bootstrap-table-fixed-columns.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  11. _typeof = function (obj) {
  12. return typeof obj;
  13. };
  14. } else {
  15. _typeof = function (obj) {
  16. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  17. };
  18. }
  19. return _typeof(obj);
  20. }
  21. function _classCallCheck(instance, Constructor) {
  22. if (!(instance instanceof Constructor)) {
  23. throw new TypeError("Cannot call a class as a function");
  24. }
  25. }
  26. function _defineProperties(target, props) {
  27. for (var i = 0; i < props.length; i++) {
  28. var descriptor = props[i];
  29. descriptor.enumerable = descriptor.enumerable || false;
  30. descriptor.configurable = true;
  31. if ("value" in descriptor) descriptor.writable = true;
  32. Object.defineProperty(target, descriptor.key, descriptor);
  33. }
  34. }
  35. function _createClass(Constructor, protoProps, staticProps) {
  36. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  37. if (staticProps) _defineProperties(Constructor, staticProps);
  38. return Constructor;
  39. }
  40. function _inherits(subClass, superClass) {
  41. if (typeof superClass !== "function" && superClass !== null) {
  42. throw new TypeError("Super expression must either be null or a function");
  43. }
  44. subClass.prototype = Object.create(superClass && superClass.prototype, {
  45. constructor: {
  46. value: subClass,
  47. writable: true,
  48. configurable: true
  49. }
  50. });
  51. if (superClass) _setPrototypeOf(subClass, superClass);
  52. }
  53. function _getPrototypeOf(o) {
  54. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  55. return o.__proto__ || Object.getPrototypeOf(o);
  56. };
  57. return _getPrototypeOf(o);
  58. }
  59. function _setPrototypeOf(o, p) {
  60. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  61. o.__proto__ = p;
  62. return o;
  63. };
  64. return _setPrototypeOf(o, p);
  65. }
  66. function _isNativeReflectConstruct() {
  67. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  68. if (Reflect.construct.sham) return false;
  69. if (typeof Proxy === "function") return true;
  70. try {
  71. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  72. return true;
  73. } catch (e) {
  74. return false;
  75. }
  76. }
  77. function _assertThisInitialized(self) {
  78. if (self === void 0) {
  79. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80. }
  81. return self;
  82. }
  83. function _possibleConstructorReturn(self, call) {
  84. if (call && (typeof call === "object" || typeof call === "function")) {
  85. return call;
  86. }
  87. return _assertThisInitialized(self);
  88. }
  89. function _createSuper(Derived) {
  90. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  91. return function _createSuperInternal() {
  92. var Super = _getPrototypeOf(Derived),
  93. result;
  94. if (hasNativeReflectConstruct) {
  95. var NewTarget = _getPrototypeOf(this).constructor;
  96. result = Reflect.construct(Super, arguments, NewTarget);
  97. } else {
  98. result = Super.apply(this, arguments);
  99. }
  100. return _possibleConstructorReturn(this, result);
  101. };
  102. }
  103. function _superPropBase(object, property) {
  104. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  105. object = _getPrototypeOf(object);
  106. if (object === null) break;
  107. }
  108. return object;
  109. }
  110. function _get(target, property, receiver) {
  111. if (typeof Reflect !== "undefined" && Reflect.get) {
  112. _get = Reflect.get;
  113. } else {
  114. _get = function _get(target, property, receiver) {
  115. var base = _superPropBase(target, property);
  116. if (!base) return;
  117. var desc = Object.getOwnPropertyDescriptor(base, property);
  118. if (desc.get) {
  119. return desc.get.call(receiver);
  120. }
  121. return desc.value;
  122. };
  123. }
  124. return _get(target, property, receiver || target);
  125. }
  126. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  127. function createCommonjsModule(fn, module) {
  128. return module = { exports: {} }, fn(module, module.exports), module.exports;
  129. }
  130. var check = function (it) {
  131. return it && it.Math == Math && it;
  132. };
  133. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  134. var global_1 =
  135. // eslint-disable-next-line es/no-global-this -- safe
  136. check(typeof globalThis == 'object' && globalThis) ||
  137. check(typeof window == 'object' && window) ||
  138. // eslint-disable-next-line no-restricted-globals -- safe
  139. check(typeof self == 'object' && self) ||
  140. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  141. // eslint-disable-next-line no-new-func -- fallback
  142. (function () { return this; })() || Function('return this')();
  143. var fails = function (exec) {
  144. try {
  145. return !!exec();
  146. } catch (error) {
  147. return true;
  148. }
  149. };
  150. // Detect IE8's incomplete defineProperty implementation
  151. var descriptors = !fails(function () {
  152. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  153. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  154. });
  155. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  156. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  157. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  158. // Nashorn ~ JDK8 bug
  159. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  160. // `Object.prototype.propertyIsEnumerable` method implementation
  161. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  162. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  163. var descriptor = getOwnPropertyDescriptor$1(this, V);
  164. return !!descriptor && descriptor.enumerable;
  165. } : $propertyIsEnumerable;
  166. var objectPropertyIsEnumerable = {
  167. f: f$4
  168. };
  169. var createPropertyDescriptor = function (bitmap, value) {
  170. return {
  171. enumerable: !(bitmap & 1),
  172. configurable: !(bitmap & 2),
  173. writable: !(bitmap & 4),
  174. value: value
  175. };
  176. };
  177. var toString = {}.toString;
  178. var classofRaw = function (it) {
  179. return toString.call(it).slice(8, -1);
  180. };
  181. var split = ''.split;
  182. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  183. var indexedObject = fails(function () {
  184. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  185. // eslint-disable-next-line no-prototype-builtins -- safe
  186. return !Object('z').propertyIsEnumerable(0);
  187. }) ? function (it) {
  188. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  189. } : Object;
  190. // `RequireObjectCoercible` abstract operation
  191. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  192. var requireObjectCoercible = function (it) {
  193. if (it == undefined) throw TypeError("Can't call method on " + it);
  194. return it;
  195. };
  196. // toObject with fallback for non-array-like ES3 strings
  197. var toIndexedObject = function (it) {
  198. return indexedObject(requireObjectCoercible(it));
  199. };
  200. var isObject = function (it) {
  201. return typeof it === 'object' ? it !== null : typeof it === 'function';
  202. };
  203. // `ToPrimitive` abstract operation
  204. // https://tc39.es/ecma262/#sec-toprimitive
  205. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  206. // and the second argument - flag - preferred type is a string
  207. var toPrimitive = function (input, PREFERRED_STRING) {
  208. if (!isObject(input)) return input;
  209. var fn, val;
  210. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  211. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  212. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  213. throw TypeError("Can't convert object to primitive value");
  214. };
  215. var hasOwnProperty = {}.hasOwnProperty;
  216. var has$1 = function (it, key) {
  217. return hasOwnProperty.call(it, key);
  218. };
  219. var document$1 = global_1.document;
  220. // typeof document.createElement is 'object' in old IE
  221. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  222. var documentCreateElement = function (it) {
  223. return EXISTS ? document$1.createElement(it) : {};
  224. };
  225. // Thank's IE8 for his funny defineProperty
  226. var ie8DomDefine = !descriptors && !fails(function () {
  227. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  228. return Object.defineProperty(documentCreateElement('div'), 'a', {
  229. get: function () { return 7; }
  230. }).a != 7;
  231. });
  232. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  233. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  234. // `Object.getOwnPropertyDescriptor` method
  235. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  236. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  237. O = toIndexedObject(O);
  238. P = toPrimitive(P, true);
  239. if (ie8DomDefine) try {
  240. return $getOwnPropertyDescriptor(O, P);
  241. } catch (error) { /* empty */ }
  242. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  243. };
  244. var objectGetOwnPropertyDescriptor = {
  245. f: f$3
  246. };
  247. var anObject = function (it) {
  248. if (!isObject(it)) {
  249. throw TypeError(String(it) + ' is not an object');
  250. } return it;
  251. };
  252. // eslint-disable-next-line es/no-object-defineproperty -- safe
  253. var $defineProperty = Object.defineProperty;
  254. // `Object.defineProperty` method
  255. // https://tc39.es/ecma262/#sec-object.defineproperty
  256. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  257. anObject(O);
  258. P = toPrimitive(P, true);
  259. anObject(Attributes);
  260. if (ie8DomDefine) try {
  261. return $defineProperty(O, P, Attributes);
  262. } catch (error) { /* empty */ }
  263. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  264. if ('value' in Attributes) O[P] = Attributes.value;
  265. return O;
  266. };
  267. var objectDefineProperty = {
  268. f: f$2
  269. };
  270. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  271. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  272. } : function (object, key, value) {
  273. object[key] = value;
  274. return object;
  275. };
  276. var setGlobal = function (key, value) {
  277. try {
  278. createNonEnumerableProperty(global_1, key, value);
  279. } catch (error) {
  280. global_1[key] = value;
  281. } return value;
  282. };
  283. var SHARED = '__core-js_shared__';
  284. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  285. var sharedStore = store$1;
  286. var functionToString = Function.toString;
  287. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  288. if (typeof sharedStore.inspectSource != 'function') {
  289. sharedStore.inspectSource = function (it) {
  290. return functionToString.call(it);
  291. };
  292. }
  293. var inspectSource = sharedStore.inspectSource;
  294. var WeakMap$1 = global_1.WeakMap;
  295. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  296. var shared = createCommonjsModule(function (module) {
  297. (module.exports = function (key, value) {
  298. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  299. })('versions', []).push({
  300. version: '3.10.1',
  301. mode: 'global',
  302. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  303. });
  304. });
  305. var id = 0;
  306. var postfix = Math.random();
  307. var uid = function (key) {
  308. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  309. };
  310. var keys = shared('keys');
  311. var sharedKey = function (key) {
  312. return keys[key] || (keys[key] = uid(key));
  313. };
  314. var hiddenKeys$1 = {};
  315. var WeakMap = global_1.WeakMap;
  316. var set, get, has;
  317. var enforce = function (it) {
  318. return has(it) ? get(it) : set(it, {});
  319. };
  320. var getterFor = function (TYPE) {
  321. return function (it) {
  322. var state;
  323. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  324. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  325. } return state;
  326. };
  327. };
  328. if (nativeWeakMap) {
  329. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  330. var wmget = store.get;
  331. var wmhas = store.has;
  332. var wmset = store.set;
  333. set = function (it, metadata) {
  334. metadata.facade = it;
  335. wmset.call(store, it, metadata);
  336. return metadata;
  337. };
  338. get = function (it) {
  339. return wmget.call(store, it) || {};
  340. };
  341. has = function (it) {
  342. return wmhas.call(store, it);
  343. };
  344. } else {
  345. var STATE = sharedKey('state');
  346. hiddenKeys$1[STATE] = true;
  347. set = function (it, metadata) {
  348. metadata.facade = it;
  349. createNonEnumerableProperty(it, STATE, metadata);
  350. return metadata;
  351. };
  352. get = function (it) {
  353. return has$1(it, STATE) ? it[STATE] : {};
  354. };
  355. has = function (it) {
  356. return has$1(it, STATE);
  357. };
  358. }
  359. var internalState = {
  360. set: set,
  361. get: get,
  362. has: has,
  363. enforce: enforce,
  364. getterFor: getterFor
  365. };
  366. var redefine = createCommonjsModule(function (module) {
  367. var getInternalState = internalState.get;
  368. var enforceInternalState = internalState.enforce;
  369. var TEMPLATE = String(String).split('String');
  370. (module.exports = function (O, key, value, options) {
  371. var unsafe = options ? !!options.unsafe : false;
  372. var simple = options ? !!options.enumerable : false;
  373. var noTargetGet = options ? !!options.noTargetGet : false;
  374. var state;
  375. if (typeof value == 'function') {
  376. if (typeof key == 'string' && !has$1(value, 'name')) {
  377. createNonEnumerableProperty(value, 'name', key);
  378. }
  379. state = enforceInternalState(value);
  380. if (!state.source) {
  381. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  382. }
  383. }
  384. if (O === global_1) {
  385. if (simple) O[key] = value;
  386. else setGlobal(key, value);
  387. return;
  388. } else if (!unsafe) {
  389. delete O[key];
  390. } else if (!noTargetGet && O[key]) {
  391. simple = true;
  392. }
  393. if (simple) O[key] = value;
  394. else createNonEnumerableProperty(O, key, value);
  395. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  396. })(Function.prototype, 'toString', function toString() {
  397. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  398. });
  399. });
  400. var path = global_1;
  401. var aFunction$1 = function (variable) {
  402. return typeof variable == 'function' ? variable : undefined;
  403. };
  404. var getBuiltIn = function (namespace, method) {
  405. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  406. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  407. };
  408. var ceil = Math.ceil;
  409. var floor = Math.floor;
  410. // `ToInteger` abstract operation
  411. // https://tc39.es/ecma262/#sec-tointeger
  412. var toInteger = function (argument) {
  413. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  414. };
  415. var min$1 = Math.min;
  416. // `ToLength` abstract operation
  417. // https://tc39.es/ecma262/#sec-tolength
  418. var toLength = function (argument) {
  419. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  420. };
  421. var max = Math.max;
  422. var min = Math.min;
  423. // Helper for a popular repeating case of the spec:
  424. // Let integer be ? ToInteger(index).
  425. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  426. var toAbsoluteIndex = function (index, length) {
  427. var integer = toInteger(index);
  428. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  429. };
  430. // `Array.prototype.{ indexOf, includes }` methods implementation
  431. var createMethod$2 = function (IS_INCLUDES) {
  432. return function ($this, el, fromIndex) {
  433. var O = toIndexedObject($this);
  434. var length = toLength(O.length);
  435. var index = toAbsoluteIndex(fromIndex, length);
  436. var value;
  437. // Array#includes uses SameValueZero equality algorithm
  438. // eslint-disable-next-line no-self-compare -- NaN check
  439. if (IS_INCLUDES && el != el) while (length > index) {
  440. value = O[index++];
  441. // eslint-disable-next-line no-self-compare -- NaN check
  442. if (value != value) return true;
  443. // Array#indexOf ignores holes, Array#includes - not
  444. } else for (;length > index; index++) {
  445. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  446. } return !IS_INCLUDES && -1;
  447. };
  448. };
  449. var arrayIncludes = {
  450. // `Array.prototype.includes` method
  451. // https://tc39.es/ecma262/#sec-array.prototype.includes
  452. includes: createMethod$2(true),
  453. // `Array.prototype.indexOf` method
  454. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  455. indexOf: createMethod$2(false)
  456. };
  457. var indexOf = arrayIncludes.indexOf;
  458. var objectKeysInternal = function (object, names) {
  459. var O = toIndexedObject(object);
  460. var i = 0;
  461. var result = [];
  462. var key;
  463. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  464. // Don't enum bug & hidden keys
  465. while (names.length > i) if (has$1(O, key = names[i++])) {
  466. ~indexOf(result, key) || result.push(key);
  467. }
  468. return result;
  469. };
  470. // IE8- don't enum bug keys
  471. var enumBugKeys = [
  472. 'constructor',
  473. 'hasOwnProperty',
  474. 'isPrototypeOf',
  475. 'propertyIsEnumerable',
  476. 'toLocaleString',
  477. 'toString',
  478. 'valueOf'
  479. ];
  480. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  481. // `Object.getOwnPropertyNames` method
  482. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  483. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  484. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  485. return objectKeysInternal(O, hiddenKeys);
  486. };
  487. var objectGetOwnPropertyNames = {
  488. f: f$1
  489. };
  490. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  491. var f = Object.getOwnPropertySymbols;
  492. var objectGetOwnPropertySymbols = {
  493. f: f
  494. };
  495. // all object keys, includes non-enumerable and symbols
  496. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  497. var keys = objectGetOwnPropertyNames.f(anObject(it));
  498. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  499. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  500. };
  501. var copyConstructorProperties = function (target, source) {
  502. var keys = ownKeys(source);
  503. var defineProperty = objectDefineProperty.f;
  504. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  505. for (var i = 0; i < keys.length; i++) {
  506. var key = keys[i];
  507. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  508. }
  509. };
  510. var replacement = /#|\.prototype\./;
  511. var isForced = function (feature, detection) {
  512. var value = data[normalize(feature)];
  513. return value == POLYFILL ? true
  514. : value == NATIVE ? false
  515. : typeof detection == 'function' ? fails(detection)
  516. : !!detection;
  517. };
  518. var normalize = isForced.normalize = function (string) {
  519. return String(string).replace(replacement, '.').toLowerCase();
  520. };
  521. var data = isForced.data = {};
  522. var NATIVE = isForced.NATIVE = 'N';
  523. var POLYFILL = isForced.POLYFILL = 'P';
  524. var isForced_1 = isForced;
  525. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  526. /*
  527. options.target - name of the target object
  528. options.global - target is the global object
  529. options.stat - export as static methods of target
  530. options.proto - export as prototype methods of target
  531. options.real - real prototype method for the `pure` version
  532. options.forced - export even if the native feature is available
  533. options.bind - bind methods to the target, required for the `pure` version
  534. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  535. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  536. options.sham - add a flag to not completely full polyfills
  537. options.enumerable - export as enumerable property
  538. options.noTargetGet - prevent calling a getter on target
  539. */
  540. var _export = function (options, source) {
  541. var TARGET = options.target;
  542. var GLOBAL = options.global;
  543. var STATIC = options.stat;
  544. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  545. if (GLOBAL) {
  546. target = global_1;
  547. } else if (STATIC) {
  548. target = global_1[TARGET] || setGlobal(TARGET, {});
  549. } else {
  550. target = (global_1[TARGET] || {}).prototype;
  551. }
  552. if (target) for (key in source) {
  553. sourceProperty = source[key];
  554. if (options.noTargetGet) {
  555. descriptor = getOwnPropertyDescriptor(target, key);
  556. targetProperty = descriptor && descriptor.value;
  557. } else targetProperty = target[key];
  558. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  559. // contained in target
  560. if (!FORCED && targetProperty !== undefined) {
  561. if (typeof sourceProperty === typeof targetProperty) continue;
  562. copyConstructorProperties(sourceProperty, targetProperty);
  563. }
  564. // add a flag to not completely full polyfills
  565. if (options.sham || (targetProperty && targetProperty.sham)) {
  566. createNonEnumerableProperty(sourceProperty, 'sham', true);
  567. }
  568. // extend global
  569. redefine(target, key, sourceProperty, options);
  570. }
  571. };
  572. var aFunction = function (it) {
  573. if (typeof it != 'function') {
  574. throw TypeError(String(it) + ' is not a function');
  575. } return it;
  576. };
  577. // optional / simple context binding
  578. var functionBindContext = function (fn, that, length) {
  579. aFunction(fn);
  580. if (that === undefined) return fn;
  581. switch (length) {
  582. case 0: return function () {
  583. return fn.call(that);
  584. };
  585. case 1: return function (a) {
  586. return fn.call(that, a);
  587. };
  588. case 2: return function (a, b) {
  589. return fn.call(that, a, b);
  590. };
  591. case 3: return function (a, b, c) {
  592. return fn.call(that, a, b, c);
  593. };
  594. }
  595. return function (/* ...args */) {
  596. return fn.apply(that, arguments);
  597. };
  598. };
  599. // `ToObject` abstract operation
  600. // https://tc39.es/ecma262/#sec-toobject
  601. var toObject = function (argument) {
  602. return Object(requireObjectCoercible(argument));
  603. };
  604. // `IsArray` abstract operation
  605. // https://tc39.es/ecma262/#sec-isarray
  606. // eslint-disable-next-line es/no-array-isarray -- safe
  607. var isArray = Array.isArray || function isArray(arg) {
  608. return classofRaw(arg) == 'Array';
  609. };
  610. var engineIsNode = classofRaw(global_1.process) == 'process';
  611. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  612. var process = global_1.process;
  613. var versions = process && process.versions;
  614. var v8 = versions && versions.v8;
  615. var match, version;
  616. if (v8) {
  617. match = v8.split('.');
  618. version = match[0] + match[1];
  619. } else if (engineUserAgent) {
  620. match = engineUserAgent.match(/Edge\/(\d+)/);
  621. if (!match || match[1] >= 74) {
  622. match = engineUserAgent.match(/Chrome\/(\d+)/);
  623. if (match) version = match[1];
  624. }
  625. }
  626. var engineV8Version = version && +version;
  627. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  628. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  629. // eslint-disable-next-line es/no-symbol -- required for testing
  630. return !Symbol.sham &&
  631. // Chrome 38 Symbol has incorrect toString conversion
  632. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  633. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  634. });
  635. /* eslint-disable es/no-symbol -- required for testing */
  636. var useSymbolAsUid = nativeSymbol
  637. && !Symbol.sham
  638. && typeof Symbol.iterator == 'symbol';
  639. var WellKnownSymbolsStore = shared('wks');
  640. var Symbol$1 = global_1.Symbol;
  641. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  642. var wellKnownSymbol = function (name) {
  643. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  644. if (nativeSymbol && has$1(Symbol$1, name)) {
  645. WellKnownSymbolsStore[name] = Symbol$1[name];
  646. } else {
  647. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  648. }
  649. } return WellKnownSymbolsStore[name];
  650. };
  651. var SPECIES$1 = wellKnownSymbol('species');
  652. // `ArraySpeciesCreate` abstract operation
  653. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  654. var arraySpeciesCreate = function (originalArray, length) {
  655. var C;
  656. if (isArray(originalArray)) {
  657. C = originalArray.constructor;
  658. // cross-realm fallback
  659. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  660. else if (isObject(C)) {
  661. C = C[SPECIES$1];
  662. if (C === null) C = undefined;
  663. }
  664. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  665. };
  666. var push = [].push;
  667. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  668. var createMethod$1 = function (TYPE) {
  669. var IS_MAP = TYPE == 1;
  670. var IS_FILTER = TYPE == 2;
  671. var IS_SOME = TYPE == 3;
  672. var IS_EVERY = TYPE == 4;
  673. var IS_FIND_INDEX = TYPE == 6;
  674. var IS_FILTER_OUT = TYPE == 7;
  675. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  676. return function ($this, callbackfn, that, specificCreate) {
  677. var O = toObject($this);
  678. var self = indexedObject(O);
  679. var boundFunction = functionBindContext(callbackfn, that, 3);
  680. var length = toLength(self.length);
  681. var index = 0;
  682. var create = specificCreate || arraySpeciesCreate;
  683. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  684. var value, result;
  685. for (;length > index; index++) if (NO_HOLES || index in self) {
  686. value = self[index];
  687. result = boundFunction(value, index, O);
  688. if (TYPE) {
  689. if (IS_MAP) target[index] = result; // map
  690. else if (result) switch (TYPE) {
  691. case 3: return true; // some
  692. case 5: return value; // find
  693. case 6: return index; // findIndex
  694. case 2: push.call(target, value); // filter
  695. } else switch (TYPE) {
  696. case 4: return false; // every
  697. case 7: push.call(target, value); // filterOut
  698. }
  699. }
  700. }
  701. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  702. };
  703. };
  704. var arrayIteration = {
  705. // `Array.prototype.forEach` method
  706. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  707. forEach: createMethod$1(0),
  708. // `Array.prototype.map` method
  709. // https://tc39.es/ecma262/#sec-array.prototype.map
  710. map: createMethod$1(1),
  711. // `Array.prototype.filter` method
  712. // https://tc39.es/ecma262/#sec-array.prototype.filter
  713. filter: createMethod$1(2),
  714. // `Array.prototype.some` method
  715. // https://tc39.es/ecma262/#sec-array.prototype.some
  716. some: createMethod$1(3),
  717. // `Array.prototype.every` method
  718. // https://tc39.es/ecma262/#sec-array.prototype.every
  719. every: createMethod$1(4),
  720. // `Array.prototype.find` method
  721. // https://tc39.es/ecma262/#sec-array.prototype.find
  722. find: createMethod$1(5),
  723. // `Array.prototype.findIndex` method
  724. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  725. findIndex: createMethod$1(6),
  726. // `Array.prototype.filterOut` method
  727. // https://github.com/tc39/proposal-array-filtering
  728. filterOut: createMethod$1(7)
  729. };
  730. // `Object.keys` method
  731. // https://tc39.es/ecma262/#sec-object.keys
  732. // eslint-disable-next-line es/no-object-keys -- safe
  733. var objectKeys = Object.keys || function keys(O) {
  734. return objectKeysInternal(O, enumBugKeys);
  735. };
  736. // `Object.defineProperties` method
  737. // https://tc39.es/ecma262/#sec-object.defineproperties
  738. // eslint-disable-next-line es/no-object-defineproperties -- safe
  739. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  740. anObject(O);
  741. var keys = objectKeys(Properties);
  742. var length = keys.length;
  743. var index = 0;
  744. var key;
  745. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  746. return O;
  747. };
  748. var html = getBuiltIn('document', 'documentElement');
  749. var GT = '>';
  750. var LT = '<';
  751. var PROTOTYPE = 'prototype';
  752. var SCRIPT = 'script';
  753. var IE_PROTO = sharedKey('IE_PROTO');
  754. var EmptyConstructor = function () { /* empty */ };
  755. var scriptTag = function (content) {
  756. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  757. };
  758. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  759. var NullProtoObjectViaActiveX = function (activeXDocument) {
  760. activeXDocument.write(scriptTag(''));
  761. activeXDocument.close();
  762. var temp = activeXDocument.parentWindow.Object;
  763. activeXDocument = null; // avoid memory leak
  764. return temp;
  765. };
  766. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  767. var NullProtoObjectViaIFrame = function () {
  768. // Thrash, waste and sodomy: IE GC bug
  769. var iframe = documentCreateElement('iframe');
  770. var JS = 'java' + SCRIPT + ':';
  771. var iframeDocument;
  772. iframe.style.display = 'none';
  773. html.appendChild(iframe);
  774. // https://github.com/zloirock/core-js/issues/475
  775. iframe.src = String(JS);
  776. iframeDocument = iframe.contentWindow.document;
  777. iframeDocument.open();
  778. iframeDocument.write(scriptTag('document.F=Object'));
  779. iframeDocument.close();
  780. return iframeDocument.F;
  781. };
  782. // Check for document.domain and active x support
  783. // No need to use active x approach when document.domain is not set
  784. // see https://github.com/es-shims/es5-shim/issues/150
  785. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  786. // avoid IE GC bug
  787. var activeXDocument;
  788. var NullProtoObject = function () {
  789. try {
  790. /* global ActiveXObject -- old IE */
  791. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  792. } catch (error) { /* ignore */ }
  793. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  794. var length = enumBugKeys.length;
  795. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  796. return NullProtoObject();
  797. };
  798. hiddenKeys$1[IE_PROTO] = true;
  799. // `Object.create` method
  800. // https://tc39.es/ecma262/#sec-object.create
  801. var objectCreate = Object.create || function create(O, Properties) {
  802. var result;
  803. if (O !== null) {
  804. EmptyConstructor[PROTOTYPE] = anObject(O);
  805. result = new EmptyConstructor();
  806. EmptyConstructor[PROTOTYPE] = null;
  807. // add "__proto__" for Object.getPrototypeOf polyfill
  808. result[IE_PROTO] = O;
  809. } else result = NullProtoObject();
  810. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  811. };
  812. var UNSCOPABLES = wellKnownSymbol('unscopables');
  813. var ArrayPrototype = Array.prototype;
  814. // Array.prototype[@@unscopables]
  815. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  816. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  817. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  818. configurable: true,
  819. value: objectCreate(null)
  820. });
  821. }
  822. // add a key to Array.prototype[@@unscopables]
  823. var addToUnscopables = function (key) {
  824. ArrayPrototype[UNSCOPABLES][key] = true;
  825. };
  826. var $find = arrayIteration.find;
  827. var FIND = 'find';
  828. var SKIPS_HOLES = true;
  829. // Shouldn't skip holes
  830. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  831. // `Array.prototype.find` method
  832. // https://tc39.es/ecma262/#sec-array.prototype.find
  833. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  834. find: function find(callbackfn /* , that = undefined */) {
  835. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  836. }
  837. });
  838. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  839. addToUnscopables(FIND);
  840. var createProperty = function (object, key, value) {
  841. var propertyKey = toPrimitive(key);
  842. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  843. else object[propertyKey] = value;
  844. };
  845. var SPECIES = wellKnownSymbol('species');
  846. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  847. // We can't use this feature detection in V8 since it causes
  848. // deoptimization and serious performance degradation
  849. // https://github.com/zloirock/core-js/issues/677
  850. return engineV8Version >= 51 || !fails(function () {
  851. var array = [];
  852. var constructor = array.constructor = {};
  853. constructor[SPECIES] = function () {
  854. return { foo: 1 };
  855. };
  856. return array[METHOD_NAME](Boolean).foo !== 1;
  857. });
  858. };
  859. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  860. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  861. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  862. // We can't use this feature detection in V8 since it causes
  863. // deoptimization and serious performance degradation
  864. // https://github.com/zloirock/core-js/issues/679
  865. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  866. var array = [];
  867. array[IS_CONCAT_SPREADABLE] = false;
  868. return array.concat()[0] !== array;
  869. });
  870. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  871. var isConcatSpreadable = function (O) {
  872. if (!isObject(O)) return false;
  873. var spreadable = O[IS_CONCAT_SPREADABLE];
  874. return spreadable !== undefined ? !!spreadable : isArray(O);
  875. };
  876. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  877. // `Array.prototype.concat` method
  878. // https://tc39.es/ecma262/#sec-array.prototype.concat
  879. // with adding support of @@isConcatSpreadable and @@species
  880. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  881. // eslint-disable-next-line no-unused-vars -- required for `.length`
  882. concat: function concat(arg) {
  883. var O = toObject(this);
  884. var A = arraySpeciesCreate(O, 0);
  885. var n = 0;
  886. var i, k, length, len, E;
  887. for (i = -1, length = arguments.length; i < length; i++) {
  888. E = i === -1 ? O : arguments[i];
  889. if (isConcatSpreadable(E)) {
  890. len = toLength(E.length);
  891. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  892. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  893. } else {
  894. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  895. createProperty(A, n++, E);
  896. }
  897. }
  898. A.length = n;
  899. return A;
  900. }
  901. });
  902. var nativeReverse = [].reverse;
  903. var test = [1, 2];
  904. // `Array.prototype.reverse` method
  905. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  906. // fix for Safari 12.0 bug
  907. // https://bugs.webkit.org/show_bug.cgi?id=188794
  908. _export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
  909. reverse: function reverse() {
  910. // eslint-disable-next-line no-self-assign -- dirty hack
  911. if (isArray(this)) this.length = this.length;
  912. return nativeReverse.call(this);
  913. }
  914. });
  915. // a string of all valid unicode whitespaces
  916. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  917. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  918. var whitespace = '[' + whitespaces + ']';
  919. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  920. var rtrim = RegExp(whitespace + whitespace + '*$');
  921. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  922. var createMethod = function (TYPE) {
  923. return function ($this) {
  924. var string = String(requireObjectCoercible($this));
  925. if (TYPE & 1) string = string.replace(ltrim, '');
  926. if (TYPE & 2) string = string.replace(rtrim, '');
  927. return string;
  928. };
  929. };
  930. var stringTrim = {
  931. // `String.prototype.{ trimLeft, trimStart }` methods
  932. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  933. start: createMethod(1),
  934. // `String.prototype.{ trimRight, trimEnd }` methods
  935. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  936. end: createMethod(2),
  937. // `String.prototype.trim` method
  938. // https://tc39.es/ecma262/#sec-string.prototype.trim
  939. trim: createMethod(3)
  940. };
  941. var trim = stringTrim.trim;
  942. var $parseInt = global_1.parseInt;
  943. var hex = /^[+-]?0[Xx]/;
  944. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
  945. // `parseInt` method
  946. // https://tc39.es/ecma262/#sec-parseint-string-radix
  947. var numberParseInt = FORCED ? function parseInt(string, radix) {
  948. var S = trim(String(string));
  949. return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  950. } : $parseInt;
  951. // `parseInt` method
  952. // https://tc39.es/ecma262/#sec-parseint-string-radix
  953. _export({ global: true, forced: parseInt != numberParseInt }, {
  954. parseInt: numberParseInt
  955. });
  956. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  957. var method = [][METHOD_NAME];
  958. return !!method && fails(function () {
  959. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  960. method.call(null, argument || function () { throw 1; }, 1);
  961. });
  962. };
  963. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  964. var $indexOf = arrayIncludes.indexOf;
  965. var nativeIndexOf = [].indexOf;
  966. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  967. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  968. // `Array.prototype.indexOf` method
  969. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  970. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  971. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  972. return NEGATIVE_ZERO
  973. // convert -0 to +0
  974. ? nativeIndexOf.apply(this, arguments) || 0
  975. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  976. }
  977. });
  978. /**
  979. * @author zhixin wen <wenzhixin2010@gmail.com>
  980. */
  981. var Utils = $__default['default'].fn.bootstrapTable.utils; // Reasonable defaults
  982. var PIXEL_STEP = 10;
  983. var LINE_HEIGHT = 40;
  984. var PAGE_HEIGHT = 800;
  985. function normalizeWheel(event) {
  986. var sX = 0; // spinX
  987. var sY = 0; // spinY
  988. var pX = 0; // pixelX
  989. var pY = 0; // pixelY
  990. // Legacy
  991. if ('detail' in event) {
  992. sY = event.detail;
  993. }
  994. if ('wheelDelta' in event) {
  995. sY = -event.wheelDelta / 120;
  996. }
  997. if ('wheelDeltaY' in event) {
  998. sY = -event.wheelDeltaY / 120;
  999. }
  1000. if ('wheelDeltaX' in event) {
  1001. sX = -event.wheelDeltaX / 120;
  1002. } // side scrolling on FF with DOMMouseScroll
  1003. if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
  1004. sX = sY;
  1005. sY = 0;
  1006. }
  1007. pX = sX * PIXEL_STEP;
  1008. pY = sY * PIXEL_STEP;
  1009. if ('deltaY' in event) {
  1010. pY = event.deltaY;
  1011. }
  1012. if ('deltaX' in event) {
  1013. pX = event.deltaX;
  1014. }
  1015. if ((pX || pY) && event.deltaMode) {
  1016. if (event.deltaMode === 1) {
  1017. // delta in LINE units
  1018. pX *= LINE_HEIGHT;
  1019. pY *= LINE_HEIGHT;
  1020. } else {
  1021. // delta in PAGE units
  1022. pX *= PAGE_HEIGHT;
  1023. pY *= PAGE_HEIGHT;
  1024. }
  1025. } // Fall-back if spin cannot be determined
  1026. if (pX && !sX) {
  1027. sX = pX < 1 ? -1 : 1;
  1028. }
  1029. if (pY && !sY) {
  1030. sY = pY < 1 ? -1 : 1;
  1031. }
  1032. return {
  1033. spinX: sX,
  1034. spinY: sY,
  1035. pixelX: pX,
  1036. pixelY: pY
  1037. };
  1038. }
  1039. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1040. fixedColumns: false,
  1041. fixedNumber: 0,
  1042. fixedRightNumber: 0
  1043. });
  1044. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1045. _inherits(_class, _$$BootstrapTable);
  1046. var _super = _createSuper(_class);
  1047. function _class() {
  1048. _classCallCheck(this, _class);
  1049. return _super.apply(this, arguments);
  1050. }
  1051. _createClass(_class, [{
  1052. key: "fixedColumnsSupported",
  1053. value: function fixedColumnsSupported() {
  1054. return this.options.fixedColumns && !this.options.detailView && !this.options.cardView;
  1055. }
  1056. }, {
  1057. key: "initContainer",
  1058. value: function initContainer() {
  1059. _get(_getPrototypeOf(_class.prototype), "initContainer", this).call(this);
  1060. if (!this.fixedColumnsSupported()) {
  1061. return;
  1062. }
  1063. if (this.options.fixedNumber) {
  1064. this.$tableContainer.append('<div class="fixed-columns"></div>');
  1065. this.$fixedColumns = this.$tableContainer.find('.fixed-columns');
  1066. }
  1067. if (this.options.fixedRightNumber) {
  1068. this.$tableContainer.append('<div class="fixed-columns-right"></div>');
  1069. this.$fixedColumnsRight = this.$tableContainer.find('.fixed-columns-right');
  1070. }
  1071. }
  1072. }, {
  1073. key: "initBody",
  1074. value: function initBody() {
  1075. var _get2;
  1076. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1077. args[_key] = arguments[_key];
  1078. }
  1079. (_get2 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get2, [this].concat(args));
  1080. if (this.$fixedColumns && this.$fixedColumns.length) {
  1081. this.$fixedColumns.toggle(this.fixedColumnsSupported());
  1082. }
  1083. if (this.$fixedColumnsRight && this.$fixedColumnsRight.length) {
  1084. this.$fixedColumnsRight.toggle(this.fixedColumnsSupported());
  1085. }
  1086. if (!this.fixedColumnsSupported()) {
  1087. return;
  1088. }
  1089. if (this.options.showHeader && this.options.height) {
  1090. return;
  1091. }
  1092. this.initFixedColumnsBody();
  1093. this.initFixedColumnsEvents();
  1094. }
  1095. }, {
  1096. key: "trigger",
  1097. value: function trigger() {
  1098. var _get3;
  1099. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1100. args[_key2] = arguments[_key2];
  1101. }
  1102. (_get3 = _get(_getPrototypeOf(_class.prototype), "trigger", this)).call.apply(_get3, [this].concat(args));
  1103. if (!this.fixedColumnsSupported()) {
  1104. return;
  1105. }
  1106. if (args[0] === 'post-header') {
  1107. this.initFixedColumnsHeader();
  1108. } else if (args[0] === 'scroll-body') {
  1109. if (this.needFixedColumns && this.options.fixedNumber) {
  1110. this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
  1111. }
  1112. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1113. this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
  1114. }
  1115. }
  1116. }
  1117. }, {
  1118. key: "updateSelected",
  1119. value: function updateSelected() {
  1120. var _this = this;
  1121. _get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
  1122. if (!this.fixedColumnsSupported()) {
  1123. return;
  1124. }
  1125. this.$tableBody.find('tr').each(function (i, el) {
  1126. var $el = $__default['default'](el);
  1127. var index = $el.data('index');
  1128. var classes = $el.attr('class');
  1129. var inputSelector = "[name=\"".concat(_this.options.selectItemName, "\"]");
  1130. var $input = $el.find(inputSelector);
  1131. if (_typeof(index) === undefined) {
  1132. return;
  1133. }
  1134. var updateFixedBody = function updateFixedBody($fixedHeader, $fixedBody) {
  1135. var $tr = $fixedBody.find("tr[data-index=\"".concat(index, "\"]"));
  1136. $tr.attr('class', classes);
  1137. if ($input.length) {
  1138. $tr.find(inputSelector).prop('checked', $input.prop('checked'));
  1139. }
  1140. if (_this.$selectAll.length) {
  1141. $fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', _this.$selectAll.prop('checked'));
  1142. }
  1143. };
  1144. if (_this.$fixedBody && _this.options.fixedNumber) {
  1145. updateFixedBody(_this.$fixedHeader, _this.$fixedBody);
  1146. }
  1147. if (_this.$fixedBodyRight && _this.options.fixedRightNumber) {
  1148. updateFixedBody(_this.$fixedHeaderRight, _this.$fixedBodyRight);
  1149. }
  1150. });
  1151. }
  1152. }, {
  1153. key: "hideLoading",
  1154. value: function hideLoading() {
  1155. _get(_getPrototypeOf(_class.prototype), "hideLoading", this).call(this);
  1156. if (this.needFixedColumns && this.options.fixedNumber) {
  1157. this.$fixedColumns.find('.fixed-table-loading').hide();
  1158. }
  1159. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1160. this.$fixedColumnsRight.find('.fixed-table-loading').hide();
  1161. }
  1162. }
  1163. }, {
  1164. key: "initFixedColumnsHeader",
  1165. value: function initFixedColumnsHeader() {
  1166. var _this2 = this;
  1167. if (this.options.height) {
  1168. this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true);
  1169. } else {
  1170. this.needFixedColumns = this.$tableBody.outerWidth(true) < this.$tableBody.find('table').outerWidth(true);
  1171. }
  1172. var initFixedHeader = function initFixedHeader($fixedColumns, isRight) {
  1173. $fixedColumns.find('.fixed-table-header').remove();
  1174. $fixedColumns.append(_this2.$tableHeader.clone(true));
  1175. $fixedColumns.css({
  1176. width: _this2.getFixedColumnsWidth(isRight)
  1177. });
  1178. return $fixedColumns.find('.fixed-table-header');
  1179. };
  1180. if (this.needFixedColumns && this.options.fixedNumber) {
  1181. this.$fixedHeader = initFixedHeader(this.$fixedColumns);
  1182. this.$fixedHeader.css('margin-right', '');
  1183. } else if (this.$fixedColumns) {
  1184. this.$fixedColumns.html('').css('width', '');
  1185. }
  1186. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1187. this.$fixedHeaderRight = initFixedHeader(this.$fixedColumnsRight, true);
  1188. this.$fixedHeaderRight.scrollLeft(this.$fixedHeaderRight.find('table').width());
  1189. } else if (this.$fixedColumnsRight) {
  1190. this.$fixedColumnsRight.html('').css('width', '');
  1191. }
  1192. this.initFixedColumnsBody();
  1193. this.initFixedColumnsEvents();
  1194. }
  1195. }, {
  1196. key: "initFixedColumnsBody",
  1197. value: function initFixedColumnsBody() {
  1198. var _this3 = this;
  1199. var initFixedBody = function initFixedBody($fixedColumns, $fixedHeader) {
  1200. $fixedColumns.find('.fixed-table-body').remove();
  1201. $fixedColumns.append(_this3.$tableBody.clone(true));
  1202. $fixedColumns.find('.fixed-table-body table').removeAttr('id');
  1203. var $fixedBody = $fixedColumns.find('.fixed-table-body');
  1204. var tableBody = _this3.$tableBody.get(0);
  1205. var scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? Utils.getScrollBarWidth() : 0;
  1206. var height = _this3.$tableContainer.outerHeight(true) - scrollHeight - 1;
  1207. $fixedColumns.css({
  1208. height: height
  1209. });
  1210. $fixedBody.css({
  1211. height: height - $fixedHeader.height()
  1212. });
  1213. return $fixedBody;
  1214. };
  1215. if (this.needFixedColumns && this.options.fixedNumber) {
  1216. this.$fixedBody = initFixedBody(this.$fixedColumns, this.$fixedHeader);
  1217. }
  1218. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1219. this.$fixedBodyRight = initFixedBody(this.$fixedColumnsRight, this.$fixedHeaderRight);
  1220. this.$fixedBodyRight.scrollLeft(this.$fixedBodyRight.find('table').width());
  1221. this.$fixedBodyRight.css('overflow-y', this.options.height ? 'auto' : 'hidden');
  1222. }
  1223. }
  1224. }, {
  1225. key: "getFixedColumnsWidth",
  1226. value: function getFixedColumnsWidth(isRight) {
  1227. var visibleFields = this.getVisibleFields();
  1228. var width = 0;
  1229. var fixedNumber = this.options.fixedNumber;
  1230. var marginRight = 0;
  1231. if (isRight) {
  1232. visibleFields = visibleFields.reverse();
  1233. fixedNumber = this.options.fixedRightNumber;
  1234. marginRight = parseInt(this.$tableHeader.css('margin-right'), 10);
  1235. }
  1236. for (var i = 0; i < fixedNumber; i++) {
  1237. width += this.$header.find("th[data-field=\"".concat(visibleFields[i], "\"]")).outerWidth(true);
  1238. }
  1239. return width + marginRight + 1;
  1240. }
  1241. }, {
  1242. key: "initFixedColumnsEvents",
  1243. value: function initFixedColumnsEvents() {
  1244. var _this4 = this;
  1245. var toggleHover = function toggleHover(e, toggle) {
  1246. var tr = "tr[data-index=\"".concat($__default['default'](e.currentTarget).data('index'), "\"]");
  1247. var $trs = _this4.$tableBody.find(tr);
  1248. if (_this4.$fixedBody) {
  1249. $trs = $trs.add(_this4.$fixedBody.find(tr));
  1250. }
  1251. if (_this4.$fixedBodyRight) {
  1252. $trs = $trs.add(_this4.$fixedBodyRight.find(tr));
  1253. }
  1254. $trs.css('background-color', toggle ? $__default['default'](e.currentTarget).css('background-color') : '');
  1255. };
  1256. this.$tableBody.find('tr').hover(function (e) {
  1257. toggleHover(e, true);
  1258. }, function (e) {
  1259. toggleHover(e, false);
  1260. });
  1261. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  1262. var mousewheel = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
  1263. var updateScroll = function updateScroll(e, fixedBody) {
  1264. var normalized = normalizeWheel(e);
  1265. var deltaY = Math.ceil(normalized.pixelY);
  1266. var top = _this4.$tableBody.scrollTop() + deltaY;
  1267. if (deltaY < 0 && top > 0 || deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight) {
  1268. e.preventDefault();
  1269. }
  1270. _this4.$tableBody.scrollTop(top);
  1271. if (_this4.$fixedBody) {
  1272. _this4.$fixedBody.scrollTop(top);
  1273. }
  1274. if (_this4.$fixedBodyRight) {
  1275. _this4.$fixedBodyRight.scrollTop(top);
  1276. }
  1277. };
  1278. if (this.needFixedColumns && this.options.fixedNumber) {
  1279. this.$fixedBody.find('tr').hover(function (e) {
  1280. toggleHover(e, true);
  1281. }, function (e) {
  1282. toggleHover(e, false);
  1283. });
  1284. this.$fixedBody[0].addEventListener(mousewheel, function (e) {
  1285. updateScroll(e, _this4.$fixedBody[0]);
  1286. });
  1287. }
  1288. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1289. this.$fixedBodyRight.find('tr').hover(function (e) {
  1290. toggleHover(e, true);
  1291. }, function (e) {
  1292. toggleHover(e, false);
  1293. });
  1294. this.$fixedBodyRight.off('scroll').on('scroll', function () {
  1295. var top = _this4.$fixedBodyRight.scrollTop();
  1296. _this4.$tableBody.scrollTop(top);
  1297. if (_this4.$fixedBody) {
  1298. _this4.$fixedBody.scrollTop(top);
  1299. }
  1300. });
  1301. }
  1302. if (this.options.filterControl) {
  1303. $__default['default'](this.$fixedColumns).off('keyup change').on('keyup change', function (e) {
  1304. var $target = $__default['default'](e.target);
  1305. var value = $target.val();
  1306. var field = $target.parents('th').data('field');
  1307. var $coreTh = _this4.$header.find("th[data-field=\"".concat(field, "\"]"));
  1308. if ($target.is('input')) {
  1309. $coreTh.find('input').val(value);
  1310. } else if ($target.is('select')) {
  1311. var $select = $coreTh.find('select');
  1312. $select.find('option[selected]').removeAttr('selected');
  1313. $select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  1314. }
  1315. _this4.triggerSearch();
  1316. });
  1317. }
  1318. }
  1319. }, {
  1320. key: "renderStickyHeader",
  1321. value: function renderStickyHeader() {
  1322. if (!this.options.stickyHeader) {
  1323. return;
  1324. }
  1325. this.$stickyContainer = this.$container.find('.sticky-header-container');
  1326. _get(_getPrototypeOf(_class.prototype), "renderStickyHeader", this).call(this);
  1327. if (this.needFixedColumns && this.options.fixedNumber) {
  1328. this.$fixedColumns.css('z-index', 101).find('.sticky-header-container').css('right', '').width(this.$fixedColumns.outerWidth());
  1329. }
  1330. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1331. var $stickyHeaderContainerRight = this.$fixedColumnsRight.find('.sticky-header-container');
  1332. this.$fixedColumnsRight.css('z-index', 101);
  1333. $stickyHeaderContainerRight.css('left', '').scrollLeft($stickyHeaderContainerRight.find('.table').outerWidth()).width(this.$fixedColumnsRight.outerWidth());
  1334. }
  1335. }
  1336. }, {
  1337. key: "matchPositionX",
  1338. value: function matchPositionX() {
  1339. if (!this.options.stickyHeader) {
  1340. return;
  1341. }
  1342. this.$stickyContainer.eq(0).scrollLeft(this.$tableBody.scrollLeft());
  1343. }
  1344. }]);
  1345. return _class;
  1346. }($__default['default'].BootstrapTable);
  1347. })));