@smallpearl/ngx-helper 0.33.50 → 20.0.3

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.
Files changed (119) hide show
  1. package/core/index.d.ts +3 -1
  2. package/entities/index.d.ts +313 -2
  3. package/entity-field/index.d.ts +101 -2
  4. package/fesm2022/smallpearl-ngx-helper-entities.mjs +18 -18
  5. package/fesm2022/smallpearl-ngx-helper-entities.mjs.map +1 -1
  6. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +5 -4
  7. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -1
  8. package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -1
  9. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +6 -6
  10. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -1
  11. package/fesm2022/smallpearl-ngx-helper-locale.mjs +6 -6
  12. package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -1
  13. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +57 -31
  14. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -1
  15. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +15 -15
  16. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -1
  17. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +346 -334
  18. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
  19. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +152 -146
  20. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
  21. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +5 -5
  22. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -1
  23. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +19 -19
  24. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -1
  25. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +25 -26
  26. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -1
  27. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs +7 -7
  28. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs.map +1 -1
  29. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +24 -24
  30. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -1
  31. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +8 -9
  32. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -1
  33. package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -1
  34. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +35 -35
  35. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -1
  36. package/forms/index.d.ts +55 -1
  37. package/hover-dropdown/index.d.ts +44 -1
  38. package/index.d.ts +4 -5
  39. package/locale/index.d.ts +55 -5
  40. package/mat-busy-wheel/index.d.ts +165 -4
  41. package/mat-context-menu/index.d.ts +65 -1
  42. package/mat-entity-crud/index.d.ts +1075 -6
  43. package/mat-entity-list/index.d.ts +394 -3
  44. package/mat-file-input/index.d.ts +61 -1
  45. package/mat-form-error/index.d.ts +184 -6
  46. package/mat-select-entity/index.d.ts +194 -1
  47. package/mat-select-infinite-scroll/index.d.ts +45 -2
  48. package/mat-side-menu-layout/index.d.ts +180 -6
  49. package/mat-tel-input/index.d.ts +169 -2
  50. package/package.json +18 -13
  51. package/sideload/index.d.ts +20 -1
  52. package/stationary-with-line-items/index.d.ts +78 -1
  53. package/core/src/version.d.ts +0 -1
  54. package/entities/src/paged-loader.d.ts +0 -219
  55. package/entities/src/paginator.d.ts +0 -87
  56. package/entity-field/src/entity-field.d.ts +0 -70
  57. package/entity-field/src/provider.d.ts +0 -27
  58. package/forms/src/validation-error-handler.d.ts +0 -52
  59. package/hover-dropdown/src/hover-dropdown.directive.d.ts +0 -41
  60. package/locale/src/currency.pipe.d.ts +0 -14
  61. package/locale/src/date.pipe.d.ts +0 -14
  62. package/locale/src/format-currency.d.ts +0 -1
  63. package/locale/src/format-date.d.ts +0 -2
  64. package/locale/src/is-empty.d.ts +0 -1
  65. package/locale/src/providers.d.ts +0 -20
  66. package/mat-busy-wheel/src/busy-wheel-op.d.ts +0 -65
  67. package/mat-busy-wheel/src/busy-wheel.component.d.ts +0 -12
  68. package/mat-busy-wheel/src/busy-wheel.service.d.ts +0 -42
  69. package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +0 -35
  70. package/mat-context-menu/src/mat-context-menu.component.d.ts +0 -61
  71. package/mat-entity-crud/src/convert-context-input-to-http-context.d.ts +0 -11
  72. package/mat-entity-crud/src/default-config.d.ts +0 -9
  73. package/mat-entity-crud/src/form-view-host.component.d.ts +0 -41
  74. package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +0 -277
  75. package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +0 -131
  76. package/mat-entity-crud/src/mat-entity-crud-item-action.d.ts +0 -68
  77. package/mat-entity-crud/src/mat-entity-crud-types.d.ts +0 -149
  78. package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -366
  79. package/mat-entity-crud/src/preview-host.component.d.ts +0 -21
  80. package/mat-entity-crud/src/preview-pane.component.d.ts +0 -31
  81. package/mat-entity-crud/src/providers.d.ts +0 -3
  82. package/mat-entity-list/src/config.d.ts +0 -6
  83. package/mat-entity-list/src/mat-entity-list-types.d.ts +0 -128
  84. package/mat-entity-list/src/mat-entity-list.component.d.ts +0 -259
  85. package/mat-entity-list/src/providers.d.ts +0 -3
  86. package/mat-file-input/src/mat-file-input.component.d.ts +0 -58
  87. package/mat-form-error/src/locales/en.d.ts +0 -4
  88. package/mat-form-error/src/locales/hu.d.ts +0 -4
  89. package/mat-form-error/src/locales/index.d.ts +0 -5
  90. package/mat-form-error/src/locales/pt-br.d.ts +0 -4
  91. package/mat-form-error/src/locales/zh-hans.d.ts +0 -4
  92. package/mat-form-error/src/locales/zh-hant.d.ts +0 -4
  93. package/mat-form-error/src/ngx-error-list.component.d.ts +0 -9
  94. package/mat-form-error/src/ngx-mat-error-control.d.ts +0 -17
  95. package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +0 -30
  96. package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +0 -8
  97. package/mat-form-error/src/ngx-mat-errors.component.d.ts +0 -44
  98. package/mat-form-error/src/types.d.ts +0 -68
  99. package/mat-form-error/src/utils/coerce-to-observable.d.ts +0 -3
  100. package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +0 -2
  101. package/mat-form-error/src/utils/find-error-for-control.d.ts +0 -9
  102. package/mat-form-error/src/utils/get-abstract-controls.d.ts +0 -3
  103. package/mat-form-error/src/utils/get-control-with-error.d.ts +0 -3
  104. package/mat-select-entity/src/mat-select-entity.component.d.ts +0 -190
  105. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.directive.d.ts +0 -19
  106. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.service.d.ts +0 -25
  107. package/mat-side-menu-layout/src/layout.service.d.ts +0 -23
  108. package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +0 -39
  109. package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +0 -18
  110. package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +0 -36
  111. package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +0 -66
  112. package/mat-side-menu-layout/src/nav-item.d.ts +0 -10
  113. package/mat-tel-input/src/country-codes.d.ts +0 -5
  114. package/mat-tel-input/src/mat-telephone.component.d.ts +0 -129
  115. package/mat-tel-input/src/providers.d.ts +0 -38
  116. package/ngx-helper.d.ts +0 -2
  117. package/public-api.d.ts +0 -1
  118. package/sideload/src/sideload.d.ts +0 -18
  119. package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +0 -74
@@ -1,38 +1,40 @@
1
- import * as i1 from '@angular/common/http';
2
- import { HttpContext, HttpClient, HttpParams, HttpContextToken } from '@angular/common/http';
3
1
  import * as i0 from '@angular/core';
4
- import { input, signal, computed, inject, ChangeDetectorRef, Component, InjectionToken, viewChild, ViewContainerRef, ChangeDetectionStrategy, viewChildren, EventEmitter, effect, ContentChildren, Output } from '@angular/core';
2
+ import { InjectionToken, input, signal, computed, inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, viewChild, ViewContainerRef, viewChildren, EventEmitter, effect, Output, ContentChildren } from '@angular/core';
3
+ import * as i1$1 from '@angular/common/http';
4
+ import { HttpContext, HttpContextToken, HttpClient, HttpParams } from '@angular/common/http';
5
5
  import { FormArray } from '@angular/forms';
6
- import * as i4$1 from '@jsverse/transloco';
6
+ import * as i3$1 from '@jsverse/transloco';
7
7
  import { TranslocoService, TranslocoModule, provideTranslocoScope } from '@jsverse/transloco';
8
8
  import { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';
9
9
  import { Subscription, map, tap, Observable, of, switchMap, firstValueFrom, catchError, EMPTY, throwError } from 'rxjs';
10
10
  import { sideloadToComposite } from '@smallpearl/ngx-helper/sideload';
11
- import * as i4 from '@angular/common';
12
- import { CommonModule } from '@angular/common';
13
11
  import * as i2 from '@angular/material/button';
14
12
  import { MatButtonModule } from '@angular/material/button';
13
+ import * as i3 from '@angular/material/icon';
14
+ import { MatIconModule } from '@angular/material/icon';
15
+ import * as i1 from '@angular/material/toolbar';
16
+ import { MatToolbarModule } from '@angular/material/toolbar';
17
+ import * as i4 from '@angular/common';
18
+ import { CommonModule } from '@angular/common';
19
+ import * as i8 from '@angular/material/menu';
20
+ import { MatMenuModule } from '@angular/material/menu';
15
21
  import * as i2$1 from '@angular/material/snack-bar';
16
22
  import { MatSnackBarModule } from '@angular/material/snack-bar';
17
23
  import { MatSortModule } from '@angular/material/sort';
18
24
  import * as i7 from '@angular/material/table';
19
25
  import { MatColumnDef, MatTableModule } from '@angular/material/table';
26
+ import * as i3$2 from '@angular/platform-browser';
20
27
  import * as i5 from '@angular/router';
21
28
  import { RouterModule } from '@angular/router';
22
29
  import { SPMatHostBusyWheelDirective, showBusyWheelUntilComplete } from '@smallpearl/ngx-helper/mat-busy-wheel';
23
30
  import { SPMatContextMenuComponent } from '@smallpearl/ngx-helper/mat-context-menu';
24
31
  import { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';
25
- import * as i3 from '@angular/material/icon';
26
- import { MatIconModule } from '@angular/material/icon';
27
- import * as i8 from '@angular/material/menu';
28
- import { MatMenuModule } from '@angular/material/menu';
29
- import * as i3$1 from '@angular/platform-browser';
30
32
  import * as i11 from 'angular-split';
31
33
  import { AngularSplitModule } from 'angular-split';
32
34
  import { startCase, clone } from 'lodash';
33
35
  import { plural } from 'pluralize';
34
- import * as i1$1 from '@angular/material/toolbar';
35
- import { MatToolbarModule } from '@angular/material/toolbar';
36
+
37
+ const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken('SPMatEntityCrudConfig');
36
38
 
37
39
  /**
38
40
  * Converts array of HttpContextToken key, value pairs to HttpContext
@@ -59,6 +61,13 @@ function convertHttpContextInputToHttpContext(context, reqContext) {
59
61
  return context;
60
62
  }
61
63
 
64
+ const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT = new HttpContextToken(() => ({
65
+ entityName: '',
66
+ entityNamePlural: '',
67
+ endpoint: '',
68
+ op: undefined,
69
+ }));
70
+
62
71
  /**
63
72
  * This is a convenience base class that clients can derive from to implement
64
73
  * their CRUD form component. Particularly this class registers the change
@@ -185,37 +194,37 @@ function convertHttpContextInputToHttpContext(context, reqContext) {
185
194
  */
186
195
  class SPMatEntityCrudFormBase {
187
196
  // bridge mode inputs
188
- entity = input();
189
- bridge = input();
190
- params = input();
197
+ entity = input(...(ngDevMode ? [undefined, { debugName: "entity" }] : []));
198
+ bridge = input(...(ngDevMode ? [undefined, { debugName: "bridge" }] : []));
199
+ params = input(...(ngDevMode ? [undefined, { debugName: "params" }] : []));
191
200
  // END bridge mode inputs
192
201
  // standalone mode inputs
193
202
  // Entity name, which is used to parse sideloaded entity responses
194
- entityName = input();
203
+ entityName = input(...(ngDevMode ? [undefined, { debugName: "entityName" }] : []));
195
204
  // Base CRUD URL, which is the GET-list-of-entities/POST-to-create
196
205
  // URL. Update URL will be derived from this ias `baseUrl()/${TEntity[IdKey]}`
197
- baseUrl = input();
206
+ baseUrl = input(...(ngDevMode ? [undefined, { debugName: "baseUrl" }] : []));
198
207
  // Additional request context to be passed to the request
199
- httpReqContext = input();
208
+ httpReqContext = input(...(ngDevMode ? [undefined, { debugName: "httpReqContext" }] : []));
200
209
  // ID key, defaults to 'id'
201
- idKey = input('id');
210
+ idKey = input('id', ...(ngDevMode ? [{ debugName: "idKey" }] : []));
202
211
  // END standalone mode inputs
203
212
  // IMPLEMENTATION
204
213
  loadEntity$;
205
214
  // This will hold the raw response returned by load() method
206
- loadResponse = signal(undefined);
215
+ loadResponse = signal(undefined, ...(ngDevMode ? [{ debugName: "loadResponse" }] : []));
207
216
  // This will hold the loaded entity after it's extracted from the
208
217
  // load response.
209
- _entity = signal(undefined);
218
+ _entity = signal(undefined, ...(ngDevMode ? [{ debugName: "_entity" }] : []));
210
219
  sub$ = new Subscription();
211
220
  // Store for internal form signal. form() is computed from this.
212
- _form = signal(undefined);
221
+ _form = signal(undefined, ...(ngDevMode ? [{ debugName: "_form" }] : []));
213
222
  // Force typecast to TFormGroup so that we can use it in the template
214
223
  // without having to use the non-nullable operator ! with every reference
215
224
  // of form(). In any case the form() signal is always set in ngOnInit()
216
225
  // method after the form is created. And if form() is not set, then there
217
226
  // will be errors while loading the form in the template.
218
- form = computed(() => this._form());
227
+ form = computed(() => this._form(), ...(ngDevMode ? [{ debugName: "form" }] : []));
219
228
  transloco = inject(TranslocoService);
220
229
  cdr = inject(ChangeDetectorRef);
221
230
  http = inject(HttpClient);
@@ -502,26 +511,151 @@ class SPMatEntityCrudFormBase {
502
511
  }
503
512
  return context;
504
513
  }
505
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudFormBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
506
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.6", type: SPMatEntityCrudFormBase, isStandalone: false, selector: "_#_sp-mat-entity-crud-form-base_#_", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: false, transformFunction: null }, bridge: { classPropertyName: "bridge", publicName: "bridge", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, entityName: { classPropertyName: "entityName", publicName: "entityName", isSignal: true, isRequired: false, transformFunction: null }, baseUrl: { classPropertyName: "baseUrl", publicName: "baseUrl", isSignal: true, isRequired: false, transformFunction: null }, httpReqContext: { classPropertyName: "httpReqContext", publicName: "httpReqContext", isSignal: true, isRequired: false, transformFunction: null }, idKey: { classPropertyName: "idKey", publicName: "idKey", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ``, isInline: true });
514
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudFormBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
515
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", type: SPMatEntityCrudFormBase, isStandalone: false, selector: "_#_sp-mat-entity-crud-form-base_#_", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: false, transformFunction: null }, bridge: { classPropertyName: "bridge", publicName: "bridge", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, entityName: { classPropertyName: "entityName", publicName: "entityName", isSignal: true, isRequired: false, transformFunction: null }, baseUrl: { classPropertyName: "baseUrl", publicName: "baseUrl", isSignal: true, isRequired: false, transformFunction: null }, httpReqContext: { classPropertyName: "httpReqContext", publicName: "httpReqContext", isSignal: true, isRequired: false, transformFunction: null }, idKey: { classPropertyName: "idKey", publicName: "idKey", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ``, isInline: true });
507
516
  }
508
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudFormBase, decorators: [{
517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudFormBase, decorators: [{
509
518
  type: Component,
510
519
  args: [{
511
520
  selector: '_#_sp-mat-entity-crud-form-base_#_',
512
521
  template: ``,
513
522
  standalone: false,
514
523
  }]
515
- }] });
524
+ }], propDecorators: { entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: false }] }], bridge: [{ type: i0.Input, args: [{ isSignal: true, alias: "bridge", required: false }] }], params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: false }] }], entityName: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityName", required: false }] }], baseUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseUrl", required: false }] }], httpReqContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "httpReqContext", required: false }] }], idKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "idKey", required: false }] }] } });
516
525
 
517
- const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT = new HttpContextToken(() => ({
518
- entityName: '',
519
- entityNamePlural: '',
520
- endpoint: '',
521
- op: undefined,
522
- }));
526
+ const ITEM_ACTION_UPDATE = '_update_';
527
+ const ITEM_ACTION_DELETE = '_delete_';
523
528
 
524
- const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken('SPMatEntityCrudConfig');
529
+ /**
530
+ * A preview pane container to provide a consistent UX for all preview panes.
531
+ * It consits of a toolbar on the top and a container div below that takes up
532
+ * the rest of the preview pane area.
533
+ */
534
+ class SPMatEntityCrudPreviewPaneComponent {
535
+ entity = input.required(...(ngDevMode ? [{ debugName: "entity" }] : []));
536
+ entityCrudComponent = input.required(...(ngDevMode ? [{ debugName: "entityCrudComponent" }] : []));
537
+ title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
538
+ disableUpdate = input(false, ...(ngDevMode ? [{ debugName: "disableUpdate" }] : []));
539
+ hideUpdate = input(false, ...(ngDevMode ? [{ debugName: "hideUpdate" }] : []));
540
+ disableDelete = input(false, ...(ngDevMode ? [{ debugName: "disableDelete" }] : []));
541
+ hideDelete = input(false, ...(ngDevMode ? [{ debugName: "hideDelete" }] : []));
542
+ itemActions;
543
+ _disableActionFactory = (role, signal) => {
544
+ return computed(() => {
545
+ if (signal && signal()) {
546
+ return true;
547
+ }
548
+ const actionFn = this.itemActions.find((a) => a.role === role)?.disable;
549
+ if (actionFn && actionFn(this.entity())) {
550
+ return true;
551
+ }
552
+ return false;
553
+ });
554
+ };
555
+ _disableUpdate = this._disableActionFactory(ITEM_ACTION_UPDATE, this.disableUpdate);
556
+ _disableDelete = this._disableActionFactory(ITEM_ACTION_DELETE, this.disableDelete);
557
+ ngOnInit() {
558
+ this.itemActions = this.entityCrudComponent().getItemActions();
559
+ }
560
+ ngOnDestroy() { }
561
+ onEdit() {
562
+ this.entityCrudComponent().triggerEntityUpdate(this.entity());
563
+ }
564
+ onDelete() {
565
+ this.entityCrudComponent().triggerEntityDelete(this.entity());
566
+ }
567
+ onClose() {
568
+ this.entityCrudComponent().closePreview();
569
+ }
570
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudPreviewPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
571
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SPMatEntityCrudPreviewPaneComponent, isStandalone: true, selector: "sp-mat-entity-crud-preview-pane", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, entityCrudComponent: { classPropertyName: "entityCrudComponent", publicName: "entityCrudComponent", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, disableUpdate: { classPropertyName: "disableUpdate", publicName: "disableUpdate", isSignal: true, isRequired: false, transformFunction: null }, hideUpdate: { classPropertyName: "hideUpdate", publicName: "hideUpdate", isSignal: true, isRequired: false, transformFunction: null }, disableDelete: { classPropertyName: "disableDelete", publicName: "disableDelete", isSignal: true, isRequired: false, transformFunction: null }, hideDelete: { classPropertyName: "hideDelete", publicName: "hideDelete", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
572
+ <div class="preview-wrapper">
573
+ <mat-toolbar>
574
+ <mat-toolbar-row>
575
+ @if (title()) {
576
+ <h2>{{ title() }}</h2>
577
+ &nbsp; } @if (!hideUpdate()) {
578
+ <button
579
+ mat-icon-button
580
+ aria-label="Edit"
581
+ (click)="onEdit()"
582
+ [disabled]="_disableUpdate()"
583
+ >
584
+ <mat-icon>edit</mat-icon>
585
+ </button>
586
+ } @if (!hideDelete()) {
587
+ <button
588
+ mat-icon-button
589
+ aria-label="Delete"
590
+ (click)="onDelete()"
591
+ [disabled]="_disableDelete()"
592
+ >
593
+ <mat-icon>delete</mat-icon>
594
+ </button>
595
+ }
596
+ <ng-content select="[previewToolbarContent]"></ng-content>
597
+ <span class="spacer"></span>
598
+ <button mat-icon-button aria-label="Close" (click)="onClose()">
599
+ <mat-icon>close</mat-icon>
600
+ </button>
601
+ </mat-toolbar-row>
602
+ </mat-toolbar>
603
+ <div
604
+ [class]="
605
+ 'preview-content ' +
606
+ entityCrudComponent().getPreviewPaneContentClass()
607
+ "
608
+ >
609
+ <ng-content select="[previewContent]"></ng-content>
610
+ </div>
611
+ </div>
612
+ `, isInline: true, styles: [".preview-wrapper{display:flex;flex-direction:column;height:100%!important;width:100%!important}mat-toolbar{background-color:var(--mat-sys-surface-variant)}.spacer{flex:1 1 auto}.preview-content{padding:.4em;flex-grow:1;overflow:scroll}\n"], dependencies: [{ kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i1.MatToolbarRow, selector: "mat-toolbar-row", exportAs: ["matToolbarRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
613
+ }
614
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudPreviewPaneComponent, decorators: [{
615
+ type: Component,
616
+ args: [{ imports: [MatToolbarModule, MatButtonModule, MatIconModule], selector: 'sp-mat-entity-crud-preview-pane', template: `
617
+ <div class="preview-wrapper">
618
+ <mat-toolbar>
619
+ <mat-toolbar-row>
620
+ @if (title()) {
621
+ <h2>{{ title() }}</h2>
622
+ &nbsp; } @if (!hideUpdate()) {
623
+ <button
624
+ mat-icon-button
625
+ aria-label="Edit"
626
+ (click)="onEdit()"
627
+ [disabled]="_disableUpdate()"
628
+ >
629
+ <mat-icon>edit</mat-icon>
630
+ </button>
631
+ } @if (!hideDelete()) {
632
+ <button
633
+ mat-icon-button
634
+ aria-label="Delete"
635
+ (click)="onDelete()"
636
+ [disabled]="_disableDelete()"
637
+ >
638
+ <mat-icon>delete</mat-icon>
639
+ </button>
640
+ }
641
+ <ng-content select="[previewToolbarContent]"></ng-content>
642
+ <span class="spacer"></span>
643
+ <button mat-icon-button aria-label="Close" (click)="onClose()">
644
+ <mat-icon>close</mat-icon>
645
+ </button>
646
+ </mat-toolbar-row>
647
+ </mat-toolbar>
648
+ <div
649
+ [class]="
650
+ 'preview-content ' +
651
+ entityCrudComponent().getPreviewPaneContentClass()
652
+ "
653
+ >
654
+ <ng-content select="[previewContent]"></ng-content>
655
+ </div>
656
+ </div>
657
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".preview-wrapper{display:flex;flex-direction:column;height:100%!important;width:100%!important}mat-toolbar{background-color:var(--mat-sys-surface-variant)}.spacer{flex:1 1 auto}.preview-content{padding:.4em;flex-grow:1;overflow:scroll}\n"] }]
658
+ }], propDecorators: { entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: true }] }], entityCrudComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityCrudComponent", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], disableUpdate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableUpdate", required: false }] }], hideUpdate: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideUpdate", required: false }] }], disableDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableDelete", required: false }] }], hideDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideDelete", required: false }] }] } });
525
659
 
526
660
  function defaultCrudResponseParser(entityName, idKey, method, // 'create' | 'retrieve' | 'update' | 'delete',
527
661
  resp) {
@@ -561,21 +695,21 @@ function getEntityCrudConfig() {
561
695
  }
562
696
 
563
697
  class FormViewHostComponent {
564
- entityCrudComponentBase = input.required();
565
- clientViewTemplate = input(null);
698
+ entityCrudComponentBase = input.required(...(ngDevMode ? [{ debugName: "entityCrudComponentBase" }] : []));
699
+ clientViewTemplate = input(null, ...(ngDevMode ? [{ debugName: "clientViewTemplate" }] : []));
566
700
  _itemLabel = computed(() => {
567
701
  const label = this.entityCrudComponentBase().getItemLabel();
568
702
  return label instanceof Observable ? label : of(label);
569
- });
703
+ }, ...(ngDevMode ? [{ debugName: "_itemLabel" }] : []));
570
704
  _itemLabelPlural = computed(() => {
571
705
  const label = this.entityCrudComponentBase().getItemLabelPlural();
572
706
  return label instanceof Observable ? label : of(label);
573
- });
574
- entity = signal(undefined);
575
- title = signal(undefined);
576
- params = signal(undefined);
707
+ }, ...(ngDevMode ? [{ debugName: "_itemLabelPlural" }] : []));
708
+ entity = signal(undefined, ...(ngDevMode ? [{ debugName: "entity" }] : []));
709
+ title = signal(undefined, ...(ngDevMode ? [{ debugName: "title" }] : []));
710
+ params = signal(undefined, ...(ngDevMode ? [{ debugName: "params" }] : []));
577
711
  clientFormView;
578
- vc = viewChild('clientFormContainer', { read: ViewContainerRef });
712
+ vc = viewChild('clientFormContainer', ...(ngDevMode ? [{ debugName: "vc", read: ViewContainerRef }] : [{ read: ViewContainerRef }]));
579
713
  config;
580
714
  sub$ = new Subscription();
581
715
  transloco = inject(TranslocoService);
@@ -676,8 +810,8 @@ class FormViewHostComponent {
676
810
  this.destroyClientView();
677
811
  }
678
812
  }
679
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: FormViewHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
680
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: FormViewHostComponent, isStandalone: true, selector: "sp-create-edit-entity-host", inputs: { entityCrudComponentBase: { classPropertyName: "entityCrudComponentBase", publicName: "entityCrudComponentBase", isSignal: true, isRequired: true, transformFunction: null }, clientViewTemplate: { classPropertyName: "clientViewTemplate", publicName: "clientViewTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["clientFormContainer"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: `
813
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FormViewHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
814
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: FormViewHostComponent, isStandalone: true, selector: "sp-create-edit-entity-host", inputs: { entityCrudComponentBase: { classPropertyName: "entityCrudComponentBase", publicName: "entityCrudComponentBase", isSignal: true, isRequired: true, transformFunction: null }, clientViewTemplate: { classPropertyName: "clientViewTemplate", publicName: "clientViewTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["clientFormContainer"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: `
681
815
  <div
682
816
  [class]="
683
817
  'sp-mat-crud-form-wrapper ' +
@@ -716,9 +850,9 @@ class FormViewHostComponent {
716
850
  </div>
717
851
  </div>
718
852
  </div>
719
- `, isInline: true, styles: [".sp-mat-crud-form-wrapper{width:100%!important;height:100%!important}.sp-mat-crud-form-content{height:100%;width:100%;display:flex;flex-direction:column;padding:.4em}.create-edit-topbar{display:flex;flex-direction:row;align-items:center;min-height:48px;padding:.4em}.form-container{padding-top:.4em;flex-grow:1;overflow:auto}.create-edit-topbar .title{font-size:1.5em;font-weight:500}.create-edit-topbar .spacer{flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i4$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: SPMatHostBusyWheelDirective, selector: "[spHostBusyWheel]", inputs: ["spHostBusyWheel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
853
+ `, isInline: true, styles: [".sp-mat-crud-form-wrapper{width:100%!important;height:100%!important}.sp-mat-crud-form-content{height:100%;width:100%;display:flex;flex-direction:column;padding:.4em}.create-edit-topbar{display:flex;flex-direction:row;align-items:center;min-height:48px;padding:.4em}.form-container{padding-top:.4em;flex-grow:1;overflow:auto}.create-edit-topbar .title{font-size:1.5em;font-weight:500}.create-edit-topbar .spacer{flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: SPMatHostBusyWheelDirective, selector: "[spHostBusyWheel]", inputs: ["spHostBusyWheel"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
720
854
  }
721
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: FormViewHostComponent, decorators: [{
855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FormViewHostComponent, decorators: [{
722
856
  type: Component,
723
857
  args: [{ imports: [
724
858
  CommonModule,
@@ -766,13 +900,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
766
900
  </div>
767
901
  </div>
768
902
  `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".sp-mat-crud-form-wrapper{width:100%!important;height:100%!important}.sp-mat-crud-form-content{height:100%;width:100%;display:flex;flex-direction:column;padding:.4em}.create-edit-topbar{display:flex;flex-direction:row;align-items:center;min-height:48px;padding:.4em}.form-container{padding-top:.4em;flex-grow:1;overflow:auto}.create-edit-topbar .title{font-size:1.5em;font-weight:500}.create-edit-topbar .spacer{flex-grow:1}\n"] }]
769
- }], ctorParameters: () => [] });
903
+ }], ctorParameters: () => [], propDecorators: { entityCrudComponentBase: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityCrudComponentBase", required: true }] }], clientViewTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "clientViewTemplate", required: false }] }], vc: [{ type: i0.ViewChild, args: ['clientFormContainer', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
770
904
 
771
905
  class PreviewHostComponent {
772
- vc = viewChild('previewComponent', { read: ViewContainerRef });
773
- entityCrudComponentBase = input.required();
774
- clientViewTemplate = input(null);
775
- entity = signal(undefined);
906
+ vc = viewChild('previewComponent', ...(ngDevMode ? [{ debugName: "vc", read: ViewContainerRef }] : [{ read: ViewContainerRef }]));
907
+ entityCrudComponentBase = input.required(...(ngDevMode ? [{ debugName: "entityCrudComponentBase" }] : []));
908
+ clientViewTemplate = input(null, ...(ngDevMode ? [{ debugName: "clientViewTemplate" }] : []));
909
+ entity = signal(undefined, ...(ngDevMode ? [{ debugName: "entity" }] : []));
776
910
  clientView;
777
911
  constructor() {
778
912
  // effect(() => {
@@ -823,10 +957,10 @@ class PreviewHostComponent {
823
957
  this.clientView = null;
824
958
  }
825
959
  }
826
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: PreviewHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
827
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.6", type: PreviewHostComponent, isStandalone: true, selector: "sp-entity-crud-preview-host", inputs: { entityCrudComponentBase: { classPropertyName: "entityCrudComponentBase", publicName: "entityCrudComponentBase", isSignal: true, isRequired: true, transformFunction: null }, clientViewTemplate: { classPropertyName: "clientViewTemplate", publicName: "clientViewTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["previewComponent"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: ` <ng-container #previewComponent></ng-container> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
960
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PreviewHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
961
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.16", type: PreviewHostComponent, isStandalone: true, selector: "sp-entity-crud-preview-host", inputs: { entityCrudComponentBase: { classPropertyName: "entityCrudComponentBase", publicName: "entityCrudComponentBase", isSignal: true, isRequired: true, transformFunction: null }, clientViewTemplate: { classPropertyName: "clientViewTemplate", publicName: "clientViewTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["previewComponent"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: ` <ng-container #previewComponent></ng-container> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
828
962
  }
829
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: PreviewHostComponent, decorators: [{
963
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PreviewHostComponent, decorators: [{
830
964
  type: Component,
831
965
  args: [{
832
966
  imports: [],
@@ -834,59 +968,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
834
968
  template: ` <ng-container #previewComponent></ng-container> `,
835
969
  changeDetection: ChangeDetectionStrategy.OnPush
836
970
  }]
837
- }], ctorParameters: () => [] });
971
+ }], ctorParameters: () => [], propDecorators: { vc: [{ type: i0.ViewChild, args: ['previewComponent', { ...{ read: ViewContainerRef }, isSignal: true }] }], entityCrudComponentBase: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityCrudComponentBase", required: true }] }], clientViewTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "clientViewTemplate", required: false }] }] } });
838
972
 
839
973
  class SPMatEntityCrudComponent extends SPMatEntityListComponent {
840
974
  snackBar;
841
975
  // entityName = input.required<string>();
842
976
  // entityNamePlural = input<string>();
843
- itemLabel = input();
844
- itemLabelPlural = input();
977
+ itemLabel = input(...(ngDevMode ? [undefined, { debugName: "itemLabel" }] : []));
978
+ itemLabelPlural = input(...(ngDevMode ? [undefined, { debugName: "itemLabelPlural" }] : []));
845
979
  /**
846
980
  * Title string displayed above the component. If not specified, will use
847
981
  * itemLabelPlural() as the title.
848
982
  */
849
- title = input();
983
+ title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
850
984
  /**
851
985
  *
852
986
  */
853
- itemActions = input([]);
987
+ itemActions = input([], ...(ngDevMode ? [{ debugName: "itemActions" }] : []));
854
988
  /**
855
989
  * Specify the list of router paths that will be set as the value for
856
990
  * [routerLink] for the 'New {{ item }}' button. If not specified,
857
991
  * if createEditTemplate is specified, it will be shown. If not, `action`
858
992
  * out event will be raised with `{ role: '_new_' }`.
859
993
  */
860
- newItemLink = input();
994
+ newItemLink = input(...(ngDevMode ? [undefined, { debugName: "newItemLink" }] : []));
861
995
  /**
862
996
  * If not specified, will default to 'New <itemLabel()>'.
863
997
  */
864
- newItemLabel = input();
998
+ newItemLabel = input(...(ngDevMode ? [undefined, { debugName: "newItemLabel" }] : []));
865
999
  /**
866
1000
  * Text for the Edit <item> pane title
867
1001
  */
868
- editItemTitle = input();
1002
+ editItemTitle = input(...(ngDevMode ? [undefined, { debugName: "editItemTitle" }] : []));
869
1003
  /**
870
1004
  * If you want "New {{item}}" button to support multiple entity types,
871
1005
  * you can set this to `NewItemSubType[]`, where each element stands for for
872
1006
  * a dropdown menu item. Refer to `NewItemSubType` for details on this
873
1007
  * interface.
874
1008
  */
875
- newItemSubTypes = input();
1009
+ newItemSubTypes = input(...(ngDevMode ? [undefined, { debugName: "newItemSubTypes" }] : []));
876
1010
  /**
877
1011
  * If you want to take control of the network operations for the CRUD
878
1012
  * operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.
879
1013
  */
880
- crudOpFn = input();
1014
+ crudOpFn = input(...(ngDevMode ? [undefined, { debugName: "crudOpFn" }] : []));
881
1015
  /**
882
1016
  * Item preview template.
883
1017
  */
884
- previewTemplate = input();
1018
+ previewTemplate = input(...(ngDevMode ? [undefined, { debugName: "previewTemplate" }] : []));
885
1019
  /**
886
1020
  * Whether to allow a context menu action or not. Return false to disable
887
1021
  * the action.
888
1022
  */
889
- allowEntityActionFn = input();
1023
+ allowEntityActionFn = input(...(ngDevMode ? [undefined, { debugName: "allowEntityActionFn" }] : []));
890
1024
  /**
891
1025
  * A template that allows the header to be replaced. Usage:-
892
1026
  *
@@ -897,7 +1031,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
897
1031
  * <ng-template #myCrudViewHeader>...</ng-template>
898
1032
  * ```
899
1033
  */
900
- headerTemplate = input();
1034
+ headerTemplate = input(...(ngDevMode ? [undefined, { debugName: "headerTemplate" }] : []));
901
1035
  /**
902
1036
  * Set this to the custom template identifier that will replace the
903
1037
  * "New {{Item}}" button portion. This template will expand towards the
@@ -910,13 +1044,13 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
910
1044
  * <ng-template #myCrudActions>...</ng-template>
911
1045
  * ```
912
1046
  */
913
- actionsTemplate = input();
1047
+ actionsTemplate = input(...(ngDevMode ? [undefined, { debugName: "actionsTemplate" }] : []));
914
1048
  /**
915
1049
  * CRUD action response parser. This will be called with the response
916
1050
  * from CREATE & UPDATE operations to parse the response JSON and return
917
1051
  * the created/updated TEntity.
918
1052
  */
919
- crudResponseParser = input();
1053
+ crudResponseParser = input(...(ngDevMode ? [undefined, { debugName: "crudResponseParser" }] : []));
920
1054
  /**
921
1055
  * An ng-template name that contains the component which provides the
922
1056
  * create/edit CRUD action.
@@ -932,16 +1066,16 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
932
1066
  * (app-create-edit-entity-demo here is the client code that implements the
933
1067
  * Create/Edit form)
934
1068
  */
935
- createEditFormTemplate = input(null);
1069
+ createEditFormTemplate = input(null, ...(ngDevMode ? [{ debugName: "createEditFormTemplate" }] : []));
936
1070
  /**
937
1071
  * Disables the per item actions column, preventing 'Edit' & 'Delete'
938
1072
  * (and other user defined) item operations.
939
1073
  */
940
- disableItemActions = input(false);
1074
+ disableItemActions = input(false, ...(ngDevMode ? [{ debugName: "disableItemActions" }] : []));
941
1075
  /**
942
1076
  * Disables the Create function.
943
1077
  */
944
- disableCreate = input(false);
1078
+ disableCreate = input(false, ...(ngDevMode ? [{ debugName: "disableCreate" }] : []));
945
1079
  /**
946
1080
  * View refresh policy after a CREATE/UPDATE operation. Values
947
1081
  * 'none' - Objects are not refreshed after an edit operation. The return
@@ -955,7 +1089,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
955
1089
  * mimics the behaviour of legacy HTML apps with pure server
956
1090
  * defined UI.
957
1091
  */
958
- refreshAfterEdit = input('none');
1092
+ refreshAfterEdit = input('none', ...(ngDevMode ? [{ debugName: "refreshAfterEdit" }] : []));
959
1093
  /**
960
1094
  * HttpContext for crud requests - `create`, `retrieve`, `update` & `delete`.
961
1095
  * Note that HttpContext for `list` operation should be set using the
@@ -968,19 +1102,19 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
968
1102
  * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`,
969
1103
  * in which case the same context would be used for all HTTP requests.
970
1104
  */
971
- crudHttpReqContext = input();
1105
+ crudHttpReqContext = input(...(ngDevMode ? [undefined, { debugName: "crudHttpReqContext" }] : []));
972
1106
  /**
973
1107
  * Width of the edit pane as a percentange of the overall <as-split> width.
974
1108
  */
975
- editPaneWidth = input(100);
1109
+ editPaneWidth = input(100, ...(ngDevMode ? [{ debugName: "editPaneWidth" }] : []));
976
1110
  /**
977
1111
  * Width of the preview pane as a percentange of the overall <as-split> width.
978
1112
  */
979
- previewPaneWidth = input(50);
1113
+ previewPaneWidth = input(50, ...(ngDevMode ? [{ debugName: "previewPaneWidth" }] : []));
980
1114
  /**
981
1115
  * The class class that will be applied to the list pane wrapper.
982
1116
  */
983
- listPaneWrapperClass = input('sp-mat-crud-list-pane-wrapper-class');
1117
+ listPaneWrapperClass = input('sp-mat-crud-list-pane-wrapper-class', ...(ngDevMode ? [{ debugName: "listPaneWrapperClass" }] : []));
984
1118
  /**
985
1119
  * The class class that will be applied to the preview pane wrapper.
986
1120
  * Inside this wrapper, another div element with class='previewPaneContentClass()'
@@ -999,11 +1133,11 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
999
1133
  * | +------------------------------------+ |
1000
1134
  * +----------------------------------------+
1001
1135
  */
1002
- previewPaneWrapperClass = input('sp-mat-crud-entity-pane-wrapper-class');
1136
+ previewPaneWrapperClass = input('sp-mat-crud-entity-pane-wrapper-class', ...(ngDevMode ? [{ debugName: "previewPaneWrapperClass" }] : []));
1003
1137
  /**
1004
1138
  * The class class that will be applied to the preview pane content.
1005
1139
  */
1006
- previewPaneContentClass = input('sp-mat-crud-preview-pane-content-class');
1140
+ previewPaneContentClass = input('sp-mat-crud-preview-pane-content-class', ...(ngDevMode ? [{ debugName: "previewPaneContentClass" }] : []));
1007
1141
  /**
1008
1142
  * The class class that will be applied to the form pane wrapper. Inside this
1009
1143
  * wrapper, another div element with class='formPaneContentClass()' will be
@@ -1021,11 +1155,11 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1021
1155
  * | +------------------------------------+ |
1022
1156
  * +----------------------------------------+
1023
1157
  */
1024
- formPaneWrapperClass = input('sp-mat-crud-form-pane-wrapper-class');
1158
+ formPaneWrapperClass = input('sp-mat-crud-form-pane-wrapper-class', ...(ngDevMode ? [{ debugName: "formPaneWrapperClass" }] : []));
1025
1159
  /**
1026
1160
  * The CSS class that will be applied to the form pane content.
1027
1161
  */
1028
- formPaneContentClass = input('sp-mat-crud-form-pane-content-class');
1162
+ formPaneContentClass = input('sp-mat-crud-form-pane-content-class', ...(ngDevMode ? [{ debugName: "formPaneContentClass" }] : []));
1029
1163
  // INTERNAL PROPERTIES //
1030
1164
  // Derive a label from a camelCase source string. If the camelCase string
1031
1165
  // can be translated, it returns the translated string. If not, the function
@@ -1042,23 +1176,23 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1042
1176
  const itemLabel = this.itemLabel();
1043
1177
  const label = itemLabel ? itemLabel : this.getLabel(this.entityName());
1044
1178
  return label instanceof Observable ? label : of(label);
1045
- });
1179
+ }, ...(ngDevMode ? [{ debugName: "_itemLabel" }] : []));
1046
1180
  _itemLabelPlural = computed(() => {
1047
1181
  const itemLabelPlural = this.itemLabelPlural();
1048
1182
  const label = itemLabelPlural
1049
1183
  ? itemLabelPlural
1050
1184
  : this.getLabel(plural(this.entityName()));
1051
1185
  return label instanceof Observable ? label : of(label);
1052
- });
1186
+ }, ...(ngDevMode ? [{ debugName: "_itemLabelPlural" }] : []));
1053
1187
  // Computed title
1054
1188
  _title = computed(() => {
1055
1189
  const title = this.title() ? this.title() : this._itemLabelPlural();
1056
1190
  return title instanceof Observable ? title : of(title);
1057
- });
1191
+ }, ...(ngDevMode ? [{ debugName: "_title" }] : []));
1058
1192
  // endpoint with the QP string removed (if one was provided)
1059
- _endpointSansParams = computed(() => this.endpoint().split('?')[0]);
1060
- _endpointParams = computed(() => { });
1061
- componentColumns = viewChildren(MatColumnDef);
1193
+ _endpointSansParams = computed(() => this.endpoint().split('?')[0], ...(ngDevMode ? [{ debugName: "_endpointSansParams" }] : []));
1194
+ _endpointParams = computed(() => { }, ...(ngDevMode ? [{ debugName: "_endpointParams" }] : []));
1195
+ componentColumns = viewChildren(MatColumnDef, ...(ngDevMode ? [{ debugName: "componentColumns" }] : []));
1062
1196
  _clientColumnDefs;
1063
1197
  /**
1064
1198
  * Event raised for user selecting an item action. It's also raised
@@ -1077,7 +1211,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1077
1211
  entityViewPaneActivated = new EventEmitter();
1078
1212
  busyWheelId = `entityCrudBusyWheel-${Date.now()}`;
1079
1213
  sub$ = new Subscription();
1080
- spEntitiesList = viewChild('entitiesList');
1214
+ spEntitiesList = viewChild('entitiesList', ...(ngDevMode ? [{ debugName: "spEntitiesList" }] : []));
1081
1215
  // Theoritically, we ought to be able to initialize the mat-entities-list
1082
1216
  // columns from ngAfterViewInit lifecycle hook. But for some strange reason
1083
1217
  // when this hook is called, sp-mat-entities-list has not been initialized.
@@ -1088,33 +1222,33 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1088
1222
  if (this.spEntitiesList()) {
1089
1223
  this._initEntitiesList();
1090
1224
  }
1091
- });
1225
+ }, ...(ngDevMode ? [{ debugName: "spEntitiesListInited" }] : []));
1092
1226
  crudConfig;
1093
1227
  // This is the internal component that will host the createEditFormTemplate
1094
- createEditHostComponent = viewChild(FormViewHostComponent);
1228
+ createEditHostComponent = viewChild(FormViewHostComponent, ...(ngDevMode ? [{ debugName: "createEditHostComponent" }] : []));
1095
1229
  // A flag to toggle the viewport's contents between the mat-table
1096
1230
  // and the create/edit form template.
1097
- createEditViewActive = signal(false);
1231
+ createEditViewActive = signal(false, ...(ngDevMode ? [{ debugName: "createEditViewActive" }] : []));
1098
1232
  // Whether it's okay to cancel the edit
1099
1233
  canCancelEditCallback;
1100
1234
  // Preview host component
1101
- previewHostComponent = viewChild(PreviewHostComponent);
1102
- previewActive = computed(() => this.previewedEntity() !== undefined);
1103
- previewedEntity = signal(undefined);
1235
+ previewHostComponent = viewChild(PreviewHostComponent, ...(ngDevMode ? [{ debugName: "previewHostComponent" }] : []));
1236
+ previewActive = computed(() => this.previewedEntity() !== undefined, ...(ngDevMode ? [{ debugName: "previewActive" }] : []));
1237
+ previewedEntity = signal(undefined, ...(ngDevMode ? [{ debugName: "previewedEntity" }] : []));
1104
1238
  // Whether the pane that hosts the preview/edit-entity template is active.
1105
1239
  // We call it entityPane as it's used to either render a selected entity
1106
1240
  // or to edit one.
1107
- entityPaneActive = computed(() => !!this.previewedEntity() || this.createEditViewActive());
1241
+ entityPaneActive = computed(() => !!this.previewedEntity() || this.createEditViewActive(), ...(ngDevMode ? [{ debugName: "entityPaneActive" }] : []));
1108
1242
  // Effective width of the entity pane.
1109
1243
  entityPaneWidth = computed(() => this.entityPaneActive()
1110
1244
  ? !!this.previewedEntity()
1111
1245
  ? this.previewPaneWidth()
1112
1246
  : this.editPaneWidth()
1113
- : 0);
1247
+ : 0, ...(ngDevMode ? [{ debugName: "entityPaneWidth" }] : []));
1114
1248
  // Width of the pane showing the list of entities. Calculated as
1115
- entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth());
1116
- entitiesPaneHidden = computed(() => this.entityPaneActive() && this.entityPaneWidth() === 100);
1117
- defaultItemCrudActions = signal([]);
1249
+ entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth(), ...(ngDevMode ? [{ debugName: "entitiesPaneWidth" }] : []));
1250
+ entitiesPaneHidden = computed(() => this.entityPaneActive() && this.entityPaneWidth() === 100, ...(ngDevMode ? [{ debugName: "entitiesPaneHidden" }] : []));
1251
+ defaultItemCrudActions = signal([], ...(ngDevMode ? [{ debugName: "defaultItemCrudActions" }] : []));
1118
1252
  columnsWithAction = computed(() => {
1119
1253
  const cols = clone(this.columns());
1120
1254
  const actionDefined = cols.find((c) => typeof c === 'string' ? c === 'action' : c.name === 'action') !== undefined;
@@ -1122,7 +1256,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1122
1256
  cols.push('action');
1123
1257
  }
1124
1258
  return cols;
1125
- });
1259
+ }, ...(ngDevMode ? [{ debugName: "columnsWithAction" }] : []));
1126
1260
  // Provide per entity actions as a function so that the actions are
1127
1261
  // enumerated only when the user clicks on the context menu button.
1128
1262
  _itemActions = (entity) => this.getItemActions(entity);
@@ -1136,7 +1270,7 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1136
1270
  ? this.columnsWithAction()
1137
1271
  .map((col) => (typeof col === 'string' ? col : col.name))
1138
1272
  .filter((name) => name !== 'action')
1139
- : []);
1273
+ : [], ...(ngDevMode ? [{ debugName: "visibleColumns" }] : []));
1140
1274
  transloco = inject(TranslocoService);
1141
1275
  constructor(http, snackBar, sanitizer, injector) {
1142
1276
  super(http, sanitizer, injector);
@@ -1709,8 +1843,8 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1709
1843
  spEntitiesList.loadMoreEntities();
1710
1844
  }
1711
1845
  }
1712
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudComponent, deps: [{ token: i1.HttpClient }, { token: i2$1.MatSnackBar }, { token: i3$1.DomSanitizer }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1713
- /** @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 }, listPaneWrapperClass: { classPropertyName: "listPaneWrapperClass", publicName: "listPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, previewPaneWrapperClass: { classPropertyName: "previewPaneWrapperClass", publicName: "previewPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, previewPaneContentClass: { classPropertyName: "previewPaneContentClass", publicName: "previewPaneContentClass", isSignal: true, isRequired: false, transformFunction: null }, formPaneWrapperClass: { classPropertyName: "formPaneWrapperClass", publicName: "formPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, formPaneContentClass: { classPropertyName: "formPaneContentClass", publicName: "formPaneContentClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", entityViewPaneActivated: "entityViewPaneActivated" }, providers: [provideTranslocoScope('sp-mat-entity-crud')], queries: [{ propertyName: "_clientColumnDefs", predicate: MatColumnDef }], viewQueries: [{ propertyName: "componentColumns", predicate: MatColumnDef, descendants: true, isSignal: true }, { propertyName: "spEntitiesList", first: true, predicate: ["entitiesList"], 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: `
1846
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudComponent, deps: [{ token: i1$1.HttpClient }, { token: i2$1.MatSnackBar }, { token: i3$2.DomSanitizer }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1847
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", 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 }, listPaneWrapperClass: { classPropertyName: "listPaneWrapperClass", publicName: "listPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, previewPaneWrapperClass: { classPropertyName: "previewPaneWrapperClass", publicName: "previewPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, previewPaneContentClass: { classPropertyName: "previewPaneContentClass", publicName: "previewPaneContentClass", isSignal: true, isRequired: false, transformFunction: null }, formPaneWrapperClass: { classPropertyName: "formPaneWrapperClass", publicName: "formPaneWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, formPaneContentClass: { classPropertyName: "formPaneContentClass", publicName: "formPaneContentClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", entityViewPaneActivated: "entityViewPaneActivated" }, providers: [provideTranslocoScope('sp-mat-entity-crud')], queries: [{ propertyName: "_clientColumnDefs", predicate: MatColumnDef }], viewQueries: [{ propertyName: "componentColumns", predicate: MatColumnDef, descendants: true, isSignal: true }, { propertyName: "spEntitiesList", first: true, predicate: ["entitiesList"], 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: `
1714
1848
  <as-split direction="horizontal" [gutterSize]="6" *transloco="let t">
1715
1849
  <as-split-area
1716
1850
  [size]="entitiesPaneWidth()"
@@ -1721,50 +1855,56 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1721
1855
 
1722
1856
  <ng-template #defaultActionButtons>
1723
1857
  <div class="action-bar-actions">
1724
- @if (!disableCreate()) { @if (newItemSubTypes()) {
1725
- <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->
1726
- <button
1727
- type="button"
1728
- mat-raised-button
1729
- color="primary"
1730
- [matMenuTriggerFor]="newSubTypesMenu"
1731
- >
1732
- {{
1733
- newItemLabel() ??
1734
- t('spMatEntityCrud.newItem', {
1735
- item: _itemLabel() | async
1736
- })
1737
- }}
1738
- <mat-icon>expand_circle_down</mat-icon>
1739
- </button>
1740
- <mat-menu #newSubTypesMenu="matMenu">
1741
- @for (subtype of newItemSubTypes(); track $index) { @if
1742
- (subtype.role) {
1743
- <button mat-menu-item (click)="handleNewItemSubType(subtype)">
1744
- {{ subtype.label }}
1745
- </button>
1858
+ @if (!disableCreate()) {
1859
+ @if (newItemSubTypes()) {
1860
+ <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->
1861
+ <button
1862
+ type="button"
1863
+ mat-raised-button
1864
+ color="primary"
1865
+ [matMenuTriggerFor]="newSubTypesMenu"
1866
+ >
1867
+ {{
1868
+ newItemLabel() ??
1869
+ t('spMatEntityCrud.newItem', {
1870
+ item: _itemLabel() | async,
1871
+ })
1872
+ }}
1873
+ <mat-icon>expand_circle_down</mat-icon>
1874
+ </button>
1875
+ <mat-menu #newSubTypesMenu="matMenu">
1876
+ @for (subtype of newItemSubTypes(); track $index) {
1877
+ @if (subtype.role) {
1878
+ <button
1879
+ mat-menu-item
1880
+ (click)="handleNewItemSubType(subtype)"
1881
+ >
1882
+ {{ subtype.label }}
1883
+ </button>
1884
+ } @else {
1885
+ <div style="padding: .2em 0.5em;">
1886
+ <strong>{{ subtype.label }}</strong>
1887
+ </div>
1888
+ }
1889
+ }
1890
+ </mat-menu>
1746
1891
  } @else {
1747
- <div style="padding: .2em 0.5em;">
1748
- <strong>{{ subtype.label }}</strong>
1749
- </div>
1750
- } }
1751
- </mat-menu>
1752
- } @else {
1753
- <button
1754
- mat-raised-button
1755
- color="primary"
1756
- (click)="onCreate($event)"
1757
- [routerLink]="newItemLink()"
1758
- >
1759
- {{
1760
- newItemLabel() ??
1761
- t('spMatEntityCrud.newItem', {
1762
- item: _itemLabel() | async
1763
- })
1764
- }}
1765
- <mat-icon>add_circle</mat-icon>
1766
- </button>
1767
- } }
1892
+ <button
1893
+ mat-raised-button
1894
+ color="primary"
1895
+ (click)="onCreate($event)"
1896
+ [routerLink]="newItemLink()"
1897
+ >
1898
+ {{
1899
+ newItemLabel() ??
1900
+ t('spMatEntityCrud.newItem', {
1901
+ item: _itemLabel() | async,
1902
+ })
1903
+ }}
1904
+ <mat-icon>add_circle</mat-icon>
1905
+ </button>
1906
+ }
1907
+ }
1768
1908
  </div>
1769
1909
  </ng-template>
1770
1910
 
@@ -1776,9 +1916,9 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1776
1916
  <span class="spacer"></span>
1777
1917
  <!-- Hide the action buttons when Preview/Edit pane is active -->
1778
1918
  @if (!entityPaneActive()) {
1779
- <ng-container
1780
- [ngTemplateOutlet]="actionsTemplate() || defaultActionButtons"
1781
- ></ng-container>
1919
+ <ng-container
1920
+ [ngTemplateOutlet]="actionsTemplate() || defaultActionButtons"
1921
+ ></ng-container>
1782
1922
  }
1783
1923
  </div>
1784
1924
  </ng-template>
@@ -1849,9 +1989,9 @@ class SPMatEntityCrudComponent extends SPMatEntityListComponent {
1849
1989
  </div>
1850
1990
  </as-split-area>
1851
1991
  </as-split>
1852
- `, isInline: true, styles: [".sp-hidden{display:none}.sp-visible{display:inherit;height:100%!important;width:100%!important}.entity-pane-wrapper{height:100%!important;width:100%!important}.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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.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: i7.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i7.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i7.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i7.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i7.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.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: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.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: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i4$1.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"] }, { 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 });
1992
+ `, isInline: true, styles: [".sp-hidden{display:none}.sp-visible{display:inherit;height:100%!important;width:100%!important}.entity-pane-wrapper{height:100%!important;width:100%!important}.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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i7.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i7.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i7.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i7.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i7.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.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: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.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: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i3$1.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"] }, { kind: "directive", type: SPMatHostBusyWheelDirective, selector: "[spHostBusyWheel]", inputs: ["spHostBusyWheel"] }, { kind: "component", type: PreviewHostComponent, selector: "sp-entity-crud-preview-host", inputs: ["entityCrudComponentBase", "clientViewTemplate"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1853
1993
  }
1854
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudComponent, decorators: [{
1994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatEntityCrudComponent, decorators: [{
1855
1995
  type: Component,
1856
1996
  args: [{ imports: [
1857
1997
  CommonModule,
@@ -1880,50 +2020,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
1880
2020
 
1881
2021
  <ng-template #defaultActionButtons>
1882
2022
  <div class="action-bar-actions">
1883
- @if (!disableCreate()) { @if (newItemSubTypes()) {
1884
- <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->
1885
- <button
1886
- type="button"
1887
- mat-raised-button
1888
- color="primary"
1889
- [matMenuTriggerFor]="newSubTypesMenu"
1890
- >
1891
- {{
1892
- newItemLabel() ??
1893
- t('spMatEntityCrud.newItem', {
1894
- item: _itemLabel() | async
1895
- })
1896
- }}
1897
- <mat-icon>expand_circle_down</mat-icon>
1898
- </button>
1899
- <mat-menu #newSubTypesMenu="matMenu">
1900
- @for (subtype of newItemSubTypes(); track $index) { @if
1901
- (subtype.role) {
1902
- <button mat-menu-item (click)="handleNewItemSubType(subtype)">
1903
- {{ subtype.label }}
1904
- </button>
2023
+ @if (!disableCreate()) {
2024
+ @if (newItemSubTypes()) {
2025
+ <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->
2026
+ <button
2027
+ type="button"
2028
+ mat-raised-button
2029
+ color="primary"
2030
+ [matMenuTriggerFor]="newSubTypesMenu"
2031
+ >
2032
+ {{
2033
+ newItemLabel() ??
2034
+ t('spMatEntityCrud.newItem', {
2035
+ item: _itemLabel() | async,
2036
+ })
2037
+ }}
2038
+ <mat-icon>expand_circle_down</mat-icon>
2039
+ </button>
2040
+ <mat-menu #newSubTypesMenu="matMenu">
2041
+ @for (subtype of newItemSubTypes(); track $index) {
2042
+ @if (subtype.role) {
2043
+ <button
2044
+ mat-menu-item
2045
+ (click)="handleNewItemSubType(subtype)"
2046
+ >
2047
+ {{ subtype.label }}
2048
+ </button>
2049
+ } @else {
2050
+ <div style="padding: .2em 0.5em;">
2051
+ <strong>{{ subtype.label }}</strong>
2052
+ </div>
2053
+ }
2054
+ }
2055
+ </mat-menu>
1905
2056
  } @else {
1906
- <div style="padding: .2em 0.5em;">
1907
- <strong>{{ subtype.label }}</strong>
1908
- </div>
1909
- } }
1910
- </mat-menu>
1911
- } @else {
1912
- <button
1913
- mat-raised-button
1914
- color="primary"
1915
- (click)="onCreate($event)"
1916
- [routerLink]="newItemLink()"
1917
- >
1918
- {{
1919
- newItemLabel() ??
1920
- t('spMatEntityCrud.newItem', {
1921
- item: _itemLabel() | async
1922
- })
1923
- }}
1924
- <mat-icon>add_circle</mat-icon>
1925
- </button>
1926
- } }
2057
+ <button
2058
+ mat-raised-button
2059
+ color="primary"
2060
+ (click)="onCreate($event)"
2061
+ [routerLink]="newItemLink()"
2062
+ >
2063
+ {{
2064
+ newItemLabel() ??
2065
+ t('spMatEntityCrud.newItem', {
2066
+ item: _itemLabel() | async,
2067
+ })
2068
+ }}
2069
+ <mat-icon>add_circle</mat-icon>
2070
+ </button>
2071
+ }
2072
+ }
1927
2073
  </div>
1928
2074
  </ng-template>
1929
2075
 
@@ -1935,9 +2081,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
1935
2081
  <span class="spacer"></span>
1936
2082
  <!-- Hide the action buttons when Preview/Edit pane is active -->
1937
2083
  @if (!entityPaneActive()) {
1938
- <ng-container
1939
- [ngTemplateOutlet]="actionsTemplate() || defaultActionButtons"
1940
- ></ng-container>
2084
+ <ng-container
2085
+ [ngTemplateOutlet]="actionsTemplate() || defaultActionButtons"
2086
+ ></ng-container>
1941
2087
  }
1942
2088
  </div>
1943
2089
  </ng-template>
@@ -2009,148 +2155,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
2009
2155
  </as-split-area>
2010
2156
  </as-split>
2011
2157
  `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".sp-hidden{display:none}.sp-visible{display:inherit;height:100%!important;width:100%!important}.entity-pane-wrapper{height:100%!important;width:100%!important}.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"] }]
2012
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$1.MatSnackBar }, { type: i3$1.DomSanitizer }, { type: i0.Injector }], propDecorators: { _clientColumnDefs: [{
2158
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i2$1.MatSnackBar }, { type: i3$2.DomSanitizer }, { type: i0.Injector }], propDecorators: { itemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemLabel", required: false }] }], itemLabelPlural: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemLabelPlural", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], itemActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemActions", required: false }] }], newItemLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "newItemLink", required: false }] }], newItemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "newItemLabel", required: false }] }], editItemTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "editItemTitle", required: false }] }], newItemSubTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "newItemSubTypes", required: false }] }], crudOpFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "crudOpFn", required: false }] }], previewTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewTemplate", required: false }] }], allowEntityActionFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEntityActionFn", required: false }] }], headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: false }] }], actionsTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsTemplate", required: false }] }], crudResponseParser: [{ type: i0.Input, args: [{ isSignal: true, alias: "crudResponseParser", required: false }] }], createEditFormTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "createEditFormTemplate", required: false }] }], disableItemActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableItemActions", required: false }] }], disableCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableCreate", required: false }] }], refreshAfterEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "refreshAfterEdit", required: false }] }], crudHttpReqContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "crudHttpReqContext", required: false }] }], editPaneWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "editPaneWidth", required: false }] }], previewPaneWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewPaneWidth", required: false }] }], listPaneWrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "listPaneWrapperClass", required: false }] }], previewPaneWrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewPaneWrapperClass", required: false }] }], previewPaneContentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewPaneContentClass", required: false }] }], formPaneWrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "formPaneWrapperClass", required: false }] }], formPaneContentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "formPaneContentClass", required: false }] }], componentColumns: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => MatColumnDef), { isSignal: true }] }], _clientColumnDefs: [{
2013
2159
  type: ContentChildren,
2014
2160
  args: [MatColumnDef]
2015
2161
  }], action: [{
2016
2162
  type: Output
2017
2163
  }], entityViewPaneActivated: [{
2018
2164
  type: Output
2019
- }] } });
2020
-
2021
- const ITEM_ACTION_UPDATE = '_update_';
2022
- const ITEM_ACTION_DELETE = '_delete_';
2023
-
2024
- /**
2025
- * A preview pane container to provide a consistent UX for all preview panes.
2026
- * It consits of a toolbar on the top and a container div below that takes up
2027
- * the rest of the preview pane area.
2028
- */
2029
- class SPMatEntityCrudPreviewPaneComponent {
2030
- entity = input.required();
2031
- entityCrudComponent = input.required();
2032
- title = input();
2033
- disableUpdate = input(false);
2034
- hideUpdate = input(false);
2035
- disableDelete = input(false);
2036
- hideDelete = input(false);
2037
- itemActions;
2038
- _disableActionFactory = (role, signal) => {
2039
- return computed(() => {
2040
- if (signal && signal()) {
2041
- return true;
2042
- }
2043
- const actionFn = this.itemActions.find((a) => a.role === role)?.disable;
2044
- if (actionFn && actionFn(this.entity())) {
2045
- return true;
2046
- }
2047
- return false;
2048
- });
2049
- };
2050
- _disableUpdate = this._disableActionFactory(ITEM_ACTION_UPDATE, this.disableUpdate);
2051
- _disableDelete = this._disableActionFactory(ITEM_ACTION_DELETE, this.disableDelete);
2052
- ngOnInit() {
2053
- this.itemActions = this.entityCrudComponent().getItemActions();
2054
- }
2055
- ngOnDestroy() { }
2056
- onEdit() {
2057
- this.entityCrudComponent().triggerEntityUpdate(this.entity());
2058
- }
2059
- onDelete() {
2060
- this.entityCrudComponent().triggerEntityDelete(this.entity());
2061
- }
2062
- onClose() {
2063
- this.entityCrudComponent().closePreview();
2064
- }
2065
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudPreviewPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2066
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: SPMatEntityCrudPreviewPaneComponent, isStandalone: true, selector: "sp-mat-entity-crud-preview-pane", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, entityCrudComponent: { classPropertyName: "entityCrudComponent", publicName: "entityCrudComponent", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, disableUpdate: { classPropertyName: "disableUpdate", publicName: "disableUpdate", isSignal: true, isRequired: false, transformFunction: null }, hideUpdate: { classPropertyName: "hideUpdate", publicName: "hideUpdate", isSignal: true, isRequired: false, transformFunction: null }, disableDelete: { classPropertyName: "disableDelete", publicName: "disableDelete", isSignal: true, isRequired: false, transformFunction: null }, hideDelete: { classPropertyName: "hideDelete", publicName: "hideDelete", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2067
- <div class="preview-wrapper">
2068
- <mat-toolbar>
2069
- <mat-toolbar-row>
2070
- @if (title()) {
2071
- <h2>{{ title() }}</h2>
2072
- &nbsp; } @if (!hideUpdate()) {
2073
- <button
2074
- mat-icon-button
2075
- aria-label="Edit"
2076
- (click)="onEdit()"
2077
- [disabled]="_disableUpdate()"
2078
- >
2079
- <mat-icon>edit</mat-icon>
2080
- </button>
2081
- } @if (!hideDelete()) {
2082
- <button
2083
- mat-icon-button
2084
- aria-label="Delete"
2085
- (click)="onDelete()"
2086
- [disabled]="_disableDelete()"
2087
- >
2088
- <mat-icon>delete</mat-icon>
2089
- </button>
2090
- }
2091
- <ng-content select="[previewToolbarContent]"></ng-content>
2092
- <span class="spacer"></span>
2093
- <button mat-icon-button aria-label="Close" (click)="onClose()">
2094
- <mat-icon>close</mat-icon>
2095
- </button>
2096
- </mat-toolbar-row>
2097
- </mat-toolbar>
2098
- <div
2099
- [class]="
2100
- 'preview-content ' +
2101
- entityCrudComponent().getPreviewPaneContentClass()
2102
- "
2103
- >
2104
- <ng-content select="[previewContent]"></ng-content>
2105
- </div>
2106
- </div>
2107
- `, isInline: true, styles: [".preview-wrapper{display:flex;flex-direction:column;height:100%!important;width:100%!important}mat-toolbar{background-color:var(--mat-sys-surface-variant)}.spacer{flex:1 1 auto}.preview-content{padding:.4em;flex-grow:1;overflow:scroll}\n"], dependencies: [{ kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i1$1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i1$1.MatToolbarRow, selector: "mat-toolbar-row", exportAs: ["matToolbarRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2108
- }
2109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatEntityCrudPreviewPaneComponent, decorators: [{
2110
- type: Component,
2111
- args: [{ imports: [MatToolbarModule, MatButtonModule, MatIconModule], selector: 'sp-mat-entity-crud-preview-pane', template: `
2112
- <div class="preview-wrapper">
2113
- <mat-toolbar>
2114
- <mat-toolbar-row>
2115
- @if (title()) {
2116
- <h2>{{ title() }}</h2>
2117
- &nbsp; } @if (!hideUpdate()) {
2118
- <button
2119
- mat-icon-button
2120
- aria-label="Edit"
2121
- (click)="onEdit()"
2122
- [disabled]="_disableUpdate()"
2123
- >
2124
- <mat-icon>edit</mat-icon>
2125
- </button>
2126
- } @if (!hideDelete()) {
2127
- <button
2128
- mat-icon-button
2129
- aria-label="Delete"
2130
- (click)="onDelete()"
2131
- [disabled]="_disableDelete()"
2132
- >
2133
- <mat-icon>delete</mat-icon>
2134
- </button>
2135
- }
2136
- <ng-content select="[previewToolbarContent]"></ng-content>
2137
- <span class="spacer"></span>
2138
- <button mat-icon-button aria-label="Close" (click)="onClose()">
2139
- <mat-icon>close</mat-icon>
2140
- </button>
2141
- </mat-toolbar-row>
2142
- </mat-toolbar>
2143
- <div
2144
- [class]="
2145
- 'preview-content ' +
2146
- entityCrudComponent().getPreviewPaneContentClass()
2147
- "
2148
- >
2149
- <ng-content select="[previewContent]"></ng-content>
2150
- </div>
2151
- </div>
2152
- `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".preview-wrapper{display:flex;flex-direction:column;height:100%!important;width:100%!important}mat-toolbar{background-color:var(--mat-sys-surface-variant)}.spacer{flex:1 1 auto}.preview-content{padding:.4em;flex-grow:1;overflow:scroll}\n"] }]
2153
- }] });
2165
+ }], spEntitiesList: [{ type: i0.ViewChild, args: ['entitiesList', { isSignal: true }] }], createEditHostComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => FormViewHostComponent), { isSignal: true }] }], previewHostComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PreviewHostComponent), { isSignal: true }] }] } });
2154
2166
 
2155
2167
  /**
2156
2168
  * Generated bundle index. Do not edit.