bk-magic-vue 2.5.9-beta.2 → 2.5.9-beta.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/dist/bk-magic-vue.css +893 -959
- package/dist/bk-magic-vue.js +860 -625
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/card.js +2981 -203
- package/lib/cascade.js +6447 -6411
- package/lib/date-picker.js +1 -1
- package/lib/dialog.js +484 -9
- package/lib/info-box.js +484 -9
- package/lib/input.js +2942 -164
- package/lib/loading.js +7 -4
- package/lib/pagination.js +214 -17
- package/lib/rate.js +14 -3
- package/lib/resize-layout.js +3 -1
- package/lib/select.js +40 -9
- package/lib/sideslider.js +802 -336
- package/lib/slider.js +3270 -3202
- package/lib/star.js +13 -2
- package/lib/table.js +214 -17
- package/lib/tag-input.js +122 -102
- package/lib/time-picker.js +1 -1
- package/lib/timeline.js +26 -17
- package/lib/transfer.js +1886 -1710
- package/lib/ui/badge.css +127 -119
- package/lib/ui/badge.min.css +1 -1
- package/lib/ui/badge.min.css.map +1 -1
- package/lib/ui/bk-magic-vue.css +893 -959
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/button.css +4 -4
- package/lib/ui/button.min.css +1 -1
- package/lib/ui/button.min.css.map +1 -1
- package/lib/ui/card.css +2 -2
- package/lib/ui/card.min.css +1 -1
- package/lib/ui/card.min.css.map +1 -1
- package/lib/ui/cascade.css +19 -1
- package/lib/ui/cascade.min.css +1 -1
- package/lib/ui/cascade.min.css.map +1 -1
- package/lib/ui/checkbox.css +67 -67
- package/lib/ui/checkbox.min.css.map +1 -1
- package/lib/ui/dialog.css +4 -4
- package/lib/ui/dialog.min.css +1 -1
- package/lib/ui/dialog.min.css.map +1 -1
- package/lib/ui/exception.css +1 -0
- package/lib/ui/exception.min.css +1 -1
- package/lib/ui/exception.min.css.map +1 -1
- package/lib/ui/form.css +2 -2
- package/lib/ui/form.min.css +1 -1
- package/lib/ui/form.min.css.map +1 -1
- package/lib/ui/info-box.css +4 -4
- package/lib/ui/info-box.min.css +1 -1
- package/lib/ui/info-box.min.css.map +1 -1
- package/lib/ui/input.css +1 -1
- package/lib/ui/input.min.css +1 -1
- package/lib/ui/input.min.css.map +1 -1
- package/lib/ui/link.css +27 -3
- package/lib/ui/link.min.css +1 -1
- package/lib/ui/link.min.css.map +1 -1
- package/lib/ui/loading.css +43 -280
- package/lib/ui/loading.min.css +1 -1
- package/lib/ui/loading.min.css.map +1 -1
- package/lib/ui/notify.css +5 -5
- package/lib/ui/notify.min.css +1 -1
- package/lib/ui/notify.min.css.map +1 -1
- package/lib/ui/overflow-tips.css +3 -2
- package/lib/ui/overflow-tips.min.css +1 -1
- package/lib/ui/overflow-tips.min.css.map +1 -1
- package/lib/ui/pagination.css +1 -1
- package/lib/ui/pagination.min.css +1 -1
- package/lib/ui/pagination.min.css.map +1 -1
- package/lib/ui/popconfirm.css +2 -2
- package/lib/ui/popconfirm.min.css +1 -1
- package/lib/ui/popconfirm.min.css.map +1 -1
- package/lib/ui/popover.css +3 -2
- package/lib/ui/popover.min.css +1 -1
- package/lib/ui/popover.min.css.map +1 -1
- package/lib/ui/process.css +51 -282
- package/lib/ui/process.min.css +1 -1
- package/lib/ui/process.min.css.map +1 -1
- package/lib/ui/progress.css +2 -2
- package/lib/ui/progress.min.css +1 -1
- package/lib/ui/progress.min.css.map +1 -1
- package/lib/ui/radio.css +64 -64
- package/lib/ui/radio.min.css +1 -1
- package/lib/ui/radio.min.css.map +1 -1
- package/lib/ui/resize-layout.css +13 -5
- package/lib/ui/resize-layout.min.css +1 -1
- package/lib/ui/resize-layout.min.css.map +1 -1
- package/lib/ui/sideslider.css +8 -7
- package/lib/ui/sideslider.min.css +1 -1
- package/lib/ui/sideslider.min.css.map +1 -1
- package/lib/ui/star.css +22 -17
- package/lib/ui/star.min.css +1 -1
- package/lib/ui/star.min.css.map +1 -1
- package/lib/ui/steps.css +372 -274
- package/lib/ui/steps.min.css +1 -1
- package/lib/ui/steps.min.css.map +1 -1
- package/lib/ui/tooltips.css +3 -2
- package/lib/ui/tooltips.min.css +1 -1
- package/lib/ui/tooltips.min.css.map +1 -1
- package/lib/ui/transfer.css +122 -121
- package/lib/ui/transfer.min.css +1 -1
- package/lib/ui/transfer.min.css.map +1 -1
- package/lib/ui/tree.css +45 -282
- package/lib/ui/tree.min.css +1 -1
- package/lib/ui/tree.min.css.map +1 -1
- package/lib/version-detail.js +453 -13
- package/package.json +3 -4
package/lib/card.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale'], factory) :
|
|
4
|
-
(global = global || self, factory(global.library = {}, global.locale));
|
|
5
|
-
}(this, function (exports, locale) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('bk-magic-vue/lib/locale')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'bk-magic-vue/lib/locale'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}, global.Vue, global.locale));
|
|
5
|
+
}(this, function (exports, Vue, locale) { 'use strict';
|
|
6
6
|
|
|
7
|
+
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
7
8
|
locale = locale && locale.hasOwnProperty('default') ? locale['default'] : locale;
|
|
8
9
|
|
|
9
10
|
function createCommonjsModule(fn, module) {
|
|
@@ -215,6 +216,51 @@
|
|
|
215
216
|
|
|
216
217
|
var _parseInt$2 = _parseInt$1;
|
|
217
218
|
|
|
219
|
+
function _typeof(obj) {
|
|
220
|
+
"@babel/helpers - typeof";
|
|
221
|
+
|
|
222
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
223
|
+
return typeof obj;
|
|
224
|
+
} : function (obj) {
|
|
225
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
226
|
+
}, _typeof(obj);
|
|
227
|
+
}
|
|
228
|
+
function _classCallCheck(instance, Constructor) {
|
|
229
|
+
if (!(instance instanceof Constructor)) {
|
|
230
|
+
throw new TypeError("Cannot call a class as a function");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function _defineProperties(target, props) {
|
|
234
|
+
for (var i = 0; i < props.length; i++) {
|
|
235
|
+
var descriptor = props[i];
|
|
236
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
237
|
+
descriptor.configurable = true;
|
|
238
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
239
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
243
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
244
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
245
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
246
|
+
writable: false
|
|
247
|
+
});
|
|
248
|
+
return Constructor;
|
|
249
|
+
}
|
|
250
|
+
function _defineProperty(obj, key, value) {
|
|
251
|
+
key = _toPropertyKey(key);
|
|
252
|
+
if (key in obj) {
|
|
253
|
+
Object.defineProperty(obj, key, {
|
|
254
|
+
value: value,
|
|
255
|
+
enumerable: true,
|
|
256
|
+
configurable: true,
|
|
257
|
+
writable: true
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
obj[key] = value;
|
|
261
|
+
}
|
|
262
|
+
return obj;
|
|
263
|
+
}
|
|
218
264
|
function _extends() {
|
|
219
265
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
220
266
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -229,6 +275,21 @@
|
|
|
229
275
|
};
|
|
230
276
|
return _extends.apply(this, arguments);
|
|
231
277
|
}
|
|
278
|
+
function _objectSpread(target) {
|
|
279
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
280
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
281
|
+
var ownKeys = Object.keys(source);
|
|
282
|
+
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
283
|
+
ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
284
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
285
|
+
}));
|
|
286
|
+
}
|
|
287
|
+
ownKeys.forEach(function (key) {
|
|
288
|
+
_defineProperty(target, key, source[key]);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return target;
|
|
292
|
+
}
|
|
232
293
|
function _unsupportedIterableToArray(o, minLen) {
|
|
233
294
|
if (!o) return;
|
|
234
295
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -293,6 +354,20 @@
|
|
|
293
354
|
}
|
|
294
355
|
};
|
|
295
356
|
}
|
|
357
|
+
function _toPrimitive$1(input, hint) {
|
|
358
|
+
if (typeof input !== "object" || input === null) return input;
|
|
359
|
+
var prim = input[Symbol.toPrimitive];
|
|
360
|
+
if (prim !== undefined) {
|
|
361
|
+
var res = prim.call(input, hint || "default");
|
|
362
|
+
if (typeof res !== "object") return res;
|
|
363
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
364
|
+
}
|
|
365
|
+
return (hint === "string" ? String : Number)(input);
|
|
366
|
+
}
|
|
367
|
+
function _toPropertyKey(arg) {
|
|
368
|
+
var key = _toPrimitive$1(arg, "string");
|
|
369
|
+
return typeof key === "symbol" ? key : String(key);
|
|
370
|
+
}
|
|
296
371
|
|
|
297
372
|
var $parseFloat = _global.parseFloat;
|
|
298
373
|
var $trim$1 = _stringTrim.trim;
|
|
@@ -338,101 +413,2851 @@
|
|
|
338
413
|
}
|
|
339
414
|
};
|
|
340
415
|
|
|
341
|
-
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
|
|
342
|
-
window.setTimeout(callback, 1000 / 60);
|
|
343
|
-
};
|
|
344
|
-
var cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {
|
|
345
|
-
window.clearTimeout(id);
|
|
346
|
-
};
|
|
347
|
-
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
348
|
-
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
349
|
-
var trim$1 = function trim(string) {
|
|
350
|
-
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
351
|
-
};
|
|
352
|
-
var camelCase = function camelCase(name) {
|
|
353
|
-
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
354
|
-
return offset ? letter.toUpperCase() : letter;
|
|
355
|
-
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
416
|
+
var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
|
|
417
|
+
window.setTimeout(callback, 1000 / 60);
|
|
418
|
+
};
|
|
419
|
+
var cancelAnimationFrame$1 = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {
|
|
420
|
+
window.clearTimeout(id);
|
|
421
|
+
};
|
|
422
|
+
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
423
|
+
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
424
|
+
var trim$1 = function trim(string) {
|
|
425
|
+
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
426
|
+
};
|
|
427
|
+
var camelCase = function camelCase(name) {
|
|
428
|
+
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
429
|
+
return offset ? letter.toUpperCase() : letter;
|
|
430
|
+
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
431
|
+
};
|
|
432
|
+
function hasClass(el, cls) {
|
|
433
|
+
if (!el || !cls) return false;
|
|
434
|
+
if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
|
|
435
|
+
if (el.classList) {
|
|
436
|
+
return el.classList.contains(cls);
|
|
437
|
+
} else {
|
|
438
|
+
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
function addClass(el, cls) {
|
|
442
|
+
if (!el) return;
|
|
443
|
+
var curClass = el.className;
|
|
444
|
+
var classes = (cls || '').split(' ');
|
|
445
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
446
|
+
var clsName = classes[i];
|
|
447
|
+
if (!clsName) continue;
|
|
448
|
+
if (el.classList) {
|
|
449
|
+
el.classList.add(clsName);
|
|
450
|
+
} else if (!hasClass(el, clsName)) {
|
|
451
|
+
curClass += ' ' + clsName;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (!el.classList) {
|
|
455
|
+
el.className = curClass;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function removeClass(el, cls) {
|
|
459
|
+
if (!el || !cls) return;
|
|
460
|
+
var classes = cls.split(' ');
|
|
461
|
+
var curClass = ' ' + el.className + ' ';
|
|
462
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
463
|
+
var clsName = classes[i];
|
|
464
|
+
if (!clsName) continue;
|
|
465
|
+
if (el.classList) {
|
|
466
|
+
el.classList.remove(clsName);
|
|
467
|
+
} else if (hasClass(el, clsName)) {
|
|
468
|
+
curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (!el.classList) {
|
|
472
|
+
el.className = trim$1(curClass);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
var getStyle = Number(document.documentMode) < 9 ? function (element, styleName) {
|
|
476
|
+
if (!element || !styleName) return null;
|
|
477
|
+
styleName = camelCase(styleName);
|
|
478
|
+
if (styleName === 'float') {
|
|
479
|
+
styleName = 'styleFloat';
|
|
480
|
+
}
|
|
481
|
+
try {
|
|
482
|
+
switch (styleName) {
|
|
483
|
+
case 'opacity':
|
|
484
|
+
try {
|
|
485
|
+
return element.filters.item('alpha').opacity / 100;
|
|
486
|
+
} catch (e) {
|
|
487
|
+
return 1.0;
|
|
488
|
+
}
|
|
489
|
+
default:
|
|
490
|
+
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
491
|
+
}
|
|
492
|
+
} catch (e) {
|
|
493
|
+
return element.style[styleName];
|
|
494
|
+
}
|
|
495
|
+
} : function (element, styleName) {
|
|
496
|
+
if (!element || !styleName) return null;
|
|
497
|
+
styleName = camelCase(styleName);
|
|
498
|
+
if (styleName === 'float') {
|
|
499
|
+
styleName = 'cssFloat';
|
|
500
|
+
}
|
|
501
|
+
try {
|
|
502
|
+
var computed = document.defaultView.getComputedStyle(element, '');
|
|
503
|
+
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
504
|
+
} catch (e) {
|
|
505
|
+
return element.style[styleName];
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
var toString = {}.toString;
|
|
510
|
+
var _cof = function (it) {
|
|
511
|
+
return toString.call(it).slice(8, -1);
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
var _isArray = Array.isArray || function isArray(arg) {
|
|
515
|
+
return _cof(arg) == 'Array';
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
_export(_export.S, 'Array', { isArray: _isArray });
|
|
519
|
+
|
|
520
|
+
var isArray = _core.Array.isArray;
|
|
521
|
+
|
|
522
|
+
var isArray$1 = isArray;
|
|
523
|
+
|
|
524
|
+
var _toObject = function (it) {
|
|
525
|
+
return Object(_defined(it));
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
529
|
+
return _cof(it) == 'String' ? it.split('') : Object(it);
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
var _toIobject = function (it) {
|
|
533
|
+
return _iobject(_defined(it));
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
var ceil = Math.ceil;
|
|
537
|
+
var floor = Math.floor;
|
|
538
|
+
var _toInteger = function (it) {
|
|
539
|
+
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
var min = Math.min;
|
|
543
|
+
var _toLength = function (it) {
|
|
544
|
+
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
var max = Math.max;
|
|
548
|
+
var min$1 = Math.min;
|
|
549
|
+
var _toAbsoluteIndex = function (index, length) {
|
|
550
|
+
index = _toInteger(index);
|
|
551
|
+
return index < 0 ? max(index + length, 0) : min$1(index, length);
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
var _arrayIncludes = function (IS_INCLUDES) {
|
|
555
|
+
return function ($this, el, fromIndex) {
|
|
556
|
+
var O = _toIobject($this);
|
|
557
|
+
var length = _toLength(O.length);
|
|
558
|
+
var index = _toAbsoluteIndex(fromIndex, length);
|
|
559
|
+
var value;
|
|
560
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
561
|
+
value = O[index++];
|
|
562
|
+
if (value != value) return true;
|
|
563
|
+
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
564
|
+
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
565
|
+
} return !IS_INCLUDES && -1;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
var _shared = createCommonjsModule(function (module) {
|
|
570
|
+
var SHARED = '__core-js_shared__';
|
|
571
|
+
var store = _global[SHARED] || (_global[SHARED] = {});
|
|
572
|
+
(module.exports = function (key, value) {
|
|
573
|
+
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
574
|
+
})('versions', []).push({
|
|
575
|
+
version: _core.version,
|
|
576
|
+
mode: 'pure' ,
|
|
577
|
+
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
578
|
+
});
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
var id = 0;
|
|
582
|
+
var px = Math.random();
|
|
583
|
+
var _uid = function (key) {
|
|
584
|
+
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
var shared = _shared('keys');
|
|
588
|
+
var _sharedKey = function (key) {
|
|
589
|
+
return shared[key] || (shared[key] = _uid(key));
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
var arrayIndexOf = _arrayIncludes(false);
|
|
593
|
+
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
594
|
+
var _objectKeysInternal = function (object, names) {
|
|
595
|
+
var O = _toIobject(object);
|
|
596
|
+
var i = 0;
|
|
597
|
+
var result = [];
|
|
598
|
+
var key;
|
|
599
|
+
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
|
|
600
|
+
while (names.length > i) if (_has(O, key = names[i++])) {
|
|
601
|
+
~arrayIndexOf(result, key) || result.push(key);
|
|
602
|
+
}
|
|
603
|
+
return result;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
var _enumBugKeys = (
|
|
607
|
+
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
608
|
+
).split(',');
|
|
609
|
+
|
|
610
|
+
var _objectKeys = Object.keys || function keys(O) {
|
|
611
|
+
return _objectKeysInternal(O, _enumBugKeys);
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
var _objectSap = function (KEY, exec) {
|
|
615
|
+
var fn = (_core.Object || {})[KEY] || Object[KEY];
|
|
616
|
+
var exp = {};
|
|
617
|
+
exp[KEY] = exec(fn);
|
|
618
|
+
_export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
_objectSap('keys', function () {
|
|
622
|
+
return function keys(it) {
|
|
623
|
+
return _objectKeys(_toObject(it));
|
|
624
|
+
};
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
var keys = _core.Object.keys;
|
|
628
|
+
|
|
629
|
+
var keys$1 = keys;
|
|
630
|
+
|
|
631
|
+
var f$1 = Object.getOwnPropertySymbols;
|
|
632
|
+
var _objectGops = {
|
|
633
|
+
f: f$1
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
var f$2 = {}.propertyIsEnumerable;
|
|
637
|
+
var _objectPie = {
|
|
638
|
+
f: f$2
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
var $assign = Object.assign;
|
|
642
|
+
var _objectAssign = !$assign || _fails(function () {
|
|
643
|
+
var A = {};
|
|
644
|
+
var B = {};
|
|
645
|
+
var S = Symbol();
|
|
646
|
+
var K = 'abcdefghijklmnopqrst';
|
|
647
|
+
A[S] = 7;
|
|
648
|
+
K.split('').forEach(function (k) { B[k] = k; });
|
|
649
|
+
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
|
650
|
+
}) ? function assign(target, source) {
|
|
651
|
+
var T = _toObject(target);
|
|
652
|
+
var aLen = arguments.length;
|
|
653
|
+
var index = 1;
|
|
654
|
+
var getSymbols = _objectGops.f;
|
|
655
|
+
var isEnum = _objectPie.f;
|
|
656
|
+
while (aLen > index) {
|
|
657
|
+
var S = _iobject(arguments[index++]);
|
|
658
|
+
var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
|
|
659
|
+
var length = keys.length;
|
|
660
|
+
var j = 0;
|
|
661
|
+
var key;
|
|
662
|
+
while (length > j) {
|
|
663
|
+
key = keys[j++];
|
|
664
|
+
if (!_descriptors || isEnum.call(S, key)) T[key] = S[key];
|
|
665
|
+
}
|
|
666
|
+
} return T;
|
|
667
|
+
} : $assign;
|
|
668
|
+
|
|
669
|
+
_export(_export.S + _export.F, 'Object', { assign: _objectAssign });
|
|
670
|
+
|
|
671
|
+
var assign = _core.Object.assign;
|
|
672
|
+
|
|
673
|
+
var assign$1 = assign;
|
|
674
|
+
|
|
675
|
+
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
676
|
+
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
|
677
|
+
var timeoutDuration = 0;
|
|
678
|
+
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
679
|
+
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
680
|
+
timeoutDuration = 1;
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
function microtaskDebounce(fn) {
|
|
685
|
+
var called = false;
|
|
686
|
+
return function () {
|
|
687
|
+
if (called) {
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
called = true;
|
|
691
|
+
window.Promise.resolve().then(function () {
|
|
692
|
+
called = false;
|
|
693
|
+
fn();
|
|
694
|
+
});
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function taskDebounce(fn) {
|
|
698
|
+
var scheduled = false;
|
|
699
|
+
return function () {
|
|
700
|
+
if (!scheduled) {
|
|
701
|
+
scheduled = true;
|
|
702
|
+
setTimeout(function () {
|
|
703
|
+
scheduled = false;
|
|
704
|
+
fn();
|
|
705
|
+
}, timeoutDuration);
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
var supportsMicroTasks = isBrowser && window.Promise;
|
|
710
|
+
var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
|
|
711
|
+
function isFunction(functionToCheck) {
|
|
712
|
+
var getType = {};
|
|
713
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
714
|
+
}
|
|
715
|
+
function getStyleComputedProperty(element, property) {
|
|
716
|
+
if (element.nodeType !== 1) {
|
|
717
|
+
return [];
|
|
718
|
+
}
|
|
719
|
+
var window = element.ownerDocument.defaultView;
|
|
720
|
+
var css = window.getComputedStyle(element, null);
|
|
721
|
+
return property ? css[property] : css;
|
|
722
|
+
}
|
|
723
|
+
function getParentNode(element) {
|
|
724
|
+
if (element.nodeName === 'HTML') {
|
|
725
|
+
return element;
|
|
726
|
+
}
|
|
727
|
+
return element.parentNode || element.host;
|
|
728
|
+
}
|
|
729
|
+
function getScrollParent(element) {
|
|
730
|
+
if (!element) {
|
|
731
|
+
return document.body;
|
|
732
|
+
}
|
|
733
|
+
switch (element.nodeName) {
|
|
734
|
+
case 'HTML':
|
|
735
|
+
case 'BODY':
|
|
736
|
+
return element.ownerDocument.body;
|
|
737
|
+
case '#document':
|
|
738
|
+
return element.body;
|
|
739
|
+
}
|
|
740
|
+
var _getStyleComputedProp = getStyleComputedProperty(element),
|
|
741
|
+
overflow = _getStyleComputedProp.overflow,
|
|
742
|
+
overflowX = _getStyleComputedProp.overflowX,
|
|
743
|
+
overflowY = _getStyleComputedProp.overflowY;
|
|
744
|
+
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
|
745
|
+
return element;
|
|
746
|
+
}
|
|
747
|
+
return getScrollParent(getParentNode(element));
|
|
748
|
+
}
|
|
749
|
+
var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
|
750
|
+
var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
|
|
751
|
+
function isIE(version) {
|
|
752
|
+
if (version === 11) {
|
|
753
|
+
return isIE11;
|
|
754
|
+
}
|
|
755
|
+
if (version === 10) {
|
|
756
|
+
return isIE10;
|
|
757
|
+
}
|
|
758
|
+
return isIE11 || isIE10;
|
|
759
|
+
}
|
|
760
|
+
function getOffsetParent(element) {
|
|
761
|
+
if (!element) {
|
|
762
|
+
return document.documentElement;
|
|
763
|
+
}
|
|
764
|
+
var noOffsetParent = isIE(10) ? document.body : null;
|
|
765
|
+
var offsetParent = element.offsetParent || null;
|
|
766
|
+
while (offsetParent === noOffsetParent && element.nextElementSibling) {
|
|
767
|
+
offsetParent = (element = element.nextElementSibling).offsetParent;
|
|
768
|
+
}
|
|
769
|
+
var nodeName = offsetParent && offsetParent.nodeName;
|
|
770
|
+
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
|
|
771
|
+
return element ? element.ownerDocument.documentElement : document.documentElement;
|
|
772
|
+
}
|
|
773
|
+
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
|
|
774
|
+
return getOffsetParent(offsetParent);
|
|
775
|
+
}
|
|
776
|
+
return offsetParent;
|
|
777
|
+
}
|
|
778
|
+
function isOffsetContainer(element) {
|
|
779
|
+
var nodeName = element.nodeName;
|
|
780
|
+
if (nodeName === 'BODY') {
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
|
|
784
|
+
}
|
|
785
|
+
function getRoot(node) {
|
|
786
|
+
if (node.parentNode !== null) {
|
|
787
|
+
return getRoot(node.parentNode);
|
|
788
|
+
}
|
|
789
|
+
return node;
|
|
790
|
+
}
|
|
791
|
+
function findCommonOffsetParent(element1, element2) {
|
|
792
|
+
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
|
|
793
|
+
return document.documentElement;
|
|
794
|
+
}
|
|
795
|
+
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
|
|
796
|
+
var start = order ? element1 : element2;
|
|
797
|
+
var end = order ? element2 : element1;
|
|
798
|
+
var range = document.createRange();
|
|
799
|
+
range.setStart(start, 0);
|
|
800
|
+
range.setEnd(end, 0);
|
|
801
|
+
var commonAncestorContainer = range.commonAncestorContainer;
|
|
802
|
+
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
|
|
803
|
+
if (isOffsetContainer(commonAncestorContainer)) {
|
|
804
|
+
return commonAncestorContainer;
|
|
805
|
+
}
|
|
806
|
+
return getOffsetParent(commonAncestorContainer);
|
|
807
|
+
}
|
|
808
|
+
var element1root = getRoot(element1);
|
|
809
|
+
if (element1root.host) {
|
|
810
|
+
return findCommonOffsetParent(element1root.host, element2);
|
|
811
|
+
} else {
|
|
812
|
+
return findCommonOffsetParent(element1, getRoot(element2).host);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
function getScroll(element) {
|
|
816
|
+
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
|
817
|
+
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
|
|
818
|
+
var nodeName = element.nodeName;
|
|
819
|
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
820
|
+
var html = element.ownerDocument.documentElement;
|
|
821
|
+
var scrollingElement = element.ownerDocument.scrollingElement || html;
|
|
822
|
+
return scrollingElement[upperSide];
|
|
823
|
+
}
|
|
824
|
+
return element[upperSide];
|
|
825
|
+
}
|
|
826
|
+
function includeScroll(rect, element) {
|
|
827
|
+
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
828
|
+
var scrollTop = getScroll(element, 'top');
|
|
829
|
+
var scrollLeft = getScroll(element, 'left');
|
|
830
|
+
var modifier = subtract ? -1 : 1;
|
|
831
|
+
rect.top += scrollTop * modifier;
|
|
832
|
+
rect.bottom += scrollTop * modifier;
|
|
833
|
+
rect.left += scrollLeft * modifier;
|
|
834
|
+
rect.right += scrollLeft * modifier;
|
|
835
|
+
return rect;
|
|
836
|
+
}
|
|
837
|
+
function getBordersSize(styles, axis) {
|
|
838
|
+
var sideA = axis === 'x' ? 'Left' : 'Top';
|
|
839
|
+
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
|
840
|
+
return _parseFloat$2(styles["border".concat(sideA, "Width")], 10) + _parseFloat$2(styles["border".concat(sideB, "Width")], 10);
|
|
841
|
+
}
|
|
842
|
+
function getSize(axis, body, html, computedStyle) {
|
|
843
|
+
return Math.max(body["offset".concat(axis)], body["scroll".concat(axis)], html["client".concat(axis)], html["offset".concat(axis)], html["scroll".concat(axis)], isIE(10) ? _parseInt$2(html["offset".concat(axis)]) + _parseInt$2(computedStyle["margin".concat(axis === 'Height' ? 'Top' : 'Left')]) + _parseInt$2(computedStyle["margin".concat(axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
|
844
|
+
}
|
|
845
|
+
function getWindowSizes(document) {
|
|
846
|
+
var body = document.body;
|
|
847
|
+
var html = document.documentElement;
|
|
848
|
+
var computedStyle = isIE(10) && getComputedStyle(html);
|
|
849
|
+
return {
|
|
850
|
+
height: getSize('Height', body, html, computedStyle),
|
|
851
|
+
width: getSize('Width', body, html, computedStyle)
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
var _extends$1 = assign$1 || function (target) {
|
|
855
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
856
|
+
var source = arguments[i];
|
|
857
|
+
for (var key in source) {
|
|
858
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
859
|
+
target[key] = source[key];
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return target;
|
|
864
|
+
};
|
|
865
|
+
function getClientRect(offsets) {
|
|
866
|
+
return _extends$1({}, offsets, {
|
|
867
|
+
right: offsets.left + offsets.width,
|
|
868
|
+
bottom: offsets.top + offsets.height
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
function getBoundingClientRect(element) {
|
|
872
|
+
var rect = {};
|
|
873
|
+
try {
|
|
874
|
+
if (isIE(10)) {
|
|
875
|
+
rect = element.getBoundingClientRect();
|
|
876
|
+
var scrollTop = getScroll(element, 'top');
|
|
877
|
+
var scrollLeft = getScroll(element, 'left');
|
|
878
|
+
rect.top += scrollTop;
|
|
879
|
+
rect.left += scrollLeft;
|
|
880
|
+
rect.bottom += scrollTop;
|
|
881
|
+
rect.right += scrollLeft;
|
|
882
|
+
} else {
|
|
883
|
+
rect = element.getBoundingClientRect();
|
|
884
|
+
}
|
|
885
|
+
} catch (e) {}
|
|
886
|
+
var result = {
|
|
887
|
+
left: rect.left,
|
|
888
|
+
top: rect.top,
|
|
889
|
+
width: rect.right - rect.left,
|
|
890
|
+
height: rect.bottom - rect.top
|
|
891
|
+
};
|
|
892
|
+
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
|
893
|
+
var width = sizes.width || element.clientWidth || result.right - result.left;
|
|
894
|
+
var height = sizes.height || element.clientHeight || result.bottom - result.top;
|
|
895
|
+
var horizScrollbar = element.offsetWidth - width;
|
|
896
|
+
var vertScrollbar = element.offsetHeight - height;
|
|
897
|
+
if (horizScrollbar || vertScrollbar) {
|
|
898
|
+
var styles = getStyleComputedProperty(element);
|
|
899
|
+
horizScrollbar -= getBordersSize(styles, 'x');
|
|
900
|
+
vertScrollbar -= getBordersSize(styles, 'y');
|
|
901
|
+
result.width -= horizScrollbar;
|
|
902
|
+
result.height -= vertScrollbar;
|
|
903
|
+
}
|
|
904
|
+
return getClientRect(result);
|
|
905
|
+
}
|
|
906
|
+
function getOffsetRectRelativeToArbitraryNode(children, parent) {
|
|
907
|
+
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
908
|
+
var isIE10 = isIE(10);
|
|
909
|
+
var isHTML = parent.nodeName === 'HTML';
|
|
910
|
+
var childrenRect = getBoundingClientRect(children);
|
|
911
|
+
var parentRect = getBoundingClientRect(parent);
|
|
912
|
+
var scrollParent = getScrollParent(children);
|
|
913
|
+
var styles = getStyleComputedProperty(parent);
|
|
914
|
+
var borderTopWidth = _parseFloat$2(styles.borderTopWidth, 10);
|
|
915
|
+
var borderLeftWidth = _parseFloat$2(styles.borderLeftWidth, 10);
|
|
916
|
+
if (fixedPosition && isHTML) {
|
|
917
|
+
parentRect.top = Math.max(parentRect.top, 0);
|
|
918
|
+
parentRect.left = Math.max(parentRect.left, 0);
|
|
919
|
+
}
|
|
920
|
+
var offsets = getClientRect({
|
|
921
|
+
top: childrenRect.top - parentRect.top - borderTopWidth,
|
|
922
|
+
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
|
923
|
+
width: childrenRect.width,
|
|
924
|
+
height: childrenRect.height
|
|
925
|
+
});
|
|
926
|
+
offsets.marginTop = 0;
|
|
927
|
+
offsets.marginLeft = 0;
|
|
928
|
+
if (!isIE10 && isHTML) {
|
|
929
|
+
var marginTop = _parseFloat$2(styles.marginTop, 10);
|
|
930
|
+
var marginLeft = _parseFloat$2(styles.marginLeft, 10);
|
|
931
|
+
offsets.top -= borderTopWidth - marginTop;
|
|
932
|
+
offsets.bottom -= borderTopWidth - marginTop;
|
|
933
|
+
offsets.left -= borderLeftWidth - marginLeft;
|
|
934
|
+
offsets.right -= borderLeftWidth - marginLeft;
|
|
935
|
+
offsets.marginTop = marginTop;
|
|
936
|
+
offsets.marginLeft = marginLeft;
|
|
937
|
+
}
|
|
938
|
+
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
|
|
939
|
+
offsets = includeScroll(offsets, parent);
|
|
940
|
+
}
|
|
941
|
+
return offsets;
|
|
942
|
+
}
|
|
943
|
+
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
|
|
944
|
+
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
945
|
+
var html = element.ownerDocument.documentElement;
|
|
946
|
+
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
|
|
947
|
+
var width = Math.max(html.clientWidth, window.innerWidth || 0);
|
|
948
|
+
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
|
949
|
+
var scrollTop = !excludeScroll ? getScroll(html) : 0;
|
|
950
|
+
var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
|
|
951
|
+
var offset = {
|
|
952
|
+
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
|
953
|
+
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
|
954
|
+
width: width,
|
|
955
|
+
height: height
|
|
956
|
+
};
|
|
957
|
+
return getClientRect(offset);
|
|
958
|
+
}
|
|
959
|
+
function isFixed(element) {
|
|
960
|
+
var nodeName = element.nodeName;
|
|
961
|
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
var parentNode = getParentNode(element);
|
|
968
|
+
if (!parentNode) {
|
|
969
|
+
return false;
|
|
970
|
+
}
|
|
971
|
+
return isFixed(parentNode);
|
|
972
|
+
}
|
|
973
|
+
function getFixedPositionOffsetParent(element) {
|
|
974
|
+
if (!element || !element.parentElement || isIE()) {
|
|
975
|
+
return document.documentElement;
|
|
976
|
+
}
|
|
977
|
+
var el = element.parentElement;
|
|
978
|
+
while (el && getStyleComputedProperty(el, 'transform') === 'none') {
|
|
979
|
+
el = el.parentElement;
|
|
980
|
+
}
|
|
981
|
+
return el || document.documentElement;
|
|
982
|
+
}
|
|
983
|
+
function getBoundaries(popper, reference, padding, boundariesElement) {
|
|
984
|
+
var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
985
|
+
var boundaries = {
|
|
986
|
+
top: 0,
|
|
987
|
+
left: 0
|
|
988
|
+
};
|
|
989
|
+
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
|
|
990
|
+
if (boundariesElement === 'viewport') {
|
|
991
|
+
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
|
|
992
|
+
} else {
|
|
993
|
+
var boundariesNode;
|
|
994
|
+
if (boundariesElement === 'scrollParent') {
|
|
995
|
+
boundariesNode = getScrollParent(getParentNode(reference));
|
|
996
|
+
if (boundariesNode.nodeName === 'BODY') {
|
|
997
|
+
boundariesNode = popper.ownerDocument.documentElement;
|
|
998
|
+
}
|
|
999
|
+
} else if (boundariesElement === 'window') {
|
|
1000
|
+
boundariesNode = popper.ownerDocument.documentElement;
|
|
1001
|
+
} else {
|
|
1002
|
+
boundariesNode = boundariesElement;
|
|
1003
|
+
}
|
|
1004
|
+
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
|
|
1005
|
+
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
|
|
1006
|
+
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
|
|
1007
|
+
height = _getWindowSizes.height,
|
|
1008
|
+
width = _getWindowSizes.width;
|
|
1009
|
+
boundaries.top += offsets.top - offsets.marginTop;
|
|
1010
|
+
boundaries.bottom = height + offsets.top;
|
|
1011
|
+
boundaries.left += offsets.left - offsets.marginLeft;
|
|
1012
|
+
boundaries.right = width + offsets.left;
|
|
1013
|
+
} else {
|
|
1014
|
+
boundaries = offsets;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
padding = padding || 0;
|
|
1018
|
+
var isPaddingNumber = typeof padding === 'number';
|
|
1019
|
+
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
|
|
1020
|
+
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
|
1021
|
+
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
|
1022
|
+
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
|
1023
|
+
return boundaries;
|
|
1024
|
+
}
|
|
1025
|
+
function getArea(_ref) {
|
|
1026
|
+
var width = _ref.width,
|
|
1027
|
+
height = _ref.height;
|
|
1028
|
+
return width * height;
|
|
1029
|
+
}
|
|
1030
|
+
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
|
|
1031
|
+
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
1032
|
+
if (placement.indexOf('auto') === -1) {
|
|
1033
|
+
return placement;
|
|
1034
|
+
}
|
|
1035
|
+
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
|
|
1036
|
+
var rects = {
|
|
1037
|
+
top: {
|
|
1038
|
+
width: boundaries.width,
|
|
1039
|
+
height: refRect.top - boundaries.top
|
|
1040
|
+
},
|
|
1041
|
+
right: {
|
|
1042
|
+
width: boundaries.right - refRect.right,
|
|
1043
|
+
height: boundaries.height
|
|
1044
|
+
},
|
|
1045
|
+
bottom: {
|
|
1046
|
+
width: boundaries.width,
|
|
1047
|
+
height: boundaries.bottom - refRect.bottom
|
|
1048
|
+
},
|
|
1049
|
+
left: {
|
|
1050
|
+
width: refRect.left - boundaries.left,
|
|
1051
|
+
height: boundaries.height
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
var sortedAreas = keys$1(rects).map(function (key) {
|
|
1055
|
+
return _extends$1({
|
|
1056
|
+
key: key
|
|
1057
|
+
}, rects[key], {
|
|
1058
|
+
area: getArea(rects[key])
|
|
1059
|
+
});
|
|
1060
|
+
}).sort(function (a, b) {
|
|
1061
|
+
return b.area - a.area;
|
|
1062
|
+
});
|
|
1063
|
+
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
|
1064
|
+
var width = _ref2.width,
|
|
1065
|
+
height = _ref2.height;
|
|
1066
|
+
return width >= popper.clientWidth && height >= popper.clientHeight;
|
|
1067
|
+
});
|
|
1068
|
+
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
|
|
1069
|
+
var variation = placement.split('-')[1];
|
|
1070
|
+
return computedPlacement + (variation ? "-".concat(variation) : '');
|
|
1071
|
+
}
|
|
1072
|
+
function getReferenceOffsets(state, popper, reference) {
|
|
1073
|
+
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
1074
|
+
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
|
|
1075
|
+
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
|
|
1076
|
+
}
|
|
1077
|
+
function getOuterSizes(element) {
|
|
1078
|
+
var window = element.ownerDocument.defaultView;
|
|
1079
|
+
var styles = window.getComputedStyle(element);
|
|
1080
|
+
var x = _parseFloat$2(styles.marginTop || 0) + _parseFloat$2(styles.marginBottom || 0);
|
|
1081
|
+
var y = _parseFloat$2(styles.marginLeft || 0) + _parseFloat$2(styles.marginRight || 0);
|
|
1082
|
+
var result = {
|
|
1083
|
+
width: element.offsetWidth + y,
|
|
1084
|
+
height: element.offsetHeight + x
|
|
1085
|
+
};
|
|
1086
|
+
return result;
|
|
1087
|
+
}
|
|
1088
|
+
function getOppositePlacement(placement) {
|
|
1089
|
+
var hash = {
|
|
1090
|
+
left: 'right',
|
|
1091
|
+
right: 'left',
|
|
1092
|
+
bottom: 'top',
|
|
1093
|
+
top: 'bottom'
|
|
1094
|
+
};
|
|
1095
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
1096
|
+
return hash[matched];
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
function getPopperOffsets(popper, referenceOffsets, placement) {
|
|
1100
|
+
placement = placement.split('-')[0];
|
|
1101
|
+
var popperRect = getOuterSizes(popper);
|
|
1102
|
+
var popperOffsets = {
|
|
1103
|
+
width: popperRect.width,
|
|
1104
|
+
height: popperRect.height
|
|
1105
|
+
};
|
|
1106
|
+
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
|
|
1107
|
+
var mainSide = isHoriz ? 'top' : 'left';
|
|
1108
|
+
var secondarySide = isHoriz ? 'left' : 'top';
|
|
1109
|
+
var measurement = isHoriz ? 'height' : 'width';
|
|
1110
|
+
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
|
1111
|
+
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
|
|
1112
|
+
if (placement === secondarySide) {
|
|
1113
|
+
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
|
1114
|
+
} else {
|
|
1115
|
+
popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
|
|
1116
|
+
}
|
|
1117
|
+
return popperOffsets;
|
|
1118
|
+
}
|
|
1119
|
+
function find(arr, check) {
|
|
1120
|
+
if (Array.prototype.find) {
|
|
1121
|
+
return arr.find(check);
|
|
1122
|
+
}
|
|
1123
|
+
return arr.filter(check)[0];
|
|
1124
|
+
}
|
|
1125
|
+
function findIndex(arr, prop, value) {
|
|
1126
|
+
if (Array.prototype.findIndex) {
|
|
1127
|
+
return arr.findIndex(function (cur) {
|
|
1128
|
+
return cur[prop] === value;
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
var match = find(arr, function (obj) {
|
|
1132
|
+
return obj[prop] === value;
|
|
1133
|
+
});
|
|
1134
|
+
return arr.indexOf(match);
|
|
1135
|
+
}
|
|
1136
|
+
function runModifiers(modifiers, data, ends) {
|
|
1137
|
+
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
|
|
1138
|
+
modifiersToRun.forEach(function (modifier) {
|
|
1139
|
+
if (modifier['function']) {
|
|
1140
|
+
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
|
1141
|
+
}
|
|
1142
|
+
var fn = modifier['function'] || modifier.fn;
|
|
1143
|
+
if (modifier.enabled && isFunction(fn)) {
|
|
1144
|
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
1145
|
+
data.offsets.reference = getClientRect(data.offsets.reference);
|
|
1146
|
+
data = fn(data, modifier);
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
return data;
|
|
1150
|
+
}
|
|
1151
|
+
function _update() {
|
|
1152
|
+
if (this.state.isDestroyed) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
var data = {
|
|
1156
|
+
instance: this,
|
|
1157
|
+
styles: {},
|
|
1158
|
+
arrowStyles: {},
|
|
1159
|
+
attributes: {},
|
|
1160
|
+
flipped: false,
|
|
1161
|
+
offsets: {}
|
|
1162
|
+
};
|
|
1163
|
+
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
|
|
1164
|
+
data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
|
|
1165
|
+
data.originalPlacement = data.placement;
|
|
1166
|
+
data.positionFixed = this.options.positionFixed;
|
|
1167
|
+
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
|
|
1168
|
+
data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
|
|
1169
|
+
data = runModifiers(this.modifiers, data);
|
|
1170
|
+
if (!this.state.isCreated) {
|
|
1171
|
+
this.state.isCreated = true;
|
|
1172
|
+
this.options.onCreate(data);
|
|
1173
|
+
} else {
|
|
1174
|
+
this.options.onUpdate(data);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function isModifierEnabled(modifiers, modifierName) {
|
|
1178
|
+
return modifiers.some(function (_ref3) {
|
|
1179
|
+
var name = _ref3.name,
|
|
1180
|
+
enabled = _ref3.enabled;
|
|
1181
|
+
return enabled && name === modifierName;
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
function getSupportedPropertyName(property) {
|
|
1185
|
+
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
|
|
1186
|
+
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
|
|
1187
|
+
for (var _i = 0; _i < prefixes.length; _i++) {
|
|
1188
|
+
var prefix = prefixes[_i];
|
|
1189
|
+
var toCheck = prefix ? "".concat(prefix).concat(upperProp) : property;
|
|
1190
|
+
if (typeof document.body.style[toCheck] !== 'undefined') {
|
|
1191
|
+
return toCheck;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return null;
|
|
1195
|
+
}
|
|
1196
|
+
function _destroy() {
|
|
1197
|
+
this.state.isDestroyed = true;
|
|
1198
|
+
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
|
|
1199
|
+
this.popper.removeAttribute('x-placement');
|
|
1200
|
+
this.popper.style.position = '';
|
|
1201
|
+
this.popper.style.top = '';
|
|
1202
|
+
this.popper.style.left = '';
|
|
1203
|
+
this.popper.style.right = '';
|
|
1204
|
+
this.popper.style.bottom = '';
|
|
1205
|
+
this.popper.style.willChange = '';
|
|
1206
|
+
this.popper.style[getSupportedPropertyName('transform')] = '';
|
|
1207
|
+
}
|
|
1208
|
+
this.disableEventListeners();
|
|
1209
|
+
if (this.options.removeOnDestroy) {
|
|
1210
|
+
this.popper.parentNode.removeChild(this.popper);
|
|
1211
|
+
}
|
|
1212
|
+
return this;
|
|
1213
|
+
}
|
|
1214
|
+
function getWindow(element) {
|
|
1215
|
+
var ownerDocument = element.ownerDocument;
|
|
1216
|
+
return ownerDocument ? ownerDocument.defaultView : window;
|
|
1217
|
+
}
|
|
1218
|
+
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
|
|
1219
|
+
var isBody = scrollParent.nodeName === 'BODY';
|
|
1220
|
+
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
|
|
1221
|
+
target.addEventListener(event, callback, {
|
|
1222
|
+
passive: true
|
|
1223
|
+
});
|
|
1224
|
+
if (!isBody) {
|
|
1225
|
+
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
|
|
1226
|
+
}
|
|
1227
|
+
scrollParents.push(target);
|
|
1228
|
+
}
|
|
1229
|
+
function setupEventListeners(reference, options, state, updateBound) {
|
|
1230
|
+
state.updateBound = updateBound;
|
|
1231
|
+
getWindow(reference).addEventListener('resize', state.updateBound, {
|
|
1232
|
+
passive: true
|
|
1233
|
+
});
|
|
1234
|
+
var scrollElement = getScrollParent(reference);
|
|
1235
|
+
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
|
1236
|
+
state.scrollElement = scrollElement;
|
|
1237
|
+
state.eventsEnabled = true;
|
|
1238
|
+
return state;
|
|
1239
|
+
}
|
|
1240
|
+
function _enableEventListeners() {
|
|
1241
|
+
if (!this.state.eventsEnabled) {
|
|
1242
|
+
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
function removeEventListeners(reference, state) {
|
|
1246
|
+
getWindow(reference).removeEventListener('resize', state.updateBound);
|
|
1247
|
+
state.scrollParents.forEach(function (target) {
|
|
1248
|
+
target.removeEventListener('scroll', state.updateBound);
|
|
1249
|
+
});
|
|
1250
|
+
state.updateBound = null;
|
|
1251
|
+
state.scrollParents = [];
|
|
1252
|
+
state.scrollElement = null;
|
|
1253
|
+
state.eventsEnabled = false;
|
|
1254
|
+
return state;
|
|
1255
|
+
}
|
|
1256
|
+
function _disableEventListeners() {
|
|
1257
|
+
if (this.state.eventsEnabled) {
|
|
1258
|
+
cancelAnimationFrame(this.scheduleUpdate);
|
|
1259
|
+
this.state = removeEventListeners(this.reference, this.state);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
function isNumeric(n) {
|
|
1263
|
+
return n !== '' && !isNaN(_parseFloat$2(n)) && isFinite(n);
|
|
1264
|
+
}
|
|
1265
|
+
function setStyles(element, styles) {
|
|
1266
|
+
keys$1(styles).forEach(function (prop) {
|
|
1267
|
+
var unit = '';
|
|
1268
|
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
|
|
1269
|
+
unit = 'px';
|
|
1270
|
+
}
|
|
1271
|
+
element.style[prop] = styles[prop] + unit;
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
function setAttributes(element, attributes) {
|
|
1275
|
+
keys$1(attributes).forEach(function (prop) {
|
|
1276
|
+
var value = attributes[prop];
|
|
1277
|
+
if (value !== false) {
|
|
1278
|
+
element.setAttribute(prop, attributes[prop]);
|
|
1279
|
+
} else {
|
|
1280
|
+
element.removeAttribute(prop);
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
function applyStyle(data) {
|
|
1285
|
+
setStyles(data.instance.popper, data.styles);
|
|
1286
|
+
setAttributes(data.instance.popper, data.attributes);
|
|
1287
|
+
if (data.arrowElement && keys$1(data.arrowStyles).length) {
|
|
1288
|
+
setStyles(data.arrowElement, data.arrowStyles);
|
|
1289
|
+
}
|
|
1290
|
+
return data;
|
|
1291
|
+
}
|
|
1292
|
+
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
|
|
1293
|
+
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
|
1294
|
+
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
|
1295
|
+
popper.setAttribute('x-placement', placement);
|
|
1296
|
+
setStyles(popper, {
|
|
1297
|
+
position: options.positionFixed ? 'fixed' : 'absolute'
|
|
1298
|
+
});
|
|
1299
|
+
return options;
|
|
1300
|
+
}
|
|
1301
|
+
function getRoundedOffsets(data, shouldRound) {
|
|
1302
|
+
var _data$offsets = data.offsets,
|
|
1303
|
+
popper = _data$offsets.popper,
|
|
1304
|
+
reference = _data$offsets.reference;
|
|
1305
|
+
var round = Math.round,
|
|
1306
|
+
floor = Math.floor;
|
|
1307
|
+
var noRound = function noRound(v) {
|
|
1308
|
+
return v;
|
|
1309
|
+
};
|
|
1310
|
+
var referenceWidth = round(reference.width);
|
|
1311
|
+
var popperWidth = round(popper.width);
|
|
1312
|
+
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
|
1313
|
+
var isVariation = data.placement.indexOf('-') !== -1;
|
|
1314
|
+
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
|
1315
|
+
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
|
1316
|
+
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
|
1317
|
+
var verticalToInteger = !shouldRound ? noRound : round;
|
|
1318
|
+
return {
|
|
1319
|
+
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
|
1320
|
+
top: verticalToInteger(popper.top),
|
|
1321
|
+
bottom: verticalToInteger(popper.bottom),
|
|
1322
|
+
right: horizontalToInteger(popper.right)
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
|
|
1326
|
+
function computeStyle(data, options) {
|
|
1327
|
+
var x = options.x,
|
|
1328
|
+
y = options.y;
|
|
1329
|
+
var popper = data.offsets.popper;
|
|
1330
|
+
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
|
|
1331
|
+
return modifier.name === 'applyStyle';
|
|
1332
|
+
}).gpuAcceleration;
|
|
1333
|
+
if (legacyGpuAccelerationOption !== undefined) {
|
|
1334
|
+
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
|
1335
|
+
}
|
|
1336
|
+
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
|
1337
|
+
var offsetParent = getOffsetParent(data.instance.popper);
|
|
1338
|
+
var offsetParentRect = getBoundingClientRect(offsetParent);
|
|
1339
|
+
var styles = {
|
|
1340
|
+
position: popper.position
|
|
1341
|
+
};
|
|
1342
|
+
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
|
1343
|
+
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
|
1344
|
+
var sideB = y === 'right' ? 'left' : 'right';
|
|
1345
|
+
var prefixedProperty = getSupportedPropertyName('transform');
|
|
1346
|
+
var left, top;
|
|
1347
|
+
if (sideA === 'bottom') {
|
|
1348
|
+
if (offsetParent.nodeName === 'HTML') {
|
|
1349
|
+
top = -offsetParent.clientHeight + offsets.bottom;
|
|
1350
|
+
} else {
|
|
1351
|
+
top = -offsetParentRect.height + offsets.bottom;
|
|
1352
|
+
}
|
|
1353
|
+
} else {
|
|
1354
|
+
top = offsets.top;
|
|
1355
|
+
}
|
|
1356
|
+
if (sideB === 'right') {
|
|
1357
|
+
if (offsetParent.nodeName === 'HTML') {
|
|
1358
|
+
left = -offsetParent.clientWidth + offsets.right;
|
|
1359
|
+
} else {
|
|
1360
|
+
left = -offsetParentRect.width + offsets.right;
|
|
1361
|
+
}
|
|
1362
|
+
} else {
|
|
1363
|
+
left = offsets.left;
|
|
1364
|
+
}
|
|
1365
|
+
if (gpuAcceleration && prefixedProperty) {
|
|
1366
|
+
styles[prefixedProperty] = "translate3d(".concat(left, "px, ").concat(top, "px, 0)");
|
|
1367
|
+
styles[sideA] = 0;
|
|
1368
|
+
styles[sideB] = 0;
|
|
1369
|
+
} else {
|
|
1370
|
+
var invertTop = sideA === 'bottom' ? -1 : 1;
|
|
1371
|
+
var invertLeft = sideB === 'right' ? -1 : 1;
|
|
1372
|
+
styles[sideA] = top * invertTop;
|
|
1373
|
+
styles[sideB] = left * invertLeft;
|
|
1374
|
+
}
|
|
1375
|
+
var attributes = {
|
|
1376
|
+
'x-placement': data.placement
|
|
1377
|
+
};
|
|
1378
|
+
data.attributes = _extends$1({}, attributes, data.attributes);
|
|
1379
|
+
data.styles = _extends$1({}, styles, data.styles);
|
|
1380
|
+
data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
|
|
1381
|
+
return data;
|
|
1382
|
+
}
|
|
1383
|
+
function isModifierRequired(modifiers, requestingName, requestedName) {
|
|
1384
|
+
var requesting = find(modifiers, function (_ref4) {
|
|
1385
|
+
var name = _ref4.name;
|
|
1386
|
+
return name === requestingName;
|
|
1387
|
+
});
|
|
1388
|
+
var isRequired = !!requesting && modifiers.some(function (modifier) {
|
|
1389
|
+
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
|
|
1390
|
+
});
|
|
1391
|
+
if (!isRequired) {
|
|
1392
|
+
var _requesting = "`".concat(requestingName, "`");
|
|
1393
|
+
var requested = "`".concat(requestedName, "`");
|
|
1394
|
+
console.warn("".concat(requested, " modifier is required by ").concat(_requesting, " modifier in order to work, be sure to include it before ").concat(_requesting, "!"));
|
|
1395
|
+
}
|
|
1396
|
+
return isRequired;
|
|
1397
|
+
}
|
|
1398
|
+
function arrow(data, options) {
|
|
1399
|
+
var _data$offsets$arrow;
|
|
1400
|
+
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
|
|
1401
|
+
return data;
|
|
1402
|
+
}
|
|
1403
|
+
var arrowElement = options.element;
|
|
1404
|
+
if (typeof arrowElement === 'string') {
|
|
1405
|
+
arrowElement = data.instance.popper.querySelector(arrowElement);
|
|
1406
|
+
if (!arrowElement) {
|
|
1407
|
+
return data;
|
|
1408
|
+
}
|
|
1409
|
+
} else {
|
|
1410
|
+
if (!data.instance.popper.contains(arrowElement)) {
|
|
1411
|
+
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
|
1412
|
+
return data;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
var placement = data.placement.split('-')[0];
|
|
1416
|
+
var _data$offsets2 = data.offsets,
|
|
1417
|
+
popper = _data$offsets2.popper,
|
|
1418
|
+
reference = _data$offsets2.reference;
|
|
1419
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
1420
|
+
var len = isVertical ? 'height' : 'width';
|
|
1421
|
+
var sideCapitalized = isVertical ? 'Top' : 'Left';
|
|
1422
|
+
var side = sideCapitalized.toLowerCase();
|
|
1423
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
1424
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
1425
|
+
var arrowElementSize = getOuterSizes(arrowElement)[len];
|
|
1426
|
+
if (reference[opSide] - arrowElementSize < popper[side]) {
|
|
1427
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
|
|
1428
|
+
}
|
|
1429
|
+
if (reference[side] + arrowElementSize > popper[opSide]) {
|
|
1430
|
+
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
|
|
1431
|
+
}
|
|
1432
|
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
1433
|
+
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
|
|
1434
|
+
var css = getStyleComputedProperty(data.instance.popper);
|
|
1435
|
+
var popperMarginSide = _parseFloat$2(css["margin".concat(sideCapitalized)], 10);
|
|
1436
|
+
var popperBorderSide = _parseFloat$2(css["border".concat(sideCapitalized, "Width")], 10);
|
|
1437
|
+
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
|
1438
|
+
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
|
|
1439
|
+
data.arrowElement = arrowElement;
|
|
1440
|
+
data.offsets.arrow = (_data$offsets$arrow = {}, _defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), _defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
|
|
1441
|
+
return data;
|
|
1442
|
+
}
|
|
1443
|
+
function getOppositeVariation(variation) {
|
|
1444
|
+
if (variation === 'end') {
|
|
1445
|
+
return 'start';
|
|
1446
|
+
} else if (variation === 'start') {
|
|
1447
|
+
return 'end';
|
|
1448
|
+
}
|
|
1449
|
+
return variation;
|
|
1450
|
+
}
|
|
1451
|
+
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
|
1452
|
+
var validPlacements = placements.slice(3);
|
|
1453
|
+
function clockwise(placement) {
|
|
1454
|
+
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1455
|
+
var index = validPlacements.indexOf(placement);
|
|
1456
|
+
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
|
1457
|
+
return counter ? arr.reverse() : arr;
|
|
1458
|
+
}
|
|
1459
|
+
var BEHAVIORS = {
|
|
1460
|
+
FLIP: 'flip',
|
|
1461
|
+
CLOCKWISE: 'clockwise',
|
|
1462
|
+
COUNTERCLOCKWISE: 'counterclockwise'
|
|
1463
|
+
};
|
|
1464
|
+
function flip(data, options) {
|
|
1465
|
+
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
|
1466
|
+
return data;
|
|
1467
|
+
}
|
|
1468
|
+
if (data.flipped && data.placement === data.originalPlacement) {
|
|
1469
|
+
return data;
|
|
1470
|
+
}
|
|
1471
|
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
|
1472
|
+
var placement = data.placement.split('-')[0];
|
|
1473
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
1474
|
+
var variation = data.placement.split('-')[1] || '';
|
|
1475
|
+
var flipOrder = [];
|
|
1476
|
+
switch (options.behavior) {
|
|
1477
|
+
case BEHAVIORS.FLIP:
|
|
1478
|
+
flipOrder = [placement, placementOpposite];
|
|
1479
|
+
break;
|
|
1480
|
+
case BEHAVIORS.CLOCKWISE:
|
|
1481
|
+
flipOrder = clockwise(placement);
|
|
1482
|
+
break;
|
|
1483
|
+
case BEHAVIORS.COUNTERCLOCKWISE:
|
|
1484
|
+
flipOrder = clockwise(placement, true);
|
|
1485
|
+
break;
|
|
1486
|
+
default:
|
|
1487
|
+
flipOrder = options.behavior;
|
|
1488
|
+
}
|
|
1489
|
+
flipOrder.forEach(function (step, index) {
|
|
1490
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
1491
|
+
return data;
|
|
1492
|
+
}
|
|
1493
|
+
placement = data.placement.split('-')[0];
|
|
1494
|
+
placementOpposite = getOppositePlacement(placement);
|
|
1495
|
+
var popperOffsets = data.offsets.popper;
|
|
1496
|
+
var refOffsets = data.offsets.reference;
|
|
1497
|
+
var floor = Math.floor;
|
|
1498
|
+
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
|
|
1499
|
+
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
|
|
1500
|
+
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
|
|
1501
|
+
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
|
|
1502
|
+
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
|
|
1503
|
+
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
|
1504
|
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
1505
|
+
var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
|
|
1506
|
+
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
|
1507
|
+
var flippedVariation = flippedVariationByRef || flippedVariationByContent;
|
|
1508
|
+
if (overlapsRef || overflowsBoundaries || flippedVariation) {
|
|
1509
|
+
data.flipped = true;
|
|
1510
|
+
if (overlapsRef || overflowsBoundaries) {
|
|
1511
|
+
placement = flipOrder[index + 1];
|
|
1512
|
+
}
|
|
1513
|
+
if (flippedVariation) {
|
|
1514
|
+
variation = getOppositeVariation(variation);
|
|
1515
|
+
}
|
|
1516
|
+
data.placement = placement + (variation ? '-' + variation : '');
|
|
1517
|
+
data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
1518
|
+
data = runModifiers(data.instance.modifiers, data, 'flip');
|
|
1519
|
+
}
|
|
1520
|
+
});
|
|
1521
|
+
return data;
|
|
1522
|
+
}
|
|
1523
|
+
function keepTogether(data) {
|
|
1524
|
+
var _data$offsets3 = data.offsets,
|
|
1525
|
+
popper = _data$offsets3.popper,
|
|
1526
|
+
reference = _data$offsets3.reference;
|
|
1527
|
+
var placement = data.placement.split('-')[0];
|
|
1528
|
+
var floor = Math.floor;
|
|
1529
|
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
1530
|
+
var side = isVertical ? 'right' : 'bottom';
|
|
1531
|
+
var opSide = isVertical ? 'left' : 'top';
|
|
1532
|
+
var measurement = isVertical ? 'width' : 'height';
|
|
1533
|
+
if (popper[side] < floor(reference[opSide])) {
|
|
1534
|
+
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
|
|
1535
|
+
}
|
|
1536
|
+
if (popper[opSide] > floor(reference[side])) {
|
|
1537
|
+
data.offsets.popper[opSide] = floor(reference[side]);
|
|
1538
|
+
}
|
|
1539
|
+
return data;
|
|
1540
|
+
}
|
|
1541
|
+
function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
|
1542
|
+
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
|
|
1543
|
+
var value = +split[1];
|
|
1544
|
+
var unit = split[2];
|
|
1545
|
+
if (!value) {
|
|
1546
|
+
return str;
|
|
1547
|
+
}
|
|
1548
|
+
if (unit.indexOf('%') === 0) {
|
|
1549
|
+
var element;
|
|
1550
|
+
switch (unit) {
|
|
1551
|
+
case '%p':
|
|
1552
|
+
element = popperOffsets;
|
|
1553
|
+
break;
|
|
1554
|
+
case '%':
|
|
1555
|
+
case '%r':
|
|
1556
|
+
default:
|
|
1557
|
+
element = referenceOffsets;
|
|
1558
|
+
}
|
|
1559
|
+
var rect = getClientRect(element);
|
|
1560
|
+
return rect[measurement] / 100 * value;
|
|
1561
|
+
} else if (unit === 'vh' || unit === 'vw') {
|
|
1562
|
+
var size;
|
|
1563
|
+
if (unit === 'vh') {
|
|
1564
|
+
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
1565
|
+
} else {
|
|
1566
|
+
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
1567
|
+
}
|
|
1568
|
+
return size / 100 * value;
|
|
1569
|
+
} else {
|
|
1570
|
+
return value;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
|
1574
|
+
var offsets = [0, 0];
|
|
1575
|
+
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
|
|
1576
|
+
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
|
1577
|
+
return frag.trim();
|
|
1578
|
+
});
|
|
1579
|
+
var divider = fragments.indexOf(find(fragments, function (frag) {
|
|
1580
|
+
return frag.search(/,|\s/) !== -1;
|
|
1581
|
+
}));
|
|
1582
|
+
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
|
|
1583
|
+
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
|
1584
|
+
}
|
|
1585
|
+
var splitRegex = /\s*,\s*|\s+/;
|
|
1586
|
+
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
|
|
1587
|
+
ops = ops.map(function (op, index) {
|
|
1588
|
+
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
|
|
1589
|
+
var mergeWithPrevious = false;
|
|
1590
|
+
return op
|
|
1591
|
+
.reduce(function (a, b) {
|
|
1592
|
+
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
|
|
1593
|
+
a[a.length - 1] = b;
|
|
1594
|
+
mergeWithPrevious = true;
|
|
1595
|
+
return a;
|
|
1596
|
+
} else if (mergeWithPrevious) {
|
|
1597
|
+
a[a.length - 1] += b;
|
|
1598
|
+
mergeWithPrevious = false;
|
|
1599
|
+
return a;
|
|
1600
|
+
} else {
|
|
1601
|
+
return a.concat(b);
|
|
1602
|
+
}
|
|
1603
|
+
}, [])
|
|
1604
|
+
.map(function (str) {
|
|
1605
|
+
return toValue(str, measurement, popperOffsets, referenceOffsets);
|
|
1606
|
+
});
|
|
1607
|
+
});
|
|
1608
|
+
ops.forEach(function (op, index) {
|
|
1609
|
+
op.forEach(function (frag, index2) {
|
|
1610
|
+
if (isNumeric(frag)) {
|
|
1611
|
+
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
});
|
|
1615
|
+
return offsets;
|
|
1616
|
+
}
|
|
1617
|
+
function offset(data, _ref5) {
|
|
1618
|
+
var offset = _ref5.offset;
|
|
1619
|
+
var placement = data.placement,
|
|
1620
|
+
_data$offsets4 = data.offsets,
|
|
1621
|
+
popper = _data$offsets4.popper,
|
|
1622
|
+
reference = _data$offsets4.reference;
|
|
1623
|
+
var basePlacement = placement.split('-')[0];
|
|
1624
|
+
var offsets;
|
|
1625
|
+
if (isNumeric(+offset)) {
|
|
1626
|
+
offsets = [+offset, 0];
|
|
1627
|
+
} else {
|
|
1628
|
+
offsets = parseOffset(offset, popper, reference, basePlacement);
|
|
1629
|
+
}
|
|
1630
|
+
if (basePlacement === 'left') {
|
|
1631
|
+
popper.top += offsets[0];
|
|
1632
|
+
popper.left -= offsets[1];
|
|
1633
|
+
} else if (basePlacement === 'right') {
|
|
1634
|
+
popper.top += offsets[0];
|
|
1635
|
+
popper.left += offsets[1];
|
|
1636
|
+
} else if (basePlacement === 'top') {
|
|
1637
|
+
popper.left += offsets[0];
|
|
1638
|
+
popper.top -= offsets[1];
|
|
1639
|
+
} else if (basePlacement === 'bottom') {
|
|
1640
|
+
popper.left += offsets[0];
|
|
1641
|
+
popper.top += offsets[1];
|
|
1642
|
+
}
|
|
1643
|
+
data.popper = popper;
|
|
1644
|
+
return data;
|
|
1645
|
+
}
|
|
1646
|
+
function preventOverflow(data, options) {
|
|
1647
|
+
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
|
|
1648
|
+
if (data.instance.reference === boundariesElement) {
|
|
1649
|
+
boundariesElement = getOffsetParent(boundariesElement);
|
|
1650
|
+
}
|
|
1651
|
+
var transformProp = getSupportedPropertyName('transform');
|
|
1652
|
+
var popperStyles = data.instance.popper.style;
|
|
1653
|
+
var top = popperStyles.top,
|
|
1654
|
+
left = popperStyles.left,
|
|
1655
|
+
transform = popperStyles[transformProp];
|
|
1656
|
+
popperStyles.top = '';
|
|
1657
|
+
popperStyles.left = '';
|
|
1658
|
+
popperStyles[transformProp] = '';
|
|
1659
|
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
|
|
1660
|
+
popperStyles.top = top;
|
|
1661
|
+
popperStyles.left = left;
|
|
1662
|
+
popperStyles[transformProp] = transform;
|
|
1663
|
+
options.boundaries = boundaries;
|
|
1664
|
+
var order = options.priority;
|
|
1665
|
+
var popper = data.offsets.popper;
|
|
1666
|
+
var check = {
|
|
1667
|
+
primary: function primary(placement) {
|
|
1668
|
+
var value = popper[placement];
|
|
1669
|
+
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
|
|
1670
|
+
value = Math.max(popper[placement], boundaries[placement]);
|
|
1671
|
+
}
|
|
1672
|
+
return _defineProperty({}, placement, value);
|
|
1673
|
+
},
|
|
1674
|
+
secondary: function secondary(placement) {
|
|
1675
|
+
var mainSide = placement === 'right' ? 'left' : 'top';
|
|
1676
|
+
var value = popper[mainSide];
|
|
1677
|
+
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
|
|
1678
|
+
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
|
|
1679
|
+
}
|
|
1680
|
+
return _defineProperty({}, mainSide, value);
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
order.forEach(function (placement) {
|
|
1684
|
+
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
|
1685
|
+
popper = _extends$1({}, popper, check[side](placement));
|
|
1686
|
+
});
|
|
1687
|
+
data.offsets.popper = popper;
|
|
1688
|
+
return data;
|
|
1689
|
+
}
|
|
1690
|
+
function shift(data) {
|
|
1691
|
+
var placement = data.placement;
|
|
1692
|
+
var basePlacement = placement.split('-')[0];
|
|
1693
|
+
var shiftvariation = placement.split('-')[1];
|
|
1694
|
+
if (shiftvariation) {
|
|
1695
|
+
var _data$offsets5 = data.offsets,
|
|
1696
|
+
reference = _data$offsets5.reference,
|
|
1697
|
+
popper = _data$offsets5.popper;
|
|
1698
|
+
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
|
|
1699
|
+
var side = isVertical ? 'left' : 'top';
|
|
1700
|
+
var measurement = isVertical ? 'width' : 'height';
|
|
1701
|
+
var shiftOffsets = {
|
|
1702
|
+
start: _defineProperty({}, side, reference[side]),
|
|
1703
|
+
end: _defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
|
1704
|
+
};
|
|
1705
|
+
data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
|
|
1706
|
+
}
|
|
1707
|
+
return data;
|
|
1708
|
+
}
|
|
1709
|
+
function hide(data) {
|
|
1710
|
+
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
|
|
1711
|
+
return data;
|
|
1712
|
+
}
|
|
1713
|
+
var refRect = data.offsets.reference;
|
|
1714
|
+
var bound = find(data.instance.modifiers, function (modifier) {
|
|
1715
|
+
return modifier.name === 'preventOverflow';
|
|
1716
|
+
}).boundaries;
|
|
1717
|
+
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
|
|
1718
|
+
if (data.hide === true) {
|
|
1719
|
+
return data;
|
|
1720
|
+
}
|
|
1721
|
+
data.hide = true;
|
|
1722
|
+
data.attributes['x-out-of-boundaries'] = '';
|
|
1723
|
+
} else {
|
|
1724
|
+
if (data.hide === false) {
|
|
1725
|
+
return data;
|
|
1726
|
+
}
|
|
1727
|
+
data.hide = false;
|
|
1728
|
+
data.attributes['x-out-of-boundaries'] = false;
|
|
1729
|
+
}
|
|
1730
|
+
return data;
|
|
1731
|
+
}
|
|
1732
|
+
function inner(data) {
|
|
1733
|
+
var placement = data.placement;
|
|
1734
|
+
var basePlacement = placement.split('-')[0];
|
|
1735
|
+
var _data$offsets6 = data.offsets,
|
|
1736
|
+
popper = _data$offsets6.popper,
|
|
1737
|
+
reference = _data$offsets6.reference;
|
|
1738
|
+
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
|
|
1739
|
+
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
|
|
1740
|
+
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
|
|
1741
|
+
data.placement = getOppositePlacement(placement);
|
|
1742
|
+
data.offsets.popper = getClientRect(popper);
|
|
1743
|
+
return data;
|
|
1744
|
+
}
|
|
1745
|
+
var modifiers = {
|
|
1746
|
+
shift: {
|
|
1747
|
+
order: 100,
|
|
1748
|
+
enabled: true,
|
|
1749
|
+
fn: shift
|
|
1750
|
+
},
|
|
1751
|
+
offset: {
|
|
1752
|
+
order: 200,
|
|
1753
|
+
enabled: true,
|
|
1754
|
+
fn: offset,
|
|
1755
|
+
offset: 0
|
|
1756
|
+
},
|
|
1757
|
+
preventOverflow: {
|
|
1758
|
+
order: 300,
|
|
1759
|
+
enabled: true,
|
|
1760
|
+
fn: preventOverflow,
|
|
1761
|
+
priority: ['left', 'right', 'top', 'bottom'],
|
|
1762
|
+
padding: 5,
|
|
1763
|
+
boundariesElement: 'scrollParent'
|
|
1764
|
+
},
|
|
1765
|
+
keepTogether: {
|
|
1766
|
+
order: 400,
|
|
1767
|
+
enabled: true,
|
|
1768
|
+
fn: keepTogether
|
|
1769
|
+
},
|
|
1770
|
+
arrow: {
|
|
1771
|
+
order: 500,
|
|
1772
|
+
enabled: true,
|
|
1773
|
+
fn: arrow,
|
|
1774
|
+
element: '[x-arrow]'
|
|
1775
|
+
},
|
|
1776
|
+
flip: {
|
|
1777
|
+
order: 600,
|
|
1778
|
+
enabled: true,
|
|
1779
|
+
fn: flip,
|
|
1780
|
+
behavior: 'flip',
|
|
1781
|
+
padding: 5,
|
|
1782
|
+
boundariesElement: 'viewport',
|
|
1783
|
+
flipVariations: false,
|
|
1784
|
+
flipVariationsByContent: false
|
|
1785
|
+
},
|
|
1786
|
+
inner: {
|
|
1787
|
+
order: 700,
|
|
1788
|
+
enabled: false,
|
|
1789
|
+
fn: inner
|
|
1790
|
+
},
|
|
1791
|
+
hide: {
|
|
1792
|
+
order: 800,
|
|
1793
|
+
enabled: true,
|
|
1794
|
+
fn: hide
|
|
1795
|
+
},
|
|
1796
|
+
computeStyle: {
|
|
1797
|
+
order: 850,
|
|
1798
|
+
enabled: true,
|
|
1799
|
+
fn: computeStyle,
|
|
1800
|
+
gpuAcceleration: true,
|
|
1801
|
+
x: 'bottom',
|
|
1802
|
+
y: 'right'
|
|
1803
|
+
},
|
|
1804
|
+
applyStyle: {
|
|
1805
|
+
order: 900,
|
|
1806
|
+
enabled: true,
|
|
1807
|
+
fn: applyStyle,
|
|
1808
|
+
onLoad: applyStyleOnLoad,
|
|
1809
|
+
gpuAcceleration: undefined
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
var Defaults = {
|
|
1813
|
+
placement: 'bottom',
|
|
1814
|
+
positionFixed: false,
|
|
1815
|
+
eventsEnabled: true,
|
|
1816
|
+
removeOnDestroy: false,
|
|
1817
|
+
onCreate: function onCreate() {},
|
|
1818
|
+
onUpdate: function onUpdate() {},
|
|
1819
|
+
modifiers: modifiers
|
|
1820
|
+
};
|
|
1821
|
+
var Popper = function () {
|
|
1822
|
+
function Popper(reference, popper) {
|
|
1823
|
+
var _this = this;
|
|
1824
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1825
|
+
_classCallCheck(this, Popper);
|
|
1826
|
+
this.scheduleUpdate = function () {
|
|
1827
|
+
return requestAnimationFrame(_this.update);
|
|
1828
|
+
};
|
|
1829
|
+
this.update = debounce(this.update.bind(this));
|
|
1830
|
+
this.options = _extends$1({}, Popper.Defaults, options);
|
|
1831
|
+
this.state = {
|
|
1832
|
+
isDestroyed: false,
|
|
1833
|
+
isCreated: false,
|
|
1834
|
+
scrollParents: []
|
|
1835
|
+
};
|
|
1836
|
+
this.reference = reference && reference.jquery ? reference[0] : reference;
|
|
1837
|
+
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
1838
|
+
this.options.modifiers = {};
|
|
1839
|
+
keys$1(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
|
1840
|
+
_this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
1841
|
+
});
|
|
1842
|
+
this.modifiers = keys$1(this.options.modifiers).map(function (name) {
|
|
1843
|
+
return _extends$1({
|
|
1844
|
+
name: name
|
|
1845
|
+
}, _this.options.modifiers[name]);
|
|
1846
|
+
})
|
|
1847
|
+
.sort(function (a, b) {
|
|
1848
|
+
return a.order - b.order;
|
|
1849
|
+
});
|
|
1850
|
+
this.modifiers.forEach(function (modifierOptions) {
|
|
1851
|
+
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
|
|
1852
|
+
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
this.update();
|
|
1856
|
+
var eventsEnabled = this.options.eventsEnabled;
|
|
1857
|
+
if (eventsEnabled) {
|
|
1858
|
+
this.enableEventListeners();
|
|
1859
|
+
}
|
|
1860
|
+
this.state.eventsEnabled = eventsEnabled;
|
|
1861
|
+
}
|
|
1862
|
+
_createClass(Popper, [{
|
|
1863
|
+
key: "update",
|
|
1864
|
+
value: function update() {
|
|
1865
|
+
return _update.call(this);
|
|
1866
|
+
}
|
|
1867
|
+
}, {
|
|
1868
|
+
key: "destroy",
|
|
1869
|
+
value: function destroy() {
|
|
1870
|
+
return _destroy.call(this);
|
|
1871
|
+
}
|
|
1872
|
+
}, {
|
|
1873
|
+
key: "enableEventListeners",
|
|
1874
|
+
value: function enableEventListeners() {
|
|
1875
|
+
return _enableEventListeners.call(this);
|
|
1876
|
+
}
|
|
1877
|
+
}, {
|
|
1878
|
+
key: "disableEventListeners",
|
|
1879
|
+
value: function disableEventListeners() {
|
|
1880
|
+
return _disableEventListeners.call(this);
|
|
1881
|
+
}
|
|
1882
|
+
}]);
|
|
1883
|
+
return Popper;
|
|
1884
|
+
}();
|
|
1885
|
+
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
|
|
1886
|
+
Popper.placements = placements;
|
|
1887
|
+
Popper.Defaults = Defaults;
|
|
1888
|
+
|
|
1889
|
+
var requestAnimationFrame$2 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
|
|
1890
|
+
window.setTimeout(callback, 1000 / 60);
|
|
1891
|
+
};
|
|
1892
|
+
var cancelAnimationFrame$2 = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {
|
|
1893
|
+
window.clearTimeout(id);
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
function _extends$2() {
|
|
1897
|
+
_extends$2 = assign$1 || function (target) {
|
|
1898
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1899
|
+
var source = arguments[i];
|
|
1900
|
+
for (var key in source) {
|
|
1901
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1902
|
+
target[key] = source[key];
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
return target;
|
|
1907
|
+
};
|
|
1908
|
+
return _extends$2.apply(this, arguments);
|
|
1909
|
+
}
|
|
1910
|
+
var version = "4.3.4";
|
|
1911
|
+
var isBrowser$1 = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1912
|
+
var ua = isBrowser$1 ? navigator.userAgent : '';
|
|
1913
|
+
var isIE$1 = /MSIE |Trident\//.test(ua);
|
|
1914
|
+
var isUCBrowser = /UCBrowser\//.test(ua);
|
|
1915
|
+
var isIOS = isBrowser$1 && /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream;
|
|
1916
|
+
var defaultProps = {
|
|
1917
|
+
a11y: true,
|
|
1918
|
+
allowHTML: true,
|
|
1919
|
+
animateFill: true,
|
|
1920
|
+
animation: 'shift-away',
|
|
1921
|
+
appendTo: function appendTo() {
|
|
1922
|
+
return document.body;
|
|
1923
|
+
},
|
|
1924
|
+
aria: 'describedby',
|
|
1925
|
+
arrow: false,
|
|
1926
|
+
arrowType: 'sharp',
|
|
1927
|
+
boundary: 'scrollParent',
|
|
1928
|
+
content: '',
|
|
1929
|
+
delay: 0,
|
|
1930
|
+
distance: 10,
|
|
1931
|
+
duration: [325, 275],
|
|
1932
|
+
flip: true,
|
|
1933
|
+
flipBehavior: 'flip',
|
|
1934
|
+
flipOnUpdate: false,
|
|
1935
|
+
followCursor: false,
|
|
1936
|
+
hideOnClick: true,
|
|
1937
|
+
ignoreAttributes: false,
|
|
1938
|
+
inertia: false,
|
|
1939
|
+
interactive: false,
|
|
1940
|
+
interactiveBorder: 2,
|
|
1941
|
+
interactiveDebounce: 0,
|
|
1942
|
+
lazy: true,
|
|
1943
|
+
width: 'auto',
|
|
1944
|
+
maxWidth: 'auto',
|
|
1945
|
+
multiple: false,
|
|
1946
|
+
offset: 0,
|
|
1947
|
+
onHidden: function onHidden() {},
|
|
1948
|
+
onHide: function onHide() {},
|
|
1949
|
+
onMount: function onMount() {},
|
|
1950
|
+
onShow: function onShow() {},
|
|
1951
|
+
onShown: function onShown() {},
|
|
1952
|
+
onTrigger: function onTrigger() {},
|
|
1953
|
+
placement: 'top',
|
|
1954
|
+
popperOptions: {},
|
|
1955
|
+
role: 'tooltip',
|
|
1956
|
+
showOnInit: false,
|
|
1957
|
+
size: 'regular',
|
|
1958
|
+
sticky: false,
|
|
1959
|
+
target: '',
|
|
1960
|
+
theme: 'dark',
|
|
1961
|
+
touch: true,
|
|
1962
|
+
touchHold: false,
|
|
1963
|
+
trigger: 'mouseenter focus',
|
|
1964
|
+
triggerTarget: null,
|
|
1965
|
+
updateDuration: 0,
|
|
1966
|
+
wait: null,
|
|
1967
|
+
zIndex: 9999,
|
|
1968
|
+
extCls: ''
|
|
1969
|
+
};
|
|
1970
|
+
var POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'arrowType', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions'];
|
|
1971
|
+
var elementProto = isBrowser$1 ? Element.prototype : {};
|
|
1972
|
+
var matches = elementProto.matches || elementProto.matchesSelector || elementProto.webkitMatchesSelector || elementProto.mozMatchesSelector || elementProto.msMatchesSelector;
|
|
1973
|
+
function arrayFrom(value) {
|
|
1974
|
+
return [].slice.call(value);
|
|
1975
|
+
}
|
|
1976
|
+
function closest(element, selector) {
|
|
1977
|
+
return closestCallback(element, function (el) {
|
|
1978
|
+
return matches.call(el, selector);
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1981
|
+
function closestCallback(element, callback) {
|
|
1982
|
+
while (element) {
|
|
1983
|
+
if (callback(element)) {
|
|
1984
|
+
return element;
|
|
1985
|
+
}
|
|
1986
|
+
element = element.parentElement;
|
|
1987
|
+
}
|
|
1988
|
+
return null;
|
|
1989
|
+
}
|
|
1990
|
+
var PASSIVE = {
|
|
1991
|
+
passive: true
|
|
1992
|
+
};
|
|
1993
|
+
var PADDING = 4;
|
|
1994
|
+
var PLACEMENT_ATTRIBUTE = 'x-placement';
|
|
1995
|
+
var OUT_OF_BOUNDARIES_ATTRIBUTE = 'x-out-of-boundaries';
|
|
1996
|
+
var IOS_CLASS = "tippy-iOS";
|
|
1997
|
+
var ACTIVE_CLASS = "tippy-active";
|
|
1998
|
+
var POPPER_CLASS = "tippy-popper";
|
|
1999
|
+
var TOOLTIP_CLASS = "tippy-tooltip";
|
|
2000
|
+
var CONTENT_CLASS = "tippy-content";
|
|
2001
|
+
var BACKDROP_CLASS = "tippy-backdrop";
|
|
2002
|
+
var ARROW_CLASS = "tippy-arrow";
|
|
2003
|
+
var ROUND_ARROW_CLASS = "tippy-roundarrow";
|
|
2004
|
+
var POPPER_SELECTOR = ".".concat(POPPER_CLASS);
|
|
2005
|
+
var TOOLTIP_SELECTOR = ".".concat(TOOLTIP_CLASS);
|
|
2006
|
+
var CONTENT_SELECTOR = ".".concat(CONTENT_CLASS);
|
|
2007
|
+
var BACKDROP_SELECTOR = ".".concat(BACKDROP_CLASS);
|
|
2008
|
+
var ARROW_SELECTOR = ".".concat(ARROW_CLASS);
|
|
2009
|
+
var ROUND_ARROW_SELECTOR = ".".concat(ROUND_ARROW_CLASS);
|
|
2010
|
+
var isUsingTouch = false;
|
|
2011
|
+
function onDocumentTouch() {
|
|
2012
|
+
if (isUsingTouch) {
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
2015
|
+
isUsingTouch = true;
|
|
2016
|
+
if (isIOS) {
|
|
2017
|
+
document.body.classList.add(IOS_CLASS);
|
|
2018
|
+
}
|
|
2019
|
+
if (window.performance) {
|
|
2020
|
+
document.addEventListener('mousemove', onDocumentMouseMove);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
var lastMouseMoveTime = 0;
|
|
2024
|
+
function onDocumentMouseMove() {
|
|
2025
|
+
var now = performance.now();
|
|
2026
|
+
if (now - lastMouseMoveTime < 20) {
|
|
2027
|
+
isUsingTouch = false;
|
|
2028
|
+
document.removeEventListener('mousemove', onDocumentMouseMove);
|
|
2029
|
+
if (!isIOS) {
|
|
2030
|
+
document.body.classList.remove(IOS_CLASS);
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
lastMouseMoveTime = now;
|
|
2034
|
+
}
|
|
2035
|
+
function onWindowBlur() {
|
|
2036
|
+
var _document = document,
|
|
2037
|
+
activeElement = _document.activeElement;
|
|
2038
|
+
if (activeElement && activeElement.blur && activeElement._tippy) {
|
|
2039
|
+
activeElement.blur();
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
function bindGlobalEventListeners() {
|
|
2043
|
+
document.addEventListener('touchstart', onDocumentTouch, PASSIVE);
|
|
2044
|
+
window.addEventListener('blur', onWindowBlur);
|
|
2045
|
+
}
|
|
2046
|
+
var keys$2 = keys$1(defaultProps);
|
|
2047
|
+
function getDataAttributeOptions(reference) {
|
|
2048
|
+
return keys$2.reduce(function (acc, key) {
|
|
2049
|
+
var valueAsString = (reference.getAttribute("data-tippy-".concat(key)) || '').trim();
|
|
2050
|
+
if (!valueAsString) {
|
|
2051
|
+
return acc;
|
|
2052
|
+
}
|
|
2053
|
+
if (key === 'content') {
|
|
2054
|
+
acc[key] = valueAsString;
|
|
2055
|
+
} else {
|
|
2056
|
+
try {
|
|
2057
|
+
acc[key] = JSON.parse(valueAsString);
|
|
2058
|
+
} catch (e) {
|
|
2059
|
+
acc[key] = valueAsString;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
return acc;
|
|
2063
|
+
}, {});
|
|
2064
|
+
}
|
|
2065
|
+
function polyfillElementPrototypeProperties(virtualReference) {
|
|
2066
|
+
var polyfills = {
|
|
2067
|
+
isVirtual: true,
|
|
2068
|
+
attributes: virtualReference.attributes || {},
|
|
2069
|
+
contains: function contains() {},
|
|
2070
|
+
setAttribute: function setAttribute(key, value) {
|
|
2071
|
+
virtualReference.attributes[key] = value;
|
|
2072
|
+
},
|
|
2073
|
+
getAttribute: function getAttribute(key) {
|
|
2074
|
+
return virtualReference.attributes[key];
|
|
2075
|
+
},
|
|
2076
|
+
removeAttribute: function removeAttribute(key) {
|
|
2077
|
+
delete virtualReference.attributes[key];
|
|
2078
|
+
},
|
|
2079
|
+
hasAttribute: function hasAttribute(key) {
|
|
2080
|
+
return key in virtualReference.attributes;
|
|
2081
|
+
},
|
|
2082
|
+
addEventListener: function addEventListener() {},
|
|
2083
|
+
removeEventListener: function removeEventListener() {},
|
|
2084
|
+
classList: {
|
|
2085
|
+
classNames: {},
|
|
2086
|
+
add: function add(key) {
|
|
2087
|
+
virtualReference.classList.classNames[key] = true;
|
|
2088
|
+
},
|
|
2089
|
+
remove: function remove(key) {
|
|
2090
|
+
delete virtualReference.classList.classNames[key];
|
|
2091
|
+
},
|
|
2092
|
+
contains: function contains(key) {
|
|
2093
|
+
return key in virtualReference.classList.classNames;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
for (var key in polyfills) {
|
|
2098
|
+
virtualReference[key] = polyfills[key];
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
function isBareVirtualElement(value) {
|
|
2102
|
+
return {}.toString.call(value) === '[object Object]' && !value.addEventListener;
|
|
2103
|
+
}
|
|
2104
|
+
function isReferenceElement(value) {
|
|
2105
|
+
return !!value._tippy && !matches.call(value, POPPER_SELECTOR);
|
|
2106
|
+
}
|
|
2107
|
+
function hasOwnProperty$1(obj, key) {
|
|
2108
|
+
return {}.hasOwnProperty.call(obj, key);
|
|
2109
|
+
}
|
|
2110
|
+
function getArrayOfElements(value) {
|
|
2111
|
+
if (isSingular(value)) {
|
|
2112
|
+
return [value];
|
|
2113
|
+
}
|
|
2114
|
+
if (value instanceof NodeList) {
|
|
2115
|
+
return arrayFrom(value);
|
|
2116
|
+
}
|
|
2117
|
+
if (isArray$1(value)) {
|
|
2118
|
+
return value;
|
|
2119
|
+
}
|
|
2120
|
+
try {
|
|
2121
|
+
return arrayFrom(document.querySelectorAll(value));
|
|
2122
|
+
} catch (e) {
|
|
2123
|
+
return [];
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
function getValue(value, index, defaultValue) {
|
|
2127
|
+
if (isArray$1(value)) {
|
|
2128
|
+
var v = value[index];
|
|
2129
|
+
return v == null ? defaultValue : v;
|
|
2130
|
+
}
|
|
2131
|
+
return value;
|
|
2132
|
+
}
|
|
2133
|
+
function debounce$1(fn, ms) {
|
|
2134
|
+
if (ms === 0) {
|
|
2135
|
+
return fn;
|
|
2136
|
+
}
|
|
2137
|
+
var timeout;
|
|
2138
|
+
return function (arg) {
|
|
2139
|
+
clearTimeout(timeout);
|
|
2140
|
+
timeout = setTimeout(function () {
|
|
2141
|
+
fn(arg);
|
|
2142
|
+
}, ms);
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
function getModifier(obj, key) {
|
|
2146
|
+
return obj && obj.modifiers && obj.modifiers[key];
|
|
2147
|
+
}
|
|
2148
|
+
function includes(a, b) {
|
|
2149
|
+
return a.indexOf(b) > -1;
|
|
2150
|
+
}
|
|
2151
|
+
function isRealElement(value) {
|
|
2152
|
+
return value instanceof Element;
|
|
2153
|
+
}
|
|
2154
|
+
function isSingular(value) {
|
|
2155
|
+
return !!(value && hasOwnProperty$1(value, 'isVirtual')) || isRealElement(value);
|
|
2156
|
+
}
|
|
2157
|
+
function innerHTML() {
|
|
2158
|
+
return 'innerHTML';
|
|
2159
|
+
}
|
|
2160
|
+
function invokeWithArgsOrReturn(value, args) {
|
|
2161
|
+
return typeof value === 'function' ? value.apply(null, args) : value;
|
|
2162
|
+
}
|
|
2163
|
+
function setFlipModifierEnabled(modifiers, value) {
|
|
2164
|
+
modifiers.filter(function (m) {
|
|
2165
|
+
return m.name === 'flip';
|
|
2166
|
+
})[0].enabled = value;
|
|
2167
|
+
}
|
|
2168
|
+
function canReceiveFocus(element) {
|
|
2169
|
+
return isRealElement(element) ? matches.call(element, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !element.hasAttribute('disabled') : true;
|
|
2170
|
+
}
|
|
2171
|
+
function div() {
|
|
2172
|
+
return document.createElement('div');
|
|
2173
|
+
}
|
|
2174
|
+
function setTransitionDuration(els, value) {
|
|
2175
|
+
els.forEach(function (el) {
|
|
2176
|
+
if (el) {
|
|
2177
|
+
el.style.transitionDuration = "".concat(value, "ms");
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
function setVisibilityState(els, state) {
|
|
2182
|
+
els.forEach(function (el) {
|
|
2183
|
+
if (el) {
|
|
2184
|
+
el.setAttribute('data-state', state);
|
|
2185
|
+
}
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
function evaluateProps(reference, props) {
|
|
2189
|
+
var out = _extends$2({}, props, {
|
|
2190
|
+
content: invokeWithArgsOrReturn(props.content, [reference])
|
|
2191
|
+
}, props.ignoreAttributes ? {} : getDataAttributeOptions(reference));
|
|
2192
|
+
if (out.arrow || isUCBrowser) {
|
|
2193
|
+
out.animateFill = false;
|
|
2194
|
+
}
|
|
2195
|
+
return out;
|
|
2196
|
+
}
|
|
2197
|
+
function validateOptions(options, defaultProps) {
|
|
2198
|
+
keys$1(options).forEach(function (option) {
|
|
2199
|
+
if (!hasOwnProperty$1(defaultProps, option)) {
|
|
2200
|
+
throw new Error("[tippy]: `".concat(option, "` is not a valid option"));
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
function setInnerHTML(element, html) {
|
|
2205
|
+
element[innerHTML()] = isRealElement(html) ? html[innerHTML()] : html;
|
|
2206
|
+
}
|
|
2207
|
+
function setContent(contentEl, props) {
|
|
2208
|
+
if (isRealElement(props.content)) {
|
|
2209
|
+
setInnerHTML(contentEl, '');
|
|
2210
|
+
contentEl.appendChild(props.content);
|
|
2211
|
+
} else if (typeof props.content !== 'function') {
|
|
2212
|
+
var key = props.allowHTML ? 'innerHTML' : 'textContent';
|
|
2213
|
+
contentEl[key] = props.content;
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
function getChildren(popper) {
|
|
2217
|
+
return {
|
|
2218
|
+
tooltip: popper.querySelector(TOOLTIP_SELECTOR),
|
|
2219
|
+
backdrop: popper.querySelector(BACKDROP_SELECTOR),
|
|
2220
|
+
content: popper.querySelector(CONTENT_SELECTOR),
|
|
2221
|
+
arrow: popper.querySelector(ARROW_SELECTOR) || popper.querySelector(ROUND_ARROW_SELECTOR)
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
function addInertia(tooltip) {
|
|
2225
|
+
tooltip.setAttribute('data-inertia', '');
|
|
2226
|
+
}
|
|
2227
|
+
function removeInertia(tooltip) {
|
|
2228
|
+
tooltip.removeAttribute('data-inertia');
|
|
2229
|
+
}
|
|
2230
|
+
function createArrowElement(arrowType) {
|
|
2231
|
+
var arrow = div();
|
|
2232
|
+
if (arrowType === 'round') {
|
|
2233
|
+
arrow.className = ROUND_ARROW_CLASS;
|
|
2234
|
+
setInnerHTML(arrow, '<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>');
|
|
2235
|
+
} else {
|
|
2236
|
+
arrow.className = ARROW_CLASS;
|
|
2237
|
+
}
|
|
2238
|
+
return arrow;
|
|
2239
|
+
}
|
|
2240
|
+
function createBackdropElement() {
|
|
2241
|
+
var backdrop = div();
|
|
2242
|
+
backdrop.className = BACKDROP_CLASS;
|
|
2243
|
+
backdrop.setAttribute('data-state', 'hidden');
|
|
2244
|
+
return backdrop;
|
|
2245
|
+
}
|
|
2246
|
+
function addInteractive(popper, tooltip) {
|
|
2247
|
+
popper.setAttribute('tabindex', '-1');
|
|
2248
|
+
tooltip.setAttribute('data-interactive', '');
|
|
2249
|
+
}
|
|
2250
|
+
function removeInteractive(popper, tooltip) {
|
|
2251
|
+
popper.removeAttribute('tabindex');
|
|
2252
|
+
tooltip.removeAttribute('data-interactive');
|
|
2253
|
+
}
|
|
2254
|
+
function updateTransitionEndListener(tooltip, action, listener) {
|
|
2255
|
+
var eventName = isUCBrowser && document.body.style.webkitTransition !== undefined ? 'webkitTransitionEnd' : 'transitionend';
|
|
2256
|
+
tooltip[action + 'EventListener'](eventName, listener);
|
|
2257
|
+
}
|
|
2258
|
+
function getBasicPlacement(popper) {
|
|
2259
|
+
var fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE);
|
|
2260
|
+
return fullPlacement ? fullPlacement.split('-')[0] : '';
|
|
2261
|
+
}
|
|
2262
|
+
function reflow(popper) {
|
|
2263
|
+
void popper.offsetHeight;
|
|
2264
|
+
}
|
|
2265
|
+
function updateTheme(tooltip, action, theme) {
|
|
2266
|
+
theme.split(' ').forEach(function (themeName) {
|
|
2267
|
+
tooltip.classList[action](themeName + '-theme');
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
function setWidth(tooltip, props, key) {
|
|
2271
|
+
var width = props[key];
|
|
2272
|
+
var parsedWidth = _parseInt$2(width);
|
|
2273
|
+
if (typeof width === 'number') {
|
|
2274
|
+
tooltip.style[key] = width + 'px';
|
|
2275
|
+
} else if (isNaN(parsedWidth)) {
|
|
2276
|
+
tooltip.style[key] = width;
|
|
2277
|
+
} else {
|
|
2278
|
+
tooltip.style[key] = parsedWidth + 'px';
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
function createPopperElement(id, props) {
|
|
2282
|
+
var popper = div();
|
|
2283
|
+
popper.className = POPPER_CLASS + (props.extCls ? " ".concat(props.extCls) : '');
|
|
2284
|
+
popper.id = "tippy-".concat(id);
|
|
2285
|
+
popper.style.zIndex = '' + props.zIndex;
|
|
2286
|
+
popper.style.position = 'absolute';
|
|
2287
|
+
popper.style.top = '0';
|
|
2288
|
+
popper.style.left = '0';
|
|
2289
|
+
if (props.role) {
|
|
2290
|
+
popper.setAttribute('role', props.role);
|
|
2291
|
+
}
|
|
2292
|
+
var tooltip = div();
|
|
2293
|
+
tooltip.className = TOOLTIP_CLASS;
|
|
2294
|
+
setWidth(tooltip, props, 'maxWidth');
|
|
2295
|
+
setWidth(tooltip, props, 'width');
|
|
2296
|
+
tooltip.setAttribute('data-size', props.size);
|
|
2297
|
+
tooltip.setAttribute('data-animation', props.animation);
|
|
2298
|
+
tooltip.setAttribute('data-state', 'hidden');
|
|
2299
|
+
updateTheme(tooltip, 'add', props.theme);
|
|
2300
|
+
var content = div();
|
|
2301
|
+
content.className = CONTENT_CLASS;
|
|
2302
|
+
content.setAttribute('data-state', 'hidden');
|
|
2303
|
+
if (props.interactive) {
|
|
2304
|
+
addInteractive(popper, tooltip);
|
|
2305
|
+
}
|
|
2306
|
+
if (props.arrow) {
|
|
2307
|
+
tooltip.appendChild(createArrowElement(props.arrowType));
|
|
2308
|
+
}
|
|
2309
|
+
if (props.animateFill) {
|
|
2310
|
+
tooltip.appendChild(createBackdropElement());
|
|
2311
|
+
tooltip.setAttribute('data-animatefill', '');
|
|
2312
|
+
}
|
|
2313
|
+
if (props.inertia) {
|
|
2314
|
+
addInertia(tooltip);
|
|
2315
|
+
}
|
|
2316
|
+
setContent(content, props);
|
|
2317
|
+
tooltip.appendChild(content);
|
|
2318
|
+
popper.appendChild(tooltip);
|
|
2319
|
+
return popper;
|
|
2320
|
+
}
|
|
2321
|
+
function updatePopperElement(popper, prevProps, nextProps) {
|
|
2322
|
+
var _getChildren = getChildren(popper),
|
|
2323
|
+
tooltip = _getChildren.tooltip,
|
|
2324
|
+
content = _getChildren.content,
|
|
2325
|
+
backdrop = _getChildren.backdrop,
|
|
2326
|
+
arrow = _getChildren.arrow;
|
|
2327
|
+
popper.style.zIndex = '' + nextProps.zIndex;
|
|
2328
|
+
tooltip.setAttribute('data-size', nextProps.size);
|
|
2329
|
+
tooltip.setAttribute('data-animation', nextProps.animation);
|
|
2330
|
+
tooltip.style.maxWidth = nextProps.maxWidth + (typeof nextProps.maxWidth === 'number' ? 'px' : '');
|
|
2331
|
+
if (nextProps.role) {
|
|
2332
|
+
popper.setAttribute('role', nextProps.role);
|
|
2333
|
+
} else {
|
|
2334
|
+
popper.removeAttribute('role');
|
|
2335
|
+
}
|
|
2336
|
+
if (prevProps.content !== nextProps.content) {
|
|
2337
|
+
setContent(content, nextProps);
|
|
2338
|
+
}
|
|
2339
|
+
if (!prevProps.animateFill && nextProps.animateFill) {
|
|
2340
|
+
tooltip.appendChild(createBackdropElement());
|
|
2341
|
+
tooltip.setAttribute('data-animatefill', '');
|
|
2342
|
+
} else if (prevProps.animateFill && !nextProps.animateFill) {
|
|
2343
|
+
tooltip.removeChild(backdrop);
|
|
2344
|
+
tooltip.removeAttribute('data-animatefill');
|
|
2345
|
+
}
|
|
2346
|
+
if (!prevProps.arrow && nextProps.arrow) {
|
|
2347
|
+
tooltip.appendChild(createArrowElement(nextProps.arrowType));
|
|
2348
|
+
} else if (prevProps.arrow && !nextProps.arrow) {
|
|
2349
|
+
tooltip.removeChild(arrow);
|
|
2350
|
+
}
|
|
2351
|
+
if (prevProps.arrow && nextProps.arrow && prevProps.arrowType !== nextProps.arrowType) {
|
|
2352
|
+
tooltip.replaceChild(createArrowElement(nextProps.arrowType), arrow);
|
|
2353
|
+
}
|
|
2354
|
+
if (!prevProps.interactive && nextProps.interactive) {
|
|
2355
|
+
addInteractive(popper, tooltip);
|
|
2356
|
+
} else if (prevProps.interactive && !nextProps.interactive) {
|
|
2357
|
+
removeInteractive(popper, tooltip);
|
|
2358
|
+
}
|
|
2359
|
+
if (!prevProps.inertia && nextProps.inertia) {
|
|
2360
|
+
addInertia(tooltip);
|
|
2361
|
+
} else if (prevProps.inertia && !nextProps.inertia) {
|
|
2362
|
+
removeInertia(tooltip);
|
|
2363
|
+
}
|
|
2364
|
+
if (prevProps.theme !== nextProps.theme) {
|
|
2365
|
+
updateTheme(tooltip, 'remove', prevProps.theme);
|
|
2366
|
+
updateTheme(tooltip, 'add', nextProps.theme);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
function hideAll() {
|
|
2370
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
2371
|
+
excludedReferenceOrInstance = _ref.exclude,
|
|
2372
|
+
duration = _ref.duration;
|
|
2373
|
+
arrayFrom(document.querySelectorAll(POPPER_SELECTOR)).forEach(function (popper) {
|
|
2374
|
+
var instance = popper._tippy;
|
|
2375
|
+
if (instance) {
|
|
2376
|
+
var isExcluded = false;
|
|
2377
|
+
if (excludedReferenceOrInstance) {
|
|
2378
|
+
isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : popper === excludedReferenceOrInstance.popper;
|
|
2379
|
+
}
|
|
2380
|
+
if (!isExcluded) {
|
|
2381
|
+
instance.hide(duration);
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
}
|
|
2386
|
+
function isCursorOutsideInteractiveBorder(popperPlacement, popperRect, event, props) {
|
|
2387
|
+
if (!popperPlacement) {
|
|
2388
|
+
return true;
|
|
2389
|
+
}
|
|
2390
|
+
var x = event.clientX,
|
|
2391
|
+
y = event.clientY;
|
|
2392
|
+
var interactiveBorder = props.interactiveBorder,
|
|
2393
|
+
distance = props.distance;
|
|
2394
|
+
var exceedsTop = popperRect.top - y > (popperPlacement === 'top' ? interactiveBorder + distance : interactiveBorder);
|
|
2395
|
+
var exceedsBottom = y - popperRect.bottom > (popperPlacement === 'bottom' ? interactiveBorder + distance : interactiveBorder);
|
|
2396
|
+
var exceedsLeft = popperRect.left - x > (popperPlacement === 'left' ? interactiveBorder + distance : interactiveBorder);
|
|
2397
|
+
var exceedsRight = x - popperRect.right > (popperPlacement === 'right' ? interactiveBorder + distance : interactiveBorder);
|
|
2398
|
+
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
|
|
2399
|
+
}
|
|
2400
|
+
function getOffsetDistanceInPx(distance) {
|
|
2401
|
+
return -(distance - 10) + 'px';
|
|
2402
|
+
}
|
|
2403
|
+
var idCounter = 1;
|
|
2404
|
+
var mouseMoveListeners = [];
|
|
2405
|
+
function createTippy(reference, collectionProps) {
|
|
2406
|
+
var props = evaluateProps(reference, collectionProps);
|
|
2407
|
+
if (!props.multiple && reference._tippy) {
|
|
2408
|
+
return null;
|
|
2409
|
+
}
|
|
2410
|
+
var lastTriggerEventType;
|
|
2411
|
+
var lastMouseMoveEvent;
|
|
2412
|
+
var showTimeoutId;
|
|
2413
|
+
var hideTimeoutId;
|
|
2414
|
+
var scheduleHideAnimationFrameId;
|
|
2415
|
+
var isScheduledToShow = false;
|
|
2416
|
+
var isBeingDestroyed = false;
|
|
2417
|
+
var previousPlacement;
|
|
2418
|
+
var wasVisibleDuringPreviousUpdate = false;
|
|
2419
|
+
var hasMountCallbackRun = false;
|
|
2420
|
+
var currentMountCallback;
|
|
2421
|
+
var currentTransitionEndListener;
|
|
2422
|
+
var listeners = [];
|
|
2423
|
+
var currentComputedPadding;
|
|
2424
|
+
var debouncedOnMouseMove = debounce$1(onMouseMove, props.interactiveDebounce);
|
|
2425
|
+
var id = idCounter++;
|
|
2426
|
+
var popper = createPopperElement(id, props);
|
|
2427
|
+
var popperChildren = getChildren(popper);
|
|
2428
|
+
var popperInstance = null;
|
|
2429
|
+
var state = {
|
|
2430
|
+
isEnabled: true,
|
|
2431
|
+
isVisible: false,
|
|
2432
|
+
isDestroyed: false,
|
|
2433
|
+
isMounted: false,
|
|
2434
|
+
isShown: false
|
|
2435
|
+
};
|
|
2436
|
+
var instance = {
|
|
2437
|
+
id: id,
|
|
2438
|
+
reference: reference,
|
|
2439
|
+
popper: popper,
|
|
2440
|
+
popperChildren: popperChildren,
|
|
2441
|
+
popperInstance: popperInstance,
|
|
2442
|
+
props: props,
|
|
2443
|
+
state: state,
|
|
2444
|
+
clearDelayTimeouts: clearDelayTimeouts,
|
|
2445
|
+
set: set,
|
|
2446
|
+
setContent: setContent,
|
|
2447
|
+
show: show,
|
|
2448
|
+
hide: hide,
|
|
2449
|
+
enable: enable,
|
|
2450
|
+
disable: disable,
|
|
2451
|
+
destroy: destroy
|
|
2452
|
+
};
|
|
2453
|
+
reference._tippy = instance;
|
|
2454
|
+
popper._tippy = instance;
|
|
2455
|
+
addTriggersToReference();
|
|
2456
|
+
if (!props.lazy) {
|
|
2457
|
+
createPopperInstance();
|
|
2458
|
+
}
|
|
2459
|
+
if (props.showOnInit) {
|
|
2460
|
+
scheduleShow();
|
|
2461
|
+
}
|
|
2462
|
+
if (props.a11y && !props.target && !canReceiveFocus(getEventListenersTarget())) {
|
|
2463
|
+
getEventListenersTarget().setAttribute('tabindex', '0');
|
|
2464
|
+
}
|
|
2465
|
+
popper.addEventListener('mouseenter', function (event) {
|
|
2466
|
+
if (instance.props.interactive && instance.state.isVisible && lastTriggerEventType === 'mouseenter') {
|
|
2467
|
+
scheduleShow(event, true);
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
popper.addEventListener('mouseleave', function () {
|
|
2471
|
+
if (instance.props.interactive && lastTriggerEventType === 'mouseenter') {
|
|
2472
|
+
document.addEventListener('mousemove', debouncedOnMouseMove);
|
|
2473
|
+
}
|
|
2474
|
+
});
|
|
2475
|
+
return instance;
|
|
2476
|
+
function removeFollowCursorListener() {
|
|
2477
|
+
document.removeEventListener('mousemove', positionVirtualReferenceNearCursor);
|
|
2478
|
+
}
|
|
2479
|
+
function cleanupInteractiveMouseListeners() {
|
|
2480
|
+
document.body.removeEventListener('mouseleave', scheduleHide);
|
|
2481
|
+
document.removeEventListener('mousemove', debouncedOnMouseMove);
|
|
2482
|
+
mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
|
|
2483
|
+
return listener !== debouncedOnMouseMove;
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
function getEventListenersTarget() {
|
|
2487
|
+
return instance.props.triggerTarget || reference;
|
|
2488
|
+
}
|
|
2489
|
+
function addDocumentClickListener() {
|
|
2490
|
+
document.addEventListener('click', onDocumentClick, true);
|
|
2491
|
+
}
|
|
2492
|
+
function removeDocumentClickListener() {
|
|
2493
|
+
document.removeEventListener('click', onDocumentClick, true);
|
|
2494
|
+
}
|
|
2495
|
+
function getTransitionableElements() {
|
|
2496
|
+
return [instance.popperChildren.tooltip, instance.popperChildren.backdrop, instance.popperChildren.content];
|
|
2497
|
+
}
|
|
2498
|
+
function getIsInLooseFollowCursorMode() {
|
|
2499
|
+
var followCursor = instance.props.followCursor;
|
|
2500
|
+
return followCursor && lastTriggerEventType !== 'focus' || isUsingTouch && followCursor === 'initial';
|
|
2501
|
+
}
|
|
2502
|
+
function makeSticky() {
|
|
2503
|
+
setTransitionDuration([popper], isIE$1 ? 0 : instance.props.updateDuration);
|
|
2504
|
+
function updatePosition() {
|
|
2505
|
+
instance.popperInstance.scheduleUpdate();
|
|
2506
|
+
if (instance.state.isMounted) {
|
|
2507
|
+
requestAnimationFrame(updatePosition);
|
|
2508
|
+
} else {
|
|
2509
|
+
setTransitionDuration([popper], 0);
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
updatePosition();
|
|
2513
|
+
}
|
|
2514
|
+
function onTransitionedOut(duration, callback) {
|
|
2515
|
+
onTransitionEnd(duration, function () {
|
|
2516
|
+
if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
|
|
2517
|
+
callback();
|
|
2518
|
+
}
|
|
2519
|
+
});
|
|
2520
|
+
}
|
|
2521
|
+
function onTransitionedIn(duration, callback) {
|
|
2522
|
+
onTransitionEnd(duration, callback);
|
|
2523
|
+
}
|
|
2524
|
+
function onTransitionEnd(duration, callback) {
|
|
2525
|
+
var tooltip = instance.popperChildren.tooltip;
|
|
2526
|
+
function listener(event) {
|
|
2527
|
+
if (event.target === tooltip) {
|
|
2528
|
+
updateTransitionEndListener(tooltip, 'remove', listener);
|
|
2529
|
+
callback();
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
if (duration === 0) {
|
|
2533
|
+
return callback();
|
|
2534
|
+
}
|
|
2535
|
+
updateTransitionEndListener(tooltip, 'remove', currentTransitionEndListener);
|
|
2536
|
+
updateTransitionEndListener(tooltip, 'add', listener);
|
|
2537
|
+
currentTransitionEndListener = listener;
|
|
2538
|
+
}
|
|
2539
|
+
function on(eventType, handler) {
|
|
2540
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2541
|
+
getEventListenersTarget().addEventListener(eventType, handler, options);
|
|
2542
|
+
listeners.push({
|
|
2543
|
+
eventType: eventType,
|
|
2544
|
+
handler: handler,
|
|
2545
|
+
options: options
|
|
2546
|
+
});
|
|
2547
|
+
}
|
|
2548
|
+
function addTriggersToReference() {
|
|
2549
|
+
if (instance.props.touchHold && !instance.props.target) {
|
|
2550
|
+
on('touchstart', onTrigger, PASSIVE);
|
|
2551
|
+
on('touchend', onMouseLeave, PASSIVE);
|
|
2552
|
+
}
|
|
2553
|
+
instance.props.trigger.trim().split(' ').forEach(function (eventType) {
|
|
2554
|
+
if (eventType === 'manual') {
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
if (!instance.props.target) {
|
|
2558
|
+
on(eventType, onTrigger);
|
|
2559
|
+
switch (eventType) {
|
|
2560
|
+
case 'mouseenter':
|
|
2561
|
+
on('mouseleave', onMouseLeave);
|
|
2562
|
+
break;
|
|
2563
|
+
case 'focus':
|
|
2564
|
+
on(isIE$1 ? 'focusout' : 'blur', onBlur);
|
|
2565
|
+
break;
|
|
2566
|
+
}
|
|
2567
|
+
} else {
|
|
2568
|
+
switch (eventType) {
|
|
2569
|
+
case 'mouseenter':
|
|
2570
|
+
on('mouseover', onDelegateShow);
|
|
2571
|
+
on('mouseout', onDelegateHide);
|
|
2572
|
+
break;
|
|
2573
|
+
case 'focus':
|
|
2574
|
+
on('focusin', onDelegateShow);
|
|
2575
|
+
on('focusout', onDelegateHide);
|
|
2576
|
+
break;
|
|
2577
|
+
case 'click':
|
|
2578
|
+
on(eventType, onDelegateShow);
|
|
2579
|
+
break;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
function removeTriggersFromReference() {
|
|
2585
|
+
listeners.forEach(function (_ref) {
|
|
2586
|
+
var eventType = _ref.eventType,
|
|
2587
|
+
handler = _ref.handler,
|
|
2588
|
+
options = _ref.options;
|
|
2589
|
+
getEventListenersTarget().removeEventListener(eventType, handler, options);
|
|
2590
|
+
});
|
|
2591
|
+
listeners = [];
|
|
2592
|
+
}
|
|
2593
|
+
function positionVirtualReferenceNearCursor(event) {
|
|
2594
|
+
var _lastMouseMoveEvent = lastMouseMoveEvent = event,
|
|
2595
|
+
x = _lastMouseMoveEvent.clientX,
|
|
2596
|
+
y = _lastMouseMoveEvent.clientY;
|
|
2597
|
+
if (!currentComputedPadding) {
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2600
|
+
var isCursorOverReference = closestCallback(event.target, function (el) {
|
|
2601
|
+
return el === reference;
|
|
2602
|
+
});
|
|
2603
|
+
var rect = reference.getBoundingClientRect();
|
|
2604
|
+
var followCursor = instance.props.followCursor;
|
|
2605
|
+
var isHorizontal = followCursor === 'horizontal';
|
|
2606
|
+
var isVertical = followCursor === 'vertical';
|
|
2607
|
+
var isVerticalPlacement = includes(['top', 'bottom'], getBasicPlacement(popper));
|
|
2608
|
+
var fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE);
|
|
2609
|
+
var isVariation = fullPlacement ? !!fullPlacement.split('-')[1] : false;
|
|
2610
|
+
var size = isVerticalPlacement ? popper.offsetWidth : popper.offsetHeight;
|
|
2611
|
+
var halfSize = size / 2;
|
|
2612
|
+
var verticalIncrease = isVerticalPlacement ? 0 : isVariation ? size : halfSize;
|
|
2613
|
+
var horizontalIncrease = isVerticalPlacement ? isVariation ? size : halfSize : 0;
|
|
2614
|
+
if (isCursorOverReference || !instance.props.interactive) {
|
|
2615
|
+
instance.popperInstance.reference = _extends$2({}, instance.popperInstance.reference, {
|
|
2616
|
+
clientWidth: 0,
|
|
2617
|
+
clientHeight: 0,
|
|
2618
|
+
getBoundingClientRect: function getBoundingClientRect() {
|
|
2619
|
+
return {
|
|
2620
|
+
width: isVerticalPlacement ? size : 0,
|
|
2621
|
+
height: isVerticalPlacement ? 0 : size,
|
|
2622
|
+
top: (isHorizontal ? rect.top : y) - verticalIncrease,
|
|
2623
|
+
bottom: (isHorizontal ? rect.bottom : y) + verticalIncrease,
|
|
2624
|
+
left: (isVertical ? rect.left : x) - horizontalIncrease,
|
|
2625
|
+
right: (isVertical ? rect.right : x) + horizontalIncrease
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
2629
|
+
instance.popperInstance.update();
|
|
2630
|
+
}
|
|
2631
|
+
if (followCursor === 'initial' && instance.state.isVisible) {
|
|
2632
|
+
removeFollowCursorListener();
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
function createDelegateChildTippy(event) {
|
|
2636
|
+
if (event) {
|
|
2637
|
+
var targetEl = closest(event.target, instance.props.target);
|
|
2638
|
+
if (targetEl && !targetEl._tippy) {
|
|
2639
|
+
createTippy(targetEl, _extends$2({}, instance.props, {
|
|
2640
|
+
content: invokeWithArgsOrReturn(collectionProps.content, [targetEl]),
|
|
2641
|
+
appendTo: collectionProps.appendTo,
|
|
2642
|
+
target: '',
|
|
2643
|
+
showOnInit: true
|
|
2644
|
+
}));
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
function onTrigger(event) {
|
|
2649
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event)) {
|
|
2650
|
+
return;
|
|
2651
|
+
}
|
|
2652
|
+
if (!instance.state.isVisible) {
|
|
2653
|
+
lastTriggerEventType = event.type;
|
|
2654
|
+
if (event instanceof MouseEvent) {
|
|
2655
|
+
lastMouseMoveEvent = event;
|
|
2656
|
+
mouseMoveListeners.forEach(function (listener) {
|
|
2657
|
+
return listener(event);
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
if (event.type === 'click' && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
|
2662
|
+
scheduleHide();
|
|
2663
|
+
} else {
|
|
2664
|
+
scheduleShow(event);
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
function onMouseMove(event) {
|
|
2668
|
+
var isCursorOverPopper = closest(event.target, POPPER_SELECTOR) === popper;
|
|
2669
|
+
var isCursorOverReference = closestCallback(event.target, function (el) {
|
|
2670
|
+
return el === reference;
|
|
2671
|
+
});
|
|
2672
|
+
if (isCursorOverPopper || isCursorOverReference) {
|
|
2673
|
+
return;
|
|
2674
|
+
}
|
|
2675
|
+
if (isCursorOutsideInteractiveBorder(getBasicPlacement(popper), popper.getBoundingClientRect(), event, instance.props)) {
|
|
2676
|
+
cleanupInteractiveMouseListeners();
|
|
2677
|
+
scheduleHide();
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
function onMouseLeave(event) {
|
|
2681
|
+
if (isEventListenerStopped(event)) {
|
|
2682
|
+
return;
|
|
2683
|
+
}
|
|
2684
|
+
if (instance.props.interactive) {
|
|
2685
|
+
document.body.addEventListener('mouseleave', scheduleHide);
|
|
2686
|
+
document.addEventListener('mousemove', debouncedOnMouseMove);
|
|
2687
|
+
mouseMoveListeners.push(debouncedOnMouseMove);
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
scheduleHide();
|
|
2691
|
+
}
|
|
2692
|
+
function onBlur(event) {
|
|
2693
|
+
if (event.target !== getEventListenersTarget()) {
|
|
2694
|
+
return;
|
|
2695
|
+
}
|
|
2696
|
+
if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
scheduleHide();
|
|
2700
|
+
}
|
|
2701
|
+
function onDelegateShow(event) {
|
|
2702
|
+
if (closest(event.target, instance.props.target)) {
|
|
2703
|
+
scheduleShow(event);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
function onDelegateHide(event) {
|
|
2707
|
+
if (closest(event.target, instance.props.target)) {
|
|
2708
|
+
scheduleHide();
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
function isEventListenerStopped(event) {
|
|
2712
|
+
var supportsTouch = ('ontouchstart' in window);
|
|
2713
|
+
var isTouchEvent = includes(event.type, 'touch');
|
|
2714
|
+
var touchHold = instance.props.touchHold;
|
|
2715
|
+
return supportsTouch && isUsingTouch && touchHold && !isTouchEvent || isUsingTouch && !touchHold && isTouchEvent;
|
|
2716
|
+
}
|
|
2717
|
+
function runMountCallback() {
|
|
2718
|
+
if (!hasMountCallbackRun && currentMountCallback) {
|
|
2719
|
+
hasMountCallbackRun = true;
|
|
2720
|
+
reflow(popper);
|
|
2721
|
+
currentMountCallback();
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
function createPopperInstance() {
|
|
2725
|
+
var popperOptions = instance.props.popperOptions;
|
|
2726
|
+
var _instance$popperChild = instance.popperChildren,
|
|
2727
|
+
tooltip = _instance$popperChild.tooltip,
|
|
2728
|
+
arrow = _instance$popperChild.arrow;
|
|
2729
|
+
var preventOverflowModifier = getModifier(popperOptions, 'preventOverflow');
|
|
2730
|
+
function applyMutations(data) {
|
|
2731
|
+
if (instance.props.flip && !instance.props.flipOnUpdate) {
|
|
2732
|
+
if (data.flipped) {
|
|
2733
|
+
instance.popperInstance.options.placement = data.placement;
|
|
2734
|
+
}
|
|
2735
|
+
setFlipModifierEnabled(instance.popperInstance.modifiers, false);
|
|
2736
|
+
}
|
|
2737
|
+
tooltip.setAttribute(PLACEMENT_ATTRIBUTE, data.placement);
|
|
2738
|
+
if (data.attributes[OUT_OF_BOUNDARIES_ATTRIBUTE] !== false) {
|
|
2739
|
+
tooltip.setAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE, '');
|
|
2740
|
+
} else {
|
|
2741
|
+
tooltip.removeAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE);
|
|
2742
|
+
}
|
|
2743
|
+
if (previousPlacement && previousPlacement !== data.placement && wasVisibleDuringPreviousUpdate) {
|
|
2744
|
+
tooltip.style.transition = 'none';
|
|
2745
|
+
requestAnimationFrame(function () {
|
|
2746
|
+
tooltip.style.transition = '';
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
previousPlacement = data.placement;
|
|
2750
|
+
wasVisibleDuringPreviousUpdate = instance.state.isVisible;
|
|
2751
|
+
var basicPlacement = getBasicPlacement(popper);
|
|
2752
|
+
var styles = tooltip.style;
|
|
2753
|
+
styles.top = styles.bottom = styles.left = styles.right = '';
|
|
2754
|
+
styles[basicPlacement] = getOffsetDistanceInPx(instance.props.distance);
|
|
2755
|
+
var padding = preventOverflowModifier && preventOverflowModifier.padding !== undefined ? preventOverflowModifier.padding : PADDING;
|
|
2756
|
+
var isPaddingNumber = typeof padding === 'number';
|
|
2757
|
+
var computedPadding = _extends$2({
|
|
2758
|
+
top: isPaddingNumber ? padding : padding.top,
|
|
2759
|
+
bottom: isPaddingNumber ? padding : padding.bottom,
|
|
2760
|
+
left: isPaddingNumber ? padding : padding.left,
|
|
2761
|
+
right: isPaddingNumber ? padding : padding.right
|
|
2762
|
+
}, !isPaddingNumber && padding);
|
|
2763
|
+
computedPadding[basicPlacement] = isPaddingNumber ? padding + instance.props.distance : (padding[basicPlacement] || 0) + instance.props.distance;
|
|
2764
|
+
instance.popperInstance.modifiers.filter(function (m) {
|
|
2765
|
+
return m.name === 'preventOverflow';
|
|
2766
|
+
})[0].padding = computedPadding;
|
|
2767
|
+
currentComputedPadding = computedPadding;
|
|
2768
|
+
}
|
|
2769
|
+
var config = _extends$2({
|
|
2770
|
+
eventsEnabled: false,
|
|
2771
|
+
placement: instance.props.placement
|
|
2772
|
+
}, popperOptions, {
|
|
2773
|
+
modifiers: _extends$2({}, popperOptions ? popperOptions.modifiers : {}, {
|
|
2774
|
+
preventOverflow: _extends$2({
|
|
2775
|
+
boundariesElement: instance.props.boundary,
|
|
2776
|
+
padding: PADDING
|
|
2777
|
+
}, preventOverflowModifier),
|
|
2778
|
+
arrow: _extends$2({
|
|
2779
|
+
element: arrow,
|
|
2780
|
+
enabled: !!arrow
|
|
2781
|
+
}, getModifier(popperOptions, 'arrow')),
|
|
2782
|
+
flip: _extends$2({
|
|
2783
|
+
enabled: instance.props.flip,
|
|
2784
|
+
padding: instance.props.distance + PADDING,
|
|
2785
|
+
behavior: instance.props.flipBehavior
|
|
2786
|
+
}, getModifier(popperOptions, 'flip')),
|
|
2787
|
+
offset: _extends$2({
|
|
2788
|
+
offset: instance.props.offset
|
|
2789
|
+
}, getModifier(popperOptions, 'offset'))
|
|
2790
|
+
}),
|
|
2791
|
+
onCreate: function onCreate(data) {
|
|
2792
|
+
applyMutations(data);
|
|
2793
|
+
runMountCallback();
|
|
2794
|
+
if (popperOptions && popperOptions.onCreate) {
|
|
2795
|
+
popperOptions.onCreate(data);
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
onUpdate: function onUpdate(data) {
|
|
2799
|
+
applyMutations(data);
|
|
2800
|
+
runMountCallback();
|
|
2801
|
+
if (popperOptions && popperOptions.onUpdate) {
|
|
2802
|
+
popperOptions.onUpdate(data);
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
instance.popperInstance = new Popper(reference, popper, config);
|
|
2807
|
+
}
|
|
2808
|
+
function mount() {
|
|
2809
|
+
hasMountCallbackRun = false;
|
|
2810
|
+
var isInLooseFollowCursorMode = getIsInLooseFollowCursorMode();
|
|
2811
|
+
if (instance.popperInstance) {
|
|
2812
|
+
setFlipModifierEnabled(instance.popperInstance.modifiers, instance.props.flip);
|
|
2813
|
+
if (!isInLooseFollowCursorMode) {
|
|
2814
|
+
instance.popperInstance.reference = reference;
|
|
2815
|
+
instance.popperInstance.enableEventListeners();
|
|
2816
|
+
}
|
|
2817
|
+
instance.popperInstance.scheduleUpdate();
|
|
2818
|
+
} else {
|
|
2819
|
+
createPopperInstance();
|
|
2820
|
+
if (!isInLooseFollowCursorMode) {
|
|
2821
|
+
instance.popperInstance.enableEventListeners();
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
var appendTo = instance.props.appendTo;
|
|
2825
|
+
var parentNode = appendTo === 'parent' ? reference.parentNode : invokeWithArgsOrReturn(appendTo, [reference]);
|
|
2826
|
+
if (!parentNode.contains(popper)) {
|
|
2827
|
+
parentNode.appendChild(popper);
|
|
2828
|
+
instance.props.onMount(instance);
|
|
2829
|
+
instance.state.isMounted = true;
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
function scheduleShow(event, shouldAvoidCallingOnTrigger) {
|
|
2833
|
+
clearDelayTimeouts();
|
|
2834
|
+
if (instance.state.isVisible) {
|
|
2835
|
+
return;
|
|
2836
|
+
}
|
|
2837
|
+
if (instance.props.target) {
|
|
2838
|
+
return createDelegateChildTippy(event);
|
|
2839
|
+
}
|
|
2840
|
+
isScheduledToShow = true;
|
|
2841
|
+
if (event && !shouldAvoidCallingOnTrigger) {
|
|
2842
|
+
instance.props.onTrigger(instance, event);
|
|
2843
|
+
}
|
|
2844
|
+
if (instance.props.wait) {
|
|
2845
|
+
return instance.props.wait(instance, event);
|
|
2846
|
+
}
|
|
2847
|
+
if (getIsInLooseFollowCursorMode() && !instance.state.isMounted) {
|
|
2848
|
+
if (!instance.popperInstance) {
|
|
2849
|
+
createPopperInstance();
|
|
2850
|
+
}
|
|
2851
|
+
document.addEventListener('mousemove', positionVirtualReferenceNearCursor);
|
|
2852
|
+
}
|
|
2853
|
+
addDocumentClickListener();
|
|
2854
|
+
var delay = getValue(instance.props.delay, 0, defaultProps.delay);
|
|
2855
|
+
if (delay) {
|
|
2856
|
+
showTimeoutId = setTimeout(function () {
|
|
2857
|
+
show();
|
|
2858
|
+
}, delay);
|
|
2859
|
+
} else {
|
|
2860
|
+
show();
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
function scheduleHide() {
|
|
2864
|
+
clearDelayTimeouts();
|
|
2865
|
+
if (!instance.state.isVisible) {
|
|
2866
|
+
return removeFollowCursorListener();
|
|
2867
|
+
}
|
|
2868
|
+
isScheduledToShow = false;
|
|
2869
|
+
var delay = getValue(instance.props.delay, 1, defaultProps.delay);
|
|
2870
|
+
if (delay) {
|
|
2871
|
+
hideTimeoutId = setTimeout(function () {
|
|
2872
|
+
if (instance.state.isVisible) {
|
|
2873
|
+
hide();
|
|
2874
|
+
}
|
|
2875
|
+
}, delay);
|
|
2876
|
+
} else {
|
|
2877
|
+
scheduleHideAnimationFrameId = requestAnimationFrame(function () {
|
|
2878
|
+
hide();
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
function onDocumentClick(event) {
|
|
2883
|
+
if (instance.props.interactive && popper.contains(event.target)) {
|
|
2884
|
+
return;
|
|
2885
|
+
}
|
|
2886
|
+
if (getEventListenersTarget().contains(event.target)) {
|
|
2887
|
+
if (isUsingTouch) {
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2890
|
+
if (instance.state.isVisible && includes(instance.props.trigger, 'click')) {
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
if (instance.props.hideOnClick === true) {
|
|
2895
|
+
clearDelayTimeouts();
|
|
2896
|
+
hide();
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
function enable() {
|
|
2900
|
+
instance.state.isEnabled = true;
|
|
2901
|
+
}
|
|
2902
|
+
function disable() {
|
|
2903
|
+
instance.state.isEnabled = false;
|
|
2904
|
+
}
|
|
2905
|
+
function clearDelayTimeouts() {
|
|
2906
|
+
clearTimeout(showTimeoutId);
|
|
2907
|
+
clearTimeout(hideTimeoutId);
|
|
2908
|
+
cancelAnimationFrame(scheduleHideAnimationFrameId);
|
|
2909
|
+
}
|
|
2910
|
+
function set(options) {
|
|
2911
|
+
options = options || {};
|
|
2912
|
+
validateOptions(options, defaultProps);
|
|
2913
|
+
removeTriggersFromReference();
|
|
2914
|
+
var prevProps = instance.props;
|
|
2915
|
+
var nextProps = evaluateProps(reference, _extends$2({}, instance.props, options, {
|
|
2916
|
+
ignoreAttributes: true
|
|
2917
|
+
}));
|
|
2918
|
+
nextProps.ignoreAttributes = hasOwnProperty$1(options, 'ignoreAttributes') ? options.ignoreAttributes || false : prevProps.ignoreAttributes;
|
|
2919
|
+
instance.props = nextProps;
|
|
2920
|
+
addTriggersToReference();
|
|
2921
|
+
cleanupInteractiveMouseListeners();
|
|
2922
|
+
debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
|
|
2923
|
+
updatePopperElement(popper, prevProps, nextProps);
|
|
2924
|
+
instance.popperChildren = getChildren(popper);
|
|
2925
|
+
if (instance.popperInstance) {
|
|
2926
|
+
if (POPPER_INSTANCE_DEPENDENCIES.some(function (prop) {
|
|
2927
|
+
return hasOwnProperty$1(options, prop) && options[prop] !== prevProps[prop];
|
|
2928
|
+
})) {
|
|
2929
|
+
instance.popperInstance.destroy();
|
|
2930
|
+
createPopperInstance();
|
|
2931
|
+
if (instance.state.isVisible) {
|
|
2932
|
+
instance.popperInstance.enableEventListeners();
|
|
2933
|
+
}
|
|
2934
|
+
if (instance.props.followCursor && lastMouseMoveEvent) {
|
|
2935
|
+
positionVirtualReferenceNearCursor(lastMouseMoveEvent);
|
|
2936
|
+
}
|
|
2937
|
+
} else {
|
|
2938
|
+
instance.popperInstance.update();
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
function setContent(content) {
|
|
2943
|
+
set({
|
|
2944
|
+
content: content
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
function show() {
|
|
2948
|
+
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 0, defaultProps.duration[1]);
|
|
2949
|
+
if (instance.state.isDestroyed || !instance.state.isEnabled || isUsingTouch && !instance.props.touch) {
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
if (getEventListenersTarget().hasAttribute('disabled')) {
|
|
2953
|
+
return;
|
|
2954
|
+
}
|
|
2955
|
+
if (instance.props.onShow(instance) === false) {
|
|
2956
|
+
return;
|
|
2957
|
+
}
|
|
2958
|
+
addDocumentClickListener();
|
|
2959
|
+
popper.style.visibility = 'visible';
|
|
2960
|
+
instance.state.isVisible = true;
|
|
2961
|
+
if (instance.props.interactive) {
|
|
2962
|
+
getEventListenersTarget().classList.add(ACTIVE_CLASS);
|
|
2963
|
+
}
|
|
2964
|
+
var transitionableElements = getTransitionableElements();
|
|
2965
|
+
setTransitionDuration(transitionableElements.concat(popper), 0);
|
|
2966
|
+
currentMountCallback = function currentMountCallback() {
|
|
2967
|
+
if (!instance.state.isVisible) {
|
|
2968
|
+
return;
|
|
2969
|
+
}
|
|
2970
|
+
var isInLooseFollowCursorMode = getIsInLooseFollowCursorMode();
|
|
2971
|
+
if (isInLooseFollowCursorMode && lastMouseMoveEvent) {
|
|
2972
|
+
positionVirtualReferenceNearCursor(lastMouseMoveEvent);
|
|
2973
|
+
} else if (!isInLooseFollowCursorMode) {
|
|
2974
|
+
instance.popperInstance.update();
|
|
2975
|
+
}
|
|
2976
|
+
if (instance.popperChildren.backdrop) {
|
|
2977
|
+
instance.popperChildren.content.style.transitionDelay = Math.round(duration / 12) + 'ms';
|
|
2978
|
+
}
|
|
2979
|
+
if (instance.props.sticky) {
|
|
2980
|
+
makeSticky();
|
|
2981
|
+
}
|
|
2982
|
+
setTransitionDuration([popper], instance.props.updateDuration);
|
|
2983
|
+
setTransitionDuration(transitionableElements, duration);
|
|
2984
|
+
setVisibilityState(transitionableElements, 'visible');
|
|
2985
|
+
onTransitionedIn(duration, function () {
|
|
2986
|
+
if (instance.props.aria) {
|
|
2987
|
+
getEventListenersTarget().setAttribute("aria-".concat(instance.props.aria), popper.id);
|
|
2988
|
+
}
|
|
2989
|
+
instance.props.onShown(instance);
|
|
2990
|
+
instance.state.isShown = true;
|
|
2991
|
+
});
|
|
2992
|
+
};
|
|
2993
|
+
mount();
|
|
2994
|
+
}
|
|
2995
|
+
function hide() {
|
|
2996
|
+
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 1, defaultProps.duration[1]);
|
|
2997
|
+
if (instance.state.isDestroyed || !instance.state.isEnabled && !isBeingDestroyed) {
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
if (instance.props.onHide(instance) === false && !isBeingDestroyed) {
|
|
3001
|
+
return;
|
|
3002
|
+
}
|
|
3003
|
+
removeDocumentClickListener();
|
|
3004
|
+
popper.style.visibility = 'hidden';
|
|
3005
|
+
instance.state.isVisible = false;
|
|
3006
|
+
instance.state.isShown = false;
|
|
3007
|
+
wasVisibleDuringPreviousUpdate = false;
|
|
3008
|
+
if (instance.props.interactive) {
|
|
3009
|
+
getEventListenersTarget().classList.remove(ACTIVE_CLASS);
|
|
3010
|
+
}
|
|
3011
|
+
var transitionableElements = getTransitionableElements();
|
|
3012
|
+
setTransitionDuration(transitionableElements, duration);
|
|
3013
|
+
setVisibilityState(transitionableElements, 'hidden');
|
|
3014
|
+
onTransitionedOut(duration, function () {
|
|
3015
|
+
if (!isScheduledToShow) {
|
|
3016
|
+
removeFollowCursorListener();
|
|
3017
|
+
}
|
|
3018
|
+
if (instance.props.aria) {
|
|
3019
|
+
getEventListenersTarget().removeAttribute("aria-".concat(instance.props.aria));
|
|
3020
|
+
}
|
|
3021
|
+
instance.popperInstance.disableEventListeners();
|
|
3022
|
+
instance.popperInstance.options.placement = instance.props.placement;
|
|
3023
|
+
popper.parentNode.removeChild(popper);
|
|
3024
|
+
instance.props.onHidden(instance);
|
|
3025
|
+
instance.state.isMounted = false;
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
function destroy(destroyTargetInstances) {
|
|
3029
|
+
if (instance.state.isDestroyed) {
|
|
3030
|
+
return;
|
|
3031
|
+
}
|
|
3032
|
+
isBeingDestroyed = true;
|
|
3033
|
+
if (instance.state.isMounted) {
|
|
3034
|
+
hide(0);
|
|
3035
|
+
}
|
|
3036
|
+
removeTriggersFromReference();
|
|
3037
|
+
delete reference._tippy;
|
|
3038
|
+
var target = instance.props.target;
|
|
3039
|
+
if (target && destroyTargetInstances && isRealElement(reference)) {
|
|
3040
|
+
arrayFrom(reference.querySelectorAll(target)).forEach(function (child) {
|
|
3041
|
+
if (child._tippy) {
|
|
3042
|
+
child._tippy.destroy();
|
|
3043
|
+
}
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
if (instance.popperInstance) {
|
|
3047
|
+
instance.popperInstance.destroy();
|
|
3048
|
+
}
|
|
3049
|
+
isBeingDestroyed = false;
|
|
3050
|
+
instance.state.isDestroyed = true;
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
function group(instances) {
|
|
3054
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
3055
|
+
_ref$delay = _ref.delay,
|
|
3056
|
+
delay = _ref$delay === void 0 ? instances[0].props.delay : _ref$delay,
|
|
3057
|
+
_ref$duration = _ref.duration,
|
|
3058
|
+
duration = _ref$duration === void 0 ? 0 : _ref$duration;
|
|
3059
|
+
var isAnyTippyOpen = false;
|
|
3060
|
+
instances.forEach(function (instance) {
|
|
3061
|
+
if (instance._originalProps) {
|
|
3062
|
+
instance.set(instance._originalProps);
|
|
3063
|
+
} else {
|
|
3064
|
+
instance._originalProps = _extends$2({}, instance.props);
|
|
3065
|
+
}
|
|
3066
|
+
});
|
|
3067
|
+
function setIsAnyTippyOpen(value) {
|
|
3068
|
+
isAnyTippyOpen = value;
|
|
3069
|
+
updateInstances();
|
|
3070
|
+
}
|
|
3071
|
+
function onShow(instance) {
|
|
3072
|
+
instance._originalProps.onShow(instance);
|
|
3073
|
+
instances.forEach(function (instance) {
|
|
3074
|
+
instance.set({
|
|
3075
|
+
duration: duration
|
|
3076
|
+
});
|
|
3077
|
+
if (instance.state.isVisible) {
|
|
3078
|
+
instance.hide();
|
|
3079
|
+
}
|
|
3080
|
+
});
|
|
3081
|
+
setIsAnyTippyOpen(true);
|
|
3082
|
+
}
|
|
3083
|
+
function onHide(instance) {
|
|
3084
|
+
instance._originalProps.onHide(instance);
|
|
3085
|
+
setIsAnyTippyOpen(false);
|
|
3086
|
+
}
|
|
3087
|
+
function onShown(instance) {
|
|
3088
|
+
instance._originalProps.onShown(instance);
|
|
3089
|
+
instance.set({
|
|
3090
|
+
duration: instance._originalProps.duration
|
|
3091
|
+
});
|
|
3092
|
+
}
|
|
3093
|
+
function updateInstances() {
|
|
3094
|
+
instances.forEach(function (instance) {
|
|
3095
|
+
instance.set({
|
|
3096
|
+
onShow: onShow,
|
|
3097
|
+
onShown: onShown,
|
|
3098
|
+
onHide: onHide,
|
|
3099
|
+
delay: isAnyTippyOpen ? [0, isArray$1(delay) ? delay[1] : delay] : delay,
|
|
3100
|
+
duration: isAnyTippyOpen ? duration : instance._originalProps.duration
|
|
3101
|
+
});
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
updateInstances();
|
|
3105
|
+
}
|
|
3106
|
+
var globalEventListenersBound = false;
|
|
3107
|
+
function tippy(targets, options) {
|
|
3108
|
+
validateOptions(options || {}, defaultProps);
|
|
3109
|
+
if (!globalEventListenersBound) {
|
|
3110
|
+
bindGlobalEventListeners();
|
|
3111
|
+
globalEventListenersBound = true;
|
|
3112
|
+
}
|
|
3113
|
+
var props = _extends$2({}, defaultProps, options);
|
|
3114
|
+
if (isBareVirtualElement(targets)) {
|
|
3115
|
+
polyfillElementPrototypeProperties(targets);
|
|
3116
|
+
}
|
|
3117
|
+
var instances = getArrayOfElements(targets).reduce(function (acc, reference) {
|
|
3118
|
+
var instance = reference && createTippy(reference, props);
|
|
3119
|
+
if (instance) {
|
|
3120
|
+
acc.push(instance);
|
|
3121
|
+
}
|
|
3122
|
+
return acc;
|
|
3123
|
+
}, []);
|
|
3124
|
+
return isSingular(targets) ? instances[0] : instances;
|
|
3125
|
+
}
|
|
3126
|
+
tippy.version = version;
|
|
3127
|
+
tippy.defaults = defaultProps;
|
|
3128
|
+
tippy.setDefaults = function (partialDefaults) {
|
|
3129
|
+
keys$1(partialDefaults).forEach(function (key) {
|
|
3130
|
+
defaultProps[key] = partialDefaults[key];
|
|
3131
|
+
});
|
|
3132
|
+
};
|
|
3133
|
+
tippy.hideAll = hideAll;
|
|
3134
|
+
tippy.group = group;
|
|
3135
|
+
function autoInit() {
|
|
3136
|
+
arrayFrom(document.querySelectorAll('[data-tippy]')).forEach(function (el) {
|
|
3137
|
+
var content = el.getAttribute('data-tippy');
|
|
3138
|
+
if (content) {
|
|
3139
|
+
tippy(el, {
|
|
3140
|
+
content: content
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
3144
|
+
}
|
|
3145
|
+
if (isBrowser$1) {
|
|
3146
|
+
setTimeout(autoInit);
|
|
3147
|
+
}
|
|
3148
|
+
var getValidTippyProps = function getValidTippyProps(props) {
|
|
3149
|
+
var validProps = {};
|
|
3150
|
+
for (var key in props) {
|
|
3151
|
+
if (defaultProps.hasOwnProperty(key)) {
|
|
3152
|
+
validProps[key] = props[key];
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
return validProps;
|
|
3156
|
+
};
|
|
3157
|
+
|
|
3158
|
+
var defaultOptions = {
|
|
3159
|
+
duration: 0,
|
|
3160
|
+
arrow: true,
|
|
3161
|
+
size: 'small',
|
|
3162
|
+
trigger: 'mouseenter focus',
|
|
3163
|
+
theme: 'dark',
|
|
3164
|
+
interactive: true,
|
|
3165
|
+
boundary: 'window',
|
|
3166
|
+
content: '',
|
|
3167
|
+
allowHTML: true,
|
|
3168
|
+
extCls: ''
|
|
356
3169
|
};
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
3170
|
+
var validPlacements$1 = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
|
3171
|
+
var createTippy$1 = function createTippy(el, binding) {
|
|
3172
|
+
var value = binding.value;
|
|
3173
|
+
var options = _objectSpread({}, defaultOptions);
|
|
3174
|
+
if (_typeof(value) === 'object') {
|
|
3175
|
+
if (value.allowHtml || value.allowHTML) {
|
|
3176
|
+
value.allowHTML = true;
|
|
3177
|
+
}
|
|
3178
|
+
_extends(options, value);
|
|
362
3179
|
} else {
|
|
363
|
-
|
|
3180
|
+
options.content = value;
|
|
364
3181
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
var
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
el.classList.add(clsName);
|
|
375
|
-
} else if (!hasClass(el, clsName)) {
|
|
376
|
-
curClass += ' ' + clsName;
|
|
377
|
-
}
|
|
3182
|
+
var placement = validPlacements$1.find(function (placement) {
|
|
3183
|
+
return binding.modifiers[placement];
|
|
3184
|
+
});
|
|
3185
|
+
options.placement = options.placement || placement || (options.placements || ['top'])[0];
|
|
3186
|
+
var _binding$modifiers = binding.modifiers,
|
|
3187
|
+
click = _binding$modifiers.click,
|
|
3188
|
+
light = _binding$modifiers.light;
|
|
3189
|
+
if (click) {
|
|
3190
|
+
options.trigger = 'click';
|
|
378
3191
|
}
|
|
379
|
-
if (
|
|
380
|
-
|
|
3192
|
+
if (light) {
|
|
3193
|
+
options.theme = 'light';
|
|
381
3194
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
3195
|
+
if (options.allowHTML) {
|
|
3196
|
+
var selector = options.content;
|
|
3197
|
+
if (selector instanceof Vue) {
|
|
3198
|
+
options.content = selector.$el;
|
|
3199
|
+
} else if (typeof selector === 'string') {
|
|
3200
|
+
try {
|
|
3201
|
+
var element = document.querySelector(selector);
|
|
3202
|
+
if (element) {
|
|
3203
|
+
options.content = element;
|
|
3204
|
+
}
|
|
3205
|
+
} catch (e) {
|
|
3206
|
+
var _element = document.createElement('div');
|
|
3207
|
+
_element.innerHTML = selector;
|
|
3208
|
+
}
|
|
394
3209
|
}
|
|
395
3210
|
}
|
|
396
|
-
if (
|
|
397
|
-
|
|
3211
|
+
if (options.html) {
|
|
3212
|
+
options.content = options.html;
|
|
398
3213
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
if (!element || !styleName) return null;
|
|
402
|
-
styleName = camelCase(styleName);
|
|
403
|
-
if (styleName === 'float') {
|
|
404
|
-
styleName = 'styleFloat';
|
|
3214
|
+
if (typeof options.onClose === 'function') {
|
|
3215
|
+
options.onHide = options.onClose;
|
|
405
3216
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
3217
|
+
var validOptions = getValidTippyProps(options);
|
|
3218
|
+
return tippy(el, validOptions);
|
|
3219
|
+
};
|
|
3220
|
+
var bkTooltips = {
|
|
3221
|
+
inserted: function inserted(el, binding) {
|
|
3222
|
+
var disabled = _typeof(binding.value) === 'object' ? binding.value.disabled : false;
|
|
3223
|
+
if (!disabled) {
|
|
3224
|
+
el.tippyInstance = createTippy$1(el, binding);
|
|
3225
|
+
}
|
|
3226
|
+
},
|
|
3227
|
+
unbind: function unbind(el) {
|
|
3228
|
+
el._tippy && el._tippy.destroy();
|
|
3229
|
+
el.tippyInstance = null;
|
|
3230
|
+
},
|
|
3231
|
+
update: function update(el, binding) {
|
|
3232
|
+
var value = binding.value;
|
|
3233
|
+
var isObject = _typeof(value) === 'object';
|
|
3234
|
+
var content = isObject ? value.content : value;
|
|
3235
|
+
var disabled = isObject ? value.disabled : false;
|
|
3236
|
+
if (disabled || !content) {
|
|
3237
|
+
el._tippy && el._tippy.destroy();
|
|
3238
|
+
el.tippyInstance = null;
|
|
3239
|
+
} else if (content) {
|
|
3240
|
+
if (!el._tippy) {
|
|
3241
|
+
el.tippyInstance = createTippy$1(el, binding);
|
|
3242
|
+
} else {
|
|
3243
|
+
if (_typeof(value) === 'object' && (binding.value.allowHtml || binding.value.allowHTML)) {
|
|
3244
|
+
el.tippyInstance = createTippy$1(el, binding);
|
|
3245
|
+
} else {
|
|
3246
|
+
el._tippy.setContent(content);
|
|
413
3247
|
}
|
|
414
|
-
|
|
415
|
-
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
3248
|
+
}
|
|
416
3249
|
}
|
|
417
|
-
} catch (e) {
|
|
418
|
-
return element.style[styleName];
|
|
419
|
-
}
|
|
420
|
-
} : function (element, styleName) {
|
|
421
|
-
if (!element || !styleName) return null;
|
|
422
|
-
styleName = camelCase(styleName);
|
|
423
|
-
if (styleName === 'float') {
|
|
424
|
-
styleName = 'cssFloat';
|
|
425
|
-
}
|
|
426
|
-
try {
|
|
427
|
-
var computed = document.defaultView.getComputedStyle(element, '');
|
|
428
|
-
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
429
|
-
} catch (e) {
|
|
430
|
-
return element.style[styleName];
|
|
431
3250
|
}
|
|
432
3251
|
};
|
|
3252
|
+
bkTooltips.install = function (Vue) {
|
|
3253
|
+
Vue.directive('bkTooltips', bkTooltips);
|
|
3254
|
+
};
|
|
433
3255
|
|
|
434
3256
|
var script = {
|
|
435
3257
|
name: 'bk-input',
|
|
3258
|
+
directives: {
|
|
3259
|
+
bkTooltips: bkTooltips
|
|
3260
|
+
},
|
|
436
3261
|
mixins: [emitter, locale.mixin],
|
|
437
3262
|
props: {
|
|
438
3263
|
type: {
|
|
@@ -542,7 +3367,12 @@
|
|
|
542
3367
|
allowNumberPaste: {
|
|
543
3368
|
type: Boolean,
|
|
544
3369
|
default: false
|
|
545
|
-
}
|
|
3370
|
+
},
|
|
3371
|
+
showOverflowTooltips: {
|
|
3372
|
+
type: Boolean,
|
|
3373
|
+
default: false
|
|
3374
|
+
},
|
|
3375
|
+
initialControlValue: Number
|
|
546
3376
|
},
|
|
547
3377
|
data: function data() {
|
|
548
3378
|
return {
|
|
@@ -563,6 +3393,9 @@
|
|
|
563
3393
|
inputPasswordIcon: this.passwordIcon,
|
|
564
3394
|
inputRightPadding: '10px',
|
|
565
3395
|
iconAreaSizeObserver: null,
|
|
3396
|
+
inputResizeObserver: null,
|
|
3397
|
+
isInputOverflow: false,
|
|
3398
|
+
inputClientWidth: null,
|
|
566
3399
|
validKeyCodeList: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
|
|
567
3400
|
96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
|
|
568
3401
|
8,
|
|
@@ -634,6 +3467,13 @@
|
|
|
634
3467
|
return "bk-input-".concat(this.inputSize);
|
|
635
3468
|
}
|
|
636
3469
|
return '';
|
|
3470
|
+
},
|
|
3471
|
+
inputTooltips: function inputTooltips() {
|
|
3472
|
+
return {
|
|
3473
|
+
content: this.curValue,
|
|
3474
|
+
disabled: !this.showOverflowTooltips || this.type === 'password' || !this.isInputOverflow,
|
|
3475
|
+
width: this.inputClientWidth && this.inputClientWidth
|
|
3476
|
+
};
|
|
637
3477
|
}
|
|
638
3478
|
},
|
|
639
3479
|
watch: {
|
|
@@ -641,6 +3481,7 @@
|
|
|
641
3481
|
handler: function handler(val, old) {
|
|
642
3482
|
this.setCurValue(val);
|
|
643
3483
|
old === undefined && this.updateNumberValue(val);
|
|
3484
|
+
this.setOverflow();
|
|
644
3485
|
},
|
|
645
3486
|
immediate: true
|
|
646
3487
|
},
|
|
@@ -675,10 +3516,13 @@
|
|
|
675
3516
|
};
|
|
676
3517
|
}
|
|
677
3518
|
this.observerIconSize();
|
|
3519
|
+
this.observerInputSize();
|
|
678
3520
|
},
|
|
679
3521
|
beforeDestroy: function beforeDestroy() {
|
|
680
3522
|
this.iconAreaSizeObserver && typeof this.iconAreaSizeObserver.disconnect === 'function' && this.iconAreaSizeObserver.disconnect();
|
|
681
3523
|
this.iconAreaSizeObserver = null;
|
|
3524
|
+
this.inputResizeObserver && this.inputResizeObserver.disconnect();
|
|
3525
|
+
this.inputResizeObserver = null;
|
|
682
3526
|
},
|
|
683
3527
|
methods: {
|
|
684
3528
|
observerIconSize: function observerIconSize() {
|
|
@@ -705,6 +3549,41 @@
|
|
|
705
3549
|
this.iconAreaSizeObserver.observe(element);
|
|
706
3550
|
}
|
|
707
3551
|
},
|
|
3552
|
+
observerInputSize: function observerInputSize() {
|
|
3553
|
+
var _this3 = this;
|
|
3554
|
+
var element = this.$refs.input;
|
|
3555
|
+
if (!element) return;
|
|
3556
|
+
this.inputResizeObserver = new ResizeObserver(function (entries) {
|
|
3557
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
3558
|
+
_step2;
|
|
3559
|
+
try {
|
|
3560
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
3561
|
+
var entry = _step2.value;
|
|
3562
|
+
if (entry.target === element) {
|
|
3563
|
+
_this3.setOverflow();
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
} catch (err) {
|
|
3567
|
+
_iterator2.e(err);
|
|
3568
|
+
} finally {
|
|
3569
|
+
_iterator2.f();
|
|
3570
|
+
}
|
|
3571
|
+
});
|
|
3572
|
+
this.inputResizeObserver.observe(element);
|
|
3573
|
+
},
|
|
3574
|
+
setOverflow: function setOverflow() {
|
|
3575
|
+
var _this4 = this;
|
|
3576
|
+
setTimeout(function () {
|
|
3577
|
+
var inputEl = _this4.$refs.input;
|
|
3578
|
+
if (inputEl) {
|
|
3579
|
+
_this4.isInputOverflow = inputEl.scrollWidth > inputEl.clientWidth + 2;
|
|
3580
|
+
if (inputEl.clientWidth !== _this4.inputClientWidth) {
|
|
3581
|
+
_this4.$refs.inputWrapper._tippy && _this4.$refs.inputWrapper._tippy.destroy();
|
|
3582
|
+
}
|
|
3583
|
+
_this4.inputClientWidth = inputEl.clientWidth;
|
|
3584
|
+
}
|
|
3585
|
+
});
|
|
3586
|
+
},
|
|
708
3587
|
getAttributeByType: function getAttributeByType() {
|
|
709
3588
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
710
3589
|
var defaultAttr = {
|
|
@@ -790,7 +3669,9 @@
|
|
|
790
3669
|
}
|
|
791
3670
|
},
|
|
792
3671
|
handleNumberDelete: function handleNumberDelete(event) {
|
|
793
|
-
this.curValue === ''
|
|
3672
|
+
if (this.curValue === '') {
|
|
3673
|
+
this.curValue = this.initialControlValue === undefined ? this.max : Math.min(this.initialControlValue, this.max);
|
|
3674
|
+
}
|
|
794
3675
|
var curNumberValue = Number(this.curValue);
|
|
795
3676
|
if (curNumberValue - 1 >= this.min) {
|
|
796
3677
|
var curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '';
|
|
@@ -805,7 +3686,9 @@
|
|
|
805
3686
|
}
|
|
806
3687
|
},
|
|
807
3688
|
handleNumberAdd: function handleNumberAdd(event) {
|
|
808
|
-
this.curValue === ''
|
|
3689
|
+
if (this.curValue === '') {
|
|
3690
|
+
this.curValue = this.initialControlValue === undefined ? this.min : Math.max(this.initialControlValue, this.min);
|
|
3691
|
+
}
|
|
809
3692
|
var curNumberValue = Number(this.curValue);
|
|
810
3693
|
if (curNumberValue <= this.max - 1) {
|
|
811
3694
|
var curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '';
|
|
@@ -959,16 +3842,16 @@
|
|
|
959
3842
|
}
|
|
960
3843
|
},
|
|
961
3844
|
handlerInput: function handlerInput(event) {
|
|
962
|
-
var
|
|
3845
|
+
var _this5 = this;
|
|
963
3846
|
if (this.inputType === 'number' && this.isOnComposition) {
|
|
964
3847
|
return;
|
|
965
3848
|
}
|
|
966
3849
|
this.$nextTick(function () {
|
|
967
3850
|
var value = event.target.value;
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
3851
|
+
_this5.setCurValue(value);
|
|
3852
|
+
_this5.$emit('input', value, event);
|
|
3853
|
+
_this5.$emit('change', value, event);
|
|
3854
|
+
_this5.dispatch('bk-form-item', 'form-change');
|
|
972
3855
|
});
|
|
973
3856
|
},
|
|
974
3857
|
handlerClear: function handlerClear(event) {
|
|
@@ -1132,6 +4015,13 @@
|
|
|
1132
4015
|
}, [_c('span', {
|
|
1133
4016
|
staticClass: "strong"
|
|
1134
4017
|
}, [_vm._v(_vm._s(_vm.curValue && _vm.curValue.length || 0))]), _vm._v("/"), _c('span', [_vm._v(_vm._s(_vm.maxlength))])])] : _vm._e()], 2)] : [_c('div', {
|
|
4018
|
+
directives: [{
|
|
4019
|
+
name: "bk-tooltips",
|
|
4020
|
+
rawName: "v-bk-tooltips",
|
|
4021
|
+
value: _vm.inputTooltips,
|
|
4022
|
+
expression: "inputTooltips"
|
|
4023
|
+
}],
|
|
4024
|
+
ref: "inputWrapper",
|
|
1135
4025
|
class: ["bk-input-" + _vm.type]
|
|
1136
4026
|
}, [_c('input', _vm._b({
|
|
1137
4027
|
ref: "input",
|
|
@@ -1553,118 +4443,6 @@
|
|
|
1553
4443
|
staticRenderFns: __vue_staticRenderFns__$2
|
|
1554
4444
|
}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
|
|
1555
4445
|
|
|
1556
|
-
var _toObject = function (it) {
|
|
1557
|
-
return Object(_defined(it));
|
|
1558
|
-
};
|
|
1559
|
-
|
|
1560
|
-
var toString = {}.toString;
|
|
1561
|
-
var _cof = function (it) {
|
|
1562
|
-
return toString.call(it).slice(8, -1);
|
|
1563
|
-
};
|
|
1564
|
-
|
|
1565
|
-
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
1566
|
-
return _cof(it) == 'String' ? it.split('') : Object(it);
|
|
1567
|
-
};
|
|
1568
|
-
|
|
1569
|
-
var _toIobject = function (it) {
|
|
1570
|
-
return _iobject(_defined(it));
|
|
1571
|
-
};
|
|
1572
|
-
|
|
1573
|
-
var ceil = Math.ceil;
|
|
1574
|
-
var floor = Math.floor;
|
|
1575
|
-
var _toInteger = function (it) {
|
|
1576
|
-
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
var min = Math.min;
|
|
1580
|
-
var _toLength = function (it) {
|
|
1581
|
-
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
|
|
1582
|
-
};
|
|
1583
|
-
|
|
1584
|
-
var max = Math.max;
|
|
1585
|
-
var min$1 = Math.min;
|
|
1586
|
-
var _toAbsoluteIndex = function (index, length) {
|
|
1587
|
-
index = _toInteger(index);
|
|
1588
|
-
return index < 0 ? max(index + length, 0) : min$1(index, length);
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
|
-
var _arrayIncludes = function (IS_INCLUDES) {
|
|
1592
|
-
return function ($this, el, fromIndex) {
|
|
1593
|
-
var O = _toIobject($this);
|
|
1594
|
-
var length = _toLength(O.length);
|
|
1595
|
-
var index = _toAbsoluteIndex(fromIndex, length);
|
|
1596
|
-
var value;
|
|
1597
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
1598
|
-
value = O[index++];
|
|
1599
|
-
if (value != value) return true;
|
|
1600
|
-
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
1601
|
-
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
1602
|
-
} return !IS_INCLUDES && -1;
|
|
1603
|
-
};
|
|
1604
|
-
};
|
|
1605
|
-
|
|
1606
|
-
var _shared = createCommonjsModule(function (module) {
|
|
1607
|
-
var SHARED = '__core-js_shared__';
|
|
1608
|
-
var store = _global[SHARED] || (_global[SHARED] = {});
|
|
1609
|
-
(module.exports = function (key, value) {
|
|
1610
|
-
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1611
|
-
})('versions', []).push({
|
|
1612
|
-
version: _core.version,
|
|
1613
|
-
mode: 'pure' ,
|
|
1614
|
-
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
1615
|
-
});
|
|
1616
|
-
});
|
|
1617
|
-
|
|
1618
|
-
var id = 0;
|
|
1619
|
-
var px = Math.random();
|
|
1620
|
-
var _uid = function (key) {
|
|
1621
|
-
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
|
1622
|
-
};
|
|
1623
|
-
|
|
1624
|
-
var shared = _shared('keys');
|
|
1625
|
-
var _sharedKey = function (key) {
|
|
1626
|
-
return shared[key] || (shared[key] = _uid(key));
|
|
1627
|
-
};
|
|
1628
|
-
|
|
1629
|
-
var arrayIndexOf = _arrayIncludes(false);
|
|
1630
|
-
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
1631
|
-
var _objectKeysInternal = function (object, names) {
|
|
1632
|
-
var O = _toIobject(object);
|
|
1633
|
-
var i = 0;
|
|
1634
|
-
var result = [];
|
|
1635
|
-
var key;
|
|
1636
|
-
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
|
|
1637
|
-
while (names.length > i) if (_has(O, key = names[i++])) {
|
|
1638
|
-
~arrayIndexOf(result, key) || result.push(key);
|
|
1639
|
-
}
|
|
1640
|
-
return result;
|
|
1641
|
-
};
|
|
1642
|
-
|
|
1643
|
-
var _enumBugKeys = (
|
|
1644
|
-
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
1645
|
-
).split(',');
|
|
1646
|
-
|
|
1647
|
-
var _objectKeys = Object.keys || function keys(O) {
|
|
1648
|
-
return _objectKeysInternal(O, _enumBugKeys);
|
|
1649
|
-
};
|
|
1650
|
-
|
|
1651
|
-
var _objectSap = function (KEY, exec) {
|
|
1652
|
-
var fn = (_core.Object || {})[KEY] || Object[KEY];
|
|
1653
|
-
var exp = {};
|
|
1654
|
-
exp[KEY] = exec(fn);
|
|
1655
|
-
_export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
|
|
1656
|
-
};
|
|
1657
|
-
|
|
1658
|
-
_objectSap('keys', function () {
|
|
1659
|
-
return function keys(it) {
|
|
1660
|
-
return _objectKeys(_toObject(it));
|
|
1661
|
-
};
|
|
1662
|
-
});
|
|
1663
|
-
|
|
1664
|
-
var keys = _core.Object.keys;
|
|
1665
|
-
|
|
1666
|
-
var keys$1 = keys;
|
|
1667
|
-
|
|
1668
4446
|
function setInstaller (component, afterInstall) {
|
|
1669
4447
|
component.install = function (Vue) {
|
|
1670
4448
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|