@smallpearl/ngx-helper 0.29.34 → 0.29.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/sp-mat-entity-crud/en.json +24 -0
- package/assets/i18n/sp-mat-entity-crud/zh-hant.json +24 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +45 -25
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +3 -1
- package/package.json +20 -27
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"save": "Save",
|
|
3
|
+
"edit": "Edit",
|
|
4
|
+
"newItem": "New {{item}}",
|
|
5
|
+
"editItem": "Edit {{item}}",
|
|
6
|
+
"deleteItem": "Delete {{item}}",
|
|
7
|
+
"deleteItemConfirm": "Are you sure you want to delete {{item}}?",
|
|
8
|
+
"deleteItemSuccess": "{{item}} deleted successfully",
|
|
9
|
+
"deleteItemError": "Failed to delete {{item}}",
|
|
10
|
+
"saveSuccess": "{{item}} saved successfully",
|
|
11
|
+
"saveError": "Failed to save {{item}}",
|
|
12
|
+
"createSuccess": "{{item}} created successfully",
|
|
13
|
+
"createError": "Failed to create {{item}}",
|
|
14
|
+
"updateSuccess": "{{item}} updated successfully",
|
|
15
|
+
"updateError": "Failed to update {{item}}",
|
|
16
|
+
"cancel": "Cancel",
|
|
17
|
+
"confirm": "Confirm",
|
|
18
|
+
"yes": "Yes",
|
|
19
|
+
"no": "No",
|
|
20
|
+
"close": "Close",
|
|
21
|
+
"search": "Search",
|
|
22
|
+
"clear": "Clear",
|
|
23
|
+
"add": "Add"
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"save": "保存",
|
|
3
|
+
"edit": "編輯",
|
|
4
|
+
"newItem": "新建 {{item}}",
|
|
5
|
+
"editItem": "編輯 {{item}}",
|
|
6
|
+
"deleteItem": "刪除 {{item}}",
|
|
7
|
+
"deleteItemConfirm": "確定要刪除 {{item}} 嗎?",
|
|
8
|
+
"deleteItemSuccess": "{{item}} 刪除成功",
|
|
9
|
+
"deleteItemError": "{{item}} 刪除失敗",
|
|
10
|
+
"saveSuccess": "{{item}} 保存成功",
|
|
11
|
+
"saveError": "{{item}} 保存失敗",
|
|
12
|
+
"createSuccess": "{{item}} 創建成功",
|
|
13
|
+
"createError": "{{item}} 創建失敗",
|
|
14
|
+
"updateSuccess": "{{item}} 更新成功",
|
|
15
|
+
"updateError": "{{item}} 更新失敗",
|
|
16
|
+
"cancel": "取消",
|
|
17
|
+
"confirm": "確認",
|
|
18
|
+
"yes": "是",
|
|
19
|
+
"no": "否",
|
|
20
|
+
"close": "關閉",
|
|
21
|
+
"search": "搜索",
|
|
22
|
+
"clear": "清除",
|
|
23
|
+
"add": "添加"
|
|
24
|
+
}
|
|
@@ -2,34 +2,35 @@ import * as i1$1 from '@angular/common/http';
|
|
|
2
2
|
import { HttpContextToken, HttpContext } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, inject, input, signal, viewChild, ViewContainerRef, Component, ChangeDetectionStrategy, computed, viewChildren, EventEmitter, ContentChildren, Output, ChangeDetectorRef } from '@angular/core';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i5 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
import * as i1 from '@angular/material/button';
|
|
8
8
|
import { MatButtonModule } from '@angular/material/button';
|
|
9
9
|
import * as i2$1 from '@angular/material/snack-bar';
|
|
10
10
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
11
11
|
import { MatSortModule } from '@angular/material/sort';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i8 from '@angular/material/table';
|
|
13
13
|
import { MatColumnDef, MatTableModule } from '@angular/material/table';
|
|
14
|
-
import * as
|
|
14
|
+
import * as i6 from '@angular/router';
|
|
15
15
|
import { RouterModule } from '@angular/router';
|
|
16
16
|
import { SPMatHostBusyWheelDirective, showBusyWheelUntilComplete } from '@smallpearl/ngx-helper/mat-busy-wheel';
|
|
17
17
|
import { SPMatContextMenuComponent } from '@smallpearl/ngx-helper/mat-context-menu';
|
|
18
18
|
import { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';
|
|
19
|
-
import * as
|
|
19
|
+
import * as i9 from '@angular/material/menu';
|
|
20
20
|
import { MatMenuModule } from '@angular/material/menu';
|
|
21
21
|
import * as i3 from '@angular/platform-browser';
|
|
22
|
-
import * as
|
|
22
|
+
import * as i11 from 'angular-split';
|
|
23
23
|
import { AngularSplitModule } from 'angular-split';
|
|
24
24
|
import { startCase } from 'lodash';
|
|
25
25
|
import { plural } from 'pluralize';
|
|
26
26
|
import { Subscription, tap, switchMap, of, map } from 'rxjs';
|
|
27
27
|
import * as i2 from '@angular/material/icon';
|
|
28
28
|
import { MatIconModule } from '@angular/material/icon';
|
|
29
|
+
import * as i4 from '@jsverse/transloco';
|
|
30
|
+
import { provideTranslocoScope, TranslocoModule } from '@jsverse/transloco';
|
|
29
31
|
import * as i1$2 from '@angular/material/toolbar';
|
|
30
32
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
31
33
|
import { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';
|
|
32
|
-
import { tap as tap$1 } from 'rxjs/operators';
|
|
33
34
|
|
|
34
35
|
const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT = new HttpContextToken(() => ({
|
|
35
36
|
entityName: '',
|
|
@@ -284,6 +285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
284
285
|
|
|
285
286
|
class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
286
287
|
snackBar;
|
|
288
|
+
transloco;
|
|
287
289
|
// entityName = input.required<string>();
|
|
288
290
|
// entityNamePlural = input<string>();
|
|
289
291
|
itemLabel = input();
|
|
@@ -548,9 +550,10 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
548
550
|
.map((col) => (typeof col === 'string' ? col : col.name))
|
|
549
551
|
.filter((name) => name !== 'action')
|
|
550
552
|
: []);
|
|
551
|
-
constructor(http, snackBar, sanitizer, injector) {
|
|
553
|
+
constructor(http, snackBar, sanitizer, injector, transloco) {
|
|
552
554
|
super(http, sanitizer, injector);
|
|
553
555
|
this.snackBar = snackBar;
|
|
556
|
+
this.transloco = transloco;
|
|
554
557
|
this.crudConfig = getEntityCrudConfig();
|
|
555
558
|
if (this.crudConfig?.defaultItemActions) {
|
|
556
559
|
this.defaultItemCrudActions.set(this.crudConfig?.defaultItemActions);
|
|
@@ -561,8 +564,13 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
561
564
|
{ label: this.crudConfig.i18n.delete, role: '_delete_' },
|
|
562
565
|
]);
|
|
563
566
|
}
|
|
567
|
+
this.transloco.selectTranslate('editItem', { item: 'Invoice' }, 'sp-mat-entity-crud').subscribe((t) => {
|
|
568
|
+
console.log(`MatEntityCrudComponent: "sp-mat-entity-crud.edit": ${t}, translate: ${this.transloco.translate('editItem', { item: 'Invoice' }, 'sp-mat-entity-crud')}`);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
ngOnInit() {
|
|
572
|
+
console.log('MatEntityCrudComponent: ngOnInit');
|
|
564
573
|
}
|
|
565
|
-
ngOnInit() { }
|
|
566
574
|
ngOnDestroy() {
|
|
567
575
|
this.sub$.unsubscribe();
|
|
568
576
|
}
|
|
@@ -971,13 +979,16 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
971
979
|
});
|
|
972
980
|
return actionsCopy;
|
|
973
981
|
}
|
|
974
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudComponent, deps: [{ token: i1$1.HttpClient }, { token: i2$1.MatSnackBar }, { token: i3.DomSanitizer }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
975
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: SPMatEntityCrudComponent, isStandalone: true, selector: "sp-mat-entity-crud", inputs: { itemLabel: { classPropertyName: "itemLabel", publicName: "itemLabel", isSignal: true, isRequired: false, transformFunction: null }, itemLabelPlural: { classPropertyName: "itemLabelPlural", publicName: "itemLabelPlural", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, itemActions: { classPropertyName: "itemActions", publicName: "itemActions", isSignal: true, isRequired: false, transformFunction: null }, newItemLink: { classPropertyName: "newItemLink", publicName: "newItemLink", isSignal: true, isRequired: false, transformFunction: null }, newItemLabel: { classPropertyName: "newItemLabel", publicName: "newItemLabel", isSignal: true, isRequired: false, transformFunction: null }, editItemTitle: { classPropertyName: "editItemTitle", publicName: "editItemTitle", isSignal: true, isRequired: false, transformFunction: null }, newItemSubTypes: { classPropertyName: "newItemSubTypes", publicName: "newItemSubTypes", isSignal: true, isRequired: false, transformFunction: null }, crudOpFn: { classPropertyName: "crudOpFn", publicName: "crudOpFn", isSignal: true, isRequired: false, transformFunction: null }, previewTemplate: { classPropertyName: "previewTemplate", publicName: "previewTemplate", isSignal: true, isRequired: false, transformFunction: null }, allowEntityActionFn: { classPropertyName: "allowEntityActionFn", publicName: "allowEntityActionFn", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, actionsTemplate: { classPropertyName: "actionsTemplate", publicName: "actionsTemplate", isSignal: true, isRequired: false, transformFunction: null }, crudResponseParser: { classPropertyName: "crudResponseParser", publicName: "crudResponseParser", isSignal: true, isRequired: false, transformFunction: null }, createEditFormTemplate: { classPropertyName: "createEditFormTemplate", publicName: "createEditFormTemplate", isSignal: true, isRequired: false, transformFunction: null }, disableItemActions: { classPropertyName: "disableItemActions", publicName: "disableItemActions", isSignal: true, isRequired: false, transformFunction: null }, disableCreate: { classPropertyName: "disableCreate", publicName: "disableCreate", isSignal: true, isRequired: false, transformFunction: null }, refreshAfterEdit: { classPropertyName: "refreshAfterEdit", publicName: "refreshAfterEdit", isSignal: true, isRequired: false, transformFunction: null }, crudHttpReqContext: { classPropertyName: "crudHttpReqContext", publicName: "crudHttpReqContext", isSignal: true, isRequired: false, transformFunction: null }, editPaneWidth: { classPropertyName: "editPaneWidth", publicName: "editPaneWidth", isSignal: true, isRequired: false, transformFunction: null }, previewPaneWidth: { classPropertyName: "previewPaneWidth", publicName: "previewPaneWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", entityViewPaneActivated: "entityViewPaneActivated" },
|
|
976
|
-
|
|
982
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudComponent, deps: [{ token: i1$1.HttpClient }, { token: i2$1.MatSnackBar }, { token: i3.DomSanitizer }, { token: i0.Injector }, { token: i4.TranslocoService }], target: i0.ɵɵFactoryTarget.Component });
|
|
983
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: SPMatEntityCrudComponent, isStandalone: true, selector: "sp-mat-entity-crud", inputs: { itemLabel: { classPropertyName: "itemLabel", publicName: "itemLabel", isSignal: true, isRequired: false, transformFunction: null }, itemLabelPlural: { classPropertyName: "itemLabelPlural", publicName: "itemLabelPlural", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, itemActions: { classPropertyName: "itemActions", publicName: "itemActions", isSignal: true, isRequired: false, transformFunction: null }, newItemLink: { classPropertyName: "newItemLink", publicName: "newItemLink", isSignal: true, isRequired: false, transformFunction: null }, newItemLabel: { classPropertyName: "newItemLabel", publicName: "newItemLabel", isSignal: true, isRequired: false, transformFunction: null }, editItemTitle: { classPropertyName: "editItemTitle", publicName: "editItemTitle", isSignal: true, isRequired: false, transformFunction: null }, newItemSubTypes: { classPropertyName: "newItemSubTypes", publicName: "newItemSubTypes", isSignal: true, isRequired: false, transformFunction: null }, crudOpFn: { classPropertyName: "crudOpFn", publicName: "crudOpFn", isSignal: true, isRequired: false, transformFunction: null }, previewTemplate: { classPropertyName: "previewTemplate", publicName: "previewTemplate", isSignal: true, isRequired: false, transformFunction: null }, allowEntityActionFn: { classPropertyName: "allowEntityActionFn", publicName: "allowEntityActionFn", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, actionsTemplate: { classPropertyName: "actionsTemplate", publicName: "actionsTemplate", isSignal: true, isRequired: false, transformFunction: null }, crudResponseParser: { classPropertyName: "crudResponseParser", publicName: "crudResponseParser", isSignal: true, isRequired: false, transformFunction: null }, createEditFormTemplate: { classPropertyName: "createEditFormTemplate", publicName: "createEditFormTemplate", isSignal: true, isRequired: false, transformFunction: null }, disableItemActions: { classPropertyName: "disableItemActions", publicName: "disableItemActions", isSignal: true, isRequired: false, transformFunction: null }, disableCreate: { classPropertyName: "disableCreate", publicName: "disableCreate", isSignal: true, isRequired: false, transformFunction: null }, refreshAfterEdit: { classPropertyName: "refreshAfterEdit", publicName: "refreshAfterEdit", isSignal: true, isRequired: false, transformFunction: null }, crudHttpReqContext: { classPropertyName: "crudHttpReqContext", publicName: "crudHttpReqContext", isSignal: true, isRequired: false, transformFunction: null }, editPaneWidth: { classPropertyName: "editPaneWidth", publicName: "editPaneWidth", isSignal: true, isRequired: false, transformFunction: null }, previewPaneWidth: { classPropertyName: "previewPaneWidth", publicName: "previewPaneWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", entityViewPaneActivated: "entityViewPaneActivated" }, providers: [
|
|
984
|
+
provideTranslocoScope('sp-mat-entity-crud')
|
|
985
|
+
], queries: [{ propertyName: "_clientColumnDefs", predicate: MatColumnDef }], viewQueries: [{ propertyName: "componentColumns", predicate: MatColumnDef, descendants: true, isSignal: true }, { propertyName: "spEntitiesList", first: true, predicate: (SPMatEntityListComponent), descendants: true, isSignal: true }, { propertyName: "createEditHostComponent", first: true, predicate: FormViewHostComponent, descendants: true, isSignal: true }, { propertyName: "previewHostComponent", first: true, predicate: PreviewHostComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
986
|
+
<as-split direction="horizontal" [gutterSize]="6" *transloco="let t">
|
|
977
987
|
<as-split-area [size]="entitiesPaneWidth()" [visible]="!entitiesPaneHidden()">
|
|
978
988
|
<div
|
|
979
989
|
[class]="crudConfig.listPaneWrapperClass"
|
|
980
990
|
>
|
|
991
|
+
<h2>sp-mat-entity-crud.newItem: {{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}</h2>
|
|
981
992
|
<ng-content select="[breadCrumbs]"></ng-content>
|
|
982
993
|
|
|
983
994
|
<ng-template #defaultActionButtons>
|
|
@@ -990,10 +1001,12 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
990
1001
|
color="primary"
|
|
991
1002
|
[matMenuTriggerFor]="newSubTypesMenu"
|
|
992
1003
|
>
|
|
993
|
-
|
|
1004
|
+
{{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}
|
|
1005
|
+
<mat-icon>expand_circle_down</mat-icon>
|
|
1006
|
+
<!-- {{
|
|
994
1007
|
newItemLabel() ??
|
|
995
1008
|
crudConfig.i18n.newItemLabel(this._itemLabel())
|
|
996
|
-
}} ▼
|
|
1009
|
+
}} ▼ -->
|
|
997
1010
|
<!-- down arrow-head -->
|
|
998
1011
|
</button>
|
|
999
1012
|
<mat-menu #newSubTypesMenu="matMenu">
|
|
@@ -1015,10 +1028,12 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
1015
1028
|
(click)="onCreate($event)"
|
|
1016
1029
|
[routerLink]="newItemLink()"
|
|
1017
1030
|
>
|
|
1031
|
+
{{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}
|
|
1032
|
+
<!--
|
|
1018
1033
|
{{
|
|
1019
1034
|
newItemLabel() ??
|
|
1020
1035
|
crudConfig.i18n.newItemLabel(this._itemLabel())
|
|
1021
|
-
}}
|
|
1036
|
+
}} -->
|
|
1022
1037
|
</button>
|
|
1023
1038
|
} }
|
|
1024
1039
|
</div>
|
|
@@ -1119,7 +1134,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
|
|
|
1119
1134
|
</div>
|
|
1120
1135
|
</as-split-area>
|
|
1121
1136
|
</as-split>
|
|
1122
|
-
`, isInline: true, styles: [".d-none{display:none}.d-inherit{display:inherit}.action-bar{display:flex;flex-direction:row;align-items:center;padding-bottom:.5em}.action-bar-title{font-size:1.5em;font-weight:600}.spacer{flex-grow:1}.action-bar-actions{text-align:end}.active-row{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type:
|
|
1137
|
+
`, isInline: true, styles: [".d-none{display:none}.d-inherit{display:inherit}.action-bar{display:flex;flex-direction:row;align-items:center;padding-bottom:.5em}.action-bar-title{font-size:1.5em;font-weight:600}.spacer{flex-grow:1}.action-bar-actions{text-align:end}.active-row{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i6.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i9.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i4.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: AngularSplitModule }, { kind: "component", type: i11.SplitComponent, selector: "as-split", inputs: ["gutterSize", "gutterStep", "disabled", "gutterClickDeltaPx", "direction", "dir", "unit", "gutterAriaLabel", "restrictMove", "useTransition", "gutterDblClickDuration"], outputs: ["gutterClick", "gutterDblClick", "dragStart", "dragEnd", "transitionEnd"], exportAs: ["asSplit"] }, { kind: "component", type: i11.SplitAreaComponent, selector: "as-split-area", inputs: ["size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { kind: "component", type: SPMatEntityListComponent, selector: "sp-mat-entity-list", inputs: ["entityName", "entityNamePlural", "endpoint", "entityLoaderFn", "columns", "displayedColumns", "pageSize", "idKey", "pagination", "paginator", "sorter", "disableSort", "infiniteScrollContainer", "infiniteScrollDistance", "infiniteScrollThrottle", "infiniteScrollWindow", "httpReqContext", "_deferViewInit"], outputs: ["selectEntity"] }, { kind: "component", type: SPMatContextMenuComponent, selector: "sp-mat-context-menu", inputs: ["menuItems", "label", "menuIconName", "enableHover", "contextData", "hasBackdrop"], outputs: ["selected"] }, { kind: "component", type: FormViewHostComponent, selector: "sp-create-edit-entity-host", inputs: ["entityCrudComponentBase", "clientViewTemplate", "itemLabel", "itemLabelPlural"] }, { kind: "directive", type: SPMatHostBusyWheelDirective, selector: "[spHostBusyWheel]", inputs: ["spHostBusyWheel"] }, { kind: "component", type: PreviewHostComponent, selector: "sp-entity-crud-preview-host", inputs: ["entityCrudComponentBase", "clientViewTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1123
1138
|
}
|
|
1124
1139
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudComponent, decorators: [{
|
|
1125
1140
|
type: Component,
|
|
@@ -1131,18 +1146,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
1131
1146
|
MatSortModule,
|
|
1132
1147
|
MatMenuModule,
|
|
1133
1148
|
MatSnackBarModule,
|
|
1149
|
+
MatIconModule,
|
|
1150
|
+
TranslocoModule,
|
|
1134
1151
|
AngularSplitModule,
|
|
1135
1152
|
SPMatEntityListComponent,
|
|
1136
1153
|
SPMatContextMenuComponent,
|
|
1137
1154
|
FormViewHostComponent,
|
|
1138
1155
|
SPMatHostBusyWheelDirective,
|
|
1139
1156
|
PreviewHostComponent,
|
|
1157
|
+
], providers: [
|
|
1158
|
+
provideTranslocoScope('sp-mat-entity-crud')
|
|
1140
1159
|
], selector: 'sp-mat-entity-crud', template: `
|
|
1141
|
-
<as-split direction="horizontal" [gutterSize]="6">
|
|
1160
|
+
<as-split direction="horizontal" [gutterSize]="6" *transloco="let t">
|
|
1142
1161
|
<as-split-area [size]="entitiesPaneWidth()" [visible]="!entitiesPaneHidden()">
|
|
1143
1162
|
<div
|
|
1144
1163
|
[class]="crudConfig.listPaneWrapperClass"
|
|
1145
1164
|
>
|
|
1165
|
+
<h2>sp-mat-entity-crud.newItem: {{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}</h2>
|
|
1146
1166
|
<ng-content select="[breadCrumbs]"></ng-content>
|
|
1147
1167
|
|
|
1148
1168
|
<ng-template #defaultActionButtons>
|
|
@@ -1155,10 +1175,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
1155
1175
|
color="primary"
|
|
1156
1176
|
[matMenuTriggerFor]="newSubTypesMenu"
|
|
1157
1177
|
>
|
|
1158
|
-
|
|
1178
|
+
{{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}
|
|
1179
|
+
<mat-icon>expand_circle_down</mat-icon>
|
|
1180
|
+
<!-- {{
|
|
1159
1181
|
newItemLabel() ??
|
|
1160
1182
|
crudConfig.i18n.newItemLabel(this._itemLabel())
|
|
1161
|
-
}} ▼
|
|
1183
|
+
}} ▼ -->
|
|
1162
1184
|
<!-- down arrow-head -->
|
|
1163
1185
|
</button>
|
|
1164
1186
|
<mat-menu #newSubTypesMenu="matMenu">
|
|
@@ -1180,10 +1202,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
1180
1202
|
(click)="onCreate($event)"
|
|
1181
1203
|
[routerLink]="newItemLink()"
|
|
1182
1204
|
>
|
|
1205
|
+
{{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}
|
|
1206
|
+
<!--
|
|
1183
1207
|
{{
|
|
1184
1208
|
newItemLabel() ??
|
|
1185
1209
|
crudConfig.i18n.newItemLabel(this._itemLabel())
|
|
1186
|
-
}}
|
|
1210
|
+
}} -->
|
|
1187
1211
|
</button>
|
|
1188
1212
|
} }
|
|
1189
1213
|
</div>
|
|
@@ -1285,7 +1309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
1285
1309
|
</as-split-area>
|
|
1286
1310
|
</as-split>
|
|
1287
1311
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".d-none{display:none}.d-inherit{display:inherit}.action-bar{display:flex;flex-direction:row;align-items:center;padding-bottom:.5em}.action-bar-title{font-size:1.5em;font-weight:600}.spacer{flex-grow:1}.action-bar-actions{text-align:end}.active-row{font-weight:700}\n"] }]
|
|
1288
|
-
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i2$1.MatSnackBar }, { type: i3.DomSanitizer }, { type: i0.Injector }], propDecorators: { _clientColumnDefs: [{
|
|
1312
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i2$1.MatSnackBar }, { type: i3.DomSanitizer }, { type: i0.Injector }, { type: i4.TranslocoService }], propDecorators: { _clientColumnDefs: [{
|
|
1289
1313
|
type: ContentChildren,
|
|
1290
1314
|
args: [MatColumnDef]
|
|
1291
1315
|
}], action: [{
|
|
@@ -1509,11 +1533,7 @@ class SPMatEntityCrudFormBase {
|
|
|
1509
1533
|
? this.bridge()?.create(value)
|
|
1510
1534
|
: this.bridge()?.update(this.entity()[this.getIdKey()], value);
|
|
1511
1535
|
this.sub$.add(obs
|
|
1512
|
-
?.pipe(setServerErrorsAsFormErrors(this._form, this.cdr)
|
|
1513
|
-
if (res) {
|
|
1514
|
-
// this.bridge()?.close();
|
|
1515
|
-
}
|
|
1516
|
-
}))
|
|
1536
|
+
?.pipe(setServerErrorsAsFormErrors(this._form(), this.cdr))
|
|
1517
1537
|
.subscribe());
|
|
1518
1538
|
}
|
|
1519
1539
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudFormBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-crud.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/default-config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/form-view-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-internal-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-pane.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-form-base.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/smallpearl-ngx-helper-mat-entity-crud.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Prototype of the function to parse the CRUD action response.\n */\nexport type SPMatEntityCrudResponseParser = (\n entityName: string,\n idKey: string,\n method: 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) => any|undefined;\n\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityCrudConfig {\n i18n: {\n newItemLabel: (itemLabel: string) => string;\n editItemLabel: (itemLabel: string) => string;\n edit: string;\n delete: string;\n deleteItemHeader: (itemLabel: string) => string;\n deleteItemMessage: (itemLabel: string) => string;\n itemDeletedNotification: (itemLabel: string) => string;\n createdItemNotification: (itemLabel: string) => string;\n updatedItemNotification: (itemLabel: string) => string;\n loseChangesPrompt: string;\n }\n defaultItemActions?: SPContextMenuItem[];\n listPaneWrapperClass?: string;\n previewPaneWrapperClass?: string;\n previewPaneContentClass?: string;\n /**\n * Global crud response parser.\n */\n crudOpResponseParser?: SPMatEntityCrudResponseParser;\n}\n\n/**\n * This is the interface through which the client provided CRUD form component\n * interacts with the 'host' SPMatEntityCrudComponent. When the form wants to\n * submit an entity to the server (for create or update), it should call the\n * one of the create or update methods. The interface also other methods for\n * the form component to interact with SPMatEntityCrudComponent such as\n * refresh its entities list, close the form pane, etc.\n *\n * The interface name has a 'Bridge' as the interface acts as a bridge between\n * the client provided form handler component and the host\n * SPMatEntityCrudComponent.\n */\nexport interface SPMatEntityCrudCreateEditBridge {\n /**\n * Close the edit/update form pane. This WON'T call the 'cancelEditCallback'\n * even if one is registered.\n */\n close: (cancel: boolean) => void;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns None\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n // Parameters of type any are entity values are typically the output of\n // form.value and therefore their types would not necessarily match TEntity.\n // id can be typed as TEntity[Idkey], but TSC doesn't allow that yet.\n /**\n * Create a new instance of TEntity, by sending a POST request to remote.\n * @param entityValue This is the typically the output of Reactive form's\n * form.value. Since this value's shape may be different from TEntity and is\n * known only to client form, we use 'any'.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Update the entity with id `id` with new values in entityValue.\n * @param id TEntity id\n * @param entityValue Entity values to be updated.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n}\n\n/**\n * Prototype of the function that will be used instead of HttpClient for\n * CRUD operations.\n * @param op - the CRUD operation being requested\n * @param entityValue - The entity or entity value upon which the operation\n * is being requested. for 'create' & 'update' this will be the value\n * of the reactive form. This is typically form.value or the 2nd arg to create\n * & update methods of SPMatEntityCrudCreateEditBridge.\n */\nexport type CRUD_OP_FN<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> = (\n op: 'get' | 'create' | 'update' | 'delete',\n id: TEntity[IdKey] | undefined, // valid only for 'get', 'update' & 'delete'\n entityValue: any, // valid only for 'create' & 'update'\n entityCrudComponent: any,\n) => Observable<TEntity | null>;\n\n\nexport type ALLOW_ITEM_ACTION_FN<TEntity> = (entity: TEntity, action: string) => boolean;\n\n/**\n * This interface is used to define sub types for the \"New {{item}}\" button on\n * top of the CRUD UI. An array of these is provided as the value to the\n * component property 'newItemSubTypes'.\n */\nexport interface NewItemSubType {\n /**\n * A role string that will be passed as argument to the (action) event\n * handler. This string allows the event handler to distinguish the selected\n * sub-type.\n *\n * The special keyword '_new_' can be used to activate the\n * `createEditTemplate` template if one is provided. In this case the params\n * element value (see below) can be used in the template to distinguish\n * between different menu items.\n */\n role: string;\n /**\n * Label displayed in the menu representing this role.\n */\n label: string;\n /**\n * Arbitrary value that will be passed to the 'createEditTemplate' in the\n * $implicit template context as 'params'. You can access this in the\n * template like below (see `data.params`):-\n ```\n <ng-template #createEdit let-data>\n <app-create-edit-entity-demo\n [bridge]=\"data.bridge\"\n [entity]=\"data.entity\"\n [params]=\"data.params\"\n ></app-create-edit-entity-demo>\n </ng-template>\n ```\n\n If params is an object and it includes the key 'title', its value will be\n used as the title for the edit form.\n */\n params?: any;\n}\n\nexport type CrudOp = 'create'|'retrieve'|'update'|'delete'|undefined;\n\nexport interface SPMatEntityCrudHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n op: CrudOp;\n}\n\nexport const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityCrudHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n op: undefined,\n }));\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\n\nexport const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken<SPMatEntityCrudConfig>('SPMatEntityCrudConfig');\n","import { inject } from \"@angular/core\";\nimport { SPMatEntityCrudConfig } from \"./mat-entity-crud-types\";\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from \"./providers\";\n\nfunction defaultCrudResponseParser(\n entityName: string,\n idKey: string,\n method: 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) {\n // If the response is an object with a property '<idKey>', return it as\n // TEntity.\n if (resp.hasOwnProperty(idKey)) {\n return resp;\n }\n // If the response has an object indexed at '<entityName>' and it has\n // the property '<idKey>', return it as TEntity.\n if (resp.hasOwnProperty(entityName)) {\n const obj = resp[entityName];\n if (obj.hasOwnProperty(idKey)) {\n return obj;\n }\n }\n // Return undefined, indicating that we could't parse the response.\n return undefined;\n}\n\nexport const DefaultSPMatEntityCrudConfig: SPMatEntityCrudConfig = {\n i18n: {\n newItemLabel: (itemLabel: string) => `New ${itemLabel}`,\n editItemLabel: (itemLabel: string) => `Edit ${itemLabel}`,\n edit: 'Edit',\n delete: 'Delete',\n deleteItemHeader: (itemLabel: string) => `Confirm Delete ${itemLabel}`,\n deleteItemMessage: (itemLabel: string) => `Are you sure you want to delete this ${itemLabel}`,\n itemDeletedNotification: (itemLabel: string) => `${itemLabel} deleted`,\n createdItemNotification: (itemLabel: string) => `${itemLabel} created.`,\n updatedItemNotification: (itemLabel: string) => `${ itemLabel } saved.`,\n loseChangesPrompt: 'OK to lose changes?'\n },\n crudOpResponseParser: defaultCrudResponseParser\n};\n\n/**\n * To be called from an object constructor as it internally calls Angular's\n * inject() API.\n * @param userConfig\n * @returns\n */\nexport function getEntityCrudConfig(): SPMatEntityCrudConfig {\n const userCrudConfig = inject(SP_MAT_ENTITY_CRUD_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityCrudConfig,\n ...(userCrudConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { SPMatHostBusyWheelDirective } from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { Subscription, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig, SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n@Component({\n imports: [CommonModule, MatButtonModule, MatIconModule, SPMatHostBusyWheelDirective],\n selector: 'sp-create-edit-entity-host',\n template: `\n <div spHostBusyWheel=\"formBusyWheel\">\n <div class=\"create-edit-topbar\">\n <div class=\"title\">\n {{ title() }}\n </div>\n <div class=\"spacer\"></div>\n <div class=\"close\">\n <button mat-icon-button (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n <ng-container #clientFormContainer></ng-container>\n </div>\n `,\n styles: `\n .create-edit-topbar {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n }\n .create-edit-topbar .title {\n font-size: 1.5em;\n font-weight: 500;\n }\n .create-edit-topbar .spacer {\n flex-grow: 1;\n }\n .create-edit-topbar .close {\n\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormViewHostComponent<TEntity> implements SPMatEntityCrudCreateEditBridge, OnInit, OnDestroy\n{\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n itemLabel = input.required<string>();\n itemLabelPlural = input.required<string>();\n\n entity = signal<TEntity|undefined>(undefined);\n title = signal<string>('');\n params = signal<any>(undefined);\n clientFormView!: EmbeddedViewRef<any> | null;\n vc = viewChild('clientFormContainer', { read: ViewContainerRef });\n config!: SPMatEntityCrudConfig;\n sub$ = new Subscription();\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n\n ngOnInit() {}\n\n ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n if (params && params?.title) {\n this.title.set(params.title);\n } else {\n this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n }\n this.params.set(params);\n this.createClientView();\n }\n\n close(cancel: boolean) {\n this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.entityCrudComponentBase().registerCanCancelEditCallback(callback);\n }\n\n create(entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.create - entity: ${JSON.stringify(\n // entityValue\n // )}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent?.create(entityValue).pipe(\n tap(() => this.close(false)),\n );\n }\n\n update(id: any, entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.update - id: ${String(\n // id\n // )}, entity: ${entityValue}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent?.update(id, entityValue).pipe(\n tap(() => this.close(false)),\n );\n }\n\n /**\n * Creates the client view provided via template\n */\n createClientView() {\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientFormView = vc.createEmbeddedView(ft, {\n $implicit: {\n bridge: this,\n entity: this.entity(),\n params: this.params()\n },\n });\n this.clientFormView.detectChanges();\n }\n }\n\n destroyClientView() {\n if (this.clientFormView) {\n this.clientFormView.destroy();\n this.clientFormView = null;\n }\n }\n\n onClose() {\n // Can we give the client form component a chance to intercept this\n // and cancel the closure?\n if (this.entityCrudComponentBase().canCancelEdit()) {\n this.entityCrudComponentBase().closeCreateEdit(true);\n this.destroyClientView();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\n\n@Component({\n imports: [],\n selector: 'sp-entity-crud-preview-host',\n template: ` <ng-container #previewComponent></ng-container> `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PreviewHostComponent<TEntity> implements OnInit, OnDestroy {\n vc = viewChild('previewComponent', { read: ViewContainerRef });\n\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n entity = signal<TEntity|undefined>(undefined);\n clientView!: EmbeddedViewRef<any> | null;\n\n constructor() {\n // effect(() => {\n // const tmpl = this.clientViewTemplate();\n // this.createClientView(tmpl);\n // });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {}\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n // if (params && params?.title) {\n // this.title.set(params.title);\n // } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // }\n // this.params.set(params);\n this.createClientView();\n }\n\n close() {\n // this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n private createClientView() {\n if (this.clientView) {\n // We have only one view in the ng-container. So we might as well\n // call clear() to remove all views contained in it.\n this.vc()!.clear();\n this.clientView.destroy();\n }\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientView = this.vc()!.createEmbeddedView(\n ft,\n {\n $implicit: {\n entity: this.entity(),\n entityCrudComponent: this.entityCrudComponentBase(),\n },\n }\n );\n this.clientView.detectChanges();\n }\n }\n\n\n destroyClientView() {\n if (this.clientView) {\n this.clientView.destroy();\n this.clientView = null;\n }\n }\n\n // close() {\n // this.closePreview.emit();\n // }\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n EventEmitter,\n Injector,\n input,\n Output,\n QueryList,\n signal,\n TemplateRef,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatColumnDef, MatTableModule } from '@angular/material/table';\nimport { RouterModule } from '@angular/router';\nimport {\n showBusyWheelUntilComplete,\n SPMatHostBusyWheelDirective\n} from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport {\n SPContextMenuItem,\n SPMatContextMenuComponent,\n} from '@smallpearl/ngx-helper/mat-context-menu';\nimport { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';\n\nimport { MatMenuModule } from '@angular/material/menu';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { SPEntityFieldSpec } from '@smallpearl/ngx-helper/entity-field';\nimport { AngularSplitModule } from 'angular-split';\nimport { startCase } from 'lodash';\nimport { plural } from 'pluralize';\nimport { map, Observable, of, Subscription, switchMap, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { FormViewHostComponent } from './form-view-host.component';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport {\n ALLOW_ITEM_ACTION_FN,\n CRUD_OP_FN,\n CrudOp,\n NewItemSubType,\n SP_MAT_ENTITY_CRUD_HTTP_CONTEXT,\n SPMatEntityCrudConfig,\n SPMatEntityCrudResponseParser,\n} from './mat-entity-crud-types';\nimport { PreviewHostComponent } from './preview-host.component';\n\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatButtonModule,\n MatTableModule,\n MatSortModule,\n MatMenuModule,\n MatSnackBarModule,\n AngularSplitModule,\n SPMatEntityListComponent,\n SPMatContextMenuComponent,\n FormViewHostComponent,\n SPMatHostBusyWheelDirective,\n PreviewHostComponent,\n ],\n selector: 'sp-mat-entity-crud',\n template: `\n <as-split direction=\"horizontal\" [gutterSize]=\"6\">\n <as-split-area [size]=\"entitiesPaneWidth()\" [visible]=\"!entitiesPaneHidden()\">\n <div\n [class]=\"crudConfig.listPaneWrapperClass\"\n >\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n\n <ng-template #defaultActionButtons>\n <div class=\"action-bar-actions\">\n @if (!disableCreate()) { @if (newItemSubTypes()) {\n <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->\n <button\n type=\"button\"\n mat-raised-button\n color=\"primary\"\n [matMenuTriggerFor]=\"newSubTypesMenu\"\n >\n {{\n newItemLabel() ??\n crudConfig.i18n.newItemLabel(this._itemLabel())\n }} ▼\n <!-- down arrow-head -->\n </button>\n <mat-menu #newSubTypesMenu=\"matMenu\">\n @for (subtype of newItemSubTypes(); track $index) { @if\n (subtype.role) {\n <button mat-menu-item (click)=\"handleNewItemSubType(subtype)\">\n {{ subtype.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.5em;\">\n <strong>{{ subtype.label }}</strong>\n </div>\n } }\n </mat-menu>\n } @else {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"onCreate($event)\"\n [routerLink]=\"newItemLink()\"\n >\n {{\n newItemLabel() ??\n crudConfig.i18n.newItemLabel(this._itemLabel())\n }}\n </button>\n } }\n </div>\n </ng-template>\n\n <ng-template #defaultHeaderTemplate>\n <div class=\"action-bar\">\n <div class=\"action-bar-title\">\n {{ _title() }}\n </div>\n <span class=\"spacer\"></span>\n <!-- Hide the action buttons when Preview/Edit pane is active -->\n @if (!entityPaneActive()) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTemplate() || defaultActionButtons\"\n ></ng-container>\n }\n </div>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"headerTemplate() || defaultHeaderTemplate\"\n ></ng-container>\n <sp-mat-entity-list\n [entityName]=\"entityName()\"\n [entityNamePlural]=\"entityNamePlural()\"\n [_deferViewInit]=\"true\"\n [endpoint]=\"endpoint()\"\n [entityLoaderFn]=\"entityLoaderFn()\"\n [columns]=\"columnsWithAction()\"\n [displayedColumns]=\"visibleColumns()\"\n [idKey]=\"idKey()\"\n [pagination]=\"pagination()\"\n [paginator]=\"paginator()\"\n [pageSize]=\"pageSize()\"\n [sorter]=\"sorter()\"\n [disableSort]=\"disableSort()\"\n (selectEntity)=\"handleSelectEntity($event)\"\n [httpReqContext]=\"httpReqContext()\"\n >\n </sp-mat-entity-list>\n </div>\n\n <!--\n We'll be initializing the contentColumnDefs separately and not\n relying on <sp-mat-entity-list>'s internal @ContentChildre() querylist\n for building this. So we define this independenly and not as\n <sp-mat-entity-list> content.\n -->\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n mat-cell\n *matCellDef=\"let element\"\n (click)=\"$event.stopImmediatePropagation()\"\n >\n @if (_itemActions().length) {\n <sp-mat-context-menu\n [menuItems]=\"_itemActions()\"\n (selected)=\"onItemAction($event, element)\"\n [contextData]=\"element\"\n [hasBackdrop]=\"true\"\n ></sp-mat-context-menu>\n }\n </td>\n </ng-container>\n\n <!--\n <div\n [class]=\"crudConfig.listPaneWrapperClass\"\n [ngStyle]=\"{ display: createEditViewActive() ? 'inherit' : 'none' }\"\n spHostBusyWheel=\"formBusyWheel\"\n >\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n <sp-create-edit-entity-host\n [itemLabel]=\"_itemLabel()\"\n [itemLabelPlural]=\"_itemLabelPlural()\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n -->\n </as-split-area>\n <as-split-area [size]=\"entityPaneWidth()\" [visible]=\"entityPaneActive()\">\n <div [class]=\"crudConfig.previewPaneWrapperClass\" spHostBusyWheel=\"formBusyWheel\">\n <sp-entity-crud-preview-host\n [ngClass]=\"createEditViewActive() ? 'd-none' : 'd-inherit'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"previewTemplate()!\"\n ></sp-entity-crud-preview-host>\n <!-- Create/Edit Entity -->\n <sp-create-edit-entity-host\n [ngClass]=\"createEditViewActive() ? 'd-inherit' : 'd-none'\"\n [itemLabel]=\"_itemLabel()\"\n [itemLabelPlural]=\"_itemLabelPlural()\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n </as-split-area>\n </as-split>\n `,\n styles: `\n .d-none {\n display: none;\n }\n .d-inherit {\n display: inherit;\n }\n .action-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 0.5em;\n }\n .action-bar-title {\n font-size: 1.5em;\n font-weight: 600;\n }\n .spacer {\n flex-grow: 1;\n }\n .action-bar-actions {\n text-align: end;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityCrudComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >\n extends SPMatEntityListComponent<TEntity, IdKey>\n implements SPMatEntityCrudComponentBase<TEntity>, AfterViewInit\n{\n // entityName = input.required<string>();\n // entityNamePlural = input<string>();\n\n itemLabel = input<string>();\n itemLabelPlural = input<string>();\n /**\n * Title string displayed above the component. If not specified, will use\n * itemLabelPlural() as the title.\n */\n title = input<string>();\n /**\n *\n */\n itemActions = input<SPContextMenuItem[]>([]);\n /**\n * Specify the list of router paths that will be set as the value for\n * [routerLink] for the 'New {{ item }}' button. If not specified,\n * if createEditTemplate is specified, it will be shown. If not, `action`\n * out event will be raised with `{ role: '_new_' }`.\n */\n newItemLink = input<string | string[]>();\n /**\n * If not specified, will use label from SPMatEntityCrudConfig.i18n.newItemLabel.\n */\n newItemLabel = input<string | string[]>();\n /**\n * Text for the Edit <item> pane title\n */\n editItemTitle = input<string>();\n /**\n * If you want \"New {{item}}\" button to support multiple entity types,\n * you can set this to `NewItemSubType[]`, where each element stands for for\n * a dropdown menu item. Refer to `NewItemSubType` for details on this\n * interface.\n */\n newItemSubTypes = input<NewItemSubType[]>();\n /**\n * If you want to take control of the network operations for the CRUD\n * operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.\n */\n crudOpFn = input<CRUD_OP_FN<TEntity, IdKey>>();\n /**\n * Item preview template.\n */\n previewTemplate = input<TemplateRef<any>>();\n /**\n * Whether to allow a context menu action or not. Return false to disable\n * the action.\n */\n allowEntityActionFn = input<ALLOW_ITEM_ACTION_FN<TEntity>>();\n /**\n * A template that allows the header to be replaced. Usage:-\n *\n * ```\n * <sp-map-entity-crud\n * [headerTemplate]=\"myCrudViewHeader\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudViewHeader>...</ng-template>\n * ```\n */\n headerTemplate = input<TemplateRef<any>>();\n /**\n * Set this to the custom template identifier that will replace the\n * \"New {{Item}}\" button portion. This template will expand towards the\n * title which will be placed to its left (right in rtl).\n *\n * ```\n * <sp-map-entity-crud\n * [actionsTemplate]=\"myCrudActions\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudActions>...</ng-template>\n * ```\n */\n actionsTemplate = input<TemplateRef<any>>();\n\n /**\n * CRUD action response parser. This will be called with the response\n * from CREATE & UPDATE operations to parse the response JSON and return\n * the created/updated TEntity.\n */\n crudResponseParser = input<SPMatEntityCrudResponseParser>();\n /**\n * An ng-template name that contains the component which provides the\n * create/edit CRUD action.\n *\n * ```\n * <ng-template #createEdit let-data>\n * <app-create-edit-entity-demo [bridge]=\"data.bridge\" [entity]=\"data.entity\"></app-create-edit-entity-demo>\n * </ng-template>\n * ```\n * Note how [bridge] & [entity] properties are set deriving them from the\n * implicit template context. [entity] will be undefined for Create\n * opreation and will be the valid entity for an Update.\n * (app-create-edit-entity-demo here is the client code that implements the\n * Create/Edit form)\n */\n createEditFormTemplate = input<TemplateRef<any> | null>(null);\n /**\n * Disables the per item actions column, preventing 'Edit' & 'Delete'\n * (and other user defined) item operations.\n */\n disableItemActions = input<boolean>(false);\n /**\n * Disables the Create function.\n */\n disableCreate = input<boolean>(false);\n /**\n * View refresh policy after a CREATE/UPDATE operation. Values\n * 'none' - Objects are not refreshed after an edit operation. The return\n * value of the edit operation is used as the object to\n * add/update the component's internal store. This is the default.\n * 'object' - Refresh just the object that was returned from the\n * CREATE/UPDATE operation. Use this if the JSON object returned\n * after a successful CREATE/UPDATE op differs from the JSON\n * object returned for the GET request.\n * 'all' - Refresh the entire list after a CREATE/UPDATE operation. This\n * mimics the behaviour of legacy HTML apps with pure server\n * defined UI.\n */\n refreshAfterEdit = input<'none' | 'object' | 'all'>('none');\n /**\n * HttpContext for crud requests - list, create, retrieve, update & delete.\n * The value can be an object where the property names reflect the CRUD\n * methods with each of these keys taking\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]` as its\n * value. This object has a special key 'crud', which if given a value for,\n * would be used for all CRUD requests (CREATE|READ|UPDATE|DELETE).\n *\n * Alternatively the property can be set a\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]` as its\n * value, in which case the same context would be used for all HTTP requests.\n */\n crudHttpReqContext = input<\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | {\n // list?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];\n // crud?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // common context for all crud operations\n create?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // CREATE\n retrieve?:\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]; // RETRIEVE\n update?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // UPDATE\n delete?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // DELETE\n }\n >();\n /**\n * Width of the edit pane as a percentange of the overall <as-split> width.\n */\n editPaneWidth = input<number>(100);\n /**\n * Width of the preview pane as a percentange of the overall <as-split> width.\n */\n previewPaneWidth = input<number>(50);\n\n // INTERNAL PROPERTIES //\n // Derive a label from a camelCase source string. If the camelCase string\n // can be translated, it returns the translated string. If not, the function\n // converts the camelCase to 'Title Case' and returns it.\n private getLabel = (source: string) => {\n const label = this.ngxHelperConfig.i18nTranslate(source);\n if (label.localeCompare(source) !== 0) {\n // Successful translation, return it\n return label;\n }\n return startCase(source);\n };\n\n _itemLabel = computed<string>(() =>\n this.itemLabel()\n ? (this.itemLabel() as string)\n : this.getLabel(this.entityName())\n );\n _itemLabelPlural = computed<string>(() =>\n this.itemLabelPlural()\n ? (this.itemLabelPlural() as string)\n : this.getLabel(plural(this.entityName()))\n );\n // Computed title\n _title = computed(() =>\n this.title() ? this.title() : this._itemLabelPlural()\n );\n // endpoint with the QP string removed (if one was provided)\n _endpointSansParams = computed(() => this.endpoint().split('?')[0]);\n _endpointParams = computed(() => {});\n componentColumns = viewChildren(MatColumnDef);\n @ContentChildren(MatColumnDef) _clientColumnDefs!: QueryList<MatColumnDef>;\n\n /**\n * Event raised for user selecting an item action. It's also raised\n * for 'New <Item>' action, if 'newItemLink' property is not set.\n */\n @Output() action = new EventEmitter<{ role: string; entity?: TEntity }>();\n\n /**\n * Event raised when create Create/Edit pane is activated & deactivated.\n * Event contains two flags:-\n * activated - whether the createEdit form view was activated or\n * deactivated.\n * cancelled - whether the form view was cancelled by user. False for this\n * indicates that the form view was closed after a successful\n * edit operation.\n */\n @Output() entityViewPaneActivated = new EventEmitter<{\n activated: boolean;\n cancelled: boolean|undefined;\n mode: 'edit'|'preview';\n }>();\n\n busyWheelId = `entityCrudBusyWheel-${Date.now()}`;\n sub$ = new Subscription();\n spEntitiesList = viewChild(SPMatEntityListComponent<TEntity, IdKey>);\n crudConfig!: SPMatEntityCrudConfig;\n\n // This is the internal component that will host the createEditFormTemplate\n createEditHostComponent = viewChild(FormViewHostComponent);\n // A flag to toggle the viewport's contents between the mat-table\n // and the create/edit form template.\n createEditViewActive = signal<boolean>(false);\n\n // Whether it's okay to cancel the edit\n canCancelEditCallback!: () => boolean;\n\n // Preview host component\n previewHostComponent = viewChild(PreviewHostComponent);\n previewActive = computed(() => this.previewedEntity() !== undefined);\n previewedEntity = signal<TEntity | undefined>(undefined);\n\n // Whether the pane that hosts the preview/edit-entity template is active.\n // We call it entityPane as it's used to either render a selected entity\n // or to edit one.\n entityPaneActive = computed(() => !!this.previewedEntity() || this.createEditViewActive());\n // Effective width of the entity pane.\n entityPaneWidth = computed(() => !!this.previewedEntity() ? this.previewPaneWidth() : this.editPaneWidth());\n\n // Width of the pane showing the list of entities. Calculated as\n entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth());\n entitiesPaneHidden = computed(() => this.entityPaneActive() && this.entityPaneWidth() === 100);\n\n defaultItemCrudActions = signal<SPContextMenuItem[]>([]);\n columnsWithAction = computed(() => {\n const cols: Array<SPEntityFieldSpec<TEntity, IdKey> | string> = JSON.parse(\n JSON.stringify(this.columns())\n );\n // JSON.parse(JSON.strigify()) does not clone function objects. So\n // explicitly copy these over. So this is really a shallow clone as\n // the cloned objects still refers to the function objects in the original\n // object.\n this.columns().forEach((col, index: number, orgColumns) => {\n const orgCol = orgColumns[index];\n if (typeof orgCol !== 'string') {\n const newColumn = cols[index] as SPEntityFieldSpec<TEntity, IdKey>;\n if (orgCol.valueFn) {\n newColumn.valueFn = orgCol.valueFn;\n }\n if (orgCol.valueOptions) {\n newColumn.valueOptions = orgCol.valueOptions;\n }\n }\n });\n const actionDefined =\n cols.find((c) =>\n typeof c === 'string' ? c === 'action' : c.name === 'action'\n ) !== undefined;\n if (!actionDefined && !this.disableItemActions()) {\n cols.push('action');\n }\n return cols;\n });\n // Use a custom computed() signal to derive the action items for each\n // entity so that we can run per item's allow item action function to\n // selectively disable one or more actions based on the item's state.\n _itemActions = computed(() => {\n return this.getItemActions();\n // const actions =\n // this.itemActions() && this.itemActions().length\n // ? this.itemActions()\n // : this.defaultItemCrudActions();\n // let actionsCopy: SPContextMenuItem[] = JSON.parse(JSON.stringify(actions));\n // actionsCopy.forEach((action, index: number) => {\n // const orgDisable = actions[index]?.disable;\n // action.disable = (entity: TEntity) => {\n // if (orgDisable) {\n // return orgDisable(entity);\n // }\n // const allowItemActionFn = this.allowEntityActionFn();\n // if (allowItemActionFn) {\n // return !allowItemActionFn(entity, action.role ?? action.label);\n // }\n // return false;\n // };\n // });\n // return actionsCopy;\n });\n // This uses the previewActive signal to compute the visible columns\n // when preview is activated. For now we just hide the 'action' column when\n // preview is active. We can further customize this logic by allowing the\n // client to specify the columns to display when preview is active thereby\n // reducing column clutter when the table width becomes narrower owing to\n // preview pane taking up screen space.\n visibleColumns = computed(() =>\n this.entityPaneActive()\n ? this.columnsWithAction()\n .map((col) => (typeof col === 'string' ? col : col.name))\n .filter((name) => name !== 'action')\n : []\n );\n\n constructor(\n http: HttpClient,\n private snackBar: MatSnackBar,\n sanitizer: DomSanitizer,\n injector: Injector,\n ) {\n super(http, sanitizer, injector);\n this.crudConfig = getEntityCrudConfig();\n if (this.crudConfig?.defaultItemActions) {\n this.defaultItemCrudActions.set(this.crudConfig?.defaultItemActions);\n } else {\n this.defaultItemCrudActions.set([\n { label: this.crudConfig.i18n.edit, role: '_update_' },\n { label: this.crudConfig.i18n.delete, role: '_delete_' },\n ]);\n }\n }\n\n override ngOnInit() {}\n\n override ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n override ngAfterViewInit(): void {\n const spEntitiesList = this.spEntitiesList();\n if (spEntitiesList) {\n // Build contentColumnDefs using our component's content. Then add our own\n // 'action' column definition to it. Then set this as the value of\n // child SPMatEntityListComponent.contentColumnDef. This way we force\n // SPMatEntityListComponent to use our component's any project MatColumnDef\n // content in the final mat-table.\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs && spEntitiesList) {\n // Note that we process any content projected matColumnDef first and\n // our own internal content later. And when we process our own internal\n // columns (for now only 'action'), it's not added if a column with that\n // name has already been defined via content projection. This allows the\n // clients to override even internal columns with their column defintion.\n let contentColumnDefs = new Array<MatColumnDef>();\n clientColumnDefs.toArray().forEach((c) => contentColumnDefs.push(c));\n this.componentColumns().forEach((ic) => {\n if (!contentColumnDefs.find((c) => c.name === ic.name)) {\n contentColumnDefs.push(ic);\n }\n });\n spEntitiesList.contentColumnDefs = contentColumnDefs;\n }\n // This is a replication of SPMatEntityCrudList.ngAfterViewInit. That\n // code is skipped as we declare set the _deferViewInit=true in\n // sp-mat-entity-list declaration.\n spEntitiesList.buildColumns();\n spEntitiesList.setupSort();\n spEntitiesList.loadMoreEntities();\n }\n }\n\n /**\n * If the create/edit entity form is active, it calls its registered\n * canCancelEdit callback to determine if it's okay to cancel the edit.\n * You can use this method from the host component's router guard to\n * ensure that any changes made to the form are not accidentally lost by\n * navigating away from the CRUD page.\n *\n * If your CRUD page has multiple sp-mat-entity-crud components, you have to\n * implement the logic to call this method on the appropriate component.\n *\n * If the the create/edit form is not active, this method returns true.\n * @returns\n */\n canDeactivate() {\n if (this.createEditViewActive()) {\n return this.canCancelEdit();\n }\n return true;\n }\n\n override refresh(force = false) {\n this.spEntitiesList()?.refresh(force);\n }\n\n closeCreateEdit(cancelled: boolean) {\n this.createEditViewActive.set(false);\n this.entityViewPaneActivated.emit({ activated: false, cancelled: !!cancelled, mode: 'edit' });\n }\n\n canCancelEdit() {\n if (this.canCancelEditCallback) {\n return this.canCancelEditCallback();\n }\n return true;\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.canCancelEditCallback = callback;\n }\n\n triggerEntityUpdate(entity: TEntity) {\n this.onUpdate(entity);\n }\n\n triggerEntityDelete(entity: TEntity) {\n this.onDelete(entity);\n }\n\n create(entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('create', undefined, entityValue, this);\n } else {\n obs = this.http.post<TEntity>(this.getUrl(this.endpoint()), entityValue, {\n context: this.getCrudReqHttpContext('create'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'create') : of(null)\n ),\n tap((entity) => {\n // If pagination is infinite or if the pagination if none or if the\n // count of items in the current page is less than pageSize()\n // wec an safely add the item to the list, which will cause the view\n // render the new item in the mat-table.\n if (entity) {\n this.spEntitiesList()?.addEntity(entity);\n this.snackBar.open(\n this.crudConfig.i18n.createdItemNotification(this._itemLabel())\n );\n }\n })\n );\n }\n\n update(id: TEntity[IdKey], entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('update', id, entityValue, this);\n } else {\n obs = this.http.patch<TEntity>(this.getEntityUrl(id), entityValue, {\n context: this.getCrudReqHttpContext('update'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null)\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n this.snackBar.open(\n this.crudConfig.i18n.updatedItemNotification(this._itemLabel())\n );\n }\n })\n );\n }\n\n /**\n * Refresh the entity list, after a CRUD CREATE or UPDATE operation.\n * @param resp This is the response from the CRUD operation (CREATE/UPDATE).\n * @param method The CRUD operation post which REFRESH is requested.\n * @returns Observable<TEntity|null>\n */\n doRefreshAfterEdit(resp: any, method: 'create' | 'update') {\n const refreshAfterEdit = this.refreshAfterEdit();\n const entity = this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n method,\n resp\n );\n if (refreshAfterEdit === 'object') {\n let obs!: Observable<TEntity>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(\n 'get',\n (entity as any)[this.idKey()],\n undefined,\n this\n ) as Observable<TEntity>;\n } else {\n obs = this.http.get<TEntity>(\n this.getEntityUrl((entity as any)[this.idKey()]),\n { context: this.getCrudReqHttpContext('retrieve') }\n );\n }\n return obs.pipe(\n map((entity) => {\n return this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n 'retrieve',\n entity\n );\n })\n );\n } else if (refreshAfterEdit === 'all') {\n this.refresh(true);\n return of(null);\n }\n\n return of(entity);\n }\n\n getCrudOpResponseParser(): SPMatEntityCrudResponseParser {\n if (this.crudResponseParser()) {\n // Without the `as SPMatEntityCrudResponseParser`, TSC will complain.\n return this.crudResponseParser() as SPMatEntityCrudResponseParser;\n }\n // crudConfig will have a parser as our default config provides one.\n return this.crudConfig\n .crudOpResponseParser as SPMatEntityCrudResponseParser;\n }\n\n // SPMatEntityCrudComponentBase interface method. Thunk to the implementation\n // method closePreviewImpl().\n closePreview() {\n this.closePreviewImpl(true);\n }\n\n private closePreviewImpl(toggleEntityListActiveEntity: boolean) {\n if (this.previewedEntity()) {\n if (toggleEntityListActiveEntity) {\n this.spEntitiesList()?.toggleActiveEntity(this.previewedEntity());\n }\n this.previewedEntity.set(undefined);\n this.entityViewPaneActivated.emit({ activated: false, cancelled: undefined, mode: 'preview' });\n }\n }\n\n onItemAction(role: string, entity: TEntity) {\n if (role === '_update_') {\n this.onUpdate(entity);\n } else if (role === '_delete_') {\n this.onDelete(entity);\n } else {\n this.action.emit({ role, entity });\n }\n }\n\n onCreate(event: Event) {\n // If newItemLink() has not been provided, check if createEditFormTemplate\n // is specified. If it is, load it and make that cover the entire viewport.\n // If that too is not specified, emit an action event with role='_new_'.\n if (!this.newItemLink() || this.newItemLink()?.length == 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n const params = {\n title: this.newItemLabel() ?? this.crudConfig.i18n.newItemLabel(this._itemLabel()),\n }\n this.showCreateEditView(undefined, params);\n // const tmpl = this.createEditFormTemplate();\n // if (tmpl) {\n // // If preview is active deactivate it\n // if (this.previewActive()) {\n // this.closePreview();\n // }\n // const createEditHost = this.createEditHostComponent();\n // createEditHost!.show(undefined);\n // this.createEditViewActive.set(true);\n // }\n }\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_new_' });\n }\n }\n\n onUpdate(entity: TEntity) {\n const params = {\n title: this.editItemTitle() ?? this.crudConfig.i18n.editItemLabel(this._itemLabel()),\n }\n this.showCreateEditView(entity, params);\n\n // const tmpl = this.createEditFormTemplate();\n // if (tmpl) {\n // // If preview is active deactivate it\n // if (this.previewActive()) {\n // this.closePreview();\n // }\n // const createEditHost = this.createEditHostComponent();\n // if (tmpl && createEditHost) {\n // createEditHost.show(entity);\n // this.createEditViewActive.set(true);\n // }\n // }\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_update_' });\n }\n }\n\n /**\n * Show the create/edit component. This is deliberately made public so as to\n * be callable from the client. This allows the client to dynamically\n * set the form edit template and then show the edit pane by calling this\n * method.\n * @param entity\n * @param params\n */\n showCreateEditView(entity?: TEntity | undefined, params?: any) {\n const tmpl = this.createEditFormTemplate();\n if (!this.createEditViewActive() && tmpl) {\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(true);\n }\n const createEditHost = this.createEditHostComponent();\n createEditHost!.show(entity, params);\n this.createEditViewActive.set(true);\n this.entityViewPaneActivated.emit({ activated: true, cancelled: undefined, mode: 'edit' });\n }\n }\n\n showPreviewView(entity?: TEntity, params?: any) {\n const tmpl = this.previewTemplate();\n if (tmpl) {\n if (!this.createEditViewActive()) {\n const previewHost = this.previewHostComponent();\n this.previewedEntity.set(entity);\n previewHost?.show(entity, params);\n this.entityViewPaneActivated.emit({ activated: true, cancelled: undefined, mode: 'preview' });\n // this.previewActivated.emit({ entity, activated: true });\n }\n }\n }\n\n hidePreviewView() {\n if (this.previewActive()) {\n const previewHost = this.previewHostComponent();\n previewHost?.close();\n this.closePreviewImpl(false);\n }\n }\n\n async onDelete(entity: TEntity) {\n // Do the delete prompt asynchronously so that the context menu is\n // dismissed before the prompt is displayed.\n setTimeout(() => {\n const deletedItemPrompt = this.crudConfig.i18n.deleteItemMessage(\n this._itemLabel()\n );\n const yes = confirm(deletedItemPrompt);\n if (yes) {\n const entityId = (entity as any)[this.idKey()];\n\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(false);\n }\n\n let obs!: Observable<any>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('delete', entityId, undefined, this);\n } else {\n obs = this.http.delete<void>(this.getEntityUrl(entityId), {\n context: this.getCrudReqHttpContext('delete'),\n });\n }\n\n this.sub$.add(\n obs\n .pipe(\n // TODO: how to display a busy wheel?\n // showBusyWheelUntilComplete(this.busyWheelId),\n tap(() => {\n this.spEntitiesList()!.removeEntity(entityId);\n // TODO: customize by providing an interface via SPMatEntityCrudConfig?\n const deletedMessage =\n this.crudConfig.i18n.itemDeletedNotification(\n this._itemLabel()\n );\n this.snackBar.open(deletedMessage);\n })\n )\n .subscribe()\n );\n }\n });\n }\n\n override getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n getEntityUrl(entityId: TEntity[IdKey]) {\n const endpoint = this.endpoint();\n const endpointParts = endpoint.split('?');\n const entityEndpoint =\n (endpointParts[0].endsWith('/')\n ? endpointParts[0]\n : endpointParts[0] + '/') + `${String(entityId)}/`;\n if (endpointParts.length > 1) {\n return this.getUrl(entityEndpoint + `?${endpointParts[1]}`);\n }\n return this.getUrl(entityEndpoint);\n }\n\n handleSelectEntity(entity: TEntity|undefined) {\n if (!this.createEditViewActive()) {\n if (this.previewTemplate()) {\n entity ? this.showPreviewView(entity) : this.hidePreviewView();\n // this.previewedEntity.set(entity);\n } else {\n // If 'previewTemplate' is not set, propagate the event to client.\n this.selectEntity.emit(entity);\n }\n }\n }\n\n handleNewItemSubType(subtype: NewItemSubType) {\n // console.log(`handleNewItemSubType: ${subtype}`);\n if (subtype.role === '_new_') {\n this.showCreateEditView(undefined, subtype?.params);\n } else {\n this.action.emit({ role: subtype.role });\n }\n }\n\n private getCrudReqHttpContext(op: CrudOp) {\n const contextParamToHttpContext = (\n context: HttpContext,\n reqContext: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]\n ) => {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n };\n\n let context = new HttpContext();\n const crudHttpReqContext = this.crudHttpReqContext();\n if (crudHttpReqContext) {\n if (Array.isArray(crudHttpReqContext)) {\n // Same HttpContext for all crud requests\n contextParamToHttpContext(context, crudHttpReqContext);\n } else if (\n typeof crudHttpReqContext === 'object' &&\n op &&\n crudHttpReqContext[op]\n ) {\n contextParamToHttpContext(context, crudHttpReqContext[op]!);\n // if (crudHttpReqContext[op]) {\n // context = contextParamToHttpContext(crudHttpReqContext[op] as any);\n // } else if (crudHttpReqContext['crud']) {\n // context = contextParamToHttpContext(crudHttpReqContext['crud'] as any);\n // }\n }\n // } else if (this.httpReqContext()) {\n // context = contextParamToHttpContext(this.httpReqContext()!);\n }\n\n context.set(SP_MAT_ENTITY_CRUD_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n op,\n });\n return context;\n // const httpReqContext = this.httpReqContext();\n // return httpReqContext\n // ? contextParamToHttpContext(httpReqContext)\n // : undefined;\n }\n\n isItemActionAllowed(action: string, entity: TEntity) {\n return false;\n }\n\n /**\n * Returns the list of item actions. Calls 'allowItemActionFn' for each action\n * to determine if the action is allowed for the given entity.\n * @returns\n */\n getItemActions(): SPContextMenuItem[] {\n const actions =\n this.itemActions() && this.itemActions().length\n ? this.itemActions()\n : this.defaultItemCrudActions();\n let actionsCopy: SPContextMenuItem[] = JSON.parse(JSON.stringify(actions));\n actionsCopy.forEach((action, index: number) => {\n const orgDisable = actions[index]?.disable;\n action.disable = (entity: TEntity) => {\n if (orgDisable) {\n return orgDisable(entity);\n }\n const allowItemActionFn = this.allowEntityActionFn();\n if (allowItemActionFn) {\n return !allowItemActionFn(entity, action.role ?? action.label);\n }\n return false;\n };\n });\n return actionsCopy;\n }\n}\n","import { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\nexport const ITEM_ACTION_UPDATE = '_update_';\nexport const ITEM_ACTION_DELETE = '_delete_';\n\n/**\n * SPMatEntityCrudCreateEditBridge implementer uses this interface to\n * communicate with the parent SPMatEntityCreateComponent. The bridge\n * component would use the hideCreateEdit() to close itself, when user cancels\n * the create/edit operation.\n */\nexport interface SPMatEntityCrudComponentBase<TEntity> {\n /**\n * FormViewHostComponent will call this to close the Create/Edit pane.\n * SPMatEntityCrudComponentBase implementor will destroy the client form\n * view and hide the Create/Edit form view pane and show the hidden\n * entity list view.\n * @returns\n */\n closeCreateEdit: (cancelled: boolean) => void;\n /**\n * Used internally by FormViewHostComponent to determine if the client form\n * view wants to intercept user's cancel the create/edit operation. Perhaps\n * with the Yes/No prompt 'Lose changes?'\n * @returns boolean indicating it's okay to cancel the create/edit operation.\n */\n canCancelEdit: () => boolean;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n /**\n * Initiates update on the given entity.\n * @returns\n */\n triggerEntityUpdate: (entity: TEntity) => void;\n /**\n * Initiates entity delete.\n * @returns\n */\n triggerEntityDelete: (entity: TEntity) => void;\n /**\n * Called by client form-view host component to close a new entity.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to create a new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Called by client form-view host component to close a new entity.\n * @param id The id of the entity being edited.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to update the new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n /**\n * Close the preview pane.\n * @returns\n */\n closePreview: () => void;\n /**\n * Returns the context menu items for the entity. This can be used to build\n * the context menu for an entity in its preview pane toolbar.\n * @returns\n */\n getItemActions(): SPContextMenuItem[];\n}\n","import { ChangeDetectionStrategy, Component, computed, Inject, input, InputSignal, OnDestroy, OnInit, Optional } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { ITEM_ACTION_DELETE, ITEM_ACTION_UPDATE, SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from './providers';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';\n\n/**\n * A preview pane container to provide a consistent UX for all preview panes.\n * It consits of a toolbar on the top and a container div below that takes up\n * the rest of the preview pane area.\n */\n@Component({\n imports: [MatToolbarModule, MatButtonModule, MatIconModule],\n selector: 'sp-mat-entity-crud-preview-pane',\n template: `\n <div class=\"preview-wrapper\">\n <mat-toolbar>\n <mat-toolbar-row>\n @if (title()) {\n <h2>{{ title() }}</h2> \n }\n @if (!hideUpdate()) {\n <button mat-icon-button aria-label=\"Edit\" (click)=\"onEdit()\" [disabled]=\"_disableUpdate()\">\n <mat-icon>edit</mat-icon>\n </button>\n }\n @if (!hideDelete()) {\n <button mat-icon-button aria-label=\"Delete\" (click)=\"onDelete()\" [disabled]=\"_disableDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n <ng-content select=\"[previewToolbarContent]\"></ng-content>\n <span class=\"spacer\"></span>\n <button mat-icon-button aria-label=\"Close\" (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar-row>\n </mat-toolbar>\n <div [class]=\"'preview-content ' + (config.previewPaneContentClass ?? '')\">\n <ng-content select=\"[previewContent]\"></ng-content>\n </div>\n </div>\n `,\n styles: [`\n .preview-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n .spacer {\n flex: 1 1 auto;\n }\n .preview-content {\n flex-grow: 1;\n overflow: scroll;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityCrudPreviewPaneComponent<TEntity> implements OnInit, OnDestroy {\n\n entity = input.required<TEntity>();\n entityCrudComponent = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n title = input<string>();\n disableUpdate = input<boolean>(false);\n hideUpdate = input<boolean>(false);\n disableDelete = input<boolean>(false);\n hideDelete = input<boolean>(false);\n config!: SPMatEntityCrudConfig;\n itemActions!: SPContextMenuItem[];\n\n _disableActionFactory = (role: string, signal?: InputSignal<boolean>) => {\n return computed(() => {\n if (signal && signal()) {\n return true;\n }\n const actionFn = this.itemActions.find((a) => a.role === role)?.disable;\n if (actionFn && actionFn(this.entity())) {\n return true;\n }\n return false;\n });\n };\n _disableUpdate = this._disableActionFactory(ITEM_ACTION_UPDATE, this.disableUpdate);\n _disableDelete = this._disableActionFactory(ITEM_ACTION_DELETE, this.disableDelete);\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n\n ngOnInit() {\n this.itemActions = this.entityCrudComponent().getItemActions();\n }\n\n ngOnDestroy(): void {\n }\n\n onEdit() {\n this.entityCrudComponent().triggerEntityUpdate(this.entity());\n }\n\n onDelete() {\n this.entityCrudComponent().triggerEntityDelete(this.entity());\n }\n\n onClose() {\n this.entityCrudComponent().closePreview();\n }\n}\n","import { ChangeDetectorRef, Component, computed, inject, input, OnDestroy, OnInit, signal } from '@angular/core';\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\nimport { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';\nimport { Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n/**\n * This is a convenience base class that clients can derive from to implement\n * their CRUD form component. Particularly this class registers the change\n * detection hook which will be called when the user attempts to close the\n * form's parent container pane via the Close button on the top right.\n *\n * This button behaves like a Cancel button in a desktop app and therefore if\n * the user has entered any data in the form's controls, (determined by\n * checking form.touched), then a 'Lose Changes' prompt is displayed allowing\n * the user to cancel the closure.\n *\n * The @Component is fake just to keep the VSCode angular linter quiet.\n *\n * To use this class:-\n *\n * 1. Declare a FormGroup<> type as\n *\n * ```\n * type MyForm = FormGroup<{\n * name: FormControl<string>;\n * type: FormControl<string>;\n * notes: FormControl<string>;\n * }>;\n * ```\n *\n * 2. Derive your form's component class from this and implement the\n * createForm() method returing the FormGroup<> instance that matches\n * the FormGroup concrete type above.\n *\n * ```\n * class MyFormComponent extends SPMatEntityCrudFormBase<MyForm, MyEntity> {\n * constructor() {\n * super()\n * }\n *\n * createForm() {\n * return new FormGroup([...])\n * }\n * }\n * ```\n *\n * 3. If you form's value requires manipulation before being sent to the\n * server, override getFormValue() method and do it there before returning\n * the modified values.\n *\n * 4. Wire up the form in the template as:\n *\n * ```\n * <form [formGroup]='form'.. (ngSubmit)=\"onSubmit()\">\n * <button type=\"submit\">Submit</button>\n * </form>\n * ```\n */\n@Component({\n selector: '_#_sp-mat-entity-crud-form-base_#_', template: ``,\n standalone: false\n})\nexport abstract class SPMatEntityCrudFormBase<\n TFormGroup extends AbstractControl,\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy\n{\n _form = signal<TFormGroup|undefined>(undefined);\n entity = input.required<TEntity>();\n bridge = input.required<SPMatEntityCrudCreateEditBridge>();\n params = input<any>();\n sub$ = new Subscription();\n form = computed(() => this._form());\n\n crudConfig = getEntityCrudConfig();\n\n cdr = inject(ChangeDetectorRef);\n\n canCancelEdit = () => {\n return this._canCancelEdit();\n };\n\n _canCancelEdit() {\n const form = this._form();\n if (form && form.touched) {\n return window.confirm(this.crudConfig.i18n.loseChangesPrompt);\n }\n return true;\n }\n\n ngOnInit() {\n this._form.set(this.createForm(this.entity()));\n this.bridge()?.registerCanCancelEditCallback(this.canCancelEdit);\n }\n\n ngOnDestroy() {\n this.sub$.unsubscribe();\n }\n\n // get form(): TFormGroup|undefined {\n // return this._form();\n // }\n\n // set form(f: TFormGroup) {\n // this._form.set(f);\n // }\n\n /**\n * Create the TFormGroup FormGroup class that will be used for the reactive\n * form.\n * @param entity\n */\n abstract createForm(entity: TEntity | undefined): TFormGroup;\n\n /**\n * Override to customize the id key name if it's not 'id'\n * @returns The name of the unique identifier key that will be used to\n * extract the entity's id for UPDATE operation.\n */\n getIdKey() {\n return 'id';\n }\n\n /**\n * Return the form's value to be sent to server as Create/Update CRUD\n * operation data.\n * @returns\n */\n getFormValue() {\n const form = this.form()\n return form ? form.value : undefined;\n }\n\n onSubmit() {\n const value = this.getFormValue();\n const obs = !this.entity()\n ? this.bridge()?.create(value)\n : this.bridge()?.update((this.entity() as any)[this.getIdKey()], value);\n this.sub$.add(\n obs\n ?.pipe(\n setServerErrorsAsFormErrors(this._form as unknown as UntypedFormGroup, this.cdr),\n tap((res) => {\n if (res) {\n // this.bridge()?.close();\n }\n })\n )\n .subscribe()\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","tap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKa,MAAA,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,EAAE,EAAE,SAAS;AACd,CAAA,CAAC;;MCtKS,yBAAyB,GAAG,IAAI,cAAc,CAAwB,uBAAuB;;ACC1G,SAAS,yBAAy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,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,0dAHiB,CAAE,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAG1C,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJ5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oCAAoC,EAAE,QAAQ,EAAE,CAAE,CAAA;AAC5D,oBAAA,UAAU,EAAE;AACf,iBAAA;;;AChED;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-crud.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/default-config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/form-view-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-internal-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-pane.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-form-base.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/smallpearl-ngx-helper-mat-entity-crud.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Prototype of the function to parse the CRUD action response.\n */\nexport type SPMatEntityCrudResponseParser = (\n entityName: string,\n idKey: string,\n method: 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) => any|undefined;\n\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityCrudConfig {\n i18n: {\n newItemLabel: (itemLabel: string) => string;\n editItemLabel: (itemLabel: string) => string;\n edit: string;\n delete: string;\n deleteItemHeader: (itemLabel: string) => string;\n deleteItemMessage: (itemLabel: string) => string;\n itemDeletedNotification: (itemLabel: string) => string;\n createdItemNotification: (itemLabel: string) => string;\n updatedItemNotification: (itemLabel: string) => string;\n loseChangesPrompt: string;\n }\n defaultItemActions?: SPContextMenuItem[];\n listPaneWrapperClass?: string;\n previewPaneWrapperClass?: string;\n previewPaneContentClass?: string;\n /**\n * Global crud response parser.\n */\n crudOpResponseParser?: SPMatEntityCrudResponseParser;\n}\n\n/**\n * This is the interface through which the client provided CRUD form component\n * interacts with the 'host' SPMatEntityCrudComponent. When the form wants to\n * submit an entity to the server (for create or update), it should call the\n * one of the create or update methods. The interface also other methods for\n * the form component to interact with SPMatEntityCrudComponent such as\n * refresh its entities list, close the form pane, etc.\n *\n * The interface name has a 'Bridge' as the interface acts as a bridge between\n * the client provided form handler component and the host\n * SPMatEntityCrudComponent.\n */\nexport interface SPMatEntityCrudCreateEditBridge {\n /**\n * Close the edit/update form pane. This WON'T call the 'cancelEditCallback'\n * even if one is registered.\n */\n close: (cancel: boolean) => void;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns None\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n // Parameters of type any are entity values are typically the output of\n // form.value and therefore their types would not necessarily match TEntity.\n // id can be typed as TEntity[Idkey], but TSC doesn't allow that yet.\n /**\n * Create a new instance of TEntity, by sending a POST request to remote.\n * @param entityValue This is the typically the output of Reactive form's\n * form.value. Since this value's shape may be different from TEntity and is\n * known only to client form, we use 'any'.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Update the entity with id `id` with new values in entityValue.\n * @param id TEntity id\n * @param entityValue Entity values to be updated.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n}\n\n/**\n * Prototype of the function that will be used instead of HttpClient for\n * CRUD operations.\n * @param op - the CRUD operation being requested\n * @param entityValue - The entity or entity value upon which the operation\n * is being requested. for 'create' & 'update' this will be the value\n * of the reactive form. This is typically form.value or the 2nd arg to create\n * & update methods of SPMatEntityCrudCreateEditBridge.\n */\nexport type CRUD_OP_FN<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> = (\n op: 'get' | 'create' | 'update' | 'delete',\n id: TEntity[IdKey] | undefined, // valid only for 'get', 'update' & 'delete'\n entityValue: any, // valid only for 'create' & 'update'\n entityCrudComponent: any,\n) => Observable<TEntity | null>;\n\n\nexport type ALLOW_ITEM_ACTION_FN<TEntity> = (entity: TEntity, action: string) => boolean;\n\n/**\n * This interface is used to define sub types for the \"New {{item}}\" button on\n * top of the CRUD UI. An array of these is provided as the value to the\n * component property 'newItemSubTypes'.\n */\nexport interface NewItemSubType {\n /**\n * A role string that will be passed as argument to the (action) event\n * handler. This string allows the event handler to distinguish the selected\n * sub-type.\n *\n * The special keyword '_new_' can be used to activate the\n * `createEditTemplate` template if one is provided. In this case the params\n * element value (see below) can be used in the template to distinguish\n * between different menu items.\n */\n role: string;\n /**\n * Label displayed in the menu representing this role.\n */\n label: string;\n /**\n * Arbitrary value that will be passed to the 'createEditTemplate' in the\n * $implicit template context as 'params'. You can access this in the\n * template like below (see `data.params`):-\n ```\n <ng-template #createEdit let-data>\n <app-create-edit-entity-demo\n [bridge]=\"data.bridge\"\n [entity]=\"data.entity\"\n [params]=\"data.params\"\n ></app-create-edit-entity-demo>\n </ng-template>\n ```\n\n If params is an object and it includes the key 'title', its value will be\n used as the title for the edit form.\n */\n params?: any;\n}\n\nexport type CrudOp = 'create'|'retrieve'|'update'|'delete'|undefined;\n\nexport interface SPMatEntityCrudHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n op: CrudOp;\n}\n\nexport const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityCrudHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n op: undefined,\n }));\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\n\nexport const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken<SPMatEntityCrudConfig>('SPMatEntityCrudConfig');\n","import { inject } from \"@angular/core\";\nimport { SPMatEntityCrudConfig } from \"./mat-entity-crud-types\";\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from \"./providers\";\n\nfunction defaultCrudResponseParser(\n entityName: string,\n idKey: string,\n method: 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) {\n // If the response is an object with a property '<idKey>', return it as\n // TEntity.\n if (resp.hasOwnProperty(idKey)) {\n return resp;\n }\n // If the response has an object indexed at '<entityName>' and it has\n // the property '<idKey>', return it as TEntity.\n if (resp.hasOwnProperty(entityName)) {\n const obj = resp[entityName];\n if (obj.hasOwnProperty(idKey)) {\n return obj;\n }\n }\n // Return undefined, indicating that we could't parse the response.\n return undefined;\n}\n\nexport const DefaultSPMatEntityCrudConfig: SPMatEntityCrudConfig = {\n i18n: {\n newItemLabel: (itemLabel: string) => `New ${itemLabel}`,\n editItemLabel: (itemLabel: string) => `Edit ${itemLabel}`,\n edit: 'Edit',\n delete: 'Delete',\n deleteItemHeader: (itemLabel: string) => `Confirm Delete ${itemLabel}`,\n deleteItemMessage: (itemLabel: string) => `Are you sure you want to delete this ${itemLabel}`,\n itemDeletedNotification: (itemLabel: string) => `${itemLabel} deleted`,\n createdItemNotification: (itemLabel: string) => `${itemLabel} created.`,\n updatedItemNotification: (itemLabel: string) => `${ itemLabel } saved.`,\n loseChangesPrompt: 'OK to lose changes?'\n },\n crudOpResponseParser: defaultCrudResponseParser\n};\n\n/**\n * To be called from an object constructor as it internally calls Angular's\n * inject() API.\n * @param userConfig\n * @returns\n */\nexport function getEntityCrudConfig(): SPMatEntityCrudConfig {\n const userCrudConfig = inject(SP_MAT_ENTITY_CRUD_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityCrudConfig,\n ...(userCrudConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { SPMatHostBusyWheelDirective } from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { Subscription, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig, SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n@Component({\n imports: [CommonModule, MatButtonModule, MatIconModule, SPMatHostBusyWheelDirective],\n selector: 'sp-create-edit-entity-host',\n template: `\n <div spHostBusyWheel=\"formBusyWheel\">\n <div class=\"create-edit-topbar\">\n <div class=\"title\">\n {{ title() }}\n </div>\n <div class=\"spacer\"></div>\n <div class=\"close\">\n <button mat-icon-button (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n <ng-container #clientFormContainer></ng-container>\n </div>\n `,\n styles: `\n .create-edit-topbar {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n }\n .create-edit-topbar .title {\n font-size: 1.5em;\n font-weight: 500;\n }\n .create-edit-topbar .spacer {\n flex-grow: 1;\n }\n .create-edit-topbar .close {\n\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormViewHostComponent<TEntity> implements SPMatEntityCrudCreateEditBridge, OnInit, OnDestroy\n{\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n itemLabel = input.required<string>();\n itemLabelPlural = input.required<string>();\n\n entity = signal<TEntity|undefined>(undefined);\n title = signal<string>('');\n params = signal<any>(undefined);\n clientFormView!: EmbeddedViewRef<any> | null;\n vc = viewChild('clientFormContainer', { read: ViewContainerRef });\n config!: SPMatEntityCrudConfig;\n sub$ = new Subscription();\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n\n ngOnInit() {}\n\n ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n if (params && params?.title) {\n this.title.set(params.title);\n } else {\n this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n }\n this.params.set(params);\n this.createClientView();\n }\n\n close(cancel: boolean) {\n this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.entityCrudComponentBase().registerCanCancelEditCallback(callback);\n }\n\n create(entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.create - entity: ${JSON.stringify(\n // entityValue\n // )}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent?.create(entityValue).pipe(\n tap(() => this.close(false)),\n );\n }\n\n update(id: any, entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.update - id: ${String(\n // id\n // )}, entity: ${entityValue}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent?.update(id, entityValue).pipe(\n tap(() => this.close(false)),\n );\n }\n\n /**\n * Creates the client view provided via template\n */\n createClientView() {\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientFormView = vc.createEmbeddedView(ft, {\n $implicit: {\n bridge: this,\n entity: this.entity(),\n params: this.params()\n },\n });\n this.clientFormView.detectChanges();\n }\n }\n\n destroyClientView() {\n if (this.clientFormView) {\n this.clientFormView.destroy();\n this.clientFormView = null;\n }\n }\n\n onClose() {\n // Can we give the client form component a chance to intercept this\n // and cancel the closure?\n if (this.entityCrudComponentBase().canCancelEdit()) {\n this.entityCrudComponentBase().closeCreateEdit(true);\n this.destroyClientView();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\n\n@Component({\n imports: [],\n selector: 'sp-entity-crud-preview-host',\n template: ` <ng-container #previewComponent></ng-container> `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PreviewHostComponent<TEntity> implements OnInit, OnDestroy {\n vc = viewChild('previewComponent', { read: ViewContainerRef });\n\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n entity = signal<TEntity|undefined>(undefined);\n clientView!: EmbeddedViewRef<any> | null;\n\n constructor() {\n // effect(() => {\n // const tmpl = this.clientViewTemplate();\n // this.createClientView(tmpl);\n // });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {}\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n // if (params && params?.title) {\n // this.title.set(params.title);\n // } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // }\n // this.params.set(params);\n this.createClientView();\n }\n\n close() {\n // this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n private createClientView() {\n if (this.clientView) {\n // We have only one view in the ng-container. So we might as well\n // call clear() to remove all views contained in it.\n this.vc()!.clear();\n this.clientView.destroy();\n }\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientView = this.vc()!.createEmbeddedView(\n ft,\n {\n $implicit: {\n entity: this.entity(),\n entityCrudComponent: this.entityCrudComponentBase(),\n },\n }\n );\n this.clientView.detectChanges();\n }\n }\n\n\n destroyClientView() {\n if (this.clientView) {\n this.clientView.destroy();\n this.clientView = null;\n }\n }\n\n // close() {\n // this.closePreview.emit();\n // }\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n EventEmitter,\n Injector,\n input,\n Output,\n QueryList,\n signal,\n TemplateRef,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatColumnDef, MatTableModule } from '@angular/material/table';\nimport { RouterModule } from '@angular/router';\nimport {\n showBusyWheelUntilComplete,\n SPMatHostBusyWheelDirective\n} from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport {\n SPContextMenuItem,\n SPMatContextMenuComponent,\n} from '@smallpearl/ngx-helper/mat-context-menu';\nimport { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';\n\nimport { MatMenuModule } from '@angular/material/menu';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { SPEntityFieldSpec } from '@smallpearl/ngx-helper/entity-field';\nimport { AngularSplitModule } from 'angular-split';\nimport { startCase } from 'lodash';\nimport { plural } from 'pluralize';\nimport { map, Observable, of, Subscription, switchMap, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { FormViewHostComponent } from './form-view-host.component';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport {\n ALLOW_ITEM_ACTION_FN,\n CRUD_OP_FN,\n CrudOp,\n NewItemSubType,\n SP_MAT_ENTITY_CRUD_HTTP_CONTEXT,\n SPMatEntityCrudConfig,\n SPMatEntityCrudResponseParser,\n} from './mat-entity-crud-types';\nimport { PreviewHostComponent } from './preview-host.component';\nimport { provideTranslocoScope, TranslocoModule, TranslocoService } from '@jsverse/transloco';\nimport { MatIconModule } from '@angular/material/icon';\n\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatButtonModule,\n MatTableModule,\n MatSortModule,\n MatMenuModule,\n MatSnackBarModule,\n MatIconModule,\n TranslocoModule,\n AngularSplitModule,\n SPMatEntityListComponent,\n SPMatContextMenuComponent,\n FormViewHostComponent,\n SPMatHostBusyWheelDirective,\n PreviewHostComponent,\n ],\n providers: [\n provideTranslocoScope('sp-mat-entity-crud')\n ],\n selector: 'sp-mat-entity-crud',\n template: `\n <as-split direction=\"horizontal\" [gutterSize]=\"6\" *transloco=\"let t\">\n <as-split-area [size]=\"entitiesPaneWidth()\" [visible]=\"!entitiesPaneHidden()\">\n <div\n [class]=\"crudConfig.listPaneWrapperClass\"\n >\n <h2>sp-mat-entity-crud.newItem: {{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}</h2>\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n\n <ng-template #defaultActionButtons>\n <div class=\"action-bar-actions\">\n @if (!disableCreate()) { @if (newItemSubTypes()) {\n <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->\n <button\n type=\"button\"\n mat-raised-button\n color=\"primary\"\n [matMenuTriggerFor]=\"newSubTypesMenu\"\n >\n {{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}\n <mat-icon>expand_circle_down</mat-icon>\n <!-- {{\n newItemLabel() ??\n crudConfig.i18n.newItemLabel(this._itemLabel())\n }} ▼ -->\n <!-- down arrow-head -->\n </button>\n <mat-menu #newSubTypesMenu=\"matMenu\">\n @for (subtype of newItemSubTypes(); track $index) { @if\n (subtype.role) {\n <button mat-menu-item (click)=\"handleNewItemSubType(subtype)\">\n {{ subtype.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.5em;\">\n <strong>{{ subtype.label }}</strong>\n </div>\n } }\n </mat-menu>\n } @else {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"onCreate($event)\"\n [routerLink]=\"newItemLink()\"\n >\n {{ t('spMatEntityCrud.newItem', {item: _itemLabel() }) }}\n<!--\n {{\n newItemLabel() ??\n crudConfig.i18n.newItemLabel(this._itemLabel())\n }} -->\n </button>\n } }\n </div>\n </ng-template>\n\n <ng-template #defaultHeaderTemplate>\n <div class=\"action-bar\">\n <div class=\"action-bar-title\">\n {{ _title() }}\n </div>\n <span class=\"spacer\"></span>\n <!-- Hide the action buttons when Preview/Edit pane is active -->\n @if (!entityPaneActive()) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTemplate() || defaultActionButtons\"\n ></ng-container>\n }\n </div>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"headerTemplate() || defaultHeaderTemplate\"\n ></ng-container>\n <sp-mat-entity-list\n [entityName]=\"entityName()\"\n [entityNamePlural]=\"entityNamePlural()\"\n [_deferViewInit]=\"true\"\n [endpoint]=\"endpoint()\"\n [entityLoaderFn]=\"entityLoaderFn()\"\n [columns]=\"columnsWithAction()\"\n [displayedColumns]=\"visibleColumns()\"\n [idKey]=\"idKey()\"\n [pagination]=\"pagination()\"\n [paginator]=\"paginator()\"\n [pageSize]=\"pageSize()\"\n [sorter]=\"sorter()\"\n [disableSort]=\"disableSort()\"\n (selectEntity)=\"handleSelectEntity($event)\"\n [httpReqContext]=\"httpReqContext()\"\n >\n </sp-mat-entity-list>\n </div>\n\n <!--\n We'll be initializing the contentColumnDefs separately and not\n relying on <sp-mat-entity-list>'s internal @ContentChildre() querylist\n for building this. So we define this independenly and not as\n <sp-mat-entity-list> content.\n -->\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n mat-cell\n *matCellDef=\"let element\"\n (click)=\"$event.stopImmediatePropagation()\"\n >\n @if (_itemActions().length) {\n <sp-mat-context-menu\n [menuItems]=\"_itemActions()\"\n (selected)=\"onItemAction($event, element)\"\n [contextData]=\"element\"\n [hasBackdrop]=\"true\"\n ></sp-mat-context-menu>\n }\n </td>\n </ng-container>\n\n <!--\n <div\n [class]=\"crudConfig.listPaneWrapperClass\"\n [ngStyle]=\"{ display: createEditViewActive() ? 'inherit' : 'none' }\"\n spHostBusyWheel=\"formBusyWheel\"\n >\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n <sp-create-edit-entity-host\n [itemLabel]=\"_itemLabel()\"\n [itemLabelPlural]=\"_itemLabelPlural()\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n -->\n </as-split-area>\n <as-split-area [size]=\"entityPaneWidth()\" [visible]=\"entityPaneActive()\">\n <div [class]=\"crudConfig.previewPaneWrapperClass\" spHostBusyWheel=\"formBusyWheel\">\n <sp-entity-crud-preview-host\n [ngClass]=\"createEditViewActive() ? 'd-none' : 'd-inherit'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"previewTemplate()!\"\n ></sp-entity-crud-preview-host>\n <!-- Create/Edit Entity -->\n <sp-create-edit-entity-host\n [ngClass]=\"createEditViewActive() ? 'd-inherit' : 'd-none'\"\n [itemLabel]=\"_itemLabel()\"\n [itemLabelPlural]=\"_itemLabelPlural()\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n </as-split-area>\n </as-split>\n `,\n styles: `\n .d-none {\n display: none;\n }\n .d-inherit {\n display: inherit;\n }\n .action-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 0.5em;\n }\n .action-bar-title {\n font-size: 1.5em;\n font-weight: 600;\n }\n .spacer {\n flex-grow: 1;\n }\n .action-bar-actions {\n text-align: end;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityCrudComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >\n extends SPMatEntityListComponent<TEntity, IdKey>\n implements SPMatEntityCrudComponentBase<TEntity>, AfterViewInit\n{\n // entityName = input.required<string>();\n // entityNamePlural = input<string>();\n\n itemLabel = input<string>();\n itemLabelPlural = input<string>();\n /**\n * Title string displayed above the component. If not specified, will use\n * itemLabelPlural() as the title.\n */\n title = input<string>();\n /**\n *\n */\n itemActions = input<SPContextMenuItem[]>([]);\n /**\n * Specify the list of router paths that will be set as the value for\n * [routerLink] for the 'New {{ item }}' button. If not specified,\n * if createEditTemplate is specified, it will be shown. If not, `action`\n * out event will be raised with `{ role: '_new_' }`.\n */\n newItemLink = input<string | string[]>();\n /**\n * If not specified, will use label from SPMatEntityCrudConfig.i18n.newItemLabel.\n */\n newItemLabel = input<string | string[]>();\n /**\n * Text for the Edit <item> pane title\n */\n editItemTitle = input<string>();\n /**\n * If you want \"New {{item}}\" button to support multiple entity types,\n * you can set this to `NewItemSubType[]`, where each element stands for for\n * a dropdown menu item. Refer to `NewItemSubType` for details on this\n * interface.\n */\n newItemSubTypes = input<NewItemSubType[]>();\n /**\n * If you want to take control of the network operations for the CRUD\n * operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.\n */\n crudOpFn = input<CRUD_OP_FN<TEntity, IdKey>>();\n /**\n * Item preview template.\n */\n previewTemplate = input<TemplateRef<any>>();\n /**\n * Whether to allow a context menu action or not. Return false to disable\n * the action.\n */\n allowEntityActionFn = input<ALLOW_ITEM_ACTION_FN<TEntity>>();\n /**\n * A template that allows the header to be replaced. Usage:-\n *\n * ```\n * <sp-map-entity-crud\n * [headerTemplate]=\"myCrudViewHeader\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudViewHeader>...</ng-template>\n * ```\n */\n headerTemplate = input<TemplateRef<any>>();\n /**\n * Set this to the custom template identifier that will replace the\n * \"New {{Item}}\" button portion. This template will expand towards the\n * title which will be placed to its left (right in rtl).\n *\n * ```\n * <sp-map-entity-crud\n * [actionsTemplate]=\"myCrudActions\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudActions>...</ng-template>\n * ```\n */\n actionsTemplate = input<TemplateRef<any>>();\n\n /**\n * CRUD action response parser. This will be called with the response\n * from CREATE & UPDATE operations to parse the response JSON and return\n * the created/updated TEntity.\n */\n crudResponseParser = input<SPMatEntityCrudResponseParser>();\n /**\n * An ng-template name that contains the component which provides the\n * create/edit CRUD action.\n *\n * ```\n * <ng-template #createEdit let-data>\n * <app-create-edit-entity-demo [bridge]=\"data.bridge\" [entity]=\"data.entity\"></app-create-edit-entity-demo>\n * </ng-template>\n * ```\n * Note how [bridge] & [entity] properties are set deriving them from the\n * implicit template context. [entity] will be undefined for Create\n * opreation and will be the valid entity for an Update.\n * (app-create-edit-entity-demo here is the client code that implements the\n * Create/Edit form)\n */\n createEditFormTemplate = input<TemplateRef<any> | null>(null);\n /**\n * Disables the per item actions column, preventing 'Edit' & 'Delete'\n * (and other user defined) item operations.\n */\n disableItemActions = input<boolean>(false);\n /**\n * Disables the Create function.\n */\n disableCreate = input<boolean>(false);\n /**\n * View refresh policy after a CREATE/UPDATE operation. Values\n * 'none' - Objects are not refreshed after an edit operation. The return\n * value of the edit operation is used as the object to\n * add/update the component's internal store. This is the default.\n * 'object' - Refresh just the object that was returned from the\n * CREATE/UPDATE operation. Use this if the JSON object returned\n * after a successful CREATE/UPDATE op differs from the JSON\n * object returned for the GET request.\n * 'all' - Refresh the entire list after a CREATE/UPDATE operation. This\n * mimics the behaviour of legacy HTML apps with pure server\n * defined UI.\n */\n refreshAfterEdit = input<'none' | 'object' | 'all'>('none');\n /**\n * HttpContext for crud requests - list, create, retrieve, update & delete.\n * The value can be an object where the property names reflect the CRUD\n * methods with each of these keys taking\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]` as its\n * value. This object has a special key 'crud', which if given a value for,\n * would be used for all CRUD requests (CREATE|READ|UPDATE|DELETE).\n *\n * Alternatively the property can be set a\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]` as its\n * value, in which case the same context would be used for all HTTP requests.\n */\n crudHttpReqContext = input<\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | {\n // list?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];\n // crud?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // common context for all crud operations\n create?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // CREATE\n retrieve?:\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]; // RETRIEVE\n update?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // UPDATE\n delete?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // DELETE\n }\n >();\n /**\n * Width of the edit pane as a percentange of the overall <as-split> width.\n */\n editPaneWidth = input<number>(100);\n /**\n * Width of the preview pane as a percentange of the overall <as-split> width.\n */\n previewPaneWidth = input<number>(50);\n\n // INTERNAL PROPERTIES //\n // Derive a label from a camelCase source string. If the camelCase string\n // can be translated, it returns the translated string. If not, the function\n // converts the camelCase to 'Title Case' and returns it.\n private getLabel = (source: string) => {\n const label = this.ngxHelperConfig.i18nTranslate(source);\n if (label.localeCompare(source) !== 0) {\n // Successful translation, return it\n return label;\n }\n return startCase(source);\n };\n\n _itemLabel = computed<string>(() =>\n this.itemLabel()\n ? (this.itemLabel() as string)\n : this.getLabel(this.entityName())\n );\n _itemLabelPlural = computed<string>(() =>\n this.itemLabelPlural()\n ? (this.itemLabelPlural() as string)\n : this.getLabel(plural(this.entityName()))\n );\n // Computed title\n _title = computed(() =>\n this.title() ? this.title() : this._itemLabelPlural()\n );\n // endpoint with the QP string removed (if one was provided)\n _endpointSansParams = computed(() => this.endpoint().split('?')[0]);\n _endpointParams = computed(() => {});\n componentColumns = viewChildren(MatColumnDef);\n @ContentChildren(MatColumnDef) _clientColumnDefs!: QueryList<MatColumnDef>;\n\n /**\n * Event raised for user selecting an item action. It's also raised\n * for 'New <Item>' action, if 'newItemLink' property is not set.\n */\n @Output() action = new EventEmitter<{ role: string; entity?: TEntity }>();\n\n /**\n * Event raised when create Create/Edit pane is activated & deactivated.\n * Event contains two flags:-\n * activated - whether the createEdit form view was activated or\n * deactivated.\n * cancelled - whether the form view was cancelled by user. False for this\n * indicates that the form view was closed after a successful\n * edit operation.\n */\n @Output() entityViewPaneActivated = new EventEmitter<{\n activated: boolean;\n cancelled: boolean|undefined;\n mode: 'edit'|'preview';\n }>();\n\n busyWheelId = `entityCrudBusyWheel-${Date.now()}`;\n sub$ = new Subscription();\n spEntitiesList = viewChild(SPMatEntityListComponent<TEntity, IdKey>);\n crudConfig!: SPMatEntityCrudConfig;\n\n // This is the internal component that will host the createEditFormTemplate\n createEditHostComponent = viewChild(FormViewHostComponent);\n // A flag to toggle the viewport's contents between the mat-table\n // and the create/edit form template.\n createEditViewActive = signal<boolean>(false);\n\n // Whether it's okay to cancel the edit\n canCancelEditCallback!: () => boolean;\n\n // Preview host component\n previewHostComponent = viewChild(PreviewHostComponent);\n previewActive = computed(() => this.previewedEntity() !== undefined);\n previewedEntity = signal<TEntity | undefined>(undefined);\n\n // Whether the pane that hosts the preview/edit-entity template is active.\n // We call it entityPane as it's used to either render a selected entity\n // or to edit one.\n entityPaneActive = computed(() => !!this.previewedEntity() || this.createEditViewActive());\n // Effective width of the entity pane.\n entityPaneWidth = computed(() => !!this.previewedEntity() ? this.previewPaneWidth() : this.editPaneWidth());\n\n // Width of the pane showing the list of entities. Calculated as\n entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth());\n entitiesPaneHidden = computed(() => this.entityPaneActive() && this.entityPaneWidth() === 100);\n\n defaultItemCrudActions = signal<SPContextMenuItem[]>([]);\n columnsWithAction = computed(() => {\n const cols: Array<SPEntityFieldSpec<TEntity, IdKey> | string> = JSON.parse(\n JSON.stringify(this.columns())\n );\n // JSON.parse(JSON.strigify()) does not clone function objects. So\n // explicitly copy these over. So this is really a shallow clone as\n // the cloned objects still refers to the function objects in the original\n // object.\n this.columns().forEach((col, index: number, orgColumns) => {\n const orgCol = orgColumns[index];\n if (typeof orgCol !== 'string') {\n const newColumn = cols[index] as SPEntityFieldSpec<TEntity, IdKey>;\n if (orgCol.valueFn) {\n newColumn.valueFn = orgCol.valueFn;\n }\n if (orgCol.valueOptions) {\n newColumn.valueOptions = orgCol.valueOptions;\n }\n }\n });\n const actionDefined =\n cols.find((c) =>\n typeof c === 'string' ? c === 'action' : c.name === 'action'\n ) !== undefined;\n if (!actionDefined && !this.disableItemActions()) {\n cols.push('action');\n }\n return cols;\n });\n // Use a custom computed() signal to derive the action items for each\n // entity so that we can run per item's allow item action function to\n // selectively disable one or more actions based on the item's state.\n _itemActions = computed(() => {\n return this.getItemActions();\n // const actions =\n // this.itemActions() && this.itemActions().length\n // ? this.itemActions()\n // : this.defaultItemCrudActions();\n // let actionsCopy: SPContextMenuItem[] = JSON.parse(JSON.stringify(actions));\n // actionsCopy.forEach((action, index: number) => {\n // const orgDisable = actions[index]?.disable;\n // action.disable = (entity: TEntity) => {\n // if (orgDisable) {\n // return orgDisable(entity);\n // }\n // const allowItemActionFn = this.allowEntityActionFn();\n // if (allowItemActionFn) {\n // return !allowItemActionFn(entity, action.role ?? action.label);\n // }\n // return false;\n // };\n // });\n // return actionsCopy;\n });\n // This uses the previewActive signal to compute the visible columns\n // when preview is activated. For now we just hide the 'action' column when\n // preview is active. We can further customize this logic by allowing the\n // client to specify the columns to display when preview is active thereby\n // reducing column clutter when the table width becomes narrower owing to\n // preview pane taking up screen space.\n visibleColumns = computed(() =>\n this.entityPaneActive()\n ? this.columnsWithAction()\n .map((col) => (typeof col === 'string' ? col : col.name))\n .filter((name) => name !== 'action')\n : []\n );\n\n constructor(\n http: HttpClient,\n private snackBar: MatSnackBar,\n sanitizer: DomSanitizer,\n injector: Injector,\n private transloco: TranslocoService\n ) {\n super(http, sanitizer, injector);\n this.crudConfig = getEntityCrudConfig();\n if (this.crudConfig?.defaultItemActions) {\n this.defaultItemCrudActions.set(this.crudConfig?.defaultItemActions);\n } else {\n this.defaultItemCrudActions.set([\n { label: this.crudConfig.i18n.edit, role: '_update_' },\n { label: this.crudConfig.i18n.delete, role: '_delete_' },\n ]);\n }\n this.transloco.selectTranslate('editItem', {item: 'Invoice'}, 'sp-mat-entity-crud').subscribe((t) => {\n console.log(`MatEntityCrudComponent: \"sp-mat-entity-crud.edit\": ${t}, translate: ${this.transloco.translate('editItem', {item: 'Invoice'}, 'sp-mat-entity-crud')}`);\n });\n }\n\n override ngOnInit() {\n console.log('MatEntityCrudComponent: ngOnInit');\n }\n\n override ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n override ngAfterViewInit(): void {\n const spEntitiesList = this.spEntitiesList();\n if (spEntitiesList) {\n // Build contentColumnDefs using our component's content. Then add our own\n // 'action' column definition to it. Then set this as the value of\n // child SPMatEntityListComponent.contentColumnDef. This way we force\n // SPMatEntityListComponent to use our component's any project MatColumnDef\n // content in the final mat-table.\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs && spEntitiesList) {\n // Note that we process any content projected matColumnDef first and\n // our own internal content later. And when we process our own internal\n // columns (for now only 'action'), it's not added if a column with that\n // name has already been defined via content projection. This allows the\n // clients to override even internal columns with their column defintion.\n let contentColumnDefs = new Array<MatColumnDef>();\n clientColumnDefs.toArray().forEach((c) => contentColumnDefs.push(c));\n this.componentColumns().forEach((ic) => {\n if (!contentColumnDefs.find((c) => c.name === ic.name)) {\n contentColumnDefs.push(ic);\n }\n });\n spEntitiesList.contentColumnDefs = contentColumnDefs;\n }\n // This is a replication of SPMatEntityCrudList.ngAfterViewInit. That\n // code is skipped as we declare set the _deferViewInit=true in\n // sp-mat-entity-list declaration.\n spEntitiesList.buildColumns();\n spEntitiesList.setupSort();\n spEntitiesList.loadMoreEntities();\n }\n }\n\n /**\n * If the create/edit entity form is active, it calls its registered\n * canCancelEdit callback to determine if it's okay to cancel the edit.\n * You can use this method from the host component's router guard to\n * ensure that any changes made to the form are not accidentally lost by\n * navigating away from the CRUD page.\n *\n * If your CRUD page has multiple sp-mat-entity-crud components, you have to\n * implement the logic to call this method on the appropriate component.\n *\n * If the the create/edit form is not active, this method returns true.\n * @returns\n */\n canDeactivate() {\n if (this.createEditViewActive()) {\n return this.canCancelEdit();\n }\n return true;\n }\n\n override refresh(force = false) {\n this.spEntitiesList()?.refresh(force);\n }\n\n closeCreateEdit(cancelled: boolean) {\n this.createEditViewActive.set(false);\n this.entityViewPaneActivated.emit({ activated: false, cancelled: !!cancelled, mode: 'edit' });\n }\n\n canCancelEdit() {\n if (this.canCancelEditCallback) {\n return this.canCancelEditCallback();\n }\n return true;\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.canCancelEditCallback = callback;\n }\n\n triggerEntityUpdate(entity: TEntity) {\n this.onUpdate(entity);\n }\n\n triggerEntityDelete(entity: TEntity) {\n this.onDelete(entity);\n }\n\n create(entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('create', undefined, entityValue, this);\n } else {\n obs = this.http.post<TEntity>(this.getUrl(this.endpoint()), entityValue, {\n context: this.getCrudReqHttpContext('create'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'create') : of(null)\n ),\n tap((entity) => {\n // If pagination is infinite or if the pagination if none or if the\n // count of items in the current page is less than pageSize()\n // wec an safely add the item to the list, which will cause the view\n // render the new item in the mat-table.\n if (entity) {\n this.spEntitiesList()?.addEntity(entity);\n this.snackBar.open(\n this.crudConfig.i18n.createdItemNotification(this._itemLabel())\n );\n }\n })\n );\n }\n\n update(id: TEntity[IdKey], entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('update', id, entityValue, this);\n } else {\n obs = this.http.patch<TEntity>(this.getEntityUrl(id), entityValue, {\n context: this.getCrudReqHttpContext('update'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null)\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n this.snackBar.open(\n this.crudConfig.i18n.updatedItemNotification(this._itemLabel())\n );\n }\n })\n );\n }\n\n /**\n * Refresh the entity list, after a CRUD CREATE or UPDATE operation.\n * @param resp This is the response from the CRUD operation (CREATE/UPDATE).\n * @param method The CRUD operation post which REFRESH is requested.\n * @returns Observable<TEntity|null>\n */\n doRefreshAfterEdit(resp: any, method: 'create' | 'update') {\n const refreshAfterEdit = this.refreshAfterEdit();\n const entity = this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n method,\n resp\n );\n if (refreshAfterEdit === 'object') {\n let obs!: Observable<TEntity>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(\n 'get',\n (entity as any)[this.idKey()],\n undefined,\n this\n ) as Observable<TEntity>;\n } else {\n obs = this.http.get<TEntity>(\n this.getEntityUrl((entity as any)[this.idKey()]),\n { context: this.getCrudReqHttpContext('retrieve') }\n );\n }\n return obs.pipe(\n map((entity) => {\n return this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n 'retrieve',\n entity\n );\n })\n );\n } else if (refreshAfterEdit === 'all') {\n this.refresh(true);\n return of(null);\n }\n\n return of(entity);\n }\n\n getCrudOpResponseParser(): SPMatEntityCrudResponseParser {\n if (this.crudResponseParser()) {\n // Without the `as SPMatEntityCrudResponseParser`, TSC will complain.\n return this.crudResponseParser() as SPMatEntityCrudResponseParser;\n }\n // crudConfig will have a parser as our default config provides one.\n return this.crudConfig\n .crudOpResponseParser as SPMatEntityCrudResponseParser;\n }\n\n // SPMatEntityCrudComponentBase interface method. Thunk to the implementation\n // method closePreviewImpl().\n closePreview() {\n this.closePreviewImpl(true);\n }\n\n private closePreviewImpl(toggleEntityListActiveEntity: boolean) {\n if (this.previewedEntity()) {\n if (toggleEntityListActiveEntity) {\n this.spEntitiesList()?.toggleActiveEntity(this.previewedEntity());\n }\n this.previewedEntity.set(undefined);\n this.entityViewPaneActivated.emit({ activated: false, cancelled: undefined, mode: 'preview' });\n }\n }\n\n onItemAction(role: string, entity: TEntity) {\n if (role === '_update_') {\n this.onUpdate(entity);\n } else if (role === '_delete_') {\n this.onDelete(entity);\n } else {\n this.action.emit({ role, entity });\n }\n }\n\n onCreate(event: Event) {\n // If newItemLink() has not been provided, check if createEditFormTemplate\n // is specified. If it is, load it and make that cover the entire viewport.\n // If that too is not specified, emit an action event with role='_new_'.\n if (!this.newItemLink() || this.newItemLink()?.length == 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n const params = {\n title: this.newItemLabel() ?? this.crudConfig.i18n.newItemLabel(this._itemLabel()),\n }\n this.showCreateEditView(undefined, params);\n // const tmpl = this.createEditFormTemplate();\n // if (tmpl) {\n // // If preview is active deactivate it\n // if (this.previewActive()) {\n // this.closePreview();\n // }\n // const createEditHost = this.createEditHostComponent();\n // createEditHost!.show(undefined);\n // this.createEditViewActive.set(true);\n // }\n }\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_new_' });\n }\n }\n\n onUpdate(entity: TEntity) {\n const params = {\n title: this.editItemTitle() ?? this.crudConfig.i18n.editItemLabel(this._itemLabel()),\n }\n this.showCreateEditView(entity, params);\n\n // const tmpl = this.createEditFormTemplate();\n // if (tmpl) {\n // // If preview is active deactivate it\n // if (this.previewActive()) {\n // this.closePreview();\n // }\n // const createEditHost = this.createEditHostComponent();\n // if (tmpl && createEditHost) {\n // createEditHost.show(entity);\n // this.createEditViewActive.set(true);\n // }\n // }\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_update_' });\n }\n }\n\n /**\n * Show the create/edit component. This is deliberately made public so as to\n * be callable from the client. This allows the client to dynamically\n * set the form edit template and then show the edit pane by calling this\n * method.\n * @param entity\n * @param params\n */\n showCreateEditView(entity?: TEntity | undefined, params?: any) {\n const tmpl = this.createEditFormTemplate();\n if (!this.createEditViewActive() && tmpl) {\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(true);\n }\n const createEditHost = this.createEditHostComponent();\n createEditHost!.show(entity, params);\n this.createEditViewActive.set(true);\n this.entityViewPaneActivated.emit({ activated: true, cancelled: undefined, mode: 'edit' });\n }\n }\n\n showPreviewView(entity?: TEntity, params?: any) {\n const tmpl = this.previewTemplate();\n if (tmpl) {\n if (!this.createEditViewActive()) {\n const previewHost = this.previewHostComponent();\n this.previewedEntity.set(entity);\n previewHost?.show(entity, params);\n this.entityViewPaneActivated.emit({ activated: true, cancelled: undefined, mode: 'preview' });\n // this.previewActivated.emit({ entity, activated: true });\n }\n }\n }\n\n hidePreviewView() {\n if (this.previewActive()) {\n const previewHost = this.previewHostComponent();\n previewHost?.close();\n this.closePreviewImpl(false);\n }\n }\n\n async onDelete(entity: TEntity) {\n // Do the delete prompt asynchronously so that the context menu is\n // dismissed before the prompt is displayed.\n setTimeout(() => {\n const deletedItemPrompt = this.crudConfig.i18n.deleteItemMessage(\n this._itemLabel()\n );\n const yes = confirm(deletedItemPrompt);\n if (yes) {\n const entityId = (entity as any)[this.idKey()];\n\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(false);\n }\n\n let obs!: Observable<any>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('delete', entityId, undefined, this);\n } else {\n obs = this.http.delete<void>(this.getEntityUrl(entityId), {\n context: this.getCrudReqHttpContext('delete'),\n });\n }\n\n this.sub$.add(\n obs\n .pipe(\n // TODO: how to display a busy wheel?\n // showBusyWheelUntilComplete(this.busyWheelId),\n tap(() => {\n this.spEntitiesList()!.removeEntity(entityId);\n // TODO: customize by providing an interface via SPMatEntityCrudConfig?\n const deletedMessage =\n this.crudConfig.i18n.itemDeletedNotification(\n this._itemLabel()\n );\n this.snackBar.open(deletedMessage);\n })\n )\n .subscribe()\n );\n }\n });\n }\n\n override getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n getEntityUrl(entityId: TEntity[IdKey]) {\n const endpoint = this.endpoint();\n const endpointParts = endpoint.split('?');\n const entityEndpoint =\n (endpointParts[0].endsWith('/')\n ? endpointParts[0]\n : endpointParts[0] + '/') + `${String(entityId)}/`;\n if (endpointParts.length > 1) {\n return this.getUrl(entityEndpoint + `?${endpointParts[1]}`);\n }\n return this.getUrl(entityEndpoint);\n }\n\n handleSelectEntity(entity: TEntity|undefined) {\n if (!this.createEditViewActive()) {\n if (this.previewTemplate()) {\n entity ? this.showPreviewView(entity) : this.hidePreviewView();\n // this.previewedEntity.set(entity);\n } else {\n // If 'previewTemplate' is not set, propagate the event to client.\n this.selectEntity.emit(entity);\n }\n }\n }\n\n handleNewItemSubType(subtype: NewItemSubType) {\n // console.log(`handleNewItemSubType: ${subtype}`);\n if (subtype.role === '_new_') {\n this.showCreateEditView(undefined, subtype?.params);\n } else {\n this.action.emit({ role: subtype.role });\n }\n }\n\n private getCrudReqHttpContext(op: CrudOp) {\n const contextParamToHttpContext = (\n context: HttpContext,\n reqContext: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]\n ) => {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n };\n\n let context = new HttpContext();\n const crudHttpReqContext = this.crudHttpReqContext();\n if (crudHttpReqContext) {\n if (Array.isArray(crudHttpReqContext)) {\n // Same HttpContext for all crud requests\n contextParamToHttpContext(context, crudHttpReqContext);\n } else if (\n typeof crudHttpReqContext === 'object' &&\n op &&\n crudHttpReqContext[op]\n ) {\n contextParamToHttpContext(context, crudHttpReqContext[op]!);\n // if (crudHttpReqContext[op]) {\n // context = contextParamToHttpContext(crudHttpReqContext[op] as any);\n // } else if (crudHttpReqContext['crud']) {\n // context = contextParamToHttpContext(crudHttpReqContext['crud'] as any);\n // }\n }\n // } else if (this.httpReqContext()) {\n // context = contextParamToHttpContext(this.httpReqContext()!);\n }\n\n context.set(SP_MAT_ENTITY_CRUD_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n op,\n });\n return context;\n // const httpReqContext = this.httpReqContext();\n // return httpReqContext\n // ? contextParamToHttpContext(httpReqContext)\n // : undefined;\n }\n\n isItemActionAllowed(action: string, entity: TEntity) {\n return false;\n }\n\n /**\n * Returns the list of item actions. Calls 'allowItemActionFn' for each action\n * to determine if the action is allowed for the given entity.\n * @returns\n */\n getItemActions(): SPContextMenuItem[] {\n const actions =\n this.itemActions() && this.itemActions().length\n ? this.itemActions()\n : this.defaultItemCrudActions();\n let actionsCopy: SPContextMenuItem[] = JSON.parse(JSON.stringify(actions));\n actionsCopy.forEach((action, index: number) => {\n const orgDisable = actions[index]?.disable;\n action.disable = (entity: TEntity) => {\n if (orgDisable) {\n return orgDisable(entity);\n }\n const allowItemActionFn = this.allowEntityActionFn();\n if (allowItemActionFn) {\n return !allowItemActionFn(entity, action.role ?? action.label);\n }\n return false;\n };\n });\n return actionsCopy;\n }\n}\n","import { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\nexport const ITEM_ACTION_UPDATE = '_update_';\nexport const ITEM_ACTION_DELETE = '_delete_';\n\n/**\n * SPMatEntityCrudCreateEditBridge implementer uses this interface to\n * communicate with the parent SPMatEntityCreateComponent. The bridge\n * component would use the hideCreateEdit() to close itself, when user cancels\n * the create/edit operation.\n */\nexport interface SPMatEntityCrudComponentBase<TEntity> {\n /**\n * FormViewHostComponent will call this to close the Create/Edit pane.\n * SPMatEntityCrudComponentBase implementor will destroy the client form\n * view and hide the Create/Edit form view pane and show the hidden\n * entity list view.\n * @returns\n */\n closeCreateEdit: (cancelled: boolean) => void;\n /**\n * Used internally by FormViewHostComponent to determine if the client form\n * view wants to intercept user's cancel the create/edit operation. Perhaps\n * with the Yes/No prompt 'Lose changes?'\n * @returns boolean indicating it's okay to cancel the create/edit operation.\n */\n canCancelEdit: () => boolean;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n /**\n * Initiates update on the given entity.\n * @returns\n */\n triggerEntityUpdate: (entity: TEntity) => void;\n /**\n * Initiates entity delete.\n * @returns\n */\n triggerEntityDelete: (entity: TEntity) => void;\n /**\n * Called by client form-view host component to close a new entity.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to create a new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Called by client form-view host component to close a new entity.\n * @param id The id of the entity being edited.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to update the new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n /**\n * Close the preview pane.\n * @returns\n */\n closePreview: () => void;\n /**\n * Returns the context menu items for the entity. This can be used to build\n * the context menu for an entity in its preview pane toolbar.\n * @returns\n */\n getItemActions(): SPContextMenuItem[];\n}\n","import { ChangeDetectionStrategy, Component, computed, Inject, input, InputSignal, OnDestroy, OnInit, Optional } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { ITEM_ACTION_DELETE, ITEM_ACTION_UPDATE, SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from './providers';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';\n\n/**\n * A preview pane container to provide a consistent UX for all preview panes.\n * It consits of a toolbar on the top and a container div below that takes up\n * the rest of the preview pane area.\n */\n@Component({\n imports: [MatToolbarModule, MatButtonModule, MatIconModule],\n selector: 'sp-mat-entity-crud-preview-pane',\n template: `\n <div class=\"preview-wrapper\">\n <mat-toolbar>\n <mat-toolbar-row>\n @if (title()) {\n <h2>{{ title() }}</h2> \n }\n @if (!hideUpdate()) {\n <button mat-icon-button aria-label=\"Edit\" (click)=\"onEdit()\" [disabled]=\"_disableUpdate()\">\n <mat-icon>edit</mat-icon>\n </button>\n }\n @if (!hideDelete()) {\n <button mat-icon-button aria-label=\"Delete\" (click)=\"onDelete()\" [disabled]=\"_disableDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n <ng-content select=\"[previewToolbarContent]\"></ng-content>\n <span class=\"spacer\"></span>\n <button mat-icon-button aria-label=\"Close\" (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar-row>\n </mat-toolbar>\n <div [class]=\"'preview-content ' + (config.previewPaneContentClass ?? '')\">\n <ng-content select=\"[previewContent]\"></ng-content>\n </div>\n </div>\n `,\n styles: [`\n .preview-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n .spacer {\n flex: 1 1 auto;\n }\n .preview-content {\n flex-grow: 1;\n overflow: scroll;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityCrudPreviewPaneComponent<TEntity> implements OnInit, OnDestroy {\n\n entity = input.required<TEntity>();\n entityCrudComponent = input.required<SPMatEntityCrudComponentBase<TEntity>>();\n title = input<string>();\n disableUpdate = input<boolean>(false);\n hideUpdate = input<boolean>(false);\n disableDelete = input<boolean>(false);\n hideDelete = input<boolean>(false);\n config!: SPMatEntityCrudConfig;\n itemActions!: SPContextMenuItem[];\n\n _disableActionFactory = (role: string, signal?: InputSignal<boolean>) => {\n return computed(() => {\n if (signal && signal()) {\n return true;\n }\n const actionFn = this.itemActions.find((a) => a.role === role)?.disable;\n if (actionFn && actionFn(this.entity())) {\n return true;\n }\n return false;\n });\n };\n _disableUpdate = this._disableActionFactory(ITEM_ACTION_UPDATE, this.disableUpdate);\n _disableDelete = this._disableActionFactory(ITEM_ACTION_DELETE, this.disableDelete);\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n\n ngOnInit() {\n this.itemActions = this.entityCrudComponent().getItemActions();\n }\n\n ngOnDestroy(): void {\n }\n\n onEdit() {\n this.entityCrudComponent().triggerEntityUpdate(this.entity());\n }\n\n onDelete() {\n this.entityCrudComponent().triggerEntityDelete(this.entity());\n }\n\n onClose() {\n this.entityCrudComponent().closePreview();\n }\n}\n","import { ChangeDetectorRef, Component, computed, inject, input, OnDestroy, OnInit, signal } from '@angular/core';\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\nimport { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';\nimport { Subscription } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n/**\n * This is a convenience base class that clients can derive from to implement\n * their CRUD form component. Particularly this class registers the change\n * detection hook which will be called when the user attempts to close the\n * form's parent container pane via the Close button on the top right.\n *\n * This button behaves like a Cancel button in a desktop app and therefore if\n * the user has entered any data in the form's controls, (determined by\n * checking form.touched), then a 'Lose Changes' prompt is displayed allowing\n * the user to cancel the closure.\n *\n * The @Component is fake just to keep the VSCode angular linter quiet.\n *\n * To use this class:-\n *\n * 1. Declare a FormGroup<> type as\n *\n * ```\n * type MyForm = FormGroup<{\n * name: FormControl<string>;\n * type: FormControl<string>;\n * notes: FormControl<string>;\n * }>;\n * ```\n *\n * 2. Derive your form's component class from this and implement the\n * createForm() method returing the FormGroup<> instance that matches\n * the FormGroup concrete type above.\n *\n * ```\n * class MyFormComponent extends SPMatEntityCrudFormBase<MyForm, MyEntity> {\n * constructor() {\n * super()\n * }\n *\n * createForm() {\n * return new FormGroup([...])\n * }\n * }\n * ```\n *\n * 3. If you form's value requires manipulation before being sent to the\n * server, override getFormValue() method and do it there before returning\n * the modified values.\n *\n * 4. Wire up the form in the template as:\n *\n * ```\n * <form [formGroup]='form'.. (ngSubmit)=\"onSubmit()\">\n * <button type=\"submit\">Submit</button>\n * </form>\n * ```\n */\n@Component({\n selector: '_#_sp-mat-entity-crud-form-base_#_', template: ``,\n standalone: false\n})\nexport abstract class SPMatEntityCrudFormBase<\n TFormGroup extends AbstractControl,\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy\n{\n _form = signal<TFormGroup|undefined>(undefined);\n entity = input.required<TEntity>();\n bridge = input.required<SPMatEntityCrudCreateEditBridge>();\n params = input<any>();\n sub$ = new Subscription();\n form = computed(() => this._form());\n\n crudConfig = getEntityCrudConfig();\n\n cdr = inject(ChangeDetectorRef);\n\n canCancelEdit = () => {\n return this._canCancelEdit();\n };\n\n _canCancelEdit() {\n const form = this._form();\n if (form && form.touched) {\n return window.confirm(this.crudConfig.i18n.loseChangesPrompt);\n }\n return true;\n }\n\n ngOnInit() {\n this._form.set(this.createForm(this.entity()));\n this.bridge()?.registerCanCancelEditCallback(this.canCancelEdit);\n }\n\n ngOnDestroy() {\n this.sub$.unsubscribe();\n }\n\n // get form(): TFormGroup|undefined {\n // return this._form();\n // }\n\n // set form(f: TFormGroup) {\n // this._form.set(f);\n // }\n\n /**\n * Create the TFormGroup FormGroup class that will be used for the reactive\n * form.\n * @param entity\n */\n abstract createForm(entity: TEntity | undefined): TFormGroup;\n\n /**\n * Override to customize the id key name if it's not 'id'\n * @returns The name of the unique identifier key that will be used to\n * extract the entity's id for UPDATE operation.\n */\n getIdKey() {\n return 'id';\n }\n\n /**\n * Return the form's value to be sent to server as Create/Update CRUD\n * operation data.\n * @returns\n */\n getFormValue() {\n const form = this.form()\n return form ? form.value : undefined;\n }\n\n onSubmit() {\n const value = this.getFormValue();\n const obs = !this.entity()\n ? this.bridge()?.create(value)\n : this.bridge()?.update((this.entity() as any)[this.getIdKey()], value);\n this.sub$.add(\n obs\n ?.pipe(\n setServerErrorsAsFormErrors(this._form() as unknown as UntypedFormGroup, this.cdr)\n )\n .subscribe()\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i7","i10","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKa,MAAA,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,EAAE,EAAE,SAAS;AACd,CAAA,CAAC;;MCtKS,yBAAyB,GAAG,IAAI,cAAc,CAAwB,uBAAuB;;ACC1G,SAAS,yBAAyB,CAChC,UAAkB,EAClB,KAAa,EACb,MAAmD,EACnD,IAAS,EAAA;;;AAIT,IAAA,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,OAAO,IAAI;;;;AAIb,IAAA,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;AACnC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;AAC5B,QAAA,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;AAC7B,YAAA,OAAO,GAAG;;;;AAId,IAAA,OAAO,SAAS;AAClB;AAEO,MAAM,4BAA4B,GAA0B;AACjE,IAAA,IAAI,EAAE;QACJ,YAAY,EAAE,CAAC,SAAiB,KAAK,CAAA,IAAA,EAAO,SAAS,CAAE,CAAA;QACvD,aAAa,EAAE,CAAC,SAAiB,KAAK,CAAA,KAAA,EAAQ,SAAS,CAAE,CAAA;AACzD,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;QAChB,gBAAgB,EAAE,CAAC,SAAiB,KAAK,CAAA,eAAA,E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ponent } from './form-view-host.component';
|
|
|
11
11
|
import { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';
|
|
12
12
|
import { ALLOW_ITEM_ACTION_FN, CRUD_OP_FN, NewItemSubType, SPMatEntityCrudConfig, SPMatEntityCrudResponseParser } from './mat-entity-crud-types';
|
|
13
13
|
import { PreviewHostComponent } from './preview-host.component';
|
|
14
|
+
import { TranslocoService } from '@jsverse/transloco';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
15
16
|
export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
16
17
|
[P in IdKey]: PropertyKey;
|
|
17
18
|
}, IdKey extends string = 'id'> extends SPMatEntityListComponent<TEntity, IdKey> implements SPMatEntityCrudComponentBase<TEntity>, AfterViewInit {
|
|
18
19
|
private snackBar;
|
|
20
|
+
private transloco;
|
|
19
21
|
itemLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
20
22
|
itemLabelPlural: import("@angular/core").InputSignal<string | undefined>;
|
|
21
23
|
/**
|
|
@@ -206,7 +208,7 @@ export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
|
206
208
|
columnsWithAction: import("@angular/core").Signal<(string | SPEntityFieldSpec<TEntity, IdKey>)[]>;
|
|
207
209
|
_itemActions: import("@angular/core").Signal<SPContextMenuItem[]>;
|
|
208
210
|
visibleColumns: import("@angular/core").Signal<string[]>;
|
|
209
|
-
constructor(http: HttpClient, snackBar: MatSnackBar, sanitizer: DomSanitizer, injector: Injector);
|
|
211
|
+
constructor(http: HttpClient, snackBar: MatSnackBar, sanitizer: DomSanitizer, injector: Injector, transloco: TranslocoService);
|
|
210
212
|
ngOnInit(): void;
|
|
211
213
|
ngOnDestroy(): void;
|
|
212
214
|
ngAfterViewInit(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smallpearl/ngx-helper",
|
|
3
|
-
"
|
|
3
|
+
"i18n": [
|
|
4
|
+
{
|
|
5
|
+
"scope": "sp-mat-entity-crud",
|
|
6
|
+
"path": "src/assets/i18n/"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"version": "0.29.39",
|
|
4
10
|
"peerDependencies": {
|
|
5
11
|
"@angular/common": "^19.1.0",
|
|
6
12
|
"@angular/core": "^19.1.0",
|
|
@@ -18,20 +24,7 @@
|
|
|
18
24
|
"ngx-mat-select-search": "^8.0.0",
|
|
19
25
|
"rxjs": "^7.0.0"
|
|
20
26
|
},
|
|
21
|
-
"peerDependenciesMeta": {
|
|
22
|
-
"ngx-infinite-scroll": {
|
|
23
|
-
"optional": true
|
|
24
|
-
},
|
|
25
|
-
"angular-split": {
|
|
26
|
-
"optional": true
|
|
27
|
-
},
|
|
28
|
-
"@ngneat/elf": {
|
|
29
|
-
"optional": true
|
|
30
|
-
},
|
|
31
|
-
"@ngneat/elf-entities": {
|
|
32
|
-
"optional": true
|
|
33
|
-
}
|
|
34
|
-
},
|
|
27
|
+
"peerDependenciesMeta": {},
|
|
35
28
|
"dependencies": {
|
|
36
29
|
"tslib": "^2.3.0"
|
|
37
30
|
},
|
|
@@ -54,10 +47,18 @@
|
|
|
54
47
|
"types": "./entity-field/index.d.ts",
|
|
55
48
|
"default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
|
|
56
49
|
},
|
|
50
|
+
"./locale": {
|
|
51
|
+
"types": "./locale/index.d.ts",
|
|
52
|
+
"default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
|
|
53
|
+
},
|
|
57
54
|
"./forms": {
|
|
58
55
|
"types": "./forms/index.d.ts",
|
|
59
56
|
"default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
|
|
60
57
|
},
|
|
58
|
+
"./hover-dropdown": {
|
|
59
|
+
"types": "./hover-dropdown/index.d.ts",
|
|
60
|
+
"default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
|
|
61
|
+
},
|
|
61
62
|
"./mat-busy-wheel": {
|
|
62
63
|
"types": "./mat-busy-wheel/index.d.ts",
|
|
63
64
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
|
|
@@ -66,26 +67,18 @@
|
|
|
66
67
|
"types": "./mat-context-menu/index.d.ts",
|
|
67
68
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
|
|
68
69
|
},
|
|
69
|
-
"./hover-dropdown": {
|
|
70
|
-
"types": "./hover-dropdown/index.d.ts",
|
|
71
|
-
"default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
|
|
72
|
-
},
|
|
73
|
-
"./locale": {
|
|
74
|
-
"types": "./locale/index.d.ts",
|
|
75
|
-
"default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
|
|
76
|
-
},
|
|
77
70
|
"./mat-entity-crud": {
|
|
78
71
|
"types": "./mat-entity-crud/index.d.ts",
|
|
79
72
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs"
|
|
80
73
|
},
|
|
81
|
-
"./mat-entity-list": {
|
|
82
|
-
"types": "./mat-entity-list/index.d.ts",
|
|
83
|
-
"default": "./fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs"
|
|
84
|
-
},
|
|
85
74
|
"./mat-file-input": {
|
|
86
75
|
"types": "./mat-file-input/index.d.ts",
|
|
87
76
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-file-input.mjs"
|
|
88
77
|
},
|
|
78
|
+
"./mat-entity-list": {
|
|
79
|
+
"types": "./mat-entity-list/index.d.ts",
|
|
80
|
+
"default": "./fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs"
|
|
81
|
+
},
|
|
89
82
|
"./mat-form-error": {
|
|
90
83
|
"types": "./mat-form-error/index.d.ts",
|
|
91
84
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-form-error.mjs"
|