@elasticias/screens 1.0.27 → 1.0.29

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.27",
3
+ "version": "1.0.29",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -286,6 +286,13 @@ declare abstract class AbstractScreenComponent extends AbstractComponent impleme
286
286
  refreshStaticLists(): Promise<void>;
287
287
  invalidateReference(key: string): Promise<void>;
288
288
  invalidateReferences(keys: string[]): Promise<void>;
289
+ /** The record the user acted on carries no id — it was removed by someone
290
+ * else, the list is stale, or the route points at nothing. Say that,
291
+ * rather than the internal "Item [id] is undefined!" this used to ship
292
+ * to end users. Lives on the common base so every screen abstract
293
+ * (search, detail and sub in V1 and V2, plus report-v2) says the same
294
+ * thing — four copies of one string is how this file set drifts. */
295
+ protected recordNotFound(): void;
289
296
  handleErrors(errors: string[]): void;
290
297
  setServerErrors(errors: {
291
298
  [key: string]: string[];
@@ -357,6 +364,13 @@ declare abstract class AbstractDetailScreenComponent extends AbstractScreenCompo
357
364
  protected customizeDuplicatedEntity(entity: any): any;
358
365
  duplicate(): void;
359
366
  print(): void;
367
+ /**
368
+ * Name of the record being deleted, so the confirmation can say what
369
+ * it is about to destroy rather than asking about "this item".
370
+ * Override in the screen and return whatever a user recognises the
371
+ * record by — `return this.entity?.name;` is the usual body.
372
+ */
373
+ protected getDeleteConfirmName(): string | undefined;
360
374
  delete(): void;
361
375
  navigateBack(): void;
362
376
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AbstractDetailScreenComponent, never>;
@@ -399,6 +413,19 @@ declare abstract class AbstractSearchScreenComponent extends AbstractScreenCompo
399
413
  navigateToDetails(id?: any): void;
400
414
  add(): void;
401
415
  edit(id: any): void;
416
+ /**
417
+ * Name of the row being deleted, so the confirmation can say what it
418
+ * is about to destroy rather than asking about "this item". Override
419
+ * in the screen — look the row up in the loaded results and return
420
+ * whatever a user would recognise it by.
421
+ *
422
+ * ```ts
423
+ * protected override getDeleteConfirmName(id: any) {
424
+ * return this.searchEntity.items?.find((r: any) => r.id === id)?.name;
425
+ * }
426
+ * ```
427
+ */
428
+ protected getDeleteConfirmName(_id: any): string | undefined;
402
429
  delete(id: any): void;
403
430
  duplicate(id: any): void;
404
431
  clear(): void;
@@ -826,6 +853,19 @@ declare abstract class AbstractSearchScreenV2<TItem = any> extends AbstractScree
826
853
  /** Open the create form. */
827
854
  add(): void;
828
855
  edit(id: any): void;
856
+ /**
857
+ * Name of the row being deleted, so the confirmation can say what it
858
+ * is about to destroy — "Delete ANDALOCY PARFUMS?" rather than
859
+ * "Delete?". Override in the screen; returning `undefined` keeps the
860
+ * generic message, which still reads correctly.
861
+ *
862
+ * ```ts
863
+ * protected override getDeleteConfirmName(id: any) {
864
+ * return this.items().find(r => r.id === id)?.name;
865
+ * }
866
+ * ```
867
+ */
868
+ protected getDeleteConfirmName(_id: any): string | undefined;
829
869
  delete(id: any): void;
830
870
  duplicate(id: any): void;
831
871
  ngOnDestroy(): void;
@@ -1009,6 +1049,19 @@ declare abstract class AbstractDetailScreenV2<TItem extends object = any> extend
1009
1049
  /**
1010
1050
  * Soft-delete-then-navigate-back. Confirms with the user first.
1011
1051
  */
1052
+ /**
1053
+ * Name of the record being deleted, so the confirmation can say what
1054
+ * it is about to destroy — "Delete ANDALOCY PARFUMS?" rather than
1055
+ * "Delete?". Override in the screen; returning `undefined` keeps the
1056
+ * generic message, which still reads correctly.
1057
+ *
1058
+ * ```ts
1059
+ * protected override getDeleteConfirmName() {
1060
+ * return this.entity()?.name;
1061
+ * }
1062
+ * ```
1063
+ */
1064
+ protected getDeleteConfirmName(): string | undefined;
1012
1065
  delete(): void;
1013
1066
  /** Navigate to `/details/:id?mode=duplicate` so the abstract can
1014
1067
  * reload the source entity, treat it as a template, and persist