bootstrap-table-treegrid.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191
  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. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. function _unsupportedIterableToArray(o, minLen) {
  114. if (!o) return;
  115. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  116. var n = Object.prototype.toString.call(o).slice(8, -1);
  117. if (n === "Object" && o.constructor) n = o.constructor.name;
  118. if (n === "Map" || n === "Set") return Array.from(o);
  119. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  120. }
  121. function _arrayLikeToArray(arr, len) {
  122. if (len == null || len > arr.length) len = arr.length;
  123. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  124. return arr2;
  125. }
  126. function _createForOfIteratorHelper(o, allowArrayLike) {
  127. var it;
  128. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  129. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  130. if (it) o = it;
  131. var i = 0;
  132. var F = function () {};
  133. return {
  134. s: F,
  135. n: function () {
  136. if (i >= o.length) return {
  137. done: true
  138. };
  139. return {
  140. done: false,
  141. value: o[i++]
  142. };
  143. },
  144. e: function (e) {
  145. throw e;
  146. },
  147. f: F
  148. };
  149. }
  150. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  151. }
  152. var normalCompletion = true,
  153. didErr = false,
  154. err;
  155. return {
  156. s: function () {
  157. it = o[Symbol.iterator]();
  158. },
  159. n: function () {
  160. var step = it.next();
  161. normalCompletion = step.done;
  162. return step;
  163. },
  164. e: function (e) {
  165. didErr = true;
  166. err = e;
  167. },
  168. f: function () {
  169. try {
  170. if (!normalCompletion && it.return != null) it.return();
  171. } finally {
  172. if (didErr) throw err;
  173. }
  174. }
  175. };
  176. }
  177. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  178. function createCommonjsModule(fn, module) {
  179. return module = { exports: {} }, fn(module, module.exports), module.exports;
  180. }
  181. var check = function (it) {
  182. return it && it.Math == Math && it;
  183. };
  184. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  185. var global_1 =
  186. /* global globalThis -- safe */
  187. check(typeof globalThis == 'object' && globalThis) ||
  188. check(typeof window == 'object' && window) ||
  189. check(typeof self == 'object' && self) ||
  190. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  191. // eslint-disable-next-line no-new-func -- fallback
  192. (function () { return this; })() || Function('return this')();
  193. var fails = function (exec) {
  194. try {
  195. return !!exec();
  196. } catch (error) {
  197. return true;
  198. }
  199. };
  200. // Detect IE8's incomplete defineProperty implementation
  201. var descriptors = !fails(function () {
  202. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  203. });
  204. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  205. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  206. // Nashorn ~ JDK8 bug
  207. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  208. // `Object.prototype.propertyIsEnumerable` method implementation
  209. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  210. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  211. var descriptor = getOwnPropertyDescriptor$1(this, V);
  212. return !!descriptor && descriptor.enumerable;
  213. } : nativePropertyIsEnumerable;
  214. var objectPropertyIsEnumerable = {
  215. f: f$4
  216. };
  217. var createPropertyDescriptor = function (bitmap, value) {
  218. return {
  219. enumerable: !(bitmap & 1),
  220. configurable: !(bitmap & 2),
  221. writable: !(bitmap & 4),
  222. value: value
  223. };
  224. };
  225. var toString = {}.toString;
  226. var classofRaw = function (it) {
  227. return toString.call(it).slice(8, -1);
  228. };
  229. var split = ''.split;
  230. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  231. var indexedObject = fails(function () {
  232. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  233. // eslint-disable-next-line no-prototype-builtins -- safe
  234. return !Object('z').propertyIsEnumerable(0);
  235. }) ? function (it) {
  236. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  237. } : Object;
  238. // `RequireObjectCoercible` abstract operation
  239. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  240. var requireObjectCoercible = function (it) {
  241. if (it == undefined) throw TypeError("Can't call method on " + it);
  242. return it;
  243. };
  244. // toObject with fallback for non-array-like ES3 strings
  245. var toIndexedObject = function (it) {
  246. return indexedObject(requireObjectCoercible(it));
  247. };
  248. var isObject = function (it) {
  249. return typeof it === 'object' ? it !== null : typeof it === 'function';
  250. };
  251. // `ToPrimitive` abstract operation
  252. // https://tc39.es/ecma262/#sec-toprimitive
  253. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  254. // and the second argument - flag - preferred type is a string
  255. var toPrimitive = function (input, PREFERRED_STRING) {
  256. if (!isObject(input)) return input;
  257. var fn, val;
  258. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  259. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  260. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  261. throw TypeError("Can't convert object to primitive value");
  262. };
  263. var hasOwnProperty = {}.hasOwnProperty;
  264. var has$1 = function (it, key) {
  265. return hasOwnProperty.call(it, key);
  266. };
  267. var document = global_1.document;
  268. // typeof document.createElement is 'object' in old IE
  269. var EXISTS = isObject(document) && isObject(document.createElement);
  270. var documentCreateElement = function (it) {
  271. return EXISTS ? document.createElement(it) : {};
  272. };
  273. // Thank's IE8 for his funny defineProperty
  274. var ie8DomDefine = !descriptors && !fails(function () {
  275. return Object.defineProperty(documentCreateElement('div'), 'a', {
  276. get: function () { return 7; }
  277. }).a != 7;
  278. });
  279. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  280. // `Object.getOwnPropertyDescriptor` method
  281. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  282. var f$3 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  283. O = toIndexedObject(O);
  284. P = toPrimitive(P, true);
  285. if (ie8DomDefine) try {
  286. return nativeGetOwnPropertyDescriptor(O, P);
  287. } catch (error) { /* empty */ }
  288. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  289. };
  290. var objectGetOwnPropertyDescriptor = {
  291. f: f$3
  292. };
  293. var anObject = function (it) {
  294. if (!isObject(it)) {
  295. throw TypeError(String(it) + ' is not an object');
  296. } return it;
  297. };
  298. var nativeDefineProperty = Object.defineProperty;
  299. // `Object.defineProperty` method
  300. // https://tc39.es/ecma262/#sec-object.defineproperty
  301. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  302. anObject(O);
  303. P = toPrimitive(P, true);
  304. anObject(Attributes);
  305. if (ie8DomDefine) try {
  306. return nativeDefineProperty(O, P, Attributes);
  307. } catch (error) { /* empty */ }
  308. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  309. if ('value' in Attributes) O[P] = Attributes.value;
  310. return O;
  311. };
  312. var objectDefineProperty = {
  313. f: f$2
  314. };
  315. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  316. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  317. } : function (object, key, value) {
  318. object[key] = value;
  319. return object;
  320. };
  321. var setGlobal = function (key, value) {
  322. try {
  323. createNonEnumerableProperty(global_1, key, value);
  324. } catch (error) {
  325. global_1[key] = value;
  326. } return value;
  327. };
  328. var SHARED = '__core-js_shared__';
  329. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  330. var sharedStore = store$1;
  331. var functionToString = Function.toString;
  332. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  333. if (typeof sharedStore.inspectSource != 'function') {
  334. sharedStore.inspectSource = function (it) {
  335. return functionToString.call(it);
  336. };
  337. }
  338. var inspectSource = sharedStore.inspectSource;
  339. var WeakMap$1 = global_1.WeakMap;
  340. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  341. var shared = createCommonjsModule(function (module) {
  342. (module.exports = function (key, value) {
  343. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  344. })('versions', []).push({
  345. version: '3.9.1',
  346. mode: 'global',
  347. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  348. });
  349. });
  350. var id = 0;
  351. var postfix = Math.random();
  352. var uid = function (key) {
  353. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  354. };
  355. var keys = shared('keys');
  356. var sharedKey = function (key) {
  357. return keys[key] || (keys[key] = uid(key));
  358. };
  359. var hiddenKeys$1 = {};
  360. var WeakMap = global_1.WeakMap;
  361. var set, get, has;
  362. var enforce = function (it) {
  363. return has(it) ? get(it) : set(it, {});
  364. };
  365. var getterFor = function (TYPE) {
  366. return function (it) {
  367. var state;
  368. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  369. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  370. } return state;
  371. };
  372. };
  373. if (nativeWeakMap) {
  374. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  375. var wmget = store.get;
  376. var wmhas = store.has;
  377. var wmset = store.set;
  378. set = function (it, metadata) {
  379. metadata.facade = it;
  380. wmset.call(store, it, metadata);
  381. return metadata;
  382. };
  383. get = function (it) {
  384. return wmget.call(store, it) || {};
  385. };
  386. has = function (it) {
  387. return wmhas.call(store, it);
  388. };
  389. } else {
  390. var STATE = sharedKey('state');
  391. hiddenKeys$1[STATE] = true;
  392. set = function (it, metadata) {
  393. metadata.facade = it;
  394. createNonEnumerableProperty(it, STATE, metadata);
  395. return metadata;
  396. };
  397. get = function (it) {
  398. return has$1(it, STATE) ? it[STATE] : {};
  399. };
  400. has = function (it) {
  401. return has$1(it, STATE);
  402. };
  403. }
  404. var internalState = {
  405. set: set,
  406. get: get,
  407. has: has,
  408. enforce: enforce,
  409. getterFor: getterFor
  410. };
  411. var redefine = createCommonjsModule(function (module) {
  412. var getInternalState = internalState.get;
  413. var enforceInternalState = internalState.enforce;
  414. var TEMPLATE = String(String).split('String');
  415. (module.exports = function (O, key, value, options) {
  416. var unsafe = options ? !!options.unsafe : false;
  417. var simple = options ? !!options.enumerable : false;
  418. var noTargetGet = options ? !!options.noTargetGet : false;
  419. var state;
  420. if (typeof value == 'function') {
  421. if (typeof key == 'string' && !has$1(value, 'name')) {
  422. createNonEnumerableProperty(value, 'name', key);
  423. }
  424. state = enforceInternalState(value);
  425. if (!state.source) {
  426. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  427. }
  428. }
  429. if (O === global_1) {
  430. if (simple) O[key] = value;
  431. else setGlobal(key, value);
  432. return;
  433. } else if (!unsafe) {
  434. delete O[key];
  435. } else if (!noTargetGet && O[key]) {
  436. simple = true;
  437. }
  438. if (simple) O[key] = value;
  439. else createNonEnumerableProperty(O, key, value);
  440. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  441. })(Function.prototype, 'toString', function toString() {
  442. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  443. });
  444. });
  445. var path = global_1;
  446. var aFunction$1 = function (variable) {
  447. return typeof variable == 'function' ? variable : undefined;
  448. };
  449. var getBuiltIn = function (namespace, method) {
  450. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  451. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  452. };
  453. var ceil = Math.ceil;
  454. var floor = Math.floor;
  455. // `ToInteger` abstract operation
  456. // https://tc39.es/ecma262/#sec-tointeger
  457. var toInteger = function (argument) {
  458. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  459. };
  460. var min$1 = Math.min;
  461. // `ToLength` abstract operation
  462. // https://tc39.es/ecma262/#sec-tolength
  463. var toLength = function (argument) {
  464. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  465. };
  466. var max = Math.max;
  467. var min = Math.min;
  468. // Helper for a popular repeating case of the spec:
  469. // Let integer be ? ToInteger(index).
  470. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  471. var toAbsoluteIndex = function (index, length) {
  472. var integer = toInteger(index);
  473. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  474. };
  475. // `Array.prototype.{ indexOf, includes }` methods implementation
  476. var createMethod$1 = function (IS_INCLUDES) {
  477. return function ($this, el, fromIndex) {
  478. var O = toIndexedObject($this);
  479. var length = toLength(O.length);
  480. var index = toAbsoluteIndex(fromIndex, length);
  481. var value;
  482. // Array#includes uses SameValueZero equality algorithm
  483. // eslint-disable-next-line no-self-compare -- NaN check
  484. if (IS_INCLUDES && el != el) while (length > index) {
  485. value = O[index++];
  486. // eslint-disable-next-line no-self-compare -- NaN check
  487. if (value != value) return true;
  488. // Array#indexOf ignores holes, Array#includes - not
  489. } else for (;length > index; index++) {
  490. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  491. } return !IS_INCLUDES && -1;
  492. };
  493. };
  494. var arrayIncludes = {
  495. // `Array.prototype.includes` method
  496. // https://tc39.es/ecma262/#sec-array.prototype.includes
  497. includes: createMethod$1(true),
  498. // `Array.prototype.indexOf` method
  499. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  500. indexOf: createMethod$1(false)
  501. };
  502. var indexOf = arrayIncludes.indexOf;
  503. var objectKeysInternal = function (object, names) {
  504. var O = toIndexedObject(object);
  505. var i = 0;
  506. var result = [];
  507. var key;
  508. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  509. // Don't enum bug & hidden keys
  510. while (names.length > i) if (has$1(O, key = names[i++])) {
  511. ~indexOf(result, key) || result.push(key);
  512. }
  513. return result;
  514. };
  515. // IE8- don't enum bug keys
  516. var enumBugKeys = [
  517. 'constructor',
  518. 'hasOwnProperty',
  519. 'isPrototypeOf',
  520. 'propertyIsEnumerable',
  521. 'toLocaleString',
  522. 'toString',
  523. 'valueOf'
  524. ];
  525. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  526. // `Object.getOwnPropertyNames` method
  527. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  528. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  529. return objectKeysInternal(O, hiddenKeys);
  530. };
  531. var objectGetOwnPropertyNames = {
  532. f: f$1
  533. };
  534. var f = Object.getOwnPropertySymbols;
  535. var objectGetOwnPropertySymbols = {
  536. f: f
  537. };
  538. // all object keys, includes non-enumerable and symbols
  539. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  540. var keys = objectGetOwnPropertyNames.f(anObject(it));
  541. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  542. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  543. };
  544. var copyConstructorProperties = function (target, source) {
  545. var keys = ownKeys(source);
  546. var defineProperty = objectDefineProperty.f;
  547. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  548. for (var i = 0; i < keys.length; i++) {
  549. var key = keys[i];
  550. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  551. }
  552. };
  553. var replacement = /#|\.prototype\./;
  554. var isForced = function (feature, detection) {
  555. var value = data[normalize(feature)];
  556. return value == POLYFILL ? true
  557. : value == NATIVE ? false
  558. : typeof detection == 'function' ? fails(detection)
  559. : !!detection;
  560. };
  561. var normalize = isForced.normalize = function (string) {
  562. return String(string).replace(replacement, '.').toLowerCase();
  563. };
  564. var data = isForced.data = {};
  565. var NATIVE = isForced.NATIVE = 'N';
  566. var POLYFILL = isForced.POLYFILL = 'P';
  567. var isForced_1 = isForced;
  568. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  569. /*
  570. options.target - name of the target object
  571. options.global - target is the global object
  572. options.stat - export as static methods of target
  573. options.proto - export as prototype methods of target
  574. options.real - real prototype method for the `pure` version
  575. options.forced - export even if the native feature is available
  576. options.bind - bind methods to the target, required for the `pure` version
  577. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  578. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  579. options.sham - add a flag to not completely full polyfills
  580. options.enumerable - export as enumerable property
  581. options.noTargetGet - prevent calling a getter on target
  582. */
  583. var _export = function (options, source) {
  584. var TARGET = options.target;
  585. var GLOBAL = options.global;
  586. var STATIC = options.stat;
  587. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  588. if (GLOBAL) {
  589. target = global_1;
  590. } else if (STATIC) {
  591. target = global_1[TARGET] || setGlobal(TARGET, {});
  592. } else {
  593. target = (global_1[TARGET] || {}).prototype;
  594. }
  595. if (target) for (key in source) {
  596. sourceProperty = source[key];
  597. if (options.noTargetGet) {
  598. descriptor = getOwnPropertyDescriptor(target, key);
  599. targetProperty = descriptor && descriptor.value;
  600. } else targetProperty = target[key];
  601. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  602. // contained in target
  603. if (!FORCED && targetProperty !== undefined) {
  604. if (typeof sourceProperty === typeof targetProperty) continue;
  605. copyConstructorProperties(sourceProperty, targetProperty);
  606. }
  607. // add a flag to not completely full polyfills
  608. if (options.sham || (targetProperty && targetProperty.sham)) {
  609. createNonEnumerableProperty(sourceProperty, 'sham', true);
  610. }
  611. // extend global
  612. redefine(target, key, sourceProperty, options);
  613. }
  614. };
  615. // `IsArray` abstract operation
  616. // https://tc39.es/ecma262/#sec-isarray
  617. var isArray = Array.isArray || function isArray(arg) {
  618. return classofRaw(arg) == 'Array';
  619. };
  620. // `ToObject` abstract operation
  621. // https://tc39.es/ecma262/#sec-toobject
  622. var toObject = function (argument) {
  623. return Object(requireObjectCoercible(argument));
  624. };
  625. var createProperty = function (object, key, value) {
  626. var propertyKey = toPrimitive(key);
  627. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  628. else object[propertyKey] = value;
  629. };
  630. var engineIsNode = classofRaw(global_1.process) == 'process';
  631. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  632. var process = global_1.process;
  633. var versions = process && process.versions;
  634. var v8 = versions && versions.v8;
  635. var match, version;
  636. if (v8) {
  637. match = v8.split('.');
  638. version = match[0] + match[1];
  639. } else if (engineUserAgent) {
  640. match = engineUserAgent.match(/Edge\/(\d+)/);
  641. if (!match || match[1] >= 74) {
  642. match = engineUserAgent.match(/Chrome\/(\d+)/);
  643. if (match) version = match[1];
  644. }
  645. }
  646. var engineV8Version = version && +version;
  647. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  648. /* global Symbol -- required for testing */
  649. return !Symbol.sham &&
  650. // Chrome 38 Symbol has incorrect toString conversion
  651. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  652. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  653. });
  654. var useSymbolAsUid = nativeSymbol
  655. /* global Symbol -- safe */
  656. && !Symbol.sham
  657. && typeof Symbol.iterator == 'symbol';
  658. var WellKnownSymbolsStore = shared('wks');
  659. var Symbol$1 = global_1.Symbol;
  660. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  661. var wellKnownSymbol = function (name) {
  662. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  663. if (nativeSymbol && has$1(Symbol$1, name)) {
  664. WellKnownSymbolsStore[name] = Symbol$1[name];
  665. } else {
  666. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  667. }
  668. } return WellKnownSymbolsStore[name];
  669. };
  670. var SPECIES$1 = wellKnownSymbol('species');
  671. // `ArraySpeciesCreate` abstract operation
  672. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  673. var arraySpeciesCreate = function (originalArray, length) {
  674. var C;
  675. if (isArray(originalArray)) {
  676. C = originalArray.constructor;
  677. // cross-realm fallback
  678. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  679. else if (isObject(C)) {
  680. C = C[SPECIES$1];
  681. if (C === null) C = undefined;
  682. }
  683. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  684. };
  685. var SPECIES = wellKnownSymbol('species');
  686. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  687. // We can't use this feature detection in V8 since it causes
  688. // deoptimization and serious performance degradation
  689. // https://github.com/zloirock/core-js/issues/677
  690. return engineV8Version >= 51 || !fails(function () {
  691. var array = [];
  692. var constructor = array.constructor = {};
  693. constructor[SPECIES] = function () {
  694. return { foo: 1 };
  695. };
  696. return array[METHOD_NAME](Boolean).foo !== 1;
  697. });
  698. };
  699. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  700. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  701. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  702. // We can't use this feature detection in V8 since it causes
  703. // deoptimization and serious performance degradation
  704. // https://github.com/zloirock/core-js/issues/679
  705. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  706. var array = [];
  707. array[IS_CONCAT_SPREADABLE] = false;
  708. return array.concat()[0] !== array;
  709. });
  710. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  711. var isConcatSpreadable = function (O) {
  712. if (!isObject(O)) return false;
  713. var spreadable = O[IS_CONCAT_SPREADABLE];
  714. return spreadable !== undefined ? !!spreadable : isArray(O);
  715. };
  716. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  717. // `Array.prototype.concat` method
  718. // https://tc39.es/ecma262/#sec-array.prototype.concat
  719. // with adding support of @@isConcatSpreadable and @@species
  720. _export({ target: 'Array', proto: true, forced: FORCED }, {
  721. // eslint-disable-next-line no-unused-vars -- required for `.length`
  722. concat: function concat(arg) {
  723. var O = toObject(this);
  724. var A = arraySpeciesCreate(O, 0);
  725. var n = 0;
  726. var i, k, length, len, E;
  727. for (i = -1, length = arguments.length; i < length; i++) {
  728. E = i === -1 ? O : arguments[i];
  729. if (isConcatSpreadable(E)) {
  730. len = toLength(E.length);
  731. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  732. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  733. } else {
  734. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  735. createProperty(A, n++, E);
  736. }
  737. }
  738. A.length = n;
  739. return A;
  740. }
  741. });
  742. var aFunction = function (it) {
  743. if (typeof it != 'function') {
  744. throw TypeError(String(it) + ' is not a function');
  745. } return it;
  746. };
  747. // optional / simple context binding
  748. var functionBindContext = function (fn, that, length) {
  749. aFunction(fn);
  750. if (that === undefined) return fn;
  751. switch (length) {
  752. case 0: return function () {
  753. return fn.call(that);
  754. };
  755. case 1: return function (a) {
  756. return fn.call(that, a);
  757. };
  758. case 2: return function (a, b) {
  759. return fn.call(that, a, b);
  760. };
  761. case 3: return function (a, b, c) {
  762. return fn.call(that, a, b, c);
  763. };
  764. }
  765. return function (/* ...args */) {
  766. return fn.apply(that, arguments);
  767. };
  768. };
  769. var push = [].push;
  770. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  771. var createMethod = function (TYPE) {
  772. var IS_MAP = TYPE == 1;
  773. var IS_FILTER = TYPE == 2;
  774. var IS_SOME = TYPE == 3;
  775. var IS_EVERY = TYPE == 4;
  776. var IS_FIND_INDEX = TYPE == 6;
  777. var IS_FILTER_OUT = TYPE == 7;
  778. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  779. return function ($this, callbackfn, that, specificCreate) {
  780. var O = toObject($this);
  781. var self = indexedObject(O);
  782. var boundFunction = functionBindContext(callbackfn, that, 3);
  783. var length = toLength(self.length);
  784. var index = 0;
  785. var create = specificCreate || arraySpeciesCreate;
  786. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  787. var value, result;
  788. for (;length > index; index++) if (NO_HOLES || index in self) {
  789. value = self[index];
  790. result = boundFunction(value, index, O);
  791. if (TYPE) {
  792. if (IS_MAP) target[index] = result; // map
  793. else if (result) switch (TYPE) {
  794. case 3: return true; // some
  795. case 5: return value; // find
  796. case 6: return index; // findIndex
  797. case 2: push.call(target, value); // filter
  798. } else switch (TYPE) {
  799. case 4: return false; // every
  800. case 7: push.call(target, value); // filterOut
  801. }
  802. }
  803. }
  804. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  805. };
  806. };
  807. var arrayIteration = {
  808. // `Array.prototype.forEach` method
  809. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  810. forEach: createMethod(0),
  811. // `Array.prototype.map` method
  812. // https://tc39.es/ecma262/#sec-array.prototype.map
  813. map: createMethod(1),
  814. // `Array.prototype.filter` method
  815. // https://tc39.es/ecma262/#sec-array.prototype.filter
  816. filter: createMethod(2),
  817. // `Array.prototype.some` method
  818. // https://tc39.es/ecma262/#sec-array.prototype.some
  819. some: createMethod(3),
  820. // `Array.prototype.every` method
  821. // https://tc39.es/ecma262/#sec-array.prototype.every
  822. every: createMethod(4),
  823. // `Array.prototype.find` method
  824. // https://tc39.es/ecma262/#sec-array.prototype.find
  825. find: createMethod(5),
  826. // `Array.prototype.findIndex` method
  827. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  828. findIndex: createMethod(6),
  829. // `Array.prototype.filterOut` method
  830. // https://github.com/tc39/proposal-array-filtering
  831. filterOut: createMethod(7)
  832. };
  833. var $filter = arrayIteration.filter;
  834. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  835. // `Array.prototype.filter` method
  836. // https://tc39.es/ecma262/#sec-array.prototype.filter
  837. // with adding support of @@species
  838. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  839. filter: function filter(callbackfn /* , thisArg */) {
  840. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  841. }
  842. });
  843. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  844. var method = [][METHOD_NAME];
  845. return !!method && fails(function () {
  846. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  847. method.call(null, argument || function () { throw 1; }, 1);
  848. });
  849. };
  850. var nativeJoin = [].join;
  851. var ES3_STRINGS = indexedObject != Object;
  852. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  853. // `Array.prototype.join` method
  854. // https://tc39.es/ecma262/#sec-array.prototype.join
  855. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  856. join: function join(separator) {
  857. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  858. }
  859. });
  860. /**
  861. * @author: YL
  862. * @update: zhixin wen <wenzhixin2010@gmail.com>
  863. */
  864. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  865. treeEnable: false,
  866. treeShowField: null,
  867. idField: 'id',
  868. parentIdField: 'pid',
  869. rootParentId: null
  870. });
  871. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  872. _inherits(_class, _$$BootstrapTable);
  873. var _super = _createSuper(_class);
  874. function _class() {
  875. _classCallCheck(this, _class);
  876. return _super.apply(this, arguments);
  877. }
  878. _createClass(_class, [{
  879. key: "init",
  880. value: function init() {
  881. var _get2;
  882. this._rowStyle = this.options.rowStyle;
  883. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  884. args[_key] = arguments[_key];
  885. }
  886. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  887. }
  888. }, {
  889. key: "initHeader",
  890. value: function initHeader() {
  891. var _get3;
  892. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  893. args[_key2] = arguments[_key2];
  894. }
  895. (_get3 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get3, [this].concat(args));
  896. var treeShowField = this.options.treeShowField;
  897. if (treeShowField) {
  898. var _iterator = _createForOfIteratorHelper(this.header.fields),
  899. _step;
  900. try {
  901. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  902. var field = _step.value;
  903. if (treeShowField === field) {
  904. this.treeEnable = true;
  905. break;
  906. }
  907. }
  908. } catch (err) {
  909. _iterator.e(err);
  910. } finally {
  911. _iterator.f();
  912. }
  913. }
  914. }
  915. }, {
  916. key: "initBody",
  917. value: function initBody() {
  918. var _get4;
  919. if (this.treeEnable) {
  920. this.options.virtualScroll = false;
  921. }
  922. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  923. args[_key3] = arguments[_key3];
  924. }
  925. (_get4 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get4, [this].concat(args));
  926. }
  927. }, {
  928. key: "initTr",
  929. value: function initTr(item, idx, data, parentDom) {
  930. var _this = this;
  931. var nodes = data.filter(function (it) {
  932. return item[_this.options.idField] === it[_this.options.parentIdField];
  933. });
  934. parentDom.append(_get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom)); // init sub node
  935. var len = nodes.length - 1;
  936. for (var i = 0; i <= len; i++) {
  937. var node = nodes[i];
  938. var defaultItem = $__default['default'].extend(true, {}, item);
  939. node._level = defaultItem._level + 1;
  940. node._parent = defaultItem;
  941. if (i === len) {
  942. node._last = 1;
  943. } // jquery.treegrid.js
  944. this.options.rowStyle = function (item, idx) {
  945. var res = _this._rowStyle(item, idx);
  946. var id = item[_this.options.idField] ? item[_this.options.idField] : 0;
  947. var pid = item[_this.options.parentIdField] ? item[_this.options.parentIdField] : 0;
  948. res.classes = [res.classes || '', "treegrid-".concat(id), "treegrid-parent-".concat(pid)].join(' ');
  949. return res;
  950. };
  951. this.initTr(node, $__default['default'].inArray(node, data), data, parentDom);
  952. }
  953. }
  954. }, {
  955. key: "initRow",
  956. value: function initRow(item, idx, data, parentDom) {
  957. var _this2 = this;
  958. if (this.treeEnable) {
  959. if (this.options.rootParentId === item[this.options.parentIdField] || !item[this.options.parentIdField]) {
  960. if (item._level === undefined) {
  961. item._level = 0;
  962. } // jquery.treegrid.js
  963. this.options.rowStyle = function (item, idx) {
  964. var res = _this2._rowStyle(item, idx);
  965. var x = item[_this2.options.idField] ? item[_this2.options.idField] : 0;
  966. res.classes = [res.classes || '', "treegrid-".concat(x)].join(' ');
  967. return res;
  968. };
  969. this.initTr(item, idx, data, parentDom);
  970. return true;
  971. }
  972. return false;
  973. }
  974. return _get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom);
  975. }
  976. }, {
  977. key: "destroy",
  978. value: function destroy() {
  979. var _get5;
  980. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  981. args[_key4] = arguments[_key4];
  982. }
  983. (_get5 = _get(_getPrototypeOf(_class.prototype), "destroy", this)).call.apply(_get5, [this].concat(args));
  984. this.options.rowStyle = this._rowStyle;
  985. }
  986. }]);
  987. return _class;
  988. }($__default['default'].BootstrapTable);
  989. })));