@progress/kendo-react-grid 5.17.0 → 5.18.0-dev.202308311010

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.
package/dist/es/Grid.d.ts CHANGED
@@ -173,6 +173,7 @@ export declare class Grid extends React.Component<GridProps> {
173
173
  private forceUpdateTimeout;
174
174
  private isRtl;
175
175
  private _gridId;
176
+ private _gridRoleElementId;
176
177
  private rowIndex;
177
178
  private get _header();
178
179
  private observer;
package/dist/es/Grid.js CHANGED
@@ -119,6 +119,7 @@ var Grid = /** @class */ (function (_super) {
119
119
  _this.forceUpdateTimeout = undefined;
120
120
  _this.isRtl = false;
121
121
  _this._gridId = guid();
122
+ _this._gridRoleElementId = guid(); // Needed for aria-control accessibility attribute
122
123
  _this.observer = null;
123
124
  _this.handleIntersection = function (entries) {
124
125
  var options = { rowIndex: _this.rowIndex };
@@ -630,7 +631,7 @@ var Grid = /** @class */ (function (_super) {
630
631
  var noRecords = children.filter(function (child) { return child && child.type &&
631
632
  child.type.displayName === 'KendoReactGridNoRecords'; });
632
633
  var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
633
- var groupingPanel = groupable && (React.createElement(GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle }));
634
+ var groupingPanel = groupable && (React.createElement(GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId }));
634
635
  var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;
635
636
  var header = (React.createElement(Header, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, elemRef: this.headerElementRef, headerRow: this.getHeaderRow(sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, this._columns, this._columnsMap, this.isRtl), filterRow: this.props.filterable && React.createElement(FilterRow, { cells: this.props.cells, size: this.props.size, columns: this._columns, filter: this.props.filter, filterOperators: this.props.filterOperators || operators, filterChange: this.filterChange, sort: this.props.sort, cellRender: this.props.filterCellRender, isRtl: this.isRtl, ariaRowIndex: this._columnsMap.length + 1 }) || undefined, cols: leafColumns.map(function (column, index) { return (React.createElement("col", { key: index.toString(), width: getColumnWidth(column) })); }) }));
636
637
  var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
@@ -793,27 +794,28 @@ var Grid = /** @class */ (function (_super) {
793
794
  _c['k-grid-virtual'] = this.props.scrollable === 'virtual',
794
795
  _c), this.props.className), ref: function (el) {
795
796
  _this._element = el;
796
- }, role: "grid", "aria-colcount": leafColumns.length, "aria-rowcount": total, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),
797
+ }, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),
797
798
  toolbar,
798
799
  groupingPanel,
799
- header,
800
- React.createElement("div", { className: "k-grid-container", role: "presentation" },
801
- React.createElement("div", { ref: this.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
802
- React.createElement("div", { className: 'k-grid-table-wrap', role: "presentation" },
803
- React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
804
- _this.tableElement = table;
805
- } },
806
- React.createElement("table", { className: classNames('k-table k-grid-table', (_d = {
807
- 'k-table-md': !this.props.size
808
- },
809
- _d["k-table-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
810
- _d)), role: "presentation", style: { userSelect: tableUserSelect, display: tableDisplay } },
811
- colGroups,
812
- React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, tableKeyboardNavigationBodyAttributes), body)))),
813
- React.createElement("div", { className: "k-height-container", role: "presentation" },
814
- React.createElement("div", { style: this.props.scrollable === 'virtual' ?
815
- { 'height': (this.vs.containerHeight) + 'px' } : {} })))),
816
- footer,
800
+ React.createElement("div", { role: "grid", className: "k-grid-aria-root", id: this._gridRoleElementId, "aria-colcount": leafColumns.length, "aria-rowcount": total },
801
+ header,
802
+ React.createElement("div", { className: "k-grid-container", role: "presentation" },
803
+ React.createElement("div", { ref: this.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
804
+ React.createElement("div", { className: 'k-grid-table-wrap', role: "presentation" },
805
+ React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
806
+ _this.tableElement = table;
807
+ } },
808
+ React.createElement("table", { className: classNames('k-table k-grid-table', (_d = {
809
+ 'k-table-md': !this.props.size
810
+ },
811
+ _d["k-table-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
812
+ _d)), role: "presentation", style: { userSelect: tableUserSelect, display: tableDisplay } },
813
+ colGroups,
814
+ React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, tableKeyboardNavigationBodyAttributes), body)))),
815
+ React.createElement("div", { className: "k-height-container", role: "presentation" },
816
+ React.createElement("div", { style: this.props.scrollable === 'virtual' ?
817
+ { 'height': (this.vs.containerHeight) + 'px' } : {} }))),
818
+ footer)),
817
819
  this.props.pageable && pager,
818
820
  enableDragClues && (React.createElement(React.Fragment, null,
819
821
  React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),
@@ -67,7 +67,7 @@ var GridToolbar = /** @class */ (function (_super) {
67
67
  'k-toolbar-md': !this.props.size
68
68
  },
69
69
  _a["k-toolbar-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
70
- _a), this.props.className) }, this.props.children));
70
+ _a), this.props.className), "aria-label": this.props.ariaLabel, role: "toolbar" }, this.props.children));
71
71
  };
72
72
  /**
73
73
  * @hidden
@@ -9,6 +9,7 @@ export interface GroupPanelProps extends ColumnDraggableProps {
9
9
  groupChange: (groups: GroupDescriptor[], event: React.MouseEvent<HTMLElement>) => void;
10
10
  refCallback: (e: HTMLDivElement | null) => void;
11
11
  resolveTitle: (field: string) => string;
12
+ ariaControls: string;
12
13
  }
13
14
  /**
14
15
  * @hidden
@@ -45,7 +45,7 @@ var GroupPanel = /** @class */ (function (_super) {
45
45
  }, onSortChange: function (event, dir) {
46
46
  _this.onGroupSortChange(event, index, groupDesc, dir);
47
47
  }, onPress: _this.props.pressHandler, onDrag: _this.props.dragHandler, onRelease: _this.props.releaseHandler })); });
48
- return (React.createElement("div", { ref: this.props.refCallback, className: "k-grouping-header", role: "toolbar", "aria-label": intl(this).toLanguageString(groupPanelAriaLabel, messages[groupPanelAriaLabel]) },
48
+ return (React.createElement("div", { ref: this.props.refCallback, className: "k-grouping-header", role: "toolbar", "aria-label": intl(this).toLanguageString(groupPanelAriaLabel, messages[groupPanelAriaLabel]), "aria-controls": this.props.ariaControls },
49
49
  React.createElement("div", { className: "k-chip-list k-chip-list-md", role: "none" }, groups),
50
50
  React.createElement("div", { className: "k-grouping-drop-container" },
51
51
  !groups.length && intl(this).toLanguageString(messageKey, messages[messageKey]),
@@ -23,4 +23,8 @@ export interface GridToolbarProps {
23
23
  * @default `medium`
24
24
  */
25
25
  size?: null | 'small' | 'medium' | 'large';
26
+ /**
27
+ * The accessible label of the GridToolbar component.
28
+ */
29
+ ariaLabel?: string;
26
30
  }
@@ -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: 1693312367,
8
+ publishDate: 1693475397,
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
  };
@@ -173,6 +173,7 @@ export declare class Grid extends React.Component<GridProps> {
173
173
  private forceUpdateTimeout;
174
174
  private isRtl;
175
175
  private _gridId;
176
+ private _gridRoleElementId;
176
177
  private rowIndex;
177
178
  private get _header();
178
179
  private observer;
package/dist/npm/Grid.js CHANGED
@@ -122,6 +122,7 @@ var Grid = /** @class */ (function (_super) {
122
122
  _this.forceUpdateTimeout = undefined;
123
123
  _this.isRtl = false;
124
124
  _this._gridId = (0, kendo_react_common_1.guid)();
125
+ _this._gridRoleElementId = (0, kendo_react_common_1.guid)(); // Needed for aria-control accessibility attribute
125
126
  _this.observer = null;
126
127
  _this.handleIntersection = function (entries) {
127
128
  var options = { rowIndex: _this.rowIndex };
@@ -633,7 +634,7 @@ var Grid = /** @class */ (function (_super) {
633
634
  var noRecords = children.filter(function (child) { return child && child.type &&
634
635
  child.type.displayName === 'KendoReactGridNoRecords'; });
635
636
  var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
636
- var groupingPanel = groupable && (React.createElement(GroupPanel_1.GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle }));
637
+ var groupingPanel = groupable && (React.createElement(GroupPanel_1.GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId }));
637
638
  var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? filterCommon_1.operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;
638
639
  var header = (React.createElement(Header_1.Header, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, elemRef: this.headerElementRef, headerRow: this.getHeaderRow(sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, this._columns, this._columnsMap, this.isRtl), filterRow: this.props.filterable && React.createElement(FilterRow_1.FilterRow, { cells: this.props.cells, size: this.props.size, columns: this._columns, filter: this.props.filter, filterOperators: this.props.filterOperators || filterCommon_1.operators, filterChange: this.filterChange, sort: this.props.sort, cellRender: this.props.filterCellRender, isRtl: this.isRtl, ariaRowIndex: this._columnsMap.length + 1 }) || undefined, cols: leafColumns.map(function (column, index) { return (React.createElement("col", { key: index.toString(), width: (0, index_1.getColumnWidth)(column) })); }) }));
639
640
  var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
@@ -796,27 +797,28 @@ var Grid = /** @class */ (function (_super) {
796
797
  _c['k-grid-virtual'] = this.props.scrollable === 'virtual',
797
798
  _c), this.props.className), ref: function (el) {
798
799
  _this._element = el;
799
- }, role: "grid", "aria-colcount": leafColumns.length, "aria-rowcount": total, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, kendo_react_data_tools_1.tableKeyboardNavigationScopeAttributes),
800
+ }, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, kendo_react_data_tools_1.tableKeyboardNavigationScopeAttributes),
800
801
  toolbar,
801
802
  groupingPanel,
802
- header,
803
- React.createElement("div", { className: "k-grid-container", role: "presentation" },
804
- React.createElement("div", { ref: this.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
805
- React.createElement("div", { className: 'k-grid-table-wrap', role: "presentation" },
806
- React.createElement(kendo_react_data_tools_1.TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
807
- _this.tableElement = table;
808
- } },
809
- React.createElement("table", { className: (0, kendo_react_common_1.classNames)('k-table k-grid-table', (_d = {
810
- 'k-table-md': !this.props.size
811
- },
812
- _d["k-table-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
813
- _d)), role: "presentation", style: { userSelect: tableUserSelect, display: tableDisplay } },
814
- colGroups,
815
- React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, kendo_react_data_tools_1.tableKeyboardNavigationBodyAttributes), body)))),
816
- React.createElement("div", { className: "k-height-container", role: "presentation" },
817
- React.createElement("div", { style: this.props.scrollable === 'virtual' ?
818
- { 'height': (this.vs.containerHeight) + 'px' } : {} })))),
819
- footer,
803
+ React.createElement("div", { role: "grid", className: "k-grid-aria-root", id: this._gridRoleElementId, "aria-colcount": leafColumns.length, "aria-rowcount": total },
804
+ header,
805
+ React.createElement("div", { className: "k-grid-container", role: "presentation" },
806
+ React.createElement("div", { ref: this.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
807
+ React.createElement("div", { className: 'k-grid-table-wrap', role: "presentation" },
808
+ React.createElement(kendo_react_data_tools_1.TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
809
+ _this.tableElement = table;
810
+ } },
811
+ React.createElement("table", { className: (0, kendo_react_common_1.classNames)('k-table k-grid-table', (_d = {
812
+ 'k-table-md': !this.props.size
813
+ },
814
+ _d["k-table-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
815
+ _d)), role: "presentation", style: { userSelect: tableUserSelect, display: tableDisplay } },
816
+ colGroups,
817
+ React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, kendo_react_data_tools_1.tableKeyboardNavigationBodyAttributes), body)))),
818
+ React.createElement("div", { className: "k-height-container", role: "presentation" },
819
+ React.createElement("div", { style: this.props.scrollable === 'virtual' ?
820
+ { 'height': (this.vs.containerHeight) + 'px' } : {} }))),
821
+ footer)),
820
822
  this.props.pageable && pager,
821
823
  enableDragClues && (React.createElement(React.Fragment, null,
822
824
  React.createElement(kendo_react_data_tools_1.DropClue, { ref: this.dragLogic.refDropElementClue }),
@@ -70,7 +70,7 @@ var GridToolbar = /** @class */ (function (_super) {
70
70
  'k-toolbar-md': !this.props.size
71
71
  },
72
72
  _a["k-toolbar-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
73
- _a), this.props.className) }, this.props.children));
73
+ _a), this.props.className), "aria-label": this.props.ariaLabel, role: "toolbar" }, this.props.children));
74
74
  };
75
75
  /**
76
76
  * @hidden
@@ -9,6 +9,7 @@ export interface GroupPanelProps extends ColumnDraggableProps {
9
9
  groupChange: (groups: GroupDescriptor[], event: React.MouseEvent<HTMLElement>) => void;
10
10
  refCallback: (e: HTMLDivElement | null) => void;
11
11
  resolveTitle: (field: string) => string;
12
+ ariaControls: string;
12
13
  }
13
14
  /**
14
15
  * @hidden
@@ -48,7 +48,7 @@ var GroupPanel = /** @class */ (function (_super) {
48
48
  }, onSortChange: function (event, dir) {
49
49
  _this.onGroupSortChange(event, index, groupDesc, dir);
50
50
  }, onPress: _this.props.pressHandler, onDrag: _this.props.dragHandler, onRelease: _this.props.releaseHandler })); });
51
- return (React.createElement("div", { ref: this.props.refCallback, className: "k-grouping-header", role: "toolbar", "aria-label": (0, kendo_react_intl_1.provideLocalizationService)(this).toLanguageString(messages_1.groupPanelAriaLabel, messages_1.messages[messages_1.groupPanelAriaLabel]) },
51
+ return (React.createElement("div", { ref: this.props.refCallback, className: "k-grouping-header", role: "toolbar", "aria-label": (0, kendo_react_intl_1.provideLocalizationService)(this).toLanguageString(messages_1.groupPanelAriaLabel, messages_1.messages[messages_1.groupPanelAriaLabel]), "aria-controls": this.props.ariaControls },
52
52
  React.createElement("div", { className: "k-chip-list k-chip-list-md", role: "none" }, groups),
53
53
  React.createElement("div", { className: "k-grouping-drop-container" },
54
54
  !groups.length && (0, kendo_react_intl_1.provideLocalizationService)(this).toLanguageString(messages_1.groupPanelEmpty, messages_1.messages[messages_1.groupPanelEmpty]),
@@ -23,4 +23,8 @@ export interface GridToolbarProps {
23
23
  * @default `medium`
24
24
  */
25
25
  size?: null | 'small' | 'medium' | 'large';
26
+ /**
27
+ * The accessible label of the GridToolbar component.
28
+ */
29
+ ariaLabel?: string;
26
30
  }
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-grid',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1693312367,
11
+ publishDate: 1693475397,
12
12
  version: '',
13
13
  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'
14
14
  };