@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260522043844 → 0.8.1-dev.20260523055026
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/index.js +219 -280
- package/dist/index.mjs +166 -227
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1123,28 +1123,28 @@ var LinkNodeButton_exports = {};
|
|
|
1123
1123
|
__export(LinkNodeButton_exports, {
|
|
1124
1124
|
default: () => LinkNodeButton_default
|
|
1125
1125
|
});
|
|
1126
|
-
var
|
|
1126
|
+
var import_react33, import_jsx_runtime46, LinkNodeButton, LinkNodeButton_default;
|
|
1127
1127
|
var init_LinkNodeButton = __esm({
|
|
1128
1128
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
1129
1129
|
"use strict";
|
|
1130
1130
|
"use client";
|
|
1131
|
-
|
|
1131
|
+
import_react33 = require("react");
|
|
1132
1132
|
init_Button();
|
|
1133
1133
|
init_ServiceClient();
|
|
1134
1134
|
init_ToastService();
|
|
1135
1135
|
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1136
1136
|
LinkNodeButton = (props) => {
|
|
1137
1137
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
1138
|
-
const [isLoading, setIsLoading] = (0,
|
|
1139
|
-
const [error, setError] = (0,
|
|
1140
|
-
const extractFieldNames = (0,
|
|
1138
|
+
const [isLoading, setIsLoading] = (0, import_react33.useState)(false);
|
|
1139
|
+
const [error, setError] = (0, import_react33.useState)(null);
|
|
1140
|
+
const extractFieldNames = (0, import_react33.useCallback)((template) => {
|
|
1141
1141
|
if (!template) return [];
|
|
1142
1142
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
1143
1143
|
const matches = Array.from(template.matchAll(regex));
|
|
1144
1144
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
1145
1145
|
return fieldNames;
|
|
1146
1146
|
}, []);
|
|
1147
|
-
const replaceTemplateVariables = (0,
|
|
1147
|
+
const replaceTemplateVariables = (0, import_react33.useCallback)((template, responseData) => {
|
|
1148
1148
|
if (!template) return template;
|
|
1149
1149
|
let result = template;
|
|
1150
1150
|
const fieldNames = extractFieldNames(template);
|
|
@@ -1173,7 +1173,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1173
1173
|
}
|
|
1174
1174
|
return result;
|
|
1175
1175
|
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
1176
|
-
const getNestedValue3 = (0,
|
|
1176
|
+
const getNestedValue3 = (0, import_react33.useCallback)((obj, path) => {
|
|
1177
1177
|
if (!obj || !path) return void 0;
|
|
1178
1178
|
if (obj[path] !== void 0) {
|
|
1179
1179
|
return obj[path];
|
|
@@ -1188,7 +1188,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return current;
|
|
1190
1190
|
}, []);
|
|
1191
|
-
const onClick = (0,
|
|
1191
|
+
const onClick = (0, import_react33.useCallback)(async (e) => {
|
|
1192
1192
|
if (!node.postUrl) {
|
|
1193
1193
|
setError("No POST URL configured for this button");
|
|
1194
1194
|
return;
|
|
@@ -1300,9 +1300,9 @@ __export(CopyButton_exports, {
|
|
|
1300
1300
|
default: () => CopyButton
|
|
1301
1301
|
});
|
|
1302
1302
|
function CopyButton({ text }) {
|
|
1303
|
-
const [copied, setCopied] = (0,
|
|
1304
|
-
const timeoutRef = (0,
|
|
1305
|
-
(0,
|
|
1303
|
+
const [copied, setCopied] = (0, import_react40.useState)(false);
|
|
1304
|
+
const timeoutRef = (0, import_react40.useRef)(null);
|
|
1305
|
+
(0, import_react40.useEffect)(() => {
|
|
1306
1306
|
return () => {
|
|
1307
1307
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
1308
1308
|
};
|
|
@@ -1346,25 +1346,25 @@ function CopyButton({ text }) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
);
|
|
1348
1348
|
}
|
|
1349
|
-
var
|
|
1349
|
+
var import_react40, import_jsx_runtime56;
|
|
1350
1350
|
var init_CopyButton = __esm({
|
|
1351
1351
|
"src/components/CopyButton.tsx"() {
|
|
1352
1352
|
"use strict";
|
|
1353
1353
|
"use client";
|
|
1354
|
-
|
|
1354
|
+
import_react40 = require("react");
|
|
1355
1355
|
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1356
1356
|
}
|
|
1357
1357
|
});
|
|
1358
1358
|
|
|
1359
1359
|
// src/components/IFrameLoaderView.tsx
|
|
1360
|
-
var
|
|
1360
|
+
var import_react44, import_jsx_runtime62, IFrameLoaderView, IFrameLoaderView_default;
|
|
1361
1361
|
var init_IFrameLoaderView = __esm({
|
|
1362
1362
|
"src/components/IFrameLoaderView.tsx"() {
|
|
1363
1363
|
"use strict";
|
|
1364
|
-
|
|
1364
|
+
import_react44 = __toESM(require("react"));
|
|
1365
1365
|
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
1366
1366
|
IFrameLoaderView = (props) => {
|
|
1367
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_react44.default.Fragment, { children: [
|
|
1368
1368
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
1369
1369
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
1370
1370
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -1409,19 +1409,19 @@ var IframeClient_exports = {};
|
|
|
1409
1409
|
__export(IframeClient_exports, {
|
|
1410
1410
|
default: () => IframeClient_default
|
|
1411
1411
|
});
|
|
1412
|
-
var
|
|
1412
|
+
var import_react45, import_jsx_runtime63, IframeClient, IframeClient_default;
|
|
1413
1413
|
var init_IframeClient = __esm({
|
|
1414
1414
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1415
1415
|
"use strict";
|
|
1416
1416
|
"use client";
|
|
1417
|
-
|
|
1417
|
+
import_react45 = __toESM(require("react"));
|
|
1418
1418
|
init_IFrameLoaderView();
|
|
1419
1419
|
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
1420
1420
|
IframeClient = ({ src }) => {
|
|
1421
|
-
const iframeRef = (0,
|
|
1422
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
1423
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
1424
|
-
(0,
|
|
1421
|
+
const iframeRef = (0, import_react45.useRef)(null);
|
|
1422
|
+
const [iframeHeight, setIframeHeight] = (0, import_react45.useState)("100%");
|
|
1423
|
+
const [isDataFound, setIsDataFound] = (0, import_react45.useState)(null);
|
|
1424
|
+
(0, import_react45.useEffect)(() => {
|
|
1425
1425
|
const handleReceiveMessage = (event) => {
|
|
1426
1426
|
const eventName = event?.data?.eventName;
|
|
1427
1427
|
const payload = event?.data?.payload;
|
|
@@ -1436,7 +1436,7 @@ var init_IframeClient = __esm({
|
|
|
1436
1436
|
window.addEventListener("message", handleReceiveMessage);
|
|
1437
1437
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
1438
1438
|
}, []);
|
|
1439
|
-
(0,
|
|
1439
|
+
(0, import_react45.useEffect)(() => {
|
|
1440
1440
|
const handleResize = () => {
|
|
1441
1441
|
if (iframeRef.current) {
|
|
1442
1442
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -1448,7 +1448,7 @@ var init_IframeClient = __esm({
|
|
|
1448
1448
|
const handleIframeLoad = () => {
|
|
1449
1449
|
setIsDataFound(true);
|
|
1450
1450
|
};
|
|
1451
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
1451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react45.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
1452
1452
|
"iframe",
|
|
1453
1453
|
{
|
|
1454
1454
|
ref: iframeRef,
|
|
@@ -1603,117 +1603,76 @@ var AssetUtility_default = AssetUtility;
|
|
|
1603
1603
|
// src/components/DeviceAssetSelector.tsx
|
|
1604
1604
|
init_HlsPlayer();
|
|
1605
1605
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1606
|
+
var FORMAT_CLASSES = {
|
|
1607
|
+
center: "justify-center",
|
|
1608
|
+
left: "justify-start",
|
|
1609
|
+
right: "justify-end"
|
|
1610
|
+
};
|
|
1606
1611
|
var DeviceAssetSelector = ({
|
|
1607
1612
|
assets,
|
|
1608
1613
|
assetBaseUrl,
|
|
1609
1614
|
session,
|
|
1610
|
-
// This should receive the session
|
|
1611
1615
|
width,
|
|
1612
1616
|
tag,
|
|
1613
|
-
customProps,
|
|
1614
1617
|
nodeProps,
|
|
1615
1618
|
device
|
|
1616
1619
|
}) => {
|
|
1617
|
-
console.log("\u{1F511} Session in DeviceAssetSelector:", session);
|
|
1618
1620
|
const targetTag = tag || nodeProps?.tag;
|
|
1619
|
-
const selectAssetByDevice = (assets2, currentDevice) =>
|
|
1620
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
1621
|
-
const exactMatch = assets2.find((asset) => asset.device === currentDevice);
|
|
1622
|
-
if (exactMatch) return exactMatch;
|
|
1623
|
-
const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
|
|
1624
|
-
if (noDeviceMatch) return noDeviceMatch;
|
|
1625
|
-
return void 0;
|
|
1626
|
-
};
|
|
1627
|
-
const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
|
|
1628
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
1629
|
-
if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
|
|
1630
|
-
const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
|
|
1631
|
-
if (taggedAssets.length === 0) {
|
|
1632
|
-
return selectAssetByDevice(assets2, currentDevice);
|
|
1633
|
-
}
|
|
1634
|
-
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
1635
|
-
if (exactTaggedMatch) return exactTaggedMatch;
|
|
1636
|
-
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
1637
|
-
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
1638
|
-
return void 0;
|
|
1639
|
-
};
|
|
1621
|
+
const selectAssetByDevice = (assets2, currentDevice) => assets2.find((a) => a.device === currentDevice) ?? assets2.find((a) => !a.device || a.device === "");
|
|
1640
1622
|
const selectAsset = () => {
|
|
1641
|
-
if (!assets
|
|
1623
|
+
if (!assets?.length) return void 0;
|
|
1642
1624
|
if (targetTag) {
|
|
1643
|
-
|
|
1625
|
+
const tagged = assets.filter((a) => a.tag === targetTag);
|
|
1626
|
+
if (tagged.length) {
|
|
1627
|
+
return tagged.find((a) => a.device === device) ?? tagged.find((a) => !a.device || a.device === "");
|
|
1628
|
+
}
|
|
1644
1629
|
}
|
|
1645
1630
|
return selectAssetByDevice(assets, device);
|
|
1646
1631
|
};
|
|
1647
1632
|
const selectedAsset = selectAsset();
|
|
1648
|
-
if (!selectedAsset)
|
|
1649
|
-
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
1650
|
-
return null;
|
|
1651
|
-
}
|
|
1633
|
+
if (!selectedAsset) return null;
|
|
1652
1634
|
const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
|
|
1653
1635
|
const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
|
|
1654
|
-
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
1655
1636
|
const title = selectedAsset.title || nodeProps?.title;
|
|
1656
|
-
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
1657
|
-
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
1658
1637
|
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
1659
|
-
const showControls =
|
|
1660
|
-
const loop =
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
}
|
|
1666
|
-
if (nodeProps?.borderRadius) {
|
|
1667
|
-
styles.borderRadius = nodeProps.borderRadius;
|
|
1668
|
-
}
|
|
1669
|
-
if (nodeProps?.width) {
|
|
1670
|
-
styles.width = nodeProps.width;
|
|
1671
|
-
}
|
|
1672
|
-
const FormatClass = {
|
|
1673
|
-
"center": "justify-center",
|
|
1674
|
-
"left": "justify-start",
|
|
1675
|
-
"right": "justify-end"
|
|
1638
|
+
const showControls = nodeProps?.showControls === "true";
|
|
1639
|
+
const loop = nodeProps?.loop === "true";
|
|
1640
|
+
const styles = {
|
|
1641
|
+
...nodeProps?.borderRadius && { borderRadius: nodeProps.borderRadius },
|
|
1642
|
+
...nodeProps?.width && { width: nodeProps.width },
|
|
1643
|
+
...nodeProps?.height && { height: nodeProps.height }
|
|
1676
1644
|
};
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
height: selectedAsset.intrinsicHeight
|
|
1707
|
-
}
|
|
1708
|
-
)
|
|
1709
|
-
);
|
|
1710
|
-
}
|
|
1711
|
-
};
|
|
1712
|
-
if (width) {
|
|
1713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width }, children: renderMedia() });
|
|
1714
|
-
}
|
|
1645
|
+
const renderMedia = () => isHls ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1646
|
+
HlsPlayer_default,
|
|
1647
|
+
{
|
|
1648
|
+
assetUrl: resolvedAssetUrl,
|
|
1649
|
+
posterUrl: resolvedThumbnailUrl,
|
|
1650
|
+
intrinsicWidth: selectedAsset.intrinsicWidth?.toString(),
|
|
1651
|
+
intrinsicHeight: selectedAsset.intrinsicHeight?.toString(),
|
|
1652
|
+
showControls,
|
|
1653
|
+
loop,
|
|
1654
|
+
playOptions: nodeProps?.playOptions,
|
|
1655
|
+
apiBaseUrl: assetBaseUrl,
|
|
1656
|
+
session
|
|
1657
|
+
}
|
|
1658
|
+
) : (
|
|
1659
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
1660
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1661
|
+
"img",
|
|
1662
|
+
{
|
|
1663
|
+
style: styles,
|
|
1664
|
+
loading: "lazy",
|
|
1665
|
+
className: "object-cover w-full",
|
|
1666
|
+
src: resolvedAssetUrl,
|
|
1667
|
+
width: selectedAsset.intrinsicWidth,
|
|
1668
|
+
height: selectedAsset.intrinsicHeight,
|
|
1669
|
+
alt: title || "Asset image"
|
|
1670
|
+
}
|
|
1671
|
+
)
|
|
1672
|
+
);
|
|
1673
|
+
if (width) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width }, children: renderMedia() });
|
|
1715
1674
|
if (nodeProps?.format) {
|
|
1716
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `flex ${
|
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `flex ${FORMAT_CLASSES[nodeProps.format] ?? ""}`, children: renderMedia() });
|
|
1717
1676
|
}
|
|
1718
1677
|
return renderMedia();
|
|
1719
1678
|
};
|
|
@@ -1734,12 +1693,15 @@ var MediaAsset = (props) => {
|
|
|
1734
1693
|
if (!assets || assets.length === 0) {
|
|
1735
1694
|
return null;
|
|
1736
1695
|
}
|
|
1696
|
+
const domainName = props.apiBaseUrl?.replace("https://", "");
|
|
1697
|
+
const assetBaseUrl = `https://cdn.g-assets.com/${domainName}`;
|
|
1737
1698
|
console.log(props.customProps?.tag, "Tag in MediaAsset");
|
|
1738
1699
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1739
1700
|
DeviceAssetSelector_default,
|
|
1740
1701
|
{
|
|
1741
1702
|
assets,
|
|
1742
1703
|
apiBaseUrl: props.apiBaseUrl,
|
|
1704
|
+
assetBaseUrl,
|
|
1743
1705
|
session: props,
|
|
1744
1706
|
width: props.width,
|
|
1745
1707
|
customProps: props.customProps,
|
|
@@ -3409,10 +3371,10 @@ InputControl.displayName = "InputControl";
|
|
|
3409
3371
|
var InputControl_default = InputControl;
|
|
3410
3372
|
|
|
3411
3373
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3412
|
-
var
|
|
3374
|
+
var import_react49 = __toESM(require("react"));
|
|
3413
3375
|
|
|
3414
3376
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3415
|
-
var
|
|
3377
|
+
var import_react35 = __toESM(require("react"));
|
|
3416
3378
|
|
|
3417
3379
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3418
3380
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -3494,15 +3456,12 @@ var LineBreakNode = () => {
|
|
|
3494
3456
|
var LineBreakNode_default = LineBreakNode;
|
|
3495
3457
|
|
|
3496
3458
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3497
|
-
var
|
|
3459
|
+
var import_react34 = __toESM(require("react"));
|
|
3498
3460
|
|
|
3499
3461
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3500
|
-
var import_react33 = __toESM(require("react"));
|
|
3501
3462
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
3502
3463
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3503
|
-
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3504
|
-
ssr: false
|
|
3505
|
-
});
|
|
3464
|
+
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
3506
3465
|
var getNestedValue = (obj, path) => {
|
|
3507
3466
|
if (!obj || !path) return void 0;
|
|
3508
3467
|
return path.split(".").reduce((current, key) => {
|
|
@@ -3516,20 +3475,13 @@ var ImageNode = (props) => {
|
|
|
3516
3475
|
const currentDevice = props.device;
|
|
3517
3476
|
if (props.node.device) {
|
|
3518
3477
|
const nodeDevice = props.node.device;
|
|
3519
|
-
if (nodeDevice !== currentDevice)
|
|
3520
|
-
return null;
|
|
3521
|
-
}
|
|
3478
|
+
if (nodeDevice !== currentDevice) return null;
|
|
3522
3479
|
}
|
|
3523
|
-
console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
|
|
3524
3480
|
if (props.node.imageUrl.startsWith("http")) {
|
|
3525
3481
|
imageUrl = props.node.imageUrl;
|
|
3526
|
-
posterUrl = AssetUtility_default.resolveUrl(
|
|
3527
|
-
props.assetBaseUrl,
|
|
3528
|
-
props.node.posterUrl
|
|
3529
|
-
);
|
|
3482
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3530
3483
|
} else if (props.dataitem && props.node.datafield) {
|
|
3531
3484
|
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
3532
|
-
console.log("ImageNode Datafield Image:", image);
|
|
3533
3485
|
try {
|
|
3534
3486
|
if (typeof image === "string") {
|
|
3535
3487
|
assets = JSON.parse(image);
|
|
@@ -3538,11 +3490,10 @@ var ImageNode = (props) => {
|
|
|
3538
3490
|
} else if (image && typeof image === "object") {
|
|
3539
3491
|
assets = [image];
|
|
3540
3492
|
}
|
|
3541
|
-
} catch
|
|
3542
|
-
console.error("Error parsing assets in ImageNode:", error);
|
|
3493
|
+
} catch {
|
|
3543
3494
|
}
|
|
3544
3495
|
if (assets && assets.length > 0) {
|
|
3545
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3546
3497
|
DeviceAssetSelector_default,
|
|
3547
3498
|
{
|
|
3548
3499
|
device: props.device,
|
|
@@ -3559,11 +3510,10 @@ var ImageNode = (props) => {
|
|
|
3559
3510
|
height: props.node.height,
|
|
3560
3511
|
format: props.node.format,
|
|
3561
3512
|
tag: props.node.tag,
|
|
3562
|
-
// Add tag to ImageNode if needed
|
|
3563
3513
|
placementCode: props.node.placementCode
|
|
3564
3514
|
}
|
|
3565
3515
|
}
|
|
3566
|
-
)
|
|
3516
|
+
);
|
|
3567
3517
|
} else {
|
|
3568
3518
|
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3569
3519
|
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
@@ -3572,56 +3522,45 @@ var ImageNode = (props) => {
|
|
|
3572
3522
|
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3573
3523
|
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3574
3524
|
}
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
if (props.node.height) styles.height = props.node.height;
|
|
3581
|
-
if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
|
|
3582
|
-
if (props.node.width) styles.width = props.node.width;
|
|
3583
|
-
const FormatClass = {
|
|
3584
|
-
"center": "justify-center",
|
|
3585
|
-
"left": "justify-start",
|
|
3586
|
-
"right": "justify-end"
|
|
3525
|
+
if (!imageUrl) return null;
|
|
3526
|
+
const styles = {
|
|
3527
|
+
...props.node.height && { height: props.node.height },
|
|
3528
|
+
...props.node.borderRadius && { borderRadius: props.node.borderRadius },
|
|
3529
|
+
...props.node.width && { width: props.node.width }
|
|
3587
3530
|
};
|
|
3588
|
-
{
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
const renderMedia = () => {
|
|
3593
|
-
if (isHls) {
|
|
3594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3595
|
-
HlsPlayer2,
|
|
3596
|
-
{
|
|
3597
|
-
assetUrl: imageUrl,
|
|
3598
|
-
posterUrl,
|
|
3599
|
-
intrinsicWidth: props.node.intrinsicWidth,
|
|
3600
|
-
intrinsicHeight: props.node.intrinsicHeight,
|
|
3601
|
-
showControls: props.node.showControls === "true",
|
|
3602
|
-
loop: props.node.loop === "true",
|
|
3603
|
-
playOptions: props.node.playOptions,
|
|
3604
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3605
|
-
session: props.session
|
|
3606
|
-
}
|
|
3607
|
-
);
|
|
3608
|
-
} else {
|
|
3609
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3610
|
-
"img",
|
|
3611
|
-
{
|
|
3612
|
-
style: styles,
|
|
3613
|
-
loading: "lazy",
|
|
3614
|
-
className: "object-cover",
|
|
3615
|
-
src: imageUrl,
|
|
3616
|
-
width: props.node.intrinsicWidth,
|
|
3617
|
-
alt: props.node.title,
|
|
3618
|
-
height: props.node.intrinsicHeight
|
|
3619
|
-
}
|
|
3620
|
-
) });
|
|
3621
|
-
}
|
|
3531
|
+
const FORMAT_CLASSES2 = {
|
|
3532
|
+
center: "justify-center",
|
|
3533
|
+
left: "justify-start",
|
|
3534
|
+
right: "justify-end"
|
|
3622
3535
|
};
|
|
3536
|
+
const isHls = imageUrl.endsWith(".m3u8");
|
|
3537
|
+
const renderMedia = () => isHls ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3538
|
+
HlsPlayer2,
|
|
3539
|
+
{
|
|
3540
|
+
assetUrl: imageUrl,
|
|
3541
|
+
posterUrl,
|
|
3542
|
+
intrinsicWidth: props.node.intrinsicWidth,
|
|
3543
|
+
intrinsicHeight: props.node.intrinsicHeight,
|
|
3544
|
+
showControls: props.node.showControls === "true",
|
|
3545
|
+
loop: props.node.loop === "true",
|
|
3546
|
+
playOptions: props.node.playOptions,
|
|
3547
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3548
|
+
session: props.session
|
|
3549
|
+
}
|
|
3550
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3551
|
+
"img",
|
|
3552
|
+
{
|
|
3553
|
+
style: styles,
|
|
3554
|
+
loading: "lazy",
|
|
3555
|
+
className: "object-cover",
|
|
3556
|
+
src: imageUrl,
|
|
3557
|
+
width: props.node.intrinsicWidth,
|
|
3558
|
+
alt: props.node.title,
|
|
3559
|
+
height: props.node.intrinsicHeight
|
|
3560
|
+
}
|
|
3561
|
+
);
|
|
3623
3562
|
if (props.node.width) {
|
|
3624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${
|
|
3563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${FORMAT_CLASSES2[props.node.format] ?? ""}`, children: renderMedia() });
|
|
3625
3564
|
}
|
|
3626
3565
|
return renderMedia();
|
|
3627
3566
|
};
|
|
@@ -3683,7 +3622,7 @@ var LinkNode = (props) => {
|
|
|
3683
3622
|
console.warn("Unknown node type:", childNode.type);
|
|
3684
3623
|
return null;
|
|
3685
3624
|
}
|
|
3686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3687
3626
|
SelectedNode,
|
|
3688
3627
|
{
|
|
3689
3628
|
node: childNode,
|
|
@@ -3922,7 +3861,7 @@ var ParagraphNode = (props) => {
|
|
|
3922
3861
|
if (isInlineOnlyParent) {
|
|
3923
3862
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3924
3863
|
const SelectedNode = NodeTypes2[node.type];
|
|
3925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3926
3865
|
SelectedNode,
|
|
3927
3866
|
{
|
|
3928
3867
|
node,
|
|
@@ -3937,7 +3876,7 @@ var ParagraphNode = (props) => {
|
|
|
3937
3876
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3938
3877
|
hasChildren && props.node.children.map((node, index) => {
|
|
3939
3878
|
const SelectedNode = NodeTypes2[node.type];
|
|
3940
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3941
3880
|
SelectedNode,
|
|
3942
3881
|
{
|
|
3943
3882
|
node,
|
|
@@ -3954,7 +3893,7 @@ var ParagraphNode = (props) => {
|
|
|
3954
3893
|
var ParagraphNode_default = ParagraphNode;
|
|
3955
3894
|
|
|
3956
3895
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3957
|
-
var
|
|
3896
|
+
var import_react36 = __toESM(require("react"));
|
|
3958
3897
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3959
3898
|
var HeadingNode = (props) => {
|
|
3960
3899
|
const NodeTypes2 = {
|
|
@@ -3971,22 +3910,22 @@ var HeadingNode = (props) => {
|
|
|
3971
3910
|
{
|
|
3972
3911
|
}
|
|
3973
3912
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3974
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children:
|
|
3913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: import_react36.default.createElement(
|
|
3975
3914
|
HeadingTag,
|
|
3976
3915
|
{ className: formatClasses },
|
|
3977
3916
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3978
3917
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3979
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3980
3919
|
})
|
|
3981
3920
|
) });
|
|
3982
3921
|
};
|
|
3983
3922
|
var HeadingNode_default = HeadingNode;
|
|
3984
3923
|
|
|
3985
3924
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3986
|
-
var
|
|
3925
|
+
var import_react38 = __toESM(require("react"));
|
|
3987
3926
|
|
|
3988
3927
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3989
|
-
var
|
|
3928
|
+
var import_react37 = __toESM(require("react"));
|
|
3990
3929
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3991
3930
|
var ListItemNode = (props) => {
|
|
3992
3931
|
const NodeTypes2 = {
|
|
@@ -4015,7 +3954,7 @@ var ListItemNode = (props) => {
|
|
|
4015
3954
|
}
|
|
4016
3955
|
} else {
|
|
4017
3956
|
foundFirstBreak = false;
|
|
4018
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4019
3958
|
}
|
|
4020
3959
|
}) });
|
|
4021
3960
|
};
|
|
@@ -4027,21 +3966,21 @@ var ListNode = (props) => {
|
|
|
4027
3966
|
const NodeTypes2 = {
|
|
4028
3967
|
listitem: ListItemNode_default
|
|
4029
3968
|
};
|
|
4030
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react38.default.Fragment, { children: [
|
|
4031
3970
|
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4032
3971
|
const SelectedNode = NodeTypes2[node.type];
|
|
4033
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4034
3973
|
}) }),
|
|
4035
3974
|
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4036
3975
|
const SelectedNode = NodeTypes2[node.type];
|
|
4037
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4038
3977
|
}) })
|
|
4039
3978
|
] });
|
|
4040
3979
|
};
|
|
4041
3980
|
var ListNode_default = ListNode;
|
|
4042
3981
|
|
|
4043
3982
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4044
|
-
var
|
|
3983
|
+
var import_react39 = __toESM(require("react"));
|
|
4045
3984
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4046
3985
|
var QuoteNode = (props) => {
|
|
4047
3986
|
const NodeTypes2 = {
|
|
@@ -4051,13 +3990,13 @@ var QuoteNode = (props) => {
|
|
|
4051
3990
|
};
|
|
4052
3991
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4053
3992
|
const SelectedNode = NodeTypes2[node.type];
|
|
4054
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4055
3994
|
}) });
|
|
4056
3995
|
};
|
|
4057
3996
|
var QuoteNode_default = QuoteNode;
|
|
4058
3997
|
|
|
4059
3998
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4060
|
-
var
|
|
3999
|
+
var import_react41 = __toESM(require("react"));
|
|
4061
4000
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4062
4001
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4063
4002
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
@@ -4084,7 +4023,7 @@ var CodeNode = (props) => {
|
|
|
4084
4023
|
] }),
|
|
4085
4024
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
4086
4025
|
const SelectedNode = NodeTypes2[node.type];
|
|
4087
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4088
4027
|
SelectedNode,
|
|
4089
4028
|
{
|
|
4090
4029
|
node,
|
|
@@ -4106,7 +4045,7 @@ var HorizontalRuleNode = () => {
|
|
|
4106
4045
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4107
4046
|
|
|
4108
4047
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4109
|
-
var
|
|
4048
|
+
var import_react42 = __toESM(require("react"));
|
|
4110
4049
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4111
4050
|
var WidgetNode = (props) => {
|
|
4112
4051
|
const getWidgetParameters = () => {
|
|
@@ -4180,7 +4119,7 @@ var WidgetNode = (props) => {
|
|
|
4180
4119
|
}
|
|
4181
4120
|
return (
|
|
4182
4121
|
// eslint-disable-next-line react-hooks/static-components
|
|
4183
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4184
4123
|
WidgetRenderer,
|
|
4185
4124
|
{
|
|
4186
4125
|
params: widgetParams,
|
|
@@ -4197,7 +4136,7 @@ var WidgetNode = (props) => {
|
|
|
4197
4136
|
var WidgetNode_default = WidgetNode;
|
|
4198
4137
|
|
|
4199
4138
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4200
|
-
var
|
|
4139
|
+
var import_react43 = __toESM(require("react"));
|
|
4201
4140
|
|
|
4202
4141
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4203
4142
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -4282,16 +4221,16 @@ var FormContainerNode = (props) => {
|
|
|
4282
4221
|
["input-control"]: InputControlNode_default
|
|
4283
4222
|
};
|
|
4284
4223
|
const { node } = props;
|
|
4285
|
-
const formRef = (0,
|
|
4224
|
+
const formRef = (0, import_react43.useRef)(null);
|
|
4286
4225
|
const initialState = {
|
|
4287
4226
|
inputValues: {},
|
|
4288
4227
|
lastPropertyChanged: ""
|
|
4289
4228
|
};
|
|
4290
|
-
const [formState, dispatch] = (0,
|
|
4291
|
-
const handleInputChange = (0,
|
|
4229
|
+
const [formState, dispatch] = (0, import_react43.useReducer)(FormReducer_default, initialState);
|
|
4230
|
+
const handleInputChange = (0, import_react43.useCallback)((updatedValues) => {
|
|
4292
4231
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4293
4232
|
}, [dispatch]);
|
|
4294
|
-
(0,
|
|
4233
|
+
(0, import_react43.useEffect)(() => {
|
|
4295
4234
|
const fetchInitialData = async () => {
|
|
4296
4235
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4297
4236
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4311,7 +4250,7 @@ var FormContainerNode = (props) => {
|
|
|
4311
4250
|
{
|
|
4312
4251
|
}
|
|
4313
4252
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4314
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react43.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4315
4254
|
InputControlNode_default,
|
|
4316
4255
|
{
|
|
4317
4256
|
value: formState.inputValues[node2.name],
|
|
@@ -4326,7 +4265,7 @@ var FormContainerNode = (props) => {
|
|
|
4326
4265
|
var FormContainerNode_default = FormContainerNode;
|
|
4327
4266
|
|
|
4328
4267
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4329
|
-
var
|
|
4268
|
+
var import_react48 = __toESM(require("react"));
|
|
4330
4269
|
|
|
4331
4270
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4332
4271
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
@@ -4351,7 +4290,7 @@ var EmbedNode_default = EmbedNode;
|
|
|
4351
4290
|
init_ServiceClient();
|
|
4352
4291
|
|
|
4353
4292
|
// src/components/Slider.tsx
|
|
4354
|
-
var
|
|
4293
|
+
var import_react46 = __toESM(require("react"));
|
|
4355
4294
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4356
4295
|
var Slider = ({
|
|
4357
4296
|
children,
|
|
@@ -4370,13 +4309,13 @@ var Slider = ({
|
|
|
4370
4309
|
pillStyle = "cumulative",
|
|
4371
4310
|
progressPosition = "bottom"
|
|
4372
4311
|
}) => {
|
|
4373
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4374
|
-
const [transition, setTransition] = (0,
|
|
4375
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4312
|
+
const [currentSlide, setCurrentSlide] = (0, import_react46.useState)(0);
|
|
4313
|
+
const [transition, setTransition] = (0, import_react46.useState)(true);
|
|
4314
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react46.useState)(
|
|
4376
4315
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4377
4316
|
);
|
|
4378
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4379
|
-
(0,
|
|
4317
|
+
const [isPlaying, setIsPlaying] = (0, import_react46.useState)(autoplay);
|
|
4318
|
+
(0, import_react46.useEffect)(() => {
|
|
4380
4319
|
if (typeof slidesToShow === "number") return;
|
|
4381
4320
|
const handleResize = () => {
|
|
4382
4321
|
if (window.innerWidth >= 1024) {
|
|
@@ -4391,7 +4330,7 @@ var Slider = ({
|
|
|
4391
4330
|
window.addEventListener("resize", handleResize);
|
|
4392
4331
|
return () => window.removeEventListener("resize", handleResize);
|
|
4393
4332
|
}, [slidesToShow]);
|
|
4394
|
-
(0,
|
|
4333
|
+
(0, import_react46.useEffect)(() => {
|
|
4395
4334
|
if (!autoplay) return;
|
|
4396
4335
|
const timer = setInterval(() => {
|
|
4397
4336
|
if (isPlaying) {
|
|
@@ -4400,7 +4339,7 @@ var Slider = ({
|
|
|
4400
4339
|
}, autoplay_speed);
|
|
4401
4340
|
return () => clearInterval(timer);
|
|
4402
4341
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4403
|
-
const totalSlides =
|
|
4342
|
+
const totalSlides = import_react46.Children.count(children);
|
|
4404
4343
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4405
4344
|
const nextSlide = () => {
|
|
4406
4345
|
if (currentSlide >= maxSlide) {
|
|
@@ -4445,8 +4384,8 @@ var Slider = ({
|
|
|
4445
4384
|
}
|
|
4446
4385
|
};
|
|
4447
4386
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4448
|
-
const slides =
|
|
4449
|
-
if (!
|
|
4387
|
+
const slides = import_react46.Children.map(children, (child, index) => {
|
|
4388
|
+
if (!import_react46.default.isValidElement(child)) return null;
|
|
4450
4389
|
const childProps = child.props;
|
|
4451
4390
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4452
4391
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
@@ -4454,7 +4393,7 @@ var Slider = ({
|
|
|
4454
4393
|
{
|
|
4455
4394
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4456
4395
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4457
|
-
children: (0,
|
|
4396
|
+
children: (0, import_react46.cloneElement)(child, {
|
|
4458
4397
|
className: mergedClassName
|
|
4459
4398
|
})
|
|
4460
4399
|
},
|
|
@@ -4567,13 +4506,13 @@ var ProgressPill = ({
|
|
|
4567
4506
|
currentSlide,
|
|
4568
4507
|
totalSlides
|
|
4569
4508
|
}) => {
|
|
4570
|
-
const [progress, setProgress] = (0,
|
|
4571
|
-
(0,
|
|
4509
|
+
const [progress, setProgress] = (0, import_react46.useState)(0);
|
|
4510
|
+
(0, import_react46.useEffect)(() => {
|
|
4572
4511
|
if (active) {
|
|
4573
4512
|
setProgress(0);
|
|
4574
4513
|
}
|
|
4575
4514
|
}, [active, index]);
|
|
4576
|
-
(0,
|
|
4515
|
+
(0, import_react46.useEffect)(() => {
|
|
4577
4516
|
if (!active || !isPlaying) {
|
|
4578
4517
|
if (!active) {
|
|
4579
4518
|
setProgress(0);
|
|
@@ -5017,12 +4956,12 @@ var NoDataFound = () => {
|
|
|
5017
4956
|
var NoDataFound_default = NoDataFound;
|
|
5018
4957
|
|
|
5019
4958
|
// src/components/Pagination.tsx
|
|
5020
|
-
var
|
|
4959
|
+
var import_react47 = require("react");
|
|
5021
4960
|
init_StyleTypes();
|
|
5022
4961
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5023
4962
|
var Pagination = (props) => {
|
|
5024
4963
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5025
|
-
const builder = (0,
|
|
4964
|
+
const builder = (0, import_react47.useMemo)(() => {
|
|
5026
4965
|
const b = new OdataBuilder(path);
|
|
5027
4966
|
if (query) b.setQuery(query);
|
|
5028
4967
|
return b;
|
|
@@ -5547,7 +5486,7 @@ var DivContainer = async (props) => {
|
|
|
5547
5486
|
}
|
|
5548
5487
|
const SelectedNode = NodeTypes2[node.type];
|
|
5549
5488
|
if (!SelectedNode) return null;
|
|
5550
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5551
5490
|
SelectedNode,
|
|
5552
5491
|
{
|
|
5553
5492
|
node,
|
|
@@ -5649,9 +5588,9 @@ var DivContainer = async (props) => {
|
|
|
5649
5588
|
props.node.autoFormat && "auto-format",
|
|
5650
5589
|
props.node.bgClass
|
|
5651
5590
|
].filter(Boolean).join(" ");
|
|
5652
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react48.default.Fragment, { children: [
|
|
5653
5592
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5654
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5655
5594
|
Wrapper,
|
|
5656
5595
|
{
|
|
5657
5596
|
id: guid,
|
|
@@ -5660,7 +5599,7 @@ var DivContainer = async (props) => {
|
|
|
5660
5599
|
...wrapperProps,
|
|
5661
5600
|
children: dataToRender.map(
|
|
5662
5601
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5663
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5602
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: child }, i)
|
|
5664
5603
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5665
5604
|
)
|
|
5666
5605
|
}
|
|
@@ -5699,11 +5638,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5699
5638
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5700
5639
|
rootNode = pageBodyTree.root;
|
|
5701
5640
|
}
|
|
5702
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5703
5642
|
{
|
|
5704
5643
|
}
|
|
5705
5644
|
const SelectedNode = NodeTypes[node.type];
|
|
5706
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5707
5646
|
SelectedNode,
|
|
5708
5647
|
{
|
|
5709
5648
|
node,
|
|
@@ -5719,7 +5658,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5719
5658
|
device: props.device,
|
|
5720
5659
|
widgetRenderer: props.widgetRenderer
|
|
5721
5660
|
}
|
|
5722
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5661
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5723
5662
|
SelectedNode,
|
|
5724
5663
|
{
|
|
5725
5664
|
node,
|
|
@@ -5740,13 +5679,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5740
5679
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5741
5680
|
|
|
5742
5681
|
// src/components/Toast.tsx
|
|
5743
|
-
var
|
|
5682
|
+
var import_react50 = require("react");
|
|
5744
5683
|
init_ToastService();
|
|
5745
5684
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5746
5685
|
var Toast = () => {
|
|
5747
|
-
const [showToast, setShowToast] = (0,
|
|
5748
|
-
const [message, setMessage] = (0,
|
|
5749
|
-
const [messageType, setMessageType] = (0,
|
|
5686
|
+
const [showToast, setShowToast] = (0, import_react50.useState)(false);
|
|
5687
|
+
const [message, setMessage] = (0, import_react50.useState)("");
|
|
5688
|
+
const [messageType, setMessageType] = (0, import_react50.useState)("error");
|
|
5750
5689
|
ToastService_default.showError = function(message2) {
|
|
5751
5690
|
setShowToast(true);
|
|
5752
5691
|
setMessage(message2);
|
|
@@ -5854,22 +5793,22 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5854
5793
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
5855
5794
|
|
|
5856
5795
|
// src/components/dataForm/DataList.tsx
|
|
5857
|
-
var
|
|
5796
|
+
var import_react53 = __toESM(require("react"));
|
|
5858
5797
|
var import_navigation2 = require("next/navigation");
|
|
5859
5798
|
|
|
5860
5799
|
// src/components/dataForm/NoContentView.tsx
|
|
5861
|
-
var
|
|
5800
|
+
var import_react51 = __toESM(require("react"));
|
|
5862
5801
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5863
5802
|
var NoContentView = (props) => {
|
|
5864
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react51.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
5865
5804
|
};
|
|
5866
5805
|
var NoContentView_default = NoContentView;
|
|
5867
5806
|
|
|
5868
5807
|
// src/components/dataForm/ContentView.tsx
|
|
5869
|
-
var
|
|
5808
|
+
var import_react52 = __toESM(require("react"));
|
|
5870
5809
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5871
5810
|
var ContentView = (props) => {
|
|
5872
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
5811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_react52.default.Fragment, { children: [
|
|
5873
5812
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
5874
5813
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
5875
5814
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -5918,8 +5857,8 @@ var DataList = (props) => {
|
|
|
5918
5857
|
let activePageNumber = 0;
|
|
5919
5858
|
let pages = 0;
|
|
5920
5859
|
console.log(props.addLinkText);
|
|
5921
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
5922
|
-
(0,
|
|
5860
|
+
const [isDataFound, setIsDataFound] = (0, import_react53.useState)(null);
|
|
5861
|
+
(0, import_react53.useEffect)(() => {
|
|
5923
5862
|
if (props?.dataset) {
|
|
5924
5863
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
5925
5864
|
setIsDataFound(true);
|
|
@@ -5941,8 +5880,8 @@ var DataList = (props) => {
|
|
|
5941
5880
|
inputValues: {},
|
|
5942
5881
|
lastPropertyChanged: ""
|
|
5943
5882
|
};
|
|
5944
|
-
const [formState, dispatch] = (0,
|
|
5945
|
-
const handleFilterChange = (0,
|
|
5883
|
+
const [formState, dispatch] = (0, import_react53.useReducer)(FormReducer_default, initialState);
|
|
5884
|
+
const handleFilterChange = (0, import_react53.useCallback)(
|
|
5946
5885
|
(updatedValues) => {
|
|
5947
5886
|
dispatch({
|
|
5948
5887
|
type: FORM_INPUT_UPDATE,
|
|
@@ -5988,7 +5927,7 @@ var DataList = (props) => {
|
|
|
5988
5927
|
const renderPageNumbers = () => {
|
|
5989
5928
|
if (pages <= 10) {
|
|
5990
5929
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5991
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5930
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5992
5931
|
Hyperlink,
|
|
5993
5932
|
{
|
|
5994
5933
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6002,7 +5941,7 @@ var DataList = (props) => {
|
|
|
6002
5941
|
const showLastPages = activePageNumber > pages - 5;
|
|
6003
5942
|
if (showFirstPages) {
|
|
6004
5943
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6005
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5944
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6006
5945
|
Hyperlink,
|
|
6007
5946
|
{
|
|
6008
5947
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6068,7 +6007,7 @@ var DataList = (props) => {
|
|
|
6068
6007
|
),
|
|
6069
6008
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6070
6009
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6071
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6010
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6072
6011
|
Hyperlink,
|
|
6073
6012
|
{
|
|
6074
6013
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6100,7 +6039,7 @@ var DataList = (props) => {
|
|
|
6100
6039
|
Array.from(
|
|
6101
6040
|
{ length: 5 },
|
|
6102
6041
|
(_, index) => activePageNumber - 2 + index
|
|
6103
|
-
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6042
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6104
6043
|
Hyperlink,
|
|
6105
6044
|
{
|
|
6106
6045
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6146,7 +6085,7 @@ var DataList = (props) => {
|
|
|
6146
6085
|
}
|
|
6147
6086
|
}
|
|
6148
6087
|
};
|
|
6149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react53.default.Fragment, { children: [
|
|
6150
6089
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ContentView_default, { isDataFound, children: [
|
|
6151
6090
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6152
6091
|
"div",
|
|
@@ -6224,7 +6163,7 @@ var DataList = (props) => {
|
|
|
6224
6163
|
}
|
|
6225
6164
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6226
6165
|
console.log("column", column);
|
|
6227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6228
6167
|
"td",
|
|
6229
6168
|
{
|
|
6230
6169
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -6376,7 +6315,7 @@ var DataList = (props) => {
|
|
|
6376
6315
|
var DataList_default = DataList;
|
|
6377
6316
|
|
|
6378
6317
|
// src/components/dataForm/DataListRenderer.tsx
|
|
6379
|
-
var
|
|
6318
|
+
var import_react54 = __toESM(require("react"));
|
|
6380
6319
|
init_ServiceClient();
|
|
6381
6320
|
var import_navigation3 = require("next/navigation");
|
|
6382
6321
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
@@ -6433,14 +6372,14 @@ var DataListRenderer = ({
|
|
|
6433
6372
|
widgetProps
|
|
6434
6373
|
}) => {
|
|
6435
6374
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
6436
|
-
const [columns, setColumns] = (0,
|
|
6437
|
-
const [dataset, setDataset] = (0,
|
|
6438
|
-
const [filter, setFilters] = (0,
|
|
6439
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
6440
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
6441
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
6375
|
+
const [columns, setColumns] = (0, import_react54.useState)([]);
|
|
6376
|
+
const [dataset, setDataset] = (0, import_react54.useState)();
|
|
6377
|
+
const [filter, setFilters] = (0, import_react54.useState)([]);
|
|
6378
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react54.useState)("");
|
|
6379
|
+
const [addLinkText, setAddLinkText] = (0, import_react54.useState)("");
|
|
6380
|
+
const [serviceRoute, setServiceRoute] = (0, import_react54.useState)("");
|
|
6442
6381
|
const pathname = (0, import_navigation3.usePathname)();
|
|
6443
|
-
(0,
|
|
6382
|
+
(0, import_react54.useEffect)(() => {
|
|
6444
6383
|
if (!formDefinition) return;
|
|
6445
6384
|
setColumns(mapApiToColumns(formDefinition));
|
|
6446
6385
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -6453,7 +6392,7 @@ var DataListRenderer = ({
|
|
|
6453
6392
|
setAddLinkHref(resolvedAddLinkHref);
|
|
6454
6393
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
6455
6394
|
}, [formDefinition, params]);
|
|
6456
|
-
(0,
|
|
6395
|
+
(0, import_react54.useEffect)(() => {
|
|
6457
6396
|
const fetchData = async () => {
|
|
6458
6397
|
if (!serviceRoute) return;
|
|
6459
6398
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -6465,10 +6404,10 @@ var DataListRenderer = ({
|
|
|
6465
6404
|
};
|
|
6466
6405
|
fetchData();
|
|
6467
6406
|
}, [serviceRoute, query, params]);
|
|
6468
|
-
const [tabItem, setTabItem] = (0,
|
|
6407
|
+
const [tabItem, setTabItem] = (0, import_react54.useState)();
|
|
6469
6408
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6470
6409
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6471
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_react54.default.Fragment, { children: [
|
|
6472
6411
|
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6473
6412
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6474
6413
|
DataList_default,
|
|
@@ -6489,12 +6428,12 @@ var DataListRenderer = ({
|
|
|
6489
6428
|
var DataListRenderer_default = DataListRenderer;
|
|
6490
6429
|
|
|
6491
6430
|
// src/components/dataForm/DataForm.tsx
|
|
6492
|
-
var
|
|
6431
|
+
var import_react56 = __toESM(require("react"));
|
|
6493
6432
|
init_Button();
|
|
6494
6433
|
init_StyleTypes();
|
|
6495
6434
|
|
|
6496
6435
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6497
|
-
var
|
|
6436
|
+
var import_react55 = __toESM(require("react"));
|
|
6498
6437
|
|
|
6499
6438
|
// src/components/dataForm/StyleTypes.tsx
|
|
6500
6439
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -6532,7 +6471,7 @@ var DataFormChildSection = (props) => {
|
|
|
6532
6471
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
6533
6472
|
};
|
|
6534
6473
|
const childItemsToRender = getChildItemsForRendering();
|
|
6535
|
-
const handleChildInputChange = (0,
|
|
6474
|
+
const handleChildInputChange = (0, import_react55.useCallback)(
|
|
6536
6475
|
(updatedValues) => {
|
|
6537
6476
|
if (isOneToOne) {
|
|
6538
6477
|
props.callback({
|
|
@@ -6559,7 +6498,7 @@ var DataFormChildSection = (props) => {
|
|
|
6559
6498
|
},
|
|
6560
6499
|
[props, isOneToOne, childItemsToRender]
|
|
6561
6500
|
);
|
|
6562
|
-
const onAddRow = (0,
|
|
6501
|
+
const onAddRow = (0, import_react55.useCallback)(() => {
|
|
6563
6502
|
props.callback({
|
|
6564
6503
|
sectionName: props.section.name,
|
|
6565
6504
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -6568,7 +6507,7 @@ var DataFormChildSection = (props) => {
|
|
|
6568
6507
|
rowIndex: -1
|
|
6569
6508
|
});
|
|
6570
6509
|
}, [props]);
|
|
6571
|
-
const onDeleteRow = (0,
|
|
6510
|
+
const onDeleteRow = (0, import_react55.useCallback)(
|
|
6572
6511
|
(filteredIndex) => {
|
|
6573
6512
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
6574
6513
|
if (visibleItem) {
|
|
@@ -6588,7 +6527,7 @@ var DataFormChildSection = (props) => {
|
|
|
6588
6527
|
childItemsToRender,
|
|
6589
6528
|
allChildItems: childItems
|
|
6590
6529
|
});
|
|
6591
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
6592
6531
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
6593
6532
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
6594
6533
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
@@ -6610,7 +6549,7 @@ var DataFormChildSection = (props) => {
|
|
|
6610
6549
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6611
6550
|
const { item, originalIndex } = visibleItem;
|
|
6612
6551
|
const rowKey = originalIndex;
|
|
6613
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react55.default.Fragment, { children: section.sectionRows.map(
|
|
6614
6553
|
(sectionRow, sectionRowIndex) => {
|
|
6615
6554
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6616
6555
|
"tr",
|
|
@@ -6681,7 +6620,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
6681
6620
|
// src/components/dataForm/DataForm.tsx
|
|
6682
6621
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6683
6622
|
var DataForm = (props) => {
|
|
6684
|
-
const formRef = (0,
|
|
6623
|
+
const formRef = (0, import_react56.useRef)(null);
|
|
6685
6624
|
console.log(props.dataItem, "dssads");
|
|
6686
6625
|
const initialState = {
|
|
6687
6626
|
inputValues: {},
|
|
@@ -6690,9 +6629,9 @@ var DataForm = (props) => {
|
|
|
6690
6629
|
const childInitialState = {
|
|
6691
6630
|
inputValues: []
|
|
6692
6631
|
};
|
|
6693
|
-
const [formState, dispatch] = (0,
|
|
6632
|
+
const [formState, dispatch] = (0, import_react56.useReducer)(FormReducer_default, initialState);
|
|
6694
6633
|
console.log(props.sections, "sections");
|
|
6695
|
-
const clearHiddenChildSections = (0,
|
|
6634
|
+
const clearHiddenChildSections = (0, import_react56.useCallback)(
|
|
6696
6635
|
(changedProperty, newValues) => {
|
|
6697
6636
|
if (!props.sections) return;
|
|
6698
6637
|
const allChildSections = [];
|
|
@@ -6730,7 +6669,7 @@ var DataForm = (props) => {
|
|
|
6730
6669
|
},
|
|
6731
6670
|
[props.sections, formState.inputValues]
|
|
6732
6671
|
);
|
|
6733
|
-
const handleInputChange = (0,
|
|
6672
|
+
const handleInputChange = (0, import_react56.useCallback)(
|
|
6734
6673
|
async (updatedValues) => {
|
|
6735
6674
|
dispatch({
|
|
6736
6675
|
type: FORM_INPUT_UPDATE,
|
|
@@ -6745,7 +6684,7 @@ var DataForm = (props) => {
|
|
|
6745
6684
|
},
|
|
6746
6685
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
6747
6686
|
);
|
|
6748
|
-
const fetchData = (0,
|
|
6687
|
+
const fetchData = (0, import_react56.useCallback)(async () => {
|
|
6749
6688
|
if (!props.rules) return;
|
|
6750
6689
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
6751
6690
|
return;
|
|
@@ -6776,7 +6715,7 @@ var DataForm = (props) => {
|
|
|
6776
6715
|
console.error("Error fetching data:", error);
|
|
6777
6716
|
}
|
|
6778
6717
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
6779
|
-
(0,
|
|
6718
|
+
(0, import_react56.useEffect)(() => {
|
|
6780
6719
|
fetchData();
|
|
6781
6720
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
6782
6721
|
function replacePlaceholders(template, context, params) {
|
|
@@ -6796,7 +6735,7 @@ var DataForm = (props) => {
|
|
|
6796
6735
|
}
|
|
6797
6736
|
);
|
|
6798
6737
|
}
|
|
6799
|
-
const handleChildSectionChangeCallback = (0,
|
|
6738
|
+
const handleChildSectionChangeCallback = (0, import_react56.useCallback)(
|
|
6800
6739
|
(params) => {
|
|
6801
6740
|
dispatch({
|
|
6802
6741
|
type: params.actionType,
|
|
@@ -6841,7 +6780,7 @@ var DataForm = (props) => {
|
|
|
6841
6780
|
});
|
|
6842
6781
|
return cloned;
|
|
6843
6782
|
}
|
|
6844
|
-
const onClick = (0,
|
|
6783
|
+
const onClick = (0, import_react56.useCallback)(async () => {
|
|
6845
6784
|
if (props.onClick) {
|
|
6846
6785
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
6847
6786
|
const normalizedValues = normalizeChildSections(
|
|
@@ -6857,21 +6796,21 @@ var DataForm = (props) => {
|
|
|
6857
6796
|
return { isSuccessful: true };
|
|
6858
6797
|
}
|
|
6859
6798
|
}, [formState, props]);
|
|
6860
|
-
const handleAdditionalOnClick = (0,
|
|
6799
|
+
const handleAdditionalOnClick = (0, import_react56.useCallback)(async () => {
|
|
6861
6800
|
if (props.additionalActions?.onClick) {
|
|
6862
6801
|
return await props.additionalActions.onClick(formState);
|
|
6863
6802
|
} else {
|
|
6864
6803
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
6865
6804
|
}
|
|
6866
6805
|
}, [formState, props]);
|
|
6867
|
-
const onDelete = (0,
|
|
6806
|
+
const onDelete = (0, import_react56.useCallback)(async () => {
|
|
6868
6807
|
if (props.onDelete) {
|
|
6869
6808
|
return await props.onDelete(formState);
|
|
6870
6809
|
} else {
|
|
6871
6810
|
return { isSuccessful: true };
|
|
6872
6811
|
}
|
|
6873
6812
|
}, [formState, props]);
|
|
6874
|
-
(0,
|
|
6813
|
+
(0, import_react56.useEffect)(() => {
|
|
6875
6814
|
if (props.dataItem) {
|
|
6876
6815
|
dispatch({
|
|
6877
6816
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -6899,7 +6838,7 @@ var DataForm = (props) => {
|
|
|
6899
6838
|
return false;
|
|
6900
6839
|
}
|
|
6901
6840
|
}
|
|
6902
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react56.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
6903
6842
|
props.title && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "inline-flex items-center gap-2 px-6 py-3 border border-neutral-200 bg-white shadow-sm rounded-t-md", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6904
6843
|
"div",
|
|
6905
6844
|
{
|
|
@@ -6933,7 +6872,7 @@ var DataForm = (props) => {
|
|
|
6933
6872
|
}
|
|
6934
6873
|
},
|
|
6935
6874
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
6936
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react56.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
6937
6876
|
section.sectionRows?.map(
|
|
6938
6877
|
(sectionRow, sectionRowIndex) => {
|
|
6939
6878
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6944,7 +6883,7 @@ var DataForm = (props) => {
|
|
|
6944
6883
|
sectionRow.visible
|
|
6945
6884
|
);
|
|
6946
6885
|
}
|
|
6947
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react56.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
6948
6887
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6949
6888
|
"div",
|
|
6950
6889
|
{
|