@anglr/common 12.0.0-beta.20220413122054 → 12.0.0-beta.20220419062525

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 (165) hide show
  1. package/changelog.md +64 -2
  2. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
  3. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +43 -0
  5. package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -0
  6. package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +75 -0
  7. package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -0
  8. package/es2015/forms/src/components/index.js +4 -0
  9. package/es2015/forms/src/components/index.js.map +1 -0
  10. package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
  11. package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
  12. package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
  13. package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
  14. package/es2015/forms/src/directives/hasError/hasError.directive.js +38 -8
  15. package/es2015/forms/src/directives/hasError/hasError.directive.js.map +1 -1
  16. package/es2015/forms/src/directives/index.js +3 -0
  17. package/es2015/forms/src/directives/index.js.map +1 -0
  18. package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
  19. package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
  20. package/es2015/forms/src/index.js +3 -0
  21. package/es2015/forms/src/index.js.map +1 -1
  22. package/es2015/forms/src/misc/tokens.js +4 -0
  23. package/es2015/forms/src/misc/tokens.js.map +1 -1
  24. package/es2015/forms/src/misc/validationErrorsContainerView.js +31 -0
  25. package/es2015/forms/src/misc/validationErrorsContainerView.js.map +1 -0
  26. package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
  27. package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
  28. package/es2015/forms/src/modules/hasError.module.js +27 -5
  29. package/es2015/forms/src/modules/hasError.module.js.map +1 -1
  30. package/es2015/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +1 -1
  31. package/es2015/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js.map +1 -1
  32. package/es2015/forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.js.map +1 -1
  33. package/es2015/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +31 -145
  34. package/es2015/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js.map +1 -1
  35. package/es2015/positions/src/index.js +0 -7
  36. package/es2015/positions/src/index.js.map +1 -1
  37. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
  38. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  39. package/es2015/src/services/position/position.interface.js.map +1 -1
  40. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
  41. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  42. package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +43 -0
  43. package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -0
  44. package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +75 -0
  45. package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -0
  46. package/es2020/forms/src/components/index.js +4 -0
  47. package/es2020/forms/src/components/index.js.map +1 -0
  48. package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
  49. package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
  50. package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
  51. package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
  52. package/es2020/forms/src/directives/hasError/hasError.directive.js +37 -8
  53. package/es2020/forms/src/directives/hasError/hasError.directive.js.map +1 -1
  54. package/es2020/forms/src/directives/index.js +3 -0
  55. package/es2020/forms/src/directives/index.js.map +1 -0
  56. package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
  57. package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
  58. package/es2020/forms/src/index.js +3 -0
  59. package/es2020/forms/src/index.js.map +1 -1
  60. package/es2020/forms/src/misc/tokens.js +4 -0
  61. package/es2020/forms/src/misc/tokens.js.map +1 -1
  62. package/es2020/forms/src/misc/validationErrorsContainerView.js +31 -0
  63. package/es2020/forms/src/misc/validationErrorsContainerView.js.map +1 -0
  64. package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
  65. package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
  66. package/es2020/forms/src/modules/hasError.module.js +27 -5
  67. package/es2020/forms/src/modules/hasError.module.js.map +1 -1
  68. package/es2020/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +1 -1
  69. package/es2020/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js.map +1 -1
  70. package/es2020/forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.js.map +1 -1
  71. package/es2020/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +31 -143
  72. package/es2020/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js.map +1 -1
  73. package/es2020/positions/src/index.js +0 -7
  74. package/es2020/positions/src/index.js.map +1 -1
  75. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
  76. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  77. package/es2020/src/services/position/position.interface.js.map +1 -1
  78. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  79. package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.css +4 -0
  80. package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts +32 -0
  81. package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -0
  82. package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.html +3 -0
  83. package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.css +4 -0
  84. package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.d.ts +51 -0
  85. package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.d.ts.map +1 -0
  86. package/forms/src/components/index.d.ts +4 -0
  87. package/forms/src/components/index.d.ts.map +1 -0
  88. package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.css +4 -0
  89. package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts +53 -0
  90. package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts.map +1 -0
  91. package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html +3 -0
  92. package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts +10 -0
  93. package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts.map +1 -0
  94. package/forms/src/directives/hasError/hasError.directive.d.ts +21 -6
  95. package/forms/src/directives/hasError/hasError.directive.d.ts.map +1 -1
  96. package/forms/src/directives/index.d.ts +3 -0
  97. package/forms/src/directives/index.d.ts.map +1 -0
  98. package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts +12 -0
  99. package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts.map +1 -0
  100. package/forms/src/index.d.ts +3 -0
  101. package/forms/src/index.d.ts.map +1 -1
  102. package/forms/src/misc/tokens.d.ts +5 -0
  103. package/forms/src/misc/tokens.d.ts.map +1 -1
  104. package/forms/src/misc/validationErrorsContainerView.d.ts +25 -0
  105. package/forms/src/misc/validationErrorsContainerView.d.ts.map +1 -0
  106. package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts.map +1 -1
  107. package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html +1 -1
  108. package/forms/src/modules/hasError.module.d.ts +7 -1
  109. package/forms/src/modules/hasError.module.d.ts.map +1 -1
  110. package/forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.d.ts +43 -12
  111. package/forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.d.ts.map +1 -1
  112. package/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.d.ts +15 -63
  113. package/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.d.ts.map +1 -1
  114. package/package.json +3 -3
  115. package/positions/src/index.d.ts +0 -7
  116. package/positions/src/index.d.ts.map +1 -1
  117. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +6 -2
  118. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -1
  119. package/src/services/position/position.interface.d.ts +4 -0
  120. package/src/services/position/position.interface.d.ts.map +1 -1
  121. package/version.bak +1 -1
  122. package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
  123. package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
  124. package/es2015/positions/src/modules/positions/modules/positions.module.js +0 -24
  125. package/es2015/positions/src/modules/positions/modules/positions.module.js.map +0 -1
  126. package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
  127. package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
  128. package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -230
  129. package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
  130. package/es2015/positions/src/modules/tooltip/misc/tokens.js +0 -6
  131. package/es2015/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
  132. package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
  133. package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
  134. package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
  135. package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
  136. package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
  137. package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
  138. package/es2020/positions/src/modules/positions/modules/positions.module.js +0 -24
  139. package/es2020/positions/src/modules/positions/modules/positions.module.js.map +0 -1
  140. package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
  141. package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
  142. package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -229
  143. package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
  144. package/es2020/positions/src/modules/tooltip/misc/tokens.js +0 -6
  145. package/es2020/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
  146. package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
  147. package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
  148. package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
  149. package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
  150. package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts +0 -34
  151. package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts.map +0 -1
  152. package/positions/src/modules/positions/modules/positions.module.d.ts +0 -11
  153. package/positions/src/modules/positions/modules/positions.module.d.ts.map +0 -1
  154. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.css +0 -10
  155. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +0 -63
  156. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +0 -1
  157. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.html +0 -6
  158. package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +0 -106
  159. package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +0 -1
  160. package/positions/src/modules/tooltip/misc/tokens.d.ts +0 -7
  161. package/positions/src/modules/tooltip/misc/tokens.d.ts.map +0 -1
  162. package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts +0 -71
  163. package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts.map +0 -1
  164. package/positions/src/modules/tooltip/modules/tooltip.module.d.ts +0 -13
  165. package/positions/src/modules/tooltip/modules/tooltip.module.d.ts.map +0 -1
@@ -1,6 +1,9 @@
1
1
  import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { HasErrorDirective } from '../directives/hasError/hasError.directive';
3
4
  import { GroupHasErrorDirective } from '../directives/groupHasError/groupHasError.directive';
5
+ import { GroupHasErrorContainerDirective, ValidationErrorsContainerDirective } from '../directives';
6
+ import { DefaultValidationErrorsComponent, DefaultValidationErrorsContainerComponent, ReservedSpaceValidationErrorsContainerComponent } from '../components';
4
7
  import * as i0 from "@angular/core";
5
8
  /**
6
9
  * Module for input validation directives
@@ -9,19 +12,38 @@ export class HasErrorModule {
9
12
  }
10
13
  HasErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11
14
  HasErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, declarations: [HasErrorDirective,
12
- GroupHasErrorDirective], exports: [HasErrorDirective,
13
- GroupHasErrorDirective] });
14
- HasErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule });
15
+ GroupHasErrorDirective,
16
+ GroupHasErrorContainerDirective,
17
+ ValidationErrorsContainerDirective,
18
+ DefaultValidationErrorsComponent,
19
+ DefaultValidationErrorsContainerComponent,
20
+ ReservedSpaceValidationErrorsContainerComponent], imports: [CommonModule], exports: [HasErrorDirective,
21
+ GroupHasErrorDirective,
22
+ GroupHasErrorContainerDirective,
23
+ ValidationErrorsContainerDirective] });
24
+ HasErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, imports: [[
25
+ CommonModule,
26
+ ]] });
15
27
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, decorators: [{
16
28
  type: NgModule,
17
29
  args: [{
30
+ imports: [
31
+ CommonModule,
32
+ ],
18
33
  declarations: [
19
34
  HasErrorDirective,
20
- GroupHasErrorDirective
35
+ GroupHasErrorDirective,
36
+ GroupHasErrorContainerDirective,
37
+ ValidationErrorsContainerDirective,
38
+ DefaultValidationErrorsComponent,
39
+ DefaultValidationErrorsContainerComponent,
40
+ ReservedSpaceValidationErrorsContainerComponent,
21
41
  ],
22
42
  exports: [
23
43
  HasErrorDirective,
24
- GroupHasErrorDirective
44
+ GroupHasErrorDirective,
45
+ GroupHasErrorContainerDirective,
46
+ ValidationErrorsContainerDirective,
25
47
  ]
26
48
  }]
27
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;AAEvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,qDAAqD,CAAC;;AAE3F;;GAEG;AAcH,MAAM,OAAO,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBATnB,iBAAiB;QACjB,sBAAsB,aAItB,iBAAiB;QACjB,sBAAsB;4GAGjB,cAAc;2FAAd,cAAc;kBAb1B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,iBAAiB;wBACjB,sBAAsB;qBACzB;oBACD,OAAO,EACP;wBACI,iBAAiB;wBACjB,sBAAsB;qBACzB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {HasErrorDirective} from '../directives/hasError/hasError.directive';\nimport {GroupHasErrorDirective} from '../directives/groupHasError/groupHasError.directive';\n\n/**\n * Module for input validation directives\n */\n@NgModule(\n{\n declarations: \n [\n HasErrorDirective,\n GroupHasErrorDirective\n ],\n exports: \n [\n HasErrorDirective,\n GroupHasErrorDirective\n ]\n})\nexport class HasErrorModule\n{\n}"]}
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}"]}
@@ -38,7 +38,7 @@ export class ErrorMessagesExtractor {
38
38
  return null;
39
39
  }
40
40
  const result = {
41
- errors: Object.keys(control.errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) >= 0),
41
+ errors: Object.keys(control.errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) < 0),
42
42
  errorMessages: []
43
43
  };
44
44
  result.errors.forEach(error => {
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessagesExtractor.service.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0BAChC,MAAM;2BAAC,yBAAyB;;0BAAG,QAAQ","sourcesContent":["import {Injectable, Inject, Optional} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {StringDictionary, extend, isString} from '@jscrpt/common';\n\nimport {IGNORED_VALIDATION_ERRORS, VALIDATION_ERROR_MESSAGES} from '../../misc/tokens';\nimport {ValidationErrorsResult} from './errorMessagesExtractor.interface';\n\n/**\n * Default error messages displayed\n */\nconst defaultErrorMessages: StringDictionary =\n{\n required: 'Field is required.',\n number: 'Value must be number.',\n pattern: 'Value is not valid.',\n minValue: 'Value is too small.',\n maxValue: 'Value is too big.',\n minlength: 'Value is short.',\n maxlength: 'Value is too long.'\n};\n\n/**\n * Service used for extracting error messages from form control\n */\n@Injectable({providedIn: 'root'})\nexport class ErrorMessagesExtractor\n{\n //######################### protected fields #########################\n\n /**\n * Dictionary with error names that have defined message\n */\n protected _errorMessages: StringDictionary;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n @Inject(IGNORED_VALIDATION_ERRORS) protected _ignoredValidationErrors: string[],\n @Inject(VALIDATION_ERROR_MESSAGES) @Optional() globalErrorMessages?: StringDictionary)\n {\n this._errorMessages = extend(true, {}, defaultErrorMessages, globalErrorMessages);\n }\n\n //######################### public methods #########################\n\n /**\n * Gets validation errors result for provided control, or null of no errors are present\n * @param control - Form control instance that should be inspected for errors\n * @param messages - Object containing error messages that should patch existing error messages\n */\n public getErrors(control: FormControl, messages?: StringDictionary): ValidationErrorsResult\n {\n const errorMessages: StringDictionary = extend(true, {}, this._errorMessages, messages);\n\n //no control or no errors\n if(!control || !control.errors)\n {\n return null;\n }\n\n const result: ValidationErrorsResult =\n {\n errors: Object.keys(control.errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) >= 0),\n errorMessages: []\n };\n\n result.errors.forEach(error =>\n {\n const errorData = control.errors[error];\n \n //error message is present for error\n if(errorMessages[error])\n {\n result.errorMessages.push(this._stringLocalization.get(errorMessages[error], control.errors));\n }\n //display error data if it is string and there is missing translation\n else if(isString(errorData))\n {\n result.errorMessages.push(errorData);\n }\n //error data are array of strings, each string is considered error message\n else if(Array.isArray(errorData))\n {\n errorData.forEach(errorItm =>\n {\n if(isString(errorItm))\n {\n result.errorMessages.push(this._stringLocalization.get(errorItm, control.errors));\n }\n });\n }\n });\n\n return result;\n }\n}"]}
1
+ {"version":3,"file":"errorMessagesExtractor.service.js","sourceRoot":"","sources":["../../../../../forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAmB,MAAM,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAC,yBAAyB,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;;AAGvF;;GAEG;AACH,MAAM,oBAAoB,GAC1B;IACI,QAAQ,EAAE,oBAAoB;IAC9B,MAAM,EAAE,uBAAuB;IAC/B,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,oBAAoB;CAClC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAmD,mBAAuC,EACjC,wBAAkC,EAChC,mBAAsC;QAF9C,wBAAmB,GAAnB,mBAAmB,CAAoB;QACjC,6BAAwB,GAAxB,wBAAwB,CAAU;QAGvF,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACtF,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,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;qBACrF;gBACL,CAAC,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;;mHApEQ,sBAAsB,kBAUX,mBAAmB,aACnB,yBAAyB,aACzB,yBAAyB;uHAZpC,sBAAsB,cADV,MAAM;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAWf,MAAM;2BAAC,mBAAmB;;0BAC1B,MAAM;2BAAC,yBAAyB;;0BAChC,MAAM;2BAAC,yBAAyB;;0BAAG,QAAQ","sourcesContent":["import {Injectable, Inject, Optional} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {StringDictionary, extend, isString} from '@jscrpt/common';\n\nimport {IGNORED_VALIDATION_ERRORS, VALIDATION_ERROR_MESSAGES} from '../../misc/tokens';\nimport {ValidationErrorsResult} from './errorMessagesExtractor.interface';\n\n/**\n * Default error messages displayed\n */\nconst defaultErrorMessages: StringDictionary =\n{\n required: 'Field is required.',\n number: 'Value must be number.',\n pattern: 'Value is not valid.',\n minValue: 'Value is too small.',\n maxValue: 'Value is too big.',\n minlength: 'Value is short.',\n maxlength: 'Value is too long.'\n};\n\n/**\n * Service used for extracting error messages from form control\n */\n@Injectable({providedIn: 'root'})\nexport class ErrorMessagesExtractor\n{\n //######################### protected fields #########################\n\n /**\n * Dictionary with error names that have defined message\n */\n protected _errorMessages: StringDictionary;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n @Inject(IGNORED_VALIDATION_ERRORS) protected _ignoredValidationErrors: string[],\n @Inject(VALIDATION_ERROR_MESSAGES) @Optional() globalErrorMessages?: StringDictionary)\n {\n this._errorMessages = extend(true, {}, defaultErrorMessages, globalErrorMessages);\n }\n\n //######################### public methods #########################\n\n /**\n * Gets validation errors result for provided control, or null of no errors are present\n * @param control - Form control instance that should be inspected for errors\n * @param messages - Object containing error messages that should patch existing error messages\n */\n public getErrors(control: FormControl, messages?: StringDictionary): ValidationErrorsResult\n {\n const errorMessages: StringDictionary = extend(true, {}, this._errorMessages, messages);\n\n //no control or no errors\n if(!control || !control.errors)\n {\n return null;\n }\n\n const result: ValidationErrorsResult =\n {\n errors: Object.keys(control.errors).filter(itm => this._ignoredValidationErrors.indexOf(itm) < 0),\n errorMessages: []\n };\n\n result.errors.forEach(error =>\n {\n const errorData = control.errors[error];\n \n //error message is present for error\n if(errorMessages[error])\n {\n result.errorMessages.push(this._stringLocalization.get(errorMessages[error], control.errors));\n }\n //display error data if it is string and there is missing translation\n else if(isString(errorData))\n {\n result.errorMessages.push(errorData);\n }\n //error data are array of strings, each string is considered error message\n else if(Array.isArray(errorData))\n {\n errorData.forEach(errorItm =>\n {\n if(isString(errorItm))\n {\n result.errorMessages.push(this._stringLocalization.get(errorItm, control.errors));\n }\n });\n }\n });\n\n return result;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"validationErrorRenderer.interface.js","sourceRoot":"","sources":["../../../../../forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type, TemplateRef, Injector} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {StringDictionary} from '@jscrpt/common';\n\nimport {ErrorMessagesExtractor} from '../errorMessagesExtractor/errorMessagesExtractor.service';\nimport {ValidationErrorsResult} from '../errorMessagesExtractor/errorMessagesExtractor.interface';\n\n/**\n * Describes function that is used for performing actions when form is submitted or dirty\n */\nexport interface IsSubmittedOrDirtyFunc\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 (action: () => void, falseAction?: () => void, additionalCondition?: boolean): void;\n}\n\n/**\n * Component that is used for rendering validation errors\n */\nexport interface ValidationErrorsComponent\n{\n /**\n * Shows validation errors in component\n * @param errors - Errors to be shown, or null if to be hidden\n */\n show(errors: ValidationErrorsResult): void;\n}\n\n/**\n * Context passed to template that is used for rendering validation errors\n */\nexport interface ValidationErrorsTemplateContext\n{\n /**\n * Errors to be shown\n */\n $implicit: ValidationErrorsResult;\n}\n\n/**\n * Options for ValidationErrorRenderer\n */\nexport interface ValidationErrorsRendererOptions\n{\n /**\n * Prefix of css classes applied to element\n */\n prefix?: string;\n\n /**\n * Suffix of css classes applied to element\n */\n suffix?: string;\n\n /**\n * Css class attached to wrapper div\n */\n wrapperDivClass?: string;\n\n /**\n * Component used for rendering validation errors\n */\n component?: Type<ValidationErrorsComponent>;\n\n /**\n * Template used for rendering validation errors\n */\n template?: TemplateRef<ValidationErrorsTemplateContext>;\n}\n\n/**\n * Options for ValidationErrorRendererFactory\n */\nexport interface ValidationErrorRendererFactoryOptions extends ValidationErrorsRendererOptions\n{\n /**\n * Type of ValidationErrorRenderer implementation\n */\n rendererType?: ValidationErrorRendererCtor;\n}\n\n/**\n * Describes type that represents ValidationErrorRenderer\n */\nexport interface ValidationErrorRendererCtor\n{\n /**\n * Creates instance of ValidationErrorRenderer\n * @param errorMessagesExtractor - Instance of service used for extracting errors from control\n * @param control - Control that is being processed for errors\n * @param controlElement - Html element that represents control that is being processed\n * @param document - Html document instance, used for manipulation with html\n * @param injector - Injector used for obtaining dependencies\n * @param isSubmittedOrDirty - Function used for testing if control is submitted or dirty\n * @param options - Options for validation errors renderer\n */\n new(errorMessagesExtractor: ErrorMessagesExtractor,\n control: FormControl,\n controlElement: HTMLElement,\n document: Document,\n injector: Injector,\n isSubmittedOrDirty: IsSubmittedOrDirtyFunc,\n options: ValidationErrorsRendererOptions): ValidationErrorRenderer;\n}\n\n/**\n * Describes service that is used for rendering validation errors\n */\nexport interface ValidationErrorRenderer\n{\n /**\n * Html element that is wrapping errors\n */\n wrapperElement: HTMLElement;\n\n /**\n * Destroys renderer and everything that was rendered\n */\n destroy(): void;\n \n /**\n * Updates rendered errors for current state and returns true if errors were rendered, otherwise false\n * @param errorMessages - Object storing error messages to be used as override\n */\n update(errorMessages?: StringDictionary): boolean;\n}"]}
1
+ {"version":3,"file":"validationErrorRenderer.interface.js","sourceRoot":"","sources":["../../../../../forms/src/services/validationErrorRenderer/validationErrorRenderer.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type, TemplateRef, Injector} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {StringDictionary} from '@jscrpt/common';\n\nimport {ErrorMessagesExtractor} from '../errorMessagesExtractor/errorMessagesExtractor.service';\nimport {ValidationErrorsResult} from '../errorMessagesExtractor/errorMessagesExtractor.interface';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n/**\n * Describes function that is used for performing actions when form is submitted or dirty\n */\nexport interface IsSubmittedOrDirtyFunc\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 (action: () => void, falseAction?: () => void, additionalCondition?: boolean): void;\n}\n\n/**\n * Component that is used for rendering validation errors\n */\nexport interface ValidationErrorsComponent\n{\n /**\n * Shows validation errors in component\n * @param errors - Errors to be shown\n * @param options - Options used for displaying validation errors\n */\n show(errors: ValidationErrorsResult, options: ValidationErrorsOptions): void;\n}\n\n/**\n * Context passed to template that is used for rendering validation errors\n */\nexport interface ValidationErrorsTemplateContext\n{\n /**\n * Errors to be shown\n */\n $implicit: ValidationErrorsResult;\n\n /**\n * Options used for displaying validation errors\n */\n options: ValidationErrorsOptions;\n}\n\n/**\n * Component that is used for rendering validation errors container\n */\nexport interface ValidationErrorsContainerComponent\n{\n /**\n * Shows validation errors\n * @param errors - Errors to be shown\n * @param options - Options used for displaying validation errors\n */\n show(errors: ValidationErrorsResult, options: ValidationErrorsContainerOptions): void;\n\n /**\n * Hides validation errors\n */\n hide(): void;\n}\n\n/**\n * Options for displayed validation errors\n */\nexport interface ValidationErrorsOptions\n{\n /**\n * Prefix of css classes applied to element\n */\n prefix?: string;\n\n /**\n * Suffix of css classes applied to element\n */\n suffix?: string;\n\n /**\n * Css class attached to wrapper div\n */\n wrapperDivClass?: string;\n}\n\n/**\n * Options for validation errors container\n */\nexport interface ValidationErrorsContainerOptions extends ValidationErrorsOptions\n{\n /**\n * Component used for rendering validation errors\n */\n component?: Type<ValidationErrorsComponent>;\n\n /**\n * Template used for rendering validation errors\n */\n template?: TemplateRef<ValidationErrorsTemplateContext>;\n}\n\n/**\n * Options for ValidationErrorRenderer\n */\nexport interface ValidationErrorsRendererOptions extends ValidationErrorsContainerOptions\n{\n /**\n * Component used for rendering validation errors container\n */\n container?: Type<ValidationErrorsContainerComponent>;\n}\n\n/**\n * Options for ValidationErrorRendererFactory\n */\nexport interface ValidationErrorRendererFactoryOptions extends ValidationErrorsRendererOptions\n{\n /**\n * Type of ValidationErrorRenderer implementation\n */\n rendererType?: ValidationErrorRendererCtor;\n}\n\n/**\n * Describes type that represents ValidationErrorRenderer\n */\nexport interface ValidationErrorRendererCtor\n{\n /**\n * Creates instance of ValidationErrorRenderer\n * @param errorMessagesExtractor - Instance of service used for extracting errors from control\n * @param control - Control that is being processed for errors\n * @param containerView - Class that stores view container for rendering errors\n * @param injector - Injector used for obtaining dependencies\n * @param isSubmittedOrDirty - Function used for testing if control is submitted or dirty\n * @param options - Options for validation errors renderer\n */\n new(errorMessagesExtractor: ErrorMessagesExtractor,\n control: FormControl,\n containerView: ValidationErrorsContainerView,\n injector: Injector,\n isSubmittedOrDirty: IsSubmittedOrDirtyFunc,\n options: ValidationErrorsRendererOptions): ValidationErrorRenderer;\n}\n\n/**\n * Describes service that is used for rendering validation errors\n */\nexport interface ValidationErrorRenderer\n{\n /**\n * Destroys renderer and everything that was rendered\n */\n destroy(): void;\n \n /**\n * Updates rendered errors for current state and returns true if errors were rendered, otherwise false\n * @param options - Options for validation errors renderer\n * @param errorMessages - Object storing error messages to be used as override\n */\n update(options: ValidationErrorsRendererOptions, errorMessages?: StringDictionary): boolean;\n}"]}
@@ -1,46 +1,37 @@
1
- import { Injectable, Inject, InjectionToken, Optional, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
2
- import { DOCUMENT } from '@angular/common';
1
+ import { Injectable, Inject, Optional } from '@angular/core';
3
2
  import { extend } from '@jscrpt/common';
4
3
  import { ErrorMessagesExtractor } from '../errorMessagesExtractor/errorMessagesExtractor.service';
4
+ import { VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS } from '../../misc/tokens';
5
+ import { DefaultValidationErrorsComponent, DefaultValidationErrorsContainerComponent } from '../../components';
5
6
  import * as i0 from "@angular/core";
6
7
  import * as i1 from "../errorMessagesExtractor/errorMessagesExtractor.service";
7
- /**
8
- * Injection token used for injecting global options for ValidationErrorRendererFactory
9
- */
10
- export const VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS = new InjectionToken('VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS');
11
- //TODO: div renderer as custom component, wrapper div renderer
12
8
  /**
13
9
  * Service used for creating validation errors renderer
14
10
  */
15
11
  export class ValidationErrorRendererFactory {
16
12
  //######################### constructor #########################
17
- constructor(_errorMessagesExtractor, _document, options) {
13
+ constructor(_errorMessagesExtractor, options) {
18
14
  this._errorMessagesExtractor = _errorMessagesExtractor;
19
- this._document = _document;
20
15
  this._options = extend(true, {}, DEFAULT_OPTIONS, options);
21
16
  }
22
17
  //######################### public methods #########################
23
18
  /**
24
19
  * Creates new instance of ValidationErrorRenderer
25
20
  * @param control - Control that is being processed for errors
26
- * @param controlElement - Html element that represents control that is being processed
21
+ * @param containerView - Class that stores view container for rendering errors
22
+ * @param injector - Injector for obtaining dependencies
27
23
  * @param isSubmittedOrDirty - Function used for testing if control is submitted or dirty
28
- * @param options - Options for validation errors renderer factory
29
24
  */
30
- create(control, controlElement, injector, isSubmittedOrDirty, options) {
31
- const opts = extend(true, {}, this._options, options);
32
- return new opts.rendererType(this._errorMessagesExtractor, control, controlElement, this._document, injector, isSubmittedOrDirty, opts);
25
+ create(control, containerView, injector, isSubmittedOrDirty) {
26
+ return new this._options.rendererType(this._errorMessagesExtractor, control, containerView, injector, isSubmittedOrDirty, this._options);
33
27
  }
34
28
  }
35
- ValidationErrorRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorRendererFactory, deps: [{ token: i1.ErrorMessagesExtractor }, { token: DOCUMENT }, { token: VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
29
+ ValidationErrorRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorRendererFactory, deps: [{ token: i1.ErrorMessagesExtractor }, { token: VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
36
30
  ValidationErrorRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorRendererFactory, providedIn: 'root' });
37
31
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorRendererFactory, decorators: [{
38
32
  type: Injectable,
39
33
  args: [{ providedIn: 'root' }]
40
- }], ctorParameters: function () { return [{ type: i1.ErrorMessagesExtractor }, { type: Document, decorators: [{
41
- type: Inject,
42
- args: [DOCUMENT]
43
- }] }, { type: undefined, decorators: [{
34
+ }], ctorParameters: function () { return [{ type: i1.ErrorMessagesExtractor }, { type: undefined, decorators: [{
44
35
  type: Optional
45
36
  }, {
46
37
  type: Inject,
@@ -51,11 +42,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
51
42
  */
52
43
  export class DefaultValidationErrorRenderer {
53
44
  //######################### constructor #########################
54
- constructor(_errorMessagesExtractor, _control, _controlElement, _document, _injector, _isSubmittedOrDirty, _options) {
45
+ constructor(_errorMessagesExtractor, _control, _containerView, _injector, _isSubmittedOrDirty, _options) {
55
46
  this._errorMessagesExtractor = _errorMessagesExtractor;
56
47
  this._control = _control;
57
- this._controlElement = _controlElement;
58
- this._document = _document;
48
+ this._containerView = _containerView;
59
49
  this._injector = _injector;
60
50
  this._isSubmittedOrDirty = _isSubmittedOrDirty;
61
51
  this._options = _options;
@@ -63,155 +53,53 @@ export class DefaultValidationErrorRenderer {
63
53
  }
64
54
  //######################### public methods - implementation of ValiDationErrorRenderer #########################
65
55
  /**
66
- * Destroys renderer and everything that was rendered
56
+ * @inheritdoc
67
57
  */
68
58
  destroy() {
69
- if (this._component) {
70
- this._injector.get(ApplicationRef).detachView(this._component.hostView);
71
- this._component.destroy();
72
- this._component = null;
73
- }
74
- this.wrapperElement?.remove();
75
- this.wrapperElement = null;
59
+ this._containerView.viewContainer.clear();
60
+ this._container = null;
76
61
  }
77
62
  /**
78
- * Updates rendered errors for current state and returns true if errors were rendered, otherwise false
79
- * @param errorMessages - Object storing error messages to be used as override
80
- * @param onlyShow - Indication that update performs only displaying of existing errors
63
+ * @inheritdoc
81
64
  */
82
- update(errorMessages) {
65
+ update(options, errorMessages) {
83
66
  let result = false;
84
- //hides old errors
85
- this._toggleErrors(false);
86
67
  this._lastErrors = this._errorMessagesExtractor.getErrors(this._control, errorMessages);
68
+ //has errors
87
69
  if (this._lastErrors) {
88
70
  this._isSubmittedOrDirty(() => {
89
- this._show();
90
- this._toggleErrors();
71
+ // const errorsClasses = this._lastErrors.errors.map(error => `${this._options.prefix}${error.toLowerCase()}${this._options.suffix}`);
72
+ const opts = extend(true, {}, this._options, options);
73
+ this._container.instance.show(this._lastErrors, opts);
91
74
  result = true;
92
75
  }, () => {
93
- this._hide();
76
+ this._container.instance.hide();
94
77
  result = false;
95
78
  });
96
79
  }
97
80
  else {
98
- this._hide();
81
+ this._container.instance.hide();
99
82
  result = false;
100
83
  }
101
84
  return result;
102
85
  }
103
- //######################### protected methods #########################
104
- /**
105
- * Toggles css classes for errors that are currently set
106
- * @param add - Indication whether add or remove errors
107
- */
108
- _toggleErrors(add = true) {
109
- if (!this._lastErrors) {
110
- return;
111
- }
112
- const errorsClasses = this._lastErrors.errors.map(error => `${this._options.prefix}${error.toLowerCase()}${this._options.suffix}`);
113
- (add ? this._controlElement.classList.add : this._controlElement.classList.remove).apply(this._controlElement.classList, errorsClasses);
114
- (add ? this.wrapperElement.classList.add : this.wrapperElement.classList.remove).apply(this.wrapperElement.classList, errorsClasses);
115
- this._errorMessageAttr.value = (add ? this._lastErrors.errorMessages : [])
116
- .join(' ');
117
- this._render(add);
118
- }
119
86
  /**
120
87
  * Initialize renderer
121
88
  */
122
89
  _initialize() {
123
- this.wrapperElement = this._document.createElement('div');
124
- this._hide();
125
- this.wrapperElement.classList.add(this._options.wrapperDivClass);
126
- this._errorMessageAttr = this._document.createAttribute('data-error-message');
127
- this.wrapperElement.attributes.setNamedItem(this._errorMessageAttr);
128
- this._controlElement.after(this.wrapperElement);
129
- }
130
- /**
131
- * Renders error messages
132
- * @param add - Indication whether add or remove errors
133
- */
134
- _render(add) {
135
- if (this._options.component) {
136
- this._renderComponent(add);
137
- }
138
- else if (this._options.template) {
139
- this._renderTemplate(add);
140
- }
141
- else {
142
- this._renderDivs(add);
143
- }
144
- }
145
- /**
146
- * Renders divs with errors
147
- * @param add - Indication whether add or remove errors
148
- */
149
- _renderDivs(add = true) {
150
- if (!add) {
151
- const children = this.wrapperElement.children;
152
- //first clean old messages
153
- for (let x = children.length - 1; x >= 0; x--) {
154
- children.item(x).remove();
155
- }
156
- return;
157
- }
158
- if (this._lastErrors?.errorMessages?.length) {
159
- this._lastErrors.errorMessages.forEach(message => {
160
- const errorDiv = this._document.createElement('div');
161
- errorDiv.innerText = message;
162
- this.wrapperElement.append(errorDiv);
163
- });
164
- }
165
- }
166
- /**
167
- * Renders component with errors
168
- * @param add - Indication whether add or remove errors
169
- */
170
- _renderComponent(add = true) {
171
- if (add) {
172
- //render component
173
- if (!this._component) {
174
- // 1. Create a component reference from the component
175
- this._component = this._injector.get(ComponentFactoryResolver)
176
- .resolveComponentFactory(this._options.component)
177
- .create(this._injector);
178
- // 2. Attach component to the appRef so that it's inside the ng component tree
179
- this._injector.get(ApplicationRef).attachView(this._component.hostView);
180
- // 3. Get DOM element from component
181
- const domElem = this._component.hostView
182
- .rootNodes[0];
183
- // 4. Append DOM element to the body
184
- this.wrapperElement.append(domElem);
185
- }
186
- this._component.instance.show(this._lastErrors);
187
- }
188
- else if (this._component) {
189
- this._component.instance.show(null);
190
- }
191
- }
192
- /**
193
- * Renders template with errors
194
- * @param add - Indication whether add or remove errors
195
- */
196
- _renderTemplate(_add = true) {
197
- }
198
- /**
199
- * Shows wrapper element
200
- */
201
- _show() {
202
- this.wrapperElement.style.display = 'block';
203
- }
204
- /**
205
- * Hides wrapper element
206
- */
207
- _hide() {
208
- this.wrapperElement.style.display = 'none';
90
+ this._container = this._containerView.viewContainer.createComponent(this._options.container, { injector: this._injector });
91
+ this._container.instance.hide();
209
92
  }
210
93
  }
94
+ /**
95
+ * Default options for validation error renderer factory
96
+ */
211
97
  const DEFAULT_OPTIONS = {
212
98
  prefix: 'ng-',
213
99
  suffix: '-error',
214
100
  wrapperDivClass: 'validation-error-div',
215
- rendererType: DefaultValidationErrorRenderer
101
+ rendererType: DefaultValidationErrorRenderer,
102
+ component: DefaultValidationErrorsComponent,
103
+ container: DefaultValidationErrorsContainerComponent,
216
104
  };
217
105
  //# sourceMappingURL=validationErrorRenderer.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validationErrorRenderer.service.js","sourceRoot":"","sources":["../../../../../forms/src/services/validationErrorRenderer/validationErrorRenderer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAY,wBAAwB,EAAE,cAAc,EAAgC,MAAM,eAAe,CAAC;AAE9J,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAA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AAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;IAChD,CAAC;IAED;;OAEG;IACO,KAAK;QAEX,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC/C,CAAC;CACJ;AAED,MAAM,eAAe,GACrB;IACI,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,sBAAsB;IACvC,YAAY,EAAE,8BAA8B;CAC/C,CAAC","sourcesContent":["import {Injectable, Inject, InjectionToken, Optional, Injector, ComponentFactoryResolver, ApplicationRef, EmbeddedViewRef, ComponentRef} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {DOCUMENT} from '@angular/common';\nimport {extend, StringDictionary} from '@jscrpt/common';\n\nimport {ErrorMessagesExtractor} from '../errorMessagesExtractor/errorMessagesExtractor.service';\nimport {ValidationErrorRenderer, IsSubmittedOrDirtyFunc, ValidationErrorsRendererOptions, ValidationErrorRendererFactoryOptions, ValidationErrorsComponent} from './validationErrorRenderer.interface';\nimport {ValidationErrorsResult} from '../errorMessagesExtractor/errorMessagesExtractor.interface';\n\n/**\n * Injection token used for injecting global options for ValidationErrorRendererFactory\n */\nexport const VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS: InjectionToken<ValidationErrorRendererFactoryOptions> = new InjectionToken<ValidationErrorRendererFactoryOptions>('VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS');\n\n//TODO: div renderer as custom component, wrapper div renderer\n\n/**\n * Service used for creating validation errors renderer\n */\n@Injectable({providedIn: 'root'})\nexport class ValidationErrorRendererFactory\n{\n //######################### protected fields #########################\n\n /**\n * Options for validation error renderer factory\n */\n protected _options: ValidationErrorRendererFactoryOptions;\n\n //######################### constructor #########################\n constructor(protected _errorMessagesExtractor: ErrorMessagesExtractor,\n @Inject(DOCUMENT) protected _document: Document,\n @Optional() @Inject(VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS) options: ValidationErrorRendererFactoryOptions)\n {\n this._options = extend(true, {}, DEFAULT_OPTIONS, options);\n }\n\n //######################### public methods #########################\n\n /**\n * Creates new instance of ValidationErrorRenderer\n * @param control - Control that is being processed for errors\n * @param controlElement - Html element that represents control that is being processed\n * @param isSubmittedOrDirty - Function used for testing if control is submitted or dirty\n * @param options - Options for validation errors renderer factory\n */\n public create(control: FormControl,\n controlElement: HTMLElement,\n injector: Injector,\n isSubmittedOrDirty: IsSubmittedOrDirtyFunc,\n options: ValidationErrorRendererFactoryOptions): ValidationErrorRenderer\n {\n const opts: ValidationErrorRendererFactoryOptions = extend(true, {}, this._options, options);\n\n return new opts.rendererType(this._errorMessagesExtractor,\n control,\n controlElement,\n this._document,\n injector,\n isSubmittedOrDirty,\n opts);\n }\n}\n\n/**\n * Default implementation of validation error renderer\n */\nexport class DefaultValidationErrorRenderer implements ValidationErrorRenderer\n{\n //######################### protected fields #########################\n\n /**\n * Html element attribute storing error messages\n */\n protected _errorMessageAttr: Attr;\n\n /**\n * Object storing last obtained errors\n */\n protected _lastErrors: ValidationErrorsResult;\n\n /**\n * Component used for displaying errors\n */\n protected _component: ComponentRef<ValidationErrorsComponent>;\n\n //######################### public properties - implementation of ValidationErrorRenderer #########################\n\n /**\n * Html element that is wrapping errors\n */\n public wrapperElement: HTMLElement;\n\n //######################### constructor #########################\n constructor(protected _errorMessagesExtractor: ErrorMessagesExtractor,\n protected _control: FormControl,\n protected _controlElement: HTMLElement,\n protected _document: Document,\n protected _injector: Injector,\n protected _isSubmittedOrDirty: IsSubmittedOrDirtyFunc,\n protected _options: ValidationErrorsRendererOptions)\n {\n this._initialize();\n }\n\n //######################### public methods - implementation of ValiDationErrorRenderer #########################\n\n /**\n * Destroys renderer and everything that was rendered\n */\n public destroy(): void\n {\n if(this._component)\n {\n this._injector.get(ApplicationRef).detachView(this._component.hostView);\n this._component.destroy();\n this._component = null;\n }\n\n this.wrapperElement?.remove();\n this.wrapperElement = null;\n }\n\n /**\n * Updates rendered errors for current state and returns true if errors were rendered, otherwise false\n * @param errorMessages - Object storing error messages to be used as override\n * @param onlyShow - Indication that update performs only displaying of existing errors\n */\n public update(errorMessages?: StringDictionary): boolean\n {\n let result = false;\n\n //hides old errors\n this._toggleErrors(false);\n this._lastErrors = this._errorMessagesExtractor.getErrors(this._control, errorMessages);\n\n if(this._lastErrors)\n {\n this._isSubmittedOrDirty(() =>\n {\n this._show();\n this._toggleErrors();\n result = true;\n },\n () =>\n {\n this._hide();\n result = false;\n });\n }\n else\n {\n this._hide();\n result = false;\n }\n\n return result;\n }\n\n //######################### protected methods #########################\n\n /**\n * Toggles css classes for errors that are currently set\n * @param add - Indication whether add or remove errors\n */\n protected _toggleErrors(add: boolean = true): void\n {\n if(!this._lastErrors)\n {\n return;\n }\n\n const errorsClasses = this._lastErrors.errors.map(error => `${this._options.prefix}${error.toLowerCase()}${this._options.suffix}`);\n\n (add ? this._controlElement.classList.add : this._controlElement.classList.remove).apply(this._controlElement.classList, errorsClasses);\n (add ? this.wrapperElement.classList.add : this.wrapperElement.classList.remove).apply(this.wrapperElement.classList, errorsClasses);\n\n this._errorMessageAttr.value = (add ? this._lastErrors.errorMessages : [])\n .join(' ');\n\n this._render(add);\n }\n\n /**\n * Initialize renderer\n */\n protected _initialize(): void\n {\n this.wrapperElement = this._document.createElement('div');\n this._hide();\n this.wrapperElement.classList.add(this._options.wrapperDivClass);\n\n this._errorMessageAttr = this._document.createAttribute('data-error-message');\n\n this.wrapperElement.attributes.setNamedItem(this._errorMessageAttr);\n this._controlElement.after(this.wrapperElement);\n }\n\n /**\n * Renders error messages\n * @param add - Indication whether add or remove errors\n */\n protected _render(add: boolean): void\n {\n if(this._options.component)\n {\n this._renderComponent(add);\n }\n else if(this._options.template)\n {\n this._renderTemplate(add);\n }\n else\n {\n this._renderDivs(add);\n }\n }\n\n /**\n * Renders divs with errors\n * @param add - Indication whether add or remove errors\n */\n protected _renderDivs(add: boolean = true): void\n {\n if(!add)\n {\n const children = this.wrapperElement.children;\n \n //first clean old messages\n for(let x = children.length - 1; x >= 0; x--)\n {\n children.item(x).remove();\n }\n\n return;\n }\n\n if(this._lastErrors?.errorMessages?.length)\n {\n this._lastErrors.errorMessages.forEach(message =>\n {\n const errorDiv = this._document.createElement('div');\n\n errorDiv.innerText = message;\n\n this.wrapperElement.append(errorDiv);\n });\n }\n }\n\n /**\n * Renders component with errors\n * @param add - Indication whether add or remove errors\n */\n protected _renderComponent(add: boolean = true): void\n {\n if(add)\n {\n //render component\n if(!this._component)\n {\n // 1. Create a component reference from the component \n this._component = this._injector.get(ComponentFactoryResolver)\n .resolveComponentFactory(this._options.component)\n .create(this._injector);\n\n // 2. Attach component to the appRef so that it's inside the ng component tree\n this._injector.get(ApplicationRef).attachView(this._component.hostView);\n\n // 3. Get DOM element from component\n const domElem = (this._component.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n this.wrapperElement.append(domElem);\n }\n\n this._component.instance.show(this._lastErrors);\n }\n else if(this._component)\n {\n this._component.instance.show(null);\n }\n }\n\n /**\n * Renders template with errors\n * @param add - Indication whether add or remove errors\n */\n protected _renderTemplate(_add: boolean = true): void\n {\n\n }\n\n /**\n * Shows wrapper element\n */\n protected _show(): void\n {\n this.wrapperElement.style.display = 'block';\n }\n\n /**\n * Hides wrapper element\n */\n protected _hide(): void\n {\n this.wrapperElement.style.display = 'none';\n }\n}\n\nconst DEFAULT_OPTIONS: ValidationErrorRendererFactoryOptions =\n{\n prefix: 'ng-',\n suffix: '-error',\n wrapperDivClass: 'validation-error-div',\n rendererType: DefaultValidationErrorRenderer\n};"]}
1
+ {"version":3,"file":"validationErrorRenderer.service.js","sourceRoot":"","sources":["../../../../../forms/src/services/validationErrorRenderer/validationErrorRenderer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAyB,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAC,MAAM,EAAmB,MAAM,gBAAgB,CAAC;AAExD,OAAO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,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,eAAe,GACrB;IACI,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,sBAAsB;IACvC,YAAY,EAAE,8BAA8B;IAC5C,SAAS,EAAE,gCAAgC;IAC3C,SAAS,EAAE,yCAAyC;CACvD,CAAC","sourcesContent":["import {Injectable, Inject, Optional, Injector, ComponentRef} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {extend, StringDictionary} from '@jscrpt/common';\n\nimport {ErrorMessagesExtractor} from '../errorMessagesExtractor/errorMessagesExtractor.service';\nimport {ValidationErrorRenderer, IsSubmittedOrDirtyFunc, ValidationErrorsRendererOptions, ValidationErrorRendererFactoryOptions, ValidationErrorsContainerComponent} from './validationErrorRenderer.interface';\nimport {ValidationErrorsResult} from '../errorMessagesExtractor/errorMessagesExtractor.interface';\nimport {VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS} from '../../misc/tokens';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\nimport {DefaultValidationErrorsComponent, DefaultValidationErrorsContainerComponent} from '../../components';\n\n/**\n * Service used for creating validation errors renderer\n */\n@Injectable({providedIn: 'root'})\nexport class ValidationErrorRendererFactory\n{\n //######################### protected fields #########################\n\n /**\n * Options for validation error renderer factory\n */\n protected _options: ValidationErrorRendererFactoryOptions;\n\n //######################### constructor #########################\n constructor(protected _errorMessagesExtractor: ErrorMessagesExtractor,\n @Optional() @Inject(VALIDATION_ERROR_RENDERER_FACTORY_OPTIONS) options: ValidationErrorRendererFactoryOptions)\n {\n this._options = extend(true, {}, DEFAULT_OPTIONS, options);\n }\n\n //######################### public methods #########################\n\n /**\n * Creates new instance of ValidationErrorRenderer\n * @param control - Control that is being processed for errors\n * @param containerView - Class that stores view container for rendering errors\n * @param injector - Injector for obtaining dependencies\n * @param isSubmittedOrDirty - Function used for testing if control is submitted or dirty\n */\n public create(control: FormControl,\n containerView: ValidationErrorsContainerView,\n injector: Injector,\n isSubmittedOrDirty: IsSubmittedOrDirtyFunc): ValidationErrorRenderer\n {\n return new this._options.rendererType(this._errorMessagesExtractor,\n control,\n containerView,\n injector,\n isSubmittedOrDirty,\n this._options);\n }\n}\n\n/**\n * Default implementation of validation error renderer\n */\nexport class DefaultValidationErrorRenderer implements ValidationErrorRenderer\n{\n //######################### protected fields #########################\n\n /**\n * Object storing last obtained errors\n */\n protected _lastErrors: ValidationErrorsResult;\n\n /**\n * Component used as validation errors container\n */\n protected _container: ComponentRef<ValidationErrorsContainerComponent>;\n\n //######################### constructor #########################\n constructor(protected _errorMessagesExtractor: ErrorMessagesExtractor,\n protected _control: FormControl,\n protected _containerView: ValidationErrorsContainerView,\n protected _injector: Injector,\n protected _isSubmittedOrDirty: IsSubmittedOrDirtyFunc,\n protected _options: ValidationErrorsRendererOptions)\n {\n this._initialize();\n }\n\n //######################### public methods - implementation of ValiDationErrorRenderer #########################\n\n /**\n * @inheritdoc\n */\n public destroy(): void\n {\n this._containerView.viewContainer.clear();\n this._container = null;\n }\n\n /**\n * @inheritdoc\n */\n public update(options: ValidationErrorsRendererOptions, errorMessages?: StringDictionary): boolean\n {\n let result = false;\n this._lastErrors = this._errorMessagesExtractor.getErrors(this._control, errorMessages);\n\n //has errors\n if(this._lastErrors)\n {\n this._isSubmittedOrDirty(() =>\n {\n // const errorsClasses = this._lastErrors.errors.map(error => `${this._options.prefix}${error.toLowerCase()}${this._options.suffix}`);\n const opts = extend(true, {}, this._options, options);\n\n this._container.instance.show(this._lastErrors, opts);\n result = true;\n },\n () =>\n {\n this._container.instance.hide();\n result = false;\n });\n }\n else\n {\n this._container.instance.hide();\n result = false;\n }\n\n return result;\n }\n\n /**\n * Initialize renderer\n */\n protected _initialize(): void\n {\n this._container = this._containerView.viewContainer.createComponent(this._options.container, {injector: this._injector});\n this._container.instance.hide();\n }\n}\n\n/**\n * Default options for validation error renderer factory\n */\nconst DEFAULT_OPTIONS: ValidationErrorRendererFactoryOptions =\n{\n prefix: 'ng-',\n suffix: '-error',\n wrapperDivClass: 'validation-error-div',\n rendererType: DefaultValidationErrorRenderer,\n component: DefaultValidationErrorsComponent,\n container: DefaultValidationErrorsContainerComponent,\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;AAC7B,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC","sourcesContent":["export * from './misc/utils';\nexport * from './modules/positions/directives/positionTo/positionTo.directive';\nexport * from './modules/positions/modules/positions.module';\nexport * from './modules/tooltip/components/tooltip/tooltip.component';\nexport * from './modules/tooltip/directives/tooltip/tooltip.directive';\nexport * from './modules/tooltip/misc/tokens';\nexport * from './modules/tooltip/misc/tooltip.interface';\nexport * from './modules/tooltip/modules/tooltip.module';\n"]}
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;AAC7F,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;IAwD5B,oFAAoF;IAEpF,MAAM;IACN,gDAAgD;IAChD,MAAM;IACN,YAAY;IACZ,8DAA8D;IAE9D,iEAAiE;IACjE,YAAsB,OAAgC,EACd,SAAmB;QADrC,YAAO,GAAP,OAAO,CAAyB;QACd,cAAS,GAAT,SAAS,CAAU;IAE3D,CAAC;IAtDD,gFAAgF;IAEhF;;OAEG;IACH,IACW,MAAM;QAEb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IAAW,MAAM,CAAC,KAAkB;QAEhC,IAAG,KAAK,YAAY,UAAU,EAC9B;YACI,IAAI,CAAC,OAAO,GAAI,KAAoB,CAAC,aAAa,CAAC;YAEnD,OAAO;SACV;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IACW,SAAS;QAEhB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD,IAAW,SAAS,CAAC,KAAuC;QAExD,IAAG,QAAQ,CAAC,KAAK,CAAC,EAClB;YACI,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,KAAuC,CAAC,CAAC;YAE7E,OAAO;SACV;QAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAgBD,kGAAkG;IAElG;;OAEG;IACI,WAAW,CAAC,OAAsB;QAErC,IAAG,CAAC,MAAM,CAAsB,QAAQ,CAAC,IAAI,OAAO;YAChD,MAAM,CAAsB,WAAW,CAAC,IAAI,OAAO,CAAC;YACrD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EACzB;YACI,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;IACL,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,KAAK,CAAC,cAAc;QAE1B,MAAM,OAAO,GACb,EACC,CAAC;QAEF,IAAG,IAAI,CAAC,UAAU,EAClB;YACI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;SACvC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,IAAI,CAAC,OAAO,EACZ,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;QAEtE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;;gHA1GQ,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","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject} 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\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
+ {"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,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IAAW,MAAM,CAAC,KAAkB;QAEhC,IAAG,KAAK,YAAY,UAAU,EAC9B;YACI,IAAI,CAAC,OAAO,GAAI,KAAoB,CAAC,aAAa,CAAC;YAEnD,OAAO;SACV;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IACW,SAAS;QAEhB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD,IAAW,SAAS,CAAC,KAAuC;QAExD,IAAG,QAAQ,CAAC,KAAK,CAAC,EAClB;YACI,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,KAAuC,CAAC,CAAC;YAE7E,OAAO;SACV;QAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAgBD,kGAAkG;IAElG;;OAEG;IACI,WAAW,CAAC,OAAsB;QAErC,IAAG,CAAC,MAAM,CAAsB,QAAQ,CAAC,IAAI,OAAO;YAChD,MAAM,CAAsB,WAAW,CAAC,IAAI,OAAO,CAAC;YACrD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EACzB;YACI,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;IACL,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,KAAK,CAAC,cAAc;QAE1B,MAAM,OAAO,GACb,EACC,CAAC;QAEF,IAAG,IAAI,CAAC,UAAU,EAClB;YACI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;SACvC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,IAAI,CAAC,OAAO,EACZ,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;QAEtE,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAG,MAAM,CAAC,IAAI,EACd;YACI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,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;IAiFrH;;;;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;yCAhMnD,qBAAqB;6CAArB,qBAAqB;CAuPjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,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"}
@@ -0,0 +1,32 @@
1
+ import { ChangeDetectorRef } from '@angular/core';
2
+ import { ValidationErrorsResult } from '../../services/errorMessagesExtractor/errorMessagesExtractor.interface';
3
+ import { ValidationErrorsComponent, ValidationErrorsOptions } from '../../services/validationErrorRenderer/validationErrorRenderer.interface';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Default validation errors component, displaying validation errors
7
+ */
8
+ export declare class DefaultValidationErrorsComponent implements ValidationErrorsComponent {
9
+ protected _changeDetector: ChangeDetectorRef;
10
+ /**
11
+ * Errors to be shown
12
+ * @internal
13
+ */
14
+ errors: ValidationErrorsResult;
15
+ /**
16
+ * Options used for displaying validation errors
17
+ * @internal
18
+ */
19
+ options: ValidationErrorsOptions;
20
+ /**
21
+ * Enables leave animations for internal stuff
22
+ */
23
+ animate: boolean;
24
+ constructor(_changeDetector: ChangeDetectorRef);
25
+ /**
26
+ * @inheritdoc
27
+ */
28
+ show(errors: ValidationErrorsResult, options: ValidationErrorsOptions): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultValidationErrorsComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultValidationErrorsComponent, "default-validation-errors", never, {}, {}, never, never>;
31
+ }
32
+ //# sourceMappingURL=defaultValidationErrors.component.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ <div [ngClass]="options?.wrapperDivClass" *ngIf="errors?.errorMessages?.length" @slideInOut>
2
+ <div *ngFor="let error of errors?.errorMessages">{{error}}</div>
3
+ </div>