Skip to content

Commit a7dbad5

Browse files
author
User Jenkins
committed
Sync with Kendo UI Professional
1 parent 28e57d9 commit a7dbad5

File tree

20 files changed

+632
-507
lines changed

20 files changed

+632
-507
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@progress/kendo-theme-material": "3.33.1",
1717
"amd-optimize": "0.6.1",
1818
"autoprefixer": "^9.1.5",
19-
"axe-core": "4.1.2",
19+
"axe-core": "^4.2.1",
2020
"bootstrap": "^4.0.0",
2121
"browser-sync": "~2.9.10",
2222
"chai": "^4.1.2",

src/kendo.colorpicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ var __meta__ = { // jshint ignore:line
749749
'# } else { #' +
750750
'<span class="k-selected-color"><span class="k-icon k-i-line" style="display: none;"></span></span>' +
751751
'# } #' +
752-
'<span class="k-select" unselectable="on" aria-label="select">' +
752+
'<span role="button" class="k-select" unselectable="on" aria-label="select">' +
753753
'<span class="k-icon k-i-arrow-60-down"></span>' +
754754
'</span>' +
755755
'</span>' +

src/kendo.datetimepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,8 @@ var __meta__ = { // jshint ignore:line
875875

876876
if (!icons[0]) {
877877
icons = $('<span unselectable="on" class="k-select">' +
878-
'<span class="k-link k-link-date" aria-label="' + options.dateButtonText + '"><span unselectable="on" class="k-icon k-i-calendar"></span></span>' +
879-
'<span class="k-link k-link-time" aria-label="' + options.timeButtonText + '"><span unselectable="on" class="k-icon k-i-clock"></span></span>' +
878+
'<span class="k-link k-link-date" role="button" aria-label="' + options.dateButtonText + '"><span unselectable="on" class="k-icon k-i-calendar"></span></span>' +
879+
'<span class="k-link k-link-time" role="button" aria-label="' + options.timeButtonText + '"><span unselectable="on" class="k-icon k-i-clock"></span></span>' +
880880
'</span>'
881881
).insertAfter(element);
882882
}

src/kendo.dropdownlist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ var __meta__ = { // jshint ignore:line
12621262
span = wrapper.find(SELECTOR);
12631263

12641264
if (!span[0]) {
1265-
wrapper.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span id="' + id + '" unselectable="on" role="option" aria-selected="true" class="k-input">&nbsp;</span><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"></span></span></span>')
1265+
wrapper.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span id="' + id + '" unselectable="on" role="option" aria-selected="true" class="k-input">&nbsp;</span><span role="button" unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"></span></span></span>')
12661266
.append(that.element);
12671267

12681268
span = wrapper.find(SELECTOR);

src/kendo.listbox.js

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ var __meta__ = { // jshint ignore:line
6464
var TRANSFER_ALL_FROM = "transferAllFrom";
6565
var DRAGGEDCLASS = "k-ghost";
6666
var UNIQUE_ID = "uid";
67+
var ID = "id";
6768
var TABINDEX = "tabindex";
6869
var COMMAND = "command";
6970

@@ -116,6 +117,7 @@ var __meta__ = { // jshint ignore:line
116117

117118
that._wrapper();
118119
that._list();
120+
that._ariaLabel();
119121
element = that.element.attr("multiple", "multiple").hide();
120122

121123
if (element[0] && !that.options.dataSource) {
@@ -218,9 +220,11 @@ var __meta__ = { // jshint ignore:line
218220

219221
_addItem: function (dataItem, list) {
220222
var that = this;
221-
var item = that.templates.itemTemplate({ item: dataItem, r: that.templates.itemContent });
223+
var item = $(that.templates.itemTemplate({ item: dataItem, r: that.templates.itemContent }));
222224

223-
$(item).attr(kendoAttr(UNIQUE_ID), dataItem.uid).appendTo(list);
225+
that._setItemId(item, dataItem.uid);
226+
227+
item.appendTo(list);
224228

225229
if (typeof dataItem === typeof "") {
226230
that.dataSource._data.push(dataItem);
@@ -231,13 +235,14 @@ var __meta__ = { // jshint ignore:line
231235

232236
_addItemAt: function(dataItem, index) {
233237
var that = this;
234-
var item = that.templates.itemTemplate({ item: dataItem, r: that.templates.itemContent });
238+
var item = $(that.templates.itemTemplate({ item: dataItem, r: that.templates.itemContent }));
235239
that._unbindDataSource();
236240
if (typeof dataItem === typeof "") {
237241
that._insertElementAt(item, index);
238242
that.dataSource._data.push(dataItem);
239243
} else {
240-
that._insertElementAt($(item).attr(kendoAttr(UNIQUE_ID), dataItem.uid), index);
244+
that._setItemId(item, dataItem.uid);
245+
that._insertElementAt(item, index);
241246
that.dataSource.add(dataItem);
242247
}
243248
that._bindDataSource();
@@ -303,7 +308,7 @@ var __meta__ = { // jshint ignore:line
303308

304309
that._target = target;
305310
target.addClass(FOCUSED_CLASS);
306-
that._getList().attr("aria-activedescendant", target.attr("id"));
311+
that._getList().attr("aria-activedescendant", target.attr(ID));
307312

308313
if (that._getList()[0] !== kendo._activeElement() && !isInput) {
309314
that.focus();
@@ -411,7 +416,7 @@ var __meta__ = { // jshint ignore:line
411416
if(that._target) {
412417
that._target.addClass(FOCUSED_CLASS);
413418
that._scrollIntoView(that._target);
414-
that._getList().attr("aria-activedescendant", that._target.attr("id"));
419+
that._getList().attr("aria-activedescendant", that._target.attr(ID));
415420
} else {
416421
that._getList().removeAttr("aria-activedescendant");
417422
}
@@ -950,6 +955,32 @@ var __meta__ = { // jshint ignore:line
950955
}
951956
},
952957

958+
_ariaLabel: function(){
959+
var that = this;
960+
var inputElm = that.element;
961+
var ul = that._getList();
962+
var id = inputElm.attr("id");
963+
var labelElm = $("label[for=\'" + id + "\']");
964+
var ariaLabel = inputElm.attr("aria-label");
965+
var ariaLabelledBy = inputElm.attr("aria-labelledby");
966+
var labelId;
967+
968+
if (ariaLabel) {
969+
ul.attr("aria-label", ariaLabel);
970+
} else if (ariaLabelledBy){
971+
ul.attr("aria-labelledby", ariaLabelledBy);
972+
} else if (labelElm.length){
973+
labelId = labelElm.attr("id");
974+
if (labelId) {
975+
ul.attr("aria-labelledby", labelId);
976+
} else {
977+
labelId = kendo.guid();
978+
labelElm.attr("id", labelId);
979+
ul.attr("aria-labelledby", labelId);
980+
}
981+
}
982+
},
983+
953984
_templates: function () {
954985
var that = this;
955986
var options = this.options;
@@ -1018,6 +1049,14 @@ var __meta__ = { // jshint ignore:line
10181049
return option += "</option>";
10191050
},
10201051

1052+
_setItemId: function(item, id) {
1053+
if (!item.length) {
1054+
return;
1055+
}
1056+
1057+
item.attr(kendoAttr(UNIQUE_ID), id).attr(ID, id);
1058+
},
1059+
10211060
_setItemIds: function() {
10221061
var that = this;
10231062
var items = that.items();
@@ -1026,7 +1065,7 @@ var __meta__ = { // jshint ignore:line
10261065
var i;
10271066

10281067
for (i = 0; i < viewLength; i++) {
1029-
items.eq(i).attr(kendoAttr(UNIQUE_ID), view[i].uid).attr("id", view[i].uid);
1068+
that._setItemId(items.eq(i), view[i].uid);
10301069
}
10311070
},
10321071

@@ -1318,7 +1357,6 @@ var __meta__ = { // jshint ignore:line
13181357
if (items.length !== 1) {
13191358
return null;
13201359
}
1321-
13221360
var that = this;
13231361
var itemFilter = that.options.filter;
13241362
var sourceListBox = that.getSourceListBox();

src/kendo.multiselect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ var __meta__ = { // jshint ignore:line
580580
listViewFilterValue;
581581

582582
if(listViewFilter && listViewFilter.filters.length > 0) {
583-
listViewFilterValue = listViewFilter.filters[0].value.toLowerCase();
583+
listViewFilterValue = listViewFilter.filters[0].value.toString().toLowerCase();
584584
}
585585

586586
if (that._request) {

src/kendo.numerictextbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ var __meta__ = { // jshint ignore:line
949949
var className = "k-i-arrow-" + (direction === "increase" ? "60-up" : "60-down");
950950

951951
return (
952-
'<span unselectable="on" class="k-link k-link-' + direction + '" aria-label="' + text + '" title="' + text + '">' +
952+
'<span role="button" unselectable="on" class="k-link k-link-' + direction + '" aria-label="' + text + '" title="' + text + '">' +
953953
'<span unselectable="on" class="' + CLASS_ICON + ' ' + className + '"></span>' +
954954
'</span>'
955955
);

styles/web/Bootstrap/_variables.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
@button-padding-y: @padding-y;
5353
@button-padding-x-sm: (@button-padding-x / 2);
5454
@button-padding-y-sm: (@button-padding-y / 2);
55-
@button-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2) + 2px";
56-
@button-inner-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2)";
55+
@button-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) + 2px )";
56+
@button-inner-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) )";
5757

5858
@input-border-width: 1px;
5959
@input-padding-x: @padding-x;
6060
@input-padding-y: @padding-y;
6161
@input-padding-x-sm: (@input-padding-x / 2);
6262
@input-padding-y-sm: (@input-padding-y / 2);
63-
@input-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2) + 2px";
64-
@input-inner-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2)";
63+
@input-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) + 2px )";
64+
@input-inner-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) )";
6565

6666
// Toolbar
6767
@toolbar-padding-x: 4px;
6868
@toolbar-padding-y: 4px;
69-
@toolbar-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px";
70-
@toolbar-inner-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2)";
69+
@toolbar-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px )";
70+
@toolbar-inner-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) )";

styles/web/Default/_variables.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
@button-padding-y: @padding-y;
5353
@button-padding-x-sm: (@button-padding-x / 2);
5454
@button-padding-y-sm: (@button-padding-y / 2);
55-
@button-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2) + 2px";
56-
@button-inner-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2)";
55+
@button-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) + 2px )";
56+
@button-inner-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) )";
5757

5858
@input-border-width: 1px;
5959
@input-padding-x: 5px;
6060
@input-padding-y: 4px;
6161
@input-padding-x-sm: (@input-padding-x / 2);
6262
@input-padding-y-sm: (@input-padding-y / 2);
63-
@input-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2) + 2px";
64-
@input-inner-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2)";
63+
@input-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) + 2px )";
64+
@input-inner-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) )";
6565

6666
// Toolbar
6767
@toolbar-padding-x: 4px;
6868
@toolbar-padding-y: 4px;
69-
@toolbar-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px";
70-
@toolbar-inner-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2)";
69+
@toolbar-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px )";
70+
@toolbar-inner-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) )";

styles/web/Fiori/_variables.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
@button-padding-y: @padding-y;
5353
@button-padding-x-sm: (@button-padding-x / 2);
5454
@button-padding-y-sm: (@button-padding-y / 2);
55-
@button-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2) + 2px";
56-
@button-inner-calc-size: ~"@{form-line-height-em} + (@{button-padding-y} * 2)";
55+
@button-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) + 2px )";
56+
@button-inner-calc-size: ~"calc( @{form-line-height-em} + (@{button-padding-y} * 2) )";
5757

5858
@input-border-width: 1px;
5959
@input-padding-x: 5px;
6060
@input-padding-y: 4px;
6161
@input-padding-x-sm: (@input-padding-x / 2);
6262
@input-padding-y-sm: (@input-padding-y / 2);
63-
@input-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2) + 2px";
64-
@input-inner-calc-size: ~"@{form-line-height-em} + (@{input-padding-y} * 2)";
63+
@input-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) + 2px )";
64+
@input-inner-calc-size: ~"calc( @{form-line-height-em} + (@{input-padding-y} * 2) )";
6565

6666
// Toolbar
6767
@toolbar-padding-x: 4px;
6868
@toolbar-padding-y: 4px;
69-
@toolbar-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px";
70-
@toolbar-inner-calc-size: ~"@{button-calc-size} + (@{toolbar-padding-y} * 2)";
69+
@toolbar-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) + 2px )";
70+
@toolbar-inner-calc-size: ~"calc( @{button-calc-size} + (@{toolbar-padding-y} * 2) )";

0 commit comments

Comments
 (0)