-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Co-authored-by: Faris Ansari <netchamp.faris@gmail.com>
- Loading branch information
1 parent
8ceadac
commit 6d6602f
Showing
12 changed files
with
222 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,73 @@ | ||
import filterRows from './filterRows'; | ||
import icons from './icons'; | ||
|
||
export default { | ||
columns: [], | ||
data: [], | ||
dropdownButton: icons.chevronDown, | ||
headerDropdown: [ | ||
{ | ||
label: 'Sort Ascending', | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'asc'); | ||
export default function getDefaultOptions(instance) { | ||
return { | ||
columns: [], | ||
data: [], | ||
dropdownButton: icons.chevronDown, | ||
headerDropdown: [ | ||
{ | ||
label: instance.translate('Sort Ascending'), | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'asc'); | ||
} | ||
}, | ||
{ | ||
label: instance.translate('Sort Descending'), | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'desc'); | ||
} | ||
}, | ||
{ | ||
label: instance.translate('Reset sorting'), | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'none'); | ||
} | ||
}, | ||
{ | ||
label: instance.translate('Remove column'), | ||
action: function (column) { | ||
this.removeColumn(column.colIndex); | ||
} | ||
} | ||
], | ||
events: { | ||
onRemoveColumn(column) {}, | ||
onSwitchColumn(column1, column2) {}, | ||
onSortColumn(column) {}, | ||
onCheckRow(row) {}, | ||
onDestroy() {} | ||
}, | ||
{ | ||
label: 'Sort Descending', | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'desc'); | ||
} | ||
hooks: { | ||
columnTotal: null | ||
}, | ||
{ | ||
label: 'Reset sorting', | ||
action: function (column) { | ||
this.sortColumn(column.colIndex, 'none'); | ||
} | ||
sortIndicator: { | ||
asc: '↑', | ||
desc: '↓', | ||
none: '' | ||
}, | ||
{ | ||
label: 'Remove column', | ||
action: function (column) { | ||
this.removeColumn(column.colIndex); | ||
} | ||
} | ||
], | ||
events: { | ||
onRemoveColumn(column) {}, | ||
onSwitchColumn(column1, column2) {}, | ||
onSortColumn(column) {}, | ||
onCheckRow(row) {}, | ||
onDestroy() {} | ||
}, | ||
hooks: { | ||
columnTotal: null | ||
}, | ||
sortIndicator: { | ||
asc: '↑', | ||
desc: '↓', | ||
none: '' | ||
}, | ||
overrideComponents: { | ||
// ColumnManager: CustomColumnManager | ||
}, | ||
filterRows: filterRows, | ||
freezeMessage: '', | ||
getEditor: null, | ||
serialNoColumn: true, | ||
checkboxColumn: false, | ||
clusterize: true, | ||
logs: false, | ||
layout: 'fixed', // fixed, fluid, ratio | ||
noDataMessage: 'No Data', | ||
cellHeight: 40, | ||
minimumColumnWidth: 30, | ||
inlineFilters: false, | ||
treeView: false, | ||
checkedRowStatus: true, | ||
dynamicRowHeight: false, | ||
pasteFromClipboard: false, | ||
showTotalRow: false, | ||
direction: 'ltr', | ||
disableReorderColumn: false | ||
overrideComponents: { | ||
// ColumnManager: CustomColumnManager | ||
}, | ||
filterRows: filterRows, | ||
freezeMessage: '', | ||
getEditor: null, | ||
serialNoColumn: true, | ||
checkboxColumn: false, | ||
clusterize: true, | ||
logs: false, | ||
layout: 'fixed', // fixed, fluid, ratio | ||
noDataMessage: instance.translate('No Data'), | ||
cellHeight: 40, | ||
minimumColumnWidth: 30, | ||
inlineFilters: false, | ||
treeView: false, | ||
checkedRowStatus: true, | ||
dynamicRowHeight: false, | ||
pasteFromClipboard: false, | ||
showTotalRow: false, | ||
direction: 'ltr', | ||
disableReorderColumn: false | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { format } from './utils'; | ||
import getTranslations from './translations'; | ||
|
||
export default class TranslationManager { | ||
constructor(language) { | ||
this.language = language; | ||
this.translations = getTranslations(); | ||
} | ||
|
||
addTranslations(translations) { | ||
this.translations = Object.assign(this.translations, translations); | ||
} | ||
|
||
translate(sourceText, args) { | ||
let translation = (this.translations[this.language] && | ||
this.translations[this.language][sourceText]) || sourceText; | ||
|
||
if (typeof translation === 'object') { | ||
translation = args && args.count ? | ||
this.getPluralizedTranslation(translation, args.count) : | ||
sourceText; | ||
} | ||
|
||
return format(translation, args || {}); | ||
} | ||
|
||
getPluralizedTranslation(translations, count) { | ||
return translations[count] || translations['default']; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Sort Ascending": "Aufsteigend sortieren", | ||
"Sort Descending": "Absteigend sortieren", | ||
"Reset sorting": "Sortierung zurücksetzen", | ||
"Remove column": "Spalte entfernen", | ||
"No Data": "Keine Daten", | ||
"{count} cells copied": { | ||
"1": "{count} Zelle kopiert", | ||
"default": "{count} Zellen kopiert" | ||
}, | ||
"{count} rows selected": { | ||
"1": "{count} Zeile ausgewählt", | ||
"default": "{count} Zeilen ausgewählt" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Sort Ascending": "Sort Ascending", | ||
"Sort Descending": "Sort Descending", | ||
"Reset sorting": "Reset sorting", | ||
"Remove column": "Remove column", | ||
"No Data": "No Data", | ||
"{count} cells copied": { | ||
"1": "{count} cell copied", | ||
"default": "{count} cells copied" | ||
}, | ||
"{count} rows selected": { | ||
"1": "{count} row selected", | ||
"default": "{count} rows selected" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Sort Ascending": "Trier par ordre croissant", | ||
"Sort Descending": "Trier par ordre décroissant", | ||
"Reset sorting": "Réinitialiser le tri", | ||
"Remove column": "Supprimer colonne", | ||
"No Data": "Pas de données", | ||
"{count} cells copied": { | ||
"1": "{count} cellule copiée", | ||
"default": "{count} cellules copiées" | ||
}, | ||
"{count} rows selected": { | ||
"1": "{count} ligne sélectionnée", | ||
"default": "{count} lignes sélectionnées" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import en from './en.json'; | ||
import de from './de.json'; | ||
import fr from './fr.json'; | ||
import it from './it.json'; | ||
|
||
export default function getTranslations() { | ||
return { | ||
en, | ||
de, | ||
fr, | ||
it, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Sort Ascending": "Ordinamento ascendente", | ||
"Sort Descending": "Ordinamento decrescente", | ||
"Reset sorting": "Azzeramento ordinamento", | ||
"Remove column": "Rimuovi colonna", | ||
"No Data": "Nessun dato", | ||
"{count} cells copied": { | ||
"1": "Copiato {count} cella", | ||
"default": "{count} celle copiate" | ||
}, | ||
"{count} rows selected": { | ||
"1": "{count} linea selezionata", | ||
"default": "{count} linee selezionate" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters