@anzusystems/common-admin 1.47.0-beta.dev-1782074999 → 1.47.0-beta.dev-1782075999

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/dist/labs.d.ts CHANGED
@@ -1187,7 +1187,7 @@ export declare interface ListEditorHandle<TItem extends Record<string, any>> {
1187
1187
  /** Amber: is this row added / edited / moved since the last commit? */
1188
1188
  isUnsaved: (key: ListEditorKey) => boolean;
1189
1189
  /** Red rail (gated): 'invalid' only once the row is unsaved or `validateAll()` ran. */
1190
- rowState: (item: TItem, key: ListEditorKey) => ListEditorValidationState;
1190
+ rowState: (item: TItem, key: ListEditorKey, editing?: boolean) => ListEditorValidationState;
1191
1191
  /** Force-show all invalid rows + return whether the list is valid. The save guard. */
1192
1192
  validateAll: () => boolean;
1193
1193
  /** Normalized ordered array for a full-DTO save. */
@@ -1198,7 +1198,7 @@ export declare interface ListEditorHandle<TItem extends Record<string, any>> {
1198
1198
  commit: (savedItems?: TItem[]) => void;
1199
1199
  /** Discard unsaved edits back to the last committed baseline (or given items). */
1200
1200
  reset: (items?: TItem[]) => void;
1201
- addItem: (item?: TItem, hint?: PositionHint) => void;
1201
+ addItem: (item?: TItem, hint?: PositionHint) => ListEditorKey | undefined;
1202
1202
  updateItem: (key: ListEditorKey, next: TItem | Partial<TItem> | ((current: TItem) => TItem)) => void;
1203
1203
  /** Remove a row. `trackDeleted: false` (immediate mode) skips the deferred-deletion tombstone. */
1204
1204
  deleteItem: (key: ListEditorKey, opts?: {
@@ -1322,7 +1322,7 @@ export declare interface NestedListEditorHandle<TItem extends Record<string, any
1322
1322
  /** Amber: is this row added / edited / moved / reparented since the last commit? */
1323
1323
  isUnsaved: (key: ListEditorKey) => boolean;
1324
1324
  /** Red rail (gated): 'invalid' only once the row is unsaved or `validateAll()` ran. */
1325
- rowState: (item: TItem, key: ListEditorKey) => ListEditorValidationState;
1325
+ rowState: (item: TItem, key: ListEditorKey, editing?: boolean) => ListEditorValidationState;
1326
1326
  /** Force-show all invalid rows + return whether the tree is valid. The save guard. */
1327
1327
  validateAll: () => boolean;
1328
1328
  /** Flattened ordered array (each row carrying its resolved position + parent key) for a full-DTO save. */
@@ -2097,6 +2097,20 @@ export declare function useFilterHelpers<F extends readonly MakeFilterOption<str
2097
2097
  } | null;
2098
2098
  };
2099
2099
 
2100
+ /**
2101
+ * Wrap an entity-delete handler so it bypasses the unsaved-changes leave guard.
2102
+ *
2103
+ * An entity delete destroys the record together with any unsaved edits, so the "you have unsaved
2104
+ * changes — really leave?" prompt that the delete's `router.push` would otherwise trigger is
2105
+ * meaningless: the user already confirmed the delete, and there is nothing left to keep. Without this
2106
+ * the delete runs, then the leave-guard fires on the post-delete navigation and choosing "stay" leaves
2107
+ * the view on an already-deleted entity (system error). This acknowledges the guard right before the
2108
+ * delete so the follow-up navigation proceeds without prompting. (QA 85050 batch 7 — BUG-08)
2109
+ *
2110
+ * Usage: `@delete-record="guardedDelete(() => onDelete(id))"` or wrap the handler once.
2111
+ */
2112
+ export declare function useGuardedDelete<A extends unknown[], R>(guard: Pick<UseUnsavedChangesGuardApi, 'acknowledge'>, onDelete: (...args: A) => R): (...args: A) => R;
2113
+
2100
2114
  export declare function useJobApi<JobType extends JobBase = JobBase>(client: () => AxiosInstance, system: string): {
2101
2115
  useFetchJobList: () => UseApiFetchListReturnType<JobType[]>;
2102
2116
  fetchJob: (id: number) => Promise<JobType>;