@progress/kendo-react-webmcp 15.0.1-develop.3 → 15.0.1-develop.5
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/WebMcpProvider.js +1 -1
- package/WebMcpProvider.mjs +84 -80
- package/adapters/button.d.ts +1 -1
- package/adapters/button.js +1 -1
- package/adapters/button.mjs +12 -17
- package/adapters/{dashboard.d.ts → checkbox.d.ts} +5 -6
- package/adapters/checkbox.js +8 -0
- package/adapters/checkbox.mjs +60 -0
- package/adapters/dropdowntree.js +1 -1
- package/adapters/dropdowntree.mjs +78 -51
- package/adapters/editor.d.ts +0 -1
- package/adapters/editor.js +1 -1
- package/adapters/editor.mjs +38 -46
- package/adapters/form.d.ts +1 -0
- package/adapters/form.js +3 -3
- package/adapters/form.mjs +75 -49
- package/adapters/gantt.d.ts +2 -0
- package/adapters/gantt.js +1 -1
- package/adapters/gantt.mjs +188 -140
- package/adapters/grid.d.ts +0 -1
- package/adapters/grid.js +1 -1
- package/adapters/grid.mjs +52 -60
- package/adapters/multicolumncombobox.d.ts +20 -0
- package/adapters/multicolumncombobox.js +8 -0
- package/adapters/multicolumncombobox.mjs +75 -0
- package/adapters/multiselect.d.ts +2 -0
- package/adapters/multiselect.js +1 -1
- package/adapters/multiselect.mjs +46 -30
- package/adapters/notification.js +1 -1
- package/adapters/notification.mjs +14 -14
- package/adapters/pivotgrid.js +1 -1
- package/adapters/pivotgrid.mjs +39 -47
- package/adapters/scheduler.js +1 -1
- package/adapters/scheduler.mjs +137 -92
- package/adapters/spreadsheet.js +1 -1
- package/adapters/spreadsheet.mjs +3 -3
- package/adapters/switch.js +1 -1
- package/adapters/switch.mjs +29 -19
- package/adapters/treeview.js +2 -2
- package/adapters/treeview.mjs +79 -113
- package/adapters/window.d.ts +0 -2
- package/adapters/window.js +1 -1
- package/adapters/window.mjs +29 -63
- package/commands/form.d.ts +4 -1
- package/commands/form.js +1 -1
- package/commands/form.mjs +11 -7
- package/commands/gantt.js +1 -1
- package/commands/gantt.mjs +14 -10
- package/commands/grid.d.ts +0 -4
- package/commands/grid.js +1 -1
- package/commands/grid.mjs +18 -24
- package/commands/index.d.ts +0 -1
- package/commands/pivotgrid.d.ts +0 -4
- package/commands/pivotgrid.js +1 -1
- package/commands/pivotgrid.mjs +6 -12
- package/commands/scheduler.d.ts +10 -0
- package/commands/scheduler.js +1 -1
- package/commands/scheduler.mjs +16 -4
- package/commands/window.d.ts +0 -8
- package/commands/window.js +1 -1
- package/commands/window.mjs +8 -18
- package/dist/cdn/js/kendo-react-webmcp.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/index.mjs +248 -249
- package/package.json +3 -3
- package/schemas/gantt.d.ts +4 -0
- package/schemas/gantt.js +1 -1
- package/schemas/gantt.mjs +93 -8
- package/schemas/scheduler.d.ts +2 -0
- package/schemas/scheduler.js +1 -1
- package/schemas/scheduler.mjs +21 -5
- package/adapters/dashboard.js +0 -8
- package/adapters/dashboard.mjs +0 -41
- package/commands/dashboard.d.ts +0 -19
- package/commands/dashboard.js +0 -8
- package/commands/dashboard.mjs +0 -21
package/adapters/grid.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as O from "react";
|
|
9
|
-
import { getGridToolSchema as
|
|
9
|
+
import { getGridToolSchema as B } from "../commands/grid.mjs";
|
|
10
10
|
function C(r, n, e, t, a) {
|
|
11
11
|
const i = r.current;
|
|
12
12
|
if (n)
|
|
@@ -25,7 +25,7 @@ function C(r, n, e, t, a) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Q(r) {
|
|
29
29
|
const n = [];
|
|
30
30
|
return O.Children.forEach(r, (e) => {
|
|
31
31
|
if (O.isValidElement(e) && e.props.field) {
|
|
@@ -34,13 +34,13 @@ function Y(r) {
|
|
|
34
34
|
}
|
|
35
35
|
}), n;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Y(r, n, e) {
|
|
38
38
|
if (!r.field)
|
|
39
39
|
return { content: [{ type: "text", text: "Missing required argument: field" }], isError: !0 };
|
|
40
40
|
const t = r.field, a = r.dir || "asc", i = [{ field: t, dir: a }];
|
|
41
41
|
return C(n, n.current.onSortChange, { sort: i }, { sort: i }, e), { content: [{ type: "text", text: `Sorted by ${t} ${a}.` }] };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Z(r, n, e, t) {
|
|
44
44
|
var u, s;
|
|
45
45
|
if (!r.field || !r.operator)
|
|
46
46
|
return { content: [{ type: "text", text: "Missing required arguments: field, operator" }], isError: !0 };
|
|
@@ -50,14 +50,14 @@ function V(r, n, e, t) {
|
|
|
50
50
|
};
|
|
51
51
|
return C(n, l.onFilterChange, { filter: c }, { filter: c, skip: 0 }, e), { content: [{ type: "text", text: `Filter applied: ${a} ${i} "${o}".` }] };
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function V(r, n, e) {
|
|
54
54
|
var l;
|
|
55
55
|
if (!r.field)
|
|
56
56
|
return { content: [{ type: "text", text: "Missing required argument: field" }], isError: !0 };
|
|
57
57
|
const t = r.field, a = r.dir || "asc", i = n.current, o = [...(l = i.group) != null ? l : [], { field: t, dir: a }];
|
|
58
58
|
return C(n, i.onGroupChange, { group: o }, { group: o }, e), { content: [{ type: "text", text: `Grouped by ${t} ${a}.` }] };
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function R(r, n, e) {
|
|
61
61
|
var o;
|
|
62
62
|
const t = Number(r.page);
|
|
63
63
|
if (!t || t < 1)
|
|
@@ -65,7 +65,7 @@ function ee(r, n, e) {
|
|
|
65
65
|
const a = (o = n.current.take) != null ? o : 10, i = (t - 1) * a;
|
|
66
66
|
return C(n, n.current.onPageChange, { page: { skip: i, take: a } }, { skip: i, take: a }, e), { content: [{ type: "text", text: `Navigated to page ${t}.` }] };
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ee(r, n, e) {
|
|
69
69
|
const t = Number(r.pageSize);
|
|
70
70
|
return !t || t < 1 ? { content: [{ type: "text", text: "Invalid page size." }], isError: !0 } : (C(
|
|
71
71
|
n,
|
|
@@ -75,15 +75,15 @@ function te(r, n, e) {
|
|
|
75
75
|
e
|
|
76
76
|
), { content: [{ type: "text", text: `Page size set to ${t}.` }] });
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function te(r, n, e, t, a) {
|
|
79
79
|
const i = e.current;
|
|
80
80
|
switch (r) {
|
|
81
81
|
case "GridSort":
|
|
82
|
-
return
|
|
82
|
+
return Y(n, e, t);
|
|
83
83
|
case "GridClearSort":
|
|
84
84
|
return C(e, i.onSortChange, { sort: [] }, { sort: [] }, t), { content: [{ type: "text", text: "Sorting cleared." }] };
|
|
85
85
|
case "GridFilter":
|
|
86
|
-
return
|
|
86
|
+
return Z(n, e, t, a);
|
|
87
87
|
case "GridClearFilter": {
|
|
88
88
|
const o = { logic: "and", filters: [] };
|
|
89
89
|
return C(
|
|
@@ -95,13 +95,13 @@ function re(r, n, e, t, a) {
|
|
|
95
95
|
), { content: [{ type: "text", text: "All filters cleared." }] };
|
|
96
96
|
}
|
|
97
97
|
case "GridGroup":
|
|
98
|
-
return
|
|
98
|
+
return V(n, e, t);
|
|
99
99
|
case "GridClearGroup":
|
|
100
100
|
return C(e, i.onGroupChange, { group: [] }, { group: [] }, t), { content: [{ type: "text", text: "Grouping cleared." }] };
|
|
101
101
|
case "GridPage":
|
|
102
|
-
return
|
|
102
|
+
return R(n, e, t);
|
|
103
103
|
case "GridPageSize":
|
|
104
|
-
return
|
|
104
|
+
return ee(n, e, t);
|
|
105
105
|
default:
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
@@ -109,7 +109,7 @@ function re(r, n, e, t, a) {
|
|
|
109
109
|
function $(r) {
|
|
110
110
|
return Array.isArray(r) ? r : r && typeof r == "object" && Array.isArray(r.data) ? r.data : [];
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function re(r, n, e) {
|
|
113
113
|
var c, u;
|
|
114
114
|
if (!r.field || !r.operator)
|
|
115
115
|
return { content: [{ type: "text", text: "Missing required arguments: field, operator" }], isError: !0 };
|
|
@@ -128,7 +128,7 @@ function ne(r, n, e) {
|
|
|
128
128
|
content: [{ type: "text", text: `Highlighted rows where ${t} ${a} "${JSON.stringify(i)}".` }]
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ne(r, n, e) {
|
|
132
132
|
var c, u;
|
|
133
133
|
if (!r.field || !r.operator)
|
|
134
134
|
return { content: [{ type: "text", text: "Missing required arguments: field, operator" }], isError: !0 };
|
|
@@ -154,7 +154,7 @@ function oe(r, n, e) {
|
|
|
154
154
|
content: [{ type: "text", text: `Selected rows where ${t} ${a} "${JSON.stringify(i)}".` }]
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function oe(r, n, e, t, a) {
|
|
158
158
|
const i = n.id;
|
|
159
159
|
if (!i)
|
|
160
160
|
return { content: [{ type: "text", text: "Missing required argument: id" }], isError: !0 };
|
|
@@ -204,7 +204,7 @@ function ae(r, n, e, t, a) {
|
|
|
204
204
|
return null;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function ae(r, n, e, t) {
|
|
208
208
|
const a = e.current;
|
|
209
209
|
if (!a.onItemChange)
|
|
210
210
|
return null;
|
|
@@ -231,47 +231,45 @@ function ie(r, n, e, t) {
|
|
|
231
231
|
return null;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ie(r, n, e, t, a) {
|
|
235
235
|
switch (r) {
|
|
236
236
|
case "GridHighlight":
|
|
237
|
-
return
|
|
237
|
+
return re(n, e, t);
|
|
238
238
|
case "GridClearHighlight":
|
|
239
239
|
return e.current.onHighlightChange && e.current.onHighlightChange({ highlight: {} }), { content: [{ type: "text", text: "Highlights cleared." }] };
|
|
240
240
|
case "GridSelect":
|
|
241
|
-
return
|
|
241
|
+
return ne(n, e, t);
|
|
242
242
|
case "GridClearSelect":
|
|
243
243
|
return e.current.onSelectionChange && e.current.onSelectionChange({ select: {}, target: t }), { content: [{ type: "text", text: "Selection cleared." }] };
|
|
244
244
|
case "GridSelectAll":
|
|
245
|
-
return
|
|
245
|
+
return ce(e, t);
|
|
246
246
|
case "GridDetailExpand":
|
|
247
247
|
case "GridDetailCollapse":
|
|
248
248
|
case "GridDetailExpandAll":
|
|
249
249
|
case "GridDetailCollapseAll":
|
|
250
|
-
return
|
|
250
|
+
return de(r, n, e, t);
|
|
251
251
|
case "GridGroupExpand":
|
|
252
252
|
case "GridGroupCollapse":
|
|
253
253
|
case "GridGroupExpandAll":
|
|
254
254
|
case "GridGroupCollapseAll":
|
|
255
|
-
return
|
|
255
|
+
return me(r, n, e, t);
|
|
256
256
|
case "GridSetAggregates":
|
|
257
|
-
return
|
|
257
|
+
return ue(n, e, t);
|
|
258
258
|
case "GridExportPDF":
|
|
259
259
|
return t != null && t.exportAsPdf && t.exportAsPdf(), { content: [{ type: "text", text: "PDF export triggered." }] };
|
|
260
260
|
case "GridExportCSV":
|
|
261
261
|
return t != null && t.saveAsCsv ? t.saveAsCsv().then(() => ({ content: [{ type: "text", text: "CSV export triggered." }] })) : { content: [{ type: "text", text: "CSV export not available." }], isError: !0 };
|
|
262
|
-
case "GridExportExcel":
|
|
263
|
-
return t != null && t.saveAsExcel && t.saveAsExcel(), { content: [{ type: "text", text: "Excel export triggered." }] };
|
|
264
262
|
case "GridColumnReorder":
|
|
265
263
|
case "GridColumnResize":
|
|
266
264
|
case "GridColumnShow":
|
|
267
265
|
case "GridColumnHide":
|
|
268
266
|
case "GridColumnLock":
|
|
269
267
|
case "GridColumnUnlock":
|
|
270
|
-
return
|
|
268
|
+
return oe(r, n, e, t);
|
|
271
269
|
case "GridAdd":
|
|
272
270
|
case "GridUpdate":
|
|
273
271
|
case "GridDelete":
|
|
274
|
-
return
|
|
272
|
+
return ae(r, n, e, t);
|
|
275
273
|
default:
|
|
276
274
|
return null;
|
|
277
275
|
}
|
|
@@ -287,7 +285,7 @@ function I(r, n) {
|
|
|
287
285
|
}
|
|
288
286
|
return e;
|
|
289
287
|
}
|
|
290
|
-
function
|
|
288
|
+
function ce(r, n) {
|
|
291
289
|
var i, o;
|
|
292
290
|
const e = r.current;
|
|
293
291
|
if (!e.onHeaderSelectionChange && !e.onSelectionChange)
|
|
@@ -308,7 +306,7 @@ function de(r, n) {
|
|
|
308
306
|
}
|
|
309
307
|
return { content: [{ type: "text", text: "All rows selected." }] };
|
|
310
308
|
}
|
|
311
|
-
function
|
|
309
|
+
function de(r, n, e, t) {
|
|
312
310
|
var l, d;
|
|
313
311
|
const a = e.current;
|
|
314
312
|
if (!a.onDetailExpandChange)
|
|
@@ -324,12 +322,12 @@ function le(r, n, e, t) {
|
|
|
324
322
|
return a.onDetailExpandChange({ detailExpand: {}, target: t }), { content: [{ type: "text", text: "All detail rows collapsed." }] };
|
|
325
323
|
case "GridDetailExpand":
|
|
326
324
|
case "GridDetailCollapse":
|
|
327
|
-
return
|
|
325
|
+
return le(r, n, a, t, i, o);
|
|
328
326
|
default:
|
|
329
327
|
return { content: [{ type: "text", text: `Unknown expand command: ${r}` }], isError: !0 };
|
|
330
328
|
}
|
|
331
329
|
}
|
|
332
|
-
function
|
|
330
|
+
function le(r, n, e, t, a, i) {
|
|
333
331
|
var g;
|
|
334
332
|
if (!n.field || !n.operator)
|
|
335
333
|
return {
|
|
@@ -370,7 +368,7 @@ function k(r, n, e) {
|
|
|
370
368
|
return !1;
|
|
371
369
|
}
|
|
372
370
|
}
|
|
373
|
-
function
|
|
371
|
+
function ue(r, n, e) {
|
|
374
372
|
const t = n.current;
|
|
375
373
|
if (!t.groupable)
|
|
376
374
|
return {
|
|
@@ -388,7 +386,7 @@ function se(r, n, e) {
|
|
|
388
386
|
});
|
|
389
387
|
return C(n, t.onGroupChange, { group: l }, { group: l }, e), { content: [{ type: "text", text: `Aggregate "${i}" added for column "${a}".` }] };
|
|
390
388
|
}
|
|
391
|
-
function
|
|
389
|
+
function se(r, n) {
|
|
392
390
|
const e = [];
|
|
393
391
|
for (const t of r) {
|
|
394
392
|
const a = /* @__PURE__ */ new Set();
|
|
@@ -399,13 +397,13 @@ function pe(r, n) {
|
|
|
399
397
|
}
|
|
400
398
|
return e;
|
|
401
399
|
}
|
|
402
|
-
function
|
|
400
|
+
function pe(r, n, e) {
|
|
403
401
|
if (!r.field || r.value == null)
|
|
404
402
|
return null;
|
|
405
403
|
const t = r.field, a = r.value, i = typeof a == "string" || typeof a == "number" ? String(a) : JSON.stringify(a);
|
|
406
404
|
return { updated: n.find((d) => d.field === t && String(d.value) === i) ? n.map((d) => d.field === t && String(d.value) === i ? { ...d, expanded: e } : d) : [...n, { field: t, value: a, expanded: e }], field: t, valueStr: i };
|
|
407
405
|
}
|
|
408
|
-
function
|
|
406
|
+
function me(r, n, e, t) {
|
|
409
407
|
var i, o, l;
|
|
410
408
|
const a = e.current;
|
|
411
409
|
if (!a.groupable)
|
|
@@ -418,12 +416,12 @@ function ge(r, n, e, t) {
|
|
|
418
416
|
case "GridGroupCollapseAll": {
|
|
419
417
|
if (!a.group || a.group.length === 0)
|
|
420
418
|
return { content: [{ type: "text", text: "No active grouping." }], isError: !0 };
|
|
421
|
-
const d = (o = (i = t == null ? void 0 : t.getLeafDataItems) == null ? void 0 : i.call(t)) != null ? o : $(a.data), c =
|
|
419
|
+
const d = (o = (i = t == null ? void 0 : t.getLeafDataItems) == null ? void 0 : i.call(t)) != null ? o : $(a.data), c = se(a.group, d);
|
|
422
420
|
return a.onGroupExpandChange({ groupExpand: c, target: t }), { content: [{ type: "text", text: "All groups collapsed." }] };
|
|
423
421
|
}
|
|
424
422
|
case "GridGroupExpand":
|
|
425
423
|
case "GridGroupCollapse": {
|
|
426
|
-
const d = r === "GridGroupExpand", c =
|
|
424
|
+
const d = r === "GridGroupExpand", c = pe(n, (l = a.groupExpand) != null ? l : [], d);
|
|
427
425
|
if (!c)
|
|
428
426
|
return { content: [{ type: "text", text: "Missing required arguments: field, value" }], isError: !0 };
|
|
429
427
|
a.onGroupExpandChange({ groupExpand: c.updated, target: t });
|
|
@@ -434,10 +432,10 @@ function ge(r, n, e, t) {
|
|
|
434
432
|
return { content: [{ type: "text", text: `Unknown group expand command: ${r}` }], isError: !0 };
|
|
435
433
|
}
|
|
436
434
|
}
|
|
437
|
-
const
|
|
435
|
+
const Ce = {
|
|
438
436
|
componentSuffix: "grid",
|
|
439
437
|
createTools(r, n, e, t) {
|
|
440
|
-
const a = [], i = (m) => `${e.groupName}_${m}`, o = n.current, l =
|
|
438
|
+
const a = [], i = (m) => `${e.groupName}_${m}`, o = n.current, l = Q(o.children), d = !!o.onHighlightChange, c = !!o.selectable, u = c && (!!o.onHeaderSelectionChange || !!o.dataItemKey), s = !!o.onDetailExpandChange, p = !!o.groupable && !!o.onGroupExpandChange, g = !!o.pdf, G = !!o.csv, w = !!o.reorderable, S = !!o.resizable, h = !!o.onColumnsStateChange, D = !!o.onItemChange || !!o.editable, _ = [
|
|
441
439
|
{
|
|
442
440
|
name: "sort",
|
|
443
441
|
description: `Sort the ${e.dataName} grid by a column`,
|
|
@@ -580,25 +578,19 @@ const ye = {
|
|
|
580
578
|
name: "export_csv",
|
|
581
579
|
description: `Export the ${e.dataName} grid to CSV`,
|
|
582
580
|
commandType: "GridExportCSV",
|
|
583
|
-
enabled: w
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
name: "export_excel",
|
|
587
|
-
description: `Export the ${e.dataName} grid to Excel`,
|
|
588
|
-
commandType: "GridExportExcel",
|
|
589
581
|
enabled: G
|
|
590
582
|
},
|
|
591
583
|
{
|
|
592
584
|
name: "reorder_column",
|
|
593
585
|
description: `Reorder a column in the ${e.dataName} grid`,
|
|
594
586
|
commandType: "GridColumnReorder",
|
|
595
|
-
enabled:
|
|
587
|
+
enabled: w
|
|
596
588
|
},
|
|
597
589
|
{
|
|
598
590
|
name: "resize_column",
|
|
599
591
|
description: `Resize a column in the ${e.dataName} grid`,
|
|
600
592
|
commandType: "GridColumnResize",
|
|
601
|
-
enabled:
|
|
593
|
+
enabled: S
|
|
602
594
|
},
|
|
603
595
|
{
|
|
604
596
|
name: "show_column",
|
|
@@ -646,39 +638,39 @@ const ye = {
|
|
|
646
638
|
name: "get_data",
|
|
647
639
|
description: `Read the data currently visible in the ${e.dataName} grid as JSON`,
|
|
648
640
|
commandType: "GridGetData",
|
|
649
|
-
enabled: !
|
|
641
|
+
enabled: !1
|
|
650
642
|
}
|
|
651
|
-
],
|
|
643
|
+
], b = n.current.webMcp, T = typeof b == "object" && b !== null && typeof b.tools == "function" ? b.tools : void 0, J = { tname: i, columns: l, data: o.data }, j = T ? T(_, J) : _;
|
|
652
644
|
let x = null;
|
|
653
|
-
const
|
|
645
|
+
const W = async (m, f) => {
|
|
654
646
|
var M, q, z, P, F, K, L;
|
|
655
|
-
const v = (q = x == null ? void 0 : x.filters) != null ? q : (M = n.current.filter) == null ? void 0 : M.filters,
|
|
656
|
-
if (
|
|
647
|
+
const v = (q = x == null ? void 0 : x.filters) != null ? q : (M = n.current.filter) == null ? void 0 : M.filters, E = te(m, f, n, r, v);
|
|
648
|
+
if (E)
|
|
657
649
|
return m === "GridFilter" && f.field && f.operator ? x = {
|
|
658
650
|
logic: "and",
|
|
659
651
|
filters: [...(F = (P = x == null ? void 0 : x.filters) != null ? P : (z = n.current.filter) == null ? void 0 : z.filters) != null ? F : [], { field: f.field, operator: f.operator, value: f.value }]
|
|
660
|
-
} : m === "GridClearFilter" && (x = { logic: "and", filters: [] }),
|
|
661
|
-
const H =
|
|
652
|
+
} : m === "GridClearFilter" && (x = { logic: "and", filters: [] }), E;
|
|
653
|
+
const H = ie(m, f, n, r);
|
|
662
654
|
if (H)
|
|
663
655
|
return H;
|
|
664
656
|
if (m === "GridGetData") {
|
|
665
|
-
x && await new Promise((
|
|
657
|
+
x && await new Promise((X) => setTimeout(X, 100));
|
|
666
658
|
const A = 1e3, y = (L = (K = r == null ? void 0 : r.getLeafDataItems) == null ? void 0 : K.call(r)) != null ? L : $(n.current.data), U = Array.isArray(y) && y.length > A ? y.slice(0, A) : y;
|
|
667
659
|
return { content: [{ type: "text", text: JSON.stringify(U !== y ? { rows: U, truncated: !0, total: y.length } : y) }] };
|
|
668
660
|
}
|
|
669
661
|
return { content: [{ type: "text", text: `Unknown command: ${m}` }], isError: !0 };
|
|
670
662
|
};
|
|
671
|
-
for (const m of
|
|
663
|
+
for (const m of j) {
|
|
672
664
|
if (!m.enabled)
|
|
673
665
|
continue;
|
|
674
|
-
const f =
|
|
666
|
+
const f = B(m.commandType, l), v = m.commandType;
|
|
675
667
|
try {
|
|
676
668
|
a.push(
|
|
677
669
|
t.registerTool({
|
|
678
670
|
name: i(m.name),
|
|
679
671
|
description: m.description,
|
|
680
672
|
inputSchema: f,
|
|
681
|
-
execute: async (
|
|
673
|
+
execute: async (E) => W(v, E || {})
|
|
682
674
|
})
|
|
683
675
|
);
|
|
684
676
|
} catch {
|
|
@@ -688,5 +680,5 @@ const ye = {
|
|
|
688
680
|
}
|
|
689
681
|
};
|
|
690
682
|
export {
|
|
691
|
-
|
|
683
|
+
Ce as gridAdapter
|
|
692
684
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ToolAdapter } from '../types';
|
|
9
|
+
interface MultiColumnComboBoxAdapterProps {
|
|
10
|
+
data?: unknown[];
|
|
11
|
+
textField?: string;
|
|
12
|
+
opened?: boolean;
|
|
13
|
+
onChange?: (event: unknown) => void;
|
|
14
|
+
onOpen?: (event: unknown) => void;
|
|
15
|
+
onClose?: (event: unknown) => void;
|
|
16
|
+
webMcp?: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** @hidden */
|
|
19
|
+
export declare const multiColumnComboBoxAdapter: ToolAdapter<unknown, MultiColumnComboBoxAdapterProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../commands/multicolumncombobox.js"),B={componentSuffix:"multicolumncombobox",createTools(l,s,n,h){const C=[],g=t=>`${n.groupName}_${t}`,i=s.current,p=!!i.onChange,b=[{name:"open",description:`Open the ${n.dataName} multi-column combo box popup`,commandType:e.MultiColumnComboBoxCommands.Open,enabled:!!i.onOpen},{name:"close",description:`Close the ${n.dataName} multi-column combo box popup`,commandType:e.MultiColumnComboBoxCommands.Close,enabled:!!i.onClose},{name:"set_value",description:`Select an item from the ${n.dataName} multi-column combo box`,commandType:e.MultiColumnComboBoxCommands.SetValue,enabled:p},{name:"clear",description:`Clear the ${n.dataName} multi-column combo box selection`,commandType:e.MultiColumnComboBoxCommands.Clear,enabled:p}],m=s.current.webMcp,d=typeof m=="object"&&m!==null&&typeof m.tools=="function"?m.tools:void 0,f=d?d(b):b,M=async(t,c)=>{const o=s.current;switch(t){case e.MultiColumnComboBoxCommands.Open:return o.onOpen&&o.onOpen({syntheticEvent:null,target:l}),{content:[{type:"text",text:"Multi-column combo box opened."}]};case e.MultiColumnComboBoxCommands.SetValue:{const r=o.data||[],x=o.textField,a=c.value,y=r.find(u=>x&&typeof u=="object"&&u!==null&&u[x]===a?!0:u===a),v=y===void 0?a:y;return o.onChange&&o.onChange({value:v,syntheticEvent:null,target:l}),{content:[{type:"text",text:`Selected "${String(a)}".`}]}}case e.MultiColumnComboBoxCommands.Clear:return o.onChange&&o.onChange({value:null,syntheticEvent:null,target:l}),{content:[{type:"text",text:"Selection cleared."}]};case e.MultiColumnComboBoxCommands.Close:return o.onClose&&o.onClose({syntheticEvent:null,target:l}),{content:[{type:"text",text:"Multi-column combo box closed."}]};default:return{content:[{type:"text",text:`Unknown command: ${t}`}],isError:!0}}};for(const t of f){if(!t.enabled)continue;const c=t.commandType,o=e.getMultiColumnComboBoxToolSchema(c);try{C.push(h.registerTool({name:g(t.name),description:t.description,inputSchema:o,execute:async r=>M(c,r||{})}))}catch{}}return C}};exports.multiColumnComboBoxAdapter=B;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { MultiColumnComboBoxCommands as o, getMultiColumnComboBoxToolSchema as T } from "../commands/multicolumncombobox.mjs";
|
|
9
|
+
const $ = {
|
|
10
|
+
componentSuffix: "multicolumncombobox",
|
|
11
|
+
createTools(c, u, n, h) {
|
|
12
|
+
const p = [], f = (t) => `${n.groupName}_${t}`, r = u.current, d = !!r.onChange, b = [
|
|
13
|
+
{
|
|
14
|
+
name: "open",
|
|
15
|
+
description: `Open the ${n.dataName} multi-column combo box popup`,
|
|
16
|
+
commandType: o.Open,
|
|
17
|
+
enabled: !!r.onOpen
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "close",
|
|
21
|
+
description: `Close the ${n.dataName} multi-column combo box popup`,
|
|
22
|
+
commandType: o.Close,
|
|
23
|
+
enabled: !!r.onClose
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "set_value",
|
|
27
|
+
description: `Select an item from the ${n.dataName} multi-column combo box`,
|
|
28
|
+
commandType: o.SetValue,
|
|
29
|
+
enabled: d
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "clear",
|
|
33
|
+
description: `Clear the ${n.dataName} multi-column combo box selection`,
|
|
34
|
+
commandType: o.Clear,
|
|
35
|
+
enabled: d
|
|
36
|
+
}
|
|
37
|
+
], l = u.current.webMcp, x = typeof l == "object" && l !== null && typeof l.tools == "function" ? l.tools : void 0, g = x ? x(b) : b, v = async (t, a) => {
|
|
38
|
+
const e = u.current;
|
|
39
|
+
switch (t) {
|
|
40
|
+
case o.Open:
|
|
41
|
+
return e.onOpen && e.onOpen({ syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Multi-column combo box opened." }] };
|
|
42
|
+
case o.SetValue: {
|
|
43
|
+
const i = e.data || [], C = e.textField, m = a.value, y = i.find((s) => C && typeof s == "object" && s !== null && s[C] === m ? !0 : s === m), S = y === void 0 ? m : y;
|
|
44
|
+
return e.onChange && e.onChange({ value: S, syntheticEvent: null, target: c }), { content: [{ type: "text", text: `Selected "${String(m)}".` }] };
|
|
45
|
+
}
|
|
46
|
+
case o.Clear:
|
|
47
|
+
return e.onChange && e.onChange({ value: null, syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Selection cleared." }] };
|
|
48
|
+
case o.Close:
|
|
49
|
+
return e.onClose && e.onClose({ syntheticEvent: null, target: c }), { content: [{ type: "text", text: "Multi-column combo box closed." }] };
|
|
50
|
+
default:
|
|
51
|
+
return { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
for (const t of g) {
|
|
55
|
+
if (!t.enabled)
|
|
56
|
+
continue;
|
|
57
|
+
const a = t.commandType, e = T(a);
|
|
58
|
+
try {
|
|
59
|
+
p.push(
|
|
60
|
+
h.registerTool({
|
|
61
|
+
name: f(t.name),
|
|
62
|
+
description: t.description,
|
|
63
|
+
inputSchema: e,
|
|
64
|
+
execute: async (i) => v(a, i || {})
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return p;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
$ as multiColumnComboBoxAdapter
|
|
75
|
+
};
|
|
@@ -12,6 +12,8 @@ interface MultiSelectAdapterProps {
|
|
|
12
12
|
textField?: string;
|
|
13
13
|
dataItemKey?: string;
|
|
14
14
|
onChange?: (event: Record<string, unknown>) => void;
|
|
15
|
+
onOpen?: (event: unknown) => void;
|
|
16
|
+
onClose?: (event: unknown) => void;
|
|
15
17
|
webMcp?: unknown;
|
|
16
18
|
}
|
|
17
19
|
/** @hidden */
|
package/adapters/multiselect.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../commands/multiselect.js");function x(o){return typeof o=="object"&&o!==null}const $={componentSuffix:"multiselect",createTools(o,y,c,h){const C=[],g=n=>`${c.groupName}_${n}`,f=y.current;if(!f.onChange)return C;const S=[{name:"add",description:`Add an item to the ${c.dataName} multi-select`,commandType:t.MultiSelectCommands.AddValue,enabled:!0},{name:"remove",description:`Remove an item from the ${c.dataName} multi-select`,commandType:t.MultiSelectCommands.RemoveValue,enabled:!0},{name:"clear",description:`Clear all selections from the ${c.dataName} multi-select`,commandType:t.MultiSelectCommands.Clear,enabled:!0},{name:"open",description:`Open the ${c.dataName} multi-select popup`,commandType:t.MultiSelectCommands.Open,enabled:!!f.onOpen},{name:"close",description:`Close the ${c.dataName} multi-select popup`,commandType:t.MultiSelectCommands.Close,enabled:!!f.onClose}],u=y.current.webMcp,v=typeof u=="object"&&u!==null&&typeof u.tools=="function"?u.tools:void 0,M=v?v(S):S,b=async(n,m)=>{const e=y.current;switch(n){case t.MultiSelectCommands.AddValue:{const l=e.textField,i=e.dataItemKey,a=e.data||[],r=m.value,d=a.find(p=>x(p)&&(l&&p[l]===r||i&&p[i]===r)?!0:p===r),s=d===void 0?r:d,T=e.value||[];return e.onChange&&e.onChange({value:[...T,s],syntheticEvent:null,target:o}),{content:[{type:"text",text:`Added "${String(r)}".`}]}}case t.MultiSelectCommands.RemoveValue:{const l=e.textField,i=e.dataItemKey,a=m.value,d=(e.value||[]).filter(s=>x(s)&&(l&&s[l]===a||i&&s[i]===a)?!1:s!==a);return e.onChange&&e.onChange({value:d,syntheticEvent:null,target:o}),{content:[{type:"text",text:`Removed "${String(a)}".`}]}}case t.MultiSelectCommands.Clear:return e.onChange&&e.onChange({value:[],syntheticEvent:null,target:o}),{content:[{type:"text",text:"All selections cleared."}]};case t.MultiSelectCommands.Open:return e.onOpen&&e.onOpen({syntheticEvent:null,target:o}),{content:[{type:"text",text:"Multi-select popup opened."}]};case t.MultiSelectCommands.Close:return e.onClose&&e.onClose({syntheticEvent:null,target:o}),{content:[{type:"text",text:"Multi-select popup closed."}]};default:return{content:[{type:"text",text:`Unknown command: ${n}`}],isError:!0}}};for(const n of M){if(!n.enabled)continue;const m=t.getMultiSelectToolSchema(n.commandType),e=n.commandType;try{C.push(h.registerTool({name:g(n.name),description:n.description,inputSchema:m,execute:async l=>b(e,l||{})}))}catch{}}return C}};exports.multiSelectAdapter=$;
|
package/adapters/multiselect.mjs
CHANGED
|
@@ -5,71 +5,87 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { MultiSelectCommands as
|
|
9
|
-
function
|
|
8
|
+
import { MultiSelectCommands as n, getMultiSelectToolSchema as A } from "../commands/multiselect.mjs";
|
|
9
|
+
function v(o) {
|
|
10
10
|
return typeof o == "object" && o !== null;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const E = {
|
|
13
13
|
componentSuffix: "multiselect",
|
|
14
|
-
createTools(o,
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
-
return
|
|
18
|
-
const
|
|
14
|
+
createTools(o, y, a, g) {
|
|
15
|
+
const f = [], b = (t) => `${a.groupName}_${t}`, x = y.current;
|
|
16
|
+
if (!x.onChange)
|
|
17
|
+
return f;
|
|
18
|
+
const C = [
|
|
19
19
|
{
|
|
20
20
|
name: "add",
|
|
21
|
-
description: `Add an item to the ${
|
|
22
|
-
commandType:
|
|
21
|
+
description: `Add an item to the ${a.dataName} multi-select`,
|
|
22
|
+
commandType: n.AddValue,
|
|
23
23
|
enabled: !0
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: "remove",
|
|
27
|
-
description: `Remove an item from the ${
|
|
28
|
-
commandType:
|
|
27
|
+
description: `Remove an item from the ${a.dataName} multi-select`,
|
|
28
|
+
commandType: n.RemoveValue,
|
|
29
29
|
enabled: !0
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
name: "clear",
|
|
33
|
-
description: `Clear all selections from the ${
|
|
34
|
-
commandType:
|
|
33
|
+
description: `Clear all selections from the ${a.dataName} multi-select`,
|
|
34
|
+
commandType: n.Clear,
|
|
35
35
|
enabled: !0
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "open",
|
|
39
|
+
description: `Open the ${a.dataName} multi-select popup`,
|
|
40
|
+
commandType: n.Open,
|
|
41
|
+
enabled: !!x.onOpen
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "close",
|
|
45
|
+
description: `Close the ${a.dataName} multi-select popup`,
|
|
46
|
+
commandType: n.Close,
|
|
47
|
+
enabled: !!x.onClose
|
|
36
48
|
}
|
|
37
|
-
], u =
|
|
38
|
-
const e =
|
|
49
|
+
], u = y.current.webMcp, h = typeof u == "object" && u !== null && typeof u.tools == "function" ? u.tools : void 0, T = h ? h(C) : C, $ = async (t, m) => {
|
|
50
|
+
const e = y.current;
|
|
39
51
|
switch (t) {
|
|
40
|
-
case
|
|
41
|
-
const
|
|
42
|
-
return e.onChange && e.onChange({ value: [...S,
|
|
52
|
+
case n.AddValue: {
|
|
53
|
+
const c = e.textField, i = e.dataItemKey, l = e.data || [], r = m.value, p = l.find((d) => v(d) && (c && d[c] === r || i && d[i] === r) ? !0 : d === r), s = p === void 0 ? r : p, S = e.value || [];
|
|
54
|
+
return e.onChange && e.onChange({ value: [...S, s], syntheticEvent: null, target: o }), { content: [{ type: "text", text: `Added "${String(r)}".` }] };
|
|
43
55
|
}
|
|
44
|
-
case
|
|
45
|
-
const
|
|
46
|
-
return e.onChange && e.onChange({ value:
|
|
56
|
+
case n.RemoveValue: {
|
|
57
|
+
const c = e.textField, i = e.dataItemKey, l = m.value, p = (e.value || []).filter((s) => v(s) && (c && s[c] === l || i && s[i] === l) ? !1 : s !== l);
|
|
58
|
+
return e.onChange && e.onChange({ value: p, syntheticEvent: null, target: o }), { content: [{ type: "text", text: `Removed "${String(l)}".` }] };
|
|
47
59
|
}
|
|
48
|
-
case
|
|
60
|
+
case n.Clear:
|
|
49
61
|
return e.onChange && e.onChange({ value: [], syntheticEvent: null, target: o }), { content: [{ type: "text", text: "All selections cleared." }] };
|
|
62
|
+
case n.Open:
|
|
63
|
+
return e.onOpen && e.onOpen({ syntheticEvent: null, target: o }), { content: [{ type: "text", text: "Multi-select popup opened." }] };
|
|
64
|
+
case n.Close:
|
|
65
|
+
return e.onClose && e.onClose({ syntheticEvent: null, target: o }), { content: [{ type: "text", text: "Multi-select popup closed." }] };
|
|
50
66
|
default:
|
|
51
67
|
return { content: [{ type: "text", text: `Unknown command: ${t}` }], isError: !0 };
|
|
52
68
|
}
|
|
53
69
|
};
|
|
54
|
-
for (const t of
|
|
70
|
+
for (const t of T) {
|
|
55
71
|
if (!t.enabled)
|
|
56
72
|
continue;
|
|
57
|
-
const m =
|
|
73
|
+
const m = A(t.commandType), e = t.commandType;
|
|
58
74
|
try {
|
|
59
|
-
|
|
75
|
+
f.push(
|
|
60
76
|
g.registerTool({
|
|
61
|
-
name:
|
|
77
|
+
name: b(t.name),
|
|
62
78
|
description: t.description,
|
|
63
79
|
inputSchema: m,
|
|
64
|
-
execute: async (
|
|
80
|
+
execute: async (c) => $(e, c || {})
|
|
65
81
|
})
|
|
66
82
|
);
|
|
67
83
|
} catch {
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
|
-
return
|
|
86
|
+
return f;
|
|
71
87
|
}
|
|
72
88
|
};
|
|
73
89
|
export {
|
|
74
|
-
|
|
90
|
+
E as multiSelectAdapter
|
|
75
91
|
};
|
package/adapters/notification.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../commands/notification.js"),x={componentSuffix:"notification",createTools(l,r,c,f){const m=[],p=t=>`${c.groupName}_${t}`,u=[{name:"show",description:`Show a notification in the ${c.dataName} notification group.`,commandType:n.NotificationCommands.Show,enabled:!0},{name:"dismiss",description:`Dismiss all notifications in the ${c.dataName} notification group.`,commandType:n.NotificationCommands.Dismiss,enabled:!0}],e=r.current.webMcp,d=typeof e=="object"&&e!==null&&typeof e.tools=="function"?e.tools:void 0,y=d?d(u):u,h=async(t,a)=>{var i,o;switch(t){case n.NotificationCommands.Show:return{content:[{type:"text",text:`Notification shown: "${String(a.message)}".`}]};case n.NotificationCommands.Dismiss:return(o=(i=r.current).onClose)==null||o.call(i,{syntheticEvent:null,target:l}),{content:[{type:"text",text:"Notification dismissed."}]};default:return{content:[{type:"text",text:`Unknown command: ${t}`}],isError:!0}}};for(const t of y){if(!t.enabled)continue;const a=n.getNotificationToolSchema(t.commandType),i=t.commandType,o=t.execute;try{m.push(f.registerTool({name:p(t.name),description:t.description,inputSchema:a,execute:o?async s=>await o(s):async s=>h(i,s||{})}))}catch{}}return m}};exports.notificationAdapter=x;
|