@progress/kendo-angular-grid 19.3.0-develop.20 → 19.3.0-develop.22
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/directives.d.ts +4 -3
- package/esm2022/common/toolbar-tool-base.directive.mjs +3 -2
- package/esm2022/directives.mjs +2 -0
- package/esm2022/grid.component.mjs +74 -5
- package/esm2022/grid.module.mjs +102 -101
- package/esm2022/index.mjs +2 -0
- package/esm2022/localization/messages.mjs +55 -1
- package/esm2022/navigation/toolbar-tool-name.mjs +2 -1
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/rendering/toolbar/tools/ai-assistant/ai-assistant.component.mjs +286 -0
- package/esm2022/rendering/toolbar/tools/ai-assistant/ai-tool.directive.mjs +269 -0
- package/esm2022/rendering/toolbar/tools/ai-assistant/utils.mjs +47 -0
- package/fesm2022/progress-kendo-angular-grid.mjs +742 -50
- package/grid.component.d.ts +4 -1
- package/grid.module.d.ts +101 -100
- package/index.d.ts +2 -0
- package/localization/messages.d.ts +37 -1
- package/navigation/toolbar-tool-name.d.ts +1 -0
- package/package.json +21 -20
- package/rendering/toolbar/tools/ai-assistant/ai-assistant.component.d.ts +49 -0
- package/rendering/toolbar/tools/ai-assistant/ai-tool.directive.d.ts +119 -0
- package/rendering/toolbar/tools/ai-assistant/utils.d.ts +110 -0
- package/schematics/ngAdd/index.js +4 -4
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgZone, AfterViewInit, OnInit, OnDestroy, ChangeDetectorRef, EventEmitter } from '@angular/core';
|
|
6
|
+
import { RefreshService, ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
8
|
+
import { ContextService } from '../../../../common/provider.service';
|
|
9
|
+
import { ToolbarToolBase } from '../../../../common/toolbar-tool-base.directive';
|
|
10
|
+
import { WindowService } from '@progress/kendo-angular-dialog';
|
|
11
|
+
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
|
12
|
+
import { GridToolbarAIOpenEvent, GridToolbarAIPromptSettings, GridToolbarAIWindowSettings, GridToolbarAIRequestData, GridToolbarAIRequestResponse, GridToolbarAIRequestOptions } from './utils';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
/**
|
|
15
|
+
* Represents an AI Assistant tool of the Grid.
|
|
16
|
+
* Use this directive on any `kendo-toolbar-button` inside a ToolbarComponent in the Grid.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html-no-run
|
|
20
|
+
* <kendo-grid>
|
|
21
|
+
* <kendo-toolbar>
|
|
22
|
+
* <kendo-toolbar-button kendoGridAIAssistantTool></kendo-toolbar-button>
|
|
23
|
+
* </kendo-toolbar>
|
|
24
|
+
* </kendo-grid>
|
|
25
|
+
* ```
|
|
26
|
+
* @remarks
|
|
27
|
+
* Applied to: {@link ToolBarButtonComponent}.
|
|
28
|
+
*/
|
|
29
|
+
export declare class AIAssistantToolbarDirective extends ToolbarToolBase implements OnInit, AfterViewInit, OnDestroy {
|
|
30
|
+
private windowService;
|
|
31
|
+
host: ToolBarButtonComponent;
|
|
32
|
+
ctx: ContextService;
|
|
33
|
+
zone: NgZone;
|
|
34
|
+
private refresh;
|
|
35
|
+
/**
|
|
36
|
+
* The URL to which the AI Assistant tool sends the AI request.
|
|
37
|
+
* - When you set this property, the AI Assistant tool sends and handles an HTTP request to the provided `requestUrl`. You can handle the `promptRequest` event to modify the request options before the tool sends it.
|
|
38
|
+
* - When you do not set this property, the AI Assistant tool does not send an HTTP request. You should handle the `promptRequest` event to send and handle a custom HTTP request.
|
|
39
|
+
*/
|
|
40
|
+
requestUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Configures the request options that the AI Assistant tool sends with the AI request.
|
|
43
|
+
*
|
|
44
|
+
* @default
|
|
45
|
+
* ```typescript
|
|
46
|
+
* {
|
|
47
|
+
* headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
|
48
|
+
* role: 'user',
|
|
49
|
+
* method: 'POST',
|
|
50
|
+
* responseType: 'json',
|
|
51
|
+
* withCredentials: false
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
requestOptions?: GridToolbarAIRequestOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Configures the settings for the AI Assistant Window.
|
|
58
|
+
*/
|
|
59
|
+
aiWindowSettings: GridToolbarAIWindowSettings;
|
|
60
|
+
/**
|
|
61
|
+
* Configures the settings for the AI prompt component that the AI Assistant Window component uses.
|
|
62
|
+
*/
|
|
63
|
+
aiPromptSettings: GridToolbarAIPromptSettings;
|
|
64
|
+
/**
|
|
65
|
+
* Emits an event before the AI Assistant tool sends the AI request.
|
|
66
|
+
* - When you provide a `requestUrl`, you can handle the event to modify the request options.
|
|
67
|
+
* - When you do not provide a `requestUrl`, you can handle the event to perform an entirely custom request.
|
|
68
|
+
*/
|
|
69
|
+
promptRequest: EventEmitter<{
|
|
70
|
+
requestData: GridToolbarAIRequestData;
|
|
71
|
+
isRetry: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Emits an event when the user clicks the cancel button.
|
|
75
|
+
*/
|
|
76
|
+
cancelRequest: EventEmitter<undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Emits an event when the AI Assistant tool completes the AI request successfully.
|
|
79
|
+
* The event contains the response from the AI service.
|
|
80
|
+
*/
|
|
81
|
+
responseSuccess: EventEmitter<HttpResponse<GridToolbarAIRequestResponse>>;
|
|
82
|
+
/**
|
|
83
|
+
* Emits an event when the AI Assistant tool completes the AI request with an error.
|
|
84
|
+
* The event contains the response from the AI service.
|
|
85
|
+
*/
|
|
86
|
+
responseError: EventEmitter<HttpErrorResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Emits an event when the AI Assistant tool closes.
|
|
89
|
+
*/
|
|
90
|
+
close: EventEmitter<undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Emits an event when the AI Assistant tool opens.
|
|
93
|
+
* The event contains the window instance and the AI prompt instance.
|
|
94
|
+
*/
|
|
95
|
+
open: EventEmitter<GridToolbarAIOpenEvent>;
|
|
96
|
+
tableWizardIcon: SVGIcon;
|
|
97
|
+
private windowRef;
|
|
98
|
+
private subs;
|
|
99
|
+
private actionSheetCloseSub;
|
|
100
|
+
private emitOpenClose;
|
|
101
|
+
private defaultAiPromptSettings;
|
|
102
|
+
constructor(windowService: WindowService, host: ToolBarButtonComponent, ctx: ContextService, zone: NgZone, refresh: RefreshService, cdr: ChangeDetectorRef);
|
|
103
|
+
ngOnInit(): void;
|
|
104
|
+
ngAfterViewInit(): void;
|
|
105
|
+
ngOnDestroy(): void;
|
|
106
|
+
/**
|
|
107
|
+
* @hidden
|
|
108
|
+
*/
|
|
109
|
+
onClick(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Toggles the AI Assistant window.
|
|
112
|
+
*/
|
|
113
|
+
toggleWindow(): void;
|
|
114
|
+
private openWindow;
|
|
115
|
+
private closeWindow;
|
|
116
|
+
private get buttonElement();
|
|
117
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AIAssistantToolbarDirective, never>;
|
|
118
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AIAssistantToolbarDirective, "[kendoGridAIAssistantTool]", never, { "requestUrl": { "alias": "requestUrl"; "required": false; }; "requestOptions": { "alias": "requestOptions"; "required": false; }; "aiWindowSettings": { "alias": "aiWindowSettings"; "required": false; }; "aiPromptSettings": { "alias": "aiPromptSettings"; "required": false; }; }, { "promptRequest": "promptRequest"; "cancelRequest": "cancelRequest"; "responseSuccess": "responseSuccess"; "responseError": "responseError"; "close": "close"; "open": "open"; }, never, never, true, never>;
|
|
119
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { HttpHeaders } from "@angular/common/http";
|
|
6
|
+
import { AIPromptComponent, AIPromptSettings } from "@progress/kendo-angular-conversational-ui";
|
|
7
|
+
import { WindowComponent, WindowSettings } from "@progress/kendo-angular-dialog";
|
|
8
|
+
import { CompositeFilterDescriptor, FilterDescriptor, GroupDescriptor, SortDescriptor } from "@progress/kendo-data-query";
|
|
9
|
+
/**
|
|
10
|
+
* Interface representing all configuration options of the Ai Assistant Window.
|
|
11
|
+
*/
|
|
12
|
+
export interface GridToolbarAIWindowSettings extends Omit<WindowSettings, 'content'> {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface representing all configuration options of the Ai Assistant Prompt.
|
|
16
|
+
*/
|
|
17
|
+
export interface GridToolbarAIPromptSettings extends Omit<AIPromptSettings, 'promptCommands'> {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents the event data when the AI Assistant window is opened.
|
|
21
|
+
*/
|
|
22
|
+
export interface GridToolbarAIOpenEvent {
|
|
23
|
+
aiWindow: WindowComponent;
|
|
24
|
+
aiPrompt: AIPromptComponent;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents the data sent in the AI request from the Grid Toolbar AI Assistant.
|
|
28
|
+
*/
|
|
29
|
+
export interface GridToolbarAIRequestData {
|
|
30
|
+
columns: Array<{
|
|
31
|
+
field: string;
|
|
32
|
+
title: string;
|
|
33
|
+
}>;
|
|
34
|
+
promptMessage: string;
|
|
35
|
+
url?: string;
|
|
36
|
+
requestOptions: {
|
|
37
|
+
role?: string;
|
|
38
|
+
headers?: HttpHeaders;
|
|
39
|
+
method?: string;
|
|
40
|
+
withCredentials?: boolean;
|
|
41
|
+
body?: any;
|
|
42
|
+
responseType?: 'json' | 'arraybuffer' | 'blob' | 'text';
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents the response from the AI request in the Grid Toolbar AI Assistant.
|
|
48
|
+
*/
|
|
49
|
+
export interface GridToolbarAIRequestResponse {
|
|
50
|
+
messages: string[];
|
|
51
|
+
sort?: SortDescriptor[];
|
|
52
|
+
filter?: CompositeFilterDescriptor;
|
|
53
|
+
group?: GroupDescriptor[];
|
|
54
|
+
highlight?: {
|
|
55
|
+
cells: {
|
|
56
|
+
[key: string]: boolean;
|
|
57
|
+
};
|
|
58
|
+
filters: FilterDescriptor[];
|
|
59
|
+
logic: 'and' | 'or';
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Configuration options for the HTTP request.
|
|
64
|
+
*/
|
|
65
|
+
export interface GridToolbarAIRequestOptions {
|
|
66
|
+
/**
|
|
67
|
+
* HTTP headers to include with the request.
|
|
68
|
+
*/
|
|
69
|
+
headers?: HttpHeaders;
|
|
70
|
+
/**
|
|
71
|
+
* The role of the user making the request, e.g., 'user', 'assistant'.
|
|
72
|
+
* @default 'user'
|
|
73
|
+
*/
|
|
74
|
+
role?: string;
|
|
75
|
+
/**
|
|
76
|
+
* HTTP method to use for the request.
|
|
77
|
+
* @default 'POST'
|
|
78
|
+
*/
|
|
79
|
+
method?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to include credentials (cookies, authorization headers) with the request.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
withCredentials?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The expected response type.
|
|
87
|
+
* @default 'json'
|
|
88
|
+
*/
|
|
89
|
+
responseType?: 'json' | 'arraybuffer' | 'blob' | 'text';
|
|
90
|
+
/**
|
|
91
|
+
* The body of the request.
|
|
92
|
+
*/
|
|
93
|
+
body?: any;
|
|
94
|
+
/**
|
|
95
|
+
* Additional custom options that will be spread into the request configuration.
|
|
96
|
+
*/
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @hidden
|
|
101
|
+
*/
|
|
102
|
+
export declare const DEFAULT_AI_REQUEST_OPTIONS: GridToolbarAIRequestOptions;
|
|
103
|
+
/**
|
|
104
|
+
* @hidden
|
|
105
|
+
*/
|
|
106
|
+
export declare const convertDateStringsInFilter: (filter: any, columns: any[]) => any;
|
|
107
|
+
/**
|
|
108
|
+
* @hidden
|
|
109
|
+
*/
|
|
110
|
+
export declare const isDateField: (fieldName: string, columns: any[]) => boolean;
|
|
@@ -4,14 +4,14 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
4
4
|
function default_1(options) {
|
|
5
5
|
const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'GridModule', package: 'grid', peerDependencies: {
|
|
6
6
|
// peer deps of the dropdowns
|
|
7
|
-
'@progress/kendo-angular-treeview': '19.3.0-develop.
|
|
8
|
-
'@progress/kendo-angular-navigation': '19.3.0-develop.
|
|
7
|
+
'@progress/kendo-angular-treeview': '19.3.0-develop.22',
|
|
8
|
+
'@progress/kendo-angular-navigation': '19.3.0-develop.22',
|
|
9
9
|
// peer dependency of kendo-angular-inputs
|
|
10
|
-
'@progress/kendo-angular-dialog': '19.3.0-develop.
|
|
10
|
+
'@progress/kendo-angular-dialog': '19.3.0-develop.22',
|
|
11
11
|
// peer dependency of kendo-angular-icons
|
|
12
12
|
'@progress/kendo-svg-icons': '^4.0.0',
|
|
13
13
|
// peer dependency of kendo-angular-layout
|
|
14
|
-
'@progress/kendo-angular-progressbar': '19.3.0-develop.
|
|
14
|
+
'@progress/kendo-angular-progressbar': '19.3.0-develop.22'
|
|
15
15
|
} });
|
|
16
16
|
return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
|
|
17
17
|
}
|