@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260525053215 → 0.8.1-dev.20260526111119
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 +234 -230
- package/dist/index.mjs +118 -114
- 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: props.assetBaseUrl ? /* @__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,
|
|
1748
1749
|
session: props,
|
|
1749
1750
|
width: props.width,
|
|
1750
1751
|
customProps: props.customProps,
|
|
1751
1752
|
tag: props.customProps?.tag
|
|
1752
1753
|
}
|
|
1753
|
-
);
|
|
1754
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: "AssetBaseUrl is not set" }) });
|
|
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"));
|
|
@@ -3526,7 +3527,10 @@ var ImageNode = (props) => {
|
|
|
3526
3527
|
} else if (props.dataitem && props.node.datafield) {
|
|
3527
3528
|
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
3528
3529
|
if (typeof image === "string") {
|
|
3529
|
-
|
|
3530
|
+
const trimmed = image.trim();
|
|
3531
|
+
if (trimmed) {
|
|
3532
|
+
assets = JSON.parse(trimmed);
|
|
3533
|
+
}
|
|
3530
3534
|
} else if (Array.isArray(image)) {
|
|
3531
3535
|
assets = image;
|
|
3532
3536
|
} else if (image && typeof image === "object") {
|
|
@@ -3662,7 +3666,7 @@ var LinkNode = (props) => {
|
|
|
3662
3666
|
console.warn("Unknown node type:", childNode.type);
|
|
3663
3667
|
return null;
|
|
3664
3668
|
}
|
|
3665
|
-
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)(
|
|
3666
3670
|
SelectedNode,
|
|
3667
3671
|
{
|
|
3668
3672
|
node: childNode,
|
|
@@ -3901,7 +3905,7 @@ var ParagraphNode = (props) => {
|
|
|
3901
3905
|
if (isInlineOnlyParent) {
|
|
3902
3906
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3903
3907
|
const SelectedNode = NodeTypes2[node.type];
|
|
3904
|
-
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)(
|
|
3905
3909
|
SelectedNode,
|
|
3906
3910
|
{
|
|
3907
3911
|
node,
|
|
@@ -3916,7 +3920,7 @@ var ParagraphNode = (props) => {
|
|
|
3916
3920
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3917
3921
|
hasChildren && props.node.children.map((node, index) => {
|
|
3918
3922
|
const SelectedNode = NodeTypes2[node.type];
|
|
3919
|
-
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)(
|
|
3920
3924
|
SelectedNode,
|
|
3921
3925
|
{
|
|
3922
3926
|
node,
|
|
@@ -3933,7 +3937,7 @@ var ParagraphNode = (props) => {
|
|
|
3933
3937
|
var ParagraphNode_default = ParagraphNode;
|
|
3934
3938
|
|
|
3935
3939
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3936
|
-
var
|
|
3940
|
+
var import_react37 = __toESM(require("react"));
|
|
3937
3941
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3938
3942
|
var HeadingNode = (props) => {
|
|
3939
3943
|
const NodeTypes2 = {
|
|
@@ -3950,22 +3954,22 @@ var HeadingNode = (props) => {
|
|
|
3950
3954
|
{
|
|
3951
3955
|
}
|
|
3952
3956
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3953
|
-
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(
|
|
3954
3958
|
HeadingTag,
|
|
3955
3959
|
{ className: formatClasses },
|
|
3956
3960
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3957
3961
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3958
|
-
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);
|
|
3959
3963
|
})
|
|
3960
3964
|
) });
|
|
3961
3965
|
};
|
|
3962
3966
|
var HeadingNode_default = HeadingNode;
|
|
3963
3967
|
|
|
3964
3968
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3965
|
-
var
|
|
3969
|
+
var import_react39 = __toESM(require("react"));
|
|
3966
3970
|
|
|
3967
3971
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3968
|
-
var
|
|
3972
|
+
var import_react38 = __toESM(require("react"));
|
|
3969
3973
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3970
3974
|
var ListItemNode = (props) => {
|
|
3971
3975
|
const NodeTypes2 = {
|
|
@@ -3994,7 +3998,7 @@ var ListItemNode = (props) => {
|
|
|
3994
3998
|
}
|
|
3995
3999
|
} else {
|
|
3996
4000
|
foundFirstBreak = false;
|
|
3997
|
-
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);
|
|
3998
4002
|
}
|
|
3999
4003
|
}) });
|
|
4000
4004
|
};
|
|
@@ -4006,21 +4010,21 @@ var ListNode = (props) => {
|
|
|
4006
4010
|
const NodeTypes2 = {
|
|
4007
4011
|
listitem: ListItemNode_default
|
|
4008
4012
|
};
|
|
4009
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react39.default.Fragment, { children: [
|
|
4010
4014
|
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4011
4015
|
const SelectedNode = NodeTypes2[node.type];
|
|
4012
|
-
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);
|
|
4013
4017
|
}) }),
|
|
4014
4018
|
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4015
4019
|
const SelectedNode = NodeTypes2[node.type];
|
|
4016
|
-
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);
|
|
4017
4021
|
}) })
|
|
4018
4022
|
] });
|
|
4019
4023
|
};
|
|
4020
4024
|
var ListNode_default = ListNode;
|
|
4021
4025
|
|
|
4022
4026
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4023
|
-
var
|
|
4027
|
+
var import_react40 = __toESM(require("react"));
|
|
4024
4028
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4025
4029
|
var QuoteNode = (props) => {
|
|
4026
4030
|
const NodeTypes2 = {
|
|
@@ -4030,13 +4034,13 @@ var QuoteNode = (props) => {
|
|
|
4030
4034
|
};
|
|
4031
4035
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4032
4036
|
const SelectedNode = NodeTypes2[node.type];
|
|
4033
|
-
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);
|
|
4034
4038
|
}) });
|
|
4035
4039
|
};
|
|
4036
4040
|
var QuoteNode_default = QuoteNode;
|
|
4037
4041
|
|
|
4038
4042
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4039
|
-
var
|
|
4043
|
+
var import_react42 = __toESM(require("react"));
|
|
4040
4044
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4041
4045
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4042
4046
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
@@ -4063,7 +4067,7 @@ var CodeNode = (props) => {
|
|
|
4063
4067
|
] }),
|
|
4064
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) => {
|
|
4065
4069
|
const SelectedNode = NodeTypes2[node.type];
|
|
4066
|
-
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)(
|
|
4067
4071
|
SelectedNode,
|
|
4068
4072
|
{
|
|
4069
4073
|
node,
|
|
@@ -4085,7 +4089,7 @@ var HorizontalRuleNode = () => {
|
|
|
4085
4089
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4086
4090
|
|
|
4087
4091
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4088
|
-
var
|
|
4092
|
+
var import_react43 = __toESM(require("react"));
|
|
4089
4093
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4090
4094
|
var WidgetNode = (props) => {
|
|
4091
4095
|
const getWidgetParameters = () => {
|
|
@@ -4159,7 +4163,7 @@ var WidgetNode = (props) => {
|
|
|
4159
4163
|
}
|
|
4160
4164
|
return (
|
|
4161
4165
|
// eslint-disable-next-line react-hooks/static-components
|
|
4162
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4166
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react43.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4163
4167
|
WidgetRenderer,
|
|
4164
4168
|
{
|
|
4165
4169
|
params: widgetParams,
|
|
@@ -4176,7 +4180,7 @@ var WidgetNode = (props) => {
|
|
|
4176
4180
|
var WidgetNode_default = WidgetNode;
|
|
4177
4181
|
|
|
4178
4182
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4179
|
-
var
|
|
4183
|
+
var import_react44 = __toESM(require("react"));
|
|
4180
4184
|
|
|
4181
4185
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4182
4186
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -4261,16 +4265,16 @@ var FormContainerNode = (props) => {
|
|
|
4261
4265
|
["input-control"]: InputControlNode_default
|
|
4262
4266
|
};
|
|
4263
4267
|
const { node } = props;
|
|
4264
|
-
const formRef = (0,
|
|
4268
|
+
const formRef = (0, import_react44.useRef)(null);
|
|
4265
4269
|
const initialState = {
|
|
4266
4270
|
inputValues: {},
|
|
4267
4271
|
lastPropertyChanged: ""
|
|
4268
4272
|
};
|
|
4269
|
-
const [formState, dispatch] = (0,
|
|
4270
|
-
const handleInputChange = (0,
|
|
4273
|
+
const [formState, dispatch] = (0, import_react44.useReducer)(FormReducer_default, initialState);
|
|
4274
|
+
const handleInputChange = (0, import_react44.useCallback)((updatedValues) => {
|
|
4271
4275
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4272
4276
|
}, [dispatch]);
|
|
4273
|
-
(0,
|
|
4277
|
+
(0, import_react44.useEffect)(() => {
|
|
4274
4278
|
const fetchInitialData = async () => {
|
|
4275
4279
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4276
4280
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4290,7 +4294,7 @@ var FormContainerNode = (props) => {
|
|
|
4290
4294
|
{
|
|
4291
4295
|
}
|
|
4292
4296
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4293
|
-
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)(
|
|
4294
4298
|
InputControlNode_default,
|
|
4295
4299
|
{
|
|
4296
4300
|
value: formState.inputValues[node2.name],
|
|
@@ -4305,7 +4309,7 @@ var FormContainerNode = (props) => {
|
|
|
4305
4309
|
var FormContainerNode_default = FormContainerNode;
|
|
4306
4310
|
|
|
4307
4311
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4308
|
-
var
|
|
4312
|
+
var import_react49 = __toESM(require("react"));
|
|
4309
4313
|
|
|
4310
4314
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4311
4315
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
@@ -4330,7 +4334,7 @@ var EmbedNode_default = EmbedNode;
|
|
|
4330
4334
|
init_ServiceClient();
|
|
4331
4335
|
|
|
4332
4336
|
// src/components/Slider.tsx
|
|
4333
|
-
var
|
|
4337
|
+
var import_react47 = __toESM(require("react"));
|
|
4334
4338
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4335
4339
|
var Slider = ({
|
|
4336
4340
|
children,
|
|
@@ -4349,13 +4353,13 @@ var Slider = ({
|
|
|
4349
4353
|
pillStyle = "cumulative",
|
|
4350
4354
|
progressPosition = "bottom"
|
|
4351
4355
|
}) => {
|
|
4352
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4353
|
-
const [transition, setTransition] = (0,
|
|
4354
|
-
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)(
|
|
4355
4359
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4356
4360
|
);
|
|
4357
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4358
|
-
(0,
|
|
4361
|
+
const [isPlaying, setIsPlaying] = (0, import_react47.useState)(autoplay);
|
|
4362
|
+
(0, import_react47.useEffect)(() => {
|
|
4359
4363
|
if (typeof slidesToShow === "number") return;
|
|
4360
4364
|
const handleResize = () => {
|
|
4361
4365
|
if (window.innerWidth >= 1024) {
|
|
@@ -4370,7 +4374,7 @@ var Slider = ({
|
|
|
4370
4374
|
window.addEventListener("resize", handleResize);
|
|
4371
4375
|
return () => window.removeEventListener("resize", handleResize);
|
|
4372
4376
|
}, [slidesToShow]);
|
|
4373
|
-
(0,
|
|
4377
|
+
(0, import_react47.useEffect)(() => {
|
|
4374
4378
|
if (!autoplay) return;
|
|
4375
4379
|
const timer = setInterval(() => {
|
|
4376
4380
|
if (isPlaying) {
|
|
@@ -4379,7 +4383,7 @@ var Slider = ({
|
|
|
4379
4383
|
}, autoplay_speed);
|
|
4380
4384
|
return () => clearInterval(timer);
|
|
4381
4385
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4382
|
-
const totalSlides =
|
|
4386
|
+
const totalSlides = import_react47.Children.count(children);
|
|
4383
4387
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4384
4388
|
const nextSlide = () => {
|
|
4385
4389
|
if (currentSlide >= maxSlide) {
|
|
@@ -4424,8 +4428,8 @@ var Slider = ({
|
|
|
4424
4428
|
}
|
|
4425
4429
|
};
|
|
4426
4430
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4427
|
-
const slides =
|
|
4428
|
-
if (!
|
|
4431
|
+
const slides = import_react47.Children.map(children, (child, index) => {
|
|
4432
|
+
if (!import_react47.default.isValidElement(child)) return null;
|
|
4429
4433
|
const childProps = child.props;
|
|
4430
4434
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4431
4435
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
@@ -4433,7 +4437,7 @@ var Slider = ({
|
|
|
4433
4437
|
{
|
|
4434
4438
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4435
4439
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4436
|
-
children: (0,
|
|
4440
|
+
children: (0, import_react47.cloneElement)(child, {
|
|
4437
4441
|
className: mergedClassName
|
|
4438
4442
|
})
|
|
4439
4443
|
},
|
|
@@ -4546,13 +4550,13 @@ var ProgressPill = ({
|
|
|
4546
4550
|
currentSlide,
|
|
4547
4551
|
totalSlides
|
|
4548
4552
|
}) => {
|
|
4549
|
-
const [progress, setProgress] = (0,
|
|
4550
|
-
(0,
|
|
4553
|
+
const [progress, setProgress] = (0, import_react47.useState)(0);
|
|
4554
|
+
(0, import_react47.useEffect)(() => {
|
|
4551
4555
|
if (active) {
|
|
4552
4556
|
setProgress(0);
|
|
4553
4557
|
}
|
|
4554
4558
|
}, [active, index]);
|
|
4555
|
-
(0,
|
|
4559
|
+
(0, import_react47.useEffect)(() => {
|
|
4556
4560
|
if (!active || !isPlaying) {
|
|
4557
4561
|
if (!active) {
|
|
4558
4562
|
setProgress(0);
|
|
@@ -4996,12 +5000,12 @@ var NoDataFound = () => {
|
|
|
4996
5000
|
var NoDataFound_default = NoDataFound;
|
|
4997
5001
|
|
|
4998
5002
|
// src/components/Pagination.tsx
|
|
4999
|
-
var
|
|
5003
|
+
var import_react48 = require("react");
|
|
5000
5004
|
init_StyleTypes();
|
|
5001
5005
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5002
5006
|
var Pagination = (props) => {
|
|
5003
5007
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5004
|
-
const builder = (0,
|
|
5008
|
+
const builder = (0, import_react48.useMemo)(() => {
|
|
5005
5009
|
const b = new OdataBuilder(path);
|
|
5006
5010
|
if (query) b.setQuery(query);
|
|
5007
5011
|
return b;
|
|
@@ -5526,7 +5530,7 @@ var DivContainer = async (props) => {
|
|
|
5526
5530
|
}
|
|
5527
5531
|
const SelectedNode = NodeTypes2[node.type];
|
|
5528
5532
|
if (!SelectedNode) return null;
|
|
5529
|
-
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)(
|
|
5530
5534
|
SelectedNode,
|
|
5531
5535
|
{
|
|
5532
5536
|
node,
|
|
@@ -5628,9 +5632,9 @@ var DivContainer = async (props) => {
|
|
|
5628
5632
|
props.node.autoFormat && "auto-format",
|
|
5629
5633
|
props.node.bgClass
|
|
5630
5634
|
].filter(Boolean).join(" ");
|
|
5631
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react49.default.Fragment, { children: [
|
|
5632
5636
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5633
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5634
5638
|
Wrapper,
|
|
5635
5639
|
{
|
|
5636
5640
|
id: guid,
|
|
@@ -5639,7 +5643,7 @@ var DivContainer = async (props) => {
|
|
|
5639
5643
|
...wrapperProps,
|
|
5640
5644
|
children: dataToRender.map(
|
|
5641
5645
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5642
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5646
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: child }, i)
|
|
5643
5647
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5644
5648
|
)
|
|
5645
5649
|
}
|
|
@@ -5678,11 +5682,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5678
5682
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5679
5683
|
rootNode = pageBodyTree.root;
|
|
5680
5684
|
}
|
|
5681
|
-
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) => {
|
|
5682
5686
|
{
|
|
5683
5687
|
}
|
|
5684
5688
|
const SelectedNode = NodeTypes[node.type];
|
|
5685
|
-
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)(
|
|
5686
5690
|
SelectedNode,
|
|
5687
5691
|
{
|
|
5688
5692
|
node,
|
|
@@ -5698,7 +5702,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5698
5702
|
device: props.device,
|
|
5699
5703
|
widgetRenderer: props.widgetRenderer
|
|
5700
5704
|
}
|
|
5701
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5705
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5702
5706
|
SelectedNode,
|
|
5703
5707
|
{
|
|
5704
5708
|
node,
|
|
@@ -5719,13 +5723,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5719
5723
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5720
5724
|
|
|
5721
5725
|
// src/components/Toast.tsx
|
|
5722
|
-
var
|
|
5726
|
+
var import_react51 = require("react");
|
|
5723
5727
|
init_ToastService();
|
|
5724
5728
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5725
5729
|
var Toast = () => {
|
|
5726
|
-
const [showToast, setShowToast] = (0,
|
|
5727
|
-
const [message, setMessage] = (0,
|
|
5728
|
-
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");
|
|
5729
5733
|
ToastService_default.showError = function(message2) {
|
|
5730
5734
|
setShowToast(true);
|
|
5731
5735
|
setMessage(message2);
|
|
@@ -5833,22 +5837,22 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5833
5837
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
5834
5838
|
|
|
5835
5839
|
// src/components/dataForm/DataList.tsx
|
|
5836
|
-
var
|
|
5840
|
+
var import_react54 = __toESM(require("react"));
|
|
5837
5841
|
var import_navigation2 = require("next/navigation");
|
|
5838
5842
|
|
|
5839
5843
|
// src/components/dataForm/NoContentView.tsx
|
|
5840
|
-
var
|
|
5844
|
+
var import_react52 = __toESM(require("react"));
|
|
5841
5845
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5842
5846
|
var NoContentView = (props) => {
|
|
5843
|
-
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 });
|
|
5844
5848
|
};
|
|
5845
5849
|
var NoContentView_default = NoContentView;
|
|
5846
5850
|
|
|
5847
5851
|
// src/components/dataForm/ContentView.tsx
|
|
5848
|
-
var
|
|
5852
|
+
var import_react53 = __toESM(require("react"));
|
|
5849
5853
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5850
5854
|
var ContentView = (props) => {
|
|
5851
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
5855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_react53.default.Fragment, { children: [
|
|
5852
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: [
|
|
5853
5857
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
5854
5858
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -5897,8 +5901,8 @@ var DataList = (props) => {
|
|
|
5897
5901
|
let activePageNumber = 0;
|
|
5898
5902
|
let pages = 0;
|
|
5899
5903
|
console.log(props.addLinkText);
|
|
5900
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
5901
|
-
(0,
|
|
5904
|
+
const [isDataFound, setIsDataFound] = (0, import_react54.useState)(null);
|
|
5905
|
+
(0, import_react54.useEffect)(() => {
|
|
5902
5906
|
if (props?.dataset) {
|
|
5903
5907
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
5904
5908
|
setIsDataFound(true);
|
|
@@ -5920,8 +5924,8 @@ var DataList = (props) => {
|
|
|
5920
5924
|
inputValues: {},
|
|
5921
5925
|
lastPropertyChanged: ""
|
|
5922
5926
|
};
|
|
5923
|
-
const [formState, dispatch] = (0,
|
|
5924
|
-
const handleFilterChange = (0,
|
|
5927
|
+
const [formState, dispatch] = (0, import_react54.useReducer)(FormReducer_default, initialState);
|
|
5928
|
+
const handleFilterChange = (0, import_react54.useCallback)(
|
|
5925
5929
|
(updatedValues) => {
|
|
5926
5930
|
dispatch({
|
|
5927
5931
|
type: FORM_INPUT_UPDATE,
|
|
@@ -5967,7 +5971,7 @@ var DataList = (props) => {
|
|
|
5967
5971
|
const renderPageNumbers = () => {
|
|
5968
5972
|
if (pages <= 10) {
|
|
5969
5973
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5970
|
-
(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)(
|
|
5971
5975
|
Hyperlink,
|
|
5972
5976
|
{
|
|
5973
5977
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5981,7 +5985,7 @@ var DataList = (props) => {
|
|
|
5981
5985
|
const showLastPages = activePageNumber > pages - 5;
|
|
5982
5986
|
if (showFirstPages) {
|
|
5983
5987
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5984
|
-
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)(
|
|
5985
5989
|
Hyperlink,
|
|
5986
5990
|
{
|
|
5987
5991
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6047,7 +6051,7 @@ var DataList = (props) => {
|
|
|
6047
6051
|
),
|
|
6048
6052
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6049
6053
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6050
|
-
(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)(
|
|
6051
6055
|
Hyperlink,
|
|
6052
6056
|
{
|
|
6053
6057
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6079,7 +6083,7 @@ var DataList = (props) => {
|
|
|
6079
6083
|
Array.from(
|
|
6080
6084
|
{ length: 5 },
|
|
6081
6085
|
(_, index) => activePageNumber - 2 + index
|
|
6082
|
-
).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)(
|
|
6083
6087
|
Hyperlink,
|
|
6084
6088
|
{
|
|
6085
6089
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6125,7 +6129,7 @@ var DataList = (props) => {
|
|
|
6125
6129
|
}
|
|
6126
6130
|
}
|
|
6127
6131
|
};
|
|
6128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react54.default.Fragment, { children: [
|
|
6129
6133
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ContentView_default, { isDataFound, children: [
|
|
6130
6134
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6131
6135
|
"div",
|
|
@@ -6203,7 +6207,7 @@ var DataList = (props) => {
|
|
|
6203
6207
|
}
|
|
6204
6208
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6205
6209
|
console.log("column", column);
|
|
6206
|
-
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)(
|
|
6207
6211
|
"td",
|
|
6208
6212
|
{
|
|
6209
6213
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -6355,7 +6359,7 @@ var DataList = (props) => {
|
|
|
6355
6359
|
var DataList_default = DataList;
|
|
6356
6360
|
|
|
6357
6361
|
// src/components/dataForm/DataListRenderer.tsx
|
|
6358
|
-
var
|
|
6362
|
+
var import_react55 = __toESM(require("react"));
|
|
6359
6363
|
init_ServiceClient();
|
|
6360
6364
|
var import_navigation3 = require("next/navigation");
|
|
6361
6365
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
@@ -6412,14 +6416,14 @@ var DataListRenderer = ({
|
|
|
6412
6416
|
widgetProps
|
|
6413
6417
|
}) => {
|
|
6414
6418
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
6415
|
-
const [columns, setColumns] = (0,
|
|
6416
|
-
const [dataset, setDataset] = (0,
|
|
6417
|
-
const [filter, setFilters] = (0,
|
|
6418
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
6419
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
6420
|
-
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)("");
|
|
6421
6425
|
const pathname = (0, import_navigation3.usePathname)();
|
|
6422
|
-
(0,
|
|
6426
|
+
(0, import_react55.useEffect)(() => {
|
|
6423
6427
|
if (!formDefinition) return;
|
|
6424
6428
|
setColumns(mapApiToColumns(formDefinition));
|
|
6425
6429
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -6432,7 +6436,7 @@ var DataListRenderer = ({
|
|
|
6432
6436
|
setAddLinkHref(resolvedAddLinkHref);
|
|
6433
6437
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
6434
6438
|
}, [formDefinition, params]);
|
|
6435
|
-
(0,
|
|
6439
|
+
(0, import_react55.useEffect)(() => {
|
|
6436
6440
|
const fetchData = async () => {
|
|
6437
6441
|
if (!serviceRoute) return;
|
|
6438
6442
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -6444,10 +6448,10 @@ var DataListRenderer = ({
|
|
|
6444
6448
|
};
|
|
6445
6449
|
fetchData();
|
|
6446
6450
|
}, [serviceRoute, query, params]);
|
|
6447
|
-
const [tabItem, setTabItem] = (0,
|
|
6451
|
+
const [tabItem, setTabItem] = (0, import_react55.useState)();
|
|
6448
6452
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6449
6453
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6450
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_react55.default.Fragment, { children: [
|
|
6451
6455
|
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6452
6456
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6453
6457
|
DataList_default,
|
|
@@ -6468,12 +6472,12 @@ var DataListRenderer = ({
|
|
|
6468
6472
|
var DataListRenderer_default = DataListRenderer;
|
|
6469
6473
|
|
|
6470
6474
|
// src/components/dataForm/DataForm.tsx
|
|
6471
|
-
var
|
|
6475
|
+
var import_react57 = __toESM(require("react"));
|
|
6472
6476
|
init_Button();
|
|
6473
6477
|
init_StyleTypes();
|
|
6474
6478
|
|
|
6475
6479
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6476
|
-
var
|
|
6480
|
+
var import_react56 = __toESM(require("react"));
|
|
6477
6481
|
|
|
6478
6482
|
// src/components/dataForm/StyleTypes.tsx
|
|
6479
6483
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -6511,7 +6515,7 @@ var DataFormChildSection = (props) => {
|
|
|
6511
6515
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
6512
6516
|
};
|
|
6513
6517
|
const childItemsToRender = getChildItemsForRendering();
|
|
6514
|
-
const handleChildInputChange = (0,
|
|
6518
|
+
const handleChildInputChange = (0, import_react56.useCallback)(
|
|
6515
6519
|
(updatedValues) => {
|
|
6516
6520
|
if (isOneToOne) {
|
|
6517
6521
|
props.callback({
|
|
@@ -6538,7 +6542,7 @@ var DataFormChildSection = (props) => {
|
|
|
6538
6542
|
},
|
|
6539
6543
|
[props, isOneToOne, childItemsToRender]
|
|
6540
6544
|
);
|
|
6541
|
-
const onAddRow = (0,
|
|
6545
|
+
const onAddRow = (0, import_react56.useCallback)(() => {
|
|
6542
6546
|
props.callback({
|
|
6543
6547
|
sectionName: props.section.name,
|
|
6544
6548
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -6547,7 +6551,7 @@ var DataFormChildSection = (props) => {
|
|
|
6547
6551
|
rowIndex: -1
|
|
6548
6552
|
});
|
|
6549
6553
|
}, [props]);
|
|
6550
|
-
const onDeleteRow = (0,
|
|
6554
|
+
const onDeleteRow = (0, import_react56.useCallback)(
|
|
6551
6555
|
(filteredIndex) => {
|
|
6552
6556
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
6553
6557
|
if (visibleItem) {
|
|
@@ -6567,7 +6571,7 @@ var DataFormChildSection = (props) => {
|
|
|
6567
6571
|
childItemsToRender,
|
|
6568
6572
|
allChildItems: childItems
|
|
6569
6573
|
});
|
|
6570
|
-
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: [
|
|
6571
6575
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
6572
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: [
|
|
6573
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: [
|
|
@@ -6589,7 +6593,7 @@ var DataFormChildSection = (props) => {
|
|
|
6589
6593
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6590
6594
|
const { item, originalIndex } = visibleItem;
|
|
6591
6595
|
const rowKey = originalIndex;
|
|
6592
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: section.sectionRows.map(
|
|
6593
6597
|
(sectionRow, sectionRowIndex) => {
|
|
6594
6598
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6595
6599
|
"tr",
|
|
@@ -6660,7 +6664,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
6660
6664
|
// src/components/dataForm/DataForm.tsx
|
|
6661
6665
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6662
6666
|
var DataForm = (props) => {
|
|
6663
|
-
const formRef = (0,
|
|
6667
|
+
const formRef = (0, import_react57.useRef)(null);
|
|
6664
6668
|
console.log(props.dataItem, "dssads");
|
|
6665
6669
|
const initialState = {
|
|
6666
6670
|
inputValues: {},
|
|
@@ -6669,9 +6673,9 @@ var DataForm = (props) => {
|
|
|
6669
6673
|
const childInitialState = {
|
|
6670
6674
|
inputValues: []
|
|
6671
6675
|
};
|
|
6672
|
-
const [formState, dispatch] = (0,
|
|
6676
|
+
const [formState, dispatch] = (0, import_react57.useReducer)(FormReducer_default, initialState);
|
|
6673
6677
|
console.log(props.sections, "sections");
|
|
6674
|
-
const clearHiddenChildSections = (0,
|
|
6678
|
+
const clearHiddenChildSections = (0, import_react57.useCallback)(
|
|
6675
6679
|
(changedProperty, newValues) => {
|
|
6676
6680
|
if (!props.sections) return;
|
|
6677
6681
|
const allChildSections = [];
|
|
@@ -6709,7 +6713,7 @@ var DataForm = (props) => {
|
|
|
6709
6713
|
},
|
|
6710
6714
|
[props.sections, formState.inputValues]
|
|
6711
6715
|
);
|
|
6712
|
-
const handleInputChange = (0,
|
|
6716
|
+
const handleInputChange = (0, import_react57.useCallback)(
|
|
6713
6717
|
async (updatedValues) => {
|
|
6714
6718
|
dispatch({
|
|
6715
6719
|
type: FORM_INPUT_UPDATE,
|
|
@@ -6724,7 +6728,7 @@ var DataForm = (props) => {
|
|
|
6724
6728
|
},
|
|
6725
6729
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
6726
6730
|
);
|
|
6727
|
-
const fetchData = (0,
|
|
6731
|
+
const fetchData = (0, import_react57.useCallback)(async () => {
|
|
6728
6732
|
if (!props.rules) return;
|
|
6729
6733
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
6730
6734
|
return;
|
|
@@ -6755,7 +6759,7 @@ var DataForm = (props) => {
|
|
|
6755
6759
|
console.error("Error fetching data:", error);
|
|
6756
6760
|
}
|
|
6757
6761
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
6758
|
-
(0,
|
|
6762
|
+
(0, import_react57.useEffect)(() => {
|
|
6759
6763
|
fetchData();
|
|
6760
6764
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
6761
6765
|
function replacePlaceholders(template, context, params) {
|
|
@@ -6775,7 +6779,7 @@ var DataForm = (props) => {
|
|
|
6775
6779
|
}
|
|
6776
6780
|
);
|
|
6777
6781
|
}
|
|
6778
|
-
const handleChildSectionChangeCallback = (0,
|
|
6782
|
+
const handleChildSectionChangeCallback = (0, import_react57.useCallback)(
|
|
6779
6783
|
(params) => {
|
|
6780
6784
|
dispatch({
|
|
6781
6785
|
type: params.actionType,
|
|
@@ -6820,7 +6824,7 @@ var DataForm = (props) => {
|
|
|
6820
6824
|
});
|
|
6821
6825
|
return cloned;
|
|
6822
6826
|
}
|
|
6823
|
-
const onClick = (0,
|
|
6827
|
+
const onClick = (0, import_react57.useCallback)(async () => {
|
|
6824
6828
|
if (props.onClick) {
|
|
6825
6829
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
6826
6830
|
const normalizedValues = normalizeChildSections(
|
|
@@ -6836,21 +6840,21 @@ var DataForm = (props) => {
|
|
|
6836
6840
|
return { isSuccessful: true };
|
|
6837
6841
|
}
|
|
6838
6842
|
}, [formState, props]);
|
|
6839
|
-
const handleAdditionalOnClick = (0,
|
|
6843
|
+
const handleAdditionalOnClick = (0, import_react57.useCallback)(async () => {
|
|
6840
6844
|
if (props.additionalActions?.onClick) {
|
|
6841
6845
|
return await props.additionalActions.onClick(formState);
|
|
6842
6846
|
} else {
|
|
6843
6847
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
6844
6848
|
}
|
|
6845
6849
|
}, [formState, props]);
|
|
6846
|
-
const onDelete = (0,
|
|
6850
|
+
const onDelete = (0, import_react57.useCallback)(async () => {
|
|
6847
6851
|
if (props.onDelete) {
|
|
6848
6852
|
return await props.onDelete(formState);
|
|
6849
6853
|
} else {
|
|
6850
6854
|
return { isSuccessful: true };
|
|
6851
6855
|
}
|
|
6852
6856
|
}, [formState, props]);
|
|
6853
|
-
(0,
|
|
6857
|
+
(0, import_react57.useEffect)(() => {
|
|
6854
6858
|
if (props.dataItem) {
|
|
6855
6859
|
dispatch({
|
|
6856
6860
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -6878,7 +6882,7 @@ var DataForm = (props) => {
|
|
|
6878
6882
|
return false;
|
|
6879
6883
|
}
|
|
6880
6884
|
}
|
|
6881
|
-
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: [
|
|
6882
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)(
|
|
6883
6887
|
"div",
|
|
6884
6888
|
{
|
|
@@ -6912,7 +6916,7 @@ var DataForm = (props) => {
|
|
|
6912
6916
|
}
|
|
6913
6917
|
},
|
|
6914
6918
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
6915
|
-
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: [
|
|
6916
6920
|
section.sectionRows?.map(
|
|
6917
6921
|
(sectionRow, sectionRowIndex) => {
|
|
6918
6922
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6923,7 +6927,7 @@ var DataForm = (props) => {
|
|
|
6923
6927
|
sectionRow.visible
|
|
6924
6928
|
);
|
|
6925
6929
|
}
|
|
6926
|
-
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) => {
|
|
6927
6931
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6928
6932
|
"div",
|
|
6929
6933
|
{
|