bootstrap-table-rails 1.16.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +142 -33
- data/lib/bootstrap-table-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +588 -19
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +3 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +3 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +1 -2
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +399 -181
- data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +23 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +28 -8
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +3 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +999 -240
- data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +3 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +1587 -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 -211
- data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +28 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +846 -720
- data/vendor/assets/javascripts/bootstrap-table/extensions/{cell-input/bootstrap-table-cell-input.js → filter-control/utils.js} +1136 -1023
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +44 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +6 -15
- 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 +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +31 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +1 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +170 -25
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +4 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +3 -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 +2 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +45 -7
- 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 +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +25 -16
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +11 -2
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +13 -3
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +10 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +768 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.js +1049 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.eot +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.svg +28 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.ttf +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.woff +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +54 -2
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +54 -2
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +55 -3
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +54 -2
- metadata +10 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.css +0 -12
@@ -4,7 +4,7 @@
|
|
4
4
|
(global = global || self, factory(global.jQuery));
|
5
5
|
}(this, (function ($) { 'use strict';
|
6
6
|
|
7
|
-
$ = $ &&
|
7
|
+
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
8
8
|
|
9
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10
10
|
|
@@ -945,45 +945,6 @@
|
|
945
945
|
}
|
946
946
|
});
|
947
947
|
|
948
|
-
var nativeJoin = [].join;
|
949
|
-
|
950
|
-
var ES3_STRINGS = indexedObject != Object;
|
951
|
-
var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
|
952
|
-
|
953
|
-
// `Array.prototype.join` method
|
954
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.join
|
955
|
-
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
|
956
|
-
join: function join(separator) {
|
957
|
-
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
958
|
-
}
|
959
|
-
});
|
960
|
-
|
961
|
-
var test = [];
|
962
|
-
var nativeSort = test.sort;
|
963
|
-
|
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));
|
984
|
-
}
|
985
|
-
});
|
986
|
-
|
987
948
|
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
988
949
|
|
989
950
|
// `Object.keys` method
|
@@ -995,11 +956,11 @@
|
|
995
956
|
});
|
996
957
|
|
997
958
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
998
|
-
var test
|
959
|
+
var test = {};
|
999
960
|
|
1000
|
-
test
|
961
|
+
test[TO_STRING_TAG] = 'z';
|
1001
962
|
|
1002
|
-
var toStringTagSupport = String(test
|
963
|
+
var toStringTagSupport = String(test) === '[object z]';
|
1003
964
|
|
1004
965
|
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
1005
966
|
// ES3 wrong here
|
@@ -1071,11 +1032,11 @@
|
|
1071
1032
|
|
1072
1033
|
var nativeParseInt = global_1.parseInt;
|
1073
1034
|
var hex = /^[+-]?0[Xx]/;
|
1074
|
-
var FORCED$
|
1035
|
+
var FORCED$1 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
|
1075
1036
|
|
1076
1037
|
// `parseInt` method
|
1077
1038
|
// https://tc39.github.io/ecma262/#sec-parseint-string-radix
|
1078
|
-
var _parseInt = FORCED$
|
1039
|
+
var _parseInt = FORCED$1 ? function parseInt(string, radix) {
|
1079
1040
|
var S = trim(String(string));
|
1080
1041
|
return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
|
1081
1042
|
} : nativeParseInt;
|
@@ -1271,6 +1232,255 @@
|
|
1271
1232
|
}
|
1272
1233
|
});
|
1273
1234
|
|
1235
|
+
var non = '\u200B\u0085\u180E';
|
1236
|
+
|
1237
|
+
// check that a method works with the correct list
|
1238
|
+
// of whitespaces and has a correct name
|
1239
|
+
var forcedStringTrimMethod = function (METHOD_NAME) {
|
1240
|
+
return fails(function () {
|
1241
|
+
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
1242
|
+
});
|
1243
|
+
};
|
1244
|
+
|
1245
|
+
var $trim = stringTrim.trim;
|
1246
|
+
|
1247
|
+
|
1248
|
+
// `String.prototype.trim` method
|
1249
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
1250
|
+
_export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
1251
|
+
trim: function trim() {
|
1252
|
+
return $trim(this);
|
1253
|
+
}
|
1254
|
+
});
|
1255
|
+
|
1256
|
+
// iterable DOM collections
|
1257
|
+
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
1258
|
+
var domIterables = {
|
1259
|
+
CSSRuleList: 0,
|
1260
|
+
CSSStyleDeclaration: 0,
|
1261
|
+
CSSValueList: 0,
|
1262
|
+
ClientRectList: 0,
|
1263
|
+
DOMRectList: 0,
|
1264
|
+
DOMStringList: 0,
|
1265
|
+
DOMTokenList: 1,
|
1266
|
+
DataTransferItemList: 0,
|
1267
|
+
FileList: 0,
|
1268
|
+
HTMLAllCollection: 0,
|
1269
|
+
HTMLCollection: 0,
|
1270
|
+
HTMLFormElement: 0,
|
1271
|
+
HTMLSelectElement: 0,
|
1272
|
+
MediaList: 0,
|
1273
|
+
MimeTypeArray: 0,
|
1274
|
+
NamedNodeMap: 0,
|
1275
|
+
NodeList: 1,
|
1276
|
+
PaintRequestList: 0,
|
1277
|
+
Plugin: 0,
|
1278
|
+
PluginArray: 0,
|
1279
|
+
SVGLengthList: 0,
|
1280
|
+
SVGNumberList: 0,
|
1281
|
+
SVGPathSegList: 0,
|
1282
|
+
SVGPointList: 0,
|
1283
|
+
SVGStringList: 0,
|
1284
|
+
SVGTransformList: 0,
|
1285
|
+
SourceBufferList: 0,
|
1286
|
+
StyleSheetList: 0,
|
1287
|
+
TextTrackCueList: 0,
|
1288
|
+
TextTrackList: 0,
|
1289
|
+
TouchList: 0
|
1290
|
+
};
|
1291
|
+
|
1292
|
+
var $forEach = arrayIteration.forEach;
|
1293
|
+
|
1294
|
+
|
1295
|
+
// `Array.prototype.forEach` method implementation
|
1296
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
1297
|
+
var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
1298
|
+
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1299
|
+
} : [].forEach;
|
1300
|
+
|
1301
|
+
for (var COLLECTION_NAME in domIterables) {
|
1302
|
+
var Collection = global_1[COLLECTION_NAME];
|
1303
|
+
var CollectionPrototype = Collection && Collection.prototype;
|
1304
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
1305
|
+
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
1306
|
+
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
1307
|
+
} catch (error) {
|
1308
|
+
CollectionPrototype.forEach = arrayForEach;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
|
1312
|
+
function _typeof(obj) {
|
1313
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1314
|
+
_typeof = function (obj) {
|
1315
|
+
return typeof obj;
|
1316
|
+
};
|
1317
|
+
} else {
|
1318
|
+
_typeof = function (obj) {
|
1319
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1320
|
+
};
|
1321
|
+
}
|
1322
|
+
|
1323
|
+
return _typeof(obj);
|
1324
|
+
}
|
1325
|
+
|
1326
|
+
function _classCallCheck(instance, Constructor) {
|
1327
|
+
if (!(instance instanceof Constructor)) {
|
1328
|
+
throw new TypeError("Cannot call a class as a function");
|
1329
|
+
}
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
function _defineProperties(target, props) {
|
1333
|
+
for (var i = 0; i < props.length; i++) {
|
1334
|
+
var descriptor = props[i];
|
1335
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
1336
|
+
descriptor.configurable = true;
|
1337
|
+
if ("value" in descriptor) descriptor.writable = true;
|
1338
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
1339
|
+
}
|
1340
|
+
}
|
1341
|
+
|
1342
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
1343
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1344
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
1345
|
+
return Constructor;
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
function _inherits(subClass, superClass) {
|
1349
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
1350
|
+
throw new TypeError("Super expression must either be null or a function");
|
1351
|
+
}
|
1352
|
+
|
1353
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1354
|
+
constructor: {
|
1355
|
+
value: subClass,
|
1356
|
+
writable: true,
|
1357
|
+
configurable: true
|
1358
|
+
}
|
1359
|
+
});
|
1360
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
function _getPrototypeOf(o) {
|
1364
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1365
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
1366
|
+
};
|
1367
|
+
return _getPrototypeOf(o);
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
function _setPrototypeOf(o, p) {
|
1371
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1372
|
+
o.__proto__ = p;
|
1373
|
+
return o;
|
1374
|
+
};
|
1375
|
+
|
1376
|
+
return _setPrototypeOf(o, p);
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
function _assertThisInitialized(self) {
|
1380
|
+
if (self === void 0) {
|
1381
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
return self;
|
1385
|
+
}
|
1386
|
+
|
1387
|
+
function _possibleConstructorReturn(self, call) {
|
1388
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
1389
|
+
return call;
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
return _assertThisInitialized(self);
|
1393
|
+
}
|
1394
|
+
|
1395
|
+
function _superPropBase(object, property) {
|
1396
|
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1397
|
+
object = _getPrototypeOf(object);
|
1398
|
+
if (object === null) break;
|
1399
|
+
}
|
1400
|
+
|
1401
|
+
return object;
|
1402
|
+
}
|
1403
|
+
|
1404
|
+
function _get(target, property, receiver) {
|
1405
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
1406
|
+
_get = Reflect.get;
|
1407
|
+
} else {
|
1408
|
+
_get = function _get(target, property, receiver) {
|
1409
|
+
var base = _superPropBase(target, property);
|
1410
|
+
|
1411
|
+
if (!base) return;
|
1412
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
1413
|
+
|
1414
|
+
if (desc.get) {
|
1415
|
+
return desc.get.call(receiver);
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
return desc.value;
|
1419
|
+
};
|
1420
|
+
}
|
1421
|
+
|
1422
|
+
return _get(target, property, receiver || target);
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
function _toConsumableArray(arr) {
|
1426
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
1427
|
+
}
|
1428
|
+
|
1429
|
+
function _arrayWithoutHoles(arr) {
|
1430
|
+
if (Array.isArray(arr)) {
|
1431
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
1432
|
+
|
1433
|
+
return arr2;
|
1434
|
+
}
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
function _iterableToArray(iter) {
|
1438
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
1439
|
+
}
|
1440
|
+
|
1441
|
+
function _nonIterableSpread() {
|
1442
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
1443
|
+
}
|
1444
|
+
|
1445
|
+
var nativeJoin = [].join;
|
1446
|
+
|
1447
|
+
var ES3_STRINGS = indexedObject != Object;
|
1448
|
+
var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
|
1449
|
+
|
1450
|
+
// `Array.prototype.join` method
|
1451
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.join
|
1452
|
+
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
|
1453
|
+
join: function join(separator) {
|
1454
|
+
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
1455
|
+
}
|
1456
|
+
});
|
1457
|
+
|
1458
|
+
var test$1 = [];
|
1459
|
+
var nativeSort = test$1.sort;
|
1460
|
+
|
1461
|
+
// IE8-
|
1462
|
+
var FAILS_ON_UNDEFINED = fails(function () {
|
1463
|
+
test$1.sort(undefined);
|
1464
|
+
});
|
1465
|
+
// V8 bug
|
1466
|
+
var FAILS_ON_NULL = fails(function () {
|
1467
|
+
test$1.sort(null);
|
1468
|
+
});
|
1469
|
+
// Old WebKit
|
1470
|
+
var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
|
1471
|
+
|
1472
|
+
var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
|
1473
|
+
|
1474
|
+
// `Array.prototype.sort` method
|
1475
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.sort
|
1476
|
+
_export({ target: 'Array', proto: true, forced: FORCED$2 }, {
|
1477
|
+
sort: function sort(comparefn) {
|
1478
|
+
return comparefn === undefined
|
1479
|
+
? nativeSort.call(toObject(this))
|
1480
|
+
: nativeSort.call(toObject(this), aFunction$1(comparefn));
|
1481
|
+
}
|
1482
|
+
});
|
1483
|
+
|
1274
1484
|
var SPECIES$2 = wellKnownSymbol('species');
|
1275
1485
|
|
1276
1486
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
@@ -1713,681 +1923,527 @@
|
|
1713
1923
|
];
|
1714
1924
|
}, !SUPPORTS_Y);
|
1715
1925
|
|
1716
|
-
var
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
};
|
1725
|
-
|
1726
|
-
var $trim = stringTrim.trim;
|
1727
|
-
|
1728
|
-
|
1729
|
-
// `String.prototype.trim` method
|
1730
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
1731
|
-
_export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
1732
|
-
trim: function trim() {
|
1733
|
-
return $trim(this);
|
1734
|
-
}
|
1735
|
-
});
|
1736
|
-
|
1737
|
-
// iterable DOM collections
|
1738
|
-
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
1739
|
-
var domIterables = {
|
1740
|
-
CSSRuleList: 0,
|
1741
|
-
CSSStyleDeclaration: 0,
|
1742
|
-
CSSValueList: 0,
|
1743
|
-
ClientRectList: 0,
|
1744
|
-
DOMRectList: 0,
|
1745
|
-
DOMStringList: 0,
|
1746
|
-
DOMTokenList: 1,
|
1747
|
-
DataTransferItemList: 0,
|
1748
|
-
FileList: 0,
|
1749
|
-
HTMLAllCollection: 0,
|
1750
|
-
HTMLCollection: 0,
|
1751
|
-
HTMLFormElement: 0,
|
1752
|
-
HTMLSelectElement: 0,
|
1753
|
-
MediaList: 0,
|
1754
|
-
MimeTypeArray: 0,
|
1755
|
-
NamedNodeMap: 0,
|
1756
|
-
NodeList: 1,
|
1757
|
-
PaintRequestList: 0,
|
1758
|
-
Plugin: 0,
|
1759
|
-
PluginArray: 0,
|
1760
|
-
SVGLengthList: 0,
|
1761
|
-
SVGNumberList: 0,
|
1762
|
-
SVGPathSegList: 0,
|
1763
|
-
SVGPointList: 0,
|
1764
|
-
SVGStringList: 0,
|
1765
|
-
SVGTransformList: 0,
|
1766
|
-
SourceBufferList: 0,
|
1767
|
-
StyleSheetList: 0,
|
1768
|
-
TextTrackCueList: 0,
|
1769
|
-
TextTrackList: 0,
|
1770
|
-
TouchList: 0
|
1771
|
-
};
|
1772
|
-
|
1773
|
-
var $forEach = arrayIteration.forEach;
|
1774
|
-
|
1775
|
-
|
1776
|
-
// `Array.prototype.forEach` method implementation
|
1777
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
1778
|
-
var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
1779
|
-
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1780
|
-
} : [].forEach;
|
1781
|
-
|
1782
|
-
for (var COLLECTION_NAME in domIterables) {
|
1783
|
-
var Collection = global_1[COLLECTION_NAME];
|
1784
|
-
var CollectionPrototype = Collection && Collection.prototype;
|
1785
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
1786
|
-
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
1787
|
-
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
1788
|
-
} catch (error) {
|
1789
|
-
CollectionPrototype.forEach = arrayForEach;
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
|
1793
|
-
function _typeof(obj) {
|
1794
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1795
|
-
_typeof = function (obj) {
|
1796
|
-
return typeof obj;
|
1797
|
-
};
|
1798
|
-
} else {
|
1799
|
-
_typeof = function (obj) {
|
1800
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1801
|
-
};
|
1802
|
-
}
|
1803
|
-
|
1804
|
-
return _typeof(obj);
|
1805
|
-
}
|
1806
|
-
|
1807
|
-
function _classCallCheck(instance, Constructor) {
|
1808
|
-
if (!(instance instanceof Constructor)) {
|
1809
|
-
throw new TypeError("Cannot call a class as a function");
|
1810
|
-
}
|
1811
|
-
}
|
1812
|
-
|
1813
|
-
function _defineProperties(target, props) {
|
1814
|
-
for (var i = 0; i < props.length; i++) {
|
1815
|
-
var descriptor = props[i];
|
1816
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
1817
|
-
descriptor.configurable = true;
|
1818
|
-
if ("value" in descriptor) descriptor.writable = true;
|
1819
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
1820
|
-
}
|
1821
|
-
}
|
1822
|
-
|
1823
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
1824
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1825
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
1826
|
-
return Constructor;
|
1827
|
-
}
|
1828
|
-
|
1829
|
-
function _inherits(subClass, superClass) {
|
1830
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
1831
|
-
throw new TypeError("Super expression must either be null or a function");
|
1832
|
-
}
|
1833
|
-
|
1834
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1835
|
-
constructor: {
|
1836
|
-
value: subClass,
|
1837
|
-
writable: true,
|
1838
|
-
configurable: true
|
1839
|
-
}
|
1840
|
-
});
|
1841
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
1842
|
-
}
|
1843
|
-
|
1844
|
-
function _getPrototypeOf(o) {
|
1845
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1846
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
1847
|
-
};
|
1848
|
-
return _getPrototypeOf(o);
|
1849
|
-
}
|
1850
|
-
|
1851
|
-
function _setPrototypeOf(o, p) {
|
1852
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1853
|
-
o.__proto__ = p;
|
1854
|
-
return o;
|
1855
|
-
};
|
1856
|
-
|
1857
|
-
return _setPrototypeOf(o, p);
|
1858
|
-
}
|
1859
|
-
|
1860
|
-
function _assertThisInitialized(self) {
|
1861
|
-
if (self === void 0) {
|
1862
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1863
|
-
}
|
1864
|
-
|
1865
|
-
return self;
|
1866
|
-
}
|
1867
|
-
|
1868
|
-
function _possibleConstructorReturn(self, call) {
|
1869
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
1870
|
-
return call;
|
1871
|
-
}
|
1872
|
-
|
1873
|
-
return _assertThisInitialized(self);
|
1874
|
-
}
|
1875
|
-
|
1876
|
-
function _superPropBase(object, property) {
|
1877
|
-
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1878
|
-
object = _getPrototypeOf(object);
|
1879
|
-
if (object === null) break;
|
1926
|
+
var Utils = $.fn.bootstrapTable.utils;
|
1927
|
+
var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
|
1928
|
+
function getOptionsFromSelectControl(selectControl) {
|
1929
|
+
return selectControl.get(selectControl.length - 1).options;
|
1930
|
+
}
|
1931
|
+
function getControlContainer(that) {
|
1932
|
+
if (that.options.filterControlContainer) {
|
1933
|
+
return $("".concat(that.options.filterControlContainer));
|
1880
1934
|
}
|
1881
1935
|
|
1882
|
-
return
|
1936
|
+
return that.$header;
|
1883
1937
|
}
|
1938
|
+
function getSearchControls(that) {
|
1939
|
+
return getControlContainer(that).find(searchControls);
|
1940
|
+
}
|
1941
|
+
function hideUnusedSelectOptions(selectControl, uniqueValues) {
|
1942
|
+
var options = getOptionsFromSelectControl(selectControl);
|
1884
1943
|
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
if (!base) return;
|
1893
|
-
var desc = Object.getOwnPropertyDescriptor(base, property);
|
1894
|
-
|
1895
|
-
if (desc.get) {
|
1896
|
-
return desc.get.call(receiver);
|
1944
|
+
for (var i = 0; i < options.length; i++) {
|
1945
|
+
if (options[i].value !== '') {
|
1946
|
+
if (!uniqueValues.hasOwnProperty(options[i].value)) {
|
1947
|
+
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
|
1948
|
+
} else {
|
1949
|
+
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
|
1897
1950
|
}
|
1898
|
-
|
1899
|
-
return desc.value;
|
1900
|
-
};
|
1951
|
+
}
|
1901
1952
|
}
|
1902
|
-
|
1903
|
-
return _get(target, property, receiver || target);
|
1904
1953
|
}
|
1954
|
+
function existOptionInSelectControl(selectControl, value) {
|
1955
|
+
var options = getOptionsFromSelectControl(selectControl);
|
1905
1956
|
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
*/
|
1911
|
-
|
1912
|
-
var Utils = $.fn.bootstrapTable.utils;
|
1913
|
-
var UtilsFilterControl = {
|
1914
|
-
getOptionsFromSelectControl: function getOptionsFromSelectControl(selectControl) {
|
1915
|
-
return selectControl.get(selectControl.length - 1).options;
|
1916
|
-
},
|
1917
|
-
getControlContainer: function getControlContainer() {
|
1918
|
-
if (UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer) {
|
1919
|
-
return $("".concat(UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer));
|
1957
|
+
for (var i = 0; i < options.length; i++) {
|
1958
|
+
if (options[i].value === value.toString()) {
|
1959
|
+
// The value is not valid to add
|
1960
|
+
return true;
|
1920
1961
|
}
|
1962
|
+
} // If we get here, the value is valid to add
|
1921
1963
|
|
1922
|
-
return UtilsFilterControl.getCurrentHeader(UtilsFilterControl.bootstrapTableInstance);
|
1923
|
-
},
|
1924
|
-
getSearchControls: function getSearchControls(scope) {
|
1925
|
-
var header = UtilsFilterControl.getControlContainer();
|
1926
|
-
var searchControls = UtilsFilterControl.getCurrentSearchControls(scope);
|
1927
|
-
return header.find(searchControls);
|
1928
|
-
},
|
1929
|
-
hideUnusedSelectOptions: function hideUnusedSelectOptions(selectControl, uniqueValues) {
|
1930
|
-
var options = UtilsFilterControl.getOptionsFromSelectControl(selectControl);
|
1931
|
-
|
1932
|
-
for (var i = 0; i < options.length; i++) {
|
1933
|
-
if (options[i].value !== '') {
|
1934
|
-
if (!uniqueValues.hasOwnProperty(options[i].value)) {
|
1935
|
-
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
|
1936
|
-
} else {
|
1937
|
-
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
|
1938
|
-
}
|
1939
|
-
}
|
1940
|
-
}
|
1941
|
-
},
|
1942
|
-
addOptionToSelectControl: function addOptionToSelectControl(selectControl, _value, text, selected) {
|
1943
|
-
var value = $.trim(_value);
|
1944
|
-
var $selectControl = $(selectControl.get(selectControl.length - 1));
|
1945
1964
|
|
1946
|
-
|
1947
|
-
|
1965
|
+
return false;
|
1966
|
+
}
|
1967
|
+
function addOptionToSelectControl(selectControl, _value, text, selected) {
|
1968
|
+
var value = _value === undefined || _value === null ? '' : _value.toString().trim();
|
1969
|
+
var $selectControl = $(selectControl.get(selectControl.length - 1));
|
1948
1970
|
|
1949
|
-
|
1950
|
-
|
1951
|
-
}
|
1971
|
+
if (!existOptionInSelectControl(selectControl, value)) {
|
1972
|
+
var option = $("<option value=\"".concat(value, "\">").concat(text, "</option>"));
|
1952
1973
|
|
1953
|
-
|
1974
|
+
if (value === selected) {
|
1975
|
+
option.attr('selected', true);
|
1954
1976
|
}
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1977
|
+
|
1978
|
+
$selectControl.append(option);
|
1979
|
+
}
|
1980
|
+
}
|
1981
|
+
function sortSelectControl(selectControl, orderBy) {
|
1982
|
+
var $selectControl = $(selectControl.get(selectControl.length - 1));
|
1983
|
+
var $opts = $selectControl.find('option:gt(0)');
|
1984
|
+
|
1985
|
+
if (orderBy !== 'server') {
|
1959
1986
|
$opts.sort(function (a, b) {
|
1960
1987
|
return Utils.sort(a.textContent, b.textContent, orderBy === 'desc' ? -1 : 1);
|
1961
1988
|
});
|
1962
|
-
|
1963
|
-
$selectControl.append($opts);
|
1964
|
-
},
|
1965
|
-
existOptionInSelectControl: function existOptionInSelectControl(selectControl, value) {
|
1966
|
-
var options = UtilsFilterControl.getOptionsFromSelectControl(selectControl);
|
1989
|
+
}
|
1967
1990
|
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1991
|
+
$selectControl.find('option:gt(0)').remove();
|
1992
|
+
$selectControl.append($opts);
|
1993
|
+
}
|
1994
|
+
function fixHeaderCSS(_ref) {
|
1995
|
+
var $tableHeader = _ref.$tableHeader;
|
1996
|
+
$tableHeader.css('height', '89px');
|
1997
|
+
}
|
1998
|
+
function getElementClass($element) {
|
1999
|
+
return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
|
2000
|
+
}
|
2001
|
+
function getCursorPosition(el) {
|
2002
|
+
if (Utils.isIEBrowser()) {
|
2003
|
+
if ($(el).is('input[type=text]')) {
|
2004
|
+
var pos = 0;
|
2005
|
+
|
2006
|
+
if ('selectionStart' in el) {
|
2007
|
+
pos = el.selectionStart;
|
2008
|
+
} else if ('selection' in document) {
|
2009
|
+
el.focus();
|
2010
|
+
var Sel = document.selection.createRange();
|
2011
|
+
var SelLength = document.selection.createRange().text.length;
|
2012
|
+
Sel.moveStart('character', -el.value.length);
|
2013
|
+
pos = Sel.text.length - SelLength;
|
1972
2014
|
}
|
1973
|
-
} // If we get here, the value is valid to add
|
1974
|
-
|
1975
|
-
|
1976
|
-
return false;
|
1977
|
-
},
|
1978
|
-
fixHeaderCSS: function fixHeaderCSS(_ref) {
|
1979
|
-
var $tableHeader = _ref.$tableHeader;
|
1980
|
-
$tableHeader.css('height', '77px');
|
1981
|
-
},
|
1982
|
-
getCurrentHeader: function getCurrentHeader(_ref2) {
|
1983
|
-
var $header = _ref2.$header,
|
1984
|
-
options = _ref2.options,
|
1985
|
-
$tableHeader = _ref2.$tableHeader;
|
1986
|
-
var header = $header;
|
1987
|
-
|
1988
|
-
if (options.height) {
|
1989
|
-
header = $tableHeader;
|
1990
|
-
}
|
1991
|
-
|
1992
|
-
return header;
|
1993
|
-
},
|
1994
|
-
getCurrentSearchControls: function getCurrentSearchControls(_ref3) {
|
1995
|
-
var options = _ref3.options;
|
1996
|
-
var searchControls = 'select, input';
|
1997
2015
|
|
1998
|
-
|
1999
|
-
searchControls = 'table select, table input';
|
2016
|
+
return pos;
|
2000
2017
|
}
|
2001
2018
|
|
2002
|
-
return
|
2003
|
-
}
|
2004
|
-
getCursorPosition: function getCursorPosition(el) {
|
2005
|
-
if (Utils.isIEBrowser()) {
|
2006
|
-
if ($(el).is('input[type=text]')) {
|
2007
|
-
var pos = 0;
|
2008
|
-
|
2009
|
-
if ('selectionStart' in el) {
|
2010
|
-
pos = el.selectionStart;
|
2011
|
-
} else if ('selection' in document) {
|
2012
|
-
el.focus();
|
2013
|
-
var Sel = document.selection.createRange();
|
2014
|
-
var SelLength = document.selection.createRange().text.length;
|
2015
|
-
Sel.moveStart('character', -el.value.length);
|
2016
|
-
pos = Sel.text.length - SelLength;
|
2017
|
-
}
|
2018
|
-
|
2019
|
-
return pos;
|
2020
|
-
}
|
2019
|
+
return -1;
|
2020
|
+
}
|
2021
2021
|
|
2022
|
-
|
2022
|
+
return -1;
|
2023
|
+
}
|
2024
|
+
function setCursorPosition(el) {
|
2025
|
+
$(el).val(el.value);
|
2026
|
+
}
|
2027
|
+
function copyValues(that) {
|
2028
|
+
var searchControls = getSearchControls(that);
|
2029
|
+
that.options.valuesFilterControl = [];
|
2030
|
+
searchControls.each(function () {
|
2031
|
+
var $field = $(this);
|
2032
|
+
|
2033
|
+
if (that.options.height) {
|
2034
|
+
var fieldClass = getElementClass($field);
|
2035
|
+
$field = $(".fixed-table-header .".concat(fieldClass));
|
2023
2036
|
}
|
2024
2037
|
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
copyValues: function copyValues(that) {
|
2031
|
-
var searchControls = UtilsFilterControl.getSearchControls(that);
|
2032
|
-
that.options.valuesFilterControl = [];
|
2033
|
-
searchControls.each(function () {
|
2034
|
-
that.options.valuesFilterControl.push({
|
2035
|
-
field: $(this).closest('[data-field]').data('field'),
|
2036
|
-
value: $(this).val(),
|
2037
|
-
position: UtilsFilterControl.getCursorPosition($(this).get(0)),
|
2038
|
-
hasFocus: $(this).is(':focus')
|
2039
|
-
});
|
2038
|
+
that.options.valuesFilterControl.push({
|
2039
|
+
field: $field.closest('[data-field]').data('field'),
|
2040
|
+
value: $field.val(),
|
2041
|
+
position: getCursorPosition($field.get(0)),
|
2042
|
+
hasFocus: $field.is(':focus')
|
2040
2043
|
});
|
2041
|
-
}
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2044
|
+
});
|
2045
|
+
}
|
2046
|
+
function setValues(that) {
|
2047
|
+
var field = null;
|
2048
|
+
var result = [];
|
2049
|
+
var searchControls = getSearchControls(that);
|
2050
|
+
|
2051
|
+
if (that.options.valuesFilterControl.length > 0) {
|
2052
|
+
// Callback to apply after settings fields values
|
2053
|
+
var fieldToFocusCallback = null;
|
2054
|
+
searchControls.each(function (index, ele) {
|
2055
|
+
var $this = $(this);
|
2056
|
+
field = $this.closest('[data-field]').data('field');
|
2057
|
+
result = that.options.valuesFilterControl.filter(function (valueObj) {
|
2058
|
+
return valueObj.field === field;
|
2059
|
+
});
|
2055
2060
|
|
2056
|
-
|
2057
|
-
|
2061
|
+
if (result.length > 0) {
|
2062
|
+
if ($this.is('[type=radio]')) {
|
2063
|
+
return;
|
2064
|
+
}
|
2058
2065
|
|
2059
|
-
|
2060
|
-
// set callback if the field had the focus.
|
2061
|
-
fieldToFocusCallback = function (fieldToFocus, carretPosition) {
|
2062
|
-
// Closure here to capture the field and cursor position
|
2063
|
-
var closedCallback = function closedCallback() {
|
2064
|
-
fieldToFocus.focus();
|
2065
|
-
UtilsFilterControl.setCursorPosition(fieldToFocus, carretPosition);
|
2066
|
-
};
|
2066
|
+
$this.val(result[0].value);
|
2067
2067
|
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2068
|
+
if (result[0].hasFocus && result[0].value !== '') {
|
2069
|
+
// set callback if the field had the focus.
|
2070
|
+
fieldToFocusCallback = function (fieldToFocus, carretPosition) {
|
2071
|
+
// Closure here to capture the field and cursor position
|
2072
|
+
var closedCallback = function closedCallback() {
|
2073
|
+
fieldToFocus.focus();
|
2074
|
+
setCursorPosition(fieldToFocus);
|
2075
|
+
};
|
2073
2076
|
|
2074
|
-
|
2075
|
-
|
2077
|
+
return closedCallback;
|
2078
|
+
}($this.get(0), result[0].position);
|
2079
|
+
}
|
2076
2080
|
}
|
2081
|
+
}); // Callback call.
|
2082
|
+
|
2083
|
+
if (fieldToFocusCallback !== null) {
|
2084
|
+
fieldToFocusCallback();
|
2077
2085
|
}
|
2078
|
-
}
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2086
|
+
}
|
2087
|
+
}
|
2088
|
+
function collectBootstrapCookies() {
|
2089
|
+
var cookies = [];
|
2090
|
+
var foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
|
2091
|
+
var foundLocalStorage = localStorage;
|
2083
2092
|
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2093
|
+
if (foundCookies) {
|
2094
|
+
$.each(foundCookies, function (i, _cookie) {
|
2095
|
+
var cookie = _cookie;
|
2087
2096
|
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2097
|
+
if (/./.test(cookie)) {
|
2098
|
+
cookie = cookie.split('.').pop();
|
2099
|
+
}
|
2091
2100
|
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2101
|
+
if ($.inArray(cookie, cookies) === -1) {
|
2102
|
+
cookies.push(cookie);
|
2103
|
+
}
|
2104
|
+
});
|
2105
|
+
}
|
2097
2106
|
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2107
|
+
if (foundLocalStorage) {
|
2108
|
+
for (var i = 0; i < foundLocalStorage.length; i++) {
|
2109
|
+
var cookie = foundLocalStorage.key(i);
|
2101
2110
|
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2111
|
+
if (/./.test(cookie)) {
|
2112
|
+
cookie = cookie.split('.').pop();
|
2113
|
+
}
|
2105
2114
|
|
2106
|
-
|
2107
|
-
|
2108
|
-
}
|
2115
|
+
if (!cookies.includes(cookie)) {
|
2116
|
+
cookies.push(cookie);
|
2109
2117
|
}
|
2110
2118
|
}
|
2119
|
+
}
|
2111
2120
|
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2121
|
+
return cookies;
|
2122
|
+
}
|
2123
|
+
function escapeID(id) {
|
2124
|
+
// eslint-disable-next-line no-useless-escape
|
2125
|
+
return String(id).replace(/([:.\[\],])/g, '\\$1');
|
2126
|
+
}
|
2127
|
+
function isColumnSearchableViaSelect(_ref2) {
|
2128
|
+
var filterControl = _ref2.filterControl,
|
2129
|
+
searchable = _ref2.searchable;
|
2130
|
+
return filterControl && filterControl.toLowerCase() === 'select' && searchable;
|
2131
|
+
}
|
2132
|
+
function isFilterDataNotGiven(_ref3) {
|
2133
|
+
var filterData = _ref3.filterData;
|
2134
|
+
return filterData === undefined || filterData.toLowerCase() === 'column';
|
2135
|
+
}
|
2136
|
+
function hasSelectControlElement(selectControl) {
|
2137
|
+
return selectControl && selectControl.length > 0;
|
2138
|
+
}
|
2139
|
+
function initFilterSelectControls(that) {
|
2140
|
+
var data = that.data;
|
2141
|
+
var z = that.options.pagination ? that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows : that.pageTo;
|
2142
|
+
$.each(that.header.fields, function (j, field) {
|
2143
|
+
var column = that.columns[that.fieldsColumnsIndex[field]];
|
2144
|
+
var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
2145
|
+
|
2146
|
+
if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
|
2147
|
+
if (selectControl.get(selectControl.length - 1).options.length === 0) {
|
2148
|
+
// Added the default option
|
2149
|
+
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
|
2150
|
+
}
|
2142
2151
|
|
2143
|
-
|
2152
|
+
var uniqueValues = {};
|
2144
2153
|
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2154
|
+
for (var i = 0; i < z; i++) {
|
2155
|
+
// Added a new value
|
2156
|
+
var fieldValue = data[i][field];
|
2157
|
+
var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
|
2158
|
+
var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
|
2150
2159
|
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2160
|
+
if (column.filterDataCollector) {
|
2161
|
+
formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
|
2162
|
+
}
|
2154
2163
|
|
2155
|
-
|
2164
|
+
if (column.searchFormatter) {
|
2165
|
+
fieldValue = formattedValue;
|
2166
|
+
}
|
2156
2167
|
|
2157
|
-
|
2158
|
-
formattedValue.forEach(function (value) {
|
2159
|
-
UtilsFilterControl.addOptionToSelectControl(selectControl, value, value, column.filterDefault);
|
2160
|
-
});
|
2161
|
-
continue;
|
2162
|
-
}
|
2168
|
+
uniqueValues[formattedValue] = fieldValue;
|
2163
2169
|
|
2164
|
-
|
2170
|
+
if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
|
2171
|
+
formattedValue.forEach(function (value) {
|
2172
|
+
addOptionToSelectControl(selectControl, value, value, column.filterDefault);
|
2173
|
+
});
|
2174
|
+
continue;
|
2165
2175
|
}
|
2166
2176
|
|
2167
|
-
|
2168
|
-
|
2169
|
-
if (that.options.hideUnusedSelectOptions) {
|
2170
|
-
UtilsFilterControl.hideUnusedSelectOptions(selectControl, uniqueValues);
|
2177
|
+
for (var key in uniqueValues) {
|
2178
|
+
addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
|
2171
2179
|
}
|
2172
2180
|
}
|
2173
|
-
});
|
2174
|
-
that.trigger('created-controls');
|
2175
|
-
},
|
2176
|
-
getFilterDataMethod: function getFilterDataMethod(objFilterDataMethod, searchTerm) {
|
2177
|
-
var keys = Object.keys(objFilterDataMethod);
|
2178
2181
|
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
+
sortSelectControl(selectControl, column.filterOrderBy);
|
2183
|
+
|
2184
|
+
if (that.options.hideUnusedSelectOptions) {
|
2185
|
+
hideUnusedSelectOptions(selectControl, uniqueValues);
|
2182
2186
|
}
|
2183
2187
|
}
|
2188
|
+
});
|
2189
|
+
}
|
2190
|
+
function getFilterDataMethod(objFilterDataMethod, searchTerm) {
|
2191
|
+
var keys = Object.keys(objFilterDataMethod);
|
2184
2192
|
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2188
|
-
|
2189
|
-
|
2190
|
-
$.each(that.columns, function (i, column) {
|
2191
|
-
html = [];
|
2193
|
+
for (var i = 0; i < keys.length; i++) {
|
2194
|
+
if (keys[i] === searchTerm) {
|
2195
|
+
return objFilterDataMethod[searchTerm];
|
2196
|
+
}
|
2197
|
+
}
|
2192
2198
|
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2199
|
+
return null;
|
2200
|
+
}
|
2201
|
+
function createControls(that, header) {
|
2202
|
+
var addedFilterControl = false;
|
2203
|
+
var html;
|
2204
|
+
$.each(that.columns, function (_, column) {
|
2205
|
+
html = [];
|
2206
|
+
|
2207
|
+
if (!column.visible) {
|
2208
|
+
return;
|
2209
|
+
}
|
2196
2210
|
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
$filterControl
|
2203
|
-
$filterControl.val(column.filterDefault);
|
2204
|
-
$filterControl.attr('data-field', column.field);
|
2205
|
-
addedFilterControl = true;
|
2206
|
-
} else {
|
2207
|
-
var nameControl = column.filterControl.toLowerCase();
|
2208
|
-
html.push('<div class="filter-control">');
|
2209
|
-
addedFilterControl = true;
|
2211
|
+
if (!column.filterControl && !that.options.filterControlContainer) {
|
2212
|
+
html.push('<div class="no-filter-control"></div>');
|
2213
|
+
} else if (that.options.filterControlContainer) {
|
2214
|
+
var $filterControls = $(".bootstrap-table-filter-control-".concat(column.field));
|
2215
|
+
$.each($filterControls, function (_, filterControl) {
|
2216
|
+
var $filterControl = $(filterControl);
|
2210
2217
|
|
2211
|
-
if (
|
2212
|
-
|
2218
|
+
if (!$filterControl.is('[type=radio]')) {
|
2219
|
+
var placeholder = column.filterControlPlaceholder ? column.filterControlPlaceholder : '';
|
2220
|
+
$filterControl.attr('placeholder', placeholder).val(column.filterDefault);
|
2213
2221
|
}
|
2214
|
-
}
|
2215
2222
|
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2223
|
+
$filterControl.attr('data-field', column.field);
|
2224
|
+
});
|
2225
|
+
addedFilterControl = true;
|
2226
|
+
} else {
|
2227
|
+
var nameControl = column.filterControl.toLowerCase();
|
2228
|
+
html.push('<div class="filter-control">');
|
2229
|
+
addedFilterControl = true;
|
2220
2230
|
|
2221
|
-
|
2231
|
+
if (column.searchable && that.options.filterTemplate[nameControl]) {
|
2232
|
+
html.push(that.options.filterTemplate[nameControl](that, column.field, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
|
2222
2233
|
}
|
2234
|
+
}
|
2223
2235
|
|
2224
|
-
|
2225
|
-
|
2236
|
+
if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
|
2237
|
+
if ($.isEmptyObject(that.filterColumnsPartial)) {
|
2238
|
+
that.filterColumnsPartial = {};
|
2239
|
+
}
|
2226
2240
|
|
2227
|
-
|
2228
|
-
|
2229
|
-
return false;
|
2230
|
-
}
|
2231
|
-
});
|
2241
|
+
that.filterColumnsPartial[column.field] = column.filterDefault;
|
2242
|
+
}
|
2232
2243
|
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
if (filterDataType !== null) {
|
2241
|
-
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
|
2242
|
-
selectControl = UtilsFilterControl.getControlContainer().find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
|
2243
|
-
UtilsFilterControl.addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
|
2244
|
-
filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
|
2245
|
-
} else {
|
2246
|
-
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"}');
|
2247
|
-
}
|
2244
|
+
$.each(header.find('th'), function (i, th) {
|
2245
|
+
var $th = $(th);
|
2246
|
+
|
2247
|
+
if ($th.data('field') === column.field) {
|
2248
|
+
$th.find('.fht-cell').append(html.join(''));
|
2249
|
+
return false;
|
2248
2250
|
}
|
2249
2251
|
});
|
2250
2252
|
|
2251
|
-
if (
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2253
|
+
if (column.filterData && column.filterData.toLowerCase() !== 'column') {
|
2254
|
+
var filterDataType = getFilterDataMethod(
|
2255
|
+
/* eslint-disable no-use-before-define */
|
2256
|
+
filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
|
2257
|
+
var filterDataSource;
|
2258
|
+
var selectControl;
|
2259
|
+
|
2260
|
+
if (filterDataType) {
|
2261
|
+
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
|
2262
|
+
selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
2263
|
+
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
|
2264
|
+
filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
|
2265
|
+
} else {
|
2266
|
+
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"}');
|
2267
|
+
}
|
2268
|
+
}
|
2269
|
+
});
|
2257
2270
|
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2271
|
+
if (addedFilterControl) {
|
2272
|
+
header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
|
2273
|
+
var currentTarget = _ref4.currentTarget,
|
2274
|
+
keyCode = _ref4.keyCode;
|
2275
|
+
syncControls(that); // Simulate enter key action from clear button
|
2261
2276
|
|
2262
|
-
|
2263
|
-
return;
|
2264
|
-
}
|
2277
|
+
keyCode = obj ? obj.keyCode : keyCode;
|
2265
2278
|
|
2266
|
-
|
2279
|
+
if (that.options.searchOnEnterKey && keyCode !== 13) {
|
2280
|
+
return;
|
2281
|
+
}
|
2267
2282
|
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2283
|
+
if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
|
2284
|
+
return;
|
2285
|
+
}
|
2271
2286
|
|
2272
|
-
|
2273
|
-
currentTarget.timeoutId = setTimeout(function () {
|
2274
|
-
that.onColumnSearch({
|
2275
|
-
currentTarget: currentTarget,
|
2276
|
-
keyCode: keyCode
|
2277
|
-
});
|
2278
|
-
}, that.options.searchTimeOut);
|
2279
|
-
});
|
2280
|
-
UtilsFilterControl.getControlContainer().off('change', 'select').on('change', 'select', function (_ref7) {
|
2281
|
-
var currentTarget = _ref7.currentTarget,
|
2282
|
-
keyCode = _ref7.keyCode;
|
2287
|
+
var $currentTarget = $(currentTarget);
|
2283
2288
|
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2289
|
+
if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
|
2290
|
+
return;
|
2291
|
+
}
|
2287
2292
|
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2293
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2294
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2295
|
+
that.onColumnSearch({
|
2296
|
+
currentTarget: currentTarget,
|
2297
|
+
keyCode: keyCode
|
2298
|
+
});
|
2299
|
+
}, that.options.searchTimeOut);
|
2300
|
+
});
|
2301
|
+
header.off('change', 'select:not(".ms-offscreen")').on('change', 'select:not(".ms-offscreen")', function (_ref5) {
|
2302
|
+
var currentTarget = _ref5.currentTarget,
|
2303
|
+
keyCode = _ref5.keyCode;
|
2304
|
+
syncControls(that);
|
2305
|
+
var $select = $(currentTarget);
|
2306
|
+
var value = $select.val();
|
2307
|
+
|
2308
|
+
if (value && value.length > 0 && value.trim()) {
|
2309
|
+
$select.find('option[selected]').removeAttr('selected');
|
2310
|
+
$select.find('option[value="' + value + '"]').attr('selected', true);
|
2311
|
+
} else {
|
2312
|
+
$select.find('option[selected]').removeAttr('selected');
|
2313
|
+
}
|
2291
2314
|
|
2292
|
-
|
2293
|
-
|
2315
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2316
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2317
|
+
that.onColumnSearch({
|
2318
|
+
currentTarget: currentTarget,
|
2319
|
+
keyCode: keyCode
|
2320
|
+
});
|
2321
|
+
}, that.options.searchTimeOut);
|
2322
|
+
});
|
2323
|
+
header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
|
2324
|
+
var currentTarget = _ref6.currentTarget,
|
2325
|
+
keyCode = _ref6.keyCode;
|
2326
|
+
var $input = $(currentTarget);
|
2327
|
+
var oldValue = $input.val();
|
2294
2328
|
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
} else {
|
2299
|
-
$select.find('option[selected]').removeAttr('selected');
|
2300
|
-
}
|
2329
|
+
if (oldValue === '') {
|
2330
|
+
return;
|
2331
|
+
}
|
2301
2332
|
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
currentTarget: currentTarget,
|
2306
|
-
keyCode: keyCode
|
2307
|
-
});
|
2308
|
-
}, that.options.searchTimeOut);
|
2309
|
-
});
|
2310
|
-
header.off('mouseup', 'input').on('mouseup', 'input', function (_ref8) {
|
2311
|
-
var currentTarget = _ref8.currentTarget,
|
2312
|
-
keyCode = _ref8.keyCode;
|
2313
|
-
var $input = $(currentTarget);
|
2314
|
-
var oldValue = $input.val();
|
2333
|
+
setTimeout(function () {
|
2334
|
+
syncControls(that);
|
2335
|
+
var newValue = $input.val();
|
2315
2336
|
|
2316
|
-
if (
|
2317
|
-
|
2337
|
+
if (newValue === '') {
|
2338
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2339
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2340
|
+
that.onColumnSearch({
|
2341
|
+
currentTarget: currentTarget,
|
2342
|
+
keyCode: keyCode
|
2343
|
+
});
|
2344
|
+
}, that.options.searchTimeOut);
|
2318
2345
|
}
|
2346
|
+
}, 1);
|
2347
|
+
});
|
2348
|
+
header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
|
2349
|
+
var currentTarget = _ref7.currentTarget,
|
2350
|
+
keyCode = _ref7.keyCode;
|
2351
|
+
clearTimeout(currentTarget.timeoutId || 0);
|
2352
|
+
currentTarget.timeoutId = setTimeout(function () {
|
2353
|
+
syncControls(that);
|
2354
|
+
that.onColumnSearch({
|
2355
|
+
currentTarget: currentTarget,
|
2356
|
+
keyCode: keyCode
|
2357
|
+
});
|
2358
|
+
}, that.options.searchTimeOut);
|
2359
|
+
});
|
2319
2360
|
|
2320
|
-
|
2321
|
-
|
2361
|
+
if (header.find('.date-filter-control').length > 0) {
|
2362
|
+
$.each(that.columns, function (i, _ref8) {
|
2363
|
+
var filterControl = _ref8.filterControl,
|
2364
|
+
field = _ref8.field,
|
2365
|
+
filterDatepickerOptions = _ref8.filterDatepickerOptions;
|
2322
2366
|
|
2323
|
-
|
2367
|
+
if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
|
2368
|
+
header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field)).datepicker(filterDatepickerOptions).on('changeDate', function (_ref9) {
|
2369
|
+
var currentTarget = _ref9.currentTarget,
|
2370
|
+
keyCode = _ref9.keyCode;
|
2324
2371
|
clearTimeout(currentTarget.timeoutId || 0);
|
2325
2372
|
currentTarget.timeoutId = setTimeout(function () {
|
2373
|
+
syncControls(that);
|
2326
2374
|
that.onColumnSearch({
|
2327
2375
|
currentTarget: currentTarget,
|
2328
2376
|
keyCode: keyCode
|
2329
2377
|
});
|
2330
2378
|
}, that.options.searchTimeOut);
|
2331
|
-
}
|
2332
|
-
}
|
2379
|
+
});
|
2380
|
+
}
|
2333
2381
|
});
|
2382
|
+
}
|
2334
2383
|
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
field = _ref9.field,
|
2339
|
-
filterDatepickerOptions = _ref9.filterDatepickerOptions;
|
2340
|
-
|
2341
|
-
if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
|
2342
|
-
UtilsFilterControl.getControlContainer().find(".date-filter-control.bootstrap-table-filter-control-".concat(field)).datepicker(filterDatepickerOptions).on('changeDate', function (_ref10) {
|
2343
|
-
var currentTarget = _ref10.currentTarget,
|
2344
|
-
keyCode = _ref10.keyCode;
|
2345
|
-
clearTimeout(currentTarget.timeoutId || 0);
|
2346
|
-
currentTarget.timeoutId = setTimeout(function () {
|
2347
|
-
that.onColumnSearch({
|
2348
|
-
currentTarget: currentTarget,
|
2349
|
-
keyCode: keyCode
|
2350
|
-
});
|
2351
|
-
}, that.options.searchTimeOut);
|
2352
|
-
});
|
2353
|
-
}
|
2354
|
-
});
|
2355
|
-
}
|
2384
|
+
if (that.options.sidePagination !== 'server' && !that.options.height) {
|
2385
|
+
that.triggerSearch();
|
2386
|
+
}
|
2356
2387
|
|
2357
|
-
|
2358
|
-
|
2359
|
-
}
|
2360
|
-
} else {
|
2361
|
-
UtilsFilterControl.getControlContainer().find('.filterControl').hide();
|
2388
|
+
if (!that.options.filterControlVisible) {
|
2389
|
+
header.find('.filter-control, .no-filter-control').hide();
|
2362
2390
|
}
|
2363
|
-
}
|
2364
|
-
|
2365
|
-
|
2391
|
+
} else {
|
2392
|
+
header.find('.filter-control, .no-filter-control').hide();
|
2393
|
+
}
|
2394
|
+
|
2395
|
+
that.trigger('created-controls');
|
2396
|
+
}
|
2397
|
+
function getDirectionOfSelectOptions(_alignment) {
|
2398
|
+
var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
|
2366
2399
|
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2400
|
+
switch (alignment) {
|
2401
|
+
case 'left':
|
2402
|
+
return 'ltr';
|
2370
2403
|
|
2371
|
-
|
2372
|
-
|
2404
|
+
case 'right':
|
2405
|
+
return 'rtl';
|
2373
2406
|
|
2374
|
-
|
2375
|
-
|
2407
|
+
case 'auto':
|
2408
|
+
return 'auto';
|
2376
2409
|
|
2377
|
-
|
2378
|
-
|
2379
|
-
}
|
2410
|
+
default:
|
2411
|
+
return 'ltr';
|
2380
2412
|
}
|
2381
|
-
}
|
2413
|
+
}
|
2414
|
+
function syncControls(that) {
|
2415
|
+
if (that.options.height) {
|
2416
|
+
var controlsTableHeader = that.$tableHeader.find(searchControls);
|
2417
|
+
that.$header.find(searchControls).each(function (_, control) {
|
2418
|
+
var $control = $(control);
|
2419
|
+
var controlClass = getElementClass($control);
|
2420
|
+
var foundControl = controlsTableHeader.filter(function (_, ele) {
|
2421
|
+
var eleClass = getElementClass($(ele));
|
2422
|
+
return controlClass === eleClass;
|
2423
|
+
});
|
2424
|
+
|
2425
|
+
if (foundControl.length === 0) {
|
2426
|
+
return;
|
2427
|
+
}
|
2428
|
+
|
2429
|
+
if ($control.is('select')) {
|
2430
|
+
$control.find('option:selected').removeAttr('selected');
|
2431
|
+
$control.find("option[value='".concat(foundControl.val(), "']")).attr('selected', true);
|
2432
|
+
} else {
|
2433
|
+
$control.val(foundControl.val());
|
2434
|
+
}
|
2435
|
+
});
|
2436
|
+
}
|
2437
|
+
}
|
2382
2438
|
var filterDataMethods = {
|
2383
2439
|
func: function func(filterDataSource, selectControl, filterOrderBy, selected) {
|
2384
2440
|
var variableValues = window[filterDataSource].apply();
|
2385
2441
|
|
2386
2442
|
for (var key in variableValues) {
|
2387
|
-
|
2443
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2388
2444
|
}
|
2389
2445
|
|
2390
|
-
|
2446
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2391
2447
|
},
|
2392
2448
|
obj: function obj(filterDataSource, selectControl, filterOrderBy, selected) {
|
2393
2449
|
var objectKeys = filterDataSource.split('.');
|
@@ -2401,19 +2457,24 @@
|
|
2401
2457
|
}
|
2402
2458
|
|
2403
2459
|
for (var key in variableValues) {
|
2404
|
-
|
2460
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2405
2461
|
}
|
2406
2462
|
|
2407
|
-
|
2463
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2408
2464
|
},
|
2409
2465
|
var: function _var(filterDataSource, selectControl, filterOrderBy, selected) {
|
2410
2466
|
var variableValues = window[filterDataSource];
|
2467
|
+
var isArray = Array.isArray(variableValues);
|
2411
2468
|
|
2412
2469
|
for (var key in variableValues) {
|
2413
|
-
|
2470
|
+
if (isArray) {
|
2471
|
+
addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected);
|
2472
|
+
} else {
|
2473
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2474
|
+
}
|
2414
2475
|
}
|
2415
2476
|
|
2416
|
-
|
2477
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2417
2478
|
},
|
2418
2479
|
url: function url(filterDataSource, selectControl, filterOrderBy, selected) {
|
2419
2480
|
$.ajax({
|
@@ -2421,10 +2482,10 @@
|
|
2421
2482
|
dataType: 'json',
|
2422
2483
|
success: function success(data) {
|
2423
2484
|
for (var key in data) {
|
2424
|
-
|
2485
|
+
addOptionToSelectControl(selectControl, key, data[key], selected);
|
2425
2486
|
}
|
2426
2487
|
|
2427
|
-
|
2488
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2428
2489
|
}
|
2429
2490
|
});
|
2430
2491
|
},
|
@@ -2432,40 +2493,45 @@
|
|
2432
2493
|
var variableValues = JSON.parse(filterDataSource);
|
2433
2494
|
|
2434
2495
|
for (var key in variableValues) {
|
2435
|
-
|
2496
|
+
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
2436
2497
|
}
|
2437
2498
|
|
2438
|
-
|
2499
|
+
sortSelectControl(selectControl, filterOrderBy);
|
2439
2500
|
}
|
2440
2501
|
};
|
2502
|
+
|
2503
|
+
var Utils$1 = $.fn.bootstrapTable.utils;
|
2441
2504
|
$.extend($.fn.bootstrapTable.defaults, {
|
2442
2505
|
filterControl: false,
|
2506
|
+
filterControlVisible: true,
|
2443
2507
|
onColumnSearch: function onColumnSearch(field, text) {
|
2444
2508
|
return false;
|
2445
2509
|
},
|
2446
2510
|
onCreatedControls: function onCreatedControls() {
|
2447
|
-
return
|
2511
|
+
return false;
|
2448
2512
|
},
|
2449
2513
|
alignmentSelectControlOptions: undefined,
|
2450
2514
|
filterTemplate: {
|
2451
2515
|
input: function input(that, field, placeholder, value) {
|
2452
|
-
return Utils.sprintf('<input type="text" class="form-control bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
|
2516
|
+
return Utils$1.sprintf('<input type="text" class="form-control bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
|
2453
2517
|
},
|
2454
|
-
select: function select(
|
2455
|
-
var options =
|
2456
|
-
return Utils.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%;" dir="%s"></select>', field,
|
2518
|
+
select: function select(_ref, field) {
|
2519
|
+
var options = _ref.options;
|
2520
|
+
return Utils$1.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%;" dir="%s"></select>', field, getDirectionOfSelectOptions(options.alignmentSelectControlOptions));
|
2457
2521
|
},
|
2458
2522
|
datepicker: function datepicker(that, field, value) {
|
2459
|
-
return Utils.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', field, 'undefined' === typeof value ? '' : value);
|
2523
|
+
return Utils$1.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', field, 'undefined' === typeof value ? '' : value);
|
2460
2524
|
}
|
2461
2525
|
},
|
2462
2526
|
disableControlWhenSearch: false,
|
2463
2527
|
searchOnEnterKey: false,
|
2528
|
+
showFilterControlSwitch: false,
|
2464
2529
|
// internal variables
|
2465
2530
|
valuesFilterControl: []
|
2466
2531
|
});
|
2467
2532
|
$.extend($.fn.bootstrapTable.columnDefaults, {
|
2468
2533
|
filterControl: undefined,
|
2534
|
+
// input, select, datepicker
|
2469
2535
|
filterDataCollector: undefined,
|
2470
2536
|
filterData: undefined,
|
2471
2537
|
filterDatepickerOptions: undefined,
|
@@ -2483,7 +2549,26 @@
|
|
2483
2549
|
$.extend($.fn.bootstrapTable.defaults.icons, {
|
2484
2550
|
clear: {
|
2485
2551
|
bootstrap3: 'glyphicon-trash icon-clear'
|
2486
|
-
}[$.fn.bootstrapTable.theme] || 'fa-trash'
|
2552
|
+
}[$.fn.bootstrapTable.theme] || 'fa-trash',
|
2553
|
+
filterControlSwitchHide: {
|
2554
|
+
bootstrap3: 'glyphicon-zoom-out icon-zoom-out',
|
2555
|
+
materialize: 'zoom_out'
|
2556
|
+
}[$.fn.bootstrapTable.theme] || 'fa-search-minus',
|
2557
|
+
filterControlSwitchShow: {
|
2558
|
+
bootstrap3: 'glyphicon-zoom-in icon-zoom-in',
|
2559
|
+
materialize: 'zoom_in'
|
2560
|
+
}[$.fn.bootstrapTable.theme] || 'fa-search-plus'
|
2561
|
+
});
|
2562
|
+
$.extend($.fn.bootstrapTable.locales, {
|
2563
|
+
formatFilterControlSwitch: function formatFilterControlSwitch() {
|
2564
|
+
return 'Hide/Show controls';
|
2565
|
+
},
|
2566
|
+
formatFilterControlSwitchHide: function formatFilterControlSwitchHide() {
|
2567
|
+
return 'Hide controls';
|
2568
|
+
},
|
2569
|
+
formatFilterControlSwitchShow: function formatFilterControlSwitchShow() {
|
2570
|
+
return 'Show controls';
|
2571
|
+
}
|
2487
2572
|
});
|
2488
2573
|
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
2489
2574
|
$.extend($.fn.bootstrapTable.defaults, {
|
@@ -2493,6 +2578,7 @@
|
|
2493
2578
|
});
|
2494
2579
|
$.fn.bootstrapTable.methods.push('triggerSearch');
|
2495
2580
|
$.fn.bootstrapTable.methods.push('clearFilterControl');
|
2581
|
+
$.fn.bootstrapTable.methods.push('toggleFilterControl');
|
2496
2582
|
|
2497
2583
|
$.BootstrapTable =
|
2498
2584
|
/*#__PURE__*/
|
@@ -2510,38 +2596,38 @@
|
|
2510
2596
|
value: function init() {
|
2511
2597
|
var _this = this;
|
2512
2598
|
|
2513
|
-
|
2514
|
-
|
2599
|
+
// Make sure that the filterControl option is set
|
2515
2600
|
if (this.options.filterControl) {
|
2516
|
-
|
2517
|
-
|
2601
|
+
// Make sure that the internal variables are set correctly
|
2518
2602
|
this.options.valuesFilterControl = [];
|
2519
2603
|
this.$el.on('reset-view.bs.table', function () {
|
2520
2604
|
// Create controls on $tableHeader if the height is set
|
2521
|
-
if (!
|
2605
|
+
if (!_this.options.height) {
|
2522
2606
|
return;
|
2523
2607
|
} // Avoid recreate the controls
|
2524
2608
|
|
2525
2609
|
|
2526
|
-
|
2610
|
+
var $controlContainer = getControlContainer(_this);
|
2611
|
+
|
2612
|
+
if ($controlContainer.find('select').length > 0 || $controlContainer.find('input:not([type="checkbox"]):not([type="radio"])').length > 0) {
|
2527
2613
|
return;
|
2528
2614
|
}
|
2529
2615
|
|
2530
|
-
|
2616
|
+
createControls(_this, $controlContainer);
|
2531
2617
|
}).on('post-header.bs.table', function () {
|
2532
|
-
|
2618
|
+
setValues(_this);
|
2533
2619
|
}).on('post-body.bs.table', function () {
|
2534
|
-
if (
|
2535
|
-
|
2620
|
+
if (_this.options.height && !_this.options.filterControlContainer) {
|
2621
|
+
fixHeaderCSS(_this);
|
2536
2622
|
}
|
2537
2623
|
|
2538
2624
|
_this.$tableLoading.css('top', _this.$header.outerHeight() + 1);
|
2539
2625
|
}).on('column-switch.bs.table', function () {
|
2540
|
-
|
2626
|
+
setValues(_this);
|
2541
2627
|
}).on('load-success.bs.table', function () {
|
2542
|
-
|
2628
|
+
_this.enableControls(true);
|
2543
2629
|
}).on('load-error.bs.table', function () {
|
2544
|
-
|
2630
|
+
_this.enableControls(true);
|
2545
2631
|
});
|
2546
2632
|
}
|
2547
2633
|
|
@@ -2552,18 +2638,19 @@
|
|
2552
2638
|
value: function initHeader() {
|
2553
2639
|
_get(_getPrototypeOf(_class.prototype), "initHeader", this).call(this);
|
2554
2640
|
|
2555
|
-
if (!this.options.filterControl) {
|
2641
|
+
if (!this.options.filterControl || this.options.height) {
|
2556
2642
|
return;
|
2557
2643
|
}
|
2558
2644
|
|
2559
|
-
|
2645
|
+
createControls(this, getControlContainer(this));
|
2560
2646
|
}
|
2561
2647
|
}, {
|
2562
2648
|
key: "initBody",
|
2563
2649
|
value: function initBody() {
|
2564
2650
|
_get(_getPrototypeOf(_class.prototype), "initBody", this).call(this);
|
2565
2651
|
|
2566
|
-
|
2652
|
+
syncControls(this);
|
2653
|
+
initFilterSelectControls(this);
|
2567
2654
|
}
|
2568
2655
|
}, {
|
2569
2656
|
key: "initSearch",
|
@@ -2571,20 +2658,14 @@
|
|
2571
2658
|
var that = this;
|
2572
2659
|
var fp = $.isEmptyObject(that.filterColumnsPartial) ? null : that.filterColumnsPartial;
|
2573
2660
|
|
2574
|
-
|
2575
|
-
_get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
|
2576
|
-
}
|
2577
|
-
|
2578
|
-
if (this.options.sidePagination === 'server') {
|
2579
|
-
return;
|
2580
|
-
}
|
2661
|
+
_get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
|
2581
2662
|
|
2582
|
-
if (fp === null) {
|
2663
|
+
if (this.options.sidePagination === 'server' || fp === null) {
|
2583
2664
|
return;
|
2584
2665
|
} // Check partial column filter
|
2585
2666
|
|
2586
2667
|
|
2587
|
-
that.data = fp ? that.
|
2668
|
+
that.data = fp ? that.data.filter(function (item, i) {
|
2588
2669
|
var itemIsExpected = [];
|
2589
2670
|
var keys1 = Object.keys(item);
|
2590
2671
|
var keys2 = Object.keys(fp);
|
@@ -2594,7 +2675,7 @@
|
|
2594
2675
|
keys.forEach(function (key) {
|
2595
2676
|
var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
|
2596
2677
|
var fval = (fp[key] || '').toLowerCase();
|
2597
|
-
var value = Utils.getItemField(item, key, false);
|
2678
|
+
var value = Utils$1.getItemField(item, key, false);
|
2598
2679
|
var tmpItemIsExpected;
|
2599
2680
|
|
2600
2681
|
if (fval === '') {
|
@@ -2608,58 +2689,16 @@
|
|
2608
2689
|
if ($.inArray(key, that.header.fields) !== -1) {
|
2609
2690
|
if (value === undefined || value === null) {
|
2610
2691
|
tmpItemIsExpected = false;
|
2611
|
-
} else if (
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(fval) === 0;
|
2616
|
-
} else {
|
2617
|
-
tmpItemIsExpected = "".concat(value).toLowerCase().includes(fval);
|
2618
|
-
}
|
2619
|
-
|
2620
|
-
var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
|
2621
|
-
var matches = largerSmallerEqualsRegex.exec(fval);
|
2622
|
-
|
2623
|
-
if (matches) {
|
2624
|
-
var operator = matches[1] || "".concat(matches[5], "l");
|
2625
|
-
var comparisonValue = matches[2] || matches[3];
|
2626
|
-
var int = parseInt(value, 10);
|
2627
|
-
var comparisonInt = parseInt(comparisonValue, 10);
|
2628
|
-
|
2629
|
-
switch (operator) {
|
2630
|
-
case '>':
|
2631
|
-
case '<l':
|
2632
|
-
tmpItemIsExpected = int > comparisonInt;
|
2633
|
-
break;
|
2634
|
-
|
2635
|
-
case '<':
|
2636
|
-
case '>l':
|
2637
|
-
tmpItemIsExpected = int < comparisonInt;
|
2638
|
-
break;
|
2639
|
-
|
2640
|
-
case '<=':
|
2641
|
-
case '=<':
|
2642
|
-
case '>=l':
|
2643
|
-
case '=>l':
|
2644
|
-
tmpItemIsExpected = int <= comparisonInt;
|
2645
|
-
break;
|
2646
|
-
|
2647
|
-
case '>=':
|
2648
|
-
case '=>':
|
2649
|
-
case '<=l':
|
2650
|
-
case '=<l':
|
2651
|
-
tmpItemIsExpected = int >= comparisonInt;
|
2652
|
-
break;
|
2692
|
+
} else if (_typeof(value) === 'object') {
|
2693
|
+
value.forEach(function (objectValue) {
|
2694
|
+
if (tmpItemIsExpected) {
|
2695
|
+
return;
|
2653
2696
|
}
|
2654
|
-
}
|
2655
|
-
|
2656
|
-
if (thisColumn.filterCustomSearch) {
|
2657
|
-
var customSearchResult = Utils.calculateObjectValue(that, thisColumn.filterCustomSearch, [fval, value, key, that.options.data], true);
|
2658
2697
|
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2698
|
+
tmpItemIsExpected = that.isValueExpected(fval, objectValue, thisColumn, key);
|
2699
|
+
});
|
2700
|
+
} else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
2701
|
+
tmpItemIsExpected = that.isValueExpected(fval, value, thisColumn, key);
|
2663
2702
|
}
|
2664
2703
|
}
|
2665
2704
|
}
|
@@ -2668,11 +2707,71 @@
|
|
2668
2707
|
});
|
2669
2708
|
return !itemIsExpected.includes(false);
|
2670
2709
|
}) : that.data;
|
2710
|
+
that.unsortedData = _toConsumableArray(that.data);
|
2711
|
+
}
|
2712
|
+
}, {
|
2713
|
+
key: "isValueExpected",
|
2714
|
+
value: function isValueExpected(searchValue, value, column, key) {
|
2715
|
+
var tmpItemIsExpected = false;
|
2716
|
+
|
2717
|
+
if (column.filterStrictSearch) {
|
2718
|
+
tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase();
|
2719
|
+
} else if (column.filterStartsWithSearch) {
|
2720
|
+
tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(searchValue) === 0;
|
2721
|
+
} else {
|
2722
|
+
tmpItemIsExpected = "".concat(value).toLowerCase().includes(searchValue);
|
2723
|
+
}
|
2724
|
+
|
2725
|
+
var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
|
2726
|
+
var matches = largerSmallerEqualsRegex.exec(searchValue);
|
2727
|
+
|
2728
|
+
if (matches) {
|
2729
|
+
var operator = matches[1] || "".concat(matches[5], "l");
|
2730
|
+
var comparisonValue = matches[2] || matches[3];
|
2731
|
+
var int = parseInt(value, 10);
|
2732
|
+
var comparisonInt = parseInt(comparisonValue, 10);
|
2733
|
+
|
2734
|
+
switch (operator) {
|
2735
|
+
case '>':
|
2736
|
+
case '<l':
|
2737
|
+
tmpItemIsExpected = int > comparisonInt;
|
2738
|
+
break;
|
2739
|
+
|
2740
|
+
case '<':
|
2741
|
+
case '>l':
|
2742
|
+
tmpItemIsExpected = int < comparisonInt;
|
2743
|
+
break;
|
2744
|
+
|
2745
|
+
case '<=':
|
2746
|
+
case '=<':
|
2747
|
+
case '>=l':
|
2748
|
+
case '=>l':
|
2749
|
+
tmpItemIsExpected = int <= comparisonInt;
|
2750
|
+
break;
|
2751
|
+
|
2752
|
+
case '>=':
|
2753
|
+
case '=>':
|
2754
|
+
case '<=l':
|
2755
|
+
case '=<l':
|
2756
|
+
tmpItemIsExpected = int >= comparisonInt;
|
2757
|
+
break;
|
2758
|
+
}
|
2759
|
+
}
|
2760
|
+
|
2761
|
+
if (column.filterCustomSearch) {
|
2762
|
+
var customSearchResult = Utils$1.calculateObjectValue(this, column.filterCustomSearch, [searchValue, value, key, this.options.data], true);
|
2763
|
+
|
2764
|
+
if (customSearchResult !== null) {
|
2765
|
+
tmpItemIsExpected = customSearchResult;
|
2766
|
+
}
|
2767
|
+
}
|
2768
|
+
|
2769
|
+
return tmpItemIsExpected;
|
2671
2770
|
}
|
2672
2771
|
}, {
|
2673
2772
|
key: "initColumnSearch",
|
2674
2773
|
value: function initColumnSearch(filterColumnsDefaults) {
|
2675
|
-
|
2774
|
+
copyValues(this);
|
2676
2775
|
|
2677
2776
|
if (filterColumnsDefaults) {
|
2678
2777
|
this.filterColumnsPartial = filterColumnsDefaults;
|
@@ -2685,17 +2784,18 @@
|
|
2685
2784
|
}
|
2686
2785
|
}, {
|
2687
2786
|
key: "onColumnSearch",
|
2688
|
-
value: function onColumnSearch(
|
2689
|
-
var currentTarget =
|
2690
|
-
keyCode =
|
2787
|
+
value: function onColumnSearch(_ref2) {
|
2788
|
+
var currentTarget = _ref2.currentTarget,
|
2789
|
+
keyCode = _ref2.keyCode;
|
2691
2790
|
|
2692
2791
|
if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
|
2693
2792
|
return;
|
2694
2793
|
}
|
2695
2794
|
|
2696
|
-
|
2795
|
+
copyValues(this);
|
2697
2796
|
var text = $.trim($(currentTarget).val());
|
2698
2797
|
var $field = $(currentTarget).closest('[data-field]').data('field');
|
2798
|
+
this.trigger('column-search', $field, text);
|
2699
2799
|
|
2700
2800
|
if ($.isEmptyObject(this.filterColumnsPartial)) {
|
2701
2801
|
this.filterColumnsPartial = {};
|
@@ -2712,14 +2812,24 @@
|
|
2712
2812
|
this.onSearch({
|
2713
2813
|
currentTarget: currentTarget
|
2714
2814
|
}, false);
|
2715
|
-
this.trigger('column-search', $field, text);
|
2716
2815
|
}
|
2717
2816
|
}, {
|
2718
2817
|
key: "initToolbar",
|
2719
2818
|
value: function initToolbar() {
|
2819
|
+
this.showToolbar = this.showToolbar || this.options.showFilterControlSwitch;
|
2720
2820
|
this.showSearchClearButton = this.options.filterControl && this.options.showSearchClearButton;
|
2721
2821
|
|
2722
2822
|
_get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
|
2823
|
+
|
2824
|
+
if (this.options.showFilterControlSwitch) {
|
2825
|
+
var $btnGroup = this.$toolbar.find('>.columns');
|
2826
|
+
var $btnFilterControlSwitch = $btnGroup.find('.filter-control-switch');
|
2827
|
+
|
2828
|
+
if (!$btnFilterControlSwitch.length) {
|
2829
|
+
$btnFilterControlSwitch = $("\n <button class=\"filter-control-switch ".concat(this.constants.buttonsClass, "\"\n type=\"button\" title=\"").concat(this.options.formatFilterControlSwitch(), "\">\n ").concat(this.options.showButtonIcons ? Utils$1.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow) : '', "\n ").concat(this.options.showButtonText ? this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow() : '', "\n </button>\n ")).appendTo($btnGroup);
|
2830
|
+
$btnFilterControlSwitch.on('click', $.proxy(this.toggleFilterControl, this));
|
2831
|
+
}
|
2832
|
+
}
|
2723
2833
|
}
|
2724
2834
|
}, {
|
2725
2835
|
key: "resetSearch",
|
@@ -2735,10 +2845,9 @@
|
|
2735
2845
|
value: function clearFilterControl() {
|
2736
2846
|
if (this.options.filterControl) {
|
2737
2847
|
var that = this;
|
2738
|
-
var cookies =
|
2739
|
-
var
|
2740
|
-
var
|
2741
|
-
var controls = header.find(UtilsFilterControl.getCurrentSearchControls(that));
|
2848
|
+
var cookies = collectBootstrapCookies();
|
2849
|
+
var table = this.$el.closest('table');
|
2850
|
+
var controls = getSearchControls(that);
|
2742
2851
|
var search = that.$toolbar.find('.search input');
|
2743
2852
|
var hasValues = false;
|
2744
2853
|
var timeoutId = 0;
|
@@ -2749,7 +2858,7 @@
|
|
2749
2858
|
$.each(that.options.filterControls, function (i, item) {
|
2750
2859
|
item.text = '';
|
2751
2860
|
});
|
2752
|
-
|
2861
|
+
setValues(that); // clear cookies once the filters are clean
|
2753
2862
|
|
2754
2863
|
clearTimeout(timeoutId);
|
2755
2864
|
timeoutId = setTimeout(function () {
|
@@ -2784,7 +2893,7 @@
|
|
2784
2893
|
|
2785
2894
|
|
2786
2895
|
if (that.options.sortName !== table.data('sortName') || that.options.sortOrder !== table.data('sortOrder')) {
|
2787
|
-
var sorter = header.find(Utils.sprintf('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
|
2896
|
+
var sorter = this.$header.find(Utils$1.sprintf('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
|
2788
2897
|
|
2789
2898
|
if (sorter.length > 0) {
|
2790
2899
|
that.onSort({
|
@@ -2799,7 +2908,7 @@
|
|
2799
2908
|
}, {
|
2800
2909
|
key: "triggerSearch",
|
2801
2910
|
value: function triggerSearch() {
|
2802
|
-
var searchControls =
|
2911
|
+
var searchControls = getSearchControls(this);
|
2803
2912
|
searchControls.each(function () {
|
2804
2913
|
var el = $(this);
|
2805
2914
|
|
@@ -2814,7 +2923,7 @@
|
|
2814
2923
|
key: "enableControls",
|
2815
2924
|
value: function enableControls(enable) {
|
2816
2925
|
if (this.options.disableControlWhenSearch && this.options.sidePagination === 'server') {
|
2817
|
-
var searchControls =
|
2926
|
+
var searchControls = getSearchControls(this);
|
2818
2927
|
|
2819
2928
|
if (!enable) {
|
2820
2929
|
searchControls.prop('disabled', 'disabled');
|
@@ -2823,6 +2932,23 @@
|
|
2823
2932
|
}
|
2824
2933
|
}
|
2825
2934
|
}
|
2935
|
+
}, {
|
2936
|
+
key: "toggleFilterControl",
|
2937
|
+
value: function toggleFilterControl() {
|
2938
|
+
this.options.filterControlVisible = !this.options.filterControlVisible;
|
2939
|
+
var $filterControls = getControlContainer(this).find('.filter-control, .no-filter-control');
|
2940
|
+
|
2941
|
+
if (this.options.filterControlVisible) {
|
2942
|
+
$filterControls.show();
|
2943
|
+
} else {
|
2944
|
+
$filterControls.hide();
|
2945
|
+
this.clearFilterControl();
|
2946
|
+
}
|
2947
|
+
|
2948
|
+
var icon = this.options.showButtonIcons ? this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow : '';
|
2949
|
+
var text = this.options.showButtonText ? this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow() : '';
|
2950
|
+
this.$toolbar.find('>.columns').find('.filter-control-switch').html(Utils$1.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon) + ' ' + text);
|
2951
|
+
}
|
2826
2952
|
}]);
|
2827
2953
|
|
2828
2954
|
return _class;
|