bootstrap-table-fixed-columns.js 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var check = function (it) {
  12. return it && it.Math == Math && it;
  13. };
  14. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  15. var global_1 =
  16. // eslint-disable-next-line no-undef
  17. check(typeof globalThis == 'object' && globalThis) ||
  18. check(typeof window == 'object' && window) ||
  19. check(typeof self == 'object' && self) ||
  20. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  21. // eslint-disable-next-line no-new-func
  22. Function('return this')();
  23. var fails = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. // Thank's IE8 for his funny defineProperty
  31. var descriptors = !fails(function () {
  32. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  33. });
  34. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  35. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  36. // Nashorn ~ JDK8 bug
  37. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  38. // `Object.prototype.propertyIsEnumerable` method implementation
  39. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  40. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  41. var descriptor = getOwnPropertyDescriptor(this, V);
  42. return !!descriptor && descriptor.enumerable;
  43. } : nativePropertyIsEnumerable;
  44. var objectPropertyIsEnumerable = {
  45. f: f
  46. };
  47. var createPropertyDescriptor = function (bitmap, value) {
  48. return {
  49. enumerable: !(bitmap & 1),
  50. configurable: !(bitmap & 2),
  51. writable: !(bitmap & 4),
  52. value: value
  53. };
  54. };
  55. var toString = {}.toString;
  56. var classofRaw = function (it) {
  57. return toString.call(it).slice(8, -1);
  58. };
  59. var split = ''.split;
  60. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  61. var indexedObject = fails(function () {
  62. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  63. // eslint-disable-next-line no-prototype-builtins
  64. return !Object('z').propertyIsEnumerable(0);
  65. }) ? function (it) {
  66. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  67. } : Object;
  68. // `RequireObjectCoercible` abstract operation
  69. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  70. var requireObjectCoercible = function (it) {
  71. if (it == undefined) throw TypeError("Can't call method on " + it);
  72. return it;
  73. };
  74. // toObject with fallback for non-array-like ES3 strings
  75. var toIndexedObject = function (it) {
  76. return indexedObject(requireObjectCoercible(it));
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `ToPrimitive` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-toprimitive
  83. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  84. // and the second argument - flag - preferred type is a string
  85. var toPrimitive = function (input, PREFERRED_STRING) {
  86. if (!isObject(input)) return input;
  87. var fn, val;
  88. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  89. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  91. throw TypeError("Can't convert object to primitive value");
  92. };
  93. var hasOwnProperty = {}.hasOwnProperty;
  94. var has = function (it, key) {
  95. return hasOwnProperty.call(it, key);
  96. };
  97. var document$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 nativeReverse = [].reverse;
  772. var test = [1, 2];
  773. // `Array.prototype.reverse` method
  774. // https://tc39.github.io/ecma262/#sec-array.prototype.reverse
  775. // fix for Safari 12.0 bug
  776. // https://bugs.webkit.org/show_bug.cgi?id=188794
  777. _export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
  778. reverse: function reverse() {
  779. // eslint-disable-next-line no-self-assign
  780. if (isArray(this)) this.length = this.length;
  781. return nativeReverse.call(this);
  782. }
  783. });
  784. // a string of all valid unicode whitespaces
  785. // eslint-disable-next-line max-len
  786. 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';
  787. var whitespace = '[' + whitespaces + ']';
  788. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  789. var rtrim = RegExp(whitespace + whitespace + '*$');
  790. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  791. var createMethod$2 = function (TYPE) {
  792. return function ($this) {
  793. var string = String(requireObjectCoercible($this));
  794. if (TYPE & 1) string = string.replace(ltrim, '');
  795. if (TYPE & 2) string = string.replace(rtrim, '');
  796. return string;
  797. };
  798. };
  799. var stringTrim = {
  800. // `String.prototype.{ trimLeft, trimStart }` methods
  801. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  802. start: createMethod$2(1),
  803. // `String.prototype.{ trimRight, trimEnd }` methods
  804. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  805. end: createMethod$2(2),
  806. // `String.prototype.trim` method
  807. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  808. trim: createMethod$2(3)
  809. };
  810. var trim = stringTrim.trim;
  811. var nativeParseInt = global_1.parseInt;
  812. var hex = /^[+-]?0[Xx]/;
  813. var FORCED$1 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
  814. // `parseInt` method
  815. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  816. var _parseInt = FORCED$1 ? function parseInt(string, radix) {
  817. var S = trim(String(string));
  818. return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  819. } : nativeParseInt;
  820. // `parseInt` method
  821. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  822. _export({ global: true, forced: parseInt != _parseInt }, {
  823. parseInt: _parseInt
  824. });
  825. function _typeof(obj) {
  826. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  827. _typeof = function (obj) {
  828. return typeof obj;
  829. };
  830. } else {
  831. _typeof = function (obj) {
  832. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  833. };
  834. }
  835. return _typeof(obj);
  836. }
  837. function _classCallCheck(instance, Constructor) {
  838. if (!(instance instanceof Constructor)) {
  839. throw new TypeError("Cannot call a class as a function");
  840. }
  841. }
  842. function _defineProperties(target, props) {
  843. for (var i = 0; i < props.length; i++) {
  844. var descriptor = props[i];
  845. descriptor.enumerable = descriptor.enumerable || false;
  846. descriptor.configurable = true;
  847. if ("value" in descriptor) descriptor.writable = true;
  848. Object.defineProperty(target, descriptor.key, descriptor);
  849. }
  850. }
  851. function _createClass(Constructor, protoProps, staticProps) {
  852. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  853. if (staticProps) _defineProperties(Constructor, staticProps);
  854. return Constructor;
  855. }
  856. function _inherits(subClass, superClass) {
  857. if (typeof superClass !== "function" && superClass !== null) {
  858. throw new TypeError("Super expression must either be null or a function");
  859. }
  860. subClass.prototype = Object.create(superClass && superClass.prototype, {
  861. constructor: {
  862. value: subClass,
  863. writable: true,
  864. configurable: true
  865. }
  866. });
  867. if (superClass) _setPrototypeOf(subClass, superClass);
  868. }
  869. function _getPrototypeOf(o) {
  870. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  871. return o.__proto__ || Object.getPrototypeOf(o);
  872. };
  873. return _getPrototypeOf(o);
  874. }
  875. function _setPrototypeOf(o, p) {
  876. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  877. o.__proto__ = p;
  878. return o;
  879. };
  880. return _setPrototypeOf(o, p);
  881. }
  882. function _assertThisInitialized(self) {
  883. if (self === void 0) {
  884. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  885. }
  886. return self;
  887. }
  888. function _possibleConstructorReturn(self, call) {
  889. if (call && (typeof call === "object" || typeof call === "function")) {
  890. return call;
  891. }
  892. return _assertThisInitialized(self);
  893. }
  894. function _superPropBase(object, property) {
  895. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  896. object = _getPrototypeOf(object);
  897. if (object === null) break;
  898. }
  899. return object;
  900. }
  901. function _get(target, property, receiver) {
  902. if (typeof Reflect !== "undefined" && Reflect.get) {
  903. _get = Reflect.get;
  904. } else {
  905. _get = function _get(target, property, receiver) {
  906. var base = _superPropBase(target, property);
  907. if (!base) return;
  908. var desc = Object.getOwnPropertyDescriptor(base, property);
  909. if (desc.get) {
  910. return desc.get.call(receiver);
  911. }
  912. return desc.value;
  913. };
  914. }
  915. return _get(target, property, receiver || target);
  916. }
  917. /**
  918. * @author zhixin wen <wenzhixin2010@gmail.com>
  919. */
  920. var Utils = $.fn.bootstrapTable.utils; // Reasonable defaults
  921. var PIXEL_STEP = 10;
  922. var LINE_HEIGHT = 40;
  923. var PAGE_HEIGHT = 800;
  924. function normalizeWheel(event) {
  925. var sX = 0; // spinX
  926. var sY = 0; // spinY
  927. var pX = 0; // pixelX
  928. var pY = 0; // pixelY
  929. // Legacy
  930. if ('detail' in event) {
  931. sY = event.detail;
  932. }
  933. if ('wheelDelta' in event) {
  934. sY = -event.wheelDelta / 120;
  935. }
  936. if ('wheelDeltaY' in event) {
  937. sY = -event.wheelDeltaY / 120;
  938. }
  939. if ('wheelDeltaX' in event) {
  940. sX = -event.wheelDeltaX / 120;
  941. } // side scrolling on FF with DOMMouseScroll
  942. if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
  943. sX = sY;
  944. sY = 0;
  945. }
  946. pX = sX * PIXEL_STEP;
  947. pY = sY * PIXEL_STEP;
  948. if ('deltaY' in event) {
  949. pY = event.deltaY;
  950. }
  951. if ('deltaX' in event) {
  952. pX = event.deltaX;
  953. }
  954. if ((pX || pY) && event.deltaMode) {
  955. if (event.deltaMode === 1) {
  956. // delta in LINE units
  957. pX *= LINE_HEIGHT;
  958. pY *= LINE_HEIGHT;
  959. } else {
  960. // delta in PAGE units
  961. pX *= PAGE_HEIGHT;
  962. pY *= PAGE_HEIGHT;
  963. }
  964. } // Fall-back if spin cannot be determined
  965. if (pX && !sX) {
  966. sX = pX < 1 ? -1 : 1;
  967. }
  968. if (pY && !sY) {
  969. sY = pY < 1 ? -1 : 1;
  970. }
  971. return {
  972. spinX: sX,
  973. spinY: sY,
  974. pixelX: pX,
  975. pixelY: pY
  976. };
  977. }
  978. $.extend($.fn.bootstrapTable.defaults, {
  979. fixedColumns: false,
  980. fixedNumber: 0,
  981. fixedRightNumber: 0
  982. });
  983. $.BootstrapTable =
  984. /*#__PURE__*/
  985. function (_$$BootstrapTable) {
  986. _inherits(_class, _$$BootstrapTable);
  987. function _class() {
  988. _classCallCheck(this, _class);
  989. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  990. }
  991. _createClass(_class, [{
  992. key: "fixedColumnsSupported",
  993. value: function fixedColumnsSupported() {
  994. return this.options.fixedColumns && !this.options.detailView && !this.options.cardView;
  995. }
  996. }, {
  997. key: "initContainer",
  998. value: function initContainer() {
  999. _get(_getPrototypeOf(_class.prototype), "initContainer", this).call(this);
  1000. if (!this.fixedColumnsSupported()) {
  1001. return;
  1002. }
  1003. if (this.options.fixedNumber) {
  1004. this.$tableContainer.append('<div class="fixed-columns"></div>');
  1005. this.$fixedColumns = this.$tableContainer.find('.fixed-columns');
  1006. }
  1007. if (this.options.fixedRightNumber) {
  1008. this.$tableContainer.append('<div class="fixed-columns-right"></div>');
  1009. this.$fixedColumnsRight = this.$tableContainer.find('.fixed-columns-right');
  1010. }
  1011. }
  1012. }, {
  1013. key: "initBody",
  1014. value: function initBody() {
  1015. var _get2;
  1016. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1017. args[_key] = arguments[_key];
  1018. }
  1019. (_get2 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get2, [this].concat(args));
  1020. if (this.$fixedColumns && this.$fixedColumns.length) {
  1021. this.$fixedColumns.toggle(this.fixedColumnsSupported());
  1022. }
  1023. if (this.$fixedColumnsRight && this.$fixedColumnsRight.length) {
  1024. this.$fixedColumnsRight.toggle(this.fixedColumnsSupported());
  1025. }
  1026. if (!this.fixedColumnsSupported()) {
  1027. return;
  1028. }
  1029. if (this.options.showHeader && this.options.height) {
  1030. return;
  1031. }
  1032. this.initFixedColumnsBody();
  1033. this.initFixedColumnsEvents();
  1034. }
  1035. }, {
  1036. key: "trigger",
  1037. value: function trigger() {
  1038. var _get3;
  1039. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1040. args[_key2] = arguments[_key2];
  1041. }
  1042. (_get3 = _get(_getPrototypeOf(_class.prototype), "trigger", this)).call.apply(_get3, [this].concat(args));
  1043. if (!this.fixedColumnsSupported()) {
  1044. return;
  1045. }
  1046. if (args[0] === 'post-header') {
  1047. this.initFixedColumnsHeader();
  1048. } else if (args[0] === 'scroll-body') {
  1049. if (this.needFixedColumns && this.options.fixedNumber) {
  1050. this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
  1051. }
  1052. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1053. this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
  1054. }
  1055. }
  1056. }
  1057. }, {
  1058. key: "updateSelected",
  1059. value: function updateSelected() {
  1060. var _this = this;
  1061. _get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
  1062. if (!this.fixedColumnsSupported()) {
  1063. return;
  1064. }
  1065. this.$tableBody.find('tr').each(function (i, el) {
  1066. var $el = $(el);
  1067. var index = $el.data('index');
  1068. var classes = $el.attr('class');
  1069. var inputSelector = "[name=\"".concat(_this.options.selectItemName, "\"]");
  1070. var $input = $el.find(inputSelector);
  1071. if (_typeof(index) === undefined) {
  1072. return;
  1073. }
  1074. var updateFixedBody = function updateFixedBody($fixedHeader, $fixedBody) {
  1075. var $tr = $fixedBody.find("tr[data-index=\"".concat(index, "\"]"));
  1076. $tr.attr('class', classes);
  1077. if ($input.length) {
  1078. $tr.find(inputSelector).prop('checked', $input.prop('checked'));
  1079. }
  1080. if (_this.$selectAll.length) {
  1081. $fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', _this.$selectAll.prop('checked'));
  1082. }
  1083. };
  1084. if (_this.$fixedBody && _this.options.fixedNumber) {
  1085. updateFixedBody(_this.$fixedHeader, _this.$fixedBody);
  1086. }
  1087. if (_this.$fixedBodyRight && _this.options.fixedRightNumber) {
  1088. updateFixedBody(_this.$fixedHeaderRight, _this.$fixedBodyRight);
  1089. }
  1090. });
  1091. }
  1092. }, {
  1093. key: "hideLoading",
  1094. value: function hideLoading() {
  1095. _get(_getPrototypeOf(_class.prototype), "hideLoading", this).call(this);
  1096. if (this.needFixedColumns && this.options.fixedNumber) {
  1097. this.$fixedColumns.find('.fixed-table-loading').hide();
  1098. }
  1099. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1100. this.$fixedColumnsRight.find('.fixed-table-loading').hide();
  1101. }
  1102. }
  1103. }, {
  1104. key: "initFixedColumnsHeader",
  1105. value: function initFixedColumnsHeader() {
  1106. var _this2 = this;
  1107. if (this.options.height) {
  1108. this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true);
  1109. } else {
  1110. this.needFixedColumns = this.$tableBody.outerWidth(true) < this.$tableBody.find('table').outerWidth(true);
  1111. }
  1112. var initFixedHeader = function initFixedHeader($fixedColumns, isRight) {
  1113. $fixedColumns.find('.fixed-table-header').remove();
  1114. $fixedColumns.append(_this2.$tableHeader.clone(true));
  1115. $fixedColumns.css({
  1116. width: _this2.getFixedColumnsWidth(isRight)
  1117. });
  1118. return $fixedColumns.find('.fixed-table-header');
  1119. };
  1120. if (this.needFixedColumns && this.options.fixedNumber) {
  1121. this.$fixedHeader = initFixedHeader(this.$fixedColumns);
  1122. this.$fixedHeader.css('margin-right', '');
  1123. } else if (this.$fixedColumns) {
  1124. this.$fixedColumns.html('').css('width', '');
  1125. }
  1126. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1127. this.$fixedHeaderRight = initFixedHeader(this.$fixedColumnsRight, true);
  1128. this.$fixedHeaderRight.scrollLeft(this.$fixedHeaderRight.find('table').width());
  1129. } else if (this.$fixedColumnsRight) {
  1130. this.$fixedColumnsRight.html('').css('width', '');
  1131. }
  1132. this.initFixedColumnsBody();
  1133. this.initFixedColumnsEvents();
  1134. }
  1135. }, {
  1136. key: "initFixedColumnsBody",
  1137. value: function initFixedColumnsBody() {
  1138. var _this3 = this;
  1139. var initFixedBody = function initFixedBody($fixedColumns, $fixedHeader) {
  1140. $fixedColumns.find('.fixed-table-body').remove();
  1141. $fixedColumns.append(_this3.$tableBody.clone(true));
  1142. var $fixedBody = $fixedColumns.find('.fixed-table-body');
  1143. var tableBody = _this3.$tableBody.get(0);
  1144. var scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? Utils.getScrollBarWidth() : 0;
  1145. var height = _this3.$tableContainer.outerHeight(true) - scrollHeight - 1;
  1146. $fixedColumns.css({
  1147. height: height
  1148. });
  1149. $fixedBody.css({
  1150. height: height - $fixedHeader.height()
  1151. });
  1152. return $fixedBody;
  1153. };
  1154. if (this.needFixedColumns && this.options.fixedNumber) {
  1155. this.$fixedBody = initFixedBody(this.$fixedColumns, this.$fixedHeader);
  1156. }
  1157. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1158. this.$fixedBodyRight = initFixedBody(this.$fixedColumnsRight, this.$fixedHeaderRight);
  1159. this.$fixedBodyRight.scrollLeft(this.$fixedBodyRight.find('table').width());
  1160. this.$fixedBodyRight.css('overflow-y', this.options.height ? 'auto' : 'hidden');
  1161. }
  1162. }
  1163. }, {
  1164. key: "getFixedColumnsWidth",
  1165. value: function getFixedColumnsWidth(isRight) {
  1166. var visibleFields = this.getVisibleFields();
  1167. var width = 0;
  1168. var fixedNumber = this.options.fixedNumber;
  1169. var marginRight = 0;
  1170. if (isRight) {
  1171. visibleFields = visibleFields.reverse();
  1172. fixedNumber = this.options.fixedRightNumber;
  1173. marginRight = parseInt(this.$tableHeader.css('margin-right'), 10);
  1174. }
  1175. for (var i = 0; i < fixedNumber; i++) {
  1176. width += this.$header.find("th[data-field=\"".concat(visibleFields[i], "\"]")).outerWidth(true);
  1177. }
  1178. return width + marginRight + 1;
  1179. }
  1180. }, {
  1181. key: "initFixedColumnsEvents",
  1182. value: function initFixedColumnsEvents() {
  1183. var _this4 = this;
  1184. var toggleHover = function toggleHover(e, toggle) {
  1185. var tr = "tr[data-index=\"".concat($(e.currentTarget).data('index'), "\"]");
  1186. var $trs = _this4.$tableBody.find(tr);
  1187. if (_this4.$fixedBody) {
  1188. $trs = $trs.add(_this4.$fixedBody.find(tr));
  1189. }
  1190. if (_this4.$fixedBodyRight) {
  1191. $trs = $trs.add(_this4.$fixedBodyRight.find(tr));
  1192. }
  1193. $trs.css('background-color', toggle ? $(e.currentTarget).css('background-color') : '');
  1194. };
  1195. this.$tableBody.find('tr').hover(function (e) {
  1196. toggleHover(e, true);
  1197. }, function (e) {
  1198. toggleHover(e, false);
  1199. });
  1200. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  1201. var mousewheel = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
  1202. var updateScroll = function updateScroll(e, fixedBody) {
  1203. var normalized = normalizeWheel(e);
  1204. var deltaY = Math.ceil(normalized.pixelY);
  1205. var top = _this4.$tableBody.scrollTop() + deltaY;
  1206. if (deltaY < 0 && top > 0 || deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight) {
  1207. e.preventDefault();
  1208. }
  1209. _this4.$tableBody.scrollTop(top);
  1210. if (_this4.$fixedBody) {
  1211. _this4.$fixedBody.scrollTop(top);
  1212. }
  1213. if (_this4.$fixedBodyRight) {
  1214. _this4.$fixedBodyRight.scrollTop(top);
  1215. }
  1216. };
  1217. if (this.needFixedColumns && this.options.fixedNumber) {
  1218. this.$fixedBody.find('tr').hover(function (e) {
  1219. toggleHover(e, true);
  1220. }, function (e) {
  1221. toggleHover(e, false);
  1222. });
  1223. this.$fixedBody[0].addEventListener(mousewheel, function (e) {
  1224. updateScroll(e, _this4.$fixedBody[0]);
  1225. });
  1226. }
  1227. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1228. this.$fixedBodyRight.find('tr').hover(function (e) {
  1229. toggleHover(e, true);
  1230. }, function (e) {
  1231. toggleHover(e, false);
  1232. });
  1233. this.$fixedBodyRight.off('scroll').on('scroll', function () {
  1234. var top = _this4.$fixedBodyRight.scrollTop();
  1235. _this4.$tableBody.scrollTop(top);
  1236. if (_this4.$fixedBody) {
  1237. _this4.$fixedBody.scrollTop(top);
  1238. }
  1239. });
  1240. }
  1241. if (this.options.filterControl) {
  1242. $(this.$fixedColumns).off('keyup change').on('keyup change', function (e) {
  1243. var $target = $(e.target);
  1244. var value = $target.val();
  1245. var field = $target.parents('th').data('field');
  1246. var $coreTh = _this4.$header.find("th[data-field=\"".concat(field, "\"]"));
  1247. if ($target.is('input')) {
  1248. $coreTh.find('input').val(value);
  1249. } else if ($target.is('select')) {
  1250. var $select = $coreTh.find('select');
  1251. $select.find('option[selected]').removeAttr('selected');
  1252. $select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  1253. }
  1254. _this4.triggerSearch();
  1255. });
  1256. }
  1257. }
  1258. }, {
  1259. key: "renderStickyHeader",
  1260. value: function renderStickyHeader() {
  1261. if (!this.options.stickyHeader) {
  1262. return;
  1263. }
  1264. this.$stickyContainer = this.$container.find('.sticky-header-container');
  1265. _get(_getPrototypeOf(_class.prototype), "renderStickyHeader", this).call(this);
  1266. if (this.needFixedColumns && this.options.fixedNumber) {
  1267. this.$fixedColumns.css('z-index', 101).find('.sticky-header-container').css('right', '').width(this.$fixedColumns.outerWidth());
  1268. }
  1269. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1270. var $stickyHeaderContainerRight = this.$fixedColumnsRight.find('.sticky-header-container');
  1271. this.$fixedColumnsRight.css('z-index', 101);
  1272. $stickyHeaderContainerRight.css('left', '').scrollLeft($stickyHeaderContainerRight.find('.table').outerWidth()).width(this.$fixedColumnsRight.outerWidth());
  1273. }
  1274. }
  1275. }, {
  1276. key: "matchPositionX",
  1277. value: function matchPositionX() {
  1278. if (!this.options.stickyHeader) {
  1279. return;
  1280. }
  1281. this.$stickyContainer.eq(0).scrollLeft(this.$tableBody.scrollLeft());
  1282. }
  1283. }]);
  1284. return _class;
  1285. }($.BootstrapTable);
  1286. })));