@anglr/common 12.0.0-beta.20220414120442 → 13.0.0-beta.20220419081530

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 (73) hide show
  1. package/changelog.md +18 -1
  2. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
  3. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
  5. package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
  6. package/es2015/positions/src/index.js +0 -7
  7. package/es2015/positions/src/index.js.map +1 -1
  8. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
  9. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  10. package/es2015/src/services/position/position.interface.js.map +1 -1
  11. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
  12. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  13. package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
  14. package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
  15. package/es2020/positions/src/index.js +0 -7
  16. package/es2020/positions/src/index.js.map +1 -1
  17. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
  18. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
  19. package/es2020/src/services/position/position.interface.js.map +1 -1
  20. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  21. package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -1
  22. package/package.json +3 -3
  23. package/positions/src/index.d.ts +0 -7
  24. package/positions/src/index.d.ts.map +1 -1
  25. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +6 -2
  26. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -1
  27. package/src/services/position/position.interface.d.ts +4 -0
  28. package/src/services/position/position.interface.d.ts.map +1 -1
  29. package/version.bak +1 -1
  30. package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
  31. package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
  32. package/es2015/positions/src/modules/positions/modules/positions.module.js +0 -24
  33. package/es2015/positions/src/modules/positions/modules/positions.module.js.map +0 -1
  34. package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
  35. package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
  36. package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -230
  37. package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
  38. package/es2015/positions/src/modules/tooltip/misc/tokens.js +0 -6
  39. package/es2015/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
  40. package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
  41. package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
  42. package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
  43. package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
  44. package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
  45. package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
  46. package/es2020/positions/src/modules/positions/modules/positions.module.js +0 -24
  47. package/es2020/positions/src/modules/positions/modules/positions.module.js.map +0 -1
  48. package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
  49. package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
  50. package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -229
  51. package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
  52. package/es2020/positions/src/modules/tooltip/misc/tokens.js +0 -6
  53. package/es2020/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
  54. package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
  55. package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
  56. package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
  57. package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
  58. package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts +0 -34
  59. package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts.map +0 -1
  60. package/positions/src/modules/positions/modules/positions.module.d.ts +0 -11
  61. package/positions/src/modules/positions/modules/positions.module.d.ts.map +0 -1
  62. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.css +0 -10
  63. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +0 -63
  64. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +0 -1
  65. package/positions/src/modules/tooltip/components/tooltip/tooltip.component.html +0 -6
  66. package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +0 -106
  67. package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +0 -1
  68. package/positions/src/modules/tooltip/misc/tokens.d.ts +0 -7
  69. package/positions/src/modules/tooltip/misc/tokens.d.ts.map +0 -1
  70. package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts +0 -71
  71. package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts.map +0 -1
  72. package/positions/src/modules/tooltip/modules/tooltip.module.d.ts +0 -13
  73. package/positions/src/modules/tooltip/modules/tooltip.module.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {PositionOffset, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement\n */\n offset: PositionOffset;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>;\n}\n"]}
1
+ {"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {PositionOffset, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement\n */\n offset: PositionOffset;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Indication whether there was flip applied\n */\n flip: boolean;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"floatingUiDomPosition.service.d.ts","sourceRoot":"","sources":["floatingUiDomPosition.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAa,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAiE,MAAM,eAAe,CAAC;AAExI,OAAO,EAAkB,SAAS,EAAc,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAahC;;GAEG;AACH,qBACa,qBAAsB,YAAW,QAAQ;IAIlD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAA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AAe,GAAG,SAAS;yCAlMnD,qBAAqB;6CAArB,qBAAqB;CAyPjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultValidationErrors.component.d.ts","sourceRoot":"","sources":["defaultValidationErrors.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,iBAAiB,EAAc,MAAM,eAAe,CAAC;AAIjG,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,yBAAyB,EAAE,uBAAuB,EAAC,MAAM,0EAA0E,CAAC;;AAI5I;;GAEG;AACH,qBAkBa,gCAAiC,YAAW,yBAAyB;IAyBlE,SAAS,CAAC,eAAe,EAAE,iBAAiB;IArBxD;;;OAGG;IACI,MAAM,EAAE,sBAAsB,CAAC;IAEtC;;;OAGG;IACI,OAAO,EAAE,uBAAuB,CAAC;IAIxC;;OAEG;IAEI,OAAO,EAAE,OAAO,CAAQ;gBAGT,eAAe,EAAE,iBAAiB;IAMxD;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI;yCAlC1E,gCAAgC;2CAAhC,gCAAgC;CAyC5C"}
1
+ {"version":3,"file":"defaultValidationErrors.component.d.ts","sourceRoot":"","sources":["defaultValidationErrors.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,iBAAiB,EAAc,MAAM,eAAe,CAAC;AAGjG,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,yBAAyB,EAAE,uBAAuB,EAAC,MAAM,0EAA0E,CAAC;;AAE5I;;GAEG;AACH,qBAYa,gCAAiC,YAAW,yBAAyB;IAyBlE,SAAS,CAAC,eAAe,EAAE,iBAAiB;IArBxD;;;OAGG;IACI,MAAM,EAAE,sBAAsB,CAAC;IAEtC;;;OAGG;IACI,OAAO,EAAE,uBAAuB,CAAC;IAIxC;;OAEG;IAEI,OAAO,EAAE,OAAO,CAAQ;gBAGT,eAAe,EAAE,iBAAiB;IAMxD;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI;yCAlC1E,gCAAgC;2CAAhC,gCAAgC;CAyC5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "12.0.0-beta.20220414120442",
3
+ "version": "13.0.0-beta.20220419081530",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -102,7 +102,7 @@
102
102
  "@angular/animations": ">=13.1.0",
103
103
  "@angular/cdk": ">=13.1.0",
104
104
  "@angular/material": ">=13.1.0",
105
- "@anglr/animations": ">=9.0.0",
105
+ "@anglr/animations": ">=9.1.0",
106
106
  "rxjs": ">=6.6.7",
107
107
  "@jscrpt/common": ">=2.2.0",
108
108
  "numeral": "^2.0.6",
@@ -124,7 +124,7 @@
124
124
  "@angular/animations": "^13.1.0",
125
125
  "@angular/cdk": "^13.1.0",
126
126
  "@angular/material": "^13.1.0",
127
- "@anglr/animations": "^9.0.0",
127
+ "@anglr/animations": "^9.1.0",
128
128
  "rxjs": "^6.6.7",
129
129
  "@jscrpt/common": "^2.2.0",
130
130
  "angular2-hotkeys": "^2.4.0",
@@ -1,9 +1,2 @@
1
1
  export * from './misc/utils';
2
- export * from './modules/positions/directives/positionTo/positionTo.directive';
3
- export * from './modules/positions/modules/positions.module';
4
- export * from './modules/tooltip/components/tooltip/tooltip.component';
5
- export * from './modules/tooltip/directives/tooltip/tooltip.directive';
6
- export * from './modules/tooltip/misc/tokens';
7
- export * from './modules/tooltip/misc/tooltip.interface';
8
- export * from './modules/tooltip/modules/tooltip.module';
9
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ElementRef, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { ElementRef, OnChanges, SimpleChanges, EventEmitter } from '@angular/core';
2
2
  import { Position, PositionPlacement } from '../../../../services/position';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -25,6 +25,10 @@ export declare class PositionToDirective implements OnChanges {
25
25
  */
26
26
  get placement(): PositionPlacement | null | undefined;
27
27
  set placement(value: PositionPlacement | null | undefined);
28
+ /**
29
+ * Occurs when flip occurs during positioning
30
+ */
31
+ flip: EventEmitter<void>;
28
32
  constructor(_target: ElementRef<HTMLElement>, _position: Position);
29
33
  /**
30
34
  * Called when input value changes
@@ -43,6 +47,6 @@ export declare class PositionToDirective implements OnChanges {
43
47
  */
44
48
  static ngAcceptInputType_positionTo: HTMLElement | ElementRef<HTMLElement>;
45
49
  static ɵfac: i0.ɵɵFactoryDeclaration<PositionToDirective, never>;
46
- static ɵdir: i0.ɵɵDirectiveDeclaration<PositionToDirective, "[positionTo]", never, { "source": "positionTo"; "placement": "placement"; }, {}, never>;
50
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PositionToDirective, "[positionTo]", never, { "source": "positionTo"; "placement": "placement"; }, { "flip": "flip"; }, never>;
47
51
  }
48
52
  //# sourceMappingURL=positionTo.directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"positionTo.directive.d.ts","sourceRoot":"","sources":["positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE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EAAsB,QAAQ,EAAE,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;;AAGhH;;GAEG;AACH,qBAIa,mBAAoB,YAAW,SAAS;IAiErC,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC;IACxB,SAAS,CAAC,SAAS,EAAE,QAAQ;IA9D3D;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,iBAAiB,GAAC,IAAI,GAAC,SAAS,CAAC;IAEvD;;OAEG;IACH,SAAS,CAAC,OAAO,EAAG,WAAW,CAAC;IAIhC;;OAEG;IACH,IACW,MAAM,IAAI,WAAW,CAG/B;IACD,IAAW,MAAM,CAAC,KAAK,EAAE,WAAW,EAUnC;IAED;;OAEG;IACH,IACW,SAAS,IAAI,iBAAiB,GAAC,IAAI,GAAC,SAAS,CAGvD;IACD,IAAW,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAC,IAAI,GAAC,SAAS,EAU3D;IAID;;OAEG;IAEI,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAA4B;gBAGrC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,EACd,SAAS,EAAE,QAAQ;IAM3D;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAYhD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB/C;;OAEG;IACH,OAAc,2BAA2B,EAAE,iBAAiB,GAAC,SAAS,GAAC,IAAI,GAAC,MAAM,OAAO,iBAAiB,CAAC;IAI3G;;OAEG;IACH,OAAc,4BAA4B,EAAE,WAAW,GAAC,UAAU,CAAC,WAAW,CAAC,CAAC;yCA7HvE,mBAAmB;2CAAnB,mBAAmB;CA8H/B"}
@@ -58,6 +58,10 @@ export interface PositionResult<TElement extends Element = any> {
58
58
  * Y coordinate of position of target
59
59
  */
60
60
  y: number;
61
+ /**
62
+ * Indication whether there was flip applied
63
+ */
64
+ flip: boolean;
61
65
  /**
62
66
  * Disposes instance of engine used for positioning
63
67
  */
@@ -1 +1 @@
1
- {"version":3,"file":"position.interface.d.ts","sourceRoot":"","sources":["position.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAE9B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAI5B;;OAEG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,OAAO,GAAC,iBAAiB,CAAC;IAEtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,OAAO,GAAG,GAAG;IAE1D;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IAIrB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;CAClH"}
1
+ {"version":3,"file":"position.interface.d.ts","sourceRoot":"","sources":["position.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAE9B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAI5B;;OAEG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,OAAO,GAAC,iBAAiB,CAAC;IAEtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,OAAO,GAAG,GAAG;IAE1D;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IAIrB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;CAClH"}
package/version.bak CHANGED
@@ -1 +1 @@
1
- 12.0.0-beta.20220414120442
1
+ 13.0.0-beta.20220419081530
@@ -1,58 +0,0 @@
1
- import { Directive, Input, ElementRef, Inject, Output, EventEmitter } from '@angular/core';
2
- import { DOCUMENT } from '@angular/common';
3
- import { nameof, isPresent } from '@jscrpt/common';
4
- import { positionsWithFlip } from '../../../../misc/utils';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Sets position of attached element relative to provided element
8
- */
9
- export class PositionToDirective {
10
- //######################### constructor #########################
11
- constructor(_element, _document) {
12
- this._element = _element;
13
- this._document = _document;
14
- /**
15
- * Relative coordinates of element
16
- */
17
- this.elementCoordinates = 'top left';
18
- /**
19
- * Relative coordinates of target element
20
- */
21
- this.targetCoordinates = 'bottom left';
22
- //######################### public properties - outputs #########################
23
- /**
24
- * Occurs when flip occurs during positioning
25
- */
26
- this.flip = new EventEmitter();
27
- }
28
- //######################### public methods - implementation of OnChanges #########################
29
- /**
30
- * Called when input value changes
31
- */
32
- ngOnChanges(changes) {
33
- if (nameof('target') in changes && isPresent(this.target)) {
34
- positionsWithFlip(this._element.nativeElement, this.elementCoordinates, this.target, this.targetCoordinates, this._document, () => this.flip.emit());
35
- }
36
- }
37
- }
38
- PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
39
- PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: PositionToDirective, selector: "[positionTo]", inputs: { target: ["positionTo", "target"], elementCoordinates: "elementCoordinates", targetCoordinates: "targetCoordinates" }, outputs: { flip: "flip" }, usesOnChanges: true, ngImport: i0 });
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: '[positionTo]'
44
- }]
45
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Document, decorators: [{
46
- type: Inject,
47
- args: [DOCUMENT]
48
- }] }]; }, propDecorators: { target: [{
49
- type: Input,
50
- args: ['positionTo']
51
- }], elementCoordinates: [{
52
- type: Input
53
- }], targetCoordinates: [{
54
- type: Input
55
- }], flip: [{
56
- type: Output
57
- }] } });
58
- //# sourceMappingURL=positionTo.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/positions/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,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;;AAEzD;;GAEG;AAKH,MAAM,OAAO,mBAAmB;IA8B5B,iEAAiE;IACjE,YAAoB,QAAiC,EACf,SAAmB;QADrC,aAAQ,GAAR,QAAQ,CAAyB;QACf,cAAS,GAAT,SAAS,CAAU;QAtBzD;;WAEG;QAEI,uBAAkB,GAAyB,UAAU,CAAC;QAE7D;;WAEG;QAEI,sBAAiB,GAAyB,aAAa,CAAC;QAE/D,iFAAiF;QAEjF;;WAEG;QAEI,SAAI,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAM3D,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW,CAAC,OAAsB;QAErC,IAAG,MAAM,CAAsB,QAAQ,CAAC,IAAI,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7E;YACI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SACxJ;IACL,CAAC;;gHA/CQ,mBAAmB,4CAgCR,QAAQ;oGAhCnB,mBAAmB;2FAAnB,mBAAmB;kBAJ/B,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;mFAiCoD,QAAQ;0BAA5C,MAAM;2BAAC,QAAQ;4CAxBrB,MAAM;sBADZ,KAAK;uBAAC,YAAY;gBAOZ,kBAAkB;sBADxB,KAAK;gBAOC,iBAAiB;sBADvB,KAAK;gBASC,IAAI;sBADV,MAAM","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject, Output, EventEmitter} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {nameof, isPresent} from '@jscrpt/common';\nimport type {PositionsCoordinates} from 'positions';\n\nimport {positionsWithFlip} from '../../../../misc/utils';\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 //######################### public properties - inputs #########################\n\n /**\n * Html element which is used as target for positioning against it\n */\n @Input('positionTo')\n public target: HTMLElement;\n\n /**\n * Relative coordinates of element\n */\n @Input()\n public elementCoordinates: PositionsCoordinates = 'top left';\n\n /**\n * Relative coordinates of target element\n */\n @Input()\n public targetCoordinates: PositionsCoordinates = 'bottom left';\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(private _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) private _document: Document)\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>('target') in changes && isPresent(this.target))\n {\n positionsWithFlip(this._element.nativeElement, this.elementCoordinates, this.target, this.targetCoordinates, this._document, () => this.flip.emit());\n }\n }\n}"]}
@@ -1,24 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { PositionToDirective } from '../directives/positionTo/positionTo.directive';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Module for position to directive
6
- */
7
- export class PositionsModule {
8
- }
9
- PositionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
- PositionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, declarations: [PositionToDirective], exports: [PositionToDirective] });
11
- PositionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, imports: [[]] });
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, decorators: [{
13
- type: NgModule,
14
- args: [{
15
- imports: [],
16
- declarations: [
17
- PositionToDirective
18
- ],
19
- exports: [
20
- PositionToDirective
21
- ]
22
- }]
23
- }] });
24
- //# sourceMappingURL=positions.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"positions.module.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/positions/modules/positions.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,+CAA+C,CAAC;;AAElF;;GAEG;AAeH,MAAM,OAAO,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAPpB,mBAAmB,aAInB,mBAAmB;6GAGd,eAAe,YAXxB,EACC;2FAUQ,eAAe;kBAd3B,QAAQ;mBACT;oBACI,OAAO,EACP,EACC;oBACD,YAAY,EACZ;wBACI,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,mBAAmB;qBACtB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {PositionToDirective} from '../directives/positionTo/positionTo.directive';\n\n/**\n * Module for position to directive\n */\n@NgModule(\n{\n imports:\n [\n ],\n declarations:\n [\n PositionToDirective\n ],\n exports:\n [\n PositionToDirective\n ]\n})\nexport class PositionsModule\n{\n}\n"]}
@@ -1,98 +0,0 @@
1
- import { Component, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding, ElementRef, HostListener } from '@angular/core';
2
- import { transition, trigger, useAnimation } from '@angular/animations';
3
- import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "@angular/common";
6
- /**
7
- * Component used for displaying tooltip content
8
- */
9
- export class TooltipComponent {
10
- //######################### constructor #########################
11
- constructor(_changeDetector, _element) {
12
- this._changeDetector = _changeDetector;
13
- this._element = _element;
14
- //######################### protected fields #########################
15
- /**
16
- * Called when mouse enter tooltip component, hover
17
- */
18
- this._enterFn = () => null;
19
- /**
20
- * Called when mouse leaves tooltip component
21
- */
22
- this._leaveFn = () => null;
23
- //######################### public properties - host #########################
24
- /**
25
- * Attach fade in/out animation to element
26
- * @internal
27
- */
28
- this.animation = true;
29
- }
30
- //######################### public methods - implementation of TooltipRenderer #########################
31
- /**
32
- * Registers handlers that allows reaction to entering or leaving tooltip
33
- * @param enter - Called when mouse enter tooltip component, hover
34
- * @param leave - Called when mouse leaves tooltip component
35
- */
36
- registerHoverEvents(enter, leave) {
37
- this._enterFn = enter;
38
- this._leaveFn = leave;
39
- }
40
- /**
41
- * Explicitly runs invalidation of content (change detection)
42
- */
43
- invalidateVisuals() {
44
- if (this.cssClass) {
45
- this._element.nativeElement.classList.add(this.cssClass);
46
- }
47
- this._changeDetector.detectChanges();
48
- }
49
- //######################### public methods - host #########################
50
- /**
51
- * Handles mouse enter event over tooltip
52
- * @internal
53
- */
54
- mouseEnter() {
55
- this._enterFn();
56
- }
57
- /**
58
- * Handles mouse leave event over tooltip
59
- * @internal
60
- */
61
- mouseLeave() {
62
- this._leaveFn();
63
- }
64
- }
65
- TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
66
- TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: TooltipComponent, selector: "tooltip-popup", host: { listeners: { "mouseenter": "mouseEnter()", "mouseleave": "mouseLeave()" }, properties: { "@fadeInOut": "this.animation" } }, ngImport: i0, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
67
- trigger('fadeInOut', [
68
- transition(':enter', [
69
- useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
70
- ]),
71
- transition(':leave', [
72
- useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
73
- ])
74
- ])
75
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, decorators: [{
77
- type: Component,
78
- args: [{ selector: 'tooltip-popup', animations: [
79
- trigger('fadeInOut', [
80
- transition(':enter', [
81
- useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
82
- ]),
83
- transition(':leave', [
84
- useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
85
- ])
86
- ])
87
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"] }]
88
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { animation: [{
89
- type: HostBinding,
90
- args: ['@fadeInOut']
91
- }], mouseEnter: [{
92
- type: HostListener,
93
- args: ['mouseenter']
94
- }], mouseLeave: [{
95
- type: HostListener,
96
- args: ['mouseleave']
97
- }] } });
98
- //# sourceMappingURL=tooltip.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../../positions/src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;;;AAIpE;;GAEG;AAsBH,MAAM,OAAO,gBAAgB;IA6CzB,iEAAiE;IACjE,YAAsB,eAAkC,EAClC,QAAiC;QADjC,oBAAe,GAAf,eAAe,CAAmB;QAClC,aAAQ,GAAR,QAAQ,CAAyB;QA7CvD,sEAAsE;QAEtE;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAE5C;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAwB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UAAU,CAAC,QAAQ,EACnB;gCACI,YAAY,CAAC,gBAAgB,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAC,CAAC;6BAChE,CAAC;yBACL,CAAC;qBACL,mBACgB,uBAAuB,CAAC,MAAM;iIA6CxC,SAAS;sBADf,WAAW;uBAAC,YAAY;gBA0ClB,UAAU;sBADhB,YAAY;uBAAC,YAAY;gBAWnB,UAAU;sBADhB,YAAY;uBAAC,YAAY","sourcesContent":["import {Component, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, HostBinding, ElementRef, HostListener} from '@angular/core';\nimport {transition, trigger, useAnimation} from '@angular/animations';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\n\nimport {TooltipRenderer} from '../../misc/tooltip.interface';\n\n/**\n * Component used for displaying tooltip content\n */\n@Component(\n{\n selector: 'tooltip-popup',\n templateUrl: 'tooltip.component.html',\n styleUrls: ['tooltip.component.css'],\n animations:\n [\n trigger('fadeInOut',\n [\n transition(':enter', \n [\n useAnimation(fadeInAnimation, {params: {duration: '260ms'}})\n ]),\n transition(':leave', \n [\n useAnimation(fadeOutAnimation, {params: {duration: '260ms'}})\n ])\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TooltipComponent<TData = any> implements TooltipRenderer<TData>\n{\n //######################### protected fields #########################\n\n /**\n * Called when mouse enter tooltip component, hover\n */\n protected _enterFn: () => void = () => null;\n\n /**\n * Called when mouse leaves tooltip component\n */\n protected _leaveFn: () => void = () => null;\n\n //######################### public properties - implementation of TooltipRenderer #########################\n\n /**\n * Data that are rendered in tooltip\n */\n public data: TData|null;\n\n /**\n * Template used for rendering tooltip\n */\n public template: TemplateRef<TData>|null;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n public allowHtml: boolean;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n public cssClass: string|null;\n\n //######################### public properties - host #########################\n\n /**\n * Attach fade in/out animation to element\n * @internal\n */\n @HostBinding('@fadeInOut')\n public animation: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of TooltipRenderer #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n public registerHoverEvents(enter: () => void, leave: () => void): void\n {\n this._enterFn = enter;\n this._leaveFn = leave;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n if(this.cssClass)\n {\n this._element.nativeElement.classList.add(this.cssClass);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse enter event over tooltip\n * @internal\n */\n @HostListener('mouseenter')\n public mouseEnter(): void\n {\n this._enterFn();\n }\n\n /**\n * Handles mouse leave event over tooltip\n * @internal\n */\n @HostListener('mouseleave')\n public mouseLeave(): void\n {\n this._leaveFn();\n }\n}","<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>"]}
@@ -1,230 +0,0 @@
1
- import { ApplicationRef, ComponentFactoryResolver, ContentChild, Directive, ElementRef, HostListener, Inject, Injector, Input, Optional, TemplateRef } from '@angular/core';
2
- import { extend, isBlank, isPresent, nameof } from '@jscrpt/common';
3
- import { TooltipComponent } from '../../components/tooltip/tooltip.component';
4
- import { TOOLTIP_OPTIONS } from '../../misc/tokens';
5
- import { positionsWithFlip } from '../../../../misc/utils';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Default options for tooltip
9
- */
10
- const defaultOptions = {
11
- delay: 200,
12
- elementPositionAt: 'top left',
13
- tooltipPosition: 'bottom left',
14
- fixedPosition: false,
15
- allowSelection: false,
16
- tooltipRenderer: TooltipComponent,
17
- tooltipCssClass: null,
18
- stopPropagation: false
19
- };
20
- /**
21
- * Directive used for rendering tooltip
22
- */
23
- export class TooltipDirective {
24
- //######################### constructor #########################
25
- constructor(_componentFactoryResolver, _appRef, _injector, _element, options) {
26
- this._componentFactoryResolver = _componentFactoryResolver;
27
- this._appRef = _appRef;
28
- this._injector = _injector;
29
- this._element = _element;
30
- /**
31
- * Indication whether there is active show tooltip request
32
- */
33
- this._showRequest = false;
34
- /**
35
- * Indication whether keep open tooltip component
36
- */
37
- this._keepOpen = false;
38
- /**
39
- * Timeout that is used for handling mouse move
40
- */
41
- this._timeout = null;
42
- /**
43
- * Indication whether are html tags allowed in tooltip text
44
- */
45
- this.allowHtml = false;
46
- this._options = extend(true, {}, defaultOptions, options);
47
- }
48
- /**
49
- * Options used for displaying tooltip
50
- */
51
- get tooltipOptions() {
52
- return this._options;
53
- }
54
- set tooltipOptions(value) {
55
- this._options = extend(true, {}, this._options, value);
56
- }
57
- //######################### public methods - implementation of OnChanges #########################
58
- /**
59
- * Called when input value changes
60
- */
61
- ngOnChanges(changes) {
62
- if (nameof('tooltipVisible') in changes) {
63
- if (this.tooltipVisible) {
64
- this._showTooltip();
65
- }
66
- else {
67
- this._hideTooltip();
68
- }
69
- }
70
- }
71
- //######################### public methods - implementation of OnDestroy #########################
72
- /**
73
- * Called when component is destroyed
74
- */
75
- ngOnDestroy() {
76
- this._destroyTooltip();
77
- }
78
- //######################### public methods - host #########################
79
- /**
80
- * Handles mouse leave event, hover ends
81
- * @param event - Mouse event that occured
82
- * @internal
83
- */
84
- mouseLeave(event) {
85
- if (this._options.stopPropagation) {
86
- event.stopPropagation();
87
- }
88
- if (isBlank(this.tooltipVisible)) {
89
- setTimeout(() => {
90
- if (!this._keepOpen) {
91
- this._showRequest = false;
92
- this._hideTooltip();
93
- }
94
- }, 10);
95
- }
96
- }
97
- /**
98
- * Handles mouse move event, displaying tooltip
99
- * @param event - Mouse event that occured
100
- * @internal
101
- */
102
- mouseMove(event) {
103
- if (this._options.stopPropagation) {
104
- event.stopPropagation();
105
- }
106
- this._showRequest = true;
107
- //do nothing if tooltip is visible
108
- if (this._tooltipComponent || isPresent(this.tooltipVisible)) {
109
- return;
110
- }
111
- if (isPresent(this._timeout)) {
112
- clearTimeout(this._timeout);
113
- }
114
- this._timeout = setTimeout(() => {
115
- this._timeout = null;
116
- if (this._showRequest) {
117
- this._showTooltip(event.clientX);
118
- this._showRequest = false;
119
- }
120
- }, this._options.delay);
121
- }
122
- //######################### protected methods #########################
123
- /**
124
- * Shows tooltip
125
- * @param xCoordinate - X coordinate of mouse event in viewport
126
- */
127
- _showTooltip(xCoordinate) {
128
- this._createTooltip();
129
- this._showData();
130
- positionsWithFlip(this._tooltipElement, this._options.tooltipPosition, this._element.nativeElement, this._options.elementPositionAt);
131
- if (xCoordinate && !this._options.fixedPosition) {
132
- this._tooltipElement.style.left = `${xCoordinate}px`;
133
- }
134
- }
135
- /**
136
- * Hides tooltip
137
- */
138
- _hideTooltip() {
139
- this._destroyTooltip();
140
- }
141
- /**
142
- * Destroys tooltip component
143
- */
144
- _destroyTooltip() {
145
- if (this._tooltipComponent) {
146
- this._appRef.detachView(this._tooltipComponent.hostView);
147
- this._tooltipComponent.destroy();
148
- this._tooltipComponent = null;
149
- this._tooltipElement = null;
150
- }
151
- }
152
- /**
153
- * Creates tooltip renderer component
154
- */
155
- _createTooltip() {
156
- // 0. Destroyes absolute popup if it exists
157
- this._destroyTooltip();
158
- // 1. Create a component reference from the component
159
- this._tooltipComponent = this._componentFactoryResolver
160
- .resolveComponentFactory(this._options.tooltipRenderer)
161
- .create(this._injector);
162
- // 2. Attach component to the appRef so that it's inside the ng component tree
163
- this._appRef.attachView(this._tooltipComponent.hostView);
164
- // 3. Get DOM element from component
165
- this._tooltipElement = this._tooltipComponent.hostView
166
- .rootNodes[0];
167
- // 4. Append DOM element to the body
168
- document.body.appendChild(this._tooltipElement);
169
- }
170
- /**
171
- * Sets data to tooltip component and shows them
172
- */
173
- _showData() {
174
- var _a;
175
- if (this._tooltipComponent) {
176
- this._tooltipComponent.instance.allowHtml = this.allowHtml;
177
- this._tooltipComponent.instance.data = this.tooltip;
178
- this._tooltipComponent.instance.template = (_a = this.tooltipTemplate) !== null && _a !== void 0 ? _a : this.tooltipTemplateChild;
179
- this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;
180
- this._tooltipComponent.instance.registerHoverEvents(() => {
181
- if (this._options.allowSelection) {
182
- this._keepOpen = true;
183
- this._showRequest = false;
184
- }
185
- }, () => {
186
- setTimeout(() => {
187
- this._keepOpen = false;
188
- if (!this._showRequest) {
189
- this._hideTooltip();
190
- }
191
- this._showRequest = false;
192
- }, 5);
193
- });
194
- this._tooltipComponent.instance.invalidateVisuals();
195
- }
196
- }
197
- }
198
- TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: TOOLTIP_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
199
- 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: ["tooltipTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0 });
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, decorators: [{
201
- type: Directive,
202
- args: [{
203
- selector: '[tooltip]'
204
- }]
205
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: undefined, decorators: [{
206
- type: Optional
207
- }, {
208
- type: Inject,
209
- args: [TOOLTIP_OPTIONS]
210
- }] }]; }, propDecorators: { tooltip: [{
211
- type: Input
212
- }], allowHtml: [{
213
- type: Input
214
- }], tooltipTemplate: [{
215
- type: Input
216
- }], tooltipOptions: [{
217
- type: Input
218
- }], tooltipVisible: [{
219
- type: Input
220
- }], tooltipTemplateChild: [{
221
- type: ContentChild,
222
- args: ['tooltipTemplate']
223
- }], mouseLeave: [{
224
- type: HostListener,
225
- args: ['mouseleave', ['$event']]
226
- }], mouseMove: [{
227
- type: HostListener,
228
- args: ['mousemove', ['$event']]
229
- }] } });
230
- //# sourceMappingURL=tooltip.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAgB,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAC,MAAM,eAAe,CAAC;AAC9O,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,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;;AAEzD;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,KAAK,EAAE,GAAG;IACV,iBAAiB,EAAE,UAAU;IAC7B,eAAe,EAAE,aAAa;IAC9B,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,gBAAgB;IACjC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xC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAcC,cAAc;sBADpB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,iBAAiB;gBAmDxB,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ApplicationRef, ComponentFactoryResolver, ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef} from '@angular/core';\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 {positionsWithFlip} from '../../../../misc/utils';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n elementPositionAt: 'top left',\n tooltipPosition: 'bottom left',\n fixedPosition: false,\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>;\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|string;\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<any>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): TooltipOptions\n {\n return this._options;\n }\n public set tooltipOptions(value: 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('tooltipTemplate')\n public tooltipTemplateChild?: TemplateRef<any>;\n\n //######################### constructor #########################\n constructor(protected _componentFactoryResolver: ComponentFactoryResolver,\n protected _appRef: ApplicationRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n @Optional() @Inject(TOOLTIP_OPTIONS) options: 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.clientX);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param xCoordinate - X coordinate of mouse event in viewport\n */\n protected _showTooltip(xCoordinate?: number): void\n {\n this._createTooltip();\n this._showData();\n positionsWithFlip(this._tooltipElement, this._options.tooltipPosition, this._element.nativeElement, this._options.elementPositionAt);\n\n if(xCoordinate && !this._options.fixedPosition)\n {\n this._tooltipElement.style.left = `${xCoordinate}px`;\n }\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._appRef.detachView(this._tooltipComponent.hostView);\n this._tooltipComponent.destroy();\n this._tooltipComponent = null;\n this._tooltipElement = null;\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroyes absolute popup if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._componentFactoryResolver\n .resolveComponentFactory(this._options.tooltipRenderer)\n .create(this._injector);\n\n // 2. Attach component to the appRef so that it's inside the ng component tree\n this._appRef.attachView(this._tooltipComponent.hostView);\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 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;\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}"]}
@@ -1,6 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- /**
3
- * Injection token used for injecting tooltip options
4
- */
5
- export const TOOLTIP_OPTIONS = new InjectionToken('TOOLTIP_OPTIONS');
6
- //# sourceMappingURL=tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/tooltip/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,IAAI,cAAc,CAAiB,iBAAiB,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {TooltipOptions} from './tooltip.interface';\n\n/**\n * Injection token used for injecting tooltip options\n */\nexport const TOOLTIP_OPTIONS: InjectionToken<TooltipOptions> = new InjectionToken<TooltipOptions>('TOOLTIP_OPTIONS');"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tooltip.interface.js.map