@anglr/common 11.3.0-beta.20220412054621 → 11.3.0-beta.20220413080437

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.
Files changed (138) hide show
  1. package/changelog.md +39 -5
  2. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +2 -1
  3. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2015/forms/src/index.js +1 -0
  5. package/es2015/forms/src/index.js.map +1 -1
  6. package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +74 -0
  7. package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -0
  8. package/es2015/forms/src/modules/errorMessage/components/index.js +2 -0
  9. package/es2015/forms/src/modules/errorMessage/components/index.js.map +1 -0
  10. package/es2015/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js +75 -0
  11. package/es2015/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js.map +1 -0
  12. package/es2015/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.js +2 -0
  13. package/es2015/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.js.map +1 -0
  14. package/es2015/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js +27 -0
  15. package/es2015/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js.map +1 -0
  16. package/es2015/forms/src/modules/errorMessage/directives/index.js +4 -0
  17. package/es2015/forms/src/modules/errorMessage/directives/index.js.map +1 -0
  18. package/es2015/forms/src/modules/errorMessage/index.js +5 -0
  19. package/es2015/forms/src/modules/errorMessage/index.js.map +1 -0
  20. package/es2015/forms/src/modules/errorMessage/modules/errorMessage.module.js +47 -0
  21. package/es2015/forms/src/modules/errorMessage/modules/errorMessage.module.js.map +1 -0
  22. package/es2015/forms/src/modules/errorMessage/modules/index.js +2 -0
  23. package/es2015/forms/src/modules/errorMessage/modules/index.js.map +1 -0
  24. package/es2015/forms/src/modules/errorMessage/pipes/index.js +2 -0
  25. package/es2015/forms/src/modules/errorMessage/pipes/index.js.map +1 -0
  26. package/es2015/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +33 -0
  27. package/es2015/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js.map +1 -0
  28. package/es2015/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.js +16 -2
  29. package/es2015/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.js.map +1 -1
  30. package/es2015/src/modules/commonUtils.module.js +7 -3
  31. package/es2015/src/modules/commonUtils.module.js.map +1 -1
  32. package/es2015/src/modules/tooltip/components/tooltip/tooltip.component.js +4 -33
  33. package/es2015/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
  34. package/es2015/src/modules/tooltip/directives/index.js +1 -0
  35. package/es2015/src/modules/tooltip/directives/index.js.map +1 -1
  36. package/es2015/src/modules/tooltip/directives/tooltip/tooltip.directive.js +23 -5
  37. package/es2015/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
  38. package/es2015/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.js +2 -0
  39. package/es2015/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.js.map +1 -0
  40. package/es2015/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +7 -0
  41. package/es2015/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js.map +1 -1
  42. package/es2015/src/modules/tooltip/misc/tooltip.interface.js.map +1 -1
  43. package/es2015/src/pipes/index.js +1 -0
  44. package/es2015/src/pipes/index.js.map +1 -1
  45. package/es2015/src/pipes/keys/keys.pipe.js +25 -0
  46. package/es2015/src/pipes/keys/keys.pipe.js.map +1 -0
  47. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +1 -1
  48. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  49. package/es2020/forms/src/index.js +1 -0
  50. package/es2020/forms/src/index.js.map +1 -1
  51. package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +72 -0
  52. package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -0
  53. package/es2020/forms/src/modules/errorMessage/components/index.js +2 -0
  54. package/es2020/forms/src/modules/errorMessage/components/index.js.map +1 -0
  55. package/es2020/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js +74 -0
  56. package/es2020/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js.map +1 -0
  57. package/es2020/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.js +2 -0
  58. package/es2020/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.js.map +1 -0
  59. package/es2020/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js +27 -0
  60. package/es2020/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js.map +1 -0
  61. package/es2020/forms/src/modules/errorMessage/directives/index.js +4 -0
  62. package/es2020/forms/src/modules/errorMessage/directives/index.js.map +1 -0
  63. package/es2020/forms/src/modules/errorMessage/index.js +5 -0
  64. package/es2020/forms/src/modules/errorMessage/index.js.map +1 -0
  65. package/es2020/forms/src/modules/errorMessage/modules/errorMessage.module.js +47 -0
  66. package/es2020/forms/src/modules/errorMessage/modules/errorMessage.module.js.map +1 -0
  67. package/es2020/forms/src/modules/errorMessage/modules/index.js +2 -0
  68. package/es2020/forms/src/modules/errorMessage/modules/index.js.map +1 -0
  69. package/es2020/forms/src/modules/errorMessage/pipes/index.js +2 -0
  70. package/es2020/forms/src/modules/errorMessage/pipes/index.js.map +1 -0
  71. package/es2020/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +33 -0
  72. package/es2020/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js.map +1 -0
  73. package/es2020/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.js +16 -2
  74. package/es2020/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.js.map +1 -1
  75. package/es2020/src/modules/commonUtils.module.js +7 -3
  76. package/es2020/src/modules/commonUtils.module.js.map +1 -1
  77. package/es2020/src/modules/tooltip/components/tooltip/tooltip.component.js +4 -33
  78. package/es2020/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
  79. package/es2020/src/modules/tooltip/directives/index.js +1 -0
  80. package/es2020/src/modules/tooltip/directives/index.js.map +1 -1
  81. package/es2020/src/modules/tooltip/directives/tooltip/tooltip.directive.js +23 -5
  82. package/es2020/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
  83. package/es2020/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.js +2 -0
  84. package/es2020/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.js.map +1 -0
  85. package/es2020/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +7 -0
  86. package/es2020/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js.map +1 -1
  87. package/es2020/src/modules/tooltip/misc/tooltip.interface.js.map +1 -1
  88. package/es2020/src/pipes/index.js +1 -0
  89. package/es2020/src/pipes/index.js.map +1 -1
  90. package/es2020/src/pipes/keys/keys.pipe.js +25 -0
  91. package/es2020/src/pipes/keys/keys.pipe.js.map +1 -0
  92. package/forms/src/index.d.ts +1 -0
  93. package/forms/src/index.d.ts.map +1 -1
  94. package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts +50 -0
  95. package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts.map +1 -0
  96. package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html +7 -0
  97. package/forms/src/modules/errorMessage/components/index.d.ts +2 -0
  98. package/forms/src/modules/errorMessage/components/index.d.ts.map +1 -0
  99. package/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.d.ts +41 -0
  100. package/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.d.ts.map +1 -0
  101. package/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.d.ts +27 -0
  102. package/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.d.ts.map +1 -0
  103. package/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.d.ts +17 -0
  104. package/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.d.ts.map +1 -0
  105. package/forms/src/modules/errorMessage/directives/index.d.ts +4 -0
  106. package/forms/src/modules/errorMessage/directives/index.d.ts.map +1 -0
  107. package/forms/src/modules/errorMessage/index.d.ts +5 -0
  108. package/forms/src/modules/errorMessage/index.d.ts.map +1 -0
  109. package/forms/src/modules/errorMessage/modules/errorMessage.module.d.ts +16 -0
  110. package/forms/src/modules/errorMessage/modules/errorMessage.module.d.ts.map +1 -0
  111. package/forms/src/modules/errorMessage/modules/index.d.ts +2 -0
  112. package/forms/src/modules/errorMessage/modules/index.d.ts.map +1 -0
  113. package/forms/src/modules/errorMessage/pipes/index.d.ts +2 -0
  114. package/forms/src/modules/errorMessage/pipes/index.d.ts.map +1 -0
  115. package/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.d.ts +18 -0
  116. package/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.d.ts.map +1 -0
  117. package/package.json +1 -1
  118. package/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.d.ts +12 -3
  119. package/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.d.ts.map +1 -1
  120. package/src/modules/commonUtils.module.d.ts +2 -1
  121. package/src/modules/commonUtils.module.d.ts.map +1 -1
  122. package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +2 -6
  123. package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +1 -1
  124. package/src/modules/tooltip/directives/index.d.ts +1 -0
  125. package/src/modules/tooltip/directives/index.d.ts.map +1 -1
  126. package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +14 -3
  127. package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +1 -1
  128. package/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.d.ts +10 -0
  129. package/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.d.ts.map +1 -0
  130. package/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.d.ts +7 -2
  131. package/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.d.ts.map +1 -1
  132. package/src/modules/tooltip/misc/tooltip.interface.d.ts +11 -1
  133. package/src/modules/tooltip/misc/tooltip.interface.d.ts.map +1 -1
  134. package/src/pipes/index.d.ts +1 -0
  135. package/src/pipes/index.d.ts.map +1 -1
  136. package/src/pipes/keys/keys.pipe.d.ts +16 -0
  137. package/src/pipes/keys/keys.pipe.d.ts.map +1 -0
  138. package/version.bak +1 -1
@@ -0,0 +1,72 @@
1
+ import { Component, ChangeDetectionStrategy, Optional, ChangeDetectorRef, Input, ContentChild } from '@angular/core';
2
+ import { FormGroupDirective, FormGroupName } from '@angular/forms';
3
+ import { Subscription } from 'rxjs';
4
+ import { GroupErrorsTemplateDirective } from '../../directives';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/forms";
7
+ import * as i2 from "@angular/common";
8
+ import * as i3 from "../../directives/errorMessage/errorMessage.directive";
9
+ import * as i4 from "../../pipes/withErrorMessage/withErrorMessage.pipe";
10
+ import * as i5 from "../../../../../../src/pipes/keys/keys.pipe";
11
+ /**
12
+ * Component used for rendering from group errors
13
+ */
14
+ export class GroupErrorsComponent {
15
+ //######################### constructor #########################
16
+ constructor(formGroupDirective, formGroupName, _changeDetector) {
17
+ this.formGroupDirective = formGroupDirective;
18
+ this.formGroupName = formGroupName;
19
+ this._changeDetector = _changeDetector;
20
+ /**
21
+ * Subscriptions created during initialization
22
+ */
23
+ this._initSubscriptions = new Subscription();
24
+ if (!this.formGroupDirective && !this.formGroupName) {
25
+ throw new Error('There is no parent formGroup or formGroupName directive');
26
+ }
27
+ }
28
+ //######################### public properties - template bindings #########################
29
+ /**
30
+ * Gets instance of currently used form group
31
+ * @internal
32
+ */
33
+ get formGroup() {
34
+ return (this._formGroup ?? (this._formGroup = this.formGroupDirective?.form ?? this.formGroupName?.control));
35
+ }
36
+ //######################### public methods - implementation of OnInit #########################
37
+ /**
38
+ * Initialize component
39
+ */
40
+ ngOnInit() {
41
+ this._initSubscriptions.add(this.formGroup.statusChanges.subscribe(state => {
42
+ if (this._lastState != state || state == 'INVALID') {
43
+ this._lastState = state;
44
+ this._changeDetector.detectChanges();
45
+ }
46
+ }));
47
+ }
48
+ //######################### public methods - implementation of OnDestroy #########################
49
+ /**
50
+ * Called when component is destroyed
51
+ */
52
+ ngOnDestroy() {
53
+ this._initSubscriptions?.unsubscribe();
54
+ this._initSubscriptions = null;
55
+ }
56
+ }
57
+ 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
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: GroupErrorsComponent, decorators: [{
60
+ 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
+ }], ctorParameters: function () { return [{ type: i1.FormGroupDirective, decorators: [{
63
+ type: Optional
64
+ }] }, { type: i1.FormGroupName, decorators: [{
65
+ type: Optional
66
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { cssClass: [{
67
+ type: Input
68
+ }], template: [{
69
+ type: ContentChild,
70
+ args: [GroupErrorsTemplateDirective]
71
+ }] } });
72
+ //# sourceMappingURL=groupErrors.component.js.map
@@ -0,0 +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;AAOH,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,gDC1D9C,0eAMe;2FDSF,oBAAoB;kBANhC,SAAS;+BAEI,mBAAmB,mBAEZ,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 {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 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\"></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>"]}
@@ -0,0 +1,2 @@
1
+ export * from './groupErrors/groupErrors.component';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/modules/errorMessage/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC","sourcesContent":["export * from './groupErrors/groupErrors.component';\n"]}
@@ -0,0 +1,74 @@
1
+ import { Directive, ElementRef, Inject, Input } from '@angular/core';
2
+ import { STRING_LOCALIZATION } from '@anglr/common';
3
+ import { isBlank, nameof } from '@jscrpt/common';
4
+ import { Subscription } from 'rxjs';
5
+ import { VALIDATION_ERROR_MESSAGES } from '../../../../misc/types';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Directive used for displaying form error message
9
+ */
10
+ export class ErrorMessageDirective {
11
+ //######################### constructor #########################
12
+ constructor(_element, _localization, _errorMessages) {
13
+ this._element = _element;
14
+ this._localization = _localization;
15
+ this._errorMessages = _errorMessages;
16
+ //######################### protected properties #########################
17
+ /**
18
+ * Subscriptions created during initialization
19
+ */
20
+ this._initSubscriptions = new Subscription();
21
+ this._initSubscriptions.add(this._localization.textsChange.subscribe(() => this._showMessage()));
22
+ }
23
+ //######################### public methods - implementation of OnChanges #########################
24
+ /**
25
+ * Called when input value changes
26
+ */
27
+ ngOnChanges(changes) {
28
+ if (nameof('errorName') in changes) {
29
+ this._showMessage();
30
+ }
31
+ }
32
+ //######################### public methods - implementation of OnDestroy #########################
33
+ /**
34
+ * Called when component is destroyed
35
+ */
36
+ ngOnDestroy() {
37
+ this._initSubscriptions?.unsubscribe();
38
+ this._initSubscriptions = null;
39
+ }
40
+ //######################### protected methods #########################
41
+ /**
42
+ * Shows message inside of element
43
+ */
44
+ _showMessage() {
45
+ if (isBlank(this.errorName)) {
46
+ this._element.nativeElement.innerHTML = '';
47
+ return;
48
+ }
49
+ const errorMessage = this._errorMessages[this.errorName];
50
+ const message = this._localization.get(errorMessage, this.errors);
51
+ this._element.nativeElement.innerHTML = message;
52
+ }
53
+ }
54
+ ErrorMessageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageDirective, deps: [{ token: i0.ElementRef }, { token: STRING_LOCALIZATION }, { token: VALIDATION_ERROR_MESSAGES }], target: i0.ɵɵFactoryTarget.Directive });
55
+ ErrorMessageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: ErrorMessageDirective, selector: "[errorMessage]", inputs: { errorName: ["errorMessage", "errorName"], errors: "errors" }, exportAs: ["errorMessage"], usesOnChanges: true, ngImport: i0 });
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageDirective, decorators: [{
57
+ type: Directive,
58
+ args: [{
59
+ selector: '[errorMessage]',
60
+ exportAs: 'errorMessage'
61
+ }]
62
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
63
+ type: Inject,
64
+ args: [STRING_LOCALIZATION]
65
+ }] }, { type: undefined, decorators: [{
66
+ type: Inject,
67
+ args: [VALIDATION_ERROR_MESSAGES]
68
+ }] }]; }, propDecorators: { errorName: [{
69
+ type: Input,
70
+ args: ['errorMessage']
71
+ }], errors: [{
72
+ type: Input
73
+ }] } });
74
+ //# sourceMappingURL=errorMessage.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessage.directive.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAsC,MAAM,eAAe,CAAC;AACxG,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAa,OAAO,EAAE,MAAM,EAAmB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;;AAEjE;;GAEG;AAMH,MAAM,OAAO,qBAAqB;IAuB9B,iEAAiE;IACjE,YAAsB,QAAiC,EACJ,aAAiC,EAC3B,cAAgC;QAFnE,aAAQ,GAAR,QAAQ,CAAyB;QACJ,kBAAa,GAAb,aAAa,CAAoB;QAC3B,mBAAc,GAAd,cAAc,CAAkB;QAxBzF,0EAA0E;QAE1E;;WAEG;QACO,uBAAkB,GAAiB,IAAI,YAAY,EAAE,CAAC;QAqB5D,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW,CAAC,OAAsB;QAErC,IAAG,MAAM,CAAwB,WAAW,CAAC,IAAI,OAAO,EACxD;YACI,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;IACL,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACnC,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,YAAY;QAElB,IAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1B;YACI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,EAAE,CAAC;YAE3C,OAAO;SACV;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAElE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,OAAO,CAAC;IACpD,CAAC;;kHAzEQ,qBAAqB,4CAyBV,mBAAmB,aACnB,yBAAyB;sGA1BpC,qBAAqB;2FAArB,qBAAqB;kBALjC,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,cAAc;iBAC3B;;0BA0BgB,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,yBAAyB;4CAXtC,SAAS;sBADf,KAAK;uBAAC,cAAc;gBAOd,MAAM;sBADZ,KAAK","sourcesContent":["import {Directive, ElementRef, Inject, Input, OnChanges, OnDestroy, SimpleChanges} from '@angular/core';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {Dictionary, isBlank, nameof, StringDictionary} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {VALIDATION_ERROR_MESSAGES} from '../../../../misc/types';\n\n/**\n * Directive used for displaying form error message\n */\n@Directive(\n{\n selector: '[errorMessage]',\n exportAs: 'errorMessage'\n})\nexport class ErrorMessageDirective implements OnChanges, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected _initSubscriptions: Subscription = new Subscription();\n\n //######################### public properties - inputs #########################\n\n /**\n * Name/code of error message to be displayed\n */\n @Input('errorMessage')\n public errorName: string;\n\n /**\n * Object storing all errors\n */\n @Input()\n public errors: Dictionary;\n\n //######################### constructor #########################\n constructor(protected _element: ElementRef<HTMLElement>,\n @Inject(STRING_LOCALIZATION) protected _localization: StringLocalization,\n @Inject(VALIDATION_ERROR_MESSAGES) protected _errorMessages: StringDictionary,)\n {\n this._initSubscriptions.add(this._localization.textsChange.subscribe(() => this._showMessage()));\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<ErrorMessageDirective>('errorName') in changes)\n {\n this._showMessage();\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\n //######################### protected methods #########################\n\n /**\n * Shows message inside of element\n */\n protected _showMessage(): void\n {\n if(isBlank(this.errorName))\n {\n this._element.nativeElement.innerHTML = '';\n\n return;\n }\n\n const errorMessage = this._errorMessages[this.errorName];\n const message = this._localization.get(errorMessage, this.errors);\n\n this._element.nativeElement.innerHTML = message;\n }\n}"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=groupErrorsTemplate.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupErrorsTemplate.context.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.context.ts"],"names":[],"mappings":"","sourcesContent":["import {Dictionary} from '@jscrpt/common';\n\n/**\n * Context passed to template of group error\n */\nexport interface GroupErrorsTemplateContext\n{\n /**\n * Name/code of error\n */\n $implicit: string;\n\n /**\n * Indication whether rendered error is last\n */\n last: boolean;\n\n /**\n * Indication whether rendered error is first\n */\n first: boolean;\n\n /**\n * Index of currently rendered item\n */\n index: number;\n\n /**\n * Object storing all errors for form group\n */\n errors: Dictionary;\n}"]}
@@ -0,0 +1,27 @@
1
+ import { Directive, TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Obtains template for displaying form group error
5
+ */
6
+ export class GroupErrorsTemplateDirective {
7
+ //######################### constructor #########################
8
+ constructor(template) {
9
+ this.template = template;
10
+ }
11
+ //######################### ng language server #########################
12
+ /**
13
+ * Allows typechecking for template
14
+ */
15
+ static ngTemplateContextGuard(_dir, _ctx) {
16
+ return true;
17
+ }
18
+ }
19
+ GroupErrorsTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: GroupErrorsTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
20
+ GroupErrorsTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: GroupErrorsTemplateDirective, selector: "[formGroupError]", ngImport: i0 });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: GroupErrorsTemplateDirective, decorators: [{
22
+ type: Directive,
23
+ args: [{
24
+ selector: '[formGroupError]'
25
+ }]
26
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
27
+ //# sourceMappingURL=groupErrorsTemplate.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupErrorsTemplate.directive.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;;AAIrD;;GAEG;AAKH,MAAM,OAAO,4BAA4B;IAErC,iEAAiE;IACjE,YAAmB,QAAiD;QAAjD,aAAQ,GAAR,QAAQ,CAAyC;IAEpE,CAAC;IAED,wEAAwE;IAExE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAkC,EAAE,IAAa;QAE3E,OAAO,IAAI,CAAC;IAChB,CAAC;;yHAfQ,4BAA4B;6GAA5B,4BAA4B;2FAA5B,4BAA4B;kBAJxC,SAAS;mBACV;oBACI,QAAQ,EAAE,kBAAkB;iBAC/B","sourcesContent":["import {Directive, TemplateRef} from '@angular/core';\n\nimport {GroupErrorsTemplateContext} from './groupErrorsTemplate.context';\n\n/**\n * Obtains template for displaying form group error\n */\n@Directive(\n{\n selector: '[formGroupError]'\n})\nexport class GroupErrorsTemplateDirective\n{\n //######################### constructor #########################\n constructor(public template: TemplateRef<GroupErrorsTemplateContext>)\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Allows typechecking for template\n */\n static ngTemplateContextGuard(_dir: GroupErrorsTemplateDirective, _ctx: unknown): _ctx is GroupErrorsTemplateContext\n {\n return true;\n }\n}"]}
@@ -0,0 +1,4 @@
1
+ export * from './errorMessage/errorMessage.directive';
2
+ export * from './groupErrorsTemplate/groupErrorsTemplate.directive';
3
+ export * from './groupErrorsTemplate/groupErrorsTemplate.context';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/modules/errorMessage/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC","sourcesContent":["export * from './errorMessage/errorMessage.directive';\nexport * from './groupErrorsTemplate/groupErrorsTemplate.directive';\nexport * from './groupErrorsTemplate/groupErrorsTemplate.context';\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './components';
2
+ export * from './directives';
3
+ export * from './modules';
4
+ export * from './pipes';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../forms/src/modules/errorMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC","sourcesContent":["export * from './components';\nexport * from './directives';\nexport * from './modules';\nexport * from './pipes';\n"]}
@@ -0,0 +1,47 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { CommonUtilsModule } from '@anglr/common';
4
+ import { GroupErrorsComponent } from '../components';
5
+ import { ErrorMessageDirective, GroupErrorsTemplateDirective } from '../directives';
6
+ import { WithErrorMessagePipe } from '../pipes';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Module for error message directives, pipes and components
10
+ */
11
+ export class ErrorMessageModule {
12
+ }
13
+ ErrorMessageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
14
+ ErrorMessageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageModule, declarations: [WithErrorMessagePipe,
15
+ ErrorMessageDirective,
16
+ GroupErrorsTemplateDirective,
17
+ GroupErrorsComponent], imports: [CommonModule,
18
+ CommonUtilsModule], exports: [WithErrorMessagePipe,
19
+ ErrorMessageDirective,
20
+ GroupErrorsTemplateDirective,
21
+ GroupErrorsComponent] });
22
+ ErrorMessageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageModule, imports: [[
23
+ CommonModule,
24
+ CommonUtilsModule,
25
+ ]] });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ErrorMessageModule, decorators: [{
27
+ type: NgModule,
28
+ args: [{
29
+ imports: [
30
+ CommonModule,
31
+ CommonUtilsModule,
32
+ ],
33
+ declarations: [
34
+ WithErrorMessagePipe,
35
+ ErrorMessageDirective,
36
+ GroupErrorsTemplateDirective,
37
+ GroupErrorsComponent,
38
+ ],
39
+ exports: [
40
+ WithErrorMessagePipe,
41
+ ErrorMessageDirective,
42
+ GroupErrorsTemplateDirective,
43
+ GroupErrorsComponent,
44
+ ]
45
+ }]
46
+ }] });
47
+ //# sourceMappingURL=errorMessage.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessage.module.js","sourceRoot":"","sources":["../../../../../../forms/src/modules/errorMessage/modules/errorMessage.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,qBAAqB,EAAE,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;;AAE9C;;GAEG;AAuBH,MAAM,OAAO,kBAAkB;;+GAAlB,kBAAkB;gHAAlB,kBAAkB,iBAbvB,oBAAoB;QACpB,qBAAqB;QACrB,4BAA4B;QAC5B,oBAAoB,aARpB,YAAY;QACZ,iBAAiB,aAWjB,oBAAoB;QACpB,qBAAqB;QACrB,4BAA4B;QAC5B,oBAAoB;gHAGf,kBAAkB,YAnB3B;YACI,YAAY;YACZ,iBAAiB;SACpB;2FAgBQ,kBAAkB;kBAtB9B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,YAAY;wBACZ,iBAAiB;qBACpB;oBACD,YAAY,EACZ;wBACI,oBAAoB;wBACpB,qBAAqB;wBACrB,4BAA4B;wBAC5B,oBAAoB;qBACvB;oBACD,OAAO,EACP;wBACI,oBAAoB;wBACpB,qBAAqB;wBACrB,4BAA4B;wBAC5B,oBAAoB;qBACvB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {CommonUtilsModule} from '@anglr/common';\n\nimport {GroupErrorsComponent} from '../components';\nimport {ErrorMessageDirective, GroupErrorsTemplateDirective} from '../directives';\nimport {WithErrorMessagePipe} from '../pipes';\n\n/**\n * Module for error message directives, pipes and components\n */\n@NgModule(\n{\n imports:\n [\n CommonModule,\n CommonUtilsModule,\n ],\n declarations:\n [\n WithErrorMessagePipe,\n ErrorMessageDirective,\n GroupErrorsTemplateDirective,\n GroupErrorsComponent,\n ],\n exports:\n [\n WithErrorMessagePipe,\n ErrorMessageDirective,\n GroupErrorsTemplateDirective,\n GroupErrorsComponent,\n ]\n})\nexport class ErrorMessageModule\n{\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './errorMessage.module';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/modules/errorMessage/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './errorMessage.module';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './withErrorMessage/withErrorMessage.pipe';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/modules/errorMessage/pipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC","sourcesContent":["export * from './withErrorMessage/withErrorMessage.pipe';\n"]}
@@ -0,0 +1,33 @@
1
+ import { Inject, Pipe } from '@angular/core';
2
+ import { VALIDATION_ERROR_MESSAGES } from '../../../../misc/types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Filters array of errors with messages
6
+ */
7
+ export class WithErrorMessagePipe {
8
+ //######################### constructor #########################
9
+ constructor(_errorMessages) {
10
+ this._errorMessages = _errorMessages;
11
+ }
12
+ //######################### public methods - implementation of PipeTransform #########################
13
+ /**
14
+ * Filters array of errors with messages
15
+ * @param value - Array of error names
16
+ */
17
+ transform(value) {
18
+ if (!value?.length) {
19
+ return value;
20
+ }
21
+ return value.filter(itm => this._errorMessages[itm]);
22
+ }
23
+ }
24
+ WithErrorMessagePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: WithErrorMessagePipe, deps: [{ token: VALIDATION_ERROR_MESSAGES }], target: i0.ɵɵFactoryTarget.Pipe });
25
+ WithErrorMessagePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: WithErrorMessagePipe, name: "withErrorMessage" });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: WithErrorMessagePipe, decorators: [{
27
+ type: Pipe,
28
+ args: [{ name: 'withErrorMessage' }]
29
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
30
+ type: Inject,
31
+ args: [VALIDATION_ERROR_MESSAGES]
32
+ }] }]; } });
33
+ //# sourceMappingURL=withErrorMessage.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withErrorMessage.pipe.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;;AAEjE;;GAEG;AAEH,MAAM,OAAO,oBAAoB;IAE7B,iEAAiE;IACjE,YAAyD,cAAgC;QAAhC,mBAAc,GAAd,cAAc,CAAkB;IAEzF,CAAC;IAED,sGAAsG;IAEtG;;;OAGG;IACI,SAAS,CAAC,KAAe;QAE5B,IAAG,CAAC,KAAK,EAAE,MAAM,EACjB;YACI,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;;iHArBQ,oBAAoB,kBAGT,yBAAyB;+GAHpC,oBAAoB;2FAApB,oBAAoB;kBADhC,IAAI;mBAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC;;0BAIf,MAAM;2BAAC,yBAAyB","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {StringDictionary} from '@jscrpt/common';\n\nimport {VALIDATION_ERROR_MESSAGES} from '../../../../misc/types';\n\n/**\n * Filters array of errors with messages\n */\n@Pipe({name: 'withErrorMessage'})\nexport class WithErrorMessagePipe implements PipeTransform\n{\n //######################### constructor #########################\n constructor(@Inject(VALIDATION_ERROR_MESSAGES) protected _errorMessages: StringDictionary)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Filters array of errors with messages\n * @param value - Array of error names\n */\n public transform(value: string[]): string[]\n {\n if(!value?.length)\n {\n return value;\n }\n\n return value.filter(itm => this._errorMessages[itm]);\n }\n}"]}
@@ -1,6 +1,6 @@
1
1
  import { Directive, Input, EventEmitter, Output, ElementRef, Inject } from '@angular/core';
2
2
  import { DOCUMENT } from '@angular/common';
3
- import { isDescendant } from '@jscrpt/common';
3
+ import { isDescendant, isString } from '@jscrpt/common';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Directive that handles click outside of element
@@ -15,7 +15,7 @@ export class ClickOutsideDirective {
15
15
  * Used for emitting event when click outside occurs
16
16
  */
17
17
  this.clickOutsideConditionChange = new EventEmitter();
18
- //######################### private methods #########################
18
+ //######################### protected methods #########################
19
19
  /**
20
20
  * Handles click outside of element
21
21
  * @param event - Mouse event object
@@ -30,6 +30,20 @@ export class ClickOutsideDirective {
30
30
  }
31
31
  };
32
32
  }
33
+ //######################### public properties - inputs #########################
34
+ /**
35
+ * Variable that is used for displaying element that handles click outside
36
+ */
37
+ get clickOutsideCondition() {
38
+ return this._clickOutsideCondition;
39
+ }
40
+ set clickOutsideCondition(value) {
41
+ if (isString(value) && value === '') {
42
+ this._clickOutsideCondition = true;
43
+ return;
44
+ }
45
+ this._clickOutsideCondition = value;
46
+ }
33
47
  //######################### public methods - implementation of OnInit #########################
34
48
  /**
35
49
  * Initialize component
@@ -1 +1 @@
1
- {"version":3,"file":"clickOutside.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/clickOutside/directives/clickOutside/clickOutside.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAqB,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;;AAE5C;;GAEG;AAKH,MAAM,OAAO,qBAAqB;IAwB9B,iEAAiE;IACjE,YAAoB,QAAiC,EACf,SAAmB;QADrC,aAAQ,GAAR,QAAQ,CAAyB;QACf,cAAS,GAAT,SAAS,CAAU;QAVzD,iFAAiF;QAEjF;;WAEG;QAEI,gCAA2B,GAA0B,IAAI,YAAY,EAAW,CAAC;QA4BxF,qEAAqE;QAErE;;;WAGG;QACO,wBAAmB,GAAG,CAAC,KAAiB,EAAE,EAAE;YAElD,IAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,IAAI,KAAK,CAAC,MAAM;gBAC3C,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,MAAqB,CAAC;gBACvE,CAAC,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,KAAK,CAAC,MAAM;oBACxC,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,MAAqB,CAAC,CAAC,CAAC,EACxG;gBACI,IAAI,CAAC,qBAAqB,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC;gBACzD,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;aACrE;QACL,CAAC,CAAA;IAtCD,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACzE,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC5E,CAAC;;kHAhDQ,qBAAqB,4CA0BV,QAAQ;sGA1BnB,qBAAqB;2FAArB,qBAAqB;kBAJjC,SAAS;mBACN;oBACI,QAAQ,EAAE,gBAAgB;iBAC7B;mFA2BgD,QAAQ;0BAA5C,MAAM;2BAAC,QAAQ;4CAlBrB,qBAAqB;sBAD3B,KAAK;uBAAC,cAAc;gBAOd,mBAAmB;sBADzB,KAAK;gBASC,2BAA2B;sBADjC,MAAM;uBAAC,oBAAoB","sourcesContent":["import {Directive, OnInit, OnDestroy, Input, EventEmitter, Output, ElementRef, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {isDescendant} from '@jscrpt/common';\n\n/**\n * Directive that handles click outside of element\n */\n@Directive(\n {\n selector: '[clickOutside]'\n })\nexport class ClickOutsideDirective implements OnInit, OnDestroy\n{\n //######################### public properties - inputs #########################\n\n /**\n * Variable that is used for displaying element that handles click outside\n */\n @Input('clickOutside')\n public clickOutsideCondition: boolean;\n\n /**\n * Additional element that is checked for click\n */\n @Input()\n public clickOutsideElement: HTMLElement;\n\n //######################### public properties - outputs #########################\n\n /**\n * Used for emitting event when click outside occurs\n */\n @Output('clickOutsideChange')\n public clickOutsideConditionChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) private _document: Document)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._document.addEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### private methods #########################\n\n /**\n * Handles click outside of element\n * @param event - Mouse event object\n */\n protected _handleClickOutside = (event: MouseEvent) =>\n {\n if(this._element.nativeElement != event.target &&\n !isDescendant(this._element.nativeElement, event.target as HTMLElement) &&\n (!this.clickOutsideElement || (this.clickOutsideElement != event.target &&\n !isDescendant(this.clickOutsideElement, event.target as HTMLElement))))\n { \n this.clickOutsideCondition = !this.clickOutsideCondition;\n this.clickOutsideConditionChange.emit(this.clickOutsideCondition);\n }\n }\n}"]}
1
+ {"version":3,"file":"clickOutside.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/clickOutside/directives/clickOutside/clickOutside.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAqB,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAEtD;;GAEG;AAKH,MAAM,OAAO,qBAAqB;IA6C9B,iEAAiE;IACjE,YAAsB,QAAiC,EACf,SAAmB;QADrC,aAAQ,GAAR,QAAQ,CAAyB;QACf,cAAS,GAAT,SAAS,CAAU;QAV3D,iFAAiF;QAEjF;;WAEG;QAEI,gCAA2B,GAA0B,IAAI,YAAY,EAAW,CAAC;QA4BxF,uEAAuE;QAEvE;;;WAGG;QACO,wBAAmB,GAAG,CAAC,KAAiB,EAAE,EAAE;YAElD,IAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,IAAI,KAAK,CAAC,MAAM;gBAC3C,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,MAAqB,CAAC;gBACvE,CAAC,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,KAAK,CAAC,MAAM;oBACxC,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,MAAqB,CAAC,CAAC,CAAC,EACxG;gBACI,IAAI,CAAC,qBAAqB,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC;gBACzD,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;aACrE;QACL,CAAC,CAAA;IAtCD,CAAC;IAxCD,gFAAgF;IAEhF;;OAEG;IACH,IACW,qBAAqB;QAE5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IACD,IAAW,qBAAqB,CAAC,KAAc;QAE3C,IAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,EAClC;YACI,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;YAEnC,OAAO;SACV;QAED,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;IACxC,CAAC;IAsBD,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACzE,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC5E,CAAC;;kHArEQ,qBAAqB,4CA+CV,QAAQ;sGA/CnB,qBAAqB;2FAArB,qBAAqB;kBAJjC,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;iBAC7B;mFAgDsD,QAAQ;0BAA9C,MAAM;2BAAC,QAAQ;4CAhCjB,qBAAqB;sBAD/B,KAAK;uBAAC,cAAc;gBAqBd,mBAAmB;sBADzB,KAAK;gBASC,2BAA2B;sBADjC,MAAM;uBAAC,oBAAoB","sourcesContent":["import {Directive, OnInit, OnDestroy, Input, EventEmitter, Output, ElementRef, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {isDescendant, isString} from '@jscrpt/common';\n\n/**\n * Directive that handles click outside of element\n */\n@Directive(\n{\n selector: '[clickOutside]'\n})\nexport class ClickOutsideDirective implements OnInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Variable that is used for displaying element that handles click outside\n */\n protected _clickOutsideCondition: boolean;\n\n //######################### public properties - inputs #########################\n\n /**\n * Variable that is used for displaying element that handles click outside\n */\n @Input('clickOutside')\n public get clickOutsideCondition(): boolean\n {\n return this._clickOutsideCondition;\n }\n public set clickOutsideCondition(value: boolean)\n {\n if(isString(value) && value === '')\n {\n this._clickOutsideCondition = true;\n\n return;\n }\n\n this._clickOutsideCondition = value;\n }\n\n /**\n * Additional element that is checked for click\n */\n @Input()\n public clickOutsideElement: HTMLElement;\n\n //######################### public properties - outputs #########################\n\n /**\n * Used for emitting event when click outside occurs\n */\n @Output('clickOutsideChange')\n public clickOutsideConditionChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n //######################### constructor #########################\n constructor(protected _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) protected _document: Document)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._document.addEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._document.removeEventListener('mouseup', this._handleClickOutside);\n }\n\n //######################### protected methods #########################\n\n /**\n * Handles click outside of element\n * @param event - Mouse event object\n */\n protected _handleClickOutside = (event: MouseEvent) =>\n {\n if(this._element.nativeElement != event.target &&\n !isDescendant(this._element.nativeElement, event.target as HTMLElement) &&\n (!this.clickOutsideElement || (this.clickOutsideElement != event.target &&\n !isDescendant(this.clickOutsideElement, event.target as HTMLElement))))\n { \n this.clickOutsideCondition = !this.clickOutsideCondition;\n this.clickOutsideConditionChange.emit(this.clickOutsideCondition);\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `clickOutsideCondition` input\n */\n public static ngAcceptInputType_clickOutsideCondition: boolean|'';\n}"]}
@@ -1,5 +1,5 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { IsNaNPipe, IsPresentPipe, UrlEncodePipe, MergeCssClassesPipe } from '../pipes';
2
+ import { IsNaNPipe, IsPresentPipe, UrlEncodePipe, MergeCssClassesPipe, KeysPipe } from '../pipes';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Module for common utility stuff
@@ -10,10 +10,12 @@ CommonUtilsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
10
10
  CommonUtilsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: CommonUtilsModule, declarations: [IsNaNPipe,
11
11
  IsPresentPipe,
12
12
  UrlEncodePipe,
13
- MergeCssClassesPipe], exports: [IsNaNPipe,
13
+ MergeCssClassesPipe,
14
+ KeysPipe], exports: [IsNaNPipe,
14
15
  IsPresentPipe,
15
16
  UrlEncodePipe,
16
- MergeCssClassesPipe] });
17
+ MergeCssClassesPipe,
18
+ KeysPipe] });
17
19
  CommonUtilsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: CommonUtilsModule });
18
20
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: CommonUtilsModule, decorators: [{
19
21
  type: NgModule,
@@ -23,12 +25,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
23
25
  IsPresentPipe,
24
26
  UrlEncodePipe,
25
27
  MergeCssClassesPipe,
28
+ KeysPipe,
26
29
  ],
27
30
  exports: [
28
31
  IsNaNPipe,
29
32
  IsPresentPipe,
30
33
  UrlEncodePipe,
31
34
  MergeCssClassesPipe,
35
+ KeysPipe,
32
36
  ]
33
37
  }]
34
38
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,UAAU,CAAC;;AAEtF;;GAEG;AAkBH,MAAM,OAAO,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAbtB,SAAS;QACT,aAAa;QACb,aAAa;QACb,mBAAmB,aAInB,SAAS;QACT,aAAa;QACb,aAAa;QACb,mBAAmB;+GAGd,iBAAiB;2FAAjB,iBAAiB;kBAjB7B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,SAAS;wBACT,aAAa;wBACb,aAAa;wBACb,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,SAAS;wBACT,aAAa;wBACb,aAAa;wBACb,mBAAmB;qBACtB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {IsNaNPipe, IsPresentPipe, UrlEncodePipe, MergeCssClassesPipe} from '../pipes';\n\n/**\n * Module for common utility stuff\n */\n@NgModule(\n{\n declarations:\n [\n IsNaNPipe,\n IsPresentPipe,\n UrlEncodePipe,\n MergeCssClassesPipe,\n ],\n exports: \n [\n IsNaNPipe,\n IsPresentPipe,\n UrlEncodePipe,\n MergeCssClassesPipe,\n ]\n})\nexport class CommonUtilsModule\n{\n}"]}
1
+ {"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;;AAEhG;;GAEG;AAoBH,MAAM,OAAO,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAftB,SAAS;QACT,aAAa;QACb,aAAa;QACb,mBAAmB;QACnB,QAAQ,aAIR,SAAS;QACT,aAAa;QACb,aAAa;QACb,mBAAmB;QACnB,QAAQ;+GAGH,iBAAiB;2FAAjB,iBAAiB;kBAnB7B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,SAAS;wBACT,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,QAAQ;qBACX;oBACD,OAAO,EACP;wBACI,SAAS;wBACT,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,QAAQ;qBACX;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {IsNaNPipe, IsPresentPipe, UrlEncodePipe, MergeCssClassesPipe, KeysPipe} from '../pipes';\n\n/**\n * Module for common utility stuff\n */\n@NgModule(\n{\n declarations:\n [\n IsNaNPipe,\n IsPresentPipe,\n UrlEncodePipe,\n MergeCssClassesPipe,\n KeysPipe,\n ],\n exports: \n [\n IsNaNPipe,\n IsPresentPipe,\n UrlEncodePipe,\n MergeCssClassesPipe,\n KeysPipe,\n ]\n})\nexport class CommonUtilsModule\n{\n}"]}
@@ -1,6 +1,4 @@
1
- import { Component, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding, ElementRef, HostListener } from '@angular/core';
2
- import { transition, trigger, useAnimation } from '@angular/animations';
3
- import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
1
+ import { Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, HostListener } from '@angular/core';
4
2
  import * as i0 from "@angular/core";
5
3
  import * as i1 from "@angular/common";
6
4
  /**
@@ -24,12 +22,6 @@ export class TooltipComponent {
24
22
  * Indication whether are html tags allowed in tooltip text
25
23
  */
26
24
  this.allowHtml = false;
27
- //######################### public properties - host #########################
28
- /**
29
- * Attach fade in/out animation to element
30
- * @internal
31
- */
32
- this.animation = true;
33
25
  }
34
26
  //######################### public methods - implementation of TooltipRenderer #########################
35
27
  /**
@@ -67,32 +59,11 @@ export class TooltipComponent {
67
59
  }
68
60
  }
69
61
  TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
70
- TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: TooltipComponent, selector: "tooltip-popup", host: { listeners: { "mouseenter": "mouseEnter()", "mouseleave": "mouseLeave()" }, properties: { "@fadeInOut": "this.animation" } }, ngImport: i0, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
71
- trigger('fadeInOut', [
72
- transition(':enter', [
73
- useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
74
- ]),
75
- transition(':leave', [
76
- useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
77
- ])
78
- ])
79
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
62
+ TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: TooltipComponent, selector: "tooltip-popup", host: { listeners: { "mouseenter": "mouseEnter()", "mouseleave": "mouseLeave()" } }, ngImport: i0, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
80
63
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, decorators: [{
81
64
  type: Component,
82
- args: [{ selector: 'tooltip-popup', animations: [
83
- trigger('fadeInOut', [
84
- transition(':enter', [
85
- useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
86
- ]),
87
- transition(':leave', [
88
- useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
89
- ])
90
- ])
91
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"] }]
92
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { animation: [{
93
- type: HostBinding,
94
- args: ['@fadeInOut']
95
- }], mouseEnter: [{
65
+ args: [{ selector: 'tooltip-popup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"] }]
66
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { mouseEnter: [{
96
67
  type: HostListener,
97
68
  args: ['mouseenter']
98
69
  }], mouseLeave: [{
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;;;AAIpE;;GAEG;AAsBH,MAAM,OAAO,gBAAgB;IA6CzB,iEAAiE;IACjE,YAAsB,eAAkC,EAClC,QAAiC;QADjC,oBAAe,GAAf,eAAe,CAAmB;QAClC,aAAQ,GAAR,QAAQ,CAAyB;QA7CvD,sEAAsE;QAEtE;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAE5C;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAc5C;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;QAOlC,8EAA8E;QAE9E;;;WAGG;QAEI,cAAS,GAAY,IAAI,CAAC;IAMjC,CAAC;IAED,wGAAwG;IAExG;;;;OAIG;IACI,mBAAmB,CAAC,KAAiB,EAAE,KAAiB;QAE3D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAG,IAAI,CAAC,QAAQ,EAChB;YACI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC5D;QAED,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,2EAA2E;IAE3E;;;OAGG;IAEI,UAAU;QAEb,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IAEI,UAAU;QAEb,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;;6GAjGQ,gBAAgB;iGAAhB,gBAAgB,0LC9B7B,uRAKc,obDUV;QACI,OAAO,CAAC,WAAW,EACnB;YACI,UAAU,CAAC,QAAQ,EACnB;gBACI,YAAY,CAAC,eAAe,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAC,CAAC;aAC/D,CAAC;YACF,UAAU,CAAC,QAAQ,EACnB;gBACI,YAAY,CAAC,gBAAgB,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAC,CAAC;aAChE,CAAC;SACL,CAAC;KACL;2FAGQ,gBAAgB;kBArB5B,SAAS;+BAEI,eAAe,cAIzB;wBACI,OAAO,CAAC,WAAW,EACnB;4BACI,UAAU,CAAC,QAAQ,EACnB;gCACI,YAAY,CAAC,eAAe,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAC,CAAC;6BAC/D,CAAC;4BACF,UAAU,CAAC,QAAQ,EACnB;gCACI,YAAY,CAAC,gBAAgB,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAC,CAAC;6BAChE,CAAC;yBACL,CAAC;qBACL,mBACgB,uBAAuB,CAAC,MAAM;iIA6CxC,SAAS;sBADf,WAAW;uBAAC,YAAY;gBA0ClB,UAAU;sBADhB,YAAY;uBAAC,YAAY;gBAWnB,UAAU;sBADhB,YAAY;uBAAC,YAAY","sourcesContent":["import {Component, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, HostBinding, ElementRef, HostListener} from '@angular/core';\nimport {transition, trigger, useAnimation} from '@angular/animations';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\n\nimport {TooltipRenderer} from '../../misc/tooltip.interface';\n\n/**\n * Component used for displaying tooltip content\n */\n@Component(\n{\n selector: 'tooltip-popup',\n templateUrl: 'tooltip.component.html',\n styleUrls: ['tooltip.component.css'],\n animations:\n [\n trigger('fadeInOut',\n [\n transition(':enter', \n [\n useAnimation(fadeInAnimation, {params: {duration: '260ms'}})\n ]),\n transition(':leave', \n [\n useAnimation(fadeOutAnimation, {params: {duration: '260ms'}})\n ])\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TooltipComponent<TData = any> implements TooltipRenderer<TData>\n{\n //######################### protected fields #########################\n\n /**\n * Called when mouse enter tooltip component, hover\n */\n protected _enterFn: () => void = () => null;\n\n /**\n * Called when mouse leaves tooltip component\n */\n protected _leaveFn: () => void = () => null;\n\n //######################### public properties - implementation of TooltipRenderer #########################\n\n /**\n * Data that are rendered in tooltip\n */\n public data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n public template: TemplateRef<TData>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n public allowHtml: boolean = false;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n public cssClass: string|null|undefined;\n\n //######################### public properties - host #########################\n\n /**\n * Attach fade in/out animation to element\n * @internal\n */\n @HostBinding('@fadeInOut')\n public animation: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of TooltipRenderer #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n public registerHoverEvents(enter: () => void, leave: () => void): void\n {\n this._enterFn = enter;\n this._leaveFn = leave;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n if(this.cssClass)\n {\n this._element.nativeElement.classList.add(this.cssClass);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse enter event over tooltip\n * @internal\n */\n @HostListener('mouseenter')\n public mouseEnter(): void\n {\n this._enterFn();\n }\n\n /**\n * Handles mouse leave event over tooltip\n * @internal\n */\n @HostListener('mouseleave')\n public mouseLeave(): void\n {\n this._leaveFn();\n }\n}","<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>"]}
1
+ {"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;;;AAK3H;;GAEG;AAQH,MAAM,OAAO,gBAAgB;IAoCzB,iEAAiE;IACjE,YAAsB,eAAkC,EAClC,QAAiC;QADjC,oBAAe,GAAf,eAAe,CAAmB;QAClC,aAAQ,GAAR,QAAQ,CAAyB;QApCvD,sEAAsE;QAEtE;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAE5C;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAc5C;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;IAWlC,CAAC;IAED,wGAAwG;IAExG;;;;OAIG;IACI,mBAAmB,CAAC,KAAiB,EAAE,KAAiB;QAE3D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAG,IAAI,CAAC,QAAQ,EAChB;YACI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC5D;QAED,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,2EAA2E;IAE3E;;;OAGG;IAEI,UAAU;QAEb,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IAEI,UAAU;QAEb,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;;6GAxFQ,gBAAgB;iGAAhB,gBAAgB,0ICf7B,uRAKc;2FDUD,gBAAgB;kBAP5B,SAAS;+BAEI,eAAe,mBAGR,uBAAuB,CAAC,MAAM;iIA6ExC,UAAU;sBADhB,YAAY;uBAAC,YAAY;gBAWnB,UAAU;sBADhB,YAAY;uBAAC,YAAY","sourcesContent":["import {Component, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, ElementRef, HostListener} from '@angular/core';\n\nimport {TooltipTemplateContext} from '../../directives';\nimport {TooltipRenderer} from '../../misc/tooltip.interface';\n\n/**\n * Component used for displaying tooltip content\n */\n@Component(\n{\n selector: 'tooltip-popup',\n templateUrl: 'tooltip.component.html',\n styleUrls: ['tooltip.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TooltipComponent<TData = any> implements TooltipRenderer<TData>\n{\n //######################### protected fields #########################\n\n /**\n * Called when mouse enter tooltip component, hover\n */\n protected _enterFn: () => void = () => null;\n\n /**\n * Called when mouse leaves tooltip component\n */\n protected _leaveFn: () => void = () => null;\n\n //######################### public properties - implementation of TooltipRenderer #########################\n\n /**\n * Data that are rendered in tooltip\n */\n public data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n public template: TemplateRef<TooltipTemplateContext<TData>>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n public allowHtml: boolean = false;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n public cssClass: string|null|undefined;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of TooltipRenderer #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n public registerHoverEvents(enter: () => void, leave: () => void): void\n {\n this._enterFn = enter;\n this._leaveFn = leave;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n if(this.cssClass)\n {\n this._element.nativeElement.classList.add(this.cssClass);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse enter event over tooltip\n * @internal\n */\n @HostListener('mouseenter')\n public mouseEnter(): void\n {\n this._enterFn();\n }\n\n /**\n * Handles mouse leave event over tooltip\n * @internal\n */\n @HostListener('mouseleave')\n public mouseLeave(): void\n {\n this._leaveFn();\n }\n}","<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>"]}
@@ -1,3 +1,4 @@
1
1
  export * from './tooltip/tooltip.directive';
2
2
  export * from './tooltipTemplate/tooltipTemplate.directive';
3
+ export * from './tooltipTemplate/tooltipTemplate.context';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC","sourcesContent":["export * from './tooltip/tooltip.directive';\nexport * from './tooltipTemplate/tooltipTemplate.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC","sourcesContent":["export * from './tooltip/tooltip.directive';\nexport * from './tooltipTemplate/tooltipTemplate.directive';\nexport * from './tooltipTemplate/tooltipTemplate.context';\n"]}