1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
3 | typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
|
5 | })(this, (function ($$o) { 'use strict';
|
6 |
|
7 | function _iterableToArrayLimit(arr, i) {
|
8 | var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
9 | if (null != _i) {
|
10 | var _s,
|
11 | _e,
|
12 | _x,
|
13 | _r,
|
14 | _arr = [],
|
15 | _n = !0,
|
16 | _d = !1;
|
17 | try {
|
18 | if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
19 | if (Object(_i) !== _i) return;
|
20 | _n = !1;
|
21 | } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
22 | } catch (err) {
|
23 | _d = !0, _e = err;
|
24 | } finally {
|
25 | try {
|
26 | if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
27 | } finally {
|
28 | if (_d) throw _e;
|
29 | }
|
30 | }
|
31 | return _arr;
|
32 | }
|
33 | }
|
34 | function _typeof(obj) {
|
35 | "@babel/helpers - typeof";
|
36 |
|
37 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
38 | return typeof obj;
|
39 | } : function (obj) {
|
40 | return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
41 | }, _typeof(obj);
|
42 | }
|
43 | function _classCallCheck(instance, Constructor) {
|
44 | if (!(instance instanceof Constructor)) {
|
45 | throw new TypeError("Cannot call a class as a function");
|
46 | }
|
47 | }
|
48 | function _defineProperties(target, props) {
|
49 | for (var i = 0; i < props.length; i++) {
|
50 | var descriptor = props[i];
|
51 | descriptor.enumerable = descriptor.enumerable || false;
|
52 | descriptor.configurable = true;
|
53 | if ("value" in descriptor) descriptor.writable = true;
|
54 | Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
55 | }
|
56 | }
|
57 | function _createClass(Constructor, protoProps, staticProps) {
|
58 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
59 | if (staticProps) _defineProperties(Constructor, staticProps);
|
60 | Object.defineProperty(Constructor, "prototype", {
|
61 | writable: false
|
62 | });
|
63 | return Constructor;
|
64 | }
|
65 | function _slicedToArray(arr, i) {
|
66 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
67 | }
|
68 | function _toConsumableArray(arr) {
|
69 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
70 | }
|
71 | function _arrayWithoutHoles(arr) {
|
72 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
73 | }
|
74 | function _arrayWithHoles(arr) {
|
75 | if (Array.isArray(arr)) return arr;
|
76 | }
|
77 | function _iterableToArray(iter) {
|
78 | if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
79 | }
|
80 | function _unsupportedIterableToArray(o, minLen) {
|
81 | if (!o) return;
|
82 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
83 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
84 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
85 | if (n === "Map" || n === "Set") return Array.from(o);
|
86 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
87 | }
|
88 | function _arrayLikeToArray(arr, len) {
|
89 | if (len == null || len > arr.length) len = arr.length;
|
90 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
91 | return arr2;
|
92 | }
|
93 | function _nonIterableSpread() {
|
94 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
95 | }
|
96 | function _nonIterableRest() {
|
97 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
98 | }
|
99 | function _createForOfIteratorHelper(o, allowArrayLike) {
|
100 | var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
101 | if (!it) {
|
102 | if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
103 | if (it) o = it;
|
104 | var i = 0;
|
105 | var F = function () {};
|
106 | return {
|
107 | s: F,
|
108 | n: function () {
|
109 | if (i >= o.length) return {
|
110 | done: true
|
111 | };
|
112 | return {
|
113 | done: false,
|
114 | value: o[i++]
|
115 | };
|
116 | },
|
117 | e: function (e) {
|
118 | throw e;
|
119 | },
|
120 | f: F
|
121 | };
|
122 | }
|
123 | throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
124 | }
|
125 | var normalCompletion = true,
|
126 | didErr = false,
|
127 | err;
|
128 | return {
|
129 | s: function () {
|
130 | it = it.call(o);
|
131 | },
|
132 | n: function () {
|
133 | var step = it.next();
|
134 | normalCompletion = step.done;
|
135 | return step;
|
136 | },
|
137 | e: function (e) {
|
138 | didErr = true;
|
139 | err = e;
|
140 | },
|
141 | f: function () {
|
142 | try {
|
143 | if (!normalCompletion && it.return != null) it.return();
|
144 | } finally {
|
145 | if (didErr) throw err;
|
146 | }
|
147 | }
|
148 | };
|
149 | }
|
150 | function _toPrimitive(input, hint) {
|
151 | if (typeof input !== "object" || input === null) return input;
|
152 | var prim = input[Symbol.toPrimitive];
|
153 | if (prim !== undefined) {
|
154 | var res = prim.call(input, hint || "default");
|
155 | if (typeof res !== "object") return res;
|
156 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
157 | }
|
158 | return (hint === "string" ? String : Number)(input);
|
159 | }
|
160 | function _toPropertyKey(arg) {
|
161 | var key = _toPrimitive(arg, "string");
|
162 | return typeof key === "symbol" ? key : String(key);
|
163 | }
|
164 |
|
165 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
166 |
|
167 | var check = function (it) {
|
168 | return it && it.Math == Math && it;
|
169 | };
|
170 |
|
171 |
|
172 | var global$k =
|
173 |
|
174 | check(typeof globalThis == 'object' && globalThis) ||
|
175 | check(typeof window == 'object' && window) ||
|
176 |
|
177 | check(typeof self == 'object' && self) ||
|
178 | check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
179 |
|
180 | (function () { return this; })() || Function('return this')();
|
181 |
|
182 | var objectGetOwnPropertyDescriptor = {};
|
183 |
|
184 | var fails$u = function (exec) {
|
185 | try {
|
186 | return !!exec();
|
187 | } catch (error) {
|
188 | return true;
|
189 | }
|
190 | };
|
191 |
|
192 | var fails$t = fails$u;
|
193 |
|
194 |
|
195 | var descriptors = !fails$t(function () {
|
196 |
|
197 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
198 | });
|
199 |
|
200 | var fails$s = fails$u;
|
201 |
|
202 | var functionBindNative = !fails$s(function () {
|
203 |
|
204 | var test = (function () { }).bind();
|
205 |
|
206 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
207 | });
|
208 |
|
209 | var NATIVE_BIND$3 = functionBindNative;
|
210 |
|
211 | var call$e = Function.prototype.call;
|
212 |
|
213 | var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
|
214 | return call$e.apply(call$e, arguments);
|
215 | };
|
216 |
|
217 | var objectPropertyIsEnumerable = {};
|
218 |
|
219 | var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
|
220 |
|
221 | var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
|
222 |
|
223 |
|
224 | var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
|
225 |
|
226 |
|
227 |
|
228 | objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
229 | var descriptor = getOwnPropertyDescriptor$5(this, V);
|
230 | return !!descriptor && descriptor.enumerable;
|
231 | } : $propertyIsEnumerable$1;
|
232 |
|
233 | var createPropertyDescriptor$4 = function (bitmap, value) {
|
234 | return {
|
235 | enumerable: !(bitmap & 1),
|
236 | configurable: !(bitmap & 2),
|
237 | writable: !(bitmap & 4),
|
238 | value: value
|
239 | };
|
240 | };
|
241 |
|
242 | var NATIVE_BIND$2 = functionBindNative;
|
243 |
|
244 | var FunctionPrototype$2 = Function.prototype;
|
245 | var call$d = FunctionPrototype$2.call;
|
246 | var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
|
247 |
|
248 | var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
|
249 | return function () {
|
250 | return call$d.apply(fn, arguments);
|
251 | };
|
252 | };
|
253 |
|
254 | var uncurryThis$z = functionUncurryThis;
|
255 |
|
256 | var toString$h = uncurryThis$z({}.toString);
|
257 | var stringSlice$9 = uncurryThis$z(''.slice);
|
258 |
|
259 | var classofRaw$2 = function (it) {
|
260 | return stringSlice$9(toString$h(it), 8, -1);
|
261 | };
|
262 |
|
263 | var uncurryThis$y = functionUncurryThis;
|
264 | var fails$r = fails$u;
|
265 | var classof$7 = classofRaw$2;
|
266 |
|
267 | var $Object$4 = Object;
|
268 | var split = uncurryThis$y(''.split);
|
269 |
|
270 |
|
271 | var indexedObject = fails$r(function () {
|
272 |
|
273 |
|
274 | return !$Object$4('z').propertyIsEnumerable(0);
|
275 | }) ? function (it) {
|
276 | return classof$7(it) == 'String' ? split(it, '') : $Object$4(it);
|
277 | } : $Object$4;
|
278 |
|
279 |
|
280 |
|
281 | var isNullOrUndefined$7 = function (it) {
|
282 | return it === null || it === undefined;
|
283 | };
|
284 |
|
285 | var isNullOrUndefined$6 = isNullOrUndefined$7;
|
286 |
|
287 | var $TypeError$c = TypeError;
|
288 |
|
289 |
|
290 |
|
291 | var requireObjectCoercible$b = function (it) {
|
292 | if (isNullOrUndefined$6(it)) throw $TypeError$c("Can't call method on " + it);
|
293 | return it;
|
294 | };
|
295 |
|
296 |
|
297 | var IndexedObject$3 = indexedObject;
|
298 | var requireObjectCoercible$a = requireObjectCoercible$b;
|
299 |
|
300 | var toIndexedObject$8 = function (it) {
|
301 | return IndexedObject$3(requireObjectCoercible$a(it));
|
302 | };
|
303 |
|
304 | var documentAll$2 = typeof document == 'object' && document.all;
|
305 |
|
306 |
|
307 |
|
308 | var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
309 |
|
310 | var documentAll_1 = {
|
311 | all: documentAll$2,
|
312 | IS_HTMLDDA: IS_HTMLDDA
|
313 | };
|
314 |
|
315 | var $documentAll$1 = documentAll_1;
|
316 |
|
317 | var documentAll$1 = $documentAll$1.all;
|
318 |
|
319 |
|
320 |
|
321 | var isCallable$j = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
322 | return typeof argument == 'function' || argument === documentAll$1;
|
323 | } : function (argument) {
|
324 | return typeof argument == 'function';
|
325 | };
|
326 |
|
327 | var isCallable$i = isCallable$j;
|
328 | var $documentAll = documentAll_1;
|
329 |
|
330 | var documentAll = $documentAll.all;
|
331 |
|
332 | var isObject$b = $documentAll.IS_HTMLDDA ? function (it) {
|
333 | return typeof it == 'object' ? it !== null : isCallable$i(it) || it === documentAll;
|
334 | } : function (it) {
|
335 | return typeof it == 'object' ? it !== null : isCallable$i(it);
|
336 | };
|
337 |
|
338 | var global$j = global$k;
|
339 | var isCallable$h = isCallable$j;
|
340 |
|
341 | var aFunction = function (argument) {
|
342 | return isCallable$h(argument) ? argument : undefined;
|
343 | };
|
344 |
|
345 | var getBuiltIn$5 = function (namespace, method) {
|
346 | return arguments.length < 2 ? aFunction(global$j[namespace]) : global$j[namespace] && global$j[namespace][method];
|
347 | };
|
348 |
|
349 | var uncurryThis$x = functionUncurryThis;
|
350 |
|
351 | var objectIsPrototypeOf = uncurryThis$x({}.isPrototypeOf);
|
352 |
|
353 | var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
354 |
|
355 | var global$i = global$k;
|
356 | var userAgent$2 = engineUserAgent;
|
357 |
|
358 | var process = global$i.process;
|
359 | var Deno = global$i.Deno;
|
360 | var versions = process && process.versions || Deno && Deno.version;
|
361 | var v8 = versions && versions.v8;
|
362 | var match, version;
|
363 |
|
364 | if (v8) {
|
365 | match = v8.split('.');
|
366 |
|
367 |
|
368 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
369 | }
|
370 |
|
371 |
|
372 |
|
373 | if (!version && userAgent$2) {
|
374 | match = userAgent$2.match(/Edge\/(\d+)/);
|
375 | if (!match || match[1] >= 74) {
|
376 | match = userAgent$2.match(/Chrome\/(\d+)/);
|
377 | if (match) version = +match[1];
|
378 | }
|
379 | }
|
380 |
|
381 | var engineV8Version = version;
|
382 |
|
383 |
|
384 |
|
385 | var V8_VERSION$2 = engineV8Version;
|
386 | var fails$q = fails$u;
|
387 |
|
388 |
|
389 | var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () {
|
390 | var symbol = Symbol();
|
391 |
|
392 |
|
393 | return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
394 |
|
395 | !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
|
396 | });
|
397 |
|
398 |
|
399 |
|
400 | var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
401 |
|
402 | var useSymbolAsUid = NATIVE_SYMBOL$1
|
403 | && !Symbol.sham
|
404 | && typeof Symbol.iterator == 'symbol';
|
405 |
|
406 | var getBuiltIn$4 = getBuiltIn$5;
|
407 | var isCallable$g = isCallable$j;
|
408 | var isPrototypeOf$3 = objectIsPrototypeOf;
|
409 | var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
410 |
|
411 | var $Object$3 = Object;
|
412 |
|
413 | var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
414 | return typeof it == 'symbol';
|
415 | } : function (it) {
|
416 | var $Symbol = getBuiltIn$4('Symbol');
|
417 | return isCallable$g($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
|
418 | };
|
419 |
|
420 | var $String$4 = String;
|
421 |
|
422 | var tryToString$3 = function (argument) {
|
423 | try {
|
424 | return $String$4(argument);
|
425 | } catch (error) {
|
426 | return 'Object';
|
427 | }
|
428 | };
|
429 |
|
430 | var isCallable$f = isCallable$j;
|
431 | var tryToString$2 = tryToString$3;
|
432 |
|
433 | var $TypeError$b = TypeError;
|
434 |
|
435 |
|
436 | var aCallable$4 = function (argument) {
|
437 | if (isCallable$f(argument)) return argument;
|
438 | throw $TypeError$b(tryToString$2(argument) + ' is not a function');
|
439 | };
|
440 |
|
441 | var aCallable$3 = aCallable$4;
|
442 | var isNullOrUndefined$5 = isNullOrUndefined$7;
|
443 |
|
444 |
|
445 |
|
446 | var getMethod$5 = function (V, P) {
|
447 | var func = V[P];
|
448 | return isNullOrUndefined$5(func) ? undefined : aCallable$3(func);
|
449 | };
|
450 |
|
451 | var call$c = functionCall;
|
452 | var isCallable$e = isCallable$j;
|
453 | var isObject$a = isObject$b;
|
454 |
|
455 | var $TypeError$a = TypeError;
|
456 |
|
457 |
|
458 |
|
459 | var ordinaryToPrimitive$1 = function (input, pref) {
|
460 | var fn, val;
|
461 | if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$a(val = call$c(fn, input))) return val;
|
462 | if (isCallable$e(fn = input.valueOf) && !isObject$a(val = call$c(fn, input))) return val;
|
463 | if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$a(val = call$c(fn, input))) return val;
|
464 | throw $TypeError$a("Can't convert object to primitive value");
|
465 | };
|
466 |
|
467 | var sharedExports = {};
|
468 | var shared$4 = {
|
469 | get exports(){ return sharedExports; },
|
470 | set exports(v){ sharedExports = v; },
|
471 | };
|
472 |
|
473 | var isPure = false;
|
474 |
|
475 | var global$h = global$k;
|
476 |
|
477 |
|
478 | var defineProperty$8 = Object.defineProperty;
|
479 |
|
480 | var defineGlobalProperty$3 = function (key, value) {
|
481 | try {
|
482 | defineProperty$8(global$h, key, { value: value, configurable: true, writable: true });
|
483 | } catch (error) {
|
484 | global$h[key] = value;
|
485 | } return value;
|
486 | };
|
487 |
|
488 | var global$g = global$k;
|
489 | var defineGlobalProperty$2 = defineGlobalProperty$3;
|
490 |
|
491 | var SHARED = '__core-js_shared__';
|
492 | var store$3 = global$g[SHARED] || defineGlobalProperty$2(SHARED, {});
|
493 |
|
494 | var sharedStore = store$3;
|
495 |
|
496 | var store$2 = sharedStore;
|
497 |
|
498 | (shared$4.exports = function (key, value) {
|
499 | return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
500 | })('versions', []).push({
|
501 | version: '3.29.0',
|
502 | mode: 'global',
|
503 | copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
504 | license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
|
505 | source: 'https://github.com/zloirock/core-js'
|
506 | });
|
507 |
|
508 | var requireObjectCoercible$9 = requireObjectCoercible$b;
|
509 |
|
510 | var $Object$2 = Object;
|
511 |
|
512 |
|
513 |
|
514 | var toObject$9 = function (argument) {
|
515 | return $Object$2(requireObjectCoercible$9(argument));
|
516 | };
|
517 |
|
518 | var uncurryThis$w = functionUncurryThis;
|
519 | var toObject$8 = toObject$9;
|
520 |
|
521 | var hasOwnProperty = uncurryThis$w({}.hasOwnProperty);
|
522 |
|
523 |
|
524 |
|
525 |
|
526 | var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
527 | return hasOwnProperty(toObject$8(it), key);
|
528 | };
|
529 |
|
530 | var uncurryThis$v = functionUncurryThis;
|
531 |
|
532 | var id = 0;
|
533 | var postfix = Math.random();
|
534 | var toString$g = uncurryThis$v(1.0.toString);
|
535 |
|
536 | var uid$2 = function (key) {
|
537 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
|
538 | };
|
539 |
|
540 | var global$f = global$k;
|
541 | var shared$3 = sharedExports;
|
542 | var hasOwn$b = hasOwnProperty_1;
|
543 | var uid$1 = uid$2;
|
544 | var NATIVE_SYMBOL = symbolConstructorDetection;
|
545 | var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
546 |
|
547 | var Symbol$3 = global$f.Symbol;
|
548 | var WellKnownSymbolsStore = shared$3('wks');
|
549 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
|
550 |
|
551 | var wellKnownSymbol$j = function (name) {
|
552 | if (!hasOwn$b(WellKnownSymbolsStore, name)) {
|
553 | WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)
|
554 | ? Symbol$3[name]
|
555 | : createWellKnownSymbol('Symbol.' + name);
|
556 | } return WellKnownSymbolsStore[name];
|
557 | };
|
558 |
|
559 | var call$b = functionCall;
|
560 | var isObject$9 = isObject$b;
|
561 | var isSymbol$2 = isSymbol$3;
|
562 | var getMethod$4 = getMethod$5;
|
563 | var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
564 | var wellKnownSymbol$i = wellKnownSymbol$j;
|
565 |
|
566 | var $TypeError$9 = TypeError;
|
567 | var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
|
568 |
|
569 |
|
570 |
|
571 | var toPrimitive$2 = function (input, pref) {
|
572 | if (!isObject$9(input) || isSymbol$2(input)) return input;
|
573 | var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
|
574 | var result;
|
575 | if (exoticToPrim) {
|
576 | if (pref === undefined) pref = 'default';
|
577 | result = call$b(exoticToPrim, input, pref);
|
578 | if (!isObject$9(result) || isSymbol$2(result)) return result;
|
579 | throw $TypeError$9("Can't convert object to primitive value");
|
580 | }
|
581 | if (pref === undefined) pref = 'number';
|
582 | return ordinaryToPrimitive(input, pref);
|
583 | };
|
584 |
|
585 | var toPrimitive$1 = toPrimitive$2;
|
586 | var isSymbol$1 = isSymbol$3;
|
587 |
|
588 |
|
589 |
|
590 | var toPropertyKey$3 = function (argument) {
|
591 | var key = toPrimitive$1(argument, 'string');
|
592 | return isSymbol$1(key) ? key : key + '';
|
593 | };
|
594 |
|
595 | var global$e = global$k;
|
596 | var isObject$8 = isObject$b;
|
597 |
|
598 | var document$1 = global$e.document;
|
599 |
|
600 | var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
|
601 |
|
602 | var documentCreateElement$2 = function (it) {
|
603 | return EXISTS$1 ? document$1.createElement(it) : {};
|
604 | };
|
605 |
|
606 | var DESCRIPTORS$e = descriptors;
|
607 | var fails$p = fails$u;
|
608 | var createElement = documentCreateElement$2;
|
609 |
|
610 |
|
611 | var ie8DomDefine = !DESCRIPTORS$e && !fails$p(function () {
|
612 |
|
613 | return Object.defineProperty(createElement('div'), 'a', {
|
614 | get: function () { return 7; }
|
615 | }).a != 7;
|
616 | });
|
617 |
|
618 | var DESCRIPTORS$d = descriptors;
|
619 | var call$a = functionCall;
|
620 | var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
621 | var createPropertyDescriptor$3 = createPropertyDescriptor$4;
|
622 | var toIndexedObject$7 = toIndexedObject$8;
|
623 | var toPropertyKey$2 = toPropertyKey$3;
|
624 | var hasOwn$a = hasOwnProperty_1;
|
625 | var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
626 |
|
627 |
|
628 | var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
629 |
|
630 |
|
631 |
|
632 | objectGetOwnPropertyDescriptor.f = DESCRIPTORS$d ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
633 | O = toIndexedObject$7(O);
|
634 | P = toPropertyKey$2(P);
|
635 | if (IE8_DOM_DEFINE$1) try {
|
636 | return $getOwnPropertyDescriptor$1(O, P);
|
637 | } catch (error) { }
|
638 | if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
639 | };
|
640 |
|
641 | var objectDefineProperty = {};
|
642 |
|
643 | var DESCRIPTORS$c = descriptors;
|
644 | var fails$o = fails$u;
|
645 |
|
646 |
|
647 |
|
648 | var v8PrototypeDefineBug = DESCRIPTORS$c && fails$o(function () {
|
649 |
|
650 | return Object.defineProperty(function () { }, 'prototype', {
|
651 | value: 42,
|
652 | writable: false
|
653 | }).prototype != 42;
|
654 | });
|
655 |
|
656 | var isObject$7 = isObject$b;
|
657 |
|
658 | var $String$3 = String;
|
659 | var $TypeError$8 = TypeError;
|
660 |
|
661 |
|
662 | var anObject$d = function (argument) {
|
663 | if (isObject$7(argument)) return argument;
|
664 | throw $TypeError$8($String$3(argument) + ' is not an object');
|
665 | };
|
666 |
|
667 | var DESCRIPTORS$b = descriptors;
|
668 | var IE8_DOM_DEFINE = ie8DomDefine;
|
669 | var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
670 | var anObject$c = anObject$d;
|
671 | var toPropertyKey$1 = toPropertyKey$3;
|
672 |
|
673 | var $TypeError$7 = TypeError;
|
674 |
|
675 | var $defineProperty = Object.defineProperty;
|
676 |
|
677 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
678 | var ENUMERABLE = 'enumerable';
|
679 | var CONFIGURABLE$1 = 'configurable';
|
680 | var WRITABLE = 'writable';
|
681 |
|
682 |
|
683 |
|
684 | objectDefineProperty.f = DESCRIPTORS$b ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
685 | anObject$c(O);
|
686 | P = toPropertyKey$1(P);
|
687 | anObject$c(Attributes);
|
688 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
689 | var current = $getOwnPropertyDescriptor(O, P);
|
690 | if (current && current[WRITABLE]) {
|
691 | O[P] = Attributes.value;
|
692 | Attributes = {
|
693 | configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
694 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
695 | writable: false
|
696 | };
|
697 | }
|
698 | } return $defineProperty(O, P, Attributes);
|
699 | } : $defineProperty : function defineProperty(O, P, Attributes) {
|
700 | anObject$c(O);
|
701 | P = toPropertyKey$1(P);
|
702 | anObject$c(Attributes);
|
703 | if (IE8_DOM_DEFINE) try {
|
704 | return $defineProperty(O, P, Attributes);
|
705 | } catch (error) { }
|
706 | if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
|
707 | if ('value' in Attributes) O[P] = Attributes.value;
|
708 | return O;
|
709 | };
|
710 |
|
711 | var DESCRIPTORS$a = descriptors;
|
712 | var definePropertyModule$4 = objectDefineProperty;
|
713 | var createPropertyDescriptor$2 = createPropertyDescriptor$4;
|
714 |
|
715 | var createNonEnumerableProperty$7 = DESCRIPTORS$a ? function (object, key, value) {
|
716 | return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
|
717 | } : function (object, key, value) {
|
718 | object[key] = value;
|
719 | return object;
|
720 | };
|
721 |
|
722 | var makeBuiltInExports = {};
|
723 | var makeBuiltIn$3 = {
|
724 | get exports(){ return makeBuiltInExports; },
|
725 | set exports(v){ makeBuiltInExports = v; },
|
726 | };
|
727 |
|
728 | var DESCRIPTORS$9 = descriptors;
|
729 | var hasOwn$9 = hasOwnProperty_1;
|
730 |
|
731 | var FunctionPrototype$1 = Function.prototype;
|
732 |
|
733 | var getDescriptor = DESCRIPTORS$9 && Object.getOwnPropertyDescriptor;
|
734 |
|
735 | var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
|
736 |
|
737 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
738 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS$9 || (DESCRIPTORS$9 && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
739 |
|
740 | var functionName = {
|
741 | EXISTS: EXISTS,
|
742 | PROPER: PROPER,
|
743 | CONFIGURABLE: CONFIGURABLE
|
744 | };
|
745 |
|
746 | var uncurryThis$u = functionUncurryThis;
|
747 | var isCallable$d = isCallable$j;
|
748 | var store$1 = sharedStore;
|
749 |
|
750 | var functionToString = uncurryThis$u(Function.toString);
|
751 |
|
752 |
|
753 | if (!isCallable$d(store$1.inspectSource)) {
|
754 | store$1.inspectSource = function (it) {
|
755 | return functionToString(it);
|
756 | };
|
757 | }
|
758 |
|
759 | var inspectSource$2 = store$1.inspectSource;
|
760 |
|
761 | var global$d = global$k;
|
762 | var isCallable$c = isCallable$j;
|
763 |
|
764 | var WeakMap$1 = global$d.WeakMap;
|
765 |
|
766 | var weakMapBasicDetection = isCallable$c(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
767 |
|
768 | var shared$2 = sharedExports;
|
769 | var uid = uid$2;
|
770 |
|
771 | var keys$1 = shared$2('keys');
|
772 |
|
773 | var sharedKey$3 = function (key) {
|
774 | return keys$1[key] || (keys$1[key] = uid(key));
|
775 | };
|
776 |
|
777 | var hiddenKeys$4 = {};
|
778 |
|
779 | var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
780 | var global$c = global$k;
|
781 | var isObject$6 = isObject$b;
|
782 | var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
|
783 | var hasOwn$8 = hasOwnProperty_1;
|
784 | var shared$1 = sharedStore;
|
785 | var sharedKey$2 = sharedKey$3;
|
786 | var hiddenKeys$3 = hiddenKeys$4;
|
787 |
|
788 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
789 | var TypeError$2 = global$c.TypeError;
|
790 | var WeakMap = global$c.WeakMap;
|
791 | var set, get, has;
|
792 |
|
793 | var enforce = function (it) {
|
794 | return has(it) ? get(it) : set(it, {});
|
795 | };
|
796 |
|
797 | var getterFor = function (TYPE) {
|
798 | return function (it) {
|
799 | var state;
|
800 | if (!isObject$6(it) || (state = get(it)).type !== TYPE) {
|
801 | throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
|
802 | } return state;
|
803 | };
|
804 | };
|
805 |
|
806 | if (NATIVE_WEAK_MAP || shared$1.state) {
|
807 | var store = shared$1.state || (shared$1.state = new WeakMap());
|
808 |
|
809 | store.get = store.get;
|
810 | store.has = store.has;
|
811 | store.set = store.set;
|
812 |
|
813 | set = function (it, metadata) {
|
814 | if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
815 | metadata.facade = it;
|
816 | store.set(it, metadata);
|
817 | return metadata;
|
818 | };
|
819 | get = function (it) {
|
820 | return store.get(it) || {};
|
821 | };
|
822 | has = function (it) {
|
823 | return store.has(it);
|
824 | };
|
825 | } else {
|
826 | var STATE = sharedKey$2('state');
|
827 | hiddenKeys$3[STATE] = true;
|
828 | set = function (it, metadata) {
|
829 | if (hasOwn$8(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
830 | metadata.facade = it;
|
831 | createNonEnumerableProperty$6(it, STATE, metadata);
|
832 | return metadata;
|
833 | };
|
834 | get = function (it) {
|
835 | return hasOwn$8(it, STATE) ? it[STATE] : {};
|
836 | };
|
837 | has = function (it) {
|
838 | return hasOwn$8(it, STATE);
|
839 | };
|
840 | }
|
841 |
|
842 | var internalState = {
|
843 | set: set,
|
844 | get: get,
|
845 | has: has,
|
846 | enforce: enforce,
|
847 | getterFor: getterFor
|
848 | };
|
849 |
|
850 | var uncurryThis$t = functionUncurryThis;
|
851 | var fails$n = fails$u;
|
852 | var isCallable$b = isCallable$j;
|
853 | var hasOwn$7 = hasOwnProperty_1;
|
854 | var DESCRIPTORS$8 = descriptors;
|
855 | var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
856 | var inspectSource$1 = inspectSource$2;
|
857 | var InternalStateModule$1 = internalState;
|
858 |
|
859 | var enforceInternalState$1 = InternalStateModule$1.enforce;
|
860 | var getInternalState$2 = InternalStateModule$1.get;
|
861 | var $String$2 = String;
|
862 | // eslint-disable-next-line es/no-object-defineproperty -- safe
|
863 | var defineProperty$7 = Object.defineProperty;
|
864 | var stringSlice$8 = uncurryThis$t(''.slice);
|
865 | var replace$4 = uncurryThis$t(''.replace);
|
866 | var join = uncurryThis$t([].join);
|
867 |
|
868 | var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$n(function () {
|
869 | return defineProperty$7(function () { }, 'length', { value: 8 }).length !== 8;
|
870 | });
|
871 |
|
872 | var TEMPLATE = String(String).split('String');
|
873 |
|
874 | var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
|
875 | if (stringSlice$8($String$2(name), 0, 7) === 'Symbol(') {
|
876 | name = '[' + replace$4($String$2(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
877 | }
|
878 | if (options && options.getter) name = 'get ' + name;
|
879 | if (options && options.setter) name = 'set ' + name;
|
880 | if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
881 | if (DESCRIPTORS$8) defineProperty$7(value, 'name', { value: name, configurable: true });
|
882 | else value.name = name;
|
883 | }
|
884 | if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
|
885 | defineProperty$7(value, 'length', { value: options.arity });
|
886 | }
|
887 | try {
|
888 | if (options && hasOwn$7(options, 'constructor') && options.constructor) {
|
889 | if (DESCRIPTORS$8) defineProperty$7(value, 'prototype', { writable: false });
|
890 |
|
891 | } else if (value.prototype) value.prototype = undefined;
|
892 | } catch (error) { }
|
893 | var state = enforceInternalState$1(value);
|
894 | if (!hasOwn$7(state, 'source')) {
|
895 | state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
896 | } return value;
|
897 | };
|
898 |
|
899 |
|
900 |
|
901 | Function.prototype.toString = makeBuiltIn$2(function toString() {
|
902 | return isCallable$b(this) && getInternalState$2(this).source || inspectSource$1(this);
|
903 | }, 'toString');
|
904 |
|
905 | var isCallable$a = isCallable$j;
|
906 | var definePropertyModule$3 = objectDefineProperty;
|
907 | var makeBuiltIn$1 = makeBuiltInExports;
|
908 | var defineGlobalProperty$1 = defineGlobalProperty$3;
|
909 |
|
910 | var defineBuiltIn$7 = function (O, key, value, options) {
|
911 | if (!options) options = {};
|
912 | var simple = options.enumerable;
|
913 | var name = options.name !== undefined ? options.name : key;
|
914 | if (isCallable$a(value)) makeBuiltIn$1(value, name, options);
|
915 | if (options.global) {
|
916 | if (simple) O[key] = value;
|
917 | else defineGlobalProperty$1(key, value);
|
918 | } else {
|
919 | try {
|
920 | if (!options.unsafe) delete O[key];
|
921 | else if (O[key]) simple = true;
|
922 | } catch (error) { }
|
923 | if (simple) O[key] = value;
|
924 | else definePropertyModule$3.f(O, key, {
|
925 | value: value,
|
926 | enumerable: false,
|
927 | configurable: !options.nonConfigurable,
|
928 | writable: !options.nonWritable
|
929 | });
|
930 | } return O;
|
931 | };
|
932 |
|
933 | var objectGetOwnPropertyNames = {};
|
934 |
|
935 | var ceil = Math.ceil;
|
936 | var floor$2 = Math.floor;
|
937 |
|
938 |
|
939 |
|
940 |
|
941 | var mathTrunc = Math.trunc || function trunc(x) {
|
942 | var n = +x;
|
943 | return (n > 0 ? floor$2 : ceil)(n);
|
944 | };
|
945 |
|
946 | var trunc = mathTrunc;
|
947 |
|
948 |
|
949 |
|
950 | var toIntegerOrInfinity$5 = function (argument) {
|
951 | var number = +argument;
|
952 |
|
953 | return number !== number || number === 0 ? 0 : trunc(number);
|
954 | };
|
955 |
|
956 | var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
|
957 |
|
958 | var max$4 = Math.max;
|
959 | var min$6 = Math.min;
|
960 |
|
961 |
|
962 |
|
963 |
|
964 | var toAbsoluteIndex$4 = function (index, length) {
|
965 | var integer = toIntegerOrInfinity$4(index);
|
966 | return integer < 0 ? max$4(integer + length, 0) : min$6(integer, length);
|
967 | };
|
968 |
|
969 | var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
|
970 |
|
971 | var min$5 = Math.min;
|
972 |
|
973 |
|
974 |
|
975 | var toLength$6 = function (argument) {
|
976 | return argument > 0 ? min$5(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0;
|
977 | };
|
978 |
|
979 | var toLength$5 = toLength$6;
|
980 |
|
981 |
|
982 |
|
983 | var lengthOfArrayLike$7 = function (obj) {
|
984 | return toLength$5(obj.length);
|
985 | };
|
986 |
|
987 | var toIndexedObject$6 = toIndexedObject$8;
|
988 | var toAbsoluteIndex$3 = toAbsoluteIndex$4;
|
989 | var lengthOfArrayLike$6 = lengthOfArrayLike$7;
|
990 |
|
991 |
|
992 | var createMethod$4 = function (IS_INCLUDES) {
|
993 | return function ($this, el, fromIndex) {
|
994 | var O = toIndexedObject$6($this);
|
995 | var length = lengthOfArrayLike$6(O);
|
996 | var index = toAbsoluteIndex$3(fromIndex, length);
|
997 | var value;
|
998 |
|
999 |
|
1000 | if (IS_INCLUDES && el != el) while (length > index) {
|
1001 | value = O[index++];
|
1002 |
|
1003 | if (value != value) return true;
|
1004 |
|
1005 | } else for (;length > index; index++) {
|
1006 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
1007 | } return !IS_INCLUDES && -1;
|
1008 | };
|
1009 | };
|
1010 |
|
1011 | var arrayIncludes = {
|
1012 |
|
1013 |
|
1014 | includes: createMethod$4(true),
|
1015 |
|
1016 |
|
1017 | indexOf: createMethod$4(false)
|
1018 | };
|
1019 |
|
1020 | var uncurryThis$s = functionUncurryThis;
|
1021 | var hasOwn$6 = hasOwnProperty_1;
|
1022 | var toIndexedObject$5 = toIndexedObject$8;
|
1023 | var indexOf$1 = arrayIncludes.indexOf;
|
1024 | var hiddenKeys$2 = hiddenKeys$4;
|
1025 |
|
1026 | var push$5 = uncurryThis$s([].push);
|
1027 |
|
1028 | var objectKeysInternal = function (object, names) {
|
1029 | var O = toIndexedObject$5(object);
|
1030 | var i = 0;
|
1031 | var result = [];
|
1032 | var key;
|
1033 | for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
|
1034 |
|
1035 | while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
|
1036 | ~indexOf$1(result, key) || push$5(result, key);
|
1037 | }
|
1038 | return result;
|
1039 | };
|
1040 |
|
1041 |
|
1042 | var enumBugKeys$3 = [
|
1043 | 'constructor',
|
1044 | 'hasOwnProperty',
|
1045 | 'isPrototypeOf',
|
1046 | 'propertyIsEnumerable',
|
1047 | 'toLocaleString',
|
1048 | 'toString',
|
1049 | 'valueOf'
|
1050 | ];
|
1051 |
|
1052 | var internalObjectKeys$1 = objectKeysInternal;
|
1053 | var enumBugKeys$2 = enumBugKeys$3;
|
1054 |
|
1055 | var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 | objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1061 | return internalObjectKeys$1(O, hiddenKeys$1);
|
1062 | };
|
1063 |
|
1064 | var objectGetOwnPropertySymbols = {};
|
1065 |
|
1066 |
|
1067 | objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
1068 |
|
1069 | var getBuiltIn$3 = getBuiltIn$5;
|
1070 | var uncurryThis$r = functionUncurryThis;
|
1071 | var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
1072 | var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
1073 | var anObject$b = anObject$d;
|
1074 |
|
1075 | var concat$2 = uncurryThis$r([].concat);
|
1076 |
|
1077 |
|
1078 | var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
|
1079 | var keys = getOwnPropertyNamesModule.f(anObject$b(it));
|
1080 | var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
1081 | return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
|
1082 | };
|
1083 |
|
1084 | var hasOwn$5 = hasOwnProperty_1;
|
1085 | var ownKeys = ownKeys$1;
|
1086 | var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
1087 | var definePropertyModule$2 = objectDefineProperty;
|
1088 |
|
1089 | var copyConstructorProperties$2 = function (target, source, exceptions) {
|
1090 | var keys = ownKeys(source);
|
1091 | var defineProperty = definePropertyModule$2.f;
|
1092 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
1093 | for (var i = 0; i < keys.length; i++) {
|
1094 | var key = keys[i];
|
1095 | if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
|
1096 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
1097 | }
|
1098 | }
|
1099 | };
|
1100 |
|
1101 | var fails$m = fails$u;
|
1102 | var isCallable$9 = isCallable$j;
|
1103 |
|
1104 | var replacement = /#|\.prototype\./;
|
1105 |
|
1106 | var isForced$3 = function (feature, detection) {
|
1107 | var value = data[normalize(feature)];
|
1108 | return value == POLYFILL ? true
|
1109 | : value == NATIVE ? false
|
1110 | : isCallable$9(detection) ? fails$m(detection)
|
1111 | : !!detection;
|
1112 | };
|
1113 |
|
1114 | var normalize = isForced$3.normalize = function (string) {
|
1115 | return String(string).replace(replacement, '.').toLowerCase();
|
1116 | };
|
1117 |
|
1118 | var data = isForced$3.data = {};
|
1119 | var NATIVE = isForced$3.NATIVE = 'N';
|
1120 | var POLYFILL = isForced$3.POLYFILL = 'P';
|
1121 |
|
1122 | var isForced_1 = isForced$3;
|
1123 |
|
1124 | var global$b = global$k;
|
1125 | var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
|
1126 | var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
|
1127 | var defineBuiltIn$6 = defineBuiltIn$7;
|
1128 | var defineGlobalProperty = defineGlobalProperty$3;
|
1129 | var copyConstructorProperties$1 = copyConstructorProperties$2;
|
1130 | var isForced$2 = isForced_1;
|
1131 |
|
1132 | |
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 | var _export = function (options, source) {
|
1148 | var TARGET = options.target;
|
1149 | var GLOBAL = options.global;
|
1150 | var STATIC = options.stat;
|
1151 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
1152 | if (GLOBAL) {
|
1153 | target = global$b;
|
1154 | } else if (STATIC) {
|
1155 | target = global$b[TARGET] || defineGlobalProperty(TARGET, {});
|
1156 | } else {
|
1157 | target = (global$b[TARGET] || {}).prototype;
|
1158 | }
|
1159 | if (target) for (key in source) {
|
1160 | sourceProperty = source[key];
|
1161 | if (options.dontCallGetSet) {
|
1162 | descriptor = getOwnPropertyDescriptor$4(target, key);
|
1163 | targetProperty = descriptor && descriptor.value;
|
1164 | } else targetProperty = target[key];
|
1165 | FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
1166 |
|
1167 | if (!FORCED && targetProperty !== undefined) {
|
1168 | if (typeof sourceProperty == typeof targetProperty) continue;
|
1169 | copyConstructorProperties$1(sourceProperty, targetProperty);
|
1170 | }
|
1171 |
|
1172 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
1173 | createNonEnumerableProperty$5(sourceProperty, 'sham', true);
|
1174 | }
|
1175 | defineBuiltIn$6(target, key, sourceProperty, options);
|
1176 | }
|
1177 | };
|
1178 |
|
1179 | var internalObjectKeys = objectKeysInternal;
|
1180 | var enumBugKeys$1 = enumBugKeys$3;
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 | var objectKeys$3 = Object.keys || function keys(O) {
|
1186 | return internalObjectKeys(O, enumBugKeys$1);
|
1187 | };
|
1188 |
|
1189 | var DESCRIPTORS$7 = descriptors;
|
1190 | var uncurryThis$q = functionUncurryThis;
|
1191 | var call$9 = functionCall;
|
1192 | var fails$l = fails$u;
|
1193 | var objectKeys$2 = objectKeys$3;
|
1194 | var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
1195 | var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
1196 | var toObject$7 = toObject$9;
|
1197 | var IndexedObject$2 = indexedObject;
|
1198 |
|
1199 |
|
1200 | var $assign = Object.assign;
|
1201 |
|
1202 | var defineProperty$6 = Object.defineProperty;
|
1203 | var concat$1 = uncurryThis$q([].concat);
|
1204 |
|
1205 |
|
1206 |
|
1207 | var objectAssign = !$assign || fails$l(function () {
|
1208 |
|
1209 | if (DESCRIPTORS$7 && $assign({ b: 1 }, $assign(defineProperty$6({}, 'a', {
|
1210 | enumerable: true,
|
1211 | get: function () {
|
1212 | defineProperty$6(this, 'b', {
|
1213 | value: 3,
|
1214 | enumerable: false
|
1215 | });
|
1216 | }
|
1217 | }), { b: 2 })).b !== 1) return true;
|
1218 |
|
1219 | var A = {};
|
1220 | var B = {};
|
1221 |
|
1222 | var symbol = Symbol();
|
1223 | var alphabet = 'abcdefghijklmnopqrst';
|
1224 | A[symbol] = 7;
|
1225 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
1226 | return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet;
|
1227 | }) ? function assign(target, source) {
|
1228 | var T = toObject$7(target);
|
1229 | var argumentsLength = arguments.length;
|
1230 | var index = 1;
|
1231 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
1232 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
1233 | while (argumentsLength > index) {
|
1234 | var S = IndexedObject$2(arguments[index++]);
|
1235 | var keys = getOwnPropertySymbols ? concat$1(objectKeys$2(S), getOwnPropertySymbols(S)) : objectKeys$2(S);
|
1236 | var length = keys.length;
|
1237 | var j = 0;
|
1238 | var key;
|
1239 | while (length > j) {
|
1240 | key = keys[j++];
|
1241 | if (!DESCRIPTORS$7 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
|
1242 | }
|
1243 | } return T;
|
1244 | } : $assign;
|
1245 |
|
1246 | var $$n = _export;
|
1247 | var assign = objectAssign;
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 | $$n({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
1253 | assign: assign
|
1254 | });
|
1255 |
|
1256 | var wellKnownSymbol$h = wellKnownSymbol$j;
|
1257 |
|
1258 | var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
|
1259 | var test$2 = {};
|
1260 |
|
1261 | test$2[TO_STRING_TAG$3] = 'z';
|
1262 |
|
1263 | var toStringTagSupport = String(test$2) === '[object z]';
|
1264 |
|
1265 | var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
|
1266 | var isCallable$8 = isCallable$j;
|
1267 | var classofRaw$1 = classofRaw$2;
|
1268 | var wellKnownSymbol$g = wellKnownSymbol$j;
|
1269 |
|
1270 | var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
|
1271 | var $Object$1 = Object;
|
1272 |
|
1273 |
|
1274 | var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
|
1275 |
|
1276 |
|
1277 | var tryGet = function (it, key) {
|
1278 | try {
|
1279 | return it[key];
|
1280 | } catch (error) { }
|
1281 | };
|
1282 |
|
1283 |
|
1284 | var classof$6 = TO_STRING_TAG_SUPPORT$2 ? classofRaw$1 : function (it) {
|
1285 | var O, tag, result;
|
1286 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1287 |
|
1288 | : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
|
1289 |
|
1290 | : CORRECT_ARGUMENTS ? classofRaw$1(O)
|
1291 |
|
1292 | : (result = classofRaw$1(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
|
1293 | };
|
1294 |
|
1295 | var classof$5 = classof$6;
|
1296 |
|
1297 | var $String$1 = String;
|
1298 |
|
1299 | var toString$f = function (argument) {
|
1300 | if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
1301 | return $String$1(argument);
|
1302 | };
|
1303 |
|
1304 |
|
1305 | var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
1306 | '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
1307 |
|
1308 | var uncurryThis$p = functionUncurryThis;
|
1309 | var requireObjectCoercible$8 = requireObjectCoercible$b;
|
1310 | var toString$e = toString$f;
|
1311 | var whitespaces$3 = whitespaces$4;
|
1312 |
|
1313 | var replace$3 = uncurryThis$p(''.replace);
|
1314 | var ltrim = RegExp('^[' + whitespaces$3 + ']+');
|
1315 | var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
|
1316 |
|
1317 |
|
1318 | var createMethod$3 = function (TYPE) {
|
1319 | return function ($this) {
|
1320 | var string = toString$e(requireObjectCoercible$8($this));
|
1321 | if (TYPE & 1) string = replace$3(string, ltrim, '');
|
1322 | if (TYPE & 2) string = replace$3(string, rtrim, '$1');
|
1323 | return string;
|
1324 | };
|
1325 | };
|
1326 |
|
1327 | var stringTrim = {
|
1328 |
|
1329 |
|
1330 | start: createMethod$3(1),
|
1331 |
|
1332 |
|
1333 | end: createMethod$3(2),
|
1334 |
|
1335 |
|
1336 | trim: createMethod$3(3)
|
1337 | };
|
1338 |
|
1339 | var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
|
1340 | var fails$k = fails$u;
|
1341 | var whitespaces$2 = whitespaces$4;
|
1342 |
|
1343 | var non = '\u200B\u0085\u180E';
|
1344 |
|
1345 |
|
1346 |
|
1347 | var stringTrimForced = function (METHOD_NAME) {
|
1348 | return fails$k(function () {
|
1349 | return !!whitespaces$2[METHOD_NAME]()
|
1350 | || non[METHOD_NAME]() !== non
|
1351 | || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME);
|
1352 | });
|
1353 | };
|
1354 |
|
1355 | var $$m = _export;
|
1356 | var $trim = stringTrim.trim;
|
1357 | var forcedStringTrimMethod = stringTrimForced;
|
1358 |
|
1359 |
|
1360 |
|
1361 | $$m({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
1362 | trim: function trim() {
|
1363 | return $trim(this);
|
1364 | }
|
1365 | });
|
1366 |
|
1367 | var fails$j = fails$u;
|
1368 |
|
1369 | var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
|
1370 | var method = [][METHOD_NAME];
|
1371 | return !!method && fails$j(function () {
|
1372 |
|
1373 | method.call(null, argument || function () { return 1; }, 1);
|
1374 | });
|
1375 | };
|
1376 |
|
1377 | var $$l = _export;
|
1378 | var uncurryThis$o = functionUncurryThis;
|
1379 | var IndexedObject$1 = indexedObject;
|
1380 | var toIndexedObject$4 = toIndexedObject$8;
|
1381 | var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
|
1382 |
|
1383 | var nativeJoin = uncurryThis$o([].join);
|
1384 |
|
1385 | var ES3_STRINGS = IndexedObject$1 != Object;
|
1386 | var FORCED$6 = ES3_STRINGS || !arrayMethodIsStrict$3('join', ',');
|
1387 |
|
1388 |
|
1389 |
|
1390 | $$l({ target: 'Array', proto: true, forced: FORCED$6 }, {
|
1391 | join: function join(separator) {
|
1392 | return nativeJoin(toIndexedObject$4(this), separator === undefined ? ',' : separator);
|
1393 | }
|
1394 | });
|
1395 |
|
1396 | var anObject$a = anObject$d;
|
1397 |
|
1398 |
|
1399 |
|
1400 | var regexpFlags$1 = function () {
|
1401 | var that = anObject$a(this);
|
1402 | var result = '';
|
1403 | if (that.hasIndices) result += 'd';
|
1404 | if (that.global) result += 'g';
|
1405 | if (that.ignoreCase) result += 'i';
|
1406 | if (that.multiline) result += 'm';
|
1407 | if (that.dotAll) result += 's';
|
1408 | if (that.unicode) result += 'u';
|
1409 | if (that.unicodeSets) result += 'v';
|
1410 | if (that.sticky) result += 'y';
|
1411 | return result;
|
1412 | };
|
1413 |
|
1414 | var fails$i = fails$u;
|
1415 | var global$a = global$k;
|
1416 |
|
1417 |
|
1418 | var $RegExp$2 = global$a.RegExp;
|
1419 |
|
1420 | var UNSUPPORTED_Y$3 = fails$i(function () {
|
1421 | var re = $RegExp$2('a', 'y');
|
1422 | re.lastIndex = 2;
|
1423 | return re.exec('abcd') != null;
|
1424 | });
|
1425 |
|
1426 |
|
1427 |
|
1428 | var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$i(function () {
|
1429 | return !$RegExp$2('a', 'y').sticky;
|
1430 | });
|
1431 |
|
1432 | var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(function () {
|
1433 |
|
1434 | var re = $RegExp$2('^r', 'gy');
|
1435 | re.lastIndex = 2;
|
1436 | return re.exec('str') != null;
|
1437 | });
|
1438 |
|
1439 | var regexpStickyHelpers = {
|
1440 | BROKEN_CARET: BROKEN_CARET,
|
1441 | MISSED_STICKY: MISSED_STICKY$1,
|
1442 | UNSUPPORTED_Y: UNSUPPORTED_Y$3
|
1443 | };
|
1444 |
|
1445 | var objectDefineProperties = {};
|
1446 |
|
1447 | var DESCRIPTORS$6 = descriptors;
|
1448 | var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
1449 | var definePropertyModule$1 = objectDefineProperty;
|
1450 | var anObject$9 = anObject$d;
|
1451 | var toIndexedObject$3 = toIndexedObject$8;
|
1452 | var objectKeys$1 = objectKeys$3;
|
1453 |
|
1454 |
|
1455 |
|
1456 |
|
1457 | objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
1458 | anObject$9(O);
|
1459 | var props = toIndexedObject$3(Properties);
|
1460 | var keys = objectKeys$1(Properties);
|
1461 | var length = keys.length;
|
1462 | var index = 0;
|
1463 | var key;
|
1464 | while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
|
1465 | return O;
|
1466 | };
|
1467 |
|
1468 | var getBuiltIn$2 = getBuiltIn$5;
|
1469 |
|
1470 | var html$1 = getBuiltIn$2('document', 'documentElement');
|
1471 |
|
1472 |
|
1473 |
|
1474 | var anObject$8 = anObject$d;
|
1475 | var definePropertiesModule = objectDefineProperties;
|
1476 | var enumBugKeys = enumBugKeys$3;
|
1477 | var hiddenKeys = hiddenKeys$4;
|
1478 | var html = html$1;
|
1479 | var documentCreateElement$1 = documentCreateElement$2;
|
1480 | var sharedKey$1 = sharedKey$3;
|
1481 |
|
1482 | var GT = '>';
|
1483 | var LT = '<';
|
1484 | var PROTOTYPE = 'prototype';
|
1485 | var SCRIPT = 'script';
|
1486 | var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
1487 |
|
1488 | var EmptyConstructor = function () { };
|
1489 |
|
1490 | var scriptTag = function (content) {
|
1491 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1492 | };
|
1493 |
|
1494 |
|
1495 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1496 | activeXDocument.write(scriptTag(''));
|
1497 | activeXDocument.close();
|
1498 | var temp = activeXDocument.parentWindow.Object;
|
1499 | activeXDocument = null;
|
1500 | return temp;
|
1501 | };
|
1502 |
|
1503 |
|
1504 | var NullProtoObjectViaIFrame = function () {
|
1505 |
|
1506 | var iframe = documentCreateElement$1('iframe');
|
1507 | var JS = 'java' + SCRIPT + ':';
|
1508 | var iframeDocument;
|
1509 | iframe.style.display = 'none';
|
1510 | html.appendChild(iframe);
|
1511 |
|
1512 | iframe.src = String(JS);
|
1513 | iframeDocument = iframe.contentWindow.document;
|
1514 | iframeDocument.open();
|
1515 | iframeDocument.write(scriptTag('document.F=Object'));
|
1516 | iframeDocument.close();
|
1517 | return iframeDocument.F;
|
1518 | };
|
1519 |
|
1520 |
|
1521 |
|
1522 |
|
1523 |
|
1524 |
|
1525 | var activeXDocument;
|
1526 | var NullProtoObject = function () {
|
1527 | try {
|
1528 | activeXDocument = new ActiveXObject('htmlfile');
|
1529 | } catch (error) { }
|
1530 | NullProtoObject = typeof document != 'undefined'
|
1531 | ? document.domain && activeXDocument
|
1532 | ? NullProtoObjectViaActiveX(activeXDocument)
|
1533 | : NullProtoObjectViaIFrame()
|
1534 | : NullProtoObjectViaActiveX(activeXDocument);
|
1535 | var length = enumBugKeys.length;
|
1536 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
1537 | return NullProtoObject();
|
1538 | };
|
1539 |
|
1540 | hiddenKeys[IE_PROTO$1] = true;
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 | var objectCreate = Object.create || function create(O, Properties) {
|
1546 | var result;
|
1547 | if (O !== null) {
|
1548 | EmptyConstructor[PROTOTYPE] = anObject$8(O);
|
1549 | result = new EmptyConstructor();
|
1550 | EmptyConstructor[PROTOTYPE] = null;
|
1551 |
|
1552 | result[IE_PROTO$1] = O;
|
1553 | } else result = NullProtoObject();
|
1554 | return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
1555 | };
|
1556 |
|
1557 | var fails$h = fails$u;
|
1558 | var global$9 = global$k;
|
1559 |
|
1560 |
|
1561 | var $RegExp$1 = global$9.RegExp;
|
1562 |
|
1563 | var regexpUnsupportedDotAll = fails$h(function () {
|
1564 | var re = $RegExp$1('.', 's');
|
1565 | return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
1566 | });
|
1567 |
|
1568 | var fails$g = fails$u;
|
1569 | var global$8 = global$k;
|
1570 |
|
1571 |
|
1572 | var $RegExp = global$8.RegExp;
|
1573 |
|
1574 | var regexpUnsupportedNcg = fails$g(function () {
|
1575 | var re = $RegExp('(?<a>b)', 'g');
|
1576 | return re.exec('b').groups.a !== 'b' ||
|
1577 | 'b'.replace(re, '$<a>c') !== 'bc';
|
1578 | });
|
1579 |
|
1580 |
|
1581 |
|
1582 | var call$8 = functionCall;
|
1583 | var uncurryThis$n = functionUncurryThis;
|
1584 | var toString$d = toString$f;
|
1585 | var regexpFlags = regexpFlags$1;
|
1586 | var stickyHelpers$2 = regexpStickyHelpers;
|
1587 | var shared = sharedExports;
|
1588 | var create$2 = objectCreate;
|
1589 | var getInternalState$1 = internalState.get;
|
1590 | var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
|
1591 | var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
|
1592 |
|
1593 | var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
1594 | var nativeExec = RegExp.prototype.exec;
|
1595 | var patchedExec = nativeExec;
|
1596 | var charAt$5 = uncurryThis$n(''.charAt);
|
1597 | var indexOf = uncurryThis$n(''.indexOf);
|
1598 | var replace$2 = uncurryThis$n(''.replace);
|
1599 | var stringSlice$7 = uncurryThis$n(''.slice);
|
1600 |
|
1601 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
1602 | var re1 = /a/;
|
1603 | var re2 = /b*/g;
|
1604 | call$8(nativeExec, re1, 'a');
|
1605 | call$8(nativeExec, re2, 'a');
|
1606 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
1607 | })();
|
1608 |
|
1609 | var UNSUPPORTED_Y$2 = stickyHelpers$2.BROKEN_CARET;
|
1610 |
|
1611 |
|
1612 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
1613 |
|
1614 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1;
|
1615 |
|
1616 | if (PATCH) {
|
1617 | patchedExec = function exec(string) {
|
1618 | var re = this;
|
1619 | var state = getInternalState$1(re);
|
1620 | var str = toString$d(string);
|
1621 | var raw = state.raw;
|
1622 | var result, reCopy, lastIndex, match, i, object, group;
|
1623 |
|
1624 | if (raw) {
|
1625 | raw.lastIndex = re.lastIndex;
|
1626 | result = call$8(patchedExec, raw, str);
|
1627 | re.lastIndex = raw.lastIndex;
|
1628 | return result;
|
1629 | }
|
1630 |
|
1631 | var groups = state.groups;
|
1632 | var sticky = UNSUPPORTED_Y$2 && re.sticky;
|
1633 | var flags = call$8(regexpFlags, re);
|
1634 | var source = re.source;
|
1635 | var charsAdded = 0;
|
1636 | var strCopy = str;
|
1637 |
|
1638 | if (sticky) {
|
1639 | flags = replace$2(flags, 'y', '');
|
1640 | if (indexOf(flags, 'g') === -1) {
|
1641 | flags += 'g';
|
1642 | }
|
1643 |
|
1644 | strCopy = stringSlice$7(str, re.lastIndex);
|
1645 |
|
1646 | if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
|
1647 | source = '(?: ' + source + ')';
|
1648 | strCopy = ' ' + strCopy;
|
1649 | charsAdded++;
|
1650 | }
|
1651 |
|
1652 |
|
1653 | reCopy = new RegExp('^(?:' + source + ')', flags);
|
1654 | }
|
1655 |
|
1656 | if (NPCG_INCLUDED) {
|
1657 | reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
1658 | }
|
1659 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
1660 |
|
1661 | match = call$8(nativeExec, sticky ? reCopy : re, strCopy);
|
1662 |
|
1663 | if (sticky) {
|
1664 | if (match) {
|
1665 | match.input = stringSlice$7(match.input, charsAdded);
|
1666 | match[0] = stringSlice$7(match[0], charsAdded);
|
1667 | match.index = re.lastIndex;
|
1668 | re.lastIndex += match[0].length;
|
1669 | } else re.lastIndex = 0;
|
1670 | } else if (UPDATES_LAST_INDEX_WRONG && match) {
|
1671 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
1672 | }
|
1673 | if (NPCG_INCLUDED && match && match.length > 1) {
|
1674 |
|
1675 |
|
1676 | call$8(nativeReplace, match[0], reCopy, function () {
|
1677 | for (i = 1; i < arguments.length - 2; i++) {
|
1678 | if (arguments[i] === undefined) match[i] = undefined;
|
1679 | }
|
1680 | });
|
1681 | }
|
1682 |
|
1683 | if (match && groups) {
|
1684 | match.groups = object = create$2(null);
|
1685 | for (i = 0; i < groups.length; i++) {
|
1686 | group = groups[i];
|
1687 | object[group[0]] = match[group[1]];
|
1688 | }
|
1689 | }
|
1690 |
|
1691 | return match;
|
1692 | };
|
1693 | }
|
1694 |
|
1695 | var regexpExec$3 = patchedExec;
|
1696 |
|
1697 | var $$k = _export;
|
1698 | var exec$4 = regexpExec$3;
|
1699 |
|
1700 |
|
1701 |
|
1702 | $$k({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, {
|
1703 | exec: exec$4
|
1704 | });
|
1705 |
|
1706 | var NATIVE_BIND$1 = functionBindNative;
|
1707 |
|
1708 | var FunctionPrototype = Function.prototype;
|
1709 | var apply$2 = FunctionPrototype.apply;
|
1710 | var call$7 = FunctionPrototype.call;
|
1711 |
|
1712 |
|
1713 | var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$2) : function () {
|
1714 | return call$7.apply(apply$2, arguments);
|
1715 | });
|
1716 |
|
1717 | var classofRaw = classofRaw$2;
|
1718 | var uncurryThis$m = functionUncurryThis;
|
1719 |
|
1720 | var functionUncurryThisClause = function (fn) {
|
1721 |
|
1722 |
|
1723 |
|
1724 | if (classofRaw(fn) === 'Function') return uncurryThis$m(fn);
|
1725 | };
|
1726 |
|
1727 |
|
1728 |
|
1729 | var uncurryThis$l = functionUncurryThisClause;
|
1730 | var defineBuiltIn$5 = defineBuiltIn$7;
|
1731 | var regexpExec$2 = regexpExec$3;
|
1732 | var fails$f = fails$u;
|
1733 | var wellKnownSymbol$f = wellKnownSymbol$j;
|
1734 | var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
|
1735 |
|
1736 | var SPECIES$5 = wellKnownSymbol$f('species');
|
1737 | var RegExpPrototype$3 = RegExp.prototype;
|
1738 |
|
1739 | var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
1740 | var SYMBOL = wellKnownSymbol$f(KEY);
|
1741 |
|
1742 | var DELEGATES_TO_SYMBOL = !fails$f(function () {
|
1743 |
|
1744 | var O = {};
|
1745 | O[SYMBOL] = function () { return 7; };
|
1746 | return ''[KEY](O) != 7;
|
1747 | });
|
1748 |
|
1749 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () {
|
1750 |
|
1751 | var execCalled = false;
|
1752 | var re = /a/;
|
1753 |
|
1754 | if (KEY === 'split') {
|
1755 |
|
1756 |
|
1757 |
|
1758 | re = {};
|
1759 |
|
1760 |
|
1761 | re.constructor = {};
|
1762 | re.constructor[SPECIES$5] = function () { return re; };
|
1763 | re.flags = '';
|
1764 | re[SYMBOL] = /./[SYMBOL];
|
1765 | }
|
1766 |
|
1767 | re.exec = function () { execCalled = true; return null; };
|
1768 |
|
1769 | re[SYMBOL]('');
|
1770 | return !execCalled;
|
1771 | });
|
1772 |
|
1773 | if (
|
1774 | !DELEGATES_TO_SYMBOL ||
|
1775 | !DELEGATES_TO_EXEC ||
|
1776 | FORCED
|
1777 | ) {
|
1778 | var uncurriedNativeRegExpMethod = uncurryThis$l(/./[SYMBOL]);
|
1779 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
1780 | var uncurriedNativeMethod = uncurryThis$l(nativeMethod);
|
1781 | var $exec = regexp.exec;
|
1782 | if ($exec === regexpExec$2 || $exec === RegExpPrototype$3.exec) {
|
1783 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
1784 |
|
1785 |
|
1786 |
|
1787 | return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
1788 | }
|
1789 | return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
1790 | }
|
1791 | return { done: false };
|
1792 | });
|
1793 |
|
1794 | defineBuiltIn$5(String.prototype, KEY, methods[0]);
|
1795 | defineBuiltIn$5(RegExpPrototype$3, SYMBOL, methods[1]);
|
1796 | }
|
1797 |
|
1798 | if (SHAM) createNonEnumerableProperty$4(RegExpPrototype$3[SYMBOL], 'sham', true);
|
1799 | };
|
1800 |
|
1801 | var isObject$5 = isObject$b;
|
1802 | var classof$4 = classofRaw$2;
|
1803 | var wellKnownSymbol$e = wellKnownSymbol$j;
|
1804 |
|
1805 | var MATCH$2 = wellKnownSymbol$e('match');
|
1806 |
|
1807 |
|
1808 |
|
1809 | var isRegexp = function (it) {
|
1810 | var isRegExp;
|
1811 | return isObject$5(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
|
1812 | };
|
1813 |
|
1814 | var uncurryThis$k = functionUncurryThis;
|
1815 | var fails$e = fails$u;
|
1816 | var isCallable$7 = isCallable$j;
|
1817 | var classof$3 = classof$6;
|
1818 | var getBuiltIn$1 = getBuiltIn$5;
|
1819 | var inspectSource = inspectSource$2;
|
1820 |
|
1821 | var noop = function () { };
|
1822 | var empty = [];
|
1823 | var construct = getBuiltIn$1('Reflect', 'construct');
|
1824 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
1825 | var exec$3 = uncurryThis$k(constructorRegExp.exec);
|
1826 | var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
1827 |
|
1828 | var isConstructorModern = function isConstructor(argument) {
|
1829 | if (!isCallable$7(argument)) return false;
|
1830 | try {
|
1831 | construct(noop, empty, argument);
|
1832 | return true;
|
1833 | } catch (error) {
|
1834 | return false;
|
1835 | }
|
1836 | };
|
1837 |
|
1838 | var isConstructorLegacy = function isConstructor(argument) {
|
1839 | if (!isCallable$7(argument)) return false;
|
1840 | switch (classof$3(argument)) {
|
1841 | case 'AsyncFunction':
|
1842 | case 'GeneratorFunction':
|
1843 | case 'AsyncGeneratorFunction': return false;
|
1844 | }
|
1845 | try {
|
1846 |
|
1847 |
|
1848 |
|
1849 | return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
|
1850 | } catch (error) {
|
1851 | return true;
|
1852 | }
|
1853 | };
|
1854 |
|
1855 | isConstructorLegacy.sham = true;
|
1856 |
|
1857 |
|
1858 |
|
1859 | var isConstructor$3 = !construct || fails$e(function () {
|
1860 | var called;
|
1861 | return isConstructorModern(isConstructorModern.call)
|
1862 | || !isConstructorModern(Object)
|
1863 | || !isConstructorModern(function () { called = true; })
|
1864 | || called;
|
1865 | }) ? isConstructorLegacy : isConstructorModern;
|
1866 |
|
1867 | var isConstructor$2 = isConstructor$3;
|
1868 | var tryToString$1 = tryToString$3;
|
1869 |
|
1870 | var $TypeError$6 = TypeError;
|
1871 |
|
1872 |
|
1873 | var aConstructor$1 = function (argument) {
|
1874 | if (isConstructor$2(argument)) return argument;
|
1875 | throw $TypeError$6(tryToString$1(argument) + ' is not a constructor');
|
1876 | };
|
1877 |
|
1878 | var anObject$7 = anObject$d;
|
1879 | var aConstructor = aConstructor$1;
|
1880 | var isNullOrUndefined$4 = isNullOrUndefined$7;
|
1881 | var wellKnownSymbol$d = wellKnownSymbol$j;
|
1882 |
|
1883 | var SPECIES$4 = wellKnownSymbol$d('species');
|
1884 |
|
1885 |
|
1886 |
|
1887 | var speciesConstructor$1 = function (O, defaultConstructor) {
|
1888 | var C = anObject$7(O).constructor;
|
1889 | var S;
|
1890 | return C === undefined || isNullOrUndefined$4(S = anObject$7(C)[SPECIES$4]) ? defaultConstructor : aConstructor(S);
|
1891 | };
|
1892 |
|
1893 | var uncurryThis$j = functionUncurryThis;
|
1894 | var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
|
1895 | var toString$c = toString$f;
|
1896 | var requireObjectCoercible$7 = requireObjectCoercible$b;
|
1897 |
|
1898 | var charAt$4 = uncurryThis$j(''.charAt);
|
1899 | var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
|
1900 | var stringSlice$6 = uncurryThis$j(''.slice);
|
1901 |
|
1902 | var createMethod$2 = function (CONVERT_TO_STRING) {
|
1903 | return function ($this, pos) {
|
1904 | var S = toString$c(requireObjectCoercible$7($this));
|
1905 | var position = toIntegerOrInfinity$2(pos);
|
1906 | var size = S.length;
|
1907 | var first, second;
|
1908 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1909 | first = charCodeAt$1(S, position);
|
1910 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1911 | || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
1912 | ? CONVERT_TO_STRING
|
1913 | ? charAt$4(S, position)
|
1914 | : first
|
1915 | : CONVERT_TO_STRING
|
1916 | ? stringSlice$6(S, position, position + 2)
|
1917 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1918 | };
|
1919 | };
|
1920 |
|
1921 | var stringMultibyte = {
|
1922 |
|
1923 |
|
1924 | codeAt: createMethod$2(false),
|
1925 |
|
1926 |
|
1927 | charAt: createMethod$2(true)
|
1928 | };
|
1929 |
|
1930 | var charAt$3 = stringMultibyte.charAt;
|
1931 |
|
1932 |
|
1933 |
|
1934 | var advanceStringIndex$3 = function (S, index, unicode) {
|
1935 | return index + (unicode ? charAt$3(S, index).length : 1);
|
1936 | };
|
1937 |
|
1938 | var toPropertyKey = toPropertyKey$3;
|
1939 | var definePropertyModule = objectDefineProperty;
|
1940 | var createPropertyDescriptor$1 = createPropertyDescriptor$4;
|
1941 |
|
1942 | var createProperty$4 = function (object, key, value) {
|
1943 | var propertyKey = toPropertyKey(key);
|
1944 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor$1(0, value));
|
1945 | else object[propertyKey] = value;
|
1946 | };
|
1947 |
|
1948 | var toAbsoluteIndex$2 = toAbsoluteIndex$4;
|
1949 | var lengthOfArrayLike$5 = lengthOfArrayLike$7;
|
1950 | var createProperty$3 = createProperty$4;
|
1951 |
|
1952 | var $Array$2 = Array;
|
1953 | var max$3 = Math.max;
|
1954 |
|
1955 | var arraySliceSimple = function (O, start, end) {
|
1956 | var length = lengthOfArrayLike$5(O);
|
1957 | var k = toAbsoluteIndex$2(start, length);
|
1958 | var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
|
1959 | var result = $Array$2(max$3(fin - k, 0));
|
1960 | for (var n = 0; k < fin; k++, n++) createProperty$3(result, n, O[k]);
|
1961 | result.length = n;
|
1962 | return result;
|
1963 | };
|
1964 |
|
1965 | var call$6 = functionCall;
|
1966 | var anObject$6 = anObject$d;
|
1967 | var isCallable$6 = isCallable$j;
|
1968 | var classof$2 = classofRaw$2;
|
1969 | var regexpExec$1 = regexpExec$3;
|
1970 |
|
1971 | var $TypeError$5 = TypeError;
|
1972 |
|
1973 |
|
1974 |
|
1975 | var regexpExecAbstract = function (R, S) {
|
1976 | var exec = R.exec;
|
1977 | if (isCallable$6(exec)) {
|
1978 | var result = call$6(exec, R, S);
|
1979 | if (result !== null) anObject$6(result);
|
1980 | return result;
|
1981 | }
|
1982 | if (classof$2(R) === 'RegExp') return call$6(regexpExec$1, R, S);
|
1983 | throw $TypeError$5('RegExp#exec called on incompatible receiver');
|
1984 | };
|
1985 |
|
1986 | var apply$1 = functionApply;
|
1987 | var call$5 = functionCall;
|
1988 | var uncurryThis$i = functionUncurryThis;
|
1989 | var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
|
1990 | var anObject$5 = anObject$d;
|
1991 | var isNullOrUndefined$3 = isNullOrUndefined$7;
|
1992 | var isRegExp$2 = isRegexp;
|
1993 | var requireObjectCoercible$6 = requireObjectCoercible$b;
|
1994 | var speciesConstructor = speciesConstructor$1;
|
1995 | var advanceStringIndex$2 = advanceStringIndex$3;
|
1996 | var toLength$4 = toLength$6;
|
1997 | var toString$b = toString$f;
|
1998 | var getMethod$3 = getMethod$5;
|
1999 | var arraySlice$2 = arraySliceSimple;
|
2000 | var callRegExpExec = regexpExecAbstract;
|
2001 | var regexpExec = regexpExec$3;
|
2002 | var stickyHelpers$1 = regexpStickyHelpers;
|
2003 | var fails$d = fails$u;
|
2004 |
|
2005 | var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y;
|
2006 | var MAX_UINT32 = 0xFFFFFFFF;
|
2007 | var min$4 = Math.min;
|
2008 | var $push = [].push;
|
2009 | var exec$2 = uncurryThis$i(/./.exec);
|
2010 | var push$4 = uncurryThis$i($push);
|
2011 | var stringSlice$5 = uncurryThis$i(''.slice);
|
2012 |
|
2013 |
|
2014 |
|
2015 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () {
|
2016 |
|
2017 | var re = /(?:)/;
|
2018 | var originalExec = re.exec;
|
2019 | re.exec = function () { return originalExec.apply(this, arguments); };
|
2020 | var result = 'ab'.split(re);
|
2021 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
2022 | });
|
2023 |
|
2024 |
|
2025 | fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
|
2026 | var internalSplit;
|
2027 | if (
|
2028 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
2029 |
|
2030 | 'test'.split(/(?:)/, -1).length != 4 ||
|
2031 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
2032 | '.'.split(/(.?)(.?)/).length != 4 ||
|
2033 |
|
2034 | '.'.split(/()()/).length > 1 ||
|
2035 | ''.split(/.?/).length
|
2036 | ) {
|
2037 |
|
2038 | internalSplit = function (separator, limit) {
|
2039 | var string = toString$b(requireObjectCoercible$6(this));
|
2040 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
2041 | if (lim === 0) return [];
|
2042 | if (separator === undefined) return [string];
|
2043 |
|
2044 | if (!isRegExp$2(separator)) {
|
2045 | return call$5(nativeSplit, string, separator, lim);
|
2046 | }
|
2047 | var output = [];
|
2048 | var flags = (separator.ignoreCase ? 'i' : '') +
|
2049 | (separator.multiline ? 'm' : '') +
|
2050 | (separator.unicode ? 'u' : '') +
|
2051 | (separator.sticky ? 'y' : '');
|
2052 | var lastLastIndex = 0;
|
2053 |
|
2054 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
2055 | var match, lastIndex, lastLength;
|
2056 | while (match = call$5(regexpExec, separatorCopy, string)) {
|
2057 | lastIndex = separatorCopy.lastIndex;
|
2058 | if (lastIndex > lastLastIndex) {
|
2059 | push$4(output, stringSlice$5(string, lastLastIndex, match.index));
|
2060 | if (match.length > 1 && match.index < string.length) apply$1($push, output, arraySlice$2(match, 1));
|
2061 | lastLength = match[0].length;
|
2062 | lastLastIndex = lastIndex;
|
2063 | if (output.length >= lim) break;
|
2064 | }
|
2065 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
2066 | }
|
2067 | if (lastLastIndex === string.length) {
|
2068 | if (lastLength || !exec$2(separatorCopy, '')) push$4(output, '');
|
2069 | } else push$4(output, stringSlice$5(string, lastLastIndex));
|
2070 | return output.length > lim ? arraySlice$2(output, 0, lim) : output;
|
2071 | };
|
2072 |
|
2073 | } else if ('0'.split(undefined, 0).length) {
|
2074 | internalSplit = function (separator, limit) {
|
2075 | return separator === undefined && limit === 0 ? [] : call$5(nativeSplit, this, separator, limit);
|
2076 | };
|
2077 | } else internalSplit = nativeSplit;
|
2078 |
|
2079 | return [
|
2080 |
|
2081 |
|
2082 | function split(separator, limit) {
|
2083 | var O = requireObjectCoercible$6(this);
|
2084 | var splitter = isNullOrUndefined$3(separator) ? undefined : getMethod$3(separator, SPLIT);
|
2085 | return splitter
|
2086 | ? call$5(splitter, separator, O, limit)
|
2087 | : call$5(internalSplit, toString$b(O), separator, limit);
|
2088 | },
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 |
|
2094 | function (string, limit) {
|
2095 | var rx = anObject$5(this);
|
2096 | var S = toString$b(string);
|
2097 | var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
2098 |
|
2099 | if (res.done) return res.value;
|
2100 |
|
2101 | var C = speciesConstructor(rx, RegExp);
|
2102 |
|
2103 | var unicodeMatching = rx.unicode;
|
2104 | var flags = (rx.ignoreCase ? 'i' : '') +
|
2105 | (rx.multiline ? 'm' : '') +
|
2106 | (rx.unicode ? 'u' : '') +
|
2107 | (UNSUPPORTED_Y$1 ? 'g' : 'y');
|
2108 |
|
2109 |
|
2110 |
|
2111 | var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
|
2112 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
2113 | if (lim === 0) return [];
|
2114 | if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
|
2115 | var p = 0;
|
2116 | var q = 0;
|
2117 | var A = [];
|
2118 | while (q < S.length) {
|
2119 | splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
|
2120 | var z = callRegExpExec(splitter, UNSUPPORTED_Y$1 ? stringSlice$5(S, q) : S);
|
2121 | var e;
|
2122 | if (
|
2123 | z === null ||
|
2124 | (e = min$4(toLength$4(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
|
2125 | ) {
|
2126 | q = advanceStringIndex$2(S, q, unicodeMatching);
|
2127 | } else {
|
2128 | push$4(A, stringSlice$5(S, p, q));
|
2129 | if (A.length === lim) return A;
|
2130 | for (var i = 1; i <= z.length - 1; i++) {
|
2131 | push$4(A, z[i]);
|
2132 | if (A.length === lim) return A;
|
2133 | }
|
2134 | q = p = e;
|
2135 | }
|
2136 | }
|
2137 | push$4(A, stringSlice$5(S, p));
|
2138 | return A;
|
2139 | }
|
2140 | ];
|
2141 | }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
|
2142 |
|
2143 | var DESCRIPTORS$5 = descriptors;
|
2144 | var uncurryThis$h = functionUncurryThis;
|
2145 | var objectKeys = objectKeys$3;
|
2146 | var toIndexedObject$2 = toIndexedObject$8;
|
2147 | var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
2148 |
|
2149 | var propertyIsEnumerable = uncurryThis$h($propertyIsEnumerable);
|
2150 | var push$3 = uncurryThis$h([].push);
|
2151 |
|
2152 |
|
2153 | var createMethod$1 = function (TO_ENTRIES) {
|
2154 | return function (it) {
|
2155 | var O = toIndexedObject$2(it);
|
2156 | var keys = objectKeys(O);
|
2157 | var length = keys.length;
|
2158 | var i = 0;
|
2159 | var result = [];
|
2160 | var key;
|
2161 | while (length > i) {
|
2162 | key = keys[i++];
|
2163 | if (!DESCRIPTORS$5 || propertyIsEnumerable(O, key)) {
|
2164 | push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
|
2165 | }
|
2166 | }
|
2167 | return result;
|
2168 | };
|
2169 | };
|
2170 |
|
2171 | var objectToArray = {
|
2172 |
|
2173 |
|
2174 | entries: createMethod$1(true),
|
2175 |
|
2176 |
|
2177 | values: createMethod$1(false)
|
2178 | };
|
2179 |
|
2180 | var $$j = _export;
|
2181 | var $entries = objectToArray.entries;
|
2182 |
|
2183 |
|
2184 |
|
2185 | $$j({ target: 'Object', stat: true }, {
|
2186 | entries: function entries(O) {
|
2187 | return $entries(O);
|
2188 | }
|
2189 | });
|
2190 |
|
2191 | var wellKnownSymbol$c = wellKnownSymbol$j;
|
2192 | var create$1 = objectCreate;
|
2193 | var defineProperty$5 = objectDefineProperty.f;
|
2194 |
|
2195 | var UNSCOPABLES = wellKnownSymbol$c('unscopables');
|
2196 | var ArrayPrototype = Array.prototype;
|
2197 |
|
2198 |
|
2199 |
|
2200 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
2201 | defineProperty$5(ArrayPrototype, UNSCOPABLES, {
|
2202 | configurable: true,
|
2203 | value: create$1(null)
|
2204 | });
|
2205 | }
|
2206 |
|
2207 |
|
2208 | var addToUnscopables$4 = function (key) {
|
2209 | ArrayPrototype[UNSCOPABLES][key] = true;
|
2210 | };
|
2211 |
|
2212 | var $$i = _export;
|
2213 | var $includes = arrayIncludes.includes;
|
2214 | var fails$c = fails$u;
|
2215 | var addToUnscopables$3 = addToUnscopables$4;
|
2216 |
|
2217 |
|
2218 | var BROKEN_ON_SPARSE = fails$c(function () {
|
2219 |
|
2220 | return !Array(1).includes();
|
2221 | });
|
2222 |
|
2223 |
|
2224 |
|
2225 | $$i({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
2226 | includes: function includes(el /* , fromIndex = 0 */) {
|
2227 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
2228 | }
|
2229 | });
|
2230 |
|
2231 |
|
2232 | addToUnscopables$3('includes');
|
2233 |
|
2234 | var classof$1 = classofRaw$2;
|
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 | var isArray$5 = Array.isArray || function isArray(argument) {
|
2240 | return classof$1(argument) == 'Array';
|
2241 | };
|
2242 |
|
2243 | var $TypeError$4 = TypeError;
|
2244 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
2245 |
|
2246 | var doesNotExceedSafeInteger$2 = function (it) {
|
2247 | if (it > MAX_SAFE_INTEGER) throw $TypeError$4('Maximum allowed index exceeded');
|
2248 | return it;
|
2249 | };
|
2250 |
|
2251 | var isArray$4 = isArray$5;
|
2252 | var isConstructor$1 = isConstructor$3;
|
2253 | var isObject$4 = isObject$b;
|
2254 | var wellKnownSymbol$b = wellKnownSymbol$j;
|
2255 |
|
2256 | var SPECIES$3 = wellKnownSymbol$b('species');
|
2257 | var $Array$1 = Array;
|
2258 |
|
2259 |
|
2260 |
|
2261 | var arraySpeciesConstructor$1 = function (originalArray) {
|
2262 | var C;
|
2263 | if (isArray$4(originalArray)) {
|
2264 | C = originalArray.constructor;
|
2265 |
|
2266 | if (isConstructor$1(C) && (C === $Array$1 || isArray$4(C.prototype))) C = undefined;
|
2267 | else if (isObject$4(C)) {
|
2268 | C = C[SPECIES$3];
|
2269 | if (C === null) C = undefined;
|
2270 | }
|
2271 | } return C === undefined ? $Array$1 : C;
|
2272 | };
|
2273 |
|
2274 | var arraySpeciesConstructor = arraySpeciesConstructor$1;
|
2275 |
|
2276 |
|
2277 |
|
2278 | var arraySpeciesCreate$3 = function (originalArray, length) {
|
2279 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
2280 | };
|
2281 |
|
2282 | var fails$b = fails$u;
|
2283 | var wellKnownSymbol$a = wellKnownSymbol$j;
|
2284 | var V8_VERSION$1 = engineV8Version;
|
2285 |
|
2286 | var SPECIES$2 = wellKnownSymbol$a('species');
|
2287 |
|
2288 | var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
|
2289 |
|
2290 |
|
2291 |
|
2292 | return V8_VERSION$1 >= 51 || !fails$b(function () {
|
2293 | var array = [];
|
2294 | var constructor = array.constructor = {};
|
2295 | constructor[SPECIES$2] = function () {
|
2296 | return { foo: 1 };
|
2297 | };
|
2298 | return array[METHOD_NAME](Boolean).foo !== 1;
|
2299 | });
|
2300 | };
|
2301 |
|
2302 | var $$h = _export;
|
2303 | var fails$a = fails$u;
|
2304 | var isArray$3 = isArray$5;
|
2305 | var isObject$3 = isObject$b;
|
2306 | var toObject$6 = toObject$9;
|
2307 | var lengthOfArrayLike$4 = lengthOfArrayLike$7;
|
2308 | var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
|
2309 | var createProperty$2 = createProperty$4;
|
2310 | var arraySpeciesCreate$2 = arraySpeciesCreate$3;
|
2311 | var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
|
2312 | var wellKnownSymbol$9 = wellKnownSymbol$j;
|
2313 | var V8_VERSION = engineV8Version;
|
2314 |
|
2315 | var IS_CONCAT_SPREADABLE = wellKnownSymbol$9('isConcatSpreadable');
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () {
|
2321 | var array = [];
|
2322 | array[IS_CONCAT_SPREADABLE] = false;
|
2323 | return array.concat()[0] !== array;
|
2324 | });
|
2325 |
|
2326 | var isConcatSpreadable = function (O) {
|
2327 | if (!isObject$3(O)) return false;
|
2328 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
2329 | return spreadable !== undefined ? !!spreadable : isArray$3(O);
|
2330 | };
|
2331 |
|
2332 | var FORCED$5 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat');
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 | $$h({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, {
|
2338 |
|
2339 | concat: function concat(arg) {
|
2340 | var O = toObject$6(this);
|
2341 | var A = arraySpeciesCreate$2(O, 0);
|
2342 | var n = 0;
|
2343 | var i, k, length, len, E;
|
2344 | for (i = -1, length = arguments.length; i < length; i++) {
|
2345 | E = i === -1 ? O : arguments[i];
|
2346 | if (isConcatSpreadable(E)) {
|
2347 | len = lengthOfArrayLike$4(E);
|
2348 | doesNotExceedSafeInteger$1(n + len);
|
2349 | for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
|
2350 | } else {
|
2351 | doesNotExceedSafeInteger$1(n + 1);
|
2352 | createProperty$2(A, n++, E);
|
2353 | }
|
2354 | }
|
2355 | A.length = n;
|
2356 | return A;
|
2357 | }
|
2358 | });
|
2359 |
|
2360 | var uncurryThis$g = functionUncurryThisClause;
|
2361 | var aCallable$2 = aCallable$4;
|
2362 | var NATIVE_BIND = functionBindNative;
|
2363 |
|
2364 | var bind$1 = uncurryThis$g(uncurryThis$g.bind);
|
2365 |
|
2366 |
|
2367 | var functionBindContext = function (fn, that) {
|
2368 | aCallable$2(fn);
|
2369 | return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
|
2370 | return fn.apply(that, arguments);
|
2371 | };
|
2372 | };
|
2373 |
|
2374 | var bind = functionBindContext;
|
2375 | var uncurryThis$f = functionUncurryThis;
|
2376 | var IndexedObject = indexedObject;
|
2377 | var toObject$5 = toObject$9;
|
2378 | var lengthOfArrayLike$3 = lengthOfArrayLike$7;
|
2379 | var arraySpeciesCreate$1 = arraySpeciesCreate$3;
|
2380 |
|
2381 | var push$2 = uncurryThis$f([].push);
|
2382 |
|
2383 |
|
2384 | var createMethod = function (TYPE) {
|
2385 | var IS_MAP = TYPE == 1;
|
2386 | var IS_FILTER = TYPE == 2;
|
2387 | var IS_SOME = TYPE == 3;
|
2388 | var IS_EVERY = TYPE == 4;
|
2389 | var IS_FIND_INDEX = TYPE == 6;
|
2390 | var IS_FILTER_REJECT = TYPE == 7;
|
2391 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
2392 | return function ($this, callbackfn, that, specificCreate) {
|
2393 | var O = toObject$5($this);
|
2394 | var self = IndexedObject(O);
|
2395 | var boundFunction = bind(callbackfn, that);
|
2396 | var length = lengthOfArrayLike$3(self);
|
2397 | var index = 0;
|
2398 | var create = specificCreate || arraySpeciesCreate$1;
|
2399 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
2400 | var value, result;
|
2401 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
2402 | value = self[index];
|
2403 | result = boundFunction(value, index, O);
|
2404 | if (TYPE) {
|
2405 | if (IS_MAP) target[index] = result;
|
2406 | else if (result) switch (TYPE) {
|
2407 | case 3: return true;
|
2408 | case 5: return value;
|
2409 | case 6: return index;
|
2410 | case 2: push$2(target, value);
|
2411 | } else switch (TYPE) {
|
2412 | case 4: return false;
|
2413 | case 7: push$2(target, value);
|
2414 | }
|
2415 | }
|
2416 | }
|
2417 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
2418 | };
|
2419 | };
|
2420 |
|
2421 | var arrayIteration = {
|
2422 |
|
2423 |
|
2424 | forEach: createMethod(0),
|
2425 |
|
2426 |
|
2427 | map: createMethod(1),
|
2428 |
|
2429 |
|
2430 | filter: createMethod(2),
|
2431 |
|
2432 |
|
2433 | some: createMethod(3),
|
2434 |
|
2435 |
|
2436 | every: createMethod(4),
|
2437 |
|
2438 |
|
2439 | find: createMethod(5),
|
2440 |
|
2441 |
|
2442 | findIndex: createMethod(6),
|
2443 |
|
2444 |
|
2445 | filterReject: createMethod(7)
|
2446 | };
|
2447 |
|
2448 | var $$g = _export;
|
2449 | var $find = arrayIteration.find;
|
2450 | var addToUnscopables$2 = addToUnscopables$4;
|
2451 |
|
2452 | var FIND = 'find';
|
2453 | var SKIPS_HOLES$1 = true;
|
2454 |
|
2455 |
|
2456 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
|
2457 |
|
2458 |
|
2459 |
|
2460 | $$g({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
|
2461 | find: function find(callbackfn /* , that = undefined */) {
|
2462 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2463 | }
|
2464 | });
|
2465 |
|
2466 |
|
2467 | addToUnscopables$2(FIND);
|
2468 |
|
2469 | var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
|
2470 | var classof = classof$6;
|
2471 |
|
2472 |
|
2473 |
|
2474 | var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
|
2475 | return '[object ' + classof(this) + ']';
|
2476 | };
|
2477 |
|
2478 | var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
2479 | var defineBuiltIn$4 = defineBuiltIn$7;
|
2480 | var toString$a = objectToString;
|
2481 |
|
2482 |
|
2483 |
|
2484 | if (!TO_STRING_TAG_SUPPORT) {
|
2485 | defineBuiltIn$4(Object.prototype, 'toString', toString$a, { unsafe: true });
|
2486 | }
|
2487 |
|
2488 | var isRegExp$1 = isRegexp;
|
2489 |
|
2490 | var $TypeError$3 = TypeError;
|
2491 |
|
2492 | var notARegexp = function (it) {
|
2493 | if (isRegExp$1(it)) {
|
2494 | throw $TypeError$3("The method doesn't accept regular expressions");
|
2495 | } return it;
|
2496 | };
|
2497 |
|
2498 | var wellKnownSymbol$8 = wellKnownSymbol$j;
|
2499 |
|
2500 | var MATCH$1 = wellKnownSymbol$8('match');
|
2501 |
|
2502 | var correctIsRegexpLogic = function (METHOD_NAME) {
|
2503 | var regexp = /./;
|
2504 | try {
|
2505 | '/./'[METHOD_NAME](regexp);
|
2506 | } catch (error1) {
|
2507 | try {
|
2508 | regexp[MATCH$1] = false;
|
2509 | return '/./'[METHOD_NAME](regexp);
|
2510 | } catch (error2) { }
|
2511 | } return false;
|
2512 | };
|
2513 |
|
2514 | var $$f = _export;
|
2515 | var uncurryThis$e = functionUncurryThis;
|
2516 | var notARegExp$2 = notARegexp;
|
2517 | var requireObjectCoercible$5 = requireObjectCoercible$b;
|
2518 | var toString$9 = toString$f;
|
2519 | var correctIsRegExpLogic$2 = correctIsRegexpLogic;
|
2520 |
|
2521 | var stringIndexOf$2 = uncurryThis$e(''.indexOf);
|
2522 |
|
2523 |
|
2524 |
|
2525 | $$f({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
|
2526 | includes: function includes(searchString /* , position = 0 */) {
|
2527 | return !!~stringIndexOf$2(
|
2528 | toString$9(requireObjectCoercible$5(this)),
|
2529 | toString$9(notARegExp$2(searchString)),
|
2530 | arguments.length > 1 ? arguments[1] : undefined
|
2531 | );
|
2532 | }
|
2533 | });
|
2534 |
|
2535 |
|
2536 |
|
2537 | var domIterables = {
|
2538 | CSSRuleList: 0,
|
2539 | CSSStyleDeclaration: 0,
|
2540 | CSSValueList: 0,
|
2541 | ClientRectList: 0,
|
2542 | DOMRectList: 0,
|
2543 | DOMStringList: 0,
|
2544 | DOMTokenList: 1,
|
2545 | DataTransferItemList: 0,
|
2546 | FileList: 0,
|
2547 | HTMLAllCollection: 0,
|
2548 | HTMLCollection: 0,
|
2549 | HTMLFormElement: 0,
|
2550 | HTMLSelectElement: 0,
|
2551 | MediaList: 0,
|
2552 | MimeTypeArray: 0,
|
2553 | NamedNodeMap: 0,
|
2554 | NodeList: 1,
|
2555 | PaintRequestList: 0,
|
2556 | Plugin: 0,
|
2557 | PluginArray: 0,
|
2558 | SVGLengthList: 0,
|
2559 | SVGNumberList: 0,
|
2560 | SVGPathSegList: 0,
|
2561 | SVGPointList: 0,
|
2562 | SVGStringList: 0,
|
2563 | SVGTransformList: 0,
|
2564 | SourceBufferList: 0,
|
2565 | StyleSheetList: 0,
|
2566 | TextTrackCueList: 0,
|
2567 | TextTrackList: 0,
|
2568 | TouchList: 0
|
2569 | };
|
2570 |
|
2571 |
|
2572 | var documentCreateElement = documentCreateElement$2;
|
2573 |
|
2574 | var classList = documentCreateElement('span').classList;
|
2575 | var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
|
2576 |
|
2577 | var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
|
2578 |
|
2579 | var $forEach = arrayIteration.forEach;
|
2580 | var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
|
2581 |
|
2582 | var STRICT_METHOD$1 = arrayMethodIsStrict$2('forEach');
|
2583 |
|
2584 |
|
2585 |
|
2586 | var arrayForEach = !STRICT_METHOD$1 ? function forEach(callbackfn /* , thisArg */) {
|
2587 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2588 |
|
2589 | } : [].forEach;
|
2590 |
|
2591 | var global$7 = global$k;
|
2592 | var DOMIterables$1 = domIterables;
|
2593 | var DOMTokenListPrototype$1 = domTokenListPrototype;
|
2594 | var forEach = arrayForEach;
|
2595 | var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
|
2596 |
|
2597 | var handlePrototype$1 = function (CollectionPrototype) {
|
2598 |
|
2599 | if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
|
2600 | createNonEnumerableProperty$3(CollectionPrototype, 'forEach', forEach);
|
2601 | } catch (error) {
|
2602 | CollectionPrototype.forEach = forEach;
|
2603 | }
|
2604 | };
|
2605 |
|
2606 | for (var COLLECTION_NAME$1 in DOMIterables$1) {
|
2607 | if (DOMIterables$1[COLLECTION_NAME$1]) {
|
2608 | handlePrototype$1(global$7[COLLECTION_NAME$1] && global$7[COLLECTION_NAME$1].prototype);
|
2609 | }
|
2610 | }
|
2611 |
|
2612 | handlePrototype$1(DOMTokenListPrototype$1);
|
2613 |
|
2614 | var global$6 = global$k;
|
2615 | var fails$9 = fails$u;
|
2616 | var uncurryThis$d = functionUncurryThis;
|
2617 | var toString$8 = toString$f;
|
2618 | var trim$2 = stringTrim.trim;
|
2619 | var whitespaces$1 = whitespaces$4;
|
2620 |
|
2621 | var charAt$2 = uncurryThis$d(''.charAt);
|
2622 | var $parseFloat$1 = global$6.parseFloat;
|
2623 | var Symbol$2 = global$6.Symbol;
|
2624 | var ITERATOR$4 = Symbol$2 && Symbol$2.iterator;
|
2625 | var FORCED$4 = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity
|
2626 |
|
2627 | || (ITERATOR$4 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$4)); }));
|
2628 |
|
2629 |
|
2630 |
|
2631 | var numberParseFloat = FORCED$4 ? function parseFloat(string) {
|
2632 | var trimmedString = trim$2(toString$8(string));
|
2633 | var result = $parseFloat$1(trimmedString);
|
2634 | return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result;
|
2635 | } : $parseFloat$1;
|
2636 |
|
2637 | var $$e = _export;
|
2638 | var $parseFloat = numberParseFloat;
|
2639 |
|
2640 |
|
2641 |
|
2642 | $$e({ global: true, forced: parseFloat != $parseFloat }, {
|
2643 | parseFloat: $parseFloat
|
2644 | });
|
2645 |
|
2646 | var $$d = _export;
|
2647 | var toObject$4 = toObject$9;
|
2648 | var nativeKeys = objectKeys$3;
|
2649 | var fails$8 = fails$u;
|
2650 |
|
2651 | var FAILS_ON_PRIMITIVES = fails$8(function () { nativeKeys(1); });
|
2652 |
|
2653 |
|
2654 |
|
2655 | $$d({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
2656 | keys: function keys(it) {
|
2657 | return nativeKeys(toObject$4(it));
|
2658 | }
|
2659 | });
|
2660 |
|
2661 |
|
2662 | var $$c = _export;
|
2663 | var uncurryThis$c = functionUncurryThisClause;
|
2664 | var $indexOf = arrayIncludes.indexOf;
|
2665 | var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
|
2666 |
|
2667 | var nativeIndexOf = uncurryThis$c([].indexOf);
|
2668 |
|
2669 | var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
|
2670 | var FORCED$3 = NEGATIVE_ZERO || !arrayMethodIsStrict$1('indexOf');
|
2671 |
|
2672 |
|
2673 |
|
2674 | $$c({ target: 'Array', proto: true, forced: FORCED$3 }, {
|
2675 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
2676 | var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
|
2677 | return NEGATIVE_ZERO
|
2678 |
|
2679 | ? nativeIndexOf(this, searchElement, fromIndex) || 0
|
2680 | : $indexOf(this, searchElement, fromIndex);
|
2681 | }
|
2682 | });
|
2683 |
|
2684 | var tryToString = tryToString$3;
|
2685 |
|
2686 | var $TypeError$2 = TypeError;
|
2687 |
|
2688 | var deletePropertyOrThrow$2 = function (O, P) {
|
2689 | if (!delete O[P]) throw $TypeError$2('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
2690 | };
|
2691 |
|
2692 | var arraySlice$1 = arraySliceSimple;
|
2693 |
|
2694 | var floor$1 = Math.floor;
|
2695 |
|
2696 | var mergeSort = function (array, comparefn) {
|
2697 | var length = array.length;
|
2698 | var middle = floor$1(length / 2);
|
2699 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
2700 | array,
|
2701 | mergeSort(arraySlice$1(array, 0, middle), comparefn),
|
2702 | mergeSort(arraySlice$1(array, middle), comparefn),
|
2703 | comparefn
|
2704 | );
|
2705 | };
|
2706 |
|
2707 | var insertionSort = function (array, comparefn) {
|
2708 | var length = array.length;
|
2709 | var i = 1;
|
2710 | var element, j;
|
2711 |
|
2712 | while (i < length) {
|
2713 | j = i;
|
2714 | element = array[i];
|
2715 | while (j && comparefn(array[j - 1], element) > 0) {
|
2716 | array[j] = array[--j];
|
2717 | }
|
2718 | if (j !== i++) array[j] = element;
|
2719 | } return array;
|
2720 | };
|
2721 |
|
2722 | var merge = function (array, left, right, comparefn) {
|
2723 | var llength = left.length;
|
2724 | var rlength = right.length;
|
2725 | var lindex = 0;
|
2726 | var rindex = 0;
|
2727 |
|
2728 | while (lindex < llength || rindex < rlength) {
|
2729 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
2730 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
2731 | : lindex < llength ? left[lindex++] : right[rindex++];
|
2732 | } return array;
|
2733 | };
|
2734 |
|
2735 | var arraySort = mergeSort;
|
2736 |
|
2737 | var userAgent$1 = engineUserAgent;
|
2738 |
|
2739 | var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
2740 |
|
2741 | var engineFfVersion = !!firefox && +firefox[1];
|
2742 |
|
2743 | var UA = engineUserAgent;
|
2744 |
|
2745 | var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
2746 |
|
2747 | var userAgent = engineUserAgent;
|
2748 |
|
2749 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
2750 |
|
2751 | var engineWebkitVersion = !!webkit && +webkit[1];
|
2752 |
|
2753 | var $$b = _export;
|
2754 | var uncurryThis$b = functionUncurryThis;
|
2755 | var aCallable$1 = aCallable$4;
|
2756 | var toObject$3 = toObject$9;
|
2757 | var lengthOfArrayLike$2 = lengthOfArrayLike$7;
|
2758 | var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
|
2759 | var toString$7 = toString$f;
|
2760 | var fails$7 = fails$u;
|
2761 | var internalSort = arraySort;
|
2762 | var arrayMethodIsStrict = arrayMethodIsStrict$4;
|
2763 | var FF = engineFfVersion;
|
2764 | var IE_OR_EDGE = engineIsIeOrEdge;
|
2765 | var V8 = engineV8Version;
|
2766 | var WEBKIT = engineWebkitVersion;
|
2767 |
|
2768 | var test$1 = [];
|
2769 | var nativeSort = uncurryThis$b(test$1.sort);
|
2770 | var push$1 = uncurryThis$b(test$1.push);
|
2771 |
|
2772 |
|
2773 | var FAILS_ON_UNDEFINED = fails$7(function () {
|
2774 | test$1.sort(undefined);
|
2775 | });
|
2776 |
|
2777 | var FAILS_ON_NULL = fails$7(function () {
|
2778 | test$1.sort(null);
|
2779 | });
|
2780 |
|
2781 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
2782 |
|
2783 | var STABLE_SORT = !fails$7(function () {
|
2784 |
|
2785 | if (V8) return V8 < 70;
|
2786 | if (FF && FF > 3) return;
|
2787 | if (IE_OR_EDGE) return true;
|
2788 | if (WEBKIT) return WEBKIT < 603;
|
2789 |
|
2790 | var result = '';
|
2791 | var code, chr, value, index;
|
2792 |
|
2793 |
|
2794 | for (code = 65; code < 76; code++) {
|
2795 | chr = String.fromCharCode(code);
|
2796 |
|
2797 | switch (code) {
|
2798 | case 66: case 69: case 70: case 72: value = 3; break;
|
2799 | case 68: case 71: value = 4; break;
|
2800 | default: value = 2;
|
2801 | }
|
2802 |
|
2803 | for (index = 0; index < 47; index++) {
|
2804 | test$1.push({ k: chr + index, v: value });
|
2805 | }
|
2806 | }
|
2807 |
|
2808 | test$1.sort(function (a, b) { return b.v - a.v; });
|
2809 |
|
2810 | for (index = 0; index < test$1.length; index++) {
|
2811 | chr = test$1[index].k.charAt(0);
|
2812 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
2813 | }
|
2814 |
|
2815 | return result !== 'DGBEFHACIJK';
|
2816 | });
|
2817 |
|
2818 | var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
2819 |
|
2820 | var getSortCompare = function (comparefn) {
|
2821 | return function (x, y) {
|
2822 | if (y === undefined) return -1;
|
2823 | if (x === undefined) return 1;
|
2824 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
2825 | return toString$7(x) > toString$7(y) ? 1 : -1;
|
2826 | };
|
2827 | };
|
2828 |
|
2829 |
|
2830 |
|
2831 | $$b({ target: 'Array', proto: true, forced: FORCED$2 }, {
|
2832 | sort: function sort(comparefn) {
|
2833 | if (comparefn !== undefined) aCallable$1(comparefn);
|
2834 |
|
2835 | var array = toObject$3(this);
|
2836 |
|
2837 | if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
2838 |
|
2839 | var items = [];
|
2840 | var arrayLength = lengthOfArrayLike$2(array);
|
2841 | var itemsLength, index;
|
2842 |
|
2843 | for (index = 0; index < arrayLength; index++) {
|
2844 | if (index in array) push$1(items, array[index]);
|
2845 | }
|
2846 |
|
2847 | internalSort(items, getSortCompare(comparefn));
|
2848 |
|
2849 | itemsLength = lengthOfArrayLike$2(items);
|
2850 | index = 0;
|
2851 |
|
2852 | while (index < itemsLength) array[index] = items[index++];
|
2853 | while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
|
2854 |
|
2855 | return array;
|
2856 | }
|
2857 | });
|
2858 |
|
2859 | var uncurryThis$a = functionUncurryThis;
|
2860 | var toObject$2 = toObject$9;
|
2861 |
|
2862 | var floor = Math.floor;
|
2863 | var charAt$1 = uncurryThis$a(''.charAt);
|
2864 | var replace$1 = uncurryThis$a(''.replace);
|
2865 | var stringSlice$4 = uncurryThis$a(''.slice);
|
2866 |
|
2867 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
2868 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
2869 |
|
2870 |
|
2871 |
|
2872 | var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
|
2873 | var tailPos = position + matched.length;
|
2874 | var m = captures.length;
|
2875 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
2876 | if (namedCaptures !== undefined) {
|
2877 | namedCaptures = toObject$2(namedCaptures);
|
2878 | symbols = SUBSTITUTION_SYMBOLS;
|
2879 | }
|
2880 | return replace$1(replacement, symbols, function (match, ch) {
|
2881 | var capture;
|
2882 | switch (charAt$1(ch, 0)) {
|
2883 | case '$': return '$';
|
2884 | case '&': return matched;
|
2885 | case '`': return stringSlice$4(str, 0, position);
|
2886 | case "'": return stringSlice$4(str, tailPos);
|
2887 | case '<':
|
2888 | capture = namedCaptures[stringSlice$4(ch, 1, -1)];
|
2889 | break;
|
2890 | default:
|
2891 | var n = +ch;
|
2892 | if (n === 0) return match;
|
2893 | if (n > m) {
|
2894 | var f = floor(n / 10);
|
2895 | if (f === 0) return match;
|
2896 | if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
|
2897 | return match;
|
2898 | }
|
2899 | capture = captures[n - 1];
|
2900 | }
|
2901 | return capture === undefined ? '' : capture;
|
2902 | });
|
2903 | };
|
2904 |
|
2905 | var apply = functionApply;
|
2906 | var call$4 = functionCall;
|
2907 | var uncurryThis$9 = functionUncurryThis;
|
2908 | var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
|
2909 | var fails$6 = fails$u;
|
2910 | var anObject$4 = anObject$d;
|
2911 | var isCallable$5 = isCallable$j;
|
2912 | var isNullOrUndefined$2 = isNullOrUndefined$7;
|
2913 | var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
|
2914 | var toLength$3 = toLength$6;
|
2915 | var toString$6 = toString$f;
|
2916 | var requireObjectCoercible$4 = requireObjectCoercible$b;
|
2917 | var advanceStringIndex$1 = advanceStringIndex$3;
|
2918 | var getMethod$2 = getMethod$5;
|
2919 | var getSubstitution = getSubstitution$1;
|
2920 | var regExpExec$2 = regexpExecAbstract;
|
2921 | var wellKnownSymbol$7 = wellKnownSymbol$j;
|
2922 |
|
2923 | var REPLACE = wellKnownSymbol$7('replace');
|
2924 | var max$2 = Math.max;
|
2925 | var min$3 = Math.min;
|
2926 | var concat = uncurryThis$9([].concat);
|
2927 | var push = uncurryThis$9([].push);
|
2928 | var stringIndexOf$1 = uncurryThis$9(''.indexOf);
|
2929 | var stringSlice$3 = uncurryThis$9(''.slice);
|
2930 |
|
2931 | var maybeToString = function (it) {
|
2932 | return it === undefined ? it : String(it);
|
2933 | };
|
2934 |
|
2935 |
|
2936 |
|
2937 | var REPLACE_KEEPS_$0 = (function () {
|
2938 |
|
2939 | return 'a'.replace(/./, '$0') === '$0';
|
2940 | })();
|
2941 |
|
2942 |
|
2943 | var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
2944 | if (/./[REPLACE]) {
|
2945 | return /./[REPLACE]('a', '$0') === '';
|
2946 | }
|
2947 | return false;
|
2948 | })();
|
2949 |
|
2950 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () {
|
2951 | var re = /./;
|
2952 | re.exec = function () {
|
2953 | var result = [];
|
2954 | result.groups = { a: '7' };
|
2955 | return result;
|
2956 | };
|
2957 |
|
2958 | return ''.replace(re, '$<a>') !== '7';
|
2959 | });
|
2960 |
|
2961 |
|
2962 | fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) {
|
2963 | var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
2964 |
|
2965 | return [
|
2966 |
|
2967 |
|
2968 | function replace(searchValue, replaceValue) {
|
2969 | var O = requireObjectCoercible$4(this);
|
2970 | var replacer = isNullOrUndefined$2(searchValue) ? undefined : getMethod$2(searchValue, REPLACE);
|
2971 | return replacer
|
2972 | ? call$4(replacer, searchValue, O, replaceValue)
|
2973 | : call$4(nativeReplace, toString$6(O), searchValue, replaceValue);
|
2974 | },
|
2975 |
|
2976 |
|
2977 | function (string, replaceValue) {
|
2978 | var rx = anObject$4(this);
|
2979 | var S = toString$6(string);
|
2980 |
|
2981 | if (
|
2982 | typeof replaceValue == 'string' &&
|
2983 | stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
2984 | stringIndexOf$1(replaceValue, '$<') === -1
|
2985 | ) {
|
2986 | var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
2987 | if (res.done) return res.value;
|
2988 | }
|
2989 |
|
2990 | var functionalReplace = isCallable$5(replaceValue);
|
2991 | if (!functionalReplace) replaceValue = toString$6(replaceValue);
|
2992 |
|
2993 | var global = rx.global;
|
2994 | if (global) {
|
2995 | var fullUnicode = rx.unicode;
|
2996 | rx.lastIndex = 0;
|
2997 | }
|
2998 | var results = [];
|
2999 | while (true) {
|
3000 | var result = regExpExec$2(rx, S);
|
3001 | if (result === null) break;
|
3002 |
|
3003 | push(results, result);
|
3004 | if (!global) break;
|
3005 |
|
3006 | var matchStr = toString$6(result[0]);
|
3007 | if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
|
3008 | }
|
3009 |
|
3010 | var accumulatedResult = '';
|
3011 | var nextSourcePosition = 0;
|
3012 | for (var i = 0; i < results.length; i++) {
|
3013 | result = results[i];
|
3014 |
|
3015 | var matched = toString$6(result[0]);
|
3016 | var position = max$2(min$3(toIntegerOrInfinity$1(result.index), S.length), 0);
|
3017 | var captures = [];
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 | for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
3024 | var namedCaptures = result.groups;
|
3025 | if (functionalReplace) {
|
3026 | var replacerArgs = concat([matched], captures, position, S);
|
3027 | if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
3028 | var replacement = toString$6(apply(replaceValue, undefined, replacerArgs));
|
3029 | } else {
|
3030 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
3031 | }
|
3032 | if (position >= nextSourcePosition) {
|
3033 | accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
|
3034 | nextSourcePosition = position + matched.length;
|
3035 | }
|
3036 | }
|
3037 | return accumulatedResult + stringSlice$3(S, nextSourcePosition);
|
3038 | }
|
3039 | ];
|
3040 | }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
3041 |
|
3042 | var $$a = _export;
|
3043 | var $filter = arrayIteration.filter;
|
3044 | var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
|
3045 |
|
3046 | var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 | $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
|
3052 | filter: function filter(callbackfn /* , thisArg */) {
|
3053 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3054 | }
|
3055 | });
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 | var sameValue$1 = Object.is || function is(x, y) {
|
3061 |
|
3062 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
3063 | };
|
3064 |
|
3065 | var call$3 = functionCall;
|
3066 | var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
3067 | var anObject$3 = anObject$d;
|
3068 | var isNullOrUndefined$1 = isNullOrUndefined$7;
|
3069 | var requireObjectCoercible$3 = requireObjectCoercible$b;
|
3070 | var sameValue = sameValue$1;
|
3071 | var toString$5 = toString$f;
|
3072 | var getMethod$1 = getMethod$5;
|
3073 | var regExpExec$1 = regexpExecAbstract;
|
3074 |
|
3075 |
|
3076 | fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
3077 | return [
|
3078 |
|
3079 |
|
3080 | function search(regexp) {
|
3081 | var O = requireObjectCoercible$3(this);
|
3082 | var searcher = isNullOrUndefined$1(regexp) ? undefined : getMethod$1(regexp, SEARCH);
|
3083 | return searcher ? call$3(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$5(O));
|
3084 | },
|
3085 |
|
3086 |
|
3087 | function (string) {
|
3088 | var rx = anObject$3(this);
|
3089 | var S = toString$5(string);
|
3090 | var res = maybeCallNative(nativeSearch, rx, S);
|
3091 |
|
3092 | if (res.done) return res.value;
|
3093 |
|
3094 | var previousLastIndex = rx.lastIndex;
|
3095 | if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
3096 | var result = regExpExec$1(rx, S);
|
3097 | if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
3098 | return result === null ? -1 : result.index;
|
3099 | }
|
3100 | ];
|
3101 | });
|
3102 |
|
3103 | var global$5 = global$k;
|
3104 | var fails$5 = fails$u;
|
3105 | var uncurryThis$8 = functionUncurryThis;
|
3106 | var toString$4 = toString$f;
|
3107 | var trim$1 = stringTrim.trim;
|
3108 | var whitespaces = whitespaces$4;
|
3109 |
|
3110 | var $parseInt$1 = global$5.parseInt;
|
3111 | var Symbol$1 = global$5.Symbol;
|
3112 | var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
|
3113 | var hex = /^[+-]?0x/i;
|
3114 | var exec$1 = uncurryThis$8(hex.exec);
|
3115 | var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
3116 |
|
3117 | || (ITERATOR$3 && !fails$5(function () { $parseInt$1(Object(ITERATOR$3)); }));
|
3118 |
|
3119 |
|
3120 |
|
3121 | var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
|
3122 | var S = trim$1(toString$4(string));
|
3123 | return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
|
3124 | } : $parseInt$1;
|
3125 |
|
3126 | var $$9 = _export;
|
3127 | var $parseInt = numberParseInt;
|
3128 |
|
3129 |
|
3130 |
|
3131 | $$9({ global: true, forced: parseInt != $parseInt }, {
|
3132 | parseInt: $parseInt
|
3133 | });
|
3134 |
|
3135 | var $$8 = _export;
|
3136 | var $map = arrayIteration.map;
|
3137 | var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
|
3138 |
|
3139 | var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
|
3140 |
|
3141 |
|
3142 |
|
3143 |
|
3144 | $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
|
3145 | map: function map(callbackfn /* , thisArg */) {
|
3146 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3147 | }
|
3148 | });
|
3149 |
|
3150 | var $$7 = _export;
|
3151 | var $findIndex = arrayIteration.findIndex;
|
3152 | var addToUnscopables$1 = addToUnscopables$4;
|
3153 |
|
3154 | var FIND_INDEX = 'findIndex';
|
3155 | var SKIPS_HOLES = true;
|
3156 |
|
3157 |
|
3158 | if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
|
3159 |
|
3160 |
|
3161 |
|
3162 | $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
3163 | findIndex: function findIndex(callbackfn /* , that = undefined */) {
|
3164 | return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3165 | }
|
3166 | });
|
3167 |
|
3168 |
|
3169 | addToUnscopables$1(FIND_INDEX);
|
3170 |
|
3171 | var uncurryThis$7 = functionUncurryThis;
|
3172 | var aCallable = aCallable$4;
|
3173 |
|
3174 | var functionUncurryThisAccessor = function (object, key, method) {
|
3175 | try {
|
3176 |
|
3177 | return uncurryThis$7(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
3178 | } catch (error) { }
|
3179 | };
|
3180 |
|
3181 | var isCallable$4 = isCallable$j;
|
3182 |
|
3183 | var $String = String;
|
3184 | var $TypeError$1 = TypeError;
|
3185 |
|
3186 | var aPossiblePrototype$1 = function (argument) {
|
3187 | if (typeof argument == 'object' || isCallable$4(argument)) return argument;
|
3188 | throw $TypeError$1("Can't set " + $String(argument) + ' as a prototype');
|
3189 | };
|
3190 |
|
3191 |
|
3192 |
|
3193 | var uncurryThisAccessor = functionUncurryThisAccessor;
|
3194 | var anObject$2 = anObject$d;
|
3195 | var aPossiblePrototype = aPossiblePrototype$1;
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
3202 | var CORRECT_SETTER = false;
|
3203 | var test = {};
|
3204 | var setter;
|
3205 | try {
|
3206 | setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
3207 | setter(test, []);
|
3208 | CORRECT_SETTER = test instanceof Array;
|
3209 | } catch (error) { }
|
3210 | return function setPrototypeOf(O, proto) {
|
3211 | anObject$2(O);
|
3212 | aPossiblePrototype(proto);
|
3213 | if (CORRECT_SETTER) setter(O, proto);
|
3214 | else O.__proto__ = proto;
|
3215 | return O;
|
3216 | };
|
3217 | }() : undefined);
|
3218 |
|
3219 | var isCallable$3 = isCallable$j;
|
3220 | var isObject$2 = isObject$b;
|
3221 | var setPrototypeOf$1 = objectSetPrototypeOf;
|
3222 |
|
3223 |
|
3224 | var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
|
3225 | var NewTarget, NewTargetPrototype;
|
3226 | if (
|
3227 |
|
3228 | setPrototypeOf$1 &&
|
3229 |
|
3230 | isCallable$3(NewTarget = dummy.constructor) &&
|
3231 | NewTarget !== Wrapper &&
|
3232 | isObject$2(NewTargetPrototype = NewTarget.prototype) &&
|
3233 | NewTargetPrototype !== Wrapper.prototype
|
3234 | ) setPrototypeOf$1($this, NewTargetPrototype);
|
3235 | return $this;
|
3236 | };
|
3237 |
|
3238 | var call$2 = functionCall;
|
3239 | var hasOwn$4 = hasOwnProperty_1;
|
3240 | var isPrototypeOf$2 = objectIsPrototypeOf;
|
3241 | var regExpFlags = regexpFlags$1;
|
3242 |
|
3243 | var RegExpPrototype$2 = RegExp.prototype;
|
3244 |
|
3245 | var regexpGetFlags = function (R) {
|
3246 | var flags = R.flags;
|
3247 | return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$4(R, 'flags') && isPrototypeOf$2(RegExpPrototype$2, R)
|
3248 | ? call$2(regExpFlags, R) : flags;
|
3249 | };
|
3250 |
|
3251 | var defineProperty$4 = objectDefineProperty.f;
|
3252 |
|
3253 | var proxyAccessor$1 = function (Target, Source, key) {
|
3254 | key in Target || defineProperty$4(Target, key, {
|
3255 | configurable: true,
|
3256 | get: function () { return Source[key]; },
|
3257 | set: function (it) { Source[key] = it; }
|
3258 | });
|
3259 | };
|
3260 |
|
3261 | var makeBuiltIn = makeBuiltInExports;
|
3262 | var defineProperty$3 = objectDefineProperty;
|
3263 |
|
3264 | var defineBuiltInAccessor$1 = function (target, name, descriptor) {
|
3265 | if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
3266 | if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
3267 | return defineProperty$3.f(target, name, descriptor);
|
3268 | };
|
3269 |
|
3270 | var getBuiltIn = getBuiltIn$5;
|
3271 | var defineBuiltInAccessor = defineBuiltInAccessor$1;
|
3272 | var wellKnownSymbol$6 = wellKnownSymbol$j;
|
3273 | var DESCRIPTORS$4 = descriptors;
|
3274 |
|
3275 | var SPECIES$1 = wellKnownSymbol$6('species');
|
3276 |
|
3277 | var setSpecies$1 = function (CONSTRUCTOR_NAME) {
|
3278 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
3279 |
|
3280 | if (DESCRIPTORS$4 && Constructor && !Constructor[SPECIES$1]) {
|
3281 | defineBuiltInAccessor(Constructor, SPECIES$1, {
|
3282 | configurable: true,
|
3283 | get: function () { return this; }
|
3284 | });
|
3285 | }
|
3286 | };
|
3287 |
|
3288 | var DESCRIPTORS$3 = descriptors;
|
3289 | var global$4 = global$k;
|
3290 | var uncurryThis$6 = functionUncurryThis;
|
3291 | var isForced$1 = isForced_1;
|
3292 | var inheritIfRequired$1 = inheritIfRequired$2;
|
3293 | var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
|
3294 | var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
3295 | var isPrototypeOf$1 = objectIsPrototypeOf;
|
3296 | var isRegExp = isRegexp;
|
3297 | var toString$3 = toString$f;
|
3298 | var getRegExpFlags$1 = regexpGetFlags;
|
3299 | var stickyHelpers = regexpStickyHelpers;
|
3300 | var proxyAccessor = proxyAccessor$1;
|
3301 | var defineBuiltIn$3 = defineBuiltIn$7;
|
3302 | var fails$4 = fails$u;
|
3303 | var hasOwn$3 = hasOwnProperty_1;
|
3304 | var enforceInternalState = internalState.enforce;
|
3305 | var setSpecies = setSpecies$1;
|
3306 | var wellKnownSymbol$5 = wellKnownSymbol$j;
|
3307 | var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
3308 | var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
3309 |
|
3310 | var MATCH = wellKnownSymbol$5('match');
|
3311 | var NativeRegExp = global$4.RegExp;
|
3312 | var RegExpPrototype$1 = NativeRegExp.prototype;
|
3313 | var SyntaxError = global$4.SyntaxError;
|
3314 | var exec = uncurryThis$6(RegExpPrototype$1.exec);
|
3315 | var charAt = uncurryThis$6(''.charAt);
|
3316 | var replace = uncurryThis$6(''.replace);
|
3317 | var stringIndexOf = uncurryThis$6(''.indexOf);
|
3318 | var stringSlice$2 = uncurryThis$6(''.slice);
|
3319 |
|
3320 | var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
|
3321 | var re1 = /a/g;
|
3322 | var re2 = /a/g;
|
3323 |
|
3324 |
|
3325 | var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
3326 |
|
3327 | var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
|
3328 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
3329 |
|
3330 | var BASE_FORCED = DESCRIPTORS$3 &&
|
3331 | (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$4(function () {
|
3332 | re2[MATCH] = false;
|
3333 |
|
3334 | return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
3335 | }));
|
3336 |
|
3337 | var handleDotAll = function (string) {
|
3338 | var length = string.length;
|
3339 | var index = 0;
|
3340 | var result = '';
|
3341 | var brackets = false;
|
3342 | var chr;
|
3343 | for (; index <= length; index++) {
|
3344 | chr = charAt(string, index);
|
3345 | if (chr === '\\') {
|
3346 | result += chr + charAt(string, ++index);
|
3347 | continue;
|
3348 | }
|
3349 | if (!brackets && chr === '.') {
|
3350 | result += '[\\s\\S]';
|
3351 | } else {
|
3352 | if (chr === '[') {
|
3353 | brackets = true;
|
3354 | } else if (chr === ']') {
|
3355 | brackets = false;
|
3356 | } result += chr;
|
3357 | }
|
3358 | } return result;
|
3359 | };
|
3360 |
|
3361 | var handleNCG = function (string) {
|
3362 | var length = string.length;
|
3363 | var index = 0;
|
3364 | var result = '';
|
3365 | var named = [];
|
3366 | var names = {};
|
3367 | var brackets = false;
|
3368 | var ncg = false;
|
3369 | var groupid = 0;
|
3370 | var groupname = '';
|
3371 | var chr;
|
3372 | for (; index <= length; index++) {
|
3373 | chr = charAt(string, index);
|
3374 | if (chr === '\\') {
|
3375 | chr = chr + charAt(string, ++index);
|
3376 | } else if (chr === ']') {
|
3377 | brackets = false;
|
3378 | } else if (!brackets) switch (true) {
|
3379 | case chr === '[':
|
3380 | brackets = true;
|
3381 | break;
|
3382 | case chr === '(':
|
3383 | if (exec(IS_NCG, stringSlice$2(string, index + 1))) {
|
3384 | index += 2;
|
3385 | ncg = true;
|
3386 | }
|
3387 | result += chr;
|
3388 | groupid++;
|
3389 | continue;
|
3390 | case chr === '>' && ncg:
|
3391 | if (groupname === '' || hasOwn$3(names, groupname)) {
|
3392 | throw new SyntaxError('Invalid capture group name');
|
3393 | }
|
3394 | names[groupname] = true;
|
3395 | named[named.length] = [groupname, groupid];
|
3396 | ncg = false;
|
3397 | groupname = '';
|
3398 | continue;
|
3399 | }
|
3400 | if (ncg) groupname += chr;
|
3401 | else result += chr;
|
3402 | } return [result, named];
|
3403 | };
|
3404 |
|
3405 |
|
3406 |
|
3407 | if (isForced$1('RegExp', BASE_FORCED)) {
|
3408 | var RegExpWrapper = function RegExp(pattern, flags) {
|
3409 | var thisIsRegExp = isPrototypeOf$1(RegExpPrototype$1, this);
|
3410 | var patternIsRegExp = isRegExp(pattern);
|
3411 | var flagsAreUndefined = flags === undefined;
|
3412 | var groups = [];
|
3413 | var rawPattern = pattern;
|
3414 | var rawFlags, dotAll, sticky, handled, result, state;
|
3415 |
|
3416 | if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
|
3417 | return pattern;
|
3418 | }
|
3419 |
|
3420 | if (patternIsRegExp || isPrototypeOf$1(RegExpPrototype$1, pattern)) {
|
3421 | pattern = pattern.source;
|
3422 | if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
|
3423 | }
|
3424 |
|
3425 | pattern = pattern === undefined ? '' : toString$3(pattern);
|
3426 | flags = flags === undefined ? '' : toString$3(flags);
|
3427 | rawPattern = pattern;
|
3428 |
|
3429 | if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
|
3430 | dotAll = !!flags && stringIndexOf(flags, 's') > -1;
|
3431 | if (dotAll) flags = replace(flags, /s/g, '');
|
3432 | }
|
3433 |
|
3434 | rawFlags = flags;
|
3435 |
|
3436 | if (MISSED_STICKY && 'sticky' in re1) {
|
3437 | sticky = !!flags && stringIndexOf(flags, 'y') > -1;
|
3438 | if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');
|
3439 | }
|
3440 |
|
3441 | if (UNSUPPORTED_NCG) {
|
3442 | handled = handleNCG(pattern);
|
3443 | pattern = handled[0];
|
3444 | groups = handled[1];
|
3445 | }
|
3446 |
|
3447 | result = inheritIfRequired$1(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$1, RegExpWrapper);
|
3448 |
|
3449 | if (dotAll || sticky || groups.length) {
|
3450 | state = enforceInternalState(result);
|
3451 | if (dotAll) {
|
3452 | state.dotAll = true;
|
3453 | state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
|
3454 | }
|
3455 | if (sticky) state.sticky = true;
|
3456 | if (groups.length) state.groups = groups;
|
3457 | }
|
3458 |
|
3459 | if (pattern !== rawPattern) try {
|
3460 |
|
3461 | createNonEnumerableProperty$2(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
|
3462 | } catch (error) { }
|
3463 |
|
3464 | return result;
|
3465 | };
|
3466 |
|
3467 | for (var keys = getOwnPropertyNames$1(NativeRegExp), index = 0; keys.length > index;) {
|
3468 | proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
|
3469 | }
|
3470 |
|
3471 | RegExpPrototype$1.constructor = RegExpWrapper;
|
3472 | RegExpWrapper.prototype = RegExpPrototype$1;
|
3473 | defineBuiltIn$3(global$4, 'RegExp', RegExpWrapper, { constructor: true });
|
3474 | }
|
3475 |
|
3476 | // https://tc39.es/ecma262/#sec-get-regexp-@@species
|
3477 | setSpecies('RegExp');
|
3478 |
|
3479 | var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
3480 | var defineBuiltIn$2 = defineBuiltIn$7;
|
3481 | var anObject$1 = anObject$d;
|
3482 | var $toString = toString$f;
|
3483 | var fails$3 = fails$u;
|
3484 | var getRegExpFlags = regexpGetFlags;
|
3485 |
|
3486 | var TO_STRING = 'toString';
|
3487 | var RegExpPrototype = RegExp.prototype;
|
3488 | var nativeToString = RegExpPrototype[TO_STRING];
|
3489 |
|
3490 | var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
3491 |
|
3492 | var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING;
|
3493 |
|
3494 |
|
3495 |
|
3496 | if (NOT_GENERIC || INCORRECT_NAME) {
|
3497 | defineBuiltIn$2(RegExp.prototype, TO_STRING, function toString() {
|
3498 | var R = anObject$1(this);
|
3499 | var pattern = $toString(R.source);
|
3500 | var flags = $toString(getRegExpFlags(R));
|
3501 | return '/' + pattern + '/' + flags;
|
3502 | }, { unsafe: true });
|
3503 | }
|
3504 |
|
3505 | var uncurryThis$5 = functionUncurryThis;
|
3506 |
|
3507 | var arraySlice = uncurryThis$5([].slice);
|
3508 |
|
3509 | var $$6 = _export;
|
3510 | var isArray$2 = isArray$5;
|
3511 | var isConstructor = isConstructor$3;
|
3512 | var isObject$1 = isObject$b;
|
3513 | var toAbsoluteIndex$1 = toAbsoluteIndex$4;
|
3514 | var lengthOfArrayLike$1 = lengthOfArrayLike$7;
|
3515 | var toIndexedObject$1 = toIndexedObject$8;
|
3516 | var createProperty$1 = createProperty$4;
|
3517 | var wellKnownSymbol$4 = wellKnownSymbol$j;
|
3518 | var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
|
3519 | var nativeSlice = arraySlice;
|
3520 |
|
3521 | var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
|
3522 |
|
3523 | var SPECIES = wellKnownSymbol$4('species');
|
3524 | var $Array = Array;
|
3525 | var max$1 = Math.max;
|
3526 |
|
3527 |
|
3528 |
|
3529 |
|
3530 | $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
|
3531 | slice: function slice(start, end) {
|
3532 | var O = toIndexedObject$1(this);
|
3533 | var length = lengthOfArrayLike$1(O);
|
3534 | var k = toAbsoluteIndex$1(start, length);
|
3535 | var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
|
3536 |
|
3537 | var Constructor, result, n;
|
3538 | if (isArray$2(O)) {
|
3539 | Constructor = O.constructor;
|
3540 |
|
3541 | if (isConstructor(Constructor) && (Constructor === $Array || isArray$2(Constructor.prototype))) {
|
3542 | Constructor = undefined;
|
3543 | } else if (isObject$1(Constructor)) {
|
3544 | Constructor = Constructor[SPECIES];
|
3545 | if (Constructor === null) Constructor = undefined;
|
3546 | }
|
3547 | if (Constructor === $Array || Constructor === undefined) {
|
3548 | return nativeSlice(O, k, fin);
|
3549 | }
|
3550 | }
|
3551 | result = new (Constructor === undefined ? $Array : Constructor)(max$1(fin - k, 0));
|
3552 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
|
3553 | result.length = n;
|
3554 | return result;
|
3555 | }
|
3556 | });
|
3557 |
|
3558 | var iterators = {};
|
3559 |
|
3560 | var fails$2 = fails$u;
|
3561 |
|
3562 | var correctPrototypeGetter = !fails$2(function () {
|
3563 | function F() { }
|
3564 | F.prototype.constructor = null;
|
3565 |
|
3566 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
3567 | });
|
3568 |
|
3569 | var hasOwn$2 = hasOwnProperty_1;
|
3570 | var isCallable$2 = isCallable$j;
|
3571 | var toObject$1 = toObject$9;
|
3572 | var sharedKey = sharedKey$3;
|
3573 | var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
3574 |
|
3575 | var IE_PROTO = sharedKey('IE_PROTO');
|
3576 | var $Object = Object;
|
3577 | var ObjectPrototype = $Object.prototype;
|
3578 |
|
3579 |
|
3580 |
|
3581 |
|
3582 | var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
3583 | var object = toObject$1(O);
|
3584 | if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
3585 | var constructor = object.constructor;
|
3586 | if (isCallable$2(constructor) && object instanceof constructor) {
|
3587 | return constructor.prototype;
|
3588 | } return object instanceof $Object ? ObjectPrototype : null;
|
3589 | };
|
3590 |
|
3591 | var fails$1 = fails$u;
|
3592 | var isCallable$1 = isCallable$j;
|
3593 | var isObject = isObject$b;
|
3594 | var getPrototypeOf$1 = objectGetPrototypeOf;
|
3595 | var defineBuiltIn$1 = defineBuiltIn$7;
|
3596 | var wellKnownSymbol$3 = wellKnownSymbol$j;
|
3597 |
|
3598 | var ITERATOR$2 = wellKnownSymbol$3('iterator');
|
3599 | var BUGGY_SAFARI_ITERATORS$1 = false;
|
3600 |
|
3601 | // `%IteratorPrototype%` object
|
3602 | // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
3603 | var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
3604 |
|
3605 | /* eslint-disable es/no-array-prototype-keys -- safe */
|
3606 | if ([].keys) {
|
3607 | arrayIterator = [].keys();
|
3608 |
|
3609 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
3610 | else {
|
3611 | PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
3612 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
3613 | }
|
3614 | }
|
3615 |
|
3616 | var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$1(function () {
|
3617 | var test = {};
|
3618 |
|
3619 | return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
3620 | });
|
3621 |
|
3622 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
3623 |
|
3624 |
|
3625 |
|
3626 | if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
|
3627 | defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
|
3628 | return this;
|
3629 | });
|
3630 | }
|
3631 |
|
3632 | var iteratorsCore = {
|
3633 | IteratorPrototype: IteratorPrototype$2,
|
3634 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
3635 | };
|
3636 |
|
3637 | var defineProperty$2 = objectDefineProperty.f;
|
3638 | var hasOwn$1 = hasOwnProperty_1;
|
3639 | var wellKnownSymbol$2 = wellKnownSymbol$j;
|
3640 |
|
3641 | var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
|
3642 |
|
3643 | var setToStringTag$2 = function (target, TAG, STATIC) {
|
3644 | if (target && !STATIC) target = target.prototype;
|
3645 | if (target && !hasOwn$1(target, TO_STRING_TAG$1)) {
|
3646 | defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
|
3647 | }
|
3648 | };
|
3649 |
|
3650 | var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
3651 | var create = objectCreate;
|
3652 | var createPropertyDescriptor = createPropertyDescriptor$4;
|
3653 | var setToStringTag$1 = setToStringTag$2;
|
3654 | var Iterators$2 = iterators;
|
3655 |
|
3656 | var returnThis$1 = function () { return this; };
|
3657 |
|
3658 | var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
3659 | var TO_STRING_TAG = NAME + ' Iterator';
|
3660 | IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
3661 | setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
|
3662 | Iterators$2[TO_STRING_TAG] = returnThis$1;
|
3663 | return IteratorConstructor;
|
3664 | };
|
3665 |
|
3666 | var $$5 = _export;
|
3667 | var call$1 = functionCall;
|
3668 | var FunctionName = functionName;
|
3669 | var isCallable = isCallable$j;
|
3670 | var createIteratorConstructor = iteratorCreateConstructor;
|
3671 | var getPrototypeOf = objectGetPrototypeOf;
|
3672 | var setPrototypeOf = objectSetPrototypeOf;
|
3673 | var setToStringTag = setToStringTag$2;
|
3674 | var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
|
3675 | var defineBuiltIn = defineBuiltIn$7;
|
3676 | var wellKnownSymbol$1 = wellKnownSymbol$j;
|
3677 | var Iterators$1 = iterators;
|
3678 | var IteratorsCore = iteratorsCore;
|
3679 |
|
3680 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
3681 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
3682 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
3683 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
3684 | var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
3685 | var KEYS = 'keys';
|
3686 | var VALUES = 'values';
|
3687 | var ENTRIES = 'entries';
|
3688 |
|
3689 | var returnThis = function () { return this; };
|
3690 |
|
3691 | var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
3692 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
3693 |
|
3694 | var getIterationMethod = function (KIND) {
|
3695 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
3696 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
3697 | switch (KIND) {
|
3698 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
3699 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
3700 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
3701 | } return function () { return new IteratorConstructor(this); };
|
3702 | };
|
3703 |
|
3704 | var TO_STRING_TAG = NAME + ' Iterator';
|
3705 | var INCORRECT_VALUES_NAME = false;
|
3706 | var IterablePrototype = Iterable.prototype;
|
3707 | var nativeIterator = IterablePrototype[ITERATOR$1]
|
3708 | || IterablePrototype['@@iterator']
|
3709 | || DEFAULT && IterablePrototype[DEFAULT];
|
3710 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
3711 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
3712 | var CurrentIteratorPrototype, methods, KEY;
|
3713 |
|
3714 |
|
3715 | if (anyNativeIterator) {
|
3716 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
3717 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
3718 | if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
3719 | if (setPrototypeOf) {
|
3720 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
3721 | } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
3722 | defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
3723 | }
|
3724 | }
|
3725 |
|
3726 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
3727 | }
|
3728 | }
|
3729 |
|
3730 |
|
3731 | if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
3732 | if (CONFIGURABLE_FUNCTION_NAME) {
|
3733 | createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
3734 | } else {
|
3735 | INCORRECT_VALUES_NAME = true;
|
3736 | defaultIterator = function values() { return call$1(nativeIterator, this); };
|
3737 | }
|
3738 | }
|
3739 |
|
3740 |
|
3741 | if (DEFAULT) {
|
3742 | methods = {
|
3743 | values: getIterationMethod(VALUES),
|
3744 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
3745 | entries: getIterationMethod(ENTRIES)
|
3746 | };
|
3747 | if (FORCED) for (KEY in methods) {
|
3748 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
3749 | defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
3750 | }
|
3751 | } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
3752 | }
|
3753 |
|
3754 |
|
3755 | if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
3756 | defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
3757 | }
|
3758 | Iterators$1[NAME] = defaultIterator;
|
3759 |
|
3760 | return methods;
|
3761 | };
|
3762 |
|
3763 |
|
3764 |
|
3765 | var createIterResultObject$1 = function (value, done) {
|
3766 | return { value: value, done: done };
|
3767 | };
|
3768 |
|
3769 | var toIndexedObject = toIndexedObject$8;
|
3770 | var addToUnscopables = addToUnscopables$4;
|
3771 | var Iterators = iterators;
|
3772 | var InternalStateModule = internalState;
|
3773 | var defineProperty$1 = objectDefineProperty.f;
|
3774 | var defineIterator = iteratorDefine;
|
3775 | var createIterResultObject = createIterResultObject$1;
|
3776 | var DESCRIPTORS$2 = descriptors;
|
3777 |
|
3778 | var ARRAY_ITERATOR = 'Array Iterator';
|
3779 | var setInternalState = InternalStateModule.set;
|
3780 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 |
|
3792 | var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
3793 | setInternalState(this, {
|
3794 | type: ARRAY_ITERATOR,
|
3795 | target: toIndexedObject(iterated),
|
3796 | index: 0,
|
3797 | kind: kind
|
3798 | });
|
3799 |
|
3800 |
|
3801 | }, function () {
|
3802 | var state = getInternalState(this);
|
3803 | var target = state.target;
|
3804 | var kind = state.kind;
|
3805 | var index = state.index++;
|
3806 | if (!target || index >= target.length) {
|
3807 | state.target = undefined;
|
3808 | return createIterResultObject(undefined, true);
|
3809 | }
|
3810 | if (kind == 'keys') return createIterResultObject(index, false);
|
3811 | if (kind == 'values') return createIterResultObject(target[index], false);
|
3812 | return createIterResultObject([index, target[index]], false);
|
3813 | }, 'values');
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 | var values = Iterators.Arguments = Iterators.Array;
|
3819 |
|
3820 |
|
3821 | addToUnscopables('keys');
|
3822 | addToUnscopables('values');
|
3823 | addToUnscopables('entries');
|
3824 |
|
3825 |
|
3826 | if (DESCRIPTORS$2 && values.name !== 'values') try {
|
3827 | defineProperty$1(values, 'name', { value: 'values' });
|
3828 | } catch (error) { }
|
3829 |
|
3830 | var global$3 = global$k;
|
3831 | var DOMIterables = domIterables;
|
3832 | var DOMTokenListPrototype = domTokenListPrototype;
|
3833 | var ArrayIteratorMethods = es_array_iterator;
|
3834 | var createNonEnumerableProperty = createNonEnumerableProperty$7;
|
3835 | var wellKnownSymbol = wellKnownSymbol$j;
|
3836 |
|
3837 | var ITERATOR = wellKnownSymbol('iterator');
|
3838 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
3839 | var ArrayValues = ArrayIteratorMethods.values;
|
3840 |
|
3841 | var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
3842 | if (CollectionPrototype) {
|
3843 |
|
3844 | if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
3845 | createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
3846 | } catch (error) {
|
3847 | CollectionPrototype[ITERATOR] = ArrayValues;
|
3848 | }
|
3849 | if (!CollectionPrototype[TO_STRING_TAG]) {
|
3850 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
3851 | }
|
3852 | if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
3853 |
|
3854 | if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
3855 | createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
3856 | } catch (error) {
|
3857 | CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
3858 | }
|
3859 | }
|
3860 | }
|
3861 | };
|
3862 |
|
3863 | for (var COLLECTION_NAME in DOMIterables) {
|
3864 | handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
3865 | }
|
3866 |
|
3867 | handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
3868 |
|
3869 | var DESCRIPTORS$1 = descriptors;
|
3870 | var isArray$1 = isArray$5;
|
3871 |
|
3872 | var $TypeError = TypeError;
|
3873 |
|
3874 | var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
|
3875 |
|
3876 |
|
3877 | var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$1 && !function () {
|
3878 |
|
3879 | if (this !== undefined) return true;
|
3880 | try {
|
3881 |
|
3882 | Object.defineProperty([], 'length', { writable: false }).length = 1;
|
3883 | } catch (error) {
|
3884 | return error instanceof TypeError;
|
3885 | }
|
3886 | }();
|
3887 |
|
3888 | var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
|
3889 | if (isArray$1(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
|
3890 | throw $TypeError('Cannot set read only .length');
|
3891 | } return O.length = length;
|
3892 | } : function (O, length) {
|
3893 | return O.length = length;
|
3894 | };
|
3895 |
|
3896 | var $$4 = _export;
|
3897 | var toObject = toObject$9;
|
3898 | var toAbsoluteIndex = toAbsoluteIndex$4;
|
3899 | var toIntegerOrInfinity = toIntegerOrInfinity$5;
|
3900 | var lengthOfArrayLike = lengthOfArrayLike$7;
|
3901 | var setArrayLength = arraySetLength;
|
3902 | var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
|
3903 | var arraySpeciesCreate = arraySpeciesCreate$3;
|
3904 | var createProperty = createProperty$4;
|
3905 | var deletePropertyOrThrow = deletePropertyOrThrow$2;
|
3906 | var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
|
3907 |
|
3908 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
3909 |
|
3910 | var max = Math.max;
|
3911 | var min$2 = Math.min;
|
3912 |
|
3913 |
|
3914 |
|
3915 |
|
3916 | $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3917 | splice: function splice(start, deleteCount /* , ...items */) {
|
3918 | var O = toObject(this);
|
3919 | var len = lengthOfArrayLike(O);
|
3920 | var actualStart = toAbsoluteIndex(start, len);
|
3921 | var argumentsLength = arguments.length;
|
3922 | var insertCount, actualDeleteCount, A, k, from, to;
|
3923 | if (argumentsLength === 0) {
|
3924 | insertCount = actualDeleteCount = 0;
|
3925 | } else if (argumentsLength === 1) {
|
3926 | insertCount = 0;
|
3927 | actualDeleteCount = len - actualStart;
|
3928 | } else {
|
3929 | insertCount = argumentsLength - 2;
|
3930 | actualDeleteCount = min$2(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
|
3931 | }
|
3932 | doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
|
3933 | A = arraySpeciesCreate(O, actualDeleteCount);
|
3934 | for (k = 0; k < actualDeleteCount; k++) {
|
3935 | from = actualStart + k;
|
3936 | if (from in O) createProperty(A, k, O[from]);
|
3937 | }
|
3938 | A.length = actualDeleteCount;
|
3939 | if (insertCount < actualDeleteCount) {
|
3940 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
3941 | from = k + actualDeleteCount;
|
3942 | to = k + insertCount;
|
3943 | if (from in O) O[to] = O[from];
|
3944 | else deletePropertyOrThrow(O, to);
|
3945 | }
|
3946 | for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
|
3947 | } else if (insertCount > actualDeleteCount) {
|
3948 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
3949 | from = k + actualDeleteCount - 1;
|
3950 | to = k + insertCount - 1;
|
3951 | if (from in O) O[to] = O[from];
|
3952 | else deletePropertyOrThrow(O, to);
|
3953 | }
|
3954 | }
|
3955 | for (k = 0; k < insertCount; k++) {
|
3956 | O[k + actualStart] = arguments[k + 2];
|
3957 | }
|
3958 | setArrayLength(O, len - actualDeleteCount + insertCount);
|
3959 | return A;
|
3960 | }
|
3961 | });
|
3962 |
|
3963 | var global$2 = global$k;
|
3964 |
|
3965 | var path$1 = global$2;
|
3966 |
|
3967 | var uncurryThis$4 = functionUncurryThis;
|
3968 |
|
3969 |
|
3970 |
|
3971 | var thisNumberValue$1 = uncurryThis$4(1.0.valueOf);
|
3972 |
|
3973 | var $$3 = _export;
|
3974 | var IS_PURE = isPure;
|
3975 | var DESCRIPTORS = descriptors;
|
3976 | var global$1 = global$k;
|
3977 | var path = path$1;
|
3978 | var uncurryThis$3 = functionUncurryThis;
|
3979 | var isForced = isForced_1;
|
3980 | var hasOwn = hasOwnProperty_1;
|
3981 | var inheritIfRequired = inheritIfRequired$2;
|
3982 | var isPrototypeOf = objectIsPrototypeOf;
|
3983 | var isSymbol = isSymbol$3;
|
3984 | var toPrimitive = toPrimitive$2;
|
3985 | var fails = fails$u;
|
3986 | var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
3987 | var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
|
3988 | var defineProperty = objectDefineProperty.f;
|
3989 | var thisNumberValue = thisNumberValue$1;
|
3990 | var trim = stringTrim.trim;
|
3991 |
|
3992 | var NUMBER = 'Number';
|
3993 | var NativeNumber = global$1[NUMBER];
|
3994 | path[NUMBER];
|
3995 | var NumberPrototype = NativeNumber.prototype;
|
3996 | var TypeError$1 = global$1.TypeError;
|
3997 | var stringSlice$1 = uncurryThis$3(''.slice);
|
3998 | var charCodeAt = uncurryThis$3(''.charCodeAt);
|
3999 |
|
4000 |
|
4001 |
|
4002 | var toNumeric = function (value) {
|
4003 | var primValue = toPrimitive(value, 'number');
|
4004 | return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
|
4005 | };
|
4006 |
|
4007 |
|
4008 |
|
4009 | var toNumber = function (argument) {
|
4010 | var it = toPrimitive(argument, 'number');
|
4011 | var first, third, radix, maxCode, digits, length, index, code;
|
4012 | if (isSymbol(it)) throw TypeError$1('Cannot convert a Symbol value to a number');
|
4013 | if (typeof it == 'string' && it.length > 2) {
|
4014 | it = trim(it);
|
4015 | first = charCodeAt(it, 0);
|
4016 | if (first === 43 || first === 45) {
|
4017 | third = charCodeAt(it, 2);
|
4018 | if (third === 88 || third === 120) return NaN;
|
4019 | } else if (first === 48) {
|
4020 | switch (charCodeAt(it, 1)) {
|
4021 | case 66: case 98: radix = 2; maxCode = 49; break;
|
4022 | case 79: case 111: radix = 8; maxCode = 55; break;
|
4023 | default: return +it;
|
4024 | }
|
4025 | digits = stringSlice$1(it, 2);
|
4026 | length = digits.length;
|
4027 | for (index = 0; index < length; index++) {
|
4028 | code = charCodeAt(digits, index);
|
4029 |
|
4030 |
|
4031 | if (code < 48 || code > maxCode) return NaN;
|
4032 | } return parseInt(digits, radix);
|
4033 | }
|
4034 | } return +it;
|
4035 | };
|
4036 |
|
4037 | var FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
|
4038 |
|
4039 | var calledWithNew = function (dummy) {
|
4040 |
|
4041 | return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); });
|
4042 | };
|
4043 |
|
4044 |
|
4045 |
|
4046 | var NumberWrapper = function Number(value) {
|
4047 | var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
|
4048 | return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n;
|
4049 | };
|
4050 |
|
4051 | NumberWrapper.prototype = NumberPrototype;
|
4052 | if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper;
|
4053 |
|
4054 | $$3({ global: true, constructor: true, wrap: true, forced: FORCED }, {
|
4055 | Number: NumberWrapper
|
4056 | });
|
4057 |
|
4058 |
|
4059 | var copyConstructorProperties = function (target, source) {
|
4060 | for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : (
|
4061 |
|
4062 | 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
|
4063 |
|
4064 | 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
|
4065 |
|
4066 | 'fromString,range'
|
4067 | ).split(','), j = 0, key; keys.length > j; j++) {
|
4068 | if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) {
|
4069 | defineProperty(target, key, getOwnPropertyDescriptor$2(source, key));
|
4070 | }
|
4071 | }
|
4072 | };
|
4073 | if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);
|
4074 |
|
4075 | var $$2 = _export;
|
4076 | var uncurryThis$2 = functionUncurryThis;
|
4077 | var isArray = isArray$5;
|
4078 |
|
4079 | var nativeReverse = uncurryThis$2([].reverse);
|
4080 | var test = [1, 2];
|
4081 |
|
4082 |
|
4083 |
|
4084 |
|
4085 |
|
4086 | $$2({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
4087 | reverse: function reverse() {
|
4088 |
|
4089 | if (isArray(this)) this.length = this.length;
|
4090 | return nativeReverse(this);
|
4091 | }
|
4092 | });
|
4093 |
|
4094 | var call = functionCall;
|
4095 | var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
4096 | var anObject = anObject$d;
|
4097 | var isNullOrUndefined = isNullOrUndefined$7;
|
4098 | var toLength$2 = toLength$6;
|
4099 | var toString$2 = toString$f;
|
4100 | var requireObjectCoercible$2 = requireObjectCoercible$b;
|
4101 | var getMethod = getMethod$5;
|
4102 | var advanceStringIndex = advanceStringIndex$3;
|
4103 | var regExpExec = regexpExecAbstract;
|
4104 |
|
4105 |
|
4106 | fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
|
4107 | return [
|
4108 |
|
4109 |
|
4110 | function match(regexp) {
|
4111 | var O = requireObjectCoercible$2(this);
|
4112 | var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
|
4113 | return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
|
4114 | },
|
4115 |
|
4116 |
|
4117 | function (string) {
|
4118 | var rx = anObject(this);
|
4119 | var S = toString$2(string);
|
4120 | var res = maybeCallNative(nativeMatch, rx, S);
|
4121 |
|
4122 | if (res.done) return res.value;
|
4123 |
|
4124 | if (!rx.global) return regExpExec(rx, S);
|
4125 |
|
4126 | var fullUnicode = rx.unicode;
|
4127 | rx.lastIndex = 0;
|
4128 | var A = [];
|
4129 | var n = 0;
|
4130 | var result;
|
4131 | while ((result = regExpExec(rx, S)) !== null) {
|
4132 | var matchStr = toString$2(result[0]);
|
4133 | A[n] = matchStr;
|
4134 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
|
4135 | n++;
|
4136 | }
|
4137 | return n === 0 ? null : A;
|
4138 | }
|
4139 | ];
|
4140 | });
|
4141 |
|
4142 | var $$1 = _export;
|
4143 | var uncurryThis$1 = functionUncurryThisClause;
|
4144 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
4145 | var toLength$1 = toLength$6;
|
4146 | var toString$1 = toString$f;
|
4147 | var notARegExp$1 = notARegexp;
|
4148 | var requireObjectCoercible$1 = requireObjectCoercible$b;
|
4149 | var correctIsRegExpLogic$1 = correctIsRegexpLogic;
|
4150 |
|
4151 |
|
4152 | var nativeStartsWith = uncurryThis$1(''.startsWith);
|
4153 | var stringSlice = uncurryThis$1(''.slice);
|
4154 | var min$1 = Math.min;
|
4155 |
|
4156 | var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('startsWith');
|
4157 |
|
4158 | var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
|
4159 | var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
|
4160 | return descriptor && !descriptor.writable;
|
4161 | }();
|
4162 |
|
4163 |
|
4164 |
|
4165 | $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
|
4166 | startsWith: function startsWith(searchString /* , position = 0 */) {
|
4167 | var that = toString$1(requireObjectCoercible$1(this));
|
4168 | notARegExp$1(searchString);
|
4169 | var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
4170 | var search = toString$1(searchString);
|
4171 | return nativeStartsWith
|
4172 | ? nativeStartsWith(that, search, index)
|
4173 | : stringSlice(that, index, index + search.length) === search;
|
4174 | }
|
4175 | });
|
4176 |
|
4177 | var $ = _export;
|
4178 | var uncurryThis = functionUncurryThisClause;
|
4179 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
4180 | var toLength = toLength$6;
|
4181 | var toString = toString$f;
|
4182 | var notARegExp = notARegexp;
|
4183 | var requireObjectCoercible = requireObjectCoercible$b;
|
4184 | var correctIsRegExpLogic = correctIsRegexpLogic;
|
4185 |
|
4186 |
|
4187 | var nativeEndsWith = uncurryThis(''.endsWith);
|
4188 | var slice = uncurryThis(''.slice);
|
4189 | var min = Math.min;
|
4190 |
|
4191 | var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
|
4192 |
|
4193 | var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
4194 | var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
|
4195 | return descriptor && !descriptor.writable;
|
4196 | }();
|
4197 |
|
4198 |
|
4199 |
|
4200 | $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
4201 | endsWith: function endsWith(searchString /* , endPosition = @length */) {
|
4202 | var that = toString(requireObjectCoercible(this));
|
4203 | notARegExp(searchString);
|
4204 | var endPosition = arguments.length > 1 ? arguments[1] : undefined;
|
4205 | var len = that.length;
|
4206 | var end = endPosition === undefined ? len : min(toLength(endPosition), len);
|
4207 | var search = toString(searchString);
|
4208 | return nativeEndsWith
|
4209 | ? nativeEndsWith(that, search, end)
|
4210 | : slice(that, end - search.length, end) === search;
|
4211 | }
|
4212 | });
|
4213 |
|
4214 | var Utils = {
|
4215 | getBootstrapVersion: function getBootstrapVersion() {
|
4216 | var bootstrapVersion = 5;
|
4217 | try {
|
4218 | var rawVersion = $$o.fn.dropdown.Constructor.VERSION;
|
4219 |
|
4220 |
|
4221 |
|
4222 | if (rawVersion !== undefined) {
|
4223 | bootstrapVersion = parseInt(rawVersion, 10);
|
4224 | }
|
4225 | } catch (e) {
|
4226 |
|
4227 | }
|
4228 | try {
|
4229 |
|
4230 | var _rawVersion = bootstrap.Tooltip.VERSION;
|
4231 | if (_rawVersion !== undefined) {
|
4232 | bootstrapVersion = parseInt(_rawVersion, 10);
|
4233 | }
|
4234 | } catch (e) {
|
4235 |
|
4236 | }
|
4237 | return bootstrapVersion;
|
4238 | },
|
4239 | getIconsPrefix: function getIconsPrefix(theme) {
|
4240 | return {
|
4241 | bootstrap3: 'glyphicon',
|
4242 | bootstrap4: 'fa',
|
4243 | bootstrap5: 'bi',
|
4244 | 'bootstrap-table': 'icon',
|
4245 | bulma: 'fa',
|
4246 | foundation: 'fa',
|
4247 | materialize: 'material-icons',
|
4248 | semantic: 'fa'
|
4249 | }[theme] || 'fa';
|
4250 | },
|
4251 | getIcons: function getIcons(prefix) {
|
4252 | return {
|
4253 | glyphicon: {
|
4254 | paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
|
4255 | paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
|
4256 | refresh: 'glyphicon-refresh icon-refresh',
|
4257 | toggleOff: 'glyphicon-list-alt icon-list-alt',
|
4258 | toggleOn: 'glyphicon-list-alt icon-list-alt',
|
4259 | columns: 'glyphicon-th icon-th',
|
4260 | detailOpen: 'glyphicon-plus icon-plus',
|
4261 | detailClose: 'glyphicon-minus icon-minus',
|
4262 | fullscreen: 'glyphicon-fullscreen',
|
4263 | search: 'glyphicon-search',
|
4264 | clearSearch: 'glyphicon-trash'
|
4265 | },
|
4266 | fa: {
|
4267 | paginationSwitchDown: 'fa-caret-square-down',
|
4268 | paginationSwitchUp: 'fa-caret-square-up',
|
4269 | refresh: 'fa-sync',
|
4270 | toggleOff: 'fa-toggle-off',
|
4271 | toggleOn: 'fa-toggle-on',
|
4272 | columns: 'fa-th-list',
|
4273 | detailOpen: 'fa-plus',
|
4274 | detailClose: 'fa-minus',
|
4275 | fullscreen: 'fa-arrows-alt',
|
4276 | search: 'fa-search',
|
4277 | clearSearch: 'fa-trash'
|
4278 | },
|
4279 | bi: {
|
4280 | paginationSwitchDown: 'bi-caret-down-square',
|
4281 | paginationSwitchUp: 'bi-caret-up-square',
|
4282 | refresh: 'bi-arrow-clockwise',
|
4283 | toggleOff: 'bi-toggle-off',
|
4284 | toggleOn: 'bi-toggle-on',
|
4285 | columns: 'bi-list-ul',
|
4286 | detailOpen: 'bi-plus',
|
4287 | detailClose: 'bi-dash',
|
4288 | fullscreen: 'bi-arrows-move',
|
4289 | search: 'bi-search',
|
4290 | clearSearch: 'bi-trash'
|
4291 | },
|
4292 | icon: {
|
4293 | paginationSwitchDown: 'icon-arrow-up-circle',
|
4294 | paginationSwitchUp: 'icon-arrow-down-circle',
|
4295 | refresh: 'icon-refresh-cw',
|
4296 | toggleOff: 'icon-toggle-right',
|
4297 | toggleOn: 'icon-toggle-right',
|
4298 | columns: 'icon-list',
|
4299 | detailOpen: 'icon-plus',
|
4300 | detailClose: 'icon-minus',
|
4301 | fullscreen: 'icon-maximize',
|
4302 | search: 'icon-search',
|
4303 | clearSearch: 'icon-trash-2'
|
4304 | },
|
4305 | 'material-icons': {
|
4306 | paginationSwitchDown: 'grid_on',
|
4307 | paginationSwitchUp: 'grid_off',
|
4308 | refresh: 'refresh',
|
4309 | toggleOff: 'tablet',
|
4310 | toggleOn: 'tablet_android',
|
4311 | columns: 'view_list',
|
4312 | detailOpen: 'add',
|
4313 | detailClose: 'remove',
|
4314 | fullscreen: 'fullscreen',
|
4315 | sort: 'sort',
|
4316 | search: 'search',
|
4317 | clearSearch: 'delete'
|
4318 | }
|
4319 | }[prefix];
|
4320 | },
|
4321 | getSearchInput: function getSearchInput(that) {
|
4322 | if (typeof that.options.searchSelector === 'string') {
|
4323 | return $$o(that.options.searchSelector);
|
4324 | }
|
4325 | return that.$toolbar.find('.search input');
|
4326 | },
|
4327 |
|
4328 | extend: function extend() {
|
4329 | var _this = this;
|
4330 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
4331 | args[_key] = arguments[_key];
|
4332 | }
|
4333 | var target = args[0] || {};
|
4334 | var i = 1;
|
4335 | var deep = false;
|
4336 | var clone;
|
4337 |
|
4338 |
|
4339 | if (typeof target === 'boolean') {
|
4340 | deep = target;
|
4341 |
|
4342 |
|
4343 | target = args[i] || {};
|
4344 | i++;
|
4345 | }
|
4346 |
|
4347 |
|
4348 | if (_typeof(target) !== 'object' && typeof target !== 'function') {
|
4349 | target = {};
|
4350 | }
|
4351 | for (; i < args.length; i++) {
|
4352 | var options = args[i];
|
4353 |
|
4354 |
|
4355 | if (typeof options === 'undefined' || options === null) {
|
4356 | continue;
|
4357 | }
|
4358 |
|
4359 |
|
4360 |
|
4361 | for (var name in options) {
|
4362 | var copy = options[name];
|
4363 |
|
4364 |
|
4365 |
|
4366 | if (name === '__proto__' || target === copy) {
|
4367 | continue;
|
4368 | }
|
4369 | var copyIsArray = Array.isArray(copy);
|
4370 |
|
4371 |
|
4372 | if (deep && copy && (this.isObject(copy) || copyIsArray)) {
|
4373 | var src = target[name];
|
4374 | if (copyIsArray && Array.isArray(src)) {
|
4375 | if (src.every(function (it) {
|
4376 | return !_this.isObject(it) && !Array.isArray(it);
|
4377 | })) {
|
4378 | target[name] = copy;
|
4379 | continue;
|
4380 | }
|
4381 | }
|
4382 | if (copyIsArray && !Array.isArray(src)) {
|
4383 | clone = [];
|
4384 | } else if (!copyIsArray && !this.isObject(src)) {
|
4385 | clone = {};
|
4386 | } else {
|
4387 | clone = src;
|
4388 | }
|
4389 |
|
4390 |
|
4391 | target[name] = this.extend(deep, clone, copy);
|
4392 |
|
4393 |
|
4394 | } else if (copy !== undefined) {
|
4395 | target[name] = copy;
|
4396 | }
|
4397 | }
|
4398 | }
|
4399 | return target;
|
4400 | },
|
4401 |
|
4402 | sprintf: function sprintf(_str) {
|
4403 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
4404 | args[_key2 - 1] = arguments[_key2];
|
4405 | }
|
4406 | var flag = true;
|
4407 | var i = 0;
|
4408 | var str = _str.replace(/%s/g, function () {
|
4409 | var arg = args[i++];
|
4410 | if (typeof arg === 'undefined') {
|
4411 | flag = false;
|
4412 | return '';
|
4413 | }
|
4414 | return arg;
|
4415 | });
|
4416 | return flag ? str : '';
|
4417 | },
|
4418 | isObject: function isObject(obj) {
|
4419 | return _typeof(obj) === 'object' && obj !== null && !Array.isArray(obj);
|
4420 | },
|
4421 | isEmptyObject: function isEmptyObject() {
|
4422 | var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4423 | return Object.entries(obj).length === 0 && obj.constructor === Object;
|
4424 | },
|
4425 | isNumeric: function isNumeric(n) {
|
4426 | return !isNaN(parseFloat(n)) && isFinite(n);
|
4427 | },
|
4428 | getFieldTitle: function getFieldTitle(list, value) {
|
4429 | var _iterator = _createForOfIteratorHelper(list),
|
4430 | _step;
|
4431 | try {
|
4432 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
4433 | var item = _step.value;
|
4434 | if (item.field === value) {
|
4435 | return item.title;
|
4436 | }
|
4437 | }
|
4438 | } catch (err) {
|
4439 | _iterator.e(err);
|
4440 | } finally {
|
4441 | _iterator.f();
|
4442 | }
|
4443 | return '';
|
4444 | },
|
4445 | setFieldIndex: function setFieldIndex(columns) {
|
4446 | var totalCol = 0;
|
4447 | var flag = [];
|
4448 | var _iterator2 = _createForOfIteratorHelper(columns[0]),
|
4449 | _step2;
|
4450 | try {
|
4451 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
4452 | var column = _step2.value;
|
4453 | totalCol += column.colspan || 1;
|
4454 | }
|
4455 | } catch (err) {
|
4456 | _iterator2.e(err);
|
4457 | } finally {
|
4458 | _iterator2.f();
|
4459 | }
|
4460 | for (var i = 0; i < columns.length; i++) {
|
4461 | flag[i] = [];
|
4462 | for (var j = 0; j < totalCol; j++) {
|
4463 | flag[i][j] = false;
|
4464 | }
|
4465 | }
|
4466 | for (var _i = 0; _i < columns.length; _i++) {
|
4467 | var _iterator3 = _createForOfIteratorHelper(columns[_i]),
|
4468 | _step3;
|
4469 | try {
|
4470 | for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
4471 | var r = _step3.value;
|
4472 | var rowspan = r.rowspan || 1;
|
4473 | var colspan = r.colspan || 1;
|
4474 | var index = flag[_i].indexOf(false);
|
4475 | r.colspanIndex = index;
|
4476 | if (colspan === 1) {
|
4477 | r.fieldIndex = index;
|
4478 |
|
4479 | if (typeof r.field === 'undefined') {
|
4480 | r.field = index;
|
4481 | }
|
4482 | } else {
|
4483 | r.colspanGroup = r.colspan;
|
4484 | }
|
4485 | for (var _j = 0; _j < rowspan; _j++) {
|
4486 | for (var k = 0; k < colspan; k++) {
|
4487 | flag[_i + _j][index + k] = true;
|
4488 | }
|
4489 | }
|
4490 | }
|
4491 | } catch (err) {
|
4492 | _iterator3.e(err);
|
4493 | } finally {
|
4494 | _iterator3.f();
|
4495 | }
|
4496 | }
|
4497 | },
|
4498 | normalizeAccent: function normalizeAccent(value) {
|
4499 | if (typeof value !== 'string') {
|
4500 | return value;
|
4501 | }
|
4502 | return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
4503 | },
|
4504 | updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
|
4505 | var _ref;
|
4506 | var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
|
4507 | var _iterator4 = _createForOfIteratorHelper(columns),
|
4508 | _step4;
|
4509 | try {
|
4510 | for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
4511 | var c = _step4.value;
|
4512 | var _iterator6 = _createForOfIteratorHelper(c),
|
4513 | _step6;
|
4514 | try {
|
4515 | for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
4516 | var r = _step6.value;
|
4517 | if (r.colspanGroup > 1) {
|
4518 | var colspan = 0;
|
4519 | var _loop = function _loop(i) {
|
4520 | var column = allColumns.find(function (col) {
|
4521 | return col.fieldIndex === i;
|
4522 | });
|
4523 | if (column.visible) {
|
4524 | colspan++;
|
4525 | }
|
4526 | };
|
4527 | for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
|
4528 | _loop(i);
|
4529 | }
|
4530 | r.colspan = colspan;
|
4531 | r.visible = colspan > 0;
|
4532 | }
|
4533 | }
|
4534 | } catch (err) {
|
4535 | _iterator6.e(err);
|
4536 | } finally {
|
4537 | _iterator6.f();
|
4538 | }
|
4539 | }
|
4540 | } catch (err) {
|
4541 | _iterator4.e(err);
|
4542 | } finally {
|
4543 | _iterator4.f();
|
4544 | }
|
4545 | if (columns.length < 2) {
|
4546 | return;
|
4547 | }
|
4548 | var _iterator5 = _createForOfIteratorHelper(fieldColumns),
|
4549 | _step5;
|
4550 | try {
|
4551 | var _loop2 = function _loop2() {
|
4552 | var column = _step5.value;
|
4553 | var sameColumns = allColumns.filter(function (col) {
|
4554 | return col.fieldIndex === column.fieldIndex;
|
4555 | });
|
4556 | if (sameColumns.length > 1) {
|
4557 | var _iterator7 = _createForOfIteratorHelper(sameColumns),
|
4558 | _step7;
|
4559 | try {
|
4560 | for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
4561 | var _c = _step7.value;
|
4562 | _c.visible = column.visible;
|
4563 | }
|
4564 | } catch (err) {
|
4565 | _iterator7.e(err);
|
4566 | } finally {
|
4567 | _iterator7.f();
|
4568 | }
|
4569 | }
|
4570 | };
|
4571 | for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
4572 | _loop2();
|
4573 | }
|
4574 | } catch (err) {
|
4575 | _iterator5.e(err);
|
4576 | } finally {
|
4577 | _iterator5.f();
|
4578 | }
|
4579 | },
|
4580 | getScrollBarWidth: function getScrollBarWidth() {
|
4581 | if (this.cachedWidth === undefined) {
|
4582 | var $inner = $$o('<div/>').addClass('fixed-table-scroll-inner');
|
4583 | var $outer = $$o('<div/>').addClass('fixed-table-scroll-outer');
|
4584 | $outer.append($inner);
|
4585 | $$o('body').append($outer);
|
4586 | var w1 = $inner[0].offsetWidth;
|
4587 | $outer.css('overflow', 'scroll');
|
4588 | var w2 = $inner[0].offsetWidth;
|
4589 | if (w1 === w2) {
|
4590 | w2 = $outer[0].clientWidth;
|
4591 | }
|
4592 | $outer.remove();
|
4593 | this.cachedWidth = w1 - w2;
|
4594 | }
|
4595 | return this.cachedWidth;
|
4596 | },
|
4597 | calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
|
4598 | var func = name;
|
4599 | if (typeof name === 'string') {
|
4600 |
|
4601 | var names = name.split('.');
|
4602 | if (names.length > 1) {
|
4603 | func = window;
|
4604 | var _iterator8 = _createForOfIteratorHelper(names),
|
4605 | _step8;
|
4606 | try {
|
4607 | for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
4608 | var f = _step8.value;
|
4609 | func = func[f];
|
4610 | }
|
4611 | } catch (err) {
|
4612 | _iterator8.e(err);
|
4613 | } finally {
|
4614 | _iterator8.f();
|
4615 | }
|
4616 | } else {
|
4617 | func = window[name];
|
4618 | }
|
4619 | }
|
4620 | if (func !== null && _typeof(func) === 'object') {
|
4621 | return func;
|
4622 | }
|
4623 | if (typeof func === 'function') {
|
4624 | return func.apply(self, args || []);
|
4625 | }
|
4626 | if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
|
4627 | return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
|
4628 | }
|
4629 | return defaultValue;
|
4630 | },
|
4631 | compareObjects: function compareObjects(objectA, objectB, compareLength) {
|
4632 | var aKeys = Object.keys(objectA);
|
4633 | var bKeys = Object.keys(objectB);
|
4634 | if (compareLength && aKeys.length !== bKeys.length) {
|
4635 | return false;
|
4636 | }
|
4637 | for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
|
4638 | var key = _aKeys[_i2];
|
4639 | if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
|
4640 | return false;
|
4641 | }
|
4642 | }
|
4643 | return true;
|
4644 | },
|
4645 | regexCompare: function regexCompare(value, search) {
|
4646 | try {
|
4647 | var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
|
4648 | if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
|
4649 | return true;
|
4650 | }
|
4651 | } catch (e) {
|
4652 | return false;
|
4653 | }
|
4654 | return false;
|
4655 | },
|
4656 | escapeApostrophe: function escapeApostrophe(value) {
|
4657 | return value.toString().replace(/'/g, ''');
|
4658 | },
|
4659 | escapeHTML: function escapeHTML(text) {
|
4660 | if (!text) {
|
4661 | return text;
|
4662 | }
|
4663 | return text.toString().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
4664 | },
|
4665 | unescapeHTML: function unescapeHTML(text) {
|
4666 | if (typeof text !== 'string' || !text) {
|
4667 | return text;
|
4668 | }
|
4669 | return text.toString().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '\'');
|
4670 | },
|
4671 | removeHTML: function removeHTML(text) {
|
4672 | if (!text) {
|
4673 | return text;
|
4674 | }
|
4675 | return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
|
4676 | },
|
4677 | getRealDataAttr: function getRealDataAttr(dataAttr) {
|
4678 | for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
|
4679 | var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
|
4680 | attr = _Object$entries$_i[0],
|
4681 | value = _Object$entries$_i[1];
|
4682 | var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
|
4683 | if (auxAttr !== attr) {
|
4684 | dataAttr[auxAttr] = value;
|
4685 | delete dataAttr[attr];
|
4686 | }
|
4687 | }
|
4688 | return dataAttr;
|
4689 | },
|
4690 | getItemField: function getItemField(item, field, escape) {
|
4691 | var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
4692 | var value = item;
|
4693 |
|
4694 |
|
4695 | if (typeof columnEscape !== 'undefined') {
|
4696 | escape = columnEscape;
|
4697 | }
|
4698 | if (typeof field !== 'string' || item.hasOwnProperty(field)) {
|
4699 | return escape ? this.escapeHTML(item[field]) : item[field];
|
4700 | }
|
4701 | var props = field.split('.');
|
4702 | var _iterator9 = _createForOfIteratorHelper(props),
|
4703 | _step9;
|
4704 | try {
|
4705 | for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
4706 | var p = _step9.value;
|
4707 | value = value && value[p];
|
4708 | }
|
4709 | } catch (err) {
|
4710 | _iterator9.e(err);
|
4711 | } finally {
|
4712 | _iterator9.f();
|
4713 | }
|
4714 | return escape ? this.escapeHTML(value) : value;
|
4715 | },
|
4716 | isIEBrowser: function isIEBrowser() {
|
4717 | return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
|
4718 | },
|
4719 | findIndex: function findIndex(items, item) {
|
4720 | var _iterator10 = _createForOfIteratorHelper(items),
|
4721 | _step10;
|
4722 | try {
|
4723 | for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
4724 | var it = _step10.value;
|
4725 | if (JSON.stringify(it) === JSON.stringify(item)) {
|
4726 | return items.indexOf(it);
|
4727 | }
|
4728 | }
|
4729 | } catch (err) {
|
4730 | _iterator10.e(err);
|
4731 | } finally {
|
4732 | _iterator10.f();
|
4733 | }
|
4734 | return -1;
|
4735 | },
|
4736 | trToData: function trToData(columns, $els) {
|
4737 | var _this2 = this;
|
4738 | var data = [];
|
4739 | var m = [];
|
4740 | $els.each(function (y, el) {
|
4741 | var $el = $$o(el);
|
4742 | var row = {};
|
4743 |
|
4744 |
|
4745 | row._id = $el.attr('id');
|
4746 | row._class = $el.attr('class');
|
4747 | row._data = _this2.getRealDataAttr($el.data());
|
4748 | row._style = $el.attr('style');
|
4749 | $el.find('>td,>th').each(function (_x, el) {
|
4750 | var $el = $$o(el);
|
4751 | var cspan = +$el.attr('colspan') || 1;
|
4752 | var rspan = +$el.attr('rowspan') || 1;
|
4753 | var x = _x;
|
4754 |
|
4755 |
|
4756 | for (; m[y] && m[y][x]; x++) {
|
4757 |
|
4758 | }
|
4759 |
|
4760 |
|
4761 | for (var tx = x; tx < x + cspan; tx++) {
|
4762 | for (var ty = y; ty < y + rspan; ty++) {
|
4763 | if (!m[ty]) {
|
4764 |
|
4765 | m[ty] = [];
|
4766 | }
|
4767 | m[ty][tx] = true;
|
4768 | }
|
4769 | }
|
4770 | var field = columns[x].field;
|
4771 | row[field] = _this2.escapeApostrophe($el.html().trim());
|
4772 |
|
4773 | row["_".concat(field, "_id")] = $el.attr('id');
|
4774 | row["_".concat(field, "_class")] = $el.attr('class');
|
4775 | row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
|
4776 | row["_".concat(field, "_colspan")] = $el.attr('colspan');
|
4777 | row["_".concat(field, "_title")] = $el.attr('title');
|
4778 | row["_".concat(field, "_data")] = _this2.getRealDataAttr($el.data());
|
4779 | row["_".concat(field, "_style")] = $el.attr('style');
|
4780 | });
|
4781 | data.push(row);
|
4782 | });
|
4783 | return data;
|
4784 | },
|
4785 | sort: function sort(a, b, order, options, aPosition, bPosition) {
|
4786 | if (a === undefined || a === null) {
|
4787 | a = '';
|
4788 | }
|
4789 | if (b === undefined || b === null) {
|
4790 | b = '';
|
4791 | }
|
4792 | if (options.sortStable && a === b) {
|
4793 | a = aPosition;
|
4794 | b = bPosition;
|
4795 | }
|
4796 |
|
4797 |
|
4798 | if (this.isNumeric(a) && this.isNumeric(b)) {
|
4799 |
|
4800 | a = parseFloat(a);
|
4801 | b = parseFloat(b);
|
4802 | if (a < b) {
|
4803 | return order * -1;
|
4804 | }
|
4805 | if (a > b) {
|
4806 | return order;
|
4807 | }
|
4808 | return 0;
|
4809 | }
|
4810 | if (options.sortEmptyLast) {
|
4811 | if (a === '') {
|
4812 | return 1;
|
4813 | }
|
4814 | if (b === '') {
|
4815 | return -1;
|
4816 | }
|
4817 | }
|
4818 | if (a === b) {
|
4819 | return 0;
|
4820 | }
|
4821 |
|
4822 |
|
4823 | if (typeof a !== 'string') {
|
4824 | a = a.toString();
|
4825 | }
|
4826 | if (a.localeCompare(b) === -1) {
|
4827 | return order * -1;
|
4828 | }
|
4829 | return order;
|
4830 | },
|
4831 | getEventName: function getEventName(eventPrefix) {
|
4832 | var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
4833 | id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
|
4834 | return "".concat(eventPrefix, "-").concat(id);
|
4835 | },
|
4836 | hasDetailViewIcon: function hasDetailViewIcon(options) {
|
4837 | return options.detailView && options.detailViewIcon && !options.cardView;
|
4838 | },
|
4839 | getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
|
4840 | return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
|
4841 | },
|
4842 | checkAutoMergeCells: function checkAutoMergeCells(data) {
|
4843 | var _iterator11 = _createForOfIteratorHelper(data),
|
4844 | _step11;
|
4845 | try {
|
4846 | for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
4847 | var row = _step11.value;
|
4848 | for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
|
4849 | var key = _Object$keys[_i4];
|
4850 | if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
|
4851 | return true;
|
4852 | }
|
4853 | }
|
4854 | }
|
4855 | } catch (err) {
|
4856 | _iterator11.e(err);
|
4857 | } finally {
|
4858 | _iterator11.f();
|
4859 | }
|
4860 | return false;
|
4861 | },
|
4862 | deepCopy: function deepCopy(arg) {
|
4863 | if (arg === undefined) {
|
4864 | return arg;
|
4865 | }
|
4866 | return this.extend(true, Array.isArray(arg) ? [] : {}, arg);
|
4867 | },
|
4868 | debounce: function debounce(func, wait, immediate) {
|
4869 | var timeout;
|
4870 | return function executedFunction() {
|
4871 | var context = this;
|
4872 | var args = arguments;
|
4873 | var later = function later() {
|
4874 | timeout = null;
|
4875 | if (!immediate) func.apply(context, args);
|
4876 | };
|
4877 | var callNow = immediate && !timeout;
|
4878 | clearTimeout(timeout);
|
4879 | timeout = setTimeout(later, wait);
|
4880 | if (callNow) func.apply(context, args);
|
4881 | };
|
4882 | }
|
4883 | };
|
4884 |
|
4885 | var VERSION = '1.21.4';
|
4886 | var bootstrapVersion = Utils.getBootstrapVersion();
|
4887 | var CONSTANTS = {
|
4888 | 3: {
|
4889 | classes: {
|
4890 | buttonsPrefix: 'btn',
|
4891 | buttons: 'default',
|
4892 | buttonsGroup: 'btn-group',
|
4893 | buttonsDropdown: 'btn-group',
|
4894 | pull: 'pull',
|
4895 | inputGroup: 'input-group',
|
4896 | inputPrefix: 'input-',
|
4897 | input: 'form-control',
|
4898 | select: 'form-control',
|
4899 | paginationDropdown: 'btn-group dropdown',
|
4900 | dropup: 'dropup',
|
4901 | dropdownActive: 'active',
|
4902 | paginationActive: 'active',
|
4903 | buttonActive: 'active'
|
4904 | },
|
4905 | html: {
|
4906 | toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
|
4907 | toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
|
4908 | toolbarDropdownSeparator: '<li class="divider"></li>',
|
4909 | pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
|
4910 | pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
|
4911 | dropdownCaret: '<span class="caret"></span>',
|
4912 | pagination: ['<ul class="pagination%s">', '</ul>'],
|
4913 | paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
|
4914 | icon: '<i class="%s %s"></i>',
|
4915 | inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
|
4916 | searchInput: '<input class="%s%s" type="text" placeholder="%s">',
|
4917 | searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
|
4918 | searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
|
4919 | }
|
4920 | },
|
4921 | 4: {
|
4922 | classes: {
|
4923 | buttonsPrefix: 'btn',
|
4924 | buttons: 'secondary',
|
4925 | buttonsGroup: 'btn-group',
|
4926 | buttonsDropdown: 'btn-group',
|
4927 | pull: 'float',
|
4928 | inputGroup: 'btn-group',
|
4929 | inputPrefix: 'form-control-',
|
4930 | input: 'form-control',
|
4931 | select: 'form-control',
|
4932 | paginationDropdown: 'btn-group dropdown',
|
4933 | dropup: 'dropup',
|
4934 | dropdownActive: 'active',
|
4935 | paginationActive: 'active',
|
4936 | buttonActive: 'active'
|
4937 | },
|
4938 | html: {
|
4939 | toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
|
4940 | toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
|
4941 | pageDropdown: ['<div class="dropdown-menu">', '</div>'],
|
4942 | pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
|
4943 | toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
|
4944 | dropdownCaret: '<span class="caret"></span>',
|
4945 | pagination: ['<ul class="pagination%s">', '</ul>'],
|
4946 | paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
|
4947 | icon: '<i class="%s %s"></i>',
|
4948 | inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
|
4949 | searchInput: '<input class="%s%s" type="text" placeholder="%s">',
|
4950 | searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
|
4951 | searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
|
4952 | }
|
4953 | },
|
4954 | 5: {
|
4955 | classes: {
|
4956 | buttonsPrefix: 'btn',
|
4957 | buttons: 'secondary',
|
4958 | buttonsGroup: 'btn-group',
|
4959 | buttonsDropdown: 'btn-group',
|
4960 | pull: 'float',
|
4961 | inputGroup: 'btn-group',
|
4962 | inputPrefix: 'form-control-',
|
4963 | input: 'form-control',
|
4964 | select: 'form-select',
|
4965 | paginationDropdown: 'btn-group dropdown',
|
4966 | dropup: 'dropup',
|
4967 | dropdownActive: 'active',
|
4968 | paginationActive: 'active',
|
4969 | buttonActive: 'active'
|
4970 | },
|
4971 | html: {
|
4972 | dataToggle: 'data-bs-toggle',
|
4973 | toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
|
4974 | toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
|
4975 | pageDropdown: ['<div class="dropdown-menu">', '</div>'],
|
4976 | pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
|
4977 | toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
|
4978 | dropdownCaret: '<span class="caret"></span>',
|
4979 | pagination: ['<ul class="pagination%s">', '</ul>'],
|
4980 | paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
|
4981 | icon: '<i class="%s %s"></i>',
|
4982 | inputGroup: '<div class="input-group">%s%s</div>',
|
4983 | searchInput: '<input class="%s%s" type="text" placeholder="%s">',
|
4984 | searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
|
4985 | searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
|
4986 | }
|
4987 | }
|
4988 | }[bootstrapVersion];
|
4989 | var DEFAULTS = {
|
4990 | height: undefined,
|
4991 | classes: 'table table-bordered table-hover',
|
4992 | buttons: {},
|
4993 | theadClasses: '',
|
4994 | headerStyle: function headerStyle(column) {
|
4995 | return {};
|
4996 | },
|
4997 | rowStyle: function rowStyle(row, index) {
|
4998 | return {};
|
4999 | },
|
5000 | rowAttributes: function rowAttributes(row, index) {
|
5001 | return {};
|
5002 | },
|
5003 | undefinedText: '-',
|
5004 | locale: undefined,
|
5005 | virtualScroll: false,
|
5006 | virtualScrollItemHeight: undefined,
|
5007 | sortable: true,
|
5008 | sortClass: undefined,
|
5009 | silentSort: true,
|
5010 | sortEmptyLast: false,
|
5011 | sortName: undefined,
|
5012 | sortOrder: undefined,
|
5013 | sortReset: false,
|
5014 | sortStable: false,
|
5015 | sortResetPage: false,
|
5016 | rememberOrder: false,
|
5017 | serverSort: true,
|
5018 | customSort: undefined,
|
5019 | columns: [[]],
|
5020 | data: [],
|
5021 | url: undefined,
|
5022 | method: 'get',
|
5023 | cache: true,
|
5024 | contentType: 'application/json',
|
5025 | dataType: 'json',
|
5026 | ajax: undefined,
|
5027 | ajaxOptions: {},
|
5028 | queryParams: function queryParams(params) {
|
5029 | return params;
|
5030 | },
|
5031 | queryParamsType: 'limit',
|
5032 |
|
5033 | responseHandler: function responseHandler(res) {
|
5034 | return res;
|
5035 | },
|
5036 | totalField: 'total',
|
5037 | totalNotFilteredField: 'totalNotFiltered',
|
5038 | dataField: 'rows',
|
5039 | footerField: 'footer',
|
5040 | pagination: false,
|
5041 | paginationParts: ['pageInfo', 'pageSize', 'pageList'],
|
5042 | showExtendedPagination: false,
|
5043 | paginationLoop: true,
|
5044 | sidePagination: 'client',
|
5045 |
|
5046 | totalRows: 0,
|
5047 | totalNotFiltered: 0,
|
5048 | pageNumber: 1,
|
5049 | pageSize: 10,
|
5050 | pageList: [10, 25, 50, 100],
|
5051 | paginationHAlign: 'right',
|
5052 |
|
5053 | paginationVAlign: 'bottom',
|
5054 |
|
5055 | paginationDetailHAlign: 'left',
|
5056 |
|
5057 | paginationPreText: '‹',
|
5058 | paginationNextText: '›',
|
5059 | paginationSuccessivelySize: 5,
|
5060 |
|
5061 | paginationPagesBySide: 1,
|
5062 |
|
5063 | paginationUseIntermediate: false,
|
5064 |
|
5065 | search: false,
|
5066 | searchable: false,
|
5067 | searchHighlight: false,
|
5068 | searchOnEnterKey: false,
|
5069 | strictSearch: false,
|
5070 | regexSearch: false,
|
5071 | searchSelector: false,
|
5072 | visibleSearch: false,
|
5073 | showButtonIcons: true,
|
5074 | showButtonText: false,
|
5075 | showSearchButton: false,
|
5076 | showSearchClearButton: false,
|
5077 | trimOnSearch: true,
|
5078 | searchAlign: 'right',
|
5079 | searchTimeOut: 500,
|
5080 | searchText: '',
|
5081 | customSearch: undefined,
|
5082 | showHeader: true,
|
5083 | showFooter: false,
|
5084 | footerStyle: function footerStyle(column) {
|
5085 | return {};
|
5086 | },
|
5087 | searchAccentNeutralise: false,
|
5088 | showColumns: false,
|
5089 | showColumnsToggleAll: false,
|
5090 | showColumnsSearch: false,
|
5091 | minimumCountColumns: 1,
|
5092 | showPaginationSwitch: false,
|
5093 | showRefresh: false,
|
5094 | showToggle: false,
|
5095 | showFullscreen: false,
|
5096 | smartDisplay: true,
|
5097 | escape: false,
|
5098 | escapeTitle: true,
|
5099 | filterOptions: {
|
5100 | filterAlgorithm: 'and'
|
5101 | },
|
5102 | idField: undefined,
|
5103 | selectItemName: 'btSelectItem',
|
5104 | clickToSelect: false,
|
5105 | ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
|
5106 | var tagName = _ref.tagName;
|
5107 | return ['A', 'BUTTON'].includes(tagName);
|
5108 | },
|
5109 | singleSelect: false,
|
5110 | checkboxHeader: true,
|
5111 | maintainMetaData: false,
|
5112 | multipleSelectRow: false,
|
5113 | uniqueId: undefined,
|
5114 | cardView: false,
|
5115 | detailView: false,
|
5116 | detailViewIcon: true,
|
5117 | detailViewByClick: false,
|
5118 | detailViewAlign: 'left',
|
5119 | detailFormatter: function detailFormatter(index, row) {
|
5120 | return '';
|
5121 | },
|
5122 | detailFilter: function detailFilter(index, row) {
|
5123 | return true;
|
5124 | },
|
5125 | toolbar: undefined,
|
5126 | toolbarAlign: 'left',
|
5127 | buttonsToolbar: undefined,
|
5128 | buttonsAlign: 'right',
|
5129 | buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
|
5130 | buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
|
5131 | buttonsClass: CONSTANTS.classes.buttons,
|
5132 | iconsPrefix: undefined,
|
5133 |
|
5134 | icons: {},
|
5135 |
|
5136 | iconSize: undefined,
|
5137 | loadingFontSize: 'auto',
|
5138 | loadingTemplate: function loadingTemplate(loadingMessage) {
|
5139 | return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
|
5140 | },
|
5141 | onAll: function onAll(name, args) {
|
5142 | return false;
|
5143 | },
|
5144 | onClickCell: function onClickCell(field, value, row, $element) {
|
5145 | return false;
|
5146 | },
|
5147 | onDblClickCell: function onDblClickCell(field, value, row, $element) {
|
5148 | return false;
|
5149 | },
|
5150 | onClickRow: function onClickRow(item, $element) {
|
5151 | return false;
|
5152 | },
|
5153 | onDblClickRow: function onDblClickRow(item, $element) {
|
5154 | return false;
|
5155 | },
|
5156 | onSort: function onSort(name, order) {
|
5157 | return false;
|
5158 | },
|
5159 | onCheck: function onCheck(row) {
|
5160 | return false;
|
5161 | },
|
5162 | onUncheck: function onUncheck(row) {
|
5163 | return false;
|
5164 | },
|
5165 | onCheckAll: function onCheckAll(rows) {
|
5166 | return false;
|
5167 | },
|
5168 | onUncheckAll: function onUncheckAll(rows) {
|
5169 | return false;
|
5170 | },
|
5171 | onCheckSome: function onCheckSome(rows) {
|
5172 | return false;
|
5173 | },
|
5174 | onUncheckSome: function onUncheckSome(rows) {
|
5175 | return false;
|
5176 | },
|
5177 | onLoadSuccess: function onLoadSuccess(data) {
|
5178 | return false;
|
5179 | },
|
5180 | onLoadError: function onLoadError(status) {
|
5181 | return false;
|
5182 | },
|
5183 | onColumnSwitch: function onColumnSwitch(field, checked) {
|
5184 | return false;
|
5185 | },
|
5186 | onColumnSwitchAll: function onColumnSwitchAll(checked) {
|
5187 | return false;
|
5188 | },
|
5189 | onPageChange: function onPageChange(number, size) {
|
5190 | return false;
|
5191 | },
|
5192 | onSearch: function onSearch(text) {
|
5193 | return false;
|
5194 | },
|
5195 | onToggle: function onToggle(cardView) {
|
5196 | return false;
|
5197 | },
|
5198 | onPreBody: function onPreBody(data) {
|
5199 | return false;
|
5200 | },
|
5201 | onPostBody: function onPostBody() {
|
5202 | return false;
|
5203 | },
|
5204 | onPostHeader: function onPostHeader() {
|
5205 | return false;
|
5206 | },
|
5207 | onPostFooter: function onPostFooter() {
|
5208 | return false;
|
5209 | },
|
5210 | onExpandRow: function onExpandRow(index, row, $detail) {
|
5211 | return false;
|
5212 | },
|
5213 | onCollapseRow: function onCollapseRow(index, row) {
|
5214 | return false;
|
5215 | },
|
5216 | onRefreshOptions: function onRefreshOptions(options) {
|
5217 | return false;
|
5218 | },
|
5219 | onRefresh: function onRefresh(params) {
|
5220 | return false;
|
5221 | },
|
5222 | onResetView: function onResetView() {
|
5223 | return false;
|
5224 | },
|
5225 | onScrollBody: function onScrollBody() {
|
5226 | return false;
|
5227 | },
|
5228 | onTogglePagination: function onTogglePagination(newState) {
|
5229 | return false;
|
5230 | },
|
5231 | onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
|
5232 | return false;
|
5233 | }
|
5234 | };
|
5235 | var EN = {
|
5236 | formatLoadingMessage: function formatLoadingMessage() {
|
5237 | return 'Loading, please wait';
|
5238 | },
|
5239 | formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
|
5240 | return "".concat(pageNumber, " rows per page");
|
5241 | },
|
5242 | formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
|
5243 | if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
|
5244 | return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
|
5245 | }
|
5246 | return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
|
5247 | },
|
5248 | formatSRPaginationPreText: function formatSRPaginationPreText() {
|
5249 | return 'previous page';
|
5250 | },
|
5251 | formatSRPaginationPageText: function formatSRPaginationPageText(page) {
|
5252 | return "to page ".concat(page);
|
5253 | },
|
5254 | formatSRPaginationNextText: function formatSRPaginationNextText() {
|
5255 | return 'next page';
|
5256 | },
|
5257 | formatDetailPagination: function formatDetailPagination(totalRows) {
|
5258 | return "Showing ".concat(totalRows, " rows");
|
5259 | },
|
5260 | formatSearch: function formatSearch() {
|
5261 | return 'Search';
|
5262 | },
|
5263 | formatClearSearch: function formatClearSearch() {
|
5264 | return 'Clear Search';
|
5265 | },
|
5266 | formatNoMatches: function formatNoMatches() {
|
5267 | return 'No matching records found';
|
5268 | },
|
5269 | formatPaginationSwitch: function formatPaginationSwitch() {
|
5270 | return 'Hide/Show pagination';
|
5271 | },
|
5272 | formatPaginationSwitchDown: function formatPaginationSwitchDown() {
|
5273 | return 'Show pagination';
|
5274 | },
|
5275 | formatPaginationSwitchUp: function formatPaginationSwitchUp() {
|
5276 | return 'Hide pagination';
|
5277 | },
|
5278 | formatRefresh: function formatRefresh() {
|
5279 | return 'Refresh';
|
5280 | },
|
5281 | formatToggleOn: function formatToggleOn() {
|
5282 | return 'Show card view';
|
5283 | },
|
5284 | formatToggleOff: function formatToggleOff() {
|
5285 | return 'Hide card view';
|
5286 | },
|
5287 | formatColumns: function formatColumns() {
|
5288 | return 'Columns';
|
5289 | },
|
5290 | formatColumnsToggleAll: function formatColumnsToggleAll() {
|
5291 | return 'Toggle all';
|
5292 | },
|
5293 | formatFullscreen: function formatFullscreen() {
|
5294 | return 'Fullscreen';
|
5295 | },
|
5296 | formatAllRows: function formatAllRows() {
|
5297 | return 'All';
|
5298 | }
|
5299 | };
|
5300 | var COLUMN_DEFAULTS = {
|
5301 | field: undefined,
|
5302 | title: undefined,
|
5303 | titleTooltip: undefined,
|
5304 | class: undefined,
|
5305 | width: undefined,
|
5306 | widthUnit: 'px',
|
5307 | rowspan: undefined,
|
5308 | colspan: undefined,
|
5309 | align: undefined,
|
5310 |
|
5311 | halign: undefined,
|
5312 |
|
5313 | falign: undefined,
|
5314 |
|
5315 | valign: undefined,
|
5316 |
|
5317 | cellStyle: undefined,
|
5318 | radio: false,
|
5319 | checkbox: false,
|
5320 | checkboxEnabled: true,
|
5321 | clickToSelect: true,
|
5322 | showSelectTitle: false,
|
5323 | sortable: false,
|
5324 | sortName: undefined,
|
5325 | order: 'asc',
|
5326 |
|
5327 | sorter: undefined,
|
5328 | visible: true,
|
5329 | switchable: true,
|
5330 | cardVisible: true,
|
5331 | searchable: true,
|
5332 | formatter: undefined,
|
5333 | footerFormatter: undefined,
|
5334 | detailFormatter: undefined,
|
5335 | searchFormatter: true,
|
5336 | searchHighlightFormatter: false,
|
5337 | escape: undefined,
|
5338 | events: undefined
|
5339 | };
|
5340 | var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
|
5341 | var EVENTS = {
|
5342 | 'all.bs.table': 'onAll',
|
5343 | 'click-row.bs.table': 'onClickRow',
|
5344 | 'dbl-click-row.bs.table': 'onDblClickRow',
|
5345 | 'click-cell.bs.table': 'onClickCell',
|
5346 | 'dbl-click-cell.bs.table': 'onDblClickCell',
|
5347 | 'sort.bs.table': 'onSort',
|
5348 | 'check.bs.table': 'onCheck',
|
5349 | 'uncheck.bs.table': 'onUncheck',
|
5350 | 'check-all.bs.table': 'onCheckAll',
|
5351 | 'uncheck-all.bs.table': 'onUncheckAll',
|
5352 | 'check-some.bs.table': 'onCheckSome',
|
5353 | 'uncheck-some.bs.table': 'onUncheckSome',
|
5354 | 'load-success.bs.table': 'onLoadSuccess',
|
5355 | 'load-error.bs.table': 'onLoadError',
|
5356 | 'column-switch.bs.table': 'onColumnSwitch',
|
5357 | 'column-switch-all.bs.table': 'onColumnSwitchAll',
|
5358 | 'page-change.bs.table': 'onPageChange',
|
5359 | 'search.bs.table': 'onSearch',
|
5360 | 'toggle.bs.table': 'onToggle',
|
5361 | 'pre-body.bs.table': 'onPreBody',
|
5362 | 'post-body.bs.table': 'onPostBody',
|
5363 | 'post-header.bs.table': 'onPostHeader',
|
5364 | 'post-footer.bs.table': 'onPostFooter',
|
5365 | 'expand-row.bs.table': 'onExpandRow',
|
5366 | 'collapse-row.bs.table': 'onCollapseRow',
|
5367 | 'refresh-options.bs.table': 'onRefreshOptions',
|
5368 | 'reset-view.bs.table': 'onResetView',
|
5369 | 'refresh.bs.table': 'onRefresh',
|
5370 | 'scroll-body.bs.table': 'onScrollBody',
|
5371 | 'toggle-pagination.bs.table': 'onTogglePagination',
|
5372 | 'virtual-scroll.bs.table': 'onVirtualScroll'
|
5373 | };
|
5374 | Object.assign(DEFAULTS, EN);
|
5375 | var Constants = {
|
5376 | VERSION: VERSION,
|
5377 | THEME: "bootstrap".concat(bootstrapVersion),
|
5378 | CONSTANTS: CONSTANTS,
|
5379 | DEFAULTS: DEFAULTS,
|
5380 | COLUMN_DEFAULTS: COLUMN_DEFAULTS,
|
5381 | METHODS: METHODS,
|
5382 | EVENTS: EVENTS,
|
5383 | LOCALES: {
|
5384 | en: EN,
|
5385 | 'en-US': EN
|
5386 | }
|
5387 | };
|
5388 |
|
5389 | var BLOCK_ROWS = 50;
|
5390 | var CLUSTER_BLOCKS = 4;
|
5391 | var VirtualScroll = function () {
|
5392 | function VirtualScroll(options) {
|
5393 | var _this = this;
|
5394 | _classCallCheck(this, VirtualScroll);
|
5395 | this.rows = options.rows;
|
5396 | this.scrollEl = options.scrollEl;
|
5397 | this.contentEl = options.contentEl;
|
5398 | this.callback = options.callback;
|
5399 | this.itemHeight = options.itemHeight;
|
5400 | this.cache = {};
|
5401 | this.scrollTop = this.scrollEl.scrollTop;
|
5402 | this.initDOM(this.rows, options.fixedScroll);
|
5403 | this.scrollEl.scrollTop = this.scrollTop;
|
5404 | this.lastCluster = 0;
|
5405 | var onScroll = function onScroll() {
|
5406 | if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
|
5407 | _this.initDOM(_this.rows);
|
5408 | _this.callback(_this.startIndex, _this.endIndex);
|
5409 | }
|
5410 | };
|
5411 | this.scrollEl.addEventListener('scroll', onScroll, false);
|
5412 | this.destroy = function () {
|
5413 | _this.contentEl.innerHtml = '';
|
5414 | _this.scrollEl.removeEventListener('scroll', onScroll, false);
|
5415 | };
|
5416 | }
|
5417 | _createClass(VirtualScroll, [{
|
5418 | key: "initDOM",
|
5419 | value: function initDOM(rows, fixedScroll) {
|
5420 | if (typeof this.clusterHeight === 'undefined') {
|
5421 | this.cache.scrollTop = this.scrollEl.scrollTop;
|
5422 | this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
|
5423 | this.getRowsHeight(rows);
|
5424 | }
|
5425 | var data = this.initData(rows, this.getNum(fixedScroll));
|
5426 | var thisRows = data.rows.join('');
|
5427 | var dataChanged = this.checkChanges('data', thisRows);
|
5428 | var topOffsetChanged = this.checkChanges('top', data.topOffset);
|
5429 | var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
|
5430 | var html = [];
|
5431 | if (dataChanged && topOffsetChanged) {
|
5432 | if (data.topOffset) {
|
5433 | html.push(this.getExtra('top', data.topOffset));
|
5434 | }
|
5435 | html.push(thisRows);
|
5436 | if (data.bottomOffset) {
|
5437 | html.push(this.getExtra('bottom', data.bottomOffset));
|
5438 | }
|
5439 | this.startIndex = data.start;
|
5440 | this.endIndex = data.end;
|
5441 | this.contentEl.innerHTML = html.join('');
|
5442 | if (fixedScroll) {
|
5443 | this.contentEl.scrollTop = this.cache.scrollTop;
|
5444 | }
|
5445 | } else if (bottomOffsetChanged) {
|
5446 | this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
|
5447 | }
|
5448 | }
|
5449 | }, {
|
5450 | key: "getRowsHeight",
|
5451 | value: function getRowsHeight() {
|
5452 | if (typeof this.itemHeight === 'undefined') {
|
5453 | var nodes = this.contentEl.children;
|
5454 | var node = nodes[Math.floor(nodes.length / 2)];
|
5455 | this.itemHeight = node.offsetHeight;
|
5456 | }
|
5457 | this.blockHeight = this.itemHeight * BLOCK_ROWS;
|
5458 | this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
|
5459 | this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
|
5460 | }
|
5461 | }, {
|
5462 | key: "getNum",
|
5463 | value: function getNum(fixedScroll) {
|
5464 | this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
|
5465 | return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
|
5466 | }
|
5467 | }, {
|
5468 | key: "initData",
|
5469 | value: function initData(rows, num) {
|
5470 | if (rows.length < BLOCK_ROWS) {
|
5471 | return {
|
5472 | topOffset: 0,
|
5473 | bottomOffset: 0,
|
5474 | rowsAbove: 0,
|
5475 | rows: rows
|
5476 | };
|
5477 | }
|
5478 | var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
|
5479 | var end = start + this.clusterRows;
|
5480 | var topOffset = Math.max(start * this.itemHeight, 0);
|
5481 | var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
|
5482 | var thisRows = [];
|
5483 | var rowsAbove = start;
|
5484 | if (topOffset < 1) {
|
5485 | rowsAbove++;
|
5486 | }
|
5487 | for (var i = start; i < end; i++) {
|
5488 | rows[i] && thisRows.push(rows[i]);
|
5489 | }
|
5490 | return {
|
5491 | start: start,
|
5492 | end: end,
|
5493 | topOffset: topOffset,
|
5494 | bottomOffset: bottomOffset,
|
5495 | rowsAbove: rowsAbove,
|
5496 | rows: thisRows
|
5497 | };
|
5498 | }
|
5499 | }, {
|
5500 | key: "checkChanges",
|
5501 | value: function checkChanges(type, value) {
|
5502 | var changed = value !== this.cache[type];
|
5503 | this.cache[type] = value;
|
5504 | return changed;
|
5505 | }
|
5506 | }, {
|
5507 | key: "getExtra",
|
5508 | value: function getExtra(className, height) {
|
5509 | var tag = document.createElement('tr');
|
5510 | tag.className = "virtual-scroll-".concat(className);
|
5511 | if (height) {
|
5512 | tag.style.height = "".concat(height, "px");
|
5513 | }
|
5514 | return tag.outerHTML;
|
5515 | }
|
5516 | }]);
|
5517 | return VirtualScroll;
|
5518 | }();
|
5519 |
|
5520 | var BootstrapTable = function () {
|
5521 | function BootstrapTable(el, options) {
|
5522 | _classCallCheck(this, BootstrapTable);
|
5523 | this.options = options;
|
5524 | this.$el = $$o(el);
|
5525 | this.$el_ = this.$el.clone();
|
5526 | this.timeoutId_ = 0;
|
5527 | this.timeoutFooter_ = 0;
|
5528 | }
|
5529 | _createClass(BootstrapTable, [{
|
5530 | key: "init",
|
5531 | value: function init() {
|
5532 | this.initConstants();
|
5533 | this.initLocale();
|
5534 | this.initContainer();
|
5535 | this.initTable();
|
5536 | this.initHeader();
|
5537 | this.initData();
|
5538 | this.initHiddenRows();
|
5539 | this.initToolbar();
|
5540 | this.initPagination();
|
5541 | this.initBody();
|
5542 | this.initSearchText();
|
5543 | this.initServer();
|
5544 | }
|
5545 | }, {
|
5546 | key: "initConstants",
|
5547 | value: function initConstants() {
|
5548 | var opts = this.options;
|
5549 | this.constants = Constants.CONSTANTS;
|
5550 | this.constants.theme = $$o.fn.bootstrapTable.theme;
|
5551 | this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle';
|
5552 |
|
5553 |
|
5554 | var iconsPrefix = Utils.getIconsPrefix($$o.fn.bootstrapTable.theme);
|
5555 | var icons = Utils.getIcons(iconsPrefix);
|
5556 | if (typeof opts.icons === 'string') {
|
5557 | opts.icons = Utils.calculateObjectValue(null, opts.icons);
|
5558 | }
|
5559 | opts.iconsPrefix = opts.iconsPrefix || $$o.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
|
5560 | opts.icons = Object.assign(icons, $$o.fn.bootstrapTable.defaults.icons, opts.icons);
|
5561 |
|
5562 |
|
5563 | var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
|
5564 | this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
|
5565 | this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
|
5566 | if (_typeof(this.buttons) !== 'object') {
|
5567 | this.buttons = {};
|
5568 | }
|
5569 | }
|
5570 | }, {
|
5571 | key: "initLocale",
|
5572 | value: function initLocale() {
|
5573 | if (this.options.locale) {
|
5574 | var locales = $$o.fn.bootstrapTable.locales;
|
5575 | var parts = this.options.locale.split(/-|_/);
|
5576 | parts[0] = parts[0].toLowerCase();
|
5577 | if (parts[1]) {
|
5578 | parts[1] = parts[1].toUpperCase();
|
5579 | }
|
5580 | var localesToExtend = {};
|
5581 | if (locales[this.options.locale]) {
|
5582 | localesToExtend = locales[this.options.locale];
|
5583 | } else if (locales[parts.join('-')]) {
|
5584 | localesToExtend = locales[parts.join('-')];
|
5585 | } else if (locales[parts[0]]) {
|
5586 | localesToExtend = locales[parts[0]];
|
5587 | }
|
5588 | for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
|
5589 | var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
5590 | formatName = _Object$entries$_i[0],
|
5591 | func = _Object$entries$_i[1];
|
5592 | if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
|
5593 | continue;
|
5594 | }
|
5595 | this.options[formatName] = func;
|
5596 | }
|
5597 | }
|
5598 | }
|
5599 | }, {
|
5600 | key: "initContainer",
|
5601 | value: function initContainer() {
|
5602 | var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
|
5603 | var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
|
5604 | var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
|
5605 | this.$container = $$o("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
|
5606 | this.$container.insertAfter(this.$el);
|
5607 | this.$tableContainer = this.$container.find('.fixed-table-container');
|
5608 | this.$tableHeader = this.$container.find('.fixed-table-header');
|
5609 | this.$tableBody = this.$container.find('.fixed-table-body');
|
5610 | this.$tableLoading = this.$container.find('.fixed-table-loading');
|
5611 | this.$tableFooter = this.$el.find('tfoot');
|
5612 |
|
5613 | if (this.options.buttonsToolbar) {
|
5614 | this.$toolbar = $$o('body').find(this.options.buttonsToolbar);
|
5615 | } else {
|
5616 | this.$toolbar = this.$container.find('.fixed-table-toolbar');
|
5617 | }
|
5618 | this.$pagination = this.$container.find('.fixed-table-pagination');
|
5619 | this.$tableBody.append(this.$el);
|
5620 | this.$container.after('<div class="clearfix"></div>');
|
5621 | this.$el.addClass(this.options.classes);
|
5622 | this.$tableLoading.addClass(this.options.classes);
|
5623 | if (this.options.height) {
|
5624 | this.$tableContainer.addClass('fixed-height');
|
5625 | if (this.options.showFooter) {
|
5626 | this.$tableContainer.addClass('has-footer');
|
5627 | }
|
5628 | if (this.options.classes.split(' ').includes('table-bordered')) {
|
5629 | this.$tableBody.append('<div class="fixed-table-border"></div>');
|
5630 | this.$tableBorder = this.$tableBody.find('.fixed-table-border');
|
5631 | this.$tableLoading.addClass('fixed-table-border');
|
5632 | }
|
5633 | this.$tableFooter = this.$container.find('.fixed-table-footer');
|
5634 | }
|
5635 | }
|
5636 | }, {
|
5637 | key: "initTable",
|
5638 | value: function initTable() {
|
5639 | var _this = this;
|
5640 | var columns = [];
|
5641 | this.$header = this.$el.find('>thead');
|
5642 | if (!this.$header.length) {
|
5643 | this.$header = $$o("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
|
5644 | } else if (this.options.theadClasses) {
|
5645 | this.$header.addClass(this.options.theadClasses);
|
5646 | }
|
5647 | this._headerTrClasses = [];
|
5648 | this._headerTrStyles = [];
|
5649 | this.$header.find('tr').each(function (i, el) {
|
5650 | var $tr = $$o(el);
|
5651 | var column = [];
|
5652 | $tr.find('th').each(function (i, el) {
|
5653 | var $th = $$o(el);
|
5654 |
|
5655 |
|
5656 | if (typeof $th.data('field') !== 'undefined') {
|
5657 | $th.data('field', "".concat($th.data('field')));
|
5658 | }
|
5659 | var _data = Object.assign({}, $th.data());
|
5660 | for (var key in _data) {
|
5661 | if ($$o.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) {
|
5662 | delete _data[key];
|
5663 | }
|
5664 | }
|
5665 | column.push(Utils.extend({}, {
|
5666 | _data: Utils.getRealDataAttr(_data),
|
5667 | title: $th.html(),
|
5668 | class: $th.attr('class'),
|
5669 | titleTooltip: $th.attr('title'),
|
5670 | rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
|
5671 | colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
|
5672 | }, $th.data()));
|
5673 | });
|
5674 | columns.push(column);
|
5675 | if ($tr.attr('class')) {
|
5676 | _this._headerTrClasses.push($tr.attr('class'));
|
5677 | }
|
5678 | if ($tr.attr('style')) {
|
5679 | _this._headerTrStyles.push($tr.attr('style'));
|
5680 | }
|
5681 | });
|
5682 | if (!Array.isArray(this.options.columns[0])) {
|
5683 | this.options.columns = [this.options.columns];
|
5684 | }
|
5685 | this.options.columns = Utils.extend(true, [], columns, this.options.columns);
|
5686 | this.columns = [];
|
5687 | this.fieldsColumnsIndex = [];
|
5688 | Utils.setFieldIndex(this.options.columns);
|
5689 | this.options.columns.forEach(function (columns, i) {
|
5690 | columns.forEach(function (_column, j) {
|
5691 | var column = Utils.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, {
|
5692 | passed: _column
|
5693 | });
|
5694 | if (typeof column.fieldIndex !== 'undefined') {
|
5695 | _this.columns[column.fieldIndex] = column;
|
5696 | _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
|
5697 | }
|
5698 | _this.options.columns[i][j] = column;
|
5699 | });
|
5700 | });
|
5701 |
|
5702 |
|
5703 | if (!this.options.data.length) {
|
5704 | var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
|
5705 | if (htmlData.length) {
|
5706 | this.options.data = htmlData;
|
5707 | this.fromHtml = true;
|
5708 | }
|
5709 | }
|
5710 | if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
|
5711 | this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
|
5712 | }
|
5713 | if (this.footerData) {
|
5714 | this.$el.find('tfoot').html('<tr></tr>');
|
5715 | }
|
5716 | if (!this.options.showFooter || this.options.cardView) {
|
5717 | this.$tableFooter.hide();
|
5718 | } else {
|
5719 | this.$tableFooter.show();
|
5720 | }
|
5721 | }
|
5722 | }, {
|
5723 | key: "initHeader",
|
5724 | value: function initHeader() {
|
5725 | var _this2 = this;
|
5726 | var visibleColumns = {};
|
5727 | var headerHtml = [];
|
5728 | this.header = {
|
5729 | fields: [],
|
5730 | styles: [],
|
5731 | classes: [],
|
5732 | formatters: [],
|
5733 | detailFormatters: [],
|
5734 | events: [],
|
5735 | sorters: [],
|
5736 | sortNames: [],
|
5737 | cellStyles: [],
|
5738 | searchables: []
|
5739 | };
|
5740 | Utils.updateFieldGroup(this.options.columns, this.columns);
|
5741 | this.options.columns.forEach(function (columns, i) {
|
5742 | var html = [];
|
5743 | html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
|
5744 | var detailViewTemplate = '';
|
5745 | if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
|
5746 | var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
|
5747 | detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
|
5748 | }
|
5749 | if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
|
5750 | html.push(detailViewTemplate);
|
5751 | }
|
5752 | columns.forEach(function (column, j) {
|
5753 | var class_ = Utils.sprintf(' class="%s"', column['class']);
|
5754 | var unitWidth = column.widthUnit;
|
5755 | var width = parseFloat(column.width);
|
5756 | var columnHalign = column.halign ? column.halign : column.align;
|
5757 | var halign = Utils.sprintf('text-align: %s; ', columnHalign);
|
5758 | var align = Utils.sprintf('text-align: %s; ', column.align);
|
5759 | var style = Utils.sprintf('vertical-align: %s; ', column.valign);
|
5760 | style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
|
5761 | if (typeof column.fieldIndex === 'undefined' && !column.visible) {
|
5762 | return;
|
5763 | }
|
5764 | var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
|
5765 | var csses = [];
|
5766 | var data_ = [];
|
5767 | var classes = '';
|
5768 | if (headerStyle && headerStyle.css) {
|
5769 | for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
|
5770 | var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
5771 | key = _Object$entries2$_i[0],
|
5772 | value = _Object$entries2$_i[1];
|
5773 | csses.push("".concat(key, ": ").concat(value));
|
5774 | }
|
5775 | }
|
5776 | if (headerStyle && headerStyle.classes) {
|
5777 | classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
|
5778 | }
|
5779 | if (typeof column.fieldIndex !== 'undefined') {
|
5780 | _this2.header.fields[column.fieldIndex] = column.field;
|
5781 | _this2.header.styles[column.fieldIndex] = align + style;
|
5782 | _this2.header.classes[column.fieldIndex] = class_;
|
5783 | _this2.header.formatters[column.fieldIndex] = column.formatter;
|
5784 | _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
|
5785 | _this2.header.events[column.fieldIndex] = column.events;
|
5786 | _this2.header.sorters[column.fieldIndex] = column.sorter;
|
5787 | _this2.header.sortNames[column.fieldIndex] = column.sortName;
|
5788 | _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
|
5789 | _this2.header.searchables[column.fieldIndex] = column.searchable;
|
5790 | if (!column.visible) {
|
5791 | return;
|
5792 | }
|
5793 | if (_this2.options.cardView && !column.cardVisible) {
|
5794 | return;
|
5795 | }
|
5796 | visibleColumns[column.field] = column;
|
5797 | }
|
5798 | if (Object.keys(column._data || {}).length > 0) {
|
5799 | for (var _i3 = 0, _Object$entries3 = Object.entries(column._data); _i3 < _Object$entries3.length; _i3++) {
|
5800 | var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
|
5801 | k = _Object$entries3$_i[0],
|
5802 | v = _Object$entries3$_i[1];
|
5803 | data_.push("data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'"));
|
5804 | }
|
5805 | }
|
5806 | html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field),
|
5807 |
|
5808 | j === 0 && i > 0 ? ' data-not-first-th' : '', data_.length > 0 ? data_.join(' ') : '', '>');
|
5809 | html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? "sortable".concat(columnHalign === 'center' ? ' sortable-center' : '', " both") : ''));
|
5810 | var text = _this2.options.escape && _this2.options.escapeTitle ? Utils.escapeHTML(column.title) : column.title;
|
5811 | var title = text;
|
5812 | if (column.checkbox) {
|
5813 | text = '';
|
5814 | if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
|
5815 | text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
|
5816 | }
|
5817 | _this2.header.stateField = column.field;
|
5818 | }
|
5819 | if (column.radio) {
|
5820 | text = '';
|
5821 | _this2.header.stateField = column.field;
|
5822 | }
|
5823 | if (!text && column.showSelectTitle) {
|
5824 | text += title;
|
5825 | }
|
5826 | html.push(text);
|
5827 | html.push('</div>');
|
5828 | html.push('<div class="fht-cell"></div>');
|
5829 | html.push('</div>');
|
5830 | html.push('</th>');
|
5831 | });
|
5832 | if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
|
5833 | html.push(detailViewTemplate);
|
5834 | }
|
5835 | html.push('</tr>');
|
5836 | if (html.length > 3) {
|
5837 | headerHtml.push(html.join(''));
|
5838 | }
|
5839 | });
|
5840 | this.$header.html(headerHtml.join(''));
|
5841 | this.$header.find('th[data-field]').each(function (i, el) {
|
5842 | $$o(el).data(visibleColumns[$$o(el).data('field')]);
|
5843 | });
|
5844 | this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
|
5845 | var $this = $$o(e.currentTarget);
|
5846 | if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
|
5847 | if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
|
5848 | return false;
|
5849 | }
|
5850 | }
|
5851 | if (_this2.options.sortable && $this.parent().data().sortable) {
|
5852 | _this2.onSort(e);
|
5853 | }
|
5854 | });
|
5855 | var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
|
5856 | $$o(window).off(resizeEvent);
|
5857 | if (!this.options.showHeader || this.options.cardView) {
|
5858 | this.$header.hide();
|
5859 | this.$tableHeader.hide();
|
5860 | this.$tableLoading.css('top', 0);
|
5861 | } else {
|
5862 | this.$header.show();
|
5863 | this.$tableHeader.show();
|
5864 | this.$tableLoading.css('top', this.$header.outerHeight() + 1);
|
5865 |
|
5866 | this.getCaret();
|
5867 | $$o(window).on(resizeEvent, function () {
|
5868 | return _this2.resetView();
|
5869 | });
|
5870 | }
|
5871 | this.$selectAll = this.$header.find('[name="btSelectAll"]');
|
5872 | this.$selectAll.off('click').on('click', function (e) {
|
5873 | e.stopPropagation();
|
5874 | var checked = $$o(e.currentTarget).prop('checked');
|
5875 | _this2[checked ? 'checkAll' : 'uncheckAll']();
|
5876 | _this2.updateSelected();
|
5877 | });
|
5878 | }
|
5879 | }, {
|
5880 | key: "initData",
|
5881 | value: function initData(data, type) {
|
5882 | if (type === 'append') {
|
5883 | this.options.data = this.options.data.concat(data);
|
5884 | } else if (type === 'prepend') {
|
5885 | this.options.data = [].concat(data).concat(this.options.data);
|
5886 | } else {
|
5887 | data = data || Utils.deepCopy(this.options.data);
|
5888 | this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
|
5889 | }
|
5890 | this.data = _toConsumableArray(this.options.data);
|
5891 | if (this.options.sortReset) {
|
5892 | this.unsortedData = _toConsumableArray(this.data);
|
5893 | }
|
5894 | if (this.options.sidePagination === 'server') {
|
5895 | return;
|
5896 | }
|
5897 | this.initSort();
|
5898 | }
|
5899 | }, {
|
5900 | key: "initSort",
|
5901 | value: function initSort() {
|
5902 | var _this3 = this;
|
5903 | var name = this.options.sortName;
|
5904 | var order = this.options.sortOrder === 'desc' ? -1 : 1;
|
5905 | var index = this.header.fields.indexOf(this.options.sortName);
|
5906 | var timeoutId = 0;
|
5907 | if (index !== -1) {
|
5908 | if (this.options.sortStable) {
|
5909 | this.data.forEach(function (row, i) {
|
5910 | if (!row.hasOwnProperty('_position')) {
|
5911 | row._position = i;
|
5912 | }
|
5913 | });
|
5914 | }
|
5915 | if (this.options.customSort) {
|
5916 | Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
|
5917 | } else {
|
5918 | this.data.sort(function (a, b) {
|
5919 | if (_this3.header.sortNames[index]) {
|
5920 | name = _this3.header.sortNames[index];
|
5921 | }
|
5922 | var aa = Utils.getItemField(a, name, _this3.options.escape);
|
5923 | var bb = Utils.getItemField(b, name, _this3.options.escape);
|
5924 | var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
|
5925 | if (value !== undefined) {
|
5926 | if (_this3.options.sortStable && value === 0) {
|
5927 | return order * (a._position - b._position);
|
5928 | }
|
5929 | return order * value;
|
5930 | }
|
5931 | return Utils.sort(aa, bb, order, _this3.options, a._position, b._position);
|
5932 | });
|
5933 | }
|
5934 | if (this.options.sortClass !== undefined) {
|
5935 | clearTimeout(timeoutId);
|
5936 | timeoutId = setTimeout(function () {
|
5937 | _this3.$el.removeClass(_this3.options.sortClass);
|
5938 | var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
|
5939 | _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
|
5940 | }, 250);
|
5941 | }
|
5942 | } else if (this.options.sortReset) {
|
5943 | this.data = _toConsumableArray(this.unsortedData);
|
5944 | }
|
5945 | }
|
5946 | }, {
|
5947 | key: "onSort",
|
5948 | value: function onSort(_ref) {
|
5949 | var type = _ref.type,
|
5950 | currentTarget = _ref.currentTarget;
|
5951 | var $this = type === 'keypress' ? $$o(currentTarget) : $$o(currentTarget).parent();
|
5952 | var $this_ = this.$header.find('th').eq($this.index());
|
5953 | this.$header.add(this.$header_).find('span.order').remove();
|
5954 | if (this.options.sortName === $this.data('field')) {
|
5955 | var currentSortOrder = this.options.sortOrder;
|
5956 | var initialSortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
|
5957 | if (currentSortOrder === undefined) {
|
5958 | this.options.sortOrder = 'asc';
|
5959 | } else if (currentSortOrder === 'asc') {
|
5960 | this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'asc' ? 'desc' : undefined : 'desc';
|
5961 | } else if (this.options.sortOrder === 'desc') {
|
5962 | this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'desc' ? 'asc' : undefined : 'asc';
|
5963 | }
|
5964 | if (this.options.sortOrder === undefined) {
|
5965 | this.options.sortName = undefined;
|
5966 | }
|
5967 | } else {
|
5968 | this.options.sortName = $this.data('field');
|
5969 | if (this.options.rememberOrder) {
|
5970 | this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
|
5971 | } else {
|
5972 | this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
|
5973 | }
|
5974 | }
|
5975 | this.trigger('sort', this.options.sortName, this.options.sortOrder);
|
5976 | $this.add($this_).data('order', this.options.sortOrder);
|
5977 |
|
5978 |
|
5979 | this.getCaret();
|
5980 | if (this.options.sidePagination === 'server' && this.options.serverSort) {
|
5981 | this.options.pageNumber = 1;
|
5982 | this.initServer(this.options.silentSort);
|
5983 | return;
|
5984 | }
|
5985 | if (this.options.pagination && this.options.sortResetPage) {
|
5986 | this.options.pageNumber = 1;
|
5987 | this.initPagination();
|
5988 | }
|
5989 | this.initSort();
|
5990 | this.initBody();
|
5991 | }
|
5992 | }, {
|
5993 | key: "initToolbar",
|
5994 | value: function initToolbar() {
|
5995 | var _this4 = this;
|
5996 | var opts = this.options;
|
5997 | var html = [];
|
5998 | var timeoutId = 0;
|
5999 | var $keepOpen;
|
6000 | var switchableCount = 0;
|
6001 | if (this.$toolbar.find('.bs-bars').children().length) {
|
6002 | $$o('body').append($$o(opts.toolbar));
|
6003 | }
|
6004 | this.$toolbar.html('');
|
6005 | if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
|
6006 | $$o(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$o(opts.toolbar));
|
6007 | }
|
6008 |
|
6009 |
|
6010 | html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
|
6011 | if (typeof opts.buttonsOrder === 'string') {
|
6012 | opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
|
6013 | }
|
6014 | this.buttons = Object.assign(this.buttons, {
|
6015 | paginationSwitch: {
|
6016 | text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
|
6017 | icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
|
6018 | render: false,
|
6019 | event: this.togglePagination,
|
6020 | attributes: {
|
6021 | 'aria-label': opts.formatPaginationSwitch(),
|
6022 | title: opts.formatPaginationSwitch()
|
6023 | }
|
6024 | },
|
6025 | refresh: {
|
6026 | text: opts.formatRefresh(),
|
6027 | icon: opts.icons.refresh,
|
6028 | render: false,
|
6029 | event: this.refresh,
|
6030 | attributes: {
|
6031 | 'aria-label': opts.formatRefresh(),
|
6032 | title: opts.formatRefresh()
|
6033 | }
|
6034 | },
|
6035 | toggle: {
|
6036 | text: opts.formatToggleOn(),
|
6037 | icon: opts.icons.toggleOff,
|
6038 | render: false,
|
6039 | event: this.toggleView,
|
6040 | attributes: {
|
6041 | 'aria-label': opts.formatToggleOn(),
|
6042 | title: opts.formatToggleOn()
|
6043 | }
|
6044 | },
|
6045 | fullscreen: {
|
6046 | text: opts.formatFullscreen(),
|
6047 | icon: opts.icons.fullscreen,
|
6048 | render: false,
|
6049 | event: this.toggleFullscreen,
|
6050 | attributes: {
|
6051 | 'aria-label': opts.formatFullscreen(),
|
6052 | title: opts.formatFullscreen()
|
6053 | }
|
6054 | },
|
6055 | columns: {
|
6056 | render: false,
|
6057 | html: function html() {
|
6058 | var html = [];
|
6059 | html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(_this4.constants.dataToggle, "=\"dropdown\"\n aria-label=\"").concat(opts.formatColumns(), "\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
|
6060 | if (opts.showColumnsSearch) {
|
6061 | html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
|
6062 | html.push(_this4.constants.html.toolbarDropdownSeparator);
|
6063 | }
|
6064 | if (opts.showColumnsToggleAll) {
|
6065 | var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
|
6066 | return !_this4.isSelectionColumn(column);
|
6067 | }).length;
|
6068 | html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
|
6069 | html.push(_this4.constants.html.toolbarDropdownSeparator);
|
6070 | }
|
6071 | var visibleColumns = 0;
|
6072 | _this4.columns.forEach(function (column) {
|
6073 | if (column.visible) {
|
6074 | visibleColumns++;
|
6075 | }
|
6076 | });
|
6077 | _this4.columns.forEach(function (column, i) {
|
6078 | if (_this4.isSelectionColumn(column)) {
|
6079 | return;
|
6080 | }
|
6081 | if (opts.cardView && !column.cardVisible) {
|
6082 | return;
|
6083 | }
|
6084 | var checked = column.visible ? ' checked="checked"' : '';
|
6085 | var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
|
6086 | if (column.switchable) {
|
6087 | html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
|
6088 | switchableCount++;
|
6089 | }
|
6090 | });
|
6091 | html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
|
6092 | return html.join('');
|
6093 | }
|
6094 | }
|
6095 | });
|
6096 | var buttonsHtml = {};
|
6097 | for (var _i4 = 0, _Object$entries4 = Object.entries(this.buttons); _i4 < _Object$entries4.length; _i4++) {
|
6098 | var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
|
6099 | buttonName = _Object$entries4$_i[0],
|
6100 | buttonConfig = _Object$entries4$_i[1];
|
6101 | var buttonHtml = void 0;
|
6102 | if (buttonConfig.hasOwnProperty('html')) {
|
6103 | if (typeof buttonConfig.html === 'function') {
|
6104 | buttonHtml = buttonConfig.html();
|
6105 | } else if (typeof buttonConfig.html === 'string') {
|
6106 | buttonHtml = buttonConfig.html;
|
6107 | }
|
6108 | } else {
|
6109 | buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
|
6110 | if (buttonConfig.hasOwnProperty('attributes')) {
|
6111 | for (var _i5 = 0, _Object$entries5 = Object.entries(buttonConfig.attributes); _i5 < _Object$entries5.length; _i5++) {
|
6112 | var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
|
6113 | attributeName = _Object$entries5$_i[0],
|
6114 | value = _Object$entries5$_i[1];
|
6115 | buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
|
6116 | }
|
6117 | }
|
6118 | buttonHtml += '>';
|
6119 | if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
|
6120 | buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
|
6121 | }
|
6122 | if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
|
6123 | buttonHtml += buttonConfig.text;
|
6124 | }
|
6125 | buttonHtml += '</button>';
|
6126 | }
|
6127 | buttonsHtml[buttonName] = buttonHtml;
|
6128 | var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
|
6129 | var showOption = opts[optionName];
|
6130 | if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
|
6131 | opts[optionName] = true;
|
6132 | }
|
6133 | if (!opts.buttonsOrder.includes(buttonName)) {
|
6134 | opts.buttonsOrder.push(buttonName);
|
6135 | }
|
6136 | }
|
6137 |
|
6138 |
|
6139 | var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
|
6140 | _step;
|
6141 | try {
|
6142 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
6143 | var button = _step.value;
|
6144 | var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
|
6145 | if (_showOption) {
|
6146 | html.push(buttonsHtml[button]);
|
6147 | }
|
6148 | }
|
6149 | } catch (err) {
|
6150 | _iterator.e(err);
|
6151 | } finally {
|
6152 | _iterator.f();
|
6153 | }
|
6154 | html.push('</div>');
|
6155 |
|
6156 |
|
6157 | if (this.showToolbar || html.length > 2) {
|
6158 | this.$toolbar.append(html.join(''));
|
6159 | }
|
6160 | for (var _i6 = 0, _Object$entries6 = Object.entries(this.buttons); _i6 < _Object$entries6.length; _i6++) {
|
6161 | var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
|
6162 | _buttonName = _Object$entries6$_i[0],
|
6163 | _buttonConfig = _Object$entries6$_i[1];
|
6164 | if (_buttonConfig.hasOwnProperty('event')) {
|
6165 | if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
|
6166 | var _ret = function () {
|
6167 | var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
|
6168 | _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
|
6169 | return event.call(_this4);
|
6170 | });
|
6171 | return "continue";
|
6172 | }();
|
6173 | if (_ret === "continue") continue;
|
6174 | }
|
6175 | var _loop = function _loop() {
|
6176 | var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i7], 2),
|
6177 | eventType = _Object$entries7$_i[0],
|
6178 | eventFunction = _Object$entries7$_i[1];
|
6179 | var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
|
6180 | _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
|
6181 | return event.call(_this4);
|
6182 | });
|
6183 | };
|
6184 | for (var _i7 = 0, _Object$entries7 = Object.entries(_buttonConfig.event); _i7 < _Object$entries7.length; _i7++) {
|
6185 | _loop();
|
6186 | }
|
6187 | }
|
6188 | }
|
6189 | if (opts.showColumns) {
|
6190 | $keepOpen = this.$toolbar.find('.keep-open');
|
6191 | var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
|
6192 | var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
|
6193 | if (switchableCount <= opts.minimumCountColumns) {
|
6194 | $keepOpen.find('input').prop('disabled', true);
|
6195 | }
|
6196 | $keepOpen.find('li, label').off('click').on('click', function (e) {
|
6197 | e.stopImmediatePropagation();
|
6198 | });
|
6199 | $checkboxes.off('click').on('click', function (_ref2) {
|
6200 | var currentTarget = _ref2.currentTarget;
|
6201 | var $this = $$o(currentTarget);
|
6202 | _this4._toggleColumn($this.val(), $this.prop('checked'), false);
|
6203 | _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
|
6204 | $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
|
6205 | return !_this4.isSelectionColumn(column);
|
6206 | }).length);
|
6207 | });
|
6208 | $toggleAll.off('click').on('click', function (_ref3) {
|
6209 | var currentTarget = _ref3.currentTarget;
|
6210 | _this4._toggleAllColumns($$o(currentTarget).prop('checked'));
|
6211 | _this4.trigger('column-switch-all', $$o(currentTarget).prop('checked'));
|
6212 | });
|
6213 | if (opts.showColumnsSearch) {
|
6214 | var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
|
6215 | var $listItems = $keepOpen.find('.dropdown-item-marker');
|
6216 | $columnsSearch.on('keyup paste change', function (_ref4) {
|
6217 | var currentTarget = _ref4.currentTarget;
|
6218 | var $this = $$o(currentTarget);
|
6219 | var searchValue = $this.val().toLowerCase();
|
6220 | $listItems.show();
|
6221 | $checkboxes.each(function (i, el) {
|
6222 | var $checkbox = $$o(el);
|
6223 | var $listItem = $checkbox.parents('.dropdown-item-marker');
|
6224 | var text = $listItem.text().toLowerCase();
|
6225 | if (!text.includes(searchValue)) {
|
6226 | $listItem.hide();
|
6227 | }
|
6228 | });
|
6229 | });
|
6230 | }
|
6231 | }
|
6232 | var handleInputEvent = function handleInputEvent($searchInput) {
|
6233 | var eventTriggers = $searchInput.is('select') ? 'change' : 'keyup drop blur mouseup';
|
6234 | $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
|
6235 | if (opts.searchOnEnterKey && event.keyCode !== 13) {
|
6236 | return;
|
6237 | }
|
6238 | if ([37, 38, 39, 40].includes(event.keyCode)) {
|
6239 | return;
|
6240 | }
|
6241 | clearTimeout(timeoutId);
|
6242 | timeoutId = setTimeout(function () {
|
6243 | _this4.onSearch({
|
6244 | currentTarget: event.currentTarget
|
6245 | });
|
6246 | }, opts.searchTimeOut);
|
6247 | });
|
6248 | };
|
6249 |
|
6250 |
|
6251 | if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
|
6252 | html = [];
|
6253 | var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
|
6254 | var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
|
6255 | var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" aria-label=\"").concat(opts.formatSearch(), "\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
|
6256 | var searchInputFinalHtml = searchInputHtml;
|
6257 | if (opts.showSearchButton || opts.showSearchClearButton) {
|
6258 | var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
|
6259 | searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
|
6260 | }
|
6261 | html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
|
6262 | this.$toolbar.append(html.join(''));
|
6263 | var $searchInput = Utils.getSearchInput(this);
|
6264 | if (opts.showSearchButton) {
|
6265 | this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
|
6266 | clearTimeout(timeoutId);
|
6267 | timeoutId = setTimeout(function () {
|
6268 | _this4.onSearch({
|
6269 | currentTarget: $searchInput
|
6270 | });
|
6271 | }, opts.searchTimeOut);
|
6272 | });
|
6273 | if (opts.searchOnEnterKey) {
|
6274 | handleInputEvent($searchInput);
|
6275 | }
|
6276 | } else {
|
6277 | handleInputEvent($searchInput);
|
6278 | }
|
6279 | if (opts.showSearchClearButton) {
|
6280 | this.$toolbar.find('.search button[name=clearSearch]').click(function () {
|
6281 | _this4.resetSearch();
|
6282 | });
|
6283 | }
|
6284 | } else if (typeof opts.searchSelector === 'string') {
|
6285 | var _$searchInput = Utils.getSearchInput(this);
|
6286 | handleInputEvent(_$searchInput);
|
6287 | }
|
6288 | }
|
6289 | }, {
|
6290 | key: "onSearch",
|
6291 | value: function onSearch() {
|
6292 | var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
6293 | currentTarget = _ref5.currentTarget,
|
6294 | firedByInitSearchText = _ref5.firedByInitSearchText;
|
6295 | var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
6296 | if (currentTarget !== undefined && $$o(currentTarget).length && overwriteSearchText) {
|
6297 | var text = $$o(currentTarget).val().trim();
|
6298 | if (this.options.trimOnSearch && $$o(currentTarget).val() !== text) {
|
6299 | $$o(currentTarget).val(text);
|
6300 | }
|
6301 | if (this.searchText === text) {
|
6302 | return;
|
6303 | }
|
6304 | var $searchInput = Utils.getSearchInput(this);
|
6305 | var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$o(currentTarget);
|
6306 | if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
|
6307 | this.searchText = text;
|
6308 | this.options.searchText = text;
|
6309 | }
|
6310 | }
|
6311 | if (!firedByInitSearchText) {
|
6312 | this.options.pageNumber = 1;
|
6313 | }
|
6314 | this.initSearch();
|
6315 | if (firedByInitSearchText) {
|
6316 | if (this.options.sidePagination === 'client') {
|
6317 | this.updatePagination();
|
6318 | }
|
6319 | } else {
|
6320 | this.updatePagination();
|
6321 | }
|
6322 | this.trigger('search', this.searchText);
|
6323 | }
|
6324 | }, {
|
6325 | key: "initSearch",
|
6326 | value: function initSearch() {
|
6327 | var _this5 = this;
|
6328 | this.filterOptions = this.filterOptions || this.options.filterOptions;
|
6329 | if (this.options.sidePagination !== 'server') {
|
6330 | if (this.options.customSearch) {
|
6331 | this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
|
6332 | if (this.options.sortReset) {
|
6333 | this.unsortedData = _toConsumableArray(this.data);
|
6334 | }
|
6335 | this.initSort();
|
6336 | return;
|
6337 | }
|
6338 | var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
|
6339 | var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
|
6340 | var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
|
6341 | if (this.options.searchAccentNeutralise) {
|
6342 | searchText = Utils.normalizeAccent(searchText);
|
6343 | }
|
6344 |
|
6345 |
|
6346 | if (typeof this.filterOptions.filterAlgorithm === 'function') {
|
6347 | this.data = this.options.data.filter(function (item) {
|
6348 | return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
|
6349 | });
|
6350 | } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
|
6351 | this.data = f ? this.options.data.filter(function (item) {
|
6352 | var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
|
6353 | if (filterAlgorithm === 'and') {
|
6354 | for (var key in f) {
|
6355 | if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
|
6356 | return false;
|
6357 | }
|
6358 | }
|
6359 | } else if (filterAlgorithm === 'or') {
|
6360 | var match = false;
|
6361 | for (var _key in f) {
|
6362 | if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
|
6363 | match = true;
|
6364 | }
|
6365 | }
|
6366 | return match;
|
6367 | }
|
6368 | return true;
|
6369 | }) : _toConsumableArray(this.options.data);
|
6370 | }
|
6371 | var visibleFields = this.getVisibleFields();
|
6372 | this.data = searchText ? this.data.filter(function (item, i) {
|
6373 | for (var j = 0; j < _this5.header.fields.length; j++) {
|
6374 | if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
|
6375 | continue;
|
6376 | }
|
6377 | var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
|
6378 | var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
|
6379 | var value = void 0;
|
6380 | if (typeof key === 'string') {
|
6381 | value = item;
|
6382 | var props = key.split('.');
|
6383 | for (var _i8 = 0; _i8 < props.length; _i8++) {
|
6384 | if (value[props[_i8]] !== null) {
|
6385 | value = value[props[_i8]];
|
6386 | } else {
|
6387 | value = null;
|
6388 | break;
|
6389 | }
|
6390 | }
|
6391 | } else {
|
6392 | value = item[key];
|
6393 | }
|
6394 | if (_this5.options.searchAccentNeutralise) {
|
6395 | value = Utils.normalizeAccent(value);
|
6396 | }
|
6397 |
|
6398 |
|
6399 | if (column && column.searchFormatter) {
|
6400 | value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
|
6401 | }
|
6402 | if (typeof value === 'string' || typeof value === 'number') {
|
6403 | if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
|
6404 | return true;
|
6405 | }
|
6406 | var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
|
6407 | var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
|
6408 | var comparisonCheck = false;
|
6409 | if (matches) {
|
6410 | var operator = matches[1] || "".concat(matches[5], "l");
|
6411 | var comparisonValue = matches[2] || matches[3];
|
6412 | var int = parseInt(value, 10);
|
6413 | var comparisonInt = parseInt(comparisonValue, 10);
|
6414 | switch (operator) {
|
6415 | case '>':
|
6416 | case '<l':
|
6417 | comparisonCheck = int > comparisonInt;
|
6418 | break;
|
6419 | case '<':
|
6420 | case '>l':
|
6421 | comparisonCheck = int < comparisonInt;
|
6422 | break;
|
6423 | case '<=':
|
6424 | case '=<':
|
6425 | case '>=l':
|
6426 | case '=>l':
|
6427 | comparisonCheck = int <= comparisonInt;
|
6428 | break;
|
6429 | case '>=':
|
6430 | case '=>':
|
6431 | case '<=l':
|
6432 | case '=<l':
|
6433 | comparisonCheck = int >= comparisonInt;
|
6434 | break;
|
6435 | }
|
6436 | }
|
6437 | if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
|
6438 | return true;
|
6439 | }
|
6440 | }
|
6441 | }
|
6442 | return false;
|
6443 | }) : this.data;
|
6444 | if (this.options.sortReset) {
|
6445 | this.unsortedData = _toConsumableArray(this.data);
|
6446 | }
|
6447 | this.initSort();
|
6448 | }
|
6449 | }
|
6450 | }, {
|
6451 | key: "initPagination",
|
6452 | value: function initPagination() {
|
6453 | var _this6 = this;
|
6454 | var opts = this.options;
|
6455 | if (!opts.pagination) {
|
6456 | this.$pagination.hide();
|
6457 | return;
|
6458 | }
|
6459 | this.$pagination.show();
|
6460 | var html = [];
|
6461 | var allSelected = false;
|
6462 | var i;
|
6463 | var from;
|
6464 | var to;
|
6465 | var $pageList;
|
6466 | var $pre;
|
6467 | var $next;
|
6468 | var $number;
|
6469 | var data = this.getData({
|
6470 | includeHiddenRows: false
|
6471 | });
|
6472 | var pageList = opts.pageList;
|
6473 | if (typeof pageList === 'string') {
|
6474 | pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
|
6475 | }
|
6476 | pageList = pageList.map(function (value) {
|
6477 | if (typeof value === 'string') {
|
6478 | return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
|
6479 | }
|
6480 | return value;
|
6481 | });
|
6482 | this.paginationParts = opts.paginationParts;
|
6483 | if (typeof this.paginationParts === 'string') {
|
6484 | this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
|
6485 | }
|
6486 | if (opts.sidePagination !== 'server') {
|
6487 | opts.totalRows = data.length;
|
6488 | }
|
6489 | this.totalPages = 0;
|
6490 | if (opts.totalRows) {
|
6491 | if (opts.pageSize === opts.formatAllRows()) {
|
6492 | opts.pageSize = opts.totalRows;
|
6493 | allSelected = true;
|
6494 | }
|
6495 | this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
|
6496 | opts.totalPages = this.totalPages;
|
6497 | }
|
6498 | if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
|
6499 | opts.pageNumber = this.totalPages;
|
6500 | }
|
6501 | this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
|
6502 | this.pageTo = opts.pageNumber * opts.pageSize;
|
6503 | if (this.pageTo > opts.totalRows) {
|
6504 | this.pageTo = opts.totalRows;
|
6505 | }
|
6506 | if (this.options.pagination && this.options.sidePagination !== 'server') {
|
6507 | this.options.totalNotFiltered = this.options.data.length;
|
6508 | }
|
6509 | if (!this.options.showExtendedPagination) {
|
6510 | this.options.totalNotFiltered = undefined;
|
6511 | }
|
6512 | if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
|
6513 | html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
|
6514 | }
|
6515 | if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
|
6516 | var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
|
6517 | html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
|
6518 | }
|
6519 | if (this.paginationParts.includes('pageSize')) {
|
6520 | html.push('<div class="page-list">');
|
6521 | var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
|
6522 | pageList.forEach(function (page, i) {
|
6523 | if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
|
6524 | var active;
|
6525 | if (allSelected) {
|
6526 | active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
|
6527 | } else {
|
6528 | active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
|
6529 | }
|
6530 | pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
|
6531 | }
|
6532 | });
|
6533 | pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
|
6534 | html.push(opts.formatRecordsPerPage(pageNumber.join('')));
|
6535 | }
|
6536 | if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
|
6537 | html.push('</div></div>');
|
6538 | }
|
6539 | if (this.paginationParts.includes('pageList')) {
|
6540 | html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
|
6541 | if (this.totalPages < opts.paginationSuccessivelySize) {
|
6542 | from = 1;
|
6543 | to = this.totalPages;
|
6544 | } else {
|
6545 | from = opts.pageNumber - opts.paginationPagesBySide;
|
6546 | to = from + opts.paginationPagesBySide * 2;
|
6547 | }
|
6548 | if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
|
6549 | to = opts.paginationSuccessivelySize;
|
6550 | }
|
6551 | if (opts.paginationSuccessivelySize > this.totalPages - from) {
|
6552 | from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
|
6553 | }
|
6554 | if (from < 1) {
|
6555 | from = 1;
|
6556 | }
|
6557 | if (to > this.totalPages) {
|
6558 | to = this.totalPages;
|
6559 | }
|
6560 | var middleSize = Math.round(opts.paginationPagesBySide / 2);
|
6561 | var pageItem = function pageItem(i) {
|
6562 | var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
6563 | return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
|
6564 | };
|
6565 | if (from > 1) {
|
6566 | var max = opts.paginationPagesBySide;
|
6567 | if (max >= from) max = from - 1;
|
6568 | for (i = 1; i <= max; i++) {
|
6569 | html.push(pageItem(i));
|
6570 | }
|
6571 | if (from - 1 === max + 1) {
|
6572 | i = from - 1;
|
6573 | html.push(pageItem(i));
|
6574 | } else if (from - 1 > max) {
|
6575 | if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
|
6576 | i = Math.round((from - middleSize) / 2 + middleSize);
|
6577 | html.push(pageItem(i, ' page-intermediate'));
|
6578 | } else {
|
6579 | html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
|
6580 | }
|
6581 | }
|
6582 | }
|
6583 | for (i = from; i <= to; i++) {
|
6584 | html.push(pageItem(i));
|
6585 | }
|
6586 | if (this.totalPages > to) {
|
6587 | var min = this.totalPages - (opts.paginationPagesBySide - 1);
|
6588 | if (to >= min) min = to + 1;
|
6589 | if (to + 1 === min - 1) {
|
6590 | i = to + 1;
|
6591 | html.push(pageItem(i));
|
6592 | } else if (min > to + 1) {
|
6593 | if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
|
6594 | i = Math.round((this.totalPages - middleSize - to) / 2 + to);
|
6595 | html.push(pageItem(i, ' page-intermediate'));
|
6596 | } else {
|
6597 | html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
|
6598 | }
|
6599 | }
|
6600 | for (i = min; i <= this.totalPages; i++) {
|
6601 | html.push(pageItem(i));
|
6602 | }
|
6603 | }
|
6604 | html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
|
6605 | html.push(this.constants.html.pagination[1], '</div>');
|
6606 | }
|
6607 | this.$pagination.html(html.join(''));
|
6608 | var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
|
6609 | this.$pagination.last().find('.page-list > div').addClass(dropupClass);
|
6610 | if (!opts.onlyInfoPagination) {
|
6611 | $pageList = this.$pagination.find('.page-list a');
|
6612 | $pre = this.$pagination.find('.page-pre');
|
6613 | $next = this.$pagination.find('.page-next');
|
6614 | $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
|
6615 | if (this.totalPages <= 1) {
|
6616 | this.$pagination.find('div.pagination').hide();
|
6617 | }
|
6618 | if (opts.smartDisplay) {
|
6619 | if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
|
6620 | this.$pagination.find('div.page-list').hide();
|
6621 | }
|
6622 | }
|
6623 |
|
6624 |
|
6625 | this.$pagination[this.getData().length ? 'show' : 'hide']();
|
6626 | if (!opts.paginationLoop) {
|
6627 | if (opts.pageNumber === 1) {
|
6628 | $pre.addClass('disabled');
|
6629 | }
|
6630 | if (opts.pageNumber === this.totalPages) {
|
6631 | $next.addClass('disabled');
|
6632 | }
|
6633 | }
|
6634 | if (allSelected) {
|
6635 | opts.pageSize = opts.formatAllRows();
|
6636 | }
|
6637 |
|
6638 | $pageList.off('click').on('click', function (e) {
|
6639 | return _this6.onPageListChange(e);
|
6640 | });
|
6641 | $pre.off('click').on('click', function (e) {
|
6642 | return _this6.onPagePre(e);
|
6643 | });
|
6644 | $next.off('click').on('click', function (e) {
|
6645 | return _this6.onPageNext(e);
|
6646 | });
|
6647 | $number.off('click').on('click', function (e) {
|
6648 | return _this6.onPageNumber(e);
|
6649 | });
|
6650 | }
|
6651 | }
|
6652 | }, {
|
6653 | key: "updatePagination",
|
6654 | value: function updatePagination(event) {
|
6655 |
|
6656 | if (event && $$o(event.currentTarget).hasClass('disabled')) {
|
6657 | return;
|
6658 | }
|
6659 | if (!this.options.maintainMetaData) {
|
6660 | this.resetRows();
|
6661 | }
|
6662 | this.initPagination();
|
6663 | this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
|
6664 | if (this.options.sidePagination === 'server') {
|
6665 | this.initServer();
|
6666 | } else {
|
6667 | this.initBody();
|
6668 | }
|
6669 | }
|
6670 | }, {
|
6671 | key: "onPageListChange",
|
6672 | value: function onPageListChange(event) {
|
6673 | event.preventDefault();
|
6674 | var $this = $$o(event.currentTarget);
|
6675 | $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
|
6676 | this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
|
6677 | this.$toolbar.find('.page-size').text(this.options.pageSize);
|
6678 | this.updatePagination(event);
|
6679 | return false;
|
6680 | }
|
6681 | }, {
|
6682 | key: "onPagePre",
|
6683 | value: function onPagePre(event) {
|
6684 | if ($$o(event.target).hasClass('disabled')) {
|
6685 | return;
|
6686 | }
|
6687 | event.preventDefault();
|
6688 | if (this.options.pageNumber - 1 === 0) {
|
6689 | this.options.pageNumber = this.options.totalPages;
|
6690 | } else {
|
6691 | this.options.pageNumber--;
|
6692 | }
|
6693 | this.updatePagination(event);
|
6694 | return false;
|
6695 | }
|
6696 | }, {
|
6697 | key: "onPageNext",
|
6698 | value: function onPageNext(event) {
|
6699 | if ($$o(event.target).hasClass('disabled')) {
|
6700 | return;
|
6701 | }
|
6702 | event.preventDefault();
|
6703 | if (this.options.pageNumber + 1 > this.options.totalPages) {
|
6704 | this.options.pageNumber = 1;
|
6705 | } else {
|
6706 | this.options.pageNumber++;
|
6707 | }
|
6708 | this.updatePagination(event);
|
6709 | return false;
|
6710 | }
|
6711 | }, {
|
6712 | key: "onPageNumber",
|
6713 | value: function onPageNumber(event) {
|
6714 | event.preventDefault();
|
6715 | if (this.options.pageNumber === +$$o(event.currentTarget).text()) {
|
6716 | return;
|
6717 | }
|
6718 | this.options.pageNumber = +$$o(event.currentTarget).text();
|
6719 | this.updatePagination(event);
|
6720 | return false;
|
6721 | }
|
6722 |
|
6723 |
|
6724 | }, {
|
6725 | key: "initRow",
|
6726 | value: function initRow(item, i, data, trFragments) {
|
6727 | var _this7 = this;
|
6728 | var html = [];
|
6729 | var style = {};
|
6730 | var csses = [];
|
6731 | var data_ = '';
|
6732 | var attributes = {};
|
6733 | var htmlAttributes = [];
|
6734 | if (Utils.findIndex(this.hiddenRows, item) > -1) {
|
6735 | return;
|
6736 | }
|
6737 | style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
|
6738 | if (style && style.css) {
|
6739 | for (var _i9 = 0, _Object$entries8 = Object.entries(style.css); _i9 < _Object$entries8.length; _i9++) {
|
6740 | var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
|
6741 | key = _Object$entries8$_i[0],
|
6742 | value = _Object$entries8$_i[1];
|
6743 | csses.push("".concat(key, ": ").concat(value));
|
6744 | }
|
6745 | }
|
6746 | attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
|
6747 | if (attributes) {
|
6748 | for (var _i10 = 0, _Object$entries9 = Object.entries(attributes); _i10 < _Object$entries9.length; _i10++) {
|
6749 | var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
|
6750 | _key2 = _Object$entries9$_i[0],
|
6751 | _value = _Object$entries9$_i[1];
|
6752 | htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
|
6753 | }
|
6754 | }
|
6755 | if (item._data && !Utils.isEmptyObject(item._data)) {
|
6756 | for (var _i11 = 0, _Object$entries10 = Object.entries(item._data); _i11 < _Object$entries10.length; _i11++) {
|
6757 | var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
|
6758 | k = _Object$entries10$_i[0],
|
6759 | v = _Object$entries10$_i[1];
|
6760 |
|
6761 | if (k === 'index') {
|
6762 | return;
|
6763 | }
|
6764 | data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
|
6765 | }
|
6766 | }
|
6767 | html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
|
6768 | if (this.options.cardView) {
|
6769 | html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
|
6770 | }
|
6771 | var detailViewTemplate = '';
|
6772 | if (Utils.hasDetailViewIcon(this.options)) {
|
6773 | detailViewTemplate = '<td>';
|
6774 | if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
|
6775 | detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
|
6776 | }
|
6777 | detailViewTemplate += '</td>';
|
6778 | }
|
6779 | if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
|
6780 | html.push(detailViewTemplate);
|
6781 | }
|
6782 | this.header.fields.forEach(function (field, j) {
|
6783 | var column = _this7.columns[j];
|
6784 | var text = '';
|
6785 | var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
|
6786 | var value = '';
|
6787 | var type = '';
|
6788 | var cellStyle = {};
|
6789 | var id_ = '';
|
6790 | var class_ = _this7.header.classes[j];
|
6791 | var style_ = '';
|
6792 | var styleToAdd_ = '';
|
6793 | var data_ = '';
|
6794 | var rowspan_ = '';
|
6795 | var colspan_ = '';
|
6796 | var title_ = '';
|
6797 | if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
|
6798 | if (!column.checkbox && !column.radio) {
|
6799 | return;
|
6800 | }
|
6801 | }
|
6802 | if (!column.visible) {
|
6803 | return;
|
6804 | }
|
6805 | if (_this7.options.cardView && !column.cardVisible) {
|
6806 | return;
|
6807 | }
|
6808 |
|
6809 |
|
6810 | if (csses.concat([_this7.header.styles[j]]).length) {
|
6811 | styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
|
6812 | }
|
6813 | if (item["_".concat(field, "_style")]) {
|
6814 | styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
|
6815 | }
|
6816 | if (styleToAdd_) {
|
6817 | style_ = " style=\"".concat(styleToAdd_, "\"");
|
6818 | }
|
6819 |
|
6820 |
|
6821 |
|
6822 | if (item["_".concat(field, "_id")]) {
|
6823 | id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
|
6824 | }
|
6825 | if (item["_".concat(field, "_class")]) {
|
6826 | class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
|
6827 | }
|
6828 | if (item["_".concat(field, "_rowspan")]) {
|
6829 | rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
|
6830 | }
|
6831 | if (item["_".concat(field, "_colspan")]) {
|
6832 | colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
|
6833 | }
|
6834 | if (item["_".concat(field, "_title")]) {
|
6835 | title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
|
6836 | }
|
6837 | cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
|
6838 | if (cellStyle.classes) {
|
6839 | class_ = " class=\"".concat(cellStyle.classes, "\"");
|
6840 | }
|
6841 | if (cellStyle.css) {
|
6842 | var csses_ = [];
|
6843 | for (var _i12 = 0, _Object$entries11 = Object.entries(cellStyle.css); _i12 < _Object$entries11.length; _i12++) {
|
6844 | var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
|
6845 | _key3 = _Object$entries11$_i[0],
|
6846 | _value2 = _Object$entries11$_i[1];
|
6847 | csses_.push("".concat(_key3, ": ").concat(_value2));
|
6848 | }
|
6849 | style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
|
6850 | }
|
6851 | value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
|
6852 | if (!(column.checkbox || column.radio)) {
|
6853 | value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
|
6854 | }
|
6855 | if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
|
6856 | var defValue = '';
|
6857 | var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
6858 | if (_this7.options.searchAccentNeutralise) {
|
6859 | var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
|
6860 | var match = indexRegex.exec(Utils.normalizeAccent(value));
|
6861 | if (match) {
|
6862 | searchText = value.substring(match.index, match.index + searchText.length);
|
6863 | }
|
6864 | }
|
6865 | var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
|
6866 | var marker = '<mark>$1</mark>';
|
6867 | var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
|
6868 | if (isHTML) {
|
6869 |
|
6870 | var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
|
6871 | var textReplaced = textContent.replace(regExp, marker);
|
6872 | textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
6873 | defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
|
6874 | } else {
|
6875 |
|
6876 | defValue = value.toString().replace(regExp, marker);
|
6877 | }
|
6878 | value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
|
6879 | }
|
6880 | if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
|
6881 | for (var _i13 = 0, _Object$entries12 = Object.entries(item["_".concat(field, "_data")]); _i13 < _Object$entries12.length; _i13++) {
|
6882 | var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
|
6883 | _k = _Object$entries12$_i[0],
|
6884 | _v = _Object$entries12$_i[1];
|
6885 |
|
6886 | if (_k === 'index') {
|
6887 | return;
|
6888 | }
|
6889 | data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
|
6890 | }
|
6891 | }
|
6892 | if (column.checkbox || column.radio) {
|
6893 | type = column.checkbox ? 'checkbox' : type;
|
6894 | type = column.radio ? 'radio' : type;
|
6895 | var c = column['class'] || '';
|
6896 | var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
|
6897 | var isDisabled = !column.checkboxEnabled || value && value.disabled;
|
6898 | text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
|
6899 | item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
|
6900 | } else if (_this7.options.cardView) {
|
6901 | var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
|
6902 | text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
|
6903 | if (_this7.options.smartDisplay && value === '') {
|
6904 | text = '<div class="card-view"></div>';
|
6905 | }
|
6906 | } else {
|
6907 | text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
|
6908 | }
|
6909 | html.push(text);
|
6910 | });
|
6911 | if (detailViewTemplate && this.options.detailViewAlign === 'right') {
|
6912 | html.push(detailViewTemplate);
|
6913 | }
|
6914 | if (this.options.cardView) {
|
6915 | html.push('</div></td>');
|
6916 | }
|
6917 | html.push('</tr>');
|
6918 | return html.join('');
|
6919 | }
|
6920 | }, {
|
6921 | key: "initBody",
|
6922 | value: function initBody(fixedScroll, updatedUid) {
|
6923 | var _this8 = this;
|
6924 | var data = this.getData();
|
6925 | this.trigger('pre-body', data);
|
6926 | this.$body = this.$el.find('>tbody');
|
6927 | if (!this.$body.length) {
|
6928 | this.$body = $$o('<tbody></tbody>').appendTo(this.$el);
|
6929 | }
|
6930 |
|
6931 |
|
6932 | if (!this.options.pagination || this.options.sidePagination === 'server') {
|
6933 | this.pageFrom = 1;
|
6934 | this.pageTo = data.length;
|
6935 | }
|
6936 | var rows = [];
|
6937 | var trFragments = $$o(document.createDocumentFragment());
|
6938 | var hasTr = false;
|
6939 | var toExpand = [];
|
6940 | this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
|
6941 | for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
|
6942 | var item = data[i];
|
6943 | var tr = this.initRow(item, i, data, trFragments);
|
6944 | hasTr = hasTr || !!tr;
|
6945 | if (tr && typeof tr === 'string') {
|
6946 | var uniqueId = this.options.uniqueId;
|
6947 | if (uniqueId && item.hasOwnProperty(uniqueId)) {
|
6948 | var itemUniqueId = item[uniqueId];
|
6949 | var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
|
6950 | var oldTrNext = oldTr.next();
|
6951 | if (oldTrNext.is('tr.detail-view')) {
|
6952 | toExpand.push(i);
|
6953 | if (!updatedUid || itemUniqueId !== updatedUid) {
|
6954 | tr += oldTrNext[0].outerHTML;
|
6955 | }
|
6956 | }
|
6957 | }
|
6958 | if (!this.options.virtualScroll) {
|
6959 | trFragments.append(tr);
|
6960 | } else {
|
6961 | rows.push(tr);
|
6962 | }
|
6963 | }
|
6964 | }
|
6965 |
|
6966 |
|
6967 | if (!hasTr) {
|
6968 | this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
|
6969 | } else if (!this.options.virtualScroll) {
|
6970 | this.$body.html(trFragments);
|
6971 | } else {
|
6972 | if (this.virtualScroll) {
|
6973 | this.virtualScroll.destroy();
|
6974 | }
|
6975 | this.virtualScroll = new VirtualScroll({
|
6976 | rows: rows,
|
6977 | fixedScroll: fixedScroll,
|
6978 | scrollEl: this.$tableBody[0],
|
6979 | contentEl: this.$body[0],
|
6980 | itemHeight: this.options.virtualScrollItemHeight,
|
6981 | callback: function callback(startIndex, endIndex) {
|
6982 | _this8.fitHeader();
|
6983 | _this8.initBodyEvent();
|
6984 | _this8.trigger('virtual-scroll', startIndex, endIndex);
|
6985 | }
|
6986 | });
|
6987 | }
|
6988 | toExpand.forEach(function (index) {
|
6989 | _this8.expandRow(index);
|
6990 | });
|
6991 | if (!fixedScroll) {
|
6992 | this.scrollTo(0);
|
6993 | }
|
6994 | this.initBodyEvent();
|
6995 | this.initFooter();
|
6996 | this.resetView();
|
6997 | this.updateSelected();
|
6998 | if (this.options.sidePagination !== 'server') {
|
6999 | this.options.totalRows = data.length;
|
7000 | }
|
7001 | this.trigger('post-body', data);
|
7002 | }
|
7003 | }, {
|
7004 | key: "initBodyEvent",
|
7005 | value: function initBodyEvent() {
|
7006 | var _this9 = this;
|
7007 |
|
7008 | this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
|
7009 | var $td = $$o(e.currentTarget);
|
7010 | if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) {
|
7011 | return;
|
7012 | }
|
7013 | var $tr = $td.parent();
|
7014 | var $cardViewArr = $$o(e.target).parents('.card-views').children();
|
7015 | var $cardViewTarget = $$o(e.target).parents('.card-view');
|
7016 | var rowIndex = $tr.data('index');
|
7017 | var item = _this9.data[rowIndex];
|
7018 | var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
|
7019 | var fields = _this9.getVisibleFields();
|
7020 | var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
|
7021 | var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
|
7022 | var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
|
7023 | _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
|
7024 | _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field);
|
7025 |
|
7026 |
|
7027 | if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
|
7028 | var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
|
7029 | if ($selectItem.length) {
|
7030 | $selectItem[0].click();
|
7031 | }
|
7032 | }
|
7033 | if (e.type === 'click' && _this9.options.detailViewByClick) {
|
7034 | _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
|
7035 | }
|
7036 | }).off('mousedown').on('mousedown', function (e) {
|
7037 |
|
7038 | _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
|
7039 | _this9.multipleSelectRowShiftKey = e.shiftKey;
|
7040 | });
|
7041 | this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
|
7042 | e.preventDefault();
|
7043 | _this9.toggleDetailView($$o(e.currentTarget).parent().parent().data('index'));
|
7044 | return false;
|
7045 | });
|
7046 | this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
|
7047 | this.$selectItem.off('click').on('click', function (e) {
|
7048 | e.stopImmediatePropagation();
|
7049 | var $this = $$o(e.currentTarget);
|
7050 | _this9._toggleCheck($this.prop('checked'), $this.data('index'));
|
7051 | });
|
7052 | this.header.events.forEach(function (_events, i) {
|
7053 | var events = _events;
|
7054 | if (!events) {
|
7055 | return;
|
7056 | }
|
7057 |
|
7058 | if (typeof events === 'string') {
|
7059 | events = Utils.calculateObjectValue(null, events);
|
7060 | }
|
7061 | if (!events) {
|
7062 | throw new Error("Unknown event in the scope: ".concat(_events));
|
7063 | }
|
7064 | var field = _this9.header.fields[i];
|
7065 | var fieldIndex = _this9.getVisibleFields().indexOf(field);
|
7066 | if (fieldIndex === -1) {
|
7067 | return;
|
7068 | }
|
7069 | fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
|
7070 | var _loop2 = function _loop2(key) {
|
7071 | if (!events.hasOwnProperty(key)) {
|
7072 | return "continue";
|
7073 | }
|
7074 | var event = events[key];
|
7075 | _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
|
7076 | var $tr = $$o(tr);
|
7077 | var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
|
7078 | var index = key.indexOf(' ');
|
7079 | var name = key.substring(0, index);
|
7080 | var el = key.substring(index + 1);
|
7081 | $td.find(el).off(name).on(name, function (e) {
|
7082 | var index = $tr.data('index');
|
7083 | var row = _this9.data[index];
|
7084 | var value = row[field];
|
7085 | event.apply(_this9, [e, value, row, index]);
|
7086 | });
|
7087 | });
|
7088 | };
|
7089 | for (var key in events) {
|
7090 | var _ret2 = _loop2(key);
|
7091 | if (_ret2 === "continue") continue;
|
7092 | }
|
7093 | });
|
7094 | }
|
7095 | }, {
|
7096 | key: "initServer",
|
7097 | value: function initServer(silent, query, url) {
|
7098 | var _this10 = this;
|
7099 | var data = {};
|
7100 | var index = this.header.fields.indexOf(this.options.sortName);
|
7101 | var params = {
|
7102 | searchText: this.searchText,
|
7103 | sortName: this.options.sortName,
|
7104 | sortOrder: this.options.sortOrder
|
7105 | };
|
7106 | if (this.header.sortNames[index]) {
|
7107 | params.sortName = this.header.sortNames[index];
|
7108 | }
|
7109 | if (this.options.pagination && this.options.sidePagination === 'server') {
|
7110 | params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
|
7111 | params.pageNumber = this.options.pageNumber;
|
7112 | }
|
7113 | if (!(url || this.options.url) && !this.options.ajax) {
|
7114 | return;
|
7115 | }
|
7116 | if (this.options.queryParamsType === 'limit') {
|
7117 | params = {
|
7118 | search: params.searchText,
|
7119 | sort: params.sortName,
|
7120 | order: params.sortOrder
|
7121 | };
|
7122 | if (this.options.pagination && this.options.sidePagination === 'server') {
|
7123 | params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
|
7124 | params.limit = this.options.pageSize;
|
7125 | if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
|
7126 | delete params.limit;
|
7127 | }
|
7128 | }
|
7129 | }
|
7130 | if (this.options.search && this.options.sidePagination === 'server' && this.options.searchable && this.columns.filter(function (column) {
|
7131 | return column.searchable;
|
7132 | }).length) {
|
7133 | params.searchable = [];
|
7134 | var _iterator2 = _createForOfIteratorHelper(this.columns),
|
7135 | _step2;
|
7136 | try {
|
7137 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
7138 | var column = _step2.value;
|
7139 | if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
|
7140 | params.searchable.push(column.field);
|
7141 | }
|
7142 | }
|
7143 | } catch (err) {
|
7144 | _iterator2.e(err);
|
7145 | } finally {
|
7146 | _iterator2.f();
|
7147 | }
|
7148 | }
|
7149 | if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
|
7150 | params.filter = JSON.stringify(this.filterColumnsPartial, null);
|
7151 | }
|
7152 | Utils.extend(params, query || {});
|
7153 | data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
|
7154 |
|
7155 |
|
7156 | if (data === false) {
|
7157 | return;
|
7158 | }
|
7159 | if (!silent) {
|
7160 | this.showLoading();
|
7161 | }
|
7162 | var request = Utils.extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
|
7163 | type: this.options.method,
|
7164 | url: url || this.options.url,
|
7165 | data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
|
7166 | cache: this.options.cache,
|
7167 | contentType: this.options.contentType,
|
7168 | dataType: this.options.dataType,
|
7169 | success: function success(_res, textStatus, jqXHR) {
|
7170 | var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
|
7171 | _this10.load(res);
|
7172 | _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
|
7173 | if (!silent) {
|
7174 | _this10.hideLoading();
|
7175 | }
|
7176 | if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
|
7177 | _this10.updatePagination();
|
7178 | }
|
7179 | },
|
7180 | error: function error(jqXHR) {
|
7181 |
|
7182 | if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
|
7183 | _this10._xhrAbort = false;
|
7184 | return;
|
7185 | }
|
7186 | var data = [];
|
7187 | if (_this10.options.sidePagination === 'server') {
|
7188 | data = {};
|
7189 | data[_this10.options.totalField] = 0;
|
7190 | data[_this10.options.dataField] = [];
|
7191 | }
|
7192 | _this10.load(data);
|
7193 | _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
|
7194 | if (!silent) {
|
7195 | _this10.hideLoading();
|
7196 | }
|
7197 | }
|
7198 | });
|
7199 | if (this.options.ajax) {
|
7200 | Utils.calculateObjectValue(this, this.options.ajax, [request], null);
|
7201 | } else {
|
7202 | if (this._xhr && this._xhr.readyState !== 4) {
|
7203 | this._xhrAbort = true;
|
7204 | this._xhr.abort();
|
7205 | }
|
7206 | this._xhr = $$o.ajax(request);
|
7207 | }
|
7208 | return data;
|
7209 | }
|
7210 | }, {
|
7211 | key: "initSearchText",
|
7212 | value: function initSearchText() {
|
7213 | if (this.options.search) {
|
7214 | this.searchText = '';
|
7215 | if (this.options.searchText !== '') {
|
7216 | var $search = Utils.getSearchInput(this);
|
7217 | $search.val(this.options.searchText);
|
7218 | this.onSearch({
|
7219 | currentTarget: $search,
|
7220 | firedByInitSearchText: true
|
7221 | });
|
7222 | }
|
7223 | }
|
7224 | }
|
7225 | }, {
|
7226 | key: "getCaret",
|
7227 | value: function getCaret() {
|
7228 | var _this11 = this;
|
7229 | this.$header.find('th').each(function (i, th) {
|
7230 | $$o(th).find('.sortable').removeClass('desc asc').addClass($$o(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
|
7231 | });
|
7232 | }
|
7233 | }, {
|
7234 | key: "updateSelected",
|
7235 | value: function updateSelected() {
|
7236 | var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
|
7237 | this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
|
7238 | this.$selectItem.each(function (i, el) {
|
7239 | $$o(el).closest('tr')[$$o(el).prop('checked') ? 'addClass' : 'removeClass']('selected');
|
7240 | });
|
7241 | }
|
7242 | }, {
|
7243 | key: "updateRows",
|
7244 | value: function updateRows() {
|
7245 | var _this12 = this;
|
7246 | this.$selectItem.each(function (i, el) {
|
7247 | _this12.data[$$o(el).data('index')][_this12.header.stateField] = $$o(el).prop('checked');
|
7248 | });
|
7249 | }
|
7250 | }, {
|
7251 | key: "resetRows",
|
7252 | value: function resetRows() {
|
7253 | var _iterator3 = _createForOfIteratorHelper(this.data),
|
7254 | _step3;
|
7255 | try {
|
7256 | for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
7257 | var row = _step3.value;
|
7258 | this.$selectAll.prop('checked', false);
|
7259 | this.$selectItem.prop('checked', false);
|
7260 | if (this.header.stateField) {
|
7261 | row[this.header.stateField] = false;
|
7262 | }
|
7263 | }
|
7264 | } catch (err) {
|
7265 | _iterator3.e(err);
|
7266 | } finally {
|
7267 | _iterator3.f();
|
7268 | }
|
7269 | this.initHiddenRows();
|
7270 | }
|
7271 | }, {
|
7272 | key: "trigger",
|
7273 | value: function trigger(_name) {
|
7274 | var _this$options, _this$options2;
|
7275 | var name = "".concat(_name, ".bs.table");
|
7276 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
|
7277 | args[_key4 - 1] = arguments[_key4];
|
7278 | }
|
7279 | (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
|
7280 | this.$el.trigger($$o.Event(name, {
|
7281 | sender: this
|
7282 | }), args);
|
7283 | (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
|
7284 | this.$el.trigger($$o.Event('all.bs.table', {
|
7285 | sender: this
|
7286 | }), [name, args]);
|
7287 | }
|
7288 | }, {
|
7289 | key: "resetHeader",
|
7290 | value: function resetHeader() {
|
7291 | var _this13 = this;
|
7292 |
|
7293 |
|
7294 | clearTimeout(this.timeoutId_);
|
7295 | this.timeoutId_ = setTimeout(function () {
|
7296 | return _this13.fitHeader();
|
7297 | }, this.$el.is(':hidden') ? 100 : 0);
|
7298 | }
|
7299 | }, {
|
7300 | key: "fitHeader",
|
7301 | value: function fitHeader() {
|
7302 | var _this14 = this;
|
7303 | if (this.$el.is(':hidden')) {
|
7304 | this.timeoutId_ = setTimeout(function () {
|
7305 | return _this14.fitHeader();
|
7306 | }, 100);
|
7307 | return;
|
7308 | }
|
7309 | var fixedBody = this.$tableBody.get(0);
|
7310 | var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
|
7311 | this.$el.css('margin-top', -this.$header.outerHeight());
|
7312 | var focused = this.$tableHeader.find(':focus');
|
7313 | if (focused.length > 0) {
|
7314 | var $th = focused.parents('th');
|
7315 | if ($th.length > 0) {
|
7316 | var dataField = $th.attr('data-field');
|
7317 | if (dataField !== undefined) {
|
7318 | var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
|
7319 | if ($headerTh.length > 0) {
|
7320 | $headerTh.find(':input').addClass('focus-temp');
|
7321 | }
|
7322 | }
|
7323 | }
|
7324 | }
|
7325 | this.$header_ = this.$header.clone(true, true);
|
7326 | this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
|
7327 | this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
|
7328 | this.$tableLoading.css('width', this.$el.outerWidth());
|
7329 | var focusedTemp = $$o('.focus-temp:visible:eq(0)');
|
7330 | if (focusedTemp.length > 0) {
|
7331 | focusedTemp.focus();
|
7332 | this.$header.find('.focus-temp').removeClass('focus-temp');
|
7333 | }
|
7334 |
|
7335 |
|
7336 | this.$header.find('th[data-field]').each(function (i, el) {
|
7337 | _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$o(el).data('field'))).data($$o(el).data());
|
7338 | });
|
7339 | var visibleFields = this.getVisibleFields();
|
7340 | var $ths = this.$header_.find('th');
|
7341 | var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
|
7342 | while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
|
7343 | $tr = $tr.next();
|
7344 | }
|
7345 | var trLength = $tr.find('> *').length;
|
7346 | $tr.find('> *').each(function (i, el) {
|
7347 | var $this = $$o(el);
|
7348 | if (Utils.hasDetailViewIcon(_this14.options)) {
|
7349 | if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
|
7350 | var $thDetail = $ths.filter('.detail');
|
7351 | var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
|
7352 | $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
|
7353 | return;
|
7354 | }
|
7355 | }
|
7356 | var index = i - Utils.getDetailViewIndexOffset(_this14.options);
|
7357 | var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
|
7358 | if ($th.length > 1) {
|
7359 | $th = $$o($ths[$this[0].cellIndex]);
|
7360 | }
|
7361 | var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
|
7362 | $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
|
7363 | });
|
7364 | this.horizontalScroll();
|
7365 | this.trigger('post-header');
|
7366 | }
|
7367 | }, {
|
7368 | key: "initFooter",
|
7369 | value: function initFooter() {
|
7370 | if (!this.options.showFooter || this.options.cardView) {
|
7371 |
|
7372 | return;
|
7373 | }
|
7374 | var data = this.getData();
|
7375 | var html = [];
|
7376 | var detailTemplate = '';
|
7377 | if (Utils.hasDetailViewIcon(this.options)) {
|
7378 | detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
|
7379 | }
|
7380 | if (detailTemplate && this.options.detailViewAlign !== 'right') {
|
7381 | html.push(detailTemplate);
|
7382 | }
|
7383 | var _iterator4 = _createForOfIteratorHelper(this.columns),
|
7384 | _step4;
|
7385 | try {
|
7386 | for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
7387 | var column = _step4.value;
|
7388 | var falign = '';
|
7389 | var valign = '';
|
7390 | var csses = [];
|
7391 | var style = {};
|
7392 | var class_ = Utils.sprintf(' class="%s"', column['class']);
|
7393 | if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
|
7394 | continue;
|
7395 | }
|
7396 | if (this.options.cardView && !column.cardVisible) {
|
7397 | return;
|
7398 | }
|
7399 | falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
|
7400 | valign = Utils.sprintf('vertical-align: %s; ', column.valign);
|
7401 | style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
|
7402 | if (style && style.css) {
|
7403 | for (var _i14 = 0, _Object$entries13 = Object.entries(style.css); _i14 < _Object$entries13.length; _i14++) {
|
7404 | var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
|
7405 | key = _Object$entries13$_i[0],
|
7406 | _value3 = _Object$entries13$_i[1];
|
7407 | csses.push("".concat(key, ": ").concat(_value3));
|
7408 | }
|
7409 | }
|
7410 | if (style && style.classes) {
|
7411 | class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
|
7412 | }
|
7413 | html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
|
7414 | var colspan = 0;
|
7415 | if (this.footerData && this.footerData.length > 0) {
|
7416 | colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
|
7417 | }
|
7418 | if (colspan) {
|
7419 | html.push(" colspan=\"".concat(colspan, "\" "));
|
7420 | }
|
7421 | html.push('>');
|
7422 | html.push('<div class="th-inner">');
|
7423 | var value = '';
|
7424 | if (this.footerData && this.footerData.length > 0) {
|
7425 | value = this.footerData[0][column.field] || '';
|
7426 | }
|
7427 | html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
|
7428 | html.push('</div>');
|
7429 | html.push('<div class="fht-cell"></div>');
|
7430 | html.push('</div>');
|
7431 | html.push('</th>');
|
7432 | }
|
7433 | } catch (err) {
|
7434 | _iterator4.e(err);
|
7435 | } finally {
|
7436 | _iterator4.f();
|
7437 | }
|
7438 | if (detailTemplate && this.options.detailViewAlign === 'right') {
|
7439 | html.push(detailTemplate);
|
7440 | }
|
7441 | if (!this.options.height && !this.$tableFooter.length) {
|
7442 | this.$el.append('<tfoot><tr></tr></tfoot>');
|
7443 | this.$tableFooter = this.$el.find('tfoot');
|
7444 | }
|
7445 | if (!this.$tableFooter.find('tr').length) {
|
7446 | this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
|
7447 | }
|
7448 | this.$tableFooter.find('tr').html(html.join(''));
|
7449 | this.trigger('post-footer', this.$tableFooter);
|
7450 | }
|
7451 | }, {
|
7452 | key: "fitFooter",
|
7453 | value: function fitFooter() {
|
7454 | var _this15 = this;
|
7455 | if (this.$el.is(':hidden')) {
|
7456 | setTimeout(function () {
|
7457 | return _this15.fitFooter();
|
7458 | }, 100);
|
7459 | return;
|
7460 | }
|
7461 | var fixedBody = this.$tableBody.get(0);
|
7462 | var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
|
7463 | this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
|
7464 | var $ths = this.$tableFooter.find('th');
|
7465 | var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
|
7466 | $ths.find('.fht-cell').width('auto');
|
7467 | while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
|
7468 | $tr = $tr.next();
|
7469 | }
|
7470 | var trLength = $tr.find('> *').length;
|
7471 | $tr.find('> *').each(function (i, el) {
|
7472 | var $this = $$o(el);
|
7473 | if (Utils.hasDetailViewIcon(_this15.options)) {
|
7474 | if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
|
7475 | var $thDetail = $ths.filter('.detail');
|
7476 | var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
|
7477 | $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
|
7478 | return;
|
7479 | }
|
7480 | }
|
7481 | var $th = $ths.eq(i);
|
7482 | var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
|
7483 | $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
|
7484 | });
|
7485 | this.horizontalScroll();
|
7486 | }
|
7487 | }, {
|
7488 | key: "horizontalScroll",
|
7489 | value: function horizontalScroll() {
|
7490 | var _this16 = this;
|
7491 |
|
7492 |
|
7493 | this.$tableBody.off('scroll').on('scroll', function () {
|
7494 | var scrollLeft = _this16.$tableBody.scrollLeft();
|
7495 | if (_this16.options.showHeader && _this16.options.height) {
|
7496 | _this16.$tableHeader.scrollLeft(scrollLeft);
|
7497 | }
|
7498 | if (_this16.options.showFooter && !_this16.options.cardView) {
|
7499 | _this16.$tableFooter.scrollLeft(scrollLeft);
|
7500 | }
|
7501 | _this16.trigger('scroll-body', _this16.$tableBody);
|
7502 | });
|
7503 | }
|
7504 | }, {
|
7505 | key: "getVisibleFields",
|
7506 | value: function getVisibleFields() {
|
7507 | var visibleFields = [];
|
7508 | var _iterator5 = _createForOfIteratorHelper(this.header.fields),
|
7509 | _step5;
|
7510 | try {
|
7511 | for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
7512 | var field = _step5.value;
|
7513 | var column = this.columns[this.fieldsColumnsIndex[field]];
|
7514 | if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
|
7515 | continue;
|
7516 | }
|
7517 | visibleFields.push(field);
|
7518 | }
|
7519 | } catch (err) {
|
7520 | _iterator5.e(err);
|
7521 | } finally {
|
7522 | _iterator5.f();
|
7523 | }
|
7524 | return visibleFields;
|
7525 | }
|
7526 | }, {
|
7527 | key: "initHiddenRows",
|
7528 | value: function initHiddenRows() {
|
7529 | this.hiddenRows = [];
|
7530 | }
|
7531 |
|
7532 |
|
7533 |
|
7534 | }, {
|
7535 | key: "getOptions",
|
7536 | value: function getOptions() {
|
7537 |
|
7538 | var options = Utils.extend({}, this.options);
|
7539 | delete options.data;
|
7540 | return Utils.extend(true, {}, options);
|
7541 | }
|
7542 | }, {
|
7543 | key: "refreshOptions",
|
7544 | value: function refreshOptions(options) {
|
7545 |
|
7546 | if (Utils.compareObjects(this.options, options, true)) {
|
7547 | return;
|
7548 | }
|
7549 | this.options = Utils.extend(this.options, options);
|
7550 | this.trigger('refresh-options', this.options);
|
7551 | this.destroy();
|
7552 | this.init();
|
7553 | }
|
7554 | }, {
|
7555 | key: "getData",
|
7556 | value: function getData(params) {
|
7557 | var _this17 = this;
|
7558 | var data = this.options.data;
|
7559 | if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort ||
|
7560 |
|
7561 | !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
|
7562 | data = this.data;
|
7563 | }
|
7564 | if (params && !params.includeHiddenRows) {
|
7565 | var hiddenRows = this.getHiddenRows();
|
7566 | data = data.filter(function (row) {
|
7567 | return Utils.findIndex(hiddenRows, row) === -1;
|
7568 | });
|
7569 | }
|
7570 | if (params && params.useCurrentPage) {
|
7571 | data = data.slice(this.pageFrom - 1, this.pageTo);
|
7572 | }
|
7573 | if (params && params.formatted) {
|
7574 | data.forEach(function (row) {
|
7575 | for (var _i15 = 0, _Object$entries14 = Object.entries(row); _i15 < _Object$entries14.length; _i15++) {
|
7576 | var _Object$entries14$_i = _slicedToArray(_Object$entries14[_i15], 2),
|
7577 | key = _Object$entries14$_i[0],
|
7578 | value = _Object$entries14$_i[1];
|
7579 | var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
|
7580 | if (!column) {
|
7581 | return;
|
7582 | }
|
7583 | row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
|
7584 | }
|
7585 | });
|
7586 | }
|
7587 | return data;
|
7588 | }
|
7589 | }, {
|
7590 | key: "getSelections",
|
7591 | value: function getSelections() {
|
7592 | var _this18 = this;
|
7593 | return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
|
7594 | return row[_this18.header.stateField] === true;
|
7595 | });
|
7596 | }
|
7597 | }, {
|
7598 | key: "load",
|
7599 | value: function load(_data) {
|
7600 | var fixedScroll = false;
|
7601 | var data = _data;
|
7602 |
|
7603 |
|
7604 | if (this.options.pagination && this.options.sidePagination === 'server') {
|
7605 | this.options.totalRows = data[this.options.totalField];
|
7606 | this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
|
7607 | this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
|
7608 | }
|
7609 | fixedScroll = data.fixedScroll;
|
7610 | data = Array.isArray(data) ? data : data[this.options.dataField];
|
7611 | this.initData(data);
|
7612 | this.initSearch();
|
7613 | this.initPagination();
|
7614 | this.initBody(fixedScroll);
|
7615 | }
|
7616 | }, {
|
7617 | key: "append",
|
7618 | value: function append(data) {
|
7619 | this.initData(data, 'append');
|
7620 | this.initSearch();
|
7621 | this.initPagination();
|
7622 | this.initSort();
|
7623 | this.initBody(true);
|
7624 | }
|
7625 | }, {
|
7626 | key: "prepend",
|
7627 | value: function prepend(data) {
|
7628 | this.initData(data, 'prepend');
|
7629 | this.initSearch();
|
7630 | this.initPagination();
|
7631 | this.initSort();
|
7632 | this.initBody(true);
|
7633 | }
|
7634 | }, {
|
7635 | key: "remove",
|
7636 | value: function remove(params) {
|
7637 | var removed = 0;
|
7638 | for (var i = this.options.data.length - 1; i >= 0; i--) {
|
7639 | var row = this.options.data[i];
|
7640 | var value = Utils.getItemField(row, params.field, this.options.escape, row.escape);
|
7641 | if (value === undefined && params.field !== '$index') {
|
7642 | continue;
|
7643 | }
|
7644 | if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(value)) {
|
7645 | removed++;
|
7646 | this.options.data.splice(i, 1);
|
7647 | }
|
7648 | }
|
7649 | if (!removed) {
|
7650 | return;
|
7651 | }
|
7652 | if (this.options.sidePagination === 'server') {
|
7653 | this.options.totalRows -= removed;
|
7654 | this.data = _toConsumableArray(this.options.data);
|
7655 | }
|
7656 | this.initSearch();
|
7657 | this.initPagination();
|
7658 | this.initSort();
|
7659 | this.initBody(true);
|
7660 | }
|
7661 | }, {
|
7662 | key: "removeAll",
|
7663 | value: function removeAll() {
|
7664 | if (this.options.data.length > 0) {
|
7665 | this.options.data.splice(0, this.options.data.length);
|
7666 | this.initSearch();
|
7667 | this.initPagination();
|
7668 | this.initBody(true);
|
7669 | }
|
7670 | }
|
7671 | }, {
|
7672 | key: "insertRow",
|
7673 | value: function insertRow(params) {
|
7674 | if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
|
7675 | return;
|
7676 | }
|
7677 | this.options.data.splice(params.index, 0, params.row);
|
7678 | this.initSearch();
|
7679 | this.initPagination();
|
7680 | this.initSort();
|
7681 | this.initBody(true);
|
7682 | }
|
7683 | }, {
|
7684 | key: "updateRow",
|
7685 | value: function updateRow(params) {
|
7686 | var allParams = Array.isArray(params) ? params : [params];
|
7687 | var _iterator6 = _createForOfIteratorHelper(allParams),
|
7688 | _step6;
|
7689 | try {
|
7690 | for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
7691 | var _params = _step6.value;
|
7692 | if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
|
7693 | continue;
|
7694 | }
|
7695 | if (_params.hasOwnProperty('replace') && _params.replace) {
|
7696 | this.options.data[_params.index] = _params.row;
|
7697 | } else {
|
7698 | Utils.extend(this.options.data[_params.index], _params.row);
|
7699 | }
|
7700 | }
|
7701 | } catch (err) {
|
7702 | _iterator6.e(err);
|
7703 | } finally {
|
7704 | _iterator6.f();
|
7705 | }
|
7706 | this.initSearch();
|
7707 | this.initPagination();
|
7708 | this.initSort();
|
7709 | this.initBody(true);
|
7710 | }
|
7711 | }, {
|
7712 | key: "getRowByUniqueId",
|
7713 | value: function getRowByUniqueId(_id) {
|
7714 | var uniqueId = this.options.uniqueId;
|
7715 | var len = this.options.data.length;
|
7716 | var id = _id;
|
7717 | var dataRow = null;
|
7718 | var i;
|
7719 | var row;
|
7720 | for (i = len - 1; i >= 0; i--) {
|
7721 | row = this.options.data[i];
|
7722 | var rowUniqueId = Utils.getItemField(row, uniqueId, this.options.escape, row.escape);
|
7723 | if (rowUniqueId === undefined) {
|
7724 | continue;
|
7725 | }
|
7726 | if (typeof rowUniqueId === 'string') {
|
7727 | id = id.toString();
|
7728 | } else if (typeof rowUniqueId === 'number') {
|
7729 | if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
|
7730 | id = parseInt(id, 10);
|
7731 | } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
|
7732 | id = parseFloat(id);
|
7733 | }
|
7734 | }
|
7735 | if (rowUniqueId === id) {
|
7736 | dataRow = row;
|
7737 | break;
|
7738 | }
|
7739 | }
|
7740 | return dataRow;
|
7741 | }
|
7742 | }, {
|
7743 | key: "updateByUniqueId",
|
7744 | value: function updateByUniqueId(params) {
|
7745 | var allParams = Array.isArray(params) ? params : [params];
|
7746 | var updatedUid = null;
|
7747 | var _iterator7 = _createForOfIteratorHelper(allParams),
|
7748 | _step7;
|
7749 | try {
|
7750 | for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
7751 | var _params2 = _step7.value;
|
7752 | if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
|
7753 | continue;
|
7754 | }
|
7755 | var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
|
7756 | if (rowId === -1) {
|
7757 | continue;
|
7758 | }
|
7759 | if (_params2.hasOwnProperty('replace') && _params2.replace) {
|
7760 | this.options.data[rowId] = _params2.row;
|
7761 | } else {
|
7762 | Utils.extend(this.options.data[rowId], _params2.row);
|
7763 | }
|
7764 | updatedUid = _params2.id;
|
7765 | }
|
7766 | } catch (err) {
|
7767 | _iterator7.e(err);
|
7768 | } finally {
|
7769 | _iterator7.f();
|
7770 | }
|
7771 | this.initSearch();
|
7772 | this.initPagination();
|
7773 | this.initSort();
|
7774 | this.initBody(true, updatedUid);
|
7775 | }
|
7776 | }, {
|
7777 | key: "removeByUniqueId",
|
7778 | value: function removeByUniqueId(id) {
|
7779 | var len = this.options.data.length;
|
7780 | var row = this.getRowByUniqueId(id);
|
7781 | if (row) {
|
7782 | this.options.data.splice(this.options.data.indexOf(row), 1);
|
7783 | }
|
7784 | if (len === this.options.data.length) {
|
7785 | return;
|
7786 | }
|
7787 | if (this.options.sidePagination === 'server') {
|
7788 | this.options.totalRows -= 1;
|
7789 | this.data = _toConsumableArray(this.options.data);
|
7790 | }
|
7791 | this.initSearch();
|
7792 | this.initPagination();
|
7793 | this.initBody(true);
|
7794 | }
|
7795 | }, {
|
7796 | key: "_updateCellOnly",
|
7797 | value: function _updateCellOnly(field, index) {
|
7798 | var rowHtml = this.initRow(this.options.data[index], index);
|
7799 | var fieldIndex = this.getVisibleFields().indexOf(field);
|
7800 | if (fieldIndex === -1) {
|
7801 | return;
|
7802 | }
|
7803 | fieldIndex += Utils.getDetailViewIndexOffset(this.options);
|
7804 | this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$o(rowHtml).find(">td:eq(".concat(fieldIndex, ")")));
|
7805 | this.initBodyEvent();
|
7806 | this.initFooter();
|
7807 | this.resetView();
|
7808 | this.updateSelected();
|
7809 | }
|
7810 | }, {
|
7811 | key: "updateCell",
|
7812 | value: function updateCell(params) {
|
7813 | if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
|
7814 | return;
|
7815 | }
|
7816 | this.options.data[params.index][params.field] = params.value;
|
7817 | if (params.reinit === false) {
|
7818 | this._updateCellOnly(params.field, params.index);
|
7819 | return;
|
7820 | }
|
7821 | this.initSort();
|
7822 | this.initBody(true);
|
7823 | }
|
7824 | }, {
|
7825 | key: "updateCellByUniqueId",
|
7826 | value: function updateCellByUniqueId(params) {
|
7827 | var _this19 = this;
|
7828 | var allParams = Array.isArray(params) ? params : [params];
|
7829 | allParams.forEach(function (_ref6) {
|
7830 | var id = _ref6.id,
|
7831 | field = _ref6.field,
|
7832 | value = _ref6.value;
|
7833 | var index = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
|
7834 | if (index === -1) {
|
7835 | return;
|
7836 | }
|
7837 | _this19.options.data[index][field] = value;
|
7838 | });
|
7839 | if (params.reinit === false) {
|
7840 | this._updateCellOnly(params.field, this.options.data.indexOf(this.getRowByUniqueId(params.id)));
|
7841 | return;
|
7842 | }
|
7843 | this.initSort();
|
7844 | this.initBody(true);
|
7845 | }
|
7846 | }, {
|
7847 | key: "showRow",
|
7848 | value: function showRow(params) {
|
7849 | this._toggleRow(params, true);
|
7850 | }
|
7851 | }, {
|
7852 | key: "hideRow",
|
7853 | value: function hideRow(params) {
|
7854 | this._toggleRow(params, false);
|
7855 | }
|
7856 | }, {
|
7857 | key: "_toggleRow",
|
7858 | value: function _toggleRow(params, visible) {
|
7859 | var row;
|
7860 | if (params.hasOwnProperty('index')) {
|
7861 | row = this.getData()[params.index];
|
7862 | } else if (params.hasOwnProperty('uniqueId')) {
|
7863 | row = this.getRowByUniqueId(params.uniqueId);
|
7864 | }
|
7865 | if (!row) {
|
7866 | return;
|
7867 | }
|
7868 | var index = Utils.findIndex(this.hiddenRows, row);
|
7869 | if (!visible && index === -1) {
|
7870 | this.hiddenRows.push(row);
|
7871 | } else if (visible && index > -1) {
|
7872 | this.hiddenRows.splice(index, 1);
|
7873 | }
|
7874 | this.initBody(true);
|
7875 | this.initPagination();
|
7876 | }
|
7877 | }, {
|
7878 | key: "getHiddenRows",
|
7879 | value: function getHiddenRows(show) {
|
7880 | if (show) {
|
7881 | this.initHiddenRows();
|
7882 | this.initBody(true);
|
7883 | this.initPagination();
|
7884 | return;
|
7885 | }
|
7886 | var data = this.getData();
|
7887 | var rows = [];
|
7888 | var _iterator8 = _createForOfIteratorHelper(data),
|
7889 | _step8;
|
7890 | try {
|
7891 | for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
7892 | var row = _step8.value;
|
7893 | if (this.hiddenRows.includes(row)) {
|
7894 | rows.push(row);
|
7895 | }
|
7896 | }
|
7897 | } catch (err) {
|
7898 | _iterator8.e(err);
|
7899 | } finally {
|
7900 | _iterator8.f();
|
7901 | }
|
7902 | this.hiddenRows = rows;
|
7903 | return rows;
|
7904 | }
|
7905 | }, {
|
7906 | key: "showColumn",
|
7907 | value: function showColumn(field) {
|
7908 | var _this20 = this;
|
7909 | var fields = Array.isArray(field) ? field : [field];
|
7910 | fields.forEach(function (field) {
|
7911 | _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
|
7912 | });
|
7913 | }
|
7914 | }, {
|
7915 | key: "hideColumn",
|
7916 | value: function hideColumn(field) {
|
7917 | var _this21 = this;
|
7918 | var fields = Array.isArray(field) ? field : [field];
|
7919 | fields.forEach(function (field) {
|
7920 | _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
|
7921 | });
|
7922 | }
|
7923 | }, {
|
7924 | key: "_toggleColumn",
|
7925 | value: function _toggleColumn(index, checked, needUpdate) {
|
7926 | if (index === -1 || this.columns[index].visible === checked) {
|
7927 | return;
|
7928 | }
|
7929 | this.columns[index].visible = checked;
|
7930 | this.initHeader();
|
7931 | this.initSearch();
|
7932 | this.initPagination();
|
7933 | this.initBody();
|
7934 | if (this.options.showColumns) {
|
7935 | var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
|
7936 | if (needUpdate) {
|
7937 | $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
|
7938 | }
|
7939 | if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
|
7940 | $items.filter(':checked').prop('disabled', true);
|
7941 | }
|
7942 | }
|
7943 | }
|
7944 | }, {
|
7945 | key: "getVisibleColumns",
|
7946 | value: function getVisibleColumns() {
|
7947 | var _this22 = this;
|
7948 | return this.columns.filter(function (column) {
|
7949 | return column.visible && !_this22.isSelectionColumn(column);
|
7950 | });
|
7951 | }
|
7952 | }, {
|
7953 | key: "getHiddenColumns",
|
7954 | value: function getHiddenColumns() {
|
7955 | return this.columns.filter(function (_ref7) {
|
7956 | var visible = _ref7.visible;
|
7957 | return !visible;
|
7958 | });
|
7959 | }
|
7960 | }, {
|
7961 | key: "isSelectionColumn",
|
7962 | value: function isSelectionColumn(column) {
|
7963 | return column.radio || column.checkbox;
|
7964 | }
|
7965 | }, {
|
7966 | key: "showAllColumns",
|
7967 | value: function showAllColumns() {
|
7968 | this._toggleAllColumns(true);
|
7969 | }
|
7970 | }, {
|
7971 | key: "hideAllColumns",
|
7972 | value: function hideAllColumns() {
|
7973 | this._toggleAllColumns(false);
|
7974 | }
|
7975 | }, {
|
7976 | key: "_toggleAllColumns",
|
7977 | value: function _toggleAllColumns(visible) {
|
7978 | var _this23 = this;
|
7979 | var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
|
7980 | _step9;
|
7981 | try {
|
7982 | for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
7983 | var column = _step9.value;
|
7984 | if (column.switchable) {
|
7985 | if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
|
7986 | return it.switchable;
|
7987 | }).length === this.options.minimumCountColumns) {
|
7988 | continue;
|
7989 | }
|
7990 | column.visible = visible;
|
7991 | }
|
7992 | }
|
7993 | } catch (err) {
|
7994 | _iterator9.e(err);
|
7995 | } finally {
|
7996 | _iterator9.f();
|
7997 | }
|
7998 | this.initHeader();
|
7999 | this.initSearch();
|
8000 | this.initPagination();
|
8001 | this.initBody();
|
8002 | if (this.options.showColumns) {
|
8003 | var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
|
8004 | if (visible) {
|
8005 | $items.prop('checked', visible);
|
8006 | } else {
|
8007 | $items.get().reverse().forEach(function (item) {
|
8008 | if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
|
8009 | $$o(item).prop('checked', visible);
|
8010 | }
|
8011 | });
|
8012 | }
|
8013 | if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
|
8014 | $items.filter(':checked').prop('disabled', true);
|
8015 | }
|
8016 | }
|
8017 | }
|
8018 | }, {
|
8019 | key: "mergeCells",
|
8020 | value: function mergeCells(options) {
|
8021 | var row = options.index;
|
8022 | var col = this.getVisibleFields().indexOf(options.field);
|
8023 | var rowspan = options.rowspan || 1;
|
8024 | var colspan = options.colspan || 1;
|
8025 | var i;
|
8026 | var j;
|
8027 | var $tr = this.$body.find('>tr[data-index]');
|
8028 | col += Utils.getDetailViewIndexOffset(this.options);
|
8029 | var $td = $tr.eq(row).find('>td').eq(col);
|
8030 | if (row < 0 || col < 0 || row >= this.data.length) {
|
8031 | return;
|
8032 | }
|
8033 | for (i = row; i < row + rowspan; i++) {
|
8034 | for (j = col; j < col + colspan; j++) {
|
8035 | $tr.eq(i).find('>td').eq(j).hide();
|
8036 | }
|
8037 | }
|
8038 | $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
|
8039 | }
|
8040 | }, {
|
8041 | key: "checkAll",
|
8042 | value: function checkAll() {
|
8043 | this._toggleCheckAll(true);
|
8044 | }
|
8045 | }, {
|
8046 | key: "uncheckAll",
|
8047 | value: function uncheckAll() {
|
8048 | this._toggleCheckAll(false);
|
8049 | }
|
8050 | }, {
|
8051 | key: "_toggleCheckAll",
|
8052 | value: function _toggleCheckAll(checked) {
|
8053 | var rowsBefore = this.getSelections();
|
8054 | this.$selectAll.add(this.$selectAll_).prop('checked', checked);
|
8055 | this.$selectItem.filter(':enabled').prop('checked', checked);
|
8056 | this.updateRows();
|
8057 | this.updateSelected();
|
8058 | var rowsAfter = this.getSelections();
|
8059 | if (checked) {
|
8060 | this.trigger('check-all', rowsAfter, rowsBefore);
|
8061 | return;
|
8062 | }
|
8063 | this.trigger('uncheck-all', rowsAfter, rowsBefore);
|
8064 | }
|
8065 | }, {
|
8066 | key: "checkInvert",
|
8067 | value: function checkInvert() {
|
8068 | var $items = this.$selectItem.filter(':enabled');
|
8069 | var checked = $items.filter(':checked');
|
8070 | $items.each(function (i, el) {
|
8071 | $$o(el).prop('checked', !$$o(el).prop('checked'));
|
8072 | });
|
8073 | this.updateRows();
|
8074 | this.updateSelected();
|
8075 | this.trigger('uncheck-some', checked);
|
8076 | checked = this.getSelections();
|
8077 | this.trigger('check-some', checked);
|
8078 | }
|
8079 | }, {
|
8080 | key: "check",
|
8081 | value: function check(index) {
|
8082 | this._toggleCheck(true, index);
|
8083 | }
|
8084 | }, {
|
8085 | key: "uncheck",
|
8086 | value: function uncheck(index) {
|
8087 | this._toggleCheck(false, index);
|
8088 | }
|
8089 | }, {
|
8090 | key: "_toggleCheck",
|
8091 | value: function _toggleCheck(checked, index) {
|
8092 | var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
|
8093 | var row = this.data[index];
|
8094 | if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
|
8095 | var _iterator10 = _createForOfIteratorHelper(this.options.data),
|
8096 | _step10;
|
8097 | try {
|
8098 | for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
8099 | var r = _step10.value;
|
8100 | r[this.header.stateField] = false;
|
8101 | }
|
8102 | } catch (err) {
|
8103 | _iterator10.e(err);
|
8104 | } finally {
|
8105 | _iterator10.f();
|
8106 | }
|
8107 | this.$selectItem.filter(':checked').not($el).prop('checked', false);
|
8108 | }
|
8109 | row[this.header.stateField] = checked;
|
8110 | if (this.options.multipleSelectRow) {
|
8111 | if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
|
8112 | var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
|
8113 | _ref9 = _slicedToArray(_ref8, 2),
|
8114 | fromIndex = _ref9[0],
|
8115 | toIndex = _ref9[1];
|
8116 | for (var i = fromIndex + 1; i < toIndex; i++) {
|
8117 | this.data[i][this.header.stateField] = true;
|
8118 | this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
|
8119 | }
|
8120 | }
|
8121 | this.multipleSelectRowCtrlKey = false;
|
8122 | this.multipleSelectRowShiftKey = false;
|
8123 | this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
|
8124 | }
|
8125 | $el.prop('checked', checked);
|
8126 | this.updateSelected();
|
8127 | this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
|
8128 | }
|
8129 | }, {
|
8130 | key: "checkBy",
|
8131 | value: function checkBy(obj) {
|
8132 | this._toggleCheckBy(true, obj);
|
8133 | }
|
8134 | }, {
|
8135 | key: "uncheckBy",
|
8136 | value: function uncheckBy(obj) {
|
8137 | this._toggleCheckBy(false, obj);
|
8138 | }
|
8139 | }, {
|
8140 | key: "_toggleCheckBy",
|
8141 | value: function _toggleCheckBy(checked, obj) {
|
8142 | var _this24 = this;
|
8143 | if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
|
8144 | return;
|
8145 | }
|
8146 | var rows = [];
|
8147 | this.data.forEach(function (row, i) {
|
8148 | if (!row.hasOwnProperty(obj.field)) {
|
8149 | return false;
|
8150 | }
|
8151 | if (obj.values.includes(row[obj.field])) {
|
8152 | var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
|
8153 | var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
|
8154 | $el = checked ? $el.not(':checked') : $el.filter(':checked');
|
8155 | if (!$el.length && onlyCurrentPage) {
|
8156 | return;
|
8157 | }
|
8158 | $el.prop('checked', checked);
|
8159 | row[_this24.header.stateField] = checked;
|
8160 | rows.push(row);
|
8161 | _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
|
8162 | }
|
8163 | });
|
8164 | this.updateSelected();
|
8165 | this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
|
8166 | }
|
8167 | }, {
|
8168 | key: "refresh",
|
8169 | value: function refresh(params) {
|
8170 | if (params && params.url) {
|
8171 | this.options.url = params.url;
|
8172 | }
|
8173 | if (params && params.pageNumber) {
|
8174 | this.options.pageNumber = params.pageNumber;
|
8175 | }
|
8176 | if (params && params.pageSize) {
|
8177 | this.options.pageSize = params.pageSize;
|
8178 | }
|
8179 | this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
|
8180 | }
|
8181 | }, {
|
8182 | key: "destroy",
|
8183 | value: function destroy() {
|
8184 | this.$el.insertBefore(this.$container);
|
8185 | $$o(this.options.toolbar).insertBefore(this.$el);
|
8186 | this.$container.next().remove();
|
8187 | this.$container.remove();
|
8188 | this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || '');
|
8189 |
|
8190 | var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
|
8191 | $$o(window).off(resizeEvent);
|
8192 | }
|
8193 | }, {
|
8194 | key: "resetView",
|
8195 | value: function resetView(params) {
|
8196 | var padding = 0;
|
8197 | if (params && params.height) {
|
8198 | this.options.height = params.height;
|
8199 | }
|
8200 | this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
|
8201 | if (this.options.height) {
|
8202 | var fixedBody = this.$tableBody.get(0);
|
8203 | this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
|
8204 | }
|
8205 | if (!this.options.cardView && this.options.showHeader && this.options.height) {
|
8206 | this.$tableHeader.show();
|
8207 | this.resetHeader();
|
8208 | padding += this.$header.outerHeight(true) + 1;
|
8209 | } else {
|
8210 | this.$tableHeader.hide();
|
8211 | this.trigger('post-header');
|
8212 | }
|
8213 | if (!this.options.cardView && this.options.showFooter) {
|
8214 | this.$tableFooter.show();
|
8215 | this.fitFooter();
|
8216 | if (this.options.height) {
|
8217 | padding += this.$tableFooter.outerHeight(true);
|
8218 | }
|
8219 | }
|
8220 | if (this.$container.hasClass('fullscreen')) {
|
8221 | this.$tableContainer.css('height', '');
|
8222 | this.$tableContainer.css('width', '');
|
8223 | } else if (this.options.height) {
|
8224 | if (this.$tableBorder) {
|
8225 | this.$tableBorder.css('width', '');
|
8226 | this.$tableBorder.css('height', '');
|
8227 | }
|
8228 | var toolbarHeight = this.$toolbar.outerHeight(true);
|
8229 | var paginationHeight = this.$pagination.outerHeight(true);
|
8230 | var height = this.options.height - toolbarHeight - paginationHeight;
|
8231 | var $bodyTable = this.$tableBody.find('>table');
|
8232 | var tableHeight = $bodyTable.outerHeight();
|
8233 | this.$tableContainer.css('height', "".concat(height, "px"));
|
8234 | if (this.$tableBorder && $bodyTable.is(':visible')) {
|
8235 | var tableBorderHeight = height - tableHeight - 2;
|
8236 | if (this.hasScrollBar) {
|
8237 | tableBorderHeight -= Utils.getScrollBarWidth();
|
8238 | }
|
8239 | this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
|
8240 | this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
|
8241 | }
|
8242 | }
|
8243 | if (this.options.cardView) {
|
8244 |
|
8245 | this.$el.css('margin-top', '0');
|
8246 | this.$tableContainer.css('padding-bottom', '0');
|
8247 | this.$tableFooter.hide();
|
8248 | } else {
|
8249 |
|
8250 | this.getCaret();
|
8251 | this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
|
8252 | }
|
8253 | this.trigger('reset-view');
|
8254 | }
|
8255 | }, {
|
8256 | key: "showLoading",
|
8257 | value: function showLoading() {
|
8258 | this.$tableLoading.toggleClass('open', true);
|
8259 | var fontSize = this.options.loadingFontSize;
|
8260 | if (this.options.loadingFontSize === 'auto') {
|
8261 | fontSize = this.$tableLoading.width() * 0.04;
|
8262 | fontSize = Math.max(12, fontSize);
|
8263 | fontSize = Math.min(32, fontSize);
|
8264 | fontSize = "".concat(fontSize, "px");
|
8265 | }
|
8266 | this.$tableLoading.find('.loading-text').css('font-size', fontSize);
|
8267 | }
|
8268 | }, {
|
8269 | key: "hideLoading",
|
8270 | value: function hideLoading() {
|
8271 | this.$tableLoading.toggleClass('open', false);
|
8272 | }
|
8273 | }, {
|
8274 | key: "togglePagination",
|
8275 | value: function togglePagination() {
|
8276 | this.options.pagination = !this.options.pagination;
|
8277 | var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
|
8278 | var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
|
8279 | this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
|
8280 | this.updatePagination();
|
8281 | this.trigger('toggle-pagination', this.options.pagination);
|
8282 | }
|
8283 | }, {
|
8284 | key: "toggleFullscreen",
|
8285 | value: function toggleFullscreen() {
|
8286 | this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
|
8287 | this.resetView();
|
8288 | }
|
8289 | }, {
|
8290 | key: "toggleView",
|
8291 | value: function toggleView() {
|
8292 | this.options.cardView = !this.options.cardView;
|
8293 | this.initHeader();
|
8294 | var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
|
8295 | var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
|
8296 | this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
|
8297 | this.initBody();
|
8298 | this.trigger('toggle', this.options.cardView);
|
8299 | }
|
8300 | }, {
|
8301 | key: "resetSearch",
|
8302 | value: function resetSearch(text) {
|
8303 | var $search = Utils.getSearchInput(this);
|
8304 | var textToUse = text || '';
|
8305 | $search.val(textToUse);
|
8306 | this.searchText = textToUse;
|
8307 | this.onSearch({
|
8308 | currentTarget: $search
|
8309 | }, false);
|
8310 | }
|
8311 | }, {
|
8312 | key: "filterBy",
|
8313 | value: function filterBy(columns, options) {
|
8314 | this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : Utils.extend(this.options.filterOptions, options);
|
8315 | this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
|
8316 | this.options.pageNumber = 1;
|
8317 | this.initSearch();
|
8318 | this.updatePagination();
|
8319 | }
|
8320 | }, {
|
8321 | key: "scrollTo",
|
8322 | value: function scrollTo(params) {
|
8323 | var options = {
|
8324 | unit: 'px',
|
8325 | value: 0
|
8326 | };
|
8327 | if (_typeof(params) === 'object') {
|
8328 | options = Object.assign(options, params);
|
8329 | } else if (typeof params === 'string' && params === 'bottom') {
|
8330 | options.value = this.$tableBody[0].scrollHeight;
|
8331 | } else if (typeof params === 'string' || typeof params === 'number') {
|
8332 | options.value = params;
|
8333 | }
|
8334 | var scrollTo = options.value;
|
8335 | if (options.unit === 'rows') {
|
8336 | scrollTo = 0;
|
8337 | this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
|
8338 | scrollTo += $$o(el).outerHeight(true);
|
8339 | });
|
8340 | }
|
8341 | this.$tableBody.scrollTop(scrollTo);
|
8342 | }
|
8343 | }, {
|
8344 | key: "getScrollPosition",
|
8345 | value: function getScrollPosition() {
|
8346 | return this.$tableBody.scrollTop();
|
8347 | }
|
8348 | }, {
|
8349 | key: "selectPage",
|
8350 | value: function selectPage(page) {
|
8351 | if (page > 0 && page <= this.options.totalPages) {
|
8352 | this.options.pageNumber = page;
|
8353 | this.updatePagination();
|
8354 | }
|
8355 | }
|
8356 | }, {
|
8357 | key: "prevPage",
|
8358 | value: function prevPage() {
|
8359 | if (this.options.pageNumber > 1) {
|
8360 | this.options.pageNumber--;
|
8361 | this.updatePagination();
|
8362 | }
|
8363 | }
|
8364 | }, {
|
8365 | key: "nextPage",
|
8366 | value: function nextPage() {
|
8367 | if (this.options.pageNumber < this.options.totalPages) {
|
8368 | this.options.pageNumber++;
|
8369 | this.updatePagination();
|
8370 | }
|
8371 | }
|
8372 | }, {
|
8373 | key: "toggleDetailView",
|
8374 | value: function toggleDetailView(index, _columnDetailFormatter) {
|
8375 | var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
|
8376 | if ($tr.next().is('tr.detail-view')) {
|
8377 | this.collapseRow(index);
|
8378 | } else {
|
8379 | this.expandRow(index, _columnDetailFormatter);
|
8380 | }
|
8381 | this.resetView();
|
8382 | }
|
8383 | }, {
|
8384 | key: "expandRow",
|
8385 | value: function expandRow(index, _columnDetailFormatter) {
|
8386 | var row = this.data[index];
|
8387 | var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
|
8388 | if (this.options.detailViewIcon) {
|
8389 | $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
|
8390 | }
|
8391 | if ($tr.next().is('tr.detail-view')) {
|
8392 | return;
|
8393 | }
|
8394 | $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
|
8395 | var $element = $tr.next().find('td');
|
8396 | var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
|
8397 | var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
|
8398 | if ($element.length === 1) {
|
8399 | $element.append(content);
|
8400 | }
|
8401 | this.trigger('expand-row', index, row, $element);
|
8402 | }
|
8403 | }, {
|
8404 | key: "expandRowByUniqueId",
|
8405 | value: function expandRowByUniqueId(uniqueId) {
|
8406 | var row = this.getRowByUniqueId(uniqueId);
|
8407 | if (!row) {
|
8408 | return;
|
8409 | }
|
8410 | this.expandRow(this.data.indexOf(row));
|
8411 | }
|
8412 | }, {
|
8413 | key: "collapseRow",
|
8414 | value: function collapseRow(index) {
|
8415 | var row = this.data[index];
|
8416 | var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
|
8417 | if (!$tr.next().is('tr.detail-view')) {
|
8418 | return;
|
8419 | }
|
8420 | if (this.options.detailViewIcon) {
|
8421 | $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
|
8422 | }
|
8423 | this.trigger('collapse-row', index, row, $tr.next());
|
8424 | $tr.next().remove();
|
8425 | }
|
8426 | }, {
|
8427 | key: "collapseRowByUniqueId",
|
8428 | value: function collapseRowByUniqueId(uniqueId) {
|
8429 | var row = this.getRowByUniqueId(uniqueId);
|
8430 | if (!row) {
|
8431 | return;
|
8432 | }
|
8433 | this.collapseRow(this.data.indexOf(row));
|
8434 | }
|
8435 | }, {
|
8436 | key: "expandAllRows",
|
8437 | value: function expandAllRows() {
|
8438 | var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
|
8439 | for (var i = 0; i < trs.length; i++) {
|
8440 | this.expandRow($$o(trs[i]).data('index'));
|
8441 | }
|
8442 | }
|
8443 | }, {
|
8444 | key: "collapseAllRows",
|
8445 | value: function collapseAllRows() {
|
8446 | var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
|
8447 | for (var i = 0; i < trs.length; i++) {
|
8448 | this.collapseRow($$o(trs[i]).data('index'));
|
8449 | }
|
8450 | }
|
8451 | }, {
|
8452 | key: "updateColumnTitle",
|
8453 | value: function updateColumnTitle(params) {
|
8454 | if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
|
8455 | return;
|
8456 | }
|
8457 | this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title;
|
8458 | if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
|
8459 | this.$header.find('th[data-field]').each(function (i, el) {
|
8460 | if ($$o(el).data('field') === params.field) {
|
8461 | $$o($$o(el).find('.th-inner')[0]).text(params.title);
|
8462 | return false;
|
8463 | }
|
8464 | });
|
8465 | this.resetView();
|
8466 | }
|
8467 | }
|
8468 | }, {
|
8469 | key: "updateFormatText",
|
8470 | value: function updateFormatText(formatName, text) {
|
8471 | if (!/^format/.test(formatName) || !this.options[formatName]) {
|
8472 | return;
|
8473 | }
|
8474 | if (typeof text === 'string') {
|
8475 | this.options[formatName] = function () {
|
8476 | return text;
|
8477 | };
|
8478 | } else if (typeof text === 'function') {
|
8479 | this.options[formatName] = text;
|
8480 | }
|
8481 | this.initToolbar();
|
8482 | this.initPagination();
|
8483 | this.initBody();
|
8484 | }
|
8485 | }]);
|
8486 | return BootstrapTable;
|
8487 | }();
|
8488 | BootstrapTable.VERSION = Constants.VERSION;
|
8489 | BootstrapTable.DEFAULTS = Constants.DEFAULTS;
|
8490 | BootstrapTable.LOCALES = Constants.LOCALES;
|
8491 | BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
|
8492 | BootstrapTable.METHODS = Constants.METHODS;
|
8493 | BootstrapTable.EVENTS = Constants.EVENTS;
|
8494 |
|
8495 |
|
8496 |
|
8497 |
|
8498 | $$o.BootstrapTable = BootstrapTable;
|
8499 | $$o.fn.bootstrapTable = function (option) {
|
8500 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
|
8501 | args[_key5 - 1] = arguments[_key5];
|
8502 | }
|
8503 | var value;
|
8504 | this.each(function (i, el) {
|
8505 | var data = $$o(el).data('bootstrap.table');
|
8506 | if (typeof option === 'string') {
|
8507 | var _data2;
|
8508 | if (!Constants.METHODS.includes(option)) {
|
8509 | throw new Error("Unknown method: ".concat(option));
|
8510 | }
|
8511 | if (!data) {
|
8512 | return;
|
8513 | }
|
8514 | value = (_data2 = data)[option].apply(_data2, args);
|
8515 | if (option === 'destroy') {
|
8516 | $$o(el).removeData('bootstrap.table');
|
8517 | }
|
8518 | return;
|
8519 | }
|
8520 | if (data) {
|
8521 | console.warn('You cannot initialize the table more than once!');
|
8522 | return;
|
8523 | }
|
8524 | var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$o(el).data(), _typeof(option) === 'object' && option);
|
8525 | data = new $$o.BootstrapTable(el, options);
|
8526 | $$o(el).data('bootstrap.table', data);
|
8527 | data.init();
|
8528 | });
|
8529 | return typeof value === 'undefined' ? this : value;
|
8530 | };
|
8531 | $$o.fn.bootstrapTable.Constructor = BootstrapTable;
|
8532 | $$o.fn.bootstrapTable.theme = Constants.THEME;
|
8533 | $$o.fn.bootstrapTable.VERSION = Constants.VERSION;
|
8534 | $$o.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
|
8535 | $$o.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
|
8536 | $$o.fn.bootstrapTable.events = BootstrapTable.EVENTS;
|
8537 | $$o.fn.bootstrapTable.locales = BootstrapTable.LOCALES;
|
8538 | $$o.fn.bootstrapTable.methods = BootstrapTable.METHODS;
|
8539 | $$o.fn.bootstrapTable.utils = Utils;
|
8540 |
|
8541 |
|
8542 |
|
8543 |
|
8544 | $$o(function () {
|
8545 | $$o('[data-toggle="table"]').bootstrapTable();
|
8546 | });
|
8547 |
|
8548 | return BootstrapTable;
|
8549 |
|
8550 | }));
|