diff --git a/packages/devextreme/js/__internal/grids/grid_core/sorting/m_sorting_mixin.ts b/packages/devextreme/js/__internal/grids/grid_core/sorting/m_sorting_mixin.ts index 6e86545c79fd..935c6998735b 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/sorting/m_sorting_mixin.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/sorting/m_sorting_mixin.ts @@ -1,5 +1,6 @@ import $ from '@js/core/renderer'; import { isDefined } from '@js/core/utils/type'; +import messageLocalization from '@js/localization/message'; const SORT_CLASS = 'dx-sort'; const SORT_NONE_CLASS = 'dx-sort-none'; @@ -24,6 +25,7 @@ export default { !$indicatorsContainer.children().length && $indicatorsContainer.remove(); const isSortingAllowed = sortingMode !== 'none' && column.allowSorting; + const hasSeveralSortIndexes = that.getController && !!that.getController('columns').columnOption('sortIndex:1'); if (!isDefined(column.groupIndex) && (isSortingAllowed || isDefined(column.sortOrder))) { ariaSortState = column.sortOrder === 'asc' ? 'ascending' : 'descending'; @@ -31,7 +33,6 @@ export default { .toggleClass(SORTUP_CLASS, column.sortOrder === 'asc') .toggleClass(SORTDOWN_CLASS, column.sortOrder === 'desc'); - const hasSeveralSortIndexes = that.getController && !!that.getController('columns').columnOption('sortIndex:1'); if (hasSeveralSortIndexes && that.option('sorting.showSortIndexes') && column.sortIndex >= 0) { $('') .addClass(SORT_INDEX_ICON_CLASS) @@ -45,14 +46,16 @@ export default { } } - this._setAriaSortAttribute(column, ariaSortState, rootElement); + this._setAriaSortAttribute(column, ariaSortState, rootElement, hasSeveralSortIndexes); return $sortIndicator; } return that.callBase(options); }, - _setAriaSortAttribute(column, ariaSortState, rootElement) { + _setAriaSortAttribute(column, ariaSortState, $rootElement, hasSeveralSortIndexes) { + $rootElement.removeAttr('aria-roledescription'); + if (column.isGrouped) { let description = this.localize('dxDataGrid-ariaNotSortedColumn'); if (isDefined(column.sortOrder)) { @@ -60,11 +63,22 @@ export default { ? this.localize('dxDataGrid-ariaSortedAscendingColumn') : this.localize('dxDataGrid-ariaSortedDescendingColumn'); } - this.setAria('roledescription', description, rootElement); + this.setAria('roledescription', description, $rootElement); } else if (!isDefined(column.sortOrder)) { - this.setAria('sort', 'none', rootElement); + this.setAria('sort', 'none', $rootElement); } else { - this.setAria('sort', ariaSortState, rootElement); + this.setAria('sort', ariaSortState, $rootElement); + + if (hasSeveralSortIndexes && column.sortIndex >= 0) { + const ariaColumnHeader = messageLocalization.format('dxDataGrid-ariaColumnHeader'); + const ariaSortIndex = messageLocalization.format( + 'dxDataGrid-ariaSortIndex', + // @ts-expect-error + column.sortIndex + 1, + ); + const description = `${ariaColumnHeader}, ${ariaSortIndex}`; + this.setAria('roledescription', description, $rootElement); + } } }, diff --git a/packages/devextreme/js/localization/messages/ar.json b/packages/devextreme/js/localization/messages/ar.json index 9969962699e5..b9cd6702e3ac 100644 --- a/packages/devextreme/js/localization/messages/ar.json +++ b/packages/devextreme/js/localization/messages/ar.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "احفظ التغييرات", "dxDataGrid-editingCancelAllChanges": "تجاهل التغييرات", "dxDataGrid-editingAddRow": "أضف صفًا", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "عمود", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "القيمة", "dxDataGrid-ariaFilterCell": "تصفية الخلية", "dxDataGrid-ariaCollapse": "طي", diff --git a/packages/devextreme/js/localization/messages/ca.json b/packages/devextreme/js/localization/messages/ca.json index b18bea7afe00..42e393e6ef28 100644 --- a/packages/devextreme/js/localization/messages/ca.json +++ b/packages/devextreme/js/localization/messages/ca.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Guardar canvis", "dxDataGrid-editingCancelAllChanges": "Descartar els canvis", "dxDataGrid-editingAddRow": "Afegiu una fila", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Amagueu les dades addicionals", "dxDataGrid-ariaAdaptiveExpand": "Mostra dades addicionals", "dxDataGrid-ariaColumn": "Columna", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valorar", "dxDataGrid-ariaFilterCell": "Filtrar la cel·la", "dxDataGrid-ariaCollapse": "Col·lapsar", diff --git a/packages/devextreme/js/localization/messages/cs.json b/packages/devextreme/js/localization/messages/cs.json index c00addd35214..6025c4a3cfb1 100644 --- a/packages/devextreme/js/localization/messages/cs.json +++ b/packages/devextreme/js/localization/messages/cs.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Uložit změny", "dxDataGrid-editingCancelAllChanges": "Zrušit změny", "dxDataGrid-editingAddRow": "Přidat řádek", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Sloupec", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Hodnota", "dxDataGrid-ariaFilterCell": "Filtrovat buňku", "dxDataGrid-ariaCollapse": "Sbalit", diff --git a/packages/devextreme/js/localization/messages/de.json b/packages/devextreme/js/localization/messages/de.json index ac6981fa64f8..805c56831aad 100644 --- a/packages/devextreme/js/localization/messages/de.json +++ b/packages/devextreme/js/localization/messages/de.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Änderungen speichern", "dxDataGrid-editingCancelAllChanges": "Änderungen verwerfen", "dxDataGrid-editingAddRow": "Neue Zeile", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Zusätzliche Spalten verstecken", "dxDataGrid-ariaAdaptiveExpand": "Zusätzliche Spalten anzeigen", "dxDataGrid-ariaColumn": "Spalte", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Wert", "dxDataGrid-ariaFilterCell": "Filterzelle", "dxDataGrid-ariaCollapse": "Zusammenklappen", diff --git a/packages/devextreme/js/localization/messages/el.json b/packages/devextreme/js/localization/messages/el.json index 3d9d8da2c826..0885b0a1fb59 100644 --- a/packages/devextreme/js/localization/messages/el.json +++ b/packages/devextreme/js/localization/messages/el.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Αποθήκευση αλλαγών", "dxDataGrid-editingCancelAllChanges": "Απόρριψη αλλαγών", "dxDataGrid-editingAddRow": "Προσθήκη γραμμής", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Στήλη", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Τιμή", "dxDataGrid-ariaFilterCell": "Φιλτράρισμα κελιού", "dxDataGrid-ariaCollapse": "Συρρίκνωση", diff --git a/packages/devextreme/js/localization/messages/en.json b/packages/devextreme/js/localization/messages/en.json index 23c32c643a01..62fd0a74fd29 100644 --- a/packages/devextreme/js/localization/messages/en.json +++ b/packages/devextreme/js/localization/messages/en.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Save changes", "dxDataGrid-editingCancelAllChanges": "Discard changes", "dxDataGrid-editingAddRow": "Add a row", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Column", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Value", "dxDataGrid-ariaFilterCell": "Filter cell", "dxDataGrid-ariaCollapse": "Collapse", diff --git a/packages/devextreme/js/localization/messages/es.json b/packages/devextreme/js/localization/messages/es.json index 0bd93dcb35a3..a98d7e675623 100644 --- a/packages/devextreme/js/localization/messages/es.json +++ b/packages/devextreme/js/localization/messages/es.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Guardar cambios", "dxDataGrid-editingCancelAllChanges": "Descartar cambios", "dxDataGrid-editingAddRow": "Agregar una fila", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Columna", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valor", "dxDataGrid-ariaFilterCell": "Celda de filtro", "dxDataGrid-ariaCollapse": "Colapsar", diff --git a/packages/devextreme/js/localization/messages/fa.json b/packages/devextreme/js/localization/messages/fa.json index 7dc451373cff..8c33fc4562f0 100644 --- a/packages/devextreme/js/localization/messages/fa.json +++ b/packages/devextreme/js/localization/messages/fa.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "ثبت تغییرات", "dxDataGrid-editingCancelAllChanges": "لغو تغییرات", "dxDataGrid-editingAddRow": "افزودن سطر", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "عدم نمایش اطلاعات تکمیلی", "dxDataGrid-ariaAdaptiveExpand": "نمایش اطلاعات تکمیلی", "dxDataGrid-ariaColumn": "ستون", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "مقدار", "dxDataGrid-ariaFilterCell": "فیلتر سلول", "dxDataGrid-ariaCollapse": "عدم نمایش", diff --git a/packages/devextreme/js/localization/messages/fi.json b/packages/devextreme/js/localization/messages/fi.json index 55d85b8134bc..c9ffda904974 100644 --- a/packages/devextreme/js/localization/messages/fi.json +++ b/packages/devextreme/js/localization/messages/fi.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Tallenna muutokset", "dxDataGrid-editingCancelAllChanges": "Hylkää muutokset", "dxDataGrid-editingAddRow": "Lisää rivi", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Sarake", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Arvo", "dxDataGrid-ariaFilterCell": "Suodatinsolu", "dxDataGrid-ariaCollapse": "Tiivistä", diff --git a/packages/devextreme/js/localization/messages/fr.json b/packages/devextreme/js/localization/messages/fr.json index 715d7af5fcc5..da38507ad890 100644 --- a/packages/devextreme/js/localization/messages/fr.json +++ b/packages/devextreme/js/localization/messages/fr.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Sauvegarder les changements", "dxDataGrid-editingCancelAllChanges": "Ignorer les changements", "dxDataGrid-editingAddRow": "Ajouter ligne", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Masquer les données supplémentaires", "dxDataGrid-ariaAdaptiveExpand": "Afficher des données supplémentaires", "dxDataGrid-ariaColumn": "Colonne", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valeur", "dxDataGrid-ariaFilterCell": "Filtre de cellule", "dxDataGrid-ariaCollapse": "Réduire", diff --git a/packages/devextreme/js/localization/messages/hu.json b/packages/devextreme/js/localization/messages/hu.json index ae03097b718b..9469b8f5694f 100644 --- a/packages/devextreme/js/localization/messages/hu.json +++ b/packages/devextreme/js/localization/messages/hu.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Módosítások mentése", "dxDataGrid-editingCancelAllChanges": "Módosítások elvetése", "dxDataGrid-editingAddRow": "Sor hozzáadása", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Oszlop", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Érték", "dxDataGrid-ariaFilterCell": "Szűrő cella", "dxDataGrid-ariaCollapse": "Összecsukás", diff --git a/packages/devextreme/js/localization/messages/it.json b/packages/devextreme/js/localization/messages/it.json index 3003a8a7a946..314f23c79437 100644 --- a/packages/devextreme/js/localization/messages/it.json +++ b/packages/devextreme/js/localization/messages/it.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Salva le modifiche", "dxDataGrid-editingCancelAllChanges": "Annulla le modifiche", "dxDataGrid-editingAddRow": "Aggiungi una riga", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Nascondi ulteriori dati", "dxDataGrid-ariaAdaptiveExpand": "Mostra ulteriori dati", "dxDataGrid-ariaColumn": "Colonna", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valore", "dxDataGrid-ariaFilterCell": "Filtra cella", "dxDataGrid-ariaCollapse": "Comprimi", diff --git a/packages/devextreme/js/localization/messages/ja.json b/packages/devextreme/js/localization/messages/ja.json index edbbeb17c25c..0e638bc22ea8 100644 --- a/packages/devextreme/js/localization/messages/ja.json +++ b/packages/devextreme/js/localization/messages/ja.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "変更を保存", "dxDataGrid-editingCancelAllChanges": "変更を破棄", "dxDataGrid-editingAddRow": "行を追加", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "追加データを非表示にする", "dxDataGrid-ariaAdaptiveExpand": "追加データを表示する", "dxDataGrid-ariaColumn": "列", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "値", "dxDataGrid-ariaFilterCell": "フィルター セル", "dxDataGrid-ariaCollapse": "折りたたむ", diff --git a/packages/devextreme/js/localization/messages/lt.json b/packages/devextreme/js/localization/messages/lt.json index de71b46d4278..258f6a7cffec 100644 --- a/packages/devextreme/js/localization/messages/lt.json +++ b/packages/devextreme/js/localization/messages/lt.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Išsaugoti pakeitimus", "dxDataGrid-editingCancelAllChanges": "Atmesti pakeitimus", "dxDataGrid-editingAddRow": "Pridėti eilutę", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Slėpti papildomus duomenis", "dxDataGrid-ariaAdaptiveExpand": "Rodyti papildomus duomenis", "dxDataGrid-ariaColumn": "Stulpelis", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Reikšmė", "dxDataGrid-ariaFilterCell": "Filtro laukas", "dxDataGrid-ariaCollapse": "Suskleisti", diff --git a/packages/devextreme/js/localization/messages/lv.json b/packages/devextreme/js/localization/messages/lv.json index e04e0271a069..d6aa99631c71 100644 --- a/packages/devextreme/js/localization/messages/lv.json +++ b/packages/devextreme/js/localization/messages/lv.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Saglabāt izmaiņas", "dxDataGrid-editingCancelAllChanges": "Atcelt izmaiņas", "dxDataGrid-editingAddRow": "Pievienot rindu", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Slēpt papildus datus", "dxDataGrid-ariaAdaptiveExpand": "Rādīt papildus datus", "dxDataGrid-ariaColumn": "Kolonna", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Vērtība", "dxDataGrid-ariaFilterCell": "Filtrēt šūnu", "dxDataGrid-ariaCollapse": "Savērst", diff --git a/packages/devextreme/js/localization/messages/nb.json b/packages/devextreme/js/localization/messages/nb.json index ecfe291b77f1..9ddc798cfb04 100644 --- a/packages/devextreme/js/localization/messages/nb.json +++ b/packages/devextreme/js/localization/messages/nb.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Lagre endringer", "dxDataGrid-editingCancelAllChanges": "Forkast endringer", "dxDataGrid-editingAddRow": "Legg til rad", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Kolonne", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Verdi", "dxDataGrid-ariaFilterCell": "Filtrér celle", "dxDataGrid-ariaCollapse": "Skjul", diff --git a/packages/devextreme/js/localization/messages/nl.json b/packages/devextreme/js/localization/messages/nl.json index a5fc1950692f..c2f88a0f0de9 100644 --- a/packages/devextreme/js/localization/messages/nl.json +++ b/packages/devextreme/js/localization/messages/nl.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Wijzigingen opslaan", "dxDataGrid-editingCancelAllChanges": "Wijzigingen annuleren", "dxDataGrid-editingAddRow": "Rij toevoegen", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Kolom", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Waarde", "dxDataGrid-ariaFilterCell": "Filter cel", "dxDataGrid-ariaCollapse": "Inklappen", diff --git a/packages/devextreme/js/localization/messages/pt.json b/packages/devextreme/js/localization/messages/pt.json index 2b5a585d7d89..b956b674d355 100644 --- a/packages/devextreme/js/localization/messages/pt.json +++ b/packages/devextreme/js/localization/messages/pt.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Salvar todas as alterações", "dxDataGrid-editingCancelAllChanges": "Descartar alterações", "dxDataGrid-editingAddRow": "Adicionar uma linha", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Ocultar dados adicionais", "dxDataGrid-ariaAdaptiveExpand": "Exibir dados adicionais", "dxDataGrid-ariaColumn": "Coluna", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valor", "dxDataGrid-ariaFilterCell": "Filtro de célula", "dxDataGrid-ariaCollapse": "Contrair", diff --git a/packages/devextreme/js/localization/messages/ro.json b/packages/devextreme/js/localization/messages/ro.json index 0d9f6f32b26b..d7c970877061 100644 --- a/packages/devextreme/js/localization/messages/ro.json +++ b/packages/devextreme/js/localization/messages/ro.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Salvează modificările", "dxDataGrid-editingCancelAllChanges": "Renunţă la modificări", "dxDataGrid-editingAddRow": "Adaugă un rând", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Coloană", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Valoare", "dxDataGrid-ariaFilterCell": "Celulă de filtrare", "dxDataGrid-ariaCollapse": "Restrângere", diff --git a/packages/devextreme/js/localization/messages/ru.json b/packages/devextreme/js/localization/messages/ru.json index a5aea0565454..d0651e307da8 100644 --- a/packages/devextreme/js/localization/messages/ru.json +++ b/packages/devextreme/js/localization/messages/ru.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Сохранить изменения", "dxDataGrid-editingCancelAllChanges": "Отменить изменения", "dxDataGrid-editingAddRow": "Добавить строку", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Скрыть дополнительные данные", "dxDataGrid-ariaAdaptiveExpand": "Показать дополнительные данные", "dxDataGrid-ariaColumn": "Столбец", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Значение", "dxDataGrid-ariaFilterCell": "Фильтр", "dxDataGrid-ariaCollapse": "Свернуть", diff --git a/packages/devextreme/js/localization/messages/sl.json b/packages/devextreme/js/localization/messages/sl.json index eebddf58df6e..f985347a09eb 100644 --- a/packages/devextreme/js/localization/messages/sl.json +++ b/packages/devextreme/js/localization/messages/sl.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Shrani spremembe", "dxDataGrid-editingCancelAllChanges": "Zavrzi spremembe", "dxDataGrid-editingAddRow": "Dodaj vrstico", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Stolpec", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Vrednost", "dxDataGrid-ariaFilterCell": "Filtriraj po celici", "dxDataGrid-ariaCollapse": "Skrči", diff --git a/packages/devextreme/js/localization/messages/sv.json b/packages/devextreme/js/localization/messages/sv.json index a9e673bc33d9..3c2aa5705217 100644 --- a/packages/devextreme/js/localization/messages/sv.json +++ b/packages/devextreme/js/localization/messages/sv.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Spara ändringar", "dxDataGrid-editingCancelAllChanges": "Ångra ändringar", "dxDataGrid-editingAddRow": "Lägg till rad", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Kolumn", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Värde", "dxDataGrid-ariaFilterCell": "Filtrera cell", "dxDataGrid-ariaCollapse": "Kollapsa", diff --git a/packages/devextreme/js/localization/messages/tr.json b/packages/devextreme/js/localization/messages/tr.json index bde6c12b72e0..1ecd6202403c 100644 --- a/packages/devextreme/js/localization/messages/tr.json +++ b/packages/devextreme/js/localization/messages/tr.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Değişiklikleri Kaydet", "dxDataGrid-editingCancelAllChanges": "Değişiklikleri iptal et", "dxDataGrid-editingAddRow": "Satır ekle", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Sütun", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Veri", "dxDataGrid-ariaFilterCell": "Filtre hücresi", "dxDataGrid-ariaCollapse": "Daralt", diff --git a/packages/devextreme/js/localization/messages/vi.json b/packages/devextreme/js/localization/messages/vi.json index aed4e00dee12..d83e7d5f5e59 100644 --- a/packages/devextreme/js/localization/messages/vi.json +++ b/packages/devextreme/js/localization/messages/vi.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "Lưu lại các thay đổi", "dxDataGrid-editingCancelAllChanges": "Loại bỏ các thay đổi", "dxDataGrid-editingAddRow": "Thêm một hàng", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "Cột", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "Giá trị", "dxDataGrid-ariaFilterCell": "Lọc ô", "dxDataGrid-ariaCollapse": "Thu lại", diff --git a/packages/devextreme/js/localization/messages/zh-tw.json b/packages/devextreme/js/localization/messages/zh-tw.json index c581219b01db..88abc6bb5d1e 100644 --- a/packages/devextreme/js/localization/messages/zh-tw.json +++ b/packages/devextreme/js/localization/messages/zh-tw.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "保存修改", "dxDataGrid-editingCancelAllChanges": "放棄修改", "dxDataGrid-editingAddRow": "添加一列", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "欄", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "值", "dxDataGrid-ariaFilterCell": "過濾單元", "dxDataGrid-ariaCollapse": "摺疊", diff --git a/packages/devextreme/js/localization/messages/zh.json b/packages/devextreme/js/localization/messages/zh.json index 58a3a3f45169..399f062ce9e5 100644 --- a/packages/devextreme/js/localization/messages/zh.json +++ b/packages/devextreme/js/localization/messages/zh.json @@ -136,6 +136,7 @@ "dxDataGrid-ariaNotSortedColumn": "Not sorted column", "dxDataGrid-ariaSortedAscendingColumn": "Column sorted in ascending order", "dxDataGrid-ariaSortedDescendingColumn": "Column sorted in descending order", + "dxDataGrid-ariaSortIndex": "Sort index {0}", "dxDataGrid-editingSaveAllChanges": "保存修改", "dxDataGrid-editingCancelAllChanges": "放弃修改", "dxDataGrid-editingAddRow": "添加一行", @@ -167,6 +168,7 @@ "dxDataGrid-ariaAdaptiveCollapse": "Hide additional data", "dxDataGrid-ariaAdaptiveExpand": "Display additional data", "dxDataGrid-ariaColumn": "列", + "dxDataGrid-ariaColumnHeader": "Column header", "dxDataGrid-ariaValue": "值", "dxDataGrid-ariaFilterCell": "过滤单元", "dxDataGrid-ariaCollapse": "折叠", diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnsHeadersView.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnsHeadersView.tests.js index 93e31385a589..dfe51bdc54ed 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnsHeadersView.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnsHeadersView.tests.js @@ -3120,6 +3120,50 @@ QUnit.module('Multiple sorting', { assert.strictEqual(cols[2].sortOrder, 'asc', 'third column has sort order'); }); }); + + QUnit.test('Column headers should have correct aria-roledescription', function(assert) { + // arrange + const $testElement = this.$element().addClass('dx-widget'); + const options = { + sorting: { + mode: 'multiple' + } + }; + + this.setupDataGrid(options); + + // act + this.columnHeadersView.render($testElement); + + // assert + const $headerCells = $testElement.find('.dx-header-row td'); + const ariaColumnHeader = messageLocalization.format('dxDataGrid-ariaColumnHeader'); + const getAriaSortIndex = (index = 0) => { + return `${ariaColumnHeader}, ${messageLocalization.format('dxDataGrid-ariaSortIndex', index + 1)}`; + }; + + assert.equal($headerCells.eq(0).attr('aria-roledescription'), undefined, 'First column has correct aria-roledescription'); + assert.equal($headerCells.eq(1).attr('aria-roledescription'), getAriaSortIndex(1), 'Second column has correct aria-roledescription'); + assert.equal($headerCells.eq(2).attr('aria-roledescription'), getAriaSortIndex(0), 'Third column has correct aria-roledescription'); + + // act + $headerCells.eq(0).trigger($.Event('dxclick', { shiftKey: true })); + this.clock.tick(10); + + // assert + assert.equal($headerCells.eq(0).attr('aria-roledescription'), getAriaSortIndex(2), 'First column has correct aria-roledescription'); + assert.equal($headerCells.eq(1).attr('aria-roledescription'), getAriaSortIndex(1), 'Second column has correct aria-roledescription'); + assert.equal($headerCells.eq(2).attr('aria-roledescription'), getAriaSortIndex(0), 'Third column has correct aria-roledescription'); + + // act + $headerCells.eq(0).trigger('dxclick'); + this.clock.tick(10); + + // assert + assert.equal($headerCells.eq(0).attr('aria-roledescription'), undefined, 'First column has correct aria-roledescription'); + assert.equal($headerCells.eq(1).attr('aria-roledescription'), undefined, 'Second column has correct aria-roledescription'); + assert.equal($headerCells.eq(2).attr('aria-roledescription'), undefined, 'Third column has correct aria-roledescription'); + }); }); QUnit.module('Headers with RTL', {