@progress/kendo-react-grid 4.11.0 → 4.13.0-dev.202111231559
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/Grid.d.ts +2 -1
- package/dist/es/Grid.js +10 -7
- package/dist/es/VirtualScroll.d.ts +3 -2
- package/dist/es/VirtualScroll.js +9 -0
- package/dist/es/columnMenu/GridColumnMenuWrapper.d.ts +8 -0
- package/dist/es/columnMenu/GridColumnMenuWrapper.js +6 -0
- package/dist/es/drag/ColumnDraggable.d.ts +5 -0
- package/dist/es/drag/ColumnDraggable.js +1 -1
- package/dist/es/drag/CommonDragLogic.d.ts +7 -4
- package/dist/es/drag/CommonDragLogic.js +31 -8
- package/dist/es/header/Header.d.ts +2 -1
- package/dist/es/header/Header.js +9 -2
- package/dist/es/header/HeaderRow.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/Grid.d.ts +2 -1
- package/dist/npm/Grid.js +10 -7
- package/dist/npm/VirtualScroll.d.ts +3 -2
- package/dist/npm/VirtualScroll.js +9 -0
- package/dist/npm/columnMenu/GridColumnMenuWrapper.d.ts +8 -0
- package/dist/npm/columnMenu/GridColumnMenuWrapper.js +6 -0
- package/dist/npm/drag/ColumnDraggable.d.ts +5 -0
- package/dist/npm/drag/ColumnDraggable.js +1 -1
- package/dist/npm/drag/CommonDragLogic.d.ts +7 -4
- package/dist/npm/drag/CommonDragLogic.js +31 -8
- package/dist/npm/header/Header.d.ts +2 -1
- package/dist/npm/header/Header.js +9 -2
- package/dist/npm/header/HeaderRow.js +1 -1
- 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/Grid.d.ts
CHANGED
|
@@ -150,15 +150,16 @@ export declare class Grid extends React.Component<GridProps, {}> {
|
|
|
150
150
|
*/
|
|
151
151
|
readonly columns: GridColumnProps[];
|
|
152
152
|
private readonly document;
|
|
153
|
+
private headerRef;
|
|
153
154
|
private element;
|
|
154
155
|
private tableElement;
|
|
155
156
|
private vs;
|
|
156
157
|
private columnResize;
|
|
157
|
-
private _header;
|
|
158
158
|
private _footer;
|
|
159
159
|
private forceUpdateTimeout;
|
|
160
160
|
private isRtl;
|
|
161
161
|
private _gridId;
|
|
162
|
+
private readonly _header;
|
|
162
163
|
constructor(props: GridProps);
|
|
163
164
|
/**
|
|
164
165
|
* Method to allow the scroll to be set to a specific row index.
|
package/dist/es/Grid.js
CHANGED
|
@@ -91,9 +91,9 @@ var Grid = /** @class */ (function (_super) {
|
|
|
91
91
|
_this.contextStateRef = { current: undefined };
|
|
92
92
|
_this.navigationStateRef = { current: undefined };
|
|
93
93
|
_this.wrapperScrollTop = 0;
|
|
94
|
+
_this.headerRef = React.createRef();
|
|
94
95
|
_this.element = null;
|
|
95
96
|
_this.tableElement = null;
|
|
96
|
-
_this._header = null;
|
|
97
97
|
_this._footer = null;
|
|
98
98
|
_this.forceUpdateTimeout = undefined;
|
|
99
99
|
_this.isRtl = false;
|
|
@@ -327,6 +327,13 @@ var Grid = /** @class */ (function (_super) {
|
|
|
327
327
|
enumerable: true,
|
|
328
328
|
configurable: true
|
|
329
329
|
});
|
|
330
|
+
Object.defineProperty(Grid.prototype, "_header", {
|
|
331
|
+
get: function () {
|
|
332
|
+
return this.headerRef.current;
|
|
333
|
+
},
|
|
334
|
+
enumerable: true,
|
|
335
|
+
configurable: true
|
|
336
|
+
});
|
|
330
337
|
/**
|
|
331
338
|
* @hidden
|
|
332
339
|
*/
|
|
@@ -427,9 +434,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
427
434
|
child.type.displayName === 'KendoReactGridNoRecords'; });
|
|
428
435
|
var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
|
|
429
436
|
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 }));
|
|
430
|
-
var header = (React.createElement(Header, { columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: function (
|
|
431
|
-
_this._header = h;
|
|
432
|
-
}, headerRow: React.createElement(HeaderRow, { sort: this.props.sort, sortable: this.props.sortable, sortChange: this.sortChange, group: this.props.group || [], groupable: groupable, groupChange: this.groupChange, filter: this.props.filter, filterable: this.props.filterable, filterOperators: this.props.filterOperators || operators, filterChange: this.filterChange, columnMenu: this.props.columnMenu, selectionChange: this.onHeaderSelectionChange, columns: this._columns, columnResize: this.columnResize, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, columnsMap: this._columnsMap, cellRender: this.props.headerCellRender, isRtl: this.isRtl }), filterRow: this.props.filterable && React.createElement(FilterRow, { 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: column.width !== undefined ?
|
|
437
|
+
var header = (React.createElement(Header, { columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, headerRow: React.createElement(HeaderRow, { sort: this.props.sort, sortable: this.props.sortable, sortChange: this.sortChange, group: this.props.group || [], groupable: groupable, groupChange: this.groupChange, filter: this.props.filter, filterable: this.props.filterable, filterOperators: this.props.filterOperators || operators, filterChange: this.filterChange, columnMenu: this.props.columnMenu, selectionChange: this.onHeaderSelectionChange, columns: this._columns, columnResize: this.columnResize, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, columnsMap: this._columnsMap, cellRender: this.props.headerCellRender, isRtl: this.isRtl, dragClue: this.dragLogic.dragClueRef, headerRef: this.headerRef, containerRef: this.vs.containerRef }), filterRow: this.props.filterable && React.createElement(FilterRow, { 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: column.width !== undefined ?
|
|
433
438
|
Math.floor(parseFloat(column.width.toString())) + 'px' : undefined })); }) }));
|
|
434
439
|
var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
|
|
435
440
|
var tableWidth = parseFloat(((this.props.style || {}).width || '').toString());
|
|
@@ -605,9 +610,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
605
610
|
groupingPanel,
|
|
606
611
|
header,
|
|
607
612
|
React.createElement("div", { className: "k-grid-container", role: "presentation" },
|
|
608
|
-
React.createElement("div", { ref:
|
|
609
|
-
_this.vs.container = container;
|
|
610
|
-
}, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
|
|
613
|
+
React.createElement("div", { ref: this.vs.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
|
|
611
614
|
React.createElement("div", { style: { 'position': 'relative' }, role: "presentation" },
|
|
612
615
|
React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
|
|
613
616
|
_this.vs.table = table;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Page } from './paging/Page';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export declare class VirtualScroll {
|
|
7
|
-
container: HTMLDivElement | null;
|
|
8
7
|
table: HTMLTableElement | null;
|
|
9
8
|
containerHeight: number;
|
|
10
9
|
topCacheCount: number;
|
|
@@ -19,6 +18,8 @@ export declare class VirtualScroll {
|
|
|
19
18
|
heightContainer: any;
|
|
20
19
|
fixedScroll: boolean;
|
|
21
20
|
askedSkip: number | undefined;
|
|
21
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
22
|
+
readonly container: HTMLDivElement | null;
|
|
22
23
|
private prevScrollPos;
|
|
23
24
|
private syncTimeout;
|
|
24
25
|
private tableTranslate;
|
package/dist/es/VirtualScroll.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* @hidden
|
|
3
4
|
*/
|
|
@@ -14,6 +15,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
14
15
|
this.heightContainer = null;
|
|
15
16
|
this.fixedScroll = false;
|
|
16
17
|
this.askedSkip = undefined;
|
|
18
|
+
this.containerRef = React.createRef();
|
|
17
19
|
this.prevScrollPos = 0;
|
|
18
20
|
this.tableTranslate = 0;
|
|
19
21
|
this.scrollSyncing = false;
|
|
@@ -23,6 +25,13 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
23
25
|
}
|
|
24
26
|
this.scrollHandler = this.scrollHandler.bind(this);
|
|
25
27
|
}
|
|
28
|
+
Object.defineProperty(VirtualScroll.prototype, "container", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this.containerRef.current;
|
|
31
|
+
},
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
26
35
|
Object.defineProperty(VirtualScroll.prototype, "rowHeights", {
|
|
27
36
|
/**
|
|
28
37
|
* @return - The row heights in an array.
|
|
@@ -19,13 +19,21 @@ export interface ColumnMenuStateProps {
|
|
|
19
19
|
* The GridColumnMenuWrapper component.
|
|
20
20
|
*/
|
|
21
21
|
export declare class GridColumnMenuWrapper extends React.Component<GridColumnMenuWrapperProps, ColumnMenuStateProps> {
|
|
22
|
+
/** @hidden */
|
|
22
23
|
readonly state: ColumnMenuStateProps;
|
|
24
|
+
/** @hidden */
|
|
23
25
|
_anchor: HTMLDivElement | null;
|
|
26
|
+
/** @hidden */
|
|
24
27
|
_content: HTMLDivElement | null;
|
|
28
|
+
/** @hidden */
|
|
25
29
|
blurTimeout: any;
|
|
30
|
+
/** @hidden */
|
|
26
31
|
blur: () => void;
|
|
32
|
+
/** @hidden */
|
|
27
33
|
focus: () => void;
|
|
34
|
+
/** @hidden */
|
|
28
35
|
anchorClick: () => void;
|
|
36
|
+
/** @hidden */
|
|
29
37
|
closeMenu: () => void;
|
|
30
38
|
render(): JSX.Element;
|
|
31
39
|
}
|
|
@@ -40,20 +40,26 @@ var GridColumnMenuWrapper = /** @class */ (function (_super) {
|
|
|
40
40
|
__extends(GridColumnMenuWrapper, _super);
|
|
41
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
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DragClue } from '@progress/kendo-react-data-tools';
|
|
3
|
+
import { Header } from '../header/Header';
|
|
2
4
|
/**
|
|
3
5
|
* @hidden
|
|
4
6
|
*/
|
|
@@ -7,6 +9,9 @@ export interface ColumnDraggableProps {
|
|
|
7
9
|
dragHandler?: (draggableEvent: any, element: HTMLTableRowElement | HTMLDivElement) => void;
|
|
8
10
|
releaseHandler?: (draggableEvent: any) => void;
|
|
9
11
|
ariaRowIndex?: number;
|
|
12
|
+
dragClue?: React.RefObject<DragClue | null> | null;
|
|
13
|
+
headerRef?: React.RefObject<Header | null> | null;
|
|
14
|
+
containerRef?: React.RefObject<HTMLDivElement | null> | null;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* @hidden
|
|
@@ -51,7 +51,7 @@ var ColumnDraggable = /** @class */ (function (_super) {
|
|
|
51
51
|
}
|
|
52
52
|
ColumnDraggable.prototype.render = function () {
|
|
53
53
|
var _this = this;
|
|
54
|
-
return (React.createElement(Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { _this.draggable = component; } },
|
|
54
|
+
return (React.createElement(Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, hint: this.props.dragClue, autoScroll: { boundaryElementRef: this.props.headerRef, direction: { horizontal: true, vertical: false } }, scrollContainer: this.props.containerRef || undefined, ref: function (component) { _this.draggable = component; } },
|
|
55
55
|
React.createElement("tr", { style: { touchAction: 'none' }, role: "row", "aria-rowindex": this.props.ariaRowIndex }, this.props.children)));
|
|
56
56
|
};
|
|
57
57
|
return ColumnDraggable;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { DragClue, DropClue } from '@progress/kendo-react-data-tools';
|
|
2
3
|
import { ExtendedColumnProps } from '../GridColumn';
|
|
3
4
|
/**
|
|
@@ -8,6 +9,8 @@ export declare type handler = (prevIndex: number, nextIndex: number, nativeEvent
|
|
|
8
9
|
* @hidden
|
|
9
10
|
*/
|
|
10
11
|
export declare class CommonDragLogic {
|
|
12
|
+
refDragElementClue: React.RefObject<DragClue>;
|
|
13
|
+
refDropElementClue: React.RefObject<DropClue>;
|
|
11
14
|
columns: ExtendedColumnProps[];
|
|
12
15
|
reorderable: boolean;
|
|
13
16
|
groupable: boolean;
|
|
@@ -18,13 +21,13 @@ export declare class CommonDragLogic {
|
|
|
18
21
|
private columnReorder;
|
|
19
22
|
private groupReorder;
|
|
20
23
|
private columnToGroup;
|
|
21
|
-
private dropElementClue;
|
|
22
|
-
private dragElementClue;
|
|
23
24
|
private groupPanelDivElement;
|
|
25
|
+
readonly dragClueRef: React.RefObject<DragClue | null>;
|
|
26
|
+
readonly dropClueRef: React.RefObject<DropClue | null>;
|
|
27
|
+
private readonly dragElementClue;
|
|
28
|
+
private readonly dropElementClue;
|
|
24
29
|
constructor(columnReorder: handler, groupReorder: handler, columnToGroup: handler);
|
|
25
30
|
refGroupPanelDiv: (e: HTMLDivElement) => void;
|
|
26
|
-
refDropElementClue: (e: DropClue) => void;
|
|
27
|
-
refDragElementClue: (e: DragClue) => void;
|
|
28
31
|
pressHandler: (event: any, element: HTMLDivElement | HTMLTableRowElement) => void;
|
|
29
32
|
dragHandler: (event: any, element: HTMLDivElement | HTMLTableRowElement) => void;
|
|
30
33
|
releaseHandler: (event: any) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { getIndex } from '@progress/kendo-react-data-tools';
|
|
2
3
|
/**
|
|
3
4
|
* @hidden
|
|
@@ -5,24 +6,18 @@ import { getIndex } from '@progress/kendo-react-data-tools';
|
|
|
5
6
|
var CommonDragLogic = /** @class */ (function () {
|
|
6
7
|
function CommonDragLogic(columnReorder, groupReorder, columnToGroup) {
|
|
7
8
|
var _this = this;
|
|
9
|
+
this.refDragElementClue = React.createRef();
|
|
10
|
+
this.refDropElementClue = React.createRef();
|
|
8
11
|
this.reorderable = false;
|
|
9
12
|
this.groupable = false;
|
|
10
13
|
this.startColumn = -1;
|
|
11
14
|
this.startGroup = -1;
|
|
12
15
|
this.currentColumn = -1;
|
|
13
16
|
this.currentGroup = -1;
|
|
14
|
-
this.dropElementClue = null;
|
|
15
|
-
this.dragElementClue = null;
|
|
16
17
|
this.groupPanelDivElement = null;
|
|
17
18
|
this.refGroupPanelDiv = function (e) {
|
|
18
19
|
_this.groupPanelDivElement = e;
|
|
19
20
|
};
|
|
20
|
-
this.refDropElementClue = function (e) {
|
|
21
|
-
_this.dropElementClue = e;
|
|
22
|
-
};
|
|
23
|
-
this.refDragElementClue = function (e) {
|
|
24
|
-
_this.dragElementClue = e;
|
|
25
|
-
};
|
|
26
21
|
this.pressHandler = function (event, element) {
|
|
27
22
|
var startColumn = _this.getColumnIndex(event, element);
|
|
28
23
|
_this.startGroup = _this.getGroupIndex(event);
|
|
@@ -88,6 +83,34 @@ var CommonDragLogic = /** @class */ (function () {
|
|
|
88
83
|
this.groupReorder = groupReorder;
|
|
89
84
|
this.columnToGroup = columnToGroup;
|
|
90
85
|
}
|
|
86
|
+
Object.defineProperty(CommonDragLogic.prototype, "dragClueRef", {
|
|
87
|
+
get: function () {
|
|
88
|
+
return this.refDragElementClue;
|
|
89
|
+
},
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(CommonDragLogic.prototype, "dropClueRef", {
|
|
94
|
+
get: function () {
|
|
95
|
+
return this.refDropElementClue;
|
|
96
|
+
},
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(CommonDragLogic.prototype, "dragElementClue", {
|
|
101
|
+
get: function () {
|
|
102
|
+
return this.refDragElementClue.current;
|
|
103
|
+
},
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(CommonDragLogic.prototype, "dropElementClue", {
|
|
108
|
+
get: function () {
|
|
109
|
+
return this.refDropElementClue.current;
|
|
110
|
+
},
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true
|
|
113
|
+
});
|
|
91
114
|
CommonDragLogic.prototype.getColumnIndex = function (event, parent) {
|
|
92
115
|
if (!parent || (parent.parentElement === this.groupPanelDivElement)) {
|
|
93
116
|
return -1;
|
|
@@ -18,11 +18,12 @@ export interface HeaderProps {
|
|
|
18
18
|
* @hidden
|
|
19
19
|
*/
|
|
20
20
|
export declare class Header extends React.Component<HeaderProps, {}> {
|
|
21
|
-
private
|
|
21
|
+
private elementRef;
|
|
22
22
|
private headerWrap;
|
|
23
23
|
private table;
|
|
24
24
|
private syncScroll;
|
|
25
25
|
private scrollbarWidth;
|
|
26
|
+
readonly element: HTMLDivElement | null;
|
|
26
27
|
componentDidMount(): void;
|
|
27
28
|
/**
|
|
28
29
|
*
|
package/dist/es/header/Header.js
CHANGED
|
@@ -32,7 +32,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
32
32
|
__extends(Header, _super);
|
|
33
33
|
function Header() {
|
|
34
34
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
-
_this.
|
|
35
|
+
_this.elementRef = React.createRef();
|
|
36
36
|
_this.headerWrap = null;
|
|
37
37
|
_this.table = null;
|
|
38
38
|
_this.syncScroll = false;
|
|
@@ -53,6 +53,13 @@ var Header = /** @class */ (function (_super) {
|
|
|
53
53
|
};
|
|
54
54
|
return _this;
|
|
55
55
|
}
|
|
56
|
+
Object.defineProperty(Header.prototype, "element", {
|
|
57
|
+
get: function () {
|
|
58
|
+
return this.elementRef.current;
|
|
59
|
+
},
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true
|
|
62
|
+
});
|
|
56
63
|
Header.prototype.componentDidMount = function () {
|
|
57
64
|
var rtl = isRtl(this.element);
|
|
58
65
|
if (this.props.columnResize) {
|
|
@@ -86,7 +93,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
86
93
|
this.props.headerRow,
|
|
87
94
|
this.props.filterRow));
|
|
88
95
|
}
|
|
89
|
-
return (React.createElement("div", { ref:
|
|
96
|
+
return (React.createElement("div", { ref: this.elementRef, className: classNames('k-grid-header', { 'k-grid-draggable-header': this.props.draggable }), role: "presentation" },
|
|
90
97
|
React.createElement("div", { ref: function (div) { _this.headerWrap = div; }, className: "k-grid-header-wrap", style: this.scrollbarWidth ? {} : { borderWidth: 0 }, onScroll: this.onScroll, role: "presentation" },
|
|
91
98
|
React.createElement("table", { ref: function (table) { _this.table = table; }, role: "presentation" },
|
|
92
99
|
React.createElement("colgroup", { ref: function (e) { _this.props.columnResize.colGroupHeader = e; }, role: "presentation" }, this.props.cols),
|
|
@@ -162,7 +162,7 @@ var HeaderRow = /** @class */ (function (_super) {
|
|
|
162
162
|
this.serviceIndex = 0;
|
|
163
163
|
this.index = -1;
|
|
164
164
|
return this.props.columnsMap.map(function (rowIndexes, i) {
|
|
165
|
-
return _this.props.pressHandler && (React.createElement(ColumnDraggable, { key: i, pressHandler: _this.props.pressHandler, dragHandler: _this.props.dragHandler, releaseHandler: _this.props.releaseHandler, ariaRowIndex: i + 1 }, _this.cells(rowIndexes))) || React.createElement("tr", { role: "row", "aria-rowindex": i + 1 }, _this.cells(rowIndexes));
|
|
165
|
+
return _this.props.pressHandler && (React.createElement(ColumnDraggable, { key: i, pressHandler: _this.props.pressHandler, dragHandler: _this.props.dragHandler, releaseHandler: _this.props.releaseHandler, ariaRowIndex: i + 1, dragClue: _this.props.dragClue, headerRef: _this.props.headerRef, containerRef: _this.props.containerRef }, _this.cells(rowIndexes))) || React.createElement("tr", { role: "row", "aria-rowindex": i + 1 }, _this.cells(rowIndexes));
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
return HeaderRow;
|
|
@@ -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: 1637682566,
|
|
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
|
};
|
package/dist/npm/Grid.d.ts
CHANGED
|
@@ -150,15 +150,16 @@ export declare class Grid extends React.Component<GridProps, {}> {
|
|
|
150
150
|
*/
|
|
151
151
|
readonly columns: GridColumnProps[];
|
|
152
152
|
private readonly document;
|
|
153
|
+
private headerRef;
|
|
153
154
|
private element;
|
|
154
155
|
private tableElement;
|
|
155
156
|
private vs;
|
|
156
157
|
private columnResize;
|
|
157
|
-
private _header;
|
|
158
158
|
private _footer;
|
|
159
159
|
private forceUpdateTimeout;
|
|
160
160
|
private isRtl;
|
|
161
161
|
private _gridId;
|
|
162
|
+
private readonly _header;
|
|
162
163
|
constructor(props: GridProps);
|
|
163
164
|
/**
|
|
164
165
|
* Method to allow the scroll to be set to a specific row index.
|
package/dist/npm/Grid.js
CHANGED
|
@@ -93,9 +93,9 @@ var Grid = /** @class */ (function (_super) {
|
|
|
93
93
|
_this.contextStateRef = { current: undefined };
|
|
94
94
|
_this.navigationStateRef = { current: undefined };
|
|
95
95
|
_this.wrapperScrollTop = 0;
|
|
96
|
+
_this.headerRef = React.createRef();
|
|
96
97
|
_this.element = null;
|
|
97
98
|
_this.tableElement = null;
|
|
98
|
-
_this._header = null;
|
|
99
99
|
_this._footer = null;
|
|
100
100
|
_this.forceUpdateTimeout = undefined;
|
|
101
101
|
_this.isRtl = false;
|
|
@@ -329,6 +329,13 @@ var Grid = /** @class */ (function (_super) {
|
|
|
329
329
|
enumerable: true,
|
|
330
330
|
configurable: true
|
|
331
331
|
});
|
|
332
|
+
Object.defineProperty(Grid.prototype, "_header", {
|
|
333
|
+
get: function () {
|
|
334
|
+
return this.headerRef.current;
|
|
335
|
+
},
|
|
336
|
+
enumerable: true,
|
|
337
|
+
configurable: true
|
|
338
|
+
});
|
|
332
339
|
/**
|
|
333
340
|
* @hidden
|
|
334
341
|
*/
|
|
@@ -429,9 +436,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
429
436
|
child.type.displayName === 'KendoReactGridNoRecords'; });
|
|
430
437
|
var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
|
|
431
438
|
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 }));
|
|
432
|
-
var header = (React.createElement(Header_1.Header, { columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: function (
|
|
433
|
-
_this._header = h;
|
|
434
|
-
}, headerRow: React.createElement(HeaderRow_1.HeaderRow, { sort: this.props.sort, sortable: this.props.sortable, sortChange: this.sortChange, group: this.props.group || [], groupable: groupable, groupChange: this.groupChange, filter: this.props.filter, filterable: this.props.filterable, filterOperators: this.props.filterOperators || filterCommon_1.operators, filterChange: this.filterChange, columnMenu: this.props.columnMenu, selectionChange: this.onHeaderSelectionChange, columns: this._columns, columnResize: this.columnResize, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, columnsMap: this._columnsMap, cellRender: this.props.headerCellRender, isRtl: this.isRtl }), filterRow: this.props.filterable && React.createElement(FilterRow_1.FilterRow, { 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: column.width !== undefined ?
|
|
439
|
+
var header = (React.createElement(Header_1.Header, { columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, headerRow: React.createElement(HeaderRow_1.HeaderRow, { sort: this.props.sort, sortable: this.props.sortable, sortChange: this.sortChange, group: this.props.group || [], groupable: groupable, groupChange: this.groupChange, filter: this.props.filter, filterable: this.props.filterable, filterOperators: this.props.filterOperators || filterCommon_1.operators, filterChange: this.filterChange, columnMenu: this.props.columnMenu, selectionChange: this.onHeaderSelectionChange, columns: this._columns, columnResize: this.columnResize, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, columnsMap: this._columnsMap, cellRender: this.props.headerCellRender, isRtl: this.isRtl, dragClue: this.dragLogic.dragClueRef, headerRef: this.headerRef, containerRef: this.vs.containerRef }), filterRow: this.props.filterable && React.createElement(FilterRow_1.FilterRow, { 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: column.width !== undefined ?
|
|
435
440
|
Math.floor(parseFloat(column.width.toString())) + 'px' : undefined })); }) }));
|
|
436
441
|
var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
|
|
437
442
|
var tableWidth = parseFloat(((this.props.style || {}).width || '').toString());
|
|
@@ -607,9 +612,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
607
612
|
groupingPanel,
|
|
608
613
|
header,
|
|
609
614
|
React.createElement("div", { className: "k-grid-container", role: "presentation" },
|
|
610
|
-
React.createElement("div", { ref:
|
|
611
|
-
_this.vs.container = container;
|
|
612
|
-
}, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
|
|
615
|
+
React.createElement("div", { ref: this.vs.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
|
|
613
616
|
React.createElement("div", { style: { 'position': 'relative' }, role: "presentation" },
|
|
614
617
|
React.createElement(kendo_react_data_tools_1.TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
|
|
615
618
|
_this.vs.table = table;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Page } from './paging/Page';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export declare class VirtualScroll {
|
|
7
|
-
container: HTMLDivElement | null;
|
|
8
7
|
table: HTMLTableElement | null;
|
|
9
8
|
containerHeight: number;
|
|
10
9
|
topCacheCount: number;
|
|
@@ -19,6 +18,8 @@ export declare class VirtualScroll {
|
|
|
19
18
|
heightContainer: any;
|
|
20
19
|
fixedScroll: boolean;
|
|
21
20
|
askedSkip: number | undefined;
|
|
21
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
22
|
+
readonly container: HTMLDivElement | null;
|
|
22
23
|
private prevScrollPos;
|
|
23
24
|
private syncTimeout;
|
|
24
25
|
private tableTranslate;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var React = require("react");
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -16,6 +17,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
16
17
|
this.heightContainer = null;
|
|
17
18
|
this.fixedScroll = false;
|
|
18
19
|
this.askedSkip = undefined;
|
|
20
|
+
this.containerRef = React.createRef();
|
|
19
21
|
this.prevScrollPos = 0;
|
|
20
22
|
this.tableTranslate = 0;
|
|
21
23
|
this.scrollSyncing = false;
|
|
@@ -25,6 +27,13 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
25
27
|
}
|
|
26
28
|
this.scrollHandler = this.scrollHandler.bind(this);
|
|
27
29
|
}
|
|
30
|
+
Object.defineProperty(VirtualScroll.prototype, "container", {
|
|
31
|
+
get: function () {
|
|
32
|
+
return this.containerRef.current;
|
|
33
|
+
},
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
28
37
|
Object.defineProperty(VirtualScroll.prototype, "rowHeights", {
|
|
29
38
|
/**
|
|
30
39
|
* @return - The row heights in an array.
|
|
@@ -19,13 +19,21 @@ export interface ColumnMenuStateProps {
|
|
|
19
19
|
* The GridColumnMenuWrapper component.
|
|
20
20
|
*/
|
|
21
21
|
export declare class GridColumnMenuWrapper extends React.Component<GridColumnMenuWrapperProps, ColumnMenuStateProps> {
|
|
22
|
+
/** @hidden */
|
|
22
23
|
readonly state: ColumnMenuStateProps;
|
|
24
|
+
/** @hidden */
|
|
23
25
|
_anchor: HTMLDivElement | null;
|
|
26
|
+
/** @hidden */
|
|
24
27
|
_content: HTMLDivElement | null;
|
|
28
|
+
/** @hidden */
|
|
25
29
|
blurTimeout: any;
|
|
30
|
+
/** @hidden */
|
|
26
31
|
blur: () => void;
|
|
32
|
+
/** @hidden */
|
|
27
33
|
focus: () => void;
|
|
34
|
+
/** @hidden */
|
|
28
35
|
anchorClick: () => void;
|
|
36
|
+
/** @hidden */
|
|
29
37
|
closeMenu: () => void;
|
|
30
38
|
render(): JSX.Element;
|
|
31
39
|
}
|
|
@@ -42,20 +42,26 @@ var GridColumnMenuWrapper = /** @class */ (function (_super) {
|
|
|
42
42
|
__extends(GridColumnMenuWrapper, _super);
|
|
43
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
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DragClue } from '@progress/kendo-react-data-tools';
|
|
3
|
+
import { Header } from '../header/Header';
|
|
2
4
|
/**
|
|
3
5
|
* @hidden
|
|
4
6
|
*/
|
|
@@ -7,6 +9,9 @@ export interface ColumnDraggableProps {
|
|
|
7
9
|
dragHandler?: (draggableEvent: any, element: HTMLTableRowElement | HTMLDivElement) => void;
|
|
8
10
|
releaseHandler?: (draggableEvent: any) => void;
|
|
9
11
|
ariaRowIndex?: number;
|
|
12
|
+
dragClue?: React.RefObject<DragClue | null> | null;
|
|
13
|
+
headerRef?: React.RefObject<Header | null> | null;
|
|
14
|
+
containerRef?: React.RefObject<HTMLDivElement | null> | null;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* @hidden
|
|
@@ -53,7 +53,7 @@ var ColumnDraggable = /** @class */ (function (_super) {
|
|
|
53
53
|
}
|
|
54
54
|
ColumnDraggable.prototype.render = function () {
|
|
55
55
|
var _this = this;
|
|
56
|
-
return (React.createElement(kendo_react_common_1.Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { _this.draggable = component; } },
|
|
56
|
+
return (React.createElement(kendo_react_common_1.Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, hint: this.props.dragClue, autoScroll: { boundaryElementRef: this.props.headerRef, direction: { horizontal: true, vertical: false } }, scrollContainer: this.props.containerRef || undefined, ref: function (component) { _this.draggable = component; } },
|
|
57
57
|
React.createElement("tr", { style: { touchAction: 'none' }, role: "row", "aria-rowindex": this.props.ariaRowIndex }, this.props.children)));
|
|
58
58
|
};
|
|
59
59
|
return ColumnDraggable;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { DragClue, DropClue } from '@progress/kendo-react-data-tools';
|
|
2
3
|
import { ExtendedColumnProps } from '../GridColumn';
|
|
3
4
|
/**
|
|
@@ -8,6 +9,8 @@ export declare type handler = (prevIndex: number, nextIndex: number, nativeEvent
|
|
|
8
9
|
* @hidden
|
|
9
10
|
*/
|
|
10
11
|
export declare class CommonDragLogic {
|
|
12
|
+
refDragElementClue: React.RefObject<DragClue>;
|
|
13
|
+
refDropElementClue: React.RefObject<DropClue>;
|
|
11
14
|
columns: ExtendedColumnProps[];
|
|
12
15
|
reorderable: boolean;
|
|
13
16
|
groupable: boolean;
|
|
@@ -18,13 +21,13 @@ export declare class CommonDragLogic {
|
|
|
18
21
|
private columnReorder;
|
|
19
22
|
private groupReorder;
|
|
20
23
|
private columnToGroup;
|
|
21
|
-
private dropElementClue;
|
|
22
|
-
private dragElementClue;
|
|
23
24
|
private groupPanelDivElement;
|
|
25
|
+
readonly dragClueRef: React.RefObject<DragClue | null>;
|
|
26
|
+
readonly dropClueRef: React.RefObject<DropClue | null>;
|
|
27
|
+
private readonly dragElementClue;
|
|
28
|
+
private readonly dropElementClue;
|
|
24
29
|
constructor(columnReorder: handler, groupReorder: handler, columnToGroup: handler);
|
|
25
30
|
refGroupPanelDiv: (e: HTMLDivElement) => void;
|
|
26
|
-
refDropElementClue: (e: DropClue) => void;
|
|
27
|
-
refDragElementClue: (e: DragClue) => void;
|
|
28
31
|
pressHandler: (event: any, element: HTMLDivElement | HTMLTableRowElement) => void;
|
|
29
32
|
dragHandler: (event: any, element: HTMLDivElement | HTMLTableRowElement) => void;
|
|
30
33
|
releaseHandler: (event: any) => void;
|