react-tooltip 4.2.17 → 4.2.21
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/CHANGELOG.md +28 -0
- package/dist/index.es.js +868 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +868 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1017,6 +1017,854 @@ function getPopupColors(customColors, type, hasBorder) {
|
|
|
1017
1017
|
return colors;
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1021
|
+
|
|
1022
|
+
function createCommonjsModule(fn, module) {
|
|
1023
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
var check = function (it) {
|
|
1027
|
+
return it && it.Math == Math && it;
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
1031
|
+
var global_1 =
|
|
1032
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
1033
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
1034
|
+
check(typeof window == 'object' && window) ||
|
|
1035
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
1036
|
+
check(typeof self == 'object' && self) ||
|
|
1037
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
1038
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
1039
|
+
(function () { return this; })() || Function('return this')();
|
|
1040
|
+
|
|
1041
|
+
var fails = function (exec) {
|
|
1042
|
+
try {
|
|
1043
|
+
return !!exec();
|
|
1044
|
+
} catch (error) {
|
|
1045
|
+
return true;
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
1050
|
+
var descriptors = !fails(function () {
|
|
1051
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1052
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
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
|
+
};
|
|
1072
|
+
|
|
1073
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
1074
|
+
return {
|
|
1075
|
+
enumerable: !(bitmap & 1),
|
|
1076
|
+
configurable: !(bitmap & 2),
|
|
1077
|
+
writable: !(bitmap & 4),
|
|
1078
|
+
value: value
|
|
1079
|
+
};
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
var toString = {}.toString;
|
|
1083
|
+
|
|
1084
|
+
var classofRaw = function (it) {
|
|
1085
|
+
return toString.call(it).slice(8, -1);
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1088
|
+
var split = ''.split;
|
|
1089
|
+
|
|
1090
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
1091
|
+
var indexedObject = fails(function () {
|
|
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;
|
|
1098
|
+
|
|
1099
|
+
// `RequireObjectCoercible` abstract operation
|
|
1100
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
1101
|
+
var requireObjectCoercible = function (it) {
|
|
1102
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
1103
|
+
return it;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
var toIndexedObject = function (it) {
|
|
1111
|
+
return indexedObject(requireObjectCoercible(it));
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
var isObject = function (it) {
|
|
1115
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
// `ToPrimitive` abstract operation
|
|
1119
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
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
|
+
};
|
|
1130
|
+
|
|
1131
|
+
// `ToObject` abstract operation
|
|
1132
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
1133
|
+
var toObject = function (argument) {
|
|
1134
|
+
return Object(requireObjectCoercible(argument));
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
1138
|
+
|
|
1139
|
+
var has = function hasOwn(it, key) {
|
|
1140
|
+
return hasOwnProperty.call(toObject(it), key);
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
var document$1 = global_1.document;
|
|
1144
|
+
// typeof document.createElement is 'object' in old IE
|
|
1145
|
+
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
|
1146
|
+
|
|
1147
|
+
var documentCreateElement = function (it) {
|
|
1148
|
+
return EXISTS ? document$1.createElement(it) : {};
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// Thank's IE8 for his funny defineProperty
|
|
1152
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
1153
|
+
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
|
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
|
+
};
|
|
1397
|
+
|
|
1398
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
1399
|
+
var createMethod = function (IS_INCLUDES) {
|
|
1400
|
+
return function ($this, el, fromIndex) {
|
|
1401
|
+
var O = toIndexedObject($this);
|
|
1402
|
+
var length = toLength(O.length);
|
|
1403
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
1404
|
+
var value;
|
|
1405
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
1406
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1407
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
1408
|
+
value = O[index++];
|
|
1409
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1410
|
+
if (value != value) return true;
|
|
1411
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
1412
|
+
} else for (;length > index; index++) {
|
|
1413
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
1414
|
+
} return !IS_INCLUDES && -1;
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
var arrayIncludes = {
|
|
1419
|
+
// `Array.prototype.includes` method
|
|
1420
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
1421
|
+
includes: createMethod(true),
|
|
1422
|
+
// `Array.prototype.indexOf` method
|
|
1423
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
1424
|
+
indexOf: createMethod(false)
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
var indexOf = arrayIncludes.indexOf;
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
var objectKeysInternal = function (object, names) {
|
|
1431
|
+
var O = toIndexedObject(object);
|
|
1432
|
+
var i = 0;
|
|
1433
|
+
var result = [];
|
|
1434
|
+
var key;
|
|
1435
|
+
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
|
1436
|
+
// Don't enum bug & hidden keys
|
|
1437
|
+
while (names.length > i) if (has(O, key = names[i++])) {
|
|
1438
|
+
~indexOf(result, key) || result.push(key);
|
|
1439
|
+
}
|
|
1440
|
+
return result;
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
// IE8- don't enum bug keys
|
|
1444
|
+
var enumBugKeys = [
|
|
1445
|
+
'constructor',
|
|
1446
|
+
'hasOwnProperty',
|
|
1447
|
+
'isPrototypeOf',
|
|
1448
|
+
'propertyIsEnumerable',
|
|
1449
|
+
'toLocaleString',
|
|
1450
|
+
'toString',
|
|
1451
|
+
'valueOf'
|
|
1452
|
+
];
|
|
1453
|
+
|
|
1454
|
+
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
1455
|
+
|
|
1456
|
+
// `Object.getOwnPropertyNames` method
|
|
1457
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
1458
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
1459
|
+
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
1460
|
+
return objectKeysInternal(O, hiddenKeys$1);
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
var objectGetOwnPropertyNames = {
|
|
1464
|
+
f: f$3
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
1468
|
+
var f$4 = Object.getOwnPropertySymbols;
|
|
1469
|
+
|
|
1470
|
+
var objectGetOwnPropertySymbols = {
|
|
1471
|
+
f: f$4
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
// all object keys, includes non-enumerable and symbols
|
|
1475
|
+
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1476
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
1477
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
1478
|
+
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
var copyConstructorProperties = function (target, source) {
|
|
1482
|
+
var keys = ownKeys$1(source);
|
|
1483
|
+
var defineProperty = objectDefineProperty.f;
|
|
1484
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1485
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1486
|
+
var key = keys[i];
|
|
1487
|
+
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1491
|
+
var replacement = /#|\.prototype\./;
|
|
1492
|
+
|
|
1493
|
+
var isForced = function (feature, detection) {
|
|
1494
|
+
var value = data[normalize(feature)];
|
|
1495
|
+
return value == POLYFILL ? true
|
|
1496
|
+
: value == NATIVE ? false
|
|
1497
|
+
: typeof detection == 'function' ? fails(detection)
|
|
1498
|
+
: !!detection;
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1501
|
+
var normalize = isForced.normalize = function (string) {
|
|
1502
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
1503
|
+
};
|
|
1504
|
+
|
|
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
|
+
|
|
1515
|
+
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
/*
|
|
1519
|
+
options.target - name of the target object
|
|
1520
|
+
options.global - target is the global object
|
|
1521
|
+
options.stat - export as static methods of target
|
|
1522
|
+
options.proto - export as prototype methods of target
|
|
1523
|
+
options.real - real prototype method for the `pure` version
|
|
1524
|
+
options.forced - export even if the native feature is available
|
|
1525
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
1526
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
1527
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
1528
|
+
options.sham - add a flag to not completely full polyfills
|
|
1529
|
+
options.enumerable - export as enumerable property
|
|
1530
|
+
options.noTargetGet - prevent calling a getter on target
|
|
1531
|
+
*/
|
|
1532
|
+
var _export = function (options, source) {
|
|
1533
|
+
var TARGET = options.target;
|
|
1534
|
+
var GLOBAL = options.global;
|
|
1535
|
+
var STATIC = options.stat;
|
|
1536
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1537
|
+
if (GLOBAL) {
|
|
1538
|
+
target = global_1;
|
|
1539
|
+
} else if (STATIC) {
|
|
1540
|
+
target = global_1[TARGET] || setGlobal(TARGET, {});
|
|
1541
|
+
} else {
|
|
1542
|
+
target = (global_1[TARGET] || {}).prototype;
|
|
1543
|
+
}
|
|
1544
|
+
if (target) for (key in source) {
|
|
1545
|
+
sourceProperty = source[key];
|
|
1546
|
+
if (options.noTargetGet) {
|
|
1547
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
1548
|
+
targetProperty = descriptor && descriptor.value;
|
|
1549
|
+
} else targetProperty = target[key];
|
|
1550
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1551
|
+
// contained in target
|
|
1552
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
1553
|
+
if (typeof sourceProperty === typeof targetProperty) continue;
|
|
1554
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1555
|
+
}
|
|
1556
|
+
// add a flag to not completely full polyfills
|
|
1557
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1558
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
1559
|
+
}
|
|
1560
|
+
// extend global
|
|
1561
|
+
redefine(target, key, sourceProperty, options);
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
var aFunction$1 = function (it) {
|
|
1566
|
+
if (typeof it != 'function') {
|
|
1567
|
+
throw TypeError(String(it) + ' is not a function');
|
|
1568
|
+
} return it;
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
// optional / simple context binding
|
|
1572
|
+
var functionBindContext = function (fn, that, length) {
|
|
1573
|
+
aFunction$1(fn);
|
|
1574
|
+
if (that === undefined) return fn;
|
|
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 */) {
|
|
1590
|
+
return fn.apply(that, arguments);
|
|
1591
|
+
};
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
// `IsArray` abstract operation
|
|
1595
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
1596
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
1597
|
+
var isArray = Array.isArray || function isArray(arg) {
|
|
1598
|
+
return classofRaw(arg) == 'Array';
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1601
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
1602
|
+
|
|
1603
|
+
var process = global_1.process;
|
|
1604
|
+
var versions = process && process.versions;
|
|
1605
|
+
var v8 = versions && versions.v8;
|
|
1606
|
+
var match, version;
|
|
1607
|
+
|
|
1608
|
+
if (v8) {
|
|
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
|
+
}
|
|
1618
|
+
|
|
1619
|
+
var engineV8Version = version && +version;
|
|
1620
|
+
|
|
1621
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
1626
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
1627
|
+
return !String(Symbol()) ||
|
|
1628
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
1629
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
1630
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
1631
|
+
});
|
|
1632
|
+
|
|
1633
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
var useSymbolAsUid = nativeSymbol
|
|
1637
|
+
&& !Symbol.sham
|
|
1638
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
1639
|
+
|
|
1640
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
1641
|
+
var Symbol$1 = global_1.Symbol;
|
|
1642
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
1643
|
+
|
|
1644
|
+
var wellKnownSymbol = function (name) {
|
|
1645
|
+
if (!has(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
1646
|
+
if (nativeSymbol && has(Symbol$1, name)) {
|
|
1647
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
1648
|
+
} else {
|
|
1649
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
|
1650
|
+
}
|
|
1651
|
+
} return WellKnownSymbolsStore[name];
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
var SPECIES = wellKnownSymbol('species');
|
|
1655
|
+
|
|
1656
|
+
// `ArraySpeciesCreate` abstract operation
|
|
1657
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1658
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
|
1659
|
+
var C;
|
|
1660
|
+
if (isArray(originalArray)) {
|
|
1661
|
+
C = originalArray.constructor;
|
|
1662
|
+
// cross-realm fallback
|
|
1663
|
+
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
|
1664
|
+
else if (isObject(C)) {
|
|
1665
|
+
C = C[SPECIES];
|
|
1666
|
+
if (C === null) C = undefined;
|
|
1667
|
+
}
|
|
1668
|
+
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
var push = [].push;
|
|
1672
|
+
|
|
1673
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
|
|
1674
|
+
var createMethod$1 = function (TYPE) {
|
|
1675
|
+
var IS_MAP = TYPE == 1;
|
|
1676
|
+
var IS_FILTER = TYPE == 2;
|
|
1677
|
+
var IS_SOME = TYPE == 3;
|
|
1678
|
+
var IS_EVERY = TYPE == 4;
|
|
1679
|
+
var IS_FIND_INDEX = TYPE == 6;
|
|
1680
|
+
var IS_FILTER_OUT = TYPE == 7;
|
|
1681
|
+
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
1682
|
+
return function ($this, callbackfn, that, specificCreate) {
|
|
1683
|
+
var O = toObject($this);
|
|
1684
|
+
var self = indexedObject(O);
|
|
1685
|
+
var boundFunction = functionBindContext(callbackfn, that, 3);
|
|
1686
|
+
var length = toLength(self.length);
|
|
1687
|
+
var index = 0;
|
|
1688
|
+
var create = specificCreate || arraySpeciesCreate;
|
|
1689
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
|
|
1690
|
+
var value, result;
|
|
1691
|
+
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
1692
|
+
value = self[index];
|
|
1693
|
+
result = boundFunction(value, index, O);
|
|
1694
|
+
if (TYPE) {
|
|
1695
|
+
if (IS_MAP) target[index] = result; // map
|
|
1696
|
+
else if (result) switch (TYPE) {
|
|
1697
|
+
case 3: return true; // some
|
|
1698
|
+
case 5: return value; // find
|
|
1699
|
+
case 6: return index; // findIndex
|
|
1700
|
+
case 2: push.call(target, value); // filter
|
|
1701
|
+
} else switch (TYPE) {
|
|
1702
|
+
case 4: return false; // every
|
|
1703
|
+
case 7: push.call(target, value); // filterOut
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
var arrayIteration = {
|
|
1712
|
+
// `Array.prototype.forEach` method
|
|
1713
|
+
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
1714
|
+
forEach: createMethod$1(0),
|
|
1715
|
+
// `Array.prototype.map` method
|
|
1716
|
+
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
1717
|
+
map: createMethod$1(1),
|
|
1718
|
+
// `Array.prototype.filter` method
|
|
1719
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
1720
|
+
filter: createMethod$1(2),
|
|
1721
|
+
// `Array.prototype.some` method
|
|
1722
|
+
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
1723
|
+
some: createMethod$1(3),
|
|
1724
|
+
// `Array.prototype.every` method
|
|
1725
|
+
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
1726
|
+
every: createMethod$1(4),
|
|
1727
|
+
// `Array.prototype.find` method
|
|
1728
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1729
|
+
find: createMethod$1(5),
|
|
1730
|
+
// `Array.prototype.findIndex` method
|
|
1731
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
1732
|
+
findIndex: createMethod$1(6),
|
|
1733
|
+
// `Array.prototype.filterOut` method
|
|
1734
|
+
// https://github.com/tc39/proposal-array-filtering
|
|
1735
|
+
filterOut: createMethod$1(7)
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1738
|
+
// `Object.keys` method
|
|
1739
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
1740
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1741
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
1742
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
1743
|
+
};
|
|
1744
|
+
|
|
1745
|
+
// `Object.defineProperties` method
|
|
1746
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1747
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1748
|
+
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1749
|
+
anObject(O);
|
|
1750
|
+
var keys = objectKeys(Properties);
|
|
1751
|
+
var length = keys.length;
|
|
1752
|
+
var index = 0;
|
|
1753
|
+
var key;
|
|
1754
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
|
1755
|
+
return O;
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
1759
|
+
|
|
1760
|
+
var GT = '>';
|
|
1761
|
+
var LT = '<';
|
|
1762
|
+
var PROTOTYPE = 'prototype';
|
|
1763
|
+
var SCRIPT = 'script';
|
|
1764
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1765
|
+
|
|
1766
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
1767
|
+
|
|
1768
|
+
var scriptTag = function (content) {
|
|
1769
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1770
|
+
};
|
|
1771
|
+
|
|
1772
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1773
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1774
|
+
activeXDocument.write(scriptTag(''));
|
|
1775
|
+
activeXDocument.close();
|
|
1776
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
1777
|
+
activeXDocument = null; // avoid memory leak
|
|
1778
|
+
return temp;
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1781
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1782
|
+
var NullProtoObjectViaIFrame = function () {
|
|
1783
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
1784
|
+
var iframe = documentCreateElement('iframe');
|
|
1785
|
+
var JS = 'java' + SCRIPT + ':';
|
|
1786
|
+
var iframeDocument;
|
|
1787
|
+
iframe.style.display = 'none';
|
|
1788
|
+
html.appendChild(iframe);
|
|
1789
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
1790
|
+
iframe.src = String(JS);
|
|
1791
|
+
iframeDocument = iframe.contentWindow.document;
|
|
1792
|
+
iframeDocument.open();
|
|
1793
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1794
|
+
iframeDocument.close();
|
|
1795
|
+
return iframeDocument.F;
|
|
1796
|
+
};
|
|
1797
|
+
|
|
1798
|
+
// Check for document.domain and active x support
|
|
1799
|
+
// No need to use active x approach when document.domain is not set
|
|
1800
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1801
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1802
|
+
// avoid IE GC bug
|
|
1803
|
+
var activeXDocument;
|
|
1804
|
+
var NullProtoObject = function () {
|
|
1805
|
+
try {
|
|
1806
|
+
/* global ActiveXObject -- old IE */
|
|
1807
|
+
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
|
1808
|
+
} catch (error) { /* ignore */ }
|
|
1809
|
+
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
|
1810
|
+
var length = enumBugKeys.length;
|
|
1811
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1812
|
+
return NullProtoObject();
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
hiddenKeys[IE_PROTO] = true;
|
|
1816
|
+
|
|
1817
|
+
// `Object.create` method
|
|
1818
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
1819
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
1820
|
+
var result;
|
|
1821
|
+
if (O !== null) {
|
|
1822
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
1823
|
+
result = new EmptyConstructor();
|
|
1824
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
1825
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1826
|
+
result[IE_PROTO] = O;
|
|
1827
|
+
} else result = NullProtoObject();
|
|
1828
|
+
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
1832
|
+
var ArrayPrototype = Array.prototype;
|
|
1833
|
+
|
|
1834
|
+
// Array.prototype[@@unscopables]
|
|
1835
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1836
|
+
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
1837
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
|
1838
|
+
configurable: true,
|
|
1839
|
+
value: objectCreate(null)
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// add a key to Array.prototype[@@unscopables]
|
|
1844
|
+
var addToUnscopables = function (key) {
|
|
1845
|
+
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
1846
|
+
};
|
|
1847
|
+
|
|
1848
|
+
var $find = arrayIteration.find;
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
var FIND = 'find';
|
|
1852
|
+
var SKIPS_HOLES = true;
|
|
1853
|
+
|
|
1854
|
+
// Shouldn't skip holes
|
|
1855
|
+
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
|
1856
|
+
|
|
1857
|
+
// `Array.prototype.find` method
|
|
1858
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1859
|
+
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
|
1860
|
+
find: function find(callbackfn /* , that = undefined */) {
|
|
1861
|
+
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
1862
|
+
}
|
|
1863
|
+
});
|
|
1864
|
+
|
|
1865
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1866
|
+
addToUnscopables(FIND);
|
|
1867
|
+
|
|
1020
1868
|
var _class, _class2, _temp;
|
|
1021
1869
|
|
|
1022
1870
|
var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =
|
|
@@ -1173,6 +2021,7 @@ function (_React$Component) {
|
|
|
1173
2021
|
switch (parentNode.constructor.name) {
|
|
1174
2022
|
case 'Document':
|
|
1175
2023
|
case 'HTMLDocument':
|
|
2024
|
+
case undefined:
|
|
1176
2025
|
domRoot = parentNode.head;
|
|
1177
2026
|
break;
|
|
1178
2027
|
|
|
@@ -1284,12 +2133,14 @@ function (_React$Component) {
|
|
|
1284
2133
|
}
|
|
1285
2134
|
|
|
1286
2135
|
target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
|
|
2136
|
+
target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
|
|
1287
2137
|
|
|
1288
2138
|
if (effect === 'float') {
|
|
1289
2139
|
target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
|
|
1290
2140
|
}
|
|
1291
2141
|
|
|
1292
2142
|
target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
|
|
2143
|
+
target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
|
|
1293
2144
|
});
|
|
1294
2145
|
} // Global event to hide tooltip
|
|
1295
2146
|
|
|
@@ -1403,6 +2254,11 @@ function (_React$Component) {
|
|
|
1403
2254
|
scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
|
|
1404
2255
|
} else if (this.props.scrollHide != null) {
|
|
1405
2256
|
scrollHide = this.props.scrollHide;
|
|
2257
|
+
} // adding aria-describedby to target to make tooltips read by screen readers
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
if (e && e.currentTarget && e.currentTarget.setAttribute) {
|
|
2261
|
+
e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
|
|
1406
2262
|
} // Make sure the correct place is set
|
|
1407
2263
|
|
|
1408
2264
|
|
|
@@ -1577,6 +2433,11 @@ function (_React$Component) {
|
|
|
1577
2433
|
return ele === e.currentTarget;
|
|
1578
2434
|
});
|
|
1579
2435
|
if (!isMyElement || !this.state.show) return;
|
|
2436
|
+
} // clean up aria-describedby when hiding tooltip
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
if (e && e.currentTarget && e.currentTarget.removeAttribute) {
|
|
2440
|
+
e.currentTarget.removeAttribute('aria-describedby');
|
|
1580
2441
|
}
|
|
1581
2442
|
|
|
1582
2443
|
var resetState = function resetState() {
|
|
@@ -1698,7 +2559,8 @@ function (_React$Component) {
|
|
|
1698
2559
|
extraClass = _this$state3.extraClass,
|
|
1699
2560
|
html = _this$state3.html,
|
|
1700
2561
|
ariaProps = _this$state3.ariaProps,
|
|
1701
|
-
disable = _this$state3.disable
|
|
2562
|
+
disable = _this$state3.disable,
|
|
2563
|
+
uuid = _this$state3.uuid;
|
|
1702
2564
|
var content = this.getTooltipContent();
|
|
1703
2565
|
var isEmptyTip = this.isEmptyTip(content);
|
|
1704
2566
|
var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);
|
|
@@ -1714,10 +2576,10 @@ function (_React$Component) {
|
|
|
1714
2576
|
var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
|
|
1715
2577
|
|
|
1716
2578
|
if (html) {
|
|
1717
|
-
var htmlContent = "".concat(content, "\n<style>").concat(style, "</style>");
|
|
2579
|
+
var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
|
|
1718
2580
|
return React.createElement(Wrapper, _extends({
|
|
1719
2581
|
className: "".concat(wrapperClassName),
|
|
1720
|
-
id: this.props.id,
|
|
2582
|
+
id: this.props.id || uuid,
|
|
1721
2583
|
ref: function ref(_ref) {
|
|
1722
2584
|
return _this9.tooltipRef = _ref;
|
|
1723
2585
|
}
|
|
@@ -1730,7 +2592,7 @@ function (_React$Component) {
|
|
|
1730
2592
|
} else {
|
|
1731
2593
|
return React.createElement(Wrapper, _extends({
|
|
1732
2594
|
className: "".concat(wrapperClassName),
|
|
1733
|
-
id: this.props.id
|
|
2595
|
+
id: this.props.id || uuid
|
|
1734
2596
|
}, ariaProps, {
|
|
1735
2597
|
ref: function ref(_ref2) {
|
|
1736
2598
|
return _this9.tooltipRef = _ref2;
|
|
@@ -1739,7 +2601,8 @@ function (_React$Component) {
|
|
|
1739
2601
|
}), React.createElement("style", {
|
|
1740
2602
|
dangerouslySetInnerHTML: {
|
|
1741
2603
|
__html: style
|
|
1742
|
-
}
|
|
2604
|
+
},
|
|
2605
|
+
"aria-hidden": "true"
|
|
1743
2606
|
}), content);
|
|
1744
2607
|
}
|
|
1745
2608
|
}
|