@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
@@ -1,5 +1,7 @@
1
1
  import { ContentChild, Directive, ElementRef, HostListener, Inject, Injector, Input, Optional, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { AnimationBuilder } from '@angular/animations';
2
3
  import { DOCUMENT } from '@angular/common';
4
+ import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
3
5
  import { extend, isBlank, isPresent, nameof } from '@jscrpt/common';
4
6
  import { TooltipComponent } from '../../components/tooltip/tooltip.component';
5
7
  import { TOOLTIP_OPTIONS } from '../../misc/tokens';
@@ -7,6 +9,7 @@ import { applyPositionResult, PositionOffset, PositionPlacement } from '../../..
7
9
  import { TooltipTemplateDirective } from '../tooltipTemplate/tooltipTemplate.directive';
8
10
  import { POSITION } from '../../../../types/tokens';
9
11
  import * as i0 from "@angular/core";
12
+ import * as i1 from "@angular/animations";
10
13
  /**
11
14
  * Default options for tooltip
12
15
  */
@@ -19,17 +22,20 @@ const defaultOptions = {
19
22
  allowSelection: false,
20
23
  tooltipRenderer: TooltipComponent,
21
24
  tooltipCssClass: null,
22
- stopPropagation: false
25
+ stopPropagation: false,
26
+ enterAnimation: fadeInAnimation,
27
+ exitAnimation: fadeOutAnimation,
23
28
  };
24
29
  /**
25
30
  * Directive used for rendering tooltip
26
31
  */
27
32
  export class TooltipDirective {
28
33
  //######################### constructor #########################
29
- constructor(_viewContainerRef, _injector, _element, _document, _position, options) {
34
+ constructor(_viewContainerRef, _injector, _element, _animationsPlayer, _document, _position, options) {
30
35
  this._viewContainerRef = _viewContainerRef;
31
36
  this._injector = _injector;
32
37
  this._element = _element;
38
+ this._animationsPlayer = _animationsPlayer;
33
39
  this._document = _document;
34
40
  this._position = _position;
35
41
  /**
@@ -49,6 +55,8 @@ export class TooltipDirective {
49
55
  */
50
56
  this.allowHtml = false;
51
57
  this._options = extend(true, {}, defaultOptions, options);
58
+ this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);
59
+ this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);
52
60
  }
53
61
  /**
54
62
  * Options used for displaying tooltip
@@ -58,6 +66,8 @@ export class TooltipDirective {
58
66
  }
59
67
  set tooltipOptions(value) {
60
68
  this._options = extend(true, {}, this._options, value);
69
+ this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);
70
+ this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);
61
71
  }
62
72
  //######################### public methods - implementation of OnChanges #########################
63
73
  /**
@@ -157,9 +167,16 @@ export class TooltipDirective {
157
167
  */
158
168
  _destroyTooltip() {
159
169
  if (this._tooltipComponent) {
160
- this._tooltipComponent.destroy();
170
+ const component = this._tooltipComponent;
171
+ const element = this._tooltipElement;
172
+ const exitAnimation = this._exitAnimation.create(element);
173
+ exitAnimation.onDone(() => {
174
+ component.destroy();
175
+ exitAnimation.destroy();
176
+ });
161
177
  this._tooltipComponent = undefined;
162
178
  this._tooltipElement = undefined;
179
+ exitAnimation.play();
163
180
  }
164
181
  }
165
182
  /**
@@ -178,6 +195,7 @@ export class TooltipDirective {
178
195
  .rootNodes[0];
179
196
  // 4. Append DOM element to the body
180
197
  this._document.body.appendChild(this._tooltipElement);
198
+ this._enterAnimation.create(this._tooltipElement).play();
181
199
  }
182
200
  /**
183
201
  * Sets data to tooltip component and shows them
@@ -206,14 +224,14 @@ export class TooltipDirective {
206
224
  }
207
225
  }
208
226
  }
209
- TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: DOCUMENT }, { token: POSITION }, { token: TOOLTIP_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
227
+ TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: i1.AnimationBuilder }, { token: DOCUMENT }, { token: POSITION }, { token: TOOLTIP_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
210
228
  TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: TooltipDirective, selector: "[tooltip]", inputs: { tooltip: "tooltip", allowHtml: "allowHtml", tooltipTemplate: "tooltipTemplate", tooltipOptions: "tooltipOptions", tooltipVisible: "tooltipVisible" }, host: { listeners: { "mouseleave": "mouseLeave($event)", "mousemove": "mouseMove($event)" } }, queries: [{ propertyName: "tooltipTemplateChild", first: true, predicate: TooltipTemplateDirective, descendants: true }], usesOnChanges: true, ngImport: i0 });
211
229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, decorators: [{
212
230
  type: Directive,
213
231
  args: [{
214
232
  selector: '[tooltip]'
215
233
  }]
216
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: Document, decorators: [{
234
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: i1.AnimationBuilder }, { type: Document, decorators: [{
217
235
  type: Inject,
218
236
  args: [DOCUMENT]
219
237
  }] }, { type: undefined, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtN,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAE5E,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAY,cAAc,EAAE,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAC/G,OAAO,EAAC,wBAAwB,EAAC,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;;AAElD;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,KAAK,EAAE,GAAG;IACV,QAAQ,EACR;QACI,MAAM,EAAE,cAAc,CAAC,UAAU;QACjC,SAAS,EAAE,iBAAiB,CAAC,QAAQ;KACxC;IACD,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,gBAAgB;IACjC,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,KAAK;CACzB,CAAC;AAEF;;GAEG;AAKH,MAAM,OAAO,gBAAgB;IAiFzB,iEA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AAM;2BAAC,eAAe;4CA/CxC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAcC,cAAc;sBADpB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,wBAAwB;gBAoD/B,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {extend, isBlank, isPresent, nameof} from '@jscrpt/common';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionOffset, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: PositionOffset.MouseEnter,\n placement: PositionPlacement.TopStart\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: false\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]'\n})\nexport class TooltipDirective<TData = any> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public tooltipTemplate?: TemplateRef<TData>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): Partial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: Partial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>)\n {\n this._options = extend(true, {}, defaultOptions, options);\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<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\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._destroyTooltip();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mouseleave', ['$event'])\n public mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mousemove', ['$event'])\n public mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false\n })\n .toPromise()\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.destroy();\n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n this._document.body.appendChild(this._tooltipElement);\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.tooltipTemplate ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}"]}
1
+ {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtN,OAAO,EAAC,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACpE,OAAO,EA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C9B,CAAC,EAAE,CAAC,CAAC,CAAC;YACV,CAAC,CAAC,CAAC;YAEvD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;SACvD;IACL,CAAC;;6GA3UQ,gBAAgB,oIAmGL,QAAQ,aACR,QAAQ,aACI,eAAe;iGArGtC,gBAAgB,kWA2FX,wBAAwB;2FA3F7B,gBAAgB;kBAJ5B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;iBACxB;wKAoGsD,QAAQ;0BAA9C,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,QAAQ;;0BAAI,MAAM;2BAAC,eAAe;4CAnDxC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAiBC,cAAc;sBADpB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,wBAAwB;gBAwD/B,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {AnimationBuilder, AnimationFactory} from '@angular/animations';\nimport {DOCUMENT} from '@angular/common';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\nimport {extend, isBlank, isPresent, nameof} from '@jscrpt/common';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionOffset, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {TooltipTemplateContext} from '../tooltipTemplate/tooltipTemplate.context';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: PositionOffset.MouseEnter,\n placement: PositionPlacement.TopStart\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: false,\n enterAnimation: fadeInAnimation,\n exitAnimation: fadeOutAnimation,\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]'\n})\nexport class TooltipDirective<TData = any> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Animation factory used for enter animation of tooltip\n */\n protected _enterAnimation: AnimationFactory;\n\n /**\n * Animation factory used for exit animation of tooltip\n */\n protected _exitAnimation: AnimationFactory;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public tooltipTemplate?: TemplateRef<TooltipTemplateContext<TData>>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): Partial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: Partial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n protected _animationsPlayer: AnimationBuilder,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>,)\n {\n this._options = extend(true, {}, defaultOptions, options);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\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<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\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._destroyTooltip();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mouseleave', ['$event'])\n public mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mousemove', ['$event'])\n public mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false\n })\n .toPromise()\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n const component = this._tooltipComponent;\n const element = this._tooltipElement;\n\n const exitAnimation = this._exitAnimation.create(element);\n\n exitAnimation.onDone(() =>\n {\n component.destroy();\n exitAnimation.destroy();\n });\n \n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n\n exitAnimation.play();\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n this._document.body.appendChild(this._tooltipElement);\n this._enterAnimation.create(this._tooltipElement).play();\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.tooltipTemplate ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tooltipTemplate.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltipTemplate.context.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.context.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context passed to template of tooltip\n */\nexport interface TooltipTemplateContext<TData = any>\n{\n /**\n * Data that should be displayed in tooltip\n */\n $implicit: TData;\n}"]}
@@ -8,6 +8,13 @@ export class TooltipTemplateDirective {
8
8
  constructor(template) {
9
9
  this.template = template;
10
10
  }
11
+ //######################### ng language server #########################
12
+ /**
13
+ * Allows typechecking for template
14
+ */
15
+ static ngTemplateContextGuard(_dir, _ctx) {
16
+ return true;
17
+ }
11
18
  }
12
19
  TooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
13
20
  TooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: TooltipTemplateDirective, selector: "[tooltipTemplate]", ngImport: i0 });
@@ -1 +1 @@
1
- {"version":3,"file":"tooltipTemplate.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;;AAErD;;GAEG;AAKH,MAAM,OAAO,wBAAwB;IAEjC,iEAAiE;IACjE,YAAmB,QAA4B;QAA5B,aAAQ,GAAR,QAAQ,CAAoB;IAE/C,CAAC;;qHALQ,wBAAwB;yGAAxB,wBAAwB;2FAAxB,wBAAwB;kBAJpC,SAAS;mBACV;oBACI,QAAQ,EAAE,mBAAmB;iBAChC","sourcesContent":["import {Directive, TemplateRef} from '@angular/core';\n\n/**\n * Directive used for obtaining custom tooltip template\n */\n@Directive(\n{\n selector: '[tooltipTemplate]'\n})\nexport class TooltipTemplateDirective<TData = any>\n{\n //######################### constructor #########################\n constructor(public template: TemplateRef<TData>)\n {\n }\n}"]}
1
+ {"version":3,"file":"tooltipTemplate.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;;AAIrD;;GAEG;AAKH,MAAM,OAAO,wBAAwB;IAEjC,iEAAiE;IACjE,YAAmB,QAAoD;QAApD,aAAQ,GAAR,QAAQ,CAA4C;IAEvE,CAAC;IAED,wEAAwE;IAExE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAA8B,EAAE,IAAa;QAEvE,OAAO,IAAI,CAAC;IAChB,CAAC;;qHAfQ,wBAAwB;yGAAxB,wBAAwB;2FAAxB,wBAAwB;kBAJpC,SAAS;mBACV;oBACI,QAAQ,EAAE,mBAAmB;iBAChC","sourcesContent":["import {Directive, TemplateRef} from '@angular/core';\n\nimport {TooltipTemplateContext} from './tooltipTemplate.context';\n\n/**\n * Directive used for obtaining custom tooltip template\n */\n@Directive(\n{\n selector: '[tooltipTemplate]'\n})\nexport class TooltipTemplateDirective<TData = any>\n{\n //######################### constructor #########################\n constructor(public template: TemplateRef<TooltipTemplateContext<TData>>)\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Allows typechecking for template\n */\n static ngTemplateContextGuard(_dir: TooltipTemplateDirective, _ctx: unknown): _ctx is TooltipTemplateContext\n {\n return true;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.interface.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/misc/tooltip.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {TemplateRef, Type} from '@angular/core';\n\nimport {PositionOptions} from '../../../services/position';\n\n/**\n * Represents component that is used for rendering tooltip\n */\nexport interface TooltipRenderer<TData = any>\n{\n //######################### properties #########################\n\n /**\n * Data that are rendered in tooltip\n */\n data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n template: TemplateRef<TData>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n allowHtml: boolean;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n cssClass: string|null|undefined;\n\n //######################### methods #########################\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 registerHoverEvents(enter: () => void, leave: () => void): void;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}\n\n/**\n * Options used for tooltip directive\n */\nexport interface TooltipOptions\n{\n /**\n * Delay for displaying of tooltip on hover\n */\n delay: number;\n\n /**\n * Position where should tooltip appear relative to its parent\n */\n position: Pick<PositionOptions, 'placement'|'offset'>;\n\n /**\n * Allows selection of text in tooltip\n */\n allowSelection: boolean|null;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n tooltipCssClass: string|null;\n\n /**\n * Indication whether stop propagation of \"hover\" event\n */\n stopPropagation: boolean|null;\n\n /**\n * Type of tooltip renderer that is used for rendering tooltip\n */\n tooltipRenderer: Type<TooltipRenderer>;\n}"]}
1
+ {"version":3,"file":"tooltip.interface.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/misc/tooltip.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {TemplateRef, Type} from '@angular/core';\nimport {AnimationMetadata} from '@angular/animations';\n\nimport {PositionOptions} from '../../../services/position';\nimport {TooltipTemplateContext} from '../directives';\n\n/**\n * Represents component that is used for rendering tooltip\n */\nexport interface TooltipRenderer<TData = any>\n{\n //######################### properties #########################\n\n /**\n * Data that are rendered in tooltip\n */\n data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n template: TemplateRef<TooltipTemplateContext<TData>>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n allowHtml: boolean;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n cssClass: string|null|undefined;\n\n //######################### methods #########################\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 registerHoverEvents(enter: () => void, leave: () => void): void;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}\n\n/**\n * Options used for tooltip directive\n */\nexport interface TooltipOptions\n{\n /**\n * Delay for displaying of tooltip on hover\n */\n delay: number;\n\n /**\n * Position where should tooltip appear relative to its parent\n */\n position: Pick<PositionOptions, 'placement'|'offset'>;\n\n /**\n * Allows selection of text in tooltip\n */\n allowSelection: boolean|null;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n tooltipCssClass: string|null;\n\n /**\n * Indication whether stop propagation of \"hover\" event\n */\n stopPropagation: boolean|null;\n\n /**\n * Type of tooltip renderer that is used for rendering tooltip\n */\n tooltipRenderer: Type<TooltipRenderer>;\n\n /**\n * Animation used to tooltip component when it is displayed\n */\n enterAnimation: AnimationMetadata;\n\n /**\n * Animation used to tooltip component when it is hidden\n */\n exitAnimation: AnimationMetadata;\n}"]}
@@ -3,4 +3,5 @@ export * from './isPresent/isPresent.pipe';
3
3
  export * from './isNaN/isNaN.pipe';
4
4
  export * from './localize/localize.pipe';
5
5
  export * from './mergeCssClasses/mergeCssClasses.pipe';
6
+ export * from './keys/keys.pipe';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC","sourcesContent":["export * from './urlEncode/urlEncode.pipe';\nexport * from './isPresent/isPresent.pipe';\nexport * from './isNaN/isNaN.pipe';\nexport * from './localize/localize.pipe';\nexport * from './mergeCssClasses/mergeCssClasses.pipe';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './urlEncode/urlEncode.pipe';\nexport * from './isPresent/isPresent.pipe';\nexport * from './isNaN/isNaN.pipe';\nexport * from './localize/localize.pipe';\nexport * from './mergeCssClasses/mergeCssClasses.pipe';\nexport * from './keys/keys.pipe';\n"]}
@@ -0,0 +1,25 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { isBlank } from '@jscrpt/common';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Gets object keys/property names
6
+ */
7
+ export class KeysPipe {
8
+ /**
9
+ * Gets object keys/property names
10
+ * @param value - Object containing keys which will be obtained
11
+ */
12
+ transform(value) {
13
+ if (isBlank(value)) {
14
+ return [];
15
+ }
16
+ return Object.keys(value);
17
+ }
18
+ }
19
+ KeysPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
20
+ KeysPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: KeysPipe, name: "keys" });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: KeysPipe, decorators: [{
22
+ type: Pipe,
23
+ args: [{ name: 'keys' }]
24
+ }] });
25
+ //# sourceMappingURL=keys.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keys.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/keys/keys.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAa,OAAO,EAAC,MAAM,gBAAgB,CAAC;;AAEnD;;GAEG;AAEH,MAAM,OAAO,QAAQ;IAEjB;;;OAGG;IACI,SAAS,CAAC,KAAsB;QAEnC,IAAG,OAAO,CAAC,KAAK,CAAC,EACjB;YACI,OAAO,EAAE,CAAC;SACb;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;;qGAdQ,QAAQ;mGAAR,QAAQ;2FAAR,QAAQ;kBADpB,IAAI;mBAAC,EAAC,IAAI,EAAE,MAAM,EAAC","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {Dictionary, isBlank} from '@jscrpt/common';\n\n/**\n * Gets object keys/property names\n */\n@Pipe({name: 'keys'})\nexport class KeysPipe implements PipeTransform\n{\n /**\n * Gets object keys/property names\n * @param value - Object containing keys which will be obtained\n */\n public transform(value: Dictionary<any>): string[]\n {\n if(isBlank(value))\n {\n return [];\n }\n\n return Object.keys(value);\n }\n}\n"]}
@@ -17,5 +17,6 @@ export * from './modules/numberInput.module';
17
17
  export * from './modules/hasError.module';
18
18
  export * from './modules/requiredClass.module';
19
19
  export * from './modules/formPipes';
20
+ export * from './modules/errorMessage';
20
21
  export * from './misc/formModel';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,yDAAyD,CAAC;AACxE,cAAc,oEAAoE,CAAC;AACnF,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oEAAoE,CAAC;AACnF,cAAc,kEAAkE,CAAC;AACjF,cAAc,sEAAsE,CAAC;AACrF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,yDAAyD,CAAC;AACxE,cAAc,oEAAoE,CAAC;AACnF,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oEAAoE,CAAC;AACnF,cAAc,kEAAkE,CAAC;AACjF,cAAc,sEAAsE,CAAC;AACrF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import { FormControlStatus, FormGroup, FormGroupDirective, FormGroupName } from '@angular/forms';
3
+ import { Subscription } from 'rxjs';
4
+ import { GroupErrorsTemplateDirective } from '../../directives';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Component used for rendering from group errors
8
+ */
9
+ export declare class GroupErrorsComponent implements OnInit, OnDestroy {
10
+ protected formGroupDirective: FormGroupDirective;
11
+ protected formGroupName: FormGroupName;
12
+ protected _changeDetector: ChangeDetectorRef;
13
+ /**
14
+ * Instance of currently used form group
15
+ */
16
+ protected _formGroup?: FormGroup;
17
+ /**
18
+ * Subscriptions created during initialization
19
+ */
20
+ protected _initSubscriptions: Subscription;
21
+ /**
22
+ * Last state of form control
23
+ */
24
+ protected _lastState?: FormControlStatus;
25
+ /**
26
+ * Gets instance of currently used form group
27
+ * @internal
28
+ */
29
+ get formGroup(): FormGroup;
30
+ /**
31
+ * Css classes that are applied to default rendered divs
32
+ */
33
+ cssClass: string;
34
+ /**
35
+ * Custom template for rendering form group error
36
+ */
37
+ template?: GroupErrorsTemplateDirective;
38
+ constructor(formGroupDirective: FormGroupDirective, formGroupName: FormGroupName, _changeDetector: ChangeDetectorRef);
39
+ /**
40
+ * Initialize component
41
+ */
42
+ ngOnInit(): void;
43
+ /**
44
+ * Called when component is destroyed
45
+ */
46
+ ngOnDestroy(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<GroupErrorsComponent, [{ optional: true; }, { optional: true; }, null]>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<GroupErrorsComponent, "form-group-errors", never, { "cssClass": "cssClass"; }, {}, ["template"], never>;
49
+ }
50
+ //# sourceMappingURL=groupErrors.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupErrors.component.d.ts","sourceRoot":"","sources":["groupErrors.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAsB,MAAM,eAAe,CAAC;AACtI,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,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;AACH,qBAMa,oBAAqB,YAAW,MAAM,EAAE,SAAS;IA+ClC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB;IAChD,SAAS,CAAC,aAAa,EAAE,aAAa;IAClD,SAAS,CAAC,eAAe,EAAE,iBAAiB;IA7CxD;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,kBAAkB,EAAE,YAAY,CAAsB;IAEhE;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAIzC;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAGhC;IAID;;OAEG;IAEI,QAAQ,EAAE,MAAM,CAAC;IAIxB;;OAEG;IAEI,QAAQ,CAAC,EAAE,4BAA4B,CAAC;gBAGb,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EACxC,eAAe,EAAE,iBAAiB;IAUxD;;OAEG;IACI,QAAQ,IAAI,IAAI;IAcvB;;OAEG;IACI,WAAW,IAAI,IAAI;yCA/EjB,oBAAoB;2CAApB,oBAAoB;CAoFhC"}
@@ -0,0 +1,7 @@
1
+ <ng-template #defaultTemplate let-errorName>
2
+ <div [ngClass]="cssClass" [errorMessage]="errorName" [errors]="formGroup.errors"></div>
3
+ </ng-template>
4
+
5
+ <ng-container *ngFor="let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index">
6
+ <ng-container *ngTemplateOutlet="template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}"></ng-container>
7
+ </ng-container>
@@ -0,0 +1,2 @@
1
+ export * from './groupErrors/groupErrors.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { StringLocalization } from '@anglr/common';
3
+ import { Dictionary, StringDictionary } from '@jscrpt/common';
4
+ import { Subscription } from 'rxjs';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Directive used for displaying form error message
8
+ */
9
+ export declare class ErrorMessageDirective implements OnChanges, OnDestroy {
10
+ protected _element: ElementRef<HTMLElement>;
11
+ protected _localization: StringLocalization;
12
+ protected _errorMessages: StringDictionary;
13
+ /**
14
+ * Subscriptions created during initialization
15
+ */
16
+ protected _initSubscriptions: Subscription;
17
+ /**
18
+ * Name/code of error message to be displayed
19
+ */
20
+ errorName: string;
21
+ /**
22
+ * Object storing all errors
23
+ */
24
+ errors: Dictionary;
25
+ constructor(_element: ElementRef<HTMLElement>, _localization: StringLocalization, _errorMessages: StringDictionary);
26
+ /**
27
+ * Called when input value changes
28
+ */
29
+ ngOnChanges(changes: SimpleChanges): void;
30
+ /**
31
+ * Called when component is destroyed
32
+ */
33
+ ngOnDestroy(): void;
34
+ /**
35
+ * Shows message inside of element
36
+ */
37
+ protected _showMessage(): void;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessageDirective, never>;
39
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ErrorMessageDirective, "[errorMessage]", ["errorMessage"], { "errorName": "errorMessage"; "errors": "errors"; }, {}, never>;
40
+ }
41
+ //# sourceMappingURL=errorMessage.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessage.directive.d.ts","sourceRoot":"","sources":["errorMessage.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAiB,SAAS,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACxG,OAAO,EAAC,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAmB,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;;AAIlC;;GAEG;AACH,qBAKa,qBAAsB,YAAW,SAAS,EAAE,SAAS;IAwBlD,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC;IACd,SAAS,CAAC,aAAa,EAAE,kBAAkB;IACrC,SAAS,CAAC,cAAc,EAAE,gBAAgB;IAtBzF;;OAEG;IACH,SAAS,CAAC,kBAAkB,EAAE,YAAY,CAAsB;IAIhE;;OAEG;IAEI,SAAS,EAAE,MAAM,CAAC;IAEzB;;OAEG;IAEI,MAAM,EAAE,UAAU,CAAC;gBAGJ,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,EACJ,aAAa,EAAE,kBAAkB,EAC3B,cAAc,EAAE,gBAAgB;IAOzF;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAUhD;;OAEG;IACI,WAAW,IAAI,IAAI;IAQ1B;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;yCA5DrB,qBAAqB;2CAArB,qBAAqB;CA0EjC"}
@@ -0,0 +1,27 @@
1
+ import { Dictionary } from '@jscrpt/common';
2
+ /**
3
+ * Context passed to template of group error
4
+ */
5
+ export interface GroupErrorsTemplateContext {
6
+ /**
7
+ * Name/code of error
8
+ */
9
+ $implicit: string;
10
+ /**
11
+ * Indication whether rendered error is last
12
+ */
13
+ last: boolean;
14
+ /**
15
+ * Indication whether rendered error is first
16
+ */
17
+ first: boolean;
18
+ /**
19
+ * Index of currently rendered item
20
+ */
21
+ index: number;
22
+ /**
23
+ * Object storing all errors for form group
24
+ */
25
+ errors: Dictionary;
26
+ }
27
+ //# sourceMappingURL=groupErrorsTemplate.context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupErrorsTemplate.context.d.ts","sourceRoot":"","sources":["groupErrorsTemplate.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAEvC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;CACtB"}
@@ -0,0 +1,17 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { GroupErrorsTemplateContext } from './groupErrorsTemplate.context';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Obtains template for displaying form group error
6
+ */
7
+ export declare class GroupErrorsTemplateDirective {
8
+ template: TemplateRef<GroupErrorsTemplateContext>;
9
+ constructor(template: TemplateRef<GroupErrorsTemplateContext>);
10
+ /**
11
+ * Allows typechecking for template
12
+ */
13
+ static ngTemplateContextGuard(_dir: GroupErrorsTemplateDirective, _ctx: unknown): _ctx is GroupErrorsTemplateContext;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<GroupErrorsTemplateDirective, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GroupErrorsTemplateDirective, "[formGroupError]", never, {}, {}, never>;
16
+ }
17
+ //# sourceMappingURL=groupErrorsTemplate.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupErrorsTemplate.directive.d.ts","sourceRoot":"","sources":["groupErrorsTemplate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;;AAEzE;;GAEG;AACH,qBAIa,4BAA4B;IAGlB,QAAQ,EAAE,WAAW,CAAC,0BAA0B,CAAC;gBAAjD,QAAQ,EAAE,WAAW,CAAC,0BAA0B,CAAC;IAMpE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,0BAA0B;yCAZ3G,4BAA4B;2CAA5B,4BAA4B;CAgBxC"}
@@ -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.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './components';
2
+ export * from './directives';
3
+ export * from './modules';
4
+ export * from './pipes';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "../pipes/withErrorMessage/withErrorMessage.pipe";
3
+ import * as i2 from "../directives/errorMessage/errorMessage.directive";
4
+ import * as i3 from "../directives/groupErrorsTemplate/groupErrorsTemplate.directive";
5
+ import * as i4 from "../components/groupErrors/groupErrors.component";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "@anglr/common";
8
+ /**
9
+ * Module for error message directives, pipes and components
10
+ */
11
+ export declare class ErrorMessageModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessageModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ErrorMessageModule, [typeof i1.WithErrorMessagePipe, typeof i2.ErrorMessageDirective, typeof i3.GroupErrorsTemplateDirective, typeof i4.GroupErrorsComponent], [typeof i5.CommonModule, typeof i6.CommonUtilsModule], [typeof i1.WithErrorMessagePipe, typeof i2.ErrorMessageDirective, typeof i3.GroupErrorsTemplateDirective, typeof i4.GroupErrorsComponent]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<ErrorMessageModule>;
15
+ }
16
+ //# sourceMappingURL=errorMessage.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessage.module.d.ts","sourceRoot":"","sources":["errorMessage.module.ts"],"names":[],"mappings":";;;;;;;AAQA;;GAEG;AACH,qBAsBa,kBAAkB;yCAAlB,kBAAkB;0CAAlB,kBAAkB;0CAAlB,kBAAkB;CAE9B"}
@@ -0,0 +1,2 @@
1
+ export * from './errorMessage.module';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './withErrorMessage/withErrorMessage.pipe';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { StringDictionary } from '@jscrpt/common';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Filters array of errors with messages
6
+ */
7
+ export declare class WithErrorMessagePipe implements PipeTransform {
8
+ protected _errorMessages: StringDictionary;
9
+ constructor(_errorMessages: StringDictionary);
10
+ /**
11
+ * Filters array of errors with messages
12
+ * @param value - Array of error names
13
+ */
14
+ transform(value: string[]): string[];
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<WithErrorMessagePipe, never>;
16
+ static ɵpipe: i0.ɵɵPipeDeclaration<WithErrorMessagePipe, "withErrorMessage">;
17
+ }
18
+ //# sourceMappingURL=withErrorMessage.pipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withErrorMessage.pipe.d.ts","sourceRoot":"","sources":["withErrorMessage.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;;AAIhD;;GAEG;AACH,qBACa,oBAAqB,YAAW,aAAa;IAGP,SAAS,CAAC,cAAc,EAAE,gBAAgB;gBAAhC,cAAc,EAAE,gBAAgB;IAMzF;;;OAGG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;yCAblC,oBAAoB;uCAApB,oBAAoB;CAsBhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "11.3.0-beta.20220412054621",
3
+ "version": "11.3.0-beta.20220413080437",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -4,12 +4,17 @@ import * as i0 from "@angular/core";
4
4
  * Directive that handles click outside of element
5
5
  */
6
6
  export declare class ClickOutsideDirective implements OnInit, OnDestroy {
7
- private _element;
8
- private _document;
7
+ protected _element: ElementRef<HTMLElement>;
8
+ protected _document: Document;
9
9
  /**
10
10
  * Variable that is used for displaying element that handles click outside
11
11
  */
12
- clickOutsideCondition: boolean;
12
+ protected _clickOutsideCondition: boolean;
13
+ /**
14
+ * Variable that is used for displaying element that handles click outside
15
+ */
16
+ get clickOutsideCondition(): boolean;
17
+ set clickOutsideCondition(value: boolean);
13
18
  /**
14
19
  * Additional element that is checked for click
15
20
  */
@@ -32,6 +37,10 @@ export declare class ClickOutsideDirective implements OnInit, OnDestroy {
32
37
  * @param event - Mouse event object
33
38
  */
34
39
  protected _handleClickOutside: (event: MouseEvent) => void;
40
+ /**
41
+ * Custom input type for `clickOutsideCondition` input
42
+ */
43
+ static ngAcceptInputType_clickOutsideCondition: boolean | '';
35
44
  static ɵfac: i0.ɵɵFactoryDeclaration<ClickOutsideDirective, never>;
36
45
  static ɵdir: i0.ɵɵDirectiveDeclaration<ClickOutsideDirective, "[clickOutside]", never, { "clickOutsideCondition": "clickOutside"; "clickOutsideElement": "clickOutsideElement"; }, { "clickOutsideConditionChange": "clickOutsideChange"; }, never>;
37
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"clickOutside.directive.d.ts","sourceRoot":"","sources":["clickOutside.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,SAAS,EAAS,YAAY,EAAU,UAAU,EAAS,MAAM,eAAe,CAAC;;AAI5G;;GAEG;AACH,qBAIa,qBAAsB,YAAW,MAAM,EAAE,SAAS;IAyB/C,OAAO,CAAC,QAAQ;IACE,OAAO,CAAC,SAAS;IAtB/C;;OAEG;IAEI,qBAAqB,EAAE,OAAO,CAAC;IAEtC;;OAEG;IAEI,mBAAmB,EAAE,WAAW,CAAC;IAIxC;;OAEG;IAEI,2BAA2B,EAAE,YAAY,CAAC,OAAO,CAAC,CAA+B;gBAGpE,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,EACf,SAAS,EAAE,QAAQ;IAMzD;;OAEG;IACI,QAAQ,IAAI,IAAI;IAOvB;;OAEG;IACI,WAAW,IAAI,IAAI;IAO1B;;;OAGG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