@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.
- package/BaseCSVExport.d.ts +31 -0
- package/BaseCSVExport.js +8 -0
- package/BaseCSVExport.mjs +82 -0
- package/Grid.d.ts +33 -0
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +313 -289
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +247 -252
- package/GridCsvExportButton.d.ts +13 -0
- package/GridCsvExportButton.js +8 -0
- package/GridCsvExportButton.mjs +35 -0
- package/columnMenu/GridColumnMenuFilter.mjs +2 -2
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.mjs +4 -4
- package/components/noRecords/GridNoRecordsContainer.mjs +1 -1
- package/constants/index.mjs +2 -2
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/hooks/index.d.ts +8 -0
- package/hooks/useGridAIRequest.d.ts +150 -0
- package/hooks/useGridAIRequest.js +8 -0
- package/hooks/useGridAIRequest.mjs +93 -0
- package/index.d.mts +5 -2
- package/index.d.ts +5 -2
- package/index.js +1 -1
- package/index.mjs +71 -63
- package/interfaces/GridProps.d.ts +81 -0
- package/messages/index.d.ts +80 -0
- package/messages/index.js +2 -2
- package/messages/index.mjs +126 -94
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +19 -19
- package/toolbar-tools/GridToolbarAIAssistant.d.ts +2 -34
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +167 -164
- package/toolbar-tools/GridToolbarFilter.mjs +5 -5
- package/toolbar-tools/smartbox/SegmentedControl.d.ts +13 -0
- package/toolbar-tools/smartbox/SegmentedControl.js +8 -0
- package/toolbar-tools/smartbox/SegmentedControl.mjs +109 -0
- package/toolbar-tools/smartbox/SmartBox.d.ts +20 -0
- package/toolbar-tools/smartbox/SmartBox.js +8 -0
- package/toolbar-tools/smartbox/SmartBox.mjs +380 -0
- package/toolbar-tools/smartbox/defaultConfigs.d.ts +30 -0
- package/toolbar-tools/smartbox/defaultConfigs.js +8 -0
- package/toolbar-tools/smartbox/defaultConfigs.mjs +36 -0
- package/toolbar-tools/smartbox/hooks/index.d.ts +17 -0
- package/toolbar-tools/smartbox/hooks/useDebounce.d.ts +11 -0
- package/toolbar-tools/smartbox/hooks/useDebounce.js +9 -0
- package/toolbar-tools/smartbox/hooks/useDebounce.mjs +21 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.d.ts +245 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxGridState.mjs +54 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.d.ts +80 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxHistory.mjs +66 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxInput.d.ts +96 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.d.ts +93 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxLabels.mjs +61 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxListData.d.ts +163 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxListData.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxListData.mjs +102 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxModes.d.ts +115 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxModes.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxModes.mjs +65 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.d.ts +56 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxPopup.mjs +25 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.d.ts +82 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSearch.mjs +67 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.d.ts +70 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.js +9 -0
- package/toolbar-tools/smartbox/hooks/useSmartBoxSegmentedControl.mjs +57 -0
- package/toolbar-tools/smartbox/index.d.ts +10 -0
- package/toolbar-tools/smartbox/interfaces/SearchTypes.d.ts +45 -0
- package/toolbar-tools/smartbox/interfaces/SegmentedControlTypes.d.ts +66 -0
- package/toolbar-tools/smartbox/interfaces/SmartBoxTypes.d.ts +461 -0
- package/toolbar-tools/smartbox/interfaces/index.d.ts +11 -0
- package/toolbar-tools/smartbox/interfaces/utilTypes.d.ts +25 -0
- package/toolbar-tools/smartbox/listItemRenders.d.ts +165 -0
- package/toolbar-tools/smartbox/listItemRenders.js +8 -0
- package/toolbar-tools/smartbox/listItemRenders.mjs +68 -0
- package/toolbar-tools/smartbox/utils.d.ts +14 -0
- package/toolbar-tools/smartbox/utils.js +8 -0
- package/toolbar-tools/smartbox/utils.mjs +14 -0
- package/utils/dataProcessing.d.ts +67 -0
- package/utils/dataProcessing.js +8 -0
- package/utils/dataProcessing.mjs +49 -0
|
@@ -11,6 +11,7 @@ import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
|
11
11
|
import { CustomComponent } from '@progress/kendo-react-common';
|
|
12
12
|
import { AIPromptOutputInterface } from '@progress/kendo-react-conversational-ui';
|
|
13
13
|
import { GridAIPromptProps } from './ai-tool/GridAIPrompt.js';
|
|
14
|
+
import { GridAIRequestData } from '../hooks/useGridAIRequest.js';
|
|
14
15
|
import * as React from 'react';
|
|
15
16
|
/**
|
|
16
17
|
* Represents the handle interface for the GridToolbarAIAssistant component.
|
|
@@ -28,37 +29,7 @@ export interface GridToolbarAIAssistantHandle {
|
|
|
28
29
|
/**
|
|
29
30
|
* Represents the request data structure for the GridToolbarAIAssistant component.
|
|
30
31
|
*/
|
|
31
|
-
export
|
|
32
|
-
/**
|
|
33
|
-
* The role or context for the AI request.
|
|
34
|
-
*/
|
|
35
|
-
role: string;
|
|
36
|
-
/**
|
|
37
|
-
* The array of column definitions with their field names.
|
|
38
|
-
*/
|
|
39
|
-
columns: Array<{
|
|
40
|
-
field: string;
|
|
41
|
-
}>;
|
|
42
|
-
/**
|
|
43
|
-
* The headers object containing key-value pairs for the request.
|
|
44
|
-
*/
|
|
45
|
-
headers: Record<string, string>;
|
|
46
|
-
/**
|
|
47
|
-
* The prompt message sent to the AI assistant.
|
|
48
|
-
*/
|
|
49
|
-
promptMessage: string;
|
|
50
|
-
/**
|
|
51
|
-
* The request configuration options for the HTTP request.
|
|
52
|
-
*/
|
|
53
|
-
requestOptions: {
|
|
54
|
-
url?: string;
|
|
55
|
-
method?: string;
|
|
56
|
-
withCredentials?: boolean;
|
|
57
|
-
responseType?: string;
|
|
58
|
-
cancelToken?: any;
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
32
|
+
export type GridToolbarAIAssistantRequestData = GridAIRequestData;
|
|
62
33
|
/**
|
|
63
34
|
* Represents the props interface for the GridToolbarAIAssistant component.
|
|
64
35
|
* This component provides AI-powered functionality for grid operations through natural language prompts.
|
|
@@ -239,8 +210,5 @@ export interface GridToolbarAIAssistantProps {
|
|
|
239
210
|
*/
|
|
240
211
|
onCloseWindow?: () => void;
|
|
241
212
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Represents the GridToolbarAIAssistant component.
|
|
244
|
-
*/
|
|
245
213
|
declare const GridToolbarAIAssistant: React.ForwardRefExoticComponent<GridToolbarAIAssistantProps & React.RefAttributes<GridToolbarAIAssistantHandle>>;
|
|
246
214
|
export { GridToolbarAIAssistant };
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
-
`);
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),le=require("../utils/GridContext.js"),ue=require("@progress/kendo-react-buttons"),ce=require("@progress/kendo-svg-icons"),de=require("@progress/kendo-react-intl"),n=require("../messages/index.js"),y=require("@progress/kendo-react-common"),ge=require("@progress/kendo-react-dialogs"),pe=require("./ai-tool/GridAIPrompt.js"),me=require("../hooks/useGridAIRequest.js");function fe(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(a,e,i.get?i:{enumerable:!0,get:()=>r[e]})}}return a.default=r,Object.freeze(a)}const o=fe(ae),P=768,he=(r,a)=>r.map(i=>{let c=i;return a.forEach(l=>{l.field&&c.includes(l.field)&&(c=c.replace(new RegExp(l.field,"g"),l.title||l.field))}),c}),Ce=()=>null,q=o.forwardRef((r,a)=>{const e=o.useContext(le.GridContext),i=de.useLocalization(),{requestUrl:c,requestOptions:l,onPromptRequest:v,onResponseSuccess:x,onResponseError:T,role:E="user",gridAIPrompt:W=pe.GridAIPrompt,icon:k,svgIcon:O,onCloseWindow:m,promptPlaceHolder:L,suggestionsList:M,streaming:B,loading:D,outputs:G,enableSpeechToText:S}=r,[j,I]=o.useState([]),z=o.useMemo(()=>e&&Array.isArray(e.columnsRef)&&Array.isArray(e.hiddenColumnsRef)?[...e.columnsRef,...e.hiddenColumnsRef].map(t=>{var s;return{id:t.id,field:t.field,values:(s=t.values)!=null?s:[]}}):[],[e]),N=o.useMemo(()=>({sort:e.sort,filter:e.filter,group:e.group,highlight:e.highlight,select:e.select,columnsState:e.columnsState,skip:e.skip,take:e.take}),[e]),H=o.useMemo(()=>({getTotal:()=>e.getTotal(),getLeafDataItems:()=>e.getLeafDataItems(),exportAsPdf:()=>e.exportAsPdf(),props:{dataItemKey:e.dataItemKey}}),[e]),[f,h]=o.useState(!1),[K,_]=o.useState(),[F,w]=o.useState(),[b,U]=o.useState(()=>{const t=window.innerWidth;return t<P?t*.8:560}),d=o.useRef(null),X=o.useCallback(t=>{var s,u;t.sort!==void 0&&t.sort!==e.sort&&e.sortChange(t.sort,{}),t.filter!==e.filter&&e.filterChange(t.filter,{}),t.group!==void 0&&t.group!==e.group&&e.groupChange(t.group,{}),t.highlight!==void 0&&t.highlight!==e.highlight&&e.applyHighlightDescriptor(t.highlight),t.select!==void 0&&t.select!==e.select&&e.applySelectionDescriptor(t.select),t.columnsState!==void 0&&t.columnsState!==e.columnsState&&e.onColumnsStateChange(t.columnsState),(t.skip!==void 0&&t.skip!==e.skip||t.take!==void 0&&t.take!==e.take)&&e.pagerPageChange({skip:(s=t.skip)!=null?s:0,take:(u=t.take)!=null?u:0,syntheticEvent:{}})},[e]),Y=o.useCallback((t,s,u)=>{const C=[i.toLanguageString(n.aIResponseData,n.messages[n.aIResponseData])];t.forEach(re=>{const ie=he([re],e.columnsRef).join(`
|
|
9
|
+
`);I(A=>[{id:A.length+1,title:i.toLanguageString(n.generatedWithAI,n.messages[n.generatedWithAI]),subTitle:s,prompt:s,responseContent:C.concat(ie).join(""),isRetry:u},...A])})},[i,e.columnsRef]),$=o.useCallback(()=>{e.exportAsPdf()},[e]),{loading:J,streaming:Q,sendRequest:V,cancelRequest:Z}=me.useGridAIRequest({requestUrl:c,requestOptions:l,role:E,columns:z,gridState:N,gridRef:H,onPromptRequest:v,onResponseSuccess:x,onResponseError:T,onStateChange:X,onMessages:Y,onExportPdf:$}),ee=t=>{t.preventDefault(),h(!f)},g=o.useMemo(()=>{var t;return(t=r.show)!=null?t:f},[r.show,f]),p=o.useCallback(()=>{var t;m&&m(),I([]),h(!1),d.current&&((t=d.current.element)==null||t.focus())},[m]),[te,R]=y.useCustomComponent(W),oe=Object.keys(R).length>0?R:{},se=o.createElement(te,{onPromptRequest:V,onCancel:Z,onClose:p,streaming:B||Q,loading:D||J,outputs:G||j,promptPlaceHolder:L,suggestionsList:M,enableSpeechToText:S,...oe}),ne=o.createElement(ue.Button,{ref:d,togglable:!0,themeColor:"primary",rounded:"full",selected:g,svgIcon:O||(k?void 0:ce.sparklesIcon),icon:k,size:e.mobileMode?"large":"medium",className:y.classNames("k-toolbar-button",{"k-icon-button":e.mobileMode}),title:i.toLanguageString(n.toolbarAI,n.messages[n.toolbarAI]),onClick:ee});return o.useEffect(()=>{var t;if(d.current&&g){const s=(t=d.current.element)==null?void 0:t.getBoundingClientRect();if(s){_(s.top+window.scrollY+s.height),w(s.left+window.scrollX+s.width);const u=window.innerWidth,C=u<P?u*.75:560;U(C)}}},[g]),o.useImperativeHandle(a,()=>({show:()=>h(!0),hide:()=>p()}),[p]),o.createElement(o.Fragment,null,ne,g&&o.createElement(ge.Window,{key:b,autoFocus:!1,title:i.toLanguageString(n.toolbarAI,n.messages[n.toolbarAI]),initialTop:K,initialLeft:F,initialWidth:b,style:{height:"auto",minWidth:"90px",minHeight:"50px"},onClose:p,resizable:!0,draggable:!0,className:"k-grid-assistant-window",maximizeButton:Ce},se))});q.displayName="KendoReactGridToolbarAIAssistant";exports.GridToolbarAIAssistant=q;
|
|
@@ -6,200 +6,203 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as o from "react";
|
|
9
|
-
import { GridContext as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { sparklesIcon as
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var n;
|
|
9
|
+
import { GridContext as at } from "../utils/GridContext.mjs";
|
|
10
|
+
import { Button as ut } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { sparklesIcon as ct } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { useLocalization as dt } from "@progress/kendo-react-intl";
|
|
13
|
+
import { aIResponseData as x, messages as m, generatedWithAI as y, toolbarAI as g } from "../messages/index.mjs";
|
|
14
|
+
import { useCustomComponent as mt, classNames as gt } from "@progress/kendo-react-common";
|
|
15
|
+
import { Window as pt } from "@progress/kendo-react-dialogs";
|
|
16
|
+
import { GridAIPrompt as ft } from "./ai-tool/GridAIPrompt.mjs";
|
|
17
|
+
import { useGridAIRequest as ht } from "../hooks/useGridAIRequest.mjs";
|
|
18
|
+
const E = 768, Ct = (a, p) => a.map((i) => {
|
|
19
|
+
let l = i;
|
|
20
|
+
return p.forEach((n) => {
|
|
21
|
+
n.field && l.includes(n.field) && (l = l.replace(new RegExp(n.field, "g"), n.title || n.field));
|
|
22
|
+
}), l;
|
|
23
|
+
}), kt = () => null, It = o.forwardRef(
|
|
24
|
+
(a, p) => {
|
|
25
|
+
const t = o.useContext(at), i = dt(), {
|
|
26
|
+
requestUrl: l,
|
|
27
|
+
requestOptions: n,
|
|
28
|
+
onPromptRequest: v,
|
|
29
|
+
onResponseSuccess: T,
|
|
30
|
+
onResponseError: W,
|
|
31
|
+
role: L = "user",
|
|
32
|
+
gridAIPrompt: B = ft,
|
|
33
|
+
icon: I,
|
|
34
|
+
svgIcon: M,
|
|
35
|
+
onCloseWindow: f,
|
|
36
|
+
promptPlaceHolder: q,
|
|
37
|
+
suggestionsList: O,
|
|
38
|
+
streaming: z,
|
|
39
|
+
loading: D,
|
|
40
|
+
outputs: G,
|
|
41
|
+
enableSpeechToText: N
|
|
42
|
+
} = a, [S, R] = o.useState([]), H = o.useMemo(() => t && Array.isArray(t.columnsRef) && Array.isArray(t.hiddenColumnsRef) ? [...t.columnsRef, ...t.hiddenColumnsRef].map((e) => {
|
|
43
|
+
var s;
|
|
45
44
|
return {
|
|
46
|
-
id:
|
|
47
|
-
field:
|
|
48
|
-
values: (
|
|
45
|
+
id: e.id,
|
|
46
|
+
field: e.field,
|
|
47
|
+
values: (s = e.values) != null ? s : []
|
|
49
48
|
};
|
|
50
|
-
}) : [], [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
title: l.toLanguageString(D, k[D]),
|
|
68
|
-
subTitle: n,
|
|
69
|
-
prompt: n,
|
|
70
|
-
responseContent: a.concat(s).join(""),
|
|
71
|
-
isRetry: r
|
|
72
|
-
},
|
|
73
|
-
...R
|
|
74
|
-
]);
|
|
75
|
-
}, se = (t, n, r) => {
|
|
76
|
-
var h, C;
|
|
77
|
-
p(!1), m(!1);
|
|
78
|
-
const a = {
|
|
79
|
-
getTotal: () => e.getTotal(),
|
|
80
|
-
getLeafDataItems: () => e.getLeafDataItems(),
|
|
81
|
-
exportAsPdf: () => e.exportAsPdf(),
|
|
49
|
+
}) : [], [t]), K = o.useMemo(
|
|
50
|
+
() => ({
|
|
51
|
+
sort: t.sort,
|
|
52
|
+
filter: t.filter,
|
|
53
|
+
group: t.group,
|
|
54
|
+
highlight: t.highlight,
|
|
55
|
+
select: t.select,
|
|
56
|
+
columnsState: t.columnsState,
|
|
57
|
+
skip: t.skip,
|
|
58
|
+
take: t.take
|
|
59
|
+
}),
|
|
60
|
+
[t]
|
|
61
|
+
), j = o.useMemo(
|
|
62
|
+
() => ({
|
|
63
|
+
getTotal: () => t.getTotal(),
|
|
64
|
+
getLeafDataItems: () => t.getLeafDataItems(),
|
|
65
|
+
exportAsPdf: () => t.exportAsPdf(),
|
|
82
66
|
props: {
|
|
83
|
-
dataItemKey:
|
|
84
|
-
}
|
|
85
|
-
}, s = ke(t, e, a);
|
|
86
|
-
s.state.sort !== e.sort && e.sortChange(s.state.sort, t), s.state.filter !== e.filter && e.filterChange(s.state.filter, t), s.state.group !== e.group && e.groupChange(s.state.group, t), s.state.highlight !== e.highlight && e.applyHighlightDescriptor(s.state.highlight), s.state.select !== e.select && e.applySelectionDescriptor(s.state.select), s.state.columnsState !== e.columnsState && e.onColumnsStateChange(s.state.columnsState), (s.state.skip !== e.skip || s.state.take !== e.take) && e.pagerPageChange({
|
|
87
|
-
skip: (h = s.state.skip) != null ? h : 0,
|
|
88
|
-
take: (C = s.state.take) != null ? C : 0,
|
|
89
|
-
syntheticEvent: t
|
|
90
|
-
}), s.shouldExportPdf && e.exportAsPdf(), s.messages.length > 0 && s.messages.forEach((ue) => {
|
|
91
|
-
te(ue, n, r);
|
|
92
|
-
}), P && P(t, n, r);
|
|
93
|
-
}, oe = (t) => {
|
|
94
|
-
I == null || I(t), p(!1), m(!1);
|
|
95
|
-
}, ne = (t, n) => {
|
|
96
|
-
const r = v.CancelToken.source(), a = {
|
|
97
|
-
role: j || "user",
|
|
98
|
-
columns: X || [],
|
|
99
|
-
headers: {
|
|
100
|
-
Accept: "*/*",
|
|
101
|
-
"Content-Type": "application/json"
|
|
102
|
-
},
|
|
103
|
-
promptMessage: t,
|
|
104
|
-
requestOptions: {
|
|
105
|
-
url: c,
|
|
106
|
-
method: "POST",
|
|
107
|
-
withCredentials: !1,
|
|
108
|
-
responseType: "json",
|
|
109
|
-
cancelToken: r.token,
|
|
110
|
-
...i
|
|
67
|
+
dataItemKey: t.dataItemKey
|
|
111
68
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
69
|
+
}),
|
|
70
|
+
[t]
|
|
71
|
+
), [h, C] = o.useState(!1), [F, U] = o.useState(), [X, Y] = o.useState(), [A, _] = o.useState(() => {
|
|
72
|
+
const e = window.innerWidth;
|
|
73
|
+
return e < E ? e * 0.8 : 560;
|
|
74
|
+
}), u = o.useRef(null), $ = o.useCallback(
|
|
75
|
+
(e) => {
|
|
76
|
+
var s, r;
|
|
77
|
+
e.sort !== void 0 && e.sort !== t.sort && t.sortChange(e.sort, {}), e.filter !== t.filter && t.filterChange(e.filter, {}), e.group !== void 0 && e.group !== t.group && t.groupChange(e.group, {}), e.highlight !== void 0 && e.highlight !== t.highlight && t.applyHighlightDescriptor(e.highlight), e.select !== void 0 && e.select !== t.select && t.applySelectionDescriptor(e.select), e.columnsState !== void 0 && e.columnsState !== t.columnsState && t.onColumnsStateChange(e.columnsState), (e.skip !== void 0 && e.skip !== t.skip || e.take !== void 0 && e.take !== t.take) && t.pagerPageChange({
|
|
78
|
+
skip: (s = e.skip) != null ? s : 0,
|
|
79
|
+
take: (r = e.take) != null ? r : 0,
|
|
80
|
+
syntheticEvent: {}
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
[t]
|
|
84
|
+
), w = o.useCallback(
|
|
85
|
+
(e, s, r) => {
|
|
86
|
+
const k = [i.toLanguageString(x, m[x])];
|
|
87
|
+
e.forEach((rt) => {
|
|
88
|
+
const lt = Ct([rt], t.columnsRef).join(`
|
|
89
|
+
`);
|
|
90
|
+
R((P) => [
|
|
91
|
+
{
|
|
92
|
+
id: P.length + 1,
|
|
93
|
+
title: i.toLanguageString(y, m[y]),
|
|
94
|
+
subTitle: s,
|
|
95
|
+
prompt: s,
|
|
96
|
+
responseContent: k.concat(lt).join(""),
|
|
97
|
+
isRetry: r
|
|
98
|
+
},
|
|
99
|
+
...P
|
|
100
|
+
]);
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
[i, t.columnsRef]
|
|
104
|
+
), J = o.useCallback(() => {
|
|
105
|
+
t.exportAsPdf();
|
|
106
|
+
}, [t]), {
|
|
107
|
+
loading: Q,
|
|
108
|
+
streaming: V,
|
|
109
|
+
sendRequest: Z,
|
|
110
|
+
cancelRequest: tt
|
|
111
|
+
} = ht({
|
|
112
|
+
requestUrl: l,
|
|
113
|
+
requestOptions: n,
|
|
114
|
+
role: L,
|
|
115
|
+
columns: H,
|
|
116
|
+
gridState: K,
|
|
117
|
+
gridRef: j,
|
|
118
|
+
onPromptRequest: v,
|
|
119
|
+
onResponseSuccess: T,
|
|
120
|
+
onResponseError: W,
|
|
121
|
+
onStateChange: $,
|
|
122
|
+
onMessages: w,
|
|
123
|
+
onExportPdf: J
|
|
124
|
+
}), et = (e) => {
|
|
125
|
+
e.preventDefault(), C(!h);
|
|
126
|
+
}, c = o.useMemo(() => {
|
|
127
|
+
var e;
|
|
128
|
+
return (e = a.show) != null ? e : h;
|
|
129
|
+
}, [a.show, h]), d = o.useCallback(() => {
|
|
130
|
+
var e;
|
|
131
|
+
f && f(), R([]), C(!1), u.current && ((e = u.current.element) == null || e.focus());
|
|
132
|
+
}, [f]), [ot, b] = mt(
|
|
133
|
+
B
|
|
134
|
+
), st = Object.keys(b).length > 0 ? b : {}, it = /* @__PURE__ */ o.createElement(
|
|
135
|
+
ot,
|
|
133
136
|
{
|
|
134
|
-
onPromptRequest:
|
|
135
|
-
onCancel:
|
|
136
|
-
onClose:
|
|
137
|
-
streaming:
|
|
138
|
-
loading:
|
|
139
|
-
outputs:
|
|
140
|
-
promptPlaceHolder:
|
|
141
|
-
suggestionsList:
|
|
142
|
-
enableSpeechToText:
|
|
143
|
-
...
|
|
137
|
+
onPromptRequest: Z,
|
|
138
|
+
onCancel: tt,
|
|
139
|
+
onClose: d,
|
|
140
|
+
streaming: z || V,
|
|
141
|
+
loading: D || Q,
|
|
142
|
+
outputs: G || S,
|
|
143
|
+
promptPlaceHolder: q,
|
|
144
|
+
suggestionsList: O,
|
|
145
|
+
enableSpeechToText: N,
|
|
146
|
+
...st
|
|
144
147
|
}
|
|
145
|
-
),
|
|
146
|
-
|
|
148
|
+
), nt = /* @__PURE__ */ o.createElement(
|
|
149
|
+
ut,
|
|
147
150
|
{
|
|
148
|
-
ref:
|
|
151
|
+
ref: u,
|
|
149
152
|
togglable: !0,
|
|
150
153
|
themeColor: "primary",
|
|
151
154
|
rounded: "full",
|
|
152
|
-
selected:
|
|
153
|
-
svgIcon:
|
|
154
|
-
icon:
|
|
155
|
-
size:
|
|
156
|
-
className:
|
|
157
|
-
title:
|
|
158
|
-
onClick:
|
|
155
|
+
selected: c,
|
|
156
|
+
svgIcon: M || (I ? void 0 : ct),
|
|
157
|
+
icon: I,
|
|
158
|
+
size: t.mobileMode ? "large" : "medium",
|
|
159
|
+
className: gt("k-toolbar-button", { "k-icon-button": t.mobileMode }),
|
|
160
|
+
title: i.toLanguageString(g, m[g]),
|
|
161
|
+
onClick: et
|
|
159
162
|
}
|
|
160
163
|
);
|
|
161
164
|
return o.useEffect(() => {
|
|
162
|
-
var
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
const r = window.innerWidth,
|
|
168
|
-
|
|
165
|
+
var e;
|
|
166
|
+
if (u.current && c) {
|
|
167
|
+
const s = (e = u.current.element) == null ? void 0 : e.getBoundingClientRect();
|
|
168
|
+
if (s) {
|
|
169
|
+
U(s.top + window.scrollY + s.height), Y(s.left + window.scrollX + s.width);
|
|
170
|
+
const r = window.innerWidth, k = r < E ? r * 0.75 : 560;
|
|
171
|
+
_(k);
|
|
169
172
|
}
|
|
170
173
|
}
|
|
171
|
-
}, [
|
|
172
|
-
|
|
174
|
+
}, [c]), o.useImperativeHandle(
|
|
175
|
+
p,
|
|
173
176
|
() => ({
|
|
174
|
-
show: () =>
|
|
175
|
-
hide: () =>
|
|
177
|
+
show: () => C(!0),
|
|
178
|
+
hide: () => d()
|
|
176
179
|
}),
|
|
177
|
-
[
|
|
178
|
-
), /* @__PURE__ */ o.createElement(o.Fragment, null,
|
|
179
|
-
|
|
180
|
+
[d]
|
|
181
|
+
), /* @__PURE__ */ o.createElement(o.Fragment, null, nt, c && /* @__PURE__ */ o.createElement(
|
|
182
|
+
pt,
|
|
180
183
|
{
|
|
181
|
-
key:
|
|
184
|
+
key: A,
|
|
182
185
|
autoFocus: !1,
|
|
183
|
-
title:
|
|
184
|
-
initialTop:
|
|
185
|
-
initialLeft:
|
|
186
|
-
initialWidth:
|
|
186
|
+
title: i.toLanguageString(g, m[g]),
|
|
187
|
+
initialTop: F,
|
|
188
|
+
initialLeft: X,
|
|
189
|
+
initialWidth: A,
|
|
187
190
|
style: {
|
|
188
191
|
height: "auto",
|
|
189
192
|
minWidth: "90px",
|
|
190
193
|
minHeight: "50px"
|
|
191
194
|
},
|
|
192
|
-
onClose:
|
|
195
|
+
onClose: d,
|
|
193
196
|
resizable: !0,
|
|
194
197
|
draggable: !0,
|
|
195
198
|
className: "k-grid-assistant-window",
|
|
196
|
-
maximizeButton:
|
|
199
|
+
maximizeButton: kt
|
|
197
200
|
},
|
|
198
|
-
|
|
201
|
+
it
|
|
199
202
|
));
|
|
200
203
|
}
|
|
201
204
|
);
|
|
202
|
-
|
|
205
|
+
It.displayName = "KendoReactGridToolbarAIAssistant";
|
|
203
206
|
export {
|
|
204
|
-
|
|
207
|
+
It as GridToolbarAIAssistant
|
|
205
208
|
};
|
|
@@ -13,7 +13,7 @@ import { GridColumnMenuItemContent as je } from "../columnMenu/GridColumnMenuIte
|
|
|
13
13
|
import { GridColumnMenuItemGroup as qe } from "../columnMenu/GridColumnMenuItemGroup.mjs";
|
|
14
14
|
import { GridContext as Je } from "../utils/GridContext.mjs";
|
|
15
15
|
import { filterIcon as me, filterClearIcon as Qe } from "@progress/kendo-svg-icons";
|
|
16
|
-
import { getFilterType as de, operatorMap as V,
|
|
16
|
+
import { getFilterType as de, operatorMap as V, defaultHideSecondFilter as We, IsUnaryFilter as b, getDefaultOperator as Xe, filterLogicList as Ye, booleanFilterValues as Ze } from "../filterCommon.mjs";
|
|
17
17
|
import { Button as k } from "@progress/kendo-react-buttons";
|
|
18
18
|
import { GridColumnMenuFilterUI as $e } from "../columnMenu/GridColumnMenuFilterUI.mjs";
|
|
19
19
|
import { toolbarFilter as M, messages as F, filterSubmitButton as ge, filterClearButton as pe, filterClearAllButton as he } from "../messages/index.mjs";
|
|
@@ -49,7 +49,7 @@ const nt = (c) => {
|
|
|
49
49
|
var o, i, l, s, ce, ue;
|
|
50
50
|
let e;
|
|
51
51
|
if (r != null && r.current && ((o = r == null ? void 0 : r.current) != null && o.field)) {
|
|
52
|
-
const Ge = de((i = r == null ? void 0 : r.current) == null ? void 0 : i.filter), v =
|
|
52
|
+
const Ge = de((i = r == null ? void 0 : r.current) == null ? void 0 : i.filter), v = Xe(n.filterOperators, Ge);
|
|
53
53
|
e = Re((l = r == null ? void 0 : r.current) == null ? void 0 : l.field, n.filter), e = e ? {
|
|
54
54
|
...e,
|
|
55
55
|
filters: e.filters.map((O) => ({ ...O }))
|
|
@@ -90,7 +90,7 @@ const nt = (c) => {
|
|
|
90
90
|
...u,
|
|
91
91
|
filters: i
|
|
92
92
|
});
|
|
93
|
-
}, [u, B] = t.useState(q()), a = u == null ? void 0 : u.filters, C = de((re = r == null ? void 0 : r.current) == null ? void 0 : re.filter), A = V(n.filterOperators[C], f), Q = V(
|
|
93
|
+
}, [u, B] = t.useState(q()), a = u == null ? void 0 : u.filters, C = de((re = r == null ? void 0 : r.current) == null ? void 0 : re.filter), A = V(n.filterOperators[C], f), Q = V(Ze, f), ke = {
|
|
94
94
|
field: (oe = r == null ? void 0 : r.current) == null ? void 0 : oe.field,
|
|
95
95
|
value: a == null ? void 0 : a[0].value,
|
|
96
96
|
operator: a == null ? void 0 : a[0].operator,
|
|
@@ -109,11 +109,11 @@ const nt = (c) => {
|
|
|
109
109
|
}, we = (e) => {
|
|
110
110
|
let o = e.target.value;
|
|
111
111
|
e.target.tagName === "SPAN" && (o = e.target.parentElement.value), B({ ...u, logic: o });
|
|
112
|
-
}, W = u == null ? void 0 : u.logic, X = V(
|
|
112
|
+
}, W = u == null ? void 0 : u.logic, X = V(Ye, f), T = {
|
|
113
113
|
value: X.find((e) => e.operator === (W === null ? "" : W)),
|
|
114
114
|
onChange: we,
|
|
115
115
|
data: X
|
|
116
|
-
}, Se = c.hideSecondFilter !== void 0 ? c.hideSecondFilter :
|
|
116
|
+
}, Se = c.hideSecondFilter !== void 0 ? c.hideSecondFilter : We[C], N = c.filterUI, L = {
|
|
117
117
|
firstFilterProps: ke,
|
|
118
118
|
secondFilterProps: Me,
|
|
119
119
|
logicData: T.data,
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { SegmentedControlHandle, SegmentedControlProps } from './interfaces/index.js';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<SegmentedControlHandle>>;
|
|
@@ -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 T=require("react"),i=require("@progress/kendo-react-common");function W(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(a,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return a.default=s,Object.freeze(a)}const e=W(T),P=void 0,I=e.forwardRef((s,a)=>{const{buttons:r=[],size:l=P,stretched:z}=s,N=l?i.kendoThemeMaps.sizeMap[l]:void 0,f=e.useRef(null),R=e.useRef(null),[O,u]=e.useState({}),d=e.useCallback(()=>{const t=f.current,n=R.current;if(!t||!n)return;const m=t.querySelector(".k-segmented-control-button.k-selected");if(!m)return;const g=t.offsetWidth,p=m.offsetWidth,b=m.offsetLeft;n.style.left=`${b}px`,n.style.right=`${g-b-p}px`},[]);return e.useLayoutEffect(()=>{d()},[r,d]),e.useEffect(()=>{const t=f.current;if(!t)return;const n=new ResizeObserver(()=>{d()});return n.observe(t),()=>{n.disconnect()}},[d]),e.useImperativeHandle(a,()=>({element:f.current}),[]),e.createElement("div",{ref:f,className:i.classNames("k-segmented-control",N&&`k-segmented-control-${N}`,{"k-segmented-control-stretched":z})},e.createElement("div",{className:"k-segmented-control-thumb",ref:R,"aria-hidden":"true"}),r.map(({buttonId:t,disabled:n,text:m,svgIcon:g,selected:p,accentIcon:b,type:E="button",onClick:h,onMouseEnter:k,onMouseLeave:v,onFocus:S,onBlur:y,...j})=>e.createElement("button",{key:t,type:E,className:i.classNames("k-segmented-control-button",{"k-selected":p,"k-hover":O.hoveredId===t&&!n,"k-focus":O.focusedId===t&&!n,"k-disabled":n}),disabled:n,onClick:c=>{h==null||h(c),d()},onMouseEnter:c=>{u(o=>({...o,hoveredId:t})),k==null||k(c)},onMouseLeave:c=>{u(o=>({...o,hoveredId:void 0})),v==null||v(c)},onFocus:c=>{u(o=>({...o,focusedId:t})),S==null||S(c)},onBlur:c=>{u(o=>({...o,focusedId:void 0})),y==null||y(c)},...j},g&&e.createElement(i.IconWrap,{className:i.classNames("k-segmented-control-button-icon",{"k-accent-icon":p&&b}),icon:g}),e.createElement("span",{className:"k-segmented-control-button-text"},m))))});I.displayName="KendoReactSegmentedControl";exports.SegmentedControl=I;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { kendoThemeMaps as x, classNames as g, IconWrap as T } from "@progress/kendo-react-common";
|
|
10
|
+
const $ = void 0, w = e.forwardRef((S, y) => {
|
|
11
|
+
const { buttons: v = [], size: b = $, stretched: E } = S, R = b ? x.sizeMap[b] : void 0, a = e.useRef(null), I = e.useRef(null), [N, m] = e.useState({}), r = e.useCallback(() => {
|
|
12
|
+
const t = a.current, s = I.current;
|
|
13
|
+
if (!t || !s)
|
|
14
|
+
return;
|
|
15
|
+
const o = t.querySelector(".k-segmented-control-button.k-selected");
|
|
16
|
+
if (!o)
|
|
17
|
+
return;
|
|
18
|
+
const d = t.offsetWidth, l = o.offsetWidth, i = o.offsetLeft;
|
|
19
|
+
s.style.left = `${i}px`, s.style.right = `${d - i - l}px`;
|
|
20
|
+
}, []);
|
|
21
|
+
return e.useLayoutEffect(() => {
|
|
22
|
+
r();
|
|
23
|
+
}, [v, r]), e.useEffect(() => {
|
|
24
|
+
const t = a.current;
|
|
25
|
+
if (!t)
|
|
26
|
+
return;
|
|
27
|
+
const s = new ResizeObserver(() => {
|
|
28
|
+
r();
|
|
29
|
+
});
|
|
30
|
+
return s.observe(t), () => {
|
|
31
|
+
s.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, [r]), e.useImperativeHandle(
|
|
34
|
+
y,
|
|
35
|
+
() => ({
|
|
36
|
+
element: a.current
|
|
37
|
+
}),
|
|
38
|
+
[]
|
|
39
|
+
), /* @__PURE__ */ e.createElement(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: a,
|
|
43
|
+
className: g("k-segmented-control", R && `k-segmented-control-${R}`, {
|
|
44
|
+
"k-segmented-control-stretched": E
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-segmented-control-thumb", ref: I, "aria-hidden": "true" }),
|
|
48
|
+
v.map(
|
|
49
|
+
({
|
|
50
|
+
buttonId: t,
|
|
51
|
+
disabled: s,
|
|
52
|
+
text: o,
|
|
53
|
+
svgIcon: d,
|
|
54
|
+
selected: l,
|
|
55
|
+
accentIcon: i,
|
|
56
|
+
type: z = "button",
|
|
57
|
+
onClick: f,
|
|
58
|
+
onMouseEnter: u,
|
|
59
|
+
onMouseLeave: h,
|
|
60
|
+
onFocus: k,
|
|
61
|
+
onBlur: p,
|
|
62
|
+
...W
|
|
63
|
+
}) => /* @__PURE__ */ e.createElement(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
key: t,
|
|
67
|
+
type: z,
|
|
68
|
+
className: g("k-segmented-control-button", {
|
|
69
|
+
"k-selected": l,
|
|
70
|
+
"k-hover": N.hoveredId === t && !s,
|
|
71
|
+
"k-focus": N.focusedId === t && !s,
|
|
72
|
+
"k-disabled": s
|
|
73
|
+
}),
|
|
74
|
+
disabled: s,
|
|
75
|
+
onClick: (n) => {
|
|
76
|
+
f == null || f(n), r();
|
|
77
|
+
},
|
|
78
|
+
onMouseEnter: (n) => {
|
|
79
|
+
m((c) => ({ ...c, hoveredId: t })), u == null || u(n);
|
|
80
|
+
},
|
|
81
|
+
onMouseLeave: (n) => {
|
|
82
|
+
m((c) => ({ ...c, hoveredId: void 0 })), h == null || h(n);
|
|
83
|
+
},
|
|
84
|
+
onFocus: (n) => {
|
|
85
|
+
m((c) => ({ ...c, focusedId: t })), k == null || k(n);
|
|
86
|
+
},
|
|
87
|
+
onBlur: (n) => {
|
|
88
|
+
m((c) => ({ ...c, focusedId: void 0 })), p == null || p(n);
|
|
89
|
+
},
|
|
90
|
+
...W
|
|
91
|
+
},
|
|
92
|
+
d && /* @__PURE__ */ e.createElement(
|
|
93
|
+
T,
|
|
94
|
+
{
|
|
95
|
+
className: g("k-segmented-control-button-icon", {
|
|
96
|
+
"k-accent-icon": l && i
|
|
97
|
+
}),
|
|
98
|
+
icon: d
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ e.createElement("span", { className: "k-segmented-control-button-text" }, o)
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
w.displayName = "KendoReactSegmentedControl";
|
|
107
|
+
export {
|
|
108
|
+
w as SegmentedControl
|
|
109
|
+
};
|