bootstrap-table-rails 1.15.4 → 1.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +147 -54
- data/lib/bootstrap-table-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +876 -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 +66 -11
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +1347 -727
- data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +254 -88
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +139 -66
- data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1309 -258
- data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +139 -64
- data/vendor/assets/javascripts/bootstrap-table/extensions/{accent-neutralise/bootstrap-table-accent-neutralise.js → custom-view/bootstrap-table-custom-view.js} +582 -752
- 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 +409 -210
- 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 +1369 -904
- 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.js +494 -107
- 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 +217 -73
- 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 +374 -138
- 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 +388 -148
- 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 +209 -76
- data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +490 -202
- 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 +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +114 -63
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +93 -43
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +107 -57
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +93 -43
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +96 -45
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +92 -42
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +768 -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 +80 -12
- 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 +79 -14
- 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 +74 -10
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +165 -67
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +80 -14
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +165 -67
- metadata +13 -16
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.css +0 -3
- 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/group-by/bootstrap-table-group-by.css +0 -53
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.js +0 -257
- data/vendor/assets/javascripts/bootstrap-table/extensions/multi-column-toggle/bootstrap-table-multi-toggle.js +0 -105
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js +0 -85
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.css +0 -17
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.js +0 -143
- data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +0 -1265
- data/vendor/assets/javascripts/bootstrap-table/extensions/select2-filter/bootstrap-table-select2-filter.js +0 -341
- data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.js +0 -142
data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js
CHANGED
@@ -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);
|
@@ -567,12 +573,21 @@
|
|
567
573
|
return !String(Symbol());
|
568
574
|
});
|
569
575
|
|
576
|
+
var useSymbolAsUid = nativeSymbol
|
577
|
+
// eslint-disable-next-line no-undef
|
578
|
+
&& !Symbol.sham
|
579
|
+
// eslint-disable-next-line no-undef
|
580
|
+
&& typeof Symbol() == 'symbol';
|
581
|
+
|
582
|
+
var WellKnownSymbolsStore = shared('wks');
|
570
583
|
var Symbol$1 = global_1.Symbol;
|
571
|
-
var
|
584
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
|
572
585
|
|
573
586
|
var wellKnownSymbol = function (name) {
|
574
|
-
|
575
|
-
|
587
|
+
if (!has(WellKnownSymbolsStore, name)) {
|
588
|
+
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
589
|
+
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
590
|
+
} return WellKnownSymbolsStore[name];
|
576
591
|
};
|
577
592
|
|
578
593
|
var SPECIES = wellKnownSymbol('species');
|
@@ -652,10 +667,33 @@
|
|
652
667
|
findIndex: createMethod$1(6)
|
653
668
|
};
|
654
669
|
|
670
|
+
var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
671
|
+
|
672
|
+
var process = global_1.process;
|
673
|
+
var versions = process && process.versions;
|
674
|
+
var v8 = versions && versions.v8;
|
675
|
+
var match, version;
|
676
|
+
|
677
|
+
if (v8) {
|
678
|
+
match = v8.split('.');
|
679
|
+
version = match[0] + match[1];
|
680
|
+
} else if (userAgent) {
|
681
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
682
|
+
if (!match || match[1] >= 74) {
|
683
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
684
|
+
if (match) version = match[1];
|
685
|
+
}
|
686
|
+
}
|
687
|
+
|
688
|
+
var v8Version = version && +version;
|
689
|
+
|
655
690
|
var SPECIES$1 = wellKnownSymbol('species');
|
656
691
|
|
657
692
|
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
658
|
-
|
693
|
+
// We can't use this feature detection in V8 since it causes
|
694
|
+
// deoptimization and serious performance degradation
|
695
|
+
// https://github.com/zloirock/core-js/issues/677
|
696
|
+
return v8Version >= 51 || !fails(function () {
|
659
697
|
var array = [];
|
660
698
|
var constructor = array.constructor = {};
|
661
699
|
constructor[SPECIES$1] = function () {
|
@@ -668,10 +706,17 @@
|
|
668
706
|
var $filter = arrayIteration.filter;
|
669
707
|
|
670
708
|
|
709
|
+
|
710
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
711
|
+
// Edge 14- issue
|
712
|
+
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
|
713
|
+
[].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
714
|
+
});
|
715
|
+
|
671
716
|
// `Array.prototype.filter` method
|
672
717
|
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
|
673
718
|
// with adding support of @@species
|
674
|
-
_export({ target: 'Array', proto: true, forced: !
|
719
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
675
720
|
filter: function filter(callbackfn /* , thisArg */) {
|
676
721
|
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
677
722
|
}
|
@@ -697,56 +742,87 @@
|
|
697
742
|
|
698
743
|
var html = getBuiltIn('document', 'documentElement');
|
699
744
|
|
745
|
+
var GT = '>';
|
746
|
+
var LT = '<';
|
747
|
+
var PROTOTYPE = 'prototype';
|
748
|
+
var SCRIPT = 'script';
|
700
749
|
var IE_PROTO = sharedKey('IE_PROTO');
|
701
750
|
|
702
|
-
var
|
703
|
-
|
751
|
+
var EmptyConstructor = function () { /* empty */ };
|
752
|
+
|
753
|
+
var scriptTag = function (content) {
|
754
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
755
|
+
};
|
756
|
+
|
757
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
758
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
759
|
+
activeXDocument.write(scriptTag(''));
|
760
|
+
activeXDocument.close();
|
761
|
+
var temp = activeXDocument.parentWindow.Object;
|
762
|
+
activeXDocument = null; // avoid memory leak
|
763
|
+
return temp;
|
764
|
+
};
|
704
765
|
|
705
766
|
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
706
|
-
var
|
767
|
+
var NullProtoObjectViaIFrame = function () {
|
707
768
|
// Thrash, waste and sodomy: IE GC bug
|
708
769
|
var iframe = documentCreateElement('iframe');
|
709
|
-
var
|
710
|
-
var lt = '<';
|
711
|
-
var script = 'script';
|
712
|
-
var gt = '>';
|
713
|
-
var js = 'java' + script + ':';
|
770
|
+
var JS = 'java' + SCRIPT + ':';
|
714
771
|
var iframeDocument;
|
715
772
|
iframe.style.display = 'none';
|
716
773
|
html.appendChild(iframe);
|
717
|
-
|
774
|
+
// https://github.com/zloirock/core-js/issues/475
|
775
|
+
iframe.src = String(JS);
|
718
776
|
iframeDocument = iframe.contentWindow.document;
|
719
777
|
iframeDocument.open();
|
720
|
-
iframeDocument.write(
|
778
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
721
779
|
iframeDocument.close();
|
722
|
-
|
723
|
-
while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
|
724
|
-
return createDict();
|
780
|
+
return iframeDocument.F;
|
725
781
|
};
|
726
782
|
|
783
|
+
// Check for document.domain and active x support
|
784
|
+
// No need to use active x approach when document.domain is not set
|
785
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
786
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
787
|
+
// avoid IE GC bug
|
788
|
+
var activeXDocument;
|
789
|
+
var NullProtoObject = function () {
|
790
|
+
try {
|
791
|
+
/* global ActiveXObject */
|
792
|
+
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
793
|
+
} catch (error) { /* ignore */ }
|
794
|
+
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
795
|
+
var length = enumBugKeys.length;
|
796
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
797
|
+
return NullProtoObject();
|
798
|
+
};
|
799
|
+
|
800
|
+
hiddenKeys[IE_PROTO] = true;
|
801
|
+
|
727
802
|
// `Object.create` method
|
728
803
|
// https://tc39.github.io/ecma262/#sec-object.create
|
729
804
|
var objectCreate = Object.create || function create(O, Properties) {
|
730
805
|
var result;
|
731
806
|
if (O !== null) {
|
732
|
-
|
733
|
-
result = new
|
734
|
-
|
807
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
808
|
+
result = new EmptyConstructor();
|
809
|
+
EmptyConstructor[PROTOTYPE] = null;
|
735
810
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
736
811
|
result[IE_PROTO] = O;
|
737
|
-
} else result =
|
812
|
+
} else result = NullProtoObject();
|
738
813
|
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
739
814
|
};
|
740
815
|
|
741
|
-
hiddenKeys[IE_PROTO] = true;
|
742
|
-
|
743
816
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
744
817
|
var ArrayPrototype = Array.prototype;
|
745
818
|
|
746
819
|
// Array.prototype[@@unscopables]
|
747
820
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
748
821
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
749
|
-
|
822
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
823
|
+
configurable: true,
|
824
|
+
value: objectCreate(null)
|
825
|
+
});
|
750
826
|
}
|
751
827
|
|
752
828
|
// add a key to Array.prototype[@@unscopables]
|
@@ -836,8 +912,8 @@
|
|
836
912
|
}
|
837
913
|
});
|
838
914
|
|
839
|
-
var
|
840
|
-
var
|
915
|
+
var test = [];
|
916
|
+
var nativeSort = test.sort;
|
841
917
|
|
842
918
|
// IE8-
|
843
919
|
var FAILS_ON_UNDEFINED = fails(function () {
|
@@ -884,6 +960,56 @@
|
|
884
960
|
});
|
885
961
|
}
|
886
962
|
|
963
|
+
var nativeAssign = Object.assign;
|
964
|
+
var defineProperty$1 = Object.defineProperty;
|
965
|
+
|
966
|
+
// `Object.assign` method
|
967
|
+
// https://tc39.github.io/ecma262/#sec-object.assign
|
968
|
+
var objectAssign = !nativeAssign || fails(function () {
|
969
|
+
// should have correct order of operations (Edge bug)
|
970
|
+
if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$1({}, 'a', {
|
971
|
+
enumerable: true,
|
972
|
+
get: function () {
|
973
|
+
defineProperty$1(this, 'b', {
|
974
|
+
value: 3,
|
975
|
+
enumerable: false
|
976
|
+
});
|
977
|
+
}
|
978
|
+
}), { b: 2 })).b !== 1) return true;
|
979
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
980
|
+
var A = {};
|
981
|
+
var B = {};
|
982
|
+
// eslint-disable-next-line no-undef
|
983
|
+
var symbol = Symbol();
|
984
|
+
var alphabet = 'abcdefghijklmnopqrst';
|
985
|
+
A[symbol] = 7;
|
986
|
+
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
987
|
+
return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
988
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
|
989
|
+
var T = toObject(target);
|
990
|
+
var argumentsLength = arguments.length;
|
991
|
+
var index = 1;
|
992
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
993
|
+
var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
994
|
+
while (argumentsLength > index) {
|
995
|
+
var S = indexedObject(arguments[index++]);
|
996
|
+
var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
997
|
+
var length = keys.length;
|
998
|
+
var j = 0;
|
999
|
+
var key;
|
1000
|
+
while (length > j) {
|
1001
|
+
key = keys[j++];
|
1002
|
+
if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
1003
|
+
}
|
1004
|
+
} return T;
|
1005
|
+
} : nativeAssign;
|
1006
|
+
|
1007
|
+
// `Object.assign` method
|
1008
|
+
// https://tc39.github.io/ecma262/#sec-object.assign
|
1009
|
+
_export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
|
1010
|
+
assign: objectAssign
|
1011
|
+
});
|
1012
|
+
|
887
1013
|
// `RegExp.prototype.flags` getter implementation
|
888
1014
|
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
889
1015
|
var regexpFlags = function () {
|
@@ -898,6 +1024,31 @@
|
|
898
1024
|
return result;
|
899
1025
|
};
|
900
1026
|
|
1027
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
|
1028
|
+
// so we use an intermediate function.
|
1029
|
+
function RE(s, f) {
|
1030
|
+
return RegExp(s, f);
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
var UNSUPPORTED_Y = fails(function () {
|
1034
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
1035
|
+
var re = RE('a', 'y');
|
1036
|
+
re.lastIndex = 2;
|
1037
|
+
return re.exec('abcd') != null;
|
1038
|
+
});
|
1039
|
+
|
1040
|
+
var BROKEN_CARET = fails(function () {
|
1041
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
1042
|
+
var re = RE('^r', 'gy');
|
1043
|
+
re.lastIndex = 2;
|
1044
|
+
return re.exec('str') != null;
|
1045
|
+
});
|
1046
|
+
|
1047
|
+
var regexpStickyHelpers = {
|
1048
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y,
|
1049
|
+
BROKEN_CARET: BROKEN_CARET
|
1050
|
+
};
|
1051
|
+
|
901
1052
|
var nativeExec = RegExp.prototype.exec;
|
902
1053
|
// This always refers to the native implementation, because the
|
903
1054
|
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
@@ -914,24 +1065,56 @@
|
|
914
1065
|
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
915
1066
|
})();
|
916
1067
|
|
1068
|
+
var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
|
1069
|
+
|
917
1070
|
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
918
1071
|
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
919
1072
|
|
920
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
1073
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
|
921
1074
|
|
922
1075
|
if (PATCH) {
|
923
1076
|
patchedExec = function exec(str) {
|
924
1077
|
var re = this;
|
925
1078
|
var lastIndex, reCopy, match, i;
|
1079
|
+
var sticky = UNSUPPORTED_Y$1 && re.sticky;
|
1080
|
+
var flags = regexpFlags.call(re);
|
1081
|
+
var source = re.source;
|
1082
|
+
var charsAdded = 0;
|
1083
|
+
var strCopy = str;
|
1084
|
+
|
1085
|
+
if (sticky) {
|
1086
|
+
flags = flags.replace('y', '');
|
1087
|
+
if (flags.indexOf('g') === -1) {
|
1088
|
+
flags += 'g';
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
strCopy = String(str).slice(re.lastIndex);
|
1092
|
+
// Support anchored sticky behavior.
|
1093
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
1094
|
+
source = '(?: ' + source + ')';
|
1095
|
+
strCopy = ' ' + strCopy;
|
1096
|
+
charsAdded++;
|
1097
|
+
}
|
1098
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
1099
|
+
// simulate the 'y' flag.
|
1100
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
1101
|
+
}
|
926
1102
|
|
927
1103
|
if (NPCG_INCLUDED) {
|
928
|
-
reCopy = new RegExp('^' +
|
1104
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
929
1105
|
}
|
930
1106
|
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
931
1107
|
|
932
|
-
match = nativeExec.call(re,
|
1108
|
+
match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
933
1109
|
|
934
|
-
if (
|
1110
|
+
if (sticky) {
|
1111
|
+
if (match) {
|
1112
|
+
match.input = match.input.slice(charsAdded);
|
1113
|
+
match[0] = match[0].slice(charsAdded);
|
1114
|
+
match.index = re.lastIndex;
|
1115
|
+
re.lastIndex += match[0].length;
|
1116
|
+
} else re.lastIndex = 0;
|
1117
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
935
1118
|
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
936
1119
|
}
|
937
1120
|
if (NPCG_INCLUDED && match && match.length > 1) {
|
@@ -950,6 +1133,10 @@
|
|
950
1133
|
|
951
1134
|
var regexpExec = patchedExec;
|
952
1135
|
|
1136
|
+
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
1137
|
+
exec: regexpExec
|
1138
|
+
});
|
1139
|
+
|
953
1140
|
var SPECIES$3 = wellKnownSymbol('species');
|
954
1141
|
|
955
1142
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
@@ -965,6 +1152,12 @@
|
|
965
1152
|
return ''.replace(re, '$<a>') !== '7';
|
966
1153
|
});
|
967
1154
|
|
1155
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
1156
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
1157
|
+
var REPLACE_KEEPS_$0 = (function () {
|
1158
|
+
return 'a'.replace(/./, '$0') === '$0';
|
1159
|
+
})();
|
1160
|
+
|
968
1161
|
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
969
1162
|
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
970
1163
|
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
@@ -989,15 +1182,22 @@
|
|
989
1182
|
// Symbol-named RegExp methods call .exec
|
990
1183
|
var execCalled = false;
|
991
1184
|
var re = /a/;
|
992
|
-
re.exec = function () { execCalled = true; return null; };
|
993
1185
|
|
994
1186
|
if (KEY === 'split') {
|
1187
|
+
// We can't use real regex here since it causes deoptimization
|
1188
|
+
// and serious performance degradation in V8
|
1189
|
+
// https://github.com/zloirock/core-js/issues/306
|
1190
|
+
re = {};
|
995
1191
|
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
996
1192
|
// a new one. We need to return the patched regex when creating the new one.
|
997
1193
|
re.constructor = {};
|
998
1194
|
re.constructor[SPECIES$3] = function () { return re; };
|
1195
|
+
re.flags = '';
|
1196
|
+
re[SYMBOL] = /./[SYMBOL];
|
999
1197
|
}
|
1000
1198
|
|
1199
|
+
re.exec = function () { execCalled = true; return null; };
|
1200
|
+
|
1001
1201
|
re[SYMBOL]('');
|
1002
1202
|
return !execCalled;
|
1003
1203
|
});
|
@@ -1005,7 +1205,7 @@
|
|
1005
1205
|
if (
|
1006
1206
|
!DELEGATES_TO_SYMBOL ||
|
1007
1207
|
!DELEGATES_TO_EXEC ||
|
1008
|
-
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
1208
|
+
(KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
|
1009
1209
|
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
1010
1210
|
) {
|
1011
1211
|
var nativeRegExpMethod = /./[SYMBOL];
|
@@ -1020,7 +1220,7 @@
|
|
1020
1220
|
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
1021
1221
|
}
|
1022
1222
|
return { done: false };
|
1023
|
-
});
|
1223
|
+
}, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
|
1024
1224
|
var stringMethod = methods[0];
|
1025
1225
|
var regexMethod = methods[1];
|
1026
1226
|
|
@@ -1033,8 +1233,9 @@
|
|
1033
1233
|
// 21.2.5.9 RegExp.prototype[@@search](string)
|
1034
1234
|
: function (string) { return regexMethod.call(string, this); }
|
1035
1235
|
);
|
1036
|
-
if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
1037
1236
|
}
|
1237
|
+
|
1238
|
+
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
1038
1239
|
};
|
1039
1240
|
|
1040
1241
|
// `String.prototype.{ codePointAt, at }` methods implementation
|
@@ -1100,7 +1301,7 @@
|
|
1100
1301
|
};
|
1101
1302
|
|
1102
1303
|
// @@replace logic
|
1103
|
-
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
|
1304
|
+
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
1104
1305
|
return [
|
1105
1306
|
// `String.prototype.replace` method
|
1106
1307
|
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
@@ -1114,8 +1315,10 @@
|
|
1114
1315
|
// `RegExp.prototype[@@replace]` method
|
1115
1316
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
1116
1317
|
function (regexp, replaceValue) {
|
1117
|
-
|
1118
|
-
|
1318
|
+
if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
|
1319
|
+
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
1320
|
+
if (res.done) return res.value;
|
1321
|
+
}
|
1119
1322
|
|
1120
1323
|
var rx = anObject(regexp);
|
1121
1324
|
var S = String(this);
|
@@ -1256,19 +1459,131 @@
|
|
1256
1459
|
var CollectionPrototype = Collection && Collection.prototype;
|
1257
1460
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
1258
1461
|
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
1259
|
-
|
1462
|
+
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
1260
1463
|
} catch (error) {
|
1261
1464
|
CollectionPrototype.forEach = arrayForEach;
|
1262
1465
|
}
|
1263
1466
|
}
|
1264
1467
|
|
1468
|
+
function _typeof(obj) {
|
1469
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1470
|
+
_typeof = function (obj) {
|
1471
|
+
return typeof obj;
|
1472
|
+
};
|
1473
|
+
} else {
|
1474
|
+
_typeof = function (obj) {
|
1475
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1476
|
+
};
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
return _typeof(obj);
|
1480
|
+
}
|
1481
|
+
|
1482
|
+
function _classCallCheck(instance, Constructor) {
|
1483
|
+
if (!(instance instanceof Constructor)) {
|
1484
|
+
throw new TypeError("Cannot call a class as a function");
|
1485
|
+
}
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
function _defineProperties(target, props) {
|
1489
|
+
for (var i = 0; i < props.length; i++) {
|
1490
|
+
var descriptor = props[i];
|
1491
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
1492
|
+
descriptor.configurable = true;
|
1493
|
+
if ("value" in descriptor) descriptor.writable = true;
|
1494
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
1495
|
+
}
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
1499
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1500
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
1501
|
+
return Constructor;
|
1502
|
+
}
|
1503
|
+
|
1504
|
+
function _inherits(subClass, superClass) {
|
1505
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
1506
|
+
throw new TypeError("Super expression must either be null or a function");
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1510
|
+
constructor: {
|
1511
|
+
value: subClass,
|
1512
|
+
writable: true,
|
1513
|
+
configurable: true
|
1514
|
+
}
|
1515
|
+
});
|
1516
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
function _getPrototypeOf(o) {
|
1520
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1521
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
1522
|
+
};
|
1523
|
+
return _getPrototypeOf(o);
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
function _setPrototypeOf(o, p) {
|
1527
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1528
|
+
o.__proto__ = p;
|
1529
|
+
return o;
|
1530
|
+
};
|
1531
|
+
|
1532
|
+
return _setPrototypeOf(o, p);
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
function _assertThisInitialized(self) {
|
1536
|
+
if (self === void 0) {
|
1537
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
return self;
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
function _possibleConstructorReturn(self, call) {
|
1544
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
1545
|
+
return call;
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
return _assertThisInitialized(self);
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
function _superPropBase(object, property) {
|
1552
|
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1553
|
+
object = _getPrototypeOf(object);
|
1554
|
+
if (object === null) break;
|
1555
|
+
}
|
1556
|
+
|
1557
|
+
return object;
|
1558
|
+
}
|
1559
|
+
|
1560
|
+
function _get(target, property, receiver) {
|
1561
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
1562
|
+
_get = Reflect.get;
|
1563
|
+
} else {
|
1564
|
+
_get = function _get(target, property, receiver) {
|
1565
|
+
var base = _superPropBase(target, property);
|
1566
|
+
|
1567
|
+
if (!base) return;
|
1568
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
1569
|
+
|
1570
|
+
if (desc.get) {
|
1571
|
+
return desc.get.call(receiver);
|
1572
|
+
}
|
1573
|
+
|
1574
|
+
return desc.value;
|
1575
|
+
};
|
1576
|
+
}
|
1577
|
+
|
1578
|
+
return _get(target, property, receiver || target);
|
1579
|
+
}
|
1580
|
+
|
1265
1581
|
/**
|
1266
1582
|
* @author: Yura Knoxville
|
1267
1583
|
* @version: v1.1.0
|
1268
1584
|
*/
|
1269
1585
|
|
1270
|
-
var initBodyCaller;
|
1271
|
-
var tableGroups; // it only does '%s', and return '' when arguments are undefined
|
1586
|
+
var initBodyCaller; // it only does '%s', and return '' when arguments are undefined
|
1272
1587
|
|
1273
1588
|
var sprintf = function sprintf(str) {
|
1274
1589
|
var args = arguments;
|
@@ -1288,13 +1603,13 @@
|
|
1288
1603
|
};
|
1289
1604
|
|
1290
1605
|
var groupBy = function groupBy(array, f) {
|
1291
|
-
var
|
1606
|
+
var tmpGroups = {};
|
1292
1607
|
array.forEach(function (o) {
|
1293
|
-
var
|
1294
|
-
groups
|
1295
|
-
groups
|
1608
|
+
var groups = f(o);
|
1609
|
+
tmpGroups[groups] = tmpGroups[groups] || [];
|
1610
|
+
tmpGroups[groups].push(o);
|
1296
1611
|
});
|
1297
|
-
return
|
1612
|
+
return tmpGroups;
|
1298
1613
|
};
|
1299
1614
|
|
1300
1615
|
$.extend($.fn.bootstrapTable.defaults, {
|
@@ -1302,12 +1617,15 @@
|
|
1302
1617
|
groupByField: '',
|
1303
1618
|
groupByFormatter: undefined
|
1304
1619
|
});
|
1620
|
+
var Utils = $.fn.bootstrapTable.utils;
|
1305
1621
|
var BootstrapTable = $.fn.bootstrapTable.Constructor;
|
1306
1622
|
var _initSort = BootstrapTable.prototype.initSort;
|
1307
1623
|
var _initBody = BootstrapTable.prototype.initBody;
|
1308
1624
|
var _updateSelected = BootstrapTable.prototype.updateSelected;
|
1309
1625
|
|
1310
1626
|
BootstrapTable.prototype.initSort = function () {
|
1627
|
+
var _this = this;
|
1628
|
+
|
1311
1629
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1312
1630
|
args[_key] = arguments[_key];
|
1313
1631
|
}
|
@@ -1315,25 +1633,48 @@
|
|
1315
1633
|
_initSort.apply(this, Array.prototype.slice.apply(args));
|
1316
1634
|
|
1317
1635
|
var that = this;
|
1318
|
-
tableGroups = [];
|
1636
|
+
this.tableGroups = [];
|
1319
1637
|
|
1320
1638
|
if (this.options.groupBy && this.options.groupByField !== '') {
|
1321
1639
|
if (this.options.sortName !== this.options.groupByField) {
|
1322
|
-
this.
|
1323
|
-
|
1324
|
-
}
|
1640
|
+
if (this.options.customSort) {
|
1641
|
+
Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
|
1642
|
+
} else {
|
1643
|
+
this.data.sort(function (a, b) {
|
1644
|
+
var groupByFields = _this.getGroupByFields();
|
1645
|
+
|
1646
|
+
var fieldValuesA = [];
|
1647
|
+
var fieldValuesB = [];
|
1648
|
+
$.each(groupByFields, function (i, field) {
|
1649
|
+
fieldValuesA.push(a[field]);
|
1650
|
+
fieldValuesB.push(b[field]);
|
1651
|
+
});
|
1652
|
+
a = fieldValuesA.join();
|
1653
|
+
b = fieldValuesB.join();
|
1654
|
+
return a.localeCompare(b, undefined, {
|
1655
|
+
numeric: true
|
1656
|
+
});
|
1657
|
+
});
|
1658
|
+
}
|
1325
1659
|
}
|
1326
1660
|
|
1327
1661
|
var groups = groupBy(that.data, function (item) {
|
1328
|
-
|
1662
|
+
var groupByFields = _this.getGroupByFields();
|
1663
|
+
|
1664
|
+
var groupValues = [];
|
1665
|
+
$.each(groupByFields, function (i, field) {
|
1666
|
+
groupValues.push(item[field]);
|
1667
|
+
});
|
1668
|
+
return groupValues.join(', ');
|
1329
1669
|
});
|
1330
1670
|
var index = 0;
|
1331
1671
|
$.each(groups, function (key, value) {
|
1332
|
-
tableGroups.push({
|
1672
|
+
_this.tableGroups.push({
|
1333
1673
|
id: index,
|
1334
1674
|
name: key,
|
1335
1675
|
data: value
|
1336
1676
|
});
|
1677
|
+
|
1337
1678
|
value.forEach(function (item) {
|
1338
1679
|
if (!item._data) {
|
1339
1680
|
item._data = {};
|
@@ -1373,7 +1714,7 @@
|
|
1373
1714
|
visibleColumns += 1;
|
1374
1715
|
}
|
1375
1716
|
|
1376
|
-
tableGroups.forEach(function (item) {
|
1717
|
+
this.tableGroups.forEach(function (item) {
|
1377
1718
|
var html = [];
|
1378
1719
|
html.push(sprintf('<tr class="info groupBy expanded" data-group-index="%s">', item.id));
|
1379
1720
|
|
@@ -1438,13 +1779,6 @@
|
|
1438
1779
|
}
|
1439
1780
|
};
|
1440
1781
|
|
1441
|
-
BootstrapTable.prototype.getGroupSelections = function (index) {
|
1442
|
-
var that = this;
|
1443
|
-
return this.data.filter(function (row) {
|
1444
|
-
return row[that.header.stateField] && row._data['parent-index'] === index;
|
1445
|
-
});
|
1446
|
-
};
|
1447
|
-
|
1448
1782
|
BootstrapTable.prototype.checkGroup = function (index) {
|
1449
1783
|
this.checkGroup_(index, true);
|
1450
1784
|
};
|
@@ -1454,25 +1788,78 @@
|
|
1454
1788
|
};
|
1455
1789
|
|
1456
1790
|
BootstrapTable.prototype.checkGroup_ = function (index, checked) {
|
1457
|
-
var
|
1791
|
+
var rowsBefore = this.getSelections();
|
1458
1792
|
|
1459
1793
|
var filter = function filter() {
|
1460
1794
|
return $(this).closest('tr').data('parent-index') === index;
|
1461
1795
|
};
|
1462
1796
|
|
1463
|
-
if (!checked) {
|
1464
|
-
rows = this.getGroupSelections(index);
|
1465
|
-
}
|
1466
|
-
|
1467
1797
|
this.$selectItem.filter(filter).prop('checked', checked);
|
1468
1798
|
this.updateRows();
|
1469
1799
|
this.updateSelected();
|
1800
|
+
var rowsAfter = this.getSelections();
|
1470
1801
|
|
1471
1802
|
if (checked) {
|
1472
|
-
|
1803
|
+
this.trigger('check-all', rowsAfter, rowsBefore);
|
1804
|
+
return;
|
1805
|
+
}
|
1806
|
+
|
1807
|
+
this.trigger('uncheck-all', rowsAfter, rowsBefore);
|
1808
|
+
};
|
1809
|
+
|
1810
|
+
BootstrapTable.prototype.getGroupByFields = function () {
|
1811
|
+
var groupByFields = this.options.groupByField;
|
1812
|
+
|
1813
|
+
if (!$.isArray(this.options.groupByField)) {
|
1814
|
+
groupByFields = [this.options.groupByField];
|
1473
1815
|
}
|
1474
1816
|
|
1475
|
-
|
1817
|
+
return groupByFields;
|
1476
1818
|
};
|
1477
1819
|
|
1478
|
-
|
1820
|
+
$.BootstrapTable =
|
1821
|
+
/*#__PURE__*/
|
1822
|
+
function (_$$BootstrapTable) {
|
1823
|
+
_inherits(_class, _$$BootstrapTable);
|
1824
|
+
|
1825
|
+
function _class() {
|
1826
|
+
_classCallCheck(this, _class);
|
1827
|
+
|
1828
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
_createClass(_class, [{
|
1832
|
+
key: "scrollTo",
|
1833
|
+
value: function scrollTo(params) {
|
1834
|
+
if (this.options.groupBy) {
|
1835
|
+
var options = {
|
1836
|
+
unit: 'px',
|
1837
|
+
value: 0
|
1838
|
+
};
|
1839
|
+
|
1840
|
+
if (_typeof(params) === 'object') {
|
1841
|
+
options = Object.assign(options, params);
|
1842
|
+
}
|
1843
|
+
|
1844
|
+
if (options.unit === 'rows') {
|
1845
|
+
var scrollTo = 0;
|
1846
|
+
this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
|
1847
|
+
scrollTo += $(el).outerHeight(true);
|
1848
|
+
});
|
1849
|
+
var $targetColumn = this.$body.find("> tr:not(.groupBy):eq(".concat(options.value, ")"));
|
1850
|
+
$targetColumn.prevAll('.groupBy').each(function (i, el) {
|
1851
|
+
scrollTo += $(el).outerHeight(true);
|
1852
|
+
});
|
1853
|
+
this.$tableBody.scrollTop(scrollTo);
|
1854
|
+
return;
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
_get(_getPrototypeOf(_class.prototype), "scrollTo", this).call(this, params);
|
1859
|
+
}
|
1860
|
+
}]);
|
1861
|
+
|
1862
|
+
return _class;
|
1863
|
+
}($.BootstrapTable);
|
1864
|
+
|
1865
|
+
})));
|