@ngneat/helipopper 4.3.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 +1 -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/{esm2015/lib/tippy.types.js → esm2020/lib/tippy.types.mjs} +0 -0
- package/{esm2015/lib/utils.js → esm2020/lib/utils.mjs} +2 -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} +96 -63
- 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/ngneat-helipopper.d.ts +1 -1
- package/package.json +23 -11
- package/bundles/ngneat-helipopper.umd.js +0 -912
- package/bundles/ngneat-helipopper.umd.js.map +0 -1
- package/esm2015/lib/defaults.js +0 -19
- package/esm2015/lib/tippy.directive.js +0 -315
- package/esm2015/lib/tippy.module.js +0 -23
- package/esm2015/lib/tippy.service.js +0 -67
- 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
|
@@ -1,912 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('tippy.js'), require('rxjs'), require('rxjs/operators'), require('@ngneat/overview')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@ngneat/helipopper', ['exports', '@angular/core', '@angular/common', 'tippy.js', 'rxjs', 'rxjs/operators', '@ngneat/overview'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngneat = global.ngneat || {}, global.ngneat.helipopper = {}), global.ng.core, global.ng.common, global.tippy, global.rxjs, global.rxjs.operators, global.ngneatOverview));
|
|
5
|
-
}(this, (function (exports, i0, common, tippy, rxjs, operators, i2) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return e[k];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
n['default'] = e;
|
|
26
|
-
return Object.freeze(n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
|
-
var tippy__default = /*#__PURE__*/_interopDefaultLegacy(tippy);
|
|
31
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
32
|
-
|
|
33
|
-
/*! *****************************************************************************
|
|
34
|
-
Copyright (c) Microsoft Corporation.
|
|
35
|
-
|
|
36
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
-
purpose with or without fee is hereby granted.
|
|
38
|
-
|
|
39
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
40
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
43
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
-
***************************************************************************** */
|
|
47
|
-
/* global Reflect, Promise */
|
|
48
|
-
var extendStatics = function (d, b) {
|
|
49
|
-
extendStatics = Object.setPrototypeOf ||
|
|
50
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
51
|
-
function (d, b) { for (var p in b)
|
|
52
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
53
|
-
d[p] = b[p]; };
|
|
54
|
-
return extendStatics(d, b);
|
|
55
|
-
};
|
|
56
|
-
function __extends(d, b) {
|
|
57
|
-
if (typeof b !== "function" && b !== null)
|
|
58
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
59
|
-
extendStatics(d, b);
|
|
60
|
-
function __() { this.constructor = d; }
|
|
61
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
62
|
-
}
|
|
63
|
-
var __assign = function () {
|
|
64
|
-
__assign = Object.assign || function __assign(t) {
|
|
65
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
66
|
-
s = arguments[i];
|
|
67
|
-
for (var p in s)
|
|
68
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
69
|
-
t[p] = s[p];
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
};
|
|
73
|
-
return __assign.apply(this, arguments);
|
|
74
|
-
};
|
|
75
|
-
function __rest(s, e) {
|
|
76
|
-
var t = {};
|
|
77
|
-
for (var p in s)
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
79
|
-
t[p] = s[p];
|
|
80
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
81
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
82
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
83
|
-
t[p[i]] = s[p[i]];
|
|
84
|
-
}
|
|
85
|
-
return t;
|
|
86
|
-
}
|
|
87
|
-
function __decorate(decorators, target, key, desc) {
|
|
88
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
89
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
90
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
91
|
-
else
|
|
92
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
93
|
-
if (d = decorators[i])
|
|
94
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
95
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
96
|
-
}
|
|
97
|
-
function __param(paramIndex, decorator) {
|
|
98
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
99
|
-
}
|
|
100
|
-
function __metadata(metadataKey, metadataValue) {
|
|
101
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
102
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
103
|
-
}
|
|
104
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
105
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
106
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
107
|
-
function fulfilled(value) { try {
|
|
108
|
-
step(generator.next(value));
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
reject(e);
|
|
112
|
-
} }
|
|
113
|
-
function rejected(value) { try {
|
|
114
|
-
step(generator["throw"](value));
|
|
115
|
-
}
|
|
116
|
-
catch (e) {
|
|
117
|
-
reject(e);
|
|
118
|
-
} }
|
|
119
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
120
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function __generator(thisArg, body) {
|
|
124
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
125
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
126
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
127
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
128
|
-
function step(op) {
|
|
129
|
-
if (f)
|
|
130
|
-
throw new TypeError("Generator is already executing.");
|
|
131
|
-
while (_)
|
|
132
|
-
try {
|
|
133
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
134
|
-
return t;
|
|
135
|
-
if (y = 0, t)
|
|
136
|
-
op = [op[0] & 2, t.value];
|
|
137
|
-
switch (op[0]) {
|
|
138
|
-
case 0:
|
|
139
|
-
case 1:
|
|
140
|
-
t = op;
|
|
141
|
-
break;
|
|
142
|
-
case 4:
|
|
143
|
-
_.label++;
|
|
144
|
-
return { value: op[1], done: false };
|
|
145
|
-
case 5:
|
|
146
|
-
_.label++;
|
|
147
|
-
y = op[1];
|
|
148
|
-
op = [0];
|
|
149
|
-
continue;
|
|
150
|
-
case 7:
|
|
151
|
-
op = _.ops.pop();
|
|
152
|
-
_.trys.pop();
|
|
153
|
-
continue;
|
|
154
|
-
default:
|
|
155
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
156
|
-
_ = 0;
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
160
|
-
_.label = op[1];
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
164
|
-
_.label = t[1];
|
|
165
|
-
t = op;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
if (t && _.label < t[2]) {
|
|
169
|
-
_.label = t[2];
|
|
170
|
-
_.ops.push(op);
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
if (t[2])
|
|
174
|
-
_.ops.pop();
|
|
175
|
-
_.trys.pop();
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
op = body.call(thisArg, _);
|
|
179
|
-
}
|
|
180
|
-
catch (e) {
|
|
181
|
-
op = [6, e];
|
|
182
|
-
y = 0;
|
|
183
|
-
}
|
|
184
|
-
finally {
|
|
185
|
-
f = t = 0;
|
|
186
|
-
}
|
|
187
|
-
if (op[0] & 5)
|
|
188
|
-
throw op[1];
|
|
189
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
193
|
-
if (k2 === undefined)
|
|
194
|
-
k2 = k;
|
|
195
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
196
|
-
}) : (function (o, m, k, k2) {
|
|
197
|
-
if (k2 === undefined)
|
|
198
|
-
k2 = k;
|
|
199
|
-
o[k2] = m[k];
|
|
200
|
-
});
|
|
201
|
-
function __exportStar(m, o) {
|
|
202
|
-
for (var p in m)
|
|
203
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
204
|
-
__createBinding(o, m, p);
|
|
205
|
-
}
|
|
206
|
-
function __values(o) {
|
|
207
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
208
|
-
if (m)
|
|
209
|
-
return m.call(o);
|
|
210
|
-
if (o && typeof o.length === "number")
|
|
211
|
-
return {
|
|
212
|
-
next: function () {
|
|
213
|
-
if (o && i >= o.length)
|
|
214
|
-
o = void 0;
|
|
215
|
-
return { value: o && o[i++], done: !o };
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
219
|
-
}
|
|
220
|
-
function __read(o, n) {
|
|
221
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
222
|
-
if (!m)
|
|
223
|
-
return o;
|
|
224
|
-
var i = m.call(o), r, ar = [], e;
|
|
225
|
-
try {
|
|
226
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
227
|
-
ar.push(r.value);
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
e = { error: error };
|
|
231
|
-
}
|
|
232
|
-
finally {
|
|
233
|
-
try {
|
|
234
|
-
if (r && !r.done && (m = i["return"]))
|
|
235
|
-
m.call(i);
|
|
236
|
-
}
|
|
237
|
-
finally {
|
|
238
|
-
if (e)
|
|
239
|
-
throw e.error;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return ar;
|
|
243
|
-
}
|
|
244
|
-
/** @deprecated */
|
|
245
|
-
function __spread() {
|
|
246
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
247
|
-
ar = ar.concat(__read(arguments[i]));
|
|
248
|
-
return ar;
|
|
249
|
-
}
|
|
250
|
-
/** @deprecated */
|
|
251
|
-
function __spreadArrays() {
|
|
252
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
253
|
-
s += arguments[i].length;
|
|
254
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
255
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
256
|
-
r[k] = a[j];
|
|
257
|
-
return r;
|
|
258
|
-
}
|
|
259
|
-
function __spreadArray(to, from) {
|
|
260
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
261
|
-
to[j] = from[i];
|
|
262
|
-
return to;
|
|
263
|
-
}
|
|
264
|
-
function __await(v) {
|
|
265
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
266
|
-
}
|
|
267
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
268
|
-
if (!Symbol.asyncIterator)
|
|
269
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
270
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
271
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
272
|
-
function verb(n) { if (g[n])
|
|
273
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
274
|
-
function resume(n, v) { try {
|
|
275
|
-
step(g[n](v));
|
|
276
|
-
}
|
|
277
|
-
catch (e) {
|
|
278
|
-
settle(q[0][3], e);
|
|
279
|
-
} }
|
|
280
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
281
|
-
function fulfill(value) { resume("next", value); }
|
|
282
|
-
function reject(value) { resume("throw", value); }
|
|
283
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
284
|
-
resume(q[0][0], q[0][1]); }
|
|
285
|
-
}
|
|
286
|
-
function __asyncDelegator(o) {
|
|
287
|
-
var i, p;
|
|
288
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
289
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
290
|
-
}
|
|
291
|
-
function __asyncValues(o) {
|
|
292
|
-
if (!Symbol.asyncIterator)
|
|
293
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
294
|
-
var m = o[Symbol.asyncIterator], i;
|
|
295
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
296
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
297
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
298
|
-
}
|
|
299
|
-
function __makeTemplateObject(cooked, raw) {
|
|
300
|
-
if (Object.defineProperty) {
|
|
301
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
cooked.raw = raw;
|
|
305
|
-
}
|
|
306
|
-
return cooked;
|
|
307
|
-
}
|
|
308
|
-
;
|
|
309
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
310
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
311
|
-
}) : function (o, v) {
|
|
312
|
-
o["default"] = v;
|
|
313
|
-
};
|
|
314
|
-
function __importStar(mod) {
|
|
315
|
-
if (mod && mod.__esModule)
|
|
316
|
-
return mod;
|
|
317
|
-
var result = {};
|
|
318
|
-
if (mod != null)
|
|
319
|
-
for (var k in mod)
|
|
320
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
321
|
-
__createBinding(result, mod, k);
|
|
322
|
-
__setModuleDefault(result, mod);
|
|
323
|
-
return result;
|
|
324
|
-
}
|
|
325
|
-
function __importDefault(mod) {
|
|
326
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
327
|
-
}
|
|
328
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
329
|
-
if (kind === "a" && !f)
|
|
330
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
331
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
332
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
333
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
334
|
-
}
|
|
335
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
336
|
-
if (kind === "m")
|
|
337
|
-
throw new TypeError("Private method is not writable");
|
|
338
|
-
if (kind === "a" && !f)
|
|
339
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
340
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
341
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
342
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
var TIPPY_CONFIG = new i0.InjectionToken('Tippy config', {
|
|
346
|
-
providedIn: 'root',
|
|
347
|
-
factory: function () {
|
|
348
|
-
return {};
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
var TIPPY_REF = new i0.InjectionToken('TIPPY_REF');
|
|
352
|
-
function coerceElement(element) {
|
|
353
|
-
return element instanceof i0.ElementRef ? element.nativeElement : element;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
var supportsIntersectionObserver = false;
|
|
357
|
-
var supportsResizeObserver = false;
|
|
358
|
-
if (typeof window !== 'undefined') {
|
|
359
|
-
supportsIntersectionObserver = 'IntersectionObserver' in window;
|
|
360
|
-
supportsResizeObserver = 'ResizeObserver' in window;
|
|
361
|
-
}
|
|
362
|
-
function inView(host, options) {
|
|
363
|
-
if (options === void 0) { options = {
|
|
364
|
-
root: null,
|
|
365
|
-
threshold: 0.3
|
|
366
|
-
}; }
|
|
367
|
-
var element = coerceElement(host);
|
|
368
|
-
return new rxjs.Observable(function (subscriber) {
|
|
369
|
-
if (!supportsIntersectionObserver) {
|
|
370
|
-
subscriber.next();
|
|
371
|
-
subscriber.complete();
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
var observer = new IntersectionObserver(function (entries) {
|
|
375
|
-
// Several changes may occur in the same tick, we want to check the latest entry state.
|
|
376
|
-
var entry = entries[entries.length - 1];
|
|
377
|
-
if (entry.isIntersecting) {
|
|
378
|
-
subscriber.next();
|
|
379
|
-
subscriber.complete();
|
|
380
|
-
}
|
|
381
|
-
}, options);
|
|
382
|
-
observer.observe(element);
|
|
383
|
-
return function () { return observer.disconnect(); };
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
function isElementOverflow(host) {
|
|
387
|
-
// Don't access the `offsetWidth` multipe times since it triggers layout updates.
|
|
388
|
-
var hostOffsetWidth = host.offsetWidth;
|
|
389
|
-
return hostOffsetWidth > host.parentElement.offsetWidth || hostOffsetWidth < host.scrollWidth;
|
|
390
|
-
}
|
|
391
|
-
function overflowChanges(host) {
|
|
392
|
-
var element = coerceElement(host);
|
|
393
|
-
return dimensionsChanges(element).pipe(operators.auditTime(150), operators.map(function () { return isElementOverflow(element); }));
|
|
394
|
-
}
|
|
395
|
-
function dimensionsChanges(target) {
|
|
396
|
-
return resizeObserverStrategy(target);
|
|
397
|
-
}
|
|
398
|
-
function resizeObserverStrategy(target) {
|
|
399
|
-
return new rxjs.Observable(function (subscriber) {
|
|
400
|
-
if (!supportsResizeObserver) {
|
|
401
|
-
subscriber.next();
|
|
402
|
-
subscriber.complete();
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
var observer = new ResizeObserver(function () { return subscriber.next(true); });
|
|
406
|
-
observer.observe(target);
|
|
407
|
-
return function () { return observer.disconnect(); };
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
function onlyTippyProps(allProps) {
|
|
411
|
-
var tippyProps = {};
|
|
412
|
-
var ownProps = [
|
|
413
|
-
'variations',
|
|
414
|
-
'useHostWidth',
|
|
415
|
-
'defaultVariation',
|
|
416
|
-
'beforeRender',
|
|
417
|
-
'lazy',
|
|
418
|
-
'variation',
|
|
419
|
-
'isEnabled',
|
|
420
|
-
'className',
|
|
421
|
-
'onlyTextOverflow',
|
|
422
|
-
'data',
|
|
423
|
-
'content',
|
|
424
|
-
'context',
|
|
425
|
-
'hideOnEscape',
|
|
426
|
-
'customHost'
|
|
427
|
-
];
|
|
428
|
-
Object.keys(allProps).forEach(function (prop) {
|
|
429
|
-
if (!ownProps.includes(prop)) {
|
|
430
|
-
tippyProps[prop] = allProps[prop];
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
return tippyProps;
|
|
434
|
-
}
|
|
435
|
-
function normalizeClassName(className) {
|
|
436
|
-
var classes = isString(className) ? className.split(' ') : className;
|
|
437
|
-
return classes.map(function (klass) { return klass === null || klass === void 0 ? void 0 : klass.trim(); }).filter(Boolean);
|
|
438
|
-
}
|
|
439
|
-
function isString(value) {
|
|
440
|
-
return typeof value === 'string';
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
var TippyDirective = /** @class */ (function () {
|
|
444
|
-
function TippyDirective(platformId, globalConfig, injector, viewService, vcr, zone, hostRef) {
|
|
445
|
-
this.platformId = platformId;
|
|
446
|
-
this.globalConfig = globalConfig;
|
|
447
|
-
this.injector = injector;
|
|
448
|
-
this.viewService = viewService;
|
|
449
|
-
this.vcr = vcr;
|
|
450
|
-
this.zone = zone;
|
|
451
|
-
this.hostRef = hostRef;
|
|
452
|
-
this.onlyTextOverflow = false;
|
|
453
|
-
this.useHostWidth = false;
|
|
454
|
-
this.hideOnEscape = false;
|
|
455
|
-
this.visible = new i0.EventEmitter();
|
|
456
|
-
this.isVisible = false;
|
|
457
|
-
this.destroyed = new rxjs.Subject();
|
|
458
|
-
this.enabled = true;
|
|
459
|
-
this.variationDefined = false;
|
|
460
|
-
}
|
|
461
|
-
TippyDirective.prototype.ngOnChanges = function (changes) {
|
|
462
|
-
if (common.isPlatformServer(this.platformId))
|
|
463
|
-
return;
|
|
464
|
-
var props = Object.keys(changes).reduce(function (acc, change) {
|
|
465
|
-
if (change === 'isVisible')
|
|
466
|
-
return acc;
|
|
467
|
-
acc[change] = changes[change].currentValue;
|
|
468
|
-
return acc;
|
|
469
|
-
}, {});
|
|
470
|
-
var variation;
|
|
471
|
-
if (isChanged('variation', changes)) {
|
|
472
|
-
variation = changes.variation.currentValue;
|
|
473
|
-
this.variationDefined = true;
|
|
474
|
-
}
|
|
475
|
-
else if (!this.variationDefined) {
|
|
476
|
-
variation = this.globalConfig.defaultVariation;
|
|
477
|
-
this.variationDefined = true;
|
|
478
|
-
}
|
|
479
|
-
if (variation) {
|
|
480
|
-
props = Object.assign(Object.assign({}, this.globalConfig.variations[variation]), props);
|
|
481
|
-
}
|
|
482
|
-
if (isChanged('isEnabled', changes)) {
|
|
483
|
-
this.enabled = changes.isEnabled.currentValue;
|
|
484
|
-
this.setStatus();
|
|
485
|
-
}
|
|
486
|
-
if (isChanged('isVisible', changes)) {
|
|
487
|
-
this.isVisible ? this.show() : this.hide();
|
|
488
|
-
}
|
|
489
|
-
this.setProps(props);
|
|
490
|
-
};
|
|
491
|
-
TippyDirective.prototype.ngOnInit = function () {
|
|
492
|
-
if (this.useHostWidth) {
|
|
493
|
-
this.props.maxWidth = this.hostWidth;
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
TippyDirective.prototype.ngAfterViewInit = function () {
|
|
497
|
-
var _this = this;
|
|
498
|
-
this.zone.runOutsideAngular(function () {
|
|
499
|
-
if (_this.lazy) {
|
|
500
|
-
if (_this.onlyTextOverflow) {
|
|
501
|
-
inView(_this.host)
|
|
502
|
-
.pipe(operators.switchMap(function () { return overflowChanges(_this.host); }), operators.takeUntil(_this.destroyed))
|
|
503
|
-
.subscribe(function (isElementOverflow) {
|
|
504
|
-
_this.checkOverflow(isElementOverflow);
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
inView(_this.host)
|
|
509
|
-
.pipe(operators.takeUntil(_this.destroyed))
|
|
510
|
-
.subscribe(function () {
|
|
511
|
-
_this.createInstance();
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
else if (_this.onlyTextOverflow) {
|
|
516
|
-
overflowChanges(_this.host)
|
|
517
|
-
.pipe(operators.takeUntil(_this.destroyed))
|
|
518
|
-
.subscribe(function (isElementOverflow) {
|
|
519
|
-
_this.checkOverflow(isElementOverflow);
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
_this.createInstance();
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
};
|
|
527
|
-
TippyDirective.prototype.ngOnDestroy = function () {
|
|
528
|
-
var _a;
|
|
529
|
-
this.destroyed.next();
|
|
530
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
531
|
-
this.destroyView();
|
|
532
|
-
};
|
|
533
|
-
TippyDirective.prototype.destroyView = function () {
|
|
534
|
-
var _a;
|
|
535
|
-
this.viewOptions$ = null;
|
|
536
|
-
(_a = this.viewRef) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
537
|
-
this.viewRef = null;
|
|
538
|
-
};
|
|
539
|
-
TippyDirective.prototype.show = function () {
|
|
540
|
-
var _a;
|
|
541
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.show();
|
|
542
|
-
};
|
|
543
|
-
TippyDirective.prototype.hide = function () {
|
|
544
|
-
var _a;
|
|
545
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.hide();
|
|
546
|
-
};
|
|
547
|
-
TippyDirective.prototype.enable = function () {
|
|
548
|
-
var _a;
|
|
549
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.enable();
|
|
550
|
-
};
|
|
551
|
-
TippyDirective.prototype.disable = function () {
|
|
552
|
-
var _a;
|
|
553
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.disable();
|
|
554
|
-
};
|
|
555
|
-
TippyDirective.prototype.setProps = function (props) {
|
|
556
|
-
var _a;
|
|
557
|
-
this.props = props;
|
|
558
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.setProps(onlyTippyProps(props));
|
|
559
|
-
};
|
|
560
|
-
TippyDirective.prototype.setStatus = function () {
|
|
561
|
-
var _a, _b;
|
|
562
|
-
this.enabled ? (_a = this.instance) === null || _a === void 0 ? void 0 : _a.enable() : (_b = this.instance) === null || _b === void 0 ? void 0 : _b.disable();
|
|
563
|
-
};
|
|
564
|
-
Object.defineProperty(TippyDirective.prototype, "host", {
|
|
565
|
-
get: function () {
|
|
566
|
-
return this.customHost || this.hostRef.nativeElement;
|
|
567
|
-
},
|
|
568
|
-
enumerable: false,
|
|
569
|
-
configurable: true
|
|
570
|
-
});
|
|
571
|
-
Object.defineProperty(TippyDirective.prototype, "hostWidth", {
|
|
572
|
-
get: function () {
|
|
573
|
-
return this.host.getBoundingClientRect().width + "px";
|
|
574
|
-
},
|
|
575
|
-
enumerable: false,
|
|
576
|
-
configurable: true
|
|
577
|
-
});
|
|
578
|
-
TippyDirective.prototype.createInstance = function () {
|
|
579
|
-
var _this = this;
|
|
580
|
-
if (this.content == null) {
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
this.zone.runOutsideAngular(function () {
|
|
584
|
-
_this.instance = tippy__default['default'](_this.host, Object.assign(Object.assign(Object.assign({ allowHTML: true, appendTo: document.body }, onlyTippyProps(_this.globalConfig)), onlyTippyProps(_this.props)), { onMount: function (instance) {
|
|
585
|
-
var _a, _b;
|
|
586
|
-
_this.isVisible = true;
|
|
587
|
-
_this.visible.next(true);
|
|
588
|
-
_this.useHostWidth && _this.listenToHostResize();
|
|
589
|
-
(_b = (_a = _this.globalConfig).onMount) === null || _b === void 0 ? void 0 : _b.call(_a, instance);
|
|
590
|
-
}, onCreate: function (instance) {
|
|
591
|
-
var e_1, _c;
|
|
592
|
-
var _a, _b;
|
|
593
|
-
if (_this.className) {
|
|
594
|
-
try {
|
|
595
|
-
for (var _d = __values(normalizeClassName(_this.className)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
596
|
-
var klass = _e.value;
|
|
597
|
-
instance.popper.classList.add(klass);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
601
|
-
finally {
|
|
602
|
-
try {
|
|
603
|
-
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
604
|
-
}
|
|
605
|
-
finally { if (e_1) throw e_1.error; }
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
(_b = (_a = _this.globalConfig).onCreate) === null || _b === void 0 ? void 0 : _b.call(_a, instance);
|
|
609
|
-
if (_this.isVisible === true) {
|
|
610
|
-
instance.show();
|
|
611
|
-
}
|
|
612
|
-
}, onShow: function (instance) {
|
|
613
|
-
var _a, _b;
|
|
614
|
-
_this.zone.run(function () {
|
|
615
|
-
var content = _this.resolveContent();
|
|
616
|
-
if (i2.isString(content)) {
|
|
617
|
-
instance.setProps({ allowHTML: false });
|
|
618
|
-
}
|
|
619
|
-
instance.setContent(content);
|
|
620
|
-
_this.hideOnEscape && _this.handleEscapeButton();
|
|
621
|
-
});
|
|
622
|
-
if (_this.useHostWidth) {
|
|
623
|
-
// Don't access `hostWidth` multiple times since it's a getter that calls `getBoundingClientRect()`,
|
|
624
|
-
// which triggers the whole layout update.
|
|
625
|
-
var hostWidth = _this.hostWidth;
|
|
626
|
-
instance.popper.style.width = hostWidth;
|
|
627
|
-
instance.popper.style.maxWidth = hostWidth;
|
|
628
|
-
instance.popper.firstElementChild.style.maxWidth = hostWidth;
|
|
629
|
-
}
|
|
630
|
-
(_b = (_a = _this.globalConfig).onShow) === null || _b === void 0 ? void 0 : _b.call(_a, instance);
|
|
631
|
-
}, onHidden: function (instance) {
|
|
632
|
-
var _a, _b;
|
|
633
|
-
_this.destroyView();
|
|
634
|
-
_this.isVisible = false;
|
|
635
|
-
_this.visible.next(false);
|
|
636
|
-
(_b = (_a = _this.globalConfig).onHidden) === null || _b === void 0 ? void 0 : _b.call(_a, instance);
|
|
637
|
-
} }));
|
|
638
|
-
_this.setStatus();
|
|
639
|
-
_this.setProps(_this.props);
|
|
640
|
-
_this.variation === 'contextMenu' && _this.handleContextMenu();
|
|
641
|
-
});
|
|
642
|
-
};
|
|
643
|
-
TippyDirective.prototype.resolveContent = function () {
|
|
644
|
-
if (!this.viewOptions$ && !i2.isString(this.content)) {
|
|
645
|
-
if (i2.isComponent(this.content)) {
|
|
646
|
-
this.instance.data = this.data;
|
|
647
|
-
this.viewOptions$ = {
|
|
648
|
-
injector: i0.Injector.create({
|
|
649
|
-
providers: [
|
|
650
|
-
{
|
|
651
|
-
provide: TIPPY_REF,
|
|
652
|
-
useValue: this.instance
|
|
653
|
-
}
|
|
654
|
-
],
|
|
655
|
-
parent: this.injector
|
|
656
|
-
})
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
else if (i2.isTemplateRef(this.content)) {
|
|
660
|
-
this.viewOptions$ = {
|
|
661
|
-
context: {
|
|
662
|
-
$implicit: this.hide.bind(this),
|
|
663
|
-
data: this.data
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
this.viewRef = this.viewService.createView(this.content, Object.assign({ vcr: this.vcr }, this.viewOptions$));
|
|
669
|
-
var content = this.viewRef.getElement();
|
|
670
|
-
if (i2.isString(content) && this.globalConfig.beforeRender) {
|
|
671
|
-
content = this.globalConfig.beforeRender(content);
|
|
672
|
-
}
|
|
673
|
-
return content;
|
|
674
|
-
};
|
|
675
|
-
TippyDirective.prototype.handleContextMenu = function () {
|
|
676
|
-
var _this = this;
|
|
677
|
-
rxjs.fromEvent(this.host, 'contextmenu')
|
|
678
|
-
.pipe(operators.takeUntil(this.destroyed))
|
|
679
|
-
.subscribe(function (event) {
|
|
680
|
-
event.preventDefault();
|
|
681
|
-
_this.instance.setProps({
|
|
682
|
-
getReferenceClientRect: function () { return ({
|
|
683
|
-
width: 0,
|
|
684
|
-
height: 0,
|
|
685
|
-
top: event.clientY,
|
|
686
|
-
bottom: event.clientY,
|
|
687
|
-
left: event.clientX,
|
|
688
|
-
right: event.clientX
|
|
689
|
-
}); }
|
|
690
|
-
});
|
|
691
|
-
_this.instance.show();
|
|
692
|
-
});
|
|
693
|
-
};
|
|
694
|
-
TippyDirective.prototype.handleEscapeButton = function () {
|
|
695
|
-
var _this = this;
|
|
696
|
-
this.pressButton$(document.body, 'Escape')
|
|
697
|
-
.pipe(operators.takeUntil(rxjs.merge(this.destroyed, this.visible.pipe(operators.filter(function (v) { return !v; })))))
|
|
698
|
-
.subscribe(function () { return _this.hide(); });
|
|
699
|
-
};
|
|
700
|
-
TippyDirective.prototype.pressButton$ = function (element, codeButton) {
|
|
701
|
-
return rxjs.fromEvent(element, 'keydown').pipe(operators.filter(function (_c) {
|
|
702
|
-
var code = _c.code;
|
|
703
|
-
return codeButton === code;
|
|
704
|
-
}));
|
|
705
|
-
};
|
|
706
|
-
TippyDirective.prototype.checkOverflow = function (isElementOverflow) {
|
|
707
|
-
var _a;
|
|
708
|
-
if (isElementOverflow) {
|
|
709
|
-
if (!this.instance) {
|
|
710
|
-
this.createInstance();
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
this.instance.enable();
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.disable();
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
TippyDirective.prototype.listenToHostResize = function () {
|
|
721
|
-
var _this = this;
|
|
722
|
-
dimensionsChanges(this.host)
|
|
723
|
-
.pipe(operators.takeUntil(rxjs.merge(this.destroyed, this.visible)))
|
|
724
|
-
.subscribe(function () {
|
|
725
|
-
_this.instance.popper.style.width = _this.hostWidth;
|
|
726
|
-
});
|
|
727
|
-
};
|
|
728
|
-
return TippyDirective;
|
|
729
|
-
}());
|
|
730
|
-
TippyDirective.decorators = [
|
|
731
|
-
{ type: i0.Directive, args: [{
|
|
732
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
733
|
-
selector: '[tippy]',
|
|
734
|
-
exportAs: 'tippy'
|
|
735
|
-
},] }
|
|
736
|
-
];
|
|
737
|
-
TippyDirective.ctorParameters = function () { return [
|
|
738
|
-
{ type: String, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
|
739
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [TIPPY_CONFIG,] }] },
|
|
740
|
-
{ type: i0.Injector },
|
|
741
|
-
{ type: i2.ViewService },
|
|
742
|
-
{ type: i0.ViewContainerRef },
|
|
743
|
-
{ type: i0.NgZone },
|
|
744
|
-
{ type: i0.ElementRef }
|
|
745
|
-
]; };
|
|
746
|
-
TippyDirective.propDecorators = {
|
|
747
|
-
appendTo: [{ type: i0.Input }],
|
|
748
|
-
delay: [{ type: i0.Input }],
|
|
749
|
-
duration: [{ type: i0.Input }],
|
|
750
|
-
hideOnClick: [{ type: i0.Input }],
|
|
751
|
-
interactive: [{ type: i0.Input }],
|
|
752
|
-
interactiveBorder: [{ type: i0.Input }],
|
|
753
|
-
maxWidth: [{ type: i0.Input }],
|
|
754
|
-
offset: [{ type: i0.Input }],
|
|
755
|
-
placement: [{ type: i0.Input }],
|
|
756
|
-
popperOptions: [{ type: i0.Input }],
|
|
757
|
-
showOnCreate: [{ type: i0.Input }],
|
|
758
|
-
trigger: [{ type: i0.Input }],
|
|
759
|
-
triggerTarget: [{ type: i0.Input }],
|
|
760
|
-
zIndex: [{ type: i0.Input }],
|
|
761
|
-
lazy: [{ type: i0.Input }],
|
|
762
|
-
variation: [{ type: i0.Input }],
|
|
763
|
-
isEnabled: [{ type: i0.Input }],
|
|
764
|
-
className: [{ type: i0.Input }],
|
|
765
|
-
onlyTextOverflow: [{ type: i0.Input }],
|
|
766
|
-
data: [{ type: i0.Input }],
|
|
767
|
-
useHostWidth: [{ type: i0.Input }],
|
|
768
|
-
hideOnEscape: [{ type: i0.Input }],
|
|
769
|
-
content: [{ type: i0.Input, args: ['tippy',] }],
|
|
770
|
-
customHost: [{ type: i0.Input, args: ['tippyHost',] }],
|
|
771
|
-
visible: [{ type: i0.Output }],
|
|
772
|
-
isVisible: [{ type: i0.Input }]
|
|
773
|
-
};
|
|
774
|
-
function isChanged(key, changes) {
|
|
775
|
-
return key in changes;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
var TippyModule = /** @class */ (function () {
|
|
779
|
-
function TippyModule() {
|
|
780
|
-
}
|
|
781
|
-
TippyModule.forRoot = function (config) {
|
|
782
|
-
if (config === void 0) { config = {}; }
|
|
783
|
-
return {
|
|
784
|
-
ngModule: TippyModule,
|
|
785
|
-
providers: [
|
|
786
|
-
{
|
|
787
|
-
provide: TIPPY_CONFIG,
|
|
788
|
-
useValue: config
|
|
789
|
-
}
|
|
790
|
-
]
|
|
791
|
-
};
|
|
792
|
-
};
|
|
793
|
-
return TippyModule;
|
|
794
|
-
}());
|
|
795
|
-
TippyModule.decorators = [
|
|
796
|
-
{ type: i0.NgModule, args: [{
|
|
797
|
-
declarations: [TippyDirective],
|
|
798
|
-
exports: [TippyDirective]
|
|
799
|
-
},] }
|
|
800
|
-
];
|
|
801
|
-
|
|
802
|
-
var tooltipVariation = {
|
|
803
|
-
theme: null,
|
|
804
|
-
arrow: false,
|
|
805
|
-
animation: 'scale',
|
|
806
|
-
trigger: 'mouseenter',
|
|
807
|
-
offset: [0, 5]
|
|
808
|
-
};
|
|
809
|
-
var popperVariation = {
|
|
810
|
-
theme: 'light',
|
|
811
|
-
arrow: true,
|
|
812
|
-
offset: [0, 10],
|
|
813
|
-
animation: null,
|
|
814
|
-
trigger: 'click',
|
|
815
|
-
interactive: true
|
|
816
|
-
};
|
|
817
|
-
function withContextMenuVariation(baseVariation) {
|
|
818
|
-
return Object.assign(Object.assign({}, baseVariation), { placement: 'right-start', trigger: 'manual', arrow: false, offset: [0, 0] });
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
var TippyService = /** @class */ (function () {
|
|
822
|
-
function TippyService(globalConfig, view, injector) {
|
|
823
|
-
this.globalConfig = globalConfig;
|
|
824
|
-
this.view = view;
|
|
825
|
-
this.injector = injector;
|
|
826
|
-
}
|
|
827
|
-
TippyService.prototype.create = function (host, content, options) {
|
|
828
|
-
var _this = this;
|
|
829
|
-
if (options === void 0) { options = {}; }
|
|
830
|
-
var config = Object.assign(Object.assign(Object.assign(Object.assign({ onShow: function (instance) {
|
|
831
|
-
var _a;
|
|
832
|
-
if (!instance.$viewOptions) {
|
|
833
|
-
instance.$viewOptions = {};
|
|
834
|
-
if (i2.isTemplateRef(content)) {
|
|
835
|
-
instance.$viewOptions.context = Object.assign({ $implicit: instance.hide.bind(instance) }, options.context);
|
|
836
|
-
}
|
|
837
|
-
else if (i2.isComponent(content)) {
|
|
838
|
-
instance.context = options.context;
|
|
839
|
-
instance.data = options.data;
|
|
840
|
-
instance.$viewOptions.injector = i0.Injector.create({
|
|
841
|
-
providers: [
|
|
842
|
-
{
|
|
843
|
-
provide: TIPPY_REF,
|
|
844
|
-
useValue: instance
|
|
845
|
-
}
|
|
846
|
-
],
|
|
847
|
-
parent: options.injector || _this.injector
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
instance.view = _this.view.createView(content, Object.assign(Object.assign({}, options), instance.$viewOptions));
|
|
852
|
-
instance.setContent(instance.view.getElement());
|
|
853
|
-
(_a = options === null || options === void 0 ? void 0 : options.onShow) === null || _a === void 0 ? void 0 : _a.call(options, instance);
|
|
854
|
-
}, onHidden: function (instance) {
|
|
855
|
-
var _a;
|
|
856
|
-
instance.view.destroy();
|
|
857
|
-
(_a = options === null || options === void 0 ? void 0 : options.onHidden) === null || _a === void 0 ? void 0 : _a.call(options, instance);
|
|
858
|
-
instance.view = null;
|
|
859
|
-
} }, onlyTippyProps(this.globalConfig)), this.globalConfig.variations[options.variation || this.globalConfig.defaultVariation]), onlyTippyProps(options)), { onCreate: function (instance) {
|
|
860
|
-
var e_1, _d;
|
|
861
|
-
var _a, _b, _c;
|
|
862
|
-
if (options.className) {
|
|
863
|
-
try {
|
|
864
|
-
for (var _e = __values(normalizeClassName(options.className)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
865
|
-
var klass = _f.value;
|
|
866
|
-
instance.popper.classList.add(klass);
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
870
|
-
finally {
|
|
871
|
-
try {
|
|
872
|
-
if (_f && !_f.done && (_d = _e.return)) _d.call(_e);
|
|
873
|
-
}
|
|
874
|
-
finally { if (e_1) throw e_1.error; }
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
(_b = (_a = _this.globalConfig).onCreate) === null || _b === void 0 ? void 0 : _b.call(_a, instance);
|
|
878
|
-
(_c = options.onCreate) === null || _c === void 0 ? void 0 : _c.call(options, instance);
|
|
879
|
-
} });
|
|
880
|
-
return tippy__default['default'](host, config);
|
|
881
|
-
};
|
|
882
|
-
return TippyService;
|
|
883
|
-
}());
|
|
884
|
-
TippyService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function TippyService_Factory() { return new TippyService(i0__namespace.ɵɵinject(TIPPY_CONFIG), i0__namespace.ɵɵinject(i2__namespace.ViewService), i0__namespace.ɵɵinject(i0__namespace.INJECTOR)); }, token: TippyService, providedIn: "root" });
|
|
885
|
-
TippyService.decorators = [
|
|
886
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
887
|
-
];
|
|
888
|
-
TippyService.ctorParameters = function () { return [
|
|
889
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [TIPPY_CONFIG,] }] },
|
|
890
|
-
{ type: i2.ViewService },
|
|
891
|
-
{ type: i0.Injector }
|
|
892
|
-
]; };
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Generated bundle index. Do not edit.
|
|
896
|
-
*/
|
|
897
|
-
|
|
898
|
-
exports.TIPPY_CONFIG = TIPPY_CONFIG;
|
|
899
|
-
exports.TIPPY_REF = TIPPY_REF;
|
|
900
|
-
exports.TippyDirective = TippyDirective;
|
|
901
|
-
exports.TippyModule = TippyModule;
|
|
902
|
-
exports.TippyService = TippyService;
|
|
903
|
-
exports.inView = inView;
|
|
904
|
-
exports.overflowChanges = overflowChanges;
|
|
905
|
-
exports.popperVariation = popperVariation;
|
|
906
|
-
exports.tooltipVariation = tooltipVariation;
|
|
907
|
-
exports.withContextMenuVariation = withContextMenuVariation;
|
|
908
|
-
|
|
909
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
910
|
-
|
|
911
|
-
})));
|
|
912
|
-
//# sourceMappingURL=ngneat-helipopper.umd.js.map
|