@elasticias/screens 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elasticias/screens",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -357,7 +357,18 @@ declare abstract class AbstractDetailScreenComponent extends AbstractScreenCompo
357
357
  protected customizeDuplicatedEntity(entity: any): any;
358
358
  duplicate(): void;
359
359
  print(): void;
360
+ /**
361
+ * Name of the record being deleted, so the confirmation can say what
362
+ * it is about to destroy rather than asking about "this item".
363
+ * Override in the screen and return whatever a user recognises the
364
+ * record by — `return this.entity?.name;` is the usual body.
365
+ */
366
+ protected getDeleteConfirmName(): string | undefined;
360
367
  delete(): void;
368
+ /** The screen has no record id — it was removed by someone else, or the
369
+ * route is stale. Say that, rather than the internal
370
+ * "Item [id] is undefined!" this used to ship to end users. */
371
+ protected recordNotFound(): void;
361
372
  navigateBack(): void;
362
373
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AbstractDetailScreenComponent, never>;
363
374
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AbstractDetailScreenComponent, "ng-component", never, {}, {}, never, never, true, never>;
@@ -399,7 +410,24 @@ declare abstract class AbstractSearchScreenComponent extends AbstractScreenCompo
399
410
  navigateToDetails(id?: any): void;
400
411
  add(): void;
401
412
  edit(id: any): void;
413
+ /**
414
+ * Name of the row being deleted, so the confirmation can say what it
415
+ * is about to destroy rather than asking about "this item". Override
416
+ * in the screen — look the row up in the loaded results and return
417
+ * whatever a user would recognise it by.
418
+ *
419
+ * ```ts
420
+ * protected override getDeleteConfirmName(id: any) {
421
+ * return this.searchEntity.items?.find((r: any) => r.id === id)?.name;
422
+ * }
423
+ * ```
424
+ */
425
+ protected getDeleteConfirmName(_id: any): string | undefined;
402
426
  delete(id: any): void;
427
+ /** The row the user acted on carries no id — it was removed by someone
428
+ * else, or the list is stale. Say that, rather than the internal
429
+ * "Item [id] is undefined!" this used to ship to end users. */
430
+ protected recordNotFound(): void;
403
431
  duplicate(id: any): void;
404
432
  clear(): void;
405
433
  ngOnDestroy(): void;
@@ -826,7 +854,24 @@ declare abstract class AbstractSearchScreenV2<TItem = any> extends AbstractScree
826
854
  /** Open the create form. */
827
855
  add(): void;
828
856
  edit(id: any): void;
857
+ /**
858
+ * Name of the row being deleted, so the confirmation can say what it
859
+ * is about to destroy — "Delete ANDALOCY PARFUMS?" rather than
860
+ * "Delete?". Override in the screen; returning `undefined` keeps the
861
+ * generic message, which still reads correctly.
862
+ *
863
+ * ```ts
864
+ * protected override getDeleteConfirmName(id: any) {
865
+ * return this.items().find(r => r.id === id)?.name;
866
+ * }
867
+ * ```
868
+ */
869
+ protected getDeleteConfirmName(_id: any): string | undefined;
829
870
  delete(id: any): void;
871
+ /** The row the user acted on carries no id — it was removed by someone
872
+ * else, or the list is stale. Say that, rather than the internal
873
+ * "Item [id] is undefined!" this used to ship to end users. */
874
+ protected recordNotFound(): void;
830
875
  duplicate(id: any): void;
831
876
  ngOnDestroy(): void;
832
877
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AbstractSearchScreenV2<any>, never>;
@@ -1009,7 +1054,24 @@ declare abstract class AbstractDetailScreenV2<TItem extends object = any> extend
1009
1054
  /**
1010
1055
  * Soft-delete-then-navigate-back. Confirms with the user first.
1011
1056
  */
1057
+ /**
1058
+ * Name of the record being deleted, so the confirmation can say what
1059
+ * it is about to destroy — "Delete ANDALOCY PARFUMS?" rather than
1060
+ * "Delete?". Override in the screen; returning `undefined` keeps the
1061
+ * generic message, which still reads correctly.
1062
+ *
1063
+ * ```ts
1064
+ * protected override getDeleteConfirmName() {
1065
+ * return this.entity()?.name;
1066
+ * }
1067
+ * ```
1068
+ */
1069
+ protected getDeleteConfirmName(): string | undefined;
1012
1070
  delete(): void;
1071
+ /** The screen has no record id — it was removed by someone else, or
1072
+ * the route is stale. Say that, rather than the internal
1073
+ * "Item [id] is undefined!" this used to ship to end users. */
1074
+ protected recordNotFound(): void;
1013
1075
  /** Navigate to `/details/:id?mode=duplicate` so the abstract can
1014
1076
  * reload the source entity, treat it as a template, and persist
1015
1077
  * via `service.create()` after the user hits Save.