@wertzui/ngx-restworld-client 3.1.0 → 3.3.0
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/esm2020/lib/restworld-client.module.mjs +8 -4
- package/esm2020/lib/services/restworld-client.mjs +29 -5
- package/esm2020/lib/views/restworld-list-view/restworld-list-view.component.mjs +64 -23
- package/fesm2015/wertzui-ngx-restworld-client.mjs +93 -22
- package/fesm2015/wertzui-ngx-restworld-client.mjs.map +1 -1
- package/fesm2020/wertzui-ngx-restworld-client.mjs +91 -22
- package/fesm2020/wertzui-ngx-restworld-client.mjs.map +1 -1
- package/lib/restworld-client.module.d.ts +2 -1
- package/lib/services/restworld-client.d.ts +1 -0
- package/lib/views/restworld-list-view/restworld-list-view.component.d.ts +24 -7
- package/package.json +2 -2
|
@@ -57,9 +57,11 @@ import * as i11 from 'primeng/toast';
|
|
|
57
57
|
import { ToastModule } from 'primeng/toast';
|
|
58
58
|
import * as i12$1 from 'primeng/confirmdialog';
|
|
59
59
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
60
|
-
import * as
|
|
60
|
+
import * as i5$2 from 'primeng/table';
|
|
61
61
|
import { TableModule } from 'primeng/table';
|
|
62
|
-
import * as
|
|
62
|
+
import * as i6$1 from 'primeng/splitbutton';
|
|
63
|
+
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
64
|
+
import * as i7$3 from 'primeng/avatar';
|
|
63
65
|
import { AvatarModule } from 'primeng/avatar';
|
|
64
66
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
65
67
|
import { MessagesModule } from 'primeng/messages';
|
|
@@ -341,7 +343,9 @@ class RESTworldClient {
|
|
|
341
343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
344
|
const link = this.getLinkFromHome(rel, LinkNames.getList, curie);
|
|
343
345
|
const uri = link.fillTemplate(parameters);
|
|
344
|
-
const
|
|
346
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
347
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
348
|
+
const response = yield this.halClient.get(uri, PagedListResource, ProblemDetails, combinedHeaders);
|
|
345
349
|
return response;
|
|
346
350
|
});
|
|
347
351
|
}
|
|
@@ -350,7 +354,9 @@ class RESTworldClient {
|
|
|
350
354
|
const link = new Link();
|
|
351
355
|
link.href = uri;
|
|
352
356
|
const filledUri = link.fillTemplate(parameters);
|
|
353
|
-
const
|
|
357
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
358
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
359
|
+
const response = yield this.halClient.get(filledUri, PagedListResource, ProblemDetails, combinedHeaders);
|
|
354
360
|
return response;
|
|
355
361
|
});
|
|
356
362
|
}
|
|
@@ -370,7 +376,9 @@ class RESTworldClient {
|
|
|
370
376
|
const link = this.getLinkFromHome(relOrUri, LinkNames.get, curie);
|
|
371
377
|
uri = link.fillTemplate({ id: id.toString() });
|
|
372
378
|
}
|
|
373
|
-
const
|
|
379
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
380
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
381
|
+
const response = yield this.halClient.get(uri, Resource, ProblemDetails, combinedHeaders);
|
|
374
382
|
return response;
|
|
375
383
|
});
|
|
376
384
|
}
|
|
@@ -472,9 +480,27 @@ class RESTworldClient {
|
|
|
472
480
|
}
|
|
473
481
|
static createHeaders(mediaType, version) {
|
|
474
482
|
if (version)
|
|
475
|
-
return new HttpHeaders({
|
|
483
|
+
return new HttpHeaders({
|
|
484
|
+
'Accept': `${mediaType || 'application/hal+json'}; v=${version}`,
|
|
485
|
+
'Content-Type': `${mediaType || 'application/hal+json'}; v=${version}`
|
|
486
|
+
});
|
|
476
487
|
return new HttpHeaders();
|
|
477
488
|
}
|
|
489
|
+
static combineHeaders(originalHeaders, headersToAdd, overwriteExisting) {
|
|
490
|
+
if (!headersToAdd)
|
|
491
|
+
return originalHeaders;
|
|
492
|
+
if (!originalHeaders)
|
|
493
|
+
return headersToAdd;
|
|
494
|
+
let combinedHeaders = originalHeaders;
|
|
495
|
+
for (const key in headersToAdd.keys) {
|
|
496
|
+
if (!combinedHeaders.has(key) || overwriteExisting) {
|
|
497
|
+
const headerValuesToAdd = headersToAdd.getAll(key);
|
|
498
|
+
if (headerValuesToAdd)
|
|
499
|
+
combinedHeaders = combinedHeaders.set(key, headerValuesToAdd);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return combinedHeaders;
|
|
503
|
+
}
|
|
478
504
|
}
|
|
479
505
|
|
|
480
506
|
class RESTworldClientCollection {
|
|
@@ -1213,17 +1239,23 @@ var ColumnType;
|
|
|
1213
1239
|
ColumnType["numeric"] = "numeric";
|
|
1214
1240
|
ColumnType["boolean"] = "boolean";
|
|
1215
1241
|
ColumnType["date"] = "date";
|
|
1242
|
+
ColumnType["array"] = "array";
|
|
1243
|
+
ColumnType["object"] = "object";
|
|
1216
1244
|
})(ColumnType || (ColumnType = {}));
|
|
1217
1245
|
class RESTworldListViewComponent {
|
|
1218
|
-
constructor(_clients, _confirmationService, _messageService, avatarGenerator) {
|
|
1246
|
+
constructor(_clients, _confirmationService, _messageService, avatarGenerator, _router) {
|
|
1219
1247
|
this._clients = _clients;
|
|
1220
1248
|
this._confirmationService = _confirmationService;
|
|
1221
1249
|
this._messageService = _messageService;
|
|
1222
1250
|
this.avatarGenerator = avatarGenerator;
|
|
1251
|
+
this._router = _router;
|
|
1223
1252
|
this._columns = [];
|
|
1224
1253
|
this._editLink = '/edit';
|
|
1254
|
+
this._sortField = '';
|
|
1255
|
+
this._sortOrder = 1;
|
|
1225
1256
|
this.isLoading = false;
|
|
1226
1257
|
this._totalRecords = 0;
|
|
1258
|
+
this.load = _.debounce(this.load2, 100);
|
|
1227
1259
|
this.rowsPerPage = [10, 25, 50];
|
|
1228
1260
|
this._lastEvent = {
|
|
1229
1261
|
rows: this.rowsPerPage[0]
|
|
@@ -1241,20 +1273,34 @@ class RESTworldListViewComponent {
|
|
|
1241
1273
|
}
|
|
1242
1274
|
set apiName(value) {
|
|
1243
1275
|
this._apiName = value;
|
|
1244
|
-
|
|
1245
|
-
this.load(this._lastEvent);
|
|
1276
|
+
this.load(this._lastEvent);
|
|
1246
1277
|
}
|
|
1247
1278
|
get apiName() {
|
|
1248
1279
|
return this._apiName;
|
|
1249
1280
|
}
|
|
1250
1281
|
set rel(value) {
|
|
1251
1282
|
this._rel = value;
|
|
1252
|
-
|
|
1253
|
-
this.load(this._lastEvent);
|
|
1283
|
+
this.load(this._lastEvent);
|
|
1254
1284
|
}
|
|
1255
1285
|
get rel() {
|
|
1256
1286
|
return this._rel;
|
|
1257
1287
|
}
|
|
1288
|
+
set sortField(value) {
|
|
1289
|
+
this._sortField = value !== null && value !== void 0 ? value : '';
|
|
1290
|
+
this._lastEvent.sortField = value;
|
|
1291
|
+
this.load(this._lastEvent);
|
|
1292
|
+
}
|
|
1293
|
+
get sortField() {
|
|
1294
|
+
return this._sortField;
|
|
1295
|
+
}
|
|
1296
|
+
set sortOrder(value) {
|
|
1297
|
+
this._sortOrder = value !== null && value !== void 0 ? value : 1;
|
|
1298
|
+
this._lastEvent.sortOrder = value;
|
|
1299
|
+
this.load(this._lastEvent);
|
|
1300
|
+
}
|
|
1301
|
+
get sortOrder() {
|
|
1302
|
+
return this._sortOrder;
|
|
1303
|
+
}
|
|
1258
1304
|
get value() {
|
|
1259
1305
|
var _a, _b;
|
|
1260
1306
|
return ((_b = (_a = this.resource) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b.items) || [];
|
|
@@ -1269,9 +1315,6 @@ class RESTworldListViewComponent {
|
|
|
1269
1315
|
set totalRecords(value) {
|
|
1270
1316
|
this._totalRecords = value || 0;
|
|
1271
1317
|
}
|
|
1272
|
-
get sortOrder() {
|
|
1273
|
-
return this._lastEvent.sortOrder || 0;
|
|
1274
|
-
}
|
|
1275
1318
|
get newHref() {
|
|
1276
1319
|
var _a, _b;
|
|
1277
1320
|
return (_b = (_a = this.resource) === null || _a === void 0 ? void 0 : _a.findLink('new')) === null || _b === void 0 ? void 0 : _b.href;
|
|
@@ -1279,12 +1322,27 @@ class RESTworldListViewComponent {
|
|
|
1279
1322
|
get dateFormat() {
|
|
1280
1323
|
return RESTworldListViewComponent._dateFormat;
|
|
1281
1324
|
}
|
|
1325
|
+
ngOnChanges(changes) {
|
|
1326
|
+
console.log("ngOnChanges " + changes);
|
|
1327
|
+
}
|
|
1328
|
+
ngOnInit() {
|
|
1329
|
+
console.log("ngOnInit");
|
|
1330
|
+
}
|
|
1331
|
+
ngAfterViewInit() {
|
|
1332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1333
|
+
console.log("ngAfterViewInit");
|
|
1334
|
+
//await this.load(this._lastEvent);
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
createNew() {
|
|
1338
|
+
return this._router.navigate([this.editLink, this.apiName, this.newHref]);
|
|
1339
|
+
}
|
|
1282
1340
|
getClient() {
|
|
1283
1341
|
if (!this.apiName)
|
|
1284
1342
|
throw new Error('Cannot get a client, because the apiName is not set.');
|
|
1285
1343
|
return this._clients.getClient(this.apiName);
|
|
1286
1344
|
}
|
|
1287
|
-
|
|
1345
|
+
load2(event) {
|
|
1288
1346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1289
1347
|
if (!this.apiName || !this.rel)
|
|
1290
1348
|
return;
|
|
@@ -1380,6 +1438,10 @@ class RESTworldListViewComponent {
|
|
|
1380
1438
|
return ColumnType.text;
|
|
1381
1439
|
if (_.isBoolean(value))
|
|
1382
1440
|
return ColumnType.boolean;
|
|
1441
|
+
if (_.isArrayLike(value))
|
|
1442
|
+
return ColumnType.array;
|
|
1443
|
+
if (_.isObjectLike(value))
|
|
1444
|
+
return ColumnType.object;
|
|
1383
1445
|
return ColumnType.text;
|
|
1384
1446
|
}
|
|
1385
1447
|
static toTitleCase(anyCase) {
|
|
@@ -1522,19 +1584,25 @@ RESTworldListViewComponent._dateFormat = new Date(3333, 10, 22)
|
|
|
1522
1584
|
.replace("11", "MM")
|
|
1523
1585
|
.replace("3333", "y")
|
|
1524
1586
|
.replace("33", "yy");
|
|
1525
|
-
RESTworldListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RESTworldListViewComponent, deps: [{ token: RESTworldClientCollection }, { token: i2$1.ConfirmationService }, { token: i2$1.MessageService }, { token: AvatarGenerator }], target: i0.ɵɵFactoryTarget.Component });
|
|
1526
|
-
RESTworldListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: RESTworldListViewComponent, selector: "rw-list", inputs: { editLink: "editLink", apiName: "apiName", rel: "rel", rowsPerPage: "rowsPerPage" }, ngImport: i0, template: "<p-table [value]=\"value\"\r\n [lazy]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n (onLazyLoad)=\"load($event)\"\r\n responsiveLayout=\"scroll\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [rowsPerPageOptions]=\"rowsPerPage\"\r\n [totalRecords]=\"totalRecords\"\r\n [loading]=\"isLoading\"\r\n [showInitialSortBadge]=\"true\"\r\n [columns]=\"columns\">\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\">\r\n <div class=\"p-d-flex p-jc-between p-ai-center\">\r\n {{col.header}}\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n <p-columnFilter [type]=\"col.type\" [field]=\"col.field\" display=\"menu\"></p-columnFilter>\r\n </div>\r\n </th>\r\n <th>\r\n <div class=\"flex justify-content-end\">\r\n <div class=\"mx-2\" pTooltip=\"Create new\" tooltipPosition=\"left\">\r\n <a class=\"p-button-success\" icon=\"fas fa-plus\" pButton [routerLink]=\"['/edit', apiName, newHref]\"></a>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"body\" let-entity let-columns=\"columns\">\r\n <tr>\r\n <td [ngSwitch]=\"col.type\" *ngFor=\"let col of columns\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <p-avatar *ngIf=\"col.field === 'createdBy' || col.field === 'lastChangedBy'\" [pTooltip]=\"entity[col.field]\" tooltipPosition=\"top\" [image]=\"avatarGenerator.getImage(entity[col.field])\" [label]=\"avatarGenerator.getLabel(entity[col.field])\" [style]=\"avatarGenerator.getStyle(entity[col.field])\" shape=\"circle\"></p-avatar>\r\n <span *ngIf=\"col.field !== 'createdBy' && col.field !== 'lastChangedBy'\">{{entity[col.field]}}</span>\r\n </ng-container>\r\n <span *ngSwitchCase=\"'numeric'\" class=\"flex justify-content-end\">{{entity[col.field]}}</span>\r\n <span *ngSwitchCase=\"'boolean'\" class=\"flex justify-content-center\"><p-triStateCheckbox [(ngModel)]=\"entity[col.field]\" [readonly]=\"true\"></p-triStateCheckbox></span>\r\n <span *ngSwitchCase=\"'date'\" [pTooltip]=\"entity[col.field]\">{{entity[col.field] | date:dateFormat}}</span>\r\n </td>\r\n <td>\r\n <div class=\"flex justify-content-end\">\r\n <a pButton pTooltip=\"View/Edit\" tooltipPosition=\"left\" [routerLink]=\"[editLink, apiName, entity._links?.self[0].href]\" icon=\"fas fa-edit\"></a>\r\n <button pTooltip=\"Delete\" tooltipPosition=\"left\" pButton *ngIf=\"entity._links.delete\" (click)=\"showDeleteConfirmatioModal(entity)\" icon=\"fas fa-trash-alt\" type=\"button\" class=\"mx-2 p-button-danger\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"8\">No entries found.</td>\r\n </tr>\r\n </ng-template>\r\n\r\n</p-table>\r\n\r\n<p-toast></p-toast>\r\n<p-confirmDialog></p-confirmDialog>\r\n", styles: [".p-tooltip{max-width:-moz-fit-content;max-width:fit-content}a.p-button{text-decoration:none}\n"], components: [{ type: i4$3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: i4$3.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: i5$2.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass"] }, { type: i9$1.TriStateCheckbox, selector: "p-triStateCheckbox", inputs: ["disabled", "name", "ariaLabelledBy", "tabindex", "inputId", "style", "styleClass", "label", "readonly", "checkboxTrueIcon", "checkboxFalseIcon"], outputs: ["onChange"] }, { type: i11.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i12$1.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i4$2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i1$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "date": i3$1.DatePipe } });
|
|
1587
|
+
RESTworldListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RESTworldListViewComponent, deps: [{ token: RESTworldClientCollection }, { token: i2$1.ConfirmationService }, { token: i2$1.MessageService }, { token: AvatarGenerator }, { token: i4$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1588
|
+
RESTworldListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: RESTworldListViewComponent, selector: "rw-list", inputs: { editLink: "editLink", apiName: "apiName", rel: "rel", sortField: "sortField", sortOrder: "sortOrder", rowsPerPage: "rowsPerPage", createButtonMenu: "createButtonMenu" }, usesOnChanges: true, ngImport: i0, template: "<p-table [value]=\"value\"\r\n [lazy]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n (onLazyLoad)=\"load($event)\"\r\n responsiveLayout=\"scroll\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [rowsPerPageOptions]=\"rowsPerPage\"\r\n [totalRecords]=\"totalRecords\"\r\n [loading]=\"isLoading\"\r\n [showInitialSortBadge]=\"true\"\r\n [columns]=\"columns\"\r\n [sortField]=\"sortField\"\r\n [sortOrder]=\"sortOrder\">\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\">\r\n <div class=\"p-d-flex p-jc-between p-ai-center\">\r\n {{col.header}}\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n <p-columnFilter [type]=\"col.type\" [field]=\"col.field\" display=\"menu\"></p-columnFilter>\r\n </div>\r\n </th>\r\n <th>\r\n <div class=\"flex justify-content-end\">\r\n <div class=\"mx-2\">\r\n <a *ngIf=\"!createButtonMenu\" class=\"p-button-success\" icon=\"fas fa-plus\" pButton [routerLink]=\"[editLink, apiName, newHref]\" pTooltip=\"Create new\" tooltipPosition=\"left\"></a>\r\n <p-splitButton *ngIf=\"createButtonMenu\" styleClass=\"p-button-success\" icon=\"fas fa-plus\" pTooltip=\"Create new\" tooltipPosition=\"left\" (onClick)=\"createNew()\" [model]=\"createButtonMenu\" appendTo=\"body\"></p-splitButton>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"body\" let-entity let-columns=\"columns\">\r\n <tr>\r\n <td [ngSwitch]=\"col.type\" *ngFor=\"let col of columns\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <p-avatar *ngIf=\"col.field === 'createdBy' || col.field === 'lastChangedBy'\" [pTooltip]=\"entity[col.field]\" tooltipPosition=\"top\" [image]=\"avatarGenerator.getImage(entity[col.field])\" [label]=\"avatarGenerator.getLabel(entity[col.field])\" [style]=\"avatarGenerator.getStyle(entity[col.field])\" shape=\"circle\"></p-avatar>\r\n <span *ngIf=\"col.field !== 'createdBy' && col.field !== 'lastChangedBy'\">{{entity[col.field]}}</span>\r\n </ng-container>\r\n <span *ngSwitchCase=\"'numeric'\" class=\"flex justify-content-end\">{{entity[col.field]}}</span>\r\n <span *ngSwitchCase=\"'boolean'\" class=\"flex justify-content-center\"><p-triStateCheckbox [(ngModel)]=\"entity[col.field]\" [readonly]=\"true\"></p-triStateCheckbox></span>\r\n <span *ngSwitchCase=\"'date'\" [pTooltip]=\"entity[col.field]\">{{entity[col.field] | date:dateFormat}}</span>\r\n <span *ngSwitchCase=\"'array'\" class=\"flex justify-content-end\"><p *ngFor=\"let arrayElement of entity[col.field]\">{{arrayElement | json}}</p></span>\r\n <span *ngSwitchCase=\"'object'\" class=\"flex justify-content-end\">{{entity[col.field] | json}}</span>\r\n </td>\r\n <td>\r\n <div class=\"flex justify-content-end\">\r\n <a pButton pTooltip=\"View/Edit\" tooltipPosition=\"left\" [routerLink]=\"[editLink, apiName, entity._links?.self[0].href]\" icon=\"fas fa-edit\"></a>\r\n <button pTooltip=\"Delete\" tooltipPosition=\"left\" pButton *ngIf=\"entity._links.delete\" (click)=\"showDeleteConfirmatioModal(entity)\" icon=\"fas fa-trash-alt\" type=\"button\" class=\"mx-2 p-button-danger\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"8\">No entries found.</td>\r\n </tr>\r\n </ng-template>\r\n\r\n</p-table>\r\n\r\n<p-toast></p-toast>\r\n<p-confirmDialog></p-confirmDialog>\r\n", styles: [".p-tooltip{max-width:-moz-fit-content;max-width:fit-content}a.p-button{text-decoration:none}\n"], components: [{ type: i5$2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i5$2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: i5$2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: i6$1.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }, { type: i7$3.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass"] }, { type: i9$1.TriStateCheckbox, selector: "p-triStateCheckbox", inputs: ["disabled", "name", "ariaLabelledBy", "tabindex", "inputId", "style", "styleClass", "label", "readonly", "checkboxTrueIcon", "checkboxFalseIcon"], outputs: ["onChange"] }, { type: i11.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i12$1.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i1$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "date": i3$1.DatePipe, "json": i3$1.JsonPipe } });
|
|
1527
1589
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RESTworldListViewComponent, decorators: [{
|
|
1528
1590
|
type: Component,
|
|
1529
|
-
args: [{ selector: 'rw-list', template: "<p-table [value]=\"value\"\r\n [lazy]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n (onLazyLoad)=\"load($event)\"\r\n responsiveLayout=\"scroll\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [rowsPerPageOptions]=\"rowsPerPage\"\r\n [totalRecords]=\"totalRecords\"\r\n [loading]=\"isLoading\"\r\n [showInitialSortBadge]=\"true\"\r\n [columns]=\"columns\">\r\n\r\n
|
|
1530
|
-
}], ctorParameters: function () { return [{ type: RESTworldClientCollection }, { type: i2$1.ConfirmationService }, { type: i2$1.MessageService }, { type: AvatarGenerator }]; }, propDecorators: { editLink: [{
|
|
1591
|
+
args: [{ selector: 'rw-list', template: "<p-table [value]=\"value\"\r\n [lazy]=\"true\"\r\n [lazyLoadOnInit]=\"false\"\r\n (onLazyLoad)=\"load($event)\"\r\n responsiveLayout=\"scroll\"\r\n [paginator]=\"true\"\r\n [rows]=\"rows\"\r\n [rowsPerPageOptions]=\"rowsPerPage\"\r\n [totalRecords]=\"totalRecords\"\r\n [loading]=\"isLoading\"\r\n [showInitialSortBadge]=\"true\"\r\n [columns]=\"columns\"\r\n [sortField]=\"sortField\"\r\n [sortOrder]=\"sortOrder\">\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\">\r\n <div class=\"p-d-flex p-jc-between p-ai-center\">\r\n {{col.header}}\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n <p-columnFilter [type]=\"col.type\" [field]=\"col.field\" display=\"menu\"></p-columnFilter>\r\n </div>\r\n </th>\r\n <th>\r\n <div class=\"flex justify-content-end\">\r\n <div class=\"mx-2\">\r\n <a *ngIf=\"!createButtonMenu\" class=\"p-button-success\" icon=\"fas fa-plus\" pButton [routerLink]=\"[editLink, apiName, newHref]\" pTooltip=\"Create new\" tooltipPosition=\"left\"></a>\r\n <p-splitButton *ngIf=\"createButtonMenu\" styleClass=\"p-button-success\" icon=\"fas fa-plus\" pTooltip=\"Create new\" tooltipPosition=\"left\" (onClick)=\"createNew()\" [model]=\"createButtonMenu\" appendTo=\"body\"></p-splitButton>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"body\" let-entity let-columns=\"columns\">\r\n <tr>\r\n <td [ngSwitch]=\"col.type\" *ngFor=\"let col of columns\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <p-avatar *ngIf=\"col.field === 'createdBy' || col.field === 'lastChangedBy'\" [pTooltip]=\"entity[col.field]\" tooltipPosition=\"top\" [image]=\"avatarGenerator.getImage(entity[col.field])\" [label]=\"avatarGenerator.getLabel(entity[col.field])\" [style]=\"avatarGenerator.getStyle(entity[col.field])\" shape=\"circle\"></p-avatar>\r\n <span *ngIf=\"col.field !== 'createdBy' && col.field !== 'lastChangedBy'\">{{entity[col.field]}}</span>\r\n </ng-container>\r\n <span *ngSwitchCase=\"'numeric'\" class=\"flex justify-content-end\">{{entity[col.field]}}</span>\r\n <span *ngSwitchCase=\"'boolean'\" class=\"flex justify-content-center\"><p-triStateCheckbox [(ngModel)]=\"entity[col.field]\" [readonly]=\"true\"></p-triStateCheckbox></span>\r\n <span *ngSwitchCase=\"'date'\" [pTooltip]=\"entity[col.field]\">{{entity[col.field] | date:dateFormat}}</span>\r\n <span *ngSwitchCase=\"'array'\" class=\"flex justify-content-end\"><p *ngFor=\"let arrayElement of entity[col.field]\">{{arrayElement | json}}</p></span>\r\n <span *ngSwitchCase=\"'object'\" class=\"flex justify-content-end\">{{entity[col.field] | json}}</span>\r\n </td>\r\n <td>\r\n <div class=\"flex justify-content-end\">\r\n <a pButton pTooltip=\"View/Edit\" tooltipPosition=\"left\" [routerLink]=\"[editLink, apiName, entity._links?.self[0].href]\" icon=\"fas fa-edit\"></a>\r\n <button pTooltip=\"Delete\" tooltipPosition=\"left\" pButton *ngIf=\"entity._links.delete\" (click)=\"showDeleteConfirmatioModal(entity)\" icon=\"fas fa-trash-alt\" type=\"button\" class=\"mx-2 p-button-danger\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"8\">No entries found.</td>\r\n </tr>\r\n </ng-template>\r\n\r\n</p-table>\r\n\r\n<p-toast></p-toast>\r\n<p-confirmDialog></p-confirmDialog>\r\n", styles: [".p-tooltip{max-width:-moz-fit-content;max-width:fit-content}a.p-button{text-decoration:none}\n"] }]
|
|
1592
|
+
}], ctorParameters: function () { return [{ type: RESTworldClientCollection }, { type: i2$1.ConfirmationService }, { type: i2$1.MessageService }, { type: AvatarGenerator }, { type: i4$2.Router }]; }, propDecorators: { editLink: [{
|
|
1531
1593
|
type: Input
|
|
1532
1594
|
}], apiName: [{
|
|
1533
1595
|
type: Input
|
|
1534
1596
|
}], rel: [{
|
|
1535
1597
|
type: Input
|
|
1598
|
+
}], sortField: [{
|
|
1599
|
+
type: Input
|
|
1600
|
+
}], sortOrder: [{
|
|
1601
|
+
type: Input
|
|
1536
1602
|
}], rowsPerPage: [{
|
|
1537
1603
|
type: Input
|
|
1604
|
+
}], createButtonMenu: [{
|
|
1605
|
+
type: Input
|
|
1538
1606
|
}] } });
|
|
1539
1607
|
|
|
1540
1608
|
function initializeSettings(settingsService) {
|
|
@@ -1578,7 +1646,8 @@ RestworldClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
1578
1646
|
DialogModule,
|
|
1579
1647
|
ButtonModule,
|
|
1580
1648
|
ColorPickerModule,
|
|
1581
|
-
DragDropModule
|
|
1649
|
+
DragDropModule,
|
|
1650
|
+
SplitButtonModule], exports: [RESTworldListViewComponent,
|
|
1582
1651
|
RESTworldEditViewComponent,
|
|
1583
1652
|
RESTWorldImageViewComponent,
|
|
1584
1653
|
RESTWorldFileViewComponent,
|
|
@@ -1625,7 +1694,8 @@ RestworldClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", v
|
|
|
1625
1694
|
DialogModule,
|
|
1626
1695
|
ButtonModule,
|
|
1627
1696
|
ColorPickerModule,
|
|
1628
|
-
DragDropModule
|
|
1697
|
+
DragDropModule,
|
|
1698
|
+
SplitButtonModule,
|
|
1629
1699
|
]] });
|
|
1630
1700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RestworldClientModule, decorators: [{
|
|
1631
1701
|
type: NgModule,
|
|
@@ -1669,7 +1739,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImpor
|
|
|
1669
1739
|
DialogModule,
|
|
1670
1740
|
ButtonModule,
|
|
1671
1741
|
ColorPickerModule,
|
|
1672
|
-
DragDropModule
|
|
1742
|
+
DragDropModule,
|
|
1743
|
+
SplitButtonModule,
|
|
1673
1744
|
],
|
|
1674
1745
|
exports: [
|
|
1675
1746
|
RESTworldListViewComponent,
|