@progress/kendo-react-grid 10.2.0 → 11.0.0-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.
Files changed (40) hide show
  1. package/GridClientWrapper.js +1 -1
  2. package/GridClientWrapper.mjs +264 -246
  3. package/GridComponent.js +1 -1
  4. package/GridComponent.mjs +220 -216
  5. package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
  6. package/columnMenu/GridColumnMenuCheckboxFilter.mjs +125 -95
  7. package/columnMenu/GridColumnMenuColumnsChooser.js +1 -1
  8. package/columnMenu/GridColumnMenuColumnsChooser.mjs +104 -58
  9. package/columnMenu/GridColumnMenuFilter.js +1 -1
  10. package/columnMenu/GridColumnMenuFilter.mjs +119 -97
  11. package/columnMenu/GridColumnMenuFilterCell.js +1 -1
  12. package/columnMenu/GridColumnMenuFilterCell.mjs +47 -44
  13. package/columnMenu/GridColumnMenuFilterUI.js +1 -1
  14. package/columnMenu/GridColumnMenuFilterUI.mjs +28 -14
  15. package/columnMenu/GridColumnMenuItem.js +1 -1
  16. package/columnMenu/GridColumnMenuItem.mjs +9 -6
  17. package/columnMenu/GridColumnMenuWrapper.js +1 -1
  18. package/columnMenu/GridColumnMenuWrapper.mjs +68 -71
  19. package/columnMenu/adaptiveContent/GridActionSheetFooter.js +9 -0
  20. package/columnMenu/adaptiveContent/GridActionSheetFooter.mjs +24 -0
  21. package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.js +9 -0
  22. package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.mjs +73 -0
  23. package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.js +9 -0
  24. package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.mjs +84 -0
  25. package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.js +9 -0
  26. package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.mjs +66 -0
  27. package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.js +9 -0
  28. package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.mjs +67 -0
  29. package/columnMenu/adaptiveContext/GridColumnMenuAdaptiveContext.js +9 -0
  30. package/columnMenu/adaptiveContext/GridColumnMenuAdaptiveContext.mjs +17 -0
  31. package/components/GridEditDialog.js +9 -0
  32. package/components/GridEditDialog.mjs +207 -0
  33. package/dist/cdn/js/kendo-react-grid.js +1 -1
  34. package/index.d.mts +87 -3
  35. package/index.d.ts +87 -3
  36. package/messages/index.js +1 -1
  37. package/messages/index.mjs +76 -54
  38. package/package-metadata.js +1 -1
  39. package/package-metadata.mjs +2 -2
  40. package/package.json +16 -13
@@ -0,0 +1,207 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import e from "react";
10
+ import _ from "react-dom";
11
+ import { ActionSheet as O, ActionSheetContent as V, ActionSheetFooter as G } from "@progress/kendo-react-layout";
12
+ import { Button as r } from "@progress/kendo-react-buttons";
13
+ import { Label as v, Error as b } from "@progress/kendo-react-labels";
14
+ import { useLocalization as W } from "@progress/kendo-react-intl";
15
+ import { DatePicker as j } from "@progress/kendo-react-dateinputs";
16
+ import { useAdaptiveModeContext as q } from "@progress/kendo-react-common";
17
+ import { xIcon as H, cancelIcon as D, saveIcon as N } from "@progress/kendo-svg-icons";
18
+ import { TextBox as J, Checkbox as K, NumericTextBox as P } from "@progress/kendo-react-inputs";
19
+ import { TABLE_PREVENT_SELECTION_ELEMENT as p } from "@progress/kendo-react-data-tools";
20
+ import { Dialog as Q, DialogActionsBar as U } from "@progress/kendo-react-dialogs";
21
+ import { Form as T, FormElement as F, FieldWrapper as M, Field as w } from "@progress/kendo-react-form";
22
+ import { GridContext as X } from "../GridClientWrapper.mjs";
23
+ import { editDialogTitle as z, messages as S, editDialogSaveButtonTitle as B, editDialogCancelButtonTitle as L } from "../messages/index.mjs";
24
+ const fe = (l) => {
25
+ var y;
26
+ const C = W(), m = q(), i = e.useContext(X), c = (a, t) => {
27
+ i.onDialogEditSubmit && i.onDialogEditSubmit({ dataItem: a, syntheticEvent: t });
28
+ }, n = (a) => {
29
+ i.onDialogEditCancel && i.onDialogEditCancel({ syntheticEvent: a });
30
+ }, k = (a) => {
31
+ const { validationMessage: t, visited: Y, id: s, valid: Z, editor: R, value: E, label: u, ...f } = a, g = i.mobileMode ? "large" : "medium";
32
+ switch (R) {
33
+ case "numeric":
34
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(v, { editorId: s, className: "k-form-label" }, u, ":"), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
35
+ P,
36
+ {
37
+ ...f,
38
+ size: g,
39
+ value: E,
40
+ [p]: !0
41
+ }
42
+ ), t && /* @__PURE__ */ e.createElement(b, null, t)));
43
+ case "date":
44
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(v, { editorId: s, className: "k-form-label" }, u, ":"), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
45
+ j,
46
+ {
47
+ valid: !0,
48
+ ...f,
49
+ value: E,
50
+ adaptive: i.mobileMode,
51
+ size: g,
52
+ [p]: !0
53
+ }
54
+ ), t && /* @__PURE__ */ e.createElement(b, null, t)));
55
+ case "boolean":
56
+ return /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(v, { editorId: s, className: "k-form-label" }, u, ":  ", /* @__PURE__ */ e.createElement(
57
+ K,
58
+ {
59
+ ...f,
60
+ size: g,
61
+ value: E,
62
+ [p]: !0
63
+ }
64
+ ), t && /* @__PURE__ */ e.createElement(b, null, t)));
65
+ default:
66
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(v, { editorId: s, className: "k-form-label" }, u, ":"), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
67
+ J,
68
+ {
69
+ ...f,
70
+ size: g,
71
+ value: E || "",
72
+ [p]: !0
73
+ }
74
+ ), t && /* @__PURE__ */ e.createElement(b, null, t)));
75
+ }
76
+ }, I = C.toLanguageString(z, S[z]), h = C.toLanguageString(
77
+ B,
78
+ S[B]
79
+ ), x = C.toLanguageString(
80
+ L,
81
+ S[L]
82
+ ), A = {
83
+ animation: !0,
84
+ navigatable: !1,
85
+ navigatableElements: [],
86
+ expand: !0,
87
+ title: i.adpativeTitle || I,
88
+ suffixActions: /* @__PURE__ */ e.createElement(r, { svgIcon: H, onClick: n, fillMode: "flat" }),
89
+ animationStyles: m && i.adaptiveColumnMenuRef <= m.small ? { top: 0, width: "100%", height: "100%" } : void 0,
90
+ className: "k-adaptive-actionsheet",
91
+ position: m && i.adaptiveColumnMenuRef <= m.small ? "fullscreen" : void 0
92
+ }, { customEditDialog: d } = l, o = (y = l.columns) == null ? void 0 : y.filter((a) => a.editable);
93
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, _.createPortal(
94
+ // eslint-disable-next-line react/jsx-no-useless-fragment
95
+ /* @__PURE__ */ e.createElement(e.Fragment, null, i.mobileMode ? (
96
+ // eslint-disable-next-line react/jsx-no-useless-fragment
97
+ /* @__PURE__ */ e.createElement(e.Fragment, null, d ? /* @__PURE__ */ e.createElement(
98
+ d,
99
+ {
100
+ columns: l.columns,
101
+ dataItem: l.dataItem,
102
+ onSubmit: c,
103
+ onCancel: n
104
+ }
105
+ ) : /* @__PURE__ */ e.createElement(
106
+ T,
107
+ {
108
+ initialValues: l.dataItem,
109
+ onSubmit: c,
110
+ id: "kendo-grid-edit-dialog",
111
+ render: (a) => /* @__PURE__ */ e.createElement(O, { ...A }, /* @__PURE__ */ e.createElement(V, null, /* @__PURE__ */ e.createElement(F, null, o == null ? void 0 : o.map((t) => /* @__PURE__ */ e.createElement(M, { key: t.field }, /* @__PURE__ */ e.createElement(
112
+ w,
113
+ {
114
+ name: t.field,
115
+ id: t.field,
116
+ editor: t.editor,
117
+ component: k,
118
+ label: t.title || t.field,
119
+ validator: t == null ? void 0 : t.validator
120
+ }
121
+ ))))), /* @__PURE__ */ e.createElement(G, null, /* @__PURE__ */ e.createElement(
122
+ r,
123
+ {
124
+ onClick: n,
125
+ type: "reset",
126
+ icon: "cancel",
127
+ size: "large",
128
+ svgIcon: D
129
+ },
130
+ x
131
+ ), /* @__PURE__ */ e.createElement(
132
+ r,
133
+ {
134
+ type: "submit",
135
+ themeColor: "primary",
136
+ size: "large",
137
+ disabled: !a.allowSubmit || !a.valid,
138
+ onClick: a.onSubmit,
139
+ icon: "save",
140
+ svgIcon: N
141
+ },
142
+ h
143
+ )))
144
+ }
145
+ ))
146
+ ) : d ? /* @__PURE__ */ e.createElement(
147
+ d,
148
+ {
149
+ columns: l.columns,
150
+ dataItem: l.dataItem,
151
+ onSubmit: c,
152
+ onCancel: n
153
+ }
154
+ ) : /* @__PURE__ */ e.createElement(
155
+ T,
156
+ {
157
+ initialValues: l.dataItem,
158
+ onSubmit: c,
159
+ id: "kendo-grid-edit-dialog",
160
+ render: (a) => /* @__PURE__ */ e.createElement(
161
+ Q,
162
+ {
163
+ title: I,
164
+ width: 450,
165
+ onClose: (t) => n(t.syntheticEvent)
166
+ },
167
+ /* @__PURE__ */ e.createElement(F, null, o == null ? void 0 : o.map((t) => /* @__PURE__ */ e.createElement(M, { key: t.field }, /* @__PURE__ */ e.createElement(
168
+ w,
169
+ {
170
+ name: t.field,
171
+ id: t.field,
172
+ editor: t.editor,
173
+ component: k,
174
+ label: t.title || t.field,
175
+ validator: t == null ? void 0 : t.validator
176
+ }
177
+ )))),
178
+ /* @__PURE__ */ e.createElement(U, { layout: "start" }, /* @__PURE__ */ e.createElement(
179
+ r,
180
+ {
181
+ type: "submit",
182
+ themeColor: "primary",
183
+ disabled: !a.allowSubmit || !a.valid,
184
+ onClick: a.onSubmit,
185
+ icon: "save",
186
+ svgIcon: N
187
+ },
188
+ h
189
+ ), /* @__PURE__ */ e.createElement(
190
+ r,
191
+ {
192
+ onClick: n,
193
+ type: "reset",
194
+ icon: "cancel",
195
+ svgIcon: D
196
+ },
197
+ x
198
+ ))
199
+ )
200
+ }
201
+ )),
202
+ document.body
203
+ ));
204
+ };
205
+ export {
206
+ fe as GridEditDialog
207
+ };