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' ? module.exports = factory(require('jquery')) :
|
3
3
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4
4
|
(global = global || self, global.BootstrapTable = 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
|
|
@@ -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);
|
@@ -526,6 +532,12 @@
|
|
526
532
|
return !String(Symbol());
|
527
533
|
});
|
528
534
|
|
535
|
+
var useSymbolAsUid = nativeSymbol
|
536
|
+
// eslint-disable-next-line no-undef
|
537
|
+
&& !Symbol.sham
|
538
|
+
// eslint-disable-next-line no-undef
|
539
|
+
&& typeof Symbol() == 'symbol';
|
540
|
+
|
529
541
|
// `IsArray` abstract operation
|
530
542
|
// https://tc39.github.io/ecma262/#sec-isarray
|
531
543
|
var isArray = Array.isArray || function isArray(arg) {
|
@@ -558,49 +570,77 @@
|
|
558
570
|
|
559
571
|
var html = getBuiltIn('document', 'documentElement');
|
560
572
|
|
573
|
+
var GT = '>';
|
574
|
+
var LT = '<';
|
575
|
+
var PROTOTYPE = 'prototype';
|
576
|
+
var SCRIPT = 'script';
|
561
577
|
var IE_PROTO = sharedKey('IE_PROTO');
|
562
578
|
|
563
|
-
var
|
564
|
-
|
579
|
+
var EmptyConstructor = function () { /* empty */ };
|
580
|
+
|
581
|
+
var scriptTag = function (content) {
|
582
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
583
|
+
};
|
584
|
+
|
585
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
586
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
587
|
+
activeXDocument.write(scriptTag(''));
|
588
|
+
activeXDocument.close();
|
589
|
+
var temp = activeXDocument.parentWindow.Object;
|
590
|
+
activeXDocument = null; // avoid memory leak
|
591
|
+
return temp;
|
592
|
+
};
|
565
593
|
|
566
594
|
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
567
|
-
var
|
595
|
+
var NullProtoObjectViaIFrame = function () {
|
568
596
|
// Thrash, waste and sodomy: IE GC bug
|
569
597
|
var iframe = documentCreateElement('iframe');
|
570
|
-
var
|
571
|
-
var lt = '<';
|
572
|
-
var script = 'script';
|
573
|
-
var gt = '>';
|
574
|
-
var js = 'java' + script + ':';
|
598
|
+
var JS = 'java' + SCRIPT + ':';
|
575
599
|
var iframeDocument;
|
576
600
|
iframe.style.display = 'none';
|
577
601
|
html.appendChild(iframe);
|
578
|
-
|
602
|
+
// https://github.com/zloirock/core-js/issues/475
|
603
|
+
iframe.src = String(JS);
|
579
604
|
iframeDocument = iframe.contentWindow.document;
|
580
605
|
iframeDocument.open();
|
581
|
-
iframeDocument.write(
|
606
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
582
607
|
iframeDocument.close();
|
583
|
-
|
584
|
-
|
585
|
-
|
608
|
+
return iframeDocument.F;
|
609
|
+
};
|
610
|
+
|
611
|
+
// Check for document.domain and active x support
|
612
|
+
// No need to use active x approach when document.domain is not set
|
613
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
614
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
615
|
+
// avoid IE GC bug
|
616
|
+
var activeXDocument;
|
617
|
+
var NullProtoObject = function () {
|
618
|
+
try {
|
619
|
+
/* global ActiveXObject */
|
620
|
+
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
621
|
+
} catch (error) { /* ignore */ }
|
622
|
+
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
623
|
+
var length = enumBugKeys.length;
|
624
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
625
|
+
return NullProtoObject();
|
586
626
|
};
|
587
627
|
|
628
|
+
hiddenKeys[IE_PROTO] = true;
|
629
|
+
|
588
630
|
// `Object.create` method
|
589
631
|
// https://tc39.github.io/ecma262/#sec-object.create
|
590
632
|
var objectCreate = Object.create || function create(O, Properties) {
|
591
633
|
var result;
|
592
634
|
if (O !== null) {
|
593
|
-
|
594
|
-
result = new
|
595
|
-
|
635
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
636
|
+
result = new EmptyConstructor();
|
637
|
+
EmptyConstructor[PROTOTYPE] = null;
|
596
638
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
597
639
|
result[IE_PROTO] = O;
|
598
|
-
} else result =
|
640
|
+
} else result = NullProtoObject();
|
599
641
|
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
600
642
|
};
|
601
643
|
|
602
|
-
hiddenKeys[IE_PROTO] = true;
|
603
|
-
|
604
644
|
var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
|
605
645
|
|
606
646
|
var toString$1 = {}.toString;
|
@@ -627,12 +667,15 @@
|
|
627
667
|
f: f$5
|
628
668
|
};
|
629
669
|
|
670
|
+
var WellKnownSymbolsStore = shared('wks');
|
630
671
|
var Symbol$1 = global_1.Symbol;
|
631
|
-
var
|
672
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
|
632
673
|
|
633
674
|
var wellKnownSymbol = function (name) {
|
634
|
-
|
635
|
-
|
675
|
+
if (!has(WellKnownSymbolsStore, name)) {
|
676
|
+
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
677
|
+
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
678
|
+
} return WellKnownSymbolsStore[name];
|
636
679
|
};
|
637
680
|
|
638
681
|
var f$6 = wellKnownSymbol;
|
@@ -778,8 +821,7 @@
|
|
778
821
|
var getInternalState = internalState.getterFor(SYMBOL);
|
779
822
|
var ObjectPrototype = Object[PROTOTYPE$1];
|
780
823
|
var $Symbol = global_1.Symbol;
|
781
|
-
var
|
782
|
-
var nativeJSONStringify = JSON$1 && JSON$1.stringify;
|
824
|
+
var $stringify = getBuiltIn('JSON', 'stringify');
|
783
825
|
var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
784
826
|
var nativeDefineProperty$1 = objectDefineProperty.f;
|
785
827
|
var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
|
@@ -788,7 +830,7 @@
|
|
788
830
|
var ObjectPrototypeSymbols = shared('op-symbols');
|
789
831
|
var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
790
832
|
var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
791
|
-
var WellKnownSymbolsStore = shared('wks');
|
833
|
+
var WellKnownSymbolsStore$1 = shared('wks');
|
792
834
|
var QObject = global_1.QObject;
|
793
835
|
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
794
836
|
var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
|
@@ -931,7 +973,9 @@
|
|
931
973
|
redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
932
974
|
}
|
933
975
|
}
|
976
|
+
}
|
934
977
|
|
978
|
+
if (!useSymbolAsUid) {
|
935
979
|
wrappedWellKnownSymbol.f = function (name) {
|
936
980
|
return wrap(wellKnownSymbol(name), name);
|
937
981
|
};
|
@@ -941,7 +985,7 @@
|
|
941
985
|
Symbol: $Symbol
|
942
986
|
});
|
943
987
|
|
944
|
-
$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
988
|
+
$forEach(objectKeys(WellKnownSymbolsStore$1), function (name) {
|
945
989
|
defineWellKnownSymbol(name);
|
946
990
|
});
|
947
991
|
|
@@ -1000,34 +1044,41 @@
|
|
1000
1044
|
|
1001
1045
|
// `JSON.stringify` method behavior with symbols
|
1002
1046
|
// https://tc39.github.io/ecma262/#sec-json.stringify
|
1003
|
-
|
1004
|
-
var
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1047
|
+
if ($stringify) {
|
1048
|
+
var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
|
1049
|
+
var symbol = $Symbol();
|
1050
|
+
// MS Edge converts symbol values to JSON as {}
|
1051
|
+
return $stringify([symbol]) != '[null]'
|
1052
|
+
// WebKit converts symbol values to JSON as null
|
1053
|
+
|| $stringify({ a: symbol }) != '{}'
|
1054
|
+
// V8 throws on boxed symbols
|
1055
|
+
|| $stringify(Object(symbol)) != '{}';
|
1056
|
+
});
|
1057
|
+
|
1058
|
+
_export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
1059
|
+
// eslint-disable-next-line no-unused-vars
|
1060
|
+
stringify: function stringify(it, replacer, space) {
|
1061
|
+
var args = [it];
|
1062
|
+
var index = 1;
|
1063
|
+
var $replacer;
|
1064
|
+
while (arguments.length > index) args.push(arguments[index++]);
|
1065
|
+
$replacer = replacer;
|
1066
|
+
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
|
1067
|
+
if (!isArray(replacer)) replacer = function (key, value) {
|
1068
|
+
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
1069
|
+
if (!isSymbol(value)) return value;
|
1070
|
+
};
|
1071
|
+
args[1] = replacer;
|
1072
|
+
return $stringify.apply(null, args);
|
1073
|
+
}
|
1074
|
+
});
|
1075
|
+
}
|
1027
1076
|
|
1028
1077
|
// `Symbol.prototype[@@toPrimitive]` method
|
1029
1078
|
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
|
1030
|
-
if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE])
|
1079
|
+
if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
|
1080
|
+
createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
|
1081
|
+
}
|
1031
1082
|
// `Symbol.prototype[@@toStringTag]` property
|
1032
1083
|
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
|
1033
1084
|
setToStringTag($Symbol, SYMBOL);
|
@@ -1087,10 +1138,33 @@
|
|
1087
1138
|
else object[propertyKey] = value;
|
1088
1139
|
};
|
1089
1140
|
|
1141
|
+
var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
1142
|
+
|
1143
|
+
var process = global_1.process;
|
1144
|
+
var versions = process && process.versions;
|
1145
|
+
var v8 = versions && versions.v8;
|
1146
|
+
var match, version;
|
1147
|
+
|
1148
|
+
if (v8) {
|
1149
|
+
match = v8.split('.');
|
1150
|
+
version = match[0] + match[1];
|
1151
|
+
} else if (userAgent) {
|
1152
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
1153
|
+
if (!match || match[1] >= 74) {
|
1154
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
1155
|
+
if (match) version = match[1];
|
1156
|
+
}
|
1157
|
+
}
|
1158
|
+
|
1159
|
+
var v8Version = version && +version;
|
1160
|
+
|
1090
1161
|
var SPECIES$1 = wellKnownSymbol('species');
|
1091
1162
|
|
1092
1163
|
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
1093
|
-
|
1164
|
+
// We can't use this feature detection in V8 since it causes
|
1165
|
+
// deoptimization and serious performance degradation
|
1166
|
+
// https://github.com/zloirock/core-js/issues/677
|
1167
|
+
return v8Version >= 51 || !fails(function () {
|
1094
1168
|
var array = [];
|
1095
1169
|
var constructor = array.constructor = {};
|
1096
1170
|
constructor[SPECIES$1] = function () {
|
@@ -1104,7 +1178,10 @@
|
|
1104
1178
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
1105
1179
|
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
1106
1180
|
|
1107
|
-
|
1181
|
+
// We can't use this feature detection in V8 since it causes
|
1182
|
+
// deoptimization and serious performance degradation
|
1183
|
+
// https://github.com/zloirock/core-js/issues/679
|
1184
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
1108
1185
|
var array = [];
|
1109
1186
|
array[IS_CONCAT_SPREADABLE] = false;
|
1110
1187
|
return array.concat()[0] !== array;
|
@@ -1148,10 +1225,17 @@
|
|
1148
1225
|
var $filter = arrayIteration.filter;
|
1149
1226
|
|
1150
1227
|
|
1228
|
+
|
1229
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
1230
|
+
// Edge 14- issue
|
1231
|
+
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
|
1232
|
+
[].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
1233
|
+
});
|
1234
|
+
|
1151
1235
|
// `Array.prototype.filter` method
|
1152
1236
|
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
|
1153
1237
|
// with adding support of @@species
|
1154
|
-
_export({ target: 'Array', proto: true, forced: !
|
1238
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
1155
1239
|
filter: function filter(callbackfn /* , thisArg */) {
|
1156
1240
|
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1157
1241
|
}
|
@@ -1163,7 +1247,10 @@
|
|
1163
1247
|
// Array.prototype[@@unscopables]
|
1164
1248
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
1165
1249
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
1166
|
-
|
1250
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
1251
|
+
configurable: true,
|
1252
|
+
value: objectCreate(null)
|
1253
|
+
});
|
1167
1254
|
}
|
1168
1255
|
|
1169
1256
|
// add a key to Array.prototype[@@unscopables]
|
@@ -1293,7 +1380,9 @@
|
|
1293
1380
|
if (IteratorPrototype == undefined) IteratorPrototype = {};
|
1294
1381
|
|
1295
1382
|
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
1296
|
-
if ( !has(IteratorPrototype, ITERATOR))
|
1383
|
+
if ( !has(IteratorPrototype, ITERATOR)) {
|
1384
|
+
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
1385
|
+
}
|
1297
1386
|
|
1298
1387
|
var iteratorsCore = {
|
1299
1388
|
IteratorPrototype: IteratorPrototype,
|
@@ -1377,7 +1466,7 @@
|
|
1377
1466
|
if (objectSetPrototypeOf) {
|
1378
1467
|
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
1379
1468
|
} else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
|
1380
|
-
|
1469
|
+
createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
|
1381
1470
|
}
|
1382
1471
|
}
|
1383
1472
|
// Set @@toStringTag to native iterators
|
@@ -1393,7 +1482,7 @@
|
|
1393
1482
|
|
1394
1483
|
// define iterator
|
1395
1484
|
if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
1396
|
-
|
1485
|
+
createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
|
1397
1486
|
}
|
1398
1487
|
|
1399
1488
|
// export additional methods
|
@@ -1468,6 +1557,40 @@
|
|
1468
1557
|
}
|
1469
1558
|
});
|
1470
1559
|
|
1560
|
+
var $map = arrayIteration.map;
|
1561
|
+
|
1562
|
+
|
1563
|
+
|
1564
|
+
var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
|
1565
|
+
// FF49- issue
|
1566
|
+
var USES_TO_LENGTH$1 = HAS_SPECIES_SUPPORT$1 && !fails(function () {
|
1567
|
+
[].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
1568
|
+
});
|
1569
|
+
|
1570
|
+
// `Array.prototype.map` method
|
1571
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.map
|
1572
|
+
// with adding support of @@species
|
1573
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$1 }, {
|
1574
|
+
map: function map(callbackfn /* , thisArg */) {
|
1575
|
+
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1576
|
+
}
|
1577
|
+
});
|
1578
|
+
|
1579
|
+
var nativeReverse = [].reverse;
|
1580
|
+
var test = [1, 2];
|
1581
|
+
|
1582
|
+
// `Array.prototype.reverse` method
|
1583
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
|
1584
|
+
// fix for Safari 12.0 bug
|
1585
|
+
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
1586
|
+
_export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
1587
|
+
reverse: function reverse() {
|
1588
|
+
// eslint-disable-next-line no-self-assign
|
1589
|
+
if (isArray(this)) this.length = this.length;
|
1590
|
+
return nativeReverse.call(this);
|
1591
|
+
}
|
1592
|
+
});
|
1593
|
+
|
1471
1594
|
var SPECIES$2 = wellKnownSymbol('species');
|
1472
1595
|
var nativeSlice = [].slice;
|
1473
1596
|
var max$1 = Math.max;
|
@@ -1503,16 +1626,16 @@
|
|
1503
1626
|
}
|
1504
1627
|
});
|
1505
1628
|
|
1506
|
-
var
|
1507
|
-
var
|
1629
|
+
var test$1 = [];
|
1630
|
+
var nativeSort = test$1.sort;
|
1508
1631
|
|
1509
1632
|
// IE8-
|
1510
1633
|
var FAILS_ON_UNDEFINED = fails(function () {
|
1511
|
-
test.sort(undefined);
|
1634
|
+
test$1.sort(undefined);
|
1512
1635
|
});
|
1513
1636
|
// V8 bug
|
1514
1637
|
var FAILS_ON_NULL = fails(function () {
|
1515
|
-
test.sort(null);
|
1638
|
+
test$1.sort(null);
|
1516
1639
|
});
|
1517
1640
|
// Old WebKit
|
1518
1641
|
var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
|
@@ -1700,11 +1823,22 @@
|
|
1700
1823
|
}
|
1701
1824
|
|
1702
1825
|
var nativeAssign = Object.assign;
|
1826
|
+
var defineProperty$4 = Object.defineProperty;
|
1703
1827
|
|
1704
1828
|
// `Object.assign` method
|
1705
1829
|
// https://tc39.github.io/ecma262/#sec-object.assign
|
1706
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
1707
1830
|
var objectAssign = !nativeAssign || fails(function () {
|
1831
|
+
// should have correct order of operations (Edge bug)
|
1832
|
+
if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$4({}, 'a', {
|
1833
|
+
enumerable: true,
|
1834
|
+
get: function () {
|
1835
|
+
defineProperty$4(this, 'b', {
|
1836
|
+
value: 3,
|
1837
|
+
enumerable: false
|
1838
|
+
});
|
1839
|
+
}
|
1840
|
+
}), { b: 2 })).b !== 1) return true;
|
1841
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
1708
1842
|
var A = {};
|
1709
1843
|
var B = {};
|
1710
1844
|
// eslint-disable-next-line no-undef
|
@@ -1779,6 +1913,13 @@
|
|
1779
1913
|
});
|
1780
1914
|
|
1781
1915
|
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
1916
|
+
var test$2 = {};
|
1917
|
+
|
1918
|
+
test$2[TO_STRING_TAG$1] = 'z';
|
1919
|
+
|
1920
|
+
var toStringTagSupport = String(test$2) === '[object z]';
|
1921
|
+
|
1922
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
1782
1923
|
// ES3 wrong here
|
1783
1924
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
1784
1925
|
|
@@ -1790,34 +1931,27 @@
|
|
1790
1931
|
};
|
1791
1932
|
|
1792
1933
|
// getting tag from ES6+ `Object.prototype.toString`
|
1793
|
-
var classof = function (it) {
|
1934
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
1794
1935
|
var O, tag, result;
|
1795
1936
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1796
1937
|
// @@toStringTag case
|
1797
|
-
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$
|
1938
|
+
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
|
1798
1939
|
// builtinTag case
|
1799
1940
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
1800
1941
|
// ES3 arguments fallback
|
1801
1942
|
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
1802
1943
|
};
|
1803
1944
|
|
1804
|
-
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
1805
|
-
var test$1 = {};
|
1806
|
-
|
1807
|
-
test$1[TO_STRING_TAG$2] = 'z';
|
1808
|
-
|
1809
1945
|
// `Object.prototype.toString` method implementation
|
1810
1946
|
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
1811
|
-
var objectToString =
|
1947
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
1812
1948
|
return '[object ' + classof(this) + ']';
|
1813
|
-
}
|
1814
|
-
|
1815
|
-
var ObjectPrototype$2 = Object.prototype;
|
1949
|
+
};
|
1816
1950
|
|
1817
1951
|
// `Object.prototype.toString` method
|
1818
1952
|
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
1819
|
-
if (
|
1820
|
-
redefine(
|
1953
|
+
if (!toStringTagSupport) {
|
1954
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
1821
1955
|
}
|
1822
1956
|
|
1823
1957
|
var trim$1 = stringTrim.trim;
|
@@ -1860,6 +1994,15 @@
|
|
1860
1994
|
parseInt: _parseInt
|
1861
1995
|
});
|
1862
1996
|
|
1997
|
+
var MATCH = wellKnownSymbol('match');
|
1998
|
+
|
1999
|
+
// `IsRegExp` abstract operation
|
2000
|
+
// https://tc39.github.io/ecma262/#sec-isregexp
|
2001
|
+
var isRegexp = function (it) {
|
2002
|
+
var isRegExp;
|
2003
|
+
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
2004
|
+
};
|
2005
|
+
|
1863
2006
|
// `RegExp.prototype.flags` getter implementation
|
1864
2007
|
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
1865
2008
|
var regexpFlags = function () {
|
@@ -1874,9 +2017,217 @@
|
|
1874
2017
|
return result;
|
1875
2018
|
};
|
1876
2019
|
|
2020
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
|
2021
|
+
// so we use an intermediate function.
|
2022
|
+
function RE(s, f) {
|
2023
|
+
return RegExp(s, f);
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
var UNSUPPORTED_Y = fails(function () {
|
2027
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
2028
|
+
var re = RE('a', 'y');
|
2029
|
+
re.lastIndex = 2;
|
2030
|
+
return re.exec('abcd') != null;
|
2031
|
+
});
|
2032
|
+
|
2033
|
+
var BROKEN_CARET = fails(function () {
|
2034
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
2035
|
+
var re = RE('^r', 'gy');
|
2036
|
+
re.lastIndex = 2;
|
2037
|
+
return re.exec('str') != null;
|
2038
|
+
});
|
2039
|
+
|
2040
|
+
var regexpStickyHelpers = {
|
2041
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y,
|
2042
|
+
BROKEN_CARET: BROKEN_CARET
|
2043
|
+
};
|
2044
|
+
|
2045
|
+
var SPECIES$3 = wellKnownSymbol('species');
|
2046
|
+
|
2047
|
+
var setSpecies = function (CONSTRUCTOR_NAME) {
|
2048
|
+
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
2049
|
+
var defineProperty = objectDefineProperty.f;
|
2050
|
+
|
2051
|
+
if (descriptors && Constructor && !Constructor[SPECIES$3]) {
|
2052
|
+
defineProperty(Constructor, SPECIES$3, {
|
2053
|
+
configurable: true,
|
2054
|
+
get: function () { return this; }
|
2055
|
+
});
|
2056
|
+
}
|
2057
|
+
};
|
2058
|
+
|
2059
|
+
var defineProperty$5 = objectDefineProperty.f;
|
2060
|
+
var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
2061
|
+
|
2062
|
+
|
2063
|
+
|
2064
|
+
|
2065
|
+
|
2066
|
+
var setInternalState$2 = internalState.set;
|
2067
|
+
|
2068
|
+
|
2069
|
+
|
2070
|
+
var MATCH$1 = wellKnownSymbol('match');
|
2071
|
+
var NativeRegExp = global_1.RegExp;
|
2072
|
+
var RegExpPrototype = NativeRegExp.prototype;
|
2073
|
+
var re1 = /a/g;
|
2074
|
+
var re2 = /a/g;
|
2075
|
+
|
2076
|
+
// "new" should create a new object, old webkit bug
|
2077
|
+
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
2078
|
+
|
2079
|
+
var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
|
2080
|
+
|
2081
|
+
var FORCED$4 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
|
2082
|
+
re2[MATCH$1] = false;
|
2083
|
+
// RegExp constructor can alter flags and IsRegExp works correct with @@match
|
2084
|
+
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
2085
|
+
})));
|
2086
|
+
|
2087
|
+
// `RegExp` constructor
|
2088
|
+
// https://tc39.github.io/ecma262/#sec-regexp-constructor
|
2089
|
+
if (FORCED$4) {
|
2090
|
+
var RegExpWrapper = function RegExp(pattern, flags) {
|
2091
|
+
var thisIsRegExp = this instanceof RegExpWrapper;
|
2092
|
+
var patternIsRegExp = isRegexp(pattern);
|
2093
|
+
var flagsAreUndefined = flags === undefined;
|
2094
|
+
var sticky;
|
2095
|
+
|
2096
|
+
if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
|
2097
|
+
return pattern;
|
2098
|
+
}
|
2099
|
+
|
2100
|
+
if (CORRECT_NEW) {
|
2101
|
+
if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
|
2102
|
+
} else if (pattern instanceof RegExpWrapper) {
|
2103
|
+
if (flagsAreUndefined) flags = regexpFlags.call(pattern);
|
2104
|
+
pattern = pattern.source;
|
2105
|
+
}
|
2106
|
+
|
2107
|
+
if (UNSUPPORTED_Y$1) {
|
2108
|
+
sticky = !!flags && flags.indexOf('y') > -1;
|
2109
|
+
if (sticky) flags = flags.replace(/y/g, '');
|
2110
|
+
}
|
2111
|
+
|
2112
|
+
var result = inheritIfRequired(
|
2113
|
+
CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
|
2114
|
+
thisIsRegExp ? this : RegExpPrototype,
|
2115
|
+
RegExpWrapper
|
2116
|
+
);
|
2117
|
+
|
2118
|
+
if (UNSUPPORTED_Y$1 && sticky) setInternalState$2(result, { sticky: sticky });
|
2119
|
+
|
2120
|
+
return result;
|
2121
|
+
};
|
2122
|
+
var proxy = function (key) {
|
2123
|
+
key in RegExpWrapper || defineProperty$5(RegExpWrapper, key, {
|
2124
|
+
configurable: true,
|
2125
|
+
get: function () { return NativeRegExp[key]; },
|
2126
|
+
set: function (it) { NativeRegExp[key] = it; }
|
2127
|
+
});
|
2128
|
+
};
|
2129
|
+
var keys$2 = getOwnPropertyNames$1(NativeRegExp);
|
2130
|
+
var index = 0;
|
2131
|
+
while (keys$2.length > index) proxy(keys$2[index++]);
|
2132
|
+
RegExpPrototype.constructor = RegExpWrapper;
|
2133
|
+
RegExpWrapper.prototype = RegExpPrototype;
|
2134
|
+
redefine(global_1, 'RegExp', RegExpWrapper);
|
2135
|
+
}
|
2136
|
+
|
2137
|
+
// https://tc39.github.io/ecma262/#sec-get-regexp-@@species
|
2138
|
+
setSpecies('RegExp');
|
2139
|
+
|
2140
|
+
var nativeExec = RegExp.prototype.exec;
|
2141
|
+
// This always refers to the native implementation, because the
|
2142
|
+
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
2143
|
+
// which loads this file before patching the method.
|
2144
|
+
var nativeReplace = String.prototype.replace;
|
2145
|
+
|
2146
|
+
var patchedExec = nativeExec;
|
2147
|
+
|
2148
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
2149
|
+
var re1 = /a/;
|
2150
|
+
var re2 = /b*/g;
|
2151
|
+
nativeExec.call(re1, 'a');
|
2152
|
+
nativeExec.call(re2, 'a');
|
2153
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
2154
|
+
})();
|
2155
|
+
|
2156
|
+
var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
|
2157
|
+
|
2158
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
2159
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
2160
|
+
|
2161
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
|
2162
|
+
|
2163
|
+
if (PATCH) {
|
2164
|
+
patchedExec = function exec(str) {
|
2165
|
+
var re = this;
|
2166
|
+
var lastIndex, reCopy, match, i;
|
2167
|
+
var sticky = UNSUPPORTED_Y$2 && re.sticky;
|
2168
|
+
var flags = regexpFlags.call(re);
|
2169
|
+
var source = re.source;
|
2170
|
+
var charsAdded = 0;
|
2171
|
+
var strCopy = str;
|
2172
|
+
|
2173
|
+
if (sticky) {
|
2174
|
+
flags = flags.replace('y', '');
|
2175
|
+
if (flags.indexOf('g') === -1) {
|
2176
|
+
flags += 'g';
|
2177
|
+
}
|
2178
|
+
|
2179
|
+
strCopy = String(str).slice(re.lastIndex);
|
2180
|
+
// Support anchored sticky behavior.
|
2181
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
2182
|
+
source = '(?: ' + source + ')';
|
2183
|
+
strCopy = ' ' + strCopy;
|
2184
|
+
charsAdded++;
|
2185
|
+
}
|
2186
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
2187
|
+
// simulate the 'y' flag.
|
2188
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
if (NPCG_INCLUDED) {
|
2192
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
2193
|
+
}
|
2194
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
2195
|
+
|
2196
|
+
match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
2197
|
+
|
2198
|
+
if (sticky) {
|
2199
|
+
if (match) {
|
2200
|
+
match.input = match.input.slice(charsAdded);
|
2201
|
+
match[0] = match[0].slice(charsAdded);
|
2202
|
+
match.index = re.lastIndex;
|
2203
|
+
re.lastIndex += match[0].length;
|
2204
|
+
} else re.lastIndex = 0;
|
2205
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
2206
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
2207
|
+
}
|
2208
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
2209
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
2210
|
+
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
2211
|
+
nativeReplace.call(match[0], reCopy, function () {
|
2212
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
2213
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
2214
|
+
}
|
2215
|
+
});
|
2216
|
+
}
|
2217
|
+
|
2218
|
+
return match;
|
2219
|
+
};
|
2220
|
+
}
|
2221
|
+
|
2222
|
+
var regexpExec = patchedExec;
|
2223
|
+
|
2224
|
+
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
2225
|
+
exec: regexpExec
|
2226
|
+
});
|
2227
|
+
|
1877
2228
|
var TO_STRING = 'toString';
|
1878
|
-
var RegExpPrototype = RegExp.prototype;
|
1879
|
-
var nativeToString = RegExpPrototype[TO_STRING];
|
2229
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
2230
|
+
var nativeToString = RegExpPrototype$1[TO_STRING];
|
1880
2231
|
|
1881
2232
|
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
1882
2233
|
// FF44- RegExp#toString has a wrong name
|
@@ -1889,27 +2240,18 @@
|
|
1889
2240
|
var R = anObject(this);
|
1890
2241
|
var p = String(R.source);
|
1891
2242
|
var rf = R.flags;
|
1892
|
-
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
|
2243
|
+
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
|
1893
2244
|
return '/' + p + '/' + f;
|
1894
2245
|
}, { unsafe: true });
|
1895
2246
|
}
|
1896
2247
|
|
1897
|
-
var MATCH = wellKnownSymbol('match');
|
1898
|
-
|
1899
|
-
// `IsRegExp` abstract operation
|
1900
|
-
// https://tc39.github.io/ecma262/#sec-isregexp
|
1901
|
-
var isRegexp = function (it) {
|
1902
|
-
var isRegExp;
|
1903
|
-
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
1904
|
-
};
|
1905
|
-
|
1906
2248
|
var notARegexp = function (it) {
|
1907
2249
|
if (isRegexp(it)) {
|
1908
2250
|
throw TypeError("The method doesn't accept regular expressions");
|
1909
2251
|
} return it;
|
1910
2252
|
};
|
1911
2253
|
|
1912
|
-
var MATCH$
|
2254
|
+
var MATCH$2 = wellKnownSymbol('match');
|
1913
2255
|
|
1914
2256
|
var correctIsRegexpLogic = function (METHOD_NAME) {
|
1915
2257
|
var regexp = /./;
|
@@ -1917,7 +2259,7 @@
|
|
1917
2259
|
'/./'[METHOD_NAME](regexp);
|
1918
2260
|
} catch (e) {
|
1919
2261
|
try {
|
1920
|
-
regexp[MATCH$
|
2262
|
+
regexp[MATCH$2] = false;
|
1921
2263
|
return '/./'[METHOD_NAME](regexp);
|
1922
2264
|
} catch (f) { /* empty */ }
|
1923
2265
|
} return false;
|
@@ -1962,13 +2304,13 @@
|
|
1962
2304
|
|
1963
2305
|
|
1964
2306
|
var STRING_ITERATOR = 'String Iterator';
|
1965
|
-
var setInternalState$
|
2307
|
+
var setInternalState$3 = internalState.set;
|
1966
2308
|
var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
|
1967
2309
|
|
1968
2310
|
// `String.prototype[@@iterator]` method
|
1969
2311
|
// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
|
1970
2312
|
defineIterator(String, 'String', function (iterated) {
|
1971
|
-
setInternalState$
|
2313
|
+
setInternalState$3(this, {
|
1972
2314
|
type: STRING_ITERATOR,
|
1973
2315
|
string: String(iterated),
|
1974
2316
|
index: 0
|
@@ -1986,59 +2328,7 @@
|
|
1986
2328
|
return { value: point, done: false };
|
1987
2329
|
});
|
1988
2330
|
|
1989
|
-
var
|
1990
|
-
// This always refers to the native implementation, because the
|
1991
|
-
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
1992
|
-
// which loads this file before patching the method.
|
1993
|
-
var nativeReplace = String.prototype.replace;
|
1994
|
-
|
1995
|
-
var patchedExec = nativeExec;
|
1996
|
-
|
1997
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
1998
|
-
var re1 = /a/;
|
1999
|
-
var re2 = /b*/g;
|
2000
|
-
nativeExec.call(re1, 'a');
|
2001
|
-
nativeExec.call(re2, 'a');
|
2002
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
2003
|
-
})();
|
2004
|
-
|
2005
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
2006
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
2007
|
-
|
2008
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
2009
|
-
|
2010
|
-
if (PATCH) {
|
2011
|
-
patchedExec = function exec(str) {
|
2012
|
-
var re = this;
|
2013
|
-
var lastIndex, reCopy, match, i;
|
2014
|
-
|
2015
|
-
if (NPCG_INCLUDED) {
|
2016
|
-
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
|
2017
|
-
}
|
2018
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
2019
|
-
|
2020
|
-
match = nativeExec.call(re, str);
|
2021
|
-
|
2022
|
-
if (UPDATES_LAST_INDEX_WRONG && match) {
|
2023
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
2024
|
-
}
|
2025
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
2026
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
2027
|
-
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
2028
|
-
nativeReplace.call(match[0], reCopy, function () {
|
2029
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
2030
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
2031
|
-
}
|
2032
|
-
});
|
2033
|
-
}
|
2034
|
-
|
2035
|
-
return match;
|
2036
|
-
};
|
2037
|
-
}
|
2038
|
-
|
2039
|
-
var regexpExec = patchedExec;
|
2040
|
-
|
2041
|
-
var SPECIES$3 = wellKnownSymbol('species');
|
2331
|
+
var SPECIES$4 = wellKnownSymbol('species');
|
2042
2332
|
|
2043
2333
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
2044
2334
|
// #replace needs built-in support for named groups.
|
@@ -2053,6 +2343,12 @@
|
|
2053
2343
|
return ''.replace(re, '$<a>') !== '7';
|
2054
2344
|
});
|
2055
2345
|
|
2346
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
2347
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
2348
|
+
var REPLACE_KEEPS_$0 = (function () {
|
2349
|
+
return 'a'.replace(/./, '$0') === '$0';
|
2350
|
+
})();
|
2351
|
+
|
2056
2352
|
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
2057
2353
|
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
2058
2354
|
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
@@ -2077,15 +2373,22 @@
|
|
2077
2373
|
// Symbol-named RegExp methods call .exec
|
2078
2374
|
var execCalled = false;
|
2079
2375
|
var re = /a/;
|
2080
|
-
re.exec = function () { execCalled = true; return null; };
|
2081
2376
|
|
2082
2377
|
if (KEY === 'split') {
|
2378
|
+
// We can't use real regex here since it causes deoptimization
|
2379
|
+
// and serious performance degradation in V8
|
2380
|
+
// https://github.com/zloirock/core-js/issues/306
|
2381
|
+
re = {};
|
2083
2382
|
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
2084
2383
|
// a new one. We need to return the patched regex when creating the new one.
|
2085
2384
|
re.constructor = {};
|
2086
|
-
re.constructor[SPECIES$
|
2385
|
+
re.constructor[SPECIES$4] = function () { return re; };
|
2386
|
+
re.flags = '';
|
2387
|
+
re[SYMBOL] = /./[SYMBOL];
|
2087
2388
|
}
|
2088
2389
|
|
2390
|
+
re.exec = function () { execCalled = true; return null; };
|
2391
|
+
|
2089
2392
|
re[SYMBOL]('');
|
2090
2393
|
return !execCalled;
|
2091
2394
|
});
|
@@ -2093,7 +2396,7 @@
|
|
2093
2396
|
if (
|
2094
2397
|
!DELEGATES_TO_SYMBOL ||
|
2095
2398
|
!DELEGATES_TO_EXEC ||
|
2096
|
-
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
2399
|
+
(KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
|
2097
2400
|
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
2098
2401
|
) {
|
2099
2402
|
var nativeRegExpMethod = /./[SYMBOL];
|
@@ -2108,7 +2411,7 @@
|
|
2108
2411
|
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
2109
2412
|
}
|
2110
2413
|
return { done: false };
|
2111
|
-
});
|
2414
|
+
}, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
|
2112
2415
|
var stringMethod = methods[0];
|
2113
2416
|
var regexMethod = methods[1];
|
2114
2417
|
|
@@ -2121,8 +2424,9 @@
|
|
2121
2424
|
// 21.2.5.9 RegExp.prototype[@@search](string)
|
2122
2425
|
: function (string) { return regexMethod.call(string, this); }
|
2123
2426
|
);
|
2124
|
-
if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
2125
2427
|
}
|
2428
|
+
|
2429
|
+
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
2126
2430
|
};
|
2127
2431
|
|
2128
2432
|
var charAt$1 = stringMultibyte.charAt;
|
@@ -2163,7 +2467,7 @@
|
|
2163
2467
|
};
|
2164
2468
|
|
2165
2469
|
// @@replace logic
|
2166
|
-
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
|
2470
|
+
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
2167
2471
|
return [
|
2168
2472
|
// `String.prototype.replace` method
|
2169
2473
|
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
@@ -2177,8 +2481,10 @@
|
|
2177
2481
|
// `RegExp.prototype[@@replace]` method
|
2178
2482
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
2179
2483
|
function (regexp, replaceValue) {
|
2180
|
-
|
2181
|
-
|
2484
|
+
if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
|
2485
|
+
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
2486
|
+
if (res.done) return res.value;
|
2487
|
+
}
|
2182
2488
|
|
2183
2489
|
var rx = anObject(regexp);
|
2184
2490
|
var S = String(this);
|
@@ -2304,14 +2610,14 @@
|
|
2304
2610
|
];
|
2305
2611
|
});
|
2306
2612
|
|
2307
|
-
var SPECIES$
|
2613
|
+
var SPECIES$5 = wellKnownSymbol('species');
|
2308
2614
|
|
2309
2615
|
// `SpeciesConstructor` abstract operation
|
2310
2616
|
// https://tc39.github.io/ecma262/#sec-speciesconstructor
|
2311
2617
|
var speciesConstructor = function (O, defaultConstructor) {
|
2312
2618
|
var C = anObject(O).constructor;
|
2313
2619
|
var S;
|
2314
|
-
return C === undefined || (S = anObject(C)[SPECIES$
|
2620
|
+
return C === undefined || (S = anObject(C)[SPECIES$5]) == undefined ? defaultConstructor : aFunction$1(S);
|
2315
2621
|
};
|
2316
2622
|
|
2317
2623
|
var arrayPush = [].push;
|
@@ -2508,7 +2814,7 @@
|
|
2508
2814
|
var CollectionPrototype = Collection && Collection.prototype;
|
2509
2815
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
2510
2816
|
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
2511
|
-
|
2817
|
+
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
2512
2818
|
} catch (error) {
|
2513
2819
|
CollectionPrototype.forEach = arrayForEach;
|
2514
2820
|
}
|
@@ -2524,15 +2830,17 @@
|
|
2524
2830
|
if (CollectionPrototype$1) {
|
2525
2831
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
2526
2832
|
if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues) try {
|
2527
|
-
|
2833
|
+
createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$2, ArrayValues);
|
2528
2834
|
} catch (error) {
|
2529
2835
|
CollectionPrototype$1[ITERATOR$2] = ArrayValues;
|
2530
2836
|
}
|
2531
|
-
if (!CollectionPrototype$1[TO_STRING_TAG$3])
|
2837
|
+
if (!CollectionPrototype$1[TO_STRING_TAG$3]) {
|
2838
|
+
createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
|
2839
|
+
}
|
2532
2840
|
if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
|
2533
2841
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
2534
2842
|
if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
|
2535
|
-
|
2843
|
+
createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
|
2536
2844
|
} catch (error) {
|
2537
2845
|
CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
|
2538
2846
|
}
|
@@ -2601,6 +2909,10 @@
|
|
2601
2909
|
}
|
2602
2910
|
|
2603
2911
|
function _iterableToArrayLimit(arr, i) {
|
2912
|
+
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
2913
|
+
return;
|
2914
|
+
}
|
2915
|
+
|
2604
2916
|
var _arr = [];
|
2605
2917
|
var _n = true;
|
2606
2918
|
var _d = false;
|
@@ -2634,7 +2946,7 @@
|
|
2634
2946
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
2635
2947
|
}
|
2636
2948
|
|
2637
|
-
var VERSION = '1.
|
2949
|
+
var VERSION = '1.18.0';
|
2638
2950
|
var bootstrapVersion = 4;
|
2639
2951
|
|
2640
2952
|
try {
|
@@ -2647,6 +2959,16 @@
|
|
2647
2959
|
} catch (e) {// ignore
|
2648
2960
|
}
|
2649
2961
|
|
2962
|
+
try {
|
2963
|
+
// eslint-disable-next-line no-undef
|
2964
|
+
var _rawVersion = bootstrap.Tooltip.VERSION;
|
2965
|
+
|
2966
|
+
if (_rawVersion !== undefined) {
|
2967
|
+
bootstrapVersion = parseInt(_rawVersion, 10);
|
2968
|
+
}
|
2969
|
+
} catch (e) {// ignore
|
2970
|
+
}
|
2971
|
+
|
2650
2972
|
var CONSTANTS = {
|
2651
2973
|
3: {
|
2652
2974
|
iconsPrefix: 'glyphicon',
|
@@ -2680,7 +3002,7 @@
|
|
2680
3002
|
},
|
2681
3003
|
html: {
|
2682
3004
|
toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
|
2683
|
-
toolbarDropdownItem: '<li role="menuitem"><label>%s</label></li>',
|
3005
|
+
toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
|
2684
3006
|
toolbarDropdownSeparator: '<li class="divider"></li>',
|
2685
3007
|
pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
|
2686
3008
|
pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
|
@@ -2688,13 +3010,59 @@
|
|
2688
3010
|
pagination: ['<ul class="pagination%s">', '</ul>'],
|
2689
3011
|
paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
|
2690
3012
|
icon: '<i class="%s %s"></i>',
|
2691
|
-
inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
|
3013
|
+
inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
|
3014
|
+
searchInput: '<input class="%s%s" type="text" placeholder="%s">',
|
3015
|
+
searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
|
3016
|
+
searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
|
3017
|
+
}
|
3018
|
+
},
|
3019
|
+
4: {
|
3020
|
+
iconsPrefix: 'fa',
|
3021
|
+
icons: {
|
3022
|
+
paginationSwitchDown: 'fa-caret-square-down',
|
3023
|
+
paginationSwitchUp: 'fa-caret-square-up',
|
3024
|
+
refresh: 'fa-sync',
|
3025
|
+
toggleOff: 'fa-toggle-off',
|
3026
|
+
toggleOn: 'fa-toggle-on',
|
3027
|
+
columns: 'fa-th-list',
|
3028
|
+
detailOpen: 'fa-plus',
|
3029
|
+
detailClose: 'fa-minus',
|
3030
|
+
fullscreen: 'fa-arrows-alt',
|
3031
|
+
search: 'fa-search',
|
3032
|
+
clearSearch: 'fa-trash'
|
3033
|
+
},
|
3034
|
+
classes: {
|
3035
|
+
buttonsPrefix: 'btn',
|
3036
|
+
buttons: 'secondary',
|
3037
|
+
buttonsGroup: 'btn-group',
|
3038
|
+
buttonsDropdown: 'btn-group',
|
3039
|
+
pull: 'float',
|
3040
|
+
inputGroup: 'btn-group',
|
3041
|
+
inputPrefix: 'form-control-',
|
3042
|
+
input: 'form-control',
|
3043
|
+
paginationDropdown: 'btn-group dropdown',
|
3044
|
+
dropup: 'dropup',
|
3045
|
+
dropdownActive: 'active',
|
3046
|
+
paginationActive: 'active',
|
3047
|
+
buttonActive: 'active'
|
3048
|
+
},
|
3049
|
+
html: {
|
3050
|
+
toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
|
3051
|
+
toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
|
3052
|
+
pageDropdown: ['<div class="dropdown-menu">', '</div>'],
|
3053
|
+
pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
|
3054
|
+
toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
|
3055
|
+
dropdownCaret: '<span class="caret"></span>',
|
3056
|
+
pagination: ['<ul class="pagination%s">', '</ul>'],
|
3057
|
+
paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
|
3058
|
+
icon: '<i class="%s %s"></i>',
|
3059
|
+
inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
|
2692
3060
|
searchInput: '<input class="%s%s" type="text" placeholder="%s">',
|
2693
3061
|
searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
|
2694
3062
|
searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
|
2695
3063
|
}
|
2696
3064
|
},
|
2697
|
-
|
3065
|
+
5: {
|
2698
3066
|
iconsPrefix: 'fa',
|
2699
3067
|
icons: {
|
2700
3068
|
paginationSwitchDown: 'fa-caret-square-down',
|
@@ -2726,7 +3094,7 @@
|
|
2726
3094
|
},
|
2727
3095
|
html: {
|
2728
3096
|
toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
|
2729
|
-
toolbarDropdownItem: '<label class="dropdown-item">%s</label>',
|
3097
|
+
toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
|
2730
3098
|
pageDropdown: ['<div class="dropdown-menu">', '</div>'],
|
2731
3099
|
pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
|
2732
3100
|
toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
|
@@ -2744,7 +3112,11 @@
|
|
2744
3112
|
var DEFAULTS = {
|
2745
3113
|
height: undefined,
|
2746
3114
|
classes: 'table table-bordered table-hover',
|
3115
|
+
buttons: {},
|
2747
3116
|
theadClasses: '',
|
3117
|
+
headerStyle: function headerStyle(column) {
|
3118
|
+
return {};
|
3119
|
+
},
|
2748
3120
|
rowStyle: function rowStyle(row, index) {
|
2749
3121
|
return {};
|
2750
3122
|
},
|
@@ -2759,9 +3131,11 @@
|
|
2759
3131
|
sortClass: undefined,
|
2760
3132
|
silentSort: true,
|
2761
3133
|
sortName: undefined,
|
2762
|
-
sortOrder:
|
3134
|
+
sortOrder: undefined,
|
3135
|
+
sortReset: false,
|
2763
3136
|
sortStable: false,
|
2764
3137
|
rememberOrder: false,
|
3138
|
+
serverSort: true,
|
2765
3139
|
customSort: undefined,
|
2766
3140
|
columns: [[]],
|
2767
3141
|
data: [],
|
@@ -2783,8 +3157,9 @@
|
|
2783
3157
|
totalField: 'total',
|
2784
3158
|
totalNotFilteredField: 'totalNotFiltered',
|
2785
3159
|
dataField: 'rows',
|
3160
|
+
footerField: 'footer',
|
2786
3161
|
pagination: false,
|
2787
|
-
|
3162
|
+
paginationParts: ['pageInfo', 'pageSize', 'pageList'],
|
2788
3163
|
showExtendedPagination: false,
|
2789
3164
|
paginationLoop: true,
|
2790
3165
|
sidePagination: 'client',
|
@@ -2809,8 +3184,10 @@
|
|
2809
3184
|
paginationUseIntermediate: false,
|
2810
3185
|
// Calculate intermediate pages for quick access
|
2811
3186
|
search: false,
|
3187
|
+
searchHighlight: false,
|
2812
3188
|
searchOnEnterKey: false,
|
2813
3189
|
strictSearch: false,
|
3190
|
+
searchSelector: false,
|
2814
3191
|
visibleSearch: false,
|
2815
3192
|
showButtonIcons: true,
|
2816
3193
|
showButtonText: false,
|
@@ -2823,11 +3200,13 @@
|
|
2823
3200
|
customSearch: undefined,
|
2824
3201
|
showHeader: true,
|
2825
3202
|
showFooter: false,
|
2826
|
-
footerStyle: function footerStyle(
|
3203
|
+
footerStyle: function footerStyle(column) {
|
2827
3204
|
return {};
|
2828
3205
|
},
|
3206
|
+
searchAccentNeutralise: false,
|
2829
3207
|
showColumns: false,
|
2830
3208
|
showColumnsToggleAll: false,
|
3209
|
+
showColumnsSearch: false,
|
2831
3210
|
minimumCountColumns: 1,
|
2832
3211
|
showPaginationSwitch: false,
|
2833
3212
|
showRefresh: false,
|
@@ -2854,6 +3233,7 @@
|
|
2854
3233
|
detailView: false,
|
2855
3234
|
detailViewIcon: true,
|
2856
3235
|
detailViewByClick: false,
|
3236
|
+
detailViewAlign: 'left',
|
2857
3237
|
detailFormatter: function detailFormatter(index, row) {
|
2858
3238
|
return '';
|
2859
3239
|
},
|
@@ -2864,13 +3244,17 @@
|
|
2864
3244
|
toolbarAlign: 'left',
|
2865
3245
|
buttonsToolbar: undefined,
|
2866
3246
|
buttonsAlign: 'right',
|
3247
|
+
buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
|
2867
3248
|
buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
|
2868
3249
|
buttonsClass: CONSTANTS.classes.buttons,
|
2869
3250
|
icons: CONSTANTS.icons,
|
2870
|
-
html: CONSTANTS.html,
|
2871
3251
|
iconSize: undefined,
|
2872
3252
|
iconsPrefix: CONSTANTS.iconsPrefix,
|
2873
3253
|
// glyphicon or fa(font-awesome)
|
3254
|
+
loadingFontSize: 'auto',
|
3255
|
+
loadingTemplate: function loadingTemplate(loadingMessage) {
|
3256
|
+
return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
|
3257
|
+
},
|
2874
3258
|
onAll: function onAll(name, args) {
|
2875
3259
|
return false;
|
2876
3260
|
},
|
@@ -3061,10 +3445,11 @@
|
|
3061
3445
|
footerFormatter: undefined,
|
3062
3446
|
detailFormatter: undefined,
|
3063
3447
|
searchFormatter: true,
|
3448
|
+
searchHighlightFormatter: false,
|
3064
3449
|
escape: false,
|
3065
3450
|
events: undefined
|
3066
3451
|
};
|
3067
|
-
var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', '
|
3452
|
+
var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
|
3068
3453
|
var EVENTS = {
|
3069
3454
|
'all.bs.table': 'onAll',
|
3070
3455
|
'click-row.bs.table': 'onClickRow',
|
@@ -3110,64 +3495,88 @@
|
|
3110
3495
|
}
|
3111
3496
|
};
|
3112
3497
|
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3498
|
+
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
3499
|
+
|
3500
|
+
// `Object.keys` method
|
3501
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
3502
|
+
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
3503
|
+
keys: function keys(it) {
|
3504
|
+
return objectKeys(toObject(it));
|
3505
|
+
}
|
3506
|
+
});
|
3507
|
+
|
3508
|
+
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
3120
3509
|
|
3121
|
-
while (sourceIndex < sourceLen) {
|
3122
|
-
if (sourceIndex in source) {
|
3123
|
-
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
3124
3510
|
|
3125
|
-
if (depth > 0 && isArray(element)) {
|
3126
|
-
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
|
3127
|
-
} else {
|
3128
|
-
if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
|
3129
|
-
target[targetIndex] = element;
|
3130
|
-
}
|
3131
3511
|
|
3132
|
-
targetIndex++;
|
3133
|
-
}
|
3134
|
-
sourceIndex++;
|
3135
|
-
}
|
3136
|
-
return targetIndex;
|
3137
|
-
};
|
3138
3512
|
|
3139
|
-
var flattenIntoArray_1 = flattenIntoArray;
|
3140
3513
|
|
3141
|
-
|
3142
|
-
|
3143
|
-
|
3144
|
-
|
3145
|
-
|
3146
|
-
|
3147
|
-
|
3148
|
-
|
3149
|
-
|
3150
|
-
|
3514
|
+
|
3515
|
+
var nativeEndsWith = ''.endsWith;
|
3516
|
+
var min$5 = Math.min;
|
3517
|
+
|
3518
|
+
var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
|
3519
|
+
// https://github.com/zloirock/core-js/pull/702
|
3520
|
+
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
3521
|
+
var descriptor = getOwnPropertyDescriptor$3(String.prototype, 'endsWith');
|
3522
|
+
return descriptor && !descriptor.writable;
|
3523
|
+
}();
|
3524
|
+
|
3525
|
+
// `String.prototype.endsWith` method
|
3526
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.endswith
|
3527
|
+
_export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
3528
|
+
endsWith: function endsWith(searchString /* , endPosition = @length */) {
|
3529
|
+
var that = String(requireObjectCoercible(this));
|
3530
|
+
notARegexp(searchString);
|
3531
|
+
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
|
3532
|
+
var len = toLength(that.length);
|
3533
|
+
var end = endPosition === undefined ? len : min$5(toLength(endPosition), len);
|
3534
|
+
var search = String(searchString);
|
3535
|
+
return nativeEndsWith
|
3536
|
+
? nativeEndsWith.call(that, search, end)
|
3537
|
+
: that.slice(end - search.length, end) === search;
|
3151
3538
|
}
|
3152
3539
|
});
|
3153
3540
|
|
3154
|
-
|
3155
|
-
// in popular engines, so it's moved to a separate module
|
3541
|
+
var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
|
3156
3542
|
|
3157
3543
|
|
3158
|
-
addToUnscopables('flat');
|
3159
3544
|
|
3160
|
-
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
3161
3545
|
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3546
|
+
|
3547
|
+
|
3548
|
+
var nativeStartsWith = ''.startsWith;
|
3549
|
+
var min$6 = Math.min;
|
3550
|
+
|
3551
|
+
var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith');
|
3552
|
+
// https://github.com/zloirock/core-js/pull/702
|
3553
|
+
var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
|
3554
|
+
var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'startsWith');
|
3555
|
+
return descriptor && !descriptor.writable;
|
3556
|
+
}();
|
3557
|
+
|
3558
|
+
// `String.prototype.startsWith` method
|
3559
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.startswith
|
3560
|
+
_export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
|
3561
|
+
startsWith: function startsWith(searchString /* , position = 0 */) {
|
3562
|
+
var that = String(requireObjectCoercible(this));
|
3563
|
+
notARegexp(searchString);
|
3564
|
+
var index = toLength(min$6(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
3565
|
+
var search = String(searchString);
|
3566
|
+
return nativeStartsWith
|
3567
|
+
? nativeStartsWith.call(that, search, index)
|
3568
|
+
: that.slice(index, index + search.length) === search;
|
3167
3569
|
}
|
3168
3570
|
});
|
3169
3571
|
|
3170
3572
|
var Utils = {
|
3573
|
+
getSearchInput: function getSearchInput(that) {
|
3574
|
+
if (typeof that.options.searchSelector === 'string') {
|
3575
|
+
return $(that.options.searchSelector);
|
3576
|
+
}
|
3577
|
+
|
3578
|
+
return that.$toolbar.find('.search input');
|
3579
|
+
},
|
3171
3580
|
// it only does '%s', and return '' when arguments are undefined
|
3172
3581
|
sprintf: function sprintf(_str) {
|
3173
3582
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
@@ -3190,6 +3599,9 @@
|
|
3190
3599
|
|
3191
3600
|
return flag ? str : '';
|
3192
3601
|
},
|
3602
|
+
isObject: function isObject(val) {
|
3603
|
+
return val instanceof Object && !Array.isArray(val);
|
3604
|
+
},
|
3193
3605
|
isEmptyObject: function isEmptyObject() {
|
3194
3606
|
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3195
3607
|
return Object.entries(obj).length === 0 && obj.constructor === Object;
|
@@ -3287,12 +3699,10 @@
|
|
3287
3699
|
r.colspanGroup = r.colspan;
|
3288
3700
|
}
|
3289
3701
|
|
3290
|
-
for (var
|
3291
|
-
|
3292
|
-
|
3293
|
-
|
3294
|
-
for (var _k = 0; _k < colspan; _k++) {
|
3295
|
-
flag[_i][index + _k] = true;
|
3702
|
+
for (var _j = 0; _j < rowspan; _j++) {
|
3703
|
+
for (var k = 0; k < colspan; k++) {
|
3704
|
+
flag[_i + _j][index + k] = true;
|
3705
|
+
}
|
3296
3706
|
}
|
3297
3707
|
}
|
3298
3708
|
} catch (err) {
|
@@ -3311,8 +3721,18 @@
|
|
3311
3721
|
}
|
3312
3722
|
}
|
3313
3723
|
},
|
3724
|
+
normalizeAccent: function normalizeAccent(value) {
|
3725
|
+
if (typeof value !== 'string') {
|
3726
|
+
return value;
|
3727
|
+
}
|
3728
|
+
|
3729
|
+
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
3730
|
+
},
|
3314
3731
|
updateFieldGroup: function updateFieldGroup(columns) {
|
3315
|
-
var
|
3732
|
+
var _ref;
|
3733
|
+
|
3734
|
+
var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
|
3735
|
+
|
3316
3736
|
var _iteratorNormalCompletion4 = true;
|
3317
3737
|
var _didIteratorError4 = false;
|
3318
3738
|
var _iteratorError4 = undefined;
|
@@ -3399,7 +3819,9 @@
|
|
3399
3819
|
|
3400
3820
|
return this.cachedWidth;
|
3401
3821
|
},
|
3402
|
-
calculateObjectValue: function calculateObjectValue(self, name
|
3822
|
+
calculateObjectValue: function calculateObjectValue(self, name) {
|
3823
|
+
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
3824
|
+
var defaultValue = arguments.length > 3 ? arguments[3] : undefined;
|
3403
3825
|
var func = name;
|
3404
3826
|
|
3405
3827
|
if (typeof name === 'string') {
|
@@ -3475,6 +3897,13 @@
|
|
3475
3897
|
|
3476
3898
|
return text;
|
3477
3899
|
},
|
3900
|
+
unescapeHTML: function unescapeHTML(text) {
|
3901
|
+
if (typeof text === 'string') {
|
3902
|
+
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '\'').replace(/`/g, '`');
|
3903
|
+
}
|
3904
|
+
|
3905
|
+
return text;
|
3906
|
+
},
|
3478
3907
|
getRealDataAttr: function getRealDataAttr(dataAttr) {
|
3479
3908
|
for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
|
3480
3909
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
|
@@ -3564,14 +3993,17 @@
|
|
3564
3993
|
var data = [];
|
3565
3994
|
var m = [];
|
3566
3995
|
$els.each(function (y, el) {
|
3996
|
+
var $el = $(el);
|
3567
3997
|
var row = {}; // save tr's id, class and data-* attributes
|
3568
3998
|
|
3569
|
-
row._id = $
|
3570
|
-
row._class = $
|
3571
|
-
row._data = _this.getRealDataAttr($
|
3572
|
-
$
|
3573
|
-
|
3574
|
-
var
|
3999
|
+
row._id = $el.attr('id');
|
4000
|
+
row._class = $el.attr('class');
|
4001
|
+
row._data = _this.getRealDataAttr($el.data());
|
4002
|
+
row._style = $el.attr('style');
|
4003
|
+
$el.find('>td,>th').each(function (_x, el) {
|
4004
|
+
var $el = $(el);
|
4005
|
+
var cspan = +$el.attr('colspan') || 1;
|
4006
|
+
var rspan = +$el.attr('rowspan') || 1;
|
3575
4007
|
var x = _x; // skip already occupied cells in current row
|
3576
4008
|
|
3577
4009
|
for (; m[y] && m[y][x]; x++) {} // ignore
|
@@ -3590,20 +4022,21 @@
|
|
3590
4022
|
}
|
3591
4023
|
|
3592
4024
|
var field = columns[x].field;
|
3593
|
-
row[field] = $
|
3594
|
-
|
3595
|
-
row["_".concat(field, "_id")] = $
|
3596
|
-
row["_".concat(field, "_class")] = $
|
3597
|
-
row["_".concat(field, "_rowspan")] = $
|
3598
|
-
row["_".concat(field, "_colspan")] = $
|
3599
|
-
row["_".concat(field, "_title")] = $
|
3600
|
-
row["_".concat(field, "_data")] = _this.getRealDataAttr($
|
4025
|
+
row[field] = $el.html().trim(); // save td's id, class and data-* attributes
|
4026
|
+
|
4027
|
+
row["_".concat(field, "_id")] = $el.attr('id');
|
4028
|
+
row["_".concat(field, "_class")] = $el.attr('class');
|
4029
|
+
row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
|
4030
|
+
row["_".concat(field, "_colspan")] = $el.attr('colspan');
|
4031
|
+
row["_".concat(field, "_title")] = $el.attr('title');
|
4032
|
+
row["_".concat(field, "_data")] = _this.getRealDataAttr($el.data());
|
4033
|
+
row["_".concat(field, "_style")] = $el.attr('style');
|
3601
4034
|
});
|
3602
4035
|
data.push(row);
|
3603
4036
|
});
|
3604
4037
|
return data;
|
3605
4038
|
},
|
3606
|
-
sort: function sort(a, b, order, sortStable) {
|
4039
|
+
sort: function sort(a, b, order, sortStable, aPosition, bPosition) {
|
3607
4040
|
if (a === undefined || a === null) {
|
3608
4041
|
a = '';
|
3609
4042
|
}
|
@@ -3613,8 +4046,8 @@
|
|
3613
4046
|
}
|
3614
4047
|
|
3615
4048
|
if (sortStable && a === b) {
|
3616
|
-
a =
|
3617
|
-
b =
|
4049
|
+
a = aPosition;
|
4050
|
+
b = bPosition;
|
3618
4051
|
} // If both values are numeric, do a numeric comparison
|
3619
4052
|
|
3620
4053
|
|
@@ -3648,6 +4081,58 @@
|
|
3648
4081
|
}
|
3649
4082
|
|
3650
4083
|
return order;
|
4084
|
+
},
|
4085
|
+
getEventName: function getEventName(eventPrefix) {
|
4086
|
+
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
4087
|
+
id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
|
4088
|
+
return "".concat(eventPrefix, "-").concat(id);
|
4089
|
+
},
|
4090
|
+
hasDetailViewIcon: function hasDetailViewIcon(options) {
|
4091
|
+
return options.detailView && options.detailViewIcon && !options.cardView;
|
4092
|
+
},
|
4093
|
+
getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
|
4094
|
+
return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
|
4095
|
+
},
|
4096
|
+
checkAutoMergeCells: function checkAutoMergeCells(data) {
|
4097
|
+
var _iteratorNormalCompletion9 = true;
|
4098
|
+
var _didIteratorError9 = false;
|
4099
|
+
var _iteratorError9 = undefined;
|
4100
|
+
|
4101
|
+
try {
|
4102
|
+
for (var _iterator9 = data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
|
4103
|
+
var row = _step9.value;
|
4104
|
+
|
4105
|
+
for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
|
4106
|
+
var key = _Object$keys[_i4];
|
4107
|
+
|
4108
|
+
if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
|
4109
|
+
return true;
|
4110
|
+
}
|
4111
|
+
}
|
4112
|
+
}
|
4113
|
+
} catch (err) {
|
4114
|
+
_didIteratorError9 = true;
|
4115
|
+
_iteratorError9 = err;
|
4116
|
+
} finally {
|
4117
|
+
try {
|
4118
|
+
if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
|
4119
|
+
_iterator9.return();
|
4120
|
+
}
|
4121
|
+
} finally {
|
4122
|
+
if (_didIteratorError9) {
|
4123
|
+
throw _iteratorError9;
|
4124
|
+
}
|
4125
|
+
}
|
4126
|
+
}
|
4127
|
+
|
4128
|
+
return false;
|
4129
|
+
},
|
4130
|
+
deepCopy: function deepCopy(arg) {
|
4131
|
+
if (arg === undefined) {
|
4132
|
+
return arg;
|
4133
|
+
}
|
4134
|
+
|
4135
|
+
return $.extend(true, Array.isArray(arg) ? [] : {}, arg);
|
3651
4136
|
}
|
3652
4137
|
};
|
3653
4138
|
|
@@ -3814,7 +4299,6 @@
|
|
3814
4299
|
this.$el_ = this.$el.clone();
|
3815
4300
|
this.timeoutId_ = 0;
|
3816
4301
|
this.timeoutFooter_ = 0;
|
3817
|
-
this.init();
|
3818
4302
|
}
|
3819
4303
|
|
3820
4304
|
_createClass(BootstrapTable, [{
|
@@ -3836,11 +4320,12 @@
|
|
3836
4320
|
}, {
|
3837
4321
|
key: "initConstants",
|
3838
4322
|
value: function initConstants() {
|
3839
|
-
var
|
4323
|
+
var opts = this.options;
|
3840
4324
|
this.constants = Constants.CONSTANTS;
|
3841
4325
|
this.constants.theme = $.fn.bootstrapTable.theme;
|
3842
|
-
var buttonsPrefix =
|
3843
|
-
this.constants.buttonsClass = [
|
4326
|
+
var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
|
4327
|
+
this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
|
4328
|
+
this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], []);
|
3844
4329
|
}
|
3845
4330
|
}, {
|
3846
4331
|
key: "initLocale",
|
@@ -3868,7 +4353,8 @@
|
|
3868
4353
|
value: function initContainer() {
|
3869
4354
|
var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
|
3870
4355
|
var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
|
3871
|
-
|
4356
|
+
var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
|
4357
|
+
this.$container = $("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"><table><thead><tr></tr></thead></table></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
|
3872
4358
|
this.$container.insertAfter(this.$el);
|
3873
4359
|
this.$tableContainer = this.$container.find('.fixed-table-container');
|
3874
4360
|
this.$tableHeader = this.$container.find('.fixed-table-header');
|
@@ -3902,11 +4388,6 @@
|
|
3902
4388
|
}
|
3903
4389
|
|
3904
4390
|
this.$tableFooter = this.$container.find('.fixed-table-footer');
|
3905
|
-
} else {
|
3906
|
-
if (!this.$tableFooter.length) {
|
3907
|
-
this.$el.append('<tfoot><tr></tr></tfoot>');
|
3908
|
-
this.$tableFooter = this.$el.find('tfoot');
|
3909
|
-
}
|
3910
4391
|
}
|
3911
4392
|
}
|
3912
4393
|
}, {
|
@@ -3915,7 +4396,6 @@
|
|
3915
4396
|
var _this = this;
|
3916
4397
|
|
3917
4398
|
var columns = [];
|
3918
|
-
var data = [];
|
3919
4399
|
this.$header = this.$el.find('>thead');
|
3920
4400
|
|
3921
4401
|
if (!this.$header.length) {
|
@@ -3924,23 +4404,35 @@
|
|
3924
4404
|
this.$header.addClass(this.options.theadClasses);
|
3925
4405
|
}
|
3926
4406
|
|
4407
|
+
this._headerTrClasses = [];
|
4408
|
+
this._headerTrStyles = [];
|
3927
4409
|
this.$header.find('tr').each(function (i, el) {
|
4410
|
+
var $tr = $(el);
|
3928
4411
|
var column = [];
|
3929
|
-
$
|
3930
|
-
// #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
|
3931
|
-
|
3932
|
-
|
4412
|
+
$tr.find('th').each(function (i, el) {
|
4413
|
+
var $th = $(el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
|
4414
|
+
|
4415
|
+
if (typeof $th.data('field') !== 'undefined') {
|
4416
|
+
$th.data('field', "".concat($th.data('field')));
|
3933
4417
|
}
|
3934
4418
|
|
3935
4419
|
column.push($.extend({}, {
|
3936
|
-
title: $
|
3937
|
-
'class': $
|
3938
|
-
titleTooltip: $
|
3939
|
-
rowspan: $
|
3940
|
-
colspan: $
|
3941
|
-
}, $
|
4420
|
+
title: $th.html(),
|
4421
|
+
'class': $th.attr('class'),
|
4422
|
+
titleTooltip: $th.attr('title'),
|
4423
|
+
rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
|
4424
|
+
colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
|
4425
|
+
}, $th.data()));
|
3942
4426
|
});
|
3943
4427
|
columns.push(column);
|
4428
|
+
|
4429
|
+
if ($tr.attr('class')) {
|
4430
|
+
_this._headerTrClasses.push($tr.attr('class'));
|
4431
|
+
}
|
4432
|
+
|
4433
|
+
if ($tr.attr('style')) {
|
4434
|
+
_this._headerTrStyles.push($tr.attr('style'));
|
4435
|
+
}
|
3944
4436
|
});
|
3945
4437
|
|
3946
4438
|
if (!Array.isArray(this.options.columns[0])) {
|
@@ -3965,14 +4457,17 @@
|
|
3965
4457
|
}); // if options.data is setting, do not process tbody and tfoot data
|
3966
4458
|
|
3967
4459
|
if (!this.options.data.length) {
|
3968
|
-
|
4460
|
+
var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
|
3969
4461
|
|
3970
|
-
if (
|
4462
|
+
if (htmlData.length) {
|
4463
|
+
this.options.data = htmlData;
|
3971
4464
|
this.fromHtml = true;
|
3972
4465
|
}
|
3973
4466
|
}
|
3974
4467
|
|
3975
|
-
this.
|
4468
|
+
if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
|
4469
|
+
this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
|
4470
|
+
}
|
3976
4471
|
|
3977
4472
|
if (this.footerData) {
|
3978
4473
|
this.$el.find('tfoot').html('<tr></tr>');
|
@@ -4005,10 +4500,15 @@
|
|
4005
4500
|
};
|
4006
4501
|
Utils.updateFieldGroup(this.options.columns);
|
4007
4502
|
this.options.columns.forEach(function (columns, i) {
|
4008
|
-
html.push(
|
4503
|
+
html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
|
4504
|
+
var detailViewTemplate = '';
|
4009
4505
|
|
4010
|
-
if (i === 0 &&
|
4011
|
-
|
4506
|
+
if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
|
4507
|
+
detailViewTemplate = "<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>");
|
4508
|
+
}
|
4509
|
+
|
4510
|
+
if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
|
4511
|
+
html.push(detailViewTemplate);
|
4012
4512
|
}
|
4013
4513
|
|
4014
4514
|
columns.forEach(function (column, j) {
|
@@ -4024,6 +4524,24 @@
|
|
4024
4524
|
return;
|
4025
4525
|
}
|
4026
4526
|
|
4527
|
+
var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
|
4528
|
+
var csses = [];
|
4529
|
+
var classes = '';
|
4530
|
+
|
4531
|
+
if (headerStyle && headerStyle.css) {
|
4532
|
+
for (var _i = 0, _Object$entries = Object.entries(headerStyle.css); _i < _Object$entries.length; _i++) {
|
4533
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
4534
|
+
key = _Object$entries$_i[0],
|
4535
|
+
value = _Object$entries$_i[1];
|
4536
|
+
|
4537
|
+
csses.push("".concat(key, ": ").concat(value));
|
4538
|
+
}
|
4539
|
+
}
|
4540
|
+
|
4541
|
+
if (headerStyle && headerStyle.classes) {
|
4542
|
+
classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
|
4543
|
+
}
|
4544
|
+
|
4027
4545
|
if (typeof column.fieldIndex !== 'undefined') {
|
4028
4546
|
_this2.header.fields[column.fieldIndex] = column.field;
|
4029
4547
|
_this2.header.styles[column.fieldIndex] = align + style;
|
@@ -4047,7 +4565,7 @@
|
|
4047
4565
|
visibleColumns[column.field] = column;
|
4048
4566
|
}
|
4049
4567
|
|
4050
|
-
html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : class_, Utils.sprintf(' style="%s"', halign + style), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
|
4568
|
+
html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
|
4051
4569
|
j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
|
4052
4570
|
html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? 'sortable both' : ''));
|
4053
4571
|
var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
|
@@ -4066,7 +4584,6 @@
|
|
4066
4584
|
if (column.radio) {
|
4067
4585
|
text = '';
|
4068
4586
|
_this2.header.stateField = column.field;
|
4069
|
-
_this2.options.singleSelect = true;
|
4070
4587
|
}
|
4071
4588
|
|
4072
4589
|
if (!text && column.showSelectTitle) {
|
@@ -4079,6 +4596,11 @@
|
|
4079
4596
|
html.push('</div>');
|
4080
4597
|
html.push('</th>');
|
4081
4598
|
});
|
4599
|
+
|
4600
|
+
if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
|
4601
|
+
html.push(detailViewTemplate);
|
4602
|
+
}
|
4603
|
+
|
4082
4604
|
html.push('</tr>');
|
4083
4605
|
});
|
4084
4606
|
this.$header.html(html.join(''));
|
@@ -4108,7 +4630,7 @@
|
|
4108
4630
|
}
|
4109
4631
|
}
|
4110
4632
|
});
|
4111
|
-
var resizeEvent =
|
4633
|
+
var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
|
4112
4634
|
$(window).off(resizeEvent);
|
4113
4635
|
|
4114
4636
|
if (!this.options.showHeader || this.options.cardView) {
|
@@ -4121,15 +4643,15 @@
|
|
4121
4643
|
this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow
|
4122
4644
|
|
4123
4645
|
this.getCaret();
|
4124
|
-
$(window).on(resizeEvent, function (
|
4125
|
-
return _this2.
|
4646
|
+
$(window).on(resizeEvent, function () {
|
4647
|
+
return _this2.resetView();
|
4126
4648
|
});
|
4127
4649
|
}
|
4128
4650
|
|
4129
4651
|
this.$selectAll = this.$header.find('[name="btSelectAll"]');
|
4130
|
-
this.$selectAll.off('click').on('click', function (
|
4131
|
-
|
4132
|
-
var checked = $(currentTarget).prop('checked');
|
4652
|
+
this.$selectAll.off('click').on('click', function (e) {
|
4653
|
+
e.stopPropagation();
|
4654
|
+
var checked = $(e.currentTarget).prop('checked');
|
4133
4655
|
|
4134
4656
|
_this2[checked ? 'checkAll' : 'uncheckAll']();
|
4135
4657
|
|
@@ -4144,10 +4666,15 @@
|
|
4144
4666
|
} else if (type === 'prepend') {
|
4145
4667
|
this.options.data = [].concat(data).concat(this.options.data);
|
4146
4668
|
} else {
|
4147
|
-
|
4669
|
+
data = data || Utils.deepCopy(this.options.data);
|
4670
|
+
this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
|
4148
4671
|
}
|
4149
4672
|
|
4150
|
-
this.data = this.options.data;
|
4673
|
+
this.data = _toConsumableArray(this.options.data);
|
4674
|
+
|
4675
|
+
if (this.options.sortReset) {
|
4676
|
+
this.unsortedData = _toConsumableArray(this.data);
|
4677
|
+
}
|
4151
4678
|
|
4152
4679
|
if (this.options.sidePagination === 'server') {
|
4153
4680
|
return;
|
@@ -4194,7 +4721,7 @@
|
|
4194
4721
|
return order * value;
|
4195
4722
|
}
|
4196
4723
|
|
4197
|
-
return Utils.sort(aa, bb, order, _this3.options.sortStable);
|
4724
|
+
return Utils.sort(aa, bb, order, _this3.options.sortStable, a._position, b._position);
|
4198
4725
|
});
|
4199
4726
|
}
|
4200
4727
|
|
@@ -4208,19 +4735,33 @@
|
|
4208
4735
|
_this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
|
4209
4736
|
}, 250);
|
4210
4737
|
}
|
4738
|
+
} else if (this.options.sortReset) {
|
4739
|
+
this.data = _toConsumableArray(this.unsortedData);
|
4211
4740
|
}
|
4212
4741
|
}
|
4213
4742
|
}, {
|
4214
4743
|
key: "onSort",
|
4215
|
-
value: function onSort(
|
4216
|
-
var type =
|
4217
|
-
currentTarget =
|
4744
|
+
value: function onSort(_ref) {
|
4745
|
+
var type = _ref.type,
|
4746
|
+
currentTarget = _ref.currentTarget;
|
4218
4747
|
var $this = type === 'keypress' ? $(currentTarget) : $(currentTarget).parent();
|
4219
4748
|
var $this_ = this.$header.find('th').eq($this.index());
|
4220
4749
|
this.$header.add(this.$header_).find('span.order').remove();
|
4221
4750
|
|
4222
4751
|
if (this.options.sortName === $this.data('field')) {
|
4223
|
-
|
4752
|
+
var currentSortOrder = this.options.sortOrder;
|
4753
|
+
|
4754
|
+
if (currentSortOrder === undefined) {
|
4755
|
+
this.options.sortOrder = 'asc';
|
4756
|
+
} else if (currentSortOrder === 'asc') {
|
4757
|
+
this.options.sortOrder = 'desc';
|
4758
|
+
} else if (this.options.sortOrder === 'desc') {
|
4759
|
+
this.options.sortOrder = this.options.sortReset ? undefined : 'asc';
|
4760
|
+
}
|
4761
|
+
|
4762
|
+
if (this.options.sortOrder === undefined) {
|
4763
|
+
this.options.sortName = undefined;
|
4764
|
+
}
|
4224
4765
|
} else {
|
4225
4766
|
this.options.sortName = $this.data('field');
|
4226
4767
|
|
@@ -4236,7 +4777,7 @@
|
|
4236
4777
|
|
4237
4778
|
this.getCaret();
|
4238
4779
|
|
4239
|
-
if (this.options.sidePagination === 'server') {
|
4780
|
+
if (this.options.sidePagination === 'server' && this.options.serverSort) {
|
4240
4781
|
this.options.pageNumber = 1;
|
4241
4782
|
this.initServer(this.options.silentSort);
|
4242
4783
|
return;
|
@@ -4250,71 +4791,203 @@
|
|
4250
4791
|
value: function initToolbar() {
|
4251
4792
|
var _this4 = this;
|
4252
4793
|
|
4253
|
-
var
|
4794
|
+
var opts = this.options;
|
4254
4795
|
var html = [];
|
4255
4796
|
var timeoutId = 0;
|
4256
4797
|
var $keepOpen;
|
4257
4798
|
var switchableCount = 0;
|
4258
4799
|
|
4259
4800
|
if (this.$toolbar.find('.bs-bars').children().length) {
|
4260
|
-
$('body').append($(
|
4801
|
+
$('body').append($(opts.toolbar));
|
4261
4802
|
}
|
4262
4803
|
|
4263
4804
|
this.$toolbar.html('');
|
4264
4805
|
|
4265
|
-
if (typeof
|
4266
|
-
$(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull,
|
4806
|
+
if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
|
4807
|
+
$(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($(opts.toolbar));
|
4267
4808
|
} // showColumns, showToggle, showRefresh
|
4268
4809
|
|
4269
4810
|
|
4270
|
-
html = ["<div class=\"".concat(['columns', "columns-".concat(
|
4811
|
+
html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
|
4271
4812
|
|
4272
|
-
if (typeof
|
4273
|
-
|
4813
|
+
if (typeof opts.icons === 'string') {
|
4814
|
+
opts.icons = Utils.calculateObjectValue(null, opts.icons);
|
4274
4815
|
}
|
4275
4816
|
|
4276
|
-
if (
|
4277
|
-
|
4817
|
+
if (typeof opts.buttonsOrder === 'string') {
|
4818
|
+
opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
|
4278
4819
|
}
|
4279
4820
|
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4821
|
+
this.buttons = Object.assign(this.buttons, {
|
4822
|
+
paginationSwitch: {
|
4823
|
+
text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
|
4824
|
+
icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
|
4825
|
+
render: false,
|
4826
|
+
event: this.togglePagination,
|
4827
|
+
attributes: {
|
4828
|
+
'aria-label': opts.formatPaginationSwitch(),
|
4829
|
+
title: opts.formatPaginationSwitch()
|
4830
|
+
}
|
4831
|
+
},
|
4832
|
+
refresh: {
|
4833
|
+
text: opts.formatRefresh(),
|
4834
|
+
icon: opts.icons.refresh,
|
4835
|
+
render: false,
|
4836
|
+
event: this.refresh,
|
4837
|
+
attributes: {
|
4838
|
+
'aria-label': opts.formatRefresh(),
|
4839
|
+
title: opts.formatRefresh()
|
4840
|
+
}
|
4841
|
+
},
|
4842
|
+
toggle: {
|
4843
|
+
text: opts.formatToggle(),
|
4844
|
+
icon: opts.icons.toggleOff,
|
4845
|
+
render: false,
|
4846
|
+
event: this.toggleView,
|
4847
|
+
attributes: {
|
4848
|
+
'aria-label': opts.formatToggleOn(),
|
4849
|
+
title: opts.formatToggleOn()
|
4850
|
+
}
|
4851
|
+
},
|
4852
|
+
fullscreen: {
|
4853
|
+
text: opts.formatFullscreen(),
|
4854
|
+
icon: opts.icons.fullscreen,
|
4855
|
+
render: false,
|
4856
|
+
event: this.toggleFullscreen,
|
4857
|
+
attributes: {
|
4858
|
+
'aria-label': opts.formatFullscreen(),
|
4859
|
+
title: opts.formatFullscreen()
|
4860
|
+
}
|
4861
|
+
},
|
4862
|
+
columns: {
|
4863
|
+
render: false,
|
4864
|
+
html: function html() {
|
4865
|
+
var html = [];
|
4866
|
+
html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"\n aria-label=\"Columns\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
|
4867
|
+
|
4868
|
+
if (opts.showColumnsSearch) {
|
4869
|
+
html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
|
4870
|
+
html.push(_this4.constants.html.toolbarDropdownSeparator);
|
4871
|
+
}
|
4283
4872
|
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4873
|
+
if (opts.showColumnsToggleAll) {
|
4874
|
+
var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
|
4875
|
+
return !_this4.isSelectionColumn(column);
|
4876
|
+
}).length;
|
4287
4877
|
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4878
|
+
html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
|
4879
|
+
html.push(_this4.constants.html.toolbarDropdownSeparator);
|
4880
|
+
}
|
4881
|
+
|
4882
|
+
var visibleColumns = 0;
|
4883
|
+
|
4884
|
+
_this4.columns.forEach(function (column, i) {
|
4885
|
+
if (column.visible) {
|
4886
|
+
visibleColumns++;
|
4887
|
+
}
|
4888
|
+
});
|
4889
|
+
|
4890
|
+
_this4.columns.forEach(function (column, i) {
|
4891
|
+
if (_this4.isSelectionColumn(column)) {
|
4892
|
+
return;
|
4893
|
+
}
|
4291
4894
|
|
4292
|
-
|
4293
|
-
|
4895
|
+
if (opts.cardView && !column.cardVisible) {
|
4896
|
+
return;
|
4897
|
+
}
|
4898
|
+
|
4899
|
+
var checked = column.visible ? ' checked="checked"' : '';
|
4900
|
+
var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
|
4901
|
+
|
4902
|
+
if (column.switchable) {
|
4903
|
+
html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
|
4904
|
+
switchableCount++;
|
4905
|
+
}
|
4906
|
+
});
|
4294
4907
|
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
html.push(this.constants.html.toolbarDropdownSeparator);
|
4908
|
+
html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
|
4909
|
+
return html.join('');
|
4910
|
+
}
|
4299
4911
|
}
|
4912
|
+
});
|
4913
|
+
var buttonsHtml = {};
|
4300
4914
|
|
4301
|
-
|
4302
|
-
|
4303
|
-
|
4915
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(this.buttons); _i2 < _Object$entries2.length; _i2++) {
|
4916
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
4917
|
+
buttonName = _Object$entries2$_i[0],
|
4918
|
+
buttonConfig = _Object$entries2$_i[1];
|
4919
|
+
|
4920
|
+
var buttonHtml = void 0;
|
4921
|
+
|
4922
|
+
if (buttonConfig.hasOwnProperty('html')) {
|
4923
|
+
buttonHtml = Utils.calculateObjectValue(opts, buttonConfig.html);
|
4924
|
+
} else {
|
4925
|
+
buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
|
4926
|
+
|
4927
|
+
if (buttonConfig.hasOwnProperty('attributes')) {
|
4928
|
+
for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
|
4929
|
+
var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
|
4930
|
+
attributeName = _Object$entries4$_i[0],
|
4931
|
+
value = _Object$entries4$_i[1];
|
4932
|
+
|
4933
|
+
buttonHtml += " ".concat(attributeName, "=\"").concat(Utils.calculateObjectValue(opts, value), "\"");
|
4934
|
+
}
|
4304
4935
|
}
|
4305
4936
|
|
4306
|
-
|
4307
|
-
|
4937
|
+
buttonHtml += '>';
|
4938
|
+
|
4939
|
+
if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
|
4940
|
+
var icon = Utils.calculateObjectValue(opts, buttonConfig.icon);
|
4941
|
+
buttonHtml += Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, icon) + ' ';
|
4308
4942
|
}
|
4309
4943
|
|
4310
|
-
|
4944
|
+
if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
|
4945
|
+
buttonHtml += Utils.calculateObjectValue(opts, buttonConfig.text);
|
4946
|
+
}
|
4311
4947
|
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4948
|
+
buttonHtml += '</button>';
|
4949
|
+
}
|
4950
|
+
|
4951
|
+
buttonsHtml[buttonName] = buttonHtml;
|
4952
|
+
var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
|
4953
|
+
var showOption = opts[optionName];
|
4954
|
+
|
4955
|
+
if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
|
4956
|
+
opts[optionName] = true;
|
4957
|
+
}
|
4958
|
+
|
4959
|
+
if (!opts.buttonsOrder.includes(buttonName)) {
|
4960
|
+
opts.buttonsOrder.push(buttonName);
|
4961
|
+
}
|
4962
|
+
} // Adding the button html to the final toolbar html when the showOption is true
|
4963
|
+
|
4964
|
+
|
4965
|
+
var _iteratorNormalCompletion = true;
|
4966
|
+
var _didIteratorError = false;
|
4967
|
+
var _iteratorError = undefined;
|
4968
|
+
|
4969
|
+
try {
|
4970
|
+
for (var _iterator = opts.buttonsOrder[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
4971
|
+
var button = _step.value;
|
4972
|
+
var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
|
4973
|
+
|
4974
|
+
if (_showOption) {
|
4975
|
+
html.push(buttonsHtml[button]);
|
4315
4976
|
}
|
4316
|
-
}
|
4317
|
-
|
4977
|
+
}
|
4978
|
+
} catch (err) {
|
4979
|
+
_didIteratorError = true;
|
4980
|
+
_iteratorError = err;
|
4981
|
+
} finally {
|
4982
|
+
try {
|
4983
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
4984
|
+
_iterator.return();
|
4985
|
+
}
|
4986
|
+
} finally {
|
4987
|
+
if (_didIteratorError) {
|
4988
|
+
throw _iteratorError;
|
4989
|
+
}
|
4990
|
+
}
|
4318
4991
|
}
|
4319
4992
|
|
4320
4993
|
html.push('</div>'); // Fix #188: this.showToolbar is for extensions
|
@@ -4323,96 +4996,135 @@
|
|
4323
4996
|
this.$toolbar.append(html.join(''));
|
4324
4997
|
}
|
4325
4998
|
|
4326
|
-
|
4327
|
-
|
4328
|
-
|
4329
|
-
|
4330
|
-
}
|
4999
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
|
5000
|
+
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
|
5001
|
+
_buttonName = _Object$entries3$_i[0],
|
5002
|
+
_buttonConfig = _Object$entries3$_i[1];
|
4331
5003
|
|
4332
|
-
|
4333
|
-
|
4334
|
-
|
4335
|
-
|
4336
|
-
}
|
5004
|
+
if (_buttonConfig.hasOwnProperty('event')) {
|
5005
|
+
if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
|
5006
|
+
var _ret = function () {
|
5007
|
+
var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
|
4337
5008
|
|
4338
|
-
|
4339
|
-
|
4340
|
-
|
4341
|
-
});
|
4342
|
-
}
|
5009
|
+
_this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
|
5010
|
+
return event.call(_this4);
|
5011
|
+
});
|
4343
5012
|
|
4344
|
-
|
4345
|
-
|
4346
|
-
|
4347
|
-
|
5013
|
+
return "continue";
|
5014
|
+
}();
|
5015
|
+
|
5016
|
+
if (_ret === "continue") continue;
|
5017
|
+
}
|
5018
|
+
|
5019
|
+
var _loop = function _loop() {
|
5020
|
+
var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
|
5021
|
+
eventType = _Object$entries5$_i[0],
|
5022
|
+
eventFunction = _Object$entries5$_i[1];
|
5023
|
+
|
5024
|
+
var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
|
5025
|
+
|
5026
|
+
_this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
|
5027
|
+
return event.call(_this4);
|
5028
|
+
});
|
5029
|
+
};
|
5030
|
+
|
5031
|
+
for (var _i5 = 0, _Object$entries5 = Object.entries(_buttonConfig.event); _i5 < _Object$entries5.length; _i5++) {
|
5032
|
+
_loop();
|
5033
|
+
}
|
5034
|
+
}
|
4348
5035
|
}
|
4349
5036
|
|
4350
|
-
if (
|
5037
|
+
if (opts.showColumns) {
|
4351
5038
|
$keepOpen = this.$toolbar.find('.keep-open');
|
4352
|
-
var $checkboxes = $keepOpen.find('input:not(".toggle-all")');
|
4353
|
-
var $toggleAll = $keepOpen.find('input.toggle-all');
|
5039
|
+
var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
|
5040
|
+
var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
|
4354
5041
|
|
4355
|
-
if (switchableCount <=
|
5042
|
+
if (switchableCount <= opts.minimumCountColumns) {
|
4356
5043
|
$keepOpen.find('input').prop('disabled', true);
|
4357
5044
|
}
|
4358
5045
|
|
4359
5046
|
$keepOpen.find('li, label').off('click').on('click', function (e) {
|
4360
5047
|
e.stopImmediatePropagation();
|
4361
5048
|
});
|
4362
|
-
$checkboxes.off('click').on('click', function (
|
4363
|
-
var currentTarget =
|
5049
|
+
$checkboxes.off('click').on('click', function (_ref2) {
|
5050
|
+
var currentTarget = _ref2.currentTarget;
|
4364
5051
|
var $this = $(currentTarget);
|
4365
5052
|
|
4366
5053
|
_this4._toggleColumn($this.val(), $this.prop('checked'), false);
|
4367
5054
|
|
4368
5055
|
_this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
|
4369
5056
|
|
4370
|
-
$toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.
|
5057
|
+
$toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
|
5058
|
+
return !_this4.isSelectionColumn(column);
|
5059
|
+
}).length);
|
4371
5060
|
});
|
4372
|
-
$toggleAll.off('click').on('click', function (
|
4373
|
-
var currentTarget =
|
5061
|
+
$toggleAll.off('click').on('click', function (_ref3) {
|
5062
|
+
var currentTarget = _ref3.currentTarget;
|
4374
5063
|
|
4375
5064
|
_this4._toggleAllColumns($(currentTarget).prop('checked'));
|
4376
5065
|
});
|
4377
|
-
} // Fix #4516: this.showSearchClearButton is for extensions
|
4378
5066
|
|
5067
|
+
if (opts.showColumnsSearch) {
|
5068
|
+
var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
|
5069
|
+
var $listItems = $keepOpen.find('.dropdown-item-marker');
|
5070
|
+
$columnsSearch.on('keyup paste change', function (_ref4) {
|
5071
|
+
var currentTarget = _ref4.currentTarget;
|
5072
|
+
var $this = $(currentTarget);
|
5073
|
+
var searchValue = $this.val().toLowerCase();
|
5074
|
+
$listItems.show();
|
5075
|
+
$checkboxes.each(function (i, el) {
|
5076
|
+
var $checkbox = $(el);
|
5077
|
+
var $listItem = $checkbox.parents('.dropdown-item-marker');
|
5078
|
+
var text = $listItem.text().toLowerCase();
|
5079
|
+
|
5080
|
+
if (!text.includes(searchValue)) {
|
5081
|
+
$listItem.hide();
|
5082
|
+
}
|
5083
|
+
});
|
5084
|
+
});
|
5085
|
+
}
|
5086
|
+
}
|
4379
5087
|
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4384
|
-
|
4385
|
-
|
5088
|
+
var handleInputEvent = function handleInputEvent($searchInput) {
|
5089
|
+
var eventTriggers = 'keyup drop blur mouseup';
|
5090
|
+
$searchInput.off(eventTriggers).on(eventTriggers, function (event) {
|
5091
|
+
if (opts.searchOnEnterKey && event.keyCode !== 13) {
|
5092
|
+
return;
|
5093
|
+
}
|
4386
5094
|
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
}
|
5095
|
+
if ([37, 38, 39, 40].includes(event.keyCode)) {
|
5096
|
+
return;
|
5097
|
+
}
|
4391
5098
|
|
4392
|
-
|
4393
|
-
this.$toolbar.append(html.join(''));
|
4394
|
-
var $searchInput = this.$toolbar.find('.search input');
|
5099
|
+
clearTimeout(timeoutId); // doesn't matter if it's 0
|
4395
5100
|
|
4396
|
-
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
5101
|
+
timeoutId = setTimeout(function () {
|
5102
|
+
_this4.onSearch({
|
5103
|
+
currentTarget: event.currentTarget
|
5104
|
+
});
|
5105
|
+
}, opts.searchTimeOut);
|
5106
|
+
});
|
5107
|
+
}; // Fix #4516: this.showSearchClearButton is for extensions
|
4402
5108
|
|
4403
|
-
if ([37, 38, 39, 40].includes(event.keyCode)) {
|
4404
|
-
return;
|
4405
|
-
}
|
4406
5109
|
|
4407
|
-
|
5110
|
+
if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
|
5111
|
+
html = [];
|
5112
|
+
var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
|
5113
|
+
var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
|
5114
|
+
var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
|
5115
|
+
var searchInputFinalHtml = searchInputHtml;
|
4408
5116
|
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
}
|
5117
|
+
if (opts.showSearchButton || opts.showSearchClearButton) {
|
5118
|
+
var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
|
5119
|
+
|
5120
|
+
searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
|
5121
|
+
}
|
5122
|
+
|
5123
|
+
html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
|
5124
|
+
this.$toolbar.append(html.join(''));
|
5125
|
+
var $searchInput = Utils.getSearchInput(this);
|
4414
5126
|
|
4415
|
-
if (
|
5127
|
+
if (opts.showSearchButton) {
|
4416
5128
|
this.$toolbar.find('.search button[name=search]').off('click').on('click', function (event) {
|
4417
5129
|
clearTimeout(timeoutId); // doesn't matter if it's 0
|
4418
5130
|
|
@@ -4420,21 +5132,25 @@
|
|
4420
5132
|
_this4.onSearch({
|
4421
5133
|
currentTarget: $searchInput
|
4422
5134
|
});
|
4423
|
-
},
|
5135
|
+
}, opts.searchTimeOut);
|
4424
5136
|
});
|
4425
5137
|
|
4426
|
-
if (
|
4427
|
-
handleInputEvent();
|
5138
|
+
if (opts.searchOnEnterKey) {
|
5139
|
+
handleInputEvent($searchInput);
|
4428
5140
|
}
|
4429
5141
|
} else {
|
4430
|
-
handleInputEvent();
|
5142
|
+
handleInputEvent($searchInput);
|
4431
5143
|
}
|
4432
5144
|
|
4433
|
-
if (
|
5145
|
+
if (opts.showSearchClearButton) {
|
4434
5146
|
this.$toolbar.find('.search button[name=clearSearch]').click(function () {
|
4435
5147
|
_this4.resetSearch();
|
4436
5148
|
});
|
4437
5149
|
}
|
5150
|
+
} else if (typeof opts.searchSelector === 'string') {
|
5151
|
+
var _$searchInput = Utils.getSearchInput(this);
|
5152
|
+
|
5153
|
+
handleInputEvent(_$searchInput);
|
4438
5154
|
}
|
4439
5155
|
}
|
4440
5156
|
}, {
|
@@ -4457,7 +5173,7 @@
|
|
4457
5173
|
return;
|
4458
5174
|
}
|
4459
5175
|
|
4460
|
-
if ($(currentTarget).hasClass('search-input')) {
|
5176
|
+
if (currentTarget === Utils.getSearchInput(this)[0] || $(currentTarget).hasClass('search-input')) {
|
4461
5177
|
this.searchText = text;
|
4462
5178
|
this.options.searchText = text;
|
4463
5179
|
}
|
@@ -4489,10 +5205,15 @@
|
|
4489
5205
|
if (this.options.sidePagination !== 'server') {
|
4490
5206
|
if (this.options.customSearch) {
|
4491
5207
|
this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
|
5208
|
+
|
5209
|
+
if (this.options.sortReset) {
|
5210
|
+
this.unsortedData = _toConsumableArray(this.data);
|
5211
|
+
}
|
5212
|
+
|
4492
5213
|
return;
|
4493
5214
|
}
|
4494
5215
|
|
4495
|
-
var s = this.searchText && (this.
|
5216
|
+
var s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase();
|
4496
5217
|
var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
|
4497
5218
|
|
4498
5219
|
if (typeof this.filterOptions.filterAlgorithm === 'function') {
|
@@ -4522,7 +5243,7 @@
|
|
4522
5243
|
}
|
4523
5244
|
|
4524
5245
|
return true;
|
4525
|
-
}) : this.options.data;
|
5246
|
+
}) : _toConsumableArray(this.options.data);
|
4526
5247
|
}
|
4527
5248
|
|
4528
5249
|
var visibleFields = this.getVisibleFields();
|
@@ -4540,13 +5261,17 @@
|
|
4540
5261
|
value = item;
|
4541
5262
|
var props = key.split('.');
|
4542
5263
|
|
4543
|
-
for (var
|
4544
|
-
if (value[props[
|
4545
|
-
value = value[props[
|
5264
|
+
for (var _i6 = 0; _i6 < props.length; _i6++) {
|
5265
|
+
if (value[props[_i6]] !== null) {
|
5266
|
+
value = value[props[_i6]];
|
4546
5267
|
}
|
4547
5268
|
}
|
4548
5269
|
} else {
|
4549
5270
|
value = item[key];
|
5271
|
+
}
|
5272
|
+
|
5273
|
+
if (_this5.options.searchAccentNeutralise) {
|
5274
|
+
value = Utils.normalizeAccent(value);
|
4550
5275
|
} // Fix #142: respect searchFormatter boolean
|
4551
5276
|
|
4552
5277
|
|
@@ -4594,9 +5319,6 @@
|
|
4594
5319
|
case '=<l':
|
4595
5320
|
comparisonCheck = int >= comparisonInt;
|
4596
5321
|
break;
|
4597
|
-
|
4598
|
-
default:
|
4599
|
-
break;
|
4600
5322
|
}
|
4601
5323
|
}
|
4602
5324
|
|
@@ -4609,6 +5331,12 @@
|
|
4609
5331
|
|
4610
5332
|
return false;
|
4611
5333
|
}) : this.data;
|
5334
|
+
|
5335
|
+
if (this.options.sortReset) {
|
5336
|
+
this.unsortedData = _toConsumableArray(this.data);
|
5337
|
+
}
|
5338
|
+
|
5339
|
+
this.initSort();
|
4612
5340
|
}
|
4613
5341
|
}
|
4614
5342
|
}, {
|
@@ -4616,16 +5344,16 @@
|
|
4616
5344
|
value: function initPagination() {
|
4617
5345
|
var _this6 = this;
|
4618
5346
|
|
4619
|
-
var
|
5347
|
+
var opts = this.options;
|
4620
5348
|
|
4621
|
-
if (!
|
5349
|
+
if (!opts.pagination) {
|
4622
5350
|
this.$pagination.hide();
|
4623
5351
|
return;
|
4624
5352
|
}
|
4625
5353
|
|
4626
5354
|
this.$pagination.show();
|
4627
5355
|
var html = [];
|
4628
|
-
var
|
5356
|
+
var allSelected = false;
|
4629
5357
|
var i;
|
4630
5358
|
var from;
|
4631
5359
|
var to;
|
@@ -4636,41 +5364,50 @@
|
|
4636
5364
|
var data = this.getData({
|
4637
5365
|
includeHiddenRows: false
|
4638
5366
|
});
|
4639
|
-
var pageList =
|
5367
|
+
var pageList = opts.pageList;
|
5368
|
+
|
5369
|
+
if (typeof pageList === 'string') {
|
5370
|
+
pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
|
5371
|
+
}
|
5372
|
+
|
5373
|
+
pageList = pageList.map(function (value) {
|
5374
|
+
if (typeof value === 'string') {
|
5375
|
+
return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
|
5376
|
+
}
|
5377
|
+
|
5378
|
+
return value;
|
5379
|
+
});
|
5380
|
+
this.paginationParts = opts.paginationParts;
|
4640
5381
|
|
4641
|
-
if (
|
4642
|
-
|
5382
|
+
if (typeof this.paginationParts === 'string') {
|
5383
|
+
this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
|
5384
|
+
}
|
5385
|
+
|
5386
|
+
if (opts.sidePagination !== 'server') {
|
5387
|
+
opts.totalRows = data.length;
|
4643
5388
|
}
|
4644
5389
|
|
4645
5390
|
this.totalPages = 0;
|
4646
5391
|
|
4647
|
-
if (
|
4648
|
-
if (
|
4649
|
-
|
4650
|
-
|
4651
|
-
} else if (o.pageSize === o.totalRows) {
|
4652
|
-
// Fix #667 Table with pagination,
|
4653
|
-
// multiple pages and a search this matches to one page throws exception
|
4654
|
-
var pageLst = typeof o.pageList === 'string' ? o.pageList.replace('[', '').replace(']', '').replace(/ /g, '').toLowerCase().split(',') : o.pageList;
|
4655
|
-
|
4656
|
-
if (pageLst.includes(o.formatAllRows().toLowerCase())) {
|
4657
|
-
$allSelected = true;
|
4658
|
-
}
|
5392
|
+
if (opts.totalRows) {
|
5393
|
+
if (opts.pageSize === opts.formatAllRows()) {
|
5394
|
+
opts.pageSize = opts.totalRows;
|
5395
|
+
allSelected = true;
|
4659
5396
|
}
|
4660
5397
|
|
4661
|
-
this.totalPages = ~~((
|
4662
|
-
|
5398
|
+
this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
|
5399
|
+
opts.totalPages = this.totalPages;
|
4663
5400
|
}
|
4664
5401
|
|
4665
|
-
if (this.totalPages > 0 &&
|
4666
|
-
|
5402
|
+
if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
|
5403
|
+
opts.pageNumber = this.totalPages;
|
4667
5404
|
}
|
4668
5405
|
|
4669
|
-
this.pageFrom = (
|
4670
|
-
this.pageTo =
|
5406
|
+
this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
|
5407
|
+
this.pageTo = opts.pageNumber * opts.pageSize;
|
4671
5408
|
|
4672
|
-
if (this.pageTo >
|
4673
|
-
this.pageTo =
|
5409
|
+
if (this.pageTo > opts.totalRows) {
|
5410
|
+
this.pageTo = opts.totalRows;
|
4674
5411
|
}
|
4675
5412
|
|
4676
5413
|
if (this.options.pagination && this.options.sidePagination !== 'server') {
|
@@ -4681,73 +5418,56 @@
|
|
4681
5418
|
this.options.totalNotFiltered = undefined;
|
4682
5419
|
}
|
4683
5420
|
|
4684
|
-
|
4685
|
-
|
4686
|
-
|
4687
|
-
if (!o.onlyInfoPagination) {
|
4688
|
-
html.push('<span class="page-list">');
|
4689
|
-
var pageNumber = ["<span class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n <span class=\"page-size\">\n ").concat($allSelected ? o.formatAllRows() : o.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
|
4690
|
-
|
4691
|
-
if (typeof o.pageList === 'string') {
|
4692
|
-
var list = o.pageList.replace('[', '').replace(']', '').replace(/ /g, '').split(',');
|
4693
|
-
pageList = [];
|
4694
|
-
var _iteratorNormalCompletion = true;
|
4695
|
-
var _didIteratorError = false;
|
4696
|
-
var _iteratorError = undefined;
|
4697
|
-
|
4698
|
-
try {
|
4699
|
-
for (var _iterator = list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
4700
|
-
var value = _step.value;
|
4701
|
-
pageList.push(value.toLowerCase() === o.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? o.formatAllRows() : +value);
|
4702
|
-
}
|
4703
|
-
} catch (err) {
|
4704
|
-
_didIteratorError = true;
|
4705
|
-
_iteratorError = err;
|
4706
|
-
} finally {
|
4707
|
-
try {
|
4708
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
4709
|
-
_iterator.return();
|
4710
|
-
}
|
4711
|
-
} finally {
|
4712
|
-
if (_didIteratorError) {
|
4713
|
-
throw _iteratorError;
|
4714
|
-
}
|
4715
|
-
}
|
4716
|
-
}
|
4717
|
-
}
|
5421
|
+
if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
|
5422
|
+
html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
|
5423
|
+
}
|
4718
5424
|
|
5425
|
+
if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
|
5426
|
+
var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
|
5427
|
+
html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
|
5428
|
+
}
|
5429
|
+
|
5430
|
+
if (this.paginationParts.includes('pageSize')) {
|
5431
|
+
html.push('<span class="page-list">');
|
5432
|
+
var pageNumber = ["<span class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
|
4719
5433
|
pageList.forEach(function (page, i) {
|
4720
|
-
if (!
|
5434
|
+
if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows) {
|
4721
5435
|
var active;
|
4722
5436
|
|
4723
|
-
if (
|
4724
|
-
active = page ===
|
5437
|
+
if (allSelected) {
|
5438
|
+
active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
|
4725
5439
|
} else {
|
4726
|
-
active = page ===
|
5440
|
+
active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
|
4727
5441
|
}
|
4728
5442
|
|
4729
5443
|
pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
|
4730
5444
|
}
|
4731
5445
|
});
|
4732
5446
|
pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</span>"));
|
4733
|
-
html.push(
|
5447
|
+
html.push(opts.formatRecordsPerPage(pageNumber.join('')));
|
5448
|
+
}
|
5449
|
+
|
5450
|
+
if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
|
4734
5451
|
html.push('</span></div>');
|
4735
|
-
|
5452
|
+
}
|
4736
5453
|
|
4737
|
-
|
5454
|
+
if (this.paginationParts.includes('pageList')) {
|
5455
|
+
html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
|
5456
|
+
|
5457
|
+
if (this.totalPages < opts.paginationSuccessivelySize) {
|
4738
5458
|
from = 1;
|
4739
5459
|
to = this.totalPages;
|
4740
5460
|
} else {
|
4741
|
-
from =
|
4742
|
-
to = from +
|
5461
|
+
from = opts.pageNumber - opts.paginationPagesBySide;
|
5462
|
+
to = from + opts.paginationPagesBySide * 2;
|
4743
5463
|
}
|
4744
5464
|
|
4745
|
-
if (
|
4746
|
-
to =
|
5465
|
+
if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
|
5466
|
+
to = opts.paginationSuccessivelySize;
|
4747
5467
|
}
|
4748
5468
|
|
4749
|
-
if (
|
4750
|
-
from = from - (
|
5469
|
+
if (opts.paginationSuccessivelySize > this.totalPages - from) {
|
5470
|
+
from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
|
4751
5471
|
}
|
4752
5472
|
|
4753
5473
|
if (from < 1) {
|
@@ -4758,15 +5478,15 @@
|
|
4758
5478
|
to = this.totalPages;
|
4759
5479
|
}
|
4760
5480
|
|
4761
|
-
var middleSize = Math.round(
|
5481
|
+
var middleSize = Math.round(opts.paginationPagesBySide / 2);
|
4762
5482
|
|
4763
5483
|
var pageItem = function pageItem(i) {
|
4764
5484
|
var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
4765
|
-
return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i ===
|
5485
|
+
return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
|
4766
5486
|
};
|
4767
5487
|
|
4768
5488
|
if (from > 1) {
|
4769
|
-
var max =
|
5489
|
+
var max = opts.paginationPagesBySide;
|
4770
5490
|
if (max >= from) max = from - 1;
|
4771
5491
|
|
4772
5492
|
for (i = 1; i <= max; i++) {
|
@@ -4778,7 +5498,7 @@
|
|
4778
5498
|
html.push(pageItem(i));
|
4779
5499
|
} else {
|
4780
5500
|
if (from - 1 > max) {
|
4781
|
-
if (from -
|
5501
|
+
if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
|
4782
5502
|
i = Math.round((from - middleSize) / 2 + middleSize);
|
4783
5503
|
html.push(pageItem(i, ' page-intermediate'));
|
4784
5504
|
} else {
|
@@ -4793,7 +5513,7 @@
|
|
4793
5513
|
}
|
4794
5514
|
|
4795
5515
|
if (this.totalPages > to) {
|
4796
|
-
var min = this.totalPages - (
|
5516
|
+
var min = this.totalPages - (opts.paginationPagesBySide - 1);
|
4797
5517
|
if (to >= min) min = to + 1;
|
4798
5518
|
|
4799
5519
|
if (to + 1 === min - 1) {
|
@@ -4801,7 +5521,7 @@
|
|
4801
5521
|
html.push(pageItem(i));
|
4802
5522
|
} else {
|
4803
5523
|
if (min > to + 1) {
|
4804
|
-
if (this.totalPages - to >
|
5524
|
+
if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
|
4805
5525
|
i = Math.round((this.totalPages - middleSize - to) / 2 + to);
|
4806
5526
|
html.push(pageItem(i, ' page-intermediate'));
|
4807
5527
|
} else {
|
@@ -4815,15 +5535,15 @@
|
|
4815
5535
|
}
|
4816
5536
|
}
|
4817
5537
|
|
4818
|
-
html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next',
|
5538
|
+
html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
|
4819
5539
|
html.push(this.constants.html.pagination[1], '</div>');
|
4820
5540
|
}
|
4821
5541
|
|
4822
5542
|
this.$pagination.html(html.join(''));
|
4823
|
-
var dropupClass = ['bottom', 'both'].includes(
|
5543
|
+
var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
|
4824
5544
|
this.$pagination.last().find('.page-list > span').addClass(dropupClass);
|
4825
5545
|
|
4826
|
-
if (!
|
5546
|
+
if (!opts.onlyInfoPagination) {
|
4827
5547
|
$pageList = this.$pagination.find('.page-list a');
|
4828
5548
|
$pre = this.$pagination.find('.page-pre');
|
4829
5549
|
$next = this.$pagination.find('.page-next');
|
@@ -4833,8 +5553,8 @@
|
|
4833
5553
|
this.$pagination.find('div.pagination').hide();
|
4834
5554
|
}
|
4835
5555
|
|
4836
|
-
if (
|
4837
|
-
if (pageList.length < 2 ||
|
5556
|
+
if (opts.smartDisplay) {
|
5557
|
+
if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
|
4838
5558
|
this.$pagination.find('span.page-list').hide();
|
4839
5559
|
}
|
4840
5560
|
} // when data is empty, hide the pagination
|
@@ -4842,18 +5562,18 @@
|
|
4842
5562
|
|
4843
5563
|
this.$pagination[this.getData().length ? 'show' : 'hide']();
|
4844
5564
|
|
4845
|
-
if (!
|
4846
|
-
if (
|
5565
|
+
if (!opts.paginationLoop) {
|
5566
|
+
if (opts.pageNumber === 1) {
|
4847
5567
|
$pre.addClass('disabled');
|
4848
5568
|
}
|
4849
5569
|
|
4850
|
-
if (
|
5570
|
+
if (opts.pageNumber === this.totalPages) {
|
4851
5571
|
$next.addClass('disabled');
|
4852
5572
|
}
|
4853
5573
|
}
|
4854
5574
|
|
4855
|
-
if (
|
4856
|
-
|
5575
|
+
if (allSelected) {
|
5576
|
+
opts.pageSize = opts.formatAllRows();
|
4857
5577
|
} // removed the events for last and first, onPageNumber executeds the same logic
|
4858
5578
|
|
4859
5579
|
|
@@ -4884,14 +5604,13 @@
|
|
4884
5604
|
}
|
4885
5605
|
|
4886
5606
|
this.initPagination();
|
5607
|
+
this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
|
4887
5608
|
|
4888
5609
|
if (this.options.sidePagination === 'server') {
|
4889
5610
|
this.initServer();
|
4890
5611
|
} else {
|
4891
5612
|
this.initBody();
|
4892
5613
|
}
|
4893
|
-
|
4894
|
-
this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
|
4895
5614
|
}
|
4896
5615
|
}, {
|
4897
5616
|
key: "onPageListChange",
|
@@ -4964,10 +5683,10 @@
|
|
4964
5683
|
style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
|
4965
5684
|
|
4966
5685
|
if (style && style.css) {
|
4967
|
-
for (var
|
4968
|
-
var _Object$
|
4969
|
-
key = _Object$
|
4970
|
-
value = _Object$
|
5686
|
+
for (var _i7 = 0, _Object$entries6 = Object.entries(style.css); _i7 < _Object$entries6.length; _i7++) {
|
5687
|
+
var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
|
5688
|
+
key = _Object$entries6$_i[0],
|
5689
|
+
value = _Object$entries6$_i[1];
|
4971
5690
|
|
4972
5691
|
csses.push("".concat(key, ": ").concat(value));
|
4973
5692
|
}
|
@@ -4976,20 +5695,20 @@
|
|
4976
5695
|
attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
|
4977
5696
|
|
4978
5697
|
if (attributes) {
|
4979
|
-
for (var
|
4980
|
-
var _Object$
|
4981
|
-
|
4982
|
-
|
5698
|
+
for (var _i8 = 0, _Object$entries7 = Object.entries(attributes); _i8 < _Object$entries7.length; _i8++) {
|
5699
|
+
var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
|
5700
|
+
_key2 = _Object$entries7$_i[0],
|
5701
|
+
_value = _Object$entries7$_i[1];
|
4983
5702
|
|
4984
|
-
htmlAttributes.push("".concat(
|
5703
|
+
htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
|
4985
5704
|
}
|
4986
5705
|
}
|
4987
5706
|
|
4988
5707
|
if (item._data && !Utils.isEmptyObject(item._data)) {
|
4989
|
-
for (var
|
4990
|
-
var _Object$
|
4991
|
-
k = _Object$
|
4992
|
-
v = _Object$
|
5708
|
+
for (var _i9 = 0, _Object$entries8 = Object.entries(item._data); _i9 < _Object$entries8.length; _i9++) {
|
5709
|
+
var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
|
5710
|
+
k = _Object$entries8$_i[0],
|
5711
|
+
v = _Object$entries8$_i[1];
|
4993
5712
|
|
4994
5713
|
// ignore data-index
|
4995
5714
|
if (k === 'index') {
|
@@ -5000,20 +5719,26 @@
|
|
5000
5719
|
}
|
5001
5720
|
}
|
5002
5721
|
|
5003
|
-
html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"',
|
5722
|
+
html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
|
5004
5723
|
|
5005
5724
|
if (this.options.cardView) {
|
5006
5725
|
html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
|
5007
5726
|
}
|
5008
5727
|
|
5009
|
-
|
5010
|
-
|
5728
|
+
var detailViewTemplate = '';
|
5729
|
+
|
5730
|
+
if (Utils.hasDetailViewIcon(this.options)) {
|
5731
|
+
detailViewTemplate = '<td>';
|
5011
5732
|
|
5012
5733
|
if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
|
5013
|
-
|
5734
|
+
detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
|
5014
5735
|
}
|
5015
5736
|
|
5016
|
-
|
5737
|
+
detailViewTemplate += '</td>';
|
5738
|
+
}
|
5739
|
+
|
5740
|
+
if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
|
5741
|
+
html.push(detailViewTemplate);
|
5017
5742
|
}
|
5018
5743
|
|
5019
5744
|
this.header.fields.forEach(function (field, j) {
|
@@ -5025,13 +5750,14 @@
|
|
5025
5750
|
var id_ = '';
|
5026
5751
|
var class_ = _this7.header.classes[j];
|
5027
5752
|
var style_ = '';
|
5753
|
+
var styleToAdd_ = '';
|
5028
5754
|
var data_ = '';
|
5029
5755
|
var rowspan_ = '';
|
5030
5756
|
var colspan_ = '';
|
5031
5757
|
var title_ = '';
|
5032
5758
|
var column = _this7.columns[j];
|
5033
5759
|
|
5034
|
-
if (_this7.fromHtml && typeof value_ === 'undefined') {
|
5760
|
+
if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
|
5035
5761
|
if (!column.checkbox && !column.radio) {
|
5036
5762
|
return;
|
5037
5763
|
}
|
@@ -5047,11 +5773,21 @@
|
|
5047
5773
|
|
5048
5774
|
if (column.escape) {
|
5049
5775
|
value_ = Utils.escapeHTML(value_);
|
5050
|
-
}
|
5776
|
+
} // Style concat
|
5777
|
+
|
5051
5778
|
|
5052
5779
|
if (csses.concat([_this7.header.styles[j]]).length) {
|
5053
|
-
|
5054
|
-
}
|
5780
|
+
styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
|
5781
|
+
}
|
5782
|
+
|
5783
|
+
if (item["_".concat(field, "_style")]) {
|
5784
|
+
styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
|
5785
|
+
}
|
5786
|
+
|
5787
|
+
if (styleToAdd_) {
|
5788
|
+
style_ = " style=\"".concat(styleToAdd_, "\"");
|
5789
|
+
} // Style concat
|
5790
|
+
// handle id and class of td
|
5055
5791
|
|
5056
5792
|
|
5057
5793
|
if (item["_".concat(field, "_id")]) {
|
@@ -5083,12 +5819,12 @@
|
|
5083
5819
|
if (cellStyle.css) {
|
5084
5820
|
var csses_ = [];
|
5085
5821
|
|
5086
|
-
for (var
|
5087
|
-
var _Object$
|
5088
|
-
|
5089
|
-
|
5822
|
+
for (var _i10 = 0, _Object$entries9 = Object.entries(cellStyle.css); _i10 < _Object$entries9.length; _i10++) {
|
5823
|
+
var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
|
5824
|
+
_key3 = _Object$entries9$_i[0],
|
5825
|
+
_value2 = _Object$entries9$_i[1];
|
5090
5826
|
|
5091
|
-
csses_.push("".concat(
|
5827
|
+
csses_.push("".concat(_key3, ": ").concat(_value2));
|
5092
5828
|
}
|
5093
5829
|
|
5094
5830
|
style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
|
@@ -5096,18 +5832,22 @@
|
|
5096
5832
|
|
5097
5833
|
value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
|
5098
5834
|
|
5835
|
+
if (_this7.searchText !== '' && _this7.options.searchHighlight) {
|
5836
|
+
value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], value.replace(new RegExp('(' + _this7.searchText + ')', 'gim'), '<mark>$1</mark>'));
|
5837
|
+
}
|
5838
|
+
|
5099
5839
|
if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
|
5100
|
-
for (var
|
5101
|
-
var _Object$
|
5102
|
-
|
5103
|
-
|
5840
|
+
for (var _i11 = 0, _Object$entries10 = Object.entries(item["_".concat(field, "_data")]); _i11 < _Object$entries10.length; _i11++) {
|
5841
|
+
var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
|
5842
|
+
_k = _Object$entries10$_i[0],
|
5843
|
+
_v = _Object$entries10$_i[1];
|
5104
5844
|
|
5105
5845
|
// ignore data-index
|
5106
|
-
if (
|
5846
|
+
if (_k === 'index') {
|
5107
5847
|
return;
|
5108
5848
|
}
|
5109
5849
|
|
5110
|
-
data_ += " data-".concat(
|
5850
|
+
data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
|
5111
5851
|
}
|
5112
5852
|
}
|
5113
5853
|
|
@@ -5115,7 +5855,7 @@
|
|
5115
5855
|
type = column.checkbox ? 'checkbox' : type;
|
5116
5856
|
type = column.radio ? 'radio' : type;
|
5117
5857
|
var c = column['class'] || '';
|
5118
|
-
var isChecked = (value
|
5858
|
+
var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
|
5119
5859
|
var isDisabled = !column.checkboxEnabled || value && value.disabled;
|
5120
5860
|
text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
|
5121
5861
|
item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
|
@@ -5137,6 +5877,10 @@
|
|
5137
5877
|
html.push(text);
|
5138
5878
|
});
|
5139
5879
|
|
5880
|
+
if (detailViewTemplate && this.options.detailViewAlign === 'right') {
|
5881
|
+
html.push(detailViewTemplate);
|
5882
|
+
}
|
5883
|
+
|
5140
5884
|
if (this.options.cardView) {
|
5141
5885
|
html.push('</div></td>');
|
5142
5886
|
}
|
@@ -5166,6 +5910,7 @@
|
|
5166
5910
|
var rows = [];
|
5167
5911
|
var trFragments = $(document.createDocumentFragment());
|
5168
5912
|
var hasTr = false;
|
5913
|
+
this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
|
5169
5914
|
|
5170
5915
|
for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
|
5171
5916
|
var item = data[i];
|
@@ -5183,7 +5928,7 @@
|
|
5183
5928
|
|
5184
5929
|
|
5185
5930
|
if (!hasTr) {
|
5186
|
-
this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this
|
5931
|
+
this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
|
5187
5932
|
} else {
|
5188
5933
|
if (!this.options.virtualScroll) {
|
5189
5934
|
this.$body.html(trFragments);
|
@@ -5239,7 +5984,7 @@
|
|
5239
5984
|
|
5240
5985
|
var fields = _this9.getVisibleFields();
|
5241
5986
|
|
5242
|
-
var field = fields[
|
5987
|
+
var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
|
5243
5988
|
var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
|
5244
5989
|
var value = Utils.getItemField(item, field, _this9.options.escape);
|
5245
5990
|
|
@@ -5302,11 +6047,9 @@
|
|
5302
6047
|
return;
|
5303
6048
|
}
|
5304
6049
|
|
5305
|
-
|
5306
|
-
fieldIndex += 1;
|
5307
|
-
}
|
6050
|
+
fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
|
5308
6051
|
|
5309
|
-
var
|
6052
|
+
var _loop2 = function _loop2(key) {
|
5310
6053
|
if (!events.hasOwnProperty(key)) {
|
5311
6054
|
return "continue";
|
5312
6055
|
}
|
@@ -5329,9 +6072,9 @@
|
|
5329
6072
|
};
|
5330
6073
|
|
5331
6074
|
for (var key in events) {
|
5332
|
-
var
|
6075
|
+
var _ret2 = _loop2(key);
|
5333
6076
|
|
5334
|
-
if (
|
6077
|
+
if (_ret2 === "continue") continue;
|
5335
6078
|
}
|
5336
6079
|
});
|
5337
6080
|
}
|
@@ -5378,6 +6121,38 @@
|
|
5378
6121
|
}
|
5379
6122
|
}
|
5380
6123
|
|
6124
|
+
if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
|
6125
|
+
return !column.searchable;
|
6126
|
+
}).length) {
|
6127
|
+
params.searchable = [];
|
6128
|
+
var _iteratorNormalCompletion2 = true;
|
6129
|
+
var _didIteratorError2 = false;
|
6130
|
+
var _iteratorError2 = undefined;
|
6131
|
+
|
6132
|
+
try {
|
6133
|
+
for (var _iterator2 = this.columns[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
6134
|
+
var column = _step2.value;
|
6135
|
+
|
6136
|
+
if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
|
6137
|
+
params.searchable.push(column.field);
|
6138
|
+
}
|
6139
|
+
}
|
6140
|
+
} catch (err) {
|
6141
|
+
_didIteratorError2 = true;
|
6142
|
+
_iteratorError2 = err;
|
6143
|
+
} finally {
|
6144
|
+
try {
|
6145
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
6146
|
+
_iterator2.return();
|
6147
|
+
}
|
6148
|
+
} finally {
|
6149
|
+
if (_didIteratorError2) {
|
6150
|
+
throw _iteratorError2;
|
6151
|
+
}
|
6152
|
+
}
|
6153
|
+
}
|
6154
|
+
}
|
6155
|
+
|
5381
6156
|
if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
|
5382
6157
|
params.filter = JSON.stringify(this.filterColumnsPartial, null);
|
5383
6158
|
}
|
@@ -5405,11 +6180,15 @@
|
|
5405
6180
|
|
5406
6181
|
_this10.load(res);
|
5407
6182
|
|
5408
|
-
_this10.trigger('load-success', res, jqXHR.status, jqXHR);
|
6183
|
+
_this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
|
5409
6184
|
|
5410
6185
|
if (!silent) {
|
5411
6186
|
_this10.hideLoading();
|
5412
6187
|
}
|
6188
|
+
|
6189
|
+
if (_this10.options.sidePagination === 'server' && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
|
6190
|
+
_this10.updatePagination();
|
6191
|
+
}
|
5413
6192
|
},
|
5414
6193
|
error: function error(jqXHR) {
|
5415
6194
|
var data = [];
|
@@ -5422,7 +6201,7 @@
|
|
5422
6201
|
|
5423
6202
|
_this10.load(data);
|
5424
6203
|
|
5425
|
-
_this10.trigger('load-error', jqXHR.status, jqXHR);
|
6204
|
+
_this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
|
5426
6205
|
|
5427
6206
|
if (!silent) _this10.$tableLoading.hide();
|
5428
6207
|
}
|
@@ -5447,7 +6226,7 @@
|
|
5447
6226
|
this.searchText = '';
|
5448
6227
|
|
5449
6228
|
if (this.options.searchText !== '') {
|
5450
|
-
var $search =
|
6229
|
+
var $search = Utils.getSearchInput(this);
|
5451
6230
|
$search.val(this.options.searchText);
|
5452
6231
|
this.onSearch({
|
5453
6232
|
currentTarget: $search,
|
@@ -5486,13 +6265,13 @@
|
|
5486
6265
|
}, {
|
5487
6266
|
key: "resetRows",
|
5488
6267
|
value: function resetRows() {
|
5489
|
-
var
|
5490
|
-
var
|
5491
|
-
var
|
6268
|
+
var _iteratorNormalCompletion3 = true;
|
6269
|
+
var _didIteratorError3 = false;
|
6270
|
+
var _iteratorError3 = undefined;
|
5492
6271
|
|
5493
6272
|
try {
|
5494
|
-
for (var
|
5495
|
-
var row =
|
6273
|
+
for (var _iterator3 = this.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
6274
|
+
var row = _step3.value;
|
5496
6275
|
this.$selectAll.prop('checked', false);
|
5497
6276
|
this.$selectItem.prop('checked', false);
|
5498
6277
|
|
@@ -5501,16 +6280,16 @@
|
|
5501
6280
|
}
|
5502
6281
|
}
|
5503
6282
|
} catch (err) {
|
5504
|
-
|
5505
|
-
|
6283
|
+
_didIteratorError3 = true;
|
6284
|
+
_iteratorError3 = err;
|
5506
6285
|
} finally {
|
5507
6286
|
try {
|
5508
|
-
if (!
|
5509
|
-
|
6287
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
6288
|
+
_iterator3.return();
|
5510
6289
|
}
|
5511
6290
|
} finally {
|
5512
|
-
if (
|
5513
|
-
throw
|
6291
|
+
if (_didIteratorError3) {
|
6292
|
+
throw _iteratorError3;
|
5514
6293
|
}
|
5515
6294
|
}
|
5516
6295
|
}
|
@@ -5520,19 +6299,25 @@
|
|
5520
6299
|
}, {
|
5521
6300
|
key: "trigger",
|
5522
6301
|
value: function trigger(_name) {
|
5523
|
-
var _this$options;
|
6302
|
+
var _this$options, _this$options2;
|
5524
6303
|
|
5525
6304
|
var name = "".concat(_name, ".bs.table");
|
5526
6305
|
|
5527
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0),
|
5528
|
-
args[
|
6306
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
|
6307
|
+
args[_key4 - 1] = arguments[_key4];
|
5529
6308
|
}
|
5530
6309
|
|
5531
|
-
(_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, args);
|
6310
|
+
(_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
|
6311
|
+
|
6312
|
+
this.$el.trigger($.Event(name, {
|
6313
|
+
sender: this
|
6314
|
+
}), args);
|
6315
|
+
|
6316
|
+
(_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
|
5532
6317
|
|
5533
|
-
this.$el.trigger($.Event(
|
5534
|
-
|
5535
|
-
|
6318
|
+
this.$el.trigger($.Event('all.bs.table', {
|
6319
|
+
sender: this
|
6320
|
+
}), [name, args]);
|
5536
6321
|
}
|
5537
6322
|
}, {
|
5538
6323
|
key: "resetHeader",
|
@@ -5602,25 +6387,22 @@
|
|
5602
6387
|
$tr = $tr.next();
|
5603
6388
|
}
|
5604
6389
|
|
6390
|
+
var trLength = $tr.find('> *').length;
|
5605
6391
|
$tr.find('> *').each(function (i, el) {
|
5606
6392
|
var $this = $(el);
|
5607
|
-
var index = i;
|
5608
6393
|
|
5609
|
-
if (
|
5610
|
-
if (i === 0) {
|
6394
|
+
if (Utils.hasDetailViewIcon(_this14.options)) {
|
6395
|
+
if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
|
5611
6396
|
var $thDetail = $ths.filter('.detail');
|
5612
6397
|
|
5613
6398
|
var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
|
5614
6399
|
|
5615
6400
|
$thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
|
6401
|
+
return;
|
5616
6402
|
}
|
5617
|
-
|
5618
|
-
index = i - 1;
|
5619
6403
|
}
|
5620
6404
|
|
5621
|
-
|
5622
|
-
return;
|
5623
|
-
}
|
6405
|
+
var index = i - Utils.getDetailViewIndexOffset(_this14.options);
|
5624
6406
|
|
5625
6407
|
var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
|
5626
6408
|
|
@@ -5644,25 +6426,30 @@
|
|
5644
6426
|
|
5645
6427
|
var data = this.getData();
|
5646
6428
|
var html = [];
|
6429
|
+
var detailTemplate = '';
|
5647
6430
|
|
5648
|
-
if (
|
5649
|
-
|
6431
|
+
if (Utils.hasDetailViewIcon(this.options)) {
|
6432
|
+
detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
|
5650
6433
|
}
|
5651
6434
|
|
5652
|
-
|
5653
|
-
|
5654
|
-
|
6435
|
+
if (detailTemplate && this.options.detailViewAlign !== 'right') {
|
6436
|
+
html.push(detailTemplate);
|
6437
|
+
}
|
6438
|
+
|
6439
|
+
var _iteratorNormalCompletion4 = true;
|
6440
|
+
var _didIteratorError4 = false;
|
6441
|
+
var _iteratorError4 = undefined;
|
5655
6442
|
|
5656
6443
|
try {
|
5657
|
-
for (var
|
5658
|
-
var column =
|
6444
|
+
for (var _iterator4 = this.columns[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
6445
|
+
var column = _step4.value;
|
5659
6446
|
var falign = '';
|
5660
6447
|
var valign = '';
|
5661
6448
|
var csses = [];
|
5662
6449
|
var style = {};
|
5663
6450
|
var class_ = Utils.sprintf(' class="%s"', column['class']);
|
5664
6451
|
|
5665
|
-
if (!column.visible) {
|
6452
|
+
if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
|
5666
6453
|
continue;
|
5667
6454
|
}
|
5668
6455
|
|
@@ -5675,12 +6462,12 @@
|
|
5675
6462
|
style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
|
5676
6463
|
|
5677
6464
|
if (style && style.css) {
|
5678
|
-
for (var
|
5679
|
-
var _Object$
|
5680
|
-
key = _Object$
|
5681
|
-
|
6465
|
+
for (var _i12 = 0, _Object$entries11 = Object.entries(style.css); _i12 < _Object$entries11.length; _i12++) {
|
6466
|
+
var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
|
6467
|
+
key = _Object$entries11$_i[0],
|
6468
|
+
_value3 = _Object$entries11$_i[1];
|
5682
6469
|
|
5683
|
-
csses.push("".concat(key, ": ").concat(
|
6470
|
+
csses.push("".concat(key, ": ").concat(_value3));
|
5684
6471
|
}
|
5685
6472
|
}
|
5686
6473
|
|
@@ -5688,29 +6475,55 @@
|
|
5688
6475
|
class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
|
5689
6476
|
}
|
5690
6477
|
|
5691
|
-
html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; '))
|
6478
|
+
html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
|
6479
|
+
var colspan = 0;
|
6480
|
+
|
6481
|
+
if (this.footerData && this.footerData.length > 0) {
|
6482
|
+
colspan = this.footerData[0]['_' + column.field + '_colspan'] || 0;
|
6483
|
+
}
|
6484
|
+
|
6485
|
+
if (colspan) {
|
6486
|
+
html.push(" colspan=\"".concat(colspan, "\" "));
|
6487
|
+
}
|
6488
|
+
|
6489
|
+
html.push('>');
|
5692
6490
|
html.push('<div class="th-inner">');
|
5693
|
-
|
6491
|
+
var value = '';
|
6492
|
+
|
6493
|
+
if (this.footerData && this.footerData.length > 0) {
|
6494
|
+
value = this.footerData[0][column.field] || '';
|
6495
|
+
}
|
6496
|
+
|
6497
|
+
html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
|
5694
6498
|
html.push('</div>');
|
5695
6499
|
html.push('<div class="fht-cell"></div>');
|
5696
6500
|
html.push('</div>');
|
5697
6501
|
html.push('</th>');
|
5698
6502
|
}
|
5699
6503
|
} catch (err) {
|
5700
|
-
|
5701
|
-
|
6504
|
+
_didIteratorError4 = true;
|
6505
|
+
_iteratorError4 = err;
|
5702
6506
|
} finally {
|
5703
6507
|
try {
|
5704
|
-
if (!
|
5705
|
-
|
6508
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
6509
|
+
_iterator4.return();
|
5706
6510
|
}
|
5707
6511
|
} finally {
|
5708
|
-
if (
|
5709
|
-
throw
|
6512
|
+
if (_didIteratorError4) {
|
6513
|
+
throw _iteratorError4;
|
5710
6514
|
}
|
5711
6515
|
}
|
5712
6516
|
}
|
5713
6517
|
|
6518
|
+
if (detailTemplate && this.options.detailViewAlign === 'right') {
|
6519
|
+
html.push(detailTemplate);
|
6520
|
+
}
|
6521
|
+
|
6522
|
+
if (!this.options.height && !this.$tableFooter.length) {
|
6523
|
+
this.$el.append('<tfoot><tr></tr></tfoot>');
|
6524
|
+
this.$tableFooter = this.$el.find('tfoot');
|
6525
|
+
}
|
6526
|
+
|
5714
6527
|
this.$tableFooter.find('tr').html(html.join(''));
|
5715
6528
|
this.trigger('post-footer', this.$tableFooter);
|
5716
6529
|
}
|
@@ -5732,29 +6545,25 @@
|
|
5732
6545
|
var visibleFields = this.getVisibleFields();
|
5733
6546
|
var $ths = this.$tableFooter.find('th');
|
5734
6547
|
var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
|
6548
|
+
$ths.find('.fht-cell').width('auto');
|
5735
6549
|
|
5736
6550
|
while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
|
5737
6551
|
$tr = $tr.next();
|
5738
6552
|
}
|
5739
6553
|
|
6554
|
+
var trLength = $tr.find('> *').length;
|
5740
6555
|
$tr.find('> *').each(function (i, el) {
|
5741
6556
|
var $this = $(el);
|
5742
|
-
var index = i;
|
5743
6557
|
|
5744
|
-
if (
|
5745
|
-
if (i === 0) {
|
6558
|
+
if (Utils.hasDetailViewIcon(_this15.options)) {
|
6559
|
+
if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
|
5746
6560
|
var $thDetail = $ths.filter('.detail');
|
5747
6561
|
|
5748
6562
|
var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
|
5749
6563
|
|
5750
6564
|
$thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
|
6565
|
+
return;
|
5751
6566
|
}
|
5752
|
-
|
5753
|
-
index = i - 1;
|
5754
|
-
}
|
5755
|
-
|
5756
|
-
if (index === -1) {
|
5757
|
-
return;
|
5758
6567
|
}
|
5759
6568
|
|
5760
6569
|
var $th = $ths.eq(i);
|
@@ -5770,31 +6579,31 @@
|
|
5770
6579
|
|
5771
6580
|
// horizontal scroll event
|
5772
6581
|
// TODO: it's probably better improving the layout than binding to scroll event
|
5773
|
-
this.$tableBody.off('scroll').on('scroll', function (
|
5774
|
-
var
|
6582
|
+
this.$tableBody.off('scroll').on('scroll', function () {
|
6583
|
+
var scrollLeft = _this16.$tableBody.scrollLeft();
|
5775
6584
|
|
5776
6585
|
if (_this16.options.showHeader && _this16.options.height) {
|
5777
|
-
_this16.$tableHeader.scrollLeft(
|
6586
|
+
_this16.$tableHeader.scrollLeft(scrollLeft);
|
5778
6587
|
}
|
5779
6588
|
|
5780
6589
|
if (_this16.options.showFooter && !_this16.options.cardView) {
|
5781
|
-
_this16.$tableFooter.scrollLeft(
|
6590
|
+
_this16.$tableFooter.scrollLeft(scrollLeft);
|
5782
6591
|
}
|
5783
6592
|
|
5784
|
-
_this16.trigger('scroll-body',
|
6593
|
+
_this16.trigger('scroll-body', _this16.$tableBody);
|
5785
6594
|
});
|
5786
6595
|
}
|
5787
6596
|
}, {
|
5788
6597
|
key: "getVisibleFields",
|
5789
6598
|
value: function getVisibleFields() {
|
5790
6599
|
var visibleFields = [];
|
5791
|
-
var
|
5792
|
-
var
|
5793
|
-
var
|
6600
|
+
var _iteratorNormalCompletion5 = true;
|
6601
|
+
var _didIteratorError5 = false;
|
6602
|
+
var _iteratorError5 = undefined;
|
5794
6603
|
|
5795
6604
|
try {
|
5796
|
-
for (var
|
5797
|
-
var field =
|
6605
|
+
for (var _iterator5 = this.header.fields[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
|
6606
|
+
var field = _step5.value;
|
5798
6607
|
var column = this.columns[this.fieldsColumnsIndex[field]];
|
5799
6608
|
|
5800
6609
|
if (!column || !column.visible) {
|
@@ -5804,16 +6613,16 @@
|
|
5804
6613
|
visibleFields.push(field);
|
5805
6614
|
}
|
5806
6615
|
} catch (err) {
|
5807
|
-
|
5808
|
-
|
6616
|
+
_didIteratorError5 = true;
|
6617
|
+
_iteratorError5 = err;
|
5809
6618
|
} finally {
|
5810
6619
|
try {
|
5811
|
-
if (!
|
5812
|
-
|
6620
|
+
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
6621
|
+
_iterator5.return();
|
5813
6622
|
}
|
5814
6623
|
} finally {
|
5815
|
-
if (
|
5816
|
-
throw
|
6624
|
+
if (_didIteratorError5) {
|
6625
|
+
throw _iteratorError5;
|
5817
6626
|
}
|
5818
6627
|
}
|
5819
6628
|
}
|
@@ -5851,9 +6660,11 @@
|
|
5851
6660
|
}, {
|
5852
6661
|
key: "getData",
|
5853
6662
|
value: function getData(params) {
|
6663
|
+
var _this17 = this;
|
6664
|
+
|
5854
6665
|
var data = this.options.data;
|
5855
6666
|
|
5856
|
-
if (this.searchText || this.options.sortName || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) {
|
6667
|
+
if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
|
5857
6668
|
data = this.data;
|
5858
6669
|
}
|
5859
6670
|
|
@@ -5868,21 +6679,29 @@
|
|
5868
6679
|
});
|
5869
6680
|
}
|
5870
6681
|
|
6682
|
+
if (params && params.formatted) {
|
6683
|
+
data.forEach(function (row) {
|
6684
|
+
for (var _i13 = 0, _Object$entries12 = Object.entries(row); _i13 < _Object$entries12.length; _i13++) {
|
6685
|
+
var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
|
6686
|
+
key = _Object$entries12$_i[0],
|
6687
|
+
value = _Object$entries12$_i[1];
|
6688
|
+
|
6689
|
+
var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
|
6690
|
+
|
6691
|
+
if (!column) {
|
6692
|
+
return;
|
6693
|
+
}
|
6694
|
+
|
6695
|
+
row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
|
6696
|
+
}
|
6697
|
+
});
|
6698
|
+
}
|
6699
|
+
|
5871
6700
|
return data;
|
5872
6701
|
}
|
5873
6702
|
}, {
|
5874
6703
|
key: "getSelections",
|
5875
6704
|
value: function getSelections() {
|
5876
|
-
var _this17 = this;
|
5877
|
-
|
5878
|
-
// fix #2424: from html with checkbox
|
5879
|
-
return this.data.filter(function (row) {
|
5880
|
-
return row[_this17.header.stateField] === true;
|
5881
|
-
});
|
5882
|
-
}
|
5883
|
-
}, {
|
5884
|
-
key: "getAllSelections",
|
5885
|
-
value: function getAllSelections() {
|
5886
6705
|
var _this18 = this;
|
5887
6706
|
|
5888
6707
|
return this.options.data.filter(function (row) {
|
@@ -5897,10 +6716,8 @@
|
|
5897
6716
|
|
5898
6717
|
if (this.options.pagination && this.options.sidePagination === 'server') {
|
5899
6718
|
this.options.totalRows = data[this.options.totalField];
|
5900
|
-
}
|
5901
|
-
|
5902
|
-
if (this.options.pagination && this.options.sidePagination === 'server') {
|
5903
6719
|
this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
|
6720
|
+
this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
|
5904
6721
|
}
|
5905
6722
|
|
5906
6723
|
fixedScroll = data.fixedScroll;
|
@@ -5940,13 +6757,18 @@
|
|
5940
6757
|
}
|
5941
6758
|
|
5942
6759
|
for (i = len - 1; i >= 0; i--) {
|
6760
|
+
var exists = false;
|
5943
6761
|
row = this.options.data[i];
|
5944
6762
|
|
5945
|
-
if (!row.hasOwnProperty(params.field)) {
|
6763
|
+
if (!row.hasOwnProperty(params.field) && params.field !== '$index') {
|
5946
6764
|
continue;
|
6765
|
+
} else if (!row.hasOwnProperty(params.field) && params.field === '$index') {
|
6766
|
+
exists = params.values.includes(i);
|
6767
|
+
} else {
|
6768
|
+
exists = params.values.includes(row[params.field]);
|
5947
6769
|
}
|
5948
6770
|
|
5949
|
-
if (
|
6771
|
+
if (exists) {
|
5950
6772
|
this.options.data.splice(i, 1);
|
5951
6773
|
|
5952
6774
|
if (this.options.sidePagination === 'server') {
|
@@ -5991,20 +6813,18 @@
|
|
5991
6813
|
key: "updateRow",
|
5992
6814
|
value: function updateRow(params) {
|
5993
6815
|
var allParams = Array.isArray(params) ? params : [params];
|
5994
|
-
var
|
5995
|
-
var
|
5996
|
-
var
|
6816
|
+
var _iteratorNormalCompletion6 = true;
|
6817
|
+
var _didIteratorError6 = false;
|
6818
|
+
var _iteratorError6 = undefined;
|
5997
6819
|
|
5998
6820
|
try {
|
5999
|
-
for (var
|
6000
|
-
var _params =
|
6821
|
+
for (var _iterator6 = allParams[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
|
6822
|
+
var _params = _step6.value;
|
6001
6823
|
|
6002
6824
|
if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
|
6003
6825
|
continue;
|
6004
6826
|
}
|
6005
6827
|
|
6006
|
-
$.extend(this.options.data[_params.index], _params.row);
|
6007
|
-
|
6008
6828
|
if (_params.hasOwnProperty('replace') && _params.replace) {
|
6009
6829
|
this.options.data[_params.index] = _params.row;
|
6010
6830
|
} else {
|
@@ -6012,16 +6832,16 @@
|
|
6012
6832
|
}
|
6013
6833
|
}
|
6014
6834
|
} catch (err) {
|
6015
|
-
|
6016
|
-
|
6835
|
+
_didIteratorError6 = true;
|
6836
|
+
_iteratorError6 = err;
|
6017
6837
|
} finally {
|
6018
6838
|
try {
|
6019
|
-
if (!
|
6020
|
-
|
6839
|
+
if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
|
6840
|
+
_iterator6.return();
|
6021
6841
|
}
|
6022
6842
|
} finally {
|
6023
|
-
if (
|
6024
|
-
throw
|
6843
|
+
if (_didIteratorError6) {
|
6844
|
+
throw _iteratorError6;
|
6025
6845
|
}
|
6026
6846
|
}
|
6027
6847
|
}
|
@@ -6077,13 +6897,13 @@
|
|
6077
6897
|
key: "updateByUniqueId",
|
6078
6898
|
value: function updateByUniqueId(params) {
|
6079
6899
|
var allParams = Array.isArray(params) ? params : [params];
|
6080
|
-
var
|
6081
|
-
var
|
6082
|
-
var
|
6900
|
+
var _iteratorNormalCompletion7 = true;
|
6901
|
+
var _didIteratorError7 = false;
|
6902
|
+
var _iteratorError7 = undefined;
|
6083
6903
|
|
6084
6904
|
try {
|
6085
|
-
for (var
|
6086
|
-
var _params2 =
|
6905
|
+
for (var _iterator7 = allParams[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
|
6906
|
+
var _params2 = _step7.value;
|
6087
6907
|
|
6088
6908
|
if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
|
6089
6909
|
continue;
|
@@ -6102,16 +6922,16 @@
|
|
6102
6922
|
}
|
6103
6923
|
}
|
6104
6924
|
} catch (err) {
|
6105
|
-
|
6106
|
-
|
6925
|
+
_didIteratorError7 = true;
|
6926
|
+
_iteratorError7 = err;
|
6107
6927
|
} finally {
|
6108
6928
|
try {
|
6109
|
-
if (!
|
6110
|
-
|
6929
|
+
if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
|
6930
|
+
_iterator7.return();
|
6111
6931
|
}
|
6112
6932
|
} finally {
|
6113
|
-
if (
|
6114
|
-
throw
|
6933
|
+
if (_didIteratorError7) {
|
6934
|
+
throw _iteratorError7;
|
6115
6935
|
}
|
6116
6936
|
}
|
6117
6937
|
}
|
@@ -6160,15 +6980,11 @@
|
|
6160
6980
|
value: function updateCellByUniqueId(params) {
|
6161
6981
|
var _this19 = this;
|
6162
6982
|
|
6163
|
-
if (!params.hasOwnProperty('id') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
|
6164
|
-
return;
|
6165
|
-
}
|
6166
|
-
|
6167
6983
|
var allParams = Array.isArray(params) ? params : [params];
|
6168
|
-
allParams.forEach(function (
|
6169
|
-
var id =
|
6170
|
-
field =
|
6171
|
-
value =
|
6984
|
+
allParams.forEach(function (_ref6) {
|
6985
|
+
var id = _ref6.id,
|
6986
|
+
field = _ref6.field,
|
6987
|
+
value = _ref6.value;
|
6172
6988
|
|
6173
6989
|
var rowId = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
|
6174
6990
|
|
@@ -6219,12 +7035,8 @@
|
|
6219
7035
|
this.hiddenRows.splice(index, 1);
|
6220
7036
|
}
|
6221
7037
|
|
6222
|
-
|
6223
|
-
|
6224
|
-
} else {
|
6225
|
-
this.initBody(true);
|
6226
|
-
this.initPagination();
|
6227
|
-
}
|
7038
|
+
this.initBody(true);
|
7039
|
+
this.initPagination();
|
6228
7040
|
}
|
6229
7041
|
}, {
|
6230
7042
|
key: "getHiddenRows",
|
@@ -6232,34 +7044,35 @@
|
|
6232
7044
|
if (show) {
|
6233
7045
|
this.initHiddenRows();
|
6234
7046
|
this.initBody(true);
|
7047
|
+
this.initPagination();
|
6235
7048
|
return;
|
6236
7049
|
}
|
6237
7050
|
|
6238
7051
|
var data = this.getData();
|
6239
7052
|
var rows = [];
|
6240
|
-
var
|
6241
|
-
var
|
6242
|
-
var
|
7053
|
+
var _iteratorNormalCompletion8 = true;
|
7054
|
+
var _didIteratorError8 = false;
|
7055
|
+
var _iteratorError8 = undefined;
|
6243
7056
|
|
6244
7057
|
try {
|
6245
|
-
for (var
|
6246
|
-
var row =
|
7058
|
+
for (var _iterator8 = data[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
|
7059
|
+
var row = _step8.value;
|
6247
7060
|
|
6248
7061
|
if (this.hiddenRows.includes(row)) {
|
6249
7062
|
rows.push(row);
|
6250
7063
|
}
|
6251
7064
|
}
|
6252
7065
|
} catch (err) {
|
6253
|
-
|
6254
|
-
|
7066
|
+
_didIteratorError8 = true;
|
7067
|
+
_iteratorError8 = err;
|
6255
7068
|
} finally {
|
6256
7069
|
try {
|
6257
|
-
if (!
|
6258
|
-
|
7070
|
+
if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
|
7071
|
+
_iterator8.return();
|
6259
7072
|
}
|
6260
7073
|
} finally {
|
6261
|
-
if (
|
6262
|
-
throw
|
7074
|
+
if (_didIteratorError8) {
|
7075
|
+
throw _iteratorError8;
|
6263
7076
|
}
|
6264
7077
|
}
|
6265
7078
|
}
|
@@ -6301,7 +7114,7 @@
|
|
6301
7114
|
this.initBody();
|
6302
7115
|
|
6303
7116
|
if (this.options.showColumns) {
|
6304
|
-
var $items = this.$toolbar.find('.keep-open input').prop('disabled', false);
|
7117
|
+
var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
|
6305
7118
|
|
6306
7119
|
if (needUpdate) {
|
6307
7120
|
$items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
|
@@ -6315,19 +7128,25 @@
|
|
6315
7128
|
}, {
|
6316
7129
|
key: "getVisibleColumns",
|
6317
7130
|
value: function getVisibleColumns() {
|
6318
|
-
|
6319
|
-
|
6320
|
-
|
7131
|
+
var _this22 = this;
|
7132
|
+
|
7133
|
+
return this.columns.filter(function (column) {
|
7134
|
+
return column.visible && !_this22.isSelectionColumn(column);
|
6321
7135
|
});
|
6322
7136
|
}
|
6323
7137
|
}, {
|
6324
7138
|
key: "getHiddenColumns",
|
6325
7139
|
value: function getHiddenColumns() {
|
6326
|
-
return this.columns.filter(function (
|
6327
|
-
var visible =
|
7140
|
+
return this.columns.filter(function (_ref7) {
|
7141
|
+
var visible = _ref7.visible;
|
6328
7142
|
return !visible;
|
6329
7143
|
});
|
6330
7144
|
}
|
7145
|
+
}, {
|
7146
|
+
key: "isSelectionColumn",
|
7147
|
+
value: function isSelectionColumn(column) {
|
7148
|
+
return column.radio || column.checkbox;
|
7149
|
+
}
|
6331
7150
|
}, {
|
6332
7151
|
key: "showAllColumns",
|
6333
7152
|
value: function showAllColumns() {
|
@@ -6341,15 +7160,15 @@
|
|
6341
7160
|
}, {
|
6342
7161
|
key: "_toggleAllColumns",
|
6343
7162
|
value: function _toggleAllColumns(visible) {
|
6344
|
-
var
|
7163
|
+
var _this23 = this;
|
6345
7164
|
|
6346
|
-
var
|
6347
|
-
var
|
6348
|
-
var
|
7165
|
+
var _iteratorNormalCompletion9 = true;
|
7166
|
+
var _didIteratorError9 = false;
|
7167
|
+
var _iteratorError9 = undefined;
|
6349
7168
|
|
6350
7169
|
try {
|
6351
|
-
for (var
|
6352
|
-
var column =
|
7170
|
+
for (var _iterator9 = this.columns.slice().reverse()[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
|
7171
|
+
var column = _step9.value;
|
6353
7172
|
|
6354
7173
|
if (column.switchable) {
|
6355
7174
|
if (!visible && this.options.showColumns && this.getVisibleColumns().length === this.options.minimumCountColumns) {
|
@@ -6360,16 +7179,16 @@
|
|
6360
7179
|
}
|
6361
7180
|
}
|
6362
7181
|
} catch (err) {
|
6363
|
-
|
6364
|
-
|
7182
|
+
_didIteratorError9 = true;
|
7183
|
+
_iteratorError9 = err;
|
6365
7184
|
} finally {
|
6366
7185
|
try {
|
6367
|
-
if (!
|
6368
|
-
|
7186
|
+
if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
|
7187
|
+
_iterator9.return();
|
6369
7188
|
}
|
6370
7189
|
} finally {
|
6371
|
-
if (
|
6372
|
-
throw
|
7190
|
+
if (_didIteratorError9) {
|
7191
|
+
throw _iteratorError9;
|
6373
7192
|
}
|
6374
7193
|
}
|
6375
7194
|
}
|
@@ -6380,13 +7199,13 @@
|
|
6380
7199
|
this.initBody();
|
6381
7200
|
|
6382
7201
|
if (this.options.showColumns) {
|
6383
|
-
var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
|
7202
|
+
var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
|
6384
7203
|
|
6385
7204
|
if (visible) {
|
6386
7205
|
$items.prop('checked', visible);
|
6387
7206
|
} else {
|
6388
7207
|
$items.get().reverse().forEach(function (item) {
|
6389
|
-
if ($items.filter(':checked').length >
|
7208
|
+
if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
|
6390
7209
|
$(item).prop('checked', visible);
|
6391
7210
|
}
|
6392
7211
|
});
|
@@ -6407,11 +7226,7 @@
|
|
6407
7226
|
var i;
|
6408
7227
|
var j;
|
6409
7228
|
var $tr = this.$body.find('>tr');
|
6410
|
-
|
6411
|
-
if (this.options.detailView && !this.options.cardView) {
|
6412
|
-
col += 1;
|
6413
|
-
}
|
6414
|
-
|
7229
|
+
col += Utils.getDetailViewIndexOffset(this.options);
|
6415
7230
|
var $td = $tr.eq(row).find('>td').eq(col);
|
6416
7231
|
|
6417
7232
|
if (row < 0 || col < 0 || row >= this.data.length) {
|
@@ -6443,6 +7258,7 @@
|
|
6443
7258
|
this.$selectAll.add(this.$selectAll_).prop('checked', checked);
|
6444
7259
|
this.$selectItem.filter(':enabled').prop('checked', checked);
|
6445
7260
|
this.updateRows();
|
7261
|
+
this.updateSelected();
|
6446
7262
|
var rowsAfter = this.getSelections();
|
6447
7263
|
|
6448
7264
|
if (checked) {
|
@@ -6480,29 +7296,29 @@
|
|
6480
7296
|
key: "_toggleCheck",
|
6481
7297
|
value: function _toggleCheck(checked, index) {
|
6482
7298
|
var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
|
6483
|
-
var row = this.data[index];
|
7299
|
+
var row = this.options.data[index];
|
6484
7300
|
|
6485
7301
|
if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
|
6486
|
-
var
|
6487
|
-
var
|
6488
|
-
var
|
7302
|
+
var _iteratorNormalCompletion10 = true;
|
7303
|
+
var _didIteratorError10 = false;
|
7304
|
+
var _iteratorError10 = undefined;
|
6489
7305
|
|
6490
7306
|
try {
|
6491
|
-
for (var
|
6492
|
-
var r =
|
7307
|
+
for (var _iterator10 = this.options.data[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
|
7308
|
+
var r = _step10.value;
|
6493
7309
|
r[this.header.stateField] = false;
|
6494
7310
|
}
|
6495
7311
|
} catch (err) {
|
6496
|
-
|
6497
|
-
|
7312
|
+
_didIteratorError10 = true;
|
7313
|
+
_iteratorError10 = err;
|
6498
7314
|
} finally {
|
6499
7315
|
try {
|
6500
|
-
if (!
|
6501
|
-
|
7316
|
+
if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
|
7317
|
+
_iterator10.return();
|
6502
7318
|
}
|
6503
7319
|
} finally {
|
6504
|
-
if (
|
6505
|
-
throw
|
7320
|
+
if (_didIteratorError10) {
|
7321
|
+
throw _iteratorError10;
|
6506
7322
|
}
|
6507
7323
|
}
|
6508
7324
|
}
|
@@ -6544,7 +7360,7 @@
|
|
6544
7360
|
}, {
|
6545
7361
|
key: "_toggleCheckBy",
|
6546
7362
|
value: function _toggleCheckBy(checked, obj) {
|
6547
|
-
var
|
7363
|
+
var _this24 = this;
|
6548
7364
|
|
6549
7365
|
if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
|
6550
7366
|
return;
|
@@ -6557,7 +7373,7 @@
|
|
6557
7373
|
}
|
6558
7374
|
|
6559
7375
|
if (obj.values.includes(row[obj.field])) {
|
6560
|
-
var $el =
|
7376
|
+
var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
|
6561
7377
|
|
6562
7378
|
$el = checked ? $el.not(':checked') : $el.filter(':checked');
|
6563
7379
|
|
@@ -6566,10 +7382,10 @@
|
|
6566
7382
|
}
|
6567
7383
|
|
6568
7384
|
$el.prop('checked', checked);
|
6569
|
-
row[
|
7385
|
+
row[_this24.header.stateField] = checked;
|
6570
7386
|
rows.push(row);
|
6571
7387
|
|
6572
|
-
|
7388
|
+
_this24.trigger(checked ? 'check' : 'uncheck', row, $el);
|
6573
7389
|
}
|
6574
7390
|
});
|
6575
7391
|
this.updateSelected();
|
@@ -6631,13 +7447,32 @@
|
|
6631
7447
|
}
|
6632
7448
|
}
|
6633
7449
|
|
6634
|
-
if (this.
|
7450
|
+
if (this.$container.hasClass('fullscreen')) {
|
7451
|
+
this.$tableContainer.css('height', '');
|
7452
|
+
this.$tableContainer.css('width', '');
|
7453
|
+
} else if (this.options.height) {
|
7454
|
+
if (this.$tableBorder) {
|
7455
|
+
this.$tableBorder.css('width', '');
|
7456
|
+
this.$tableBorder.css('height', '');
|
7457
|
+
}
|
7458
|
+
|
6635
7459
|
var toolbarHeight = this.$toolbar.outerHeight(true);
|
6636
7460
|
var paginationHeight = this.$pagination.outerHeight(true);
|
6637
7461
|
var height = this.options.height - toolbarHeight - paginationHeight;
|
6638
|
-
var
|
7462
|
+
var $bodyTable = this.$tableBody.find('>table');
|
7463
|
+
var tableHeight = $bodyTable.outerHeight();
|
6639
7464
|
this.$tableContainer.css('height', "".concat(height, "px"));
|
6640
|
-
|
7465
|
+
|
7466
|
+
if (this.$tableBorder && $bodyTable.is(':visible')) {
|
7467
|
+
var tableBorderHeight = height - tableHeight - 2;
|
7468
|
+
|
7469
|
+
if (this.$tableBody[0].scrollWidth - this.$tableBody.innerWidth()) {
|
7470
|
+
tableBorderHeight -= Utils.getScrollBarWidth();
|
7471
|
+
}
|
7472
|
+
|
7473
|
+
this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
|
7474
|
+
this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
|
7475
|
+
}
|
6641
7476
|
}
|
6642
7477
|
|
6643
7478
|
if (this.options.cardView) {
|
@@ -6653,26 +7488,25 @@
|
|
6653
7488
|
|
6654
7489
|
this.trigger('reset-view');
|
6655
7490
|
}
|
6656
|
-
}, {
|
6657
|
-
key: "resetWidth",
|
6658
|
-
value: function resetWidth() {
|
6659
|
-
if (this.options.showHeader && this.options.height) {
|
6660
|
-
this.fitHeader();
|
6661
|
-
}
|
6662
|
-
|
6663
|
-
if (this.options.showFooter && !this.options.cardView) {
|
6664
|
-
this.fitFooter();
|
6665
|
-
}
|
6666
|
-
}
|
6667
7491
|
}, {
|
6668
7492
|
key: "showLoading",
|
6669
7493
|
value: function showLoading() {
|
6670
|
-
this.$tableLoading.
|
7494
|
+
this.$tableLoading.toggleClass('open', true);
|
7495
|
+
var fontSize = this.options.loadingFontSize;
|
7496
|
+
|
7497
|
+
if (this.options.loadingFontSize === 'auto') {
|
7498
|
+
fontSize = this.$tableLoading.width() * 0.04;
|
7499
|
+
fontSize = Math.max(12, fontSize);
|
7500
|
+
fontSize = Math.min(32, fontSize);
|
7501
|
+
fontSize = "".concat(fontSize, "px");
|
7502
|
+
}
|
7503
|
+
|
7504
|
+
this.$tableLoading.find('.loading-text').css('font-size', fontSize);
|
6671
7505
|
}
|
6672
7506
|
}, {
|
6673
7507
|
key: "hideLoading",
|
6674
7508
|
value: function hideLoading() {
|
6675
|
-
this.$tableLoading.
|
7509
|
+
this.$tableLoading.toggleClass('open', false);
|
6676
7510
|
}
|
6677
7511
|
}, {
|
6678
7512
|
key: "togglePagination",
|
@@ -6703,7 +7537,7 @@
|
|
6703
7537
|
}, {
|
6704
7538
|
key: "resetSearch",
|
6705
7539
|
value: function resetSearch(text) {
|
6706
|
-
var $search =
|
7540
|
+
var $search = Utils.getSearchInput(this);
|
6707
7541
|
$search.val(text || '');
|
6708
7542
|
this.onSearch({
|
6709
7543
|
currentTarget: $search
|
@@ -6721,10 +7555,6 @@
|
|
6721
7555
|
}, {
|
6722
7556
|
key: "scrollTo",
|
6723
7557
|
value: function scrollTo(params) {
|
6724
|
-
if (typeof params === 'undefined') {
|
6725
|
-
return this.$tableBody.scrollTop();
|
6726
|
-
}
|
6727
|
-
|
6728
7558
|
var options = {
|
6729
7559
|
unit: 'px',
|
6730
7560
|
value: 0
|
@@ -6734,7 +7564,7 @@
|
|
6734
7564
|
options = Object.assign(options, params);
|
6735
7565
|
} else if (typeof params === 'string' && params === 'bottom') {
|
6736
7566
|
options.value = this.$tableBody[0].scrollHeight;
|
6737
|
-
} else if (typeof params === 'string') {
|
7567
|
+
} else if (typeof params === 'string' || typeof params === 'number') {
|
6738
7568
|
options.value = params;
|
6739
7569
|
}
|
6740
7570
|
|
@@ -6752,7 +7582,7 @@
|
|
6752
7582
|
}, {
|
6753
7583
|
key: "getScrollPosition",
|
6754
7584
|
value: function getScrollPosition() {
|
6755
|
-
return this.
|
7585
|
+
return this.$tableBody.scrollTop();
|
6756
7586
|
}
|
6757
7587
|
}, {
|
6758
7588
|
key: "selectPage",
|
@@ -6816,6 +7646,17 @@
|
|
6816
7646
|
|
6817
7647
|
this.trigger('expand-row', index, row, $element);
|
6818
7648
|
}
|
7649
|
+
}, {
|
7650
|
+
key: "expandRowByUniqueId",
|
7651
|
+
value: function expandRowByUniqueId(uniqueId) {
|
7652
|
+
var row = this.getRowByUniqueId(uniqueId);
|
7653
|
+
|
7654
|
+
if (!row) {
|
7655
|
+
return;
|
7656
|
+
}
|
7657
|
+
|
7658
|
+
this.expandRow(this.data.indexOf(row));
|
7659
|
+
}
|
6819
7660
|
}, {
|
6820
7661
|
key: "collapseRow",
|
6821
7662
|
value: function collapseRow(index) {
|
@@ -6833,6 +7674,17 @@
|
|
6833
7674
|
this.trigger('collapse-row', index, row, $tr.next());
|
6834
7675
|
$tr.next().remove();
|
6835
7676
|
}
|
7677
|
+
}, {
|
7678
|
+
key: "collapseRowByUniqueId",
|
7679
|
+
value: function collapseRowByUniqueId(uniqueId) {
|
7680
|
+
var row = this.getRowByUniqueId(uniqueId);
|
7681
|
+
|
7682
|
+
if (!row) {
|
7683
|
+
return;
|
7684
|
+
}
|
7685
|
+
|
7686
|
+
this.collapseRow(this.data.indexOf(row));
|
7687
|
+
}
|
6836
7688
|
}, {
|
6837
7689
|
key: "expandAllRows",
|
6838
7690
|
value: function expandAllRows() {
|
@@ -6905,8 +7757,8 @@
|
|
6905
7757
|
$.BootstrapTable = BootstrapTable;
|
6906
7758
|
|
6907
7759
|
$.fn.bootstrapTable = function (option) {
|
6908
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0),
|
6909
|
-
args[
|
7760
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
|
7761
|
+
args[_key5 - 1] = arguments[_key5];
|
6910
7762
|
}
|
6911
7763
|
|
6912
7764
|
var value;
|
@@ -6933,7 +7785,9 @@
|
|
6933
7785
|
}
|
6934
7786
|
|
6935
7787
|
if (!data) {
|
6936
|
-
|
7788
|
+
data = new $.BootstrapTable(el, options);
|
7789
|
+
$(el).data('bootstrap.table', data);
|
7790
|
+
data.init();
|
6937
7791
|
}
|
6938
7792
|
});
|
6939
7793
|
return typeof value === 'undefined' ? this : value;
|
@@ -6956,4 +7810,4 @@
|
|
6956
7810
|
|
6957
7811
|
return BootstrapTable;
|
6958
7812
|
|
6959
|
-
}));
|
7813
|
+
})));
|