@progress/kendo-react-grid 12.3.0-develop.1 → 12.3.0-develop.10
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +498 -416
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +326 -311
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +64 -63
- package/index.d.mts +169 -1
- package/index.d.ts +169 -1
- package/index.js +1 -1
- package/index.mjs +54 -53
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +264 -161
- package/utils/index.js +1 -1
- package/utils/index.mjs +158 -148
package/header/HeaderRow.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 V=require("react"),_=require("./GridHeaderCell.js"),c=require("@progress/kendo-react-common"),$=require("@progress/kendo-react-data-tools"),S=require("../messages/index.js"),N=require("@progress/kendo-svg-icons"),d=require("../utils/index.js"),v=require("./client/GridHeaderCellContainer.js"),B=require("./client/HeaderRowDraggable.js"),F=require("./client/GridHeaderRowContainer.js"),J=require("./client/GridHeaderCellElementContainer.js"),K=require("./client/HeaderCellResizer.js");function Q(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(i,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return i.default=e,Object.freeze(i)}const t=Q(V),U={none:"none",asc:"ascending",desc:"descending"},X=e=>{let i=e.columnsState||[];const a=e.unstyled,o=a&&a.uGrid?a.uGrid:c.uGrid;let w=0,P=-1;const O=r=>{if(!e.sort)return null;const n=c.classNames(o.sortIcon({}));return r>=0&&[t.createElement("span",{key:1,className:n},t.createElement(c.IconWrap,{name:"sort-"+e.sort[r].dir+"-small",icon:e.sort[r].dir==="asc"?N.sortAscSmallIcon:N.sortDescSmallIcon})),e.sort.length>1&&t.createElement("span",{key:2,className:n},t.createElement("span",{className:c.classNames(o.sortOrder({}))},r+1))]},D=r=>r.map(n=>{var M,q,G;const l=e.columns[n],u=i[n],m=(q=(M=l.locked)!=null?M:u==null?void 0:u.locked)!=null?q:!1,h=e.sortable&&l.sortable,C=e.sort?e.sort.findIndex(s=>s.field===l.field):-1,T=C>=0&&e.sort[C].dir||"none",k=l.columnMenu===null?null:l.columnMenu||e.columnMenu,j=l.menuIcon||e.columnMenuIcon,A=c.classNames(c.classNames(o.headerTh({first:l.kFirst,filterable:!!k,locked:m,sorted:e.sort&&e.sort.some(s=>s.field===l.field)})),l.headerClassName);m===!1&&(l.left=0);const L=e.localization.toLanguageString(S.sortAriaLabel,S.messages[S.sortAriaLabel]),z=l.isAccessible?{ariaSort:U[T],role:"columnheader",ariaColumnIndex:l.ariaColumnIndex,ariaSelected:!1,ariaDescription:h?L:""}:{role:"presentation"},E=l.declarationIndex>=0?++P:--w,f={field:l.field,title:l.title,selectionValue:(G=l.headerSelectionValue)!=null?G:e.headerSelectionValue,children:O(C),selectionChange:null,columnMenuWrapperProps:{column:{field:l.field,title:l.title,locked:m,filter:l.filter,id:l.id},sortable:h&&e.sortable,sort:e.sort,filter:e.filter,filterable:e.filterable&&l.filterable,filterOperators:e.filterOperators,navigatable:e.navigatable,group:e.group,groupable:e.groupable,columnMenu:k,columnMenuIcon:j}},b={...z,colSpan:l.headerColSpan,rowSpan:l.rowSpan,className:A,columnId:l.id,navigatable:l.navigatable,role:"columnheader"},g=d.clientColumn(l),R={column:g,sortable:e.sortable,sort:e.sort,columnMenuWrapperProps:f.columnMenuWrapperProps},y=l.defaultHeaderCell?l.defaultHeaderCell:_.GridHeaderCell,I=[t.createElement(v.GridHeaderCellContainer,{key:1,...R,isClient:d.isClientReference(y)},t.createElement(y,{...f})),t.createElement(K.HeaderCellResizer,{key:2,column:g})],H=d.resolveCells(e.cells,l.cells);if(H&&H.headerCell){const s=H.headerCell,W=d.isClientReference(s);return t.createElement(v.GridHeaderCellContainer,{key:E,...R,thProps:b,isCustom:!0,isClient:W},t.createElement(s,{...f,thProps:b,index:n},I))}return t.createElement(J.GridHeaderCellElementContainer,{key:E,column:g},t.createElement($.HeaderThElement,{...b},I))}),x=e.columns.map(d.clientColumn);return t.createElement(F.GridHeaderRowContainer,{sortable:e.sortable,sort:e.sort,navigatable:e.navigatable,groupable:e.groupable,columns:x},e.columnsMap.map((r,n)=>t.createElement(B.HeaderRowDraggable,{key:n,className:c.classNames(o.simpleTr({})),ariaRowIndex:n+1},D(r))))};exports.HeaderRow=X;
|
package/header/HeaderRow.mjs
CHANGED
|
@@ -6,75 +6,76 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { GridHeaderCell as
|
|
10
|
-
import { uGrid as
|
|
11
|
-
import { HeaderThElement as
|
|
12
|
-
import { sortAriaLabel as
|
|
13
|
-
import { sortAscSmallIcon as
|
|
14
|
-
import { clientColumn as
|
|
15
|
-
import { GridHeaderCellContainer as
|
|
16
|
-
import { HeaderRowDraggable as
|
|
17
|
-
import { GridHeaderRowContainer as
|
|
18
|
-
import { GridHeaderCellElementContainer as
|
|
19
|
-
import { HeaderCellResizer as
|
|
20
|
-
const
|
|
9
|
+
import { GridHeaderCell as F } from "./GridHeaderCell.mjs";
|
|
10
|
+
import { uGrid as j, classNames as o, IconWrap as q } from "@progress/kendo-react-common";
|
|
11
|
+
import { HeaderThElement as J } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { sortAriaLabel as y, messages as K } from "../messages/index.mjs";
|
|
13
|
+
import { sortAscSmallIcon as Q, sortDescSmallIcon as U } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { clientColumn as G, isClientReference as N, resolveCells as X } from "../utils/index.mjs";
|
|
15
|
+
import { GridHeaderCellContainer as P } from "./client/GridHeaderCellContainer.mjs";
|
|
16
|
+
import { HeaderRowDraggable as Y } from "./client/HeaderRowDraggable.mjs";
|
|
17
|
+
import { GridHeaderRowContainer as Z } from "./client/GridHeaderRowContainer.mjs";
|
|
18
|
+
import { GridHeaderCellElementContainer as _ } from "./client/GridHeaderCellElementContainer.mjs";
|
|
19
|
+
import { HeaderCellResizer as $ } from "./client/HeaderCellResizer.mjs";
|
|
20
|
+
const p = {
|
|
21
21
|
none: "none",
|
|
22
22
|
asc: "ascending",
|
|
23
23
|
desc: "descending"
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
}, de = (e) => {
|
|
25
|
+
let R = e.columnsState || [];
|
|
26
|
+
const s = e.unstyled, c = s && s.uGrid ? s.uGrid : j;
|
|
27
|
+
let w = 0, x = -1;
|
|
28
|
+
const A = (a) => {
|
|
28
29
|
if (!e.sort)
|
|
29
30
|
return null;
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
/* @__PURE__ */ t.createElement("span", { key: 1, className:
|
|
33
|
-
|
|
31
|
+
const n = o(c.sortIcon({}));
|
|
32
|
+
return a >= 0 && [
|
|
33
|
+
/* @__PURE__ */ t.createElement("span", { key: 1, className: n }, /* @__PURE__ */ t.createElement(
|
|
34
|
+
q,
|
|
34
35
|
{
|
|
35
|
-
name: "sort-" + e.sort[
|
|
36
|
-
icon: e.sort[
|
|
36
|
+
name: "sort-" + e.sort[a].dir + "-small",
|
|
37
|
+
icon: e.sort[a].dir === "asc" ? Q : U
|
|
37
38
|
}
|
|
38
39
|
)),
|
|
39
|
-
e.sort.length > 1 && /* @__PURE__ */ t.createElement("span", { key: 2, className:
|
|
40
|
+
e.sort.length > 1 && /* @__PURE__ */ t.createElement("span", { key: 2, className: n }, /* @__PURE__ */ t.createElement("span", { className: o(c.sortOrder({})) }, a + 1))
|
|
40
41
|
];
|
|
41
|
-
},
|
|
42
|
-
var
|
|
43
|
-
const l = e.columns[
|
|
42
|
+
}, D = (a) => a.map((n) => {
|
|
43
|
+
var H, M, v;
|
|
44
|
+
const l = e.columns[n], i = R[n], m = (M = (H = l.locked) != null ? H : i == null ? void 0 : i.locked) != null ? M : !1, g = e.sortable && l.sortable, d = e.sort ? e.sort.findIndex((r) => r.field === l.field) : -1, W = d >= 0 && e.sort[d].dir || "none", h = l.columnMenu === null ? null : l.columnMenu || e.columnMenu, O = l.menuIcon || e.columnMenuIcon, T = o(
|
|
44
45
|
o(
|
|
45
46
|
c.headerTh({
|
|
46
47
|
first: l.kFirst,
|
|
47
|
-
filterable: !!
|
|
48
|
-
locked:
|
|
48
|
+
filterable: !!h,
|
|
49
|
+
locked: m,
|
|
49
50
|
sorted: e.sort && e.sort.some((r) => r.field === l.field)
|
|
50
51
|
})
|
|
51
52
|
),
|
|
52
53
|
l.headerClassName
|
|
53
54
|
);
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
ariaSort:
|
|
55
|
+
m === !1 && (l.left = 0);
|
|
56
|
+
const V = e.localization.toLanguageString(y, K[y]), z = l.isAccessible ? {
|
|
57
|
+
ariaSort: p[W],
|
|
57
58
|
role: "columnheader",
|
|
58
59
|
ariaColumnIndex: l.ariaColumnIndex,
|
|
59
60
|
ariaSelected: !1,
|
|
60
|
-
ariaDescription:
|
|
61
|
+
ariaDescription: g ? V : ""
|
|
61
62
|
} : {
|
|
62
63
|
role: "presentation"
|
|
63
|
-
},
|
|
64
|
+
}, E = l.declarationIndex >= 0 ? ++x : --w, u = {
|
|
64
65
|
field: l.field,
|
|
65
66
|
title: l.title,
|
|
66
|
-
selectionValue: (
|
|
67
|
-
children:
|
|
67
|
+
selectionValue: (v = l.headerSelectionValue) != null ? v : e.headerSelectionValue,
|
|
68
|
+
children: A(d),
|
|
68
69
|
selectionChange: null,
|
|
69
70
|
columnMenuWrapperProps: {
|
|
70
71
|
column: {
|
|
71
72
|
field: l.field,
|
|
72
73
|
title: l.title,
|
|
73
|
-
locked:
|
|
74
|
+
locked: m,
|
|
74
75
|
filter: l.filter,
|
|
75
76
|
id: l.id
|
|
76
77
|
},
|
|
77
|
-
sortable:
|
|
78
|
+
sortable: g && e.sortable,
|
|
78
79
|
sort: e.sort,
|
|
79
80
|
filter: e.filter,
|
|
80
81
|
filterable: e.filterable && l.filterable,
|
|
@@ -82,54 +83,54 @@ const X = {
|
|
|
82
83
|
navigatable: e.navigatable,
|
|
83
84
|
group: e.group,
|
|
84
85
|
groupable: e.groupable,
|
|
85
|
-
columnMenu:
|
|
86
|
-
columnMenuIcon:
|
|
86
|
+
columnMenu: h,
|
|
87
|
+
columnMenuIcon: O
|
|
87
88
|
}
|
|
88
|
-
},
|
|
89
|
-
...
|
|
89
|
+
}, f = {
|
|
90
|
+
...z,
|
|
90
91
|
colSpan: l.headerColSpan,
|
|
91
92
|
rowSpan: l.rowSpan,
|
|
92
|
-
className:
|
|
93
|
+
className: T,
|
|
93
94
|
columnId: l.id,
|
|
94
95
|
navigatable: l.navigatable,
|
|
95
96
|
role: "columnheader"
|
|
96
|
-
},
|
|
97
|
-
column:
|
|
97
|
+
}, C = G(l), S = {
|
|
98
|
+
column: C,
|
|
98
99
|
sortable: e.sortable,
|
|
99
100
|
sort: e.sort,
|
|
100
|
-
columnMenuWrapperProps:
|
|
101
|
-
},
|
|
102
|
-
/* @__PURE__ */ t.createElement(
|
|
103
|
-
/* @__PURE__ */ t.createElement(
|
|
104
|
-
],
|
|
105
|
-
if (
|
|
106
|
-
const r =
|
|
101
|
+
columnMenuWrapperProps: u.columnMenuWrapperProps
|
|
102
|
+
}, k = l.defaultHeaderCell ? l.defaultHeaderCell : F, I = [
|
|
103
|
+
/* @__PURE__ */ t.createElement(P, { key: 1, ...S, isClient: N(k) }, /* @__PURE__ */ t.createElement(k, { ...u })),
|
|
104
|
+
/* @__PURE__ */ t.createElement($, { key: 2, column: C })
|
|
105
|
+
], b = X(e.cells, l.cells);
|
|
106
|
+
if (b && b.headerCell) {
|
|
107
|
+
const r = b.headerCell, B = N(r);
|
|
107
108
|
return /* @__PURE__ */ t.createElement(
|
|
108
|
-
|
|
109
|
+
P,
|
|
109
110
|
{
|
|
110
|
-
key:
|
|
111
|
-
...
|
|
112
|
-
thProps:
|
|
111
|
+
key: E,
|
|
112
|
+
...S,
|
|
113
|
+
thProps: f,
|
|
113
114
|
isCustom: !0,
|
|
114
|
-
isClient:
|
|
115
|
+
isClient: B
|
|
115
116
|
},
|
|
116
|
-
/* @__PURE__ */ t.createElement(r, { ...
|
|
117
|
+
/* @__PURE__ */ t.createElement(r, { ...u, thProps: f, index: n }, I)
|
|
117
118
|
);
|
|
118
119
|
}
|
|
119
|
-
return /* @__PURE__ */ t.createElement(
|
|
120
|
-
}),
|
|
120
|
+
return /* @__PURE__ */ t.createElement(_, { key: E, column: C }, /* @__PURE__ */ t.createElement(J, { ...f }, I));
|
|
121
|
+
}), L = e.columns.map(G);
|
|
121
122
|
return /* @__PURE__ */ t.createElement(
|
|
122
|
-
|
|
123
|
+
Z,
|
|
123
124
|
{
|
|
124
125
|
sortable: e.sortable,
|
|
125
126
|
sort: e.sort,
|
|
126
127
|
navigatable: e.navigatable,
|
|
127
128
|
groupable: e.groupable,
|
|
128
|
-
columns:
|
|
129
|
+
columns: L
|
|
129
130
|
},
|
|
130
|
-
e.columnsMap.map((
|
|
131
|
+
e.columnsMap.map((a, n) => /* @__PURE__ */ t.createElement(Y, { key: n, className: o(c.simpleTr({})), ariaRowIndex: n + 1 }, D(a)))
|
|
131
132
|
);
|
|
132
133
|
};
|
|
133
134
|
export {
|
|
134
|
-
|
|
135
|
+
de as HeaderRow
|
|
135
136
|
};
|
package/index.d.mts
CHANGED
|
@@ -121,7 +121,7 @@ export declare interface CompositeHighlightDescriptor {
|
|
|
121
121
|
/**
|
|
122
122
|
* An array of filter descriptors representing the filters applied to the grid.
|
|
123
123
|
*/
|
|
124
|
-
filters: FilterDescriptor
|
|
124
|
+
filters: Array<FilterDescriptor | CompositeFilterDescriptor>;
|
|
125
125
|
/**
|
|
126
126
|
* The logical operator ('and' | 'or') used to combine the filters.
|
|
127
127
|
*/
|
|
@@ -350,6 +350,147 @@ export declare const GRID_PREVENT_SELECTION_ELEMENT = "data-prevent-selection";
|
|
|
350
350
|
/** The attribute required by the Grid selection on Grid `tr` elements. */
|
|
351
351
|
export declare const GRID_ROW_INDEX_ATTRIBUTE = "data-grid-row-index";
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Represents a command structure returned by AI services for grid operations.
|
|
355
|
+
* Each command contains the operation type and relevant configuration data.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```tsx
|
|
359
|
+
* // Sort command example
|
|
360
|
+
* const sortCommand: GridAIAssistantCommand = {
|
|
361
|
+
* type: 'GridSort',
|
|
362
|
+
* sort: { field: 'productName', dir: 'asc' },
|
|
363
|
+
* message: 'Sorted by Product Name ascending'
|
|
364
|
+
* };
|
|
365
|
+
*
|
|
366
|
+
* // Filter command example
|
|
367
|
+
* const filterCommand: GridAIAssistantCommand = {
|
|
368
|
+
* type: 'GridFilter',
|
|
369
|
+
* filter: {
|
|
370
|
+
* logic: 'and',
|
|
371
|
+
* filters: [{ field: 'price', operator: 'gte', value: 100 }]
|
|
372
|
+
* },
|
|
373
|
+
* message: 'Filtered products with price >= 100'
|
|
374
|
+
* };
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
export declare interface GridAIAssistantCommand {
|
|
378
|
+
/**
|
|
379
|
+
* The type of grid operation to perform.
|
|
380
|
+
* Possible values: 'GridSort', 'GridFilter', 'GridGroup', 'GridHighlight', 'GridClearSort', 'GridClearFilter', 'GridClearGroup', 'GridClearHighlight'
|
|
381
|
+
*/
|
|
382
|
+
type: GridAICommands;
|
|
383
|
+
/**
|
|
384
|
+
* The filename for export operations, including the file extension.
|
|
385
|
+
* Used when the AI assistant performs export commands such as PDF generation.
|
|
386
|
+
* Expected data type: string ending with file extension (e.g., '.pdf', '.xlsx').
|
|
387
|
+
*/
|
|
388
|
+
fileName?: string;
|
|
389
|
+
/**
|
|
390
|
+
* The sort descriptor for sorting operations.
|
|
391
|
+
*/
|
|
392
|
+
sort?: SortDescriptor | SortDescriptor[];
|
|
393
|
+
/**
|
|
394
|
+
* The filter descriptor for filtering operations.
|
|
395
|
+
*/
|
|
396
|
+
filter?: CompositeFilterDescriptor;
|
|
397
|
+
/**
|
|
398
|
+
* The group descriptor for grouping operations.
|
|
399
|
+
*/
|
|
400
|
+
group?: GroupDescriptor | GroupDescriptor[];
|
|
401
|
+
/**
|
|
402
|
+
* The highlight descriptor for highlight operations.
|
|
403
|
+
*/
|
|
404
|
+
highlight?: any;
|
|
405
|
+
/**
|
|
406
|
+
* The select descriptor for selection operations.
|
|
407
|
+
* Used when type is 'GridSelect' to define cell or row selection criteria.
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* ```tsx
|
|
411
|
+
* select: {
|
|
412
|
+
* cells: { 'Age': true },
|
|
413
|
+
* filters: [{ field: 'Age', operator: 'gt', value: 60 }],
|
|
414
|
+
* logic: 'and'
|
|
415
|
+
* }
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
select?: CompositeHighlightDescriptor;
|
|
419
|
+
/**
|
|
420
|
+
* The message describing the operation.
|
|
421
|
+
*/
|
|
422
|
+
message?: string;
|
|
423
|
+
/**
|
|
424
|
+
* The messages describing the operation (alternative to message).
|
|
425
|
+
*/
|
|
426
|
+
messages?: string[];
|
|
427
|
+
/**
|
|
428
|
+
* The new size value for column resize operations.
|
|
429
|
+
* Specifies the width dimension when resizing grid columns.
|
|
430
|
+
*/
|
|
431
|
+
size?: string;
|
|
432
|
+
/**
|
|
433
|
+
* The unique identifier of the column to resize.
|
|
434
|
+
* Used when type is 'GridColumnResize' to specify which column should be resized.
|
|
435
|
+
*/
|
|
436
|
+
id?: string;
|
|
437
|
+
/**
|
|
438
|
+
* The target position for column reordering operations.
|
|
439
|
+
* Used when type is 'GridColumnReorder' to specify the new column index.
|
|
440
|
+
*/
|
|
441
|
+
position?: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Enum defining the available AI command types for grid operations.
|
|
446
|
+
* These commands control different aspects of grid functionality through AI prompts.
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```tsx
|
|
450
|
+
* // Used internally when processing AI responses
|
|
451
|
+
* const command = {
|
|
452
|
+
* type: GridAICommands.GridSort,
|
|
453
|
+
* sort: { field: 'name', dir: 'asc' }
|
|
454
|
+
* };
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
export declare enum GridAICommands {
|
|
458
|
+
/** Clears all applied filters from the grid */
|
|
459
|
+
GridClearFilter = "GridClearFilter",
|
|
460
|
+
/** Clears all applied sorting from the grid */
|
|
461
|
+
GridClearSort = "GridClearSort",
|
|
462
|
+
/** Clears all applied grouping from the grid */
|
|
463
|
+
GridClearGroup = "GridClearGroup",
|
|
464
|
+
/** Clears all applied highlighting from the grid */
|
|
465
|
+
GridClearHighlight = "GridClearHighlight",
|
|
466
|
+
/** Clears all applied selections from the grid */
|
|
467
|
+
GridClearSelect = "GridClearSelect",
|
|
468
|
+
/** Applies sorting to grid columns */
|
|
469
|
+
GridSort = "GridSort",
|
|
470
|
+
/** Applies filtering to grid data */
|
|
471
|
+
GridFilter = "GridFilter",
|
|
472
|
+
/** Applies grouping to grid data */
|
|
473
|
+
GridGroup = "GridGroup",
|
|
474
|
+
/** Applies highlighting to grid cells or rows */
|
|
475
|
+
GridHighlight = "GridHighlight",
|
|
476
|
+
/** Applies select to grid cells or rows */
|
|
477
|
+
GridSelect = "GridSelect",
|
|
478
|
+
/** Exports the grid data as a PDF document */
|
|
479
|
+
GridExportPDF = "GridExportPDF",
|
|
480
|
+
/** Resizes grid columns to specified dimensions */
|
|
481
|
+
GridColumnResize = "GridColumnResize",
|
|
482
|
+
/** Hides specified grid columns from view */
|
|
483
|
+
GridColumnHide = "GridColumnHide",
|
|
484
|
+
/** Shows previously hidden grid columns */
|
|
485
|
+
GridColumnShow = "GridColumnShow",
|
|
486
|
+
/** Reorders grid columns to new positions */
|
|
487
|
+
GridColumnReorder = "GridColumnReorder",
|
|
488
|
+
/** Locks grid columns to prevent horizontal scrolling */
|
|
489
|
+
GridColumnLock = "GridColumnLock",
|
|
490
|
+
/** Unlocks previously locked grid columns */
|
|
491
|
+
GridColumnUnlock = "GridColumnUnlock"
|
|
492
|
+
}
|
|
493
|
+
|
|
353
494
|
export declare const GridAIPrompt: (props: GridAIPromptProps) => JSX.Element;
|
|
354
495
|
|
|
355
496
|
/**
|
|
@@ -1759,6 +1900,10 @@ export declare interface GridColumnState {
|
|
|
1759
1900
|
* A collection of child states.
|
|
1760
1901
|
*/
|
|
1761
1902
|
children?: GridColumnState[];
|
|
1903
|
+
/**
|
|
1904
|
+
* Determines if the column is locked to the left or right side of the grid.
|
|
1905
|
+
*/
|
|
1906
|
+
locked?: boolean;
|
|
1762
1907
|
}
|
|
1763
1908
|
|
|
1764
1909
|
/**
|
|
@@ -4108,6 +4253,29 @@ export declare interface GridToolbarAIAssistantHandle {
|
|
|
4108
4253
|
hide: () => void;
|
|
4109
4254
|
}
|
|
4110
4255
|
|
|
4256
|
+
/**
|
|
4257
|
+
* Represents the props interface for the GridToolbarAIAssistant component.
|
|
4258
|
+
* This component provides AI-powered functionality for grid operations through natural language prompts.
|
|
4259
|
+
* Users can request sorting, filtering, grouping, and highlighting through conversational input.
|
|
4260
|
+
*
|
|
4261
|
+
* @example
|
|
4262
|
+
* ```tsx
|
|
4263
|
+
* <Grid data={products}>
|
|
4264
|
+
* <GridToolbar>
|
|
4265
|
+
* <GridToolbarAIAssistant
|
|
4266
|
+
* requestUrl="/api/ai/grid"
|
|
4267
|
+
* promptPlaceHolder="Ask AI to sort, filter, or group your data"
|
|
4268
|
+
* suggestionsList={[
|
|
4269
|
+
* 'Sort products by price',
|
|
4270
|
+
* 'Show only electronics',
|
|
4271
|
+
* 'Group by category'
|
|
4272
|
+
* ]}
|
|
4273
|
+
* onResponseSuccess={(response) => console.log('AI processed:', response)}
|
|
4274
|
+
* />
|
|
4275
|
+
* </GridToolbar>
|
|
4276
|
+
* </Grid>
|
|
4277
|
+
* ```
|
|
4278
|
+
*/
|
|
4111
4279
|
export declare interface GridToolbarAIAssistantProps {
|
|
4112
4280
|
/**
|
|
4113
4281
|
* Defines the URL to which the request will be sent.
|
package/index.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export declare interface CompositeHighlightDescriptor {
|
|
|
121
121
|
/**
|
|
122
122
|
* An array of filter descriptors representing the filters applied to the grid.
|
|
123
123
|
*/
|
|
124
|
-
filters: FilterDescriptor
|
|
124
|
+
filters: Array<FilterDescriptor | CompositeFilterDescriptor>;
|
|
125
125
|
/**
|
|
126
126
|
* The logical operator ('and' | 'or') used to combine the filters.
|
|
127
127
|
*/
|
|
@@ -350,6 +350,147 @@ export declare const GRID_PREVENT_SELECTION_ELEMENT = "data-prevent-selection";
|
|
|
350
350
|
/** The attribute required by the Grid selection on Grid `tr` elements. */
|
|
351
351
|
export declare const GRID_ROW_INDEX_ATTRIBUTE = "data-grid-row-index";
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Represents a command structure returned by AI services for grid operations.
|
|
355
|
+
* Each command contains the operation type and relevant configuration data.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```tsx
|
|
359
|
+
* // Sort command example
|
|
360
|
+
* const sortCommand: GridAIAssistantCommand = {
|
|
361
|
+
* type: 'GridSort',
|
|
362
|
+
* sort: { field: 'productName', dir: 'asc' },
|
|
363
|
+
* message: 'Sorted by Product Name ascending'
|
|
364
|
+
* };
|
|
365
|
+
*
|
|
366
|
+
* // Filter command example
|
|
367
|
+
* const filterCommand: GridAIAssistantCommand = {
|
|
368
|
+
* type: 'GridFilter',
|
|
369
|
+
* filter: {
|
|
370
|
+
* logic: 'and',
|
|
371
|
+
* filters: [{ field: 'price', operator: 'gte', value: 100 }]
|
|
372
|
+
* },
|
|
373
|
+
* message: 'Filtered products with price >= 100'
|
|
374
|
+
* };
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
export declare interface GridAIAssistantCommand {
|
|
378
|
+
/**
|
|
379
|
+
* The type of grid operation to perform.
|
|
380
|
+
* Possible values: 'GridSort', 'GridFilter', 'GridGroup', 'GridHighlight', 'GridClearSort', 'GridClearFilter', 'GridClearGroup', 'GridClearHighlight'
|
|
381
|
+
*/
|
|
382
|
+
type: GridAICommands;
|
|
383
|
+
/**
|
|
384
|
+
* The filename for export operations, including the file extension.
|
|
385
|
+
* Used when the AI assistant performs export commands such as PDF generation.
|
|
386
|
+
* Expected data type: string ending with file extension (e.g., '.pdf', '.xlsx').
|
|
387
|
+
*/
|
|
388
|
+
fileName?: string;
|
|
389
|
+
/**
|
|
390
|
+
* The sort descriptor for sorting operations.
|
|
391
|
+
*/
|
|
392
|
+
sort?: SortDescriptor | SortDescriptor[];
|
|
393
|
+
/**
|
|
394
|
+
* The filter descriptor for filtering operations.
|
|
395
|
+
*/
|
|
396
|
+
filter?: CompositeFilterDescriptor;
|
|
397
|
+
/**
|
|
398
|
+
* The group descriptor for grouping operations.
|
|
399
|
+
*/
|
|
400
|
+
group?: GroupDescriptor | GroupDescriptor[];
|
|
401
|
+
/**
|
|
402
|
+
* The highlight descriptor for highlight operations.
|
|
403
|
+
*/
|
|
404
|
+
highlight?: any;
|
|
405
|
+
/**
|
|
406
|
+
* The select descriptor for selection operations.
|
|
407
|
+
* Used when type is 'GridSelect' to define cell or row selection criteria.
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* ```tsx
|
|
411
|
+
* select: {
|
|
412
|
+
* cells: { 'Age': true },
|
|
413
|
+
* filters: [{ field: 'Age', operator: 'gt', value: 60 }],
|
|
414
|
+
* logic: 'and'
|
|
415
|
+
* }
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
select?: CompositeHighlightDescriptor;
|
|
419
|
+
/**
|
|
420
|
+
* The message describing the operation.
|
|
421
|
+
*/
|
|
422
|
+
message?: string;
|
|
423
|
+
/**
|
|
424
|
+
* The messages describing the operation (alternative to message).
|
|
425
|
+
*/
|
|
426
|
+
messages?: string[];
|
|
427
|
+
/**
|
|
428
|
+
* The new size value for column resize operations.
|
|
429
|
+
* Specifies the width dimension when resizing grid columns.
|
|
430
|
+
*/
|
|
431
|
+
size?: string;
|
|
432
|
+
/**
|
|
433
|
+
* The unique identifier of the column to resize.
|
|
434
|
+
* Used when type is 'GridColumnResize' to specify which column should be resized.
|
|
435
|
+
*/
|
|
436
|
+
id?: string;
|
|
437
|
+
/**
|
|
438
|
+
* The target position for column reordering operations.
|
|
439
|
+
* Used when type is 'GridColumnReorder' to specify the new column index.
|
|
440
|
+
*/
|
|
441
|
+
position?: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Enum defining the available AI command types for grid operations.
|
|
446
|
+
* These commands control different aspects of grid functionality through AI prompts.
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```tsx
|
|
450
|
+
* // Used internally when processing AI responses
|
|
451
|
+
* const command = {
|
|
452
|
+
* type: GridAICommands.GridSort,
|
|
453
|
+
* sort: { field: 'name', dir: 'asc' }
|
|
454
|
+
* };
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
export declare enum GridAICommands {
|
|
458
|
+
/** Clears all applied filters from the grid */
|
|
459
|
+
GridClearFilter = "GridClearFilter",
|
|
460
|
+
/** Clears all applied sorting from the grid */
|
|
461
|
+
GridClearSort = "GridClearSort",
|
|
462
|
+
/** Clears all applied grouping from the grid */
|
|
463
|
+
GridClearGroup = "GridClearGroup",
|
|
464
|
+
/** Clears all applied highlighting from the grid */
|
|
465
|
+
GridClearHighlight = "GridClearHighlight",
|
|
466
|
+
/** Clears all applied selections from the grid */
|
|
467
|
+
GridClearSelect = "GridClearSelect",
|
|
468
|
+
/** Applies sorting to grid columns */
|
|
469
|
+
GridSort = "GridSort",
|
|
470
|
+
/** Applies filtering to grid data */
|
|
471
|
+
GridFilter = "GridFilter",
|
|
472
|
+
/** Applies grouping to grid data */
|
|
473
|
+
GridGroup = "GridGroup",
|
|
474
|
+
/** Applies highlighting to grid cells or rows */
|
|
475
|
+
GridHighlight = "GridHighlight",
|
|
476
|
+
/** Applies select to grid cells or rows */
|
|
477
|
+
GridSelect = "GridSelect",
|
|
478
|
+
/** Exports the grid data as a PDF document */
|
|
479
|
+
GridExportPDF = "GridExportPDF",
|
|
480
|
+
/** Resizes grid columns to specified dimensions */
|
|
481
|
+
GridColumnResize = "GridColumnResize",
|
|
482
|
+
/** Hides specified grid columns from view */
|
|
483
|
+
GridColumnHide = "GridColumnHide",
|
|
484
|
+
/** Shows previously hidden grid columns */
|
|
485
|
+
GridColumnShow = "GridColumnShow",
|
|
486
|
+
/** Reorders grid columns to new positions */
|
|
487
|
+
GridColumnReorder = "GridColumnReorder",
|
|
488
|
+
/** Locks grid columns to prevent horizontal scrolling */
|
|
489
|
+
GridColumnLock = "GridColumnLock",
|
|
490
|
+
/** Unlocks previously locked grid columns */
|
|
491
|
+
GridColumnUnlock = "GridColumnUnlock"
|
|
492
|
+
}
|
|
493
|
+
|
|
353
494
|
export declare const GridAIPrompt: (props: GridAIPromptProps) => JSX.Element;
|
|
354
495
|
|
|
355
496
|
/**
|
|
@@ -1759,6 +1900,10 @@ export declare interface GridColumnState {
|
|
|
1759
1900
|
* A collection of child states.
|
|
1760
1901
|
*/
|
|
1761
1902
|
children?: GridColumnState[];
|
|
1903
|
+
/**
|
|
1904
|
+
* Determines if the column is locked to the left or right side of the grid.
|
|
1905
|
+
*/
|
|
1906
|
+
locked?: boolean;
|
|
1762
1907
|
}
|
|
1763
1908
|
|
|
1764
1909
|
/**
|
|
@@ -4108,6 +4253,29 @@ export declare interface GridToolbarAIAssistantHandle {
|
|
|
4108
4253
|
hide: () => void;
|
|
4109
4254
|
}
|
|
4110
4255
|
|
|
4256
|
+
/**
|
|
4257
|
+
* Represents the props interface for the GridToolbarAIAssistant component.
|
|
4258
|
+
* This component provides AI-powered functionality for grid operations through natural language prompts.
|
|
4259
|
+
* Users can request sorting, filtering, grouping, and highlighting through conversational input.
|
|
4260
|
+
*
|
|
4261
|
+
* @example
|
|
4262
|
+
* ```tsx
|
|
4263
|
+
* <Grid data={products}>
|
|
4264
|
+
* <GridToolbar>
|
|
4265
|
+
* <GridToolbarAIAssistant
|
|
4266
|
+
* requestUrl="/api/ai/grid"
|
|
4267
|
+
* promptPlaceHolder="Ask AI to sort, filter, or group your data"
|
|
4268
|
+
* suggestionsList={[
|
|
4269
|
+
* 'Sort products by price',
|
|
4270
|
+
* 'Show only electronics',
|
|
4271
|
+
* 'Group by category'
|
|
4272
|
+
* ]}
|
|
4273
|
+
* onResponseSuccess={(response) => console.log('AI processed:', response)}
|
|
4274
|
+
* />
|
|
4275
|
+
* </GridToolbar>
|
|
4276
|
+
* </Grid>
|
|
4277
|
+
* ```
|
|
4278
|
+
*/
|
|
4111
4279
|
export declare interface GridToolbarAIAssistantProps {
|
|
4112
4280
|
/**
|
|
4113
4281
|
* Defines the URL to which the request will be sent.
|
package/index.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 G=require("./Grid.js"),s=require("./GridColumn.js"),C=require("./columnMenu/GridColumnMenuWrapper.js"),m=require("./columnMenu/GridColumnMenuGroup.js"),l=require("./columnMenu/GridColumnMenuSort.js"),o=require("./columnMenu/GridColumnMenuFilter.js"),c=require("./columnMenu/GridColumnMenuFilterUI.js"),p=require("./columnMenu/GridColumnMenuFilterCell.js"),M=require("./columnMenu/GridColumnMenuCheckboxFilter.js"),g=require("./columnMenu/GridColumnMenuColumnsList.js"),T=require("./columnMenu/GridColumnMenuColumnsChooser.js"),I=require("./cells/datacell/GridCell.js"),b=require("./cells/editcell/GridEditCell.js"),q=require("./cells/groupcell/GridGroupCell.js"),S=require("./cells/hierarchycell/GridHierarchyCell.js"),F=require("./cells/GridFilterCell.js"),E=require("./header/GridHeaderCell.js"),P=require("./cells/selectioncell/GridSelectionCell.js"),D=require("./rows/GridDetailRow.js"),h=require("./rows/GridRow.js"),x=require("./GridToolbar.js"),R=require("./toolbar-tools/GridToolbarSpacer.js"),A=require("./toolbar-tools/GridToolbarSeparator.js"),_=require("./toolbar-tools/GridToolbarCheckboxFilter.js"),B=require("./toolbar-tools/GridToolbarColumnsChooser.js"),N=require("./toolbar-tools/GridToolbarFilter.js"),f=require("./toolbar-tools/GridToolbarSort.js"),L=require("./toolbar-tools/GridToolbarGroup.js"),u=require("./toolbar-tools/GridToolbarAIAssistant.js"),O=require("./toolbar-tools/ai-tool/GridAIPrompt.js"),y=require("./components/noRecords/GridNoRecords.js"),w=require("./columnMenu/GridColumnMenuItem.js"),k=require("./columnMenu/GridColumnMenuItemContent.js"),v=require("./columnMenu/GridColumnMenuItemGroup.js"),i=require("./constants/index.js"),t=require("@progress/kendo-react-data-tools"),U=require("./drag/CommonDragLogic.js"),e=require("./filterCommon.js"),r=require("./messages/index.js"),n=require("./StatusBar.js"),d=require("./contextMenu/GridContextMenu.js"),a=require("./contextMenu/enums.js"),H=require("./GridSearchBox.js"),W=require("./GridPdfExportButton.js");exports.Grid=G.Grid;exports.GridColumn=s.GridColumn;exports.GridColumnMenuWrapper=C.GridColumnMenuWrapper;exports.GridColumnMenuGroup=m.GridColumnMenuGroup;exports.GridColumnMenuSort=l.GridColumnMenuSort;exports.isColumnMenuSortActive=l.isColumnMenuSortActive;exports.GridColumnMenuFilter=o.GridColumnMenuFilter;exports.filterGroupByField=o.filterGroupByField;exports.isColumnMenuFilterActive=o.isColumnMenuFilterActive;exports.rootFilterOrDefault=o.rootFilterOrDefault;exports.GridColumnMenuFilterUI=c.GridColumnMenuFilterUI;exports.GridColumnMenuFilterCell=p.GridColumnMenuFilterCell;exports.GridColumnMenuCheckboxFilter=M.GridColumnMenuCheckboxFilter;exports.GridColumnMenuColumnsList=g.GridColumnMenuColumnsList;exports.GridColumnMenuColumnsChooser=T.GridColumnMenuColumnsChooser;exports.GridCell=I.GridCell;exports.GridEditCell=b.GridEditCell;exports.GridGroupCell=q.GridGroupCell;exports.GridHierarchyCell=S.GridHierarchyCell;exports.GridFilterCell=F.GridFilterCell;exports.GridHeaderCell=E.GridHeaderCell;exports.GridSelectionCell=P.GridSelectionCell;exports.GridDetailRow=D.GridDetailRow;exports.GridRow=h.GridRow;exports.GridToolbar=x.GridToolbar;exports.GridToolbarSpacer=R.GridToolbarSpacer;exports.GridToolbarSeparator=A.GridToolbarSeparator;exports.GridToolbarCheckboxFilter=_.GridToolbarCheckboxFilter;exports.GridToolbarColumnsChooser=B.GridToolbarColumnsChooser;exports.GridToolbarFilter=N.GridToolbarFilter;exports.GridToolbarSort=f.GridToolbarSort;exports.GridToolbarGroup=L.GridToolbarGroup;exports.GridAICommands=u.GridAICommands;exports.GridToolbarAIAssistant=u.GridToolbarAIAssistant;exports.GridAIPrompt=O.GridAIPrompt;exports.GridNoRecords=y.GridNoRecords;exports.GridColumnMenuItem=w.GridColumnMenuItem;exports.GridColumnMenuItemContent=k.GridColumnMenuItemContent;exports.GridColumnMenuItemGroup=v.GridColumnMenuItemGroup;exports.GRID_COL_INDEX_ATTRIBUTE=i.GRID_COL_INDEX_ATTRIBUTE;exports.GRID_PREVENT_SELECTION_ELEMENT=i.GRID_PREVENT_SELECTION_ELEMENT;exports.GRID_ROW_INDEX_ATTRIBUTE=i.GRID_ROW_INDEX_ATTRIBUTE;Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>t.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>t.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>t.setSelectedState});exports.GridCommonDragLogic=U.CommonDragLogic;exports.booleanFilterValues=e.booleanFilterValues;exports.cellBoolDropdownChange=e.cellBoolDropdownChange;exports.cellInputChange=e.cellInputChange;exports.cellOperatorChange=e.cellOperatorChange;exports.combineSmartFilters=e.combineSmartFilters;exports.operators=e.operators;exports.parseFilterDates=e.parseFilterDates;exports.gridMessages=r.messages;exports.pagerFirstPage=r.pagerFirstPage;exports.pagerInfo=r.pagerInfo;exports.pagerItemPerPage=r.pagerItemPerPage;exports.pagerLastPage=r.pagerLastPage;exports.pagerNextPage=r.pagerNextPage;exports.pagerPreviousPage=r.pagerPreviousPage;exports.StatusBar=n.StatusBar;exports.getStatusData=n.getStatusData;exports.leafColumns=n.leafColumns;exports.GridContextMenu=d.GridContextMenu;exports.contextMenuItemsMap=d.contextMenuItemsMap;exports.GridContextMenuAnchorPart=a.GridContextMenuAnchorPart;exports.GridContextMenuItemNames=a.GridContextMenuItemNames;exports.GridSearchBox=H.GridSearchBox;exports.GridPdfExportButton=W.GridPdfExportButton;
|