@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260713054732 → 0.8.1-dev.20260713105440
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/InputControlClient-HIZOJLKW.mjs +677 -0
- package/dist/index.js +220 -274
- package/dist/index.mjs +21 -25
- package/dist/server.d.mts +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +6 -6
- package/dist/server.mjs +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4127,58 +4127,6 @@ var init_Slider = __esm({
|
|
|
4127
4127
|
}
|
|
4128
4128
|
});
|
|
4129
4129
|
|
|
4130
|
-
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
4131
|
-
var EnterAnimationClient_exports = {};
|
|
4132
|
-
__export(EnterAnimationClient_exports, {
|
|
4133
|
-
default: () => EnterAnimationClient
|
|
4134
|
-
});
|
|
4135
|
-
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
4136
|
-
const ref = (0, import_react52.useRef)(null);
|
|
4137
|
-
console.log("render");
|
|
4138
|
-
(0, import_react52.useEffect)(() => {
|
|
4139
|
-
console.log("effect");
|
|
4140
|
-
console.log("ref", ref.current);
|
|
4141
|
-
if (!hasEnterAnimation) {
|
|
4142
|
-
console.log("no animation");
|
|
4143
|
-
return;
|
|
4144
|
-
}
|
|
4145
|
-
if (!ref.current) {
|
|
4146
|
-
console.log("no ref");
|
|
4147
|
-
return;
|
|
4148
|
-
}
|
|
4149
|
-
console.log("observer started");
|
|
4150
|
-
}, []);
|
|
4151
|
-
(0, import_react52.useEffect)(() => {
|
|
4152
|
-
if (!hasEnterAnimation || !ref.current) return;
|
|
4153
|
-
const observer = new IntersectionObserver(
|
|
4154
|
-
(entries) => {
|
|
4155
|
-
entries.forEach((entry) => {
|
|
4156
|
-
if (entry.isIntersecting) {
|
|
4157
|
-
entry.target.classList.add("visible");
|
|
4158
|
-
observer.unobserve(entry.target);
|
|
4159
|
-
}
|
|
4160
|
-
});
|
|
4161
|
-
},
|
|
4162
|
-
{ threshold: 0.1 }
|
|
4163
|
-
);
|
|
4164
|
-
observer.observe(ref.current);
|
|
4165
|
-
return () => observer.disconnect();
|
|
4166
|
-
}, [hasEnterAnimation]);
|
|
4167
|
-
if (!children) return null;
|
|
4168
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
4169
|
-
//@ts-ignore
|
|
4170
|
-
import_react52.default.cloneElement(children, { ref }) });
|
|
4171
|
-
}
|
|
4172
|
-
var import_react52, import_jsx_runtime72;
|
|
4173
|
-
var init_EnterAnimationClient = __esm({
|
|
4174
|
-
"src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx"() {
|
|
4175
|
-
"use strict";
|
|
4176
|
-
"use client";
|
|
4177
|
-
import_react52 = __toESM(require("react"));
|
|
4178
|
-
import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4179
|
-
}
|
|
4180
|
-
});
|
|
4181
|
-
|
|
4182
4130
|
// src/index.ts
|
|
4183
4131
|
var index_exports = {};
|
|
4184
4132
|
__export(index_exports, {
|
|
@@ -4593,7 +4541,7 @@ var InputControl_default = InputControl2;
|
|
|
4593
4541
|
init_InputControlType();
|
|
4594
4542
|
|
|
4595
4543
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
4596
|
-
var
|
|
4544
|
+
var import_react53 = __toESM(require("react"));
|
|
4597
4545
|
|
|
4598
4546
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4599
4547
|
var import_react40 = __toESM(require("react"));
|
|
@@ -5367,7 +5315,7 @@ var WidgetNode_default = WidgetNode;
|
|
|
5367
5315
|
|
|
5368
5316
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5369
5317
|
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
5370
|
-
var
|
|
5318
|
+
var import_react52 = __toESM(require("react"));
|
|
5371
5319
|
|
|
5372
5320
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
5373
5321
|
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
@@ -6410,14 +6358,11 @@ var DocumentNode = (props) => {
|
|
|
6410
6358
|
var DocumentNode_default = DocumentNode;
|
|
6411
6359
|
|
|
6412
6360
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
6413
|
-
var
|
|
6361
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6414
6362
|
var Pagination2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
6415
6363
|
var Slider2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
6416
6364
|
ssr: false
|
|
6417
6365
|
});
|
|
6418
|
-
var EnterAnimationClient2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_EnterAnimationClient(), EnterAnimationClient_exports)), {
|
|
6419
|
-
ssr: false
|
|
6420
|
-
});
|
|
6421
6366
|
function toCamelCase(str) {
|
|
6422
6367
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
6423
6368
|
}
|
|
@@ -6667,7 +6612,7 @@ var DivContainer = async (props) => {
|
|
|
6667
6612
|
response = await serviceClient.get(endpoint);
|
|
6668
6613
|
result = response?.result;
|
|
6669
6614
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
6670
|
-
return /* @__PURE__ */ (0,
|
|
6615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(NoDataFound_default, {});
|
|
6671
6616
|
}
|
|
6672
6617
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
6673
6618
|
childCollectionData = getNestedValue6(
|
|
@@ -6687,7 +6632,7 @@ var DivContainer = async (props) => {
|
|
|
6687
6632
|
}
|
|
6688
6633
|
const SelectedNode = NodeTypes2[node.type];
|
|
6689
6634
|
if (!SelectedNode) return null;
|
|
6690
|
-
return /* @__PURE__ */ (0,
|
|
6635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6691
6636
|
SelectedNode,
|
|
6692
6637
|
{
|
|
6693
6638
|
node,
|
|
@@ -6817,16 +6762,17 @@ var DivContainer = async (props) => {
|
|
|
6817
6762
|
containerPaddingClass,
|
|
6818
6763
|
props.node.autoFormat && "auto-format",
|
|
6819
6764
|
props.node.bgClass,
|
|
6820
|
-
noLinkColor && "no-link-color"
|
|
6765
|
+
noLinkColor && "no-link-color",
|
|
6766
|
+
!!props.node.enterAnimation && "enter-animation"
|
|
6821
6767
|
].filter(Boolean).join(" ");
|
|
6822
|
-
return /* @__PURE__ */ (0,
|
|
6823
|
-
/* @__PURE__ */ (0,
|
|
6768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_react52.default.Fragment, { children: [
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6824
6770
|
"style",
|
|
6825
6771
|
{
|
|
6826
6772
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
6827
6773
|
}
|
|
6828
6774
|
),
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6830
6776
|
Wrapper,
|
|
6831
6777
|
{
|
|
6832
6778
|
id: guid,
|
|
@@ -6840,11 +6786,11 @@ var DivContainer = async (props) => {
|
|
|
6840
6786
|
item,
|
|
6841
6787
|
idx,
|
|
6842
6788
|
props.href ? void 0 : item?.links?.view
|
|
6843
|
-
)?.map((child, i) => /* @__PURE__ */ (0,
|
|
6789
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react52.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
6844
6790
|
)
|
|
6845
6791
|
}
|
|
6846
|
-
)
|
|
6847
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
6792
|
+
),
|
|
6793
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6848
6794
|
Pagination2,
|
|
6849
6795
|
{
|
|
6850
6796
|
path: props.path,
|
|
@@ -6857,7 +6803,7 @@ var DivContainer = async (props) => {
|
|
|
6857
6803
|
var DivContainer_default = DivContainer;
|
|
6858
6804
|
|
|
6859
6805
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
6860
|
-
var
|
|
6806
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6861
6807
|
var NodeTypes = {
|
|
6862
6808
|
["paragraph"]: ParagraphNode_default,
|
|
6863
6809
|
["heading"]: HeadingNode_default,
|
|
@@ -6894,14 +6840,14 @@ var PageBodyRenderer = (props) => {
|
|
|
6894
6840
|
}
|
|
6895
6841
|
return true;
|
|
6896
6842
|
};
|
|
6897
|
-
return /* @__PURE__ */ (0,
|
|
6843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
6898
6844
|
{
|
|
6899
6845
|
}
|
|
6900
6846
|
const SelectedNode = NodeTypes[node.type];
|
|
6901
6847
|
if (!shouldRenderNode(node)) {
|
|
6902
6848
|
return null;
|
|
6903
6849
|
}
|
|
6904
|
-
return /* @__PURE__ */ (0,
|
|
6850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6905
6851
|
SelectedNode,
|
|
6906
6852
|
{
|
|
6907
6853
|
node,
|
|
@@ -6917,7 +6863,7 @@ var PageBodyRenderer = (props) => {
|
|
|
6917
6863
|
device: props.device,
|
|
6918
6864
|
widgetRenderer: props.widgetRenderer
|
|
6919
6865
|
}
|
|
6920
|
-
) }) : /* @__PURE__ */ (0,
|
|
6866
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6921
6867
|
SelectedNode,
|
|
6922
6868
|
{
|
|
6923
6869
|
node,
|
|
@@ -6938,22 +6884,22 @@ var PageBodyRenderer = (props) => {
|
|
|
6938
6884
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
6939
6885
|
|
|
6940
6886
|
// src/components/Toast.tsx
|
|
6941
|
-
var
|
|
6887
|
+
var import_react54 = require("react");
|
|
6942
6888
|
init_ToastService();
|
|
6943
|
-
var
|
|
6889
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
6944
6890
|
var Toast = () => {
|
|
6945
|
-
const [showToast, setShowToast] = (0,
|
|
6946
|
-
const [message, setMessage] = (0,
|
|
6947
|
-
const [messageType, setMessageType] = (0,
|
|
6948
|
-
const timeoutRef = (0,
|
|
6949
|
-
const closeToast = (0,
|
|
6891
|
+
const [showToast, setShowToast] = (0, import_react54.useState)(false);
|
|
6892
|
+
const [message, setMessage] = (0, import_react54.useState)("");
|
|
6893
|
+
const [messageType, setMessageType] = (0, import_react54.useState)("error");
|
|
6894
|
+
const timeoutRef = (0, import_react54.useRef)(null);
|
|
6895
|
+
const closeToast = (0, import_react54.useCallback)(() => {
|
|
6950
6896
|
if (timeoutRef.current) {
|
|
6951
6897
|
clearTimeout(timeoutRef.current);
|
|
6952
6898
|
timeoutRef.current = null;
|
|
6953
6899
|
}
|
|
6954
6900
|
setShowToast(false);
|
|
6955
6901
|
}, []);
|
|
6956
|
-
const showMessage = (0,
|
|
6902
|
+
const showMessage = (0, import_react54.useCallback)((message2, messageType2) => {
|
|
6957
6903
|
if (timeoutRef.current) {
|
|
6958
6904
|
clearTimeout(timeoutRef.current);
|
|
6959
6905
|
}
|
|
@@ -6965,7 +6911,7 @@ var Toast = () => {
|
|
|
6965
6911
|
timeoutRef.current = null;
|
|
6966
6912
|
}, 4e3);
|
|
6967
6913
|
}, []);
|
|
6968
|
-
(0,
|
|
6914
|
+
(0, import_react54.useEffect)(() => {
|
|
6969
6915
|
ToastService_default.initialize(showMessage, closeToast);
|
|
6970
6916
|
return () => {
|
|
6971
6917
|
closeToast();
|
|
@@ -6974,8 +6920,8 @@ var Toast = () => {
|
|
|
6974
6920
|
});
|
|
6975
6921
|
};
|
|
6976
6922
|
}, [closeToast, showMessage]);
|
|
6977
|
-
return /* @__PURE__ */ (0,
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
6923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime74.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_runtime74.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
6924
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6979
6925
|
"span",
|
|
6980
6926
|
{
|
|
6981
6927
|
className: "font-medium text-inherit text-sm",
|
|
@@ -6983,7 +6929,7 @@ var Toast = () => {
|
|
|
6983
6929
|
children: message
|
|
6984
6930
|
}
|
|
6985
6931
|
),
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
6932
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6987
6933
|
"svg",
|
|
6988
6934
|
{
|
|
6989
6935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6991,7 +6937,7 @@ var Toast = () => {
|
|
|
6991
6937
|
fill: "none",
|
|
6992
6938
|
viewBox: "0 0 24 24",
|
|
6993
6939
|
stroke: "currentColor",
|
|
6994
|
-
children: /* @__PURE__ */ (0,
|
|
6940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
6995
6941
|
}
|
|
6996
6942
|
) })
|
|
6997
6943
|
] }) }) });
|
|
@@ -7018,7 +6964,7 @@ init_TimeInput();
|
|
|
7018
6964
|
// src/components/NavigationTabsV2.tsx
|
|
7019
6965
|
var import_link3 = __toESM(require("next/link"));
|
|
7020
6966
|
var import_navigation = require("next/navigation");
|
|
7021
|
-
var
|
|
6967
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
7022
6968
|
function resolveRoutePlaceholders(route, params) {
|
|
7023
6969
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
7024
6970
|
const value = params[key];
|
|
@@ -7043,8 +6989,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7043
6989
|
isActive: tab.isActive
|
|
7044
6990
|
})) || [];
|
|
7045
6991
|
if (mappedTabs.length === 0) return null;
|
|
7046
|
-
return /* @__PURE__ */ (0,
|
|
7047
|
-
return /* @__PURE__ */ (0,
|
|
6992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
6993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
7048
6994
|
"div",
|
|
7049
6995
|
{
|
|
7050
6996
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -7057,14 +7003,14 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7057
7003
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
7058
7004
|
|
|
7059
7005
|
// src/components/dataForm/DataList.tsx
|
|
7060
|
-
var
|
|
7006
|
+
var import_react57 = __toESM(require("react"));
|
|
7061
7007
|
var import_navigation2 = require("next/navigation");
|
|
7062
7008
|
|
|
7063
7009
|
// src/components/dataForm/NoContentView.tsx
|
|
7064
|
-
var
|
|
7065
|
-
var
|
|
7010
|
+
var import_react55 = __toESM(require("react"));
|
|
7011
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
7066
7012
|
var NoContentView = (props) => {
|
|
7067
|
-
return /* @__PURE__ */ (0,
|
|
7013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_react55.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
7068
7014
|
};
|
|
7069
7015
|
var NoContentView_default = NoContentView;
|
|
7070
7016
|
|
|
@@ -7072,39 +7018,39 @@ var NoContentView_default = NoContentView;
|
|
|
7072
7018
|
init_InputControlType();
|
|
7073
7019
|
|
|
7074
7020
|
// src/components/dataForm/ContentView.tsx
|
|
7075
|
-
var
|
|
7076
|
-
var
|
|
7021
|
+
var import_react56 = __toESM(require("react"));
|
|
7022
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7077
7023
|
var ContentView = (props) => {
|
|
7078
|
-
return /* @__PURE__ */ (0,
|
|
7079
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
7080
|
-
/* @__PURE__ */ (0,
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_react56.default.Fragment, { children: [
|
|
7025
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
7028
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "ml-2", children: [
|
|
7029
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
7030
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
7085
7031
|
] })
|
|
7086
7032
|
] }),
|
|
7087
|
-
/* @__PURE__ */ (0,
|
|
7088
|
-
/* @__PURE__ */ (0,
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7090
|
-
/* @__PURE__ */ (0,
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7033
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
7034
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "animate-pulse", children: [
|
|
7035
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7036
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7038
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7094
7040
|
] }),
|
|
7095
|
-
/* @__PURE__ */ (0,
|
|
7096
|
-
/* @__PURE__ */ (0,
|
|
7097
|
-
/* @__PURE__ */ (0,
|
|
7098
|
-
/* @__PURE__ */ (0,
|
|
7099
|
-
/* @__PURE__ */ (0,
|
|
7100
|
-
/* @__PURE__ */ (0,
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "animate-pulse", children: [
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7043
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7044
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7045
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7101
7047
|
] }),
|
|
7102
|
-
/* @__PURE__ */ (0,
|
|
7103
|
-
/* @__PURE__ */ (0,
|
|
7104
|
-
/* @__PURE__ */ (0,
|
|
7105
|
-
/* @__PURE__ */ (0,
|
|
7106
|
-
/* @__PURE__ */ (0,
|
|
7107
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "animate-pulse", children: [
|
|
7049
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
7050
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
7051
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
7052
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
7053
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7108
7054
|
] })
|
|
7109
7055
|
] })
|
|
7110
7056
|
] }) }),
|
|
@@ -7164,7 +7110,7 @@ function FormReducer(state, action) {
|
|
|
7164
7110
|
var FormReducer_default = FormReducer;
|
|
7165
7111
|
|
|
7166
7112
|
// src/components/dataForm/DataList.tsx
|
|
7167
|
-
var
|
|
7113
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
7168
7114
|
var DataList = (props) => {
|
|
7169
7115
|
const router = (0, import_navigation2.useRouter)();
|
|
7170
7116
|
let builder = new OdataBuilder(props.path);
|
|
@@ -7172,9 +7118,9 @@ var DataList = (props) => {
|
|
|
7172
7118
|
let activePageNumber = 0;
|
|
7173
7119
|
let pages = 0;
|
|
7174
7120
|
console.log(props.addLinkText);
|
|
7175
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
7176
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
7177
|
-
(0,
|
|
7121
|
+
const [isDataFound, setIsDataFound] = (0, import_react57.useState)(null);
|
|
7122
|
+
const [searchTerm, setSearchTerm] = (0, import_react57.useState)(props.query?.searchTerm ?? "");
|
|
7123
|
+
(0, import_react57.useEffect)(() => {
|
|
7178
7124
|
if (props?.dataset) {
|
|
7179
7125
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
7180
7126
|
setIsDataFound(true);
|
|
@@ -7183,7 +7129,7 @@ var DataList = (props) => {
|
|
|
7183
7129
|
}
|
|
7184
7130
|
}
|
|
7185
7131
|
}, [props.dataset]);
|
|
7186
|
-
(0,
|
|
7132
|
+
(0, import_react57.useEffect)(() => {
|
|
7187
7133
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
7188
7134
|
const filterQuery = props.query["$filter"];
|
|
7189
7135
|
props.filters.forEach((filter) => {
|
|
@@ -7202,7 +7148,7 @@ var DataList = (props) => {
|
|
|
7202
7148
|
if (path.includes(".")) {
|
|
7203
7149
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
7204
7150
|
} else if (Array.isArray(obj[path])) {
|
|
7205
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
7151
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: item }, index));
|
|
7206
7152
|
} else {
|
|
7207
7153
|
return obj[path];
|
|
7208
7154
|
}
|
|
@@ -7211,11 +7157,11 @@ var DataList = (props) => {
|
|
|
7211
7157
|
inputValues: {},
|
|
7212
7158
|
lastPropertyChanged: ""
|
|
7213
7159
|
};
|
|
7214
|
-
const [formState, dispatch] = (0,
|
|
7160
|
+
const [formState, dispatch] = (0, import_react57.useReducer)(FormReducer_default, initialState);
|
|
7215
7161
|
const getSearchableColumns = () => {
|
|
7216
7162
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
7217
7163
|
};
|
|
7218
|
-
const handleFilterChange = (0,
|
|
7164
|
+
const handleFilterChange = (0, import_react57.useCallback)(
|
|
7219
7165
|
(updatedValues) => {
|
|
7220
7166
|
dispatch({
|
|
7221
7167
|
type: FORM_INPUT_UPDATE,
|
|
@@ -7246,7 +7192,7 @@ var DataList = (props) => {
|
|
|
7246
7192
|
},
|
|
7247
7193
|
[dispatch, props, router]
|
|
7248
7194
|
);
|
|
7249
|
-
(0,
|
|
7195
|
+
(0, import_react57.useEffect)(() => {
|
|
7250
7196
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
7251
7197
|
return;
|
|
7252
7198
|
}
|
|
@@ -7281,30 +7227,30 @@ var DataList = (props) => {
|
|
|
7281
7227
|
const renderPageNumbers = () => {
|
|
7282
7228
|
if (pages <= 10) {
|
|
7283
7229
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
7284
|
-
(page) => /* @__PURE__ */ (0,
|
|
7230
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7285
7231
|
Hyperlink,
|
|
7286
7232
|
{
|
|
7287
7233
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7288
7234
|
href: builder.getNewPageUrl(page),
|
|
7289
7235
|
children: page
|
|
7290
7236
|
}
|
|
7291
|
-
) : /* @__PURE__ */ (0,
|
|
7237
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
7292
7238
|
);
|
|
7293
7239
|
} else {
|
|
7294
7240
|
const showFirstPages = activePageNumber <= 5;
|
|
7295
7241
|
const showLastPages = activePageNumber > pages - 5;
|
|
7296
7242
|
if (showFirstPages) {
|
|
7297
|
-
return /* @__PURE__ */ (0,
|
|
7298
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
7243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7244
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7299
7245
|
Hyperlink,
|
|
7300
7246
|
{
|
|
7301
7247
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7302
7248
|
href: builder.getNewPageUrl(page),
|
|
7303
7249
|
children: page
|
|
7304
7250
|
}
|
|
7305
|
-
) : /* @__PURE__ */ (0,
|
|
7306
|
-
/* @__PURE__ */ (0,
|
|
7307
|
-
/* @__PURE__ */ (0,
|
|
7251
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7308
7254
|
Hyperlink,
|
|
7309
7255
|
{
|
|
7310
7256
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7312,7 +7258,7 @@ var DataList = (props) => {
|
|
|
7312
7258
|
children: pages - 1
|
|
7313
7259
|
}
|
|
7314
7260
|
),
|
|
7315
|
-
/* @__PURE__ */ (0,
|
|
7261
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7316
7262
|
Hyperlink,
|
|
7317
7263
|
{
|
|
7318
7264
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7320,7 +7266,7 @@ var DataList = (props) => {
|
|
|
7320
7266
|
children: pages
|
|
7321
7267
|
}
|
|
7322
7268
|
),
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
7269
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7324
7270
|
"select",
|
|
7325
7271
|
{
|
|
7326
7272
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -7332,18 +7278,18 @@ var DataList = (props) => {
|
|
|
7332
7278
|
}
|
|
7333
7279
|
},
|
|
7334
7280
|
children: [
|
|
7335
|
-
/* @__PURE__ */ (0,
|
|
7281
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
7336
7282
|
Array.from(
|
|
7337
7283
|
{ length: Math.max(0, pages - 10) },
|
|
7338
7284
|
(_, index) => index + 9
|
|
7339
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
7285
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("option", { value: page, children: page }, page))
|
|
7340
7286
|
]
|
|
7341
7287
|
}
|
|
7342
7288
|
) })
|
|
7343
7289
|
] });
|
|
7344
7290
|
} else if (showLastPages) {
|
|
7345
|
-
return /* @__PURE__ */ (0,
|
|
7346
|
-
/* @__PURE__ */ (0,
|
|
7291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7292
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7347
7293
|
Hyperlink,
|
|
7348
7294
|
{
|
|
7349
7295
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7351,7 +7297,7 @@ var DataList = (props) => {
|
|
|
7351
7297
|
children: "1"
|
|
7352
7298
|
}
|
|
7353
7299
|
),
|
|
7354
|
-
/* @__PURE__ */ (0,
|
|
7300
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7355
7301
|
Hyperlink,
|
|
7356
7302
|
{
|
|
7357
7303
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7359,21 +7305,21 @@ var DataList = (props) => {
|
|
|
7359
7305
|
children: "2"
|
|
7360
7306
|
}
|
|
7361
7307
|
),
|
|
7362
|
-
/* @__PURE__ */ (0,
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7363
7309
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
7364
|
-
(page) => /* @__PURE__ */ (0,
|
|
7310
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7365
7311
|
Hyperlink,
|
|
7366
7312
|
{
|
|
7367
7313
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7368
7314
|
href: builder.getNewPageUrl(page),
|
|
7369
7315
|
children: page
|
|
7370
7316
|
}
|
|
7371
|
-
) : /* @__PURE__ */ (0,
|
|
7317
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
7372
7318
|
)
|
|
7373
7319
|
] });
|
|
7374
7320
|
} else {
|
|
7375
|
-
return /* @__PURE__ */ (0,
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7377
7323
|
Hyperlink,
|
|
7378
7324
|
{
|
|
7379
7325
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7381,7 +7327,7 @@ var DataList = (props) => {
|
|
|
7381
7327
|
children: "1"
|
|
7382
7328
|
}
|
|
7383
7329
|
),
|
|
7384
|
-
/* @__PURE__ */ (0,
|
|
7330
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7385
7331
|
Hyperlink,
|
|
7386
7332
|
{
|
|
7387
7333
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7389,20 +7335,20 @@ var DataList = (props) => {
|
|
|
7389
7335
|
children: "2"
|
|
7390
7336
|
}
|
|
7391
7337
|
),
|
|
7392
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7393
7339
|
Array.from(
|
|
7394
7340
|
{ length: 5 },
|
|
7395
7341
|
(_, index) => activePageNumber - 2 + index
|
|
7396
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
7342
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7397
7343
|
Hyperlink,
|
|
7398
7344
|
{
|
|
7399
7345
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
7400
7346
|
href: builder.getNewPageUrl(page),
|
|
7401
7347
|
children: page
|
|
7402
7348
|
}
|
|
7403
|
-
) : /* @__PURE__ */ (0,
|
|
7404
|
-
/* @__PURE__ */ (0,
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7349
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
7350
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7406
7352
|
Hyperlink,
|
|
7407
7353
|
{
|
|
7408
7354
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7410,7 +7356,7 @@ var DataList = (props) => {
|
|
|
7410
7356
|
children: pages - 1
|
|
7411
7357
|
}
|
|
7412
7358
|
),
|
|
7413
|
-
/* @__PURE__ */ (0,
|
|
7359
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7414
7360
|
Hyperlink,
|
|
7415
7361
|
{
|
|
7416
7362
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7418,7 +7364,7 @@ var DataList = (props) => {
|
|
|
7418
7364
|
children: pages
|
|
7419
7365
|
}
|
|
7420
7366
|
),
|
|
7421
|
-
/* @__PURE__ */ (0,
|
|
7367
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7422
7368
|
"select",
|
|
7423
7369
|
{
|
|
7424
7370
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -7430,8 +7376,8 @@ var DataList = (props) => {
|
|
|
7430
7376
|
}
|
|
7431
7377
|
},
|
|
7432
7378
|
children: [
|
|
7433
|
-
/* @__PURE__ */ (0,
|
|
7434
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("option", { value: "", children: "Jump to" }),
|
|
7380
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("option", { value: page, children: page }, page))
|
|
7435
7381
|
]
|
|
7436
7382
|
}
|
|
7437
7383
|
) })
|
|
@@ -7439,16 +7385,16 @@ var DataList = (props) => {
|
|
|
7439
7385
|
}
|
|
7440
7386
|
}
|
|
7441
7387
|
};
|
|
7442
|
-
return /* @__PURE__ */ (0,
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7444
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
7388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react57.default.Fragment, { children: [
|
|
7389
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(ContentView_default, { isDataFound, children: [
|
|
7390
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7445
7391
|
"div",
|
|
7446
7392
|
{
|
|
7447
7393
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
7448
7394
|
children: [
|
|
7449
|
-
props.title ? /* @__PURE__ */ (0,
|
|
7450
|
-
/* @__PURE__ */ (0,
|
|
7451
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
7395
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", {}),
|
|
7396
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7397
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7452
7398
|
InputControl_default,
|
|
7453
7399
|
{
|
|
7454
7400
|
name: "Search_input",
|
|
@@ -7460,7 +7406,7 @@ var DataList = (props) => {
|
|
|
7460
7406
|
}
|
|
7461
7407
|
}
|
|
7462
7408
|
),
|
|
7463
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
7409
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7464
7410
|
InputControl_default,
|
|
7465
7411
|
{
|
|
7466
7412
|
name: filter.name,
|
|
@@ -7475,15 +7421,15 @@ var DataList = (props) => {
|
|
|
7475
7421
|
},
|
|
7476
7422
|
filter.name
|
|
7477
7423
|
)),
|
|
7478
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
7424
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7479
7425
|
Hyperlink,
|
|
7480
7426
|
{
|
|
7481
7427
|
className: "gap-1",
|
|
7482
7428
|
linkType: "Primary" /* Solid */,
|
|
7483
7429
|
href: props.addLinkHref,
|
|
7484
7430
|
children: [
|
|
7485
|
-
/* @__PURE__ */ (0,
|
|
7486
|
-
/* @__PURE__ */ (0,
|
|
7431
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
7432
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
7487
7433
|
]
|
|
7488
7434
|
}
|
|
7489
7435
|
)
|
|
@@ -7491,8 +7437,8 @@ var DataList = (props) => {
|
|
|
7491
7437
|
]
|
|
7492
7438
|
}
|
|
7493
7439
|
),
|
|
7494
|
-
/* @__PURE__ */ (0,
|
|
7495
|
-
/* @__PURE__ */ (0,
|
|
7440
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
7441
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
7496
7442
|
let url = builder.getNewOrderByUrl(column.name);
|
|
7497
7443
|
let icon = "chevronUpDown";
|
|
7498
7444
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -7502,18 +7448,18 @@ var DataList = (props) => {
|
|
|
7502
7448
|
icon = "chevronUp";
|
|
7503
7449
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
7504
7450
|
}
|
|
7505
|
-
return /* @__PURE__ */ (0,
|
|
7451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7506
7452
|
"th",
|
|
7507
7453
|
{
|
|
7508
7454
|
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" : ""),
|
|
7509
|
-
children: /* @__PURE__ */ (0,
|
|
7455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7510
7456
|
Hyperlink,
|
|
7511
7457
|
{
|
|
7512
7458
|
href: column.enableSorting ? url : void 0,
|
|
7513
7459
|
className: "!text-neutral-contrast ",
|
|
7514
|
-
children: /* @__PURE__ */ (0,
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7516
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
7460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
7461
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-black", children: column.label }),
|
|
7462
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
7517
7463
|
] })
|
|
7518
7464
|
}
|
|
7519
7465
|
)
|
|
@@ -7521,24 +7467,24 @@ var DataList = (props) => {
|
|
|
7521
7467
|
column.name
|
|
7522
7468
|
);
|
|
7523
7469
|
}) }) }),
|
|
7524
|
-
/* @__PURE__ */ (0,
|
|
7470
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
7525
7471
|
let validityClass = "";
|
|
7526
7472
|
console.log("dataitem", dataitem);
|
|
7527
7473
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
7528
7474
|
validityClass = "bg-alert-200";
|
|
7529
7475
|
}
|
|
7530
|
-
return /* @__PURE__ */ (0,
|
|
7476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
7531
7477
|
console.log("column", column);
|
|
7532
|
-
return /* @__PURE__ */ (0,
|
|
7478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7533
7479
|
"td",
|
|
7534
7480
|
{
|
|
7535
7481
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
7536
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
7482
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7537
7483
|
Hyperlink,
|
|
7538
7484
|
{
|
|
7539
7485
|
className: "",
|
|
7540
7486
|
href: `https://${dataitem[column.name]}`,
|
|
7541
|
-
children: /* @__PURE__ */ (0,
|
|
7487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7542
7488
|
ViewControl_default,
|
|
7543
7489
|
{
|
|
7544
7490
|
controlType: column.controlType,
|
|
@@ -7551,11 +7497,11 @@ var DataList = (props) => {
|
|
|
7551
7497
|
}
|
|
7552
7498
|
)
|
|
7553
7499
|
}
|
|
7554
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
7500
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7555
7501
|
Hyperlink,
|
|
7556
7502
|
{
|
|
7557
7503
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
7558
|
-
children: /* @__PURE__ */ (0,
|
|
7504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7559
7505
|
ViewControl_default,
|
|
7560
7506
|
{
|
|
7561
7507
|
controlType: column.controlType,
|
|
@@ -7565,7 +7511,7 @@ var DataList = (props) => {
|
|
|
7565
7511
|
}
|
|
7566
7512
|
)
|
|
7567
7513
|
}
|
|
7568
|
-
) : /* @__PURE__ */ (0,
|
|
7514
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7569
7515
|
ViewControl_default,
|
|
7570
7516
|
{
|
|
7571
7517
|
controlType: column.controlType,
|
|
@@ -7579,10 +7525,10 @@ var DataList = (props) => {
|
|
|
7579
7525
|
}) }, index);
|
|
7580
7526
|
}) })
|
|
7581
7527
|
] }) }),
|
|
7582
|
-
/* @__PURE__ */ (0,
|
|
7583
|
-
/* @__PURE__ */ (0,
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7585
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
7528
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7529
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "text-gray-700", children: label }),
|
|
7530
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
7531
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7586
7532
|
Hyperlink,
|
|
7587
7533
|
{
|
|
7588
7534
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -7590,9 +7536,9 @@ var DataList = (props) => {
|
|
|
7590
7536
|
children: "Prev"
|
|
7591
7537
|
}
|
|
7592
7538
|
),
|
|
7593
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
7539
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime78.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" }),
|
|
7594
7540
|
renderPageNumbers(),
|
|
7595
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
7541
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7596
7542
|
Hyperlink,
|
|
7597
7543
|
{
|
|
7598
7544
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -7600,19 +7546,19 @@ var DataList = (props) => {
|
|
|
7600
7546
|
children: "Next"
|
|
7601
7547
|
}
|
|
7602
7548
|
),
|
|
7603
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
7549
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
7604
7550
|
] })
|
|
7605
7551
|
] }) })
|
|
7606
7552
|
] }),
|
|
7607
|
-
/* @__PURE__ */ (0,
|
|
7608
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
7553
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
7554
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7609
7555
|
"div",
|
|
7610
7556
|
{
|
|
7611
7557
|
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`,
|
|
7612
7558
|
children: [
|
|
7613
|
-
props.title ? /* @__PURE__ */ (0,
|
|
7614
|
-
/* @__PURE__ */ (0,
|
|
7615
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
7559
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", {}),
|
|
7560
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7561
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7616
7562
|
InputControl_default,
|
|
7617
7563
|
{
|
|
7618
7564
|
name: "Search_input",
|
|
@@ -7624,7 +7570,7 @@ var DataList = (props) => {
|
|
|
7624
7570
|
}
|
|
7625
7571
|
}
|
|
7626
7572
|
),
|
|
7627
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
7573
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7628
7574
|
InputControl_default,
|
|
7629
7575
|
{
|
|
7630
7576
|
name: filter.name,
|
|
@@ -7639,15 +7585,15 @@ var DataList = (props) => {
|
|
|
7639
7585
|
},
|
|
7640
7586
|
filter.name
|
|
7641
7587
|
)),
|
|
7642
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
7588
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7643
7589
|
Hyperlink,
|
|
7644
7590
|
{
|
|
7645
7591
|
className: "gap-1",
|
|
7646
7592
|
linkType: "Primary" /* Solid */,
|
|
7647
7593
|
href: props.addLinkHref,
|
|
7648
7594
|
children: [
|
|
7649
|
-
/* @__PURE__ */ (0,
|
|
7650
|
-
/* @__PURE__ */ (0,
|
|
7595
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
7596
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
7651
7597
|
]
|
|
7652
7598
|
}
|
|
7653
7599
|
)
|
|
@@ -7655,8 +7601,8 @@ var DataList = (props) => {
|
|
|
7655
7601
|
]
|
|
7656
7602
|
}
|
|
7657
7603
|
),
|
|
7658
|
-
/* @__PURE__ */ (0,
|
|
7659
|
-
/* @__PURE__ */ (0,
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
7605
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
7660
7606
|
let url = builder.getNewOrderByUrl(column.name);
|
|
7661
7607
|
let icon = "chevronUpDown";
|
|
7662
7608
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -7666,18 +7612,18 @@ var DataList = (props) => {
|
|
|
7666
7612
|
icon = "chevronUp";
|
|
7667
7613
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
7668
7614
|
}
|
|
7669
|
-
return /* @__PURE__ */ (0,
|
|
7615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7670
7616
|
"th",
|
|
7671
7617
|
{
|
|
7672
7618
|
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" : ""),
|
|
7673
|
-
children: /* @__PURE__ */ (0,
|
|
7619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7674
7620
|
Hyperlink,
|
|
7675
7621
|
{
|
|
7676
7622
|
href: column.enableSorting ? url : void 0,
|
|
7677
7623
|
className: "text-body-950",
|
|
7678
|
-
children: /* @__PURE__ */ (0,
|
|
7679
|
-
/* @__PURE__ */ (0,
|
|
7680
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
7624
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: column.label }),
|
|
7626
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
7681
7627
|
] })
|
|
7682
7628
|
}
|
|
7683
7629
|
)
|
|
@@ -7685,7 +7631,7 @@ var DataList = (props) => {
|
|
|
7685
7631
|
column.name
|
|
7686
7632
|
);
|
|
7687
7633
|
}) }) }) }) }),
|
|
7688
|
-
/* @__PURE__ */ (0,
|
|
7634
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
7689
7635
|
] })
|
|
7690
7636
|
] })
|
|
7691
7637
|
] });
|
|
@@ -7693,12 +7639,12 @@ var DataList = (props) => {
|
|
|
7693
7639
|
var DataList_default = DataList;
|
|
7694
7640
|
|
|
7695
7641
|
// src/components/dataForm/DataListRenderer.tsx
|
|
7696
|
-
var
|
|
7642
|
+
var import_react58 = __toESM(require("react"));
|
|
7697
7643
|
init_ServiceClient();
|
|
7698
7644
|
init_OdataBuilder();
|
|
7699
7645
|
init_SelectWithSearchInput();
|
|
7700
7646
|
var import_navigation3 = require("next/navigation");
|
|
7701
|
-
var
|
|
7647
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7702
7648
|
var viewControlMap = {
|
|
7703
7649
|
number: ViewControlTypes.number,
|
|
7704
7650
|
lineText: ViewControlTypes.lineText,
|
|
@@ -7753,14 +7699,14 @@ var DataListRenderer = ({
|
|
|
7753
7699
|
widgetProps
|
|
7754
7700
|
}) => {
|
|
7755
7701
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
7756
|
-
const [columns, setColumns] = (0,
|
|
7757
|
-
const [dataset, setDataset] = (0,
|
|
7758
|
-
const [filter, setFilters] = (0,
|
|
7759
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
7760
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
7761
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
7702
|
+
const [columns, setColumns] = (0, import_react58.useState)([]);
|
|
7703
|
+
const [dataset, setDataset] = (0, import_react58.useState)();
|
|
7704
|
+
const [filter, setFilters] = (0, import_react58.useState)([]);
|
|
7705
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react58.useState)("");
|
|
7706
|
+
const [addLinkText, setAddLinkText] = (0, import_react58.useState)("");
|
|
7707
|
+
const [serviceRoute, setServiceRoute] = (0, import_react58.useState)("");
|
|
7762
7708
|
const pathname = (0, import_navigation3.usePathname)();
|
|
7763
|
-
(0,
|
|
7709
|
+
(0, import_react58.useEffect)(() => {
|
|
7764
7710
|
if (!formDefinition) return;
|
|
7765
7711
|
setColumns(mapApiToColumns(formDefinition));
|
|
7766
7712
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -7773,7 +7719,7 @@ var DataListRenderer = ({
|
|
|
7773
7719
|
setAddLinkHref(resolvedAddLinkHref);
|
|
7774
7720
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
7775
7721
|
}, [formDefinition, params]);
|
|
7776
|
-
(0,
|
|
7722
|
+
(0, import_react58.useEffect)(() => {
|
|
7777
7723
|
const fetchData = async () => {
|
|
7778
7724
|
if (!serviceRoute) return;
|
|
7779
7725
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -7793,15 +7739,15 @@ var DataListRenderer = ({
|
|
|
7793
7739
|
isActive: landingPageUrl === pathname
|
|
7794
7740
|
};
|
|
7795
7741
|
});
|
|
7796
|
-
return /* @__PURE__ */ (0,
|
|
7797
|
-
resolvedTabs.length > 0 && /* @__PURE__ */ (0,
|
|
7742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react58.default.Fragment, { children: [
|
|
7743
|
+
resolvedTabs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7798
7744
|
NavigationTabsV2_default,
|
|
7799
7745
|
{
|
|
7800
7746
|
tabs: resolvedTabs,
|
|
7801
7747
|
params: widgetProps?.params ?? params
|
|
7802
7748
|
}
|
|
7803
7749
|
),
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7750
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7805
7751
|
DataList_default,
|
|
7806
7752
|
{
|
|
7807
7753
|
addLinkHref,
|
|
@@ -7823,13 +7769,13 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
7823
7769
|
init_InputControlType();
|
|
7824
7770
|
|
|
7825
7771
|
// src/components/dataForm/DataForm.tsx
|
|
7826
|
-
var
|
|
7772
|
+
var import_react60 = __toESM(require("react"));
|
|
7827
7773
|
init_Icon();
|
|
7828
7774
|
init_Button();
|
|
7829
7775
|
init_StyleTypes();
|
|
7830
7776
|
|
|
7831
7777
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
7832
|
-
var
|
|
7778
|
+
var import_react59 = __toESM(require("react"));
|
|
7833
7779
|
|
|
7834
7780
|
// src/components/dataForm/StyleTypes.tsx
|
|
7835
7781
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -7856,7 +7802,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
7856
7802
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
7857
7803
|
|
|
7858
7804
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
7859
|
-
var
|
|
7805
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7860
7806
|
var DataFormChildSection = (props) => {
|
|
7861
7807
|
const { section } = props;
|
|
7862
7808
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -7868,7 +7814,7 @@ var DataFormChildSection = (props) => {
|
|
|
7868
7814
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
7869
7815
|
};
|
|
7870
7816
|
const childItemsToRender = getChildItemsForRendering();
|
|
7871
|
-
const handleChildInputChange = (0,
|
|
7817
|
+
const handleChildInputChange = (0, import_react59.useCallback)(
|
|
7872
7818
|
(updatedValues) => {
|
|
7873
7819
|
if (isOneToOne) {
|
|
7874
7820
|
props.callback({
|
|
@@ -7895,7 +7841,7 @@ var DataFormChildSection = (props) => {
|
|
|
7895
7841
|
},
|
|
7896
7842
|
[props, isOneToOne, childItemsToRender]
|
|
7897
7843
|
);
|
|
7898
|
-
const onAddRow = (0,
|
|
7844
|
+
const onAddRow = (0, import_react59.useCallback)(() => {
|
|
7899
7845
|
props.callback({
|
|
7900
7846
|
sectionName: props.section.name,
|
|
7901
7847
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -7904,7 +7850,7 @@ var DataFormChildSection = (props) => {
|
|
|
7904
7850
|
rowIndex: -1
|
|
7905
7851
|
});
|
|
7906
7852
|
}, [props]);
|
|
7907
|
-
const onDeleteRow = (0,
|
|
7853
|
+
const onDeleteRow = (0, import_react59.useCallback)(
|
|
7908
7854
|
(filteredIndex) => {
|
|
7909
7855
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
7910
7856
|
if (visibleItem) {
|
|
@@ -7924,14 +7870,14 @@ var DataFormChildSection = (props) => {
|
|
|
7924
7870
|
childItemsToRender,
|
|
7925
7871
|
allChildItems: childItems
|
|
7926
7872
|
});
|
|
7927
|
-
return /* @__PURE__ */ (0,
|
|
7928
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
7929
|
-
/* @__PURE__ */ (0,
|
|
7930
|
-
/* @__PURE__ */ (0,
|
|
7931
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
7932
|
-
return /* @__PURE__ */ (0,
|
|
7873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react59.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
7874
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
7875
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
7876
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
7877
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
7878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("tr", { className: "", children: [
|
|
7933
7879
|
sectionRow.elements.map((field, index) => {
|
|
7934
|
-
return /* @__PURE__ */ (0,
|
|
7880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7935
7881
|
"th",
|
|
7936
7882
|
{
|
|
7937
7883
|
className: "py-3 font-normal text-left",
|
|
@@ -7940,21 +7886,21 @@ var DataFormChildSection = (props) => {
|
|
|
7940
7886
|
field.name
|
|
7941
7887
|
);
|
|
7942
7888
|
}),
|
|
7943
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7889
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
7944
7890
|
] }, sectionRowIndex);
|
|
7945
7891
|
}) }),
|
|
7946
|
-
/* @__PURE__ */ (0,
|
|
7892
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
7947
7893
|
const { item, originalIndex } = visibleItem;
|
|
7948
7894
|
const rowKey = originalIndex;
|
|
7949
|
-
return /* @__PURE__ */ (0,
|
|
7895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react59.default.Fragment, { children: section.sectionRows.map(
|
|
7950
7896
|
(sectionRow, sectionRowIndex) => {
|
|
7951
|
-
return /* @__PURE__ */ (0,
|
|
7897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
7952
7898
|
"tr",
|
|
7953
7899
|
{
|
|
7954
7900
|
className: "",
|
|
7955
7901
|
children: [
|
|
7956
7902
|
sectionRow.elements.map((field, index) => {
|
|
7957
|
-
return /* @__PURE__ */ (0,
|
|
7903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "w-11/12", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7958
7904
|
InputControl_default,
|
|
7959
7905
|
{
|
|
7960
7906
|
index: filteredIndex,
|
|
@@ -7974,7 +7920,7 @@ var DataFormChildSection = (props) => {
|
|
|
7974
7920
|
}
|
|
7975
7921
|
) }) }) }, field.name);
|
|
7976
7922
|
}),
|
|
7977
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7923
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7978
7924
|
ClientButton_default,
|
|
7979
7925
|
{
|
|
7980
7926
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -7983,7 +7929,7 @@ var DataFormChildSection = (props) => {
|
|
|
7983
7929
|
},
|
|
7984
7930
|
dataRole: "delete",
|
|
7985
7931
|
tabIndex: -1,
|
|
7986
|
-
children: /* @__PURE__ */ (0,
|
|
7932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7987
7933
|
Icon_default,
|
|
7988
7934
|
{
|
|
7989
7935
|
className: "w-4 h-4",
|
|
@@ -8000,7 +7946,7 @@ var DataFormChildSection = (props) => {
|
|
|
8000
7946
|
) }, rowKey);
|
|
8001
7947
|
}) })
|
|
8002
7948
|
] }) }),
|
|
8003
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
7949
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
8004
7950
|
ClientButton_default,
|
|
8005
7951
|
{
|
|
8006
7952
|
ButtonType: "Link" /* Link */,
|
|
@@ -8015,9 +7961,9 @@ var DataFormChildSection = (props) => {
|
|
|
8015
7961
|
var DataFormChildSection_default = DataFormChildSection;
|
|
8016
7962
|
|
|
8017
7963
|
// src/components/dataForm/DataForm.tsx
|
|
8018
|
-
var
|
|
7964
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
8019
7965
|
var DataForm = (props) => {
|
|
8020
|
-
const formRef = (0,
|
|
7966
|
+
const formRef = (0, import_react60.useRef)(null);
|
|
8021
7967
|
console.log(props.dataItem, "dssads");
|
|
8022
7968
|
const initialState = {
|
|
8023
7969
|
inputValues: {},
|
|
@@ -8026,9 +7972,9 @@ var DataForm = (props) => {
|
|
|
8026
7972
|
const childInitialState = {
|
|
8027
7973
|
inputValues: []
|
|
8028
7974
|
};
|
|
8029
|
-
const [formState, dispatch] = (0,
|
|
7975
|
+
const [formState, dispatch] = (0, import_react60.useReducer)(FormReducer_default, initialState);
|
|
8030
7976
|
console.log(props.sections, "sections");
|
|
8031
|
-
const clearHiddenChildSections = (0,
|
|
7977
|
+
const clearHiddenChildSections = (0, import_react60.useCallback)(
|
|
8032
7978
|
(changedProperty, newValues) => {
|
|
8033
7979
|
if (!props.sections) return;
|
|
8034
7980
|
const allChildSections = [];
|
|
@@ -8066,7 +8012,7 @@ var DataForm = (props) => {
|
|
|
8066
8012
|
},
|
|
8067
8013
|
[props.sections, formState.inputValues]
|
|
8068
8014
|
);
|
|
8069
|
-
const handleInputChange = (0,
|
|
8015
|
+
const handleInputChange = (0, import_react60.useCallback)(
|
|
8070
8016
|
async (updatedValues) => {
|
|
8071
8017
|
dispatch({
|
|
8072
8018
|
type: FORM_INPUT_UPDATE,
|
|
@@ -8081,7 +8027,7 @@ var DataForm = (props) => {
|
|
|
8081
8027
|
},
|
|
8082
8028
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
8083
8029
|
);
|
|
8084
|
-
const fetchData = (0,
|
|
8030
|
+
const fetchData = (0, import_react60.useCallback)(async () => {
|
|
8085
8031
|
if (!props.rules) return;
|
|
8086
8032
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
8087
8033
|
return;
|
|
@@ -8112,7 +8058,7 @@ var DataForm = (props) => {
|
|
|
8112
8058
|
console.error("Error fetching data:", error);
|
|
8113
8059
|
}
|
|
8114
8060
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
8115
|
-
(0,
|
|
8061
|
+
(0, import_react60.useEffect)(() => {
|
|
8116
8062
|
fetchData();
|
|
8117
8063
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
8118
8064
|
function replacePlaceholders(template, context, params) {
|
|
@@ -8132,7 +8078,7 @@ var DataForm = (props) => {
|
|
|
8132
8078
|
}
|
|
8133
8079
|
);
|
|
8134
8080
|
}
|
|
8135
|
-
const handleChildSectionChangeCallback = (0,
|
|
8081
|
+
const handleChildSectionChangeCallback = (0, import_react60.useCallback)(
|
|
8136
8082
|
(params) => {
|
|
8137
8083
|
dispatch({
|
|
8138
8084
|
type: params.actionType,
|
|
@@ -8177,7 +8123,7 @@ var DataForm = (props) => {
|
|
|
8177
8123
|
});
|
|
8178
8124
|
return cloned;
|
|
8179
8125
|
}
|
|
8180
|
-
const onClick = (0,
|
|
8126
|
+
const onClick = (0, import_react60.useCallback)(async () => {
|
|
8181
8127
|
if (props.onClick) {
|
|
8182
8128
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
8183
8129
|
const normalizedValues = normalizeChildSections(
|
|
@@ -8193,21 +8139,21 @@ var DataForm = (props) => {
|
|
|
8193
8139
|
return { isSuccessful: true };
|
|
8194
8140
|
}
|
|
8195
8141
|
}, [formState, props]);
|
|
8196
|
-
const handleAdditionalOnClick = (0,
|
|
8142
|
+
const handleAdditionalOnClick = (0, import_react60.useCallback)(async () => {
|
|
8197
8143
|
if (props.additionalActions?.onClick) {
|
|
8198
8144
|
return await props.additionalActions.onClick(formState);
|
|
8199
8145
|
} else {
|
|
8200
8146
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
8201
8147
|
}
|
|
8202
8148
|
}, [formState, props]);
|
|
8203
|
-
const onDelete = (0,
|
|
8149
|
+
const onDelete = (0, import_react60.useCallback)(async () => {
|
|
8204
8150
|
if (props.onDelete) {
|
|
8205
8151
|
return await props.onDelete(formState);
|
|
8206
8152
|
} else {
|
|
8207
8153
|
return { isSuccessful: true };
|
|
8208
8154
|
}
|
|
8209
8155
|
}, [formState, props]);
|
|
8210
|
-
(0,
|
|
8156
|
+
(0, import_react60.useEffect)(() => {
|
|
8211
8157
|
if (props.dataItem) {
|
|
8212
8158
|
dispatch({
|
|
8213
8159
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -8235,19 +8181,19 @@ var DataForm = (props) => {
|
|
|
8235
8181
|
return false;
|
|
8236
8182
|
}
|
|
8237
8183
|
}
|
|
8238
|
-
return /* @__PURE__ */ (0,
|
|
8239
|
-
props.title && /* @__PURE__ */ (0,
|
|
8184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react60.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
8185
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime81.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_runtime81.jsxs)(
|
|
8240
8186
|
"div",
|
|
8241
8187
|
{
|
|
8242
8188
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
8243
8189
|
onClick: () => window.history.back(),
|
|
8244
8190
|
children: [
|
|
8245
|
-
/* @__PURE__ */ (0,
|
|
8246
|
-
/* @__PURE__ */ (0,
|
|
8191
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
8192
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
8247
8193
|
]
|
|
8248
8194
|
}
|
|
8249
8195
|
) }),
|
|
8250
|
-
/* @__PURE__ */ (0,
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8251
8197
|
"form",
|
|
8252
8198
|
{
|
|
8253
8199
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -8268,8 +8214,8 @@ var DataForm = (props) => {
|
|
|
8268
8214
|
}
|
|
8269
8215
|
}
|
|
8270
8216
|
},
|
|
8271
|
-
children: /* @__PURE__ */ (0,
|
|
8272
|
-
return /* @__PURE__ */ (0,
|
|
8217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
8218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react60.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
8273
8219
|
section.sectionRows?.map(
|
|
8274
8220
|
(sectionRow, sectionRowIndex) => {
|
|
8275
8221
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -8280,14 +8226,14 @@ var DataForm = (props) => {
|
|
|
8280
8226
|
sectionRow.visible
|
|
8281
8227
|
);
|
|
8282
8228
|
}
|
|
8283
|
-
return /* @__PURE__ */ (0,
|
|
8284
|
-
return /* @__PURE__ */ (0,
|
|
8229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react60.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
8230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
8285
8231
|
"div",
|
|
8286
8232
|
{
|
|
8287
8233
|
className: sectionRow.grow ? "grow" : "",
|
|
8288
8234
|
children: [
|
|
8289
|
-
/* @__PURE__ */ (0,
|
|
8290
|
-
/* @__PURE__ */ (0,
|
|
8235
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: field.controlType }),
|
|
8236
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8291
8237
|
InputControl_default,
|
|
8292
8238
|
{
|
|
8293
8239
|
name: field.name,
|
|
@@ -8317,12 +8263,12 @@ var DataForm = (props) => {
|
|
|
8317
8263
|
}) }) }, sectionRowIndex);
|
|
8318
8264
|
}
|
|
8319
8265
|
),
|
|
8320
|
-
/* @__PURE__ */ (0,
|
|
8266
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: section.childSections?.map(
|
|
8321
8267
|
(childSection, childSectionIndex) => {
|
|
8322
|
-
return /* @__PURE__ */ (0,
|
|
8268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
8323
8269
|
formState.inputValues,
|
|
8324
8270
|
childSection.visible
|
|
8325
|
-
) && /* @__PURE__ */ (0,
|
|
8271
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8326
8272
|
DataFormChildSection_default,
|
|
8327
8273
|
{
|
|
8328
8274
|
section: childSection,
|
|
@@ -8337,8 +8283,8 @@ var DataForm = (props) => {
|
|
|
8337
8283
|
}) })
|
|
8338
8284
|
}
|
|
8339
8285
|
),
|
|
8340
|
-
/* @__PURE__ */ (0,
|
|
8341
|
-
/* @__PURE__ */ (0,
|
|
8286
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
8287
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8342
8288
|
Button_default,
|
|
8343
8289
|
{
|
|
8344
8290
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -8346,7 +8292,7 @@ var DataForm = (props) => {
|
|
|
8346
8292
|
children: props.additionalActions.title
|
|
8347
8293
|
}
|
|
8348
8294
|
) }),
|
|
8349
|
-
/* @__PURE__ */ (0,
|
|
8295
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8350
8296
|
Button_default,
|
|
8351
8297
|
{
|
|
8352
8298
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -8357,7 +8303,7 @@ var DataForm = (props) => {
|
|
|
8357
8303
|
children: "Delete"
|
|
8358
8304
|
}
|
|
8359
8305
|
) }),
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8306
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8361
8307
|
Button_default,
|
|
8362
8308
|
{
|
|
8363
8309
|
onValidate,
|
|
@@ -8375,7 +8321,7 @@ var DataForm_default = DataForm;
|
|
|
8375
8321
|
|
|
8376
8322
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
8377
8323
|
init_ServiceClient();
|
|
8378
|
-
var
|
|
8324
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
8379
8325
|
function getAction(actions, code) {
|
|
8380
8326
|
return actions?.find((a) => a.actionCode === code);
|
|
8381
8327
|
}
|
|
@@ -8401,9 +8347,9 @@ var DataFormRenderer = ({
|
|
|
8401
8347
|
"Delete"
|
|
8402
8348
|
);
|
|
8403
8349
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
8404
|
-
return /* @__PURE__ */ (0,
|
|
8405
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
8406
|
-
/* @__PURE__ */ (0,
|
|
8350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
8351
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8407
8353
|
DataForm_default,
|
|
8408
8354
|
{
|
|
8409
8355
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|