bootstrap-table-reorder-rows.js 35 KB

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