@zealicsolutions/web-ui 1.0.140-beta.151 → 1.0.140-beta.153
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/cjs/helpers/utils.d.ts +26 -5
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/helpers/utils.d.ts +26 -5
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/package.json +1 -1
|
@@ -58,19 +58,40 @@ export interface ResolvedDataDrivenLink {
|
|
|
58
58
|
/**
|
|
59
59
|
* Resolves a data-driven link to its destination and determines navigation type
|
|
60
60
|
*
|
|
61
|
+
* ## Data-Driven Link Resolution
|
|
62
|
+
*
|
|
63
|
+
* ### Link Type Detection
|
|
64
|
+
* The `dataDrivenLinkType` field references a picklist value: `{ id, code, label }`
|
|
65
|
+
* - Internal: `code === "internal"` or `label === "Internal"`
|
|
66
|
+
* - External: `code === "external"` or `label === "External"`
|
|
67
|
+
*
|
|
68
|
+
* ### Internal Links
|
|
69
|
+
* Uses `internalLinkFieldId` to get the target page ID:
|
|
70
|
+
* - Extracts `.id` from the field value (NOT `.value`)
|
|
71
|
+
* - This ID should match `webpage.internalTaskTagId` in the host app
|
|
72
|
+
* - Host app resolves the webpage by: `appPages.find(p => p.internalTaskTagId === id)`
|
|
73
|
+
*
|
|
74
|
+
* ### External Links
|
|
75
|
+
* Uses `externalLinkFieldId` to get the URL:
|
|
76
|
+
* - Extracts `.value` from the field value (the actual URL string)
|
|
77
|
+
* - Opens in a new tab
|
|
78
|
+
* - Logs error if URL is invalid
|
|
79
|
+
*
|
|
61
80
|
* @param link - The LinkProperties object
|
|
62
|
-
* @param rawItemDataByDmfId - DMF data from container runtime context
|
|
81
|
+
* @param rawItemDataByDmfId - DMF data from container runtime context or local state
|
|
63
82
|
* @returns Resolved link details or null if link cannot be resolved (disabled state)
|
|
64
83
|
*
|
|
65
84
|
* @example
|
|
66
85
|
* // External URL
|
|
67
|
-
*
|
|
86
|
+
* // Data: { externalLinkFieldId: { value: 'https://example.com' } }
|
|
87
|
+
* const result = resolveDataDrivenLink(link, data);
|
|
68
88
|
* // Returns: { destination: 'https://example.com', isExternal: true }
|
|
69
89
|
*
|
|
70
90
|
* @example
|
|
71
|
-
* // Internal page with
|
|
72
|
-
*
|
|
73
|
-
*
|
|
91
|
+
* // Internal page with internalTaskTagId
|
|
92
|
+
* // Data: { internalLinkFieldId: { id: '777a77bc-a0d4-4bdd-933b-9a343daa7891' } }
|
|
93
|
+
* const result = resolveDataDrivenLink(link, data);
|
|
94
|
+
* // Returns: { destination: '?internalTaskTagId=777a77bc-...', isExternal: false, internalTaskTagId: '777a77bc-...' }
|
|
74
95
|
*/
|
|
75
96
|
export declare const resolveDataDrivenLink: (link: LinkProperties, rawItemDataByDmfId: Record<string, unknown> | undefined) => ResolvedDataDrivenLink | null;
|
|
76
97
|
export declare const addInternalParamsToCurrentLink: (internalLink?: Nullable<string>, isPreview?: boolean) => string | undefined;
|