react-tooltip 4.2.21 → 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/README.md +38 -18
- package/dist/index.es.js +2061 -1535
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2030 -1501
- package/dist/index.js.map +1 -1
- package/package.json +85 -81
- package/CHANGELOG.md +0 -372
package/dist/index.es.js
CHANGED
|
@@ -2,12 +2,32 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { v4 } from 'uuid';
|
|
4
4
|
|
|
5
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
6
|
+
var keys = Object.keys(object);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
10
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
11
|
+
})), keys.push.apply(keys, symbols);
|
|
12
|
+
}
|
|
13
|
+
return keys;
|
|
14
|
+
}
|
|
15
|
+
function _objectSpread2(target) {
|
|
16
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
18
|
+
i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
|
|
19
|
+
_defineProperty(target, key, source[key]);
|
|
20
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
|
|
21
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
5
26
|
function _classCallCheck(instance, Constructor) {
|
|
6
27
|
if (!(instance instanceof Constructor)) {
|
|
7
28
|
throw new TypeError("Cannot call a class as a function");
|
|
8
29
|
}
|
|
9
30
|
}
|
|
10
|
-
|
|
11
31
|
function _defineProperties(target, props) {
|
|
12
32
|
for (var i = 0; i < props.length; i++) {
|
|
13
33
|
var descriptor = props[i];
|
|
@@ -17,13 +37,14 @@ function _defineProperties(target, props) {
|
|
|
17
37
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
18
38
|
}
|
|
19
39
|
}
|
|
20
|
-
|
|
21
40
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
22
41
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
42
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
43
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
44
|
+
writable: false
|
|
45
|
+
});
|
|
24
46
|
return Constructor;
|
|
25
47
|
}
|
|
26
|
-
|
|
27
48
|
function _defineProperty(obj, key, value) {
|
|
28
49
|
if (key in obj) {
|
|
29
50
|
Object.defineProperty(obj, key, {
|
|
@@ -35,67 +56,26 @@ function _defineProperty(obj, key, value) {
|
|
|
35
56
|
} else {
|
|
36
57
|
obj[key] = value;
|
|
37
58
|
}
|
|
38
|
-
|
|
39
59
|
return obj;
|
|
40
60
|
}
|
|
41
|
-
|
|
42
61
|
function _extends() {
|
|
43
|
-
_extends = Object.assign
|
|
62
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
44
63
|
for (var i = 1; i < arguments.length; i++) {
|
|
45
64
|
var source = arguments[i];
|
|
46
|
-
|
|
47
65
|
for (var key in source) {
|
|
48
66
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
49
67
|
target[key] = source[key];
|
|
50
68
|
}
|
|
51
69
|
}
|
|
52
70
|
}
|
|
53
|
-
|
|
54
71
|
return target;
|
|
55
72
|
};
|
|
56
|
-
|
|
57
73
|
return _extends.apply(this, arguments);
|
|
58
74
|
}
|
|
59
|
-
|
|
60
|
-
function ownKeys(object, enumerableOnly) {
|
|
61
|
-
var keys = Object.keys(object);
|
|
62
|
-
|
|
63
|
-
if (Object.getOwnPropertySymbols) {
|
|
64
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
65
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
66
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
67
|
-
});
|
|
68
|
-
keys.push.apply(keys, symbols);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return keys;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _objectSpread2(target) {
|
|
75
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
76
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
77
|
-
|
|
78
|
-
if (i % 2) {
|
|
79
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
80
|
-
_defineProperty(target, key, source[key]);
|
|
81
|
-
});
|
|
82
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
83
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
84
|
-
} else {
|
|
85
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
86
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return target;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
75
|
function _inherits(subClass, superClass) {
|
|
95
76
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
96
77
|
throw new TypeError("Super expression must either be null or a function");
|
|
97
78
|
}
|
|
98
|
-
|
|
99
79
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
100
80
|
constructor: {
|
|
101
81
|
value: subClass,
|
|
@@ -103,1303 +83,961 @@ function _inherits(subClass, superClass) {
|
|
|
103
83
|
configurable: true
|
|
104
84
|
}
|
|
105
85
|
});
|
|
86
|
+
Object.defineProperty(subClass, "prototype", {
|
|
87
|
+
writable: false
|
|
88
|
+
});
|
|
106
89
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
107
90
|
}
|
|
108
|
-
|
|
109
91
|
function _getPrototypeOf(o) {
|
|
110
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
92
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
111
93
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
112
94
|
};
|
|
113
95
|
return _getPrototypeOf(o);
|
|
114
96
|
}
|
|
115
|
-
|
|
116
97
|
function _setPrototypeOf(o, p) {
|
|
117
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
98
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
118
99
|
o.__proto__ = p;
|
|
119
100
|
return o;
|
|
120
101
|
};
|
|
121
|
-
|
|
122
102
|
return _setPrototypeOf(o, p);
|
|
123
103
|
}
|
|
124
|
-
|
|
104
|
+
function _isNativeReflectConstruct() {
|
|
105
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
106
|
+
if (Reflect.construct.sham) return false;
|
|
107
|
+
if (typeof Proxy === "function") return true;
|
|
108
|
+
try {
|
|
109
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
110
|
+
return true;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
125
115
|
function _assertThisInitialized(self) {
|
|
126
116
|
if (self === void 0) {
|
|
127
117
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
128
118
|
}
|
|
129
|
-
|
|
130
119
|
return self;
|
|
131
120
|
}
|
|
132
|
-
|
|
133
121
|
function _possibleConstructorReturn(self, call) {
|
|
134
122
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
135
123
|
return call;
|
|
124
|
+
} else if (call !== void 0) {
|
|
125
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
136
126
|
}
|
|
137
|
-
|
|
138
127
|
return _assertThisInitialized(self);
|
|
139
128
|
}
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
129
|
+
function _createSuper(Derived) {
|
|
130
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
131
|
+
return function _createSuperInternal() {
|
|
132
|
+
var Super = _getPrototypeOf(Derived),
|
|
133
|
+
result;
|
|
134
|
+
if (hasNativeReflectConstruct) {
|
|
135
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
136
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
137
|
+
} else {
|
|
138
|
+
result = Super.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
return _possibleConstructorReturn(this, result);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
144
|
+
if (!o) return;
|
|
145
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
146
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
147
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
148
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
149
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
150
|
+
}
|
|
151
|
+
function _arrayLikeToArray(arr, len) {
|
|
152
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
153
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
154
|
+
return arr2;
|
|
155
|
+
}
|
|
156
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
157
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
158
|
+
if (!it) {
|
|
159
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
160
|
+
if (it) o = it;
|
|
161
|
+
var i = 0;
|
|
162
|
+
var F = function () {};
|
|
163
|
+
return {
|
|
164
|
+
s: F,
|
|
165
|
+
n: function () {
|
|
166
|
+
if (i >= o.length) return {
|
|
167
|
+
done: true
|
|
168
|
+
};
|
|
169
|
+
return {
|
|
170
|
+
done: false,
|
|
171
|
+
value: o[i++]
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
e: function (e) {
|
|
175
|
+
throw e;
|
|
176
|
+
},
|
|
177
|
+
f: F
|
|
178
|
+
};
|
|
179
|
+
}
|
|
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.");
|
|
146
181
|
}
|
|
182
|
+
var normalCompletion = true,
|
|
183
|
+
didErr = false,
|
|
184
|
+
err;
|
|
185
|
+
return {
|
|
186
|
+
s: function () {
|
|
187
|
+
it = it.call(o);
|
|
188
|
+
},
|
|
189
|
+
n: function () {
|
|
190
|
+
var step = it.next();
|
|
191
|
+
normalCompletion = step.done;
|
|
192
|
+
return step;
|
|
193
|
+
},
|
|
194
|
+
e: function (e) {
|
|
195
|
+
didErr = true;
|
|
196
|
+
err = e;
|
|
197
|
+
},
|
|
198
|
+
f: function () {
|
|
199
|
+
try {
|
|
200
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
201
|
+
} finally {
|
|
202
|
+
if (didErr) throw err;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
209
|
+
|
|
210
|
+
var check = function (it) {
|
|
211
|
+
return it && it.Math == Math && it;
|
|
147
212
|
};
|
|
148
213
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
214
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
215
|
+
var global$a =
|
|
216
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
217
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
218
|
+
check(typeof window == 'object' && window) ||
|
|
219
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
220
|
+
check(typeof self == 'object' && self) ||
|
|
221
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
222
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
223
|
+
(function () { return this; })() || Function('return this')();
|
|
152
224
|
|
|
153
|
-
var
|
|
154
|
-
// Compatible with IE
|
|
155
|
-
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
|
|
156
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
157
|
-
var event;
|
|
225
|
+
var objectGetOwnPropertyDescriptor = {};
|
|
158
226
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
event = document.createEvent('Event');
|
|
165
|
-
event.initEvent(eventName, false, true, opts);
|
|
227
|
+
var fails$9 = function (exec) {
|
|
228
|
+
try {
|
|
229
|
+
return !!exec();
|
|
230
|
+
} catch (error) {
|
|
231
|
+
return true;
|
|
166
232
|
}
|
|
167
|
-
|
|
168
|
-
window.dispatchEvent(event);
|
|
169
233
|
};
|
|
170
234
|
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Hide all tooltip
|
|
174
|
-
* @trigger ReactTooltip.hide()
|
|
175
|
-
*/
|
|
176
|
-
target.hide = function (target) {
|
|
177
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
|
|
178
|
-
target: target
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* Rebuild all tooltip
|
|
183
|
-
* @trigger ReactTooltip.rebuild()
|
|
184
|
-
*/
|
|
235
|
+
var fails$8 = fails$9;
|
|
185
236
|
|
|
237
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
238
|
+
var descriptors = !fails$8(function () {
|
|
239
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
240
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
241
|
+
});
|
|
186
242
|
|
|
187
|
-
|
|
188
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Show specific tooltip
|
|
192
|
-
* @trigger ReactTooltip.show()
|
|
193
|
-
*/
|
|
243
|
+
var fails$7 = fails$9;
|
|
194
244
|
|
|
245
|
+
var functionBindNative = !fails$7(function () {
|
|
246
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
247
|
+
var test = (function () { /* empty */ }).bind();
|
|
248
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
249
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
250
|
+
});
|
|
195
251
|
|
|
196
|
-
|
|
197
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
|
|
198
|
-
target: target
|
|
199
|
-
});
|
|
200
|
-
};
|
|
252
|
+
var NATIVE_BIND$2 = functionBindNative;
|
|
201
253
|
|
|
202
|
-
|
|
203
|
-
if (this.mount) {
|
|
204
|
-
this.unbindListener();
|
|
205
|
-
this.bindListener();
|
|
206
|
-
}
|
|
207
|
-
};
|
|
254
|
+
var call$4 = Function.prototype.call;
|
|
208
255
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
// only `float` type cares e.clientX e.clientY
|
|
256
|
+
var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
|
|
257
|
+
return call$4.apply(call$4, arguments);
|
|
258
|
+
};
|
|
213
259
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
260
|
+
var objectPropertyIsEnumerable = {};
|
|
261
|
+
|
|
262
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
263
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
264
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
265
|
+
|
|
266
|
+
// Nashorn ~ JDK8 bug
|
|
267
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
268
|
+
|
|
269
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
270
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
271
|
+
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
272
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
273
|
+
return !!descriptor && descriptor.enumerable;
|
|
274
|
+
} : $propertyIsEnumerable;
|
|
275
|
+
|
|
276
|
+
var createPropertyDescriptor$2 = function (bitmap, value) {
|
|
277
|
+
return {
|
|
278
|
+
enumerable: !(bitmap & 1),
|
|
279
|
+
configurable: !(bitmap & 2),
|
|
280
|
+
writable: !(bitmap & 4),
|
|
281
|
+
value: value
|
|
218
282
|
};
|
|
283
|
+
};
|
|
219
284
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
285
|
+
var NATIVE_BIND$1 = functionBindNative;
|
|
286
|
+
|
|
287
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
288
|
+
var call$3 = FunctionPrototype$1.call;
|
|
289
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$3, call$3);
|
|
290
|
+
|
|
291
|
+
var functionUncurryThisRaw = function (fn) {
|
|
292
|
+
return NATIVE_BIND$1 ? uncurryThisWithBind(fn) : function () {
|
|
293
|
+
return call$3.apply(fn, arguments);
|
|
227
294
|
};
|
|
228
|
-
}
|
|
295
|
+
};
|
|
229
296
|
|
|
230
|
-
|
|
231
|
-
* Events that should be bound to the window
|
|
232
|
-
*/
|
|
233
|
-
function windowListener (target) {
|
|
234
|
-
target.prototype.bindWindowEvents = function (resizeHide) {
|
|
235
|
-
// ReactTooltip.hide
|
|
236
|
-
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
237
|
-
window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild
|
|
297
|
+
var uncurryThisRaw$1 = functionUncurryThisRaw;
|
|
238
298
|
|
|
239
|
-
|
|
240
|
-
|
|
299
|
+
var toString$1 = uncurryThisRaw$1({}.toString);
|
|
300
|
+
var stringSlice = uncurryThisRaw$1(''.slice);
|
|
241
301
|
|
|
242
|
-
|
|
243
|
-
|
|
302
|
+
var classofRaw$2 = function (it) {
|
|
303
|
+
return stringSlice(toString$1(it), 8, -1);
|
|
304
|
+
};
|
|
244
305
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
window.addEventListener('resize', this.onWindowResize, false);
|
|
248
|
-
}
|
|
249
|
-
};
|
|
306
|
+
var classofRaw$1 = classofRaw$2;
|
|
307
|
+
var uncurryThisRaw = functionUncurryThisRaw;
|
|
250
308
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* invoked by resize event of window
|
|
259
|
-
*/
|
|
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
|
+
};
|
|
260
315
|
|
|
316
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
317
|
+
var fails$6 = fails$9;
|
|
318
|
+
var classof$3 = classofRaw$2;
|
|
261
319
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
this.hideTooltip();
|
|
265
|
-
};
|
|
266
|
-
}
|
|
320
|
+
var $Object$3 = Object;
|
|
321
|
+
var split = uncurryThis$9(''.split);
|
|
267
322
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
var show = this.state.show;
|
|
277
|
-
var id = this.props.id;
|
|
278
|
-
var isCapture = this.isCapture(e.currentTarget);
|
|
279
|
-
var currentItem = e.currentTarget.getAttribute('currentItem');
|
|
280
|
-
if (!isCapture) e.stopPropagation();
|
|
323
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
324
|
+
var indexedObject = fails$6(function () {
|
|
325
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
326
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
327
|
+
return !$Object$3('z').propertyIsEnumerable(0);
|
|
328
|
+
}) ? function (it) {
|
|
329
|
+
return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
|
|
330
|
+
} : $Object$3;
|
|
281
331
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
setUntargetItems(e.currentTarget, this.getTargetArray(id));
|
|
287
|
-
this.showTooltip(e);
|
|
288
|
-
}
|
|
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;
|
|
289
336
|
};
|
|
290
337
|
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
338
|
+
var isNullOrUndefined$1 = isNullOrUndefined$2;
|
|
339
|
+
|
|
340
|
+
var $TypeError$5 = TypeError;
|
|
341
|
+
|
|
342
|
+
// `RequireObjectCoercible` abstract operation
|
|
343
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
344
|
+
var requireObjectCoercible$2 = function (it) {
|
|
345
|
+
if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
|
|
346
|
+
return it;
|
|
299
347
|
};
|
|
300
348
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
if (this.id in target) {
|
|
305
|
-
var map = target[this.id];
|
|
306
|
-
map[event] = listener;
|
|
307
|
-
} else {
|
|
308
|
-
// this is workaround for WeakMap, which is not supported in older browsers, such as IE
|
|
309
|
-
Object.defineProperty(target, this.id, {
|
|
310
|
-
configurable: true,
|
|
311
|
-
value: _defineProperty({}, event, listener)
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
get: function get(target, event) {
|
|
316
|
-
var map = target[this.id];
|
|
349
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
350
|
+
var IndexedObject$1 = indexedObject;
|
|
351
|
+
var requireObjectCoercible$1 = requireObjectCoercible$2;
|
|
317
352
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
}
|
|
353
|
+
var toIndexedObject$4 = function (it) {
|
|
354
|
+
return IndexedObject$1(requireObjectCoercible$1(it));
|
|
322
355
|
};
|
|
323
|
-
function customEvent (target) {
|
|
324
|
-
target.prototype.isCustomEvent = function (ele) {
|
|
325
|
-
var event = this.state.event;
|
|
326
|
-
return event || !!ele.getAttribute('data-event');
|
|
327
|
-
};
|
|
328
|
-
/* Bind listener for custom event */
|
|
329
356
|
|
|
357
|
+
var documentAll$2 = typeof document == 'object' && document.all;
|
|
330
358
|
|
|
331
|
-
|
|
332
|
-
|
|
359
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
360
|
+
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
333
361
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
|
|
339
|
-
dataEvent.split(' ').forEach(function (event) {
|
|
340
|
-
ele.removeEventListener(event, customListeners.get(ele, event));
|
|
341
|
-
var customListener = checkStatus.bind(_this, dataEventOff);
|
|
342
|
-
customListeners.set(ele, event, customListener);
|
|
343
|
-
ele.addEventListener(event, customListener, false);
|
|
344
|
-
});
|
|
362
|
+
var documentAll_1 = {
|
|
363
|
+
all: documentAll$2,
|
|
364
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
365
|
+
};
|
|
345
366
|
|
|
346
|
-
|
|
347
|
-
dataEventOff.split(' ').forEach(function (event) {
|
|
348
|
-
ele.removeEventListener(event, _this.hideTooltip);
|
|
349
|
-
ele.addEventListener(event, _this.hideTooltip, false);
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
/* Unbind listener for custom event */
|
|
367
|
+
var $documentAll$1 = documentAll_1;
|
|
354
368
|
|
|
369
|
+
var documentAll$1 = $documentAll$1.all;
|
|
355
370
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
|
|
364
|
-
};
|
|
365
|
-
}
|
|
371
|
+
// `IsCallable` abstract operation
|
|
372
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
373
|
+
var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
374
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
375
|
+
} : function (argument) {
|
|
376
|
+
return typeof argument == 'function';
|
|
377
|
+
};
|
|
366
378
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
*/
|
|
370
|
-
function isCapture (target) {
|
|
371
|
-
target.prototype.isCapture = function (currentTarget) {
|
|
372
|
-
return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
|
|
373
|
-
};
|
|
374
|
-
}
|
|
379
|
+
var isCallable$b = isCallable$c;
|
|
380
|
+
var $documentAll = documentAll_1;
|
|
375
381
|
|
|
376
|
-
|
|
377
|
-
* Util method to get effect
|
|
378
|
-
*/
|
|
379
|
-
function getEffect (target) {
|
|
380
|
-
target.prototype.getEffect = function (currentTarget) {
|
|
381
|
-
var dataEffect = currentTarget.getAttribute('data-effect');
|
|
382
|
-
return dataEffect || this.props.effect || 'float';
|
|
383
|
-
};
|
|
384
|
-
}
|
|
382
|
+
var documentAll = $documentAll.all;
|
|
385
383
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
384
|
+
var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
385
|
+
return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
|
|
386
|
+
} : function (it) {
|
|
387
|
+
return typeof it == 'object' ? it !== null : isCallable$b(it);
|
|
388
|
+
};
|
|
389
389
|
|
|
390
|
-
var
|
|
391
|
-
|
|
390
|
+
var global$9 = global$a;
|
|
391
|
+
var isCallable$a = isCallable$c;
|
|
392
392
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
} else {
|
|
397
|
-
proxy[key] = e[key];
|
|
398
|
-
}
|
|
399
|
-
}
|
|
393
|
+
var aFunction = function (argument) {
|
|
394
|
+
return isCallable$a(argument) ? argument : undefined;
|
|
395
|
+
};
|
|
400
396
|
|
|
401
|
-
|
|
397
|
+
var getBuiltIn$5 = function (namespace, method) {
|
|
398
|
+
return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
|
|
402
399
|
};
|
|
403
400
|
|
|
404
|
-
var
|
|
405
|
-
var _options$respectEffec = options.respectEffect,
|
|
406
|
-
respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
|
|
407
|
-
_options$customEvent = options.customEvent,
|
|
408
|
-
customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
|
|
409
|
-
var id = this.props.id;
|
|
410
|
-
var tip = e.target.getAttribute('data-tip') || null;
|
|
411
|
-
var forId = e.target.getAttribute('data-for') || null;
|
|
412
|
-
var target = e.target;
|
|
401
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
413
402
|
|
|
414
|
-
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
403
|
+
var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
|
|
417
404
|
|
|
418
|
-
|
|
405
|
+
var getBuiltIn$4 = getBuiltIn$5;
|
|
419
406
|
|
|
420
|
-
|
|
421
|
-
var proxy = makeProxy(e);
|
|
422
|
-
proxy.currentTarget = target;
|
|
423
|
-
callback(proxy);
|
|
424
|
-
}
|
|
425
|
-
};
|
|
407
|
+
var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
|
|
426
408
|
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
targetArray.forEach(function (target) {
|
|
430
|
-
var event = target.getAttribute(dataAttribute);
|
|
431
|
-
if (event) event.split(' ').forEach(function (event) {
|
|
432
|
-
return events[event] = true;
|
|
433
|
-
});
|
|
434
|
-
});
|
|
435
|
-
return events;
|
|
436
|
-
};
|
|
409
|
+
var global$8 = global$a;
|
|
410
|
+
var userAgent = engineUserAgent;
|
|
437
411
|
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
412
|
+
var process = global$8.process;
|
|
413
|
+
var Deno = global$8.Deno;
|
|
414
|
+
var versions = process && process.versions || Deno && Deno.version;
|
|
415
|
+
var v8 = versions && versions.v8;
|
|
416
|
+
var match, version;
|
|
441
417
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
418
|
+
if (v8) {
|
|
419
|
+
match = v8.split('.');
|
|
420
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
421
|
+
// but their correct versions are not interesting for us
|
|
422
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
423
|
+
}
|
|
446
424
|
|
|
447
|
-
|
|
448
|
-
|
|
425
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
426
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
427
|
+
if (!version && userAgent) {
|
|
428
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
429
|
+
if (!match || match[1] >= 74) {
|
|
430
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
431
|
+
if (match) version = +match[1];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
449
434
|
|
|
450
|
-
|
|
451
|
-
event = _this$state.event,
|
|
452
|
-
eventOff = _this$state.eventOff,
|
|
453
|
-
possibleCustomEvents = _this$state.possibleCustomEvents,
|
|
454
|
-
possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
|
|
455
|
-
var body = getBody();
|
|
456
|
-
var customEvents = findCustomEvents(targetArray, 'data-event');
|
|
457
|
-
var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
|
|
458
|
-
if (event != null) customEvents[event] = true;
|
|
459
|
-
if (eventOff != null) customEventsOff[eventOff] = true;
|
|
460
|
-
possibleCustomEvents.split(' ').forEach(function (event) {
|
|
461
|
-
return customEvents[event] = true;
|
|
462
|
-
});
|
|
463
|
-
possibleCustomEventsOff.split(' ').forEach(function (event) {
|
|
464
|
-
return customEventsOff[event] = true;
|
|
465
|
-
});
|
|
466
|
-
this.unbindBodyListener(body);
|
|
467
|
-
var listeners = this.bodyModeListeners = {};
|
|
435
|
+
var engineV8Version = version;
|
|
468
436
|
|
|
469
|
-
|
|
470
|
-
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
|
|
471
|
-
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
|
|
472
|
-
respectEffect: true
|
|
473
|
-
});
|
|
474
|
-
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
|
|
475
|
-
}
|
|
437
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
476
438
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
|
|
480
|
-
checkStatus.call(_this, targetEventOff, e);
|
|
481
|
-
}, {
|
|
482
|
-
customEvent: true
|
|
483
|
-
});
|
|
484
|
-
}
|
|
439
|
+
var V8_VERSION = engineV8Version;
|
|
440
|
+
var fails$5 = fails$9;
|
|
485
441
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
442
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
443
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
|
|
444
|
+
var symbol = Symbol();
|
|
445
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
446
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
447
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
448
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
449
|
+
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
450
|
+
});
|
|
491
451
|
|
|
492
|
-
|
|
493
|
-
body.addEventListener(_event3, listeners[_event3]);
|
|
494
|
-
}
|
|
495
|
-
};
|
|
452
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
496
453
|
|
|
497
|
-
|
|
498
|
-
body = body || getBody();
|
|
499
|
-
var listeners = this.bodyModeListeners;
|
|
454
|
+
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
500
455
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
};
|
|
505
|
-
}
|
|
456
|
+
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
457
|
+
&& !Symbol.sham
|
|
458
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
506
459
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
460
|
+
var getBuiltIn$3 = getBuiltIn$5;
|
|
461
|
+
var isCallable$9 = isCallable$c;
|
|
462
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
463
|
+
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
464
|
+
|
|
465
|
+
var $Object$2 = Object;
|
|
466
|
+
|
|
467
|
+
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
468
|
+
return typeof it == 'symbol';
|
|
469
|
+
} : function (it) {
|
|
470
|
+
var $Symbol = getBuiltIn$3('Symbol');
|
|
471
|
+
return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
|
|
518
472
|
};
|
|
519
473
|
|
|
520
|
-
|
|
521
|
-
target.prototype.bindRemovalTracker = function () {
|
|
522
|
-
var _this = this;
|
|
474
|
+
var $String$1 = String;
|
|
523
475
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
476
|
+
var tryToString$1 = function (argument) {
|
|
477
|
+
try {
|
|
478
|
+
return $String$1(argument);
|
|
479
|
+
} catch (error) {
|
|
480
|
+
return 'Object';
|
|
481
|
+
}
|
|
482
|
+
};
|
|
529
483
|
|
|
530
|
-
|
|
531
|
-
|
|
484
|
+
var isCallable$8 = isCallable$c;
|
|
485
|
+
var tryToString = tryToString$1;
|
|
532
486
|
|
|
533
|
-
|
|
534
|
-
_this.hideTooltip();
|
|
487
|
+
var $TypeError$4 = TypeError;
|
|
535
488
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
observer.observe(window.document, {
|
|
542
|
-
childList: true,
|
|
543
|
-
subtree: true
|
|
544
|
-
});
|
|
545
|
-
this.removalTracker = observer;
|
|
546
|
-
};
|
|
489
|
+
// `Assert: IsCallable(argument) is true`
|
|
490
|
+
var aCallable$2 = function (argument) {
|
|
491
|
+
if (isCallable$8(argument)) return argument;
|
|
492
|
+
throw $TypeError$4(tryToString(argument) + ' is not a function');
|
|
493
|
+
};
|
|
547
494
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
this.removalTracker.disconnect();
|
|
551
|
-
this.removalTracker = null;
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
}
|
|
495
|
+
var aCallable$1 = aCallable$2;
|
|
496
|
+
var isNullOrUndefined = isNullOrUndefined$2;
|
|
555
497
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
* - `node` {DOM} the react-tooltip object
|
|
563
|
-
* - `place` {String} top / right / bottom / left
|
|
564
|
-
* - `effect` {String} float / solid
|
|
565
|
-
* - `offset` {Object} the offset to default position
|
|
566
|
-
*
|
|
567
|
-
* @return {Object}
|
|
568
|
-
* - `isNewState` {Bool} required
|
|
569
|
-
* - `newState` {Object}
|
|
570
|
-
* - `position` {Object} {left: {Number}, top: {Number}}
|
|
571
|
-
*/
|
|
572
|
-
function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
573
|
-
var _getDimensions = getDimensions(node),
|
|
574
|
-
tipWidth = _getDimensions.width,
|
|
575
|
-
tipHeight = _getDimensions.height;
|
|
498
|
+
// `GetMethod` abstract operation
|
|
499
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
500
|
+
var getMethod$1 = function (V, P) {
|
|
501
|
+
var func = V[P];
|
|
502
|
+
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
503
|
+
};
|
|
576
504
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
505
|
+
var call$2 = functionCall;
|
|
506
|
+
var isCallable$7 = isCallable$c;
|
|
507
|
+
var isObject$5 = isObject$6;
|
|
580
508
|
|
|
581
|
-
|
|
582
|
-
mouseX = _getCurrentOffset.mouseX,
|
|
583
|
-
mouseY = _getCurrentOffset.mouseY;
|
|
509
|
+
var $TypeError$3 = TypeError;
|
|
584
510
|
|
|
585
|
-
|
|
511
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
512
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
513
|
+
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
514
|
+
var fn, val;
|
|
515
|
+
if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
516
|
+
if (isCallable$7(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
|
|
517
|
+
if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
518
|
+
throw $TypeError$3("Can't convert object to primitive value");
|
|
519
|
+
};
|
|
586
520
|
|
|
587
|
-
|
|
588
|
-
extraOffsetX = _calculateOffset.extraOffsetX,
|
|
589
|
-
extraOffsetY = _calculateOffset.extraOffsetY;
|
|
521
|
+
var shared$3 = {exports: {}};
|
|
590
522
|
|
|
591
|
-
|
|
592
|
-
var windowHeight = window.innerHeight;
|
|
523
|
+
var global$7 = global$a;
|
|
593
524
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
|
|
525
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
526
|
+
var defineProperty$2 = Object.defineProperty;
|
|
597
527
|
|
|
528
|
+
var defineGlobalProperty$3 = function (key, value) {
|
|
529
|
+
try {
|
|
530
|
+
defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
|
|
531
|
+
} catch (error) {
|
|
532
|
+
global$7[key] = value;
|
|
533
|
+
} return value;
|
|
534
|
+
};
|
|
598
535
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
return mouseX + offsetX + extraOffsetX;
|
|
602
|
-
};
|
|
536
|
+
var global$6 = global$a;
|
|
537
|
+
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
603
538
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
return mouseX + offsetX + extraOffsetX;
|
|
607
|
-
};
|
|
539
|
+
var SHARED = '__core-js_shared__';
|
|
540
|
+
var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
608
541
|
|
|
609
|
-
|
|
610
|
-
var offsetY = defaultOffset[place].t;
|
|
611
|
-
return mouseY + offsetY + extraOffsetY;
|
|
612
|
-
};
|
|
542
|
+
var sharedStore = store$3;
|
|
613
543
|
|
|
614
|
-
|
|
615
|
-
var offsetY = defaultOffset[place].b;
|
|
616
|
-
return mouseY + offsetY + extraOffsetY;
|
|
617
|
-
}; //
|
|
618
|
-
// Functions to test whether the tooltip's sides are inside
|
|
619
|
-
// the client window for a given orientation p
|
|
620
|
-
//
|
|
621
|
-
// _____________
|
|
622
|
-
// | | <-- Right side
|
|
623
|
-
// | p = 'left' |\
|
|
624
|
-
// | |/ |\
|
|
625
|
-
// |_____________| |_\ <-- Mouse
|
|
626
|
-
// / \ |
|
|
627
|
-
// |
|
|
628
|
-
// |
|
|
629
|
-
// Bottom side
|
|
630
|
-
//
|
|
544
|
+
var store$2 = sharedStore;
|
|
631
545
|
|
|
546
|
+
(shared$3.exports = function (key, value) {
|
|
547
|
+
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
548
|
+
})('versions', []).push({
|
|
549
|
+
version: '3.25.5',
|
|
550
|
+
mode: 'global',
|
|
551
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
552
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
553
|
+
source: 'https://github.com/zloirock/core-js'
|
|
554
|
+
});
|
|
632
555
|
|
|
633
|
-
|
|
634
|
-
return getTipOffsetLeft(p) < 0;
|
|
635
|
-
};
|
|
556
|
+
var requireObjectCoercible = requireObjectCoercible$2;
|
|
636
557
|
|
|
637
|
-
|
|
638
|
-
return getTipOffsetRight(p) > windowWidth;
|
|
639
|
-
};
|
|
558
|
+
var $Object$1 = Object;
|
|
640
559
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
560
|
+
// `ToObject` abstract operation
|
|
561
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
562
|
+
var toObject$2 = function (argument) {
|
|
563
|
+
return $Object$1(requireObjectCoercible(argument));
|
|
564
|
+
};
|
|
644
565
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}; // Check whether the tooltip with orientation p is completely inside the client window
|
|
566
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
567
|
+
var toObject$1 = toObject$2;
|
|
648
568
|
|
|
569
|
+
var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
|
|
649
570
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
571
|
+
// `HasOwnProperty` abstract operation
|
|
572
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
573
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
574
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
575
|
+
return hasOwnProperty(toObject$1(it), key);
|
|
576
|
+
};
|
|
653
577
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
578
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
579
|
+
|
|
580
|
+
var id = 0;
|
|
581
|
+
var postfix = Math.random();
|
|
582
|
+
var toString = uncurryThis$6(1.0.toString);
|
|
583
|
+
|
|
584
|
+
var uid$2 = function (key) {
|
|
585
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
586
|
+
};
|
|
657
587
|
|
|
658
|
-
|
|
659
|
-
|
|
588
|
+
var global$5 = global$a;
|
|
589
|
+
var shared$2 = shared$3.exports;
|
|
590
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
591
|
+
var uid$1 = uid$2;
|
|
592
|
+
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
593
|
+
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
660
594
|
|
|
661
|
-
|
|
662
|
-
|
|
595
|
+
var WellKnownSymbolsStore = shared$2('wks');
|
|
596
|
+
var Symbol$1 = global$5.Symbol;
|
|
597
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
598
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
663
599
|
|
|
664
|
-
|
|
665
|
-
|
|
600
|
+
var wellKnownSymbol$5 = function (name) {
|
|
601
|
+
if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
602
|
+
var description = 'Symbol.' + name;
|
|
603
|
+
if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
|
|
604
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
605
|
+
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
606
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
607
|
+
} else {
|
|
608
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
666
609
|
}
|
|
667
|
-
}
|
|
610
|
+
} return WellKnownSymbolsStore[name];
|
|
611
|
+
};
|
|
668
612
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
613
|
+
var call$1 = functionCall;
|
|
614
|
+
var isObject$4 = isObject$6;
|
|
615
|
+
var isSymbol$1 = isSymbol$2;
|
|
616
|
+
var getMethod = getMethod$1;
|
|
617
|
+
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
618
|
+
var wellKnownSymbol$4 = wellKnownSymbol$5;
|
|
672
619
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
newPlace = desiredPlace;
|
|
676
|
-
} else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {
|
|
677
|
-
isNewState = true;
|
|
678
|
-
newPlace = insideList[0];
|
|
679
|
-
}
|
|
620
|
+
var $TypeError$2 = TypeError;
|
|
621
|
+
var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
|
|
680
622
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
623
|
+
// `ToPrimitive` abstract operation
|
|
624
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
625
|
+
var toPrimitive$1 = function (input, pref) {
|
|
626
|
+
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
627
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
628
|
+
var result;
|
|
629
|
+
if (exoticToPrim) {
|
|
630
|
+
if (pref === undefined) pref = 'default';
|
|
631
|
+
result = call$1(exoticToPrim, input, pref);
|
|
632
|
+
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
633
|
+
throw $TypeError$2("Can't convert object to primitive value");
|
|
688
634
|
}
|
|
635
|
+
if (pref === undefined) pref = 'number';
|
|
636
|
+
return ordinaryToPrimitive(input, pref);
|
|
637
|
+
};
|
|
689
638
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
position: {
|
|
693
|
-
left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
|
|
694
|
-
top: parseInt(getTipOffsetTop(place) - parentTop, 10)
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
}
|
|
639
|
+
var toPrimitive = toPrimitive$1;
|
|
640
|
+
var isSymbol = isSymbol$2;
|
|
698
641
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
642
|
+
// `ToPropertyKey` abstract operation
|
|
643
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
644
|
+
var toPropertyKey$2 = function (argument) {
|
|
645
|
+
var key = toPrimitive(argument, 'string');
|
|
646
|
+
return isSymbol(key) ? key : key + '';
|
|
647
|
+
};
|
|
703
648
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
width: parseInt(width, 10)
|
|
707
|
-
};
|
|
708
|
-
}; // Get current mouse offset
|
|
649
|
+
var global$4 = global$a;
|
|
650
|
+
var isObject$3 = isObject$6;
|
|
709
651
|
|
|
652
|
+
var document$1 = global$4.document;
|
|
653
|
+
// typeof document.createElement is 'object' in old IE
|
|
654
|
+
var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
|
|
710
655
|
|
|
711
|
-
var
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
var targetLeft = boundingClientRect.left;
|
|
656
|
+
var documentCreateElement$1 = function (it) {
|
|
657
|
+
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
658
|
+
};
|
|
715
659
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
660
|
+
var DESCRIPTORS$7 = descriptors;
|
|
661
|
+
var fails$4 = fails$9;
|
|
662
|
+
var createElement = documentCreateElement$1;
|
|
719
663
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
}
|
|
664
|
+
// Thanks to IE8 for its funny defineProperty
|
|
665
|
+
var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
|
|
666
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
667
|
+
return Object.defineProperty(createElement('div'), 'a', {
|
|
668
|
+
get: function () { return 7; }
|
|
669
|
+
}).a != 7;
|
|
670
|
+
});
|
|
726
671
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
672
|
+
var DESCRIPTORS$6 = descriptors;
|
|
673
|
+
var call = functionCall;
|
|
674
|
+
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
675
|
+
var createPropertyDescriptor$1 = createPropertyDescriptor$2;
|
|
676
|
+
var toIndexedObject$3 = toIndexedObject$4;
|
|
677
|
+
var toPropertyKey$1 = toPropertyKey$2;
|
|
678
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
679
|
+
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
733
680
|
|
|
681
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
682
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
734
683
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
684
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
685
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
686
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
687
|
+
O = toIndexedObject$3(O);
|
|
688
|
+
P = toPropertyKey$1(P);
|
|
689
|
+
if (IE8_DOM_DEFINE$1) try {
|
|
690
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
691
|
+
} catch (error) { /* empty */ }
|
|
692
|
+
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
693
|
+
};
|
|
743
694
|
|
|
744
|
-
|
|
745
|
-
top = {
|
|
746
|
-
l: -(tipWidth / 2),
|
|
747
|
-
r: tipWidth / 2,
|
|
748
|
-
t: -(tipHeight + disToMouse + triangleHeight),
|
|
749
|
-
b: -disToMouse
|
|
750
|
-
};
|
|
751
|
-
bottom = {
|
|
752
|
-
l: -(tipWidth / 2),
|
|
753
|
-
r: tipWidth / 2,
|
|
754
|
-
t: disToMouse + cursorHeight,
|
|
755
|
-
b: tipHeight + disToMouse + triangleHeight + cursorHeight
|
|
756
|
-
};
|
|
757
|
-
left = {
|
|
758
|
-
l: -(tipWidth + disToMouse + triangleHeight),
|
|
759
|
-
r: -disToMouse,
|
|
760
|
-
t: -(tipHeight / 2),
|
|
761
|
-
b: tipHeight / 2
|
|
762
|
-
};
|
|
763
|
-
right = {
|
|
764
|
-
l: disToMouse,
|
|
765
|
-
r: tipWidth + disToMouse + triangleHeight,
|
|
766
|
-
t: -(tipHeight / 2),
|
|
767
|
-
b: tipHeight / 2
|
|
768
|
-
};
|
|
769
|
-
} else if (effect === 'solid') {
|
|
770
|
-
top = {
|
|
771
|
-
l: -(tipWidth / 2),
|
|
772
|
-
r: tipWidth / 2,
|
|
773
|
-
t: -(targetHeight / 2 + tipHeight + triangleHeight),
|
|
774
|
-
b: -(targetHeight / 2)
|
|
775
|
-
};
|
|
776
|
-
bottom = {
|
|
777
|
-
l: -(tipWidth / 2),
|
|
778
|
-
r: tipWidth / 2,
|
|
779
|
-
t: targetHeight / 2,
|
|
780
|
-
b: targetHeight / 2 + tipHeight + triangleHeight
|
|
781
|
-
};
|
|
782
|
-
left = {
|
|
783
|
-
l: -(tipWidth + targetWidth / 2 + triangleHeight),
|
|
784
|
-
r: -(targetWidth / 2),
|
|
785
|
-
t: -(tipHeight / 2),
|
|
786
|
-
b: tipHeight / 2
|
|
787
|
-
};
|
|
788
|
-
right = {
|
|
789
|
-
l: targetWidth / 2,
|
|
790
|
-
r: tipWidth + targetWidth / 2 + triangleHeight,
|
|
791
|
-
t: -(tipHeight / 2),
|
|
792
|
-
b: tipHeight / 2
|
|
793
|
-
};
|
|
794
|
-
}
|
|
695
|
+
var objectDefineProperty = {};
|
|
795
696
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
697
|
+
var DESCRIPTORS$5 = descriptors;
|
|
698
|
+
var fails$3 = fails$9;
|
|
699
|
+
|
|
700
|
+
// V8 ~ Chrome 36-
|
|
701
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
702
|
+
var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
|
|
703
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
704
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
705
|
+
value: 42,
|
|
706
|
+
writable: false
|
|
707
|
+
}).prototype != 42;
|
|
708
|
+
});
|
|
803
709
|
|
|
710
|
+
var isObject$2 = isObject$6;
|
|
804
711
|
|
|
805
|
-
var
|
|
806
|
-
|
|
807
|
-
var extraOffsetY = 0;
|
|
712
|
+
var $String = String;
|
|
713
|
+
var $TypeError$1 = TypeError;
|
|
808
714
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
715
|
+
// `Assert: Type(argument) is Object`
|
|
716
|
+
var anObject$4 = function (argument) {
|
|
717
|
+
if (isObject$2(argument)) return argument;
|
|
718
|
+
throw $TypeError$1($String(argument) + ' is not an object');
|
|
719
|
+
};
|
|
812
720
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
721
|
+
var DESCRIPTORS$4 = descriptors;
|
|
722
|
+
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
723
|
+
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
724
|
+
var anObject$3 = anObject$4;
|
|
725
|
+
var toPropertyKey = toPropertyKey$2;
|
|
726
|
+
|
|
727
|
+
var $TypeError = TypeError;
|
|
728
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
729
|
+
var $defineProperty = Object.defineProperty;
|
|
730
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
731
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
732
|
+
var ENUMERABLE = 'enumerable';
|
|
733
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
734
|
+
var WRITABLE = 'writable';
|
|
735
|
+
|
|
736
|
+
// `Object.defineProperty` method
|
|
737
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
738
|
+
objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
739
|
+
anObject$3(O);
|
|
740
|
+
P = toPropertyKey(P);
|
|
741
|
+
anObject$3(Attributes);
|
|
742
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
743
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
744
|
+
if (current && current[WRITABLE]) {
|
|
745
|
+
O[P] = Attributes.value;
|
|
746
|
+
Attributes = {
|
|
747
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
748
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
749
|
+
writable: false
|
|
750
|
+
};
|
|
822
751
|
}
|
|
823
|
-
}
|
|
752
|
+
} return $defineProperty(O, P, Attributes);
|
|
753
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
754
|
+
anObject$3(O);
|
|
755
|
+
P = toPropertyKey(P);
|
|
756
|
+
anObject$3(Attributes);
|
|
757
|
+
if (IE8_DOM_DEFINE) try {
|
|
758
|
+
return $defineProperty(O, P, Attributes);
|
|
759
|
+
} catch (error) { /* empty */ }
|
|
760
|
+
if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
|
|
761
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
762
|
+
return O;
|
|
763
|
+
};
|
|
824
764
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
};
|
|
829
|
-
}; // Get the offset of the parent elements
|
|
765
|
+
var DESCRIPTORS$3 = descriptors;
|
|
766
|
+
var definePropertyModule$3 = objectDefineProperty;
|
|
767
|
+
var createPropertyDescriptor = createPropertyDescriptor$2;
|
|
830
768
|
|
|
769
|
+
var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
|
|
770
|
+
return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
|
|
771
|
+
} : function (object, key, value) {
|
|
772
|
+
object[key] = value;
|
|
773
|
+
return object;
|
|
774
|
+
};
|
|
831
775
|
|
|
832
|
-
var
|
|
833
|
-
var currentParent = currentTarget;
|
|
776
|
+
var makeBuiltIn$2 = {exports: {}};
|
|
834
777
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
|
|
778
|
+
var DESCRIPTORS$2 = descriptors;
|
|
779
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
838
780
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
781
|
+
var FunctionPrototype = Function.prototype;
|
|
782
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
783
|
+
var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
|
|
842
784
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
785
|
+
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
|
786
|
+
// additional protection from minified / mangled / dropped function names
|
|
787
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
788
|
+
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
789
|
+
|
|
790
|
+
var functionName = {
|
|
791
|
+
EXISTS: EXISTS,
|
|
792
|
+
PROPER: PROPER,
|
|
793
|
+
CONFIGURABLE: CONFIGURABLE
|
|
849
794
|
};
|
|
850
795
|
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
* it should support multiline
|
|
855
|
-
*
|
|
856
|
-
* @params
|
|
857
|
-
* - `tip` {String} value of data-tip
|
|
858
|
-
* - `children` {ReactElement} this.props.children
|
|
859
|
-
* - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
|
|
860
|
-
*
|
|
861
|
-
* @return
|
|
862
|
-
* - String or react component
|
|
863
|
-
*/
|
|
864
|
-
function getTipContent (tip, children, getContent, multiline) {
|
|
865
|
-
if (children) return children;
|
|
866
|
-
if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
|
|
867
|
-
|
|
868
|
-
if (getContent === null) return null; // Tip not exist and children is null or undefined
|
|
869
|
-
|
|
870
|
-
var regexp = /<br\s*\/?>/;
|
|
871
|
-
|
|
872
|
-
if (!multiline || multiline === 'false' || !regexp.test(tip)) {
|
|
873
|
-
// No trim(), so that user can keep their input
|
|
874
|
-
return tip;
|
|
875
|
-
} // Multiline tooltip content
|
|
796
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
797
|
+
var isCallable$6 = isCallable$c;
|
|
798
|
+
var store$1 = sharedStore;
|
|
876
799
|
|
|
800
|
+
var functionToString = uncurryThis$5(Function.toString);
|
|
877
801
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
});
|
|
802
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
803
|
+
if (!isCallable$6(store$1.inspectSource)) {
|
|
804
|
+
store$1.inspectSource = function (it) {
|
|
805
|
+
return functionToString(it);
|
|
806
|
+
};
|
|
884
807
|
}
|
|
885
808
|
|
|
886
|
-
|
|
887
|
-
* Support aria- and role in ReactTooltip
|
|
888
|
-
*
|
|
889
|
-
* @params props {Object}
|
|
890
|
-
* @return {Object}
|
|
891
|
-
*/
|
|
892
|
-
function parseAria(props) {
|
|
893
|
-
var ariaObj = {};
|
|
894
|
-
Object.keys(props).filter(function (prop) {
|
|
895
|
-
// aria-xxx and role is acceptable
|
|
896
|
-
return /(^aria-\w+$|^role$)/.test(prop);
|
|
897
|
-
}).forEach(function (prop) {
|
|
898
|
-
ariaObj[prop] = props[prop];
|
|
899
|
-
});
|
|
900
|
-
return ariaObj;
|
|
901
|
-
}
|
|
809
|
+
var inspectSource$2 = store$1.inspectSource;
|
|
902
810
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
* @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
|
|
906
|
-
* NodeLists are functions in Safari
|
|
907
|
-
*/
|
|
908
|
-
function nodeListToArray (nodeList) {
|
|
909
|
-
var length = nodeList.length;
|
|
811
|
+
var global$3 = global$a;
|
|
812
|
+
var isCallable$5 = isCallable$c;
|
|
910
813
|
|
|
911
|
-
|
|
912
|
-
return Array.prototype.slice.call(nodeList);
|
|
913
|
-
}
|
|
814
|
+
var WeakMap$1 = global$3.WeakMap;
|
|
914
815
|
|
|
915
|
-
|
|
916
|
-
return nodeList[index];
|
|
917
|
-
});
|
|
918
|
-
}
|
|
816
|
+
var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
919
817
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}
|
|
818
|
+
var shared$1 = shared$3.exports;
|
|
819
|
+
var uid = uid$2;
|
|
923
820
|
|
|
924
|
-
var
|
|
821
|
+
var keys = shared$1('keys');
|
|
925
822
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
*/
|
|
929
|
-
var defaultColors = {
|
|
930
|
-
dark: {
|
|
931
|
-
text: '#fff',
|
|
932
|
-
background: '#222',
|
|
933
|
-
border: 'transparent',
|
|
934
|
-
arrow: '#222'
|
|
935
|
-
},
|
|
936
|
-
success: {
|
|
937
|
-
text: '#fff',
|
|
938
|
-
background: '#8DC572',
|
|
939
|
-
border: 'transparent',
|
|
940
|
-
arrow: '#8DC572'
|
|
941
|
-
},
|
|
942
|
-
warning: {
|
|
943
|
-
text: '#fff',
|
|
944
|
-
background: '#F0AD4E',
|
|
945
|
-
border: 'transparent',
|
|
946
|
-
arrow: '#F0AD4E'
|
|
947
|
-
},
|
|
948
|
-
error: {
|
|
949
|
-
text: '#fff',
|
|
950
|
-
background: '#BE6464',
|
|
951
|
-
border: 'transparent',
|
|
952
|
-
arrow: '#BE6464'
|
|
953
|
-
},
|
|
954
|
-
info: {
|
|
955
|
-
text: '#fff',
|
|
956
|
-
background: '#337AB7',
|
|
957
|
-
border: 'transparent',
|
|
958
|
-
arrow: '#337AB7'
|
|
959
|
-
},
|
|
960
|
-
light: {
|
|
961
|
-
text: '#222',
|
|
962
|
-
background: '#fff',
|
|
963
|
-
border: 'transparent',
|
|
964
|
-
arrow: '#fff'
|
|
965
|
-
}
|
|
823
|
+
var sharedKey$2 = function (key) {
|
|
824
|
+
return keys[key] || (keys[key] = uid(key));
|
|
966
825
|
};
|
|
967
|
-
function getDefaultPopupColors(type) {
|
|
968
|
-
return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
/**
|
|
972
|
-
* Generates the specific tooltip style for use on render.
|
|
973
|
-
*/
|
|
974
|
-
|
|
975
|
-
function generateTooltipStyle(uuid, customColors, type, hasBorder) {
|
|
976
|
-
return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));
|
|
977
|
-
}
|
|
978
|
-
/**
|
|
979
|
-
* Generates the tooltip style rules based on the element-specified "data-type" property.
|
|
980
|
-
*/
|
|
981
|
-
|
|
982
|
-
function generateStyle(uuid, colors) {
|
|
983
|
-
var textColor = colors.text;
|
|
984
|
-
var backgroundColor = colors.background;
|
|
985
|
-
var borderColor = colors.border;
|
|
986
|
-
var arrowColor = colors.arrow;
|
|
987
|
-
return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\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 ");
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
function getPopupColors(customColors, type, hasBorder) {
|
|
991
|
-
var textColor = customColors.text;
|
|
992
|
-
var backgroundColor = customColors.background;
|
|
993
|
-
var borderColor = customColors.border;
|
|
994
|
-
var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
|
|
995
|
-
var colors = getDefaultPopupColors(type);
|
|
996
|
-
|
|
997
|
-
if (textColor) {
|
|
998
|
-
colors.text = textColor;
|
|
999
|
-
}
|
|
1000
826
|
|
|
1001
|
-
|
|
1002
|
-
colors.background = backgroundColor;
|
|
1003
|
-
}
|
|
827
|
+
var hiddenKeys$4 = {};
|
|
1004
828
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
829
|
+
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
830
|
+
var global$2 = global$a;
|
|
831
|
+
var isObject$1 = isObject$6;
|
|
832
|
+
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
|
833
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
834
|
+
var shared = sharedStore;
|
|
835
|
+
var sharedKey$1 = sharedKey$2;
|
|
836
|
+
var hiddenKeys$3 = hiddenKeys$4;
|
|
1012
837
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
838
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
839
|
+
var TypeError$1 = global$2.TypeError;
|
|
840
|
+
var WeakMap = global$2.WeakMap;
|
|
841
|
+
var set, get, has;
|
|
1016
842
|
|
|
1017
|
-
|
|
1018
|
-
}
|
|
843
|
+
var enforce = function (it) {
|
|
844
|
+
return has(it) ? get(it) : set(it, {});
|
|
845
|
+
};
|
|
1019
846
|
|
|
1020
|
-
var
|
|
847
|
+
var getterFor = function (TYPE) {
|
|
848
|
+
return function (it) {
|
|
849
|
+
var state;
|
|
850
|
+
if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
|
|
851
|
+
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
852
|
+
} return state;
|
|
853
|
+
};
|
|
854
|
+
};
|
|
1021
855
|
|
|
1022
|
-
|
|
1023
|
-
|
|
856
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
857
|
+
var store = shared.state || (shared.state = new WeakMap());
|
|
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
|
+
set = function (it, metadata) {
|
|
864
|
+
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
865
|
+
metadata.facade = it;
|
|
866
|
+
store.set(it, metadata);
|
|
867
|
+
return metadata;
|
|
868
|
+
};
|
|
869
|
+
get = function (it) {
|
|
870
|
+
return store.get(it) || {};
|
|
871
|
+
};
|
|
872
|
+
has = function (it) {
|
|
873
|
+
return store.has(it);
|
|
874
|
+
};
|
|
875
|
+
} else {
|
|
876
|
+
var STATE = sharedKey$1('state');
|
|
877
|
+
hiddenKeys$3[STATE] = true;
|
|
878
|
+
set = function (it, metadata) {
|
|
879
|
+
if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
880
|
+
metadata.facade = it;
|
|
881
|
+
createNonEnumerableProperty$1(it, STATE, metadata);
|
|
882
|
+
return metadata;
|
|
883
|
+
};
|
|
884
|
+
get = function (it) {
|
|
885
|
+
return hasOwn$3(it, STATE) ? it[STATE] : {};
|
|
886
|
+
};
|
|
887
|
+
has = function (it) {
|
|
888
|
+
return hasOwn$3(it, STATE);
|
|
889
|
+
};
|
|
1024
890
|
}
|
|
1025
891
|
|
|
1026
|
-
var
|
|
1027
|
-
|
|
892
|
+
var internalState = {
|
|
893
|
+
set: set,
|
|
894
|
+
get: get,
|
|
895
|
+
has: has,
|
|
896
|
+
enforce: enforce,
|
|
897
|
+
getterFor: getterFor
|
|
1028
898
|
};
|
|
1029
899
|
|
|
1030
|
-
|
|
1031
|
-
var
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
1038
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
1039
|
-
(function () { return this; })() || Function('return this')();
|
|
900
|
+
var fails$2 = fails$9;
|
|
901
|
+
var isCallable$4 = isCallable$c;
|
|
902
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
903
|
+
var DESCRIPTORS$1 = descriptors;
|
|
904
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
905
|
+
var inspectSource$1 = inspectSource$2;
|
|
906
|
+
var InternalStateModule = internalState;
|
|
1040
907
|
|
|
1041
|
-
var
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
return true;
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
908
|
+
var enforceInternalState = InternalStateModule.enforce;
|
|
909
|
+
var getInternalState = InternalStateModule.get;
|
|
910
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
911
|
+
var defineProperty$1 = Object.defineProperty;
|
|
1048
912
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1052
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
913
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
|
|
914
|
+
return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
1053
915
|
});
|
|
1054
916
|
|
|
1055
|
-
var
|
|
1056
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1057
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1058
|
-
|
|
1059
|
-
// Nashorn ~ JDK8 bug
|
|
1060
|
-
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
1061
|
-
|
|
1062
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
1063
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
1064
|
-
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
1065
|
-
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
1066
|
-
return !!descriptor && descriptor.enumerable;
|
|
1067
|
-
} : $propertyIsEnumerable;
|
|
1068
|
-
|
|
1069
|
-
var objectPropertyIsEnumerable = {
|
|
1070
|
-
f: f
|
|
1071
|
-
};
|
|
917
|
+
var TEMPLATE = String(String).split('String');
|
|
1072
918
|
|
|
1073
|
-
var
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
919
|
+
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
920
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
921
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
922
|
+
}
|
|
923
|
+
if (options && options.getter) name = 'get ' + name;
|
|
924
|
+
if (options && options.setter) name = 'set ' + name;
|
|
925
|
+
if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
926
|
+
if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
|
|
927
|
+
else value.name = name;
|
|
928
|
+
}
|
|
929
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
|
|
930
|
+
defineProperty$1(value, 'length', { value: options.arity });
|
|
931
|
+
}
|
|
932
|
+
try {
|
|
933
|
+
if (options && hasOwn$2(options, 'constructor') && options.constructor) {
|
|
934
|
+
if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
|
|
935
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
936
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
937
|
+
} catch (error) { /* empty */ }
|
|
938
|
+
var state = enforceInternalState(value);
|
|
939
|
+
if (!hasOwn$2(state, 'source')) {
|
|
940
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
941
|
+
} return value;
|
|
1080
942
|
};
|
|
1081
943
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
return
|
|
944
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
945
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
946
|
+
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
947
|
+
return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
|
|
948
|
+
}, 'toString');
|
|
949
|
+
|
|
950
|
+
var isCallable$3 = isCallable$c;
|
|
951
|
+
var definePropertyModule$2 = objectDefineProperty;
|
|
952
|
+
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
953
|
+
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
954
|
+
|
|
955
|
+
var defineBuiltIn$1 = function (O, key, value, options) {
|
|
956
|
+
if (!options) options = {};
|
|
957
|
+
var simple = options.enumerable;
|
|
958
|
+
var name = options.name !== undefined ? options.name : key;
|
|
959
|
+
if (isCallable$3(value)) makeBuiltIn(value, name, options);
|
|
960
|
+
if (options.global) {
|
|
961
|
+
if (simple) O[key] = value;
|
|
962
|
+
else defineGlobalProperty$1(key, value);
|
|
963
|
+
} else {
|
|
964
|
+
try {
|
|
965
|
+
if (!options.unsafe) delete O[key];
|
|
966
|
+
else if (O[key]) simple = true;
|
|
967
|
+
} catch (error) { /* empty */ }
|
|
968
|
+
if (simple) O[key] = value;
|
|
969
|
+
else definePropertyModule$2.f(O, key, {
|
|
970
|
+
value: value,
|
|
971
|
+
enumerable: false,
|
|
972
|
+
configurable: !options.nonConfigurable,
|
|
973
|
+
writable: !options.nonWritable
|
|
974
|
+
});
|
|
975
|
+
} return O;
|
|
1086
976
|
};
|
|
1087
977
|
|
|
1088
|
-
var
|
|
978
|
+
var objectGetOwnPropertyNames = {};
|
|
1089
979
|
|
|
1090
|
-
|
|
1091
|
-
var
|
|
1092
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
1093
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
1094
|
-
return !Object('z').propertyIsEnumerable(0);
|
|
1095
|
-
}) ? function (it) {
|
|
1096
|
-
return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
|
1097
|
-
} : Object;
|
|
980
|
+
var ceil = Math.ceil;
|
|
981
|
+
var floor = Math.floor;
|
|
1098
982
|
|
|
1099
|
-
// `
|
|
1100
|
-
// https://tc39.es/ecma262/#sec-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
983
|
+
// `Math.trunc` method
|
|
984
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
985
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
986
|
+
var mathTrunc = Math.trunc || function trunc(x) {
|
|
987
|
+
var n = +x;
|
|
988
|
+
return (n > 0 ? floor : ceil)(n);
|
|
1104
989
|
};
|
|
1105
990
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
991
|
+
var trunc = mathTrunc;
|
|
1109
992
|
|
|
1110
|
-
|
|
1111
|
-
|
|
993
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
994
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
995
|
+
var toIntegerOrInfinity$2 = function (argument) {
|
|
996
|
+
var number = +argument;
|
|
997
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
998
|
+
return number !== number || number === 0 ? 0 : trunc(number);
|
|
1112
999
|
};
|
|
1113
1000
|
|
|
1114
|
-
var
|
|
1115
|
-
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
1116
|
-
};
|
|
1001
|
+
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
1117
1002
|
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
1121
|
-
// and the second argument - flag - preferred type is a string
|
|
1122
|
-
var toPrimitive = function (input, PREFERRED_STRING) {
|
|
1123
|
-
if (!isObject(input)) return input;
|
|
1124
|
-
var fn, val;
|
|
1125
|
-
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
1126
|
-
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
1127
|
-
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
1128
|
-
throw TypeError("Can't convert object to primitive value");
|
|
1129
|
-
};
|
|
1003
|
+
var max = Math.max;
|
|
1004
|
+
var min$1 = Math.min;
|
|
1130
1005
|
|
|
1131
|
-
//
|
|
1132
|
-
//
|
|
1133
|
-
|
|
1134
|
-
|
|
1006
|
+
// Helper for a popular repeating case of the spec:
|
|
1007
|
+
// Let integer be ? ToInteger(index).
|
|
1008
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
1009
|
+
var toAbsoluteIndex$1 = function (index, length) {
|
|
1010
|
+
var integer = toIntegerOrInfinity$1(index);
|
|
1011
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
1135
1012
|
};
|
|
1136
1013
|
|
|
1137
|
-
var
|
|
1014
|
+
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
1015
|
+
|
|
1016
|
+
var min = Math.min;
|
|
1138
1017
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1018
|
+
// `ToLength` abstract operation
|
|
1019
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
1020
|
+
var toLength$1 = function (argument) {
|
|
1021
|
+
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
1141
1022
|
};
|
|
1142
1023
|
|
|
1143
|
-
var
|
|
1144
|
-
// typeof document.createElement is 'object' in old IE
|
|
1145
|
-
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
|
1024
|
+
var toLength = toLength$1;
|
|
1146
1025
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1026
|
+
// `LengthOfArrayLike` abstract operation
|
|
1027
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
1028
|
+
var lengthOfArrayLike$2 = function (obj) {
|
|
1029
|
+
return toLength(obj.length);
|
|
1149
1030
|
};
|
|
1150
1031
|
|
|
1151
|
-
|
|
1152
|
-
var
|
|
1153
|
-
|
|
1154
|
-
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
1155
|
-
get: function () { return 7; }
|
|
1156
|
-
}).a != 7;
|
|
1157
|
-
});
|
|
1158
|
-
|
|
1159
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1160
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1161
|
-
|
|
1162
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
1163
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
1164
|
-
var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
1165
|
-
O = toIndexedObject(O);
|
|
1166
|
-
P = toPrimitive(P, true);
|
|
1167
|
-
if (ie8DomDefine) try {
|
|
1168
|
-
return $getOwnPropertyDescriptor(O, P);
|
|
1169
|
-
} catch (error) { /* empty */ }
|
|
1170
|
-
if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
|
1171
|
-
};
|
|
1172
|
-
|
|
1173
|
-
var objectGetOwnPropertyDescriptor = {
|
|
1174
|
-
f: f$1
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
var anObject = function (it) {
|
|
1178
|
-
if (!isObject(it)) {
|
|
1179
|
-
throw TypeError(String(it) + ' is not an object');
|
|
1180
|
-
} return it;
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
1184
|
-
var $defineProperty = Object.defineProperty;
|
|
1185
|
-
|
|
1186
|
-
// `Object.defineProperty` method
|
|
1187
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
1188
|
-
var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
|
|
1189
|
-
anObject(O);
|
|
1190
|
-
P = toPrimitive(P, true);
|
|
1191
|
-
anObject(Attributes);
|
|
1192
|
-
if (ie8DomDefine) try {
|
|
1193
|
-
return $defineProperty(O, P, Attributes);
|
|
1194
|
-
} catch (error) { /* empty */ }
|
|
1195
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
1196
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
1197
|
-
return O;
|
|
1198
|
-
};
|
|
1199
|
-
|
|
1200
|
-
var objectDefineProperty = {
|
|
1201
|
-
f: f$2
|
|
1202
|
-
};
|
|
1203
|
-
|
|
1204
|
-
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
1205
|
-
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
1206
|
-
} : function (object, key, value) {
|
|
1207
|
-
object[key] = value;
|
|
1208
|
-
return object;
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
var setGlobal = function (key, value) {
|
|
1212
|
-
try {
|
|
1213
|
-
createNonEnumerableProperty(global_1, key, value);
|
|
1214
|
-
} catch (error) {
|
|
1215
|
-
global_1[key] = value;
|
|
1216
|
-
} return value;
|
|
1217
|
-
};
|
|
1218
|
-
|
|
1219
|
-
var SHARED = '__core-js_shared__';
|
|
1220
|
-
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
1221
|
-
|
|
1222
|
-
var sharedStore = store;
|
|
1223
|
-
|
|
1224
|
-
var functionToString = Function.toString;
|
|
1225
|
-
|
|
1226
|
-
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
|
1227
|
-
if (typeof sharedStore.inspectSource != 'function') {
|
|
1228
|
-
sharedStore.inspectSource = function (it) {
|
|
1229
|
-
return functionToString.call(it);
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
var inspectSource = sharedStore.inspectSource;
|
|
1234
|
-
|
|
1235
|
-
var WeakMap = global_1.WeakMap;
|
|
1236
|
-
|
|
1237
|
-
var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
|
1238
|
-
|
|
1239
|
-
var shared = createCommonjsModule(function (module) {
|
|
1240
|
-
(module.exports = function (key, value) {
|
|
1241
|
-
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
1242
|
-
})('versions', []).push({
|
|
1243
|
-
version: '3.12.1',
|
|
1244
|
-
mode: 'global',
|
|
1245
|
-
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
1246
|
-
});
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
var id = 0;
|
|
1250
|
-
var postfix = Math.random();
|
|
1251
|
-
|
|
1252
|
-
var uid = function (key) {
|
|
1253
|
-
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
|
1254
|
-
};
|
|
1255
|
-
|
|
1256
|
-
var keys = shared('keys');
|
|
1257
|
-
|
|
1258
|
-
var sharedKey = function (key) {
|
|
1259
|
-
return keys[key] || (keys[key] = uid(key));
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
var hiddenKeys = {};
|
|
1263
|
-
|
|
1264
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
1265
|
-
var WeakMap$1 = global_1.WeakMap;
|
|
1266
|
-
var set, get, has$1;
|
|
1267
|
-
|
|
1268
|
-
var enforce = function (it) {
|
|
1269
|
-
return has$1(it) ? get(it) : set(it, {});
|
|
1270
|
-
};
|
|
1271
|
-
|
|
1272
|
-
var getterFor = function (TYPE) {
|
|
1273
|
-
return function (it) {
|
|
1274
|
-
var state;
|
|
1275
|
-
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
1276
|
-
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
1277
|
-
} return state;
|
|
1278
|
-
};
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1281
|
-
if (nativeWeakMap || sharedStore.state) {
|
|
1282
|
-
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
|
|
1283
|
-
var wmget = store$1.get;
|
|
1284
|
-
var wmhas = store$1.has;
|
|
1285
|
-
var wmset = store$1.set;
|
|
1286
|
-
set = function (it, metadata) {
|
|
1287
|
-
if (wmhas.call(store$1, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
1288
|
-
metadata.facade = it;
|
|
1289
|
-
wmset.call(store$1, it, metadata);
|
|
1290
|
-
return metadata;
|
|
1291
|
-
};
|
|
1292
|
-
get = function (it) {
|
|
1293
|
-
return wmget.call(store$1, it) || {};
|
|
1294
|
-
};
|
|
1295
|
-
has$1 = function (it) {
|
|
1296
|
-
return wmhas.call(store$1, it);
|
|
1297
|
-
};
|
|
1298
|
-
} else {
|
|
1299
|
-
var STATE = sharedKey('state');
|
|
1300
|
-
hiddenKeys[STATE] = true;
|
|
1301
|
-
set = function (it, metadata) {
|
|
1302
|
-
if (has(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
1303
|
-
metadata.facade = it;
|
|
1304
|
-
createNonEnumerableProperty(it, STATE, metadata);
|
|
1305
|
-
return metadata;
|
|
1306
|
-
};
|
|
1307
|
-
get = function (it) {
|
|
1308
|
-
return has(it, STATE) ? it[STATE] : {};
|
|
1309
|
-
};
|
|
1310
|
-
has$1 = function (it) {
|
|
1311
|
-
return has(it, STATE);
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
var internalState = {
|
|
1316
|
-
set: set,
|
|
1317
|
-
get: get,
|
|
1318
|
-
has: has$1,
|
|
1319
|
-
enforce: enforce,
|
|
1320
|
-
getterFor: getterFor
|
|
1321
|
-
};
|
|
1322
|
-
|
|
1323
|
-
var redefine = createCommonjsModule(function (module) {
|
|
1324
|
-
var getInternalState = internalState.get;
|
|
1325
|
-
var enforceInternalState = internalState.enforce;
|
|
1326
|
-
var TEMPLATE = String(String).split('String');
|
|
1327
|
-
|
|
1328
|
-
(module.exports = function (O, key, value, options) {
|
|
1329
|
-
var unsafe = options ? !!options.unsafe : false;
|
|
1330
|
-
var simple = options ? !!options.enumerable : false;
|
|
1331
|
-
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
1332
|
-
var state;
|
|
1333
|
-
if (typeof value == 'function') {
|
|
1334
|
-
if (typeof key == 'string' && !has(value, 'name')) {
|
|
1335
|
-
createNonEnumerableProperty(value, 'name', key);
|
|
1336
|
-
}
|
|
1337
|
-
state = enforceInternalState(value);
|
|
1338
|
-
if (!state.source) {
|
|
1339
|
-
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
if (O === global_1) {
|
|
1343
|
-
if (simple) O[key] = value;
|
|
1344
|
-
else setGlobal(key, value);
|
|
1345
|
-
return;
|
|
1346
|
-
} else if (!unsafe) {
|
|
1347
|
-
delete O[key];
|
|
1348
|
-
} else if (!noTargetGet && O[key]) {
|
|
1349
|
-
simple = true;
|
|
1350
|
-
}
|
|
1351
|
-
if (simple) O[key] = value;
|
|
1352
|
-
else createNonEnumerableProperty(O, key, value);
|
|
1353
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
1354
|
-
})(Function.prototype, 'toString', function toString() {
|
|
1355
|
-
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
|
1356
|
-
});
|
|
1357
|
-
});
|
|
1358
|
-
|
|
1359
|
-
var path = global_1;
|
|
1360
|
-
|
|
1361
|
-
var aFunction = function (variable) {
|
|
1362
|
-
return typeof variable == 'function' ? variable : undefined;
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
var getBuiltIn = function (namespace, method) {
|
|
1366
|
-
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
|
1367
|
-
: path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
|
1368
|
-
};
|
|
1369
|
-
|
|
1370
|
-
var ceil = Math.ceil;
|
|
1371
|
-
var floor = Math.floor;
|
|
1372
|
-
|
|
1373
|
-
// `ToInteger` abstract operation
|
|
1374
|
-
// https://tc39.es/ecma262/#sec-tointeger
|
|
1375
|
-
var toInteger = function (argument) {
|
|
1376
|
-
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
|
-
var min = Math.min;
|
|
1380
|
-
|
|
1381
|
-
// `ToLength` abstract operation
|
|
1382
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
1383
|
-
var toLength = function (argument) {
|
|
1384
|
-
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1387
|
-
var max = Math.max;
|
|
1388
|
-
var min$1 = Math.min;
|
|
1389
|
-
|
|
1390
|
-
// Helper for a popular repeating case of the spec:
|
|
1391
|
-
// Let integer be ? ToInteger(index).
|
|
1392
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
1393
|
-
var toAbsoluteIndex = function (index, length) {
|
|
1394
|
-
var integer = toInteger(index);
|
|
1395
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
1396
|
-
};
|
|
1032
|
+
var toIndexedObject$2 = toIndexedObject$4;
|
|
1033
|
+
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
1034
|
+
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
1397
1035
|
|
|
1398
1036
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
1399
|
-
var createMethod = function (IS_INCLUDES) {
|
|
1037
|
+
var createMethod$1 = function (IS_INCLUDES) {
|
|
1400
1038
|
return function ($this, el, fromIndex) {
|
|
1401
|
-
var O = toIndexedObject($this);
|
|
1402
|
-
var length =
|
|
1039
|
+
var O = toIndexedObject$2($this);
|
|
1040
|
+
var length = lengthOfArrayLike$1(O);
|
|
1403
1041
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
1404
1042
|
var value;
|
|
1405
1043
|
// Array#includes uses SameValueZero equality algorithm
|
|
@@ -1418,30 +1056,35 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
1418
1056
|
var arrayIncludes = {
|
|
1419
1057
|
// `Array.prototype.includes` method
|
|
1420
1058
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
1421
|
-
includes: createMethod(true),
|
|
1059
|
+
includes: createMethod$1(true),
|
|
1422
1060
|
// `Array.prototype.indexOf` method
|
|
1423
1061
|
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
1424
|
-
indexOf: createMethod(false)
|
|
1062
|
+
indexOf: createMethod$1(false)
|
|
1425
1063
|
};
|
|
1426
1064
|
|
|
1065
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
1066
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1067
|
+
var toIndexedObject$1 = toIndexedObject$4;
|
|
1427
1068
|
var indexOf = arrayIncludes.indexOf;
|
|
1069
|
+
var hiddenKeys$2 = hiddenKeys$4;
|
|
1428
1070
|
|
|
1071
|
+
var push$1 = uncurryThis$4([].push);
|
|
1429
1072
|
|
|
1430
1073
|
var objectKeysInternal = function (object, names) {
|
|
1431
|
-
var O = toIndexedObject(object);
|
|
1074
|
+
var O = toIndexedObject$1(object);
|
|
1432
1075
|
var i = 0;
|
|
1433
1076
|
var result = [];
|
|
1434
1077
|
var key;
|
|
1435
|
-
for (key in O) !
|
|
1078
|
+
for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
|
|
1436
1079
|
// Don't enum bug & hidden keys
|
|
1437
|
-
while (names.length > i) if (
|
|
1438
|
-
~indexOf(result, key) ||
|
|
1080
|
+
while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
|
|
1081
|
+
~indexOf(result, key) || push$1(result, key);
|
|
1439
1082
|
}
|
|
1440
1083
|
return result;
|
|
1441
1084
|
};
|
|
1442
1085
|
|
|
1443
1086
|
// IE8- don't enum bug keys
|
|
1444
|
-
var enumBugKeys = [
|
|
1087
|
+
var enumBugKeys$3 = [
|
|
1445
1088
|
'constructor',
|
|
1446
1089
|
'hasOwnProperty',
|
|
1447
1090
|
'isPrototypeOf',
|
|
@@ -1451,83 +1094,100 @@ var enumBugKeys = [
|
|
|
1451
1094
|
'valueOf'
|
|
1452
1095
|
];
|
|
1453
1096
|
|
|
1454
|
-
var
|
|
1097
|
+
var internalObjectKeys$1 = objectKeysInternal;
|
|
1098
|
+
var enumBugKeys$2 = enumBugKeys$3;
|
|
1099
|
+
|
|
1100
|
+
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
1455
1101
|
|
|
1456
1102
|
// `Object.getOwnPropertyNames` method
|
|
1457
1103
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
1458
1104
|
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
1459
|
-
|
|
1460
|
-
return
|
|
1105
|
+
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
1106
|
+
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
1461
1107
|
};
|
|
1462
1108
|
|
|
1463
|
-
var
|
|
1464
|
-
f: f$3
|
|
1465
|
-
};
|
|
1109
|
+
var objectGetOwnPropertySymbols = {};
|
|
1466
1110
|
|
|
1467
1111
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
1468
|
-
|
|
1112
|
+
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1469
1113
|
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1472
|
-
|
|
1114
|
+
var getBuiltIn$2 = getBuiltIn$5;
|
|
1115
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
1116
|
+
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1117
|
+
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1118
|
+
var anObject$2 = anObject$4;
|
|
1119
|
+
|
|
1120
|
+
var concat = uncurryThis$3([].concat);
|
|
1473
1121
|
|
|
1474
1122
|
// all object keys, includes non-enumerable and symbols
|
|
1475
|
-
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1476
|
-
var keys =
|
|
1477
|
-
var getOwnPropertySymbols =
|
|
1478
|
-
return getOwnPropertySymbols ?
|
|
1123
|
+
var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1124
|
+
var keys = getOwnPropertyNamesModule.f(anObject$2(it));
|
|
1125
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1126
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
1479
1127
|
};
|
|
1480
1128
|
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1129
|
+
var hasOwn = hasOwnProperty_1;
|
|
1130
|
+
var ownKeys = ownKeys$1;
|
|
1131
|
+
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1132
|
+
var definePropertyModule$1 = objectDefineProperty;
|
|
1133
|
+
|
|
1134
|
+
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
1135
|
+
var keys = ownKeys(source);
|
|
1136
|
+
var defineProperty = definePropertyModule$1.f;
|
|
1137
|
+
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1485
1138
|
for (var i = 0; i < keys.length; i++) {
|
|
1486
1139
|
var key = keys[i];
|
|
1487
|
-
if (!
|
|
1140
|
+
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
|
1141
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1142
|
+
}
|
|
1488
1143
|
}
|
|
1489
1144
|
};
|
|
1490
1145
|
|
|
1146
|
+
var fails$1 = fails$9;
|
|
1147
|
+
var isCallable$2 = isCallable$c;
|
|
1148
|
+
|
|
1491
1149
|
var replacement = /#|\.prototype\./;
|
|
1492
1150
|
|
|
1493
|
-
var isForced = function (feature, detection) {
|
|
1151
|
+
var isForced$1 = function (feature, detection) {
|
|
1494
1152
|
var value = data[normalize(feature)];
|
|
1495
1153
|
return value == POLYFILL ? true
|
|
1496
1154
|
: value == NATIVE ? false
|
|
1497
|
-
:
|
|
1155
|
+
: isCallable$2(detection) ? fails$1(detection)
|
|
1498
1156
|
: !!detection;
|
|
1499
1157
|
};
|
|
1500
1158
|
|
|
1501
|
-
var normalize = isForced.normalize = function (string) {
|
|
1159
|
+
var normalize = isForced$1.normalize = function (string) {
|
|
1502
1160
|
return String(string).replace(replacement, '.').toLowerCase();
|
|
1503
1161
|
};
|
|
1504
1162
|
|
|
1505
|
-
var data = isForced.data = {};
|
|
1506
|
-
var NATIVE = isForced.NATIVE = 'N';
|
|
1507
|
-
var POLYFILL = isForced.POLYFILL = 'P';
|
|
1508
|
-
|
|
1509
|
-
var isForced_1 = isForced;
|
|
1510
|
-
|
|
1511
|
-
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1163
|
+
var data = isForced$1.data = {};
|
|
1164
|
+
var NATIVE = isForced$1.NATIVE = 'N';
|
|
1165
|
+
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
1515
1166
|
|
|
1167
|
+
var isForced_1 = isForced$1;
|
|
1516
1168
|
|
|
1169
|
+
var global$1 = global$a;
|
|
1170
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1171
|
+
var createNonEnumerableProperty = createNonEnumerableProperty$2;
|
|
1172
|
+
var defineBuiltIn = defineBuiltIn$1;
|
|
1173
|
+
var defineGlobalProperty = defineGlobalProperty$3;
|
|
1174
|
+
var copyConstructorProperties = copyConstructorProperties$1;
|
|
1175
|
+
var isForced = isForced_1;
|
|
1517
1176
|
|
|
1518
1177
|
/*
|
|
1519
|
-
options.target
|
|
1520
|
-
options.global
|
|
1521
|
-
options.stat
|
|
1522
|
-
options.proto
|
|
1523
|
-
options.real
|
|
1524
|
-
options.forced
|
|
1525
|
-
options.bind
|
|
1526
|
-
options.wrap
|
|
1527
|
-
options.unsafe
|
|
1528
|
-
options.sham
|
|
1529
|
-
options.enumerable
|
|
1530
|
-
options.
|
|
1178
|
+
options.target - name of the target object
|
|
1179
|
+
options.global - target is the global object
|
|
1180
|
+
options.stat - export as static methods of target
|
|
1181
|
+
options.proto - export as prototype methods of target
|
|
1182
|
+
options.real - real prototype method for the `pure` version
|
|
1183
|
+
options.forced - export even if the native feature is available
|
|
1184
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
1185
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
1186
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
1187
|
+
options.sham - add a flag to not completely full polyfills
|
|
1188
|
+
options.enumerable - export as enumerable property
|
|
1189
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
1190
|
+
options.name - the .name of the function if it does not match the key
|
|
1531
1191
|
*/
|
|
1532
1192
|
var _export = function (options, source) {
|
|
1533
1193
|
var TARGET = options.target;
|
|
@@ -1535,158 +1195,204 @@ var _export = function (options, source) {
|
|
|
1535
1195
|
var STATIC = options.stat;
|
|
1536
1196
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1537
1197
|
if (GLOBAL) {
|
|
1538
|
-
target =
|
|
1198
|
+
target = global$1;
|
|
1539
1199
|
} else if (STATIC) {
|
|
1540
|
-
target =
|
|
1200
|
+
target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1541
1201
|
} else {
|
|
1542
|
-
target = (
|
|
1202
|
+
target = (global$1[TARGET] || {}).prototype;
|
|
1543
1203
|
}
|
|
1544
1204
|
if (target) for (key in source) {
|
|
1545
1205
|
sourceProperty = source[key];
|
|
1546
|
-
if (options.
|
|
1547
|
-
descriptor = getOwnPropertyDescriptor
|
|
1206
|
+
if (options.dontCallGetSet) {
|
|
1207
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1548
1208
|
targetProperty = descriptor && descriptor.value;
|
|
1549
1209
|
} else targetProperty = target[key];
|
|
1550
|
-
FORCED =
|
|
1210
|
+
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1551
1211
|
// contained in target
|
|
1552
1212
|
if (!FORCED && targetProperty !== undefined) {
|
|
1553
|
-
if (typeof sourceProperty
|
|
1213
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1554
1214
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1555
1215
|
}
|
|
1556
1216
|
// add a flag to not completely full polyfills
|
|
1557
1217
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1558
1218
|
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
1559
1219
|
}
|
|
1560
|
-
|
|
1561
|
-
redefine(target, key, sourceProperty, options);
|
|
1220
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
1562
1221
|
}
|
|
1563
1222
|
};
|
|
1564
1223
|
|
|
1565
|
-
var
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1224
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1225
|
+
var aCallable = aCallable$2;
|
|
1226
|
+
var NATIVE_BIND = functionBindNative;
|
|
1227
|
+
|
|
1228
|
+
var bind$1 = uncurryThis$2(uncurryThis$2.bind);
|
|
1570
1229
|
|
|
1571
1230
|
// optional / simple context binding
|
|
1572
|
-
var functionBindContext = function (fn, that
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
switch (length) {
|
|
1576
|
-
case 0: return function () {
|
|
1577
|
-
return fn.call(that);
|
|
1578
|
-
};
|
|
1579
|
-
case 1: return function (a) {
|
|
1580
|
-
return fn.call(that, a);
|
|
1581
|
-
};
|
|
1582
|
-
case 2: return function (a, b) {
|
|
1583
|
-
return fn.call(that, a, b);
|
|
1584
|
-
};
|
|
1585
|
-
case 3: return function (a, b, c) {
|
|
1586
|
-
return fn.call(that, a, b, c);
|
|
1587
|
-
};
|
|
1588
|
-
}
|
|
1589
|
-
return function (/* ...args */) {
|
|
1231
|
+
var functionBindContext = function (fn, that) {
|
|
1232
|
+
aCallable(fn);
|
|
1233
|
+
return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
|
|
1590
1234
|
return fn.apply(that, arguments);
|
|
1591
1235
|
};
|
|
1592
1236
|
};
|
|
1593
1237
|
|
|
1238
|
+
var classof$2 = classofRaw$2;
|
|
1239
|
+
|
|
1594
1240
|
// `IsArray` abstract operation
|
|
1595
1241
|
// https://tc39.es/ecma262/#sec-isarray
|
|
1596
1242
|
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
1597
|
-
var isArray = Array.isArray || function isArray(
|
|
1598
|
-
return
|
|
1243
|
+
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
1244
|
+
return classof$2(argument) == 'Array';
|
|
1599
1245
|
};
|
|
1600
1246
|
|
|
1601
|
-
var
|
|
1247
|
+
var wellKnownSymbol$3 = wellKnownSymbol$5;
|
|
1602
1248
|
|
|
1603
|
-
var
|
|
1604
|
-
var
|
|
1605
|
-
var v8 = versions && versions.v8;
|
|
1606
|
-
var match, version;
|
|
1249
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
1250
|
+
var test = {};
|
|
1607
1251
|
|
|
1608
|
-
|
|
1609
|
-
match = v8.split('.');
|
|
1610
|
-
version = match[0] < 4 ? 1 : match[0] + match[1];
|
|
1611
|
-
} else if (engineUserAgent) {
|
|
1612
|
-
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
1613
|
-
if (!match || match[1] >= 74) {
|
|
1614
|
-
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
1615
|
-
if (match) version = match[1];
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1252
|
+
test[TO_STRING_TAG$1] = 'z';
|
|
1618
1253
|
|
|
1619
|
-
var
|
|
1254
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
1620
1255
|
|
|
1621
|
-
|
|
1256
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1257
|
+
var isCallable$1 = isCallable$c;
|
|
1258
|
+
var classofRaw = classofRaw$2;
|
|
1259
|
+
var wellKnownSymbol$2 = wellKnownSymbol$5;
|
|
1622
1260
|
|
|
1261
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
1262
|
+
var $Object = Object;
|
|
1623
1263
|
|
|
1264
|
+
// ES3 wrong here
|
|
1265
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1624
1266
|
|
|
1625
|
-
//
|
|
1626
|
-
var
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
});
|
|
1267
|
+
// fallback for IE11 Script Access Denied error
|
|
1268
|
+
var tryGet = function (it, key) {
|
|
1269
|
+
try {
|
|
1270
|
+
return it[key];
|
|
1271
|
+
} catch (error) { /* empty */ }
|
|
1272
|
+
};
|
|
1632
1273
|
|
|
1633
|
-
|
|
1274
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
1275
|
+
var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1276
|
+
var O, tag, result;
|
|
1277
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1278
|
+
// @@toStringTag case
|
|
1279
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1280
|
+
// builtinTag case
|
|
1281
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1282
|
+
// ES3 arguments fallback
|
|
1283
|
+
: (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
1287
|
+
var fails = fails$9;
|
|
1288
|
+
var isCallable = isCallable$c;
|
|
1289
|
+
var classof = classof$1;
|
|
1290
|
+
var getBuiltIn$1 = getBuiltIn$5;
|
|
1291
|
+
var inspectSource = inspectSource$2;
|
|
1292
|
+
|
|
1293
|
+
var noop = function () { /* empty */ };
|
|
1294
|
+
var empty = [];
|
|
1295
|
+
var construct = getBuiltIn$1('Reflect', 'construct');
|
|
1296
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1297
|
+
var exec = uncurryThis$1(constructorRegExp.exec);
|
|
1298
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
1299
|
+
|
|
1300
|
+
var isConstructorModern = function isConstructor(argument) {
|
|
1301
|
+
if (!isCallable(argument)) return false;
|
|
1302
|
+
try {
|
|
1303
|
+
construct(noop, empty, argument);
|
|
1304
|
+
return true;
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1634
1309
|
|
|
1310
|
+
var isConstructorLegacy = function isConstructor(argument) {
|
|
1311
|
+
if (!isCallable(argument)) return false;
|
|
1312
|
+
switch (classof(argument)) {
|
|
1313
|
+
case 'AsyncFunction':
|
|
1314
|
+
case 'GeneratorFunction':
|
|
1315
|
+
case 'AsyncGeneratorFunction': return false;
|
|
1316
|
+
}
|
|
1317
|
+
try {
|
|
1318
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1319
|
+
// `Function#toString` throws on some built-it function in some legacy engines
|
|
1320
|
+
// (for example, `DOMQuad` and similar in FF41-)
|
|
1321
|
+
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1322
|
+
} catch (error) {
|
|
1323
|
+
return true;
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1635
1326
|
|
|
1636
|
-
|
|
1637
|
-
&& !Symbol.sham
|
|
1638
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
1327
|
+
isConstructorLegacy.sham = true;
|
|
1639
1328
|
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
var
|
|
1329
|
+
// `IsConstructor` abstract operation
|
|
1330
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1331
|
+
var isConstructor$1 = !construct || fails(function () {
|
|
1332
|
+
var called;
|
|
1333
|
+
return isConstructorModern(isConstructorModern.call)
|
|
1334
|
+
|| !isConstructorModern(Object)
|
|
1335
|
+
|| !isConstructorModern(function () { called = true; })
|
|
1336
|
+
|| called;
|
|
1337
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
1643
1338
|
|
|
1644
|
-
var
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
} else {
|
|
1649
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
|
1650
|
-
}
|
|
1651
|
-
} return WellKnownSymbolsStore[name];
|
|
1652
|
-
};
|
|
1339
|
+
var isArray = isArray$1;
|
|
1340
|
+
var isConstructor = isConstructor$1;
|
|
1341
|
+
var isObject = isObject$6;
|
|
1342
|
+
var wellKnownSymbol$1 = wellKnownSymbol$5;
|
|
1653
1343
|
|
|
1654
|
-
var SPECIES = wellKnownSymbol('species');
|
|
1344
|
+
var SPECIES = wellKnownSymbol$1('species');
|
|
1345
|
+
var $Array = Array;
|
|
1655
1346
|
|
|
1656
|
-
// `ArraySpeciesCreate` abstract operation
|
|
1347
|
+
// a part of `ArraySpeciesCreate` abstract operation
|
|
1657
1348
|
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1658
|
-
var
|
|
1349
|
+
var arraySpeciesConstructor$1 = function (originalArray) {
|
|
1659
1350
|
var C;
|
|
1660
1351
|
if (isArray(originalArray)) {
|
|
1661
1352
|
C = originalArray.constructor;
|
|
1662
1353
|
// cross-realm fallback
|
|
1663
|
-
if (
|
|
1354
|
+
if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
|
1664
1355
|
else if (isObject(C)) {
|
|
1665
1356
|
C = C[SPECIES];
|
|
1666
1357
|
if (C === null) C = undefined;
|
|
1667
1358
|
}
|
|
1668
|
-
} return
|
|
1359
|
+
} return C === undefined ? $Array : C;
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
var arraySpeciesConstructor = arraySpeciesConstructor$1;
|
|
1363
|
+
|
|
1364
|
+
// `ArraySpeciesCreate` abstract operation
|
|
1365
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1366
|
+
var arraySpeciesCreate$1 = function (originalArray, length) {
|
|
1367
|
+
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
1669
1368
|
};
|
|
1670
1369
|
|
|
1671
|
-
var
|
|
1370
|
+
var bind = functionBindContext;
|
|
1371
|
+
var uncurryThis = functionUncurryThis;
|
|
1372
|
+
var IndexedObject = indexedObject;
|
|
1373
|
+
var toObject = toObject$2;
|
|
1374
|
+
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
1375
|
+
var arraySpeciesCreate = arraySpeciesCreate$1;
|
|
1672
1376
|
|
|
1673
|
-
|
|
1674
|
-
|
|
1377
|
+
var push = uncurryThis([].push);
|
|
1378
|
+
|
|
1379
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
1380
|
+
var createMethod = function (TYPE) {
|
|
1675
1381
|
var IS_MAP = TYPE == 1;
|
|
1676
1382
|
var IS_FILTER = TYPE == 2;
|
|
1677
1383
|
var IS_SOME = TYPE == 3;
|
|
1678
1384
|
var IS_EVERY = TYPE == 4;
|
|
1679
1385
|
var IS_FIND_INDEX = TYPE == 6;
|
|
1680
|
-
var
|
|
1386
|
+
var IS_FILTER_REJECT = TYPE == 7;
|
|
1681
1387
|
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
1682
1388
|
return function ($this, callbackfn, that, specificCreate) {
|
|
1683
1389
|
var O = toObject($this);
|
|
1684
|
-
var self =
|
|
1685
|
-
var boundFunction =
|
|
1686
|
-
var length =
|
|
1390
|
+
var self = IndexedObject(O);
|
|
1391
|
+
var boundFunction = bind(callbackfn, that);
|
|
1392
|
+
var length = lengthOfArrayLike(self);
|
|
1687
1393
|
var index = 0;
|
|
1688
1394
|
var create = specificCreate || arraySpeciesCreate;
|
|
1689
|
-
var target = IS_MAP ? create($this, length) : IS_FILTER ||
|
|
1395
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
|
1690
1396
|
var value, result;
|
|
1691
1397
|
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
1692
1398
|
value = self[index];
|
|
@@ -1697,10 +1403,10 @@ var createMethod$1 = function (TYPE) {
|
|
|
1697
1403
|
case 3: return true; // some
|
|
1698
1404
|
case 5: return value; // find
|
|
1699
1405
|
case 6: return index; // findIndex
|
|
1700
|
-
case 2: push
|
|
1406
|
+
case 2: push(target, value); // filter
|
|
1701
1407
|
} else switch (TYPE) {
|
|
1702
1408
|
case 4: return false; // every
|
|
1703
|
-
case 7: push
|
|
1409
|
+
case 7: push(target, value); // filterReject
|
|
1704
1410
|
}
|
|
1705
1411
|
}
|
|
1706
1412
|
}
|
|
@@ -1711,51 +1417,76 @@ var createMethod$1 = function (TYPE) {
|
|
|
1711
1417
|
var arrayIteration = {
|
|
1712
1418
|
// `Array.prototype.forEach` method
|
|
1713
1419
|
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
1714
|
-
forEach: createMethod
|
|
1420
|
+
forEach: createMethod(0),
|
|
1715
1421
|
// `Array.prototype.map` method
|
|
1716
1422
|
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
1717
|
-
map: createMethod
|
|
1423
|
+
map: createMethod(1),
|
|
1718
1424
|
// `Array.prototype.filter` method
|
|
1719
1425
|
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
1720
|
-
filter: createMethod
|
|
1426
|
+
filter: createMethod(2),
|
|
1721
1427
|
// `Array.prototype.some` method
|
|
1722
1428
|
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
1723
|
-
some: createMethod
|
|
1429
|
+
some: createMethod(3),
|
|
1724
1430
|
// `Array.prototype.every` method
|
|
1725
1431
|
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
1726
|
-
every: createMethod
|
|
1432
|
+
every: createMethod(4),
|
|
1727
1433
|
// `Array.prototype.find` method
|
|
1728
1434
|
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1729
|
-
find: createMethod
|
|
1435
|
+
find: createMethod(5),
|
|
1730
1436
|
// `Array.prototype.findIndex` method
|
|
1731
1437
|
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
1732
|
-
findIndex: createMethod
|
|
1733
|
-
// `Array.prototype.
|
|
1438
|
+
findIndex: createMethod(6),
|
|
1439
|
+
// `Array.prototype.filterReject` method
|
|
1734
1440
|
// https://github.com/tc39/proposal-array-filtering
|
|
1735
|
-
|
|
1441
|
+
filterReject: createMethod(7)
|
|
1736
1442
|
};
|
|
1737
1443
|
|
|
1444
|
+
var objectDefineProperties = {};
|
|
1445
|
+
|
|
1446
|
+
var internalObjectKeys = objectKeysInternal;
|
|
1447
|
+
var enumBugKeys$1 = enumBugKeys$3;
|
|
1448
|
+
|
|
1738
1449
|
// `Object.keys` method
|
|
1739
1450
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
1740
1451
|
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1741
|
-
var objectKeys = Object.keys || function keys(O) {
|
|
1742
|
-
return
|
|
1452
|
+
var objectKeys$1 = Object.keys || function keys(O) {
|
|
1453
|
+
return internalObjectKeys(O, enumBugKeys$1);
|
|
1743
1454
|
};
|
|
1744
1455
|
|
|
1456
|
+
var DESCRIPTORS = descriptors;
|
|
1457
|
+
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1458
|
+
var definePropertyModule = objectDefineProperty;
|
|
1459
|
+
var anObject$1 = anObject$4;
|
|
1460
|
+
var toIndexedObject = toIndexedObject$4;
|
|
1461
|
+
var objectKeys = objectKeys$1;
|
|
1462
|
+
|
|
1745
1463
|
// `Object.defineProperties` method
|
|
1746
1464
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1747
1465
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1748
|
-
|
|
1749
|
-
anObject(O);
|
|
1466
|
+
objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1467
|
+
anObject$1(O);
|
|
1468
|
+
var props = toIndexedObject(Properties);
|
|
1750
1469
|
var keys = objectKeys(Properties);
|
|
1751
1470
|
var length = keys.length;
|
|
1752
1471
|
var index = 0;
|
|
1753
1472
|
var key;
|
|
1754
|
-
while (length > index)
|
|
1473
|
+
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
|
1755
1474
|
return O;
|
|
1756
1475
|
};
|
|
1757
1476
|
|
|
1758
|
-
var
|
|
1477
|
+
var getBuiltIn = getBuiltIn$5;
|
|
1478
|
+
|
|
1479
|
+
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1480
|
+
|
|
1481
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
1482
|
+
|
|
1483
|
+
var anObject = anObject$4;
|
|
1484
|
+
var definePropertiesModule = objectDefineProperties;
|
|
1485
|
+
var enumBugKeys = enumBugKeys$3;
|
|
1486
|
+
var hiddenKeys = hiddenKeys$4;
|
|
1487
|
+
var html = html$1;
|
|
1488
|
+
var documentCreateElement = documentCreateElement$1;
|
|
1489
|
+
var sharedKey = sharedKey$2;
|
|
1759
1490
|
|
|
1760
1491
|
var GT = '>';
|
|
1761
1492
|
var LT = '<';
|
|
@@ -1803,10 +1534,13 @@ var NullProtoObjectViaIFrame = function () {
|
|
|
1803
1534
|
var activeXDocument;
|
|
1804
1535
|
var NullProtoObject = function () {
|
|
1805
1536
|
try {
|
|
1806
|
-
|
|
1807
|
-
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
|
1537
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
1808
1538
|
} catch (error) { /* ignore */ }
|
|
1809
|
-
NullProtoObject =
|
|
1539
|
+
NullProtoObject = typeof document != 'undefined'
|
|
1540
|
+
? document.domain && activeXDocument
|
|
1541
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1542
|
+
: NullProtoObjectViaIFrame()
|
|
1543
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1810
1544
|
var length = enumBugKeys.length;
|
|
1811
1545
|
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1812
1546
|
return NullProtoObject();
|
|
@@ -1816,6 +1550,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
1816
1550
|
|
|
1817
1551
|
// `Object.create` method
|
|
1818
1552
|
// https://tc39.es/ecma262/#sec-object.create
|
|
1553
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
1819
1554
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
1820
1555
|
var result;
|
|
1821
1556
|
if (O !== null) {
|
|
@@ -1825,28 +1560,33 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
1825
1560
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1826
1561
|
result[IE_PROTO] = O;
|
|
1827
1562
|
} else result = NullProtoObject();
|
|
1828
|
-
return Properties === undefined ? result :
|
|
1563
|
+
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1829
1564
|
};
|
|
1830
1565
|
|
|
1566
|
+
var wellKnownSymbol = wellKnownSymbol$5;
|
|
1567
|
+
var create = objectCreate;
|
|
1568
|
+
var defineProperty = objectDefineProperty.f;
|
|
1569
|
+
|
|
1831
1570
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
1832
1571
|
var ArrayPrototype = Array.prototype;
|
|
1833
1572
|
|
|
1834
1573
|
// Array.prototype[@@unscopables]
|
|
1835
1574
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1836
1575
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
1837
|
-
|
|
1576
|
+
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
1838
1577
|
configurable: true,
|
|
1839
|
-
value:
|
|
1578
|
+
value: create(null)
|
|
1840
1579
|
});
|
|
1841
1580
|
}
|
|
1842
1581
|
|
|
1843
1582
|
// add a key to Array.prototype[@@unscopables]
|
|
1844
|
-
var addToUnscopables = function (key) {
|
|
1583
|
+
var addToUnscopables$1 = function (key) {
|
|
1845
1584
|
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
1846
1585
|
};
|
|
1847
1586
|
|
|
1587
|
+
var $ = _export;
|
|
1848
1588
|
var $find = arrayIteration.find;
|
|
1849
|
-
|
|
1589
|
+
var addToUnscopables = addToUnscopables$1;
|
|
1850
1590
|
|
|
1851
1591
|
var FIND = 'find';
|
|
1852
1592
|
var SKIPS_HOLES = true;
|
|
@@ -1854,87 +1594,867 @@ var SKIPS_HOLES = true;
|
|
|
1854
1594
|
// Shouldn't skip holes
|
|
1855
1595
|
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
|
1856
1596
|
|
|
1857
|
-
// `Array.prototype.find` method
|
|
1858
|
-
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1859
|
-
|
|
1860
|
-
find: function find(callbackfn /* , that = undefined */) {
|
|
1861
|
-
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
1597
|
+
// `Array.prototype.find` method
|
|
1598
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1599
|
+
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
|
1600
|
+
find: function find(callbackfn /* , that = undefined */) {
|
|
1601
|
+
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
|
|
1605
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1606
|
+
addToUnscopables(FIND);
|
|
1607
|
+
|
|
1608
|
+
var CONSTANT = {
|
|
1609
|
+
GLOBAL: {
|
|
1610
|
+
HIDE: '__react_tooltip_hide_event',
|
|
1611
|
+
REBUILD: '__react_tooltip_rebuild_event',
|
|
1612
|
+
SHOW: '__react_tooltip_show_event'
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Static methods for react-tooltip
|
|
1618
|
+
*/
|
|
1619
|
+
var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
|
|
1620
|
+
// Compatible with IE
|
|
1621
|
+
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
|
|
1622
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
1623
|
+
var event;
|
|
1624
|
+
if (typeof window.CustomEvent === 'function') {
|
|
1625
|
+
event = new window.CustomEvent(eventName, {
|
|
1626
|
+
detail: opts
|
|
1627
|
+
});
|
|
1628
|
+
} else {
|
|
1629
|
+
event = document.createEvent('Event');
|
|
1630
|
+
event.initEvent(eventName, false, true, opts);
|
|
1631
|
+
}
|
|
1632
|
+
window.dispatchEvent(event);
|
|
1633
|
+
};
|
|
1634
|
+
function staticMethods (target) {
|
|
1635
|
+
/**
|
|
1636
|
+
* Hide all tooltip
|
|
1637
|
+
* @trigger ReactTooltip.hide()
|
|
1638
|
+
*/
|
|
1639
|
+
target.hide = function (target) {
|
|
1640
|
+
dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
|
|
1641
|
+
target: target
|
|
1642
|
+
});
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* Rebuild all tooltip
|
|
1647
|
+
* @trigger ReactTooltip.rebuild()
|
|
1648
|
+
*/
|
|
1649
|
+
target.rebuild = function () {
|
|
1650
|
+
dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
|
|
1651
|
+
};
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Show specific tooltip
|
|
1655
|
+
* @trigger ReactTooltip.show()
|
|
1656
|
+
*/
|
|
1657
|
+
target.show = function (target) {
|
|
1658
|
+
dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
|
|
1659
|
+
target: target
|
|
1660
|
+
});
|
|
1661
|
+
};
|
|
1662
|
+
target.prototype.globalRebuild = function () {
|
|
1663
|
+
if (this.mount) {
|
|
1664
|
+
this.unbindListener();
|
|
1665
|
+
this.bindListener();
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
target.prototype.globalShow = function (event) {
|
|
1669
|
+
if (this.mount) {
|
|
1670
|
+
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
1671
|
+
// Create a fake event, specific show will limit the type to `solid`
|
|
1672
|
+
// only `float` type cares e.clientX e.clientY
|
|
1673
|
+
this.showTooltip({
|
|
1674
|
+
currentTarget: hasTarget && event.detail.target
|
|
1675
|
+
}, true);
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
target.prototype.globalHide = function (event) {
|
|
1679
|
+
if (this.mount) {
|
|
1680
|
+
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
1681
|
+
this.hideTooltip({
|
|
1682
|
+
currentTarget: hasTarget && event.detail.target
|
|
1683
|
+
}, hasTarget);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* Events that should be bound to the window
|
|
1690
|
+
*/
|
|
1691
|
+
function windowListener (target) {
|
|
1692
|
+
target.prototype.bindWindowEvents = function (resizeHide) {
|
|
1693
|
+
// ReactTooltip.hide
|
|
1694
|
+
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
1695
|
+
window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
|
|
1696
|
+
|
|
1697
|
+
// ReactTooltip.rebuild
|
|
1698
|
+
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
1699
|
+
window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
|
|
1700
|
+
|
|
1701
|
+
// ReactTooltip.show
|
|
1702
|
+
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
1703
|
+
window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
|
|
1704
|
+
|
|
1705
|
+
// Resize
|
|
1706
|
+
if (resizeHide) {
|
|
1707
|
+
window.removeEventListener('resize', this.onWindowResize);
|
|
1708
|
+
window.addEventListener('resize', this.onWindowResize, false);
|
|
1709
|
+
}
|
|
1710
|
+
};
|
|
1711
|
+
target.prototype.unbindWindowEvents = function () {
|
|
1712
|
+
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
1713
|
+
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
1714
|
+
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
1715
|
+
window.removeEventListener('resize', this.onWindowResize);
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* invoked by resize event of window
|
|
1720
|
+
*/
|
|
1721
|
+
target.prototype.onWindowResize = function () {
|
|
1722
|
+
if (!this.mount) return;
|
|
1723
|
+
this.hideTooltip();
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Custom events to control showing and hiding of tooltip
|
|
1729
|
+
*
|
|
1730
|
+
* @attributes
|
|
1731
|
+
* - `event` {String}
|
|
1732
|
+
* - `eventOff` {String}
|
|
1733
|
+
*/
|
|
1734
|
+
|
|
1735
|
+
var checkStatus = function checkStatus(dataEventOff, e) {
|
|
1736
|
+
var show = this.state.show;
|
|
1737
|
+
var id = this.props.id;
|
|
1738
|
+
var isCapture = this.isCapture(e.currentTarget);
|
|
1739
|
+
var currentItem = e.currentTarget.getAttribute('currentItem');
|
|
1740
|
+
if (!isCapture) e.stopPropagation();
|
|
1741
|
+
if (show && currentItem === 'true') {
|
|
1742
|
+
if (!dataEventOff) this.hideTooltip(e);
|
|
1743
|
+
} else {
|
|
1744
|
+
e.currentTarget.setAttribute('currentItem', 'true');
|
|
1745
|
+
setUntargetItems(e.currentTarget, this.getTargetArray(id));
|
|
1746
|
+
this.showTooltip(e);
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
|
|
1750
|
+
for (var i = 0; i < targetArray.length; i++) {
|
|
1751
|
+
if (currentTarget !== targetArray[i]) {
|
|
1752
|
+
targetArray[i].setAttribute('currentItem', 'false');
|
|
1753
|
+
} else {
|
|
1754
|
+
targetArray[i].setAttribute('currentItem', 'true');
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
};
|
|
1758
|
+
var customListeners = {
|
|
1759
|
+
id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
|
|
1760
|
+
set: function set(target, event, listener) {
|
|
1761
|
+
if (this.id in target) {
|
|
1762
|
+
var map = target[this.id];
|
|
1763
|
+
map[event] = listener;
|
|
1764
|
+
} else {
|
|
1765
|
+
// this is workaround for WeakMap, which is not supported in older browsers, such as IE
|
|
1766
|
+
Object.defineProperty(target, this.id, {
|
|
1767
|
+
configurable: true,
|
|
1768
|
+
value: _defineProperty({}, event, listener)
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
},
|
|
1772
|
+
get: function get(target, event) {
|
|
1773
|
+
var map = target[this.id];
|
|
1774
|
+
if (map !== undefined) {
|
|
1775
|
+
return map[event];
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
};
|
|
1779
|
+
function customEvent (target) {
|
|
1780
|
+
target.prototype.isCustomEvent = function (ele) {
|
|
1781
|
+
var event = this.state.event;
|
|
1782
|
+
return event || !!ele.getAttribute('data-event');
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
/* Bind listener for custom event */
|
|
1786
|
+
target.prototype.customBindListener = function (ele) {
|
|
1787
|
+
var _this = this;
|
|
1788
|
+
var _this$state = this.state,
|
|
1789
|
+
event = _this$state.event,
|
|
1790
|
+
eventOff = _this$state.eventOff;
|
|
1791
|
+
var dataEvent = ele.getAttribute('data-event') || event;
|
|
1792
|
+
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
|
|
1793
|
+
dataEvent.split(' ').forEach(function (event) {
|
|
1794
|
+
ele.removeEventListener(event, customListeners.get(ele, event));
|
|
1795
|
+
var customListener = checkStatus.bind(_this, dataEventOff);
|
|
1796
|
+
customListeners.set(ele, event, customListener);
|
|
1797
|
+
ele.addEventListener(event, customListener, false);
|
|
1798
|
+
});
|
|
1799
|
+
if (dataEventOff) {
|
|
1800
|
+
dataEventOff.split(' ').forEach(function (event) {
|
|
1801
|
+
ele.removeEventListener(event, _this.hideTooltip);
|
|
1802
|
+
ele.addEventListener(event, _this.hideTooltip, false);
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
/* Unbind listener for custom event */
|
|
1808
|
+
target.prototype.customUnbindListener = function (ele) {
|
|
1809
|
+
var _this$state2 = this.state,
|
|
1810
|
+
event = _this$state2.event,
|
|
1811
|
+
eventOff = _this$state2.eventOff;
|
|
1812
|
+
var dataEvent = event || ele.getAttribute('data-event');
|
|
1813
|
+
var dataEventOff = eventOff || ele.getAttribute('data-event-off');
|
|
1814
|
+
ele.removeEventListener(dataEvent, customListeners.get(ele, event));
|
|
1815
|
+
if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
|
|
1816
|
+
};
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* Util method to judge if it should follow capture model
|
|
1821
|
+
*/
|
|
1822
|
+
|
|
1823
|
+
function isCapture (target) {
|
|
1824
|
+
target.prototype.isCapture = function (currentTarget) {
|
|
1825
|
+
return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* Util method to get effect
|
|
1831
|
+
*/
|
|
1832
|
+
|
|
1833
|
+
function getEffect (target) {
|
|
1834
|
+
target.prototype.getEffect = function (currentTarget) {
|
|
1835
|
+
var dataEffect = currentTarget.getAttribute('data-effect');
|
|
1836
|
+
return dataEffect || this.props.effect || 'float';
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/**
|
|
1841
|
+
* Util method to get effect
|
|
1842
|
+
*/
|
|
1843
|
+
var makeProxy = function makeProxy(e) {
|
|
1844
|
+
var proxy = {};
|
|
1845
|
+
for (var key in e) {
|
|
1846
|
+
if (typeof e[key] === 'function') {
|
|
1847
|
+
proxy[key] = e[key].bind(e);
|
|
1848
|
+
} else {
|
|
1849
|
+
proxy[key] = e[key];
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
return proxy;
|
|
1853
|
+
};
|
|
1854
|
+
var bodyListener = function bodyListener(callback, options, e) {
|
|
1855
|
+
var _options$respectEffec = options.respectEffect,
|
|
1856
|
+
respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
|
|
1857
|
+
_options$customEvent = options.customEvent,
|
|
1858
|
+
customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
|
|
1859
|
+
var id = this.props.id;
|
|
1860
|
+
var tip = null;
|
|
1861
|
+
var forId;
|
|
1862
|
+
var target = e.target;
|
|
1863
|
+
var lastTarget;
|
|
1864
|
+
// walk up parent chain until tip is found
|
|
1865
|
+
// there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
|
|
1866
|
+
while (tip === null && target !== null) {
|
|
1867
|
+
lastTarget = target;
|
|
1868
|
+
tip = target.getAttribute('data-tip') || null;
|
|
1869
|
+
forId = target.getAttribute('data-for') || null;
|
|
1870
|
+
target = target.parentElement;
|
|
1871
|
+
}
|
|
1872
|
+
target = lastTarget || e.target;
|
|
1873
|
+
if (this.isCustomEvent(target) && !customEvent) {
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1876
|
+
var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
|
|
1877
|
+
if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
|
|
1878
|
+
var proxy = makeProxy(e);
|
|
1879
|
+
proxy.currentTarget = target;
|
|
1880
|
+
callback(proxy);
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1883
|
+
var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
|
|
1884
|
+
var events = {};
|
|
1885
|
+
targetArray.forEach(function (target) {
|
|
1886
|
+
var event = target.getAttribute(dataAttribute);
|
|
1887
|
+
if (event) event.split(' ').forEach(function (event) {
|
|
1888
|
+
return events[event] = true;
|
|
1889
|
+
});
|
|
1890
|
+
});
|
|
1891
|
+
return events;
|
|
1892
|
+
};
|
|
1893
|
+
var getBody = function getBody() {
|
|
1894
|
+
return document.getElementsByTagName('body')[0];
|
|
1895
|
+
};
|
|
1896
|
+
function bodyMode (target) {
|
|
1897
|
+
target.prototype.isBodyMode = function () {
|
|
1898
|
+
return !!this.props.bodyMode;
|
|
1899
|
+
};
|
|
1900
|
+
target.prototype.bindBodyListener = function (targetArray) {
|
|
1901
|
+
var _this = this;
|
|
1902
|
+
var _this$state = this.state,
|
|
1903
|
+
event = _this$state.event,
|
|
1904
|
+
eventOff = _this$state.eventOff,
|
|
1905
|
+
possibleCustomEvents = _this$state.possibleCustomEvents,
|
|
1906
|
+
possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
|
|
1907
|
+
var body = getBody();
|
|
1908
|
+
var customEvents = findCustomEvents(targetArray, 'data-event');
|
|
1909
|
+
var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
|
|
1910
|
+
if (event != null) customEvents[event] = true;
|
|
1911
|
+
if (eventOff != null) customEventsOff[eventOff] = true;
|
|
1912
|
+
possibleCustomEvents.split(' ').forEach(function (event) {
|
|
1913
|
+
return customEvents[event] = true;
|
|
1914
|
+
});
|
|
1915
|
+
possibleCustomEventsOff.split(' ').forEach(function (event) {
|
|
1916
|
+
return customEventsOff[event] = true;
|
|
1917
|
+
});
|
|
1918
|
+
this.unbindBodyListener(body);
|
|
1919
|
+
var listeners = this.bodyModeListeners = {};
|
|
1920
|
+
if (event == null) {
|
|
1921
|
+
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
|
|
1922
|
+
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
|
|
1923
|
+
respectEffect: true
|
|
1924
|
+
});
|
|
1925
|
+
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
|
|
1926
|
+
}
|
|
1927
|
+
for (var _event in customEvents) {
|
|
1928
|
+
listeners[_event] = bodyListener.bind(this, function (e) {
|
|
1929
|
+
var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
|
|
1930
|
+
checkStatus.call(_this, targetEventOff, e);
|
|
1931
|
+
}, {
|
|
1932
|
+
customEvent: true
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
for (var _event2 in customEventsOff) {
|
|
1936
|
+
listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
|
|
1937
|
+
customEvent: true
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
for (var _event3 in listeners) {
|
|
1941
|
+
body.addEventListener(_event3, listeners[_event3]);
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
target.prototype.unbindBodyListener = function (body) {
|
|
1945
|
+
body = body || getBody();
|
|
1946
|
+
var listeners = this.bodyModeListeners;
|
|
1947
|
+
for (var event in listeners) {
|
|
1948
|
+
body.removeEventListener(event, listeners[event]);
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* Tracking target removing from DOM.
|
|
1955
|
+
* It's necessary to hide tooltip when it's target disappears.
|
|
1956
|
+
* Otherwise, the tooltip would be shown forever until another target
|
|
1957
|
+
* is triggered.
|
|
1958
|
+
*
|
|
1959
|
+
* If MutationObserver is not available, this feature just doesn't work.
|
|
1960
|
+
*/
|
|
1961
|
+
|
|
1962
|
+
// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
|
|
1963
|
+
var getMutationObserverClass = function getMutationObserverClass() {
|
|
1964
|
+
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
|
1965
|
+
};
|
|
1966
|
+
function trackRemoval (target) {
|
|
1967
|
+
target.prototype.bindRemovalTracker = function () {
|
|
1968
|
+
var _this = this;
|
|
1969
|
+
var MutationObserver = getMutationObserverClass();
|
|
1970
|
+
if (MutationObserver == null) return;
|
|
1971
|
+
var observer = new MutationObserver(function (mutations) {
|
|
1972
|
+
for (var m1 = 0; m1 < mutations.length; m1++) {
|
|
1973
|
+
var mutation = mutations[m1];
|
|
1974
|
+
for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
|
|
1975
|
+
var element = mutation.removedNodes[m2];
|
|
1976
|
+
if (element === _this.state.currentTarget) {
|
|
1977
|
+
_this.hideTooltip();
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
});
|
|
1983
|
+
observer.observe(window.document, {
|
|
1984
|
+
childList: true,
|
|
1985
|
+
subtree: true
|
|
1986
|
+
});
|
|
1987
|
+
this.removalTracker = observer;
|
|
1988
|
+
};
|
|
1989
|
+
target.prototype.unbindRemovalTracker = function () {
|
|
1990
|
+
if (this.removalTracker) {
|
|
1991
|
+
this.removalTracker.disconnect();
|
|
1992
|
+
this.removalTracker = null;
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* Calculate the position of tooltip
|
|
1999
|
+
*
|
|
2000
|
+
* @params
|
|
2001
|
+
* - `e` {Event} the event of current mouse
|
|
2002
|
+
* - `target` {Element} the currentTarget of the event
|
|
2003
|
+
* - `node` {DOM} the react-tooltip object
|
|
2004
|
+
* - `place` {String} top / right / bottom / left
|
|
2005
|
+
* - `effect` {String} float / solid
|
|
2006
|
+
* - `offset` {Object} the offset to default position
|
|
2007
|
+
*
|
|
2008
|
+
* @return {Object}
|
|
2009
|
+
* - `isNewState` {Bool} required
|
|
2010
|
+
* - `newState` {Object}
|
|
2011
|
+
* - `position` {Object} {left: {Number}, top: {Number}}
|
|
2012
|
+
*/
|
|
2013
|
+
function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
2014
|
+
var _getDimensions = getDimensions(node),
|
|
2015
|
+
tipWidth = _getDimensions.width,
|
|
2016
|
+
tipHeight = _getDimensions.height;
|
|
2017
|
+
var _getDimensions2 = getDimensions(target),
|
|
2018
|
+
targetWidth = _getDimensions2.width,
|
|
2019
|
+
targetHeight = _getDimensions2.height;
|
|
2020
|
+
var _getCurrentOffset = getCurrentOffset(e, target, effect),
|
|
2021
|
+
mouseX = _getCurrentOffset.mouseX,
|
|
2022
|
+
mouseY = _getCurrentOffset.mouseY;
|
|
2023
|
+
var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
|
|
2024
|
+
var _calculateOffset = calculateOffset(offset),
|
|
2025
|
+
extraOffsetX = _calculateOffset.extraOffsetX,
|
|
2026
|
+
extraOffsetY = _calculateOffset.extraOffsetY;
|
|
2027
|
+
var windowWidth = window.innerWidth;
|
|
2028
|
+
var windowHeight = window.innerHeight;
|
|
2029
|
+
var _getParent = getParent(node),
|
|
2030
|
+
parentTop = _getParent.parentTop,
|
|
2031
|
+
parentLeft = _getParent.parentLeft;
|
|
2032
|
+
|
|
2033
|
+
// Get the edge offset of the tooltip
|
|
2034
|
+
var getTipOffsetLeft = function getTipOffsetLeft(place) {
|
|
2035
|
+
var offsetX = defaultOffset[place].l;
|
|
2036
|
+
return mouseX + offsetX + extraOffsetX;
|
|
2037
|
+
};
|
|
2038
|
+
var getTipOffsetRight = function getTipOffsetRight(place) {
|
|
2039
|
+
var offsetX = defaultOffset[place].r;
|
|
2040
|
+
return mouseX + offsetX + extraOffsetX;
|
|
2041
|
+
};
|
|
2042
|
+
var getTipOffsetTop = function getTipOffsetTop(place) {
|
|
2043
|
+
var offsetY = defaultOffset[place].t;
|
|
2044
|
+
return mouseY + offsetY + extraOffsetY;
|
|
2045
|
+
};
|
|
2046
|
+
var getTipOffsetBottom = function getTipOffsetBottom(place) {
|
|
2047
|
+
var offsetY = defaultOffset[place].b;
|
|
2048
|
+
return mouseY + offsetY + extraOffsetY;
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
//
|
|
2052
|
+
// Functions to test whether the tooltip's sides are inside
|
|
2053
|
+
// the client window for a given orientation p
|
|
2054
|
+
//
|
|
2055
|
+
// _____________
|
|
2056
|
+
// | | <-- Right side
|
|
2057
|
+
// | p = 'left' |\
|
|
2058
|
+
// | |/ |\
|
|
2059
|
+
// |_____________| |_\ <-- Mouse
|
|
2060
|
+
// / \ |
|
|
2061
|
+
// |
|
|
2062
|
+
// |
|
|
2063
|
+
// Bottom side
|
|
2064
|
+
//
|
|
2065
|
+
var outsideLeft = function outsideLeft(p) {
|
|
2066
|
+
return getTipOffsetLeft(p) < 0;
|
|
2067
|
+
};
|
|
2068
|
+
var outsideRight = function outsideRight(p) {
|
|
2069
|
+
return getTipOffsetRight(p) > windowWidth;
|
|
2070
|
+
};
|
|
2071
|
+
var outsideTop = function outsideTop(p) {
|
|
2072
|
+
return getTipOffsetTop(p) < 0;
|
|
2073
|
+
};
|
|
2074
|
+
var outsideBottom = function outsideBottom(p) {
|
|
2075
|
+
return getTipOffsetBottom(p) > windowHeight;
|
|
2076
|
+
};
|
|
2077
|
+
|
|
2078
|
+
// Check whether the tooltip with orientation p is completely inside the client window
|
|
2079
|
+
var outside = function outside(p) {
|
|
2080
|
+
return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
|
|
2081
|
+
};
|
|
2082
|
+
var inside = function inside(p) {
|
|
2083
|
+
return !outside(p);
|
|
2084
|
+
};
|
|
2085
|
+
var placeIsInside = {
|
|
2086
|
+
top: inside('top'),
|
|
2087
|
+
bottom: inside('bottom'),
|
|
2088
|
+
left: inside('left'),
|
|
2089
|
+
right: inside('right')
|
|
2090
|
+
};
|
|
2091
|
+
function choose() {
|
|
2092
|
+
var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
|
|
2093
|
+
var _iterator = _createForOfIteratorHelper(allPlaces),
|
|
2094
|
+
_step;
|
|
2095
|
+
try {
|
|
2096
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2097
|
+
var d = _step.value;
|
|
2098
|
+
if (placeIsInside[d]) return d;
|
|
2099
|
+
}
|
|
2100
|
+
// if nothing is inside, just use the old place.
|
|
2101
|
+
} catch (err) {
|
|
2102
|
+
_iterator.e(err);
|
|
2103
|
+
} finally {
|
|
2104
|
+
_iterator.f();
|
|
2105
|
+
}
|
|
2106
|
+
return place;
|
|
2107
|
+
}
|
|
2108
|
+
var chosen = choose();
|
|
2109
|
+
var isNewState = false;
|
|
2110
|
+
var newPlace;
|
|
2111
|
+
if (chosen && chosen !== place) {
|
|
2112
|
+
isNewState = true;
|
|
2113
|
+
newPlace = chosen;
|
|
2114
|
+
}
|
|
2115
|
+
if (isNewState) {
|
|
2116
|
+
return {
|
|
2117
|
+
isNewState: true,
|
|
2118
|
+
newState: {
|
|
2119
|
+
place: newPlace
|
|
2120
|
+
}
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
return {
|
|
2124
|
+
isNewState: false,
|
|
2125
|
+
position: {
|
|
2126
|
+
left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
|
|
2127
|
+
top: parseInt(getTipOffsetTop(place) - parentTop, 10)
|
|
2128
|
+
}
|
|
2129
|
+
};
|
|
2130
|
+
}
|
|
2131
|
+
var getDimensions = function getDimensions(node) {
|
|
2132
|
+
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
2133
|
+
height = _node$getBoundingClie.height,
|
|
2134
|
+
width = _node$getBoundingClie.width;
|
|
2135
|
+
return {
|
|
2136
|
+
height: parseInt(height, 10),
|
|
2137
|
+
width: parseInt(width, 10)
|
|
2138
|
+
};
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
// Get current mouse offset
|
|
2142
|
+
var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
|
|
2143
|
+
var boundingClientRect = currentTarget.getBoundingClientRect();
|
|
2144
|
+
var targetTop = boundingClientRect.top;
|
|
2145
|
+
var targetLeft = boundingClientRect.left;
|
|
2146
|
+
var _getDimensions3 = getDimensions(currentTarget),
|
|
2147
|
+
targetWidth = _getDimensions3.width,
|
|
2148
|
+
targetHeight = _getDimensions3.height;
|
|
2149
|
+
if (effect === 'float') {
|
|
2150
|
+
return {
|
|
2151
|
+
mouseX: e.clientX,
|
|
2152
|
+
mouseY: e.clientY
|
|
2153
|
+
};
|
|
2154
|
+
}
|
|
2155
|
+
return {
|
|
2156
|
+
mouseX: targetLeft + targetWidth / 2,
|
|
2157
|
+
mouseY: targetTop + targetHeight / 2
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
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
|
|
2163
|
+
var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
|
|
2164
|
+
var top;
|
|
2165
|
+
var right;
|
|
2166
|
+
var bottom;
|
|
2167
|
+
var left;
|
|
2168
|
+
var disToMouse = 3;
|
|
2169
|
+
var triangleHeight = 2;
|
|
2170
|
+
var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
|
|
2171
|
+
|
|
2172
|
+
if (effect === 'float') {
|
|
2173
|
+
top = {
|
|
2174
|
+
l: -(tipWidth / 2),
|
|
2175
|
+
r: tipWidth / 2,
|
|
2176
|
+
t: -(tipHeight + disToMouse + triangleHeight),
|
|
2177
|
+
b: -disToMouse
|
|
2178
|
+
};
|
|
2179
|
+
bottom = {
|
|
2180
|
+
l: -(tipWidth / 2),
|
|
2181
|
+
r: tipWidth / 2,
|
|
2182
|
+
t: disToMouse + cursorHeight,
|
|
2183
|
+
b: tipHeight + disToMouse + triangleHeight + cursorHeight
|
|
2184
|
+
};
|
|
2185
|
+
left = {
|
|
2186
|
+
l: -(tipWidth + disToMouse + triangleHeight),
|
|
2187
|
+
r: -disToMouse,
|
|
2188
|
+
t: -(tipHeight / 2),
|
|
2189
|
+
b: tipHeight / 2
|
|
2190
|
+
};
|
|
2191
|
+
right = {
|
|
2192
|
+
l: disToMouse,
|
|
2193
|
+
r: tipWidth + disToMouse + triangleHeight,
|
|
2194
|
+
t: -(tipHeight / 2),
|
|
2195
|
+
b: tipHeight / 2
|
|
2196
|
+
};
|
|
2197
|
+
} else if (effect === 'solid') {
|
|
2198
|
+
top = {
|
|
2199
|
+
l: -(tipWidth / 2),
|
|
2200
|
+
r: tipWidth / 2,
|
|
2201
|
+
t: -(targetHeight / 2 + tipHeight + triangleHeight),
|
|
2202
|
+
b: -(targetHeight / 2)
|
|
2203
|
+
};
|
|
2204
|
+
bottom = {
|
|
2205
|
+
l: -(tipWidth / 2),
|
|
2206
|
+
r: tipWidth / 2,
|
|
2207
|
+
t: targetHeight / 2,
|
|
2208
|
+
b: targetHeight / 2 + tipHeight + triangleHeight
|
|
2209
|
+
};
|
|
2210
|
+
left = {
|
|
2211
|
+
l: -(tipWidth + targetWidth / 2 + triangleHeight),
|
|
2212
|
+
r: -(targetWidth / 2),
|
|
2213
|
+
t: -(tipHeight / 2),
|
|
2214
|
+
b: tipHeight / 2
|
|
2215
|
+
};
|
|
2216
|
+
right = {
|
|
2217
|
+
l: targetWidth / 2,
|
|
2218
|
+
r: tipWidth + targetWidth / 2 + triangleHeight,
|
|
2219
|
+
t: -(tipHeight / 2),
|
|
2220
|
+
b: tipHeight / 2
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
return {
|
|
2224
|
+
top: top,
|
|
2225
|
+
bottom: bottom,
|
|
2226
|
+
left: left,
|
|
2227
|
+
right: right
|
|
2228
|
+
};
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
// Consider additional offset into position calculation
|
|
2232
|
+
var calculateOffset = function calculateOffset(offset) {
|
|
2233
|
+
var extraOffsetX = 0;
|
|
2234
|
+
var extraOffsetY = 0;
|
|
2235
|
+
if (Object.prototype.toString.apply(offset) === '[object String]') {
|
|
2236
|
+
offset = JSON.parse(offset.toString().replace(/'/g, '"'));
|
|
2237
|
+
}
|
|
2238
|
+
for (var key in offset) {
|
|
2239
|
+
if (key === 'top') {
|
|
2240
|
+
extraOffsetY -= parseInt(offset[key], 10);
|
|
2241
|
+
} else if (key === 'bottom') {
|
|
2242
|
+
extraOffsetY += parseInt(offset[key], 10);
|
|
2243
|
+
} else if (key === 'left') {
|
|
2244
|
+
extraOffsetX -= parseInt(offset[key], 10);
|
|
2245
|
+
} else if (key === 'right') {
|
|
2246
|
+
extraOffsetX += parseInt(offset[key], 10);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
return {
|
|
2250
|
+
extraOffsetX: extraOffsetX,
|
|
2251
|
+
extraOffsetY: extraOffsetY
|
|
2252
|
+
};
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
// Get the offset of the parent elements
|
|
2256
|
+
var getParent = function getParent(currentTarget) {
|
|
2257
|
+
var currentParent = currentTarget;
|
|
2258
|
+
while (currentParent) {
|
|
2259
|
+
var computedStyle = window.getComputedStyle(currentParent);
|
|
2260
|
+
// transform and will-change: transform change the containing block
|
|
2261
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
|
|
2262
|
+
if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
|
|
2263
|
+
currentParent = currentParent.parentElement;
|
|
2264
|
+
}
|
|
2265
|
+
var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
|
|
2266
|
+
var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
|
|
2267
|
+
return {
|
|
2268
|
+
parentTop: parentTop,
|
|
2269
|
+
parentLeft: parentLeft
|
|
2270
|
+
};
|
|
2271
|
+
};
|
|
2272
|
+
|
|
2273
|
+
/**
|
|
2274
|
+
* To get the tooltip content
|
|
2275
|
+
* it may comes from data-tip or this.props.children
|
|
2276
|
+
* it should support multiline
|
|
2277
|
+
*
|
|
2278
|
+
* @params
|
|
2279
|
+
* - `tip` {String} value of data-tip
|
|
2280
|
+
* - `children` {ReactElement} this.props.children
|
|
2281
|
+
* - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
|
|
2282
|
+
*
|
|
2283
|
+
* @return
|
|
2284
|
+
* - String or react component
|
|
2285
|
+
*/
|
|
2286
|
+
function TipContent(tip, children, getContent, multiline) {
|
|
2287
|
+
if (children) return children;
|
|
2288
|
+
if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
|
|
2289
|
+
if (getContent === null) return null; // Tip not exist and children is null or undefined
|
|
2290
|
+
|
|
2291
|
+
var regexp = /<br\s*\/?>/;
|
|
2292
|
+
if (!multiline || multiline === 'false' || !regexp.test(tip)) {
|
|
2293
|
+
// No trim(), so that user can keep their input
|
|
2294
|
+
return tip;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
// Multiline tooltip content
|
|
2298
|
+
return tip.split(regexp).map(function (d, i) {
|
|
2299
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
2300
|
+
key: i,
|
|
2301
|
+
className: "multi-line"
|
|
2302
|
+
}, d);
|
|
2303
|
+
});
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* Support aria- and role in ReactTooltip
|
|
2308
|
+
*
|
|
2309
|
+
* @params props {Object}
|
|
2310
|
+
* @return {Object}
|
|
2311
|
+
*/
|
|
2312
|
+
function parseAria(props) {
|
|
2313
|
+
var ariaObj = {};
|
|
2314
|
+
Object.keys(props).filter(function (prop) {
|
|
2315
|
+
// aria-xxx and role is acceptable
|
|
2316
|
+
return /(^aria-\w+$|^role$)/.test(prop);
|
|
2317
|
+
}).forEach(function (prop) {
|
|
2318
|
+
ariaObj[prop] = props[prop];
|
|
2319
|
+
});
|
|
2320
|
+
return ariaObj;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* Convert nodelist to array
|
|
2325
|
+
* @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
|
|
2326
|
+
* NodeLists are functions in Safari
|
|
2327
|
+
*/
|
|
2328
|
+
|
|
2329
|
+
function nodeListToArray (nodeList) {
|
|
2330
|
+
var length = nodeList.length;
|
|
2331
|
+
if (nodeList.hasOwnProperty) {
|
|
2332
|
+
return Array.prototype.slice.call(nodeList);
|
|
2333
|
+
}
|
|
2334
|
+
return new Array(length).fill().map(function (index) {
|
|
2335
|
+
return nodeList[index];
|
|
2336
|
+
});
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
function generateUUID() {
|
|
2340
|
+
return 't' + v4();
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: \"\";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* Default pop-up style values (text color, background color).
|
|
2347
|
+
*/
|
|
2348
|
+
var defaultColors = {
|
|
2349
|
+
dark: {
|
|
2350
|
+
text: '#fff',
|
|
2351
|
+
background: '#222',
|
|
2352
|
+
border: 'transparent',
|
|
2353
|
+
arrow: '#222'
|
|
2354
|
+
},
|
|
2355
|
+
success: {
|
|
2356
|
+
text: '#fff',
|
|
2357
|
+
background: '#8DC572',
|
|
2358
|
+
border: 'transparent',
|
|
2359
|
+
arrow: '#8DC572'
|
|
2360
|
+
},
|
|
2361
|
+
warning: {
|
|
2362
|
+
text: '#fff',
|
|
2363
|
+
background: '#F0AD4E',
|
|
2364
|
+
border: 'transparent',
|
|
2365
|
+
arrow: '#F0AD4E'
|
|
2366
|
+
},
|
|
2367
|
+
error: {
|
|
2368
|
+
text: '#fff',
|
|
2369
|
+
background: '#BE6464',
|
|
2370
|
+
border: 'transparent',
|
|
2371
|
+
arrow: '#BE6464'
|
|
2372
|
+
},
|
|
2373
|
+
info: {
|
|
2374
|
+
text: '#fff',
|
|
2375
|
+
background: '#337AB7',
|
|
2376
|
+
border: 'transparent',
|
|
2377
|
+
arrow: '#337AB7'
|
|
2378
|
+
},
|
|
2379
|
+
light: {
|
|
2380
|
+
text: '#222',
|
|
2381
|
+
background: '#fff',
|
|
2382
|
+
border: 'transparent',
|
|
2383
|
+
arrow: '#fff'
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
function getDefaultPopupColors(type) {
|
|
2387
|
+
return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
|
|
2388
|
+
}
|
|
2389
|
+
var DEFAULT_PADDING = '8px 21px';
|
|
2390
|
+
|
|
2391
|
+
/**
|
|
2392
|
+
* Generates the specific tooltip style for use on render.
|
|
2393
|
+
*/
|
|
2394
|
+
function generateTooltipStyle(uuid, customColors, type, hasBorder, padding) {
|
|
2395
|
+
return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding);
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
/**
|
|
2399
|
+
* Generates the tooltip style rules based on the element-specified "data-type" property.
|
|
2400
|
+
*/
|
|
2401
|
+
function generateStyle(uuid, colors) {
|
|
2402
|
+
var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
|
|
2403
|
+
var textColor = colors.text;
|
|
2404
|
+
var backgroundColor = colors.background;
|
|
2405
|
+
var borderColor = colors.border;
|
|
2406
|
+
var arrowColor = colors.arrow;
|
|
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 ");
|
|
2408
|
+
}
|
|
2409
|
+
function getPopupColors(customColors, type, hasBorder) {
|
|
2410
|
+
var textColor = customColors.text;
|
|
2411
|
+
var backgroundColor = customColors.background;
|
|
2412
|
+
var borderColor = customColors.border;
|
|
2413
|
+
var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
|
|
2414
|
+
var colors = getDefaultPopupColors(type);
|
|
2415
|
+
if (textColor) {
|
|
2416
|
+
colors.text = textColor;
|
|
1862
2417
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
2418
|
+
if (backgroundColor) {
|
|
2419
|
+
colors.background = backgroundColor;
|
|
2420
|
+
}
|
|
2421
|
+
if (hasBorder) {
|
|
2422
|
+
if (borderColor) {
|
|
2423
|
+
colors.border = borderColor;
|
|
2424
|
+
} else {
|
|
2425
|
+
colors.border = type === 'light' ? 'black' : 'white';
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
if (arrowColor) {
|
|
2429
|
+
colors.arrow = arrowColor;
|
|
2430
|
+
}
|
|
2431
|
+
return colors;
|
|
2432
|
+
}
|
|
1867
2433
|
|
|
1868
|
-
var _class, _class2
|
|
2434
|
+
var _class, _class2;
|
|
1869
2435
|
|
|
1870
|
-
|
|
1871
|
-
/*#__PURE__*/
|
|
1872
|
-
function (_React$Component) {
|
|
2436
|
+
/* Polyfill */
|
|
2437
|
+
var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
|
|
1873
2438
|
_inherits(ReactTooltip, _React$Component);
|
|
1874
|
-
|
|
1875
|
-
_createClass(ReactTooltip, null, [{
|
|
1876
|
-
key: "propTypes",
|
|
1877
|
-
get: function get() {
|
|
1878
|
-
return {
|
|
1879
|
-
uuid: PropTypes.string,
|
|
1880
|
-
children: PropTypes.any,
|
|
1881
|
-
place: PropTypes.string,
|
|
1882
|
-
type: PropTypes.string,
|
|
1883
|
-
effect: PropTypes.string,
|
|
1884
|
-
offset: PropTypes.object,
|
|
1885
|
-
multiline: PropTypes.bool,
|
|
1886
|
-
border: PropTypes.bool,
|
|
1887
|
-
textColor: PropTypes.string,
|
|
1888
|
-
backgroundColor: PropTypes.string,
|
|
1889
|
-
borderColor: PropTypes.string,
|
|
1890
|
-
arrowColor: PropTypes.string,
|
|
1891
|
-
insecure: PropTypes.bool,
|
|
1892
|
-
"class": PropTypes.string,
|
|
1893
|
-
className: PropTypes.string,
|
|
1894
|
-
id: PropTypes.string,
|
|
1895
|
-
html: PropTypes.bool,
|
|
1896
|
-
delayHide: PropTypes.number,
|
|
1897
|
-
delayUpdate: PropTypes.number,
|
|
1898
|
-
delayShow: PropTypes.number,
|
|
1899
|
-
event: PropTypes.string,
|
|
1900
|
-
eventOff: PropTypes.string,
|
|
1901
|
-
isCapture: PropTypes.bool,
|
|
1902
|
-
globalEventOff: PropTypes.string,
|
|
1903
|
-
getContent: PropTypes.any,
|
|
1904
|
-
afterShow: PropTypes.func,
|
|
1905
|
-
afterHide: PropTypes.func,
|
|
1906
|
-
overridePosition: PropTypes.func,
|
|
1907
|
-
disable: PropTypes.bool,
|
|
1908
|
-
scrollHide: PropTypes.bool,
|
|
1909
|
-
resizeHide: PropTypes.bool,
|
|
1910
|
-
wrapper: PropTypes.string,
|
|
1911
|
-
bodyMode: PropTypes.bool,
|
|
1912
|
-
possibleCustomEvents: PropTypes.string,
|
|
1913
|
-
possibleCustomEventsOff: PropTypes.string,
|
|
1914
|
-
clickable: PropTypes.bool
|
|
1915
|
-
};
|
|
1916
|
-
}
|
|
1917
|
-
}]);
|
|
1918
|
-
|
|
2439
|
+
var _super = _createSuper(ReactTooltip);
|
|
1919
2440
|
function ReactTooltip(props) {
|
|
1920
2441
|
var _this;
|
|
1921
|
-
|
|
1922
2442
|
_classCallCheck(this, ReactTooltip);
|
|
1923
|
-
|
|
1924
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));
|
|
2443
|
+
_this = _super.call(this, props);
|
|
1925
2444
|
_this.state = {
|
|
1926
2445
|
uuid: props.uuid || generateUUID(),
|
|
1927
2446
|
place: props.place || 'top',
|
|
1928
2447
|
// Direction of tooltip
|
|
1929
2448
|
desiredPlace: props.place || 'top',
|
|
1930
|
-
type: 'dark',
|
|
2449
|
+
type: props.type || 'dark',
|
|
1931
2450
|
// Color theme of tooltip
|
|
1932
|
-
effect: 'float',
|
|
2451
|
+
effect: props.effect || 'float',
|
|
1933
2452
|
// float or fixed
|
|
1934
2453
|
show: false,
|
|
1935
2454
|
border: false,
|
|
1936
2455
|
customColors: {},
|
|
1937
2456
|
offset: {},
|
|
2457
|
+
padding: props.padding,
|
|
1938
2458
|
extraClass: '',
|
|
1939
2459
|
html: false,
|
|
1940
2460
|
delayHide: 0,
|
|
@@ -1954,9 +2474,7 @@ function (_React$Component) {
|
|
|
1954
2474
|
originTooltip: null,
|
|
1955
2475
|
isMultiline: false
|
|
1956
2476
|
};
|
|
1957
|
-
|
|
1958
2477
|
_this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);
|
|
1959
|
-
|
|
1960
2478
|
_this.mount = true;
|
|
1961
2479
|
_this.delayShowLoop = null;
|
|
1962
2480
|
_this.delayHideLoop = null;
|
|
@@ -1964,16 +2482,14 @@ function (_React$Component) {
|
|
|
1964
2482
|
_this.intervalUpdateContent = null;
|
|
1965
2483
|
return _this;
|
|
1966
2484
|
}
|
|
2485
|
+
|
|
1967
2486
|
/**
|
|
1968
2487
|
* For unify the bind and unbind listener
|
|
1969
2488
|
*/
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
2489
|
_createClass(ReactTooltip, [{
|
|
1973
2490
|
key: "bind",
|
|
1974
2491
|
value: function bind(methodArray) {
|
|
1975
2492
|
var _this2 = this;
|
|
1976
|
-
|
|
1977
2493
|
methodArray.forEach(function (method) {
|
|
1978
2494
|
_this2[method] = _this2[method].bind(_this2);
|
|
1979
2495
|
});
|
|
@@ -1981,13 +2497,12 @@ function (_React$Component) {
|
|
|
1981
2497
|
}, {
|
|
1982
2498
|
key: "componentDidMount",
|
|
1983
2499
|
value: function componentDidMount() {
|
|
1984
|
-
var _this$props = this.props
|
|
1985
|
-
|
|
1986
|
-
|
|
2500
|
+
var _this$props = this.props;
|
|
2501
|
+
_this$props.insecure;
|
|
2502
|
+
var resizeHide = _this$props.resizeHide;
|
|
2503
|
+
this.mount = true;
|
|
1987
2504
|
this.bindListener(); // Bind listener for tooltip
|
|
1988
|
-
|
|
1989
2505
|
this.bindWindowEvents(resizeHide); // Bind global event for static method
|
|
1990
|
-
|
|
1991
2506
|
this.injectStyles(); // Inject styles for each DOM root having tooltip.
|
|
1992
2507
|
}
|
|
1993
2508
|
}, {
|
|
@@ -1999,39 +2514,33 @@ function (_React$Component) {
|
|
|
1999
2514
|
this.removeScrollListener(this.state.currentTarget);
|
|
2000
2515
|
this.unbindWindowEvents();
|
|
2001
2516
|
}
|
|
2002
|
-
/* Look for the closest DOM root having tooltip and inject styles. */
|
|
2003
2517
|
|
|
2518
|
+
/* Look for the closest DOM root having tooltip and inject styles. */
|
|
2004
2519
|
}, {
|
|
2005
2520
|
key: "injectStyles",
|
|
2006
2521
|
value: function injectStyles() {
|
|
2007
2522
|
var tooltipRef = this.tooltipRef;
|
|
2008
|
-
|
|
2009
2523
|
if (!tooltipRef) {
|
|
2010
2524
|
return;
|
|
2011
2525
|
}
|
|
2012
|
-
|
|
2013
2526
|
var parentNode = tooltipRef.parentNode;
|
|
2014
|
-
|
|
2015
2527
|
while (parentNode.parentNode) {
|
|
2016
2528
|
parentNode = parentNode.parentNode;
|
|
2017
2529
|
}
|
|
2018
|
-
|
|
2019
2530
|
var domRoot;
|
|
2020
|
-
|
|
2021
2531
|
switch (parentNode.constructor.name) {
|
|
2022
2532
|
case 'Document':
|
|
2023
2533
|
case 'HTMLDocument':
|
|
2024
2534
|
case undefined:
|
|
2025
2535
|
domRoot = parentNode.head;
|
|
2026
2536
|
break;
|
|
2027
|
-
|
|
2028
2537
|
case 'ShadowRoot':
|
|
2029
2538
|
default:
|
|
2030
2539
|
domRoot = parentNode;
|
|
2031
2540
|
break;
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2541
|
+
}
|
|
2034
2542
|
|
|
2543
|
+
// Prevent styles duplication.
|
|
2035
2544
|
if (!domRoot.querySelector('style[data-react-tooltip]')) {
|
|
2036
2545
|
var style = document.createElement('style');
|
|
2037
2546
|
style.textContent = baseCss;
|
|
@@ -2039,16 +2548,15 @@ function (_React$Component) {
|
|
|
2039
2548
|
domRoot.appendChild(style);
|
|
2040
2549
|
}
|
|
2041
2550
|
}
|
|
2551
|
+
|
|
2042
2552
|
/**
|
|
2043
2553
|
* Return if the mouse is on the tooltip.
|
|
2044
2554
|
* @returns {boolean} true - mouse is on the tooltip
|
|
2045
2555
|
*/
|
|
2046
|
-
|
|
2047
2556
|
}, {
|
|
2048
2557
|
key: "mouseOnToolTip",
|
|
2049
2558
|
value: function mouseOnToolTip() {
|
|
2050
2559
|
var show = this.state.show;
|
|
2051
|
-
|
|
2052
2560
|
if (show && this.tooltipRef) {
|
|
2053
2561
|
/* old IE or Firefox work around */
|
|
2054
2562
|
if (!this.tooltipRef.matches) {
|
|
@@ -2060,30 +2568,27 @@ function (_React$Component) {
|
|
|
2060
2568
|
this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
|
|
2061
2569
|
}
|
|
2062
2570
|
}
|
|
2063
|
-
|
|
2064
2571
|
return this.tooltipRef.matches(':hover');
|
|
2065
2572
|
}
|
|
2066
|
-
|
|
2067
2573
|
return false;
|
|
2068
2574
|
}
|
|
2575
|
+
|
|
2069
2576
|
/**
|
|
2070
2577
|
* Pick out corresponded target elements
|
|
2071
2578
|
*/
|
|
2072
|
-
|
|
2073
2579
|
}, {
|
|
2074
2580
|
key: "getTargetArray",
|
|
2075
2581
|
value: function getTargetArray(id) {
|
|
2076
2582
|
var targetArray = [];
|
|
2077
2583
|
var selector;
|
|
2078
|
-
|
|
2079
2584
|
if (!id) {
|
|
2080
2585
|
selector = '[data-tip]:not([data-for])';
|
|
2081
2586
|
} else {
|
|
2082
2587
|
var escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
2083
2588
|
selector = "[data-tip][data-for=\"".concat(escaped, "\"]");
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2589
|
+
}
|
|
2086
2590
|
|
|
2591
|
+
// Scan document for shadow DOM elements
|
|
2087
2592
|
nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {
|
|
2088
2593
|
return element.shadowRoot;
|
|
2089
2594
|
}).forEach(function (element) {
|
|
@@ -2091,101 +2596,87 @@ function (_React$Component) {
|
|
|
2091
2596
|
});
|
|
2092
2597
|
return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));
|
|
2093
2598
|
}
|
|
2599
|
+
|
|
2094
2600
|
/**
|
|
2095
2601
|
* Bind listener to the target elements
|
|
2096
2602
|
* These listeners used to trigger showing or hiding the tooltip
|
|
2097
2603
|
*/
|
|
2098
|
-
|
|
2099
2604
|
}, {
|
|
2100
2605
|
key: "bindListener",
|
|
2101
2606
|
value: function bindListener() {
|
|
2102
2607
|
var _this3 = this;
|
|
2103
|
-
|
|
2104
2608
|
var _this$props2 = this.props,
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2609
|
+
id = _this$props2.id,
|
|
2610
|
+
globalEventOff = _this$props2.globalEventOff,
|
|
2611
|
+
isCapture = _this$props2.isCapture;
|
|
2108
2612
|
var targetArray = this.getTargetArray(id);
|
|
2109
2613
|
targetArray.forEach(function (target) {
|
|
2110
2614
|
if (target.getAttribute('currentItem') === null) {
|
|
2111
2615
|
target.setAttribute('currentItem', 'false');
|
|
2112
2616
|
}
|
|
2113
|
-
|
|
2114
2617
|
_this3.unbindBasicListener(target);
|
|
2115
|
-
|
|
2116
2618
|
if (_this3.isCustomEvent(target)) {
|
|
2117
2619
|
_this3.customUnbindListener(target);
|
|
2118
2620
|
}
|
|
2119
2621
|
});
|
|
2120
|
-
|
|
2121
2622
|
if (this.isBodyMode()) {
|
|
2122
2623
|
this.bindBodyListener(targetArray);
|
|
2123
2624
|
} else {
|
|
2124
2625
|
targetArray.forEach(function (target) {
|
|
2125
2626
|
var isCaptureMode = _this3.isCapture(target);
|
|
2126
|
-
|
|
2127
2627
|
var effect = _this3.getEffect(target);
|
|
2128
|
-
|
|
2129
2628
|
if (_this3.isCustomEvent(target)) {
|
|
2130
2629
|
_this3.customBindListener(target);
|
|
2131
|
-
|
|
2132
2630
|
return;
|
|
2133
2631
|
}
|
|
2134
|
-
|
|
2135
2632
|
target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
|
|
2136
2633
|
target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
|
|
2137
|
-
|
|
2138
2634
|
if (effect === 'float') {
|
|
2139
2635
|
target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
|
|
2140
2636
|
}
|
|
2141
|
-
|
|
2142
2637
|
target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
|
|
2143
2638
|
target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
|
|
2144
2639
|
});
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2640
|
+
}
|
|
2147
2641
|
|
|
2642
|
+
// Global event to hide tooltip
|
|
2148
2643
|
if (globalEventOff) {
|
|
2149
2644
|
window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
2150
2645
|
window.addEventListener(globalEventOff, this.hideTooltip, isCapture);
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2646
|
+
}
|
|
2153
2647
|
|
|
2648
|
+
// Track removal of targetArray elements from DOM
|
|
2154
2649
|
this.bindRemovalTracker();
|
|
2155
2650
|
}
|
|
2651
|
+
|
|
2156
2652
|
/**
|
|
2157
2653
|
* Unbind listeners on target elements
|
|
2158
2654
|
*/
|
|
2159
|
-
|
|
2160
2655
|
}, {
|
|
2161
2656
|
key: "unbindListener",
|
|
2162
2657
|
value: function unbindListener() {
|
|
2163
2658
|
var _this4 = this;
|
|
2164
|
-
|
|
2165
2659
|
var _this$props3 = this.props,
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2660
|
+
id = _this$props3.id,
|
|
2661
|
+
globalEventOff = _this$props3.globalEventOff;
|
|
2169
2662
|
if (this.isBodyMode()) {
|
|
2170
2663
|
this.unbindBodyListener();
|
|
2171
2664
|
} else {
|
|
2172
2665
|
var targetArray = this.getTargetArray(id);
|
|
2173
2666
|
targetArray.forEach(function (target) {
|
|
2174
2667
|
_this4.unbindBasicListener(target);
|
|
2175
|
-
|
|
2176
2668
|
if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);
|
|
2177
2669
|
});
|
|
2178
2670
|
}
|
|
2179
|
-
|
|
2180
2671
|
if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
2181
2672
|
this.unbindRemovalTracker();
|
|
2182
2673
|
}
|
|
2674
|
+
|
|
2183
2675
|
/**
|
|
2184
2676
|
* Invoke this before bind listener and unmount the component
|
|
2185
2677
|
* it is necessary to invoke this even when binding custom event
|
|
2186
2678
|
* so that the tooltip can switch between custom and default listener
|
|
2187
2679
|
*/
|
|
2188
|
-
|
|
2189
2680
|
}, {
|
|
2190
2681
|
key: "unbindBasicListener",
|
|
2191
2682
|
value: function unbindBasicListener(target) {
|
|
@@ -2198,11 +2689,11 @@ function (_React$Component) {
|
|
|
2198
2689
|
key: "getTooltipContent",
|
|
2199
2690
|
value: function getTooltipContent() {
|
|
2200
2691
|
var _this$props4 = this.props,
|
|
2201
|
-
|
|
2202
|
-
|
|
2692
|
+
getContent = _this$props4.getContent,
|
|
2693
|
+
children = _this$props4.children;
|
|
2203
2694
|
|
|
2695
|
+
// Generate tooltip content
|
|
2204
2696
|
var content;
|
|
2205
|
-
|
|
2206
2697
|
if (getContent) {
|
|
2207
2698
|
if (Array.isArray(getContent)) {
|
|
2208
2699
|
content = getContent[0] && getContent[0](this.state.originTooltip);
|
|
@@ -2210,25 +2701,23 @@ function (_React$Component) {
|
|
|
2210
2701
|
content = getContent(this.state.originTooltip);
|
|
2211
2702
|
}
|
|
2212
2703
|
}
|
|
2213
|
-
|
|
2214
|
-
return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);
|
|
2704
|
+
return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
|
|
2215
2705
|
}
|
|
2216
2706
|
}, {
|
|
2217
2707
|
key: "isEmptyTip",
|
|
2218
2708
|
value: function isEmptyTip(placeholder) {
|
|
2219
2709
|
return typeof placeholder === 'string' && placeholder === '' || placeholder === null;
|
|
2220
2710
|
}
|
|
2711
|
+
|
|
2221
2712
|
/**
|
|
2222
2713
|
* When mouse enter, show the tooltip
|
|
2223
2714
|
*/
|
|
2224
|
-
|
|
2225
2715
|
}, {
|
|
2226
2716
|
key: "showTooltip",
|
|
2227
2717
|
value: function showTooltip(e, isGlobalCall) {
|
|
2228
2718
|
if (!this.tooltipRef) {
|
|
2229
2719
|
return;
|
|
2230
2720
|
}
|
|
2231
|
-
|
|
2232
2721
|
if (isGlobalCall) {
|
|
2233
2722
|
// Don't trigger other elements belongs to other ReactTooltip
|
|
2234
2723
|
var targetArray = this.getTargetArray(this.props.id);
|
|
@@ -2236,48 +2725,46 @@ function (_React$Component) {
|
|
|
2236
2725
|
return ele === e.currentTarget;
|
|
2237
2726
|
});
|
|
2238
2727
|
if (!isMyElement) return;
|
|
2239
|
-
}
|
|
2728
|
+
}
|
|
2729
|
+
// Get the tooltip content
|
|
2240
2730
|
// calculate in this phrase so that tip width height can be detected
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
2731
|
var _this$props5 = this.props,
|
|
2244
|
-
|
|
2245
|
-
|
|
2732
|
+
multiline = _this$props5.multiline,
|
|
2733
|
+
getContent = _this$props5.getContent;
|
|
2246
2734
|
var originTooltip = e.currentTarget.getAttribute('data-tip');
|
|
2247
|
-
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
|
|
2735
|
+
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
|
|
2248
2736
|
|
|
2249
|
-
|
|
2737
|
+
// If it is focus event or called by ReactTooltip.show, switch to `solid` effect
|
|
2738
|
+
var switchToSolid = e instanceof window.FocusEvent || isGlobalCall;
|
|
2250
2739
|
|
|
2740
|
+
// if it needs to skip adding hide listener to scroll
|
|
2251
2741
|
var scrollHide = true;
|
|
2252
|
-
|
|
2253
2742
|
if (e.currentTarget.getAttribute('data-scroll-hide')) {
|
|
2254
2743
|
scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
|
|
2255
2744
|
} else if (this.props.scrollHide != null) {
|
|
2256
2745
|
scrollHide = this.props.scrollHide;
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2746
|
+
}
|
|
2259
2747
|
|
|
2748
|
+
// adding aria-describedby to target to make tooltips read by screen readers
|
|
2260
2749
|
if (e && e.currentTarget && e.currentTarget.setAttribute) {
|
|
2261
|
-
e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2750
|
+
e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
|
|
2751
|
+
}
|
|
2264
2752
|
|
|
2753
|
+
// Make sure the correct place is set
|
|
2265
2754
|
var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
|
|
2266
2755
|
var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
|
|
2267
2756
|
var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
|
|
2268
|
-
var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
|
|
2269
|
-
|
|
2757
|
+
var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
|
|
2270
2758
|
if (result.position && this.props.overridePosition) {
|
|
2271
2759
|
result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
|
|
2272
2760
|
}
|
|
2761
|
+
var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0];
|
|
2273
2762
|
|
|
2274
|
-
|
|
2275
|
-
|
|
2763
|
+
// To prevent previously created timers from triggering
|
|
2276
2764
|
this.clearTimer();
|
|
2277
2765
|
var target = e.currentTarget;
|
|
2278
2766
|
var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;
|
|
2279
2767
|
var self = this;
|
|
2280
|
-
|
|
2281
2768
|
var updateState = function updateState() {
|
|
2282
2769
|
self.setState({
|
|
2283
2770
|
originTooltip: originTooltip,
|
|
@@ -2293,6 +2780,7 @@ function (_React$Component) {
|
|
|
2293
2780
|
},
|
|
2294
2781
|
effect: effect,
|
|
2295
2782
|
offset: offset,
|
|
2783
|
+
padding: target.getAttribute('data-padding') || self.props.padding,
|
|
2296
2784
|
html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
|
|
2297
2785
|
delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
|
|
2298
2786
|
delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
|
|
@@ -2305,14 +2793,12 @@ function (_React$Component) {
|
|
|
2305
2793
|
if (scrollHide) {
|
|
2306
2794
|
self.addScrollListener(self.state.currentTarget);
|
|
2307
2795
|
}
|
|
2308
|
-
|
|
2309
2796
|
self.updateTooltip(e);
|
|
2310
|
-
|
|
2311
2797
|
if (getContent && Array.isArray(getContent)) {
|
|
2312
2798
|
self.intervalUpdateContent = setInterval(function () {
|
|
2313
2799
|
if (self.mount) {
|
|
2314
2800
|
var _getContent = self.props.getContent;
|
|
2315
|
-
var placeholder =
|
|
2801
|
+
var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
|
|
2316
2802
|
var isEmptyTip = self.isEmptyTip(placeholder);
|
|
2317
2803
|
self.setState({
|
|
2318
2804
|
isEmptyTip: isEmptyTip
|
|
@@ -2322,77 +2808,76 @@ function (_React$Component) {
|
|
|
2322
2808
|
}, getContent[1]);
|
|
2323
2809
|
}
|
|
2324
2810
|
});
|
|
2325
|
-
};
|
|
2326
|
-
|
|
2811
|
+
};
|
|
2327
2812
|
|
|
2813
|
+
// If there is no delay call immediately, don't allow events to get in first.
|
|
2328
2814
|
if (reshowDelay) {
|
|
2329
2815
|
this.delayReshow = setTimeout(updateState, reshowDelay);
|
|
2330
2816
|
} else {
|
|
2331
2817
|
updateState();
|
|
2332
2818
|
}
|
|
2333
2819
|
}
|
|
2820
|
+
|
|
2334
2821
|
/**
|
|
2335
2822
|
* When mouse hover, update tool tip
|
|
2336
2823
|
*/
|
|
2337
|
-
|
|
2338
2824
|
}, {
|
|
2339
2825
|
key: "updateTooltip",
|
|
2340
2826
|
value: function updateTooltip(e) {
|
|
2341
2827
|
var _this5 = this;
|
|
2342
|
-
|
|
2343
2828
|
var _this$state = this.state,
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
var
|
|
2829
|
+
delayShow = _this$state.delayShow,
|
|
2830
|
+
disable = _this$state.disable;
|
|
2831
|
+
var _this$props6 = this.props,
|
|
2832
|
+
afterShow = _this$props6.afterShow,
|
|
2833
|
+
disableProp = _this$props6.disable;
|
|
2347
2834
|
var placeholder = this.getTooltipContent();
|
|
2348
|
-
var eventTarget = e.currentTarget || e.target;
|
|
2835
|
+
var eventTarget = e.currentTarget || e.target;
|
|
2349
2836
|
|
|
2837
|
+
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
2350
2838
|
if (this.mouseOnToolTip()) {
|
|
2351
2839
|
return;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2840
|
+
}
|
|
2354
2841
|
|
|
2355
|
-
if
|
|
2842
|
+
// if the tooltip is empty, disable the tooltip
|
|
2843
|
+
if (this.isEmptyTip(placeholder) || disable || disableProp) {
|
|
2356
2844
|
return;
|
|
2357
2845
|
}
|
|
2358
|
-
|
|
2359
2846
|
var delayTime = !this.state.show ? parseInt(delayShow, 10) : 0;
|
|
2360
|
-
|
|
2361
2847
|
var updateState = function updateState() {
|
|
2362
2848
|
if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {
|
|
2363
2849
|
var isInvisible = !_this5.state.show;
|
|
2364
|
-
|
|
2365
2850
|
_this5.setState({
|
|
2366
2851
|
currentEvent: e,
|
|
2367
2852
|
currentTarget: eventTarget,
|
|
2368
2853
|
show: true
|
|
2369
2854
|
}, function () {
|
|
2370
|
-
_this5.updatePosition()
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
}
|
|
2855
|
+
_this5.updatePosition(function () {
|
|
2856
|
+
if (isInvisible && afterShow) {
|
|
2857
|
+
afterShow(e);
|
|
2858
|
+
}
|
|
2859
|
+
});
|
|
2375
2860
|
});
|
|
2376
2861
|
}
|
|
2377
2862
|
};
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2863
|
+
if (this.delayShowLoop) {
|
|
2864
|
+
clearTimeout(this.delayShowLoop);
|
|
2865
|
+
}
|
|
2381
2866
|
if (delayTime) {
|
|
2382
2867
|
this.delayShowLoop = setTimeout(updateState, delayTime);
|
|
2383
2868
|
} else {
|
|
2869
|
+
this.delayShowLoop = null;
|
|
2384
2870
|
updateState();
|
|
2385
2871
|
}
|
|
2386
2872
|
}
|
|
2873
|
+
|
|
2387
2874
|
/*
|
|
2388
2875
|
* If we're mousing over the tooltip remove it when we leave.
|
|
2389
2876
|
*/
|
|
2390
|
-
|
|
2391
2877
|
}, {
|
|
2392
2878
|
key: "listenForTooltipExit",
|
|
2393
2879
|
value: function listenForTooltipExit() {
|
|
2394
2880
|
var show = this.state.show;
|
|
2395
|
-
|
|
2396
2881
|
if (show && this.tooltipRef) {
|
|
2397
2882
|
this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);
|
|
2398
2883
|
}
|
|
@@ -2401,31 +2886,30 @@ function (_React$Component) {
|
|
|
2401
2886
|
key: "removeListenerForTooltipExit",
|
|
2402
2887
|
value: function removeListenerForTooltipExit() {
|
|
2403
2888
|
var show = this.state.show;
|
|
2404
|
-
|
|
2405
2889
|
if (show && this.tooltipRef) {
|
|
2406
2890
|
this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);
|
|
2407
2891
|
}
|
|
2408
2892
|
}
|
|
2893
|
+
|
|
2409
2894
|
/**
|
|
2410
2895
|
* When mouse leave, hide tooltip
|
|
2411
2896
|
*/
|
|
2412
|
-
|
|
2413
2897
|
}, {
|
|
2414
2898
|
key: "hideTooltip",
|
|
2415
2899
|
value: function hideTooltip(e, hasTarget) {
|
|
2416
2900
|
var _this6 = this;
|
|
2417
|
-
|
|
2418
2901
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
2419
2902
|
isScroll: false
|
|
2420
2903
|
};
|
|
2421
2904
|
var disable = this.state.disable;
|
|
2422
2905
|
var isScroll = options.isScroll;
|
|
2423
2906
|
var delayHide = isScroll ? 0 : this.state.delayHide;
|
|
2424
|
-
var
|
|
2907
|
+
var _this$props7 = this.props,
|
|
2908
|
+
afterHide = _this$props7.afterHide,
|
|
2909
|
+
disableProp = _this$props7.disable;
|
|
2425
2910
|
var placeholder = this.getTooltipContent();
|
|
2426
2911
|
if (!this.mount) return;
|
|
2427
|
-
if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip
|
|
2428
|
-
|
|
2912
|
+
if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
|
|
2429
2913
|
if (hasTarget) {
|
|
2430
2914
|
// Don't trigger other elements belongs to other ReactTooltip
|
|
2431
2915
|
var targetArray = this.getTargetArray(this.props.id);
|
|
@@ -2433,47 +2917,40 @@ function (_React$Component) {
|
|
|
2433
2917
|
return ele === e.currentTarget;
|
|
2434
2918
|
});
|
|
2435
2919
|
if (!isMyElement || !this.state.show) return;
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2920
|
+
}
|
|
2438
2921
|
|
|
2922
|
+
// clean up aria-describedby when hiding tooltip
|
|
2439
2923
|
if (e && e.currentTarget && e.currentTarget.removeAttribute) {
|
|
2440
2924
|
e.currentTarget.removeAttribute('aria-describedby');
|
|
2441
2925
|
}
|
|
2442
|
-
|
|
2443
2926
|
var resetState = function resetState() {
|
|
2444
|
-
var isVisible = _this6.state.show;
|
|
2445
|
-
|
|
2927
|
+
var isVisible = _this6.state.show;
|
|
2928
|
+
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
2446
2929
|
if (_this6.mouseOnToolTip()) {
|
|
2447
2930
|
_this6.listenForTooltipExit();
|
|
2448
|
-
|
|
2449
2931
|
return;
|
|
2450
2932
|
}
|
|
2451
|
-
|
|
2452
2933
|
_this6.removeListenerForTooltipExit();
|
|
2453
|
-
|
|
2454
2934
|
_this6.setState({
|
|
2455
2935
|
show: false
|
|
2456
2936
|
}, function () {
|
|
2457
2937
|
_this6.removeScrollListener(_this6.state.currentTarget);
|
|
2458
|
-
|
|
2459
2938
|
if (isVisible && afterHide) {
|
|
2460
2939
|
afterHide(e);
|
|
2461
2940
|
}
|
|
2462
2941
|
});
|
|
2463
2942
|
};
|
|
2464
|
-
|
|
2465
2943
|
this.clearTimer();
|
|
2466
|
-
|
|
2467
2944
|
if (delayHide) {
|
|
2468
2945
|
this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));
|
|
2469
2946
|
} else {
|
|
2470
2947
|
resetState();
|
|
2471
2948
|
}
|
|
2472
2949
|
}
|
|
2950
|
+
|
|
2473
2951
|
/**
|
|
2474
2952
|
* When scroll, hide tooltip
|
|
2475
2953
|
*/
|
|
2476
|
-
|
|
2477
2954
|
}, {
|
|
2478
2955
|
key: "hideTooltipOnScroll",
|
|
2479
2956
|
value: function hideTooltipOnScroll(event, hasTarget) {
|
|
@@ -2481,11 +2958,11 @@ function (_React$Component) {
|
|
|
2481
2958
|
isScroll: true
|
|
2482
2959
|
});
|
|
2483
2960
|
}
|
|
2961
|
+
|
|
2484
2962
|
/**
|
|
2485
2963
|
* Add scroll event listener when tooltip show
|
|
2486
2964
|
* automatically hide the tooltip when scrolling
|
|
2487
2965
|
*/
|
|
2488
|
-
|
|
2489
2966
|
}, {
|
|
2490
2967
|
key: "addScrollListener",
|
|
2491
2968
|
value: function addScrollListener(currentTarget) {
|
|
@@ -2497,55 +2974,67 @@ function (_React$Component) {
|
|
|
2497
2974
|
value: function removeScrollListener(currentTarget) {
|
|
2498
2975
|
var isCaptureMode = this.isCapture(currentTarget);
|
|
2499
2976
|
window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
|
|
2500
|
-
}
|
|
2977
|
+
}
|
|
2501
2978
|
|
|
2979
|
+
// Calculation the position
|
|
2502
2980
|
}, {
|
|
2503
2981
|
key: "updatePosition",
|
|
2504
|
-
value: function updatePosition() {
|
|
2982
|
+
value: function updatePosition(callbackAfter) {
|
|
2505
2983
|
var _this7 = this;
|
|
2506
|
-
|
|
2507
2984
|
var _this$state2 = this.state,
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
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;
|
|
2514
2991
|
var node = this.tooltipRef;
|
|
2515
2992
|
var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
2516
|
-
|
|
2517
2993
|
if (result.position && this.props.overridePosition) {
|
|
2518
2994
|
result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
2519
2995
|
}
|
|
2520
|
-
|
|
2521
2996
|
if (result.isNewState) {
|
|
2522
2997
|
// Switch to reverse placement
|
|
2523
2998
|
return this.setState(result.newState, function () {
|
|
2524
|
-
_this7.updatePosition();
|
|
2999
|
+
_this7.updatePosition(callbackAfter);
|
|
2525
3000
|
});
|
|
2526
|
-
}
|
|
2527
|
-
|
|
3001
|
+
}
|
|
3002
|
+
if (callbackAfter && typeof callbackAfter === 'function') {
|
|
3003
|
+
callbackAfter();
|
|
3004
|
+
}
|
|
2528
3005
|
|
|
3006
|
+
// Set tooltip position
|
|
2529
3007
|
node.style.left = result.position.left + 'px';
|
|
2530
3008
|
node.style.top = result.position.top + 'px';
|
|
2531
3009
|
}
|
|
3010
|
+
|
|
2532
3011
|
/**
|
|
2533
3012
|
* CLear all kinds of timeout of interval
|
|
2534
3013
|
*/
|
|
2535
|
-
|
|
2536
3014
|
}, {
|
|
2537
3015
|
key: "clearTimer",
|
|
2538
3016
|
value: function clearTimer() {
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
3017
|
+
if (this.delayShowLoop) {
|
|
3018
|
+
clearTimeout(this.delayShowLoop);
|
|
3019
|
+
this.delayShowLoop = null;
|
|
3020
|
+
}
|
|
3021
|
+
if (this.delayHideLoop) {
|
|
3022
|
+
clearTimeout(this.delayHideLoop);
|
|
3023
|
+
this.delayHideLoop = null;
|
|
3024
|
+
}
|
|
3025
|
+
if (this.delayReshow) {
|
|
3026
|
+
clearTimeout(this.delayReshow);
|
|
3027
|
+
this.delayReshow = null;
|
|
3028
|
+
}
|
|
3029
|
+
if (this.intervalUpdateContent) {
|
|
3030
|
+
clearInterval(this.intervalUpdateContent);
|
|
3031
|
+
this.intervalUpdateContent = null;
|
|
3032
|
+
}
|
|
2543
3033
|
}
|
|
2544
3034
|
}, {
|
|
2545
3035
|
key: "hasCustomColors",
|
|
2546
3036
|
value: function hasCustomColors() {
|
|
2547
3037
|
var _this8 = this;
|
|
2548
|
-
|
|
2549
3038
|
return Boolean(Object.keys(this.state.customColors).find(function (color) {
|
|
2550
3039
|
return color !== 'border' && _this8.state.customColors[color];
|
|
2551
3040
|
}) || this.state.border && this.state.customColors['border']);
|
|
@@ -2554,30 +3043,27 @@ function (_React$Component) {
|
|
|
2554
3043
|
key: "render",
|
|
2555
3044
|
value: function render() {
|
|
2556
3045
|
var _this9 = this;
|
|
2557
|
-
|
|
2558
3046
|
var _this$state3 = this.state,
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
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;
|
|
2564
3052
|
var content = this.getTooltipContent();
|
|
2565
3053
|
var isEmptyTip = this.isEmptyTip(content);
|
|
2566
|
-
var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);
|
|
3054
|
+
var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding);
|
|
2567
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
|
|
2568
|
-
" type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
|
|
3056
|
+
" type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
|
|
3057
|
+
// dark, success, warning, error, info, light, custom
|
|
2569
3058
|
this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
|
|
2570
3059
|
var Wrapper = this.props.wrapper;
|
|
2571
|
-
|
|
2572
3060
|
if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {
|
|
2573
3061
|
Wrapper = ReactTooltip.defaultProps.wrapper;
|
|
2574
3062
|
}
|
|
2575
|
-
|
|
2576
3063
|
var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
|
|
2577
|
-
|
|
2578
3064
|
if (html) {
|
|
2579
3065
|
var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
|
|
2580
|
-
return React.createElement(Wrapper, _extends({
|
|
3066
|
+
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
2581
3067
|
className: "".concat(wrapperClassName),
|
|
2582
3068
|
id: this.props.id || uuid,
|
|
2583
3069
|
ref: function ref(_ref) {
|
|
@@ -2590,7 +3076,7 @@ function (_React$Component) {
|
|
|
2590
3076
|
}
|
|
2591
3077
|
}));
|
|
2592
3078
|
} else {
|
|
2593
|
-
return React.createElement(Wrapper, _extends({
|
|
3079
|
+
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
2594
3080
|
className: "".concat(wrapperClassName),
|
|
2595
3081
|
id: this.props.id || uuid
|
|
2596
3082
|
}, ariaProps, {
|
|
@@ -2598,7 +3084,7 @@ function (_React$Component) {
|
|
|
2598
3084
|
return _this9.tooltipRef = _ref2;
|
|
2599
3085
|
},
|
|
2600
3086
|
"data-id": "tooltip"
|
|
2601
|
-
}), React.createElement("style", {
|
|
3087
|
+
}), /*#__PURE__*/React.createElement("style", {
|
|
2602
3088
|
dangerouslySetInnerHTML: {
|
|
2603
3089
|
__html: style
|
|
2604
3090
|
},
|
|
@@ -2607,6 +3093,49 @@ function (_React$Component) {
|
|
|
2607
3093
|
}
|
|
2608
3094
|
}
|
|
2609
3095
|
}], [{
|
|
3096
|
+
key: "propTypes",
|
|
3097
|
+
get: function get() {
|
|
3098
|
+
return {
|
|
3099
|
+
uuid: PropTypes.string,
|
|
3100
|
+
children: PropTypes.any,
|
|
3101
|
+
place: PropTypes.string,
|
|
3102
|
+
type: PropTypes.string,
|
|
3103
|
+
effect: PropTypes.string,
|
|
3104
|
+
offset: PropTypes.object,
|
|
3105
|
+
padding: PropTypes.string,
|
|
3106
|
+
multiline: PropTypes.bool,
|
|
3107
|
+
border: PropTypes.bool,
|
|
3108
|
+
textColor: PropTypes.string,
|
|
3109
|
+
backgroundColor: PropTypes.string,
|
|
3110
|
+
borderColor: PropTypes.string,
|
|
3111
|
+
arrowColor: PropTypes.string,
|
|
3112
|
+
insecure: PropTypes.bool,
|
|
3113
|
+
"class": PropTypes.string,
|
|
3114
|
+
className: PropTypes.string,
|
|
3115
|
+
id: PropTypes.string,
|
|
3116
|
+
html: PropTypes.bool,
|
|
3117
|
+
delayHide: PropTypes.number,
|
|
3118
|
+
delayUpdate: PropTypes.number,
|
|
3119
|
+
delayShow: PropTypes.number,
|
|
3120
|
+
event: PropTypes.string,
|
|
3121
|
+
eventOff: PropTypes.string,
|
|
3122
|
+
isCapture: PropTypes.bool,
|
|
3123
|
+
globalEventOff: PropTypes.string,
|
|
3124
|
+
getContent: PropTypes.any,
|
|
3125
|
+
afterShow: PropTypes.func,
|
|
3126
|
+
afterHide: PropTypes.func,
|
|
3127
|
+
overridePosition: PropTypes.func,
|
|
3128
|
+
disable: PropTypes.bool,
|
|
3129
|
+
scrollHide: PropTypes.bool,
|
|
3130
|
+
resizeHide: PropTypes.bool,
|
|
3131
|
+
wrapper: PropTypes.string,
|
|
3132
|
+
bodyMode: PropTypes.bool,
|
|
3133
|
+
possibleCustomEvents: PropTypes.string,
|
|
3134
|
+
possibleCustomEventsOff: PropTypes.string,
|
|
3135
|
+
clickable: PropTypes.bool
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
}, {
|
|
2610
3139
|
key: "getDerivedStateFromProps",
|
|
2611
3140
|
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
2612
3141
|
var ariaProps = prevState.ariaProps;
|
|
@@ -2614,24 +3143,21 @@ function (_React$Component) {
|
|
|
2614
3143
|
var isChanged = Object.keys(newAriaProps).some(function (props) {
|
|
2615
3144
|
return newAriaProps[props] !== ariaProps[props];
|
|
2616
3145
|
});
|
|
2617
|
-
|
|
2618
3146
|
if (!isChanged) {
|
|
2619
3147
|
return null;
|
|
2620
3148
|
}
|
|
2621
|
-
|
|
2622
|
-
return _objectSpread2({}, prevState, {
|
|
3149
|
+
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
2623
3150
|
ariaProps: newAriaProps
|
|
2624
3151
|
});
|
|
2625
3152
|
}
|
|
2626
3153
|
}]);
|
|
2627
|
-
|
|
2628
3154
|
return ReactTooltip;
|
|
2629
3155
|
}(React.Component), _defineProperty(_class2, "defaultProps", {
|
|
2630
3156
|
insecure: true,
|
|
2631
3157
|
resizeHide: true,
|
|
2632
3158
|
wrapper: 'div',
|
|
2633
3159
|
clickable: false
|
|
2634
|
-
}), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'),
|
|
3160
|
+
}), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
|
|
2635
3161
|
|
|
2636
|
-
export default
|
|
3162
|
+
export { ReactTooltip as default };
|
|
2637
3163
|
//# sourceMappingURL=index.es.js.map
|