bootstrap-table-rails 1.16.0 → 1.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +142 -33
- data/lib/bootstrap-table-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +1017 -129
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +7 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +7 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +18 -8
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +1055 -457
- data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +58 -13
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +64 -14
- data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1040 -241
- data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +84 -17
- 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 +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +1054 -209
- data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +110 -31
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +928 -726
- data/vendor/assets/javascripts/bootstrap-table/extensions/{cell-input/bootstrap-table-cell-input.js → filter-control/utils.js} +1152 -1028
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +52 -1
- 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 +196 -523
- data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +3 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +6 -8
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +122 -470
- data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +27 -4
- data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +9 -10
- data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +267 -35
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +17 -6
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +6 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +21 -7
- data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +120 -28
- data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +14 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +17 -2
- 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 +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +18 -3
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +33 -18
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +31 -16
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +25 -10
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +32 -17
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +35 -19
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +19 -3
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +31 -16
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +17 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +16 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +781 -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 +17 -7
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +55 -3
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +22 -7
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +63 -5
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +22 -7
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +63 -5
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +17 -7
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +54 -2
- metadata +10 -4
- data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +0 -2647
- data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.css +0 -12
@@ -1,10 +1,10 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
|
3
|
-
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4
|
-
(global = global || self, factory(global.jQuery));
|
5
|
-
}(this, (function ($) { 'use strict';
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
|
4
|
+
(global = global || self, factory(global.BootstrapTable = {}, global.jQuery));
|
5
|
+
}(this, (function (exports, $) { '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
|
|
@@ -526,18 +526,6 @@
|
|
526
526
|
}
|
527
527
|
};
|
528
528
|
|
529
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
530
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
531
|
-
// eslint-disable-next-line no-undef
|
532
|
-
return !String(Symbol());
|
533
|
-
});
|
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
|
-
|
541
529
|
// `IsArray` abstract operation
|
542
530
|
// https://tc39.github.io/ecma262/#sec-isarray
|
543
531
|
var isArray = Array.isArray || function isArray(arg) {
|
@@ -550,122 +538,23 @@
|
|
550
538
|
return Object(requireObjectCoercible(argument));
|
551
539
|
};
|
552
540
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
};
|
558
|
-
|
559
|
-
// `Object.defineProperties` method
|
560
|
-
// https://tc39.github.io/ecma262/#sec-object.defineproperties
|
561
|
-
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
562
|
-
anObject(O);
|
563
|
-
var keys = objectKeys(Properties);
|
564
|
-
var length = keys.length;
|
565
|
-
var index = 0;
|
566
|
-
var key;
|
567
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
568
|
-
return O;
|
569
|
-
};
|
570
|
-
|
571
|
-
var html = getBuiltIn('document', 'documentElement');
|
572
|
-
|
573
|
-
var GT = '>';
|
574
|
-
var LT = '<';
|
575
|
-
var PROTOTYPE = 'prototype';
|
576
|
-
var SCRIPT = 'script';
|
577
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
578
|
-
|
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
|
-
};
|
593
|
-
|
594
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
595
|
-
var NullProtoObjectViaIFrame = function () {
|
596
|
-
// Thrash, waste and sodomy: IE GC bug
|
597
|
-
var iframe = documentCreateElement('iframe');
|
598
|
-
var JS = 'java' + SCRIPT + ':';
|
599
|
-
var iframeDocument;
|
600
|
-
iframe.style.display = 'none';
|
601
|
-
html.appendChild(iframe);
|
602
|
-
// https://github.com/zloirock/core-js/issues/475
|
603
|
-
iframe.src = String(JS);
|
604
|
-
iframeDocument = iframe.contentWindow.document;
|
605
|
-
iframeDocument.open();
|
606
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
607
|
-
iframeDocument.close();
|
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();
|
626
|
-
};
|
627
|
-
|
628
|
-
hiddenKeys[IE_PROTO] = true;
|
629
|
-
|
630
|
-
// `Object.create` method
|
631
|
-
// https://tc39.github.io/ecma262/#sec-object.create
|
632
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
633
|
-
var result;
|
634
|
-
if (O !== null) {
|
635
|
-
EmptyConstructor[PROTOTYPE] = anObject(O);
|
636
|
-
result = new EmptyConstructor();
|
637
|
-
EmptyConstructor[PROTOTYPE] = null;
|
638
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
639
|
-
result[IE_PROTO] = O;
|
640
|
-
} else result = NullProtoObject();
|
641
|
-
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
642
|
-
};
|
643
|
-
|
644
|
-
var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
|
645
|
-
|
646
|
-
var toString$1 = {}.toString;
|
647
|
-
|
648
|
-
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
649
|
-
? Object.getOwnPropertyNames(window) : [];
|
650
|
-
|
651
|
-
var getWindowNames = function (it) {
|
652
|
-
try {
|
653
|
-
return nativeGetOwnPropertyNames(it);
|
654
|
-
} catch (error) {
|
655
|
-
return windowNames.slice();
|
656
|
-
}
|
541
|
+
var createProperty = function (object, key, value) {
|
542
|
+
var propertyKey = toPrimitive(key);
|
543
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
544
|
+
else object[propertyKey] = value;
|
657
545
|
};
|
658
546
|
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
};
|
547
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
548
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
549
|
+
// eslint-disable-next-line no-undef
|
550
|
+
return !String(Symbol());
|
551
|
+
});
|
665
552
|
|
666
|
-
var
|
667
|
-
|
668
|
-
|
553
|
+
var useSymbolAsUid = nativeSymbol
|
554
|
+
// eslint-disable-next-line no-undef
|
555
|
+
&& !Symbol.sham
|
556
|
+
// eslint-disable-next-line no-undef
|
557
|
+
&& typeof Symbol() == 'symbol';
|
669
558
|
|
670
559
|
var WellKnownSymbolsStore = shared('wks');
|
671
560
|
var Symbol$1 = global_1.Symbol;
|
@@ -678,32 +567,106 @@
|
|
678
567
|
} return WellKnownSymbolsStore[name];
|
679
568
|
};
|
680
569
|
|
681
|
-
var
|
570
|
+
var SPECIES = wellKnownSymbol('species');
|
682
571
|
|
683
|
-
|
684
|
-
|
572
|
+
// `ArraySpeciesCreate` abstract operation
|
573
|
+
// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
574
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
575
|
+
var C;
|
576
|
+
if (isArray(originalArray)) {
|
577
|
+
C = originalArray.constructor;
|
578
|
+
// cross-realm fallback
|
579
|
+
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
580
|
+
else if (isObject(C)) {
|
581
|
+
C = C[SPECIES];
|
582
|
+
if (C === null) C = undefined;
|
583
|
+
}
|
584
|
+
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
685
585
|
};
|
686
586
|
|
687
|
-
var
|
587
|
+
var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
588
|
+
|
589
|
+
var process = global_1.process;
|
590
|
+
var versions = process && process.versions;
|
591
|
+
var v8 = versions && versions.v8;
|
592
|
+
var match, version;
|
593
|
+
|
594
|
+
if (v8) {
|
595
|
+
match = v8.split('.');
|
596
|
+
version = match[0] + match[1];
|
597
|
+
} else if (userAgent) {
|
598
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
599
|
+
if (!match || match[1] >= 74) {
|
600
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
601
|
+
if (match) version = match[1];
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
var v8Version = version && +version;
|
688
606
|
|
689
|
-
var
|
690
|
-
|
691
|
-
|
692
|
-
|
607
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
608
|
+
|
609
|
+
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
610
|
+
// We can't use this feature detection in V8 since it causes
|
611
|
+
// deoptimization and serious performance degradation
|
612
|
+
// https://github.com/zloirock/core-js/issues/677
|
613
|
+
return v8Version >= 51 || !fails(function () {
|
614
|
+
var array = [];
|
615
|
+
var constructor = array.constructor = {};
|
616
|
+
constructor[SPECIES$1] = function () {
|
617
|
+
return { foo: 1 };
|
618
|
+
};
|
619
|
+
return array[METHOD_NAME](Boolean).foo !== 1;
|
693
620
|
});
|
694
621
|
};
|
695
622
|
|
696
|
-
var
|
623
|
+
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
624
|
+
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
625
|
+
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
626
|
+
|
627
|
+
// We can't use this feature detection in V8 since it causes
|
628
|
+
// deoptimization and serious performance degradation
|
629
|
+
// https://github.com/zloirock/core-js/issues/679
|
630
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
631
|
+
var array = [];
|
632
|
+
array[IS_CONCAT_SPREADABLE] = false;
|
633
|
+
return array.concat()[0] !== array;
|
634
|
+
});
|
697
635
|
|
636
|
+
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
698
637
|
|
638
|
+
var isConcatSpreadable = function (O) {
|
639
|
+
if (!isObject(O)) return false;
|
640
|
+
var spreadable = O[IS_CONCAT_SPREADABLE];
|
641
|
+
return spreadable !== undefined ? !!spreadable : isArray(O);
|
642
|
+
};
|
699
643
|
|
700
|
-
var
|
644
|
+
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
701
645
|
|
702
|
-
|
703
|
-
|
704
|
-
|
646
|
+
// `Array.prototype.concat` method
|
647
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.concat
|
648
|
+
// with adding support of @@isConcatSpreadable and @@species
|
649
|
+
_export({ target: 'Array', proto: true, forced: FORCED }, {
|
650
|
+
concat: function concat(arg) { // eslint-disable-line no-unused-vars
|
651
|
+
var O = toObject(this);
|
652
|
+
var A = arraySpeciesCreate(O, 0);
|
653
|
+
var n = 0;
|
654
|
+
var i, k, length, len, E;
|
655
|
+
for (i = -1, length = arguments.length; i < length; i++) {
|
656
|
+
E = i === -1 ? O : arguments[i];
|
657
|
+
if (isConcatSpreadable(E)) {
|
658
|
+
len = toLength(E.length);
|
659
|
+
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
660
|
+
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
661
|
+
} else {
|
662
|
+
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
663
|
+
createProperty(A, n++, E);
|
664
|
+
}
|
665
|
+
}
|
666
|
+
A.length = n;
|
667
|
+
return A;
|
705
668
|
}
|
706
|
-
};
|
669
|
+
});
|
707
670
|
|
708
671
|
var aFunction$1 = function (it) {
|
709
672
|
if (typeof it != 'function') {
|
@@ -734,23 +697,6 @@
|
|
734
697
|
};
|
735
698
|
};
|
736
699
|
|
737
|
-
var SPECIES = wellKnownSymbol('species');
|
738
|
-
|
739
|
-
// `ArraySpeciesCreate` abstract operation
|
740
|
-
// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
741
|
-
var arraySpeciesCreate = function (originalArray, length) {
|
742
|
-
var C;
|
743
|
-
if (isArray(originalArray)) {
|
744
|
-
C = originalArray.constructor;
|
745
|
-
// cross-realm fallback
|
746
|
-
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
747
|
-
else if (isObject(C)) {
|
748
|
-
C = C[SPECIES];
|
749
|
-
if (C === null) C = undefined;
|
750
|
-
}
|
751
|
-
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
752
|
-
};
|
753
|
-
|
754
700
|
var push = [].push;
|
755
701
|
|
756
702
|
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
|
@@ -811,416 +757,115 @@
|
|
811
757
|
findIndex: createMethod$1(6)
|
812
758
|
};
|
813
759
|
|
814
|
-
var $
|
760
|
+
var $filter = arrayIteration.filter;
|
815
761
|
|
816
|
-
var HIDDEN = sharedKey('hidden');
|
817
|
-
var SYMBOL = 'Symbol';
|
818
|
-
var PROTOTYPE$1 = 'prototype';
|
819
|
-
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
820
|
-
var setInternalState = internalState.set;
|
821
|
-
var getInternalState = internalState.getterFor(SYMBOL);
|
822
|
-
var ObjectPrototype = Object[PROTOTYPE$1];
|
823
|
-
var $Symbol = global_1.Symbol;
|
824
|
-
var $stringify = getBuiltIn('JSON', 'stringify');
|
825
|
-
var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
826
|
-
var nativeDefineProperty$1 = objectDefineProperty.f;
|
827
|
-
var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
|
828
|
-
var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
|
829
|
-
var AllSymbols = shared('symbols');
|
830
|
-
var ObjectPrototypeSymbols = shared('op-symbols');
|
831
|
-
var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
832
|
-
var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
833
|
-
var WellKnownSymbolsStore$1 = shared('wks');
|
834
|
-
var QObject = global_1.QObject;
|
835
|
-
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
836
|
-
var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
|
837
|
-
|
838
|
-
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
839
|
-
var setSymbolDescriptor = descriptors && fails(function () {
|
840
|
-
return objectCreate(nativeDefineProperty$1({}, 'a', {
|
841
|
-
get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
|
842
|
-
})).a != 7;
|
843
|
-
}) ? function (O, P, Attributes) {
|
844
|
-
var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
|
845
|
-
if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
846
|
-
nativeDefineProperty$1(O, P, Attributes);
|
847
|
-
if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
848
|
-
nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
849
|
-
}
|
850
|
-
} : nativeDefineProperty$1;
|
851
|
-
|
852
|
-
var wrap = function (tag, description) {
|
853
|
-
var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
|
854
|
-
setInternalState(symbol, {
|
855
|
-
type: SYMBOL,
|
856
|
-
tag: tag,
|
857
|
-
description: description
|
858
|
-
});
|
859
|
-
if (!descriptors) symbol.description = description;
|
860
|
-
return symbol;
|
861
|
-
};
|
862
762
|
|
863
|
-
var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
864
|
-
return typeof it == 'symbol';
|
865
|
-
} : function (it) {
|
866
|
-
return Object(it) instanceof $Symbol;
|
867
|
-
};
|
868
|
-
|
869
|
-
var $defineProperty = function defineProperty(O, P, Attributes) {
|
870
|
-
if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
871
|
-
anObject(O);
|
872
|
-
var key = toPrimitive(P, true);
|
873
|
-
anObject(Attributes);
|
874
|
-
if (has(AllSymbols, key)) {
|
875
|
-
if (!Attributes.enumerable) {
|
876
|
-
if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
|
877
|
-
O[HIDDEN][key] = true;
|
878
|
-
} else {
|
879
|
-
if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
880
|
-
Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
881
|
-
} return setSymbolDescriptor(O, key, Attributes);
|
882
|
-
} return nativeDefineProperty$1(O, key, Attributes);
|
883
|
-
};
|
884
|
-
|
885
|
-
var $defineProperties = function defineProperties(O, Properties) {
|
886
|
-
anObject(O);
|
887
|
-
var properties = toIndexedObject(Properties);
|
888
|
-
var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
889
|
-
$forEach(keys, function (key) {
|
890
|
-
if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
|
891
|
-
});
|
892
|
-
return O;
|
893
|
-
};
|
894
763
|
|
895
|
-
var
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
900
|
-
var P = toPrimitive(V, true);
|
901
|
-
var enumerable = nativePropertyIsEnumerable$1.call(this, P);
|
902
|
-
if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
|
903
|
-
return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
|
904
|
-
};
|
905
|
-
|
906
|
-
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
907
|
-
var it = toIndexedObject(O);
|
908
|
-
var key = toPrimitive(P, true);
|
909
|
-
if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
|
910
|
-
var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
|
911
|
-
if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
|
912
|
-
descriptor.enumerable = true;
|
913
|
-
}
|
914
|
-
return descriptor;
|
915
|
-
};
|
916
|
-
|
917
|
-
var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
918
|
-
var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
|
919
|
-
var result = [];
|
920
|
-
$forEach(names, function (key) {
|
921
|
-
if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
|
922
|
-
});
|
923
|
-
return result;
|
924
|
-
};
|
925
|
-
|
926
|
-
var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
927
|
-
var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
928
|
-
var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
929
|
-
var result = [];
|
930
|
-
$forEach(names, function (key) {
|
931
|
-
if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
|
932
|
-
result.push(AllSymbols[key]);
|
933
|
-
}
|
934
|
-
});
|
935
|
-
return result;
|
936
|
-
};
|
937
|
-
|
938
|
-
// `Symbol` constructor
|
939
|
-
// https://tc39.github.io/ecma262/#sec-symbol-constructor
|
940
|
-
if (!nativeSymbol) {
|
941
|
-
$Symbol = function Symbol() {
|
942
|
-
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
943
|
-
var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
944
|
-
var tag = uid(description);
|
945
|
-
var setter = function (value) {
|
946
|
-
if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
|
947
|
-
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
948
|
-
setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
949
|
-
};
|
950
|
-
if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
951
|
-
return wrap(tag, description);
|
952
|
-
};
|
953
|
-
|
954
|
-
redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
|
955
|
-
return getInternalState(this).tag;
|
956
|
-
});
|
957
|
-
|
958
|
-
objectPropertyIsEnumerable.f = $propertyIsEnumerable;
|
959
|
-
objectDefineProperty.f = $defineProperty;
|
960
|
-
objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
|
961
|
-
objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
962
|
-
objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
|
963
|
-
|
964
|
-
if (descriptors) {
|
965
|
-
// https://github.com/tc39/proposal-Symbol-description
|
966
|
-
nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
|
967
|
-
configurable: true,
|
968
|
-
get: function description() {
|
969
|
-
return getInternalState(this).description;
|
970
|
-
}
|
971
|
-
});
|
972
|
-
{
|
973
|
-
redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
974
|
-
}
|
975
|
-
}
|
976
|
-
}
|
977
|
-
|
978
|
-
if (!useSymbolAsUid) {
|
979
|
-
wrappedWellKnownSymbol.f = function (name) {
|
980
|
-
return wrap(wellKnownSymbol(name), name);
|
981
|
-
};
|
982
|
-
}
|
983
|
-
|
984
|
-
_export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
|
985
|
-
Symbol: $Symbol
|
764
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
765
|
+
// Edge 14- issue
|
766
|
+
var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
|
767
|
+
[].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
986
768
|
});
|
987
769
|
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
// https://tc39.github.io/ecma262/#sec-symbol.for
|
995
|
-
'for': function (key) {
|
996
|
-
var string = String(key);
|
997
|
-
if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
998
|
-
var symbol = $Symbol(string);
|
999
|
-
StringToSymbolRegistry[string] = symbol;
|
1000
|
-
SymbolToStringRegistry[symbol] = string;
|
1001
|
-
return symbol;
|
1002
|
-
},
|
1003
|
-
// `Symbol.keyFor` method
|
1004
|
-
// https://tc39.github.io/ecma262/#sec-symbol.keyfor
|
1005
|
-
keyFor: function keyFor(sym) {
|
1006
|
-
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
1007
|
-
if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
1008
|
-
},
|
1009
|
-
useSetter: function () { USE_SETTER = true; },
|
1010
|
-
useSimple: function () { USE_SETTER = false; }
|
1011
|
-
});
|
1012
|
-
|
1013
|
-
_export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
|
1014
|
-
// `Object.create` method
|
1015
|
-
// https://tc39.github.io/ecma262/#sec-object.create
|
1016
|
-
create: $create,
|
1017
|
-
// `Object.defineProperty` method
|
1018
|
-
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
1019
|
-
defineProperty: $defineProperty,
|
1020
|
-
// `Object.defineProperties` method
|
1021
|
-
// https://tc39.github.io/ecma262/#sec-object.defineproperties
|
1022
|
-
defineProperties: $defineProperties,
|
1023
|
-
// `Object.getOwnPropertyDescriptor` method
|
1024
|
-
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
|
1025
|
-
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
1026
|
-
});
|
1027
|
-
|
1028
|
-
_export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
|
1029
|
-
// `Object.getOwnPropertyNames` method
|
1030
|
-
// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
|
1031
|
-
getOwnPropertyNames: $getOwnPropertyNames,
|
1032
|
-
// `Object.getOwnPropertySymbols` method
|
1033
|
-
// https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
|
1034
|
-
getOwnPropertySymbols: $getOwnPropertySymbols
|
1035
|
-
});
|
1036
|
-
|
1037
|
-
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
|
1038
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
|
1039
|
-
_export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, {
|
1040
|
-
getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
1041
|
-
return objectGetOwnPropertySymbols.f(toObject(it));
|
770
|
+
// `Array.prototype.filter` method
|
771
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
|
772
|
+
// with adding support of @@species
|
773
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
774
|
+
filter: function filter(callbackfn /* , thisArg */) {
|
775
|
+
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1042
776
|
}
|
1043
777
|
});
|
1044
778
|
|
1045
|
-
// `
|
1046
|
-
// https://tc39.github.io/ecma262/#sec-
|
1047
|
-
|
1048
|
-
|
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
|
-
}
|
1076
|
-
|
1077
|
-
// `Symbol.prototype[@@toPrimitive]` method
|
1078
|
-
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
|
1079
|
-
if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
|
1080
|
-
createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
|
1081
|
-
}
|
1082
|
-
// `Symbol.prototype[@@toStringTag]` property
|
1083
|
-
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
|
1084
|
-
setToStringTag($Symbol, SYMBOL);
|
1085
|
-
|
1086
|
-
hiddenKeys[HIDDEN] = true;
|
1087
|
-
|
1088
|
-
var defineProperty$2 = objectDefineProperty.f;
|
1089
|
-
|
1090
|
-
|
1091
|
-
var NativeSymbol = global_1.Symbol;
|
1092
|
-
|
1093
|
-
if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
|
1094
|
-
// Safari 12 bug
|
1095
|
-
NativeSymbol().description !== undefined
|
1096
|
-
)) {
|
1097
|
-
var EmptyStringDescriptionStore = {};
|
1098
|
-
// wrap Symbol constructor for correct work with undefined description
|
1099
|
-
var SymbolWrapper = function Symbol() {
|
1100
|
-
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
|
1101
|
-
var result = this instanceof SymbolWrapper
|
1102
|
-
? new NativeSymbol(description)
|
1103
|
-
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
1104
|
-
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
1105
|
-
if (description === '') EmptyStringDescriptionStore[result] = true;
|
1106
|
-
return result;
|
1107
|
-
};
|
1108
|
-
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
1109
|
-
var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
|
1110
|
-
symbolPrototype.constructor = SymbolWrapper;
|
1111
|
-
|
1112
|
-
var symbolToString = symbolPrototype.toString;
|
1113
|
-
var native = String(NativeSymbol('test')) == 'Symbol(test)';
|
1114
|
-
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
1115
|
-
defineProperty$2(symbolPrototype, 'description', {
|
1116
|
-
configurable: true,
|
1117
|
-
get: function description() {
|
1118
|
-
var symbol = isObject(this) ? this.valueOf() : this;
|
1119
|
-
var string = symbolToString.call(symbol);
|
1120
|
-
if (has(EmptyStringDescriptionStore, symbol)) return '';
|
1121
|
-
var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
|
1122
|
-
return desc === '' ? undefined : desc;
|
1123
|
-
}
|
1124
|
-
});
|
1125
|
-
|
1126
|
-
_export({ global: true, forced: true }, {
|
1127
|
-
Symbol: SymbolWrapper
|
1128
|
-
});
|
1129
|
-
}
|
1130
|
-
|
1131
|
-
// `Symbol.iterator` well-known symbol
|
1132
|
-
// https://tc39.github.io/ecma262/#sec-symbol.iterator
|
1133
|
-
defineWellKnownSymbol('iterator');
|
1134
|
-
|
1135
|
-
var createProperty = function (object, key, value) {
|
1136
|
-
var propertyKey = toPrimitive(key);
|
1137
|
-
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
1138
|
-
else object[propertyKey] = value;
|
779
|
+
// `Object.keys` method
|
780
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
781
|
+
var objectKeys = Object.keys || function keys(O) {
|
782
|
+
return objectKeysInternal(O, enumBugKeys);
|
1139
783
|
};
|
1140
784
|
|
1141
|
-
|
1142
|
-
|
1143
|
-
var
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
785
|
+
// `Object.defineProperties` method
|
786
|
+
// https://tc39.github.io/ecma262/#sec-object.defineproperties
|
787
|
+
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
788
|
+
anObject(O);
|
789
|
+
var keys = objectKeys(Properties);
|
790
|
+
var length = keys.length;
|
791
|
+
var index = 0;
|
792
|
+
var key;
|
793
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
794
|
+
return O;
|
795
|
+
};
|
1147
796
|
|
1148
|
-
|
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
|
-
}
|
797
|
+
var html = getBuiltIn('document', 'documentElement');
|
1158
798
|
|
1159
|
-
var
|
799
|
+
var GT = '>';
|
800
|
+
var LT = '<';
|
801
|
+
var PROTOTYPE = 'prototype';
|
802
|
+
var SCRIPT = 'script';
|
803
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
1160
804
|
|
1161
|
-
var
|
805
|
+
var EmptyConstructor = function () { /* empty */ };
|
1162
806
|
|
1163
|
-
var
|
1164
|
-
|
1165
|
-
// deoptimization and serious performance degradation
|
1166
|
-
// https://github.com/zloirock/core-js/issues/677
|
1167
|
-
return v8Version >= 51 || !fails(function () {
|
1168
|
-
var array = [];
|
1169
|
-
var constructor = array.constructor = {};
|
1170
|
-
constructor[SPECIES$1] = function () {
|
1171
|
-
return { foo: 1 };
|
1172
|
-
};
|
1173
|
-
return array[METHOD_NAME](Boolean).foo !== 1;
|
1174
|
-
});
|
807
|
+
var scriptTag = function (content) {
|
808
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1175
809
|
};
|
1176
810
|
|
1177
|
-
|
1178
|
-
var
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
var array = [];
|
1186
|
-
array[IS_CONCAT_SPREADABLE] = false;
|
1187
|
-
return array.concat()[0] !== array;
|
1188
|
-
});
|
811
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
812
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
813
|
+
activeXDocument.write(scriptTag(''));
|
814
|
+
activeXDocument.close();
|
815
|
+
var temp = activeXDocument.parentWindow.Object;
|
816
|
+
activeXDocument = null; // avoid memory leak
|
817
|
+
return temp;
|
818
|
+
};
|
1189
819
|
|
1190
|
-
|
820
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
821
|
+
var NullProtoObjectViaIFrame = function () {
|
822
|
+
// Thrash, waste and sodomy: IE GC bug
|
823
|
+
var iframe = documentCreateElement('iframe');
|
824
|
+
var JS = 'java' + SCRIPT + ':';
|
825
|
+
var iframeDocument;
|
826
|
+
iframe.style.display = 'none';
|
827
|
+
html.appendChild(iframe);
|
828
|
+
// https://github.com/zloirock/core-js/issues/475
|
829
|
+
iframe.src = String(JS);
|
830
|
+
iframeDocument = iframe.contentWindow.document;
|
831
|
+
iframeDocument.open();
|
832
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
833
|
+
iframeDocument.close();
|
834
|
+
return iframeDocument.F;
|
835
|
+
};
|
1191
836
|
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
837
|
+
// Check for document.domain and active x support
|
838
|
+
// No need to use active x approach when document.domain is not set
|
839
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
840
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
841
|
+
// avoid IE GC bug
|
842
|
+
var activeXDocument;
|
843
|
+
var NullProtoObject = function () {
|
844
|
+
try {
|
845
|
+
/* global ActiveXObject */
|
846
|
+
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
847
|
+
} catch (error) { /* ignore */ }
|
848
|
+
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
849
|
+
var length = enumBugKeys.length;
|
850
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
851
|
+
return NullProtoObject();
|
1196
852
|
};
|
1197
853
|
|
1198
|
-
|
854
|
+
hiddenKeys[IE_PROTO] = true;
|
1199
855
|
|
1200
|
-
// `
|
1201
|
-
// https://tc39.github.io/ecma262/#sec-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1214
|
-
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
1215
|
-
} else {
|
1216
|
-
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
1217
|
-
createProperty(A, n++, E);
|
1218
|
-
}
|
1219
|
-
}
|
1220
|
-
A.length = n;
|
1221
|
-
return A;
|
1222
|
-
}
|
1223
|
-
});
|
856
|
+
// `Object.create` method
|
857
|
+
// https://tc39.github.io/ecma262/#sec-object.create
|
858
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
859
|
+
var result;
|
860
|
+
if (O !== null) {
|
861
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
862
|
+
result = new EmptyConstructor();
|
863
|
+
EmptyConstructor[PROTOTYPE] = null;
|
864
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
865
|
+
result[IE_PROTO] = O;
|
866
|
+
} else result = NullProtoObject();
|
867
|
+
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
868
|
+
};
|
1224
869
|
|
1225
870
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
1226
871
|
var ArrayPrototype = Array.prototype;
|
@@ -1259,210 +904,19 @@
|
|
1259
904
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
1260
905
|
addToUnscopables(FIND);
|
1261
906
|
|
1262
|
-
var
|
1263
|
-
function F() { /* empty */ }
|
1264
|
-
F.prototype.constructor = null;
|
1265
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
1266
|
-
});
|
1267
|
-
|
1268
|
-
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
1269
|
-
var ObjectPrototype$1 = Object.prototype;
|
1270
|
-
|
1271
|
-
// `Object.getPrototypeOf` method
|
1272
|
-
// https://tc39.github.io/ecma262/#sec-object.getprototypeof
|
1273
|
-
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
1274
|
-
O = toObject(O);
|
1275
|
-
if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
|
1276
|
-
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
1277
|
-
return O.constructor.prototype;
|
1278
|
-
} return O instanceof Object ? ObjectPrototype$1 : null;
|
1279
|
-
};
|
1280
|
-
|
1281
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
1282
|
-
var BUGGY_SAFARI_ITERATORS = false;
|
1283
|
-
|
1284
|
-
var returnThis = function () { return this; };
|
1285
|
-
|
1286
|
-
// `%IteratorPrototype%` object
|
1287
|
-
// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
|
1288
|
-
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
1289
|
-
|
1290
|
-
if ([].keys) {
|
1291
|
-
arrayIterator = [].keys();
|
1292
|
-
// Safari 8 has buggy iterators w/o `next`
|
1293
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
1294
|
-
else {
|
1295
|
-
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
1296
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
1297
|
-
}
|
1298
|
-
}
|
1299
|
-
|
1300
|
-
if (IteratorPrototype == undefined) IteratorPrototype = {};
|
907
|
+
var $includes = arrayIncludes.includes;
|
1301
908
|
|
1302
|
-
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
1303
|
-
if ( !has(IteratorPrototype, ITERATOR)) {
|
1304
|
-
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
var iteratorsCore = {
|
1308
|
-
IteratorPrototype: IteratorPrototype,
|
1309
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
1310
|
-
};
|
1311
|
-
|
1312
|
-
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
1313
|
-
|
1314
|
-
var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
1315
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
1316
|
-
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
|
1317
|
-
setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
1318
|
-
return IteratorConstructor;
|
1319
|
-
};
|
1320
|
-
|
1321
|
-
var aPossiblePrototype = function (it) {
|
1322
|
-
if (!isObject(it) && it !== null) {
|
1323
|
-
throw TypeError("Can't set " + String(it) + ' as a prototype');
|
1324
|
-
} return it;
|
1325
|
-
};
|
1326
|
-
|
1327
|
-
// `Object.setPrototypeOf` method
|
1328
|
-
// https://tc39.github.io/ecma262/#sec-object.setprototypeof
|
1329
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
1330
|
-
/* eslint-disable no-proto */
|
1331
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
1332
|
-
var CORRECT_SETTER = false;
|
1333
|
-
var test = {};
|
1334
|
-
var setter;
|
1335
|
-
try {
|
1336
|
-
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
1337
|
-
setter.call(test, []);
|
1338
|
-
CORRECT_SETTER = test instanceof Array;
|
1339
|
-
} catch (error) { /* empty */ }
|
1340
|
-
return function setPrototypeOf(O, proto) {
|
1341
|
-
anObject(O);
|
1342
|
-
aPossiblePrototype(proto);
|
1343
|
-
if (CORRECT_SETTER) setter.call(O, proto);
|
1344
|
-
else O.__proto__ = proto;
|
1345
|
-
return O;
|
1346
|
-
};
|
1347
|
-
}() : undefined);
|
1348
|
-
|
1349
|
-
var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
|
1350
|
-
var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
1351
|
-
var ITERATOR$1 = wellKnownSymbol('iterator');
|
1352
|
-
var KEYS = 'keys';
|
1353
|
-
var VALUES = 'values';
|
1354
|
-
var ENTRIES = 'entries';
|
1355
|
-
|
1356
|
-
var returnThis$1 = function () { return this; };
|
1357
|
-
|
1358
|
-
var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
1359
|
-
createIteratorConstructor(IteratorConstructor, NAME, next);
|
1360
|
-
|
1361
|
-
var getIterationMethod = function (KIND) {
|
1362
|
-
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
1363
|
-
if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
1364
|
-
switch (KIND) {
|
1365
|
-
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
1366
|
-
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
1367
|
-
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
1368
|
-
} return function () { return new IteratorConstructor(this); };
|
1369
|
-
};
|
1370
|
-
|
1371
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
1372
|
-
var INCORRECT_VALUES_NAME = false;
|
1373
|
-
var IterablePrototype = Iterable.prototype;
|
1374
|
-
var nativeIterator = IterablePrototype[ITERATOR$1]
|
1375
|
-
|| IterablePrototype['@@iterator']
|
1376
|
-
|| DEFAULT && IterablePrototype[DEFAULT];
|
1377
|
-
var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
|
1378
|
-
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
1379
|
-
var CurrentIteratorPrototype, methods, KEY;
|
1380
|
-
|
1381
|
-
// fix native
|
1382
|
-
if (anyNativeIterator) {
|
1383
|
-
CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
1384
|
-
if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
|
1385
|
-
if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
|
1386
|
-
if (objectSetPrototypeOf) {
|
1387
|
-
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
1388
|
-
} else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
|
1389
|
-
createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
|
1390
|
-
}
|
1391
|
-
}
|
1392
|
-
// Set @@toStringTag to native iterators
|
1393
|
-
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
1394
|
-
}
|
1395
|
-
}
|
1396
|
-
|
1397
|
-
// fix Array#{values, @@iterator}.name in V8 / FF
|
1398
|
-
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
1399
|
-
INCORRECT_VALUES_NAME = true;
|
1400
|
-
defaultIterator = function values() { return nativeIterator.call(this); };
|
1401
|
-
}
|
1402
|
-
|
1403
|
-
// define iterator
|
1404
|
-
if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
1405
|
-
createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
|
1406
|
-
}
|
1407
|
-
|
1408
|
-
// export additional methods
|
1409
|
-
if (DEFAULT) {
|
1410
|
-
methods = {
|
1411
|
-
values: getIterationMethod(VALUES),
|
1412
|
-
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
1413
|
-
entries: getIterationMethod(ENTRIES)
|
1414
|
-
};
|
1415
|
-
if (FORCED) for (KEY in methods) {
|
1416
|
-
if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
1417
|
-
redefine(IterablePrototype, KEY, methods[KEY]);
|
1418
|
-
}
|
1419
|
-
} else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
|
1420
|
-
}
|
1421
909
|
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
|
1428
|
-
|
1429
|
-
// `Array.prototype.entries` method
|
1430
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.entries
|
1431
|
-
// `Array.prototype.keys` method
|
1432
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.keys
|
1433
|
-
// `Array.prototype.values` method
|
1434
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.values
|
1435
|
-
// `Array.prototype[@@iterator]` method
|
1436
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
|
1437
|
-
// `CreateArrayIterator` internal method
|
1438
|
-
// https://tc39.github.io/ecma262/#sec-createarrayiterator
|
1439
|
-
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
1440
|
-
setInternalState$1(this, {
|
1441
|
-
type: ARRAY_ITERATOR,
|
1442
|
-
target: toIndexedObject(iterated), // target
|
1443
|
-
index: 0, // next index
|
1444
|
-
kind: kind // kind
|
1445
|
-
});
|
1446
|
-
// `%ArrayIteratorPrototype%.next` method
|
1447
|
-
// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
|
1448
|
-
}, function () {
|
1449
|
-
var state = getInternalState$1(this);
|
1450
|
-
var target = state.target;
|
1451
|
-
var kind = state.kind;
|
1452
|
-
var index = state.index++;
|
1453
|
-
if (!target || index >= target.length) {
|
1454
|
-
state.target = undefined;
|
1455
|
-
return { value: undefined, done: true };
|
910
|
+
// `Array.prototype.includes` method
|
911
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
|
912
|
+
_export({ target: 'Array', proto: true }, {
|
913
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
914
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
1456
915
|
}
|
1457
|
-
|
1458
|
-
if (kind == 'values') return { value: target[index], done: false };
|
1459
|
-
return { value: [index, target[index]], done: false };
|
1460
|
-
}, 'values');
|
916
|
+
});
|
1461
917
|
|
1462
918
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
1463
|
-
addToUnscopables('
|
1464
|
-
addToUnscopables('values');
|
1465
|
-
addToUnscopables('entries');
|
919
|
+
addToUnscopables('includes');
|
1466
920
|
|
1467
921
|
var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
1468
922
|
var method = [][METHOD_NAME];
|
@@ -1472,62 +926,82 @@
|
|
1472
926
|
});
|
1473
927
|
};
|
1474
928
|
|
929
|
+
var $indexOf = arrayIncludes.indexOf;
|
930
|
+
|
931
|
+
|
932
|
+
var nativeIndexOf = [].indexOf;
|
933
|
+
|
934
|
+
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
|
935
|
+
var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
|
936
|
+
|
937
|
+
// `Array.prototype.indexOf` method
|
938
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
|
939
|
+
_export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
|
940
|
+
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
941
|
+
return NEGATIVE_ZERO
|
942
|
+
// convert -0 to +0
|
943
|
+
? nativeIndexOf.apply(this, arguments) || 0
|
944
|
+
: $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
945
|
+
}
|
946
|
+
});
|
947
|
+
|
1475
948
|
var nativeJoin = [].join;
|
1476
949
|
|
1477
950
|
var ES3_STRINGS = indexedObject != Object;
|
1478
|
-
var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
|
951
|
+
var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
|
1479
952
|
|
1480
953
|
// `Array.prototype.join` method
|
1481
954
|
// https://tc39.github.io/ecma262/#sec-array.prototype.join
|
1482
|
-
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
|
955
|
+
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
|
1483
956
|
join: function join(separator) {
|
1484
957
|
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
1485
958
|
}
|
1486
959
|
});
|
1487
960
|
|
1488
|
-
var
|
1489
|
-
var
|
1490
|
-
var max$1 = Math.max;
|
961
|
+
var test = [];
|
962
|
+
var nativeSort = test.sort;
|
1491
963
|
|
1492
|
-
//
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
if (Constructor === Array || Constructor === undefined) {
|
1513
|
-
return nativeSlice.call(O, k, fin);
|
1514
|
-
}
|
1515
|
-
}
|
1516
|
-
result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
|
1517
|
-
for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
1518
|
-
result.length = n;
|
1519
|
-
return result;
|
964
|
+
// IE8-
|
965
|
+
var FAILS_ON_UNDEFINED = fails(function () {
|
966
|
+
test.sort(undefined);
|
967
|
+
});
|
968
|
+
// V8 bug
|
969
|
+
var FAILS_ON_NULL = fails(function () {
|
970
|
+
test.sort(null);
|
971
|
+
});
|
972
|
+
// Old WebKit
|
973
|
+
var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
|
974
|
+
|
975
|
+
var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
|
976
|
+
|
977
|
+
// `Array.prototype.sort` method
|
978
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.sort
|
979
|
+
_export({ target: 'Array', proto: true, forced: FORCED$1 }, {
|
980
|
+
sort: function sort(comparefn) {
|
981
|
+
return comparefn === undefined
|
982
|
+
? nativeSort.call(toObject(this))
|
983
|
+
: nativeSort.call(toObject(this), aFunction$1(comparefn));
|
1520
984
|
}
|
1521
985
|
});
|
1522
986
|
|
1523
|
-
var
|
1524
|
-
|
987
|
+
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
988
|
+
|
989
|
+
// `Object.keys` method
|
990
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
991
|
+
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
992
|
+
keys: function keys(it) {
|
993
|
+
return objectKeys(toObject(it));
|
994
|
+
}
|
995
|
+
});
|
996
|
+
|
997
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
998
|
+
var test$1 = {};
|
1525
999
|
|
1526
|
-
test[TO_STRING_TAG
|
1000
|
+
test$1[TO_STRING_TAG] = 'z';
|
1527
1001
|
|
1528
|
-
var toStringTagSupport = String(test) === '[object z]';
|
1002
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
1529
1003
|
|
1530
|
-
var TO_STRING_TAG$
|
1004
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
1531
1005
|
// ES3 wrong here
|
1532
1006
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
1533
1007
|
|
@@ -1543,7 +1017,7 @@
|
|
1543
1017
|
var O, tag, result;
|
1544
1018
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1545
1019
|
// @@toStringTag case
|
1546
|
-
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$
|
1020
|
+
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
1547
1021
|
// builtinTag case
|
1548
1022
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
1549
1023
|
// ES3 arguments fallback
|
@@ -1689,61 +1163,27 @@
|
|
1689
1163
|
exec: regexpExec
|
1690
1164
|
});
|
1691
1165
|
|
1692
|
-
|
1693
|
-
var
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
codeAt: createMethod$2(false),
|
1712
|
-
// `String.prototype.at` method
|
1713
|
-
// https://github.com/mathiasbynens/String.prototype.at
|
1714
|
-
charAt: createMethod$2(true)
|
1715
|
-
};
|
1716
|
-
|
1717
|
-
var charAt = stringMultibyte.charAt;
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
var STRING_ITERATOR = 'String Iterator';
|
1722
|
-
var setInternalState$2 = internalState.set;
|
1723
|
-
var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
|
1724
|
-
|
1725
|
-
// `String.prototype[@@iterator]` method
|
1726
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
|
1727
|
-
defineIterator(String, 'String', function (iterated) {
|
1728
|
-
setInternalState$2(this, {
|
1729
|
-
type: STRING_ITERATOR,
|
1730
|
-
string: String(iterated),
|
1731
|
-
index: 0
|
1732
|
-
});
|
1733
|
-
// `%StringIteratorPrototype%.next` method
|
1734
|
-
// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
|
1735
|
-
}, function next() {
|
1736
|
-
var state = getInternalState$2(this);
|
1737
|
-
var string = state.string;
|
1738
|
-
var index = state.index;
|
1739
|
-
var point;
|
1740
|
-
if (index >= string.length) return { value: undefined, done: true };
|
1741
|
-
point = charAt(string, index);
|
1742
|
-
state.index += point.length;
|
1743
|
-
return { value: point, done: false };
|
1744
|
-
});
|
1166
|
+
var TO_STRING = 'toString';
|
1167
|
+
var RegExpPrototype = RegExp.prototype;
|
1168
|
+
var nativeToString = RegExpPrototype[TO_STRING];
|
1169
|
+
|
1170
|
+
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
1171
|
+
// FF44- RegExp#toString has a wrong name
|
1172
|
+
var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
1173
|
+
|
1174
|
+
// `RegExp.prototype.toString` method
|
1175
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
|
1176
|
+
if (NOT_GENERIC || INCORRECT_NAME) {
|
1177
|
+
redefine(RegExp.prototype, TO_STRING, function toString() {
|
1178
|
+
var R = anObject(this);
|
1179
|
+
var p = String(R.source);
|
1180
|
+
var rf = R.flags;
|
1181
|
+
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
|
1182
|
+
return '/' + p + '/' + f;
|
1183
|
+
}, { unsafe: true });
|
1184
|
+
}
|
1745
1185
|
|
1746
|
-
var SPECIES$
|
1186
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
1747
1187
|
|
1748
1188
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
1749
1189
|
// #replace needs built-in support for named groups.
|
@@ -1797,7 +1237,7 @@
|
|
1797
1237
|
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
1798
1238
|
// a new one. We need to return the patched regex when creating the new one.
|
1799
1239
|
re.constructor = {};
|
1800
|
-
re.constructor[SPECIES$
|
1240
|
+
re.constructor[SPECIES$2] = function () { return re; };
|
1801
1241
|
re.flags = '';
|
1802
1242
|
re[SYMBOL] = /./[SYMBOL];
|
1803
1243
|
}
|
@@ -1844,12 +1284,37 @@
|
|
1844
1284
|
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
1845
1285
|
};
|
1846
1286
|
|
1847
|
-
|
1287
|
+
// `String.prototype.{ codePointAt, at }` methods implementation
|
1288
|
+
var createMethod$2 = function (CONVERT_TO_STRING) {
|
1289
|
+
return function ($this, pos) {
|
1290
|
+
var S = String(requireObjectCoercible($this));
|
1291
|
+
var position = toInteger(pos);
|
1292
|
+
var size = S.length;
|
1293
|
+
var first, second;
|
1294
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1295
|
+
first = S.charCodeAt(position);
|
1296
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1297
|
+
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1298
|
+
? CONVERT_TO_STRING ? S.charAt(position) : first
|
1299
|
+
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1300
|
+
};
|
1301
|
+
};
|
1302
|
+
|
1303
|
+
var stringMultibyte = {
|
1304
|
+
// `String.prototype.codePointAt` method
|
1305
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
|
1306
|
+
codeAt: createMethod$2(false),
|
1307
|
+
// `String.prototype.at` method
|
1308
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
1309
|
+
charAt: createMethod$2(true)
|
1310
|
+
};
|
1311
|
+
|
1312
|
+
var charAt = stringMultibyte.charAt;
|
1848
1313
|
|
1849
1314
|
// `AdvanceStringIndex` abstract operation
|
1850
1315
|
// https://tc39.github.io/ecma262/#sec-advancestringindex
|
1851
1316
|
var advanceStringIndex = function (S, index, unicode) {
|
1852
|
-
return index + (unicode ? charAt
|
1317
|
+
return index + (unicode ? charAt(S, index).length : 1);
|
1853
1318
|
};
|
1854
1319
|
|
1855
1320
|
// `RegExpExec` abstract operation
|
@@ -1864,14 +1329,51 @@
|
|
1864
1329
|
return result;
|
1865
1330
|
}
|
1866
1331
|
|
1867
|
-
if (classofRaw(R) !== 'RegExp') {
|
1868
|
-
throw TypeError('RegExp#exec called on incompatible receiver');
|
1869
|
-
}
|
1332
|
+
if (classofRaw(R) !== 'RegExp') {
|
1333
|
+
throw TypeError('RegExp#exec called on incompatible receiver');
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
return regexpExec.call(R, S);
|
1337
|
+
};
|
1338
|
+
|
1339
|
+
// @@match logic
|
1340
|
+
fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
1341
|
+
return [
|
1342
|
+
// `String.prototype.match` method
|
1343
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.match
|
1344
|
+
function match(regexp) {
|
1345
|
+
var O = requireObjectCoercible(this);
|
1346
|
+
var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
1347
|
+
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
1348
|
+
},
|
1349
|
+
// `RegExp.prototype[@@match]` method
|
1350
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
|
1351
|
+
function (regexp) {
|
1352
|
+
var res = maybeCallNative(nativeMatch, regexp, this);
|
1353
|
+
if (res.done) return res.value;
|
1354
|
+
|
1355
|
+
var rx = anObject(regexp);
|
1356
|
+
var S = String(this);
|
1357
|
+
|
1358
|
+
if (!rx.global) return regexpExecAbstract(rx, S);
|
1870
1359
|
|
1871
|
-
|
1872
|
-
|
1360
|
+
var fullUnicode = rx.unicode;
|
1361
|
+
rx.lastIndex = 0;
|
1362
|
+
var A = [];
|
1363
|
+
var n = 0;
|
1364
|
+
var result;
|
1365
|
+
while ((result = regexpExecAbstract(rx, S)) !== null) {
|
1366
|
+
var matchStr = String(result[0]);
|
1367
|
+
A[n] = matchStr;
|
1368
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
1369
|
+
n++;
|
1370
|
+
}
|
1371
|
+
return n === 0 ? null : A;
|
1372
|
+
}
|
1373
|
+
];
|
1374
|
+
});
|
1873
1375
|
|
1874
|
-
var max$
|
1376
|
+
var max$1 = Math.max;
|
1875
1377
|
var min$2 = Math.min;
|
1876
1378
|
var floor$1 = Math.floor;
|
1877
1379
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
@@ -1930,7 +1432,7 @@
|
|
1930
1432
|
result = results[i];
|
1931
1433
|
|
1932
1434
|
var matched = String(result[0]);
|
1933
|
-
var position = max$
|
1435
|
+
var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
1934
1436
|
var captures = [];
|
1935
1437
|
// NOTE: This is equivalent to
|
1936
1438
|
// captures = result.slice(1).map(maybeToString)
|
@@ -1990,6 +1492,199 @@
|
|
1990
1492
|
}
|
1991
1493
|
});
|
1992
1494
|
|
1495
|
+
var MATCH = wellKnownSymbol('match');
|
1496
|
+
|
1497
|
+
// `IsRegExp` abstract operation
|
1498
|
+
// https://tc39.github.io/ecma262/#sec-isregexp
|
1499
|
+
var isRegexp = function (it) {
|
1500
|
+
var isRegExp;
|
1501
|
+
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
1502
|
+
};
|
1503
|
+
|
1504
|
+
var SPECIES$3 = wellKnownSymbol('species');
|
1505
|
+
|
1506
|
+
// `SpeciesConstructor` abstract operation
|
1507
|
+
// https://tc39.github.io/ecma262/#sec-speciesconstructor
|
1508
|
+
var speciesConstructor = function (O, defaultConstructor) {
|
1509
|
+
var C = anObject(O).constructor;
|
1510
|
+
var S;
|
1511
|
+
return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction$1(S);
|
1512
|
+
};
|
1513
|
+
|
1514
|
+
var arrayPush = [].push;
|
1515
|
+
var min$3 = Math.min;
|
1516
|
+
var MAX_UINT32 = 0xFFFFFFFF;
|
1517
|
+
|
1518
|
+
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
|
1519
|
+
var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
1520
|
+
|
1521
|
+
// @@split logic
|
1522
|
+
fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
1523
|
+
var internalSplit;
|
1524
|
+
if (
|
1525
|
+
'abbc'.split(/(b)*/)[1] == 'c' ||
|
1526
|
+
'test'.split(/(?:)/, -1).length != 4 ||
|
1527
|
+
'ab'.split(/(?:ab)*/).length != 2 ||
|
1528
|
+
'.'.split(/(.?)(.?)/).length != 4 ||
|
1529
|
+
'.'.split(/()()/).length > 1 ||
|
1530
|
+
''.split(/.?/).length
|
1531
|
+
) {
|
1532
|
+
// based on es5-shim implementation, need to rework it
|
1533
|
+
internalSplit = function (separator, limit) {
|
1534
|
+
var string = String(requireObjectCoercible(this));
|
1535
|
+
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1536
|
+
if (lim === 0) return [];
|
1537
|
+
if (separator === undefined) return [string];
|
1538
|
+
// If `separator` is not a regex, use native split
|
1539
|
+
if (!isRegexp(separator)) {
|
1540
|
+
return nativeSplit.call(string, separator, lim);
|
1541
|
+
}
|
1542
|
+
var output = [];
|
1543
|
+
var flags = (separator.ignoreCase ? 'i' : '') +
|
1544
|
+
(separator.multiline ? 'm' : '') +
|
1545
|
+
(separator.unicode ? 'u' : '') +
|
1546
|
+
(separator.sticky ? 'y' : '');
|
1547
|
+
var lastLastIndex = 0;
|
1548
|
+
// Make `global` and avoid `lastIndex` issues by working with a copy
|
1549
|
+
var separatorCopy = new RegExp(separator.source, flags + 'g');
|
1550
|
+
var match, lastIndex, lastLength;
|
1551
|
+
while (match = regexpExec.call(separatorCopy, string)) {
|
1552
|
+
lastIndex = separatorCopy.lastIndex;
|
1553
|
+
if (lastIndex > lastLastIndex) {
|
1554
|
+
output.push(string.slice(lastLastIndex, match.index));
|
1555
|
+
if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
1556
|
+
lastLength = match[0].length;
|
1557
|
+
lastLastIndex = lastIndex;
|
1558
|
+
if (output.length >= lim) break;
|
1559
|
+
}
|
1560
|
+
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
|
1561
|
+
}
|
1562
|
+
if (lastLastIndex === string.length) {
|
1563
|
+
if (lastLength || !separatorCopy.test('')) output.push('');
|
1564
|
+
} else output.push(string.slice(lastLastIndex));
|
1565
|
+
return output.length > lim ? output.slice(0, lim) : output;
|
1566
|
+
};
|
1567
|
+
// Chakra, V8
|
1568
|
+
} else if ('0'.split(undefined, 0).length) {
|
1569
|
+
internalSplit = function (separator, limit) {
|
1570
|
+
return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
1571
|
+
};
|
1572
|
+
} else internalSplit = nativeSplit;
|
1573
|
+
|
1574
|
+
return [
|
1575
|
+
// `String.prototype.split` method
|
1576
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.split
|
1577
|
+
function split(separator, limit) {
|
1578
|
+
var O = requireObjectCoercible(this);
|
1579
|
+
var splitter = separator == undefined ? undefined : separator[SPLIT];
|
1580
|
+
return splitter !== undefined
|
1581
|
+
? splitter.call(separator, O, limit)
|
1582
|
+
: internalSplit.call(String(O), separator, limit);
|
1583
|
+
},
|
1584
|
+
// `RegExp.prototype[@@split]` method
|
1585
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
|
1586
|
+
//
|
1587
|
+
// NOTE: This cannot be properly polyfilled in engines that don't support
|
1588
|
+
// the 'y' flag.
|
1589
|
+
function (regexp, limit) {
|
1590
|
+
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
1591
|
+
if (res.done) return res.value;
|
1592
|
+
|
1593
|
+
var rx = anObject(regexp);
|
1594
|
+
var S = String(this);
|
1595
|
+
var C = speciesConstructor(rx, RegExp);
|
1596
|
+
|
1597
|
+
var unicodeMatching = rx.unicode;
|
1598
|
+
var flags = (rx.ignoreCase ? 'i' : '') +
|
1599
|
+
(rx.multiline ? 'm' : '') +
|
1600
|
+
(rx.unicode ? 'u' : '') +
|
1601
|
+
(SUPPORTS_Y ? 'y' : 'g');
|
1602
|
+
|
1603
|
+
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
1604
|
+
// simulate the 'y' flag.
|
1605
|
+
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
1606
|
+
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1607
|
+
if (lim === 0) return [];
|
1608
|
+
if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
|
1609
|
+
var p = 0;
|
1610
|
+
var q = 0;
|
1611
|
+
var A = [];
|
1612
|
+
while (q < S.length) {
|
1613
|
+
splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
1614
|
+
var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
|
1615
|
+
var e;
|
1616
|
+
if (
|
1617
|
+
z === null ||
|
1618
|
+
(e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
1619
|
+
) {
|
1620
|
+
q = advanceStringIndex(S, q, unicodeMatching);
|
1621
|
+
} else {
|
1622
|
+
A.push(S.slice(p, q));
|
1623
|
+
if (A.length === lim) return A;
|
1624
|
+
for (var i = 1; i <= z.length - 1; i++) {
|
1625
|
+
A.push(z[i]);
|
1626
|
+
if (A.length === lim) return A;
|
1627
|
+
}
|
1628
|
+
q = p = e;
|
1629
|
+
}
|
1630
|
+
}
|
1631
|
+
A.push(S.slice(p));
|
1632
|
+
return A;
|
1633
|
+
}
|
1634
|
+
];
|
1635
|
+
}, !SUPPORTS_Y);
|
1636
|
+
|
1637
|
+
// a string of all valid unicode whitespaces
|
1638
|
+
// eslint-disable-next-line max-len
|
1639
|
+
var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
1640
|
+
|
1641
|
+
var whitespace = '[' + whitespaces + ']';
|
1642
|
+
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
1643
|
+
var rtrim = RegExp(whitespace + whitespace + '*$');
|
1644
|
+
|
1645
|
+
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
1646
|
+
var createMethod$3 = function (TYPE) {
|
1647
|
+
return function ($this) {
|
1648
|
+
var string = String(requireObjectCoercible($this));
|
1649
|
+
if (TYPE & 1) string = string.replace(ltrim, '');
|
1650
|
+
if (TYPE & 2) string = string.replace(rtrim, '');
|
1651
|
+
return string;
|
1652
|
+
};
|
1653
|
+
};
|
1654
|
+
|
1655
|
+
var stringTrim = {
|
1656
|
+
// `String.prototype.{ trimLeft, trimStart }` methods
|
1657
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
|
1658
|
+
start: createMethod$3(1),
|
1659
|
+
// `String.prototype.{ trimRight, trimEnd }` methods
|
1660
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trimend
|
1661
|
+
end: createMethod$3(2),
|
1662
|
+
// `String.prototype.trim` method
|
1663
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
1664
|
+
trim: createMethod$3(3)
|
1665
|
+
};
|
1666
|
+
|
1667
|
+
var non = '\u200B\u0085\u180E';
|
1668
|
+
|
1669
|
+
// check that a method works with the correct list
|
1670
|
+
// of whitespaces and has a correct name
|
1671
|
+
var forcedStringTrimMethod = function (METHOD_NAME) {
|
1672
|
+
return fails(function () {
|
1673
|
+
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
1674
|
+
});
|
1675
|
+
};
|
1676
|
+
|
1677
|
+
var $trim = stringTrim.trim;
|
1678
|
+
|
1679
|
+
|
1680
|
+
// `String.prototype.trim` method
|
1681
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
1682
|
+
_export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
1683
|
+
trim: function trim() {
|
1684
|
+
return $trim(this);
|
1685
|
+
}
|
1686
|
+
});
|
1687
|
+
|
1993
1688
|
// iterable DOM collections
|
1994
1689
|
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
1995
1690
|
var domIterables = {
|
@@ -2026,223 +1721,652 @@
|
|
2026
1721
|
TouchList: 0
|
2027
1722
|
};
|
2028
1723
|
|
2029
|
-
var
|
2030
|
-
|
2031
|
-
|
1724
|
+
var $forEach = arrayIteration.forEach;
|
1725
|
+
|
1726
|
+
|
1727
|
+
// `Array.prototype.forEach` method implementation
|
1728
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
1729
|
+
var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
1730
|
+
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1731
|
+
} : [].forEach;
|
2032
1732
|
|
2033
1733
|
for (var COLLECTION_NAME in domIterables) {
|
2034
1734
|
var Collection = global_1[COLLECTION_NAME];
|
2035
1735
|
var CollectionPrototype = Collection && Collection.prototype;
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
1736
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
1737
|
+
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
1738
|
+
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
1739
|
+
} catch (error) {
|
1740
|
+
CollectionPrototype.forEach = arrayForEach;
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
|
1744
|
+
function _typeof(obj) {
|
1745
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1746
|
+
_typeof = function (obj) {
|
1747
|
+
return typeof obj;
|
1748
|
+
};
|
1749
|
+
} else {
|
1750
|
+
_typeof = function (obj) {
|
1751
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1752
|
+
};
|
1753
|
+
}
|
1754
|
+
|
1755
|
+
return _typeof(obj);
|
1756
|
+
}
|
1757
|
+
|
1758
|
+
var Utils = $.fn.bootstrapTable.utils;
|
1759
|
+
var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
|
1760
|
+
function getOptionsFromSelectControl(selectControl) {
|
1761
|
+
return selectControl.get(selectControl.length - 1).options;
|
1762
|
+
}
|
1763
|
+
function getControlContainer(that) {
|
1764
|
+
if (that.options.filterControlContainer) {
|
1765
|
+
return $("".concat(that.options.filterControlContainer));
|
1766
|
+
}
|
1767
|
+
|
1768
|
+
return that.$header;
|
1769
|
+
}
|
1770
|
+
function getSearchControls(that) {
|
1771
|
+
return getControlContainer(that).find(searchControls);
|
1772
|
+
}
|
1773
|
+
function hideUnusedSelectOptions(selectControl, uniqueValues) {
|
1774
|
+
var options = getOptionsFromSelectControl(selectControl);
|
1775
|
+
|
1776
|
+
for (var i = 0; i < options.length; i++) {
|
1777
|
+
if (options[i].value !== '') {
|
1778
|
+
if (!uniqueValues.hasOwnProperty(options[i].value)) {
|
1779
|
+
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
|
1780
|
+
} else {
|
1781
|
+
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
|
1782
|
+
}
|
2042
1783
|
}
|
2043
|
-
|
2044
|
-
|
1784
|
+
}
|
1785
|
+
}
|
1786
|
+
function existOptionInSelectControl(selectControl, value) {
|
1787
|
+
var options = getOptionsFromSelectControl(selectControl);
|
1788
|
+
|
1789
|
+
for (var i = 0; i < options.length; i++) {
|
1790
|
+
if (options[i].value === Utils.unescapeHTML(value.toString())) {
|
1791
|
+
// The value is not valid to add
|
1792
|
+
return true;
|
2045
1793
|
}
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
1794
|
+
} // If we get here, the value is valid to add
|
1795
|
+
|
1796
|
+
|
1797
|
+
return false;
|
1798
|
+
}
|
1799
|
+
function addOptionToSelectControl(selectControl, _value, text, selected) {
|
1800
|
+
var value = _value === undefined || _value === null ? '' : _value.toString().trim();
|
1801
|
+
var $selectControl = $(selectControl.get(selectControl.length - 1));
|
1802
|
+
|
1803
|
+
if (!existOptionInSelectControl(selectControl, value)) {
|
1804
|
+
var option = $("<option value=\"".concat(value, "\">").concat(text, "</option>"));
|
1805
|
+
|
1806
|
+
if (value === selected) {
|
1807
|
+
option.attr('selected', true);
|
2053
1808
|
}
|
1809
|
+
|
1810
|
+
$selectControl.append(option);
|
2054
1811
|
}
|
2055
1812
|
}
|
1813
|
+
function sortSelectControl(selectControl, orderBy) {
|
1814
|
+
var $selectControl = $(selectControl.get(selectControl.length - 1));
|
1815
|
+
var $opts = $selectControl.find('option:gt(0)');
|
2056
1816
|
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
*/
|
1817
|
+
if (orderBy !== 'server') {
|
1818
|
+
$opts.sort(function (a, b) {
|
1819
|
+
return Utils.sort(a.textContent, b.textContent, orderBy === 'desc' ? -1 : 1);
|
1820
|
+
});
|
1821
|
+
}
|
2063
1822
|
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
1823
|
+
$selectControl.find('option:gt(0)').remove();
|
1824
|
+
$selectControl.append($opts);
|
1825
|
+
}
|
1826
|
+
function fixHeaderCSS(_ref) {
|
1827
|
+
var $tableHeader = _ref.$tableHeader;
|
1828
|
+
$tableHeader.css('height', '89px');
|
1829
|
+
}
|
1830
|
+
function getElementClass($element) {
|
1831
|
+
return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
|
1832
|
+
}
|
1833
|
+
function getCursorPosition(el) {
|
1834
|
+
if (Utils.isIEBrowser()) {
|
1835
|
+
if ($(el).is('input[type=text]')) {
|
1836
|
+
var pos = 0;
|
1837
|
+
|
1838
|
+
if ('selectionStart' in el) {
|
1839
|
+
pos = el.selectionStart;
|
1840
|
+
} else if ('selection' in document) {
|
1841
|
+
el.focus();
|
1842
|
+
var Sel = document.selection.createRange();
|
1843
|
+
var SelLength = document.selection.createRange().text.length;
|
1844
|
+
Sel.moveStart('character', -el.value.length);
|
1845
|
+
pos = Sel.text.length - SelLength;
|
1846
|
+
}
|
1847
|
+
|
1848
|
+
return pos;
|
1849
|
+
}
|
1850
|
+
|
1851
|
+
return -1;
|
2089
1852
|
}
|
2090
|
-
});
|
2091
|
-
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
2092
|
-
'cellinput-init.bs.table': 'onCellInputInit',
|
2093
|
-
'cellinput-blur.bs.table': 'onCellInputBlur',
|
2094
|
-
'cellinput-focus.bs.table': 'onCellInputFocus',
|
2095
|
-
'cellinput-keyup.bs.table': 'onCellInputKeyup',
|
2096
|
-
'cellinput-keydown.bs.table': 'onCellInputKeydown',
|
2097
|
-
'cellinput-selectchange.bs.table': 'onCellInputSelectChange'
|
2098
|
-
});
|
2099
|
-
var BootstrapTable = $.fn.bootstrapTable.Constructor;
|
2100
|
-
var _initTable = BootstrapTable.prototype.initTable;
|
2101
|
-
var _initBody = BootstrapTable.prototype.initBody;
|
2102
1853
|
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
1854
|
+
return -1;
|
1855
|
+
}
|
1856
|
+
function setCursorPosition(el) {
|
1857
|
+
$(el).val(el.value);
|
1858
|
+
}
|
1859
|
+
function copyValues(that) {
|
1860
|
+
var searchControls = getSearchControls(that);
|
1861
|
+
that.options.valuesFilterControl = [];
|
1862
|
+
searchControls.each(function () {
|
1863
|
+
var $field = $(this);
|
1864
|
+
|
1865
|
+
if (that.options.height) {
|
1866
|
+
var fieldClass = getElementClass($field);
|
1867
|
+
$field = $(".fixed-table-header .".concat(fieldClass));
|
1868
|
+
}
|
1869
|
+
|
1870
|
+
that.options.valuesFilterControl.push({
|
1871
|
+
field: $field.closest('[data-field]').data('field'),
|
1872
|
+
value: $field.val(),
|
1873
|
+
position: getCursorPosition($field.get(0)),
|
1874
|
+
hasFocus: $field.is(':focus')
|
1875
|
+
});
|
1876
|
+
});
|
1877
|
+
}
|
1878
|
+
function setValues(that) {
|
1879
|
+
var field = null;
|
1880
|
+
var result = [];
|
1881
|
+
var searchControls = getSearchControls(that);
|
1882
|
+
|
1883
|
+
if (that.options.valuesFilterControl.length > 0) {
|
1884
|
+
// Callback to apply after settings fields values
|
1885
|
+
var fieldToFocusCallback = null;
|
1886
|
+
searchControls.each(function (i, el) {
|
1887
|
+
var $this = $(el);
|
1888
|
+
field = $this.closest('[data-field]').data('field');
|
1889
|
+
result = that.options.valuesFilterControl.filter(function (valueObj) {
|
1890
|
+
return valueObj.field === field;
|
1891
|
+
});
|
1892
|
+
|
1893
|
+
if (result.length > 0) {
|
1894
|
+
if ($this.is('[type=radio]')) {
|
1895
|
+
return;
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
$this.val(result[0].value);
|
1899
|
+
|
1900
|
+
if (result[0].hasFocus && result[0].value !== '') {
|
1901
|
+
// set callback if the field had the focus.
|
1902
|
+
fieldToFocusCallback = function (fieldToFocus, carretPosition) {
|
1903
|
+
// Closure here to capture the field and cursor position
|
1904
|
+
var closedCallback = function closedCallback() {
|
1905
|
+
fieldToFocus.focus();
|
1906
|
+
setCursorPosition(fieldToFocus);
|
1907
|
+
};
|
1908
|
+
|
1909
|
+
return closedCallback;
|
1910
|
+
}($this.get(0), result[0].position);
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
}); // Callback call.
|
1914
|
+
|
1915
|
+
if (fieldToFocusCallback !== null) {
|
1916
|
+
fieldToFocusCallback();
|
1917
|
+
}
|
2106
1918
|
}
|
1919
|
+
}
|
1920
|
+
function collectBootstrapCookies() {
|
1921
|
+
var cookies = [];
|
1922
|
+
var foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
|
1923
|
+
var foundLocalStorage = localStorage;
|
2107
1924
|
|
2108
|
-
|
1925
|
+
if (foundCookies) {
|
1926
|
+
$.each(foundCookies, function (i, _cookie) {
|
1927
|
+
var cookie = _cookie;
|
2109
1928
|
|
1929
|
+
if (/./.test(cookie)) {
|
1930
|
+
cookie = cookie.split('.').pop();
|
1931
|
+
}
|
2110
1932
|
|
2111
|
-
|
2112
|
-
|
1933
|
+
if ($.inArray(cookie, cookies) === -1) {
|
1934
|
+
cookies.push(cookie);
|
1935
|
+
}
|
1936
|
+
});
|
2113
1937
|
}
|
2114
1938
|
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
1939
|
+
if (foundLocalStorage) {
|
1940
|
+
for (var i = 0; i < foundLocalStorage.length; i++) {
|
1941
|
+
var cookie = foundLocalStorage.key(i);
|
1942
|
+
|
1943
|
+
if (/./.test(cookie)) {
|
1944
|
+
cookie = cookie.split('.').pop();
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
if (!cookies.includes(cookie)) {
|
1948
|
+
cookies.push(cookie);
|
1949
|
+
}
|
2119
1950
|
}
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
return cookies;
|
1954
|
+
}
|
1955
|
+
function escapeID(id) {
|
1956
|
+
// eslint-disable-next-line no-useless-escape
|
1957
|
+
return String(id).replace(/([:.\[\],])/g, '\\$1');
|
1958
|
+
}
|
1959
|
+
function isColumnSearchableViaSelect(_ref2) {
|
1960
|
+
var filterControl = _ref2.filterControl,
|
1961
|
+
searchable = _ref2.searchable;
|
1962
|
+
return filterControl && filterControl.toLowerCase() === 'select' && searchable;
|
1963
|
+
}
|
1964
|
+
function isFilterDataNotGiven(_ref3) {
|
1965
|
+
var filterData = _ref3.filterData;
|
1966
|
+
return filterData === undefined || filterData.toLowerCase() === 'column';
|
1967
|
+
}
|
1968
|
+
function hasSelectControlElement(selectControl) {
|
1969
|
+
return selectControl && selectControl.length > 0;
|
1970
|
+
}
|
1971
|
+
function initFilterSelectControls(that) {
|
1972
|
+
var data = that.data;
|
1973
|
+
var z = that.options.pagination ? that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows : that.pageTo;
|
1974
|
+
$.each(that.header.fields, function (j, field) {
|
1975
|
+
var column = that.columns[that.fieldsColumnsIndex[field]];
|
1976
|
+
var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
1977
|
+
|
1978
|
+
if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
|
1979
|
+
if (selectControl.get(selectControl.length - 1).options.length === 0) {
|
1980
|
+
// Added the default option
|
1981
|
+
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
|
1982
|
+
}
|
2120
1983
|
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
var
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
isSetDataUniqueIdAttr ? " data-uniqueid=\"".concat(row[column.cellInputUniqueId], "\"") : '', " data-name=\"".concat(column.field, "\""), " data-value=\"".concat(result, "\""), " value=\"".concat(result, "\""), ' autofocus="autofocus"', typeof disableCallbackFunc !== 'undefined' && disableCallbackFunc(row) ? ' disabled="disabled"' : '', '>'].join('');
|
2132
|
-
};
|
2133
|
-
} else if (column.cellInputType === 'select') {
|
2134
|
-
column.formatter = function (value, row, index) {
|
2135
|
-
var result = _formatter ? _formatter(value, row, index) : value;
|
2136
|
-
var optionDatas = column.cellInputSelectOptinons !== null ? column.cellInputSelectOptinons : [];
|
2137
|
-
var selectoptions = [];
|
2138
|
-
var arrAllowedValues = [];
|
2139
|
-
|
2140
|
-
for (var k = 0; k < optionDatas.length; k++) {
|
2141
|
-
arrAllowedValues.push(optionDatas[k].value);
|
1984
|
+
var uniqueValues = {};
|
1985
|
+
|
1986
|
+
for (var i = 0; i < z; i++) {
|
1987
|
+
// Added a new value
|
1988
|
+
var fieldValue = data[i][field];
|
1989
|
+
var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
|
1990
|
+
var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
|
1991
|
+
|
1992
|
+
if (column.filterDataCollector) {
|
1993
|
+
formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
|
2142
1994
|
}
|
2143
1995
|
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
var _iteratorError = undefined;
|
1996
|
+
if (column.searchFormatter) {
|
1997
|
+
fieldValue = formattedValue;
|
1998
|
+
}
|
2148
1999
|
|
2149
|
-
|
2150
|
-
for (var _iterator = optionDatas[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
2151
|
-
var optionData = _step.value;
|
2152
|
-
var isSelected = optionData.value === value;
|
2000
|
+
uniqueValues[formattedValue] = fieldValue;
|
2153
2001
|
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2002
|
+
if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
|
2003
|
+
formattedValue.forEach(function (value) {
|
2004
|
+
addOptionToSelectControl(selectControl, value, value, column.filterDefault);
|
2005
|
+
});
|
2006
|
+
continue;
|
2007
|
+
} // eslint-disable-next-line guard-for-in
|
2158
2008
|
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
_didIteratorError = true;
|
2163
|
-
_iteratorError = err;
|
2164
|
-
} finally {
|
2165
|
-
try {
|
2166
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
2167
|
-
_iterator.return();
|
2168
|
-
}
|
2169
|
-
} finally {
|
2170
|
-
if (_didIteratorError) {
|
2171
|
-
throw _iteratorError;
|
2172
|
-
}
|
2173
|
-
}
|
2009
|
+
|
2010
|
+
for (var key in uniqueValues) {
|
2011
|
+
addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
|
2174
2012
|
}
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
sortSelectControl(selectControl, column.filterOrderBy);
|
2175
2016
|
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
};
|
2017
|
+
if (that.options.hideUnusedSelectOptions) {
|
2018
|
+
hideUnusedSelectOptions(selectControl, uniqueValues);
|
2019
|
+
}
|
2180
2020
|
}
|
2181
2021
|
});
|
2182
|
-
}
|
2022
|
+
}
|
2023
|
+
function getFilterDataMethod(objFilterDataMethod, searchTerm) {
|
2024
|
+
var keys = Object.keys(objFilterDataMethod);
|
2183
2025
|
|
2184
|
-
|
2185
|
-
|
2026
|
+
for (var i = 0; i < keys.length; i++) {
|
2027
|
+
if (keys[i] === searchTerm) {
|
2028
|
+
return objFilterDataMethod[searchTerm];
|
2029
|
+
}
|
2030
|
+
}
|
2186
2031
|
|
2187
|
-
|
2032
|
+
return null;
|
2033
|
+
}
|
2034
|
+
function createControls(that, header) {
|
2035
|
+
var addedFilterControl = false;
|
2036
|
+
var html;
|
2037
|
+
$.each(that.columns, function (_, column) {
|
2038
|
+
html = [];
|
2188
2039
|
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2040
|
+
if (!column.visible) {
|
2041
|
+
return;
|
2042
|
+
}
|
2192
2043
|
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
var
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
var row = data[index];
|
2207
|
-
var oldValue = row[column.field];
|
2208
|
-
var newValue = $(this).val();
|
2209
|
-
row[column.field] = newValue;
|
2210
|
-
that.trigger('cellinput-keyup', column.field, row, oldValue, index, $(this));
|
2044
|
+
if (!column.filterControl && !that.options.filterControlContainer) {
|
2045
|
+
html.push('<div class="no-filter-control"></div>');
|
2046
|
+
} else if (that.options.filterControlContainer) {
|
2047
|
+
var $filterControls = $(".bootstrap-table-filter-control-".concat(column.field));
|
2048
|
+
$.each($filterControls, function (_, filterControl) {
|
2049
|
+
var $filterControl = $(filterControl);
|
2050
|
+
|
2051
|
+
if (!$filterControl.is('[type=radio]')) {
|
2052
|
+
var placeholder = column.filterControlPlaceholder ? column.filterControlPlaceholder : '';
|
2053
|
+
$filterControl.attr('placeholder', placeholder).val(column.filterDefault);
|
2054
|
+
}
|
2055
|
+
|
2056
|
+
$filterControl.attr('data-field', column.field);
|
2211
2057
|
});
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2058
|
+
addedFilterControl = true;
|
2059
|
+
} else {
|
2060
|
+
var nameControl = column.filterControl.toLowerCase();
|
2061
|
+
html.push('<div class="filter-control">');
|
2062
|
+
addedFilterControl = true;
|
2063
|
+
|
2064
|
+
if (column.searchable && that.options.filterTemplate[nameControl]) {
|
2065
|
+
html.push(that.options.filterTemplate[nameControl](that, column.field, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
|
2066
|
+
}
|
2067
|
+
}
|
2068
|
+
|
2069
|
+
if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
|
2070
|
+
if ($.isEmptyObject(that.filterColumnsPartial)) {
|
2071
|
+
that.filterColumnsPartial = {};
|
2072
|
+
}
|
2073
|
+
|
2074
|
+
that.filterColumnsPartial[column.field] = column.filterDefault;
|
2075
|
+
}
|
2076
|
+
|
2077
|
+
$.each(header.find('th'), function (i, th) {
|
2078
|
+
var $th = $(th);
|
2079
|
+
|
2080
|
+
if ($th.data('field') === column.field) {
|
2081
|
+
$th.find('.fht-cell').append(html.join(''));
|
2082
|
+
return false;
|
2083
|
+
}
|
2084
|
+
});
|
2085
|
+
|
2086
|
+
if (column.filterData && column.filterData.toLowerCase() !== 'column') {
|
2087
|
+
var filterDataType = getFilterDataMethod(
|
2088
|
+
/* eslint-disable no-use-before-define */
|
2089
|
+
filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
|
2090
|
+
var filterDataSource;
|
2091
|
+
var selectControl;
|
2092
|
+
|
2093
|
+
if (filterDataType) {
|
2094
|
+
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
|
2095
|
+
selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
2096
|
+
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
|
2097
|
+
filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
|
2098
|
+
} else {
|
2099
|
+
throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
|
2100
|
+
}
|
2101
|
+
}
|
2102
|
+
});
|
2103
|
+
|
2104
|
+
if (addedFilterControl) {
|
2105
|
+
header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
|
2106
|
+
var currentTarget = _ref4.currentTarget,
|
2107
|
+
keyCode = _ref4.keyCode;
|
2108
|
+
syncControls(that); // Simulate enter key action from clear button
|
2109
|
+
|
2110
|
+
keyCode = obj ? obj.keyCode : keyCode;
|
2111
|
+
|
2112
|
+
if (that.options.searchOnEnterKey && keyCode !== 13) {
|
2113
|
+
return;
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
|
2117
|
+
return;
|
2118
|
+
}
|
2119
|
+
|
2120
|
+
var $currentTarget = $(currentTarget);
|
2121
|
+
|
2122
|
+
if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
|
2123
|
+
return;
|
2124
|
+
}
|
2125
|
+
|
2126
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2127
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2128
|
+
that.onColumnSearch({
|
2129
|
+
currentTarget: currentTarget,
|
2130
|
+
keyCode: keyCode
|
2131
|
+
});
|
2132
|
+
}, that.options.searchTimeOut);
|
2133
|
+
});
|
2134
|
+
header.off('change', 'select:not(".ms-offscreen")').on('change', 'select:not(".ms-offscreen")', function (_ref5) {
|
2135
|
+
var currentTarget = _ref5.currentTarget,
|
2136
|
+
keyCode = _ref5.keyCode;
|
2137
|
+
syncControls(that);
|
2138
|
+
var $select = $(currentTarget);
|
2139
|
+
var value = $select.val();
|
2140
|
+
|
2141
|
+
if (value && value.length > 0 && value.trim()) {
|
2142
|
+
$select.find('option[selected]').removeAttr('selected');
|
2143
|
+
$select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
|
2144
|
+
} else {
|
2145
|
+
$select.find('option[selected]').removeAttr('selected');
|
2146
|
+
}
|
2147
|
+
|
2148
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2149
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2150
|
+
that.onColumnSearch({
|
2151
|
+
currentTarget: currentTarget,
|
2152
|
+
keyCode: keyCode
|
2153
|
+
});
|
2154
|
+
}, that.options.searchTimeOut);
|
2155
|
+
});
|
2156
|
+
header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
|
2157
|
+
var currentTarget = _ref6.currentTarget,
|
2158
|
+
keyCode = _ref6.keyCode;
|
2159
|
+
var $input = $(currentTarget);
|
2160
|
+
var oldValue = $input.val();
|
2161
|
+
|
2162
|
+
if (oldValue === '') {
|
2163
|
+
return;
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
setTimeout(function () {
|
2167
|
+
syncControls(that);
|
2168
|
+
var newValue = $input.val();
|
2169
|
+
|
2170
|
+
if (newValue === '') {
|
2171
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2172
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2173
|
+
that.onColumnSearch({
|
2174
|
+
currentTarget: currentTarget,
|
2175
|
+
keyCode: keyCode
|
2176
|
+
});
|
2177
|
+
}, that.options.searchTimeOut);
|
2221
2178
|
}
|
2179
|
+
}, 1);
|
2180
|
+
});
|
2181
|
+
header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
|
2182
|
+
var currentTarget = _ref7.currentTarget,
|
2183
|
+
keyCode = _ref7.keyCode;
|
2184
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2185
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2186
|
+
syncControls(that);
|
2187
|
+
that.onColumnSearch({
|
2188
|
+
currentTarget: currentTarget,
|
2189
|
+
keyCode: keyCode
|
2190
|
+
});
|
2191
|
+
}, that.options.searchTimeOut);
|
2192
|
+
});
|
2193
|
+
|
2194
|
+
if (header.find('.date-filter-control').length > 0) {
|
2195
|
+
$.each(that.columns, function (i, _ref8) {
|
2196
|
+
var filterDefault = _ref8.filterDefault,
|
2197
|
+
filterControl = _ref8.filterControl,
|
2198
|
+
field = _ref8.field,
|
2199
|
+
filterDatepickerOptions = _ref8.filterDatepickerOptions;
|
2222
2200
|
|
2223
|
-
|
2201
|
+
if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
|
2202
|
+
var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field));
|
2203
|
+
$datepicker.datepicker(filterDatepickerOptions);
|
2204
|
+
|
2205
|
+
if (filterDefault) {
|
2206
|
+
$datepicker.datepicker('setDate', filterDefault);
|
2207
|
+
}
|
2208
|
+
|
2209
|
+
$datepicker.on('changeDate', function (_ref9) {
|
2210
|
+
var currentTarget = _ref9.currentTarget,
|
2211
|
+
keyCode = _ref9.keyCode;
|
2212
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2213
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2214
|
+
syncControls(that);
|
2215
|
+
that.onColumnSearch({
|
2216
|
+
currentTarget: currentTarget,
|
2217
|
+
keyCode: keyCode
|
2218
|
+
});
|
2219
|
+
}, that.options.searchTimeOut);
|
2220
|
+
});
|
2221
|
+
}
|
2224
2222
|
});
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2223
|
+
}
|
2224
|
+
|
2225
|
+
if (that.options.sidePagination !== 'server' && !that.options.height) {
|
2226
|
+
that.triggerSearch();
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
if (!that.options.filterControlVisible) {
|
2230
|
+
header.find('.filter-control, .no-filter-control').hide();
|
2231
|
+
}
|
2232
|
+
} else {
|
2233
|
+
header.find('.filter-control, .no-filter-control').hide();
|
2234
|
+
}
|
2235
|
+
|
2236
|
+
that.trigger('created-controls');
|
2237
|
+
}
|
2238
|
+
function getDirectionOfSelectOptions(_alignment) {
|
2239
|
+
var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
|
2240
|
+
|
2241
|
+
switch (alignment) {
|
2242
|
+
case 'left':
|
2243
|
+
return 'ltr';
|
2244
|
+
|
2245
|
+
case 'right':
|
2246
|
+
return 'rtl';
|
2247
|
+
|
2248
|
+
case 'auto':
|
2249
|
+
return 'auto';
|
2250
|
+
|
2251
|
+
default:
|
2252
|
+
return 'ltr';
|
2253
|
+
}
|
2254
|
+
}
|
2255
|
+
function syncControls(that) {
|
2256
|
+
if (that.options.height) {
|
2257
|
+
var controlsTableHeader = that.$tableHeader.find(searchControls);
|
2258
|
+
that.$header.find(searchControls).each(function (_, control) {
|
2259
|
+
var $control = $(control);
|
2260
|
+
var controlClass = getElementClass($control);
|
2261
|
+
var foundControl = controlsTableHeader.filter(function (_, ele) {
|
2262
|
+
var eleClass = getElementClass($(ele));
|
2263
|
+
return controlClass === eleClass;
|
2230
2264
|
});
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2265
|
+
|
2266
|
+
if (foundControl.length === 0) {
|
2267
|
+
return;
|
2268
|
+
}
|
2269
|
+
|
2270
|
+
if ($control.is('select')) {
|
2271
|
+
$control.find('option:selected').removeAttr('selected');
|
2272
|
+
$control.find("option[value='".concat(foundControl.val(), "']")).attr('selected', true);
|
2273
|
+
} else {
|
2274
|
+
$control.val(foundControl.val());
|
2275
|
+
}
|
2276
|
+
});
|
2277
|
+
}
|
2278
|
+
}
|
2279
|
+
var filterDataMethods = {
|
2280
|
+
func: function func(filterDataSource, selectControl, filterOrderBy, selected) {
|
2281
|
+
var variableValues = window[filterDataSource].apply(); // eslint-disable-next-line guard-for-in
|
2282
|
+
|
2283
|
+
for (var key in variableValues) {
|
2284
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2285
|
+
}
|
2286
|
+
|
2287
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2288
|
+
},
|
2289
|
+
obj: function obj(filterDataSource, selectControl, filterOrderBy, selected) {
|
2290
|
+
var objectKeys = filterDataSource.split('.');
|
2291
|
+
var variableName = objectKeys.shift();
|
2292
|
+
var variableValues = window[variableName];
|
2293
|
+
|
2294
|
+
if (objectKeys.length > 0) {
|
2295
|
+
objectKeys.forEach(function (key) {
|
2296
|
+
variableValues = variableValues[key];
|
2242
2297
|
});
|
2298
|
+
} // eslint-disable-next-line guard-for-in
|
2299
|
+
|
2300
|
+
|
2301
|
+
for (var key in variableValues) {
|
2302
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2243
2303
|
}
|
2244
|
-
|
2245
|
-
|
2304
|
+
|
2305
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2306
|
+
},
|
2307
|
+
var: function _var(filterDataSource, selectControl, filterOrderBy, selected) {
|
2308
|
+
var variableValues = window[filterDataSource];
|
2309
|
+
var isArray = Array.isArray(variableValues);
|
2310
|
+
|
2311
|
+
for (var key in variableValues) {
|
2312
|
+
if (isArray) {
|
2313
|
+
addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected);
|
2314
|
+
} else {
|
2315
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2316
|
+
}
|
2317
|
+
}
|
2318
|
+
|
2319
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2320
|
+
},
|
2321
|
+
url: function url(filterDataSource, selectControl, filterOrderBy, selected) {
|
2322
|
+
$.ajax({
|
2323
|
+
url: filterDataSource,
|
2324
|
+
dataType: 'json',
|
2325
|
+
success: function success(data) {
|
2326
|
+
// eslint-disable-next-line guard-for-in
|
2327
|
+
for (var key in data) {
|
2328
|
+
addOptionToSelectControl(selectControl, key, data[key], selected);
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2332
|
+
}
|
2333
|
+
});
|
2334
|
+
},
|
2335
|
+
json: function json(filterDataSource, selectControl, filterOrderBy, selected) {
|
2336
|
+
var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
|
2337
|
+
|
2338
|
+
for (var key in variableValues) {
|
2339
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2340
|
+
}
|
2341
|
+
|
2342
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2343
|
+
}
|
2246
2344
|
};
|
2247
2345
|
|
2346
|
+
exports.addOptionToSelectControl = addOptionToSelectControl;
|
2347
|
+
exports.collectBootstrapCookies = collectBootstrapCookies;
|
2348
|
+
exports.copyValues = copyValues;
|
2349
|
+
exports.createControls = createControls;
|
2350
|
+
exports.escapeID = escapeID;
|
2351
|
+
exports.existOptionInSelectControl = existOptionInSelectControl;
|
2352
|
+
exports.fixHeaderCSS = fixHeaderCSS;
|
2353
|
+
exports.getControlContainer = getControlContainer;
|
2354
|
+
exports.getCursorPosition = getCursorPosition;
|
2355
|
+
exports.getDirectionOfSelectOptions = getDirectionOfSelectOptions;
|
2356
|
+
exports.getElementClass = getElementClass;
|
2357
|
+
exports.getFilterDataMethod = getFilterDataMethod;
|
2358
|
+
exports.getOptionsFromSelectControl = getOptionsFromSelectControl;
|
2359
|
+
exports.getSearchControls = getSearchControls;
|
2360
|
+
exports.hasSelectControlElement = hasSelectControlElement;
|
2361
|
+
exports.hideUnusedSelectOptions = hideUnusedSelectOptions;
|
2362
|
+
exports.initFilterSelectControls = initFilterSelectControls;
|
2363
|
+
exports.isColumnSearchableViaSelect = isColumnSearchableViaSelect;
|
2364
|
+
exports.isFilterDataNotGiven = isFilterDataNotGiven;
|
2365
|
+
exports.setCursorPosition = setCursorPosition;
|
2366
|
+
exports.setValues = setValues;
|
2367
|
+
exports.sortSelectControl = sortSelectControl;
|
2368
|
+
exports.syncControls = syncControls;
|
2369
|
+
|
2370
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
2371
|
+
|
2248
2372
|
})));
|