@progress/kendo-angular-listview 3.0.2 → 4.0.0-next.202204010900
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-listview.umd.js +5 -0
- package/{dist/es2015/data-binding → data-binding}/data-binding.directive.d.ts +5 -1
- package/{dist/es2015/editing → editing}/commands/add-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/cancel-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/edit-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/remove-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/save-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/edit-template.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/edit.service.d.ts +6 -3
- package/{dist/es2015/editing → editing}/events/add-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/cancel-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/edit-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/remove-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/save-event-args.interface.d.ts +0 -0
- package/{dist/es2015 → esm2015}/data-binding/data-binding.directive.js +15 -16
- package/esm2015/editing/commands/add-command.directive.js +49 -0
- package/{dist/es2015 → esm2015}/editing/commands/cancel-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/edit-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/remove-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/save-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/edit-template.directive.js +14 -12
- package/{dist/es2015 → esm2015}/editing/edit.service.js +9 -13
- package/{dist/es → esm2015}/editing/events/add-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/cancel-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/edit-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/remove-event-args.interface.js +1 -0
- package/{dist/es → esm2015}/editing/events/save-event-args.interface.js +1 -0
- package/{dist/es/editing/events/remove-event-args.interface.js → esm2015/kendo-angular-listview.js} +4 -0
- package/{dist/es2015 → esm2015}/listview.component.js +242 -155
- package/{dist/es2015 → esm2015}/listview.module.js +56 -26
- package/{dist/es → esm2015}/main.js +5 -0
- package/{dist/es → esm2015}/models/listview-data-result.js +1 -0
- package/{dist/es → esm2015}/models/page-change-event.js +1 -0
- package/{dist/es2015 → esm2015}/models/page-size-change-event.js +0 -0
- package/{dist/es → esm2015}/models/page-size-item.js +1 -0
- package/{dist/es → esm2015}/models/pager-position.js +1 -0
- package/{dist/es → esm2015}/models/pager-settings.js +1 -0
- package/{dist/es → esm2015}/models/pager-type.js +1 -0
- package/{dist/es → esm2015}/models/scroll-bottom-event.js +1 -0
- package/{dist/es2015 → esm2015}/navigation/listview-navigable-item.directive.js +15 -18
- package/{dist/es2015 → esm2015}/navigation/navigation.service.js +8 -13
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/esm2015/templates/footer-template.directive.js +24 -0
- package/esm2015/templates/header-template.directive.js +24 -0
- package/{dist/es2015 → esm2015}/templates/item-template.directive.js +12 -11
- package/esm2015/templates/loader-template.directive.js +24 -0
- package/esm2015/templates/template-context.directive.js +33 -0
- package/{dist/es2015 → esm2015}/utils.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-listview.js} +521 -417
- package/{dist/es/editing/events/cancel-event-args.interface.js → kendo-angular-listview.d.ts} +5 -0
- package/{dist/es2015/listview.component.d.ts → listview.component.d.ts} +13 -7
- package/listview.module.d.ts +39 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +5 -0
- package/{dist/es2015/models → models}/listview-data-result.d.ts +0 -0
- package/{dist/es2015/models → models}/page-change-event.d.ts +0 -0
- package/{dist/es2015/models → models}/page-size-change-event.d.ts +0 -0
- package/{dist/es2015/models → models}/page-size-item.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-position.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-settings.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-type.d.ts +0 -0
- package/{dist/es2015/models → models}/scroll-bottom-event.d.ts +0 -0
- package/{dist/es2015/navigation → navigation}/listview-navigable-item.directive.d.ts +3 -0
- package/{dist/es2015/navigation → navigation}/navigation.service.d.ts +5 -1
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +36 -108
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/templates → templates}/footer-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/header-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/item-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/loader-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/template-context.directive.d.ts +4 -1
- package/{dist/es2015/utils.d.ts → utils.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-listview.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/data-binding/data-binding.directive.js +0 -69
- package/dist/es/editing/commands/add-command.directive.js +0 -58
- package/dist/es/editing/commands/cancel-command.directive.js +0 -74
- package/dist/es/editing/commands/edit-command.directive.js +0 -62
- package/dist/es/editing/commands/remove-command.directive.js +0 -61
- package/dist/es/editing/commands/save-command.directive.js +0 -74
- package/dist/es/editing/edit-template.directive.js +0 -32
- package/dist/es/editing/edit.service.js +0 -136
- package/dist/es/editing/events/edit-event-args.interface.js +0 -4
- package/dist/es/index.js +0 -17
- package/dist/es/listview.component.js +0 -534
- package/dist/es/listview.module.js +0 -83
- package/dist/es/models/page-size-change-event.js +0 -18
- package/dist/es/navigation/listview-navigable-item.directive.js +0 -70
- package/dist/es/navigation/navigation.service.js +0 -162
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/templates/footer-template.directive.js +0 -24
- package/dist/es/templates/header-template.directive.js +0 -24
- package/dist/es/templates/item-template.directive.js +0 -30
- package/dist/es/templates/loader-template.directive.js +0 -24
- package/dist/es/templates/template-context.directive.js +0 -40
- package/dist/es/utils.js +0 -103
- package/dist/es2015/editing/commands/add-command.directive.js +0 -55
- package/dist/es2015/editing/events/add-event-args.interface.js +0 -4
- package/dist/es2015/editing/events/save-event-args.interface.js +0 -4
- package/dist/es2015/index.d.ts +0 -17
- package/dist/es2015/index.js +0 -17
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/listview.module.d.ts +0 -18
- package/dist/es2015/main.js +0 -13
- package/dist/es2015/models/listview-data-result.js +0 -4
- package/dist/es2015/models/page-change-event.js +0 -4
- package/dist/es2015/models/page-size-item.js +0 -4
- package/dist/es2015/models/pager-position.js +0 -4
- package/dist/es2015/models/pager-settings.js +0 -4
- package/dist/es2015/models/pager-type.js +0 -4
- package/dist/es2015/models/scroll-bottom-event.js +0 -4
- package/dist/es2015/templates/footer-template.directive.js +0 -23
- package/dist/es2015/templates/header-template.directive.js +0 -23
- package/dist/es2015/templates/loader-template.directive.js +0 -23
- package/dist/es2015/templates/template-context.directive.js +0 -35
- package/dist/fesm5/index.js +0 -1528
- package/dist/npm/data-binding/data-binding.directive.js +0 -71
- package/dist/npm/editing/commands/add-command.directive.js +0 -60
- package/dist/npm/editing/commands/cancel-command.directive.js +0 -76
- package/dist/npm/editing/commands/edit-command.directive.js +0 -64
- package/dist/npm/editing/commands/remove-command.directive.js +0 -63
- package/dist/npm/editing/commands/save-command.directive.js +0 -76
- package/dist/npm/editing/edit-template.directive.js +0 -34
- package/dist/npm/editing/edit.service.js +0 -140
- package/dist/npm/editing/events/add-event-args.interface.js +0 -6
- package/dist/npm/editing/events/cancel-event-args.interface.js +0 -6
- package/dist/npm/editing/events/edit-event-args.interface.js +0 -6
- package/dist/npm/editing/events/remove-event-args.interface.js +0 -6
- package/dist/npm/editing/events/save-event-args.interface.js +0 -6
- package/dist/npm/index.js +0 -29
- package/dist/npm/listview.component.js +0 -536
- package/dist/npm/listview.module.js +0 -85
- package/dist/npm/main.js +0 -24
- package/dist/npm/models/listview-data-result.js +0 -6
- package/dist/npm/models/page-change-event.js +0 -6
- package/dist/npm/models/page-size-change-event.js +0 -20
- package/dist/npm/models/page-size-item.js +0 -6
- package/dist/npm/models/pager-position.js +0 -6
- package/dist/npm/models/pager-settings.js +0 -6
- package/dist/npm/models/pager-type.js +0 -6
- package/dist/npm/models/scroll-bottom-event.js +0 -6
- package/dist/npm/navigation/listview-navigable-item.directive.js +0 -72
- package/dist/npm/navigation/navigation.service.js +0 -164
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/templates/footer-template.directive.js +0 -26
- package/dist/npm/templates/header-template.directive.js +0 -26
- package/dist/npm/templates/item-template.directive.js +0 -32
- package/dist/npm/templates/loader-template.directive.js +0 -26
- package/dist/npm/templates/template-context.directive.js +0 -42
- package/dist/npm/utils.js +0 -105
- package/dist/systemjs/kendo-angular-listview.js +0 -5
|
@@ -2,15 +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
|
|
6
|
-
import { Injectable,
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, Directive, Input, Optional, EventEmitter, Component, ChangeDetectionStrategy, HostBinding, ContentChild, ViewChild, ViewChildren, Output, HostListener, NgModule } from '@angular/core';
|
|
7
|
+
import * as i5 from '@progress/kendo-angular-common';
|
|
7
8
|
import { isDocumentAvailable, Keys, isChanged, hasObservers, EventsModule } from '@progress/kendo-angular-common';
|
|
8
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
+
import * as i2 from '@progress/kendo-angular-l10n';
|
|
9
11
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
10
12
|
import { Subject, Subscription } from 'rxjs';
|
|
11
13
|
import { FormGroup, FormControl } from '@angular/forms';
|
|
12
14
|
import { switchMap, take } from 'rxjs/operators';
|
|
13
|
-
import
|
|
15
|
+
import * as i3 from '@progress/kendo-angular-pager';
|
|
16
|
+
import { PageSizeChangeEvent as PageSizeChangeEvent$1, PagerModule } from '@progress/kendo-angular-pager';
|
|
17
|
+
import * as i4 from '@angular/common';
|
|
14
18
|
import { CommonModule } from '@angular/common';
|
|
15
19
|
import { Button } from '@progress/kendo-angular-buttons';
|
|
16
20
|
|
|
@@ -21,7 +25,7 @@ const packageMetadata = {
|
|
|
21
25
|
name: '@progress/kendo-angular-listview',
|
|
22
26
|
productName: 'Kendo UI for Angular',
|
|
23
27
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
24
|
-
publishDate:
|
|
28
|
+
publishDate: 1648803587,
|
|
25
29
|
version: '',
|
|
26
30
|
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'
|
|
27
31
|
};
|
|
@@ -31,6 +35,10 @@ const LISTVIEW_ITEM_SELECTOR = '.k-listview-item';
|
|
|
31
35
|
* @hidden
|
|
32
36
|
*/
|
|
33
37
|
const isPresent = (item) => item !== null && item !== undefined;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
const isObject = (item) => isPresent(item) && typeof item === 'object';
|
|
34
42
|
/**
|
|
35
43
|
* @hidden
|
|
36
44
|
*
|
|
@@ -127,13 +135,7 @@ const getClosestListItemIndex = (element) => {
|
|
|
127
135
|
* Provided per ListView instance. Keeps the availability, active index and focused state of the current ListView.
|
|
128
136
|
* Emits `changes` when any of the aforementioned states changes.
|
|
129
137
|
*/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @hidden
|
|
133
|
-
*
|
|
134
|
-
* Provided per ListView instance. Keeps the availability, active index and focused state of the current ListView.
|
|
135
|
-
* Emits `changes` when any of the aforementioned states changes.
|
|
136
|
-
*/
|
|
138
|
+
class NavigationService {
|
|
137
139
|
constructor() {
|
|
138
140
|
/**
|
|
139
141
|
* Emits every time a change in active index/focus/blur/navigation availability occurs.
|
|
@@ -270,15 +272,17 @@ let NavigationService = class NavigationService {
|
|
|
270
272
|
const nextIndex = Math.min(this.activeIndex + 1, lastAvailableIndex);
|
|
271
273
|
this.navigateTo(nextIndex);
|
|
272
274
|
}
|
|
273
|
-
}
|
|
274
|
-
NavigationService =
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
}
|
|
276
|
+
NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
277
|
+
NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService });
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, decorators: [{
|
|
279
|
+
type: Injectable
|
|
280
|
+
}] });
|
|
277
281
|
|
|
278
282
|
/**
|
|
279
283
|
* @hidden
|
|
280
284
|
*/
|
|
281
|
-
|
|
285
|
+
class ListViewNavigableItemDirective {
|
|
282
286
|
constructor(hostElement, renderer, navigationService) {
|
|
283
287
|
this.hostElement = hostElement;
|
|
284
288
|
this.renderer = renderer;
|
|
@@ -322,19 +326,17 @@ let ListViewNavigableItemDirective = class ListViewNavigableItemDirective {
|
|
|
322
326
|
this.renderer.setAttribute(this.hostElement.nativeElement, 'tabindex', '-1');
|
|
323
327
|
}
|
|
324
328
|
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
NavigationService])
|
|
337
|
-
], ListViewNavigableItemDirective);
|
|
329
|
+
}
|
|
330
|
+
ListViewNavigableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewNavigableItemDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
331
|
+
ListViewNavigableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ListViewNavigableItemDirective, selector: "[kendoListViewNavigableItem]", inputs: { index: "index" }, usesOnChanges: true, ngImport: i0 });
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewNavigableItemDirective, decorators: [{
|
|
333
|
+
type: Directive,
|
|
334
|
+
args: [{
|
|
335
|
+
selector: '[kendoListViewNavigableItem]'
|
|
336
|
+
}]
|
|
337
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: NavigationService }]; }, propDecorators: { index: [{
|
|
338
|
+
type: Input
|
|
339
|
+
}] } });
|
|
338
340
|
|
|
339
341
|
/**
|
|
340
342
|
* Renders the list item content. To define an item template, nest an `<ng-template>` tag
|
|
@@ -347,68 +349,76 @@ ListViewNavigableItemDirective = __decorate([
|
|
|
347
349
|
* - `let-isFirst="isFirst"` (`boolean`) - Indicates whether the current data item will be rendered as the first item on the list.
|
|
348
350
|
* - `let-isLast="isLast"` (`boolean`)- Indicates whether the current data item will be rendered as the last item on the list.
|
|
349
351
|
*/
|
|
350
|
-
|
|
352
|
+
class ItemTemplateDirective {
|
|
351
353
|
constructor(templateRef) {
|
|
352
354
|
this.templateRef = templateRef;
|
|
353
355
|
}
|
|
354
|
-
}
|
|
355
|
-
ItemTemplateDirective =
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
]
|
|
356
|
+
}
|
|
357
|
+
ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
358
|
+
ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemTemplateDirective, selector: "[kendoListViewItemTemplate]", ngImport: i0 });
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, decorators: [{
|
|
360
|
+
type: Directive,
|
|
361
|
+
args: [{
|
|
362
|
+
selector: '[kendoListViewItemTemplate]'
|
|
363
|
+
}]
|
|
364
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
361
365
|
|
|
362
366
|
/**
|
|
363
367
|
* Renders the header content of the ListView. To define a header template, nest an `<ng-template>` tag
|
|
364
368
|
* with the `kendoListViewHeaderTemplate` directive inside the `<kendo-listview>` tag
|
|
365
369
|
* [see example]({% slug templates_listview %}#toc-header-template).
|
|
366
370
|
*/
|
|
367
|
-
|
|
371
|
+
class HeaderTemplateDirective {
|
|
368
372
|
constructor(templateRef) {
|
|
369
373
|
this.templateRef = templateRef;
|
|
370
374
|
}
|
|
371
|
-
}
|
|
372
|
-
HeaderTemplateDirective =
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
]
|
|
375
|
+
}
|
|
376
|
+
HeaderTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeaderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
377
|
+
HeaderTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: HeaderTemplateDirective, selector: "[kendoListViewHeaderTemplate]", ngImport: i0 });
|
|
378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeaderTemplateDirective, decorators: [{
|
|
379
|
+
type: Directive,
|
|
380
|
+
args: [{
|
|
381
|
+
selector: '[kendoListViewHeaderTemplate]'
|
|
382
|
+
}]
|
|
383
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
378
384
|
|
|
379
385
|
/**
|
|
380
386
|
* Renders the footer content of the ListView. To define a footer template, nest an `<ng-template>` tag
|
|
381
387
|
* with the `kendoListViewFooterTemplate` directive inside the `<kendo-listview>` tag
|
|
382
388
|
* [see example]({% slug templates_listview %}#toc-footer-template).
|
|
383
389
|
*/
|
|
384
|
-
|
|
390
|
+
class FooterTemplateDirective {
|
|
385
391
|
constructor(templateRef) {
|
|
386
392
|
this.templateRef = templateRef;
|
|
387
393
|
}
|
|
388
|
-
}
|
|
389
|
-
FooterTemplateDirective =
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
]
|
|
394
|
+
}
|
|
395
|
+
FooterTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FooterTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
396
|
+
FooterTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FooterTemplateDirective, selector: "[kendoListViewFooterTemplate]", ngImport: i0 });
|
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FooterTemplateDirective, decorators: [{
|
|
398
|
+
type: Directive,
|
|
399
|
+
args: [{
|
|
400
|
+
selector: '[kendoListViewFooterTemplate]'
|
|
401
|
+
}]
|
|
402
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
395
403
|
|
|
396
404
|
/**
|
|
397
405
|
* Overrides the default loader content of the ListView. To define a loader template, nest an `<ng-template>` tag
|
|
398
406
|
* with the `kendoListViewLoaderTemplate` directive inside the `<kendo-listview>` tag
|
|
399
407
|
* [see example]({% slug templates_listview %}#toc-loader-template).
|
|
400
408
|
*/
|
|
401
|
-
|
|
409
|
+
class LoaderTemplateDirective {
|
|
402
410
|
constructor(templateRef) {
|
|
403
411
|
this.templateRef = templateRef;
|
|
404
412
|
}
|
|
405
|
-
}
|
|
406
|
-
LoaderTemplateDirective =
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
]
|
|
413
|
+
}
|
|
414
|
+
LoaderTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LoaderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
415
|
+
LoaderTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LoaderTemplateDirective, selector: "[kendoListViewLoaderTemplate]", ngImport: i0 });
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LoaderTemplateDirective, decorators: [{
|
|
417
|
+
type: Directive,
|
|
418
|
+
args: [{
|
|
419
|
+
selector: '[kendoListViewLoaderTemplate]'
|
|
420
|
+
}]
|
|
421
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
412
422
|
|
|
413
423
|
/**
|
|
414
424
|
* Represents the edit template of the ListView ([see example]({% slug editing_template_forms_listview %})).
|
|
@@ -422,18 +432,21 @@ LoaderTemplateDirective = __decorate([
|
|
|
422
432
|
* - `dataItem`—The current data item.
|
|
423
433
|
* - `isNew`—The state of the current item.
|
|
424
434
|
*/
|
|
425
|
-
|
|
435
|
+
class EditTemplateDirective {
|
|
426
436
|
constructor(templateRef) {
|
|
427
437
|
this.templateRef = templateRef;
|
|
428
438
|
}
|
|
429
|
-
}
|
|
430
|
-
EditTemplateDirective =
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
]
|
|
439
|
+
}
|
|
440
|
+
EditTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
441
|
+
EditTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: EditTemplateDirective, selector: "[kendoListViewEditTemplate]", ngImport: i0 });
|
|
442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditTemplateDirective, decorators: [{
|
|
443
|
+
type: Directive,
|
|
444
|
+
args: [{
|
|
445
|
+
selector: '[kendoListViewEditTemplate]'
|
|
446
|
+
}]
|
|
447
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
448
|
+
type: Optional
|
|
449
|
+
}] }]; } });
|
|
437
450
|
|
|
438
451
|
/**
|
|
439
452
|
* @hidden
|
|
@@ -450,7 +463,7 @@ const isNewItem = (index) => index === -1 || index === undefined;
|
|
|
450
463
|
/**
|
|
451
464
|
* @hidden
|
|
452
465
|
*/
|
|
453
|
-
|
|
466
|
+
class EditService {
|
|
454
467
|
constructor(ngZone) {
|
|
455
468
|
this.ngZone = ngZone;
|
|
456
469
|
this.changes = new EventEmitter();
|
|
@@ -535,11 +548,12 @@ let EditService = class EditService {
|
|
|
535
548
|
this.changedSource.next();
|
|
536
549
|
});
|
|
537
550
|
}
|
|
538
|
-
}
|
|
539
|
-
EditService =
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
551
|
+
}
|
|
552
|
+
EditService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
553
|
+
EditService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditService });
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditService, decorators: [{
|
|
555
|
+
type: Injectable
|
|
556
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
543
557
|
|
|
544
558
|
const DEFAULT_PAGER_SETTINGS = {
|
|
545
559
|
position: 'bottom',
|
|
@@ -556,7 +570,7 @@ const createControl = (source) => (acc, key) => {
|
|
|
556
570
|
/**
|
|
557
571
|
* Represents the Kendo UI ListView component for Angular.
|
|
558
572
|
*/
|
|
559
|
-
|
|
573
|
+
class ListViewComponent {
|
|
560
574
|
constructor(ngZone, element, renderer, editService, navigationService) {
|
|
561
575
|
this.ngZone = ngZone;
|
|
562
576
|
this.element = element;
|
|
@@ -872,148 +886,160 @@ let ListViewComponent = class ListViewComponent {
|
|
|
872
886
|
});
|
|
873
887
|
this[action].emit(args);
|
|
874
888
|
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
]
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
]
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
]
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
]
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
]
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
]
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
]
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
]
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
889
|
+
}
|
|
890
|
+
ListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: EditService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
891
|
+
ListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListViewComponent, selector: "kendo-listview", inputs: { data: "data", loading: "loading", containerStyle: "containerStyle", itemStyle: "itemStyle", containerClass: "containerClass", itemClass: "itemClass", containerLabel: "containerLabel", containerRole: "containerRole", listItemRole: "listItemRole", navigable: "navigable", pageSize: "pageSize", skip: "skip", pageable: "pageable", height: "height" }, outputs: { scrollBottom: "scrollBottom", pageChange: "pageChange", pageSizeChange: "pageSizeChange", edit: "edit", cancel: "cancel", save: "save", remove: "remove", add: "add" }, host: { properties: { "class.k-widget": "this.className", "class.k-listview": "this.className", "class.k-listview-bordered": "this.className", "class.k-d-flex": "this.className" } }, providers: [
|
|
892
|
+
EditService,
|
|
893
|
+
NavigationService,
|
|
894
|
+
LocalizationService,
|
|
895
|
+
{
|
|
896
|
+
provide: L10N_PREFIX,
|
|
897
|
+
useValue: 'kendo.listview'
|
|
898
|
+
}
|
|
899
|
+
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }, { propertyName: "headerTemplate", first: true, predicate: HeaderTemplateDirective, descendants: true }, { propertyName: "footerTemplate", first: true, predicate: FooterTemplateDirective, descendants: true }, { propertyName: "loaderTemplate", first: true, predicate: LoaderTemplateDirective, descendants: true }, { propertyName: "editTemplate", first: true, predicate: EditTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, static: true }, { propertyName: "listViewItems", predicate: ListViewNavigableItemDirective, descendants: true }], exportAs: ["kendoListView"], usesOnChanges: true, ngImport: i0, template: `
|
|
900
|
+
<!-- top pager -->
|
|
901
|
+
<ng-template
|
|
902
|
+
*ngIf="pagerSettings?.position !== 'bottom'"
|
|
903
|
+
[ngTemplateOutlet]="pagerTemplate"
|
|
904
|
+
[ngTemplateOutletContext]="{ pagerClass: 'k-listview-pager k-listview-pager-top' }"
|
|
905
|
+
>
|
|
906
|
+
</ng-template>
|
|
907
|
+
|
|
908
|
+
<!-- header -->
|
|
909
|
+
<div
|
|
910
|
+
*ngIf="headerTemplate"
|
|
911
|
+
class="k-listview-header"
|
|
912
|
+
>
|
|
913
|
+
<ng-template
|
|
914
|
+
[ngTemplateOutlet]="headerTemplate?.templateRef"
|
|
915
|
+
>
|
|
916
|
+
</ng-template>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<!-- content -->
|
|
920
|
+
<div
|
|
921
|
+
#contentContainer
|
|
922
|
+
[attr.tabindex]="containerTabindex"
|
|
923
|
+
class="k-listview-content"
|
|
924
|
+
[ngClass]="containerClass"
|
|
925
|
+
[ngStyle]="containerStyle"
|
|
926
|
+
[kendoEventsOutsideAngular]="{
|
|
927
|
+
scroll: handleContentScroll
|
|
928
|
+
}"
|
|
929
|
+
[scope]="this"
|
|
930
|
+
[attr.role]="containerRole"
|
|
931
|
+
[attr.aria-label]="containerLabel"
|
|
932
|
+
>
|
|
933
|
+
<!-- new item edit template -->
|
|
934
|
+
<div
|
|
935
|
+
*ngIf="editService.hasNewItem"
|
|
936
|
+
class="k-listview-item"
|
|
937
|
+
[attr.role]="listItemRole"
|
|
938
|
+
kendoListViewNavigableItem
|
|
939
|
+
[index]="-1"
|
|
940
|
+
[attr.data-kendo-listview-item-index]="-1"
|
|
941
|
+
[ngClass]="itemClass"
|
|
942
|
+
[ngStyle]="itemStyle"
|
|
943
|
+
>
|
|
944
|
+
<ng-template
|
|
945
|
+
*ngIf="editTemplate"
|
|
946
|
+
[ngTemplateOutlet]="editTemplate?.templateRef"
|
|
947
|
+
[ngTemplateOutletContext]="editTemplateContext(-1)"
|
|
948
|
+
>
|
|
949
|
+
</ng-template>
|
|
950
|
+
</div>
|
|
951
|
+
|
|
952
|
+
<!-- items -->
|
|
953
|
+
<div
|
|
954
|
+
*ngFor="let dataItem of items; let index = index; let first = first; let last = last;"
|
|
955
|
+
class="k-listview-item"
|
|
956
|
+
[attr.role]="listItemRole"
|
|
957
|
+
[attr.aria-posinset]="itemPosInSet(index)"
|
|
958
|
+
[attr.aria-setsize]="total"
|
|
959
|
+
kendoListViewNavigableItem
|
|
960
|
+
[index]="index"
|
|
961
|
+
[attr.data-kendo-listview-item-index]="index"
|
|
962
|
+
[ngClass]="itemClass"
|
|
963
|
+
[ngStyle]="itemStyle"
|
|
964
|
+
>
|
|
965
|
+
<ng-template
|
|
966
|
+
[ngTemplateOutlet]="isEdited(index) ? editTemplate?.templateRef : itemTemplate?.templateRef"
|
|
967
|
+
[ngTemplateOutletContext]="isEdited(index) ? editTemplateContext(index) : templateContext(index)"
|
|
968
|
+
>
|
|
969
|
+
</ng-template>
|
|
970
|
+
</div>
|
|
971
|
+
|
|
972
|
+
<!-- loading indicator -->
|
|
973
|
+
<div
|
|
974
|
+
*ngIf="loading && !loaderTemplate"
|
|
975
|
+
class="k-loading-mask"
|
|
976
|
+
>
|
|
977
|
+
<!-- TODO: the k-loading-text is hidden with css but read by readers - review when implementing accessibility + possible localization case -->
|
|
978
|
+
<span class="k-loading-text">Loading</span>
|
|
979
|
+
<div class="k-loading-image"></div>
|
|
980
|
+
<div class="k-loading-color"></div>
|
|
981
|
+
</div>
|
|
982
|
+
<ng-template
|
|
983
|
+
*ngIf="loading && loaderTemplate"
|
|
984
|
+
[ngTemplateOutlet]="loaderTemplate.templateRef"
|
|
985
|
+
>
|
|
986
|
+
</ng-template>
|
|
987
|
+
</div>
|
|
988
|
+
|
|
989
|
+
<!-- footer -->
|
|
990
|
+
<div
|
|
991
|
+
*ngIf="footerTemplate"
|
|
992
|
+
class="k-listview-footer"
|
|
993
|
+
>
|
|
994
|
+
<ng-template
|
|
995
|
+
[ngTemplateOutlet]="footerTemplate?.templateRef"
|
|
996
|
+
>
|
|
997
|
+
</ng-template>
|
|
998
|
+
</div>
|
|
999
|
+
|
|
1000
|
+
<!-- bottom pager -->
|
|
1001
|
+
<ng-template
|
|
1002
|
+
*ngIf="pagerSettings?.position !== 'top'"
|
|
1003
|
+
[ngTemplateOutlet]="pagerTemplate"
|
|
1004
|
+
[ngTemplateOutletContext]="{ pagerClass: 'k-listview-pager' }"
|
|
1005
|
+
>
|
|
1006
|
+
</ng-template>
|
|
1007
|
+
|
|
1008
|
+
<!-- pager template -->
|
|
1009
|
+
<ng-template #pagerTemplate let-pagerClass="pagerClass">
|
|
1010
|
+
<kendo-datapager
|
|
1011
|
+
*ngIf="pageable"
|
|
1012
|
+
[class]="pagerClass"
|
|
1013
|
+
[total]="total"
|
|
1014
|
+
[pageSize]="pageSize"
|
|
1015
|
+
[skip]="skip"
|
|
1016
|
+
[buttonCount]="pagerSettings.buttonCount"
|
|
1017
|
+
[info]="pagerSettings.info"
|
|
1018
|
+
[previousNext]="pagerSettings.previousNext"
|
|
1019
|
+
[type]="pagerSettings.type"
|
|
1020
|
+
[pageSizeValues]="pagerSettings.pageSizeValues"
|
|
1021
|
+
(pageChange)="handlePageChange($event)"
|
|
1022
|
+
(pageSizeChange)="pageSizeChange.emit($event)"
|
|
1023
|
+
>
|
|
1024
|
+
</kendo-datapager>
|
|
1025
|
+
</ng-template>
|
|
1026
|
+
`, isInline: true, components: [{ type: i3.PagerComponent, selector: "kendo-datapager", inputs: ["total", "skip", "pageSize", "buttonCount", "info", "type", "pageSizeValues", "previousNext"], outputs: ["pageChange", "pageSizeChange"], exportAs: ["kendoDataPager"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: ListViewNavigableItemDirective, selector: "[kendoListViewNavigableItem]", inputs: ["index"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewComponent, decorators: [{
|
|
1028
|
+
type: Component,
|
|
1029
|
+
args: [{
|
|
1030
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1031
|
+
exportAs: 'kendoListView',
|
|
1032
|
+
selector: 'kendo-listview',
|
|
1033
|
+
providers: [
|
|
1034
|
+
EditService,
|
|
1035
|
+
NavigationService,
|
|
1036
|
+
LocalizationService,
|
|
1037
|
+
{
|
|
1038
|
+
provide: L10N_PREFIX,
|
|
1039
|
+
useValue: 'kendo.listview'
|
|
1040
|
+
}
|
|
1041
|
+
],
|
|
1042
|
+
template: `
|
|
1017
1043
|
<!-- top pager -->
|
|
1018
1044
|
<ng-template
|
|
1019
1045
|
*ngIf="pagerSettings?.position !== 'bottom'"
|
|
@@ -1141,19 +1167,91 @@ ListViewComponent = __decorate([
|
|
|
1141
1167
|
</kendo-datapager>
|
|
1142
1168
|
</ng-template>
|
|
1143
1169
|
`
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
]
|
|
1170
|
+
}]
|
|
1171
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: EditService }, { type: NavigationService }]; }, propDecorators: { className: [{
|
|
1172
|
+
type: HostBinding,
|
|
1173
|
+
args: ['class.k-widget']
|
|
1174
|
+
}, {
|
|
1175
|
+
type: HostBinding,
|
|
1176
|
+
args: ['class.k-listview']
|
|
1177
|
+
}, {
|
|
1178
|
+
type: HostBinding,
|
|
1179
|
+
args: ['class.k-listview-bordered']
|
|
1180
|
+
}, {
|
|
1181
|
+
type: HostBinding,
|
|
1182
|
+
args: ['class.k-d-flex']
|
|
1183
|
+
}], itemTemplate: [{
|
|
1184
|
+
type: ContentChild,
|
|
1185
|
+
args: [ItemTemplateDirective, { static: false }]
|
|
1186
|
+
}], headerTemplate: [{
|
|
1187
|
+
type: ContentChild,
|
|
1188
|
+
args: [HeaderTemplateDirective, { static: false }]
|
|
1189
|
+
}], footerTemplate: [{
|
|
1190
|
+
type: ContentChild,
|
|
1191
|
+
args: [FooterTemplateDirective, { static: false }]
|
|
1192
|
+
}], loaderTemplate: [{
|
|
1193
|
+
type: ContentChild,
|
|
1194
|
+
args: [LoaderTemplateDirective, { static: false }]
|
|
1195
|
+
}], contentContainer: [{
|
|
1196
|
+
type: ViewChild,
|
|
1197
|
+
args: ['contentContainer', { static: true }]
|
|
1198
|
+
}], editTemplate: [{
|
|
1199
|
+
type: ContentChild,
|
|
1200
|
+
args: [EditTemplateDirective, { static: false }]
|
|
1201
|
+
}], listViewItems: [{
|
|
1202
|
+
type: ViewChildren,
|
|
1203
|
+
args: [ListViewNavigableItemDirective]
|
|
1204
|
+
}], data: [{
|
|
1205
|
+
type: Input
|
|
1206
|
+
}], loading: [{
|
|
1207
|
+
type: Input
|
|
1208
|
+
}], containerStyle: [{
|
|
1209
|
+
type: Input
|
|
1210
|
+
}], itemStyle: [{
|
|
1211
|
+
type: Input
|
|
1212
|
+
}], containerClass: [{
|
|
1213
|
+
type: Input
|
|
1214
|
+
}], itemClass: [{
|
|
1215
|
+
type: Input
|
|
1216
|
+
}], containerLabel: [{
|
|
1217
|
+
type: Input
|
|
1218
|
+
}], containerRole: [{
|
|
1219
|
+
type: Input
|
|
1220
|
+
}], listItemRole: [{
|
|
1221
|
+
type: Input
|
|
1222
|
+
}], navigable: [{
|
|
1223
|
+
type: Input
|
|
1224
|
+
}], pageSize: [{
|
|
1225
|
+
type: Input
|
|
1226
|
+
}], skip: [{
|
|
1227
|
+
type: Input
|
|
1228
|
+
}], pageable: [{
|
|
1229
|
+
type: Input
|
|
1230
|
+
}], height: [{
|
|
1231
|
+
type: Input
|
|
1232
|
+
}], scrollBottom: [{
|
|
1233
|
+
type: Output
|
|
1234
|
+
}], pageChange: [{
|
|
1235
|
+
type: Output
|
|
1236
|
+
}], pageSizeChange: [{
|
|
1237
|
+
type: Output
|
|
1238
|
+
}], edit: [{
|
|
1239
|
+
type: Output
|
|
1240
|
+
}], cancel: [{
|
|
1241
|
+
type: Output
|
|
1242
|
+
}], save: [{
|
|
1243
|
+
type: Output
|
|
1244
|
+
}], remove: [{
|
|
1245
|
+
type: Output
|
|
1246
|
+
}], add: [{
|
|
1247
|
+
type: Output
|
|
1248
|
+
}] } });
|
|
1151
1249
|
|
|
1152
1250
|
/**
|
|
1153
1251
|
* A directive that encapsulates the in-memory handling of paging
|
|
1154
1252
|
* ([see example]({% slug paging_listview %}#toc-binding-directive)).
|
|
1155
1253
|
*/
|
|
1156
|
-
|
|
1254
|
+
class DataBindingDirective {
|
|
1157
1255
|
constructor(listView) {
|
|
1158
1256
|
this.listView = listView;
|
|
1159
1257
|
this.subscriptions = new Subscription();
|
|
@@ -1192,55 +1290,26 @@ let DataBindingDirective = class DataBindingDirective {
|
|
|
1192
1290
|
total: this.data.length
|
|
1193
1291
|
};
|
|
1194
1292
|
}
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
]
|
|
1293
|
+
}
|
|
1294
|
+
DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, deps: [{ token: ListViewComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1295
|
+
DataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DataBindingDirective, selector: "[kendoListViewBinding]", inputs: { data: ["kendoListViewBinding", "data"] }, ngImport: i0 });
|
|
1296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, decorators: [{
|
|
1297
|
+
type: Directive,
|
|
1298
|
+
args: [{
|
|
1299
|
+
selector: '[kendoListViewBinding]'
|
|
1300
|
+
}]
|
|
1301
|
+
}], ctorParameters: function () { return [{ type: ListViewComponent }]; }, propDecorators: { data: [{
|
|
1302
|
+
type: Input,
|
|
1303
|
+
args: ['kendoListViewBinding']
|
|
1304
|
+
}] } });
|
|
1207
1305
|
|
|
1208
1306
|
/**
|
|
1209
1307
|
* The arguments of the [`pageSizeChange`]({% slug api_listview_listviewcomponent %}#toc-pagesizechange) event of the ListView
|
|
1210
1308
|
* ([more details]({% slug paging_listview %}).
|
|
1211
1309
|
*/
|
|
1212
|
-
class PageSizeChangeEvent
|
|
1310
|
+
class PageSizeChangeEvent extends PageSizeChangeEvent$1 {
|
|
1213
1311
|
}
|
|
1214
1312
|
|
|
1215
|
-
/**
|
|
1216
|
-
* @hidden
|
|
1217
|
-
*/
|
|
1218
|
-
let TemplateContextDirective = class TemplateContextDirective {
|
|
1219
|
-
constructor(viewContainerRef) {
|
|
1220
|
-
this.viewContainerRef = viewContainerRef;
|
|
1221
|
-
}
|
|
1222
|
-
set templateContext(context) {
|
|
1223
|
-
if (this.insertedViewRef) {
|
|
1224
|
-
this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
|
|
1225
|
-
this.insertedViewRef = undefined;
|
|
1226
|
-
}
|
|
1227
|
-
if (context.templateRef) {
|
|
1228
|
-
this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
};
|
|
1232
|
-
__decorate([
|
|
1233
|
-
Input(),
|
|
1234
|
-
__metadata("design:type", Object),
|
|
1235
|
-
__metadata("design:paramtypes", [Object])
|
|
1236
|
-
], TemplateContextDirective.prototype, "templateContext", null);
|
|
1237
|
-
TemplateContextDirective = __decorate([
|
|
1238
|
-
Directive({
|
|
1239
|
-
selector: '[templateContext]' // tslint:disable-line
|
|
1240
|
-
}),
|
|
1241
|
-
__metadata("design:paramtypes", [ViewContainerRef])
|
|
1242
|
-
], TemplateContextDirective);
|
|
1243
|
-
|
|
1244
1313
|
/**
|
|
1245
1314
|
* Represents the `edit` command of the ListView. You can apply this directive to any `button`
|
|
1246
1315
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
@@ -1258,7 +1327,7 @@ TemplateContextDirective = __decorate([
|
|
|
1258
1327
|
* ```
|
|
1259
1328
|
*
|
|
1260
1329
|
*/
|
|
1261
|
-
|
|
1330
|
+
class EditCommandDirective extends Button {
|
|
1262
1331
|
constructor(editService, element, renderer, localization, ngZone) {
|
|
1263
1332
|
super(element, renderer, null, localization, ngZone);
|
|
1264
1333
|
this.editService = editService;
|
|
@@ -1272,36 +1341,72 @@ let EditCommandDirective = class EditCommandDirective extends Button {
|
|
|
1272
1341
|
const index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
1273
1342
|
this.editService.beginEdit(index);
|
|
1274
1343
|
}
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
]
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
ElementRef,
|
|
1288
|
-
Renderer2,
|
|
1289
|
-
LocalizationService,
|
|
1290
|
-
NgZone])
|
|
1291
|
-
], EditCommandDirective);
|
|
1344
|
+
}
|
|
1345
|
+
EditCommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditCommandDirective, deps: [{ token: EditService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1346
|
+
EditCommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: EditCommandDirective, selector: "[kendoListViewEditCommand]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
1347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditCommandDirective, decorators: [{
|
|
1348
|
+
type: Directive,
|
|
1349
|
+
args: [{
|
|
1350
|
+
selector: '[kendoListViewEditCommand]'
|
|
1351
|
+
}]
|
|
1352
|
+
}], ctorParameters: function () { return [{ type: EditService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { clickHandler: [{
|
|
1353
|
+
type: HostListener,
|
|
1354
|
+
args: ['click', ['$event']]
|
|
1355
|
+
}] } });
|
|
1292
1356
|
|
|
1293
1357
|
/**
|
|
1294
|
-
* Represents the
|
|
1358
|
+
* Represents the command for adding a new item to the ListView. You can apply this directive to any
|
|
1359
|
+
* `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
|
|
1360
|
+
* When an associated button with the directive is clicked, the
|
|
1361
|
+
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event is triggered
|
|
1362
|
+
* ([see example]({% slug editing_listview %})).
|
|
1363
|
+
*
|
|
1364
|
+
* @example
|
|
1365
|
+
* ```html-no-run
|
|
1366
|
+
* <kendo-listview>
|
|
1367
|
+
* <ng-template kendoListViewHeaderTemplate>
|
|
1368
|
+
* <button kendoListViewAddCommand>Add new</button>
|
|
1369
|
+
* </ng-template>
|
|
1370
|
+
* </kendo-listview>
|
|
1371
|
+
* ```
|
|
1372
|
+
*/
|
|
1373
|
+
class AddCommandDirective extends Button {
|
|
1374
|
+
constructor(editService, element, renderer, localization, ngZone) {
|
|
1375
|
+
super(element, renderer, null, localization, ngZone);
|
|
1376
|
+
this.editService = editService;
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* @hidden
|
|
1380
|
+
*/
|
|
1381
|
+
clickHandler(e) {
|
|
1382
|
+
e.preventDefault();
|
|
1383
|
+
this.editService.beginAdd();
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
AddCommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AddCommandDirective, deps: [{ token: EditService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1387
|
+
AddCommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: AddCommandDirective, selector: "[kendoListViewAddCommand]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
1388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AddCommandDirective, decorators: [{
|
|
1389
|
+
type: Directive,
|
|
1390
|
+
args: [{
|
|
1391
|
+
selector: '[kendoListViewAddCommand]'
|
|
1392
|
+
}]
|
|
1393
|
+
}], ctorParameters: function () { return [{ type: EditService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { clickHandler: [{
|
|
1394
|
+
type: HostListener,
|
|
1395
|
+
args: ['click', ['$event']]
|
|
1396
|
+
}] } });
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* Represents the `save` command of the ListView. You can apply this directive to any `button`
|
|
1295
1400
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
1296
1401
|
* When an associated button with the directive is clicked, the
|
|
1297
|
-
* [`
|
|
1402
|
+
* [`save`]({% slug api_listview_listviewcomponent %}#toc-save) event
|
|
1298
1403
|
* is triggered ([see example]({% slug editing_listview %})).
|
|
1299
1404
|
*
|
|
1300
1405
|
* @example
|
|
1301
1406
|
* ```html-no-run
|
|
1302
1407
|
* <kendo-listview>
|
|
1303
1408
|
* <ng-template kendoListViewEditTemplate>
|
|
1304
|
-
* <button
|
|
1409
|
+
* <button kendoListViewSaveCommand>Save changes</button>
|
|
1305
1410
|
* </ng-template>
|
|
1306
1411
|
* </kendo-listview>
|
|
1307
1412
|
* ```
|
|
@@ -1312,12 +1417,12 @@ EditCommandDirective = __decorate([
|
|
|
1312
1417
|
* ```html-no-run
|
|
1313
1418
|
* <kendo-listview>
|
|
1314
1419
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
1315
|
-
* <button
|
|
1420
|
+
* <button kendoListViewSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
|
|
1316
1421
|
* </ng-template>
|
|
1317
1422
|
* </kendo-listview>
|
|
1318
1423
|
* ```
|
|
1319
1424
|
*/
|
|
1320
|
-
|
|
1425
|
+
class SaveCommandDirective extends Button {
|
|
1321
1426
|
constructor(editService, element, renderer, localization, ngZone) {
|
|
1322
1427
|
super(element, renderer, null, localization, ngZone);
|
|
1323
1428
|
this.editService = editService;
|
|
@@ -1330,39 +1435,34 @@ let CancelCommandDirective = class CancelCommandDirective extends Button {
|
|
|
1330
1435
|
e.preventDefault();
|
|
1331
1436
|
const index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
1332
1437
|
if (this.editService.isEdited(index)) {
|
|
1333
|
-
this.editService.
|
|
1438
|
+
this.editService.save(index);
|
|
1334
1439
|
}
|
|
1335
1440
|
}
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
]
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
ElementRef,
|
|
1349
|
-
Renderer2,
|
|
1350
|
-
LocalizationService,
|
|
1351
|
-
NgZone])
|
|
1352
|
-
], CancelCommandDirective);
|
|
1441
|
+
}
|
|
1442
|
+
SaveCommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SaveCommandDirective, deps: [{ token: EditService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1443
|
+
SaveCommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SaveCommandDirective, selector: "[kendoListViewSaveCommand]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
1444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SaveCommandDirective, decorators: [{
|
|
1445
|
+
type: Directive,
|
|
1446
|
+
args: [{
|
|
1447
|
+
selector: '[kendoListViewSaveCommand]'
|
|
1448
|
+
}]
|
|
1449
|
+
}], ctorParameters: function () { return [{ type: EditService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { clickHandler: [{
|
|
1450
|
+
type: HostListener,
|
|
1451
|
+
args: ['click', ['$event']]
|
|
1452
|
+
}] } });
|
|
1353
1453
|
|
|
1354
1454
|
/**
|
|
1355
|
-
* Represents the `
|
|
1455
|
+
* Represents the `cancel` command of the ListView. You can apply this directive to any `button`
|
|
1356
1456
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
1357
1457
|
* When an associated button with the directive is clicked, the
|
|
1358
|
-
* [`
|
|
1458
|
+
* [`cancel`]({% slug api_listview_listviewcomponent %}#toc-cancel) event
|
|
1359
1459
|
* is triggered ([see example]({% slug editing_listview %})).
|
|
1360
1460
|
*
|
|
1361
1461
|
* @example
|
|
1362
1462
|
* ```html-no-run
|
|
1363
1463
|
* <kendo-listview>
|
|
1364
1464
|
* <ng-template kendoListViewEditTemplate>
|
|
1365
|
-
* <button
|
|
1465
|
+
* <button kendoListViewCancelCommand>Cancel changes</button>
|
|
1366
1466
|
* </ng-template>
|
|
1367
1467
|
* </kendo-listview>
|
|
1368
1468
|
* ```
|
|
@@ -1373,12 +1473,12 @@ CancelCommandDirective = __decorate([
|
|
|
1373
1473
|
* ```html-no-run
|
|
1374
1474
|
* <kendo-listview>
|
|
1375
1475
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
1376
|
-
* <button
|
|
1476
|
+
* <button kendoListViewCancelCommand>{{isNew ? 'Discard' : 'Cancel changes'}}</button>
|
|
1377
1477
|
* </ng-template>
|
|
1378
1478
|
* </kendo-listview>
|
|
1379
1479
|
* ```
|
|
1380
1480
|
*/
|
|
1381
|
-
|
|
1481
|
+
class CancelCommandDirective extends Button {
|
|
1382
1482
|
constructor(editService, element, renderer, localization, ngZone) {
|
|
1383
1483
|
super(element, renderer, null, localization, ngZone);
|
|
1384
1484
|
this.editService = editService;
|
|
@@ -1391,26 +1491,21 @@ let SaveCommandDirective = class SaveCommandDirective extends Button {
|
|
|
1391
1491
|
e.preventDefault();
|
|
1392
1492
|
const index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
1393
1493
|
if (this.editService.isEdited(index)) {
|
|
1394
|
-
this.editService.
|
|
1494
|
+
this.editService.endEdit(index);
|
|
1395
1495
|
}
|
|
1396
1496
|
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
]
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
ElementRef,
|
|
1410
|
-
Renderer2,
|
|
1411
|
-
LocalizationService,
|
|
1412
|
-
NgZone])
|
|
1413
|
-
], SaveCommandDirective);
|
|
1497
|
+
}
|
|
1498
|
+
CancelCommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CancelCommandDirective, deps: [{ token: EditService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1499
|
+
CancelCommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: CancelCommandDirective, selector: "[kendoListViewCancelCommand]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
1500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CancelCommandDirective, decorators: [{
|
|
1501
|
+
type: Directive,
|
|
1502
|
+
args: [{
|
|
1503
|
+
selector: '[kendoListViewCancelCommand]'
|
|
1504
|
+
}]
|
|
1505
|
+
}], ctorParameters: function () { return [{ type: EditService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { clickHandler: [{
|
|
1506
|
+
type: HostListener,
|
|
1507
|
+
args: ['click', ['$event']]
|
|
1508
|
+
}] } });
|
|
1414
1509
|
|
|
1415
1510
|
/**
|
|
1416
1511
|
* Represents the `remove` command of the ListView. You can apply this directive to any `button` element
|
|
@@ -1428,7 +1523,7 @@ SaveCommandDirective = __decorate([
|
|
|
1428
1523
|
* </kendo-listview>
|
|
1429
1524
|
* ```
|
|
1430
1525
|
*/
|
|
1431
|
-
|
|
1526
|
+
class RemoveCommandDirective extends Button {
|
|
1432
1527
|
constructor(editService, element, renderer, localization, ngZone) {
|
|
1433
1528
|
super(element, renderer, null, localization, ngZone);
|
|
1434
1529
|
this.editService = editService;
|
|
@@ -1442,69 +1537,46 @@ let RemoveCommandDirective = class RemoveCommandDirective extends Button {
|
|
|
1442
1537
|
const index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
1443
1538
|
this.editService.remove(index);
|
|
1444
1539
|
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
]
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
ElementRef,
|
|
1458
|
-
Renderer2,
|
|
1459
|
-
LocalizationService,
|
|
1460
|
-
NgZone])
|
|
1461
|
-
], RemoveCommandDirective);
|
|
1540
|
+
}
|
|
1541
|
+
RemoveCommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RemoveCommandDirective, deps: [{ token: EditService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1542
|
+
RemoveCommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: RemoveCommandDirective, selector: "[kendoListViewRemoveCommand]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
1543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RemoveCommandDirective, decorators: [{
|
|
1544
|
+
type: Directive,
|
|
1545
|
+
args: [{
|
|
1546
|
+
selector: '[kendoListViewRemoveCommand]'
|
|
1547
|
+
}]
|
|
1548
|
+
}], ctorParameters: function () { return [{ type: EditService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { clickHandler: [{
|
|
1549
|
+
type: HostListener,
|
|
1550
|
+
args: ['click', ['$event']]
|
|
1551
|
+
}] } });
|
|
1462
1552
|
|
|
1463
1553
|
/**
|
|
1464
|
-
*
|
|
1465
|
-
* `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
|
|
1466
|
-
* When an associated button with the directive is clicked, the
|
|
1467
|
-
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event is triggered
|
|
1468
|
-
* ([see example]({% slug editing_listview %})).
|
|
1469
|
-
*
|
|
1470
|
-
* @example
|
|
1471
|
-
* ```html-no-run
|
|
1472
|
-
* <kendo-listview>
|
|
1473
|
-
* <ng-template kendoListViewHeaderTemplate>
|
|
1474
|
-
* <button kendoListViewAddCommand>Add new</button>
|
|
1475
|
-
* </ng-template>
|
|
1476
|
-
* </kendo-listview>
|
|
1477
|
-
* ```
|
|
1554
|
+
* @hidden
|
|
1478
1555
|
*/
|
|
1479
|
-
|
|
1480
|
-
constructor(
|
|
1481
|
-
|
|
1482
|
-
this.editService = editService;
|
|
1556
|
+
class TemplateContextDirective {
|
|
1557
|
+
constructor(viewContainerRef) {
|
|
1558
|
+
this.viewContainerRef = viewContainerRef;
|
|
1483
1559
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1560
|
+
set templateContext(context) {
|
|
1561
|
+
if (this.insertedViewRef) {
|
|
1562
|
+
this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
|
|
1563
|
+
this.insertedViewRef = undefined;
|
|
1564
|
+
}
|
|
1565
|
+
if (context.templateRef) {
|
|
1566
|
+
this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
|
|
1567
|
+
}
|
|
1490
1568
|
}
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
]
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
__metadata("design:paramtypes", [EditService,
|
|
1503
|
-
ElementRef,
|
|
1504
|
-
Renderer2,
|
|
1505
|
-
LocalizationService,
|
|
1506
|
-
NgZone])
|
|
1507
|
-
], AddCommandDirective);
|
|
1569
|
+
}
|
|
1570
|
+
TemplateContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplateContextDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1571
|
+
TemplateContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TemplateContextDirective, selector: "[templateContext]", inputs: { templateContext: "templateContext" }, ngImport: i0 });
|
|
1572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplateContextDirective, decorators: [{
|
|
1573
|
+
type: Directive,
|
|
1574
|
+
args: [{
|
|
1575
|
+
selector: '[templateContext]' // eslint-disable-line
|
|
1576
|
+
}]
|
|
1577
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { templateContext: [{
|
|
1578
|
+
type: Input
|
|
1579
|
+
}] } });
|
|
1508
1580
|
|
|
1509
1581
|
const TEMPLATE_DIRECTIVES = [
|
|
1510
1582
|
ItemTemplateDirective,
|
|
@@ -1535,36 +1607,68 @@ const EDITING_DIRECTIVES = [
|
|
|
1535
1607
|
* - [`DataBindingDirective`]({% slug api_listview_databindingdirective %})—The data binding directive.
|
|
1536
1608
|
* - [`EditTemplateDirective`]({% slug api_listview_editingdirective %}—The editing template directive.
|
|
1537
1609
|
*/
|
|
1538
|
-
|
|
1539
|
-
}
|
|
1540
|
-
ListViewModule =
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1610
|
+
class ListViewModule {
|
|
1611
|
+
}
|
|
1612
|
+
ListViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1613
|
+
ListViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewModule, declarations: [ItemTemplateDirective,
|
|
1614
|
+
HeaderTemplateDirective,
|
|
1615
|
+
FooterTemplateDirective,
|
|
1616
|
+
LoaderTemplateDirective, DataBindingDirective, EditTemplateDirective,
|
|
1617
|
+
EditCommandDirective,
|
|
1618
|
+
CancelCommandDirective,
|
|
1619
|
+
SaveCommandDirective,
|
|
1620
|
+
RemoveCommandDirective,
|
|
1621
|
+
AddCommandDirective, ListViewComponent,
|
|
1622
|
+
TemplateContextDirective,
|
|
1623
|
+
ListViewNavigableItemDirective], imports: [CommonModule,
|
|
1624
|
+
PagerModule,
|
|
1625
|
+
EventsModule], exports: [ItemTemplateDirective,
|
|
1626
|
+
HeaderTemplateDirective,
|
|
1627
|
+
FooterTemplateDirective,
|
|
1628
|
+
LoaderTemplateDirective, DataBindingDirective, EditTemplateDirective,
|
|
1629
|
+
EditCommandDirective,
|
|
1630
|
+
CancelCommandDirective,
|
|
1631
|
+
SaveCommandDirective,
|
|
1632
|
+
RemoveCommandDirective,
|
|
1633
|
+
AddCommandDirective, ListViewComponent,
|
|
1634
|
+
CommonModule,
|
|
1635
|
+
EventsModule] });
|
|
1636
|
+
ListViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewModule, imports: [[
|
|
1559
1637
|
CommonModule,
|
|
1560
1638
|
PagerModule,
|
|
1561
1639
|
EventsModule
|
|
1562
|
-
]
|
|
1563
|
-
|
|
1564
|
-
|
|
1640
|
+
], CommonModule,
|
|
1641
|
+
EventsModule] });
|
|
1642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListViewModule, decorators: [{
|
|
1643
|
+
type: NgModule,
|
|
1644
|
+
args: [{
|
|
1645
|
+
declarations: [
|
|
1646
|
+
TEMPLATE_DIRECTIVES,
|
|
1647
|
+
BINDING_DIRECTIVES,
|
|
1648
|
+
EDITING_DIRECTIVES,
|
|
1649
|
+
ListViewComponent,
|
|
1650
|
+
TemplateContextDirective,
|
|
1651
|
+
ListViewNavigableItemDirective
|
|
1652
|
+
],
|
|
1653
|
+
exports: [
|
|
1654
|
+
TEMPLATE_DIRECTIVES,
|
|
1655
|
+
BINDING_DIRECTIVES,
|
|
1656
|
+
EDITING_DIRECTIVES,
|
|
1657
|
+
ListViewComponent,
|
|
1658
|
+
CommonModule,
|
|
1659
|
+
EventsModule
|
|
1660
|
+
],
|
|
1661
|
+
imports: [
|
|
1662
|
+
CommonModule,
|
|
1663
|
+
PagerModule,
|
|
1664
|
+
EventsModule
|
|
1665
|
+
]
|
|
1666
|
+
}]
|
|
1667
|
+
}] });
|
|
1565
1668
|
|
|
1566
1669
|
/**
|
|
1567
1670
|
* Generated bundle index. Do not edit.
|
|
1568
1671
|
*/
|
|
1569
1672
|
|
|
1570
|
-
export { AddCommandDirective, CancelCommandDirective,
|
|
1673
|
+
export { AddCommandDirective, CancelCommandDirective, DataBindingDirective, EditCommandDirective, EditTemplateDirective, FooterTemplateDirective, HeaderTemplateDirective, ItemTemplateDirective, ListViewComponent, ListViewModule, LoaderTemplateDirective, PageSizeChangeEvent, RemoveCommandDirective, SaveCommandDirective };
|
|
1674
|
+
|