Skip to content

Commit 28ca230

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent de166ef commit 28ca230

File tree

11 files changed

+279
-182
lines changed

11 files changed

+279
-182
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.calendar.js

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,13 @@ var __meta__ = { // jshint ignore:line
147147
})
148148
.attr(ID);
149149

150-
if (id) {
151-
that._cellID = id + "_cell_selected";
152-
}
153-
154150
if(that._isMultipleSelection() && that.options.weekNumber) {
155151
element.on(CLICK, WEEKCOLUMNSELECTOR, function(e) {
156152
var first = $(e.currentTarget).closest("tr").find(CELLSELECTORVALID).first(),
157153
last = that.selectable._lastActive = $(e.currentTarget).closest("tr").find(CELLSELECTORVALID).last();
158154
that.selectable.selectRange(first, last, { event: e});
159155
that._current = that._value = toDateObject(last.find("a"));
160-
that._class(FOCUSED, that._current);
156+
that._setCurrent(that._current);
161157
});
162158
}
163159

@@ -182,7 +178,9 @@ var __meta__ = { // jshint ignore:line
182178

183179
that._removeClassProxy = function() {
184180
that._active = false;
185-
that._cell.removeClass(FOCUSED);
181+
if (that._cell) {
182+
that._cell.removeClass(FOCUSED);
183+
}
186184
};
187185

188186
that.value(value);
@@ -462,11 +460,11 @@ var __meta__ = { // jshint ignore:line
462460

463461
if(that.options.selectable === "single") {
464462
if (view === views[options.depth] && that._value && !that.options.disableDates(that._value)) {
465-
that._class("k-state-selected", that._value);
463+
that._selectCell(that._value);
466464
}
467465
}
468466

469-
that._class(FOCUSED, value);
467+
that._setCurrent(value);
470468

471469
if (!from && that._cell) {
472470
that._cell.removeClass(FOCUSED);
@@ -603,7 +601,7 @@ var __meta__ = { // jshint ignore:line
603601

604602
if(that.selectable.options.multiple && target.is(CELLSELECTORVALID)) {
605603
that._current = toDateObject(target.find("a"));
606-
that._class(FOCUSED, toDateObject(target.find("a")));
604+
that._setCurrent(that._current);
607605
}
608606

609607
},
@@ -795,7 +793,7 @@ var __meta__ = { // jshint ignore:line
795793
that._keyboardToggleSelection(e);
796794

797795
var focusedDate = toDateObject($(that._cell[0]).find("a"));
798-
that._class(FOCUSED, focusedDate);
796+
that._setCurrent(focusedDate);
799797

800798
}
801799
} else if(e.shiftKey) {
@@ -860,7 +858,7 @@ var __meta__ = { // jshint ignore:line
860858
}
861859
else {
862860
that._current = currentValue;
863-
that._class(FOCUSED, currentValue);
861+
that._setCurrent(currentValue);
864862
}
865863
}
866864
else {
@@ -896,7 +894,7 @@ var __meta__ = { // jshint ignore:line
896894
return;
897895
}
898896
that.selectable.options.filter = that.wrapper.find("table").length > 1 && +currentValue > +that._current? "table.k-month:eq(1) " + CELLSELECTORVALID: "table.k-month:eq(0) " + CELLSELECTORVALID;
899-
that._class(FOCUSED, currentValue);
897+
that._setCurrent(currentValue);
900898
that._current = currentValue;
901899

902900
that._rangeSelection(that._cellByDate(that._view.toDateString(currentValue), CELLSELECTORVALID), currentValue);
@@ -1056,42 +1054,46 @@ var __meta__ = { // jshint ignore:line
10561054
});
10571055
},
10581056

1059-
_class: function(className, date) {
1057+
_selectCell: function (date) {
10601058
var that = this,
1061-
id = that._cellID,
1062-
cell = that._cell,
1063-
value = that._view.toDateString(date),
1064-
disabledDate;
1059+
cell = that._selectedCell,
1060+
value = that._view.toDateString(date);
10651061

1066-
if (cell && cell.length) {
1067-
cell[0].removeAttribute(ARIA_SELECTED);
1068-
cell[0].removeAttribute(ARIA_LABEL);
1069-
cell[0].removeAttribute(ID);
1070-
//.removeClass(className);
1071-
}
1062+
if (cell && cell[0]) {
1063+
cell[0].removeAttribute(ARIA_SELECTED);
1064+
cell.removeClass(SELECTED);
1065+
}
10721066

1073-
if (date && that._view.name == "month") {
1074-
disabledDate = that.options.disableDates(date);
1075-
}
1076-
that._cellsBySelector(that._isMultipleSelection() ? CELLSELECTOR: "td:not(." + OTHERMONTH + ")").removeClass(className);
1077-
cell = that._cellByDate(value, that.options.selectable == "multiple" ? CELLSELECTOR: "td:not(." + OTHERMONTH + ")")
1078-
.attr(ARIA_SELECTED, true);
1067+
cell = that._cellByDate(value, that.options.selectable == "multiple" ? CELLSELECTOR: "td:not(." + OTHERMONTH + ")");
10791068

1080-
if (className === FOCUSED && !that._active && that.options.focusOnNav !== false || disabledDate) {
1081-
className = "";
1082-
}
1069+
that._selectedCell = cell;
1070+
cell.addClass(SELECTED)
1071+
.attr(ARIA_SELECTED, true);
1072+
},
10831073

1084-
cell.addClass(className);
1074+
_setCurrent: function (date) {
1075+
var that = this,
1076+
id = kendo.guid(),
1077+
cell = that._cell,
1078+
value = that._view.toDateString(date);
1079+
1080+
if (cell && cell[0]) {
1081+
cell.removeClass(FOCUSED);
1082+
cell[0].removeAttribute(ARIA_LABEL);
1083+
cell[0].removeAttribute(ID);
1084+
}
1085+
1086+
cell = that._cellByDate(value, that.options.selectable == "multiple" ? CELLSELECTOR: "td:not(." + OTHERMONTH + ")");
10851087

1086-
if (cell[0]) {
10871088
that._cell = cell;
1088-
}
10891089

1090-
if (id) {
1091-
cell.attr(ID, id);
1092-
that._table[0].removeAttribute("aria-activedescendant");
1093-
that._table.attr("aria-activedescendant", id);
1094-
}
1090+
cell.attr(ID, id)
1091+
.addClass(FOCUSED);
1092+
1093+
if (that._table[0]) {
1094+
that._table[0].removeAttribute("aria-activedescendant");
1095+
that._table.attr("aria-activedescendant", id);
1096+
}
10951097
},
10961098

10971099
_bindTable: function (table) {
@@ -1125,7 +1127,7 @@ var __meta__ = { // jshint ignore:line
11251127
that.navigate(value);
11261128
} else {
11271129
that._current = value;
1128-
that._class(FOCUSED, value);
1130+
that._setCurrent(value);
11291131
}
11301132
},
11311133

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.numerictextbox.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var __meta__ = { // jshint ignore:line
3535
HOVER = "k-state-hover",
3636
FOCUS = "focus",
3737
POINT = ".",
38+
SYMBOL = "symbol",
3839
CLASS_ICON = "k-icon",
3940
LABELCLASSES = "k-label k-input-label",
4041
SELECTED = "k-state-selected",
@@ -421,7 +422,7 @@ var __meta__ = { // jshint ignore:line
421422

422423
if (group) {
423424
groupRegExp = new RegExp("\\" + group, "g");
424-
extractRegExp = new RegExp("(^(-)$)|(^(-)?([\\d\\" + group + "]+)(\\" + format[POINT] + ")?(\\d+)?)");
425+
extractRegExp = new RegExp("(-)?(" + format[SYMBOL] + ")?([\\d\\" + group + "]+)(\\" + format[POINT] + ")?(\\d+)?");
425426
}
426427

427428
if (extractRegExp) {

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/calendar/aria.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ it("Calendar sets id to the selected cell", function() {
9494
instance.value(new Date(2000, 10, 10));
9595
instance.value(new Date(2000, 10, 20));
9696

97-
assert.equal(instance._table.find("td[aria-selected=true]").attr("id"), "test_cell_selected");
97+
assert.isOk(instance._table.find("td[aria-selected=true]").last().attr("id"));
9898
});
9999

100100
it("Calendar has only one cell with id", function() {

tests/calendar/navigation.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@
6666
assert.equal(div.find("td.k-state-focused").text(), date.getDate() + "");
6767
});
6868

69+
it("navigating to a new date does not remove selected attributes", function() {
70+
var event = { keyCode: keys.RIGHT, preventDefault: $.noop },
71+
date = new Date(2021, 11, 1),
72+
date2 = new Date(2021, 11, 2),
73+
selectedCell;
74+
75+
calendar.value(date);
76+
77+
calendar._move(event);
78+
79+
assert.deepEqual(calendar.current(), date2);
80+
assert.equal(div.find("td.k-state-focused").text(), date2.getDate() + "");
81+
82+
selectedCell = div.find("td.k-state-selected");
83+
assert.equal(selectedCell.text(), date.getDate() + "");
84+
assert.equal(selectedCell.attr("aria-selected"), "true");
85+
});
86+
6987
it("navigate should not _move selection if value is less than min", function() {
7088
var event = { keyCode: keys.LEFT, preventDefault: $.noop },
7189
date = new Date(2000, 11, 1);

0 commit comments

Comments
 (0)