@progress/kendo-react-grid 14.0.0-develop.1 → 14.0.0-develop.3

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 (72) hide show
  1. package/columnMenu/GridColumnMenuFilter.mjs +2 -2
  2. package/components/noRecords/GridNoRecordsContainer.mjs +1 -1
  3. package/constants/index.mjs +2 -2
  4. package/dist/cdn/js/kendo-react-grid.js +1 -1
  5. package/hooks/index.d.ts +8 -0
  6. package/hooks/useGridAIRequest.d.ts +150 -0
  7. package/hooks/useGridAIRequest.js +8 -0
  8. package/hooks/useGridAIRequest.mjs +93 -0
  9. package/index.d.mts +3 -1
  10. package/index.d.ts +3 -1
  11. package/index.js +1 -1
  12. package/index.mjs +56 -50
  13. package/messages/index.d.ts +75 -0
  14. package/messages/index.js +2 -2
  15. package/messages/index.mjs +108 -78
  16. package/package-metadata.js +1 -1
  17. package/package-metadata.mjs +1 -1
  18. package/package.json +19 -19
  19. package/toolbar-tools/GridToolbarAIAssistant.d.ts +2 -34
  20. package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
  21. package/toolbar-tools/GridToolbarAIAssistant.mjs +167 -164
  22. package/toolbar-tools/GridToolbarFilter.mjs +5 -5
  23. package/toolbar-tools/smartbox/SegmentedControl.d.ts +13 -0
  24. package/toolbar-tools/smartbox/SegmentedControl.js +8 -0
  25. package/toolbar-tools/smartbox/SegmentedControl.mjs +109 -0
  26. package/toolbar-tools/smartbox/SmartBox.d.ts +20 -0
  27. package/toolbar-tools/smartbox/SmartBox.js +8 -0
  28. package/toolbar-tools/smartbox/SmartBox.mjs +380 -0
  29. package/toolbar-tools/smartbox/defaultConfigs.d.ts +30 -0
  30. package/toolbar-tools/smartbox/defaultConfigs.js +8 -0
  31. package/toolbar-tools/smartbox/defaultConfigs.mjs +36 -0
  32. package/toolbar-tools/smartbox/hooks/index.d.ts +17 -0
  33. package/toolbar-tools/smartbox/hooks/useDebounce.d.ts +11 -0
  34. package/toolbar-tools/smartbox/hooks/useDebounce.js +9 -0
  35. package/toolbar-tools/smartbox/hooks/useDebounce.mjs +21 -0
  36. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.d.ts +251 -0
  37. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.js +9 -0
  38. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.mjs +68 -0
  39. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.d.ts +80 -0
  40. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.js +9 -0
  41. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.mjs +66 -0
  42. package/toolbar-tools/smartbox/hooks/useSmartBoxInput.d.ts +96 -0
  43. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.d.ts +93 -0
  44. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.js +9 -0
  45. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.mjs +61 -0
  46. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.d.ts +163 -0
  47. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.js +9 -0
  48. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.mjs +102 -0
  49. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.d.ts +115 -0
  50. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.js +9 -0
  51. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.mjs +65 -0
  52. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.d.ts +56 -0
  53. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.js +9 -0
  54. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.mjs +25 -0
  55. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.d.ts +82 -0
  56. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.js +9 -0
  57. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.mjs +67 -0
  58. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.d.ts +70 -0
  59. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.js +9 -0
  60. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.mjs +57 -0
  61. package/toolbar-tools/smartbox/index.d.ts +10 -0
  62. package/toolbar-tools/smartbox/interfaces/SearchTypes.d.ts +45 -0
  63. package/toolbar-tools/smartbox/interfaces/SegmentedControlTypes.d.ts +66 -0
  64. package/toolbar-tools/smartbox/interfaces/SmartBoxTypes.d.ts +461 -0
  65. package/toolbar-tools/smartbox/interfaces/index.d.ts +11 -0
  66. package/toolbar-tools/smartbox/interfaces/utilTypes.d.ts +25 -0
  67. package/toolbar-tools/smartbox/listItemRenders.d.ts +165 -0
  68. package/toolbar-tools/smartbox/listItemRenders.js +8 -0
  69. package/toolbar-tools/smartbox/listItemRenders.mjs +68 -0
  70. package/toolbar-tools/smartbox/utils.d.ts +14 -0
  71. package/toolbar-tools/smartbox/utils.js +8 -0
  72. package/toolbar-tools/smartbox/utils.mjs +14 -0
@@ -0,0 +1,251 @@
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 { CompositeFilterDescriptor, GroupDescriptor, SortDescriptor } from '@progress/kendo-data-query';
9
+ import { GridColumnState } from '../../../interfaces/GridColumnState.js';
10
+ import { CompositeHighlightDescriptor } from '../../../interfaces/CompositeHighlightDescriptor.js';
11
+ /**
12
+ * Represents the grid context type with all available grid operations and state.
13
+ *
14
+ * @hidden
15
+ */
16
+ export interface SmartBoxGridContextType {
17
+ /**
18
+ * The current sort descriptors applied to the grid.
19
+ * Array of sort objects defining field and direction.
20
+ */
21
+ sort?: SortDescriptor[];
22
+ /**
23
+ * The current filter descriptor applied to the grid.
24
+ * Composite filter defining logic and filter array.
25
+ */
26
+ filter?: CompositeFilterDescriptor;
27
+ /**
28
+ * The current group descriptors applied to the grid.
29
+ * Array of group objects defining field and aggregates.
30
+ */
31
+ group?: GroupDescriptor[];
32
+ /**
33
+ * The current highlight descriptor applied to the grid.
34
+ * Used to highlight specific cells or rows based on filter conditions.
35
+ */
36
+ highlight?: CompositeHighlightDescriptor;
37
+ /**
38
+ * The current selection descriptor applied to the grid.
39
+ * Used to select specific cells or rows based on filter conditions.
40
+ */
41
+ select?: CompositeHighlightDescriptor;
42
+ /**
43
+ * The current columns state (visibility, order, width, lock status).
44
+ * Array of column state objects defining the column configuration.
45
+ */
46
+ columnsState?: GridColumnState[];
47
+ /**
48
+ * The current skip value for paging.
49
+ * Zero-based index for the first item to display.
50
+ */
51
+ skip?: number;
52
+ /**
53
+ * The current take value for paging.
54
+ * Number of items to display per page.
55
+ */
56
+ take?: number;
57
+ /**
58
+ * Reference to the visible grid columns.
59
+ */
60
+ columnsRef?: any[];
61
+ /**
62
+ * Reference to the hidden grid columns.
63
+ */
64
+ hiddenColumnsRef?: any[];
65
+ /**
66
+ * The data item key field name.
67
+ */
68
+ dataItemKey?: string;
69
+ /**
70
+ * Gets the total number of data items.
71
+ */
72
+ getTotal: () => number;
73
+ /**
74
+ * Gets the leaf data items (after grouping).
75
+ */
76
+ getLeafDataItems: () => any[];
77
+ /**
78
+ * Exports the grid as PDF.
79
+ */
80
+ exportAsPdf: () => void;
81
+ /**
82
+ * Handles sort changes.
83
+ *
84
+ * @param sort - The new sort descriptors to apply.
85
+ * @param event - The triggering event.
86
+ */
87
+ sortChange: (sort: SortDescriptor[], event: any) => void;
88
+ /**
89
+ * Handles filter changes.
90
+ *
91
+ * @param filter - The new filter descriptor to apply, or undefined to clear filters.
92
+ * @param event - The triggering event.
93
+ */
94
+ filterChange: (filter: CompositeFilterDescriptor | undefined, event: any) => void;
95
+ /**
96
+ * Handles group changes.
97
+ *
98
+ * @param group - The new group descriptors to apply.
99
+ * @param event - The triggering event.
100
+ */
101
+ groupChange: (group: GroupDescriptor[], event: any) => void;
102
+ /**
103
+ * Applies highlight descriptor to the grid.
104
+ *
105
+ * @param highlight - The highlight descriptor to apply.
106
+ */
107
+ applyHighlightDescriptor: (highlight: CompositeHighlightDescriptor) => void;
108
+ /**
109
+ * Applies selection descriptor to the grid.
110
+ *
111
+ * @param select - The selection descriptor to apply.
112
+ */
113
+ applySelectionDescriptor: (select: CompositeHighlightDescriptor) => void;
114
+ /**
115
+ * Handles columns state changes.
116
+ *
117
+ * @param columnsState - The new columns state to apply.
118
+ */
119
+ onColumnsStateChange: (columnsState: GridColumnState[]) => void;
120
+ /**
121
+ * Handles pager page changes.
122
+ *
123
+ * @param event - The page change event containing skip and take values.
124
+ */
125
+ pagerPageChange: (event: {
126
+ skip: number;
127
+ take: number;
128
+ syntheticEvent: any;
129
+ }) => void;
130
+ }
131
+ /**
132
+ * Represents the grid state snapshot.
133
+ * This interface contains all the stateful properties that can be modified through AI commands.
134
+ *
135
+ * @hidden
136
+ */
137
+ export interface SmartBoxGridState {
138
+ /**
139
+ * The current sort descriptors applied to the grid.
140
+ * Array of sort objects defining field and direction.
141
+ */
142
+ sort?: SortDescriptor[];
143
+ /**
144
+ * The current filter descriptor applied to the grid.
145
+ * Composite filter defining logic and filter array.
146
+ */
147
+ filter?: CompositeFilterDescriptor;
148
+ /**
149
+ * The current group descriptors applied to the grid.
150
+ * Array of group objects defining field and aggregates.
151
+ */
152
+ group?: GroupDescriptor[];
153
+ /**
154
+ * The current highlight descriptor applied to the grid.
155
+ * Used to highlight specific cells or rows based on filter conditions.
156
+ */
157
+ highlight?: CompositeHighlightDescriptor;
158
+ /**
159
+ * The current selection descriptor applied to the grid.
160
+ * Used to select specific cells or rows based on filter conditions.
161
+ */
162
+ select?: CompositeHighlightDescriptor;
163
+ /**
164
+ * The current columns state (visibility, order, width, lock status).
165
+ * Array of column state objects defining the column configuration.
166
+ */
167
+ columnsState?: GridColumnState[];
168
+ /**
169
+ * The current skip value for paging.
170
+ * Zero-based index for the first item to display.
171
+ */
172
+ skip?: number;
173
+ /**
174
+ * The current take value for paging.
175
+ * Number of items to display per page.
176
+ */
177
+ take?: number;
178
+ }
179
+ /**
180
+ * Represents a reference to the grid with essential methods.
181
+ *
182
+ * @hidden
183
+ */
184
+ export interface SmartBoxGridRef {
185
+ /**
186
+ * Gets the total number of data items.
187
+ */
188
+ getTotal: () => number;
189
+ /**
190
+ * Gets the leaf data items (after grouping).
191
+ */
192
+ getLeafDataItems: () => any[];
193
+ /**
194
+ * Exports the grid as PDF.
195
+ */
196
+ exportAsPdf: () => void;
197
+ /**
198
+ * The grid props.
199
+ */
200
+ props: {
201
+ /**
202
+ * The data item key field name.
203
+ */
204
+ dataItemKey?: string;
205
+ };
206
+ }
207
+ /**
208
+ * Represents the return value of the useSmartBoxGridState hook.
209
+ *
210
+ * @hidden
211
+ */
212
+ export interface UseSmartBoxGridStateResult {
213
+ /**
214
+ * The grid columns with their field names, IDs, and possible values.
215
+ */
216
+ columns: Array<{
217
+ id?: string;
218
+ field: string;
219
+ values?: any[];
220
+ }>;
221
+ /**
222
+ * The current grid state snapshot.
223
+ */
224
+ gridState: SmartBoxGridState | undefined;
225
+ /**
226
+ * Reference to the grid with essential methods.
227
+ */
228
+ gridRef: SmartBoxGridRef | null;
229
+ /**
230
+ * Function to handle grid state changes from AI responses.
231
+ *
232
+ * @param newState - The new partial state to apply.
233
+ */
234
+ handleStateChange: (newState: Partial<SmartBoxGridState>) => void;
235
+ /**
236
+ * Function to export the grid as PDF.
237
+ */
238
+ exportAsPdf: () => void;
239
+ }
240
+ /**
241
+ * Hook to manage grid state for SmartBox AI assistant operations.
242
+ *
243
+ * This hook extracts the current grid state from the grid context and provides
244
+ * functions to update the grid state based on AI responses.
245
+ *
246
+ * @param gridContext - The grid context providing access to grid operations.
247
+ * @returns An object containing grid state and management functions.
248
+ *
249
+ * @hidden
250
+ */
251
+ export declare function useSmartBoxGridState(gridContext: SmartBoxGridContextType | null): UseSmartBoxGridStateResult;
@@ -0,0 +1,9 @@
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 client";
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react");function v(s){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const u in s)if(u!=="default"){const f=Object.getOwnPropertyDescriptor(s,u);Object.defineProperty(c,u,f.get?f:{enumerable:!0,get:()=>s[u]})}}return c.default=s,Object.freeze(c)}const a=v(k);function r(s){const c=a.useMemo(()=>{var l;if(s!=null&&s.columnsRef&&Array.isArray(s.columnsRef)){const e=s.columnsRef,p=(l=s.hiddenColumnsRef)!=null?l:[];return[...e,...p].map(h=>{var m;return{id:h.id,field:h.field,values:(m=h.values)!=null?m:[]}})}return[]},[s==null?void 0:s.columnsRef,s==null?void 0:s.hiddenColumnsRef]),u=a.useMemo(()=>s?{sort:s.sort,filter:s.filter,group:s.group,highlight:s.highlight,select:s.select,columnsState:s.columnsState,skip:s.skip,take:s.take}:void 0,[s]),f=a.useMemo(()=>s?{getTotal:()=>s.getTotal(),getLeafDataItems:()=>s.getLeafDataItems(),exportAsPdf:()=>s.exportAsPdf(),props:{dataItemKey:s.dataItemKey}}:null,[s]),o=a.useCallback(l=>{var e,p;s&&(l.sort!==void 0&&l.sort!==s.sort&&s.sortChange(l.sort,{}),l.filter!==s.filter&&s.filterChange(l.filter,{}),l.group!==void 0&&l.group!==s.group&&s.groupChange(l.group,{}),l.highlight!==void 0&&l.highlight!==s.highlight&&s.applyHighlightDescriptor(l.highlight),l.select!==void 0&&l.select!==s.select&&s.applySelectionDescriptor(l.select),l.columnsState!==void 0&&l.columnsState!==s.columnsState&&s.onColumnsStateChange(l.columnsState),(l.skip!==void 0&&l.skip!==s.skip||l.take!==void 0&&l.take!==s.take)&&s.pagerPageChange({skip:(e=l.skip)!=null?e:0,take:(p=l.take)!=null?p:0,syntheticEvent:{}}))},[s]),i=a.useCallback(()=>{s==null||s.exportAsPdf()},[s]);return{columns:c,gridState:u,gridRef:f,handleStateChange:o,exportAsPdf:i}}exports.useSmartBoxGridState=r;
@@ -0,0 +1,68 @@
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 client";
9
+ import * as u from "react";
10
+ function i(s) {
11
+ const p = u.useMemo(() => {
12
+ var l;
13
+ if (s != null && s.columnsRef && Array.isArray(s.columnsRef)) {
14
+ const f = s.columnsRef, h = (l = s.hiddenColumnsRef) != null ? l : [];
15
+ return [...f, ...h].map((a) => {
16
+ var c;
17
+ return {
18
+ id: a.id,
19
+ field: a.field,
20
+ values: (c = a.values) != null ? c : []
21
+ };
22
+ });
23
+ }
24
+ return [];
25
+ }, [s == null ? void 0 : s.columnsRef, s == null ? void 0 : s.hiddenColumnsRef]), m = u.useMemo(
26
+ () => s ? {
27
+ sort: s.sort,
28
+ filter: s.filter,
29
+ group: s.group,
30
+ highlight: s.highlight,
31
+ select: s.select,
32
+ columnsState: s.columnsState,
33
+ skip: s.skip,
34
+ take: s.take
35
+ } : void 0,
36
+ [s]
37
+ ), k = u.useMemo(
38
+ () => s ? {
39
+ getTotal: () => s.getTotal(),
40
+ getLeafDataItems: () => s.getLeafDataItems(),
41
+ exportAsPdf: () => s.exportAsPdf(),
42
+ props: { dataItemKey: s.dataItemKey }
43
+ } : null,
44
+ [s]
45
+ ), v = u.useCallback(
46
+ (l) => {
47
+ var f, h;
48
+ s && (l.sort !== void 0 && l.sort !== s.sort && s.sortChange(l.sort, {}), l.filter !== s.filter && s.filterChange(l.filter, {}), l.group !== void 0 && l.group !== s.group && s.groupChange(l.group, {}), l.highlight !== void 0 && l.highlight !== s.highlight && s.applyHighlightDescriptor(l.highlight), l.select !== void 0 && l.select !== s.select && s.applySelectionDescriptor(l.select), l.columnsState !== void 0 && l.columnsState !== s.columnsState && s.onColumnsStateChange(l.columnsState), (l.skip !== void 0 && l.skip !== s.skip || l.take !== void 0 && l.take !== s.take) && s.pagerPageChange({
49
+ skip: (f = l.skip) != null ? f : 0,
50
+ take: (h = l.take) != null ? h : 0,
51
+ syntheticEvent: {}
52
+ }));
53
+ },
54
+ [s]
55
+ ), R = u.useCallback(() => {
56
+ s == null || s.exportAsPdf();
57
+ }, [s]);
58
+ return {
59
+ columns: p,
60
+ gridState: m,
61
+ gridRef: k,
62
+ handleStateChange: v,
63
+ exportAsPdf: R
64
+ };
65
+ }
66
+ export {
67
+ i as useSmartBoxGridState
68
+ };
@@ -0,0 +1,80 @@
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 { HistoryItem, SmartBoxMode } from '../interfaces/index.js';
9
+ import { GridSmartBoxHistoryProps } from '../interfaces/utilTypes.js';
10
+ /**
11
+ * Represents the props for the useSmartBoxHistory hook.
12
+ *
13
+ * @hidden
14
+ */
15
+ export interface UseSmartBoxHistoryProps {
16
+ /**
17
+ * The currently selected view mode.
18
+ */
19
+ selectedView: SmartBoxMode | null;
20
+ /**
21
+ * The history settings for search mode.
22
+ */
23
+ searchHistorySettings: GridSmartBoxHistoryProps | null;
24
+ /**
25
+ * The history settings for semantic search mode.
26
+ */
27
+ semanticSearchHistorySettings: GridSmartBoxHistoryProps | null;
28
+ /**
29
+ * The history settings for AI assistant mode.
30
+ */
31
+ aiAssistantHistorySettings: GridSmartBoxHistoryProps | null;
32
+ }
33
+ /**
34
+ * Represents the return value of the useSmartBoxHistory hook.
35
+ *
36
+ * @hidden
37
+ */
38
+ export interface UseSmartBoxHistoryReturn {
39
+ /**
40
+ * The history items for search mode.
41
+ */
42
+ searchHistory: HistoryItem[];
43
+ /**
44
+ * The history items for semantic search mode.
45
+ */
46
+ semanticSearchHistory: HistoryItem[];
47
+ /**
48
+ * The history items for AI assistant mode.
49
+ */
50
+ aiAssistantHistory: HistoryItem[];
51
+ /**
52
+ * The history items for the currently selected mode.
53
+ */
54
+ currentHistory: HistoryItem[];
55
+ /**
56
+ * The history settings for the currently selected mode.
57
+ */
58
+ currentHistorySettings: GridSmartBoxHistoryProps | null;
59
+ /**
60
+ * Function to add a new item to the history for a specific mode.
61
+ *
62
+ * @param mode - The mode to add the history item to.
63
+ * @param value - The text value to add to history.
64
+ * @param historySettings - The history settings for the mode.
65
+ */
66
+ addToHistory: (mode: SmartBoxMode, value: string, historySettings: GridSmartBoxHistoryProps | null) => void;
67
+ }
68
+ /**
69
+ * Hook to manage SmartBox history for all modes.
70
+ *
71
+ * This hook maintains separate history lists for each mode (search, semantic search,
72
+ * and AI assistant) and provides functions to add items to history while respecting
73
+ * the configured history size limits.
74
+ *
75
+ * @param props - The hook properties.
76
+ * @returns An object containing history arrays and management functions.
77
+ *
78
+ * @hidden
79
+ */
80
+ export declare function useSmartBoxHistory({ selectedView, searchHistorySettings, semanticSearchHistorySettings, aiAssistantHistorySettings }: UseSmartBoxHistoryProps): UseSmartBoxHistoryReturn;
@@ -0,0 +1,9 @@
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 client";
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react");function j(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return s.default=t,Object.freeze(s)}const r=j(O);function A({selectedView:t,searchHistorySettings:s,semanticSearchHistorySettings:e,aiAssistantHistorySettings:a}){const[n,y]=r.useState([]),[c,f]=r.useState([]),[o,l]=r.useState([]),H=r.useCallback((b,i,u)=>{if(!u||!i.trim())return;const h={text:i,timestamp:new Date,format:u.timestampFormat},d={search:y,semanticSearch:f,aiAssistant:l}[b];d(m=>m.some(M=>M.text===i)?m:[h,...m].slice(0,u.size))},[]),p=r.useMemo(()=>{switch(t){case"search":return n;case"semanticSearch":return c;case"aiAssistant":return o;default:return[]}},[t,n,c,o]),S=r.useMemo(()=>{switch(t){case"search":return s;case"semanticSearch":return e;case"aiAssistant":return a;default:return null}},[t,s,e,a]);return{searchHistory:n,semanticSearchHistory:c,aiAssistantHistory:o,currentHistory:p,currentHistorySettings:S,addToHistory:H}}exports.useSmartBoxHistory=A;
@@ -0,0 +1,66 @@
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 client";
9
+ import * as t from "react";
10
+ function d({
11
+ selectedView: s,
12
+ searchHistorySettings: i,
13
+ semanticSearchHistorySettings: u,
14
+ aiAssistantHistorySettings: m
15
+ }) {
16
+ const [r, H] = t.useState([]), [e, y] = t.useState([]), [a, h] = t.useState([]), f = t.useCallback(
17
+ (A, c, n) => {
18
+ if (!n || !c.trim())
19
+ return;
20
+ const l = {
21
+ text: c,
22
+ timestamp: /* @__PURE__ */ new Date(),
23
+ format: n.timestampFormat
24
+ }, x = {
25
+ search: H,
26
+ semanticSearch: y,
27
+ aiAssistant: h
28
+ }[A];
29
+ x((o) => o.some((M) => M.text === c) ? o : [l, ...o].slice(0, n.size));
30
+ },
31
+ []
32
+ ), p = t.useMemo(() => {
33
+ switch (s) {
34
+ case "search":
35
+ return r;
36
+ case "semanticSearch":
37
+ return e;
38
+ case "aiAssistant":
39
+ return a;
40
+ default:
41
+ return [];
42
+ }
43
+ }, [s, r, e, a]), S = t.useMemo(() => {
44
+ switch (s) {
45
+ case "search":
46
+ return i;
47
+ case "semanticSearch":
48
+ return u;
49
+ case "aiAssistant":
50
+ return m;
51
+ default:
52
+ return null;
53
+ }
54
+ }, [s, i, u, m]);
55
+ return {
56
+ searchHistory: r,
57
+ semanticSearchHistory: e,
58
+ aiAssistantHistory: a,
59
+ currentHistory: p,
60
+ currentHistorySettings: S,
61
+ addToHistory: f
62
+ };
63
+ }
64
+ export {
65
+ d as useSmartBoxHistory
66
+ };
@@ -0,0 +1,96 @@
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 { SpeechToTextResultEvent } from '@progress/kendo-react-buttons';
9
+ import { SmartBoxMode } from '../interfaces/index.js';
10
+ import * as React from 'react';
11
+ /**
12
+ * Represents the props for the useSmartBoxInput hook.
13
+ *
14
+ * @hidden
15
+ */
16
+ export interface UseSmartBoxInputProps {
17
+ /**
18
+ * The currently selected view mode.
19
+ */
20
+ selectedView: SmartBoxMode | null;
21
+ /**
22
+ * Ref to the input element.
23
+ */
24
+ inputRef: React.RefObject<HTMLInputElement | null>;
25
+ /**
26
+ * Function to toggle the popup visibility.
27
+ */
28
+ togglePopup: (open: boolean) => void;
29
+ /**
30
+ * Function to emit a search event with the provided value.
31
+ */
32
+ emitSearchEvent: (value: string) => void;
33
+ /**
34
+ * State setter for the search value.
35
+ */
36
+ setSearchValue: React.Dispatch<React.SetStateAction<string | null>>;
37
+ /**
38
+ * Callback fired when the input receives focus.
39
+ */
40
+ onFocus?: () => void;
41
+ /**
42
+ * Callback fired when the input loses focus.
43
+ */
44
+ onBlur?: () => void;
45
+ }
46
+ /**
47
+ * Represents the return value of the useSmartBoxInput hook.
48
+ *
49
+ * @hidden
50
+ */
51
+ export interface UseSmartBoxInputResult {
52
+ /**
53
+ * The current value of the input.
54
+ */
55
+ inputValue: string;
56
+ /**
57
+ * State setter for the input value.
58
+ */
59
+ setInputValue: React.Dispatch<React.SetStateAction<string>>;
60
+ /**
61
+ * Handler for input change events.
62
+ */
63
+ handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
64
+ /**
65
+ * Handler for input focus events.
66
+ */
67
+ handleInputFocus: () => void;
68
+ /**
69
+ * Handler for input click events.
70
+ */
71
+ handleInputClick: () => void;
72
+ /**
73
+ * Handler for clearing the input value.
74
+ */
75
+ handleClearValue: (event: React.MouseEvent) => void;
76
+ /**
77
+ * Handler for speech-to-text result events.
78
+ */
79
+ handleSpeechResult: (event: SpeechToTextResultEvent) => void;
80
+ /**
81
+ * Handler for blur events on the wrapper element.
82
+ */
83
+ handleWrapperBlur: (event: React.FocusEvent<HTMLDivElement>, wrapperRef: React.RefObject<HTMLDivElement | null>) => void;
84
+ }
85
+ /**
86
+ * Hook to manage SmartBox input state and event handlers.
87
+ *
88
+ * This hook provides input value management and event handlers for
89
+ * text input, focus, blur, clear, and speech-to-text functionality.
90
+ *
91
+ * @param props - The hook properties.
92
+ * @returns An object containing input state and event handlers.
93
+ *
94
+ * @hidden
95
+ */
96
+ export declare function useSmartBoxInput({ selectedView, inputRef, togglePopup, emitSearchEvent, setSearchValue, onFocus, onBlur }: UseSmartBoxInputProps): UseSmartBoxInputResult;
@@ -0,0 +1,93 @@
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 { SVGIcon } from '@progress/kendo-svg-icons';
9
+ import { SmartBoxMode } from '../interfaces/index.js';
10
+ /**
11
+ * Represents a minimal mode configuration for labels.
12
+ *
13
+ * @hidden
14
+ */
15
+ export interface SmartBoxLabelsModeConfig {
16
+ /**
17
+ * Specifies whether the mode is enabled.
18
+ */
19
+ enabled?: boolean;
20
+ /**
21
+ * The placeholder text for the mode.
22
+ */
23
+ placeholder?: string;
24
+ }
25
+ /**
26
+ * Represents the props for the useSmartBoxLabels hook.
27
+ *
28
+ * @hidden
29
+ */
30
+ export interface UseSmartBoxLabelsProps {
31
+ /**
32
+ * The currently selected view mode.
33
+ */
34
+ selectedView: SmartBoxMode | null;
35
+ /**
36
+ * The search mode configuration.
37
+ */
38
+ searchMode: SmartBoxLabelsModeConfig | null;
39
+ /**
40
+ * The semantic search mode configuration.
41
+ */
42
+ semanticSearchMode: SmartBoxLabelsModeConfig | null;
43
+ /**
44
+ * The AI assistant mode configuration.
45
+ */
46
+ aiAssistantMode: SmartBoxLabelsModeConfig | null;
47
+ /**
48
+ * The shared placeholder text that overrides mode-specific placeholders.
49
+ */
50
+ sharedPlaceholder?: string;
51
+ }
52
+ /**
53
+ * Represents a prefix icon configuration.
54
+ *
55
+ * @hidden
56
+ */
57
+ export interface SmartBoxPrefixIcon {
58
+ /**
59
+ * The icon name.
60
+ */
61
+ name: string;
62
+ /**
63
+ * The SVG icon.
64
+ */
65
+ svgIcon: SVGIcon;
66
+ }
67
+ /**
68
+ * Represents the return value of the useSmartBoxLabels hook.
69
+ *
70
+ * @hidden
71
+ */
72
+ export interface UseSmartBoxLabelsResult {
73
+ /**
74
+ * The placeholder text for the input based on the selected mode.
75
+ */
76
+ inputPlaceholder: string;
77
+ /**
78
+ * The prefix icon configuration based on the selected mode.
79
+ */
80
+ prefixIcon: SmartBoxPrefixIcon;
81
+ }
82
+ /**
83
+ * Hook to compute SmartBox labels and icons based on the selected mode.
84
+ *
85
+ * This hook determines the appropriate placeholder text and prefix icon
86
+ * based on the currently selected mode, using localized strings.
87
+ *
88
+ * @param props - The hook properties.
89
+ * @returns An object containing the input placeholder and prefix icon.
90
+ *
91
+ * @hidden
92
+ */
93
+ export declare function useSmartBoxLabels({ selectedView, searchMode, semanticSearchMode, aiAssistantMode, sharedPlaceholder }: UseSmartBoxLabelsProps): UseSmartBoxLabelsResult;
@@ -0,0 +1,9 @@
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 client";
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),m=require("@progress/kendo-react-intl"),o=require("@progress/kendo-svg-icons"),t=require("../../../messages/index.js");function i(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const u=i(g);function p({selectedView:e,searchMode:n,semanticSearchMode:r,aiAssistantMode:a,sharedPlaceholder:s}){const c=m.useLocalization(),l=u.useMemo(()=>{switch(e){case"search":return{name:"search",svgIcon:o.searchIcon};case"semanticSearch":return{name:"zoom-sparkle",svgIcon:o.zoomSparkleIcon};case"aiAssistant":return{name:"sparkles",svgIcon:o.sparklesIcon};default:return{name:"search",svgIcon:o.searchIcon}}},[e]);return{inputPlaceholder:u.useMemo(()=>{if(s)return s;switch(e){case"search":return(n==null?void 0:n.placeholder)||c.toLanguageString(t.smartBoxSearchPlaceholder,t.messages[t.smartBoxSearchPlaceholder]);case"semanticSearch":return(r==null?void 0:r.placeholder)||c.toLanguageString(t.smartBoxSemanticSearchPlaceholder,t.messages[t.smartBoxSemanticSearchPlaceholder]);case"aiAssistant":return(a==null?void 0:a.placeholder)||c.toLanguageString(t.smartBoxAIAssistantPlaceholder,t.messages[t.smartBoxAIAssistantPlaceholder]);default:return""}},[e,n,r,a,s,c]),prefixIcon:l}}exports.useSmartBoxLabels=p;