@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260525110354 → 0.8.1-dev.20260526112357
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +230 -229
- package/dist/index.mjs +114 -113
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -773,12 +773,12 @@ var init_StyleTypes = __esm({
|
|
|
773
773
|
});
|
|
774
774
|
|
|
775
775
|
// src/components/ClientButton.tsx
|
|
776
|
-
var
|
|
776
|
+
var import_react25, import_jsx_runtime28, ClientButton, ClientButton_default;
|
|
777
777
|
var init_ClientButton = __esm({
|
|
778
778
|
"src/components/ClientButton.tsx"() {
|
|
779
779
|
"use strict";
|
|
780
780
|
"use client";
|
|
781
|
-
|
|
781
|
+
import_react25 = __toESM(require("react"));
|
|
782
782
|
init_ToastService();
|
|
783
783
|
init_StyleTypes();
|
|
784
784
|
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -791,7 +791,7 @@ var init_ClientButton = __esm({
|
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
793
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
794
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react25.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
795
795
|
"button",
|
|
796
796
|
{
|
|
797
797
|
type: "button",
|
|
@@ -806,17 +806,17 @@ var init_ClientButton = __esm({
|
|
|
806
806
|
});
|
|
807
807
|
|
|
808
808
|
// src/components/Confirm.tsx
|
|
809
|
-
var
|
|
809
|
+
var import_react26, import_jsx_runtime29, Confirm, Confirm_default;
|
|
810
810
|
var init_Confirm = __esm({
|
|
811
811
|
"src/components/Confirm.tsx"() {
|
|
812
812
|
"use strict";
|
|
813
813
|
"use client";
|
|
814
|
-
|
|
814
|
+
import_react26 = require("react");
|
|
815
815
|
init_ClientButton();
|
|
816
816
|
init_StyleTypes();
|
|
817
817
|
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
818
818
|
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
819
|
-
const [showModal, setShowModal] = (0,
|
|
819
|
+
const [showModal, setShowModal] = (0, import_react26.useState)(true);
|
|
820
820
|
const handleConfirmAction = () => {
|
|
821
821
|
setShowModal(false);
|
|
822
822
|
if (onConfirm) {
|
|
@@ -861,21 +861,21 @@ var init_Confirm = __esm({
|
|
|
861
861
|
});
|
|
862
862
|
|
|
863
863
|
// src/components/Button.tsx
|
|
864
|
-
var
|
|
864
|
+
var import_react27, import_jsx_runtime30, Button, Button_default;
|
|
865
865
|
var init_Button = __esm({
|
|
866
866
|
"src/components/Button.tsx"() {
|
|
867
867
|
"use strict";
|
|
868
868
|
"use client";
|
|
869
|
-
|
|
869
|
+
import_react27 = __toESM(require("react"));
|
|
870
870
|
init_ToastService();
|
|
871
871
|
init_StyleTypes();
|
|
872
872
|
init_Confirm();
|
|
873
873
|
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
874
874
|
Button = (props) => {
|
|
875
|
-
const [inProgress, setInProgress] = (0,
|
|
876
|
-
const [isActionPerformed, setIsActionPerformed] = (0,
|
|
877
|
-
const [responseMessage, setResponseMessage] = (0,
|
|
878
|
-
const [showModal, setShowModal] = (0,
|
|
875
|
+
const [inProgress, setInProgress] = (0, import_react27.useState)(false);
|
|
876
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react27.useState)(false);
|
|
877
|
+
const [responseMessage, setResponseMessage] = (0, import_react27.useState)(null);
|
|
878
|
+
const [showModal, setShowModal] = (0, import_react27.useState)(null);
|
|
879
879
|
const execute = async (event) => {
|
|
880
880
|
event.preventDefault();
|
|
881
881
|
event.stopPropagation();
|
|
@@ -925,7 +925,7 @@ var init_Button = __esm({
|
|
|
925
925
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
926
926
|
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
927
927
|
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
928
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react27.default.Fragment, { children: [
|
|
929
929
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
930
930
|
"button",
|
|
931
931
|
{
|
|
@@ -936,7 +936,7 @@ var init_Button = __esm({
|
|
|
936
936
|
className: buttonClass + " relative " + props.className,
|
|
937
937
|
children: [
|
|
938
938
|
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
939
|
-
inProgress && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
939
|
+
inProgress && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react27.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("svg", { className: "animate-spin ml-2 mr-3 h-5 w-5 " + progressClass, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
940
940
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
941
941
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
942
942
|
] }) })
|
|
@@ -1169,28 +1169,28 @@ var LinkNodeButton_exports = {};
|
|
|
1169
1169
|
__export(LinkNodeButton_exports, {
|
|
1170
1170
|
default: () => LinkNodeButton_default
|
|
1171
1171
|
});
|
|
1172
|
-
var
|
|
1172
|
+
var import_react34, import_jsx_runtime46, LinkNodeButton, LinkNodeButton_default;
|
|
1173
1173
|
var init_LinkNodeButton = __esm({
|
|
1174
1174
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
1175
1175
|
"use strict";
|
|
1176
1176
|
"use client";
|
|
1177
|
-
|
|
1177
|
+
import_react34 = require("react");
|
|
1178
1178
|
init_Button();
|
|
1179
1179
|
init_ServiceClient();
|
|
1180
1180
|
init_ToastService();
|
|
1181
1181
|
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1182
1182
|
LinkNodeButton = (props) => {
|
|
1183
1183
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
1184
|
-
const [isLoading, setIsLoading] = (0,
|
|
1185
|
-
const [error, setError] = (0,
|
|
1186
|
-
const extractFieldNames = (0,
|
|
1184
|
+
const [isLoading, setIsLoading] = (0, import_react34.useState)(false);
|
|
1185
|
+
const [error, setError] = (0, import_react34.useState)(null);
|
|
1186
|
+
const extractFieldNames = (0, import_react34.useCallback)((template) => {
|
|
1187
1187
|
if (!template) return [];
|
|
1188
1188
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
1189
1189
|
const matches = Array.from(template.matchAll(regex));
|
|
1190
1190
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
1191
1191
|
return fieldNames;
|
|
1192
1192
|
}, []);
|
|
1193
|
-
const replaceTemplateVariables = (0,
|
|
1193
|
+
const replaceTemplateVariables = (0, import_react34.useCallback)((template, responseData) => {
|
|
1194
1194
|
if (!template) return template;
|
|
1195
1195
|
let result = template;
|
|
1196
1196
|
const fieldNames = extractFieldNames(template);
|
|
@@ -1219,7 +1219,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1219
1219
|
}
|
|
1220
1220
|
return result;
|
|
1221
1221
|
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
1222
|
-
const getNestedValue3 = (0,
|
|
1222
|
+
const getNestedValue3 = (0, import_react34.useCallback)((obj, path) => {
|
|
1223
1223
|
if (!obj || !path) return void 0;
|
|
1224
1224
|
if (obj[path] !== void 0) {
|
|
1225
1225
|
return obj[path];
|
|
@@ -1234,7 +1234,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1234
1234
|
}
|
|
1235
1235
|
return current;
|
|
1236
1236
|
}, []);
|
|
1237
|
-
const onClick = (0,
|
|
1237
|
+
const onClick = (0, import_react34.useCallback)(async (e) => {
|
|
1238
1238
|
if (!node.postUrl) {
|
|
1239
1239
|
setError("No POST URL configured for this button");
|
|
1240
1240
|
return;
|
|
@@ -1346,9 +1346,9 @@ __export(CopyButton_exports, {
|
|
|
1346
1346
|
default: () => CopyButton
|
|
1347
1347
|
});
|
|
1348
1348
|
function CopyButton({ text }) {
|
|
1349
|
-
const [copied, setCopied] = (0,
|
|
1350
|
-
const timeoutRef = (0,
|
|
1351
|
-
(0,
|
|
1349
|
+
const [copied, setCopied] = (0, import_react41.useState)(false);
|
|
1350
|
+
const timeoutRef = (0, import_react41.useRef)(null);
|
|
1351
|
+
(0, import_react41.useEffect)(() => {
|
|
1352
1352
|
return () => {
|
|
1353
1353
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
1354
1354
|
};
|
|
@@ -1392,25 +1392,25 @@ function CopyButton({ text }) {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
);
|
|
1394
1394
|
}
|
|
1395
|
-
var
|
|
1395
|
+
var import_react41, import_jsx_runtime56;
|
|
1396
1396
|
var init_CopyButton = __esm({
|
|
1397
1397
|
"src/components/CopyButton.tsx"() {
|
|
1398
1398
|
"use strict";
|
|
1399
1399
|
"use client";
|
|
1400
|
-
|
|
1400
|
+
import_react41 = require("react");
|
|
1401
1401
|
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1402
1402
|
}
|
|
1403
1403
|
});
|
|
1404
1404
|
|
|
1405
1405
|
// src/components/IFrameLoaderView.tsx
|
|
1406
|
-
var
|
|
1406
|
+
var import_react45, import_jsx_runtime62, IFrameLoaderView, IFrameLoaderView_default;
|
|
1407
1407
|
var init_IFrameLoaderView = __esm({
|
|
1408
1408
|
"src/components/IFrameLoaderView.tsx"() {
|
|
1409
1409
|
"use strict";
|
|
1410
|
-
|
|
1410
|
+
import_react45 = __toESM(require("react"));
|
|
1411
1411
|
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
1412
1412
|
IFrameLoaderView = (props) => {
|
|
1413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_react45.default.Fragment, { children: [
|
|
1414
1414
|
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: [
|
|
1415
1415
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
1416
1416
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -1455,19 +1455,19 @@ var IframeClient_exports = {};
|
|
|
1455
1455
|
__export(IframeClient_exports, {
|
|
1456
1456
|
default: () => IframeClient_default
|
|
1457
1457
|
});
|
|
1458
|
-
var
|
|
1458
|
+
var import_react46, import_jsx_runtime63, IframeClient, IframeClient_default;
|
|
1459
1459
|
var init_IframeClient = __esm({
|
|
1460
1460
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1461
1461
|
"use strict";
|
|
1462
1462
|
"use client";
|
|
1463
|
-
|
|
1463
|
+
import_react46 = __toESM(require("react"));
|
|
1464
1464
|
init_IFrameLoaderView();
|
|
1465
1465
|
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
1466
1466
|
IframeClient = ({ src }) => {
|
|
1467
|
-
const iframeRef = (0,
|
|
1468
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
1469
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
1470
|
-
(0,
|
|
1467
|
+
const iframeRef = (0, import_react46.useRef)(null);
|
|
1468
|
+
const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
|
|
1469
|
+
const [isDataFound, setIsDataFound] = (0, import_react46.useState)(null);
|
|
1470
|
+
(0, import_react46.useEffect)(() => {
|
|
1471
1471
|
const handleReceiveMessage = (event) => {
|
|
1472
1472
|
const eventName = event?.data?.eventName;
|
|
1473
1473
|
const payload = event?.data?.payload;
|
|
@@ -1482,7 +1482,7 @@ var init_IframeClient = __esm({
|
|
|
1482
1482
|
window.addEventListener("message", handleReceiveMessage);
|
|
1483
1483
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
1484
1484
|
}, []);
|
|
1485
|
-
(0,
|
|
1485
|
+
(0, import_react46.useEffect)(() => {
|
|
1486
1486
|
const handleResize = () => {
|
|
1487
1487
|
if (iframeRef.current) {
|
|
1488
1488
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -1494,7 +1494,7 @@ var init_IframeClient = __esm({
|
|
|
1494
1494
|
const handleIframeLoad = () => {
|
|
1495
1495
|
setIsDataFound(true);
|
|
1496
1496
|
};
|
|
1497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
1497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
1498
1498
|
"iframe",
|
|
1499
1499
|
{
|
|
1500
1500
|
ref: iframeRef,
|
|
@@ -1542,7 +1542,7 @@ __export(index_exports, {
|
|
|
1542
1542
|
module.exports = __toCommonJS(index_exports);
|
|
1543
1543
|
|
|
1544
1544
|
// src/components/controls/view/ViewControl.tsx
|
|
1545
|
-
var
|
|
1545
|
+
var import_react12 = __toESM(require("react"));
|
|
1546
1546
|
|
|
1547
1547
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1548
1548
|
var ViewControlTypes = {
|
|
@@ -1625,6 +1625,9 @@ var BooleanView = (props) => {
|
|
|
1625
1625
|
};
|
|
1626
1626
|
var BooleanView_default = BooleanView;
|
|
1627
1627
|
|
|
1628
|
+
// src/components/controls/view/Asset.tsx
|
|
1629
|
+
var import_react5 = __toESM(require("react"));
|
|
1630
|
+
|
|
1628
1631
|
// src/components/utilities/AssetUtility.tsx
|
|
1629
1632
|
var AssetUtility = class {
|
|
1630
1633
|
constructor() {
|
|
@@ -1635,14 +1638,14 @@ var AssetUtility = class {
|
|
|
1635
1638
|
if (!assetBaseUrl) return url;
|
|
1636
1639
|
return `${assetBaseUrl}/${url}`;
|
|
1637
1640
|
}
|
|
1638
|
-
// static getAssetUrl(apiBaseUrl: string) {
|
|
1639
|
-
// let domainName = apiBaseUrl.replace("https://", "");
|
|
1640
|
-
// return `https://cdn.g-assets.com/${domainName}`;
|
|
1641
|
+
// // static getAssetUrl(apiBaseUrl: string) {
|
|
1642
|
+
// // let domainName = apiBaseUrl.replace("https://", "");
|
|
1643
|
+
// // return `https://cdn.g-assets.com/${domainName}`;
|
|
1644
|
+
// // }
|
|
1645
|
+
// static getAssetFullPath(apiBaseUrl: string, relativePath: string) {
|
|
1646
|
+
// const domainName = apiBaseUrl.replace("https://", "");
|
|
1647
|
+
// return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
1641
1648
|
// }
|
|
1642
|
-
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
1643
|
-
const domainName = apiBaseUrl.replace("https://", "");
|
|
1644
|
-
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
1645
|
-
}
|
|
1646
1649
|
};
|
|
1647
1650
|
var AssetUtility_default = AssetUtility;
|
|
1648
1651
|
|
|
@@ -1736,34 +1739,32 @@ var MediaAsset = (props) => {
|
|
|
1736
1739
|
if (!assets || assets.length === 0) {
|
|
1737
1740
|
return null;
|
|
1738
1741
|
}
|
|
1739
|
-
const domainName = props.apiBaseUrl?.replace("https://", "");
|
|
1740
|
-
const assetBaseUrl = `https://cdn.g-assets.com/${domainName}`;
|
|
1741
1742
|
console.log(props.customProps?.tag, "Tag in MediaAsset");
|
|
1742
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react5.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1743
1744
|
DeviceAssetSelector_default,
|
|
1744
1745
|
{
|
|
1745
1746
|
assets,
|
|
1746
1747
|
apiBaseUrl: props.apiBaseUrl,
|
|
1747
|
-
assetBaseUrl,
|
|
1748
|
+
assetBaseUrl: props.assetBaseUrl ? props.assetBaseUrl : props.apiBaseUrl,
|
|
1748
1749
|
session: props,
|
|
1749
1750
|
width: props.width,
|
|
1750
1751
|
customProps: props.customProps,
|
|
1751
1752
|
tag: props.customProps?.tag
|
|
1752
1753
|
}
|
|
1753
|
-
);
|
|
1754
|
+
) });
|
|
1754
1755
|
};
|
|
1755
1756
|
var Asset_default = MediaAsset;
|
|
1756
1757
|
|
|
1757
1758
|
// src/components/controls/view/LineTextView.tsx
|
|
1758
|
-
var
|
|
1759
|
+
var import_react6 = __toESM(require("react"));
|
|
1759
1760
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1760
1761
|
var LineText = (props) => {
|
|
1761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react6.default.Fragment, { children: props.value });
|
|
1762
1763
|
};
|
|
1763
1764
|
var LineTextView_default = LineText;
|
|
1764
1765
|
|
|
1765
1766
|
// src/components/controls/view/MoneyView.tsx
|
|
1766
|
-
var
|
|
1767
|
+
var import_react7 = __toESM(require("react"));
|
|
1767
1768
|
|
|
1768
1769
|
// src/components/utilities/CurrencyUtility.tsx
|
|
1769
1770
|
var CurrencyUtility = class {
|
|
@@ -1787,7 +1788,7 @@ var CurrencyUtility_default = CurrencyUtility;
|
|
|
1787
1788
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1788
1789
|
var Money = (props) => {
|
|
1789
1790
|
const parsedNumber = parseFloat(props.value);
|
|
1790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react7.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react7.default.Fragment, { children: [
|
|
1791
1792
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-0.5", children: CurrencyUtility_default.getCurrencySymbol(props.unit) }),
|
|
1792
1793
|
parsedNumber.toLocaleString()
|
|
1793
1794
|
] }) });
|
|
@@ -1795,29 +1796,29 @@ var Money = (props) => {
|
|
|
1795
1796
|
var MoneyView_default = Money;
|
|
1796
1797
|
|
|
1797
1798
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1798
|
-
var
|
|
1799
|
+
var import_react8 = __toESM(require("react"));
|
|
1799
1800
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1800
1801
|
var MultilineTextBullets = (props) => {
|
|
1801
1802
|
const lines = props.value?.split("\\n");
|
|
1802
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react8.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
1803
1804
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { children: line }, index);
|
|
1804
1805
|
}) }) });
|
|
1805
1806
|
};
|
|
1806
1807
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1807
1808
|
|
|
1808
1809
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1809
|
-
var
|
|
1810
|
+
var import_react9 = __toESM(require("react"));
|
|
1810
1811
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1811
1812
|
var MultilineText = (props) => {
|
|
1812
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
1813
1814
|
};
|
|
1814
1815
|
var MultilineTextView_default = MultilineText;
|
|
1815
1816
|
|
|
1816
1817
|
// src/components/controls/view/PercentageView.tsx
|
|
1817
|
-
var
|
|
1818
|
+
var import_react10 = __toESM(require("react"));
|
|
1818
1819
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1819
1820
|
var PercentageView = (props) => {
|
|
1820
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react10.default.Fragment, { children: [
|
|
1821
1822
|
props.value,
|
|
1822
1823
|
"%"
|
|
1823
1824
|
] });
|
|
@@ -1825,13 +1826,13 @@ var PercentageView = (props) => {
|
|
|
1825
1826
|
var PercentageView_default = PercentageView;
|
|
1826
1827
|
|
|
1827
1828
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1828
|
-
var
|
|
1829
|
+
var import_react11 = __toESM(require("react"));
|
|
1829
1830
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1830
1831
|
var ProgressIndicator = (props) => {
|
|
1831
1832
|
const percentage = 100;
|
|
1832
1833
|
const circumference = Math.PI * 56;
|
|
1833
1834
|
const offset = circumference * (1 - percentage / 100);
|
|
1834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react11.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative w-48 h-48", children: [
|
|
1835
1836
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full border border-gray-200" }),
|
|
1836
1837
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full h-full rounded-full border-t-8 border-green-500", style: { transform: `rotate(-90deg)`, clipPath: `inset(0px ${offset}px 0px 0px)` } }) }),
|
|
1837
1838
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-lg font-bold text-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
@@ -1889,15 +1890,15 @@ var ViewControl = (props) => {
|
|
|
1889
1890
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1890
1891
|
};
|
|
1891
1892
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1892
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react12.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
1893
1894
|
};
|
|
1894
1895
|
var ViewControl_default = ViewControl;
|
|
1895
1896
|
|
|
1896
1897
|
// src/components/controls/edit/InputControl.tsx
|
|
1897
|
-
var
|
|
1898
|
+
var import_react33 = __toESM(require("react"));
|
|
1898
1899
|
|
|
1899
1900
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1900
|
-
var
|
|
1901
|
+
var import_react13 = __toESM(require("react"));
|
|
1901
1902
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1902
1903
|
var MultilineTextInput = (props) => {
|
|
1903
1904
|
const textChangeHandler = (event) => {
|
|
@@ -1917,7 +1918,7 @@ var MultilineTextInput = (props) => {
|
|
|
1917
1918
|
if (props.value !== void 0 && props.value !== null) {
|
|
1918
1919
|
value = props.value;
|
|
1919
1920
|
}
|
|
1920
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react13.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "block mb-1", children: [
|
|
1921
1922
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1922
1923
|
" ",
|
|
1923
1924
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -1944,7 +1945,7 @@ var MultilineTextInput = (props) => {
|
|
|
1944
1945
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1945
1946
|
|
|
1946
1947
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1947
|
-
var
|
|
1948
|
+
var import_react14 = __toESM(require("react"));
|
|
1948
1949
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1949
1950
|
var LineTextInput = (props) => {
|
|
1950
1951
|
const textChangeHandler = (event) => {
|
|
@@ -1964,7 +1965,7 @@ var LineTextInput = (props) => {
|
|
|
1964
1965
|
if (props.value !== void 0 && props.value !== null) {
|
|
1965
1966
|
value = props.value;
|
|
1966
1967
|
}
|
|
1967
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react14.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "block", children: [
|
|
1968
1969
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1969
1970
|
" ",
|
|
1970
1971
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -1994,7 +1995,7 @@ var LineTextInput = (props) => {
|
|
|
1994
1995
|
var LineTextInput_default = LineTextInput;
|
|
1995
1996
|
|
|
1996
1997
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1997
|
-
var
|
|
1998
|
+
var import_react15 = __toESM(require("react"));
|
|
1998
1999
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1999
2000
|
var MoneyInput = (props) => {
|
|
2000
2001
|
const textChangeHandler = (event) => {
|
|
@@ -2024,7 +2025,7 @@ var MoneyInput = (props) => {
|
|
|
2024
2025
|
e.preventDefault();
|
|
2025
2026
|
}
|
|
2026
2027
|
};
|
|
2027
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react15.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "block mb-1", children: [
|
|
2028
2029
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2029
2030
|
" ",
|
|
2030
2031
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2079,10 +2080,10 @@ var InputControlType = {
|
|
|
2079
2080
|
var InputControlType_default = InputControlType;
|
|
2080
2081
|
|
|
2081
2082
|
// src/components/controls/edit/Select.tsx
|
|
2082
|
-
var
|
|
2083
|
+
var import_react16 = require("react");
|
|
2083
2084
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2084
2085
|
var Select = (props) => {
|
|
2085
|
-
const [list, setList] = (0,
|
|
2086
|
+
const [list, setList] = (0, import_react16.useState)([]);
|
|
2086
2087
|
const getSafeValue = (val) => {
|
|
2087
2088
|
if (val === null || val === void 0) return "";
|
|
2088
2089
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -2111,7 +2112,7 @@ var Select = (props) => {
|
|
|
2111
2112
|
groupKey: props.groupKey
|
|
2112
2113
|
});
|
|
2113
2114
|
};
|
|
2114
|
-
(0,
|
|
2115
|
+
(0, import_react16.useEffect)(() => {
|
|
2115
2116
|
async function fetchData() {
|
|
2116
2117
|
if (props.dataset) {
|
|
2117
2118
|
setList(props.dataset);
|
|
@@ -2168,7 +2169,7 @@ var Select = (props) => {
|
|
|
2168
2169
|
var Select_default = Select;
|
|
2169
2170
|
|
|
2170
2171
|
// src/components/controls/edit/PercentageInput.tsx
|
|
2171
|
-
var
|
|
2172
|
+
var import_react17 = __toESM(require("react"));
|
|
2172
2173
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2173
2174
|
var PercentageInput = (props) => {
|
|
2174
2175
|
const textChangeHandler = (event) => {
|
|
@@ -2198,7 +2199,7 @@ var PercentageInput = (props) => {
|
|
|
2198
2199
|
e.preventDefault();
|
|
2199
2200
|
}
|
|
2200
2201
|
};
|
|
2201
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react17.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "block mb-1", children: [
|
|
2202
2203
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
2203
2204
|
" ",
|
|
2204
2205
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2227,7 +2228,7 @@ var PercentageInput = (props) => {
|
|
|
2227
2228
|
var PercentageInput_default = PercentageInput;
|
|
2228
2229
|
|
|
2229
2230
|
// src/components/controls/edit/PhoneInput.tsx
|
|
2230
|
-
var
|
|
2231
|
+
var import_react18 = __toESM(require("react"));
|
|
2231
2232
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2232
2233
|
var PhoneInput = (props) => {
|
|
2233
2234
|
const textChangeHandler = (event) => {
|
|
@@ -2247,7 +2248,7 @@ var PhoneInput = (props) => {
|
|
|
2247
2248
|
if (props.value !== void 0 && props.value !== null) {
|
|
2248
2249
|
value = props.value;
|
|
2249
2250
|
}
|
|
2250
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "block mb-1", children: [
|
|
2251
2252
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2252
2253
|
" ",
|
|
2253
2254
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2277,7 +2278,7 @@ var PhoneInput = (props) => {
|
|
|
2277
2278
|
var PhoneInput_default = PhoneInput;
|
|
2278
2279
|
|
|
2279
2280
|
// src/components/controls/edit/NumberInput.tsx
|
|
2280
|
-
var
|
|
2281
|
+
var import_react19 = __toESM(require("react"));
|
|
2281
2282
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2282
2283
|
var NumberInput = (props) => {
|
|
2283
2284
|
const textChangeHandler = (event) => {
|
|
@@ -2301,7 +2302,7 @@ var NumberInput = (props) => {
|
|
|
2301
2302
|
if (props.value !== void 0 && props.value !== null) {
|
|
2302
2303
|
value = props.value;
|
|
2303
2304
|
}
|
|
2304
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react19.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "block", children: [
|
|
2305
2306
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
2306
2307
|
" ",
|
|
2307
2308
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2330,7 +2331,7 @@ var NumberInput = (props) => {
|
|
|
2330
2331
|
var NumberInput_default = NumberInput;
|
|
2331
2332
|
|
|
2332
2333
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
2333
|
-
var
|
|
2334
|
+
var import_react20 = __toESM(require("react"));
|
|
2334
2335
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2335
2336
|
var CheckboxInput = (props) => {
|
|
2336
2337
|
const textChangeHandler = (event) => {
|
|
@@ -2348,7 +2349,7 @@ var CheckboxInput = (props) => {
|
|
|
2348
2349
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
2349
2350
|
value = true;
|
|
2350
2351
|
}
|
|
2351
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react20.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: "inline-block mb-1", children: [
|
|
2352
2353
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2353
2354
|
" ",
|
|
2354
2355
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2375,7 +2376,7 @@ var CheckboxInput = (props) => {
|
|
|
2375
2376
|
var CheckboxInput_default = CheckboxInput;
|
|
2376
2377
|
|
|
2377
2378
|
// src/components/controls/edit/OtpInput.tsx
|
|
2378
|
-
var
|
|
2379
|
+
var import_react21 = __toESM(require("react"));
|
|
2379
2380
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2380
2381
|
var OtpInput = (props) => {
|
|
2381
2382
|
const textChangeHandler = (event) => {
|
|
@@ -2398,7 +2399,7 @@ var OtpInput = (props) => {
|
|
|
2398
2399
|
if (props.value !== void 0 && props.value !== null) {
|
|
2399
2400
|
value = props.value;
|
|
2400
2401
|
}
|
|
2401
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react21.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2402
2403
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2403
2404
|
" ",
|
|
2404
2405
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2428,7 +2429,7 @@ var OtpInput = (props) => {
|
|
|
2428
2429
|
var OtpInput_default = OtpInput;
|
|
2429
2430
|
|
|
2430
2431
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2431
|
-
var
|
|
2432
|
+
var import_react22 = __toESM(require("react"));
|
|
2432
2433
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2433
2434
|
var DateTimeInput = (props) => {
|
|
2434
2435
|
const textChangeHandler = (event) => {
|
|
@@ -2461,7 +2462,7 @@ var DateTimeInput = (props) => {
|
|
|
2461
2462
|
e.preventDefault();
|
|
2462
2463
|
}
|
|
2463
2464
|
};
|
|
2464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react22.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "block mb-1", children: [
|
|
2465
2466
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2466
2467
|
" ",
|
|
2467
2468
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2492,11 +2493,11 @@ var DateTimeInput = (props) => {
|
|
|
2492
2493
|
var DateTimeInput_default = DateTimeInput;
|
|
2493
2494
|
|
|
2494
2495
|
// src/components/controls/edit/ColorInput.tsx
|
|
2495
|
-
var
|
|
2496
|
+
var import_react23 = __toESM(require("react"));
|
|
2496
2497
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2497
2498
|
var ColorInput = (props) => {
|
|
2498
|
-
const [color, setColor] =
|
|
2499
|
-
(0,
|
|
2499
|
+
const [color, setColor] = import_react23.default.useState("#3b82f6");
|
|
2500
|
+
(0, import_react23.useEffect)(() => {
|
|
2500
2501
|
if (props.value !== void 0 && props.value !== null) {
|
|
2501
2502
|
if (typeof props.value === "string") {
|
|
2502
2503
|
setColor(props.value);
|
|
@@ -2538,15 +2539,15 @@ var ColorInput = (props) => {
|
|
|
2538
2539
|
var ColorInput_default = ColorInput;
|
|
2539
2540
|
|
|
2540
2541
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2541
|
-
var
|
|
2542
|
+
var import_react24 = require("react");
|
|
2542
2543
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2543
2544
|
var SelectWithSearchInput = (props) => {
|
|
2544
|
-
const [isOpen, setIsOpen] = (0,
|
|
2545
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2546
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2547
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2548
|
-
const [list, setList] = (0,
|
|
2549
|
-
(0,
|
|
2545
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
2546
|
+
const [searchTerm, setSearchTerm] = (0, import_react24.useState)("");
|
|
2547
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react24.useState)(-1);
|
|
2548
|
+
const [selectedItem, setSelectedItem] = (0, import_react24.useState)(null);
|
|
2549
|
+
const [list, setList] = (0, import_react24.useState)([]);
|
|
2550
|
+
(0, import_react24.useEffect)(() => {
|
|
2550
2551
|
async function fetchData() {
|
|
2551
2552
|
if (props.dataset) {
|
|
2552
2553
|
setList(props.dataset);
|
|
@@ -2600,8 +2601,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2600
2601
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2601
2602
|
}
|
|
2602
2603
|
};
|
|
2603
|
-
const dropdownRef = (0,
|
|
2604
|
-
(0,
|
|
2604
|
+
const dropdownRef = (0, import_react24.useRef)(null);
|
|
2605
|
+
(0, import_react24.useEffect)(() => {
|
|
2605
2606
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2606
2607
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2607
2608
|
highlightedItem?.scrollIntoView({
|
|
@@ -2687,22 +2688,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2687
2688
|
|
|
2688
2689
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2689
2690
|
init_Button();
|
|
2690
|
-
var
|
|
2691
|
+
var import_react28 = __toESM(require("react"));
|
|
2691
2692
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2692
2693
|
var SelectWithSearchPanel = (props) => {
|
|
2693
|
-
const [isOpen, setIsOpen] = (0,
|
|
2694
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2695
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2696
|
-
const [list, setList] = (0,
|
|
2697
|
-
const listRef = (0,
|
|
2698
|
-
const [isError, setIsError] = (0,
|
|
2699
|
-
const containerRef = (0,
|
|
2700
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
2701
|
-
const [formData, setFormData] = (0,
|
|
2694
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(false);
|
|
2695
|
+
const [searchTerm, setSearchTerm] = (0, import_react28.useState)("");
|
|
2696
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react28.useState)(0);
|
|
2697
|
+
const [list, setList] = (0, import_react28.useState)([]);
|
|
2698
|
+
const listRef = (0, import_react28.useRef)(null);
|
|
2699
|
+
const [isError, setIsError] = (0, import_react28.useState)(false);
|
|
2700
|
+
const containerRef = (0, import_react28.useRef)(null);
|
|
2701
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react28.useState)(false);
|
|
2702
|
+
const [formData, setFormData] = (0, import_react28.useState)({});
|
|
2702
2703
|
const getNestedValue3 = (obj, path) => {
|
|
2703
2704
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2704
2705
|
};
|
|
2705
|
-
(0,
|
|
2706
|
+
(0, import_react28.useEffect)(() => {
|
|
2706
2707
|
const handleClickOutside = (event) => {
|
|
2707
2708
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2708
2709
|
setIsOpen(false);
|
|
@@ -2713,7 +2714,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2713
2714
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2714
2715
|
};
|
|
2715
2716
|
}, []);
|
|
2716
|
-
(0,
|
|
2717
|
+
(0, import_react28.useEffect)(() => {
|
|
2717
2718
|
async function fetchData() {
|
|
2718
2719
|
if (props.dataset) {
|
|
2719
2720
|
setList(props.dataset);
|
|
@@ -2755,7 +2756,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2755
2756
|
audioCtx.close();
|
|
2756
2757
|
}, 250);
|
|
2757
2758
|
};
|
|
2758
|
-
(0,
|
|
2759
|
+
(0, import_react28.useEffect)(() => {
|
|
2759
2760
|
const filteredItems2 = list?.filter(
|
|
2760
2761
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2761
2762
|
);
|
|
@@ -2820,7 +2821,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2820
2821
|
const handleInputChange = (event, field) => {
|
|
2821
2822
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2822
2823
|
};
|
|
2823
|
-
const handleSaveModal = (0,
|
|
2824
|
+
const handleSaveModal = (0, import_react28.useCallback)(async () => {
|
|
2824
2825
|
console.log("Form Data:", formData);
|
|
2825
2826
|
return formData;
|
|
2826
2827
|
}, []);
|
|
@@ -2845,7 +2846,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2845
2846
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2846
2847
|
}
|
|
2847
2848
|
) }),
|
|
2848
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react28.default.Fragment, { children: [
|
|
2849
2850
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
2850
2851
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
2851
2852
|
"Select a",
|
|
@@ -2934,10 +2935,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2934
2935
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2935
2936
|
|
|
2936
2937
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2937
|
-
var
|
|
2938
|
+
var import_react29 = __toESM(require("react"));
|
|
2938
2939
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2939
2940
|
var BooleanSelect = (props) => {
|
|
2940
|
-
const [list, setList] = (0,
|
|
2941
|
+
const [list, setList] = (0, import_react29.useState)();
|
|
2941
2942
|
const textChangeHandler = (event) => {
|
|
2942
2943
|
const text = event.target.value;
|
|
2943
2944
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2950,7 +2951,7 @@ var BooleanSelect = (props) => {
|
|
|
2950
2951
|
});
|
|
2951
2952
|
}
|
|
2952
2953
|
};
|
|
2953
|
-
(0,
|
|
2954
|
+
(0, import_react29.useEffect)(() => {
|
|
2954
2955
|
async function fetchData() {
|
|
2955
2956
|
console.log("in select");
|
|
2956
2957
|
if (props.dataset) {
|
|
@@ -2984,7 +2985,7 @@ var BooleanSelect = (props) => {
|
|
|
2984
2985
|
if (props.value !== void 0 && props.value !== null) {
|
|
2985
2986
|
value = props.value;
|
|
2986
2987
|
}
|
|
2987
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "block", children: [
|
|
2988
2989
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2989
2990
|
" ",
|
|
2990
2991
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -3021,7 +3022,7 @@ var BooleanSelect = (props) => {
|
|
|
3021
3022
|
var BooleanSelect_default = BooleanSelect;
|
|
3022
3023
|
|
|
3023
3024
|
// src/components/controls/edit/EmailInput.tsx
|
|
3024
|
-
var
|
|
3025
|
+
var import_react30 = __toESM(require("react"));
|
|
3025
3026
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3026
3027
|
var EmailInput = (props) => {
|
|
3027
3028
|
const textChangeHandler = (event) => {
|
|
@@ -3047,7 +3048,7 @@ var EmailInput = (props) => {
|
|
|
3047
3048
|
if (props.value !== void 0 && props.value !== null) {
|
|
3048
3049
|
value = props.value;
|
|
3049
3050
|
}
|
|
3050
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react30.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "block mb-1", children: [
|
|
3051
3052
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
3052
3053
|
" ",
|
|
3053
3054
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -3073,7 +3074,7 @@ var EmailInput = (props) => {
|
|
|
3073
3074
|
var EmailInput_default = EmailInput;
|
|
3074
3075
|
|
|
3075
3076
|
// src/components/controls/edit/TimeInput.tsx
|
|
3076
|
-
var
|
|
3077
|
+
var import_react31 = __toESM(require("react"));
|
|
3077
3078
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3078
3079
|
var TimeInput = (props) => {
|
|
3079
3080
|
const timeChangeHandler = (event) => {
|
|
@@ -3087,7 +3088,7 @@ var TimeInput = (props) => {
|
|
|
3087
3088
|
});
|
|
3088
3089
|
}
|
|
3089
3090
|
};
|
|
3090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react31.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "block mb-1", children: [
|
|
3091
3092
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
3092
3093
|
" ",
|
|
3093
3094
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -3110,7 +3111,7 @@ var TimeInput = (props) => {
|
|
|
3110
3111
|
var TimeInput_default = TimeInput;
|
|
3111
3112
|
|
|
3112
3113
|
// src/components/controls/edit/AssetUpload.tsx
|
|
3113
|
-
var
|
|
3114
|
+
var import_react32 = __toESM(require("react"));
|
|
3114
3115
|
init_ClientButton();
|
|
3115
3116
|
init_StyleTypes();
|
|
3116
3117
|
|
|
@@ -3209,8 +3210,8 @@ var AssetUpload = (props) => {
|
|
|
3209
3210
|
}
|
|
3210
3211
|
return "image";
|
|
3211
3212
|
};
|
|
3212
|
-
const [assetType, setAssetType] =
|
|
3213
|
-
(0,
|
|
3213
|
+
const [assetType, setAssetType] = import_react32.default.useState(getInitialTab);
|
|
3214
|
+
(0, import_react32.useEffect)(() => {
|
|
3214
3215
|
setAssetType(getInitialTab());
|
|
3215
3216
|
}, [props.value]);
|
|
3216
3217
|
const assetUploadCallback = (newAsset) => {
|
|
@@ -3285,7 +3286,7 @@ var AssetUpload = (props) => {
|
|
|
3285
3286
|
}
|
|
3286
3287
|
return false;
|
|
3287
3288
|
};
|
|
3288
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react32.default.Fragment, { children: [
|
|
3289
3290
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { className: "block mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
|
|
3290
3291
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
|
|
3291
3292
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -3385,7 +3386,7 @@ var AssetUpload_default = AssetUpload;
|
|
|
3385
3386
|
|
|
3386
3387
|
// src/components/controls/edit/InputControl.tsx
|
|
3387
3388
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3388
|
-
var InputControl =
|
|
3389
|
+
var InputControl = import_react33.default.forwardRef(
|
|
3389
3390
|
(props, ref) => {
|
|
3390
3391
|
const ControlComponents = {
|
|
3391
3392
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -3407,17 +3408,17 @@ var InputControl = import_react32.default.forwardRef(
|
|
|
3407
3408
|
[InputControlType_default.asset]: AssetUpload_default
|
|
3408
3409
|
};
|
|
3409
3410
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
3410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react33.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
3411
3412
|
}
|
|
3412
3413
|
);
|
|
3413
3414
|
InputControl.displayName = "InputControl";
|
|
3414
3415
|
var InputControl_default = InputControl;
|
|
3415
3416
|
|
|
3416
3417
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3417
|
-
var
|
|
3418
|
+
var import_react50 = __toESM(require("react"));
|
|
3418
3419
|
|
|
3419
3420
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3420
|
-
var
|
|
3421
|
+
var import_react36 = __toESM(require("react"));
|
|
3421
3422
|
|
|
3422
3423
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3423
3424
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -3499,7 +3500,7 @@ var LineBreakNode = () => {
|
|
|
3499
3500
|
var LineBreakNode_default = LineBreakNode;
|
|
3500
3501
|
|
|
3501
3502
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3502
|
-
var
|
|
3503
|
+
var import_react35 = __toESM(require("react"));
|
|
3503
3504
|
|
|
3504
3505
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3505
3506
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
@@ -3665,7 +3666,7 @@ var LinkNode = (props) => {
|
|
|
3665
3666
|
console.warn("Unknown node type:", childNode.type);
|
|
3666
3667
|
return null;
|
|
3667
3668
|
}
|
|
3668
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react35.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3669
3670
|
SelectedNode,
|
|
3670
3671
|
{
|
|
3671
3672
|
node: childNode,
|
|
@@ -3904,7 +3905,7 @@ var ParagraphNode = (props) => {
|
|
|
3904
3905
|
if (isInlineOnlyParent) {
|
|
3905
3906
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3906
3907
|
const SelectedNode = NodeTypes2[node.type];
|
|
3907
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3908
3909
|
SelectedNode,
|
|
3909
3910
|
{
|
|
3910
3911
|
node,
|
|
@@ -3919,7 +3920,7 @@ var ParagraphNode = (props) => {
|
|
|
3919
3920
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3920
3921
|
hasChildren && props.node.children.map((node, index) => {
|
|
3921
3922
|
const SelectedNode = NodeTypes2[node.type];
|
|
3922
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3923
3924
|
SelectedNode,
|
|
3924
3925
|
{
|
|
3925
3926
|
node,
|
|
@@ -3936,7 +3937,7 @@ var ParagraphNode = (props) => {
|
|
|
3936
3937
|
var ParagraphNode_default = ParagraphNode;
|
|
3937
3938
|
|
|
3938
3939
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3939
|
-
var
|
|
3940
|
+
var import_react37 = __toESM(require("react"));
|
|
3940
3941
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3941
3942
|
var HeadingNode = (props) => {
|
|
3942
3943
|
const NodeTypes2 = {
|
|
@@ -3953,22 +3954,22 @@ var HeadingNode = (props) => {
|
|
|
3953
3954
|
{
|
|
3954
3955
|
}
|
|
3955
3956
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3956
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children:
|
|
3957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: import_react37.default.createElement(
|
|
3957
3958
|
HeadingTag,
|
|
3958
3959
|
{ className: formatClasses },
|
|
3959
3960
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3960
3961
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3961
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react37.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);
|
|
3962
3963
|
})
|
|
3963
3964
|
) });
|
|
3964
3965
|
};
|
|
3965
3966
|
var HeadingNode_default = HeadingNode;
|
|
3966
3967
|
|
|
3967
3968
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3968
|
-
var
|
|
3969
|
+
var import_react39 = __toESM(require("react"));
|
|
3969
3970
|
|
|
3970
3971
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3971
|
-
var
|
|
3972
|
+
var import_react38 = __toESM(require("react"));
|
|
3972
3973
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3973
3974
|
var ListItemNode = (props) => {
|
|
3974
3975
|
const NodeTypes2 = {
|
|
@@ -3997,7 +3998,7 @@ var ListItemNode = (props) => {
|
|
|
3997
3998
|
}
|
|
3998
3999
|
} else {
|
|
3999
4000
|
foundFirstBreak = false;
|
|
4000
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4001
4002
|
}
|
|
4002
4003
|
}) });
|
|
4003
4004
|
};
|
|
@@ -4009,21 +4010,21 @@ var ListNode = (props) => {
|
|
|
4009
4010
|
const NodeTypes2 = {
|
|
4010
4011
|
listitem: ListItemNode_default
|
|
4011
4012
|
};
|
|
4012
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react39.default.Fragment, { children: [
|
|
4013
4014
|
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4014
4015
|
const SelectedNode = NodeTypes2[node.type];
|
|
4015
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4016
4017
|
}) }),
|
|
4017
4018
|
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4018
4019
|
const SelectedNode = NodeTypes2[node.type];
|
|
4019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4020
4021
|
}) })
|
|
4021
4022
|
] });
|
|
4022
4023
|
};
|
|
4023
4024
|
var ListNode_default = ListNode;
|
|
4024
4025
|
|
|
4025
4026
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4026
|
-
var
|
|
4027
|
+
var import_react40 = __toESM(require("react"));
|
|
4027
4028
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4028
4029
|
var QuoteNode = (props) => {
|
|
4029
4030
|
const NodeTypes2 = {
|
|
@@ -4033,13 +4034,13 @@ var QuoteNode = (props) => {
|
|
|
4033
4034
|
};
|
|
4034
4035
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4035
4036
|
const SelectedNode = NodeTypes2[node.type];
|
|
4036
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4037
4038
|
}) });
|
|
4038
4039
|
};
|
|
4039
4040
|
var QuoteNode_default = QuoteNode;
|
|
4040
4041
|
|
|
4041
4042
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4042
|
-
var
|
|
4043
|
+
var import_react42 = __toESM(require("react"));
|
|
4043
4044
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4044
4045
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4045
4046
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
@@ -4066,7 +4067,7 @@ var CodeNode = (props) => {
|
|
|
4066
4067
|
] }),
|
|
4067
4068
|
/* @__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) => {
|
|
4068
4069
|
const SelectedNode = NodeTypes2[node.type];
|
|
4069
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4070
4071
|
SelectedNode,
|
|
4071
4072
|
{
|
|
4072
4073
|
node,
|
|
@@ -4088,7 +4089,7 @@ var HorizontalRuleNode = () => {
|
|
|
4088
4089
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4089
4090
|
|
|
4090
4091
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4091
|
-
var
|
|
4092
|
+
var import_react43 = __toESM(require("react"));
|
|
4092
4093
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4093
4094
|
var WidgetNode = (props) => {
|
|
4094
4095
|
const getWidgetParameters = () => {
|
|
@@ -4162,7 +4163,7 @@ var WidgetNode = (props) => {
|
|
|
4162
4163
|
}
|
|
4163
4164
|
return (
|
|
4164
4165
|
// eslint-disable-next-line react-hooks/static-components
|
|
4165
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4166
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react43.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4166
4167
|
WidgetRenderer,
|
|
4167
4168
|
{
|
|
4168
4169
|
params: widgetParams,
|
|
@@ -4179,7 +4180,7 @@ var WidgetNode = (props) => {
|
|
|
4179
4180
|
var WidgetNode_default = WidgetNode;
|
|
4180
4181
|
|
|
4181
4182
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4182
|
-
var
|
|
4183
|
+
var import_react44 = __toESM(require("react"));
|
|
4183
4184
|
|
|
4184
4185
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4185
4186
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -4264,16 +4265,16 @@ var FormContainerNode = (props) => {
|
|
|
4264
4265
|
["input-control"]: InputControlNode_default
|
|
4265
4266
|
};
|
|
4266
4267
|
const { node } = props;
|
|
4267
|
-
const formRef = (0,
|
|
4268
|
+
const formRef = (0, import_react44.useRef)(null);
|
|
4268
4269
|
const initialState = {
|
|
4269
4270
|
inputValues: {},
|
|
4270
4271
|
lastPropertyChanged: ""
|
|
4271
4272
|
};
|
|
4272
|
-
const [formState, dispatch] = (0,
|
|
4273
|
-
const handleInputChange = (0,
|
|
4273
|
+
const [formState, dispatch] = (0, import_react44.useReducer)(FormReducer_default, initialState);
|
|
4274
|
+
const handleInputChange = (0, import_react44.useCallback)((updatedValues) => {
|
|
4274
4275
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4275
4276
|
}, [dispatch]);
|
|
4276
|
-
(0,
|
|
4277
|
+
(0, import_react44.useEffect)(() => {
|
|
4277
4278
|
const fetchInitialData = async () => {
|
|
4278
4279
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4279
4280
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4293,7 +4294,7 @@ var FormContainerNode = (props) => {
|
|
|
4293
4294
|
{
|
|
4294
4295
|
}
|
|
4295
4296
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react44.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4297
4298
|
InputControlNode_default,
|
|
4298
4299
|
{
|
|
4299
4300
|
value: formState.inputValues[node2.name],
|
|
@@ -4308,7 +4309,7 @@ var FormContainerNode = (props) => {
|
|
|
4308
4309
|
var FormContainerNode_default = FormContainerNode;
|
|
4309
4310
|
|
|
4310
4311
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4311
|
-
var
|
|
4312
|
+
var import_react49 = __toESM(require("react"));
|
|
4312
4313
|
|
|
4313
4314
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4314
4315
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
@@ -4333,7 +4334,7 @@ var EmbedNode_default = EmbedNode;
|
|
|
4333
4334
|
init_ServiceClient();
|
|
4334
4335
|
|
|
4335
4336
|
// src/components/Slider.tsx
|
|
4336
|
-
var
|
|
4337
|
+
var import_react47 = __toESM(require("react"));
|
|
4337
4338
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4338
4339
|
var Slider = ({
|
|
4339
4340
|
children,
|
|
@@ -4352,13 +4353,13 @@ var Slider = ({
|
|
|
4352
4353
|
pillStyle = "cumulative",
|
|
4353
4354
|
progressPosition = "bottom"
|
|
4354
4355
|
}) => {
|
|
4355
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4356
|
-
const [transition, setTransition] = (0,
|
|
4357
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4356
|
+
const [currentSlide, setCurrentSlide] = (0, import_react47.useState)(0);
|
|
4357
|
+
const [transition, setTransition] = (0, import_react47.useState)(true);
|
|
4358
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react47.useState)(
|
|
4358
4359
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4359
4360
|
);
|
|
4360
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4361
|
-
(0,
|
|
4361
|
+
const [isPlaying, setIsPlaying] = (0, import_react47.useState)(autoplay);
|
|
4362
|
+
(0, import_react47.useEffect)(() => {
|
|
4362
4363
|
if (typeof slidesToShow === "number") return;
|
|
4363
4364
|
const handleResize = () => {
|
|
4364
4365
|
if (window.innerWidth >= 1024) {
|
|
@@ -4373,7 +4374,7 @@ var Slider = ({
|
|
|
4373
4374
|
window.addEventListener("resize", handleResize);
|
|
4374
4375
|
return () => window.removeEventListener("resize", handleResize);
|
|
4375
4376
|
}, [slidesToShow]);
|
|
4376
|
-
(0,
|
|
4377
|
+
(0, import_react47.useEffect)(() => {
|
|
4377
4378
|
if (!autoplay) return;
|
|
4378
4379
|
const timer = setInterval(() => {
|
|
4379
4380
|
if (isPlaying) {
|
|
@@ -4382,7 +4383,7 @@ var Slider = ({
|
|
|
4382
4383
|
}, autoplay_speed);
|
|
4383
4384
|
return () => clearInterval(timer);
|
|
4384
4385
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4385
|
-
const totalSlides =
|
|
4386
|
+
const totalSlides = import_react47.Children.count(children);
|
|
4386
4387
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4387
4388
|
const nextSlide = () => {
|
|
4388
4389
|
if (currentSlide >= maxSlide) {
|
|
@@ -4427,8 +4428,8 @@ var Slider = ({
|
|
|
4427
4428
|
}
|
|
4428
4429
|
};
|
|
4429
4430
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4430
|
-
const slides =
|
|
4431
|
-
if (!
|
|
4431
|
+
const slides = import_react47.Children.map(children, (child, index) => {
|
|
4432
|
+
if (!import_react47.default.isValidElement(child)) return null;
|
|
4432
4433
|
const childProps = child.props;
|
|
4433
4434
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4434
4435
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
@@ -4436,7 +4437,7 @@ var Slider = ({
|
|
|
4436
4437
|
{
|
|
4437
4438
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4438
4439
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4439
|
-
children: (0,
|
|
4440
|
+
children: (0, import_react47.cloneElement)(child, {
|
|
4440
4441
|
className: mergedClassName
|
|
4441
4442
|
})
|
|
4442
4443
|
},
|
|
@@ -4549,13 +4550,13 @@ var ProgressPill = ({
|
|
|
4549
4550
|
currentSlide,
|
|
4550
4551
|
totalSlides
|
|
4551
4552
|
}) => {
|
|
4552
|
-
const [progress, setProgress] = (0,
|
|
4553
|
-
(0,
|
|
4553
|
+
const [progress, setProgress] = (0, import_react47.useState)(0);
|
|
4554
|
+
(0, import_react47.useEffect)(() => {
|
|
4554
4555
|
if (active) {
|
|
4555
4556
|
setProgress(0);
|
|
4556
4557
|
}
|
|
4557
4558
|
}, [active, index]);
|
|
4558
|
-
(0,
|
|
4559
|
+
(0, import_react47.useEffect)(() => {
|
|
4559
4560
|
if (!active || !isPlaying) {
|
|
4560
4561
|
if (!active) {
|
|
4561
4562
|
setProgress(0);
|
|
@@ -4999,12 +5000,12 @@ var NoDataFound = () => {
|
|
|
4999
5000
|
var NoDataFound_default = NoDataFound;
|
|
5000
5001
|
|
|
5001
5002
|
// src/components/Pagination.tsx
|
|
5002
|
-
var
|
|
5003
|
+
var import_react48 = require("react");
|
|
5003
5004
|
init_StyleTypes();
|
|
5004
5005
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5005
5006
|
var Pagination = (props) => {
|
|
5006
5007
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5007
|
-
const builder = (0,
|
|
5008
|
+
const builder = (0, import_react48.useMemo)(() => {
|
|
5008
5009
|
const b = new OdataBuilder(path);
|
|
5009
5010
|
if (query) b.setQuery(query);
|
|
5010
5011
|
return b;
|
|
@@ -5529,7 +5530,7 @@ var DivContainer = async (props) => {
|
|
|
5529
5530
|
}
|
|
5530
5531
|
const SelectedNode = NodeTypes2[node.type];
|
|
5531
5532
|
if (!SelectedNode) return null;
|
|
5532
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5533
5534
|
SelectedNode,
|
|
5534
5535
|
{
|
|
5535
5536
|
node,
|
|
@@ -5631,9 +5632,9 @@ var DivContainer = async (props) => {
|
|
|
5631
5632
|
props.node.autoFormat && "auto-format",
|
|
5632
5633
|
props.node.bgClass
|
|
5633
5634
|
].filter(Boolean).join(" ");
|
|
5634
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react49.default.Fragment, { children: [
|
|
5635
5636
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5636
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5637
5638
|
Wrapper,
|
|
5638
5639
|
{
|
|
5639
5640
|
id: guid,
|
|
@@ -5642,7 +5643,7 @@ var DivContainer = async (props) => {
|
|
|
5642
5643
|
...wrapperProps,
|
|
5643
5644
|
children: dataToRender.map(
|
|
5644
5645
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5645
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5646
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: child }, i)
|
|
5646
5647
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5647
5648
|
)
|
|
5648
5649
|
}
|
|
@@ -5681,11 +5682,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5681
5682
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5682
5683
|
rootNode = pageBodyTree.root;
|
|
5683
5684
|
}
|
|
5684
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5685
5686
|
{
|
|
5686
5687
|
}
|
|
5687
5688
|
const SelectedNode = NodeTypes[node.type];
|
|
5688
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5689
5690
|
SelectedNode,
|
|
5690
5691
|
{
|
|
5691
5692
|
node,
|
|
@@ -5701,7 +5702,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5701
5702
|
device: props.device,
|
|
5702
5703
|
widgetRenderer: props.widgetRenderer
|
|
5703
5704
|
}
|
|
5704
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5705
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5705
5706
|
SelectedNode,
|
|
5706
5707
|
{
|
|
5707
5708
|
node,
|
|
@@ -5722,13 +5723,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5722
5723
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5723
5724
|
|
|
5724
5725
|
// src/components/Toast.tsx
|
|
5725
|
-
var
|
|
5726
|
+
var import_react51 = require("react");
|
|
5726
5727
|
init_ToastService();
|
|
5727
5728
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5728
5729
|
var Toast = () => {
|
|
5729
|
-
const [showToast, setShowToast] = (0,
|
|
5730
|
-
const [message, setMessage] = (0,
|
|
5731
|
-
const [messageType, setMessageType] = (0,
|
|
5730
|
+
const [showToast, setShowToast] = (0, import_react51.useState)(false);
|
|
5731
|
+
const [message, setMessage] = (0, import_react51.useState)("");
|
|
5732
|
+
const [messageType, setMessageType] = (0, import_react51.useState)("error");
|
|
5732
5733
|
ToastService_default.showError = function(message2) {
|
|
5733
5734
|
setShowToast(true);
|
|
5734
5735
|
setMessage(message2);
|
|
@@ -5836,22 +5837,22 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5836
5837
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
5837
5838
|
|
|
5838
5839
|
// src/components/dataForm/DataList.tsx
|
|
5839
|
-
var
|
|
5840
|
+
var import_react54 = __toESM(require("react"));
|
|
5840
5841
|
var import_navigation2 = require("next/navigation");
|
|
5841
5842
|
|
|
5842
5843
|
// src/components/dataForm/NoContentView.tsx
|
|
5843
|
-
var
|
|
5844
|
+
var import_react52 = __toESM(require("react"));
|
|
5844
5845
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5845
5846
|
var NoContentView = (props) => {
|
|
5846
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react52.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
5847
5848
|
};
|
|
5848
5849
|
var NoContentView_default = NoContentView;
|
|
5849
5850
|
|
|
5850
5851
|
// src/components/dataForm/ContentView.tsx
|
|
5851
|
-
var
|
|
5852
|
+
var import_react53 = __toESM(require("react"));
|
|
5852
5853
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5853
5854
|
var ContentView = (props) => {
|
|
5854
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
5855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_react53.default.Fragment, { children: [
|
|
5855
5856
|
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: [
|
|
5856
5857
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
5857
5858
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -5900,8 +5901,8 @@ var DataList = (props) => {
|
|
|
5900
5901
|
let activePageNumber = 0;
|
|
5901
5902
|
let pages = 0;
|
|
5902
5903
|
console.log(props.addLinkText);
|
|
5903
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
5904
|
-
(0,
|
|
5904
|
+
const [isDataFound, setIsDataFound] = (0, import_react54.useState)(null);
|
|
5905
|
+
(0, import_react54.useEffect)(() => {
|
|
5905
5906
|
if (props?.dataset) {
|
|
5906
5907
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
5907
5908
|
setIsDataFound(true);
|
|
@@ -5923,8 +5924,8 @@ var DataList = (props) => {
|
|
|
5923
5924
|
inputValues: {},
|
|
5924
5925
|
lastPropertyChanged: ""
|
|
5925
5926
|
};
|
|
5926
|
-
const [formState, dispatch] = (0,
|
|
5927
|
-
const handleFilterChange = (0,
|
|
5927
|
+
const [formState, dispatch] = (0, import_react54.useReducer)(FormReducer_default, initialState);
|
|
5928
|
+
const handleFilterChange = (0, import_react54.useCallback)(
|
|
5928
5929
|
(updatedValues) => {
|
|
5929
5930
|
dispatch({
|
|
5930
5931
|
type: FORM_INPUT_UPDATE,
|
|
@@ -5970,7 +5971,7 @@ var DataList = (props) => {
|
|
|
5970
5971
|
const renderPageNumbers = () => {
|
|
5971
5972
|
if (pages <= 10) {
|
|
5972
5973
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5973
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5974
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5974
5975
|
Hyperlink,
|
|
5975
5976
|
{
|
|
5976
5977
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5984,7 +5985,7 @@ var DataList = (props) => {
|
|
|
5984
5985
|
const showLastPages = activePageNumber > pages - 5;
|
|
5985
5986
|
if (showFirstPages) {
|
|
5986
5987
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5987
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5988
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5988
5989
|
Hyperlink,
|
|
5989
5990
|
{
|
|
5990
5991
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6050,7 +6051,7 @@ var DataList = (props) => {
|
|
|
6050
6051
|
),
|
|
6051
6052
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6052
6053
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6053
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6054
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6054
6055
|
Hyperlink,
|
|
6055
6056
|
{
|
|
6056
6057
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6082,7 +6083,7 @@ var DataList = (props) => {
|
|
|
6082
6083
|
Array.from(
|
|
6083
6084
|
{ length: 5 },
|
|
6084
6085
|
(_, index) => activePageNumber - 2 + index
|
|
6085
|
-
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6086
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6086
6087
|
Hyperlink,
|
|
6087
6088
|
{
|
|
6088
6089
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6128,7 +6129,7 @@ var DataList = (props) => {
|
|
|
6128
6129
|
}
|
|
6129
6130
|
}
|
|
6130
6131
|
};
|
|
6131
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react54.default.Fragment, { children: [
|
|
6132
6133
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ContentView_default, { isDataFound, children: [
|
|
6133
6134
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6134
6135
|
"div",
|
|
@@ -6206,7 +6207,7 @@ var DataList = (props) => {
|
|
|
6206
6207
|
}
|
|
6207
6208
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6208
6209
|
console.log("column", column);
|
|
6209
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6210
6211
|
"td",
|
|
6211
6212
|
{
|
|
6212
6213
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -6358,7 +6359,7 @@ var DataList = (props) => {
|
|
|
6358
6359
|
var DataList_default = DataList;
|
|
6359
6360
|
|
|
6360
6361
|
// src/components/dataForm/DataListRenderer.tsx
|
|
6361
|
-
var
|
|
6362
|
+
var import_react55 = __toESM(require("react"));
|
|
6362
6363
|
init_ServiceClient();
|
|
6363
6364
|
var import_navigation3 = require("next/navigation");
|
|
6364
6365
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
@@ -6415,14 +6416,14 @@ var DataListRenderer = ({
|
|
|
6415
6416
|
widgetProps
|
|
6416
6417
|
}) => {
|
|
6417
6418
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
6418
|
-
const [columns, setColumns] = (0,
|
|
6419
|
-
const [dataset, setDataset] = (0,
|
|
6420
|
-
const [filter, setFilters] = (0,
|
|
6421
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
6422
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
6423
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
6419
|
+
const [columns, setColumns] = (0, import_react55.useState)([]);
|
|
6420
|
+
const [dataset, setDataset] = (0, import_react55.useState)();
|
|
6421
|
+
const [filter, setFilters] = (0, import_react55.useState)([]);
|
|
6422
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react55.useState)("");
|
|
6423
|
+
const [addLinkText, setAddLinkText] = (0, import_react55.useState)("");
|
|
6424
|
+
const [serviceRoute, setServiceRoute] = (0, import_react55.useState)("");
|
|
6424
6425
|
const pathname = (0, import_navigation3.usePathname)();
|
|
6425
|
-
(0,
|
|
6426
|
+
(0, import_react55.useEffect)(() => {
|
|
6426
6427
|
if (!formDefinition) return;
|
|
6427
6428
|
setColumns(mapApiToColumns(formDefinition));
|
|
6428
6429
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -6435,7 +6436,7 @@ var DataListRenderer = ({
|
|
|
6435
6436
|
setAddLinkHref(resolvedAddLinkHref);
|
|
6436
6437
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
6437
6438
|
}, [formDefinition, params]);
|
|
6438
|
-
(0,
|
|
6439
|
+
(0, import_react55.useEffect)(() => {
|
|
6439
6440
|
const fetchData = async () => {
|
|
6440
6441
|
if (!serviceRoute) return;
|
|
6441
6442
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -6447,10 +6448,10 @@ var DataListRenderer = ({
|
|
|
6447
6448
|
};
|
|
6448
6449
|
fetchData();
|
|
6449
6450
|
}, [serviceRoute, query, params]);
|
|
6450
|
-
const [tabItem, setTabItem] = (0,
|
|
6451
|
+
const [tabItem, setTabItem] = (0, import_react55.useState)();
|
|
6451
6452
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6452
6453
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_react55.default.Fragment, { children: [
|
|
6454
6455
|
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6455
6456
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6456
6457
|
DataList_default,
|
|
@@ -6471,12 +6472,12 @@ var DataListRenderer = ({
|
|
|
6471
6472
|
var DataListRenderer_default = DataListRenderer;
|
|
6472
6473
|
|
|
6473
6474
|
// src/components/dataForm/DataForm.tsx
|
|
6474
|
-
var
|
|
6475
|
+
var import_react57 = __toESM(require("react"));
|
|
6475
6476
|
init_Button();
|
|
6476
6477
|
init_StyleTypes();
|
|
6477
6478
|
|
|
6478
6479
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6479
|
-
var
|
|
6480
|
+
var import_react56 = __toESM(require("react"));
|
|
6480
6481
|
|
|
6481
6482
|
// src/components/dataForm/StyleTypes.tsx
|
|
6482
6483
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -6514,7 +6515,7 @@ var DataFormChildSection = (props) => {
|
|
|
6514
6515
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
6515
6516
|
};
|
|
6516
6517
|
const childItemsToRender = getChildItemsForRendering();
|
|
6517
|
-
const handleChildInputChange = (0,
|
|
6518
|
+
const handleChildInputChange = (0, import_react56.useCallback)(
|
|
6518
6519
|
(updatedValues) => {
|
|
6519
6520
|
if (isOneToOne) {
|
|
6520
6521
|
props.callback({
|
|
@@ -6541,7 +6542,7 @@ var DataFormChildSection = (props) => {
|
|
|
6541
6542
|
},
|
|
6542
6543
|
[props, isOneToOne, childItemsToRender]
|
|
6543
6544
|
);
|
|
6544
|
-
const onAddRow = (0,
|
|
6545
|
+
const onAddRow = (0, import_react56.useCallback)(() => {
|
|
6545
6546
|
props.callback({
|
|
6546
6547
|
sectionName: props.section.name,
|
|
6547
6548
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -6550,7 +6551,7 @@ var DataFormChildSection = (props) => {
|
|
|
6550
6551
|
rowIndex: -1
|
|
6551
6552
|
});
|
|
6552
6553
|
}, [props]);
|
|
6553
|
-
const onDeleteRow = (0,
|
|
6554
|
+
const onDeleteRow = (0, import_react56.useCallback)(
|
|
6554
6555
|
(filteredIndex) => {
|
|
6555
6556
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
6556
6557
|
if (visibleItem) {
|
|
@@ -6570,7 +6571,7 @@ var DataFormChildSection = (props) => {
|
|
|
6570
6571
|
childItemsToRender,
|
|
6571
6572
|
allChildItems: childItems
|
|
6572
6573
|
});
|
|
6573
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
6574
6575
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
6575
6576
|
/* @__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: [
|
|
6576
6577
|
/* @__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: [
|
|
@@ -6592,7 +6593,7 @@ var DataFormChildSection = (props) => {
|
|
|
6592
6593
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6593
6594
|
const { item, originalIndex } = visibleItem;
|
|
6594
6595
|
const rowKey = originalIndex;
|
|
6595
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: section.sectionRows.map(
|
|
6596
6597
|
(sectionRow, sectionRowIndex) => {
|
|
6597
6598
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6598
6599
|
"tr",
|
|
@@ -6663,7 +6664,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
6663
6664
|
// src/components/dataForm/DataForm.tsx
|
|
6664
6665
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6665
6666
|
var DataForm = (props) => {
|
|
6666
|
-
const formRef = (0,
|
|
6667
|
+
const formRef = (0, import_react57.useRef)(null);
|
|
6667
6668
|
console.log(props.dataItem, "dssads");
|
|
6668
6669
|
const initialState = {
|
|
6669
6670
|
inputValues: {},
|
|
@@ -6672,9 +6673,9 @@ var DataForm = (props) => {
|
|
|
6672
6673
|
const childInitialState = {
|
|
6673
6674
|
inputValues: []
|
|
6674
6675
|
};
|
|
6675
|
-
const [formState, dispatch] = (0,
|
|
6676
|
+
const [formState, dispatch] = (0, import_react57.useReducer)(FormReducer_default, initialState);
|
|
6676
6677
|
console.log(props.sections, "sections");
|
|
6677
|
-
const clearHiddenChildSections = (0,
|
|
6678
|
+
const clearHiddenChildSections = (0, import_react57.useCallback)(
|
|
6678
6679
|
(changedProperty, newValues) => {
|
|
6679
6680
|
if (!props.sections) return;
|
|
6680
6681
|
const allChildSections = [];
|
|
@@ -6712,7 +6713,7 @@ var DataForm = (props) => {
|
|
|
6712
6713
|
},
|
|
6713
6714
|
[props.sections, formState.inputValues]
|
|
6714
6715
|
);
|
|
6715
|
-
const handleInputChange = (0,
|
|
6716
|
+
const handleInputChange = (0, import_react57.useCallback)(
|
|
6716
6717
|
async (updatedValues) => {
|
|
6717
6718
|
dispatch({
|
|
6718
6719
|
type: FORM_INPUT_UPDATE,
|
|
@@ -6727,7 +6728,7 @@ var DataForm = (props) => {
|
|
|
6727
6728
|
},
|
|
6728
6729
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
6729
6730
|
);
|
|
6730
|
-
const fetchData = (0,
|
|
6731
|
+
const fetchData = (0, import_react57.useCallback)(async () => {
|
|
6731
6732
|
if (!props.rules) return;
|
|
6732
6733
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
6733
6734
|
return;
|
|
@@ -6758,7 +6759,7 @@ var DataForm = (props) => {
|
|
|
6758
6759
|
console.error("Error fetching data:", error);
|
|
6759
6760
|
}
|
|
6760
6761
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
6761
|
-
(0,
|
|
6762
|
+
(0, import_react57.useEffect)(() => {
|
|
6762
6763
|
fetchData();
|
|
6763
6764
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
6764
6765
|
function replacePlaceholders(template, context, params) {
|
|
@@ -6778,7 +6779,7 @@ var DataForm = (props) => {
|
|
|
6778
6779
|
}
|
|
6779
6780
|
);
|
|
6780
6781
|
}
|
|
6781
|
-
const handleChildSectionChangeCallback = (0,
|
|
6782
|
+
const handleChildSectionChangeCallback = (0, import_react57.useCallback)(
|
|
6782
6783
|
(params) => {
|
|
6783
6784
|
dispatch({
|
|
6784
6785
|
type: params.actionType,
|
|
@@ -6823,7 +6824,7 @@ var DataForm = (props) => {
|
|
|
6823
6824
|
});
|
|
6824
6825
|
return cloned;
|
|
6825
6826
|
}
|
|
6826
|
-
const onClick = (0,
|
|
6827
|
+
const onClick = (0, import_react57.useCallback)(async () => {
|
|
6827
6828
|
if (props.onClick) {
|
|
6828
6829
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
6829
6830
|
const normalizedValues = normalizeChildSections(
|
|
@@ -6839,21 +6840,21 @@ var DataForm = (props) => {
|
|
|
6839
6840
|
return { isSuccessful: true };
|
|
6840
6841
|
}
|
|
6841
6842
|
}, [formState, props]);
|
|
6842
|
-
const handleAdditionalOnClick = (0,
|
|
6843
|
+
const handleAdditionalOnClick = (0, import_react57.useCallback)(async () => {
|
|
6843
6844
|
if (props.additionalActions?.onClick) {
|
|
6844
6845
|
return await props.additionalActions.onClick(formState);
|
|
6845
6846
|
} else {
|
|
6846
6847
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
6847
6848
|
}
|
|
6848
6849
|
}, [formState, props]);
|
|
6849
|
-
const onDelete = (0,
|
|
6850
|
+
const onDelete = (0, import_react57.useCallback)(async () => {
|
|
6850
6851
|
if (props.onDelete) {
|
|
6851
6852
|
return await props.onDelete(formState);
|
|
6852
6853
|
} else {
|
|
6853
6854
|
return { isSuccessful: true };
|
|
6854
6855
|
}
|
|
6855
6856
|
}, [formState, props]);
|
|
6856
|
-
(0,
|
|
6857
|
+
(0, import_react57.useEffect)(() => {
|
|
6857
6858
|
if (props.dataItem) {
|
|
6858
6859
|
dispatch({
|
|
6859
6860
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -6881,7 +6882,7 @@ var DataForm = (props) => {
|
|
|
6881
6882
|
return false;
|
|
6882
6883
|
}
|
|
6883
6884
|
}
|
|
6884
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
6885
6886
|
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)(
|
|
6886
6887
|
"div",
|
|
6887
6888
|
{
|
|
@@ -6915,7 +6916,7 @@ var DataForm = (props) => {
|
|
|
6915
6916
|
}
|
|
6916
6917
|
},
|
|
6917
6918
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
6918
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.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: [
|
|
6919
6920
|
section.sectionRows?.map(
|
|
6920
6921
|
(sectionRow, sectionRowIndex) => {
|
|
6921
6922
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6926,7 +6927,7 @@ var DataForm = (props) => {
|
|
|
6926
6927
|
sectionRow.visible
|
|
6927
6928
|
);
|
|
6928
6929
|
}
|
|
6929
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.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) => {
|
|
6930
6931
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6931
6932
|
"div",
|
|
6932
6933
|
{
|