bootstrap-table-fixed-columns.js 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941
  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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _inherits(subClass, superClass) {
  31. if (typeof superClass !== "function" && superClass !== null) {
  32. throw new TypeError("Super expression must either be null or a function");
  33. }
  34. subClass.prototype = Object.create(superClass && superClass.prototype, {
  35. constructor: {
  36. value: subClass,
  37. writable: true,
  38. configurable: true
  39. }
  40. });
  41. Object.defineProperty(subClass, "prototype", {
  42. writable: false
  43. });
  44. if (superClass) _setPrototypeOf(subClass, superClass);
  45. }
  46. function _getPrototypeOf(o) {
  47. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  48. return o.__proto__ || Object.getPrototypeOf(o);
  49. };
  50. return _getPrototypeOf(o);
  51. }
  52. function _setPrototypeOf(o, p) {
  53. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  54. o.__proto__ = p;
  55. return o;
  56. };
  57. return _setPrototypeOf(o, p);
  58. }
  59. function _isNativeReflectConstruct() {
  60. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  61. if (Reflect.construct.sham) return false;
  62. if (typeof Proxy === "function") return true;
  63. try {
  64. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. } else if (call !== void 0) {
  80. throw new TypeError("Derived constructors may only return object or undefined");
  81. }
  82. return _assertThisInitialized(self);
  83. }
  84. function _createSuper(Derived) {
  85. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  86. return function _createSuperInternal() {
  87. var Super = _getPrototypeOf(Derived),
  88. result;
  89. if (hasNativeReflectConstruct) {
  90. var NewTarget = _getPrototypeOf(this).constructor;
  91. result = Reflect.construct(Super, arguments, NewTarget);
  92. } else {
  93. result = Super.apply(this, arguments);
  94. }
  95. return _possibleConstructorReturn(this, result);
  96. };
  97. }
  98. function _superPropBase(object, property) {
  99. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  100. object = _getPrototypeOf(object);
  101. if (object === null) break;
  102. }
  103. return object;
  104. }
  105. function _get() {
  106. if (typeof Reflect !== "undefined" && Reflect.get) {
  107. _get = Reflect.get;
  108. } else {
  109. _get = function _get(target, property, receiver) {
  110. var base = _superPropBase(target, property);
  111. if (!base) return;
  112. var desc = Object.getOwnPropertyDescriptor(base, property);
  113. if (desc.get) {
  114. return desc.get.call(arguments.length < 3 ? target : receiver);
  115. }
  116. return desc.value;
  117. };
  118. }
  119. return _get.apply(this, arguments);
  120. }
  121. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  122. function createCommonjsModule(fn, module) {
  123. return module = { exports: {} }, fn(module, module.exports), module.exports;
  124. }
  125. var check = function (it) {
  126. return it && it.Math == Math && it;
  127. };
  128. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  129. var global_1 =
  130. // eslint-disable-next-line es-x/no-global-this -- safe
  131. check(typeof globalThis == 'object' && globalThis) ||
  132. check(typeof window == 'object' && window) ||
  133. // eslint-disable-next-line no-restricted-globals -- safe
  134. check(typeof self == 'object' && self) ||
  135. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  136. // eslint-disable-next-line no-new-func -- fallback
  137. (function () { return this; })() || Function('return this')();
  138. var fails = function (exec) {
  139. try {
  140. return !!exec();
  141. } catch (error) {
  142. return true;
  143. }
  144. };
  145. // Detect IE8's incomplete defineProperty implementation
  146. var descriptors = !fails(function () {
  147. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  148. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  149. });
  150. var functionBindNative = !fails(function () {
  151. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  152. var test = (function () { /* empty */ }).bind();
  153. // eslint-disable-next-line no-prototype-builtins -- safe
  154. return typeof test != 'function' || test.hasOwnProperty('prototype');
  155. });
  156. var call$1 = Function.prototype.call;
  157. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  158. return call$1.apply(call$1, arguments);
  159. };
  160. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  161. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  162. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  163. // Nashorn ~ JDK8 bug
  164. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  165. // `Object.prototype.propertyIsEnumerable` method implementation
  166. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  167. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  168. var descriptor = getOwnPropertyDescriptor$1(this, V);
  169. return !!descriptor && descriptor.enumerable;
  170. } : $propertyIsEnumerable;
  171. var objectPropertyIsEnumerable = {
  172. f: f$5
  173. };
  174. var createPropertyDescriptor = function (bitmap, value) {
  175. return {
  176. enumerable: !(bitmap & 1),
  177. configurable: !(bitmap & 2),
  178. writable: !(bitmap & 4),
  179. value: value
  180. };
  181. };
  182. var FunctionPrototype$1 = Function.prototype;
  183. var bind$1 = FunctionPrototype$1.bind;
  184. var call = FunctionPrototype$1.call;
  185. var uncurryThis = functionBindNative && bind$1.bind(call, call);
  186. var functionUncurryThis = functionBindNative ? function (fn) {
  187. return fn && uncurryThis(fn);
  188. } : function (fn) {
  189. return fn && function () {
  190. return call.apply(fn, arguments);
  191. };
  192. };
  193. var toString$1 = functionUncurryThis({}.toString);
  194. var stringSlice = functionUncurryThis(''.slice);
  195. var classofRaw = function (it) {
  196. return stringSlice(toString$1(it), 8, -1);
  197. };
  198. var Object$4 = global_1.Object;
  199. var split = functionUncurryThis(''.split);
  200. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  201. var indexedObject = fails(function () {
  202. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  203. // eslint-disable-next-line no-prototype-builtins -- safe
  204. return !Object$4('z').propertyIsEnumerable(0);
  205. }) ? function (it) {
  206. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  207. } : Object$4;
  208. var TypeError$8 = global_1.TypeError;
  209. // `RequireObjectCoercible` abstract operation
  210. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  211. var requireObjectCoercible = function (it) {
  212. if (it == undefined) throw TypeError$8("Can't call method on " + it);
  213. return it;
  214. };
  215. // toObject with fallback for non-array-like ES3 strings
  216. var toIndexedObject = function (it) {
  217. return indexedObject(requireObjectCoercible(it));
  218. };
  219. // `IsCallable` abstract operation
  220. // https://tc39.es/ecma262/#sec-iscallable
  221. var isCallable = function (argument) {
  222. return typeof argument == 'function';
  223. };
  224. var isObject = function (it) {
  225. return typeof it == 'object' ? it !== null : isCallable(it);
  226. };
  227. var aFunction = function (argument) {
  228. return isCallable(argument) ? argument : undefined;
  229. };
  230. var getBuiltIn = function (namespace, method) {
  231. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  232. };
  233. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  234. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  235. var process = global_1.process;
  236. var Deno = global_1.Deno;
  237. var versions = process && process.versions || Deno && Deno.version;
  238. var v8 = versions && versions.v8;
  239. var match, version;
  240. if (v8) {
  241. match = v8.split('.');
  242. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  243. // but their correct versions are not interesting for us
  244. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  245. }
  246. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  247. // so check `userAgent` even if `.v8` exists, but 0
  248. if (!version && engineUserAgent) {
  249. match = engineUserAgent.match(/Edge\/(\d+)/);
  250. if (!match || match[1] >= 74) {
  251. match = engineUserAgent.match(/Chrome\/(\d+)/);
  252. if (match) version = +match[1];
  253. }
  254. }
  255. var engineV8Version = version;
  256. /* eslint-disable es-x/no-symbol -- required for testing */
  257. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  258. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  259. var symbol = Symbol();
  260. // Chrome 38 Symbol has incorrect toString conversion
  261. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  262. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  263. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  264. !Symbol.sham && engineV8Version && engineV8Version < 41;
  265. });
  266. /* eslint-disable es-x/no-symbol -- required for testing */
  267. var useSymbolAsUid = nativeSymbol
  268. && !Symbol.sham
  269. && typeof Symbol.iterator == 'symbol';
  270. var Object$3 = global_1.Object;
  271. var isSymbol = useSymbolAsUid ? function (it) {
  272. return typeof it == 'symbol';
  273. } : function (it) {
  274. var $Symbol = getBuiltIn('Symbol');
  275. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  276. };
  277. var String$3 = global_1.String;
  278. var tryToString = function (argument) {
  279. try {
  280. return String$3(argument);
  281. } catch (error) {
  282. return 'Object';
  283. }
  284. };
  285. var TypeError$7 = global_1.TypeError;
  286. // `Assert: IsCallable(argument) is true`
  287. var aCallable = function (argument) {
  288. if (isCallable(argument)) return argument;
  289. throw TypeError$7(tryToString(argument) + ' is not a function');
  290. };
  291. // `GetMethod` abstract operation
  292. // https://tc39.es/ecma262/#sec-getmethod
  293. var getMethod = function (V, P) {
  294. var func = V[P];
  295. return func == null ? undefined : aCallable(func);
  296. };
  297. var TypeError$6 = global_1.TypeError;
  298. // `OrdinaryToPrimitive` abstract operation
  299. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  300. var ordinaryToPrimitive = function (input, pref) {
  301. var fn, val;
  302. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  303. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  304. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  305. throw TypeError$6("Can't convert object to primitive value");
  306. };
  307. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  308. var defineProperty = Object.defineProperty;
  309. var setGlobal = function (key, value) {
  310. try {
  311. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  312. } catch (error) {
  313. global_1[key] = value;
  314. } return value;
  315. };
  316. var SHARED = '__core-js_shared__';
  317. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  318. var sharedStore = store$1;
  319. var shared = createCommonjsModule(function (module) {
  320. (module.exports = function (key, value) {
  321. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  322. })('versions', []).push({
  323. version: '3.22.4',
  324. mode: 'global',
  325. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  326. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  327. source: 'https://github.com/zloirock/core-js'
  328. });
  329. });
  330. var Object$2 = global_1.Object;
  331. // `ToObject` abstract operation
  332. // https://tc39.es/ecma262/#sec-toobject
  333. var toObject = function (argument) {
  334. return Object$2(requireObjectCoercible(argument));
  335. };
  336. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  337. // `HasOwnProperty` abstract operation
  338. // https://tc39.es/ecma262/#sec-hasownproperty
  339. // eslint-disable-next-line es-x/no-object-hasown -- safe
  340. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  341. return hasOwnProperty(toObject(it), key);
  342. };
  343. var id = 0;
  344. var postfix = Math.random();
  345. var toString = functionUncurryThis(1.0.toString);
  346. var uid = function (key) {
  347. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  348. };
  349. var WellKnownSymbolsStore = shared('wks');
  350. var Symbol$2 = global_1.Symbol;
  351. var symbolFor = Symbol$2 && Symbol$2['for'];
  352. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  353. var wellKnownSymbol = function (name) {
  354. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  355. var description = 'Symbol.' + name;
  356. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  357. WellKnownSymbolsStore[name] = Symbol$2[name];
  358. } else if (useSymbolAsUid && symbolFor) {
  359. WellKnownSymbolsStore[name] = symbolFor(description);
  360. } else {
  361. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  362. }
  363. } return WellKnownSymbolsStore[name];
  364. };
  365. var TypeError$5 = global_1.TypeError;
  366. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  367. // `ToPrimitive` abstract operation
  368. // https://tc39.es/ecma262/#sec-toprimitive
  369. var toPrimitive = function (input, pref) {
  370. if (!isObject(input) || isSymbol(input)) return input;
  371. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  372. var result;
  373. if (exoticToPrim) {
  374. if (pref === undefined) pref = 'default';
  375. result = functionCall(exoticToPrim, input, pref);
  376. if (!isObject(result) || isSymbol(result)) return result;
  377. throw TypeError$5("Can't convert object to primitive value");
  378. }
  379. if (pref === undefined) pref = 'number';
  380. return ordinaryToPrimitive(input, pref);
  381. };
  382. // `ToPropertyKey` abstract operation
  383. // https://tc39.es/ecma262/#sec-topropertykey
  384. var toPropertyKey = function (argument) {
  385. var key = toPrimitive(argument, 'string');
  386. return isSymbol(key) ? key : key + '';
  387. };
  388. var document$1 = global_1.document;
  389. // typeof document.createElement is 'object' in old IE
  390. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  391. var documentCreateElement = function (it) {
  392. return EXISTS$1 ? document$1.createElement(it) : {};
  393. };
  394. // Thanks to IE8 for its funny defineProperty
  395. var ie8DomDefine = !descriptors && !fails(function () {
  396. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  397. return Object.defineProperty(documentCreateElement('div'), 'a', {
  398. get: function () { return 7; }
  399. }).a != 7;
  400. });
  401. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  402. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  403. // `Object.getOwnPropertyDescriptor` method
  404. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  405. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  406. O = toIndexedObject(O);
  407. P = toPropertyKey(P);
  408. if (ie8DomDefine) try {
  409. return $getOwnPropertyDescriptor$1(O, P);
  410. } catch (error) { /* empty */ }
  411. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  412. };
  413. var objectGetOwnPropertyDescriptor = {
  414. f: f$4
  415. };
  416. // V8 ~ Chrome 36-
  417. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  418. var v8PrototypeDefineBug = descriptors && fails(function () {
  419. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  420. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  421. value: 42,
  422. writable: false
  423. }).prototype != 42;
  424. });
  425. var String$2 = global_1.String;
  426. var TypeError$4 = global_1.TypeError;
  427. // `Assert: Type(argument) is Object`
  428. var anObject = function (argument) {
  429. if (isObject(argument)) return argument;
  430. throw TypeError$4(String$2(argument) + ' is not an object');
  431. };
  432. var TypeError$3 = global_1.TypeError;
  433. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  434. var $defineProperty = Object.defineProperty;
  435. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  436. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  437. var ENUMERABLE = 'enumerable';
  438. var CONFIGURABLE$1 = 'configurable';
  439. var WRITABLE = 'writable';
  440. // `Object.defineProperty` method
  441. // https://tc39.es/ecma262/#sec-object.defineproperty
  442. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  443. anObject(O);
  444. P = toPropertyKey(P);
  445. anObject(Attributes);
  446. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  447. var current = $getOwnPropertyDescriptor(O, P);
  448. if (current && current[WRITABLE]) {
  449. O[P] = Attributes.value;
  450. Attributes = {
  451. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  452. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  453. writable: false
  454. };
  455. }
  456. } return $defineProperty(O, P, Attributes);
  457. } : $defineProperty : function defineProperty(O, P, Attributes) {
  458. anObject(O);
  459. P = toPropertyKey(P);
  460. anObject(Attributes);
  461. if (ie8DomDefine) try {
  462. return $defineProperty(O, P, Attributes);
  463. } catch (error) { /* empty */ }
  464. if ('get' in Attributes || 'set' in Attributes) throw TypeError$3('Accessors not supported');
  465. if ('value' in Attributes) O[P] = Attributes.value;
  466. return O;
  467. };
  468. var objectDefineProperty = {
  469. f: f$3
  470. };
  471. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  472. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  473. } : function (object, key, value) {
  474. object[key] = value;
  475. return object;
  476. };
  477. var FunctionPrototype = Function.prototype;
  478. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  479. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  480. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  481. // additional protection from minified / mangled / dropped function names
  482. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  483. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  484. var functionName = {
  485. EXISTS: EXISTS,
  486. PROPER: PROPER,
  487. CONFIGURABLE: CONFIGURABLE
  488. };
  489. var functionToString = functionUncurryThis(Function.toString);
  490. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  491. if (!isCallable(sharedStore.inspectSource)) {
  492. sharedStore.inspectSource = function (it) {
  493. return functionToString(it);
  494. };
  495. }
  496. var inspectSource = sharedStore.inspectSource;
  497. var WeakMap$1 = global_1.WeakMap;
  498. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  499. var keys = shared('keys');
  500. var sharedKey = function (key) {
  501. return keys[key] || (keys[key] = uid(key));
  502. };
  503. var hiddenKeys$1 = {};
  504. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  505. var TypeError$2 = global_1.TypeError;
  506. var WeakMap = global_1.WeakMap;
  507. var set, get, has;
  508. var enforce = function (it) {
  509. return has(it) ? get(it) : set(it, {});
  510. };
  511. var getterFor = function (TYPE) {
  512. return function (it) {
  513. var state;
  514. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  515. throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  516. } return state;
  517. };
  518. };
  519. if (nativeWeakMap || sharedStore.state) {
  520. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  521. var wmget = functionUncurryThis(store.get);
  522. var wmhas = functionUncurryThis(store.has);
  523. var wmset = functionUncurryThis(store.set);
  524. set = function (it, metadata) {
  525. if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  526. metadata.facade = it;
  527. wmset(store, it, metadata);
  528. return metadata;
  529. };
  530. get = function (it) {
  531. return wmget(store, it) || {};
  532. };
  533. has = function (it) {
  534. return wmhas(store, it);
  535. };
  536. } else {
  537. var STATE = sharedKey('state');
  538. hiddenKeys$1[STATE] = true;
  539. set = function (it, metadata) {
  540. if (hasOwnProperty_1(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  541. metadata.facade = it;
  542. createNonEnumerableProperty(it, STATE, metadata);
  543. return metadata;
  544. };
  545. get = function (it) {
  546. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  547. };
  548. has = function (it) {
  549. return hasOwnProperty_1(it, STATE);
  550. };
  551. }
  552. var internalState = {
  553. set: set,
  554. get: get,
  555. has: has,
  556. enforce: enforce,
  557. getterFor: getterFor
  558. };
  559. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  560. var defineProperty = objectDefineProperty.f;
  561. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  562. var enforceInternalState = internalState.enforce;
  563. var getInternalState = internalState.get;
  564. var CONFIGURABLE_LENGTH = !fails(function () {
  565. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  566. });
  567. var TEMPLATE = String(String).split('String');
  568. var makeBuiltIn = module.exports = function (value, name, options) {
  569. if (String(name).slice(0, 7) === 'Symbol(') {
  570. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  571. }
  572. if (options && options.getter) name = 'get ' + name;
  573. if (options && options.setter) name = 'set ' + name;
  574. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  575. defineProperty(value, 'name', { value: name, configurable: true });
  576. }
  577. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  578. defineProperty(value, 'length', { value: options.arity });
  579. }
  580. var state = enforceInternalState(value);
  581. if (!hasOwnProperty_1(state, 'source')) {
  582. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  583. } return value;
  584. };
  585. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  586. // eslint-disable-next-line no-extend-native -- required
  587. Function.prototype.toString = makeBuiltIn(function toString() {
  588. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  589. }, 'toString');
  590. });
  591. var defineBuiltIn = function (O, key, value, options) {
  592. var unsafe = options ? !!options.unsafe : false;
  593. var simple = options ? !!options.enumerable : false;
  594. var noTargetGet = options ? !!options.noTargetGet : false;
  595. var name = options && options.name !== undefined ? options.name : key;
  596. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  597. if (O === global_1) {
  598. if (simple) O[key] = value;
  599. else setGlobal(key, value);
  600. return O;
  601. } else if (!unsafe) {
  602. delete O[key];
  603. } else if (!noTargetGet && O[key]) {
  604. simple = true;
  605. }
  606. if (simple) O[key] = value;
  607. else createNonEnumerableProperty(O, key, value);
  608. return O;
  609. };
  610. var ceil = Math.ceil;
  611. var floor = Math.floor;
  612. // `ToIntegerOrInfinity` abstract operation
  613. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  614. var toIntegerOrInfinity = function (argument) {
  615. var number = +argument;
  616. // eslint-disable-next-line no-self-compare -- safe
  617. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  618. };
  619. var max = Math.max;
  620. var min$1 = Math.min;
  621. // Helper for a popular repeating case of the spec:
  622. // Let integer be ? ToInteger(index).
  623. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  624. var toAbsoluteIndex = function (index, length) {
  625. var integer = toIntegerOrInfinity(index);
  626. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  627. };
  628. var min = Math.min;
  629. // `ToLength` abstract operation
  630. // https://tc39.es/ecma262/#sec-tolength
  631. var toLength = function (argument) {
  632. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  633. };
  634. // `LengthOfArrayLike` abstract operation
  635. // https://tc39.es/ecma262/#sec-lengthofarraylike
  636. var lengthOfArrayLike = function (obj) {
  637. return toLength(obj.length);
  638. };
  639. // `Array.prototype.{ indexOf, includes }` methods implementation
  640. var createMethod$2 = function (IS_INCLUDES) {
  641. return function ($this, el, fromIndex) {
  642. var O = toIndexedObject($this);
  643. var length = lengthOfArrayLike(O);
  644. var index = toAbsoluteIndex(fromIndex, length);
  645. var value;
  646. // Array#includes uses SameValueZero equality algorithm
  647. // eslint-disable-next-line no-self-compare -- NaN check
  648. if (IS_INCLUDES && el != el) while (length > index) {
  649. value = O[index++];
  650. // eslint-disable-next-line no-self-compare -- NaN check
  651. if (value != value) return true;
  652. // Array#indexOf ignores holes, Array#includes - not
  653. } else for (;length > index; index++) {
  654. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  655. } return !IS_INCLUDES && -1;
  656. };
  657. };
  658. var arrayIncludes = {
  659. // `Array.prototype.includes` method
  660. // https://tc39.es/ecma262/#sec-array.prototype.includes
  661. includes: createMethod$2(true),
  662. // `Array.prototype.indexOf` method
  663. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  664. indexOf: createMethod$2(false)
  665. };
  666. var indexOf = arrayIncludes.indexOf;
  667. var push$1 = functionUncurryThis([].push);
  668. var objectKeysInternal = function (object, names) {
  669. var O = toIndexedObject(object);
  670. var i = 0;
  671. var result = [];
  672. var key;
  673. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
  674. // Don't enum bug & hidden keys
  675. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  676. ~indexOf(result, key) || push$1(result, key);
  677. }
  678. return result;
  679. };
  680. // IE8- don't enum bug keys
  681. var enumBugKeys = [
  682. 'constructor',
  683. 'hasOwnProperty',
  684. 'isPrototypeOf',
  685. 'propertyIsEnumerable',
  686. 'toLocaleString',
  687. 'toString',
  688. 'valueOf'
  689. ];
  690. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  691. // `Object.getOwnPropertyNames` method
  692. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  693. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  694. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  695. return objectKeysInternal(O, hiddenKeys);
  696. };
  697. var objectGetOwnPropertyNames = {
  698. f: f$2
  699. };
  700. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  701. var f$1 = Object.getOwnPropertySymbols;
  702. var objectGetOwnPropertySymbols = {
  703. f: f$1
  704. };
  705. var concat = functionUncurryThis([].concat);
  706. // all object keys, includes non-enumerable and symbols
  707. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  708. var keys = objectGetOwnPropertyNames.f(anObject(it));
  709. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  710. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  711. };
  712. var copyConstructorProperties = function (target, source, exceptions) {
  713. var keys = ownKeys(source);
  714. var defineProperty = objectDefineProperty.f;
  715. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  716. for (var i = 0; i < keys.length; i++) {
  717. var key = keys[i];
  718. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  719. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  720. }
  721. }
  722. };
  723. var replacement = /#|\.prototype\./;
  724. var isForced = function (feature, detection) {
  725. var value = data[normalize(feature)];
  726. return value == POLYFILL ? true
  727. : value == NATIVE ? false
  728. : isCallable(detection) ? fails(detection)
  729. : !!detection;
  730. };
  731. var normalize = isForced.normalize = function (string) {
  732. return String(string).replace(replacement, '.').toLowerCase();
  733. };
  734. var data = isForced.data = {};
  735. var NATIVE = isForced.NATIVE = 'N';
  736. var POLYFILL = isForced.POLYFILL = 'P';
  737. var isForced_1 = isForced;
  738. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  739. /*
  740. options.target - name of the target object
  741. options.global - target is the global object
  742. options.stat - export as static methods of target
  743. options.proto - export as prototype methods of target
  744. options.real - real prototype method for the `pure` version
  745. options.forced - export even if the native feature is available
  746. options.bind - bind methods to the target, required for the `pure` version
  747. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  748. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  749. options.sham - add a flag to not completely full polyfills
  750. options.enumerable - export as enumerable property
  751. options.noTargetGet - prevent calling a getter on target
  752. options.name - the .name of the function if it does not match the key
  753. */
  754. var _export = function (options, source) {
  755. var TARGET = options.target;
  756. var GLOBAL = options.global;
  757. var STATIC = options.stat;
  758. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  759. if (GLOBAL) {
  760. target = global_1;
  761. } else if (STATIC) {
  762. target = global_1[TARGET] || setGlobal(TARGET, {});
  763. } else {
  764. target = (global_1[TARGET] || {}).prototype;
  765. }
  766. if (target) for (key in source) {
  767. sourceProperty = source[key];
  768. if (options.noTargetGet) {
  769. descriptor = getOwnPropertyDescriptor(target, key);
  770. targetProperty = descriptor && descriptor.value;
  771. } else targetProperty = target[key];
  772. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  773. // contained in target
  774. if (!FORCED && targetProperty !== undefined) {
  775. if (typeof sourceProperty == typeof targetProperty) continue;
  776. copyConstructorProperties(sourceProperty, targetProperty);
  777. }
  778. // add a flag to not completely full polyfills
  779. if (options.sham || (targetProperty && targetProperty.sham)) {
  780. createNonEnumerableProperty(sourceProperty, 'sham', true);
  781. }
  782. defineBuiltIn(target, key, sourceProperty, options);
  783. }
  784. };
  785. var bind = functionUncurryThis(functionUncurryThis.bind);
  786. // optional / simple context binding
  787. var functionBindContext = function (fn, that) {
  788. aCallable(fn);
  789. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  790. return fn.apply(that, arguments);
  791. };
  792. };
  793. // `IsArray` abstract operation
  794. // https://tc39.es/ecma262/#sec-isarray
  795. // eslint-disable-next-line es-x/no-array-isarray -- safe
  796. var isArray = Array.isArray || function isArray(argument) {
  797. return classofRaw(argument) == 'Array';
  798. };
  799. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  800. var test$1 = {};
  801. test$1[TO_STRING_TAG$1] = 'z';
  802. var toStringTagSupport = String(test$1) === '[object z]';
  803. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  804. var Object$1 = global_1.Object;
  805. // ES3 wrong here
  806. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  807. // fallback for IE11 Script Access Denied error
  808. var tryGet = function (it, key) {
  809. try {
  810. return it[key];
  811. } catch (error) { /* empty */ }
  812. };
  813. // getting tag from ES6+ `Object.prototype.toString`
  814. var classof = toStringTagSupport ? classofRaw : function (it) {
  815. var O, tag, result;
  816. return it === undefined ? 'Undefined' : it === null ? 'Null'
  817. // @@toStringTag case
  818. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  819. // builtinTag case
  820. : CORRECT_ARGUMENTS ? classofRaw(O)
  821. // ES3 arguments fallback
  822. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  823. };
  824. var noop = function () { /* empty */ };
  825. var empty = [];
  826. var construct = getBuiltIn('Reflect', 'construct');
  827. var constructorRegExp = /^\s*(?:class|function)\b/;
  828. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  829. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  830. var isConstructorModern = function isConstructor(argument) {
  831. if (!isCallable(argument)) return false;
  832. try {
  833. construct(noop, empty, argument);
  834. return true;
  835. } catch (error) {
  836. return false;
  837. }
  838. };
  839. var isConstructorLegacy = function isConstructor(argument) {
  840. if (!isCallable(argument)) return false;
  841. switch (classof(argument)) {
  842. case 'AsyncFunction':
  843. case 'GeneratorFunction':
  844. case 'AsyncGeneratorFunction': return false;
  845. }
  846. try {
  847. // we can't check .prototype since constructors produced by .bind haven't it
  848. // `Function#toString` throws on some built-it function in some legacy engines
  849. // (for example, `DOMQuad` and similar in FF41-)
  850. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  851. } catch (error) {
  852. return true;
  853. }
  854. };
  855. isConstructorLegacy.sham = true;
  856. // `IsConstructor` abstract operation
  857. // https://tc39.es/ecma262/#sec-isconstructor
  858. var isConstructor = !construct || fails(function () {
  859. var called;
  860. return isConstructorModern(isConstructorModern.call)
  861. || !isConstructorModern(Object)
  862. || !isConstructorModern(function () { called = true; })
  863. || called;
  864. }) ? isConstructorLegacy : isConstructorModern;
  865. var SPECIES$1 = wellKnownSymbol('species');
  866. var Array$1 = global_1.Array;
  867. // a part of `ArraySpeciesCreate` abstract operation
  868. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  869. var arraySpeciesConstructor = function (originalArray) {
  870. var C;
  871. if (isArray(originalArray)) {
  872. C = originalArray.constructor;
  873. // cross-realm fallback
  874. if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
  875. else if (isObject(C)) {
  876. C = C[SPECIES$1];
  877. if (C === null) C = undefined;
  878. }
  879. } return C === undefined ? Array$1 : C;
  880. };
  881. // `ArraySpeciesCreate` abstract operation
  882. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  883. var arraySpeciesCreate = function (originalArray, length) {
  884. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  885. };
  886. var push = functionUncurryThis([].push);
  887. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  888. var createMethod$1 = function (TYPE) {
  889. var IS_MAP = TYPE == 1;
  890. var IS_FILTER = TYPE == 2;
  891. var IS_SOME = TYPE == 3;
  892. var IS_EVERY = TYPE == 4;
  893. var IS_FIND_INDEX = TYPE == 6;
  894. var IS_FILTER_REJECT = TYPE == 7;
  895. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  896. return function ($this, callbackfn, that, specificCreate) {
  897. var O = toObject($this);
  898. var self = indexedObject(O);
  899. var boundFunction = functionBindContext(callbackfn, that);
  900. var length = lengthOfArrayLike(self);
  901. var index = 0;
  902. var create = specificCreate || arraySpeciesCreate;
  903. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  904. var value, result;
  905. for (;length > index; index++) if (NO_HOLES || index in self) {
  906. value = self[index];
  907. result = boundFunction(value, index, O);
  908. if (TYPE) {
  909. if (IS_MAP) target[index] = result; // map
  910. else if (result) switch (TYPE) {
  911. case 3: return true; // some
  912. case 5: return value; // find
  913. case 6: return index; // findIndex
  914. case 2: push(target, value); // filter
  915. } else switch (TYPE) {
  916. case 4: return false; // every
  917. case 7: push(target, value); // filterReject
  918. }
  919. }
  920. }
  921. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  922. };
  923. };
  924. var arrayIteration = {
  925. // `Array.prototype.forEach` method
  926. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  927. forEach: createMethod$1(0),
  928. // `Array.prototype.map` method
  929. // https://tc39.es/ecma262/#sec-array.prototype.map
  930. map: createMethod$1(1),
  931. // `Array.prototype.filter` method
  932. // https://tc39.es/ecma262/#sec-array.prototype.filter
  933. filter: createMethod$1(2),
  934. // `Array.prototype.some` method
  935. // https://tc39.es/ecma262/#sec-array.prototype.some
  936. some: createMethod$1(3),
  937. // `Array.prototype.every` method
  938. // https://tc39.es/ecma262/#sec-array.prototype.every
  939. every: createMethod$1(4),
  940. // `Array.prototype.find` method
  941. // https://tc39.es/ecma262/#sec-array.prototype.find
  942. find: createMethod$1(5),
  943. // `Array.prototype.findIndex` method
  944. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  945. findIndex: createMethod$1(6),
  946. // `Array.prototype.filterReject` method
  947. // https://github.com/tc39/proposal-array-filtering
  948. filterReject: createMethod$1(7)
  949. };
  950. // `Object.keys` method
  951. // https://tc39.es/ecma262/#sec-object.keys
  952. // eslint-disable-next-line es-x/no-object-keys -- safe
  953. var objectKeys = Object.keys || function keys(O) {
  954. return objectKeysInternal(O, enumBugKeys);
  955. };
  956. // `Object.defineProperties` method
  957. // https://tc39.es/ecma262/#sec-object.defineproperties
  958. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  959. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  960. anObject(O);
  961. var props = toIndexedObject(Properties);
  962. var keys = objectKeys(Properties);
  963. var length = keys.length;
  964. var index = 0;
  965. var key;
  966. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  967. return O;
  968. };
  969. var objectDefineProperties = {
  970. f: f
  971. };
  972. var html = getBuiltIn('document', 'documentElement');
  973. /* global ActiveXObject -- old IE, WSH */
  974. var GT = '>';
  975. var LT = '<';
  976. var PROTOTYPE = 'prototype';
  977. var SCRIPT = 'script';
  978. var IE_PROTO = sharedKey('IE_PROTO');
  979. var EmptyConstructor = function () { /* empty */ };
  980. var scriptTag = function (content) {
  981. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  982. };
  983. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  984. var NullProtoObjectViaActiveX = function (activeXDocument) {
  985. activeXDocument.write(scriptTag(''));
  986. activeXDocument.close();
  987. var temp = activeXDocument.parentWindow.Object;
  988. activeXDocument = null; // avoid memory leak
  989. return temp;
  990. };
  991. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  992. var NullProtoObjectViaIFrame = function () {
  993. // Thrash, waste and sodomy: IE GC bug
  994. var iframe = documentCreateElement('iframe');
  995. var JS = 'java' + SCRIPT + ':';
  996. var iframeDocument;
  997. iframe.style.display = 'none';
  998. html.appendChild(iframe);
  999. // https://github.com/zloirock/core-js/issues/475
  1000. iframe.src = String(JS);
  1001. iframeDocument = iframe.contentWindow.document;
  1002. iframeDocument.open();
  1003. iframeDocument.write(scriptTag('document.F=Object'));
  1004. iframeDocument.close();
  1005. return iframeDocument.F;
  1006. };
  1007. // Check for document.domain and active x support
  1008. // No need to use active x approach when document.domain is not set
  1009. // see https://github.com/es-shims/es5-shim/issues/150
  1010. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1011. // avoid IE GC bug
  1012. var activeXDocument;
  1013. var NullProtoObject = function () {
  1014. try {
  1015. activeXDocument = new ActiveXObject('htmlfile');
  1016. } catch (error) { /* ignore */ }
  1017. NullProtoObject = typeof document != 'undefined'
  1018. ? document.domain && activeXDocument
  1019. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1020. : NullProtoObjectViaIFrame()
  1021. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1022. var length = enumBugKeys.length;
  1023. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1024. return NullProtoObject();
  1025. };
  1026. hiddenKeys$1[IE_PROTO] = true;
  1027. // `Object.create` method
  1028. // https://tc39.es/ecma262/#sec-object.create
  1029. // eslint-disable-next-line es-x/no-object-create -- safe
  1030. var objectCreate = Object.create || function create(O, Properties) {
  1031. var result;
  1032. if (O !== null) {
  1033. EmptyConstructor[PROTOTYPE] = anObject(O);
  1034. result = new EmptyConstructor();
  1035. EmptyConstructor[PROTOTYPE] = null;
  1036. // add "__proto__" for Object.getPrototypeOf polyfill
  1037. result[IE_PROTO] = O;
  1038. } else result = NullProtoObject();
  1039. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  1040. };
  1041. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1042. var ArrayPrototype = Array.prototype;
  1043. // Array.prototype[@@unscopables]
  1044. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1045. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1046. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1047. configurable: true,
  1048. value: objectCreate(null)
  1049. });
  1050. }
  1051. // add a key to Array.prototype[@@unscopables]
  1052. var addToUnscopables = function (key) {
  1053. ArrayPrototype[UNSCOPABLES][key] = true;
  1054. };
  1055. var $find = arrayIteration.find;
  1056. var FIND = 'find';
  1057. var SKIPS_HOLES = true;
  1058. // Shouldn't skip holes
  1059. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1060. // `Array.prototype.find` method
  1061. // https://tc39.es/ecma262/#sec-array.prototype.find
  1062. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1063. find: function find(callbackfn /* , that = undefined */) {
  1064. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1065. }
  1066. });
  1067. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1068. addToUnscopables(FIND);
  1069. // `Object.prototype.toString` method implementation
  1070. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1071. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1072. return '[object ' + classof(this) + ']';
  1073. };
  1074. // `Object.prototype.toString` method
  1075. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1076. if (!toStringTagSupport) {
  1077. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  1078. }
  1079. var createProperty = function (object, key, value) {
  1080. var propertyKey = toPropertyKey(key);
  1081. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1082. else object[propertyKey] = value;
  1083. };
  1084. var SPECIES = wellKnownSymbol('species');
  1085. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1086. // We can't use this feature detection in V8 since it causes
  1087. // deoptimization and serious performance degradation
  1088. // https://github.com/zloirock/core-js/issues/677
  1089. return engineV8Version >= 51 || !fails(function () {
  1090. var array = [];
  1091. var constructor = array.constructor = {};
  1092. constructor[SPECIES] = function () {
  1093. return { foo: 1 };
  1094. };
  1095. return array[METHOD_NAME](Boolean).foo !== 1;
  1096. });
  1097. };
  1098. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1099. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1100. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1101. var TypeError$1 = global_1.TypeError;
  1102. // We can't use this feature detection in V8 since it causes
  1103. // deoptimization and serious performance degradation
  1104. // https://github.com/zloirock/core-js/issues/679
  1105. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1106. var array = [];
  1107. array[IS_CONCAT_SPREADABLE] = false;
  1108. return array.concat()[0] !== array;
  1109. });
  1110. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1111. var isConcatSpreadable = function (O) {
  1112. if (!isObject(O)) return false;
  1113. var spreadable = O[IS_CONCAT_SPREADABLE];
  1114. return spreadable !== undefined ? !!spreadable : isArray(O);
  1115. };
  1116. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1117. // `Array.prototype.concat` method
  1118. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1119. // with adding support of @@isConcatSpreadable and @@species
  1120. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
  1121. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1122. concat: function concat(arg) {
  1123. var O = toObject(this);
  1124. var A = arraySpeciesCreate(O, 0);
  1125. var n = 0;
  1126. var i, k, length, len, E;
  1127. for (i = -1, length = arguments.length; i < length; i++) {
  1128. E = i === -1 ? O : arguments[i];
  1129. if (isConcatSpreadable(E)) {
  1130. len = lengthOfArrayLike(E);
  1131. if (n + len > MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1132. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1133. } else {
  1134. if (n >= MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1135. createProperty(A, n++, E);
  1136. }
  1137. }
  1138. A.length = n;
  1139. return A;
  1140. }
  1141. });
  1142. var un$Reverse = functionUncurryThis([].reverse);
  1143. var test = [1, 2];
  1144. // `Array.prototype.reverse` method
  1145. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  1146. // fix for Safari 12.0 bug
  1147. // https://bugs.webkit.org/show_bug.cgi?id=188794
  1148. _export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
  1149. reverse: function reverse() {
  1150. // eslint-disable-next-line no-self-assign -- dirty hack
  1151. if (isArray(this)) this.length = this.length;
  1152. return un$Reverse(this);
  1153. }
  1154. });
  1155. var String$1 = global_1.String;
  1156. var toString_1 = function (argument) {
  1157. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1158. return String$1(argument);
  1159. };
  1160. // a string of all valid unicode whitespaces
  1161. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1162. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1163. var replace = functionUncurryThis(''.replace);
  1164. var whitespace = '[' + whitespaces + ']';
  1165. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1166. var rtrim = RegExp(whitespace + whitespace + '*$');
  1167. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1168. var createMethod = function (TYPE) {
  1169. return function ($this) {
  1170. var string = toString_1(requireObjectCoercible($this));
  1171. if (TYPE & 1) string = replace(string, ltrim, '');
  1172. if (TYPE & 2) string = replace(string, rtrim, '');
  1173. return string;
  1174. };
  1175. };
  1176. var stringTrim = {
  1177. // `String.prototype.{ trimLeft, trimStart }` methods
  1178. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1179. start: createMethod(1),
  1180. // `String.prototype.{ trimRight, trimEnd }` methods
  1181. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1182. end: createMethod(2),
  1183. // `String.prototype.trim` method
  1184. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1185. trim: createMethod(3)
  1186. };
  1187. var trim = stringTrim.trim;
  1188. var $parseInt = global_1.parseInt;
  1189. var Symbol$1 = global_1.Symbol;
  1190. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  1191. var hex = /^[+-]?0x/i;
  1192. var exec = functionUncurryThis(hex.exec);
  1193. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
  1194. // MS Edge 18- broken with boxed symbols
  1195. || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
  1196. // `parseInt` method
  1197. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1198. var numberParseInt = FORCED ? function parseInt(string, radix) {
  1199. var S = trim(toString_1(string));
  1200. return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
  1201. } : $parseInt;
  1202. // `parseInt` method
  1203. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1204. _export({ global: true, forced: parseInt != numberParseInt }, {
  1205. parseInt: numberParseInt
  1206. });
  1207. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1208. var method = [][METHOD_NAME];
  1209. return !!method && fails(function () {
  1210. // eslint-disable-next-line no-useless-call -- required for testing
  1211. method.call(null, argument || function () { return 1; }, 1);
  1212. });
  1213. };
  1214. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  1215. var $IndexOf = arrayIncludes.indexOf;
  1216. var un$IndexOf = functionUncurryThis([].indexOf);
  1217. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1218. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1219. // `Array.prototype.indexOf` method
  1220. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1221. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1222. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1223. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1224. return NEGATIVE_ZERO
  1225. // convert -0 to +0
  1226. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1227. : $IndexOf(this, searchElement, fromIndex);
  1228. }
  1229. });
  1230. /**
  1231. * @author zhixin wen <wenzhixin2010@gmail.com>
  1232. */
  1233. var Utils = $__default["default"].fn.bootstrapTable.utils; // Reasonable defaults
  1234. var PIXEL_STEP = 10;
  1235. var LINE_HEIGHT = 40;
  1236. var PAGE_HEIGHT = 800;
  1237. function normalizeWheel(event) {
  1238. var sX = 0; // spinX
  1239. var sY = 0; // spinY
  1240. var pX = 0; // pixelX
  1241. var pY = 0; // pixelY
  1242. // Legacy
  1243. if ('detail' in event) {
  1244. sY = event.detail;
  1245. }
  1246. if ('wheelDelta' in event) {
  1247. sY = -event.wheelDelta / 120;
  1248. }
  1249. if ('wheelDeltaY' in event) {
  1250. sY = -event.wheelDeltaY / 120;
  1251. }
  1252. if ('wheelDeltaX' in event) {
  1253. sX = -event.wheelDeltaX / 120;
  1254. } // side scrolling on FF with DOMMouseScroll
  1255. if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
  1256. sX = sY;
  1257. sY = 0;
  1258. }
  1259. pX = sX * PIXEL_STEP;
  1260. pY = sY * PIXEL_STEP;
  1261. if ('deltaY' in event) {
  1262. pY = event.deltaY;
  1263. }
  1264. if ('deltaX' in event) {
  1265. pX = event.deltaX;
  1266. }
  1267. if ((pX || pY) && event.deltaMode) {
  1268. if (event.deltaMode === 1) {
  1269. // delta in LINE units
  1270. pX *= LINE_HEIGHT;
  1271. pY *= LINE_HEIGHT;
  1272. } else {
  1273. // delta in PAGE units
  1274. pX *= PAGE_HEIGHT;
  1275. pY *= PAGE_HEIGHT;
  1276. }
  1277. } // Fall-back if spin cannot be determined
  1278. if (pX && !sX) {
  1279. sX = pX < 1 ? -1 : 1;
  1280. }
  1281. if (pY && !sY) {
  1282. sY = pY < 1 ? -1 : 1;
  1283. }
  1284. return {
  1285. spinX: sX,
  1286. spinY: sY,
  1287. pixelX: pX,
  1288. pixelY: pY
  1289. };
  1290. }
  1291. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1292. fixedColumns: false,
  1293. fixedNumber: 0,
  1294. fixedRightNumber: 0
  1295. });
  1296. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1297. _inherits(_class, _$$BootstrapTable);
  1298. var _super = _createSuper(_class);
  1299. function _class() {
  1300. _classCallCheck(this, _class);
  1301. return _super.apply(this, arguments);
  1302. }
  1303. _createClass(_class, [{
  1304. key: "fixedColumnsSupported",
  1305. value: function fixedColumnsSupported() {
  1306. return this.options.fixedColumns && !this.options.detailView && !this.options.cardView;
  1307. }
  1308. }, {
  1309. key: "initContainer",
  1310. value: function initContainer() {
  1311. _get(_getPrototypeOf(_class.prototype), "initContainer", this).call(this);
  1312. if (!this.fixedColumnsSupported()) {
  1313. return;
  1314. }
  1315. if (this.options.fixedNumber) {
  1316. this.$tableContainer.append('<div class="fixed-columns"></div>');
  1317. this.$fixedColumns = this.$tableContainer.find('.fixed-columns');
  1318. }
  1319. if (this.options.fixedRightNumber) {
  1320. this.$tableContainer.append('<div class="fixed-columns-right"></div>');
  1321. this.$fixedColumnsRight = this.$tableContainer.find('.fixed-columns-right');
  1322. }
  1323. }
  1324. }, {
  1325. key: "initBody",
  1326. value: function initBody() {
  1327. var _get2;
  1328. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1329. args[_key] = arguments[_key];
  1330. }
  1331. (_get2 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get2, [this].concat(args));
  1332. if (this.$fixedColumns && this.$fixedColumns.length) {
  1333. this.$fixedColumns.toggle(this.fixedColumnsSupported());
  1334. }
  1335. if (this.$fixedColumnsRight && this.$fixedColumnsRight.length) {
  1336. this.$fixedColumnsRight.toggle(this.fixedColumnsSupported());
  1337. }
  1338. if (!this.fixedColumnsSupported()) {
  1339. return;
  1340. }
  1341. if (this.options.showHeader && this.options.height) {
  1342. return;
  1343. }
  1344. this.initFixedColumnsBody();
  1345. this.initFixedColumnsEvents();
  1346. }
  1347. }, {
  1348. key: "trigger",
  1349. value: function trigger() {
  1350. var _get3;
  1351. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1352. args[_key2] = arguments[_key2];
  1353. }
  1354. (_get3 = _get(_getPrototypeOf(_class.prototype), "trigger", this)).call.apply(_get3, [this].concat(args));
  1355. if (!this.fixedColumnsSupported()) {
  1356. return;
  1357. }
  1358. if (args[0] === 'post-header') {
  1359. this.initFixedColumnsHeader();
  1360. } else if (args[0] === 'scroll-body') {
  1361. if (this.needFixedColumns && this.options.fixedNumber) {
  1362. this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
  1363. }
  1364. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1365. this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
  1366. }
  1367. }
  1368. }
  1369. }, {
  1370. key: "updateSelected",
  1371. value: function updateSelected() {
  1372. var _this = this;
  1373. _get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
  1374. if (!this.fixedColumnsSupported()) {
  1375. return;
  1376. }
  1377. this.$tableBody.find('tr').each(function (i, el) {
  1378. var $el = $__default["default"](el);
  1379. var index = $el.data('index');
  1380. var classes = $el.attr('class');
  1381. var inputSelector = "[name=\"".concat(_this.options.selectItemName, "\"]");
  1382. var $input = $el.find(inputSelector);
  1383. if (typeof index === 'undefined') {
  1384. return;
  1385. }
  1386. var updateFixedBody = function updateFixedBody($fixedHeader, $fixedBody) {
  1387. var $tr = $fixedBody.find("tr[data-index=\"".concat(index, "\"]"));
  1388. $tr.attr('class', classes);
  1389. if ($input.length) {
  1390. $tr.find(inputSelector).prop('checked', $input.prop('checked'));
  1391. }
  1392. if (_this.$selectAll.length) {
  1393. $fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', _this.$selectAll.prop('checked'));
  1394. }
  1395. };
  1396. if (_this.$fixedBody && _this.options.fixedNumber) {
  1397. updateFixedBody(_this.$fixedHeader, _this.$fixedBody);
  1398. }
  1399. if (_this.$fixedBodyRight && _this.options.fixedRightNumber) {
  1400. updateFixedBody(_this.$fixedHeaderRight, _this.$fixedBodyRight);
  1401. }
  1402. });
  1403. }
  1404. }, {
  1405. key: "hideLoading",
  1406. value: function hideLoading() {
  1407. _get(_getPrototypeOf(_class.prototype), "hideLoading", this).call(this);
  1408. if (this.needFixedColumns && this.options.fixedNumber) {
  1409. this.$fixedColumns.find('.fixed-table-loading').hide();
  1410. }
  1411. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1412. this.$fixedColumnsRight.find('.fixed-table-loading').hide();
  1413. }
  1414. }
  1415. }, {
  1416. key: "initFixedColumnsHeader",
  1417. value: function initFixedColumnsHeader() {
  1418. var _this2 = this;
  1419. if (this.options.height) {
  1420. this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true);
  1421. } else {
  1422. this.needFixedColumns = this.$tableBody.outerWidth(true) < this.$tableBody.find('table').outerWidth(true);
  1423. }
  1424. var initFixedHeader = function initFixedHeader($fixedColumns, isRight) {
  1425. $fixedColumns.find('.fixed-table-header').remove();
  1426. $fixedColumns.append(_this2.$tableHeader.clone(true));
  1427. $fixedColumns.css({
  1428. width: _this2.getFixedColumnsWidth(isRight)
  1429. });
  1430. return $fixedColumns.find('.fixed-table-header');
  1431. };
  1432. if (this.needFixedColumns && this.options.fixedNumber) {
  1433. this.$fixedHeader = initFixedHeader(this.$fixedColumns);
  1434. this.$fixedHeader.css('margin-right', '');
  1435. } else if (this.$fixedColumns) {
  1436. this.$fixedColumns.html('').css('width', '');
  1437. }
  1438. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1439. this.$fixedHeaderRight = initFixedHeader(this.$fixedColumnsRight, true);
  1440. this.$fixedHeaderRight.scrollLeft(this.$fixedHeaderRight.find('table').width());
  1441. } else if (this.$fixedColumnsRight) {
  1442. this.$fixedColumnsRight.html('').css('width', '');
  1443. }
  1444. this.initFixedColumnsBody();
  1445. this.initFixedColumnsEvents();
  1446. }
  1447. }, {
  1448. key: "initFixedColumnsBody",
  1449. value: function initFixedColumnsBody() {
  1450. var _this3 = this;
  1451. var initFixedBody = function initFixedBody($fixedColumns, $fixedHeader) {
  1452. $fixedColumns.find('.fixed-table-body').remove();
  1453. $fixedColumns.append(_this3.$tableBody.clone(true));
  1454. $fixedColumns.find('.fixed-table-body table').removeAttr('id');
  1455. var $fixedBody = $fixedColumns.find('.fixed-table-body');
  1456. var tableBody = _this3.$tableBody.get(0);
  1457. var scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? Utils.getScrollBarWidth() : 0;
  1458. var height = _this3.$tableContainer.outerHeight(true) - scrollHeight - 1;
  1459. $fixedColumns.css({
  1460. height: height
  1461. });
  1462. $fixedBody.css({
  1463. height: height - $fixedHeader.height()
  1464. });
  1465. return $fixedBody;
  1466. };
  1467. if (this.needFixedColumns && this.options.fixedNumber) {
  1468. this.$fixedBody = initFixedBody(this.$fixedColumns, this.$fixedHeader);
  1469. }
  1470. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1471. this.$fixedBodyRight = initFixedBody(this.$fixedColumnsRight, this.$fixedHeaderRight);
  1472. this.$fixedBodyRight.scrollLeft(this.$fixedBodyRight.find('table').width());
  1473. this.$fixedBodyRight.css('overflow-y', this.options.height ? 'auto' : 'hidden');
  1474. }
  1475. }
  1476. }, {
  1477. key: "getFixedColumnsWidth",
  1478. value: function getFixedColumnsWidth(isRight) {
  1479. var visibleFields = this.getVisibleFields();
  1480. var width = 0;
  1481. var fixedNumber = this.options.fixedNumber;
  1482. var marginRight = 0;
  1483. if (isRight) {
  1484. visibleFields = visibleFields.reverse();
  1485. fixedNumber = this.options.fixedRightNumber;
  1486. marginRight = parseInt(this.$tableHeader.css('margin-right'), 10);
  1487. }
  1488. for (var i = 0; i < fixedNumber; i++) {
  1489. width += this.$header.find("th[data-field=\"".concat(visibleFields[i], "\"]")).outerWidth(true);
  1490. }
  1491. return width + marginRight + 1;
  1492. }
  1493. }, {
  1494. key: "initFixedColumnsEvents",
  1495. value: function initFixedColumnsEvents() {
  1496. var _this4 = this;
  1497. var toggleHover = function toggleHover(e, toggle) {
  1498. var tr = "tr[data-index=\"".concat($__default["default"](e.currentTarget).data('index'), "\"]");
  1499. var $trs = _this4.$tableBody.find(tr);
  1500. if (_this4.$fixedBody) {
  1501. $trs = $trs.add(_this4.$fixedBody.find(tr));
  1502. }
  1503. if (_this4.$fixedBodyRight) {
  1504. $trs = $trs.add(_this4.$fixedBodyRight.find(tr));
  1505. }
  1506. $trs.css('background-color', toggle ? $__default["default"](e.currentTarget).css('background-color') : '');
  1507. };
  1508. this.$tableBody.find('tr').hover(function (e) {
  1509. toggleHover(e, true);
  1510. }, function (e) {
  1511. toggleHover(e, false);
  1512. });
  1513. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  1514. var mousewheel = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
  1515. var updateScroll = function updateScroll(e, fixedBody) {
  1516. var normalized = normalizeWheel(e);
  1517. var deltaY = Math.ceil(normalized.pixelY);
  1518. var top = _this4.$tableBody.scrollTop() + deltaY;
  1519. if (deltaY < 0 && top > 0 || deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight) {
  1520. e.preventDefault();
  1521. }
  1522. _this4.$tableBody.scrollTop(top);
  1523. if (_this4.$fixedBody) {
  1524. _this4.$fixedBody.scrollTop(top);
  1525. }
  1526. if (_this4.$fixedBodyRight) {
  1527. _this4.$fixedBodyRight.scrollTop(top);
  1528. }
  1529. };
  1530. if (this.needFixedColumns && this.options.fixedNumber) {
  1531. this.$fixedBody.find('tr').hover(function (e) {
  1532. toggleHover(e, true);
  1533. }, function (e) {
  1534. toggleHover(e, false);
  1535. });
  1536. this.$fixedBody[0].addEventListener(mousewheel, function (e) {
  1537. updateScroll(e, _this4.$fixedBody[0]);
  1538. });
  1539. }
  1540. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1541. this.$fixedBodyRight.find('tr').hover(function (e) {
  1542. toggleHover(e, true);
  1543. }, function (e) {
  1544. toggleHover(e, false);
  1545. });
  1546. this.$fixedBodyRight.off('scroll').on('scroll', function () {
  1547. var top = _this4.$fixedBodyRight.scrollTop();
  1548. _this4.$tableBody.scrollTop(top);
  1549. if (_this4.$fixedBody) {
  1550. _this4.$fixedBody.scrollTop(top);
  1551. }
  1552. });
  1553. }
  1554. if (this.options.filterControl) {
  1555. $__default["default"](this.$fixedColumns).off('keyup change').on('keyup change', function (e) {
  1556. var $target = $__default["default"](e.target);
  1557. var value = $target.val();
  1558. var field = $target.parents('th').data('field');
  1559. var $coreTh = _this4.$header.find("th[data-field=\"".concat(field, "\"]"));
  1560. if ($target.is('input')) {
  1561. $coreTh.find('input').val(value);
  1562. } else if ($target.is('select')) {
  1563. var $select = $coreTh.find('select');
  1564. $select.find('option[selected]').removeAttr('selected');
  1565. $select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  1566. }
  1567. _this4.triggerSearch();
  1568. });
  1569. }
  1570. }
  1571. }, {
  1572. key: "renderStickyHeader",
  1573. value: function renderStickyHeader() {
  1574. if (!this.options.stickyHeader) {
  1575. return;
  1576. }
  1577. this.$stickyContainer = this.$container.find('.sticky-header-container');
  1578. _get(_getPrototypeOf(_class.prototype), "renderStickyHeader", this).call(this);
  1579. if (this.needFixedColumns && this.options.fixedNumber) {
  1580. this.$fixedColumns.css('z-index', 101).find('.sticky-header-container').css('right', '').width(this.$fixedColumns.outerWidth());
  1581. }
  1582. if (this.needFixedColumns && this.options.fixedRightNumber) {
  1583. var $stickyHeaderContainerRight = this.$fixedColumnsRight.find('.sticky-header-container');
  1584. this.$fixedColumnsRight.css('z-index', 101);
  1585. $stickyHeaderContainerRight.css('left', '').scrollLeft($stickyHeaderContainerRight.find('.table').outerWidth()).width(this.$fixedColumnsRight.outerWidth());
  1586. }
  1587. }
  1588. }, {
  1589. key: "matchPositionX",
  1590. value: function matchPositionX() {
  1591. if (!this.options.stickyHeader) {
  1592. return;
  1593. }
  1594. this.$stickyContainer.eq(0).scrollLeft(this.$tableBody.scrollLeft());
  1595. }
  1596. }]);
  1597. return _class;
  1598. }($__default["default"].BootstrapTable);
  1599. }));