Skip to content

Commit

Permalink
Merge branch 'develop' into feature/add
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin authored Mar 13, 2022
2 parents 92b7ace + e352146 commit 91c00bf
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- stage: test
language: node_js
node_js:
- 12
- 14
name: "Lint src and check docs"
cache:
npm: true
Expand All @@ -22,7 +22,7 @@ jobs:
- stage: test
language: node_js
node_js:
- 12
- 14
name: "Cypress Test"
cache:
npm: true
Expand All @@ -40,7 +40,7 @@ jobs:
rvm:
- 2.4.1
before_install:
- nvm install 12
- nvm install 14
script: ./deploy.sh
if: branch = master AND type = push
cache: bundler
Expand Down
2 changes: 1 addition & 1 deletion site/docs/api/column-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.

Escapes a string for insertion into HTML, replacing &, <, >, ", \`, and ' characters.

- **Default:** `false`
- **Default:** `undefined`

- **Example:** [Column Escape](https://examples.bootstrap-table.com/#column-options/escape.html)

Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,9 @@ class BootstrapTable {
}

this.header.fields.forEach((field, j) => {
const column = this.columns[j]
let text = ''
let value_ = Utils.getItemField(item, field, this.options.escape)
let value_ = Utils.getItemField(item, field, this.options.escape, column.escape)
let value = ''
let type = ''
let cellStyle = {}
Expand All @@ -1526,7 +1527,6 @@ class BootstrapTable {
let rowspan_ = ''
let colspan_ = ''
let title_ = ''
const column = this.columns[j]

if ((this.fromHtml || this.autoMergeCells) && typeof value_ === 'undefined') {
if ((!column.checkbox) && (!column.radio)) {
Expand Down Expand Up @@ -1795,7 +1795,7 @@ class BootstrapTable {
const fields = this.getVisibleFields()
const field = fields[index - Utils.getDetailViewIndexOffset(this.options)]
const column = this.columns[this.fieldsColumnsIndex[field]]
const value = Utils.getItemField(item, field, this.options.escape)
const value = Utils.getItemField(item, field, this.options.escape, column.escape)

if ($td.find('.detail-icon').length) {
return
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ const COLUMN_DEFAULTS = {
detailFormatter: undefined,
searchFormatter: true,
searchHighlightFormatter: false,
escape: false,
escape: undefined,
events: undefined
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
const inputSelector = `[name="${this.options.selectItemName}"]`
const $input = $el.find(inputSelector)

if (typeof index === undefined) {
if (typeof index === 'undefined') {
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/locale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Table bellow is sorted ascending by language code. If case of add new translatio
| Central Kurdish | ku-Arab | ku | missing |
| Central Kurdish (Iraq) | ku-Arab-IQ | | missing |
| Kyrgyz (Kyrgyzstan) | ky-KG | ky | missing |
| Luxembourgish (Luxembourg) | lb-LU | lb | missing |
| Luxembourgish (Luxembourg) | lb-LU | lb | |
| Lao (Lao P.D.R.) | lo-LA | lo | missing |
| Lithuanian (Lithuania) | lt-LT | lt | missing |
| Latvian (Latvia) | lv-LV | lv | missing |
Expand Down
5 changes: 3 additions & 2 deletions src/locale/bootstrap-table-fr-LU.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/**
* Bootstrap Table French (Luxembourg) translation
* Author: Nevets82 <[email protected]>
* Editor: David Morais Ferreira (https://github.com/DavidMoraisFerreira/)
*/

$.fn.bootstrapTable.locales['fr-LU'] = {
formatCopyRows () {
return 'Copy Rows'
return 'Copier les lignes'
},
formatPrint () {
return 'Print'
return 'Imprimer'
},
formatLoadingMessage () {
return 'Chargement en cours'
Expand Down
106 changes: 106 additions & 0 deletions src/locale/bootstrap-table-lb-LU.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/**
* Bootstrap Table Luxembourgish translation
* Author: David Morais Ferreira (https://github.com/DavidMoraisFerreira)
*/

$.fn.bootstrapTable.locales['lb-LU'] = $.fn.bootstrapTable.locales['lb'] = {
formatCopyRows () {
return 'Zeilen kopéieren'
},
formatPrint () {
return 'Drécken'
},
formatLoadingMessage () {
return 'Gëtt gelueden, gedellëgt Iech wannechgelift ee Moment'
},
formatRecordsPerPage (pageNumber) {
return `${pageNumber} Zeilen per Säit`
},
formatShowingRows (pageFrom, pageTo, totalRows, totalNotFiltered) {
if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
return `Weist Zeil ${pageFrom} bis ${pageTo} vun ${totalRows} Zeil${(totalRows > 1) ? 'en' : ''} (gefiltert vun insgesamt ${totalNotFiltered} Zeil${(totalRows > 1) ? 'en' : ''})`
}

return `Weist Zeil ${pageFrom} bis ${pageTo} vun ${totalRows} Zeil${(totalRows > 1) ? 'en' : ''}`
},
formatSRPaginationPreText () {
return 'viregt Säit'
},
formatSRPaginationPageText (page) {
return `op Säit ${page}`
},
formatSRPaginationNextText () {
return 'nächst Säit'
},
formatDetailPagination (totalRows) {
return `Weist ${totalRows} Zeilen`
},
formatClearSearch () {
return 'Sich réckgängeg maachen'
},
formatSearch () {
return 'Sich'
},
formatNoMatches () {
return 'Keng passend Anträg fonnt'
},
formatPaginationSwitch () {
return 'Paginatioun uweisen/verstoppen'
},
formatPaginationSwitchDown () {
return 'Paginatioun uweisen'
},
formatPaginationSwitchUp () {
return 'Paginatioun verstoppen'
},
formatRefresh () {
return 'Nei lueden'
},
formatToggle () {
return 'Ëmschalten'
},
formatToggleOn () {
return 'Kaartenusiicht uweisen'
},
formatToggleOff () {
return 'Kaartenusiicht verstoppen'
},
formatColumns () {
return 'Kolonnen'
},
formatColumnsToggleAll () {
return 'All ëmschalten'
},
formatFullscreen () {
return 'Vollbild'
},
formatAllRows () {
return 'All'
},
formatAutoRefresh () {
return 'Automatescht neilueden'
},
formatExport () {
return 'Daten exportéieren'
},
formatJumpTo () {
return 'Sprangen'
},
formatAdvancedSearch () {
return 'Erweidert Sich'
},
formatAdvancedCloseButton () {
return 'Zoumaachen'
},
formatFilterControlSwitch () {
return 'Schaltelementer uweisen/verstoppen'
},
formatFilterControlSwitchHide () {
return 'Schaltelementer verstoppen'
},
formatFilterControlSwitchShow () {
return 'Schaltelementer uweisen'
}
}

$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['lb-LU'])
7 changes: 6 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,14 @@ export default {
return dataAttr
},

getItemField (item, field, escape) {
getItemField (item, field, escape, columnEscape = undefined) {
let value = item

// use column escape if it is defined
if (typeof columnEscape !== 'undefined') {
escape = columnEscape
}

if (typeof field !== 'string' || item.hasOwnProperty(field)) {
return escape ? this.escapeHTML(item[field]) : item[field]
}
Expand Down

0 comments on commit 91c00bf

Please sign in to comment.