@progress/kendo-react-grid 4.11.0-dev.202111171558 → 4.12.0-dev.202111220849
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/cdn/js/kendo-react-grid.js +1 -1
- package/dist/es/columnMenu/GridColumnMenuWrapper.d.ts +39 -0
- package/dist/es/columnMenu/{ColumnMenu.js → GridColumnMenuWrapper.js} +15 -10
- package/dist/es/header/GridHeaderCell.js +7 -3
- package/dist/es/header/HeaderRow.js +28 -19
- package/dist/es/interfaces/GridHeaderCellProps.d.ts +5 -0
- package/dist/es/main.d.ts +2 -1
- package/dist/es/main.js +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/columnMenu/GridColumnMenuWrapper.d.ts +39 -0
- package/dist/npm/columnMenu/{ColumnMenu.js → GridColumnMenuWrapper.js} +15 -10
- package/dist/npm/header/GridHeaderCell.js +7 -3
- package/dist/npm/header/HeaderRow.js +28 -19
- package/dist/npm/interfaces/GridHeaderCellProps.d.ts +5 -0
- package/dist/npm/main.d.ts +2 -1
- package/dist/npm/main.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-grid.js +1 -1
- package/package.json +18 -18
- package/dist/es/columnMenu/ColumnMenu.d.ts +0 -28
- package/dist/npm/columnMenu/ColumnMenu.d.ts +0 -28
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridColumnMenuProps } from '../interfaces/GridColumnMenuProps';
|
|
3
|
+
/**
|
|
4
|
+
* The props of the GridColumnMenuWrapper component.
|
|
5
|
+
*/
|
|
6
|
+
export interface GridColumnMenuWrapperProps extends GridColumnMenuProps {
|
|
7
|
+
/**
|
|
8
|
+
* The component to be rendered as content of the Grid column menu.
|
|
9
|
+
*/
|
|
10
|
+
columnMenu?: React.ComponentType<GridColumnMenuProps> | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export interface ColumnMenuStateProps {
|
|
16
|
+
show: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The GridColumnMenuWrapper component.
|
|
20
|
+
*/
|
|
21
|
+
export declare class GridColumnMenuWrapper extends React.Component<GridColumnMenuWrapperProps, ColumnMenuStateProps> {
|
|
22
|
+
/** @hidden */
|
|
23
|
+
readonly state: ColumnMenuStateProps;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
_anchor: HTMLDivElement | null;
|
|
26
|
+
/** @hidden */
|
|
27
|
+
_content: HTMLDivElement | null;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
blurTimeout: any;
|
|
30
|
+
/** @hidden */
|
|
31
|
+
blur: () => void;
|
|
32
|
+
/** @hidden */
|
|
33
|
+
focus: () => void;
|
|
34
|
+
/** @hidden */
|
|
35
|
+
anchorClick: () => void;
|
|
36
|
+
/** @hidden */
|
|
37
|
+
closeMenu: () => void;
|
|
38
|
+
render(): JSX.Element;
|
|
39
|
+
}
|
|
@@ -34,41 +34,46 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
34
34
|
import * as React from 'react';
|
|
35
35
|
import { Popup } from '@progress/kendo-react-popup';
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* The GridColumnMenuWrapper component.
|
|
38
38
|
*/
|
|
39
|
-
var
|
|
40
|
-
__extends(
|
|
41
|
-
function
|
|
39
|
+
var GridColumnMenuWrapper = /** @class */ (function (_super) {
|
|
40
|
+
__extends(GridColumnMenuWrapper, _super);
|
|
41
|
+
function GridColumnMenuWrapper() {
|
|
42
42
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
43
|
+
/** @hidden */
|
|
43
44
|
_this.state = {
|
|
44
45
|
show: false
|
|
45
46
|
};
|
|
47
|
+
/** @hidden */
|
|
46
48
|
_this.blurTimeout = undefined;
|
|
49
|
+
/** @hidden */
|
|
47
50
|
_this.blur = function () {
|
|
48
51
|
clearTimeout(_this.blurTimeout);
|
|
49
52
|
_this.blurTimeout = window.setTimeout(function () { _this.closeMenu(); });
|
|
50
53
|
};
|
|
54
|
+
/** @hidden */
|
|
51
55
|
_this.focus = function () {
|
|
52
56
|
clearTimeout(_this.blurTimeout);
|
|
53
57
|
};
|
|
58
|
+
/** @hidden */
|
|
54
59
|
_this.anchorClick = function () {
|
|
55
60
|
_this.setState({ show: !_this.state.show }, function () { return _this.state.show && _this._content && _this._content.focus(); });
|
|
56
61
|
};
|
|
62
|
+
/** @hidden */
|
|
57
63
|
_this.closeMenu = function () {
|
|
58
64
|
_this.setState({ show: false });
|
|
59
65
|
};
|
|
60
66
|
return _this;
|
|
61
67
|
}
|
|
62
|
-
|
|
68
|
+
GridColumnMenuWrapper.prototype.render = function () {
|
|
63
69
|
var _this = this;
|
|
64
|
-
var _a = this.props,
|
|
70
|
+
var _a = this.props, ColumnMenu = _a.columnMenu, others = __rest(_a, ["columnMenu"]);
|
|
65
71
|
return (React.createElement(React.Fragment, null,
|
|
66
72
|
React.createElement("div", { className: 'k-grid-column-menu k-grid-filter', ref: function (e) { return _this._anchor = e; }, onClick: this.anchorClick },
|
|
67
73
|
React.createElement("span", { className: 'k-icon k-i-more-vertical' })),
|
|
68
74
|
React.createElement(Popup, { anchor: this._anchor, show: this.state.show },
|
|
69
|
-
React.createElement("div", { ref: function (e) { return _this._content = e; }, className: 'k-grid-columnmenu-popup', tabIndex: 0, onBlur: this.blur, onFocus: this.focus, style: { outline: 'none' } },
|
|
70
|
-
React.createElement(ChildComponent, __assign({}, others, { onCloseMenu: this.closeMenu }))))));
|
|
75
|
+
React.createElement("div", { ref: function (e) { return _this._content = e; }, className: 'k-grid-columnmenu-popup', tabIndex: 0, onBlur: this.blur, onFocus: this.focus, style: { outline: 'none' } }, ColumnMenu && (React.createElement(ColumnMenu, __assign({}, others, { onCloseMenu: this.closeMenu })))))));
|
|
71
76
|
};
|
|
72
|
-
return
|
|
77
|
+
return GridColumnMenuWrapper;
|
|
73
78
|
}(React.Component));
|
|
74
|
-
export {
|
|
79
|
+
export { GridColumnMenuWrapper };
|
|
@@ -23,6 +23,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
23
|
return __assign.apply(this, arguments);
|
|
24
24
|
};
|
|
25
25
|
import * as React from 'react';
|
|
26
|
+
import { GridColumnMenuWrapper } from '../columnMenu/GridColumnMenuWrapper';
|
|
26
27
|
/**
|
|
27
28
|
* @example
|
|
28
29
|
* ```jsx
|
|
@@ -75,12 +76,15 @@ var GridHeaderCell = /** @class */ (function (_super) {
|
|
|
75
76
|
* @hidden
|
|
76
77
|
*/
|
|
77
78
|
GridHeaderCell.prototype.render = function () {
|
|
79
|
+
var columnMenuWrapperProps = this.props.columnMenuWrapperProps;
|
|
78
80
|
var clickProps = this.props.onClick ? {
|
|
79
81
|
onClick: this.props.onClick
|
|
80
82
|
} : {};
|
|
81
|
-
var defaultRendering = (React.createElement("span",
|
|
82
|
-
React.createElement("span", { className: 'k-
|
|
83
|
-
|
|
83
|
+
var defaultRendering = (React.createElement("span", { className: 'k-cell-inner' },
|
|
84
|
+
React.createElement("span", __assign({ className: 'k-link' }, clickProps),
|
|
85
|
+
React.createElement("span", { className: 'k-column-title' }, this.props.title || this.props.field || '\u00A0'),
|
|
86
|
+
this.props.children),
|
|
87
|
+
columnMenuWrapperProps.columnMenu && React.createElement(GridColumnMenuWrapper, __assign({}, columnMenuWrapperProps))));
|
|
84
88
|
if (this.props.render) {
|
|
85
89
|
return this.props.render.call(undefined, defaultRendering, this.props);
|
|
86
90
|
}
|
|
@@ -27,7 +27,6 @@ import { normalize } from '../interfaces/GridSortSettings';
|
|
|
27
27
|
import { ColumnResizer } from '../drag/ColumnResizer';
|
|
28
28
|
import { ColumnDraggable } from '../drag/ColumnDraggable';
|
|
29
29
|
import { GridHeaderCell } from './GridHeaderCell';
|
|
30
|
-
import { ColumnMenu } from '../columnMenu/ColumnMenu';
|
|
31
30
|
import { classNames, Keys } from '@progress/kendo-react-common';
|
|
32
31
|
import { HeaderThElement } from '@progress/kendo-react-data-tools';
|
|
33
32
|
import { registerForLocalization, provideLocalizationService as intl } from '@progress/kendo-react-intl';
|
|
@@ -69,16 +68,6 @@ var HeaderRow = /** @class */ (function (_super) {
|
|
|
69
68
|
var sortable = _this.props.sortable && column.sortable;
|
|
70
69
|
var sortIndex = _this.props.sort ? _this.props.sort.findIndex(function (s) { return s.field === column.field; }) : -1;
|
|
71
70
|
var sortDir = sortIndex >= 0 ? ((_this.props.sort)[sortIndex].dir || 'none') : 'none';
|
|
72
|
-
var headerCellProps = {
|
|
73
|
-
field: column.field,
|
|
74
|
-
onClick: sortable && (function (e) { return _this.cellClick(e, column); }) || undefined,
|
|
75
|
-
selectionChange: _this.props.selectionChange,
|
|
76
|
-
title: column.title,
|
|
77
|
-
selectionValue: column.headerSelectionValue,
|
|
78
|
-
render: _this.props.cellRender,
|
|
79
|
-
children: _this.sortIcon(sortIndex),
|
|
80
|
-
key: 1
|
|
81
|
-
};
|
|
82
71
|
var columnMenu = (column.columnMenu === null) ? null : (column.columnMenu || _this.props.columnMenu);
|
|
83
72
|
var className = classNames({
|
|
84
73
|
'k-first': column.kFirst,
|
|
@@ -102,16 +91,36 @@ var HeaderRow = /** @class */ (function (_super) {
|
|
|
102
91
|
} : {
|
|
103
92
|
'role': 'presentation'
|
|
104
93
|
};
|
|
94
|
+
var columnMenuWrapperProps = {
|
|
95
|
+
column: {
|
|
96
|
+
field: column.field,
|
|
97
|
+
filter: column.filter
|
|
98
|
+
},
|
|
99
|
+
sortable: sortable && _this.props.sortable,
|
|
100
|
+
sort: _this.props.sort,
|
|
101
|
+
onSortChange: _this.props.sortChange,
|
|
102
|
+
filter: _this.props.filter,
|
|
103
|
+
filterable: _this.props.filterable && column.filterable,
|
|
104
|
+
filterOperators: _this.props.filterOperators,
|
|
105
|
+
onFilterChange: _this.props.filterChange,
|
|
106
|
+
group: _this.props.group,
|
|
107
|
+
groupable: _this.props.groupable,
|
|
108
|
+
onGroupChange: _this.props.groupChange,
|
|
109
|
+
columnMenu: columnMenu
|
|
110
|
+
};
|
|
111
|
+
var headerCellProps = {
|
|
112
|
+
field: column.field,
|
|
113
|
+
onClick: sortable && (function (e) { return _this.cellClick(e, column); }) || undefined,
|
|
114
|
+
selectionChange: _this.props.selectionChange,
|
|
115
|
+
title: column.title,
|
|
116
|
+
selectionValue: column.headerSelectionValue,
|
|
117
|
+
render: _this.props.cellRender,
|
|
118
|
+
children: _this.sortIcon(sortIndex),
|
|
119
|
+
columnMenuWrapperProps: columnMenuWrapperProps
|
|
120
|
+
};
|
|
105
121
|
var key = (column.declarationIndex >= 0) ? ++_this.index : --_this.serviceIndex;
|
|
106
122
|
return (React.createElement(HeaderThElement, __assign({}, ariaAttrs, { key: key, colSpan: column.colSpan, rowSpan: column.rowSpan, className: className, style: style, columnId: column.id, navigatable: column.navigatable, onKeyDown: sortable && (function (e) { return _this.cellKeyDown(e, column); }) || undefined }),
|
|
107
|
-
column.headerCell
|
|
108
|
-
!column.headerCell && (React.createElement("span", { className: 'k-cell-inner' },
|
|
109
|
-
React.createElement(GridHeaderCell, __assign({}, headerCellProps)),
|
|
110
|
-
columnMenu &&
|
|
111
|
-
React.createElement(ColumnMenu, { key: 0, column: {
|
|
112
|
-
field: column.field,
|
|
113
|
-
filter: column.filter
|
|
114
|
-
}, sortable: sortable && _this.props.sortable, sort: _this.props.sort, onSortChange: _this.props.sortChange, filter: _this.props.filter, filterable: _this.props.filterable && column.filterable, filterOperators: _this.props.filterOperators, onFilterChange: _this.props.filterChange, group: _this.props.group, groupable: _this.props.groupable, onGroupChange: _this.props.groupChange, render: columnMenu }))),
|
|
123
|
+
column.headerCell ? React.createElement(column.headerCell, __assign({}, headerCellProps)) : React.createElement(GridHeaderCell, __assign({}, headerCellProps)),
|
|
115
124
|
_this.props.columnResize && _this.props.columnResize.resizable && column.resizable &&
|
|
116
125
|
React.createElement(ColumnResizer, { key: 2, resize: function (e, element, end) {
|
|
117
126
|
return _this.props.columnResize &&
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HeaderCellBaseProps } from '@progress/kendo-react-data-tools';
|
|
3
|
+
import { GridColumnMenuWrapperProps } from '../columnMenu/GridColumnMenuWrapper';
|
|
3
4
|
/**
|
|
4
5
|
* The props of the GridHeaderCell component
|
|
5
6
|
* ([more information]({% slug cells_grid %}#toc-header-cells)).
|
|
@@ -9,4 +10,8 @@ export interface GridHeaderCellProps extends HeaderCellBaseProps {
|
|
|
9
10
|
* A function for overriding the default rendering of the header cell.
|
|
10
11
|
*/
|
|
11
12
|
render?: (defaultRendering: React.ReactNode | null, props: GridHeaderCellProps) => React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The props of the Grid column menu wrapper.
|
|
15
|
+
*/
|
|
16
|
+
columnMenuWrapperProps: GridColumnMenuWrapperProps;
|
|
12
17
|
}
|
package/dist/es/main.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { GridProps } from './interfaces/GridProps';
|
|
|
3
3
|
import { GridColumn } from './GridColumn';
|
|
4
4
|
import { GridColumnProps } from './interfaces/GridColumnProps';
|
|
5
5
|
import { GridColumnMenuProps } from './interfaces/GridColumnMenuProps';
|
|
6
|
+
import { GridColumnMenuWrapper, GridColumnMenuWrapperProps } from './columnMenu/GridColumnMenuWrapper';
|
|
6
7
|
import { GridColumnMenuGroup } from './columnMenu/GridColumnMenuGroup';
|
|
7
8
|
import { GridColumnMenuSort } from './columnMenu/GridColumnMenuSort';
|
|
8
9
|
import { GridColumnMenuFilter } from './columnMenu/GridColumnMenuFilter';
|
|
@@ -39,4 +40,4 @@ import { GridSelectableMode } from './interfaces/GridSelectableSettings';
|
|
|
39
40
|
import { GridColumnMenuFilterUIProps } from './interfaces/GridColumnMenuFilterUIProps';
|
|
40
41
|
import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
|
|
41
42
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
|
|
42
|
-
export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
|
43
|
+
export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
package/dist/es/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Grid } from './Grid';
|
|
2
2
|
import { GridColumn } from './GridColumn';
|
|
3
|
+
import { GridColumnMenuWrapper } from './columnMenu/GridColumnMenuWrapper';
|
|
3
4
|
import { GridColumnMenuGroup } from './columnMenu/GridColumnMenuGroup';
|
|
4
5
|
import { GridColumnMenuSort } from './columnMenu/GridColumnMenuSort';
|
|
5
6
|
import { GridColumnMenuFilter } from './columnMenu/GridColumnMenuFilter';
|
|
@@ -21,4 +22,4 @@ import { GridColumnMenuItemContent } from './columnMenu/GridColumnMenuItemConten
|
|
|
21
22
|
import { GridColumnMenuItemGroup } from './columnMenu/GridColumnMenuItemGroup';
|
|
22
23
|
import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
|
|
23
24
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
|
|
24
|
-
export { Grid, GridColumn, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridRow, GridFilterCell, GridHeaderCell, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridToolbar, GridNoRecords, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
|
25
|
+
export { Grid, GridColumn, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridRow, GridFilterCell, GridHeaderCell, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridToolbar, GridNoRecords, GridColumnMenuWrapper, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
|
@@ -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:
|
|
8
|
+
publishDate: 1637570381,
|
|
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
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridColumnMenuProps } from '../interfaces/GridColumnMenuProps';
|
|
3
|
+
/**
|
|
4
|
+
* The props of the GridColumnMenuWrapper component.
|
|
5
|
+
*/
|
|
6
|
+
export interface GridColumnMenuWrapperProps extends GridColumnMenuProps {
|
|
7
|
+
/**
|
|
8
|
+
* The component to be rendered as content of the Grid column menu.
|
|
9
|
+
*/
|
|
10
|
+
columnMenu?: React.ComponentType<GridColumnMenuProps> | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export interface ColumnMenuStateProps {
|
|
16
|
+
show: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The GridColumnMenuWrapper component.
|
|
20
|
+
*/
|
|
21
|
+
export declare class GridColumnMenuWrapper extends React.Component<GridColumnMenuWrapperProps, ColumnMenuStateProps> {
|
|
22
|
+
/** @hidden */
|
|
23
|
+
readonly state: ColumnMenuStateProps;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
_anchor: HTMLDivElement | null;
|
|
26
|
+
/** @hidden */
|
|
27
|
+
_content: HTMLDivElement | null;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
blurTimeout: any;
|
|
30
|
+
/** @hidden */
|
|
31
|
+
blur: () => void;
|
|
32
|
+
/** @hidden */
|
|
33
|
+
focus: () => void;
|
|
34
|
+
/** @hidden */
|
|
35
|
+
anchorClick: () => void;
|
|
36
|
+
/** @hidden */
|
|
37
|
+
closeMenu: () => void;
|
|
38
|
+
render(): JSX.Element;
|
|
39
|
+
}
|
|
@@ -36,41 +36,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
var React = require("react");
|
|
37
37
|
var kendo_react_popup_1 = require("@progress/kendo-react-popup");
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* The GridColumnMenuWrapper component.
|
|
40
40
|
*/
|
|
41
|
-
var
|
|
42
|
-
__extends(
|
|
43
|
-
function
|
|
41
|
+
var GridColumnMenuWrapper = /** @class */ (function (_super) {
|
|
42
|
+
__extends(GridColumnMenuWrapper, _super);
|
|
43
|
+
function GridColumnMenuWrapper() {
|
|
44
44
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
45
|
+
/** @hidden */
|
|
45
46
|
_this.state = {
|
|
46
47
|
show: false
|
|
47
48
|
};
|
|
49
|
+
/** @hidden */
|
|
48
50
|
_this.blurTimeout = undefined;
|
|
51
|
+
/** @hidden */
|
|
49
52
|
_this.blur = function () {
|
|
50
53
|
clearTimeout(_this.blurTimeout);
|
|
51
54
|
_this.blurTimeout = window.setTimeout(function () { _this.closeMenu(); });
|
|
52
55
|
};
|
|
56
|
+
/** @hidden */
|
|
53
57
|
_this.focus = function () {
|
|
54
58
|
clearTimeout(_this.blurTimeout);
|
|
55
59
|
};
|
|
60
|
+
/** @hidden */
|
|
56
61
|
_this.anchorClick = function () {
|
|
57
62
|
_this.setState({ show: !_this.state.show }, function () { return _this.state.show && _this._content && _this._content.focus(); });
|
|
58
63
|
};
|
|
64
|
+
/** @hidden */
|
|
59
65
|
_this.closeMenu = function () {
|
|
60
66
|
_this.setState({ show: false });
|
|
61
67
|
};
|
|
62
68
|
return _this;
|
|
63
69
|
}
|
|
64
|
-
|
|
70
|
+
GridColumnMenuWrapper.prototype.render = function () {
|
|
65
71
|
var _this = this;
|
|
66
|
-
var _a = this.props,
|
|
72
|
+
var _a = this.props, ColumnMenu = _a.columnMenu, others = __rest(_a, ["columnMenu"]);
|
|
67
73
|
return (React.createElement(React.Fragment, null,
|
|
68
74
|
React.createElement("div", { className: 'k-grid-column-menu k-grid-filter', ref: function (e) { return _this._anchor = e; }, onClick: this.anchorClick },
|
|
69
75
|
React.createElement("span", { className: 'k-icon k-i-more-vertical' })),
|
|
70
76
|
React.createElement(kendo_react_popup_1.Popup, { anchor: this._anchor, show: this.state.show },
|
|
71
|
-
React.createElement("div", { ref: function (e) { return _this._content = e; }, className: 'k-grid-columnmenu-popup', tabIndex: 0, onBlur: this.blur, onFocus: this.focus, style: { outline: 'none' } },
|
|
72
|
-
React.createElement(ChildComponent, __assign({}, others, { onCloseMenu: this.closeMenu }))))));
|
|
77
|
+
React.createElement("div", { ref: function (e) { return _this._content = e; }, className: 'k-grid-columnmenu-popup', tabIndex: 0, onBlur: this.blur, onFocus: this.focus, style: { outline: 'none' } }, ColumnMenu && (React.createElement(ColumnMenu, __assign({}, others, { onCloseMenu: this.closeMenu })))))));
|
|
73
78
|
};
|
|
74
|
-
return
|
|
79
|
+
return GridColumnMenuWrapper;
|
|
75
80
|
}(React.Component));
|
|
76
|
-
exports.
|
|
81
|
+
exports.GridColumnMenuWrapper = GridColumnMenuWrapper;
|
|
@@ -25,6 +25,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
var React = require("react");
|
|
28
|
+
var GridColumnMenuWrapper_1 = require("../columnMenu/GridColumnMenuWrapper");
|
|
28
29
|
/**
|
|
29
30
|
* @example
|
|
30
31
|
* ```jsx
|
|
@@ -77,12 +78,15 @@ var GridHeaderCell = /** @class */ (function (_super) {
|
|
|
77
78
|
* @hidden
|
|
78
79
|
*/
|
|
79
80
|
GridHeaderCell.prototype.render = function () {
|
|
81
|
+
var columnMenuWrapperProps = this.props.columnMenuWrapperProps;
|
|
80
82
|
var clickProps = this.props.onClick ? {
|
|
81
83
|
onClick: this.props.onClick
|
|
82
84
|
} : {};
|
|
83
|
-
var defaultRendering = (React.createElement("span",
|
|
84
|
-
React.createElement("span", { className: 'k-
|
|
85
|
-
|
|
85
|
+
var defaultRendering = (React.createElement("span", { className: 'k-cell-inner' },
|
|
86
|
+
React.createElement("span", __assign({ className: 'k-link' }, clickProps),
|
|
87
|
+
React.createElement("span", { className: 'k-column-title' }, this.props.title || this.props.field || '\u00A0'),
|
|
88
|
+
this.props.children),
|
|
89
|
+
columnMenuWrapperProps.columnMenu && React.createElement(GridColumnMenuWrapper_1.GridColumnMenuWrapper, __assign({}, columnMenuWrapperProps))));
|
|
86
90
|
if (this.props.render) {
|
|
87
91
|
return this.props.render.call(undefined, defaultRendering, this.props);
|
|
88
92
|
}
|
|
@@ -29,7 +29,6 @@ var GridSortSettings_1 = require("../interfaces/GridSortSettings");
|
|
|
29
29
|
var ColumnResizer_1 = require("../drag/ColumnResizer");
|
|
30
30
|
var ColumnDraggable_1 = require("../drag/ColumnDraggable");
|
|
31
31
|
var GridHeaderCell_1 = require("./GridHeaderCell");
|
|
32
|
-
var ColumnMenu_1 = require("../columnMenu/ColumnMenu");
|
|
33
32
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
34
33
|
var kendo_react_data_tools_1 = require("@progress/kendo-react-data-tools");
|
|
35
34
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
@@ -71,16 +70,6 @@ var HeaderRow = /** @class */ (function (_super) {
|
|
|
71
70
|
var sortable = _this.props.sortable && column.sortable;
|
|
72
71
|
var sortIndex = _this.props.sort ? _this.props.sort.findIndex(function (s) { return s.field === column.field; }) : -1;
|
|
73
72
|
var sortDir = sortIndex >= 0 ? ((_this.props.sort)[sortIndex].dir || 'none') : 'none';
|
|
74
|
-
var headerCellProps = {
|
|
75
|
-
field: column.field,
|
|
76
|
-
onClick: sortable && (function (e) { return _this.cellClick(e, column); }) || undefined,
|
|
77
|
-
selectionChange: _this.props.selectionChange,
|
|
78
|
-
title: column.title,
|
|
79
|
-
selectionValue: column.headerSelectionValue,
|
|
80
|
-
render: _this.props.cellRender,
|
|
81
|
-
children: _this.sortIcon(sortIndex),
|
|
82
|
-
key: 1
|
|
83
|
-
};
|
|
84
73
|
var columnMenu = (column.columnMenu === null) ? null : (column.columnMenu || _this.props.columnMenu);
|
|
85
74
|
var className = kendo_react_common_1.classNames({
|
|
86
75
|
'k-first': column.kFirst,
|
|
@@ -104,16 +93,36 @@ var HeaderRow = /** @class */ (function (_super) {
|
|
|
104
93
|
} : {
|
|
105
94
|
'role': 'presentation'
|
|
106
95
|
};
|
|
96
|
+
var columnMenuWrapperProps = {
|
|
97
|
+
column: {
|
|
98
|
+
field: column.field,
|
|
99
|
+
filter: column.filter
|
|
100
|
+
},
|
|
101
|
+
sortable: sortable && _this.props.sortable,
|
|
102
|
+
sort: _this.props.sort,
|
|
103
|
+
onSortChange: _this.props.sortChange,
|
|
104
|
+
filter: _this.props.filter,
|
|
105
|
+
filterable: _this.props.filterable && column.filterable,
|
|
106
|
+
filterOperators: _this.props.filterOperators,
|
|
107
|
+
onFilterChange: _this.props.filterChange,
|
|
108
|
+
group: _this.props.group,
|
|
109
|
+
groupable: _this.props.groupable,
|
|
110
|
+
onGroupChange: _this.props.groupChange,
|
|
111
|
+
columnMenu: columnMenu
|
|
112
|
+
};
|
|
113
|
+
var headerCellProps = {
|
|
114
|
+
field: column.field,
|
|
115
|
+
onClick: sortable && (function (e) { return _this.cellClick(e, column); }) || undefined,
|
|
116
|
+
selectionChange: _this.props.selectionChange,
|
|
117
|
+
title: column.title,
|
|
118
|
+
selectionValue: column.headerSelectionValue,
|
|
119
|
+
render: _this.props.cellRender,
|
|
120
|
+
children: _this.sortIcon(sortIndex),
|
|
121
|
+
columnMenuWrapperProps: columnMenuWrapperProps
|
|
122
|
+
};
|
|
107
123
|
var key = (column.declarationIndex >= 0) ? ++_this.index : --_this.serviceIndex;
|
|
108
124
|
return (React.createElement(kendo_react_data_tools_1.HeaderThElement, __assign({}, ariaAttrs, { key: key, colSpan: column.colSpan, rowSpan: column.rowSpan, className: className, style: style, columnId: column.id, navigatable: column.navigatable, onKeyDown: sortable && (function (e) { return _this.cellKeyDown(e, column); }) || undefined }),
|
|
109
|
-
column.headerCell
|
|
110
|
-
!column.headerCell && (React.createElement("span", { className: 'k-cell-inner' },
|
|
111
|
-
React.createElement(GridHeaderCell_1.GridHeaderCell, __assign({}, headerCellProps)),
|
|
112
|
-
columnMenu &&
|
|
113
|
-
React.createElement(ColumnMenu_1.ColumnMenu, { key: 0, column: {
|
|
114
|
-
field: column.field,
|
|
115
|
-
filter: column.filter
|
|
116
|
-
}, sortable: sortable && _this.props.sortable, sort: _this.props.sort, onSortChange: _this.props.sortChange, filter: _this.props.filter, filterable: _this.props.filterable && column.filterable, filterOperators: _this.props.filterOperators, onFilterChange: _this.props.filterChange, group: _this.props.group, groupable: _this.props.groupable, onGroupChange: _this.props.groupChange, render: columnMenu }))),
|
|
125
|
+
column.headerCell ? React.createElement(column.headerCell, __assign({}, headerCellProps)) : React.createElement(GridHeaderCell_1.GridHeaderCell, __assign({}, headerCellProps)),
|
|
117
126
|
_this.props.columnResize && _this.props.columnResize.resizable && column.resizable &&
|
|
118
127
|
React.createElement(ColumnResizer_1.ColumnResizer, { key: 2, resize: function (e, element, end) {
|
|
119
128
|
return _this.props.columnResize &&
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HeaderCellBaseProps } from '@progress/kendo-react-data-tools';
|
|
3
|
+
import { GridColumnMenuWrapperProps } from '../columnMenu/GridColumnMenuWrapper';
|
|
3
4
|
/**
|
|
4
5
|
* The props of the GridHeaderCell component
|
|
5
6
|
* ([more information]({% slug cells_grid %}#toc-header-cells)).
|
|
@@ -9,4 +10,8 @@ export interface GridHeaderCellProps extends HeaderCellBaseProps {
|
|
|
9
10
|
* A function for overriding the default rendering of the header cell.
|
|
10
11
|
*/
|
|
11
12
|
render?: (defaultRendering: React.ReactNode | null, props: GridHeaderCellProps) => React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The props of the Grid column menu wrapper.
|
|
15
|
+
*/
|
|
16
|
+
columnMenuWrapperProps: GridColumnMenuWrapperProps;
|
|
12
17
|
}
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { GridProps } from './interfaces/GridProps';
|
|
|
3
3
|
import { GridColumn } from './GridColumn';
|
|
4
4
|
import { GridColumnProps } from './interfaces/GridColumnProps';
|
|
5
5
|
import { GridColumnMenuProps } from './interfaces/GridColumnMenuProps';
|
|
6
|
+
import { GridColumnMenuWrapper, GridColumnMenuWrapperProps } from './columnMenu/GridColumnMenuWrapper';
|
|
6
7
|
import { GridColumnMenuGroup } from './columnMenu/GridColumnMenuGroup';
|
|
7
8
|
import { GridColumnMenuSort } from './columnMenu/GridColumnMenuSort';
|
|
8
9
|
import { GridColumnMenuFilter } from './columnMenu/GridColumnMenuFilter';
|
|
@@ -39,4 +40,4 @@ import { GridSelectableMode } from './interfaces/GridSelectableSettings';
|
|
|
39
40
|
import { GridColumnMenuFilterUIProps } from './interfaces/GridColumnMenuFilterUIProps';
|
|
40
41
|
import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
|
|
41
42
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
|
|
42
|
-
export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
|
43
|
+
export { Grid, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridFilterOperators, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE };
|
package/dist/npm/main.js
CHANGED
|
@@ -4,6 +4,8 @@ var Grid_1 = require("./Grid");
|
|
|
4
4
|
exports.Grid = Grid_1.Grid;
|
|
5
5
|
var GridColumn_1 = require("./GridColumn");
|
|
6
6
|
exports.GridColumn = GridColumn_1.GridColumn;
|
|
7
|
+
var GridColumnMenuWrapper_1 = require("./columnMenu/GridColumnMenuWrapper");
|
|
8
|
+
exports.GridColumnMenuWrapper = GridColumnMenuWrapper_1.GridColumnMenuWrapper;
|
|
7
9
|
var GridColumnMenuGroup_1 = require("./columnMenu/GridColumnMenuGroup");
|
|
8
10
|
exports.GridColumnMenuGroup = GridColumnMenuGroup_1.GridColumnMenuGroup;
|
|
9
11
|
var GridColumnMenuSort_1 = require("./columnMenu/GridColumnMenuSort");
|
|
@@ -7,7 +7,7 @@ exports.packageMetadata = {
|
|
|
7
7
|
name: '@progress/kendo-react-grid',
|
|
8
8
|
productName: 'KendoReact',
|
|
9
9
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
10
|
+
publishDate: 1637570381,
|
|
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
|
};
|