bootstrap-table-pipeline.js 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  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 = global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var check = function (it) {
  12. return it && it.Math == Math && it;
  13. };
  14. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  15. var global_1 =
  16. // eslint-disable-next-line no-undef
  17. check(typeof globalThis == 'object' && globalThis) ||
  18. check(typeof window == 'object' && window) ||
  19. check(typeof self == 'object' && self) ||
  20. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  21. // eslint-disable-next-line no-new-func
  22. Function('return this')();
  23. var fails = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. // Thank's IE8 for his funny defineProperty
  31. var descriptors = !fails(function () {
  32. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  33. });
  34. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  35. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  36. // Nashorn ~ JDK8 bug
  37. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  38. // `Object.prototype.propertyIsEnumerable` method implementation
  39. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  40. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  41. var descriptor = getOwnPropertyDescriptor(this, V);
  42. return !!descriptor && descriptor.enumerable;
  43. } : nativePropertyIsEnumerable;
  44. var objectPropertyIsEnumerable = {
  45. f: f
  46. };
  47. var createPropertyDescriptor = function (bitmap, value) {
  48. return {
  49. enumerable: !(bitmap & 1),
  50. configurable: !(bitmap & 2),
  51. writable: !(bitmap & 4),
  52. value: value
  53. };
  54. };
  55. var toString = {}.toString;
  56. var classofRaw = function (it) {
  57. return toString.call(it).slice(8, -1);
  58. };
  59. var split = ''.split;
  60. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  61. var indexedObject = fails(function () {
  62. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  63. // eslint-disable-next-line no-prototype-builtins
  64. return !Object('z').propertyIsEnumerable(0);
  65. }) ? function (it) {
  66. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  67. } : Object;
  68. // `RequireObjectCoercible` abstract operation
  69. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  70. var requireObjectCoercible = function (it) {
  71. if (it == undefined) throw TypeError("Can't call method on " + it);
  72. return it;
  73. };
  74. // toObject with fallback for non-array-like ES3 strings
  75. var toIndexedObject = function (it) {
  76. return indexedObject(requireObjectCoercible(it));
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `ToPrimitive` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-toprimitive
  83. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  84. // and the second argument - flag - preferred type is a string
  85. var toPrimitive = function (input, PREFERRED_STRING) {
  86. if (!isObject(input)) return input;
  87. var fn, val;
  88. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  89. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  91. throw TypeError("Can't convert object to primitive value");
  92. };
  93. var hasOwnProperty = {}.hasOwnProperty;
  94. var has = function (it, key) {
  95. return hasOwnProperty.call(it, key);
  96. };
  97. var document = global_1.document;
  98. // typeof document.createElement is 'object' in old IE
  99. var EXISTS = isObject(document) && isObject(document.createElement);
  100. var documentCreateElement = function (it) {
  101. return EXISTS ? document.createElement(it) : {};
  102. };
  103. // Thank's IE8 for his funny defineProperty
  104. var ie8DomDefine = !descriptors && !fails(function () {
  105. return Object.defineProperty(documentCreateElement('div'), 'a', {
  106. get: function () { return 7; }
  107. }).a != 7;
  108. });
  109. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  110. // `Object.getOwnPropertyDescriptor` method
  111. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  112. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  113. O = toIndexedObject(O);
  114. P = toPrimitive(P, true);
  115. if (ie8DomDefine) try {
  116. return nativeGetOwnPropertyDescriptor(O, P);
  117. } catch (error) { /* empty */ }
  118. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  119. };
  120. var objectGetOwnPropertyDescriptor = {
  121. f: f$1
  122. };
  123. var anObject = function (it) {
  124. if (!isObject(it)) {
  125. throw TypeError(String(it) + ' is not an object');
  126. } return it;
  127. };
  128. var nativeDefineProperty = Object.defineProperty;
  129. // `Object.defineProperty` method
  130. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  131. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  132. anObject(O);
  133. P = toPrimitive(P, true);
  134. anObject(Attributes);
  135. if (ie8DomDefine) try {
  136. return nativeDefineProperty(O, P, Attributes);
  137. } catch (error) { /* empty */ }
  138. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  139. if ('value' in Attributes) O[P] = Attributes.value;
  140. return O;
  141. };
  142. var objectDefineProperty = {
  143. f: f$2
  144. };
  145. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  146. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  147. } : function (object, key, value) {
  148. object[key] = value;
  149. return object;
  150. };
  151. var setGlobal = function (key, value) {
  152. try {
  153. createNonEnumerableProperty(global_1, key, value);
  154. } catch (error) {
  155. global_1[key] = value;
  156. } return value;
  157. };
  158. var SHARED = '__core-js_shared__';
  159. var store = global_1[SHARED] || setGlobal(SHARED, {});
  160. var sharedStore = store;
  161. var functionToString = Function.toString;
  162. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  163. if (typeof sharedStore.inspectSource != 'function') {
  164. sharedStore.inspectSource = function (it) {
  165. return functionToString.call(it);
  166. };
  167. }
  168. var inspectSource = sharedStore.inspectSource;
  169. var WeakMap = global_1.WeakMap;
  170. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  171. var shared = createCommonjsModule(function (module) {
  172. (module.exports = function (key, value) {
  173. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  174. })('versions', []).push({
  175. version: '3.6.0',
  176. mode: 'global',
  177. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  178. });
  179. });
  180. var id = 0;
  181. var postfix = Math.random();
  182. var uid = function (key) {
  183. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  184. };
  185. var keys = shared('keys');
  186. var sharedKey = function (key) {
  187. return keys[key] || (keys[key] = uid(key));
  188. };
  189. var hiddenKeys = {};
  190. var WeakMap$1 = global_1.WeakMap;
  191. var set, get, has$1;
  192. var enforce = function (it) {
  193. return has$1(it) ? get(it) : set(it, {});
  194. };
  195. var getterFor = function (TYPE) {
  196. return function (it) {
  197. var state;
  198. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  199. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  200. } return state;
  201. };
  202. };
  203. if (nativeWeakMap) {
  204. var store$1 = new WeakMap$1();
  205. var wmget = store$1.get;
  206. var wmhas = store$1.has;
  207. var wmset = store$1.set;
  208. set = function (it, metadata) {
  209. wmset.call(store$1, it, metadata);
  210. return metadata;
  211. };
  212. get = function (it) {
  213. return wmget.call(store$1, it) || {};
  214. };
  215. has$1 = function (it) {
  216. return wmhas.call(store$1, it);
  217. };
  218. } else {
  219. var STATE = sharedKey('state');
  220. hiddenKeys[STATE] = true;
  221. set = function (it, metadata) {
  222. createNonEnumerableProperty(it, STATE, metadata);
  223. return metadata;
  224. };
  225. get = function (it) {
  226. return has(it, STATE) ? it[STATE] : {};
  227. };
  228. has$1 = function (it) {
  229. return has(it, STATE);
  230. };
  231. }
  232. var internalState = {
  233. set: set,
  234. get: get,
  235. has: has$1,
  236. enforce: enforce,
  237. getterFor: getterFor
  238. };
  239. var redefine = createCommonjsModule(function (module) {
  240. var getInternalState = internalState.get;
  241. var enforceInternalState = internalState.enforce;
  242. var TEMPLATE = String(String).split('String');
  243. (module.exports = function (O, key, value, options) {
  244. var unsafe = options ? !!options.unsafe : false;
  245. var simple = options ? !!options.enumerable : false;
  246. var noTargetGet = options ? !!options.noTargetGet : false;
  247. if (typeof value == 'function') {
  248. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  249. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  250. }
  251. if (O === global_1) {
  252. if (simple) O[key] = value;
  253. else setGlobal(key, value);
  254. return;
  255. } else if (!unsafe) {
  256. delete O[key];
  257. } else if (!noTargetGet && O[key]) {
  258. simple = true;
  259. }
  260. if (simple) O[key] = value;
  261. else createNonEnumerableProperty(O, key, value);
  262. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  263. })(Function.prototype, 'toString', function toString() {
  264. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  265. });
  266. });
  267. var path = global_1;
  268. var aFunction = function (variable) {
  269. return typeof variable == 'function' ? variable : undefined;
  270. };
  271. var getBuiltIn = function (namespace, method) {
  272. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  273. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  274. };
  275. var ceil = Math.ceil;
  276. var floor = Math.floor;
  277. // `ToInteger` abstract operation
  278. // https://tc39.github.io/ecma262/#sec-tointeger
  279. var toInteger = function (argument) {
  280. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  281. };
  282. var min = Math.min;
  283. // `ToLength` abstract operation
  284. // https://tc39.github.io/ecma262/#sec-tolength
  285. var toLength = function (argument) {
  286. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  287. };
  288. var max = Math.max;
  289. var min$1 = Math.min;
  290. // Helper for a popular repeating case of the spec:
  291. // Let integer be ? ToInteger(index).
  292. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  293. var toAbsoluteIndex = function (index, length) {
  294. var integer = toInteger(index);
  295. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  296. };
  297. // `Array.prototype.{ indexOf, includes }` methods implementation
  298. var createMethod = function (IS_INCLUDES) {
  299. return function ($this, el, fromIndex) {
  300. var O = toIndexedObject($this);
  301. var length = toLength(O.length);
  302. var index = toAbsoluteIndex(fromIndex, length);
  303. var value;
  304. // Array#includes uses SameValueZero equality algorithm
  305. // eslint-disable-next-line no-self-compare
  306. if (IS_INCLUDES && el != el) while (length > index) {
  307. value = O[index++];
  308. // eslint-disable-next-line no-self-compare
  309. if (value != value) return true;
  310. // Array#indexOf ignores holes, Array#includes - not
  311. } else for (;length > index; index++) {
  312. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  313. } return !IS_INCLUDES && -1;
  314. };
  315. };
  316. var arrayIncludes = {
  317. // `Array.prototype.includes` method
  318. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  319. includes: createMethod(true),
  320. // `Array.prototype.indexOf` method
  321. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  322. indexOf: createMethod(false)
  323. };
  324. var indexOf = arrayIncludes.indexOf;
  325. var objectKeysInternal = function (object, names) {
  326. var O = toIndexedObject(object);
  327. var i = 0;
  328. var result = [];
  329. var key;
  330. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  331. // Don't enum bug & hidden keys
  332. while (names.length > i) if (has(O, key = names[i++])) {
  333. ~indexOf(result, key) || result.push(key);
  334. }
  335. return result;
  336. };
  337. // IE8- don't enum bug keys
  338. var enumBugKeys = [
  339. 'constructor',
  340. 'hasOwnProperty',
  341. 'isPrototypeOf',
  342. 'propertyIsEnumerable',
  343. 'toLocaleString',
  344. 'toString',
  345. 'valueOf'
  346. ];
  347. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  348. // `Object.getOwnPropertyNames` method
  349. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  350. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  351. return objectKeysInternal(O, hiddenKeys$1);
  352. };
  353. var objectGetOwnPropertyNames = {
  354. f: f$3
  355. };
  356. var f$4 = Object.getOwnPropertySymbols;
  357. var objectGetOwnPropertySymbols = {
  358. f: f$4
  359. };
  360. // all object keys, includes non-enumerable and symbols
  361. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  362. var keys = objectGetOwnPropertyNames.f(anObject(it));
  363. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  364. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  365. };
  366. var copyConstructorProperties = function (target, source) {
  367. var keys = ownKeys(source);
  368. var defineProperty = objectDefineProperty.f;
  369. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  370. for (var i = 0; i < keys.length; i++) {
  371. var key = keys[i];
  372. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  373. }
  374. };
  375. var replacement = /#|\.prototype\./;
  376. var isForced = function (feature, detection) {
  377. var value = data[normalize(feature)];
  378. return value == POLYFILL ? true
  379. : value == NATIVE ? false
  380. : typeof detection == 'function' ? fails(detection)
  381. : !!detection;
  382. };
  383. var normalize = isForced.normalize = function (string) {
  384. return String(string).replace(replacement, '.').toLowerCase();
  385. };
  386. var data = isForced.data = {};
  387. var NATIVE = isForced.NATIVE = 'N';
  388. var POLYFILL = isForced.POLYFILL = 'P';
  389. var isForced_1 = isForced;
  390. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  391. /*
  392. options.target - name of the target object
  393. options.global - target is the global object
  394. options.stat - export as static methods of target
  395. options.proto - export as prototype methods of target
  396. options.real - real prototype method for the `pure` version
  397. options.forced - export even if the native feature is available
  398. options.bind - bind methods to the target, required for the `pure` version
  399. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  400. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  401. options.sham - add a flag to not completely full polyfills
  402. options.enumerable - export as enumerable property
  403. options.noTargetGet - prevent calling a getter on target
  404. */
  405. var _export = function (options, source) {
  406. var TARGET = options.target;
  407. var GLOBAL = options.global;
  408. var STATIC = options.stat;
  409. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  410. if (GLOBAL) {
  411. target = global_1;
  412. } else if (STATIC) {
  413. target = global_1[TARGET] || setGlobal(TARGET, {});
  414. } else {
  415. target = (global_1[TARGET] || {}).prototype;
  416. }
  417. if (target) for (key in source) {
  418. sourceProperty = source[key];
  419. if (options.noTargetGet) {
  420. descriptor = getOwnPropertyDescriptor$1(target, key);
  421. targetProperty = descriptor && descriptor.value;
  422. } else targetProperty = target[key];
  423. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  424. // contained in target
  425. if (!FORCED && targetProperty !== undefined) {
  426. if (typeof sourceProperty === typeof targetProperty) continue;
  427. copyConstructorProperties(sourceProperty, targetProperty);
  428. }
  429. // add a flag to not completely full polyfills
  430. if (options.sham || (targetProperty && targetProperty.sham)) {
  431. createNonEnumerableProperty(sourceProperty, 'sham', true);
  432. }
  433. // extend global
  434. redefine(target, key, sourceProperty, options);
  435. }
  436. };
  437. var aFunction$1 = function (it) {
  438. if (typeof it != 'function') {
  439. throw TypeError(String(it) + ' is not a function');
  440. } return it;
  441. };
  442. // optional / simple context binding
  443. var bindContext = function (fn, that, length) {
  444. aFunction$1(fn);
  445. if (that === undefined) return fn;
  446. switch (length) {
  447. case 0: return function () {
  448. return fn.call(that);
  449. };
  450. case 1: return function (a) {
  451. return fn.call(that, a);
  452. };
  453. case 2: return function (a, b) {
  454. return fn.call(that, a, b);
  455. };
  456. case 3: return function (a, b, c) {
  457. return fn.call(that, a, b, c);
  458. };
  459. }
  460. return function (/* ...args */) {
  461. return fn.apply(that, arguments);
  462. };
  463. };
  464. // `ToObject` abstract operation
  465. // https://tc39.github.io/ecma262/#sec-toobject
  466. var toObject = function (argument) {
  467. return Object(requireObjectCoercible(argument));
  468. };
  469. // `IsArray` abstract operation
  470. // https://tc39.github.io/ecma262/#sec-isarray
  471. var isArray = Array.isArray || function isArray(arg) {
  472. return classofRaw(arg) == 'Array';
  473. };
  474. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  475. // Chrome 38 Symbol has incorrect toString conversion
  476. // eslint-disable-next-line no-undef
  477. return !String(Symbol());
  478. });
  479. var useSymbolAsUid = nativeSymbol
  480. // eslint-disable-next-line no-undef
  481. && !Symbol.sham
  482. // eslint-disable-next-line no-undef
  483. && typeof Symbol() == 'symbol';
  484. var WellKnownSymbolsStore = shared('wks');
  485. var Symbol$1 = global_1.Symbol;
  486. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
  487. var wellKnownSymbol = function (name) {
  488. if (!has(WellKnownSymbolsStore, name)) {
  489. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  490. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  491. } return WellKnownSymbolsStore[name];
  492. };
  493. var SPECIES = wellKnownSymbol('species');
  494. // `ArraySpeciesCreate` abstract operation
  495. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  496. var arraySpeciesCreate = function (originalArray, length) {
  497. var C;
  498. if (isArray(originalArray)) {
  499. C = originalArray.constructor;
  500. // cross-realm fallback
  501. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  502. else if (isObject(C)) {
  503. C = C[SPECIES];
  504. if (C === null) C = undefined;
  505. }
  506. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  507. };
  508. var push = [].push;
  509. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  510. var createMethod$1 = function (TYPE) {
  511. var IS_MAP = TYPE == 1;
  512. var IS_FILTER = TYPE == 2;
  513. var IS_SOME = TYPE == 3;
  514. var IS_EVERY = TYPE == 4;
  515. var IS_FIND_INDEX = TYPE == 6;
  516. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  517. return function ($this, callbackfn, that, specificCreate) {
  518. var O = toObject($this);
  519. var self = indexedObject(O);
  520. var boundFunction = bindContext(callbackfn, that, 3);
  521. var length = toLength(self.length);
  522. var index = 0;
  523. var create = specificCreate || arraySpeciesCreate;
  524. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  525. var value, result;
  526. for (;length > index; index++) if (NO_HOLES || index in self) {
  527. value = self[index];
  528. result = boundFunction(value, index, O);
  529. if (TYPE) {
  530. if (IS_MAP) target[index] = result; // map
  531. else if (result) switch (TYPE) {
  532. case 3: return true; // some
  533. case 5: return value; // find
  534. case 6: return index; // findIndex
  535. case 2: push.call(target, value); // filter
  536. } else if (IS_EVERY) return false; // every
  537. }
  538. }
  539. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  540. };
  541. };
  542. var arrayIteration = {
  543. // `Array.prototype.forEach` method
  544. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  545. forEach: createMethod$1(0),
  546. // `Array.prototype.map` method
  547. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  548. map: createMethod$1(1),
  549. // `Array.prototype.filter` method
  550. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  551. filter: createMethod$1(2),
  552. // `Array.prototype.some` method
  553. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  554. some: createMethod$1(3),
  555. // `Array.prototype.every` method
  556. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  557. every: createMethod$1(4),
  558. // `Array.prototype.find` method
  559. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  560. find: createMethod$1(5),
  561. // `Array.prototype.findIndex` method
  562. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  563. findIndex: createMethod$1(6)
  564. };
  565. var userAgent = getBuiltIn('navigator', 'userAgent') || '';
  566. var process = global_1.process;
  567. var versions = process && process.versions;
  568. var v8 = versions && versions.v8;
  569. var match, version;
  570. if (v8) {
  571. match = v8.split('.');
  572. version = match[0] + match[1];
  573. } else if (userAgent) {
  574. match = userAgent.match(/Edge\/(\d+)/);
  575. if (!match || match[1] >= 74) {
  576. match = userAgent.match(/Chrome\/(\d+)/);
  577. if (match) version = match[1];
  578. }
  579. }
  580. var v8Version = version && +version;
  581. var SPECIES$1 = wellKnownSymbol('species');
  582. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  583. // We can't use this feature detection in V8 since it causes
  584. // deoptimization and serious performance degradation
  585. // https://github.com/zloirock/core-js/issues/677
  586. return v8Version >= 51 || !fails(function () {
  587. var array = [];
  588. var constructor = array.constructor = {};
  589. constructor[SPECIES$1] = function () {
  590. return { foo: 1 };
  591. };
  592. return array[METHOD_NAME](Boolean).foo !== 1;
  593. });
  594. };
  595. var $filter = arrayIteration.filter;
  596. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  597. // Edge 14- issue
  598. var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
  599. [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
  600. });
  601. // `Array.prototype.filter` method
  602. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  603. // with adding support of @@species
  604. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  605. filter: function filter(callbackfn /* , thisArg */) {
  606. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  607. }
  608. });
  609. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  610. var method = [][METHOD_NAME];
  611. return !method || !fails(function () {
  612. // eslint-disable-next-line no-useless-call,no-throw-literal
  613. method.call(null, argument || function () { throw 1; }, 1);
  614. });
  615. };
  616. var $indexOf = arrayIncludes.indexOf;
  617. var nativeIndexOf = [].indexOf;
  618. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  619. var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
  620. // `Array.prototype.indexOf` method
  621. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  622. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
  623. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  624. return NEGATIVE_ZERO
  625. // convert -0 to +0
  626. ? nativeIndexOf.apply(this, arguments) || 0
  627. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  628. }
  629. });
  630. var createProperty = function (object, key, value) {
  631. var propertyKey = toPrimitive(key);
  632. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  633. else object[propertyKey] = value;
  634. };
  635. var SPECIES$2 = wellKnownSymbol('species');
  636. var nativeSlice = [].slice;
  637. var max$1 = Math.max;
  638. // `Array.prototype.slice` method
  639. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  640. // fallback for not array-like ES3 strings and DOM objects
  641. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  642. slice: function slice(start, end) {
  643. var O = toIndexedObject(this);
  644. var length = toLength(O.length);
  645. var k = toAbsoluteIndex(start, length);
  646. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  647. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  648. var Constructor, result, n;
  649. if (isArray(O)) {
  650. Constructor = O.constructor;
  651. // cross-realm fallback
  652. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  653. Constructor = undefined;
  654. } else if (isObject(Constructor)) {
  655. Constructor = Constructor[SPECIES$2];
  656. if (Constructor === null) Constructor = undefined;
  657. }
  658. if (Constructor === Array || Constructor === undefined) {
  659. return nativeSlice.call(O, k, fin);
  660. }
  661. }
  662. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  663. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  664. result.length = n;
  665. return result;
  666. }
  667. });
  668. // a string of all valid unicode whitespaces
  669. // eslint-disable-next-line max-len
  670. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  671. var whitespace = '[' + whitespaces + ']';
  672. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  673. var rtrim = RegExp(whitespace + whitespace + '*$');
  674. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  675. var createMethod$2 = function (TYPE) {
  676. return function ($this) {
  677. var string = String(requireObjectCoercible($this));
  678. if (TYPE & 1) string = string.replace(ltrim, '');
  679. if (TYPE & 2) string = string.replace(rtrim, '');
  680. return string;
  681. };
  682. };
  683. var stringTrim = {
  684. // `String.prototype.{ trimLeft, trimStart }` methods
  685. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  686. start: createMethod$2(1),
  687. // `String.prototype.{ trimRight, trimEnd }` methods
  688. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  689. end: createMethod$2(2),
  690. // `String.prototype.trim` method
  691. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  692. trim: createMethod$2(3)
  693. };
  694. var trim = stringTrim.trim;
  695. var nativeParseInt = global_1.parseInt;
  696. var hex = /^[+-]?0[Xx]/;
  697. var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
  698. // `parseInt` method
  699. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  700. var _parseInt = FORCED ? function parseInt(string, radix) {
  701. var S = trim(String(string));
  702. return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  703. } : nativeParseInt;
  704. // `parseInt` method
  705. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  706. _export({ global: true, forced: parseInt != _parseInt }, {
  707. parseInt: _parseInt
  708. });
  709. /**
  710. * @author doug-the-guy
  711. * @version v1.0.0
  712. *
  713. * Bootstrap Table Pipeline
  714. * -----------------------
  715. *
  716. * This plugin enables client side data caching for server side requests which will
  717. * eliminate the need to issue a new request every page change. This will allow
  718. * for a performance balance for a large data set between returning all data at once
  719. * (client side paging) and a new server side request (server side paging).
  720. *
  721. * There are two new options:
  722. * - usePipeline: enables this feature
  723. * - pipelineSize: the size of each cache window
  724. *
  725. * The size of the pipeline must be evenly divisible by the current page size. This is
  726. * assured by rounding up to the nearest evenly divisible value. For example, if
  727. * the pipeline size is 4990 and the current page size is 25, then pipeline size will
  728. * be dynamically set to 5000.
  729. *
  730. * The cache windows are computed based on the pipeline size and the total number of rows
  731. * returned by the server side query. For example, with pipeline size 500 and total rows
  732. * 1300, the cache windows will be:
  733. *
  734. * [{'lower': 0, 'upper': 499}, {'lower': 500, 'upper': 999}, {'lower': 1000, 'upper': 1499}]
  735. *
  736. * Using the limit (i.e. the pipelineSize) and offset parameters, the server side request
  737. * **MUST** return only the data in the requested cache window **AND** the total number of rows.
  738. * To wit, the server side code must use the offset and limit parameters to prepare the response
  739. * data.
  740. *
  741. * On a page change, the new offset is checked if it is within the current cache window. If so,
  742. * the requested page data is returned from the cached data set. Otherwise, a new server side
  743. * request will be issued for the new cache window.
  744. *
  745. * The current cached data is only invalidated on these events:
  746. * * sorting
  747. * * searching
  748. * * page size change
  749. * * page change moves into a new cache window
  750. *
  751. * There are two new events:
  752. * - cached-data-hit.bs.table: issued when cached data is used on a page change
  753. * - cached-data-reset.bs.table: issued when the cached data is invalidated and a
  754. * new server side request is issued
  755. *
  756. **/
  757. var Utils = $.fn.bootstrapTable.utils;
  758. $.extend($.fn.bootstrapTable.defaults, {
  759. usePipeline: false,
  760. pipelineSize: 1000,
  761. // eslint-disable-next-line no-unused-vars
  762. onCachedDataHit: function onCachedDataHit(data) {
  763. return false;
  764. },
  765. // eslint-disable-next-line no-unused-vars
  766. onCachedDataReset: function onCachedDataReset(data) {
  767. return false;
  768. }
  769. });
  770. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  771. 'cached-data-hit.bs.table': 'onCachedDataHit',
  772. 'cached-data-reset.bs.table': 'onCachedDataReset'
  773. });
  774. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  775. var _init = BootstrapTable.prototype.init;
  776. var _onSearch = BootstrapTable.prototype.onSearch;
  777. var _onSort = BootstrapTable.prototype.onSort;
  778. var _onPageListChange = BootstrapTable.prototype.onPageListChange;
  779. BootstrapTable.prototype.init = function () {
  780. // needs to be called before initServer()
  781. this.initPipeline();
  782. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  783. args[_key] = arguments[_key];
  784. }
  785. _init.apply(this, Array.prototype.slice.apply(args));
  786. };
  787. BootstrapTable.prototype.initPipeline = function () {
  788. this.cacheRequestJSON = {};
  789. this.cacheWindows = [];
  790. this.currWindow = 0;
  791. this.resetCache = true;
  792. };
  793. BootstrapTable.prototype.onSearch = function () {
  794. /* force a cache reset on search */
  795. if (this.options.usePipeline) {
  796. this.resetCache = true;
  797. }
  798. _onSearch.apply(this, Array.prototype.slice.apply(arguments));
  799. };
  800. BootstrapTable.prototype.onSort = function () {
  801. /* force a cache reset on sort */
  802. if (this.options.usePipeline) {
  803. this.resetCache = true;
  804. }
  805. _onSort.apply(this, Array.prototype.slice.apply(arguments));
  806. };
  807. BootstrapTable.prototype.onPageListChange = function (event) {
  808. /* rebuild cache window on page size change */
  809. var target = $(event.currentTarget);
  810. var newPageSize = parseInt(target.text());
  811. this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
  812. this.resetCache = true;
  813. _onPageListChange.apply(this, Array.prototype.slice.apply(arguments));
  814. };
  815. BootstrapTable.prototype.calculatePipelineSize = function (pipelineSize, pageSize) {
  816. /* calculate pipeline size by rounding up to the nearest value evenly divisible
  817. * by the pageSize */
  818. if (pageSize === 0) return 0;
  819. return Math.ceil(pipelineSize / pageSize) * pageSize;
  820. };
  821. BootstrapTable.prototype.setCacheWindows = function () {
  822. /* set cache windows based on the total number of rows returned by server side
  823. * request and the pipelineSize */
  824. this.cacheWindows = [];
  825. var numWindows = this.options.totalRows / this.options.pipelineSize;
  826. for (var i = 0; i <= numWindows; i++) {
  827. var b = i * this.options.pipelineSize;
  828. this.cacheWindows[i] = {
  829. lower: b,
  830. upper: b + this.options.pipelineSize - 1
  831. };
  832. }
  833. };
  834. BootstrapTable.prototype.setCurrWindow = function (offset) {
  835. /* set the current cache window index, based on where the current offset falls */
  836. this.currWindow = 0;
  837. for (var i = 0; i < this.cacheWindows.length; i++) {
  838. if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
  839. this.currWindow = i;
  840. break;
  841. }
  842. }
  843. };
  844. BootstrapTable.prototype.drawFromCache = function (offset, limit) {
  845. /* draw rows from the cache using offset and limit */
  846. var res = $.extend(true, {}, this.cacheRequestJSON);
  847. var drawStart = offset - this.cacheWindows[this.currWindow].lower;
  848. var drawEnd = drawStart + limit;
  849. res.rows = res.rows.slice(drawStart, drawEnd);
  850. return res;
  851. };
  852. BootstrapTable.prototype.initServer = function (silent, query, url) {
  853. /* determine if requested data is in cache (on paging) or if
  854. * a new ajax request needs to be issued (sorting, searching, paging
  855. * moving outside of cached data, page size change)
  856. * initial version of this extension will entirely override base initServer
  857. **/
  858. var data = {};
  859. var index = this.header.fields.indexOf(this.options.sortName);
  860. var params = {
  861. searchText: this.searchText,
  862. sortName: this.options.sortName,
  863. sortOrder: this.options.sortOrder
  864. };
  865. var request = null;
  866. if (this.header.sortNames[index]) {
  867. params.sortName = this.header.sortNames[index];
  868. }
  869. if (this.options.pagination && this.options.sidePagination === 'server') {
  870. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  871. params.pageNumber = this.options.pageNumber;
  872. }
  873. if (!(url || this.options.url) && !this.options.ajax) {
  874. return;
  875. }
  876. var useAjax = true;
  877. if (this.options.queryParamsType === 'limit') {
  878. params = {
  879. searchText: params.searchText,
  880. sortName: params.sortName,
  881. sortOrder: params.sortOrder
  882. };
  883. if (this.options.pagination && this.options.sidePagination === 'server') {
  884. params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  885. params.offset = (this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize) * (this.options.pageNumber - 1);
  886. if (this.options.usePipeline) {
  887. // if cacheWindows is empty, this is the initial request
  888. if (!this.cacheWindows.length) {
  889. useAjax = true;
  890. params.drawOffset = params.offset; // cache exists: determine if the page request is entirely within the current cached window
  891. } else {
  892. var w = this.cacheWindows[this.currWindow]; // case 1: reset cache but stay within current window (e.g. column sort)
  893. // case 2: move outside of the current window (e.g. search or paging)
  894. // since each cache window is aligned with the current page size
  895. // checking if params.offset is outside the current window is sufficient.
  896. // need to requery for preceding or succeeding cache window
  897. // also handle case
  898. if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
  899. useAjax = true;
  900. this.setCurrWindow(params.offset); // store the relative offset for drawing the page data afterwards
  901. params.drawOffset = params.offset; // now set params.offset to the lower bound of the new cache window
  902. // the server will return that whole cache window
  903. params.offset = this.cacheWindows[this.currWindow].lower; // within current cache window
  904. } else {
  905. useAjax = false;
  906. }
  907. }
  908. } else if (params.limit === 0) {
  909. delete params.limit;
  910. }
  911. }
  912. } // force an ajax call - this is on search, sort or page size change
  913. if (this.resetCache) {
  914. useAjax = true;
  915. this.resetCache = false;
  916. }
  917. if (this.options.usePipeline && useAjax) {
  918. /* in this scenario limit is used on the server to get the cache window
  919. * and drawLimit is used to get the page data afterwards */
  920. params.drawLimit = params.limit;
  921. params.limit = this.options.pipelineSize;
  922. } // cached results can be used
  923. if (!useAjax) {
  924. var res = this.drawFromCache(params.offset, params.limit);
  925. this.load(res);
  926. this.trigger('load-success', res);
  927. this.trigger('cached-data-hit', res);
  928. return;
  929. } // cached results can't be used
  930. // continue base initServer code
  931. if (!$.isEmptyObject(this.filterColumnsPartial)) {
  932. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  933. }
  934. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  935. $.extend(data, query || {}); // false to stop request
  936. if (data === false) {
  937. return;
  938. }
  939. if (!silent) {
  940. this.$tableLoading.show();
  941. }
  942. var self = this;
  943. request = $.extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  944. type: this.options.method,
  945. url: url || this.options.url,
  946. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  947. cache: this.options.cache,
  948. contentType: this.options.contentType,
  949. dataType: this.options.dataType,
  950. success: function success(res) {
  951. res = Utils.calculateObjectValue(self.options, self.options.responseHandler, [res], res); // cache results if using pipelining
  952. if (self.options.usePipeline) {
  953. // store entire request in cache
  954. self.cacheRequestJSON = $.extend(true, {}, res); // this gets set in load() also but needs to be set before
  955. // setting cacheWindows
  956. self.options.totalRows = res[self.options.totalField]; // if this is a search, potentially less results will be returned
  957. // so cache windows need to be rebuilt. Otherwise it
  958. // will come out the same
  959. self.setCacheWindows();
  960. self.setCurrWindow(params.drawOffset); // just load data for the page
  961. res = self.drawFromCache(params.drawOffset, params.drawLimit);
  962. self.trigger('cached-data-reset', res);
  963. }
  964. self.load(res);
  965. self.trigger('load-success', res);
  966. if (!silent) self.$tableLoading.hide();
  967. },
  968. error: function error(res) {
  969. var data = [];
  970. if (self.options.sidePagination === 'server') {
  971. data = {};
  972. data[self.options.totalField] = 0;
  973. data[self.options.dataField] = [];
  974. }
  975. self.load(data);
  976. self.trigger('load-error', res.status, res);
  977. if (!silent) self.$tableLoading.hide();
  978. }
  979. });
  980. if (this.options.ajax) {
  981. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  982. } else {
  983. if (this._xhr && this._xhr.readyState !== 4) {
  984. this._xhr.abort();
  985. }
  986. this._xhr = $.ajax(request);
  987. }
  988. };
  989. })));