react-tooltip 4.3.0 → 4.3.1

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