@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
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, HostListener, ElementRef, Renderer2 as Renderer, NgZone } from '@angular/core';
|
|
7
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { EditService } from '../edit.service';
|
|
10
|
-
import { getClosestListItemIndex } from '../../utils';
|
|
11
|
-
/**
|
|
12
|
-
* Represents the `remove` command of the ListView. You can apply this directive to any `button` element
|
|
13
|
-
* inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
14
|
-
* When an associated button with the directive is clicked, the
|
|
15
|
-
* [`remove` event]({% slug api_listview_listviewcomponent %}#toc-remove)
|
|
16
|
-
* is triggered ([see example]({% slug editing_listview %})).
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```html-no-run
|
|
20
|
-
* <kendo-listview>
|
|
21
|
-
* <ng-template kendoListViewEditTemplate>
|
|
22
|
-
* <button kendoListViewRemoveCommand>Remove item</button>
|
|
23
|
-
* </ng-template>
|
|
24
|
-
* </kendo-listview>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
var RemoveCommandDirective = /** @class */ (function (_super) {
|
|
28
|
-
tslib_1.__extends(RemoveCommandDirective, _super);
|
|
29
|
-
function RemoveCommandDirective(editService, element, renderer, localization, ngZone) {
|
|
30
|
-
var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
|
|
31
|
-
_this.editService = editService;
|
|
32
|
-
_this.elementRef = element;
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
RemoveCommandDirective.prototype.clickHandler = function (e) {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
var index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
41
|
-
this.editService.remove(index);
|
|
42
|
-
};
|
|
43
|
-
tslib_1.__decorate([
|
|
44
|
-
HostListener('click', ['$event']),
|
|
45
|
-
tslib_1.__metadata("design:type", Function),
|
|
46
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
47
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
48
|
-
], RemoveCommandDirective.prototype, "clickHandler", null);
|
|
49
|
-
RemoveCommandDirective = tslib_1.__decorate([
|
|
50
|
-
Directive({
|
|
51
|
-
selector: '[kendoListViewRemoveCommand]'
|
|
52
|
-
}),
|
|
53
|
-
tslib_1.__metadata("design:paramtypes", [EditService,
|
|
54
|
-
ElementRef,
|
|
55
|
-
Renderer,
|
|
56
|
-
LocalizationService,
|
|
57
|
-
NgZone])
|
|
58
|
-
], RemoveCommandDirective);
|
|
59
|
-
return RemoveCommandDirective;
|
|
60
|
-
}(Button));
|
|
61
|
-
export { RemoveCommandDirective };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, HostListener, ElementRef, Renderer2 as Renderer, NgZone } from '@angular/core';
|
|
7
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { EditService } from '../edit.service';
|
|
10
|
-
import { getClosestListItemIndex } from '../../utils';
|
|
11
|
-
/**
|
|
12
|
-
* Represents the `save` command of the ListView. You can apply this directive to any `button`
|
|
13
|
-
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
14
|
-
* When an associated button with the directive is clicked, the
|
|
15
|
-
* [`save`]({% slug api_listview_listviewcomponent %}#toc-save) event
|
|
16
|
-
* is triggered ([see example]({% slug editing_listview %})).
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```html-no-run
|
|
20
|
-
* <kendo-listview>
|
|
21
|
-
* <ng-template kendoListViewEditTemplate>
|
|
22
|
-
* <button kendoListViewSaveCommand>Save changes</button>
|
|
23
|
-
* </ng-template>
|
|
24
|
-
* </kendo-listview>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* You can control the content of the button based on the state of the item.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```html-no-run
|
|
31
|
-
* <kendo-listview>
|
|
32
|
-
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
33
|
-
* <button kendoListViewSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
|
|
34
|
-
* </ng-template>
|
|
35
|
-
* </kendo-listview>
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
var SaveCommandDirective = /** @class */ (function (_super) {
|
|
39
|
-
tslib_1.__extends(SaveCommandDirective, _super);
|
|
40
|
-
function SaveCommandDirective(editService, element, renderer, localization, ngZone) {
|
|
41
|
-
var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
|
|
42
|
-
_this.editService = editService;
|
|
43
|
-
_this.elementRef = element;
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
SaveCommandDirective.prototype.clickHandler = function (e) {
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
var index = getClosestListItemIndex(this.elementRef.nativeElement);
|
|
52
|
-
if (this.editService.isEdited(index)) {
|
|
53
|
-
this.editService.save(index);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
HostListener('click', ['$event']),
|
|
58
|
-
tslib_1.__metadata("design:type", Function),
|
|
59
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
60
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
61
|
-
], SaveCommandDirective.prototype, "clickHandler", null);
|
|
62
|
-
SaveCommandDirective = tslib_1.__decorate([
|
|
63
|
-
Directive({
|
|
64
|
-
selector: '[kendoListViewSaveCommand]'
|
|
65
|
-
}),
|
|
66
|
-
tslib_1.__metadata("design:paramtypes", [EditService,
|
|
67
|
-
ElementRef,
|
|
68
|
-
Renderer,
|
|
69
|
-
LocalizationService,
|
|
70
|
-
NgZone])
|
|
71
|
-
], SaveCommandDirective);
|
|
72
|
-
return SaveCommandDirective;
|
|
73
|
-
}(Button));
|
|
74
|
-
export { SaveCommandDirective };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, TemplateRef, Optional } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Represents the edit template of the ListView ([see example]({% slug editing_template_forms_listview %})).
|
|
9
|
-
* Helps to customize the content of the edited items. To define the template, nest an `<ng-template>`
|
|
10
|
-
* tag with the `kendoListViewEditTemplate` directive inside a `<kendo-listview>` tag.
|
|
11
|
-
*
|
|
12
|
-
* The template context contains the following fields:
|
|
13
|
-
* - `formGroup`—The current [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}).
|
|
14
|
-
* If you use the ListView inside [Template-Driven Forms]({{ site.data.urls.angular['forms'] }}), it will be `undefined`.
|
|
15
|
-
* - `itemIndex`—The current item index. If inside a new item, `itemIndex` is `-1`.
|
|
16
|
-
* - `dataItem`—The current data item.
|
|
17
|
-
* - `isNew`—The state of the current item.
|
|
18
|
-
*/
|
|
19
|
-
var EditTemplateDirective = /** @class */ (function () {
|
|
20
|
-
function EditTemplateDirective(templateRef) {
|
|
21
|
-
this.templateRef = templateRef;
|
|
22
|
-
}
|
|
23
|
-
EditTemplateDirective = tslib_1.__decorate([
|
|
24
|
-
Directive({
|
|
25
|
-
selector: '[kendoListViewEditTemplate]'
|
|
26
|
-
}),
|
|
27
|
-
tslib_1.__param(0, Optional()),
|
|
28
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
29
|
-
], EditTemplateDirective);
|
|
30
|
-
return EditTemplateDirective;
|
|
31
|
-
}());
|
|
32
|
-
export { EditTemplateDirective };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Injectable, EventEmitter, NgZone } from '@angular/core';
|
|
7
|
-
import { FormGroup } from '@angular/forms';
|
|
8
|
-
import { isPresent } from '../utils';
|
|
9
|
-
import { Subject } from 'rxjs';
|
|
10
|
-
import { switchMap, take } from 'rxjs/operators';
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
var isEqual = function (index) { return function (item) { return item.index === index; }; };
|
|
15
|
-
var ɵ0 = isEqual;
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
var isNotEqual = function (index) { return function (item) { return item.index !== index; }; };
|
|
20
|
-
var ɵ1 = isNotEqual;
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
var isNewItem = function (index) { return index === -1 || index === undefined; };
|
|
25
|
-
var ɵ2 = isNewItem;
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
var EditService = /** @class */ (function () {
|
|
30
|
-
function EditService(ngZone) {
|
|
31
|
-
var _this = this;
|
|
32
|
-
this.ngZone = ngZone;
|
|
33
|
-
this.changes = new EventEmitter();
|
|
34
|
-
this.editedIndices = [];
|
|
35
|
-
this.changedSource = new Subject();
|
|
36
|
-
this.changed = this.changedSource.asObservable().pipe(switchMap(function () { return _this.ngZone.onStable.asObservable().pipe(take(1)); }));
|
|
37
|
-
}
|
|
38
|
-
EditService.prototype.editItem = function (index, group) {
|
|
39
|
-
if (group === void 0) { group = undefined; }
|
|
40
|
-
this.editedIndices.push({ index: index, group: group });
|
|
41
|
-
this.onChanged();
|
|
42
|
-
};
|
|
43
|
-
EditService.prototype.addItem = function (group) {
|
|
44
|
-
this.newItem = { group: group };
|
|
45
|
-
this.onChanged();
|
|
46
|
-
};
|
|
47
|
-
EditService.prototype.isEditing = function () {
|
|
48
|
-
return this.editedIndices.length > 0;
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(EditService.prototype, "hasNewItem", {
|
|
51
|
-
get: function () {
|
|
52
|
-
return isPresent(this.newItem);
|
|
53
|
-
},
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(EditService.prototype, "newDataItem", {
|
|
58
|
-
get: function () {
|
|
59
|
-
if (this.hasNewItem) {
|
|
60
|
-
return this.newItem.group.value;
|
|
61
|
-
}
|
|
62
|
-
return {};
|
|
63
|
-
},
|
|
64
|
-
enumerable: true,
|
|
65
|
-
configurable: true
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(EditService.prototype, "newItemGroup", {
|
|
68
|
-
get: function () {
|
|
69
|
-
if (this.hasNewItem) {
|
|
70
|
-
return this.newItem.group;
|
|
71
|
-
}
|
|
72
|
-
return new FormGroup({});
|
|
73
|
-
},
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true
|
|
76
|
-
});
|
|
77
|
-
EditService.prototype.editGroup = function (index) {
|
|
78
|
-
return this.context(index).group;
|
|
79
|
-
};
|
|
80
|
-
EditService.prototype.close = function (index) {
|
|
81
|
-
if (isNewItem(index)) {
|
|
82
|
-
this.newItem = undefined;
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
this.editedIndices = this.editedIndices.filter(isNotEqual(index));
|
|
86
|
-
this.onChanged();
|
|
87
|
-
};
|
|
88
|
-
EditService.prototype.context = function (index) {
|
|
89
|
-
if (isNewItem(index)) {
|
|
90
|
-
return this.newItem;
|
|
91
|
-
}
|
|
92
|
-
return this.findByIndex(index);
|
|
93
|
-
};
|
|
94
|
-
EditService.prototype.isEdited = function (index) {
|
|
95
|
-
if (isNewItem(index) && isPresent(this.newItem)) {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
return isPresent(this.findByIndex(index));
|
|
99
|
-
};
|
|
100
|
-
EditService.prototype.hasEdited = function (index) {
|
|
101
|
-
return isPresent(this.context(index));
|
|
102
|
-
};
|
|
103
|
-
EditService.prototype.beginEdit = function (itemIndex) {
|
|
104
|
-
this.changes.emit({ action: 'edit', itemIndex: itemIndex });
|
|
105
|
-
};
|
|
106
|
-
EditService.prototype.beginAdd = function () {
|
|
107
|
-
this.changes.emit({ action: 'add' });
|
|
108
|
-
};
|
|
109
|
-
EditService.prototype.endEdit = function (itemIndex) {
|
|
110
|
-
var formGroup = this.context(itemIndex).group;
|
|
111
|
-
this.changes.emit({ action: 'cancel', itemIndex: itemIndex, formGroup: formGroup, isNew: isNewItem(itemIndex) });
|
|
112
|
-
};
|
|
113
|
-
EditService.prototype.save = function (itemIndex) {
|
|
114
|
-
var formGroup = this.context(itemIndex).group;
|
|
115
|
-
this.changes.emit({ action: 'save', itemIndex: itemIndex, formGroup: formGroup, isNew: isNewItem(itemIndex) });
|
|
116
|
-
};
|
|
117
|
-
EditService.prototype.remove = function (itemIndex) {
|
|
118
|
-
this.changes.emit({ action: 'remove', itemIndex: itemIndex });
|
|
119
|
-
};
|
|
120
|
-
EditService.prototype.findByIndex = function (index) {
|
|
121
|
-
return this.editedIndices.find(isEqual(index));
|
|
122
|
-
};
|
|
123
|
-
EditService.prototype.onChanged = function () {
|
|
124
|
-
var _this = this;
|
|
125
|
-
this.ngZone.runOutsideAngular(function () {
|
|
126
|
-
_this.changedSource.next();
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
EditService = tslib_1.__decorate([
|
|
130
|
-
Injectable(),
|
|
131
|
-
tslib_1.__metadata("design:paramtypes", [NgZone])
|
|
132
|
-
], EditService);
|
|
133
|
-
return EditService;
|
|
134
|
-
}());
|
|
135
|
-
export { EditService };
|
|
136
|
-
export { ɵ0, ɵ1, ɵ2 };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
package/dist/es/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export * from './main';
|
|
9
|
-
export { AddCommandDirective } from './editing/commands/add-command.directive';
|
|
10
|
-
export { CancelCommandDirective } from './editing/commands/cancel-command.directive';
|
|
11
|
-
export { EditCommandDirective } from './editing/commands/edit-command.directive';
|
|
12
|
-
export { RemoveCommandDirective } from './editing/commands/remove-command.directive';
|
|
13
|
-
export { SaveCommandDirective } from './editing/commands/save-command.directive';
|
|
14
|
-
export { EditService } from './editing/edit.service';
|
|
15
|
-
export { ListViewNavigableItemDirective } from './navigation/listview-navigable-item.directive';
|
|
16
|
-
export { NavigationService } from './navigation/navigation.service';
|
|
17
|
-
export { TemplateContextDirective } from './templates/template-context.directive';
|