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

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 +245 -0
  37. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.js +9 -0
  38. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.mjs +54 -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,61 @@
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 e from "react";
10
+ import { useLocalization as f } from "@progress/kendo-react-intl";
11
+ import { searchIcon as l, sparklesIcon as I, zoomSparkleIcon as i } from "@progress/kendo-svg-icons";
12
+ import { smartBoxAIAssistantPlaceholder as m, messages as u, smartBoxSemanticSearchPlaceholder as s, smartBoxSearchPlaceholder as p } from "../../../messages/index.mjs";
13
+ function k({
14
+ selectedView: r,
15
+ searchMode: n,
16
+ semanticSearchMode: a,
17
+ aiAssistantMode: o,
18
+ sharedPlaceholder: c
19
+ }) {
20
+ const t = f(), g = e.useMemo(() => {
21
+ switch (r) {
22
+ case "search":
23
+ return { name: "search", svgIcon: l };
24
+ case "semanticSearch":
25
+ return { name: "zoom-sparkle", svgIcon: i };
26
+ case "aiAssistant":
27
+ return { name: "sparkles", svgIcon: I };
28
+ default:
29
+ return { name: "search", svgIcon: l };
30
+ }
31
+ }, [r]);
32
+ return {
33
+ inputPlaceholder: e.useMemo(() => {
34
+ if (c)
35
+ return c;
36
+ switch (r) {
37
+ case "search":
38
+ return (n == null ? void 0 : n.placeholder) || t.toLanguageString(
39
+ p,
40
+ u[p]
41
+ );
42
+ case "semanticSearch":
43
+ return (a == null ? void 0 : a.placeholder) || t.toLanguageString(
44
+ s,
45
+ u[s]
46
+ );
47
+ case "aiAssistant":
48
+ return (o == null ? void 0 : o.placeholder) || t.toLanguageString(
49
+ m,
50
+ u[m]
51
+ );
52
+ default:
53
+ return "";
54
+ }
55
+ }, [r, n, a, o, c, t]),
56
+ prefixIcon: g
57
+ };
58
+ }
59
+ export {
60
+ k as useSmartBoxLabels
61
+ };
@@ -0,0 +1,163 @@
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 history item for the list data.
12
+ *
13
+ * @hidden
14
+ */
15
+ export interface SmartBoxListHistoryItem {
16
+ /**
17
+ * The text content of the history item.
18
+ */
19
+ text: string;
20
+ /**
21
+ * The timestamp when the history item was created.
22
+ */
23
+ timestamp: Date;
24
+ }
25
+ /**
26
+ * Represents the history settings for the list data.
27
+ *
28
+ * @hidden
29
+ */
30
+ export interface SmartBoxListHistorySettings {
31
+ /**
32
+ * The format string for displaying timestamps.
33
+ */
34
+ timestampFormat?: string;
35
+ }
36
+ /**
37
+ * Represents a search mode list item.
38
+ *
39
+ * @hidden
40
+ */
41
+ export interface SmartBoxSearchListItem {
42
+ /**
43
+ * The display text for the list item.
44
+ */
45
+ text: string;
46
+ /**
47
+ * The description text for the list item.
48
+ */
49
+ description: string;
50
+ /**
51
+ * Indicates whether the item is currently selected.
52
+ */
53
+ selected: boolean;
54
+ /**
55
+ * The mode this item represents.
56
+ */
57
+ mode: SmartBoxMode;
58
+ }
59
+ /**
60
+ * Represents a general list data item (for suggestions and history).
61
+ *
62
+ * @hidden
63
+ */
64
+ export interface SmartBoxListDataItem {
65
+ /**
66
+ * The unique identifier for the item.
67
+ */
68
+ id: string;
69
+ /**
70
+ * The display text for the item.
71
+ */
72
+ text: string;
73
+ /**
74
+ * The description text for the item (e.g., formatted timestamp).
75
+ */
76
+ description?: string;
77
+ /**
78
+ * The group name this item belongs to.
79
+ */
80
+ group: string;
81
+ /**
82
+ * The SVG icon for the group header.
83
+ */
84
+ groupSvgIcon?: SVGIcon;
85
+ /**
86
+ * Indicates whether this is a history item.
87
+ */
88
+ isHistoryItem?: boolean;
89
+ /**
90
+ * The timestamp for history items.
91
+ */
92
+ timestamp?: Date;
93
+ }
94
+ /**
95
+ * Represents the props for the useSmartBoxListData hook.
96
+ *
97
+ * @hidden
98
+ */
99
+ export interface UseSmartBoxListDataProps {
100
+ /**
101
+ * The currently selected view mode.
102
+ */
103
+ selectedView: SmartBoxMode | null;
104
+ /**
105
+ * Indicates whether search mode is enabled.
106
+ */
107
+ searchModeEnabled?: boolean;
108
+ /**
109
+ * Indicates whether semantic search mode is enabled.
110
+ */
111
+ semanticSearchModeEnabled?: boolean;
112
+ /**
113
+ * The list of prompt suggestions for AI assistant mode.
114
+ */
115
+ promptSuggestions: string[];
116
+ /**
117
+ * The current history items for the selected mode.
118
+ */
119
+ currentHistory: SmartBoxListHistoryItem[];
120
+ /**
121
+ * The current history settings for the selected mode.
122
+ */
123
+ currentHistorySettings: SmartBoxListHistorySettings | null;
124
+ }
125
+ /**
126
+ * Represents the return value of the useSmartBoxListData hook.
127
+ *
128
+ * @hidden
129
+ */
130
+ export interface UseSmartBoxListDataResult {
131
+ /**
132
+ * The list data for search mode selection (search vs semantic search).
133
+ */
134
+ searchListData: SmartBoxSearchListItem[];
135
+ /**
136
+ * The list data for AI assistant mode (suggestions and history).
137
+ */
138
+ aiAssistantListData: SmartBoxListDataItem[];
139
+ /**
140
+ * The list data for search history.
141
+ */
142
+ searchHistoryListData: SmartBoxListDataItem[];
143
+ /**
144
+ * The localized label for suggested prompts.
145
+ */
146
+ suggestedPromptsLabel: string;
147
+ /**
148
+ * The localized label for history items.
149
+ */
150
+ historyLabel: string;
151
+ }
152
+ /**
153
+ * Hook to compute list data for SmartBox popup content.
154
+ *
155
+ * This hook generates the list data for the popup based on the selected mode,
156
+ * including search mode selection items, prompt suggestions, and history items.
157
+ *
158
+ * @param props - The hook properties.
159
+ * @returns An object containing computed list data arrays and labels.
160
+ *
161
+ * @hidden
162
+ */
163
+ export declare function useSmartBoxListData({ selectedView, searchModeEnabled, semanticSearchModeEnabled, promptSuggestions, currentHistory, currentHistorySettings }: UseSmartBoxListDataProps): UseSmartBoxListDataResult;
@@ -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 S=require("react"),h=require("@progress/kendo-react-intl"),x=require("@progress/kendo-svg-icons"),a=require("../../../messages/index.js");function D(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>o[s]})}}return r.default=o,Object.freeze(r)}const l=D(S);function M({selectedView:o,searchModeEnabled:r,semanticSearchModeEnabled:s,promptSuggestions:i,currentHistory:p,currentHistorySettings:e}){const t=h.useLocalization(),u=h.useInternationalization(),g=t.toLanguageString(a.smartBoxSuggestedPrompts,a.messages[a.smartBoxSuggestedPrompts]),n=o==="aiAssistant"?t.toLanguageString(a.smartBoxPreviouslyAsked,a.messages[a.smartBoxPreviouslyAsked]):t.toLanguageString(a.smartBoxPreviouslySearched,a.messages[a.smartBoxPreviouslySearched]),f=l.useMemo(()=>r&&s?[{text:t.toLanguageString(a.smartBoxSearchModeText,a.messages[a.smartBoxSearchModeText]),description:t.toLanguageString(a.smartBoxSearchModeDescription,a.messages[a.smartBoxSearchModeDescription]),selected:o==="search",mode:"search"},{text:t.toLanguageString(a.smartBoxSemanticSearchModeText,a.messages[a.smartBoxSemanticSearchModeText]),description:t.toLanguageString(a.smartBoxSemanticSearchModeDescription,a.messages[a.smartBoxSemanticSearchModeDescription]),selected:o==="semanticSearch",mode:"semanticSearch"}]:[],[r,s,o,t]),B=l.useMemo(()=>{const m=[];return i.forEach((c,d)=>{m.push({id:`suggestion-${d}`,text:c,group:g,groupSvgIcon:x.lightbulbOutlineIcon,isHistoryItem:!1})}),p.forEach((c,d)=>{m.push({id:`history-${d}`,text:c.text,description:u.formatDate(c.timestamp,(e==null?void 0:e.timestampFormat)||"HH:mm"),group:n,groupSvgIcon:x.clockArrowRotateIcon,isHistoryItem:!0,timestamp:c.timestamp})}),m},[i,p,g,n,u,e==null?void 0:e.timestampFormat]),L=l.useMemo(()=>p.map((m,c)=>({id:`history-${c}`,text:m.text,description:u.formatDate(m.timestamp,(e==null?void 0:e.timestampFormat)||"HH:mm"),group:n,groupSvgIcon:x.clockArrowRotateIcon,isHistoryItem:!0,timestamp:m.timestamp})),[p,n,u,e==null?void 0:e.timestampFormat]);return{searchListData:f,aiAssistantListData:B,searchHistoryListData:L,suggestedPromptsLabel:g,historyLabel:n}}exports.useSmartBoxListData=M;
@@ -0,0 +1,102 @@
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 L from "react";
10
+ import { useLocalization as P, useInternationalization as z } from "@progress/kendo-react-intl";
11
+ import { lightbulbOutlineIcon as $, clockArrowRotateIcon as f } from "@progress/kendo-svg-icons";
12
+ import { smartBoxSuggestedPrompts as l, messages as e, smartBoxPreviouslyAsked as n, smartBoxPreviouslySearched as r, smartBoxSearchModeDescription as B, smartBoxSearchModeText as D, smartBoxSemanticSearchModeDescription as v, smartBoxSemanticSearchModeText as I } from "../../../messages/index.mjs";
13
+ function T({
14
+ selectedView: p,
15
+ searchModeEnabled: h,
16
+ semanticSearchModeEnabled: u,
17
+ promptSuggestions: d,
18
+ currentHistory: i,
19
+ currentHistorySettings: a
20
+ }) {
21
+ const o = P(), x = z(), g = o.toLanguageString(
22
+ l,
23
+ e[l]
24
+ ), s = p === "aiAssistant" ? o.toLanguageString(
25
+ n,
26
+ e[n]
27
+ ) : o.toLanguageString(
28
+ r,
29
+ e[r]
30
+ ), M = L.useMemo(() => h && u ? [
31
+ {
32
+ text: o.toLanguageString(
33
+ D,
34
+ e[D]
35
+ ),
36
+ description: o.toLanguageString(
37
+ B,
38
+ e[B]
39
+ ),
40
+ selected: p === "search",
41
+ mode: "search"
42
+ },
43
+ {
44
+ text: o.toLanguageString(
45
+ I,
46
+ e[I]
47
+ ),
48
+ description: o.toLanguageString(
49
+ v,
50
+ e[v]
51
+ ),
52
+ selected: p === "semanticSearch",
53
+ mode: "semanticSearch"
54
+ }
55
+ ] : [], [h, u, p, o]), A = L.useMemo(() => {
56
+ const m = [];
57
+ return d.forEach((t, c) => {
58
+ m.push({
59
+ id: `suggestion-${c}`,
60
+ text: t,
61
+ group: g,
62
+ groupSvgIcon: $,
63
+ isHistoryItem: !1
64
+ });
65
+ }), i.forEach((t, c) => {
66
+ m.push({
67
+ id: `history-${c}`,
68
+ text: t.text,
69
+ description: x.formatDate(t.timestamp, (a == null ? void 0 : a.timestampFormat) || "HH:mm"),
70
+ group: s,
71
+ groupSvgIcon: f,
72
+ isHistoryItem: !0,
73
+ timestamp: t.timestamp
74
+ });
75
+ }), m;
76
+ }, [
77
+ d,
78
+ i,
79
+ g,
80
+ s,
81
+ x,
82
+ a == null ? void 0 : a.timestampFormat
83
+ ]), F = L.useMemo(() => i.map((m, t) => ({
84
+ id: `history-${t}`,
85
+ text: m.text,
86
+ description: x.formatDate(m.timestamp, (a == null ? void 0 : a.timestampFormat) || "HH:mm"),
87
+ group: s,
88
+ groupSvgIcon: f,
89
+ isHistoryItem: !0,
90
+ timestamp: m.timestamp
91
+ })), [i, s, x, a == null ? void 0 : a.timestampFormat]);
92
+ return {
93
+ searchListData: M,
94
+ aiAssistantListData: A,
95
+ searchHistoryListData: F,
96
+ suggestedPromptsLabel: g,
97
+ historyLabel: s
98
+ };
99
+ }
100
+ export {
101
+ T as useSmartBoxListData
102
+ };
@@ -0,0 +1,115 @@
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 { SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
9
+ import { GridSmartBoxSearchProps, GridSmartBoxSemanticSearchConfigProps, GridSmartBoxAIAssistantConfigProps, SmartBoxMode } from '../interfaces/index.js';
10
+ import { GridSmartBoxHistoryProps } from '../interfaces/utilTypes.js';
11
+ import * as React from 'react';
12
+ /**
13
+ * Represents the props for the useSmartBoxModes hook.
14
+ *
15
+ * @hidden
16
+ */
17
+ export interface UseSmartBoxModesProps {
18
+ /**
19
+ * The search mode configuration prop from the component.
20
+ * Can be a boolean to enable/disable or an object with detailed settings.
21
+ */
22
+ searchConfigProp: boolean | GridSmartBoxSearchProps | undefined;
23
+ /**
24
+ * The semantic search mode configuration prop from the component.
25
+ * Can be a boolean to enable/disable or an object with detailed settings.
26
+ */
27
+ semanticSearchConfigProp: boolean | GridSmartBoxSemanticSearchConfigProps | undefined;
28
+ /**
29
+ * The AI assistant mode configuration prop from the component.
30
+ * Can be a boolean to enable/disable or an object with detailed settings.
31
+ */
32
+ aiAssistantConfigProp: boolean | GridSmartBoxAIAssistantConfigProps | undefined;
33
+ /**
34
+ * The active mode prop from the component.
35
+ * Used to control which mode is initially selected.
36
+ */
37
+ activeModeProp: SmartBoxMode | undefined;
38
+ /**
39
+ * The shared history settings prop from the component.
40
+ * When set, overrides individual mode history settings.
41
+ */
42
+ sharedHistory: boolean | GridSmartBoxHistoryProps | undefined;
43
+ }
44
+ /**
45
+ * Represents the return value of the useSmartBoxModes hook.
46
+ *
47
+ * @hidden
48
+ */
49
+ export interface UseSmartBoxModesReturn {
50
+ /**
51
+ * The normalized search mode configuration or null if disabled.
52
+ */
53
+ searchMode: GridSmartBoxSearchProps | null;
54
+ /**
55
+ * The normalized semantic search mode configuration or null if disabled.
56
+ */
57
+ semanticSearchMode: GridSmartBoxSemanticSearchConfigProps | null;
58
+ /**
59
+ * The normalized AI assistant mode configuration or null if disabled.
60
+ */
61
+ aiAssistantMode: GridSmartBoxAIAssistantConfigProps | null;
62
+ /**
63
+ * The currently selected view mode based on activeMode prop and enabled modes.
64
+ */
65
+ selectedView: SmartBoxMode | null;
66
+ /**
67
+ * The internal state for the selected view.
68
+ */
69
+ selectedViewState: SmartBoxMode | null;
70
+ /**
71
+ * State setter function for the selected view.
72
+ */
73
+ setSelectedViewState: React.Dispatch<React.SetStateAction<SmartBoxMode | null>>;
74
+ /**
75
+ * The last selected search mode ('search' or 'semanticSearch').
76
+ * Used to restore the previous search mode when switching back from AI Assistant.
77
+ */
78
+ lastSearchMode: 'search' | 'semanticSearch' | null;
79
+ /**
80
+ * State setter function for the last search mode.
81
+ */
82
+ setLastSearchMode: React.Dispatch<React.SetStateAction<'search' | 'semanticSearch' | null>>;
83
+ /**
84
+ * The normalized history settings for search mode.
85
+ */
86
+ searchHistorySettings: GridSmartBoxHistoryProps | null;
87
+ /**
88
+ * The normalized history settings for semantic search mode.
89
+ */
90
+ semanticSearchHistorySettings: GridSmartBoxHistoryProps | null;
91
+ /**
92
+ * The normalized history settings for AI assistant mode.
93
+ */
94
+ aiAssistantHistorySettings: GridSmartBoxHistoryProps | null;
95
+ /**
96
+ * The normalized speech-to-text button settings or null if disabled.
97
+ */
98
+ speechToTextButtonSettings: SpeechToTextButtonProps | null;
99
+ /**
100
+ * The current search delay in milliseconds based on the selected mode.
101
+ */
102
+ currentSearchDelay: number;
103
+ }
104
+ /**
105
+ * Hook to manage SmartBox mode configurations.
106
+ *
107
+ * This hook normalizes the mode configuration props, manages the selected view state,
108
+ * and computes derived values like history settings and speech-to-text button settings.
109
+ *
110
+ * @param props - The hook properties.
111
+ * @returns An object containing normalized mode configurations and state management functions.
112
+ *
113
+ * @hidden
114
+ */
115
+ export declare function useSmartBoxModes({ searchConfigProp, semanticSearchConfigProp, aiAssistantConfigProp, activeModeProp, sharedHistory }: UseSmartBoxModesProps): UseSmartBoxModesReturn;
@@ -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 L=require("react"),T=require("../defaultConfigs.js"),s=require("../utils.js");function N(f){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const S in f)if(S!=="default"){const n=Object.getOwnPropertyDescriptor(f,S);Object.defineProperty(c,S,n.get?n:{enumerable:!0,get:()=>f[S]})}}return c.default=f,Object.freeze(c)}const r=N(L);function V({searchConfigProp:f,semanticSearchConfigProp:c,aiAssistantConfigProp:S,activeModeProp:n,sharedHistory:l}){var O;const[b,B]=r.useState(n!=null?n:null),[D,_]=r.useState(null);r.useEffect(()=>{n!==void 0&&B(n)},[n]),r.useEffect(()=>{(b==="search"||b==="semanticSearch")&&_(b)},[b]);const t=r.useMemo(()=>f===!0?{...T.defaultSearchProps,enabled:!0}:f===!1||f===void 0?null:{...T.defaultSearchProps,...f},[f]),u=r.useMemo(()=>c===!0?{...T.defaultSemanticSearchProps,enabled:!0}:c===!1||c===void 0?null:{...T.defaultSemanticSearchProps,...c},[c]),e=r.useMemo(()=>S===!0?{...T.defaultAiAssistantProps,enabled:!0}:S===!1||S===void 0?null:{...T.defaultAiAssistantProps,...S},[S]),w=r.useMemo(()=>s.normalizeHistorySettings(l!=null?l:t==null?void 0:t.history),[t==null?void 0:t.history,l]),z=r.useMemo(()=>s.normalizeHistorySettings(l!=null?l:u==null?void 0:u.history),[u==null?void 0:u.history,l]),g=r.useMemo(()=>s.normalizeHistorySettings(l!=null?l:e==null?void 0:e.history),[e==null?void 0:e.history,l]),E=r.useMemo(()=>{var j,x;const m={search:t,semanticSearch:u,aiAssistant:e};return b&&((j=m[b])!=null&&j.enabled)?b:n&&((x=m[n])!=null&&x.enabled)?n:t!=null&&t.enabled?"search":u!=null&&u.enabled?"semanticSearch":e!=null&&e.enabled?"aiAssistant":null},[n,b,t,u,e]),q=r.useMemo(()=>{const m=e==null?void 0:e.speechToTextButton;return m===!0?T.DEFAULT_STB_SETTINGS:m===!1||!m?null:{...T.DEFAULT_STB_SETTINGS,...m}},[e==null?void 0:e.speechToTextButton]),y=(O=E==="search"?t==null?void 0:t.delay:u==null?void 0:u.delay)!=null?O:300;return{searchMode:t,semanticSearchMode:u,aiAssistantMode:e,selectedView:E,selectedViewState:b,setSelectedViewState:B,lastSearchMode:D,setLastSearchMode:_,searchHistorySettings:w,semanticSearchHistorySettings:z,aiAssistantHistorySettings:g,speechToTextButtonSettings:q,currentSearchDelay:y}}exports.useSmartBoxModes=V;
@@ -0,0 +1,65 @@
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 n from "react";
10
+ import { defaultSearchProps as _, defaultSemanticSearchProps as z, defaultAiAssistantProps as F, DEFAULT_STB_SETTINGS as G } from "../defaultConfigs.mjs";
11
+ import { normalizeHistorySettings as B } from "../utils.mjs";
12
+ function K({
13
+ searchConfigProp: T,
14
+ semanticSearchConfigProp: b,
15
+ aiAssistantConfigProp: x,
16
+ activeModeProp: f,
17
+ sharedHistory: l
18
+ }) {
19
+ var V;
20
+ const [S, r] = n.useState(f != null ? f : null), [I, E] = n.useState(null);
21
+ n.useEffect(() => {
22
+ f !== void 0 && r(f);
23
+ }, [f]), n.useEffect(() => {
24
+ (S === "search" || S === "semanticSearch") && E(S);
25
+ }, [S]);
26
+ const t = n.useMemo(() => T === !0 ? { ..._, enabled: !0 } : T === !1 || T === void 0 ? null : { ..._, ...T }, [T]), e = n.useMemo(() => b === !0 ? { ...z, enabled: !0 } : b === !1 || b === void 0 ? null : { ...z, ...b }, [b]), u = n.useMemo(() => x === !0 ? { ...F, enabled: !0 } : x === !1 || x === void 0 ? null : { ...F, ...x }, [x]), N = n.useMemo(
27
+ () => B(l != null ? l : t == null ? void 0 : t.history),
28
+ [t == null ? void 0 : t.history, l]
29
+ ), R = n.useMemo(
30
+ () => B(l != null ? l : e == null ? void 0 : e.history),
31
+ [e == null ? void 0 : e.history, l]
32
+ ), U = n.useMemo(
33
+ () => B(l != null ? l : u == null ? void 0 : u.history),
34
+ [u == null ? void 0 : u.history, l]
35
+ ), w = n.useMemo(() => {
36
+ var D, L;
37
+ const m = {
38
+ search: t,
39
+ semanticSearch: e,
40
+ aiAssistant: u
41
+ };
42
+ return S && ((D = m[S]) != null && D.enabled) ? S : f && ((L = m[f]) != null && L.enabled) ? f : t != null && t.enabled ? "search" : e != null && e.enabled ? "semanticSearch" : u != null && u.enabled ? "aiAssistant" : null;
43
+ }, [f, S, t, e, u]), j = n.useMemo(() => {
44
+ const m = u == null ? void 0 : u.speechToTextButton;
45
+ return m === !0 ? G : m === !1 || !m ? null : { ...G, ...m };
46
+ }, [u == null ? void 0 : u.speechToTextButton]), k = (V = w === "search" ? t == null ? void 0 : t.delay : e == null ? void 0 : e.delay) != null ? V : 300;
47
+ return {
48
+ searchMode: t,
49
+ semanticSearchMode: e,
50
+ aiAssistantMode: u,
51
+ selectedView: w,
52
+ selectedViewState: S,
53
+ setSelectedViewState: r,
54
+ lastSearchMode: I,
55
+ setLastSearchMode: E,
56
+ searchHistorySettings: N,
57
+ semanticSearchHistorySettings: R,
58
+ aiAssistantHistorySettings: U,
59
+ speechToTextButtonSettings: j,
60
+ currentSearchDelay: k
61
+ };
62
+ }
63
+ export {
64
+ K as useSmartBoxModes
65
+ };
@@ -0,0 +1,56 @@
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 * as React from 'react';
9
+ /**
10
+ * Represents the props for the useSmartBoxPopup hook.
11
+ *
12
+ * @hidden
13
+ */
14
+ export interface UseSmartBoxPopupProps {
15
+ /**
16
+ * Callback function fired when the popup opens.
17
+ */
18
+ onOpen?: () => void;
19
+ /**
20
+ * Callback function fired when the popup closes.
21
+ */
22
+ onClose?: () => void;
23
+ }
24
+ /**
25
+ * Represents the return value of the useSmartBoxPopup hook.
26
+ *
27
+ * @hidden
28
+ */
29
+ export interface UseSmartBoxPopupReturn {
30
+ /**
31
+ * Indicates whether the popup is currently open.
32
+ */
33
+ isOpen: boolean;
34
+ /**
35
+ * State setter function for the isOpen state.
36
+ */
37
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
38
+ /**
39
+ * Function to toggle the popup open/closed state.
40
+ *
41
+ * @param open - Whether to open (true) or close (false) the popup.
42
+ */
43
+ togglePopup: (open: boolean) => void;
44
+ }
45
+ /**
46
+ * Hook to manage SmartBox popup state.
47
+ *
48
+ * Provides state and functions to control the popup visibility,
49
+ * automatically triggering onOpen/onClose callbacks when the state changes.
50
+ *
51
+ * @param props - The hook properties.
52
+ * @returns An object containing the popup state and control functions.
53
+ *
54
+ * @hidden
55
+ */
56
+ export declare function useSmartBoxPopup({ onOpen, onClose }: UseSmartBoxPopupProps): UseSmartBoxPopupReturn;
@@ -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 s=require("react");function f(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,u.get?u:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const a=f(s);function l({onOpen:t,onClose:e}){const[r,u]=a.useState(!1),i=a.useCallback(c=>{r!==c&&(u(c),c?t==null||t():e==null||e())},[r,t,e]);return{isOpen:r,setIsOpen:u,togglePopup:i}}exports.useSmartBoxPopup=l;
@@ -0,0 +1,25 @@
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 c from "react";
10
+ function i({ onOpen: t, onClose: r }) {
11
+ const [u, s] = c.useState(!1), f = c.useCallback(
12
+ (a) => {
13
+ u !== a && (s(a), a ? t == null || t() : r == null || r());
14
+ },
15
+ [u, t, r]
16
+ );
17
+ return {
18
+ isOpen: u,
19
+ setIsOpen: s,
20
+ togglePopup: f
21
+ };
22
+ }
23
+ export {
24
+ i as useSmartBoxPopup
25
+ };