@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
|
@@ -56,9 +56,11 @@ import * as i11 from 'primeng/toast';
|
|
|
56
56
|
import { ToastModule } from 'primeng/toast';
|
|
57
57
|
import * as i12$1 from 'primeng/confirmdialog';
|
|
58
58
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
59
|
-
import * as
|
|
59
|
+
import * as i5$2 from 'primeng/table';
|
|
60
60
|
import { TableModule } from 'primeng/table';
|
|
61
|
-
import * as
|
|
61
|
+
import * as i6$1 from 'primeng/splitbutton';
|
|
62
|
+
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
63
|
+
import * as i7$3 from 'primeng/avatar';
|
|
62
64
|
import { AvatarModule } from 'primeng/avatar';
|
|
63
65
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
64
66
|
import { MessagesModule } from 'primeng/messages';
|
|
@@ -334,14 +336,18 @@ class RESTworldClient {
|
|
|
334
336
|
async getList(rel, parameters, headers, curie) {
|
|
335
337
|
const link = this.getLinkFromHome(rel, LinkNames.getList, curie);
|
|
336
338
|
const uri = link.fillTemplate(parameters);
|
|
337
|
-
const
|
|
339
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
340
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
341
|
+
const response = await this.halClient.get(uri, PagedListResource, ProblemDetails, combinedHeaders);
|
|
338
342
|
return response;
|
|
339
343
|
}
|
|
340
344
|
async getListByUri(uri, parameters, headers) {
|
|
341
345
|
const link = new Link();
|
|
342
346
|
link.href = uri;
|
|
343
347
|
const filledUri = link.fillTemplate(parameters);
|
|
344
|
-
const
|
|
348
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
349
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
350
|
+
const response = await this.halClient.get(filledUri, PagedListResource, ProblemDetails, combinedHeaders);
|
|
345
351
|
return response;
|
|
346
352
|
}
|
|
347
353
|
async getSingle(relOrUri, id, headers, curie) {
|
|
@@ -359,7 +365,9 @@ class RESTworldClient {
|
|
|
359
365
|
const link = this.getLinkFromHome(relOrUri, LinkNames.get, curie);
|
|
360
366
|
uri = link.fillTemplate({ id: id.toString() });
|
|
361
367
|
}
|
|
362
|
-
const
|
|
368
|
+
const defaultHeaders = RESTworldClient.createHeaders('application/hal+json', this._options.Version);
|
|
369
|
+
const combinedHeaders = RESTworldClient.combineHeaders(headers, defaultHeaders, false);
|
|
370
|
+
const response = await this.halClient.get(uri, Resource, ProblemDetails, combinedHeaders);
|
|
363
371
|
return response;
|
|
364
372
|
}
|
|
365
373
|
async save(resource) {
|
|
@@ -451,9 +459,27 @@ class RESTworldClient {
|
|
|
451
459
|
}
|
|
452
460
|
static createHeaders(mediaType, version) {
|
|
453
461
|
if (version)
|
|
454
|
-
return new HttpHeaders({
|
|
462
|
+
return new HttpHeaders({
|
|
463
|
+
'Accept': `${mediaType || 'application/hal+json'}; v=${version}`,
|
|
464
|
+
'Content-Type': `${mediaType || 'application/hal+json'}; v=${version}`
|
|
465
|
+
});
|
|
455
466
|
return new HttpHeaders();
|
|
456
467
|
}
|
|
468
|
+
static combineHeaders(originalHeaders, headersToAdd, overwriteExisting) {
|
|
469
|
+
if (!headersToAdd)
|
|
470
|
+
return originalHeaders;
|
|
471
|
+
if (!originalHeaders)
|
|
472
|
+
return headersToAdd;
|
|
473
|
+
let combinedHeaders = originalHeaders;
|
|
474
|
+
for (const key in headersToAdd.keys) {
|
|
475
|
+
if (!combinedHeaders.has(key) || overwriteExisting) {
|
|
476
|
+
const headerValuesToAdd = headersToAdd.getAll(key);
|
|
477
|
+
if (headerValuesToAdd)
|
|
478
|
+
combinedHeaders = combinedHeaders.set(key, headerValuesToAdd);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return combinedHeaders;
|
|
482
|
+
}
|
|
457
483
|
}
|
|
458
484
|
|
|
459
485
|
class RESTworldClientCollection {
|
|
@@ -1160,17 +1186,23 @@ var ColumnType;
|
|
|
1160
1186
|
ColumnType["numeric"] = "numeric";
|
|
1161
1187
|
ColumnType["boolean"] = "boolean";
|
|
1162
1188
|
ColumnType["date"] = "date";
|
|
1189
|
+
ColumnType["array"] = "array";
|
|
1190
|
+
ColumnType["object"] = "object";
|
|
1163
1191
|
})(ColumnType || (ColumnType = {}));
|
|
1164
1192
|
class RESTworldListViewComponent {
|
|
1165
|
-
constructor(_clients, _confirmationService, _messageService, avatarGenerator) {
|
|
1193
|
+
constructor(_clients, _confirmationService, _messageService, avatarGenerator, _router) {
|
|
1166
1194
|
this._clients = _clients;
|
|
1167
1195
|
this._confirmationService = _confirmationService;
|
|
1168
1196
|
this._messageService = _messageService;
|
|
1169
1197
|
this.avatarGenerator = avatarGenerator;
|
|
1198
|
+
this._router = _router;
|
|
1170
1199
|
this._columns = [];
|
|
1171
1200
|
this._editLink = '/edit';
|
|
1201
|
+
this._sortField = '';
|
|
1202
|
+
this._sortOrder = 1;
|
|
1172
1203
|
this.isLoading = false;
|
|
1173
1204
|
this._totalRecords = 0;
|
|
1205
|
+
this.load = _.debounce(this.load2, 100);
|
|
1174
1206
|
this.rowsPerPage = [10, 25, 50];
|
|
1175
1207
|
this._lastEvent = {
|
|
1176
1208
|
rows: this.rowsPerPage[0]
|
|
@@ -1188,20 +1220,34 @@ class RESTworldListViewComponent {
|
|
|
1188
1220
|
}
|
|
1189
1221
|
set apiName(value) {
|
|
1190
1222
|
this._apiName = value;
|
|
1191
|
-
|
|
1192
|
-
this.load(this._lastEvent);
|
|
1223
|
+
this.load(this._lastEvent);
|
|
1193
1224
|
}
|
|
1194
1225
|
get apiName() {
|
|
1195
1226
|
return this._apiName;
|
|
1196
1227
|
}
|
|
1197
1228
|
set rel(value) {
|
|
1198
1229
|
this._rel = value;
|
|
1199
|
-
|
|
1200
|
-
this.load(this._lastEvent);
|
|
1230
|
+
this.load(this._lastEvent);
|
|
1201
1231
|
}
|
|
1202
1232
|
get rel() {
|
|
1203
1233
|
return this._rel;
|
|
1204
1234
|
}
|
|
1235
|
+
set sortField(value) {
|
|
1236
|
+
this._sortField = value ?? '';
|
|
1237
|
+
this._lastEvent.sortField = value;
|
|
1238
|
+
this.load(this._lastEvent);
|
|
1239
|
+
}
|
|
1240
|
+
get sortField() {
|
|
1241
|
+
return this._sortField;
|
|
1242
|
+
}
|
|
1243
|
+
set sortOrder(value) {
|
|
1244
|
+
this._sortOrder = value ?? 1;
|
|
1245
|
+
this._lastEvent.sortOrder = value;
|
|
1246
|
+
this.load(this._lastEvent);
|
|
1247
|
+
}
|
|
1248
|
+
get sortOrder() {
|
|
1249
|
+
return this._sortOrder;
|
|
1250
|
+
}
|
|
1205
1251
|
get value() {
|
|
1206
1252
|
return this.resource?._embedded?.items || [];
|
|
1207
1253
|
}
|
|
@@ -1214,21 +1260,31 @@ class RESTworldListViewComponent {
|
|
|
1214
1260
|
set totalRecords(value) {
|
|
1215
1261
|
this._totalRecords = value || 0;
|
|
1216
1262
|
}
|
|
1217
|
-
get sortOrder() {
|
|
1218
|
-
return this._lastEvent.sortOrder || 0;
|
|
1219
|
-
}
|
|
1220
1263
|
get newHref() {
|
|
1221
1264
|
return this.resource?.findLink('new')?.href;
|
|
1222
1265
|
}
|
|
1223
1266
|
get dateFormat() {
|
|
1224
1267
|
return RESTworldListViewComponent._dateFormat;
|
|
1225
1268
|
}
|
|
1269
|
+
ngOnChanges(changes) {
|
|
1270
|
+
console.log("ngOnChanges " + changes);
|
|
1271
|
+
}
|
|
1272
|
+
ngOnInit() {
|
|
1273
|
+
console.log("ngOnInit");
|
|
1274
|
+
}
|
|
1275
|
+
async ngAfterViewInit() {
|
|
1276
|
+
console.log("ngAfterViewInit");
|
|
1277
|
+
//await this.load(this._lastEvent);
|
|
1278
|
+
}
|
|
1279
|
+
createNew() {
|
|
1280
|
+
return this._router.navigate([this.editLink, this.apiName, this.newHref]);
|
|
1281
|
+
}
|
|
1226
1282
|
getClient() {
|
|
1227
1283
|
if (!this.apiName)
|
|
1228
1284
|
throw new Error('Cannot get a client, because the apiName is not set.');
|
|
1229
1285
|
return this._clients.getClient(this.apiName);
|
|
1230
1286
|
}
|
|
1231
|
-
async
|
|
1287
|
+
async load2(event) {
|
|
1232
1288
|
if (!this.apiName || !this.rel)
|
|
1233
1289
|
return;
|
|
1234
1290
|
this.isLoading = true;
|
|
@@ -1320,6 +1376,10 @@ class RESTworldListViewComponent {
|
|
|
1320
1376
|
return ColumnType.text;
|
|
1321
1377
|
if (_.isBoolean(value))
|
|
1322
1378
|
return ColumnType.boolean;
|
|
1379
|
+
if (_.isArrayLike(value))
|
|
1380
|
+
return ColumnType.array;
|
|
1381
|
+
if (_.isObjectLike(value))
|
|
1382
|
+
return ColumnType.object;
|
|
1323
1383
|
return ColumnType.text;
|
|
1324
1384
|
}
|
|
1325
1385
|
static toTitleCase(anyCase) {
|
|
@@ -1462,19 +1522,25 @@ RESTworldListViewComponent._dateFormat = new Date(3333, 10, 22)
|
|
|
1462
1522
|
.replace("11", "MM")
|
|
1463
1523
|
.replace("3333", "y")
|
|
1464
1524
|
.replace("33", "yy");
|
|
1465
|
-
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 });
|
|
1466
|
-
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 } });
|
|
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 }, { token: i4$2.Router }], 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", 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 } });
|
|
1467
1527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RESTworldListViewComponent, decorators: [{
|
|
1468
1528
|
type: Component,
|
|
1469
|
-
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
|
|
1470
|
-
}], ctorParameters: function () { return [{ type: RESTworldClientCollection }, { type: i2$1.ConfirmationService }, { type: i2$1.MessageService }, { type: AvatarGenerator }]; }, propDecorators: { editLink: [{
|
|
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 [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"] }]
|
|
1530
|
+
}], ctorParameters: function () { return [{ type: RESTworldClientCollection }, { type: i2$1.ConfirmationService }, { type: i2$1.MessageService }, { type: AvatarGenerator }, { type: i4$2.Router }]; }, propDecorators: { editLink: [{
|
|
1471
1531
|
type: Input
|
|
1472
1532
|
}], apiName: [{
|
|
1473
1533
|
type: Input
|
|
1474
1534
|
}], rel: [{
|
|
1475
1535
|
type: Input
|
|
1536
|
+
}], sortField: [{
|
|
1537
|
+
type: Input
|
|
1538
|
+
}], sortOrder: [{
|
|
1539
|
+
type: Input
|
|
1476
1540
|
}], rowsPerPage: [{
|
|
1477
1541
|
type: Input
|
|
1542
|
+
}], createButtonMenu: [{
|
|
1543
|
+
type: Input
|
|
1478
1544
|
}] } });
|
|
1479
1545
|
|
|
1480
1546
|
function initializeSettings(settingsService) {
|
|
@@ -1518,7 +1584,8 @@ RestworldClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", v
|
|
|
1518
1584
|
DialogModule,
|
|
1519
1585
|
ButtonModule,
|
|
1520
1586
|
ColorPickerModule,
|
|
1521
|
-
DragDropModule
|
|
1587
|
+
DragDropModule,
|
|
1588
|
+
SplitButtonModule], exports: [RESTworldListViewComponent,
|
|
1522
1589
|
RESTworldEditViewComponent,
|
|
1523
1590
|
RESTWorldImageViewComponent,
|
|
1524
1591
|
RESTWorldFileViewComponent,
|
|
@@ -1565,7 +1632,8 @@ RestworldClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", v
|
|
|
1565
1632
|
DialogModule,
|
|
1566
1633
|
ButtonModule,
|
|
1567
1634
|
ColorPickerModule,
|
|
1568
|
-
DragDropModule
|
|
1635
|
+
DragDropModule,
|
|
1636
|
+
SplitButtonModule,
|
|
1569
1637
|
]] });
|
|
1570
1638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: RestworldClientModule, decorators: [{
|
|
1571
1639
|
type: NgModule,
|
|
@@ -1609,7 +1677,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImpor
|
|
|
1609
1677
|
DialogModule,
|
|
1610
1678
|
ButtonModule,
|
|
1611
1679
|
ColorPickerModule,
|
|
1612
|
-
DragDropModule
|
|
1680
|
+
DragDropModule,
|
|
1681
|
+
SplitButtonModule,
|
|
1613
1682
|
],
|
|
1614
1683
|
exports: [
|
|
1615
1684
|
RESTworldListViewComponent,
|