ソースを参照

Merge pull request #6955 from wenzhixin/feature/add-cspell

Add scpell to check the words
飞鱼 2 年 前
コミット
1bc5c18f71

+ 57 - 0
.cspell-words.txt

@@ -0,0 +1,57 @@
+addrbar
+akottr
+bootcss
+borderless
+bowser
+browserslistrc
+bulma
+clearfix
+colspan
+csses
+datepicker
+dblclick
+djhvscf
+dragaccept
+dragtable
+dropup
+edubirdie
+emptytext
+endfor
+falign
+fullscreen
+glyphicon
+gmdfsp
+halign
+hoverable
+icomoon
+jsdelivr
+keyup
+labelledby
+lsaquo
+mouseleave
+multipleselect
+neutralise
+noedit
+opencollective
+reinit
+reinitialization
+reorderable
+rowspan
+rsaquo
+scrollbars
+searchable
+searchables
+sprintf
+stylelint
+tablednd
+tableexport
+treegrid
+uniqueid
+unported
+unstackable
+utecht
+valign
+vuejs
+wenzhixin
+xmlhttp
+zhixin

+ 4 - 4
CHANGELOG.md

@@ -48,7 +48,7 @@ ChangeLog
 #### Core
 
 - **New:** Added `escapeTitle` table option.
-- **New:** Added Aria Label to the search input for screenreaders.
+- **New:** Added Aria Label to the search input for screen readers.
 - **New:** Persist data attributes for the header(`th`).
 - **Update:** Fixed wrong condition for searching with server-side pagination.
 - **Update:** Fixed overwriting the `filterOptions` after rebuild.
@@ -106,8 +106,8 @@ ChangeLog
 - **Update:** Fixed detail view with filter click error.
 - **Update:** Fixed header does not center correctly for the sortable column.
 - **Update:** Fixed `regexpCompare` bug when filtering columns.
-- **Update:** Fixed `showToogle` title display error.
-- **Update:** Fixed `remove` and `removeByUnqiueId` using object param bug.
+- **Update:** Fixed `showToggle` title display error.
+- **Update:** Fixed `remove` and `removeByUniqueId` using object param bug.
 - **Update:** Fixed `searchHighlight` bug while using `searchAccentNeutralise`.
 - **Update:** Fixed missing sort for `customSearch` option.
 - **Update:** Removed duplicated escaping of the column value.
@@ -958,7 +958,7 @@ ChangeLog
 - [bug] Fix #936 Sort carets should not be inline-styled by JS.
 - [bug] Fix table header width bug when setting table to no bordered.
 - [bug] Fix #938, fix #940: Multiple Sort and Hide/Show column.
-- [bug] Fix #970: `click`and `dblclick` bug on no-rows table.
+- [bug] Fix #970: `click` and `dblclick` bug on no-rows table.
 - [bug] Fix #967: unselected column while column sorted display error.
 - [enh] Support title feature in cells.
 - [enh] Improved cookie, mobile extension.

+ 27 - 1
package.json

@@ -22,6 +22,7 @@
     "clean-css-cli": "^5.6.2",
     "core-js": "^3.29.0",
     "cross-env": "^7.0.3",
+    "cspell": "^7.3.2",
     "cypress": "^13.1.0",
     "eslint": "^8.35.0",
     "esm": "^3.2.25",
@@ -42,6 +43,7 @@
   "scripts": {
     "lint:js": "eslint src",
     "lint:css": "stylelint src/**/*.scss",
+    "lint:spell": "cspell lint --no-progress 'src/**/*.{js,json,vue,scss}' '**/*.md'",
     "lint": "run-s lint:*",
     "test": "cypress run --headless",
     "docs:check:api": "cd tools && node check-api.js",
@@ -92,5 +94,29 @@
     "url": "https://github.com/wenzhixin/bootstrap-table/issues"
   },
   "homepage": "https://bootstrap-table.com",
-  "types": "./index.d.ts"
+  "types": "./index.d.ts",
+  "cspell": {
+    "dictionaries": [
+      "cspell-words"
+    ],
+    "dictionaryDefinitions": [
+      {
+        "name": "cspell-words",
+        "path": "./.cspell-words.txt",
+        "addWords": true
+      }
+    ],
+    "ignoreRegExpList": [
+      "/.*data:image/png;base64.*/g",
+      "/ * @author.*/g",
+      "/ * @update.*/g",
+      "/ +\"name\": \".*\",/"
+    ],
+    "ignorePaths": [
+      "src/locale/**",
+      "site/_themes/node_modules/**",
+      "tools/**",
+      "DONATORS.md"
+    ]
+  }
 }

+ 3 - 3
site/docs/api/events.md

@@ -12,7 +12,7 @@ Events can be bound in two ways:
 
 Binding via the options object:
 {% highlight html %}
-// Here, you can expect to have as the last parameter the boostrap-table object
+// Here, you can expect to have as the last parameter the bootstrap-table object
 
 $('#table').bootstrapTable({
   onEventName: function (arg1, arg2, ...) {
@@ -23,7 +23,7 @@ $('#table').bootstrapTable({
 
 Binding via the jquery event handler:
 {% highlight html %}
-// Here, you can expect to have in the 'e' variable the sender property, which is the boostrap-table object
+// Here, you can expect to have in the 'e' variable the sender property, which is the bootstrap-table object
 
 $('#table').on('event-name.bs.table', function (e, arg1, arg2, ...) {
   // ...
@@ -147,7 +147,7 @@ $('#table').on('event-name.bs.table', function (e, arg1, arg2, ...) {
 
 - **Detail:**
 
-  It fires when toogle all columns. The parameters contain:
+  It fires when toggle all columns. The parameters contain:
 
   * `checked`: the checked state of the column.
 

+ 1 - 1
site/docs/api/localizations.md

@@ -45,7 +45,7 @@ $('#table').bootstrapTable({
 })
 {% endhighlight %}
 
-List of all existing translations with their shortcodes is on [Github](https://github.com/wenzhixin/bootstrap-table/tree/develop/src/locale)
+List of all existing translations with their short codes is on [Github](https://github.com/wenzhixin/bootstrap-table/tree/develop/src/locale)
 
 You can custom the format localizations, the calling syntax:
 

+ 7 - 7
site/docs/api/table-options.md

@@ -74,14 +74,14 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
     - Description: This option is used for the [showButtonIcons](https://bootstrap-table.com/docs/api/table-options/#showbuttonicons) table option.
     - Type: `String` - Only needs the icon class e.g. `fa-users`
   - `render`
-    - Description: Set this option to `false` to hide the button by default, the button is visible again when you add the data attribute `data-show-BUTTONNAME="true"`.
+    - Description: Set this option to `false` to hide the button by default, the button is visible again when you add the data attribute `data-show-button-name="true"`.
   - `attributes`
     - Description: This option allows adding additional html attributes e.g. `title`
     - Type: `Object`
     - Example: `{title: 'Button title'}`
   - `html`
     - Description: If you don't want to autogenerate the html, you can use this option to insert your custom html.
-      The `event` option only works if you custom HTML contains `name="BUTTONNAME"`.
+      The `event` option only works if you custom HTML contains `name="button-name"`.
       If this option is used the following options will be ignored:
       - `text`
       - `icon`
@@ -552,7 +552,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 - **Detail:**
 
   Defines the key of the footer Object (From data array or server response JSON).
-  The footer Object can be used to set/define footer colspans and/or the value of the footer.
+  The footer Object can be used to set/define footer colspan and/or the value of the footer.
   Only triggered when `data-pagination` is `true` and `data-side-pagination` is `server`.
 
 
@@ -709,7 +709,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Detail:**
 
-  Indicate which field will be used as checkbox/radiobox value, its the counterpart to [selectItemName](https://bootstrap-table.com/docs/api/table-options/#selectitemname).
+  Indicate which field will be used as checkbox/radio value, its the counterpart to [selectItemName](https://bootstrap-table.com/docs/api/table-options/#selectitemname).
 
 - **Default:** `undefined`
 
@@ -785,7 +785,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
   Allows for fallback locales, if loaded, in the following order:
 
   * First tries for the locale as specified,
-  * Then tries the locale with '_' translated to '-' and the region code uppercased,
+  * Then tries the locale with '_' translated to '-' and the region code upper cased,
   * Then tries the short locale code (i.e. `'zh'` instead of `'zh-CN'`),
   * And finally will use the last locale file loaded (or the default locale if no locales loaded).
 
@@ -1560,7 +1560,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
   **URL parameters:**
 
   When `sidePagination` is set to `server`, the bootstrap table will make calls to the `url` with the following URL parameters:
-  
+
   - `offset` with a value between 0 and `total` - 1, indicating the first record to include.
   - `limit` with a value indicating the number of rows per page.
 
@@ -1894,7 +1894,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
   **URL parameters:**
 
   When `sidePagination` is set to `server`, the bootstrap table will make calls to the `url` with the following URL parameters:
-  
+
   - `offset` with a value between 0 and `total` - 1, indicating the first record to include.
   - `limit` with a value indicating the number of rows per page.
 

+ 2 - 2
site/docs/extensions/filter-control.md

@@ -88,8 +88,8 @@ toc: true
 
 - **Detail:**
 
-  Set to `true` to allow searching multiple values at once.   
-  The values will be splitted by a delimiter, see option `filterControlMultipleSearchDelimiter`.
+  Set to `true` to allow searching multiple values at once.
+  The values will be split by a delimiter, see option `filterControlMultipleSearchDelimiter`.
 
 - **Default:** `false`
 

+ 1 - 1
site/docs/getting-started/introduction.md

@@ -10,7 +10,7 @@ redirect_from:
 toc: true
 ---
 
-## Quickstart
+## Quick Start
 
 Looking to quickly add Bootstrap Table to your <a href="https://getbootstrap.com/" target="_blank">Bootstrap v5</a> project? Use CDN, provided for free by the folks at UNPKG. Using a package manager or need to download the source files? [Head to the downloads page]({{ site.baseurl }}/docs/getting-started/download/).
 

+ 17 - 17
site/news.md

@@ -52,7 +52,7 @@ description: News and announcements for all things Bootstrap Table, including ne
 #### Core
 
 - **New:** Added `escapeTitle` table option.
-- **New:** Added Aria Label to the search input for screenreaders.
+- **New:** Added Aria Label to the search input for screen readers.
 - **New:** Persist data attributes for the header(`th`).
 - **Update:** Fixed wrong condition for searching with server-side pagination.
 - **Update:** Fixed overwriting the `filterOptions` after rebuild.
@@ -116,8 +116,8 @@ description: News and announcements for all things Bootstrap Table, including ne
 - **Update:** Fixed detail view with filter click error.
 - **Update:** Fixed header does not center correctly for the sortable column.
 - **Update:** Fixed `regexpCompare` bug when filtering columns.
-- **Update:** Fixed `showToogle` title display error.
-- **Update:** Fixed `remove` and `removeByUnqiueId` using object param bug.
+- **Update:** Fixed `showToggle` title display error.
+- **Update:** Fixed `remove` and `removeByUniqueId` using object param bug.
 - **Update:** Fixed `searchHighlight` bug while using `searchAccentNeutralise`.
 - **Update:** Fixed missing sort for `customSearch` option.
 - **Update:** Removed duplicated escaping of the column value.
@@ -698,7 +698,7 @@ description: News and announcements for all things Bootstrap Table, including ne
 - **Update(js):** Fixed `detailView` find td elements bug.
 - **Update(js):** Fixed `showColumns` close dropdown bug when item label clicking.
 - **Update(js):** Fixed reset width error after `toggleFullscreen`.
-- **Update(js):** Fixed `cardview` click event bug.
+- **Update(js):** Fixed `cardView` click event bug.
 
 ## Bootstrap Table 1.13.5
 
@@ -733,9 +733,9 @@ description: News and announcements for all things Bootstrap Table, including ne
 <span class="post-date">28 Jan 2019</span>
 
 - **New(js):** Supported full table classes of bootstrap v4.
-- **New(css):** Rewrited bootstrap-table.css to scss.
-- **New(accent-neutralise extension):** Rewrited accent-neutralise extension to ES6.
-- **New(addrbar extension):** Rewrited addrbar extension to ES6 and supported attribute option.
+- **New(css):** Updated bootstrap-table.css to scss.
+- **New(accent-neutralise extension):** Updated accent-neutralise extension to ES6.
+- **New(addrbar extension):** Updated addrbar extension to ES6 and supported attribute option.
 - **New(group-by-v2 extension):** New `groupByFormatter` option.
 - **New(pipeline extension):** New pipeline extension `bootstrap-table-pipeline`.
 - **Remove(js):** Removed `striped` option and use classes instead.
@@ -751,7 +751,7 @@ description: News and announcements for all things Bootstrap Table, including ne
 <span class="post-date">18 Jan 2019</span>
 
 - **New(js):** Added `paginationSuccessivelySize`, `paginationPagesBySide` and `paginationUseIntermediate` pagination options.
-- **New(cookie extension):** Rewrited cookie extension to ES6.
+- **New(cookie extension):** Updated cookie extension to ES6.
 - **New(cookie extension):** Saved `filterBy` method.
 - **New(filter-control extension):** Added `placeholder` as a empty option to the select controls.
 - **New(filter-control extension):** Added `clearFilterControl` method in order to clear all filter controls.
@@ -786,11 +786,11 @@ Here are the highlights of what’s new and updated in new website.
 
 <span class="post-date">01 Jan 2019</span>
 
-- **New(js):** Added `theadClasses` option to supoort bootstrap v4.
+- **New(js):** Added `theadClasses` option to support bootstrap v4.
 - **New(js):** Updated the default icons to font-awesome 5.
-- **New(locale):** Rewrited all locales to ES6.
-- **New(editable extension):** Rewrited `bootstrap-table-editable` to ES6.
-- **New(filter-control extension):** Rewrited `bootstrap-table-filter-control` to ES6.
+- **New(locale):** Updated all locales to ES6.
+- **New(editable extension):** Updated `bootstrap-table-editable` to ES6.
+- **New(filter-control extension):** Updated `bootstrap-table-filter-control` to ES6.
 - **New(treegrid extension):** Added `rootParentId` option.
 - **Update(js):** Fixed `getHiddenRows` method bug.
 - **Update(js):** Fixed `getOptions` method to remove data property.
@@ -806,14 +806,14 @@ Here are the highlights of what’s new and updated in new website.
 
 <span class="post-date">27 Dec 2019</span>
 
-- **New(js):** Rewrited bootstrap-table to ES6.
+- **New(js):** Updated bootstrap-table to ES6.
 - **New(locale):** Added `fi-FI.js` locale.
 - **New(build):** Used babel instead of grunt.
 - **New(filter-control):** Added `created-controls.bs.table` event to filter-control.
-- **New(export extension):** Rewrited export extension to ES6.
+- **New(export extension):** Updated export extension to ES6.
 - **New(export extension):** Added export extension support bootstrap v4.
 - **New(export extension):** Added `exportTable` method.
-- **New(toolbar extension):** Rewrited toolbar extension to ES6.
+- **New(toolbar extension):** Updated toolbar extension to ES6.
 - **New(toolbar extension):** Added toolbar extension supports bootstrap v4.
 - **New(toolbar extension):** Added server sidePagination support
 - **New(resizable extension):** Released new resizable extension version 2.0.0.
@@ -825,9 +825,9 @@ Here are the highlights of what’s new and updated in new website.
 - **Update(js):** Added `customSearch` support data attribute.
 - **Update(js):** Fixed can't search data with formatter.
 - **Update(js):** Fixed `getRowByUniqueId` error when row unique id is undefined.
-- **Update(js):** Fxied older bootstrap version bug.
+- **Update(js):** Fixed older bootstrap version bug.
 - **Update(css):** Removed toolbar line-height.
-- **Update(css):** Limitted fullscreen CSS rule scope.
+- **Update(css):** Limited fullscreen CSS rule scope.
 - **Update(editable extension):** Fixed editable formatter bug.
 - **Update(extension):** Fixed bug with export extension together.
 - **Update(extension):** Removed click-edit-row and flat-json extensions.

+ 0 - 1
src/bootstrap-table.js

@@ -1403,7 +1403,6 @@ class BootstrapTable {
       if (allSelected) {
         opts.pageSize = opts.formatAllRows()
       }
-      // removed the events for last and first, onPageNumber executeds the same logic
       $pageList.off('click').on('click', e => this.onPageListChange(e))
       $pre.off('click').on('click', e => this.onPagePre(e))
       $next.off('click').on('click', e => this.onPageNext(e))

+ 4 - 4
src/extensions/addrbar/bootstrap-table-addrbar.js

@@ -29,10 +29,10 @@ function _GET (key, url = window.location.search) {
 
 /*
  * function: 根据给定参数生成url地址
- * var dic = {name: 'genreal', age: 24}
+ * var dic = {name: 'general', age: 24}
  * var url = 'https://www.baidu.com?age=22';
  * _buildUrl(dic, url);
- * 将得到"https://www.baidu.com?age=24&name=genreal"
+ * 将得到"https://www.baidu.com?age=24&name=general"
  * 哦, 忽略先后顺序吧...
  *
  * 补充: 可以参考浏览器URLSearchParams对象, 更加方便和强大.
@@ -57,9 +57,9 @@ function _buildUrl (dict, url = window.location.search) {
 
       url = url.replace(tmp, targetStr)
     } else {
-      const seperator = url.match('[?]') ? '&' : '?'
+      const separator = url.match('[?]') ? '&' : '?'
 
-      url = url + seperator + targetStr
+      url = url + separator + targetStr
     }
   }
   if (location.hash) {

+ 1 - 2
src/extensions/multiple-sort/bootstrap-table-multiple-sort.js

@@ -1,8 +1,7 @@
 /**
  * @author Nadim Basalamah <dimbslmh@gmail.com>
  * @version: v1.1.0
- * https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
- * Modification: ErwannNevou <https://github.com/ErwannNevou>
+ * @update: ErwannNevou <https://github.com/ErwannNevou>
  */
 
 let isSingleSort = false

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

@@ -209,7 +209,7 @@ BootstrapTable.prototype.initServer = function (silent, query, url) {
           // 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 requery for preceding or succeeding cache window
+          //  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

+ 3 - 3
src/extensions/print/bootstrap-table-print.js

@@ -165,7 +165,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
       html.push('</thead><tbody>')
 
-      const dontRender = []
+      const notRender = []
 
       if (this.mergedCells) {
         for (let mc = 0; mc < this.mergedCells.length; mc++) {
@@ -177,7 +177,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
             for (let cs = 0; cs < currentMergedCell.colspan; cs++) {
               const col = currentMergedCell.col + cs
 
-              dontRender.push(`${row},${col}`)
+              notRender.push(`${row},${col}`)
             }
           }
         }
@@ -212,7 +212,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
           if (
             !columns[j].printIgnore && columns[j].visible && columns[j].field &&
               (
-                !dontRender.includes(`${i},${j}`) ||
+                !notRender.includes(`${i},${j}`) ||
                 rowspan > 0 && colspan > 0
               )
           ) {

+ 2 - 4
src/extensions/sticky-header/bootstrap-table-sticky-header.js

@@ -108,10 +108,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
     if (top > start && top <= end) {
       // ensure clone and source column widths are the same
       this.$stickyHeader.find('tr').each((indexRows, rows) => {
-        const columns = $(rows).find('th')
-
-        columns.each((indexColumns, celd) => {
-          $(celd).css('min-width', this.$header.find(`tr:eq(${indexRows})`).find(`th:eq(${indexColumns})`).css('width'))
+        $(rows).find('th').each((index, el) => {
+          $(el).css('min-width', this.$header.find(`tr:eq(${indexRows})`).find(`th:eq(${index})`).css('width'))
         })
       })
       // match bootstrap table style

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

@@ -364,7 +364,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
     this.data = fp ? this.data.filter((item, i) => {
       for (const [key, v] of Object.entries(fp)) {
-        const fval = v.toLowerCase()
+        const val = v.toLowerCase()
         let value = item[key]
         const index = this.header.fields.indexOf(key)
 
@@ -374,7 +374,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
         if (
           !(index !== -1 &&
           (typeof value === 'string' || typeof value === 'number') &&
-          `${value}`.toLowerCase().includes(fval))
+          `${value}`.toLowerCase().includes(val))
         ) {
           return false
         }

+ 4 - 4
src/utils/index.js

@@ -518,8 +518,8 @@ export default {
 
       $el.find('>td,>th').each((_x, el) => {
         const $el = $(el)
-        const cspan = +$el.attr('colspan') || 1
-        const rspan = +$el.attr('rowspan') || 1
+        const colspan = +$el.attr('colspan') || 1
+        const rowspan = +$el.attr('rowspan') || 1
         let x = _x
 
         // skip already occupied cells in current row
@@ -528,8 +528,8 @@ export default {
         }
 
         // mark matrix elements occupied by current cell with true
-        for (let tx = x; tx < x + cspan; tx++) {
-          for (let ty = y; ty < y + rspan; ty++) {
+        for (let tx = x; tx < x + colspan; tx++) {
+          for (let ty = y; ty < y + rowspan; ty++) {
             if (!m[ty]) { // fill missing rows
               m[ty] = []
             }

ファイルの差分が大きいため隠しています
+ 701 - 5
yarn.lock