@progress/kendo-react-grid 13.4.0-develop.5 → 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 (89) hide show
  1. package/BaseCSVExport.d.ts +31 -0
  2. package/BaseCSVExport.js +8 -0
  3. package/BaseCSVExport.mjs +82 -0
  4. package/Grid.d.ts +33 -0
  5. package/GridClientWrapper.js +1 -1
  6. package/GridClientWrapper.mjs +313 -289
  7. package/GridComponent.js +1 -1
  8. package/GridComponent.mjs +247 -252
  9. package/GridCsvExportButton.d.ts +13 -0
  10. package/GridCsvExportButton.js +8 -0
  11. package/GridCsvExportButton.mjs +35 -0
  12. package/columnMenu/GridColumnMenuFilter.mjs +2 -2
  13. package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.js +1 -1
  14. package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.mjs +4 -4
  15. package/components/noRecords/GridNoRecordsContainer.mjs +1 -1
  16. package/constants/index.mjs +2 -2
  17. package/dist/cdn/js/kendo-react-grid.js +1 -1
  18. package/hooks/index.d.ts +8 -0
  19. package/hooks/useGridAIRequest.d.ts +150 -0
  20. package/hooks/useGridAIRequest.js +8 -0
  21. package/hooks/useGridAIRequest.mjs +93 -0
  22. package/index.d.mts +5 -2
  23. package/index.d.ts +5 -2
  24. package/index.js +1 -1
  25. package/index.mjs +71 -63
  26. package/interfaces/GridProps.d.ts +81 -0
  27. package/messages/index.d.ts +80 -0
  28. package/messages/index.js +2 -2
  29. package/messages/index.mjs +126 -94
  30. package/package-metadata.js +1 -1
  31. package/package-metadata.mjs +1 -1
  32. package/package.json +19 -19
  33. package/toolbar-tools/GridToolbarAIAssistant.d.ts +2 -34
  34. package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
  35. package/toolbar-tools/GridToolbarAIAssistant.mjs +167 -164
  36. package/toolbar-tools/GridToolbarFilter.mjs +5 -5
  37. package/toolbar-tools/smartbox/SegmentedControl.d.ts +13 -0
  38. package/toolbar-tools/smartbox/SegmentedControl.js +8 -0
  39. package/toolbar-tools/smartbox/SegmentedControl.mjs +109 -0
  40. package/toolbar-tools/smartbox/SmartBox.d.ts +20 -0
  41. package/toolbar-tools/smartbox/SmartBox.js +8 -0
  42. package/toolbar-tools/smartbox/SmartBox.mjs +380 -0
  43. package/toolbar-tools/smartbox/defaultConfigs.d.ts +30 -0
  44. package/toolbar-tools/smartbox/defaultConfigs.js +8 -0
  45. package/toolbar-tools/smartbox/defaultConfigs.mjs +36 -0
  46. package/toolbar-tools/smartbox/hooks/index.d.ts +17 -0
  47. package/toolbar-tools/smartbox/hooks/useDebounce.d.ts +11 -0
  48. package/toolbar-tools/smartbox/hooks/useDebounce.js +9 -0
  49. package/toolbar-tools/smartbox/hooks/useDebounce.mjs +21 -0
  50. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.d.ts +245 -0
  51. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.js +9 -0
  52. package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.mjs +54 -0
  53. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.d.ts +80 -0
  54. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.js +9 -0
  55. package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.mjs +66 -0
  56. package/toolbar-tools/smartbox/hooks/useSmartBoxInput.d.ts +96 -0
  57. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.d.ts +93 -0
  58. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.js +9 -0
  59. package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.mjs +61 -0
  60. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.d.ts +163 -0
  61. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.js +9 -0
  62. package/toolbar-tools/smartbox/hooks/useSmartBoxListData.mjs +102 -0
  63. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.d.ts +115 -0
  64. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.js +9 -0
  65. package/toolbar-tools/smartbox/hooks/useSmartBoxModes.mjs +65 -0
  66. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.d.ts +56 -0
  67. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.js +9 -0
  68. package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.mjs +25 -0
  69. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.d.ts +82 -0
  70. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.js +9 -0
  71. package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.mjs +67 -0
  72. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.d.ts +70 -0
  73. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.js +9 -0
  74. package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.mjs +57 -0
  75. package/toolbar-tools/smartbox/index.d.ts +10 -0
  76. package/toolbar-tools/smartbox/interfaces/SearchTypes.d.ts +45 -0
  77. package/toolbar-tools/smartbox/interfaces/SegmentedControlTypes.d.ts +66 -0
  78. package/toolbar-tools/smartbox/interfaces/SmartBoxTypes.d.ts +461 -0
  79. package/toolbar-tools/smartbox/interfaces/index.d.ts +11 -0
  80. package/toolbar-tools/smartbox/interfaces/utilTypes.d.ts +25 -0
  81. package/toolbar-tools/smartbox/listItemRenders.d.ts +165 -0
  82. package/toolbar-tools/smartbox/listItemRenders.js +8 -0
  83. package/toolbar-tools/smartbox/listItemRenders.mjs +68 -0
  84. package/toolbar-tools/smartbox/utils.d.ts +14 -0
  85. package/toolbar-tools/smartbox/utils.js +8 -0
  86. package/toolbar-tools/smartbox/utils.mjs +14 -0
  87. package/utils/dataProcessing.d.ts +67 -0
  88. package/utils/dataProcessing.js +8 -0
  89. package/utils/dataProcessing.mjs +49 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { GridSmartBoxAIAssistantProps } from './interfaces/index.js';
9
+ import * as React from 'react';
10
+ export interface SmartBoxPopupHandle {
11
+ /**
12
+ * Shows the SmartBox popup.
13
+ */
14
+ show: () => void;
15
+ /**
16
+ * Hides the SmartBox popup.
17
+ */
18
+ hide: () => void;
19
+ }
20
+ export declare const SmartBox: React.ForwardRefExoticComponent<GridSmartBoxAIAssistantProps & React.RefAttributes<SmartBoxPopupHandle>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ze=require("react"),et=require("./SegmentedControl.js"),de=require("@progress/kendo-react-buttons"),K=require("@progress/kendo-svg-icons"),d=require("@progress/kendo-react-common"),tt=require("@progress/kendo-react-intl"),nt=require("../../hooks/useGridAIRequest.js"),st=require("../../utils/GridContext.js"),_=require("@progress/kendo-react-dropdowns"),rt=require("@progress/kendo-react-popup"),I=require("./listItemRenders.js"),o=require("../../messages/index.js"),at=require("./hooks/useSmartBoxModes.js"),ot=require("./hooks/useSmartBoxHistory.js"),ct=require("./hooks/useSmartBoxPopup.js"),it=require("./hooks/useSmartBoxGridState.js"),lt=require("./hooks/useSmartBoxLabels.js"),ut=require("./hooks/useSmartBoxListData.js"),pt=require("./hooks/useSmartBoxSegmentedControl.js"),dt=require("./hooks/useSmartBoxSearch.js"),mt=require("./hooks/useDebounce.js");function gt(m){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const S in m)if(S!=="default"){const q=Object.getOwnPropertyDescriptor(m,S);Object.defineProperty(x,S,q.get?q:{enumerable:!0,get:()=>m[S]})}}return x.default=m,Object.freeze(x)}const e=gt(Ze),me=e.forwardRef((m,x)=>{var ue;const{searchConfig:S,semanticSearchConfig:q,aiAssistantConfig:ge,activeMode:he,dir:fe="ltr",size:M="medium",placeholder:Se,history:ke,loading:xe=!1,promptSuggestionRender:A,historyItemRender:J,onOpen:be,onClose:Ce,onFocus:v,onBlur:P,onSearch:Be,onSemanticSearch:Re,onAIPromptRequest:N,onAIResponseSuccess:F,onAIResponseError:O,onAICancelRequest:D}=m,b=tt.useLocalization(),C=e.useContext(st.GridContext),Ie=e.useRef(`k-${d.guid()}`),g=e.useRef(null),B=e.useRef(null),Q=e.useRef(null),[c,h]=e.useState(""),[qe,w]=e.useState(!1),[ve,Pe]=e.useState(void 0),[De,X]=e.useState(null),{searchMode:i,semanticSearchMode:u,aiAssistantMode:r,selectedView:n,setSelectedViewState:z,lastSearchMode:we,searchHistorySettings:Y,semanticSearchHistorySettings:Z,aiAssistantHistorySettings:G,speechToTextButtonSettings:ee,currentSearchDelay:ye}=at.useSmartBoxModes({searchConfigProp:S,semanticSearchConfigProp:q,aiAssistantConfigProp:ge,activeModeProp:he,sharedHistory:ke}),{currentHistory:y,currentHistorySettings:Ee,addToHistory:V}=ot.useSmartBoxHistory({selectedView:n,searchHistorySettings:Y,semanticSearchHistorySettings:Z,aiAssistantHistorySettings:G}),{isOpen:R,togglePopup:a}=ct.useSmartBoxPopup({onOpen:be,onClose:Ce}),{columns:te,gridState:Le,gridRef:Te,handleStateChange:He}=it.useSmartBoxGridState(C),W=e.useMemo(()=>(r==null?void 0:r.promptSuggestions)||[],[r==null?void 0:r.promptSuggestions]),{inputPlaceholder:Ne,prefixIcon:Fe}=lt.useSmartBoxLabels({selectedView:n,searchMode:i,semanticSearchMode:u,aiAssistantMode:r,sharedPlaceholder:Se}),{searchListData:k,aiAssistantListData:E,searchHistoryListData:L}=ut.useSmartBoxListData({selectedView:n,searchModeEnabled:i==null?void 0:i.enabled,semanticSearchModeEnabled:u==null?void 0:u.enabled,promptSuggestions:W,currentHistory:y,currentHistorySettings:Ee}),ne=pt.useSmartBoxSegmentedControl({searchMode:i,semanticSearchMode:u,aiAssistantMode:r,selectedView:n,lastSearchMode:we,setSelectedViewState:z,setInputValue:h});e.useEffect(()=>{R&&g.current&&Pe(g.current.offsetWidth)},[R]);const f=xe||qe,j=!n,Oe=!(i!=null&&i.enabled)&&!(u!=null&&u.enabled)&&!(r!=null&&r.enabled),ze=d.kendoThemeMaps.sizeMap[M]||"md",{emitSearchEvent:p}=dt.useSmartBoxSearch({selectedView:n,searchMode:i,columns:te,gridContext:C,searchHistorySettings:Y,semanticSearchHistorySettings:Z,addToHistory:V,onSearch:Be,onSemanticSearch:Re}),{sendRequest:se,cancelRequest:re}=nt.useGridAIRequest({requestUrl:r==null?void 0:r.requestUrl,requestOptions:r==null?void 0:r.requestOptions,columns:te,gridState:Le,gridRef:Te,onPromptRequest:t=>{N==null||N({requestData:t})},onResponseSuccess:t=>{w(!1),F==null||F({response:t})},onResponseError:t=>{w(!1),O==null||O({error:t})},onStateChange:He,onExportPdf:()=>C==null?void 0:C.exportAsPdf()});e.useImperativeHandle(x,()=>({show:()=>a(!0),hide:()=>a(!1)}),[a]);const U=mt.useDebounce(De,ye),ae=e.useRef(p);ae.current=p,e.useEffect(()=>{U!==null&&ae.current(U)},[U]);const Ge=e.useCallback(t=>{const s=t.target.value;h(s),a(!s),(n==="search"||n==="semanticSearch")&&X(s)},[a,n]),Ve=e.useCallback(()=>{v==null||v(),c||a(!0)},[v,a,c]),We=e.useCallback(t=>{var pe;const s=g.current,l=(pe=Q.current)==null?void 0:pe.element,H=t.relatedTarget,Xe=H&&(s==null?void 0:s.contains(H)),Ye=H&&(l==null?void 0:l.contains(H));!Xe&&!Ye&&(P==null||P(),a(!1))},[P,a]),je=e.useCallback(()=>{c||a(!0)},[a,c]),oe=!!((ue=r==null?void 0:r.requestOptions)!=null&&ue.url||r!=null&&r.requestUrl),$=e.useCallback(()=>{if(f){D==null||D(),re(),w(!1);return}c.trim()&&(oe&&w(!0),V("aiAssistant",c,G),a(!1),se(c.trim()),h(""))},[f,c,G,a,V,se,re,oe,D]),Ue=e.useCallback(t=>{t.key==="Enter"&&(n==="aiAssistant"?$():n==="semanticSearch"&&p(c))},[n,c,p,$]),$e=e.useCallback(()=>{var t;a(!R),(t=B.current)==null||t.focus()},[R,a]),Ke=e.useCallback(t=>{var s;t.stopPropagation(),t.preventDefault(),h(""),(s=B.current)==null||s.focus(),a(!0),p("")},[a,p]),ce=e.useCallback(t=>{var s;z(t),h(""),X(null),(s=B.current)==null||s.focus()},[z]),T=e.useCallback(t=>{var s;h(t),a(!1),(s=B.current)==null||s.focus(),n!=="aiAssistant"&&p(t)},[n,a,p]),_e=e.useCallback(t=>{if(t.isFinal&&t.alternatives.length>0){const s=t.alternatives[0].transcript;h(l=>l?`${l} ${s}`:s)}},[]),Me=e.useMemo(()=>n==="aiAssistant"?y.length===0&&W.length===0:n==="search"||n==="semanticSearch"?y.length===0&&k.length===0:!1,[n,y.length,W.length,k.length]),ie=e.useCallback(t=>{const l=(n==="aiAssistant"?E:L)[t];l&&T(l.text)},[n,E,L,T]),Ae=e.useCallback(t=>{const s=k[t];s&&ce(s.mode)},[k,ce]),le=e.useMemo(()=>I.createListItemRender({historyItemRender:J,promptSuggestionRender:A,handleListItemClick:T}),[J,A,T]),Je=R&&!Oe,Qe=()=>e.createElement(e.Fragment,null,ne.length>0&&e.createElement(et.SegmentedControl,{buttons:ne,size:M,stretched:!0}),(n==="search"||n==="semanticSearch")&&k.length>0&&e.createElement(_.List,{data:k,textField:"text",descriptionField:"description",onClick:Ae,itemRender:I.searchModeItemRender,show:!0,wrapperCssClass:"k-list k-list-md"}),n==="aiAssistant"&&E.length>0&&e.createElement(_.List,{data:E,textField:"text",groupField:"group",svgIconField:"groupSvgIcon",descriptionField:"description",onClick:ie,itemRender:le,groupHeaderItemRender:I.listGroupHeaderRender,showFirstGroupHeader:!0,show:!0,wrapperCssClass:"k-list k-list-md"}),(n==="search"||n==="semanticSearch")&&L.length>0&&e.createElement(_.List,{data:L,textField:"text",groupField:"group",svgIconField:"groupSvgIcon",descriptionField:"description",onClick:ie,itemRender:le,groupHeaderItemRender:I.listGroupHeaderRender,showFirstGroupHeader:!0,show:!0,wrapperCssClass:"k-list k-list-md"}),Me&&e.createElement(I.NoDataRender,{selectedView:n}));return e.createElement("div",{ref:g,className:"k-smart-box-wrapper",dir:fe,onBlur:We},e.createElement("span",{className:d.classNames("k-smart-box","k-input",`k-input-${ze}`,{"k-loading":f})},!j&&e.createElement("span",{className:"k-input-prefix k-input-prefix-horizontal"},e.createElement(d.IconWrap,{className:d.classNames("k-icon",{"k-accent-icon":n==="aiAssistant"||n==="semanticSearch"}),icon:Fe.svgIcon,onClick:$e,onMouseDown:t=>{"preventDefault"in t&&t.preventDefault()}})),e.createElement("input",{ref:B,type:"text",className:d.classNames("k-input-inner",{"k-disabled":j}),id:Ie.current,placeholder:Ne,value:c,disabled:j,onChange:Ge,onFocus:Ve,onClick:je,onKeyDown:Ue}),c.length>0&&(n==="search"||n==="semanticSearch")&&e.createElement("span",{className:"k-clear-value",title:b.toLanguageString(o.smartBoxClearTitle,o.messages[o.smartBoxClearTitle]),role:"button",tabIndex:-1,onClick:Ke,onMouseDown:t=>t.preventDefault()},e.createElement(d.IconWrap,{className:"k-icon",icon:K.xIcon})),n==="aiAssistant"&&e.createElement("span",{className:"k-input-suffix k-input-suffix-horizontal"},ee&&e.createElement(de.SpeechToTextButton,{...ee,"aria-label":b.toLanguageString(o.smartBoxSpeechToTextButton,o.messages[o.smartBoxSpeechToTextButton]),title:b.toLanguageString(o.smartBoxSpeechToTextButton,o.messages[o.smartBoxSpeechToTextButton]),onResult:_e}),e.createElement(de.Button,{className:d.classNames("k-smart-box-send",{"k-processing":f,"k-active":f}),type:"button",rounded:"full",size:"small",title:b.toLanguageString(o.smartBoxSubmitPromptButton,o.messages[o.smartBoxSubmitPromptButton]),"aria-label":b.toLanguageString(o.smartBoxSubmitPromptButton,o.messages[o.smartBoxSubmitPromptButton]),"aria-disabled":c.length===0,svgIcon:f?K.stopSmIcon:K.arrowUpOutlineIcon,disabled:c.length===0&&!f,onClick:$}))),e.createElement(rt.Popup,{ref:Q,anchor:g.current,show:Je,popupClass:"k-smart-box-popup",style:{width:ve},anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},margin:{horizontal:0,vertical:2},onMouseDownOutside:t=>{const s=t.event.target;g.current&&!g.current.contains(s)&&a(!1)}},Qe()))});me.displayName="KendoReactSmartBox";exports.SmartBox=me;
@@ -0,0 +1,380 @@
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 e from "react";
9
+ import { SegmentedControl as et } from "./SegmentedControl.mjs";
10
+ import { SpeechToTextButton as tt, Button as nt } from "@progress/kendo-react-buttons";
11
+ import { xIcon as rt, stopSmIcon as at, arrowUpOutlineIcon as st } from "@progress/kendo-svg-icons";
12
+ import { guid as ot, kendoThemeMaps as it, classNames as y, IconWrap as le } from "@progress/kendo-react-common";
13
+ import { useLocalization as lt } from "@progress/kendo-react-intl";
14
+ import { useGridAIRequest as ct } from "../../hooks/useGridAIRequest.mjs";
15
+ import { GridContext as ut } from "../../utils/GridContext.mjs";
16
+ import { List as U } from "@progress/kendo-react-dropdowns";
17
+ import { Popup as pt } from "@progress/kendo-react-popup";
18
+ import { createListItemRender as mt, searchModeItemRender as dt, listGroupHeaderRender as ce, NoDataRender as ft } from "./listItemRenders.mjs";
19
+ import { smartBoxClearTitle as ue, messages as C, smartBoxSpeechToTextButton as P, smartBoxSubmitPromptButton as L } from "../../messages/index.mjs";
20
+ import { useSmartBoxModes as ht } from "./hooks/useSmartBoxModes.mjs";
21
+ import { useSmartBoxHistory as gt } from "./hooks/useSmartBoxHistory.mjs";
22
+ import { useSmartBoxPopup as St } from "./hooks/useSmartBoxPopup.mjs";
23
+ import { useSmartBoxGridState as kt } from "./hooks/useSmartBoxGridState.mjs";
24
+ import { useSmartBoxLabels as Ct } from "./hooks/useSmartBoxLabels.mjs";
25
+ import { useSmartBoxListData as bt } from "./hooks/useSmartBoxListData.mjs";
26
+ import { useSmartBoxSegmentedControl as xt } from "./hooks/useSmartBoxSegmentedControl.mjs";
27
+ import { useSmartBoxSearch as Rt } from "./hooks/useSmartBoxSearch.mjs";
28
+ import { useDebounce as It } from "./hooks/useDebounce.mjs";
29
+ const vt = e.forwardRef((pe, me) => {
30
+ var oe;
31
+ const {
32
+ searchConfig: de,
33
+ semanticSearchConfig: fe,
34
+ aiAssistantConfig: he,
35
+ activeMode: ge,
36
+ dir: Se = "ltr",
37
+ size: $ = "medium",
38
+ placeholder: ke,
39
+ history: Ce,
40
+ loading: be = !1,
41
+ promptSuggestionRender: K,
42
+ historyItemRender: j,
43
+ onOpen: xe,
44
+ onClose: Re,
45
+ onFocus: b,
46
+ onBlur: x,
47
+ onSearch: Ie,
48
+ onSemanticSearch: ve,
49
+ onAIPromptRequest: F,
50
+ onAIResponseSuccess: H,
51
+ onAIResponseError: N,
52
+ onAICancelRequest: R
53
+ } = pe, h = lt(), g = e.useContext(ut), Ee = e.useRef(`k-${ot()}`), p = e.useRef(null), S = e.useRef(null), J = e.useRef(null), [o, m] = e.useState(""), [we, I] = e.useState(!1), [De, Be] = e.useState(void 0), [ye, Q] = e.useState(null), {
54
+ searchMode: i,
55
+ semanticSearchMode: c,
56
+ aiAssistantMode: a,
57
+ selectedView: n,
58
+ setSelectedViewState: z,
59
+ lastSearchMode: Pe,
60
+ searchHistorySettings: X,
61
+ semanticSearchHistorySettings: Y,
62
+ aiAssistantHistorySettings: T,
63
+ speechToTextButtonSettings: Z,
64
+ currentSearchDelay: Le
65
+ } = ht({
66
+ searchConfigProp: de,
67
+ semanticSearchConfigProp: fe,
68
+ aiAssistantConfigProp: he,
69
+ activeModeProp: ge,
70
+ sharedHistory: Ce
71
+ }), { currentHistory: v, currentHistorySettings: Fe, addToHistory: q } = gt({
72
+ selectedView: n,
73
+ searchHistorySettings: X,
74
+ semanticSearchHistorySettings: Y,
75
+ aiAssistantHistorySettings: T
76
+ }), { isOpen: k, togglePopup: s } = St({ onOpen: xe, onClose: Re }), { columns: _, gridState: He, gridRef: Ne, handleStateChange: ze } = kt(g), V = e.useMemo(
77
+ () => (a == null ? void 0 : a.promptSuggestions) || [],
78
+ [a == null ? void 0 : a.promptSuggestions]
79
+ ), { inputPlaceholder: Te, prefixIcon: qe } = Ct({
80
+ selectedView: n,
81
+ searchMode: i,
82
+ semanticSearchMode: c,
83
+ aiAssistantMode: a,
84
+ sharedPlaceholder: ke
85
+ }), { searchListData: f, aiAssistantListData: E, searchHistoryListData: w } = bt({
86
+ selectedView: n,
87
+ searchModeEnabled: i == null ? void 0 : i.enabled,
88
+ semanticSearchModeEnabled: c == null ? void 0 : c.enabled,
89
+ promptSuggestions: V,
90
+ currentHistory: v,
91
+ currentHistorySettings: Fe
92
+ }), A = xt({
93
+ searchMode: i,
94
+ semanticSearchMode: c,
95
+ aiAssistantMode: a,
96
+ selectedView: n,
97
+ lastSearchMode: Pe,
98
+ setSelectedViewState: z,
99
+ setInputValue: m
100
+ });
101
+ e.useEffect(() => {
102
+ k && p.current && Be(p.current.offsetWidth);
103
+ }, [k]);
104
+ const d = be || we, O = !n, Ve = !(i != null && i.enabled) && !(c != null && c.enabled) && !(a != null && a.enabled), Oe = it.sizeMap[$] || "md", { emitSearchEvent: u } = Rt({
105
+ selectedView: n,
106
+ searchMode: i,
107
+ columns: _,
108
+ gridContext: g,
109
+ searchHistorySettings: X,
110
+ semanticSearchHistorySettings: Y,
111
+ addToHistory: q,
112
+ onSearch: Ie,
113
+ onSemanticSearch: ve
114
+ }), { sendRequest: M, cancelRequest: ee } = ct({
115
+ requestUrl: a == null ? void 0 : a.requestUrl,
116
+ requestOptions: a == null ? void 0 : a.requestOptions,
117
+ columns: _,
118
+ gridState: He,
119
+ gridRef: Ne,
120
+ onPromptRequest: (t) => {
121
+ F == null || F({ requestData: t });
122
+ },
123
+ onResponseSuccess: (t) => {
124
+ I(!1), H == null || H({ response: t });
125
+ },
126
+ onResponseError: (t) => {
127
+ I(!1), N == null || N({ error: t });
128
+ },
129
+ onStateChange: ze,
130
+ onExportPdf: () => g == null ? void 0 : g.exportAsPdf()
131
+ });
132
+ e.useImperativeHandle(
133
+ me,
134
+ () => ({
135
+ show: () => s(!0),
136
+ hide: () => s(!1)
137
+ }),
138
+ [s]
139
+ );
140
+ const G = It(ye, Le), te = e.useRef(u);
141
+ te.current = u, e.useEffect(() => {
142
+ G !== null && te.current(G);
143
+ }, [G]);
144
+ const Ge = e.useCallback(
145
+ (t) => {
146
+ const r = t.target.value;
147
+ m(r), s(!r), (n === "search" || n === "semanticSearch") && Q(r);
148
+ },
149
+ [s, n]
150
+ ), We = e.useCallback(() => {
151
+ b == null || b(), o || s(!0);
152
+ }, [b, s, o]), Ue = e.useCallback(
153
+ (t) => {
154
+ var ie;
155
+ const r = p.current, l = (ie = J.current) == null ? void 0 : ie.element, B = t.relatedTarget, Ae = B && (r == null ? void 0 : r.contains(B)), Me = B && (l == null ? void 0 : l.contains(B));
156
+ !Ae && !Me && (x == null || x(), s(!1));
157
+ },
158
+ [x, s]
159
+ ), $e = e.useCallback(() => {
160
+ o || s(!0);
161
+ }, [s, o]), ne = !!((oe = a == null ? void 0 : a.requestOptions) != null && oe.url || a != null && a.requestUrl), W = e.useCallback(() => {
162
+ if (d) {
163
+ R == null || R(), ee(), I(!1);
164
+ return;
165
+ }
166
+ o.trim() && (ne && I(!0), q("aiAssistant", o, T), s(!1), M(o.trim()), m(""));
167
+ }, [
168
+ d,
169
+ o,
170
+ T,
171
+ s,
172
+ q,
173
+ M,
174
+ ee,
175
+ ne,
176
+ R
177
+ ]), Ke = e.useCallback(
178
+ (t) => {
179
+ t.key === "Enter" && (n === "aiAssistant" ? W() : n === "semanticSearch" && u(o));
180
+ },
181
+ [n, o, u, W]
182
+ ), je = e.useCallback(() => {
183
+ var t;
184
+ s(!k), (t = S.current) == null || t.focus();
185
+ }, [k, s]), Je = e.useCallback(
186
+ (t) => {
187
+ var r;
188
+ t.stopPropagation(), t.preventDefault(), m(""), (r = S.current) == null || r.focus(), s(!0), u("");
189
+ },
190
+ [s, u]
191
+ ), re = e.useCallback(
192
+ (t) => {
193
+ var r;
194
+ z(t), m(""), Q(null), (r = S.current) == null || r.focus();
195
+ },
196
+ [z]
197
+ ), D = e.useCallback(
198
+ (t) => {
199
+ var r;
200
+ m(t), s(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && u(t);
201
+ },
202
+ [n, s, u]
203
+ ), Qe = e.useCallback((t) => {
204
+ if (t.isFinal && t.alternatives.length > 0) {
205
+ const r = t.alternatives[0].transcript;
206
+ m((l) => l ? `${l} ${r}` : r);
207
+ }
208
+ }, []), Xe = e.useMemo(() => n === "aiAssistant" ? v.length === 0 && V.length === 0 : n === "search" || n === "semanticSearch" ? v.length === 0 && f.length === 0 : !1, [n, v.length, V.length, f.length]), ae = e.useCallback(
209
+ (t) => {
210
+ const l = (n === "aiAssistant" ? E : w)[t];
211
+ l && D(l.text);
212
+ },
213
+ [n, E, w, D]
214
+ ), Ye = e.useCallback(
215
+ (t) => {
216
+ const r = f[t];
217
+ r && re(r.mode);
218
+ },
219
+ [f, re]
220
+ ), se = e.useMemo(
221
+ () => mt({
222
+ historyItemRender: j,
223
+ promptSuggestionRender: K,
224
+ handleListItemClick: D
225
+ }),
226
+ [j, K, D]
227
+ ), Ze = k && !Ve, _e = () => /* @__PURE__ */ e.createElement(e.Fragment, null, A.length > 0 && /* @__PURE__ */ e.createElement(et, { buttons: A, size: $, stretched: !0 }), (n === "search" || n === "semanticSearch") && f.length > 0 && /* @__PURE__ */ e.createElement(
228
+ U,
229
+ {
230
+ data: f,
231
+ textField: "text",
232
+ descriptionField: "description",
233
+ onClick: Ye,
234
+ itemRender: dt,
235
+ show: !0,
236
+ wrapperCssClass: "k-list k-list-md"
237
+ }
238
+ ), n === "aiAssistant" && E.length > 0 && /* @__PURE__ */ e.createElement(
239
+ U,
240
+ {
241
+ data: E,
242
+ textField: "text",
243
+ groupField: "group",
244
+ svgIconField: "groupSvgIcon",
245
+ descriptionField: "description",
246
+ onClick: ae,
247
+ itemRender: se,
248
+ groupHeaderItemRender: ce,
249
+ showFirstGroupHeader: !0,
250
+ show: !0,
251
+ wrapperCssClass: "k-list k-list-md"
252
+ }
253
+ ), (n === "search" || n === "semanticSearch") && w.length > 0 && /* @__PURE__ */ e.createElement(
254
+ U,
255
+ {
256
+ data: w,
257
+ textField: "text",
258
+ groupField: "group",
259
+ svgIconField: "groupSvgIcon",
260
+ descriptionField: "description",
261
+ onClick: ae,
262
+ itemRender: se,
263
+ groupHeaderItemRender: ce,
264
+ showFirstGroupHeader: !0,
265
+ show: !0,
266
+ wrapperCssClass: "k-list k-list-md"
267
+ }
268
+ ), Xe && /* @__PURE__ */ e.createElement(ft, { selectedView: n }));
269
+ return /* @__PURE__ */ e.createElement("div", { ref: p, className: "k-smart-box-wrapper", dir: Se, onBlur: Ue }, /* @__PURE__ */ e.createElement(
270
+ "span",
271
+ {
272
+ className: y("k-smart-box", "k-input", `k-input-${Oe}`, {
273
+ "k-loading": d
274
+ })
275
+ },
276
+ !O && /* @__PURE__ */ e.createElement("span", { className: "k-input-prefix k-input-prefix-horizontal" }, /* @__PURE__ */ e.createElement(
277
+ le,
278
+ {
279
+ className: y("k-icon", {
280
+ "k-accent-icon": n === "aiAssistant" || n === "semanticSearch"
281
+ }),
282
+ icon: qe.svgIcon,
283
+ onClick: je,
284
+ onMouseDown: (t) => {
285
+ "preventDefault" in t && t.preventDefault();
286
+ }
287
+ }
288
+ )),
289
+ /* @__PURE__ */ e.createElement(
290
+ "input",
291
+ {
292
+ ref: S,
293
+ type: "text",
294
+ className: y("k-input-inner", { "k-disabled": O }),
295
+ id: Ee.current,
296
+ placeholder: Te,
297
+ value: o,
298
+ disabled: O,
299
+ onChange: Ge,
300
+ onFocus: We,
301
+ onClick: $e,
302
+ onKeyDown: Ke
303
+ }
304
+ ),
305
+ o.length > 0 && (n === "search" || n === "semanticSearch") && /* @__PURE__ */ e.createElement(
306
+ "span",
307
+ {
308
+ className: "k-clear-value",
309
+ title: h.toLanguageString(
310
+ ue,
311
+ C[ue]
312
+ ),
313
+ role: "button",
314
+ tabIndex: -1,
315
+ onClick: Je,
316
+ onMouseDown: (t) => t.preventDefault()
317
+ },
318
+ /* @__PURE__ */ e.createElement(le, { className: "k-icon", icon: rt })
319
+ ),
320
+ n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, Z && /* @__PURE__ */ e.createElement(
321
+ tt,
322
+ {
323
+ ...Z,
324
+ "aria-label": h.toLanguageString(
325
+ P,
326
+ C[P]
327
+ ),
328
+ title: h.toLanguageString(
329
+ P,
330
+ C[P]
331
+ ),
332
+ onResult: Qe
333
+ }
334
+ ), /* @__PURE__ */ e.createElement(
335
+ nt,
336
+ {
337
+ className: y("k-smart-box-send", {
338
+ "k-processing": d,
339
+ "k-active": d
340
+ }),
341
+ type: "button",
342
+ rounded: "full",
343
+ size: "small",
344
+ title: h.toLanguageString(
345
+ L,
346
+ C[L]
347
+ ),
348
+ "aria-label": h.toLanguageString(
349
+ L,
350
+ C[L]
351
+ ),
352
+ "aria-disabled": o.length === 0,
353
+ svgIcon: d ? at : st,
354
+ disabled: o.length === 0 && !d,
355
+ onClick: W
356
+ }
357
+ ))
358
+ ), /* @__PURE__ */ e.createElement(
359
+ pt,
360
+ {
361
+ ref: J,
362
+ anchor: p.current,
363
+ show: Ze,
364
+ popupClass: "k-smart-box-popup",
365
+ style: { width: De },
366
+ anchorAlign: { horizontal: "left", vertical: "bottom" },
367
+ popupAlign: { horizontal: "left", vertical: "top" },
368
+ margin: { horizontal: 0, vertical: 2 },
369
+ onMouseDownOutside: (t) => {
370
+ const r = t.event.target;
371
+ p.current && !p.current.contains(r) && s(!1);
372
+ }
373
+ },
374
+ _e()
375
+ ));
376
+ });
377
+ vt.displayName = "KendoReactSmartBox";
378
+ export {
379
+ vt as SmartBox
380
+ };
@@ -0,0 +1,30 @@
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 } from './interfaces/index.js';
10
+ import { GridSmartBoxHistoryProps } from './interfaces/utilTypes.js';
11
+ /**
12
+ * @hidden
13
+ */
14
+ export declare const defaultHistoryProps: GridSmartBoxHistoryProps;
15
+ /**
16
+ * @hidden
17
+ */
18
+ export declare const defaultSearchProps: GridSmartBoxSearchProps;
19
+ /**
20
+ * @hidden
21
+ */
22
+ export declare const defaultSemanticSearchProps: GridSmartBoxSemanticSearchConfigProps;
23
+ /**
24
+ * @hidden
25
+ */
26
+ export declare const defaultAiAssistantProps: GridSmartBoxAIAssistantConfigProps;
27
+ /**
28
+ * @hidden
29
+ */
30
+ export declare const DEFAULT_STB_SETTINGS: SpeechToTextButtonProps;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={size:5,timestampFormat:"HH:mm"},s={enabled:!1,fields:[],delay:300,history:e},t={enabled:!1,delay:300,history:e},a={enabled:!1,promptSuggestions:[],speechToTextButton:!1,history:e},o={fillMode:"clear",size:"small",rounded:"full"};exports.DEFAULT_STB_SETTINGS=o;exports.defaultAiAssistantProps=a;exports.defaultHistoryProps=e;exports.defaultSearchProps=s;exports.defaultSemanticSearchProps=t;
@@ -0,0 +1,36 @@
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
+ const e = {
9
+ size: 5,
10
+ timestampFormat: "HH:mm"
11
+ }, s = {
12
+ enabled: !1,
13
+ fields: [],
14
+ delay: 300,
15
+ history: e
16
+ }, t = {
17
+ enabled: !1,
18
+ delay: 300,
19
+ history: e
20
+ }, a = {
21
+ enabled: !1,
22
+ promptSuggestions: [],
23
+ speechToTextButton: !1,
24
+ history: e
25
+ }, l = {
26
+ fillMode: "clear",
27
+ size: "small",
28
+ rounded: "full"
29
+ };
30
+ export {
31
+ l as DEFAULT_STB_SETTINGS,
32
+ a as defaultAiAssistantProps,
33
+ e as defaultHistoryProps,
34
+ s as defaultSearchProps,
35
+ t as defaultSemanticSearchProps
36
+ };
@@ -0,0 +1,17 @@
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
+ export * from './useDebounce.js';
9
+ export * from './useSmartBoxModes.js';
10
+ export * from './useSmartBoxHistory.js';
11
+ export * from './useSmartBoxSearch.js';
12
+ export * from './useSmartBoxPopup.js';
13
+ export * from './useSmartBoxGridState.js';
14
+ export * from './useSmartBoxListData.js';
15
+ export * from './useSmartBoxInput.js';
16
+ export * from './useSmartBoxLabels.js';
17
+ export * from './useSmartBoxSegmentedControl.js';
@@ -0,0 +1,11 @@
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
+ /**
9
+ * @hidden
10
+ */
11
+ export declare const useDebounce: <T>(value: T, delay?: number) => T;
@@ -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 u=require("react"),s=(e,t=500)=>{const[o,c]=u.useState(e);return u.useEffect(()=>{const n=setTimeout(()=>{c(e)},t);return()=>clearTimeout(n)},[e,t]),o};exports.useDebounce=s;
@@ -0,0 +1,21 @@
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 { useState as n, useEffect as r } from "react";
10
+ const m = (e, t = 500) => {
11
+ const [o, u] = n(e);
12
+ return r(() => {
13
+ const c = setTimeout(() => {
14
+ u(e);
15
+ }, t);
16
+ return () => clearTimeout(c);
17
+ }, [e, t]), o;
18
+ };
19
+ export {
20
+ m as useDebounce
21
+ };