Initial commit,修正
This commit is contained in:
Vendored
+256
@@ -0,0 +1,256 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/es.string.iterator.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/web.url-search-params.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/es.string.iterator.js', 'core-js/modules/es.string.search.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/web.url-search-params.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_iterator_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_regexp_exec_js, es_regexp_toString_js, es_string_iterator_js, es_string_search_js, web_domCollections_iterator_js, web_urlSearchParams_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: general
|
||||
* @website: note.generals.space
|
||||
* @email: generals.space@gmail.com
|
||||
* @github: https://github.com/generals-space/bootstrap-table-addrbar
|
||||
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
addrbar: false,
|
||||
addrPrefix: '',
|
||||
addrCustomParams: {}
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
if (this.options.pagination && this.options.addrbar) {
|
||||
this.initAddrbar();
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
|
||||
/*
|
||||
* Priority order:
|
||||
* The value specified by the user has the highest priority.
|
||||
* If it is not specified, it will be obtained from the address bar.
|
||||
* If it is not obtained, the default value will be used.
|
||||
*/
|
||||
}, {
|
||||
key: "getDefaultOptionValue",
|
||||
value: function getDefaultOptionValue(optionName, prefixName) {
|
||||
if (this.options[optionName] !== $.BootstrapTable.DEFAULTS[optionName]) {
|
||||
return this.options[optionName];
|
||||
}
|
||||
return this.searchParams.get("".concat(this.options.addrPrefix || '').concat(prefixName)) || $.BootstrapTable.DEFAULTS[optionName];
|
||||
}
|
||||
}, {
|
||||
key: "initAddrbar",
|
||||
value: function initAddrbar() {
|
||||
var _this = this;
|
||||
// 标志位, 初始加载后关闭
|
||||
this.addrbarInit = true;
|
||||
this.searchParams = new URLSearchParams(window.location.search.substring(1));
|
||||
this.options.pageNumber = +this.getDefaultOptionValue('pageNumber', 'page');
|
||||
this.options.pageSize = +this.getDefaultOptionValue('pageSize', 'size');
|
||||
this.options.sortOrder = this.getDefaultOptionValue('sortOrder', 'order');
|
||||
this.options.sortName = this.getDefaultOptionValue('sortName', 'sort');
|
||||
this.options.searchText = this.getDefaultOptionValue('searchText', 'search');
|
||||
var prefix = this.options.addrPrefix || '';
|
||||
var onLoadSuccess = this.options.onLoadSuccess;
|
||||
var onPageChange = this.options.onPageChange;
|
||||
this.options.onLoadSuccess = function (data) {
|
||||
if (_this.addrbarInit) {
|
||||
_this.addrbarInit = false;
|
||||
} else {
|
||||
_this.updateHistoryState(prefix);
|
||||
}
|
||||
if (onLoadSuccess) {
|
||||
onLoadSuccess.call(_this, data);
|
||||
}
|
||||
};
|
||||
this.options.onPageChange = function (number, size) {
|
||||
_this.updateHistoryState(prefix);
|
||||
if (onPageChange) {
|
||||
onPageChange.call(_this, number, size);
|
||||
}
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "updateHistoryState",
|
||||
value: function updateHistoryState(prefix) {
|
||||
var params = {};
|
||||
params["".concat(prefix, "page")] = this.options.pageNumber;
|
||||
params["".concat(prefix, "size")] = this.options.pageSize;
|
||||
params["".concat(prefix, "order")] = this.options.sortOrder;
|
||||
params["".concat(prefix, "sort")] = this.options.sortName;
|
||||
params["".concat(prefix, "search")] = this.options.searchText;
|
||||
for (var _i = 0, _Object$entries = Object.entries(params); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
key = _Object$entries$_i[0],
|
||||
value = _Object$entries$_i[1];
|
||||
if (value === undefined) {
|
||||
this.searchParams.delete(key);
|
||||
} else {
|
||||
this.searchParams.set(key, value);
|
||||
}
|
||||
}
|
||||
var customParams = Utils.calculateObjectValue(this.options, this.options.addrCustomParams, [], {});
|
||||
for (var _i2 = 0, _Object$entries2 = Object.entries(customParams); _i2 < _Object$entries2.length; _i2++) {
|
||||
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
||||
_key2 = _Object$entries2$_i[0],
|
||||
_value = _Object$entries2$_i[1];
|
||||
this.searchParams.set(_key2, _value);
|
||||
}
|
||||
var url = "?".concat(this.searchParams.toString());
|
||||
if (location.hash) {
|
||||
url += location.hash;
|
||||
}
|
||||
window.history.pushState({}, '', url);
|
||||
}
|
||||
}, {
|
||||
key: "resetSearch",
|
||||
value: function resetSearch(text) {
|
||||
_get(_getPrototypeOf(_class.prototype), "resetSearch", this).call(this, text);
|
||||
this.options.searchText = text || '';
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
+193
@@ -0,0 +1,193 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_object_assign_js, es_object_toString_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Alec Fenichel
|
||||
* @webSite: https://fenichelar.com
|
||||
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
autoRefresh: false,
|
||||
showAutoRefresh: true,
|
||||
autoRefreshInterval: 60,
|
||||
autoRefreshSilent: true,
|
||||
autoRefreshStatus: true,
|
||||
autoRefreshFunction: null
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
autoRefresh: {
|
||||
bootstrap3: 'glyphicon-time icon-time',
|
||||
bootstrap5: 'bi-clock',
|
||||
materialize: 'access_time',
|
||||
'bootstrap-table': 'icon-clock'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-clock'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatAutoRefresh: function formatAutoRefresh() {
|
||||
return 'Auto Refresh';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
if (this.options.autoRefresh && this.options.autoRefreshStatus) {
|
||||
this.setupRefreshInterval();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
var _get3;
|
||||
if (this.options.autoRefresh) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
autoRefresh: {
|
||||
html: "\n <button class=\"auto-refresh ".concat(this.constants.buttonsClass, "\n ").concat(this.options.autoRefreshStatus ? " ".concat(this.constants.classes.buttonActive) : '', "\"\n type=\"button\" name=\"autoRefresh\" title=\"").concat(this.options.formatAutoRefresh(), "\">\n ").concat(this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.autoRefresh) : '', "\n ").concat(this.options.showButtonText ? this.options.formatAutoRefresh() : '', "\n </button>\n "),
|
||||
event: this.toggleAutoRefresh
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get3, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "toggleAutoRefresh",
|
||||
value: function toggleAutoRefresh() {
|
||||
if (this.options.autoRefresh) {
|
||||
if (this.options.autoRefreshStatus) {
|
||||
clearInterval(this.options.autoRefreshFunction);
|
||||
this.$toolbar.find('>.columns .auto-refresh').removeClass(this.constants.classes.buttonActive);
|
||||
} else {
|
||||
this.setupRefreshInterval();
|
||||
this.$toolbar.find('>.columns .auto-refresh').addClass(this.constants.classes.buttonActive);
|
||||
}
|
||||
this.options.autoRefreshStatus = !this.options.autoRefreshStatus;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "destroy",
|
||||
value: function destroy() {
|
||||
if (this.options.autoRefresh && this.options.autoRefreshStatus) {
|
||||
clearInterval(this.options.autoRefreshFunction);
|
||||
}
|
||||
_get(_getPrototypeOf(_class.prototype), "destroy", this).call(this);
|
||||
}
|
||||
}, {
|
||||
key: "setupRefreshInterval",
|
||||
value: function setupRefreshInterval() {
|
||||
var _this = this;
|
||||
this.options.autoRefreshFunction = setInterval(function () {
|
||||
if (!_this.options.autoRefresh || !_this.options.autoRefreshStatus) {
|
||||
return;
|
||||
}
|
||||
_this.refresh({
|
||||
silent: _this.options.autoRefreshSilent
|
||||
});
|
||||
}, this.options.autoRefreshInterval * 1000);
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+794
@@ -0,0 +1,794 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.date.to-json.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.keys.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.date.to-json.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.keys.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.search.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_includes_js, es_array_join_js, es_array_map_js, es_date_toJson_js, es_object_assign_js, es_object_entries_js, es_object_keys_js, es_object_toString_js, es_regexp_exec_js, es_regexp_toString_js, es_string_includes_js, es_string_replace_js, es_string_search_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
var UtilsCookie = {
|
||||
cookieIds: {
|
||||
sortOrder: 'bs.table.sortOrder',
|
||||
sortName: 'bs.table.sortName',
|
||||
sortPriority: 'bs.table.sortPriority',
|
||||
pageNumber: 'bs.table.pageNumber',
|
||||
pageList: 'bs.table.pageList',
|
||||
hiddenColumns: 'bs.table.hiddenColumns',
|
||||
cardView: 'bs.table.cardView',
|
||||
customView: 'bs.table.customView',
|
||||
searchText: 'bs.table.searchText',
|
||||
reorderColumns: 'bs.table.reorderColumns',
|
||||
filterControl: 'bs.table.filterControl',
|
||||
filterBy: 'bs.table.filterBy'
|
||||
},
|
||||
getCurrentHeader: function getCurrentHeader(that) {
|
||||
return that.options.height ? that.$tableHeader : that.$header;
|
||||
},
|
||||
getCurrentSearchControls: function getCurrentSearchControls(that) {
|
||||
return that.options.height ? 'table select, table input' : 'select, input';
|
||||
},
|
||||
isCookieSupportedByBrowser: function isCookieSupportedByBrowser() {
|
||||
return navigator.cookieEnabled;
|
||||
},
|
||||
isCookieEnabled: function isCookieEnabled(that, cookieName) {
|
||||
return that.options.cookiesEnabled.includes(cookieName);
|
||||
},
|
||||
setCookie: function setCookie(that, cookieName, cookieValue) {
|
||||
if (!that.options.cookie || !UtilsCookie.isCookieEnabled(that, cookieName)) {
|
||||
return;
|
||||
}
|
||||
return that._storage.setItem("".concat(that.options.cookieIdTable, ".").concat(cookieName), cookieValue);
|
||||
},
|
||||
getCookie: function getCookie(that, cookieName) {
|
||||
if (!cookieName || !UtilsCookie.isCookieEnabled(that, cookieName)) {
|
||||
return null;
|
||||
}
|
||||
return that._storage.getItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
|
||||
},
|
||||
deleteCookie: function deleteCookie(that, cookieName) {
|
||||
return that._storage.removeItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
|
||||
},
|
||||
calculateExpiration: function calculateExpiration(cookieExpire) {
|
||||
var time = cookieExpire.replace(/[0-9]*/, ''); // s,mi,h,d,m,y
|
||||
|
||||
cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, ''); // number
|
||||
|
||||
switch (time.toLowerCase()) {
|
||||
case 's':
|
||||
cookieExpire = +cookieExpire;
|
||||
break;
|
||||
case 'mi':
|
||||
cookieExpire *= 60;
|
||||
break;
|
||||
case 'h':
|
||||
cookieExpire = cookieExpire * 60 * 60;
|
||||
break;
|
||||
case 'd':
|
||||
cookieExpire = cookieExpire * 24 * 60 * 60;
|
||||
break;
|
||||
case 'm':
|
||||
cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
|
||||
break;
|
||||
case 'y':
|
||||
cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
|
||||
break;
|
||||
default:
|
||||
cookieExpire = undefined;
|
||||
break;
|
||||
}
|
||||
if (!cookieExpire) {
|
||||
return '';
|
||||
}
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + cookieExpire * 1000);
|
||||
return d.toGMTString();
|
||||
},
|
||||
initCookieFilters: function initCookieFilters(that) {
|
||||
setTimeout(function () {
|
||||
var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(that, UtilsCookie.cookieIds.filterControl));
|
||||
if (!that._filterControlValuesLoaded && parsedCookieFilters) {
|
||||
var cachedFilters = {};
|
||||
var header = UtilsCookie.getCurrentHeader(that);
|
||||
var searchControls = UtilsCookie.getCurrentSearchControls(that);
|
||||
var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
|
||||
filteredCookies.forEach(function (cookie) {
|
||||
var value = element.value.toString();
|
||||
var text = cookie.text;
|
||||
if (text === '' || element.type === 'radio' && value !== text) {
|
||||
return;
|
||||
}
|
||||
if (element.tagName === 'INPUT' && element.type === 'radio' && value === text) {
|
||||
element.checked = true;
|
||||
cachedFilters[cookie.field] = text;
|
||||
} else if (element.tagName === 'INPUT') {
|
||||
element.value = text;
|
||||
cachedFilters[cookie.field] = text;
|
||||
} else if (element.tagName === 'SELECT' && that.options.filterControlContainer) {
|
||||
element.value = text;
|
||||
cachedFilters[cookie.field] = text;
|
||||
} else if (text !== '' && element.tagName === 'SELECT') {
|
||||
cachedFilters[cookie.field] = text;
|
||||
var _iterator = _createForOfIteratorHelper(element),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var currentElement = _step.value;
|
||||
if (currentElement.value === text) {
|
||||
currentElement.selected = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
var option = document.createElement('option');
|
||||
option.value = text;
|
||||
option.text = text;
|
||||
element.add(option, element[1]);
|
||||
element.selectedIndex = 1;
|
||||
}
|
||||
});
|
||||
};
|
||||
var filterContainer = header;
|
||||
if (that.options.filterControlContainer) {
|
||||
filterContainer = $("".concat(that.options.filterControlContainer));
|
||||
}
|
||||
filterContainer.find(searchControls).each(function () {
|
||||
var field = $(this).closest('[data-field]').data('field');
|
||||
var filteredCookies = parsedCookieFilters.filter(function (cookie) {
|
||||
return cookie.field === field;
|
||||
});
|
||||
applyCookieFilters(this, filteredCookies);
|
||||
});
|
||||
that.initColumnSearch(cachedFilters);
|
||||
that._filterControlValuesLoaded = true;
|
||||
that.initServer();
|
||||
}
|
||||
}, 250);
|
||||
}
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
cookie: false,
|
||||
cookieExpire: '2h',
|
||||
cookiePath: null,
|
||||
cookieDomain: null,
|
||||
cookieSecure: null,
|
||||
cookieSameSite: 'Lax',
|
||||
cookieIdTable: '',
|
||||
cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.sortPriority', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.hiddenColumns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns', 'bs.table.cardView', 'bs.table.customView'],
|
||||
cookieStorage: 'cookieStorage',
|
||||
// localStorage, sessionStorage, customStorage
|
||||
cookieCustomStorageGet: null,
|
||||
cookieCustomStorageSet: null,
|
||||
cookieCustomStorageDelete: null,
|
||||
// internal variable
|
||||
_filterControls: [],
|
||||
_filterControlValuesLoaded: false,
|
||||
_storage: {
|
||||
setItem: undefined,
|
||||
getItem: undefined,
|
||||
removeItem: undefined
|
||||
}
|
||||
});
|
||||
$.fn.bootstrapTable.methods.push('getCookies');
|
||||
$.fn.bootstrapTable.methods.push('deleteCookie');
|
||||
Object.assign($.fn.bootstrapTable.utils, {
|
||||
setCookie: UtilsCookie.setCookie,
|
||||
getCookie: UtilsCookie.getCookie
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
if (this.options.cookie) {
|
||||
if (this.options.cookieStorage === 'cookieStorage' && !UtilsCookie.isCookieSupportedByBrowser()) {
|
||||
throw new Error('Cookies are not enabled in this browser.');
|
||||
}
|
||||
this.configureStorage();
|
||||
|
||||
// FilterBy logic
|
||||
var filterByCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterBy);
|
||||
if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
|
||||
throw new Error('The cookie value of filterBy must be a json!');
|
||||
}
|
||||
var filterByCookie = {};
|
||||
try {
|
||||
filterByCookie = JSON.parse(filterByCookieValue);
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the filterBy cookie!');
|
||||
}
|
||||
this.filterColumns = filterByCookie ? filterByCookie : {};
|
||||
|
||||
// FilterControl logic
|
||||
this._filterControls = [];
|
||||
this._filterControlValuesLoaded = false;
|
||||
this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').split(',') : this.options.cookiesEnabled;
|
||||
if (this.options.filterControl) {
|
||||
var that = this;
|
||||
this.$el.on('column-search.bs.table', function (e, field, text) {
|
||||
var isNewField = true;
|
||||
for (var i = 0; i < that._filterControls.length; i++) {
|
||||
if (that._filterControls[i].field === field) {
|
||||
that._filterControls[i].text = text;
|
||||
isNewField = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isNewField) {
|
||||
that._filterControls.push({
|
||||
field: field,
|
||||
text: text
|
||||
});
|
||||
}
|
||||
UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that._filterControls));
|
||||
}).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
|
||||
}
|
||||
}
|
||||
_get(_getPrototypeOf(_class.prototype), "init", this).call(this);
|
||||
}
|
||||
}, {
|
||||
key: "initServer",
|
||||
value: function initServer() {
|
||||
var _get2;
|
||||
if (this.options.cookie && this.options.filterControl && !this._filterControlValuesLoaded) {
|
||||
var cookie = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterControl));
|
||||
if (cookie) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "initTable",
|
||||
value: function initTable() {
|
||||
var _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
|
||||
this.initCookie();
|
||||
}
|
||||
}, {
|
||||
key: "onSort",
|
||||
value: function onSort() {
|
||||
var _get4;
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
|
||||
} else {
|
||||
this.options.sortPriority = null;
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "onMultipleSort",
|
||||
value: function onMultipleSort() {
|
||||
var _get5;
|
||||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
(_get5 = _get(_getPrototypeOf(_class.prototype), "onMultipleSort", this)).call.apply(_get5, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
if (this.options.sortPriority === undefined) {
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
|
||||
} else {
|
||||
this.options.sortName = undefined;
|
||||
this.options.sortOrder = undefined;
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortPriority, JSON.stringify(this.options.sortPriority));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "onPageNumber",
|
||||
value: function onPageNumber() {
|
||||
var _get6;
|
||||
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
||||
args[_key5] = arguments[_key5];
|
||||
}
|
||||
(_get6 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get6, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
||||
}
|
||||
}, {
|
||||
key: "onPageListChange",
|
||||
value: function onPageListChange() {
|
||||
var _get7;
|
||||
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
||||
args[_key6] = arguments[_key6];
|
||||
}
|
||||
(_get7 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get7, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize === this.options.formatAllRows() ? 'all' : this.options.pageSize);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
||||
}
|
||||
}, {
|
||||
key: "onPagePre",
|
||||
value: function onPagePre() {
|
||||
var _get8;
|
||||
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
||||
args[_key7] = arguments[_key7];
|
||||
}
|
||||
(_get8 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get8, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
||||
}
|
||||
}, {
|
||||
key: "onPageNext",
|
||||
value: function onPageNext() {
|
||||
var _get9;
|
||||
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
||||
args[_key8] = arguments[_key8];
|
||||
}
|
||||
(_get9 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get9, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
||||
}
|
||||
}, {
|
||||
key: "_toggleColumn",
|
||||
value: function _toggleColumn() {
|
||||
var _get10;
|
||||
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
||||
args[_key9] = arguments[_key9];
|
||||
}
|
||||
(_get10 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get10, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.hiddenColumns, JSON.stringify(this.getHiddenColumns().map(function (column) {
|
||||
return column.field;
|
||||
})));
|
||||
}
|
||||
}, {
|
||||
key: "_toggleAllColumns",
|
||||
value: function _toggleAllColumns() {
|
||||
var _get11;
|
||||
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
||||
args[_key10] = arguments[_key10];
|
||||
}
|
||||
(_get11 = _get(_getPrototypeOf(_class.prototype), "_toggleAllColumns", this)).call.apply(_get11, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.hiddenColumns, JSON.stringify(this.getHiddenColumns().map(function (column) {
|
||||
return column.field;
|
||||
})));
|
||||
}
|
||||
}, {
|
||||
key: "toggleView",
|
||||
value: function toggleView() {
|
||||
_get(_getPrototypeOf(_class.prototype), "toggleView", this).call(this);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.cardView, this.options.cardView);
|
||||
}
|
||||
}, {
|
||||
key: "toggleCustomView",
|
||||
value: function toggleCustomView() {
|
||||
_get(_getPrototypeOf(_class.prototype), "toggleCustomView", this).call(this);
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.customView, this.customViewDefaultView);
|
||||
}
|
||||
}, {
|
||||
key: "selectPage",
|
||||
value: function selectPage(page) {
|
||||
_get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
|
||||
}
|
||||
}, {
|
||||
key: "onSearch",
|
||||
value: function onSearch(event) {
|
||||
_get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event, arguments.length > 1 ? arguments[1] : true);
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
if (this.options.search) {
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
||||
}
|
||||
}, {
|
||||
key: "initHeader",
|
||||
value: function initHeader() {
|
||||
var _get12;
|
||||
if (this.options.reorderableColumns && this.options.cookie) {
|
||||
this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.reorderColumns));
|
||||
}
|
||||
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
||||
args[_key11] = arguments[_key11];
|
||||
}
|
||||
(_get12 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get12, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "persistReorderColumnsState",
|
||||
value: function persistReorderColumnsState(that) {
|
||||
UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
|
||||
}
|
||||
}, {
|
||||
key: "filterBy",
|
||||
value: function filterBy() {
|
||||
var _get13;
|
||||
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
||||
args[_key12] = arguments[_key12];
|
||||
}
|
||||
(_get13 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get13, [this].concat(args));
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
|
||||
}
|
||||
}, {
|
||||
key: "initCookie",
|
||||
value: function initCookie() {
|
||||
if (!this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
if (this.options.cookieIdTable === '' || this.options.cookieExpire === '') {
|
||||
console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
|
||||
this.options.cookie = false; // Make sure that the cookie extension is disabled
|
||||
return;
|
||||
}
|
||||
var sortOrderCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortOrder);
|
||||
var sortOrderNameCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortName);
|
||||
var sortPriorityCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortPriority);
|
||||
var pageNumberCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageNumber);
|
||||
var pageListCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageList);
|
||||
var searchTextCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.searchText);
|
||||
var cardViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.cardView);
|
||||
var customViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.customView);
|
||||
var hiddenColumnsCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.hiddenColumns);
|
||||
var hiddenColumnsCookie = {};
|
||||
try {
|
||||
hiddenColumnsCookie = JSON.parse(hiddenColumnsCookieValue);
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the hidden columns cookie!', hiddenColumnsCookieValue);
|
||||
}
|
||||
try {
|
||||
sortPriorityCookie = JSON.parse(sortPriorityCookie);
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie);
|
||||
}
|
||||
if (!sortPriorityCookie) {
|
||||
// sortOrder
|
||||
this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder;
|
||||
// sortName
|
||||
this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
|
||||
} else {
|
||||
this.options.sortOrder = undefined;
|
||||
this.options.sortName = undefined;
|
||||
}
|
||||
|
||||
// sortPriority
|
||||
this.options.sortPriority = sortPriorityCookie ? sortPriorityCookie : this.options.sortPriority;
|
||||
if (this.options.sortOrder || this.options.sortName) {
|
||||
// sortPriority
|
||||
this.options.sortPriority = null;
|
||||
}
|
||||
|
||||
// pageNumber
|
||||
this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber;
|
||||
// pageSize
|
||||
this.options.pageSize = pageListCookie ? pageListCookie === 'all' ? this.options.formatAllRows() : +pageListCookie : this.options.pageSize;
|
||||
// searchText
|
||||
if (UtilsCookie.isCookieEnabled(this, UtilsCookie.cookieIds.searchText) && this.options.searchText === '') {
|
||||
this.options.searchText = searchTextCookie ? searchTextCookie : '';
|
||||
}
|
||||
// cardView
|
||||
if (cardViewCookie !== null) {
|
||||
this.options.cardView = cardViewCookie === 'true' ? cardViewCookie : false;
|
||||
}
|
||||
this.customViewDefaultView = customViewCookie === 'true';
|
||||
if (hiddenColumnsCookie) {
|
||||
var _iterator2 = _createForOfIteratorHelper(this.columns),
|
||||
_step2;
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var column = _step2.value;
|
||||
if (!column.switchable) {
|
||||
continue;
|
||||
}
|
||||
column.visible = this.isSelectionColumn(column) || !hiddenColumnsCookie.includes(column.field);
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getCookies",
|
||||
value: function getCookies() {
|
||||
var bootstrapTable = this;
|
||||
var cookies = {};
|
||||
for (var _i = 0, _Object$entries = Object.entries(UtilsCookie.cookieIds); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
key = _Object$entries$_i[0],
|
||||
value = _Object$entries$_i[1];
|
||||
cookies[key] = UtilsCookie.getCookie(bootstrapTable, value);
|
||||
if (key === 'columns' || key === 'hiddenColumns' || key === 'sortPriority') {
|
||||
cookies[key] = JSON.parse(cookies[key]);
|
||||
}
|
||||
}
|
||||
return cookies;
|
||||
}
|
||||
}, {
|
||||
key: "deleteCookie",
|
||||
value: function deleteCookie(cookieName) {
|
||||
if (!cookieName || !this.options.cookie) {
|
||||
return;
|
||||
}
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds[cookieName]);
|
||||
}
|
||||
}, {
|
||||
key: "configureStorage",
|
||||
value: function configureStorage() {
|
||||
var that = this;
|
||||
this._storage = {};
|
||||
switch (this.options.cookieStorage) {
|
||||
case 'cookieStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
|
||||
};
|
||||
this._storage.getItem = function (cookieName) {
|
||||
var value = "; ".concat(document.cookie);
|
||||
var parts = value.split("; ".concat(cookieName, "="));
|
||||
return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
|
||||
};
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
|
||||
};
|
||||
break;
|
||||
case 'localStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
localStorage.setItem(cookieName, cookieValue);
|
||||
};
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return localStorage.getItem(cookieName);
|
||||
};
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
localStorage.removeItem(cookieName);
|
||||
};
|
||||
break;
|
||||
case 'sessionStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
sessionStorage.setItem(cookieName, cookieValue);
|
||||
};
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return sessionStorage.getItem(cookieName);
|
||||
};
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
sessionStorage.removeItem(cookieName);
|
||||
};
|
||||
break;
|
||||
case 'customStorage':
|
||||
if (!this.options.cookieCustomStorageSet || !this.options.cookieCustomStorageGet || !this.options.cookieCustomStorageDelete) {
|
||||
throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
|
||||
}
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
|
||||
};
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
|
||||
};
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
|
||||
};
|
||||
break;
|
||||
default:
|
||||
throw new Error('Storage method not supported.');
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
Vendored
+278
@@ -0,0 +1,278 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_array_join_js, es_object_assign_js, es_object_toString_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Homer Glascock <HopGlascock@gmail.com>
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatCopyRows: function formatCopyRows() {
|
||||
return 'Copy Rows';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
copy: {
|
||||
bootstrap3: 'glyphicon-copy icon-pencil',
|
||||
bootstrap5: 'bi-clipboard',
|
||||
materialize: 'content_copy',
|
||||
'bootstrap-table': 'icon-copy'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-copy'
|
||||
});
|
||||
var copyText = function copyText(text) {
|
||||
var textField = document.createElement('textarea');
|
||||
$(textField).html(text);
|
||||
document.body.appendChild(textField);
|
||||
textField.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
} catch (e) {
|
||||
console.warn('Oops, unable to copy');
|
||||
}
|
||||
$(textField).remove();
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
showCopyRows: false,
|
||||
copyWithHidden: false,
|
||||
copyDelimiter: ', ',
|
||||
copyNewline: '\n',
|
||||
copyRowsHandler: function copyRowsHandler(text) {
|
||||
return text;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
ignoreCopy: false,
|
||||
rawCopy: false
|
||||
});
|
||||
$.fn.bootstrapTable.methods.push('copyColumnsToClipboard');
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
var _get2;
|
||||
if (this.options.showCopyRows && this.header.stateField) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
copyRows: {
|
||||
text: this.options.formatCopyRows(),
|
||||
icon: this.options.icons.copy,
|
||||
event: this.copyColumnsToClipboard,
|
||||
attributes: {
|
||||
'aria-label': this.options.formatCopyRows(),
|
||||
title: this.options.formatCopyRows()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
|
||||
this.$copyButton = this.$toolbar.find('>.columns [name="copyRows"]');
|
||||
if (this.options.showCopyRows && this.header.stateField) {
|
||||
this.updateCopyButton();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "copyColumnsToClipboard",
|
||||
value: function copyColumnsToClipboard() {
|
||||
var _this = this;
|
||||
var rows = [];
|
||||
var _iterator = _createForOfIteratorHelper(this.getSelections()),
|
||||
_step;
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var row = _step.value;
|
||||
var cols = [];
|
||||
_this.options.columns[0].forEach(function (column, index) {
|
||||
if (column.field !== _this.header.stateField && (!_this.options.copyWithHidden || _this.options.copyWithHidden && column.visible) && !column.ignoreCopy) {
|
||||
if (row[column.field] !== null) {
|
||||
var columnValue = column.rawCopy ? row[column.field] : Utils.calculateObjectValue(column, _this.header.formatters[index], [row[column.field], row, index], row[column.field]);
|
||||
cols.push(columnValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
rows.push(cols.join(_this.options.copyDelimiter));
|
||||
};
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
var text = rows.join(this.options.copyNewline);
|
||||
text = Utils.calculateObjectValue(this.options, this.options.copyRowsHandler, [text], text);
|
||||
copyText(text);
|
||||
}
|
||||
}, {
|
||||
key: "updateSelected",
|
||||
value: function updateSelected() {
|
||||
_get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
|
||||
this.updateCopyButton();
|
||||
}
|
||||
}, {
|
||||
key: "updateCopyButton",
|
||||
value: function updateCopyButton() {
|
||||
if (this.options.showCopyRows && this.header.stateField && this.$copyButton) {
|
||||
this.$copyButton.prop('disabled', !this.getSelections().length);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
+220
@@ -0,0 +1,220 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_array_slice_js, es_object_assign_js, es_object_toString_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dustin Utecht
|
||||
* @github: https://github.com/UtechtDustin
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
showCustomView: false,
|
||||
customViewDefaultView: false
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
customViewOn: {
|
||||
bootstrap3: 'glyphicon glyphicon-list',
|
||||
bootstrap5: 'bi-list',
|
||||
bootstrap4: 'fa fa-list',
|
||||
semantic: 'fa fa-list',
|
||||
foundation: 'fa fa-list',
|
||||
bulma: 'fa fa-list',
|
||||
materialize: 'list'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-list',
|
||||
customViewOff: {
|
||||
bootstrap3: 'glyphicon glyphicon-thumbnails',
|
||||
bootstrap5: 'bi-grid',
|
||||
bootstrap4: 'fa fa-th',
|
||||
semantic: 'fa fa-th',
|
||||
foundation: 'fa fa-th',
|
||||
bulma: 'fa fa-th',
|
||||
materialize: 'grid_on'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-th'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
onCustomViewPostBody: function onCustomViewPostBody() {
|
||||
return false;
|
||||
},
|
||||
onCustomViewPreBody: function onCustomViewPreBody() {
|
||||
return false;
|
||||
},
|
||||
onToggleCustomView: function onToggleCustomView() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomViewOn: function formatToggleCustomViewOn() {
|
||||
return 'Show custom view';
|
||||
},
|
||||
formatToggleCustomViewOff: function formatToggleCustomViewOff() {
|
||||
return 'Hide custom view';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
$.fn.bootstrapTable.methods.push('toggleCustomView');
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'custom-view-post-body.bs.table': 'onCustomViewPostBody',
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody',
|
||||
'toggle-custom-view.bs.table': 'onToggleCustomView'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
this.customViewDefaultView = this.options.customViewDefaultView;
|
||||
_get(_getPrototypeOf(_class.prototype), "init", this).call(this);
|
||||
}
|
||||
}, {
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
var _get2;
|
||||
if (this.options.customView && this.options.showCustomView) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
customView: {
|
||||
text: this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn(),
|
||||
icon: this.options.customViewDefaultView ? this.options.icons.customViewOn : this.options.icons.customViewOff,
|
||||
event: this.toggleCustomView,
|
||||
attributes: {
|
||||
'aria-label': this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn(),
|
||||
title: this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "initBody",
|
||||
value: function initBody() {
|
||||
_get(_getPrototypeOf(_class.prototype), "initBody", this).call(this);
|
||||
if (!this.options.customView) {
|
||||
return;
|
||||
}
|
||||
var $table = this.$el;
|
||||
var $customViewContainer = this.$container.find('.fixed-table-custom-view');
|
||||
$table.hide();
|
||||
$customViewContainer.hide();
|
||||
if (!this.options.customView || !this.customViewDefaultView) {
|
||||
$table.show();
|
||||
return;
|
||||
}
|
||||
var data = this.getData().slice(this.pageFrom - 1, this.pageTo);
|
||||
var value = Utils.calculateObjectValue(this, this.options.customView, [data], '');
|
||||
this.trigger('custom-view-pre-body', data, value);
|
||||
if ($customViewContainer.length === 1) {
|
||||
$customViewContainer.show().html(value);
|
||||
} else {
|
||||
this.$tableBody.after("<div class=\"fixed-table-custom-view\">".concat(value, "</div>"));
|
||||
}
|
||||
this.trigger('custom-view-post-body', data, value);
|
||||
}
|
||||
}, {
|
||||
key: "toggleCustomView",
|
||||
value: function toggleCustomView() {
|
||||
this.customViewDefaultView = !this.customViewDefaultView;
|
||||
var icon = this.options.showButtonIcons ? this.customViewDefaultView ? this.options.icons.customViewOn : this.options.icons.customViewOff : '';
|
||||
var text = this.options.showButtonText ? this.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn() : '';
|
||||
this.$toolbar.find('button[name="customView"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
|
||||
this.initBody();
|
||||
this.trigger('toggle-custom-view', this.customViewDefaultView);
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+130
@@ -0,0 +1,130 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.object.assign.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.object.assign.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_object_assign_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* When using server-side processing, the default mode of operation for
|
||||
* bootstrap-table is to simply throw away any data that currently exists in the
|
||||
* table and make a request to the server to get the first page of data to
|
||||
* display. This is fine for an empty table, but if you already have the first
|
||||
* page of data displayed in the plain HTML, it is a waste of resources. As
|
||||
* such, you can use data-defer-url instead of data-url to allow you to instruct
|
||||
* bootstrap-table to not make that initial request, rather it will use the data
|
||||
* already on the page.
|
||||
*
|
||||
* @author: Ruben Suarez
|
||||
* @webSite: http://rubensa.eu.org
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
deferUrl: undefined
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
if (this.options.deferUrl) {
|
||||
this.options.url = this.options.deferUrl;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.object.assign.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.object.assign.js","jquery"],t):t(null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,r){"use strict";function n(e,t,r){return t=u(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function o(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},i.apply(null,arguments)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}Object.assign(r.fn.bootstrapTable.defaults,{deferUrl:void 0}),r.BootstrapTable=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),o(t,[{key:"init",value:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=i(u(t.prototype),"init",this)).call.apply(e,[this].concat(n)),this.options.deferUrl&&(this.options.url=this.options.deferUrl)}}])}(r.BootstrapTable)}));
|
||||
Vendored
+390
@@ -0,0 +1,390 @@
|
||||
(function(global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function(es_array_concat_js, es_array_find_js, es_array_indexOf_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_regexp_exec_js, es_string_replace_js, $) {
|
||||
'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function() {};
|
||||
return {
|
||||
s: F,
|
||||
n: function() {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function(r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function() {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function() {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function(r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function() {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function() {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l);
|
||||
else
|
||||
for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r);
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String)(t);
|
||||
}
|
||||
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
onEditableInit: function onEditableInit() {
|
||||
return false;
|
||||
},
|
||||
onEditableSave: function onEditableSave(field, row, rowIndex, oldValue, $el) {
|
||||
return false;
|
||||
},
|
||||
onEditableShown: function onEditableShown(field, row, $el, editable) {
|
||||
return false;
|
||||
},
|
||||
onEditableHidden: function onEditableHidden(field, row, $el, reason) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
alwaysUseFormatter: false
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'editable-init.bs.table': 'onEditableInit',
|
||||
'editable-save.bs.table': 'onEditableSave',
|
||||
'editable-shown.bs.table': 'onEditableShown',
|
||||
'editable-hidden.bs.table': 'onEditableHidden'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/ function(_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initTable",
|
||||
value: function initTable() {
|
||||
var _this = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "initTable", this).call(this);
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
this.editedCells = [];
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
var editableOptions = {};
|
||||
var editableDataPrefix = 'editable-';
|
||||
var processDataOptions = function processDataOptions(key, value) {
|
||||
// Replace camel case with dashes.
|
||||
var dashKey = key.replace(/([A-Z])/g, function($1) {
|
||||
return "-".concat($1.toLowerCase());
|
||||
});
|
||||
if (dashKey.indexOf(editableDataPrefix) === 0) {
|
||||
editableOptions[dashKey.replace(editableDataPrefix, 'data-')] = value;
|
||||
}
|
||||
};
|
||||
var formatterIsSet = column.formatter ? true : false;
|
||||
$.each(_this.options, processDataOptions);
|
||||
column.formatter = column.formatter || function(value) {
|
||||
return value;
|
||||
};
|
||||
column._formatter = column._formatter ? column._formatter : column.formatter;
|
||||
column.formatter = function(value, row, index, field) {
|
||||
var result = Utils.calculateObjectValue(column, column._formatter, [value, row, index, field], value);
|
||||
result = typeof result === 'undefined' || result === null ? _this.options.undefinedText : result;
|
||||
if (_this.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
|
||||
var uniqueId = Utils.getItemField(row, _this.options.uniqueId, false);
|
||||
if ($.inArray(column.field + uniqueId, _this.editedCells) !== -1) {
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
$.each(column, processDataOptions);
|
||||
var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row], {});
|
||||
var noEditFormatter = editableOpts.hasOwnProperty('noEditFormatter') && editableOpts.noEditFormatter(value, row, index, field);
|
||||
if (noEditFormatter) {
|
||||
return noEditFormatter;
|
||||
}
|
||||
var editableDataMarkup = '';
|
||||
$.each(editableOptions, function(key, value) {
|
||||
editableDataMarkup += " ".concat(key, "=\"").concat(value, "\"");
|
||||
});
|
||||
return "<a href=\"javascript:void(0)\"\n data-name=\"".concat(column.field, "\"\n data-pk=\"").concat(row[_this.options.idField], "\"\n data-value=\"").concat(value || '', "\"\n ").concat(editableDataMarkup, ">").concat(formatterIsSet ? result : '',"</a>"); // expand all data-editable-XXX
|
||||
};
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "initBody",
|
||||
value: function initBody(fixedScroll) {
|
||||
var _this2 = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "initBody", this).call(this, fixedScroll);
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
var data = _this2.getData({
|
||||
escape: true
|
||||
});
|
||||
|
||||
var $field = _this2.$body.find("a[data-name=\"".concat(column.field, "\"]"));
|
||||
$field.each(function(i, element) {
|
||||
var $element = $(element);
|
||||
var $tr = $element.closest('tr');
|
||||
var index = $tr.data('index');
|
||||
var row = data[index];
|
||||
var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row, $element], {});
|
||||
$element.editable($element,editableOpts);
|
||||
});
|
||||
$field.off('save').on('save', function(_ref, _ref2) {
|
||||
var currentTarget = _ref.currentTarget;
|
||||
var submitValue = _ref2.submitValue;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
var oldValue = row[column.field];
|
||||
if (_this2.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
|
||||
var uniqueId = Utils.getItemField(row, _this2.options.uniqueId, false);
|
||||
if ($.inArray(column.field + uniqueId, _this2.editedCells) === -1) {
|
||||
_this2.editedCells.push(column.field + uniqueId);
|
||||
}
|
||||
}
|
||||
submitValue = Utils.escapeHTML(submitValue);
|
||||
$this.data('value', submitValue);
|
||||
row[column.field] = submitValue;
|
||||
console.log("bt的editable开始执行save")
|
||||
_this2.trigger('editable-save', column.field, row, rowIndex, oldValue, $this);
|
||||
_this2.initBody();
|
||||
});
|
||||
$field.off('shown').on('shown', function(_ref3, editable) {
|
||||
var currentTarget = _ref3.currentTarget;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
_this2.trigger('editable-shown', column.field, row, $this, editable);
|
||||
});
|
||||
$field.off('hidden').on('hidden', function(_ref4, reason) {
|
||||
var currentTarget = _ref4.currentTarget;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
_this2.trigger('editable-hidden', column.field, row, $this, reason);
|
||||
});
|
||||
});
|
||||
this.trigger('editable-init');
|
||||
}
|
||||
}, {
|
||||
key: "getData",
|
||||
value: function getData(params) {
|
||||
var data = _get(_getPrototypeOf(_class.prototype), "getData", this).call(this, params);
|
||||
if (params && params.escape) {
|
||||
var _iterator = _createForOfIteratorHelper(data),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var row = _step.value;
|
||||
for (var _i = 0, _Object$entries = Object.entries(row); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
key = _Object$entries$_i[0],
|
||||
value = _Object$entries$_i[1];
|
||||
row[key] = Utils.unescapeHTML(value);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
ctms-admin/web/js/plugins/bootstrap-table-V1.23.1/extensions/editable/bootstrap-table-editable_副本.js
Vendored
+390
@@ -0,0 +1,390 @@
|
||||
(function(global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function(es_array_concat_js, es_array_find_js, es_array_indexOf_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_regexp_exec_js, es_string_replace_js, $) {
|
||||
'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function() {};
|
||||
return {
|
||||
s: F,
|
||||
n: function() {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function(r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function() {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function() {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function(r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function() {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function() {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l);
|
||||
else
|
||||
for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r);
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String)(t);
|
||||
}
|
||||
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
onEditableInit: function onEditableInit() {
|
||||
return false;
|
||||
},
|
||||
onEditableSave: function onEditableSave(field, row, rowIndex, oldValue, $el) {
|
||||
return false;
|
||||
},
|
||||
onEditableShown: function onEditableShown(field, row, $el, editable) {
|
||||
return false;
|
||||
},
|
||||
onEditableHidden: function onEditableHidden(field, row, $el, reason) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
alwaysUseFormatter: false
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'editable-init.bs.table': 'onEditableInit',
|
||||
'editable-save.bs.table': 'onEditableSave',
|
||||
'editable-shown.bs.table': 'onEditableShown',
|
||||
'editable-hidden.bs.table': 'onEditableHidden'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/ function(_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initTable",
|
||||
value: function initTable() {
|
||||
var _this = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "initTable", this).call(this);
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
this.editedCells = [];
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
var editableOptions = {};
|
||||
var editableDataPrefix = 'editable-';
|
||||
var processDataOptions = function processDataOptions(key, value) {
|
||||
// Replace camel case with dashes.
|
||||
var dashKey = key.replace(/([A-Z])/g, function($1) {
|
||||
return "-".concat($1.toLowerCase());
|
||||
});
|
||||
if (dashKey.indexOf(editableDataPrefix) === 0) {
|
||||
editableOptions[dashKey.replace(editableDataPrefix, 'data-')] = value;
|
||||
}
|
||||
};
|
||||
var formatterIsSet = column.formatter ? true : false;
|
||||
$.each(_this.options, processDataOptions);
|
||||
column.formatter = column.formatter || function(value) {
|
||||
return value;
|
||||
};
|
||||
column._formatter = column._formatter ? column._formatter : column.formatter;
|
||||
column.formatter = function(value, row, index, field) {
|
||||
var result = Utils.calculateObjectValue(column, column._formatter, [value, row, index, field], value);
|
||||
result = typeof result === 'undefined' || result === null ? _this.options.undefinedText : result;
|
||||
if (_this.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
|
||||
var uniqueId = Utils.getItemField(row, _this.options.uniqueId, false);
|
||||
if ($.inArray(column.field + uniqueId, _this.editedCells) !== -1) {
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
$.each(column, processDataOptions);
|
||||
var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row], {});
|
||||
var noEditFormatter = editableOpts.hasOwnProperty('noEditFormatter') && editableOpts.noEditFormatter(value, row, index, field);
|
||||
if (noEditFormatter) {
|
||||
return noEditFormatter;
|
||||
}
|
||||
var editableDataMarkup = '';
|
||||
$.each(editableOptions, function(key, value) {
|
||||
editableDataMarkup += " ".concat(key, "=\"").concat(value, "\"");
|
||||
});
|
||||
return "<a href=\"javascript:void(0)\"\n data-name=\"".concat(column.field, "\"\n data-pk=\"").concat(row[_this.options.idField], "\"\n data-value=\"").concat(value || '', "\"\n ").concat(editableDataMarkup, ">").concat(formatterIsSet ? result : '', "</a>"); // expand all data-editable-XXX
|
||||
};
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "initBody",
|
||||
value: function initBody(fixedScroll) {
|
||||
var _this2 = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "initBody", this).call(this, fixedScroll);
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
var data = _this2.getData({
|
||||
escape: true
|
||||
});
|
||||
|
||||
var $field = _this2.$body.find("a[data-name=\"".concat(column.field, "\"]"));
|
||||
$field.each(function(i, element) {
|
||||
var $element = $(element);
|
||||
var $tr = $element.closest('tr');
|
||||
var index = $tr.data('index');
|
||||
var row = data[index];
|
||||
var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row, $element], {});
|
||||
|
||||
$element.editable(editableOpts);
|
||||
});
|
||||
$field.off('save').on('save', function(_ref, _ref2) {
|
||||
var currentTarget = _ref.currentTarget;
|
||||
var submitValue = _ref2.submitValue;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
var oldValue = row[column.field];
|
||||
if (_this2.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
|
||||
var uniqueId = Utils.getItemField(row, _this2.options.uniqueId, false);
|
||||
if ($.inArray(column.field + uniqueId, _this2.editedCells) === -1) {
|
||||
_this2.editedCells.push(column.field + uniqueId);
|
||||
}
|
||||
}
|
||||
submitValue = Utils.escapeHTML(submitValue);
|
||||
$this.data('value', submitValue);
|
||||
row[column.field] = submitValue;
|
||||
_this2.trigger('editable-save', column.field, row, rowIndex, oldValue, $this);
|
||||
_this2.initBody();
|
||||
});
|
||||
$field.off('shown').on('shown', function(_ref3, editable) {
|
||||
var currentTarget = _ref3.currentTarget;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
_this2.trigger('editable-shown', column.field, row, $this, editable);
|
||||
});
|
||||
$field.off('hidden').on('hidden', function(_ref4, reason) {
|
||||
var currentTarget = _ref4.currentTarget;
|
||||
var $this = $(currentTarget);
|
||||
var data = _this2.getData();
|
||||
var rowIndex = $this.parents('tr[data-index]').data('index');
|
||||
var row = data[rowIndex];
|
||||
_this2.trigger('editable-hidden', column.field, row, $this, reason);
|
||||
});
|
||||
});
|
||||
this.trigger('editable-init');
|
||||
}
|
||||
}, {
|
||||
key: "getData",
|
||||
value: function getData(params) {
|
||||
var data = _get(_getPrototypeOf(_class.prototype), "getData", this).call(this, params);
|
||||
if (params && params.escape) {
|
||||
var _iterator = _createForOfIteratorHelper(data),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var row = _step.value;
|
||||
for (var _i = 0, _Object$entries = Object.entries(row); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
key = _Object$entries$_i[0],
|
||||
value = _Object$entries$_i[1];
|
||||
row[key] = Utils.unescapeHTML(value);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+446
@@ -0,0 +1,446 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_array_join_js, es_array_map_js, es_array_slice_js, es_object_assign_js, es_object_toString_js, es_regexp_exec_js, es_string_replace_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _defineProperty(e, r, t) {
|
||||
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
||||
value: t,
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0
|
||||
}) : e[r] = t, e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r || "default");
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return ("string" === r ? String : Number)(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/hhurz/tableExport.jquery.plugin
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
var TYPE_NAME = {
|
||||
json: 'JSON',
|
||||
xml: 'XML',
|
||||
png: 'PNG',
|
||||
csv: 'CSV',
|
||||
txt: 'TXT',
|
||||
sql: 'SQL',
|
||||
doc: 'MS-Word',
|
||||
excel: 'MS-Excel',
|
||||
xlsx: 'MS-Excel (OpenXML)',
|
||||
powerpoint: 'MS-Powerpoint',
|
||||
pdf: 'PDF'
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
showExport: false,
|
||||
exportDataType: 'basic',
|
||||
// basic, all, selected
|
||||
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
|
||||
exportOptions: {},
|
||||
exportFooter: false
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
forceExport: false,
|
||||
forceHide: false
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
export: {
|
||||
bootstrap3: 'glyphicon-export icon-share',
|
||||
bootstrap5: 'bi-download',
|
||||
materialize: 'file_download',
|
||||
'bootstrap-table': 'icon-download'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-download'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatExport: function formatExport() {
|
||||
return 'Export data';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
$.fn.bootstrapTable.methods.push('exportTable');
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onExportSaved: function onExportSaved(exportedRows) {
|
||||
return false;
|
||||
},
|
||||
onExportStarted: function onExportStarted() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'export-saved.bs.table': 'onExportSaved',
|
||||
'export-started.bs.table': 'onExportStarted'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
var _this = this,
|
||||
_get2;
|
||||
var o = this.options;
|
||||
var exportTypes = o.exportTypes;
|
||||
this.showToolbar = this.showToolbar || o.showExport;
|
||||
if (this.options.showExport) {
|
||||
if (typeof exportTypes === 'string') {
|
||||
var types = exportTypes.slice(1, -1).replace(/ /g, '').split(',');
|
||||
exportTypes = types.map(function (t) {
|
||||
return t.slice(1, -1);
|
||||
});
|
||||
}
|
||||
if (typeof o.exportOptions === 'string') {
|
||||
o.exportOptions = Utils.calculateObjectValue(null, o.exportOptions);
|
||||
}
|
||||
this.$export = this.$toolbar.find('>.columns div.export');
|
||||
if (this.$export.length) {
|
||||
this.updateExportButton();
|
||||
return;
|
||||
}
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
export: {
|
||||
html: function html() {
|
||||
if (exportTypes.length === 1) {
|
||||
return "\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\"\n data-type=\"").concat(exportTypes[0], "\">\n <button class=\"").concat(_this.constants.buttonsClass, "\"\n aria-label=\"").concat(o.formatExport(), "\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n </button>\n </div>\n ");
|
||||
}
|
||||
var html = [];
|
||||
html.push("\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(_this.constants.buttonsClass, " dropdown-toggle\"\n aria-label=\"").concat(o.formatExport(), "\"\n ").concat(_this.constants.dataToggle, "=\"dropdown\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n ").concat(_this.constants.html.dropdownCaret, "\n </button>\n ").concat(_this.constants.html.toolbarDropdown[0], "\n "));
|
||||
var _iterator = _createForOfIteratorHelper(exportTypes),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var type = _step.value;
|
||||
if (TYPE_NAME.hasOwnProperty(type)) {
|
||||
var $item = $(Utils.sprintf(_this.constants.html.pageDropdownItem, '', TYPE_NAME[type]));
|
||||
$item.attr('data-type', type);
|
||||
html.push($item.prop('outerHTML'));
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
html.push(_this.constants.html.toolbarDropdown[1], '</div>');
|
||||
return html.join('');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
|
||||
this.$export = this.$toolbar.find('>.columns div.export');
|
||||
if (!this.options.showExport) {
|
||||
return;
|
||||
}
|
||||
this.updateExportButton();
|
||||
var $exportButtons = this.$export.find('[data-type]');
|
||||
if (exportTypes.length === 1) {
|
||||
$exportButtons = this.$export;
|
||||
}
|
||||
$exportButtons.click(function (e) {
|
||||
e.preventDefault();
|
||||
_this.trigger('export-started');
|
||||
_this.exportTable({
|
||||
type: $(e.currentTarget).data('type')
|
||||
});
|
||||
});
|
||||
this.handleToolbar();
|
||||
}
|
||||
}, {
|
||||
key: "handleToolbar",
|
||||
value: function handleToolbar() {
|
||||
if (!this.$export) {
|
||||
return;
|
||||
}
|
||||
if (_get(_getPrototypeOf(_class.prototype), "handleToolbar", this)) {
|
||||
_get(_getPrototypeOf(_class.prototype), "handleToolbar", this).call(this);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "exportTable",
|
||||
value: function exportTable(options) {
|
||||
var _this2 = this;
|
||||
var o = this.options;
|
||||
var stateField = this.header.stateField;
|
||||
var isCardView = o.cardView;
|
||||
var doExport = function doExport(callback) {
|
||||
if (stateField) {
|
||||
_this2.hideColumn(stateField);
|
||||
}
|
||||
if (isCardView) {
|
||||
_this2.toggleView();
|
||||
}
|
||||
_this2.columns.forEach(function (row) {
|
||||
if (row.forceHide) {
|
||||
_this2.hideColumn(row.field);
|
||||
}
|
||||
});
|
||||
var data = _this2.getData();
|
||||
if (o.detailView && o.detailViewIcon) {
|
||||
var detailViewIndex = o.detailViewAlign === 'left' ? 0 : _this2.getVisibleFields().length + Utils.getDetailViewIndexOffset(_this2.options);
|
||||
o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || []);
|
||||
}
|
||||
if (o.exportFooter && o.height) {
|
||||
var $footerRow = _this2.$tableFooter.find('tr').first();
|
||||
var footerData = {};
|
||||
var footerHtml = [];
|
||||
$.each($footerRow.children(), function (index, footerCell) {
|
||||
var footerCellHtml = $(footerCell).children('.th-inner').first().html();
|
||||
footerData[_this2.columns[index].field] = footerCellHtml === ' ' ? null : footerCellHtml;
|
||||
|
||||
// grab footer cell text into cell index-based array
|
||||
footerHtml.push(footerCellHtml);
|
||||
});
|
||||
_this2.$body.append(_this2.$body.children().last()[0].outerHTML);
|
||||
var $lastTableRow = _this2.$body.children().last();
|
||||
$.each($lastTableRow.children(), function (index, lastTableRowCell) {
|
||||
$(lastTableRowCell).html(footerHtml[index]);
|
||||
});
|
||||
}
|
||||
var hiddenColumns = _this2.getHiddenColumns();
|
||||
hiddenColumns.forEach(function (row) {
|
||||
if (row.forceExport) {
|
||||
_this2.showColumn(row.field);
|
||||
}
|
||||
});
|
||||
if (typeof o.exportOptions.fileName === 'function') {
|
||||
options.fileName = o.exportOptions.fileName();
|
||||
}
|
||||
_this2.$el.tableExport(Utils.extend({
|
||||
onAfterSaveToFile: function onAfterSaveToFile() {
|
||||
if (o.exportFooter) {
|
||||
_this2.load(data);
|
||||
}
|
||||
if (stateField) {
|
||||
_this2.showColumn(stateField);
|
||||
}
|
||||
if (isCardView) {
|
||||
_this2.toggleView();
|
||||
}
|
||||
hiddenColumns.forEach(function (row) {
|
||||
if (row.forceExport) {
|
||||
_this2.hideColumn(row.field);
|
||||
}
|
||||
});
|
||||
_this2.columns.forEach(function (row) {
|
||||
if (row.forceHide) {
|
||||
_this2.showColumn(row.field);
|
||||
}
|
||||
});
|
||||
if (callback) callback();
|
||||
}
|
||||
}, o.exportOptions, options));
|
||||
};
|
||||
if (o.exportDataType === 'all' && o.pagination) {
|
||||
var eventName = o.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table';
|
||||
var virtualScroll = this.options.virtualScroll;
|
||||
this.$el.one(eventName, function () {
|
||||
setTimeout(function () {
|
||||
var data = _this2.getData();
|
||||
doExport(function () {
|
||||
_this2.options.virtualScroll = virtualScroll;
|
||||
_this2.togglePagination();
|
||||
});
|
||||
_this2.trigger('export-saved', data);
|
||||
}, 0);
|
||||
});
|
||||
this.options.virtualScroll = false;
|
||||
this.togglePagination();
|
||||
} else if (o.exportDataType === 'selected') {
|
||||
var data = this.getData();
|
||||
var selectedData = this.getSelections();
|
||||
var pagination = o.pagination;
|
||||
if (!selectedData.length) {
|
||||
return;
|
||||
}
|
||||
if (o.sidePagination === 'server') {
|
||||
data = _defineProperty({
|
||||
total: o.totalRows
|
||||
}, this.options.dataField, data);
|
||||
selectedData = _defineProperty({
|
||||
total: selectedData.length
|
||||
}, this.options.dataField, selectedData);
|
||||
}
|
||||
this.load(selectedData);
|
||||
if (pagination) {
|
||||
this.togglePagination();
|
||||
}
|
||||
doExport(function () {
|
||||
if (pagination) {
|
||||
_this2.togglePagination();
|
||||
}
|
||||
_this2.load(data);
|
||||
});
|
||||
this.trigger('export-saved', selectedData);
|
||||
} else {
|
||||
doExport();
|
||||
this.trigger('export-saved', this.getData(true));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "updateSelected",
|
||||
value: function updateSelected() {
|
||||
_get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
|
||||
this.updateExportButton();
|
||||
}
|
||||
}, {
|
||||
key: "updateExportButton",
|
||||
value: function updateExportButton() {
|
||||
if (this.options.exportDataType === 'selected') {
|
||||
this.$export.find('> button').prop('disabled', !this.getSelections().length);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.no-filter-control{height:40px}.filter-control{margin:0 2px 2px}.ms-choice{border:0}.ms-parent>button:focus{outline:0}
|
||||
+1213
File diff suppressed because it is too large
Load Diff
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.no-filter-control{height:40px}.filter-control{margin:0 2px 2px}.ms-choice{border:0}.ms-parent>button:focus{outline:0}
|
||||
+10
File diff suppressed because one or more lines are too long
+638
@@ -0,0 +1,638 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.object.keys.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.object.keys.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/es.string.trim.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BootstrapTable = {}, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (exports, es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_array_sort_js, es_object_keys_js, es_object_toString_js, es_regexp_exec_js, es_regexp_toString_js, es_string_match_js, es_string_replace_js, es_string_startsWith_js, es_string_trim_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
/* eslint-disable no-use-before-define */
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
|
||||
function getInputClass(that) {
|
||||
var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
var formControlClass = isSelect ? that.constants.classes.select : that.constants.classes.input;
|
||||
return that.options.iconSize ? Utils.sprintf('%s %s-%s', formControlClass, formControlClass, that.options.iconSize) : formControlClass;
|
||||
}
|
||||
function getOptionsFromSelectControl(selectControl) {
|
||||
return selectControl[0].options;
|
||||
}
|
||||
function getControlContainer(that) {
|
||||
if (that.options.filterControlContainer) {
|
||||
return $("".concat(that.options.filterControlContainer));
|
||||
}
|
||||
if (that.options.height && that._initialized) {
|
||||
return that.$tableContainer.find('.fixed-table-header table thead');
|
||||
}
|
||||
return that.$header;
|
||||
}
|
||||
function isKeyAllowed(keyCode) {
|
||||
return $.inArray(keyCode, [37, 38, 39, 40]) > -1;
|
||||
}
|
||||
function getSearchControls(that) {
|
||||
return getControlContainer(that).find(searchControls);
|
||||
}
|
||||
function hideUnusedSelectOptions(selectControl, uniqueValues) {
|
||||
var options = getOptionsFromSelectControl(selectControl);
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value !== '') {
|
||||
if (!uniqueValues.hasOwnProperty(options[i].value)) {
|
||||
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
|
||||
} else {
|
||||
selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function existOptionInSelectControl(selectControl, value) {
|
||||
var options = getOptionsFromSelectControl(selectControl);
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value === Utils.unescapeHTML(value)) {
|
||||
// The value is not valid to add
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// If we get here, the value is valid to add
|
||||
return false;
|
||||
}
|
||||
function addOptionToSelectControl(selectControl, _value, text, selected, shouldCompareText) {
|
||||
var value = _value === undefined || _value === null ? '' : _value.toString().trim();
|
||||
value = Utils.removeHTML(Utils.unescapeHTML(value));
|
||||
text = Utils.removeHTML(Utils.unescapeHTML(text));
|
||||
if (existOptionInSelectControl(selectControl, value)) {
|
||||
return;
|
||||
}
|
||||
var isSelected = shouldCompareText ? value === selected || text === selected : value === selected;
|
||||
var option = new Option(text, value, false, isSelected);
|
||||
selectControl.get(0).add(option);
|
||||
}
|
||||
function sortSelectControl(selectControl, orderBy, options) {
|
||||
var $selectControl = selectControl.get(0);
|
||||
if (orderBy === 'server') {
|
||||
return;
|
||||
}
|
||||
var tmpAry = new Array();
|
||||
for (var i = 0; i < $selectControl.options.length; i++) {
|
||||
tmpAry[i] = new Array();
|
||||
tmpAry[i][0] = $selectControl.options[i].text;
|
||||
tmpAry[i][1] = $selectControl.options[i].value;
|
||||
tmpAry[i][2] = $selectControl.options[i].selected;
|
||||
}
|
||||
tmpAry.sort(function (a, b) {
|
||||
return Utils.sort(a[0], b[0], orderBy === 'desc' ? -1 : 1, options);
|
||||
});
|
||||
while ($selectControl.options.length > 0) {
|
||||
$selectControl.options[0] = null;
|
||||
}
|
||||
for (var _i = 0; _i < tmpAry.length; _i++) {
|
||||
var op = new Option(tmpAry[_i][0], tmpAry[_i][1], false, tmpAry[_i][2]);
|
||||
$selectControl.add(op);
|
||||
}
|
||||
}
|
||||
function fixHeaderCSS(_ref) {
|
||||
var $tableHeader = _ref.$tableHeader;
|
||||
$tableHeader.css('height', $tableHeader.find('table').outerHeight(true));
|
||||
}
|
||||
function getElementClass($element) {
|
||||
return $element.attr('class').split(' ').filter(function (className) {
|
||||
return className.startsWith('bootstrap-table-filter-control-');
|
||||
});
|
||||
}
|
||||
function getCursorPosition(el) {
|
||||
if ($(el).is('input[type=search]')) {
|
||||
var pos = 0;
|
||||
if ('selectionStart' in el) {
|
||||
pos = el.selectionStart;
|
||||
} else if ('selection' in document) {
|
||||
el.focus();
|
||||
var Sel = document.selection.createRange();
|
||||
var SelLength = document.selection.createRange().text.length;
|
||||
Sel.moveStart('character', -el.value.length);
|
||||
pos = Sel.text.length - SelLength;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
function cacheValues(that) {
|
||||
var searchControls = getSearchControls(that);
|
||||
that._valuesFilterControl = [];
|
||||
searchControls.each(function () {
|
||||
var $field = $(this);
|
||||
var fieldClass = escapeID(getElementClass($field));
|
||||
if (that.options.height && !that.options.filterControlContainer) {
|
||||
$field = that.$el.find(".fixed-table-header .".concat(fieldClass));
|
||||
} else if (that.options.filterControlContainer) {
|
||||
$field = $("".concat(that.options.filterControlContainer, " .").concat(fieldClass));
|
||||
} else {
|
||||
$field = that.$el.find(".".concat(fieldClass));
|
||||
}
|
||||
that._valuesFilterControl.push({
|
||||
field: $field.closest('[data-field]').data('field'),
|
||||
value: $field.val(),
|
||||
position: getCursorPosition($field.get(0)),
|
||||
hasFocus: $field.is(':focus')
|
||||
});
|
||||
});
|
||||
}
|
||||
function setCaretPosition(elem, caretPos) {
|
||||
try {
|
||||
if (elem) {
|
||||
if (elem.createTextRange) {
|
||||
var range = elem.createTextRange();
|
||||
range.move('character', caretPos);
|
||||
range.select();
|
||||
} else {
|
||||
elem.setSelectionRange(caretPos, caretPos);
|
||||
}
|
||||
}
|
||||
} catch (ex) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
function setValues(that) {
|
||||
var field = null;
|
||||
var result = [];
|
||||
var searchControls = getSearchControls(that);
|
||||
if (that._valuesFilterControl.length > 0) {
|
||||
// Callback to apply after settings fields values
|
||||
var callbacks = [];
|
||||
searchControls.each(function (i, el) {
|
||||
var $this = $(el);
|
||||
field = $this.closest('[data-field]').data('field');
|
||||
result = that._valuesFilterControl.filter(function (valueObj) {
|
||||
return valueObj.field === field;
|
||||
});
|
||||
if (result.length > 0) {
|
||||
if (result[0].hasFocus || result[0].value) {
|
||||
var fieldToFocusCallback = function (element, cacheElementInfo) {
|
||||
// Closure here to capture the field information
|
||||
var closedCallback = function closedCallback() {
|
||||
if (cacheElementInfo.hasFocus) {
|
||||
element.focus();
|
||||
}
|
||||
if (Array.isArray(cacheElementInfo.value)) {
|
||||
var $element = $(element);
|
||||
$.each(cacheElementInfo.value, function (i, e) {
|
||||
$element.find(Utils.sprintf('option[value=\'%s\']', e)).prop('selected', true);
|
||||
});
|
||||
} else {
|
||||
element.value = cacheElementInfo.value;
|
||||
}
|
||||
setCaretPosition(element, cacheElementInfo.position);
|
||||
};
|
||||
return closedCallback;
|
||||
}($this.get(0), result[0]);
|
||||
callbacks.push(fieldToFocusCallback);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Callback call.
|
||||
if (callbacks.length > 0) {
|
||||
callbacks.forEach(function (callback) {
|
||||
return callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function collectBootstrapTableFilterCookies() {
|
||||
var cookies = [];
|
||||
var cookieRegex = /bs\.table\.(filterControl|searchText)/g;
|
||||
var foundCookies = document.cookie.match(cookieRegex);
|
||||
var foundLocalStorage = localStorage;
|
||||
if (foundCookies) {
|
||||
$.each(foundCookies, function (i, _cookie) {
|
||||
var cookie = _cookie;
|
||||
if (/./.test(cookie)) {
|
||||
cookie = cookie.split('.').pop();
|
||||
}
|
||||
if ($.inArray(cookie, cookies) === -1) {
|
||||
cookies.push(cookie);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!foundLocalStorage) {
|
||||
return cookies;
|
||||
}
|
||||
Object.keys(localStorage).forEach(function (cookie) {
|
||||
if (!cookieRegex.test(cookie)) {
|
||||
return;
|
||||
}
|
||||
cookie = cookie.split('.').pop();
|
||||
if (!cookies.includes(cookie)) {
|
||||
cookies.push(cookie);
|
||||
}
|
||||
});
|
||||
return cookies;
|
||||
}
|
||||
function escapeID(id) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
return String(id).replace(/([:.\[\],])/g, '\\$1');
|
||||
}
|
||||
function isColumnSearchableViaSelect(_ref2) {
|
||||
var filterControl = _ref2.filterControl,
|
||||
searchable = _ref2.searchable;
|
||||
return filterControl && filterControl.toLowerCase() === 'select' && searchable;
|
||||
}
|
||||
function isFilterDataNotGiven(_ref3) {
|
||||
var filterData = _ref3.filterData;
|
||||
return filterData === undefined || filterData.toLowerCase() === 'column';
|
||||
}
|
||||
function hasSelectControlElement(selectControl) {
|
||||
return selectControl && selectControl.length > 0;
|
||||
}
|
||||
function initFilterSelectControls(that) {
|
||||
var data = that.options.data;
|
||||
$.each(that.header.fields, function (j, field) {
|
||||
var column = that.columns[that.fieldsColumnsIndex[field]];
|
||||
var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
||||
if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
|
||||
if (!selectControl[0].multiple && selectControl.get(selectControl.length - 1).options.length === 0) {
|
||||
// Added the default option, must use a non-breaking space( ) to pass the W3C validator
|
||||
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder || ' ', column.filterDefault);
|
||||
}
|
||||
var uniqueValues = {};
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
// Added a new value
|
||||
var fieldValue = Utils.getItemField(data[i], field, false);
|
||||
var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
|
||||
var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
|
||||
if (fieldValue === undefined || fieldValue === null) {
|
||||
fieldValue = formattedValue;
|
||||
column._forceFormatter = true;
|
||||
}
|
||||
if (column.filterDataCollector) {
|
||||
formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
|
||||
}
|
||||
if (column.searchFormatter) {
|
||||
fieldValue = formattedValue;
|
||||
}
|
||||
uniqueValues[formattedValue] = fieldValue;
|
||||
if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
|
||||
formattedValue.forEach(function (value) {
|
||||
addOptionToSelectControl(selectControl, value, value, column.filterDefault);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (var key in uniqueValues) {
|
||||
addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, column.filterOrderBy, that.options);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function getFilterDataMethod(objFilterDataMethod, searchTerm) {
|
||||
var keys = Object.keys(objFilterDataMethod);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (keys[i] === searchTerm) {
|
||||
return objFilterDataMethod[searchTerm];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function createControls(that, header) {
|
||||
var addedFilterControl = false;
|
||||
var html;
|
||||
$.each(that.columns, function (_, column) {
|
||||
html = [];
|
||||
if (!column.visible && !(that.options.filterControlContainer && $(".bootstrap-table-filter-control-".concat(escapeID(column.field))).length >= 1)) {
|
||||
return;
|
||||
}
|
||||
if (!column.filterControl && !that.options.filterControlContainer) {
|
||||
html.push('<div class="no-filter-control"></div>');
|
||||
} else if (that.options.filterControlContainer) {
|
||||
// Use a filter control container instead of th
|
||||
var $filterControls = $(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
||||
$.each($filterControls, function (_, filterControl) {
|
||||
var $filterControl = $(filterControl);
|
||||
if (!$filterControl.is('[type=radio]')) {
|
||||
var placeholder = column.filterControlPlaceholder || '';
|
||||
$filterControl.attr('placeholder', placeholder).val(column.filterDefault);
|
||||
}
|
||||
$filterControl.attr('data-field', column.field);
|
||||
});
|
||||
addedFilterControl = true;
|
||||
} else {
|
||||
// Create the control based on the html defined in the filterTemplate array.
|
||||
var nameControl = column.filterControl.toLowerCase();
|
||||
html.push('<div class="filter-control">');
|
||||
addedFilterControl = true;
|
||||
if (column.searchable && that.options.filterTemplate[nameControl]) {
|
||||
html.push(that.options.filterTemplate[nameControl](that, column, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
|
||||
}
|
||||
}
|
||||
|
||||
// Filtering by default when it is set.
|
||||
if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
|
||||
if ($.isEmptyObject(that.filterColumnsPartial)) {
|
||||
that.filterColumnsPartial = {};
|
||||
}
|
||||
if (!(column.field in that.filterColumnsPartial)) {
|
||||
that.filterColumnsPartial[column.field] = column.filterDefault;
|
||||
}
|
||||
}
|
||||
$.each(header.find('th'), function (_, th) {
|
||||
var $th = $(th);
|
||||
if ($th.data('field') === column.field) {
|
||||
$th.find('.filter-control').remove();
|
||||
$th.find('.fht-cell').html(html.join(''));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (column.filterData && column.filterData.toLowerCase() !== 'column') {
|
||||
var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
|
||||
var filterDataSource;
|
||||
var selectControl;
|
||||
if (filterDataType) {
|
||||
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
|
||||
selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
|
||||
addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault, true);
|
||||
filterDataType(that, filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
|
||||
} else {
|
||||
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"}');
|
||||
}
|
||||
}
|
||||
});
|
||||
if (addedFilterControl) {
|
||||
header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
|
||||
var currentTarget = _ref4.currentTarget,
|
||||
keyCode = _ref4.keyCode;
|
||||
keyCode = obj ? obj.keyCode : keyCode;
|
||||
if (that.options.searchOnEnterKey && keyCode !== 13) {
|
||||
return;
|
||||
}
|
||||
if (isKeyAllowed(keyCode)) {
|
||||
return;
|
||||
}
|
||||
var $currentTarget = $(currentTarget);
|
||||
if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
|
||||
return;
|
||||
}
|
||||
clearTimeout(currentTarget.timeoutId || 0);
|
||||
currentTarget.timeoutId = setTimeout(function () {
|
||||
that.onColumnSearch({
|
||||
currentTarget: currentTarget,
|
||||
keyCode: keyCode
|
||||
});
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
header.off('change', 'select', '.fc-multipleselect').on('change', 'select', '.fc-multipleselect', function (_ref5) {
|
||||
var currentTarget = _ref5.currentTarget,
|
||||
keyCode = _ref5.keyCode;
|
||||
var $selectControl = $(currentTarget);
|
||||
var value = $selectControl.val();
|
||||
if (Array.isArray(value)) {
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
if (value[i] && value[i].length > 0 && value[i].trim()) {
|
||||
$selectControl.find("option[value=\"".concat(value[i], "\"]")).attr('selected', true);
|
||||
}
|
||||
}
|
||||
} else if (value && value.length > 0 && value.trim()) {
|
||||
$selectControl.find('option[selected]').removeAttr('selected');
|
||||
$selectControl.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
|
||||
} else {
|
||||
$selectControl.find('option[selected]').removeAttr('selected');
|
||||
}
|
||||
clearTimeout(currentTarget.timeoutId || 0);
|
||||
currentTarget.timeoutId = setTimeout(function () {
|
||||
that.onColumnSearch({
|
||||
currentTarget: currentTarget,
|
||||
keyCode: keyCode
|
||||
});
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
|
||||
var currentTarget = _ref6.currentTarget,
|
||||
keyCode = _ref6.keyCode;
|
||||
var $input = $(currentTarget);
|
||||
var oldValue = $input.val();
|
||||
if (oldValue === '') {
|
||||
return;
|
||||
}
|
||||
setTimeout(function () {
|
||||
var newValue = $input.val();
|
||||
if (newValue === '') {
|
||||
clearTimeout(currentTarget.timeoutId || 0);
|
||||
currentTarget.timeoutId = setTimeout(function () {
|
||||
that.onColumnSearch({
|
||||
currentTarget: currentTarget,
|
||||
keyCode: keyCode
|
||||
});
|
||||
}, that.options.searchTimeOut);
|
||||
}
|
||||
}, 1);
|
||||
});
|
||||
header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
|
||||
var currentTarget = _ref7.currentTarget,
|
||||
keyCode = _ref7.keyCode;
|
||||
clearTimeout(currentTarget.timeoutId || 0);
|
||||
currentTarget.timeoutId = setTimeout(function () {
|
||||
that.onColumnSearch({
|
||||
currentTarget: currentTarget,
|
||||
keyCode: keyCode
|
||||
});
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
|
||||
if (header.find('.date-filter-control').length > 0) {
|
||||
$.each(that.columns, function (i, _ref8) {
|
||||
var filterDefault = _ref8.filterDefault,
|
||||
filterControl = _ref8.filterControl,
|
||||
field = _ref8.field,
|
||||
filterDatepickerOptions = _ref8.filterDatepickerOptions;
|
||||
if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
|
||||
var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(escapeID(field)));
|
||||
if (filterDefault) {
|
||||
$datepicker.value(filterDefault);
|
||||
}
|
||||
if (filterDatepickerOptions.min) {
|
||||
$datepicker.attr('min', filterDatepickerOptions.min);
|
||||
}
|
||||
if (filterDatepickerOptions.max) {
|
||||
$datepicker.attr('max', filterDatepickerOptions.max);
|
||||
}
|
||||
if (filterDatepickerOptions.step) {
|
||||
$datepicker.attr('step', filterDatepickerOptions.step);
|
||||
}
|
||||
if (filterDatepickerOptions.pattern) {
|
||||
$datepicker.attr('pattern', filterDatepickerOptions.pattern);
|
||||
}
|
||||
$datepicker.on('change', function (_ref9) {
|
||||
var currentTarget = _ref9.currentTarget;
|
||||
clearTimeout(currentTarget.timeoutId || 0);
|
||||
currentTarget.timeoutId = setTimeout(function () {
|
||||
that.onColumnSearch({
|
||||
currentTarget: currentTarget
|
||||
});
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (that.options.sidePagination !== 'server') {
|
||||
that.triggerSearch();
|
||||
}
|
||||
if (!that.options.filterControlVisible) {
|
||||
header.find('.filter-control, .no-filter-control').hide();
|
||||
}
|
||||
} else {
|
||||
header.find('.filter-control, .no-filter-control').hide();
|
||||
}
|
||||
that.trigger('created-controls');
|
||||
}
|
||||
function getDirectionOfSelectOptions(_alignment) {
|
||||
var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
|
||||
switch (alignment) {
|
||||
case 'left':
|
||||
return 'ltr';
|
||||
case 'right':
|
||||
return 'rtl';
|
||||
case 'auto':
|
||||
return 'auto';
|
||||
default:
|
||||
return 'ltr';
|
||||
}
|
||||
}
|
||||
function syncHeaders(that) {
|
||||
if (!that.options.height) {
|
||||
return;
|
||||
}
|
||||
var fixedHeader = that.$tableContainer.find('.fixed-table-header table thead');
|
||||
if (fixedHeader.length === 0) {
|
||||
return;
|
||||
}
|
||||
that.$header.children().find('th[data-field]').each(function (_, element) {
|
||||
if (element.classList[0] !== 'bs-checkbox') {
|
||||
var $element = $(element);
|
||||
var $field = $element.data('field');
|
||||
var $fixedField = that.$tableContainer.find("th[data-field='".concat($field, "']")).not($element);
|
||||
var input = $element.find('input');
|
||||
var fixedInput = $fixedField.find('input');
|
||||
if (input.length > 0 && fixedInput.length > 0) {
|
||||
if (input.val() !== fixedInput.val()) {
|
||||
input.val(fixedInput.val());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var filterDataMethods = {
|
||||
func: function func(that, filterDataSource, selectControl, filterOrderBy, selected) {
|
||||
var variableValues = window[filterDataSource].apply();
|
||||
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (var key in variableValues) {
|
||||
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, filterOrderBy, that.options);
|
||||
}
|
||||
setValues(that);
|
||||
},
|
||||
obj: function obj(that, filterDataSource, selectControl, filterOrderBy, selected) {
|
||||
var objectKeys = filterDataSource.split('.');
|
||||
var variableName = objectKeys.shift();
|
||||
var variableValues = window[variableName];
|
||||
if (objectKeys.length > 0) {
|
||||
objectKeys.forEach(function (key) {
|
||||
variableValues = variableValues[key];
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (var key in variableValues) {
|
||||
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, filterOrderBy, that.options);
|
||||
}
|
||||
setValues(that);
|
||||
},
|
||||
var: function _var(that, filterDataSource, selectControl, filterOrderBy, selected) {
|
||||
var variableValues = window[filterDataSource];
|
||||
var isArray = Array.isArray(variableValues);
|
||||
for (var key in variableValues) {
|
||||
if (isArray) {
|
||||
addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected, true);
|
||||
} else {
|
||||
addOptionToSelectControl(selectControl, key, variableValues[key], selected, true);
|
||||
}
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, filterOrderBy, that.options);
|
||||
}
|
||||
setValues(that);
|
||||
},
|
||||
url: function url(that, filterDataSource, selectControl, filterOrderBy, selected) {
|
||||
$.ajax({
|
||||
url: filterDataSource,
|
||||
dataType: 'json',
|
||||
success: function success(data) {
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (var key in data) {
|
||||
addOptionToSelectControl(selectControl, key, data[key], selected);
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, filterOrderBy, that.options);
|
||||
}
|
||||
setValues(that);
|
||||
}
|
||||
});
|
||||
},
|
||||
json: function json(that, filterDataSource, selectControl, filterOrderBy, selected) {
|
||||
var variableValues = JSON.parse(filterDataSource);
|
||||
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (var key in variableValues) {
|
||||
addOptionToSelectControl(selectControl, key, variableValues[key], selected);
|
||||
}
|
||||
if (that.options.sortSelectOptions) {
|
||||
sortSelectControl(selectControl, filterOrderBy, that.options);
|
||||
}
|
||||
setValues(that);
|
||||
}
|
||||
};
|
||||
|
||||
exports.addOptionToSelectControl = addOptionToSelectControl;
|
||||
exports.cacheValues = cacheValues;
|
||||
exports.collectBootstrapTableFilterCookies = collectBootstrapTableFilterCookies;
|
||||
exports.createControls = createControls;
|
||||
exports.escapeID = escapeID;
|
||||
exports.existOptionInSelectControl = existOptionInSelectControl;
|
||||
exports.fixHeaderCSS = fixHeaderCSS;
|
||||
exports.getControlContainer = getControlContainer;
|
||||
exports.getCursorPosition = getCursorPosition;
|
||||
exports.getDirectionOfSelectOptions = getDirectionOfSelectOptions;
|
||||
exports.getElementClass = getElementClass;
|
||||
exports.getFilterDataMethod = getFilterDataMethod;
|
||||
exports.getInputClass = getInputClass;
|
||||
exports.getOptionsFromSelectControl = getOptionsFromSelectControl;
|
||||
exports.getSearchControls = getSearchControls;
|
||||
exports.hasSelectControlElement = hasSelectControlElement;
|
||||
exports.hideUnusedSelectOptions = hideUnusedSelectOptions;
|
||||
exports.initFilterSelectControls = initFilterSelectControls;
|
||||
exports.isColumnSearchableViaSelect = isColumnSearchableViaSelect;
|
||||
exports.isFilterDataNotGiven = isFilterDataNotGiven;
|
||||
exports.isKeyAllowed = isKeyAllowed;
|
||||
exports.setCaretPosition = setCaretPosition;
|
||||
exports.setValues = setValues;
|
||||
exports.sortSelectControl = sortSelectControl;
|
||||
exports.syncHeaders = syncHeaders;
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.fixed-columns,.fixed-columns-right{position:absolute;top:0;height:100%;background-color:#fff;box-sizing:border-box;z-index:1}.fixed-columns{left:0}.fixed-columns .fixed-table-body{overflow:hidden !important}.fixed-columns-right{right:0}.fixed-columns-right .fixed-table-body{overflow-x:hidden !important}
|
||||
+467
@@ -0,0 +1,467 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.reverse.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.parse-int.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.reverse.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.parse-int.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_array_indexOf_js, es_array_reverse_js, es_object_assign_js, es_object_toString_js, es_parseInt_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
|
||||
// Reasonable defaults
|
||||
var PIXEL_STEP = 10;
|
||||
var LINE_HEIGHT = 40;
|
||||
var PAGE_HEIGHT = 800;
|
||||
function normalizeWheel(event) {
|
||||
var sX = 0; // spinX
|
||||
var sY = 0; // spinY
|
||||
var pX = 0; // pixelX
|
||||
var pY = 0; // pixelY
|
||||
|
||||
// Legacy
|
||||
if ('detail' in event) {
|
||||
sY = event.detail;
|
||||
}
|
||||
if ('wheelDelta' in event) {
|
||||
sY = -event.wheelDelta / 120;
|
||||
}
|
||||
if ('wheelDeltaY' in event) {
|
||||
sY = -event.wheelDeltaY / 120;
|
||||
}
|
||||
if ('wheelDeltaX' in event) {
|
||||
sX = -event.wheelDeltaX / 120;
|
||||
}
|
||||
|
||||
// side scrolling on FF with DOMMouseScroll
|
||||
if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
|
||||
sX = sY;
|
||||
sY = 0;
|
||||
}
|
||||
pX = sX * PIXEL_STEP;
|
||||
pY = sY * PIXEL_STEP;
|
||||
if ('deltaY' in event) {
|
||||
pY = event.deltaY;
|
||||
}
|
||||
if ('deltaX' in event) {
|
||||
pX = event.deltaX;
|
||||
}
|
||||
if ((pX || pY) && event.deltaMode) {
|
||||
if (event.deltaMode === 1) {
|
||||
// delta in LINE units
|
||||
pX *= LINE_HEIGHT;
|
||||
pY *= LINE_HEIGHT;
|
||||
} else {
|
||||
// delta in PAGE units
|
||||
pX *= PAGE_HEIGHT;
|
||||
pY *= PAGE_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
// Fall-back if spin cannot be determined
|
||||
if (pX && !sX) {
|
||||
sX = pX < 1 ? -1 : 1;
|
||||
}
|
||||
if (pY && !sY) {
|
||||
sY = pY < 1 ? -1 : 1;
|
||||
}
|
||||
return {
|
||||
spinX: sX,
|
||||
spinY: sY,
|
||||
pixelX: pX,
|
||||
pixelY: pY
|
||||
};
|
||||
}
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
fixedColumns: false,
|
||||
fixedNumber: 0,
|
||||
fixedRightNumber: 0
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "fixedColumnsSupported",
|
||||
value: function fixedColumnsSupported() {
|
||||
return this.options.fixedColumns && !this.options.detailView && !this.options.cardView;
|
||||
}
|
||||
}, {
|
||||
key: "initContainer",
|
||||
value: function initContainer() {
|
||||
_get(_getPrototypeOf(_class.prototype), "initContainer", this).call(this);
|
||||
if (!this.fixedColumnsSupported()) {
|
||||
return;
|
||||
}
|
||||
if (this.options.fixedNumber) {
|
||||
this.$tableContainer.append('<div class="fixed-columns"></div>');
|
||||
this.$fixedColumns = this.$tableContainer.find('.fixed-columns');
|
||||
}
|
||||
if (this.options.fixedRightNumber) {
|
||||
this.$tableContainer.append('<div class="fixed-columns-right"></div>');
|
||||
this.$fixedColumnsRight = this.$tableContainer.find('.fixed-columns-right');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initBody",
|
||||
value: function initBody() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get2, [this].concat(args));
|
||||
if (this.$fixedColumns && this.$fixedColumns.length) {
|
||||
this.$fixedColumns.toggle(this.fixedColumnsSupported());
|
||||
}
|
||||
if (this.$fixedColumnsRight && this.$fixedColumnsRight.length) {
|
||||
this.$fixedColumnsRight.toggle(this.fixedColumnsSupported());
|
||||
}
|
||||
if (!this.fixedColumnsSupported()) {
|
||||
return;
|
||||
}
|
||||
if (this.options.showHeader && this.options.height) {
|
||||
return;
|
||||
}
|
||||
this.initFixedColumnsBody();
|
||||
this.initFixedColumnsEvents();
|
||||
}
|
||||
}, {
|
||||
key: "trigger",
|
||||
value: function trigger() {
|
||||
var _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "trigger", this)).call.apply(_get3, [this].concat(args));
|
||||
if (!this.fixedColumnsSupported()) {
|
||||
return;
|
||||
}
|
||||
if (args[0] === 'post-header') {
|
||||
this.initFixedColumnsHeader();
|
||||
} else if (args[0] === 'scroll-body') {
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "updateSelected",
|
||||
value: function updateSelected() {
|
||||
var _this = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
|
||||
if (!this.fixedColumnsSupported()) {
|
||||
return;
|
||||
}
|
||||
this.$tableBody.find('tr').each(function (i, el) {
|
||||
var $el = $(el);
|
||||
var index = $el.data('index');
|
||||
var classes = $el.attr('class');
|
||||
var inputSelector = "[name=\"".concat(_this.options.selectItemName, "\"]");
|
||||
var $input = $el.find(inputSelector);
|
||||
if (typeof index === 'undefined') {
|
||||
return;
|
||||
}
|
||||
var updateFixedBody = function updateFixedBody($fixedHeader, $fixedBody) {
|
||||
var $tr = $fixedBody.find("tr[data-index=\"".concat(index, "\"]"));
|
||||
$tr.attr('class', classes);
|
||||
if ($input.length) {
|
||||
$tr.find(inputSelector).prop('checked', $input.prop('checked'));
|
||||
}
|
||||
if (_this.$selectAll.length) {
|
||||
$fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', _this.$selectAll.prop('checked'));
|
||||
}
|
||||
};
|
||||
if (_this.$fixedBody && _this.options.fixedNumber) {
|
||||
updateFixedBody(_this.$fixedHeader, _this.$fixedBody);
|
||||
}
|
||||
if (_this.$fixedBodyRight && _this.options.fixedRightNumber) {
|
||||
updateFixedBody(_this.$fixedHeaderRight, _this.$fixedBodyRight);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "hideLoading",
|
||||
value: function hideLoading() {
|
||||
_get(_getPrototypeOf(_class.prototype), "hideLoading", this).call(this);
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedColumns.find('.fixed-table-loading').hide();
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
this.$fixedColumnsRight.find('.fixed-table-loading').hide();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initFixedColumnsHeader",
|
||||
value: function initFixedColumnsHeader() {
|
||||
var _this2 = this;
|
||||
if (this.options.height) {
|
||||
this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true);
|
||||
} else {
|
||||
this.needFixedColumns = this.$tableBody.outerWidth(true) < this.$tableBody.find('table').outerWidth(true);
|
||||
}
|
||||
var initFixedHeader = function initFixedHeader($fixedColumns, isRight) {
|
||||
$fixedColumns.find('.fixed-table-header').remove();
|
||||
$fixedColumns.append(_this2.$tableHeader.clone(true));
|
||||
$fixedColumns.css({
|
||||
width: _this2.getFixedColumnsWidth(isRight)
|
||||
});
|
||||
return $fixedColumns.find('.fixed-table-header');
|
||||
};
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedHeader = initFixedHeader(this.$fixedColumns);
|
||||
this.$fixedHeader.css('margin-right', '');
|
||||
} else if (this.$fixedColumns) {
|
||||
this.$fixedColumns.html('').css('width', '');
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
this.$fixedHeaderRight = initFixedHeader(this.$fixedColumnsRight, true);
|
||||
this.$fixedHeaderRight.scrollLeft(this.$fixedHeaderRight.find('table').width());
|
||||
} else if (this.$fixedColumnsRight) {
|
||||
this.$fixedColumnsRight.html('').css('width', '');
|
||||
}
|
||||
this.initFixedColumnsBody();
|
||||
this.initFixedColumnsEvents();
|
||||
}
|
||||
}, {
|
||||
key: "initFixedColumnsBody",
|
||||
value: function initFixedColumnsBody() {
|
||||
var _this3 = this;
|
||||
var initFixedBody = function initFixedBody($fixedColumns, $fixedHeader) {
|
||||
$fixedColumns.find('.fixed-table-body').remove();
|
||||
$fixedColumns.append(_this3.$tableBody.clone(true));
|
||||
$fixedColumns.find('.fixed-table-body table').removeAttr('id');
|
||||
var $fixedBody = $fixedColumns.find('.fixed-table-body');
|
||||
var tableBody = _this3.$tableBody.get(0);
|
||||
var scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? Utils.getScrollBarWidth() : 0;
|
||||
var height = _this3.$tableContainer.outerHeight(true) - scrollHeight - 1;
|
||||
$fixedColumns.css({
|
||||
height: height
|
||||
});
|
||||
$fixedBody.css({
|
||||
height: height - $fixedHeader.height()
|
||||
});
|
||||
return $fixedBody;
|
||||
};
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedBody = initFixedBody(this.$fixedColumns, this.$fixedHeader);
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
this.$fixedBodyRight = initFixedBody(this.$fixedColumnsRight, this.$fixedHeaderRight);
|
||||
this.$fixedBodyRight.scrollLeft(this.$fixedBodyRight.find('table').width());
|
||||
this.$fixedBodyRight.css('overflow-y', this.options.height ? 'auto' : 'hidden');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getFixedColumnsWidth",
|
||||
value: function getFixedColumnsWidth(isRight) {
|
||||
var visibleFields = this.getVisibleFields();
|
||||
var width = 0;
|
||||
var fixedNumber = this.options.fixedNumber;
|
||||
var marginRight = 0;
|
||||
if (isRight) {
|
||||
visibleFields = visibleFields.reverse();
|
||||
fixedNumber = this.options.fixedRightNumber;
|
||||
marginRight = parseInt(this.$tableHeader.css('margin-right'), 10);
|
||||
}
|
||||
for (var i = 0; i < fixedNumber; i++) {
|
||||
width += this.$header.find("th[data-field=\"".concat(visibleFields[i], "\"]")).outerWidth(true);
|
||||
}
|
||||
return width + marginRight + 1;
|
||||
}
|
||||
}, {
|
||||
key: "initFixedColumnsEvents",
|
||||
value: function initFixedColumnsEvents() {
|
||||
var _this4 = this;
|
||||
var toggleHover = function toggleHover(e, toggle) {
|
||||
var tr = "tr[data-index=\"".concat($(e.currentTarget).data('index'), "\"]");
|
||||
var $trs = _this4.$tableBody.find(tr);
|
||||
if (_this4.$fixedBody) {
|
||||
$trs = $trs.add(_this4.$fixedBody.find(tr));
|
||||
}
|
||||
if (_this4.$fixedBodyRight) {
|
||||
$trs = $trs.add(_this4.$fixedBodyRight.find(tr));
|
||||
}
|
||||
$trs.css('background-color', toggle ? $(e.currentTarget).css('background-color') : '');
|
||||
};
|
||||
this.$tableBody.find('tr').hover(function (e) {
|
||||
toggleHover(e, true);
|
||||
}, function (e) {
|
||||
toggleHover(e, false);
|
||||
});
|
||||
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
||||
var mousewheel = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
|
||||
var updateScroll = function updateScroll(e, fixedBody) {
|
||||
var normalized = normalizeWheel(e);
|
||||
var deltaY = Math.ceil(normalized.pixelY);
|
||||
var top = _this4.$tableBody.scrollTop() + deltaY;
|
||||
if (deltaY < 0 && top > 0 || deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight) {
|
||||
e.preventDefault();
|
||||
}
|
||||
_this4.$tableBody.scrollTop(top);
|
||||
if (_this4.$fixedBody) {
|
||||
_this4.$fixedBody.scrollTop(top);
|
||||
}
|
||||
if (_this4.$fixedBodyRight) {
|
||||
_this4.$fixedBodyRight.scrollTop(top);
|
||||
}
|
||||
};
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedBody.find('tr').hover(function (e) {
|
||||
toggleHover(e, true);
|
||||
}, function (e) {
|
||||
toggleHover(e, false);
|
||||
});
|
||||
this.$fixedBody[0].addEventListener(mousewheel, function (e) {
|
||||
updateScroll(e, _this4.$fixedBody[0]);
|
||||
});
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
this.$fixedBodyRight.find('tr').hover(function (e) {
|
||||
toggleHover(e, true);
|
||||
}, function (e) {
|
||||
toggleHover(e, false);
|
||||
});
|
||||
this.$fixedBodyRight.off('scroll').on('scroll', function () {
|
||||
var top = _this4.$fixedBodyRight.scrollTop();
|
||||
_this4.$tableBody.scrollTop(top);
|
||||
if (_this4.$fixedBody) {
|
||||
_this4.$fixedBody.scrollTop(top);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.options.filterControl) {
|
||||
$(this.$fixedColumns).off('keyup change').on('keyup change', function (e) {
|
||||
var $target = $(e.target);
|
||||
var value = $target.val();
|
||||
var field = $target.parents('th').data('field');
|
||||
var $coreTh = _this4.$header.find("th[data-field=\"".concat(field, "\"]"));
|
||||
if ($target.is('input')) {
|
||||
$coreTh.find('input').val(value);
|
||||
} else if ($target.is('select')) {
|
||||
var $select = $coreTh.find('select');
|
||||
$select.find('option[selected]').removeAttr('selected');
|
||||
$select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
|
||||
}
|
||||
_this4.triggerSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "renderStickyHeader",
|
||||
value: function renderStickyHeader() {
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
this.$stickyContainer = this.$container.find('.sticky-header-container');
|
||||
_get(_getPrototypeOf(_class.prototype), "renderStickyHeader", this).call(this);
|
||||
if (this.needFixedColumns && this.options.fixedNumber) {
|
||||
this.$fixedColumns.css('z-index', 101).find('.sticky-header-container').css('right', '').width(this.$fixedColumns.outerWidth());
|
||||
}
|
||||
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
||||
var $stickyHeaderContainerRight = this.$fixedColumnsRight.find('.sticky-header-container');
|
||||
this.$fixedColumnsRight.css('z-index', 101);
|
||||
$stickyHeaderContainerRight.css('left', '').scrollLeft($stickyHeaderContainerRight.find('.table').outerWidth()).width(this.$fixedColumnsRight.outerWidth());
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "matchPositionX",
|
||||
value: function matchPositionX() {
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
this.$stickyContainer.eq(0).scrollLeft(this.$tableBody.scrollLeft());
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.fixed-columns,.fixed-columns-right{position:absolute;top:0;height:100%;background-color:#fff;box-sizing:border-box;z-index:1}.fixed-columns{left:0}.fixed-columns .fixed-table-body{overflow:hidden!important}.fixed-columns-right{right:0}.fixed-columns-right .fixed-table-body{overflow-x:hidden!important}
|
||||
+10
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.bootstrap-table .table>tbody>tr.group-by.expanded,.bootstrap-table .table>tbody>tr.group-by.collapsed{cursor:pointer}.bootstrap-table .table>tbody>tr.hidden{display:none}
|
||||
ctms-admin/web/js/plugins/bootstrap-table-V1.23.1/extensions/group-by-v2/bootstrap-table-group-by.js
Vendored
+362
@@ -0,0 +1,362 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.function.name.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.function.name.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_join_js, es_array_slice_js, es_array_sort_js, es_function_name_js, es_object_assign_js, es_object_toString_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Yura Knoxville
|
||||
* @version: v1.1.0
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
var initBodyCaller;
|
||||
var groupBy = function groupBy(array, f) {
|
||||
var tmpGroups = {};
|
||||
array.forEach(function (o) {
|
||||
var groups = f(o);
|
||||
tmpGroups[groups] = tmpGroups[groups] || [];
|
||||
tmpGroups[groups].push(o);
|
||||
});
|
||||
return tmpGroups;
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
collapseGroup: {
|
||||
bootstrap3: 'glyphicon-chevron-up',
|
||||
bootstrap5: 'bi-chevron-up',
|
||||
materialize: 'arrow_drop_down'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-angle-up',
|
||||
expandGroup: {
|
||||
bootstrap3: 'glyphicon-chevron-down',
|
||||
bootstrap5: 'bi-chevron-down',
|
||||
materialize: 'arrow_drop_up'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-angle-down'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
groupBy: false,
|
||||
groupByField: '',
|
||||
groupByFormatter: undefined,
|
||||
groupByToggle: false,
|
||||
groupByShowToggleIcon: false,
|
||||
groupByCollapsedGroups: []
|
||||
});
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor;
|
||||
var _initSort = BootstrapTable.prototype.initSort;
|
||||
var _initBody = BootstrapTable.prototype.initBody;
|
||||
var _updateSelected = BootstrapTable.prototype.updateSelected;
|
||||
BootstrapTable.prototype.initSort = function () {
|
||||
var _this = this;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
_initSort.apply(this, Array.prototype.slice.apply(args));
|
||||
var that = this;
|
||||
this.tableGroups = [];
|
||||
if (this.options.groupBy && this.options.groupByField !== '') {
|
||||
if (this.options.sortName !== this.options.groupByField) {
|
||||
if (this.options.customSort) {
|
||||
Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
|
||||
} else {
|
||||
this.options.data.sort(function (a, b) {
|
||||
var groupByFields = _this.getGroupByFields();
|
||||
var fieldValuesA = [];
|
||||
var fieldValuesB = [];
|
||||
$.each(groupByFields, function (i, field) {
|
||||
fieldValuesA.push(a[field]);
|
||||
fieldValuesB.push(b[field]);
|
||||
});
|
||||
a = fieldValuesA.join();
|
||||
b = fieldValuesB.join();
|
||||
return a.localeCompare(b, undefined, {
|
||||
numeric: true
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
var groups = groupBy(that.data, function (item) {
|
||||
var groupByFields = _this.getGroupByFields();
|
||||
var groupValues = [];
|
||||
$.each(groupByFields, function (i, field) {
|
||||
var value_ = Utils.getItemField(item, field, that.options.escape, item.escape);
|
||||
groupValues.push(value_);
|
||||
});
|
||||
return groupValues.join(', ');
|
||||
});
|
||||
var index = 0;
|
||||
$.each(groups, function (key, value) {
|
||||
_this.tableGroups.push({
|
||||
id: index,
|
||||
name: key,
|
||||
data: value
|
||||
});
|
||||
value.forEach(function (item) {
|
||||
if (!item._data) {
|
||||
item._data = {};
|
||||
}
|
||||
if (_this.isCollapsed(key, value)) {
|
||||
item._class += ' hidden';
|
||||
}
|
||||
item._data['parent-index'] = index;
|
||||
});
|
||||
index++;
|
||||
});
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.initBody = function () {
|
||||
var _this2 = this;
|
||||
initBodyCaller = true;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
_initBody.apply(this, Array.prototype.slice.apply(args));
|
||||
if (this.options.groupBy && this.options.groupByField !== '') {
|
||||
var that = this;
|
||||
var checkBox = false;
|
||||
var visibleColumns = 0;
|
||||
this.columns.forEach(function (column) {
|
||||
if (column.checkbox && !that.options.singleSelect) {
|
||||
checkBox = true;
|
||||
} else if (column.visible) {
|
||||
visibleColumns += 1;
|
||||
}
|
||||
});
|
||||
if (this.options.detailView && !this.options.cardView) {
|
||||
visibleColumns += 1;
|
||||
}
|
||||
this.tableGroups.forEach(function (item) {
|
||||
var html = [];
|
||||
html.push(Utils.sprintf('<tr class="info group-by %s" data-group-index="%s">', _this2.options.groupByToggle ? 'expanded' : '', item.id));
|
||||
if (that.options.detailView && !that.options.cardView) {
|
||||
html.push('<td class="detail"></td>');
|
||||
}
|
||||
if (checkBox) {
|
||||
html.push('<td class="bs-checkbox">', '<input name="btSelectGroup" type="checkbox" />', '</td>');
|
||||
}
|
||||
var formattedValue = item.name;
|
||||
if (that.options.groupByFormatter !== undefined) {
|
||||
formattedValue = Utils.calculateObjectValue(that.options, that.options.groupByFormatter, [item.name, item.id, item.data]);
|
||||
}
|
||||
html.push('<td', Utils.sprintf(' colspan="%s"', visibleColumns), '>', formattedValue);
|
||||
var icon = _this2.options.icons.collapseGroup;
|
||||
if (_this2.isCollapsed(item.name, item.data)) {
|
||||
icon = _this2.options.icons.expandGroup;
|
||||
}
|
||||
if (_this2.options.groupByToggle && _this2.options.groupByShowToggleIcon) {
|
||||
html.push("<span class=\"float-right ".concat(_this2.options.iconsPrefix, " ").concat(icon, "\"></span>"));
|
||||
}
|
||||
html.push('</td></tr>');
|
||||
that.$body.find("tr[data-parent-index=".concat(item.id, "]:first")).before($(html.join('')));
|
||||
});
|
||||
this.$selectGroup = [];
|
||||
this.$body.find('[name="btSelectGroup"]').each(function () {
|
||||
var self = $(this);
|
||||
that.$selectGroup.push({
|
||||
group: self,
|
||||
item: that.$selectItem.filter(function () {
|
||||
return $(this).closest('tr').data('parent-index') === self.closest('tr').data('group-index');
|
||||
})
|
||||
});
|
||||
});
|
||||
if (this.options.groupByToggle) {
|
||||
this.$container.off('click', '.group-by').on('click', '.group-by', function () {
|
||||
var $this = $(this);
|
||||
var groupIndex = $this.closest('tr').data('group-index');
|
||||
var $groupRows = that.$body.find("tr[data-parent-index=".concat(groupIndex, "]"));
|
||||
$this.toggleClass('expanded collapsed');
|
||||
$this.find('span').toggleClass("".concat(that.options.icons.collapseGroup, " ").concat(that.options.icons.expandGroup));
|
||||
$groupRows.toggleClass('hidden');
|
||||
$groupRows.each(function (i, element) {
|
||||
return that.collapseRow($(element).data('index'));
|
||||
});
|
||||
});
|
||||
}
|
||||
this.$container.off('click', '[name="btSelectGroup"]').on('click', '[name="btSelectGroup"]', function (event) {
|
||||
event.stopImmediatePropagation();
|
||||
var self = $(this);
|
||||
var checked = self.prop('checked');
|
||||
that[checked ? 'checkGroup' : 'uncheckGroup']($(this).closest('tr').data('group-index'));
|
||||
});
|
||||
}
|
||||
initBodyCaller = false;
|
||||
this.updateSelected();
|
||||
};
|
||||
BootstrapTable.prototype.updateSelected = function () {
|
||||
if (!initBodyCaller) {
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
_updateSelected.apply(this, Array.prototype.slice.apply(args));
|
||||
if (this.options.groupBy && this.options.groupByField !== '') {
|
||||
this.$selectGroup.forEach(function (item) {
|
||||
var checkGroup = item.item.filter(':enabled').length === item.item.filter(':enabled').filter(':checked').length;
|
||||
item.group.prop('checked', checkGroup);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.checkGroup = function (index) {
|
||||
this.checkGroup_(index, true);
|
||||
};
|
||||
BootstrapTable.prototype.uncheckGroup = function (index) {
|
||||
this.checkGroup_(index, false);
|
||||
};
|
||||
BootstrapTable.prototype.isCollapsed = function (groupKey, items) {
|
||||
if (this.options.groupByCollapsedGroups) {
|
||||
var collapsedGroups = Utils.calculateObjectValue(this, this.options.groupByCollapsedGroups, [groupKey, items], true);
|
||||
if ($.inArray(groupKey, collapsedGroups) > -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
BootstrapTable.prototype.checkGroup_ = function (index, checked) {
|
||||
var rowsBefore = this.getSelections();
|
||||
var filter = function filter() {
|
||||
return $(this).closest('tr').data('parent-index') === index;
|
||||
};
|
||||
this.$selectItem.filter(filter).prop('checked', checked);
|
||||
this.updateRows();
|
||||
this.updateSelected();
|
||||
var rowsAfter = this.getSelections();
|
||||
if (checked) {
|
||||
this.trigger('check-all', rowsAfter, rowsBefore);
|
||||
return;
|
||||
}
|
||||
this.trigger('uncheck-all', rowsAfter, rowsBefore);
|
||||
};
|
||||
BootstrapTable.prototype.getGroupByFields = function () {
|
||||
var groupByFields = this.options.groupByField;
|
||||
if (!$.isArray(this.options.groupByField)) {
|
||||
groupByFields = [this.options.groupByField];
|
||||
}
|
||||
return groupByFields;
|
||||
};
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "scrollTo",
|
||||
value: function scrollTo(params) {
|
||||
if (this.options.groupBy) {
|
||||
var options = {
|
||||
unit: 'px',
|
||||
value: 0
|
||||
};
|
||||
if (_typeof(params) === 'object') {
|
||||
options = Object.assign(options, params);
|
||||
}
|
||||
if (options.unit === 'rows') {
|
||||
var scrollTo = 0;
|
||||
this.$body.find("> tr:not(.group-by):lt(".concat(options.value, ")")).each(function (i, el) {
|
||||
scrollTo += $(el).outerHeight(true);
|
||||
});
|
||||
var $targetColumn = this.$body.find("> tr:not(.group-by):eq(".concat(options.value, ")"));
|
||||
$targetColumn.prevAll('.group-by').each(function (i, el) {
|
||||
scrollTo += $(el).outerHeight(true);
|
||||
});
|
||||
this.$tableBody.scrollTop(scrollTo);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_get(_getPrototypeOf(_class.prototype), "scrollTo", this).call(this, params);
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.bootstrap-table .table>tbody>tr.group-by.collapsed,.bootstrap-table .table>tbody>tr.group-by.expanded{cursor:pointer}.bootstrap-table .table>tbody>tr.hidden{display:none}
|
||||
+10
File diff suppressed because one or more lines are too long
+117
@@ -0,0 +1,117 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.object.to-string.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.object.to-string.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, global.jQuery));
|
||||
})(this, (function (es_object_toString_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Jewway
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
$.fn.bootstrapTable.methods.push('changeTitle');
|
||||
$.fn.bootstrapTable.methods.push('changeLocale');
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "changeTitle",
|
||||
value: function changeTitle(locale) {
|
||||
this.options.columns.forEach(function (columnList) {
|
||||
columnList.forEach(function (column) {
|
||||
if (column.field) {
|
||||
column.title = locale[column.field];
|
||||
}
|
||||
});
|
||||
});
|
||||
this.initHeader();
|
||||
this.initBody();
|
||||
this.initToolbar();
|
||||
}
|
||||
}, {
|
||||
key: "changeLocale",
|
||||
value: function changeLocale(localeId) {
|
||||
this.options.locale = localeId;
|
||||
this.initLocale();
|
||||
this.initPagination();
|
||||
this.initBody();
|
||||
this.initToolbar();
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.object.to-string.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.object.to-string.js","core-js/modules/web.dom-collections.for-each.js","jquery"],t):t(null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,o){"use strict";function n(e,t,o){return t=i(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,o||[],i(e).constructor):t.apply(e,o))}function r(e,t,o){return t&&function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}o.fn.bootstrapTable.methods.push("changeTitle"),o.fn.bootstrapTable.methods.push("changeLocale"),o.BootstrapTable=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),r(t,[{key:"changeTitle",value:function(e){this.options.columns.forEach((function(t){t.forEach((function(t){t.field&&(t.title=e[t.field])}))})),this.initHeader(),this.initBody(),this.initToolbar()}},{key:"changeLocale",value:function(e){this.options.locale=e,this.initLocale(),this.initPagination(),this.initBody(),this.initToolbar()}}])}(o.BootstrapTable)}));
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.search.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.search.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_object_assign_js, es_object_toString_js, es_regexp_exec_js, es_string_search_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
keyEvents: false
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
if (this.options.keyEvents) {
|
||||
this.initKeyEvents();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initKeyEvents",
|
||||
value: function initKeyEvents() {
|
||||
var _this = this;
|
||||
$(document).off('keydown').on('keydown', function (e) {
|
||||
var $search = Utils.getSearchInput(_this);
|
||||
var $refresh = _this.$toolbar.find('button[name="refresh"]');
|
||||
var $toggle = _this.$toolbar.find('button[name="toggle"]');
|
||||
var $paginationSwitch = _this.$toolbar.find('button[name="paginationSwitch"]');
|
||||
if (document.activeElement === $search.get(0) || !$.contains(document.activeElement, _this.$toolbar.get(0))) {
|
||||
return true;
|
||||
}
|
||||
switch (e.keyCode) {
|
||||
case 83:
|
||||
// s
|
||||
if (!_this.options.search) {
|
||||
return;
|
||||
}
|
||||
$search.focus();
|
||||
return false;
|
||||
case 82:
|
||||
// r
|
||||
if (!_this.options.showRefresh) {
|
||||
return;
|
||||
}
|
||||
$refresh.click();
|
||||
return false;
|
||||
case 84:
|
||||
// t
|
||||
if (!_this.options.showToggle) {
|
||||
return;
|
||||
}
|
||||
$toggle.click();
|
||||
return false;
|
||||
case 80:
|
||||
// p
|
||||
if (!_this.options.showPaginationSwitch) {
|
||||
return;
|
||||
}
|
||||
$paginationSwitch.click();
|
||||
return false;
|
||||
case 37:
|
||||
// left
|
||||
if (!_this.options.pagination) {
|
||||
return;
|
||||
}
|
||||
_this.prevPage();
|
||||
return false;
|
||||
case 39:
|
||||
// right
|
||||
if (!_this.options.pagination) {
|
||||
return;
|
||||
}
|
||||
_this.nextPage();
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.find.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.to-string.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.string.search.js","jquery"],t):t(null,null,null,null,null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,r,n,o,i,u){"use strict";function s(e,t,r){return t=l(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function c(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},a.apply(null,arguments)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function y(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var b=u.fn.bootstrapTable.utils;Object.assign(u.fn.bootstrapTable.defaults,{keyEvents:!1}),u.BootstrapTable=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),c(t,[{key:"init",value:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=a(l(t.prototype),"init",this)).call.apply(e,[this].concat(n)),this.options.keyEvents&&this.initKeyEvents()}},{key:"initKeyEvents",value:function(){var e=this;u(document).off("keydown").on("keydown",(function(t){var r=b.getSearchInput(e),n=e.$toolbar.find('button[name="refresh"]'),o=e.$toolbar.find('button[name="toggle"]'),i=e.$toolbar.find('button[name="paginationSwitch"]');if(document.activeElement===r.get(0)||!u.contains(document.activeElement,e.$toolbar.get(0)))return!0;switch(t.keyCode){case 83:if(!e.options.search)return;return r.focus(),!1;case 82:if(!e.options.showRefresh)return;return n.click(),!1;case 84:if(!e.options.showToggle)return;return o.click(),!1;case 80:if(!e.options.showPaginationSwitch)return;return i.click(),!1;case 37:if(!e.options.pagination)return;return e.prevPage(),!1;case 39:if(!e.options.pagination)return;return void e.nextPage()}}))}}])}(u.BootstrapTable)}));
|
||||
Vendored
+222
@@ -0,0 +1,222 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.for-each.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_includes_js, es_object_assign_js, es_object_toString_js, es_string_includes_js, web_domCollections_forEach_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var debounce = function debounce(func, wait) {
|
||||
var timeout = 0;
|
||||
return function () {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
var later = function later() {
|
||||
timeout = 0;
|
||||
func.apply(void 0, args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
mobileResponsive: false,
|
||||
minWidth: 562,
|
||||
minHeight: undefined,
|
||||
heightThreshold: 100,
|
||||
// just slightly larger than mobile chrome's auto-hiding toolbar
|
||||
checkOnInit: true,
|
||||
columnsHidden: []
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2,
|
||||
_this = this;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
if (!this.options.mobileResponsive || !this.options.minWidth) {
|
||||
return;
|
||||
}
|
||||
if (this.options.minWidth < 100 && this.options.resizable) {
|
||||
console.warn('The minWidth when the resizable extension is active should be greater or equal than 100');
|
||||
this.options.minWidth = 100;
|
||||
}
|
||||
var old = {
|
||||
width: $(window).width(),
|
||||
height: $(window).height()
|
||||
};
|
||||
$(window).on('resize orientationchange', debounce(function () {
|
||||
// reset view if height has only changed by at least the threshold.
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
var $activeElement = $(document.activeElement);
|
||||
if ($activeElement.length && ['INPUT', 'SELECT', 'TEXTAREA'].includes($activeElement.prop('nodeName'))) {
|
||||
return;
|
||||
}
|
||||
if (Math.abs(old.height - height) > _this.options.heightThreshold || old.width !== width) {
|
||||
_this.changeView(width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
}, 200));
|
||||
if (this.options.checkOnInit) {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
this.changeView(width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "conditionCardView",
|
||||
value: function conditionCardView() {
|
||||
this.changeTableView(false);
|
||||
this.showHideColumns(false);
|
||||
}
|
||||
}, {
|
||||
key: "conditionFullView",
|
||||
value: function conditionFullView() {
|
||||
this.changeTableView(true);
|
||||
this.showHideColumns(true);
|
||||
}
|
||||
}, {
|
||||
key: "changeTableView",
|
||||
value: function changeTableView(cardViewState) {
|
||||
this.options.cardView = cardViewState;
|
||||
this.toggleView();
|
||||
}
|
||||
}, {
|
||||
key: "showHideColumns",
|
||||
value: function showHideColumns(checked) {
|
||||
var _this2 = this;
|
||||
if (this.options.columnsHidden.length > 0) {
|
||||
this.columns.forEach(function (column) {
|
||||
if (_this2.options.columnsHidden.includes(column.field)) {
|
||||
if (column.visible !== checked) {
|
||||
_this2._toggleColumn(_this2.fieldsColumnsIndex[column.field], checked, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "changeView",
|
||||
value: function changeView(width, height) {
|
||||
if (this.options.minHeight) {
|
||||
if (width <= this.options.minWidth && height <= this.options.minHeight) {
|
||||
this.conditionCardView();
|
||||
} else if (width > this.options.minWidth && height > this.options.minHeight) {
|
||||
this.conditionFullView();
|
||||
}
|
||||
} else if (width <= this.options.minWidth) {
|
||||
this.conditionCardView();
|
||||
} else if (width > this.options.minWidth) {
|
||||
this.conditionFullView();
|
||||
}
|
||||
this.resetView();
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
+481
@@ -0,0 +1,481 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.array.splice.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.regexp.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.array.splice.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.regexp.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_map_js, es_array_slice_js, es_array_sort_js, es_array_splice_js, es_object_assign_js, es_object_toString_js, es_parseFloat_js, es_regexp_toString_js, $) { 'use strict';
|
||||
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Nadim Basalamah <dimbslmh@gmail.com>
|
||||
* @version: v1.1.0
|
||||
* @update: ErwannNevou <https://github.com/ErwannNevou>
|
||||
*/
|
||||
|
||||
var isSingleSort = false;
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
plus: {
|
||||
bootstrap3: 'glyphicon-plus',
|
||||
bootstrap4: 'fa-plus',
|
||||
bootstrap5: 'bi-plus',
|
||||
semantic: 'fa-plus',
|
||||
materialize: 'plus',
|
||||
foundation: 'fa-plus',
|
||||
bulma: 'fa-plus',
|
||||
'bootstrap-table': 'icon-plus'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-clock',
|
||||
minus: {
|
||||
bootstrap3: 'glyphicon-minus',
|
||||
bootstrap4: 'fa-minus',
|
||||
bootstrap5: 'bi-dash',
|
||||
semantic: 'fa-minus',
|
||||
materialize: 'minus',
|
||||
foundation: 'fa-minus',
|
||||
bulma: 'fa-minus',
|
||||
'bootstrap-table': 'icon-minus'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-clock',
|
||||
sort: {
|
||||
bootstrap3: 'glyphicon-sort',
|
||||
bootstrap4: 'fa-sort',
|
||||
bootstrap5: 'bi-arrow-down-up',
|
||||
semantic: 'fa-sort',
|
||||
materialize: 'sort',
|
||||
foundation: 'fa-sort',
|
||||
bulma: 'fa-sort',
|
||||
'bootstrap-table': 'icon-sort-amount-asc'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-clock'
|
||||
});
|
||||
var theme = {
|
||||
bootstrap3: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\" id=\"%sLabel\">%s</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <button type=\"button\" class=\"toolbar-btn-add btn btn-default\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete btn btn-default\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s form-control">'
|
||||
}
|
||||
},
|
||||
bootstrap4: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars pb-3\">\n <button type=\"button\" class=\"toolbar-btn-add btn btn-secondary\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s form-control">'
|
||||
}
|
||||
},
|
||||
bootstrap5: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"modal \" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars pb-3\">\n <button type=\"button\" class=\"toolbar-btn-add btn btn-secondary\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" type="button" data-bs-toggle="modal" data-bs-target="#%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s form-control">'
|
||||
}
|
||||
},
|
||||
semantic: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"ui modal tiny\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <i class=\"close icon\"></i>\n <div class=\"header\" id=\"%sLabel\">\n %s\n </div>\n <div class=\"image content\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars pb-3\">\n <button type=\"button\" class=\"toolbar-btn-add ui button\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete ui button\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <div class=\"ui button deny\">%s</div>\n <div class=\"ui button approve multi-sort-order-button\">%s</div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s">'
|
||||
}
|
||||
},
|
||||
materialize: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div id=\"%s\" class=\"modal\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-content\" id=\"%sLabel\">\n <h4>%s</h4>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars pb-3\">\n <button type=\"button\" class=\"toolbar-btn-add waves-effect waves-light btn\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete waves-effect waves-light btn\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn\">%s</a>\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn multi-sort-order-button\">%s</a>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<a class="multi-sort %s modal-trigger" href="#%s" type="button" data-toggle="modal" title="%s">%s</a>',
|
||||
multipleSortSelect: '<select class="%s %s browser-default">'
|
||||
}
|
||||
},
|
||||
foundation: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars padding-bottom-2\">\n <button type=\"button\" class=\"toolbar-btn-add waves-effect waves-light button\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" data-open="%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s browser-default">'
|
||||
}
|
||||
},
|
||||
bulma: {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars padding-bottom-2\">\n <button type=\"button\" class=\"toolbar-btn-add waves-effect waves-light button\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <button type=\"button\" class=\"waves-effect waves-light button\" data-close>%s</button>\n <button type=\"button\" class=\"waves-effect waves-light button multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s browser-default">'
|
||||
}
|
||||
},
|
||||
'bootstrap-table': {
|
||||
html: {
|
||||
multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars padding-bottom-2\">\n <button type=\"button\" class=\"toolbar-btn-add btn\">%s %s</button>\n <button type=\"button\" class=\"toolbar-btn-delete btn\" disabled>%s %s</button>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"mt-30\">\n <button type=\"button\" class=\"btn\" data-close>%s</button>\n <button type=\"button\" class=\"btn multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
|
||||
multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
|
||||
multipleSortSelect: '<select class="%s %s browser-default">'
|
||||
}
|
||||
}
|
||||
}[$.fn.bootstrapTable.theme];
|
||||
var showSortModal = function showSortModal(that) {
|
||||
var _selector = that.sortModalSelector;
|
||||
var _id = "#".concat(_selector);
|
||||
var o = that.options;
|
||||
if (!$(_id).hasClass('modal')) {
|
||||
var sModal = Utils.sprintf(theme.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
|
||||
$('body').append($(sModal));
|
||||
that.$sortModal = $(_id);
|
||||
var $rows = that.$sortModal.find('tbody > tr');
|
||||
that.$sortModal.off('click', '.toolbar-btn-add').on('click', '.toolbar-btn-add', function () {
|
||||
var total = that.$sortModal.find('.multi-sort-name:first option').length;
|
||||
var current = that.$sortModal.find('tbody tr').length;
|
||||
if (current < total) {
|
||||
current++;
|
||||
that.addLevel();
|
||||
that.setButtonStates();
|
||||
}
|
||||
});
|
||||
that.$sortModal.off('click', '.toolbar-btn-delete').on('click', '.toolbar-btn-delete', function () {
|
||||
var total = that.$sortModal.find('.multi-sort-name:first option').length;
|
||||
var current = that.$sortModal.find('tbody tr').length;
|
||||
if (current > 1 && current <= total) {
|
||||
current--;
|
||||
that.$sortModal.find('tbody tr:last').remove();
|
||||
that.setButtonStates();
|
||||
}
|
||||
});
|
||||
that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
|
||||
var $rows = that.$sortModal.find('tbody > tr');
|
||||
var $alert = that.$sortModal.find('div.alert');
|
||||
var fields = [];
|
||||
var results = [];
|
||||
var sortPriority = $.map($rows, function (row) {
|
||||
var $row = $(row);
|
||||
var name = $row.find('.multi-sort-name').val();
|
||||
var order = $row.find('.multi-sort-order').val();
|
||||
fields.push(name);
|
||||
return {
|
||||
sortName: name,
|
||||
sortOrder: order
|
||||
};
|
||||
});
|
||||
var sorted_fields = fields.sort();
|
||||
for (var i = 0; i < fields.length - 1; i++) {
|
||||
if (sorted_fields[i + 1] === sorted_fields[i]) {
|
||||
results.push(sorted_fields[i]);
|
||||
}
|
||||
}
|
||||
if (results.length > 0) {
|
||||
if ($alert.length === 0) {
|
||||
$alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
|
||||
$($alert).insertBefore(that.$sortModal.find('.bars'));
|
||||
}
|
||||
} else {
|
||||
if ($alert.length === 1) {
|
||||
$($alert).remove();
|
||||
}
|
||||
if (['bootstrap3', 'bootstrap4', 'bootstrap5'].includes($.fn.bootstrapTable.theme)) {
|
||||
that.$sortModal.modal('hide');
|
||||
}
|
||||
that.multiSort(sortPriority);
|
||||
}
|
||||
});
|
||||
if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
|
||||
if (that.options.sortName) {
|
||||
that.options.sortPriority = [{
|
||||
sortName: that.options.sortName,
|
||||
sortOrder: that.options.sortOrder
|
||||
}];
|
||||
}
|
||||
}
|
||||
if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
|
||||
if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
|
||||
for (var i = 0; i < that.options.sortPriority.length; i++) {
|
||||
that.addLevel(i, that.options.sortPriority[i]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
that.addLevel(0);
|
||||
}
|
||||
that.setButtonStates();
|
||||
}
|
||||
};
|
||||
$.fn.bootstrapTable.methods.push('multipleSort');
|
||||
$.fn.bootstrapTable.methods.push('multiSort');
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
showMultiSort: false,
|
||||
showMultiSortButton: true,
|
||||
multiSortStrictSort: false,
|
||||
sortPriority: null,
|
||||
onMultipleSort: function onMultipleSort() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'multiple-sort.bs.table': 'onMultipleSort'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatMultipleSort: function formatMultipleSort() {
|
||||
return 'Multiple Sort';
|
||||
},
|
||||
formatAddLevel: function formatAddLevel() {
|
||||
return 'Add Level';
|
||||
},
|
||||
formatDeleteLevel: function formatDeleteLevel() {
|
||||
return 'Delete Level';
|
||||
},
|
||||
formatColumn: function formatColumn() {
|
||||
return 'Column';
|
||||
},
|
||||
formatOrder: function formatOrder() {
|
||||
return 'Order';
|
||||
},
|
||||
formatSortBy: function formatSortBy() {
|
||||
return 'Sort by';
|
||||
},
|
||||
formatThenBy: function formatThenBy() {
|
||||
return 'Then by';
|
||||
},
|
||||
formatSort: function formatSort() {
|
||||
return 'Sort';
|
||||
},
|
||||
formatCancel: function formatCancel() {
|
||||
return 'Cancel';
|
||||
},
|
||||
formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
|
||||
return 'Duplicate(s) detected!';
|
||||
},
|
||||
formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
|
||||
return 'Please remove or change any duplicate column.';
|
||||
},
|
||||
formatSortOrders: function formatSortOrders() {
|
||||
return {
|
||||
asc: 'Ascending',
|
||||
desc: 'Descending'
|
||||
};
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor;
|
||||
var _initToolbar = BootstrapTable.prototype.initToolbar;
|
||||
var _destroy = BootstrapTable.prototype.destroy;
|
||||
BootstrapTable.prototype.initToolbar = function () {
|
||||
var _this = this;
|
||||
this.showToolbar = this.showToolbar || this.options.showMultiSort;
|
||||
var that = this;
|
||||
var sortModalSelector = Utils.getEventName('sort-modal', this.$el.attr('id'));
|
||||
var sortModalId = "#".concat(sortModalSelector);
|
||||
var $multiSortBtn = this.$toolbar.find('div.multi-sort');
|
||||
var o = this.options;
|
||||
this.$sortModal = $(sortModalId);
|
||||
this.sortModalSelector = sortModalSelector;
|
||||
if (that.options.sortPriority !== null) {
|
||||
that.onMultipleSort();
|
||||
}
|
||||
if (this.options.showMultiSort && this.options.showMultiSortButton) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
multipleSort: {
|
||||
html: Utils.sprintf(theme.html.multipleSortButton, that.constants.buttonsClass, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort))
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
_initToolbar.apply(this, Array.prototype.slice.apply(args));
|
||||
if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null) {
|
||||
var t = that.options.queryParams;
|
||||
that.options.queryParams = function (params) {
|
||||
params.multiSort = that.options.sortPriority;
|
||||
return t(params);
|
||||
};
|
||||
}
|
||||
if (this.options.showMultiSort) {
|
||||
if (!$multiSortBtn.length && this.options.showMultiSortButton) {
|
||||
if ($.fn.bootstrapTable.theme === 'semantic') {
|
||||
this.$toolbar.find('.multi-sort').on('click', function () {
|
||||
$(sortModalId).modal('show');
|
||||
});
|
||||
} else if ($.fn.bootstrapTable.theme === 'materialize') {
|
||||
this.$toolbar.find('.multi-sort').on('click', function () {
|
||||
$(sortModalId).modal();
|
||||
});
|
||||
} else if ($.fn.bootstrapTable.theme === 'bootstrap-table') {
|
||||
this.$toolbar.find('.multi-sort').on('click', function () {
|
||||
$(sortModalId).addClass('show');
|
||||
});
|
||||
} else if ($.fn.bootstrapTable.theme === 'foundation') {
|
||||
this.$toolbar.find('.multi-sort').on('click', function () {
|
||||
if (!_this.foundationModal) {
|
||||
// eslint-disable-next-line no-undef
|
||||
_this.foundationModal = new Foundation.Reveal($(sortModalId));
|
||||
}
|
||||
_this.foundationModal.open();
|
||||
});
|
||||
} else if ($.fn.bootstrapTable.theme === 'bulma') {
|
||||
this.$toolbar.find('.multi-sort').on('click', function () {
|
||||
$('html').toggleClass('is-clipped');
|
||||
$(sortModalId).toggleClass('is-active');
|
||||
$('button[data-close]').one('click', function () {
|
||||
$('html').toggleClass('is-clipped');
|
||||
$(sortModalId).toggleClass('is-active');
|
||||
});
|
||||
});
|
||||
}
|
||||
showSortModal(that);
|
||||
}
|
||||
this.$el.on('sort.bs.table', function () {
|
||||
isSingleSort = true;
|
||||
});
|
||||
this.$el.on('multiple-sort.bs.table', function () {
|
||||
isSingleSort = false;
|
||||
});
|
||||
this.$el.on('load-success.bs.table', function () {
|
||||
if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
|
||||
that.onMultipleSort();
|
||||
}
|
||||
});
|
||||
this.$el.on('column-switch.bs.table', function (field, checked) {
|
||||
if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
|
||||
for (var i = 0; i < that.options.sortPriority.length; i++) {
|
||||
if (that.options.sortPriority[i].sortName === checked) {
|
||||
that.options.sortPriority.splice(i, 1);
|
||||
}
|
||||
}
|
||||
that.assignSortableArrows();
|
||||
}
|
||||
that.$sortModal.remove();
|
||||
showSortModal(that);
|
||||
});
|
||||
this.$el.on('reset-view.bs.table', function () {
|
||||
if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object') {
|
||||
that.assignSortableArrows();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.destroy = function () {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
_destroy.apply(this, Array.prototype.slice.apply(args));
|
||||
if (this.options.showMultiSort) {
|
||||
this.enableCustomSort = false;
|
||||
this.$sortModal.remove();
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.multipleSort = function () {
|
||||
var that = this;
|
||||
if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
|
||||
that.onMultipleSort();
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.onMultipleSort = function () {
|
||||
var that = this;
|
||||
var cmp = function cmp(x, y) {
|
||||
return x > y ? 1 : x < y ? -1 : 0;
|
||||
};
|
||||
var arrayCmp = function arrayCmp(a, b) {
|
||||
var arr1 = [];
|
||||
var arr2 = [];
|
||||
for (var i = 0; i < that.options.sortPriority.length; i++) {
|
||||
var fieldName = that.options.sortPriority[i].sortName;
|
||||
var fieldIndex = that.header.fields.indexOf(fieldName);
|
||||
var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
|
||||
if (that.header.sortNames[fieldIndex]) {
|
||||
fieldName = that.header.sortNames[fieldIndex];
|
||||
}
|
||||
var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
|
||||
var aa = Utils.getItemField(a, fieldName);
|
||||
var bb = Utils.getItemField(b, fieldName);
|
||||
var value1 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb, a, b]);
|
||||
var value2 = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa, b, a]);
|
||||
if (value1 !== undefined && value2 !== undefined) {
|
||||
arr1.push(order * value1);
|
||||
arr2.push(order * value2);
|
||||
continue;
|
||||
}
|
||||
if (aa === undefined || aa === null) aa = '';
|
||||
if (bb === undefined || bb === null) bb = '';
|
||||
if ($.isNumeric(aa) && $.isNumeric(bb)) {
|
||||
aa = parseFloat(aa);
|
||||
bb = parseFloat(bb);
|
||||
} else {
|
||||
aa = aa.toString();
|
||||
bb = bb.toString();
|
||||
if (that.options.multiSortStrictSort) {
|
||||
aa = aa.toLowerCase();
|
||||
bb = bb.toLowerCase();
|
||||
}
|
||||
}
|
||||
arr1.push(order * cmp(aa, bb));
|
||||
arr2.push(order * cmp(bb, aa));
|
||||
}
|
||||
return cmp(arr1, arr2);
|
||||
};
|
||||
this.enableCustomSort = true;
|
||||
this.data.sort(function (a, b) {
|
||||
return arrayCmp(a, b);
|
||||
});
|
||||
this.initBody();
|
||||
this.assignSortableArrows();
|
||||
this.trigger('multiple-sort');
|
||||
};
|
||||
BootstrapTable.prototype.addLevel = function (index, sortPriority) {
|
||||
var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
|
||||
this.$sortModal.find('tbody').append($('<tr>').append($('<td>').text(text)).append($('<td>').append($(Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($('<td>').append($(Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
|
||||
var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
|
||||
var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
|
||||
$.each(this.columns, function (i, column) {
|
||||
if (column.sortable === false || column.visible === false) {
|
||||
return true;
|
||||
}
|
||||
$multiSortName.append("<option value=\"".concat(column.field, "\">").concat(column.title, "</option>"));
|
||||
});
|
||||
$.each(this.options.formatSortOrders(), function (value, order) {
|
||||
$multiSortOrder.append("<option value=\"".concat(value, "\">").concat(order, "</option>"));
|
||||
});
|
||||
if (sortPriority !== undefined) {
|
||||
$multiSortName.find("option[value=\"".concat(sortPriority.sortName, "\"]")).attr('selected', true);
|
||||
$multiSortOrder.find("option[value=\"".concat(sortPriority.sortOrder, "\"]")).attr('selected', true);
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.assignSortableArrows = function () {
|
||||
var that = this;
|
||||
var headers = that.$header.find('th');
|
||||
for (var i = 0; i < headers.length; i++) {
|
||||
for (var c = 0; c < that.options.sortPriority.length; c++) {
|
||||
if ($(headers[i]).data('field') === that.options.sortPriority[c].sortName) {
|
||||
$(headers[i]).find('.sortable').removeClass('desc asc').addClass(that.options.sortPriority[c].sortOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.setButtonStates = function () {
|
||||
var total = this.$sortModal.find('.multi-sort-name:first option').length;
|
||||
var current = this.$sortModal.find('tbody tr').length;
|
||||
if (current === total) {
|
||||
this.$sortModal.find('.toolbar-btn-add').attr('disabled', 'disabled');
|
||||
}
|
||||
if (current > 1) {
|
||||
this.$sortModal.find('.toolbar-btn-delete').removeAttr('disabled');
|
||||
}
|
||||
if (current < total) {
|
||||
this.$sortModal.find('.toolbar-btn-add').removeAttr('disabled');
|
||||
}
|
||||
if (current === 1) {
|
||||
this.$sortModal.find('.toolbar-btn-delete').attr('disabled', 'disabled');
|
||||
}
|
||||
};
|
||||
BootstrapTable.prototype.multiSort = function (sortPriority) {
|
||||
var _this2 = this;
|
||||
this.options.sortPriority = sortPriority;
|
||||
this.options.sortName = undefined;
|
||||
if (this.options.sidePagination === 'server') {
|
||||
var queryParams = this.options.queryParams;
|
||||
this.options.queryParams = function (params) {
|
||||
params.multiSort = _this2.options.sortPriority;
|
||||
return $.fn.bootstrapTable.utils.calculateObjectValue(_this2.options, queryParams, [params]);
|
||||
};
|
||||
isSingleSort = false;
|
||||
this.initServer(this.options.silentSort);
|
||||
}
|
||||
this.onMultipleSort();
|
||||
};
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.bootstrap-table.bootstrap3 .fixed-table-pagination>.pagination .page-jump-to{display:inline-block}.bootstrap-table.bootstrap3 .fixed-table-pagination>.pagination .input-group-btn{width:auto}.bootstrap-table .fixed-table-pagination>.pagination .page-jump-to input{width:70px;margin-left:5px;text-align:center;float:left}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_object_assign_js, es_object_toString_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Jay <jwang@dizsoft.com>
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
showJumpTo: false,
|
||||
showJumpToByPages: 0
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatJumpTo: function formatJumpTo() {
|
||||
return 'GO';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initPagination",
|
||||
value: function initPagination() {
|
||||
var _get2,
|
||||
_this = this;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initPagination", this)).call.apply(_get2, [this].concat(args));
|
||||
if (this.options.showJumpTo && this.totalPages >= this.options.showJumpToByPages) {
|
||||
var $pageGroup = this.$pagination.find('> .pagination');
|
||||
var $jumpTo = $pageGroup.find('.page-jump-to');
|
||||
if (!$jumpTo.length) {
|
||||
$jumpTo = $(Utils.sprintf(this.constants.html.inputGroup, "<input type=\"number\"\n class=\"".concat(this.constants.classes.input).concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, this.options.iconSize), "\"\n value=\"").concat(this.options.pageNumber, "\"\n min=\"1\"\n max=\"").concat(this.totalPages, "\">"), "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\">\n ").concat(this.options.formatJumpTo(), "\n </button>"))).addClass('page-jump-to').appendTo($pageGroup);
|
||||
var _iterator = _createForOfIteratorHelper($jumpTo),
|
||||
_step;
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var el = _step.value;
|
||||
var $input = $(el).find('input');
|
||||
$(el).find('button').click(function () {
|
||||
_this.selectPage(+$input.val());
|
||||
});
|
||||
$input.keyup(function (e) {
|
||||
if ($input.val() === '') {
|
||||
return;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
_this.selectPage(+$input.val());
|
||||
return;
|
||||
}
|
||||
if (+$input.val() < +$input.attr('min')) {
|
||||
$input.val($input.attr('min'));
|
||||
} else if (+$input.val() > +$input.attr('max')) {
|
||||
$input.val($input.attr('max'));
|
||||
}
|
||||
});
|
||||
$input.blur(function () {
|
||||
if ($input.val() === '') {
|
||||
$input.val(_this.options.pageNumber);
|
||||
}
|
||||
});
|
||||
};
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.bootstrap-table.bootstrap3 .fixed-table-pagination>.pagination .page-jump-to{display:inline-block}.bootstrap-table.bootstrap3 .fixed-table-pagination>.pagination .input-group-btn{width:auto}.bootstrap-table .fixed-table-pagination>.pagination .page-jump-to input{width:70px;margin-left:5px;text-align:center;float:left}
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+409
@@ -0,0 +1,409 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.parse-int.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.parse-int.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_slice_js, es_object_assign_js, es_parseInt_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _defineProperty(e, r, t) {
|
||||
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
||||
value: t,
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0
|
||||
}) : e[r] = t, e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function ownKeys(e, r) {
|
||||
var t = Object.keys(e);
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var o = Object.getOwnPropertySymbols(e);
|
||||
r && (o = o.filter(function (r) {
|
||||
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
||||
})), t.push.apply(t, o);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
function _objectSpread2(e) {
|
||||
for (var r = 1; r < arguments.length; r++) {
|
||||
var t = null != arguments[r] ? arguments[r] : {};
|
||||
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
||||
_defineProperty(e, r, t[r]);
|
||||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
||||
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
||||
});
|
||||
}
|
||||
return e;
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author doug-the-guy
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*
|
||||
* Bootstrap Table Pipeline
|
||||
* -----------------------
|
||||
*
|
||||
* This plugin enables client side data caching for server side requests which will
|
||||
* eliminate the need to issue a new request every page change. This will allow
|
||||
* for a performance balance for a large data set between returning all data at once
|
||||
* (client side paging) and a new server side request (server side paging).
|
||||
*
|
||||
* There are two new options:
|
||||
* - usePipeline: enables this feature
|
||||
* - pipelineSize: the size of each cache window
|
||||
*
|
||||
* The size of the pipeline must be evenly divisible by the current page size. This is
|
||||
* assured by rounding up to the nearest evenly divisible value. For example, if
|
||||
* the pipeline size is 4990 and the current page size is 25, then pipeline size will
|
||||
* be dynamically set to 5000.
|
||||
*
|
||||
* The cache windows are computed based on the pipeline size and the total number of rows
|
||||
* returned by the server side query. For example, with pipeline size 500 and total rows
|
||||
* 1300, the cache windows will be:
|
||||
*
|
||||
* [{'lower': 0, 'upper': 499}, {'lower': 500, 'upper': 999}, {'lower': 1000, 'upper': 1499}]
|
||||
*
|
||||
* Using the limit (i.e. the pipelineSize) and offset parameters, the server side request
|
||||
* **MUST** return only the data in the requested cache window **AND** the total number of rows.
|
||||
* To wit, the server side code must use the offset and limit parameters to prepare the response
|
||||
* data.
|
||||
*
|
||||
* On a page change, the new offset is checked if it is within the current cache window. If so,
|
||||
* the requested page data is returned from the cached data set. Otherwise, a new server side
|
||||
* request will be issued for the new cache window.
|
||||
*
|
||||
* The current cached data is only invalidated on these events:
|
||||
* * sorting
|
||||
* * searching
|
||||
* * page size change
|
||||
* * page change moves into a new cache window
|
||||
*
|
||||
* There are two new events:
|
||||
* - cached-data-hit.bs.table: issued when cached data is used on a page change
|
||||
* - cached-data-reset.bs.table: issued when the cached data is invalidated and a
|
||||
* new server side request is issued
|
||||
*
|
||||
**/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
usePipeline: false,
|
||||
pipelineSize: 1000,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onCachedDataHit: function onCachedDataHit(data) {
|
||||
return false;
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onCachedDataReset: function onCachedDataReset(data) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'cached-data-hit.bs.table': 'onCachedDataHit',
|
||||
'cached-data-reset.bs.table': 'onCachedDataReset'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value:
|
||||
// needs to be called before initServer
|
||||
function init() {
|
||||
var _get2;
|
||||
if (this.options.usePipeline) {
|
||||
this.initPipeline();
|
||||
}
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "initPipeline",
|
||||
value: function initPipeline() {
|
||||
this.cacheRequestJSON = {};
|
||||
this.cacheWindows = [];
|
||||
this.currWindow = 0;
|
||||
this.resetCache = true;
|
||||
}
|
||||
|
||||
// force a cache reset on search
|
||||
}, {
|
||||
key: "onSearch",
|
||||
value: function onSearch() {
|
||||
var _get3;
|
||||
if (this.options.usePipeline) {
|
||||
this.resetCache = true;
|
||||
}
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "onSearch", this)).call.apply(_get3, [this].concat(args));
|
||||
}
|
||||
|
||||
// force a cache reset on sort
|
||||
}, {
|
||||
key: "onSort",
|
||||
value: function onSort() {
|
||||
var _get4;
|
||||
if (this.options.usePipeline) {
|
||||
this.resetCache = true;
|
||||
}
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
|
||||
}
|
||||
|
||||
// rebuild cache window on page size change
|
||||
}, {
|
||||
key: "onPageListChange",
|
||||
value: function onPageListChange(event) {
|
||||
var target = $(event.currentTarget);
|
||||
var newPageSize = parseInt(target.text(), 10);
|
||||
this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
|
||||
this.resetCache = true;
|
||||
_get(_getPrototypeOf(_class.prototype), "onPageListChange", this).call(this, event);
|
||||
}
|
||||
|
||||
// calculate pipeline size by rounding up to
|
||||
// the nearest value evenly divisible by the pageSize
|
||||
}, {
|
||||
key: "calculatePipelineSize",
|
||||
value: function calculatePipelineSize(pipelineSize, pageSize) {
|
||||
if (pageSize === 0) {
|
||||
return 0;
|
||||
}
|
||||
return Math.ceil(pipelineSize / pageSize) * pageSize;
|
||||
}
|
||||
|
||||
// set cache windows based on the total number of rows returned
|
||||
// by server side request and the pipelineSize
|
||||
}, {
|
||||
key: "setCacheWindows",
|
||||
value: function setCacheWindows() {
|
||||
this.cacheWindows = [];
|
||||
for (var i = 0; i <= this.options.totalRows / this.options.pipelineSize; i++) {
|
||||
var lower = i * this.options.pipelineSize;
|
||||
this.cacheWindows[i] = {
|
||||
lower: lower,
|
||||
upper: lower + this.options.pipelineSize - 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// set the current cache window index, based on where the current offset falls
|
||||
}, {
|
||||
key: "setCurrWindow",
|
||||
value: function setCurrWindow(offset) {
|
||||
this.currWindow = 0;
|
||||
for (var i = 0; i < this.cacheWindows.length; i++) {
|
||||
if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
|
||||
this.currWindow = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// draw rows from the cache using offset and limit
|
||||
}, {
|
||||
key: "drawFromCache",
|
||||
value: function drawFromCache(offset, limit) {
|
||||
var res = Utils.extend(true, {}, this.cacheRequestJSON);
|
||||
var drawStart = offset - this.cacheWindows[this.currWindow].lower;
|
||||
var drawEnd = drawStart + limit;
|
||||
res.rows = res.rows.slice(drawStart, drawEnd);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* determine if requested data is in cache (on paging) or if
|
||||
* a new ajax request needs to be issued (sorting, searching, paging
|
||||
* moving outside of cached data, page size change)
|
||||
* initial version of this extension will entirely override base initServer
|
||||
*/
|
||||
}, {
|
||||
key: "initServer",
|
||||
value: function initServer(silent, query, url) {
|
||||
var _this = this;
|
||||
if (!this.options.usePipeline) {
|
||||
return _get(_getPrototypeOf(_class.prototype), "initServer", this).call(this, silent, query, url);
|
||||
}
|
||||
var useAjax = true;
|
||||
var params = {};
|
||||
if (this.options.queryParamsType === 'limit' && this.options.pagination && this.options.sidePagination === 'server') {
|
||||
// same as parent initServer: params.offset
|
||||
params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
|
||||
params.limit = this.options.pageSize;
|
||||
|
||||
// if cacheWindows is empty, this is the initial request
|
||||
if (!this.cacheWindows.length) {
|
||||
useAjax = true;
|
||||
params.drawOffset = params.offset;
|
||||
// cache exists: determine if the page request is entirely within the current cached window
|
||||
} else {
|
||||
var w = this.cacheWindows[this.currWindow];
|
||||
|
||||
// case 1: reset cache but stay within current window (e.g. column sort)
|
||||
// case 2: move outside of the current window (e.g. search or paging)
|
||||
// since each cache window is aligned with the current page size
|
||||
// checking if params.offset is outside the current window is sufficient.
|
||||
// need to re-query for preceding or succeeding cache window
|
||||
// also handle case
|
||||
if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
|
||||
useAjax = true;
|
||||
this.setCurrWindow(params.offset);
|
||||
// store the relative offset for drawing the page data afterwards
|
||||
params.drawOffset = params.offset;
|
||||
// now set params.offset to the lower bound of the new cache window
|
||||
// the server will return that whole cache window
|
||||
params.offset = this.cacheWindows[this.currWindow].lower;
|
||||
// within current cache window
|
||||
} else {
|
||||
useAjax = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// force an ajax call - this is on search, sort or page size change
|
||||
if (this.resetCache) {
|
||||
useAjax = true;
|
||||
this.resetCache = false;
|
||||
}
|
||||
if (useAjax) {
|
||||
// in this scenario limit is used on the server to get the cache window
|
||||
// and drawLimit is used to get the page data afterwards
|
||||
params.drawLimit = params.limit;
|
||||
params.limit = this.options.pipelineSize;
|
||||
}
|
||||
|
||||
// cached results can be used
|
||||
if (!useAjax) {
|
||||
var res = this.drawFromCache(params.offset, params.limit);
|
||||
this.load(res);
|
||||
this.trigger('load-success', res);
|
||||
this.trigger('cached-data-hit', res);
|
||||
return;
|
||||
}
|
||||
if (!this.pipelineResponseHandler) {
|
||||
this.pipelineResponseHandler = this.options.responseHandler;
|
||||
this.options.responseHandler = function (_res, jqXHR) {
|
||||
var res = Utils.calculateObjectValue(_this.options, _this.pipelineResponseHandler, [_res, jqXHR], _res);
|
||||
|
||||
// store entire request in cache
|
||||
_this.cacheRequestJSON = Utils.extend(true, {}, res);
|
||||
// this gets set in load() also but needs to be set before
|
||||
// setting cacheWindows
|
||||
_this.options.totalRows = res[_this.options.totalField];
|
||||
// if this is a search, potentially less results will be returned
|
||||
// so cache windows need to be rebuilt. Otherwise it
|
||||
// will come out the same
|
||||
_this.setCacheWindows();
|
||||
// just load data for the page
|
||||
res = _this.drawFromCache(params.drawOffset, params.drawLimit);
|
||||
_this.trigger('cached-data-reset', res);
|
||||
return res;
|
||||
};
|
||||
}
|
||||
return _get(_getPrototypeOf(_class.prototype), "initServer", this).call(this, silent, _objectSpread2(_objectSpread2({}, query), params), url);
|
||||
}
|
||||
}, {
|
||||
key: "destroy",
|
||||
value: function destroy() {
|
||||
var _get5;
|
||||
this.options.responseHandler = this.pipelineResponseHandler;
|
||||
this.pipelineResponseHandler = null;
|
||||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
(_get5 = _get(_getPrototypeOf(_class.prototype), "destroy", this)).call.apply(_get5, [this].concat(args));
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+412
@@ -0,0 +1,412 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.flat.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.array.unscopables.flat.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.flat.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.array.unscopables.flat.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_flat_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_array_map_js, es_array_slice_js, es_array_sort_js, es_array_unscopables_flat_js, es_object_assign_js, es_object_toString_js, es_regexp_exec_js, es_string_replace_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
function printPageBuilderDefault(table, styles) {
|
||||
return "\n <html>\n <head>\n ".concat(styles, "\n <style type=\"text/css\" media=\"print\">\n @page {\n size: auto;\n margin: 25px 0 25px 0;\n }\n </style>\n <style type=\"text/css\" media=\"all\">\n table {\n border-collapse: collapse;\n font-size: 12px;\n }\n table, th, td {\n border: 1px solid grey;\n }\n th, td {\n text-align: center;\n vertical-align: middle;\n }\n p {\n font-weight: bold;\n margin-left:20px;\n }\n table {\n width: 94%;\n margin-left: 3%;\n margin-right: 3%;\n }\n div.bs-table-print {\n text-align: center;\n }\n </style>\n </head>\n <title>Print Table</title>\n <body>\n <p>Printed on: ").concat(new Date(), " </p>\n <div class=\"bs-table-print\">").concat(table, "</div>\n </body>\n </html>\n ");
|
||||
}
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatPrint: function formatPrint() {
|
||||
return 'Print';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
showPrint: false,
|
||||
printAsFilteredAndSortedOnUI: true,
|
||||
printSortColumn: undefined,
|
||||
printSortOrder: 'asc',
|
||||
printStyles: [],
|
||||
printPageBuilder: function printPageBuilder(table, styles) {
|
||||
return printPageBuilderDefault(table, styles);
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
printFilter: undefined,
|
||||
printIgnore: false,
|
||||
printFormatter: undefined
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
print: {
|
||||
bootstrap3: 'glyphicon-print icon-share',
|
||||
bootstrap5: 'bi-printer',
|
||||
'bootstrap-table': 'icon-printer'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-print'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
if (!this.options.showPrint) {
|
||||
return;
|
||||
}
|
||||
this.mergedCells = [];
|
||||
}
|
||||
}, {
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
var _this = this,
|
||||
_get3;
|
||||
this.showToolbar = this.showToolbar || this.options.showPrint;
|
||||
if (this.options.showPrint) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
print: {
|
||||
text: this.options.formatPrint(),
|
||||
icon: this.options.icons.print,
|
||||
event: function event() {
|
||||
_this.doPrint(_this.options.printAsFilteredAndSortedOnUI ? _this.getData() : _this.options.data.slice(0));
|
||||
},
|
||||
attributes: {
|
||||
'aria-label': this.options.formatPrint(),
|
||||
title: this.options.formatPrint()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get3, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "mergeCells",
|
||||
value: function mergeCells(options) {
|
||||
_get(_getPrototypeOf(_class.prototype), "mergeCells", this).call(this, options);
|
||||
if (!this.options.showPrint) {
|
||||
return;
|
||||
}
|
||||
var col = this.getVisibleFields().indexOf(options.field);
|
||||
if (Utils.hasDetailViewIcon(this.options)) {
|
||||
col += 1;
|
||||
}
|
||||
this.mergedCells.push({
|
||||
row: options.index,
|
||||
col: col,
|
||||
rowspan: options.rowspan || 1,
|
||||
colspan: options.colspan || 1
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "doPrint",
|
||||
value: function doPrint(data) {
|
||||
var _this2 = this;
|
||||
var canPrint = function canPrint(column) {
|
||||
return !column.printIgnore && column.visible;
|
||||
};
|
||||
var formatValue = function formatValue(row, i, column) {
|
||||
var value_ = Utils.getItemField(row, column.field, _this2.options.escape, column.escape);
|
||||
var value = Utils.calculateObjectValue(column, column.printFormatter || column.formatter, [value_, row, i], value_);
|
||||
return typeof value === 'undefined' || value === null ? _this2.options.undefinedText : value;
|
||||
};
|
||||
var buildTable = function buildTable(data, columnsArray) {
|
||||
var dir = _this2.$el.attr('dir') || 'ltr';
|
||||
var html = ["<table dir=\"".concat(dir, "\"><thead>")];
|
||||
var _iterator = _createForOfIteratorHelper(columnsArray),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var _columns2 = _step.value;
|
||||
html.push('<tr>');
|
||||
for (var _h = 0; _h < _columns2.length; _h++) {
|
||||
if (canPrint(_columns2[_h])) {
|
||||
html.push("<th\n ".concat(Utils.sprintf(' rowspan="%s"', _columns2[_h].rowspan), "\n ").concat(Utils.sprintf(' colspan="%s"', _columns2[_h].colspan), "\n >").concat(_columns2[_h].title, "</th>"));
|
||||
}
|
||||
}
|
||||
html.push('</tr>');
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
html.push('</thead><tbody>');
|
||||
var notRender = [];
|
||||
if (_this2.mergedCells) {
|
||||
for (var mc = 0; mc < _this2.mergedCells.length; mc++) {
|
||||
var currentMergedCell = _this2.mergedCells[mc];
|
||||
for (var rs = 0; rs < currentMergedCell.rowspan; rs++) {
|
||||
var row = currentMergedCell.row + rs;
|
||||
for (var cs = 0; cs < currentMergedCell.colspan; cs++) {
|
||||
var col = currentMergedCell.col + cs;
|
||||
notRender.push("".concat(row, ",").concat(col));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
html.push('<tr>');
|
||||
var columns = columnsArray.flat(1);
|
||||
columns.sort(function (c1, c2) {
|
||||
return c1.colspanIndex - c2.colspanIndex;
|
||||
});
|
||||
for (var j = 0; j < columns.length; j++) {
|
||||
if (columns[j].colspanGroup > 0) continue;
|
||||
var rowspan = 0;
|
||||
var colspan = 0;
|
||||
if (_this2.mergedCells) {
|
||||
for (var _mc = 0; _mc < _this2.mergedCells.length; _mc++) {
|
||||
var _currentMergedCell = _this2.mergedCells[_mc];
|
||||
if (_currentMergedCell.col === j && _currentMergedCell.row === i) {
|
||||
rowspan = _currentMergedCell.rowspan;
|
||||
colspan = _currentMergedCell.colspan;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (canPrint(columns[j]) && (!notRender.includes("".concat(i, ",").concat(j)) || rowspan > 0 && colspan > 0)) {
|
||||
if (rowspan > 0 && colspan > 0) {
|
||||
html.push("<td ".concat(Utils.sprintf(' rowspan="%s"', rowspan), " ").concat(Utils.sprintf(' colspan="%s"', colspan), ">"), formatValue(data[i], i, columns[j]), '</td>');
|
||||
} else {
|
||||
html.push('<td>', formatValue(data[i], i, columns[j]), '</td>');
|
||||
}
|
||||
}
|
||||
}
|
||||
html.push('</tr>');
|
||||
}
|
||||
html.push('</tbody>');
|
||||
if (_this2.options.showFooter) {
|
||||
html.push('<footer><tr>');
|
||||
var _iterator2 = _createForOfIteratorHelper(columnsArray),
|
||||
_step2;
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var _columns = _step2.value;
|
||||
for (var h = 0; h < _columns.length; h++) {
|
||||
if (canPrint(_columns)) {
|
||||
var footerData = Utils.trToData(_columns, _this2.$el.find('>tfoot>tr'));
|
||||
var footerValue = Utils.calculateObjectValue(_columns[h], _columns[h].footerFormatter, [data], footerData[0] && footerData[0][_columns[h].field] || '');
|
||||
html.push("<th>".concat(footerValue, "</th>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
html.push('</tr></footer>');
|
||||
}
|
||||
html.push('</table>');
|
||||
return html.join('');
|
||||
};
|
||||
var sortRows = function sortRows(data, colName, sortOrder) {
|
||||
if (!colName) {
|
||||
return data;
|
||||
}
|
||||
var reverse = sortOrder !== 'asc';
|
||||
reverse = -(+reverse || -1);
|
||||
return data.sort(function (a, b) {
|
||||
return reverse * a[colName].localeCompare(b[colName]);
|
||||
});
|
||||
};
|
||||
var filterRow = function filterRow(row, filters) {
|
||||
for (var index = 0; index < filters.length; ++index) {
|
||||
if (row[filters[index].colName] !== filters[index].value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var filterRows = function filterRows(data, filters) {
|
||||
return data.filter(function (row) {
|
||||
return filterRow(row, filters);
|
||||
});
|
||||
};
|
||||
var getColumnFilters = function getColumnFilters(columns) {
|
||||
return !columns || !columns[0] ? [] : columns[0].filter(function (col) {
|
||||
return col.printFilter;
|
||||
}).map(function (col) {
|
||||
return {
|
||||
colName: col.field,
|
||||
value: col.printFilter
|
||||
};
|
||||
});
|
||||
};
|
||||
data = filterRows(data, getColumnFilters(this.options.columns));
|
||||
data = sortRows(data, this.options.printSortColumn, this.options.printSortOrder);
|
||||
var table = buildTable(data, this.options.columns);
|
||||
var newWin = window.open('');
|
||||
var printStyles = typeof this.options.printStyles === 'string' ? this.options.printStyles.replace(/\[|\]| /g, '').toLowerCase().split(',') : this.options.printStyles;
|
||||
var styles = printStyles.map(function (it) {
|
||||
return "<link rel=\"stylesheet\" href=\"".concat(it, "\" />");
|
||||
}).join('');
|
||||
var calculatedPrintPage = Utils.calculateObjectValue(this, this.options.printPageBuilder, [table, styles], printPageBuilderDefault(table, styles));
|
||||
var startPrint = function startPrint() {
|
||||
newWin.focus();
|
||||
newWin.print();
|
||||
newWin.close();
|
||||
};
|
||||
newWin.document.write(calculatedPrintPage);
|
||||
newWin.document.close();
|
||||
if (printStyles.length) {
|
||||
var links = document.getElementsByTagName('link');
|
||||
var lastLink = links[links.length - 1];
|
||||
lastLink.onload = startPrint;
|
||||
} else {
|
||||
startPrint();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
+354
@@ -0,0 +1,354 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.parse-int.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.parse-int.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_parseInt_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update: https://github.com/wenzhixin
|
||||
* @version: v1.2.0
|
||||
*/
|
||||
|
||||
$.akottr.dragtable.prototype._restoreState = function (persistObj) {
|
||||
var i = 0;
|
||||
for (var _i = 0, _Object$entries = Object.entries(persistObj); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
field = _Object$entries$_i[0],
|
||||
value = _Object$entries$_i[1];
|
||||
var $th = this.originalTable.el.find("th[data-field=\"".concat(field, "\"]"));
|
||||
if (!$th.length) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
this.originalTable.startIndex = $th.prevAll().length + 1;
|
||||
this.originalTable.endIndex = parseInt(value, 10) + 1 - i;
|
||||
this._bubbleCols();
|
||||
}
|
||||
};
|
||||
|
||||
// From MDN site, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
|
||||
var filterFn = function filterFn() {
|
||||
if (!Array.prototype.filter) {
|
||||
Array.prototype.filter = function (fun /* , thisArg*/) {
|
||||
if (this === undefined || this === null) {
|
||||
throw new TypeError();
|
||||
}
|
||||
var t = Object(this);
|
||||
var len = t.length >>> 0;
|
||||
if (typeof fun !== 'function') {
|
||||
throw new TypeError();
|
||||
}
|
||||
var res = [];
|
||||
var thisArg = arguments.length >= 2 ? arguments[1] : undefined;
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (i in t) {
|
||||
var val = t[i];
|
||||
|
||||
// NOTE: Technically this should Object.defineProperty at
|
||||
// the next index, as push can be affected by
|
||||
// properties on Object.prototype and Array.prototype.
|
||||
// But this method's new, and collisions should be
|
||||
// rare, so use the more-compatible alternative.
|
||||
if (fun.call(thisArg, val, i, t)) {
|
||||
res.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
reorderableColumns: false,
|
||||
maxMovingRows: 10,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderColumn: function onReorderColumn(headerFields) {
|
||||
return false;
|
||||
},
|
||||
dragaccept: null
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'reorder-column.bs.table': 'onReorderColumn'
|
||||
});
|
||||
$.fn.bootstrapTable.methods.push('orderColumns');
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initHeader",
|
||||
value: function initHeader() {
|
||||
var _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get2, [this].concat(args));
|
||||
if (!this.options.reorderableColumns) {
|
||||
return;
|
||||
}
|
||||
this.makeColumnsReorderable();
|
||||
}
|
||||
}, {
|
||||
key: "_toggleColumn",
|
||||
value: function _toggleColumn() {
|
||||
var _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get3, [this].concat(args));
|
||||
if (!this.options.reorderableColumns) {
|
||||
return;
|
||||
}
|
||||
this.makeColumnsReorderable();
|
||||
}
|
||||
}, {
|
||||
key: "toggleView",
|
||||
value: function toggleView() {
|
||||
var _get4;
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "toggleView", this)).call.apply(_get4, [this].concat(args));
|
||||
if (!this.options.reorderableColumns) {
|
||||
return;
|
||||
}
|
||||
if (this.options.cardView) {
|
||||
return;
|
||||
}
|
||||
this.makeColumnsReorderable();
|
||||
}
|
||||
}, {
|
||||
key: "resetView",
|
||||
value: function resetView() {
|
||||
var _get5;
|
||||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
(_get5 = _get(_getPrototypeOf(_class.prototype), "resetView", this)).call.apply(_get5, [this].concat(args));
|
||||
if (!this.options.reorderableColumns) {
|
||||
return;
|
||||
}
|
||||
this.makeColumnsReorderable();
|
||||
}
|
||||
}, {
|
||||
key: "makeColumnsReorderable",
|
||||
value: function makeColumnsReorderable() {
|
||||
var _this = this;
|
||||
var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
||||
try {
|
||||
$(this.$el).dragtable('destroy');
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
$(this.$el).dragtable({
|
||||
maxMovingRows: this.options.maxMovingRows,
|
||||
dragaccept: this.options.dragaccept,
|
||||
clickDelay: 200,
|
||||
dragHandle: '.th-inner',
|
||||
restoreState: order ? order : this.columnsSortOrder,
|
||||
beforeStop: function beforeStop(table) {
|
||||
var sortOrder = {};
|
||||
table.el.find('th').each(function (i, el) {
|
||||
sortOrder[$(el).data('field')] = i;
|
||||
});
|
||||
_this.columnsSortOrder = sortOrder;
|
||||
if (_this.options.cookie) {
|
||||
_this.persistReorderColumnsState(_this);
|
||||
}
|
||||
var ths = [];
|
||||
var formatters = [];
|
||||
var columns = [];
|
||||
var columnsHidden = [];
|
||||
var columnIndex = -1;
|
||||
var optionsColumns = [];
|
||||
_this.$header.find('th:not(.detail)').each(function (i, el) {
|
||||
ths.push($(el).data('field'));
|
||||
formatters.push($(el).data('formatter'));
|
||||
});
|
||||
|
||||
// Exist columns not shown
|
||||
if (ths.length < _this.columns.length) {
|
||||
columnsHidden = _this.columns.filter(function (column) {
|
||||
return !column.visible;
|
||||
});
|
||||
for (var i = 0; i < columnsHidden.length; i++) {
|
||||
ths.push(columnsHidden[i].field);
|
||||
formatters.push(columnsHidden[i].formatter);
|
||||
}
|
||||
}
|
||||
for (var _i2 = 0; _i2 < ths.length; _i2++) {
|
||||
columnIndex = _this.fieldsColumnsIndex[ths[_i2]];
|
||||
if (columnIndex !== -1) {
|
||||
_this.fieldsColumnsIndex[ths[_i2]] = _i2;
|
||||
_this.columns[columnIndex].fieldIndex = _i2;
|
||||
columns.push(_this.columns[columnIndex]);
|
||||
}
|
||||
}
|
||||
_this.columns = columns;
|
||||
filterFn(); // Support <IE9
|
||||
$.each(_this.columns, function (i, column) {
|
||||
var found = false;
|
||||
var field = column.field;
|
||||
_this.options.columns[0].filter(function (item) {
|
||||
if (!found && item['field'] === field) {
|
||||
optionsColumns.push(item);
|
||||
found = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
_this.options.columns[0] = optionsColumns;
|
||||
_this.header.fields = ths;
|
||||
_this.header.formatters = formatters;
|
||||
_this.initHeader();
|
||||
_this.initToolbar();
|
||||
_this.initSearchText();
|
||||
_this.initBody();
|
||||
_this.resetView();
|
||||
_this.trigger('reorder-column', ths);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "orderColumns",
|
||||
value: function orderColumns(order) {
|
||||
this.columnsSortOrder = order;
|
||||
this.makeColumnsReorderable();
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.reorder-rows-on-drag-class td{background-color:#eee;box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset;-box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset}.reorder-rows-on-drag-class td:last-child{box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset;-box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset}
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.splice.js'), require('core-js/modules/es.object.assign.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.splice.js', 'core-js/modules/es.object.assign.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_indexOf_js, es_array_splice_js, es_object_assign_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _arrayWithoutHoles(r) {
|
||||
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _iterableToArray(r) {
|
||||
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
||||
}
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toConsumableArray(r) {
|
||||
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var rowAttr = function rowAttr(row, index) {
|
||||
return {
|
||||
id: "customId_".concat(index)
|
||||
};
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
reorderableRows: false,
|
||||
onDragStyle: null,
|
||||
onDropStyle: null,
|
||||
onDragClass: 'reorder-rows-on-drag-class',
|
||||
dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
|
||||
useRowAttrFunc: false,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRowsDrag: function onReorderRowsDrag(row) {
|
||||
return false;
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRowsDrop: function onReorderRowsDrop(row) {
|
||||
return false;
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRow: function onReorderRow(newData) {
|
||||
return false;
|
||||
},
|
||||
onDragStop: function onDragStop() {},
|
||||
onAllowDrop: function onAllowDrop() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'reorder-row.bs.table': 'onReorderRow'
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _this = this,
|
||||
_get3;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
if (!this.options.reorderableRows) {
|
||||
var _get2;
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
return;
|
||||
}
|
||||
if (this.options.useRowAttrFunc) {
|
||||
this.options.rowAttributes = rowAttr;
|
||||
}
|
||||
var onPostBody = this.options.onPostBody;
|
||||
this.options.onPostBody = function () {
|
||||
setTimeout(function () {
|
||||
_this.makeRowsReorderable();
|
||||
onPostBody.call(_this.options, _this.options.data);
|
||||
}, 1);
|
||||
};
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get3, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "makeRowsReorderable",
|
||||
value: function makeRowsReorderable() {
|
||||
var _this2 = this;
|
||||
this.$el.tableDnD({
|
||||
onDragStyle: this.options.onDragStyle,
|
||||
onDropStyle: this.options.onDropStyle,
|
||||
onDragClass: this.options.onDragClass,
|
||||
onAllowDrop: function onAllowDrop(hoveredRow, draggedRow) {
|
||||
return _this2.onAllowDrop(hoveredRow, draggedRow);
|
||||
},
|
||||
onDragStop: function onDragStop(table, draggedRow) {
|
||||
return _this2.onDragStop(table, draggedRow);
|
||||
},
|
||||
onDragStart: function onDragStart(table, droppedRow) {
|
||||
return _this2.onDropStart(table, droppedRow);
|
||||
},
|
||||
onDrop: function onDrop(table, droppedRow) {
|
||||
return _this2.onDrop(table, droppedRow);
|
||||
},
|
||||
dragHandle: this.options.dragHandle
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "onDropStart",
|
||||
value: function onDropStart(table, draggingTd) {
|
||||
this.$draggingTd = $(draggingTd).css('cursor', 'move');
|
||||
this.draggingIndex = $(this.$draggingTd.parent()).data('index');
|
||||
// Call the user defined function
|
||||
this.options.onReorderRowsDrag(this.data[this.draggingIndex]);
|
||||
}
|
||||
}, {
|
||||
key: "onDragStop",
|
||||
value: function onDragStop(table, draggedRow) {
|
||||
var rowIndexDraggedRow = $(draggedRow).data('index');
|
||||
var draggedRowItem = this.data[rowIndexDraggedRow];
|
||||
this.options.onDragStop(table, draggedRowItem, draggedRow);
|
||||
}
|
||||
}, {
|
||||
key: "onAllowDrop",
|
||||
value: function onAllowDrop(hoveredRow, draggedRow) {
|
||||
var rowIndexDraggedRow = $(draggedRow).data('index');
|
||||
var rowIndexHoveredRow = $(hoveredRow).data('index');
|
||||
var draggedRowItem = this.data[rowIndexDraggedRow];
|
||||
var hoveredRowItem = this.data[rowIndexHoveredRow];
|
||||
return this.options.onAllowDrop(hoveredRowItem, draggedRowItem, hoveredRow, draggedRow);
|
||||
}
|
||||
}, {
|
||||
key: "onDrop",
|
||||
value: function onDrop(table) {
|
||||
this.$draggingTd.css('cursor', '');
|
||||
var pageNum = this.options.pageNumber;
|
||||
var pageSize = this.options.pageSize;
|
||||
var newData = [];
|
||||
for (var i = 0; i < table.tBodies[0].rows.length; i++) {
|
||||
var $tr = $(table.tBodies[0].rows[i]);
|
||||
newData.push(this.data[$tr.data('index')]);
|
||||
$tr.data('index', i);
|
||||
}
|
||||
var draggingRow = this.data[this.draggingIndex];
|
||||
var droppedIndex = newData.indexOf(this.data[this.draggingIndex]);
|
||||
var droppedRow = this.data[droppedIndex];
|
||||
var index = (pageNum - 1) * pageSize + this.options.data.indexOf(this.data[droppedIndex]);
|
||||
this.options.data.splice(this.options.data.indexOf(draggingRow), 1);
|
||||
this.options.data.splice(index, 0, draggingRow);
|
||||
this.initSearch();
|
||||
if (this.options.sidePagination === 'server') {
|
||||
this.data = _toConsumableArray(this.options.data);
|
||||
}
|
||||
|
||||
// Call the user defined function
|
||||
this.options.onReorderRowsDrop(droppedRow);
|
||||
|
||||
// Call the event reorder-row
|
||||
this.trigger('reorder-row', newData, draggingRow, droppedRow);
|
||||
}
|
||||
}, {
|
||||
key: "initSearch",
|
||||
value: function initSearch() {
|
||||
this.ignoreInitSort = true;
|
||||
_get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
|
||||
}
|
||||
}, {
|
||||
key: "initSort",
|
||||
value: function initSort() {
|
||||
if (this.ignoreInitSort) {
|
||||
this.ignoreInitSort = false;
|
||||
return;
|
||||
}
|
||||
_get(_getPrototypeOf(_class.prototype), "initSort", this).call(this);
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.reorder-rows-on-drag-class td{background-color:#eee;box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset;-box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset}.reorder-rows-on-drag-class td:last-child{box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset;-box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset}
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+171
@@ -0,0 +1,171 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.object.assign.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.object.assign.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_object_assign_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @version: v2.0.0
|
||||
*/
|
||||
|
||||
var isInit = function isInit(that) {
|
||||
return that.$el.data('resizableColumns') !== undefined;
|
||||
};
|
||||
var initResizable = function initResizable(that) {
|
||||
console.log(that.$el);
|
||||
if (that.options.resizable && !that.options.cardView && !isInit(that) && that.$el.is(':visible')) {
|
||||
that.$el.resizableColumns({
|
||||
store: window.store
|
||||
});
|
||||
}
|
||||
};
|
||||
var destroy = function destroy(that) {
|
||||
if (isInit(that)) {
|
||||
that.$el.data('resizableColumns').destroy();
|
||||
}
|
||||
};
|
||||
var reInitResizable = function reInitResizable(that) {
|
||||
destroy(that);
|
||||
initResizable(that);
|
||||
};
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
resizable: false
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initBody",
|
||||
value: function initBody() {
|
||||
var _get2,
|
||||
_this = this;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get2, [this].concat(args));
|
||||
this.$el.off('column-switch.bs.table page-change.bs.table').on('column-switch.bs.table page-change.bs.table', function () {
|
||||
reInitResizable(_this);
|
||||
});
|
||||
reInitResizable(this);
|
||||
}
|
||||
}, {
|
||||
key: "toggleView",
|
||||
value: function toggleView() {
|
||||
var _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "toggleView", this)).call.apply(_get3, [this].concat(args));
|
||||
if (this.options.resizable && this.options.cardView) {
|
||||
// Destroy the plugin
|
||||
destroy(this);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "resetView",
|
||||
value: function resetView() {
|
||||
var _get4,
|
||||
_this2 = this;
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "resetView", this)).call.apply(_get4, [this].concat(args));
|
||||
if (this.options.resizable) {
|
||||
// because in fitHeader function, we use setTimeout(func, 100);
|
||||
setTimeout(function () {
|
||||
initResizable(_this2);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.object.assign.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.object.assign.js","jquery"],t):t(null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,n){"use strict";function o(e,t,n){return t=c(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,a(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},i.apply(null,arguments)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function a(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var s=function(e){return void 0!==e.$el.data("resizableColumns")},f=function(e){e.options.resizable&&!e.options.cardView&&!s(e)&&e.$el.is(":visible")&&e.$el.resizableColumns({store:window.store})},p=function(e){s(e)&&e.$el.data("resizableColumns").destroy()},y=function(e){p(e),f(e)};Object.assign(n.fn.bootstrapTable.defaults,{resizable:!1}),n.BootstrapTable=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),r(t,[{key:"initBody",value:function(){for(var e,n=this,o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];(e=i(c(t.prototype),"initBody",this)).call.apply(e,[this].concat(r)),this.$el.off("column-switch.bs.table page-change.bs.table").on("column-switch.bs.table page-change.bs.table",(function(){y(n)})),y(this)}},{key:"toggleView",value:function(){for(var e,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];(e=i(c(t.prototype),"toggleView",this)).call.apply(e,[this].concat(o)),this.options.resizable&&this.options.cardView&&p(this)}},{key:"resetView",value:function(){for(var e,n=this,o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];(e=i(c(t.prototype),"resetView",this)).call.apply(e,[this].concat(r)),this.options.resizable&&setTimeout((function(){f(n)}),100)}}])}(n.BootstrapTable)}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
.fix-sticky{position:fixed !important;overflow:hidden;z-index:100}.fix-sticky table thead{background:#fff}.fix-sticky table thead.thead-light{background:#e9ecef}.fix-sticky table thead.thead-dark{background:#212529}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_find_js, es_object_assign_js, es_object_toString_js, $) { 'use strict';
|
||||
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @author vincent loh <vincent.ml@gmail.com>
|
||||
* @update J Manuel Corona <jmcg92@gmail.com>
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
stickyHeader: false,
|
||||
stickyHeaderOffsetY: 0,
|
||||
stickyHeaderOffsetLeft: 0,
|
||||
stickyHeaderOffsetRight: 0
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initHeader",
|
||||
value: function initHeader() {
|
||||
var _get2,
|
||||
_this = this;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get2, [this].concat(args));
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
this.$tableBody.find('.sticky-header-container,.sticky_anchor_begin,.sticky_anchor_end').remove();
|
||||
this.$el.before('<div class="sticky-header-container"></div>');
|
||||
this.$el.before('<div class="sticky_anchor_begin"></div>');
|
||||
this.$el.after('<div class="sticky_anchor_end"></div>');
|
||||
this.$header.addClass('sticky-header');
|
||||
|
||||
// clone header just once, to be used as sticky header
|
||||
// deep clone header, using source header affects tbody>td width
|
||||
this.$stickyContainer = this.$tableBody.find('.sticky-header-container');
|
||||
this.$stickyBegin = this.$tableBody.find('.sticky_anchor_begin');
|
||||
this.$stickyEnd = this.$tableBody.find('.sticky_anchor_end');
|
||||
this.$stickyHeader = this.$header.clone(true, true);
|
||||
|
||||
// render sticky on window scroll or resize
|
||||
var resizeEvent = Utils.getEventName('resize.sticky-header-table', this.$el.attr('id'));
|
||||
var scrollEvent = Utils.getEventName('scroll.sticky-header-table', this.$el.attr('id'));
|
||||
$(window).off(resizeEvent).on(resizeEvent, function () {
|
||||
return _this.renderStickyHeader();
|
||||
});
|
||||
$(window).off(scrollEvent).on(scrollEvent, function () {
|
||||
return _this.renderStickyHeader();
|
||||
});
|
||||
this.$tableBody.off('scroll').on('scroll', function () {
|
||||
return _this.matchPositionX();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "onColumnSearch",
|
||||
value: function onColumnSearch(_ref) {
|
||||
var currentTarget = _ref.currentTarget,
|
||||
keyCode = _ref.keyCode;
|
||||
_get(_getPrototypeOf(_class.prototype), "onColumnSearch", this).call(this, {
|
||||
currentTarget: currentTarget,
|
||||
keyCode: keyCode
|
||||
});
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
this.renderStickyHeader();
|
||||
}
|
||||
}, {
|
||||
key: "resetView",
|
||||
value: function resetView() {
|
||||
var _get3,
|
||||
_this2 = this;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "resetView", this)).call.apply(_get3, [this].concat(args));
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
$('.bootstrap-table.fullscreen').off('scroll').on('scroll', function () {
|
||||
return _this2.renderStickyHeader();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "getCaret",
|
||||
value: function getCaret() {
|
||||
var _get4;
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "getCaret", this)).call.apply(_get4, [this].concat(args));
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
if (this.$stickyHeader) {
|
||||
var $ths = this.$stickyHeader.find('th');
|
||||
this.$header.find('th').each(function (i, th) {
|
||||
$ths.eq(i).find('.sortable').attr('class', $(th).find('.sortable').attr('class'));
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "horizontalScroll",
|
||||
value: function horizontalScroll() {
|
||||
var _this3 = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "horizontalScroll", this).call(this);
|
||||
if (!this.options.stickyHeader) {
|
||||
return;
|
||||
}
|
||||
this.$tableBody.on('scroll', function () {
|
||||
return _this3.matchPositionX();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "renderStickyHeader",
|
||||
value: function renderStickyHeader() {
|
||||
var _this4 = this;
|
||||
var that = this;
|
||||
this.$stickyHeader = this.$header.clone(true, true);
|
||||
if (this.options.filterControl) {
|
||||
$(this.$stickyHeader).off('keyup change mouseup').on('keyup change mouse', function (e) {
|
||||
var $target = $(e.target);
|
||||
var value = $target.val();
|
||||
var field = $target.parents('th').data('field');
|
||||
var $coreTh = that.$header.find("th[data-field=\"".concat(field, "\"]"));
|
||||
if ($target.is('input')) {
|
||||
$coreTh.find('input').val(value);
|
||||
} else if ($target.is('select')) {
|
||||
var $select = $coreTh.find('select');
|
||||
$select.find('option[selected]').removeAttr('selected');
|
||||
$select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
|
||||
}
|
||||
that.triggerSearch();
|
||||
});
|
||||
}
|
||||
var top = $(window).scrollTop();
|
||||
// top anchor scroll position, minus header height
|
||||
var start = this.$stickyBegin.offset().top - this.options.stickyHeaderOffsetY;
|
||||
// bottom anchor scroll position, minus header height, minus sticky height
|
||||
var end = this.$stickyEnd.offset().top - this.options.stickyHeaderOffsetY - this.$header.height();
|
||||
|
||||
// show sticky when top anchor touches header, and when bottom anchor not exceeded
|
||||
if (top > start && top <= end) {
|
||||
// ensure clone and source column widths are the same
|
||||
this.$stickyHeader.find('tr').each(function (indexRows, rows) {
|
||||
$(rows).find('th').each(function (index, el) {
|
||||
$(el).css('min-width', _this4.$header.find("tr:eq(".concat(indexRows, ")")).find("th:eq(".concat(index, ")")).css('width'));
|
||||
});
|
||||
});
|
||||
// match bootstrap table style
|
||||
this.$stickyContainer.show().addClass('fix-sticky fixed-table-container');
|
||||
// stick it in position
|
||||
var coords = this.$tableBody[0].getBoundingClientRect();
|
||||
var width = '100%';
|
||||
var stickyHeaderOffsetLeft = this.options.stickyHeaderOffsetLeft;
|
||||
var stickyHeaderOffsetRight = this.options.stickyHeaderOffsetRight;
|
||||
if (!stickyHeaderOffsetLeft) {
|
||||
stickyHeaderOffsetLeft = coords.left;
|
||||
}
|
||||
if (!stickyHeaderOffsetRight) {
|
||||
width = "".concat(coords.width, "px");
|
||||
}
|
||||
if (this.$el.closest('.bootstrap-table').hasClass('fullscreen')) {
|
||||
stickyHeaderOffsetLeft = 0;
|
||||
stickyHeaderOffsetRight = 0;
|
||||
width = '100%';
|
||||
}
|
||||
this.$stickyContainer.css('top', "".concat(this.options.stickyHeaderOffsetY, "px"));
|
||||
this.$stickyContainer.css('left', "".concat(stickyHeaderOffsetLeft, "px"));
|
||||
this.$stickyContainer.css('right', "".concat(stickyHeaderOffsetRight, "px"));
|
||||
this.$stickyContainer.css('width', "".concat(width));
|
||||
// create scrollable container for header
|
||||
this.$stickyTable = $('<table/>');
|
||||
this.$stickyTable.addClass(this.options.classes);
|
||||
// append cloned header to dom
|
||||
this.$stickyContainer.html(this.$stickyTable.append(this.$stickyHeader));
|
||||
// match clone and source header positions when left-right scroll
|
||||
this.matchPositionX();
|
||||
} else {
|
||||
this.$stickyContainer.removeClass('fix-sticky').hide();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "matchPositionX",
|
||||
value: function matchPositionX() {
|
||||
this.$stickyContainer.scrollLeft(this.$tableBody.scrollLeft());
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.23.1
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
.fix-sticky{position:fixed!important;overflow:hidden;z-index:100}.fix-sticky table thead{background:#fff}.fix-sticky table thead.thead-light{background:#e9ecef}.fix-sticky table thead.thead-dark{background:#212529}
|
||||
+10
File diff suppressed because one or more lines are too long
Vendored
+467
@@ -0,0 +1,467 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.string.trim.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.string.trim.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_regexp_exec_js, es_string_includes_js, es_string_search_js, es_string_trim_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _arrayWithHoles(r) {
|
||||
if (Array.isArray(r)) return r;
|
||||
}
|
||||
function _arrayWithoutHoles(r) {
|
||||
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _iterableToArray(r) {
|
||||
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
||||
}
|
||||
function _iterableToArrayLimit(r, l) {
|
||||
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (null != t) {
|
||||
var e,
|
||||
n,
|
||||
i,
|
||||
u,
|
||||
a = [],
|
||||
f = !0,
|
||||
o = !1;
|
||||
try {
|
||||
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
||||
} catch (r) {
|
||||
o = !0, n = r;
|
||||
} finally {
|
||||
try {
|
||||
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
||||
} finally {
|
||||
if (o) throw n;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _slicedToArray(r, e) {
|
||||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toConsumableArray(r) {
|
||||
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: aperez <aperez@datadec.es>
|
||||
* @version: v2.0.0
|
||||
*
|
||||
* @update Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
var theme = {
|
||||
bootstrap3: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'glyphicon-chevron-down'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button class=\"close toolbar-modal-close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <h4 class=\"modal-title toolbar-modal-title\"></h4>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
bootstrap4: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'fa-chevron-down'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title toolbar-modal-title\"></h4>\n <button class=\"close toolbar-modal-close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
bootstrap5: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'bi-chevron-down'
|
||||
},
|
||||
classes: {
|
||||
formGroup: 'mb-3'
|
||||
},
|
||||
html: {
|
||||
modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title toolbar-modal-title\"></h5>\n <button class=\"btn-close toolbar-modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
bulma: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'fa-chevron-down'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div class=\"modal\" id=\"avdSearchModal_%s\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title toolbar-modal-title\"></p>\n <button class=\"delete toolbar-modal-close\"></button>\n </header>\n <section class=\"modal-card-body toolbar-modal-body\"></section>\n <footer class=\"modal-card-foot toolbar-modal-footer\">\n <button class=\"button button-%s toolbar-modal-close\"></button>\n </footer>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
foundation: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'fa-chevron-down'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div class=\"reveal\" id=\"avdSearchModal_%s\" data-reveal>\n <h1 class=\"toolbar-modal-title\"></h1>\n <div class=\"toolbar-modal-body\"></div>\n <button class=\"close-button toolbar-modal-close\" data-close aria-label=\"Close modal\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <div class=\"toolbar-modal-footer\">\n <button class=\"button button-%s toolbar-modal-close\"></button>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
materialize: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'expand_more'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal\">\n <div class=\"modal-content\">\n <h4 class=\"toolbar-modal-title\"></h4>\n <div class=\"toolbar-modal-body\"></div>\n </div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-green btn-flat btn-%s toolbar-modal-close\"></a>\n </div>\n </div>\n "
|
||||
}
|
||||
},
|
||||
semantic: {
|
||||
icons: {
|
||||
advancedSearchIcon: 'fa-chevron-down'
|
||||
},
|
||||
classes: {},
|
||||
html: {
|
||||
modal: "\n <div class=\"ui modal\" id=\"avdSearchModal_%s\">\n <i class=\"close icon toolbar-modal-close\"></i>\n <div class=\"header toolbar-modal-title\"\"></div>\n <div class=\"image content ui form toolbar-modal-body\"></div>\n <div class=\"actions toolbar-modal-footer\">\n <div class=\"ui black deny button button-%s toolbar-modal-close\"></div>\n </div>\n </div>\n "
|
||||
}
|
||||
}
|
||||
}[$.fn.bootstrapTable.theme];
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
advancedSearch: false,
|
||||
idForm: 'advancedSearch',
|
||||
actionForm: '',
|
||||
idTable: undefined,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onColumnAdvancedSearch: function onColumnAdvancedSearch(field, text) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
advancedSearchIcon: theme.icons.advancedSearchIcon
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatAdvancedSearch: function formatAdvancedSearch() {
|
||||
return 'Advanced search';
|
||||
},
|
||||
formatAdvancedCloseButton: function formatAdvancedCloseButton() {
|
||||
return 'Close';
|
||||
}
|
||||
});
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "initToolbar",
|
||||
value: function initToolbar() {
|
||||
this.showToolbar = this.showToolbar || this.options.search && this.options.advancedSearch && this.options.idTable;
|
||||
if (this.showToolbar) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
advancedSearch: {
|
||||
text: this.options.formatAdvancedSearch(),
|
||||
icon: this.options.icons.advancedSearchIcon,
|
||||
event: this.showAdvancedSearch,
|
||||
attributes: {
|
||||
'aria-label': this.options.formatAdvancedSearch(),
|
||||
title: this.options.formatAdvancedSearch()
|
||||
}
|
||||
}
|
||||
});
|
||||
if (Utils.isEmptyObject(this.filterColumnsPartial)) {
|
||||
this.filterColumnsPartial = {};
|
||||
}
|
||||
}
|
||||
_get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
|
||||
}
|
||||
}, {
|
||||
key: "showAdvancedSearch",
|
||||
value: function showAdvancedSearch() {
|
||||
var _this = this;
|
||||
this.$toolbarModal = $("#avdSearchModal_".concat(this.options.idTable));
|
||||
if (this.$toolbarModal.length <= 0) {
|
||||
$('body').append(Utils.sprintf(theme.html.modal, this.options.idTable, this.options.buttonsClass));
|
||||
this.$toolbarModal = $("#avdSearchModal_".concat(this.options.idTable));
|
||||
this.$toolbarModal.find('.toolbar-modal-close').off('click').on('click', function () {
|
||||
return _this.hideToolbarModal();
|
||||
});
|
||||
}
|
||||
this.initToolbarModalBody();
|
||||
this.showToolbarModal();
|
||||
}
|
||||
}, {
|
||||
key: "initToolbarModalBody",
|
||||
value: function initToolbarModalBody() {
|
||||
var _this2 = this;
|
||||
this.$toolbarModal.find('.toolbar-modal-title').html(this.options.formatAdvancedSearch());
|
||||
this.$toolbarModal.find('.toolbar-modal-footer .toolbar-modal-close').html(this.options.formatAdvancedCloseButton());
|
||||
this.$toolbarModal.find('.toolbar-modal-body').html(this.createToolbarForm()).off('keyup blur', 'input').on('keyup blur', 'input', function (e) {
|
||||
_this2.onColumnAdvancedSearch(e);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "showToolbarModal",
|
||||
value: function showToolbarModal() {
|
||||
var theme = $.fn.bootstrapTable.theme;
|
||||
if (['bootstrap3', 'bootstrap4'].includes(theme)) {
|
||||
this.$toolbarModal.modal();
|
||||
} else if (theme === 'bootstrap5') {
|
||||
if (!this.toolbarModal) {
|
||||
this.toolbarModal = new window.bootstrap.Modal(this.$toolbarModal[0], {});
|
||||
}
|
||||
this.toolbarModal.show();
|
||||
} else if (theme === 'bulma') {
|
||||
this.$toolbarModal.toggleClass('is-active');
|
||||
} else if (theme === 'foundation') {
|
||||
if (!this.toolbarModal) {
|
||||
this.toolbarModal = new window.Foundation.Reveal(this.$toolbarModal);
|
||||
}
|
||||
this.toolbarModal.open();
|
||||
} else if (theme === 'materialize') {
|
||||
this.$toolbarModal.modal().modal('open');
|
||||
} else if (theme === 'semantic') {
|
||||
this.$toolbarModal.modal('show');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "hideToolbarModal",
|
||||
value: function hideToolbarModal() {
|
||||
var theme = $.fn.bootstrapTable.theme;
|
||||
if (['bootstrap3', 'bootstrap4'].includes(theme)) {
|
||||
this.$toolbarModal.modal('hide');
|
||||
} else if (theme === 'bootstrap5') {
|
||||
this.toolbarModal.hide();
|
||||
} else if (theme === 'bulma') {
|
||||
$('html').toggleClass('is-clipped');
|
||||
this.$toolbarModal.toggleClass('is-active');
|
||||
} else if (theme === 'foundation') {
|
||||
this.toolbarModal.close();
|
||||
} else if (theme === 'materialize') {
|
||||
this.$toolbarModal.modal('open');
|
||||
} else if (theme === 'semantic') {
|
||||
this.$toolbarModal.modal('close');
|
||||
}
|
||||
if (this.options.sidePagination === 'server') {
|
||||
this.options.pageNumber = 1;
|
||||
this.updatePagination();
|
||||
this.trigger('column-advanced-search', this.filterColumnsPartial);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "createToolbarForm",
|
||||
value: function createToolbarForm() {
|
||||
var html = ["<form class=\"form-horizontal toolbar-model-form\" action=\"".concat(this.options.actionForm, "\">")];
|
||||
var _iterator = _createForOfIteratorHelper(this.columns),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var column = _step.value;
|
||||
if (!column.checkbox && column.visible && column.searchable) {
|
||||
var title = $('<div/>').html(column.title).text().trim();
|
||||
var value = this.filterColumnsPartial[column.field] || '';
|
||||
html.push("\n <div class=\"form-group row ".concat(theme.classes.formGroup || '', "\">\n <label class=\"col-sm-4 control-label\">").concat(title, "</label>\n <div class=\"col-sm-6\">\n <input type=\"text\" class=\"form-control ").concat(this.constants.classes.input, "\"\n name=\"").concat(column.field, "\" placeholder=\"").concat(title, "\" value=\"").concat(value, "\">\n </div>\n </div>\n "));
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
html.push('</form>');
|
||||
return html.join('');
|
||||
}
|
||||
}, {
|
||||
key: "initSearch",
|
||||
value: function initSearch() {
|
||||
var _this3 = this;
|
||||
_get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
|
||||
if (!this.options.advancedSearch || this.options.sidePagination === 'server') {
|
||||
return;
|
||||
}
|
||||
var fp = Utils.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
|
||||
this.data = fp ? this.data.filter(function (item, i) {
|
||||
for (var _i = 0, _Object$entries = Object.entries(fp); _i < _Object$entries.length; _i++) {
|
||||
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
||||
key = _Object$entries$_i[0],
|
||||
v = _Object$entries$_i[1];
|
||||
var val = v.toLowerCase();
|
||||
var value = item[key];
|
||||
var index = _this3.header.fields.indexOf(key);
|
||||
value = Utils.calculateObjectValue(_this3.header, _this3.header.formatters[index], [value, item, i], value);
|
||||
if (!(index !== -1 && (typeof value === 'string' || typeof value === 'number') && "".concat(value).toLowerCase().includes(val))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}) : this.data;
|
||||
this.unsortedData = _toConsumableArray(this.data);
|
||||
}
|
||||
}, {
|
||||
key: "onColumnAdvancedSearch",
|
||||
value: function onColumnAdvancedSearch(e) {
|
||||
var text = $(e.currentTarget).val().trim();
|
||||
var field = $(e.currentTarget).attr('name');
|
||||
if (text) {
|
||||
this.filterColumnsPartial[field] = text;
|
||||
} else {
|
||||
delete this.filterColumnsPartial[field];
|
||||
}
|
||||
if (this.options.sidePagination !== 'server') {
|
||||
this.options.pageNumber = 1;
|
||||
this.initSearch();
|
||||
this.updatePagination();
|
||||
this.trigger('column-advanced-search', field, text);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
Vendored
+10
File diff suppressed because one or more lines are too long
Vendored
+285
@@ -0,0 +1,285 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.to-string.js'), require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.to-string.js', 'jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, global.jQuery));
|
||||
})(this, (function (es_array_concat_js, es_array_filter_js, es_array_join_js, es_object_assign_js, es_object_toString_js, $) { 'use strict';
|
||||
|
||||
function _arrayLikeToArray(r, a) {
|
||||
(null == a || a > r.length) && (a = r.length);
|
||||
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
||||
return n;
|
||||
}
|
||||
function _assertThisInitialized(e) {
|
||||
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
return e;
|
||||
}
|
||||
function _callSuper(t, o, e) {
|
||||
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
||||
}
|
||||
function _classCallCheck(a, n) {
|
||||
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
function _defineProperties(e, r) {
|
||||
for (var t = 0; t < r.length; t++) {
|
||||
var o = r[t];
|
||||
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
||||
}
|
||||
}
|
||||
function _createClass(e, r, t) {
|
||||
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
||||
writable: !1
|
||||
}), e;
|
||||
}
|
||||
function _createForOfIteratorHelper(r, e) {
|
||||
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
||||
if (!t) {
|
||||
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
|
||||
t && (r = t);
|
||||
var n = 0,
|
||||
F = function () {};
|
||||
return {
|
||||
s: F,
|
||||
n: function () {
|
||||
return n >= r.length ? {
|
||||
done: !0
|
||||
} : {
|
||||
done: !1,
|
||||
value: r[n++]
|
||||
};
|
||||
},
|
||||
e: function (r) {
|
||||
throw r;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var o,
|
||||
a = !0,
|
||||
u = !1;
|
||||
return {
|
||||
s: function () {
|
||||
t = t.call(r);
|
||||
},
|
||||
n: function () {
|
||||
var r = t.next();
|
||||
return a = r.done, r;
|
||||
},
|
||||
e: function (r) {
|
||||
u = !0, o = r;
|
||||
},
|
||||
f: function () {
|
||||
try {
|
||||
a || null == t.return || t.return();
|
||||
} finally {
|
||||
if (u) throw o;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _get() {
|
||||
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
||||
var p = _superPropBase(e, t);
|
||||
if (p) {
|
||||
var n = Object.getOwnPropertyDescriptor(p, t);
|
||||
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
||||
}
|
||||
}, _get.apply(null, arguments);
|
||||
}
|
||||
function _getPrototypeOf(t) {
|
||||
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
||||
return t.__proto__ || Object.getPrototypeOf(t);
|
||||
}, _getPrototypeOf(t);
|
||||
}
|
||||
function _inherits(t, e) {
|
||||
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
||||
t.prototype = Object.create(e && e.prototype, {
|
||||
constructor: {
|
||||
value: t,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
}), Object.defineProperty(t, "prototype", {
|
||||
writable: !1
|
||||
}), e && _setPrototypeOf(t, e);
|
||||
}
|
||||
function _isNativeReflectConstruct() {
|
||||
try {
|
||||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
||||
} catch (t) {}
|
||||
return (_isNativeReflectConstruct = function () {
|
||||
return !!t;
|
||||
})();
|
||||
}
|
||||
function _possibleConstructorReturn(t, e) {
|
||||
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
||||
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
||||
return _assertThisInitialized(t);
|
||||
}
|
||||
function _setPrototypeOf(t, e) {
|
||||
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
||||
return t.__proto__ = e, t;
|
||||
}, _setPrototypeOf(t, e);
|
||||
}
|
||||
function _superPropBase(t, o) {
|
||||
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
||||
return t;
|
||||
}
|
||||
function _toPrimitive(t, r) {
|
||||
if ("object" != typeof t || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
if (void 0 !== e) {
|
||||
var i = e.call(t, r );
|
||||
if ("object" != typeof i) return i;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (String )(t);
|
||||
}
|
||||
function _toPropertyKey(t) {
|
||||
var i = _toPrimitive(t, "string");
|
||||
return "symbol" == typeof i ? i : i + "";
|
||||
}
|
||||
function _unsupportedIterableToArray(r, a) {
|
||||
if (r) {
|
||||
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
||||
var t = {}.toString.call(r).slice(8, -1);
|
||||
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: YL
|
||||
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils;
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
treeEnable: false,
|
||||
treeShowField: null,
|
||||
idField: 'id',
|
||||
parentIdField: 'pid',
|
||||
rootParentId: null
|
||||
});
|
||||
$.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
return _callSuper(this, _class, arguments);
|
||||
}
|
||||
_inherits(_class, _$$BootstrapTable);
|
||||
return _createClass(_class, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _get2;
|
||||
this._rowStyle = this.options.rowStyle;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "initHeader",
|
||||
value: function initHeader() {
|
||||
var _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
(_get3 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get3, [this].concat(args));
|
||||
var treeShowField = this.options.treeShowField;
|
||||
if (treeShowField) {
|
||||
var _iterator = _createForOfIteratorHelper(this.header.fields),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var field = _step.value;
|
||||
if (treeShowField === field) {
|
||||
this.treeEnable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initBody",
|
||||
value: function initBody() {
|
||||
var _get4;
|
||||
if (this.treeEnable) {
|
||||
this.options.virtualScroll = false;
|
||||
}
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
(_get4 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get4, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "initTr",
|
||||
value: function initTr(item, idx, data, parentDom) {
|
||||
var _this = this;
|
||||
var nodes = data.filter(function (it) {
|
||||
return item[_this.options.idField] === it[_this.options.parentIdField];
|
||||
});
|
||||
parentDom.append(_get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom));
|
||||
|
||||
// init sub node
|
||||
var len = nodes.length - 1;
|
||||
for (var i = 0; i <= len; i++) {
|
||||
var node = nodes[i];
|
||||
var defaultItem = Utils.extend(true, {}, item);
|
||||
node._level = defaultItem._level + 1;
|
||||
node._parent = defaultItem;
|
||||
if (i === len) {
|
||||
node._last = 1;
|
||||
}
|
||||
// jquery.treegrid.js
|
||||
this.options.rowStyle = function (item, idx) {
|
||||
var res = _this._rowStyle(item, idx);
|
||||
var id = item[_this.options.idField] ? item[_this.options.idField] : 0;
|
||||
var pid = item[_this.options.parentIdField] ? item[_this.options.parentIdField] : 0;
|
||||
res.classes = [res.classes || '', "treegrid-".concat(id), "treegrid-parent-".concat(pid)].join(' ');
|
||||
return res;
|
||||
};
|
||||
this.initTr(node, $.inArray(node, data), data, parentDom);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "initRow",
|
||||
value: function initRow(item, idx, data, parentDom) {
|
||||
var _this2 = this;
|
||||
if (this.treeEnable) {
|
||||
if (this.options.rootParentId === item[this.options.parentIdField] || !item[this.options.parentIdField]) {
|
||||
if (item._level === undefined) {
|
||||
item._level = 0;
|
||||
}
|
||||
// jquery.treegrid.js
|
||||
this.options.rowStyle = function (item, idx) {
|
||||
var res = _this2._rowStyle(item, idx);
|
||||
var x = item[_this2.options.idField] ? item[_this2.options.idField] : 0;
|
||||
res.classes = [res.classes || '', "treegrid-".concat(x)].join(' ');
|
||||
return res;
|
||||
};
|
||||
this.initTr(item, idx, data, parentDom);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return _get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom);
|
||||
}
|
||||
}, {
|
||||
key: "destroy",
|
||||
value: function destroy() {
|
||||
var _get5;
|
||||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
(_get5 = _get(_getPrototypeOf(_class.prototype), "destroy", this)).call.apply(_get5, [this].concat(args));
|
||||
this.options.rowStyle = this._rowStyle;
|
||||
}
|
||||
}]);
|
||||
}($.BootstrapTable);
|
||||
|
||||
}));
|
||||
+10
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user