Skip to content

Commit

Permalink
Sync with Kendo UI Professional
Browse files Browse the repository at this point in the history
  • Loading branch information
Kendo Bot committed Apr 4, 2020
1 parent 9eef2e0 commit 2d630bf
Show file tree
Hide file tree
Showing 25 changed files with 1,083 additions and 891 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "year": 2020, "release": 1, "servicePack": "next", "servicePackNumber": 1 }
{ "year": 2020, "release": 1, "servicePack": "next", "servicePackNumber": 2 }
23 changes: 23 additions & 0 deletions docs/api/javascript/ui/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -6191,6 +6191,29 @@ Defines the text of the "Save Changes" button located in the toolbar of the widg
});
</script>

### messages.commands.search `String` *(default: "Search...")*

Allows the customization of the placeholder text in the grid search panel.

#### Example

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
messages: {
commands: {
search: "Look for..."
}
},
dataSource: [ { name: "Jane", age: 30 }, { name: "John", age: 33 }],
toolbar:["search"]
});
</script>

### messages.commands.update `String`

Defines the text of the "Update" button that is rendered in `inline` or `popup` editing mode.
Expand Down
23 changes: 23 additions & 0 deletions docs/api/javascript/ui/treelist.md
Original file line number Diff line number Diff line change
Expand Up @@ -2960,6 +2960,29 @@ Defines the text of the **Save Changes** button that saves modifed data rows.
});
</script>

### messages.commands.search `String` *(default: "Search...")*

Allows the customization of the placeholder text in the treelist search panel.

#### Example

<div id="treeList"></div>
<script>
$("#treeList").kendoTreeList({
columns: [ "name", "age" ],
dataSource: [
{ id: 1, parentId: null, name: "Jane Doe", age: 22 },
{ id: 2, parentId: 1, name: "John Doe", age: 24 }
],
toolbar:["search"],
messages: {
commands: {
search: "Look for..."
}
}
});
</script>

### messages.commands.cancel `String` *(default: "Cancel Changes")*

Defines the text of the **Cancel Changes** button that cancels all data modifications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ The following table provides a list of the keyboard shortcuts the Spreadsheet su
| `Ctrl` + select rows or columns | Selects a range of adjacent or nonadjacent rows or columns. To simultaneously select more than one range of rows or columns, repeat this command. The selected ranges can also overlap. |
| `Esc` | Cancels an entry in a cell or in the **Formula Bar** |
| `Arrow` keys | Move a cell up, down, left, or right in a worksheet |
| `Ctrl` + `Arrow` key | Moves to the edge of the current data region of the active worksheet |
| `Ctrl` + `Arrow` key | Navigates to the last cell of the current series of data. If there is another set of data afterwards, the first cell of the new series will be selected. Otherwise, you will be navigated to the last cell of the worksheet in the corresponding direction |
| `Shift` + `Arrow` key | Selects (a range of) adjacent cells, rows, or columns, by extending the selection by one cell, row, or column |
| `Ctrl` + `Shift` + `Arrow` key | Extends the selection of cells to the last nonblank cell in the same row or column as the active cell |
| `Down Arrow` / `Up Arrow` key | <ul><li>Selects the next or previous command when a menu or submenu is open</li> <li>In a dialog box, the arrow keys move between options in an active drop-down list, or between options in a group of options</li></ul> |
| `Backspace` | <ul><li>Deletes one character to the left in the **Formula Bar**</li> <li>Removes the content of the active cell</li> <li>In cell editing mode, it deletes the character to the left of the insertion point</li></ul> |
| `Delete` | <ul><li>Removes the content from selected cells without affecting cell formats</li> <li>In cell editing mode, it deletes the character to the right of the insertion point</li></ul> |
| `End` | <ul><li>Goes to the far right cell of the active row</li> <li>Selects the last command on a visible and active menu or submenu</li></ul>
| `Ctrl` + `End` | <ul><li>Moves to the last cell on a worksheet, in the lowest used row of the used column on the far right</li> <li>If the cursor is in the formula bar, `Ctrl` + `End` moves the cursor to the end of the text</li> <li>`Ctrl` + `End` moves to the last cell on a worksheet, in the lowest used row of the used column on the far right</li></ul> |
| `Ctrl` + `Shift` + `End` | <ul><li>Extends the selection of cells to the last used cell on the worksheet located in lower-right corner</li> <li>If the cursor is in the formula bar, `Ctrl` + `Shift` + `End` selects all text in the formula bar from the cursor position to the end</li></ul> |
| `Enter` | <ul><li>Completes a cell entry from the cell or the **Formula Bar**, and selects the cell below</li> <li>In a data form, it moves to the first field in the next record</li> <li>Opens a selected menu or performs the action for a selected command</li> <li>In a dialog box, it performs the action for the default command button in the dialog box (the button with the bold outline)</li></ul> |
| `Esc` | <ul><li>Cancels an entry in the cell or **Formula Bar**</li> <li>Closes an open menu or submenu, dialog box, or message window</li></ul> |
| `Home` | <ul><li>Moves to the beginning of a row in a worksheet</li> <li>Selects the first command on the menu when a menu or submenu is visible</li></ul> |
| `Ctrl` + `Home` | Moves to the beginning of a worksheet |
| `Ctrl` + `Shift` + `Arrow` key | Extends the selection of cells to the last cell of the current series of data. If there is another set of data afterwards, the cell selection will be extended to the first cell of the new series of data. Otherwise, the cell selection will be extended to the last cell of the worksheet in the corresponding direction |
| `Down Arrow` / `Up Arrow` key | <ul><li>In a menu or a submenu, selects the next or previous command</li> <li>In a dialog box, the arrow keys move between options in an active drop-down list, or between options in a group of options</li></ul> |
| `Backspace` | <ul><li>In the Formula bar, it deletes one character to the left from the formula text</li> <li>In cell selection mode, it removes the content of the active cell</li> <li>In cell editing mode, it deletes the character to the left of the insertion point</li></ul> |
| `Delete` | <ul><li>In the Formula bar, it deletes the character to the right of the insertion point from the formula text</li><li>In cell selection mode, it removes the content from selected cells without affecting cell formats</li> <li>In cell editing mode, it deletes the character to the right of the insertion point</li></ul> |
| `End` | <ul><li>In cell selection mode, moves to the far right cell of the active row</li> <li>In a menu or submenu, selects the last command</li></ul>
| `Ctrl` + `End` | <ul><li>In cell selection mode, moves to the last cell on a worksheet, in the lowest used row of the used column on the bottom-right</li> <li>In the formula bar, `Ctrl` + `End` moves the cursor to the end of the text</li> </ul> |
| `Ctrl` + `Shift` + `End` | <ul><li>In cell selection mode, extends the selection of cells to the last cell on the worksheet located in lower-right corner</li> <li>In the formula bar, `Ctrl` + `Shift` + `End` selects all text in the formula bar from the cursor position to the end</li></ul> |
| `Enter` | <ul><li>In cell editing mode or in the **Formula bar**, completes a cell entry and selects the cell below</li> <li>In a data form, it moves to the first field in the next record</li> <li>In the command toolbar, opens a selected menu or performs the action for a selected command</li> <li>In a dialog box, it performs the action for the default command button in the dialog box (the button with the bold outline)</li></ul> |
| `Esc` | <ul><li>In cell editing mode or in the **Formula bar**, cancels an entry in the cell or **Formula Bar**</li> <li>Closes an open menu or submenu, dialog box, or message window</li></ul> |
| `Home` | <ul><li>In cell selection mode, moves to the beginning of a row in a worksheet</li> <li>In a menu or submenu, selects the first command</li></ul> |
| `Ctrl` + `Home` | <ul><li>In cell selection mode, moves to the first cell (the top-left cell) on a worksheet</li> <li>In the formula bar, `Ctrl` + `Home` moves the cursor to the beginning of the text</li> </ul> |
| `Ctrl` + `Shift` + `Home` | Extends the selection of cells to the beginning of the worksheet |
| `Page Down` | Moves one screen down in a worksheet |
| `Page Up` | Moves one screen up in a worksheet |
| `Spacebar` | In a dialog box, performs the action for the selected button, or selects or clears a check box |
| `Alt` + `Spacebar` | Displays the **Control** menu for the Spreadsheet window |
| `Tab` | <ul><li>Moves one cell to the right in a worksheet</li> <li>Moves to the next option or option group in a dialog box</li> <li>Moves a cell within an active range of cells, rows, or columns.</li><li>If the currently active cell is the last cell in the Sheet (the cell on the last row in the last column), pressing `Tab` will move the focus outside of the Spreadsheet to the next focusable element on the page.</li></ul> |
| `Shift` + `Tab` | <ul><li>Moves to the previous cell in a worksheet or the previous option in a dialog box.</li><li><li>If the currently active cell is the first cell in the Sheet (the cell on the first row in the first column), pressing `Shift` + `Tab` will move the focus outside of the Sheet to the Named ranges ComboBox on the Spreadsheet Toolbar.</li></li></ul> |
| `Tab` | <ul><li>In cell selection mode, moves one cell to the right in a worksheet.</li> <li>In a dialog box, moves to the next option or option group in a dialog box</li> <li>In range selection of cells, rows or columns, moves to the next cell within the active range. If the focus is on the last cell (the bottom-right cell) in the range, the focus will return to the first cell on the top-left</li><li>If the currently active cell is the last cell in the Sheet (the cell on the last row in the last column), pressing `Tab` will move the focus outside of the Spreadsheet to the next focusable element on the page.</li></ul> |
| `Shift` + `Tab` | <ul><li>In cell selection mode, moves one cell to the right in a worksheet</li> <li>In a dialog box, moves to the next option or option group in a dialog box</li> <li>In range selection of cells, rows or columns, moves to the previous cell within the active range. If the focus is on the first cell (the top-left cell) in the range, the focus will return to the last cell on the bottom-right</li> <li><li>If the currently active cell is the first cell in the Sheet (the cell on the first row in the first column), pressing `Shift` + `Tab` will move the focus outside of the Sheet to the Named ranges ComboBox on the Spreadsheet Toolbar.</li></li></ul> |

When the focus is within the Spreadsheet Sheet, fast way to navigate away from the Spreadsheet is to press `Ctrl` + `End` (to move the focus to the last cell on the Sheet) and the `Tab`. Similarly, to move the focus from the Sheet to the Spreadsheet Toolbar, press `Ctrl` + `Home` and then `Shift` + `Tab`.

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"@progress/kendo-theme-bootstrap": "^4.0.0",
"@progress/kendo-theme-default": "^4.0.0",
"@progress/kendo-theme-material": "^3.0.0",
"@progress/kendo-theme-bootstrap": "4.10.2",
"@progress/kendo-theme-default": "4.12.2",
"@progress/kendo-theme-material": "3.10.2",
"amd-optimize": "0.6.1",
"autoprefixer": "^9.1.5",
"bootstrap": "^4.0.0",
Expand Down
84 changes: 32 additions & 52 deletions src/kendo.pager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var __meta__ = { // jshint ignore:line
KEYDOWN = "keydown",
DISABLED = "disabled",
MOUSEDOWN = "down",
DOCUMENT_ELEMENT = $(document.documentElement),
MAX_VALUE = Number.MAX_VALUE,
iconTemplate = kendo.template('<a href="\\#" aria-label="#=text#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #"></span></a>');

Expand All @@ -39,14 +40,6 @@ var __meta__ = { // jshint ignore:line
});
}

function selectOption(template, idx, text, selected) {
return template( {
idx: idx,
text: text || idx,
selected: selected || false
});
}

function icon(className, text, wrapClassName) {
return iconTemplate({
className: className.substring(1),
Expand Down Expand Up @@ -91,7 +84,6 @@ var __meta__ = { // jshint ignore:line
that.linkTemplate = kendo.template(that.options.linkTemplate);
that.selectTemplate = kendo.template(that.options.selectTemplate);
that.currentPageTemplate = kendo.template(that.options.currentPageTemplate);
that.numericSelectItemTemplate = kendo.template(that.options.numericSelectItemTemplate);

page = that.page();
totalPages = that.totalPages();
Expand All @@ -100,7 +92,6 @@ var __meta__ = { // jshint ignore:line

that.dataSource.bind(CHANGE, that._refreshHandler);
that.downEvent = kendo.applyEventMap(MOUSEDOWN, kendo.guid());

if (options.previousNext) {
if (!that.element.find(FIRST).length) {
that.element.append(icon(FIRST, options.messages.first, "k-pager-first"));
Expand All @@ -116,33 +107,16 @@ var __meta__ = { // jshint ignore:line
}

if (options.numeric) {
if (!that._numericWrap) {
that._numericWrap = that.element.find(".k-pager-numbers-wrap");

if (that._numericWrap.length === 0) {
that._numericWrap = $("<div class='k-pager-numbers-wrap' />").appendTo(that.element);
}
}

if (!that._numericSelect) {
that._numericSelect = that._numericWrap.find(".k-dropdown");

if (that._numericSelect.length === 0) {
that._numericSelect = $("<select class='k-dropdown' />").appendTo(that._numericWrap);
}
}

if (!that.list) {
that.list = that._numericWrap.find(".k-pager-numbers");
that.list = that.element.find(".k-pager-numbers");

if (that.list.length === 0) {
that.list = $('<ul class="k-pager-numbers" />').appendTo(that._numericWrap);
}
if (!that.list.length) {
that.list = $('<ul class="k-pager-numbers k-reset" />').appendTo(that.element);
}

if (options.dataSource && !options.dataSource.total()) {
that._numericSelect.empty().append("<option value='0' />");
that.list.empty().append(that.selectTemplate({ text: 0 }));
that.list.empty().append(that.currentPageTemplate({ text: 0 })).append(that.selectTemplate({ text: 0 }));
}
if (!that.list.parent().hasClass("k-pager-numbers-wrap")) {
that.list.wrap('<div class="k-pager-numbers-wrap"></div>');
}
}

Expand Down Expand Up @@ -215,9 +189,10 @@ var __meta__ = { // jshint ignore:line

that.element
.on(CLICK + NS , "a", proxy(that._click, that))
.on(CHANGE + NS , "select.k-dropdown", proxy(that._numericSelectChange, that))
.addClass("k-pager-wrap k-widget k-floatwrap");

that.element.on(CLICK + NS , ".k-current-page", proxy(that._toggleActive, that));

if (options.autoBind) {
that.refresh();
}
Expand All @@ -226,7 +201,6 @@ var __meta__ = { // jshint ignore:line
$(window).on("resize" + NS, that._resizeHandler);

sizeClassName = that._getWidthSizeClass(that.element.width());

if (sizeClassName) {
that.element.addClass(sizeClassName);
}
Expand Down Expand Up @@ -257,8 +231,6 @@ var __meta__ = { // jshint ignore:line
selectTemplate: '<li><span class="k-link k-state-selected">#=text#</span></li>',
currentPageTemplate: '<li class="k-current-page"><span class="k-link k-pager-nav">#=text#</span></li>',
linkTemplate: '<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',
numericItemTemplate: '<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',
numericSelectItemTemplate: '<option value="#= idx #" #if (selected) {# selected="selected" #}#>#= text #</option>',
buttonCount: 10,
autoBind: true,
numeric: true,
Expand Down Expand Up @@ -322,16 +294,15 @@ var __meta__ = { // jshint ignore:line
reminder,
page = that.page(),
html = "",
selectHtml = "",
options = that.options,
pageSize = that.pageSize(),
collapsedTotal = that._collapsedTotal(),
total = that.dataSource.total(),
totalPages = that.totalPages(),
linkTemplate = that.linkTemplate,
numericSelectItemTemplate = that.numericSelectItemTemplate,
buttonCount = options.buttonCount;

DOCUMENT_ELEMENT.unbind(that.downEvent, $.proxy(that._hideList, that));
if (e && e.action == "itemchange") {
return;
}
Expand All @@ -340,33 +311,31 @@ var __meta__ = { // jshint ignore:line

if (page > buttonCount) {
reminder = (page % buttonCount);

start = (reminder === 0) ? (page - buttonCount) + 1 : (page - reminder) + 1;
}

end = Math.min((start + buttonCount) - 1, totalPages);

if (start > 1) {
html += button(linkTemplate, start - 1, "...", false, options.messages.morePages);
selectHtml += selectOption(numericSelectItemTemplate, start - 1, options.messages.morePages);
}

for (idx = start; idx <= end; idx++) {
html += button(idx == page ? that.selectTemplate : linkTemplate, idx, idx, true);
selectHtml += selectOption(numericSelectItemTemplate, idx, idx, idx == page);
}

if (end < totalPages) {
html += button(linkTemplate, idx, "...", false, options.messages.morePages);
selectHtml += selectOption(numericSelectItemTemplate, idx, options.messages.morePages);
}

if (html === "") {
html = that.selectTemplate({ text: 0 });
selectHtml = $("<option value='0' />");
}

that.list.html(html);
that._numericSelect.html(selectHtml);
html = this.currentPageTemplate({ text: page }) + html;

that.list.removeClass("k-state-expanded").html(html);
}

if (options.info) {
Expand Down Expand Up @@ -463,14 +432,25 @@ var __meta__ = { // jshint ignore:line
}
},

_numericSelectChange: function(e) {
var target = e.currentTarget;
var value = target.value;
var page = parseInt(value, 10);
_toggleActive: function() {
var that = this;

if (that.list.hasClass("k-state-expanded")) {
DOCUMENT_ELEMENT.unbind(that.downEvent, $.proxy(that._hideList, that));
} else {
DOCUMENT_ELEMENT.bind(that.downEvent, $.proxy(that._hideList, that));
}
that.list.toggleClass("k-state-expanded");
},

target.blur();
_hideList: function(e) {
var that = this,
target = kendo.eventTarget(e);

this.page(page);
if (!$.contains(that.list[0], target)) {
DOCUMENT_ELEMENT.unbind(that.downEvent, $.proxy(that._hideList, that));
that.list.removeClass("k-state-expanded");
}
},

_click: function(e) {
Expand Down
Loading

0 comments on commit 2d630bf

Please sign in to comment.