@anglr/common 11.2.0-beta.20220301090733 → 11.2.0-beta.20220301105854

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 (48) hide show
  1. package/changelog.md +11 -4
  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/misc/formModel/decorators/modelPropertyMetadata.decorator.js +1 -1
  5. package/es2015/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js.map +1 -1
  6. package/es2015/src/index.js +2 -1
  7. package/es2015/src/index.js.map +1 -1
  8. package/es2015/src/modules/position/directives/index.js +2 -0
  9. package/es2015/src/modules/position/directives/index.js.map +1 -0
  10. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +91 -0
  11. package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -0
  12. package/es2015/src/modules/position/index.js +3 -0
  13. package/es2015/src/modules/position/index.js.map +1 -0
  14. package/es2015/src/modules/position/modules/index.js +2 -0
  15. package/es2015/src/modules/position/modules/index.js.map +1 -0
  16. package/es2015/src/modules/position/modules/position.module.js +24 -0
  17. package/es2015/src/modules/position/modules/position.module.js.map +1 -0
  18. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
  19. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  20. package/es2020/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js +1 -1
  21. package/es2020/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js.map +1 -1
  22. package/es2020/src/index.js +2 -1
  23. package/es2020/src/index.js.map +1 -1
  24. package/es2020/src/modules/position/directives/index.js +2 -0
  25. package/es2020/src/modules/position/directives/index.js.map +1 -0
  26. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +88 -0
  27. package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -0
  28. package/es2020/src/modules/position/index.js +3 -0
  29. package/es2020/src/modules/position/index.js.map +1 -0
  30. package/es2020/src/modules/position/modules/index.js +2 -0
  31. package/es2020/src/modules/position/modules/index.js.map +1 -0
  32. package/es2020/src/modules/position/modules/position.module.js +24 -0
  33. package/es2020/src/modules/position/modules/position.module.js.map +1 -0
  34. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/index.d.ts +2 -1
  37. package/src/index.d.ts.map +1 -1
  38. package/src/modules/position/directives/index.d.ts +2 -0
  39. package/src/modules/position/directives/index.d.ts.map +1 -0
  40. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +48 -0
  41. package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -0
  42. package/src/modules/position/index.d.ts +3 -0
  43. package/src/modules/position/index.d.ts.map +1 -0
  44. package/src/modules/position/modules/index.d.ts +2 -0
  45. package/src/modules/position/modules/index.d.ts.map +1 -0
  46. package/src/modules/position/modules/position.module.d.ts +11 -0
  47. package/src/modules/position/modules/position.module.d.ts.map +1 -0
  48. package/version.bak +1 -1
package/changelog.md CHANGED
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## Version 11.2.0 (2022-03-01)
4
4
 
5
+ ### Bug Fixes
6
+
7
+ - fixed `ModelPropertyMetadata` decorator metadata merging (previously multiple usages of decorator caused rewriting values with default value)
8
+
5
9
  ### Features
6
10
 
11
+ - new `PositionToDirective` directive, that sets position of attached element relative to provided element
12
+ - new `PositionModule` module for `PositionToDirective`
7
13
  - added new **Position**
8
14
  - new `Position` interface, that represents service that is used for positioning two elements against each other
9
15
  - new `PositionOptions` interface, that represents options that are passed to position service
@@ -25,10 +31,11 @@
25
31
  - new `PositionPlacement` enum with available positions for placement of target element against its source
26
32
  - new `PositionOffset` enum with applied offset to position of target in cross axis relative to placement
27
33
  - new `POSITION` *Injection Token* used for injecting service that is used for positioning of one element against another
28
- - added *subpackage* `@anglr/common/floating-ui`
29
- - *subpackage* `@anglr/common/floating-ui`
30
- - new `FloatingUiDomPosition` service that is used for positioning two elements against each other, using floating-ui dom implementation
31
- - new `FLOATING_UI_POSITION` provider for floating ui position implementation
34
+ - added *subpackage* `@anglr/common/floating-ui`
35
+ - *subpackage* `@anglr/common/floating-ui`
36
+ - requires `@floating-ui/dom` package of minimal version `0.3.1`
37
+ - new `FloatingUiDomPosition` service that is used for positioning two elements against each other, using floating-ui dom implementation
38
+ - new `FLOATING_UI_POSITION` provider for floating ui position implementation
32
39
 
33
40
  ## Version 11.1.0 (2022-02-22)
34
41
 
@@ -108,7 +108,9 @@ export class FloatingUiDomPosition {
108
108
  }
109
109
  middlewares.push(offset(({ floating, placement }) => {
110
110
  if (options.offset == PositionOffset.MouseEnter && options.mouseEvent) {
111
- return options.mouseEvent.offsetX;
111
+ return {
112
+ crossAxis: options.mouseEvent.offsetX
113
+ };
112
114
  }
113
115
  let dimension;
114
116
  if (placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||
@@ -1 +1 @@
1
- {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAgB,UAAU,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,cAAc,CAAC,IAAI;IAC3B,SAAS,EAAE,iBAAiB,CAAC,GAAG;CACnC,CAAC;AAEF;;GAEG;A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Aa,CAAC,OAAwB;QAE5C,QAAO,OAAO,CAAC,SAAS,EACxB;YACI;gBACA,8BAA8B;gBAC9B;oBACI,OAAO,KAAK,CAAC;iBAChB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,SAAS,CAAC;iBACpB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,QAAQ,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;;kHApPQ,qBAAqB;sHAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;;AAwPX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GACjC;IACI,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import {ClassProvider, Injectable} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: PositionOffset.None,\n placement: PositionPlacement.Top\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.offset != PositionOffset.None)\n {\n if(options.offset == PositionOffset.MouseEnter)\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({floating, placement}) =>\n {\n if(options.offset == PositionOffset.MouseEnter && options.mouseEvent)\n {\n return options.mouseEvent.offsetX;\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.width;\n }\n else\n {\n dimension = floating.height;\n }\n\n switch(options.offset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset.Full:\n {\n break;\n }\n case PositionOffset.Half:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset.NegativeFull:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset.NegativeHalf:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n\n/**\n * Provider for floating ui position implementation\n */\nexport const FLOATING_UI_POSITION: ClassProvider =\n{\n provide: POSITION,\n useClass: FloatingUiDomPosition\n};"]}
1
+ {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAgB,UAAU,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,cAAc,CAAC,IAAI;IAC3B,SAAS,EAAE,iBAAiB,CAAC,GAAG;CACnC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IAE9B,iGAAiG;IAEjG;;OAEG;IACI,YAAY,CAAC,MAAe,EAAE,MAAe,EAAE,OAAkC;QAEpF,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;YAE/B,CAAC,GAAS,EAAE;gBAER,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;gBAC5D,MAAM,W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;iBACpB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,QAAQ,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;;kHAtPQ,qBAAqB;sHAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;;AA0PX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GACjC;IACI,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import {ClassProvider, Injectable} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: PositionOffset.None,\n placement: PositionPlacement.Top\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.offset != PositionOffset.None)\n {\n if(options.offset == PositionOffset.MouseEnter)\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({floating, placement}) =>\n {\n if(options.offset == PositionOffset.MouseEnter && options.mouseEvent)\n {\n return {\n crossAxis: options.mouseEvent.offsetX\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.width;\n }\n else\n {\n dimension = floating.height;\n }\n\n switch(options.offset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset.Full:\n {\n break;\n }\n case PositionOffset.Half:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset.NegativeFull:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset.NegativeHalf:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n\n/**\n * Provider for floating ui position implementation\n */\nexport const FLOATING_UI_POSITION: ClassProvider =\n{\n provide: POSITION,\n useClass: FloatingUiDomPosition\n};"]}
@@ -20,7 +20,7 @@ export function ModelPropertyMetadata(metadata) {
20
20
  const originValidators = (_b = (_a = trgt.ɵControlsMetadata[propertyKey]) === null || _a === void 0 ? void 0 : _a.validators) !== null && _b !== void 0 ? _b : [];
21
21
  const originAsyncValidators = (_d = (_c = trgt.ɵControlsMetadata[propertyKey]) === null || _c === void 0 ? void 0 : _c.asyncValidators) !== null && _d !== void 0 ? _d : [];
22
22
  //merge all other values
23
- trgt.ɵControlsMetadata[propertyKey] = Object.assign(Object.assign(Object.assign({}, trgt.ɵControlsMetadata[propertyKey]), ɵDefaultPropertyMetadata), metadata);
23
+ trgt.ɵControlsMetadata[propertyKey] = Object.assign(Object.assign(Object.assign({}, ɵDefaultPropertyMetadata), trgt.ɵControlsMetadata[propertyKey]), metadata);
24
24
  //merge validators
25
25
  const propertyMetadata = trgt.ɵControlsMetadata[propertyKey];
26
26
  propertyMetadata.validators =
@@ -1 +1 @@
1
- {"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,UAAU,mCAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,eAAe,mCAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,iDAE5C,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,GACnD,wBAAwB,GACxB,QAAQ,CACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...ɵDefaultPropertyMetadata,\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
1
+ {"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,UAAU,mCAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,eAAe,mCAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,iDAE5C,wBAAwB,GACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,GACnD,QAAQ,CACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...ɵDefaultPropertyMetadata,\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
@@ -2,7 +2,6 @@ export { GlobalizationService } from './services/globalization/globalization.ser
2
2
  export { CommonDynamicModule } from './modules/commonDynamic.module';
3
3
  export { CommonLocalizeModule } from './modules/commonLocalize.module';
4
4
  export { CommonUtilsModule } from './modules/commonUtils.module';
5
- export * from './modules/goBack';
6
5
  export { ProgressIndicatorOptions } from './modules/progressIndicator/services/progressIndicatorOptions';
7
6
  export { ProgressIndicatorComponent } from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';
8
7
  export { ProgressIndicatorModule } from './modules/progressIndicator/modules/progressIndicator.module';
@@ -16,6 +15,8 @@ export { ClickOutsideModule } from './modules/clickOutside/modules/clickOutside.
16
15
  export { MultiButtonComponent } from './modules/multiButton/components/multiButton/multiButton.component';
17
16
  export { MULTI_BUTTON_CSS_CLASSES } from './modules/multiButton/misc/tokens';
18
17
  export { MultiButtonModule } from './modules/multiButton/modules/multiButton.module';
18
+ export * from './modules/goBack';
19
+ export * from './modules/position';
19
20
  export * from './modules/castPipes';
20
21
  export * from './types/tokens';
21
22
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,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AmB,EAAC,MAAM,SAAS,CAAC;AACjF,OAAO,EAAC,6BAA6B,EAAE,mBAAmB,EAAC,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport * from './modules/goBack';\nexport {ProgressIndicatorOptions} from './modules/progressIndicator/services/progressIndicatorOptions';\nexport {ProgressIndicatorComponent} from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';\nexport {ProgressIndicatorModule} from './modules/progressIndicator/modules/progressIndicator.module';\nexport {ProgressIndicatorService} from './modules/progressIndicator/services/progressIndicator.service';\nexport {PROGRESS_INDICATOR_GROUP_NAME} from './modules/progressIndicator/misc/tokens';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {ClickOutsideDirective} from './modules/clickOutside/directives/clickOutside/clickOutside.directive';\nexport {ClickOutsideModule} from './modules/clickOutside/modules/clickOutside.module';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './modules/castPipes';\nexport * from './types/tokens';\nexport * from './utils';\nexport * from './pipes';\nexport * from './decorators';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {CookiePermanentStorageService, PermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorageService, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalizationService, StringLocalization} from './services/stringLocalization';\nexport {Logger} from './services/logger';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable} from './utils';\nexport {PROGRESS_INTERCEPTOR_PROVIDER, ProgressInterceptor} from './modules/progressIndicator/interceptors/progressInterceptor';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAC,0BAA0B,EAAC,MAAM,sFAAsF,CAAC;AAChI,OAAO,EAAC,uBAAuB,EAAC,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAC,wBAAwB,EAAC,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,qBAAqB,EAAC,MAAM,uEAAuE,CAAC;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AAExG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAE9F,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AACjF,OAAO,EAAC,6BAA6B,EAAE,mBAAmB,EAAC,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport {ProgressIndicatorOptions} from './modules/progressIndicator/services/progressIndicatorOptions';\nexport {ProgressIndicatorComponent} from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';\nexport {ProgressIndicatorModule} from './modules/progressIndicator/modules/progressIndicator.module';\nexport {ProgressIndicatorService} from './modules/progressIndicator/services/progressIndicator.service';\nexport {PROGRESS_INDICATOR_GROUP_NAME} from './modules/progressIndicator/misc/tokens';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {ClickOutsideDirective} from './modules/clickOutside/directives/clickOutside/clickOutside.directive';\nexport {ClickOutsideModule} from './modules/clickOutside/modules/clickOutside.module';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './modules/goBack';\nexport * from './modules/position';\nexport * from './modules/castPipes';\nexport * from './types/tokens';\nexport * from './utils';\nexport * from './pipes';\nexport * from './decorators';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {CookiePermanentStorageService, PermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorageService, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalizationService, StringLocalization} from './services/stringLocalization';\nexport {Logger} from './services/logger';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable} from './utils';\nexport {PROGRESS_INTERCEPTOR_PROVIDER, ProgressInterceptor} from './modules/progressIndicator/interceptors/progressInterceptor';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
@@ -0,0 +1,2 @@
1
+ export * from './positionTo/positionTo.directive';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/position/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './positionTo/positionTo.directive';\n"]}
@@ -0,0 +1,91 @@
1
+ import { __awaiter } from "tslib";
2
+ import { Directive, Input, ElementRef, Inject } from '@angular/core';
3
+ import { nameof, isPresent, isString } from '@jscrpt/common';
4
+ import { applyPositionResult, PositionPlacement } from '../../../../services/position';
5
+ import { POSITION } from '../../../../types/tokens';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Sets position of attached element relative to provided element
9
+ */
10
+ export class PositionToDirective {
11
+ // //######################### public properties - outputs #########################
12
+ // /**
13
+ // * Occurs when flip occurs during positioning
14
+ // */
15
+ // @Output()
16
+ // public flip: EventEmitter<void> = new EventEmitter<void>();
17
+ //######################### constructor #########################
18
+ constructor(_target, _position) {
19
+ this._target = _target;
20
+ this._position = _position;
21
+ }
22
+ //######################### public properties - inputs #########################
23
+ /**
24
+ * Gets or sets html element which is used as source for positioning
25
+ */
26
+ get source() {
27
+ return this._source;
28
+ }
29
+ set source(value) {
30
+ if (value instanceof ElementRef) {
31
+ this._source = value.nativeElement;
32
+ return;
33
+ }
34
+ this._source = value;
35
+ }
36
+ /**
37
+ * Gets or sets position placement value
38
+ */
39
+ get placement() {
40
+ return this._placement;
41
+ }
42
+ set placement(value) {
43
+ if (isString(value)) {
44
+ this._placement = PositionPlacement[value];
45
+ return;
46
+ }
47
+ this._placement = value;
48
+ }
49
+ //######################### public methods - implementation of OnChanges #########################
50
+ /**
51
+ * Called when input value changes
52
+ */
53
+ ngOnChanges(changes) {
54
+ if ((nameof('source') in changes ||
55
+ nameof('placement') in changes) &&
56
+ isPresent(this.source)) {
57
+ this._applyPosition();
58
+ }
59
+ }
60
+ //######################### protected methods #########################
61
+ /**
62
+ * Applies position according to specified parameters to specified elements
63
+ */
64
+ _applyPosition() {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const options = {};
67
+ if (this._placement) {
68
+ options.placement = this._placement;
69
+ }
70
+ const result = yield this._position.placeElement(this._target.nativeElement, this._source, options).toPromise();
71
+ applyPositionResult(result);
72
+ });
73
+ }
74
+ }
75
+ PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: POSITION }], target: i0.ɵɵFactoryTarget.Directive });
76
+ PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement" }, usesOnChanges: true, ngImport: i0 });
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionToDirective, decorators: [{
78
+ type: Directive,
79
+ args: [{
80
+ selector: '[positionTo]'
81
+ }]
82
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
83
+ type: Inject,
84
+ args: [POSITION]
85
+ }] }]; }, propDecorators: { source: [{
86
+ type: Input,
87
+ args: ['positionTo']
88
+ }], placement: [{
89
+ type: Input
90
+ }] } });
91
+ //# sourceMappingURL=positionTo.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/position/directives/positionTo/positionTo.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAA4B,MAAM,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,QAAQ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AAuE;IAEvE;;OAEG;IACa,cAAc;;YAE1B,MAAM,OAAO,GACb,EACC,CAAC;YAEF,IAAG,IAAI,CAAC,UAAU,EAClB;gBACI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;aACvC;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,IAAI,CAAC,OAAO,EACZ,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtE,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;KAAA;;gHA1GQ,mBAAmB,4CAkER,QAAQ;oGAlEnB,mBAAmB;2FAAnB,mBAAmB;kBAJ/B,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;;0BAmEgB,MAAM;2BAAC,QAAQ;4CA9CjB,MAAM;sBADhB,KAAK;uBAAC,YAAY;gBAqBR,SAAS;sBADnB,KAAK","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject} from '@angular/core';\nimport {nameof, isPresent, isString} from '@jscrpt/common';\n\nimport {applyPositionResult, Position, PositionPlacement, PositionOptions} from '../../../../services/position';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Sets position of attached element relative to provided element\n */\n@Directive(\n{\n selector: '[positionTo]'\n})\nexport class PositionToDirective implements OnChanges\n{\n //######################### protected fields #########################\n\n /**\n * Position placement value\n */\n protected _placement: PositionPlacement|null|undefined;\n\n /**\n * Html element which is used as source for positioning\n */\n protected _source!: HTMLElement;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets html element which is used as source for positioning\n */\n @Input('positionTo')\n public get source(): HTMLElement\n {\n return this._source;\n }\n public set source(value: HTMLElement)\n {\n if(value instanceof ElementRef)\n {\n this._source = (value as ElementRef).nativeElement;\n\n return;\n }\n\n this._source = value;\n }\n\n /**\n * Gets or sets position placement value\n */\n @Input()\n public get placement(): PositionPlacement|null|undefined\n {\n return this._placement;\n }\n public set placement(value: PositionPlacement|null|undefined)\n {\n if(isString(value))\n {\n this._placement = PositionPlacement[value as keyof typeof PositionPlacement];\n\n return;\n }\n\n this._placement = value;\n }\n\n // //######################### public properties - outputs #########################\n\n // /**\n // * Occurs when flip occurs during positioning\n // */\n // @Output()\n // public flip: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(protected _target: ElementRef<HTMLElement>,\n @Inject(POSITION) protected _position: Position)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if((nameof<PositionToDirective>('source') in changes ||\n nameof<PositionToDirective>('placement') in changes) &&\n isPresent(this.source))\n {\n this._applyPosition();\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Applies position according to specified parameters to specified elements\n */\n protected async _applyPosition(): Promise<void>\n {\n const options: Partial<PositionOptions> =\n {\n };\n\n if(this._placement)\n {\n options.placement = this._placement;\n }\n\n const result = await this._position.placeElement(this._target.nativeElement,\n this._source,\n options).toPromise();\n\n applyPositionResult(result);\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `placement` input\n */\n public static ngAcceptInputType_placement: PositionPlacement|undefined|null|keyof typeof PositionPlacement;\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `positionTo` input\n */\n public static ngAcceptInputType_positionTo: HTMLElement|ElementRef<HTMLElement>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './directives';
2
+ export * from './modules';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/position/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC","sourcesContent":["export * from './directives';\nexport * from './modules';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './position.module';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/position/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './position.module';\n"]}
@@ -0,0 +1,24 @@
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 PositionModule {
8
+ }
9
+ PositionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
+ PositionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, declarations: [PositionToDirective], exports: [PositionToDirective] });
11
+ PositionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, imports: [[]] });
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, decorators: [{
13
+ type: NgModule,
14
+ args: [{
15
+ imports: [],
16
+ declarations: [
17
+ PositionToDirective
18
+ ],
19
+ exports: [
20
+ PositionToDirective
21
+ ]
22
+ }]
23
+ }] });
24
+ //# sourceMappingURL=position.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.module.js","sourceRoot":"","sources":["../../../../../src/modules/position/modules/position.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,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAPnB,mBAAmB,aAInB,mBAAmB;4GAGd,cAAc,YAXvB,EACC;2FAUQ,cAAc;kBAd1B,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 PositionModule\n{\n}\n"]}
@@ -107,7 +107,9 @@ export class FloatingUiDomPosition {
107
107
  }
108
108
  middlewares.push(offset(({ floating, placement }) => {
109
109
  if (options.offset == PositionOffset.MouseEnter && options.mouseEvent) {
110
- return options.mouseEvent.offsetX;
110
+ return {
111
+ crossAxis: options.mouseEvent.offsetX
112
+ };
111
113
  }
112
114
  let dimension;
113
115
  if (placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||
@@ -1 +1 @@
1
- {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,cAAc,CAAC,IAAI;IAC3B,SAAS,EAAE,iBAAiB,CAAC,GAAG;CACnC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IAE9B,iGAAiG;IAEjG;;OAEG;IACI,YAA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,8BAA8B;gBAC9B;oBACI,OAAO,KAAK,CAAC;iBAChB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,SAAS,CAAC;iBACpB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,QAAQ,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;;kHApPQ,qBAAqB;sHAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;;AAwPX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GACjC;IACI,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import {ClassProvider, Injectable} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: PositionOffset.None,\n placement: PositionPlacement.Top\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.offset != PositionOffset.None)\n {\n if(options.offset == PositionOffset.MouseEnter)\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({floating, placement}) =>\n {\n if(options.offset == PositionOffset.MouseEnter && options.mouseEvent)\n {\n return options.mouseEvent.offsetX;\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.width;\n }\n else\n {\n dimension = floating.height;\n }\n\n switch(options.offset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset.Full:\n {\n break;\n }\n case PositionOffset.Half:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset.NegativeFull:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset.NegativeHalf:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n\n/**\n * Provider for floating ui position implementation\n */\nexport const FLOATING_UI_POSITION: ClassProvider =\n{\n provide: POSITION,\n useClass: FloatingUiDomPosition\n};"]}
1
+ {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,cAAc,CAAC,IAAI;IAC3B,SAAS,EAAE,iBAAiB,CAAC,GAAG;CACnC,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IAE9B,iGAAiG;IAEjG;;OAEG;IACI,YAAY,CAAC,MAAe,EAAE,MAAe,EAAE,OAAkC;QAEpF,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;YAE/B,CAAC,KAAK,IAAI,EAAE;gBAER,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;gBAC5D,MAAM,WAAW,GAAiB,EAAE,CAAC;gBAErC,IAAI,CAAC,UAAU,CAAC,WA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Q,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;;kHAtPQ,qBAAqB;sHAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;;AA0PX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GACjC;IACI,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,qBAAqB;CAClC,CAAC","sourcesContent":["import {ClassProvider, Injectable} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION} from '@anglr/common';\nimport {extend} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: PositionOffset.None,\n placement: PositionPlacement.Top\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.offset != PositionOffset.None)\n {\n if(options.offset == PositionOffset.MouseEnter)\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({floating, placement}) =>\n {\n if(options.offset == PositionOffset.MouseEnter && options.mouseEvent)\n {\n return {\n crossAxis: options.mouseEvent.offsetX\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.width;\n }\n else\n {\n dimension = floating.height;\n }\n\n switch(options.offset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset.Full:\n {\n break;\n }\n case PositionOffset.Half:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset.NegativeFull:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset.NegativeHalf:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n\n/**\n * Provider for floating ui position implementation\n */\nexport const FLOATING_UI_POSITION: ClassProvider =\n{\n provide: POSITION,\n useClass: FloatingUiDomPosition\n};"]}
@@ -21,8 +21,8 @@ export function ModelPropertyMetadata(metadata) {
21
21
  //merge all other values
22
22
  trgt.ɵControlsMetadata[propertyKey] =
23
23
  {
24
- ...trgt.ɵControlsMetadata[propertyKey],
25
24
  ...ɵDefaultPropertyMetadata,
25
+ ...trgt.ɵControlsMetadata[propertyKey],
26
26
  ...metadata
27
27
  };
28
28
  //merge validators
@@ -1 +1 @@
1
- {"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;YACnD;gBACI,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;gBACtD,GAAG,wBAAwB;gBAC3B,GAAG,QAAQ;aACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...ɵDefaultPropertyMetadata,\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
1
+ {"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;YACnD;gBACI,GAAG,wBAAwB;gBAC3B,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;gBACtD,GAAG,QAAQ;aACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...ɵDefaultPropertyMetadata,\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
@@ -2,7 +2,6 @@ export { GlobalizationService } from './services/globalization/globalization.ser
2
2
  export { CommonDynamicModule } from './modules/commonDynamic.module';
3
3
  export { CommonLocalizeModule } from './modules/commonLocalize.module';
4
4
  export { CommonUtilsModule } from './modules/commonUtils.module';
5
- export * from './modules/goBack';
6
5
  export { ProgressIndicatorOptions } from './modules/progressIndicator/services/progressIndicatorOptions';
7
6
  export { ProgressIndicatorComponent } from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';
8
7
  export { ProgressIndicatorModule } from './modules/progressIndicator/modules/progressIndicator.module';
@@ -16,6 +15,8 @@ export { ClickOutsideModule } from './modules/clickOutside/modules/clickOutside.
16
15
  export { MultiButtonComponent } from './modules/multiButton/components/multiButton/multiButton.component';
17
16
  export { MULTI_BUTTON_CSS_CLASSES } from './modules/multiButton/misc/tokens';
18
17
  export { MultiButtonModule } from './modules/multiButton/modules/multiButton.module';
18
+ export * from './modules/goBack';
19
+ export * from './modules/position';
19
20
  export * from './modules/castPipes';
20
21
  export * from './types/tokens';
21
22
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAC,wBAAwB,EAAC,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAC,0BAA0B,EAAC,MAAM,sFAAsF,CAAC;AAChI,OAAO,EAAC,uBAAuB,EAAC,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAC,wBAAwB,EAAC,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,qBAAqB,EAAC,MAAM,uEAAuE,CAAC;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AAExG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAE9F,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AACjF,OAAO,EAAC,6BAA6B,EAAE,mBAAmB,EAAC,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport * from './modules/goBack';\nexport {ProgressIndicatorOptions} from './modules/progressIndicator/services/progressIndicatorOptions';\nexport {ProgressIndicatorComponent} from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';\nexport {ProgressIndicatorModule} from './modules/progressIndicator/modules/progressIndicator.module';\nexport {ProgressIndicatorService} from './modules/progressIndicator/services/progressIndicator.service';\nexport {PROGRESS_INDICATOR_GROUP_NAME} from './modules/progressIndicator/misc/tokens';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {ClickOutsideDirective} from './modules/clickOutside/directives/clickOutside/clickOutside.directive';\nexport {ClickOutsideModule} from './modules/clickOutside/modules/clickOutside.module';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './modules/castPipes';\nexport * from './types/tokens';\nexport * from './utils';\nexport * from './pipes';\nexport * from './decorators';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {CookiePermanentStorageService, PermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorageService, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalizationService, StringLocalization} from './services/stringLocalization';\nexport {Logger} from './services/logger';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable} from './utils';\nexport {PROGRESS_INTERCEPTOR_PROVIDER, ProgressInterceptor} from './modules/progressIndicator/interceptors/progressInterceptor';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAC,0BAA0B,EAAC,MAAM,sFAAsF,CAAC;AAChI,OAAO,EAAC,uBAAuB,EAAC,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAC,wBAAwB,EAAC,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,qBAAqB,EAAC,MAAM,uEAAuE,CAAC;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AAExG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAC,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAE9F,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AACjF,OAAO,EAAC,6BAA6B,EAAE,mBAAmB,EAAC,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport {ProgressIndicatorOptions} from './modules/progressIndicator/services/progressIndicatorOptions';\nexport {ProgressIndicatorComponent} from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';\nexport {ProgressIndicatorModule} from './modules/progressIndicator/modules/progressIndicator.module';\nexport {ProgressIndicatorService} from './modules/progressIndicator/services/progressIndicator.service';\nexport {PROGRESS_INDICATOR_GROUP_NAME} from './modules/progressIndicator/misc/tokens';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {ClickOutsideDirective} from './modules/clickOutside/directives/clickOutside/clickOutside.directive';\nexport {ClickOutsideModule} from './modules/clickOutside/modules/clickOutside.module';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './modules/goBack';\nexport * from './modules/position';\nexport * from './modules/castPipes';\nexport * from './types/tokens';\nexport * from './utils';\nexport * from './pipes';\nexport * from './decorators';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {CookiePermanentStorageService, PermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorageService, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalizationService, StringLocalization} from './services/stringLocalization';\nexport {Logger} from './services/logger';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable} from './utils';\nexport {PROGRESS_INTERCEPTOR_PROVIDER, ProgressInterceptor} from './modules/progressIndicator/interceptors/progressInterceptor';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
@@ -0,0 +1,2 @@
1
+ export * from './positionTo/positionTo.directive';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/position/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './positionTo/positionTo.directive';\n"]}
@@ -0,0 +1,88 @@
1
+ import { Directive, Input, ElementRef, Inject } from '@angular/core';
2
+ import { nameof, isPresent, isString } from '@jscrpt/common';
3
+ import { applyPositionResult, PositionPlacement } from '../../../../services/position';
4
+ import { POSITION } from '../../../../types/tokens';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Sets position of attached element relative to provided element
8
+ */
9
+ export class PositionToDirective {
10
+ // //######################### public properties - outputs #########################
11
+ // /**
12
+ // * Occurs when flip occurs during positioning
13
+ // */
14
+ // @Output()
15
+ // public flip: EventEmitter<void> = new EventEmitter<void>();
16
+ //######################### constructor #########################
17
+ constructor(_target, _position) {
18
+ this._target = _target;
19
+ this._position = _position;
20
+ }
21
+ //######################### public properties - inputs #########################
22
+ /**
23
+ * Gets or sets html element which is used as source for positioning
24
+ */
25
+ get source() {
26
+ return this._source;
27
+ }
28
+ set source(value) {
29
+ if (value instanceof ElementRef) {
30
+ this._source = value.nativeElement;
31
+ return;
32
+ }
33
+ this._source = value;
34
+ }
35
+ /**
36
+ * Gets or sets position placement value
37
+ */
38
+ get placement() {
39
+ return this._placement;
40
+ }
41
+ set placement(value) {
42
+ if (isString(value)) {
43
+ this._placement = PositionPlacement[value];
44
+ return;
45
+ }
46
+ this._placement = value;
47
+ }
48
+ //######################### public methods - implementation of OnChanges #########################
49
+ /**
50
+ * Called when input value changes
51
+ */
52
+ ngOnChanges(changes) {
53
+ if ((nameof('source') in changes ||
54
+ nameof('placement') in changes) &&
55
+ isPresent(this.source)) {
56
+ this._applyPosition();
57
+ }
58
+ }
59
+ //######################### protected methods #########################
60
+ /**
61
+ * Applies position according to specified parameters to specified elements
62
+ */
63
+ async _applyPosition() {
64
+ const options = {};
65
+ if (this._placement) {
66
+ options.placement = this._placement;
67
+ }
68
+ const result = await this._position.placeElement(this._target.nativeElement, this._source, options).toPromise();
69
+ applyPositionResult(result);
70
+ }
71
+ }
72
+ PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: POSITION }], target: i0.ɵɵFactoryTarget.Directive });
73
+ PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement" }, usesOnChanges: true, ngImport: i0 });
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionToDirective, decorators: [{
75
+ type: Directive,
76
+ args: [{
77
+ selector: '[positionTo]'
78
+ }]
79
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
80
+ type: Inject,
81
+ args: [POSITION]
82
+ }] }]; }, propDecorators: { source: [{
83
+ type: Input,
84
+ args: ['positionTo']
85
+ }], placement: [{
86
+ type: Input
87
+ }] } });
88
+ //# sourceMappingURL=positionTo.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/position/directives/positionTo/positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAA4B,MAAM,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAY,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;;AAElD;;GAEG;AAKH,MAAM,OAAO,mBAAmB;IAwD5B,oFAAoF;IAEpF,MAAM;IACN,gDAAgD;IAChD,MAAM;IACN,YAAY;IACZ,8DAA8D;IAE9D,iEAAiE;IACjE,YAAsB,OAAgC,EACd,SAAmB;QADrC,YAAO,GAAP,OAAO,CAAyB;QACd,cAAS,GAAT,SAAS,CAAU;IAE3D,CAAC;IAtDD,gFAAgF;IAEhF;;OAEG;IACH,IACW,MAAM;QAEb,OAAO,IAAI,CAAC,OA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,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;;0BAmEgB,MAAM;2BAAC,QAAQ;4CA9CjB,MAAM;sBADhB,KAAK;uBAAC,YAAY;gBAqBR,SAAS;sBADnB,KAAK","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject} from '@angular/core';\nimport {nameof, isPresent, isString} from '@jscrpt/common';\n\nimport {applyPositionResult, Position, PositionPlacement, PositionOptions} from '../../../../services/position';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Sets position of attached element relative to provided element\n */\n@Directive(\n{\n selector: '[positionTo]'\n})\nexport class PositionToDirective implements OnChanges\n{\n //######################### protected fields #########################\n\n /**\n * Position placement value\n */\n protected _placement: PositionPlacement|null|undefined;\n\n /**\n * Html element which is used as source for positioning\n */\n protected _source!: HTMLElement;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets html element which is used as source for positioning\n */\n @Input('positionTo')\n public get source(): HTMLElement\n {\n return this._source;\n }\n public set source(value: HTMLElement)\n {\n if(value instanceof ElementRef)\n {\n this._source = (value as ElementRef).nativeElement;\n\n return;\n }\n\n this._source = value;\n }\n\n /**\n * Gets or sets position placement value\n */\n @Input()\n public get placement(): PositionPlacement|null|undefined\n {\n return this._placement;\n }\n public set placement(value: PositionPlacement|null|undefined)\n {\n if(isString(value))\n {\n this._placement = PositionPlacement[value as keyof typeof PositionPlacement];\n\n return;\n }\n\n this._placement = value;\n }\n\n // //######################### public properties - outputs #########################\n\n // /**\n // * Occurs when flip occurs during positioning\n // */\n // @Output()\n // public flip: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(protected _target: ElementRef<HTMLElement>,\n @Inject(POSITION) protected _position: Position)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if((nameof<PositionToDirective>('source') in changes ||\n nameof<PositionToDirective>('placement') in changes) &&\n isPresent(this.source))\n {\n this._applyPosition();\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Applies position according to specified parameters to specified elements\n */\n protected async _applyPosition(): Promise<void>\n {\n const options: Partial<PositionOptions> =\n {\n };\n\n if(this._placement)\n {\n options.placement = this._placement;\n }\n\n const result = await this._position.placeElement(this._target.nativeElement,\n this._source,\n options).toPromise();\n\n applyPositionResult(result);\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `placement` input\n */\n public static ngAcceptInputType_placement: PositionPlacement|undefined|null|keyof typeof PositionPlacement;\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `positionTo` input\n */\n public static ngAcceptInputType_positionTo: HTMLElement|ElementRef<HTMLElement>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './directives';
2
+ export * from './modules';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/position/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC","sourcesContent":["export * from './directives';\nexport * from './modules';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './position.module';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/position/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './position.module';\n"]}
@@ -0,0 +1,24 @@
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 PositionModule {
8
+ }
9
+ PositionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
+ PositionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, declarations: [PositionToDirective], exports: [PositionToDirective] });
11
+ PositionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, imports: [[]] });
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: PositionModule, decorators: [{
13
+ type: NgModule,
14
+ args: [{
15
+ imports: [],
16
+ declarations: [
17
+ PositionToDirective
18
+ ],
19
+ exports: [
20
+ PositionToDirective
21
+ ]
22
+ }]
23
+ }] });
24
+ //# sourceMappingURL=position.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.module.js","sourceRoot":"","sources":["../../../../../src/modules/position/modules/position.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,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAPnB,mBAAmB,aAInB,mBAAmB;4GAGd,cAAc,YAXvB,EACC;2FAUQ,cAAc;kBAd1B,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 PositionModule\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,QA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AC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC;IAiFrH;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAQ7E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAkF/E;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;yCAhMnD,qBAAqB;6CAArB,qBAAqB;CAuPjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "11.2.0-beta.20220301090733",
3
+ "version": "11.2.0-beta.20220301105854",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export { GlobalizationService } from './services/globalization/globalization.ser
2
2
  export { CommonDynamicModule } from './modules/commonDynamic.module';
3
3
  export { CommonLocalizeModule } from './modules/commonLocalize.module';
4
4
  export { CommonUtilsModule } from './modules/commonUtils.module';
5
- export * from './modules/goBack';
6
5
  export { ProgressIndicatorOptions } from './modules/progressIndicator/services/progressIndicatorOptions';
7
6
  export { ProgressIndicatorComponent } from './modules/progressIndicator/components/progressIndicator/progressIndicator.component';
8
7
  export { ProgressIndicatorModule } from './modules/progressIndicator/modules/progressIndicator.module';
@@ -17,6 +16,8 @@ export { MultiButtonComponent } from './modules/multiButton/components/multiButt
17
16
  export { MultiButtonCssClasses } from './modules/multiButton/components/multiButton/multiButton.interface';
18
17
  export { MULTI_BUTTON_CSS_CLASSES } from './modules/multiButton/misc/tokens';
19
18
  export { MultiButtonModule } from './modules/multiButton/modules/multiButton.module';
19
+ export * from './modules/goBack';
20
+ export * from './modules/position';
20
21
  export * from './modules/castPipes';
21
22
  export * from './types/tokens';
22
23
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAC,wBAAwB,EAAC,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAC,0BAA0B,EAAC,MAAM,sFAAsF,CAAC;AAChI,OAAO,EAAC,uBAAuB,EAAC,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAC,wBAAwB,EAAC,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,qBAAqB,EAAC,MAAM,uEAAuE,CAAC;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AACxG,OAAO,EAAC,qBAAqB,EAAC,MAAM,oEAAoE,CAAC;AACzG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc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AC,6BAA6B,EAAE,mBAAmB,EAAC,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,iCAAiC,EAAC,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './positionTo/positionTo.directive';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { ElementRef, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Position, PositionPlacement } from '../../../../services/position';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Sets position of attached element relative to provided element
6
+ */
7
+ export declare class PositionToDirective implements OnChanges {
8
+ protected _target: ElementRef<HTMLElement>;
9
+ protected _position: Position;
10
+ /**
11
+ * Position placement value
12
+ */
13
+ protected _placement: PositionPlacement | null | undefined;
14
+ /**
15
+ * Html element which is used as source for positioning
16
+ */
17
+ protected _source: HTMLElement;
18
+ /**
19
+ * Gets or sets html element which is used as source for positioning
20
+ */
21
+ get source(): HTMLElement;
22
+ set source(value: HTMLElement);
23
+ /**
24
+ * Gets or sets position placement value
25
+ */
26
+ get placement(): PositionPlacement | null | undefined;
27
+ set placement(value: PositionPlacement | null | undefined);
28
+ constructor(_target: ElementRef<HTMLElement>, _position: Position);
29
+ /**
30
+ * Called when input value changes
31
+ */
32
+ ngOnChanges(changes: SimpleChanges): void;
33
+ /**
34
+ * Applies position according to specified parameters to specified elements
35
+ */
36
+ protected _applyPosition(): Promise<void>;
37
+ /**
38
+ * Custom input type for `placement` input
39
+ */
40
+ static ngAcceptInputType_placement: PositionPlacement | undefined | null | keyof typeof PositionPlacement;
41
+ /**
42
+ * Custom input type for `positionTo` input
43
+ */
44
+ static ngAcceptInputType_positionTo: HTMLElement | ElementRef<HTMLElement>;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<PositionToDirective, never>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PositionToDirective, "[positionTo]", never, { "source": "positionTo"; "placement": "placement"; }, {}, never>;
47
+ }
48
+ //# sourceMappingURL=positionTo.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionTo.directive.d.ts","sourceRoot":"","sources":["positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAE,aAAa,EAAS,MAAM,eAAe,CAAC;AAG7F,OAAO,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;gBAWqB,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;IAoB/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;yCAxHvE,mBAAmB;2CAAnB,mBAAmB;CAyH/B"}
@@ -0,0 +1,3 @@
1
+ export * from './directives';
2
+ export * from './modules';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './position.module';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "../directives/positionTo/positionTo.directive";
3
+ /**
4
+ * Module for position to directive
5
+ */
6
+ export declare class PositionModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<PositionModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PositionModule, [typeof i1.PositionToDirective], never, [typeof i1.PositionToDirective]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<PositionModule>;
10
+ }
11
+ //# sourceMappingURL=position.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.module.d.ts","sourceRoot":"","sources":["position.module.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH,qBAca,cAAc;yCAAd,cAAc;0CAAd,cAAc;0CAAd,cAAc;CAE1B"}
package/version.bak CHANGED
@@ -1 +1 @@
1
- 11.2.0-beta.20220301090733
1
+ 11.2.0-beta.20220301105854