Skip to content

Commit

Permalink
Merge pull request #4547 from wenzhixin/develop
Browse files Browse the repository at this point in the history
v1.15.4
  • Loading branch information
wenzhixin authored Aug 12, 2019
2 parents 8a260f6 + 84a7d4e commit 4e61543
Show file tree
Hide file tree
Showing 126 changed files with 296 additions and 191 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
ChangeLog
---------

### 1.15.4

- **New:** Added `query` to `queryParams` option.
- **New:** Added `filter` parameter of `customSearch` option.
- **Update:** Fixed search bug in hidden columns.
- **Update:** Fixed table zoom width calculating bug.
- **Update:** Fixed events of column formatted by nested table.
- **Update:** Fixed checkbox style display bug.
- **Update:** Fixed stack overflow error of `checkBy` method.
- **Update:** Fixed `showSearchButton` and `showSearchClearButton` style bug.
- **Update:** Fixed filter-control select `null` value handle error.
- **Update:** Fixed `showSearchClearButton` bug in filter-control extension.
- **Update:** Fixed `print` button appears twice bug.

### 1.15.3

- **New:** Added nl-BE, fr-CH and fr-LU locale.
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ algolia:
index_name: bootstrap-table

# Custom variables
current_version: 1.15.3
current_version: 1.15.4
title: "Bootstrap Table"
description: "An extended table to the integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)"
authors: "Zhixin Wen, and Bootstrap Table contributors"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-table.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-table",
"version": "1.15.3",
"version": "1.15.4",
"title": "Bootstrap Table",
"description": "An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-table-locale-all.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/bootstrap-table-vue.esm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/bootstrap-table-vue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/bootstrap-table.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 37 additions & 28 deletions dist/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}

var VERSION = '1.15.3';
var VERSION = '1.15.4';
var bootstrapVersion = 4;

try {
Expand Down Expand Up @@ -2689,8 +2689,8 @@
icon: '<i class="%s %s"></i>',
inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
searchInput: '<input class="%s%s" type="text" placeholder="%s">',
searchButton: '<button class="btn btn-default" type="button" name="search" title="%s">%s %s</button>',
searchClearButton: '<button class="btn btn-default" type="button" name="clearSearch" title="%s">%s %s</button>'
searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
}
},
4: {
Expand Down Expand Up @@ -2734,8 +2734,8 @@
icon: '<i class="%s %s"></i>',
inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
searchInput: '<input class="%s%s" type="text" placeholder="%s">',
searchButton: '<button class="btn btn-secondary" type="button" name="search" title="%s">%s %s</button>',
searchClearButton: '<button class="btn btn-secondary" type="button" name="clearSearch" title="%s">%s %s</button>'
searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
}
}
}[bootstrapVersion];
Expand Down Expand Up @@ -4005,10 +4005,6 @@
}

columns.forEach(function (column, j) {
if (!column.visible) {
return;
}

var class_ = Utils.sprintf(' class="%s"', column['class']);
var unitWidth = column.widthUnit;
var width = parseFloat(column.width);
Expand All @@ -4017,6 +4013,10 @@
var style = Utils.sprintf('vertical-align: %s; ', column.valign);
style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);

if (typeof column.fieldIndex === 'undefined' && !column.visible) {
return;
}

if (typeof column.fieldIndex !== 'undefined') {
_this2.header.fields[column.fieldIndex] = column.field;
_this2.header.styles[column.fieldIndex] = align + style;
Expand All @@ -4029,6 +4029,10 @@
_this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
_this2.header.searchables[column.fieldIndex] = column.searchable;

if (!column.visible) {
return;
}

if (_this2.options.cardView && !column.cardVisible) {
return;
}
Expand Down Expand Up @@ -4364,17 +4368,19 @@

_this4._toggleAllColumns($(currentTarget).prop('checked'));
});
}
} // Fix #4516: this.showSearchClearButton is for extensions


if (o.search) {
if (o.search || this.showSearchClearButton) {
html = [];
var showSearchButton = Utils.sprintf(this.constants.html.searchButton, o.formatSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.search) : '', o.showButtonText ? o.formatSearch() : '');
var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, o.formatClearSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.clearSearch) : '', o.showButtonText ? o.formatClearSearch() : '');
var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, o.formatSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.search) : '', o.showButtonText ? o.formatSearch() : '');
var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, o.formatClearSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.clearSearch) : '', o.showButtonText ? o.formatClearSearch() : '');
var searchInputHtml = "<input class=\"".concat(this.constants.classes.input).concat(Utils.sprintf(' input-%s', o.iconSize), " search-input\" type=\"text\" placeholder=\"").concat(o.formatSearch(), "\">");
var searchInputFinalHtml = searchInputHtml;

if (o.showSearchButton || o.showSearchClearButton) {
searchInputFinalHtml = Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, (o.showSearchButton ? showSearchButton : '') + (o.showSearchClearButton ? showSearchClearButton : ''));
var buttonsHtml = (o.showSearchButton ? showSearchButton : '') + (o.showSearchClearButton ? showSearchClearButton : '');
searchInputFinalHtml = o.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, buttonsHtml) : buttonsHtml;
}

html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(o.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
Expand Down Expand Up @@ -4403,10 +4409,6 @@
if (o.showSearchClearButton) {
this.$toolbar.find('.search button[name=clearSearch]').click(function () {
_this4.resetSearch();

_this4.onSearch({
currentTarget: _this4.$toolbar.find('.search input')
});
});
}
}
Expand All @@ -4420,7 +4422,7 @@

var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

if (currentTarget !== undefined && overwriteSearchText) {
if (currentTarget !== undefined && $(currentTarget).length && overwriteSearchText) {
var text = $(currentTarget).val().trim();

if (this.options.trimOnSearch && $(currentTarget).val() !== text) {
Expand Down Expand Up @@ -4462,7 +4464,7 @@

if (this.options.sidePagination !== 'server') {
if (this.options.customSearch) {
this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText]);
this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
return;
}

Expand Down Expand Up @@ -5270,7 +5272,7 @@

_this8.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
var $tr = $(tr);
var $td = $tr.find(_this8.options.cardView ? '.card-view' : 'td').eq(fieldIndex);
var $td = $tr.find(_this8.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
var index = key.indexOf(' ');
var name = key.substring(0, index);
var el = key.substring(index + 1);
Expand Down Expand Up @@ -5346,8 +5348,8 @@
params.filter = JSON.stringify(this.filterColumnsPartial, null);
}

data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
$.extend(data, query || {}); // false to stop request
$.extend(params, query || {});
data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data); // false to stop request

if (data === false) {
return;
Expand Down Expand Up @@ -5574,7 +5576,7 @@
if (i === 0) {
var $thDetail = $ths.filter('.detail');

var _zoomWidth = $thDetail.width() - $thDetail.find('.fht-cell').width();
var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();

$thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
}
Expand All @@ -5592,7 +5594,7 @@
$th = $($ths[$this[0].cellIndex]);
}

var zoomWidth = $th.width() - $th.find('.fht-cell').width();
var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
$th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
});
this.horizontalScroll();
Expand Down Expand Up @@ -5709,7 +5711,7 @@
if (i === 0) {
var $thDetail = $ths.filter('.detail');

var _zoomWidth2 = $thDetail.width() - $thDetail.find('.fht-cell').width();
var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();

$thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
}
Expand All @@ -5722,7 +5724,7 @@
}

var $th = $ths.eq(i);
var zoomWidth = $th.width() - $th.find('.fht-cell').width();
var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
$th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
});
this.horizontalScroll();
Expand Down Expand Up @@ -6520,8 +6522,15 @@
}

if (obj.values.includes(row[obj.field])) {
var $el = _this22.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i)).prop('checked', checked);
var $el = _this22.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));

$el = checked ? $el.not(':checked') : $el.filter(':checked');

if (!$el.length) {
return;
}

$el.prop('checked', checked);
row[_this22.header.stateField] = checked;
rows.push(row);

Expand Down
Loading

0 comments on commit 4e61543

Please sign in to comment.