Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,40 @@
/*
* dragtable
*
* @Version 2.0.15
*
* default css
*
*/
/*##### the dragtable stuff #####*/
.dragtable-sortable {
list-style-type: none; margin: 0; padding: 0; -moz-user-select: none;
}
.dragtable-sortable li {
margin: 0; padding: 0; float: left; font-size: 1em; background: white;
}
.dragtable-sortable th, .dragtable-sortable td{
border-left: 0px;
}
.dragtable-sortable li:first-child th, .dragtable-sortable li:first-child td {
border-left: 1px solid #CCC;
}
.ui-sortable-helper {
opacity: 0.7;filter: alpha(opacity=70);
}
.ui-sortable-placeholder {
-moz-box-shadow: 4px 5px 4px #C6C6C6 inset;
-webkit-box-shadow: 4px 5px 4px #C6C6C6 inset;
box-shadow: 4px 5px 4px #C6C6C6 inset;
border-bottom: 1px solid #CCCCCC;
border-top: 1px solid #CCCCCC;
visibility: visible !important;
background: #EFEFEF !important;
visibility: visible !important;
}
.ui-sortable-placeholder * {
opacity: 0.0; visibility: hidden;
}
@@ -0,0 +1,403 @@
/*!
* dragtable
*
* @Version 2.0.15
*
* Copyright (c) 2010-2013, Andres akottr@gmail.com
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Inspired by the the dragtable from Dan Vanderkam (danvk.org/dragtable/)
* Thanks to the jquery and jqueryui comitters
*
* Any comment, bug report, feature-request is welcome
* Feel free to contact me.
*/
/* TOKNOW:
* For IE7 you need this css rule:
* table {
* border-collapse: collapse;
* }
* Or take a clean reset.css (see http://meyerweb.com/eric/tools/css/reset/)
*/
/* TODO: investigate
* Does not work properly with css rule:
* html {
* overflow: -moz-scrollbars-vertical;
* }
* Workaround:
* Fixing Firefox issues by scrolling down the page
* http://stackoverflow.com/questions/2451528/jquery-ui-sortable-scroll-helper-element-offset-firefox-issue
*
* var start = $.noop;
* var beforeStop = $.noop;
* if($.browser.mozilla) {
* var start = function (event, ui) {
* if( ui.helper !== undefined )
* ui.helper.css('position','absolute').css('margin-top', $(window).scrollTop() );
* }
* var beforeStop = function (event, ui) {
* if( ui.offset !== undefined )
* ui.helper.css('margin-top', 0);
* }
* }
*
* and pass this as start and stop function to the sortable initialisation
* start: start,
* beforeStop: beforeStop
*/
/*
* Special thx to all pull requests comitters
*/
(function($) {
$.widget("akottr.dragtable", {
options: {
revert: false, // smooth revert
dragHandle: '.table-handle', // handle for moving cols, if not exists the whole 'th' is the handle
maxMovingRows: 40, // 1 -> only header. 40 row should be enough, the rest is usually not in the viewport
excludeFooter: false, // excludes the footer row(s) while moving other columns. Make sense if there is a footer with a colspan. */
onlyHeaderThreshold: 100, // TODO: not implemented yet, switch automatically between entire col moving / only header moving
dragaccept: null, // draggable cols -> default all
persistState: null, // url or function -> plug in your custom persistState function right here. function call is persistState(originalTable)
restoreState: null, // JSON-Object or function: some kind of experimental aka Quick-Hack TODO: do it better
exact: true, // removes pixels, so that the overlay table width fits exactly the original table width
clickDelay: 10, // ms to wait before rendering sortable list and delegating click event
containment: null, // @see http://api.jqueryui.com/sortable/#option-containment, use it if you want to move in 2 dimesnions (together with axis: null)
cursor: 'move', // @see http://api.jqueryui.com/sortable/#option-cursor
cursorAt: false, // @see http://api.jqueryui.com/sortable/#option-cursorAt
distance: 0, // @see http://api.jqueryui.com/sortable/#option-distance, for immediate feedback use "0"
tolerance: 'pointer', // @see http://api.jqueryui.com/sortable/#option-tolerance
axis: 'x', // @see http://api.jqueryui.com/sortable/#option-axis, Only vertical moving is allowed. Use 'x' or null. Use this in conjunction with the 'containment' setting
beforeStart: $.noop, // returning FALSE will stop the execution chain.
beforeMoving: $.noop,
beforeReorganize: $.noop,
beforeStop: $.noop
},
originalTable: {
el: null,
selectedHandle: null,
sortOrder: null,
startIndex: 0,
endIndex: 0
},
sortableTable: {
el: $(),
selectedHandle: $(),
movingRow: $()
},
persistState: function() {
var _this = this;
this.originalTable.el.find('th').each(function(i) {
if (this.id !== '') {
_this.originalTable.sortOrder[this.id] = i;
}
});
$.ajax({
url: this.options.persistState,
data: this.originalTable.sortOrder
});
},
/*
* persistObj looks like
* {'id1':'2','id3':'3','id2':'1'}
* table looks like
* | id2 | id1 | id3 |
*/
_restoreState: function(persistObj) {
for (var n in persistObj) {
this.originalTable.startIndex = $('#' + n).closest('th').prevAll().length + 1;
this.originalTable.endIndex = parseInt(persistObj[n], 10) + 1;
this._bubbleCols();
}
},
// bubble the moved col left or right
_bubbleCols: function() {
var i, j, col1, col2;
var from = this.originalTable.startIndex;
var to = this.originalTable.endIndex;
/* Find children thead and tbody.
* Only to process the immediate tr-children. Bugfix for inner tables
*/
var thtb = this.originalTable.el.children();
if (this.options.excludeFooter) {
thtb = thtb.not('tfoot');
}
if (from < to) {
for (i = from; i < to; i++) {
col1 = thtb.find('> tr > td:nth-child(' + i + ')')
.add(thtb.find('> tr > th:nth-child(' + i + ')'));
col2 = thtb.find('> tr > td:nth-child(' + (i + 1) + ')')
.add(thtb.find('> tr > th:nth-child(' + (i + 1) + ')'));
for (j = 0; j < col1.length; j++) {
swapNodes(col1[j], col2[j]);
}
}
} else {
for (i = from; i > to; i--) {
col1 = thtb.find('> tr > td:nth-child(' + i + ')')
.add(thtb.find('> tr > th:nth-child(' + i + ')'));
col2 = thtb.find('> tr > td:nth-child(' + (i - 1) + ')')
.add(thtb.find('> tr > th:nth-child(' + (i - 1) + ')'));
for (j = 0; j < col1.length; j++) {
swapNodes(col1[j], col2[j]);
}
}
}
},
_rearrangeTableBackroundProcessing: function() {
var _this = this;
return function() {
_this._bubbleCols();
_this.options.beforeStop(_this.originalTable);
_this.sortableTable.el.remove();
restoreTextSelection();
// persist state if necessary
if (_this.options.persistState !== null) {
$.isFunction(_this.options.persistState) ? _this.options.persistState(_this.originalTable) : _this.persistState();
}
};
},
_rearrangeTable: function() {
var _this = this;
return function() {
// remove handler-class -> handler is now finished
_this.originalTable.selectedHandle.removeClass('dragtable-handle-selected');
// add disabled class -> reorgorganisation starts soon
_this.sortableTable.el.sortable("disable");
_this.sortableTable.el.addClass('dragtable-disabled');
_this.options.beforeReorganize(_this.originalTable, _this.sortableTable);
// do reorganisation asynchronous
// for chrome a little bit more than 1 ms because we want to force a rerender
_this.originalTable.endIndex = _this.sortableTable.movingRow.prevAll().length + 1;
setTimeout(_this._rearrangeTableBackroundProcessing(), 50);
};
},
/*
* Disrupts the table. The original table stays the same.
* But on a layer above the original table we are constructing a list (ul > li)
* each li with a separate table representig a single col of the original table.
*/
_generateSortable: function(e) {
!e.cancelBubble && (e.cancelBubble = true);
var _this = this;
// table attributes
var attrs = this.originalTable.el[0].attributes;
var attrsString = '';
for (var i = 0; i < attrs.length; i++) {
if (attrs[i].nodeValue && attrs[i].nodeName != 'id' && attrs[i].nodeName != 'width') {
attrsString += attrs[i].nodeName + '="' + attrs[i].nodeValue + '" ';
}
}
// row attributes
var rowAttrsArr = [];
//compute height, special handling for ie needed :-(
var heightArr = [];
this.originalTable.el.find('tr').slice(0, this.options.maxMovingRows).each(function(i, v) {
// row attributes
var attrs = this.attributes;
var attrsString = "";
for (var j = 0; j < attrs.length; j++) {
if (attrs[j].nodeValue && attrs[j].nodeName != 'id') {
attrsString += " " + attrs[j].nodeName + '="' + attrs[j].nodeValue + '"';
}
}
rowAttrsArr.push(attrsString);
heightArr.push($(this).height());
});
// compute width, no special handling for ie needed :-)
var widthArr = [];
// compute total width, needed for not wrapping around after the screen ends (floating)
var totalWidth = 0;
/* Find children thead and tbody.
* Only to process the immediate tr-children. Bugfix for inner tables
*/
var thtb = _this.originalTable.el.children();
if (this.options.excludeFooter) {
thtb = thtb.not('tfoot');
}
thtb.find('> tr > th').each(function(i, v) {
var w = $(this).is(':visible') ? $(this).outerWidth() : 0;
widthArr.push(w);
totalWidth += w;
});
if(_this.options.exact) {
var difference = totalWidth - _this.originalTable.el.outerWidth();
widthArr[0] -= difference;
}
// one extra px on right and left side
totalWidth += 2
var sortableHtml = '<ul class="dragtable-sortable" style="position:absolute; width:' + totalWidth + 'px;">';
// assemble the needed html
thtb.find('> tr > th').each(function(i, v) {
var width_li = $(this).is(':visible') ? $(this).outerWidth() : 0;
sortableHtml += '<li style="width:' + width_li + 'px;">';
sortableHtml += '<table ' + attrsString + '>';
var row = thtb.find('> tr > th:nth-child(' + (i + 1) + ')');
if (_this.options.maxMovingRows > 1) {
row = row.add(thtb.find('> tr > td:nth-child(' + (i + 1) + ')').slice(0, _this.options.maxMovingRows - 1));
}
row.each(function(j) {
// TODO: May cause duplicate style-Attribute
var row_content = $(this).clone().wrap('<div></div>').parent().html();
if (row_content.toLowerCase().indexOf('<th') === 0) sortableHtml += "<thead>";
sortableHtml += '<tr ' + rowAttrsArr[j] + '" style="height:' + heightArr[j] + 'px;">';
sortableHtml += row_content;
if (row_content.toLowerCase().indexOf('<th') === 0) sortableHtml += "</thead>";
sortableHtml += '</tr>';
});
sortableHtml += '</table>';
sortableHtml += '</li>';
});
sortableHtml += '</ul>';
this.sortableTable.el = this.originalTable.el.before(sortableHtml).prev();
// set width if necessary
this.sortableTable.el.find('> li > table').each(function(i, v) {
$(this).css('width', widthArr[i] + 'px');
});
// assign this.sortableTable.selectedHandle
this.sortableTable.selectedHandle = this.sortableTable.el.find('th .dragtable-handle-selected');
var items = !this.options.dragaccept ? 'li' : 'li:has(' + this.options.dragaccept + ')';
this.sortableTable.el.sortable({
items: items,
stop: this._rearrangeTable(),
// pass thru options for sortable widget
revert: this.options.revert,
tolerance: this.options.tolerance,
containment: this.options.containment,
cursor: this.options.cursor,
cursorAt: this.options.cursorAt,
distance: this.options.distance,
axis: this.options.axis
});
// assign start index
this.originalTable.startIndex = $(e.target).closest('th').prevAll().length + 1;
this.options.beforeMoving(this.originalTable, this.sortableTable);
// Start moving by delegating the original event to the new sortable table
this.sortableTable.movingRow = this.sortableTable.el.find('> li:nth-child(' + this.originalTable.startIndex + ')');
// prevent the user from drag selecting "highlighting" surrounding page elements
disableTextSelection();
// clone the initial event and trigger the sort with it
this.sortableTable.movingRow.trigger($.extend($.Event(e.type), {
which: 1,
clientX: e.clientX,
clientY: e.clientY,
pageX: e.pageX,
pageY: e.pageY,
screenX: e.screenX,
screenY: e.screenY
}));
// Some inner divs to deliver the posibillity to style the placeholder more sophisticated
var placeholder = this.sortableTable.el.find('.ui-sortable-placeholder');
if(!placeholder.height() <= 0) {
placeholder.css('height', this.sortableTable.el.find('.ui-sortable-helper').height());
}
placeholder.html('<div class="outer" style="height:100%;"><div class="inner" style="height:100%;"></div></div>');
},
bindTo: {},
_create: function() {
this.originalTable = {
el: this.element,
selectedHandle: $(),
sortOrder: {},
startIndex: 0,
endIndex: 0
};
// bind draggable to 'th' by default
this.bindTo = this.originalTable.el.find('th');
// filter only the cols that are accepted
if (this.options.dragaccept) {
this.bindTo = this.bindTo.filter(this.options.dragaccept);
}
// bind draggable to handle if exists
if (this.bindTo.find(this.options.dragHandle).length > 0) {
this.bindTo = this.bindTo.find(this.options.dragHandle);
}
// restore state if necessary
if (this.options.restoreState !== null) {
$.isFunction(this.options.restoreState) ? this.options.restoreState(this.originalTable) : this._restoreState(this.options.restoreState);
}
var _this = this;
this.bindTo.mousedown(function(evt) {
// listen only to left mouse click
if(evt.which!==1) return;
if (_this.options.beforeStart(_this.originalTable) === false) {
return;
}
clearTimeout(this.downTimer);
this.downTimer = setTimeout(function() {
_this.originalTable.selectedHandle = $(this);
_this.originalTable.selectedHandle.addClass('dragtable-handle-selected');
_this._generateSortable(evt);
}, _this.options.clickDelay);
}).mouseup(function(evt) {
clearTimeout(this.downTimer);
});
},
redraw: function(){
this.destroy();
this._create();
},
destroy: function() {
this.bindTo.unbind('mousedown');
$.Widget.prototype.destroy.apply(this, arguments); // default destroy
// now do other stuff particular to this widget
}
});
/** closure-scoped "private" functions **/
var body_onselectstart_save = $(document.body).attr('onselectstart'),
body_unselectable_save = $(document.body).attr('unselectable');
// css properties to disable user-select on the body tag by appending a <style> tag to the <head>
// remove any current document selections
function disableTextSelection() {
// jQuery doesn't support the element.text attribute in MSIE 8
// http://stackoverflow.com/questions/2692770/style-style-textcss-appendtohead-does-not-work-in-ie
var $style = $('<style id="__dragtable_disable_text_selection__" type="text/css">body { -ms-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;user-select:none; }</style>');
$(document.head).append($style);
$(document.body).attr('onselectstart', 'return false;').attr('unselectable', 'on');
if (window.getSelection) {
window.getSelection().removeAllRanges();
} else {
document.selection.empty(); // MSIE http://msdn.microsoft.com/en-us/library/ms535869%28v=VS.85%29.aspx
}
}
// remove the <style> tag, and restore the original <body> onselectstart attribute
function restoreTextSelection() {
$('#__dragtable_disable_text_selection__').remove();
if (body_onselectstart_save) {
$(document.body).attr('onselectstart', body_onselectstart_save);
} else {
$(document.body).removeAttr('onselectstart');
}
if (body_unselectable_save) {
$(document.body).attr('unselectable', body_unselectable_save);
} else {
$(document.body).removeAttr('unselectable');
}
}
function swapNodes(a, b) {
var aparent = a.parentNode;
var asibling = a.nextSibling === b ? a : a.nextSibling;
b.parentNode.insertBefore(a, b);
aparent.insertBefore(b, asibling);
}
})(jQuery);
@@ -0,0 +1,18 @@
.rc-handle-container {
position: relative;
}
.rc-handle {
position: absolute;
width: 7px;
cursor: ew-resize;
margin-left: -3px;
z-index: 2;
}
table.rc-table-resizing {
cursor: ew-resize;
}
table.rc-table-resizing thead,
table.rc-table-resizing thead > th,
table.rc-table-resizing thead > th > a {
cursor: ew-resize;
}
@@ -0,0 +1,679 @@
/**
* jquery-resizable-columns - Resizable table columns for jQuery
* @date Sat May 16 2015 19:03:57 GMT+0100 (BST)
* @version v0.1.0
* @link http://dobtco.github.io/jquery-resizable-columns/
* @license MIT
*/
(function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == "function" && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
var f = new Error("Cannot find module '" + o + "'");
throw f.code = "MODULE_NOT_FOUND", f
}
var l = n[o] = {
exports: {}
};
t[o][0].call(l.exports, function(e) {
var n = t[o][1][e];
return s(n ? n : e)
}, l, l.exports, e, t, n, r)
}
return n[o].exports
}
var i = typeof require == "function" && require;
for (var o = 0; o < r.length; o++) s(r[o]);
return s
})({
1: [function(require, module, exports) {
'use strict';
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var _class = require('./class');
var _class2 = _interopRequireDefault(_class);
var _constants = require('./constants');
$.fn.resizableColumns = function(optionsOrMethod) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return this.each(function() {
var $table = $(this);
var api = $table.data(_constants.DATA_API);
if (!api) {
api = new _class2['default']($table, optionsOrMethod);
$table.data(_constants.DATA_API, api);
} else if (typeof optionsOrMethod === 'string') {
return api[optionsOrMethod].apply(api, args);
}
});
};
$.resizableColumns = _class2['default'];
}, {
"./class": 2,
"./constants": 3
}],
2: [function(require, module, exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _createClass = (function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ('value' in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
})();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError('Cannot call a class as a function');
}
}
var _constants = require('./constants');
/**
Takes a <table /> element and makes it's columns resizable across both
mobile and desktop clients.
@class ResizableColumns
@param $table {jQuery} jQuery-wrapped <table> element to make resizable
@param options {Object} Configuration object
**/
var ResizableColumns = (function() {
function ResizableColumns($table, options) {
_classCallCheck(this, ResizableColumns);
this.ns = '.rc' + this.count++;
this.options = $.extend({}, ResizableColumns.defaults, options);
this.$window = $(window);
this.$ownerDocument = $($table[0].ownerDocument);
this.$table = $table;
this.refreshHeaders();
this.restoreColumnWidths();
this.syncHandleWidths();
this.bindEvents(this.$window, 'resize', this.syncHandleWidths.bind(this));
if (this.options.start) {
this.bindEvents(this.$table, _constants.EVENT_RESIZE_START, this.options.start);
}
if (this.options.resize) {
this.bindEvents(this.$table, _constants.EVENT_RESIZE, this.options.resize);
}
if (this.options.stop) {
this.bindEvents(this.$table, _constants.EVENT_RESIZE_STOP, this.options.stop);
}
}
_createClass(ResizableColumns, [{
key: 'refreshHeaders',
/**
Refreshes the headers associated with this instances <table/> element and
generates handles for them. Also assigns percentage widths.
@method refreshHeaders
**/
value: function refreshHeaders() {
// Allow the selector to be both a regular selctor string as well as
// a dynamic callback
var selector = this.options.selector;
if (typeof selector === 'function') {
selector = selector.call(this, this.$table);
}
// Select all table headers
this.$tableHeaders = this.$table.find(selector);
// Assign percentage widths first, then create drag handles
this.assignPercentageWidths();
this.createHandles();
}
}, {
key: 'createHandles',
/**
Creates dummy handle elements for all table header columns
@method createHandles
**/
value: function createHandles() {
var _this = this;
var ref = this.$handleContainer;
if (ref != null) {
ref.remove();
}
this.$handleContainer = $('<div class=\'' + _constants.CLASS_HANDLE_CONTAINER + '\' />');
this.$table.before(this.$handleContainer);
this.$tableHeaders.each(function(i, el) {
var $current = _this.$tableHeaders.eq(i);
var $next = _this.$tableHeaders.eq(i + 1);
if ($next.length === 0 || $current.is(_constants.SELECTOR_UNRESIZABLE) || $next.is(_constants.SELECTOR_UNRESIZABLE)) {
return;
}
var $handle = $('<div class=\'' + _constants.CLASS_HANDLE + '\' />').data(_constants.DATA_TH, $(el)).appendTo(_this.$handleContainer);
});
this.bindEvents(this.$handleContainer, ['mousedown', 'touchstart'], '.' + _constants.CLASS_HANDLE, this.onPointerDown.bind(this));
}
}, {
key: 'assignPercentageWidths',
/**
Assigns a percentage width to all columns based on their current pixel width(s)
@method assignPercentageWidths
**/
value: function assignPercentageWidths() {
var _this2 = this;
this.$tableHeaders.each(function(_, el) {
var $el = $(el);
_this2.setWidth($el[0], $el.outerWidth() / _this2.$table.width() * 100);
});
}
}, {
key: 'syncHandleWidths',
/**
@method syncHandleWidths
**/
value: function syncHandleWidths() {
var _this3 = this;
var $container = this.$handleContainer;
$container.width(this.$table.width());
$container.find('.' + _constants.CLASS_HANDLE).each(function(_, el) {
var $el = $(el);
var height = _this3.options.resizeFromBody ? _this3.$table.height() : _this3.$table.find('thead').height();
var left = $el.data(_constants.DATA_TH).outerWidth() + ($el.data(_constants.DATA_TH).offset().left - _this3.$handleContainer.offset().left);
$el.css({
left: left,
height: height
});
});
}
}, {
key: 'saveColumnWidths',
/**
Persists the column widths in localStorage
@method saveColumnWidths
**/
value: function saveColumnWidths() {
var _this4 = this;
this.$tableHeaders.each(function(_, el) {
var $el = $(el);
if (_this4.options.store && !$el.is(_constants.SELECTOR_UNRESIZABLE)) {
_this4.options.store.set(_this4.generateColumnId($el), _this4.parseWidth(el));
}
});
}
}, {
key: 'restoreColumnWidths',
/**
Retrieves and sets the column widths from localStorage
@method restoreColumnWidths
**/
value: function restoreColumnWidths() {
var _this5 = this;
this.$tableHeaders.each(function(_, el) {
var $el = $(el);
if (_this5.options.store && !$el.is(_constants.SELECTOR_UNRESIZABLE)) {
var width = _this5.options.store.get(_this5.generateColumnId($el));
if (width != null) {
_this5.setWidth(el, width);
}
}
});
}
}, {
key: 'onPointerDown',
/**
Pointer/mouse down handler
@method onPointerDown
@param event {Object} Event object associated with the interaction
**/
value: function onPointerDown(event) {
// Only applies to left-click dragging
if (event.which !== 1) {
return;
}
// If a previous operation is defined, we missed the last mouseup.
// Probably gobbled up by user mousing out the window then releasing.
// We'll simulate a pointerup here prior to it
if (this.operation) {
this.onPointerUp(event);
}
// Ignore non-resizable columns
var $currentGrip = $(event.currentTarget);
if ($currentGrip.is(_constants.SELECTOR_UNRESIZABLE)) {
return;
}
console.log('鼠标单击')
var gripIndex = $currentGrip.index();
var $leftColumn = this.$tableHeaders.eq(gripIndex).not(_constants.SELECTOR_UNRESIZABLE);
var $rightColumn = this.$tableHeaders.eq(gripIndex + 1).not(_constants.SELECTOR_UNRESIZABLE);
var leftWidth = this.parseWidth($leftColumn[0]);
var rightWidth = this.parseWidth($rightColumn[0]);
this.operation = {
$leftColumn: $leftColumn,
$rightColumn: $rightColumn,
$currentGrip: $currentGrip,
startX: this.getPointerX(event),
widths: {
left: leftWidth,
right: rightWidth
},
newWidths: {
left: leftWidth,
right: rightWidth
}
};
this.bindEvents(this.$ownerDocument, ['mousemove', 'touchmove'], this.onPointerMove.bind(this));
this.bindEvents(this.$ownerDocument, ['mouseup', 'touchend'], this.onPointerUp.bind(this));
this.$handleContainer.add(this.$table).addClass(_constants.CLASS_TABLE_RESIZING);
$leftColumn.add($rightColumn).add($currentGrip).addClass(_constants.CLASS_COLUMN_RESIZING);
this.triggerEvent(_constants.EVENT_RESIZE_START, [$leftColumn, $rightColumn, leftWidth, rightWidth], event);
event.preventDefault();
}
}, {
key: 'onPointerMove',
/**
Pointer/mouse movement handler
@method onPointerMove
@param event {Object} Event object associated with the interaction
**/
value: function onPointerMove(event) {
var op = this.operation;
if (!this.operation) {
return;
}
// Determine the delta change between start and new mouse position, as a percentage of the table width
var difference = (this.getPointerX(event) - op.startX) / this.$table.width() * 100;
if (difference === 0) {
return;
}
var leftColumn = op.$leftColumn[0];
var rightColumn = op.$rightColumn[0];
var widthLeft = undefined,
widthRight = undefined;
if (difference > 0) {
widthLeft = this.constrainWidth(op.widths.left + (op.widths.right - op.newWidths.right));
widthRight = this.constrainWidth(op.widths.right - difference);
} else if (difference < 0) {
widthLeft = this.constrainWidth(op.widths.left + difference);
widthRight = this.constrainWidth(op.widths.right + (op.widths.left - op.newWidths.left));
}
if (leftColumn) {
this.setWidth(leftColumn, widthLeft);
}
if (rightColumn) {
this.setWidth(rightColumn, widthRight);
}
op.newWidths.left = widthLeft;
op.newWidths.right = widthRight;
return this.triggerEvent(_constants.EVENT_RESIZE, [op.$leftColumn, op.$rightColumn, widthLeft, widthRight], event);
}
}, {
key: 'onPointerUp',
/**
Pointer/mouse release handler
@method onPointerUp
@param event {Object} Event object associated with the interaction
**/
value: function onPointerUp(event) {
var op = this.operation;
if (!this.operation) {
return;
}
this.unbindEvents(this.$ownerDocument, ['mouseup', 'touchend', 'mousemove', 'touchmove']);
this.$handleContainer.add(this.$table).removeClass(_constants.CLASS_TABLE_RESIZING);
op.$leftColumn.add(op.$rightColumn).add(op.$currentGrip).removeClass(_constants.CLASS_COLUMN_RESIZING);
this.syncHandleWidths();
this.saveColumnWidths();
this.operation = null;
// event.which = 0;
console.log('鼠标抬起', event)
this.onPointerDown(event);
return this.triggerEvent(_constants.EVENT_RESIZE_STOP, [op.$leftColumn, op.$rightColumn, op.newWidths.left, op.newWidths.right], event);
}
}, {
key: 'destroy',
/**
Removes all event listeners, data, and added DOM elements. Takes
the <table/> element back to how it was, and returns it
@method destroy
@return {jQuery} Original jQuery-wrapped <table> element
**/
value: function destroy() {
var $table = this.$table;
var $handles = this.$handleContainer.find('.' + _constants.CLASS_HANDLE);
this.unbindEvents(this.$window.add(this.$ownerDocument).add(this.$table).add($handles));
$handles.removeData(_constants.DATA_TH);
$table.removeData(_constants.DATA_API);
this.$handleContainer.remove();
this.$handleContainer = null;
this.$tableHeaders = null;
this.$table = null;
return $table;
}
}, {
key: 'bindEvents',
/**
Binds given events for this instance to the given target DOMElement
@private
@method bindEvents
@param target {jQuery} jQuery-wrapped DOMElement to bind events to
@param events {String|Array} Event name (or array of) to bind
@param selectorOrCallback {String|Function} Selector string or callback
@param [callback] {Function} Callback method
**/
value: function bindEvents($target, events, selectorOrCallback, callback) {
if (typeof events === 'string') {
events = events + this.ns;
} else {
events = events.join(this.ns + ' ') + this.ns;
}
if (arguments.length > 3) {
$target.on(events, selectorOrCallback, callback);
} else {
$target.on(events, selectorOrCallback);
}
}
}, {
key: 'unbindEvents',
/**
Unbinds events specific to this instance from the given target DOMElement
@private
@method unbindEvents
@param target {jQuery} jQuery-wrapped DOMElement to unbind events from
@param events {String|Array} Event name (or array of) to unbind
**/
value: function unbindEvents($target, events) {
if (typeof events === 'string') {
events = events + this.ns;
} else if (events != null) {
events = events.join(this.ns + ' ') + this.ns;
} else {
events = this.ns;
}
$target.off(events);
}
}, {
key: 'triggerEvent',
/**
Triggers an event on the <table/> element for a given type with given
arguments, also setting and allowing access to the originalEvent if
given. Returns the result of the triggered event.
@private
@method triggerEvent
@param type {String} Event name
@param args {Array} Array of arguments to pass through
@param [originalEvent] If given, is set on the event object
@return {Mixed} Result of the event trigger action
**/
value: function triggerEvent(type, args, originalEvent) {
var event = $.Event(type);
if (event.originalEvent) {
event.originalEvent = $.extend({}, originalEvent);
}
return this.$table.trigger(event, [this].concat(args || []));
}
}, {
key: 'generateColumnId',
/**
Calculates a unique column ID for a given column DOMElement
@private
@method generateColumnId
@param $el {jQuery} jQuery-wrapped column element
@return {String} Column ID
**/
value: function generateColumnId($el) {
return this.$table.data(_constants.DATA_COLUMNS_ID) + '-' + $el.data(_constants.DATA_COLUMN_ID);
}
}, {
key: 'parseWidth',
/**
Parses a given DOMElement's width into a float
@private
@method parseWidth
@param element {DOMElement} Element to get width of
@return {Number} Element's width as a float
**/
value: function parseWidth(element) {
return element ? parseFloat(element.style.width.replace('%', '')) : 0;
}
}, {
key: 'setWidth',
/**
Sets the percentage width of a given DOMElement
@private
@method setWidth
@param element {DOMElement} Element to set width on
@param width {Number} Width, as a percentage, to set
**/
value: function setWidth(element, width) {
width = width.toFixed(2);
width = width > 0 ? width : 0;
element.style.width = width + '%';
}
}, {
key: 'constrainWidth',
/**
Constrains a given width to the minimum and maximum ranges defined in
the `minWidth` and `maxWidth` configuration options, respectively.
@private
@method constrainWidth
@param width {Number} Width to constrain
@return {Number} Constrained width
**/
value: function constrainWidth(width) {
if (this.options.minWidth != undefined) {
width = Math.max(this.options.minWidth, width);
}
if (this.options.maxWidth != undefined) {
width = Math.min(this.options.maxWidth, width);
}
return width;
}
}, {
key: 'getPointerX',
/**
Given a particular Event object, retrieves the current pointer offset along
the horizontal direction. Accounts for both regular mouse clicks as well as
pointer-like systems (mobiles, tablets etc.)
@private
@method getPointerX
@param event {Object} Event object associated with the interaction
@return {Number} Horizontal pointer offset
**/
value: function getPointerX(event) {
if (event.type.indexOf('touch') === 0) {
return (event.originalEvent.touches[0] || event.originalEvent.changedTouches[0]).pageX;
}
return event.pageX;
}
}]);
return ResizableColumns;
})();
exports['default'] = ResizableColumns;
ResizableColumns.defaults = {
selector: function selector($table) {
if ($table.find('thead').length) {
return _constants.SELECTOR_TH;
}
return _constants.SELECTOR_TD;
},
store: window.store,
syncHandlers: true,
resizeFromBody: true,
maxWidth: null,
minWidth: 0.01
};
ResizableColumns.count = 0;
module.exports = exports['default'];
}, {
"./constants": 3
}],
3: [function(require, module, exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var DATA_API = 'resizableColumns';
exports.DATA_API = DATA_API;
var DATA_COLUMNS_ID = 'resizable-columns-id';
exports.DATA_COLUMNS_ID = DATA_COLUMNS_ID;
var DATA_COLUMN_ID = 'resizable-column-id';
exports.DATA_COLUMN_ID = DATA_COLUMN_ID;
var DATA_TH = 'th';
exports.DATA_TH = DATA_TH;
var CLASS_TABLE_RESIZING = 'rc-table-resizing';
exports.CLASS_TABLE_RESIZING = CLASS_TABLE_RESIZING;
var CLASS_COLUMN_RESIZING = 'rc-column-resizing';
exports.CLASS_COLUMN_RESIZING = CLASS_COLUMN_RESIZING;
var CLASS_HANDLE = 'rc-handle';
exports.CLASS_HANDLE = CLASS_HANDLE;
var CLASS_HANDLE_CONTAINER = 'rc-handle-container';
exports.CLASS_HANDLE_CONTAINER = CLASS_HANDLE_CONTAINER;
var EVENT_RESIZE_START = 'column:resize:start';
exports.EVENT_RESIZE_START = EVENT_RESIZE_START;
var EVENT_RESIZE = 'column:resize';
exports.EVENT_RESIZE = EVENT_RESIZE;
var EVENT_RESIZE_STOP = 'column:resize:stop';
exports.EVENT_RESIZE_STOP = EVENT_RESIZE_STOP;
var SELECTOR_TH = 'tr:first > th:visible';
exports.SELECTOR_TH = SELECTOR_TH;
var SELECTOR_TD = 'tr:first > td:visible';
exports.SELECTOR_TD = SELECTOR_TD;
var SELECTOR_UNRESIZABLE = '[data-noresize]';
exports.SELECTOR_UNRESIZABLE = SELECTOR_UNRESIZABLE;
}, {}],
4: [function(require, module, exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var _class = require('./class');
var _class2 = _interopRequireDefault(_class);
var _adapter = require('./adapter');
var _adapter2 = _interopRequireDefault(_adapter);
exports['default'] = _class2['default'];
module.exports = exports['default'];
}, {
"./adapter": 1,
"./class": 2
}]
}, {}, [4])
@@ -0,0 +1,6 @@
.treegrid-indent {width:16px; height: 16px; display: inline-block; position: relative;}
.treegrid-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;}
.treegrid-expander-expanded{background-image: url(../img/collapse.png); }
.treegrid-expander-collapsed{background-image: url(../img/expand.png);}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,374 @@
$.fn.editableTable = function(options) {
// Default options
let defaultOptions = {
cloneProperties: ['padding', 'padding-top', 'padding-bottom', 'padding-left', 'padding-right',
'text-align', 'font', 'font-size', 'font-family', 'font-weight',
'border', 'border-top', 'border-bottom', 'border-left', 'border-right', 'color', 'background-color', 'border-radius'
],
columns: []
}
// Overlay default options on user options
options = $.extend({}, defaultOptions, options);
// The instance reference we'll pass to the user
let _instance;
// Class to put on the editor to denote an error
let errorClass = 'error';
// Something to tag the hidden input with
let identifierAttribute = 'table-editor-input';
// Keycodes
let ARROW_LEFT = 37,
ARROW_UP = 38,
ARROW_RIGHT = 39,
ARROW_DOWN = 40,
ENTER = 13,
ESC = 27,
TAB = 9,
CONTROL = 17,
LEFT_WINDOWS = 91,
SELECT_KEY = 93;
// The table element
let element = $(this);
// Show all columns and then hide any hidden ones
element.find('th').show();
options.columns.forEach((col, i) => {
if (col.isHidden !== undefined && col.isHidden) element.find('th').eq(i).hide();
});
// If there are actions, add a final blank table header
if (options.actions !== undefined && options.actions.length > 0) {
// Add header if we don't already have one
if (!element.find('thead tr th[actions]').length) {
element.find('thead tr').append($('<th actions=""></th>'));
}
}
// The textbox allowing user input. Only add if there's not already an editor input control around
let editor;
let existingEditor = element.parent().find(`input[${identifierAttribute}]`);
if (existingEditor.length) {
editor = existingEditor.first();
} else {
editor = $('<input>');
}
// Add it to the DOM
editor.attr(identifierAttribute, '')
.css('position', 'absolute')
.hide()
.appendTo(element.parent());
// The `td` being "edited"
let activeCell;
// Function to show the editor
function showEditor(select) {
// Set the active cell
activeCell = element.find('td:focus:not([action])');
if (activeCell.length) {
// Get column def
let currentColIndex = $(activeCell).parent().children('td').index($(activeCell));
let columnDef = options.columns[currentColIndex];
// Prepare input control
editor.val(activeCell.text()) // Throw the value in
.removeClass(errorClass) // remove any error classes
.show() // show it
.offset(activeCell.offset()) // position it
.css(activeCell.css(options.cloneProperties)) // make it look similar by cloning properties
.width(activeCell.width()) // size it
.height(activeCell.height()) // size it
.focus(); // focus user input into it
// Set max length, if it's specified
if (columnDef.maxLength !== undefined) editor.attr('maxlength', columnDef.maxLength);
else editor.removeAttr('maxlength');
if (select) {
editor.select();
}
}
};
function setActiveText() {
let text = editor.val(),
evt = $.Event('change'),
originalContent;
if (activeCell.text() === text || editor.hasClass(errorClass)) {
return true;
}
originalContent = activeCell.html();
activeCell.text(text).trigger(evt, text);
if (evt.result === false) {
activeCell.html(originalContent);
}
};
// For traversing the table up/down/left/right by returning the adjacent cell
function handleMovement(element, keycode) {
if (keycode === ARROW_RIGHT) {
return element.next('td');
} else if (keycode === ARROW_LEFT) {
return element.prev('td');
} else if (keycode === ARROW_UP) {
return element.parent().prev().children().eq(element.index());
} else if (keycode === ARROW_DOWN) {
return element.parent().next().children().eq(element.index());
}
return [];
};
// On the editor losing focus, hide the input
editor.blur(function() {
setActiveText();
editor.hide();
});
// Handle typing into the input
editor.keydown(function(e) {
if (e.which === ENTER) {
setActiveText();
editor.hide();
activeCell.focus();
e.preventDefault();
e.stopPropagation();
} else if (e.which === ESC) {
editor.val(activeCell.text());
e.preventDefault();
e.stopPropagation();
editor.hide();
activeCell.focus();
} else if (e.which === TAB) {
activeCell.focus();
} else if (this.selectionEnd - this.selectionStart === this.value.length) {
let possibleMove = handleMovement(activeCell, e.which);
if (possibleMove.length > 0) {
possibleMove.focus();
e.preventDefault();
e.stopPropagation();
}
}
});
// Validate cell input on typing or pasting
editor.on('input paste', function() {
let evt = $.Event('validate');
activeCell.trigger(evt, editor.val());
if (evt.result !== undefined) {
if (evt.result === false) {
editor.addClass(errorClass);
} else {
editor.removeClass(errorClass);
}
}
});
// On table clicking, move around cells
element.on('click keypress dblclick', showEditor);
element.keydown(function(e) {
let prevent = true,
possibleMove = handleMovement($(e.target), e.which);
if (possibleMove.length > 0) {
possibleMove.focus();
} else if (e.which === ENTER) {
showEditor(false);
} else if (e.which === CONTROL || e.which === LEFT_WINDOWS || e.which === SELECT_KEY) {
showEditor(true);
prevent = false;
} else {
prevent = false;
}
if (prevent) {
e.stopPropagation();
e.preventDefault();
}
});
element.find('td').prop('tabindex', 1);
$(window).on('resize', function() {
if (editor.is(':visible')) {
editor.offset(activeCell.offset())
.width(activeCell.width())
.height(activeCell.height());
}
});
function refresh() {
$(element).editableTable(options);
}
// Validate based on options
$('table td').on('validate', function(evt, newValue) {
let currentColIndex = $(evt.currentTarget).parent().children('td').index($(evt.currentTarget));
let columnDef = options.columns[currentColIndex];
let currentData = _instance.getData({
convert: false
}); // current data to allow user to validate based on existing data
let isValid = columnDef.isValid && columnDef.isValid(newValue, currentData);
return isValid;
});
$('table td').on('change', function(evt, newValue) {
let td = $(this);
let currentColIndex = $(evt.currentTarget).parent().children('td').index($(evt.currentTarget));
let columnDef = options.columns[currentColIndex];
if (columnDef.removeRowIfCleared && newValue == '') {
td.parent('tr').remove();
}
// Bind user-specified events if they exist
if (typeof columnDef.afterChange == 'function') {
columnDef.afterChange(newValue, td);
}
return true;
});
// Set up the instance reference
_instance = {
// Get table back out as JSON
getData: function(opts) {
opts = $.extend({}, {
convert: true
}, opts);
let rowData = [];
element.find('tbody tr').toArray().forEach(row => {
let newRow = {};
$(row).find('td:not([action])').toArray().forEach(col => {
let columnsDef = options.columns[
$(col).parent().children('td').index($(col)) // only index at cells, or "td"s
];
let value = $(col).text();
// Check if the cell was marked as having a null value, and if so, extract as null and not
// as a blank string
let isNull = $(col).attr('data-is-null');
if (typeof isNull !== 'undefined' && isNull !== false) {
value = null;
}
// Convert if requried
if (opts.convert && typeof columnsDef.convertOut == 'function') {
value = columnsDef.convertOut(value);
}
newRow[columnsDef.name] = value;
});
rowData.push(newRow);
});
return rowData;
},
// Add a new row with JSON
addRow: function(row) {
let newRow = $(`<tr></tr>`);
if (row !== undefined && row !== null) {
let props = Object.keys(row);
let columnsToAdd = [];
props.forEach(prop => {
let columnDef = options.columns.filter(col => col.name === prop);
if (columnDef.length) {
columnDef = columnDef[0];
columnsToAdd.push({
order: columnDef.index,
value: row[prop],
prop: prop,
def: columnDef
});
}
})
columnsToAdd.sort((a, b) => a.order - b.order).forEach((colToAdd, index) => {
let newCell;
if (colToAdd.value !== null)
newCell = $(`<td>${colToAdd.value}</td>`);
else
newCell = $(`<td data-is-null></td>`);
// Apply any classes
if (colToAdd.def.classes !== undefined && colToAdd.def.classes.length) {
colToAdd.def.classes.forEach(classToAdd => newCell.addClass(classToAdd));
}
// Apply any style
if (colToAdd.def.style !== undefined && colToAdd.def.style.length) {
newCell.attr("style", newCell.attr("style") + "; " + colToAdd.def.style);
}
// Hide if hidden
if (colToAdd.def.isHidden !== undefined && colToAdd.def.isHidden) {
newCell.hide();
}
// Add to the column
newRow.append(newCell);
// Trigger any events
let columnDef = options.columns.filter(col => col.name === colToAdd.prop)[0];
if (typeof columnDef.afterAdd == 'function') {
columnDef.afterAdd(colToAdd.value, newCell);
}
});
} else {
newRow = $(`<tr></tr>`);
activeOptions.columns.forEach(x => {
newRow.append(`<td></td>`);
});
}
// Add actions if any
if (options.actions !== undefined && options.actions.length > 0) {
let actionsCell = $(`<td action></td>`);
options.actions.forEach(a => {
let actionElement = $(a.label);
actionElement.css('cursor', 'pointer');
actionElement.click(e => a.action(e, newRow))
actionsCell.append(actionElement);
});
newRow.append(actionsCell);
}
// Add the new row
let lastRow = element.find('tbody tr:last');
if (lastRow.length > 0)
lastRow.after(newRow);
else
element.find('tbody').append(newRow);
refresh();
},
// Clear the table
clear: function() {
element.find('tbody tr').remove();
},
// Set the table's data with JSON
setData: function(data) {
if (data) {
this.clear();
data.forEach(datum => {
this.addRow(datum);
});
}
}
};
return _instance;
};
File diff suppressed because one or more lines are too long
@@ -0,0 +1,248 @@
/*! jquery.tablednd.js 20-11-2020 */ ! function(a, b, c, d) {
var e = "touchstart mousedown",
f = "touchmove mousemove",
g = "touchend mouseup";
a(c).ready(function() {
function b(a) {
for (var b = {}, c = a.match(/([^;:]+)/g) || []; c.length;) b[c.shift()] = c.shift().trim();
return b
}
a("table").each(function() {
"dnd" === a(this).data("table") && a(this).tableDnD({
onDragStyle: a(this).data("ondragstyle") && b(a(this).data("ondragstyle")) || null,
onDropStyle: a(this).data("ondropstyle") && b(a(this).data("ondropstyle")) || null,
onDragClass: a(this).data("ondragclass") === d && "tDnD_whileDrag" || a(this).data("ondragclass"),
onDrop: a(this).data("ondrop") && new Function("table", "row", a(this).data("ondrop")),
onDragStart: a(this).data("ondragstart") && new Function("table", "row", a(this).data("ondragstart")),
onDragStop: a(this).data("ondragstop") && new Function("table", "row", a(this).data("ondragstop")),
scrollAmount: a(this).data("scrollamount") || 5,
sensitivity: a(this).data("sensitivity") || 10,
hierarchyLevel: a(this).data("hierarchylevel") || 0,
indentArtifact: a(this).data("indentartifact") || '<div class="indent">&nbsp;</div>',
autoWidthAdjust: a(this).data("autowidthadjust") || !0,
autoCleanRelations: a(this).data("autocleanrelations") || !0,
jsonPretifySeparator: a(this).data("jsonpretifyseparator") || "\t",
serializeRegexp: a(this).data("serializeregexp") && new RegExp(a(this).data("serializeregexp")) || /[^\-]*$/,
serializeParamName: a(this).data("serializeparamname") || !1,
dragHandle: a(this).data("draghandle") || null
})
})
}), jQuery.tableDnD = {
currentTable: null,
dragObject: null,
mouseOffset: null,
oldX: 0,
oldY: 0,
build: function(b) {
return this.each(function() {
this.tableDnDConfig = a.extend({
onDragStyle: null,
onDropStyle: null,
onDragClass: "tDnD_whileDrag",
onDrop: null,
onDragStart: null,
onDragStop: null,
scrollAmount: 5,
sensitivity: 10,
hierarchyLevel: 0,
indentArtifact: '<div class="indent">&nbsp;</div>',
autoWidthAdjust: !0,
autoCleanRelations: !0,
jsonPretifySeparator: "\t",
serializeRegexp: /[^\-]*$/,
serializeParamName: !1,
dragHandle: null
}, b || {}), a.tableDnD.makeDraggable(this), this.tableDnDConfig.hierarchyLevel && a.tableDnD.makeIndented(this)
}), this
},
makeIndented: function(b) {
var c, d, e = b.tableDnDConfig,
f = b.rows,
g = a(f).first().find("td:first")[0],
h = 0,
i = 0;
if (a(b).hasClass("indtd")) return null;
d = a(b).addClass("indtd").attr("style"), a(b).css({
whiteSpace: "nowrap"
});
for (var j = 0; j < f.length; j++) i < a(f[j]).find("td:first").text().length && (i = a(f[j]).find("td:first").text().length, c = j);
for (a(g).css({
width: "auto"
}), j = 0; j < e.hierarchyLevel; j++) a(f[c]).find("td:first").prepend(e.indentArtifact);
for (g && a(g).css({
width: g.offsetWidth
}), d && a(b).css(d), j = 0; j < e.hierarchyLevel; j++) a(f[c]).find("td:first").children(":first").remove();
return e.hierarchyLevel && a(f).each(function() {
(h = a(this).data("level") || 0) <= e.hierarchyLevel && a(this).data("level", h) || a(this).data("level", 0);
for (var b = 0; b < a(this).data("level"); b++) a(this).find("td:first").prepend(e.indentArtifact)
}), this
},
makeDraggable: function(b) {
var c = b.tableDnDConfig;
c.dragHandle && a(c.dragHandle, b).each(function() {
a(this).bind(e, function(d) {
return a.tableDnD.initialiseDrag(a(this).parents("tr")[0], b, this, d, c), !1
})
}) || a(b.rows).each(function() {
a(this).hasClass("nodrag") ? a(this).css("cursor", "") : a(this).bind(e, function(d) {
if ("TD" === d.target.tagName) return a.tableDnD.initialiseDrag(this, b, this, d, c), !1
}).css("cursor", "move")
})
},
currentOrder: function() {
var b = this.currentTable.rows;
return a.map(b, function(b) {
return (a(b).data("level") + b.id).replace(/\s/g, "")
}).join("")
},
initialiseDrag: function(b, d, e, h, i) {
this.dragObject = b, this.currentTable = d, this.mouseOffset = this.getMouseOffset(e, h), this.originalOrder = this.currentOrder(), a(c).bind(f, this.mousemove).bind(g, this.mouseup), i.onDragStart && i.onDragStart(d, e)
},
updateTables: function() {
this.each(function() {
this.tableDnDConfig && a.tableDnD.makeDraggable(this)
})
},
mouseCoords: function(a) {
return a.originalEvent.changedTouches ? {
x: a.originalEvent.changedTouches[0].clientX,
y: a.originalEvent.changedTouches[0].clientY
} : a.pageX || a.pageY ? {
x: a.pageX,
y: a.pageY
} : {
x: a.clientX + c.body.scrollLeft - c.body.clientLeft,
y: a.clientY + c.body.scrollTop - c.body.clientTop
}
},
getMouseOffset: function(a, c) {
var d, e;
return c = c || b.event, e = this.getPosition(a), d = this.mouseCoords(c), {
x: d.x - e.x,
y: d.y - e.y
}
},
getPosition: function(a) {
for (var b = 0, c = 0; a.offsetParent;) b += a.offsetLeft, c += a.offsetTop, a = a.offsetParent;
return b += a.offsetLeft, c += a.offsetTop, {
x: b,
y: c
}
},
autoScroll: function(a) {
var d = this.currentTable.tableDnDConfig,
e = b.pageYOffset,
f = b.innerHeight ? b.innerHeight : c.documentElement.clientHeight ? c.documentElement.clientHeight : c.body.clientHeight;
c.all && (void 0 !== c.compatMode && "BackCompat" !== c.compatMode ? e = c.documentElement.scrollTop : void 0 !== c.body && (e = c.body.scrollTop)), a.y - e < d.scrollAmount && b.scrollBy(0, -d.scrollAmount) || f - (a.y - e) < d.scrollAmount && b.scrollBy(0, d.scrollAmount)
},
moveVerticle: function(a, b) {
0 !== a.vertical && b && this.dragObject !== b && this.dragObject.parentNode === b.parentNode && (0 > a.vertical && this.dragObject.parentNode.insertBefore(this.dragObject, b.nextSibling) || 0 < a.vertical && this.dragObject.parentNode.insertBefore(this.dragObject, b))
},
moveHorizontal: function(b, c) {
var d, e = this.currentTable.tableDnDConfig;
if (!e.hierarchyLevel || 0 === b.horizontal || !c || this.dragObject !== c) return null;
d = a(c).data("level"), 0 < b.horizontal && d > 0 && a(c).find("td:first").children(":first").remove() && a(c).data("level", --d), 0 > b.horizontal && d < e.hierarchyLevel && a(c).prev().data("level") >= d && a(c).children(":first").prepend(e.indentArtifact) && a(c).data("level", ++d)
},
mousemove: function(b) {
var c, d, e, f, g, h = a(a.tableDnD.dragObject),
i = a.tableDnD.currentTable.tableDnDConfig;
return b && b.preventDefault(), !!a.tableDnD.dragObject && ("touchmove" === b.type && event.preventDefault(), i.onDragClass && h.addClass(i.onDragClass) || h.css(i.onDragStyle), d = a.tableDnD.mouseCoords(b), f = d.x - a.tableDnD.mouseOffset.x, g = d.y - a.tableDnD.mouseOffset.y, a.tableDnD.autoScroll(d), c = a.tableDnD.findDropTargetRow(h, g), e = a.tableDnD.findDragDirection(f, g), a.tableDnD.moveVerticle(e, c), a.tableDnD.moveHorizontal(e, c), !1)
},
findDragDirection: function(a, b) {
var c = this.currentTable.tableDnDConfig.sensitivity,
d = this.oldX,
e = this.oldY,
f = d - c,
g = d + c,
h = e - c,
i = e + c,
j = {
horizontal: a >= f && a <= g ? 0 : a > d ? -1 : 1,
vertical: b >= h && b <= i ? 0 : b > e ? -1 : 1
};
return 0 !== j.horizontal && (this.oldX = a), 0 !== j.vertical && (this.oldY = b), j
},
findDropTargetRow: function(b, c) {
for (var d = 0, e = this.currentTable.rows, f = this.currentTable.tableDnDConfig, g = 0, h = null, i = 0; i < e.length; i++)
if (h = e[i], g = this.getPosition(h).y, d = parseInt(h.offsetHeight) / 2, 0 === h.offsetHeight && (g = this.getPosition(h.firstChild).y, d = parseInt(h.firstChild.offsetHeight) / 2), c > g - d && c < g + d) return b.is(h) || f.onAllowDrop && !f.onAllowDrop(b, h) || a(h).hasClass("nodrop") ? null : h;
return null
},
processMouseup: function() {
if (!this.currentTable || !this.dragObject) return null;
var b = this.currentTable.tableDnDConfig,
d = this.dragObject,
e = 0,
h = 0;
a(c).unbind(f, this.mousemove).unbind(g, this.mouseup), b.hierarchyLevel && b.autoCleanRelations && a(this.currentTable.rows).first().find("td:first").children().each(function() {
(h = a(this).parents("tr:first").data("level")) && a(this).parents("tr:first").data("level", --h) && a(this).remove()
}) && b.hierarchyLevel > 1 && a(this.currentTable.rows).each(function() {
if ((h = a(this).data("level")) > 1)
for (e = a(this).prev().data("level"); h > e + 1;) a(this).find("td:first").children(":first").remove(), a(this).data("level", --h)
}), b.onDragClass && a(d).removeClass(b.onDragClass) || a(d).css(b.onDropStyle), this.dragObject = null, b.onDrop && this.originalOrder !== this.currentOrder() && a(d).hide().fadeIn("fast") && b.onDrop(this.currentTable, d), b.onDragStop && b.onDragStop(this.currentTable, d), this.currentTable = null
},
mouseup: function(b) {
return b && b.preventDefault(), a.tableDnD.processMouseup(), !1
},
jsonize: function(a) {
var b = this.currentTable;
return a ? JSON.stringify(this.tableData(b), null, b.tableDnDConfig.jsonPretifySeparator) : JSON.stringify(this.tableData(b))
},
serialize: function() {
return a.param(this.tableData(this.currentTable))
},
serializeTable: function(a) {
for (var b = "", c = a.tableDnDConfig.serializeParamName || a.id, d = a.rows, e = 0; e < d.length; e++) {
b.length > 0 && (b += "&");
var f = d[e].id;
f && a.tableDnDConfig && a.tableDnDConfig.serializeRegexp && (f = f.match(a.tableDnDConfig.serializeRegexp)[0], b += c + "[]=" + f)
}
return b
},
serializeTables: function() {
var b = [];
return a("table").each(function() {
this.id && b.push(a.param(a.tableDnD.tableData(this)))
}), b.join("&")
},
tableData: function(b) {
var c, d, e, f, g = b.tableDnDConfig,
h = [],
i = 0,
j = 0,
k = null,
l = {};
if (b || (b = this.currentTable), !b || !b.rows || !b.rows.length) return {
error: {
code: 500,
message: "Not a valid table."
}
};
if (!b.id && !g.serializeParamName) return {
error: {
code: 500,
message: "No serializable unique id provided."
}
};
f = g.autoCleanRelations && b.rows || a.makeArray(b.rows), d = g.serializeParamName || b.id, e = d, c = function(a) {
return a && g && g.serializeRegexp ? a.match(g.serializeRegexp)[0] : a
}, l[e] = [], !g.autoCleanRelations && a(f[0]).data("level") && f.unshift({
id: "undefined"
});
for (var m = 0; m < f.length; m++)
if (g.hierarchyLevel) {
if (0 === (j = a(f[m]).data("level") || 0)) e = d, h = [];
else if (j > i) h.push([e, i]), e = c(f[m - 1].id);
else if (j < i)
for (var n = 0; n < h.length; n++) h[n][1] === j && (e = h[n][0]), h[n][1] >= i && (h[n][1] = 0);
i = j, a.isArray(l[e]) || (l[e] = []), k = c(f[m].id), k && l[e].push(k)
} else(k = c(f[m].id)) && l[e].push(k);
return l
}
}, jQuery.fn.extend({
tableDnD: a.tableDnD.build,
tableDnDUpdate: a.tableDnD.updateTables,
tableDnDSerialize: a.proxy(a.tableDnD.serialize, a.tableDnD),
tableDnDSerializeAll: a.tableDnD.serializeTables,
tableDnDData: a.proxy(a.tableDnD.tableData, a.tableDnD)
})
}(jQuery, window, window.document);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
@@ -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)}));
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
@@ -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 === '&nbsp;' ? 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);
}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
.no-filter-control{height:40px}.filter-control{margin:0 2px 2px}.ms-choice{border:0}.ms-parent>button:focus{outline:0}
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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(&nbsp;) 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;
}));
File diff suppressed because one or more lines are too long
@@ -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}
@@ -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);
}));
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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}
@@ -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);
}));
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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);
}));
@@ -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)}));
@@ -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);
}));
@@ -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)}));
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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\">&times;</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\">&times;</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();
};
}));
File diff suppressed because one or more lines are too long
@@ -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}
@@ -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);
}));
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -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}
@@ -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);
}));
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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);
}));
@@ -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)}));
@@ -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}
@@ -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);
}));
@@ -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}
File diff suppressed because one or more lines are too long
@@ -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\">&times;</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\">&times;</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\">&times;</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);
}));
File diff suppressed because one or more lines are too long
@@ -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);
}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,115 @@
/**
* 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 (t, n) {
"object" == typeof exports && "undefined" != typeof module ? n(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"], n) : n(null, null, (t = "undefined" != typeof globalThis ? globalThis : t || self).jQuery)
}(this, (function (t, n, o) {
"use strict";
o.fn.bootstrapTable.locales["zh-CN"] = o.fn.bootstrapTable.locales.zh = {
formatCopyRows: function () {
return "复制行"
}, formatPrint: function () {
return "打印"
}, formatLoadingMessage: function () {
return "正在努力地加载数据中,请稍候"
}, formatRecordsPerPage: function (t) {
return "每页显示 ".concat(t, " 条记录")
}, formatShowingRows: function (t, n, o, r) {
return void 0 !== r && r > 0 && r > o ? "显示第 ".concat(t, " 到第 ").concat(n, " 条记录,总共 ").concat(o, " 条记录(从 ").concat(r, " 总记录中过滤)") : "显示第 ".concat(t, " 到第 ").concat(n, " 条记录,总共 ").concat(o, " 条记录")
}, formatSRPaginationPreText: function () {
return "上一页"
}, formatSRPaginationPageText: function (t) {
return "第".concat(t, "页")
}, formatSRPaginationNextText: function () {
return "下一页"
}, formatDetailPagination: function (t) {
return "总共 ".concat(t, " 条记录")
}, formatClearSearch: function () {
return "清空查询条件"
}, formatSearch: function () {
return "搜索"
}, formatNoMatches: function () {
return "没有找到匹配的记录"
}, formatPaginationSwitch: function () {
return "隐藏/显示分页"
}, formatPaginationSwitchDown: function () {
return "显示分页"
}, formatPaginationSwitchUp: function () {
return "隐藏分页"
}, formatRefresh: function () {
return "刷新"
}, formatToggleOn: function () {
return "显示卡片视图"
}, formatToggleOff: function () {
return "隐藏卡片视图"
}, formatColumns: function () {
return "列"
}, formatColumnsToggleAll: function () {
return "切换所有"
}, formatFullscreen: function () {
return "全屏"
}, formatAllRows: function () {
return "所有"
}, formatAutoRefresh: function () {
return "自动刷新"
}, formatExport: function () {
return "导出数据"
}, formatJumpTo: function () {
return "跳转"
}, formatAdvancedSearch: function () {
return "高级搜索"
}, formatAdvancedCloseButton: function () {
return "关闭"
}, formatFilterControlSwitch: function () {
return "隐藏/显示过滤控制"
}, formatFilterControlSwitchHide: function () {
return "隐藏过滤控制"
}, formatFilterControlSwitchShow: function () {
return "显示过滤控制"
},formatMultipleSort: function formatMultipleSort() {
return '高级排序';
},
formatAddLevel: function formatAddLevel() {
return '添加排序条件';
},
formatDeleteLevel: function formatDeleteLevel() {
return '删除排序条件';
},
formatColumn: function formatColumn() {
return '列';
},
formatOrder: function formatOrder() {
return '顺序';
},
formatSortBy: function formatSortBy() {
return '优先';
},
formatThenBy: function formatThenBy() {
return '然后';
},
formatSort: function formatSort() {
return '排序';
},
formatCancel: function formatCancel() {
return '取消';
},
formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
return '检测到重复的排序规则!';
},
formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
return '请移除或修改重复的排序规则.';
},
formatSortOrders: function formatSortOrders() {
return {
asc: '升序',
desc: '降序'
};
}
}, Object.assign(o.fn.bootstrapTable.defaults, o.fn.bootstrapTable.locales["zh-CN"])
}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,160 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.string.includes.js'), require('jquery')) :
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.string.includes.js', 'jquery'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, global.jQuery));
})(this, (function (es_array_find_js, es_array_includes_js, es_object_toString_js, es_string_includes_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
* https://github.com/wenzhixin/bootstrap-table/
*/
$.fn.bootstrapTable.theme = 'bootstrap-table';
$.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() {
_get(_getPrototypeOf(_class.prototype), "init", this).call(this);
this.constants.classes.dropup = 'dropdown-menu-up';
$('.modal').on('click', '[data-close]', function (e) {
$(e.delegateTarget).removeClass('show');
});
}
}, {
key: "initConstants",
value: function initConstants() {
_get(_getPrototypeOf(_class.prototype), "initConstants", this).call(this);
this.constants.html.inputGroup = '<div class="input-group">%s%s</div>';
}
}, {
key: "initToolbar",
value: function initToolbar() {
_get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
this.handleToolbar();
}
}, {
key: "handleToolbar",
value: function handleToolbar() {
if (this.$toolbar.find('.dropdown-toggle').length) {
this._initDropdown();
}
}
}, {
key: "initPagination",
value: function initPagination() {
_get(_getPrototypeOf(_class.prototype), "initPagination", this).call(this);
if (this.options.pagination && this.paginationParts.includes('pageSize')) {
this._initDropdown();
}
}
}, {
key: "_initDropdown",
value: function _initDropdown() {
var $dropdownToggles = $('.dropdown-toggle');
$dropdownToggles.off('click').on('click', function (e) {
var $target = $(e.currentTarget);
if ($target.parents('.dropdown-toggle').length > 0) {
$target = $target.parents('.dropdown-toggle');
}
$target.next('.dropdown-menu').toggleClass('open');
});
$(window).off('click').on('click', function (e) {
var $dropdownToggles = $('.dropdown-toggle');
if ($(e.target).parents('.dropdown-toggle, .dropdown-menu').length === 0 && !$(e.target).hasClass('dropdown-toggle')) {
$dropdownToggles.next('.dropdown-menu').removeClass('open');
}
});
}
}]);
}($.BootstrapTable);
}));

Some files were not shown because too many files have changed in this diff Show More