Browse Source

Merge branch 'develop' into feature/multiselect-filtercontrol

Dennis Hernández 4 years ago
parent
commit
21d62c9f8f

+ 1 - 1
package.json

@@ -10,7 +10,7 @@
     "@babel/core": "^7.4.5",
     "@babel/preset-env": "^7.4.5",
     "chalk": "^4.0.0",
-    "clean-css-cli": "^4.3.0",
+    "clean-css-cli": "^5.0.1",
     "core-js": "^3.1.4",
     "cross-env": "^7.0.2",
     "eslint": "^7.0.0",

+ 5 - 5
site/docs/extensions/sticky-header.md

@@ -37,11 +37,11 @@ This is an extension which provides a sticky header for the table when scrolling
 
 - **attribute:** `data-sticky-header-offset-left`
 
-- **type:** `Number | String`
+- **type:** `Number`
 
 - **Detail:**
 
-   Set the left offset of the sticky header container.
+   Set the left offset of the sticky header container. If the body padding left is `60px`, this value would be `60`.
 
 - **Default:** `0`
 
@@ -49,11 +49,11 @@ This is an extension which provides a sticky header for the table when scrolling
 
 - **attribute:** `data-sticky-header-offset-right`
 
-- **type:** `Number | String`
+- **type:** `Number`
 
 - **Detail:**
 
-   Set the right offset of the sticky header container.
+   Set the right offset of the sticky header container. If the body padding right is `60px`, this value would be `60`.
 
 - **Default:** `0`
 
@@ -65,6 +65,6 @@ This is an extension which provides a sticky header for the table when scrolling
 
 - **Detail:**
 
-   Set the Y offset from the top of the window to pin the sticky header. If there is a fixed navigation bar with a height of 60px, this value would be `60`.
+   Set the Y offset from the top of the window to pin the sticky header. If there is a fixed navigation bar with a height of `60px`, this value would be `60`.
 
 - **Default:** `0`

+ 5 - 1
src/bootstrap-table.js

@@ -956,9 +956,13 @@ class BootstrapTable {
         return
       }
 
-      const s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
+      let s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
       const f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns
 
+      if (this.options.searchAccentNeutralise) {
+        s = Utils.normalizeAccent(s)
+      }
+
       // Check filter
       if (typeof this.filterOptions.filterAlgorithm === 'function') {
         this.data = this.options.data.filter(item => this.filterOptions.filterAlgorithm.apply(null, [item, f]))

+ 15 - 3
src/extensions/sticky-header/bootstrap-table-sticky-header.js

@@ -56,6 +56,18 @@ $.BootstrapTable = class extends $.BootstrapTable {
       .on('scroll', () => this.renderStickyHeader())
   }
 
+  getCaret (...args) {
+    super.getCaret(...args)
+
+    if (this.$stickyHeader) {
+      const $ths = this.$stickyHeader.find('th')
+
+      this.$header.find('th').each((i, th) => {
+        $ths.eq(i).find('.sortable').attr('class', $(th).find('.sortable').attr('class'))
+      })
+    }
+  }
+
   horizontalScroll () {
     super.horizontalScroll()
     this.$tableBody.on('scroll', () => this.matchPositionX())
@@ -108,9 +120,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
         stickyHeaderOffsetLeft = 0
         stickyHeaderOffsetRight = 0
       }
-      this.$stickyContainer.css('top', `${this.options.stickyHeaderOffsetY}`)
-      this.$stickyContainer.css('left', `${stickyHeaderOffsetLeft}`)
-      this.$stickyContainer.css('right', `${stickyHeaderOffsetRight}`)
+      this.$stickyContainer.css('top', `${this.options.stickyHeaderOffsetY}px`)
+      this.$stickyContainer.css('left', `${stickyHeaderOffsetLeft}px`)
+      this.$stickyContainer.css('right', `${stickyHeaderOffsetRight}px`)
       // create scrollable container for header
       this.$stickyTable = $('<table/>')
       this.$stickyTable.addClass(this.options.classes)