bootstrap-table-pipeline.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  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. $ = $ && $.hasOwnProperty('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. onCachedDataHit: function onCachedDataHit(data) {
  762. return false;
  763. },
  764. onCachedDataReset: function onCachedDataReset(data) {
  765. return false;
  766. }
  767. });
  768. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  769. 'cached-data-hit.bs.table': 'onCachedDataHit',
  770. 'cached-data-reset.bs.table': 'onCachedDataReset'
  771. });
  772. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  773. var _init = BootstrapTable.prototype.init;
  774. var _initServer = BootstrapTable.prototype.initServer;
  775. var _onSearch = BootstrapTable.prototype.onSearch;
  776. var _onSort = BootstrapTable.prototype.onSort;
  777. var _onPageListChange = BootstrapTable.prototype.onPageListChange;
  778. BootstrapTable.prototype.init = function () {
  779. // needs to be called before initServer()
  780. this.initPipeline();
  781. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  782. args[_key] = arguments[_key];
  783. }
  784. _init.apply(this, Array.prototype.slice.apply(args));
  785. };
  786. BootstrapTable.prototype.initPipeline = function () {
  787. this.cacheRequestJSON = {};
  788. this.cacheWindows = [];
  789. this.currWindow = 0;
  790. this.resetCache = true;
  791. };
  792. BootstrapTable.prototype.onSearch = function (event) {
  793. /* force a cache reset on search */
  794. if (this.options.usePipeline) {
  795. this.resetCache = true;
  796. }
  797. _onSearch.apply(this, Array.prototype.slice.apply(arguments));
  798. };
  799. BootstrapTable.prototype.onSort = function (event) {
  800. /* force a cache reset on sort */
  801. if (this.options.usePipeline) {
  802. this.resetCache = true;
  803. }
  804. _onSort.apply(this, Array.prototype.slice.apply(arguments));
  805. };
  806. BootstrapTable.prototype.onPageListChange = function (event) {
  807. /* rebuild cache window on page size change */
  808. var target = $(event.currentTarget);
  809. var newPageSize = parseInt(target.text());
  810. this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
  811. this.resetCache = true;
  812. _onPageListChange.apply(this, Array.prototype.slice.apply(arguments));
  813. };
  814. BootstrapTable.prototype.calculatePipelineSize = function (pipelineSize, pageSize) {
  815. /* calculate pipeline size by rounding up to the nearest value evenly divisible
  816. * by the pageSize */
  817. if (pageSize === 0) return 0;
  818. return Math.ceil(pipelineSize / pageSize) * pageSize;
  819. };
  820. BootstrapTable.prototype.setCacheWindows = function () {
  821. /* set cache windows based on the total number of rows returned by server side
  822. * request and the pipelineSize */
  823. this.cacheWindows = [];
  824. var numWindows = this.options.totalRows / this.options.pipelineSize;
  825. for (var i = 0; i <= numWindows; i++) {
  826. var b = i * this.options.pipelineSize;
  827. this.cacheWindows[i] = {
  828. 'lower': b,
  829. 'upper': b + this.options.pipelineSize - 1
  830. };
  831. }
  832. };
  833. BootstrapTable.prototype.setCurrWindow = function (offset) {
  834. /* set the current cache window index, based on where the current offset falls */
  835. this.currWindow = 0;
  836. for (var i = 0; i < this.cacheWindows.length; i++) {
  837. if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
  838. this.currWindow = i;
  839. break;
  840. }
  841. }
  842. };
  843. BootstrapTable.prototype.drawFromCache = function (offset, limit) {
  844. /* draw rows from the cache using offset and limit */
  845. var res = $.extend(true, {}, this.cacheRequestJSON);
  846. var drawStart = offset - this.cacheWindows[this.currWindow].lower;
  847. var drawEnd = drawStart + limit;
  848. res.rows = res.rows.slice(drawStart, drawEnd);
  849. return res;
  850. };
  851. BootstrapTable.prototype.initServer = function (silent, query, url) {
  852. /* determine if requested data is in cache (on paging) or if
  853. * a new ajax request needs to be issued (sorting, searching, paging
  854. * moving outside of cached data, page size change)
  855. * initial version of this extension will entirely override base initServer
  856. **/
  857. var data = {};
  858. var index = this.header.fields.indexOf(this.options.sortName);
  859. var params = {
  860. searchText: this.searchText,
  861. sortName: this.options.sortName,
  862. sortOrder: this.options.sortOrder
  863. };
  864. var request = null;
  865. if (this.header.sortNames[index]) {
  866. params.sortName = this.header.sortNames[index];
  867. }
  868. if (this.options.pagination && this.options.sidePagination === 'server') {
  869. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  870. params.pageNumber = this.options.pageNumber;
  871. }
  872. if (!(url || this.options.url) && !this.options.ajax) {
  873. return;
  874. }
  875. var useAjax = true;
  876. if (this.options.queryParamsType === 'limit') {
  877. params = {
  878. searchText: params.searchText,
  879. sortName: params.sortName,
  880. sortOrder: params.sortOrder
  881. };
  882. if (this.options.pagination && this.options.sidePagination === 'server') {
  883. params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  884. params.offset = (this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize) * (this.options.pageNumber - 1);
  885. if (this.options.usePipeline) {
  886. // if cacheWindows is empty, this is the initial request
  887. if (!this.cacheWindows.length) {
  888. useAjax = true;
  889. params.drawOffset = params.offset; // cache exists: determine if the page request is entirely within the current cached window
  890. } else {
  891. var w = this.cacheWindows[this.currWindow]; // case 1: reset cache but stay within current window (e.g. column sort)
  892. // case 2: move outside of the current window (e.g. search or paging)
  893. // since each cache window is aligned with the current page size
  894. // checking if params.offset is outside the current window is sufficient.
  895. // need to requery for preceding or succeeding cache window
  896. // also handle case
  897. if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
  898. useAjax = true;
  899. this.setCurrWindow(params.offset); // store the relative offset for drawing the page data afterwards
  900. params.drawOffset = params.offset; // now set params.offset to the lower bound of the new cache window
  901. // the server will return that whole cache window
  902. params.offset = this.cacheWindows[this.currWindow].lower; // within current cache window
  903. } else {
  904. useAjax = false;
  905. }
  906. }
  907. } else {
  908. if (params.limit === 0) {
  909. delete params.limit;
  910. }
  911. }
  912. }
  913. } // force an ajax call - this is on search, sort or page size change
  914. if (this.resetCache) {
  915. useAjax = true;
  916. this.resetCache = false;
  917. }
  918. if (this.options.usePipeline && useAjax) {
  919. /* in this scenario limit is used on the server to get the cache window
  920. * and drawLimit is used to get the page data afterwards */
  921. params.drawLimit = params.limit;
  922. params.limit = this.options.pipelineSize;
  923. } // cached results can be used
  924. if (!useAjax) {
  925. var res = this.drawFromCache(params.offset, params.limit);
  926. this.load(res);
  927. this.trigger('load-success', res);
  928. this.trigger('cached-data-hit', res);
  929. return;
  930. } // cached results can't be used
  931. // continue base initServer code
  932. if (!$.isEmptyObject(this.filterColumnsPartial)) {
  933. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  934. }
  935. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  936. $.extend(data, query || {}); // false to stop request
  937. if (data === false) {
  938. return;
  939. }
  940. if (!silent) {
  941. this.$tableLoading.show();
  942. }
  943. var self = this;
  944. request = $.extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  945. type: this.options.method,
  946. url: url || this.options.url,
  947. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  948. cache: this.options.cache,
  949. contentType: this.options.contentType,
  950. dataType: this.options.dataType,
  951. success: function success(res) {
  952. res = Utils.calculateObjectValue(self.options, self.options.responseHandler, [res], res); // cache results if using pipelining
  953. if (self.options.usePipeline) {
  954. // store entire request in cache
  955. self.cacheRequestJSON = $.extend(true, {}, res); // this gets set in load() also but needs to be set before
  956. // setting cacheWindows
  957. self.options.totalRows = res[self.options.totalField]; // if this is a search, potentially less results will be returned
  958. // so cache windows need to be rebuilt. Otherwise it
  959. // will come out the same
  960. self.setCacheWindows();
  961. self.setCurrWindow(params.drawOffset); // just load data for the page
  962. res = self.drawFromCache(params.drawOffset, params.drawLimit);
  963. self.trigger('cached-data-reset', res);
  964. }
  965. self.load(res);
  966. self.trigger('load-success', res);
  967. if (!silent) self.$tableLoading.hide();
  968. },
  969. error: function error(res) {
  970. var data = [];
  971. if (self.options.sidePagination === 'server') {
  972. data = {};
  973. data[self.options.totalField] = 0;
  974. data[self.options.dataField] = [];
  975. }
  976. self.load(data);
  977. self.trigger('load-error', res.status, res);
  978. if (!silent) self.$tableLoading.hide();
  979. }
  980. });
  981. if (this.options.ajax) {
  982. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  983. } else {
  984. if (this._xhr && this._xhr.readyState !== 4) {
  985. this._xhr.abort();
  986. }
  987. this._xhr = $.ajax(request);
  988. }
  989. };
  990. })));