@zealicsolutions/web-ui 1.0.140-beta.120 → 1.0.140-beta.122

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.
@@ -114,7 +114,10 @@ export interface LinkProperties {
114
114
  externalLink?: Nullable<string>;
115
115
  name?: string;
116
116
  required?: boolean;
117
+ /** For dataDrivenLink: DMF ID containing URL or page ID */
117
118
  sourceDataModelFieldId?: string;
119
+ /** For dataDrivenLink: Optional DMF ID containing record ID to pass to destination */
120
+ recordIdFieldId?: string;
118
121
  }
119
122
  export interface BooleanProperties {
120
123
  attributeType: 'boolean';
@@ -36,6 +36,41 @@ export declare const navigateToLink: (link?: Nullable<string | LinkProperties>,
36
36
  }) => void) | undefined) => void;
37
37
  export declare const checkIsInternalLink: (link?: LinkProperties) => boolean;
38
38
  export declare const checkIsDataDrivenLink: (link?: LinkProperties) => boolean;
39
+ /**
40
+ * Determines if a URL is external (http/https) or internal (page ID)
41
+ * @param url - The URL to check
42
+ * @returns true if URL starts with http:// or https://
43
+ */
44
+ export declare const isExternalUrl: (url: string) => boolean;
45
+ /**
46
+ * Result of resolving a data-driven link
47
+ */
48
+ export interface ResolvedDataDrivenLink {
49
+ /** The destination URL or internal link */
50
+ destination: string;
51
+ /** Whether this is an external URL */
52
+ isExternal: boolean;
53
+ /** Optional record ID to pass to destination (internal only) */
54
+ recordId?: string;
55
+ }
56
+ /**
57
+ * Resolves a data-driven link to its destination and determines navigation type
58
+ *
59
+ * @param link - The LinkProperties object
60
+ * @param rawItemDataByDmfId - DMF data from container runtime context
61
+ * @returns Resolved link details or null if link cannot be resolved (disabled state)
62
+ *
63
+ * @example
64
+ * // External URL
65
+ * const result = resolveDataDrivenLink(link, { urlField: 'https://example.com' });
66
+ * // Returns: { destination: 'https://example.com', isExternal: true }
67
+ *
68
+ * @example
69
+ * // Internal page with record ID
70
+ * const result = resolveDataDrivenLink(link, { pageField: 'study-details', idField: 'S-001' });
71
+ * // Returns: { destination: '?webpageId=study-details', isExternal: false, recordId: 'S-001' }
72
+ */
73
+ export declare const resolveDataDrivenLink: (link: LinkProperties, rawItemDataByDmfId: Record<string, unknown> | undefined) => ResolvedDataDrivenLink | null;
39
74
  export declare const addInternalParamsToCurrentLink: (internalLink?: Nullable<string>, isPreview?: boolean) => string | undefined;
40
75
  export declare const getHref: (link?: LinkProperties, isPreview?: boolean) => Nullable<string> | undefined;
41
76
  export declare const parseDescendantContent: (string: string) => CustomDescendant[];