@anglr/common 22.2.0 → 23.0.0-beta.20250825083507
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.
- package/changelog.md +23 -0
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +3 -3
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +6 -21
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +3 -3
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +3 -3
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js +3 -3
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +3 -3
- package/es2022/forms/src/directives/hasError/hasError.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js +3 -3
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js +3 -3
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +3 -3
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +4 -5
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js +3 -3
- package/es2022/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js +3 -3
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js +4 -4
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js +4 -4
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/asFormGroup/asFormGroup.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.js +3 -3
- package/es2022/forms/src/modules/hasError.module.js +4 -4
- package/es2022/forms/src/modules/numberInput.module.js +4 -4
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +3 -3
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js +3 -3
- package/es2022/forms/src/services/submitted/submitted.service.js +3 -3
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +3 -3
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js +3 -3
- package/es2022/hotkeys/src/services/appHotkeys.service.js +3 -3
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js +3 -3
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js +3 -3
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js.map +1 -1
- package/es2022/material/src/components/titledDialog/titledDialog.component.js +3 -3
- package/es2022/material/src/components/titledDialog/titledDialog.component.js.map +1 -1
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js +3 -3
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js +3 -3
- package/es2022/material/src/modules/confirmationDialog.module.js +4 -4
- package/es2022/material/src/modules/debugDataCopyClick.module.js +4 -4
- package/es2022/material/src/modules/movableTitledDialog.module.js +4 -4
- package/es2022/material/src/modules/titledDialog.module.js +4 -4
- package/es2022/material/src/services/titledDialog/titledDialog.service.js +3 -3
- package/es2022/router/src/services/routing/dataRouter.js +3 -3
- package/es2022/router/src/services/routing/dataRouterData.js +3 -3
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js +3 -3
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js +3 -3
- package/es2022/src/directives/bodyRender/bodyRender.directive.js +3 -3
- package/es2022/src/directives/clickOutside/clickOutside.directive.js +3 -3
- package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js +3 -3
- package/es2022/src/directives/goBack/goBack.directive.js +3 -3
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js +3 -3
- package/es2022/src/directives/positionTo/positionTo.directive.js +3 -3
- package/es2022/src/modules/castPipes/modules/castPipes.module.js +4 -4
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js +3 -3
- package/es2022/src/modules/commonDynamic.module.js +4 -4
- package/es2022/src/modules/commonLocalize.module.js +4 -4
- package/es2022/src/modules/commonUtils.module.js +4 -4
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js +3 -3
- package/es2022/src/modules/debugData/modules/debugData.module.js +4 -4
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js +4 -4
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js.map +1 -1
- package/es2022/src/modules/file/components/file/file.component.js +15 -15
- package/es2022/src/modules/file/components/file/file.component.js.map +1 -1
- package/es2022/src/modules/file/components/fileInput/fileInput.component.js +9 -9
- package/es2022/src/modules/file/components/fileInput/fileInput.component.js.map +1 -1
- package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js +9 -9
- package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js.map +1 -1
- package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js +7 -7
- package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js.map +1 -1
- package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.directive.js +3 -3
- package/es2022/src/modules/file/modules/file.module.js +4 -4
- package/es2022/src/modules/logger/components/console/console.component.js +7 -4
- package/es2022/src/modules/logger/components/console/console.component.js.map +1 -1
- package/es2022/src/modules/logger/components/index.js +0 -1
- package/es2022/src/modules/logger/components/index.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js +3 -3
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js +3 -3
- package/es2022/src/modules/logger/services/logger/logger.service.js +3 -3
- package/es2022/src/modules/logger/services/rest/restSink.options.js +3 -3
- package/es2022/src/modules/logger/types/loggerOptions.js +3 -3
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js +3 -3
- package/es2022/src/modules/multiButton/modules/multiButton.module.js +4 -4
- package/es2022/src/modules/progressIndicator/components/index.js.map +1 -1
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js +3 -3
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js +3 -3
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js +3 -3
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js +4 -4
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js +3 -3
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js +7 -4
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js +14 -28
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +3 -3
- package/es2022/src/modules/tooltip/misc/tooltip.interface.js.map +1 -1
- package/es2022/src/modules/tooltip/modules/tooltip.module.js +4 -4
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js +3 -3
- package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js +3 -3
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js +3 -3
- package/es2022/src/pipes/isNaN/isNaN.pipe.js +3 -3
- package/es2022/src/pipes/isPresent/isPresent.pipe.js +3 -3
- package/es2022/src/pipes/keys/keys.pipe.js +3 -3
- package/es2022/src/pipes/localize/localize.pipe.js +3 -3
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js +3 -3
- package/es2022/src/pipes/numeral/numeral.pipe.js +3 -3
- package/es2022/src/pipes/trimText/trimText.pipe.js +3 -3
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js +3 -3
- package/es2022/src/services/cookies/cookies.service.js +3 -3
- package/es2022/src/services/notifications/defaultNotifications.service.js +3 -3
- package/es2022/src/services/notifications/defaultNotifications.service.js.map +1 -1
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +3 -3
- package/es2022/src/services/statusCode/statusCode.service.js +3 -3
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +3 -3
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js +3 -3
- package/es2022/src/utils/index.js.map +1 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +3 -3
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +3 -3
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts +0 -4
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -1
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.html +1 -1
- package/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html +1 -1
- package/package.json +28 -32
- package/router/src/decorators/moduleRoutes.decorator.d.ts.map +1 -1
- package/src/directives/clickOutside/clickOutside.directive.d.ts.map +1 -1
- package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts.map +1 -1
- package/src/modules/logger/components/console/console.component.d.ts.map +1 -1
- package/src/modules/logger/components/index.d.ts +0 -1
- package/src/modules/logger/components/index.d.ts.map +1 -1
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +8 -0
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +1 -1
- package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +2 -12
- package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +1 -1
- package/src/modules/tooltip/misc/tooltip.interface.d.ts +12 -5
- package/src/modules/tooltip/misc/tooltip.interface.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2022/src/modules/logger/components/console/console.component.animations.js +0 -31
- package/es2022/src/modules/logger/components/console/console.component.animations.js.map +0 -1
- package/src/modules/logger/components/console/console.component.animations.d.ts +0 -5
- package/src/modules/logger/components/console/console.component.animations.d.ts.map +0 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ContentChild, Directive, ElementRef, HostListener, Inject, Injector, Input, Optional, SkipSelf, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { AnimationBuilder } from '@angular/animations';
|
|
3
2
|
import { DOCUMENT } from '@angular/common';
|
|
4
|
-
import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
|
|
5
3
|
import { isBlank, isPresent, nameof, renderToBody } from '@jscrpt/common';
|
|
6
4
|
import { extend } from '@jscrpt/common/extend';
|
|
7
5
|
import { lastValueFrom } from 'rxjs';
|
|
@@ -10,8 +8,8 @@ import { TOOLTIP_OPTIONS } from '../../misc/tokens';
|
|
|
10
8
|
import { applyPositionResult, PositionPlacement } from '../../../../services/position';
|
|
11
9
|
import { TooltipTemplateDirective } from '../tooltipTemplate/tooltipTemplate.directive';
|
|
12
10
|
import { POSITION } from '../../../../types/tokens';
|
|
11
|
+
import { getHostElement } from '../../../../utils';
|
|
13
12
|
import * as i0 from "@angular/core";
|
|
14
|
-
import * as i1 from "@angular/animations";
|
|
15
13
|
/**
|
|
16
14
|
* Default options for tooltip
|
|
17
15
|
*/
|
|
@@ -25,8 +23,8 @@ const defaultOptions = {
|
|
|
25
23
|
tooltipRenderer: TooltipComponent,
|
|
26
24
|
tooltipCssClass: null,
|
|
27
25
|
stopPropagation: true,
|
|
28
|
-
enterAnimation:
|
|
29
|
-
exitAnimation:
|
|
26
|
+
enterAnimation: 'fade-in',
|
|
27
|
+
exitAnimation: 'fade-out',
|
|
30
28
|
containerElement: undefined,
|
|
31
29
|
};
|
|
32
30
|
/**
|
|
@@ -41,18 +39,15 @@ export class TooltipDirective {
|
|
|
41
39
|
}
|
|
42
40
|
set tooltipOptions(value) {
|
|
43
41
|
this._options = extend(true, {}, this._options, value);
|
|
44
|
-
this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);
|
|
45
|
-
this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);
|
|
46
42
|
if (this._options.containerElement && !this.containerElement) {
|
|
47
43
|
this.containerElement = this._options.containerElement;
|
|
48
44
|
}
|
|
49
45
|
}
|
|
50
46
|
//######################### constructor #########################
|
|
51
|
-
constructor(_viewContainerRef, _injector, _element,
|
|
47
|
+
constructor(_viewContainerRef, _injector, _element, _document, _position, _parent, options) {
|
|
52
48
|
this._viewContainerRef = _viewContainerRef;
|
|
53
49
|
this._injector = _injector;
|
|
54
50
|
this._element = _element;
|
|
55
|
-
this._animationsPlayer = _animationsPlayer;
|
|
56
51
|
this._document = _document;
|
|
57
52
|
this._position = _position;
|
|
58
53
|
this._parent = _parent;
|
|
@@ -73,8 +68,6 @@ export class TooltipDirective {
|
|
|
73
68
|
*/
|
|
74
69
|
this.allowHtml = false;
|
|
75
70
|
this._options = extend(true, {}, defaultOptions, options);
|
|
76
|
-
this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);
|
|
77
|
-
this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);
|
|
78
71
|
if (this._options.containerElement) {
|
|
79
72
|
this.containerElement = this._options.containerElement;
|
|
80
73
|
}
|
|
@@ -167,7 +160,7 @@ export class TooltipDirective {
|
|
|
167
160
|
offset: this._options.position.offset,
|
|
168
161
|
flip: true,
|
|
169
162
|
mouseEvent: event,
|
|
170
|
-
autoUpdate: false
|
|
163
|
+
autoUpdate: false,
|
|
171
164
|
}))
|
|
172
165
|
.then(result => applyPositionResult(result));
|
|
173
166
|
}
|
|
@@ -182,16 +175,9 @@ export class TooltipDirective {
|
|
|
182
175
|
*/
|
|
183
176
|
_destroyTooltip() {
|
|
184
177
|
if (this._tooltipComponent) {
|
|
185
|
-
|
|
186
|
-
const element = this._tooltipElement;
|
|
187
|
-
const exitAnimation = this._exitAnimation.create(element);
|
|
188
|
-
exitAnimation.onDone(() => {
|
|
189
|
-
component.destroy();
|
|
190
|
-
exitAnimation.destroy();
|
|
191
|
-
});
|
|
178
|
+
this._viewContainerRef.clear();
|
|
192
179
|
this._tooltipComponent = undefined;
|
|
193
180
|
this._tooltipElement = undefined;
|
|
194
|
-
exitAnimation.play();
|
|
195
181
|
}
|
|
196
182
|
}
|
|
197
183
|
/**
|
|
@@ -203,20 +189,20 @@ export class TooltipDirective {
|
|
|
203
189
|
// 1. Create a component reference from the component
|
|
204
190
|
this._tooltipComponent = this._viewContainerRef
|
|
205
191
|
.createComponent(this._options.tooltipRenderer, {
|
|
206
|
-
injector: this._injector
|
|
192
|
+
injector: this._injector,
|
|
207
193
|
});
|
|
208
194
|
// 3. Get DOM element from component
|
|
209
|
-
this._tooltipElement = this._tooltipComponent
|
|
210
|
-
.rootNodes[0];
|
|
195
|
+
this._tooltipElement = getHostElement(this._tooltipComponent);
|
|
211
196
|
// 4. Append DOM element to the body
|
|
212
197
|
renderToBody(this._document, this._tooltipElement, this.containerElement);
|
|
213
|
-
this._enterAnimation.create(this._tooltipElement).play();
|
|
214
198
|
}
|
|
215
199
|
/**
|
|
216
200
|
* Sets data to tooltip component and shows them
|
|
217
201
|
*/
|
|
218
202
|
_showData() {
|
|
219
203
|
if (this._tooltipComponent) {
|
|
204
|
+
this._tooltipComponent.instance.enterAnimation = this._options.enterAnimation;
|
|
205
|
+
this._tooltipComponent.instance.exitAnimation = this._options.exitAnimation;
|
|
220
206
|
this._tooltipComponent.instance.allowHtml = this.allowHtml;
|
|
221
207
|
this._tooltipComponent.instance.data = this.tooltip;
|
|
222
208
|
this._tooltipComponent.instance.template = this.template ?? this.tooltipTemplateChild?.template;
|
|
@@ -238,15 +224,15 @@ export class TooltipDirective {
|
|
|
238
224
|
this._tooltipComponent.instance.invalidateVisuals();
|
|
239
225
|
}
|
|
240
226
|
}
|
|
241
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
242
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
227
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: DOCUMENT }, { token: POSITION }, { token: TooltipDirective, optional: true, skipSelf: true }, { token: TOOLTIP_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
228
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: TooltipDirective, isStandalone: true, selector: "[tooltip]", inputs: { tooltip: "tooltip", allowHtml: "allowHtml", template: "template", tooltipOptions: "tooltipOptions", tooltipVisible: "tooltipVisible", containerElement: "containerElement" }, host: { listeners: { "mouseleave": "mouseLeave($event)", "mousemove": "mouseMove($event)" } }, queries: [{ propertyName: "tooltipTemplateChild", first: true, predicate: TooltipTemplateDirective, descendants: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
243
229
|
}
|
|
244
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
245
231
|
type: Directive,
|
|
246
232
|
args: [{
|
|
247
233
|
selector: '[tooltip]',
|
|
248
234
|
}]
|
|
249
|
-
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type:
|
|
235
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: Document, decorators: [{
|
|
250
236
|
type: Inject,
|
|
251
237
|
args: [DOCUMENT]
|
|
252
238
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAChO,OAAO,EAAC,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAmB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAE5E,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAY,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAC,wBAAwB,EAAC,MAAM,8CAA8C,CAAC;AAEtF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0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A0B5B,SAAS;sBADlB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, SkipSelf, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {AnimationBuilder, AnimationFactory} from '@angular/animations';\nimport {DOCUMENT} from '@angular/common';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\nimport {RecursivePartial, isBlank, isPresent, nameof, renderToBody} from '@jscrpt/common';\nimport {extend} from '@jscrpt/common/extend';\nimport {lastValueFrom} from 'rxjs';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {TooltipTemplateContext} from '../tooltipTemplate/tooltipTemplate.context';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: 'MouseEnter',\n placement: PositionPlacement.TopEnd,\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: true,\n enterAnimation: fadeInAnimation,\n exitAnimation: fadeOutAnimation,\n containerElement: undefined,\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]',\n})\nexport class TooltipDirective<TData = unknown> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Animation factory used for enter animation of tooltip\n */\n protected _enterAnimation: AnimationFactory;\n\n /**\n * Animation factory used for exit animation of tooltip\n */\n protected _exitAnimation: AnimationFactory;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public template?: TemplateRef<TooltipTemplateContext<TData>>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): RecursivePartial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: RecursivePartial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement && !this.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n /**\n * String that defines element in which should be tooltip rendered, if not specified, body is used\n * \n * Allows also css classes to be specified (div.body-box)\n */\n @Input()\n public containerElement: string|undefined|null;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n protected _animationsPlayer: AnimationBuilder,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position<HTMLElement>,\n @Optional() @SkipSelf() protected _parent?: TooltipDirective|null,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>,)\n {\n this._options = extend(true, {}, defaultOptions, options);\n\n this._enterAnimation = this._animationsPlayer.build(this._options.enterAnimation);\n this._exitAnimation = this._animationsPlayer.build(this._options.exitAnimation);\n\n if(this._options.containerElement)\n {\n this.containerElement = this._options.containerElement;\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<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\n\n this._destroyTooltip();\n }\n\n //######################### protected methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n */\n @HostListener('mouseleave', ['$event'])\n protected mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n */\n @HostListener('mousemove', ['$event'])\n protected mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n //no data for tooltip or no template\n if(!this.tooltip && !this.template && !this.tooltipTemplateChild)\n {\n return;\n }\n\n this._parent?._hideTooltip();\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n lastValueFrom(this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false\n }))\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n const component = this._tooltipComponent;\n const element = this._tooltipElement;\n\n const exitAnimation = this._exitAnimation.create(element);\n\n exitAnimation.onDone(() =>\n {\n component.destroy();\n exitAnimation.destroy();\n });\n \n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n\n exitAnimation.play();\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n renderToBody(this._document, this._tooltipElement, this.containerElement);\n this._enterAnimation.create(this._tooltipElement).play();\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.template ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}"]}
|
|
1
|
+
{"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/M,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAmB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAE5E,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAY,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAC,wBAAwB,EAAC,MAAM,8CAA8C,CAAC;AAEtF,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;;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;2FA3F7B,gBAAgB;kBAJ5B,SAAS;mBACV;oBACI,QAAQ,EAAE,WAAW;iBACxB;;0BAmGgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,QAAQ;;0BAAI,QAAQ;;0BACpB,QAAQ;;0BAAI,MAAM;2BAAC,eAAe;yCA7DxC,OAAO;sBADb,KAAK;gBAOC,SAAS;sBADf,KAAK;gBAOC,QAAQ;sBADd,KAAK;gBAOK,cAAc;sBADxB,KAAK;gBAmBC,cAAc;sBADpB,KAAK;gBASC,gBAAgB;sBADtB,KAAK;gBASC,oBAAoB;sBAD1B,YAAY;uBAAC,wBAAwB;gBA8D5B,UAAU;sBADnB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA0B5B,SAAS;sBADlB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ComponentRef, ContentChild, Directive, ElementRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, SkipSelf, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {RecursivePartial, isBlank, isPresent, nameof, renderToBody} from '@jscrpt/common';\nimport {extend} from '@jscrpt/common/extend';\nimport {lastValueFrom} from 'rxjs';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {applyPositionResult, Position, PositionPlacement} from '../../../../services/position';\nimport {TooltipTemplateDirective} from '../tooltipTemplate/tooltipTemplate.directive';\nimport {TooltipTemplateContext} from '../tooltipTemplate/tooltipTemplate.context';\nimport {POSITION} from '../../../../types/tokens';\nimport {getHostElement} from '../../../../utils';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n position:\n {\n offset: 'MouseEnter',\n placement: PositionPlacement.TopEnd,\n },\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: true,\n enterAnimation: 'fade-in',\n exitAnimation: 'fade-out',\n containerElement: undefined,\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]',\n})\nexport class TooltipDirective<TData = unknown> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer<TData>>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public template?: TemplateRef<TooltipTemplateContext<TData>>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): RecursivePartial<TooltipOptions>\n {\n return this._options;\n }\n public set tooltipOptions(value: RecursivePartial<TooltipOptions>)\n {\n this._options = extend(true, {}, this._options, value);\n\n if(this._options.containerElement && !this.containerElement)\n {\n this.containerElement = this._options.containerElement;\n }\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n /**\n * String that defines element in which should be tooltip rendered, if not specified, body is used\n *\n * Allows also css classes to be specified (div.body-box)\n */\n @Input()\n public containerElement: string|undefined|null;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild(TooltipTemplateDirective)\n public tooltipTemplateChild?: TooltipTemplateDirective;\n\n //######################### constructor #########################\n constructor(protected _viewContainerRef: ViewContainerRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) protected _document: Document,\n @Inject(POSITION) protected _position: Position<HTMLElement>,\n @Optional() @SkipSelf() protected _parent?: TooltipDirective|null,\n @Optional() @Inject(TOOLTIP_OPTIONS) options?: Partial<TooltipOptions>,)\n {\n this._options = extend(true, {}, defaultOptions, options);\n\n if(this._options.containerElement)\n {\n this.containerElement = this._options.containerElement;\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<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._timeout)\n {\n clearTimeout(this._timeout);\n }\n\n this._destroyTooltip();\n }\n\n //######################### protected methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n */\n @HostListener('mouseleave', ['$event'])\n protected mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n */\n @HostListener('mousemove', ['$event'])\n protected mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param event - Mouse event\n */\n protected _showTooltip(event?: MouseEvent): void\n {\n //no data for tooltip or no template\n if(!this.tooltip && !this.template && !this.tooltipTemplateChild)\n {\n return;\n }\n\n this._parent?._hideTooltip();\n this._createTooltip();\n\n //if element was not created do nothing\n if(!this._tooltipElement)\n {\n return;\n }\n\n this._showData();\n\n lastValueFrom(this._position.placeElement(this._tooltipElement,\n this._element.nativeElement,\n {\n placement: this._options.position.placement,\n offset: this._options.position.offset,\n flip: true,\n mouseEvent: event,\n autoUpdate: false,\n }))\n .then(result => applyPositionResult(result));\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n this._viewContainerRef.clear();\n this._tooltipComponent = undefined;\n this._tooltipElement = undefined;\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroys tooltip if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._viewContainerRef\n .createComponent(this._options.tooltipRenderer,\n {\n injector: this._injector,\n });\n\n // 3. Get DOM element from component\n this._tooltipElement = getHostElement(this._tooltipComponent);\n\n // 4. Append DOM element to the body\n renderToBody(this._document, this._tooltipElement, this.containerElement);\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.enterAnimation = this._options.enterAnimation;\n this._tooltipComponent.instance.exitAnimation = this._options.exitAnimation;\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.template ?? this.tooltipTemplateChild?.template;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n\n //######################### ng language server #########################\n\n /**\n * Custom input type for `tooltip` input\n */\n public static ngAcceptInputType_tooltip: any;\n}\n"]}
|
|
@@ -15,10 +15,10 @@ export class TooltipTemplateDirective {
|
|
|
15
15
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
16
16
|
return true;
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
19
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
19
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: TooltipTemplateDirective, isStandalone: true, selector: "[tooltipTemplate]", ngImport: i0 }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipTemplateDirective, decorators: [{
|
|
22
22
|
type: Directive,
|
|
23
23
|
args: [{
|
|
24
24
|
selector: '[tooltipTemplate]'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.interface.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/misc/tooltip.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {TemplateRef, Type} from '@angular/core';\
|
|
1
|
+
{"version":3,"file":"tooltip.interface.js","sourceRoot":"","sources":["../../../../../src/modules/tooltip/misc/tooltip.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {TemplateRef, Type} from '@angular/core';\n\nimport {PositionOptions} from '../../../services/position';\nimport {TooltipTemplateContext} from '../directives';\n\n/**\n * Represents component that is used for rendering tooltip\n */\nexport interface TooltipRenderer<TData = any>\n{\n //######################### properties #########################\n\n /**\n * Data that are rendered in tooltip\n */\n data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n template: TemplateRef<TooltipTemplateContext<TData>>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n allowHtml: boolean;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n cssClass: string|null|undefined;\n\n /**\n * Css class used to animate tooltip component when it is displayed\n */\n enterAnimation: string;\n\n /**\n * Css class used to animate tooltip component when it is hidden\n */\n exitAnimation: string;\n\n //######################### methods #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n registerHoverEvents(enter: () => void, leave: () => void): void;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}\n\n/**\n * Options used for tooltip directive\n */\nexport interface TooltipOptions\n{\n /**\n * Delay for displaying of tooltip on hover\n */\n delay: number;\n\n /**\n * Position where should tooltip appear relative to its parent\n */\n position: Pick<PositionOptions, 'placement'|'offset'>;\n\n /**\n * Allows selection of text in tooltip\n */\n allowSelection: boolean|null;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n tooltipCssClass: string|null;\n\n /**\n * Indication whether stop propagation of \"hover\" event\n */\n stopPropagation: boolean|null;\n\n /**\n * Type of tooltip renderer that is used for rendering tooltip\n */\n tooltipRenderer: Type<TooltipRenderer>;\n\n /**\n * Css class used to animate tooltip component when it is displayed\n */\n enterAnimation: string;\n\n /**\n * Css class used to animate tooltip component when it is hidden\n */\n exitAnimation: string;\n\n /**\n * String that defines element in which should be tooltip rendered, if not specified, body is used\n *\n * Allows also css classes to be specified (div.body-box)\n */\n containerElement: string|undefined|null;\n}"]}
|
|
@@ -6,14 +6,14 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
* Module for rendering tooltips
|
|
7
7
|
*/
|
|
8
8
|
export class TooltipModule {
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
10
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
9
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: TooltipModule, imports: [TooltipDirective,
|
|
11
11
|
TooltipTemplateDirective,
|
|
12
12
|
TooltipComponent], exports: [TooltipDirective,
|
|
13
13
|
TooltipTemplateDirective] }); }
|
|
14
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
14
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipModule }); }
|
|
15
15
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TooltipModule, decorators: [{
|
|
17
17
|
type: NgModule,
|
|
18
18
|
args: [{
|
|
19
19
|
imports: [
|
|
@@ -26,10 +26,10 @@ export class DisplayPropertiesPipe {
|
|
|
26
26
|
return result;
|
|
27
27
|
}).join(itemSeparator);
|
|
28
28
|
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
30
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DisplayPropertiesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
30
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: DisplayPropertiesPipe, isStandalone: true, name: "displayProperties" }); }
|
|
31
31
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DisplayPropertiesPipe, decorators: [{
|
|
33
33
|
type: Pipe,
|
|
34
34
|
args: [{
|
|
35
35
|
name: 'displayProperties',
|
|
@@ -14,10 +14,10 @@ export class FirstUppercasePipe {
|
|
|
14
14
|
}
|
|
15
15
|
return value[0].toUpperCase() + value.substring(1);
|
|
16
16
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
18
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercasePipe, isStandalone: true, name: "firstUppercase" }); }
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercasePipe, decorators: [{
|
|
21
21
|
type: Pipe,
|
|
22
22
|
args: [{
|
|
23
23
|
name: 'firstUppercase',
|
|
@@ -37,10 +37,10 @@ export class FirstUppercaseLocalizePipe {
|
|
|
37
37
|
ngOnDestroy() {
|
|
38
38
|
this.localizePipe.ngOnDestroy();
|
|
39
39
|
}
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
41
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercaseLocalizePipe, deps: [{ token: STRING_LOCALIZATION }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
41
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercaseLocalizePipe, isStandalone: true, name: "firstUppercaseLocalize", pure: false }); }
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FirstUppercaseLocalizePipe, decorators: [{
|
|
44
44
|
type: Pipe,
|
|
45
45
|
args: [{
|
|
46
46
|
name: 'firstUppercaseLocalize',
|
|
@@ -12,10 +12,10 @@ export class IsNaNPipe {
|
|
|
12
12
|
transform(value) {
|
|
13
13
|
return isNaN(value);
|
|
14
14
|
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
16
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: IsNaNPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
16
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: IsNaNPipe, isStandalone: true, name: "isNaN" }); }
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: IsNaNPipe, decorators: [{
|
|
19
19
|
type: Pipe,
|
|
20
20
|
args: [{
|
|
21
21
|
name: 'isNaN',
|
|
@@ -13,10 +13,10 @@ export class IsPresentPipe {
|
|
|
13
13
|
transform(value) {
|
|
14
14
|
return isPresent(value);
|
|
15
15
|
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: IsPresentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: IsPresentPipe, isStandalone: true, name: "isPresent" }); }
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: IsPresentPipe, decorators: [{
|
|
20
20
|
type: Pipe,
|
|
21
21
|
args: [{
|
|
22
22
|
name: 'isPresent',
|
|
@@ -15,10 +15,10 @@ export class KeysPipe {
|
|
|
15
15
|
}
|
|
16
16
|
return Object.keys(value);
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
19
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
19
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: KeysPipe, isStandalone: true, name: "keys" }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: KeysPipe, decorators: [{
|
|
22
22
|
type: Pipe,
|
|
23
23
|
args: [{ name: 'keys' }]
|
|
24
24
|
}] });
|
|
@@ -40,10 +40,10 @@ export class LocalizePipe {
|
|
|
40
40
|
this._subscription?.unsubscribe();
|
|
41
41
|
this._subscription = null;
|
|
42
42
|
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
44
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LocalizePipe, deps: [{ token: STRING_LOCALIZATION }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
44
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: LocalizePipe, isStandalone: true, name: "localize", pure: false }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LocalizePipe, decorators: [{
|
|
47
47
|
type: Pipe,
|
|
48
48
|
args: [{
|
|
49
49
|
name: 'localize',
|
|
@@ -36,10 +36,10 @@ export class MergeCssClassesPipe {
|
|
|
36
36
|
});
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
40
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MergeCssClassesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
40
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: MergeCssClassesPipe, isStandalone: true, name: "mergeCssClasses" }); }
|
|
41
41
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MergeCssClassesPipe, decorators: [{
|
|
43
43
|
type: Pipe,
|
|
44
44
|
args: [{ name: 'mergeCssClasses' }]
|
|
45
45
|
}] });
|
|
@@ -38,10 +38,10 @@ export class NumeralPipe {
|
|
|
38
38
|
this._globalizationChangeSubscription?.unsubscribe();
|
|
39
39
|
this._globalizationChangeSubscription = null;
|
|
40
40
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
42
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NumeralPipe, deps: [{ token: i1.GlobalizationService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
42
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: NumeralPipe, isStandalone: true, name: "numeral" }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NumeralPipe, decorators: [{
|
|
45
45
|
type: Pipe,
|
|
46
46
|
args: [{ name: 'numeral' }]
|
|
47
47
|
}], ctorParameters: () => [{ type: i1.GlobalizationService }] });
|
|
@@ -19,10 +19,10 @@ export class TrimTextPipe {
|
|
|
19
19
|
}
|
|
20
20
|
return text;
|
|
21
21
|
}
|
|
22
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TrimTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
23
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: TrimTextPipe, isStandalone: true, name: "trimText" }); }
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TrimTextPipe, decorators: [{
|
|
26
26
|
type: Pipe,
|
|
27
27
|
args: [{ name: 'trimText' }]
|
|
28
28
|
}] });
|
|
@@ -16,10 +16,10 @@ export class UrlEncodePipe {
|
|
|
16
16
|
}
|
|
17
17
|
return serializeToUrlQuery(value);
|
|
18
18
|
}
|
|
19
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: UrlEncodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: UrlEncodePipe, isStandalone: true, name: "urlEncode" }); }
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: UrlEncodePipe, decorators: [{
|
|
23
23
|
type: Pipe,
|
|
24
24
|
args: [{ name: 'urlEncode' }]
|
|
25
25
|
}] });
|
|
@@ -88,10 +88,10 @@ export class CookieService {
|
|
|
88
88
|
this.setCookie(name, '', -1, path, domain);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
92
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookieService, deps: [{ token: PLATFORM_ID }, { token: HTTP_REQUEST_COOKIE_HEADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
92
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookieService, providedIn: 'root' }); }
|
|
93
93
|
}
|
|
94
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookieService, decorators: [{
|
|
95
95
|
type: Injectable,
|
|
96
96
|
args: [{ providedIn: 'root' }]
|
|
97
97
|
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
@@ -177,10 +177,10 @@ export class DefaultNotificationsService {
|
|
|
177
177
|
}
|
|
178
178
|
return this;
|
|
179
179
|
}
|
|
180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
181
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
180
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DefaultNotificationsService, deps: [{ token: i1.NotificationsOptions, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
181
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DefaultNotificationsService }); }
|
|
182
182
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DefaultNotificationsService, decorators: [{
|
|
184
184
|
type: Injectable
|
|
185
185
|
}], ctorParameters: () => [{ type: i1.NotificationsOptions, decorators: [{
|
|
186
186
|
type: Optional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultNotifications.service.js","sourceRoot":"","sources":["../../../../src/services/notifications/defaultNotifications.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,QAAQ,EAAE,QAAQ,EAAO,MAAM,eAAe,CAAC;AACnF,OAAO,EAAa,UAAU,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAa,OAAO,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAC,aAAa,EAAE,mBAAmB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;SACtB;QACD;YACI,OAAO,EAAE,KAAK,IAAI,aAAa;YAC/B,UAAU,EAAE,CAAC,aAA4B,EAAE,EAAE;gBAEzC,OAAO,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;SAC1C;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,cAAc,CAAC,qBAAqB,EAAE,OAAO,EACpD;IACI,GAAG;QAEC,MAAM,IAAI,GAAsC,CAAC,SAAiB,EAAE,KAAsD,EAAE,EAAE;YAE1H,OAAO,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EACpC;YACI,GAAG;gBAEC,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC,CAAC;AAEH,OAAO,EAAC,qBAAqB,EAAC,CAAC","sourcesContent":["import {Injectable, InjectionToken, Optional, SkipSelf, Type} from '@angular/core';\nimport {Dictionary, generateId} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {NOTIFICATIONS, NOTIFICATIONS_SCOPE} from '../../types/tokens';\nimport {Notifications, Notification, NotificationSeverity, NotificationsProvider, NotificationsScopeProviderFactory, NotificationsScopeProvider} from './notifications.interface';\nimport {NotificationsOptions} from './notificationsOptions';\n\n/**\n * Default notifications service implementation\n */\n@Injectable()\nexport class DefaultNotificationsService implements Notifications\n{\n //######################### protected fields #########################\n\n /**\n * Array of notifications\n */\n protected _notifications: Notification[] = [];\n\n /**\n * Array of notifications timeouts\n */\n protected _notificationsTimeouts: number[] = [];\n\n /**\n * Subject used for emitting changes of current notifications\n */\n protected _notificationsChange: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting event when instance is being destroyed\n */\n protected _destroy: Subject<void> = new Subject<void>();\n\n /**\n * Array of scoped notifications\n */\n protected _scopes: Dictionary<[Notifications, Subscription]> = {};\n\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public get notifications(): readonly Notification[]\n {\n return [...this._notifications];\n }\n\n /**\n * @inheritdoc\n */\n public get notificationsChange(): Observable<void>\n {\n return this._notificationsChange.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get destroy(): Observable<void>\n {\n return this._destroy.asObservable();\n }\n\n //######################### constructor #########################\n constructor(@Optional() protected _options: NotificationsOptions)\n {\n if(!this._options || !(this._options instanceof NotificationsOptions))\n {\n this._options = new NotificationsOptions();\n }\n }\n\n //######################### public methods - implementation of Notifications #########################\n \n /**\n * @inheritdoc\n */\n public message(message: string, severity: NotificationSeverity, parameter?: Record<string, unknown>): Notifications\n {\n const notification = new Notification(message, severity, parameter);\n \n this._notifications.push(notification);\n this._notificationsChange.next();\n\n // set timeout\n if(this._options.timeout > 0)\n {\n this._notificationsTimeouts.push(setTimeout(() =>\n {\n this.remove(notification);\n }, this._options.timeout) as any);\n }\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public default(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Default, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public success(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Success, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public error(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Error, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public info(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Info, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public warning(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Warning, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public clearNotifications(): Notifications\n {\n while(this._notifications[0])\n {\n this._remove(this._notifications[0], false);\n }\n\n this._notificationsChange.next();\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public remove(notification: Notification): Notifications\n {\n return this._remove(notification);\n }\n\n /**\n * @inheritdoc\n */\n public getScope(scopeName: string): Notifications\n {\n const scopeObj = this._scopes[scopeName];\n let scope: Notifications;\n\n // no scope yet\n if(!scopeObj)\n {\n scope = new DefaultNotificationsService(this._options);\n const subscription = new Subscription();\n\n this._scopes[scopeName] = [scope, subscription];\n\n //destroys and removes scope\n subscription.add(scope.destroy.subscribe(() =>\n {\n delete this._scopes[scopeName];\n subscription.unsubscribe();\n }));\n }\n else\n {\n scope = scopeObj[0];\n }\n\n return scope;\n }\n\n /**\n * @inheritdoc\n * \n * Call this manualy for scoped instances until this is fixed https://github.com/angular/angular/issues/28738\n */\n public ngOnDestroy(): void\n {\n this._destroy.next();\n this._destroy.complete();\n this._notificationsChange.complete();\n\n Object.keys(this._scopes).forEach(scopeName =>\n {\n const [scope] = this._scopes[scopeName];\n\n scope.ngOnDestroy();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Removes notification from array of notifications\n * @param notification - Notification to be removed\n * @param emitEvent - Indication whether emit event on removal\n */\n protected _remove(notification: Notification, emitEvent: boolean = true): Notifications\n {\n const index = this._notifications.indexOf(notification);\n\n if(index < 0)\n {\n return this;\n }\n\n this._notifications.splice(index, 1);\n\n if(emitEvent)\n {\n this._notificationsChange.next();\n }\n\n // clear timeout\n if(this._options.timeout > 0)\n {\n clearTimeout(this._notificationsTimeouts[index]);\n this._notificationsTimeouts.splice(index, 1);\n }\n\n return this;\n }\n}\n\n/**\n * Default notifications provider\n */\nconst DEFAULT_NOTIFICATIONS: NotificationsProvider =\n{\n provide: NOTIFICATIONS,\n useClass: DefaultNotificationsService\n};\n\n//TODO: add options to notifications factory\n\n/**\n * Factory that creates notifications provider for scope\n */\nconst notificationsFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n{\n return <NotificationsScopeProvider> [\n {\n provide: NOTIFICATIONS_SCOPE,\n useValue: scopeName\n },\n {\n provide: token ?? NOTIFICATIONS,\n useFactory: (notifications: Notifications) =>\n {\n return notifications.getScope(scopeName);\n },\n deps: [[new SkipSelf(), NOTIFICATIONS]]\n }\n ];\n};\n\nObject.defineProperty(DEFAULT_NOTIFICATIONS, 'scope', \n{\n get()\n {\n const func: NotificationsScopeProviderFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n {\n return notificationsFactory(scopeName, token);\n };\n\n Object.defineProperty(func, 'random', \n {\n get()\n {\n return notificationsFactory(generateId(6));\n }\n });\n\n return func;\n }\n});\n\nexport {DEFAULT_NOTIFICATIONS};"]}
|
|
1
|
+
{"version":3,"file":"defaultNotifications.service.js","sourceRoot":"","sources":["../../../../src/services/notifications/defaultNotifications.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,QAAQ,EAAE,QAAQ,EAAO,MAAM,eAAe,CAAC;AACnF,OAAO,EAAa,UAAU,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAa,OAAO,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAgB,YAAY,EAAE,oBAAoB,EAAuF,MAAM,2BAA2B,CAAC;AAClL,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;;;AAE5D;;GAEG;AAEH,MAAM,OAAO,2BAA2B;IA6BpC,uEAAuE;IAEvE;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAE1B,OAAO,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,I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AC,SAAS,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EACpC;YACI,GAAG;gBAEC,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC,CAAC;AAEH,OAAO,EAAC,qBAAqB,EAAC,CAAC","sourcesContent":["import {Injectable, InjectionToken, Optional, SkipSelf, Type} from '@angular/core';\nimport {Dictionary, generateId} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {NOTIFICATIONS, NOTIFICATIONS_SCOPE} from '../../types/tokens';\nimport {Notifications, Notification, NotificationSeverity, NotificationsProvider, NotificationsScopeProviderFactory, NotificationsScopeProvider} from './notifications.interface';\nimport {NotificationsOptions} from './notificationsOptions';\n\n/**\n * Default notifications service implementation\n */\n@Injectable()\nexport class DefaultNotificationsService implements Notifications\n{\n //######################### protected fields #########################\n\n /**\n * Array of notifications\n */\n protected _notifications: Notification[] = [];\n\n /**\n * Array of notifications timeouts\n */\n protected _notificationsTimeouts: number[] = [];\n\n /**\n * Subject used for emitting changes of current notifications\n */\n protected _notificationsChange: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting event when instance is being destroyed\n */\n protected _destroy: Subject<void> = new Subject<void>();\n\n /**\n * Array of scoped notifications\n */\n protected _scopes: Dictionary<[Notifications, Subscription]> = {};\n\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public get notifications(): readonly Notification[]\n {\n return [...this._notifications];\n }\n\n /**\n * @inheritdoc\n */\n public get notificationsChange(): Observable<void>\n {\n return this._notificationsChange.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get destroy(): Observable<void>\n {\n return this._destroy.asObservable();\n }\n\n //######################### constructor #########################\n constructor(@Optional() protected _options: NotificationsOptions)\n {\n if(!this._options || !(this._options instanceof NotificationsOptions))\n {\n this._options = new NotificationsOptions();\n }\n }\n\n //######################### public methods - implementation of Notifications #########################\n\n /**\n * @inheritdoc\n */\n public message(message: string, severity: NotificationSeverity, parameter?: Record<string, unknown>): Notifications\n {\n const notification = new Notification(message, severity, parameter);\n\n this._notifications.push(notification);\n this._notificationsChange.next();\n\n // set timeout\n if(this._options.timeout > 0)\n {\n this._notificationsTimeouts.push(setTimeout(() =>\n {\n this.remove(notification);\n }, this._options.timeout) as any);\n }\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public default(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Default, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public success(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Success, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public error(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Error, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public info(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Info, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public warning(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Warning, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public clearNotifications(): Notifications\n {\n while(this._notifications[0])\n {\n this._remove(this._notifications[0], false);\n }\n\n this._notificationsChange.next();\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public remove(notification: Notification): Notifications\n {\n return this._remove(notification);\n }\n\n /**\n * @inheritdoc\n */\n public getScope(scopeName: string): Notifications\n {\n const scopeObj = this._scopes[scopeName];\n let scope: Notifications;\n\n // no scope yet\n if(!scopeObj)\n {\n scope = new DefaultNotificationsService(this._options);\n const subscription = new Subscription();\n\n this._scopes[scopeName] = [scope, subscription];\n\n //destroys and removes scope\n subscription.add(scope.destroy.subscribe(() =>\n {\n delete this._scopes[scopeName];\n subscription.unsubscribe();\n }));\n }\n else\n {\n scope = scopeObj[0];\n }\n\n return scope;\n }\n\n /**\n * @inheritdoc\n *\n * Call this manualy for scoped instances until this is fixed https://github.com/angular/angular/issues/28738\n */\n public ngOnDestroy(): void\n {\n this._destroy.next();\n this._destroy.complete();\n this._notificationsChange.complete();\n\n Object.keys(this._scopes).forEach(scopeName =>\n {\n const [scope] = this._scopes[scopeName];\n\n scope.ngOnDestroy();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Removes notification from array of notifications\n * @param notification - Notification to be removed\n * @param emitEvent - Indication whether emit event on removal\n */\n protected _remove(notification: Notification, emitEvent: boolean = true): Notifications\n {\n const index = this._notifications.indexOf(notification);\n\n if(index < 0)\n {\n return this;\n }\n\n this._notifications.splice(index, 1);\n\n if(emitEvent)\n {\n this._notificationsChange.next();\n }\n\n // clear timeout\n if(this._options.timeout > 0)\n {\n clearTimeout(this._notificationsTimeouts[index]);\n this._notificationsTimeouts.splice(index, 1);\n }\n\n return this;\n }\n}\n\n/**\n * Default notifications provider\n */\nconst DEFAULT_NOTIFICATIONS: NotificationsProvider =\n{\n provide: NOTIFICATIONS,\n useClass: DefaultNotificationsService\n};\n\n//TODO: add options to notifications factory\n\n/**\n * Factory that creates notifications provider for scope\n */\nconst notificationsFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n{\n return <NotificationsScopeProvider> [\n {\n provide: NOTIFICATIONS_SCOPE,\n useValue: scopeName\n },\n {\n provide: token ?? NOTIFICATIONS,\n useFactory: (notifications: Notifications) =>\n {\n return notifications.getScope(scopeName);\n },\n deps: [[new SkipSelf(), NOTIFICATIONS]]\n }\n ];\n};\n\nObject.defineProperty(DEFAULT_NOTIFICATIONS, 'scope',\n{\n get()\n {\n const func: NotificationsScopeProviderFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n {\n return notificationsFactory(scopeName, token);\n };\n\n Object.defineProperty(func, 'random',\n {\n get()\n {\n return notificationsFactory(generateId(6));\n }\n });\n\n return func;\n }\n});\n\nexport {DEFAULT_NOTIFICATIONS};"]}
|
|
@@ -37,15 +37,15 @@ let CookiePermanentStorage = class CookiePermanentStorage {
|
|
|
37
37
|
remove(name) {
|
|
38
38
|
this._cookies.deleteCookie(name, '/');
|
|
39
39
|
}
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
41
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookiePermanentStorage, deps: [{ token: i1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
41
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookiePermanentStorage }); }
|
|
42
42
|
};
|
|
43
43
|
CookiePermanentStorage = __decorate([
|
|
44
44
|
TypeProvider({ provide: PERMANENT_STORAGE, useClass: forwardRef(() => CookiePermanentStorage) }),
|
|
45
45
|
__metadata("design:paramtypes", [CookieService])
|
|
46
46
|
], CookiePermanentStorage);
|
|
47
47
|
export { CookiePermanentStorage };
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CookiePermanentStorage, decorators: [{
|
|
49
49
|
type: Injectable
|
|
50
50
|
}], ctorParameters: () => [{ type: i1.CookieService }] });
|
|
51
51
|
//# sourceMappingURL=cookiePermanentStorage.service.js.map
|
|
@@ -19,10 +19,10 @@ export class StatusCodeService {
|
|
|
19
19
|
setStatusCode(code) {
|
|
20
20
|
this._statusCode = code;
|
|
21
21
|
}
|
|
22
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: StatusCodeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: StatusCodeService, providedIn: 'root' }); }
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: StatusCodeService, decorators: [{
|
|
26
26
|
type: Injectable,
|
|
27
27
|
args: [{ providedIn: 'root' }]
|
|
28
28
|
}] });
|