ソースを参照

Merge pull request #4408 from wenzhixin/feature/extensions

Feature/extensions
Dustin Utecht 6 年 前
コミット
6369ce25ae

+ 1 - 1
package.json

@@ -33,7 +33,7 @@
   },
   "scripts": {
     "lint:js": "eslint src",
-    "lint:css": "stylelint src/**/*.scss",
+    "lint:css": "stylelint src/**/*.scss && stylelint src/extensions/**/*.css",
     "lint": "run-s lint:*",
     "docs:check:api": "cd tools && node check-api.js",
     "docs:check:locale": "cd tools && node check-locale.js",

+ 11 - 11
src/extensions/cell-input/bootstrap-table-cell-input.css

@@ -1,12 +1,12 @@
-.table-cell-input {
-    display: block !important; 
-	padding: 5px !important; 
-	margin: 0 !important; 
-	border: 0 !important; 
-	width:100% !important;
-    box-sizing: border-box !important;
-    -moz-box-sizing: border-box !important;
-	border-radius: 0 !important; 
-	line-height: 1 !important;
-    white-space: nowrap;
+.table-cell-input {
+  display: block !important;
+  padding: 5px !important;
+  margin: 0 !important;
+  border: 0 !important;
+  width: 100% !important;
+  box-sizing: border-box !important;
+  -moz-box-sizing: border-box !important;
+  border-radius: 0 !important;
+  line-height: 1 !important;
+  white-space: nowrap;
 }

+ 1 - 1
src/extensions/cookie/bootstrap-table-cookie.js

@@ -329,7 +329,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
   onSearch (event) {
     super.onSearch(event)
 
-    if ($(event.currentTarget).parent().hasClass('search')) {
+    if (this.options.search) {
       UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText)
     }
     UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)

+ 1 - 1
src/extensions/export/bootstrap-table-export.js

@@ -84,7 +84,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
       return
     }
 
-    let $menu = $(this.constants.html.pageDropdown.join(''))
+    let $menu = $(this.constants.html.toolbarDropdown.join(''))
 
     this.$export = $(`
       <div class="export ${this.constants.classes.buttonsDropdown}">

+ 3 - 3
src/extensions/filter-control/bootstrap-table-filter-control.css

@@ -5,9 +5,9 @@
  */
 
 .no-filter-control {
-    height: 34px;
+  height: 34px;
 }
 
 .filter-control {
-    margin: 0 2px 2px 2px;
-}
+  margin: 0 2px 2px 2px;
+}

+ 2 - 6
src/extensions/group-by-v2/bootstrap-table-group-by.css

@@ -1,11 +1,7 @@
 .bootstrap-table .table > tbody > tr.groupBy {
-    cursor: pointer;
-}
-
-.bootstrap-table .table > tbody > tr.groupBy.expanded {
-
+  cursor: pointer;
 }
 
 .bootstrap-table .table > tbody > tr.hidden + tr.detail-view {
-    display: none;
+  display: none;
 }

+ 5 - 5
src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

@@ -135,16 +135,16 @@ BootstrapTable.prototype.makeRowsReorderable = function () {
         }
       }
 
-      for (let i = 0; i < this.length; i++ ) {
+      for (let i = 0; i < ths.length; i++ ) {
         columnIndex = that.fieldsColumnsIndex[ths[i]]
         if (columnIndex !== -1) {
+          that.fieldsColumnsIndex[ths[i]] = i
           that.columns[columnIndex].fieldIndex = i
           columns.push(that.columns[columnIndex])
-          that.columns.splice(columnIndex, 1)
         }
       }
 
-      that.columns = that.columns.concat(columns)
+      that.columns = columns
 
       filterFn() // Support <IE9
       $.each(that.columns, (i, column) => {
@@ -155,7 +155,8 @@ BootstrapTable.prototype.makeRowsReorderable = function () {
             optionsColumns.push(item)
             found = true
             return false
-          } return true
+          }
+          return true
         })
       })
 
@@ -164,7 +165,6 @@ BootstrapTable.prototype.makeRowsReorderable = function () {
       that.header.fields = ths
       that.header.formatters = formatters
       that.initHeader()
-      that.initToolbar()
       that.initBody()
       that.resetView()
       that.trigger('reorder-column', ths)

+ 10 - 10
src/extensions/reorder-rows/bootstrap-table-reorder-rows.css

@@ -1,14 +1,14 @@
 .reorder_rows_onDragClass td {
-    background-color: #eee;
-    -webkit-box-shadow: 11px 5px 12px 2px #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
-    -webkit-box-shadow: 6px 3px 5px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
-    -moz-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;
+  background-color: #eee;
+  -webkit-box-shadow: 11px 5px 12px 2px #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
+  -webkit-box-shadow: 6px 3px 5px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
+  -moz-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_onDragClass td:last-child {
-    -webkit-box-shadow: 8px 7px 12px 0 #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
-    -webkit-box-shadow: 1px 8px 6px -4px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
-    -moz-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;
-}
+  -webkit-box-shadow: 8px 7px 12px 0 #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
+  -webkit-box-shadow: 1px 8px 6px -4px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset;
+  -moz-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;
+}

+ 1 - 1
src/extensions/sticky-header/bootstrap-table-sticky-header.css

@@ -17,6 +17,6 @@
   background: #e9ecef;
 }
 
-.fix-sticky table thead.thead-light {
+.fix-sticky table thead.thead-dark {
   background: #212529;
 }

+ 1 - 1
src/extensions/toolbar/bootstrap-table-toolbar.js

@@ -85,7 +85,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
       return
     }
 
-    this.$toolbar.find('>.btn-group').append(`
+    this.$toolbar.find('>.columns').append(`
       <button class="btn btn-default${Utils.sprintf(' btn-%s', o.buttonsClass)}${Utils.sprintf(' btn-%s', o.iconSize)}"
         type="button"
         name="advancedSearch"