@anglr/common 14.2.0 → 15.0.0-beta.20221026053714

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 (66) hide show
  1. package/changelog.md +45 -0
  2. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +80 -62
  3. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2015/material/src/directives/confirmationDialog/confirmationDialog.directive.js +7 -5
  5. package/es2015/material/src/directives/confirmationDialog/confirmationDialog.directive.js.map +1 -1
  6. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +55 -19
  7. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  8. package/es2015/src/modules/progressIndicator/interceptors/progressInterceptor.js +1 -1
  9. package/es2015/src/modules/progressIndicator/interceptors/progressInterceptor.js.map +1 -1
  10. package/es2015/src/modules/tooltip/directives/tooltip/tooltip.directive.js +6 -6
  11. package/es2015/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
  12. package/es2015/src/services/position/position.interface.js.map +1 -1
  13. package/es2015/src/services/position/position.types.js.map +1 -1
  14. package/es2015/src/utils/index.js +1 -1
  15. package/es2015/src/utils/index.js.map +1 -1
  16. package/es2015/structured-log/src/services/rest/restSink.service.js +4 -2
  17. package/es2015/structured-log/src/services/rest/restSink.service.js.map +1 -1
  18. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +80 -62
  19. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  20. package/es2020/material/src/directives/confirmationDialog/confirmationDialog.directive.js +6 -5
  21. package/es2020/material/src/directives/confirmationDialog/confirmationDialog.directive.js.map +1 -1
  22. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +56 -19
  23. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  24. package/es2020/src/modules/progressIndicator/interceptors/progressInterceptor.js +1 -1
  25. package/es2020/src/modules/progressIndicator/interceptors/progressInterceptor.js.map +1 -1
  26. package/es2020/src/modules/tooltip/directives/tooltip/tooltip.directive.js +6 -6
  27. package/es2020/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
  28. package/es2020/src/services/position/position.interface.js.map +1 -1
  29. package/es2020/src/services/position/position.types.js.map +1 -1
  30. package/es2020/src/utils/index.js +1 -1
  31. package/es2020/src/utils/index.js.map +1 -1
  32. package/es2020/structured-log/src/services/rest/restSink.service.js +3 -2
  33. package/es2020/structured-log/src/services/rest/restSink.service.js.map +1 -1
  34. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  35. package/material/src/directives/confirmationDialog/confirmationDialog.directive.d.ts +4 -4
  36. package/material/src/directives/confirmationDialog/confirmationDialog.directive.d.ts.map +1 -1
  37. package/package.json +31 -28
  38. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +35 -14
  39. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -1
  40. package/src/modules/progressIndicator/interceptors/progressInterceptor.d.ts.map +1 -1
  41. package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +1 -1
  42. package/src/services/position/position.interface.d.ts +51 -3
  43. package/src/services/position/position.interface.d.ts.map +1 -1
  44. package/src/services/position/position.types.d.ts +4 -0
  45. package/src/services/position/position.types.d.ts.map +1 -1
  46. package/structured-log/src/services/rest/restSink.service.d.ts.map +1 -1
  47. package/{positions/src/types/positions.typings.d.ts → typings/positions/index.d.ts} +12 -4
  48. package/typings/store/index.d.ts +5 -0
  49. package/{structured-log/src/types/structured-log.typings.d.ts → typings/structured-log/index.d.ts} +49 -13
  50. package/version.bak +1 -1
  51. package/es2015/positions/src/types/positions.typings.js +0 -2
  52. package/es2015/positions/src/types/positions.typings.js.map +0 -1
  53. package/es2015/store/src/types/store.typings.js +0 -2
  54. package/es2015/store/src/types/store.typings.js.map +0 -1
  55. package/es2015/structured-log/src/types/structured-log.typings.js +0 -2
  56. package/es2015/structured-log/src/types/structured-log.typings.js.map +0 -1
  57. package/es2020/positions/src/types/positions.typings.js +0 -2
  58. package/es2020/positions/src/types/positions.typings.js.map +0 -1
  59. package/es2020/store/src/types/store.typings.js +0 -2
  60. package/es2020/store/src/types/store.typings.js.map +0 -1
  61. package/es2020/structured-log/src/types/structured-log.typings.js +0 -2
  62. package/es2020/structured-log/src/types/structured-log.typings.js.map +0 -1
  63. package/positions/src/types/positions.typings.d.ts.map +0 -1
  64. package/store/src/types/store.typings.d.ts +0 -4
  65. package/store/src/types/store.typings.d.ts.map +0 -1
  66. package/structured-log/src/types/structured-log.typings.d.ts.map +0 -1
@@ -8,41 +8,53 @@ import * as i0 from "@angular/core";
8
8
  */
9
9
  export class PositionToDirective {
10
10
  //######################### constructor #########################
11
- constructor(_target, _position) {
12
- this._target = _target;
13
- this._position = _position;
14
- // //######################### public properties - outputs #########################
11
+ constructor(target, position) {
12
+ this.target = target;
13
+ this.position = position;
14
+ /**
15
+ * Offset which allows moving target element along the cross axis of placement, or any chosed direction
16
+ */
17
+ this.offset = 'None';
18
+ /**
19
+ * Indication whether set up 'auto updating' of position
20
+ */
21
+ this.autoUpdate = true;
22
+ //######################### public properties - outputs #########################
15
23
  /**
16
24
  * Occurs when flip occurs during positioning
17
25
  */
18
26
  this.flip = new EventEmitter();
27
+ /**
28
+ * Occurs when element was positioned
29
+ */
30
+ this.done = new EventEmitter();
19
31
  }
20
32
  //######################### public properties - inputs #########################
21
33
  /**
22
34
  * Gets or sets html element which is used as source for positioning
23
35
  */
24
36
  get source() {
25
- return this._source;
37
+ return this.ɵSource;
26
38
  }
27
39
  set source(value) {
28
40
  if (value instanceof ElementRef) {
29
- this._source = value.nativeElement;
41
+ this.ɵSource = value.nativeElement;
30
42
  return;
31
43
  }
32
- this._source = value;
44
+ this.ɵSource = value;
33
45
  }
34
46
  /**
35
47
  * Gets or sets position placement value
36
48
  */
37
49
  get placement() {
38
- return this._placement;
50
+ return this.ɵPlacement;
39
51
  }
40
52
  set placement(value) {
41
53
  if (isString(value)) {
42
- this._placement = PositionPlacement[value];
54
+ this.ɵPlacement = PositionPlacement[value];
43
55
  return;
44
56
  }
45
- this._placement = value;
57
+ this.ɵPlacement = value;
46
58
  }
47
59
  //######################### public methods - implementation of OnChanges #########################
48
60
  /**
@@ -55,24 +67,43 @@ export class PositionToDirective {
55
67
  this._applyPosition();
56
68
  }
57
69
  }
70
+ //######################### public methods - implementation of OnDestroy #########################
71
+ /**
72
+ * Called when component is destroyed
73
+ */
74
+ ngOnDestroy() {
75
+ this.dispose?.();
76
+ }
58
77
  //######################### protected methods #########################
59
78
  /**
60
79
  * Applies position according to specified parameters to specified elements
61
80
  */
62
- async _applyPosition() {
63
- const options = {};
64
- if (this._placement) {
65
- options.placement = this._placement;
81
+ _applyPosition() {
82
+ if (!this.ɵSource) {
83
+ return;
66
84
  }
67
- const result = await this._position.placeElement(this._target.nativeElement, this._source, options).toPromise();
68
- applyPositionResult(result);
69
- if (result.flip) {
70
- this.flip.next();
85
+ const options = {
86
+ flip: true,
87
+ autoUpdate: this.autoUpdate,
88
+ offset: this.offset,
89
+ };
90
+ if (this.ɵPlacement) {
91
+ options.placement = this.ɵPlacement;
71
92
  }
93
+ this.dispose?.();
94
+ this.position.placeElement(this.target.nativeElement, this.ɵSource, options)
95
+ .subscribe(result => {
96
+ this.dispose = result.dispose;
97
+ applyPositionResult(result);
98
+ if (result.flip) {
99
+ this.flip.emit();
100
+ }
101
+ this.done.emit();
102
+ });
72
103
  }
73
104
  }
74
105
  PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: POSITION }], target: i0.ɵɵFactoryTarget.Directive });
75
- PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement" }, outputs: { flip: "flip" }, usesOnChanges: true, ngImport: i0 });
106
+ PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement", offset: "offset", autoUpdate: "autoUpdate" }, outputs: { flip: "flip", done: "done" }, usesOnChanges: true, ngImport: i0 });
76
107
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PositionToDirective, decorators: [{
77
108
  type: Directive,
78
109
  args: [{
@@ -86,7 +117,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
86
117
  args: ['positionTo']
87
118
  }], placement: [{
88
119
  type: Input
120
+ }], offset: [{
121
+ type: Input
122
+ }], autoUpdate: [{
123
+ type: Input
89
124
  }], flip: [{
90
125
  type: Output
126
+ }], done: [{
127
+ type: Output
91
128
  }] } });
92
129
  //# 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,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,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C;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 `source` input\n */\n public static ngAcceptInputType_source: 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,EAAY,MAAM,eAAe,CAAC;AAC9H,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAoB,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAC,mBAAmB,EAAY,iBAAiB,EAA+F,MAAM,+BAA+B,CAAC;AAC7L,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;;AAElD;;GAEG;AAKH,MAAM,OAAO,mBAAmB;IAuF5B,iEAAiE;IACjE,YAAsB,MAA+B,EACb,QAAkB;QADpC,WAAM,GAAN,MAAM,CAAyB;QACb,aAAQ,GAAR,QAAQ,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AAC,OAAO,EAChB;YACI,OAAO;SACV;QAED,MAAM,OAAO,GACb;YACI,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC;QAEF,IAAG,IAAI,CAAC,UAAU,EAClB;YACI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;SACvC;QAED,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAEjB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EACxB,IAAI,CAAC,OAAO,EACZ,OAAO,CAAC;aAC/B,SAAS,CAAC,MAAM,CAAC,EAAE;YAEhB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAE9B,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAE5B,IAAG,MAAM,CAAC,IAAI,EACd;gBACI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aACpB;YAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACX,CAAC;;gHAhKQ,mBAAmB,4CAyFR,QAAQ;oGAzFnB,mBAAmB;2FAAnB,mBAAmB;kBAJ/B,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;;0BA0FgB,MAAM;2BAAC,QAAQ;4CAhEjB,MAAM;sBADhB,KAAK;uBAAC,YAAY;gBAqBR,SAAS;sBADnB,KAAK;gBAqBC,MAAM;sBADZ,KAAK;gBAOC,UAAU;sBADhB,KAAK;gBASC,IAAI;sBADV,MAAM;gBAOA,IAAI;sBADV,MAAM","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject, Output, EventEmitter, OnDestroy} from '@angular/core';\nimport {nameof, isPresent, isString, Func1, NoopAction} from '@jscrpt/common';\n\nimport {applyPositionResult, Position, PositionPlacement, PositionOptions, PositionOffsetString, PositionOffsets, PositionArguments, AutoUpdateOptions} 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, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Position placement value\n */\n protected ɵPlacement: PositionPlacement|undefined|null;\n\n /**\n * Html element which is used as source for positioning\n */\n protected ɵSource: HTMLElement|undefined|null;\n\n /**\n * Method used for disposing auto positioning\n */\n protected dispose: NoopAction|undefined|null;\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|undefined|null\n {\n return this.ɵSource;\n }\n public set source(value: HTMLElement|undefined|null)\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|undefined|null\n {\n return this.ɵPlacement;\n }\n public set placement(value: PositionPlacement|undefined|null)\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 /**\n * Offset which allows moving target element along the cross axis of placement, or any chosed direction\n */\n @Input()\n public offset: PositionOffsetString|number|PositionOffsets|Func1<number|PositionOffsets, PositionArguments> = 'None';\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n @Input()\n public autoUpdate: boolean|AutoUpdateOptions = true;\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 /**\n * Occurs when element was positioned\n */\n @Output()\n public done: 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 //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.dispose?.();\n }\n\n //######################### protected methods #########################\n\n /**\n * Applies position according to specified parameters to specified elements\n */\n protected _applyPosition(): void\n {\n if(!this.ɵSource)\n {\n return;\n }\n\n const options: Partial<PositionOptions> =\n {\n flip: true,\n autoUpdate: this.autoUpdate,\n offset: this.offset,\n };\n\n if(this.ɵPlacement)\n {\n options.placement = this.ɵPlacement;\n }\n\n this.dispose?.();\n\n this.position.placeElement(this.target.nativeElement,\n this.ɵSource,\n options)\n .subscribe(result =>\n {\n this.dispose = result.dispose;\n\n applyPositionResult(result);\n\n if(result.flip)\n {\n this.flip.emit();\n }\n\n this.done.emit();\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 `source` input\n */\n public static ngAcceptInputType_source: HTMLElement|ElementRef<HTMLElement>;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Injectable } from '@angular/core';
2
2
  import { HttpEventType, HTTP_INTERCEPTORS } from '@angular/common/http';
3
- import { tap } from 'rxjs/operators';
3
+ import { tap } from 'rxjs';
4
4
  import { ProgressIndicatorService } from '../services/progressIndicator.service';
5
5
  import { PROGRESS_INDICATOR_GROUP_NAME } from '../misc/tokens';
6
6
  import { IGNORED_INTERCEPTORS } from '../../../types/tokens';
@@ -1 +1 @@
1
- {"version":3,"file":"progressInterceptor.js","sourceRoot":"","sources":["../../../../../src/modules/progressIndicator/interceptors/progressInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgB,MAAM,eAAe,CAA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,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;;gHApCQ,mBAAmB;oHAAnB,mBAAmB;2FAAnB,mBAAmB;kBAD/B,UAAU;;AAwCX;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAC1C;IACI,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,mBAAmB;IAC7B,KAAK,EAAE,IAAI;CACd,CAAC","sourcesContent":["import {Injectable, ClassProvider} from '@angular/core';\nimport {HttpEvent, HttpInterceptor, HttpHandler, HttpEventType, HTTP_INTERCEPTORS, HttpRequest} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {tap} from 'rxjs/operators';\n\nimport {ProgressIndicatorService} from '../services/progressIndicator.service';\nimport {PROGRESS_INDICATOR_GROUP_NAME} from '../misc/tokens';\nimport {IGNORED_INTERCEPTORS} from '../../../types/tokens';\n\n/**\n * ProgressInterceptor used for intercepting http requests and displaying progress indicatior\n */\n@Injectable()\nexport class ProgressInterceptor implements HttpInterceptor\n{\n //######################### constructors #########################\n constructor(private _indicatorSvc: ProgressIndicatorService)\n {\n }\n\n //######################### public methods - implementation of HttpInterceptor #########################\n\n /**\n * Intercepts http request\n * @param req - Request to be intercepted\n * @param next - Next middleware that can be called for next processing\n */\n public intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>\n {\n return next.handle(req)\n .pipe(tap(event =>\n {\n //interceptor is ignored\n if(req.context.get(IGNORED_INTERCEPTORS).some(itm => itm == ProgressInterceptor))\n {\n return;\n }\n\n //request started\n if(event.type == HttpEventType.Sent)\n {\n this._indicatorSvc.showProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME));\n }\n //response received\n else if(event.type == HttpEventType.Response)\n {\n this._indicatorSvc.hideProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME));\n }\n }, () => this._indicatorSvc.hideProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME))));\n }\n}\n\n/**\n * Progress interceptor provider\n */\nexport const PROGRESS_INTERCEPTOR_PROVIDER: ClassProvider = \n{\n provide: HTTP_INTERCEPTORS, \n useClass: ProgressInterceptor, \n multi: true\n};"]}
1
+ {"version":3,"file":"progressInterceptor.js","sourceRoot":"","sources":["../../../../../src/modules/progressIndicator/interceptors/progressInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgB,MAAM,eAAe,CAAC;AACxD,OAAO,EAA0C,aAAa,EAAE,iBAAiB,EAAc,MAAM,sBAAsB,CAAC;AAC5H,OAAO,EAAa,GAAG,EAAC,MAAM,MAAM,CAAC;AAErC,OAAO,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAC,6BAA6B,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;;;AAE3D;;GAEG;AAEH,MAAM,OAAO,mBAAmB;IAE5B,kEAAkE;IAClE,YAAoB,aAAuC;QAAvC,kBAAa,GAAb,aAAa,CAA0B;IAE3D,CAAC;IAED,wGAAwG;IAExG;;;;OAIG;IACI,SAAS,CAAC,GAAyB,EAAE,IAAiB;QAEzD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;aAClB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAEd,wBAAwB;YACxB,IAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,mBAAmB,CAAC,EAChF;gBACI,OAAO;aACV;YAED,iBAAiB;YACjB,IAAG,KAAK,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,EACnC;gBACI,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC;aACnF;YACD,mBAAmB;iBACd,IAAG,KAAK,CAAC,IAAI,IAAI,aAAa,CAAC,QAAQ,EAC5C;gBACI,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC;aACnF;QACL,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;;gHApCQ,mBAAmB;oHAAnB,mBAAmB;2FAAnB,mBAAmB;kBAD/B,UAAU;;AAwCX;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAC1C;IACI,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,mBAAmB;IAC7B,KAAK,EAAE,IAAI;CACd,CAAC","sourcesContent":["import {Injectable, ClassProvider} from '@angular/core';\nimport {HttpEvent, HttpInterceptor, HttpHandler, HttpEventType, HTTP_INTERCEPTORS, HttpRequest} from '@angular/common/http';\nimport {Observable, tap} from 'rxjs';\n\nimport {ProgressIndicatorService} from '../services/progressIndicator.service';\nimport {PROGRESS_INDICATOR_GROUP_NAME} from '../misc/tokens';\nimport {IGNORED_INTERCEPTORS} from '../../../types/tokens';\n\n/**\n * ProgressInterceptor used for intercepting http requests and displaying progress indicatior\n */\n@Injectable()\nexport class ProgressInterceptor implements HttpInterceptor\n{\n //######################### constructors #########################\n constructor(private _indicatorSvc: ProgressIndicatorService)\n {\n }\n\n //######################### public methods - implementation of HttpInterceptor #########################\n\n /**\n * Intercepts http request\n * @param req - Request to be intercepted\n * @param next - Next middleware that can be called for next processing\n */\n public intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>\n {\n return next.handle(req)\n .pipe(tap(event =>\n {\n //interceptor is ignored\n if(req.context.get(IGNORED_INTERCEPTORS).some(itm => itm == ProgressInterceptor))\n {\n return;\n }\n\n //request started\n if(event.type == HttpEventType.Sent)\n {\n this._indicatorSvc.showProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME));\n }\n //response received\n else if(event.type == HttpEventType.Response)\n {\n this._indicatorSvc.hideProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME));\n }\n }, () => this._indicatorSvc.hideProgress(req.context.get(PROGRESS_INDICATOR_GROUP_NAME))));\n }\n}\n\n/**\n * Progress interceptor provider\n */\nexport const PROGRESS_INTERCEPTOR_PROVIDER: ClassProvider = \n{\n provide: HTTP_INTERCEPTORS, \n useClass: ProgressInterceptor, \n multi: true\n};"]}
@@ -3,9 +3,10 @@ import { AnimationBuilder } from '@angular/animations';
3
3
  import { DOCUMENT } from '@angular/common';
4
4
  import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
5
5
  import { extend, isBlank, isPresent, nameof } from '@jscrpt/common';
6
+ import { lastValueFrom } from 'rxjs';
6
7
  import { TooltipComponent } from '../../components/tooltip/tooltip.component';
7
8
  import { TOOLTIP_OPTIONS } from '../../misc/tokens';
8
- import { applyPositionResult, PositionOffset, PositionPlacement } from '../../../../services/position';
9
+ import { applyPositionResult, PositionPlacement } from '../../../../services/position';
9
10
  import { TooltipTemplateDirective } from '../tooltipTemplate/tooltipTemplate.directive';
10
11
  import { POSITION } from '../../../../types/tokens';
11
12
  import * as i0 from "@angular/core";
@@ -16,8 +17,8 @@ import * as i1 from "@angular/animations";
16
17
  const defaultOptions = {
17
18
  delay: 200,
18
19
  position: {
19
- offset: PositionOffset.MouseEnter,
20
- placement: PositionPlacement.TopStart
20
+ offset: nameof('MouseEnter'),
21
+ placement: PositionPlacement.TopStart,
21
22
  },
22
23
  allowSelection: false,
23
24
  tooltipRenderer: TooltipComponent,
@@ -149,14 +150,13 @@ export class TooltipDirective {
149
150
  return;
150
151
  }
151
152
  this._showData();
152
- this._position.placeElement(this._tooltipElement, this._element.nativeElement, {
153
+ lastValueFrom(this._position.placeElement(this._tooltipElement, this._element.nativeElement, {
153
154
  placement: this._options.position.placement,
154
155
  offset: this._options.position.offset,
155
156
  flip: true,
156
157
  mouseEvent: event,
157
158
  autoUpdate: false
158
- })
159
- .toPromise()
159
+ }))
160
160
  .then(result => applyPositionResult(result));
161
161
  }
162
162
  /**
@@ -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,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,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;AAEtF,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;IACtB,cAAc,EAAE,eAAe;IAC/B,aAAa,EAAE,gBAAgB;C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AwB;gBA6D/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 template?: 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 if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\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.template ?? 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,EAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAE5E,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAkD,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrI,OAAO,EAAC,wBAAwB,EAAC,MAAM,8CAA8C,CAAC;AAEtF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;;;AAElD;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,KAAK,EAAE,GAAG;IACV,QAAQ,EACR;QACI,MAAM,EAAE,MAAM,CAAwB,YAAY,CAAyB;QAC3E,SAAS,EAAE,iBAAiB,CAAC,QAAQ;KACxC;IACD,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,gBAAgB;IACjC,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,eAAe;IAC/B,aAAa,EAAE,gBAAgB;CAClC,CAAC;AAEF;;GAEG;AAKH,MAAM,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BAAC,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';\nimport {lastValueFrom} from 'rxjs';\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, PositionOffsetString, 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: nameof<typeof PositionOffset>('MouseEnter') as PositionOffsetString,\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 template?: 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 if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\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 lastValueFrom(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 .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.template ?? 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 +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 * 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
+ {"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Func1} from '@jscrpt/common';\nimport {Observable} from 'rxjs';\n\nimport {PositionOffsetString, 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 * Defines object which describes offsets for positioned element\n */\nexport interface PositionOffsets\n{\n /**\n * Distance between positioned and reference element.\n */\n mainAxis?: number;\n\n /**\n * Skidding between floating and reference element.\n */\n crossAxis?: number;\n\n /**\n * Works on the same axis as crossAxis but applies only to aligned placements and works logically. The offset is inverted for -end alignments.\n */\n alignmentAxis?: number|null;\n}\n\n/**\n * Stores positioned element and reference element\n */\nexport interface PositionElements<TElement extends Element = Element>\n{\n /**\n * Reference element against which is object positioned\n */\n reference: TElement;\n\n /**\n * Element that is positioned\n */\n floating: TElement;\n}\n\n/**\n * Arguments that are passed during positioning\n */\nexport interface PositionArguments<TElement extends Element = Element>\n{\n /**\n * X coordinate of positioned element\n */\n x: number;\n\n /**\n * Y coordinate of positioned element\n */\n y: number;\n\n /**\n * Elements that are being used during positioning\n */\n elements: PositionElements<TElement>;\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, or any chosed direction\n */\n offset: PositionOffsetString|number|PositionOffsets|Func1<number|PositionOffsets, PositionArguments>;\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":"position.types.js","sourceRoot":"","sources":["../../../../src/services/position/position.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,iBA6DX;AA7DD,WAAY,iBAAiB;IAEzB;;OAEG;IACH,uDAAG,CAAA;IAEH;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,yDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAS,CAAA;IAET;;OAEG;IACH,+DAAO,CAAA;IAEP;;OAEG;IACH,2DAAK,CAAA;IAEL;;OAEG;IACH,qEAAU,CAAA;IAEV;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,wEAAW,CAAA;IAEX;;OAEG;IACH,oEAAS,CAAA;AACb,CAAC,EA7DW,iBAAiB,KAAjB,iBAAiB,QA6D5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IAEtB;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,+DAAU,CAAA;IAEV;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;IAEZ;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;AAChB,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB","sourcesContent":["/**\n * Available positions for placement of target element against its source\n */\nexport enum PositionPlacement\n{\n /**\n * Target is placed on the top (above) of source element in the middle of its width\n */\n Top,\n\n /**\n * Target is placed on the top (above) of source element at the start (left) of its width\n */\n TopStart,\n\n /**\n * Target is placed on the top (above) of source element at the end (right) of its width\n */\n TopEnd,\n\n /**\n * Target is placed on the left (before) of source element in the middle of its height\n */\n Left,\n\n /**\n * Target is placed on the left (before) of source element at the start (top) of its height\n */\n LeftStart,\n\n /**\n * Target is placed on the left (before) of source element at the end (bottom) of its height\n */\n LeftEnd,\n\n /**\n * Target is placed on the right (after) of source element in the middle of its height\n */\n Right,\n\n /**\n * Target is placed on the right (after) of source element at the start (top) of its height\n */\n RightStart,\n\n /**\n * Target is placed on the right (after) of source element at the end (bottom) of its height\n */\n RightEnd,\n\n /**\n * Target is placed on the bottom (below) of source element in the middle of its width\n */\n Bottom,\n\n /**\n * Target is placed on the bottom (below) of source element at the start (left) of its width\n */\n BottomStart,\n\n /**\n * Target is placed on the bottom (below) of source element at the end (right) of its width\n */\n BottomEnd\n}\n\n/**\n * Applied offset to position of target in cross axis relative to placement\n */\nexport enum PositionOffset\n{\n /**\n * No offset applied\n */\n None,\n\n /**\n * Offset is calculated at the point where mouse enters source element\n */\n MouseEnter,\n\n /**\n * Positive offset equal to half of size of target\n */\n Half,\n\n /**\n * Negative offset equal to half of size of target\n */\n NegativeHalf,\n\n /**\n * Positive offset equal to full size of target\n */\n Full,\n\n /**\n * Negative offset equal to full size of target\n */\n NegativeFull\n}"]}
1
+ {"version":3,"file":"position.types.js","sourceRoot":"","sources":["../../../../src/services/position/position.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,iBA6DX;AA7DD,WAAY,iBAAiB;IAEzB;;OAEG;IACH,uDAAG,CAAA;IAEH;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,yDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAS,CAAA;IAET;;OAEG;IACH,+DAAO,CAAA;IAEP;;OAEG;IACH,2DAAK,CAAA;IAEL;;OAEG;IACH,qEAAU,CAAA;IAEV;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,wEAAW,CAAA;IAEX;;OAEG;IACH,oEAAS,CAAA;AACb,CAAC,EA7DW,iBAAiB,KAAjB,iBAAiB,QA6D5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IAEtB;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,+DAAU,CAAA;IAEV;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;IAEZ;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;AAChB,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB","sourcesContent":["/**\n * Available positions for placement of target element against its source\n */\nexport enum PositionPlacement\n{\n /**\n * Target is placed on the top (above) of source element in the middle of its width\n */\n Top,\n\n /**\n * Target is placed on the top (above) of source element at the start (left) of its width\n */\n TopStart,\n\n /**\n * Target is placed on the top (above) of source element at the end (right) of its width\n */\n TopEnd,\n\n /**\n * Target is placed on the left (before) of source element in the middle of its height\n */\n Left,\n\n /**\n * Target is placed on the left (before) of source element at the start (top) of its height\n */\n LeftStart,\n\n /**\n * Target is placed on the left (before) of source element at the end (bottom) of its height\n */\n LeftEnd,\n\n /**\n * Target is placed on the right (after) of source element in the middle of its height\n */\n Right,\n\n /**\n * Target is placed on the right (after) of source element at the start (top) of its height\n */\n RightStart,\n\n /**\n * Target is placed on the right (after) of source element at the end (bottom) of its height\n */\n RightEnd,\n\n /**\n * Target is placed on the bottom (below) of source element in the middle of its width\n */\n Bottom,\n\n /**\n * Target is placed on the bottom (below) of source element at the start (left) of its width\n */\n BottomStart,\n\n /**\n * Target is placed on the bottom (below) of source element at the end (right) of its width\n */\n BottomEnd\n}\n\n/**\n * Applied offset to position of target in cross axis relative to placement\n */\nexport enum PositionOffset\n{\n /**\n * No offset applied\n */\n None,\n\n /**\n * Offset is calculated at the point where mouse enters source element\n */\n MouseEnter,\n\n /**\n * Positive offset equal to half of size of target\n */\n Half,\n\n /**\n * Negative offset equal to half of size of target\n */\n NegativeHalf,\n\n /**\n * Positive offset equal to full size of target\n */\n Full,\n\n /**\n * Negative offset equal to full size of target\n */\n NegativeFull\n}\n\n/**\n * Type that represents available names of position offset\n */\nexport type PositionOffsetString = keyof typeof PositionOffset;"]}
@@ -1,6 +1,6 @@
1
1
  import { ApplicationRef, InjectionToken } from '@angular/core';
2
2
  import { enableDebugTools } from '@angular/platform-browser';
3
- import { filter, first } from 'rxjs/operators';
3
+ import { filter, first } from 'rxjs';
4
4
  /**
5
5
  * Method used for extraction of resolve method for promise
6
6
  * @param appStablePromise - Promise which contains resolve method that is going to be extracted
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,gBAA+B;IAEnE,OAAQ,gBAAwB,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB;IAEnC,IAAI,gBAAgB,CAAC;IACrB,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,gBAAgB,GAAG,OAAO,CAAC,CAAC;IAEjF,gBAAwB,CAAC,SAAS,GAAG,gBAAgB,CAAC;IAEvD,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAkC,IAAI,cAAc,CAAgB,YAAY,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAC,CAAC,CAAC;AAEjK;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,gBAA+C,EAAE,QAAmD,EAAE,eAAyB;IAE/J,eAAe,GAAG,eAAe,IAAI,KAAK,CAAC;IAE3C,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAA+B,EAAE,EAAE;QAEtD,MAAM,MAAM,GAAmB,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEtE,MAAM,CAAC,QAAQ;aACV,IAAI,CAAC,MAAM,CAAC,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAC,EACvC,KAAK,EAAE,CAAC;aACb,SAAS,CAAC,GAAG,EAAE;YAEZ,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE5D,IAAG,eAAe,EAClB;gBACI,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1C;YAED,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEpB,IAAG,gBAAgB,EACnB;gBACI,MAAM,eAAe,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;gBAElE,eAAe,EAAE,CAAC;aACrB;QACL,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {NgModuleRef, ApplicationRef, InjectionToken} from '@angular/core';\nimport {enableDebugTools} from '@angular/platform-browser';\nimport {filter, first} from 'rxjs/operators';\n\n/**\n * Method used for extraction of resolve method for promise\n * @param appStablePromise - Promise which contains resolve method that is going to be extracted\n */\nexport function extractAppStableResolve(appStablePromise: Promise<void>): () => void\n{\n return (appStablePromise as any).__resolve;\n}\n\n/**\n * Factory used for creating APP_STABLE promise\n * \n * @internal\n */\nexport function appStablePromiseFactory(): Promise<void>\n{\n let appStableResolve;\n const appStablePromise = new Promise<void>(resolve => appStableResolve = resolve);\n\n (appStablePromise as any).__resolve = appStableResolve;\n\n return appStablePromise;\n}\n\n/**\n * Injection token used for obtaining promise that is resolved when application is first time stable\n */\nexport const APP_STABLE: InjectionToken<Promise<void>> = new InjectionToken<Promise<void>>('APP_STABLE', {providedIn: 'root', factory: appStablePromiseFactory});\n\n/**\n * Runs callback function when angular module is bootstrapped and stable\n * @param moduleRefPromise - Promise for module that was bootstrapped\n * @param callback - Callback that is called\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenModuleStable(moduleRefPromise: Promise<NgModuleRef<unknown>>, callback: (moduleRef: NgModuleRef<unknown>) => void, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler || false;\n\n moduleRefPromise.then((moduleRef: NgModuleRef<unknown>) => \n {\n const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);\n\n appRef.isStable\n .pipe(filter((isStable: boolean) => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = moduleRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(moduleRef);\n\n if(appStablePromise)\n {\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n\n resolveAsStable();\n }\n });\n });\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,gBAA+B;IAEnE,OA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IACX,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {NgModuleRef, ApplicationRef, InjectionToken} from '@angular/core';\nimport {enableDebugTools} from '@angular/platform-browser';\nimport {filter, first} from 'rxjs';\n\n/**\n * Method used for extraction of resolve method for promise\n * @param appStablePromise - Promise which contains resolve method that is going to be extracted\n */\nexport function extractAppStableResolve(appStablePromise: Promise<void>): () => void\n{\n return (appStablePromise as any).__resolve;\n}\n\n/**\n * Factory used for creating APP_STABLE promise\n * \n * @internal\n */\nexport function appStablePromiseFactory(): Promise<void>\n{\n let appStableResolve;\n const appStablePromise = new Promise<void>(resolve => appStableResolve = resolve);\n\n (appStablePromise as any).__resolve = appStableResolve;\n\n return appStablePromise;\n}\n\n/**\n * Injection token used for obtaining promise that is resolved when application is first time stable\n */\nexport const APP_STABLE: InjectionToken<Promise<void>> = new InjectionToken<Promise<void>>('APP_STABLE', {providedIn: 'root', factory: appStablePromiseFactory});\n\n/**\n * Runs callback function when angular module is bootstrapped and stable\n * @param moduleRefPromise - Promise for module that was bootstrapped\n * @param callback - Callback that is called\n * @param angularProfiler - Indication that angular profiler should be enabled\n */\nexport function runWhenModuleStable(moduleRefPromise: Promise<NgModuleRef<unknown>>, callback: (moduleRef: NgModuleRef<unknown>) => void, angularProfiler?: boolean): void\n{\n angularProfiler = angularProfiler || false;\n\n moduleRefPromise.then((moduleRef: NgModuleRef<unknown>) => \n {\n const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);\n\n appRef.isStable\n .pipe(filter((isStable: boolean) => isStable),\n first())\n .subscribe(() => \n {\n const appStablePromise = moduleRef.injector.get(APP_STABLE);\n\n if(angularProfiler)\n {\n enableDebugTools(appRef.components[0]);\n }\n\n callback(moduleRef);\n\n if(appStablePromise)\n {\n const resolveAsStable = extractAppStableResolve(appStablePromise);\n\n resolveAsStable();\n }\n });\n });\n}"]}
@@ -2,6 +2,7 @@ import { Injectable, Inject } from '@angular/core';
2
2
  import { APP_STABLE } from '@anglr/common';
3
3
  import { isPresent } from '@jscrpt/common';
4
4
  import { LogEventLevel } from 'structured-log';
5
+ import { lastValueFrom } from 'rxjs';
5
6
  import { toText, isEnabled } from '../../misc/utils';
6
7
  import { RestSinkConfigService } from './restSinkConfig.service';
7
8
  import { LOGGER_REST_CLIENT } from '../../types/tokens';
@@ -27,7 +28,7 @@ export class RestSinkService {
27
28
  isStable.then(() => {
28
29
  this._timer = setInterval(() => {
29
30
  this.flush();
30
- }, this._configSvc.secondsToFlushAfter * 1000);
31
+ }, (this._configSvc.secondsToFlushAfter ?? 0) * 1000);
31
32
  });
32
33
  }
33
34
  //######################### public methods - implementation of OnDestroy #########################
@@ -85,7 +86,7 @@ export class RestSinkService {
85
86
  return Promise.resolve(null);
86
87
  }
87
88
  try {
88
- promise = this._restClient.log(this._logs).toPromise();
89
+ promise = lastValueFrom(this._restClient.log(this._logs));
89
90
  }
90
91
  catch (e) {
91
92
  console.log(e);
@@ -1 +1 @@
1
- {"version":3,"file":"restSink.service.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSink.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAiB,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;;;AAGtD;;GAEG;AAEH,MAAM,OAAO,eAAe;IAmBxB,iEAAiE;IACjE,YAAoB,UAAiC,EACrB,QAAuB,EACP,WAA6B;QAFzD,eAAU,GAAV,UAAU,CAAuB;QAEL,gBAAW,GAAX,WAAW,CAAkB;QApB7E,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;4GA7IQ,eAAe,uDAqBJ,UAAU,aACV,kBAAkB;gHAtB7B,eAAe;2FAAf,eAAe;kBAD3B,UAAU;;0BAsBM,MAAM;2BAAC,UAAU;;0BACjB,MAAM;2BAAC,kBAAkB","sourcesContent":["import {Injectable, Inject} from '@angular/core';\nimport {APP_STABLE} from '@anglr/common';\nimport {isPresent} from '@jscrpt/common';\nimport {Sink, LogEvent, LogEventLevel} from 'structured-log';\n\nimport {toText, isEnabled} from '../../misc/utils';\nimport {RestSinkConfigService} from './restSinkConfig.service';\nimport {LOGGER_REST_CLIENT} from '../../types/tokens';\nimport {LoggerRestClient, RestLog} from '../../types/logger.interface';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@Injectable()\nexport class RestSinkService implements Sink\n{\n //######################### private fields #########################\n\n /**\n * Indication that prototype of MessageTemplate was updated\n */\n private _prototypeUpdated: boolean = false;\n\n /**\n * Array of unflushed logs\n */\n private _logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n private _timer: number;\n\n //######################### constructor #########################\n constructor(private _configSvc: RestSinkConfigService,\n @Inject(APP_STABLE) isStable: Promise<void>,\n @Inject(LOGGER_REST_CLIENT) private _restClient: LoggerRestClient)\n {\n isStable.then(() =>\n {\n this._timer = setInterval(() =>\n {\n this.flush();\n }, this._configSvc.secondsToFlushAfter * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this._timer))\n {\n clearInterval(this._timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * Emits events into log\n * @param events - Events to be emitted\n */\n public emit(events: LogEvent[]): void\n {\n if(!events || !events.length)\n {\n return;\n }\n\n let forceFlush = false;\n\n events.forEach(e =>\n {\n if(!this._prototypeUpdated)\n {\n this._updatePrototype(e);\n\n this._prototypeUpdated = true;\n }\n\n if (!isEnabled(this._configSvc.restrictToLevel, e.level))\n {\n return;\n }\n\n const logLevel = LogEventLevel[e.level].toUpperCase();\n const timestamp = e.timestamp;\n const message = e.messageTemplate.render(e.properties);\n\n this._logs.push(\n {\n logLevel,\n message,\n timestamp\n });\n\n if (isEnabled(this._configSvc.immediateFlushMinLevel, e.level))\n {\n forceFlush = true;\n }\n });\n\n //flush if number of records is bigger than max or flush is required\n if(forceFlush || this._logs.length >= this._configSvc.flushAfterNumberOfLogs)\n {\n this.flush();\n }\n }\n\n /**\n * Flushes logs\n */\n public flush(): Promise<void>\n {\n let promise: Promise<void>;\n\n //no logs available\n if(!this._logs.length)\n {\n return Promise.resolve(null);\n }\n\n try\n {\n promise = this._restClient.log(this._logs).toPromise();\n }\n catch(e)\n {\n console.log(e);\n }\n\n this._logs = [];\n\n return promise ?? Promise.resolve(null);\n }\n\n //######################### private methods #########################\n\n /**\n * Updates prototype of MessageTemplate\n */\n private _updatePrototype(e: LogEvent): void\n {\n const messageTemplateInstance = (<any>e.messageTemplate);\n\n if(messageTemplateInstance.constructor && messageTemplateInstance.constructor.prototype && messageTemplateInstance.constructor.prototype.toText)\n {\n messageTemplateInstance.constructor.prototype.toText = toText;\n }\n }\n}"]}
1
+ {"version":3,"file":"restSink.service.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSink.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAiB,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;;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AuB,CAAC,WAAW,IAAI,uBAAuB,CAAC,WAAW,CAAC,SAAS,IAAI,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,EAC/I;YACI,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;SACjE;IACL,CAAC;;4GA7IQ,eAAe,uDAqBJ,UAAU,aACV,kBAAkB;gHAtB7B,eAAe;2FAAf,eAAe;kBAD3B,UAAU;;0BAsBM,MAAM;2BAAC,UAAU;;0BACjB,MAAM;2BAAC,kBAAkB","sourcesContent":["import {Injectable, Inject} from '@angular/core';\nimport {APP_STABLE} from '@anglr/common';\nimport {isPresent} from '@jscrpt/common';\nimport {Sink, LogEvent, LogEventLevel} from 'structured-log';\nimport {lastValueFrom} from 'rxjs';\n\nimport {toText, isEnabled} from '../../misc/utils';\nimport {RestSinkConfigService} from './restSinkConfig.service';\nimport {LOGGER_REST_CLIENT} from '../../types/tokens';\nimport {LoggerRestClient, RestLog} from '../../types/logger.interface';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@Injectable()\nexport class RestSinkService implements Sink\n{\n //######################### private fields #########################\n\n /**\n * Indication that prototype of MessageTemplate was updated\n */\n private _prototypeUpdated: boolean = false;\n\n /**\n * Array of unflushed logs\n */\n private _logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n private _timer: number|undefined|null;\n\n //######################### constructor #########################\n constructor(private _configSvc: RestSinkConfigService,\n @Inject(APP_STABLE) isStable: Promise<void>,\n @Inject(LOGGER_REST_CLIENT) private _restClient: LoggerRestClient)\n {\n isStable.then(() =>\n {\n this._timer = setInterval(() =>\n {\n this.flush();\n }, (this._configSvc.secondsToFlushAfter ?? 0) * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this._timer))\n {\n clearInterval(this._timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * Emits events into log\n * @param events - Events to be emitted\n */\n public emit(events: LogEvent[]): void\n {\n if(!events || !events.length)\n {\n return;\n }\n\n let forceFlush = false;\n\n events.forEach(e =>\n {\n if(!this._prototypeUpdated)\n {\n this._updatePrototype(e);\n\n this._prototypeUpdated = true;\n }\n\n if (!isEnabled(this._configSvc.restrictToLevel, e.level))\n {\n return;\n }\n\n const logLevel = LogEventLevel[e.level].toUpperCase();\n const timestamp = e.timestamp;\n const message = e.messageTemplate.render(e.properties);\n\n this._logs.push(\n {\n logLevel,\n message,\n timestamp\n });\n\n if (isEnabled(this._configSvc.immediateFlushMinLevel, e.level))\n {\n forceFlush = true;\n }\n });\n\n //flush if number of records is bigger than max or flush is required\n if(forceFlush || this._logs.length >= this._configSvc.flushAfterNumberOfLogs)\n {\n this.flush();\n }\n }\n\n /**\n * Flushes logs\n */\n public flush(): Promise<void>\n {\n let promise: Promise<void>;\n\n //no logs available\n if(!this._logs.length)\n {\n return Promise.resolve(null);\n }\n\n try\n {\n promise = lastValueFrom(this._restClient.log(this._logs));\n }\n catch(e)\n {\n console.log(e);\n }\n\n this._logs = [];\n\n return promise ?? Promise.resolve(null);\n }\n\n //######################### private methods #########################\n\n /**\n * Updates prototype of MessageTemplate\n */\n private _updatePrototype(e: LogEvent): void\n {\n const messageTemplateInstance = (<any>e.messageTemplate);\n\n if(messageTemplateInstance.constructor && messageTemplateInstance.constructor.prototype && messageTemplateInstance.constructor.prototype.toText)\n {\n messageTemplateInstance.constructor.prototype.toText = toText;\n }\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,kBAA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AAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAQ7E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IA6G/E;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;yCA7NnD,qBAAqB;6CAArB,qBAAqB;CAoRjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC"}
@@ -10,7 +10,7 @@ export declare class ConfirmationDialogDirective {
10
10
  /**
11
11
  * Confirmation text that is displayed in dialog
12
12
  */
13
- confirmationText: string;
13
+ confirmationText: string | undefined | null;
14
14
  /**
15
15
  * Title for confirmation dialog
16
16
  */
@@ -18,15 +18,15 @@ export declare class ConfirmationDialogDirective {
18
18
  /**
19
19
  * Text for confirm confirmation button
20
20
  */
21
- confirmationConfirm: string;
21
+ confirmationConfirm: string | undefined | null;
22
22
  /**
23
23
  * Text for cancel confirmation button
24
24
  */
25
- confirmationCancel: string;
25
+ confirmationCancel: string | undefined | null;
26
26
  /**
27
27
  * Object with css classes to be applied to confirmation dialog component
28
28
  */
29
- confirmationCssClasses: ConfirmationDialogCssClasses;
29
+ confirmationCssClasses: ConfirmationDialogCssClasses | undefined | null;
30
30
  /**
31
31
  * Condidition that determines whether display confirmation dialog or skip it and run confirm directly
32
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"confirmationDialog.directive.d.ts","sourceRoot":"","sources":["confirmationDialog.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAuB,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,kDAAkD,CAAC;AAErF,OAAO,EAA4B,4BAA4B,EAAC,MAAM,oDAAoD,CAAC;;AAE3H;;GAEG;AACH,qBAIa,2BAA2B;IAuDxB,OAAO,CAAC,OAAO;IAnD3B;;OAEG;IAEI,gBAAg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