@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260708102516 → 0.8.1-dev.20260709115728
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/EnterAnimationClient-2NFKY4B5.mjs +31 -0
- package/dist/EnterAnimationClient-R3GFCNRS.mjs +33 -0
- package/dist/index.js +259 -220
- package/dist/index.mjs +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4126,6 +4126,44 @@ var init_Slider = __esm({
|
|
|
4126
4126
|
}
|
|
4127
4127
|
});
|
|
4128
4128
|
|
|
4129
|
+
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
4130
|
+
var EnterAnimationClient_exports = {};
|
|
4131
|
+
__export(EnterAnimationClient_exports, {
|
|
4132
|
+
default: () => EnterAnimationClient
|
|
4133
|
+
});
|
|
4134
|
+
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
4135
|
+
const ref = (0, import_react52.useRef)(null);
|
|
4136
|
+
(0, import_react52.useEffect)(() => {
|
|
4137
|
+
if (!hasEnterAnimation || !ref.current) return;
|
|
4138
|
+
const observer = new IntersectionObserver(
|
|
4139
|
+
(entries) => {
|
|
4140
|
+
entries.forEach((entry) => {
|
|
4141
|
+
if (entry.isIntersecting) {
|
|
4142
|
+
entry.target.classList.add("visible");
|
|
4143
|
+
observer.unobserve(entry.target);
|
|
4144
|
+
}
|
|
4145
|
+
});
|
|
4146
|
+
},
|
|
4147
|
+
{ threshold: 0.1 }
|
|
4148
|
+
);
|
|
4149
|
+
observer.observe(ref.current);
|
|
4150
|
+
return () => observer.disconnect();
|
|
4151
|
+
}, [hasEnterAnimation]);
|
|
4152
|
+
if (!children) return null;
|
|
4153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
4154
|
+
//@ts-ignore
|
|
4155
|
+
import_react52.default.cloneElement(children, { ref }) });
|
|
4156
|
+
}
|
|
4157
|
+
var import_react52, import_jsx_runtime72;
|
|
4158
|
+
var init_EnterAnimationClient = __esm({
|
|
4159
|
+
"src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx"() {
|
|
4160
|
+
"use strict";
|
|
4161
|
+
"use client";
|
|
4162
|
+
import_react52 = __toESM(require("react"));
|
|
4163
|
+
import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4164
|
+
}
|
|
4165
|
+
});
|
|
4166
|
+
|
|
4129
4167
|
// src/index.ts
|
|
4130
4168
|
var index_exports = {};
|
|
4131
4169
|
__export(index_exports, {
|
|
@@ -4539,7 +4577,7 @@ var InputControl_default = InputControl2;
|
|
|
4539
4577
|
init_InputControlType();
|
|
4540
4578
|
|
|
4541
4579
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
4542
|
-
var
|
|
4580
|
+
var import_react54 = __toESM(require("react"));
|
|
4543
4581
|
|
|
4544
4582
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4545
4583
|
var import_react40 = __toESM(require("react"));
|
|
@@ -5312,7 +5350,8 @@ var WidgetNode = (props) => {
|
|
|
5312
5350
|
var WidgetNode_default = WidgetNode;
|
|
5313
5351
|
|
|
5314
5352
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5315
|
-
var
|
|
5353
|
+
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
5354
|
+
var import_react53 = __toESM(require("react"));
|
|
5316
5355
|
|
|
5317
5356
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
5318
5357
|
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
@@ -5536,9 +5575,6 @@ var NoDataFound = () => {
|
|
|
5536
5575
|
};
|
|
5537
5576
|
var NoDataFound_default = NoDataFound;
|
|
5538
5577
|
|
|
5539
|
-
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5540
|
-
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
5541
|
-
|
|
5542
5578
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5543
5579
|
init_AssetUtility();
|
|
5544
5580
|
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
@@ -6358,11 +6394,14 @@ var DocumentNode = (props) => {
|
|
|
6358
6394
|
var DocumentNode_default = DocumentNode;
|
|
6359
6395
|
|
|
6360
6396
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
6361
|
-
var
|
|
6397
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6362
6398
|
var Pagination2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
6363
6399
|
var Slider2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
6364
6400
|
ssr: false
|
|
6365
6401
|
});
|
|
6402
|
+
var EnterAnimationClient2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_EnterAnimationClient(), EnterAnimationClient_exports)), {
|
|
6403
|
+
ssr: false
|
|
6404
|
+
});
|
|
6366
6405
|
function toCamelCase(str) {
|
|
6367
6406
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
6368
6407
|
}
|
|
@@ -6612,7 +6651,7 @@ var DivContainer = async (props) => {
|
|
|
6612
6651
|
response = await serviceClient.get(endpoint);
|
|
6613
6652
|
result = response?.result;
|
|
6614
6653
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
6615
|
-
return /* @__PURE__ */ (0,
|
|
6654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(NoDataFound_default, {});
|
|
6616
6655
|
}
|
|
6617
6656
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
6618
6657
|
childCollectionData = getNestedValue6(
|
|
@@ -6632,7 +6671,7 @@ var DivContainer = async (props) => {
|
|
|
6632
6671
|
}
|
|
6633
6672
|
const SelectedNode = NodeTypes2[node.type];
|
|
6634
6673
|
if (!SelectedNode) return null;
|
|
6635
|
-
return /* @__PURE__ */ (0,
|
|
6674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6636
6675
|
SelectedNode,
|
|
6637
6676
|
{
|
|
6638
6677
|
node,
|
|
@@ -6764,14 +6803,14 @@ var DivContainer = async (props) => {
|
|
|
6764
6803
|
props.node.bgClass,
|
|
6765
6804
|
noLinkColor && "no-link-color"
|
|
6766
6805
|
].filter(Boolean).join(" ");
|
|
6767
|
-
return /* @__PURE__ */ (0,
|
|
6768
|
-
/* @__PURE__ */ (0,
|
|
6806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_react53.default.Fragment, { children: [
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6769
6808
|
"style",
|
|
6770
6809
|
{
|
|
6771
6810
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
6772
6811
|
}
|
|
6773
6812
|
),
|
|
6774
|
-
/* @__PURE__ */ (0,
|
|
6813
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EnterAnimationClient2, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6775
6814
|
Wrapper,
|
|
6776
6815
|
{
|
|
6777
6816
|
id: guid,
|
|
@@ -6785,11 +6824,11 @@ var DivContainer = async (props) => {
|
|
|
6785
6824
|
item,
|
|
6786
6825
|
idx,
|
|
6787
6826
|
props.href ? void 0 : item?.links?.view
|
|
6788
|
-
)?.map((child, i) => /* @__PURE__ */ (0,
|
|
6827
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
6789
6828
|
)
|
|
6790
6829
|
}
|
|
6791
6830
|
) }),
|
|
6792
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
6831
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6793
6832
|
Pagination2,
|
|
6794
6833
|
{
|
|
6795
6834
|
path: props.path,
|
|
@@ -6802,7 +6841,7 @@ var DivContainer = async (props) => {
|
|
|
6802
6841
|
var DivContainer_default = DivContainer;
|
|
6803
6842
|
|
|
6804
6843
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
6805
|
-
var
|
|
6844
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
6806
6845
|
var NodeTypes = {
|
|
6807
6846
|
["paragraph"]: ParagraphNode_default,
|
|
6808
6847
|
["heading"]: HeadingNode_default,
|
|
@@ -6839,14 +6878,14 @@ var PageBodyRenderer = (props) => {
|
|
|
6839
6878
|
}
|
|
6840
6879
|
return true;
|
|
6841
6880
|
};
|
|
6842
|
-
return /* @__PURE__ */ (0,
|
|
6881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
6843
6882
|
{
|
|
6844
6883
|
}
|
|
6845
6884
|
const SelectedNode = NodeTypes[node.type];
|
|
6846
6885
|
if (!shouldRenderNode(node)) {
|
|
6847
6886
|
return null;
|
|
6848
6887
|
}
|
|
6849
|
-
return /* @__PURE__ */ (0,
|
|
6888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6850
6889
|
SelectedNode,
|
|
6851
6890
|
{
|
|
6852
6891
|
node,
|
|
@@ -6862,7 +6901,7 @@ var PageBodyRenderer = (props) => {
|
|
|
6862
6901
|
device: props.device,
|
|
6863
6902
|
widgetRenderer: props.widgetRenderer
|
|
6864
6903
|
}
|
|
6865
|
-
) }) : /* @__PURE__ */ (0,
|
|
6904
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6866
6905
|
SelectedNode,
|
|
6867
6906
|
{
|
|
6868
6907
|
node,
|
|
@@ -6883,22 +6922,22 @@ var PageBodyRenderer = (props) => {
|
|
|
6883
6922
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
6884
6923
|
|
|
6885
6924
|
// src/components/Toast.tsx
|
|
6886
|
-
var
|
|
6925
|
+
var import_react55 = require("react");
|
|
6887
6926
|
init_ToastService();
|
|
6888
|
-
var
|
|
6927
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
6889
6928
|
var Toast = () => {
|
|
6890
|
-
const [showToast, setShowToast] = (0,
|
|
6891
|
-
const [message, setMessage] = (0,
|
|
6892
|
-
const [messageType, setMessageType] = (0,
|
|
6893
|
-
const timeoutRef = (0,
|
|
6894
|
-
const closeToast = (0,
|
|
6929
|
+
const [showToast, setShowToast] = (0, import_react55.useState)(false);
|
|
6930
|
+
const [message, setMessage] = (0, import_react55.useState)("");
|
|
6931
|
+
const [messageType, setMessageType] = (0, import_react55.useState)("error");
|
|
6932
|
+
const timeoutRef = (0, import_react55.useRef)(null);
|
|
6933
|
+
const closeToast = (0, import_react55.useCallback)(() => {
|
|
6895
6934
|
if (timeoutRef.current) {
|
|
6896
6935
|
clearTimeout(timeoutRef.current);
|
|
6897
6936
|
timeoutRef.current = null;
|
|
6898
6937
|
}
|
|
6899
6938
|
setShowToast(false);
|
|
6900
6939
|
}, []);
|
|
6901
|
-
const showMessage = (0,
|
|
6940
|
+
const showMessage = (0, import_react55.useCallback)((message2, messageType2) => {
|
|
6902
6941
|
if (timeoutRef.current) {
|
|
6903
6942
|
clearTimeout(timeoutRef.current);
|
|
6904
6943
|
}
|
|
@@ -6910,7 +6949,7 @@ var Toast = () => {
|
|
|
6910
6949
|
timeoutRef.current = null;
|
|
6911
6950
|
}, 4e3);
|
|
6912
6951
|
}, []);
|
|
6913
|
-
(0,
|
|
6952
|
+
(0, import_react55.useEffect)(() => {
|
|
6914
6953
|
ToastService_default.initialize(showMessage, closeToast);
|
|
6915
6954
|
return () => {
|
|
6916
6955
|
closeToast();
|
|
@@ -6919,8 +6958,8 @@ var Toast = () => {
|
|
|
6919
6958
|
});
|
|
6920
6959
|
};
|
|
6921
6960
|
}, [closeToast, showMessage]);
|
|
6922
|
-
return /* @__PURE__ */ (0,
|
|
6923
|
-
/* @__PURE__ */ (0,
|
|
6961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_jsx_runtime75.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("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__ */ (0, import_jsx_runtime75.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6924
6963
|
"span",
|
|
6925
6964
|
{
|
|
6926
6965
|
className: "font-medium text-inherit text-sm",
|
|
@@ -6928,7 +6967,7 @@ var Toast = () => {
|
|
|
6928
6967
|
children: message
|
|
6929
6968
|
}
|
|
6930
6969
|
),
|
|
6931
|
-
/* @__PURE__ */ (0,
|
|
6970
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6932
6971
|
"svg",
|
|
6933
6972
|
{
|
|
6934
6973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6936,7 +6975,7 @@ var Toast = () => {
|
|
|
6936
6975
|
fill: "none",
|
|
6937
6976
|
viewBox: "0 0 24 24",
|
|
6938
6977
|
stroke: "currentColor",
|
|
6939
|
-
children: /* @__PURE__ */ (0,
|
|
6978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
6940
6979
|
}
|
|
6941
6980
|
) })
|
|
6942
6981
|
] }) }) });
|
|
@@ -6963,7 +7002,7 @@ init_TimeInput();
|
|
|
6963
7002
|
// src/components/NavigationTabsV2.tsx
|
|
6964
7003
|
var import_link3 = __toESM(require("next/link"));
|
|
6965
7004
|
var import_navigation = require("next/navigation");
|
|
6966
|
-
var
|
|
7005
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
6967
7006
|
function resolveRoutePlaceholders(route, params) {
|
|
6968
7007
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
6969
7008
|
const value = params[key];
|
|
@@ -6988,8 +7027,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
6988
7027
|
isActive: tab.isActive
|
|
6989
7028
|
})) || [];
|
|
6990
7029
|
if (mappedTabs.length === 0) return null;
|
|
6991
|
-
return /* @__PURE__ */ (0,
|
|
6992
|
-
return /* @__PURE__ */ (0,
|
|
7030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
7031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6993
7032
|
"div",
|
|
6994
7033
|
{
|
|
6995
7034
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -7002,14 +7041,14 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7002
7041
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
7003
7042
|
|
|
7004
7043
|
// src/components/dataForm/DataList.tsx
|
|
7005
|
-
var
|
|
7044
|
+
var import_react58 = __toESM(require("react"));
|
|
7006
7045
|
var import_navigation2 = require("next/navigation");
|
|
7007
7046
|
|
|
7008
7047
|
// src/components/dataForm/NoContentView.tsx
|
|
7009
|
-
var
|
|
7010
|
-
var
|
|
7048
|
+
var import_react56 = __toESM(require("react"));
|
|
7049
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7011
7050
|
var NoContentView = (props) => {
|
|
7012
|
-
return /* @__PURE__ */ (0,
|
|
7051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
7013
7052
|
};
|
|
7014
7053
|
var NoContentView_default = NoContentView;
|
|
7015
7054
|
|
|
@@ -7017,39 +7056,39 @@ var NoContentView_default = NoContentView;
|
|
|
7017
7056
|
init_InputControlType();
|
|
7018
7057
|
|
|
7019
7058
|
// src/components/dataForm/ContentView.tsx
|
|
7020
|
-
var
|
|
7021
|
-
var
|
|
7059
|
+
var import_react57 = __toESM(require("react"));
|
|
7060
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
7022
7061
|
var ContentView = (props) => {
|
|
7023
|
-
return /* @__PURE__ */ (0,
|
|
7024
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
7025
|
-
/* @__PURE__ */ (0,
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7027
|
-
/* @__PURE__ */ (0,
|
|
7028
|
-
/* @__PURE__ */ (0,
|
|
7029
|
-
/* @__PURE__ */ (0,
|
|
7062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react57.default.Fragment, { children: [
|
|
7063
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
7064
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
7066
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ml-2", children: [
|
|
7067
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
7030
7069
|
] })
|
|
7031
7070
|
] }),
|
|
7032
|
-
/* @__PURE__ */ (0,
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
7034
|
-
/* @__PURE__ */ (0,
|
|
7035
|
-
/* @__PURE__ */ (0,
|
|
7036
|
-
/* @__PURE__ */ (0,
|
|
7037
|
-
/* @__PURE__ */ (0,
|
|
7038
|
-
/* @__PURE__ */ (0,
|
|
7071
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
7072
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "animate-pulse", children: [
|
|
7073
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7074
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7075
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7076
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7039
7078
|
] }),
|
|
7040
|
-
/* @__PURE__ */ (0,
|
|
7041
|
-
/* @__PURE__ */ (0,
|
|
7042
|
-
/* @__PURE__ */ (0,
|
|
7043
|
-
/* @__PURE__ */ (0,
|
|
7044
|
-
/* @__PURE__ */ (0,
|
|
7045
|
-
/* @__PURE__ */ (0,
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "animate-pulse", children: [
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7081
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7082
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7084
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7046
7085
|
] }),
|
|
7047
|
-
/* @__PURE__ */ (0,
|
|
7048
|
-
/* @__PURE__ */ (0,
|
|
7049
|
-
/* @__PURE__ */ (0,
|
|
7050
|
-
/* @__PURE__ */ (0,
|
|
7051
|
-
/* @__PURE__ */ (0,
|
|
7052
|
-
/* @__PURE__ */ (0,
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "animate-pulse", children: [
|
|
7087
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7088
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7090
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7091
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7053
7092
|
] })
|
|
7054
7093
|
] })
|
|
7055
7094
|
] }) }),
|
|
@@ -7109,7 +7148,7 @@ function FormReducer(state, action) {
|
|
|
7109
7148
|
var FormReducer_default = FormReducer;
|
|
7110
7149
|
|
|
7111
7150
|
// src/components/dataForm/DataList.tsx
|
|
7112
|
-
var
|
|
7151
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7113
7152
|
var DataList = (props) => {
|
|
7114
7153
|
const router = (0, import_navigation2.useRouter)();
|
|
7115
7154
|
let builder = new OdataBuilder(props.path);
|
|
@@ -7117,9 +7156,9 @@ var DataList = (props) => {
|
|
|
7117
7156
|
let activePageNumber = 0;
|
|
7118
7157
|
let pages = 0;
|
|
7119
7158
|
console.log(props.addLinkText);
|
|
7120
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
7121
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
7122
|
-
(0,
|
|
7159
|
+
const [isDataFound, setIsDataFound] = (0, import_react58.useState)(null);
|
|
7160
|
+
const [searchTerm, setSearchTerm] = (0, import_react58.useState)(props.query?.searchTerm ?? "");
|
|
7161
|
+
(0, import_react58.useEffect)(() => {
|
|
7123
7162
|
if (props?.dataset) {
|
|
7124
7163
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
7125
7164
|
setIsDataFound(true);
|
|
@@ -7128,7 +7167,7 @@ var DataList = (props) => {
|
|
|
7128
7167
|
}
|
|
7129
7168
|
}
|
|
7130
7169
|
}, [props.dataset]);
|
|
7131
|
-
(0,
|
|
7170
|
+
(0, import_react58.useEffect)(() => {
|
|
7132
7171
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
7133
7172
|
const filterQuery = props.query["$filter"];
|
|
7134
7173
|
props.filters.forEach((filter) => {
|
|
@@ -7147,7 +7186,7 @@ var DataList = (props) => {
|
|
|
7147
7186
|
if (path.includes(".")) {
|
|
7148
7187
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
7149
7188
|
} else if (Array.isArray(obj[path])) {
|
|
7150
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
7189
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: item }, index));
|
|
7151
7190
|
} else {
|
|
7152
7191
|
return obj[path];
|
|
7153
7192
|
}
|
|
@@ -7156,11 +7195,11 @@ var DataList = (props) => {
|
|
|
7156
7195
|
inputValues: {},
|
|
7157
7196
|
lastPropertyChanged: ""
|
|
7158
7197
|
};
|
|
7159
|
-
const [formState, dispatch] = (0,
|
|
7198
|
+
const [formState, dispatch] = (0, import_react58.useReducer)(FormReducer_default, initialState);
|
|
7160
7199
|
const getSearchableColumns = () => {
|
|
7161
7200
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
7162
7201
|
};
|
|
7163
|
-
const handleFilterChange = (0,
|
|
7202
|
+
const handleFilterChange = (0, import_react58.useCallback)(
|
|
7164
7203
|
(updatedValues) => {
|
|
7165
7204
|
dispatch({
|
|
7166
7205
|
type: FORM_INPUT_UPDATE,
|
|
@@ -7191,7 +7230,7 @@ var DataList = (props) => {
|
|
|
7191
7230
|
},
|
|
7192
7231
|
[dispatch, props, router]
|
|
7193
7232
|
);
|
|
7194
|
-
(0,
|
|
7233
|
+
(0, import_react58.useEffect)(() => {
|
|
7195
7234
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
7196
7235
|
return;
|
|
7197
7236
|
}
|
|
@@ -7226,30 +7265,30 @@ var DataList = (props) => {
|
|
|
7226
7265
|
const renderPageNumbers = () => {
|
|
7227
7266
|
if (pages <= 10) {
|
|
7228
7267
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
7229
|
-
(page) => /* @__PURE__ */ (0,
|
|
7268
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7230
7269
|
Hyperlink,
|
|
7231
7270
|
{
|
|
7232
7271
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7233
7272
|
href: builder.getNewPageUrl(page),
|
|
7234
7273
|
children: page
|
|
7235
7274
|
}
|
|
7236
|
-
) : /* @__PURE__ */ (0,
|
|
7275
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
7237
7276
|
);
|
|
7238
7277
|
} else {
|
|
7239
7278
|
const showFirstPages = activePageNumber <= 5;
|
|
7240
7279
|
const showLastPages = activePageNumber > pages - 5;
|
|
7241
7280
|
if (showFirstPages) {
|
|
7242
|
-
return /* @__PURE__ */ (0,
|
|
7243
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
7281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7282
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7244
7283
|
Hyperlink,
|
|
7245
7284
|
{
|
|
7246
7285
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7247
7286
|
href: builder.getNewPageUrl(page),
|
|
7248
7287
|
children: page
|
|
7249
7288
|
}
|
|
7250
|
-
) : /* @__PURE__ */ (0,
|
|
7251
|
-
/* @__PURE__ */ (0,
|
|
7252
|
-
/* @__PURE__ */ (0,
|
|
7289
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
7290
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7291
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7253
7292
|
Hyperlink,
|
|
7254
7293
|
{
|
|
7255
7294
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7257,7 +7296,7 @@ var DataList = (props) => {
|
|
|
7257
7296
|
children: pages - 1
|
|
7258
7297
|
}
|
|
7259
7298
|
),
|
|
7260
|
-
/* @__PURE__ */ (0,
|
|
7299
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7261
7300
|
Hyperlink,
|
|
7262
7301
|
{
|
|
7263
7302
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7265,7 +7304,7 @@ var DataList = (props) => {
|
|
|
7265
7304
|
children: pages
|
|
7266
7305
|
}
|
|
7267
7306
|
),
|
|
7268
|
-
/* @__PURE__ */ (0,
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7269
7308
|
"select",
|
|
7270
7309
|
{
|
|
7271
7310
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -7277,18 +7316,18 @@ var DataList = (props) => {
|
|
|
7277
7316
|
}
|
|
7278
7317
|
},
|
|
7279
7318
|
children: [
|
|
7280
|
-
/* @__PURE__ */ (0,
|
|
7319
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
7281
7320
|
Array.from(
|
|
7282
7321
|
{ length: Math.max(0, pages - 10) },
|
|
7283
7322
|
(_, index) => index + 9
|
|
7284
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
7323
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("option", { value: page, children: page }, page))
|
|
7285
7324
|
]
|
|
7286
7325
|
}
|
|
7287
7326
|
) })
|
|
7288
7327
|
] });
|
|
7289
7328
|
} else if (showLastPages) {
|
|
7290
|
-
return /* @__PURE__ */ (0,
|
|
7291
|
-
/* @__PURE__ */ (0,
|
|
7329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7330
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7292
7331
|
Hyperlink,
|
|
7293
7332
|
{
|
|
7294
7333
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7296,7 +7335,7 @@ var DataList = (props) => {
|
|
|
7296
7335
|
children: "1"
|
|
7297
7336
|
}
|
|
7298
7337
|
),
|
|
7299
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7300
7339
|
Hyperlink,
|
|
7301
7340
|
{
|
|
7302
7341
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7304,21 +7343,21 @@ var DataList = (props) => {
|
|
|
7304
7343
|
children: "2"
|
|
7305
7344
|
}
|
|
7306
7345
|
),
|
|
7307
|
-
/* @__PURE__ */ (0,
|
|
7346
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7308
7347
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
7309
|
-
(page) => /* @__PURE__ */ (0,
|
|
7348
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7310
7349
|
Hyperlink,
|
|
7311
7350
|
{
|
|
7312
7351
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7313
7352
|
href: builder.getNewPageUrl(page),
|
|
7314
7353
|
children: page
|
|
7315
7354
|
}
|
|
7316
|
-
) : /* @__PURE__ */ (0,
|
|
7355
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
7317
7356
|
)
|
|
7318
7357
|
] });
|
|
7319
7358
|
} else {
|
|
7320
|
-
return /* @__PURE__ */ (0,
|
|
7321
|
-
/* @__PURE__ */ (0,
|
|
7359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7360
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7322
7361
|
Hyperlink,
|
|
7323
7362
|
{
|
|
7324
7363
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7326,7 +7365,7 @@ var DataList = (props) => {
|
|
|
7326
7365
|
children: "1"
|
|
7327
7366
|
}
|
|
7328
7367
|
),
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7368
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7330
7369
|
Hyperlink,
|
|
7331
7370
|
{
|
|
7332
7371
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7334,20 +7373,20 @@ var DataList = (props) => {
|
|
|
7334
7373
|
children: "2"
|
|
7335
7374
|
}
|
|
7336
7375
|
),
|
|
7337
|
-
/* @__PURE__ */ (0,
|
|
7376
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7338
7377
|
Array.from(
|
|
7339
7378
|
{ length: 5 },
|
|
7340
7379
|
(_, index) => activePageNumber - 2 + index
|
|
7341
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
7380
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7342
7381
|
Hyperlink,
|
|
7343
7382
|
{
|
|
7344
7383
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7345
7384
|
href: builder.getNewPageUrl(page),
|
|
7346
7385
|
children: page
|
|
7347
7386
|
}
|
|
7348
|
-
) : /* @__PURE__ */ (0,
|
|
7349
|
-
/* @__PURE__ */ (0,
|
|
7350
|
-
/* @__PURE__ */ (0,
|
|
7387
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
7388
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7389
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7351
7390
|
Hyperlink,
|
|
7352
7391
|
{
|
|
7353
7392
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7355,7 +7394,7 @@ var DataList = (props) => {
|
|
|
7355
7394
|
children: pages - 1
|
|
7356
7395
|
}
|
|
7357
7396
|
),
|
|
7358
|
-
/* @__PURE__ */ (0,
|
|
7397
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7359
7398
|
Hyperlink,
|
|
7360
7399
|
{
|
|
7361
7400
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7363,7 +7402,7 @@ var DataList = (props) => {
|
|
|
7363
7402
|
children: pages
|
|
7364
7403
|
}
|
|
7365
7404
|
),
|
|
7366
|
-
/* @__PURE__ */ (0,
|
|
7405
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7367
7406
|
"select",
|
|
7368
7407
|
{
|
|
7369
7408
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -7375,8 +7414,8 @@ var DataList = (props) => {
|
|
|
7375
7414
|
}
|
|
7376
7415
|
},
|
|
7377
7416
|
children: [
|
|
7378
|
-
/* @__PURE__ */ (0,
|
|
7379
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
7417
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("option", { value: "", children: "Jump to" }),
|
|
7418
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("option", { value: page, children: page }, page))
|
|
7380
7419
|
]
|
|
7381
7420
|
}
|
|
7382
7421
|
) })
|
|
@@ -7384,16 +7423,16 @@ var DataList = (props) => {
|
|
|
7384
7423
|
}
|
|
7385
7424
|
}
|
|
7386
7425
|
};
|
|
7387
|
-
return /* @__PURE__ */ (0,
|
|
7388
|
-
/* @__PURE__ */ (0,
|
|
7389
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
7426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react58.default.Fragment, { children: [
|
|
7427
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(ContentView_default, { isDataFound, children: [
|
|
7428
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7390
7429
|
"div",
|
|
7391
7430
|
{
|
|
7392
7431
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
7393
7432
|
children: [
|
|
7394
|
-
props.title ? /* @__PURE__ */ (0,
|
|
7395
|
-
/* @__PURE__ */ (0,
|
|
7396
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
7433
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", {}),
|
|
7434
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7435
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7397
7436
|
InputControl_default,
|
|
7398
7437
|
{
|
|
7399
7438
|
name: "Search_input",
|
|
@@ -7405,7 +7444,7 @@ var DataList = (props) => {
|
|
|
7405
7444
|
}
|
|
7406
7445
|
}
|
|
7407
7446
|
),
|
|
7408
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
7447
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7409
7448
|
InputControl_default,
|
|
7410
7449
|
{
|
|
7411
7450
|
name: filter.name,
|
|
@@ -7420,15 +7459,15 @@ var DataList = (props) => {
|
|
|
7420
7459
|
},
|
|
7421
7460
|
filter.name
|
|
7422
7461
|
)),
|
|
7423
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
7462
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7424
7463
|
Hyperlink,
|
|
7425
7464
|
{
|
|
7426
7465
|
className: "gap-1",
|
|
7427
7466
|
linkType: "Primary" /* Solid */,
|
|
7428
7467
|
href: props.addLinkHref,
|
|
7429
7468
|
children: [
|
|
7430
|
-
/* @__PURE__ */ (0,
|
|
7431
|
-
/* @__PURE__ */ (0,
|
|
7469
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
7470
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
7432
7471
|
]
|
|
7433
7472
|
}
|
|
7434
7473
|
)
|
|
@@ -7436,8 +7475,8 @@ var DataList = (props) => {
|
|
|
7436
7475
|
]
|
|
7437
7476
|
}
|
|
7438
7477
|
),
|
|
7439
|
-
/* @__PURE__ */ (0,
|
|
7440
|
-
/* @__PURE__ */ (0,
|
|
7478
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
7441
7480
|
let url = builder.getNewOrderByUrl(column.name);
|
|
7442
7481
|
let icon = "chevronUpDown";
|
|
7443
7482
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -7447,18 +7486,18 @@ var DataList = (props) => {
|
|
|
7447
7486
|
icon = "chevronUp";
|
|
7448
7487
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
7449
7488
|
}
|
|
7450
|
-
return /* @__PURE__ */ (0,
|
|
7489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7451
7490
|
"th",
|
|
7452
7491
|
{
|
|
7453
7492
|
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" : ""),
|
|
7454
|
-
children: /* @__PURE__ */ (0,
|
|
7493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7455
7494
|
Hyperlink,
|
|
7456
7495
|
{
|
|
7457
7496
|
href: column.enableSorting ? url : void 0,
|
|
7458
7497
|
className: "!text-neutral-contrast ",
|
|
7459
|
-
children: /* @__PURE__ */ (0,
|
|
7460
|
-
/* @__PURE__ */ (0,
|
|
7461
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
7498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
7499
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-black", children: column.label }),
|
|
7500
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
7462
7501
|
] })
|
|
7463
7502
|
}
|
|
7464
7503
|
)
|
|
@@ -7466,24 +7505,24 @@ var DataList = (props) => {
|
|
|
7466
7505
|
column.name
|
|
7467
7506
|
);
|
|
7468
7507
|
}) }) }),
|
|
7469
|
-
/* @__PURE__ */ (0,
|
|
7508
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
7470
7509
|
let validityClass = "";
|
|
7471
7510
|
console.log("dataitem", dataitem);
|
|
7472
7511
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
7473
7512
|
validityClass = "bg-alert-200";
|
|
7474
7513
|
}
|
|
7475
|
-
return /* @__PURE__ */ (0,
|
|
7514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
7476
7515
|
console.log("column", column);
|
|
7477
|
-
return /* @__PURE__ */ (0,
|
|
7516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7478
7517
|
"td",
|
|
7479
7518
|
{
|
|
7480
7519
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
7481
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
7520
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7482
7521
|
Hyperlink,
|
|
7483
7522
|
{
|
|
7484
7523
|
className: "",
|
|
7485
7524
|
href: `https://${dataitem[column.name]}`,
|
|
7486
|
-
children: /* @__PURE__ */ (0,
|
|
7525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7487
7526
|
ViewControl_default,
|
|
7488
7527
|
{
|
|
7489
7528
|
controlType: column.controlType,
|
|
@@ -7496,11 +7535,11 @@ var DataList = (props) => {
|
|
|
7496
7535
|
}
|
|
7497
7536
|
)
|
|
7498
7537
|
}
|
|
7499
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
7538
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7500
7539
|
Hyperlink,
|
|
7501
7540
|
{
|
|
7502
7541
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
7503
|
-
children: /* @__PURE__ */ (0,
|
|
7542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7504
7543
|
ViewControl_default,
|
|
7505
7544
|
{
|
|
7506
7545
|
controlType: column.controlType,
|
|
@@ -7510,7 +7549,7 @@ var DataList = (props) => {
|
|
|
7510
7549
|
}
|
|
7511
7550
|
)
|
|
7512
7551
|
}
|
|
7513
|
-
) : /* @__PURE__ */ (0,
|
|
7552
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7514
7553
|
ViewControl_default,
|
|
7515
7554
|
{
|
|
7516
7555
|
controlType: column.controlType,
|
|
@@ -7524,10 +7563,10 @@ var DataList = (props) => {
|
|
|
7524
7563
|
}) }, index);
|
|
7525
7564
|
}) })
|
|
7526
7565
|
] }) }),
|
|
7527
|
-
/* @__PURE__ */ (0,
|
|
7528
|
-
/* @__PURE__ */ (0,
|
|
7529
|
-
/* @__PURE__ */ (0,
|
|
7530
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
7566
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7567
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "text-gray-700", children: label }),
|
|
7568
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
7569
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7531
7570
|
Hyperlink,
|
|
7532
7571
|
{
|
|
7533
7572
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -7535,9 +7574,9 @@ var DataList = (props) => {
|
|
|
7535
7574
|
children: "Prev"
|
|
7536
7575
|
}
|
|
7537
7576
|
),
|
|
7538
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
7577
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("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" }),
|
|
7539
7578
|
renderPageNumbers(),
|
|
7540
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
7579
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7541
7580
|
Hyperlink,
|
|
7542
7581
|
{
|
|
7543
7582
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -7545,19 +7584,19 @@ var DataList = (props) => {
|
|
|
7545
7584
|
children: "Next"
|
|
7546
7585
|
}
|
|
7547
7586
|
),
|
|
7548
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
7587
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
7549
7588
|
] })
|
|
7550
7589
|
] }) })
|
|
7551
7590
|
] }),
|
|
7552
|
-
/* @__PURE__ */ (0,
|
|
7553
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
7591
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
7592
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7554
7593
|
"div",
|
|
7555
7594
|
{
|
|
7556
7595
|
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`,
|
|
7557
7596
|
children: [
|
|
7558
|
-
props.title ? /* @__PURE__ */ (0,
|
|
7559
|
-
/* @__PURE__ */ (0,
|
|
7560
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
7597
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", {}),
|
|
7598
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7599
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7561
7600
|
InputControl_default,
|
|
7562
7601
|
{
|
|
7563
7602
|
name: "Search_input",
|
|
@@ -7569,7 +7608,7 @@ var DataList = (props) => {
|
|
|
7569
7608
|
}
|
|
7570
7609
|
}
|
|
7571
7610
|
),
|
|
7572
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
7611
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7573
7612
|
InputControl_default,
|
|
7574
7613
|
{
|
|
7575
7614
|
name: filter.name,
|
|
@@ -7584,15 +7623,15 @@ var DataList = (props) => {
|
|
|
7584
7623
|
},
|
|
7585
7624
|
filter.name
|
|
7586
7625
|
)),
|
|
7587
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
7626
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7588
7627
|
Hyperlink,
|
|
7589
7628
|
{
|
|
7590
7629
|
className: "gap-1",
|
|
7591
7630
|
linkType: "Primary" /* Solid */,
|
|
7592
7631
|
href: props.addLinkHref,
|
|
7593
7632
|
children: [
|
|
7594
|
-
/* @__PURE__ */ (0,
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7633
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
7634
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
7596
7635
|
]
|
|
7597
7636
|
}
|
|
7598
7637
|
)
|
|
@@ -7600,8 +7639,8 @@ var DataList = (props) => {
|
|
|
7600
7639
|
]
|
|
7601
7640
|
}
|
|
7602
7641
|
),
|
|
7603
|
-
/* @__PURE__ */ (0,
|
|
7604
|
-
/* @__PURE__ */ (0,
|
|
7642
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
7643
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
7605
7644
|
let url = builder.getNewOrderByUrl(column.name);
|
|
7606
7645
|
let icon = "chevronUpDown";
|
|
7607
7646
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -7611,18 +7650,18 @@ var DataList = (props) => {
|
|
|
7611
7650
|
icon = "chevronUp";
|
|
7612
7651
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
7613
7652
|
}
|
|
7614
|
-
return /* @__PURE__ */ (0,
|
|
7653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7615
7654
|
"th",
|
|
7616
7655
|
{
|
|
7617
7656
|
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" : ""),
|
|
7618
|
-
children: /* @__PURE__ */ (0,
|
|
7657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7619
7658
|
Hyperlink,
|
|
7620
7659
|
{
|
|
7621
7660
|
href: column.enableSorting ? url : void 0,
|
|
7622
7661
|
className: "text-body-950",
|
|
7623
|
-
children: /* @__PURE__ */ (0,
|
|
7624
|
-
/* @__PURE__ */ (0,
|
|
7625
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
7662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
7663
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { children: column.label }),
|
|
7664
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
7626
7665
|
] })
|
|
7627
7666
|
}
|
|
7628
7667
|
)
|
|
@@ -7630,7 +7669,7 @@ var DataList = (props) => {
|
|
|
7630
7669
|
column.name
|
|
7631
7670
|
);
|
|
7632
7671
|
}) }) }) }) }),
|
|
7633
|
-
/* @__PURE__ */ (0,
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
7634
7673
|
] })
|
|
7635
7674
|
] })
|
|
7636
7675
|
] });
|
|
@@ -7638,12 +7677,12 @@ var DataList = (props) => {
|
|
|
7638
7677
|
var DataList_default = DataList;
|
|
7639
7678
|
|
|
7640
7679
|
// src/components/dataForm/DataListRenderer.tsx
|
|
7641
|
-
var
|
|
7680
|
+
var import_react59 = __toESM(require("react"));
|
|
7642
7681
|
init_ServiceClient();
|
|
7643
7682
|
init_OdataBuilder();
|
|
7644
7683
|
init_SelectWithSearchInput();
|
|
7645
7684
|
var import_navigation3 = require("next/navigation");
|
|
7646
|
-
var
|
|
7685
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7647
7686
|
var viewControlMap = {
|
|
7648
7687
|
number: ViewControlTypes.number,
|
|
7649
7688
|
lineText: ViewControlTypes.lineText,
|
|
@@ -7698,14 +7737,14 @@ var DataListRenderer = ({
|
|
|
7698
7737
|
widgetProps
|
|
7699
7738
|
}) => {
|
|
7700
7739
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
7701
|
-
const [columns, setColumns] = (0,
|
|
7702
|
-
const [dataset, setDataset] = (0,
|
|
7703
|
-
const [filter, setFilters] = (0,
|
|
7704
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
7705
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
7706
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
7740
|
+
const [columns, setColumns] = (0, import_react59.useState)([]);
|
|
7741
|
+
const [dataset, setDataset] = (0, import_react59.useState)();
|
|
7742
|
+
const [filter, setFilters] = (0, import_react59.useState)([]);
|
|
7743
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react59.useState)("");
|
|
7744
|
+
const [addLinkText, setAddLinkText] = (0, import_react59.useState)("");
|
|
7745
|
+
const [serviceRoute, setServiceRoute] = (0, import_react59.useState)("");
|
|
7707
7746
|
const pathname = (0, import_navigation3.usePathname)();
|
|
7708
|
-
(0,
|
|
7747
|
+
(0, import_react59.useEffect)(() => {
|
|
7709
7748
|
if (!formDefinition) return;
|
|
7710
7749
|
setColumns(mapApiToColumns(formDefinition));
|
|
7711
7750
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -7718,7 +7757,7 @@ var DataListRenderer = ({
|
|
|
7718
7757
|
setAddLinkHref(resolvedAddLinkHref);
|
|
7719
7758
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
7720
7759
|
}, [formDefinition, params]);
|
|
7721
|
-
(0,
|
|
7760
|
+
(0, import_react59.useEffect)(() => {
|
|
7722
7761
|
const fetchData = async () => {
|
|
7723
7762
|
if (!serviceRoute) return;
|
|
7724
7763
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -7738,15 +7777,15 @@ var DataListRenderer = ({
|
|
|
7738
7777
|
isActive: landingPageUrl === pathname
|
|
7739
7778
|
};
|
|
7740
7779
|
});
|
|
7741
|
-
return /* @__PURE__ */ (0,
|
|
7742
|
-
resolvedTabs.length > 0 && /* @__PURE__ */ (0,
|
|
7780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_react59.default.Fragment, { children: [
|
|
7781
|
+
resolvedTabs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7743
7782
|
NavigationTabsV2_default,
|
|
7744
7783
|
{
|
|
7745
7784
|
tabs: resolvedTabs,
|
|
7746
7785
|
params: widgetProps?.params ?? params
|
|
7747
7786
|
}
|
|
7748
7787
|
),
|
|
7749
|
-
/* @__PURE__ */ (0,
|
|
7788
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7750
7789
|
DataList_default,
|
|
7751
7790
|
{
|
|
7752
7791
|
addLinkHref,
|
|
@@ -7768,13 +7807,13 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
7768
7807
|
init_InputControlType();
|
|
7769
7808
|
|
|
7770
7809
|
// src/components/dataForm/DataForm.tsx
|
|
7771
|
-
var
|
|
7810
|
+
var import_react61 = __toESM(require("react"));
|
|
7772
7811
|
init_Icon();
|
|
7773
7812
|
init_Button();
|
|
7774
7813
|
init_StyleTypes();
|
|
7775
7814
|
|
|
7776
7815
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
7777
|
-
var
|
|
7816
|
+
var import_react60 = __toESM(require("react"));
|
|
7778
7817
|
|
|
7779
7818
|
// src/components/dataForm/StyleTypes.tsx
|
|
7780
7819
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -7801,7 +7840,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
7801
7840
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
7802
7841
|
|
|
7803
7842
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
7804
|
-
var
|
|
7843
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7805
7844
|
var DataFormChildSection = (props) => {
|
|
7806
7845
|
const { section } = props;
|
|
7807
7846
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -7813,7 +7852,7 @@ var DataFormChildSection = (props) => {
|
|
|
7813
7852
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
7814
7853
|
};
|
|
7815
7854
|
const childItemsToRender = getChildItemsForRendering();
|
|
7816
|
-
const handleChildInputChange = (0,
|
|
7855
|
+
const handleChildInputChange = (0, import_react60.useCallback)(
|
|
7817
7856
|
(updatedValues) => {
|
|
7818
7857
|
if (isOneToOne) {
|
|
7819
7858
|
props.callback({
|
|
@@ -7840,7 +7879,7 @@ var DataFormChildSection = (props) => {
|
|
|
7840
7879
|
},
|
|
7841
7880
|
[props, isOneToOne, childItemsToRender]
|
|
7842
7881
|
);
|
|
7843
|
-
const onAddRow = (0,
|
|
7882
|
+
const onAddRow = (0, import_react60.useCallback)(() => {
|
|
7844
7883
|
props.callback({
|
|
7845
7884
|
sectionName: props.section.name,
|
|
7846
7885
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -7849,7 +7888,7 @@ var DataFormChildSection = (props) => {
|
|
|
7849
7888
|
rowIndex: -1
|
|
7850
7889
|
});
|
|
7851
7890
|
}, [props]);
|
|
7852
|
-
const onDeleteRow = (0,
|
|
7891
|
+
const onDeleteRow = (0, import_react60.useCallback)(
|
|
7853
7892
|
(filteredIndex) => {
|
|
7854
7893
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
7855
7894
|
if (visibleItem) {
|
|
@@ -7869,14 +7908,14 @@ var DataFormChildSection = (props) => {
|
|
|
7869
7908
|
childItemsToRender,
|
|
7870
7909
|
allChildItems: childItems
|
|
7871
7910
|
});
|
|
7872
|
-
return /* @__PURE__ */ (0,
|
|
7873
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
7874
|
-
/* @__PURE__ */ (0,
|
|
7875
|
-
/* @__PURE__ */ (0,
|
|
7876
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
7877
|
-
return /* @__PURE__ */ (0,
|
|
7911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react60.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
7912
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
7913
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
7914
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
7915
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
7916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("tr", { className: "", children: [
|
|
7878
7917
|
sectionRow.elements.map((field, index) => {
|
|
7879
|
-
return /* @__PURE__ */ (0,
|
|
7918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7880
7919
|
"th",
|
|
7881
7920
|
{
|
|
7882
7921
|
className: "py-3 font-normal text-left",
|
|
@@ -7885,21 +7924,21 @@ var DataFormChildSection = (props) => {
|
|
|
7885
7924
|
field.name
|
|
7886
7925
|
);
|
|
7887
7926
|
}),
|
|
7888
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7927
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
7889
7928
|
] }, sectionRowIndex);
|
|
7890
7929
|
}) }),
|
|
7891
|
-
/* @__PURE__ */ (0,
|
|
7930
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
7892
7931
|
const { item, originalIndex } = visibleItem;
|
|
7893
7932
|
const rowKey = originalIndex;
|
|
7894
|
-
return /* @__PURE__ */ (0,
|
|
7933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react60.default.Fragment, { children: section.sectionRows.map(
|
|
7895
7934
|
(sectionRow, sectionRowIndex) => {
|
|
7896
|
-
return /* @__PURE__ */ (0,
|
|
7935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
7897
7936
|
"tr",
|
|
7898
7937
|
{
|
|
7899
7938
|
className: "",
|
|
7900
7939
|
children: [
|
|
7901
7940
|
sectionRow.elements.map((field, index) => {
|
|
7902
|
-
return /* @__PURE__ */ (0,
|
|
7941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "w-11/12", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7903
7942
|
InputControl_default,
|
|
7904
7943
|
{
|
|
7905
7944
|
index: filteredIndex,
|
|
@@ -7919,7 +7958,7 @@ var DataFormChildSection = (props) => {
|
|
|
7919
7958
|
}
|
|
7920
7959
|
) }) }) }, field.name);
|
|
7921
7960
|
}),
|
|
7922
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7961
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7923
7962
|
ClientButton_default,
|
|
7924
7963
|
{
|
|
7925
7964
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -7928,7 +7967,7 @@ var DataFormChildSection = (props) => {
|
|
|
7928
7967
|
},
|
|
7929
7968
|
dataRole: "delete",
|
|
7930
7969
|
tabIndex: -1,
|
|
7931
|
-
children: /* @__PURE__ */ (0,
|
|
7970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7932
7971
|
Icon_default,
|
|
7933
7972
|
{
|
|
7934
7973
|
className: "w-4 h-4",
|
|
@@ -7945,7 +7984,7 @@ var DataFormChildSection = (props) => {
|
|
|
7945
7984
|
) }, rowKey);
|
|
7946
7985
|
}) })
|
|
7947
7986
|
] }) }),
|
|
7948
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7987
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7949
7988
|
ClientButton_default,
|
|
7950
7989
|
{
|
|
7951
7990
|
ButtonType: "Link" /* Link */,
|
|
@@ -7960,9 +7999,9 @@ var DataFormChildSection = (props) => {
|
|
|
7960
7999
|
var DataFormChildSection_default = DataFormChildSection;
|
|
7961
8000
|
|
|
7962
8001
|
// src/components/dataForm/DataForm.tsx
|
|
7963
|
-
var
|
|
8002
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
7964
8003
|
var DataForm = (props) => {
|
|
7965
|
-
const formRef = (0,
|
|
8004
|
+
const formRef = (0, import_react61.useRef)(null);
|
|
7966
8005
|
console.log(props.dataItem, "dssads");
|
|
7967
8006
|
const initialState = {
|
|
7968
8007
|
inputValues: {},
|
|
@@ -7971,9 +8010,9 @@ var DataForm = (props) => {
|
|
|
7971
8010
|
const childInitialState = {
|
|
7972
8011
|
inputValues: []
|
|
7973
8012
|
};
|
|
7974
|
-
const [formState, dispatch] = (0,
|
|
8013
|
+
const [formState, dispatch] = (0, import_react61.useReducer)(FormReducer_default, initialState);
|
|
7975
8014
|
console.log(props.sections, "sections");
|
|
7976
|
-
const clearHiddenChildSections = (0,
|
|
8015
|
+
const clearHiddenChildSections = (0, import_react61.useCallback)(
|
|
7977
8016
|
(changedProperty, newValues) => {
|
|
7978
8017
|
if (!props.sections) return;
|
|
7979
8018
|
const allChildSections = [];
|
|
@@ -8011,7 +8050,7 @@ var DataForm = (props) => {
|
|
|
8011
8050
|
},
|
|
8012
8051
|
[props.sections, formState.inputValues]
|
|
8013
8052
|
);
|
|
8014
|
-
const handleInputChange = (0,
|
|
8053
|
+
const handleInputChange = (0, import_react61.useCallback)(
|
|
8015
8054
|
async (updatedValues) => {
|
|
8016
8055
|
dispatch({
|
|
8017
8056
|
type: FORM_INPUT_UPDATE,
|
|
@@ -8026,7 +8065,7 @@ var DataForm = (props) => {
|
|
|
8026
8065
|
},
|
|
8027
8066
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
8028
8067
|
);
|
|
8029
|
-
const fetchData = (0,
|
|
8068
|
+
const fetchData = (0, import_react61.useCallback)(async () => {
|
|
8030
8069
|
if (!props.rules) return;
|
|
8031
8070
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
8032
8071
|
return;
|
|
@@ -8057,7 +8096,7 @@ var DataForm = (props) => {
|
|
|
8057
8096
|
console.error("Error fetching data:", error);
|
|
8058
8097
|
}
|
|
8059
8098
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
8060
|
-
(0,
|
|
8099
|
+
(0, import_react61.useEffect)(() => {
|
|
8061
8100
|
fetchData();
|
|
8062
8101
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
8063
8102
|
function replacePlaceholders(template, context, params) {
|
|
@@ -8077,7 +8116,7 @@ var DataForm = (props) => {
|
|
|
8077
8116
|
}
|
|
8078
8117
|
);
|
|
8079
8118
|
}
|
|
8080
|
-
const handleChildSectionChangeCallback = (0,
|
|
8119
|
+
const handleChildSectionChangeCallback = (0, import_react61.useCallback)(
|
|
8081
8120
|
(params) => {
|
|
8082
8121
|
dispatch({
|
|
8083
8122
|
type: params.actionType,
|
|
@@ -8122,7 +8161,7 @@ var DataForm = (props) => {
|
|
|
8122
8161
|
});
|
|
8123
8162
|
return cloned;
|
|
8124
8163
|
}
|
|
8125
|
-
const onClick = (0,
|
|
8164
|
+
const onClick = (0, import_react61.useCallback)(async () => {
|
|
8126
8165
|
if (props.onClick) {
|
|
8127
8166
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
8128
8167
|
const normalizedValues = normalizeChildSections(
|
|
@@ -8138,21 +8177,21 @@ var DataForm = (props) => {
|
|
|
8138
8177
|
return { isSuccessful: true };
|
|
8139
8178
|
}
|
|
8140
8179
|
}, [formState, props]);
|
|
8141
|
-
const handleAdditionalOnClick = (0,
|
|
8180
|
+
const handleAdditionalOnClick = (0, import_react61.useCallback)(async () => {
|
|
8142
8181
|
if (props.additionalActions?.onClick) {
|
|
8143
8182
|
return await props.additionalActions.onClick(formState);
|
|
8144
8183
|
} else {
|
|
8145
8184
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
8146
8185
|
}
|
|
8147
8186
|
}, [formState, props]);
|
|
8148
|
-
const onDelete = (0,
|
|
8187
|
+
const onDelete = (0, import_react61.useCallback)(async () => {
|
|
8149
8188
|
if (props.onDelete) {
|
|
8150
8189
|
return await props.onDelete(formState);
|
|
8151
8190
|
} else {
|
|
8152
8191
|
return { isSuccessful: true };
|
|
8153
8192
|
}
|
|
8154
8193
|
}, [formState, props]);
|
|
8155
|
-
(0,
|
|
8194
|
+
(0, import_react61.useEffect)(() => {
|
|
8156
8195
|
if (props.dataItem) {
|
|
8157
8196
|
dispatch({
|
|
8158
8197
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -8180,19 +8219,19 @@ var DataForm = (props) => {
|
|
|
8180
8219
|
return false;
|
|
8181
8220
|
}
|
|
8182
8221
|
}
|
|
8183
|
-
return /* @__PURE__ */ (0,
|
|
8184
|
-
props.title && /* @__PURE__ */ (0,
|
|
8222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
8223
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime82.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_runtime82.jsxs)(
|
|
8185
8224
|
"div",
|
|
8186
8225
|
{
|
|
8187
8226
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
8188
8227
|
onClick: () => window.history.back(),
|
|
8189
8228
|
children: [
|
|
8190
|
-
/* @__PURE__ */ (0,
|
|
8191
|
-
/* @__PURE__ */ (0,
|
|
8229
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
8192
8231
|
]
|
|
8193
8232
|
}
|
|
8194
8233
|
) }),
|
|
8195
|
-
/* @__PURE__ */ (0,
|
|
8234
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8196
8235
|
"form",
|
|
8197
8236
|
{
|
|
8198
8237
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -8213,8 +8252,8 @@ var DataForm = (props) => {
|
|
|
8213
8252
|
}
|
|
8214
8253
|
}
|
|
8215
8254
|
},
|
|
8216
|
-
children: /* @__PURE__ */ (0,
|
|
8217
|
-
return /* @__PURE__ */ (0,
|
|
8255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
8256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react61.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
8218
8257
|
section.sectionRows?.map(
|
|
8219
8258
|
(sectionRow, sectionRowIndex) => {
|
|
8220
8259
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -8225,14 +8264,14 @@ var DataForm = (props) => {
|
|
|
8225
8264
|
sectionRow.visible
|
|
8226
8265
|
);
|
|
8227
8266
|
}
|
|
8228
|
-
return /* @__PURE__ */ (0,
|
|
8229
|
-
return /* @__PURE__ */ (0,
|
|
8267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react61.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
8268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
8230
8269
|
"div",
|
|
8231
8270
|
{
|
|
8232
8271
|
className: sectionRow.grow ? "grow" : "",
|
|
8233
8272
|
children: [
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8235
|
-
/* @__PURE__ */ (0,
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: field.controlType }),
|
|
8274
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8236
8275
|
InputControl_default,
|
|
8237
8276
|
{
|
|
8238
8277
|
name: field.name,
|
|
@@ -8262,12 +8301,12 @@ var DataForm = (props) => {
|
|
|
8262
8301
|
}) }) }, sectionRowIndex);
|
|
8263
8302
|
}
|
|
8264
8303
|
),
|
|
8265
|
-
/* @__PURE__ */ (0,
|
|
8304
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: section.childSections?.map(
|
|
8266
8305
|
(childSection, childSectionIndex) => {
|
|
8267
|
-
return /* @__PURE__ */ (0,
|
|
8306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
8268
8307
|
formState.inputValues,
|
|
8269
8308
|
childSection.visible
|
|
8270
|
-
) && /* @__PURE__ */ (0,
|
|
8309
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8271
8310
|
DataFormChildSection_default,
|
|
8272
8311
|
{
|
|
8273
8312
|
section: childSection,
|
|
@@ -8282,8 +8321,8 @@ var DataForm = (props) => {
|
|
|
8282
8321
|
}) })
|
|
8283
8322
|
}
|
|
8284
8323
|
),
|
|
8285
|
-
/* @__PURE__ */ (0,
|
|
8286
|
-
/* @__PURE__ */ (0,
|
|
8324
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
8325
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8287
8326
|
Button_default,
|
|
8288
8327
|
{
|
|
8289
8328
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -8291,7 +8330,7 @@ var DataForm = (props) => {
|
|
|
8291
8330
|
children: props.additionalActions.title
|
|
8292
8331
|
}
|
|
8293
8332
|
) }),
|
|
8294
|
-
/* @__PURE__ */ (0,
|
|
8333
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8295
8334
|
Button_default,
|
|
8296
8335
|
{
|
|
8297
8336
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -8302,7 +8341,7 @@ var DataForm = (props) => {
|
|
|
8302
8341
|
children: "Delete"
|
|
8303
8342
|
}
|
|
8304
8343
|
) }),
|
|
8305
|
-
/* @__PURE__ */ (0,
|
|
8344
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8306
8345
|
Button_default,
|
|
8307
8346
|
{
|
|
8308
8347
|
onValidate,
|
|
@@ -8320,7 +8359,7 @@ var DataForm_default = DataForm;
|
|
|
8320
8359
|
|
|
8321
8360
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
8322
8361
|
init_ServiceClient();
|
|
8323
|
-
var
|
|
8362
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
8324
8363
|
function getAction(actions, code) {
|
|
8325
8364
|
return actions?.find((a) => a.actionCode === code);
|
|
8326
8365
|
}
|
|
@@ -8346,9 +8385,9 @@ var DataFormRenderer = ({
|
|
|
8346
8385
|
"Delete"
|
|
8347
8386
|
);
|
|
8348
8387
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
8349
|
-
return /* @__PURE__ */ (0,
|
|
8350
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
8351
|
-
/* @__PURE__ */ (0,
|
|
8388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
8389
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
8390
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8352
8391
|
DataForm_default,
|
|
8353
8392
|
{
|
|
8354
8393
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|