@progress/kendo-angular-grid 21.0.0-develop.9 → 21.0.0
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/codemods/utils.js +485 -327
- package/codemods/v20/grid-kendogridgroupbinding.js +6 -6
- package/codemods/v21/grid-gridtoolbaraiopenevent.js +14 -0
- package/codemods/v21/grid-gridtoolbaraipromptrequestevent.js +14 -0
- package/codemods/v21/grid-gridtoolbaraipromptsettings.js +14 -0
- package/codemods/v21/grid-gridtoolbarairequestoptions.js +14 -0
- package/codemods/v21/grid-gridtoolbarairesponseerrorevent.js +14 -0
- package/codemods/v21/grid-gridtoolbaraiwindowsettings.js +14 -0
- package/column-menu/column-chooser.component.d.ts +0 -1
- package/common/id.service.d.ts +1 -0
- package/common/provider.service.d.ts +4 -0
- package/esm2022/column-menu/column-chooser.component.mjs +2 -7
- package/esm2022/columns/column-base.mjs +1 -1
- package/esm2022/common/id.service.mjs +3 -0
- package/esm2022/common/provider.service.mjs +2 -0
- package/esm2022/dragdrop/drag-hint.service.mjs +6 -2
- package/esm2022/excel/excel.component.mjs +13 -2
- package/esm2022/grid.component.mjs +18 -0
- package/esm2022/localization/messages.mjs +19 -1
- package/esm2022/navigation/navigation.service.mjs +47 -1
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/pdf/pdf.component.mjs +6 -0
- package/esm2022/rendering/list.component.mjs +16 -5
- package/esm2022/rendering/toolbar/tools/ai-assistant/ai-assistant.component.mjs +538 -29
- package/esm2022/rendering/toolbar/tools/ai-assistant/models.mjs +2 -2
- package/esm2022/row-reordering/row-reorder.service.mjs +28 -0
- package/excel/excel.component.d.ts +6 -2
- package/fesm2022/progress-kendo-angular-grid.mjs +698 -49
- package/localization/messages.d.ts +13 -1
- package/navigation/navigation.service.d.ts +1 -0
- package/package.json +58 -25
- package/rendering/toolbar/tools/ai-assistant/ai-assistant.component.d.ts +26 -5
- package/rendering/toolbar/tools/ai-assistant/ai-tool.directive.d.ts +8 -8
- package/rendering/toolbar/tools/ai-assistant/models.d.ts +65 -33
- package/row-reordering/row-reorder.service.d.ts +10 -1
- package/schematics/ngAdd/index.js +7 -7
|
@@ -205,7 +205,7 @@ const decorate = (element) => {
|
|
|
205
205
|
};
|
|
206
206
|
const svgIconsMarkup = (viewBox, content, safeTitle) => `
|
|
207
207
|
<span class="k-icon k-svg-icon k-drag-status k-svg-i-cancel">
|
|
208
|
-
<svg
|
|
208
|
+
<svg
|
|
209
209
|
xmlns="http://www.w3.org/2000/svg"
|
|
210
210
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
211
211
|
viewBox="${viewBox}"
|
|
@@ -261,7 +261,11 @@ class DragHintService {
|
|
|
261
261
|
remove() {
|
|
262
262
|
if (this.dom && this.dom.parentNode) {
|
|
263
263
|
(function (el) {
|
|
264
|
-
setTimeout(() =>
|
|
264
|
+
setTimeout(() => {
|
|
265
|
+
if (isDocumentAvailable()) {
|
|
266
|
+
document.body.removeChild(el);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
265
269
|
})(this.dom); // hack for IE + pointer events!
|
|
266
270
|
this.dom = null;
|
|
267
271
|
}
|
|
@@ -872,6 +876,8 @@ class ContextService {
|
|
|
872
876
|
scroller;
|
|
873
877
|
dataBindingDirective;
|
|
874
878
|
highlightDirective;
|
|
879
|
+
excelComponent;
|
|
880
|
+
pdfComponent;
|
|
875
881
|
constructor(renderer, localization) {
|
|
876
882
|
this.renderer = renderer;
|
|
877
883
|
this.localization = localization;
|
|
@@ -2118,6 +2124,9 @@ class IdService {
|
|
|
2118
2124
|
selectAllCheckboxId() {
|
|
2119
2125
|
return `${this.prefix}-select-all`;
|
|
2120
2126
|
}
|
|
2127
|
+
columnId(colIndex) {
|
|
2128
|
+
return `${this.prefix}-col${colIndex}`;
|
|
2129
|
+
}
|
|
2121
2130
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IdService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2122
2131
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IdService });
|
|
2123
2132
|
}
|
|
@@ -2530,7 +2539,7 @@ class ColumnBase {
|
|
|
2530
2539
|
if (parent && idService && parent.idService.gridId() === idService.gridId() && !isColumnContainer(parent)) {
|
|
2531
2540
|
throw new Error(ColumnConfigurationErrorMessages.columnNested);
|
|
2532
2541
|
}
|
|
2533
|
-
this._id =
|
|
2542
|
+
this._id = this.idService?.columnId(columnId++);
|
|
2534
2543
|
}
|
|
2535
2544
|
ngAfterViewInit() {
|
|
2536
2545
|
this.initialMinResizableWidth = this.minResizableWidth || 10;
|
|
@@ -3926,6 +3935,13 @@ class NavigationService {
|
|
|
3926
3935
|
const row = this.cursor.row;
|
|
3927
3936
|
// on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
|
|
3928
3937
|
const code = normalizeNumpadKeys(args);
|
|
3938
|
+
// Handle row reordering keyboard shortcuts (Ctrl/Cmd + Shift + Up/Down Arrow)
|
|
3939
|
+
if (modifier && args.shiftKey && (code === Keys.ArrowUp || code === Keys.ArrowDown)) {
|
|
3940
|
+
if (this.handleRowReorderKeyboard(args, code, row)) {
|
|
3941
|
+
args.preventDefault();
|
|
3942
|
+
return;
|
|
3943
|
+
}
|
|
3944
|
+
}
|
|
3929
3945
|
const dir = code === Keys.ArrowDown ? 'Down' : 'Up';
|
|
3930
3946
|
const right = code === Keys.ArrowRight;
|
|
3931
3947
|
const isArrowKey = code === Keys.ArrowDown || code === Keys.ArrowUp || code === Keys.ArrowLeft || code === Keys.ArrowRight;
|
|
@@ -3933,6 +3949,9 @@ class NavigationService {
|
|
|
3933
3949
|
startNewSelection = true;
|
|
3934
3950
|
this.isShiftPressed = true;
|
|
3935
3951
|
}
|
|
3952
|
+
const cellElement = args.target;
|
|
3953
|
+
const isDragCell = cellElement ? closest(cellElement, (el) => hasClasses$1(el, 'k-drag-cell')) : false;
|
|
3954
|
+
const isRowReorderable = this.ctx.grid.rowReorderable;
|
|
3936
3955
|
switch (code) {
|
|
3937
3956
|
case Keys.ArrowDown:
|
|
3938
3957
|
case Keys.ArrowUp:
|
|
@@ -3940,7 +3959,7 @@ class NavigationService {
|
|
|
3940
3959
|
rowspanOffset = this.calculateRowspanOffset(dir, rowspan);
|
|
3941
3960
|
step += rowspanOffset;
|
|
3942
3961
|
}
|
|
3943
|
-
if (args.shiftKey) {
|
|
3962
|
+
if (args.shiftKey && !(isDragCell && isRowReorderable)) {
|
|
3944
3963
|
if (this.ctx.grid.blockArrowSelection) {
|
|
3945
3964
|
return;
|
|
3946
3965
|
}
|
|
@@ -4288,6 +4307,42 @@ class NavigationService {
|
|
|
4288
4307
|
get isStackedMode() {
|
|
4289
4308
|
return this.ctx?.grid?.isStacked;
|
|
4290
4309
|
}
|
|
4310
|
+
handleRowReorderKeyboard(args, code, row) {
|
|
4311
|
+
if (!this.ctx.grid.rowReorderable || !this.activeCell) {
|
|
4312
|
+
return false;
|
|
4313
|
+
}
|
|
4314
|
+
const cell = this.activeCell;
|
|
4315
|
+
const cellElement = args.target;
|
|
4316
|
+
if (!cellElement) {
|
|
4317
|
+
return false;
|
|
4318
|
+
}
|
|
4319
|
+
const dragCell = closest(cellElement, (el) => hasClasses$1(el, 'k-drag-cell'));
|
|
4320
|
+
if (!dragCell || row.dataRowIndex < 0 || !row.dataItem) {
|
|
4321
|
+
return false;
|
|
4322
|
+
}
|
|
4323
|
+
const isUpArrow = code === Keys.ArrowUp;
|
|
4324
|
+
const currentRowIndex = row.dataRowIndex;
|
|
4325
|
+
const data = this.ctx.grid.flatData;
|
|
4326
|
+
if (!data || data.length === 0) {
|
|
4327
|
+
return false;
|
|
4328
|
+
}
|
|
4329
|
+
const targetRowIndex = currentRowIndex + (isUpArrow ? -1 : 1);
|
|
4330
|
+
if (targetRowIndex < 0 || targetRowIndex >= data.length) {
|
|
4331
|
+
return false;
|
|
4332
|
+
}
|
|
4333
|
+
const dropPosition = isUpArrow ? 'before' : 'after';
|
|
4334
|
+
this.zone.run(() => {
|
|
4335
|
+
const skip = this.ctx.grid.skip || 0;
|
|
4336
|
+
this.ctx.grid.rowReorderService.reorderViaKeyboard(currentRowIndex + skip, targetRowIndex + skip, dropPosition, data);
|
|
4337
|
+
// Move focus to follow the reordered row
|
|
4338
|
+
// After reordering, the row will be at the target position
|
|
4339
|
+
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
4340
|
+
const newRowIndex = this.meta.headerRows + targetRowIndex;
|
|
4341
|
+
this.cursor.reset(newRowIndex, cell.colIndex);
|
|
4342
|
+
});
|
|
4343
|
+
});
|
|
4344
|
+
return true;
|
|
4345
|
+
}
|
|
4291
4346
|
handleStackedKeydown(args) {
|
|
4292
4347
|
const target = args.target;
|
|
4293
4348
|
const stackedCell = closest(target, (el) => hasClasses$1(el, 'k-grid-stack-cell'));
|
|
@@ -13383,7 +13438,6 @@ class ColumnChooserComponent {
|
|
|
13383
13438
|
*/
|
|
13384
13439
|
allowHideAll = true;
|
|
13385
13440
|
anchor;
|
|
13386
|
-
columnList;
|
|
13387
13441
|
get columns() {
|
|
13388
13442
|
return this.columnInfoService.leafNamedColumns;
|
|
13389
13443
|
}
|
|
@@ -13478,7 +13532,7 @@ class ColumnChooserComponent {
|
|
|
13478
13532
|
}
|
|
13479
13533
|
}
|
|
13480
13534
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnChooserComponent, deps: [{ token: ContextService }, { token: ColumnInfoService }, { token: i2.PopupService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
13481
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ColumnChooserComponent, isStandalone: true, selector: "kendo-grid-column-chooser", inputs: { autoSync: "autoSync", filterable: "filterable", showSelectAll: "showSelectAll", allowHideAll: "allowHideAll" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }
|
|
13535
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ColumnChooserComponent, isStandalone: true, selector: "kendo-grid-column-chooser", inputs: { autoSync: "autoSync", filterable: "filterable", showSelectAll: "showSelectAll", allowHideAll: "allowHideAll" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }], ngImport: i0, template: `
|
|
13482
13536
|
<button #anchor
|
|
13483
13537
|
kendoButton
|
|
13484
13538
|
type="button"
|
|
@@ -13536,7 +13590,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13536
13590
|
</ng-template>
|
|
13537
13591
|
`,
|
|
13538
13592
|
standalone: true,
|
|
13539
|
-
imports: [ButtonComponent,
|
|
13593
|
+
imports: [ButtonComponent, ColumnChooserContentComponent]
|
|
13540
13594
|
}]
|
|
13541
13595
|
}], ctorParameters: () => [{ type: ContextService }, { type: ColumnInfoService }, { type: i2.PopupService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { autoSync: [{
|
|
13542
13596
|
type: Input
|
|
@@ -13549,9 +13603,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13549
13603
|
}], anchor: [{
|
|
13550
13604
|
type: ViewChild,
|
|
13551
13605
|
args: ['anchor']
|
|
13552
|
-
}], columnList: [{
|
|
13553
|
-
type: ViewChild,
|
|
13554
|
-
args: ['columnList']
|
|
13555
13606
|
}] } });
|
|
13556
13607
|
|
|
13557
13608
|
/**
|
|
@@ -16362,6 +16413,10 @@ class ExcelComponent {
|
|
|
16362
16413
|
* Specifies if groups in the Excel file are collapsible.
|
|
16363
16414
|
*/
|
|
16364
16415
|
collapsible;
|
|
16416
|
+
/**
|
|
16417
|
+
* @hidden
|
|
16418
|
+
*/
|
|
16419
|
+
fileCreated = new EventEmitter();
|
|
16365
16420
|
/**
|
|
16366
16421
|
* @hidden
|
|
16367
16422
|
*/
|
|
@@ -16372,12 +16427,16 @@ class ExcelComponent {
|
|
|
16372
16427
|
this.ctx = ctx;
|
|
16373
16428
|
this.zone = zone;
|
|
16374
16429
|
this.saveSubscription = excelService.saveToExcel.subscribe(this.save.bind(this));
|
|
16430
|
+
this.ctx.excelComponent = this;
|
|
16375
16431
|
}
|
|
16376
16432
|
ngOnDestroy() {
|
|
16377
16433
|
this.saveSubscription.unsubscribe();
|
|
16378
16434
|
if (this.dataSubscription) {
|
|
16379
16435
|
this.dataSubscription.unsubscribe();
|
|
16380
16436
|
}
|
|
16437
|
+
if (this.ctx.excelComponent === this) {
|
|
16438
|
+
this.ctx.excelComponent = undefined;
|
|
16439
|
+
}
|
|
16381
16440
|
}
|
|
16382
16441
|
save(component) {
|
|
16383
16442
|
const data = (this.fetchData || fetchComponentData)(component);
|
|
@@ -16420,10 +16479,11 @@ class ExcelComponent {
|
|
|
16420
16479
|
forceProxy: this.forceProxy,
|
|
16421
16480
|
proxyURL: this.proxyURL
|
|
16422
16481
|
});
|
|
16482
|
+
this.fileCreated.emit();
|
|
16423
16483
|
});
|
|
16424
16484
|
}
|
|
16425
16485
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExcelComponent, deps: [{ token: ExcelService }, { token: ContextService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
16426
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ExcelComponent, isStandalone: true, selector: "kendo-grid-excel", inputs: { fileName: "fileName", filterable: "filterable", creator: "creator", date: "date", forceProxy: "forceProxy", proxyURL: "proxyURL", fetchData: "fetchData", paddingCellOptions: "paddingCellOptions", headerPaddingCellOptions: "headerPaddingCellOptions", collapsible: "collapsible" }, queries: [{ propertyName: "columns", predicate: ColumnBase$1, descendants: true }], ngImport: i0, template: ``, isInline: true });
|
|
16486
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ExcelComponent, isStandalone: true, selector: "kendo-grid-excel", inputs: { fileName: "fileName", filterable: "filterable", creator: "creator", date: "date", forceProxy: "forceProxy", proxyURL: "proxyURL", fetchData: "fetchData", paddingCellOptions: "paddingCellOptions", headerPaddingCellOptions: "headerPaddingCellOptions", collapsible: "collapsible" }, outputs: { fileCreated: "fileCreated" }, queries: [{ propertyName: "columns", predicate: ColumnBase$1, descendants: true }], ngImport: i0, template: ``, isInline: true });
|
|
16427
16487
|
}
|
|
16428
16488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ExcelComponent, decorators: [{
|
|
16429
16489
|
type: Component,
|
|
@@ -16452,6 +16512,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
16452
16512
|
type: Input
|
|
16453
16513
|
}], collapsible: [{
|
|
16454
16514
|
type: Input
|
|
16515
|
+
}], fileCreated: [{
|
|
16516
|
+
type: Output
|
|
16455
16517
|
}], columns: [{
|
|
16456
16518
|
type: ContentChildren,
|
|
16457
16519
|
args: [ColumnBase$1, { descendants: true }]
|
|
@@ -16892,11 +16954,17 @@ class PDFComponent extends PDFExportComponent {
|
|
|
16892
16954
|
this.drawSubscription = pdfService.drawPDF.subscribe(this.drawPDF.bind(this));
|
|
16893
16955
|
this.reset = this.reset.bind(this);
|
|
16894
16956
|
this.draw = this.draw.bind(this);
|
|
16957
|
+
if (this.ctx) {
|
|
16958
|
+
this.ctx.pdfComponent = this;
|
|
16959
|
+
}
|
|
16895
16960
|
}
|
|
16896
16961
|
ngOnDestroy() {
|
|
16897
16962
|
this.saveSubscription.unsubscribe();
|
|
16898
16963
|
this.drawSubscription.unsubscribe();
|
|
16899
16964
|
this.reset();
|
|
16965
|
+
if (this.ctx?.pdfComponent === this) {
|
|
16966
|
+
this.ctx.pdfComponent = undefined;
|
|
16967
|
+
}
|
|
16900
16968
|
}
|
|
16901
16969
|
/**
|
|
16902
16970
|
* @hidden
|
|
@@ -22896,8 +22964,8 @@ const packageMetadata = {
|
|
|
22896
22964
|
productName: 'Kendo UI for Angular',
|
|
22897
22965
|
productCode: 'KENDOUIANGULAR',
|
|
22898
22966
|
productCodes: ['KENDOUIANGULAR'],
|
|
22899
|
-
publishDate:
|
|
22900
|
-
version: '21.0.0
|
|
22967
|
+
publishDate: 1762934613,
|
|
22968
|
+
version: '21.0.0',
|
|
22901
22969
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
22902
22970
|
};
|
|
22903
22971
|
|
|
@@ -24069,6 +24137,34 @@ class RowReorderService {
|
|
|
24069
24137
|
getDraggedRow(data) {
|
|
24070
24138
|
return this.getDragRowPerElement(this.dragTarget, data);
|
|
24071
24139
|
}
|
|
24140
|
+
/**
|
|
24141
|
+
* Triggers row reordering programmatically via keyboard shortcut.
|
|
24142
|
+
* @param dragRowIndex - The index of the row to move
|
|
24143
|
+
* @param dropRowIndex - The index of the target row
|
|
24144
|
+
* @param dropPosition - The position relative to the target row ('before' or 'after')
|
|
24145
|
+
* @param data - The data array
|
|
24146
|
+
*/
|
|
24147
|
+
reorderViaKeyboard(dragRowIndex, dropRowIndex, dropPosition, data) {
|
|
24148
|
+
if (dropPosition === 'forbidden') {
|
|
24149
|
+
return;
|
|
24150
|
+
}
|
|
24151
|
+
const dragRow = this.createVirtualRowElement(dragRowIndex);
|
|
24152
|
+
const dropRow = this.createVirtualRowElement(dropRowIndex);
|
|
24153
|
+
this.lastDropPosition = dropPosition;
|
|
24154
|
+
const rowReorderArgs = this.rowReorderArgs(dragRow, dropRow, data);
|
|
24155
|
+
this.rowReorder.emit(rowReorderArgs);
|
|
24156
|
+
}
|
|
24157
|
+
createVirtualRowElement(rowIndex) {
|
|
24158
|
+
const virtualElement = {
|
|
24159
|
+
getAttribute: (attr) => {
|
|
24160
|
+
if (attr === 'data-kendo-grid-item-index') {
|
|
24161
|
+
return String(rowIndex);
|
|
24162
|
+
}
|
|
24163
|
+
return null;
|
|
24164
|
+
}
|
|
24165
|
+
};
|
|
24166
|
+
return virtualElement;
|
|
24167
|
+
}
|
|
24072
24168
|
rowReorderArgs(dragRow, dropRow, data) {
|
|
24073
24169
|
const dragRowData = this.getDragRowPerElement(dragRow, data);
|
|
24074
24170
|
const dropRowData = this.getDragRowPerElement(dropRow, data);
|
|
@@ -25495,17 +25591,28 @@ class ListComponent {
|
|
|
25495
25591
|
const shouldCalculatePageSize = isDocumentAvailable() && this.isVirtual && !isPresent(this.virtualPageSize) && (!isPresent(this.ctx.grid?.pageSize) || this.ctx.grid?.pageable);
|
|
25496
25592
|
const previousTotal = this.allItems.length;
|
|
25497
25593
|
this.allItems = this.dataMappingService.dataMapper(this.data, this.nonLockedColumnsToRender, this.lockedLeafColumns, this.detailTemplate, this.showFooter);
|
|
25498
|
-
if (!this.isVirtual || (this.isVirtual && !this.ctx.grid?.pageable && !this.ctx.grid?.group?.length)) {
|
|
25499
|
-
this.itemsToRender = this.allItems;
|
|
25500
|
-
}
|
|
25501
25594
|
const totalChanged = previousTotal !== this.allItems.length;
|
|
25595
|
+
const totalIncreased = this.allItems.length > previousTotal;
|
|
25502
25596
|
if (this.totalIsAllItems && totalChanged) {
|
|
25503
25597
|
this.scroller.reset(this.skipScroll);
|
|
25504
25598
|
this.scroller.total = this.allItems.length;
|
|
25599
|
+
this.itemsToRender = this.allItems.slice(this.scroller.virtualSkip, this.scroller.virtualSkip + this.virtualPageSize);
|
|
25505
25600
|
}
|
|
25506
25601
|
else if (totalChanged && !this.ctx.grid?.group?.length) {
|
|
25507
|
-
|
|
25508
|
-
this.
|
|
25602
|
+
// Preserve scroll position for non-virtual endless scrolling (scrollBottom event)
|
|
25603
|
+
if (!this.isVirtual && totalIncreased) {
|
|
25604
|
+
this.scroller.total = this.total;
|
|
25605
|
+
}
|
|
25606
|
+
else {
|
|
25607
|
+
this.scroller.reset(this.skipScroll);
|
|
25608
|
+
this.scroller.total = this.total;
|
|
25609
|
+
// Clear flags to allow viewport update on next change detection (virtual scrolling fix)
|
|
25610
|
+
this.skipScroll = false;
|
|
25611
|
+
this.scroller.scrollSyncing = false;
|
|
25612
|
+
}
|
|
25613
|
+
}
|
|
25614
|
+
if (!this.isVirtual || (this.isVirtual && !this.ctx.grid?.pageable && !this.ctx.grid?.group?.length)) {
|
|
25615
|
+
this.itemsToRender = this.allItems;
|
|
25509
25616
|
}
|
|
25510
25617
|
const rebindGroupedData = this.isVirtual && !totalChanged && this.ctx.grid?.group?.length && !this.rebindGroupedDataFlag;
|
|
25511
25618
|
if (rebindGroupedData) {
|
|
@@ -26629,6 +26736,18 @@ class GridMessages extends ComponentMessages {
|
|
|
26629
26736
|
* The success message dispayed in the AI Assistant Prompt Output Card's body.
|
|
26630
26737
|
*/
|
|
26631
26738
|
aiAssistantOutputCardBodyContent;
|
|
26739
|
+
/**
|
|
26740
|
+
* The message shown when AI selection requires the Grid selectable option.
|
|
26741
|
+
*/
|
|
26742
|
+
aiAssistantSelectionNotEnabled;
|
|
26743
|
+
/**
|
|
26744
|
+
* The message shown when AI selection requires row selection mode.
|
|
26745
|
+
*/
|
|
26746
|
+
aiAssistantSelectionRowModeRequired;
|
|
26747
|
+
/**
|
|
26748
|
+
* The message shown when AI selection requires cell selection mode.
|
|
26749
|
+
*/
|
|
26750
|
+
aiAssistantSelectionCellModeRequired;
|
|
26632
26751
|
/**
|
|
26633
26752
|
* The title of the AI Assistant Window maximize button.
|
|
26634
26753
|
*/
|
|
@@ -27067,7 +27186,7 @@ class GridMessages extends ComponentMessages {
|
|
|
27067
27186
|
*/
|
|
27068
27187
|
multiCheckboxFilterSelectedItemsCount;
|
|
27069
27188
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GridMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
27070
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: GridMessages, selector: "kendo-grid-messages-base", inputs: { groupPanelEmpty: "groupPanelEmpty", noRecords: "noRecords", pagerLabel: "pagerLabel", pagerFirstPage: "pagerFirstPage", pagerLastPage: "pagerLastPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerPage: "pagerPage", pagerItemsPerPage: "pagerItemsPerPage", pagerOf: "pagerOf", pagerItems: "pagerItems", pagerPageNumberInputTitle: "pagerPageNumberInputTitle", pagerInputLabel: "pagerInputLabel", pagerSelectPage: "pagerSelectPage", filter: "filter", filterInputLabel: "filterInputLabel", filterMenuTitle: "filterMenuTitle", filterMenuOperatorsDropDownLabel: "filterMenuOperatorsDropDownLabel", filterMenuLogicDropDownLabel: "filterMenuLogicDropDownLabel", filterCellOperatorLabel: "filterCellOperatorLabel", booleanFilterCellLabel: "booleanFilterCellLabel", aiAssistantApplyButtonText: "aiAssistantApplyButtonText", aiAssistantToolbarToolText: "aiAssistantToolbarToolText", aiAssistantWindowTitle: "aiAssistantWindowTitle", aiAssistantWindowCloseTitle: "aiAssistantWindowCloseTitle", aiAssistantOutputCardTitle: "aiAssistantOutputCardTitle", aiAssistantOutputCardBodyContent: "aiAssistantOutputCardBodyContent", aiAssistantWindowMaximizeTitle: "aiAssistantWindowMaximizeTitle", aiAssistantWindowMinimizeTitle: "aiAssistantWindowMinimizeTitle", aiAssistantWindowRestoreTitle: "aiAssistantWindowRestoreTitle", filterEqOperator: "filterEqOperator", filterNotEqOperator: "filterNotEqOperator", filterIsNullOperator: "filterIsNullOperator", filterIsNotNullOperator: "filterIsNotNullOperator", filterIsEmptyOperator: "filterIsEmptyOperator", filterIsNotEmptyOperator: "filterIsNotEmptyOperator", filterStartsWithOperator: "filterStartsWithOperator", filterContainsOperator: "filterContainsOperator", filterNotContainsOperator: "filterNotContainsOperator", filterEndsWithOperator: "filterEndsWithOperator", filterGteOperator: "filterGteOperator", filterGtOperator: "filterGtOperator", filterLteOperator: "filterLteOperator", filterLtOperator: "filterLtOperator", filterIsTrue: "filterIsTrue", filterIsFalse: "filterIsFalse", filterBooleanAll: "filterBooleanAll", adaptiveFilterOperatorsTitle: "adaptiveFilterOperatorsTitle", filterAfterOrEqualOperator: "filterAfterOrEqualOperator", filterAfterOperator: "filterAfterOperator", filterBeforeOperator: "filterBeforeOperator", filterBeforeOrEqualOperator: "filterBeforeOrEqualOperator", filterFilterButton: "filterFilterButton", filterClearButton: "filterClearButton", adaptiveCloseButtonTitle: "adaptiveCloseButtonTitle", adaptiveBackButtonTitle: "adaptiveBackButtonTitle", filterAndLogic: "filterAndLogic", filterOrLogic: "filterOrLogic", filterToolbarToolText: "filterToolbarToolText", loading: "loading", gridLabel: "gridLabel", columnMenu: "columnMenu", setColumnPosition: "setColumnPosition", columns: "columns", columnChooserSelectedColumnsCount: "columnChooserSelectedColumnsCount", columnsSubtitle: "columnsSubtitle", adaptiveFilterTitle: "adaptiveFilterTitle", adaptiveSortTitle: "adaptiveSortTitle", adaptiveGroupTitle: "adaptiveGroupTitle", filterClearAllButton: "filterClearAllButton", groupClearButton: "groupClearButton", sortClearButton: "sortClearButton", sortDoneButton: "sortDoneButton", groupDoneButton: "groupDoneButton", lock: "lock", unlock: "unlock", stick: "stick", unstick: "unstick", sortable: "sortable", sortAscending: "sortAscending", sortDescending: "sortDescending", autosizeThisColumn: "autosizeThisColumn", autosizeAllColumns: "autosizeAllColumns", sortedAscending: "sortedAscending", sortedDescending: "sortedDescending", sortedDefault: "sortedDefault", sortToolbarToolText: "sortToolbarToolText", columnsApply: "columnsApply", columnsReset: "columnsReset", detailExpand: "detailExpand", detailCollapse: "detailCollapse", filterDateToday: "filterDateToday", filterDateToggle: "filterDateToggle", filterNumericDecrement: "filterNumericDecrement", filterNumericIncrement: "filterNumericIncrement", selectionCheckboxLabel: "selectionCheckboxLabel", selectAllCheckboxLabel: "selectAllCheckboxLabel", groupCollapse: "groupCollapse", groupExpand: "groupExpand", topToolbarLabel: "topToolbarLabel", bottomToolbarLabel: "bottomToolbarLabel", editToolbarToolText: "editToolbarToolText", saveToolbarToolText: "saveToolbarToolText", addToolbarToolText: "addToolbarToolText", cancelToolbarToolText: "cancelToolbarToolText", removeToolbarToolText: "removeToolbarToolText", excelExportToolbarToolText: "excelExportToolbarToolText", pdfExportToolbarToolText: "pdfExportToolbarToolText", groupPanelLabel: "groupPanelLabel", dragRowHandleLabel: "dragRowHandleLabel", columnMenuFilterTabTitle: "columnMenuFilterTabTitle", columnMenuGeneralTabTitle: "columnMenuGeneralTabTitle", columnMenuColumnsTabTitle: "columnMenuColumnsTabTitle", groupChipMenuPrevious: "groupChipMenuPrevious", groupChipMenuNext: "groupChipMenuNext", groupToolbarToolText: "groupToolbarToolText", formValidationErrorText: "formValidationErrorText", removeConfirmationDialogTitle: "removeConfirmationDialogTitle", removeConfirmationDialogContent: "removeConfirmationDialogContent", removeConfirmationDialogConfirmText: "removeConfirmationDialogConfirmText", removeConfirmationDialogRejectText: "removeConfirmationDialogRejectText", externalEditingTitle: "externalEditingTitle", externalEditingAddTitle: "externalEditingAddTitle", externalEditingSaveText: "externalEditingSaveText", externalEditingCancelText: "externalEditingCancelText", multiCheckboxFilterSearchPlaceholder: "multiCheckboxFilterSearchPlaceholder", multiCheckboxFilterSelectAllLabel: "multiCheckboxFilterSelectAllLabel", multiCheckboxFilterSelectedItemsCount: "multiCheckboxFilterSelectedItemsCount" }, usesInheritance: true, ngImport: i0 });
|
|
27189
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: GridMessages, selector: "kendo-grid-messages-base", inputs: { groupPanelEmpty: "groupPanelEmpty", noRecords: "noRecords", pagerLabel: "pagerLabel", pagerFirstPage: "pagerFirstPage", pagerLastPage: "pagerLastPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerPage: "pagerPage", pagerItemsPerPage: "pagerItemsPerPage", pagerOf: "pagerOf", pagerItems: "pagerItems", pagerPageNumberInputTitle: "pagerPageNumberInputTitle", pagerInputLabel: "pagerInputLabel", pagerSelectPage: "pagerSelectPage", filter: "filter", filterInputLabel: "filterInputLabel", filterMenuTitle: "filterMenuTitle", filterMenuOperatorsDropDownLabel: "filterMenuOperatorsDropDownLabel", filterMenuLogicDropDownLabel: "filterMenuLogicDropDownLabel", filterCellOperatorLabel: "filterCellOperatorLabel", booleanFilterCellLabel: "booleanFilterCellLabel", aiAssistantApplyButtonText: "aiAssistantApplyButtonText", aiAssistantToolbarToolText: "aiAssistantToolbarToolText", aiAssistantWindowTitle: "aiAssistantWindowTitle", aiAssistantWindowCloseTitle: "aiAssistantWindowCloseTitle", aiAssistantOutputCardTitle: "aiAssistantOutputCardTitle", aiAssistantOutputCardBodyContent: "aiAssistantOutputCardBodyContent", aiAssistantSelectionNotEnabled: "aiAssistantSelectionNotEnabled", aiAssistantSelectionRowModeRequired: "aiAssistantSelectionRowModeRequired", aiAssistantSelectionCellModeRequired: "aiAssistantSelectionCellModeRequired", aiAssistantWindowMaximizeTitle: "aiAssistantWindowMaximizeTitle", aiAssistantWindowMinimizeTitle: "aiAssistantWindowMinimizeTitle", aiAssistantWindowRestoreTitle: "aiAssistantWindowRestoreTitle", filterEqOperator: "filterEqOperator", filterNotEqOperator: "filterNotEqOperator", filterIsNullOperator: "filterIsNullOperator", filterIsNotNullOperator: "filterIsNotNullOperator", filterIsEmptyOperator: "filterIsEmptyOperator", filterIsNotEmptyOperator: "filterIsNotEmptyOperator", filterStartsWithOperator: "filterStartsWithOperator", filterContainsOperator: "filterContainsOperator", filterNotContainsOperator: "filterNotContainsOperator", filterEndsWithOperator: "filterEndsWithOperator", filterGteOperator: "filterGteOperator", filterGtOperator: "filterGtOperator", filterLteOperator: "filterLteOperator", filterLtOperator: "filterLtOperator", filterIsTrue: "filterIsTrue", filterIsFalse: "filterIsFalse", filterBooleanAll: "filterBooleanAll", adaptiveFilterOperatorsTitle: "adaptiveFilterOperatorsTitle", filterAfterOrEqualOperator: "filterAfterOrEqualOperator", filterAfterOperator: "filterAfterOperator", filterBeforeOperator: "filterBeforeOperator", filterBeforeOrEqualOperator: "filterBeforeOrEqualOperator", filterFilterButton: "filterFilterButton", filterClearButton: "filterClearButton", adaptiveCloseButtonTitle: "adaptiveCloseButtonTitle", adaptiveBackButtonTitle: "adaptiveBackButtonTitle", filterAndLogic: "filterAndLogic", filterOrLogic: "filterOrLogic", filterToolbarToolText: "filterToolbarToolText", loading: "loading", gridLabel: "gridLabel", columnMenu: "columnMenu", setColumnPosition: "setColumnPosition", columns: "columns", columnChooserSelectedColumnsCount: "columnChooserSelectedColumnsCount", columnsSubtitle: "columnsSubtitle", adaptiveFilterTitle: "adaptiveFilterTitle", adaptiveSortTitle: "adaptiveSortTitle", adaptiveGroupTitle: "adaptiveGroupTitle", filterClearAllButton: "filterClearAllButton", groupClearButton: "groupClearButton", sortClearButton: "sortClearButton", sortDoneButton: "sortDoneButton", groupDoneButton: "groupDoneButton", lock: "lock", unlock: "unlock", stick: "stick", unstick: "unstick", sortable: "sortable", sortAscending: "sortAscending", sortDescending: "sortDescending", autosizeThisColumn: "autosizeThisColumn", autosizeAllColumns: "autosizeAllColumns", sortedAscending: "sortedAscending", sortedDescending: "sortedDescending", sortedDefault: "sortedDefault", sortToolbarToolText: "sortToolbarToolText", columnsApply: "columnsApply", columnsReset: "columnsReset", detailExpand: "detailExpand", detailCollapse: "detailCollapse", filterDateToday: "filterDateToday", filterDateToggle: "filterDateToggle", filterNumericDecrement: "filterNumericDecrement", filterNumericIncrement: "filterNumericIncrement", selectionCheckboxLabel: "selectionCheckboxLabel", selectAllCheckboxLabel: "selectAllCheckboxLabel", groupCollapse: "groupCollapse", groupExpand: "groupExpand", topToolbarLabel: "topToolbarLabel", bottomToolbarLabel: "bottomToolbarLabel", editToolbarToolText: "editToolbarToolText", saveToolbarToolText: "saveToolbarToolText", addToolbarToolText: "addToolbarToolText", cancelToolbarToolText: "cancelToolbarToolText", removeToolbarToolText: "removeToolbarToolText", excelExportToolbarToolText: "excelExportToolbarToolText", pdfExportToolbarToolText: "pdfExportToolbarToolText", groupPanelLabel: "groupPanelLabel", dragRowHandleLabel: "dragRowHandleLabel", columnMenuFilterTabTitle: "columnMenuFilterTabTitle", columnMenuGeneralTabTitle: "columnMenuGeneralTabTitle", columnMenuColumnsTabTitle: "columnMenuColumnsTabTitle", groupChipMenuPrevious: "groupChipMenuPrevious", groupChipMenuNext: "groupChipMenuNext", groupToolbarToolText: "groupToolbarToolText", formValidationErrorText: "formValidationErrorText", removeConfirmationDialogTitle: "removeConfirmationDialogTitle", removeConfirmationDialogContent: "removeConfirmationDialogContent", removeConfirmationDialogConfirmText: "removeConfirmationDialogConfirmText", removeConfirmationDialogRejectText: "removeConfirmationDialogRejectText", externalEditingTitle: "externalEditingTitle", externalEditingAddTitle: "externalEditingAddTitle", externalEditingSaveText: "externalEditingSaveText", externalEditingCancelText: "externalEditingCancelText", multiCheckboxFilterSearchPlaceholder: "multiCheckboxFilterSearchPlaceholder", multiCheckboxFilterSelectAllLabel: "multiCheckboxFilterSelectAllLabel", multiCheckboxFilterSelectedItemsCount: "multiCheckboxFilterSelectedItemsCount" }, usesInheritance: true, ngImport: i0 });
|
|
27071
27190
|
}
|
|
27072
27191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GridMessages, decorators: [{
|
|
27073
27192
|
type: Directive,
|
|
@@ -27129,6 +27248,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
27129
27248
|
type: Input
|
|
27130
27249
|
}], aiAssistantOutputCardBodyContent: [{
|
|
27131
27250
|
type: Input
|
|
27251
|
+
}], aiAssistantSelectionNotEnabled: [{
|
|
27252
|
+
type: Input
|
|
27253
|
+
}], aiAssistantSelectionRowModeRequired: [{
|
|
27254
|
+
type: Input
|
|
27255
|
+
}], aiAssistantSelectionCellModeRequired: [{
|
|
27256
|
+
type: Input
|
|
27132
27257
|
}], aiAssistantWindowMaximizeTitle: [{
|
|
27133
27258
|
type: Input
|
|
27134
27259
|
}], aiAssistantWindowMinimizeTitle: [{
|
|
@@ -32465,6 +32590,15 @@ class GridComponent {
|
|
|
32465
32590
|
i18n-aiAssistantOutputCardBodyContent="kendo.grid.aiAssistantOutputCardBodyContent|The success message dispayed in the AI Assistant Prompt Output Card's body"
|
|
32466
32591
|
aiAssistantOutputCardBodyContent="Operation is successful. Data is:"
|
|
32467
32592
|
|
|
32593
|
+
i18n-aiAssistantSelectionNotEnabled="kendo.grid.aiAssistantSelectionNotEnabled|The message shown when AI selection requires the Grid selectable option"
|
|
32594
|
+
aiAssistantSelectionNotEnabled="Selection can be applied only when the Grid selectable option is enabled."
|
|
32595
|
+
|
|
32596
|
+
i18n-aiAssistantSelectionRowModeRequired="kendo.grid.aiAssistantSelectionRowModeRequired|The message shown when AI selection requires row selection mode"
|
|
32597
|
+
aiAssistantSelectionRowModeRequired="Selection can be applied only when row selection mode is enabled."
|
|
32598
|
+
|
|
32599
|
+
i18n-aiAssistantSelectionCellModeRequired="kendo.grid.aiAssistantSelectionCellModeRequired|The message shown when AI selection requires cell selection mode"
|
|
32600
|
+
aiAssistantSelectionCellModeRequired="Selection can be applied only when cell selection mode is enabled."
|
|
32601
|
+
|
|
32468
32602
|
i18n-columnChooserSelectedColumnsCount="kendo.grid.columnChooserSelectedColumnsCount|The text displayed in the Column Chooser for the number of selected columns"
|
|
32469
32603
|
columnChooserSelectedColumnsCount="{{ '{selectedColumnsCount} Selected items' }}"
|
|
32470
32604
|
|
|
@@ -33334,6 +33468,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
33334
33468
|
i18n-aiAssistantOutputCardBodyContent="kendo.grid.aiAssistantOutputCardBodyContent|The success message dispayed in the AI Assistant Prompt Output Card's body"
|
|
33335
33469
|
aiAssistantOutputCardBodyContent="Operation is successful. Data is:"
|
|
33336
33470
|
|
|
33471
|
+
i18n-aiAssistantSelectionNotEnabled="kendo.grid.aiAssistantSelectionNotEnabled|The message shown when AI selection requires the Grid selectable option"
|
|
33472
|
+
aiAssistantSelectionNotEnabled="Selection can be applied only when the Grid selectable option is enabled."
|
|
33473
|
+
|
|
33474
|
+
i18n-aiAssistantSelectionRowModeRequired="kendo.grid.aiAssistantSelectionRowModeRequired|The message shown when AI selection requires row selection mode"
|
|
33475
|
+
aiAssistantSelectionRowModeRequired="Selection can be applied only when row selection mode is enabled."
|
|
33476
|
+
|
|
33477
|
+
i18n-aiAssistantSelectionCellModeRequired="kendo.grid.aiAssistantSelectionCellModeRequired|The message shown when AI selection requires cell selection mode"
|
|
33478
|
+
aiAssistantSelectionCellModeRequired="Selection can be applied only when cell selection mode is enabled."
|
|
33479
|
+
|
|
33337
33480
|
i18n-columnChooserSelectedColumnsCount="kendo.grid.columnChooserSelectedColumnsCount|The text displayed in the Column Chooser for the number of selected columns"
|
|
33338
33481
|
columnChooserSelectedColumnsCount="{{ '{selectedColumnsCount} Selected items' }}"
|
|
33339
33482
|
|
|
@@ -37387,7 +37530,7 @@ const DEFAULT_AI_REQUEST_OPTIONS = {
|
|
|
37387
37530
|
/**
|
|
37388
37531
|
* Represents the event data when the AI Assistant request completes successfully.
|
|
37389
37532
|
*/
|
|
37390
|
-
class
|
|
37533
|
+
class GridAIAssistantResponseSuccessEvent extends PreventableEvent$1 {
|
|
37391
37534
|
/**
|
|
37392
37535
|
* The HTTP response from the AI service.
|
|
37393
37536
|
*/
|
|
@@ -37400,7 +37543,7 @@ class GridToolbarAIResponseSuccessEvent extends PreventableEvent$1 {
|
|
|
37400
37543
|
/**
|
|
37401
37544
|
* Represents the event data when the AI Assistant request completes with an error.
|
|
37402
37545
|
*/
|
|
37403
|
-
class
|
|
37546
|
+
class GridAIAssistantResponseErrorEvent extends PreventableEvent$1 {
|
|
37404
37547
|
/**
|
|
37405
37548
|
* The HTTP error response from the AI service.
|
|
37406
37549
|
*/
|
|
@@ -37505,6 +37648,7 @@ class AiAssistantComponent {
|
|
|
37505
37648
|
http;
|
|
37506
37649
|
ctx;
|
|
37507
37650
|
columnInfoService;
|
|
37651
|
+
zone;
|
|
37508
37652
|
aiPrompt;
|
|
37509
37653
|
activeView = 0;
|
|
37510
37654
|
requestUrl;
|
|
@@ -37518,15 +37662,49 @@ class AiAssistantComponent {
|
|
|
37518
37662
|
currentRequestSubscription = null;
|
|
37519
37663
|
//Remove this when the AI Assistant has a built-in loading indicator
|
|
37520
37664
|
loadingOutput = { id: 'k-loading-item', output: '', prompt: '' };
|
|
37665
|
+
// flat columns used for highlight utilities (expects { field })
|
|
37521
37666
|
columns = [];
|
|
37667
|
+
leafColumns = [];
|
|
37668
|
+
// nested tree representing the actual Grid column components sent to the AI service
|
|
37669
|
+
columnsTree = [];
|
|
37522
37670
|
idCounter = 0;
|
|
37523
|
-
constructor(http, ctx, columnInfoService) {
|
|
37671
|
+
constructor(http, ctx, columnInfoService, zone) {
|
|
37524
37672
|
this.http = http;
|
|
37525
37673
|
this.ctx = ctx;
|
|
37526
37674
|
this.columnInfoService = columnInfoService;
|
|
37675
|
+
this.zone = zone;
|
|
37527
37676
|
}
|
|
37528
37677
|
ngAfterViewInit() {
|
|
37529
|
-
|
|
37678
|
+
// Build a nested GridColumnDescriptor tree based on the actual Grid columns structure.
|
|
37679
|
+
// This includes root columns and their nested children (for ColumnGroup and SpanColumn).
|
|
37680
|
+
const rootColumns = this.ctx?.grid?.columnList?.rootColumns() || [];
|
|
37681
|
+
const buildDescriptor = (col) => {
|
|
37682
|
+
const hasChildren = Boolean(col.hasChildren && col.childrenArray?.length);
|
|
37683
|
+
const descriptor = {
|
|
37684
|
+
id: col.id,
|
|
37685
|
+
field: col.field
|
|
37686
|
+
};
|
|
37687
|
+
if (hasChildren) {
|
|
37688
|
+
descriptor.header = col.displayTitle;
|
|
37689
|
+
descriptor.columns = col.childrenArray.map((c) => buildDescriptor(c));
|
|
37690
|
+
}
|
|
37691
|
+
// For special columns that don't have a field, emit an optional type token
|
|
37692
|
+
// so the AI service knows how to treat them (checkbox/command/reorder)
|
|
37693
|
+
if (!col.field) {
|
|
37694
|
+
if (isCheckboxColumn(col)) {
|
|
37695
|
+
descriptor.type = 'checkbox';
|
|
37696
|
+
}
|
|
37697
|
+
else if (col instanceof CommandColumnComponent) {
|
|
37698
|
+
descriptor.type = 'command';
|
|
37699
|
+
}
|
|
37700
|
+
}
|
|
37701
|
+
return descriptor;
|
|
37702
|
+
};
|
|
37703
|
+
this.columnsTree = rootColumns.map((col) => buildDescriptor(col));
|
|
37704
|
+
// Preserve a flat columns array (fields) for highlight utilities.
|
|
37705
|
+
// Use leafNamedColumns as the canonical list of leaf columns with display titles.
|
|
37706
|
+
this.leafColumns = this.columnInfoService.leafNamedColumns || [];
|
|
37707
|
+
this.columns = this.leafColumns.map((col) => ({ field: col.field }));
|
|
37530
37708
|
}
|
|
37531
37709
|
ngOnDestroy() {
|
|
37532
37710
|
this.unsubscribeCurrentRequest();
|
|
@@ -37550,7 +37728,8 @@ class AiAssistantComponent {
|
|
|
37550
37728
|
this.lastMessage = ev.prompt;
|
|
37551
37729
|
}
|
|
37552
37730
|
this.requestData = {
|
|
37553
|
-
|
|
37731
|
+
// send nested tree to AI service
|
|
37732
|
+
columns: this.columnsTree,
|
|
37554
37733
|
promptMessage: ev.prompt,
|
|
37555
37734
|
url: this.requestUrl,
|
|
37556
37735
|
requestOptions: {
|
|
@@ -37594,30 +37773,22 @@ class AiAssistantComponent {
|
|
|
37594
37773
|
this.aiToolDirective.emitOpenClose = true;
|
|
37595
37774
|
this.aiToolDirective.toggleWindow();
|
|
37596
37775
|
}
|
|
37597
|
-
const responseBody = response.body;
|
|
37598
|
-
const responseSuccessEvent = new
|
|
37776
|
+
const responseBody = response.body || { commands: [] };
|
|
37777
|
+
const responseSuccessEvent = new GridAIAssistantResponseSuccessEvent(response);
|
|
37599
37778
|
this.aiToolDirective.responseSuccess.emit(responseSuccessEvent);
|
|
37600
37779
|
if (responseSuccessEvent.isDefaultPrevented()) {
|
|
37601
37780
|
this.deleteLoadingOutput();
|
|
37602
37781
|
return;
|
|
37603
37782
|
}
|
|
37604
|
-
const
|
|
37605
|
-
|
|
37606
|
-
|
|
37607
|
-
|
|
37608
|
-
this.processFilterResponse(responseBody.filter);
|
|
37609
|
-
}
|
|
37610
|
-
if (isSortable && responseBody.sort) {
|
|
37611
|
-
this.processArrayResponse(responseBody.sort, this.ctx.grid.currentState.sort || [], (item) => item.field, (mergedArray) => this.ctx.grid.sortChange.next(mergedArray));
|
|
37612
|
-
}
|
|
37613
|
-
if (isGroupable && responseBody.group) {
|
|
37614
|
-
this.processArrayResponse(responseBody.group, this.ctx.grid.currentState.group || [], (item) => item.field, (mergedArray) => this.ctx.grid.groupChange.next(mergedArray));
|
|
37615
|
-
}
|
|
37616
|
-
if (this.ctx.highlightDirective && responseBody.highlight) {
|
|
37617
|
-
this.processHighlightResponse(responseBody.highlight);
|
|
37783
|
+
const messages = [];
|
|
37784
|
+
// Include optional top-level message from the response
|
|
37785
|
+
if (responseBody.message) {
|
|
37786
|
+
messages.push(responseBody.message);
|
|
37618
37787
|
}
|
|
37788
|
+
// Execute received commands sequentially and collect messages.
|
|
37789
|
+
this.processCommands(responseBody.commands || [], messages);
|
|
37619
37790
|
const responseContentStart = [`${this.ctx.localization.get('aiAssistantOutputCardBodyContent')} \n`];
|
|
37620
|
-
const responseContentBody =
|
|
37791
|
+
const responseContentBody = messages
|
|
37621
37792
|
.map((output, idx) => `${idx + 1} ${output}`)
|
|
37622
37793
|
.join('\n');
|
|
37623
37794
|
const output = {
|
|
@@ -37630,7 +37801,7 @@ class AiAssistantComponent {
|
|
|
37630
37801
|
this.aiToolDirective.promptOutputs.unshift(output);
|
|
37631
37802
|
}
|
|
37632
37803
|
handleError(error) {
|
|
37633
|
-
const responseErrorEvent = new
|
|
37804
|
+
const responseErrorEvent = new GridAIAssistantResponseErrorEvent(error);
|
|
37634
37805
|
this.aiToolDirective.responseError.emit(responseErrorEvent);
|
|
37635
37806
|
if (responseErrorEvent.isDefaultPrevented()) {
|
|
37636
37807
|
this.deleteLoadingOutput();
|
|
@@ -37667,12 +37838,468 @@ class AiAssistantComponent {
|
|
|
37667
37838
|
updateGrid(mergedArray);
|
|
37668
37839
|
}
|
|
37669
37840
|
}
|
|
37670
|
-
|
|
37671
|
-
if (
|
|
37672
|
-
|
|
37841
|
+
processCommands(commands, messages) {
|
|
37842
|
+
if (!commands?.length) {
|
|
37843
|
+
return;
|
|
37844
|
+
}
|
|
37845
|
+
const isFilterable = Boolean(this.ctx.grid.filterable);
|
|
37846
|
+
const isSortable = Boolean(this.ctx.grid.sortable);
|
|
37847
|
+
const isGroupable = Boolean(this.ctx.grid.groupable);
|
|
37848
|
+
const findColumnById = (id) => this.ctx.grid.columnList.toArray().find((c) => c.id === id);
|
|
37849
|
+
const updateColumnHierarchy = (column, updater) => {
|
|
37850
|
+
const changed = [];
|
|
37851
|
+
const queue = [column];
|
|
37852
|
+
while (queue.length) {
|
|
37853
|
+
const current = queue.shift();
|
|
37854
|
+
if (!current) {
|
|
37855
|
+
continue;
|
|
37856
|
+
}
|
|
37857
|
+
const didChange = updater(current);
|
|
37858
|
+
if (didChange) {
|
|
37859
|
+
changed.push(current);
|
|
37860
|
+
}
|
|
37861
|
+
if (current.hasChildren && current.childrenArray?.length) {
|
|
37862
|
+
queue.push(...current.childrenArray);
|
|
37863
|
+
}
|
|
37864
|
+
}
|
|
37865
|
+
return changed;
|
|
37866
|
+
};
|
|
37867
|
+
commands.forEach((cmd) => {
|
|
37868
|
+
let displayMessage = cmd.message || '';
|
|
37869
|
+
if (this.isColumnCommand(cmd.type)) {
|
|
37870
|
+
if (cmd.id) {
|
|
37871
|
+
const column = findColumnById(cmd.id);
|
|
37872
|
+
const replacement = this.getColumnReplacement(column);
|
|
37873
|
+
displayMessage = this.replaceQuotedColumnId(displayMessage, replacement);
|
|
37874
|
+
}
|
|
37875
|
+
}
|
|
37876
|
+
messages.push(displayMessage);
|
|
37877
|
+
switch (cmd.type) {
|
|
37878
|
+
case 'GridSort':
|
|
37879
|
+
if (!isSortable) {
|
|
37880
|
+
break;
|
|
37881
|
+
}
|
|
37882
|
+
// cmd.sort is a SortDescriptor - replace or merge with existing sort
|
|
37883
|
+
this.processArrayResponse([cmd.sort], this.ctx.grid.currentState.sort || [], (item) => item.field, (mergedArray) => this.ctx.grid.sortChange.next(mergedArray));
|
|
37884
|
+
break;
|
|
37885
|
+
case 'GridClearSort':
|
|
37886
|
+
if (!isSortable) {
|
|
37887
|
+
break;
|
|
37888
|
+
}
|
|
37889
|
+
this.ctx.grid.sortChange.next([]);
|
|
37890
|
+
break;
|
|
37891
|
+
case 'GridFilter':
|
|
37892
|
+
if (!isFilterable) {
|
|
37893
|
+
break;
|
|
37894
|
+
}
|
|
37895
|
+
this.processFilterResponse(cmd.filter);
|
|
37896
|
+
break;
|
|
37897
|
+
case 'GridClearFilter':
|
|
37898
|
+
if (!isFilterable) {
|
|
37899
|
+
break;
|
|
37900
|
+
}
|
|
37901
|
+
this.ctx.grid.filterChange.next(undefined);
|
|
37902
|
+
break;
|
|
37903
|
+
case 'GridGroup':
|
|
37904
|
+
if (!isGroupable) {
|
|
37905
|
+
break;
|
|
37906
|
+
}
|
|
37907
|
+
this.processArrayResponse([cmd.group], this.ctx.grid.currentState.group || [], (item) => item.field, (mergedArray) => this.ctx.grid.groupChange.next(mergedArray));
|
|
37908
|
+
break;
|
|
37909
|
+
case 'GridClearGroup':
|
|
37910
|
+
if (!isGroupable) {
|
|
37911
|
+
break;
|
|
37912
|
+
}
|
|
37913
|
+
this.ctx.grid.groupChange.next([]);
|
|
37914
|
+
break;
|
|
37915
|
+
case 'GridHighlight':
|
|
37916
|
+
if (!this.ctx.highlightDirective) {
|
|
37917
|
+
break;
|
|
37918
|
+
}
|
|
37919
|
+
this.processHighlightResponse([cmd.highlight]);
|
|
37920
|
+
break;
|
|
37921
|
+
case 'GridClearHighlight':
|
|
37922
|
+
if (!this.ctx.highlightDirective) {
|
|
37923
|
+
break;
|
|
37924
|
+
}
|
|
37925
|
+
this.ctx.highlightDirective['setState']([]);
|
|
37926
|
+
break;
|
|
37927
|
+
case 'GridSelect': {
|
|
37928
|
+
this.processSelectionResponse([cmd.select], messages);
|
|
37929
|
+
break;
|
|
37930
|
+
}
|
|
37931
|
+
case 'GridClearSelect': {
|
|
37932
|
+
const selectionInstance = this.getSelectionInstance();
|
|
37933
|
+
if (!selectionInstance) {
|
|
37934
|
+
this.updateLastMessage(messages, this.ctx.localization?.get('aiAssistantSelectionNotEnabled'));
|
|
37935
|
+
break;
|
|
37936
|
+
}
|
|
37937
|
+
this.applySelectionState(selectionInstance, []);
|
|
37938
|
+
break;
|
|
37939
|
+
}
|
|
37940
|
+
case 'GridColumnResize': {
|
|
37941
|
+
const col = findColumnById(cmd.id);
|
|
37942
|
+
if (!col) {
|
|
37943
|
+
break;
|
|
37944
|
+
}
|
|
37945
|
+
// parse size (accept numeric or strings like '200px')
|
|
37946
|
+
let newWidth;
|
|
37947
|
+
if (typeof cmd.size === 'number') {
|
|
37948
|
+
newWidth = cmd.size;
|
|
37949
|
+
}
|
|
37950
|
+
else if (typeof cmd.size === 'string') {
|
|
37951
|
+
const numericPart = parseFloat(cmd.size);
|
|
37952
|
+
if (!isNaN(numericPart)) {
|
|
37953
|
+
newWidth = numericPart;
|
|
37954
|
+
}
|
|
37955
|
+
}
|
|
37956
|
+
if (typeof newWidth === 'number') {
|
|
37957
|
+
const oldWidth = col.width;
|
|
37958
|
+
// set the column width (ColumnBase.width setter handles string -> number)
|
|
37959
|
+
col.width = newWidth;
|
|
37960
|
+
// emit columnResize event with ColumnResizeArgs[]
|
|
37961
|
+
const args = [{ column: col, oldWidth: oldWidth, newWidth: newWidth }];
|
|
37962
|
+
this.ctx.grid.columnResize.emit(args);
|
|
37963
|
+
}
|
|
37964
|
+
break;
|
|
37965
|
+
}
|
|
37966
|
+
case 'GridColumnReorder': {
|
|
37967
|
+
const col = findColumnById(cmd.id);
|
|
37968
|
+
if (!col) {
|
|
37969
|
+
break;
|
|
37970
|
+
}
|
|
37971
|
+
const newPosition = Number(cmd.position);
|
|
37972
|
+
if (!isNaN(newPosition) && newPosition >= 0) {
|
|
37973
|
+
this.changeColumnPosition(col, newPosition);
|
|
37974
|
+
}
|
|
37975
|
+
break;
|
|
37976
|
+
}
|
|
37977
|
+
case 'GridColumnShow':
|
|
37978
|
+
case 'GridColumnHide': {
|
|
37979
|
+
const col = findColumnById(cmd.id);
|
|
37980
|
+
if (!col) {
|
|
37981
|
+
break;
|
|
37982
|
+
}
|
|
37983
|
+
const targetHidden = cmd.type === 'GridColumnHide';
|
|
37984
|
+
const changed = updateColumnHierarchy(col, (current) => {
|
|
37985
|
+
if (current.hidden === targetHidden) {
|
|
37986
|
+
return false;
|
|
37987
|
+
}
|
|
37988
|
+
current.hidden = targetHidden;
|
|
37989
|
+
return true;
|
|
37990
|
+
});
|
|
37991
|
+
if (changed.length) {
|
|
37992
|
+
this.columnInfoService.changeVisibility(changed);
|
|
37993
|
+
}
|
|
37994
|
+
break;
|
|
37995
|
+
}
|
|
37996
|
+
case 'GridColumnLock':
|
|
37997
|
+
case 'GridColumnUnlock': {
|
|
37998
|
+
const col = findColumnById(cmd.id);
|
|
37999
|
+
if (!col) {
|
|
38000
|
+
break;
|
|
38001
|
+
}
|
|
38002
|
+
const targetLocked = cmd.type === 'GridColumnLock';
|
|
38003
|
+
const changed = updateColumnHierarchy(col, (current) => {
|
|
38004
|
+
if (current.locked === targetLocked) {
|
|
38005
|
+
return false;
|
|
38006
|
+
}
|
|
38007
|
+
current.locked = targetLocked;
|
|
38008
|
+
return true;
|
|
38009
|
+
});
|
|
38010
|
+
if (changed.length) {
|
|
38011
|
+
this.columnInfoService.changeLocked(changed);
|
|
38012
|
+
}
|
|
38013
|
+
break;
|
|
38014
|
+
}
|
|
38015
|
+
case 'GridPage': {
|
|
38016
|
+
this.processPageCommand(cmd);
|
|
38017
|
+
break;
|
|
38018
|
+
}
|
|
38019
|
+
case 'GridPageSize': {
|
|
38020
|
+
this.processPageSizeCommand(cmd);
|
|
38021
|
+
break;
|
|
38022
|
+
}
|
|
38023
|
+
case 'GridExportExcel': {
|
|
38024
|
+
this.runExportWithFileName(this.ctx.excelComponent, cmd.fileName, () => this.ctx.grid.saveAsExcel());
|
|
38025
|
+
break;
|
|
38026
|
+
}
|
|
38027
|
+
case 'GridExportPDF': {
|
|
38028
|
+
this.runExportWithFileName(this.ctx.pdfComponent, cmd.fileName, () => this.ctx.grid.emitPDFExportEvent());
|
|
38029
|
+
break;
|
|
38030
|
+
}
|
|
38031
|
+
default:
|
|
38032
|
+
// Unknown command - ignore
|
|
38033
|
+
break;
|
|
38034
|
+
}
|
|
38035
|
+
});
|
|
38036
|
+
}
|
|
38037
|
+
runExportWithFileName(component, fileName, action) {
|
|
38038
|
+
if (!component || !fileName) {
|
|
38039
|
+
action();
|
|
38040
|
+
return;
|
|
38041
|
+
}
|
|
38042
|
+
const previousFileName = component.fileName;
|
|
38043
|
+
component.fileName = fileName;
|
|
38044
|
+
action();
|
|
38045
|
+
const isExcel = component === this.ctx.excelComponent;
|
|
38046
|
+
if (isExcel) {
|
|
38047
|
+
this.zone.runOutsideAngular(() => {
|
|
38048
|
+
this.ctx.excelComponent.fileCreated.subscribe(() => {
|
|
38049
|
+
component.fileName = previousFileName;
|
|
38050
|
+
});
|
|
38051
|
+
});
|
|
38052
|
+
}
|
|
38053
|
+
else {
|
|
38054
|
+
component.fileName = previousFileName;
|
|
38055
|
+
}
|
|
38056
|
+
}
|
|
38057
|
+
processPageCommand(command) {
|
|
38058
|
+
const pageSize = this.getCurrentPageSizeValue();
|
|
38059
|
+
if (!isPresent$1(pageSize) || pageSize <= 0) {
|
|
38060
|
+
return;
|
|
38061
|
+
}
|
|
38062
|
+
const total = this.getTotalItemsCount();
|
|
38063
|
+
const requestedPage = Number(command.page);
|
|
38064
|
+
let targetPage = Number.isFinite(requestedPage) ? Math.floor(requestedPage) : 1;
|
|
38065
|
+
if (targetPage < 1) {
|
|
38066
|
+
targetPage = 1;
|
|
38067
|
+
}
|
|
38068
|
+
if (isPresent$1(total) && pageSize > 0) {
|
|
38069
|
+
const maxPage = Math.max(1, Math.ceil(total / pageSize));
|
|
38070
|
+
targetPage = Math.min(targetPage, maxPage);
|
|
38071
|
+
}
|
|
38072
|
+
const skip = (targetPage - 1) * pageSize;
|
|
38073
|
+
this.emitGridPageChange(skip, pageSize);
|
|
38074
|
+
}
|
|
38075
|
+
processPageSizeCommand(command) {
|
|
38076
|
+
const rawPageSize = Number(command.pageSize);
|
|
38077
|
+
if (!Number.isFinite(rawPageSize)) {
|
|
38078
|
+
return;
|
|
38079
|
+
}
|
|
38080
|
+
const newPageSize = Math.max(1, Math.floor(rawPageSize));
|
|
38081
|
+
const skip = Math.max(0, this.ctx.grid?.skip ?? 0);
|
|
38082
|
+
this.ensurePageSizeOption(newPageSize);
|
|
38083
|
+
this.emitGridPageChange(skip, newPageSize);
|
|
38084
|
+
}
|
|
38085
|
+
emitGridPageChange(skip, take) {
|
|
38086
|
+
const grid = this.ctx.grid;
|
|
38087
|
+
const normalizedSkip = Math.max(0, Math.floor(skip));
|
|
38088
|
+
const normalizedTake = Math.max(1, Math.floor(take));
|
|
38089
|
+
grid.skip = normalizedSkip;
|
|
38090
|
+
grid.pageSize = normalizedTake;
|
|
38091
|
+
grid.pageChange.emit({ skip: normalizedSkip, take: normalizedTake });
|
|
38092
|
+
}
|
|
38093
|
+
ensurePageSizeOption(pageSize) {
|
|
38094
|
+
const grid = this.ctx.grid;
|
|
38095
|
+
if (!grid) {
|
|
38096
|
+
return;
|
|
38097
|
+
}
|
|
38098
|
+
const pageable = grid.pageable;
|
|
38099
|
+
if (!pageable || typeof pageable === 'boolean') {
|
|
38100
|
+
return;
|
|
38101
|
+
}
|
|
38102
|
+
const pageSizes = pageable.pageSizes;
|
|
38103
|
+
if (!Array.isArray(pageSizes) || pageSizes.length === 0) {
|
|
38104
|
+
return;
|
|
38105
|
+
}
|
|
38106
|
+
if (pageSizes.includes(pageSize)) {
|
|
37673
38107
|
return;
|
|
37674
38108
|
}
|
|
37675
|
-
const
|
|
38109
|
+
const uniqueSizes = [pageSize, ...pageSizes.filter(size => size !== pageSize)];
|
|
38110
|
+
grid.pageable = {
|
|
38111
|
+
...pageable,
|
|
38112
|
+
pageSizes: uniqueSizes
|
|
38113
|
+
};
|
|
38114
|
+
const changeDetector = grid?.changeDetectorRef;
|
|
38115
|
+
if (changeDetector && typeof changeDetector.markForCheck === 'function') {
|
|
38116
|
+
changeDetector.markForCheck();
|
|
38117
|
+
}
|
|
38118
|
+
}
|
|
38119
|
+
getCurrentPageSizeValue() {
|
|
38120
|
+
const grid = this.ctx.grid;
|
|
38121
|
+
if (!grid) {
|
|
38122
|
+
return null;
|
|
38123
|
+
}
|
|
38124
|
+
const candidates = [grid.pageSize, grid.currentState?.take, this.ctx.dataBindingDirective?.['state']?.take];
|
|
38125
|
+
for (const candidate of candidates) {
|
|
38126
|
+
if (typeof candidate === 'number' && candidate > 0) {
|
|
38127
|
+
return candidate;
|
|
38128
|
+
}
|
|
38129
|
+
}
|
|
38130
|
+
const pageable = grid.pageable;
|
|
38131
|
+
if (pageable && typeof pageable === 'object' && Array.isArray(pageable.pageSizes)) {
|
|
38132
|
+
const numericSize = pageable.pageSizes.find(size => typeof size === 'number' && size > 0);
|
|
38133
|
+
if (numericSize) {
|
|
38134
|
+
return numericSize;
|
|
38135
|
+
}
|
|
38136
|
+
}
|
|
38137
|
+
const originalData = this.ctx.dataBindingDirective?.['originalData'];
|
|
38138
|
+
if (Array.isArray(originalData) && originalData.length > 0) {
|
|
38139
|
+
return originalData.length;
|
|
38140
|
+
}
|
|
38141
|
+
return null;
|
|
38142
|
+
}
|
|
38143
|
+
getTotalItemsCount() {
|
|
38144
|
+
const grid = this.ctx.grid;
|
|
38145
|
+
if (!grid) {
|
|
38146
|
+
return null;
|
|
38147
|
+
}
|
|
38148
|
+
const gridData = grid.data;
|
|
38149
|
+
if (gridData && typeof gridData.total === 'number') {
|
|
38150
|
+
return gridData.total;
|
|
38151
|
+
}
|
|
38152
|
+
const view = grid.view;
|
|
38153
|
+
if (view && typeof view.total === 'number') {
|
|
38154
|
+
return view.total;
|
|
38155
|
+
}
|
|
38156
|
+
const originalData = this.ctx.dataBindingDirective?.['originalData'];
|
|
38157
|
+
if (Array.isArray(originalData)) {
|
|
38158
|
+
return originalData.length;
|
|
38159
|
+
}
|
|
38160
|
+
return null;
|
|
38161
|
+
}
|
|
38162
|
+
getSelectionInstance() {
|
|
38163
|
+
const selectionDirective = this.ctx.grid?.selectionDirective;
|
|
38164
|
+
if (selectionDirective && typeof selectionDirective === 'object') {
|
|
38165
|
+
return selectionDirective;
|
|
38166
|
+
}
|
|
38167
|
+
const defaultSelection = this.ctx.grid?.defaultSelection;
|
|
38168
|
+
if (defaultSelection && typeof defaultSelection === 'object') {
|
|
38169
|
+
return defaultSelection;
|
|
38170
|
+
}
|
|
38171
|
+
return null;
|
|
38172
|
+
}
|
|
38173
|
+
updateLastMessage(messages, newMessage) {
|
|
38174
|
+
if (!messages.length) {
|
|
38175
|
+
return;
|
|
38176
|
+
}
|
|
38177
|
+
messages[messages.length - 1] = newMessage;
|
|
38178
|
+
}
|
|
38179
|
+
getHighlightItems(descriptors) {
|
|
38180
|
+
if (!descriptors?.length) {
|
|
38181
|
+
return [];
|
|
38182
|
+
}
|
|
38183
|
+
const data = this.ctx.dataBindingDirective?.['originalData'] || [];
|
|
38184
|
+
return highlightBy(data, descriptors, this.columns);
|
|
38185
|
+
}
|
|
38186
|
+
processSelectionResponse(selection, messages) {
|
|
38187
|
+
const selectionInstance = this.getSelectionInstance();
|
|
38188
|
+
if (!selectionInstance) {
|
|
38189
|
+
this.updateLastMessage(messages, this.ctx.localization?.get('aiAssistantSelectionNotEnabled'));
|
|
38190
|
+
return;
|
|
38191
|
+
}
|
|
38192
|
+
const descriptors = (selection || []).filter((descriptor) => Boolean(descriptor));
|
|
38193
|
+
if (descriptors.length === 0) {
|
|
38194
|
+
this.applySelectionState(selectionInstance, []);
|
|
38195
|
+
return;
|
|
38196
|
+
}
|
|
38197
|
+
const highlightItems = this.getHighlightItems(descriptors);
|
|
38198
|
+
if (!highlightItems.length) {
|
|
38199
|
+
this.applySelectionState(selectionInstance, []);
|
|
38200
|
+
return;
|
|
38201
|
+
}
|
|
38202
|
+
const hasCellSelections = highlightItems.some(item => isPresent$1(item.columnKey));
|
|
38203
|
+
const hasRowSelections = highlightItems.some(item => !isPresent$1(item.columnKey));
|
|
38204
|
+
const isCellMode = selectionInstance.isCellSelectionMode;
|
|
38205
|
+
if ((!isCellMode && hasCellSelections) || (isCellMode && hasRowSelections)) {
|
|
38206
|
+
const key = isCellMode ? 'aiAssistantSelectionRowModeRequired' : 'aiAssistantSelectionCellModeRequired';
|
|
38207
|
+
this.updateLastMessage(messages, this.ctx.localization?.get(key));
|
|
38208
|
+
return;
|
|
38209
|
+
}
|
|
38210
|
+
const selectionState = this.mapHighlightItemsToSelection(selectionInstance, highlightItems, isCellMode);
|
|
38211
|
+
this.applySelectionState(selectionInstance, selectionState);
|
|
38212
|
+
}
|
|
38213
|
+
mapHighlightItemsToSelection(selectionInstance, highlightItems, isCellMode) {
|
|
38214
|
+
const data = this.ctx.dataBindingDirective?.['originalData'] || [];
|
|
38215
|
+
if (isCellMode) {
|
|
38216
|
+
const mapped = highlightItems
|
|
38217
|
+
.filter(item => isPresent$1(item.itemKey) && isPresent$1(item.columnKey))
|
|
38218
|
+
.map(item => {
|
|
38219
|
+
const rowIndex = item.itemKey;
|
|
38220
|
+
const columnIndex = item.columnKey;
|
|
38221
|
+
const dataItem = data[rowIndex];
|
|
38222
|
+
if (!isPresent$1(dataItem)) {
|
|
38223
|
+
return null;
|
|
38224
|
+
}
|
|
38225
|
+
if (typeof selectionInstance['getSelectionItem'] === 'function') {
|
|
38226
|
+
const columnComponent = this.leafColumns[columnIndex];
|
|
38227
|
+
const selectionItem = selectionInstance['getSelectionItem']({ dataItem, index: rowIndex }, columnComponent, columnIndex);
|
|
38228
|
+
if (selectionItem && isPresent$1(selectionItem.itemKey) && isPresent$1(selectionItem.columnKey)) {
|
|
38229
|
+
return selectionItem;
|
|
38230
|
+
}
|
|
38231
|
+
return null;
|
|
38232
|
+
}
|
|
38233
|
+
const itemKey = typeof selectionInstance.getItemKey === 'function'
|
|
38234
|
+
? selectionInstance.getItemKey({ dataItem, index: rowIndex })
|
|
38235
|
+
: rowIndex;
|
|
38236
|
+
return isPresent$1(itemKey) ? { itemKey, columnKey: columnIndex } : null;
|
|
38237
|
+
})
|
|
38238
|
+
.filter((item) => isPresent$1(item));
|
|
38239
|
+
return mapped.filter((item, index, self) => self.findIndex(other => other.itemKey === item.itemKey && other.columnKey === item.columnKey) === index);
|
|
38240
|
+
}
|
|
38241
|
+
const rowKeys = highlightItems
|
|
38242
|
+
.filter(item => isPresent$1(item.itemKey))
|
|
38243
|
+
.map(item => {
|
|
38244
|
+
const rowIndex = item.itemKey;
|
|
38245
|
+
const dataItem = data[rowIndex];
|
|
38246
|
+
if (!isPresent$1(dataItem)) {
|
|
38247
|
+
return null;
|
|
38248
|
+
}
|
|
38249
|
+
if (typeof selectionInstance.getItemKey === 'function') {
|
|
38250
|
+
return selectionInstance.getItemKey({ dataItem, index: rowIndex });
|
|
38251
|
+
}
|
|
38252
|
+
return rowIndex;
|
|
38253
|
+
})
|
|
38254
|
+
.filter(isPresent$1);
|
|
38255
|
+
return Array.from(new Set(rowKeys));
|
|
38256
|
+
}
|
|
38257
|
+
applySelectionState(selectionInstance, selectionState) {
|
|
38258
|
+
selectionInstance.selectedKeys = selectionState;
|
|
38259
|
+
if (typeof selectionInstance['setState'] === 'function') {
|
|
38260
|
+
selectionInstance['setState'](selectionState);
|
|
38261
|
+
}
|
|
38262
|
+
const changeDetector = selectionInstance['cd'];
|
|
38263
|
+
if (changeDetector && typeof changeDetector.markForCheck === 'function') {
|
|
38264
|
+
changeDetector.markForCheck();
|
|
38265
|
+
}
|
|
38266
|
+
if (typeof selectionInstance['notifyChange'] === 'function') {
|
|
38267
|
+
selectionInstance['notifyChange']();
|
|
38268
|
+
}
|
|
38269
|
+
}
|
|
38270
|
+
replaceQuotedColumnId(message, replacement) {
|
|
38271
|
+
if (!replacement) {
|
|
38272
|
+
const columnIdPattern = /(?:"|")(k-grid\d+-col\d+)(?:"|")\s*/g;
|
|
38273
|
+
return message.replace(columnIdPattern, '').replace(/\s{2,}/g, ' ').trim();
|
|
38274
|
+
}
|
|
38275
|
+
const columnIdPattern = /(?:"|")(k-grid\d+-col\d+)(?:"|")/g;
|
|
38276
|
+
return message.replace(columnIdPattern, (match) => {
|
|
38277
|
+
const isEncoded = match.startsWith('"');
|
|
38278
|
+
return isEncoded ? `"${replacement}"` : `"${replacement}"`;
|
|
38279
|
+
});
|
|
38280
|
+
}
|
|
38281
|
+
isColumnCommand(type) {
|
|
38282
|
+
return type === 'GridColumnResize' ||
|
|
38283
|
+
type === 'GridColumnReorder' ||
|
|
38284
|
+
type === 'GridColumnShow' ||
|
|
38285
|
+
type === 'GridColumnHide' ||
|
|
38286
|
+
type === 'GridColumnLock' ||
|
|
38287
|
+
type === 'GridColumnUnlock';
|
|
38288
|
+
}
|
|
38289
|
+
getColumnReplacement(column) {
|
|
38290
|
+
if (!column) {
|
|
38291
|
+
return '';
|
|
38292
|
+
}
|
|
38293
|
+
if (column.title && String(column.title).trim()) {
|
|
38294
|
+
return String(column.title).trim();
|
|
38295
|
+
}
|
|
38296
|
+
if (column.field && String(column.field).trim()) {
|
|
38297
|
+
return String(column.field).trim();
|
|
38298
|
+
}
|
|
38299
|
+
return '';
|
|
38300
|
+
}
|
|
38301
|
+
processHighlightResponse(highlight) {
|
|
38302
|
+
const highlightedItems = this.getHighlightItems(highlight);
|
|
37676
38303
|
this.ctx.highlightDirective['setState'](highlightedItems);
|
|
37677
38304
|
}
|
|
37678
38305
|
processFilterResponse(filter) {
|
|
@@ -37696,7 +38323,29 @@ class AiAssistantComponent {
|
|
|
37696
38323
|
this.ctx.grid.filterChange.next(mergedFilter);
|
|
37697
38324
|
}
|
|
37698
38325
|
}
|
|
37699
|
-
|
|
38326
|
+
changeColumnPosition(column, newPosition) {
|
|
38327
|
+
const grid = this.ctx.grid;
|
|
38328
|
+
if (!grid?.columns) {
|
|
38329
|
+
return;
|
|
38330
|
+
}
|
|
38331
|
+
const currentColumns = grid.columns.toArray();
|
|
38332
|
+
const currentIndex = currentColumns.findIndex(col => col === column);
|
|
38333
|
+
if (currentIndex === -1) {
|
|
38334
|
+
return;
|
|
38335
|
+
}
|
|
38336
|
+
if (newPosition < 0 || newPosition >= currentColumns.length || currentIndex === newPosition) {
|
|
38337
|
+
return;
|
|
38338
|
+
}
|
|
38339
|
+
const [removedColumn] = currentColumns.splice(currentIndex, 1);
|
|
38340
|
+
currentColumns.splice(newPosition, 0, removedColumn);
|
|
38341
|
+
grid.columns.reset(currentColumns);
|
|
38342
|
+
grid.columnReorder.emit([{
|
|
38343
|
+
column: column,
|
|
38344
|
+
oldIndex: currentIndex,
|
|
38345
|
+
newIndex: newPosition
|
|
38346
|
+
}]);
|
|
38347
|
+
}
|
|
38348
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AiAssistantComponent, deps: [{ token: i1$8.HttpClient }, { token: ContextService }, { token: ColumnInfoService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
37700
38349
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AiAssistantComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "aiPrompt", first: true, predicate: AIPromptComponent, descendants: true }], ngImport: i0, template: `
|
|
37701
38350
|
<kendo-aiprompt
|
|
37702
38351
|
#aiPrompt
|
|
@@ -37792,7 +38441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
37792
38441
|
</kendo-aiprompt>
|
|
37793
38442
|
`
|
|
37794
38443
|
}]
|
|
37795
|
-
}], ctorParameters: () => [{ type: i1$8.HttpClient }, { type: ContextService }, { type: ColumnInfoService }], propDecorators: { aiPrompt: [{
|
|
38444
|
+
}], ctorParameters: () => [{ type: i1$8.HttpClient }, { type: ContextService }, { type: ColumnInfoService }, { type: i0.NgZone }], propDecorators: { aiPrompt: [{
|
|
37796
38445
|
type: ViewChild,
|
|
37797
38446
|
args: [AIPromptComponent]
|
|
37798
38447
|
}] } });
|
|
@@ -38629,5 +39278,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
38629
39278
|
* Generated bundle index. Do not edit.
|
|
38630
39279
|
*/
|
|
38631
39280
|
|
|
38632
|
-
export { AIAssistantToolbarDirective, AddCommandDirective, AddCommandToolbarDirective, AfterEqFilterOperatorComponent, AfterFilterOperatorComponent, AutoCompleteFilterCellComponent, BaseFilterCellComponent, BeforeEqFilterOperatorComponent, BeforeFilterOperatorComponent, BooleanFilterCellComponent, BooleanFilterComponent, BooleanFilterMenuComponent, BooleanFilterRadioButtonDirective, BrowserSupportService, CELL_CONTEXT, CancelCommandDirective, CancelCommandToolbarDirective, CellCloseEvent, CellComponent, CellLoadingTemplateDirective, CellSelectionAggregateService, CellSelectionService, CellTemplateDirective, ChangeNotificationService, CheckboxColumnComponent, ColGroupComponent, ColumnBase, ColumnChooserComponent, ColumnChooserToolbarDirective, ColumnComponent, ColumnGroupComponent, ColumnHandleDirective, ColumnInfoService, ColumnListComponent, ColumnLockedChangeEvent, ColumnMenuAutoSizeAllColumnsComponent, ColumnMenuAutoSizeColumnComponent, ColumnMenuChooserComponent, ColumnMenuComponent, ColumnMenuContainerComponent, ColumnMenuFilterComponent, ColumnMenuItemComponent, ColumnMenuItemContentTemplateDirective, ColumnMenuItemDirective, ColumnMenuLockComponent, ColumnMenuPositionComponent, ColumnMenuService, ColumnMenuSortComponent, ColumnMenuStickComponent, ColumnMenuTemplateDirective, ColumnReorderEvent, ColumnReorderService, ColumnResizingService, ColumnStickyChangeEvent, ColumnVisibilityChangeEvent, ColumnsContainer, CommandColumnComponent, ContainsFilterOperatorComponent, ContextService, CustomMessagesComponent, DEFAULT_AI_REQUEST_OPTIONS, DEFAULT_SCROLLER_FACTORY, DataBindingDirective, DateFilterCellComponent, DateFilterComponent, DateFilterMenuComponent, DateFilterMenuInputComponent, DetailCollapseEvent, DetailExpandEvent, DetailTemplateDirective, DetailsService, DoesNotContainFilterOperatorComponent, DomEventsService, DragAndDropService, DragHintService, DropCueService, EditCommandDirective, EditCommandToolbarDirective, EditService as EditServiceClass, EditTemplateDirective, EditingDirectiveBase, EndsWithFilterOperatorComponent, EqualFilterOperatorComponent, ExcelCommandDirective, ExcelCommandToolbarDirective, ExcelComponent, ExcelExportEvent, ExcelModule, ExcelService, ExpandDetailsDirective, ExpandGroupDirective, ExternalEditingDirective, FieldAccessorPipe, FilterCellComponent, FilterCellHostDirective, FilterCellOperatorsComponent, FilterCellTemplateDirective, FilterCellWrapperComponent, FilterCommandToolbarDirective, FilterInputDirective, FilterMenuComponent, FilterMenuContainerComponent, FilterMenuDropDownListDirective, FilterMenuHostDirective, FilterMenuInputWrapperComponent, FilterMenuTemplateDirective, FilterRowComponent, FilterService, FocusRoot, FocusableDirective, FooterComponent, FooterTemplateDirective, GreaterFilterOperatorComponent, GreaterOrEqualToFilterOperatorComponent, GridClipboardDirective, GridComponent, GridModule, GridSpacerComponent, GridTableDirective,
|
|
39281
|
+
export { AIAssistantToolbarDirective, AddCommandDirective, AddCommandToolbarDirective, AfterEqFilterOperatorComponent, AfterFilterOperatorComponent, AutoCompleteFilterCellComponent, BaseFilterCellComponent, BeforeEqFilterOperatorComponent, BeforeFilterOperatorComponent, BooleanFilterCellComponent, BooleanFilterComponent, BooleanFilterMenuComponent, BooleanFilterRadioButtonDirective, BrowserSupportService, CELL_CONTEXT, CancelCommandDirective, CancelCommandToolbarDirective, CellCloseEvent, CellComponent, CellLoadingTemplateDirective, CellSelectionAggregateService, CellSelectionService, CellTemplateDirective, ChangeNotificationService, CheckboxColumnComponent, ColGroupComponent, ColumnBase, ColumnChooserComponent, ColumnChooserToolbarDirective, ColumnComponent, ColumnGroupComponent, ColumnHandleDirective, ColumnInfoService, ColumnListComponent, ColumnLockedChangeEvent, ColumnMenuAutoSizeAllColumnsComponent, ColumnMenuAutoSizeColumnComponent, ColumnMenuChooserComponent, ColumnMenuComponent, ColumnMenuContainerComponent, ColumnMenuFilterComponent, ColumnMenuItemComponent, ColumnMenuItemContentTemplateDirective, ColumnMenuItemDirective, ColumnMenuLockComponent, ColumnMenuPositionComponent, ColumnMenuService, ColumnMenuSortComponent, ColumnMenuStickComponent, ColumnMenuTemplateDirective, ColumnReorderEvent, ColumnReorderService, ColumnResizingService, ColumnStickyChangeEvent, ColumnVisibilityChangeEvent, ColumnsContainer, CommandColumnComponent, ContainsFilterOperatorComponent, ContextService, CustomMessagesComponent, DEFAULT_AI_REQUEST_OPTIONS, DEFAULT_SCROLLER_FACTORY, DataBindingDirective, DateFilterCellComponent, DateFilterComponent, DateFilterMenuComponent, DateFilterMenuInputComponent, DetailCollapseEvent, DetailExpandEvent, DetailTemplateDirective, DetailsService, DoesNotContainFilterOperatorComponent, DomEventsService, DragAndDropService, DragHintService, DropCueService, EditCommandDirective, EditCommandToolbarDirective, EditService as EditServiceClass, EditTemplateDirective, EditingDirectiveBase, EndsWithFilterOperatorComponent, EqualFilterOperatorComponent, ExcelCommandDirective, ExcelCommandToolbarDirective, ExcelComponent, ExcelExportEvent, ExcelModule, ExcelService, ExpandDetailsDirective, ExpandGroupDirective, ExternalEditingDirective, FieldAccessorPipe, FilterCellComponent, FilterCellHostDirective, FilterCellOperatorsComponent, FilterCellTemplateDirective, FilterCellWrapperComponent, FilterCommandToolbarDirective, FilterInputDirective, FilterMenuComponent, FilterMenuContainerComponent, FilterMenuDropDownListDirective, FilterMenuHostDirective, FilterMenuInputWrapperComponent, FilterMenuTemplateDirective, FilterRowComponent, FilterService, FocusRoot, FocusableDirective, FooterComponent, FooterTemplateDirective, GreaterFilterOperatorComponent, GreaterOrEqualToFilterOperatorComponent, GridAIAssistantResponseErrorEvent, GridAIAssistantResponseSuccessEvent, GridClipboardDirective, GridComponent, GridModule, GridSpacerComponent, GridTableDirective, GridToolbarFocusableDirective, GridToolbarNavigationService, GroupCommandToolbarDirective, GroupFooterTemplateDirective, GroupHeaderColumnTemplateDirective, GroupHeaderComponent, GroupHeaderTemplateDirective, GroupInfoService, GroupPanelComponent, GroupsService, HeaderComponent, HeaderTemplateDirective, HighlightDirective, IdService, InCellEditingDirective, IsEmptyFilterOperatorComponent, IsNotEmptyFilterOperatorComponent, IsNotNullFilterOperatorComponent, IsNullFilterOperatorComponent, KENDO_GRID, KENDO_GRID_BODY_EXPORTS, KENDO_GRID_COLUMN_DRAGANDDROP, KENDO_GRID_COLUMN_MENU_DECLARATIONS, KENDO_GRID_COLUMN_MENU_EXPORTS, KENDO_GRID_DECLARATIONS, KENDO_GRID_EXCEL_EXPORT, KENDO_GRID_EXPORTS, KENDO_GRID_FILTER_MENU, KENDO_GRID_FILTER_MENU_EXPORTS, KENDO_GRID_FILTER_OPERATORS, KENDO_GRID_FILTER_ROW, KENDO_GRID_FILTER_ROW_EXPORTS, KENDO_GRID_FILTER_SHARED, KENDO_GRID_FOOTER_EXPORTS, KENDO_GRID_GROUP_EXPORTS, KENDO_GRID_HEADER_EXPORTS, KENDO_GRID_PDF_EXPORT, KENDO_GRID_SHARED, LessFilterOperatorComponent, LessOrEqualToFilterOperatorComponent, ListComponent, LoadingComponent, LoadingTemplateDirective, LocalDataChangesService, LogicalCellDirective, LogicalRowDirective, MenuTabbingService, MultiCheckboxFilterComponent, NavigationService, NoRecordsTemplateDirective, NotEqualFilterOperatorComponent, NumericFilterCellComponent, NumericFilterComponent, NumericFilterMenuComponent, NumericFilterMenuInputComponent, PDFCommandDirective, PDFCommandToolbarDirective, PDFComponent, PDFMarginComponent, PDFModule, PDFService, PDFTemplateDirective, PopupCloseEvent, ReactiveEditingDirective, RedoCommandToolbarDirective, RemoveCommandDirective, RemoveCommandToolbarDirective, ResizableContainerDirective, ResizeService, ResponsiveService, RowDragHandleTemplateDirective, RowDragHintTemplateDirective, RowEditingDirectiveBase, RowReorderColumnComponent, RowReorderService, SaveCommandDirective, SaveCommandToolbarDirective, ScrollRequestService, ScrollSyncService, SelectAllCheckboxDirective, SelectAllToolbarToolComponent, SelectionCheckboxDirective, SelectionDirective, SelectionService, SinglePopupService, SizingOptionsService, Skip, SortCommandToolbarDirective, SortService, SpanColumnComponent, StartsWithFilterOperatorComponent, StatusBarTemplateDirective, StringFilterCellComponent, StringFilterComponent, StringFilterMenuComponent, StringFilterMenuInputComponent, SuspendService, TableBodyComponent, TableDirective, TemplateEditingDirective, ToolbarComponent, ToolbarTemplateDirective, UndoCommandToolbarDirective, UndoRedoDirective, UndoRedoEvent, defaultTrackBy, hasFilterMenu, hasFilterRow, isFilterable };
|
|
38633
39282
|
|