Skip to content

Commit ec48ad2

Browse files
committed
Sync with Kendo UI Professional
1 parent 6f64d0e commit ec48ad2

File tree

12 files changed

+125
-107
lines changed

12 files changed

+125
-107
lines changed

package-lock.json

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"version": "1.0.0",
1212
"devDependencies": {
1313
"@progress/kendo-svg-icons": "4.5.0",
14-
"@progress/kendo-theme-bootstrap": "12.2.0",
15-
"@progress/kendo-theme-classic": "12.2.0",
16-
"@progress/kendo-theme-core": "12.2.0",
17-
"@progress/kendo-theme-default": "12.2.0",
18-
"@progress/kendo-theme-fluent": "12.2.0",
19-
"@progress/kendo-theme-material": "12.2.0",
20-
"@progress/kendo-theme-utils": "12.2.0",
14+
"@progress/kendo-theme-bootstrap": "12.2.2",
15+
"@progress/kendo-theme-classic": "12.2.2",
16+
"@progress/kendo-theme-core": "12.2.2",
17+
"@progress/kendo-theme-default": "12.2.2",
18+
"@progress/kendo-theme-fluent": "12.2.2",
19+
"@progress/kendo-theme-material": "12.2.2",
20+
"@progress/kendo-theme-utils": "12.2.2",
2121
"@progress/wct-a11y-spec": "^2.0.9",
2222
"@rollup/plugin-node-resolve": "^13.3.0",
2323
"@rollup/plugin-virtual": "^2.1.0",

src/kendo.autocomplete.js

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,10 @@ export const __meta__ = {
103103
.on("input" + ns, that._search.bind(that))
104104
.on("paste" + ns, that._search.bind(that))
105105
.on("focus" + ns, function(e) {
106-
if (that._hasActionSheet()) {
107-
that.element.attr("readonly", true);
108-
} else if (!that.options.readonly) {
109-
that.element.removeAttr("readonly");
110-
}
111106
that._prev = that._accessor();
112107
that._oldText = that._prev;
113108
that._placeholder(false);
109+
114110
wrapper.addClass(FOCUSED);
115111
})
116112
.on("focusout" + ns, function(ev) {
@@ -214,7 +210,13 @@ export const __meta__ = {
214210

215211
that._unboundClick = true;
216212
that.element
217-
.on("click", function() { that.popup.toggle(); });
213+
.on("click", function() {
214+
if (that._isEnabled()) {
215+
that.popup.toggle();
216+
} else {
217+
that.popup.close();
218+
}
219+
});
218220

219221
if (that.filterInput) {
220222
that.filterInput
@@ -229,28 +231,25 @@ export const __meta__ = {
229231
});
230232

231233
that.popup.bind("activate", () => {
232-
// that.wrapper.off("focusout");
233234
that.filterInput.val(that.element.val());
234235
that.filterInput.trigger("focus");
235236
});
236237
that.popup.bind("deactivate", () => {
237-
// that.wrapper.on("focusout", function(ev) {
238-
// if ((that.filterInput && ev.relatedTarget === that.filterInput[0]) || !that.wrapper.hasClass(FOCUSED)) {
239-
// return;
240-
// }
241-
242-
// that._change();
243-
// that._placeholder();
244-
// that.close();
245-
// that.wrapper.removeClass(FOCUSED);
246-
// });
247-
248-
// that.wrapper.focus();
249238
that.element.trigger("focus");
250239
});
251240
}
252241
},
253242

243+
_isEnabled: function() {
244+
const that = this;
245+
const element = that.element;
246+
247+
const isReadonly = element.prop(READONLY) || Boolean(that.element.attr("readonly"));
248+
const isDisabled = element.prop(DISABLED) || Boolean(that.element.attr("disabled"));
249+
250+
return !isDisabled && !isReadonly;
251+
},
252+
254253
_onCloseButtonPressed: function() {
255254
var that = this;
256255

@@ -720,6 +719,9 @@ export const __meta__ = {
720719
that._last = key;
721720

722721
if (key === keys.DOWN) {
722+
if (!that._isEnabled()) {
723+
return;
724+
}
723725
if (visible) {
724726
this._move(current ? "focusNext" : "focusFirst");
725727
} else if (that.value()) {
@@ -737,6 +739,9 @@ export const __meta__ = {
737739
}
738740
e.preventDefault();
739741
} else if (key === keys.ESC ) {
742+
if (!that._isEnabled()) {
743+
return;
744+
}
740745
if (visible) {
741746
e.preventDefault();
742747
that.close();

src/kendo.combobox.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,16 @@ export const __meta__ = {
236236
Select.fn.destroy.call(that);
237237
},
238238

239+
_isEnabled: function() {
240+
const that = this;
241+
const element = that.element;
242+
243+
const isReadonly = element.prop(READONLY) || Boolean(that.element.attr("readonly"));
244+
const isDisabled = element.prop(DISABLED) || Boolean(that.element.attr("disabled"));
245+
246+
return !isDisabled && !isReadonly;
247+
},
248+
239249
_popup: function() {
240250
const that = this;
241251
Select.fn._popup.call(this);
@@ -343,16 +353,18 @@ export const __meta__ = {
343353
},
344354

345355
_arrowClick: function() {
346-
this._toggle();
356+
const that = this;
357+
358+
if (that._isEnabled()) {
359+
that._toggle();
360+
} else {
361+
that._toggle(false);
362+
}
347363
},
348364

349365
_inputFocus: function() {
350366
const that = this;
351-
if (that._hasActionSheet()) {
352-
that.input.attr("readonly", true);
353-
} else if (!that.options.readonly) {
354-
that.input.removeAttr("readonly");
355-
}
367+
356368
that.wrapper.addClass(FOCUSED);
357369
that._placeholder(false);
358370
},

src/kendo.multiselect.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,6 @@ export const __meta__ = {
459459

460460
_inputFocus: function() {
461461
const that = this;
462-
if (that._hasActionSheet()) {
463-
that.input.attr("readonly", true);
464-
} else if (!that.options.readonly) {
465-
that.input.removeAttr("readonly");
466-
}
467462
that._placeholder(false, true);
468463
that.wrapper.addClass(FOCUSEDCLASS);
469464
},

src/messages/kendo.messages.en-US.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,19 @@ if (kendo.ui.MultiSelect) {
17961796
if (kendo.ui.Chat) {
17971797
kendo.ui.Chat.prototype.options.messages =
17981798
$.extend(true, kendo.ui.Chat.prototype.options.messages,{
1799-
"messageListLabel": "Message list",
1800-
"placeholder": "Type a message...",
1801-
"toggleButton": "Toggle toolbar",
1802-
"sendButton": "Send message"
1799+
"messageListLabel": "Message list",
1800+
"placeholder": "Type a message...",
1801+
"sendButton": "Send message",
1802+
"speechToTextButton": "Toggle speech to text",
1803+
"fileButton": "Attach file",
1804+
"downloadAll": "Download all",
1805+
"selfMessageDeleted": "You removed this message.",
1806+
"otherMessageDeleted": "This message was removed by its sender.",
1807+
"stopGeneration": "Stop generation",
1808+
"messageBoxLabel": "Type your message here",
1809+
"pinnedMessageCloseButton": "Unpin message",
1810+
"replyMessageCloseButton": "Remove reply",
1811+
"fileMenuButton": "File menu"
18031812
});
18041813
}
18051814

src/messages/kendo.messages.zh-CN.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,15 +1583,6 @@
15831583
});
15841584
}
15851585

1586-
if (kendo.chat.ChatView) {
1587-
kendo.chat.ChatView.prototype.options.messages =
1588-
$.extend(true, kendo.chat.ChatView.prototype.options.messages, {
1589-
"isTyping": " 正在输入...",
1590-
"areTyping": " 正在输入...",
1591-
"and": " 和 "
1592-
});
1593-
}
1594-
15951586
/* Switch messages */
15961587
if (kendo.ui.Switch) {
15971588
kendo.ui.Switch.prototype.options.messages =

src/messages/kendo.messages.zh-HK.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,15 +1583,6 @@
15831583
});
15841584
}
15851585

1586-
if (kendo.chat.ChatView) {
1587-
kendo.chat.ChatView.prototype.options.messages =
1588-
$.extend(true, kendo.chat.ChatView.prototype.options.messages, {
1589-
"isTyping": " 正在輸入...",
1590-
"areTyping": " 正在輸入...",
1591-
"and": " 和 "
1592-
});
1593-
}
1594-
15951586
/* Switch messages */
15961587
if (kendo.ui.Switch) {
15971588
kendo.ui.Switch.prototype.options.messages =

src/messages/kendo.messages.zh-TW.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,15 +1583,6 @@
15831583
});
15841584
}
15851585

1586-
if (kendo.chat.ChatView) {
1587-
kendo.chat.ChatView.prototype.options.messages =
1588-
$.extend(true, kendo.chat.ChatView.prototype.options.messages, {
1589-
"isTyping": " 正在輸入...",
1590-
"areTyping": " 正在輸入...",
1591-
"and": " 和 "
1592-
});
1593-
}
1594-
15951586
/* Switch messages */
15961587
if (kendo.ui.Switch) {
15971588
kendo.ui.Switch.prototype.options.messages =

tests/unit/autocomplete/initialization.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,14 @@ describe("kendo.ui.AutoComplete initialization", function() {
610610
assert.equal(autocomplete.header, null);
611611
});
612612

613+
it("readonly method sets input to readonly", function() {
614+
let autocomplete = new AutoComplete(input);
615+
autocomplete.readonly(true);
616+
autocomplete.element.focus();
617+
618+
assert.include(["readonly", "true"], autocomplete.element.attr("readonly"));
619+
});
620+
613621
it("AutoComlete is disabled when placed in disabled fieldset", function() {
614622
$(input).wrap('<fieldset disabled="disabled"></fieldset>');
615623
input.kendoAutoComplete().data("kendoAutoComplete");

0 commit comments

Comments
 (0)