bootstrap-table-rails 1.15.5 → 1.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +143 -36
- data/lib/bootstrap-table-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +1012 -83
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +684 -208
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +686 -210
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +75 -12
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +1617 -763
- data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +280 -93
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +200 -78
- data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1349 -258
- data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +216 -77
- data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +1198 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +83 -42
- data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +1219 -208
- data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +458 -204
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.css +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +1420 -901
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/utils.js +2361 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.css +12 -14
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +589 -423
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css +3 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +552 -487
- data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +3 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +219 -74
- data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +143 -66
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +326 -462
- data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +137 -65
- data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +87 -42
- data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +452 -155
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +643 -255
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +348 -136
- data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +84 -44
- data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +218 -76
- data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +558 -217
- data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +221 -115
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +777 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +120 -63
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +99 -43
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +113 -57
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +99 -43
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +102 -45
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +98 -42
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +776 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.js +1049 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.eot +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.svg +28 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.ttf +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.woff +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +89 -13
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +161 -63
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +88 -15
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +166 -65
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +83 -11
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +164 -66
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +89 -15
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +164 -66
- metadata +10 -5
- data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +0 -1757
- data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.css +0 -12
- data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.js +0 -2087
- data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +0 -1265
@@ -2,9 +2,9 @@
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
|
3
3
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4
4
|
(global = global || self, factory(global.jQuery));
|
5
|
-
}(this, function ($) { 'use strict';
|
5
|
+
}(this, (function ($) { 'use strict';
|
6
6
|
|
7
|
-
$ = $ &&
|
7
|
+
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
8
8
|
|
9
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10
10
|
|
@@ -12,7 +12,6 @@
|
|
12
12
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
13
13
|
}
|
14
14
|
|
15
|
-
var O = 'object';
|
16
15
|
var check = function (it) {
|
17
16
|
return it && it.Math == Math && it;
|
18
17
|
};
|
@@ -20,10 +19,10 @@
|
|
20
19
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
21
20
|
var global_1 =
|
22
21
|
// eslint-disable-next-line no-undef
|
23
|
-
check(typeof globalThis ==
|
24
|
-
check(typeof window ==
|
25
|
-
check(typeof self ==
|
26
|
-
check(typeof commonjsGlobal ==
|
22
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
23
|
+
check(typeof window == 'object' && window) ||
|
24
|
+
check(typeof self == 'object' && self) ||
|
25
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
27
26
|
// eslint-disable-next-line no-new-func
|
28
27
|
Function('return this')();
|
29
28
|
|
@@ -121,12 +120,12 @@
|
|
121
120
|
return hasOwnProperty.call(it, key);
|
122
121
|
};
|
123
122
|
|
124
|
-
var document = global_1.document;
|
123
|
+
var document$1 = global_1.document;
|
125
124
|
// typeof document.createElement is 'object' in old IE
|
126
|
-
var EXISTS = isObject(document) && isObject(document.createElement);
|
125
|
+
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
127
126
|
|
128
127
|
var documentCreateElement = function (it) {
|
129
|
-
return EXISTS ? document.createElement(it) : {};
|
128
|
+
return EXISTS ? document$1.createElement(it) : {};
|
130
129
|
};
|
131
130
|
|
132
131
|
// Thank's IE8 for his funny defineProperty
|
@@ -179,7 +178,7 @@
|
|
179
178
|
f: f$2
|
180
179
|
};
|
181
180
|
|
182
|
-
var
|
181
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
183
182
|
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
184
183
|
} : function (object, key, value) {
|
185
184
|
object[key] = value;
|
@@ -188,31 +187,42 @@
|
|
188
187
|
|
189
188
|
var setGlobal = function (key, value) {
|
190
189
|
try {
|
191
|
-
|
190
|
+
createNonEnumerableProperty(global_1, key, value);
|
192
191
|
} catch (error) {
|
193
192
|
global_1[key] = value;
|
194
193
|
} return value;
|
195
194
|
};
|
196
195
|
|
197
|
-
var shared = createCommonjsModule(function (module) {
|
198
196
|
var SHARED = '__core-js_shared__';
|
199
197
|
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
200
198
|
|
199
|
+
var sharedStore = store;
|
200
|
+
|
201
|
+
var functionToString = Function.toString;
|
202
|
+
|
203
|
+
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
204
|
+
if (typeof sharedStore.inspectSource != 'function') {
|
205
|
+
sharedStore.inspectSource = function (it) {
|
206
|
+
return functionToString.call(it);
|
207
|
+
};
|
208
|
+
}
|
209
|
+
|
210
|
+
var inspectSource = sharedStore.inspectSource;
|
211
|
+
|
212
|
+
var WeakMap = global_1.WeakMap;
|
213
|
+
|
214
|
+
var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
215
|
+
|
216
|
+
var shared = createCommonjsModule(function (module) {
|
201
217
|
(module.exports = function (key, value) {
|
202
|
-
return
|
218
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
203
219
|
})('versions', []).push({
|
204
|
-
version: '3.
|
220
|
+
version: '3.6.0',
|
205
221
|
mode: 'global',
|
206
222
|
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
207
223
|
});
|
208
224
|
});
|
209
225
|
|
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
226
|
var id = 0;
|
217
227
|
var postfix = Math.random();
|
218
228
|
|
@@ -245,25 +255,25 @@
|
|
245
255
|
};
|
246
256
|
|
247
257
|
if (nativeWeakMap) {
|
248
|
-
var store = new WeakMap$1();
|
249
|
-
var wmget = store.get;
|
250
|
-
var wmhas = store.has;
|
251
|
-
var wmset = store.set;
|
258
|
+
var store$1 = new WeakMap$1();
|
259
|
+
var wmget = store$1.get;
|
260
|
+
var wmhas = store$1.has;
|
261
|
+
var wmset = store$1.set;
|
252
262
|
set = function (it, metadata) {
|
253
|
-
wmset.call(store, it, metadata);
|
263
|
+
wmset.call(store$1, it, metadata);
|
254
264
|
return metadata;
|
255
265
|
};
|
256
266
|
get = function (it) {
|
257
|
-
return wmget.call(store, it) || {};
|
267
|
+
return wmget.call(store$1, it) || {};
|
258
268
|
};
|
259
269
|
has$1 = function (it) {
|
260
|
-
return wmhas.call(store, it);
|
270
|
+
return wmhas.call(store$1, it);
|
261
271
|
};
|
262
272
|
} else {
|
263
273
|
var STATE = sharedKey('state');
|
264
274
|
hiddenKeys[STATE] = true;
|
265
275
|
set = function (it, metadata) {
|
266
|
-
|
276
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
267
277
|
return metadata;
|
268
278
|
};
|
269
279
|
get = function (it) {
|
@@ -285,18 +295,14 @@
|
|
285
295
|
var redefine = createCommonjsModule(function (module) {
|
286
296
|
var getInternalState = internalState.get;
|
287
297
|
var enforceInternalState = internalState.enforce;
|
288
|
-
var TEMPLATE = String(
|
289
|
-
|
290
|
-
shared('inspectSource', function (it) {
|
291
|
-
return functionToString.call(it);
|
292
|
-
});
|
298
|
+
var TEMPLATE = String(String).split('String');
|
293
299
|
|
294
300
|
(module.exports = function (O, key, value, options) {
|
295
301
|
var unsafe = options ? !!options.unsafe : false;
|
296
302
|
var simple = options ? !!options.enumerable : false;
|
297
303
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
298
304
|
if (typeof value == 'function') {
|
299
|
-
if (typeof key == 'string' && !has(value, 'name'))
|
305
|
+
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
300
306
|
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
301
307
|
}
|
302
308
|
if (O === global_1) {
|
@@ -309,10 +315,10 @@
|
|
309
315
|
simple = true;
|
310
316
|
}
|
311
317
|
if (simple) O[key] = value;
|
312
|
-
else
|
318
|
+
else createNonEnumerableProperty(O, key, value);
|
313
319
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
314
320
|
})(Function.prototype, 'toString', function toString() {
|
315
|
-
return typeof this == 'function' && getInternalState(this).source ||
|
321
|
+
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
316
322
|
});
|
317
323
|
});
|
318
324
|
|
@@ -349,7 +355,7 @@
|
|
349
355
|
|
350
356
|
// Helper for a popular repeating case of the spec:
|
351
357
|
// Let integer be ? ToInteger(index).
|
352
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(
|
358
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
353
359
|
var toAbsoluteIndex = function (index, length) {
|
354
360
|
var integer = toInteger(index);
|
355
361
|
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
@@ -513,7 +519,7 @@
|
|
513
519
|
}
|
514
520
|
// add a flag to not completely full polyfills
|
515
521
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
516
|
-
|
522
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
517
523
|
}
|
518
524
|
// extend global
|
519
525
|
redefine(target, key, sourceProperty, options);
|
@@ -544,12 +550,21 @@
|
|
544
550
|
return !String(Symbol());
|
545
551
|
});
|
546
552
|
|
553
|
+
var useSymbolAsUid = nativeSymbol
|
554
|
+
// eslint-disable-next-line no-undef
|
555
|
+
&& !Symbol.sham
|
556
|
+
// eslint-disable-next-line no-undef
|
557
|
+
&& typeof Symbol() == 'symbol';
|
558
|
+
|
559
|
+
var WellKnownSymbolsStore = shared('wks');
|
547
560
|
var Symbol$1 = global_1.Symbol;
|
548
|
-
var
|
561
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
|
549
562
|
|
550
563
|
var wellKnownSymbol = function (name) {
|
551
|
-
|
552
|
-
|
564
|
+
if (!has(WellKnownSymbolsStore, name)) {
|
565
|
+
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
566
|
+
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
567
|
+
} return WellKnownSymbolsStore[name];
|
553
568
|
};
|
554
569
|
|
555
570
|
var SPECIES = wellKnownSymbol('species');
|
@@ -569,10 +584,33 @@
|
|
569
584
|
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
570
585
|
};
|
571
586
|
|
587
|
+
var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
588
|
+
|
589
|
+
var process = global_1.process;
|
590
|
+
var versions = process && process.versions;
|
591
|
+
var v8 = versions && versions.v8;
|
592
|
+
var match, version;
|
593
|
+
|
594
|
+
if (v8) {
|
595
|
+
match = v8.split('.');
|
596
|
+
version = match[0] + match[1];
|
597
|
+
} else if (userAgent) {
|
598
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
599
|
+
if (!match || match[1] >= 74) {
|
600
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
601
|
+
if (match) version = match[1];
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
var v8Version = version && +version;
|
606
|
+
|
572
607
|
var SPECIES$1 = wellKnownSymbol('species');
|
573
608
|
|
574
609
|
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
575
|
-
|
610
|
+
// We can't use this feature detection in V8 since it causes
|
611
|
+
// deoptimization and serious performance degradation
|
612
|
+
// https://github.com/zloirock/core-js/issues/677
|
613
|
+
return v8Version >= 51 || !fails(function () {
|
576
614
|
var array = [];
|
577
615
|
var constructor = array.constructor = {};
|
578
616
|
constructor[SPECIES$1] = function () {
|
@@ -586,7 +624,10 @@
|
|
586
624
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
587
625
|
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
588
626
|
|
589
|
-
|
627
|
+
// We can't use this feature detection in V8 since it causes
|
628
|
+
// deoptimization and serious performance degradation
|
629
|
+
// https://github.com/zloirock/core-js/issues/679
|
630
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
590
631
|
var array = [];
|
591
632
|
array[IS_CONCAT_SPREADABLE] = false;
|
592
633
|
return array.concat()[0] !== array;
|
@@ -736,56 +777,87 @@
|
|
736
777
|
|
737
778
|
var html = getBuiltIn('document', 'documentElement');
|
738
779
|
|
780
|
+
var GT = '>';
|
781
|
+
var LT = '<';
|
782
|
+
var PROTOTYPE = 'prototype';
|
783
|
+
var SCRIPT = 'script';
|
739
784
|
var IE_PROTO = sharedKey('IE_PROTO');
|
740
785
|
|
741
|
-
var
|
742
|
-
|
786
|
+
var EmptyConstructor = function () { /* empty */ };
|
787
|
+
|
788
|
+
var scriptTag = function (content) {
|
789
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
790
|
+
};
|
791
|
+
|
792
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
793
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
794
|
+
activeXDocument.write(scriptTag(''));
|
795
|
+
activeXDocument.close();
|
796
|
+
var temp = activeXDocument.parentWindow.Object;
|
797
|
+
activeXDocument = null; // avoid memory leak
|
798
|
+
return temp;
|
799
|
+
};
|
743
800
|
|
744
801
|
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
745
|
-
var
|
802
|
+
var NullProtoObjectViaIFrame = function () {
|
746
803
|
// Thrash, waste and sodomy: IE GC bug
|
747
804
|
var iframe = documentCreateElement('iframe');
|
748
|
-
var
|
749
|
-
var lt = '<';
|
750
|
-
var script = 'script';
|
751
|
-
var gt = '>';
|
752
|
-
var js = 'java' + script + ':';
|
805
|
+
var JS = 'java' + SCRIPT + ':';
|
753
806
|
var iframeDocument;
|
754
807
|
iframe.style.display = 'none';
|
755
808
|
html.appendChild(iframe);
|
756
|
-
|
809
|
+
// https://github.com/zloirock/core-js/issues/475
|
810
|
+
iframe.src = String(JS);
|
757
811
|
iframeDocument = iframe.contentWindow.document;
|
758
812
|
iframeDocument.open();
|
759
|
-
iframeDocument.write(
|
813
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
760
814
|
iframeDocument.close();
|
761
|
-
|
762
|
-
|
763
|
-
|
815
|
+
return iframeDocument.F;
|
816
|
+
};
|
817
|
+
|
818
|
+
// Check for document.domain and active x support
|
819
|
+
// No need to use active x approach when document.domain is not set
|
820
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
821
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
822
|
+
// avoid IE GC bug
|
823
|
+
var activeXDocument;
|
824
|
+
var NullProtoObject = function () {
|
825
|
+
try {
|
826
|
+
/* global ActiveXObject */
|
827
|
+
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
828
|
+
} catch (error) { /* ignore */ }
|
829
|
+
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
830
|
+
var length = enumBugKeys.length;
|
831
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
832
|
+
return NullProtoObject();
|
764
833
|
};
|
765
834
|
|
835
|
+
hiddenKeys[IE_PROTO] = true;
|
836
|
+
|
766
837
|
// `Object.create` method
|
767
838
|
// https://tc39.github.io/ecma262/#sec-object.create
|
768
839
|
var objectCreate = Object.create || function create(O, Properties) {
|
769
840
|
var result;
|
770
841
|
if (O !== null) {
|
771
|
-
|
772
|
-
result = new
|
773
|
-
|
842
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
843
|
+
result = new EmptyConstructor();
|
844
|
+
EmptyConstructor[PROTOTYPE] = null;
|
774
845
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
775
846
|
result[IE_PROTO] = O;
|
776
|
-
} else result =
|
847
|
+
} else result = NullProtoObject();
|
777
848
|
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
778
849
|
};
|
779
850
|
|
780
|
-
hiddenKeys[IE_PROTO] = true;
|
781
|
-
|
782
851
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
783
852
|
var ArrayPrototype = Array.prototype;
|
784
853
|
|
785
854
|
// Array.prototype[@@unscopables]
|
786
855
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
787
856
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
788
|
-
|
857
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
858
|
+
configurable: true,
|
859
|
+
value: objectCreate(null)
|
860
|
+
});
|
789
861
|
}
|
790
862
|
|
791
863
|
// add a key to Array.prototype[@@unscopables]
|
@@ -821,26 +893,39 @@
|
|
821
893
|
});
|
822
894
|
};
|
823
895
|
|
824
|
-
var
|
896
|
+
var $indexOf = arrayIncludes.indexOf;
|
825
897
|
|
826
|
-
var ES3_STRINGS = indexedObject != Object;
|
827
|
-
var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
|
828
898
|
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
899
|
+
var nativeIndexOf = [].indexOf;
|
900
|
+
|
901
|
+
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
|
902
|
+
var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
|
903
|
+
|
904
|
+
// `Array.prototype.indexOf` method
|
905
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
|
906
|
+
_export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
|
907
|
+
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
908
|
+
return NEGATIVE_ZERO
|
909
|
+
// convert -0 to +0
|
910
|
+
? nativeIndexOf.apply(this, arguments) || 0
|
911
|
+
: $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
834
912
|
}
|
835
913
|
});
|
836
914
|
|
837
915
|
var $map = arrayIteration.map;
|
838
916
|
|
839
917
|
|
918
|
+
|
919
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
920
|
+
// FF49- issue
|
921
|
+
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
|
922
|
+
[].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
923
|
+
});
|
924
|
+
|
840
925
|
// `Array.prototype.map` method
|
841
926
|
// https://tc39.github.io/ecma262/#sec-array.prototype.map
|
842
927
|
// with adding support of @@species
|
843
|
-
_export({ target: 'Array', proto: true, forced: !
|
928
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
844
929
|
map: function map(callbackfn /* , thisArg */) {
|
845
930
|
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
846
931
|
}
|
@@ -881,8 +966,8 @@
|
|
881
966
|
}
|
882
967
|
});
|
883
968
|
|
884
|
-
var
|
885
|
-
var
|
969
|
+
var test = [];
|
970
|
+
var nativeSort = test.sort;
|
886
971
|
|
887
972
|
// IE8-
|
888
973
|
var FAILS_ON_UNDEFINED = fails(function () {
|
@@ -964,7 +1049,64 @@
|
|
964
1049
|
}
|
965
1050
|
});
|
966
1051
|
|
1052
|
+
var nativeAssign = Object.assign;
|
1053
|
+
var defineProperty = Object.defineProperty;
|
1054
|
+
|
1055
|
+
// `Object.assign` method
|
1056
|
+
// https://tc39.github.io/ecma262/#sec-object.assign
|
1057
|
+
var objectAssign = !nativeAssign || fails(function () {
|
1058
|
+
// should have correct order of operations (Edge bug)
|
1059
|
+
if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
|
1060
|
+
enumerable: true,
|
1061
|
+
get: function () {
|
1062
|
+
defineProperty(this, 'b', {
|
1063
|
+
value: 3,
|
1064
|
+
enumerable: false
|
1065
|
+
});
|
1066
|
+
}
|
1067
|
+
}), { b: 2 })).b !== 1) return true;
|
1068
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
1069
|
+
var A = {};
|
1070
|
+
var B = {};
|
1071
|
+
// eslint-disable-next-line no-undef
|
1072
|
+
var symbol = Symbol();
|
1073
|
+
var alphabet = 'abcdefghijklmnopqrst';
|
1074
|
+
A[symbol] = 7;
|
1075
|
+
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
1076
|
+
return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
1077
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
|
1078
|
+
var T = toObject(target);
|
1079
|
+
var argumentsLength = arguments.length;
|
1080
|
+
var index = 1;
|
1081
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
1082
|
+
var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
1083
|
+
while (argumentsLength > index) {
|
1084
|
+
var S = indexedObject(arguments[index++]);
|
1085
|
+
var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
1086
|
+
var length = keys.length;
|
1087
|
+
var j = 0;
|
1088
|
+
var key;
|
1089
|
+
while (length > j) {
|
1090
|
+
key = keys[j++];
|
1091
|
+
if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
1092
|
+
}
|
1093
|
+
} return T;
|
1094
|
+
} : nativeAssign;
|
1095
|
+
|
1096
|
+
// `Object.assign` method
|
1097
|
+
// https://tc39.github.io/ecma262/#sec-object.assign
|
1098
|
+
_export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
|
1099
|
+
assign: objectAssign
|
1100
|
+
});
|
1101
|
+
|
967
1102
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1103
|
+
var test$1 = {};
|
1104
|
+
|
1105
|
+
test$1[TO_STRING_TAG] = 'z';
|
1106
|
+
|
1107
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
1108
|
+
|
1109
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
968
1110
|
// ES3 wrong here
|
969
1111
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
970
1112
|
|
@@ -976,34 +1118,27 @@
|
|
976
1118
|
};
|
977
1119
|
|
978
1120
|
// getting tag from ES6+ `Object.prototype.toString`
|
979
|
-
var classof = function (it) {
|
1121
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
980
1122
|
var O, tag, result;
|
981
1123
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
982
1124
|
// @@toStringTag case
|
983
|
-
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
1125
|
+
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
984
1126
|
// builtinTag case
|
985
1127
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
986
1128
|
// ES3 arguments fallback
|
987
1129
|
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
988
1130
|
};
|
989
1131
|
|
990
|
-
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
991
|
-
var test$1 = {};
|
992
|
-
|
993
|
-
test$1[TO_STRING_TAG$1] = 'z';
|
994
|
-
|
995
1132
|
// `Object.prototype.toString` method implementation
|
996
1133
|
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
997
|
-
var objectToString =
|
1134
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
998
1135
|
return '[object ' + classof(this) + ']';
|
999
|
-
}
|
1000
|
-
|
1001
|
-
var ObjectPrototype = Object.prototype;
|
1136
|
+
};
|
1002
1137
|
|
1003
1138
|
// `Object.prototype.toString` method
|
1004
1139
|
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
1005
|
-
if (
|
1006
|
-
redefine(
|
1140
|
+
if (!toStringTagSupport) {
|
1141
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
1007
1142
|
}
|
1008
1143
|
|
1009
1144
|
// a string of all valid unicode whitespaces
|
@@ -1090,339 +1225,6 @@
|
|
1090
1225
|
}, { unsafe: true });
|
1091
1226
|
}
|
1092
1227
|
|
1093
|
-
var nativeExec = RegExp.prototype.exec;
|
1094
|
-
// This always refers to the native implementation, because the
|
1095
|
-
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
1096
|
-
// which loads this file before patching the method.
|
1097
|
-
var nativeReplace = String.prototype.replace;
|
1098
|
-
|
1099
|
-
var patchedExec = nativeExec;
|
1100
|
-
|
1101
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
1102
|
-
var re1 = /a/;
|
1103
|
-
var re2 = /b*/g;
|
1104
|
-
nativeExec.call(re1, 'a');
|
1105
|
-
nativeExec.call(re2, 'a');
|
1106
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
1107
|
-
})();
|
1108
|
-
|
1109
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
1110
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
1111
|
-
|
1112
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
1113
|
-
|
1114
|
-
if (PATCH) {
|
1115
|
-
patchedExec = function exec(str) {
|
1116
|
-
var re = this;
|
1117
|
-
var lastIndex, reCopy, match, i;
|
1118
|
-
|
1119
|
-
if (NPCG_INCLUDED) {
|
1120
|
-
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
|
1121
|
-
}
|
1122
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
1123
|
-
|
1124
|
-
match = nativeExec.call(re, str);
|
1125
|
-
|
1126
|
-
if (UPDATES_LAST_INDEX_WRONG && match) {
|
1127
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
1128
|
-
}
|
1129
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
1130
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
1131
|
-
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
1132
|
-
nativeReplace.call(match[0], reCopy, function () {
|
1133
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
1134
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
1135
|
-
}
|
1136
|
-
});
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
return match;
|
1140
|
-
};
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
var regexpExec = patchedExec;
|
1144
|
-
|
1145
|
-
var SPECIES$3 = wellKnownSymbol('species');
|
1146
|
-
|
1147
|
-
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
1148
|
-
// #replace needs built-in support for named groups.
|
1149
|
-
// #match works fine because it just return the exec results, even if it has
|
1150
|
-
// a "grops" property.
|
1151
|
-
var re = /./;
|
1152
|
-
re.exec = function () {
|
1153
|
-
var result = [];
|
1154
|
-
result.groups = { a: '7' };
|
1155
|
-
return result;
|
1156
|
-
};
|
1157
|
-
return ''.replace(re, '$<a>') !== '7';
|
1158
|
-
});
|
1159
|
-
|
1160
|
-
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
1161
|
-
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
1162
|
-
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
1163
|
-
var re = /(?:)/;
|
1164
|
-
var originalExec = re.exec;
|
1165
|
-
re.exec = function () { return originalExec.apply(this, arguments); };
|
1166
|
-
var result = 'ab'.split(re);
|
1167
|
-
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
1168
|
-
});
|
1169
|
-
|
1170
|
-
var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
1171
|
-
var SYMBOL = wellKnownSymbol(KEY);
|
1172
|
-
|
1173
|
-
var DELEGATES_TO_SYMBOL = !fails(function () {
|
1174
|
-
// String methods call symbol-named RegEp methods
|
1175
|
-
var O = {};
|
1176
|
-
O[SYMBOL] = function () { return 7; };
|
1177
|
-
return ''[KEY](O) != 7;
|
1178
|
-
});
|
1179
|
-
|
1180
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
1181
|
-
// Symbol-named RegExp methods call .exec
|
1182
|
-
var execCalled = false;
|
1183
|
-
var re = /a/;
|
1184
|
-
re.exec = function () { execCalled = true; return null; };
|
1185
|
-
|
1186
|
-
if (KEY === 'split') {
|
1187
|
-
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
1188
|
-
// a new one. We need to return the patched regex when creating the new one.
|
1189
|
-
re.constructor = {};
|
1190
|
-
re.constructor[SPECIES$3] = function () { return re; };
|
1191
|
-
}
|
1192
|
-
|
1193
|
-
re[SYMBOL]('');
|
1194
|
-
return !execCalled;
|
1195
|
-
});
|
1196
|
-
|
1197
|
-
if (
|
1198
|
-
!DELEGATES_TO_SYMBOL ||
|
1199
|
-
!DELEGATES_TO_EXEC ||
|
1200
|
-
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
1201
|
-
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
1202
|
-
) {
|
1203
|
-
var nativeRegExpMethod = /./[SYMBOL];
|
1204
|
-
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
1205
|
-
if (regexp.exec === regexpExec) {
|
1206
|
-
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
1207
|
-
// The native String method already delegates to @@method (this
|
1208
|
-
// polyfilled function), leasing to infinite recursion.
|
1209
|
-
// We avoid it by directly calling the native @@method method.
|
1210
|
-
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
1211
|
-
}
|
1212
|
-
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
1213
|
-
}
|
1214
|
-
return { done: false };
|
1215
|
-
});
|
1216
|
-
var stringMethod = methods[0];
|
1217
|
-
var regexMethod = methods[1];
|
1218
|
-
|
1219
|
-
redefine(String.prototype, KEY, stringMethod);
|
1220
|
-
redefine(RegExp.prototype, SYMBOL, length == 2
|
1221
|
-
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
|
1222
|
-
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
|
1223
|
-
? function (string, arg) { return regexMethod.call(string, this, arg); }
|
1224
|
-
// 21.2.5.6 RegExp.prototype[@@match](string)
|
1225
|
-
// 21.2.5.9 RegExp.prototype[@@search](string)
|
1226
|
-
: function (string) { return regexMethod.call(string, this); }
|
1227
|
-
);
|
1228
|
-
if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
1229
|
-
}
|
1230
|
-
};
|
1231
|
-
|
1232
|
-
var MATCH = wellKnownSymbol('match');
|
1233
|
-
|
1234
|
-
// `IsRegExp` abstract operation
|
1235
|
-
// https://tc39.github.io/ecma262/#sec-isregexp
|
1236
|
-
var isRegexp = function (it) {
|
1237
|
-
var isRegExp;
|
1238
|
-
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
1239
|
-
};
|
1240
|
-
|
1241
|
-
var SPECIES$4 = wellKnownSymbol('species');
|
1242
|
-
|
1243
|
-
// `SpeciesConstructor` abstract operation
|
1244
|
-
// https://tc39.github.io/ecma262/#sec-speciesconstructor
|
1245
|
-
var speciesConstructor = function (O, defaultConstructor) {
|
1246
|
-
var C = anObject(O).constructor;
|
1247
|
-
var S;
|
1248
|
-
return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
|
1249
|
-
};
|
1250
|
-
|
1251
|
-
// `String.prototype.{ codePointAt, at }` methods implementation
|
1252
|
-
var createMethod$3 = function (CONVERT_TO_STRING) {
|
1253
|
-
return function ($this, pos) {
|
1254
|
-
var S = String(requireObjectCoercible($this));
|
1255
|
-
var position = toInteger(pos);
|
1256
|
-
var size = S.length;
|
1257
|
-
var first, second;
|
1258
|
-
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1259
|
-
first = S.charCodeAt(position);
|
1260
|
-
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1261
|
-
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1262
|
-
? CONVERT_TO_STRING ? S.charAt(position) : first
|
1263
|
-
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1264
|
-
};
|
1265
|
-
};
|
1266
|
-
|
1267
|
-
var stringMultibyte = {
|
1268
|
-
// `String.prototype.codePointAt` method
|
1269
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
|
1270
|
-
codeAt: createMethod$3(false),
|
1271
|
-
// `String.prototype.at` method
|
1272
|
-
// https://github.com/mathiasbynens/String.prototype.at
|
1273
|
-
charAt: createMethod$3(true)
|
1274
|
-
};
|
1275
|
-
|
1276
|
-
var charAt = stringMultibyte.charAt;
|
1277
|
-
|
1278
|
-
// `AdvanceStringIndex` abstract operation
|
1279
|
-
// https://tc39.github.io/ecma262/#sec-advancestringindex
|
1280
|
-
var advanceStringIndex = function (S, index, unicode) {
|
1281
|
-
return index + (unicode ? charAt(S, index).length : 1);
|
1282
|
-
};
|
1283
|
-
|
1284
|
-
// `RegExpExec` abstract operation
|
1285
|
-
// https://tc39.github.io/ecma262/#sec-regexpexec
|
1286
|
-
var regexpExecAbstract = function (R, S) {
|
1287
|
-
var exec = R.exec;
|
1288
|
-
if (typeof exec === 'function') {
|
1289
|
-
var result = exec.call(R, S);
|
1290
|
-
if (typeof result !== 'object') {
|
1291
|
-
throw TypeError('RegExp exec method returned something other than an Object or null');
|
1292
|
-
}
|
1293
|
-
return result;
|
1294
|
-
}
|
1295
|
-
|
1296
|
-
if (classofRaw(R) !== 'RegExp') {
|
1297
|
-
throw TypeError('RegExp#exec called on incompatible receiver');
|
1298
|
-
}
|
1299
|
-
|
1300
|
-
return regexpExec.call(R, S);
|
1301
|
-
};
|
1302
|
-
|
1303
|
-
var arrayPush = [].push;
|
1304
|
-
var min$3 = Math.min;
|
1305
|
-
var MAX_UINT32 = 0xFFFFFFFF;
|
1306
|
-
|
1307
|
-
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
|
1308
|
-
var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
1309
|
-
|
1310
|
-
// @@split logic
|
1311
|
-
fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
1312
|
-
var internalSplit;
|
1313
|
-
if (
|
1314
|
-
'abbc'.split(/(b)*/)[1] == 'c' ||
|
1315
|
-
'test'.split(/(?:)/, -1).length != 4 ||
|
1316
|
-
'ab'.split(/(?:ab)*/).length != 2 ||
|
1317
|
-
'.'.split(/(.?)(.?)/).length != 4 ||
|
1318
|
-
'.'.split(/()()/).length > 1 ||
|
1319
|
-
''.split(/.?/).length
|
1320
|
-
) {
|
1321
|
-
// based on es5-shim implementation, need to rework it
|
1322
|
-
internalSplit = function (separator, limit) {
|
1323
|
-
var string = String(requireObjectCoercible(this));
|
1324
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1325
|
-
if (lim === 0) return [];
|
1326
|
-
if (separator === undefined) return [string];
|
1327
|
-
// If `separator` is not a regex, use native split
|
1328
|
-
if (!isRegexp(separator)) {
|
1329
|
-
return nativeSplit.call(string, separator, lim);
|
1330
|
-
}
|
1331
|
-
var output = [];
|
1332
|
-
var flags = (separator.ignoreCase ? 'i' : '') +
|
1333
|
-
(separator.multiline ? 'm' : '') +
|
1334
|
-
(separator.unicode ? 'u' : '') +
|
1335
|
-
(separator.sticky ? 'y' : '');
|
1336
|
-
var lastLastIndex = 0;
|
1337
|
-
// Make `global` and avoid `lastIndex` issues by working with a copy
|
1338
|
-
var separatorCopy = new RegExp(separator.source, flags + 'g');
|
1339
|
-
var match, lastIndex, lastLength;
|
1340
|
-
while (match = regexpExec.call(separatorCopy, string)) {
|
1341
|
-
lastIndex = separatorCopy.lastIndex;
|
1342
|
-
if (lastIndex > lastLastIndex) {
|
1343
|
-
output.push(string.slice(lastLastIndex, match.index));
|
1344
|
-
if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
1345
|
-
lastLength = match[0].length;
|
1346
|
-
lastLastIndex = lastIndex;
|
1347
|
-
if (output.length >= lim) break;
|
1348
|
-
}
|
1349
|
-
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
|
1350
|
-
}
|
1351
|
-
if (lastLastIndex === string.length) {
|
1352
|
-
if (lastLength || !separatorCopy.test('')) output.push('');
|
1353
|
-
} else output.push(string.slice(lastLastIndex));
|
1354
|
-
return output.length > lim ? output.slice(0, lim) : output;
|
1355
|
-
};
|
1356
|
-
// Chakra, V8
|
1357
|
-
} else if ('0'.split(undefined, 0).length) {
|
1358
|
-
internalSplit = function (separator, limit) {
|
1359
|
-
return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
1360
|
-
};
|
1361
|
-
} else internalSplit = nativeSplit;
|
1362
|
-
|
1363
|
-
return [
|
1364
|
-
// `String.prototype.split` method
|
1365
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype.split
|
1366
|
-
function split(separator, limit) {
|
1367
|
-
var O = requireObjectCoercible(this);
|
1368
|
-
var splitter = separator == undefined ? undefined : separator[SPLIT];
|
1369
|
-
return splitter !== undefined
|
1370
|
-
? splitter.call(separator, O, limit)
|
1371
|
-
: internalSplit.call(String(O), separator, limit);
|
1372
|
-
},
|
1373
|
-
// `RegExp.prototype[@@split]` method
|
1374
|
-
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
|
1375
|
-
//
|
1376
|
-
// NOTE: This cannot be properly polyfilled in engines that don't support
|
1377
|
-
// the 'y' flag.
|
1378
|
-
function (regexp, limit) {
|
1379
|
-
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
1380
|
-
if (res.done) return res.value;
|
1381
|
-
|
1382
|
-
var rx = anObject(regexp);
|
1383
|
-
var S = String(this);
|
1384
|
-
var C = speciesConstructor(rx, RegExp);
|
1385
|
-
|
1386
|
-
var unicodeMatching = rx.unicode;
|
1387
|
-
var flags = (rx.ignoreCase ? 'i' : '') +
|
1388
|
-
(rx.multiline ? 'm' : '') +
|
1389
|
-
(rx.unicode ? 'u' : '') +
|
1390
|
-
(SUPPORTS_Y ? 'y' : 'g');
|
1391
|
-
|
1392
|
-
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
1393
|
-
// simulate the 'y' flag.
|
1394
|
-
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
1395
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1396
|
-
if (lim === 0) return [];
|
1397
|
-
if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
|
1398
|
-
var p = 0;
|
1399
|
-
var q = 0;
|
1400
|
-
var A = [];
|
1401
|
-
while (q < S.length) {
|
1402
|
-
splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
1403
|
-
var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
|
1404
|
-
var e;
|
1405
|
-
if (
|
1406
|
-
z === null ||
|
1407
|
-
(e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
1408
|
-
) {
|
1409
|
-
q = advanceStringIndex(S, q, unicodeMatching);
|
1410
|
-
} else {
|
1411
|
-
A.push(S.slice(p, q));
|
1412
|
-
if (A.length === lim) return A;
|
1413
|
-
for (var i = 1; i <= z.length - 1; i++) {
|
1414
|
-
A.push(z[i]);
|
1415
|
-
if (A.length === lim) return A;
|
1416
|
-
}
|
1417
|
-
q = p = e;
|
1418
|
-
}
|
1419
|
-
}
|
1420
|
-
A.push(S.slice(p));
|
1421
|
-
return A;
|
1422
|
-
}
|
1423
|
-
];
|
1424
|
-
}, !SUPPORTS_Y);
|
1425
|
-
|
1426
1228
|
function _typeof(obj) {
|
1427
1229
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1428
1230
|
_typeof = function (obj) {
|
@@ -1446,7 +1248,7 @@
|
|
1446
1248
|
|
1447
1249
|
var isSingleSort = false;
|
1448
1250
|
var Utils = $.fn.bootstrapTable.utils;
|
1449
|
-
var
|
1251
|
+
var theme = {
|
1450
1252
|
bootstrap3: {
|
1451
1253
|
icons: {
|
1452
1254
|
plus: 'glyphicon-plus',
|
@@ -1471,6 +1273,18 @@
|
|
1471
1273
|
multipleSortSelect: '<select class="%s %s form-control">'
|
1472
1274
|
}
|
1473
1275
|
},
|
1276
|
+
bootstrap5: {
|
1277
|
+
icons: {
|
1278
|
+
'plus': 'fa-plus',
|
1279
|
+
'minus': 'fa-minus',
|
1280
|
+
'sort': 'fa-sort'
|
1281
|
+
},
|
1282
|
+
html: {
|
1283
|
+
multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
1284
|
+
multipleSortButton: '<button class="multi-sort btn btn-secondary" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
|
1285
|
+
multipleSortSelect: '<select class="%s %s form-control">'
|
1286
|
+
}
|
1287
|
+
},
|
1474
1288
|
semantic: {
|
1475
1289
|
icons: {
|
1476
1290
|
'plus': 'fa-plus',
|
@@ -1502,7 +1316,7 @@
|
|
1502
1316
|
'sort': 'fa-sort'
|
1503
1317
|
},
|
1504
1318
|
html: {
|
1505
|
-
multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n
|
1319
|
+
multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
|
1506
1320
|
multipleSortButton: '<button class="button multi-sort" data-open="%s" title="%s">%s</button>',
|
1507
1321
|
multipleSortSelect: '<select class="%s %s browser-default">'
|
1508
1322
|
}
|
@@ -1518,10 +1332,20 @@
|
|
1518
1332
|
multipleSortButton: '<button class="button multi-sort" data-target="%s" title="%s">%s</button>',
|
1519
1333
|
multipleSortSelect: '<select class="%s %s browser-default">'
|
1520
1334
|
}
|
1335
|
+
},
|
1336
|
+
'bootstrap-table': {
|
1337
|
+
icons: {
|
1338
|
+
'plus': 'icon-plus',
|
1339
|
+
'minus': 'icon-minus',
|
1340
|
+
'sort': 'icon-sort-amount-asc'
|
1341
|
+
},
|
1342
|
+
html: {
|
1343
|
+
multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"mt-30\">\n <button type=\"button\" class=\"btn\" data-close>%s</button>\n <button type=\"button\" class=\"btn multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
1344
|
+
multipleSortButton: '<button class="btn multi-sort" data-target="%s" title="%s">%s</button>',
|
1345
|
+
multipleSortSelect: '<select class="%s %s browser-default">'
|
1346
|
+
}
|
1521
1347
|
}
|
1522
1348
|
}[$.fn.bootstrapTable.theme];
|
1523
|
-
$.extend($.fn.bootstrapTable.defaults.icons, bootstrap.icons);
|
1524
|
-
$.extend($.fn.bootstrapTable.defaults.html, bootstrap.html);
|
1525
1349
|
|
1526
1350
|
var showSortModal = function showSortModal(that) {
|
1527
1351
|
var _selector = that.sortModalSelector;
|
@@ -1531,7 +1355,7 @@
|
|
1531
1355
|
var o = that.options;
|
1532
1356
|
|
1533
1357
|
if (!$(_id).hasClass('modal')) {
|
1534
|
-
var sModal = Utils.sprintf(
|
1358
|
+
var sModal = Utils.sprintf(theme.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, theme.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, theme.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
|
1535
1359
|
$('body').append($(sModal));
|
1536
1360
|
that.$sortModal = $(_id);
|
1537
1361
|
var $rows = that.$sortModal.find('tbody > tr');
|
@@ -1560,7 +1384,7 @@
|
|
1560
1384
|
var $alert = that.$sortModal.find('div.alert');
|
1561
1385
|
var fields = [];
|
1562
1386
|
var results = [];
|
1563
|
-
|
1387
|
+
var sortPriority = $.map($rows, function (row) {
|
1564
1388
|
var $row = $(row);
|
1565
1389
|
var name = $row.find('.multi-sort-name').val();
|
1566
1390
|
var order = $row.find('.multi-sort-order').val();
|
@@ -1592,22 +1416,7 @@
|
|
1592
1416
|
that.$sortModal.modal('hide');
|
1593
1417
|
}
|
1594
1418
|
|
1595
|
-
that.
|
1596
|
-
|
1597
|
-
if (that.options.sidePagination === 'server') {
|
1598
|
-
var t = that.options.queryParams;
|
1599
|
-
|
1600
|
-
that.options.queryParams = function (params) {
|
1601
|
-
params.multiSort = that.options.sortPriority;
|
1602
|
-
return $.fn.bootstrapTable.utils.calculateObjectValue(that.options, t, [params]);
|
1603
|
-
};
|
1604
|
-
|
1605
|
-
isSingleSort = false;
|
1606
|
-
that.initServer(that.options.silentSort);
|
1607
|
-
return;
|
1608
|
-
}
|
1609
|
-
|
1610
|
-
that.onMultipleSort();
|
1419
|
+
that.multiSort(sortPriority);
|
1611
1420
|
}
|
1612
1421
|
});
|
1613
1422
|
|
@@ -1635,9 +1444,11 @@
|
|
1635
1444
|
};
|
1636
1445
|
|
1637
1446
|
$.fn.bootstrapTable.methods.push('multipleSort');
|
1447
|
+
$.fn.bootstrapTable.methods.push('multiSort');
|
1638
1448
|
$.extend($.fn.bootstrapTable.defaults, {
|
1639
1449
|
showMultiSort: false,
|
1640
1450
|
showMultiSortButton: true,
|
1451
|
+
multiSortStrictSort: false,
|
1641
1452
|
sortPriority: null,
|
1642
1453
|
onMultipleSort: function onMultipleSort() {
|
1643
1454
|
return false;
|
@@ -1690,6 +1501,7 @@
|
|
1690
1501
|
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
1691
1502
|
var BootstrapTable = $.fn.bootstrapTable.Constructor;
|
1692
1503
|
var _initToolbar = BootstrapTable.prototype.initToolbar;
|
1504
|
+
var _destroy = BootstrapTable.prototype.destroy;
|
1693
1505
|
|
1694
1506
|
BootstrapTable.prototype.initToolbar = function () {
|
1695
1507
|
var _this = this;
|
@@ -1698,6 +1510,8 @@
|
|
1698
1510
|
var that = this;
|
1699
1511
|
var sortModalSelector = "sortModal_".concat(this.$el.attr('id'));
|
1700
1512
|
var sortModalId = "#".concat(sortModalSelector);
|
1513
|
+
var $multiSortBtn = this.$toolbar.find('div.multi-sort');
|
1514
|
+
var o = this.options;
|
1701
1515
|
this.$sortModal = $(sortModalId);
|
1702
1516
|
this.sortModalSelector = sortModalSelector;
|
1703
1517
|
|
@@ -1705,6 +1519,12 @@
|
|
1705
1519
|
that.onMultipleSort();
|
1706
1520
|
}
|
1707
1521
|
|
1522
|
+
this.buttons = Object.assign(this.buttons, {
|
1523
|
+
multipleSort: {
|
1524
|
+
'html': Utils.sprintf(theme.html.multipleSortButton, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, theme.icons.sort))
|
1525
|
+
}
|
1526
|
+
});
|
1527
|
+
|
1708
1528
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1709
1529
|
args[_key] = arguments[_key];
|
1710
1530
|
}
|
@@ -1721,14 +1541,7 @@
|
|
1721
1541
|
}
|
1722
1542
|
|
1723
1543
|
if (this.options.showMultiSort) {
|
1724
|
-
var $btnGroup = this.$toolbar.find('>.' + that.constants.classes.buttonsGroup.split(' ').join('.')).first();
|
1725
|
-
var $multiSortBtn = this.$toolbar.find('div.multi-sort');
|
1726
|
-
var o = that.options;
|
1727
|
-
|
1728
1544
|
if (!$multiSortBtn.length && this.options.showMultiSortButton) {
|
1729
|
-
$multiSortBtn = Utils.sprintf(that.constants.html.multipleSortButton, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort));
|
1730
|
-
$btnGroup.append($multiSortBtn);
|
1731
|
-
|
1732
1545
|
if ($.fn.bootstrapTable.theme === 'semantic') {
|
1733
1546
|
this.$toolbar.find('.multi-sort').on('click', function () {
|
1734
1547
|
$(sortModalId).modal('show');
|
@@ -1737,6 +1550,10 @@
|
|
1737
1550
|
this.$toolbar.find('.multi-sort').on('click', function () {
|
1738
1551
|
$(sortModalId).modal();
|
1739
1552
|
});
|
1553
|
+
} else if ($.fn.bootstrapTable.theme === 'bootstrap-table') {
|
1554
|
+
this.$toolbar.find('.multi-sort').on('click', function () {
|
1555
|
+
$(sortModalId).addClass('show');
|
1556
|
+
});
|
1740
1557
|
} else if ($.fn.bootstrapTable.theme === 'foundation') {
|
1741
1558
|
this.$toolbar.find('.multi-sort').on('click', function () {
|
1742
1559
|
if (!_this.foundationModal) {
|
@@ -1790,6 +1607,18 @@
|
|
1790
1607
|
}
|
1791
1608
|
};
|
1792
1609
|
|
1610
|
+
BootstrapTable.prototype.destroy = function () {
|
1611
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
1612
|
+
args[_key2] = arguments[_key2];
|
1613
|
+
}
|
1614
|
+
|
1615
|
+
_destroy.apply(this, Array.prototype.slice.apply(args));
|
1616
|
+
|
1617
|
+
if (this.options.showMultiSort) {
|
1618
|
+
this.$sortModal.remove();
|
1619
|
+
}
|
1620
|
+
};
|
1621
|
+
|
1793
1622
|
BootstrapTable.prototype.multipleSort = function () {
|
1794
1623
|
var that = this;
|
1795
1624
|
|
@@ -1810,25 +1639,40 @@
|
|
1810
1639
|
var arr2 = [];
|
1811
1640
|
|
1812
1641
|
for (var i = 0; i < that.options.sortPriority.length; i++) {
|
1813
|
-
var
|
1814
|
-
var
|
1815
|
-
var
|
1642
|
+
var fieldName = that.options.sortPriority[i].sortName;
|
1643
|
+
var fieldIndex = that.header.fields.indexOf(fieldName);
|
1644
|
+
var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
|
1816
1645
|
|
1817
|
-
if (
|
1818
|
-
|
1646
|
+
if (that.header.sortNames[fieldIndex]) {
|
1647
|
+
fieldName = that.header.sortNames[fieldIndex];
|
1819
1648
|
}
|
1820
1649
|
|
1821
|
-
|
1822
|
-
|
1650
|
+
var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
|
1651
|
+
var aa = Utils.getItemField(a, fieldName);
|
1652
|
+
var bb = Utils.getItemField(b, fieldName);
|
1653
|
+
var value1 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb]);
|
1654
|
+
var value2 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa]);
|
1655
|
+
|
1656
|
+
if (value1 !== undefined && value2 !== undefined) {
|
1657
|
+
arr1.push(order * value1);
|
1658
|
+
arr2.push(order * value2);
|
1659
|
+
continue;
|
1823
1660
|
}
|
1824
1661
|
|
1662
|
+
if (aa === undefined || aa === null) aa = '';
|
1663
|
+
if (bb === undefined || bb === null) bb = '';
|
1664
|
+
|
1825
1665
|
if ($.isNumeric(aa) && $.isNumeric(bb)) {
|
1826
1666
|
aa = parseFloat(aa);
|
1827
1667
|
bb = parseFloat(bb);
|
1828
|
-
}
|
1829
|
-
|
1830
|
-
if (typeof aa !== 'string') {
|
1668
|
+
} else {
|
1831
1669
|
aa = aa.toString();
|
1670
|
+
bb = bb.toString();
|
1671
|
+
|
1672
|
+
if (that.options.multiSortStrictSort) {
|
1673
|
+
aa = aa.toLowerCase();
|
1674
|
+
bb = bb.toLowerCase();
|
1675
|
+
}
|
1832
1676
|
}
|
1833
1677
|
|
1834
1678
|
arr1.push(order * cmp(aa, bb));
|
@@ -1848,7 +1692,7 @@
|
|
1848
1692
|
|
1849
1693
|
BootstrapTable.prototype.addLevel = function (index, sortPriority) {
|
1850
1694
|
var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
|
1851
|
-
this.$sortModal.find('tbody').append($('<tr>').append($('<td>').text(text)).append($('<td>').append($(Utils.sprintf(
|
1695
|
+
this.$sortModal.find('tbody').append($('<tr>').append($('<td>').text(text)).append($('<td>').append($(Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($('<td>').append($(Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
|
1852
1696
|
var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
|
1853
1697
|
var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
|
1854
1698
|
$.each(this.columns, function (i, column) {
|
@@ -1902,4 +1746,24 @@
|
|
1902
1746
|
}
|
1903
1747
|
};
|
1904
1748
|
|
1905
|
-
|
1749
|
+
BootstrapTable.prototype.multiSort = function (sortPriority) {
|
1750
|
+
var _this2 = this;
|
1751
|
+
|
1752
|
+
this.options.sortPriority = sortPriority;
|
1753
|
+
this.options.sortName = undefined;
|
1754
|
+
|
1755
|
+
if (this.options.sidePagination === 'server') {
|
1756
|
+
this.options.queryParams = function (params) {
|
1757
|
+
params.multiSort = _this2.options.sortPriority;
|
1758
|
+
return $.fn.bootstrapTable.utils.calculateObjectValue(_this2.options, _this2.options.queryParams, [params]);
|
1759
|
+
};
|
1760
|
+
|
1761
|
+
isSingleSort = false;
|
1762
|
+
this.initServer(this.options.silentSort);
|
1763
|
+
return;
|
1764
|
+
}
|
1765
|
+
|
1766
|
+
this.onMultipleSort();
|
1767
|
+
};
|
1768
|
+
|
1769
|
+
})));
|