@progress/kendo-react-grid 7.5.0-develop.19 → 7.5.0-develop.20
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/Grid.js +1 -1
- package/Grid.mjs +114 -112
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +2 -1
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +58 -58
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +57 -56
- package/index.d.mts +13 -0
- package/index.d.ts +13 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
package/header/HeaderRow.mjs
CHANGED
|
@@ -7,77 +7,77 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
|
-
import { normalize as
|
|
11
|
-
import { ColumnDraggable as
|
|
12
|
-
import { GridHeaderCell as
|
|
13
|
-
import { classNames as
|
|
14
|
-
import { ColumnResizer as
|
|
15
|
-
import { useLocalization as
|
|
16
|
-
import { sortAriaLabel as
|
|
17
|
-
import { sortAscSmallIcon as
|
|
18
|
-
import { resolveCells as
|
|
19
|
-
const
|
|
10
|
+
import { normalize as L } from "../interfaces/GridSortSettings.mjs";
|
|
11
|
+
import { ColumnDraggable as O } from "../drag/ColumnDraggable.mjs";
|
|
12
|
+
import { GridHeaderCell as P } from "./GridHeaderCell.mjs";
|
|
13
|
+
import { classNames as V, Keys as f, IconWrap as W } from "@progress/kendo-react-common";
|
|
14
|
+
import { ColumnResizer as q, HeaderThElement as B } from "@progress/kendo-react-data-tools";
|
|
15
|
+
import { useLocalization as T } from "@progress/kendo-react-intl";
|
|
16
|
+
import { sortAriaLabel as M, messages as U } from "../messages/index.mjs";
|
|
17
|
+
import { sortAscSmallIcon as j, sortDescSmallIcon as J } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { resolveCells as Q } from "../utils/index.mjs";
|
|
19
|
+
const X = {
|
|
20
20
|
true: { asc: "desc", desc: "", "": "asc" },
|
|
21
21
|
false: { asc: "desc", desc: "asc", "": "asc" }
|
|
22
|
-
},
|
|
22
|
+
}, Y = {
|
|
23
23
|
none: "none",
|
|
24
24
|
asc: "ascending",
|
|
25
25
|
desc: "descending"
|
|
26
|
-
},
|
|
27
|
-
const [
|
|
28
|
-
let
|
|
29
|
-
const k = (t,
|
|
26
|
+
}, re = (e) => {
|
|
27
|
+
const [z, b] = r.useState(), H = T(), u = r.useRef(null);
|
|
28
|
+
let D = 0, E = -1;
|
|
29
|
+
const k = (t, n) => {
|
|
30
30
|
if (t.preventDefault(), !e.sortChange)
|
|
31
31
|
return;
|
|
32
|
-
const { allowUnsort: l, mode: c } =
|
|
33
|
-
d !== "" &&
|
|
34
|
-
},
|
|
32
|
+
const { allowUnsort: l, mode: c } = L(e.sortable || !1, n.sortable || !1), o = (e.sort || []).filter((i) => i.field === n.field)[0], d = X[l][o && o.dir || ""], s = c === "single" ? [] : (e.sort || []).filter((i) => i.field !== n.field);
|
|
33
|
+
d !== "" && n.field && s.push({ field: n.field, dir: d }), e.sortChange(s, t);
|
|
34
|
+
}, I = (t, n) => {
|
|
35
35
|
if (t.isDefaultPrevented())
|
|
36
36
|
return;
|
|
37
|
-
const { keyCode: l, metaKey: c, ctrlKey: o, altKey: d } = t, s = e.sortable &&
|
|
38
|
-
if (s && t.keyCode ===
|
|
39
|
-
if (e.groupable && (c && l ===
|
|
37
|
+
const { keyCode: l, metaKey: c, ctrlKey: o, altKey: d } = t, s = e.sortable && n.sortable, i = t.target;
|
|
38
|
+
if (s && t.keyCode === f.enter && i.className.indexOf("k-table-th") !== -1 && k(t, n), e.navigatable) {
|
|
39
|
+
if (e.groupable && (c && l === f.enter || o && l === f.space)) {
|
|
40
40
|
t.preventDefault();
|
|
41
|
-
const m = e.columns.findIndex((g) => g.field ===
|
|
41
|
+
const m = e.columns.findIndex((g) => g.field === n.field);
|
|
42
42
|
e.columnGroupChange && e.columnGroupChange(m, t);
|
|
43
43
|
}
|
|
44
|
-
d && l ===
|
|
44
|
+
d && l === f.down && (t.preventDefault(), b(n.field), u.current = i);
|
|
45
45
|
}
|
|
46
|
-
},
|
|
47
|
-
b(void 0),
|
|
46
|
+
}, x = () => {
|
|
47
|
+
b(void 0), u.current && u.current.getAttribute("tabindex") !== "-1" && u.current.focus();
|
|
48
48
|
}, v = (t) => e.sort ? t >= 0 && [
|
|
49
49
|
/* @__PURE__ */ r.createElement("span", { key: 1, className: "k-sort-icon" }, /* @__PURE__ */ r.createElement(
|
|
50
|
-
|
|
50
|
+
W,
|
|
51
51
|
{
|
|
52
52
|
name: "sort-" + e.sort[t].dir + "-small",
|
|
53
|
-
icon: e.sort[t].dir === "asc" ?
|
|
53
|
+
icon: e.sort[t].dir === "asc" ? j : J
|
|
54
54
|
}
|
|
55
55
|
)),
|
|
56
56
|
e.sort.length > 1 && /* @__PURE__ */ r.createElement("span", { key: 2, className: "k-sort-icon" }, /* @__PURE__ */ r.createElement("span", { className: "k-sort-order" }, t + 1))
|
|
57
|
-
] : null, y = (t) => t.map((
|
|
58
|
-
const l = e.columns[
|
|
57
|
+
] : null, y = (t) => t.map((n) => {
|
|
58
|
+
const l = e.columns[n], c = e.sortable && l.sortable, o = e.sort ? e.sort.findIndex((a) => a.field === l.field) : -1, d = o >= 0 && e.sort[o].dir || "none", s = l.columnMenu === null ? null : l.columnMenu || e.columnMenu, i = l.menuIcon || e.columnMenuIcon, m = V({
|
|
59
59
|
"k-first": l.kFirst,
|
|
60
60
|
"k-filterable": !!s,
|
|
61
61
|
"k-table-th": !0,
|
|
62
62
|
"k-header": !0,
|
|
63
63
|
"k-grid-header-sticky": l.locked,
|
|
64
|
-
"k-sorted": e.sort && e.sort.some((
|
|
64
|
+
"k-sorted": e.sort && e.sort.some((a) => a.field === l.field)
|
|
65
65
|
}, l.headerClassName);
|
|
66
66
|
l.locked === !1 && (l.left = 0);
|
|
67
|
-
const
|
|
68
|
-
ariaSort:
|
|
67
|
+
const g = l.left !== void 0 ? e.isRtl ? { left: l.right, right: l.left } : { left: l.left, right: l.right } : {}, N = H.toLanguageString(M, U[M]), K = l.isAccessible ? {
|
|
68
|
+
ariaSort: Y[d],
|
|
69
69
|
role: "columnheader",
|
|
70
70
|
ariaColumnIndex: l.ariaColumnIndex,
|
|
71
71
|
ariaSelected: !1,
|
|
72
|
-
ariaDescription: c ?
|
|
72
|
+
ariaDescription: c ? N : ""
|
|
73
73
|
} : {
|
|
74
74
|
role: "presentation"
|
|
75
|
-
}, h = l.declarationIndex >= 0 ? ++
|
|
76
|
-
|
|
75
|
+
}, h = l.declarationIndex >= 0 ? ++E : --D, A = l.headerCell ? l.headerCell : P, R = /* @__PURE__ */ r.createElement(
|
|
76
|
+
A,
|
|
77
77
|
{
|
|
78
78
|
key: 1,
|
|
79
79
|
field: l.field,
|
|
80
|
-
onClick: c && ((
|
|
80
|
+
onClick: c && ((a) => k(a, l)) || void 0,
|
|
81
81
|
selectionChange: e.selectionChange,
|
|
82
82
|
title: l.title,
|
|
83
83
|
selectionValue: l.headerSelectionValue,
|
|
@@ -98,43 +98,44 @@ const Q = {
|
|
|
98
98
|
filterable: e.filterable && l.filterable,
|
|
99
99
|
filterOperators: e.filterOperators,
|
|
100
100
|
onFilterChange: e.filterChange,
|
|
101
|
-
show:
|
|
102
|
-
onCloseMenu:
|
|
101
|
+
show: z === l.field ? !0 : void 0,
|
|
102
|
+
onCloseMenu: x,
|
|
103
103
|
navigatable: e.navigatable,
|
|
104
104
|
group: e.group,
|
|
105
105
|
groupable: e.groupable,
|
|
106
106
|
onGroupChange: e.groupChange,
|
|
107
|
-
columnMenu: s
|
|
107
|
+
columnMenu: s,
|
|
108
|
+
columnMenuIcon: i
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
), S = {
|
|
111
|
-
...
|
|
112
|
+
...K,
|
|
112
113
|
key: h,
|
|
113
114
|
colSpan: l.colSpan,
|
|
114
115
|
rowSpan: l.rowSpan,
|
|
115
|
-
className:
|
|
116
|
-
style:
|
|
116
|
+
className: m,
|
|
117
|
+
style: g,
|
|
117
118
|
columnId: l.id,
|
|
118
119
|
navigatable: l.navigatable,
|
|
119
|
-
onKeyDown: (
|
|
120
|
+
onKeyDown: (a) => I(a, l),
|
|
120
121
|
role: "columnheader"
|
|
121
122
|
}, w = [
|
|
122
123
|
R,
|
|
123
124
|
e.columnResize && e.columnResize.resizable && l.resizable && /* @__PURE__ */ r.createElement(
|
|
124
|
-
|
|
125
|
+
q,
|
|
125
126
|
{
|
|
126
127
|
key: 2,
|
|
127
|
-
resize: (
|
|
128
|
-
autofit: (
|
|
128
|
+
resize: (a, F, G) => e.columnResize && e.columnResize.dragHandler(a, l, F, G),
|
|
129
|
+
autofit: (a) => e.columnResize && e.columnResize.dblClickHandler(a, [l.id])
|
|
129
130
|
}
|
|
130
131
|
)
|
|
131
|
-
], C =
|
|
132
|
+
], C = Q(e.cells, l.cells);
|
|
132
133
|
if (C && C.headerCell) {
|
|
133
|
-
const
|
|
134
|
-
return /* @__PURE__ */ r.createElement(
|
|
134
|
+
const a = C.headerCell;
|
|
135
|
+
return /* @__PURE__ */ r.createElement(a, { ...R.props, key: h, thProps: S, index: n }, w);
|
|
135
136
|
}
|
|
136
137
|
return /* @__PURE__ */ r.createElement(
|
|
137
|
-
|
|
138
|
+
B,
|
|
138
139
|
{
|
|
139
140
|
...S,
|
|
140
141
|
key: h
|
|
@@ -142,21 +143,21 @@ const Q = {
|
|
|
142
143
|
w
|
|
143
144
|
);
|
|
144
145
|
});
|
|
145
|
-
return e.columnsMap.map((t,
|
|
146
|
-
|
|
146
|
+
return e.columnsMap.map((t, n) => e.pressHandler && /* @__PURE__ */ r.createElement(
|
|
147
|
+
O,
|
|
147
148
|
{
|
|
148
|
-
key:
|
|
149
|
+
key: n,
|
|
149
150
|
pressHandler: e.pressHandler,
|
|
150
151
|
dragHandler: e.dragHandler,
|
|
151
152
|
releaseHandler: e.releaseHandler,
|
|
152
|
-
ariaRowIndex:
|
|
153
|
+
ariaRowIndex: n + 1,
|
|
153
154
|
dragClue: e.dragClue,
|
|
154
155
|
headerRef: e.headerRef,
|
|
155
156
|
containerRef: e.containerRef
|
|
156
157
|
},
|
|
157
158
|
y(t)
|
|
158
|
-
) || /* @__PURE__ */ r.createElement("tr", { key:
|
|
159
|
+
) || /* @__PURE__ */ r.createElement("tr", { key: n, className: "k-table-row", role: "row", "aria-rowindex": n + 1 }, y(t)));
|
|
159
160
|
};
|
|
160
161
|
export {
|
|
161
|
-
|
|
162
|
+
re as HeaderRow
|
|
162
163
|
};
|
package/index.d.mts
CHANGED
|
@@ -36,6 +36,7 @@ import { SortDescriptor } from '@progress/kendo-data-query';
|
|
|
36
36
|
import { SortSettings } from '@progress/kendo-react-data-tools';
|
|
37
37
|
import { State } from '@progress/kendo-data-query';
|
|
38
38
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
39
|
+
import { SVGIcon as SVGIcon_2 } from '@progress/kendo-svg-icons';
|
|
39
40
|
import { TABLE_COL_INDEX_ATTRIBUTE } from '@progress/kendo-react-data-tools';
|
|
40
41
|
import { TableDragSelectionReleaseEvent } from '@progress/kendo-react-data-tools';
|
|
41
42
|
import { TableKeyboardNavigationContextType } from '@progress/kendo-react-data-tools';
|
|
@@ -1194,6 +1195,10 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
|
|
|
1194
1195
|
* The component to be rendered as content of the Grid column menu.
|
|
1195
1196
|
*/
|
|
1196
1197
|
columnMenu?: React_2.ComponentType<GridColumnMenuProps> | null;
|
|
1198
|
+
/**
|
|
1199
|
+
* The icon that overrides the default(three vertical dots) icon displayed in the column menu of each column.
|
|
1200
|
+
*/
|
|
1201
|
+
columnMenuIcon?: SVGIcon;
|
|
1197
1202
|
}
|
|
1198
1203
|
|
|
1199
1204
|
/**
|
|
@@ -1244,6 +1249,10 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1244
1249
|
* Defines the editor type. Used when the column enters the edit mode ([more information and examples]({% slug editing_inline_grid %})). Defaults to `text`.
|
|
1245
1250
|
*/
|
|
1246
1251
|
editor?: 'text' | 'numeric' | 'boolean' | 'date';
|
|
1252
|
+
/**
|
|
1253
|
+
* Overrides the default(three vertical dots) column menu icon or the icon set through the ([`columnMenuIcon`]({% slug api_grid_gridprops %}#toc-columnmenuicon)) property.
|
|
1254
|
+
*/
|
|
1255
|
+
menuIcon?: SVGIcon;
|
|
1247
1256
|
/**
|
|
1248
1257
|
* Defines the component that will be rendered as a cell. If not set, a `GridCell` will be rendered by default.
|
|
1249
1258
|
*/
|
|
@@ -2147,6 +2156,10 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
|
|
|
2147
2156
|
* Specifies a React element that will be cloned and rendered inside the column menu of the Grid. Can be overridden on column level.
|
|
2148
2157
|
*/
|
|
2149
2158
|
columnMenu?: null | ComponentType<GridColumnMenuProps>;
|
|
2159
|
+
/**
|
|
2160
|
+
* Globally overrides the default(three vertical dots) column menu icon for the whole Grid. If set, the prop can be overridden on column level using the ([menuIcon]({% slug api_grid_gridcolumnprops %}#toc-menuicon)) property.
|
|
2161
|
+
*/
|
|
2162
|
+
columnMenuIcon?: SVGIcon_2;
|
|
2150
2163
|
/**
|
|
2151
2164
|
* The [descriptors]({% slug api_kendo-data-query_groupdescriptor %})[] by which the data will be grouped
|
|
2152
2165
|
* ([more information and examples]({% slug groupingbasics_grid %})).
|
package/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { SortDescriptor } from '@progress/kendo-data-query';
|
|
|
36
36
|
import { SortSettings } from '@progress/kendo-react-data-tools';
|
|
37
37
|
import { State } from '@progress/kendo-data-query';
|
|
38
38
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
39
|
+
import { SVGIcon as SVGIcon_2 } from '@progress/kendo-svg-icons';
|
|
39
40
|
import { TABLE_COL_INDEX_ATTRIBUTE } from '@progress/kendo-react-data-tools';
|
|
40
41
|
import { TableDragSelectionReleaseEvent } from '@progress/kendo-react-data-tools';
|
|
41
42
|
import { TableKeyboardNavigationContextType } from '@progress/kendo-react-data-tools';
|
|
@@ -1194,6 +1195,10 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
|
|
|
1194
1195
|
* The component to be rendered as content of the Grid column menu.
|
|
1195
1196
|
*/
|
|
1196
1197
|
columnMenu?: React_2.ComponentType<GridColumnMenuProps> | null;
|
|
1198
|
+
/**
|
|
1199
|
+
* The icon that overrides the default(three vertical dots) icon displayed in the column menu of each column.
|
|
1200
|
+
*/
|
|
1201
|
+
columnMenuIcon?: SVGIcon;
|
|
1197
1202
|
}
|
|
1198
1203
|
|
|
1199
1204
|
/**
|
|
@@ -1244,6 +1249,10 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1244
1249
|
* Defines the editor type. Used when the column enters the edit mode ([more information and examples]({% slug editing_inline_grid %})). Defaults to `text`.
|
|
1245
1250
|
*/
|
|
1246
1251
|
editor?: 'text' | 'numeric' | 'boolean' | 'date';
|
|
1252
|
+
/**
|
|
1253
|
+
* Overrides the default(three vertical dots) column menu icon or the icon set through the ([`columnMenuIcon`]({% slug api_grid_gridprops %}#toc-columnmenuicon)) property.
|
|
1254
|
+
*/
|
|
1255
|
+
menuIcon?: SVGIcon;
|
|
1247
1256
|
/**
|
|
1248
1257
|
* Defines the component that will be rendered as a cell. If not set, a `GridCell` will be rendered by default.
|
|
1249
1258
|
*/
|
|
@@ -2147,6 +2156,10 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
|
|
|
2147
2156
|
* Specifies a React element that will be cloned and rendered inside the column menu of the Grid. Can be overridden on column level.
|
|
2148
2157
|
*/
|
|
2149
2158
|
columnMenu?: null | ComponentType<GridColumnMenuProps>;
|
|
2159
|
+
/**
|
|
2160
|
+
* Globally overrides the default(three vertical dots) column menu icon for the whole Grid. If set, the prop can be overridden on column level using the ([menuIcon]({% slug api_grid_gridcolumnprops %}#toc-menuicon)) property.
|
|
2161
|
+
*/
|
|
2162
|
+
columnMenuIcon?: SVGIcon_2;
|
|
2150
2163
|
/**
|
|
2151
2164
|
* The [descriptors]({% slug api_kendo-data-query_groupdescriptor %})[] by which the data will be grouped
|
|
2152
2165
|
* ([more information and examples]({% slug groupingbasics_grid %})).
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-grid",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1715351893,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "7.5.0-develop.
|
|
3
|
+
"version": "7.5.0-develop.20",
|
|
4
4
|
"description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
26
|
"@progress/kendo-drawing": "^1.20.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "7.5.0-develop.
|
|
29
|
-
"@progress/kendo-react-buttons": "7.5.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "7.5.0-develop.
|
|
31
|
-
"@progress/kendo-react-data-tools": "7.5.0-develop.
|
|
32
|
-
"@progress/kendo-react-dateinputs": "7.5.0-develop.
|
|
33
|
-
"@progress/kendo-react-dropdowns": "7.5.0-develop.
|
|
34
|
-
"@progress/kendo-react-inputs": "7.5.0-develop.
|
|
35
|
-
"@progress/kendo-react-intl": "7.5.0-develop.
|
|
36
|
-
"@progress/kendo-react-popup": "7.5.0-develop.
|
|
28
|
+
"@progress/kendo-react-animation": "7.5.0-develop.20",
|
|
29
|
+
"@progress/kendo-react-buttons": "7.5.0-develop.20",
|
|
30
|
+
"@progress/kendo-react-common": "7.5.0-develop.20",
|
|
31
|
+
"@progress/kendo-react-data-tools": "7.5.0-develop.20",
|
|
32
|
+
"@progress/kendo-react-dateinputs": "7.5.0-develop.20",
|
|
33
|
+
"@progress/kendo-react-dropdowns": "7.5.0-develop.20",
|
|
34
|
+
"@progress/kendo-react-inputs": "7.5.0-develop.20",
|
|
35
|
+
"@progress/kendo-react-intl": "7.5.0-develop.20",
|
|
36
|
+
"@progress/kendo-react-popup": "7.5.0-develop.20",
|
|
37
37
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
38
38
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
39
39
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|