@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260620042502 → 0.8.1-dev.20260623053723
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +312 -175
- package/dist/index.mjs +306 -169
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1252,7 +1252,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1252
1252
|
const containerRef = useRef2(null);
|
|
1253
1253
|
const [isCreateOpen, setIsCreateOpen] = useState4(false);
|
|
1254
1254
|
const [formData, setFormData] = useState4({});
|
|
1255
|
-
const
|
|
1255
|
+
const getNestedValue6 = (obj, path) => {
|
|
1256
1256
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
1257
1257
|
};
|
|
1258
1258
|
useEffect5(() => {
|
|
@@ -1290,7 +1290,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1290
1290
|
props.dataSourceDependsOn
|
|
1291
1291
|
]);
|
|
1292
1292
|
const filteredItems = list?.filter((item) => {
|
|
1293
|
-
const value =
|
|
1293
|
+
const value = getNestedValue6(item, props.dataTextFieldName);
|
|
1294
1294
|
return value?.toLowerCase().includes(searchTerm?.toLowerCase());
|
|
1295
1295
|
});
|
|
1296
1296
|
const playBeep = () => {
|
|
@@ -1321,7 +1321,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1321
1321
|
}, [searchTerm]);
|
|
1322
1322
|
const handleSelect = (event, item) => {
|
|
1323
1323
|
event.preventDefault();
|
|
1324
|
-
setSearchTerm(
|
|
1324
|
+
setSearchTerm(getNestedValue6(item, props.dataTextFieldName));
|
|
1325
1325
|
if (props.callback) {
|
|
1326
1326
|
const val = {};
|
|
1327
1327
|
props.callback({
|
|
@@ -1476,7 +1476,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1476
1476
|
role: "option",
|
|
1477
1477
|
tabIndex: -1,
|
|
1478
1478
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
1479
|
-
children: /* @__PURE__ */ jsx25("span", { children:
|
|
1479
|
+
children: /* @__PURE__ */ jsx25("span", { children: getNestedValue6(item, props.dataTextFieldName) })
|
|
1480
1480
|
}
|
|
1481
1481
|
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ jsx25("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
1482
1482
|
}
|
|
@@ -3985,6 +3985,9 @@ var extractRolesFromToken = (decodedPayload) => {
|
|
|
3985
3985
|
if (decodedPayload.role && typeof decodedPayload.role === "string") {
|
|
3986
3986
|
roles.push(decodedPayload.role);
|
|
3987
3987
|
}
|
|
3988
|
+
if (decodedPayload.rolecode && typeof decodedPayload.rolecode === "string") {
|
|
3989
|
+
roles.push(decodedPayload.rolecode);
|
|
3990
|
+
}
|
|
3988
3991
|
if (decodedPayload.roles && Array.isArray(decodedPayload.roles)) {
|
|
3989
3992
|
roles.push(...decodedPayload.roles);
|
|
3990
3993
|
}
|
|
@@ -4443,8 +4446,141 @@ var DivContainer = async (props) => {
|
|
|
4443
4446
|
};
|
|
4444
4447
|
var DivContainer_default = DivContainer;
|
|
4445
4448
|
|
|
4449
|
+
// src/components/pageRenderingEngine/nodes/DocumentNode.tsx
|
|
4450
|
+
import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4451
|
+
var getNestedValue5 = (obj, path) => {
|
|
4452
|
+
if (!obj || !path) return void 0;
|
|
4453
|
+
return path.split(".").reduce((current, key) => {
|
|
4454
|
+
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4455
|
+
}, obj);
|
|
4456
|
+
};
|
|
4457
|
+
var PdfIcon = () => /* @__PURE__ */ jsxs33("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-red-500 w-8 h-8", children: [
|
|
4458
|
+
/* @__PURE__ */ jsx60("path", { d: "M7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4459
|
+
/* @__PURE__ */ jsx60("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4460
|
+
/* @__PURE__ */ jsx60("path", { d: "M9 14H11C11.5304 14 12.0391 13.7893 12.4142 13.4142C12.7893 13.0391 13 12.5304 13 12C13 11.4696 12.7893 10.9609 12.4142 10.5858C12.0391 10.2107 11.5304 10 11 10H9V18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4461
|
+
/* @__PURE__ */ jsx60("path", { d: "M9 14H12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4462
|
+
] });
|
|
4463
|
+
var ExcelIcon = () => /* @__PURE__ */ jsxs33("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-green-600 w-8 h-8", children: [
|
|
4464
|
+
/* @__PURE__ */ jsx60("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4465
|
+
/* @__PURE__ */ jsx60("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4466
|
+
/* @__PURE__ */ jsx60("path", { d: "M9 11L15 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4467
|
+
/* @__PURE__ */ jsx60("path", { d: "M15 11L9 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4468
|
+
] });
|
|
4469
|
+
var WordIcon = () => /* @__PURE__ */ jsxs33("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-blue-600 w-8 h-8", children: [
|
|
4470
|
+
/* @__PURE__ */ jsx60("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4471
|
+
/* @__PURE__ */ jsx60("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4472
|
+
/* @__PURE__ */ jsx60("path", { d: "M8 12L10 17L12 14L14 17L16 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4473
|
+
] });
|
|
4474
|
+
var ImageIcon = () => /* @__PURE__ */ jsxs33("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-yellow-500 w-8 h-8", children: [
|
|
4475
|
+
/* @__PURE__ */ jsx60("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15ZM21 15L16 10L9 17L6 14L3 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4476
|
+
/* @__PURE__ */ jsx60("path", { d: "M16 8C16 8.55228 15.5523 9 15 9C14.4477 9 14 8.55228 14 8C14 7.44772 14.4477 7 15 7C15.5523 7 16 7.44772 16 8Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4477
|
+
] });
|
|
4478
|
+
var StandardIcon = () => /* @__PURE__ */ jsxs33("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-gray-500 w-8 h-8", children: [
|
|
4479
|
+
/* @__PURE__ */ jsx60("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
4480
|
+
/* @__PURE__ */ jsx60("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4481
|
+
] });
|
|
4482
|
+
var getFileDetails = (url) => {
|
|
4483
|
+
const extMatch = url.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);
|
|
4484
|
+
const ext = extMatch ? extMatch[1].toLowerCase() : "";
|
|
4485
|
+
let Icon2 = StandardIcon;
|
|
4486
|
+
let extLabel = "FILE";
|
|
4487
|
+
if (["pdf"].includes(ext)) {
|
|
4488
|
+
Icon2 = PdfIcon;
|
|
4489
|
+
extLabel = "PDF";
|
|
4490
|
+
} else if (["xls", "xlsx", "csv"].includes(ext)) {
|
|
4491
|
+
Icon2 = ExcelIcon;
|
|
4492
|
+
extLabel = "Excel";
|
|
4493
|
+
} else if (["doc", "docx"].includes(ext)) {
|
|
4494
|
+
Icon2 = WordIcon;
|
|
4495
|
+
extLabel = ext.toUpperCase();
|
|
4496
|
+
} else if (["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext)) {
|
|
4497
|
+
Icon2 = ImageIcon;
|
|
4498
|
+
extLabel = ext.toUpperCase();
|
|
4499
|
+
} else if (ext) {
|
|
4500
|
+
extLabel = ext.toUpperCase();
|
|
4501
|
+
}
|
|
4502
|
+
return { Icon: Icon2, extLabel };
|
|
4503
|
+
};
|
|
4504
|
+
var DocumentNode = (props) => {
|
|
4505
|
+
let documentUrl;
|
|
4506
|
+
let documentTitle;
|
|
4507
|
+
if (props.dataitem && props.node.documentKey) {
|
|
4508
|
+
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
4509
|
+
if (typeof docData === "string") {
|
|
4510
|
+
const trimmed = docData.trim();
|
|
4511
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
4512
|
+
try {
|
|
4513
|
+
const parsed = JSON.parse(trimmed);
|
|
4514
|
+
const asset = Array.isArray(parsed) ? parsed[0] : parsed;
|
|
4515
|
+
if (asset && asset.assetUrl) {
|
|
4516
|
+
documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
|
|
4517
|
+
if (asset.title) documentTitle = asset.title;
|
|
4518
|
+
}
|
|
4519
|
+
} catch (e) {
|
|
4520
|
+
}
|
|
4521
|
+
} else {
|
|
4522
|
+
documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, docData);
|
|
4523
|
+
}
|
|
4524
|
+
} else if (Array.isArray(docData) && docData.length > 0) {
|
|
4525
|
+
const asset = docData[0];
|
|
4526
|
+
if (asset && asset.assetUrl) {
|
|
4527
|
+
documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
|
|
4528
|
+
if (asset.title) documentTitle = asset.title;
|
|
4529
|
+
}
|
|
4530
|
+
} else if (docData && typeof docData === "object") {
|
|
4531
|
+
const asset = docData;
|
|
4532
|
+
if (asset && asset.assetUrl) {
|
|
4533
|
+
documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
|
|
4534
|
+
if (asset.title) documentTitle = asset.title;
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
}
|
|
4538
|
+
if (!documentUrl) return null;
|
|
4539
|
+
const { Icon: Icon2, extLabel } = getFileDetails(documentUrl);
|
|
4540
|
+
if (!documentTitle) {
|
|
4541
|
+
try {
|
|
4542
|
+
const pathName = new URL(documentUrl).pathname;
|
|
4543
|
+
documentTitle = pathName.split("/").pop() || "Document";
|
|
4544
|
+
} catch {
|
|
4545
|
+
documentTitle = documentUrl.split("/").pop() || "Document";
|
|
4546
|
+
}
|
|
4547
|
+
documentTitle = documentTitle.replace(/\.[^/.]+$/, "");
|
|
4548
|
+
}
|
|
4549
|
+
return /* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between py-4 border-b border-gray-100 bg-white", children: [
|
|
4550
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-4", children: [
|
|
4551
|
+
/* @__PURE__ */ jsx60("div", { className: "flex items-center justify-center p-2 rounded bg-gray-50 border border-gray-100", children: /* @__PURE__ */ jsx60(Icon2, {}) }),
|
|
4552
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-baseline space-x-2", children: [
|
|
4553
|
+
/* @__PURE__ */ jsx60("h4", { className: "text-base font-semibold text-gray-800", children: documentTitle }),
|
|
4554
|
+
/* @__PURE__ */ jsxs33("span", { className: "text-sm font-medium text-gray-400", children: [
|
|
4555
|
+
"(",
|
|
4556
|
+
extLabel,
|
|
4557
|
+
")"
|
|
4558
|
+
] })
|
|
4559
|
+
] })
|
|
4560
|
+
] }),
|
|
4561
|
+
/* @__PURE__ */ jsxs33(
|
|
4562
|
+
"a",
|
|
4563
|
+
{
|
|
4564
|
+
href: documentUrl,
|
|
4565
|
+
download: true,
|
|
4566
|
+
target: "_blank",
|
|
4567
|
+
rel: "noreferrer",
|
|
4568
|
+
className: "inline-flex items-center px-4 py-2 text-sm font-medium text-blue-600 bg-white border border-blue-600 rounded hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors",
|
|
4569
|
+
children: [
|
|
4570
|
+
/* @__PURE__ */ jsxs33("svg", { className: "w-4 h-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4571
|
+
/* @__PURE__ */ jsx60("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }),
|
|
4572
|
+
/* @__PURE__ */ jsx60("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 12v5m0 0l-3-3m3 3l3-3M12 8v4" })
|
|
4573
|
+
] }),
|
|
4574
|
+
"Download"
|
|
4575
|
+
]
|
|
4576
|
+
}
|
|
4577
|
+
)
|
|
4578
|
+
] });
|
|
4579
|
+
};
|
|
4580
|
+
var DocumentNode_default = DocumentNode;
|
|
4581
|
+
|
|
4446
4582
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
4447
|
-
import { jsx as
|
|
4583
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4448
4584
|
var NodeTypes = {
|
|
4449
4585
|
["paragraph"]: ParagraphNode_default,
|
|
4450
4586
|
["heading"]: HeadingNode_default,
|
|
@@ -4458,7 +4594,8 @@ var NodeTypes = {
|
|
|
4458
4594
|
["form-container"]: FormContainerNode_default,
|
|
4459
4595
|
["div-container"]: DivContainer_default,
|
|
4460
4596
|
["svg-icon"]: SVGIconNode_default,
|
|
4461
|
-
["embed"]: EmbedNode_default
|
|
4597
|
+
["embed"]: EmbedNode_default,
|
|
4598
|
+
["document"]: DocumentNode_default
|
|
4462
4599
|
};
|
|
4463
4600
|
var PageBodyRenderer = (props) => {
|
|
4464
4601
|
let pageBodyTree;
|
|
@@ -4480,14 +4617,14 @@ var PageBodyRenderer = (props) => {
|
|
|
4480
4617
|
}
|
|
4481
4618
|
return true;
|
|
4482
4619
|
};
|
|
4483
|
-
return /* @__PURE__ */
|
|
4620
|
+
return /* @__PURE__ */ jsx61(React42.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4484
4621
|
{
|
|
4485
4622
|
}
|
|
4486
4623
|
const SelectedNode = NodeTypes[node.type];
|
|
4487
4624
|
if (!shouldRenderNode(node)) {
|
|
4488
4625
|
return null;
|
|
4489
4626
|
}
|
|
4490
|
-
return /* @__PURE__ */
|
|
4627
|
+
return /* @__PURE__ */ jsx61(React42.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx61(React42.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx61(React42.Fragment, { children: /* @__PURE__ */ jsx61(
|
|
4491
4628
|
SelectedNode,
|
|
4492
4629
|
{
|
|
4493
4630
|
node,
|
|
@@ -4503,7 +4640,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4503
4640
|
device: props.device,
|
|
4504
4641
|
widgetRenderer: props.widgetRenderer
|
|
4505
4642
|
}
|
|
4506
|
-
) }) : /* @__PURE__ */
|
|
4643
|
+
) }) : /* @__PURE__ */ jsx61(React42.Fragment, { children: /* @__PURE__ */ jsx61(
|
|
4507
4644
|
SelectedNode,
|
|
4508
4645
|
{
|
|
4509
4646
|
node,
|
|
@@ -4525,7 +4662,7 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
4525
4662
|
|
|
4526
4663
|
// src/components/Toast.tsx
|
|
4527
4664
|
import { useState as useState8 } from "react";
|
|
4528
|
-
import { Fragment as Fragment9, jsx as
|
|
4665
|
+
import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4529
4666
|
var Toast = () => {
|
|
4530
4667
|
const [showToast, setShowToast] = useState8(false);
|
|
4531
4668
|
const [message, setMessage] = useState8("");
|
|
@@ -4568,8 +4705,8 @@ var Toast = () => {
|
|
|
4568
4705
|
const closeToast = () => {
|
|
4569
4706
|
setShowToast(false);
|
|
4570
4707
|
};
|
|
4571
|
-
return /* @__PURE__ */
|
|
4572
|
-
/* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx62(Fragment9, { children: showToast && /* @__PURE__ */ jsx62("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs34("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
4709
|
+
/* @__PURE__ */ jsx62(
|
|
4573
4710
|
"span",
|
|
4574
4711
|
{
|
|
4575
4712
|
className: "font-medium text-inherit text-sm",
|
|
@@ -4577,7 +4714,7 @@ var Toast = () => {
|
|
|
4577
4714
|
children: message
|
|
4578
4715
|
}
|
|
4579
4716
|
),
|
|
4580
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ jsx62("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ jsx62(
|
|
4581
4718
|
"svg",
|
|
4582
4719
|
{
|
|
4583
4720
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4585,7 +4722,7 @@ var Toast = () => {
|
|
|
4585
4722
|
fill: "none",
|
|
4586
4723
|
viewBox: "0 0 24 24",
|
|
4587
4724
|
stroke: "currentColor",
|
|
4588
|
-
children: /* @__PURE__ */
|
|
4725
|
+
children: /* @__PURE__ */ jsx62("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
4589
4726
|
}
|
|
4590
4727
|
) })
|
|
4591
4728
|
] }) }) });
|
|
@@ -4595,7 +4732,7 @@ var Toast_default = Toast;
|
|
|
4595
4732
|
// src/components/NavigationTabsV2.tsx
|
|
4596
4733
|
import Link3 from "next/link";
|
|
4597
4734
|
import { usePathname } from "next/navigation";
|
|
4598
|
-
import { jsx as
|
|
4735
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
4599
4736
|
function resolveRoutePlaceholders(route, params) {
|
|
4600
4737
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
4601
4738
|
const value = params[key];
|
|
@@ -4620,8 +4757,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
4620
4757
|
isActive: tab.isActive
|
|
4621
4758
|
})) || [];
|
|
4622
4759
|
if (mappedTabs.length === 0) return null;
|
|
4623
|
-
return /* @__PURE__ */
|
|
4624
|
-
return /* @__PURE__ */
|
|
4760
|
+
return /* @__PURE__ */ jsx63("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
4761
|
+
return /* @__PURE__ */ jsx63(Link3, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ jsx63(
|
|
4625
4762
|
"div",
|
|
4626
4763
|
{
|
|
4627
4764
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -4639,46 +4776,46 @@ import { useRouter } from "next/navigation";
|
|
|
4639
4776
|
|
|
4640
4777
|
// src/components/dataForm/NoContentView.tsx
|
|
4641
4778
|
import React44 from "react";
|
|
4642
|
-
import { jsx as
|
|
4779
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4643
4780
|
var NoContentView = (props) => {
|
|
4644
|
-
return /* @__PURE__ */
|
|
4781
|
+
return /* @__PURE__ */ jsx64(React44.Fragment, { children: props.isDataFound === false && props.children });
|
|
4645
4782
|
};
|
|
4646
4783
|
var NoContentView_default = NoContentView;
|
|
4647
4784
|
|
|
4648
4785
|
// src/components/dataForm/ContentView.tsx
|
|
4649
4786
|
import React45 from "react";
|
|
4650
|
-
import { jsx as
|
|
4787
|
+
import { jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4651
4788
|
var ContentView = (props) => {
|
|
4652
|
-
return /* @__PURE__ */
|
|
4653
|
-
props.isDataFound == null && /* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4655
|
-
/* @__PURE__ */
|
|
4656
|
-
/* @__PURE__ */
|
|
4657
|
-
/* @__PURE__ */
|
|
4658
|
-
/* @__PURE__ */
|
|
4789
|
+
return /* @__PURE__ */ jsxs35(React45.Fragment, { children: [
|
|
4790
|
+
props.isDataFound == null && /* @__PURE__ */ jsx65("div", { className: "", children: /* @__PURE__ */ jsxs35("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
4791
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex items-center mb-4", children: [
|
|
4792
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
4793
|
+
/* @__PURE__ */ jsxs35("div", { className: "ml-2", children: [
|
|
4794
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
4795
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
4659
4796
|
] })
|
|
4660
4797
|
] }),
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
/* @__PURE__ */
|
|
4663
|
-
/* @__PURE__ */
|
|
4664
|
-
/* @__PURE__ */
|
|
4665
|
-
/* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ jsxs35("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
4799
|
+
/* @__PURE__ */ jsxs35("div", { className: "animate-pulse", children: [
|
|
4800
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
4801
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
4802
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
4803
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
4804
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
4668
4805
|
] }),
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
/* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4672
|
-
/* @__PURE__ */
|
|
4673
|
-
/* @__PURE__ */
|
|
4674
|
-
/* @__PURE__ */
|
|
4806
|
+
/* @__PURE__ */ jsxs35("div", { className: "animate-pulse", children: [
|
|
4807
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
4808
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
4809
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
4810
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
4811
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
4675
4812
|
] }),
|
|
4676
|
-
/* @__PURE__ */
|
|
4677
|
-
/* @__PURE__ */
|
|
4678
|
-
/* @__PURE__ */
|
|
4679
|
-
/* @__PURE__ */
|
|
4680
|
-
/* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ jsxs35("div", { className: "animate-pulse", children: [
|
|
4814
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
4815
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
4816
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
4817
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
4818
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
4682
4819
|
] })
|
|
4683
4820
|
] })
|
|
4684
4821
|
] }) }),
|
|
@@ -4688,7 +4825,7 @@ var ContentView = (props) => {
|
|
|
4688
4825
|
var ContentView_default = ContentView;
|
|
4689
4826
|
|
|
4690
4827
|
// src/components/dataForm/DataList.tsx
|
|
4691
|
-
import { Fragment as Fragment10, jsx as
|
|
4828
|
+
import { Fragment as Fragment10, jsx as jsx66, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4692
4829
|
var DataList = (props) => {
|
|
4693
4830
|
const router = useRouter();
|
|
4694
4831
|
let builder = new OdataBuilder(props.path);
|
|
@@ -4726,7 +4863,7 @@ var DataList = (props) => {
|
|
|
4726
4863
|
if (path.includes(".")) {
|
|
4727
4864
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
4728
4865
|
} else if (Array.isArray(obj[path])) {
|
|
4729
|
-
return obj[path].map((item, index) => /* @__PURE__ */
|
|
4866
|
+
return obj[path].map((item, index) => /* @__PURE__ */ jsx66("div", { children: item }, index));
|
|
4730
4867
|
} else {
|
|
4731
4868
|
return obj[path];
|
|
4732
4869
|
}
|
|
@@ -4805,30 +4942,30 @@ var DataList = (props) => {
|
|
|
4805
4942
|
const renderPageNumbers = () => {
|
|
4806
4943
|
if (pages <= 10) {
|
|
4807
4944
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
4808
|
-
(page) => /* @__PURE__ */
|
|
4945
|
+
(page) => /* @__PURE__ */ jsx66(React46.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ jsx66(
|
|
4809
4946
|
Hyperlink,
|
|
4810
4947
|
{
|
|
4811
4948
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
4812
4949
|
href: builder.getNewPageUrl(page),
|
|
4813
4950
|
children: page
|
|
4814
4951
|
}
|
|
4815
|
-
) : /* @__PURE__ */
|
|
4952
|
+
) : /* @__PURE__ */ jsx66("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
4816
4953
|
);
|
|
4817
4954
|
} else {
|
|
4818
4955
|
const showFirstPages = activePageNumber <= 5;
|
|
4819
4956
|
const showLastPages = activePageNumber > pages - 5;
|
|
4820
4957
|
if (showFirstPages) {
|
|
4821
|
-
return /* @__PURE__ */
|
|
4822
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */
|
|
4958
|
+
return /* @__PURE__ */ jsxs36(Fragment10, { children: [
|
|
4959
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ jsx66(React46.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ jsx66(
|
|
4823
4960
|
Hyperlink,
|
|
4824
4961
|
{
|
|
4825
4962
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
4826
4963
|
href: builder.getNewPageUrl(page),
|
|
4827
4964
|
children: page
|
|
4828
4965
|
}
|
|
4829
|
-
) : /* @__PURE__ */
|
|
4830
|
-
/* @__PURE__ */
|
|
4831
|
-
/* @__PURE__ */
|
|
4966
|
+
) : /* @__PURE__ */ jsx66("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
4967
|
+
/* @__PURE__ */ jsx66("span", { className: "px-2 py-1", children: "..." }),
|
|
4968
|
+
/* @__PURE__ */ jsx66(
|
|
4832
4969
|
Hyperlink,
|
|
4833
4970
|
{
|
|
4834
4971
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4836,7 +4973,7 @@ var DataList = (props) => {
|
|
|
4836
4973
|
children: pages - 1
|
|
4837
4974
|
}
|
|
4838
4975
|
),
|
|
4839
|
-
/* @__PURE__ */
|
|
4976
|
+
/* @__PURE__ */ jsx66(
|
|
4840
4977
|
Hyperlink,
|
|
4841
4978
|
{
|
|
4842
4979
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4844,7 +4981,7 @@ var DataList = (props) => {
|
|
|
4844
4981
|
children: pages
|
|
4845
4982
|
}
|
|
4846
4983
|
),
|
|
4847
|
-
/* @__PURE__ */
|
|
4984
|
+
/* @__PURE__ */ jsx66("div", { className: "relative inline-block", children: /* @__PURE__ */ jsxs36(
|
|
4848
4985
|
"select",
|
|
4849
4986
|
{
|
|
4850
4987
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -4856,18 +4993,18 @@ var DataList = (props) => {
|
|
|
4856
4993
|
}
|
|
4857
4994
|
},
|
|
4858
4995
|
children: [
|
|
4859
|
-
/* @__PURE__ */
|
|
4996
|
+
/* @__PURE__ */ jsx66("option", { className: "", value: "", children: "Jump to" }),
|
|
4860
4997
|
Array.from(
|
|
4861
4998
|
{ length: Math.max(0, pages - 10) },
|
|
4862
4999
|
(_, index) => index + 9
|
|
4863
|
-
).map((page) => /* @__PURE__ */
|
|
5000
|
+
).map((page) => /* @__PURE__ */ jsx66("option", { value: page, children: page }, page))
|
|
4864
5001
|
]
|
|
4865
5002
|
}
|
|
4866
5003
|
) })
|
|
4867
5004
|
] });
|
|
4868
5005
|
} else if (showLastPages) {
|
|
4869
|
-
return /* @__PURE__ */
|
|
4870
|
-
/* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ jsxs36(Fragment10, { children: [
|
|
5007
|
+
/* @__PURE__ */ jsx66(
|
|
4871
5008
|
Hyperlink,
|
|
4872
5009
|
{
|
|
4873
5010
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4875,7 +5012,7 @@ var DataList = (props) => {
|
|
|
4875
5012
|
children: "1"
|
|
4876
5013
|
}
|
|
4877
5014
|
),
|
|
4878
|
-
/* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ jsx66(
|
|
4879
5016
|
Hyperlink,
|
|
4880
5017
|
{
|
|
4881
5018
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4883,21 +5020,21 @@ var DataList = (props) => {
|
|
|
4883
5020
|
children: "2"
|
|
4884
5021
|
}
|
|
4885
5022
|
),
|
|
4886
|
-
/* @__PURE__ */
|
|
5023
|
+
/* @__PURE__ */ jsx66("span", { className: "px-2 py-1", children: "..." }),
|
|
4887
5024
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
4888
|
-
(page) => /* @__PURE__ */
|
|
5025
|
+
(page) => /* @__PURE__ */ jsx66(React46.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ jsx66(
|
|
4889
5026
|
Hyperlink,
|
|
4890
5027
|
{
|
|
4891
5028
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
4892
5029
|
href: builder.getNewPageUrl(page),
|
|
4893
5030
|
children: page
|
|
4894
5031
|
}
|
|
4895
|
-
) : /* @__PURE__ */
|
|
5032
|
+
) : /* @__PURE__ */ jsx66("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
4896
5033
|
)
|
|
4897
5034
|
] });
|
|
4898
5035
|
} else {
|
|
4899
|
-
return /* @__PURE__ */
|
|
4900
|
-
/* @__PURE__ */
|
|
5036
|
+
return /* @__PURE__ */ jsxs36(Fragment10, { children: [
|
|
5037
|
+
/* @__PURE__ */ jsx66(
|
|
4901
5038
|
Hyperlink,
|
|
4902
5039
|
{
|
|
4903
5040
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4905,7 +5042,7 @@ var DataList = (props) => {
|
|
|
4905
5042
|
children: "1"
|
|
4906
5043
|
}
|
|
4907
5044
|
),
|
|
4908
|
-
/* @__PURE__ */
|
|
5045
|
+
/* @__PURE__ */ jsx66(
|
|
4909
5046
|
Hyperlink,
|
|
4910
5047
|
{
|
|
4911
5048
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4913,20 +5050,20 @@ var DataList = (props) => {
|
|
|
4913
5050
|
children: "2"
|
|
4914
5051
|
}
|
|
4915
5052
|
),
|
|
4916
|
-
/* @__PURE__ */
|
|
5053
|
+
/* @__PURE__ */ jsx66("span", { className: "px-2 py-1", children: "..." }),
|
|
4917
5054
|
Array.from(
|
|
4918
5055
|
{ length: 5 },
|
|
4919
5056
|
(_, index) => activePageNumber - 2 + index
|
|
4920
|
-
).map((page) => /* @__PURE__ */
|
|
5057
|
+
).map((page) => /* @__PURE__ */ jsx66(React46.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ jsx66(
|
|
4921
5058
|
Hyperlink,
|
|
4922
5059
|
{
|
|
4923
5060
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
4924
5061
|
href: builder.getNewPageUrl(page),
|
|
4925
5062
|
children: page
|
|
4926
5063
|
}
|
|
4927
|
-
) : /* @__PURE__ */
|
|
4928
|
-
/* @__PURE__ */
|
|
4929
|
-
/* @__PURE__ */
|
|
5064
|
+
) : /* @__PURE__ */ jsx66("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
5065
|
+
/* @__PURE__ */ jsx66("span", { className: "px-2 py-1", children: "..." }),
|
|
5066
|
+
/* @__PURE__ */ jsx66(
|
|
4930
5067
|
Hyperlink,
|
|
4931
5068
|
{
|
|
4932
5069
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4934,7 +5071,7 @@ var DataList = (props) => {
|
|
|
4934
5071
|
children: pages - 1
|
|
4935
5072
|
}
|
|
4936
5073
|
),
|
|
4937
|
-
/* @__PURE__ */
|
|
5074
|
+
/* @__PURE__ */ jsx66(
|
|
4938
5075
|
Hyperlink,
|
|
4939
5076
|
{
|
|
4940
5077
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -4942,7 +5079,7 @@ var DataList = (props) => {
|
|
|
4942
5079
|
children: pages
|
|
4943
5080
|
}
|
|
4944
5081
|
),
|
|
4945
|
-
/* @__PURE__ */
|
|
5082
|
+
/* @__PURE__ */ jsx66("div", { className: "relative inline-block", children: /* @__PURE__ */ jsxs36(
|
|
4946
5083
|
"select",
|
|
4947
5084
|
{
|
|
4948
5085
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -4954,8 +5091,8 @@ var DataList = (props) => {
|
|
|
4954
5091
|
}
|
|
4955
5092
|
},
|
|
4956
5093
|
children: [
|
|
4957
|
-
/* @__PURE__ */
|
|
4958
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */
|
|
5094
|
+
/* @__PURE__ */ jsx66("option", { value: "", children: "Jump to" }),
|
|
5095
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ jsx66("option", { value: page, children: page }, page))
|
|
4959
5096
|
]
|
|
4960
5097
|
}
|
|
4961
5098
|
) })
|
|
@@ -4963,16 +5100,16 @@ var DataList = (props) => {
|
|
|
4963
5100
|
}
|
|
4964
5101
|
}
|
|
4965
5102
|
};
|
|
4966
|
-
return /* @__PURE__ */
|
|
4967
|
-
/* @__PURE__ */
|
|
4968
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */
|
|
5103
|
+
return /* @__PURE__ */ jsxs36(React46.Fragment, { children: [
|
|
5104
|
+
/* @__PURE__ */ jsxs36(ContentView_default, { isDataFound, children: [
|
|
5105
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ jsxs36(
|
|
4969
5106
|
"div",
|
|
4970
5107
|
{
|
|
4971
5108
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
4972
5109
|
children: [
|
|
4973
|
-
props.title ? /* @__PURE__ */
|
|
4974
|
-
/* @__PURE__ */
|
|
4975
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */
|
|
5110
|
+
props.title ? /* @__PURE__ */ jsx66("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ jsx66("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ jsx66("div", {}),
|
|
5111
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-3", children: [
|
|
5112
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ jsx66(
|
|
4976
5113
|
InputControl_default,
|
|
4977
5114
|
{
|
|
4978
5115
|
name: "Search_input",
|
|
@@ -4984,7 +5121,7 @@ var DataList = (props) => {
|
|
|
4984
5121
|
}
|
|
4985
5122
|
}
|
|
4986
5123
|
),
|
|
4987
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */
|
|
5124
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx66(
|
|
4988
5125
|
InputControl_default,
|
|
4989
5126
|
{
|
|
4990
5127
|
name: filter.name,
|
|
@@ -4999,15 +5136,15 @@ var DataList = (props) => {
|
|
|
4999
5136
|
},
|
|
5000
5137
|
filter.name
|
|
5001
5138
|
)),
|
|
5002
|
-
props.addLinkHref && /* @__PURE__ */
|
|
5139
|
+
props.addLinkHref && /* @__PURE__ */ jsxs36(
|
|
5003
5140
|
Hyperlink,
|
|
5004
5141
|
{
|
|
5005
5142
|
className: "gap-1",
|
|
5006
5143
|
linkType: "Primary" /* Solid */,
|
|
5007
5144
|
href: props.addLinkHref,
|
|
5008
5145
|
children: [
|
|
5009
|
-
/* @__PURE__ */
|
|
5010
|
-
/* @__PURE__ */
|
|
5146
|
+
/* @__PURE__ */ jsx66(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
5147
|
+
/* @__PURE__ */ jsx66("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
5011
5148
|
]
|
|
5012
5149
|
}
|
|
5013
5150
|
)
|
|
@@ -5015,8 +5152,8 @@ var DataList = (props) => {
|
|
|
5015
5152
|
]
|
|
5016
5153
|
}
|
|
5017
5154
|
),
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ jsx66("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ jsxs36("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
5156
|
+
/* @__PURE__ */ jsx66("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ jsx66("tr", { children: props?.columns?.map((column) => {
|
|
5020
5157
|
let url = builder.getNewOrderByUrl(column.name);
|
|
5021
5158
|
let icon = "chevronUpDown";
|
|
5022
5159
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -5026,18 +5163,18 @@ var DataList = (props) => {
|
|
|
5026
5163
|
icon = "chevronUp";
|
|
5027
5164
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
5028
5165
|
}
|
|
5029
|
-
return /* @__PURE__ */
|
|
5166
|
+
return /* @__PURE__ */ jsx66(
|
|
5030
5167
|
"th",
|
|
5031
5168
|
{
|
|
5032
5169
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
5033
|
-
children: /* @__PURE__ */
|
|
5170
|
+
children: /* @__PURE__ */ jsx66(
|
|
5034
5171
|
Hyperlink,
|
|
5035
5172
|
{
|
|
5036
5173
|
href: column.enableSorting ? url : void 0,
|
|
5037
5174
|
className: "!text-neutral-contrast ",
|
|
5038
|
-
children: /* @__PURE__ */
|
|
5039
|
-
/* @__PURE__ */
|
|
5040
|
-
column.enableSorting && /* @__PURE__ */
|
|
5175
|
+
children: /* @__PURE__ */ jsxs36("span", { className: "flex items-center space-x-1", children: [
|
|
5176
|
+
/* @__PURE__ */ jsx66("span", { className: "text-black", children: column.label }),
|
|
5177
|
+
column.enableSorting && /* @__PURE__ */ jsx66(Icon_default, { className: "w-4 h-4", name: icon })
|
|
5041
5178
|
] })
|
|
5042
5179
|
}
|
|
5043
5180
|
)
|
|
@@ -5045,24 +5182,24 @@ var DataList = (props) => {
|
|
|
5045
5182
|
column.name
|
|
5046
5183
|
);
|
|
5047
5184
|
}) }) }),
|
|
5048
|
-
/* @__PURE__ */
|
|
5185
|
+
/* @__PURE__ */ jsx66("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
5049
5186
|
let validityClass = "";
|
|
5050
5187
|
console.log("dataitem", dataitem);
|
|
5051
5188
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
5052
5189
|
validityClass = "bg-alert-200";
|
|
5053
5190
|
}
|
|
5054
|
-
return /* @__PURE__ */
|
|
5191
|
+
return /* @__PURE__ */ jsx66("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
5055
5192
|
console.log("column", column);
|
|
5056
|
-
return /* @__PURE__ */
|
|
5193
|
+
return /* @__PURE__ */ jsx66(React46.Fragment, { children: /* @__PURE__ */ jsx66(
|
|
5057
5194
|
"td",
|
|
5058
5195
|
{
|
|
5059
5196
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
5060
|
-
children: column.addhref === true ? /* @__PURE__ */
|
|
5197
|
+
children: column.addhref === true ? /* @__PURE__ */ jsx66(
|
|
5061
5198
|
Hyperlink,
|
|
5062
5199
|
{
|
|
5063
5200
|
className: "",
|
|
5064
5201
|
href: `https://${dataitem[column.name]}`,
|
|
5065
|
-
children: /* @__PURE__ */
|
|
5202
|
+
children: /* @__PURE__ */ jsx66(
|
|
5066
5203
|
ViewControl_default,
|
|
5067
5204
|
{
|
|
5068
5205
|
controlType: column.controlType,
|
|
@@ -5075,11 +5212,11 @@ var DataList = (props) => {
|
|
|
5075
5212
|
}
|
|
5076
5213
|
)
|
|
5077
5214
|
}
|
|
5078
|
-
) : column.showAsLink ? /* @__PURE__ */
|
|
5215
|
+
) : column.showAsLink ? /* @__PURE__ */ jsx66(
|
|
5079
5216
|
Hyperlink,
|
|
5080
5217
|
{
|
|
5081
5218
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
5082
|
-
children: /* @__PURE__ */
|
|
5219
|
+
children: /* @__PURE__ */ jsx66(
|
|
5083
5220
|
ViewControl_default,
|
|
5084
5221
|
{
|
|
5085
5222
|
controlType: column.controlType,
|
|
@@ -5089,7 +5226,7 @@ var DataList = (props) => {
|
|
|
5089
5226
|
}
|
|
5090
5227
|
)
|
|
5091
5228
|
}
|
|
5092
|
-
) : /* @__PURE__ */
|
|
5229
|
+
) : /* @__PURE__ */ jsx66(
|
|
5093
5230
|
ViewControl_default,
|
|
5094
5231
|
{
|
|
5095
5232
|
controlType: column.controlType,
|
|
@@ -5103,10 +5240,10 @@ var DataList = (props) => {
|
|
|
5103
5240
|
}) }, index);
|
|
5104
5241
|
}) })
|
|
5105
5242
|
] }) }),
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5109
|
-
activePageNumber > 1 && /* @__PURE__ */
|
|
5243
|
+
/* @__PURE__ */ jsx66("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between", children: [
|
|
5244
|
+
/* @__PURE__ */ jsx66("div", { className: "text-gray-700", children: label }),
|
|
5245
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex space-x-2 items-center", children: [
|
|
5246
|
+
activePageNumber > 1 && /* @__PURE__ */ jsx66(
|
|
5110
5247
|
Hyperlink,
|
|
5111
5248
|
{
|
|
5112
5249
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -5114,9 +5251,9 @@ var DataList = (props) => {
|
|
|
5114
5251
|
children: "Prev"
|
|
5115
5252
|
}
|
|
5116
5253
|
),
|
|
5117
|
-
activePageNumber <= 1 && /* @__PURE__ */
|
|
5254
|
+
activePageNumber <= 1 && /* @__PURE__ */ jsx66("div", { className: "px-3 py-1 rounded-l-md border border-gray-300 bg-gray-200 text-gray-500 hover:bg-gray-200", children: "Prev" }),
|
|
5118
5255
|
renderPageNumbers(),
|
|
5119
|
-
activePageNumber < pages && /* @__PURE__ */
|
|
5256
|
+
activePageNumber < pages && /* @__PURE__ */ jsx66(
|
|
5120
5257
|
Hyperlink,
|
|
5121
5258
|
{
|
|
5122
5259
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -5124,19 +5261,19 @@ var DataList = (props) => {
|
|
|
5124
5261
|
children: "Next"
|
|
5125
5262
|
}
|
|
5126
5263
|
),
|
|
5127
|
-
activePageNumber >= pages && /* @__PURE__ */
|
|
5264
|
+
activePageNumber >= pages && /* @__PURE__ */ jsx66("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
5128
5265
|
] })
|
|
5129
5266
|
] }) })
|
|
5130
5267
|
] }),
|
|
5131
|
-
/* @__PURE__ */
|
|
5132
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */
|
|
5268
|
+
/* @__PURE__ */ jsxs36(NoContentView_default, { isDataFound, children: [
|
|
5269
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ jsxs36(
|
|
5133
5270
|
"div",
|
|
5134
5271
|
{
|
|
5135
5272
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200`,
|
|
5136
5273
|
children: [
|
|
5137
|
-
props.title ? /* @__PURE__ */
|
|
5138
|
-
/* @__PURE__ */
|
|
5139
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */
|
|
5274
|
+
props.title ? /* @__PURE__ */ jsx66("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ jsx66("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ jsx66("div", {}),
|
|
5275
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-3", children: [
|
|
5276
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ jsx66(
|
|
5140
5277
|
InputControl_default,
|
|
5141
5278
|
{
|
|
5142
5279
|
name: "Search_input",
|
|
@@ -5148,7 +5285,7 @@ var DataList = (props) => {
|
|
|
5148
5285
|
}
|
|
5149
5286
|
}
|
|
5150
5287
|
),
|
|
5151
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */
|
|
5288
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ jsx66(
|
|
5152
5289
|
InputControl_default,
|
|
5153
5290
|
{
|
|
5154
5291
|
name: filter.name,
|
|
@@ -5163,15 +5300,15 @@ var DataList = (props) => {
|
|
|
5163
5300
|
},
|
|
5164
5301
|
filter.name
|
|
5165
5302
|
)),
|
|
5166
|
-
props.addLinkHref && /* @__PURE__ */
|
|
5303
|
+
props.addLinkHref && /* @__PURE__ */ jsxs36(
|
|
5167
5304
|
Hyperlink,
|
|
5168
5305
|
{
|
|
5169
5306
|
className: "gap-1",
|
|
5170
5307
|
linkType: "Primary" /* Solid */,
|
|
5171
5308
|
href: props.addLinkHref,
|
|
5172
5309
|
children: [
|
|
5173
|
-
/* @__PURE__ */
|
|
5174
|
-
/* @__PURE__ */
|
|
5310
|
+
/* @__PURE__ */ jsx66(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
5311
|
+
/* @__PURE__ */ jsx66("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
5175
5312
|
]
|
|
5176
5313
|
}
|
|
5177
5314
|
)
|
|
@@ -5179,8 +5316,8 @@ var DataList = (props) => {
|
|
|
5179
5316
|
]
|
|
5180
5317
|
}
|
|
5181
5318
|
),
|
|
5182
|
-
/* @__PURE__ */
|
|
5183
|
-
/* @__PURE__ */
|
|
5319
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
5320
|
+
/* @__PURE__ */ jsx66("div", { children: /* @__PURE__ */ jsx66("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ jsx66("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsx66("tr", { children: props?.columns?.map((column) => {
|
|
5184
5321
|
let url = builder.getNewOrderByUrl(column.name);
|
|
5185
5322
|
let icon = "chevronUpDown";
|
|
5186
5323
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -5190,18 +5327,18 @@ var DataList = (props) => {
|
|
|
5190
5327
|
icon = "chevronUp";
|
|
5191
5328
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
5192
5329
|
}
|
|
5193
|
-
return /* @__PURE__ */
|
|
5330
|
+
return /* @__PURE__ */ jsx66(
|
|
5194
5331
|
"th",
|
|
5195
5332
|
{
|
|
5196
5333
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
5197
|
-
children: /* @__PURE__ */
|
|
5334
|
+
children: /* @__PURE__ */ jsx66(
|
|
5198
5335
|
Hyperlink,
|
|
5199
5336
|
{
|
|
5200
5337
|
href: column.enableSorting ? url : void 0,
|
|
5201
5338
|
className: "text-body-950",
|
|
5202
|
-
children: /* @__PURE__ */
|
|
5203
|
-
/* @__PURE__ */
|
|
5204
|
-
column.enableSorting && /* @__PURE__ */
|
|
5339
|
+
children: /* @__PURE__ */ jsxs36("span", { className: "flex items-center space-x-1", children: [
|
|
5340
|
+
/* @__PURE__ */ jsx66("span", { children: column.label }),
|
|
5341
|
+
column.enableSorting && /* @__PURE__ */ jsx66(Icon_default, { className: "w-4 h-4", name: icon })
|
|
5205
5342
|
] })
|
|
5206
5343
|
}
|
|
5207
5344
|
)
|
|
@@ -5209,7 +5346,7 @@ var DataList = (props) => {
|
|
|
5209
5346
|
column.name
|
|
5210
5347
|
);
|
|
5211
5348
|
}) }) }) }) }),
|
|
5212
|
-
/* @__PURE__ */
|
|
5349
|
+
/* @__PURE__ */ jsx66("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
5213
5350
|
] })
|
|
5214
5351
|
] })
|
|
5215
5352
|
] });
|
|
@@ -5219,7 +5356,7 @@ var DataList_default = DataList;
|
|
|
5219
5356
|
// src/components/dataForm/DataListRenderer.tsx
|
|
5220
5357
|
import React47, { useState as useState10, useEffect as useEffect11 } from "react";
|
|
5221
5358
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
5222
|
-
import { jsx as
|
|
5359
|
+
import { jsx as jsx67, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5223
5360
|
var viewControlMap = {
|
|
5224
5361
|
number: ViewControlTypes.number,
|
|
5225
5362
|
lineText: ViewControlTypes.lineText,
|
|
@@ -5309,9 +5446,9 @@ var DataListRenderer = ({
|
|
|
5309
5446
|
const [tabItem, setTabItem] = useState10();
|
|
5310
5447
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
5311
5448
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
5312
|
-
return /* @__PURE__ */
|
|
5313
|
-
widgetProps && /* @__PURE__ */
|
|
5314
|
-
/* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ jsxs37(React47.Fragment, { children: [
|
|
5450
|
+
widgetProps && /* @__PURE__ */ jsx67(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
5451
|
+
/* @__PURE__ */ jsx67(
|
|
5315
5452
|
DataList_default,
|
|
5316
5453
|
{
|
|
5317
5454
|
addLinkHref,
|
|
@@ -5356,7 +5493,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
5356
5493
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
5357
5494
|
|
|
5358
5495
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
5359
|
-
import { jsx as
|
|
5496
|
+
import { jsx as jsx68, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5360
5497
|
var DataFormChildSection = (props) => {
|
|
5361
5498
|
const { section } = props;
|
|
5362
5499
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -5424,14 +5561,14 @@ var DataFormChildSection = (props) => {
|
|
|
5424
5561
|
childItemsToRender,
|
|
5425
5562
|
allChildItems: childItems
|
|
5426
5563
|
});
|
|
5427
|
-
return /* @__PURE__ */
|
|
5428
|
-
section.sectionTitle && /* @__PURE__ */
|
|
5429
|
-
/* @__PURE__ */
|
|
5430
|
-
/* @__PURE__ */
|
|
5431
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */
|
|
5432
|
-
return /* @__PURE__ */
|
|
5564
|
+
return /* @__PURE__ */ jsx68(React48.Fragment, { children: /* @__PURE__ */ jsxs38("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
5565
|
+
section.sectionTitle && /* @__PURE__ */ jsx68("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
5566
|
+
/* @__PURE__ */ jsx68("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ jsxs38("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
5567
|
+
/* @__PURE__ */ jsx68("div", { children: /* @__PURE__ */ jsxs38("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
5568
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ jsx68("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
5569
|
+
return /* @__PURE__ */ jsxs38("tr", { className: "", children: [
|
|
5433
5570
|
sectionRow.elements.map((field, index) => {
|
|
5434
|
-
return /* @__PURE__ */
|
|
5571
|
+
return /* @__PURE__ */ jsx68(
|
|
5435
5572
|
"th",
|
|
5436
5573
|
{
|
|
5437
5574
|
className: "py-3 font-normal text-left",
|
|
@@ -5440,21 +5577,21 @@ var DataFormChildSection = (props) => {
|
|
|
5440
5577
|
field.name
|
|
5441
5578
|
);
|
|
5442
5579
|
}),
|
|
5443
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */
|
|
5580
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ jsx68("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
5444
5581
|
] }, sectionRowIndex);
|
|
5445
5582
|
}) }),
|
|
5446
|
-
/* @__PURE__ */
|
|
5583
|
+
/* @__PURE__ */ jsx68("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
5447
5584
|
const { item, originalIndex } = visibleItem;
|
|
5448
5585
|
const rowKey = originalIndex;
|
|
5449
|
-
return /* @__PURE__ */
|
|
5586
|
+
return /* @__PURE__ */ jsx68(React48.Fragment, { children: section.sectionRows.map(
|
|
5450
5587
|
(sectionRow, sectionRowIndex) => {
|
|
5451
|
-
return /* @__PURE__ */
|
|
5588
|
+
return /* @__PURE__ */ jsxs38(
|
|
5452
5589
|
"tr",
|
|
5453
5590
|
{
|
|
5454
5591
|
className: "",
|
|
5455
5592
|
children: [
|
|
5456
5593
|
sectionRow.elements.map((field, index) => {
|
|
5457
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ jsx68("td", { children: /* @__PURE__ */ jsx68("div", { className: "flex-1", children: /* @__PURE__ */ jsx68("div", { className: "w-11/12", children: /* @__PURE__ */ jsx68(
|
|
5458
5595
|
InputControl_default,
|
|
5459
5596
|
{
|
|
5460
5597
|
index: filteredIndex,
|
|
@@ -5474,7 +5611,7 @@ var DataFormChildSection = (props) => {
|
|
|
5474
5611
|
}
|
|
5475
5612
|
) }) }) }, field.name);
|
|
5476
5613
|
}),
|
|
5477
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */
|
|
5614
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ jsx68("td", { children: /* @__PURE__ */ jsx68(
|
|
5478
5615
|
ClientButton_default,
|
|
5479
5616
|
{
|
|
5480
5617
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -5483,7 +5620,7 @@ var DataFormChildSection = (props) => {
|
|
|
5483
5620
|
},
|
|
5484
5621
|
dataRole: "delete",
|
|
5485
5622
|
tabIndex: -1,
|
|
5486
|
-
children: /* @__PURE__ */
|
|
5623
|
+
children: /* @__PURE__ */ jsx68(
|
|
5487
5624
|
Icon_default,
|
|
5488
5625
|
{
|
|
5489
5626
|
className: "w-4 h-4",
|
|
@@ -5500,7 +5637,7 @@ var DataFormChildSection = (props) => {
|
|
|
5500
5637
|
) }, rowKey);
|
|
5501
5638
|
}) })
|
|
5502
5639
|
] }) }),
|
|
5503
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */
|
|
5640
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ jsx68("div", { className: "ml-1", children: /* @__PURE__ */ jsx68(
|
|
5504
5641
|
ClientButton_default,
|
|
5505
5642
|
{
|
|
5506
5643
|
ButtonType: "Link" /* Link */,
|
|
@@ -5515,7 +5652,7 @@ var DataFormChildSection = (props) => {
|
|
|
5515
5652
|
var DataFormChildSection_default = DataFormChildSection;
|
|
5516
5653
|
|
|
5517
5654
|
// src/components/dataForm/DataForm.tsx
|
|
5518
|
-
import { jsx as
|
|
5655
|
+
import { jsx as jsx69, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5519
5656
|
var DataForm = (props) => {
|
|
5520
5657
|
const formRef = useRef4(null);
|
|
5521
5658
|
console.log(props.dataItem, "dssads");
|
|
@@ -5735,19 +5872,19 @@ var DataForm = (props) => {
|
|
|
5735
5872
|
return false;
|
|
5736
5873
|
}
|
|
5737
5874
|
}
|
|
5738
|
-
return /* @__PURE__ */
|
|
5739
|
-
props.title && /* @__PURE__ */
|
|
5875
|
+
return /* @__PURE__ */ jsx69(React49.Fragment, { children: /* @__PURE__ */ jsxs39("div", { className: "flex-grow flex flex-col", children: [
|
|
5876
|
+
props.title && /* @__PURE__ */ jsx69("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__ */ jsxs39(
|
|
5740
5877
|
"div",
|
|
5741
5878
|
{
|
|
5742
5879
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
5743
5880
|
onClick: () => window.history.back(),
|
|
5744
5881
|
children: [
|
|
5745
|
-
/* @__PURE__ */
|
|
5746
|
-
/* @__PURE__ */
|
|
5882
|
+
/* @__PURE__ */ jsx69(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
5883
|
+
/* @__PURE__ */ jsx69("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
5747
5884
|
]
|
|
5748
5885
|
}
|
|
5749
5886
|
) }),
|
|
5750
|
-
/* @__PURE__ */
|
|
5887
|
+
/* @__PURE__ */ jsx69(
|
|
5751
5888
|
"form",
|
|
5752
5889
|
{
|
|
5753
5890
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -5768,8 +5905,8 @@ var DataForm = (props) => {
|
|
|
5768
5905
|
}
|
|
5769
5906
|
}
|
|
5770
5907
|
},
|
|
5771
|
-
children: /* @__PURE__ */
|
|
5772
|
-
return /* @__PURE__ */
|
|
5908
|
+
children: /* @__PURE__ */ jsx69("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
5909
|
+
return /* @__PURE__ */ jsx69(React49.Fragment, { children: !section.isChildSection && /* @__PURE__ */ jsxs39("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
5773
5910
|
section.sectionRows?.map(
|
|
5774
5911
|
(sectionRow, sectionRowIndex) => {
|
|
5775
5912
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -5780,14 +5917,14 @@ var DataForm = (props) => {
|
|
|
5780
5917
|
sectionRow.visible
|
|
5781
5918
|
);
|
|
5782
5919
|
}
|
|
5783
|
-
return /* @__PURE__ */
|
|
5784
|
-
return /* @__PURE__ */
|
|
5920
|
+
return /* @__PURE__ */ jsx69(React49.Fragment, { children: isVisible && /* @__PURE__ */ jsx69("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
5921
|
+
return /* @__PURE__ */ jsxs39(
|
|
5785
5922
|
"div",
|
|
5786
5923
|
{
|
|
5787
5924
|
className: sectionRow.grow ? "grow" : "",
|
|
5788
5925
|
children: [
|
|
5789
|
-
/* @__PURE__ */
|
|
5790
|
-
/* @__PURE__ */
|
|
5926
|
+
/* @__PURE__ */ jsx69("div", { children: field.controlType }),
|
|
5927
|
+
/* @__PURE__ */ jsx69(
|
|
5791
5928
|
InputControl_default,
|
|
5792
5929
|
{
|
|
5793
5930
|
name: field.name,
|
|
@@ -5817,12 +5954,12 @@ var DataForm = (props) => {
|
|
|
5817
5954
|
}) }) }, sectionRowIndex);
|
|
5818
5955
|
}
|
|
5819
5956
|
),
|
|
5820
|
-
/* @__PURE__ */
|
|
5957
|
+
/* @__PURE__ */ jsx69("div", { children: section.childSections?.map(
|
|
5821
5958
|
(childSection, childSectionIndex) => {
|
|
5822
|
-
return /* @__PURE__ */
|
|
5959
|
+
return /* @__PURE__ */ jsx69("div", { children: childSection.name && evalutateCondition(
|
|
5823
5960
|
formState.inputValues,
|
|
5824
5961
|
childSection.visible
|
|
5825
|
-
) && /* @__PURE__ */
|
|
5962
|
+
) && /* @__PURE__ */ jsx69(
|
|
5826
5963
|
DataFormChildSection_default,
|
|
5827
5964
|
{
|
|
5828
5965
|
section: childSection,
|
|
@@ -5837,8 +5974,8 @@ var DataForm = (props) => {
|
|
|
5837
5974
|
}) })
|
|
5838
5975
|
}
|
|
5839
5976
|
),
|
|
5840
|
-
/* @__PURE__ */
|
|
5841
|
-
/* @__PURE__ */
|
|
5977
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
5978
|
+
/* @__PURE__ */ jsx69("div", { children: props.additionalActions && /* @__PURE__ */ jsx69(
|
|
5842
5979
|
Button_default,
|
|
5843
5980
|
{
|
|
5844
5981
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -5846,7 +5983,7 @@ var DataForm = (props) => {
|
|
|
5846
5983
|
children: props.additionalActions.title
|
|
5847
5984
|
}
|
|
5848
5985
|
) }),
|
|
5849
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ jsx69("div", { children: props.onDelete && /* @__PURE__ */ jsx69(
|
|
5850
5987
|
Button_default,
|
|
5851
5988
|
{
|
|
5852
5989
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -5857,7 +5994,7 @@ var DataForm = (props) => {
|
|
|
5857
5994
|
children: "Delete"
|
|
5858
5995
|
}
|
|
5859
5996
|
) }),
|
|
5860
|
-
/* @__PURE__ */
|
|
5997
|
+
/* @__PURE__ */ jsx69("div", { children: props.onClick && /* @__PURE__ */ jsx69(
|
|
5861
5998
|
Button_default,
|
|
5862
5999
|
{
|
|
5863
6000
|
onValidate,
|
|
@@ -5874,7 +6011,7 @@ var DataForm = (props) => {
|
|
|
5874
6011
|
var DataForm_default = DataForm;
|
|
5875
6012
|
|
|
5876
6013
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
5877
|
-
import { jsx as
|
|
6014
|
+
import { jsx as jsx70, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5878
6015
|
function getAction(actions, code) {
|
|
5879
6016
|
return actions?.find((a) => a.actionCode === code);
|
|
5880
6017
|
}
|
|
@@ -5900,9 +6037,9 @@ var DataFormRenderer = ({
|
|
|
5900
6037
|
"Delete"
|
|
5901
6038
|
);
|
|
5902
6039
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
5903
|
-
return /* @__PURE__ */
|
|
5904
|
-
widgetProps && /* @__PURE__ */
|
|
5905
|
-
/* @__PURE__ */
|
|
6040
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex-grow flex flex-col", children: [
|
|
6041
|
+
widgetProps && /* @__PURE__ */ jsx70(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6042
|
+
/* @__PURE__ */ jsx70(
|
|
5906
6043
|
DataForm_default,
|
|
5907
6044
|
{
|
|
5908
6045
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|