Skip to content

Commit 0b433af

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent d82afe4 commit 0b433af

File tree

7 files changed

+215
-139
lines changed

7 files changed

+215
-139
lines changed

docs-aspnet/html-helpers/editors/dropdownlist/cascading.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ position: 6
1111
The cascading functionality is represented by a series of two or more DropDownLists in which each DropDownList is filtered according to the selected options in the previous DropDownList.
1212

1313
## Basic Concepts and Requirements
14-
14+
{% if site.core %}
1515
The child DropDownList cascades from the parent one if the [`CascadeFrom`](/api/Kendo.Mvc.UI.Fluent/DropDownListBuilder#cascadefromsystemstring) property is defined. The `CascadeFrom` property has to point to the [`Name`]({% slug fundamentals_core %}#basic-configuration) of the parent DropDownList widget.
16+
{% else %}
17+
The child DropDownList cascades from the parent one if the [`CascadeFrom`](/api/Kendo.Mvc.UI.Fluent/DropDownListBuilder#cascadefromsystemstring) property is defined. The `CascadeFrom` property has to point to the [`Name`]({% slug fundamentals_aspnetmvc %}#basic-configuration) of the parent DropDownList widget.
18+
{% endif %}
1619

1720
The following actions occur during initialization of the child DropDownList. The child {{ site.product_short }} DropDownList:
1821
- checks if the `CascadeFrom` property is set. If not, cascading is disabled.

src/kendo.colorpicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ var __meta__ = { // jshint ignore:line
564564
return;
565565
}
566566

567-
this._colorAsText.attr("title", that.options.messages.previewInput);
567+
this._colorAsText.attr("aria-label", that.options.messages.previewInput);
568568
this._colorAsText.removeClass("k-state-error");
569569

570570
that._selectedColor.css(BACKGROUNDCOLOR, color.toDisplay());

src/kendo.textbox.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,26 @@ var __meta__ = {// jshint ignore:line
119119
}
120120

121121
that.element.off(NS);
122+
that.element[0].style.width = "";
123+
that.element.removeClass(INPUT);
122124
Widget.fn.destroy.call(that);
123125
},
124126

127+
setOptions: function(options) {
128+
this.destroy();
129+
130+
this.element.unwrap();
131+
if (this._floatingLabelContainer) {
132+
this._inputLabel.remove();
133+
this._inputLabel = null;
134+
this.element.unwrap();
135+
this._floatingLabelContainer = null;
136+
}
137+
138+
kendo.deepExtend(this.options, options);
139+
this.init(this.element, this.options);
140+
},
141+
125142
_editable: function(options) {
126143
var that = this;
127144
var element = that.element;
@@ -198,6 +215,10 @@ var __meta__ = {// jshint ignore:line
198215

199216
that.wrapper.removeClass(FOCUSED);
200217

218+
if (value === null) {
219+
value = "";
220+
}
221+
201222
if (value !== newValue) {
202223
that._value = newValue;
203224

src/kendo.window.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,9 +2051,9 @@
20512051
wnd.minTop = -containerOffset.top;
20522052
}
20532053

2054-
wnd.wrapper
2055-
.append(templates.overlay)
2056-
.children(KWINDOWRESIZEHANDLES).hide();
2054+
$(templates.overlay).appendTo(wnd.wrapper).css({ opacity: 0 });
2055+
2056+
wnd.wrapper.children(KWINDOWRESIZEHANDLES).hide();
20572057

20582058
$(BODY).css(CURSOR, e.currentTarget.css(CURSOR));
20592059
},

tests/colorpicker/aria.js

Lines changed: 153 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,153 @@
1-
(function() {
2-
var colorPicker;
3-
var element;
4-
5-
describe("colorpalette", function() {
6-
beforeEach(function() {
7-
element = $("<div>").kendoColorPalette();
8-
colorPicker = element.data("kendoColorPalette");
9-
});
10-
afterEach(function() {
11-
colorPicker.destroy();
12-
});
13-
14-
it("renders aria-label for each color", function() {
15-
element.find(".k-item").each(function() {
16-
var label = $(this).attr("aria-label");
17-
assert.isOk(label, "aria-label defined on cells"); // label defined
18-
var bg = $(this);
19-
var color = kendo.parseColor(label);
20-
bg = kendo.parseColor(bg.css("background-color"));
21-
assert.isOk(color && bg && color.equals(bg), "aria-label is same as background color");
22-
});
23-
});
24-
25-
it("maintains aria-selected attribute consistent with selection", function() {
26-
var items = element.find(".k-item");
27-
28-
assert.equal(element.find("[aria-selected=true]").length, 0);
29-
30-
items.last().click();
31-
32-
var selected = element.find("[aria-selected=true]");
33-
assert.isOk(selected[0] === items.last()[0]);
34-
assert.equal(selected.length, 1);
35-
});
36-
37-
it("sets aria-activedescendant based on selection", function() {
38-
var lastColor = element.find(".k-item").last();
39-
40-
lastColor.click();
41-
42-
assert.isOk(element.is("[aria-activedescendant]"));
43-
assert.equal(element.attr("aria-activedescendant"), lastColor.attr("id"));
44-
});
45-
46-
it("renders role='row' for each tr", function() {
47-
var rows = element.find("tr");
48-
49-
assert.equal(rows.filter("[role=row]").length, rows.length);
50-
});
51-
52-
it("renders role='gridcell' for each td", function() {
53-
var cells = element.find("td");
54-
55-
assert.equal(cells.filter("[role=gridcell]").length, cells.length);
56-
});
57-
});
58-
59-
describe("color picker", function() {
60-
beforeEach(function() {
61-
element = $("<input/>").kendoColorPicker();
62-
colorPicker = element.data("kendoColorPicker");
63-
});
64-
afterEach(function() {
65-
colorPicker.destroy();
66-
});
67-
68-
it("renders role='textbox' to the wrapper", function() {
69-
var wrapper = colorPicker.wrapper;
70-
71-
assert.equal(wrapper.attr("role"), "textbox");
72-
});
73-
74-
it("renders aria-haspopup='true' to the wrapper", function() {
75-
var wrapper = colorPicker.wrapper;
76-
77-
assert.equal(wrapper.attr("aria-haspopup"), "true");
78-
});
79-
80-
it("render popup with id", function() {
81-
colorPicker.open();
82-
83-
var popup = colorPicker._popup.element;
84-
85-
assert.isOk(popup.attr("id"));
86-
});
87-
88-
it("render aria-owns to the wrapper", function() {
89-
colorPicker.open();
90-
91-
assert.equal(colorPicker.wrapper.attr("aria-owns"), colorPicker._popup.element.attr("id"));
92-
});
93-
94-
it("renders aria-disabled=false", function() {
95-
assert.equal(colorPicker.wrapper.attr("aria-disabled"), "false");
96-
});
97-
98-
it("renders aria-disabled=true", function() {
99-
colorPicker.enable(false);
100-
101-
assert.equal(colorPicker.wrapper.attr("aria-disabled"), "true");
102-
assert.isOk(!colorPicker.wrapper.attr("disabled"));
103-
});
104-
105-
it("renders aria-label to the wrapper", function() {
106-
colorPicker.value("#f9d9ab");
107-
108-
assert.isOk(colorPicker.wrapper.attr("aria-label").indexOf("#f9d9ab") !== -1);
109-
});
110-
});
111-
112-
describe("flatcolorpicker", function() {
113-
beforeEach(function() {
114-
element = $("<div>").kendoFlatColorPicker({
115-
preview: true
116-
});
117-
colorPicker = element.data("kendoFlatColorPicker");
118-
});
119-
afterEach(function() {
120-
colorPicker.destroy();
121-
});
122-
123-
it("renders aria-label to the slider", function() {
124-
var ariaLabel = colorPicker.wrapper.find(".k-hue-slider input").attr("aria-label");
125-
assert.isOk(ariaLabel === "hue saturation");
126-
});
127-
128-
it("renders title to the preview input", function() {
129-
var ariaLabel = colorPicker.wrapper.find(".k-color-value").attr("title");
130-
assert.isOk(ariaLabel === "Color Hexadecimal Code");
131-
});
132-
133-
});
134-
}());
1+
(function() {
2+
var colorPicker;
3+
var element;
4+
5+
describe("colorpalette", function() {
6+
beforeEach(function() {
7+
element = $("<div>").appendTo(Mocha.fixture).kendoColorPalette();
8+
colorPicker = element.data("kendoColorPalette");
9+
});
10+
afterEach(function() {
11+
colorPicker.destroy();
12+
});
13+
14+
it("renders aria-label for each color", function() {
15+
element.find(".k-item").each(function() {
16+
var label = $(this).attr("aria-label");
17+
assert.isOk(label, "aria-label defined on cells"); // label defined
18+
var bg = $(this);
19+
var color = kendo.parseColor(label);
20+
bg = kendo.parseColor(bg.css("background-color"));
21+
assert.isOk(color && bg && color.equals(bg), "aria-label is same as background color");
22+
});
23+
});
24+
25+
it("maintains aria-selected attribute consistent with selection", function() {
26+
var items = element.find(".k-item");
27+
28+
assert.equal(element.find("[aria-selected=true]").length, 0);
29+
30+
items.last().click();
31+
32+
var selected = element.find("[aria-selected=true]");
33+
assert.isOk(selected[0] === items.last()[0]);
34+
assert.equal(selected.length, 1);
35+
});
36+
37+
it("sets aria-activedescendant based on selection", function() {
38+
var lastColor = element.find(".k-item").last();
39+
40+
lastColor.click();
41+
42+
assert.isOk(element.is("[aria-activedescendant]"));
43+
assert.equal(element.attr("aria-activedescendant"), lastColor.attr("id"));
44+
});
45+
46+
it("renders role='row' for each tr", function() {
47+
var rows = element.find("tr");
48+
49+
assert.equal(rows.filter("[role=row]").length, rows.length);
50+
});
51+
52+
it("renders role='gridcell' for each td", function() {
53+
var cells = element.find("td");
54+
55+
assert.equal(cells.filter("[role=gridcell]").length, cells.length);
56+
});
57+
58+
it("colorpalette is accessible with AXE", function(done) {
59+
axeRunFixture(done);
60+
});
61+
});
62+
63+
describe("color picker", function() {
64+
beforeEach(function() {
65+
element = $("<input/>").appendTo(Mocha.fixture).kendoColorPicker();
66+
colorPicker = element.data("kendoColorPicker");
67+
});
68+
afterEach(function() {
69+
colorPicker.destroy();
70+
});
71+
72+
it("renders role='textbox' to the wrapper", function() {
73+
var wrapper = colorPicker.wrapper;
74+
75+
assert.equal(wrapper.attr("role"), "textbox");
76+
});
77+
78+
it("renders aria-haspopup='true' to the wrapper", function() {
79+
var wrapper = colorPicker.wrapper;
80+
81+
assert.equal(wrapper.attr("aria-haspopup"), "true");
82+
});
83+
84+
it("render popup with id", function() {
85+
colorPicker.open();
86+
87+
var popup = colorPicker._popup.element;
88+
89+
assert.isOk(popup.attr("id"));
90+
});
91+
92+
it("render aria-owns to the wrapper", function() {
93+
colorPicker.open();
94+
95+
assert.equal(colorPicker.wrapper.attr("aria-owns"), colorPicker._popup.element.attr("id"));
96+
});
97+
98+
it("renders aria-disabled=false", function() {
99+
assert.equal(colorPicker.wrapper.attr("aria-disabled"), "false");
100+
});
101+
102+
it("renders aria-disabled=true", function() {
103+
colorPicker.enable(false);
104+
105+
assert.equal(colorPicker.wrapper.attr("aria-disabled"), "true");
106+
assert.isOk(!colorPicker.wrapper.attr("disabled"));
107+
});
108+
109+
it("renders aria-label to the wrapper", function() {
110+
colorPicker.value("#f9d9ab");
111+
112+
assert.isOk(colorPicker.wrapper.attr("aria-label").indexOf("#f9d9ab") !== -1);
113+
});
114+
115+
it("colorpicker is accessible with AXE", function(done) {
116+
axeRunFixture(done);
117+
});
118+
119+
it("colorpicker popup is accessible with AXE", function(done) {
120+
colorPicker.open();
121+
122+
// excluded rule should be removed after fixing the issue in the slider
123+
axeRun(colorPicker._popup.element, done, ["aria-allowed-role"]);
124+
});
125+
});
126+
127+
describe("flatcolorpicker", function() {
128+
beforeEach(function() {
129+
element = $("<div>").appendTo(Mocha.fixture).kendoFlatColorPicker({
130+
preview: true
131+
});
132+
colorPicker = element.data("kendoFlatColorPicker");
133+
});
134+
afterEach(function() {
135+
colorPicker.destroy();
136+
});
137+
138+
it("renders aria-label to the slider", function() {
139+
var ariaLabel = colorPicker.wrapper.find(".k-hue-slider input").attr("aria-label");
140+
assert.isOk(ariaLabel === "hue saturation");
141+
});
142+
143+
it("renders aria-label to the preview input", function() {
144+
var ariaLabel = colorPicker.wrapper.find(".k-color-value").attr("aria-label");
145+
assert.isOk(ariaLabel === "Color Hexadecimal Code");
146+
});
147+
148+
it("flatcolorpicker is accessible with AXE", function(done) {
149+
// excluded rule should be removed after fixing the issue in the slider
150+
axeRunFixture(done, ["aria-allowed-role"]);
151+
});
152+
});
153+
}());

tests/textbox/api.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,24 @@
113113
textbox.destroy();
114114
assert.equal(input.data("kendoTextBox"), undefined);
115115
});
116+
117+
it("setOptions correctly changes placeholder", function() {
118+
var textbox = new TextBox(input, { placeholder: "Enter value ..." });
119+
120+
textbox.setOptions({ placeholder: "test1" });
121+
assert.equal(textbox.element.attr("placeholder"), "test1");
122+
});
123+
124+
it("setOptions correctly removes floating label", function() {
125+
var textbox = new TextBox(input, {
126+
label: {
127+
content: "Name",
128+
floating: true
129+
}
130+
});
131+
132+
textbox.setOptions({ label: false });
133+
assert.isOk(!textbox.element.closest(".k-floating-label-container").length);
134+
});
116135
});
117136
}());

0 commit comments

Comments
 (0)