react-tooltip 4.3.0 → 4.4.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 +5 -2
- package/dist/index.es.js +264 -407
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +264 -407
- package/dist/index.js.map +1 -1
- package/dist/react-tooltip.d.ts +13 -10
- package/package.json +35 -33
package/dist/index.js
CHANGED
|
@@ -11,17 +11,14 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
11
11
|
|
|
12
12
|
function ownKeys$2(object, enumerableOnly) {
|
|
13
13
|
var keys = Object.keys(object);
|
|
14
|
-
|
|
15
14
|
if (Object.getOwnPropertySymbols) {
|
|
16
15
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
17
16
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
18
17
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
19
18
|
})), keys.push.apply(keys, symbols);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
return keys;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
function _objectSpread2(target) {
|
|
26
23
|
for (var i = 1; i < arguments.length; i++) {
|
|
27
24
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -31,16 +28,13 @@ function _objectSpread2(target) {
|
|
|
31
28
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
32
29
|
});
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return target;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
function _classCallCheck(instance, Constructor) {
|
|
39
34
|
if (!(instance instanceof Constructor)) {
|
|
40
35
|
throw new TypeError("Cannot call a class as a function");
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
function _defineProperties(target, props) {
|
|
45
39
|
for (var i = 0; i < props.length; i++) {
|
|
46
40
|
var descriptor = props[i];
|
|
@@ -50,7 +44,6 @@ function _defineProperties(target, props) {
|
|
|
50
44
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
|
-
|
|
54
47
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
55
48
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
56
49
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -59,7 +52,6 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
59
52
|
});
|
|
60
53
|
return Constructor;
|
|
61
54
|
}
|
|
62
|
-
|
|
63
55
|
function _defineProperty(obj, key, value) {
|
|
64
56
|
if (key in obj) {
|
|
65
57
|
Object.defineProperty(obj, key, {
|
|
@@ -71,32 +63,26 @@ function _defineProperty(obj, key, value) {
|
|
|
71
63
|
} else {
|
|
72
64
|
obj[key] = value;
|
|
73
65
|
}
|
|
74
|
-
|
|
75
66
|
return obj;
|
|
76
67
|
}
|
|
77
|
-
|
|
78
68
|
function _extends() {
|
|
79
69
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
80
70
|
for (var i = 1; i < arguments.length; i++) {
|
|
81
71
|
var source = arguments[i];
|
|
82
|
-
|
|
83
72
|
for (var key in source) {
|
|
84
73
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
85
74
|
target[key] = source[key];
|
|
86
75
|
}
|
|
87
76
|
}
|
|
88
77
|
}
|
|
89
|
-
|
|
90
78
|
return target;
|
|
91
79
|
};
|
|
92
80
|
return _extends.apply(this, arguments);
|
|
93
81
|
}
|
|
94
|
-
|
|
95
82
|
function _inherits(subClass, superClass) {
|
|
96
83
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
97
84
|
throw new TypeError("Super expression must either be null or a function");
|
|
98
85
|
}
|
|
99
|
-
|
|
100
86
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
101
87
|
constructor: {
|
|
102
88
|
value: subClass,
|
|
@@ -109,14 +95,12 @@ function _inherits(subClass, superClass) {
|
|
|
109
95
|
});
|
|
110
96
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
111
97
|
}
|
|
112
|
-
|
|
113
98
|
function _getPrototypeOf(o) {
|
|
114
99
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
115
100
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
116
101
|
};
|
|
117
102
|
return _getPrototypeOf(o);
|
|
118
103
|
}
|
|
119
|
-
|
|
120
104
|
function _setPrototypeOf(o, p) {
|
|
121
105
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
122
106
|
o.__proto__ = p;
|
|
@@ -124,12 +108,10 @@ function _setPrototypeOf(o, p) {
|
|
|
124
108
|
};
|
|
125
109
|
return _setPrototypeOf(o, p);
|
|
126
110
|
}
|
|
127
|
-
|
|
128
111
|
function _isNativeReflectConstruct() {
|
|
129
112
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
130
113
|
if (Reflect.construct.sham) return false;
|
|
131
114
|
if (typeof Proxy === "function") return true;
|
|
132
|
-
|
|
133
115
|
try {
|
|
134
116
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
135
117
|
return true;
|
|
@@ -137,44 +119,34 @@ function _isNativeReflectConstruct() {
|
|
|
137
119
|
return false;
|
|
138
120
|
}
|
|
139
121
|
}
|
|
140
|
-
|
|
141
122
|
function _assertThisInitialized(self) {
|
|
142
123
|
if (self === void 0) {
|
|
143
124
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
144
125
|
}
|
|
145
|
-
|
|
146
126
|
return self;
|
|
147
127
|
}
|
|
148
|
-
|
|
149
128
|
function _possibleConstructorReturn(self, call) {
|
|
150
129
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
151
130
|
return call;
|
|
152
131
|
} else if (call !== void 0) {
|
|
153
132
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
154
133
|
}
|
|
155
|
-
|
|
156
134
|
return _assertThisInitialized(self);
|
|
157
135
|
}
|
|
158
|
-
|
|
159
136
|
function _createSuper(Derived) {
|
|
160
137
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
161
|
-
|
|
162
138
|
return function _createSuperInternal() {
|
|
163
139
|
var Super = _getPrototypeOf(Derived),
|
|
164
|
-
|
|
165
|
-
|
|
140
|
+
result;
|
|
166
141
|
if (hasNativeReflectConstruct) {
|
|
167
142
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
168
|
-
|
|
169
143
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
170
144
|
} else {
|
|
171
145
|
result = Super.apply(this, arguments);
|
|
172
146
|
}
|
|
173
|
-
|
|
174
147
|
return _possibleConstructorReturn(this, result);
|
|
175
148
|
};
|
|
176
149
|
}
|
|
177
|
-
|
|
178
150
|
function _unsupportedIterableToArray(o, minLen) {
|
|
179
151
|
if (!o) return;
|
|
180
152
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -183,25 +155,18 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
183
155
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
184
156
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
185
157
|
}
|
|
186
|
-
|
|
187
158
|
function _arrayLikeToArray(arr, len) {
|
|
188
159
|
if (len == null || len > arr.length) len = arr.length;
|
|
189
|
-
|
|
190
160
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
191
|
-
|
|
192
161
|
return arr2;
|
|
193
162
|
}
|
|
194
|
-
|
|
195
163
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
196
164
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
197
|
-
|
|
198
165
|
if (!it) {
|
|
199
166
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
200
167
|
if (it) o = it;
|
|
201
168
|
var i = 0;
|
|
202
|
-
|
|
203
169
|
var F = function () {};
|
|
204
|
-
|
|
205
170
|
return {
|
|
206
171
|
s: F,
|
|
207
172
|
n: function () {
|
|
@@ -219,13 +184,11 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
219
184
|
f: F
|
|
220
185
|
};
|
|
221
186
|
}
|
|
222
|
-
|
|
223
187
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
224
188
|
}
|
|
225
|
-
|
|
226
189
|
var normalCompletion = true,
|
|
227
|
-
|
|
228
|
-
|
|
190
|
+
didErr = false,
|
|
191
|
+
err;
|
|
229
192
|
return {
|
|
230
193
|
s: function () {
|
|
231
194
|
it = it.call(o);
|
|
@@ -257,7 +220,7 @@ var check = function (it) {
|
|
|
257
220
|
|
|
258
221
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
259
222
|
var global$a =
|
|
260
|
-
// eslint-disable-next-line es
|
|
223
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
261
224
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
262
225
|
check(typeof window == 'object' && window) ||
|
|
263
226
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -280,14 +243,14 @@ var fails$8 = fails$9;
|
|
|
280
243
|
|
|
281
244
|
// Detect IE8's incomplete defineProperty implementation
|
|
282
245
|
var descriptors = !fails$8(function () {
|
|
283
|
-
// eslint-disable-next-line es
|
|
246
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
284
247
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
285
248
|
});
|
|
286
249
|
|
|
287
250
|
var fails$7 = fails$9;
|
|
288
251
|
|
|
289
252
|
var functionBindNative = !fails$7(function () {
|
|
290
|
-
// eslint-disable-next-line es
|
|
253
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
291
254
|
var test = (function () { /* empty */ }).bind();
|
|
292
255
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
293
256
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -304,7 +267,7 @@ var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
|
|
|
304
267
|
var objectPropertyIsEnumerable = {};
|
|
305
268
|
|
|
306
269
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
307
|
-
// eslint-disable-next-line es
|
|
270
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
308
271
|
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
309
272
|
|
|
310
273
|
// Nashorn ~ JDK8 bug
|
|
@@ -329,33 +292,40 @@ var createPropertyDescriptor$2 = function (bitmap, value) {
|
|
|
329
292
|
var NATIVE_BIND$1 = functionBindNative;
|
|
330
293
|
|
|
331
294
|
var FunctionPrototype$1 = Function.prototype;
|
|
332
|
-
var bind$2 = FunctionPrototype$1.bind;
|
|
333
295
|
var call$3 = FunctionPrototype$1.call;
|
|
334
|
-
var
|
|
296
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$3, call$3);
|
|
335
297
|
|
|
336
|
-
var
|
|
337
|
-
return
|
|
338
|
-
} : function (fn) {
|
|
339
|
-
return fn && function () {
|
|
298
|
+
var functionUncurryThisRaw = function (fn) {
|
|
299
|
+
return NATIVE_BIND$1 ? uncurryThisWithBind(fn) : function () {
|
|
340
300
|
return call$3.apply(fn, arguments);
|
|
341
301
|
};
|
|
342
302
|
};
|
|
343
303
|
|
|
344
|
-
var
|
|
304
|
+
var uncurryThisRaw$1 = functionUncurryThisRaw;
|
|
345
305
|
|
|
346
|
-
var toString$1 =
|
|
347
|
-
var stringSlice =
|
|
306
|
+
var toString$1 = uncurryThisRaw$1({}.toString);
|
|
307
|
+
var stringSlice = uncurryThisRaw$1(''.slice);
|
|
348
308
|
|
|
349
|
-
var classofRaw$
|
|
309
|
+
var classofRaw$2 = function (it) {
|
|
350
310
|
return stringSlice(toString$1(it), 8, -1);
|
|
351
311
|
};
|
|
352
312
|
|
|
353
|
-
var
|
|
313
|
+
var classofRaw$1 = classofRaw$2;
|
|
314
|
+
var uncurryThisRaw = functionUncurryThisRaw;
|
|
315
|
+
|
|
316
|
+
var functionUncurryThis = function (fn) {
|
|
317
|
+
// Nashorn bug:
|
|
318
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
319
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
320
|
+
if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
354
324
|
var fails$6 = fails$9;
|
|
355
|
-
var classof$3 = classofRaw$
|
|
325
|
+
var classof$3 = classofRaw$2;
|
|
356
326
|
|
|
357
327
|
var $Object$3 = Object;
|
|
358
|
-
var split = uncurryThis$
|
|
328
|
+
var split = uncurryThis$9(''.split);
|
|
359
329
|
|
|
360
330
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
361
331
|
var indexedObject = fails$6(function () {
|
|
@@ -366,12 +336,20 @@ var indexedObject = fails$6(function () {
|
|
|
366
336
|
return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
|
|
367
337
|
} : $Object$3;
|
|
368
338
|
|
|
339
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
340
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
341
|
+
var isNullOrUndefined$2 = function (it) {
|
|
342
|
+
return it === null || it === undefined;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var isNullOrUndefined$1 = isNullOrUndefined$2;
|
|
346
|
+
|
|
369
347
|
var $TypeError$5 = TypeError;
|
|
370
348
|
|
|
371
349
|
// `RequireObjectCoercible` abstract operation
|
|
372
350
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
373
351
|
var requireObjectCoercible$2 = function (it) {
|
|
374
|
-
if (it
|
|
352
|
+
if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
|
|
375
353
|
return it;
|
|
376
354
|
};
|
|
377
355
|
|
|
@@ -383,15 +361,36 @@ var toIndexedObject$4 = function (it) {
|
|
|
383
361
|
return IndexedObject$1(requireObjectCoercible$1(it));
|
|
384
362
|
};
|
|
385
363
|
|
|
364
|
+
var documentAll$2 = typeof document == 'object' && document.all;
|
|
365
|
+
|
|
366
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
367
|
+
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
368
|
+
|
|
369
|
+
var documentAll_1 = {
|
|
370
|
+
all: documentAll$2,
|
|
371
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
var $documentAll$1 = documentAll_1;
|
|
375
|
+
|
|
376
|
+
var documentAll$1 = $documentAll$1.all;
|
|
377
|
+
|
|
386
378
|
// `IsCallable` abstract operation
|
|
387
379
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
388
|
-
var isCallable$c = function (argument) {
|
|
380
|
+
var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
381
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
382
|
+
} : function (argument) {
|
|
389
383
|
return typeof argument == 'function';
|
|
390
384
|
};
|
|
391
385
|
|
|
392
386
|
var isCallable$b = isCallable$c;
|
|
387
|
+
var $documentAll = documentAll_1;
|
|
388
|
+
|
|
389
|
+
var documentAll = $documentAll.all;
|
|
393
390
|
|
|
394
|
-
var isObject$6 = function (it) {
|
|
391
|
+
var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
392
|
+
return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
|
|
393
|
+
} : function (it) {
|
|
395
394
|
return typeof it == 'object' ? it !== null : isCallable$b(it);
|
|
396
395
|
};
|
|
397
396
|
|
|
@@ -406,9 +405,9 @@ var getBuiltIn$5 = function (namespace, method) {
|
|
|
406
405
|
return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
|
|
407
406
|
};
|
|
408
407
|
|
|
409
|
-
var uncurryThis$
|
|
408
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
410
409
|
|
|
411
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
410
|
+
var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
|
|
412
411
|
|
|
413
412
|
var getBuiltIn$4 = getBuiltIn$5;
|
|
414
413
|
|
|
@@ -442,13 +441,13 @@ if (!version && userAgent) {
|
|
|
442
441
|
|
|
443
442
|
var engineV8Version = version;
|
|
444
443
|
|
|
445
|
-
/* eslint-disable es
|
|
444
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
446
445
|
|
|
447
446
|
var V8_VERSION = engineV8Version;
|
|
448
447
|
var fails$5 = fails$9;
|
|
449
448
|
|
|
450
|
-
// eslint-disable-next-line es
|
|
451
|
-
var
|
|
449
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
450
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
|
|
452
451
|
var symbol = Symbol();
|
|
453
452
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
454
453
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -457,9 +456,9 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
|
|
|
457
456
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
458
457
|
});
|
|
459
458
|
|
|
460
|
-
/* eslint-disable es
|
|
459
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
461
460
|
|
|
462
|
-
var NATIVE_SYMBOL$1 =
|
|
461
|
+
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
463
462
|
|
|
464
463
|
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
465
464
|
&& !Symbol.sham
|
|
@@ -501,12 +500,13 @@ var aCallable$2 = function (argument) {
|
|
|
501
500
|
};
|
|
502
501
|
|
|
503
502
|
var aCallable$1 = aCallable$2;
|
|
503
|
+
var isNullOrUndefined = isNullOrUndefined$2;
|
|
504
504
|
|
|
505
505
|
// `GetMethod` abstract operation
|
|
506
506
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
507
507
|
var getMethod$1 = function (V, P) {
|
|
508
508
|
var func = V[P];
|
|
509
|
-
return func
|
|
509
|
+
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
510
510
|
};
|
|
511
511
|
|
|
512
512
|
var call$2 = functionCall;
|
|
@@ -529,7 +529,7 @@ var shared$3 = {exports: {}};
|
|
|
529
529
|
|
|
530
530
|
var global$7 = global$a;
|
|
531
531
|
|
|
532
|
-
// eslint-disable-next-line es
|
|
532
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
533
533
|
var defineProperty$2 = Object.defineProperty;
|
|
534
534
|
|
|
535
535
|
var defineGlobalProperty$3 = function (key, value) {
|
|
@@ -553,10 +553,10 @@ var store$2 = sharedStore;
|
|
|
553
553
|
(shared$3.exports = function (key, value) {
|
|
554
554
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
555
555
|
})('versions', []).push({
|
|
556
|
-
version: '3.
|
|
556
|
+
version: '3.25.5',
|
|
557
557
|
mode: 'global',
|
|
558
558
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
559
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
559
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
560
560
|
source: 'https://github.com/zloirock/core-js'
|
|
561
561
|
});
|
|
562
562
|
|
|
@@ -570,23 +570,23 @@ var toObject$2 = function (argument) {
|
|
|
570
570
|
return $Object$1(requireObjectCoercible(argument));
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
-
var uncurryThis$
|
|
573
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
574
574
|
var toObject$1 = toObject$2;
|
|
575
575
|
|
|
576
|
-
var hasOwnProperty = uncurryThis$
|
|
576
|
+
var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
|
|
577
577
|
|
|
578
578
|
// `HasOwnProperty` abstract operation
|
|
579
579
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
580
|
-
// eslint-disable-next-line es
|
|
580
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
581
581
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
582
582
|
return hasOwnProperty(toObject$1(it), key);
|
|
583
583
|
};
|
|
584
584
|
|
|
585
|
-
var uncurryThis$
|
|
585
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
586
586
|
|
|
587
587
|
var id = 0;
|
|
588
588
|
var postfix = Math.random();
|
|
589
|
-
var toString = uncurryThis$
|
|
589
|
+
var toString = uncurryThis$6(1.0.toString);
|
|
590
590
|
|
|
591
591
|
var uid$2 = function (key) {
|
|
592
592
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
@@ -596,7 +596,7 @@ var global$5 = global$a;
|
|
|
596
596
|
var shared$2 = shared$3.exports;
|
|
597
597
|
var hasOwn$6 = hasOwnProperty_1;
|
|
598
598
|
var uid$1 = uid$2;
|
|
599
|
-
var NATIVE_SYMBOL =
|
|
599
|
+
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
600
600
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
601
601
|
|
|
602
602
|
var WellKnownSymbolsStore = shared$2('wks');
|
|
@@ -670,7 +670,7 @@ var createElement = documentCreateElement$1;
|
|
|
670
670
|
|
|
671
671
|
// Thanks to IE8 for its funny defineProperty
|
|
672
672
|
var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
|
|
673
|
-
// eslint-disable-next-line es
|
|
673
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
674
674
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
675
675
|
get: function () { return 7; }
|
|
676
676
|
}).a != 7;
|
|
@@ -685,7 +685,7 @@ var toPropertyKey$1 = toPropertyKey$2;
|
|
|
685
685
|
var hasOwn$5 = hasOwnProperty_1;
|
|
686
686
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
687
687
|
|
|
688
|
-
// eslint-disable-next-line es
|
|
688
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
689
689
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
690
690
|
|
|
691
691
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -707,7 +707,7 @@ var fails$3 = fails$9;
|
|
|
707
707
|
// V8 ~ Chrome 36-
|
|
708
708
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
709
709
|
var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
|
|
710
|
-
// eslint-disable-next-line es
|
|
710
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
711
711
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
712
712
|
value: 42,
|
|
713
713
|
writable: false
|
|
@@ -732,9 +732,9 @@ var anObject$3 = anObject$4;
|
|
|
732
732
|
var toPropertyKey = toPropertyKey$2;
|
|
733
733
|
|
|
734
734
|
var $TypeError = TypeError;
|
|
735
|
-
// eslint-disable-next-line es
|
|
735
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
736
736
|
var $defineProperty = Object.defineProperty;
|
|
737
|
-
// eslint-disable-next-line es
|
|
737
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
738
738
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
739
739
|
var ENUMERABLE = 'enumerable';
|
|
740
740
|
var CONFIGURABLE$1 = 'configurable';
|
|
@@ -786,7 +786,7 @@ var DESCRIPTORS$2 = descriptors;
|
|
|
786
786
|
var hasOwn$4 = hasOwnProperty_1;
|
|
787
787
|
|
|
788
788
|
var FunctionPrototype = Function.prototype;
|
|
789
|
-
// eslint-disable-next-line es
|
|
789
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
790
790
|
var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
|
|
791
791
|
|
|
792
792
|
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
|
@@ -800,11 +800,11 @@ var functionName = {
|
|
|
800
800
|
CONFIGURABLE: CONFIGURABLE
|
|
801
801
|
};
|
|
802
802
|
|
|
803
|
-
var uncurryThis$
|
|
803
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
804
804
|
var isCallable$6 = isCallable$c;
|
|
805
805
|
var store$1 = sharedStore;
|
|
806
806
|
|
|
807
|
-
var functionToString = uncurryThis$
|
|
807
|
+
var functionToString = uncurryThis$5(Function.toString);
|
|
808
808
|
|
|
809
809
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
810
810
|
if (!isCallable$6(store$1.inspectSource)) {
|
|
@@ -813,15 +813,14 @@ if (!isCallable$6(store$1.inspectSource)) {
|
|
|
813
813
|
};
|
|
814
814
|
}
|
|
815
815
|
|
|
816
|
-
var inspectSource$
|
|
816
|
+
var inspectSource$2 = store$1.inspectSource;
|
|
817
817
|
|
|
818
818
|
var global$3 = global$a;
|
|
819
819
|
var isCallable$5 = isCallable$c;
|
|
820
|
-
var inspectSource$2 = inspectSource$3;
|
|
821
820
|
|
|
822
821
|
var WeakMap$1 = global$3.WeakMap;
|
|
823
822
|
|
|
824
|
-
var
|
|
823
|
+
var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
825
824
|
|
|
826
825
|
var shared$1 = shared$3.exports;
|
|
827
826
|
var uid = uid$2;
|
|
@@ -834,9 +833,8 @@ var sharedKey$2 = function (key) {
|
|
|
834
833
|
|
|
835
834
|
var hiddenKeys$4 = {};
|
|
836
835
|
|
|
837
|
-
var NATIVE_WEAK_MAP =
|
|
836
|
+
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
838
837
|
var global$2 = global$a;
|
|
839
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
840
838
|
var isObject$1 = isObject$6;
|
|
841
839
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
|
842
840
|
var hasOwn$3 = hasOwnProperty_1;
|
|
@@ -864,26 +862,28 @@ var getterFor = function (TYPE) {
|
|
|
864
862
|
|
|
865
863
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
866
864
|
var store = shared.state || (shared.state = new WeakMap());
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
865
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
866
|
+
store.get = store.get;
|
|
867
|
+
store.has = store.has;
|
|
868
|
+
store.set = store.set;
|
|
869
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
870
870
|
set = function (it, metadata) {
|
|
871
|
-
if (
|
|
871
|
+
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
872
872
|
metadata.facade = it;
|
|
873
|
-
|
|
873
|
+
store.set(it, metadata);
|
|
874
874
|
return metadata;
|
|
875
875
|
};
|
|
876
876
|
get = function (it) {
|
|
877
|
-
return
|
|
877
|
+
return store.get(it) || {};
|
|
878
878
|
};
|
|
879
879
|
has = function (it) {
|
|
880
|
-
return
|
|
880
|
+
return store.has(it);
|
|
881
881
|
};
|
|
882
882
|
} else {
|
|
883
883
|
var STATE = sharedKey$1('state');
|
|
884
884
|
hiddenKeys$3[STATE] = true;
|
|
885
885
|
set = function (it, metadata) {
|
|
886
|
-
if (hasOwn$3(it, STATE)) throw
|
|
886
|
+
if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
887
887
|
metadata.facade = it;
|
|
888
888
|
createNonEnumerableProperty$1(it, STATE, metadata);
|
|
889
889
|
return metadata;
|
|
@@ -909,12 +909,12 @@ var isCallable$4 = isCallable$c;
|
|
|
909
909
|
var hasOwn$2 = hasOwnProperty_1;
|
|
910
910
|
var DESCRIPTORS$1 = descriptors;
|
|
911
911
|
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
912
|
-
var inspectSource$1 = inspectSource$
|
|
912
|
+
var inspectSource$1 = inspectSource$2;
|
|
913
913
|
var InternalStateModule = internalState;
|
|
914
914
|
|
|
915
915
|
var enforceInternalState = InternalStateModule.enforce;
|
|
916
916
|
var getInternalState = InternalStateModule.get;
|
|
917
|
-
// eslint-disable-next-line es
|
|
917
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
918
918
|
var defineProperty$1 = Object.defineProperty;
|
|
919
919
|
|
|
920
920
|
var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
|
|
@@ -989,7 +989,7 @@ var floor = Math.floor;
|
|
|
989
989
|
|
|
990
990
|
// `Math.trunc` method
|
|
991
991
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
992
|
-
// eslint-disable-next-line es
|
|
992
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
993
993
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
994
994
|
var n = +x;
|
|
995
995
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -1108,14 +1108,14 @@ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
|
1108
1108
|
|
|
1109
1109
|
// `Object.getOwnPropertyNames` method
|
|
1110
1110
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
1111
|
-
// eslint-disable-next-line es
|
|
1111
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
1112
1112
|
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
1113
1113
|
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
1114
1114
|
};
|
|
1115
1115
|
|
|
1116
1116
|
var objectGetOwnPropertySymbols = {};
|
|
1117
1117
|
|
|
1118
|
-
// eslint-disable-next-line es
|
|
1118
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
1119
1119
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1120
1120
|
|
|
1121
1121
|
var getBuiltIn$2 = getBuiltIn$5;
|
|
@@ -1242,11 +1242,11 @@ var functionBindContext = function (fn, that) {
|
|
|
1242
1242
|
};
|
|
1243
1243
|
};
|
|
1244
1244
|
|
|
1245
|
-
var classof$2 = classofRaw$
|
|
1245
|
+
var classof$2 = classofRaw$2;
|
|
1246
1246
|
|
|
1247
1247
|
// `IsArray` abstract operation
|
|
1248
1248
|
// https://tc39.es/ecma262/#sec-isarray
|
|
1249
|
-
// eslint-disable-next-line es
|
|
1249
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
1250
1250
|
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
1251
1251
|
return classof$2(argument) == 'Array';
|
|
1252
1252
|
};
|
|
@@ -1262,7 +1262,7 @@ var toStringTagSupport = String(test) === '[object z]';
|
|
|
1262
1262
|
|
|
1263
1263
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1264
1264
|
var isCallable$1 = isCallable$c;
|
|
1265
|
-
var classofRaw = classofRaw$
|
|
1265
|
+
var classofRaw = classofRaw$2;
|
|
1266
1266
|
var wellKnownSymbol$2 = wellKnownSymbol$5;
|
|
1267
1267
|
|
|
1268
1268
|
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
@@ -1295,7 +1295,7 @@ var fails = fails$9;
|
|
|
1295
1295
|
var isCallable = isCallable$c;
|
|
1296
1296
|
var classof = classof$1;
|
|
1297
1297
|
var getBuiltIn$1 = getBuiltIn$5;
|
|
1298
|
-
var inspectSource = inspectSource$
|
|
1298
|
+
var inspectSource = inspectSource$2;
|
|
1299
1299
|
|
|
1300
1300
|
var noop = function () { /* empty */ };
|
|
1301
1301
|
var empty = [];
|
|
@@ -1455,7 +1455,7 @@ var enumBugKeys$1 = enumBugKeys$3;
|
|
|
1455
1455
|
|
|
1456
1456
|
// `Object.keys` method
|
|
1457
1457
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
1458
|
-
// eslint-disable-next-line es
|
|
1458
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1459
1459
|
var objectKeys$1 = Object.keys || function keys(O) {
|
|
1460
1460
|
return internalObjectKeys(O, enumBugKeys$1);
|
|
1461
1461
|
};
|
|
@@ -1469,7 +1469,7 @@ var objectKeys = objectKeys$1;
|
|
|
1469
1469
|
|
|
1470
1470
|
// `Object.defineProperties` method
|
|
1471
1471
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1472
|
-
// eslint-disable-next-line es
|
|
1472
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1473
1473
|
objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1474
1474
|
anObject$1(O);
|
|
1475
1475
|
var props = toIndexedObject(Properties);
|
|
@@ -1557,7 +1557,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
1557
1557
|
|
|
1558
1558
|
// `Object.create` method
|
|
1559
1559
|
// https://tc39.es/ecma262/#sec-object.create
|
|
1560
|
-
// eslint-disable-next-line es
|
|
1560
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
1561
1561
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
1562
1562
|
var result;
|
|
1563
1563
|
if (O !== null) {
|
|
@@ -1623,13 +1623,11 @@ var CONSTANT = {
|
|
|
1623
1623
|
/**
|
|
1624
1624
|
* Static methods for react-tooltip
|
|
1625
1625
|
*/
|
|
1626
|
-
|
|
1627
1626
|
var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
|
|
1628
1627
|
// Compatible with IE
|
|
1629
1628
|
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
|
|
1630
1629
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
1631
1630
|
var event;
|
|
1632
|
-
|
|
1633
1631
|
if (typeof window.CustomEvent === 'function') {
|
|
1634
1632
|
event = new window.CustomEvent(eventName, {
|
|
1635
1633
|
detail: opts
|
|
@@ -1638,10 +1636,8 @@ var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
|
|
|
1638
1636
|
event = document.createEvent('Event');
|
|
1639
1637
|
event.initEvent(eventName, false, true, opts);
|
|
1640
1638
|
}
|
|
1641
|
-
|
|
1642
1639
|
window.dispatchEvent(event);
|
|
1643
1640
|
};
|
|
1644
|
-
|
|
1645
1641
|
function staticMethods (target) {
|
|
1646
1642
|
/**
|
|
1647
1643
|
* Hide all tooltip
|
|
@@ -1652,45 +1648,40 @@ function staticMethods (target) {
|
|
|
1652
1648
|
target: target
|
|
1653
1649
|
});
|
|
1654
1650
|
};
|
|
1651
|
+
|
|
1655
1652
|
/**
|
|
1656
1653
|
* Rebuild all tooltip
|
|
1657
1654
|
* @trigger ReactTooltip.rebuild()
|
|
1658
1655
|
*/
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
1656
|
target.rebuild = function () {
|
|
1662
1657
|
dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
|
|
1663
1658
|
};
|
|
1659
|
+
|
|
1664
1660
|
/**
|
|
1665
1661
|
* Show specific tooltip
|
|
1666
1662
|
* @trigger ReactTooltip.show()
|
|
1667
1663
|
*/
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
1664
|
target.show = function (target) {
|
|
1671
1665
|
dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
|
|
1672
1666
|
target: target
|
|
1673
1667
|
});
|
|
1674
1668
|
};
|
|
1675
|
-
|
|
1676
1669
|
target.prototype.globalRebuild = function () {
|
|
1677
1670
|
if (this.mount) {
|
|
1678
1671
|
this.unbindListener();
|
|
1679
1672
|
this.bindListener();
|
|
1680
1673
|
}
|
|
1681
1674
|
};
|
|
1682
|
-
|
|
1683
1675
|
target.prototype.globalShow = function (event) {
|
|
1684
1676
|
if (this.mount) {
|
|
1685
|
-
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
1677
|
+
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
1678
|
+
// Create a fake event, specific show will limit the type to `solid`
|
|
1686
1679
|
// only `float` type cares e.clientX e.clientY
|
|
1687
|
-
|
|
1688
1680
|
this.showTooltip({
|
|
1689
1681
|
currentTarget: hasTarget && event.detail.target
|
|
1690
1682
|
}, true);
|
|
1691
1683
|
}
|
|
1692
1684
|
};
|
|
1693
|
-
|
|
1694
1685
|
target.prototype.globalHide = function (event) {
|
|
1695
1686
|
if (this.mount) {
|
|
1696
1687
|
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
@@ -1708,31 +1699,32 @@ function windowListener (target) {
|
|
|
1708
1699
|
target.prototype.bindWindowEvents = function (resizeHide) {
|
|
1709
1700
|
// ReactTooltip.hide
|
|
1710
1701
|
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
1711
|
-
window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
|
|
1702
|
+
window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
|
|
1712
1703
|
|
|
1704
|
+
// ReactTooltip.rebuild
|
|
1713
1705
|
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
1714
|
-
window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
|
|
1706
|
+
window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
|
|
1715
1707
|
|
|
1708
|
+
// ReactTooltip.show
|
|
1716
1709
|
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
1717
|
-
window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
|
|
1710
|
+
window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
|
|
1718
1711
|
|
|
1712
|
+
// Resize
|
|
1719
1713
|
if (resizeHide) {
|
|
1720
1714
|
window.removeEventListener('resize', this.onWindowResize);
|
|
1721
1715
|
window.addEventListener('resize', this.onWindowResize, false);
|
|
1722
1716
|
}
|
|
1723
1717
|
};
|
|
1724
|
-
|
|
1725
1718
|
target.prototype.unbindWindowEvents = function () {
|
|
1726
1719
|
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
1727
1720
|
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
1728
1721
|
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
1729
1722
|
window.removeEventListener('resize', this.onWindowResize);
|
|
1730
1723
|
};
|
|
1724
|
+
|
|
1731
1725
|
/**
|
|
1732
1726
|
* invoked by resize event of window
|
|
1733
1727
|
*/
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
1728
|
target.prototype.onWindowResize = function () {
|
|
1737
1729
|
if (!this.mount) return;
|
|
1738
1730
|
this.hideTooltip();
|
|
@@ -1746,13 +1738,13 @@ function windowListener (target) {
|
|
|
1746
1738
|
* - `event` {String}
|
|
1747
1739
|
* - `eventOff` {String}
|
|
1748
1740
|
*/
|
|
1741
|
+
|
|
1749
1742
|
var checkStatus = function checkStatus(dataEventOff, e) {
|
|
1750
1743
|
var show = this.state.show;
|
|
1751
1744
|
var id = this.props.id;
|
|
1752
1745
|
var isCapture = this.isCapture(e.currentTarget);
|
|
1753
1746
|
var currentItem = e.currentTarget.getAttribute('currentItem');
|
|
1754
1747
|
if (!isCapture) e.stopPropagation();
|
|
1755
|
-
|
|
1756
1748
|
if (show && currentItem === 'true') {
|
|
1757
1749
|
if (!dataEventOff) this.hideTooltip(e);
|
|
1758
1750
|
} else {
|
|
@@ -1761,7 +1753,6 @@ var checkStatus = function checkStatus(dataEventOff, e) {
|
|
|
1761
1753
|
this.showTooltip(e);
|
|
1762
1754
|
}
|
|
1763
1755
|
};
|
|
1764
|
-
|
|
1765
1756
|
var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
|
|
1766
1757
|
for (var i = 0; i < targetArray.length; i++) {
|
|
1767
1758
|
if (currentTarget !== targetArray[i]) {
|
|
@@ -1771,7 +1762,6 @@ var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
|
|
|
1771
1762
|
}
|
|
1772
1763
|
}
|
|
1773
1764
|
};
|
|
1774
|
-
|
|
1775
1765
|
var customListeners = {
|
|
1776
1766
|
id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
|
|
1777
1767
|
set: function set(target, event, listener) {
|
|
@@ -1788,7 +1778,6 @@ var customListeners = {
|
|
|
1788
1778
|
},
|
|
1789
1779
|
get: function get(target, event) {
|
|
1790
1780
|
var map = target[this.id];
|
|
1791
|
-
|
|
1792
1781
|
if (map !== undefined) {
|
|
1793
1782
|
return map[event];
|
|
1794
1783
|
}
|
|
@@ -1799,15 +1788,13 @@ function customEvent (target) {
|
|
|
1799
1788
|
var event = this.state.event;
|
|
1800
1789
|
return event || !!ele.getAttribute('data-event');
|
|
1801
1790
|
};
|
|
1802
|
-
/* Bind listener for custom event */
|
|
1803
|
-
|
|
1804
1791
|
|
|
1792
|
+
/* Bind listener for custom event */
|
|
1805
1793
|
target.prototype.customBindListener = function (ele) {
|
|
1806
1794
|
var _this = this;
|
|
1807
|
-
|
|
1808
1795
|
var _this$state = this.state,
|
|
1809
|
-
|
|
1810
|
-
|
|
1796
|
+
event = _this$state.event,
|
|
1797
|
+
eventOff = _this$state.eventOff;
|
|
1811
1798
|
var dataEvent = ele.getAttribute('data-event') || event;
|
|
1812
1799
|
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
|
|
1813
1800
|
dataEvent.split(' ').forEach(function (event) {
|
|
@@ -1816,7 +1803,6 @@ function customEvent (target) {
|
|
|
1816
1803
|
customListeners.set(ele, event, customListener);
|
|
1817
1804
|
ele.addEventListener(event, customListener, false);
|
|
1818
1805
|
});
|
|
1819
|
-
|
|
1820
1806
|
if (dataEventOff) {
|
|
1821
1807
|
dataEventOff.split(' ').forEach(function (event) {
|
|
1822
1808
|
ele.removeEventListener(event, _this.hideTooltip);
|
|
@@ -1824,13 +1810,12 @@ function customEvent (target) {
|
|
|
1824
1810
|
});
|
|
1825
1811
|
}
|
|
1826
1812
|
};
|
|
1827
|
-
/* Unbind listener for custom event */
|
|
1828
|
-
|
|
1829
1813
|
|
|
1814
|
+
/* Unbind listener for custom event */
|
|
1830
1815
|
target.prototype.customUnbindListener = function (ele) {
|
|
1831
1816
|
var _this$state2 = this.state,
|
|
1832
|
-
|
|
1833
|
-
|
|
1817
|
+
event = _this$state2.event,
|
|
1818
|
+
eventOff = _this$state2.eventOff;
|
|
1834
1819
|
var dataEvent = event || ele.getAttribute('data-event');
|
|
1835
1820
|
var dataEventOff = eventOff || ele.getAttribute('data-event-off');
|
|
1836
1821
|
ele.removeEventListener(dataEvent, customListeners.get(ele, event));
|
|
@@ -1841,6 +1826,7 @@ function customEvent (target) {
|
|
|
1841
1826
|
/**
|
|
1842
1827
|
* Util method to judge if it should follow capture model
|
|
1843
1828
|
*/
|
|
1829
|
+
|
|
1844
1830
|
function isCapture (target) {
|
|
1845
1831
|
target.prototype.isCapture = function (currentTarget) {
|
|
1846
1832
|
return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
|
|
@@ -1850,6 +1836,7 @@ function isCapture (target) {
|
|
|
1850
1836
|
/**
|
|
1851
1837
|
* Util method to get effect
|
|
1852
1838
|
*/
|
|
1839
|
+
|
|
1853
1840
|
function getEffect (target) {
|
|
1854
1841
|
target.prototype.getEffect = function (currentTarget) {
|
|
1855
1842
|
var dataEffect = currentTarget.getAttribute('data-effect');
|
|
@@ -1860,10 +1847,8 @@ function getEffect (target) {
|
|
|
1860
1847
|
/**
|
|
1861
1848
|
* Util method to get effect
|
|
1862
1849
|
*/
|
|
1863
|
-
|
|
1864
1850
|
var makeProxy = function makeProxy(e) {
|
|
1865
1851
|
var proxy = {};
|
|
1866
|
-
|
|
1867
1852
|
for (var key in e) {
|
|
1868
1853
|
if (typeof e[key] === 'function') {
|
|
1869
1854
|
proxy[key] = e[key].bind(e);
|
|
@@ -1871,44 +1856,37 @@ var makeProxy = function makeProxy(e) {
|
|
|
1871
1856
|
proxy[key] = e[key];
|
|
1872
1857
|
}
|
|
1873
1858
|
}
|
|
1874
|
-
|
|
1875
1859
|
return proxy;
|
|
1876
1860
|
};
|
|
1877
|
-
|
|
1878
1861
|
var bodyListener = function bodyListener(callback, options, e) {
|
|
1879
1862
|
var _options$respectEffec = options.respectEffect,
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1863
|
+
respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
|
|
1864
|
+
_options$customEvent = options.customEvent,
|
|
1865
|
+
customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
|
|
1883
1866
|
var id = this.props.id;
|
|
1884
1867
|
var tip = null;
|
|
1885
1868
|
var forId;
|
|
1886
1869
|
var target = e.target;
|
|
1887
|
-
var lastTarget;
|
|
1870
|
+
var lastTarget;
|
|
1871
|
+
// walk up parent chain until tip is found
|
|
1888
1872
|
// there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
|
|
1889
|
-
|
|
1890
1873
|
while (tip === null && target !== null) {
|
|
1891
1874
|
lastTarget = target;
|
|
1892
1875
|
tip = target.getAttribute('data-tip') || null;
|
|
1893
1876
|
forId = target.getAttribute('data-for') || null;
|
|
1894
1877
|
target = target.parentElement;
|
|
1895
1878
|
}
|
|
1896
|
-
|
|
1897
1879
|
target = lastTarget || e.target;
|
|
1898
|
-
|
|
1899
1880
|
if (this.isCustomEvent(target) && !customEvent) {
|
|
1900
1881
|
return;
|
|
1901
1882
|
}
|
|
1902
|
-
|
|
1903
1883
|
var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
|
|
1904
|
-
|
|
1905
1884
|
if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
|
|
1906
1885
|
var proxy = makeProxy(e);
|
|
1907
1886
|
proxy.currentTarget = target;
|
|
1908
1887
|
callback(proxy);
|
|
1909
1888
|
}
|
|
1910
1889
|
};
|
|
1911
|
-
|
|
1912
1890
|
var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
|
|
1913
1891
|
var events = {};
|
|
1914
1892
|
targetArray.forEach(function (target) {
|
|
@@ -1919,24 +1897,20 @@ var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
|
|
|
1919
1897
|
});
|
|
1920
1898
|
return events;
|
|
1921
1899
|
};
|
|
1922
|
-
|
|
1923
1900
|
var getBody = function getBody() {
|
|
1924
1901
|
return document.getElementsByTagName('body')[0];
|
|
1925
1902
|
};
|
|
1926
|
-
|
|
1927
1903
|
function bodyMode (target) {
|
|
1928
1904
|
target.prototype.isBodyMode = function () {
|
|
1929
1905
|
return !!this.props.bodyMode;
|
|
1930
1906
|
};
|
|
1931
|
-
|
|
1932
1907
|
target.prototype.bindBodyListener = function (targetArray) {
|
|
1933
1908
|
var _this = this;
|
|
1934
|
-
|
|
1935
1909
|
var _this$state = this.state,
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1910
|
+
event = _this$state.event,
|
|
1911
|
+
eventOff = _this$state.eventOff,
|
|
1912
|
+
possibleCustomEvents = _this$state.possibleCustomEvents,
|
|
1913
|
+
possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
|
|
1940
1914
|
var body = getBody();
|
|
1941
1915
|
var customEvents = findCustomEvents(targetArray, 'data-event');
|
|
1942
1916
|
var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
|
|
@@ -1950,7 +1924,6 @@ function bodyMode (target) {
|
|
|
1950
1924
|
});
|
|
1951
1925
|
this.unbindBodyListener(body);
|
|
1952
1926
|
var listeners = this.bodyModeListeners = {};
|
|
1953
|
-
|
|
1954
1927
|
if (event == null) {
|
|
1955
1928
|
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
|
|
1956
1929
|
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
|
|
@@ -1958,7 +1931,6 @@ function bodyMode (target) {
|
|
|
1958
1931
|
});
|
|
1959
1932
|
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
|
|
1960
1933
|
}
|
|
1961
|
-
|
|
1962
1934
|
for (var _event in customEvents) {
|
|
1963
1935
|
listeners[_event] = bodyListener.bind(this, function (e) {
|
|
1964
1936
|
var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
|
|
@@ -1967,22 +1939,18 @@ function bodyMode (target) {
|
|
|
1967
1939
|
customEvent: true
|
|
1968
1940
|
});
|
|
1969
1941
|
}
|
|
1970
|
-
|
|
1971
1942
|
for (var _event2 in customEventsOff) {
|
|
1972
1943
|
listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
|
|
1973
1944
|
customEvent: true
|
|
1974
1945
|
});
|
|
1975
1946
|
}
|
|
1976
|
-
|
|
1977
1947
|
for (var _event3 in listeners) {
|
|
1978
1948
|
body.addEventListener(_event3, listeners[_event3]);
|
|
1979
1949
|
}
|
|
1980
1950
|
};
|
|
1981
|
-
|
|
1982
1951
|
target.prototype.unbindBodyListener = function (body) {
|
|
1983
1952
|
body = body || getBody();
|
|
1984
1953
|
var listeners = this.bodyModeListeners;
|
|
1985
|
-
|
|
1986
1954
|
for (var event in listeners) {
|
|
1987
1955
|
body.removeEventListener(event, listeners[event]);
|
|
1988
1956
|
}
|
|
@@ -1997,27 +1965,23 @@ function bodyMode (target) {
|
|
|
1997
1965
|
*
|
|
1998
1966
|
* If MutationObserver is not available, this feature just doesn't work.
|
|
1999
1967
|
*/
|
|
1968
|
+
|
|
2000
1969
|
// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
|
|
2001
1970
|
var getMutationObserverClass = function getMutationObserverClass() {
|
|
2002
1971
|
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
|
2003
1972
|
};
|
|
2004
|
-
|
|
2005
1973
|
function trackRemoval (target) {
|
|
2006
1974
|
target.prototype.bindRemovalTracker = function () {
|
|
2007
1975
|
var _this = this;
|
|
2008
|
-
|
|
2009
1976
|
var MutationObserver = getMutationObserverClass();
|
|
2010
1977
|
if (MutationObserver == null) return;
|
|
2011
1978
|
var observer = new MutationObserver(function (mutations) {
|
|
2012
1979
|
for (var m1 = 0; m1 < mutations.length; m1++) {
|
|
2013
1980
|
var mutation = mutations[m1];
|
|
2014
|
-
|
|
2015
1981
|
for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
|
|
2016
1982
|
var element = mutation.removedNodes[m2];
|
|
2017
|
-
|
|
2018
1983
|
if (element === _this.state.currentTarget) {
|
|
2019
1984
|
_this.hideTooltip();
|
|
2020
|
-
|
|
2021
1985
|
return;
|
|
2022
1986
|
}
|
|
2023
1987
|
}
|
|
@@ -2029,7 +1993,6 @@ function trackRemoval (target) {
|
|
|
2029
1993
|
});
|
|
2030
1994
|
this.removalTracker = observer;
|
|
2031
1995
|
};
|
|
2032
|
-
|
|
2033
1996
|
target.prototype.unbindRemovalTracker = function () {
|
|
2034
1997
|
if (this.removalTracker) {
|
|
2035
1998
|
this.removalTracker.disconnect();
|
|
@@ -2056,50 +2019,43 @@ function trackRemoval (target) {
|
|
|
2056
2019
|
*/
|
|
2057
2020
|
function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
2058
2021
|
var _getDimensions = getDimensions(node),
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2022
|
+
tipWidth = _getDimensions.width,
|
|
2023
|
+
tipHeight = _getDimensions.height;
|
|
2062
2024
|
var _getDimensions2 = getDimensions(target),
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2025
|
+
targetWidth = _getDimensions2.width,
|
|
2026
|
+
targetHeight = _getDimensions2.height;
|
|
2066
2027
|
var _getCurrentOffset = getCurrentOffset(e, target, effect),
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2028
|
+
mouseX = _getCurrentOffset.mouseX,
|
|
2029
|
+
mouseY = _getCurrentOffset.mouseY;
|
|
2070
2030
|
var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
|
|
2071
|
-
|
|
2072
2031
|
var _calculateOffset = calculateOffset(offset),
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2032
|
+
extraOffsetX = _calculateOffset.extraOffsetX,
|
|
2033
|
+
extraOffsetY = _calculateOffset.extraOffsetY;
|
|
2076
2034
|
var windowWidth = window.innerWidth;
|
|
2077
2035
|
var windowHeight = window.innerHeight;
|
|
2078
|
-
|
|
2079
2036
|
var _getParent = getParent(node),
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2037
|
+
parentTop = _getParent.parentTop,
|
|
2038
|
+
parentLeft = _getParent.parentLeft;
|
|
2083
2039
|
|
|
2040
|
+
// Get the edge offset of the tooltip
|
|
2084
2041
|
var getTipOffsetLeft = function getTipOffsetLeft(place) {
|
|
2085
2042
|
var offsetX = defaultOffset[place].l;
|
|
2086
2043
|
return mouseX + offsetX + extraOffsetX;
|
|
2087
2044
|
};
|
|
2088
|
-
|
|
2089
2045
|
var getTipOffsetRight = function getTipOffsetRight(place) {
|
|
2090
2046
|
var offsetX = defaultOffset[place].r;
|
|
2091
2047
|
return mouseX + offsetX + extraOffsetX;
|
|
2092
2048
|
};
|
|
2093
|
-
|
|
2094
2049
|
var getTipOffsetTop = function getTipOffsetTop(place) {
|
|
2095
2050
|
var offsetY = defaultOffset[place].t;
|
|
2096
2051
|
return mouseY + offsetY + extraOffsetY;
|
|
2097
2052
|
};
|
|
2098
|
-
|
|
2099
2053
|
var getTipOffsetBottom = function getTipOffsetBottom(place) {
|
|
2100
2054
|
var offsetY = defaultOffset[place].b;
|
|
2101
2055
|
return mouseY + offsetY + extraOffsetY;
|
|
2102
|
-
};
|
|
2056
|
+
};
|
|
2057
|
+
|
|
2058
|
+
//
|
|
2103
2059
|
// Functions to test whether the tooltip's sides are inside
|
|
2104
2060
|
// the client window for a given orientation p
|
|
2105
2061
|
//
|
|
@@ -2113,70 +2069,56 @@ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
|
2113
2069
|
// |
|
|
2114
2070
|
// Bottom side
|
|
2115
2071
|
//
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
2072
|
var outsideLeft = function outsideLeft(p) {
|
|
2119
2073
|
return getTipOffsetLeft(p) < 0;
|
|
2120
2074
|
};
|
|
2121
|
-
|
|
2122
2075
|
var outsideRight = function outsideRight(p) {
|
|
2123
2076
|
return getTipOffsetRight(p) > windowWidth;
|
|
2124
2077
|
};
|
|
2125
|
-
|
|
2126
2078
|
var outsideTop = function outsideTop(p) {
|
|
2127
2079
|
return getTipOffsetTop(p) < 0;
|
|
2128
2080
|
};
|
|
2129
|
-
|
|
2130
2081
|
var outsideBottom = function outsideBottom(p) {
|
|
2131
2082
|
return getTipOffsetBottom(p) > windowHeight;
|
|
2132
|
-
};
|
|
2133
|
-
|
|
2083
|
+
};
|
|
2134
2084
|
|
|
2085
|
+
// Check whether the tooltip with orientation p is completely inside the client window
|
|
2135
2086
|
var outside = function outside(p) {
|
|
2136
2087
|
return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
|
|
2137
2088
|
};
|
|
2138
|
-
|
|
2139
2089
|
var inside = function inside(p) {
|
|
2140
2090
|
return !outside(p);
|
|
2141
2091
|
};
|
|
2142
|
-
|
|
2143
2092
|
var placeIsInside = {
|
|
2144
2093
|
top: inside('top'),
|
|
2145
2094
|
bottom: inside('bottom'),
|
|
2146
2095
|
left: inside('left'),
|
|
2147
2096
|
right: inside('right')
|
|
2148
2097
|
};
|
|
2149
|
-
|
|
2150
2098
|
function choose() {
|
|
2151
2099
|
var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
|
|
2152
|
-
|
|
2153
2100
|
var _iterator = _createForOfIteratorHelper(allPlaces),
|
|
2154
|
-
|
|
2155
|
-
|
|
2101
|
+
_step;
|
|
2156
2102
|
try {
|
|
2157
2103
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2158
2104
|
var d = _step.value;
|
|
2159
2105
|
if (placeIsInside[d]) return d;
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2106
|
+
}
|
|
2107
|
+
// if nothing is inside, just use the old place.
|
|
2162
2108
|
} catch (err) {
|
|
2163
2109
|
_iterator.e(err);
|
|
2164
2110
|
} finally {
|
|
2165
2111
|
_iterator.f();
|
|
2166
2112
|
}
|
|
2167
|
-
|
|
2168
2113
|
return place;
|
|
2169
2114
|
}
|
|
2170
|
-
|
|
2171
2115
|
var chosen = choose();
|
|
2172
2116
|
var isNewState = false;
|
|
2173
2117
|
var newPlace;
|
|
2174
|
-
|
|
2175
2118
|
if (chosen && chosen !== place) {
|
|
2176
2119
|
isNewState = true;
|
|
2177
2120
|
newPlace = chosen;
|
|
2178
2121
|
}
|
|
2179
|
-
|
|
2180
2122
|
if (isNewState) {
|
|
2181
2123
|
return {
|
|
2182
2124
|
isNewState: true,
|
|
@@ -2185,7 +2127,6 @@ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
|
2185
2127
|
}
|
|
2186
2128
|
};
|
|
2187
2129
|
}
|
|
2188
|
-
|
|
2189
2130
|
return {
|
|
2190
2131
|
isNewState: false,
|
|
2191
2132
|
position: {
|
|
@@ -2194,43 +2135,38 @@ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
|
2194
2135
|
}
|
|
2195
2136
|
};
|
|
2196
2137
|
}
|
|
2197
|
-
|
|
2198
2138
|
var getDimensions = function getDimensions(node) {
|
|
2199
2139
|
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2140
|
+
height = _node$getBoundingClie.height,
|
|
2141
|
+
width = _node$getBoundingClie.width;
|
|
2203
2142
|
return {
|
|
2204
2143
|
height: parseInt(height, 10),
|
|
2205
2144
|
width: parseInt(width, 10)
|
|
2206
2145
|
};
|
|
2207
|
-
};
|
|
2208
|
-
|
|
2146
|
+
};
|
|
2209
2147
|
|
|
2148
|
+
// Get current mouse offset
|
|
2210
2149
|
var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
|
|
2211
2150
|
var boundingClientRect = currentTarget.getBoundingClientRect();
|
|
2212
2151
|
var targetTop = boundingClientRect.top;
|
|
2213
2152
|
var targetLeft = boundingClientRect.left;
|
|
2214
|
-
|
|
2215
2153
|
var _getDimensions3 = getDimensions(currentTarget),
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2154
|
+
targetWidth = _getDimensions3.width,
|
|
2155
|
+
targetHeight = _getDimensions3.height;
|
|
2219
2156
|
if (effect === 'float') {
|
|
2220
2157
|
return {
|
|
2221
2158
|
mouseX: e.clientX,
|
|
2222
2159
|
mouseY: e.clientY
|
|
2223
2160
|
};
|
|
2224
2161
|
}
|
|
2225
|
-
|
|
2226
2162
|
return {
|
|
2227
2163
|
mouseX: targetLeft + targetWidth / 2,
|
|
2228
2164
|
mouseY: targetTop + targetHeight / 2
|
|
2229
2165
|
};
|
|
2230
|
-
};
|
|
2231
|
-
// This is useful in judging if it is necessary for tooltip to switch position when out of window
|
|
2232
|
-
|
|
2166
|
+
};
|
|
2233
2167
|
|
|
2168
|
+
// List all possibility of tooltip final offset
|
|
2169
|
+
// This is useful in judging if it is necessary for tooltip to switch position when out of window
|
|
2234
2170
|
var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
|
|
2235
2171
|
var top;
|
|
2236
2172
|
var right;
|
|
@@ -2291,24 +2227,21 @@ var getDefaultPosition = function getDefaultPosition(effect, targetWidth, target
|
|
|
2291
2227
|
b: tipHeight / 2
|
|
2292
2228
|
};
|
|
2293
2229
|
}
|
|
2294
|
-
|
|
2295
2230
|
return {
|
|
2296
2231
|
top: top,
|
|
2297
2232
|
bottom: bottom,
|
|
2298
2233
|
left: left,
|
|
2299
2234
|
right: right
|
|
2300
2235
|
};
|
|
2301
|
-
};
|
|
2302
|
-
|
|
2236
|
+
};
|
|
2303
2237
|
|
|
2238
|
+
// Consider additional offset into position calculation
|
|
2304
2239
|
var calculateOffset = function calculateOffset(offset) {
|
|
2305
2240
|
var extraOffsetX = 0;
|
|
2306
2241
|
var extraOffsetY = 0;
|
|
2307
|
-
|
|
2308
2242
|
if (Object.prototype.toString.apply(offset) === '[object String]') {
|
|
2309
2243
|
offset = JSON.parse(offset.toString().replace(/'/g, '"'));
|
|
2310
2244
|
}
|
|
2311
|
-
|
|
2312
2245
|
for (var key in offset) {
|
|
2313
2246
|
if (key === 'top') {
|
|
2314
2247
|
extraOffsetY -= parseInt(offset[key], 10);
|
|
@@ -2320,25 +2253,22 @@ var calculateOffset = function calculateOffset(offset) {
|
|
|
2320
2253
|
extraOffsetX += parseInt(offset[key], 10);
|
|
2321
2254
|
}
|
|
2322
2255
|
}
|
|
2323
|
-
|
|
2324
2256
|
return {
|
|
2325
2257
|
extraOffsetX: extraOffsetX,
|
|
2326
2258
|
extraOffsetY: extraOffsetY
|
|
2327
2259
|
};
|
|
2328
|
-
};
|
|
2329
|
-
|
|
2260
|
+
};
|
|
2330
2261
|
|
|
2262
|
+
// Get the offset of the parent elements
|
|
2331
2263
|
var getParent = function getParent(currentTarget) {
|
|
2332
2264
|
var currentParent = currentTarget;
|
|
2333
|
-
|
|
2334
2265
|
while (currentParent) {
|
|
2335
|
-
var computedStyle = window.getComputedStyle(currentParent);
|
|
2266
|
+
var computedStyle = window.getComputedStyle(currentParent);
|
|
2267
|
+
// transform and will-change: transform change the containing block
|
|
2336
2268
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
|
|
2337
|
-
|
|
2338
2269
|
if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
|
|
2339
2270
|
currentParent = currentParent.parentElement;
|
|
2340
2271
|
}
|
|
2341
|
-
|
|
2342
2272
|
var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
|
|
2343
2273
|
var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
|
|
2344
2274
|
return {
|
|
@@ -2363,17 +2293,15 @@ var getParent = function getParent(currentTarget) {
|
|
|
2363
2293
|
function TipContent(tip, children, getContent, multiline) {
|
|
2364
2294
|
if (children) return children;
|
|
2365
2295
|
if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
|
|
2366
|
-
|
|
2367
2296
|
if (getContent === null) return null; // Tip not exist and children is null or undefined
|
|
2368
2297
|
|
|
2369
2298
|
var regexp = /<br\s*\/?>/;
|
|
2370
|
-
|
|
2371
2299
|
if (!multiline || multiline === 'false' || !regexp.test(tip)) {
|
|
2372
2300
|
// No trim(), so that user can keep their input
|
|
2373
2301
|
return tip;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2302
|
+
}
|
|
2376
2303
|
|
|
2304
|
+
// Multiline tooltip content
|
|
2377
2305
|
return tip.split(regexp).map(function (d, i) {
|
|
2378
2306
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2379
2307
|
key: i,
|
|
@@ -2404,13 +2332,12 @@ function parseAria(props) {
|
|
|
2404
2332
|
* @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
|
|
2405
2333
|
* NodeLists are functions in Safari
|
|
2406
2334
|
*/
|
|
2335
|
+
|
|
2407
2336
|
function nodeListToArray (nodeList) {
|
|
2408
2337
|
var length = nodeList.length;
|
|
2409
|
-
|
|
2410
2338
|
if (nodeList.hasOwnProperty) {
|
|
2411
2339
|
return Array.prototype.slice.call(nodeList);
|
|
2412
2340
|
}
|
|
2413
|
-
|
|
2414
2341
|
return new Array(length).fill().map(function (index) {
|
|
2415
2342
|
return nodeList[index];
|
|
2416
2343
|
});
|
|
@@ -2471,14 +2398,13 @@ var DEFAULT_PADDING = '8px 21px';
|
|
|
2471
2398
|
/**
|
|
2472
2399
|
* Generates the specific tooltip style for use on render.
|
|
2473
2400
|
*/
|
|
2474
|
-
|
|
2475
2401
|
function generateTooltipStyle(uuid, customColors, type, hasBorder, padding) {
|
|
2476
2402
|
return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding);
|
|
2477
2403
|
}
|
|
2404
|
+
|
|
2478
2405
|
/**
|
|
2479
2406
|
* Generates the tooltip style rules based on the element-specified "data-type" property.
|
|
2480
2407
|
*/
|
|
2481
|
-
|
|
2482
2408
|
function generateStyle(uuid, colors) {
|
|
2483
2409
|
var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
|
|
2484
2410
|
var textColor = colors.text;
|
|
@@ -2487,22 +2413,18 @@ function generateStyle(uuid, colors) {
|
|
|
2487
2413
|
var arrowColor = colors.arrow;
|
|
2488
2414
|
return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n\t padding: ").concat(padding, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n border-top: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(arrowColor, ";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n border-bottom: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(arrowColor, ";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n border-left: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(arrowColor, ";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n border-right: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(arrowColor, ";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ");
|
|
2489
2415
|
}
|
|
2490
|
-
|
|
2491
2416
|
function getPopupColors(customColors, type, hasBorder) {
|
|
2492
2417
|
var textColor = customColors.text;
|
|
2493
2418
|
var backgroundColor = customColors.background;
|
|
2494
2419
|
var borderColor = customColors.border;
|
|
2495
2420
|
var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
|
|
2496
2421
|
var colors = getDefaultPopupColors(type);
|
|
2497
|
-
|
|
2498
2422
|
if (textColor) {
|
|
2499
2423
|
colors.text = textColor;
|
|
2500
2424
|
}
|
|
2501
|
-
|
|
2502
2425
|
if (backgroundColor) {
|
|
2503
2426
|
colors.background = backgroundColor;
|
|
2504
2427
|
}
|
|
2505
|
-
|
|
2506
2428
|
if (hasBorder) {
|
|
2507
2429
|
if (borderColor) {
|
|
2508
2430
|
colors.border = borderColor;
|
|
@@ -2510,27 +2432,21 @@ function getPopupColors(customColors, type, hasBorder) {
|
|
|
2510
2432
|
colors.border = type === 'light' ? 'black' : 'white';
|
|
2511
2433
|
}
|
|
2512
2434
|
}
|
|
2513
|
-
|
|
2514
2435
|
if (arrowColor) {
|
|
2515
2436
|
colors.arrow = arrowColor;
|
|
2516
2437
|
}
|
|
2517
|
-
|
|
2518
2438
|
return colors;
|
|
2519
2439
|
}
|
|
2520
2440
|
|
|
2521
2441
|
var _class, _class2;
|
|
2522
|
-
/* Polyfill */
|
|
2523
2442
|
|
|
2443
|
+
/* Polyfill */
|
|
2524
2444
|
var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
|
|
2525
2445
|
_inherits(ReactTooltip, _React$Component);
|
|
2526
|
-
|
|
2527
2446
|
var _super = _createSuper(ReactTooltip);
|
|
2528
|
-
|
|
2529
2447
|
function ReactTooltip(props) {
|
|
2530
2448
|
var _this;
|
|
2531
|
-
|
|
2532
2449
|
_classCallCheck(this, ReactTooltip);
|
|
2533
|
-
|
|
2534
2450
|
_this = _super.call(this, props);
|
|
2535
2451
|
_this.state = {
|
|
2536
2452
|
uuid: props.uuid || generateUUID(),
|
|
@@ -2543,6 +2459,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2543
2459
|
// float or fixed
|
|
2544
2460
|
show: false,
|
|
2545
2461
|
border: false,
|
|
2462
|
+
borderClass: 'border',
|
|
2546
2463
|
customColors: {},
|
|
2547
2464
|
offset: {},
|
|
2548
2465
|
padding: props.padding,
|
|
@@ -2565,9 +2482,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2565
2482
|
originTooltip: null,
|
|
2566
2483
|
isMultiline: false
|
|
2567
2484
|
};
|
|
2568
|
-
|
|
2569
2485
|
_this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);
|
|
2570
|
-
|
|
2571
2486
|
_this.mount = true;
|
|
2572
2487
|
_this.delayShowLoop = null;
|
|
2573
2488
|
_this.delayHideLoop = null;
|
|
@@ -2575,16 +2490,14 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2575
2490
|
_this.intervalUpdateContent = null;
|
|
2576
2491
|
return _this;
|
|
2577
2492
|
}
|
|
2493
|
+
|
|
2578
2494
|
/**
|
|
2579
2495
|
* For unify the bind and unbind listener
|
|
2580
2496
|
*/
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
2497
|
_createClass(ReactTooltip, [{
|
|
2584
2498
|
key: "bind",
|
|
2585
2499
|
value: function bind(methodArray) {
|
|
2586
2500
|
var _this2 = this;
|
|
2587
|
-
|
|
2588
2501
|
methodArray.forEach(function (method) {
|
|
2589
2502
|
_this2[method] = _this2[method].bind(_this2);
|
|
2590
2503
|
});
|
|
@@ -2593,13 +2506,11 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2593
2506
|
key: "componentDidMount",
|
|
2594
2507
|
value: function componentDidMount() {
|
|
2595
2508
|
var _this$props = this.props;
|
|
2596
|
-
|
|
2597
|
-
|
|
2509
|
+
_this$props.insecure;
|
|
2510
|
+
var resizeHide = _this$props.resizeHide;
|
|
2598
2511
|
this.mount = true;
|
|
2599
2512
|
this.bindListener(); // Bind listener for tooltip
|
|
2600
|
-
|
|
2601
2513
|
this.bindWindowEvents(resizeHide); // Bind global event for static method
|
|
2602
|
-
|
|
2603
2514
|
this.injectStyles(); // Inject styles for each DOM root having tooltip.
|
|
2604
2515
|
}
|
|
2605
2516
|
}, {
|
|
@@ -2611,39 +2522,33 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2611
2522
|
this.removeScrollListener(this.state.currentTarget);
|
|
2612
2523
|
this.unbindWindowEvents();
|
|
2613
2524
|
}
|
|
2614
|
-
/* Look for the closest DOM root having tooltip and inject styles. */
|
|
2615
2525
|
|
|
2526
|
+
/* Look for the closest DOM root having tooltip and inject styles. */
|
|
2616
2527
|
}, {
|
|
2617
2528
|
key: "injectStyles",
|
|
2618
2529
|
value: function injectStyles() {
|
|
2619
2530
|
var tooltipRef = this.tooltipRef;
|
|
2620
|
-
|
|
2621
2531
|
if (!tooltipRef) {
|
|
2622
2532
|
return;
|
|
2623
2533
|
}
|
|
2624
|
-
|
|
2625
2534
|
var parentNode = tooltipRef.parentNode;
|
|
2626
|
-
|
|
2627
2535
|
while (parentNode.parentNode) {
|
|
2628
2536
|
parentNode = parentNode.parentNode;
|
|
2629
2537
|
}
|
|
2630
|
-
|
|
2631
2538
|
var domRoot;
|
|
2632
|
-
|
|
2633
2539
|
switch (parentNode.constructor.name) {
|
|
2634
2540
|
case 'Document':
|
|
2635
2541
|
case 'HTMLDocument':
|
|
2636
2542
|
case undefined:
|
|
2637
2543
|
domRoot = parentNode.head;
|
|
2638
2544
|
break;
|
|
2639
|
-
|
|
2640
2545
|
case 'ShadowRoot':
|
|
2641
2546
|
default:
|
|
2642
2547
|
domRoot = parentNode;
|
|
2643
2548
|
break;
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2549
|
+
}
|
|
2646
2550
|
|
|
2551
|
+
// Prevent styles duplication.
|
|
2647
2552
|
if (!domRoot.querySelector('style[data-react-tooltip]')) {
|
|
2648
2553
|
var style = document.createElement('style');
|
|
2649
2554
|
style.textContent = baseCss;
|
|
@@ -2651,16 +2556,15 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2651
2556
|
domRoot.appendChild(style);
|
|
2652
2557
|
}
|
|
2653
2558
|
}
|
|
2559
|
+
|
|
2654
2560
|
/**
|
|
2655
2561
|
* Return if the mouse is on the tooltip.
|
|
2656
2562
|
* @returns {boolean} true - mouse is on the tooltip
|
|
2657
2563
|
*/
|
|
2658
|
-
|
|
2659
2564
|
}, {
|
|
2660
2565
|
key: "mouseOnToolTip",
|
|
2661
2566
|
value: function mouseOnToolTip() {
|
|
2662
2567
|
var show = this.state.show;
|
|
2663
|
-
|
|
2664
2568
|
if (show && this.tooltipRef) {
|
|
2665
2569
|
/* old IE or Firefox work around */
|
|
2666
2570
|
if (!this.tooltipRef.matches) {
|
|
@@ -2672,30 +2576,27 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2672
2576
|
this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
|
|
2673
2577
|
}
|
|
2674
2578
|
}
|
|
2675
|
-
|
|
2676
2579
|
return this.tooltipRef.matches(':hover');
|
|
2677
2580
|
}
|
|
2678
|
-
|
|
2679
2581
|
return false;
|
|
2680
2582
|
}
|
|
2583
|
+
|
|
2681
2584
|
/**
|
|
2682
2585
|
* Pick out corresponded target elements
|
|
2683
2586
|
*/
|
|
2684
|
-
|
|
2685
2587
|
}, {
|
|
2686
2588
|
key: "getTargetArray",
|
|
2687
2589
|
value: function getTargetArray(id) {
|
|
2688
2590
|
var targetArray = [];
|
|
2689
2591
|
var selector;
|
|
2690
|
-
|
|
2691
2592
|
if (!id) {
|
|
2692
2593
|
selector = '[data-tip]:not([data-for])';
|
|
2693
2594
|
} else {
|
|
2694
2595
|
var escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
2695
2596
|
selector = "[data-tip][data-for=\"".concat(escaped, "\"]");
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2597
|
+
}
|
|
2698
2598
|
|
|
2599
|
+
// Scan document for shadow DOM elements
|
|
2699
2600
|
nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {
|
|
2700
2601
|
return element.shadowRoot;
|
|
2701
2602
|
}).forEach(function (element) {
|
|
@@ -2703,101 +2604,87 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2703
2604
|
});
|
|
2704
2605
|
return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));
|
|
2705
2606
|
}
|
|
2607
|
+
|
|
2706
2608
|
/**
|
|
2707
2609
|
* Bind listener to the target elements
|
|
2708
2610
|
* These listeners used to trigger showing or hiding the tooltip
|
|
2709
2611
|
*/
|
|
2710
|
-
|
|
2711
2612
|
}, {
|
|
2712
2613
|
key: "bindListener",
|
|
2713
2614
|
value: function bindListener() {
|
|
2714
2615
|
var _this3 = this;
|
|
2715
|
-
|
|
2716
2616
|
var _this$props2 = this.props,
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2617
|
+
id = _this$props2.id,
|
|
2618
|
+
globalEventOff = _this$props2.globalEventOff,
|
|
2619
|
+
isCapture = _this$props2.isCapture;
|
|
2720
2620
|
var targetArray = this.getTargetArray(id);
|
|
2721
2621
|
targetArray.forEach(function (target) {
|
|
2722
2622
|
if (target.getAttribute('currentItem') === null) {
|
|
2723
2623
|
target.setAttribute('currentItem', 'false');
|
|
2724
2624
|
}
|
|
2725
|
-
|
|
2726
2625
|
_this3.unbindBasicListener(target);
|
|
2727
|
-
|
|
2728
2626
|
if (_this3.isCustomEvent(target)) {
|
|
2729
2627
|
_this3.customUnbindListener(target);
|
|
2730
2628
|
}
|
|
2731
2629
|
});
|
|
2732
|
-
|
|
2733
2630
|
if (this.isBodyMode()) {
|
|
2734
2631
|
this.bindBodyListener(targetArray);
|
|
2735
2632
|
} else {
|
|
2736
2633
|
targetArray.forEach(function (target) {
|
|
2737
2634
|
var isCaptureMode = _this3.isCapture(target);
|
|
2738
|
-
|
|
2739
2635
|
var effect = _this3.getEffect(target);
|
|
2740
|
-
|
|
2741
2636
|
if (_this3.isCustomEvent(target)) {
|
|
2742
2637
|
_this3.customBindListener(target);
|
|
2743
|
-
|
|
2744
2638
|
return;
|
|
2745
2639
|
}
|
|
2746
|
-
|
|
2747
2640
|
target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
|
|
2748
2641
|
target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
|
|
2749
|
-
|
|
2750
2642
|
if (effect === 'float') {
|
|
2751
2643
|
target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
|
|
2752
2644
|
}
|
|
2753
|
-
|
|
2754
2645
|
target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
|
|
2755
2646
|
target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
|
|
2756
2647
|
});
|
|
2757
|
-
}
|
|
2758
|
-
|
|
2648
|
+
}
|
|
2759
2649
|
|
|
2650
|
+
// Global event to hide tooltip
|
|
2760
2651
|
if (globalEventOff) {
|
|
2761
2652
|
window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
2762
2653
|
window.addEventListener(globalEventOff, this.hideTooltip, isCapture);
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2654
|
+
}
|
|
2765
2655
|
|
|
2656
|
+
// Track removal of targetArray elements from DOM
|
|
2766
2657
|
this.bindRemovalTracker();
|
|
2767
2658
|
}
|
|
2659
|
+
|
|
2768
2660
|
/**
|
|
2769
2661
|
* Unbind listeners on target elements
|
|
2770
2662
|
*/
|
|
2771
|
-
|
|
2772
2663
|
}, {
|
|
2773
2664
|
key: "unbindListener",
|
|
2774
2665
|
value: function unbindListener() {
|
|
2775
2666
|
var _this4 = this;
|
|
2776
|
-
|
|
2777
2667
|
var _this$props3 = this.props,
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2668
|
+
id = _this$props3.id,
|
|
2669
|
+
globalEventOff = _this$props3.globalEventOff;
|
|
2781
2670
|
if (this.isBodyMode()) {
|
|
2782
2671
|
this.unbindBodyListener();
|
|
2783
2672
|
} else {
|
|
2784
2673
|
var targetArray = this.getTargetArray(id);
|
|
2785
2674
|
targetArray.forEach(function (target) {
|
|
2786
2675
|
_this4.unbindBasicListener(target);
|
|
2787
|
-
|
|
2788
2676
|
if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);
|
|
2789
2677
|
});
|
|
2790
2678
|
}
|
|
2791
|
-
|
|
2792
2679
|
if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
2793
2680
|
this.unbindRemovalTracker();
|
|
2794
2681
|
}
|
|
2682
|
+
|
|
2795
2683
|
/**
|
|
2796
2684
|
* Invoke this before bind listener and unmount the component
|
|
2797
2685
|
* it is necessary to invoke this even when binding custom event
|
|
2798
2686
|
* so that the tooltip can switch between custom and default listener
|
|
2799
2687
|
*/
|
|
2800
|
-
|
|
2801
2688
|
}, {
|
|
2802
2689
|
key: "unbindBasicListener",
|
|
2803
2690
|
value: function unbindBasicListener(target) {
|
|
@@ -2810,11 +2697,11 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2810
2697
|
key: "getTooltipContent",
|
|
2811
2698
|
value: function getTooltipContent() {
|
|
2812
2699
|
var _this$props4 = this.props,
|
|
2813
|
-
|
|
2814
|
-
|
|
2700
|
+
getContent = _this$props4.getContent,
|
|
2701
|
+
children = _this$props4.children;
|
|
2815
2702
|
|
|
2703
|
+
// Generate tooltip content
|
|
2816
2704
|
var content;
|
|
2817
|
-
|
|
2818
2705
|
if (getContent) {
|
|
2819
2706
|
if (Array.isArray(getContent)) {
|
|
2820
2707
|
content = getContent[0] && getContent[0](this.state.originTooltip);
|
|
@@ -2822,7 +2709,6 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2822
2709
|
content = getContent(this.state.originTooltip);
|
|
2823
2710
|
}
|
|
2824
2711
|
}
|
|
2825
|
-
|
|
2826
2712
|
return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
|
|
2827
2713
|
}
|
|
2828
2714
|
}, {
|
|
@@ -2830,17 +2716,16 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2830
2716
|
value: function isEmptyTip(placeholder) {
|
|
2831
2717
|
return typeof placeholder === 'string' && placeholder === '' || placeholder === null;
|
|
2832
2718
|
}
|
|
2719
|
+
|
|
2833
2720
|
/**
|
|
2834
2721
|
* When mouse enter, show the tooltip
|
|
2835
2722
|
*/
|
|
2836
|
-
|
|
2837
2723
|
}, {
|
|
2838
2724
|
key: "showTooltip",
|
|
2839
2725
|
value: function showTooltip(e, isGlobalCall) {
|
|
2840
2726
|
if (!this.tooltipRef) {
|
|
2841
2727
|
return;
|
|
2842
2728
|
}
|
|
2843
|
-
|
|
2844
2729
|
if (isGlobalCall) {
|
|
2845
2730
|
// Don't trigger other elements belongs to other ReactTooltip
|
|
2846
2731
|
var targetArray = this.getTargetArray(this.props.id);
|
|
@@ -2848,48 +2733,46 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2848
2733
|
return ele === e.currentTarget;
|
|
2849
2734
|
});
|
|
2850
2735
|
if (!isMyElement) return;
|
|
2851
|
-
}
|
|
2736
|
+
}
|
|
2737
|
+
// Get the tooltip content
|
|
2852
2738
|
// calculate in this phrase so that tip width height can be detected
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
2739
|
var _this$props5 = this.props,
|
|
2856
|
-
|
|
2857
|
-
|
|
2740
|
+
multiline = _this$props5.multiline,
|
|
2741
|
+
getContent = _this$props5.getContent;
|
|
2858
2742
|
var originTooltip = e.currentTarget.getAttribute('data-tip');
|
|
2859
|
-
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
|
|
2743
|
+
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
|
|
2860
2744
|
|
|
2861
|
-
|
|
2745
|
+
// If it is focus event or called by ReactTooltip.show, switch to `solid` effect
|
|
2746
|
+
var switchToSolid = e instanceof window.FocusEvent || isGlobalCall;
|
|
2862
2747
|
|
|
2748
|
+
// if it needs to skip adding hide listener to scroll
|
|
2863
2749
|
var scrollHide = true;
|
|
2864
|
-
|
|
2865
2750
|
if (e.currentTarget.getAttribute('data-scroll-hide')) {
|
|
2866
2751
|
scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
|
|
2867
2752
|
} else if (this.props.scrollHide != null) {
|
|
2868
2753
|
scrollHide = this.props.scrollHide;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2754
|
+
}
|
|
2871
2755
|
|
|
2756
|
+
// adding aria-describedby to target to make tooltips read by screen readers
|
|
2872
2757
|
if (e && e.currentTarget && e.currentTarget.setAttribute) {
|
|
2873
2758
|
e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
|
|
2874
|
-
}
|
|
2875
|
-
|
|
2759
|
+
}
|
|
2876
2760
|
|
|
2761
|
+
// Make sure the correct place is set
|
|
2877
2762
|
var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
|
|
2878
2763
|
var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
|
|
2879
2764
|
var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
|
|
2880
2765
|
var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
|
|
2881
|
-
|
|
2882
2766
|
if (result.position && this.props.overridePosition) {
|
|
2883
2767
|
result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
|
|
2884
2768
|
}
|
|
2769
|
+
var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0];
|
|
2885
2770
|
|
|
2886
|
-
|
|
2887
|
-
|
|
2771
|
+
// To prevent previously created timers from triggering
|
|
2888
2772
|
this.clearTimer();
|
|
2889
2773
|
var target = e.currentTarget;
|
|
2890
2774
|
var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;
|
|
2891
2775
|
var self = this;
|
|
2892
|
-
|
|
2893
2776
|
var updateState = function updateState() {
|
|
2894
2777
|
self.setState({
|
|
2895
2778
|
originTooltip: originTooltip,
|
|
@@ -2911,6 +2794,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2911
2794
|
delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
|
|
2912
2795
|
delayUpdate: target.getAttribute('data-delay-update') || self.props.delayUpdate || 0,
|
|
2913
2796
|
border: (target.getAttribute('data-border') ? target.getAttribute('data-border') === 'true' : self.props.border) || false,
|
|
2797
|
+
borderClass: target.getAttribute('data-border-class') || self.props.borderClass || 'border',
|
|
2914
2798
|
extraClass: target.getAttribute('data-class') || self.props["class"] || self.props.className || '',
|
|
2915
2799
|
disable: (target.getAttribute('data-tip-disable') ? target.getAttribute('data-tip-disable') === 'true' : self.props.disable) || false,
|
|
2916
2800
|
currentTarget: target
|
|
@@ -2918,9 +2802,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2918
2802
|
if (scrollHide) {
|
|
2919
2803
|
self.addScrollListener(self.state.currentTarget);
|
|
2920
2804
|
}
|
|
2921
|
-
|
|
2922
2805
|
self.updateTooltip(e);
|
|
2923
|
-
|
|
2924
2806
|
if (getContent && Array.isArray(getContent)) {
|
|
2925
2807
|
self.intervalUpdateContent = setInterval(function () {
|
|
2926
2808
|
if (self.mount) {
|
|
@@ -2935,48 +2817,45 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2935
2817
|
}, getContent[1]);
|
|
2936
2818
|
}
|
|
2937
2819
|
});
|
|
2938
|
-
};
|
|
2939
|
-
|
|
2820
|
+
};
|
|
2940
2821
|
|
|
2822
|
+
// If there is no delay call immediately, don't allow events to get in first.
|
|
2941
2823
|
if (reshowDelay) {
|
|
2942
2824
|
this.delayReshow = setTimeout(updateState, reshowDelay);
|
|
2943
2825
|
} else {
|
|
2944
2826
|
updateState();
|
|
2945
2827
|
}
|
|
2946
2828
|
}
|
|
2829
|
+
|
|
2947
2830
|
/**
|
|
2948
2831
|
* When mouse hover, update tool tip
|
|
2949
2832
|
*/
|
|
2950
|
-
|
|
2951
2833
|
}, {
|
|
2952
2834
|
key: "updateTooltip",
|
|
2953
2835
|
value: function updateTooltip(e) {
|
|
2954
2836
|
var _this5 = this;
|
|
2955
|
-
|
|
2956
2837
|
var _this$state = this.state,
|
|
2957
|
-
|
|
2958
|
-
|
|
2838
|
+
delayShow = _this$state.delayShow,
|
|
2839
|
+
disable = _this$state.disable;
|
|
2959
2840
|
var _this$props6 = this.props,
|
|
2960
|
-
|
|
2961
|
-
|
|
2841
|
+
afterShow = _this$props6.afterShow,
|
|
2842
|
+
disableProp = _this$props6.disable;
|
|
2962
2843
|
var placeholder = this.getTooltipContent();
|
|
2963
|
-
var eventTarget = e.currentTarget || e.target;
|
|
2844
|
+
var eventTarget = e.currentTarget || e.target;
|
|
2964
2845
|
|
|
2846
|
+
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
2965
2847
|
if (this.mouseOnToolTip()) {
|
|
2966
2848
|
return;
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2849
|
+
}
|
|
2969
2850
|
|
|
2851
|
+
// if the tooltip is empty, disable the tooltip
|
|
2970
2852
|
if (this.isEmptyTip(placeholder) || disable || disableProp) {
|
|
2971
2853
|
return;
|
|
2972
2854
|
}
|
|
2973
|
-
|
|
2974
2855
|
var delayTime = !this.state.show ? parseInt(delayShow, 10) : 0;
|
|
2975
|
-
|
|
2976
2856
|
var updateState = function updateState() {
|
|
2977
2857
|
if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {
|
|
2978
2858
|
var isInvisible = !_this5.state.show;
|
|
2979
|
-
|
|
2980
2859
|
_this5.setState({
|
|
2981
2860
|
currentEvent: e,
|
|
2982
2861
|
currentTarget: eventTarget,
|
|
@@ -2990,11 +2869,9 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
2990
2869
|
});
|
|
2991
2870
|
}
|
|
2992
2871
|
};
|
|
2993
|
-
|
|
2994
2872
|
if (this.delayShowLoop) {
|
|
2995
2873
|
clearTimeout(this.delayShowLoop);
|
|
2996
2874
|
}
|
|
2997
|
-
|
|
2998
2875
|
if (delayTime) {
|
|
2999
2876
|
this.delayShowLoop = setTimeout(updateState, delayTime);
|
|
3000
2877
|
} else {
|
|
@@ -3002,15 +2879,14 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3002
2879
|
updateState();
|
|
3003
2880
|
}
|
|
3004
2881
|
}
|
|
2882
|
+
|
|
3005
2883
|
/*
|
|
3006
2884
|
* If we're mousing over the tooltip remove it when we leave.
|
|
3007
2885
|
*/
|
|
3008
|
-
|
|
3009
2886
|
}, {
|
|
3010
2887
|
key: "listenForTooltipExit",
|
|
3011
2888
|
value: function listenForTooltipExit() {
|
|
3012
2889
|
var show = this.state.show;
|
|
3013
|
-
|
|
3014
2890
|
if (show && this.tooltipRef) {
|
|
3015
2891
|
this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);
|
|
3016
2892
|
}
|
|
@@ -3019,20 +2895,18 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3019
2895
|
key: "removeListenerForTooltipExit",
|
|
3020
2896
|
value: function removeListenerForTooltipExit() {
|
|
3021
2897
|
var show = this.state.show;
|
|
3022
|
-
|
|
3023
2898
|
if (show && this.tooltipRef) {
|
|
3024
2899
|
this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);
|
|
3025
2900
|
}
|
|
3026
2901
|
}
|
|
2902
|
+
|
|
3027
2903
|
/**
|
|
3028
2904
|
* When mouse leave, hide tooltip
|
|
3029
2905
|
*/
|
|
3030
|
-
|
|
3031
2906
|
}, {
|
|
3032
2907
|
key: "hideTooltip",
|
|
3033
2908
|
value: function hideTooltip(e, hasTarget) {
|
|
3034
2909
|
var _this6 = this;
|
|
3035
|
-
|
|
3036
2910
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
3037
2911
|
isScroll: false
|
|
3038
2912
|
};
|
|
@@ -3040,12 +2914,11 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3040
2914
|
var isScroll = options.isScroll;
|
|
3041
2915
|
var delayHide = isScroll ? 0 : this.state.delayHide;
|
|
3042
2916
|
var _this$props7 = this.props,
|
|
3043
|
-
|
|
3044
|
-
|
|
2917
|
+
afterHide = _this$props7.afterHide,
|
|
2918
|
+
disableProp = _this$props7.disable;
|
|
3045
2919
|
var placeholder = this.getTooltipContent();
|
|
3046
2920
|
if (!this.mount) return;
|
|
3047
2921
|
if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
|
|
3048
|
-
|
|
3049
2922
|
if (hasTarget) {
|
|
3050
2923
|
// Don't trigger other elements belongs to other ReactTooltip
|
|
3051
2924
|
var targetArray = this.getTargetArray(this.props.id);
|
|
@@ -3053,47 +2926,40 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3053
2926
|
return ele === e.currentTarget;
|
|
3054
2927
|
});
|
|
3055
2928
|
if (!isMyElement || !this.state.show) return;
|
|
3056
|
-
}
|
|
3057
|
-
|
|
2929
|
+
}
|
|
3058
2930
|
|
|
2931
|
+
// clean up aria-describedby when hiding tooltip
|
|
3059
2932
|
if (e && e.currentTarget && e.currentTarget.removeAttribute) {
|
|
3060
2933
|
e.currentTarget.removeAttribute('aria-describedby');
|
|
3061
2934
|
}
|
|
3062
|
-
|
|
3063
2935
|
var resetState = function resetState() {
|
|
3064
|
-
var isVisible = _this6.state.show;
|
|
3065
|
-
|
|
2936
|
+
var isVisible = _this6.state.show;
|
|
2937
|
+
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
3066
2938
|
if (_this6.mouseOnToolTip()) {
|
|
3067
2939
|
_this6.listenForTooltipExit();
|
|
3068
|
-
|
|
3069
2940
|
return;
|
|
3070
2941
|
}
|
|
3071
|
-
|
|
3072
2942
|
_this6.removeListenerForTooltipExit();
|
|
3073
|
-
|
|
3074
2943
|
_this6.setState({
|
|
3075
2944
|
show: false
|
|
3076
2945
|
}, function () {
|
|
3077
2946
|
_this6.removeScrollListener(_this6.state.currentTarget);
|
|
3078
|
-
|
|
3079
2947
|
if (isVisible && afterHide) {
|
|
3080
2948
|
afterHide(e);
|
|
3081
2949
|
}
|
|
3082
2950
|
});
|
|
3083
2951
|
};
|
|
3084
|
-
|
|
3085
2952
|
this.clearTimer();
|
|
3086
|
-
|
|
3087
2953
|
if (delayHide) {
|
|
3088
2954
|
this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));
|
|
3089
2955
|
} else {
|
|
3090
2956
|
resetState();
|
|
3091
2957
|
}
|
|
3092
2958
|
}
|
|
2959
|
+
|
|
3093
2960
|
/**
|
|
3094
2961
|
* When scroll, hide tooltip
|
|
3095
2962
|
*/
|
|
3096
|
-
|
|
3097
2963
|
}, {
|
|
3098
2964
|
key: "hideTooltipOnScroll",
|
|
3099
2965
|
value: function hideTooltipOnScroll(event, hasTarget) {
|
|
@@ -3101,11 +2967,11 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3101
2967
|
isScroll: true
|
|
3102
2968
|
});
|
|
3103
2969
|
}
|
|
2970
|
+
|
|
3104
2971
|
/**
|
|
3105
2972
|
* Add scroll event listener when tooltip show
|
|
3106
2973
|
* automatically hide the tooltip when scrolling
|
|
3107
2974
|
*/
|
|
3108
|
-
|
|
3109
2975
|
}, {
|
|
3110
2976
|
key: "addScrollListener",
|
|
3111
2977
|
value: function addScrollListener(currentTarget) {
|
|
@@ -3117,43 +2983,43 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3117
2983
|
value: function removeScrollListener(currentTarget) {
|
|
3118
2984
|
var isCaptureMode = this.isCapture(currentTarget);
|
|
3119
2985
|
window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
|
|
3120
|
-
}
|
|
2986
|
+
}
|
|
3121
2987
|
|
|
2988
|
+
// Calculation the position
|
|
3122
2989
|
}, {
|
|
3123
2990
|
key: "updatePosition",
|
|
3124
2991
|
value: function updatePosition(callbackAfter) {
|
|
3125
2992
|
var _this7 = this;
|
|
3126
|
-
|
|
3127
2993
|
var _this$state2 = this.state,
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
2994
|
+
currentEvent = _this$state2.currentEvent,
|
|
2995
|
+
currentTarget = _this$state2.currentTarget,
|
|
2996
|
+
place = _this$state2.place,
|
|
2997
|
+
desiredPlace = _this$state2.desiredPlace,
|
|
2998
|
+
effect = _this$state2.effect,
|
|
2999
|
+
offset = _this$state2.offset;
|
|
3134
3000
|
var node = this.tooltipRef;
|
|
3135
3001
|
var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
3136
|
-
|
|
3137
3002
|
if (result.position && this.props.overridePosition) {
|
|
3138
3003
|
result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
3139
3004
|
}
|
|
3140
|
-
|
|
3141
3005
|
if (result.isNewState) {
|
|
3142
3006
|
// Switch to reverse placement
|
|
3143
3007
|
return this.setState(result.newState, function () {
|
|
3144
3008
|
_this7.updatePosition(callbackAfter);
|
|
3145
3009
|
});
|
|
3146
3010
|
}
|
|
3011
|
+
if (callbackAfter && typeof callbackAfter === 'function') {
|
|
3012
|
+
callbackAfter();
|
|
3013
|
+
}
|
|
3147
3014
|
|
|
3148
|
-
|
|
3149
|
-
|
|
3015
|
+
// Set tooltip position
|
|
3150
3016
|
node.style.left = result.position.left + 'px';
|
|
3151
3017
|
node.style.top = result.position.top + 'px';
|
|
3152
3018
|
}
|
|
3019
|
+
|
|
3153
3020
|
/**
|
|
3154
3021
|
* CLear all kinds of timeout of interval
|
|
3155
3022
|
*/
|
|
3156
|
-
|
|
3157
3023
|
}, {
|
|
3158
3024
|
key: "clearTimer",
|
|
3159
3025
|
value: function clearTimer() {
|
|
@@ -3161,17 +3027,14 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3161
3027
|
clearTimeout(this.delayShowLoop);
|
|
3162
3028
|
this.delayShowLoop = null;
|
|
3163
3029
|
}
|
|
3164
|
-
|
|
3165
3030
|
if (this.delayHideLoop) {
|
|
3166
3031
|
clearTimeout(this.delayHideLoop);
|
|
3167
3032
|
this.delayHideLoop = null;
|
|
3168
3033
|
}
|
|
3169
|
-
|
|
3170
3034
|
if (this.delayReshow) {
|
|
3171
3035
|
clearTimeout(this.delayReshow);
|
|
3172
3036
|
this.delayReshow = null;
|
|
3173
3037
|
}
|
|
3174
|
-
|
|
3175
3038
|
if (this.intervalUpdateContent) {
|
|
3176
3039
|
clearInterval(this.intervalUpdateContent);
|
|
3177
3040
|
this.intervalUpdateContent = null;
|
|
@@ -3181,7 +3044,6 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3181
3044
|
key: "hasCustomColors",
|
|
3182
3045
|
value: function hasCustomColors() {
|
|
3183
3046
|
var _this8 = this;
|
|
3184
|
-
|
|
3185
3047
|
return Boolean(Object.keys(this.state.customColors).find(function (color) {
|
|
3186
3048
|
return color !== 'border' && _this8.state.customColors[color];
|
|
3187
3049
|
}) || this.state.border && this.state.customColors['border']);
|
|
@@ -3190,27 +3052,24 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3190
3052
|
key: "render",
|
|
3191
3053
|
value: function render() {
|
|
3192
3054
|
var _this9 = this;
|
|
3193
|
-
|
|
3194
3055
|
var _this$state3 = this.state,
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3056
|
+
extraClass = _this$state3.extraClass,
|
|
3057
|
+
html = _this$state3.html,
|
|
3058
|
+
ariaProps = _this$state3.ariaProps,
|
|
3059
|
+
disable = _this$state3.disable,
|
|
3060
|
+
uuid = _this$state3.uuid;
|
|
3200
3061
|
var content = this.getTooltipContent();
|
|
3201
3062
|
var isEmptyTip = this.isEmptyTip(content);
|
|
3202
3063
|
var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding);
|
|
3203
|
-
var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? '
|
|
3204
|
-
" type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
|
|
3064
|
+
var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' ' + this.state.borderClass : '') + " place-".concat(this.state.place) + // top, bottom, left, right
|
|
3065
|
+
" type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
|
|
3066
|
+
// dark, success, warning, error, info, light, custom
|
|
3205
3067
|
this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
|
|
3206
3068
|
var Wrapper = this.props.wrapper;
|
|
3207
|
-
|
|
3208
3069
|
if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {
|
|
3209
3070
|
Wrapper = ReactTooltip.defaultProps.wrapper;
|
|
3210
3071
|
}
|
|
3211
|
-
|
|
3212
3072
|
var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
|
|
3213
|
-
|
|
3214
3073
|
if (html) {
|
|
3215
3074
|
var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
|
|
3216
3075
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
|
|
@@ -3255,6 +3114,7 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3255
3114
|
padding: PropTypes__default["default"].string,
|
|
3256
3115
|
multiline: PropTypes__default["default"].bool,
|
|
3257
3116
|
border: PropTypes__default["default"].bool,
|
|
3117
|
+
borderClass: PropTypes__default["default"].string,
|
|
3258
3118
|
textColor: PropTypes__default["default"].string,
|
|
3259
3119
|
backgroundColor: PropTypes__default["default"].string,
|
|
3260
3120
|
borderColor: PropTypes__default["default"].string,
|
|
@@ -3293,17 +3153,14 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
3293
3153
|
var isChanged = Object.keys(newAriaProps).some(function (props) {
|
|
3294
3154
|
return newAriaProps[props] !== ariaProps[props];
|
|
3295
3155
|
});
|
|
3296
|
-
|
|
3297
3156
|
if (!isChanged) {
|
|
3298
3157
|
return null;
|
|
3299
3158
|
}
|
|
3300
|
-
|
|
3301
3159
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
3302
3160
|
ariaProps: newAriaProps
|
|
3303
3161
|
});
|
|
3304
3162
|
}
|
|
3305
3163
|
}]);
|
|
3306
|
-
|
|
3307
3164
|
return ReactTooltip;
|
|
3308
3165
|
}(React__default["default"].Component), _defineProperty(_class2, "defaultProps", {
|
|
3309
3166
|
insecure: true,
|