@bcgov/nr-ngx-component-lib 0.0.63 → 0.0.64
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/components/list-attachments/list-attachments.component.d.ts +5 -3
- package/components/list-event-history/list-event-history.component.d.ts +5 -3
- package/components/list-select/list-select.component.d.ts +3 -3
- package/components/schedule/schedule.component.d.ts +3 -3
- package/directives/pagination.base.d.ts +13 -4
- package/directives/row-list.base.d.ts +2 -3
- package/esm2022/components/list-attachments/list-attachments.component.mjs +7 -5
- package/esm2022/components/list-event-history/list-event-history.component.mjs +7 -5
- package/esm2022/components/list-select/list-select.component.mjs +2 -4
- package/esm2022/components/schedule/schedule.component.mjs +1 -1
- package/esm2022/directives/pagination.base.mjs +41 -16
- package/esm2022/directives/row-list.base.mjs +12 -14
- package/esm2022/services/page-state.service.mjs +11 -13
- package/fesm2022/bcgov-nr-ngx-component-lib.mjs +73 -50
- package/fesm2022/bcgov-nr-ngx-component-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/services/page-state.service.d.ts +4 -4
|
@@ -1255,19 +1255,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1255
1255
|
|
|
1256
1256
|
class PageStateService {
|
|
1257
1257
|
constructor() {
|
|
1258
|
-
this.
|
|
1258
|
+
this._pageState = {};
|
|
1259
1259
|
}
|
|
1260
|
-
getPageState(
|
|
1261
|
-
if (this.
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
return defaultState();
|
|
1260
|
+
getPageState(id) {
|
|
1261
|
+
if (id in this._pageState)
|
|
1262
|
+
return this._pageState[id];
|
|
1263
|
+
}
|
|
1264
|
+
setPageState(id, state) {
|
|
1265
|
+
this._pageState[id] = state;
|
|
1267
1266
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
this.classRegistry.set(classConstructor, sc);
|
|
1267
|
+
deletePageState(id) {
|
|
1268
|
+
delete this._pageState[id];
|
|
1271
1269
|
}
|
|
1272
1270
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PageStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1273
1271
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PageStateService, providedIn: "root" }); }
|
|
@@ -1277,7 +1275,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1277
1275
|
args: [{
|
|
1278
1276
|
providedIn: "root"
|
|
1279
1277
|
}]
|
|
1280
|
-
}]
|
|
1278
|
+
}] });
|
|
1281
1279
|
|
|
1282
1280
|
class Aborted {
|
|
1283
1281
|
constructor(reason) {
|
|
@@ -1372,9 +1370,18 @@ class PaginationBase extends NrclBase {
|
|
|
1372
1370
|
set filter(f) {
|
|
1373
1371
|
this._filter = this.clone(f);
|
|
1374
1372
|
}
|
|
1373
|
+
get instance() {
|
|
1374
|
+
return this._instance;
|
|
1375
|
+
}
|
|
1375
1376
|
ngAfterViewInit() {
|
|
1376
1377
|
// console.log('PaginationBase.ngAfterViewInit')
|
|
1377
|
-
this.
|
|
1378
|
+
this.onInitPageState();
|
|
1379
|
+
}
|
|
1380
|
+
onInitPageState() {
|
|
1381
|
+
let init = this.getInitialPageState();
|
|
1382
|
+
this._instance = init.instance;
|
|
1383
|
+
let saved = this.retrieveState();
|
|
1384
|
+
this.setCurrentPageState(saved || init);
|
|
1378
1385
|
}
|
|
1379
1386
|
clone(obj) {
|
|
1380
1387
|
return JSON.parse(JSON.stringify(obj));
|
|
@@ -1394,20 +1401,17 @@ class PaginationBase extends NrclBase {
|
|
|
1394
1401
|
}
|
|
1395
1402
|
onPageNumberChange(ev) {
|
|
1396
1403
|
this._pageConfig.pageNumber = ev;
|
|
1404
|
+
this.onPageStateChanged();
|
|
1397
1405
|
}
|
|
1398
|
-
|
|
1399
|
-
return this.
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
this._pageConfig.pageSize = state.pageConfig.pageSize;
|
|
1405
|
-
this._pageConfig.pageNumber = state.pageConfig.pageNumber;
|
|
1406
|
-
this._pageConfig.sortActive = state.pageConfig.sortActive;
|
|
1407
|
-
this._pageConfig.sortDirection = state.pageConfig.sortDirection;
|
|
1406
|
+
onPageStateChanged() {
|
|
1407
|
+
return this.refresh()
|
|
1408
|
+
.then(() => {
|
|
1409
|
+
let state = this.getCurrentPageState();
|
|
1410
|
+
this.persistState(state);
|
|
1411
|
+
});
|
|
1408
1412
|
}
|
|
1409
|
-
|
|
1410
|
-
|
|
1413
|
+
getCurrentPageState() {
|
|
1414
|
+
return {
|
|
1411
1415
|
filter: this.filter,
|
|
1412
1416
|
pageConfig: {
|
|
1413
1417
|
pageSize: this._pageConfig.pageSize,
|
|
@@ -1415,8 +1419,27 @@ class PaginationBase extends NrclBase {
|
|
|
1415
1419
|
sortActive: this._pageConfig.sortActive,
|
|
1416
1420
|
sortDirection: this._pageConfig.sortDirection,
|
|
1417
1421
|
}
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
setCurrentPageState(state) {
|
|
1425
|
+
this.filter = state.filter;
|
|
1426
|
+
this._pageConfig.pageSize = state.pageConfig.pageSize;
|
|
1427
|
+
this._pageConfig.pageNumber = state.pageConfig.pageNumber;
|
|
1428
|
+
this._pageConfig.sortActive = state.pageConfig.sortActive;
|
|
1429
|
+
this._pageConfig.sortDirection = state.pageConfig.sortDirection;
|
|
1430
|
+
}
|
|
1431
|
+
persistState(state) {
|
|
1432
|
+
if (!this._instance)
|
|
1433
|
+
return;
|
|
1434
|
+
this.pageStateService.setPageState(this._instance, JSON.stringify(state));
|
|
1435
|
+
}
|
|
1436
|
+
retrieveState() {
|
|
1437
|
+
if (!this._instance)
|
|
1438
|
+
return;
|
|
1439
|
+
let state = this.pageStateService.getPageState(this._instance);
|
|
1440
|
+
if (!state)
|
|
1441
|
+
return;
|
|
1442
|
+
return JSON.parse(state);
|
|
1420
1443
|
}
|
|
1421
1444
|
paginateState(id) {
|
|
1422
1445
|
return {
|
|
@@ -1477,15 +1500,13 @@ class RowListBase extends PaginationBase {
|
|
|
1477
1500
|
return this.loadRowList();
|
|
1478
1501
|
})
|
|
1479
1502
|
.then((res) => {
|
|
1503
|
+
inProgress.progress();
|
|
1480
1504
|
if (!res)
|
|
1481
1505
|
return;
|
|
1482
|
-
if (inProgress.isCancelled)
|
|
1483
|
-
return;
|
|
1484
1506
|
return this.parseRowList(res);
|
|
1485
1507
|
})
|
|
1486
1508
|
.then(res => {
|
|
1487
|
-
|
|
1488
|
-
return;
|
|
1509
|
+
inProgress.progress();
|
|
1489
1510
|
return this.completedRowListPage();
|
|
1490
1511
|
})
|
|
1491
1512
|
.catch((err) => {
|
|
@@ -1494,8 +1515,6 @@ class RowListBase extends PaginationBase {
|
|
|
1494
1515
|
this.loadRowListPageFailed(err);
|
|
1495
1516
|
})
|
|
1496
1517
|
.finally(() => {
|
|
1497
|
-
if (inProgress.isCancelled)
|
|
1498
|
-
return;
|
|
1499
1518
|
inProgress.complete();
|
|
1500
1519
|
this.isLoading = false;
|
|
1501
1520
|
this.changeDetectorRef.detectChanges();
|
|
@@ -1527,12 +1546,8 @@ class RowListBase extends PaginationBase {
|
|
|
1527
1546
|
this._rows = [];
|
|
1528
1547
|
this._totalRowCount = 0;
|
|
1529
1548
|
}
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
this.refreshRowList()
|
|
1533
|
-
.then(() => {
|
|
1534
|
-
this.savePageState();
|
|
1535
|
-
});
|
|
1549
|
+
refresh() {
|
|
1550
|
+
return this.refreshRowList();
|
|
1536
1551
|
}
|
|
1537
1552
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RowListBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1538
1553
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: RowListBase, outputs: { isLoadingChange: "isLoadingChange" }, usesInheritance: true, ngImport: i0 }); }
|
|
@@ -1557,6 +1572,12 @@ class InProgress {
|
|
|
1557
1572
|
return;
|
|
1558
1573
|
this._cancelled = true;
|
|
1559
1574
|
}
|
|
1575
|
+
progress() {
|
|
1576
|
+
if (this.isCompleted)
|
|
1577
|
+
return;
|
|
1578
|
+
if (this.isCancelled)
|
|
1579
|
+
throw new Aborted('InProgress cancelled');
|
|
1580
|
+
}
|
|
1560
1581
|
get isCompleted() {
|
|
1561
1582
|
return this._completed;
|
|
1562
1583
|
}
|
|
@@ -1797,14 +1818,19 @@ class ListAttachmentsComponent extends RowListBase {
|
|
|
1797
1818
|
}
|
|
1798
1819
|
}
|
|
1799
1820
|
getInitialPageState() {
|
|
1821
|
+
if (!this.rowListProvider?.getInitialPageState)
|
|
1822
|
+
throw Error('no provider for ListAttachmentsComponent.rowListProvider.getInitialPageState');
|
|
1823
|
+
let state = this.rowListProvider.getInitialPageState();
|
|
1800
1824
|
return {
|
|
1825
|
+
instance: state.instance,
|
|
1801
1826
|
filter: {},
|
|
1802
1827
|
pageConfig: {
|
|
1803
1828
|
pageSize: 10,
|
|
1804
1829
|
pageNumber: 1,
|
|
1805
1830
|
sortActive: 'uploadedTimestamp',
|
|
1806
1831
|
sortDirection: 'desc',
|
|
1807
|
-
|
|
1832
|
+
...state.pageConfig
|
|
1833
|
+
},
|
|
1808
1834
|
};
|
|
1809
1835
|
}
|
|
1810
1836
|
fetchRowListPage() {
|
|
@@ -1832,9 +1858,6 @@ class ListAttachmentsComponent extends RowListBase {
|
|
|
1832
1858
|
throw Error('no provider for ListAttachmentsComponent.rowListProvider.onDeleteClick.');
|
|
1833
1859
|
return this.rowListProvider.deleteItem(item);
|
|
1834
1860
|
}
|
|
1835
|
-
savePageState() {
|
|
1836
|
-
// state not saved
|
|
1837
|
-
}
|
|
1838
1861
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListAttachmentsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1839
1862
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListAttachmentsComponent, selector: "nrcl-list-attachments", inputs: { rowListProvider: "rowListProvider", canDelete: "canDelete", canDownload: "canDownload", showOrgUnit: "showOrgUnit", noRowsMessage: "noRowsMessage" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nrcl-device-view>\n <ng-template desktop-view>\n @if ( rows?.length > 0 ) {\n <nrcl-row-list-desktop [showRowHover]=\"false\">\n <mat-table\n [dataSource]=\"rows | paginate: paginateState( 'desktop-attachments' )\"\n matSort\n [matSortActive]=\"sortActive\"\n [matSortDirection]=\"sortDirection\"\n (matSortChange)=\"onSortChange( $event )\"\n >\n <ng-container matColumnDef=\"attachmentTypeCode\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Attachment Type</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content tooltip>{{ item.attachmentTypeDescription }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n<!-- Only show this column for prep sheet attachment section-->\n <ng-container matColumnDef=\"orgUnit\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Org Unit</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.orgUnit }}\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"fileName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>File Name</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-button anchor tooltip\n [label]=\"item.fileName\"\n iconRight=\"download\"\n (click)=\"onDownloadClick( item )\"\n ></nrcl-button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"fileExtension\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>File Type</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.fileExtension }}\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"uploadedBy\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Uploaded By</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.uploadedBy }}\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"uploadedTimestamp\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Uploaded Date</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.uploadedTimestamp }}\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"description\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Description</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.attachmentDescription }}\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"download\">\n <mat-header-cell *matHeaderCellDef>Down­load</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-button compact\n icon=\"download\"\n (click)=\"onDownloadClick( item )\"\n ></nrcl-button>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"delete\">\n <mat-header-cell *matHeaderCellDef>Delete</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-button compact\n icon=\"delete\"\n (click)=\"onDeleteClick( item )\"\n ></nrcl-button>\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"columns; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let item; columns: columns;\"></mat-row>\n </mat-table>\n </nrcl-row-list-desktop>\n\n <nrcl-gap/>\n }\n\n <nrcl-row-list-pagination\n paginationId=\"desktop-attachments\"\n [pageSize]=\"pageSize\"\n [pageNumber]=\"pageNumber\"\n [rowCount]=\"totalRowCount\"\n (pageNumberChange)=\"onPageNumberChange( $event )\"\n (pageSizeChange)=\"onPageSizeChange( $event )\"\n [noRowsMessage]=\"noRowsMessage\"\n ></nrcl-row-list-pagination>\n </ng-template>\n\n <ng-template mobile-view>\n <nrcl-gap/>\n\n @if ( rows?.length > 0 ) {\n <nrcl-row-list-sorting\n [sortColumn]=\"sortActive\"\n [sortColumnOptions]=\"sortColumns\"\n [sortDirection]=\"sortDirection\"\n (sortChange)=\"onSortChange($event)\">\n </nrcl-row-list-sorting>\n\n <nrcl-gap/>\n\n <nrcl-row-list-mobile>\n @for ( item of rows | paginate: paginateState( 'mobile-attachments' ); track item.attachmentId ) {\n <mat-card>\n <mat-card-content>\n <section full-width class=\"filename\">\n <mat-label>File Name</mat-label>\n <div class=\"value\">\n <nrcl-button anchor\n [label]=\"item.fileName\"\n iconRight=\"download\"\n (click)=\"onDownloadClick( item )\"\n ></nrcl-button>\n </div>\n </section>\n\n <section>\n <mat-label>Attachment Type</mat-label>\n <div class=\"value\">{{ item.attachmentTypeDescription }}</div>\n </section>\n\n <section>\n <mat-label>File Type</mat-label>\n <div class=\"value\">{{ item.fileExtension }}</div>\n </section>\n\n <section>\n <mat-label>Uploaded By</mat-label>\n <div class=\"value\">{{ item.uploadedBy }}</div>\n </section>\n\n <section>\n <mat-label>Uploaded Date</mat-label>\n <div class=\"value\">{{ item.uploadedTimestamp }}</div>\n </section>\n\n @if ( showOrgUnit ) {\n <section full-width>\n <mat-label>Org Unit</mat-label>\n <div class=\"value\">{{ item.orgUnit }}</div>\n </section>\n }\n\n <section full-width>\n <mat-label>Description</mat-label>\n <div class=\"value\">{{ item.attachmentDescription }}</div>\n </section>\n </mat-card-content>\n\n <mat-card-footer>\n @if ( canDownload ) {\n <nrcl-button compact\n label=\"Download\"\n icon=\"download\"\n (click)=\"onDownloadClick( item )\"\n ></nrcl-button>\n }\n\n @if ( canDelete ) {\n <nrcl-button compact\n label=\"Delete\"\n icon=\"delete\"\n (click)=\"onDeleteClick( item )\"\n ></nrcl-button>\n }\n </mat-card-footer>\n </mat-card>\n }\n </nrcl-row-list-mobile>\n\n <nrcl-gap/>\n }\n\n <nrcl-row-list-pagination\n paginationId=\"mobile-attachments\"\n [pageSize]=\"pageSize\"\n [pageNumber]=\"pageNumber\"\n [rowCount]=\"totalRowCount\"\n (pageNumberChange)=\"onPageNumberChange( $event )\"\n (pageSizeChange)=\"onPageSizeChange( $event )\"\n [noRowsMessage]=\"noRowsMessage\"\n ></nrcl-row-list-pagination>\n </ng-template>\n</nrcl-device-view>\n", styles: [":host .mat-mdc-table .mat-column-attachmentTypeCode{flex-basis:150px;flex-grow:1;flex-shrink:0}:host .mat-mdc-table .mat-column-orgUnit{flex-basis:150px;flex-grow:1;flex-shrink:0;word-break:break-word}:host .mat-mdc-table .mat-column-fileName{flex-basis:200px;flex-grow:3;flex-shrink:0}:host .mat-mdc-table .mat-column-fileName .nrcl-button{width:100%;--nrcl-button-width: 100%}:host .mat-mdc-table .mat-column-fileExtension{flex-basis:60px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-uploadedBy{flex-basis:150px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-uploadedTimestamp{flex-basis:150px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-description{flex-basis:200px;flex-grow:1;flex-shrink:1;word-break:break-word}:host .mat-mdc-table .mat-column-download{flex-basis:90px;flex-grow:0;flex-shrink:0;justify-content:center}:host .mat-mdc-table .mat-column-delete{flex-basis:60px;flex-grow:0;flex-shrink:0;justify-content:center}:host .nrcl-row-list-mobile section.filename .value .nrcl-button{width:100%;--nrcl-button-width: 100%;--nrcl-button-font-weight: bold}\n"], dependencies: [{ kind: "component", type: i1$7.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$7.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i1$7.MatCardFooter, selector: "mat-card-footer" }, { kind: "directive", type: i1$4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: ButtonComponent, selector: "nrcl-button", inputs: ["label", "icon", "iconRight", "iconCompact", "tooltip", "compact", "small", "primary", "secondary", "tertiary", "disabled", "anchor"], outputs: ["click"] }, { kind: "component", type: CellContentComponent, selector: "nrcl-cell-content", inputs: ["tooltip", "content"] }, { kind: "component", type: GapComponent, selector: "nrcl-gap", inputs: ["horizontal", "vertical", "divider"] }, { kind: "component", type: RowListDesktopComponent, selector: "nrcl-row-list-desktop", inputs: ["showRowHover"] }, { kind: "component", type: RowListMobileComponent, selector: "nrcl-row-list-mobile" }, { kind: "component", type: RowListPaginationComponent, selector: "nrcl-row-list-pagination", inputs: ["paginationId", "pageSizeOptions", "pageSize", "pageNumber", "rowCount", "showPageSize", "noRowsMessage"], outputs: ["pageSizeChange", "pageNumberChange"] }, { kind: "component", type: RowListSortingComponent, selector: "nrcl-row-list-sorting", inputs: ["sortColumn", "sortColumnOptions", "sortDirection"], outputs: ["sortChange"] }, { kind: "directive", type: DesktopViewDirective, selector: "[desktop-view]" }, { kind: "directive", type: MobileViewDirective, selector: "[mobile-view]" }, { kind: "component", type: DeviceViewComponent, selector: "nrcl-device-view" }, { kind: "pipe", type: i1$6.PaginatePipe, name: "paginate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1840
1863
|
}
|
|
@@ -1886,19 +1909,21 @@ class ListEventHistoryComponent extends RowListBase {
|
|
|
1886
1909
|
return this.rowListProvider.displayRowListPage(res);
|
|
1887
1910
|
}
|
|
1888
1911
|
getInitialPageState() {
|
|
1912
|
+
if (!this.rowListProvider?.getInitialPageState)
|
|
1913
|
+
throw Error('no provider for ListEventHistoryComponent.rowListProvider.getInitialPageState');
|
|
1914
|
+
let state = this.rowListProvider.getInitialPageState();
|
|
1889
1915
|
return {
|
|
1916
|
+
instance: state.instance,
|
|
1890
1917
|
filter: {},
|
|
1891
1918
|
pageConfig: {
|
|
1892
1919
|
pageSize: 20,
|
|
1893
1920
|
pageNumber: 1,
|
|
1894
1921
|
sortActive: 'dateTime',
|
|
1895
1922
|
sortDirection: 'desc',
|
|
1896
|
-
|
|
1923
|
+
...state.pageConfig
|
|
1924
|
+
},
|
|
1897
1925
|
};
|
|
1898
1926
|
}
|
|
1899
|
-
savePageState() {
|
|
1900
|
-
// state not saved
|
|
1901
|
-
}
|
|
1902
1927
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListEventHistoryComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1903
1928
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListEventHistoryComponent, selector: "nrcl-list-event-history", inputs: { rowListProvider: "rowListProvider", canDelete: "canDelete", showPagination: "showPagination", isSupplier: "isSupplier", noRowsMessage: "noRowsMessage" }, usesInheritance: true, ngImport: i0, template: "<nrcl-device-view>\n <ng-template desktop-view>\n @if ( rows?.length > 0 ) {\n <nrcl-row-list-desktop [showRowHover]=\"false\">\n <mat-table\n [dataSource]=\"rows | paginate: paginateState( 'desktop-event-history' )\"\n matSort\n [matSortActive]=\"sortActive\"\n [matSortDirection]=\"sortDirection\"\n (matSortChange)=\"onSortChange( $event )\">\n >\n <ng-container matColumnDef=\"dateTime\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Date and Time</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content tooltip>{{ item.eventTimestamp }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"changedBy\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>User ID</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content tooltip>{{ item.createdByUserId }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"type\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content tooltip>{{ item.eventHistoryTypeDescription }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"section\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>Section</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content tooltip>{{ item.sourceObjectNameDescription }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef>Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n {{ item.comment }}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"columns; sticky: true\"></mat-header-row>\n <mat-row *matRowDef=\"let item; columns: columns;\"></mat-row>\n </mat-table>\n </nrcl-row-list-desktop>\n\n <nrcl-gap/>\n }\n\n <nrcl-row-list-pagination\n paginationId=\"desktop-event-history\"\n [pageSize]=\"pageSize\"\n [pageNumber]=\"pageNumber\"\n [rowCount]=\"totalRowCount\"\n (pageNumberChange)=\"onPageNumberChange( $event )\"\n (pageSizeChange)=\"onPageSizeChange( $event )\"\n [noRowsMessage]=\"noRowsMessage\"\n ></nrcl-row-list-pagination>\n </ng-template>\n\n <ng-template mobile-view>\n @if ( rows?.length > 0 ) {\n <nrcl-gap/>\n\n <nrcl-row-list-sorting\n [sortColumn]=\"sortActive\"\n [sortColumnOptions]=\"sortColumns\"\n [sortDirection]=\"sortDirection\"\n (sortChange)=\"onSortChange($event)\">\n </nrcl-row-list-sorting>\n\n <nrcl-gap/>\n\n <nrcl-row-list-mobile>\n @for ( item of rows | paginate: paginateState( 'mobile-event-history' ); track item.eventHistoryGuid ) {\n <mat-card>\n <mat-card-title>\n <section title>\n <h2>{{ item.eventTimestamp }}</h2>\n </section>\n </mat-card-title>\n\n <mat-card-content>\n <section>\n <mat-label>User ID</mat-label>\n <div class=\"value\">{{ item.createdByUserId }}</div>\n </section>\n\n <section>\n <mat-label>Type</mat-label>\n <div class=\"value\">{{ item.eventHistoryTypeDescription }}</div>\n </section>\n\n <section full-width>\n <mat-label>Section</mat-label>\n <div class=\"value\">{{ item.sourceObjectNameDescription }}</div>\n </section>\n\n <section full-width>\n <mat-label>Comment</mat-label>\n <div class=\"value\">{{ item.comment }}</div>\n </section>\n </mat-card-content>\n </mat-card>\n }\n </nrcl-row-list-mobile>\n\n <nrcl-gap/>\n }\n\n <nrcl-row-list-pagination\n paginationId=\"mobile-event-history\"\n [pageSize]=\"pageSize\"\n [pageNumber]=\"pageNumber\"\n [rowCount]=\"totalRowCount\"\n (pageNumberChange)=\"onPageNumberChange( $event )\"\n (pageSizeChange)=\"onPageSizeChange( $event )\"\n [noRowsMessage]=\"noRowsMessage\"\n ></nrcl-row-list-pagination>\n </ng-template>\n</nrcl-device-view>\n", styles: [":host .mat-mdc-table .mat-column-dateTime{flex-basis:150px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-changedBy{flex-basis:120px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-type{flex-basis:80px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-section{flex-basis:230px;flex-grow:0;flex-shrink:0}:host .mat-mdc-table .mat-column-comment{flex-basis:400px;flex-grow:1;flex-shrink:0}\n"], dependencies: [{ kind: "component", type: i1$7.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$7.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i1$7.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i1$4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: CellContentComponent, selector: "nrcl-cell-content", inputs: ["tooltip", "content"] }, { kind: "component", type: GapComponent, selector: "nrcl-gap", inputs: ["horizontal", "vertical", "divider"] }, { kind: "component", type: RowListDesktopComponent, selector: "nrcl-row-list-desktop", inputs: ["showRowHover"] }, { kind: "component", type: RowListMobileComponent, selector: "nrcl-row-list-mobile" }, { kind: "component", type: RowListPaginationComponent, selector: "nrcl-row-list-pagination", inputs: ["paginationId", "pageSizeOptions", "pageSize", "pageNumber", "rowCount", "showPageSize", "noRowsMessage"], outputs: ["pageSizeChange", "pageNumberChange"] }, { kind: "component", type: RowListSortingComponent, selector: "nrcl-row-list-sorting", inputs: ["sortColumn", "sortColumnOptions", "sortDirection"], outputs: ["sortChange"] }, { kind: "directive", type: DesktopViewDirective, selector: "[desktop-view]" }, { kind: "directive", type: MobileViewDirective, selector: "[mobile-view]" }, { kind: "component", type: DeviceViewComponent, selector: "nrcl-device-view" }, { kind: "pipe", type: i1$6.PaginatePipe, name: "paginate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1904
1929
|
}
|
|
@@ -1942,6 +1967,7 @@ class ListSelectComponent extends RowListBase {
|
|
|
1942
1967
|
}
|
|
1943
1968
|
getInitialPageState() {
|
|
1944
1969
|
return {
|
|
1970
|
+
instance: '', // state not saved
|
|
1945
1971
|
filter: {},
|
|
1946
1972
|
pageConfig: {
|
|
1947
1973
|
pageSize: 0,
|
|
@@ -2006,9 +2032,6 @@ class ListSelectComponent extends RowListBase {
|
|
|
2006
2032
|
return false;
|
|
2007
2033
|
return this.filterProvider(option);
|
|
2008
2034
|
}
|
|
2009
|
-
savePageState() {
|
|
2010
|
-
// state not saved
|
|
2011
|
-
}
|
|
2012
2035
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2013
2036
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListSelectComponent, selector: "nrcl-list-select", inputs: { options: "options", value: "value", descriptionLabel: "descriptionLabel", single: ["single", "single", booleanAttribute], noRowsMessage: "noRowsMessage", displayColumnsProvider: "displayColumnsProvider", filterProvider: "filterProvider" }, outputs: { valueChange: "valueChange", filterClear: "filterClear" }, queries: [{ propertyName: "columnDefs", predicate: MatColumnDef }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if ( !single ) {\n <div class=\"summary\">\n <h3>{{ value?.length || '0' }} Selected</h3>\n </div>\n}\n\n<nrcl-filters-panel (clearFilters)=\"onClearFilters()\">\n <nrcl-filter-search\n [(value)]=\"searchText\"\n (valueChange)=\"onSearchTextChange( $event )\">\n </nrcl-filter-search>\n\n <ng-content select=\"[filter]\"></ng-content>\n</nrcl-filters-panel>\n\n<nrcl-row-list-desktop [class.empty]=\"rows?.length == 0\">\n <mat-table [dataSource]=\"rows\" >\n <ng-container matColumnDef=\"description\">\n <mat-header-cell *matHeaderCellDef>{{ descriptionLabel }}</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-cell-content>{{ item.description }}</nrcl-cell-content>\n </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"addRemove\">\n <mat-header-cell *matHeaderCellDef>Add Remove</mat-header-cell>\n <mat-cell *matCellDef=\"let item\">\n <nrcl-indicator-select [selected]=\"isSelected( item )\"></nrcl-indicator-select>\n </mat-cell>\n </ng-container>\n\n <ng-content></ng-content>\n\n <mat-header-row *matHeaderRowDef=\"displayColumns; sticky: true\"></mat-header-row>\n\n <mat-row\n *matRowDef=\"let item; columns: displayColumns\"\n [class.selected]=\"isSelected( item )\"\n (click)=\"onRowClick( item )\"\n (keypress)=\"onRowClick( item )\"\n ></mat-row>\n </mat-table>\n</nrcl-row-list-desktop>\n\n@if ( totalRowCount == 0 ) {\n <nrcl-row-list-pagination\n paginationId=\"list-select\"\n [pageSize]=\"pageSize\"\n [pageNumber]=\"pageNumber\"\n [rowCount]=\"totalRowCount\"\n (pageNumberChange)=\"onPageNumberChange( $event )\"\n (pageSizeChange)=\"onPageSizeChange( $event )\"\n [noRowsMessage]=\"noRowsMessage\"\n ></nrcl-row-list-pagination>\n}\n", styles: [":host{font-family:var(--nrcl-font-family);font-size:var(--nrcl-font-size)}:host .summary{display:flex;justify-content:flex-end}:host .summary h3{font-size:var(--nrcl-font-size-h3);font-weight:400;padding:0;margin:0;padding-bottom:var(--nrcl-gutter-space)}:host .nrcl-row-list-desktop.empty{display:none}:host .nrcl-row-list-desktop .mat-mdc-table .mat-column-description{flex-grow:1}:host .nrcl-row-list-desktop .mat-mdc-table .mat-column-addRemove{flex-basis:70px;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;text-align:center}\n"], dependencies: [{ kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: CellContentComponent, selector: "nrcl-cell-content", inputs: ["tooltip", "content"] }, { kind: "component", type: FilterSearchComponent, selector: "nrcl-filter-search", inputs: ["label", "placeholder", "hint", "value", "wide"], outputs: ["valueChange"] }, { kind: "component", type: FiltersPanelComponent, selector: "nrcl-filters-panel", inputs: ["showClear", "showFilters", "hasAdvancedFilters", "showAdvancedFilters"], outputs: ["clearFilters", "showFiltersChange", "showAdvancedFiltersChange"] }, { kind: "component", type: RowListDesktopComponent, selector: "nrcl-row-list-desktop", inputs: ["showRowHover"] }, { kind: "component", type: RowListPaginationComponent, selector: "nrcl-row-list-pagination", inputs: ["paginationId", "pageSizeOptions", "pageSize", "pageNumber", "rowCount", "showPageSize", "noRowsMessage"], outputs: ["pageSizeChange", "pageNumberChange"] }, { kind: "component", type: IndicatorSelectComponent, selector: "nrcl-indicator-select", inputs: ["selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2014
2037
|
}
|