@progress/kendo-react-grid 8.2.0-develop.9 → 8.2.1-develop.1
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 +193 -185
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +27 -27
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +8 -6
- package/index.d.mts +27 -9
- package/index.d.ts +27 -9
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +82 -82
package/cells/GridEditCell.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),f=require("../utils/index.js"),b=require("@progress/kendo-react-inputs"),N=require("@progress/kendo-react-dateinputs"),g=require("@progress/kendo-react-common"),E=require("@progress/kendo-react-data-tools"),r=require("../constants/index.js");function _(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(n,l,i.get?i:{enumerable:!0,get:()=>e[l]})}}return n.default=e,Object.freeze(n)}const t=_(T),h=e=>{const n=f.getNestedValue(e.field,e.dataItem);let l=null;const i=g.classNames("k-table-td","k-grid-edit-cell",{"k-selected":e.isSelected},e.className),I=g.useId(),o=E.useTableKeyboardNavigation(e.id);let c=null,d=null;const C=t.useCallback(a=>{if(e.onChange){const k=a.target.type==="checkbox"?a.target.checked:a.target.value;e.onChange({dataItem:e.dataItem,dataIndex:e.dataIndex,field:e.field,syntheticEvent:a,value:k})}},[e.onChange,e.dataItem,e.dataIndex,e.field]),m=t.useCallback(a=>{e.onContextMenu&&e.onContextMenu.call(void 0,a,e.dataItem,e.field)},[e.onContextMenu,e.dataItem,e.field]),s=t.useCallback(a=>{e.onChange&&e.onChange({dataItem:e.dataItem,dataIndex:e.dataIndex,field:e.field,syntheticEvent:a.syntheticEvent,value:a.value})},[e.onChange,e.dataItem,e.dataIndex,e.field]);switch(e.editor){case"numeric":{c={onContextMenu:m,colSpan:e.colSpan,style:e.style,className:i,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...o},d=t.createElement(b.NumericTextBox,{value:n===void 0?null:n,onChange:s,[E.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),l=t.createElement("td",{...c},d);break}case"date":c={onContextMenu:m,colSpan:e.colSpan,style:e.style,className:i,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...o},d=t.createElement(N.DatePicker,{value:n,onChange:s,[E.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),l=t.createElement("td",{...c},d);break;case"boolean":c={onContextMenu:m,colSpan:e.colSpan,style:e.style,className:i,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...o},d=[t.createElement("span",{key:1,className:"k-checkbox-wrap"},t.createElement("input",{checked:n||!1,id:I,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:C})),t.createElement("label",{className:"k-checkbox-label",htmlFor:I,key:2})],l=t.createElement("td",{...c},d);break;default:c={onContextMenu:m,colSpan:e.colSpan,style:e.style,className:i,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...o},d=t.createElement("input",{style:{width:"100%"},className:"k-input",value:n||"",onChange:C,[E.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),l=t.createElement("td",{...c},d)}const x=e.editor||"text",u=e.cells;if(u){let a;return u.edit&&u.edit[x]?a=u.edit[x]:u.data&&(a=u.data),t.createElement(a,{...e,tdProps:c},d)}return e.render?e.render.call(void 0,l,e):l};exports.GridEditCell=h;
|
package/cells/GridEditCell.mjs
CHANGED
|
@@ -14,11 +14,11 @@ import { classNames as s, useId as N } from "@progress/kendo-react-common";
|
|
|
14
14
|
import { useTableKeyboardNavigation as S, TABLE_PREVENT_SELECTION_ELEMENT as C } from "@progress/kendo-react-data-tools";
|
|
15
15
|
import { GRID_COL_INDEX_ATTRIBUTE as x } from "../constants/index.mjs";
|
|
16
16
|
const L = (e) => {
|
|
17
|
-
const
|
|
17
|
+
const i = r(e.field, e.dataItem);
|
|
18
18
|
let d = null;
|
|
19
|
-
const
|
|
19
|
+
const m = s("k-table-td", "k-grid-edit-cell", {
|
|
20
20
|
"k-selected": e.isSelected
|
|
21
|
-
}, e.className), I = N(),
|
|
21
|
+
}, e.className), I = N(), u = S(e.id);
|
|
22
22
|
let l = null, n = null;
|
|
23
23
|
const k = a.useCallback(
|
|
24
24
|
(t) => {
|
|
@@ -34,9 +34,9 @@ const L = (e) => {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
[e.onChange, e.dataItem, e.dataIndex, e.field]
|
|
37
|
-
),
|
|
37
|
+
), o = a.useCallback((t) => {
|
|
38
38
|
e.onContextMenu && e.onContextMenu.call(void 0, t, e.dataItem, e.field);
|
|
39
|
-
}, [e.onContextMenu, e.dataItem, e.field]),
|
|
39
|
+
}, [e.onContextMenu, e.dataItem, e.field]), f = a.useCallback(
|
|
40
40
|
(t) => {
|
|
41
41
|
e.onChange && e.onChange({
|
|
42
42
|
dataItem: e.dataItem,
|
|
@@ -51,20 +51,20 @@ const L = (e) => {
|
|
|
51
51
|
switch (e.editor) {
|
|
52
52
|
case "numeric": {
|
|
53
53
|
l = {
|
|
54
|
-
onContextMenu:
|
|
54
|
+
onContextMenu: o,
|
|
55
55
|
colSpan: e.colSpan,
|
|
56
56
|
style: e.style,
|
|
57
|
-
className:
|
|
57
|
+
className: m,
|
|
58
58
|
"aria-colindex": e.ariaColumnIndex,
|
|
59
59
|
"aria-selected": e.isSelected,
|
|
60
60
|
[x]: e.columnIndex,
|
|
61
61
|
role: "gridcell",
|
|
62
|
-
...
|
|
62
|
+
...u
|
|
63
63
|
}, n = /* @__PURE__ */ a.createElement(
|
|
64
64
|
E,
|
|
65
65
|
{
|
|
66
|
-
value:
|
|
67
|
-
onChange:
|
|
66
|
+
value: i === void 0 ? null : i,
|
|
67
|
+
onChange: f,
|
|
68
68
|
[C]: !0
|
|
69
69
|
}
|
|
70
70
|
), d = /* @__PURE__ */ a.createElement(
|
|
@@ -78,20 +78,20 @@ const L = (e) => {
|
|
|
78
78
|
}
|
|
79
79
|
case "date":
|
|
80
80
|
l = {
|
|
81
|
-
onContextMenu:
|
|
81
|
+
onContextMenu: o,
|
|
82
82
|
colSpan: e.colSpan,
|
|
83
83
|
style: e.style,
|
|
84
|
-
className:
|
|
84
|
+
className: m,
|
|
85
85
|
"aria-colindex": e.ariaColumnIndex,
|
|
86
86
|
"aria-selected": e.isSelected,
|
|
87
87
|
[x]: e.columnIndex,
|
|
88
88
|
role: "gridcell",
|
|
89
|
-
...
|
|
89
|
+
...u
|
|
90
90
|
}, n = /* @__PURE__ */ a.createElement(
|
|
91
91
|
b,
|
|
92
92
|
{
|
|
93
|
-
value:
|
|
94
|
-
onChange:
|
|
93
|
+
value: i,
|
|
94
|
+
onChange: f,
|
|
95
95
|
[C]: !0
|
|
96
96
|
}
|
|
97
97
|
), d = /* @__PURE__ */ a.createElement(
|
|
@@ -104,20 +104,20 @@ const L = (e) => {
|
|
|
104
104
|
break;
|
|
105
105
|
case "boolean":
|
|
106
106
|
l = {
|
|
107
|
-
onContextMenu:
|
|
107
|
+
onContextMenu: o,
|
|
108
108
|
colSpan: e.colSpan,
|
|
109
109
|
style: e.style,
|
|
110
|
-
className:
|
|
110
|
+
className: m,
|
|
111
111
|
"aria-colindex": e.ariaColumnIndex,
|
|
112
112
|
"aria-selected": e.isSelected,
|
|
113
113
|
[x]: e.columnIndex,
|
|
114
114
|
role: "gridcell",
|
|
115
|
-
...
|
|
115
|
+
...u
|
|
116
116
|
}, n = [
|
|
117
117
|
/* @__PURE__ */ a.createElement("span", { key: 1, className: "k-checkbox-wrap" }, /* @__PURE__ */ a.createElement(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
|
-
checked:
|
|
120
|
+
checked: i || !1,
|
|
121
121
|
id: I,
|
|
122
122
|
type: "checkbox",
|
|
123
123
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
@@ -135,21 +135,21 @@ const L = (e) => {
|
|
|
135
135
|
break;
|
|
136
136
|
default:
|
|
137
137
|
l = {
|
|
138
|
-
onContextMenu:
|
|
138
|
+
onContextMenu: o,
|
|
139
139
|
colSpan: e.colSpan,
|
|
140
140
|
style: e.style,
|
|
141
|
-
className:
|
|
141
|
+
className: m,
|
|
142
142
|
"aria-colindex": e.ariaColumnIndex,
|
|
143
143
|
"aria-selected": e.isSelected,
|
|
144
144
|
[x]: e.columnIndex,
|
|
145
145
|
role: "gridcell",
|
|
146
|
-
...
|
|
146
|
+
...u
|
|
147
147
|
}, n = /* @__PURE__ */ a.createElement(
|
|
148
148
|
"input",
|
|
149
149
|
{
|
|
150
150
|
style: { width: "100%" },
|
|
151
151
|
className: "k-input",
|
|
152
|
-
value:
|
|
152
|
+
value: i || "",
|
|
153
153
|
onChange: k,
|
|
154
154
|
[C]: !0
|
|
155
155
|
}
|
|
@@ -161,10 +161,10 @@ const L = (e) => {
|
|
|
161
161
|
n
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
return /* @__PURE__ */ a.createElement(t, { ...e, tdProps: l }, n);
|
|
164
|
+
const g = e.editor || "text", c = e.cells;
|
|
165
|
+
if (c) {
|
|
166
|
+
let t;
|
|
167
|
+
return c.edit && c.edit[g] ? t = c.edit[g] : c.data && (t = c.data), /* @__PURE__ */ a.createElement(t, { ...e, tdProps: l }, n);
|
|
168
168
|
}
|
|
169
169
|
return e.render ? e.render.call(void 0, d, e) : d;
|
|
170
170
|
};
|