@progress/kendo-angular-grid 7.0.0-next.202203311511 → 7.0.0-next.202204011628
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/bundles/kendo-angular-grid.umd.js +1 -1
- package/common/provider.service.d.ts +10 -4
- package/editing-directives/editing-directive-base.d.ts +1 -1
- package/editing-directives/in-cell-editing.directive.d.ts +1 -1
- package/editing-directives/reactive-editing.directive.d.ts +1 -1
- package/esm2015/common/provider.service.js +10 -4
- package/esm2015/grid.component.js +9 -9
- package/esm2015/layout/resizable.directive.js +6 -6
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/pdf/pdf.service.js +3 -0
- package/esm2015/rendering/toolbar/toolbar.component.js +5 -5
- package/esm2015/selection/selection-default.js +13 -13
- package/esm2015/selection/selection.directive.js +9 -9
- package/excel/excel.component.d.ts +1 -1
- package/fesm2015/kendo-angular-grid.js +60 -51
- package/filtering/base-filter-cell.component.d.ts +1 -1
- package/grid.component.d.ts +3 -3
- package/layout/resizable.directive.d.ts +3 -3
- package/package.json +2 -2
- package/pdf/pdf.service.d.ts +3 -0
- package/rendering/header/header.component.d.ts +1 -1
- package/rendering/toolbar/toolbar.component.d.ts +3 -3
- package/selection/selection-default.d.ts +3 -3
- package/selection/selection.directive.d.ts +3 -3
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import type { GridComponent } from '
|
|
5
|
+
import type { GridComponent } from '../grid.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
|
+
*
|
|
10
|
+
* The Context service is used to provide common
|
|
11
|
+
* services and DI tokens for a Grid instance.
|
|
12
|
+
*
|
|
13
|
+
* This keeps the constructor parameters stable
|
|
14
|
+
* and a avoids dependency cycles between components.
|
|
9
15
|
*/
|
|
10
|
-
export declare class
|
|
16
|
+
export declare class ContextService {
|
|
11
17
|
grid: GridComponent;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContextService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ContextService>;
|
|
14
20
|
}
|
|
@@ -7,7 +7,7 @@ import { GridComponent } from '../grid.component';
|
|
|
7
7
|
import { EditService } from './edit-service.interface';
|
|
8
8
|
import { Subscription } from 'rxjs';
|
|
9
9
|
import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
10
|
-
import { RemoveConfirmationCallback } from '
|
|
10
|
+
import { RemoveConfirmationCallback } from '../common/remove-confirmation';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
@@ -6,7 +6,7 @@ import { ChangeDetectorRef } from '@angular/core';
|
|
|
6
6
|
import { EditingDirectiveBase } from './editing-directive-base';
|
|
7
7
|
import { GridComponent } from '../grid.component';
|
|
8
8
|
import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
9
|
-
import { CreateFormGroup } from '
|
|
9
|
+
import { CreateFormGroup } from '../common/create-form-group';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
/**
|
|
12
12
|
* A directive which encapsulates the editing operations of the Grid when using the in-cell
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { RowEditingDirectiveBase } from './row-editing-directive-base';
|
|
6
6
|
import { GridComponent } from '../grid.component';
|
|
7
7
|
import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
8
|
-
import { CreateFormGroup } from '
|
|
8
|
+
import { CreateFormGroup } from '../common/create-form-group';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
11
|
* A directive which encapsulates the editing operations of the Grid when using the
|
|
@@ -6,11 +6,17 @@ import { Injectable } from '@angular/core';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
|
+
*
|
|
10
|
+
* The Context service is used to provide common
|
|
11
|
+
* services and DI tokens for a Grid instance.
|
|
12
|
+
*
|
|
13
|
+
* This keeps the constructor parameters stable
|
|
14
|
+
* and a avoids dependency cycles between components.
|
|
9
15
|
*/
|
|
10
|
-
export class
|
|
16
|
+
export class ContextService {
|
|
11
17
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type:
|
|
18
|
+
ContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
19
|
+
ContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextService });
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextService, decorators: [{
|
|
15
21
|
type: Injectable
|
|
16
22
|
}] });
|
|
@@ -69,7 +69,7 @@ import { defaultTrackBy } from './common/default-track-by';
|
|
|
69
69
|
import { CellSelectionService } from './selection/cell-selection.service';
|
|
70
70
|
import { ColumnStickyChangeEvent } from './column-menu/column-sticky-change-event';
|
|
71
71
|
import { CellLoadingTemplateDirective } from './rendering/cell-loading.template.directive';
|
|
72
|
-
import {
|
|
72
|
+
import { ContextService } from './common/provider.service';
|
|
73
73
|
import { LoadingTemplateDirective } from './rendering/loading-template.directive';
|
|
74
74
|
import * as i0 from "@angular/core";
|
|
75
75
|
import * as i1 from "./layout/browser-support.service";
|
|
@@ -158,7 +158,7 @@ const isInEditedCell = (element, gridElement) => closest(element, matchesClasses
|
|
|
158
158
|
* ```
|
|
159
159
|
*/
|
|
160
160
|
export class GridComponent {
|
|
161
|
-
constructor(supportService, selectionService, cellSelectionService, wrapper, groupInfoService, groupsService, changeNotification, detailsService, editService, filterService, pdfService, responsiveService, renderer, excelService, ngZone, scrollSyncService, domEvents, columnResizingService, changeDetectorRef, columnReorderService, columnInfoService, navigationService, sortService, scrollRequestService, localization,
|
|
161
|
+
constructor(supportService, selectionService, cellSelectionService, wrapper, groupInfoService, groupsService, changeNotification, detailsService, editService, filterService, pdfService, responsiveService, renderer, excelService, ngZone, scrollSyncService, domEvents, columnResizingService, changeDetectorRef, columnReorderService, columnInfoService, navigationService, sortService, scrollRequestService, localization, ctx) {
|
|
162
162
|
this.supportService = supportService;
|
|
163
163
|
this.selectionService = selectionService;
|
|
164
164
|
this.cellSelectionService = cellSelectionService;
|
|
@@ -184,7 +184,7 @@ export class GridComponent {
|
|
|
184
184
|
this.sortService = sortService;
|
|
185
185
|
this.scrollRequestService = scrollRequestService;
|
|
186
186
|
this.localization = localization;
|
|
187
|
-
this.
|
|
187
|
+
this.ctx = ctx;
|
|
188
188
|
/**
|
|
189
189
|
* Sets the data of the Grid. If an array is provided, the Grid automatically gets the total count
|
|
190
190
|
* ([more information and example]({% slug databinding_grid %})).
|
|
@@ -461,7 +461,7 @@ export class GridComponent {
|
|
|
461
461
|
this.rtl = false;
|
|
462
462
|
this._rowClass = () => null;
|
|
463
463
|
validatePackage(packageMetadata);
|
|
464
|
-
this.
|
|
464
|
+
this.ctx.grid = this;
|
|
465
465
|
this.localizationSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
466
466
|
this.rtl = rtl;
|
|
467
467
|
this.direction = this.rtl ? 'rtl' : 'ltr';
|
|
@@ -1690,7 +1690,7 @@ export class GridComponent {
|
|
|
1690
1690
|
return;
|
|
1691
1691
|
}
|
|
1692
1692
|
if (!this.selectionDirective && !isPresent(this.defaultSelection)) {
|
|
1693
|
-
this.defaultSelection = new Selection(this, this.changeDetectorRef);
|
|
1693
|
+
this.defaultSelection = new Selection(this.ctx, this.changeDetectorRef);
|
|
1694
1694
|
}
|
|
1695
1695
|
const cellSelectionMode = this.selectable['cell'];
|
|
1696
1696
|
const activeService = cellSelectionMode ? this.cellSelectionService : this.selectionService;
|
|
@@ -2100,7 +2100,7 @@ export class GridComponent {
|
|
|
2100
2100
|
return previousValue.cell !== currentValue.cell;
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
|
-
GridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridComponent, deps: [{ token: i1.BrowserSupportService }, { token: i2.SelectionService }, { token: i3.CellSelectionService }, { token: i0.ElementRef }, { token: i4.GroupInfoService }, { token: i5.GroupsService }, { token: i6.ChangeNotificationService }, { token: i7.DetailsService }, { token: i8.EditService }, { token: i9.FilterService }, { token: i10.PDFService }, { token: i11.ResponsiveService }, { token: i0.Renderer2 }, { token: i12.ExcelService }, { token: i0.NgZone }, { token: i13.ScrollSyncService }, { token: i14.DomEventsService }, { token: i15.ColumnResizingService }, { token: i0.ChangeDetectorRef }, { token: i16.ColumnReorderService }, { token: i17.ColumnInfoService }, { token: i18.NavigationService }, { token: i19.SortService }, { token: i20.ScrollRequestService }, { token: i21.LocalizationService }, { token: i22.
|
|
2103
|
+
GridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridComponent, deps: [{ token: i1.BrowserSupportService }, { token: i2.SelectionService }, { token: i3.CellSelectionService }, { token: i0.ElementRef }, { token: i4.GroupInfoService }, { token: i5.GroupsService }, { token: i6.ChangeNotificationService }, { token: i7.DetailsService }, { token: i8.EditService }, { token: i9.FilterService }, { token: i10.PDFService }, { token: i11.ResponsiveService }, { token: i0.Renderer2 }, { token: i12.ExcelService }, { token: i0.NgZone }, { token: i13.ScrollSyncService }, { token: i14.DomEventsService }, { token: i15.ColumnResizingService }, { token: i0.ChangeDetectorRef }, { token: i16.ColumnReorderService }, { token: i17.ColumnInfoService }, { token: i18.NavigationService }, { token: i19.SortService }, { token: i20.ScrollRequestService }, { token: i21.LocalizationService }, { token: i22.ContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2104
2104
|
GridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: GridComponent, selector: "kendo-grid", inputs: { data: "data", pageSize: "pageSize", height: "height", rowHeight: "rowHeight", detailRowHeight: "detailRowHeight", skip: "skip", scrollable: "scrollable", selectable: "selectable", sort: "sort", trackBy: "trackBy", filter: "filter", group: "group", virtualColumns: "virtualColumns", filterable: "filterable", sortable: "sortable", pageable: "pageable", groupable: "groupable", navigable: "navigable", navigatable: "navigatable", autoSize: "autoSize", rowClass: "rowClass", rowSticky: "rowSticky", rowSelected: "rowSelected", cellSelected: "cellSelected", resizable: "resizable", reorderable: "reorderable", loading: "loading", columnMenu: "columnMenu", hideHeader: "hideHeader", isDetailExpanded: "isDetailExpanded", isGroupExpanded: "isGroupExpanded" }, outputs: { filterChange: "filterChange", pageChange: "pageChange", groupChange: "groupChange", sortChange: "sortChange", selectionChange: "selectionChange", dataStateChange: "dataStateChange", groupExpand: "groupExpand", groupCollapse: "groupCollapse", detailExpand: "detailExpand", detailCollapse: "detailCollapse", edit: "edit", cancel: "cancel", save: "save", remove: "remove", add: "add", cellClose: "cellClose", cellClick: "cellClick", pdfExport: "pdfExport", excelExport: "excelExport", columnResize: "columnResize", columnReorder: "columnReorder", columnVisibilityChange: "columnVisibilityChange", columnLockedChange: "columnLockedChange", columnStickyChange: "columnStickyChange", scrollBottom: "scrollBottom", contentScroll: "contentScroll" }, host: { properties: { "attr.dir": "this.dir", "class.k-grid": "this.hostClasses", "class.k-grid-lockedcolumns": "this.lockedClasses", "class.k-grid-virtual": "this.virtualClasses", "class.k-grid-no-scrollbar": "this.noScrollbarClass" } }, providers: [
|
|
2105
2105
|
BrowserSupportService,
|
|
2106
2106
|
LocalizationService,
|
|
@@ -2141,7 +2141,7 @@ GridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
|
|
|
2141
2141
|
IdService,
|
|
2142
2142
|
ScrollRequestService,
|
|
2143
2143
|
SortService,
|
|
2144
|
-
|
|
2144
|
+
ContextService
|
|
2145
2145
|
], queries: [{ propertyName: "columns", predicate: ColumnBase }, { propertyName: "detailTemplateChildren", predicate: DetailTemplateDirective }, { propertyName: "cellLoadingTemplateChildren", predicate: CellLoadingTemplateDirective }, { propertyName: "loadingTemplateChildren", predicate: LoadingTemplateDirective }, { propertyName: "noRecordsTemplateChildren", predicate: NoRecordsTemplateDirective }, { propertyName: "pagerTemplateChildren", predicate: PagerTemplateDirective }, { propertyName: "toolbarTemplateChildren", predicate: ToolbarTemplateDirective }, { propertyName: "columnMenuTemplates", predicate: ColumnMenuTemplateDirective }], viewQueries: [{ propertyName: "lockedHeader", first: true, predicate: ["lockedHeader"], descendants: true }, { propertyName: "header", first: true, predicate: ["header"], descendants: true }, { propertyName: "ariaRoot", first: true, predicate: ["ariaRoot"], descendants: true, static: true }, { propertyName: "footer", predicate: ["footer"], descendants: true }], exportAs: ["kendoGrid"], usesOnChanges: true, ngImport: i0, template: `
|
|
2146
2146
|
<ng-container kendoGridLocalizedMessages
|
|
2147
2147
|
i18n-groupPanelEmpty="kendo.grid.groupPanelEmpty|The label visible in the Grid group panel when it is empty"
|
|
@@ -2636,7 +2636,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2636
2636
|
IdService,
|
|
2637
2637
|
ScrollRequestService,
|
|
2638
2638
|
SortService,
|
|
2639
|
-
|
|
2639
|
+
ContextService
|
|
2640
2640
|
],
|
|
2641
2641
|
selector: 'kendo-grid',
|
|
2642
2642
|
styles: [
|
|
@@ -3102,7 +3102,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
3102
3102
|
<kendo-grid-toolbar class="k-toolbar k-grid-toolbar k-grid-toolbar-bottom" *ngIf="showBottomToolbar" position="bottom"></kendo-grid-toolbar>
|
|
3103
3103
|
`
|
|
3104
3104
|
}]
|
|
3105
|
-
}], ctorParameters: function () { return [{ type: i1.BrowserSupportService }, { type: i2.SelectionService }, { type: i3.CellSelectionService }, { type: i0.ElementRef }, { type: i4.GroupInfoService }, { type: i5.GroupsService }, { type: i6.ChangeNotificationService }, { type: i7.DetailsService }, { type: i8.EditService }, { type: i9.FilterService }, { type: i10.PDFService }, { type: i11.ResponsiveService }, { type: i0.Renderer2 }, { type: i12.ExcelService }, { type: i0.NgZone }, { type: i13.ScrollSyncService }, { type: i14.DomEventsService }, { type: i15.ColumnResizingService }, { type: i0.ChangeDetectorRef }, { type: i16.ColumnReorderService }, { type: i17.ColumnInfoService }, { type: i18.NavigationService }, { type: i19.SortService }, { type: i20.ScrollRequestService }, { type: i21.LocalizationService }, { type: i22.
|
|
3105
|
+
}], ctorParameters: function () { return [{ type: i1.BrowserSupportService }, { type: i2.SelectionService }, { type: i3.CellSelectionService }, { type: i0.ElementRef }, { type: i4.GroupInfoService }, { type: i5.GroupsService }, { type: i6.ChangeNotificationService }, { type: i7.DetailsService }, { type: i8.EditService }, { type: i9.FilterService }, { type: i10.PDFService }, { type: i11.ResponsiveService }, { type: i0.Renderer2 }, { type: i12.ExcelService }, { type: i0.NgZone }, { type: i13.ScrollSyncService }, { type: i14.DomEventsService }, { type: i15.ColumnResizingService }, { type: i0.ChangeDetectorRef }, { type: i16.ColumnReorderService }, { type: i17.ColumnInfoService }, { type: i18.NavigationService }, { type: i19.SortService }, { type: i20.ScrollRequestService }, { type: i21.LocalizationService }, { type: i22.ContextService }]; }, propDecorators: { data: [{
|
|
3106
3106
|
type: Input
|
|
3107
3107
|
}], pageSize: [{
|
|
3108
3108
|
type: Input
|
|
@@ -10,11 +10,11 @@ import * as i2 from "./../common/provider.service";
|
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
export class ResizableContainerDirective {
|
|
13
|
-
constructor(el, renderer, resizeService,
|
|
13
|
+
constructor(el, renderer, resizeService, ctx) {
|
|
14
14
|
this.el = el;
|
|
15
15
|
this.renderer = renderer;
|
|
16
16
|
this.resizeService = resizeService;
|
|
17
|
-
this.
|
|
17
|
+
this.ctx = ctx;
|
|
18
18
|
this.enabled = false;
|
|
19
19
|
}
|
|
20
20
|
set lockedWidth(value) {
|
|
@@ -47,8 +47,8 @@ export class ResizableContainerDirective {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
resize() {
|
|
50
|
-
if (this.
|
|
51
|
-
const containerElement = this.
|
|
50
|
+
if (this.ctx.grid && this.ctx.grid.wrapper) {
|
|
51
|
+
const containerElement = this.ctx.grid.wrapper.nativeElement;
|
|
52
52
|
const width = Math.max(containerElement.clientWidth - this._lockedWidth, 0);
|
|
53
53
|
if (this.enabled && width > 0) {
|
|
54
54
|
this.renderer.setStyle(this.el.nativeElement, "width", width + "px");
|
|
@@ -59,14 +59,14 @@ export class ResizableContainerDirective {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
ResizableContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResizableContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ResizeService }, { token: i2.
|
|
62
|
+
ResizableContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResizableContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ResizeService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
63
63
|
ResizableContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ResizableContainerDirective, selector: "[kendoGridResizableContainer]", inputs: { lockedWidth: "lockedWidth", kendoGridResizableContainer: "kendoGridResizableContainer" }, ngImport: i0 });
|
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResizableContainerDirective, decorators: [{
|
|
65
65
|
type: Directive,
|
|
66
66
|
args: [{
|
|
67
67
|
selector: '[kendoGridResizableContainer]'
|
|
68
68
|
}]
|
|
69
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ResizeService }, { type: i2.
|
|
69
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ResizeService }, { type: i2.ContextService }]; }, propDecorators: { lockedWidth: [{
|
|
70
70
|
type: Input,
|
|
71
71
|
args: ['lockedWidth']
|
|
72
72
|
}], kendoGridResizableContainer: [{
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-grid',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1648830205,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -10,18 +10,18 @@ import * as i2 from "@angular/common";
|
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
export class ToolbarComponent {
|
|
13
|
-
constructor(
|
|
14
|
-
this.
|
|
13
|
+
constructor(ctx) {
|
|
14
|
+
this.ctx = ctx;
|
|
15
15
|
this.context = {};
|
|
16
16
|
}
|
|
17
17
|
set position(value) {
|
|
18
18
|
this.context.position = value;
|
|
19
19
|
}
|
|
20
20
|
get toolbarTemplateRef() {
|
|
21
|
-
return this.
|
|
21
|
+
return this.ctx.grid.toolbarTemplate ? this.ctx.grid.toolbarTemplate.templateRef : undefined;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.
|
|
24
|
+
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.ContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
25
25
|
ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolbarComponent, selector: "kendo-grid-toolbar", inputs: { position: "position" }, ngImport: i0, template: `
|
|
26
26
|
<ng-template
|
|
27
27
|
*ngIf="toolbarTemplateRef"
|
|
@@ -43,6 +43,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
43
43
|
</ng-template>
|
|
44
44
|
`
|
|
45
45
|
}]
|
|
46
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
46
|
+
}], ctorParameters: function () { return [{ type: i1.ContextService }]; }, propDecorators: { position: [{
|
|
47
47
|
type: Input
|
|
48
48
|
}] } });
|
|
@@ -6,13 +6,13 @@ import { Input, EventEmitter, Output, Directive } from '@angular/core';
|
|
|
6
6
|
import { isPresent } from "../utils";
|
|
7
7
|
import { PairSet } from './pair-set';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "../
|
|
9
|
+
import * as i1 from "../common/provider.service";
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
13
|
export class Selection {
|
|
14
|
-
constructor(
|
|
15
|
-
this.
|
|
14
|
+
constructor(ctx, cd) {
|
|
15
|
+
this.ctx = ctx;
|
|
16
16
|
this.cd = cd;
|
|
17
17
|
/**
|
|
18
18
|
* Defines the collection that will store the selected item keys.
|
|
@@ -27,7 +27,7 @@ export class Selection {
|
|
|
27
27
|
this.init();
|
|
28
28
|
}
|
|
29
29
|
get isCellSelectionMode() {
|
|
30
|
-
return isPresent(this.grid.selectable) && this.grid.selectable['cell'];
|
|
30
|
+
return isPresent(this.ctx.grid.selectable) && this.ctx.grid.selectable['cell'];
|
|
31
31
|
}
|
|
32
32
|
ngOnChanges(changes) {
|
|
33
33
|
// skip reinitialization if the user data is the same as the last state change
|
|
@@ -36,11 +36,11 @@ export class Selection {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
init() {
|
|
39
|
-
if (!isPresent(this.grid.rowSelected)) {
|
|
40
|
-
this.grid.rowSelected = (row) => this.rowSelectionState.has(this.getItemKey(row));
|
|
39
|
+
if (!isPresent(this.ctx.grid.rowSelected)) {
|
|
40
|
+
this.ctx.grid.rowSelected = (row) => this.rowSelectionState.has(this.getItemKey(row));
|
|
41
41
|
}
|
|
42
|
-
if (!isPresent(this.grid.cellSelected)) {
|
|
43
|
-
this.grid.cellSelected = (row, column, colIndex) => {
|
|
42
|
+
if (!isPresent(this.ctx.grid.cellSelected)) {
|
|
43
|
+
this.ctx.grid.cellSelected = (row, column, colIndex) => {
|
|
44
44
|
const contender = this.getSelectionItem(row, column, colIndex);
|
|
45
45
|
return {
|
|
46
46
|
selected: this.cellSelectionState.has(contender.itemKey, contender.columnKey),
|
|
@@ -48,7 +48,7 @@ export class Selection {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
this.selectionChangeSubscription = this.grid
|
|
51
|
+
this.selectionChangeSubscription = this.ctx.grid
|
|
52
52
|
.selectionChange
|
|
53
53
|
.subscribe(this.onSelectionChange.bind(this));
|
|
54
54
|
}
|
|
@@ -101,7 +101,7 @@ export class Selection {
|
|
|
101
101
|
const itemKey = this.getItemKey(item);
|
|
102
102
|
this.rowSelectionState.delete(itemKey);
|
|
103
103
|
});
|
|
104
|
-
if (this.grid.selectableSettings.mode === "single" && this.rowSelectionState.size > 0) {
|
|
104
|
+
if (this.ctx.grid.selectableSettings.mode === "single" && this.rowSelectionState.size > 0) {
|
|
105
105
|
this.reset();
|
|
106
106
|
}
|
|
107
107
|
selection.selectedRows.forEach((item) => {
|
|
@@ -113,7 +113,7 @@ export class Selection {
|
|
|
113
113
|
selection.deselectedCells.forEach(({ itemKey, columnKey }) => {
|
|
114
114
|
this.cellSelectionState.delete(itemKey, columnKey);
|
|
115
115
|
});
|
|
116
|
-
if (this.grid.selectableSettings.mode === "single" && this.cellSelectionState.size > 0) {
|
|
116
|
+
if (this.ctx.grid.selectableSettings.mode === "single" && this.cellSelectionState.size > 0) {
|
|
117
117
|
this.reset();
|
|
118
118
|
}
|
|
119
119
|
selection.selectedCells.forEach(({ itemKey, columnKey }) => {
|
|
@@ -142,7 +142,7 @@ export class Selection {
|
|
|
142
142
|
Array.from(this.rowSelectionState);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
Selection.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Selection, deps: [{ token: i1.
|
|
145
|
+
Selection.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Selection, deps: [{ token: i1.ContextService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
146
146
|
Selection.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Selection, selector: "kendo-grid-selection-base", inputs: { selectedKeys: "selectedKeys", selectionKey: ["kendoGridSelectBy", "selectionKey"], columnKey: "columnKey" }, outputs: { selectedKeysChange: "selectedKeysChange" }, usesOnChanges: true, ngImport: i0 });
|
|
147
147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Selection, decorators: [{
|
|
148
148
|
type: Directive,
|
|
@@ -150,7 +150,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
150
150
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
151
151
|
selector: 'kendo-grid-selection-base'
|
|
152
152
|
}]
|
|
153
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
153
|
+
}], ctorParameters: function () { return [{ type: i1.ContextService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedKeys: [{
|
|
154
154
|
type: Input
|
|
155
155
|
}], selectionKey: [{
|
|
156
156
|
type: Input,
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
import { Directive } from '@angular/core';
|
|
6
6
|
import { Selection } from "./selection-default";
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "../
|
|
8
|
+
import * as i1 from "../common/provider.service";
|
|
9
9
|
/**
|
|
10
10
|
* A directive which stores the row selection state of the Grid in memory
|
|
11
11
|
* ([see example]({% slug selection_grid %}#toc-during-data-operations)).
|
|
12
12
|
*/
|
|
13
13
|
export class SelectionDirective extends Selection {
|
|
14
|
-
constructor(
|
|
15
|
-
super(
|
|
16
|
-
this.
|
|
14
|
+
constructor(ctx, cd) {
|
|
15
|
+
super(ctx, cd);
|
|
16
|
+
this.ctx = ctx;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
|
21
21
|
ngOnInit() {
|
|
22
|
-
if (this.grid.selectable === false) {
|
|
23
|
-
this.grid.selectable = true;
|
|
22
|
+
if (this.ctx.grid.selectable === false) {
|
|
23
|
+
this.ctx.grid.selectable = true;
|
|
24
24
|
}
|
|
25
|
-
this.grid.selectionDirective = this;
|
|
25
|
+
this.ctx.grid.selectionDirective = this;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* @hidden
|
|
@@ -31,11 +31,11 @@ export class SelectionDirective extends Selection {
|
|
|
31
31
|
super.destroy();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
SelectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectionDirective, deps: [{ token: i1.
|
|
34
|
+
SelectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectionDirective, deps: [{ token: i1.ContextService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
35
35
|
SelectionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SelectionDirective, selector: "[kendoGridSelectBy]", usesInheritance: true, ngImport: i0 });
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectionDirective, decorators: [{
|
|
37
37
|
type: Directive,
|
|
38
38
|
args: [{
|
|
39
39
|
selector: '[kendoGridSelectBy]'
|
|
40
40
|
}]
|
|
41
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
41
|
+
}], ctorParameters: function () { return [{ type: i1.ContextService }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -7,7 +7,7 @@ import { ExcelExportData, ColumnBase, CellOptions } from '@progress/kendo-angula
|
|
|
7
7
|
import { GridComponent } from '../grid.component';
|
|
8
8
|
import { ExcelService } from './excel.service';
|
|
9
9
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
|
-
import { FetchDataCallback } from '
|
|
10
|
+
import { FetchDataCallback } from '../common/fetch-data-callback';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
/**
|
|
13
13
|
* Configures the settings for the export of Grid in Excel ([see example]({% slug excelexport_grid %})).
|