bootstrap-table-natural-sorting.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  3. typeof define === 'function' && define.amd ? define(factory) :
  4. (global = global || self, global.BootstrapTable = factory());
  5. }(this, function () { 'use strict';
  6. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  7. var global = typeof window == 'object' && window && window.Math == Math ? window
  8. : typeof self == 'object' && self && self.Math == Math ? self
  9. // eslint-disable-next-line no-new-func
  10. : Function('return this')();
  11. var fails = function (exec) {
  12. try {
  13. return !!exec();
  14. } catch (e) {
  15. return true;
  16. }
  17. };
  18. var replacement = /#|\.prototype\./;
  19. var isForced = function (feature, detection) {
  20. var value = data[normalize(feature)];
  21. return value == POLYFILL ? true
  22. : value == NATIVE ? false
  23. : typeof detection == 'function' ? fails(detection)
  24. : !!detection;
  25. };
  26. var normalize = isForced.normalize = function (string) {
  27. return String(string).replace(replacement, '.').toLowerCase();
  28. };
  29. var data = isForced.data = {};
  30. var NATIVE = isForced.NATIVE = 'N';
  31. var POLYFILL = isForced.POLYFILL = 'P';
  32. var isForced_1 = isForced;
  33. var hasOwnProperty = {}.hasOwnProperty;
  34. var has = function (it, key) {
  35. return hasOwnProperty.call(it, key);
  36. };
  37. var toString = {}.toString;
  38. var classofRaw = function (it) {
  39. return toString.call(it).slice(8, -1);
  40. };
  41. var isObject = function (it) {
  42. return typeof it === 'object' ? it !== null : typeof it === 'function';
  43. };
  44. var anObject = function (it) {
  45. if (!isObject(it)) {
  46. throw TypeError(String(it) + ' is not an object');
  47. } return it;
  48. };
  49. var validateSetPrototypeOfArguments = function (O, proto) {
  50. anObject(O);
  51. if (!isObject(proto) && proto !== null) {
  52. throw TypeError("Can't set " + String(proto) + ' as a prototype');
  53. }
  54. };
  55. // Works with __proto__ only. Old v8 can't work with null proto objects.
  56. /* eslint-disable no-proto */
  57. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { // eslint-disable-line
  58. var correctSetter = false;
  59. var test = {};
  60. var setter;
  61. try {
  62. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  63. setter.call(test, []);
  64. correctSetter = test instanceof Array;
  65. } catch (e) { /* empty */ }
  66. return function setPrototypeOf(O, proto) {
  67. validateSetPrototypeOfArguments(O, proto);
  68. if (correctSetter) setter.call(O, proto);
  69. else O.__proto__ = proto;
  70. return O;
  71. };
  72. }() : undefined);
  73. var inheritIfRequired = function (that, target, C) {
  74. var S = target.constructor;
  75. var P;
  76. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && objectSetPrototypeOf) {
  77. objectSetPrototypeOf(that, P);
  78. } return that;
  79. };
  80. // 7.1.1 ToPrimitive(input [, PreferredType])
  81. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  82. // and the second argument - flag - preferred type is a string
  83. var toPrimitive = function (it, S) {
  84. if (!isObject(it)) return it;
  85. var fn, val;
  86. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  87. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  88. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  89. throw TypeError("Can't convert object to primitive value");
  90. };
  91. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  92. var split = ''.split;
  93. var indexedObject = fails(function () {
  94. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  95. // eslint-disable-next-line no-prototype-builtins
  96. return !Object('z').propertyIsEnumerable(0);
  97. }) ? function (it) {
  98. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  99. } : Object;
  100. // `RequireObjectCoercible` abstract operation
  101. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  102. var requireObjectCoercible = function (it) {
  103. if (it == undefined) throw TypeError("Can't call method on " + it);
  104. return it;
  105. };
  106. // toObject with fallback for non-array-like ES3 strings
  107. var toIndexedObject = function (it) {
  108. return indexedObject(requireObjectCoercible(it));
  109. };
  110. var ceil = Math.ceil;
  111. var floor = Math.floor;
  112. // `ToInteger` abstract operation
  113. // https://tc39.github.io/ecma262/#sec-tointeger
  114. var toInteger = function (argument) {
  115. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  116. };
  117. var min = Math.min;
  118. // `ToLength` abstract operation
  119. // https://tc39.github.io/ecma262/#sec-tolength
  120. var toLength = function (argument) {
  121. return argument > 0 ? min(toInteger(argument), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  122. };
  123. var max = Math.max;
  124. var min$1 = Math.min;
  125. // Helper for a popular repeating case of the spec:
  126. // Let integer be ? ToInteger(index).
  127. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  128. var toAbsoluteIndex = function (index, length) {
  129. var integer = toInteger(index);
  130. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  131. };
  132. // `Array.prototype.{ indexOf, includes }` methods implementation
  133. // false -> Array#indexOf
  134. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  135. // true -> Array#includes
  136. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  137. var arrayIncludes = function (IS_INCLUDES) {
  138. return function ($this, el, fromIndex) {
  139. var O = toIndexedObject($this);
  140. var length = toLength(O.length);
  141. var index = toAbsoluteIndex(fromIndex, length);
  142. var value;
  143. // Array#includes uses SameValueZero equality algorithm
  144. // eslint-disable-next-line no-self-compare
  145. if (IS_INCLUDES && el != el) while (length > index) {
  146. value = O[index++];
  147. // eslint-disable-next-line no-self-compare
  148. if (value != value) return true;
  149. // Array#indexOf ignores holes, Array#includes - not
  150. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  151. if (O[index] === el) return IS_INCLUDES || index || 0;
  152. } return !IS_INCLUDES && -1;
  153. };
  154. };
  155. var hiddenKeys = {};
  156. var arrayIndexOf = arrayIncludes(false);
  157. var objectKeysInternal = function (object, names) {
  158. var O = toIndexedObject(object);
  159. var i = 0;
  160. var result = [];
  161. var key;
  162. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  163. // Don't enum bug & hidden keys
  164. while (names.length > i) if (has(O, key = names[i++])) {
  165. ~arrayIndexOf(result, key) || result.push(key);
  166. }
  167. return result;
  168. };
  169. // IE8- don't enum bug keys
  170. var enumBugKeys = [
  171. 'constructor',
  172. 'hasOwnProperty',
  173. 'isPrototypeOf',
  174. 'propertyIsEnumerable',
  175. 'toLocaleString',
  176. 'toString',
  177. 'valueOf'
  178. ];
  179. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  180. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  181. var f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  182. return objectKeysInternal(O, hiddenKeys$1);
  183. };
  184. var objectGetOwnPropertyNames = {
  185. f: f
  186. };
  187. // Thank's IE8 for his funny defineProperty
  188. var descriptors = !fails(function () {
  189. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  190. });
  191. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  192. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  193. // Nashorn ~ JDK8 bug
  194. var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  195. var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  196. var descriptor = nativeGetOwnPropertyDescriptor(this, V);
  197. return !!descriptor && descriptor.enumerable;
  198. } : nativePropertyIsEnumerable;
  199. var objectPropertyIsEnumerable = {
  200. f: f$1
  201. };
  202. var createPropertyDescriptor = function (bitmap, value) {
  203. return {
  204. enumerable: !(bitmap & 1),
  205. configurable: !(bitmap & 2),
  206. writable: !(bitmap & 4),
  207. value: value
  208. };
  209. };
  210. var document = global.document;
  211. // typeof document.createElement is 'object' in old IE
  212. var exist = isObject(document) && isObject(document.createElement);
  213. var documentCreateElement = function (it) {
  214. return exist ? document.createElement(it) : {};
  215. };
  216. // Thank's IE8 for his funny defineProperty
  217. var ie8DomDefine = !descriptors && !fails(function () {
  218. return Object.defineProperty(documentCreateElement('div'), 'a', {
  219. get: function () { return 7; }
  220. }).a != 7;
  221. });
  222. var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  223. var f$2 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  224. O = toIndexedObject(O);
  225. P = toPrimitive(P, true);
  226. if (ie8DomDefine) try {
  227. return nativeGetOwnPropertyDescriptor$1(O, P);
  228. } catch (e) { /* empty */ }
  229. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  230. };
  231. var objectGetOwnPropertyDescriptor = {
  232. f: f$2
  233. };
  234. var nativeDefineProperty = Object.defineProperty;
  235. var f$3 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  236. anObject(O);
  237. P = toPrimitive(P, true);
  238. anObject(Attributes);
  239. if (ie8DomDefine) try {
  240. return nativeDefineProperty(O, P, Attributes);
  241. } catch (e) { /* empty */ }
  242. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  243. if ('value' in Attributes) O[P] = Attributes.value;
  244. return O;
  245. };
  246. var objectDefineProperty = {
  247. f: f$3
  248. };
  249. // a string of all valid unicode whitespaces
  250. // eslint-disable-next-line max-len
  251. var whitespaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  252. var whitespace = '[' + whitespaces + ']';
  253. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  254. var rtrim = RegExp(whitespace + whitespace + '*$');
  255. // 1 -> String#trimStart
  256. // 2 -> String#trimEnd
  257. // 3 -> String#trim
  258. var stringTrim = function (string, TYPE) {
  259. string = String(requireObjectCoercible(string));
  260. if (TYPE & 1) string = string.replace(ltrim, '');
  261. if (TYPE & 2) string = string.replace(rtrim, '');
  262. return string;
  263. };
  264. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  265. var objectKeys = Object.keys || function keys(O) {
  266. return objectKeysInternal(O, enumBugKeys);
  267. };
  268. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  269. anObject(O);
  270. var keys = objectKeys(Properties);
  271. var length = keys.length;
  272. var i = 0;
  273. var key;
  274. while (length > i) objectDefineProperty.f(O, key = keys[i++], Properties[key]);
  275. return O;
  276. };
  277. var document$1 = global.document;
  278. var html = document$1 && document$1.documentElement;
  279. function createCommonjsModule(fn, module) {
  280. return module = { exports: {} }, fn(module, module.exports), module.exports;
  281. }
  282. var hide = descriptors ? function (object, key, value) {
  283. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  284. } : function (object, key, value) {
  285. object[key] = value;
  286. return object;
  287. };
  288. var setGlobal = function (key, value) {
  289. try {
  290. hide(global, key, value);
  291. } catch (e) {
  292. global[key] = value;
  293. } return value;
  294. };
  295. var shared = createCommonjsModule(function (module) {
  296. var SHARED = '__core-js_shared__';
  297. var store = global[SHARED] || setGlobal(SHARED, {});
  298. (module.exports = function (key, value) {
  299. return store[key] || (store[key] = value !== undefined ? value : {});
  300. })('versions', []).push({
  301. version: '3.0.0',
  302. mode: 'global',
  303. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  304. });
  305. });
  306. var id = 0;
  307. var postfix = Math.random();
  308. var uid = function (key) {
  309. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
  310. };
  311. var shared$1 = shared('keys');
  312. var sharedKey = function (key) {
  313. return shared$1[key] || (shared$1[key] = uid(key));
  314. };
  315. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  316. var IE_PROTO = sharedKey('IE_PROTO');
  317. var PROTOTYPE = 'prototype';
  318. var Empty = function () { /* empty */ };
  319. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  320. var createDict = function () {
  321. // Thrash, waste and sodomy: IE GC bug
  322. var iframe = documentCreateElement('iframe');
  323. var length = enumBugKeys.length;
  324. var lt = '<';
  325. var script = 'script';
  326. var gt = '>';
  327. var js = 'java' + script + ':';
  328. var iframeDocument;
  329. iframe.style.display = 'none';
  330. html.appendChild(iframe);
  331. iframe.src = String(js);
  332. iframeDocument = iframe.contentWindow.document;
  333. iframeDocument.open();
  334. iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
  335. iframeDocument.close();
  336. createDict = iframeDocument.F;
  337. while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
  338. return createDict();
  339. };
  340. var objectCreate = Object.create || function create(O, Properties) {
  341. var result;
  342. if (O !== null) {
  343. Empty[PROTOTYPE] = anObject(O);
  344. result = new Empty();
  345. Empty[PROTOTYPE] = null;
  346. // add "__proto__" for Object.getPrototypeOf polyfill
  347. result[IE_PROTO] = O;
  348. } else result = createDict();
  349. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  350. };
  351. hiddenKeys[IE_PROTO] = true;
  352. var functionToString = shared('native-function-to-string', Function.toString);
  353. var WeakMap = global.WeakMap;
  354. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  355. var WeakMap$1 = global.WeakMap;
  356. var set, get, has$1;
  357. var enforce = function (it) {
  358. return has$1(it) ? get(it) : set(it, {});
  359. };
  360. var getterFor = function (TYPE) {
  361. return function (it) {
  362. var state;
  363. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  364. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  365. } return state;
  366. };
  367. };
  368. if (nativeWeakMap) {
  369. var store = new WeakMap$1();
  370. var wmget = store.get;
  371. var wmhas = store.has;
  372. var wmset = store.set;
  373. set = function (it, metadata) {
  374. wmset.call(store, it, metadata);
  375. return metadata;
  376. };
  377. get = function (it) {
  378. return wmget.call(store, it) || {};
  379. };
  380. has$1 = function (it) {
  381. return wmhas.call(store, it);
  382. };
  383. } else {
  384. var STATE = sharedKey('state');
  385. hiddenKeys[STATE] = true;
  386. set = function (it, metadata) {
  387. hide(it, STATE, metadata);
  388. return metadata;
  389. };
  390. get = function (it) {
  391. return has(it, STATE) ? it[STATE] : {};
  392. };
  393. has$1 = function (it) {
  394. return has(it, STATE);
  395. };
  396. }
  397. var internalState = {
  398. set: set,
  399. get: get,
  400. has: has$1,
  401. enforce: enforce,
  402. getterFor: getterFor
  403. };
  404. var redefine = createCommonjsModule(function (module) {
  405. var getInternalState = internalState.get;
  406. var enforceInternalState = internalState.enforce;
  407. var TEMPLATE = String(functionToString).split('toString');
  408. shared('inspectSource', function (it) {
  409. return functionToString.call(it);
  410. });
  411. (module.exports = function (O, key, value, options) {
  412. var unsafe = options ? !!options.unsafe : false;
  413. var simple = options ? !!options.enumerable : false;
  414. var noTargetGet = options ? !!options.noTargetGet : false;
  415. if (typeof value == 'function') {
  416. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  417. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  418. }
  419. if (O === global) {
  420. if (simple) O[key] = value;
  421. else setGlobal(key, value);
  422. return;
  423. } else if (!unsafe) {
  424. delete O[key];
  425. } else if (!noTargetGet && O[key]) {
  426. simple = true;
  427. }
  428. if (simple) O[key] = value;
  429. else hide(O, key, value);
  430. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  431. })(Function.prototype, 'toString', function toString() {
  432. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  433. });
  434. });
  435. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  436. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  437. var defineProperty = objectDefineProperty.f;
  438. var NUMBER = 'Number';
  439. var NativeNumber = global[NUMBER];
  440. var NumberPrototype = NativeNumber.prototype;
  441. // Opera ~12 has broken Object#toString
  442. var BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER;
  443. var NATIVE_TRIM = 'trim' in String.prototype;
  444. // `ToNumber` abstract operation
  445. // https://tc39.github.io/ecma262/#sec-tonumber
  446. var toNumber = function (argument) {
  447. var it = toPrimitive(argument, false);
  448. var first, third, radix, maxCode, digits, length, i, code;
  449. if (typeof it == 'string' && it.length > 2) {
  450. it = NATIVE_TRIM ? it.trim() : stringTrim(it, 3);
  451. first = it.charCodeAt(0);
  452. if (first === 43 || first === 45) {
  453. third = it.charCodeAt(2);
  454. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  455. } else if (first === 48) {
  456. switch (it.charCodeAt(1)) {
  457. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  458. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  459. default: return +it;
  460. }
  461. digits = it.slice(2);
  462. length = digits.length;
  463. for (i = 0; i < length; i++) {
  464. code = digits.charCodeAt(i);
  465. // parseInt parses a string to a first unavailable symbol
  466. // but ToNumber should return NaN if a string contains unavailable symbols
  467. if (code < 48 || code > maxCode) return NaN;
  468. } return parseInt(digits, radix);
  469. }
  470. } return +it;
  471. };
  472. // `Number` constructor
  473. // https://tc39.github.io/ecma262/#sec-number-constructor
  474. if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  475. var NumberWrapper = function Number(value) {
  476. var it = arguments.length < 1 ? 0 : value;
  477. var that = this;
  478. return that instanceof NumberWrapper
  479. // check on 1..constructor(foo) case
  480. && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(that); }) : classofRaw(that) != NUMBER)
  481. ? inheritIfRequired(new NativeNumber(toNumber(it)), that, NumberWrapper) : toNumber(it);
  482. };
  483. for (var keys = descriptors ? getOwnPropertyNames(NativeNumber) : (
  484. // ES3:
  485. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  486. // ES2015 (in case, if modules with ES2015 Number statics required before):
  487. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  488. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  489. ).split(','), j = 0, key; keys.length > j; j++) {
  490. if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
  491. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  492. }
  493. }
  494. NumberWrapper.prototype = NumberPrototype;
  495. NumberPrototype.constructor = NumberWrapper;
  496. redefine(global, NUMBER, NumberWrapper);
  497. }
  498. var nativeParseInt = global.parseInt;
  499. var hex = /^[-+]?0[xX]/;
  500. var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
  501. var _parseInt = FORCED ? function parseInt(str, radix) {
  502. var string = stringTrim(String(str), 3);
  503. return nativeParseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  504. } : nativeParseInt;
  505. var f$4 = Object.getOwnPropertySymbols;
  506. var objectGetOwnPropertySymbols = {
  507. f: f$4
  508. };
  509. var Reflect = global.Reflect;
  510. // all object keys, includes non-enumerable and symbols
  511. var ownKeys = Reflect && Reflect.ownKeys || function ownKeys(it) {
  512. var keys = objectGetOwnPropertyNames.f(anObject(it));
  513. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  514. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  515. };
  516. var copyConstructorProperties = function (target, source) {
  517. var keys = ownKeys(source);
  518. var defineProperty = objectDefineProperty.f;
  519. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  520. for (var i = 0; i < keys.length; i++) {
  521. var key = keys[i];
  522. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  523. }
  524. };
  525. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  526. /*
  527. options.target - name of the target object
  528. options.global - target is the global object
  529. options.stat - export as static methods of target
  530. options.proto - export as prototype methods of target
  531. options.real - real prototype method for the `pure` version
  532. options.forced - export even if the native feature is available
  533. options.bind - bind methods to the target, required for the `pure` version
  534. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  535. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  536. options.sham - add a flag to not completely full polyfills
  537. options.enumerable - export as enumerable property
  538. options.noTargetGet - prevent calling a getter on target
  539. */
  540. var _export = function (options, source) {
  541. var TARGET = options.target;
  542. var GLOBAL = options.global;
  543. var STATIC = options.stat;
  544. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  545. if (GLOBAL) {
  546. target = global;
  547. } else if (STATIC) {
  548. target = global[TARGET] || setGlobal(TARGET, {});
  549. } else {
  550. target = (global[TARGET] || {}).prototype;
  551. }
  552. if (target) for (key in source) {
  553. sourceProperty = source[key];
  554. if (options.noTargetGet) {
  555. descriptor = getOwnPropertyDescriptor$1(target, key);
  556. targetProperty = descriptor && descriptor.value;
  557. } else targetProperty = target[key];
  558. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  559. // contained in target
  560. if (!FORCED && targetProperty !== undefined) {
  561. if (typeof sourceProperty === typeof targetProperty) continue;
  562. copyConstructorProperties(sourceProperty, targetProperty);
  563. }
  564. // add a flag to not completely full polyfills
  565. if (options.sham || (targetProperty && targetProperty.sham)) {
  566. hide(sourceProperty, 'sham', true);
  567. }
  568. // extend global
  569. redefine(target, key, sourceProperty, options);
  570. }
  571. };
  572. // `parseInt` method
  573. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  574. _export({ global: true, forced: parseInt != _parseInt }, {
  575. parseInt: _parseInt
  576. });
  577. // Chrome 38 Symbol has incorrect toString conversion
  578. var nativeSymbol = !fails(function () {
  579. });
  580. var store$1 = shared('wks');
  581. var Symbol = global.Symbol;
  582. var wellKnownSymbol = function (name) {
  583. return store$1[name] || (store$1[name] = nativeSymbol && Symbol[name]
  584. || (nativeSymbol ? Symbol : uid)('Symbol.' + name));
  585. };
  586. var MATCH = wellKnownSymbol('match');
  587. // `IsRegExp` abstract operation
  588. // https://tc39.github.io/ecma262/#sec-isregexp
  589. var isRegexp = function (it) {
  590. var isRegExp;
  591. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  592. };
  593. // `RegExp.prototype.flags` getter implementation
  594. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  595. var regexpFlags = function () {
  596. var that = anObject(this);
  597. var result = '';
  598. if (that.global) result += 'g';
  599. if (that.ignoreCase) result += 'i';
  600. if (that.multiline) result += 'm';
  601. if (that.unicode) result += 'u';
  602. if (that.sticky) result += 'y';
  603. return result;
  604. };
  605. var path = global;
  606. var aFunction = function (variable) {
  607. return typeof variable == 'function' ? variable : undefined;
  608. };
  609. var getBuiltIn = function (namespace, method) {
  610. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  611. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  612. };
  613. var SPECIES = wellKnownSymbol('species');
  614. var setSpecies = function (CONSTRUCTOR_NAME) {
  615. var C = getBuiltIn(CONSTRUCTOR_NAME);
  616. var defineProperty = objectDefineProperty.f;
  617. if (descriptors && C && !C[SPECIES]) defineProperty(C, SPECIES, {
  618. configurable: true,
  619. get: function () { return this; }
  620. });
  621. };
  622. var MATCH$1 = wellKnownSymbol('match');
  623. var defineProperty$1 = objectDefineProperty.f;
  624. var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
  625. var NativeRegExp = global.RegExp;
  626. var RegExpPrototype = NativeRegExp.prototype;
  627. var re1 = /a/g;
  628. var re2 = /a/g;
  629. // "new" should create a new object, old webkit bug
  630. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  631. var FORCED$1 = isForced_1('RegExp', descriptors && (!CORRECT_NEW || fails(function () {
  632. re2[MATCH$1] = false;
  633. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  634. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  635. })));
  636. // `RegExp` constructor
  637. // https://tc39.github.io/ecma262/#sec-regexp-constructor
  638. if (FORCED$1) {
  639. var RegExpWrapper = function RegExp(pattern, flags) {
  640. var thisIsRegExp = this instanceof RegExpWrapper;
  641. var patternIsRegExp = isRegexp(pattern);
  642. var flagsAreUndefined = flags === undefined;
  643. return !thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined ? pattern
  644. : inheritIfRequired(CORRECT_NEW
  645. ? new NativeRegExp(patternIsRegExp && !flagsAreUndefined ? pattern.source : pattern, flags)
  646. : NativeRegExp((patternIsRegExp = pattern instanceof RegExpWrapper)
  647. ? pattern.source
  648. : pattern, patternIsRegExp && flagsAreUndefined ? regexpFlags.call(pattern) : flags)
  649. , thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
  650. };
  651. var proxy = function (key) {
  652. key in RegExpWrapper || defineProperty$1(RegExpWrapper, key, {
  653. configurable: true,
  654. get: function () { return NativeRegExp[key]; },
  655. set: function (it) { NativeRegExp[key] = it; }
  656. });
  657. };
  658. var keys$1 = getOwnPropertyNames$1(NativeRegExp);
  659. var i = 0;
  660. while (i < keys$1.length) proxy(keys$1[i++]);
  661. RegExpPrototype.constructor = RegExpWrapper;
  662. RegExpWrapper.prototype = RegExpPrototype;
  663. redefine(global, 'RegExp', RegExpWrapper);
  664. }
  665. // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
  666. setSpecies('RegExp');
  667. var TO_STRING = 'toString';
  668. var nativeToString = /./[TO_STRING];
  669. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  670. // FF44- RegExp#toString has a wrong name
  671. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  672. // `RegExp.prototype.toString` method
  673. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  674. if (NOT_GENERIC || INCORRECT_NAME) {
  675. redefine(RegExp.prototype, TO_STRING, function toString() {
  676. var R = anObject(this);
  677. return '/'.concat(R.source, '/',
  678. 'flags' in R ? R.flags : !descriptors && R instanceof RegExp ? regexpFlags.call(R) : undefined);
  679. }, { unsafe: true });
  680. }
  681. // `ToObject` abstract operation
  682. // https://tc39.github.io/ecma262/#sec-toobject
  683. var toObject = function (argument) {
  684. return Object(requireObjectCoercible(argument));
  685. };
  686. // CONVERT_TO_STRING: true -> String#at
  687. // CONVERT_TO_STRING: false -> String#codePointAt
  688. var stringAt = function (that, pos, CONVERT_TO_STRING) {
  689. var S = String(requireObjectCoercible(that));
  690. var position = toInteger(pos);
  691. var size = S.length;
  692. var first, second;
  693. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  694. first = S.charCodeAt(position);
  695. return first < 0xd800 || first > 0xdbff || position + 1 === size
  696. || (second = S.charCodeAt(position + 1)) < 0xdc00 || second > 0xdfff
  697. ? CONVERT_TO_STRING ? S.charAt(position) : first
  698. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xd800 << 10) + (second - 0xdc00) + 0x10000;
  699. };
  700. // `AdvanceStringIndex` abstract operation
  701. // https://tc39.github.io/ecma262/#sec-advancestringindex
  702. var advanceStringIndex = function (S, index, unicode) {
  703. return index + (unicode ? stringAt(S, index, true).length : 1);
  704. };
  705. var nativeExec = RegExp.prototype.exec;
  706. // This always refers to the native implementation, because the
  707. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  708. // which loads this file before patching the method.
  709. var nativeReplace = String.prototype.replace;
  710. var patchedExec = nativeExec;
  711. var UPDATES_LAST_INDEX_WRONG = (function () {
  712. var re1 = /a/;
  713. var re2 = /b*/g;
  714. nativeExec.call(re1, 'a');
  715. nativeExec.call(re2, 'a');
  716. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  717. })();
  718. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  719. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  720. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  721. if (PATCH) {
  722. patchedExec = function exec(str) {
  723. var re = this;
  724. var lastIndex, reCopy, match, i;
  725. if (NPCG_INCLUDED) {
  726. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  727. }
  728. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  729. match = nativeExec.call(re, str);
  730. if (UPDATES_LAST_INDEX_WRONG && match) {
  731. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  732. }
  733. if (NPCG_INCLUDED && match && match.length > 1) {
  734. // Fix browsers whose `exec` methods don't consistently return `undefined`
  735. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  736. nativeReplace.call(match[0], reCopy, function () {
  737. for (i = 1; i < arguments.length - 2; i++) {
  738. if (arguments[i] === undefined) match[i] = undefined;
  739. }
  740. });
  741. }
  742. return match;
  743. };
  744. }
  745. var regexpExec = patchedExec;
  746. // `RegExpExec` abstract operation
  747. // https://tc39.github.io/ecma262/#sec-regexpexec
  748. var regexpExecAbstract = function (R, S) {
  749. var exec = R.exec;
  750. if (typeof exec === 'function') {
  751. var result = exec.call(R, S);
  752. if (typeof result !== 'object') {
  753. throw TypeError('RegExp exec method returned something other than an Object or null');
  754. }
  755. return result;
  756. }
  757. if (classofRaw(R) !== 'RegExp') {
  758. throw TypeError('RegExp#exec called on incompatible receiver');
  759. }
  760. return regexpExec.call(R, S);
  761. };
  762. var SPECIES$1 = wellKnownSymbol('species');
  763. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  764. // #replace needs built-in support for named groups.
  765. // #match works fine because it just return the exec results, even if it has
  766. // a "grops" property.
  767. var re = /./;
  768. re.exec = function () {
  769. var result = [];
  770. result.groups = { a: '7' };
  771. return result;
  772. };
  773. return ''.replace(re, '$<a>') !== '7';
  774. });
  775. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  776. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  777. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  778. var re = /(?:)/;
  779. var originalExec = re.exec;
  780. re.exec = function () { return originalExec.apply(this, arguments); };
  781. var result = 'ab'.split(re);
  782. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  783. });
  784. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  785. var SYMBOL = wellKnownSymbol(KEY);
  786. var DELEGATES_TO_SYMBOL = !fails(function () {
  787. // String methods call symbol-named RegEp methods
  788. var O = {};
  789. O[SYMBOL] = function () { return 7; };
  790. return ''[KEY](O) != 7;
  791. });
  792. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  793. // Symbol-named RegExp methods call .exec
  794. var execCalled = false;
  795. var re = /a/;
  796. re.exec = function () { execCalled = true; return null; };
  797. if (KEY === 'split') {
  798. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  799. // a new one. We need to return the patched regex when creating the new one.
  800. re.constructor = {};
  801. re.constructor[SPECIES$1] = function () { return re; };
  802. }
  803. re[SYMBOL]('');
  804. return !execCalled;
  805. });
  806. if (
  807. !DELEGATES_TO_SYMBOL ||
  808. !DELEGATES_TO_EXEC ||
  809. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  810. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  811. ) {
  812. var nativeRegExpMethod = /./[SYMBOL];
  813. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  814. if (regexp.exec === regexpExec) {
  815. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  816. // The native String method already delegates to @@method (this
  817. // polyfilled function), leasing to infinite recursion.
  818. // We avoid it by directly calling the native @@method method.
  819. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  820. }
  821. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  822. }
  823. return { done: false };
  824. });
  825. var stringMethod = methods[0];
  826. var regexMethod = methods[1];
  827. redefine(String.prototype, KEY, stringMethod);
  828. redefine(RegExp.prototype, SYMBOL, length == 2
  829. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  830. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  831. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  832. // 21.2.5.6 RegExp.prototype[@@match](string)
  833. // 21.2.5.9 RegExp.prototype[@@search](string)
  834. : function (string) { return regexMethod.call(string, this); }
  835. );
  836. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  837. }
  838. };
  839. var max$1 = Math.max;
  840. var min$2 = Math.min;
  841. var floor$1 = Math.floor;
  842. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  843. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  844. var maybeToString = function (it) {
  845. return it === undefined ? it : String(it);
  846. };
  847. // @@replace logic
  848. fixRegexpWellKnownSymbolLogic(
  849. 'replace',
  850. 2,
  851. function (REPLACE, nativeReplace, maybeCallNative) {
  852. return [
  853. // `String.prototype.replace` method
  854. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  855. function replace(searchValue, replaceValue) {
  856. var O = requireObjectCoercible(this);
  857. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  858. return replacer !== undefined
  859. ? replacer.call(searchValue, O, replaceValue)
  860. : nativeReplace.call(String(O), searchValue, replaceValue);
  861. },
  862. // `RegExp.prototype[@@replace]` method
  863. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  864. function (regexp, replaceValue) {
  865. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  866. if (res.done) return res.value;
  867. var rx = anObject(regexp);
  868. var S = String(this);
  869. var functionalReplace = typeof replaceValue === 'function';
  870. if (!functionalReplace) replaceValue = String(replaceValue);
  871. var global = rx.global;
  872. if (global) {
  873. var fullUnicode = rx.unicode;
  874. rx.lastIndex = 0;
  875. }
  876. var results = [];
  877. while (true) {
  878. var result = regexpExecAbstract(rx, S);
  879. if (result === null) break;
  880. results.push(result);
  881. if (!global) break;
  882. var matchStr = String(result[0]);
  883. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  884. }
  885. var accumulatedResult = '';
  886. var nextSourcePosition = 0;
  887. for (var i = 0; i < results.length; i++) {
  888. result = results[i];
  889. var matched = String(result[0]);
  890. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  891. var captures = [];
  892. // NOTE: This is equivalent to
  893. // captures = result.slice(1).map(maybeToString)
  894. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  895. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  896. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  897. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  898. var namedCaptures = result.groups;
  899. if (functionalReplace) {
  900. var replacerArgs = [matched].concat(captures, position, S);
  901. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  902. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  903. } else {
  904. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  905. }
  906. if (position >= nextSourcePosition) {
  907. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  908. nextSourcePosition = position + matched.length;
  909. }
  910. }
  911. return accumulatedResult + S.slice(nextSourcePosition);
  912. }
  913. ];
  914. // https://tc39.github.io/ecma262/#sec-getsubstitution
  915. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  916. var tailPos = position + matched.length;
  917. var m = captures.length;
  918. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  919. if (namedCaptures !== undefined) {
  920. namedCaptures = toObject(namedCaptures);
  921. symbols = SUBSTITUTION_SYMBOLS;
  922. }
  923. return nativeReplace.call(replacement, symbols, function (match, ch) {
  924. var capture;
  925. switch (ch.charAt(0)) {
  926. case '$': return '$';
  927. case '&': return matched;
  928. case '`': return str.slice(0, position);
  929. case "'": return str.slice(tailPos);
  930. case '<':
  931. capture = namedCaptures[ch.slice(1, -1)];
  932. break;
  933. default: // \d\d?
  934. var n = +ch;
  935. if (n === 0) return match;
  936. if (n > m) {
  937. var f = floor$1(n / 10);
  938. if (f === 0) return match;
  939. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  940. return match;
  941. }
  942. capture = captures[n - 1];
  943. }
  944. return capture === undefined ? '' : capture;
  945. });
  946. }
  947. }
  948. );
  949. /**
  950. * @author: Brian Huisman
  951. * @webSite: http://www.greywyvern.com
  952. * JS functions to allow natural sorting on bootstrap-table columns
  953. * add data-sorter="alphanum" or data-sorter="numericOnly" to any th
  954. *
  955. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  956. * @update Duane May
  957. */
  958. function alphanum(a, b) {
  959. function chunkify(t) {
  960. var tz = [];
  961. var y = -1;
  962. var n = 0;
  963. for (var i = 0; i <= t.length; i++) {
  964. var char = t.charAt(i);
  965. var charCode = char.charCodeAt(0);
  966. var m = charCode === 46 || charCode >= 48 && charCode <= 57;
  967. if (m !== n) {
  968. tz[++y] = '';
  969. n = m;
  970. }
  971. tz[y] += char;
  972. }
  973. return tz;
  974. }
  975. function stringfy(v) {
  976. if (typeof v === 'number') {
  977. v = "".concat(v);
  978. }
  979. if (!v) {
  980. v = '';
  981. }
  982. return v;
  983. }
  984. var aa = chunkify(stringfy(a));
  985. var bb = chunkify(stringfy(b));
  986. for (var x = 0; aa[x] && bb[x]; x++) {
  987. if (aa[x] !== bb[x]) {
  988. var c = Number(aa[x]);
  989. var d = Number(bb[x]);
  990. if (c === aa[x] && d === bb[x]) {
  991. return c - d;
  992. }
  993. return aa[x] > bb[x] ? 1 : -1;
  994. }
  995. }
  996. return aa.length - bb.length;
  997. }
  998. function numericOnly(a, b) {
  999. function stripNonNumber(s) {
  1000. s = s.replace(new RegExp(/[^0-9]/g), '');
  1001. return parseInt(s, 10);
  1002. }
  1003. return stripNonNumber(a) - stripNonNumber(b);
  1004. }
  1005. var bootstrapTableNaturalSorting = {
  1006. alphanum: alphanum,
  1007. numericOnly: numericOnly
  1008. };
  1009. return bootstrapTableNaturalSorting;
  1010. }));