@anglr/common 11.2.0-beta.20220228151413 → 11.2.0-beta.20220301064829

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 (69) hide show
  1. package/changelog.md +31 -0
  2. package/es2015/floating-ui/src/index.js +2 -0
  3. package/es2015/floating-ui/src/index.js.map +1 -0
  4. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +196 -0
  5. package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -0
  6. package/es2015/floating-ui/src/services/index.js +2 -0
  7. package/es2015/floating-ui/src/services/index.js.map +1 -0
  8. package/es2015/src/index.js +1 -1
  9. package/es2015/src/index.js.map +1 -1
  10. package/es2015/src/services/position/index.js +4 -0
  11. package/es2015/src/services/position/index.js.map +1 -0
  12. package/es2015/src/services/position/position.interface.js +2 -0
  13. package/es2015/src/services/position/position.interface.js.map +1 -0
  14. package/es2015/src/services/position/position.types.js +85 -0
  15. package/es2015/src/services/position/position.types.js.map +1 -0
  16. package/es2015/src/services/position/position.utils.js +12 -0
  17. package/es2015/src/services/position/position.utils.js.map +1 -0
  18. package/es2015/src/types/tokens.js +2 -2
  19. package/es2015/src/types/tokens.js.map +1 -1
  20. package/es2020/floating-ui/src/index.js +2 -0
  21. package/es2020/floating-ui/src/index.js.map +1 -0
  22. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +193 -0
  23. package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -0
  24. package/es2020/floating-ui/src/services/index.js +2 -0
  25. package/es2020/floating-ui/src/services/index.js.map +1 -0
  26. package/es2020/src/index.js +1 -1
  27. package/es2020/src/index.js.map +1 -1
  28. package/es2020/src/services/position/index.js +4 -0
  29. package/es2020/src/services/position/index.js.map +1 -0
  30. package/es2020/src/services/position/position.interface.js +2 -0
  31. package/es2020/src/services/position/position.interface.js.map +1 -0
  32. package/es2020/src/services/position/position.types.js +85 -0
  33. package/es2020/src/services/position/position.types.js.map +1 -0
  34. package/es2020/src/services/position/position.utils.js +12 -0
  35. package/es2020/src/services/position/position.utils.js.map +1 -0
  36. package/es2020/src/types/tokens.js +2 -2
  37. package/es2020/src/types/tokens.js.map +1 -1
  38. package/floating-ui/package.json +9 -0
  39. package/floating-ui/src/index.d.ts +2 -0
  40. package/{src/services/alignment → floating-ui/src}/index.d.ts.map +1 -1
  41. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts +37 -0
  42. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -0
  43. package/floating-ui/src/services/index.d.ts +2 -0
  44. package/floating-ui/src/services/index.d.ts.map +1 -0
  45. package/package.json +17 -3
  46. package/src/index.d.ts +1 -1
  47. package/src/index.d.ts.map +1 -1
  48. package/src/services/position/index.d.ts +4 -0
  49. package/src/services/position/index.d.ts.map +1 -0
  50. package/src/services/position/position.interface.d.ts +81 -0
  51. package/src/services/position/position.interface.d.ts.map +1 -0
  52. package/src/services/position/position.types.d.ts +83 -0
  53. package/src/services/position/position.types.d.ts.map +1 -0
  54. package/src/services/position/position.utils.d.ts +7 -0
  55. package/src/services/position/position.utils.d.ts.map +1 -0
  56. package/src/types/tokens.d.ts +3 -3
  57. package/src/types/tokens.d.ts.map +1 -1
  58. package/version.bak +1 -1
  59. package/es2015/src/services/alignment/alignment.interface.js +0 -2
  60. package/es2015/src/services/alignment/alignment.interface.js.map +0 -1
  61. package/es2015/src/services/alignment/index.js +0 -2
  62. package/es2015/src/services/alignment/index.js.map +0 -1
  63. package/es2020/src/services/alignment/alignment.interface.js +0 -2
  64. package/es2020/src/services/alignment/alignment.interface.js.map +0 -1
  65. package/es2020/src/services/alignment/index.js +0 -2
  66. package/es2020/src/services/alignment/index.js.map +0 -1
  67. package/src/services/alignment/alignment.interface.d.ts +0 -6
  68. package/src/services/alignment/alignment.interface.d.ts.map +0 -1
  69. package/src/services/alignment/index.d.ts +0 -2
package/changelog.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 11.2.0 (2022-03-01)
4
+
5
+ ### Features
6
+
7
+ - added new **Position**
8
+ - new `Position` interface, that represents service that is used for positioning two elements against each other
9
+ - new `PositionOptions` interface, that represents options that are passed to position service
10
+ - property `placement` placement of target element against source element
11
+ - property `offset` offset which allows moving target element along the cross axis of placement
12
+ - property `flip` indication whether perform flip in case of collision (with view boundaries)
13
+ - property `autoUpdate` indication whether set up 'auto updating' of position
14
+ - method `autoUpdateProcessor` function that is called when auto updated is called for processing result
15
+ - property `mouseEvent` mouse event that occured when positioning was called
16
+ - new `PositionResult` interface, that represents result of positioning process, storing new coordinates
17
+ - property `target` target element to be positioned
18
+ - property `x` X coordinate of position of target
19
+ - property `y` Y coordinate of position of target
20
+ - method `dispose` disposes instance of engine used for positioning
21
+ - new `AutoUpdateOptions` interface, that represents options for autoupdate specific functionality
22
+ - property `ancestorScroll` indication whether update position when ancestor scroll changes
23
+ - property `ancestorResize` indication whether update position when ancestor size changes
24
+ - property `elementResize` indication whether update position when target element changes size
25
+ - new `applyPositionResult` function, that applies `PositionResult` to target element
26
+ - new `PositionPlacement` enum with available positions for placement of target element against its source
27
+ - new `PositionOffset` enum with applied offset to position of target in cross axis relative to placement
28
+ - new `POSITION` *Injection Token* used for injecting service that is used for positioning of one element against another
29
+ - added *subpackage* `@anglr/common/floating-ui`
30
+ - *subpackage* `@anglr/common/floating-ui`
31
+ - new `FloatingUiDomPosition` service that is used for positioning two elements against each other, using floating-ui dom implementation
32
+ - new `FLOATING_UI_POSITION` provider for floating ui position implementation
33
+
3
34
  ## Version 11.1.0 (2022-02-22)
4
35
 
5
36
  ### Features
@@ -0,0 +1,2 @@
1
+ export * from './services';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../floating-ui/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC","sourcesContent":["export * from './services';\n"]}
@@ -0,0 +1,196 @@
1
+ import { __awaiter } from "tslib";
2
+ import { Injectable } from '@angular/core';
3
+ import { PositionOffset, PositionPlacement, POSITION } from '@anglr/common';
4
+ import { extend } from '@jscrpt/common';
5
+ import { computePosition, autoUpdate, offset, flip } from '@floating-ui/dom';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Default options for `FloatingUiDomPosition` implementation
9
+ */
10
+ const defaultOptions = {
11
+ autoUpdate: false,
12
+ flip: false,
13
+ offset: PositionOffset.None,
14
+ placement: PositionPlacement.Top
15
+ };
16
+ /**
17
+ * Service that is used for positioning two elements against each other, using floating-ui dom implementation
18
+ */
19
+ export class FloatingUiDomPosition {
20
+ //######################### public methods - implementation of Position #########################
21
+ /**
22
+ * @inheritdoc
23
+ */
24
+ placeElement(target, source, options) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const computedOptions = extend({}, defaultOptions, options);
27
+ const middlewares = [];
28
+ this._setOffset(middlewares, computedOptions);
29
+ this._setFlip(middlewares, computedOptions);
30
+ const runComputation = () => __awaiter(this, void 0, void 0, function* () {
31
+ const result = yield computePosition(source, target, {
32
+ placement: this._getPlacement(computedOptions),
33
+ middleware: middlewares
34
+ });
35
+ if (computedOptions.autoUpdate && computedOptions.autoUpdateProcessor) {
36
+ computedOptions.autoUpdateProcessor({
37
+ target,
38
+ dispose: () => { },
39
+ x: result.x,
40
+ y: result.y
41
+ });
42
+ }
43
+ return result;
44
+ });
45
+ const result = yield runComputation();
46
+ let dispose = () => { };
47
+ if (computedOptions.autoUpdate) {
48
+ let options;
49
+ if (computedOptions.autoUpdate === true) {
50
+ options =
51
+ {
52
+ ancestorResize: true,
53
+ ancestorScroll: true,
54
+ elementResize: true
55
+ };
56
+ }
57
+ else {
58
+ options = computedOptions.autoUpdate;
59
+ }
60
+ dispose = autoUpdate(source, target, runComputation, options);
61
+ }
62
+ return {
63
+ target,
64
+ dispose,
65
+ x: result.x,
66
+ y: result.y
67
+ };
68
+ });
69
+ }
70
+ //######################### protected methods #########################
71
+ /**
72
+ * Sets flip middleware
73
+ * @param middlewares - Array of middlewares that will set
74
+ * @param options - Options that contains definition of flip
75
+ */
76
+ _setFlip(middlewares, options) {
77
+ if (options.flip) {
78
+ middlewares.push(flip());
79
+ }
80
+ }
81
+ /**
82
+ * Sets offset middleware
83
+ * @param middlewares - Array of middlewares that will set
84
+ * @param options - Options that contains definition of offset
85
+ */
86
+ _setOffset(middlewares, options) {
87
+ if (options.offset != PositionOffset.None) {
88
+ //TODO: mouse enter
89
+ middlewares.push(offset(({ floating, placement }) => {
90
+ let dimension;
91
+ if (placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||
92
+ placement == 'top' || placement == 'top-start' || placement == 'top-end') {
93
+ dimension = floating.width;
94
+ }
95
+ else {
96
+ dimension = floating.height;
97
+ }
98
+ switch (options.offset) {
99
+ default:
100
+ //case PositionOffset.Full:
101
+ {
102
+ break;
103
+ }
104
+ case PositionOffset.Half:
105
+ {
106
+ dimension /= 2;
107
+ break;
108
+ }
109
+ case PositionOffset.NegativeFull:
110
+ {
111
+ dimension *= -1;
112
+ break;
113
+ }
114
+ case PositionOffset.NegativeHalf:
115
+ {
116
+ dimension *= -.5;
117
+ break;
118
+ }
119
+ }
120
+ return {
121
+ crossAxis: dimension
122
+ };
123
+ }));
124
+ }
125
+ }
126
+ /**
127
+ * Gets floating ui placement from position placement
128
+ * @param options - Options containing position placement
129
+ */
130
+ _getPlacement(options) {
131
+ switch (options.placement) {
132
+ default:
133
+ // case PositionPlacement.Top:
134
+ {
135
+ return 'bottom';
136
+ }
137
+ case PositionPlacement.TopStart:
138
+ {
139
+ return 'top-start';
140
+ }
141
+ case PositionPlacement.TopEnd:
142
+ {
143
+ return 'top-end';
144
+ }
145
+ case PositionPlacement.Bottom:
146
+ {
147
+ return 'bottom';
148
+ }
149
+ case PositionPlacement.BottomStart:
150
+ {
151
+ return 'bottom-start';
152
+ }
153
+ case PositionPlacement.BottomEnd:
154
+ {
155
+ return 'bottom-end';
156
+ }
157
+ case PositionPlacement.Left:
158
+ {
159
+ return 'left';
160
+ }
161
+ case PositionPlacement.LeftStart:
162
+ {
163
+ return 'left-start';
164
+ }
165
+ case PositionPlacement.LeftEnd:
166
+ {
167
+ return 'left-end';
168
+ }
169
+ case PositionPlacement.Right:
170
+ {
171
+ return 'right';
172
+ }
173
+ case PositionPlacement.RightStart:
174
+ {
175
+ return 'right-start';
176
+ }
177
+ case PositionPlacement.RightEnd:
178
+ {
179
+ return 'right-end';
180
+ }
181
+ }
182
+ }
183
+ }
184
+ FloatingUiDomPosition.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: FloatingUiDomPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
185
+ FloatingUiDomPosition.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: FloatingUiDomPosition });
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: FloatingUiDomPosition, decorators: [{
187
+ type: Injectable
188
+ }] });
189
+ /**
190
+ * Provider for floating ui position implementation
191
+ */
192
+ export const FLOATING_UI_POSITION = {
193
+ provide: POSITION,
194
+ useClass: FloatingUiDomPosition
195
+ };
196
+ //# sourceMappingURL=floatingUiDomPosition.service.js.map
@@ -0,0 +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;;AAElG;;GAEG;AACH,MAAM,cAAc,GACpB;IAC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BAAqB;sHAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;;AAiNX;;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';\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 async placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Promise<PositionResult>\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 && computedOptions.autoUpdateProcessor)\n {\n computedOptions.autoUpdateProcessor(\n {\n target,\n dispose: () => {},\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n\n const result = await runComputation();\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 return {\n target,\n dispose,\n x: result.x,\n y: result.y\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 //TODO: mouse enter\n\n middlewares.push(offset(({floating, placement}) => \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 //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 'bottom';\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};"]}
@@ -0,0 +1,2 @@
1
+ export * from './floatingUiDomPosition.service';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './floatingUiDomPosition.service';\n"]}
@@ -30,7 +30,7 @@ export { NgComponentOutletEx } from './directives/ngComponentOutletEx/ngComponen
30
30
  export { APP_STABLE, extractAppStableResolve, runWhenModuleStable } from './utils';
31
31
  export { PROGRESS_INTERCEPTOR_PROVIDER, ProgressInterceptor } from './modules/progressIndicator/interceptors/progressInterceptor';
32
32
  export { DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, NotificationsOptions } from './services/notifications';
33
- export * from './services/alignment';
33
+ export * from './services/position';
34
34
  //TODO: any to unknown
35
35
  //TODO: strict null checks
36
36
  //# sourceMappingURL=index.js.map
@@ -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,MAA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F,MAAM,0BAA0B,CAAC;AAC3P,cAAc,sBAAsB,CAAC;AAErC,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/alignment';\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,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"]}
@@ -0,0 +1,4 @@
1
+ export * from './position.interface';
2
+ export * from './position.types';
3
+ export * from './position.utils';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/position/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './position.interface';\nexport * from './position.types';\nexport * from './position.utils';\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=position.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {PositionOffset, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement\n */\n offset: PositionOffset;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Function that is called when auto updated is called for processing result\n */\n autoUpdateProcessor?: (result: PositionResult) => void;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Promise<PositionResult>;\n}\n"]}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Available positions for placement of target element against its source
3
+ */
4
+ export var PositionPlacement;
5
+ (function (PositionPlacement) {
6
+ /**
7
+ * Target is placed on the top (above) of source element in the middle of its width
8
+ */
9
+ PositionPlacement[PositionPlacement["Top"] = 0] = "Top";
10
+ /**
11
+ * Target is placed on the top (above) of source element at the start (left) of its width
12
+ */
13
+ PositionPlacement[PositionPlacement["TopStart"] = 1] = "TopStart";
14
+ /**
15
+ * Target is placed on the top (above) of source element at the end (right) of its width
16
+ */
17
+ PositionPlacement[PositionPlacement["TopEnd"] = 2] = "TopEnd";
18
+ /**
19
+ * Target is placed on the left (before) of source element in the middle of its height
20
+ */
21
+ PositionPlacement[PositionPlacement["Left"] = 3] = "Left";
22
+ /**
23
+ * Target is placed on the left (before) of source element at the start (top) of its height
24
+ */
25
+ PositionPlacement[PositionPlacement["LeftStart"] = 4] = "LeftStart";
26
+ /**
27
+ * Target is placed on the left (before) of source element at the end (bottom) of its height
28
+ */
29
+ PositionPlacement[PositionPlacement["LeftEnd"] = 5] = "LeftEnd";
30
+ /**
31
+ * Target is placed on the right (after) of source element in the middle of its height
32
+ */
33
+ PositionPlacement[PositionPlacement["Right"] = 6] = "Right";
34
+ /**
35
+ * Target is placed on the right (after) of source element at the start (top) of its height
36
+ */
37
+ PositionPlacement[PositionPlacement["RightStart"] = 7] = "RightStart";
38
+ /**
39
+ * Target is placed on the right (after) of source element at the end (bottom) of its height
40
+ */
41
+ PositionPlacement[PositionPlacement["RightEnd"] = 8] = "RightEnd";
42
+ /**
43
+ * Target is placed on the bottom (below) of source element in the middle of its width
44
+ */
45
+ PositionPlacement[PositionPlacement["Bottom"] = 9] = "Bottom";
46
+ /**
47
+ * Target is placed on the bottom (below) of source element at the start (left) of its width
48
+ */
49
+ PositionPlacement[PositionPlacement["BottomStart"] = 10] = "BottomStart";
50
+ /**
51
+ * Target is placed on the bottom (below) of source element at the end (right) of its width
52
+ */
53
+ PositionPlacement[PositionPlacement["BottomEnd"] = 11] = "BottomEnd";
54
+ })(PositionPlacement || (PositionPlacement = {}));
55
+ /**
56
+ * Applied offset to position of target in cross axis relative to placement
57
+ */
58
+ export var PositionOffset;
59
+ (function (PositionOffset) {
60
+ /**
61
+ * No offset applied
62
+ */
63
+ PositionOffset[PositionOffset["None"] = 0] = "None";
64
+ /**
65
+ * Offset is calculated at the point where mouse enters source element
66
+ */
67
+ PositionOffset[PositionOffset["MouseEnter"] = 1] = "MouseEnter";
68
+ /**
69
+ * Positive offset equal to half of size of target
70
+ */
71
+ PositionOffset[PositionOffset["Half"] = 2] = "Half";
72
+ /**
73
+ * Negative offset equal to half of size of target
74
+ */
75
+ PositionOffset[PositionOffset["NegativeHalf"] = 3] = "NegativeHalf";
76
+ /**
77
+ * Positive offset equal to full size of target
78
+ */
79
+ PositionOffset[PositionOffset["Full"] = 4] = "Full";
80
+ /**
81
+ * Negative offset equal to full size of target
82
+ */
83
+ PositionOffset[PositionOffset["NegativeFull"] = 5] = "NegativeFull";
84
+ })(PositionOffset || (PositionOffset = {}));
85
+ //# sourceMappingURL=position.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.types.js","sourceRoot":"","sources":["../../../../src/services/position/position.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,iBA6DX;AA7DD,WAAY,iBAAiB;IAEzB;;OAEG;IACH,uDAAG,CAAA;IAEH;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,yDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAS,CAAA;IAET;;OAEG;IACH,+DAAO,CAAA;IAEP;;OAEG;IACH,2DAAK,CAAA;IAEL;;OAEG;IACH,qEAAU,CAAA;IAEV;;OAEG;IACH,iEAAQ,CAAA;IAER;;OAEG;IACH,6DAAM,CAAA;IAEN;;OAEG;IACH,wEAAW,CAAA;IAEX;;OAEG;IACH,oEAAS,CAAA;AACb,CAAC,EA7DW,iBAAiB,KAAjB,iBAAiB,QA6D5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IAEtB;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,+DAAU,CAAA;IAEV;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;IAEZ;;OAEG;IACH,mDAAI,CAAA;IAEJ;;OAEG;IACH,mEAAY,CAAA;AAChB,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB","sourcesContent":["/**\n * Available positions for placement of target element against its source\n */\nexport enum PositionPlacement\n{\n /**\n * Target is placed on the top (above) of source element in the middle of its width\n */\n Top,\n\n /**\n * Target is placed on the top (above) of source element at the start (left) of its width\n */\n TopStart,\n\n /**\n * Target is placed on the top (above) of source element at the end (right) of its width\n */\n TopEnd,\n\n /**\n * Target is placed on the left (before) of source element in the middle of its height\n */\n Left,\n\n /**\n * Target is placed on the left (before) of source element at the start (top) of its height\n */\n LeftStart,\n\n /**\n * Target is placed on the left (before) of source element at the end (bottom) of its height\n */\n LeftEnd,\n\n /**\n * Target is placed on the right (after) of source element in the middle of its height\n */\n Right,\n\n /**\n * Target is placed on the right (after) of source element at the start (top) of its height\n */\n RightStart,\n\n /**\n * Target is placed on the right (after) of source element at the end (bottom) of its height\n */\n RightEnd,\n\n /**\n * Target is placed on the bottom (below) of source element in the middle of its width\n */\n Bottom,\n\n /**\n * Target is placed on the bottom (below) of source element at the start (left) of its width\n */\n BottomStart,\n\n /**\n * Target is placed on the bottom (below) of source element at the end (right) of its width\n */\n BottomEnd\n}\n\n/**\n * Applied offset to position of target in cross axis relative to placement\n */\nexport enum PositionOffset\n{\n /**\n * No offset applied\n */\n None,\n\n /**\n * Offset is calculated at the point where mouse enters source element\n */\n MouseEnter,\n\n /**\n * Positive offset equal to half of size of target\n */\n Half,\n\n /**\n * Negative offset equal to half of size of target\n */\n NegativeHalf,\n\n /**\n * Positive offset equal to full size of target\n */\n Full,\n\n /**\n * Negative offset equal to full size of target\n */\n NegativeFull\n}"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Applies `PositionResult` to target element
3
+ * @param result - Result of positioning process to be applied
4
+ */
5
+ export function applyPositionResult(result) {
6
+ Object.assign(result.target.style, {
7
+ top: '0',
8
+ left: '0',
9
+ transform: `translate(${result.x}px, ${result.y}px)`,
10
+ });
11
+ }
12
+ //# sourceMappingURL=position.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.utils.js","sourceRoot":"","sources":["../../../../src/services/position/position.utils.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAmC;IAEnE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EACnB;QACI,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,aAAa,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK;KACvD,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import {PositionResult} from './position.interface';\n\n/**\n * Applies `PositionResult` to target element\n * @param result - Result of positioning process to be applied\n */\nexport function applyPositionResult(result: PositionResult<HTMLElement>): void\n{\n Object.assign(result.target.style,\n {\n top: '0',\n left: '0',\n transform: `translate(${result.x}px, ${result.y}px)`,\n });\n}\n"]}
@@ -32,9 +32,9 @@ export const PERMANENT_STORAGE = new InjectionToken('PERMANENT_STORAGE');
32
32
  */
33
33
  export const TEMPORARY_STORAGE = new InjectionToken('TEMPORARY_STORAGE', { providedIn: 'root', factory: () => new MemoryTemporaryStorageService() });
34
34
  /**
35
- * Token used for injecting service that is used for absolute alignment (AKA positioning) of one element to another
35
+ * Token used for injecting service that is used for positioning of one element against another
36
36
  */
37
- export const ALIGNMENT = new InjectionToken('ALIGNMENT');
37
+ export const POSITION = new InjectionToken('POSITION');
38
38
  /**
39
39
  * Token used for injecting notifications service implementation
40
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/types/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAqB,2BAA2B,EAAC,MAAM,gCAAgC,CAAC;AAE/F,OAAO,EAAS,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAmB,6BAA6B,EAAC,MAAM,8BAA8B,CAAC;AAI7F;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA2B,IAAI,cAAc,CAAS,uBAAuB,CAAC,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA2B,IAAI,cAAc,CAAS,4BAA4B,CAAC,CAAC;AAE3H;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA2B,IAAI,cAAc,CAAS,0BAA0B,CAAC,CAAC;AAEvH;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAA2B,IAAI,cAAc,CAAS,QAAQ,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,kBAAkB,EAAE,EAAC,CAAC,CAAC;AAElJ;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAuC,IAAI,cAAc,CAAqB,qBAAqB,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,2BAA2B,EAAE,EAAC,CAAC,CAAC;AAE7M;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC,IAAI,cAAc,CAAmB,mBAAmB,CAAC,CAAC;AAE7H;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC,IAAI,cAAc,CAAmB,mBAAmB,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,6BAA6B,EAAE,EAAC,CAAC,CAAC;AAEvM;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAA8B,IAAI,cAAc,CAAY,WAAW,CAAC,CAAC;AAE/F;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkC,IAAI,cAAc,CAAgB,eAAe,CAAC,CAAC;AAE/G;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2B,IAAI,cAAc,CAAS,qBAAqB,CAAC,CAAC;AAE7G;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsC,IAAI,gBAAgB,CAAkB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {InjectionToken, Type} from '@angular/core';\nimport {HttpContextToken} from '@angular/common/http';\n\nimport {StringLocalization, NoStringLocalizationService} from '../services/stringLocalization';\nimport {PermanentStorage} from '../services/permanentStorage';\nimport {Logger, DummyLoggerService} from '../services/logger';\nimport {TemporaryStorage, MemoryTemporaryStorageService} from '../services/temporaryStorage';\nimport {Notifications} from '../services/notifications';\nimport {Alignment} from '../services/alignment';\n\n/**\n * Base url when using HTTP (example: http://localhost:8888/)\n */\nexport const HTTP_REQUEST_BASE_URL: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_BASE_URL');\n\n/**\n * Token is used to transfer http request cookie header\n */\nexport const HTTP_REQUEST_COOKIE_HEADER: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_COOKIE_HEADER');\n\n/**\n * Token is used to transfer http request authentication header\n */\nexport const HTTP_REQUEST_AUTH_HEADER: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_AUTH_HEADER');\n\n/**\n * Token used for injecting Logger implementation\n */\nexport const LOGGER: InjectionToken<Logger> = new InjectionToken<Logger>('LOGGER', {providedIn: 'root', factory: () => new DummyLoggerService()});\n\n/**\n * Token used for injecting StringLocalization service implementation\n */\nexport const STRING_LOCALIZATION: InjectionToken<StringLocalization> = new InjectionToken<StringLocalization>('STRING_LOCALIZATION', {providedIn: 'root', factory: () => new NoStringLocalizationService()});\n\n/**\n * Token used for injecting permanent storage\n */\nexport const PERMANENT_STORAGE: InjectionToken<PermanentStorage> = new InjectionToken<PermanentStorage>('PERMANENT_STORAGE');\n\n/**\n * Token used for injecting temporary storage\n */\nexport const TEMPORARY_STORAGE: InjectionToken<TemporaryStorage> = new InjectionToken<TemporaryStorage>('TEMPORARY_STORAGE', {providedIn: 'root', factory: () => new MemoryTemporaryStorageService()});\n\n/**\n * Token used for injecting service that is used for absolute alignment (AKA positioning) of one element to another\n */\nexport const ALIGNMENT: InjectionToken<Alignment> = new InjectionToken<Alignment>('ALIGNMENT');\n\n/**\n * Token used for injecting notifications service implementation\n */\nexport const NOTIFICATIONS: InjectionToken<Notifications> = new InjectionToken<Notifications>('NOTIFICATIONS');\n\n/**\n * Token used for injecting notifications scope name\n */\nexport const NOTIFICATIONS_SCOPE: InjectionToken<string> = new InjectionToken<string>('NOTIFICATIONS_SCOPE');\n\n/**\n * Http context token storing array of ignored interceptors types\n */\nexport const IGNORED_INTERCEPTORS: HttpContextToken<Type<unknown>[]> = new HttpContextToken<Type<unknown>[]>(() => []);\n"]}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/types/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAqB,2BAA2B,EAAC,MAAM,gCAAgC,CAAC;AAE/F,OAAO,EAAS,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAmB,6BAA6B,EAAC,MAAM,8BAA8B,CAAC;AAI7F;;GAEG;AACH,MAAM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kB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {InjectionToken, Type} from '@angular/core';\nimport {HttpContextToken} from '@angular/common/http';\n\nimport {StringLocalization, NoStringLocalizationService} from '../services/stringLocalization';\nimport {PermanentStorage} from '../services/permanentStorage';\nimport {Logger, DummyLoggerService} from '../services/logger';\nimport {TemporaryStorage, MemoryTemporaryStorageService} from '../services/temporaryStorage';\nimport {Notifications} from '../services/notifications';\nimport {Position} from '../services/position';\n\n/**\n * Base url when using HTTP (example: http://localhost:8888/)\n */\nexport const HTTP_REQUEST_BASE_URL: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_BASE_URL');\n\n/**\n * Token is used to transfer http request cookie header\n */\nexport const HTTP_REQUEST_COOKIE_HEADER: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_COOKIE_HEADER');\n\n/**\n * Token is used to transfer http request authentication header\n */\nexport const HTTP_REQUEST_AUTH_HEADER: InjectionToken<string> = new InjectionToken<string>('HTTP_REQUEST_AUTH_HEADER');\n\n/**\n * Token used for injecting Logger implementation\n */\nexport const LOGGER: InjectionToken<Logger> = new InjectionToken<Logger>('LOGGER', {providedIn: 'root', factory: () => new DummyLoggerService()});\n\n/**\n * Token used for injecting StringLocalization service implementation\n */\nexport const STRING_LOCALIZATION: InjectionToken<StringLocalization> = new InjectionToken<StringLocalization>('STRING_LOCALIZATION', {providedIn: 'root', factory: () => new NoStringLocalizationService()});\n\n/**\n * Token used for injecting permanent storage\n */\nexport const PERMANENT_STORAGE: InjectionToken<PermanentStorage> = new InjectionToken<PermanentStorage>('PERMANENT_STORAGE');\n\n/**\n * Token used for injecting temporary storage\n */\nexport const TEMPORARY_STORAGE: InjectionToken<TemporaryStorage> = new InjectionToken<TemporaryStorage>('TEMPORARY_STORAGE', {providedIn: 'root', factory: () => new MemoryTemporaryStorageService()});\n\n/**\n * Token used for injecting service that is used for positioning of one element against another\n */\nexport const POSITION: InjectionToken<Position> = new InjectionToken<Position>('POSITION');\n\n/**\n * Token used for injecting notifications service implementation\n */\nexport const NOTIFICATIONS: InjectionToken<Notifications> = new InjectionToken<Notifications>('NOTIFICATIONS');\n\n/**\n * Token used for injecting notifications scope name\n */\nexport const NOTIFICATIONS_SCOPE: InjectionToken<string> = new InjectionToken<string>('NOTIFICATIONS_SCOPE');\n\n/**\n * Http context token storing array of ignored interceptors types\n */\nexport const IGNORED_INTERCEPTORS: HttpContextToken<Type<unknown>[]> = new HttpContextToken<Type<unknown>[]>(() => []);\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './services';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../floating-ui/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC","sourcesContent":["export * from './services';\n"]}