1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
|
3 | typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4 | (global = global || self, factory(global.jQuery));
|
5 | }(this, function ($) { 'use strict';
|
6 |
|
7 | $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
8 |
|
9 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10 |
|
11 | function createCommonjsModule(fn, module) {
|
12 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
13 | }
|
14 |
|
15 | var O = 'object';
|
16 | var check = function (it) {
|
17 | return it && it.Math == Math && it;
|
18 | };
|
19 |
|
20 |
|
21 | var global_1 =
|
22 |
|
23 | check(typeof globalThis == O && globalThis) ||
|
24 | check(typeof window == O && window) ||
|
25 | check(typeof self == O && self) ||
|
26 | check(typeof commonjsGlobal == O && commonjsGlobal) ||
|
27 |
|
28 | Function('return this')();
|
29 |
|
30 | var fails = function (exec) {
|
31 | try {
|
32 | return !!exec();
|
33 | } catch (error) {
|
34 | return true;
|
35 | }
|
36 | };
|
37 |
|
38 |
|
39 | var descriptors = !fails(function () {
|
40 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
41 | });
|
42 |
|
43 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
44 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
45 |
|
46 |
|
47 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
48 |
|
49 |
|
50 |
|
51 | var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
52 | var descriptor = getOwnPropertyDescriptor(this, V);
|
53 | return !!descriptor && descriptor.enumerable;
|
54 | } : nativePropertyIsEnumerable;
|
55 |
|
56 | var objectPropertyIsEnumerable = {
|
57 | f: f
|
58 | };
|
59 |
|
60 | var createPropertyDescriptor = function (bitmap, value) {
|
61 | return {
|
62 | enumerable: !(bitmap & 1),
|
63 | configurable: !(bitmap & 2),
|
64 | writable: !(bitmap & 4),
|
65 | value: value
|
66 | };
|
67 | };
|
68 |
|
69 | var toString = {}.toString;
|
70 |
|
71 | var classofRaw = function (it) {
|
72 | return toString.call(it).slice(8, -1);
|
73 | };
|
74 |
|
75 | var split = ''.split;
|
76 |
|
77 |
|
78 | var indexedObject = fails(function () {
|
79 |
|
80 |
|
81 | return !Object('z').propertyIsEnumerable(0);
|
82 | }) ? function (it) {
|
83 | return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
84 | } : Object;
|
85 |
|
86 |
|
87 |
|
88 | var requireObjectCoercible = function (it) {
|
89 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
90 | return it;
|
91 | };
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | var toIndexedObject = function (it) {
|
98 | return indexedObject(requireObjectCoercible(it));
|
99 | };
|
100 |
|
101 | var isObject = function (it) {
|
102 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
103 | };
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | var toPrimitive = function (input, PREFERRED_STRING) {
|
110 | if (!isObject(input)) return input;
|
111 | var fn, val;
|
112 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
113 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
114 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
115 | throw TypeError("Can't convert object to primitive value");
|
116 | };
|
117 |
|
118 | var hasOwnProperty = {}.hasOwnProperty;
|
119 |
|
120 | var has = function (it, key) {
|
121 | return hasOwnProperty.call(it, key);
|
122 | };
|
123 |
|
124 | var document$1 = global_1.document;
|
125 |
|
126 | var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
127 |
|
128 | var documentCreateElement = function (it) {
|
129 | return EXISTS ? document$1.createElement(it) : {};
|
130 | };
|
131 |
|
132 |
|
133 | var ie8DomDefine = !descriptors && !fails(function () {
|
134 | return Object.defineProperty(documentCreateElement('div'), 'a', {
|
135 | get: function () { return 7; }
|
136 | }).a != 7;
|
137 | });
|
138 |
|
139 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
140 |
|
141 |
|
142 |
|
143 | var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
144 | O = toIndexedObject(O);
|
145 | P = toPrimitive(P, true);
|
146 | if (ie8DomDefine) try {
|
147 | return nativeGetOwnPropertyDescriptor(O, P);
|
148 | } catch (error) { }
|
149 | if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
150 | };
|
151 |
|
152 | var objectGetOwnPropertyDescriptor = {
|
153 | f: f$1
|
154 | };
|
155 |
|
156 | var anObject = function (it) {
|
157 | if (!isObject(it)) {
|
158 | throw TypeError(String(it) + ' is not an object');
|
159 | } return it;
|
160 | };
|
161 |
|
162 | var nativeDefineProperty = Object.defineProperty;
|
163 |
|
164 |
|
165 |
|
166 | var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
167 | anObject(O);
|
168 | P = toPrimitive(P, true);
|
169 | anObject(Attributes);
|
170 | if (ie8DomDefine) try {
|
171 | return nativeDefineProperty(O, P, Attributes);
|
172 | } catch (error) { }
|
173 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
174 | if ('value' in Attributes) O[P] = Attributes.value;
|
175 | return O;
|
176 | };
|
177 |
|
178 | var objectDefineProperty = {
|
179 | f: f$2
|
180 | };
|
181 |
|
182 | var hide = descriptors ? function (object, key, value) {
|
183 | return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
184 | } : function (object, key, value) {
|
185 | object[key] = value;
|
186 | return object;
|
187 | };
|
188 |
|
189 | var setGlobal = function (key, value) {
|
190 | try {
|
191 | hide(global_1, key, value);
|
192 | } catch (error) {
|
193 | global_1[key] = value;
|
194 | } return value;
|
195 | };
|
196 |
|
197 | var shared = createCommonjsModule(function (module) {
|
198 | var SHARED = '__core-js_shared__';
|
199 | var store = global_1[SHARED] || setGlobal(SHARED, {});
|
200 |
|
201 | (module.exports = function (key, value) {
|
202 | return store[key] || (store[key] = value !== undefined ? value : {});
|
203 | })('versions', []).push({
|
204 | version: '3.1.3',
|
205 | mode: 'global',
|
206 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
207 | });
|
208 | });
|
209 |
|
210 | var functionToString = shared('native-function-to-string', Function.toString);
|
211 |
|
212 | var WeakMap = global_1.WeakMap;
|
213 |
|
214 | var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
|
215 |
|
216 | var id = 0;
|
217 | var postfix = Math.random();
|
218 |
|
219 | var uid = function (key) {
|
220 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
221 | };
|
222 |
|
223 | var keys = shared('keys');
|
224 |
|
225 | var sharedKey = function (key) {
|
226 | return keys[key] || (keys[key] = uid(key));
|
227 | };
|
228 |
|
229 | var hiddenKeys = {};
|
230 |
|
231 | var WeakMap$1 = global_1.WeakMap;
|
232 | var set, get, has$1;
|
233 |
|
234 | var enforce = function (it) {
|
235 | return has$1(it) ? get(it) : set(it, {});
|
236 | };
|
237 |
|
238 | var getterFor = function (TYPE) {
|
239 | return function (it) {
|
240 | var state;
|
241 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
242 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
243 | } return state;
|
244 | };
|
245 | };
|
246 |
|
247 | if (nativeWeakMap) {
|
248 | var store = new WeakMap$1();
|
249 | var wmget = store.get;
|
250 | var wmhas = store.has;
|
251 | var wmset = store.set;
|
252 | set = function (it, metadata) {
|
253 | wmset.call(store, it, metadata);
|
254 | return metadata;
|
255 | };
|
256 | get = function (it) {
|
257 | return wmget.call(store, it) || {};
|
258 | };
|
259 | has$1 = function (it) {
|
260 | return wmhas.call(store, it);
|
261 | };
|
262 | } else {
|
263 | var STATE = sharedKey('state');
|
264 | hiddenKeys[STATE] = true;
|
265 | set = function (it, metadata) {
|
266 | hide(it, STATE, metadata);
|
267 | return metadata;
|
268 | };
|
269 | get = function (it) {
|
270 | return has(it, STATE) ? it[STATE] : {};
|
271 | };
|
272 | has$1 = function (it) {
|
273 | return has(it, STATE);
|
274 | };
|
275 | }
|
276 |
|
277 | var internalState = {
|
278 | set: set,
|
279 | get: get,
|
280 | has: has$1,
|
281 | enforce: enforce,
|
282 | getterFor: getterFor
|
283 | };
|
284 |
|
285 | var redefine = createCommonjsModule(function (module) {
|
286 | var getInternalState = internalState.get;
|
287 | var enforceInternalState = internalState.enforce;
|
288 | var TEMPLATE = String(functionToString).split('toString');
|
289 |
|
290 | shared('inspectSource', function (it) {
|
291 | return functionToString.call(it);
|
292 | });
|
293 |
|
294 | (module.exports = function (O, key, value, options) {
|
295 | var unsafe = options ? !!options.unsafe : false;
|
296 | var simple = options ? !!options.enumerable : false;
|
297 | var noTargetGet = options ? !!options.noTargetGet : false;
|
298 | if (typeof value == 'function') {
|
299 | if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
|
300 | enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
301 | }
|
302 | if (O === global_1) {
|
303 | if (simple) O[key] = value;
|
304 | else setGlobal(key, value);
|
305 | return;
|
306 | } else if (!unsafe) {
|
307 | delete O[key];
|
308 | } else if (!noTargetGet && O[key]) {
|
309 | simple = true;
|
310 | }
|
311 | if (simple) O[key] = value;
|
312 | else hide(O, key, value);
|
313 |
|
314 | })(Function.prototype, 'toString', function toString() {
|
315 | return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
|
316 | });
|
317 | });
|
318 |
|
319 | var path = global_1;
|
320 |
|
321 | var aFunction = function (variable) {
|
322 | return typeof variable == 'function' ? variable : undefined;
|
323 | };
|
324 |
|
325 | var getBuiltIn = function (namespace, method) {
|
326 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
327 | : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
328 | };
|
329 |
|
330 | var ceil = Math.ceil;
|
331 | var floor = Math.floor;
|
332 |
|
333 |
|
334 |
|
335 | var toInteger = function (argument) {
|
336 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
337 | };
|
338 |
|
339 | var min = Math.min;
|
340 |
|
341 |
|
342 |
|
343 | var toLength = function (argument) {
|
344 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
345 | };
|
346 |
|
347 | var max = Math.max;
|
348 | var min$1 = Math.min;
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | var toAbsoluteIndex = function (index, length) {
|
354 | var integer = toInteger(index);
|
355 | return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
356 | };
|
357 |
|
358 |
|
359 | var createMethod = function (IS_INCLUDES) {
|
360 | return function ($this, el, fromIndex) {
|
361 | var O = toIndexedObject($this);
|
362 | var length = toLength(O.length);
|
363 | var index = toAbsoluteIndex(fromIndex, length);
|
364 | var value;
|
365 |
|
366 |
|
367 | if (IS_INCLUDES && el != el) while (length > index) {
|
368 | value = O[index++];
|
369 |
|
370 | if (value != value) return true;
|
371 |
|
372 | } else for (;length > index; index++) {
|
373 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
374 | } return !IS_INCLUDES && -1;
|
375 | };
|
376 | };
|
377 |
|
378 | var arrayIncludes = {
|
379 |
|
380 |
|
381 | includes: createMethod(true),
|
382 |
|
383 |
|
384 | indexOf: createMethod(false)
|
385 | };
|
386 |
|
387 | var indexOf = arrayIncludes.indexOf;
|
388 |
|
389 |
|
390 | var objectKeysInternal = function (object, names) {
|
391 | var O = toIndexedObject(object);
|
392 | var i = 0;
|
393 | var result = [];
|
394 | var key;
|
395 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
396 |
|
397 | while (names.length > i) if (has(O, key = names[i++])) {
|
398 | ~indexOf(result, key) || result.push(key);
|
399 | }
|
400 | return result;
|
401 | };
|
402 |
|
403 |
|
404 | var enumBugKeys = [
|
405 | 'constructor',
|
406 | 'hasOwnProperty',
|
407 | 'isPrototypeOf',
|
408 | 'propertyIsEnumerable',
|
409 | 'toLocaleString',
|
410 | 'toString',
|
411 | 'valueOf'
|
412 | ];
|
413 |
|
414 | var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
415 |
|
416 |
|
417 |
|
418 | var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
419 | return objectKeysInternal(O, hiddenKeys$1);
|
420 | };
|
421 |
|
422 | var objectGetOwnPropertyNames = {
|
423 | f: f$3
|
424 | };
|
425 |
|
426 | var f$4 = Object.getOwnPropertySymbols;
|
427 |
|
428 | var objectGetOwnPropertySymbols = {
|
429 | f: f$4
|
430 | };
|
431 |
|
432 |
|
433 | var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
434 | var keys = objectGetOwnPropertyNames.f(anObject(it));
|
435 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
436 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
437 | };
|
438 |
|
439 | var copyConstructorProperties = function (target, source) {
|
440 | var keys = ownKeys(source);
|
441 | var defineProperty = objectDefineProperty.f;
|
442 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
443 | for (var i = 0; i < keys.length; i++) {
|
444 | var key = keys[i];
|
445 | if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
446 | }
|
447 | };
|
448 |
|
449 | var replacement = /#|\.prototype\./;
|
450 |
|
451 | var isForced = function (feature, detection) {
|
452 | var value = data[normalize(feature)];
|
453 | return value == POLYFILL ? true
|
454 | : value == NATIVE ? false
|
455 | : typeof detection == 'function' ? fails(detection)
|
456 | : !!detection;
|
457 | };
|
458 |
|
459 | var normalize = isForced.normalize = function (string) {
|
460 | return String(string).replace(replacement, '.').toLowerCase();
|
461 | };
|
462 |
|
463 | var data = isForced.data = {};
|
464 | var NATIVE = isForced.NATIVE = 'N';
|
465 | var POLYFILL = isForced.POLYFILL = 'P';
|
466 |
|
467 | var isForced_1 = isForced;
|
468 |
|
469 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 | |
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 | var _export = function (options, source) {
|
491 | var TARGET = options.target;
|
492 | var GLOBAL = options.global;
|
493 | var STATIC = options.stat;
|
494 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
495 | if (GLOBAL) {
|
496 | target = global_1;
|
497 | } else if (STATIC) {
|
498 | target = global_1[TARGET] || setGlobal(TARGET, {});
|
499 | } else {
|
500 | target = (global_1[TARGET] || {}).prototype;
|
501 | }
|
502 | if (target) for (key in source) {
|
503 | sourceProperty = source[key];
|
504 | if (options.noTargetGet) {
|
505 | descriptor = getOwnPropertyDescriptor$1(target, key);
|
506 | targetProperty = descriptor && descriptor.value;
|
507 | } else targetProperty = target[key];
|
508 | FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
509 |
|
510 | if (!FORCED && targetProperty !== undefined) {
|
511 | if (typeof sourceProperty === typeof targetProperty) continue;
|
512 | copyConstructorProperties(sourceProperty, targetProperty);
|
513 | }
|
514 |
|
515 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
516 | hide(sourceProperty, 'sham', true);
|
517 | }
|
518 |
|
519 | redefine(target, key, sourceProperty, options);
|
520 | }
|
521 | };
|
522 |
|
523 |
|
524 |
|
525 | var isArray = Array.isArray || function isArray(arg) {
|
526 | return classofRaw(arg) == 'Array';
|
527 | };
|
528 |
|
529 |
|
530 |
|
531 | var toObject = function (argument) {
|
532 | return Object(requireObjectCoercible(argument));
|
533 | };
|
534 |
|
535 | var createProperty = function (object, key, value) {
|
536 | var propertyKey = toPrimitive(key);
|
537 | if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
538 | else object[propertyKey] = value;
|
539 | };
|
540 |
|
541 | var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
542 |
|
543 |
|
544 | return !String(Symbol());
|
545 | });
|
546 |
|
547 | var Symbol$1 = global_1.Symbol;
|
548 | var store$1 = shared('wks');
|
549 |
|
550 | var wellKnownSymbol = function (name) {
|
551 | return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
|
552 | || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
|
553 | };
|
554 |
|
555 | var SPECIES = wellKnownSymbol('species');
|
556 |
|
557 |
|
558 |
|
559 | var arraySpeciesCreate = function (originalArray, length) {
|
560 | var C;
|
561 | if (isArray(originalArray)) {
|
562 | C = originalArray.constructor;
|
563 |
|
564 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
565 | else if (isObject(C)) {
|
566 | C = C[SPECIES];
|
567 | if (C === null) C = undefined;
|
568 | }
|
569 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
570 | };
|
571 |
|
572 | var SPECIES$1 = wellKnownSymbol('species');
|
573 |
|
574 | var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
575 | return !fails(function () {
|
576 | var array = [];
|
577 | var constructor = array.constructor = {};
|
578 | constructor[SPECIES$1] = function () {
|
579 | return { foo: 1 };
|
580 | };
|
581 | return array[METHOD_NAME](Boolean).foo !== 1;
|
582 | });
|
583 | };
|
584 |
|
585 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
586 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
587 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
588 |
|
589 | var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
|
590 | var array = [];
|
591 | array[IS_CONCAT_SPREADABLE] = false;
|
592 | return array.concat()[0] !== array;
|
593 | });
|
594 |
|
595 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
596 |
|
597 | var isConcatSpreadable = function (O) {
|
598 | if (!isObject(O)) return false;
|
599 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
600 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
601 | };
|
602 |
|
603 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
604 |
|
605 |
|
606 |
|
607 |
|
608 | _export({ target: 'Array', proto: true, forced: FORCED }, {
|
609 | concat: function concat(arg) {
|
610 | var O = toObject(this);
|
611 | var A = arraySpeciesCreate(O, 0);
|
612 | var n = 0;
|
613 | var i, k, length, len, E;
|
614 | for (i = -1, length = arguments.length; i < length; i++) {
|
615 | E = i === -1 ? O : arguments[i];
|
616 | if (isConcatSpreadable(E)) {
|
617 | len = toLength(E.length);
|
618 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
619 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
620 | } else {
|
621 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
622 | createProperty(A, n++, E);
|
623 | }
|
624 | }
|
625 | A.length = n;
|
626 | return A;
|
627 | }
|
628 | });
|
629 |
|
630 | var aFunction$1 = function (it) {
|
631 | if (typeof it != 'function') {
|
632 | throw TypeError(String(it) + ' is not a function');
|
633 | } return it;
|
634 | };
|
635 |
|
636 |
|
637 | var bindContext = function (fn, that, length) {
|
638 | aFunction$1(fn);
|
639 | if (that === undefined) return fn;
|
640 | switch (length) {
|
641 | case 0: return function () {
|
642 | return fn.call(that);
|
643 | };
|
644 | case 1: return function (a) {
|
645 | return fn.call(that, a);
|
646 | };
|
647 | case 2: return function (a, b) {
|
648 | return fn.call(that, a, b);
|
649 | };
|
650 | case 3: return function (a, b, c) {
|
651 | return fn.call(that, a, b, c);
|
652 | };
|
653 | }
|
654 | return function (/* ...args */) {
|
655 | return fn.apply(that, arguments);
|
656 | };
|
657 | };
|
658 |
|
659 | var push = [].push;
|
660 |
|
661 |
|
662 | var createMethod$1 = function (TYPE) {
|
663 | var IS_MAP = TYPE == 1;
|
664 | var IS_FILTER = TYPE == 2;
|
665 | var IS_SOME = TYPE == 3;
|
666 | var IS_EVERY = TYPE == 4;
|
667 | var IS_FIND_INDEX = TYPE == 6;
|
668 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
669 | return function ($this, callbackfn, that, specificCreate) {
|
670 | var O = toObject($this);
|
671 | var self = indexedObject(O);
|
672 | var boundFunction = bindContext(callbackfn, that, 3);
|
673 | var length = toLength(self.length);
|
674 | var index = 0;
|
675 | var create = specificCreate || arraySpeciesCreate;
|
676 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
677 | var value, result;
|
678 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
679 | value = self[index];
|
680 | result = boundFunction(value, index, O);
|
681 | if (TYPE) {
|
682 | if (IS_MAP) target[index] = result;
|
683 | else if (result) switch (TYPE) {
|
684 | case 3: return true;
|
685 | case 5: return value;
|
686 | case 6: return index;
|
687 | case 2: push.call(target, value);
|
688 | } else if (IS_EVERY) return false;
|
689 | }
|
690 | }
|
691 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
692 | };
|
693 | };
|
694 |
|
695 | var arrayIteration = {
|
696 |
|
697 |
|
698 | forEach: createMethod$1(0),
|
699 |
|
700 |
|
701 | map: createMethod$1(1),
|
702 |
|
703 |
|
704 | filter: createMethod$1(2),
|
705 |
|
706 |
|
707 | some: createMethod$1(3),
|
708 |
|
709 |
|
710 | every: createMethod$1(4),
|
711 |
|
712 |
|
713 | find: createMethod$1(5),
|
714 |
|
715 |
|
716 | findIndex: createMethod$1(6)
|
717 | };
|
718 |
|
719 | var $filter = arrayIteration.filter;
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 | _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
|
726 | filter: function filter(callbackfn /* , thisArg */) {
|
727 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
728 | }
|
729 | });
|
730 |
|
731 |
|
732 |
|
733 | var objectKeys = Object.keys || function keys(O) {
|
734 | return objectKeysInternal(O, enumBugKeys);
|
735 | };
|
736 |
|
737 |
|
738 |
|
739 | var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
740 | anObject(O);
|
741 | var keys = objectKeys(Properties);
|
742 | var length = keys.length;
|
743 | var index = 0;
|
744 | var key;
|
745 | while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
746 | return O;
|
747 | };
|
748 |
|
749 | var html = getBuiltIn('document', 'documentElement');
|
750 |
|
751 | var IE_PROTO = sharedKey('IE_PROTO');
|
752 |
|
753 | var PROTOTYPE = 'prototype';
|
754 | var Empty = function () { };
|
755 |
|
756 |
|
757 | var createDict = function () {
|
758 |
|
759 | var iframe = documentCreateElement('iframe');
|
760 | var length = enumBugKeys.length;
|
761 | var lt = '<';
|
762 | var script = 'script';
|
763 | var gt = '>';
|
764 | var js = 'java' + script + ':';
|
765 | var iframeDocument;
|
766 | iframe.style.display = 'none';
|
767 | html.appendChild(iframe);
|
768 | iframe.src = String(js);
|
769 | iframeDocument = iframe.contentWindow.document;
|
770 | iframeDocument.open();
|
771 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
772 | iframeDocument.close();
|
773 | createDict = iframeDocument.F;
|
774 | while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
|
775 | return createDict();
|
776 | };
|
777 |
|
778 |
|
779 |
|
780 | var objectCreate = Object.create || function create(O, Properties) {
|
781 | var result;
|
782 | if (O !== null) {
|
783 | Empty[PROTOTYPE] = anObject(O);
|
784 | result = new Empty();
|
785 | Empty[PROTOTYPE] = null;
|
786 |
|
787 | result[IE_PROTO] = O;
|
788 | } else result = createDict();
|
789 | return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
790 | };
|
791 |
|
792 | hiddenKeys[IE_PROTO] = true;
|
793 |
|
794 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
795 | var ArrayPrototype = Array.prototype;
|
796 |
|
797 |
|
798 |
|
799 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
800 | hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
|
801 | }
|
802 |
|
803 |
|
804 | var addToUnscopables = function (key) {
|
805 | ArrayPrototype[UNSCOPABLES][key] = true;
|
806 | };
|
807 |
|
808 | var $find = arrayIteration.find;
|
809 |
|
810 |
|
811 | var FIND = 'find';
|
812 | var SKIPS_HOLES = true;
|
813 |
|
814 |
|
815 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
816 |
|
817 |
|
818 |
|
819 | _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
820 | find: function find(callbackfn /* , that = undefined */) {
|
821 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
822 | }
|
823 | });
|
824 |
|
825 |
|
826 | addToUnscopables(FIND);
|
827 |
|
828 | var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
829 | var method = [][METHOD_NAME];
|
830 | return !method || !fails(function () {
|
831 |
|
832 | method.call(null, argument || function () { throw 1; }, 1);
|
833 | });
|
834 | };
|
835 |
|
836 | var nativeJoin = [].join;
|
837 |
|
838 | var ES3_STRINGS = indexedObject != Object;
|
839 | var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
|
840 |
|
841 |
|
842 |
|
843 | _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
|
844 | join: function join(separator) {
|
845 | return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
846 | }
|
847 | });
|
848 |
|
849 |
|
850 |
|
851 | var regexpFlags = function () {
|
852 | var that = anObject(this);
|
853 | var result = '';
|
854 | if (that.global) result += 'g';
|
855 | if (that.ignoreCase) result += 'i';
|
856 | if (that.multiline) result += 'm';
|
857 | if (that.dotAll) result += 's';
|
858 | if (that.unicode) result += 'u';
|
859 | if (that.sticky) result += 'y';
|
860 | return result;
|
861 | };
|
862 |
|
863 | var nativeExec = RegExp.prototype.exec;
|
864 |
|
865 |
|
866 |
|
867 | var nativeReplace = String.prototype.replace;
|
868 |
|
869 | var patchedExec = nativeExec;
|
870 |
|
871 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
872 | var re1 = /a/;
|
873 | var re2 = /b*/g;
|
874 | nativeExec.call(re1, 'a');
|
875 | nativeExec.call(re2, 'a');
|
876 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
877 | })();
|
878 |
|
879 |
|
880 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
881 |
|
882 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
883 |
|
884 | if (PATCH) {
|
885 | patchedExec = function exec(str) {
|
886 | var re = this;
|
887 | var lastIndex, reCopy, match, i;
|
888 |
|
889 | if (NPCG_INCLUDED) {
|
890 | reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
|
891 | }
|
892 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
893 |
|
894 | match = nativeExec.call(re, str);
|
895 |
|
896 | if (UPDATES_LAST_INDEX_WRONG && match) {
|
897 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
898 | }
|
899 | if (NPCG_INCLUDED && match && match.length > 1) {
|
900 |
|
901 |
|
902 | nativeReplace.call(match[0], reCopy, function () {
|
903 | for (i = 1; i < arguments.length - 2; i++) {
|
904 | if (arguments[i] === undefined) match[i] = undefined;
|
905 | }
|
906 | });
|
907 | }
|
908 |
|
909 | return match;
|
910 | };
|
911 | }
|
912 |
|
913 | var regexpExec = patchedExec;
|
914 |
|
915 | var SPECIES$2 = wellKnownSymbol('species');
|
916 |
|
917 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
918 |
|
919 |
|
920 |
|
921 | var re = /./;
|
922 | re.exec = function () {
|
923 | var result = [];
|
924 | result.groups = { a: '7' };
|
925 | return result;
|
926 | };
|
927 | return ''.replace(re, '$<a>') !== '7';
|
928 | });
|
929 |
|
930 |
|
931 |
|
932 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
933 | var re = /(?:)/;
|
934 | var originalExec = re.exec;
|
935 | re.exec = function () { return originalExec.apply(this, arguments); };
|
936 | var result = 'ab'.split(re);
|
937 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
938 | });
|
939 |
|
940 | var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
941 | var SYMBOL = wellKnownSymbol(KEY);
|
942 |
|
943 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
944 |
|
945 | var O = {};
|
946 | O[SYMBOL] = function () { return 7; };
|
947 | return ''[KEY](O) != 7;
|
948 | });
|
949 |
|
950 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
951 |
|
952 | var execCalled = false;
|
953 | var re = /a/;
|
954 | re.exec = function () { execCalled = true; return null; };
|
955 |
|
956 | if (KEY === 'split') {
|
957 |
|
958 |
|
959 | re.constructor = {};
|
960 | re.constructor[SPECIES$2] = function () { return re; };
|
961 | }
|
962 |
|
963 | re[SYMBOL]('');
|
964 | return !execCalled;
|
965 | });
|
966 |
|
967 | if (
|
968 | !DELEGATES_TO_SYMBOL ||
|
969 | !DELEGATES_TO_EXEC ||
|
970 | (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
971 | (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
972 | ) {
|
973 | var nativeRegExpMethod = /./[SYMBOL];
|
974 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
975 | if (regexp.exec === regexpExec) {
|
976 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
977 |
|
978 |
|
979 |
|
980 | return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
981 | }
|
982 | return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
983 | }
|
984 | return { done: false };
|
985 | });
|
986 | var stringMethod = methods[0];
|
987 | var regexMethod = methods[1];
|
988 |
|
989 | redefine(String.prototype, KEY, stringMethod);
|
990 | redefine(RegExp.prototype, SYMBOL, length == 2
|
991 |
|
992 |
|
993 | ? function (string, arg) { return regexMethod.call(string, this, arg); }
|
994 |
|
995 |
|
996 | : function (string) { return regexMethod.call(string, this); }
|
997 | );
|
998 | if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
999 | }
|
1000 | };
|
1001 |
|
1002 |
|
1003 | var createMethod$2 = function (CONVERT_TO_STRING) {
|
1004 | return function ($this, pos) {
|
1005 | var S = String(requireObjectCoercible($this));
|
1006 | var position = toInteger(pos);
|
1007 | var size = S.length;
|
1008 | var first, second;
|
1009 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1010 | first = S.charCodeAt(position);
|
1011 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1012 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1013 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
1014 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1015 | };
|
1016 | };
|
1017 |
|
1018 | var stringMultibyte = {
|
1019 |
|
1020 |
|
1021 | codeAt: createMethod$2(false),
|
1022 |
|
1023 |
|
1024 | charAt: createMethod$2(true)
|
1025 | };
|
1026 |
|
1027 | var charAt = stringMultibyte.charAt;
|
1028 |
|
1029 |
|
1030 |
|
1031 | var advanceStringIndex = function (S, index, unicode) {
|
1032 | return index + (unicode ? charAt(S, index).length : 1);
|
1033 | };
|
1034 |
|
1035 |
|
1036 |
|
1037 | var regexpExecAbstract = function (R, S) {
|
1038 | var exec = R.exec;
|
1039 | if (typeof exec === 'function') {
|
1040 | var result = exec.call(R, S);
|
1041 | if (typeof result !== 'object') {
|
1042 | throw TypeError('RegExp exec method returned something other than an Object or null');
|
1043 | }
|
1044 | return result;
|
1045 | }
|
1046 |
|
1047 | if (classofRaw(R) !== 'RegExp') {
|
1048 | throw TypeError('RegExp#exec called on incompatible receiver');
|
1049 | }
|
1050 |
|
1051 | return regexpExec.call(R, S);
|
1052 | };
|
1053 |
|
1054 | var max$1 = Math.max;
|
1055 | var min$2 = Math.min;
|
1056 | var floor$1 = Math.floor;
|
1057 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
1058 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
1059 |
|
1060 | var maybeToString = function (it) {
|
1061 | return it === undefined ? it : String(it);
|
1062 | };
|
1063 |
|
1064 |
|
1065 | fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
|
1066 | return [
|
1067 |
|
1068 |
|
1069 | function replace(searchValue, replaceValue) {
|
1070 | var O = requireObjectCoercible(this);
|
1071 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
1072 | return replacer !== undefined
|
1073 | ? replacer.call(searchValue, O, replaceValue)
|
1074 | : nativeReplace.call(String(O), searchValue, replaceValue);
|
1075 | },
|
1076 |
|
1077 |
|
1078 | function (regexp, replaceValue) {
|
1079 | var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
1080 | if (res.done) return res.value;
|
1081 |
|
1082 | var rx = anObject(regexp);
|
1083 | var S = String(this);
|
1084 |
|
1085 | var functionalReplace = typeof replaceValue === 'function';
|
1086 | if (!functionalReplace) replaceValue = String(replaceValue);
|
1087 |
|
1088 | var global = rx.global;
|
1089 | if (global) {
|
1090 | var fullUnicode = rx.unicode;
|
1091 | rx.lastIndex = 0;
|
1092 | }
|
1093 | var results = [];
|
1094 | while (true) {
|
1095 | var result = regexpExecAbstract(rx, S);
|
1096 | if (result === null) break;
|
1097 |
|
1098 | results.push(result);
|
1099 | if (!global) break;
|
1100 |
|
1101 | var matchStr = String(result[0]);
|
1102 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
1103 | }
|
1104 |
|
1105 | var accumulatedResult = '';
|
1106 | var nextSourcePosition = 0;
|
1107 | for (var i = 0; i < results.length; i++) {
|
1108 | result = results[i];
|
1109 |
|
1110 | var matched = String(result[0]);
|
1111 | var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
1112 | var captures = [];
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
1119 | var namedCaptures = result.groups;
|
1120 | if (functionalReplace) {
|
1121 | var replacerArgs = [matched].concat(captures, position, S);
|
1122 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
1123 | var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
1124 | } else {
|
1125 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
1126 | }
|
1127 | if (position >= nextSourcePosition) {
|
1128 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
1129 | nextSourcePosition = position + matched.length;
|
1130 | }
|
1131 | }
|
1132 | return accumulatedResult + S.slice(nextSourcePosition);
|
1133 | }
|
1134 | ];
|
1135 |
|
1136 |
|
1137 | function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
1138 | var tailPos = position + matched.length;
|
1139 | var m = captures.length;
|
1140 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
1141 | if (namedCaptures !== undefined) {
|
1142 | namedCaptures = toObject(namedCaptures);
|
1143 | symbols = SUBSTITUTION_SYMBOLS;
|
1144 | }
|
1145 | return nativeReplace.call(replacement, symbols, function (match, ch) {
|
1146 | var capture;
|
1147 | switch (ch.charAt(0)) {
|
1148 | case '$': return '$';
|
1149 | case '&': return matched;
|
1150 | case '`': return str.slice(0, position);
|
1151 | case "'": return str.slice(tailPos);
|
1152 | case '<':
|
1153 | capture = namedCaptures[ch.slice(1, -1)];
|
1154 | break;
|
1155 | default:
|
1156 | var n = +ch;
|
1157 | if (n === 0) return match;
|
1158 | if (n > m) {
|
1159 | var f = floor$1(n / 10);
|
1160 | if (f === 0) return match;
|
1161 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
1162 | return match;
|
1163 | }
|
1164 | capture = captures[n - 1];
|
1165 | }
|
1166 | return capture === undefined ? '' : capture;
|
1167 | });
|
1168 | }
|
1169 | });
|
1170 |
|
1171 |
|
1172 |
|
1173 | var sameValue = Object.is || function is(x, y) {
|
1174 |
|
1175 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
1176 | };
|
1177 |
|
1178 |
|
1179 | fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
1180 | return [
|
1181 |
|
1182 |
|
1183 | function search(regexp) {
|
1184 | var O = requireObjectCoercible(this);
|
1185 | var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
1186 | return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
1187 | },
|
1188 |
|
1189 |
|
1190 | function (regexp) {
|
1191 | var res = maybeCallNative(nativeSearch, regexp, this);
|
1192 | if (res.done) return res.value;
|
1193 |
|
1194 | var rx = anObject(regexp);
|
1195 | var S = String(this);
|
1196 |
|
1197 | var previousLastIndex = rx.lastIndex;
|
1198 | if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
1199 | var result = regexpExecAbstract(rx, S);
|
1200 | if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
1201 | return result === null ? -1 : result.index;
|
1202 | }
|
1203 | ];
|
1204 | });
|
1205 |
|
1206 | var MATCH = wellKnownSymbol('match');
|
1207 |
|
1208 |
|
1209 |
|
1210 | var isRegexp = function (it) {
|
1211 | var isRegExp;
|
1212 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
1213 | };
|
1214 |
|
1215 | var SPECIES$3 = wellKnownSymbol('species');
|
1216 |
|
1217 |
|
1218 |
|
1219 | var speciesConstructor = function (O, defaultConstructor) {
|
1220 | var C = anObject(O).constructor;
|
1221 | var S;
|
1222 | return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction$1(S);
|
1223 | };
|
1224 |
|
1225 | var arrayPush = [].push;
|
1226 | var min$3 = Math.min;
|
1227 | var MAX_UINT32 = 0xFFFFFFFF;
|
1228 |
|
1229 |
|
1230 | var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
1231 |
|
1232 |
|
1233 | fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
1234 | var internalSplit;
|
1235 | if (
|
1236 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
1237 | 'test'.split(/(?:)/, -1).length != 4 ||
|
1238 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
1239 | '.'.split(/(.?)(.?)/).length != 4 ||
|
1240 | '.'.split(/()()/).length > 1 ||
|
1241 | ''.split(/.?/).length
|
1242 | ) {
|
1243 |
|
1244 | internalSplit = function (separator, limit) {
|
1245 | var string = String(requireObjectCoercible(this));
|
1246 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1247 | if (lim === 0) return [];
|
1248 | if (separator === undefined) return [string];
|
1249 |
|
1250 | if (!isRegexp(separator)) {
|
1251 | return nativeSplit.call(string, separator, lim);
|
1252 | }
|
1253 | var output = [];
|
1254 | var flags = (separator.ignoreCase ? 'i' : '') +
|
1255 | (separator.multiline ? 'm' : '') +
|
1256 | (separator.unicode ? 'u' : '') +
|
1257 | (separator.sticky ? 'y' : '');
|
1258 | var lastLastIndex = 0;
|
1259 |
|
1260 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
1261 | var match, lastIndex, lastLength;
|
1262 | while (match = regexpExec.call(separatorCopy, string)) {
|
1263 | lastIndex = separatorCopy.lastIndex;
|
1264 | if (lastIndex > lastLastIndex) {
|
1265 | output.push(string.slice(lastLastIndex, match.index));
|
1266 | if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
1267 | lastLength = match[0].length;
|
1268 | lastLastIndex = lastIndex;
|
1269 | if (output.length >= lim) break;
|
1270 | }
|
1271 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
1272 | }
|
1273 | if (lastLastIndex === string.length) {
|
1274 | if (lastLength || !separatorCopy.test('')) output.push('');
|
1275 | } else output.push(string.slice(lastLastIndex));
|
1276 | return output.length > lim ? output.slice(0, lim) : output;
|
1277 | };
|
1278 |
|
1279 | } else if ('0'.split(undefined, 0).length) {
|
1280 | internalSplit = function (separator, limit) {
|
1281 | return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
1282 | };
|
1283 | } else internalSplit = nativeSplit;
|
1284 |
|
1285 | return [
|
1286 |
|
1287 |
|
1288 | function split(separator, limit) {
|
1289 | var O = requireObjectCoercible(this);
|
1290 | var splitter = separator == undefined ? undefined : separator[SPLIT];
|
1291 | return splitter !== undefined
|
1292 | ? splitter.call(separator, O, limit)
|
1293 | : internalSplit.call(String(O), separator, limit);
|
1294 | },
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 | function (regexp, limit) {
|
1301 | var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
1302 | if (res.done) return res.value;
|
1303 |
|
1304 | var rx = anObject(regexp);
|
1305 | var S = String(this);
|
1306 | var C = speciesConstructor(rx, RegExp);
|
1307 |
|
1308 | var unicodeMatching = rx.unicode;
|
1309 | var flags = (rx.ignoreCase ? 'i' : '') +
|
1310 | (rx.multiline ? 'm' : '') +
|
1311 | (rx.unicode ? 'u' : '') +
|
1312 | (SUPPORTS_Y ? 'y' : 'g');
|
1313 |
|
1314 |
|
1315 |
|
1316 | var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
1317 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1318 | if (lim === 0) return [];
|
1319 | if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
|
1320 | var p = 0;
|
1321 | var q = 0;
|
1322 | var A = [];
|
1323 | while (q < S.length) {
|
1324 | splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
1325 | var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
|
1326 | var e;
|
1327 | if (
|
1328 | z === null ||
|
1329 | (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
1330 | ) {
|
1331 | q = advanceStringIndex(S, q, unicodeMatching);
|
1332 | } else {
|
1333 | A.push(S.slice(p, q));
|
1334 | if (A.length === lim) return A;
|
1335 | for (var i = 1; i <= z.length - 1; i++) {
|
1336 | A.push(z[i]);
|
1337 | if (A.length === lim) return A;
|
1338 | }
|
1339 | q = p = e;
|
1340 | }
|
1341 | }
|
1342 | A.push(S.slice(p));
|
1343 | return A;
|
1344 | }
|
1345 | ];
|
1346 | }, !SUPPORTS_Y);
|
1347 |
|
1348 | function _classCallCheck(instance, Constructor) {
|
1349 | if (!(instance instanceof Constructor)) {
|
1350 | throw new TypeError("Cannot call a class as a function");
|
1351 | }
|
1352 | }
|
1353 |
|
1354 | function _defineProperties(target, props) {
|
1355 | for (var i = 0; i < props.length; i++) {
|
1356 | var descriptor = props[i];
|
1357 | descriptor.enumerable = descriptor.enumerable || false;
|
1358 | descriptor.configurable = true;
|
1359 | if ("value" in descriptor) descriptor.writable = true;
|
1360 | Object.defineProperty(target, descriptor.key, descriptor);
|
1361 | }
|
1362 | }
|
1363 |
|
1364 | function _createClass(Constructor, protoProps, staticProps) {
|
1365 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1366 | if (staticProps) _defineProperties(Constructor, staticProps);
|
1367 | return Constructor;
|
1368 | }
|
1369 |
|
1370 | function _inherits(subClass, superClass) {
|
1371 | if (typeof superClass !== "function" && superClass !== null) {
|
1372 | throw new TypeError("Super expression must either be null or a function");
|
1373 | }
|
1374 |
|
1375 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1376 | constructor: {
|
1377 | value: subClass,
|
1378 | writable: true,
|
1379 | configurable: true
|
1380 | }
|
1381 | });
|
1382 | if (superClass) _setPrototypeOf(subClass, superClass);
|
1383 | }
|
1384 |
|
1385 | function _getPrototypeOf(o) {
|
1386 | _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1387 | return o.__proto__ || Object.getPrototypeOf(o);
|
1388 | };
|
1389 | return _getPrototypeOf(o);
|
1390 | }
|
1391 |
|
1392 | function _setPrototypeOf(o, p) {
|
1393 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1394 | o.__proto__ = p;
|
1395 | return o;
|
1396 | };
|
1397 |
|
1398 | return _setPrototypeOf(o, p);
|
1399 | }
|
1400 |
|
1401 | function _assertThisInitialized(self) {
|
1402 | if (self === void 0) {
|
1403 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1404 | }
|
1405 |
|
1406 | return self;
|
1407 | }
|
1408 |
|
1409 | function _possibleConstructorReturn(self, call) {
|
1410 | if (call && (typeof call === "object" || typeof call === "function")) {
|
1411 | return call;
|
1412 | }
|
1413 |
|
1414 | return _assertThisInitialized(self);
|
1415 | }
|
1416 |
|
1417 | function _superPropBase(object, property) {
|
1418 | while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1419 | object = _getPrototypeOf(object);
|
1420 | if (object === null) break;
|
1421 | }
|
1422 |
|
1423 | return object;
|
1424 | }
|
1425 |
|
1426 | function _get(target, property, receiver) {
|
1427 | if (typeof Reflect !== "undefined" && Reflect.get) {
|
1428 | _get = Reflect.get;
|
1429 | } else {
|
1430 | _get = function _get(target, property, receiver) {
|
1431 | var base = _superPropBase(target, property);
|
1432 |
|
1433 | if (!base) return;
|
1434 | var desc = Object.getOwnPropertyDescriptor(base, property);
|
1435 |
|
1436 | if (desc.get) {
|
1437 | return desc.get.call(receiver);
|
1438 | }
|
1439 |
|
1440 | return desc.value;
|
1441 | };
|
1442 | }
|
1443 |
|
1444 | return _get(target, property, receiver || target);
|
1445 | }
|
1446 |
|
1447 | |
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 |
|
1453 | var UtilsCookie = {
|
1454 | cookieIds: {
|
1455 | sortOrder: 'bs.table.sortOrder',
|
1456 | sortName: 'bs.table.sortName',
|
1457 | pageNumber: 'bs.table.pageNumber',
|
1458 | pageList: 'bs.table.pageList',
|
1459 | columns: 'bs.table.columns',
|
1460 | searchText: 'bs.table.searchText',
|
1461 | filterControl: 'bs.table.filterControl',
|
1462 | filterBy: 'bs.table.filterBy'
|
1463 | },
|
1464 | getCurrentHeader: function getCurrentHeader(that) {
|
1465 | var header = that.$header;
|
1466 |
|
1467 | if (that.options.height) {
|
1468 | header = that.$tableHeader;
|
1469 | }
|
1470 |
|
1471 | return header;
|
1472 | },
|
1473 | getCurrentSearchControls: function getCurrentSearchControls(that) {
|
1474 | var searchControls = 'select, input';
|
1475 |
|
1476 | if (that.options.height) {
|
1477 | searchControls = 'table select, table input';
|
1478 | }
|
1479 |
|
1480 | return searchControls;
|
1481 | },
|
1482 | cookieEnabled: function cookieEnabled() {
|
1483 | return !!navigator.cookieEnabled;
|
1484 | },
|
1485 | inArrayCookiesEnabled: function inArrayCookiesEnabled(cookieName, cookiesEnabled) {
|
1486 | var index = -1;
|
1487 |
|
1488 | for (var i = 0; i < cookiesEnabled.length; i++) {
|
1489 | if (cookieName.toLowerCase() === cookiesEnabled[i].toLowerCase()) {
|
1490 | index = i;
|
1491 | break;
|
1492 | }
|
1493 | }
|
1494 |
|
1495 | return index;
|
1496 | },
|
1497 | setCookie: function setCookie(that, cookieName, cookieValue) {
|
1498 | if (!that.options.cookie || !UtilsCookie.cookieEnabled() || that.options.cookieIdTable === '') {
|
1499 | return;
|
1500 | }
|
1501 |
|
1502 | if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
|
1503 | return;
|
1504 | }
|
1505 |
|
1506 | cookieName = "".concat(that.options.cookieIdTable, ".").concat(cookieName);
|
1507 |
|
1508 | switch (that.options.cookieStorage) {
|
1509 | case 'cookieStorage':
|
1510 | document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : ''].join('');
|
1511 | break;
|
1512 |
|
1513 | case 'localStorage':
|
1514 | localStorage.setItem(cookieName, cookieValue);
|
1515 | break;
|
1516 |
|
1517 | case 'sessionStorage':
|
1518 | sessionStorage.setItem(cookieName, cookieValue);
|
1519 | break;
|
1520 |
|
1521 | default:
|
1522 | return false;
|
1523 | }
|
1524 |
|
1525 | return true;
|
1526 | },
|
1527 | getCookie: function getCookie(that, tableName, cookieName) {
|
1528 | if (!cookieName) {
|
1529 | return null;
|
1530 | }
|
1531 |
|
1532 | if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
|
1533 | return null;
|
1534 | }
|
1535 |
|
1536 | cookieName = "".concat(tableName, ".").concat(cookieName);
|
1537 |
|
1538 | switch (that.options.cookieStorage) {
|
1539 | case 'cookieStorage':
|
1540 | var value = "; ".concat(document.cookie);
|
1541 | var parts = value.split("; ".concat(cookieName, "="));
|
1542 | return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
|
1543 |
|
1544 | case 'localStorage':
|
1545 | return localStorage.getItem(cookieName);
|
1546 |
|
1547 | case 'sessionStorage':
|
1548 | return sessionStorage.getItem(cookieName);
|
1549 |
|
1550 | default:
|
1551 | return null;
|
1552 | }
|
1553 | },
|
1554 | deleteCookie: function deleteCookie(that, tableName, cookieName) {
|
1555 | cookieName = "".concat(tableName, ".").concat(cookieName);
|
1556 |
|
1557 | switch (that.options.cookieStorage) {
|
1558 | case 'cookieStorage':
|
1559 | document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : ''].join('');
|
1560 | break;
|
1561 |
|
1562 | case 'localStorage':
|
1563 | localStorage.removeItem(cookieName);
|
1564 | break;
|
1565 |
|
1566 | case 'sessionStorage':
|
1567 | sessionStorage.removeItem(cookieName);
|
1568 | break;
|
1569 |
|
1570 | default:
|
1571 | return false;
|
1572 | }
|
1573 |
|
1574 | return true;
|
1575 | },
|
1576 | calculateExpiration: function calculateExpiration(cookieExpire) {
|
1577 | var time = cookieExpire.replace(/[0-9]*/, '');
|
1578 |
|
1579 | cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, '');
|
1580 |
|
1581 | switch (time.toLowerCase()) {
|
1582 | case 's':
|
1583 | cookieExpire = +cookieExpire;
|
1584 | break;
|
1585 |
|
1586 | case 'mi':
|
1587 | cookieExpire *= 60;
|
1588 | break;
|
1589 |
|
1590 | case 'h':
|
1591 | cookieExpire = cookieExpire * 60 * 60;
|
1592 | break;
|
1593 |
|
1594 | case 'd':
|
1595 | cookieExpire = cookieExpire * 24 * 60 * 60;
|
1596 | break;
|
1597 |
|
1598 | case 'm':
|
1599 | cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
|
1600 | break;
|
1601 |
|
1602 | case 'y':
|
1603 | cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
|
1604 | break;
|
1605 |
|
1606 | default:
|
1607 | cookieExpire = undefined;
|
1608 | break;
|
1609 | }
|
1610 |
|
1611 | if (!cookieExpire) {
|
1612 | return '';
|
1613 | }
|
1614 |
|
1615 | var d = new Date();
|
1616 | d.setTime(d.getTime() + cookieExpire * 1000);
|
1617 | return d.toGMTString();
|
1618 | },
|
1619 | initCookieFilters: function initCookieFilters(bootstrapTable) {
|
1620 | setTimeout(function () {
|
1621 | var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
|
1622 |
|
1623 | if (!bootstrapTable.options.filterControlValuesLoaded && parsedCookieFilters) {
|
1624 | var cachedFilters = {};
|
1625 | var header = UtilsCookie.getCurrentHeader(bootstrapTable);
|
1626 | var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
|
1627 |
|
1628 | var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
|
1629 | $(filteredCookies).each(function (i, cookie) {
|
1630 | if (cookie.text !== '') {
|
1631 | $(element).val(cookie.text);
|
1632 | cachedFilters[cookie.field] = cookie.text;
|
1633 | }
|
1634 | });
|
1635 | };
|
1636 |
|
1637 | header.find(searchControls).each(function () {
|
1638 | var field = $(this).closest('[data-field]').data('field');
|
1639 | var filteredCookies = parsedCookieFilters.filter(function (cookie) {
|
1640 | return cookie.field === field;
|
1641 | });
|
1642 | applyCookieFilters(this, filteredCookies);
|
1643 | });
|
1644 | bootstrapTable.initColumnSearch(cachedFilters);
|
1645 | bootstrapTable.options.filterControlValuesLoaded = true;
|
1646 | bootstrapTable.initServer();
|
1647 | }
|
1648 | }, 250);
|
1649 | }
|
1650 | };
|
1651 | $.extend($.fn.bootstrapTable.defaults, {
|
1652 | cookie: false,
|
1653 | cookieExpire: '2h',
|
1654 | cookiePath: null,
|
1655 | cookieDomain: null,
|
1656 | cookieSecure: null,
|
1657 | cookieIdTable: '',
|
1658 | cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy'],
|
1659 | cookieStorage: 'cookieStorage',
|
1660 |
|
1661 |
|
1662 | filterControls: [],
|
1663 | filterControlValuesLoaded: false
|
1664 | });
|
1665 | $.fn.bootstrapTable.methods.push('getCookies');
|
1666 | $.fn.bootstrapTable.methods.push('deleteCookie');
|
1667 | $.extend($.fn.bootstrapTable.utils, {
|
1668 | setCookie: UtilsCookie.setCookie,
|
1669 | getCookie: UtilsCookie.getCookie
|
1670 | });
|
1671 |
|
1672 | $.BootstrapTable =
|
1673 |
|
1674 | function (_$$BootstrapTable) {
|
1675 | _inherits(_class, _$$BootstrapTable);
|
1676 |
|
1677 | function _class() {
|
1678 | _classCallCheck(this, _class);
|
1679 |
|
1680 | return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
|
1681 | }
|
1682 |
|
1683 | _createClass(_class, [{
|
1684 | key: "init",
|
1685 | value: function init() {
|
1686 |
|
1687 | var filterByCookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterBy));
|
1688 | this.filterColumns = filterByCookie ? filterByCookie : {};
|
1689 |
|
1690 | this.options.filterControls = [];
|
1691 | this.options.filterControlValuesLoaded = false;
|
1692 | this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
|
1693 |
|
1694 | if (this.options.filterControl) {
|
1695 | var that = this;
|
1696 | this.$el.on('column-search.bs.table', function (e, field, text) {
|
1697 | var isNewField = true;
|
1698 |
|
1699 | for (var i = 0; i < that.options.filterControls.length; i++) {
|
1700 | if (that.options.filterControls[i].field === field) {
|
1701 | that.options.filterControls[i].text = text;
|
1702 | isNewField = false;
|
1703 | break;
|
1704 | }
|
1705 | }
|
1706 |
|
1707 | if (isNewField) {
|
1708 | that.options.filterControls.push({
|
1709 | field: field,
|
1710 | text: text
|
1711 | });
|
1712 | }
|
1713 |
|
1714 | UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that.options.filterControls));
|
1715 | }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
|
1716 | }
|
1717 |
|
1718 | _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
|
1719 | }
|
1720 | }, {
|
1721 | key: "initServer",
|
1722 | value: function initServer() {
|
1723 | var _get2;
|
1724 |
|
1725 | if (this.options.cookie && this.options.filterControl && !this.options.filterControlValuesLoaded) {
|
1726 | var cookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
|
1727 |
|
1728 | if (cookie) {
|
1729 | return;
|
1730 | }
|
1731 | }
|
1732 |
|
1733 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1734 | args[_key] = arguments[_key];
|
1735 | }
|
1736 |
|
1737 | (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
|
1738 | }
|
1739 | }, {
|
1740 | key: "initTable",
|
1741 | value: function initTable() {
|
1742 | var _get3;
|
1743 |
|
1744 | for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
1745 | args[_key2] = arguments[_key2];
|
1746 | }
|
1747 |
|
1748 | (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
|
1749 |
|
1750 | this.initCookie();
|
1751 | }
|
1752 | }, {
|
1753 | key: "onSort",
|
1754 | value: function onSort() {
|
1755 | var _get4;
|
1756 |
|
1757 | for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
1758 | args[_key3] = arguments[_key3];
|
1759 | }
|
1760 |
|
1761 | (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
|
1762 |
|
1763 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
|
1764 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
|
1765 | }
|
1766 | }, {
|
1767 | key: "onPageNumber",
|
1768 | value: function onPageNumber() {
|
1769 | var _get5;
|
1770 |
|
1771 | for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
1772 | args[_key4] = arguments[_key4];
|
1773 | }
|
1774 |
|
1775 | (_get5 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get5, [this].concat(args));
|
1776 |
|
1777 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
1778 | }
|
1779 | }, {
|
1780 | key: "onPageListChange",
|
1781 | value: function onPageListChange() {
|
1782 | var _get6;
|
1783 |
|
1784 | for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
1785 | args[_key5] = arguments[_key5];
|
1786 | }
|
1787 |
|
1788 | (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get6, [this].concat(args));
|
1789 |
|
1790 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
|
1791 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
1792 | }
|
1793 | }, {
|
1794 | key: "onPagePre",
|
1795 | value: function onPagePre() {
|
1796 | var _get7;
|
1797 |
|
1798 | for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
1799 | args[_key6] = arguments[_key6];
|
1800 | }
|
1801 |
|
1802 | (_get7 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get7, [this].concat(args));
|
1803 |
|
1804 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
1805 | }
|
1806 | }, {
|
1807 | key: "onPageNext",
|
1808 | value: function onPageNext() {
|
1809 | var _get8;
|
1810 |
|
1811 | for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
1812 | args[_key7] = arguments[_key7];
|
1813 | }
|
1814 |
|
1815 | (_get8 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get8, [this].concat(args));
|
1816 |
|
1817 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
1818 | }
|
1819 | }, {
|
1820 | key: "_toggleColumn",
|
1821 | value: function _toggleColumn() {
|
1822 | var _get9;
|
1823 |
|
1824 | for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
1825 | args[_key8] = arguments[_key8];
|
1826 | }
|
1827 |
|
1828 | (_get9 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get9, [this].concat(args));
|
1829 |
|
1830 | var visibleColumns = [];
|
1831 | $.each(this.columns, function (i, column) {
|
1832 | if (column.visible) {
|
1833 | visibleColumns.push(column.field);
|
1834 | }
|
1835 | });
|
1836 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(visibleColumns));
|
1837 | }
|
1838 | }, {
|
1839 | key: "selectPage",
|
1840 | value: function selectPage(page) {
|
1841 | _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
|
1842 |
|
1843 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
|
1844 | }
|
1845 | }, {
|
1846 | key: "onSearch",
|
1847 | value: function onSearch(event) {
|
1848 | _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event);
|
1849 |
|
1850 | if (this.options.search) {
|
1851 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
|
1852 | }
|
1853 |
|
1854 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
1855 | }
|
1856 | }, {
|
1857 | key: "filterBy",
|
1858 | value: function filterBy() {
|
1859 | var _get10;
|
1860 |
|
1861 | for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
1862 | args[_key9] = arguments[_key9];
|
1863 | }
|
1864 |
|
1865 | (_get10 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get10, [this].concat(args));
|
1866 |
|
1867 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
|
1868 | }
|
1869 | }, {
|
1870 | key: "initCookie",
|
1871 | value: function initCookie() {
|
1872 | if (!this.options.cookie) {
|
1873 | return;
|
1874 | }
|
1875 |
|
1876 | if (this.options.cookieIdTable === '' || this.options.cookieExpire === '' || !UtilsCookie.cookieEnabled()) {
|
1877 | console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
|
1878 | this.options.cookie = false;
|
1879 |
|
1880 | return;
|
1881 | }
|
1882 |
|
1883 | var sortOrderCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
|
1884 | var sortOrderNameCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
|
1885 | var pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber);
|
1886 | var pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList);
|
1887 | var columnsCookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns));
|
1888 | var searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText);
|
1889 |
|
1890 | this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder;
|
1891 |
|
1892 | this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
|
1893 |
|
1894 | this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber;
|
1895 |
|
1896 | this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize;
|
1897 |
|
1898 | this.options.searchText = searchTextCookie ? searchTextCookie : '';
|
1899 |
|
1900 | if (columnsCookie) {
|
1901 | $.each(this.columns, function (i, column) {
|
1902 | column.visible = $.inArray(column.field, columnsCookie) !== -1;
|
1903 | });
|
1904 | }
|
1905 | }
|
1906 | }, {
|
1907 | key: "getCookies",
|
1908 | value: function getCookies() {
|
1909 | var bootstrapTable = this;
|
1910 | var cookies = {};
|
1911 | $.each(UtilsCookie.cookieIds, function (key, value) {
|
1912 | cookies[key] = UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, value);
|
1913 |
|
1914 | if (key === 'columns') {
|
1915 | cookies[key] = JSON.parse(cookies[key]);
|
1916 | }
|
1917 | });
|
1918 | return cookies;
|
1919 | }
|
1920 | }, {
|
1921 | key: "deleteCookie",
|
1922 | value: function deleteCookie(cookieName) {
|
1923 | if (cookieName === '' || !UtilsCookie.cookieEnabled()) {
|
1924 | return;
|
1925 | }
|
1926 |
|
1927 | UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds[cookieName]);
|
1928 | }
|
1929 | }]);
|
1930 |
|
1931 | return _class;
|
1932 | }($.BootstrapTable);
|
1933 |
|
1934 | }));
|