@progress/kendo-react-grid 5.1.0-dev.202202230642 → 5.1.0-dev.202202230917

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,13 +74,13 @@ var GridFilterCell = /** @class */ (function (_super) {
74
74
  var _this = this;
75
75
  switch (filterType) {
76
76
  case 'numeric':
77
- return (React.createElement(NumericTextBox, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title }));
77
+ return (React.createElement(NumericTextBox, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));
78
78
  case 'date':
79
- return (React.createElement(DatePicker, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title }));
79
+ return (React.createElement(DatePicker, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));
80
80
  case 'boolean':
81
81
  var noFilterSet_1 = function (filter) { return filter === null || filter === undefined; };
82
- return (React.createElement(DropDownList, { onChange: this.boolDropdownChange, value: booleanValues.find(function (item) { return item.operator === (noFilterSet_1(value) ? '' : value); }), data: booleanValues, textField: "text", title: this.props.title }));
83
- default: return (React.createElement(Input, { value: value || '', onChange: function (e) { _this.inputChange(e.target.value, e.syntheticEvent); }, title: this.props.title }));
82
+ return (React.createElement(DropDownList, { onChange: this.boolDropdownChange, value: booleanValues.find(function (item) { return item.operator === (noFilterSet_1(value) ? '' : value); }), data: booleanValues, textField: "text", title: this.props.title, ariaLabel: this.props.ariaLabel }));
83
+ default: return (React.createElement(Input, { value: value || '', onChange: function (e) { _this.inputChange(e.target.value, e.syntheticEvent); }, title: this.props.title, "aria-label": this.props.ariaLabel }));
84
84
  }
85
85
  };
86
86
  return GridFilterCell;
@@ -11,7 +11,9 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { Keys } from '@progress/kendo-react-common';
13
13
  import { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';
14
+ import { useLocalization } from '@progress/kendo-react-intl';
14
15
  import * as React from 'react';
16
+ import { messages, groupCollapse, groupExpand } from '../messages';
15
17
  /**
16
18
  * @hidden
17
19
  */
@@ -20,6 +22,7 @@ export var GridGroupCell = function (props) {
20
22
  var columnIndex = props.columnIndex, level = props.level, columnsCount = props.columnsCount, rowType = props.rowType, dataItem = props.dataItem, field = props.field, onChange = props.onChange, expanded = props.expanded, render = props.render, dataIndex = props.dataIndex, ariaColumnIndex = props.ariaColumnIndex;
21
23
  var definedField = field || '';
22
24
  var navigationAttributes = useTableKeyboardNavigation(props.id);
25
+ var localization = useLocalization();
23
26
  var onKeyDownHandler = React.useCallback(function (event) {
24
27
  if (event.isDefaultPrevented()) {
25
28
  return;
@@ -40,6 +43,8 @@ export var GridGroupCell = function (props) {
40
43
  defaultRendering = (React.createElement("td", { style: props.style, key: 'g' + columnIndex, className: "k-group-cell", role: "presentation" }));
41
44
  }
42
45
  else if (columnIndex <= level) {
46
+ var baseMessage = expanded ? groupCollapse : groupExpand;
47
+ var message = localization.toLanguageString(baseMessage, messages[baseMessage]);
43
48
  defaultRendering = (React.createElement("td", __assign({ style: props.style, key: 'g-colspan', colSpan: columnsCount - columnIndex, role: 'gridcell', "aria-selected": false, "aria-expanded": expanded, "aria-colindex": ariaColumnIndex, onKeyDown: onKeyDownHandler }, navigationAttributes),
44
49
  React.createElement("p", { className: "k-reset" },
45
50
  React.createElement("a", { onClick: function (e) {
@@ -53,7 +58,7 @@ export var GridGroupCell = function (props) {
53
58
  value: !expanded
54
59
  });
55
60
  }
56
- }, href: "#", tabIndex: -1, className: expanded ? 'k-i-collapse k-icon' : 'k-i-expand k-icon' }),
61
+ }, href: "#", tabIndex: -1, "aria-label": message, className: expanded ? 'k-i-collapse k-icon' : 'k-i-expand k-icon' }),
57
62
  ((dataItem[definedField] instanceof Date) && dataItem[definedField].toString) ?
58
63
  dataItem[definedField].toString() :
59
64
  dataItem[definedField])));
@@ -12,7 +12,9 @@ var __assign = (this && this.__assign) || function () {
12
12
  import * as React from 'react';
13
13
  import { getNestedValue } from './../utils';
14
14
  import { useTableKeyboardNavigation } from '@progress/kendo-react-data-tools';
15
+ import { useLocalization } from '@progress/kendo-react-intl';
15
16
  import { Keys } from '@progress/kendo-react-common';
17
+ import { detailCollapse, detailExpand, messages } from '../messages';
16
18
  /**
17
19
  * @hidden
18
20
  */
@@ -20,6 +22,7 @@ export var GridHierarchyCell = function (props) {
20
22
  var defaultRendering = null;
21
23
  var expanded = getNestedValue(props.field, props.dataItem);
22
24
  var navigationAttributes = useTableKeyboardNavigation(props.id);
25
+ var localization = useLocalization();
23
26
  var onKeyDownHandler = React.useCallback(function (event) {
24
27
  if (event.isDefaultPrevented()) {
25
28
  return;
@@ -40,6 +43,8 @@ export var GridHierarchyCell = function (props) {
40
43
  }
41
44
  else if (props.rowType !== 'groupHeader') {
42
45
  var className = expanded ? 'k-icon k-i-minus' : 'k-icon k-i-plus';
46
+ var baseMessage = expanded ? detailCollapse : detailExpand;
47
+ var message = localization.toLanguageString(baseMessage, messages[baseMessage]);
43
48
  defaultRendering = (React.createElement("td", __assign({ className: "k-hierarchy-cell", onKeyDown: onKeyDownHandler, "aria-expanded": expanded ? 'true' : 'false', role: 'gridcell', "aria-colindex": props.ariaColumnIndex }, navigationAttributes),
44
49
  React.createElement("a", { onClick: function (e) {
45
50
  e.preventDefault();
@@ -52,7 +57,7 @@ export var GridHierarchyCell = function (props) {
52
57
  value: !expanded
53
58
  });
54
59
  }
55
- }, className: className, href: "#", tabIndex: -1 })));
60
+ }, "aria-label": message, className: className, href: "#", tabIndex: -1 })));
56
61
  }
57
62
  return props.render ?
58
63
  props.render.call(undefined, defaultRendering, props) :
@@ -89,6 +89,7 @@ var FilterRow = /** @class */ (function (_super) {
89
89
  .map(function (column) {
90
90
  var filterType = getFilterType(column.filter);
91
91
  var currentActiveFilter = activeFilter(column.field);
92
+ var ariaLabel = column.filterable ? intl.toLanguageString(filterAriaLabel, messages[filterAriaLabel]) : undefined;
92
93
  var filterCellProps = column.filterable && {
93
94
  render: _this.props.cellRender,
94
95
  field: column.field,
@@ -98,11 +99,12 @@ var FilterRow = /** @class */ (function (_super) {
98
99
  operators: operatorMap(_this.props.filterOperators[filterType] || [], intl),
99
100
  booleanValues: operatorMap(booleanFilterValues, intl),
100
101
  filterType: filterType,
102
+ ariaLabel: ariaLabel,
101
103
  onChange: function (e) { _this.setFilter(e.value, e.operator, column.field, e.syntheticEvent); }
102
104
  };
103
105
  var key = (column.declarationIndex >= 0) ? ++index : --serviceIndex;
104
106
  var ariaAttrs = {
105
- ariaLabel: column.filterable ? intl.toLanguageString(filterAriaLabel, messages[filterAriaLabel]) : undefined,
107
+ ariaLabel: ariaLabel,
106
108
  ariaColumnIndex: column.ariaColumnIndex
107
109
  };
108
110
  var style = column.left !== undefined
@@ -46,4 +46,8 @@ export interface GridFilterCellProps {
46
46
  * A function for overriding the default rendering of the filter cell.
47
47
  */
48
48
  render?: (row: React.ReactElement<any>, dataItem: GridFilterCellProps) => React.ReactNode;
49
+ /**
50
+ * Accessible label of the filter.
51
+ */
52
+ ariaLabel?: string;
49
53
  }
@@ -94,10 +94,30 @@ export declare const sortAriaLabel = "grid.sortAriaLabel";
94
94
  * @hidden
95
95
  */
96
96
  export declare const filterAriaLabel = "grid.filterAriaLabel";
97
+ /**
98
+ * @hidden
99
+ */
100
+ export declare const groupExpand = "grid.groupExpand";
101
+ /**
102
+ * @hidden
103
+ */
104
+ export declare const groupCollapse = "grid.groupCollapse";
105
+ /**
106
+ * @hidden
107
+ */
108
+ export declare const detailExpand = "grid.detailExpand";
109
+ /**
110
+ * @hidden
111
+ */
112
+ export declare const detailCollapse = "grid.detailCollapse";
97
113
  /**
98
114
  * @hidden
99
115
  */
100
116
  export declare const messages: {
117
+ [detailExpand]: string;
118
+ [detailCollapse]: string;
119
+ [groupExpand]: string;
120
+ [groupCollapse]: string;
101
121
  [noRecords]: string;
102
122
  [groupPanelEmpty]: string;
103
123
  [filterClearButton]: string;
@@ -95,10 +95,30 @@ export var sortAriaLabel = 'grid.sortAriaLabel';
95
95
  * @hidden
96
96
  */
97
97
  export var filterAriaLabel = 'grid.filterAriaLabel';
98
+ /**
99
+ * @hidden
100
+ */
101
+ export var groupExpand = 'grid.groupExpand';
102
+ /**
103
+ * @hidden
104
+ */
105
+ export var groupCollapse = 'grid.groupCollapse';
106
+ /**
107
+ * @hidden
108
+ */
109
+ export var detailExpand = 'grid.detailExpand';
110
+ /**
111
+ * @hidden
112
+ */
113
+ export var detailCollapse = 'grid.detailCollapse';
98
114
  /**
99
115
  * @hidden
100
116
  */
101
117
  export var messages = (_a = {},
118
+ _a[detailExpand] = 'Expand detail row',
119
+ _a[detailCollapse] = 'Collapse detail row',
120
+ _a[groupExpand] = 'Expand group',
121
+ _a[groupCollapse] = 'Collapse Group',
102
122
  _a[noRecords] = 'No records available',
103
123
  _a[groupPanelEmpty] = 'Drag a column header and drop it here to group by that column',
104
124
  _a[filterClearButton] = 'Clear',
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-grid',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1645597997,
8
+ publishDate: 1645607312,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -76,13 +76,13 @@ var GridFilterCell = /** @class */ (function (_super) {
76
76
  var _this = this;
77
77
  switch (filterType) {
78
78
  case 'numeric':
79
- return (React.createElement(kendo_react_inputs_1.NumericTextBox, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title }));
79
+ return (React.createElement(kendo_react_inputs_1.NumericTextBox, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));
80
80
  case 'date':
81
- return (React.createElement(kendo_react_dateinputs_1.DatePicker, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title }));
81
+ return (React.createElement(kendo_react_dateinputs_1.DatePicker, { value: value, onChange: function (e) { _this.inputChange(e.value, e.syntheticEvent); }, title: this.props.title, ariaLabel: this.props.ariaLabel }));
82
82
  case 'boolean':
83
83
  var noFilterSet_1 = function (filter) { return filter === null || filter === undefined; };
84
- return (React.createElement(kendo_react_dropdowns_1.DropDownList, { onChange: this.boolDropdownChange, value: booleanValues.find(function (item) { return item.operator === (noFilterSet_1(value) ? '' : value); }), data: booleanValues, textField: "text", title: this.props.title }));
85
- default: return (React.createElement(kendo_react_inputs_1.Input, { value: value || '', onChange: function (e) { _this.inputChange(e.target.value, e.syntheticEvent); }, title: this.props.title }));
84
+ return (React.createElement(kendo_react_dropdowns_1.DropDownList, { onChange: this.boolDropdownChange, value: booleanValues.find(function (item) { return item.operator === (noFilterSet_1(value) ? '' : value); }), data: booleanValues, textField: "text", title: this.props.title, ariaLabel: this.props.ariaLabel }));
85
+ default: return (React.createElement(kendo_react_inputs_1.Input, { value: value || '', onChange: function (e) { _this.inputChange(e.target.value, e.syntheticEvent); }, title: this.props.title, "aria-label": this.props.ariaLabel }));
86
86
  }
87
87
  };
88
88
  return GridFilterCell;
@@ -13,7 +13,9 @@ var __assign = (this && this.__assign) || function () {
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  var kendo_react_common_1 = require("@progress/kendo-react-common");
15
15
  var kendo_react_data_tools_1 = require("@progress/kendo-react-data-tools");
16
+ var kendo_react_intl_1 = require("@progress/kendo-react-intl");
16
17
  var React = require("react");
18
+ var messages_1 = require("../messages");
17
19
  /**
18
20
  * @hidden
19
21
  */
@@ -22,6 +24,7 @@ exports.GridGroupCell = function (props) {
22
24
  var columnIndex = props.columnIndex, level = props.level, columnsCount = props.columnsCount, rowType = props.rowType, dataItem = props.dataItem, field = props.field, onChange = props.onChange, expanded = props.expanded, render = props.render, dataIndex = props.dataIndex, ariaColumnIndex = props.ariaColumnIndex;
23
25
  var definedField = field || '';
24
26
  var navigationAttributes = kendo_react_data_tools_1.useTableKeyboardNavigation(props.id);
27
+ var localization = kendo_react_intl_1.useLocalization();
25
28
  var onKeyDownHandler = React.useCallback(function (event) {
26
29
  if (event.isDefaultPrevented()) {
27
30
  return;
@@ -42,6 +45,8 @@ exports.GridGroupCell = function (props) {
42
45
  defaultRendering = (React.createElement("td", { style: props.style, key: 'g' + columnIndex, className: "k-group-cell", role: "presentation" }));
43
46
  }
44
47
  else if (columnIndex <= level) {
48
+ var baseMessage = expanded ? messages_1.groupCollapse : messages_1.groupExpand;
49
+ var message = localization.toLanguageString(baseMessage, messages_1.messages[baseMessage]);
45
50
  defaultRendering = (React.createElement("td", __assign({ style: props.style, key: 'g-colspan', colSpan: columnsCount - columnIndex, role: 'gridcell', "aria-selected": false, "aria-expanded": expanded, "aria-colindex": ariaColumnIndex, onKeyDown: onKeyDownHandler }, navigationAttributes),
46
51
  React.createElement("p", { className: "k-reset" },
47
52
  React.createElement("a", { onClick: function (e) {
@@ -55,7 +60,7 @@ exports.GridGroupCell = function (props) {
55
60
  value: !expanded
56
61
  });
57
62
  }
58
- }, href: "#", tabIndex: -1, className: expanded ? 'k-i-collapse k-icon' : 'k-i-expand k-icon' }),
63
+ }, href: "#", tabIndex: -1, "aria-label": message, className: expanded ? 'k-i-collapse k-icon' : 'k-i-expand k-icon' }),
59
64
  ((dataItem[definedField] instanceof Date) && dataItem[definedField].toString) ?
60
65
  dataItem[definedField].toString() :
61
66
  dataItem[definedField])));
@@ -14,7 +14,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  var React = require("react");
15
15
  var utils_1 = require("./../utils");
16
16
  var kendo_react_data_tools_1 = require("@progress/kendo-react-data-tools");
17
+ var kendo_react_intl_1 = require("@progress/kendo-react-intl");
17
18
  var kendo_react_common_1 = require("@progress/kendo-react-common");
19
+ var messages_1 = require("../messages");
18
20
  /**
19
21
  * @hidden
20
22
  */
@@ -22,6 +24,7 @@ exports.GridHierarchyCell = function (props) {
22
24
  var defaultRendering = null;
23
25
  var expanded = utils_1.getNestedValue(props.field, props.dataItem);
24
26
  var navigationAttributes = kendo_react_data_tools_1.useTableKeyboardNavigation(props.id);
27
+ var localization = kendo_react_intl_1.useLocalization();
25
28
  var onKeyDownHandler = React.useCallback(function (event) {
26
29
  if (event.isDefaultPrevented()) {
27
30
  return;
@@ -42,6 +45,8 @@ exports.GridHierarchyCell = function (props) {
42
45
  }
43
46
  else if (props.rowType !== 'groupHeader') {
44
47
  var className = expanded ? 'k-icon k-i-minus' : 'k-icon k-i-plus';
48
+ var baseMessage = expanded ? messages_1.detailCollapse : messages_1.detailExpand;
49
+ var message = localization.toLanguageString(baseMessage, messages_1.messages[baseMessage]);
45
50
  defaultRendering = (React.createElement("td", __assign({ className: "k-hierarchy-cell", onKeyDown: onKeyDownHandler, "aria-expanded": expanded ? 'true' : 'false', role: 'gridcell', "aria-colindex": props.ariaColumnIndex }, navigationAttributes),
46
51
  React.createElement("a", { onClick: function (e) {
47
52
  e.preventDefault();
@@ -54,7 +59,7 @@ exports.GridHierarchyCell = function (props) {
54
59
  value: !expanded
55
60
  });
56
61
  }
57
- }, className: className, href: "#", tabIndex: -1 })));
62
+ }, "aria-label": message, className: className, href: "#", tabIndex: -1 })));
58
63
  }
59
64
  return props.render ?
60
65
  props.render.call(undefined, defaultRendering, props) :
@@ -91,6 +91,7 @@ var FilterRow = /** @class */ (function (_super) {
91
91
  .map(function (column) {
92
92
  var filterType = filterCommon_1.getFilterType(column.filter);
93
93
  var currentActiveFilter = activeFilter(column.field);
94
+ var ariaLabel = column.filterable ? intl.toLanguageString(messages_1.filterAriaLabel, messages_1.messages[messages_1.filterAriaLabel]) : undefined;
94
95
  var filterCellProps = column.filterable && {
95
96
  render: _this.props.cellRender,
96
97
  field: column.field,
@@ -100,11 +101,12 @@ var FilterRow = /** @class */ (function (_super) {
100
101
  operators: filterCommon_1.operatorMap(_this.props.filterOperators[filterType] || [], intl),
101
102
  booleanValues: filterCommon_1.operatorMap(filterCommon_1.booleanFilterValues, intl),
102
103
  filterType: filterType,
104
+ ariaLabel: ariaLabel,
103
105
  onChange: function (e) { _this.setFilter(e.value, e.operator, column.field, e.syntheticEvent); }
104
106
  };
105
107
  var key = (column.declarationIndex >= 0) ? ++index : --serviceIndex;
106
108
  var ariaAttrs = {
107
- ariaLabel: column.filterable ? intl.toLanguageString(messages_1.filterAriaLabel, messages_1.messages[messages_1.filterAriaLabel]) : undefined,
109
+ ariaLabel: ariaLabel,
108
110
  ariaColumnIndex: column.ariaColumnIndex
109
111
  };
110
112
  var style = column.left !== undefined
@@ -46,4 +46,8 @@ export interface GridFilterCellProps {
46
46
  * A function for overriding the default rendering of the filter cell.
47
47
  */
48
48
  render?: (row: React.ReactElement<any>, dataItem: GridFilterCellProps) => React.ReactNode;
49
+ /**
50
+ * Accessible label of the filter.
51
+ */
52
+ ariaLabel?: string;
49
53
  }
@@ -94,10 +94,30 @@ export declare const sortAriaLabel = "grid.sortAriaLabel";
94
94
  * @hidden
95
95
  */
96
96
  export declare const filterAriaLabel = "grid.filterAriaLabel";
97
+ /**
98
+ * @hidden
99
+ */
100
+ export declare const groupExpand = "grid.groupExpand";
101
+ /**
102
+ * @hidden
103
+ */
104
+ export declare const groupCollapse = "grid.groupCollapse";
105
+ /**
106
+ * @hidden
107
+ */
108
+ export declare const detailExpand = "grid.detailExpand";
109
+ /**
110
+ * @hidden
111
+ */
112
+ export declare const detailCollapse = "grid.detailCollapse";
97
113
  /**
98
114
  * @hidden
99
115
  */
100
116
  export declare const messages: {
117
+ [detailExpand]: string;
118
+ [detailCollapse]: string;
119
+ [groupExpand]: string;
120
+ [groupCollapse]: string;
101
121
  [noRecords]: string;
102
122
  [groupPanelEmpty]: string;
103
123
  [filterClearButton]: string;
@@ -97,10 +97,30 @@ exports.sortAriaLabel = 'grid.sortAriaLabel';
97
97
  * @hidden
98
98
  */
99
99
  exports.filterAriaLabel = 'grid.filterAriaLabel';
100
+ /**
101
+ * @hidden
102
+ */
103
+ exports.groupExpand = 'grid.groupExpand';
104
+ /**
105
+ * @hidden
106
+ */
107
+ exports.groupCollapse = 'grid.groupCollapse';
108
+ /**
109
+ * @hidden
110
+ */
111
+ exports.detailExpand = 'grid.detailExpand';
112
+ /**
113
+ * @hidden
114
+ */
115
+ exports.detailCollapse = 'grid.detailCollapse';
100
116
  /**
101
117
  * @hidden
102
118
  */
103
119
  exports.messages = (_a = {},
120
+ _a[exports.detailExpand] = 'Expand detail row',
121
+ _a[exports.detailCollapse] = 'Collapse detail row',
122
+ _a[exports.groupExpand] = 'Expand group',
123
+ _a[exports.groupCollapse] = 'Collapse Group',
104
124
  _a[exports.noRecords] = 'No records available',
105
125
  _a[exports.groupPanelEmpty] = 'Drag a column header and drop it here to group by that column',
106
126
  _a[exports.filterClearButton] = 'Clear',
@@ -7,7 +7,7 @@ exports.packageMetadata = {
7
7
  name: '@progress/kendo-react-grid',
8
8
  productName: 'KendoReact',
9
9
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
10
- publishDate: 1645597997,
10
+ publishDate: 1645607312,
11
11
  version: '',
12
12
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
13
13
  };