@anglr/common 12.0.0-beta.20220414093434 → 12.0.0
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 +29 -1
- package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
- package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
- package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +2 -2
- package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2015/forms/src/components/index.js +1 -0
- package/es2015/forms/src/components/index.js.map +1 -1
- package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
- package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
- package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
- package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
- package/es2015/forms/src/directives/hasError/hasError.directive.js +25 -5
- package/es2015/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2015/forms/src/directives/index.js +3 -0
- package/es2015/forms/src/directives/index.js.map +1 -0
- package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
- package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
- package/es2015/forms/src/index.js +1 -0
- package/es2015/forms/src/index.js.map +1 -1
- package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
- package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2015/forms/src/modules/hasError.module.js +14 -3
- package/es2015/forms/src/modules/hasError.module.js.map +1 -1
- package/es2015/positions/src/index.js +0 -7
- package/es2015/positions/src/index.js.map +1 -1
- package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
- package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2015/src/services/position/position.interface.js.map +1 -1
- package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
- package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
- package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +2 -2
- package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2020/forms/src/components/index.js +1 -0
- package/es2020/forms/src/components/index.js.map +1 -1
- package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
- package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
- package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
- package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
- package/es2020/forms/src/directives/hasError/hasError.directive.js +25 -5
- package/es2020/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2020/forms/src/directives/index.js +3 -0
- package/es2020/forms/src/directives/index.js.map +1 -0
- package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
- package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
- package/es2020/forms/src/index.js +1 -0
- package/es2020/forms/src/index.js.map +1 -1
- package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
- package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2020/forms/src/modules/hasError.module.js +14 -3
- package/es2020/forms/src/modules/hasError.module.js.map +1 -1
- package/es2020/positions/src/index.js +0 -7
- package/es2020/positions/src/index.js.map +1 -1
- package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
- package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2020/src/services/position/position.interface.js.map +1 -1
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -1
- package/forms/src/components/index.d.ts +1 -0
- package/forms/src/components/index.d.ts.map +1 -1
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.css +4 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts +53 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts.map +1 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html +3 -0
- package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts +10 -0
- package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts.map +1 -0
- package/forms/src/directives/hasError/hasError.directive.d.ts +16 -4
- package/forms/src/directives/hasError/hasError.directive.d.ts.map +1 -1
- package/forms/src/directives/index.d.ts +3 -0
- package/forms/src/directives/index.d.ts.map +1 -0
- package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts +12 -0
- package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts.map +1 -0
- package/forms/src/index.d.ts +1 -0
- package/forms/src/index.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/forms/src/modules/hasError.module.d.ts +7 -4
- package/forms/src/modules/hasError.module.d.ts.map +1 -1
- package/package.json +3 -3
- package/positions/src/index.d.ts +0 -7
- package/positions/src/index.d.ts.map +1 -1
- package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +6 -2
- package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -1
- package/src/services/position/position.interface.d.ts +4 -0
- package/src/services/position/position.interface.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
- package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
- package/es2015/positions/src/modules/positions/modules/positions.module.js +0 -24
- package/es2015/positions/src/modules/positions/modules/positions.module.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
- package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -230
- package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/misc/tokens.js +0 -6
- package/es2015/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
- package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
- package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
- package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
- package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
- package/es2020/positions/src/modules/positions/modules/positions.module.js +0 -24
- package/es2020/positions/src/modules/positions/modules/positions.module.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
- package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -229
- package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/misc/tokens.js +0 -6
- package/es2020/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
- package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
- package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
- package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.html +0 -0
- package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts +0 -34
- package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts.map +0 -1
- package/positions/src/modules/positions/modules/positions.module.d.ts +0 -11
- package/positions/src/modules/positions/modules/positions.module.d.ts.map +0 -1
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.css +0 -10
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +0 -63
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +0 -1
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.html +0 -6
- package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +0 -106
- package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +0 -1
- package/positions/src/modules/tooltip/misc/tokens.d.ts +0 -7
- package/positions/src/modules/tooltip/misc/tokens.d.ts.map +0 -1
- package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts +0 -71
- package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts.map +0 -1
- package/positions/src/modules/tooltip/modules/tooltip.module.d.ts +0 -13
- package/positions/src/modules/tooltip/modules/tooltip.module.d.ts.map +0 -1
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { ApplicationRef, ComponentFactoryResolver, ContentChild, Directive, ElementRef, HostListener, Inject, Injector, Input, Optional, TemplateRef } from '@angular/core';
|
|
2
|
-
import { extend, isBlank, isPresent, nameof } from '@jscrpt/common';
|
|
3
|
-
import { TooltipComponent } from '../../components/tooltip/tooltip.component';
|
|
4
|
-
import { TOOLTIP_OPTIONS } from '../../misc/tokens';
|
|
5
|
-
import { positionsWithFlip } from '../../../../misc/utils';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Default options for tooltip
|
|
9
|
-
*/
|
|
10
|
-
const defaultOptions = {
|
|
11
|
-
delay: 200,
|
|
12
|
-
elementPositionAt: 'top left',
|
|
13
|
-
tooltipPosition: 'bottom left',
|
|
14
|
-
fixedPosition: false,
|
|
15
|
-
allowSelection: false,
|
|
16
|
-
tooltipRenderer: TooltipComponent,
|
|
17
|
-
tooltipCssClass: null,
|
|
18
|
-
stopPropagation: false
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Directive used for rendering tooltip
|
|
22
|
-
*/
|
|
23
|
-
export class TooltipDirective {
|
|
24
|
-
//######################### constructor #########################
|
|
25
|
-
constructor(_componentFactoryResolver, _appRef, _injector, _element, options) {
|
|
26
|
-
this._componentFactoryResolver = _componentFactoryResolver;
|
|
27
|
-
this._appRef = _appRef;
|
|
28
|
-
this._injector = _injector;
|
|
29
|
-
this._element = _element;
|
|
30
|
-
/**
|
|
31
|
-
* Indication whether there is active show tooltip request
|
|
32
|
-
*/
|
|
33
|
-
this._showRequest = false;
|
|
34
|
-
/**
|
|
35
|
-
* Indication whether keep open tooltip component
|
|
36
|
-
*/
|
|
37
|
-
this._keepOpen = false;
|
|
38
|
-
/**
|
|
39
|
-
* Timeout that is used for handling mouse move
|
|
40
|
-
*/
|
|
41
|
-
this._timeout = null;
|
|
42
|
-
/**
|
|
43
|
-
* Indication whether are html tags allowed in tooltip text
|
|
44
|
-
*/
|
|
45
|
-
this.allowHtml = false;
|
|
46
|
-
this._options = extend(true, {}, defaultOptions, options);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Options used for displaying tooltip
|
|
50
|
-
*/
|
|
51
|
-
get tooltipOptions() {
|
|
52
|
-
return this._options;
|
|
53
|
-
}
|
|
54
|
-
set tooltipOptions(value) {
|
|
55
|
-
this._options = extend(true, {}, this._options, value);
|
|
56
|
-
}
|
|
57
|
-
//######################### public methods - implementation of OnChanges #########################
|
|
58
|
-
/**
|
|
59
|
-
* Called when input value changes
|
|
60
|
-
*/
|
|
61
|
-
ngOnChanges(changes) {
|
|
62
|
-
if (nameof('tooltipVisible') in changes) {
|
|
63
|
-
if (this.tooltipVisible) {
|
|
64
|
-
this._showTooltip();
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
this._hideTooltip();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
//######################### public methods - implementation of OnDestroy #########################
|
|
72
|
-
/**
|
|
73
|
-
* Called when component is destroyed
|
|
74
|
-
*/
|
|
75
|
-
ngOnDestroy() {
|
|
76
|
-
this._destroyTooltip();
|
|
77
|
-
}
|
|
78
|
-
//######################### public methods - host #########################
|
|
79
|
-
/**
|
|
80
|
-
* Handles mouse leave event, hover ends
|
|
81
|
-
* @param event - Mouse event that occured
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
mouseLeave(event) {
|
|
85
|
-
if (this._options.stopPropagation) {
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
}
|
|
88
|
-
if (isBlank(this.tooltipVisible)) {
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
if (!this._keepOpen) {
|
|
91
|
-
this._showRequest = false;
|
|
92
|
-
this._hideTooltip();
|
|
93
|
-
}
|
|
94
|
-
}, 10);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Handles mouse move event, displaying tooltip
|
|
99
|
-
* @param event - Mouse event that occured
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
102
|
-
mouseMove(event) {
|
|
103
|
-
if (this._options.stopPropagation) {
|
|
104
|
-
event.stopPropagation();
|
|
105
|
-
}
|
|
106
|
-
this._showRequest = true;
|
|
107
|
-
//do nothing if tooltip is visible
|
|
108
|
-
if (this._tooltipComponent || isPresent(this.tooltipVisible)) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (isPresent(this._timeout)) {
|
|
112
|
-
clearTimeout(this._timeout);
|
|
113
|
-
}
|
|
114
|
-
this._timeout = setTimeout(() => {
|
|
115
|
-
this._timeout = null;
|
|
116
|
-
if (this._showRequest) {
|
|
117
|
-
this._showTooltip(event.clientX);
|
|
118
|
-
this._showRequest = false;
|
|
119
|
-
}
|
|
120
|
-
}, this._options.delay);
|
|
121
|
-
}
|
|
122
|
-
//######################### protected methods #########################
|
|
123
|
-
/**
|
|
124
|
-
* Shows tooltip
|
|
125
|
-
* @param xCoordinate - X coordinate of mouse event in viewport
|
|
126
|
-
*/
|
|
127
|
-
_showTooltip(xCoordinate) {
|
|
128
|
-
this._createTooltip();
|
|
129
|
-
this._showData();
|
|
130
|
-
positionsWithFlip(this._tooltipElement, this._options.tooltipPosition, this._element.nativeElement, this._options.elementPositionAt);
|
|
131
|
-
if (xCoordinate && !this._options.fixedPosition) {
|
|
132
|
-
this._tooltipElement.style.left = `${xCoordinate}px`;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Hides tooltip
|
|
137
|
-
*/
|
|
138
|
-
_hideTooltip() {
|
|
139
|
-
this._destroyTooltip();
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Destroys tooltip component
|
|
143
|
-
*/
|
|
144
|
-
_destroyTooltip() {
|
|
145
|
-
if (this._tooltipComponent) {
|
|
146
|
-
this._appRef.detachView(this._tooltipComponent.hostView);
|
|
147
|
-
this._tooltipComponent.destroy();
|
|
148
|
-
this._tooltipComponent = null;
|
|
149
|
-
this._tooltipElement = null;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Creates tooltip renderer component
|
|
154
|
-
*/
|
|
155
|
-
_createTooltip() {
|
|
156
|
-
// 0. Destroyes absolute popup if it exists
|
|
157
|
-
this._destroyTooltip();
|
|
158
|
-
// 1. Create a component reference from the component
|
|
159
|
-
this._tooltipComponent = this._componentFactoryResolver
|
|
160
|
-
.resolveComponentFactory(this._options.tooltipRenderer)
|
|
161
|
-
.create(this._injector);
|
|
162
|
-
// 2. Attach component to the appRef so that it's inside the ng component tree
|
|
163
|
-
this._appRef.attachView(this._tooltipComponent.hostView);
|
|
164
|
-
// 3. Get DOM element from component
|
|
165
|
-
this._tooltipElement = this._tooltipComponent.hostView
|
|
166
|
-
.rootNodes[0];
|
|
167
|
-
// 4. Append DOM element to the body
|
|
168
|
-
document.body.appendChild(this._tooltipElement);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Sets data to tooltip component and shows them
|
|
172
|
-
*/
|
|
173
|
-
_showData() {
|
|
174
|
-
var _a;
|
|
175
|
-
if (this._tooltipComponent) {
|
|
176
|
-
this._tooltipComponent.instance.allowHtml = this.allowHtml;
|
|
177
|
-
this._tooltipComponent.instance.data = this.tooltip;
|
|
178
|
-
this._tooltipComponent.instance.template = (_a = this.tooltipTemplate) !== null && _a !== void 0 ? _a : this.tooltipTemplateChild;
|
|
179
|
-
this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;
|
|
180
|
-
this._tooltipComponent.instance.registerHoverEvents(() => {
|
|
181
|
-
if (this._options.allowSelection) {
|
|
182
|
-
this._keepOpen = true;
|
|
183
|
-
this._showRequest = false;
|
|
184
|
-
}
|
|
185
|
-
}, () => {
|
|
186
|
-
setTimeout(() => {
|
|
187
|
-
this._keepOpen = false;
|
|
188
|
-
if (!this._showRequest) {
|
|
189
|
-
this._hideTooltip();
|
|
190
|
-
}
|
|
191
|
-
this._showRequest = false;
|
|
192
|
-
}, 5);
|
|
193
|
-
});
|
|
194
|
-
this._tooltipComponent.instance.invalidateVisuals();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: TOOLTIP_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
199
|
-
TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: TooltipDirective, selector: "[tooltip]", inputs: { tooltip: "tooltip", allowHtml: "allowHtml", tooltipTemplate: "tooltipTemplate", tooltipOptions: "tooltipOptions", tooltipVisible: "tooltipVisible" }, host: { listeners: { "mouseleave": "mouseLeave($event)", "mousemove": "mouseMove($event)" } }, queries: [{ propertyName: "tooltipTemplateChild", first: true, predicate: ["tooltipTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0 });
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
201
|
-
type: Directive,
|
|
202
|
-
args: [{
|
|
203
|
-
selector: '[tooltip]'
|
|
204
|
-
}]
|
|
205
|
-
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
206
|
-
type: Optional
|
|
207
|
-
}, {
|
|
208
|
-
type: Inject,
|
|
209
|
-
args: [TOOLTIP_OPTIONS]
|
|
210
|
-
}] }]; }, propDecorators: { tooltip: [{
|
|
211
|
-
type: Input
|
|
212
|
-
}], allowHtml: [{
|
|
213
|
-
type: Input
|
|
214
|
-
}], tooltipTemplate: [{
|
|
215
|
-
type: Input
|
|
216
|
-
}], tooltipOptions: [{
|
|
217
|
-
type: Input
|
|
218
|
-
}], tooltipVisible: [{
|
|
219
|
-
type: Input
|
|
220
|
-
}], tooltipTemplateChild: [{
|
|
221
|
-
type: ContentChild,
|
|
222
|
-
args: ['tooltipTemplate']
|
|
223
|
-
}], mouseLeave: [{
|
|
224
|
-
type: HostListener,
|
|
225
|
-
args: ['mouseleave', ['$event']]
|
|
226
|
-
}], mouseMove: [{
|
|
227
|
-
type: HostListener,
|
|
228
|
-
args: ['mousemove', ['$event']]
|
|
229
|
-
}] } });
|
|
230
|
-
//# sourceMappingURL=tooltip.directive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/tooltip/directives/tooltip/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAgB,YAAY,EAAE,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAwB,QAAQ,EAAiB,WAAW,EAAC,MAAM,eAAe,CAAC;AAC9O,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAE5E,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;;AAEzD;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,KAAK,EAAE,GAAG;IACV,iBAAiB,EAAE,UAAU;IAC7B,eAAe,EAAE,aAAa;IAC9B,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,gBAAgB;IACjC,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,KAAK;CACzB,CAAC;AAEF;;GAEG;AAKH,MAAM,OAAO,gBAAgB;IAiFzB,iEAAiE;IACjE,YAAsB,yBAAmD,EACnD,OAAuB,EACvB,SAAmB,EACnB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AAiB;gBAmDxB,UAAU;sBADhB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBA2B/B,SAAS;sBADf,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ApplicationRef, ComponentFactoryResolver, ComponentRef, ContentChild, Directive, ElementRef, EmbeddedViewRef, HostListener, Inject, Injector, Input, OnChanges, OnDestroy, Optional, SimpleChanges, TemplateRef} from '@angular/core';\nimport {extend, isBlank, isPresent, nameof} from '@jscrpt/common';\n\nimport {TooltipComponent} from '../../components/tooltip/tooltip.component';\nimport {TooltipOptions, TooltipRenderer} from '../../misc/tooltip.interface';\nimport {TOOLTIP_OPTIONS} from '../../misc/tokens';\nimport {positionsWithFlip} from '../../../../misc/utils';\n\n/**\n * Default options for tooltip\n */\nconst defaultOptions: TooltipOptions =\n{\n delay: 200,\n elementPositionAt: 'top left',\n tooltipPosition: 'bottom left',\n fixedPosition: false,\n allowSelection: false,\n tooltipRenderer: TooltipComponent,\n tooltipCssClass: null,\n stopPropagation: false\n};\n\n/**\n * Directive used for rendering tooltip\n */\n@Directive(\n{\n selector: '[tooltip]'\n})\nexport class TooltipDirective<TData = any> implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering tooltip\n */\n protected _tooltipComponent?: ComponentRef<TooltipRenderer>;\n\n /**\n * Instance of HTML element for tooltip renderer\n */\n protected _tooltipElement?: HTMLElement;\n\n /**\n * Instance of options provided for this tooltip\n */\n protected _options: TooltipOptions;\n\n /**\n * Indication whether there is active show tooltip request\n */\n protected _showRequest: boolean = false;\n\n /**\n * Indication whether keep open tooltip component\n */\n protected _keepOpen: boolean = false;\n\n /**\n * Timeout that is used for handling mouse move\n */\n protected _timeout: number|null = null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Tooltip text that is displayed, or any data that could be passed to template\n */\n @Input()\n public tooltip?: TData|string;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input()\n public allowHtml: boolean = false;\n\n /**\n * Instance of tooltip template that is used for rendering\n */\n @Input()\n public tooltipTemplate?: TemplateRef<any>;\n\n /**\n * Options used for displaying tooltip\n */\n @Input()\n public get tooltipOptions(): TooltipOptions\n {\n return this._options;\n }\n public set tooltipOptions(value: TooltipOptions)\n {\n this._options = extend(true, {}, this._options, value);\n }\n\n /**\n * Gets or sets indication whether is tooltip visible, if has boolean value, mouse events cant override this\n */\n @Input()\n public tooltipVisible?: boolean;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of template from element content, used for rendering\n */\n @ContentChild('tooltipTemplate')\n public tooltipTemplateChild?: TemplateRef<any>;\n\n //######################### constructor #########################\n constructor(protected _componentFactoryResolver: ComponentFactoryResolver,\n protected _appRef: ApplicationRef,\n protected _injector: Injector,\n protected _element: ElementRef<HTMLElement>,\n @Optional() @Inject(TOOLTIP_OPTIONS) options: TooltipOptions)\n {\n this._options = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<TooltipDirective>('tooltipVisible') in changes)\n {\n if(this.tooltipVisible)\n {\n this._showTooltip();\n }\n else\n {\n this._hideTooltip();\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._destroyTooltip();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse leave event, hover ends\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mouseleave', ['$event'])\n public mouseLeave(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n if(isBlank(this.tooltipVisible))\n {\n setTimeout(() =>\n {\n if(!this._keepOpen)\n {\n this._showRequest = false;\n this._hideTooltip();\n }\n }, 10);\n }\n }\n\n /**\n * Handles mouse move event, displaying tooltip\n * @param event - Mouse event that occured\n * @internal\n */\n @HostListener('mousemove', ['$event'])\n public mouseMove(event: MouseEvent): void\n {\n if(this._options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n this._showRequest = true;\n\n //do nothing if tooltip is visible\n if(this._tooltipComponent || isPresent(this.tooltipVisible))\n {\n return;\n }\n\n if(isPresent(this._timeout))\n {\n clearTimeout(this._timeout);\n }\n\n this._timeout = setTimeout(() =>\n {\n this._timeout = null;\n\n if(this._showRequest)\n {\n this._showTooltip(event.clientX);\n\n this._showRequest = false;\n }\n }, this._options.delay) as any;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows tooltip\n * @param xCoordinate - X coordinate of mouse event in viewport\n */\n protected _showTooltip(xCoordinate?: number): void\n {\n this._createTooltip();\n this._showData();\n positionsWithFlip(this._tooltipElement, this._options.tooltipPosition, this._element.nativeElement, this._options.elementPositionAt);\n\n if(xCoordinate && !this._options.fixedPosition)\n {\n this._tooltipElement.style.left = `${xCoordinate}px`;\n }\n }\n\n /**\n * Hides tooltip\n */\n protected _hideTooltip(): void\n {\n this._destroyTooltip();\n }\n\n /**\n * Destroys tooltip component\n */\n protected _destroyTooltip(): void\n {\n if(this._tooltipComponent)\n {\n this._appRef.detachView(this._tooltipComponent.hostView);\n this._tooltipComponent.destroy();\n this._tooltipComponent = null;\n this._tooltipElement = null;\n }\n }\n\n /**\n * Creates tooltip renderer component\n */\n protected _createTooltip(): void\n {\n // 0. Destroyes absolute popup if it exists\n this._destroyTooltip();\n\n // 1. Create a component reference from the component\n this._tooltipComponent = this._componentFactoryResolver\n .resolveComponentFactory(this._options.tooltipRenderer)\n .create(this._injector);\n\n // 2. Attach component to the appRef so that it's inside the ng component tree\n this._appRef.attachView(this._tooltipComponent.hostView);\n\n // 3. Get DOM element from component\n this._tooltipElement = (this._tooltipComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n document.body.appendChild(this._tooltipElement);\n }\n\n /**\n * Sets data to tooltip component and shows them\n */\n protected _showData(): void\n {\n if(this._tooltipComponent)\n {\n this._tooltipComponent.instance.allowHtml = this.allowHtml;\n this._tooltipComponent.instance.data = this.tooltip;\n this._tooltipComponent.instance.template = this.tooltipTemplate ?? this.tooltipTemplateChild;\n this._tooltipComponent.instance.cssClass = this._options.tooltipCssClass;\n\n this._tooltipComponent.instance.registerHoverEvents(() =>\n {\n if(this._options.allowSelection)\n {\n this._keepOpen = true;\n this._showRequest = false;\n }\n },\n () =>\n {\n setTimeout(() =>\n {\n this._keepOpen = false;\n\n if(!this._showRequest)\n {\n this._hideTooltip();\n }\n\n this._showRequest = false;\n }, 5);\n });\n\n this._tooltipComponent.instance.invalidateVisuals();\n }\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/tooltip/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,IAAI,cAAc,CAAiB,iBAAiB,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {TooltipOptions} from './tooltip.interface';\n\n/**\n * Injection token used for injecting tooltip options\n */\nexport const TOOLTIP_OPTIONS: InjectionToken<TooltipOptions> = new InjectionToken<TooltipOptions>('TOOLTIP_OPTIONS');"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.interface.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/tooltip/misc/tooltip.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {TemplateRef, Type} from '@angular/core';\nimport type {PositionsCoordinates} from 'positions';\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;\n\n /**\n * Template used for rendering tooltip\n */\n template: TemplateRef<TData>|null;\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;\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 * Indication whether is tooltip displayed at fixed position, or if it is displayed where cursor enters element\n */\n fixedPosition?: boolean;\n\n /**\n * Position where should be tooltip displayed at element\n */\n elementPositionAt?: PositionsCoordinates;\n\n /**\n * Position of tooltip where should placed at\n */\n tooltipPosition?: PositionsCoordinates;\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}"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { TooltipComponent } from '../components/tooltip/tooltip.component';
|
|
4
|
-
import { TooltipDirective } from '../directives/tooltip/tooltip.directive';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Module for rendering tooltips
|
|
8
|
-
*/
|
|
9
|
-
export class TooltipModule {
|
|
10
|
-
}
|
|
11
|
-
TooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
-
TooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipModule, declarations: [TooltipDirective,
|
|
13
|
-
TooltipComponent], imports: [CommonModule], exports: [TooltipDirective] });
|
|
14
|
-
TooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipModule, imports: [[
|
|
15
|
-
CommonModule
|
|
16
|
-
]] });
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipModule, decorators: [{
|
|
18
|
-
type: NgModule,
|
|
19
|
-
args: [{
|
|
20
|
-
imports: [
|
|
21
|
-
CommonModule
|
|
22
|
-
],
|
|
23
|
-
declarations: [
|
|
24
|
-
TooltipDirective,
|
|
25
|
-
TooltipComponent
|
|
26
|
-
],
|
|
27
|
-
exports: [
|
|
28
|
-
TooltipDirective
|
|
29
|
-
]
|
|
30
|
-
}]
|
|
31
|
-
}] });
|
|
32
|
-
//# sourceMappingURL=tooltip.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.module.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/tooltip/modules/tooltip.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAC,gBAAgB,EAAC,MAAM,yCAAyC,CAAC;;AAEzE;;GAEG;AAiBH,MAAM,OAAO,aAAa;;0GAAb,aAAa;2GAAb,aAAa,iBARlB,gBAAgB;QAChB,gBAAgB,aALhB,YAAY,aASZ,gBAAgB;2GAGX,aAAa,YAbtB;YACI,YAAY;SACf;2FAWQ,aAAa;kBAhBzB,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,YAAY;qBACf;oBACD,YAAY,EACZ;wBACI,gBAAgB;wBAChB,gBAAgB;qBACnB;oBACD,OAAO,EACP;wBACI,gBAAgB;qBACnB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {TooltipComponent} from '../components/tooltip/tooltip.component';\nimport {TooltipDirective} from '../directives/tooltip/tooltip.directive';\n\n/**\n * Module for rendering tooltips\n */\n@NgModule(\n{\n imports:\n [\n CommonModule\n ],\n declarations:\n [\n TooltipDirective,\n TooltipComponent\n ],\n exports:\n [\n TooltipDirective\n ]\n})\nexport class TooltipModule\n{\n}\n"]}
|
package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, ElementRef, Inject, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import { DOCUMENT } from '@angular/common';
|
|
3
|
-
import { nameof, isPresent } from '@jscrpt/common';
|
|
4
|
-
import { positionsWithFlip } from '../../../../misc/utils';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Sets position of attached element relative to provided element
|
|
8
|
-
*/
|
|
9
|
-
export class PositionToDirective {
|
|
10
|
-
//######################### constructor #########################
|
|
11
|
-
constructor(_element, _document) {
|
|
12
|
-
this._element = _element;
|
|
13
|
-
this._document = _document;
|
|
14
|
-
/**
|
|
15
|
-
* Relative coordinates of element
|
|
16
|
-
*/
|
|
17
|
-
this.elementCoordinates = 'top left';
|
|
18
|
-
/**
|
|
19
|
-
* Relative coordinates of target element
|
|
20
|
-
*/
|
|
21
|
-
this.targetCoordinates = 'bottom left';
|
|
22
|
-
//######################### public properties - outputs #########################
|
|
23
|
-
/**
|
|
24
|
-
* Occurs when flip occurs during positioning
|
|
25
|
-
*/
|
|
26
|
-
this.flip = new EventEmitter();
|
|
27
|
-
}
|
|
28
|
-
//######################### public methods - implementation of OnChanges #########################
|
|
29
|
-
/**
|
|
30
|
-
* Called when input value changes
|
|
31
|
-
*/
|
|
32
|
-
ngOnChanges(changes) {
|
|
33
|
-
if (nameof('target') in changes && isPresent(this.target)) {
|
|
34
|
-
positionsWithFlip(this._element.nativeElement, this.elementCoordinates, this.target, this.targetCoordinates, this._document, () => this.flip.emit());
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
|
|
39
|
-
PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: PositionToDirective, selector: "[positionTo]", inputs: { target: ["positionTo", "target"], elementCoordinates: "elementCoordinates", targetCoordinates: "targetCoordinates" }, outputs: { flip: "flip" }, usesOnChanges: true, ngImport: i0 });
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, decorators: [{
|
|
41
|
-
type: Directive,
|
|
42
|
-
args: [{
|
|
43
|
-
selector: '[positionTo]'
|
|
44
|
-
}]
|
|
45
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Document, decorators: [{
|
|
46
|
-
type: Inject,
|
|
47
|
-
args: [DOCUMENT]
|
|
48
|
-
}] }]; }, propDecorators: { target: [{
|
|
49
|
-
type: Input,
|
|
50
|
-
args: ['positionTo']
|
|
51
|
-
}], elementCoordinates: [{
|
|
52
|
-
type: Input
|
|
53
|
-
}], targetCoordinates: [{
|
|
54
|
-
type: Input
|
|
55
|
-
}], flip: [{
|
|
56
|
-
type: Output
|
|
57
|
-
}] } });
|
|
58
|
-
//# sourceMappingURL=positionTo.directive.js.map
|
package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/positions/directives/positionTo/positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAA4B,MAAM,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;;AAEzD;;GAEG;AAKH,MAAM,OAAO,mBAAmB;IA8B5B,iEAAiE;IACjE,YAAoB,QAAiC,EACf,SAAmB;QADrC,aAAQ,GAAR,QAAQ,CAAyB;QACf,cAAS,GAAT,SAAS,CAAU;QAtBzD;;WAEG;QAEI,uBAAkB,GAAyB,UAAU,CAAC;QAE7D;;WAEG;QAEI,sBAAiB,GAAyB,aAAa,CAAC;QAE/D,iFAAiF;QAEjF;;WAEG;QAEI,SAAI,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAM3D,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW,CAAC,OAAsB;QAErC,IAAG,MAAM,CAAsB,QAAQ,CAAC,IAAI,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7E;YACI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SACxJ;IACL,CAAC;;gHA/CQ,mBAAmB,4CAgCR,QAAQ;oGAhCnB,mBAAmB;2FAAnB,mBAAmB;kBAJ/B,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;mFAiCoD,QAAQ;0BAA5C,MAAM;2BAAC,QAAQ;4CAxBrB,MAAM;sBADZ,KAAK;uBAAC,YAAY;gBAOZ,kBAAkB;sBADxB,KAAK;gBAOC,iBAAiB;sBADvB,KAAK;gBASC,IAAI;sBADV,MAAM","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject, Output, EventEmitter} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {nameof, isPresent} from '@jscrpt/common';\nimport type {PositionsCoordinates} from 'positions';\n\nimport {positionsWithFlip} from '../../../../misc/utils';\n\n/**\n * Sets position of attached element relative to provided element\n */\n@Directive(\n{\n selector: '[positionTo]'\n})\nexport class PositionToDirective implements OnChanges\n{\n //######################### public properties - inputs #########################\n\n /**\n * Html element which is used as target for positioning against it\n */\n @Input('positionTo')\n public target: HTMLElement;\n\n /**\n * Relative coordinates of element\n */\n @Input()\n public elementCoordinates: PositionsCoordinates = 'top left';\n\n /**\n * Relative coordinates of target element\n */\n @Input()\n public targetCoordinates: PositionsCoordinates = 'bottom left';\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when flip occurs during positioning\n */\n @Output()\n public flip: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) private _document: Document)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<PositionToDirective>('target') in changes && isPresent(this.target))\n {\n positionsWithFlip(this._element.nativeElement, this.elementCoordinates, this.target, this.targetCoordinates, this._document, () => this.flip.emit());\n }\n }\n}"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { PositionToDirective } from '../directives/positionTo/positionTo.directive';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Module for position to directive
|
|
6
|
-
*/
|
|
7
|
-
export class PositionsModule {
|
|
8
|
-
}
|
|
9
|
-
PositionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
PositionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, declarations: [PositionToDirective], exports: [PositionToDirective] });
|
|
11
|
-
PositionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, imports: [[]] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionsModule, decorators: [{
|
|
13
|
-
type: NgModule,
|
|
14
|
-
args: [{
|
|
15
|
-
imports: [],
|
|
16
|
-
declarations: [
|
|
17
|
-
PositionToDirective
|
|
18
|
-
],
|
|
19
|
-
exports: [
|
|
20
|
-
PositionToDirective
|
|
21
|
-
]
|
|
22
|
-
}]
|
|
23
|
-
}] });
|
|
24
|
-
//# sourceMappingURL=positions.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"positions.module.js","sourceRoot":"","sources":["../../../../../../positions/src/modules/positions/modules/positions.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,+CAA+C,CAAC;;AAElF;;GAEG;AAeH,MAAM,OAAO,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAPpB,mBAAmB,aAInB,mBAAmB;6GAGd,eAAe,YAXxB,EACC;2FAUQ,eAAe;kBAd3B,QAAQ;mBACT;oBACI,OAAO,EACP,EACC;oBACD,YAAY,EACZ;wBACI,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,mBAAmB;qBACtB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {PositionToDirective} from '../directives/positionTo/positionTo.directive';\n\n/**\n * Module for position to directive\n */\n@NgModule(\n{\n imports:\n [\n ],\n declarations:\n [\n PositionToDirective\n ],\n exports:\n [\n PositionToDirective\n ]\n})\nexport class PositionsModule\n{\n}\n"]}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding, ElementRef, HostListener } from '@angular/core';
|
|
2
|
-
import { transition, trigger, useAnimation } from '@angular/animations';
|
|
3
|
-
import { fadeInAnimation, fadeOutAnimation } from '@anglr/animations';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/common";
|
|
6
|
-
/**
|
|
7
|
-
* Component used for displaying tooltip content
|
|
8
|
-
*/
|
|
9
|
-
export class TooltipComponent {
|
|
10
|
-
//######################### constructor #########################
|
|
11
|
-
constructor(_changeDetector, _element) {
|
|
12
|
-
this._changeDetector = _changeDetector;
|
|
13
|
-
this._element = _element;
|
|
14
|
-
//######################### protected fields #########################
|
|
15
|
-
/**
|
|
16
|
-
* Called when mouse enter tooltip component, hover
|
|
17
|
-
*/
|
|
18
|
-
this._enterFn = () => null;
|
|
19
|
-
/**
|
|
20
|
-
* Called when mouse leaves tooltip component
|
|
21
|
-
*/
|
|
22
|
-
this._leaveFn = () => null;
|
|
23
|
-
//######################### public properties - host #########################
|
|
24
|
-
/**
|
|
25
|
-
* Attach fade in/out animation to element
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
this.animation = true;
|
|
29
|
-
}
|
|
30
|
-
//######################### public methods - implementation of TooltipRenderer #########################
|
|
31
|
-
/**
|
|
32
|
-
* Registers handlers that allows reaction to entering or leaving tooltip
|
|
33
|
-
* @param enter - Called when mouse enter tooltip component, hover
|
|
34
|
-
* @param leave - Called when mouse leaves tooltip component
|
|
35
|
-
*/
|
|
36
|
-
registerHoverEvents(enter, leave) {
|
|
37
|
-
this._enterFn = enter;
|
|
38
|
-
this._leaveFn = leave;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Explicitly runs invalidation of content (change detection)
|
|
42
|
-
*/
|
|
43
|
-
invalidateVisuals() {
|
|
44
|
-
if (this.cssClass) {
|
|
45
|
-
this._element.nativeElement.classList.add(this.cssClass);
|
|
46
|
-
}
|
|
47
|
-
this._changeDetector.detectChanges();
|
|
48
|
-
}
|
|
49
|
-
//######################### public methods - host #########################
|
|
50
|
-
/**
|
|
51
|
-
* Handles mouse enter event over tooltip
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
mouseEnter() {
|
|
55
|
-
this._enterFn();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Handles mouse leave event over tooltip
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
mouseLeave() {
|
|
62
|
-
this._leaveFn();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
-
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: TooltipComponent, selector: "tooltip-popup", host: { listeners: { "mouseenter": "mouseEnter()", "mouseleave": "mouseLeave()" }, properties: { "@fadeInOut": "this.animation" } }, ngImport: i0, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
|
|
67
|
-
trigger('fadeInOut', [
|
|
68
|
-
transition(':enter', [
|
|
69
|
-
useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
|
|
70
|
-
]),
|
|
71
|
-
transition(':leave', [
|
|
72
|
-
useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
|
|
73
|
-
])
|
|
74
|
-
])
|
|
75
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
77
|
-
type: Component,
|
|
78
|
-
args: [{ selector: 'tooltip-popup', animations: [
|
|
79
|
-
trigger('fadeInOut', [
|
|
80
|
-
transition(':enter', [
|
|
81
|
-
useAnimation(fadeInAnimation, { params: { duration: '260ms' } })
|
|
82
|
-
]),
|
|
83
|
-
transition(':leave', [
|
|
84
|
-
useAnimation(fadeOutAnimation, { params: { duration: '260ms' } })
|
|
85
|
-
])
|
|
86
|
-
])
|
|
87
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"] }]
|
|
88
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { animation: [{
|
|
89
|
-
type: HostBinding,
|
|
90
|
-
args: ['@fadeInOut']
|
|
91
|
-
}], mouseEnter: [{
|
|
92
|
-
type: HostListener,
|
|
93
|
-
args: ['mouseenter']
|
|
94
|
-
}], mouseLeave: [{
|
|
95
|
-
type: HostListener,
|
|
96
|
-
args: ['mouseleave']
|
|
97
|
-
}] } });
|
|
98
|
-
//# sourceMappingURL=tooltip.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../../positions/src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../../positions/src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACxI,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;;;AAIpE;;GAEG;AAsBH,MAAM,OAAO,gBAAgB;IA6CzB,iEAAiE;IACjE,YAAsB,eAAkC,EAClC,QAAiC;QADjC,oBAAe,GAAf,eAAe,CAAmB;QAClC,aAAQ,GAAR,QAAQ,CAAyB;QA7CvD,sEAAsE;QAEtE;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAE5C;;WAEG;QACO,aAAQ,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;QAwB5C,8EAA8E;QAE9E;;;WAGG;QAEI,cAAS,GAAY,IAAI,CAAC;IAMjC,CAAC;IAED,wGAAwG;IAExG;;;;OAIG;IACI,mBAAmB,CAAC,KAAiB,EAAE,KAAiB;QAE3D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;OAEG;I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,YAAY;gBAWnB,UAAU;sBADhB,YAAY;uBAAC,YAAY","sourcesContent":["import {Component, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, HostBinding, ElementRef, HostListener} from '@angular/core';\nimport {transition, trigger, useAnimation} from '@angular/animations';\nimport {fadeInAnimation, fadeOutAnimation} from '@anglr/animations';\n\nimport {TooltipRenderer} from '../../misc/tooltip.interface';\n\n/**\n * Component used for displaying tooltip content\n */\n@Component(\n{\n selector: 'tooltip-popup',\n templateUrl: 'tooltip.component.html',\n styleUrls: ['tooltip.component.css'],\n animations:\n [\n trigger('fadeInOut',\n [\n transition(':enter', \n [\n useAnimation(fadeInAnimation, {params: {duration: '260ms'}})\n ]),\n transition(':leave', \n [\n useAnimation(fadeOutAnimation, {params: {duration: '260ms'}})\n ])\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TooltipComponent<TData = any> implements TooltipRenderer<TData>\n{\n //######################### protected fields #########################\n\n /**\n * Called when mouse enter tooltip component, hover\n */\n protected _enterFn: () => void = () => null;\n\n /**\n * Called when mouse leaves tooltip component\n */\n protected _leaveFn: () => void = () => null;\n\n //######################### public properties - implementation of TooltipRenderer #########################\n\n /**\n * Data that are rendered in tooltip\n */\n public data: TData|null;\n\n /**\n * Template used for rendering tooltip\n */\n public template: TemplateRef<TData>|null;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n public allowHtml: boolean;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n public cssClass: string|null;\n\n //######################### public properties - host #########################\n\n /**\n * Attach fade in/out animation to element\n * @internal\n */\n @HostBinding('@fadeInOut')\n public animation: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected _element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of TooltipRenderer #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n public registerHoverEvents(enter: () => void, leave: () => void): void\n {\n this._enterFn = enter;\n this._leaveFn = leave;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n if(this.cssClass)\n {\n this._element.nativeElement.classList.add(this.cssClass);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles mouse enter event over tooltip\n * @internal\n */\n @HostListener('mouseenter')\n public mouseEnter(): void\n {\n this._enterFn();\n }\n\n /**\n * Handles mouse leave event over tooltip\n * @internal\n */\n @HostListener('mouseleave')\n public mouseLeave(): void\n {\n this._leaveFn();\n }\n}","<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>"]}
|