@ngneat/helipopper 4.1.0 → 5.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/README.md +2 -1
- package/esm2020/lib/defaults.mjs +25 -0
- package/esm2020/lib/tippy.directive.mjs +345 -0
- package/esm2020/lib/tippy.module.mjs +28 -0
- package/esm2020/lib/tippy.service.mjs +73 -0
- package/esm2020/lib/tippy.types.mjs +12 -0
- package/{esm2015/lib/utils.js → esm2020/lib/utils.mjs} +3 -2
- package/{esm2015/ngneat-helipopper.js → esm2020/ngneat-helipopper.mjs} +1 -1
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{ngneat-helipopper.js → ngneat-helipopper.mjs} +114 -66
- package/fesm2015/ngneat-helipopper.mjs.map +1 -0
- package/fesm2020/ngneat-helipopper.mjs +561 -0
- package/fesm2020/ngneat-helipopper.mjs.map +1 -0
- package/lib/tippy.directive.d.ts +3 -0
- package/lib/tippy.module.d.ts +5 -0
- package/lib/tippy.service.d.ts +3 -0
- package/lib/tippy.types.d.ts +5 -2
- package/ngneat-helipopper.d.ts +1 -1
- package/package.json +23 -11
- package/bundles/ngneat-helipopper.umd.js +0 -897
- package/bundles/ngneat-helipopper.umd.js.map +0 -1
- package/esm2015/lib/defaults.js +0 -19
- package/esm2015/lib/tippy.directive.js +0 -308
- package/esm2015/lib/tippy.module.js +0 -23
- package/esm2015/lib/tippy.service.js +0 -60
- package/esm2015/lib/tippy.types.js +0 -12
- package/fesm2015/ngneat-helipopper.js.map +0 -1
- package/ngneat-helipopper.metadata.json +0 -1
- package/schematics/collection.json +0 -12
- package/schematics/ng-add/index.js +0 -73
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/index.ts +0 -79
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -18
- package/schematics/ng-add/schema.ts +0 -10
- package/schematics/schematics.consts.js +0 -5
- package/schematics/schematics.consts.js.map +0 -1
- package/schematics/schematics.consts.ts +0 -1
- package/schematics/utils/ast-utils.js +0 -500
- package/schematics/utils/ast-utils.js.map +0 -1
- package/schematics/utils/ast-utils.ts +0 -596
- package/schematics/utils/change.js +0 -127
- package/schematics/utils/change.js.map +0 -1
- package/schematics/utils/change.ts +0 -162
- package/schematics/utils/find-module.js +0 -113
- package/schematics/utils/find-module.js.map +0 -1
- package/schematics/utils/find-module.ts +0 -125
- package/schematics/utils/package.js +0 -22
- package/schematics/utils/package.js.map +0 -1
- package/schematics/utils/package.ts +0 -22
- package/schematics/utils/projects.js +0 -31
- package/schematics/utils/projects.js.map +0 -1
- package/schematics/utils/projects.ts +0 -31
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, ElementRef, EventEmitter, Injector, PLATFORM_ID, Directive, Inject, Input, Output, NgModule, Injectable } from '@angular/core';
|
|
3
|
+
import { isPlatformServer } from '@angular/common';
|
|
4
|
+
import tippy from 'tippy.js';
|
|
5
|
+
import { Observable, Subject, fromEvent, merge } from 'rxjs';
|
|
6
|
+
import { auditTime, map, switchMap, takeUntil, filter } from 'rxjs/operators';
|
|
7
|
+
import * as i1 from '@ngneat/overview';
|
|
8
|
+
import { isString as isString$1, isComponent, isTemplateRef } from '@ngneat/overview';
|
|
9
|
+
|
|
10
|
+
const TIPPY_CONFIG = new InjectionToken('Tippy config', {
|
|
11
|
+
providedIn: 'root',
|
|
12
|
+
factory() {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const TIPPY_REF = new InjectionToken('TIPPY_REF');
|
|
17
|
+
function coerceElement(element) {
|
|
18
|
+
return element instanceof ElementRef ? element.nativeElement : element;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let supportsIntersectionObserver = false;
|
|
22
|
+
let supportsResizeObserver = false;
|
|
23
|
+
if (typeof window !== 'undefined') {
|
|
24
|
+
supportsIntersectionObserver = 'IntersectionObserver' in window;
|
|
25
|
+
supportsResizeObserver = 'ResizeObserver' in window;
|
|
26
|
+
}
|
|
27
|
+
function inView(host, options = {
|
|
28
|
+
root: null,
|
|
29
|
+
threshold: 0.3
|
|
30
|
+
}) {
|
|
31
|
+
const element = coerceElement(host);
|
|
32
|
+
return new Observable(subscriber => {
|
|
33
|
+
if (!supportsIntersectionObserver) {
|
|
34
|
+
subscriber.next();
|
|
35
|
+
subscriber.complete();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const observer = new IntersectionObserver(entries => {
|
|
39
|
+
// Several changes may occur in the same tick, we want to check the latest entry state.
|
|
40
|
+
const entry = entries[entries.length - 1];
|
|
41
|
+
if (entry.isIntersecting) {
|
|
42
|
+
subscriber.next();
|
|
43
|
+
subscriber.complete();
|
|
44
|
+
}
|
|
45
|
+
}, options);
|
|
46
|
+
observer.observe(element);
|
|
47
|
+
return () => observer.disconnect();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function isElementOverflow(host) {
|
|
51
|
+
// Don't access the `offsetWidth` multipe times since it triggers layout updates.
|
|
52
|
+
const hostOffsetWidth = host.offsetWidth;
|
|
53
|
+
return hostOffsetWidth > host.parentElement.offsetWidth || hostOffsetWidth < host.scrollWidth;
|
|
54
|
+
}
|
|
55
|
+
function overflowChanges(host) {
|
|
56
|
+
const element = coerceElement(host);
|
|
57
|
+
return dimensionsChanges(element).pipe(auditTime(150), map(() => isElementOverflow(element)));
|
|
58
|
+
}
|
|
59
|
+
function dimensionsChanges(target) {
|
|
60
|
+
return resizeObserverStrategy(target);
|
|
61
|
+
}
|
|
62
|
+
function resizeObserverStrategy(target) {
|
|
63
|
+
return new Observable(subscriber => {
|
|
64
|
+
if (!supportsResizeObserver) {
|
|
65
|
+
subscriber.next();
|
|
66
|
+
subscriber.complete();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const observer = new ResizeObserver(() => subscriber.next(true));
|
|
70
|
+
observer.observe(target);
|
|
71
|
+
return () => observer.disconnect();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function onlyTippyProps(allProps) {
|
|
75
|
+
const tippyProps = {};
|
|
76
|
+
const ownProps = [
|
|
77
|
+
'variations',
|
|
78
|
+
'useHostWidth',
|
|
79
|
+
'defaultVariation',
|
|
80
|
+
'beforeRender',
|
|
81
|
+
'lazy',
|
|
82
|
+
'variation',
|
|
83
|
+
'isEnabled',
|
|
84
|
+
'className',
|
|
85
|
+
'onlyTextOverflow',
|
|
86
|
+
'data',
|
|
87
|
+
'content',
|
|
88
|
+
'context',
|
|
89
|
+
'hideOnEscape',
|
|
90
|
+
'customHost'
|
|
91
|
+
];
|
|
92
|
+
Object.keys(allProps).forEach(prop => {
|
|
93
|
+
if (!ownProps.includes(prop)) {
|
|
94
|
+
tippyProps[prop] = allProps[prop];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return tippyProps;
|
|
98
|
+
}
|
|
99
|
+
function normalizeClassName(className) {
|
|
100
|
+
const classes = isString(className) ? className.split(' ') : className;
|
|
101
|
+
return classes.map(klass => klass?.trim()).filter(Boolean);
|
|
102
|
+
}
|
|
103
|
+
function isString(value) {
|
|
104
|
+
return typeof value === 'string';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
class TippyDirective {
|
|
108
|
+
constructor(platformId, globalConfig, injector, viewService, vcr, zone, hostRef) {
|
|
109
|
+
this.platformId = platformId;
|
|
110
|
+
this.globalConfig = globalConfig;
|
|
111
|
+
this.injector = injector;
|
|
112
|
+
this.viewService = viewService;
|
|
113
|
+
this.vcr = vcr;
|
|
114
|
+
this.zone = zone;
|
|
115
|
+
this.hostRef = hostRef;
|
|
116
|
+
this.onlyTextOverflow = false;
|
|
117
|
+
this.useHostWidth = false;
|
|
118
|
+
this.hideOnEscape = false;
|
|
119
|
+
this.visible = new EventEmitter();
|
|
120
|
+
this.isVisible = false;
|
|
121
|
+
this.destroyed = new Subject();
|
|
122
|
+
this.enabled = true;
|
|
123
|
+
this.variationDefined = false;
|
|
124
|
+
}
|
|
125
|
+
ngOnChanges(changes) {
|
|
126
|
+
if (isPlatformServer(this.platformId))
|
|
127
|
+
return;
|
|
128
|
+
let props = Object.keys(changes).reduce((acc, change) => {
|
|
129
|
+
if (change === 'isVisible')
|
|
130
|
+
return acc;
|
|
131
|
+
acc[change] = changes[change].currentValue;
|
|
132
|
+
return acc;
|
|
133
|
+
}, {});
|
|
134
|
+
let variation;
|
|
135
|
+
if (isChanged('variation', changes)) {
|
|
136
|
+
variation = changes.variation.currentValue;
|
|
137
|
+
this.variationDefined = true;
|
|
138
|
+
}
|
|
139
|
+
else if (!this.variationDefined) {
|
|
140
|
+
variation = this.globalConfig.defaultVariation;
|
|
141
|
+
this.variationDefined = true;
|
|
142
|
+
}
|
|
143
|
+
if (variation) {
|
|
144
|
+
props = {
|
|
145
|
+
...this.globalConfig.variations[variation],
|
|
146
|
+
...props
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (isChanged('isEnabled', changes)) {
|
|
150
|
+
this.enabled = changes.isEnabled.currentValue;
|
|
151
|
+
this.setStatus();
|
|
152
|
+
}
|
|
153
|
+
if (isChanged('isVisible', changes)) {
|
|
154
|
+
this.isVisible ? this.show() : this.hide();
|
|
155
|
+
}
|
|
156
|
+
this.setProps(props);
|
|
157
|
+
}
|
|
158
|
+
ngOnInit() {
|
|
159
|
+
if (this.useHostWidth) {
|
|
160
|
+
this.props.maxWidth = this.hostWidth;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
ngAfterViewInit() {
|
|
164
|
+
this.zone.runOutsideAngular(() => {
|
|
165
|
+
if (this.lazy) {
|
|
166
|
+
if (this.onlyTextOverflow) {
|
|
167
|
+
inView(this.host)
|
|
168
|
+
.pipe(switchMap(() => overflowChanges(this.host)), takeUntil(this.destroyed))
|
|
169
|
+
.subscribe(isElementOverflow => {
|
|
170
|
+
this.checkOverflow(isElementOverflow);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
inView(this.host)
|
|
175
|
+
.pipe(takeUntil(this.destroyed))
|
|
176
|
+
.subscribe(() => {
|
|
177
|
+
this.createInstance();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else if (this.onlyTextOverflow) {
|
|
182
|
+
overflowChanges(this.host)
|
|
183
|
+
.pipe(takeUntil(this.destroyed))
|
|
184
|
+
.subscribe(isElementOverflow => {
|
|
185
|
+
this.checkOverflow(isElementOverflow);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this.createInstance();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
ngOnDestroy() {
|
|
194
|
+
this.destroyed.next();
|
|
195
|
+
this.instance?.destroy();
|
|
196
|
+
this.destroyView();
|
|
197
|
+
}
|
|
198
|
+
destroyView() {
|
|
199
|
+
this.viewOptions$ = null;
|
|
200
|
+
this.viewRef?.destroy();
|
|
201
|
+
this.viewRef = null;
|
|
202
|
+
}
|
|
203
|
+
show() {
|
|
204
|
+
this.instance?.show();
|
|
205
|
+
}
|
|
206
|
+
hide() {
|
|
207
|
+
this.instance?.hide();
|
|
208
|
+
}
|
|
209
|
+
enable() {
|
|
210
|
+
this.instance?.enable();
|
|
211
|
+
}
|
|
212
|
+
disable() {
|
|
213
|
+
this.instance?.disable();
|
|
214
|
+
}
|
|
215
|
+
setProps(props) {
|
|
216
|
+
this.props = props;
|
|
217
|
+
this.instance?.setProps(onlyTippyProps(props));
|
|
218
|
+
}
|
|
219
|
+
setStatus() {
|
|
220
|
+
this.enabled ? this.instance?.enable() : this.instance?.disable();
|
|
221
|
+
}
|
|
222
|
+
get host() {
|
|
223
|
+
return this.customHost || this.hostRef.nativeElement;
|
|
224
|
+
}
|
|
225
|
+
get hostWidth() {
|
|
226
|
+
return `${this.host.getBoundingClientRect().width}px`;
|
|
227
|
+
}
|
|
228
|
+
createInstance() {
|
|
229
|
+
if (this.content == null) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.zone.runOutsideAngular(() => {
|
|
233
|
+
this.instance = tippy(this.host, {
|
|
234
|
+
allowHTML: true,
|
|
235
|
+
appendTo: document.body,
|
|
236
|
+
...onlyTippyProps(this.globalConfig),
|
|
237
|
+
...onlyTippyProps(this.props),
|
|
238
|
+
onMount: instance => {
|
|
239
|
+
this.isVisible = true;
|
|
240
|
+
this.visible.next(true);
|
|
241
|
+
this.useHostWidth && this.listenToHostResize();
|
|
242
|
+
this.globalConfig.onMount?.(instance);
|
|
243
|
+
},
|
|
244
|
+
onCreate: instance => {
|
|
245
|
+
if (this.className) {
|
|
246
|
+
for (const klass of normalizeClassName(this.className)) {
|
|
247
|
+
instance.popper.classList.add(klass);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.globalConfig.onCreate?.(instance);
|
|
251
|
+
if (this.isVisible === true) {
|
|
252
|
+
instance.show();
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
onShow: instance => {
|
|
256
|
+
this.zone.run(() => {
|
|
257
|
+
const content = this.resolveContent();
|
|
258
|
+
if (isString$1(content)) {
|
|
259
|
+
instance.setProps({ allowHTML: false });
|
|
260
|
+
}
|
|
261
|
+
instance.setContent(content);
|
|
262
|
+
this.hideOnEscape && this.handleEscapeButton();
|
|
263
|
+
});
|
|
264
|
+
if (this.useHostWidth) {
|
|
265
|
+
// Don't access `hostWidth` multiple times since it's a getter that calls `getBoundingClientRect()`,
|
|
266
|
+
// which triggers the whole layout update.
|
|
267
|
+
const hostWidth = this.hostWidth;
|
|
268
|
+
instance.popper.style.width = hostWidth;
|
|
269
|
+
instance.popper.style.maxWidth = hostWidth;
|
|
270
|
+
instance.popper.firstElementChild.style.maxWidth = hostWidth;
|
|
271
|
+
}
|
|
272
|
+
this.globalConfig.onShow?.(instance);
|
|
273
|
+
},
|
|
274
|
+
onHidden: instance => {
|
|
275
|
+
this.destroyView();
|
|
276
|
+
this.isVisible = false;
|
|
277
|
+
this.visible.next(false);
|
|
278
|
+
this.globalConfig.onHidden?.(instance);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
this.setStatus();
|
|
282
|
+
this.setProps(this.props);
|
|
283
|
+
this.variation === 'contextMenu' && this.handleContextMenu();
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
resolveContent() {
|
|
287
|
+
if (!this.viewOptions$ && !isString$1(this.content)) {
|
|
288
|
+
if (isComponent(this.content)) {
|
|
289
|
+
this.instance.data = this.data;
|
|
290
|
+
this.viewOptions$ = {
|
|
291
|
+
injector: Injector.create({
|
|
292
|
+
providers: [
|
|
293
|
+
{
|
|
294
|
+
provide: TIPPY_REF,
|
|
295
|
+
useValue: this.instance
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
parent: this.injector
|
|
299
|
+
})
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
else if (isTemplateRef(this.content)) {
|
|
303
|
+
this.viewOptions$ = {
|
|
304
|
+
context: {
|
|
305
|
+
$implicit: this.hide.bind(this),
|
|
306
|
+
data: this.data
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
this.viewRef = this.viewService.createView(this.content, {
|
|
312
|
+
vcr: this.vcr,
|
|
313
|
+
...this.viewOptions$
|
|
314
|
+
});
|
|
315
|
+
let content = this.viewRef.getElement();
|
|
316
|
+
if (isString$1(content) && this.globalConfig.beforeRender) {
|
|
317
|
+
content = this.globalConfig.beforeRender(content);
|
|
318
|
+
}
|
|
319
|
+
return content;
|
|
320
|
+
}
|
|
321
|
+
handleContextMenu() {
|
|
322
|
+
fromEvent(this.host, 'contextmenu')
|
|
323
|
+
.pipe(takeUntil(this.destroyed))
|
|
324
|
+
.subscribe((event) => {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
this.instance.setProps({
|
|
327
|
+
getReferenceClientRect: () => ({
|
|
328
|
+
width: 0,
|
|
329
|
+
height: 0,
|
|
330
|
+
top: event.clientY,
|
|
331
|
+
bottom: event.clientY,
|
|
332
|
+
left: event.clientX,
|
|
333
|
+
right: event.clientX
|
|
334
|
+
})
|
|
335
|
+
});
|
|
336
|
+
this.instance.show();
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
handleEscapeButton() {
|
|
340
|
+
this.pressButton$(document.body, 'Escape')
|
|
341
|
+
.pipe(takeUntil(merge(this.destroyed, this.visible.pipe(filter(v => !v)))))
|
|
342
|
+
.subscribe(() => this.hide());
|
|
343
|
+
}
|
|
344
|
+
pressButton$(element, codeButton) {
|
|
345
|
+
return fromEvent(element, 'keydown').pipe(filter(({ code }) => codeButton === code));
|
|
346
|
+
}
|
|
347
|
+
checkOverflow(isElementOverflow) {
|
|
348
|
+
if (isElementOverflow) {
|
|
349
|
+
if (!this.instance) {
|
|
350
|
+
this.createInstance();
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
this.instance.enable();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
this.instance?.disable();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
listenToHostResize() {
|
|
361
|
+
dimensionsChanges(this.host)
|
|
362
|
+
.pipe(takeUntil(merge(this.destroyed, this.visible)))
|
|
363
|
+
.subscribe(() => {
|
|
364
|
+
this.instance.popper.style.width = this.hostWidth;
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
TippyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyDirective, deps: [{ token: PLATFORM_ID }, { token: TIPPY_CONFIG }, { token: i0.Injector }, { token: i1.ViewService }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
369
|
+
TippyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: TippyDirective, selector: "[tippy]", inputs: { appendTo: "appendTo", delay: "delay", duration: "duration", hideOnClick: "hideOnClick", interactive: "interactive", interactiveBorder: "interactiveBorder", maxWidth: "maxWidth", offset: "offset", placement: "placement", popperOptions: "popperOptions", showOnCreate: "showOnCreate", trigger: "trigger", triggerTarget: "triggerTarget", zIndex: "zIndex", lazy: "lazy", variation: "variation", isEnabled: "isEnabled", className: "className", onlyTextOverflow: "onlyTextOverflow", data: "data", useHostWidth: "useHostWidth", hideOnEscape: "hideOnEscape", content: ["tippy", "content"], customHost: ["tippyHost", "customHost"], isVisible: "isVisible" }, outputs: { visible: "visible" }, exportAs: ["tippy"], usesOnChanges: true, ngImport: i0 });
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyDirective, decorators: [{
|
|
371
|
+
type: Directive,
|
|
372
|
+
args: [{
|
|
373
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
374
|
+
selector: '[tippy]',
|
|
375
|
+
exportAs: 'tippy'
|
|
376
|
+
}]
|
|
377
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
378
|
+
type: Inject,
|
|
379
|
+
args: [PLATFORM_ID]
|
|
380
|
+
}] }, { type: undefined, decorators: [{
|
|
381
|
+
type: Inject,
|
|
382
|
+
args: [TIPPY_CONFIG]
|
|
383
|
+
}] }, { type: i0.Injector }, { type: i1.ViewService }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { appendTo: [{
|
|
384
|
+
type: Input
|
|
385
|
+
}], delay: [{
|
|
386
|
+
type: Input
|
|
387
|
+
}], duration: [{
|
|
388
|
+
type: Input
|
|
389
|
+
}], hideOnClick: [{
|
|
390
|
+
type: Input
|
|
391
|
+
}], interactive: [{
|
|
392
|
+
type: Input
|
|
393
|
+
}], interactiveBorder: [{
|
|
394
|
+
type: Input
|
|
395
|
+
}], maxWidth: [{
|
|
396
|
+
type: Input
|
|
397
|
+
}], offset: [{
|
|
398
|
+
type: Input
|
|
399
|
+
}], placement: [{
|
|
400
|
+
type: Input
|
|
401
|
+
}], popperOptions: [{
|
|
402
|
+
type: Input
|
|
403
|
+
}], showOnCreate: [{
|
|
404
|
+
type: Input
|
|
405
|
+
}], trigger: [{
|
|
406
|
+
type: Input
|
|
407
|
+
}], triggerTarget: [{
|
|
408
|
+
type: Input
|
|
409
|
+
}], zIndex: [{
|
|
410
|
+
type: Input
|
|
411
|
+
}], lazy: [{
|
|
412
|
+
type: Input
|
|
413
|
+
}], variation: [{
|
|
414
|
+
type: Input
|
|
415
|
+
}], isEnabled: [{
|
|
416
|
+
type: Input
|
|
417
|
+
}], className: [{
|
|
418
|
+
type: Input
|
|
419
|
+
}], onlyTextOverflow: [{
|
|
420
|
+
type: Input
|
|
421
|
+
}], data: [{
|
|
422
|
+
type: Input
|
|
423
|
+
}], useHostWidth: [{
|
|
424
|
+
type: Input
|
|
425
|
+
}], hideOnEscape: [{
|
|
426
|
+
type: Input
|
|
427
|
+
}], content: [{
|
|
428
|
+
type: Input,
|
|
429
|
+
args: ['tippy']
|
|
430
|
+
}], customHost: [{
|
|
431
|
+
type: Input,
|
|
432
|
+
args: ['tippyHost']
|
|
433
|
+
}], visible: [{
|
|
434
|
+
type: Output
|
|
435
|
+
}], isVisible: [{
|
|
436
|
+
type: Input
|
|
437
|
+
}] } });
|
|
438
|
+
function isChanged(key, changes) {
|
|
439
|
+
return key in changes;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
class TippyModule {
|
|
443
|
+
static forRoot(config = {}) {
|
|
444
|
+
return {
|
|
445
|
+
ngModule: TippyModule,
|
|
446
|
+
providers: [
|
|
447
|
+
{
|
|
448
|
+
provide: TIPPY_CONFIG,
|
|
449
|
+
useValue: config
|
|
450
|
+
}
|
|
451
|
+
]
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
TippyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
456
|
+
TippyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyModule, declarations: [TippyDirective], exports: [TippyDirective] });
|
|
457
|
+
TippyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyModule });
|
|
458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyModule, decorators: [{
|
|
459
|
+
type: NgModule,
|
|
460
|
+
args: [{
|
|
461
|
+
declarations: [TippyDirective],
|
|
462
|
+
exports: [TippyDirective]
|
|
463
|
+
}]
|
|
464
|
+
}] });
|
|
465
|
+
|
|
466
|
+
const tooltipVariation = {
|
|
467
|
+
theme: null,
|
|
468
|
+
arrow: false,
|
|
469
|
+
animation: 'scale',
|
|
470
|
+
trigger: 'mouseenter',
|
|
471
|
+
offset: [0, 5]
|
|
472
|
+
};
|
|
473
|
+
const popperVariation = {
|
|
474
|
+
theme: 'light',
|
|
475
|
+
arrow: true,
|
|
476
|
+
offset: [0, 10],
|
|
477
|
+
animation: null,
|
|
478
|
+
trigger: 'click',
|
|
479
|
+
interactive: true
|
|
480
|
+
};
|
|
481
|
+
function withContextMenuVariation(baseVariation) {
|
|
482
|
+
return {
|
|
483
|
+
...baseVariation,
|
|
484
|
+
placement: 'right-start',
|
|
485
|
+
trigger: 'manual',
|
|
486
|
+
arrow: false,
|
|
487
|
+
offset: [0, 0]
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
class TippyService {
|
|
492
|
+
constructor(globalConfig, view, injector) {
|
|
493
|
+
this.globalConfig = globalConfig;
|
|
494
|
+
this.view = view;
|
|
495
|
+
this.injector = injector;
|
|
496
|
+
}
|
|
497
|
+
create(host, content, options = {}) {
|
|
498
|
+
const config = {
|
|
499
|
+
onShow: instance => {
|
|
500
|
+
if (!instance.$viewOptions) {
|
|
501
|
+
instance.$viewOptions = {};
|
|
502
|
+
if (isTemplateRef(content)) {
|
|
503
|
+
instance.$viewOptions.context = {
|
|
504
|
+
$implicit: instance.hide.bind(instance),
|
|
505
|
+
...options.context
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
else if (isComponent(content)) {
|
|
509
|
+
instance.context = options.context;
|
|
510
|
+
instance.data = options.data;
|
|
511
|
+
instance.$viewOptions.injector = Injector.create({
|
|
512
|
+
providers: [
|
|
513
|
+
{
|
|
514
|
+
provide: TIPPY_REF,
|
|
515
|
+
useValue: instance
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
parent: options.injector || this.injector
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
instance.view = this.view.createView(content, { ...options, ...instance.$viewOptions });
|
|
523
|
+
instance.setContent(instance.view.getElement());
|
|
524
|
+
options?.onShow?.(instance);
|
|
525
|
+
},
|
|
526
|
+
onHidden: instance => {
|
|
527
|
+
instance.view.destroy();
|
|
528
|
+
options?.onHidden?.(instance);
|
|
529
|
+
instance.view = null;
|
|
530
|
+
},
|
|
531
|
+
...onlyTippyProps(this.globalConfig),
|
|
532
|
+
...this.globalConfig.variations[options.variation || this.globalConfig.defaultVariation],
|
|
533
|
+
...onlyTippyProps(options),
|
|
534
|
+
onCreate: instance => {
|
|
535
|
+
if (options.className) {
|
|
536
|
+
for (const klass of normalizeClassName(options.className)) {
|
|
537
|
+
instance.popper.classList.add(klass);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
this.globalConfig.onCreate?.(instance);
|
|
541
|
+
options.onCreate?.(instance);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
return tippy(host, config);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
TippyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyService, deps: [{ token: TIPPY_CONFIG }, { token: i1.ViewService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
548
|
+
TippyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyService, providedIn: 'root' });
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TippyService, decorators: [{
|
|
550
|
+
type: Injectable,
|
|
551
|
+
args: [{ providedIn: 'root' }]
|
|
552
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
553
|
+
type: Inject,
|
|
554
|
+
args: [TIPPY_CONFIG]
|
|
555
|
+
}] }, { type: i1.ViewService }, { type: i0.Injector }]; } });
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Generated bundle index. Do not edit.
|
|
559
|
+
*/
|
|
560
|
+
|
|
561
|
+
export { TIPPY_CONFIG, TIPPY_REF, TippyDirective, TippyModule, TippyService, inView, overflowChanges, popperVariation, tooltipVariation, withContextMenuVariation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngneat-helipopper.mjs","sources":["../../../../projects/ngneat/helipopper/src/lib/tippy.types.ts","../../../../projects/ngneat/helipopper/src/lib/utils.ts","../../../../projects/ngneat/helipopper/src/lib/tippy.directive.ts","../../../../projects/ngneat/helipopper/src/lib/tippy.module.ts","../../../../projects/ngneat/helipopper/src/lib/defaults.ts","../../../../projects/ngneat/helipopper/src/lib/tippy.service.ts","../../../../projects/ngneat/helipopper/src/ngneat-helipopper.ts"],"sourcesContent":["import { Instance, Props } from 'tippy.js';\nimport { ElementRef, InjectionToken } from '@angular/core';\nimport { ViewOptions } from '@ngneat/overview';\n\nexport interface CreateOptions extends Partial<TippyProps>, ViewOptions {\n variation: string;\n className: string | string[];\n data: any;\n}\n\nexport type NgChanges<Component extends object, Props = ExcludeFunctions<Component>> = {\n [Key in keyof Props]: {\n previousValue: Props[Key];\n currentValue: Props[Key];\n firstChange: boolean;\n isFirstChange(): boolean;\n };\n};\n\ntype MarkFunctionPropertyNames<Component> = {\n [Key in keyof Component]: Component[Key] extends Function ? never : Key;\n}[keyof Component];\n\ntype ExcludeFunctions<T extends object> = Pick<T, MarkFunctionPropertyNames<T>>;\n\nexport const TIPPY_CONFIG = new InjectionToken<Partial<TippyConfig>>('Tippy config', {\n providedIn: 'root',\n factory() {\n return {};\n }\n});\nexport const TIPPY_REF = new InjectionToken<TippyInstance>('TIPPY_REF');\n\nexport interface TippyInstance extends Instance {\n data?: any;\n}\n\nexport type TippyProps = Props;\n\nexport interface TippyConfig extends TippyProps {\n variations: Record<string, Partial<TippyProps>>;\n defaultVariation: keyof TippyConfig['variations'];\n beforeRender?: (text: string) => string;\n}\n\nexport function coerceElement(element: TippyElement) {\n return element instanceof ElementRef ? element.nativeElement : element;\n}\n\nexport type TippyElement = ElementRef | Element;\n","import { Observable } from 'rxjs';\nimport { auditTime, map } from 'rxjs/operators';\nimport { coerceElement, TippyElement } from './tippy.types';\n\ndeclare const ResizeObserver: any;\n\nlet supportsIntersectionObserver = false;\nlet supportsResizeObserver = false;\n\nif (typeof window !== 'undefined') {\n supportsIntersectionObserver = 'IntersectionObserver' in window;\n supportsResizeObserver = 'ResizeObserver' in window;\n}\n\nexport function inView(\n host: TippyElement,\n options: IntersectionObserverInit = {\n root: null,\n threshold: 0.3\n }\n) {\n const element = coerceElement(host);\n\n return new Observable(subscriber => {\n if (!supportsIntersectionObserver) {\n subscriber.next();\n subscriber.complete();\n return;\n }\n\n const observer = new IntersectionObserver(entries => {\n // Several changes may occur in the same tick, we want to check the latest entry state.\n const entry = entries[entries.length - 1];\n if (entry.isIntersecting) {\n subscriber.next();\n subscriber.complete();\n }\n }, options);\n\n observer.observe(element);\n\n return () => observer.disconnect();\n });\n}\n\nfunction isElementOverflow(host: HTMLElement): boolean {\n // Don't access the `offsetWidth` multipe times since it triggers layout updates.\n const hostOffsetWidth = host.offsetWidth;\n return hostOffsetWidth > host.parentElement.offsetWidth || hostOffsetWidth < host.scrollWidth;\n}\n\nexport function overflowChanges(host: TippyElement) {\n const element = coerceElement(host);\n\n return dimensionsChanges(element).pipe(\n auditTime(150),\n map(() => isElementOverflow(element))\n );\n}\n\nexport function dimensionsChanges(target: HTMLElement) {\n return resizeObserverStrategy(target);\n}\n\nfunction resizeObserverStrategy(target: HTMLElement): Observable<boolean> {\n return new Observable(subscriber => {\n if (!supportsResizeObserver) {\n subscriber.next();\n subscriber.complete();\n return;\n }\n\n const observer = new ResizeObserver(() => subscriber.next(true));\n observer.observe(target);\n return () => observer.disconnect();\n });\n}\n\nexport function onlyTippyProps(allProps: any) {\n const tippyProps = {};\n\n const ownProps = [\n 'variations',\n 'useHostWidth',\n 'defaultVariation',\n 'beforeRender',\n 'lazy',\n 'variation',\n 'isEnabled',\n 'className',\n 'onlyTextOverflow',\n 'data',\n 'content',\n 'context',\n 'hideOnEscape',\n 'customHost'\n ];\n\n Object.keys(allProps).forEach(prop => {\n if (!ownProps.includes(prop)) {\n tippyProps[prop] = allProps[prop];\n }\n });\n\n return tippyProps;\n}\n\nexport function normalizeClassName(className: string | string[]): string[] {\n const classes = isString(className) ? className.split(' ') : className;\n\n return classes.map(klass => klass?.trim()).filter(Boolean);\n}\n\nfunction isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n","import {\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n Injector,\n Input,\n NgZone,\n Output,\n PLATFORM_ID,\n ViewContainerRef,\n AfterViewInit,\n OnChanges,\n OnDestroy,\n OnInit\n} from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\nimport tippy from 'tippy.js';\nimport { fromEvent, merge, Subject } from 'rxjs';\nimport { filter, switchMap, takeUntil } from 'rxjs/operators';\nimport { isComponent, isString, isTemplateRef, ViewService, ViewOptions, ViewRef, Content } from '@ngneat/overview';\n\nimport { dimensionsChanges, inView, normalizeClassName, onlyTippyProps, overflowChanges } from './utils';\nimport { NgChanges, TIPPY_CONFIG, TIPPY_REF, TippyConfig, TippyInstance, TippyProps } from './tippy.types';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[tippy]',\n exportAs: 'tippy'\n})\nexport class TippyDirective implements OnChanges, AfterViewInit, OnDestroy, OnInit {\n @Input() appendTo: TippyProps['appendTo'];\n @Input() delay: TippyProps['delay'];\n @Input() duration: TippyProps['duration'];\n @Input() hideOnClick: TippyProps['hideOnClick'];\n @Input() interactive: TippyProps['interactive'];\n @Input() interactiveBorder: TippyProps['interactiveBorder'];\n @Input() maxWidth: TippyProps['maxWidth'];\n @Input() offset: TippyProps['offset'];\n @Input() placement: TippyProps['placement'];\n @Input() popperOptions: TippyProps['popperOptions'];\n @Input() showOnCreate: TippyProps['showOnCreate'];\n @Input() trigger: TippyProps['trigger'];\n @Input() triggerTarget: TippyProps['triggerTarget'];\n @Input() zIndex: TippyProps['zIndex'];\n\n @Input() lazy: boolean;\n @Input() variation: string;\n @Input() isEnabled: boolean;\n @Input() className: string | string[];\n @Input() onlyTextOverflow = false;\n @Input() data: any;\n @Input() useHostWidth = false;\n @Input() hideOnEscape = false;\n @Input('tippy') content: Content;\n @Input('tippyHost') customHost: HTMLElement;\n\n @Output() visible = new EventEmitter<boolean>();\n @Input() public isVisible = false;\n\n private instance: TippyInstance;\n private viewRef: ViewRef;\n private destroyed = new Subject<void>();\n private props: Partial<TippyConfig>;\n private enabled = true;\n private variationDefined = false;\n private viewOptions$: ViewOptions;\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n @Inject(TIPPY_CONFIG) private globalConfig: TippyConfig,\n private injector: Injector,\n private viewService: ViewService,\n private vcr: ViewContainerRef,\n private zone: NgZone,\n private hostRef: ElementRef\n ) {}\n\n ngOnChanges(changes: NgChanges<TippyDirective>) {\n if (isPlatformServer(this.platformId)) return;\n\n let props: Partial<TippyConfig> = Object.keys(changes).reduce((acc, change) => {\n if (change === 'isVisible') return acc;\n\n acc[change] = changes[change].currentValue;\n\n return acc;\n }, {});\n\n let variation: string;\n\n if (isChanged<NgChanges<TippyDirective>>('variation', changes)) {\n variation = changes.variation.currentValue;\n this.variationDefined = true;\n } else if (!this.variationDefined) {\n variation = this.globalConfig.defaultVariation;\n this.variationDefined = true;\n }\n\n if (variation) {\n props = {\n ...this.globalConfig.variations[variation],\n ...props\n };\n }\n\n if (isChanged<NgChanges<TippyDirective>>('isEnabled', changes)) {\n this.enabled = changes.isEnabled.currentValue;\n this.setStatus();\n }\n\n if (isChanged<NgChanges<TippyDirective>>('isVisible', changes)) {\n this.isVisible ? this.show() : this.hide();\n }\n\n this.setProps(props);\n }\n\n ngOnInit() {\n if (this.useHostWidth) {\n this.props.maxWidth = this.hostWidth;\n }\n }\n\n ngAfterViewInit() {\n this.zone.runOutsideAngular(() => {\n if (this.lazy) {\n if (this.onlyTextOverflow) {\n inView(this.host)\n .pipe(\n switchMap(() => overflowChanges(this.host)),\n takeUntil(this.destroyed)\n )\n .subscribe(isElementOverflow => {\n this.checkOverflow(isElementOverflow);\n });\n } else {\n inView(this.host)\n .pipe(takeUntil(this.destroyed))\n .subscribe(() => {\n this.createInstance();\n });\n }\n } else if (this.onlyTextOverflow) {\n overflowChanges(this.host)\n .pipe(takeUntil(this.destroyed))\n .subscribe(isElementOverflow => {\n this.checkOverflow(isElementOverflow);\n });\n } else {\n this.createInstance();\n }\n });\n }\n\n ngOnDestroy() {\n this.destroyed.next();\n this.instance?.destroy();\n this.destroyView();\n }\n\n destroyView() {\n this.viewOptions$ = null;\n this.viewRef?.destroy();\n this.viewRef = null;\n }\n\n show() {\n this.instance?.show();\n }\n\n hide() {\n this.instance?.hide();\n }\n\n enable() {\n this.instance?.enable();\n }\n\n disable() {\n this.instance?.disable();\n }\n\n private setProps(props: Partial<TippyConfig>) {\n this.props = props;\n this.instance?.setProps(onlyTippyProps(props));\n }\n\n private setStatus() {\n this.enabled ? this.instance?.enable() : this.instance?.disable();\n }\n\n private get host(): HTMLElement {\n return this.customHost || this.hostRef.nativeElement;\n }\n\n private get hostWidth(): string {\n return `${this.host.getBoundingClientRect().width}px`;\n }\n\n private createInstance() {\n if (this.content == null) {\n return;\n }\n\n this.zone.runOutsideAngular(() => {\n this.instance = tippy(this.host, {\n allowHTML: true,\n appendTo: document.body,\n ...onlyTippyProps(this.globalConfig),\n ...onlyTippyProps(this.props),\n onMount: instance => {\n this.isVisible = true;\n this.visible.next(true);\n this.useHostWidth && this.listenToHostResize();\n this.globalConfig.onMount?.(instance);\n },\n onCreate: instance => {\n if (this.className) {\n for (const klass of normalizeClassName(this.className)) {\n instance.popper.classList.add(klass);\n }\n }\n this.globalConfig.onCreate?.(instance);\n if (this.isVisible === true) {\n instance.show();\n }\n },\n onShow: instance => {\n this.zone.run(() => {\n const content = this.resolveContent();\n if (isString(content)) {\n instance.setProps({ allowHTML: false });\n }\n instance.setContent(content);\n this.hideOnEscape && this.handleEscapeButton();\n });\n if (this.useHostWidth) {\n // Don't access `hostWidth` multiple times since it's a getter that calls `getBoundingClientRect()`,\n // which triggers the whole layout update.\n const hostWidth = this.hostWidth;\n instance.popper.style.width = hostWidth;\n instance.popper.style.maxWidth = hostWidth;\n (instance.popper.firstElementChild as HTMLElement).style.maxWidth = hostWidth;\n }\n this.globalConfig.onShow?.(instance);\n },\n onHidden: instance => {\n this.destroyView();\n this.isVisible = false;\n this.visible.next(false);\n this.globalConfig.onHidden?.(instance);\n }\n });\n\n this.setStatus();\n this.setProps(this.props);\n\n this.variation === 'contextMenu' && this.handleContextMenu();\n });\n }\n\n private resolveContent() {\n if (!this.viewOptions$ && !isString(this.content)) {\n if (isComponent(this.content)) {\n this.instance.data = this.data;\n this.viewOptions$ = {\n injector: Injector.create({\n providers: [\n {\n provide: TIPPY_REF,\n useValue: this.instance\n }\n ],\n parent: this.injector\n })\n };\n } else if (isTemplateRef(this.content)) {\n this.viewOptions$ = {\n context: {\n $implicit: this.hide.bind(this),\n data: this.data\n }\n };\n }\n }\n\n this.viewRef = this.viewService.createView(this.content, {\n vcr: this.vcr,\n ...this.viewOptions$\n });\n\n let content = this.viewRef.getElement();\n\n if (isString(content) && this.globalConfig.beforeRender) {\n content = this.globalConfig.beforeRender(content);\n }\n\n return content;\n }\n\n private handleContextMenu() {\n fromEvent(this.host, 'contextmenu')\n .pipe(takeUntil(this.destroyed))\n .subscribe((event: MouseEvent) => {\n event.preventDefault();\n\n this.instance.setProps({\n getReferenceClientRect: () =>\n ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX\n } as any)\n });\n\n this.instance.show();\n });\n }\n\n private handleEscapeButton() {\n this.pressButton$(document.body, 'Escape')\n .pipe(takeUntil(merge(this.destroyed, this.visible.pipe(filter(v => !v)))))\n .subscribe(() => this.hide());\n }\n\n private pressButton$(element: HTMLElement, codeButton: string) {\n return fromEvent(element, 'keydown').pipe(filter(({ code }: KeyboardEvent) => codeButton === code));\n }\n\n private checkOverflow(isElementOverflow: boolean) {\n if (isElementOverflow) {\n if (!this.instance) {\n this.createInstance();\n } else {\n this.instance.enable();\n }\n } else {\n this.instance?.disable();\n }\n }\n\n private listenToHostResize() {\n dimensionsChanges(this.host)\n .pipe(takeUntil(merge(this.destroyed, this.visible)))\n .subscribe(() => {\n this.instance.popper.style.width = this.hostWidth;\n });\n }\n}\n\nfunction isChanged<T>(key: keyof T, changes: T) {\n return key in changes;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { TippyDirective } from './tippy.directive';\nimport { TIPPY_CONFIG, TippyConfig } from './tippy.types';\n\n@NgModule({\n declarations: [TippyDirective],\n exports: [TippyDirective]\n})\nexport class TippyModule {\n static forRoot(config: Partial<TippyConfig> = {}): ModuleWithProviders<TippyModule> {\n return {\n ngModule: TippyModule,\n providers: [\n {\n provide: TIPPY_CONFIG,\n useValue: config\n }\n ]\n };\n }\n}\n","import { TippyConfig } from './tippy.types';\n\ntype Variation = TippyConfig['variations'][0];\n\nexport const tooltipVariation: Variation = {\n theme: null,\n arrow: false,\n animation: 'scale',\n trigger: 'mouseenter',\n offset: [0, 5]\n};\n\nexport const popperVariation: Variation = {\n theme: 'light',\n arrow: true,\n offset: [0, 10],\n animation: null,\n trigger: 'click',\n interactive: true\n};\n\nexport function withContextMenuVariation(baseVariation: Variation): Variation {\n return {\n ...baseVariation,\n placement: 'right-start',\n trigger: 'manual',\n arrow: false,\n offset: [0, 0]\n };\n}\n","import { Inject, Injectable, Injector } from '@angular/core';\nimport tippy from 'tippy.js';\nimport { isComponent, isTemplateRef, ViewService } from '@ngneat/overview';\nimport { Content } from '@ngneat/overview';\nimport { CreateOptions, TIPPY_CONFIG, TIPPY_REF, TippyConfig, TippyInstance } from './tippy.types';\nimport { normalizeClassName, onlyTippyProps } from './utils';\n\n@Injectable({ providedIn: 'root' })\nexport class TippyService {\n constructor(\n @Inject(TIPPY_CONFIG) private globalConfig: TippyConfig,\n private view: ViewService,\n private injector: Injector\n ) {}\n\n create(host: Element, content: Content, options: Partial<CreateOptions> = {}): TippyInstance {\n const config = {\n onShow: instance => {\n if (!instance.$viewOptions) {\n instance.$viewOptions = {};\n\n if (isTemplateRef(content)) {\n instance.$viewOptions.context = {\n $implicit: instance.hide.bind(instance),\n ...options.context\n };\n } else if (isComponent(content)) {\n instance.context = options.context;\n instance.data = options.data;\n instance.$viewOptions.injector = Injector.create({\n providers: [\n {\n provide: TIPPY_REF,\n useValue: instance\n }\n ],\n parent: options.injector || this.injector\n });\n }\n }\n instance.view = this.view.createView(content, { ...options, ...instance.$viewOptions });\n instance.setContent(instance.view.getElement());\n options?.onShow?.(instance);\n },\n onHidden: instance => {\n instance.view.destroy();\n options?.onHidden?.(instance);\n instance.view = null;\n },\n ...onlyTippyProps(this.globalConfig),\n ...this.globalConfig.variations[options.variation || this.globalConfig.defaultVariation],\n ...onlyTippyProps(options),\n onCreate: instance => {\n if (options.className) {\n for (const klass of normalizeClassName(options.className)) {\n instance.popper.classList.add(klass);\n }\n }\n this.globalConfig.onCreate?.(instance);\n options.onCreate?.(instance);\n }\n };\n\n return tippy(host, config);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isString"],"mappings":";;;;;;;;;MAyBa,YAAY,GAAG,IAAI,cAAc,CAAuB,cAAc,EAAE;IACnF,UAAU,EAAE,MAAM;IAClB,OAAO;QACL,OAAO,EAAE,CAAC;KACX;CACF,EAAE;MACU,SAAS,GAAG,IAAI,cAAc,CAAgB,WAAW,EAAE;SAcxD,aAAa,CAAC,OAAqB;IACjD,OAAO,OAAO,YAAY,UAAU,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;AACzE;;ACzCA,IAAI,4BAA4B,GAAG,KAAK,CAAC;AACzC,IAAI,sBAAsB,GAAG,KAAK,CAAC;AAEnC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,4BAA4B,GAAG,sBAAsB,IAAI,MAAM,CAAC;IAChE,sBAAsB,GAAG,gBAAgB,IAAI,MAAM,CAAC;CACrD;SAEe,MAAM,CACpB,IAAkB,EAClB,UAAoC;IAClC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,GAAG;CACf;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO,IAAI,UAAU,CAAC,UAAU;QAC9B,IAAI,CAAC,4BAA4B,EAAE;YACjC,UAAU,CAAC,IAAI,EAAE,CAAC;YAClB,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CAAC,OAAO;;YAE/C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC1C,IAAI,KAAK,CAAC,cAAc,EAAE;gBACxB,UAAU,CAAC,IAAI,EAAE,CAAC;gBAClB,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;SACF,EAAE,OAA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GAAG,QAAQ,CAAC,CAAC;gBACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;aAC9B;SACF,CAAC;QAEF,OAAO,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC5B;;yGAxDU,YAAY,kBAEb,YAAY;6GAFX,YAAY,cADC,MAAM;2FACnB,YAAY;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAG7B,MAAM;2BAAC,YAAY;;;ACVxB;;;;;;"}
|
package/lib/tippy.directive.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElementRef, EventEmitter, Injector, NgZone, ViewContainerRef, AfterViewInit, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ViewService, Content } from '@ngneat/overview';
|
|
3
3
|
import { NgChanges, TippyConfig, TippyProps } from './tippy.types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class TippyDirective implements OnChanges, AfterViewInit, OnDestroy, OnInit {
|
|
5
6
|
private platformId;
|
|
6
7
|
private globalConfig;
|
|
@@ -63,4 +64,6 @@ export declare class TippyDirective implements OnChanges, AfterViewInit, OnDestr
|
|
|
63
64
|
private pressButton$;
|
|
64
65
|
private checkOverflow;
|
|
65
66
|
private listenToHostResize;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TippyDirective, never>;
|
|
68
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TippyDirective, "[tippy]", ["tippy"], { "appendTo": "appendTo"; "delay": "delay"; "duration": "duration"; "hideOnClick": "hideOnClick"; "interactive": "interactive"; "interactiveBorder": "interactiveBorder"; "maxWidth": "maxWidth"; "offset": "offset"; "placement": "placement"; "popperOptions": "popperOptions"; "showOnCreate": "showOnCreate"; "trigger": "trigger"; "triggerTarget": "triggerTarget"; "zIndex": "zIndex"; "lazy": "lazy"; "variation": "variation"; "isEnabled": "isEnabled"; "className": "className"; "onlyTextOverflow": "onlyTextOverflow"; "data": "data"; "useHostWidth": "useHostWidth"; "hideOnEscape": "hideOnEscape"; "content": "tippy"; "customHost": "tippyHost"; "isVisible": "isVisible"; }, { "visible": "visible"; }, never>;
|
|
66
69
|
}
|
package/lib/tippy.module.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { TippyConfig } from './tippy.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./tippy.directive";
|
|
3
5
|
export declare class TippyModule {
|
|
4
6
|
static forRoot(config?: Partial<TippyConfig>): ModuleWithProviders<TippyModule>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TippyModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TippyModule, [typeof i1.TippyDirective], never, [typeof i1.TippyDirective]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TippyModule>;
|
|
5
10
|
}
|