@fundamental-ngx/platform 0.43.37 → 0.43.39
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/approval-flow/approval-flow-user-list/approval-flow-user-list.component.d.ts +10 -0
- package/button/button.component.d.ts +1 -2
- package/esm2020/approval-flow/approval-flow-add-node/approval-flow-add-node.component.mjs +2 -4
- package/esm2020/approval-flow/approval-flow-user-list/approval-flow-user-list.component.mjs +50 -14
- package/esm2020/button/button.component.mjs +5 -3
- package/esm2020/list/base-list-item.mjs +4 -2
- package/esm2020/list/list.component.mjs +12 -2
- package/esm2020/table/components/table-row/table-row.component.mjs +3 -3
- package/esm2020/table/table.component.mjs +3 -3
- package/esm2020/table-helpers/directives/table-virtual-scroll.directive.mjs +9 -6
- package/esm2020/value-help-dialog/value-help-dialog/value-help-dialog.component.mjs +3 -3
- package/fesm2015/fundamental-ngx-platform-approval-flow.mjs +52 -20
- package/fesm2015/fundamental-ngx-platform-approval-flow.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-platform-button.mjs +4 -2
- package/fesm2015/fundamental-ngx-platform-button.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-platform-list.mjs +15 -2
- package/fesm2015/fundamental-ngx-platform-list.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-platform-table-helpers.mjs +8 -5
- package/fesm2015/fundamental-ngx-platform-table-helpers.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-platform-table.mjs +4 -4
- package/fesm2015/fundamental-ngx-platform-table.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-platform-value-help-dialog.mjs +2 -2
- package/fesm2015/fundamental-ngx-platform-value-help-dialog.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-approval-flow.mjs +50 -18
- package/fesm2020/fundamental-ngx-platform-approval-flow.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-button.mjs +4 -2
- package/fesm2020/fundamental-ngx-platform-button.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-list.mjs +14 -2
- package/fesm2020/fundamental-ngx-platform-list.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-table-helpers.mjs +8 -5
- package/fesm2020/fundamental-ngx-platform-table-helpers.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-table.mjs +4 -4
- package/fesm2020/fundamental-ngx-platform-table.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-platform-value-help-dialog.mjs +2 -2
- package/fesm2020/fundamental-ngx-platform-value-help-dialog.mjs.map +1 -1
- package/fundamental-ngx-platform-v0.43.39.tgz +0 -0
- package/list/list.component.d.ts +6 -0
- package/package.json +4 -4
- package/schematics/ng-add/index.js +1 -1
- package/fundamental-ngx-platform-v0.43.37.tgz +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ViewChild, ViewChildren, Directive, Optional, HostBinding, ContentChild, Injectable, Inject, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ViewChild, ViewChildren, Directive, Optional, HostBinding, ContentChild, Injectable, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import { UP_ARROW, DOWN_ARROW, RIGHT_ARROW, LEFT_ARROW } from '@angular/cdk/keycodes';
|
|
4
|
-
import { Subscription, combineLatest, Subject, merge, fromEvent } from 'rxjs';
|
|
4
|
+
import { takeUntil, Subscription, combineLatest, Subject, merge, fromEvent } from 'rxjs';
|
|
5
5
|
import { throttleTime, startWith, switchMap, mapTo, map, distinctUntilChanged } from 'rxjs/operators';
|
|
6
6
|
import * as i6 from '@fundamental-ngx/cdk/utils';
|
|
7
|
-
import { KeyUtil } from '@fundamental-ngx/cdk/utils';
|
|
7
|
+
import { DestroyedService, KeyUtil } from '@fundamental-ngx/cdk/utils';
|
|
8
8
|
import * as i1$1 from '@fundamental-ngx/core/dialog';
|
|
9
9
|
import { DialogModule } from '@fundamental-ngx/core/dialog';
|
|
10
10
|
import * as i1 from '@angular/common';
|
|
@@ -150,17 +150,22 @@ class ApprovalFlowUserListComponent {
|
|
|
150
150
|
this._trackByFn = trackByFn;
|
|
151
151
|
/** @hidden */
|
|
152
152
|
this._displayUsers = [];
|
|
153
|
+
/** @hidden */
|
|
154
|
+
this._allSelectedUsers = [];
|
|
155
|
+
/** @hidden */
|
|
156
|
+
this._destroyed$ = inject(DestroyedService);
|
|
157
|
+
/** @hidden */
|
|
158
|
+
this._dontCallSelection = false;
|
|
153
159
|
}
|
|
154
160
|
/** @hidden */
|
|
155
161
|
ngAfterViewInit() {
|
|
156
162
|
if (this.selectedUsers.length) {
|
|
157
|
-
|
|
158
|
-
this.
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this._cdr.detectChanges();
|
|
163
|
+
this._selectItems(this.selectedUsers);
|
|
164
|
+
this._allSelectedUsers = [...this.selectedUsers];
|
|
165
|
+
this._cdr.markForCheck();
|
|
166
|
+
}
|
|
167
|
+
if (this.isSelectable) {
|
|
168
|
+
this._listenToListItemChange();
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
/** @hidden */
|
|
@@ -175,13 +180,22 @@ class ApprovalFlowUserListComponent {
|
|
|
175
180
|
}
|
|
176
181
|
/** @hidden */
|
|
177
182
|
_onSelect(event) {
|
|
178
|
-
this.
|
|
179
|
-
|
|
183
|
+
if (!this._dontCallSelection) {
|
|
184
|
+
this._selectedItems = event.selectedItems;
|
|
185
|
+
if (event.removed) {
|
|
186
|
+
this._allSelectedUsers = this._allSelectedUsers.filter((user) => `${this._idPrefix + user.id}` !== event.removed.id);
|
|
187
|
+
}
|
|
188
|
+
if (event.added) {
|
|
189
|
+
this._allSelectedUsers.push(...this._getUsersFromSelectedItems([event.added]));
|
|
190
|
+
}
|
|
191
|
+
this.onSelectionChange.emit(this._allSelectedUsers);
|
|
192
|
+
this._cdr.detectChanges();
|
|
193
|
+
}
|
|
180
194
|
}
|
|
181
195
|
/** @hidden */
|
|
182
196
|
_getUsersFromSelectedItems(items) {
|
|
183
197
|
return items
|
|
184
|
-
.map((item) => this.users.find((user) => `${this._idPrefix + user.id}` === item.
|
|
198
|
+
.map((item) => this.users.find((user) => `${this._idPrefix + user.id}` === item.id))
|
|
185
199
|
.filter((u) => !!u);
|
|
186
200
|
}
|
|
187
201
|
/** @hidden */
|
|
@@ -217,14 +231,34 @@ class ApprovalFlowUserListComponent {
|
|
|
217
231
|
clearInterval(this._intervalID);
|
|
218
232
|
}
|
|
219
233
|
}
|
|
234
|
+
/** @hidden */
|
|
235
|
+
_listenToListItemChange() {
|
|
236
|
+
this.listItems.changes.pipe(takeUntil(this._destroyed$)).subscribe(() => {
|
|
237
|
+
this._selectItems(this._allSelectedUsers);
|
|
238
|
+
this._cdr.detectChanges();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** @hidden */
|
|
242
|
+
_selectItems(users) {
|
|
243
|
+
this._dontCallSelection = true;
|
|
244
|
+
const allSelectedUserNames = users.map((user) => this._idPrefix + user.id);
|
|
245
|
+
const currentSelectedList = this.listItems.filter((item) => allSelectedUserNames.includes(item.id));
|
|
246
|
+
this.list._clearSelection();
|
|
247
|
+
this._selectedItems = [...currentSelectedList];
|
|
248
|
+
this._selectedItems.forEach((item) => {
|
|
249
|
+
item._selected = true;
|
|
250
|
+
this.list._selectItem(item);
|
|
251
|
+
});
|
|
252
|
+
this._dontCallSelection = false;
|
|
253
|
+
}
|
|
220
254
|
}
|
|
221
255
|
ApprovalFlowUserListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApprovalFlowUserListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
222
|
-
ApprovalFlowUserListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ApprovalFlowUserListComponent, selector: "fdp-approval-flow-user-list", inputs: { users: "users", selectedUsers: "selectedUsers", isSelectable: "isSelectable" }, outputs: { onUserClick: "onUserClick", onSelectionChange: "onSelectionChange" }, host: { classAttribute: "fdp-approval-flow-user-list" }, viewQueries: [{ propertyName: "list", first: true, predicate: ListComponent, descendants: true }, { propertyName: "listItems", predicate: StandardListItemComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"fdp-approval-flow-user-list__selected-count\" *ngIf=\"
|
|
256
|
+
ApprovalFlowUserListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ApprovalFlowUserListComponent, selector: "fdp-approval-flow-user-list", inputs: { users: "users", selectedUsers: "selectedUsers", isSelectable: "isSelectable" }, outputs: { onUserClick: "onUserClick", onSelectionChange: "onSelectionChange" }, host: { classAttribute: "fdp-approval-flow-user-list" }, providers: [DestroyedService], viewQueries: [{ propertyName: "list", first: true, predicate: ListComponent, descendants: true }, { propertyName: "listItems", predicate: StandardListItemComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"fdp-approval-flow-user-list__selected-count\" *ngIf=\"_allSelectedUsers.length\">\n <ng-container *ngIf=\"_allSelectedUsers.length === 1; else multipleItems\">\n {{ 'platformApprovalFlow.userListSelectedItemsCountSingular' | fdTranslate }}\n </ng-container>\n\n <ng-template #multipleItems>\n {{\n 'platformApprovalFlow.userListSelectedItemsCountPlural' | fdTranslate : { count: _allSelectedUsers.length }\n }}\n </ng-template>\n</div>\n\n<fdp-list\n [selectionMode]=\"isSelectable ? 'multi' : 'none'\"\n [selection]=\"isSelectable\"\n [navigationIndicator]=\"true\"\n [hasByLine]=\"true\"\n [(ngModel)]=\"_selectedItems\"\n [selectedItems]=\"_selectedItems\"\n (selectedItemChange)=\"_onSelect($event)\"\n>\n <fdp-standard-list-item\n *ngFor=\"let _user of _displayUsers; trackBy: _trackByFn\"\n [attr.id]=\"_idPrefix + _user.id\"\n [id]=\"_idPrefix + _user.id\"\n [avatarSrc]=\"_user.imgUrl\"\n [avatarTitle]=\"_user.name\"\n [description]=\"_user.description\"\n [ariaLabel]=\"_user.name\"\n [title]=\"_user.name\"\n (click)=\"$event.stopPropagation(); onUserClick.emit(_user)\"\n ></fdp-standard-list-item>\n</fdp-list>\n", styles: [".fdp-approval-flow-user-list{display:block;margin-top:-1rem}.fdp-approval-flow-user-list__selected-count{line-height:2rem;margin:0 -1rem;padding:0 1rem;background:#f2f2f2;background:var(--sapList_HeaderBackground, #f2f2f2)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.ListComponent, selector: "fdp-list", inputs: ["selectedItems", "ariaSetsize", "ariaMultiselectable", "loadTitle", "loadingLabel", "delayTime", "itemSize", "loadMore", "loadOnScroll", "role", "listType", "maxHeight", "noBorder", "scrollOffsetPercentage", "selection", "selectionMode", "value", "rowSelection", "dataSource", "navigated", "navigationIndicator", "hasByLine", "hasObject", "unreadIndicator", "interceptTabKey"], outputs: ["selectedItemChange"] }, { kind: "component", type: i3.StandardListItemComponent, selector: "fdp-standard-list-item" }, { kind: "pipe", type: i10.FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
223
257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApprovalFlowUserListComponent, decorators: [{
|
|
224
258
|
type: Component,
|
|
225
259
|
args: [{ selector: 'fdp-approval-flow-user-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
226
260
|
class: 'fdp-approval-flow-user-list'
|
|
227
|
-
}, template: "<div class=\"fdp-approval-flow-user-list__selected-count\" *ngIf=\"
|
|
261
|
+
}, providers: [DestroyedService], template: "<div class=\"fdp-approval-flow-user-list__selected-count\" *ngIf=\"_allSelectedUsers.length\">\n <ng-container *ngIf=\"_allSelectedUsers.length === 1; else multipleItems\">\n {{ 'platformApprovalFlow.userListSelectedItemsCountSingular' | fdTranslate }}\n </ng-container>\n\n <ng-template #multipleItems>\n {{\n 'platformApprovalFlow.userListSelectedItemsCountPlural' | fdTranslate : { count: _allSelectedUsers.length }\n }}\n </ng-template>\n</div>\n\n<fdp-list\n [selectionMode]=\"isSelectable ? 'multi' : 'none'\"\n [selection]=\"isSelectable\"\n [navigationIndicator]=\"true\"\n [hasByLine]=\"true\"\n [(ngModel)]=\"_selectedItems\"\n [selectedItems]=\"_selectedItems\"\n (selectedItemChange)=\"_onSelect($event)\"\n>\n <fdp-standard-list-item\n *ngFor=\"let _user of _displayUsers; trackBy: _trackByFn\"\n [attr.id]=\"_idPrefix + _user.id\"\n [id]=\"_idPrefix + _user.id\"\n [avatarSrc]=\"_user.imgUrl\"\n [avatarTitle]=\"_user.name\"\n [description]=\"_user.description\"\n [ariaLabel]=\"_user.name\"\n [title]=\"_user.name\"\n (click)=\"$event.stopPropagation(); onUserClick.emit(_user)\"\n ></fdp-standard-list-item>\n</fdp-list>\n", styles: [".fdp-approval-flow-user-list{display:block;margin-top:-1rem}.fdp-approval-flow-user-list__selected-count{line-height:2rem;margin:0 -1rem;padding:0 1rem;background:#f2f2f2;background:var(--sapList_HeaderBackground, #f2f2f2)}\n"] }]
|
|
228
262
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { users: [{
|
|
229
263
|
type: Input
|
|
230
264
|
}], selectedUsers: [{
|
|
@@ -962,11 +996,9 @@ class ApprovalFlowAddNodeComponent {
|
|
|
962
996
|
}
|
|
963
997
|
/** @hidden */
|
|
964
998
|
_exitSelectMode() {
|
|
965
|
-
var _a, _b;
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
}
|
|
969
|
-
if (!this._data.isEdit && !((_b = this._data.node) === null || _b === void 0 ? void 0 : _b.approvalTeamId)) {
|
|
999
|
+
var _a, _b, _c;
|
|
1000
|
+
this._selectedApprovers = ((_b = (_a = this._data.node) === null || _a === void 0 ? void 0 : _a.approvers) === null || _b === void 0 ? void 0 : _b.length) ? [...this._data.node.approvers] : [];
|
|
1001
|
+
if (!this._data.isEdit && !((_c = this._data.node) === null || _c === void 0 ? void 0 : _c.approvalTeamId)) {
|
|
970
1002
|
this.viewService.resetTeam();
|
|
971
1003
|
}
|
|
972
1004
|
this._selectMode = false;
|