bootstrap-table-pipeline.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  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. /* global globalThis -- safe */
  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 -- fallback
  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. // Detect IE8's incomplete defineProperty implementation
  32. var descriptors = !fails(function () {
  33. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  34. });
  35. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  36. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  37. // Nashorn ~ JDK8 bug
  38. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  39. // `Object.prototype.propertyIsEnumerable` method implementation
  40. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  41. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  42. var descriptor = getOwnPropertyDescriptor$1(this, V);
  43. return !!descriptor && descriptor.enumerable;
  44. } : nativePropertyIsEnumerable;
  45. var objectPropertyIsEnumerable = {
  46. f: f$4
  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 -- safe
  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.es/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.es/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$1 = 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.es/ecma262/#sec-object.getownpropertydescriptor
  113. var f$3 = 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$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  120. };
  121. var objectGetOwnPropertyDescriptor = {
  122. f: f$3
  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.es/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$1 = global_1[SHARED] || setGlobal(SHARED, {});
  161. var sharedStore = store$1;
  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$1 = global_1.WeakMap;
  171. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  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.9.1',
  177. mode: 'global',
  178. copyright: '© 2021 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$1 = {};
  191. var WeakMap = global_1.WeakMap;
  192. var set, get, has;
  193. var enforce = function (it) {
  194. return has(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 = sharedStore.state || (sharedStore.state = new WeakMap());
  206. var wmget = store.get;
  207. var wmhas = store.has;
  208. var wmset = store.set;
  209. set = function (it, metadata) {
  210. metadata.facade = it;
  211. wmset.call(store, it, metadata);
  212. return metadata;
  213. };
  214. get = function (it) {
  215. return wmget.call(store, it) || {};
  216. };
  217. has = function (it) {
  218. return wmhas.call(store, it);
  219. };
  220. } else {
  221. var STATE = sharedKey('state');
  222. hiddenKeys$1[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$1(it, STATE) ? it[STATE] : {};
  230. };
  231. has = function (it) {
  232. return has$1(it, STATE);
  233. };
  234. }
  235. var internalState = {
  236. set: set,
  237. get: get,
  238. has: has,
  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$1(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$1 = function (variable) {
  278. return typeof variable == 'function' ? variable : undefined;
  279. };
  280. var getBuiltIn = function (namespace, method) {
  281. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(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.es/ecma262/#sec-tointeger
  288. var toInteger = function (argument) {
  289. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  290. };
  291. var min$1 = Math.min;
  292. // `ToLength` abstract operation
  293. // https://tc39.es/ecma262/#sec-tolength
  294. var toLength = function (argument) {
  295. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  296. };
  297. var max$1 = Math.max;
  298. var min = 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$1(integer + length, 0) : min(integer, length);
  305. };
  306. // `Array.prototype.{ indexOf, includes }` methods implementation
  307. var createMethod$2 = 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 -- NaN check
  315. if (IS_INCLUDES && el != el) while (length > index) {
  316. value = O[index++];
  317. // eslint-disable-next-line no-self-compare -- NaN check
  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.es/ecma262/#sec-array.prototype.includes
  328. includes: createMethod$2(true),
  329. // `Array.prototype.indexOf` method
  330. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  331. indexOf: createMethod$2(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$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  340. // Don't enum bug & hidden keys
  341. while (names.length > i) if (has$1(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 = enumBugKeys.concat('length', 'prototype');
  357. // `Object.getOwnPropertyNames` method
  358. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  359. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  360. return objectKeysInternal(O, hiddenKeys);
  361. };
  362. var objectGetOwnPropertyNames = {
  363. f: f$1
  364. };
  365. var f = Object.getOwnPropertySymbols;
  366. var objectGetOwnPropertySymbols = {
  367. f: f
  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$1(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 = 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(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.es/ecma262/#sec-isarray
  448. var isArray = Array.isArray || function isArray(arg) {
  449. return classofRaw(arg) == 'Array';
  450. };
  451. var createProperty = function (object, key, value) {
  452. var propertyKey = toPrimitive(key);
  453. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  454. else object[propertyKey] = value;
  455. };
  456. var engineIsNode = classofRaw(global_1.process) == 'process';
  457. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  458. var process = global_1.process;
  459. var versions = process && process.versions;
  460. var v8 = versions && versions.v8;
  461. var match, version;
  462. if (v8) {
  463. match = v8.split('.');
  464. version = match[0] + match[1];
  465. } else if (engineUserAgent) {
  466. match = engineUserAgent.match(/Edge\/(\d+)/);
  467. if (!match || match[1] >= 74) {
  468. match = engineUserAgent.match(/Chrome\/(\d+)/);
  469. if (match) version = match[1];
  470. }
  471. }
  472. var engineV8Version = version && +version;
  473. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  474. /* global Symbol -- required for testing */
  475. return !Symbol.sham &&
  476. // Chrome 38 Symbol has incorrect toString conversion
  477. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  478. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  479. });
  480. var useSymbolAsUid = nativeSymbol
  481. /* global Symbol -- safe */
  482. && !Symbol.sham
  483. && typeof Symbol.iterator == 'symbol';
  484. var WellKnownSymbolsStore = shared('wks');
  485. var Symbol$1 = global_1.Symbol;
  486. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  487. var wellKnownSymbol = function (name) {
  488. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  489. if (nativeSymbol && has$1(Symbol$1, name)) {
  490. WellKnownSymbolsStore[name] = Symbol$1[name];
  491. } else {
  492. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  493. }
  494. } return WellKnownSymbolsStore[name];
  495. };
  496. var SPECIES$2 = wellKnownSymbol('species');
  497. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  498. // We can't use this feature detection in V8 since it causes
  499. // deoptimization and serious performance degradation
  500. // https://github.com/zloirock/core-js/issues/677
  501. return engineV8Version >= 51 || !fails(function () {
  502. var array = [];
  503. var constructor = array.constructor = {};
  504. constructor[SPECIES$2] = function () {
  505. return { foo: 1 };
  506. };
  507. return array[METHOD_NAME](Boolean).foo !== 1;
  508. });
  509. };
  510. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  511. var SPECIES$1 = wellKnownSymbol('species');
  512. var nativeSlice = [].slice;
  513. var max = Math.max;
  514. // `Array.prototype.slice` method
  515. // https://tc39.es/ecma262/#sec-array.prototype.slice
  516. // fallback for not array-like ES3 strings and DOM objects
  517. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  518. slice: function slice(start, end) {
  519. var O = toIndexedObject(this);
  520. var length = toLength(O.length);
  521. var k = toAbsoluteIndex(start, length);
  522. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  523. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  524. var Constructor, result, n;
  525. if (isArray(O)) {
  526. Constructor = O.constructor;
  527. // cross-realm fallback
  528. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  529. Constructor = undefined;
  530. } else if (isObject(Constructor)) {
  531. Constructor = Constructor[SPECIES$1];
  532. if (Constructor === null) Constructor = undefined;
  533. }
  534. if (Constructor === Array || Constructor === undefined) {
  535. return nativeSlice.call(O, k, fin);
  536. }
  537. }
  538. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  539. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  540. result.length = n;
  541. return result;
  542. }
  543. });
  544. // a string of all valid unicode whitespaces
  545. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  546. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  547. var whitespace = '[' + whitespaces + ']';
  548. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  549. var rtrim = RegExp(whitespace + whitespace + '*$');
  550. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  551. var createMethod$1 = function (TYPE) {
  552. return function ($this) {
  553. var string = String(requireObjectCoercible($this));
  554. if (TYPE & 1) string = string.replace(ltrim, '');
  555. if (TYPE & 2) string = string.replace(rtrim, '');
  556. return string;
  557. };
  558. };
  559. var stringTrim = {
  560. // `String.prototype.{ trimLeft, trimStart }` methods
  561. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  562. start: createMethod$1(1),
  563. // `String.prototype.{ trimRight, trimEnd }` methods
  564. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  565. end: createMethod$1(2),
  566. // `String.prototype.trim` method
  567. // https://tc39.es/ecma262/#sec-string.prototype.trim
  568. trim: createMethod$1(3)
  569. };
  570. var trim = stringTrim.trim;
  571. var $parseInt = global_1.parseInt;
  572. var hex = /^[+-]?0[Xx]/;
  573. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
  574. // `parseInt` method
  575. // https://tc39.es/ecma262/#sec-parseint-string-radix
  576. var numberParseInt = FORCED ? function parseInt(string, radix) {
  577. var S = trim(String(string));
  578. return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  579. } : $parseInt;
  580. // `parseInt` method
  581. // https://tc39.es/ecma262/#sec-parseint-string-radix
  582. _export({ global: true, forced: parseInt != numberParseInt }, {
  583. parseInt: numberParseInt
  584. });
  585. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  586. var method = [][METHOD_NAME];
  587. return !!method && fails(function () {
  588. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  589. method.call(null, argument || function () { throw 1; }, 1);
  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. // `Array.prototype.indexOf` method
  597. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  598. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  599. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  600. return NEGATIVE_ZERO
  601. // convert -0 to +0
  602. ? nativeIndexOf.apply(this, arguments) || 0
  603. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  604. }
  605. });
  606. var aFunction = function (it) {
  607. if (typeof it != 'function') {
  608. throw TypeError(String(it) + ' is not a function');
  609. } return it;
  610. };
  611. // optional / simple context binding
  612. var functionBindContext = function (fn, that, length) {
  613. aFunction(fn);
  614. if (that === undefined) return fn;
  615. switch (length) {
  616. case 0: return function () {
  617. return fn.call(that);
  618. };
  619. case 1: return function (a) {
  620. return fn.call(that, a);
  621. };
  622. case 2: return function (a, b) {
  623. return fn.call(that, a, b);
  624. };
  625. case 3: return function (a, b, c) {
  626. return fn.call(that, a, b, c);
  627. };
  628. }
  629. return function (/* ...args */) {
  630. return fn.apply(that, arguments);
  631. };
  632. };
  633. // `ToObject` abstract operation
  634. // https://tc39.es/ecma262/#sec-toobject
  635. var toObject = function (argument) {
  636. return Object(requireObjectCoercible(argument));
  637. };
  638. var SPECIES = wellKnownSymbol('species');
  639. // `ArraySpeciesCreate` abstract operation
  640. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  641. var arraySpeciesCreate = function (originalArray, length) {
  642. var C;
  643. if (isArray(originalArray)) {
  644. C = originalArray.constructor;
  645. // cross-realm fallback
  646. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  647. else if (isObject(C)) {
  648. C = C[SPECIES];
  649. if (C === null) C = undefined;
  650. }
  651. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  652. };
  653. var push = [].push;
  654. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  655. var createMethod = function (TYPE) {
  656. var IS_MAP = TYPE == 1;
  657. var IS_FILTER = TYPE == 2;
  658. var IS_SOME = TYPE == 3;
  659. var IS_EVERY = TYPE == 4;
  660. var IS_FIND_INDEX = TYPE == 6;
  661. var IS_FILTER_OUT = TYPE == 7;
  662. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  663. return function ($this, callbackfn, that, specificCreate) {
  664. var O = toObject($this);
  665. var self = indexedObject(O);
  666. var boundFunction = functionBindContext(callbackfn, that, 3);
  667. var length = toLength(self.length);
  668. var index = 0;
  669. var create = specificCreate || arraySpeciesCreate;
  670. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  671. var value, result;
  672. for (;length > index; index++) if (NO_HOLES || index in self) {
  673. value = self[index];
  674. result = boundFunction(value, index, O);
  675. if (TYPE) {
  676. if (IS_MAP) target[index] = result; // map
  677. else if (result) switch (TYPE) {
  678. case 3: return true; // some
  679. case 5: return value; // find
  680. case 6: return index; // findIndex
  681. case 2: push.call(target, value); // filter
  682. } else switch (TYPE) {
  683. case 4: return false; // every
  684. case 7: push.call(target, value); // filterOut
  685. }
  686. }
  687. }
  688. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  689. };
  690. };
  691. var arrayIteration = {
  692. // `Array.prototype.forEach` method
  693. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  694. forEach: createMethod(0),
  695. // `Array.prototype.map` method
  696. // https://tc39.es/ecma262/#sec-array.prototype.map
  697. map: createMethod(1),
  698. // `Array.prototype.filter` method
  699. // https://tc39.es/ecma262/#sec-array.prototype.filter
  700. filter: createMethod(2),
  701. // `Array.prototype.some` method
  702. // https://tc39.es/ecma262/#sec-array.prototype.some
  703. some: createMethod(3),
  704. // `Array.prototype.every` method
  705. // https://tc39.es/ecma262/#sec-array.prototype.every
  706. every: createMethod(4),
  707. // `Array.prototype.find` method
  708. // https://tc39.es/ecma262/#sec-array.prototype.find
  709. find: createMethod(5),
  710. // `Array.prototype.findIndex` method
  711. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  712. findIndex: createMethod(6),
  713. // `Array.prototype.filterOut` method
  714. // https://github.com/tc39/proposal-array-filtering
  715. filterOut: createMethod(7)
  716. };
  717. var $filter = arrayIteration.filter;
  718. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  719. // `Array.prototype.filter` method
  720. // https://tc39.es/ecma262/#sec-array.prototype.filter
  721. // with adding support of @@species
  722. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  723. filter: function filter(callbackfn /* , thisArg */) {
  724. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  725. }
  726. });
  727. /**
  728. * @author doug-the-guy
  729. * @version v1.0.0
  730. *
  731. * Bootstrap Table Pipeline
  732. * -----------------------
  733. *
  734. * This plugin enables client side data caching for server side requests which will
  735. * eliminate the need to issue a new request every page change. This will allow
  736. * for a performance balance for a large data set between returning all data at once
  737. * (client side paging) and a new server side request (server side paging).
  738. *
  739. * There are two new options:
  740. * - usePipeline: enables this feature
  741. * - pipelineSize: the size of each cache window
  742. *
  743. * The size of the pipeline must be evenly divisible by the current page size. This is
  744. * assured by rounding up to the nearest evenly divisible value. For example, if
  745. * the pipeline size is 4990 and the current page size is 25, then pipeline size will
  746. * be dynamically set to 5000.
  747. *
  748. * The cache windows are computed based on the pipeline size and the total number of rows
  749. * returned by the server side query. For example, with pipeline size 500 and total rows
  750. * 1300, the cache windows will be:
  751. *
  752. * [{'lower': 0, 'upper': 499}, {'lower': 500, 'upper': 999}, {'lower': 1000, 'upper': 1499}]
  753. *
  754. * Using the limit (i.e. the pipelineSize) and offset parameters, the server side request
  755. * **MUST** return only the data in the requested cache window **AND** the total number of rows.
  756. * To wit, the server side code must use the offset and limit parameters to prepare the response
  757. * data.
  758. *
  759. * On a page change, the new offset is checked if it is within the current cache window. If so,
  760. * the requested page data is returned from the cached data set. Otherwise, a new server side
  761. * request will be issued for the new cache window.
  762. *
  763. * The current cached data is only invalidated on these events:
  764. * * sorting
  765. * * searching
  766. * * page size change
  767. * * page change moves into a new cache window
  768. *
  769. * There are two new events:
  770. * - cached-data-hit.bs.table: issued when cached data is used on a page change
  771. * - cached-data-reset.bs.table: issued when the cached data is invalidated and a
  772. * new server side request is issued
  773. *
  774. **/
  775. var Utils = $__default['default'].fn.bootstrapTable.utils;
  776. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  777. usePipeline: false,
  778. pipelineSize: 1000,
  779. // eslint-disable-next-line no-unused-vars
  780. onCachedDataHit: function onCachedDataHit(data) {
  781. return false;
  782. },
  783. // eslint-disable-next-line no-unused-vars
  784. onCachedDataReset: function onCachedDataReset(data) {
  785. return false;
  786. }
  787. });
  788. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  789. 'cached-data-hit.bs.table': 'onCachedDataHit',
  790. 'cached-data-reset.bs.table': 'onCachedDataReset'
  791. });
  792. var BootstrapTable = $__default['default'].fn.bootstrapTable.Constructor;
  793. var _init = BootstrapTable.prototype.init;
  794. var _onSearch = BootstrapTable.prototype.onSearch;
  795. var _onSort = BootstrapTable.prototype.onSort;
  796. var _onPageListChange = BootstrapTable.prototype.onPageListChange;
  797. BootstrapTable.prototype.init = function () {
  798. // needs to be called before initServer()
  799. this.initPipeline();
  800. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  801. args[_key] = arguments[_key];
  802. }
  803. _init.apply(this, Array.prototype.slice.apply(args));
  804. };
  805. BootstrapTable.prototype.initPipeline = function () {
  806. this.cacheRequestJSON = {};
  807. this.cacheWindows = [];
  808. this.currWindow = 0;
  809. this.resetCache = true;
  810. };
  811. BootstrapTable.prototype.onSearch = function () {
  812. /* force a cache reset on search */
  813. if (this.options.usePipeline) {
  814. this.resetCache = true;
  815. }
  816. _onSearch.apply(this, Array.prototype.slice.apply(arguments));
  817. };
  818. BootstrapTable.prototype.onSort = function () {
  819. /* force a cache reset on sort */
  820. if (this.options.usePipeline) {
  821. this.resetCache = true;
  822. }
  823. _onSort.apply(this, Array.prototype.slice.apply(arguments));
  824. };
  825. BootstrapTable.prototype.onPageListChange = function (event) {
  826. /* rebuild cache window on page size change */
  827. var target = $__default['default'](event.currentTarget);
  828. var newPageSize = parseInt(target.text());
  829. this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
  830. this.resetCache = true;
  831. _onPageListChange.apply(this, Array.prototype.slice.apply(arguments));
  832. };
  833. BootstrapTable.prototype.calculatePipelineSize = function (pipelineSize, pageSize) {
  834. /* calculate pipeline size by rounding up to the nearest value evenly divisible
  835. * by the pageSize */
  836. if (pageSize === 0) return 0;
  837. return Math.ceil(pipelineSize / pageSize) * pageSize;
  838. };
  839. BootstrapTable.prototype.setCacheWindows = function () {
  840. /* set cache windows based on the total number of rows returned by server side
  841. * request and the pipelineSize */
  842. this.cacheWindows = [];
  843. var numWindows = this.options.totalRows / this.options.pipelineSize;
  844. for (var i = 0; i <= numWindows; i++) {
  845. var b = i * this.options.pipelineSize;
  846. this.cacheWindows[i] = {
  847. lower: b,
  848. upper: b + this.options.pipelineSize - 1
  849. };
  850. }
  851. };
  852. BootstrapTable.prototype.setCurrWindow = function (offset) {
  853. /* set the current cache window index, based on where the current offset falls */
  854. this.currWindow = 0;
  855. for (var i = 0; i < this.cacheWindows.length; i++) {
  856. if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
  857. this.currWindow = i;
  858. break;
  859. }
  860. }
  861. };
  862. BootstrapTable.prototype.drawFromCache = function (offset, limit) {
  863. /* draw rows from the cache using offset and limit */
  864. var res = $__default['default'].extend(true, {}, this.cacheRequestJSON);
  865. var drawStart = offset - this.cacheWindows[this.currWindow].lower;
  866. var drawEnd = drawStart + limit;
  867. res.rows = res.rows.slice(drawStart, drawEnd);
  868. return res;
  869. };
  870. BootstrapTable.prototype.initServer = function (silent, query, url) {
  871. /* determine if requested data is in cache (on paging) or if
  872. * a new ajax request needs to be issued (sorting, searching, paging
  873. * moving outside of cached data, page size change)
  874. * initial version of this extension will entirely override base initServer
  875. **/
  876. var data = {};
  877. var index = this.header.fields.indexOf(this.options.sortName);
  878. var params = {
  879. searchText: this.searchText,
  880. sortName: this.options.sortName,
  881. sortOrder: this.options.sortOrder
  882. };
  883. var request = null;
  884. if (this.header.sortNames[index]) {
  885. params.sortName = this.header.sortNames[index];
  886. }
  887. if (this.options.pagination && this.options.sidePagination === 'server') {
  888. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  889. params.pageNumber = this.options.pageNumber;
  890. }
  891. if (!(url || this.options.url) && !this.options.ajax) {
  892. return;
  893. }
  894. var useAjax = true;
  895. if (this.options.queryParamsType === 'limit') {
  896. params = {
  897. searchText: params.searchText,
  898. sortName: params.sortName,
  899. sortOrder: params.sortOrder
  900. };
  901. if (this.options.pagination && this.options.sidePagination === 'server') {
  902. params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  903. params.offset = (this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize) * (this.options.pageNumber - 1);
  904. if (this.options.usePipeline) {
  905. // if cacheWindows is empty, this is the initial request
  906. if (!this.cacheWindows.length) {
  907. useAjax = true;
  908. params.drawOffset = params.offset; // cache exists: determine if the page request is entirely within the current cached window
  909. } else {
  910. var w = this.cacheWindows[this.currWindow]; // case 1: reset cache but stay within current window (e.g. column sort)
  911. // case 2: move outside of the current window (e.g. search or paging)
  912. // since each cache window is aligned with the current page size
  913. // checking if params.offset is outside the current window is sufficient.
  914. // need to requery for preceding or succeeding cache window
  915. // also handle case
  916. if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
  917. useAjax = true;
  918. this.setCurrWindow(params.offset); // store the relative offset for drawing the page data afterwards
  919. params.drawOffset = params.offset; // now set params.offset to the lower bound of the new cache window
  920. // the server will return that whole cache window
  921. params.offset = this.cacheWindows[this.currWindow].lower; // within current cache window
  922. } else {
  923. useAjax = false;
  924. }
  925. }
  926. } else if (params.limit === 0) {
  927. delete params.limit;
  928. }
  929. }
  930. } // force an ajax call - this is on search, sort or page size change
  931. if (this.resetCache) {
  932. useAjax = true;
  933. this.resetCache = false;
  934. }
  935. if (this.options.usePipeline && useAjax) {
  936. /* in this scenario limit is used on the server to get the cache window
  937. * and drawLimit is used to get the page data afterwards */
  938. params.drawLimit = params.limit;
  939. params.limit = this.options.pipelineSize;
  940. } // cached results can be used
  941. if (!useAjax) {
  942. var res = this.drawFromCache(params.offset, params.limit);
  943. this.load(res);
  944. this.trigger('load-success', res);
  945. this.trigger('cached-data-hit', res);
  946. return;
  947. } // cached results can't be used
  948. // continue base initServer code
  949. if (!$__default['default'].isEmptyObject(this.filterColumnsPartial)) {
  950. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  951. }
  952. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  953. $__default['default'].extend(data, query || {}); // false to stop request
  954. if (data === false) {
  955. return;
  956. }
  957. if (!silent) {
  958. this.$tableLoading.show();
  959. }
  960. var self = this;
  961. request = $__default['default'].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  962. type: this.options.method,
  963. url: url || this.options.url,
  964. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  965. cache: this.options.cache,
  966. contentType: this.options.contentType,
  967. dataType: this.options.dataType,
  968. success: function success(res) {
  969. res = Utils.calculateObjectValue(self.options, self.options.responseHandler, [res], res); // cache results if using pipelining
  970. if (self.options.usePipeline) {
  971. // store entire request in cache
  972. self.cacheRequestJSON = $__default['default'].extend(true, {}, res); // this gets set in load() also but needs to be set before
  973. // setting cacheWindows
  974. self.options.totalRows = res[self.options.totalField]; // if this is a search, potentially less results will be returned
  975. // so cache windows need to be rebuilt. Otherwise it
  976. // will come out the same
  977. self.setCacheWindows();
  978. self.setCurrWindow(params.drawOffset); // just load data for the page
  979. res = self.drawFromCache(params.drawOffset, params.drawLimit);
  980. self.trigger('cached-data-reset', res);
  981. }
  982. self.load(res);
  983. self.trigger('load-success', res);
  984. if (!silent) self.$tableLoading.hide();
  985. },
  986. error: function error(res) {
  987. var data = [];
  988. if (self.options.sidePagination === 'server') {
  989. data = {};
  990. data[self.options.totalField] = 0;
  991. data[self.options.dataField] = [];
  992. }
  993. self.load(data);
  994. self.trigger('load-error', res.status, res);
  995. if (!silent) self.$tableLoading.hide();
  996. }
  997. });
  998. if (this.options.ajax) {
  999. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  1000. } else {
  1001. if (this._xhr && this._xhr.readyState !== 4) {
  1002. this._xhr.abort();
  1003. }
  1004. this._xhr = $__default['default'].ajax(request);
  1005. }
  1006. };
  1007. })));