bootstrap-table-multiple-sort.js 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113
  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$1 = global_1.document;
  98. // typeof document.createElement is 'object' in old IE
  99. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  100. var documentCreateElement = function (it) {
  101. return EXISTS ? document$1.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. // `IsArray` abstract operation
  438. // https://tc39.github.io/ecma262/#sec-isarray
  439. var isArray = Array.isArray || function isArray(arg) {
  440. return classofRaw(arg) == 'Array';
  441. };
  442. // `ToObject` abstract operation
  443. // https://tc39.github.io/ecma262/#sec-toobject
  444. var toObject = function (argument) {
  445. return Object(requireObjectCoercible(argument));
  446. };
  447. var createProperty = function (object, key, value) {
  448. var propertyKey = toPrimitive(key);
  449. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  450. else object[propertyKey] = value;
  451. };
  452. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  453. // Chrome 38 Symbol has incorrect toString conversion
  454. // eslint-disable-next-line no-undef
  455. return !String(Symbol());
  456. });
  457. var useSymbolAsUid = nativeSymbol
  458. // eslint-disable-next-line no-undef
  459. && !Symbol.sham
  460. // eslint-disable-next-line no-undef
  461. && typeof Symbol() == 'symbol';
  462. var WellKnownSymbolsStore = shared('wks');
  463. var Symbol$1 = global_1.Symbol;
  464. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
  465. var wellKnownSymbol = function (name) {
  466. if (!has(WellKnownSymbolsStore, name)) {
  467. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  468. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  469. } return WellKnownSymbolsStore[name];
  470. };
  471. var SPECIES = wellKnownSymbol('species');
  472. // `ArraySpeciesCreate` abstract operation
  473. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  474. var arraySpeciesCreate = function (originalArray, length) {
  475. var C;
  476. if (isArray(originalArray)) {
  477. C = originalArray.constructor;
  478. // cross-realm fallback
  479. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  480. else if (isObject(C)) {
  481. C = C[SPECIES];
  482. if (C === null) C = undefined;
  483. }
  484. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  485. };
  486. var userAgent = getBuiltIn('navigator', 'userAgent') || '';
  487. var process = global_1.process;
  488. var versions = process && process.versions;
  489. var v8 = versions && versions.v8;
  490. var match, version;
  491. if (v8) {
  492. match = v8.split('.');
  493. version = match[0] + match[1];
  494. } else if (userAgent) {
  495. match = userAgent.match(/Edge\/(\d+)/);
  496. if (!match || match[1] >= 74) {
  497. match = userAgent.match(/Chrome\/(\d+)/);
  498. if (match) version = match[1];
  499. }
  500. }
  501. var v8Version = version && +version;
  502. var SPECIES$1 = wellKnownSymbol('species');
  503. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  504. // We can't use this feature detection in V8 since it causes
  505. // deoptimization and serious performance degradation
  506. // https://github.com/zloirock/core-js/issues/677
  507. return v8Version >= 51 || !fails(function () {
  508. var array = [];
  509. var constructor = array.constructor = {};
  510. constructor[SPECIES$1] = function () {
  511. return { foo: 1 };
  512. };
  513. return array[METHOD_NAME](Boolean).foo !== 1;
  514. });
  515. };
  516. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  517. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  518. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  519. // We can't use this feature detection in V8 since it causes
  520. // deoptimization and serious performance degradation
  521. // https://github.com/zloirock/core-js/issues/679
  522. var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
  523. var array = [];
  524. array[IS_CONCAT_SPREADABLE] = false;
  525. return array.concat()[0] !== array;
  526. });
  527. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  528. var isConcatSpreadable = function (O) {
  529. if (!isObject(O)) return false;
  530. var spreadable = O[IS_CONCAT_SPREADABLE];
  531. return spreadable !== undefined ? !!spreadable : isArray(O);
  532. };
  533. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  534. // `Array.prototype.concat` method
  535. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  536. // with adding support of @@isConcatSpreadable and @@species
  537. _export({ target: 'Array', proto: true, forced: FORCED }, {
  538. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  539. var O = toObject(this);
  540. var A = arraySpeciesCreate(O, 0);
  541. var n = 0;
  542. var i, k, length, len, E;
  543. for (i = -1, length = arguments.length; i < length; i++) {
  544. E = i === -1 ? O : arguments[i];
  545. if (isConcatSpreadable(E)) {
  546. len = toLength(E.length);
  547. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  548. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  549. } else {
  550. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  551. createProperty(A, n++, E);
  552. }
  553. }
  554. A.length = n;
  555. return A;
  556. }
  557. });
  558. var aFunction$1 = function (it) {
  559. if (typeof it != 'function') {
  560. throw TypeError(String(it) + ' is not a function');
  561. } return it;
  562. };
  563. // optional / simple context binding
  564. var bindContext = function (fn, that, length) {
  565. aFunction$1(fn);
  566. if (that === undefined) return fn;
  567. switch (length) {
  568. case 0: return function () {
  569. return fn.call(that);
  570. };
  571. case 1: return function (a) {
  572. return fn.call(that, a);
  573. };
  574. case 2: return function (a, b) {
  575. return fn.call(that, a, b);
  576. };
  577. case 3: return function (a, b, c) {
  578. return fn.call(that, a, b, c);
  579. };
  580. }
  581. return function (/* ...args */) {
  582. return fn.apply(that, arguments);
  583. };
  584. };
  585. var push = [].push;
  586. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  587. var createMethod$1 = function (TYPE) {
  588. var IS_MAP = TYPE == 1;
  589. var IS_FILTER = TYPE == 2;
  590. var IS_SOME = TYPE == 3;
  591. var IS_EVERY = TYPE == 4;
  592. var IS_FIND_INDEX = TYPE == 6;
  593. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  594. return function ($this, callbackfn, that, specificCreate) {
  595. var O = toObject($this);
  596. var self = indexedObject(O);
  597. var boundFunction = bindContext(callbackfn, that, 3);
  598. var length = toLength(self.length);
  599. var index = 0;
  600. var create = specificCreate || arraySpeciesCreate;
  601. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  602. var value, result;
  603. for (;length > index; index++) if (NO_HOLES || index in self) {
  604. value = self[index];
  605. result = boundFunction(value, index, O);
  606. if (TYPE) {
  607. if (IS_MAP) target[index] = result; // map
  608. else if (result) switch (TYPE) {
  609. case 3: return true; // some
  610. case 5: return value; // find
  611. case 6: return index; // findIndex
  612. case 2: push.call(target, value); // filter
  613. } else if (IS_EVERY) return false; // every
  614. }
  615. }
  616. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  617. };
  618. };
  619. var arrayIteration = {
  620. // `Array.prototype.forEach` method
  621. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  622. forEach: createMethod$1(0),
  623. // `Array.prototype.map` method
  624. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  625. map: createMethod$1(1),
  626. // `Array.prototype.filter` method
  627. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  628. filter: createMethod$1(2),
  629. // `Array.prototype.some` method
  630. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  631. some: createMethod$1(3),
  632. // `Array.prototype.every` method
  633. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  634. every: createMethod$1(4),
  635. // `Array.prototype.find` method
  636. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  637. find: createMethod$1(5),
  638. // `Array.prototype.findIndex` method
  639. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  640. findIndex: createMethod$1(6)
  641. };
  642. // `Object.keys` method
  643. // https://tc39.github.io/ecma262/#sec-object.keys
  644. var objectKeys = Object.keys || function keys(O) {
  645. return objectKeysInternal(O, enumBugKeys);
  646. };
  647. // `Object.defineProperties` method
  648. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  649. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  650. anObject(O);
  651. var keys = objectKeys(Properties);
  652. var length = keys.length;
  653. var index = 0;
  654. var key;
  655. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  656. return O;
  657. };
  658. var html = getBuiltIn('document', 'documentElement');
  659. var GT = '>';
  660. var LT = '<';
  661. var PROTOTYPE = 'prototype';
  662. var SCRIPT = 'script';
  663. var IE_PROTO = sharedKey('IE_PROTO');
  664. var EmptyConstructor = function () { /* empty */ };
  665. var scriptTag = function (content) {
  666. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  667. };
  668. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  669. var NullProtoObjectViaActiveX = function (activeXDocument) {
  670. activeXDocument.write(scriptTag(''));
  671. activeXDocument.close();
  672. var temp = activeXDocument.parentWindow.Object;
  673. activeXDocument = null; // avoid memory leak
  674. return temp;
  675. };
  676. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  677. var NullProtoObjectViaIFrame = function () {
  678. // Thrash, waste and sodomy: IE GC bug
  679. var iframe = documentCreateElement('iframe');
  680. var JS = 'java' + SCRIPT + ':';
  681. var iframeDocument;
  682. iframe.style.display = 'none';
  683. html.appendChild(iframe);
  684. // https://github.com/zloirock/core-js/issues/475
  685. iframe.src = String(JS);
  686. iframeDocument = iframe.contentWindow.document;
  687. iframeDocument.open();
  688. iframeDocument.write(scriptTag('document.F=Object'));
  689. iframeDocument.close();
  690. return iframeDocument.F;
  691. };
  692. // Check for document.domain and active x support
  693. // No need to use active x approach when document.domain is not set
  694. // see https://github.com/es-shims/es5-shim/issues/150
  695. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  696. // avoid IE GC bug
  697. var activeXDocument;
  698. var NullProtoObject = function () {
  699. try {
  700. /* global ActiveXObject */
  701. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  702. } catch (error) { /* ignore */ }
  703. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  704. var length = enumBugKeys.length;
  705. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  706. return NullProtoObject();
  707. };
  708. hiddenKeys[IE_PROTO] = true;
  709. // `Object.create` method
  710. // https://tc39.github.io/ecma262/#sec-object.create
  711. var objectCreate = Object.create || function create(O, Properties) {
  712. var result;
  713. if (O !== null) {
  714. EmptyConstructor[PROTOTYPE] = anObject(O);
  715. result = new EmptyConstructor();
  716. EmptyConstructor[PROTOTYPE] = null;
  717. // add "__proto__" for Object.getPrototypeOf polyfill
  718. result[IE_PROTO] = O;
  719. } else result = NullProtoObject();
  720. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  721. };
  722. var UNSCOPABLES = wellKnownSymbol('unscopables');
  723. var ArrayPrototype = Array.prototype;
  724. // Array.prototype[@@unscopables]
  725. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  726. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  727. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  728. configurable: true,
  729. value: objectCreate(null)
  730. });
  731. }
  732. // add a key to Array.prototype[@@unscopables]
  733. var addToUnscopables = function (key) {
  734. ArrayPrototype[UNSCOPABLES][key] = true;
  735. };
  736. var $find = arrayIteration.find;
  737. var FIND = 'find';
  738. var SKIPS_HOLES = true;
  739. // Shouldn't skip holes
  740. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  741. // `Array.prototype.find` method
  742. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  743. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  744. find: function find(callbackfn /* , that = undefined */) {
  745. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  746. }
  747. });
  748. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  749. addToUnscopables(FIND);
  750. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  751. var method = [][METHOD_NAME];
  752. return !method || !fails(function () {
  753. // eslint-disable-next-line no-useless-call,no-throw-literal
  754. method.call(null, argument || function () { throw 1; }, 1);
  755. });
  756. };
  757. var $indexOf = arrayIncludes.indexOf;
  758. var nativeIndexOf = [].indexOf;
  759. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  760. var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
  761. // `Array.prototype.indexOf` method
  762. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  763. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
  764. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  765. return NEGATIVE_ZERO
  766. // convert -0 to +0
  767. ? nativeIndexOf.apply(this, arguments) || 0
  768. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  769. }
  770. });
  771. var nativeJoin = [].join;
  772. var ES3_STRINGS = indexedObject != Object;
  773. var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
  774. // `Array.prototype.join` method
  775. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  776. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
  777. join: function join(separator) {
  778. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  779. }
  780. });
  781. var $map = arrayIteration.map;
  782. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  783. // FF49- issue
  784. var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
  785. [].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
  786. });
  787. // `Array.prototype.map` method
  788. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  789. // with adding support of @@species
  790. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  791. map: function map(callbackfn /* , thisArg */) {
  792. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  793. }
  794. });
  795. var SPECIES$2 = wellKnownSymbol('species');
  796. var nativeSlice = [].slice;
  797. var max$1 = Math.max;
  798. // `Array.prototype.slice` method
  799. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  800. // fallback for not array-like ES3 strings and DOM objects
  801. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  802. slice: function slice(start, end) {
  803. var O = toIndexedObject(this);
  804. var length = toLength(O.length);
  805. var k = toAbsoluteIndex(start, length);
  806. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  807. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  808. var Constructor, result, n;
  809. if (isArray(O)) {
  810. Constructor = O.constructor;
  811. // cross-realm fallback
  812. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  813. Constructor = undefined;
  814. } else if (isObject(Constructor)) {
  815. Constructor = Constructor[SPECIES$2];
  816. if (Constructor === null) Constructor = undefined;
  817. }
  818. if (Constructor === Array || Constructor === undefined) {
  819. return nativeSlice.call(O, k, fin);
  820. }
  821. }
  822. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  823. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  824. result.length = n;
  825. return result;
  826. }
  827. });
  828. var test = [];
  829. var nativeSort = test.sort;
  830. // IE8-
  831. var FAILS_ON_UNDEFINED = fails(function () {
  832. test.sort(undefined);
  833. });
  834. // V8 bug
  835. var FAILS_ON_NULL = fails(function () {
  836. test.sort(null);
  837. });
  838. // Old WebKit
  839. var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
  840. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
  841. // `Array.prototype.sort` method
  842. // https://tc39.github.io/ecma262/#sec-array.prototype.sort
  843. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  844. sort: function sort(comparefn) {
  845. return comparefn === undefined
  846. ? nativeSort.call(toObject(this))
  847. : nativeSort.call(toObject(this), aFunction$1(comparefn));
  848. }
  849. });
  850. var max$2 = Math.max;
  851. var min$2 = Math.min;
  852. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  853. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  854. // `Array.prototype.splice` method
  855. // https://tc39.github.io/ecma262/#sec-array.prototype.splice
  856. // with adding support of @@species
  857. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {
  858. splice: function splice(start, deleteCount /* , ...items */) {
  859. var O = toObject(this);
  860. var len = toLength(O.length);
  861. var actualStart = toAbsoluteIndex(start, len);
  862. var argumentsLength = arguments.length;
  863. var insertCount, actualDeleteCount, A, k, from, to;
  864. if (argumentsLength === 0) {
  865. insertCount = actualDeleteCount = 0;
  866. } else if (argumentsLength === 1) {
  867. insertCount = 0;
  868. actualDeleteCount = len - actualStart;
  869. } else {
  870. insertCount = argumentsLength - 2;
  871. actualDeleteCount = min$2(max$2(toInteger(deleteCount), 0), len - actualStart);
  872. }
  873. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) {
  874. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  875. }
  876. A = arraySpeciesCreate(O, actualDeleteCount);
  877. for (k = 0; k < actualDeleteCount; k++) {
  878. from = actualStart + k;
  879. if (from in O) createProperty(A, k, O[from]);
  880. }
  881. A.length = actualDeleteCount;
  882. if (insertCount < actualDeleteCount) {
  883. for (k = actualStart; k < len - actualDeleteCount; k++) {
  884. from = k + actualDeleteCount;
  885. to = k + insertCount;
  886. if (from in O) O[to] = O[from];
  887. else delete O[to];
  888. }
  889. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  890. } else if (insertCount > actualDeleteCount) {
  891. for (k = len - actualDeleteCount; k > actualStart; k--) {
  892. from = k + actualDeleteCount - 1;
  893. to = k + insertCount - 1;
  894. if (from in O) O[to] = O[from];
  895. else delete O[to];
  896. }
  897. }
  898. for (k = 0; k < insertCount; k++) {
  899. O[k + actualStart] = arguments[k + 2];
  900. }
  901. O.length = len - actualDeleteCount + insertCount;
  902. return A;
  903. }
  904. });
  905. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  906. var test$1 = {};
  907. test$1[TO_STRING_TAG] = 'z';
  908. var toStringTagSupport = String(test$1) === '[object z]';
  909. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  910. // ES3 wrong here
  911. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  912. // fallback for IE11 Script Access Denied error
  913. var tryGet = function (it, key) {
  914. try {
  915. return it[key];
  916. } catch (error) { /* empty */ }
  917. };
  918. // getting tag from ES6+ `Object.prototype.toString`
  919. var classof = toStringTagSupport ? classofRaw : function (it) {
  920. var O, tag, result;
  921. return it === undefined ? 'Undefined' : it === null ? 'Null'
  922. // @@toStringTag case
  923. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  924. // builtinTag case
  925. : CORRECT_ARGUMENTS ? classofRaw(O)
  926. // ES3 arguments fallback
  927. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  928. };
  929. // `Object.prototype.toString` method implementation
  930. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  931. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  932. return '[object ' + classof(this) + ']';
  933. };
  934. // `Object.prototype.toString` method
  935. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  936. if (!toStringTagSupport) {
  937. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  938. }
  939. // a string of all valid unicode whitespaces
  940. // eslint-disable-next-line max-len
  941. 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';
  942. var whitespace = '[' + whitespaces + ']';
  943. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  944. var rtrim = RegExp(whitespace + whitespace + '*$');
  945. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  946. var createMethod$2 = function (TYPE) {
  947. return function ($this) {
  948. var string = String(requireObjectCoercible($this));
  949. if (TYPE & 1) string = string.replace(ltrim, '');
  950. if (TYPE & 2) string = string.replace(rtrim, '');
  951. return string;
  952. };
  953. };
  954. var stringTrim = {
  955. // `String.prototype.{ trimLeft, trimStart }` methods
  956. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  957. start: createMethod$2(1),
  958. // `String.prototype.{ trimRight, trimEnd }` methods
  959. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  960. end: createMethod$2(2),
  961. // `String.prototype.trim` method
  962. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  963. trim: createMethod$2(3)
  964. };
  965. var trim = stringTrim.trim;
  966. var nativeParseFloat = global_1.parseFloat;
  967. var FORCED$2 = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity;
  968. // `parseFloat` method
  969. // https://tc39.github.io/ecma262/#sec-parsefloat-string
  970. var _parseFloat = FORCED$2 ? function parseFloat(string) {
  971. var trimmedString = trim(String(string));
  972. var result = nativeParseFloat(trimmedString);
  973. return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
  974. } : nativeParseFloat;
  975. // `parseFloat` method
  976. // https://tc39.github.io/ecma262/#sec-parsefloat-string
  977. _export({ global: true, forced: parseFloat != _parseFloat }, {
  978. parseFloat: _parseFloat
  979. });
  980. // `RegExp.prototype.flags` getter implementation
  981. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  982. var regexpFlags = function () {
  983. var that = anObject(this);
  984. var result = '';
  985. if (that.global) result += 'g';
  986. if (that.ignoreCase) result += 'i';
  987. if (that.multiline) result += 'm';
  988. if (that.dotAll) result += 's';
  989. if (that.unicode) result += 'u';
  990. if (that.sticky) result += 'y';
  991. return result;
  992. };
  993. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  994. // so we use an intermediate function.
  995. function RE(s, f) {
  996. return RegExp(s, f);
  997. }
  998. var UNSUPPORTED_Y = fails(function () {
  999. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1000. var re = RE('a', 'y');
  1001. re.lastIndex = 2;
  1002. return re.exec('abcd') != null;
  1003. });
  1004. var BROKEN_CARET = fails(function () {
  1005. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1006. var re = RE('^r', 'gy');
  1007. re.lastIndex = 2;
  1008. return re.exec('str') != null;
  1009. });
  1010. var regexpStickyHelpers = {
  1011. UNSUPPORTED_Y: UNSUPPORTED_Y,
  1012. BROKEN_CARET: BROKEN_CARET
  1013. };
  1014. var nativeExec = RegExp.prototype.exec;
  1015. // This always refers to the native implementation, because the
  1016. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  1017. // which loads this file before patching the method.
  1018. var nativeReplace = String.prototype.replace;
  1019. var patchedExec = nativeExec;
  1020. var UPDATES_LAST_INDEX_WRONG = (function () {
  1021. var re1 = /a/;
  1022. var re2 = /b*/g;
  1023. nativeExec.call(re1, 'a');
  1024. nativeExec.call(re2, 'a');
  1025. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1026. })();
  1027. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  1028. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1029. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1030. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
  1031. if (PATCH) {
  1032. patchedExec = function exec(str) {
  1033. var re = this;
  1034. var lastIndex, reCopy, match, i;
  1035. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1036. var flags = regexpFlags.call(re);
  1037. var source = re.source;
  1038. var charsAdded = 0;
  1039. var strCopy = str;
  1040. if (sticky) {
  1041. flags = flags.replace('y', '');
  1042. if (flags.indexOf('g') === -1) {
  1043. flags += 'g';
  1044. }
  1045. strCopy = String(str).slice(re.lastIndex);
  1046. // Support anchored sticky behavior.
  1047. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  1048. source = '(?: ' + source + ')';
  1049. strCopy = ' ' + strCopy;
  1050. charsAdded++;
  1051. }
  1052. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1053. // simulate the 'y' flag.
  1054. reCopy = new RegExp('^(?:' + source + ')', flags);
  1055. }
  1056. if (NPCG_INCLUDED) {
  1057. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1058. }
  1059. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1060. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  1061. if (sticky) {
  1062. if (match) {
  1063. match.input = match.input.slice(charsAdded);
  1064. match[0] = match[0].slice(charsAdded);
  1065. match.index = re.lastIndex;
  1066. re.lastIndex += match[0].length;
  1067. } else re.lastIndex = 0;
  1068. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1069. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1070. }
  1071. if (NPCG_INCLUDED && match && match.length > 1) {
  1072. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1073. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1074. nativeReplace.call(match[0], reCopy, function () {
  1075. for (i = 1; i < arguments.length - 2; i++) {
  1076. if (arguments[i] === undefined) match[i] = undefined;
  1077. }
  1078. });
  1079. }
  1080. return match;
  1081. };
  1082. }
  1083. var regexpExec = patchedExec;
  1084. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1085. exec: regexpExec
  1086. });
  1087. var TO_STRING = 'toString';
  1088. var RegExpPrototype = RegExp.prototype;
  1089. var nativeToString = RegExpPrototype[TO_STRING];
  1090. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1091. // FF44- RegExp#toString has a wrong name
  1092. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  1093. // `RegExp.prototype.toString` method
  1094. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  1095. if (NOT_GENERIC || INCORRECT_NAME) {
  1096. redefine(RegExp.prototype, TO_STRING, function toString() {
  1097. var R = anObject(this);
  1098. var p = String(R.source);
  1099. var rf = R.flags;
  1100. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
  1101. return '/' + p + '/' + f;
  1102. }, { unsafe: true });
  1103. }
  1104. var SPECIES$3 = wellKnownSymbol('species');
  1105. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1106. // #replace needs built-in support for named groups.
  1107. // #match works fine because it just return the exec results, even if it has
  1108. // a "grops" property.
  1109. var re = /./;
  1110. re.exec = function () {
  1111. var result = [];
  1112. result.groups = { a: '7' };
  1113. return result;
  1114. };
  1115. return ''.replace(re, '$<a>') !== '7';
  1116. });
  1117. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1118. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1119. var REPLACE_KEEPS_$0 = (function () {
  1120. return 'a'.replace(/./, '$0') === '$0';
  1121. })();
  1122. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1123. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1124. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1125. var re = /(?:)/;
  1126. var originalExec = re.exec;
  1127. re.exec = function () { return originalExec.apply(this, arguments); };
  1128. var result = 'ab'.split(re);
  1129. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1130. });
  1131. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1132. var SYMBOL = wellKnownSymbol(KEY);
  1133. var DELEGATES_TO_SYMBOL = !fails(function () {
  1134. // String methods call symbol-named RegEp methods
  1135. var O = {};
  1136. O[SYMBOL] = function () { return 7; };
  1137. return ''[KEY](O) != 7;
  1138. });
  1139. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1140. // Symbol-named RegExp methods call .exec
  1141. var execCalled = false;
  1142. var re = /a/;
  1143. if (KEY === 'split') {
  1144. // We can't use real regex here since it causes deoptimization
  1145. // and serious performance degradation in V8
  1146. // https://github.com/zloirock/core-js/issues/306
  1147. re = {};
  1148. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1149. // a new one. We need to return the patched regex when creating the new one.
  1150. re.constructor = {};
  1151. re.constructor[SPECIES$3] = function () { return re; };
  1152. re.flags = '';
  1153. re[SYMBOL] = /./[SYMBOL];
  1154. }
  1155. re.exec = function () { execCalled = true; return null; };
  1156. re[SYMBOL]('');
  1157. return !execCalled;
  1158. });
  1159. if (
  1160. !DELEGATES_TO_SYMBOL ||
  1161. !DELEGATES_TO_EXEC ||
  1162. (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
  1163. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1164. ) {
  1165. var nativeRegExpMethod = /./[SYMBOL];
  1166. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1167. if (regexp.exec === regexpExec) {
  1168. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1169. // The native String method already delegates to @@method (this
  1170. // polyfilled function), leasing to infinite recursion.
  1171. // We avoid it by directly calling the native @@method method.
  1172. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1173. }
  1174. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1175. }
  1176. return { done: false };
  1177. }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
  1178. var stringMethod = methods[0];
  1179. var regexMethod = methods[1];
  1180. redefine(String.prototype, KEY, stringMethod);
  1181. redefine(RegExp.prototype, SYMBOL, length == 2
  1182. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1183. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1184. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1185. // 21.2.5.6 RegExp.prototype[@@match](string)
  1186. // 21.2.5.9 RegExp.prototype[@@search](string)
  1187. : function (string) { return regexMethod.call(string, this); }
  1188. );
  1189. }
  1190. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  1191. };
  1192. var MATCH = wellKnownSymbol('match');
  1193. // `IsRegExp` abstract operation
  1194. // https://tc39.github.io/ecma262/#sec-isregexp
  1195. var isRegexp = function (it) {
  1196. var isRegExp;
  1197. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1198. };
  1199. var SPECIES$4 = wellKnownSymbol('species');
  1200. // `SpeciesConstructor` abstract operation
  1201. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  1202. var speciesConstructor = function (O, defaultConstructor) {
  1203. var C = anObject(O).constructor;
  1204. var S;
  1205. return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
  1206. };
  1207. // `String.prototype.{ codePointAt, at }` methods implementation
  1208. var createMethod$3 = function (CONVERT_TO_STRING) {
  1209. return function ($this, pos) {
  1210. var S = String(requireObjectCoercible($this));
  1211. var position = toInteger(pos);
  1212. var size = S.length;
  1213. var first, second;
  1214. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1215. first = S.charCodeAt(position);
  1216. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1217. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1218. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1219. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1220. };
  1221. };
  1222. var stringMultibyte = {
  1223. // `String.prototype.codePointAt` method
  1224. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1225. codeAt: createMethod$3(false),
  1226. // `String.prototype.at` method
  1227. // https://github.com/mathiasbynens/String.prototype.at
  1228. charAt: createMethod$3(true)
  1229. };
  1230. var charAt = stringMultibyte.charAt;
  1231. // `AdvanceStringIndex` abstract operation
  1232. // https://tc39.github.io/ecma262/#sec-advancestringindex
  1233. var advanceStringIndex = function (S, index, unicode) {
  1234. return index + (unicode ? charAt(S, index).length : 1);
  1235. };
  1236. // `RegExpExec` abstract operation
  1237. // https://tc39.github.io/ecma262/#sec-regexpexec
  1238. var regexpExecAbstract = function (R, S) {
  1239. var exec = R.exec;
  1240. if (typeof exec === 'function') {
  1241. var result = exec.call(R, S);
  1242. if (typeof result !== 'object') {
  1243. throw TypeError('RegExp exec method returned something other than an Object or null');
  1244. }
  1245. return result;
  1246. }
  1247. if (classofRaw(R) !== 'RegExp') {
  1248. throw TypeError('RegExp#exec called on incompatible receiver');
  1249. }
  1250. return regexpExec.call(R, S);
  1251. };
  1252. var arrayPush = [].push;
  1253. var min$3 = Math.min;
  1254. var MAX_UINT32 = 0xFFFFFFFF;
  1255. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  1256. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  1257. // @@split logic
  1258. fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  1259. var internalSplit;
  1260. if (
  1261. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1262. 'test'.split(/(?:)/, -1).length != 4 ||
  1263. 'ab'.split(/(?:ab)*/).length != 2 ||
  1264. '.'.split(/(.?)(.?)/).length != 4 ||
  1265. '.'.split(/()()/).length > 1 ||
  1266. ''.split(/.?/).length
  1267. ) {
  1268. // based on es5-shim implementation, need to rework it
  1269. internalSplit = function (separator, limit) {
  1270. var string = String(requireObjectCoercible(this));
  1271. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1272. if (lim === 0) return [];
  1273. if (separator === undefined) return [string];
  1274. // If `separator` is not a regex, use native split
  1275. if (!isRegexp(separator)) {
  1276. return nativeSplit.call(string, separator, lim);
  1277. }
  1278. var output = [];
  1279. var flags = (separator.ignoreCase ? 'i' : '') +
  1280. (separator.multiline ? 'm' : '') +
  1281. (separator.unicode ? 'u' : '') +
  1282. (separator.sticky ? 'y' : '');
  1283. var lastLastIndex = 0;
  1284. // Make `global` and avoid `lastIndex` issues by working with a copy
  1285. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1286. var match, lastIndex, lastLength;
  1287. while (match = regexpExec.call(separatorCopy, string)) {
  1288. lastIndex = separatorCopy.lastIndex;
  1289. if (lastIndex > lastLastIndex) {
  1290. output.push(string.slice(lastLastIndex, match.index));
  1291. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  1292. lastLength = match[0].length;
  1293. lastLastIndex = lastIndex;
  1294. if (output.length >= lim) break;
  1295. }
  1296. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1297. }
  1298. if (lastLastIndex === string.length) {
  1299. if (lastLength || !separatorCopy.test('')) output.push('');
  1300. } else output.push(string.slice(lastLastIndex));
  1301. return output.length > lim ? output.slice(0, lim) : output;
  1302. };
  1303. // Chakra, V8
  1304. } else if ('0'.split(undefined, 0).length) {
  1305. internalSplit = function (separator, limit) {
  1306. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  1307. };
  1308. } else internalSplit = nativeSplit;
  1309. return [
  1310. // `String.prototype.split` method
  1311. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  1312. function split(separator, limit) {
  1313. var O = requireObjectCoercible(this);
  1314. var splitter = separator == undefined ? undefined : separator[SPLIT];
  1315. return splitter !== undefined
  1316. ? splitter.call(separator, O, limit)
  1317. : internalSplit.call(String(O), separator, limit);
  1318. },
  1319. // `RegExp.prototype[@@split]` method
  1320. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  1321. //
  1322. // NOTE: This cannot be properly polyfilled in engines that don't support
  1323. // the 'y' flag.
  1324. function (regexp, limit) {
  1325. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  1326. if (res.done) return res.value;
  1327. var rx = anObject(regexp);
  1328. var S = String(this);
  1329. var C = speciesConstructor(rx, RegExp);
  1330. var unicodeMatching = rx.unicode;
  1331. var flags = (rx.ignoreCase ? 'i' : '') +
  1332. (rx.multiline ? 'm' : '') +
  1333. (rx.unicode ? 'u' : '') +
  1334. (SUPPORTS_Y ? 'y' : 'g');
  1335. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1336. // simulate the 'y' flag.
  1337. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  1338. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1339. if (lim === 0) return [];
  1340. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1341. var p = 0;
  1342. var q = 0;
  1343. var A = [];
  1344. while (q < S.length) {
  1345. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  1346. var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
  1347. var e;
  1348. if (
  1349. z === null ||
  1350. (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  1351. ) {
  1352. q = advanceStringIndex(S, q, unicodeMatching);
  1353. } else {
  1354. A.push(S.slice(p, q));
  1355. if (A.length === lim) return A;
  1356. for (var i = 1; i <= z.length - 1; i++) {
  1357. A.push(z[i]);
  1358. if (A.length === lim) return A;
  1359. }
  1360. q = p = e;
  1361. }
  1362. }
  1363. A.push(S.slice(p));
  1364. return A;
  1365. }
  1366. ];
  1367. }, !SUPPORTS_Y);
  1368. function _typeof(obj) {
  1369. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  1370. _typeof = function (obj) {
  1371. return typeof obj;
  1372. };
  1373. } else {
  1374. _typeof = function (obj) {
  1375. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  1376. };
  1377. }
  1378. return _typeof(obj);
  1379. }
  1380. /**
  1381. * @author Nadim Basalamah <dimbslmh@gmail.com>
  1382. * @version: v1.1.0
  1383. * https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
  1384. * Modification: ErwannNevou <https://github.com/ErwannNevou>
  1385. */
  1386. var isSingleSort = false;
  1387. var Utils = $.fn.bootstrapTable.utils;
  1388. var bootstrap = {
  1389. bootstrap3: {
  1390. icons: {
  1391. plus: 'glyphicon-plus',
  1392. minus: 'glyphicon-minus',
  1393. sort: 'glyphicon-sort'
  1394. },
  1395. html: {
  1396. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n <h4 class=\"modal-title\" id=\"%sLabel\">%s</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\">\n <button id=\"add\" type=\"button\" class=\"btn btn-default\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-default\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1397. multipleSortButton: '<button class="multi-sort btn btn-default" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1398. multipleSortSelect: '<select class="%s %s form-control">'
  1399. }
  1400. },
  1401. bootstrap4: {
  1402. icons: {
  1403. 'plus': 'fa-plus',
  1404. 'minus': 'fa-minus',
  1405. 'sort': 'fa-sort'
  1406. },
  1407. html: {
  1408. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1409. multipleSortButton: '<button class="multi-sort btn btn-secondary" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1410. multipleSortSelect: '<select class="%s %s form-control">'
  1411. }
  1412. },
  1413. semantic: {
  1414. icons: {
  1415. 'plus': 'fa-plus',
  1416. 'minus': 'fa-minus',
  1417. 'sort': 'fa-sort'
  1418. },
  1419. html: {
  1420. multipleSortModal: "\n <div class=\"ui modal tiny\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <i class=\"close icon\"></i>\n <div class=\"header\" id=\"%sLabel\">\n %s\n </div>\n <div class=\"image content\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"ui button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"ui button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <div class=\"ui button deny\">%s</div>\n <div class=\"ui button approve multi-sort-order-button\">%s</div>\n </div>\n </div>\n ",
  1421. multipleSortButton: '<button class="multi-sort ui button" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1422. multipleSortSelect: '<select class="%s %s">'
  1423. }
  1424. },
  1425. materialize: {
  1426. icons: {
  1427. 'plus': 'plus',
  1428. 'minus': 'minus',
  1429. 'sort': 'sort'
  1430. },
  1431. html: {
  1432. multipleSortModal: "\n <div id=\"%s\" class=\"modal\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-content\" id=\"%sLabel\">\n <h4>%s</h4>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn\">%s</a>\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn multi-sort-order-button\">%s</a>\n </div>\n </div>\n </div>\n ",
  1433. multipleSortButton: '<a href="#%s" class="multi-sort waves-effect waves-light btn modal-trigger" type="button" data-toggle="modal" title="%s">%s</a>',
  1434. multipleSortSelect: '<select class="%s %s browser-default">'
  1435. }
  1436. },
  1437. foundation: {
  1438. icons: {
  1439. 'plus': 'fa-plus',
  1440. 'minus': 'fa-minus',
  1441. 'sort': 'fa-sort'
  1442. },
  1443. html: {
  1444. multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
  1445. multipleSortButton: '<button class="button multi-sort" data-open="%s" title="%s">%s</button>',
  1446. multipleSortSelect: '<select class="%s %s browser-default">'
  1447. }
  1448. },
  1449. bulma: {
  1450. icons: {
  1451. 'plus': 'fa-plus',
  1452. 'minus': 'fa-minus',
  1453. 'sort': 'fa-sort'
  1454. },
  1455. html: {
  1456. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <button type=\"button\" class=\"waves-effect waves-light button\" data-close>%s</button>\n <button type=\"button\" class=\"waves-effect waves-light button multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n ",
  1457. multipleSortButton: '<button class="button multi-sort" data-target="%s" title="%s">%s</button>',
  1458. multipleSortSelect: '<select class="%s %s browser-default">'
  1459. }
  1460. }
  1461. }[$.fn.bootstrapTable.theme];
  1462. $.extend($.fn.bootstrapTable.defaults.icons, bootstrap.icons);
  1463. $.extend($.fn.bootstrapTable.defaults.html, bootstrap.html);
  1464. var showSortModal = function showSortModal(that) {
  1465. var _selector = that.sortModalSelector;
  1466. var _id = "#".concat(_selector);
  1467. var o = that.options;
  1468. if (!$(_id).hasClass('modal')) {
  1469. var sModal = Utils.sprintf(that.constants.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, that.constants.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, that.constants.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
  1470. $('body').append($(sModal));
  1471. that.$sortModal = $(_id);
  1472. var $rows = that.$sortModal.find('tbody > tr');
  1473. that.$sortModal.off('click', '#add').on('click', '#add', function () {
  1474. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1475. var current = that.$sortModal.find('tbody tr').length;
  1476. if (current < total) {
  1477. current++;
  1478. that.addLevel();
  1479. that.setButtonStates();
  1480. }
  1481. });
  1482. that.$sortModal.off('click', '#delete').on('click', '#delete', function () {
  1483. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1484. var current = that.$sortModal.find('tbody tr').length;
  1485. if (current > 1 && current <= total) {
  1486. current--;
  1487. that.$sortModal.find('tbody tr:last').remove();
  1488. that.setButtonStates();
  1489. }
  1490. });
  1491. that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
  1492. var $rows = that.$sortModal.find('tbody > tr');
  1493. var $alert = that.$sortModal.find('div.alert');
  1494. var fields = [];
  1495. var results = [];
  1496. var sortPriority = $.map($rows, function (row) {
  1497. var $row = $(row);
  1498. var name = $row.find('.multi-sort-name').val();
  1499. var order = $row.find('.multi-sort-order').val();
  1500. fields.push(name);
  1501. return {
  1502. sortName: name,
  1503. sortOrder: order
  1504. };
  1505. });
  1506. var sorted_fields = fields.sort();
  1507. for (var i = 0; i < fields.length - 1; i++) {
  1508. if (sorted_fields[i + 1] === sorted_fields[i]) {
  1509. results.push(sorted_fields[i]);
  1510. }
  1511. }
  1512. if (results.length > 0) {
  1513. if ($alert.length === 0) {
  1514. $alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
  1515. $($alert).insertBefore(that.$sortModal.find('.bars'));
  1516. }
  1517. } else {
  1518. if ($alert.length === 1) {
  1519. $($alert).remove();
  1520. }
  1521. if ($.inArray($.fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1522. that.$sortModal.modal('hide');
  1523. }
  1524. that.multiSort(sortPriority);
  1525. }
  1526. });
  1527. if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
  1528. if (that.options.sortName) {
  1529. that.options.sortPriority = [{
  1530. sortName: that.options.sortName,
  1531. sortOrder: that.options.sortOrder
  1532. }];
  1533. }
  1534. }
  1535. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1536. if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
  1537. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1538. that.addLevel(i, that.options.sortPriority[i]);
  1539. }
  1540. }
  1541. } else {
  1542. that.addLevel(0);
  1543. }
  1544. that.setButtonStates();
  1545. }
  1546. };
  1547. $.fn.bootstrapTable.methods.push('multipleSort');
  1548. $.fn.bootstrapTable.methods.push('multiSort');
  1549. $.extend($.fn.bootstrapTable.defaults, {
  1550. showMultiSort: false,
  1551. showMultiSortButton: true,
  1552. multiSortStrictSort: false,
  1553. sortPriority: null,
  1554. onMultipleSort: function onMultipleSort() {
  1555. return false;
  1556. }
  1557. });
  1558. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  1559. 'multiple-sort.bs.table': 'onMultipleSort'
  1560. });
  1561. $.extend($.fn.bootstrapTable.locales, {
  1562. formatMultipleSort: function formatMultipleSort() {
  1563. return 'Multiple Sort';
  1564. },
  1565. formatAddLevel: function formatAddLevel() {
  1566. return 'Add Level';
  1567. },
  1568. formatDeleteLevel: function formatDeleteLevel() {
  1569. return 'Delete Level';
  1570. },
  1571. formatColumn: function formatColumn() {
  1572. return 'Column';
  1573. },
  1574. formatOrder: function formatOrder() {
  1575. return 'Order';
  1576. },
  1577. formatSortBy: function formatSortBy() {
  1578. return 'Sort by';
  1579. },
  1580. formatThenBy: function formatThenBy() {
  1581. return 'Then by';
  1582. },
  1583. formatSort: function formatSort() {
  1584. return 'Sort';
  1585. },
  1586. formatCancel: function formatCancel() {
  1587. return 'Cancel';
  1588. },
  1589. formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
  1590. return 'Duplicate(s) detected!';
  1591. },
  1592. formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
  1593. return 'Please remove or change any duplicate column.';
  1594. },
  1595. formatSortOrders: function formatSortOrders() {
  1596. return {
  1597. asc: 'Ascending',
  1598. desc: 'Descending'
  1599. };
  1600. }
  1601. });
  1602. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  1603. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  1604. var _initToolbar = BootstrapTable.prototype.initToolbar;
  1605. var _destroy = BootstrapTable.prototype.destroy;
  1606. BootstrapTable.prototype.initToolbar = function () {
  1607. var _this = this;
  1608. this.showToolbar = this.showToolbar || this.options.showMultiSort;
  1609. var that = this;
  1610. var sortModalSelector = "sortModal_".concat(this.$el.attr('id'));
  1611. var sortModalId = "#".concat(sortModalSelector);
  1612. this.$sortModal = $(sortModalId);
  1613. this.sortModalSelector = sortModalSelector;
  1614. if (that.options.sortPriority !== null) {
  1615. that.onMultipleSort();
  1616. }
  1617. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1618. args[_key] = arguments[_key];
  1619. }
  1620. _initToolbar.apply(this, Array.prototype.slice.apply(args));
  1621. if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null) {
  1622. var t = that.options.queryParams;
  1623. that.options.queryParams = function (params) {
  1624. params.multiSort = that.options.sortPriority;
  1625. return t(params);
  1626. };
  1627. }
  1628. if (this.options.showMultiSort) {
  1629. var $btnGroup = this.$toolbar.find('>.' + that.constants.classes.buttonsGroup.split(' ').join('.')).first();
  1630. var $multiSortBtn = this.$toolbar.find('div.multi-sort');
  1631. var o = that.options;
  1632. if (!$multiSortBtn.length && this.options.showMultiSortButton) {
  1633. $multiSortBtn = Utils.sprintf(that.constants.html.multipleSortButton, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort));
  1634. $btnGroup.append($multiSortBtn);
  1635. if ($.fn.bootstrapTable.theme === 'semantic') {
  1636. this.$toolbar.find('.multi-sort').on('click', function () {
  1637. $(sortModalId).modal('show');
  1638. });
  1639. } else if ($.fn.bootstrapTable.theme === 'materialize') {
  1640. this.$toolbar.find('.multi-sort').on('click', function () {
  1641. $(sortModalId).modal();
  1642. });
  1643. } else if ($.fn.bootstrapTable.theme === 'foundation') {
  1644. this.$toolbar.find('.multi-sort').on('click', function () {
  1645. if (!_this.foundationModal) {
  1646. // eslint-disable-next-line no-undef
  1647. _this.foundationModal = new Foundation.Reveal($(sortModalId));
  1648. }
  1649. _this.foundationModal.open();
  1650. });
  1651. } else if ($.fn.bootstrapTable.theme === 'bulma') {
  1652. this.$toolbar.find('.multi-sort').on('click', function () {
  1653. $('html').toggleClass('is-clipped');
  1654. $(sortModalId).toggleClass('is-active');
  1655. $('button[data-close]').one('click', function () {
  1656. $('html').toggleClass('is-clipped');
  1657. $(sortModalId).toggleClass('is-active');
  1658. });
  1659. });
  1660. }
  1661. showSortModal(that);
  1662. }
  1663. this.$el.on('sort.bs.table', function () {
  1664. isSingleSort = true;
  1665. });
  1666. this.$el.on('multiple-sort.bs.table', function () {
  1667. isSingleSort = false;
  1668. });
  1669. this.$el.on('load-success.bs.table', function () {
  1670. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1671. that.onMultipleSort();
  1672. }
  1673. });
  1674. this.$el.on('column-switch.bs.table', function (field, checked) {
  1675. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1676. if (that.options.sortPriority[i].sortName === checked) {
  1677. that.options.sortPriority.splice(i, 1);
  1678. }
  1679. }
  1680. that.assignSortableArrows();
  1681. that.$sortModal.remove();
  1682. showSortModal(that);
  1683. });
  1684. this.$el.on('reset-view.bs.table', function () {
  1685. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object') {
  1686. that.assignSortableArrows();
  1687. }
  1688. });
  1689. }
  1690. };
  1691. BootstrapTable.prototype.destroy = function () {
  1692. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1693. args[_key2] = arguments[_key2];
  1694. }
  1695. _destroy.apply(this, Array.prototype.slice.apply(args));
  1696. if (this.options.showMultiSort) {
  1697. this.$sortModal.remove();
  1698. }
  1699. };
  1700. BootstrapTable.prototype.multipleSort = function () {
  1701. var that = this;
  1702. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1703. that.onMultipleSort();
  1704. }
  1705. };
  1706. BootstrapTable.prototype.onMultipleSort = function () {
  1707. var that = this;
  1708. var cmp = function cmp(x, y) {
  1709. return x > y ? 1 : x < y ? -1 : 0;
  1710. };
  1711. var arrayCmp = function arrayCmp(a, b) {
  1712. var arr1 = [];
  1713. var arr2 = [];
  1714. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1715. var fieldName = that.options.sortPriority[i].sortName;
  1716. var fieldIndex = that.header.fields.indexOf(fieldName);
  1717. var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
  1718. if (that.header.sortNames[fieldIndex]) {
  1719. fieldName = that.header.sortNames[fieldIndex];
  1720. }
  1721. var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
  1722. var aa = a[fieldName];
  1723. var bb = b[fieldName];
  1724. var value1 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb]);
  1725. var value2 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa]);
  1726. if (value1 !== undefined && value2 !== undefined) {
  1727. arr1.push(order * value1);
  1728. arr2.push(order * value2);
  1729. continue;
  1730. }
  1731. if (aa === undefined || aa === null) aa = '';
  1732. if (bb === undefined || bb === null) bb = '';
  1733. if ($.isNumeric(aa) && $.isNumeric(bb)) {
  1734. aa = parseFloat(aa);
  1735. bb = parseFloat(bb);
  1736. } else {
  1737. aa = aa.toString();
  1738. bb = bb.toString();
  1739. if (that.options.multiSortStrictSort) {
  1740. aa = aa.toLowerCase();
  1741. bb = bb.toLowerCase();
  1742. }
  1743. }
  1744. arr1.push(order * cmp(aa, bb));
  1745. arr2.push(order * cmp(bb, aa));
  1746. }
  1747. return cmp(arr1, arr2);
  1748. };
  1749. this.data.sort(function (a, b) {
  1750. return arrayCmp(a, b);
  1751. });
  1752. this.initBody();
  1753. this.assignSortableArrows();
  1754. this.trigger('multiple-sort');
  1755. };
  1756. BootstrapTable.prototype.addLevel = function (index, sortPriority) {
  1757. var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
  1758. this.$sortModal.find('tbody').append($('<tr>').append($('<td>').text(text)).append($('<td>').append($(Utils.sprintf(this.constants.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($('<td>').append($(Utils.sprintf(this.constants.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
  1759. var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
  1760. var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
  1761. $.each(this.columns, function (i, column) {
  1762. if (column.sortable === false || column.visible === false) {
  1763. return true;
  1764. }
  1765. $multiSortName.append("<option value=\"".concat(column.field, "\">").concat(column.title, "</option>"));
  1766. });
  1767. $.each(this.options.formatSortOrders(), function (value, order) {
  1768. $multiSortOrder.append("<option value=\"".concat(value, "\">").concat(order, "</option>"));
  1769. });
  1770. if (sortPriority !== undefined) {
  1771. $multiSortName.find("option[value=\"".concat(sortPriority.sortName, "\"]")).attr('selected', true);
  1772. $multiSortOrder.find("option[value=\"".concat(sortPriority.sortOrder, "\"]")).attr('selected', true);
  1773. }
  1774. };
  1775. BootstrapTable.prototype.assignSortableArrows = function () {
  1776. var that = this;
  1777. var headers = that.$header.find('th');
  1778. for (var i = 0; i < headers.length; i++) {
  1779. for (var c = 0; c < that.options.sortPriority.length; c++) {
  1780. if ($(headers[i]).data('field') === that.options.sortPriority[c].sortName) {
  1781. $(headers[i]).find('.sortable').removeClass('desc asc').addClass(that.options.sortPriority[c].sortOrder);
  1782. }
  1783. }
  1784. }
  1785. };
  1786. BootstrapTable.prototype.setButtonStates = function () {
  1787. var total = this.$sortModal.find('.multi-sort-name:first option').length;
  1788. var current = this.$sortModal.find('tbody tr').length;
  1789. if (current === total) {
  1790. this.$sortModal.find('#add').attr('disabled', 'disabled');
  1791. }
  1792. if (current > 1) {
  1793. this.$sortModal.find('#delete').removeAttr('disabled');
  1794. }
  1795. if (current < total) {
  1796. this.$sortModal.find('#add').removeAttr('disabled');
  1797. }
  1798. if (current === 1) {
  1799. this.$sortModal.find('#delete').attr('disabled', 'disabled');
  1800. }
  1801. };
  1802. BootstrapTable.prototype.multiSort = function (sortPriority) {
  1803. var _this2 = this;
  1804. this.options.sortPriority = sortPriority;
  1805. this.options.sortName = '';
  1806. if (this.options.sidePagination === 'server') {
  1807. this.options.queryParams = function (params) {
  1808. params.multiSort = _this2.options.sortPriority;
  1809. return $.fn.bootstrapTable.utils.calculateObjectValue(_this2.options, _this2.options.queryParams, [params]);
  1810. };
  1811. isSingleSort = false;
  1812. this.initServer(this.options.silentSort);
  1813. return;
  1814. }
  1815. this.onMultipleSort();
  1816. };
  1817. })));