@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260522061527 → 0.8.1-dev.20260523060518
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 +217 -287
- package/dist/index.mjs +164 -234
- 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,73 @@ 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
|
-
style: styles,
|
|
1701
|
-
loading: "lazy",
|
|
1702
|
-
className: "object-cover w-full",
|
|
1703
|
-
src: resolvedAssetUrl,
|
|
1704
|
-
width: selectedAsset.intrinsicWidth,
|
|
1705
|
-
alt: title || "Asset image",
|
|
1706
|
-
height: selectedAsset.intrinsicHeight
|
|
1707
|
-
}
|
|
1708
|
-
)
|
|
1709
|
-
);
|
|
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
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1659
|
+
"img",
|
|
1660
|
+
{
|
|
1661
|
+
style: styles,
|
|
1662
|
+
loading: "lazy",
|
|
1663
|
+
className: "object-cover w-full",
|
|
1664
|
+
src: resolvedAssetUrl,
|
|
1665
|
+
width: selectedAsset.intrinsicWidth,
|
|
1666
|
+
height: selectedAsset.intrinsicHeight,
|
|
1667
|
+
alt: title || "Asset image"
|
|
1710
1668
|
}
|
|
1711
|
-
|
|
1712
|
-
if (width) {
|
|
1713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width }, children: renderMedia() });
|
|
1714
|
-
}
|
|
1669
|
+
);
|
|
1670
|
+
if (width) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width }, children: renderMedia() });
|
|
1715
1671
|
if (nodeProps?.format) {
|
|
1716
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `flex ${
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `flex ${FORMAT_CLASSES[nodeProps.format] ?? ""}`, children: renderMedia() });
|
|
1717
1673
|
}
|
|
1718
1674
|
return renderMedia();
|
|
1719
1675
|
};
|
|
@@ -3412,10 +3368,10 @@ InputControl.displayName = "InputControl";
|
|
|
3412
3368
|
var InputControl_default = InputControl;
|
|
3413
3369
|
|
|
3414
3370
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3415
|
-
var
|
|
3371
|
+
var import_react49 = __toESM(require("react"));
|
|
3416
3372
|
|
|
3417
3373
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3418
|
-
var
|
|
3374
|
+
var import_react35 = __toESM(require("react"));
|
|
3419
3375
|
|
|
3420
3376
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3421
3377
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -3497,15 +3453,12 @@ var LineBreakNode = () => {
|
|
|
3497
3453
|
var LineBreakNode_default = LineBreakNode;
|
|
3498
3454
|
|
|
3499
3455
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3500
|
-
var
|
|
3456
|
+
var import_react34 = __toESM(require("react"));
|
|
3501
3457
|
|
|
3502
3458
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3503
|
-
var import_react33 = __toESM(require("react"));
|
|
3504
3459
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
3505
3460
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3506
|
-
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3507
|
-
ssr: false
|
|
3508
|
-
});
|
|
3461
|
+
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
3509
3462
|
var getNestedValue = (obj, path) => {
|
|
3510
3463
|
if (!obj || !path) return void 0;
|
|
3511
3464
|
return path.split(".").reduce((current, key) => {
|
|
@@ -3519,33 +3472,22 @@ var ImageNode = (props) => {
|
|
|
3519
3472
|
const currentDevice = props.device;
|
|
3520
3473
|
if (props.node.device) {
|
|
3521
3474
|
const nodeDevice = props.node.device;
|
|
3522
|
-
if (nodeDevice !== currentDevice)
|
|
3523
|
-
return null;
|
|
3524
|
-
}
|
|
3475
|
+
if (nodeDevice !== currentDevice) return null;
|
|
3525
3476
|
}
|
|
3526
|
-
console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
|
|
3527
3477
|
if (props.node.imageUrl.startsWith("http")) {
|
|
3528
3478
|
imageUrl = props.node.imageUrl;
|
|
3529
|
-
posterUrl = AssetUtility_default.resolveUrl(
|
|
3530
|
-
props.assetBaseUrl,
|
|
3531
|
-
props.node.posterUrl
|
|
3532
|
-
);
|
|
3479
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3533
3480
|
} else if (props.dataitem && props.node.datafield) {
|
|
3534
3481
|
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
} else if (image && typeof image === "object") {
|
|
3542
|
-
assets = [image];
|
|
3543
|
-
}
|
|
3544
|
-
} catch (error) {
|
|
3545
|
-
console.error("Error parsing assets in ImageNode:", error);
|
|
3482
|
+
if (typeof image === "string") {
|
|
3483
|
+
assets = JSON.parse(image);
|
|
3484
|
+
} else if (Array.isArray(image)) {
|
|
3485
|
+
assets = image;
|
|
3486
|
+
} else if (image && typeof image === "object") {
|
|
3487
|
+
assets = [image];
|
|
3546
3488
|
}
|
|
3547
3489
|
if (assets && assets.length > 0) {
|
|
3548
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3549
3491
|
DeviceAssetSelector_default,
|
|
3550
3492
|
{
|
|
3551
3493
|
device: props.device,
|
|
@@ -3562,11 +3504,10 @@ var ImageNode = (props) => {
|
|
|
3562
3504
|
height: props.node.height,
|
|
3563
3505
|
format: props.node.format,
|
|
3564
3506
|
tag: props.node.tag,
|
|
3565
|
-
// Add tag to ImageNode if needed
|
|
3566
3507
|
placementCode: props.node.placementCode
|
|
3567
3508
|
}
|
|
3568
3509
|
}
|
|
3569
|
-
)
|
|
3510
|
+
);
|
|
3570
3511
|
} else {
|
|
3571
3512
|
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3572
3513
|
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
@@ -3575,56 +3516,45 @@ var ImageNode = (props) => {
|
|
|
3575
3516
|
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3576
3517
|
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3577
3518
|
}
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
if (props.node.height) styles.height = props.node.height;
|
|
3584
|
-
if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
|
|
3585
|
-
if (props.node.width) styles.width = props.node.width;
|
|
3586
|
-
const FormatClass = {
|
|
3587
|
-
"center": "justify-center",
|
|
3588
|
-
"left": "justify-start",
|
|
3589
|
-
"right": "justify-end"
|
|
3519
|
+
if (!imageUrl) return null;
|
|
3520
|
+
const styles = {
|
|
3521
|
+
...props.node.height && { height: props.node.height },
|
|
3522
|
+
...props.node.borderRadius && { borderRadius: props.node.borderRadius },
|
|
3523
|
+
...props.node.width && { width: props.node.width }
|
|
3590
3524
|
};
|
|
3591
|
-
{
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
const renderMedia = () => {
|
|
3596
|
-
if (isHls) {
|
|
3597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3598
|
-
HlsPlayer2,
|
|
3599
|
-
{
|
|
3600
|
-
assetUrl: imageUrl,
|
|
3601
|
-
posterUrl,
|
|
3602
|
-
intrinsicWidth: props.node.intrinsicWidth,
|
|
3603
|
-
intrinsicHeight: props.node.intrinsicHeight,
|
|
3604
|
-
showControls: props.node.showControls === "true",
|
|
3605
|
-
loop: props.node.loop === "true",
|
|
3606
|
-
playOptions: props.node.playOptions,
|
|
3607
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3608
|
-
session: props.session
|
|
3609
|
-
}
|
|
3610
|
-
);
|
|
3611
|
-
} else {
|
|
3612
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3613
|
-
"img",
|
|
3614
|
-
{
|
|
3615
|
-
style: styles,
|
|
3616
|
-
loading: "lazy",
|
|
3617
|
-
className: "object-cover",
|
|
3618
|
-
src: imageUrl,
|
|
3619
|
-
width: props.node.intrinsicWidth,
|
|
3620
|
-
alt: props.node.title,
|
|
3621
|
-
height: props.node.intrinsicHeight
|
|
3622
|
-
}
|
|
3623
|
-
) });
|
|
3624
|
-
}
|
|
3525
|
+
const FORMAT_CLASSES2 = {
|
|
3526
|
+
center: "justify-center",
|
|
3527
|
+
left: "justify-start",
|
|
3528
|
+
right: "justify-end"
|
|
3625
3529
|
};
|
|
3530
|
+
const isHls = imageUrl.endsWith(".m3u8");
|
|
3531
|
+
const renderMedia = () => isHls ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3532
|
+
HlsPlayer2,
|
|
3533
|
+
{
|
|
3534
|
+
assetUrl: imageUrl,
|
|
3535
|
+
posterUrl,
|
|
3536
|
+
intrinsicWidth: props.node.intrinsicWidth,
|
|
3537
|
+
intrinsicHeight: props.node.intrinsicHeight,
|
|
3538
|
+
showControls: props.node.showControls === "true",
|
|
3539
|
+
loop: props.node.loop === "true",
|
|
3540
|
+
playOptions: props.node.playOptions,
|
|
3541
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3542
|
+
session: props.session
|
|
3543
|
+
}
|
|
3544
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3545
|
+
"img",
|
|
3546
|
+
{
|
|
3547
|
+
style: styles,
|
|
3548
|
+
loading: "lazy",
|
|
3549
|
+
className: "object-cover",
|
|
3550
|
+
src: imageUrl,
|
|
3551
|
+
width: props.node.intrinsicWidth,
|
|
3552
|
+
alt: props.node.title,
|
|
3553
|
+
height: props.node.intrinsicHeight
|
|
3554
|
+
}
|
|
3555
|
+
);
|
|
3626
3556
|
if (props.node.width) {
|
|
3627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${
|
|
3557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${FORMAT_CLASSES2[props.node.format] ?? ""}`, children: renderMedia() });
|
|
3628
3558
|
}
|
|
3629
3559
|
return renderMedia();
|
|
3630
3560
|
};
|
|
@@ -3686,7 +3616,7 @@ var LinkNode = (props) => {
|
|
|
3686
3616
|
console.warn("Unknown node type:", childNode.type);
|
|
3687
3617
|
return null;
|
|
3688
3618
|
}
|
|
3689
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3690
3620
|
SelectedNode,
|
|
3691
3621
|
{
|
|
3692
3622
|
node: childNode,
|
|
@@ -3925,7 +3855,7 @@ var ParagraphNode = (props) => {
|
|
|
3925
3855
|
if (isInlineOnlyParent) {
|
|
3926
3856
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3927
3857
|
const SelectedNode = NodeTypes2[node.type];
|
|
3928
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3929
3859
|
SelectedNode,
|
|
3930
3860
|
{
|
|
3931
3861
|
node,
|
|
@@ -3940,7 +3870,7 @@ var ParagraphNode = (props) => {
|
|
|
3940
3870
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3941
3871
|
hasChildren && props.node.children.map((node, index) => {
|
|
3942
3872
|
const SelectedNode = NodeTypes2[node.type];
|
|
3943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3944
3874
|
SelectedNode,
|
|
3945
3875
|
{
|
|
3946
3876
|
node,
|
|
@@ -3957,7 +3887,7 @@ var ParagraphNode = (props) => {
|
|
|
3957
3887
|
var ParagraphNode_default = ParagraphNode;
|
|
3958
3888
|
|
|
3959
3889
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3960
|
-
var
|
|
3890
|
+
var import_react36 = __toESM(require("react"));
|
|
3961
3891
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3962
3892
|
var HeadingNode = (props) => {
|
|
3963
3893
|
const NodeTypes2 = {
|
|
@@ -3974,22 +3904,22 @@ var HeadingNode = (props) => {
|
|
|
3974
3904
|
{
|
|
3975
3905
|
}
|
|
3976
3906
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3977
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children:
|
|
3907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: import_react36.default.createElement(
|
|
3978
3908
|
HeadingTag,
|
|
3979
3909
|
{ className: formatClasses },
|
|
3980
3910
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3981
3911
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3982
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3912
|
+
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);
|
|
3983
3913
|
})
|
|
3984
3914
|
) });
|
|
3985
3915
|
};
|
|
3986
3916
|
var HeadingNode_default = HeadingNode;
|
|
3987
3917
|
|
|
3988
3918
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3989
|
-
var
|
|
3919
|
+
var import_react38 = __toESM(require("react"));
|
|
3990
3920
|
|
|
3991
3921
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3992
|
-
var
|
|
3922
|
+
var import_react37 = __toESM(require("react"));
|
|
3993
3923
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3994
3924
|
var ListItemNode = (props) => {
|
|
3995
3925
|
const NodeTypes2 = {
|
|
@@ -4018,7 +3948,7 @@ var ListItemNode = (props) => {
|
|
|
4018
3948
|
}
|
|
4019
3949
|
} else {
|
|
4020
3950
|
foundFirstBreak = false;
|
|
4021
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3951
|
+
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);
|
|
4022
3952
|
}
|
|
4023
3953
|
}) });
|
|
4024
3954
|
};
|
|
@@ -4030,21 +3960,21 @@ var ListNode = (props) => {
|
|
|
4030
3960
|
const NodeTypes2 = {
|
|
4031
3961
|
listitem: ListItemNode_default
|
|
4032
3962
|
};
|
|
4033
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react38.default.Fragment, { children: [
|
|
4034
3964
|
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4035
3965
|
const SelectedNode = NodeTypes2[node.type];
|
|
4036
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3966
|
+
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);
|
|
4037
3967
|
}) }),
|
|
4038
3968
|
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4039
3969
|
const SelectedNode = NodeTypes2[node.type];
|
|
4040
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3970
|
+
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);
|
|
4041
3971
|
}) })
|
|
4042
3972
|
] });
|
|
4043
3973
|
};
|
|
4044
3974
|
var ListNode_default = ListNode;
|
|
4045
3975
|
|
|
4046
3976
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4047
|
-
var
|
|
3977
|
+
var import_react39 = __toESM(require("react"));
|
|
4048
3978
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4049
3979
|
var QuoteNode = (props) => {
|
|
4050
3980
|
const NodeTypes2 = {
|
|
@@ -4054,13 +3984,13 @@ var QuoteNode = (props) => {
|
|
|
4054
3984
|
};
|
|
4055
3985
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4056
3986
|
const SelectedNode = NodeTypes2[node.type];
|
|
4057
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3987
|
+
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);
|
|
4058
3988
|
}) });
|
|
4059
3989
|
};
|
|
4060
3990
|
var QuoteNode_default = QuoteNode;
|
|
4061
3991
|
|
|
4062
3992
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4063
|
-
var
|
|
3993
|
+
var import_react41 = __toESM(require("react"));
|
|
4064
3994
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4065
3995
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4066
3996
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
@@ -4087,7 +4017,7 @@ var CodeNode = (props) => {
|
|
|
4087
4017
|
] }),
|
|
4088
4018
|
/* @__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) => {
|
|
4089
4019
|
const SelectedNode = NodeTypes2[node.type];
|
|
4090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4091
4021
|
SelectedNode,
|
|
4092
4022
|
{
|
|
4093
4023
|
node,
|
|
@@ -4109,7 +4039,7 @@ var HorizontalRuleNode = () => {
|
|
|
4109
4039
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4110
4040
|
|
|
4111
4041
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4112
|
-
var
|
|
4042
|
+
var import_react42 = __toESM(require("react"));
|
|
4113
4043
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4114
4044
|
var WidgetNode = (props) => {
|
|
4115
4045
|
const getWidgetParameters = () => {
|
|
@@ -4183,7 +4113,7 @@ var WidgetNode = (props) => {
|
|
|
4183
4113
|
}
|
|
4184
4114
|
return (
|
|
4185
4115
|
// eslint-disable-next-line react-hooks/static-components
|
|
4186
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4187
4117
|
WidgetRenderer,
|
|
4188
4118
|
{
|
|
4189
4119
|
params: widgetParams,
|
|
@@ -4200,7 +4130,7 @@ var WidgetNode = (props) => {
|
|
|
4200
4130
|
var WidgetNode_default = WidgetNode;
|
|
4201
4131
|
|
|
4202
4132
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4203
|
-
var
|
|
4133
|
+
var import_react43 = __toESM(require("react"));
|
|
4204
4134
|
|
|
4205
4135
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4206
4136
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -4285,16 +4215,16 @@ var FormContainerNode = (props) => {
|
|
|
4285
4215
|
["input-control"]: InputControlNode_default
|
|
4286
4216
|
};
|
|
4287
4217
|
const { node } = props;
|
|
4288
|
-
const formRef = (0,
|
|
4218
|
+
const formRef = (0, import_react43.useRef)(null);
|
|
4289
4219
|
const initialState = {
|
|
4290
4220
|
inputValues: {},
|
|
4291
4221
|
lastPropertyChanged: ""
|
|
4292
4222
|
};
|
|
4293
|
-
const [formState, dispatch] = (0,
|
|
4294
|
-
const handleInputChange = (0,
|
|
4223
|
+
const [formState, dispatch] = (0, import_react43.useReducer)(FormReducer_default, initialState);
|
|
4224
|
+
const handleInputChange = (0, import_react43.useCallback)((updatedValues) => {
|
|
4295
4225
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4296
4226
|
}, [dispatch]);
|
|
4297
|
-
(0,
|
|
4227
|
+
(0, import_react43.useEffect)(() => {
|
|
4298
4228
|
const fetchInitialData = async () => {
|
|
4299
4229
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4300
4230
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4314,7 +4244,7 @@ var FormContainerNode = (props) => {
|
|
|
4314
4244
|
{
|
|
4315
4245
|
}
|
|
4316
4246
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4317
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react43.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4318
4248
|
InputControlNode_default,
|
|
4319
4249
|
{
|
|
4320
4250
|
value: formState.inputValues[node2.name],
|
|
@@ -4329,7 +4259,7 @@ var FormContainerNode = (props) => {
|
|
|
4329
4259
|
var FormContainerNode_default = FormContainerNode;
|
|
4330
4260
|
|
|
4331
4261
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4332
|
-
var
|
|
4262
|
+
var import_react48 = __toESM(require("react"));
|
|
4333
4263
|
|
|
4334
4264
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4335
4265
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
@@ -4354,7 +4284,7 @@ var EmbedNode_default = EmbedNode;
|
|
|
4354
4284
|
init_ServiceClient();
|
|
4355
4285
|
|
|
4356
4286
|
// src/components/Slider.tsx
|
|
4357
|
-
var
|
|
4287
|
+
var import_react46 = __toESM(require("react"));
|
|
4358
4288
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4359
4289
|
var Slider = ({
|
|
4360
4290
|
children,
|
|
@@ -4373,13 +4303,13 @@ var Slider = ({
|
|
|
4373
4303
|
pillStyle = "cumulative",
|
|
4374
4304
|
progressPosition = "bottom"
|
|
4375
4305
|
}) => {
|
|
4376
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4377
|
-
const [transition, setTransition] = (0,
|
|
4378
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4306
|
+
const [currentSlide, setCurrentSlide] = (0, import_react46.useState)(0);
|
|
4307
|
+
const [transition, setTransition] = (0, import_react46.useState)(true);
|
|
4308
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react46.useState)(
|
|
4379
4309
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4380
4310
|
);
|
|
4381
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4382
|
-
(0,
|
|
4311
|
+
const [isPlaying, setIsPlaying] = (0, import_react46.useState)(autoplay);
|
|
4312
|
+
(0, import_react46.useEffect)(() => {
|
|
4383
4313
|
if (typeof slidesToShow === "number") return;
|
|
4384
4314
|
const handleResize = () => {
|
|
4385
4315
|
if (window.innerWidth >= 1024) {
|
|
@@ -4394,7 +4324,7 @@ var Slider = ({
|
|
|
4394
4324
|
window.addEventListener("resize", handleResize);
|
|
4395
4325
|
return () => window.removeEventListener("resize", handleResize);
|
|
4396
4326
|
}, [slidesToShow]);
|
|
4397
|
-
(0,
|
|
4327
|
+
(0, import_react46.useEffect)(() => {
|
|
4398
4328
|
if (!autoplay) return;
|
|
4399
4329
|
const timer = setInterval(() => {
|
|
4400
4330
|
if (isPlaying) {
|
|
@@ -4403,7 +4333,7 @@ var Slider = ({
|
|
|
4403
4333
|
}, autoplay_speed);
|
|
4404
4334
|
return () => clearInterval(timer);
|
|
4405
4335
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4406
|
-
const totalSlides =
|
|
4336
|
+
const totalSlides = import_react46.Children.count(children);
|
|
4407
4337
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4408
4338
|
const nextSlide = () => {
|
|
4409
4339
|
if (currentSlide >= maxSlide) {
|
|
@@ -4448,8 +4378,8 @@ var Slider = ({
|
|
|
4448
4378
|
}
|
|
4449
4379
|
};
|
|
4450
4380
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4451
|
-
const slides =
|
|
4452
|
-
if (!
|
|
4381
|
+
const slides = import_react46.Children.map(children, (child, index) => {
|
|
4382
|
+
if (!import_react46.default.isValidElement(child)) return null;
|
|
4453
4383
|
const childProps = child.props;
|
|
4454
4384
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4455
4385
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
@@ -4457,7 +4387,7 @@ var Slider = ({
|
|
|
4457
4387
|
{
|
|
4458
4388
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4459
4389
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4460
|
-
children: (0,
|
|
4390
|
+
children: (0, import_react46.cloneElement)(child, {
|
|
4461
4391
|
className: mergedClassName
|
|
4462
4392
|
})
|
|
4463
4393
|
},
|
|
@@ -4570,13 +4500,13 @@ var ProgressPill = ({
|
|
|
4570
4500
|
currentSlide,
|
|
4571
4501
|
totalSlides
|
|
4572
4502
|
}) => {
|
|
4573
|
-
const [progress, setProgress] = (0,
|
|
4574
|
-
(0,
|
|
4503
|
+
const [progress, setProgress] = (0, import_react46.useState)(0);
|
|
4504
|
+
(0, import_react46.useEffect)(() => {
|
|
4575
4505
|
if (active) {
|
|
4576
4506
|
setProgress(0);
|
|
4577
4507
|
}
|
|
4578
4508
|
}, [active, index]);
|
|
4579
|
-
(0,
|
|
4509
|
+
(0, import_react46.useEffect)(() => {
|
|
4580
4510
|
if (!active || !isPlaying) {
|
|
4581
4511
|
if (!active) {
|
|
4582
4512
|
setProgress(0);
|
|
@@ -5020,12 +4950,12 @@ var NoDataFound = () => {
|
|
|
5020
4950
|
var NoDataFound_default = NoDataFound;
|
|
5021
4951
|
|
|
5022
4952
|
// src/components/Pagination.tsx
|
|
5023
|
-
var
|
|
4953
|
+
var import_react47 = require("react");
|
|
5024
4954
|
init_StyleTypes();
|
|
5025
4955
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5026
4956
|
var Pagination = (props) => {
|
|
5027
4957
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5028
|
-
const builder = (0,
|
|
4958
|
+
const builder = (0, import_react47.useMemo)(() => {
|
|
5029
4959
|
const b = new OdataBuilder(path);
|
|
5030
4960
|
if (query) b.setQuery(query);
|
|
5031
4961
|
return b;
|
|
@@ -5550,7 +5480,7 @@ var DivContainer = async (props) => {
|
|
|
5550
5480
|
}
|
|
5551
5481
|
const SelectedNode = NodeTypes2[node.type];
|
|
5552
5482
|
if (!SelectedNode) return null;
|
|
5553
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5554
5484
|
SelectedNode,
|
|
5555
5485
|
{
|
|
5556
5486
|
node,
|
|
@@ -5652,9 +5582,9 @@ var DivContainer = async (props) => {
|
|
|
5652
5582
|
props.node.autoFormat && "auto-format",
|
|
5653
5583
|
props.node.bgClass
|
|
5654
5584
|
].filter(Boolean).join(" ");
|
|
5655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react48.default.Fragment, { children: [
|
|
5656
5586
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5657
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5658
5588
|
Wrapper,
|
|
5659
5589
|
{
|
|
5660
5590
|
id: guid,
|
|
@@ -5663,7 +5593,7 @@ var DivContainer = async (props) => {
|
|
|
5663
5593
|
...wrapperProps,
|
|
5664
5594
|
children: dataToRender.map(
|
|
5665
5595
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5666
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5596
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.default.Fragment, { children: child }, i)
|
|
5667
5597
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5668
5598
|
)
|
|
5669
5599
|
}
|
|
@@ -5702,11 +5632,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5702
5632
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5703
5633
|
rootNode = pageBodyTree.root;
|
|
5704
5634
|
}
|
|
5705
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5706
5636
|
{
|
|
5707
5637
|
}
|
|
5708
5638
|
const SelectedNode = NodeTypes[node.type];
|
|
5709
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5639
|
+
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)(
|
|
5710
5640
|
SelectedNode,
|
|
5711
5641
|
{
|
|
5712
5642
|
node,
|
|
@@ -5722,7 +5652,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5722
5652
|
device: props.device,
|
|
5723
5653
|
widgetRenderer: props.widgetRenderer
|
|
5724
5654
|
}
|
|
5725
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5655
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5726
5656
|
SelectedNode,
|
|
5727
5657
|
{
|
|
5728
5658
|
node,
|
|
@@ -5743,13 +5673,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5743
5673
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5744
5674
|
|
|
5745
5675
|
// src/components/Toast.tsx
|
|
5746
|
-
var
|
|
5676
|
+
var import_react50 = require("react");
|
|
5747
5677
|
init_ToastService();
|
|
5748
5678
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5749
5679
|
var Toast = () => {
|
|
5750
|
-
const [showToast, setShowToast] = (0,
|
|
5751
|
-
const [message, setMessage] = (0,
|
|
5752
|
-
const [messageType, setMessageType] = (0,
|
|
5680
|
+
const [showToast, setShowToast] = (0, import_react50.useState)(false);
|
|
5681
|
+
const [message, setMessage] = (0, import_react50.useState)("");
|
|
5682
|
+
const [messageType, setMessageType] = (0, import_react50.useState)("error");
|
|
5753
5683
|
ToastService_default.showError = function(message2) {
|
|
5754
5684
|
setShowToast(true);
|
|
5755
5685
|
setMessage(message2);
|
|
@@ -5857,22 +5787,22 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5857
5787
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
5858
5788
|
|
|
5859
5789
|
// src/components/dataForm/DataList.tsx
|
|
5860
|
-
var
|
|
5790
|
+
var import_react53 = __toESM(require("react"));
|
|
5861
5791
|
var import_navigation2 = require("next/navigation");
|
|
5862
5792
|
|
|
5863
5793
|
// src/components/dataForm/NoContentView.tsx
|
|
5864
|
-
var
|
|
5794
|
+
var import_react51 = __toESM(require("react"));
|
|
5865
5795
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5866
5796
|
var NoContentView = (props) => {
|
|
5867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react51.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
5868
5798
|
};
|
|
5869
5799
|
var NoContentView_default = NoContentView;
|
|
5870
5800
|
|
|
5871
5801
|
// src/components/dataForm/ContentView.tsx
|
|
5872
|
-
var
|
|
5802
|
+
var import_react52 = __toESM(require("react"));
|
|
5873
5803
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5874
5804
|
var ContentView = (props) => {
|
|
5875
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
5805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_react52.default.Fragment, { children: [
|
|
5876
5806
|
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: [
|
|
5877
5807
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
5878
5808
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -5921,8 +5851,8 @@ var DataList = (props) => {
|
|
|
5921
5851
|
let activePageNumber = 0;
|
|
5922
5852
|
let pages = 0;
|
|
5923
5853
|
console.log(props.addLinkText);
|
|
5924
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
5925
|
-
(0,
|
|
5854
|
+
const [isDataFound, setIsDataFound] = (0, import_react53.useState)(null);
|
|
5855
|
+
(0, import_react53.useEffect)(() => {
|
|
5926
5856
|
if (props?.dataset) {
|
|
5927
5857
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
5928
5858
|
setIsDataFound(true);
|
|
@@ -5944,8 +5874,8 @@ var DataList = (props) => {
|
|
|
5944
5874
|
inputValues: {},
|
|
5945
5875
|
lastPropertyChanged: ""
|
|
5946
5876
|
};
|
|
5947
|
-
const [formState, dispatch] = (0,
|
|
5948
|
-
const handleFilterChange = (0,
|
|
5877
|
+
const [formState, dispatch] = (0, import_react53.useReducer)(FormReducer_default, initialState);
|
|
5878
|
+
const handleFilterChange = (0, import_react53.useCallback)(
|
|
5949
5879
|
(updatedValues) => {
|
|
5950
5880
|
dispatch({
|
|
5951
5881
|
type: FORM_INPUT_UPDATE,
|
|
@@ -5991,7 +5921,7 @@ var DataList = (props) => {
|
|
|
5991
5921
|
const renderPageNumbers = () => {
|
|
5992
5922
|
if (pages <= 10) {
|
|
5993
5923
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5994
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5924
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5995
5925
|
Hyperlink,
|
|
5996
5926
|
{
|
|
5997
5927
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6005,7 +5935,7 @@ var DataList = (props) => {
|
|
|
6005
5935
|
const showLastPages = activePageNumber > pages - 5;
|
|
6006
5936
|
if (showFirstPages) {
|
|
6007
5937
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6008
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5938
|
+
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)(
|
|
6009
5939
|
Hyperlink,
|
|
6010
5940
|
{
|
|
6011
5941
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6071,7 +6001,7 @@ var DataList = (props) => {
|
|
|
6071
6001
|
),
|
|
6072
6002
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6073
6003
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6074
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6004
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6075
6005
|
Hyperlink,
|
|
6076
6006
|
{
|
|
6077
6007
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6103,7 +6033,7 @@ var DataList = (props) => {
|
|
|
6103
6033
|
Array.from(
|
|
6104
6034
|
{ length: 5 },
|
|
6105
6035
|
(_, index) => activePageNumber - 2 + index
|
|
6106
|
-
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6036
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6107
6037
|
Hyperlink,
|
|
6108
6038
|
{
|
|
6109
6039
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6149,7 +6079,7 @@ var DataList = (props) => {
|
|
|
6149
6079
|
}
|
|
6150
6080
|
}
|
|
6151
6081
|
};
|
|
6152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react53.default.Fragment, { children: [
|
|
6153
6083
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ContentView_default, { isDataFound, children: [
|
|
6154
6084
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6155
6085
|
"div",
|
|
@@ -6227,7 +6157,7 @@ var DataList = (props) => {
|
|
|
6227
6157
|
}
|
|
6228
6158
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6229
6159
|
console.log("column", column);
|
|
6230
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6231
6161
|
"td",
|
|
6232
6162
|
{
|
|
6233
6163
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -6379,7 +6309,7 @@ var DataList = (props) => {
|
|
|
6379
6309
|
var DataList_default = DataList;
|
|
6380
6310
|
|
|
6381
6311
|
// src/components/dataForm/DataListRenderer.tsx
|
|
6382
|
-
var
|
|
6312
|
+
var import_react54 = __toESM(require("react"));
|
|
6383
6313
|
init_ServiceClient();
|
|
6384
6314
|
var import_navigation3 = require("next/navigation");
|
|
6385
6315
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
@@ -6436,14 +6366,14 @@ var DataListRenderer = ({
|
|
|
6436
6366
|
widgetProps
|
|
6437
6367
|
}) => {
|
|
6438
6368
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
6439
|
-
const [columns, setColumns] = (0,
|
|
6440
|
-
const [dataset, setDataset] = (0,
|
|
6441
|
-
const [filter, setFilters] = (0,
|
|
6442
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
6443
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
6444
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
6369
|
+
const [columns, setColumns] = (0, import_react54.useState)([]);
|
|
6370
|
+
const [dataset, setDataset] = (0, import_react54.useState)();
|
|
6371
|
+
const [filter, setFilters] = (0, import_react54.useState)([]);
|
|
6372
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react54.useState)("");
|
|
6373
|
+
const [addLinkText, setAddLinkText] = (0, import_react54.useState)("");
|
|
6374
|
+
const [serviceRoute, setServiceRoute] = (0, import_react54.useState)("");
|
|
6445
6375
|
const pathname = (0, import_navigation3.usePathname)();
|
|
6446
|
-
(0,
|
|
6376
|
+
(0, import_react54.useEffect)(() => {
|
|
6447
6377
|
if (!formDefinition) return;
|
|
6448
6378
|
setColumns(mapApiToColumns(formDefinition));
|
|
6449
6379
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -6456,7 +6386,7 @@ var DataListRenderer = ({
|
|
|
6456
6386
|
setAddLinkHref(resolvedAddLinkHref);
|
|
6457
6387
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
6458
6388
|
}, [formDefinition, params]);
|
|
6459
|
-
(0,
|
|
6389
|
+
(0, import_react54.useEffect)(() => {
|
|
6460
6390
|
const fetchData = async () => {
|
|
6461
6391
|
if (!serviceRoute) return;
|
|
6462
6392
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -6468,10 +6398,10 @@ var DataListRenderer = ({
|
|
|
6468
6398
|
};
|
|
6469
6399
|
fetchData();
|
|
6470
6400
|
}, [serviceRoute, query, params]);
|
|
6471
|
-
const [tabItem, setTabItem] = (0,
|
|
6401
|
+
const [tabItem, setTabItem] = (0, import_react54.useState)();
|
|
6472
6402
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6473
6403
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6474
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_react54.default.Fragment, { children: [
|
|
6475
6405
|
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6476
6406
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6477
6407
|
DataList_default,
|
|
@@ -6492,12 +6422,12 @@ var DataListRenderer = ({
|
|
|
6492
6422
|
var DataListRenderer_default = DataListRenderer;
|
|
6493
6423
|
|
|
6494
6424
|
// src/components/dataForm/DataForm.tsx
|
|
6495
|
-
var
|
|
6425
|
+
var import_react56 = __toESM(require("react"));
|
|
6496
6426
|
init_Button();
|
|
6497
6427
|
init_StyleTypes();
|
|
6498
6428
|
|
|
6499
6429
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6500
|
-
var
|
|
6430
|
+
var import_react55 = __toESM(require("react"));
|
|
6501
6431
|
|
|
6502
6432
|
// src/components/dataForm/StyleTypes.tsx
|
|
6503
6433
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -6535,7 +6465,7 @@ var DataFormChildSection = (props) => {
|
|
|
6535
6465
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
6536
6466
|
};
|
|
6537
6467
|
const childItemsToRender = getChildItemsForRendering();
|
|
6538
|
-
const handleChildInputChange = (0,
|
|
6468
|
+
const handleChildInputChange = (0, import_react55.useCallback)(
|
|
6539
6469
|
(updatedValues) => {
|
|
6540
6470
|
if (isOneToOne) {
|
|
6541
6471
|
props.callback({
|
|
@@ -6562,7 +6492,7 @@ var DataFormChildSection = (props) => {
|
|
|
6562
6492
|
},
|
|
6563
6493
|
[props, isOneToOne, childItemsToRender]
|
|
6564
6494
|
);
|
|
6565
|
-
const onAddRow = (0,
|
|
6495
|
+
const onAddRow = (0, import_react55.useCallback)(() => {
|
|
6566
6496
|
props.callback({
|
|
6567
6497
|
sectionName: props.section.name,
|
|
6568
6498
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -6571,7 +6501,7 @@ var DataFormChildSection = (props) => {
|
|
|
6571
6501
|
rowIndex: -1
|
|
6572
6502
|
});
|
|
6573
6503
|
}, [props]);
|
|
6574
|
-
const onDeleteRow = (0,
|
|
6504
|
+
const onDeleteRow = (0, import_react55.useCallback)(
|
|
6575
6505
|
(filteredIndex) => {
|
|
6576
6506
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
6577
6507
|
if (visibleItem) {
|
|
@@ -6591,7 +6521,7 @@ var DataFormChildSection = (props) => {
|
|
|
6591
6521
|
childItemsToRender,
|
|
6592
6522
|
allChildItems: childItems
|
|
6593
6523
|
});
|
|
6594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6524
|
+
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: [
|
|
6595
6525
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
6596
6526
|
/* @__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: [
|
|
6597
6527
|
/* @__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: [
|
|
@@ -6613,7 +6543,7 @@ var DataFormChildSection = (props) => {
|
|
|
6613
6543
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6614
6544
|
const { item, originalIndex } = visibleItem;
|
|
6615
6545
|
const rowKey = originalIndex;
|
|
6616
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react55.default.Fragment, { children: section.sectionRows.map(
|
|
6617
6547
|
(sectionRow, sectionRowIndex) => {
|
|
6618
6548
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6619
6549
|
"tr",
|
|
@@ -6684,7 +6614,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
6684
6614
|
// src/components/dataForm/DataForm.tsx
|
|
6685
6615
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6686
6616
|
var DataForm = (props) => {
|
|
6687
|
-
const formRef = (0,
|
|
6617
|
+
const formRef = (0, import_react56.useRef)(null);
|
|
6688
6618
|
console.log(props.dataItem, "dssads");
|
|
6689
6619
|
const initialState = {
|
|
6690
6620
|
inputValues: {},
|
|
@@ -6693,9 +6623,9 @@ var DataForm = (props) => {
|
|
|
6693
6623
|
const childInitialState = {
|
|
6694
6624
|
inputValues: []
|
|
6695
6625
|
};
|
|
6696
|
-
const [formState, dispatch] = (0,
|
|
6626
|
+
const [formState, dispatch] = (0, import_react56.useReducer)(FormReducer_default, initialState);
|
|
6697
6627
|
console.log(props.sections, "sections");
|
|
6698
|
-
const clearHiddenChildSections = (0,
|
|
6628
|
+
const clearHiddenChildSections = (0, import_react56.useCallback)(
|
|
6699
6629
|
(changedProperty, newValues) => {
|
|
6700
6630
|
if (!props.sections) return;
|
|
6701
6631
|
const allChildSections = [];
|
|
@@ -6733,7 +6663,7 @@ var DataForm = (props) => {
|
|
|
6733
6663
|
},
|
|
6734
6664
|
[props.sections, formState.inputValues]
|
|
6735
6665
|
);
|
|
6736
|
-
const handleInputChange = (0,
|
|
6666
|
+
const handleInputChange = (0, import_react56.useCallback)(
|
|
6737
6667
|
async (updatedValues) => {
|
|
6738
6668
|
dispatch({
|
|
6739
6669
|
type: FORM_INPUT_UPDATE,
|
|
@@ -6748,7 +6678,7 @@ var DataForm = (props) => {
|
|
|
6748
6678
|
},
|
|
6749
6679
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
6750
6680
|
);
|
|
6751
|
-
const fetchData = (0,
|
|
6681
|
+
const fetchData = (0, import_react56.useCallback)(async () => {
|
|
6752
6682
|
if (!props.rules) return;
|
|
6753
6683
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
6754
6684
|
return;
|
|
@@ -6779,7 +6709,7 @@ var DataForm = (props) => {
|
|
|
6779
6709
|
console.error("Error fetching data:", error);
|
|
6780
6710
|
}
|
|
6781
6711
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
6782
|
-
(0,
|
|
6712
|
+
(0, import_react56.useEffect)(() => {
|
|
6783
6713
|
fetchData();
|
|
6784
6714
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
6785
6715
|
function replacePlaceholders(template, context, params) {
|
|
@@ -6799,7 +6729,7 @@ var DataForm = (props) => {
|
|
|
6799
6729
|
}
|
|
6800
6730
|
);
|
|
6801
6731
|
}
|
|
6802
|
-
const handleChildSectionChangeCallback = (0,
|
|
6732
|
+
const handleChildSectionChangeCallback = (0, import_react56.useCallback)(
|
|
6803
6733
|
(params) => {
|
|
6804
6734
|
dispatch({
|
|
6805
6735
|
type: params.actionType,
|
|
@@ -6844,7 +6774,7 @@ var DataForm = (props) => {
|
|
|
6844
6774
|
});
|
|
6845
6775
|
return cloned;
|
|
6846
6776
|
}
|
|
6847
|
-
const onClick = (0,
|
|
6777
|
+
const onClick = (0, import_react56.useCallback)(async () => {
|
|
6848
6778
|
if (props.onClick) {
|
|
6849
6779
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
6850
6780
|
const normalizedValues = normalizeChildSections(
|
|
@@ -6860,21 +6790,21 @@ var DataForm = (props) => {
|
|
|
6860
6790
|
return { isSuccessful: true };
|
|
6861
6791
|
}
|
|
6862
6792
|
}, [formState, props]);
|
|
6863
|
-
const handleAdditionalOnClick = (0,
|
|
6793
|
+
const handleAdditionalOnClick = (0, import_react56.useCallback)(async () => {
|
|
6864
6794
|
if (props.additionalActions?.onClick) {
|
|
6865
6795
|
return await props.additionalActions.onClick(formState);
|
|
6866
6796
|
} else {
|
|
6867
6797
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
6868
6798
|
}
|
|
6869
6799
|
}, [formState, props]);
|
|
6870
|
-
const onDelete = (0,
|
|
6800
|
+
const onDelete = (0, import_react56.useCallback)(async () => {
|
|
6871
6801
|
if (props.onDelete) {
|
|
6872
6802
|
return await props.onDelete(formState);
|
|
6873
6803
|
} else {
|
|
6874
6804
|
return { isSuccessful: true };
|
|
6875
6805
|
}
|
|
6876
6806
|
}, [formState, props]);
|
|
6877
|
-
(0,
|
|
6807
|
+
(0, import_react56.useEffect)(() => {
|
|
6878
6808
|
if (props.dataItem) {
|
|
6879
6809
|
dispatch({
|
|
6880
6810
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -6902,7 +6832,7 @@ var DataForm = (props) => {
|
|
|
6902
6832
|
return false;
|
|
6903
6833
|
}
|
|
6904
6834
|
}
|
|
6905
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6835
|
+
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: [
|
|
6906
6836
|
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)(
|
|
6907
6837
|
"div",
|
|
6908
6838
|
{
|
|
@@ -6936,7 +6866,7 @@ var DataForm = (props) => {
|
|
|
6936
6866
|
}
|
|
6937
6867
|
},
|
|
6938
6868
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
6939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6869
|
+
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: [
|
|
6940
6870
|
section.sectionRows?.map(
|
|
6941
6871
|
(sectionRow, sectionRowIndex) => {
|
|
6942
6872
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6947,7 +6877,7 @@ var DataForm = (props) => {
|
|
|
6947
6877
|
sectionRow.visible
|
|
6948
6878
|
);
|
|
6949
6879
|
}
|
|
6950
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6880
|
+
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) => {
|
|
6951
6881
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6952
6882
|
"div",
|
|
6953
6883
|
{
|