@anzusystems/common-admin 1.47.0-beta.dev-1778753786 → 1.47.0-beta.dev-1778753787

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
@@ -423,6 +423,7 @@ declare const __VLS_export_18: DefineComponent<__VLS_PublicProps_4, {}, {}, {},
423
423
  body: string;
424
424
  stayLabel: string;
425
425
  discardLabel: string;
426
+ dirtyLabels: string[];
426
427
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
427
428
 
428
429
  declare const __VLS_export_2: __VLS_WithSlots_2<typeof __VLS_base_2, __VLS_Slots_2>;
@@ -1361,6 +1362,11 @@ declare interface Props_4 {
1361
1362
  body?: string;
1362
1363
  stayLabel?: string;
1363
1364
  discardLabel?: string;
1365
+ /**
1366
+ * Names of the dirty sections (from the guard's `dirtyLabels`). When
1367
+ * non-empty the dialog lists them instead of the generic body message.
1368
+ */
1369
+ dirtyLabels?: string[];
1364
1370
  }
1365
1371
 
1366
1372
  declare type ReorderMode = 'view' | 'reorder';
@@ -1580,6 +1586,21 @@ declare interface ToolbarSlotProps_2 {
1580
1586
  };
1581
1587
  }
1582
1588
 
1589
+ /**
1590
+ * One named, savable section the unsaved-changes confirm dialog can name back
1591
+ * to the user. `dirty` is evaluated reactively inside the section's getter.
1592
+ */
1593
+ export declare interface UnsavedSectionDescriptor {
1594
+ label: string;
1595
+ dirty: boolean;
1596
+ }
1597
+
1598
+ /**
1599
+ * Getter returning a single descriptor, or an array of them for a component
1600
+ * that owns several sub-sections (e.g. page positions in one PageContentsManage).
1601
+ */
1602
+ export declare type UnsavedSectionSource = () => UnsavedSectionDescriptor | UnsavedSectionDescriptor[];
1603
+
1583
1604
  declare type UnsavedSource = Ref<boolean | Set<unknown> | unknown[] | null | undefined>;
1584
1605
 
1585
1606
  declare type UrlParams = {
@@ -1859,6 +1880,13 @@ export declare function useUnsavedChangesGuard(options: UseUnsavedChangesGuardOp
1859
1880
 
1860
1881
  declare interface UseUnsavedChangesGuardApi {
1861
1882
  hasUnsavedChanges: ComputedRef<boolean>;
1883
+ /**
1884
+ * Labels of the dirty sections registered by descendants via
1885
+ * `useUnsavedSection`. Bind to `AUnsavedConfirmDialog`'s `dirtyLabels` prop
1886
+ * so the dialog names *which* parts are unsaved. Empty when no descendant
1887
+ * registered a section (dialog falls back to the generic message).
1888
+ */
1889
+ dirtyLabels: ComputedRef<string[]>;
1862
1890
  /**
1863
1891
  * v-model-bound to the confirm dialog. When the guard wants to ask the user
1864
1892
  * to confirm leaving, it sets this to true. The confirm dialog reads it.
@@ -1900,8 +1928,25 @@ declare interface UseUnsavedChangesGuardOptions {
1900
1928
  * confirms via the confirm dialog or via `acknowledge()`.
1901
1929
  */
1902
1930
  guardDialogModel?: Ref<boolean>;
1931
+ /**
1932
+ * Named sections owned by the guard host component itself. Descendants use
1933
+ * `useUnsavedSection` instead — but a component can't `inject` its own
1934
+ * `provide`, so when the host *is* the section owner (e.g. a dialog), pass
1935
+ * the sections here.
1936
+ */
1937
+ ownSections?: UnsavedSectionSource;
1903
1938
  }
1904
1939
 
1940
+ /**
1941
+ * Registers one or more named sections so the unsaved-changes confirm dialog
1942
+ * can tell the user *which* parts are dirty instead of a generic message.
1943
+ *
1944
+ * Pass a getter returning a descriptor — or an array of descriptors when the
1945
+ * component owns several sub-sections (e.g. one PageContentsManage owns N page
1946
+ * positions). No-op when called outside a guarded route (inject returns null).
1947
+ */
1948
+ export declare function useUnsavedSection(source: UnsavedSectionSource): void;
1949
+
1905
1950
  export declare function useUserAdminConfigApi(client: () => AxiosInstance, system: string, entity?: string, endPoint?: string): {
1906
1951
  useFetchUserAdminConfigList: () => UseApiFetchListReturnType<UserAdminConfig< UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>[]>;
1907
1952
  fetchUserAdminConfig: (id: IntegerId) => Promise<UserAdminConfig< UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>>;