bootstrap-table-reorder-rows.js 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  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. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  9. function createCommonjsModule(fn, module) {
  10. return module = { exports: {} }, fn(module, module.exports), module.exports;
  11. }
  12. var check = function (it) {
  13. return it && it.Math == Math && it;
  14. };
  15. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  16. var global_1 =
  17. // eslint-disable-next-line no-undef
  18. check(typeof globalThis == 'object' && globalThis) ||
  19. check(typeof window == 'object' && window) ||
  20. check(typeof self == 'object' && self) ||
  21. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  22. // eslint-disable-next-line no-new-func
  23. (function () { return this; })() || Function('return this')();
  24. var fails = function (exec) {
  25. try {
  26. return !!exec();
  27. } catch (error) {
  28. return true;
  29. }
  30. };
  31. // Thank's IE8 for his funny defineProperty
  32. var descriptors = !fails(function () {
  33. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  34. });
  35. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  36. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  37. // Nashorn ~ JDK8 bug
  38. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  39. // `Object.prototype.propertyIsEnumerable` method implementation
  40. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  41. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  42. var descriptor = getOwnPropertyDescriptor(this, V);
  43. return !!descriptor && descriptor.enumerable;
  44. } : nativePropertyIsEnumerable;
  45. var objectPropertyIsEnumerable = {
  46. f: f
  47. };
  48. var createPropertyDescriptor = function (bitmap, value) {
  49. return {
  50. enumerable: !(bitmap & 1),
  51. configurable: !(bitmap & 2),
  52. writable: !(bitmap & 4),
  53. value: value
  54. };
  55. };
  56. var toString = {}.toString;
  57. var classofRaw = function (it) {
  58. return toString.call(it).slice(8, -1);
  59. };
  60. var split = ''.split;
  61. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  62. var indexedObject = fails(function () {
  63. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  64. // eslint-disable-next-line no-prototype-builtins
  65. return !Object('z').propertyIsEnumerable(0);
  66. }) ? function (it) {
  67. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  68. } : Object;
  69. // `RequireObjectCoercible` abstract operation
  70. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  71. var requireObjectCoercible = function (it) {
  72. if (it == undefined) throw TypeError("Can't call method on " + it);
  73. return it;
  74. };
  75. // toObject with fallback for non-array-like ES3 strings
  76. var toIndexedObject = function (it) {
  77. return indexedObject(requireObjectCoercible(it));
  78. };
  79. var isObject = function (it) {
  80. return typeof it === 'object' ? it !== null : typeof it === 'function';
  81. };
  82. // `ToPrimitive` abstract operation
  83. // https://tc39.github.io/ecma262/#sec-toprimitive
  84. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  85. // and the second argument - flag - preferred type is a string
  86. var toPrimitive = function (input, PREFERRED_STRING) {
  87. if (!isObject(input)) return input;
  88. var fn, val;
  89. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  91. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  92. throw TypeError("Can't convert object to primitive value");
  93. };
  94. var hasOwnProperty = {}.hasOwnProperty;
  95. var has = function (it, key) {
  96. return hasOwnProperty.call(it, key);
  97. };
  98. var document = global_1.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var EXISTS = isObject(document) && isObject(document.createElement);
  101. var documentCreateElement = function (it) {
  102. return EXISTS ? document.createElement(it) : {};
  103. };
  104. // Thank's IE8 for his funny defineProperty
  105. var ie8DomDefine = !descriptors && !fails(function () {
  106. return Object.defineProperty(documentCreateElement('div'), 'a', {
  107. get: function () { return 7; }
  108. }).a != 7;
  109. });
  110. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  111. // `Object.getOwnPropertyDescriptor` method
  112. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  113. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  114. O = toIndexedObject(O);
  115. P = toPrimitive(P, true);
  116. if (ie8DomDefine) try {
  117. return nativeGetOwnPropertyDescriptor(O, P);
  118. } catch (error) { /* empty */ }
  119. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  120. };
  121. var objectGetOwnPropertyDescriptor = {
  122. f: f$1
  123. };
  124. var anObject = function (it) {
  125. if (!isObject(it)) {
  126. throw TypeError(String(it) + ' is not an object');
  127. } return it;
  128. };
  129. var nativeDefineProperty = Object.defineProperty;
  130. // `Object.defineProperty` method
  131. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  132. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  133. anObject(O);
  134. P = toPrimitive(P, true);
  135. anObject(Attributes);
  136. if (ie8DomDefine) try {
  137. return nativeDefineProperty(O, P, Attributes);
  138. } catch (error) { /* empty */ }
  139. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  140. if ('value' in Attributes) O[P] = Attributes.value;
  141. return O;
  142. };
  143. var objectDefineProperty = {
  144. f: f$2
  145. };
  146. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  147. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  148. } : function (object, key, value) {
  149. object[key] = value;
  150. return object;
  151. };
  152. var setGlobal = function (key, value) {
  153. try {
  154. createNonEnumerableProperty(global_1, key, value);
  155. } catch (error) {
  156. global_1[key] = value;
  157. } return value;
  158. };
  159. var SHARED = '__core-js_shared__';
  160. var store = global_1[SHARED] || setGlobal(SHARED, {});
  161. var sharedStore = store;
  162. var functionToString = Function.toString;
  163. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  164. if (typeof sharedStore.inspectSource != 'function') {
  165. sharedStore.inspectSource = function (it) {
  166. return functionToString.call(it);
  167. };
  168. }
  169. var inspectSource = sharedStore.inspectSource;
  170. var WeakMap = global_1.WeakMap;
  171. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  172. var shared = createCommonjsModule(function (module) {
  173. (module.exports = function (key, value) {
  174. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  175. })('versions', []).push({
  176. version: '3.8.1',
  177. mode: 'global',
  178. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  179. });
  180. });
  181. var id = 0;
  182. var postfix = Math.random();
  183. var uid = function (key) {
  184. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  185. };
  186. var keys = shared('keys');
  187. var sharedKey = function (key) {
  188. return keys[key] || (keys[key] = uid(key));
  189. };
  190. var hiddenKeys = {};
  191. var WeakMap$1 = global_1.WeakMap;
  192. var set, get, has$1;
  193. var enforce = function (it) {
  194. return has$1(it) ? get(it) : set(it, {});
  195. };
  196. var getterFor = function (TYPE) {
  197. return function (it) {
  198. var state;
  199. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  200. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  201. } return state;
  202. };
  203. };
  204. if (nativeWeakMap) {
  205. var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
  206. var wmget = store$1.get;
  207. var wmhas = store$1.has;
  208. var wmset = store$1.set;
  209. set = function (it, metadata) {
  210. metadata.facade = it;
  211. wmset.call(store$1, it, metadata);
  212. return metadata;
  213. };
  214. get = function (it) {
  215. return wmget.call(store$1, it) || {};
  216. };
  217. has$1 = function (it) {
  218. return wmhas.call(store$1, it);
  219. };
  220. } else {
  221. var STATE = sharedKey('state');
  222. hiddenKeys[STATE] = true;
  223. set = function (it, metadata) {
  224. metadata.facade = it;
  225. createNonEnumerableProperty(it, STATE, metadata);
  226. return metadata;
  227. };
  228. get = function (it) {
  229. return has(it, STATE) ? it[STATE] : {};
  230. };
  231. has$1 = function (it) {
  232. return has(it, STATE);
  233. };
  234. }
  235. var internalState = {
  236. set: set,
  237. get: get,
  238. has: has$1,
  239. enforce: enforce,
  240. getterFor: getterFor
  241. };
  242. var redefine = createCommonjsModule(function (module) {
  243. var getInternalState = internalState.get;
  244. var enforceInternalState = internalState.enforce;
  245. var TEMPLATE = String(String).split('String');
  246. (module.exports = function (O, key, value, options) {
  247. var unsafe = options ? !!options.unsafe : false;
  248. var simple = options ? !!options.enumerable : false;
  249. var noTargetGet = options ? !!options.noTargetGet : false;
  250. var state;
  251. if (typeof value == 'function') {
  252. if (typeof key == 'string' && !has(value, 'name')) {
  253. createNonEnumerableProperty(value, 'name', key);
  254. }
  255. state = enforceInternalState(value);
  256. if (!state.source) {
  257. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  258. }
  259. }
  260. if (O === global_1) {
  261. if (simple) O[key] = value;
  262. else setGlobal(key, value);
  263. return;
  264. } else if (!unsafe) {
  265. delete O[key];
  266. } else if (!noTargetGet && O[key]) {
  267. simple = true;
  268. }
  269. if (simple) O[key] = value;
  270. else createNonEnumerableProperty(O, key, value);
  271. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  272. })(Function.prototype, 'toString', function toString() {
  273. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  274. });
  275. });
  276. var path = global_1;
  277. var aFunction = function (variable) {
  278. return typeof variable == 'function' ? variable : undefined;
  279. };
  280. var getBuiltIn = function (namespace, method) {
  281. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  282. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  283. };
  284. var ceil = Math.ceil;
  285. var floor = Math.floor;
  286. // `ToInteger` abstract operation
  287. // https://tc39.github.io/ecma262/#sec-tointeger
  288. var toInteger = function (argument) {
  289. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  290. };
  291. var min = Math.min;
  292. // `ToLength` abstract operation
  293. // https://tc39.github.io/ecma262/#sec-tolength
  294. var toLength = function (argument) {
  295. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  296. };
  297. var max = Math.max;
  298. var min$1 = Math.min;
  299. // Helper for a popular repeating case of the spec:
  300. // Let integer be ? ToInteger(index).
  301. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  302. var toAbsoluteIndex = function (index, length) {
  303. var integer = toInteger(index);
  304. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  305. };
  306. // `Array.prototype.{ indexOf, includes }` methods implementation
  307. var createMethod = function (IS_INCLUDES) {
  308. return function ($this, el, fromIndex) {
  309. var O = toIndexedObject($this);
  310. var length = toLength(O.length);
  311. var index = toAbsoluteIndex(fromIndex, length);
  312. var value;
  313. // Array#includes uses SameValueZero equality algorithm
  314. // eslint-disable-next-line no-self-compare
  315. if (IS_INCLUDES && el != el) while (length > index) {
  316. value = O[index++];
  317. // eslint-disable-next-line no-self-compare
  318. if (value != value) return true;
  319. // Array#indexOf ignores holes, Array#includes - not
  320. } else for (;length > index; index++) {
  321. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  322. } return !IS_INCLUDES && -1;
  323. };
  324. };
  325. var arrayIncludes = {
  326. // `Array.prototype.includes` method
  327. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  328. includes: createMethod(true),
  329. // `Array.prototype.indexOf` method
  330. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  331. indexOf: createMethod(false)
  332. };
  333. var indexOf = arrayIncludes.indexOf;
  334. var objectKeysInternal = function (object, names) {
  335. var O = toIndexedObject(object);
  336. var i = 0;
  337. var result = [];
  338. var key;
  339. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  340. // Don't enum bug & hidden keys
  341. while (names.length > i) if (has(O, key = names[i++])) {
  342. ~indexOf(result, key) || result.push(key);
  343. }
  344. return result;
  345. };
  346. // IE8- don't enum bug keys
  347. var enumBugKeys = [
  348. 'constructor',
  349. 'hasOwnProperty',
  350. 'isPrototypeOf',
  351. 'propertyIsEnumerable',
  352. 'toLocaleString',
  353. 'toString',
  354. 'valueOf'
  355. ];
  356. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  357. // `Object.getOwnPropertyNames` method
  358. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  359. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  360. return objectKeysInternal(O, hiddenKeys$1);
  361. };
  362. var objectGetOwnPropertyNames = {
  363. f: f$3
  364. };
  365. var f$4 = Object.getOwnPropertySymbols;
  366. var objectGetOwnPropertySymbols = {
  367. f: f$4
  368. };
  369. // all object keys, includes non-enumerable and symbols
  370. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  371. var keys = objectGetOwnPropertyNames.f(anObject(it));
  372. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  373. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  374. };
  375. var copyConstructorProperties = function (target, source) {
  376. var keys = ownKeys(source);
  377. var defineProperty = objectDefineProperty.f;
  378. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  379. for (var i = 0; i < keys.length; i++) {
  380. var key = keys[i];
  381. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  382. }
  383. };
  384. var replacement = /#|\.prototype\./;
  385. var isForced = function (feature, detection) {
  386. var value = data[normalize(feature)];
  387. return value == POLYFILL ? true
  388. : value == NATIVE ? false
  389. : typeof detection == 'function' ? fails(detection)
  390. : !!detection;
  391. };
  392. var normalize = isForced.normalize = function (string) {
  393. return String(string).replace(replacement, '.').toLowerCase();
  394. };
  395. var data = isForced.data = {};
  396. var NATIVE = isForced.NATIVE = 'N';
  397. var POLYFILL = isForced.POLYFILL = 'P';
  398. var isForced_1 = isForced;
  399. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  400. /*
  401. options.target - name of the target object
  402. options.global - target is the global object
  403. options.stat - export as static methods of target
  404. options.proto - export as prototype methods of target
  405. options.real - real prototype method for the `pure` version
  406. options.forced - export even if the native feature is available
  407. options.bind - bind methods to the target, required for the `pure` version
  408. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  409. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  410. options.sham - add a flag to not completely full polyfills
  411. options.enumerable - export as enumerable property
  412. options.noTargetGet - prevent calling a getter on target
  413. */
  414. var _export = function (options, source) {
  415. var TARGET = options.target;
  416. var GLOBAL = options.global;
  417. var STATIC = options.stat;
  418. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  419. if (GLOBAL) {
  420. target = global_1;
  421. } else if (STATIC) {
  422. target = global_1[TARGET] || setGlobal(TARGET, {});
  423. } else {
  424. target = (global_1[TARGET] || {}).prototype;
  425. }
  426. if (target) for (key in source) {
  427. sourceProperty = source[key];
  428. if (options.noTargetGet) {
  429. descriptor = getOwnPropertyDescriptor$1(target, key);
  430. targetProperty = descriptor && descriptor.value;
  431. } else targetProperty = target[key];
  432. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  433. // contained in target
  434. if (!FORCED && targetProperty !== undefined) {
  435. if (typeof sourceProperty === typeof targetProperty) continue;
  436. copyConstructorProperties(sourceProperty, targetProperty);
  437. }
  438. // add a flag to not completely full polyfills
  439. if (options.sham || (targetProperty && targetProperty.sham)) {
  440. createNonEnumerableProperty(sourceProperty, 'sham', true);
  441. }
  442. // extend global
  443. redefine(target, key, sourceProperty, options);
  444. }
  445. };
  446. // `IsArray` abstract operation
  447. // https://tc39.github.io/ecma262/#sec-isarray
  448. var isArray = Array.isArray || function isArray(arg) {
  449. return classofRaw(arg) == 'Array';
  450. };
  451. // `ToObject` abstract operation
  452. // https://tc39.github.io/ecma262/#sec-toobject
  453. var toObject = function (argument) {
  454. return Object(requireObjectCoercible(argument));
  455. };
  456. var createProperty = function (object, key, value) {
  457. var propertyKey = toPrimitive(key);
  458. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  459. else object[propertyKey] = value;
  460. };
  461. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  462. // Chrome 38 Symbol has incorrect toString conversion
  463. // eslint-disable-next-line no-undef
  464. return !String(Symbol());
  465. });
  466. var useSymbolAsUid = nativeSymbol
  467. // eslint-disable-next-line no-undef
  468. && !Symbol.sham
  469. // eslint-disable-next-line no-undef
  470. && typeof Symbol.iterator == 'symbol';
  471. var WellKnownSymbolsStore = shared('wks');
  472. var Symbol$1 = global_1.Symbol;
  473. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  474. var wellKnownSymbol = function (name) {
  475. if (!has(WellKnownSymbolsStore, name)) {
  476. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  477. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  478. } return WellKnownSymbolsStore[name];
  479. };
  480. var SPECIES = wellKnownSymbol('species');
  481. // `ArraySpeciesCreate` abstract operation
  482. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  483. var arraySpeciesCreate = function (originalArray, length) {
  484. var C;
  485. if (isArray(originalArray)) {
  486. C = originalArray.constructor;
  487. // cross-realm fallback
  488. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  489. else if (isObject(C)) {
  490. C = C[SPECIES];
  491. if (C === null) C = undefined;
  492. }
  493. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  494. };
  495. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  496. var process = global_1.process;
  497. var versions = process && process.versions;
  498. var v8 = versions && versions.v8;
  499. var match, version;
  500. if (v8) {
  501. match = v8.split('.');
  502. version = match[0] + match[1];
  503. } else if (engineUserAgent) {
  504. match = engineUserAgent.match(/Edge\/(\d+)/);
  505. if (!match || match[1] >= 74) {
  506. match = engineUserAgent.match(/Chrome\/(\d+)/);
  507. if (match) version = match[1];
  508. }
  509. }
  510. var engineV8Version = version && +version;
  511. var SPECIES$1 = wellKnownSymbol('species');
  512. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  513. // We can't use this feature detection in V8 since it causes
  514. // deoptimization and serious performance degradation
  515. // https://github.com/zloirock/core-js/issues/677
  516. return engineV8Version >= 51 || !fails(function () {
  517. var array = [];
  518. var constructor = array.constructor = {};
  519. constructor[SPECIES$1] = function () {
  520. return { foo: 1 };
  521. };
  522. return array[METHOD_NAME](Boolean).foo !== 1;
  523. });
  524. };
  525. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  526. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  527. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  528. // We can't use this feature detection in V8 since it causes
  529. // deoptimization and serious performance degradation
  530. // https://github.com/zloirock/core-js/issues/679
  531. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  532. var array = [];
  533. array[IS_CONCAT_SPREADABLE] = false;
  534. return array.concat()[0] !== array;
  535. });
  536. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  537. var isConcatSpreadable = function (O) {
  538. if (!isObject(O)) return false;
  539. var spreadable = O[IS_CONCAT_SPREADABLE];
  540. return spreadable !== undefined ? !!spreadable : isArray(O);
  541. };
  542. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  543. // `Array.prototype.concat` method
  544. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  545. // with adding support of @@isConcatSpreadable and @@species
  546. _export({ target: 'Array', proto: true, forced: FORCED }, {
  547. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  548. var O = toObject(this);
  549. var A = arraySpeciesCreate(O, 0);
  550. var n = 0;
  551. var i, k, length, len, E;
  552. for (i = -1, length = arguments.length; i < length; i++) {
  553. E = i === -1 ? O : arguments[i];
  554. if (isConcatSpreadable(E)) {
  555. len = toLength(E.length);
  556. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  557. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  558. } else {
  559. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  560. createProperty(A, n++, E);
  561. }
  562. }
  563. A.length = n;
  564. return A;
  565. }
  566. });
  567. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  568. var method = [][METHOD_NAME];
  569. return !!method && fails(function () {
  570. // eslint-disable-next-line no-useless-call,no-throw-literal
  571. method.call(null, argument || function () { throw 1; }, 1);
  572. });
  573. };
  574. var defineProperty = Object.defineProperty;
  575. var cache = {};
  576. var thrower = function (it) { throw it; };
  577. var arrayMethodUsesToLength = function (METHOD_NAME, options) {
  578. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  579. if (!options) options = {};
  580. var method = [][METHOD_NAME];
  581. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  582. var argument0 = has(options, 0) ? options[0] : thrower;
  583. var argument1 = has(options, 1) ? options[1] : undefined;
  584. return cache[METHOD_NAME] = !!method && !fails(function () {
  585. if (ACCESSORS && !descriptors) return true;
  586. var O = { length: -1 };
  587. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  588. else O[1] = 1;
  589. method.call(O, argument0, argument1);
  590. });
  591. };
  592. var $indexOf = arrayIncludes.indexOf;
  593. var nativeIndexOf = [].indexOf;
  594. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  595. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  596. var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  597. // `Array.prototype.indexOf` method
  598. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  599. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
  600. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  601. return NEGATIVE_ZERO
  602. // convert -0 to +0
  603. ? nativeIndexOf.apply(this, arguments) || 0
  604. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  605. }
  606. });
  607. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  608. var USES_TO_LENGTH$1 = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
  609. var max$1 = Math.max;
  610. var min$2 = Math.min;
  611. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  612. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  613. // `Array.prototype.splice` method
  614. // https://tc39.github.io/ecma262/#sec-array.prototype.splice
  615. // with adding support of @@species
  616. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$1 }, {
  617. splice: function splice(start, deleteCount /* , ...items */) {
  618. var O = toObject(this);
  619. var len = toLength(O.length);
  620. var actualStart = toAbsoluteIndex(start, len);
  621. var argumentsLength = arguments.length;
  622. var insertCount, actualDeleteCount, A, k, from, to;
  623. if (argumentsLength === 0) {
  624. insertCount = actualDeleteCount = 0;
  625. } else if (argumentsLength === 1) {
  626. insertCount = 0;
  627. actualDeleteCount = len - actualStart;
  628. } else {
  629. insertCount = argumentsLength - 2;
  630. actualDeleteCount = min$2(max$1(toInteger(deleteCount), 0), len - actualStart);
  631. }
  632. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) {
  633. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  634. }
  635. A = arraySpeciesCreate(O, actualDeleteCount);
  636. for (k = 0; k < actualDeleteCount; k++) {
  637. from = actualStart + k;
  638. if (from in O) createProperty(A, k, O[from]);
  639. }
  640. A.length = actualDeleteCount;
  641. if (insertCount < actualDeleteCount) {
  642. for (k = actualStart; k < len - actualDeleteCount; k++) {
  643. from = k + actualDeleteCount;
  644. to = k + insertCount;
  645. if (from in O) O[to] = O[from];
  646. else delete O[to];
  647. }
  648. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  649. } else if (insertCount > actualDeleteCount) {
  650. for (k = len - actualDeleteCount; k > actualStart; k--) {
  651. from = k + actualDeleteCount - 1;
  652. to = k + insertCount - 1;
  653. if (from in O) O[to] = O[from];
  654. else delete O[to];
  655. }
  656. }
  657. for (k = 0; k < insertCount; k++) {
  658. O[k + actualStart] = arguments[k + 2];
  659. }
  660. O.length = len - actualDeleteCount + insertCount;
  661. return A;
  662. }
  663. });
  664. function _classCallCheck(instance, Constructor) {
  665. if (!(instance instanceof Constructor)) {
  666. throw new TypeError("Cannot call a class as a function");
  667. }
  668. }
  669. function _defineProperties(target, props) {
  670. for (var i = 0; i < props.length; i++) {
  671. var descriptor = props[i];
  672. descriptor.enumerable = descriptor.enumerable || false;
  673. descriptor.configurable = true;
  674. if ("value" in descriptor) descriptor.writable = true;
  675. Object.defineProperty(target, descriptor.key, descriptor);
  676. }
  677. }
  678. function _createClass(Constructor, protoProps, staticProps) {
  679. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  680. if (staticProps) _defineProperties(Constructor, staticProps);
  681. return Constructor;
  682. }
  683. function _inherits(subClass, superClass) {
  684. if (typeof superClass !== "function" && superClass !== null) {
  685. throw new TypeError("Super expression must either be null or a function");
  686. }
  687. subClass.prototype = Object.create(superClass && superClass.prototype, {
  688. constructor: {
  689. value: subClass,
  690. writable: true,
  691. configurable: true
  692. }
  693. });
  694. if (superClass) _setPrototypeOf(subClass, superClass);
  695. }
  696. function _getPrototypeOf(o) {
  697. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  698. return o.__proto__ || Object.getPrototypeOf(o);
  699. };
  700. return _getPrototypeOf(o);
  701. }
  702. function _setPrototypeOf(o, p) {
  703. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  704. o.__proto__ = p;
  705. return o;
  706. };
  707. return _setPrototypeOf(o, p);
  708. }
  709. function _isNativeReflectConstruct() {
  710. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  711. if (Reflect.construct.sham) return false;
  712. if (typeof Proxy === "function") return true;
  713. try {
  714. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  715. return true;
  716. } catch (e) {
  717. return false;
  718. }
  719. }
  720. function _assertThisInitialized(self) {
  721. if (self === void 0) {
  722. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  723. }
  724. return self;
  725. }
  726. function _possibleConstructorReturn(self, call) {
  727. if (call && (typeof call === "object" || typeof call === "function")) {
  728. return call;
  729. }
  730. return _assertThisInitialized(self);
  731. }
  732. function _createSuper(Derived) {
  733. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  734. return function _createSuperInternal() {
  735. var Super = _getPrototypeOf(Derived),
  736. result;
  737. if (hasNativeReflectConstruct) {
  738. var NewTarget = _getPrototypeOf(this).constructor;
  739. result = Reflect.construct(Super, arguments, NewTarget);
  740. } else {
  741. result = Super.apply(this, arguments);
  742. }
  743. return _possibleConstructorReturn(this, result);
  744. };
  745. }
  746. function _superPropBase(object, property) {
  747. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  748. object = _getPrototypeOf(object);
  749. if (object === null) break;
  750. }
  751. return object;
  752. }
  753. function _get(target, property, receiver) {
  754. if (typeof Reflect !== "undefined" && Reflect.get) {
  755. _get = Reflect.get;
  756. } else {
  757. _get = function _get(target, property, receiver) {
  758. var base = _superPropBase(target, property);
  759. if (!base) return;
  760. var desc = Object.getOwnPropertyDescriptor(base, property);
  761. if (desc.get) {
  762. return desc.get.call(receiver);
  763. }
  764. return desc.value;
  765. };
  766. }
  767. return _get(target, property, receiver || target);
  768. }
  769. /**
  770. * @author: Dennis Hernández
  771. * @webSite: http://djhvscf.github.io/Blog
  772. * @update zhixin wen <wenzhixin2010@gmail.com>
  773. */
  774. var rowAttr = function rowAttr(row, index) {
  775. return {
  776. id: "customId_".concat(index)
  777. };
  778. };
  779. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  780. reorderableRows: false,
  781. onDragStyle: null,
  782. onDropStyle: null,
  783. onDragClass: 'reorder_rows_onDragClass',
  784. dragHandle: '>tbody>tr>td',
  785. useRowAttrFunc: false,
  786. // eslint-disable-next-line no-unused-vars
  787. onReorderRowsDrag: function onReorderRowsDrag(row) {
  788. return false;
  789. },
  790. // eslint-disable-next-line no-unused-vars
  791. onReorderRowsDrop: function onReorderRowsDrop(row) {
  792. return false;
  793. },
  794. // eslint-disable-next-line no-unused-vars
  795. onReorderRow: function onReorderRow(newData) {
  796. return false;
  797. }
  798. });
  799. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  800. 'reorder-row.bs.table': 'onReorderRow'
  801. });
  802. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  803. _inherits(_class, _$$BootstrapTable);
  804. var _super = _createSuper(_class);
  805. function _class() {
  806. _classCallCheck(this, _class);
  807. return _super.apply(this, arguments);
  808. }
  809. _createClass(_class, [{
  810. key: "init",
  811. value: function init() {
  812. var _this = this,
  813. _get3;
  814. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  815. args[_key] = arguments[_key];
  816. }
  817. if (!this.options.reorderableRows) {
  818. var _get2;
  819. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  820. return;
  821. }
  822. if (this.options.useRowAttrFunc) {
  823. this.options.rowAttributes = rowAttr;
  824. }
  825. var onPostBody = this.options.onPostBody;
  826. this.options.onPostBody = function () {
  827. setTimeout(function () {
  828. _this.makeRowsReorderable();
  829. onPostBody.call(_this.options, _this.options.data);
  830. }, 1);
  831. };
  832. (_get3 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get3, [this].concat(args));
  833. }
  834. }, {
  835. key: "makeRowsReorderable",
  836. value: function makeRowsReorderable() {
  837. var _this2 = this;
  838. this.$el.tableDnD({
  839. onDragStyle: this.options.onDragStyle,
  840. onDropStyle: this.options.onDropStyle,
  841. onDragClass: this.options.onDragClass,
  842. onDragStart: function onDragStart(table, droppedRow) {
  843. return _this2.onDropStart(table, droppedRow);
  844. },
  845. onDrop: function onDrop(table, droppedRow) {
  846. return _this2.onDrop(table, droppedRow);
  847. },
  848. dragHandle: this.options.dragHandle
  849. });
  850. }
  851. }, {
  852. key: "onDropStart",
  853. value: function onDropStart(table, draggingTd) {
  854. this.$draggingTd = $__default['default'](draggingTd).css('cursor', 'move');
  855. this.draggingIndex = $__default['default'](this.$draggingTd.parent()).data('index'); // Call the user defined function
  856. this.options.onReorderRowsDrag(this.data[this.draggingIndex]);
  857. }
  858. }, {
  859. key: "onDrop",
  860. value: function onDrop(table) {
  861. this.$draggingTd.css('cursor', '');
  862. var newData = [];
  863. for (var i = 0; i < table.tBodies[0].rows.length; i++) {
  864. var $tr = $__default['default'](table.tBodies[0].rows[i]);
  865. newData.push(this.data[$tr.data('index')]);
  866. $tr.data('index', i);
  867. }
  868. var draggingRow = this.data[this.draggingIndex];
  869. var droppedIndex = newData.indexOf(this.data[this.draggingIndex]);
  870. var droppedRow = this.data[droppedIndex];
  871. var index = this.options.data.indexOf(this.data[droppedIndex]);
  872. this.options.data.splice(this.options.data.indexOf(draggingRow), 1);
  873. this.options.data.splice(index, 0, draggingRow); // Call the user defined function
  874. this.options.onReorderRowsDrop(droppedRow); // Call the event reorder-row
  875. this.trigger('reorder-row', newData, draggingRow, droppedRow);
  876. }
  877. }]);
  878. return _class;
  879. }($__default['default'].BootstrapTable);
  880. })));