@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260320074145 → 0.8.1-dev.20260323055150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1241 -257
- package/dist/index.mjs +1235 -250
- package/package.json +8 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
"use strict";
|
|
2
4
|
var __create = Object.create;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
@@ -1420,7 +1422,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1420
1422
|
const containerRef = (0, import_react27.useRef)(null);
|
|
1421
1423
|
const [isCreateOpen, setIsCreateOpen] = (0, import_react27.useState)(false);
|
|
1422
1424
|
const [formData, setFormData] = (0, import_react27.useState)({});
|
|
1423
|
-
const
|
|
1425
|
+
const getNestedValue2 = (obj, path) => {
|
|
1424
1426
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
1425
1427
|
};
|
|
1426
1428
|
(0, import_react27.useEffect)(() => {
|
|
@@ -1458,7 +1460,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1458
1460
|
props.dataSourceDependsOn
|
|
1459
1461
|
]);
|
|
1460
1462
|
const filteredItems = list?.filter((item) => {
|
|
1461
|
-
const value =
|
|
1463
|
+
const value = getNestedValue2(item, props.dataTextFieldName);
|
|
1462
1464
|
return value?.toLowerCase().includes(searchTerm?.toLowerCase());
|
|
1463
1465
|
});
|
|
1464
1466
|
const playBeep = () => {
|
|
@@ -1489,7 +1491,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1489
1491
|
}, [searchTerm]);
|
|
1490
1492
|
const handleSelect = (event, item) => {
|
|
1491
1493
|
event.preventDefault();
|
|
1492
|
-
setSearchTerm(
|
|
1494
|
+
setSearchTerm(getNestedValue2(item, props.dataTextFieldName));
|
|
1493
1495
|
if (props.callback) {
|
|
1494
1496
|
const val = {};
|
|
1495
1497
|
props.callback({
|
|
@@ -1636,7 +1638,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1636
1638
|
role: "option",
|
|
1637
1639
|
tabIndex: -1,
|
|
1638
1640
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
1639
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children:
|
|
1641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: getNestedValue2(item, props.dataTextFieldName) })
|
|
1640
1642
|
}
|
|
1641
1643
|
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
1642
1644
|
}
|
|
@@ -1935,51 +1937,146 @@ var OdataBuilder = class {
|
|
|
1935
1937
|
this.baseUrl = url;
|
|
1936
1938
|
this.top = Constants.pagesize.toString();
|
|
1937
1939
|
this.skip = "0";
|
|
1940
|
+
this.keyword = "";
|
|
1938
1941
|
this.filterBy = "";
|
|
1939
1942
|
this.orderBy = "";
|
|
1940
1943
|
}
|
|
1944
|
+
// parseSearchParams(ReadonlyUrlSearchParams): DataQuery {
|
|
1945
|
+
// this.top = top;
|
|
1946
|
+
// return this;
|
|
1947
|
+
// }
|
|
1941
1948
|
setQuery(odata) {
|
|
1942
|
-
if (
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1949
|
+
if (odata) {
|
|
1950
|
+
for (const key in odata) {
|
|
1951
|
+
if (odata[key] != null && odata[key] != "") {
|
|
1952
|
+
if (key == "$skip") {
|
|
1953
|
+
this.setSkip(odata[key]);
|
|
1954
|
+
}
|
|
1955
|
+
if (key == "$filter") {
|
|
1956
|
+
this.setFilter(odata[key]);
|
|
1957
|
+
}
|
|
1958
|
+
if (key == "$top") {
|
|
1959
|
+
this.setTop(odata[key]);
|
|
1960
|
+
}
|
|
1961
|
+
if (key == "$orderby") {
|
|
1962
|
+
this.setOrderBy(odata[key]);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
return this;
|
|
1968
|
+
}
|
|
1969
|
+
// parseKeyValuePairs(inputString: string): { [key: string]: string } {
|
|
1970
|
+
// return inputString.split('$')
|
|
1971
|
+
// .map((pair) => pair.split('='))
|
|
1972
|
+
// .reduce((result: { [key: string]: string }, [key, value]) => {
|
|
1973
|
+
// if (key && value) {
|
|
1974
|
+
// result[key.trim()] = value.trim();
|
|
1975
|
+
// }
|
|
1976
|
+
// return result;
|
|
1977
|
+
// }, {});
|
|
1978
|
+
// }
|
|
1979
|
+
static getOdataQueryString(obj, defaultOrder) {
|
|
1980
|
+
let queryString = "";
|
|
1981
|
+
let skip = (obj && obj["$skip"]) ?? "0";
|
|
1982
|
+
let top = (obj && obj["$top"]) ?? Constants.pagesize.toString();
|
|
1983
|
+
queryString = `$skip=${skip}&$top=${top}&$count=true`;
|
|
1984
|
+
if (obj) {
|
|
1985
|
+
if (obj["$filter"] && obj["$filter"] !== null && obj["$filter"] !== "") {
|
|
1986
|
+
queryString = queryString + `&$filter=${encodeURIComponent(obj["$filter"])}`;
|
|
1987
|
+
}
|
|
1988
|
+
if (obj["$orderby"] && obj["$orderby"] !== null && obj["$orderby"] !== "") {
|
|
1989
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(obj["$orderby"])}`;
|
|
1990
|
+
} else if (defaultOrder) {
|
|
1991
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
|
|
1992
|
+
}
|
|
1993
|
+
} else {
|
|
1994
|
+
if (defaultOrder) {
|
|
1995
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
return queryString;
|
|
1999
|
+
}
|
|
2000
|
+
setTop(top) {
|
|
2001
|
+
this.top = top;
|
|
2002
|
+
return this;
|
|
2003
|
+
}
|
|
2004
|
+
setSkip(skip) {
|
|
2005
|
+
this.skip = skip;
|
|
2006
|
+
return this;
|
|
2007
|
+
}
|
|
2008
|
+
setKeyword(keyword) {
|
|
2009
|
+
this.keyword = keyword;
|
|
2010
|
+
return this;
|
|
2011
|
+
}
|
|
2012
|
+
setFilter(filterBy) {
|
|
2013
|
+
this.filterBy = filterBy;
|
|
2014
|
+
return this;
|
|
2015
|
+
}
|
|
2016
|
+
setOrderBy(orderBy) {
|
|
2017
|
+
this.orderBy = orderBy;
|
|
1947
2018
|
return this;
|
|
1948
2019
|
}
|
|
1949
2020
|
getPageNumber(pageSize) {
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2021
|
+
let pageNumber = 1;
|
|
2022
|
+
if (this.skip && this.top) {
|
|
2023
|
+
const skip = parseInt(this.skip);
|
|
2024
|
+
const top = parseInt(this.top);
|
|
2025
|
+
if (!isNaN(skip) && !isNaN(top)) {
|
|
2026
|
+
pageNumber = skip / pageSize + 1;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
return pageNumber;
|
|
2030
|
+
}
|
|
2031
|
+
getUrl() {
|
|
2032
|
+
let url = `${this.baseUrl}?$skip=${this.skip}&$top=${this.top}&$count=true`;
|
|
2033
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
2034
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
2035
|
+
}
|
|
2036
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
2037
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
1954
2038
|
}
|
|
1955
|
-
|
|
2039
|
+
console.log(url);
|
|
2040
|
+
return url;
|
|
1956
2041
|
}
|
|
1957
2042
|
getNewOrderByUrl(orderBy) {
|
|
1958
|
-
let url = `${this.baseUrl}?$skip
|
|
1959
|
-
if (this.filterBy) {
|
|
1960
|
-
url
|
|
2043
|
+
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
2044
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
2045
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
1961
2046
|
}
|
|
1962
|
-
url
|
|
2047
|
+
url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
|
|
1963
2048
|
return url;
|
|
1964
2049
|
}
|
|
1965
2050
|
getNewFilterUrl(filterBy) {
|
|
1966
|
-
let url = `${this.baseUrl}?$skip
|
|
1967
|
-
if (filterBy) {
|
|
1968
|
-
url
|
|
2051
|
+
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
2052
|
+
if (filterBy !== null && filterBy !== "") {
|
|
2053
|
+
url = url + `&$filter=${encodeURIComponent(filterBy)}`;
|
|
1969
2054
|
}
|
|
1970
|
-
if (this.orderBy) {
|
|
1971
|
-
url
|
|
2055
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
2056
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
1972
2057
|
}
|
|
1973
2058
|
return url;
|
|
1974
2059
|
}
|
|
1975
2060
|
getNewPageUrl(page) {
|
|
1976
|
-
|
|
2061
|
+
let skip = page * Constants.pagesize - Constants.pagesize;
|
|
1977
2062
|
let url = `${this.baseUrl}?$skip=${skip}&$top=${this.top}&$count=true`;
|
|
1978
|
-
if (this.filterBy) {
|
|
1979
|
-
url
|
|
2063
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
2064
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
1980
2065
|
}
|
|
1981
|
-
if (this.orderBy) {
|
|
1982
|
-
url
|
|
2066
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
2067
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
2068
|
+
}
|
|
2069
|
+
return url;
|
|
2070
|
+
}
|
|
2071
|
+
getNewPageSizeUrl(pageSize) {
|
|
2072
|
+
const currentPage = this.getPageNumber(parseInt(this.top || Constants.pagesize.toString()));
|
|
2073
|
+
const skip = (currentPage - 1) * pageSize;
|
|
2074
|
+
let url = `${this.baseUrl}?$skip=${skip}&$top=${pageSize}&$count=true`;
|
|
2075
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
2076
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
2077
|
+
}
|
|
2078
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
2079
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
1983
2080
|
}
|
|
1984
2081
|
return url;
|
|
1985
2082
|
}
|
|
@@ -2535,7 +2632,7 @@ var DataList = (props) => {
|
|
|
2535
2632
|
var DataList_default = DataList;
|
|
2536
2633
|
|
|
2537
2634
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2538
|
-
var
|
|
2635
|
+
var import_react55 = __toESM(require("react"));
|
|
2539
2636
|
|
|
2540
2637
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2541
2638
|
var import_react37 = __toESM(require("react"));
|
|
@@ -2561,17 +2658,17 @@ var TextNode = (props) => {
|
|
|
2561
2658
|
}
|
|
2562
2659
|
return styleObject;
|
|
2563
2660
|
}
|
|
2564
|
-
function
|
|
2661
|
+
function toCamelCase2(str) {
|
|
2565
2662
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2566
2663
|
}
|
|
2567
|
-
function
|
|
2664
|
+
function convertKeysToCamelCase2(obj) {
|
|
2568
2665
|
if (Array.isArray(obj)) {
|
|
2569
|
-
return obj.map(
|
|
2666
|
+
return obj.map(convertKeysToCamelCase2);
|
|
2570
2667
|
} else if (obj !== null && typeof obj === "object") {
|
|
2571
2668
|
return Object.fromEntries(
|
|
2572
2669
|
Object.entries(obj).filter(([_, value]) => value !== "").map(([key, value]) => [
|
|
2573
|
-
|
|
2574
|
-
|
|
2670
|
+
toCamelCase2(key),
|
|
2671
|
+
convertKeysToCamelCase2(value)
|
|
2575
2672
|
])
|
|
2576
2673
|
);
|
|
2577
2674
|
}
|
|
@@ -2591,7 +2688,7 @@ var TextNode = (props) => {
|
|
|
2591
2688
|
if (format === 1024) classes.push("capitalize");
|
|
2592
2689
|
return classes.join(" ");
|
|
2593
2690
|
}
|
|
2594
|
-
const styles =
|
|
2691
|
+
const styles = convertKeysToCamelCase2(cssStringToJson(props.node.style));
|
|
2595
2692
|
function replacePlaceholders(template, dataItem) {
|
|
2596
2693
|
return template.replace(/{(\w+)}/g, (_, key) => {
|
|
2597
2694
|
return key in dataItem ? dataItem[key] : `{${key}}`;
|
|
@@ -2712,13 +2809,13 @@ var DatafieldNode = (props) => {
|
|
|
2712
2809
|
}
|
|
2713
2810
|
return styleObject;
|
|
2714
2811
|
}
|
|
2715
|
-
function
|
|
2812
|
+
function toCamelCase2(str) {
|
|
2716
2813
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2717
2814
|
}
|
|
2718
|
-
function
|
|
2815
|
+
function convertKeysToCamelCase2(obj) {
|
|
2719
2816
|
if (!obj || typeof obj !== "object") return obj;
|
|
2720
2817
|
return Object.fromEntries(
|
|
2721
|
-
Object.entries(obj).map(([key, value2]) => [
|
|
2818
|
+
Object.entries(obj).map(([key, value2]) => [toCamelCase2(key), value2])
|
|
2722
2819
|
);
|
|
2723
2820
|
}
|
|
2724
2821
|
const Formats = [
|
|
@@ -2735,7 +2832,7 @@ var DatafieldNode = (props) => {
|
|
|
2735
2832
|
"italic underline",
|
|
2736
2833
|
"italic underline font-medium"
|
|
2737
2834
|
];
|
|
2738
|
-
const styles =
|
|
2835
|
+
const styles = convertKeysToCamelCase2(cssStringToJson(props.node.style));
|
|
2739
2836
|
const fieldName = props.node.fieldName;
|
|
2740
2837
|
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
2741
2838
|
console.log(fieldName, value, "haha");
|
|
@@ -2944,8 +3041,61 @@ var QuoteNode = (props) => {
|
|
|
2944
3041
|
var QuoteNode_default = QuoteNode;
|
|
2945
3042
|
|
|
2946
3043
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
2947
|
-
var
|
|
3044
|
+
var import_react43 = __toESM(require("react"));
|
|
3045
|
+
|
|
3046
|
+
// src/components/CopyButton.tsx
|
|
3047
|
+
var import_react42 = require("react");
|
|
2948
3048
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3049
|
+
function CopyButton({ text }) {
|
|
3050
|
+
const [copied, setCopied] = (0, import_react42.useState)(false);
|
|
3051
|
+
const timeoutRef = (0, import_react42.useRef)(null);
|
|
3052
|
+
(0, import_react42.useEffect)(() => {
|
|
3053
|
+
return () => {
|
|
3054
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3055
|
+
};
|
|
3056
|
+
}, []);
|
|
3057
|
+
const handleCopy = async () => {
|
|
3058
|
+
try {
|
|
3059
|
+
await navigator.clipboard.writeText(text);
|
|
3060
|
+
setCopied(true);
|
|
3061
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3062
|
+
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
3063
|
+
} catch (err) {
|
|
3064
|
+
console.error("Failed to copy: ", err);
|
|
3065
|
+
}
|
|
3066
|
+
};
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3068
|
+
"button",
|
|
3069
|
+
{
|
|
3070
|
+
onClick: handleCopy,
|
|
3071
|
+
className: "flex gap-1 items-center hover:text-white transition",
|
|
3072
|
+
children: [
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3074
|
+
"svg",
|
|
3075
|
+
{
|
|
3076
|
+
width: "16",
|
|
3077
|
+
height: "16",
|
|
3078
|
+
viewBox: "0 0 24 24",
|
|
3079
|
+
className: "w-4 h-4",
|
|
3080
|
+
fill: "currentColor",
|
|
3081
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3082
|
+
"path",
|
|
3083
|
+
{
|
|
3084
|
+
fillRule: "evenodd",
|
|
3085
|
+
clipRule: "evenodd",
|
|
3086
|
+
d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
|
|
3087
|
+
}
|
|
3088
|
+
)
|
|
3089
|
+
}
|
|
3090
|
+
),
|
|
3091
|
+
copied ? "Copied!" : "Copy code"
|
|
3092
|
+
]
|
|
3093
|
+
}
|
|
3094
|
+
);
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3098
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2949
3099
|
var CodeNode = (props) => {
|
|
2950
3100
|
const NodeTypes2 = {
|
|
2951
3101
|
["text"]: TextNode_default,
|
|
@@ -2958,30 +3108,36 @@ var CodeNode = (props) => {
|
|
|
2958
3108
|
if (node.type === "link") return node.text || node.url || "";
|
|
2959
3109
|
return "";
|
|
2960
3110
|
}).join("") ?? "";
|
|
2961
|
-
return /* @__PURE__ */ (0,
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "code-block", children: [
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center relative text-gray-200 bg-gray-800 px-4 py-2.5 text-xs font-sans justify-between rounded-t-md", children: [
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Code Snippet" }),
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CopyButton, { text: textContent })
|
|
3115
|
+
] }),
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("code", { className: "block bg-gray-900 text-gray-100 p-4 rounded-b-md text-sm whitespace-pre-wrap", children: props.node.children && props.node.children.map((node, index) => {
|
|
3117
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3119
|
+
}) })
|
|
3120
|
+
] });
|
|
2965
3121
|
};
|
|
2966
3122
|
var CodeNode_default = CodeNode;
|
|
2967
3123
|
|
|
2968
3124
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
2969
|
-
var
|
|
3125
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2970
3126
|
var HorizontalRuleNode = (props) => {
|
|
2971
|
-
return /* @__PURE__ */ (0,
|
|
3127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("hr", {});
|
|
2972
3128
|
};
|
|
2973
3129
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
2974
3130
|
|
|
2975
3131
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
2976
|
-
var
|
|
3132
|
+
var import_react49 = __toESM(require("react"));
|
|
2977
3133
|
|
|
2978
3134
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
3135
|
+
var import_react44 = __toESM(require("react"));
|
|
3136
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2981
3137
|
var ImageNode = (props) => {
|
|
2982
3138
|
const { node, apiBaseUrl = "" } = props;
|
|
2983
3139
|
let imageUrl = node.imageUrl.startsWith("http") ? node.imageUrl : `${apiBaseUrl}/digitalassets/storefront/${node.imageUrl}`;
|
|
2984
|
-
return /* @__PURE__ */ (0,
|
|
3140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react44.default.Fragment, { children: node.width ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { width: node.width }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2985
3141
|
"img",
|
|
2986
3142
|
{
|
|
2987
3143
|
loading: "lazy",
|
|
@@ -2991,7 +3147,7 @@ var ImageNode = (props) => {
|
|
|
2991
3147
|
height: node.intrinsicHeight,
|
|
2992
3148
|
alt: node.title
|
|
2993
3149
|
}
|
|
2994
|
-
) }) : /* @__PURE__ */ (0,
|
|
3150
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2995
3151
|
"img",
|
|
2996
3152
|
{
|
|
2997
3153
|
loading: "lazy",
|
|
@@ -3006,8 +3162,8 @@ var ImageNode = (props) => {
|
|
|
3006
3162
|
var ImageNode_default = ImageNode;
|
|
3007
3163
|
|
|
3008
3164
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3009
|
-
var
|
|
3010
|
-
var
|
|
3165
|
+
var import_react45 = require("react");
|
|
3166
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3011
3167
|
var WidgetNode = (props) => {
|
|
3012
3168
|
const getWidgetParameters = () => {
|
|
3013
3169
|
const widgetInputParameters = { ...props.routeParameters ?? {} };
|
|
@@ -3062,12 +3218,12 @@ var WidgetNode = (props) => {
|
|
|
3062
3218
|
const SelectedWidget = props.widgetRegistry?.[props.node.widgetCode];
|
|
3063
3219
|
if (!SelectedWidget) {
|
|
3064
3220
|
console.warn("Widget not found:", props.node.widgetCode);
|
|
3065
|
-
return /* @__PURE__ */ (0,
|
|
3221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
3066
3222
|
"Widget not found: ",
|
|
3067
3223
|
props.node.widgetCode
|
|
3068
3224
|
] });
|
|
3069
3225
|
}
|
|
3070
|
-
return /* @__PURE__ */ (0,
|
|
3226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react45.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "container mt-2", children: "..." }), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3071
3227
|
SelectedWidget,
|
|
3072
3228
|
{
|
|
3073
3229
|
params: getWidgetParameters(),
|
|
@@ -3082,42 +3238,42 @@ var WidgetNode = (props) => {
|
|
|
3082
3238
|
var WidgetNode_default = WidgetNode;
|
|
3083
3239
|
|
|
3084
3240
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3085
|
-
var
|
|
3241
|
+
var import_react47 = __toESM(require("react"));
|
|
3086
3242
|
|
|
3087
3243
|
// src/components/IFrameLoaderView.tsx
|
|
3088
|
-
var
|
|
3089
|
-
var
|
|
3244
|
+
var import_react46 = __toESM(require("react"));
|
|
3245
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3090
3246
|
var IFrameLoaderView = (props) => {
|
|
3091
|
-
return /* @__PURE__ */ (0,
|
|
3092
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
3093
|
-
/* @__PURE__ */ (0,
|
|
3094
|
-
/* @__PURE__ */ (0,
|
|
3095
|
-
/* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react46.default.Fragment, { children: [
|
|
3248
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
3250
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ml-2", children: [
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
3253
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
3098
3254
|
] })
|
|
3099
3255
|
] }),
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3101
|
-
/* @__PURE__ */ (0,
|
|
3102
|
-
/* @__PURE__ */ (0,
|
|
3103
|
-
/* @__PURE__ */ (0,
|
|
3104
|
-
/* @__PURE__ */ (0,
|
|
3105
|
-
/* @__PURE__ */ (0,
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3256
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
3257
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "animate-pulse", children: [
|
|
3258
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3260
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3261
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3107
3263
|
] }),
|
|
3108
|
-
/* @__PURE__ */ (0,
|
|
3109
|
-
/* @__PURE__ */ (0,
|
|
3110
|
-
/* @__PURE__ */ (0,
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "animate-pulse", children: [
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3268
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3269
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3114
3270
|
] }),
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
/* @__PURE__ */ (0,
|
|
3117
|
-
/* @__PURE__ */ (0,
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3120
|
-
/* @__PURE__ */ (0,
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "animate-pulse", children: [
|
|
3272
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3273
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3274
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3275
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3276
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3121
3277
|
] })
|
|
3122
3278
|
] })
|
|
3123
3279
|
] }) }),
|
|
@@ -3127,12 +3283,12 @@ var IFrameLoaderView = (props) => {
|
|
|
3127
3283
|
var IFrameLoaderView_default = IFrameLoaderView;
|
|
3128
3284
|
|
|
3129
3285
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3130
|
-
var
|
|
3286
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3131
3287
|
var IframeClient = ({ src }) => {
|
|
3132
|
-
const iframeRef = (0,
|
|
3133
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
3134
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3135
|
-
(0,
|
|
3288
|
+
const iframeRef = (0, import_react47.useRef)(null);
|
|
3289
|
+
const [iframeHeight, setIframeHeight] = (0, import_react47.useState)("100%");
|
|
3290
|
+
const [isDataFound, setIsDataFound] = (0, import_react47.useState)(null);
|
|
3291
|
+
(0, import_react47.useEffect)(() => {
|
|
3136
3292
|
const handleReceiveMessage = (event) => {
|
|
3137
3293
|
const eventName = event?.data?.eventName;
|
|
3138
3294
|
const payload = event?.data?.payload;
|
|
@@ -3147,7 +3303,7 @@ var IframeClient = ({ src }) => {
|
|
|
3147
3303
|
window.addEventListener("message", handleReceiveMessage);
|
|
3148
3304
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
3149
3305
|
}, []);
|
|
3150
|
-
(0,
|
|
3306
|
+
(0, import_react47.useEffect)(() => {
|
|
3151
3307
|
const handleResize = () => {
|
|
3152
3308
|
if (iframeRef.current) {
|
|
3153
3309
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -3159,7 +3315,7 @@ var IframeClient = ({ src }) => {
|
|
|
3159
3315
|
const handleIframeLoad = () => {
|
|
3160
3316
|
setIsDataFound(true);
|
|
3161
3317
|
};
|
|
3162
|
-
return /* @__PURE__ */ (0,
|
|
3318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3163
3319
|
"iframe",
|
|
3164
3320
|
{
|
|
3165
3321
|
ref: iframeRef,
|
|
@@ -3173,7 +3329,7 @@ var IframeClient = ({ src }) => {
|
|
|
3173
3329
|
var IframeClient_default = IframeClient;
|
|
3174
3330
|
|
|
3175
3331
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3176
|
-
var
|
|
3332
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3177
3333
|
var EmbedNode = (props) => {
|
|
3178
3334
|
let src;
|
|
3179
3335
|
if (props.node.provider == "youtube") {
|
|
@@ -3183,13 +3339,13 @@ var EmbedNode = (props) => {
|
|
|
3183
3339
|
} else {
|
|
3184
3340
|
src = props.node.embedSrc;
|
|
3185
3341
|
}
|
|
3186
|
-
return /* @__PURE__ */ (0,
|
|
3342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(IframeClient_default, { src }) });
|
|
3187
3343
|
};
|
|
3188
3344
|
var EmbedNode_default = EmbedNode;
|
|
3189
3345
|
|
|
3190
3346
|
// src/components/pageRenderingEngine/nodes/VideoNode.tsx
|
|
3191
|
-
var
|
|
3192
|
-
var
|
|
3347
|
+
var import_react48 = __toESM(require("react"));
|
|
3348
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3193
3349
|
var VideoNode = (props) => {
|
|
3194
3350
|
let src;
|
|
3195
3351
|
if (props.node.provider == "youtube") {
|
|
@@ -3197,12 +3353,12 @@ var VideoNode = (props) => {
|
|
|
3197
3353
|
} else if (props.node.provider == "bunny") {
|
|
3198
3354
|
src = `https://iframe.mediadelivery.net/embed/${props.node.videoId}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3199
3355
|
}
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react48.default.Fragment, { children: src && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("iframe", { className: "w-full aspect-video rounded", src, loading: "lazy", allow: "accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;", allowFullScreen: true }) });
|
|
3201
3357
|
};
|
|
3202
3358
|
var VideoNode_default = VideoNode;
|
|
3203
3359
|
|
|
3204
3360
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
3205
|
-
var
|
|
3361
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3206
3362
|
var LayoutItemNode = (props) => {
|
|
3207
3363
|
const NodeTypes2 = {
|
|
3208
3364
|
["paragraph"]: ParagraphNode_default,
|
|
@@ -3263,11 +3419,11 @@ var LayoutItemNode = (props) => {
|
|
|
3263
3419
|
} else {
|
|
3264
3420
|
updatedLayout = removeParagraphsAtStartAndEnd(props.node);
|
|
3265
3421
|
}
|
|
3266
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "layout-item " + cssClasses, style: { ...styles }, children: updatedLayout.children.map((node, index) => {
|
|
3267
3423
|
{
|
|
3268
3424
|
}
|
|
3269
3425
|
const SelectedNode = NodeTypes2[node.type];
|
|
3270
|
-
return /* @__PURE__ */ (0,
|
|
3426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react49.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3271
3427
|
SelectedNode,
|
|
3272
3428
|
{
|
|
3273
3429
|
node,
|
|
@@ -3297,7 +3453,7 @@ var AssetUtility = class {
|
|
|
3297
3453
|
var AssetUtility_default = AssetUtility;
|
|
3298
3454
|
|
|
3299
3455
|
// src/components/pageRenderingEngine/nodes/LayoutContainerNode.tsx
|
|
3300
|
-
var
|
|
3456
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3301
3457
|
var LayoutContainerNode = (props) => {
|
|
3302
3458
|
const VERTICAL_ALIGNMENT_CLASSES = {
|
|
3303
3459
|
start: "items-start",
|
|
@@ -3367,7 +3523,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3367
3523
|
if (backgroundLayers.length) {
|
|
3368
3524
|
styles.background = backgroundLayers.join(", ");
|
|
3369
3525
|
}
|
|
3370
|
-
const renderChildren = () => props.node.children?.map((node, index) => /* @__PURE__ */ (0,
|
|
3526
|
+
const renderChildren = () => props.node.children?.map((node, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3371
3527
|
LayoutItemNode_default,
|
|
3372
3528
|
{
|
|
3373
3529
|
node,
|
|
@@ -3381,8 +3537,8 @@ var LayoutContainerNode = (props) => {
|
|
|
3381
3537
|
},
|
|
3382
3538
|
index
|
|
3383
3539
|
));
|
|
3384
|
-
return /* @__PURE__ */ (0,
|
|
3385
|
-
sectionWidth === "mixed" && /* @__PURE__ */ (0,
|
|
3540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
3541
|
+
sectionWidth === "mixed" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: cssClasses, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "container", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3386
3542
|
"div",
|
|
3387
3543
|
{
|
|
3388
3544
|
className: `grid gap-y-4 lg:gap-y-0 ${gridCssClasses} ${addPadding ? "py-8 lg:py-6" : ""}`,
|
|
@@ -3390,7 +3546,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3390
3546
|
children: renderChildren()
|
|
3391
3547
|
}
|
|
3392
3548
|
) }) }),
|
|
3393
|
-
sectionWidth === "full" && /* @__PURE__ */ (0,
|
|
3549
|
+
sectionWidth === "full" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3394
3550
|
"div",
|
|
3395
3551
|
{
|
|
3396
3552
|
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "p-8 lg:p-0" : ""}`,
|
|
@@ -3398,7 +3554,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3398
3554
|
children: renderChildren()
|
|
3399
3555
|
}
|
|
3400
3556
|
),
|
|
3401
|
-
sectionWidth === "fixed" && /* @__PURE__ */ (0,
|
|
3557
|
+
sectionWidth === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "container", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3402
3558
|
"div",
|
|
3403
3559
|
{
|
|
3404
3560
|
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "px-8 py-6 lg:px-6 lg:py-6" : ""}`,
|
|
@@ -3411,12 +3567,12 @@ var LayoutContainerNode = (props) => {
|
|
|
3411
3567
|
var LayoutContainerNode_default = LayoutContainerNode;
|
|
3412
3568
|
|
|
3413
3569
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3414
|
-
var
|
|
3570
|
+
var import_react50 = __toESM(require("react"));
|
|
3415
3571
|
|
|
3416
3572
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3417
|
-
var
|
|
3573
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3418
3574
|
var InputControlNode = (props) => {
|
|
3419
|
-
return /* @__PURE__ */ (0,
|
|
3575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3420
3576
|
InputControl_default,
|
|
3421
3577
|
{
|
|
3422
3578
|
name: props.node.name,
|
|
@@ -3445,19 +3601,19 @@ var InputControlNode = (props) => {
|
|
|
3445
3601
|
var InputControlNode_default = InputControlNode;
|
|
3446
3602
|
|
|
3447
3603
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3448
|
-
var
|
|
3604
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3449
3605
|
var FormContainerNode = (props) => {
|
|
3450
3606
|
const NodeTypes2 = {
|
|
3451
3607
|
["input-control"]: InputControlNode_default
|
|
3452
3608
|
};
|
|
3453
3609
|
const { node } = props;
|
|
3454
|
-
const formRef = (0,
|
|
3610
|
+
const formRef = (0, import_react50.useRef)(null);
|
|
3455
3611
|
const initialState = {
|
|
3456
3612
|
inputValues: {},
|
|
3457
3613
|
lastPropertyChanged: ""
|
|
3458
3614
|
};
|
|
3459
|
-
const [formState, dispatch] = (0,
|
|
3460
|
-
const handleInputChange = (0,
|
|
3615
|
+
const [formState, dispatch] = (0, import_react50.useReducer)(FormReducer_default, initialState);
|
|
3616
|
+
const handleInputChange = (0, import_react50.useCallback)((updatedValues) => {
|
|
3461
3617
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
3462
3618
|
}, [dispatch]);
|
|
3463
3619
|
const onValidate = async () => {
|
|
@@ -3468,7 +3624,7 @@ var FormContainerNode = (props) => {
|
|
|
3468
3624
|
return true;
|
|
3469
3625
|
}
|
|
3470
3626
|
};
|
|
3471
|
-
(0,
|
|
3627
|
+
(0, import_react50.useEffect)(() => {
|
|
3472
3628
|
const fetchInitialData = async () => {
|
|
3473
3629
|
if (!props.fetchData || !node.dataFetchApi) return;
|
|
3474
3630
|
const response = await props.fetchData(
|
|
@@ -3485,12 +3641,12 @@ var FormContainerNode = (props) => {
|
|
|
3485
3641
|
};
|
|
3486
3642
|
fetchInitialData();
|
|
3487
3643
|
}, [props.fetchData, node.dataFetchApi, props.routeParameters]);
|
|
3488
|
-
return /* @__PURE__ */ (0,
|
|
3644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
3489
3645
|
node.children && node.children.map((node2, index) => {
|
|
3490
3646
|
{
|
|
3491
3647
|
}
|
|
3492
3648
|
const SelectedNode = NodeTypes2[node2.type];
|
|
3493
|
-
return /* @__PURE__ */ (0,
|
|
3649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react50.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3494
3650
|
InputControlNode_default,
|
|
3495
3651
|
{
|
|
3496
3652
|
value: formState.inputValues[node2.name],
|
|
@@ -3499,74 +3655,823 @@ var FormContainerNode = (props) => {
|
|
|
3499
3655
|
}
|
|
3500
3656
|
) }, index);
|
|
3501
3657
|
}),
|
|
3502
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
3658
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
3503
3659
|
] });
|
|
3504
3660
|
};
|
|
3505
3661
|
var FormContainerNode_default = FormContainerNode;
|
|
3506
3662
|
|
|
3507
3663
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3508
|
-
var
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
var
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3664
|
+
var import_react54 = __toESM(require("react"));
|
|
3665
|
+
|
|
3666
|
+
// src/components/utilities/AnimationUtility.tsx
|
|
3667
|
+
var AnimationUtility = class {
|
|
3668
|
+
static generateAnimationCSS(config, guid) {
|
|
3669
|
+
const {
|
|
3670
|
+
duration = 700,
|
|
3671
|
+
delay = 0,
|
|
3672
|
+
easing = "ease-out",
|
|
3673
|
+
distance = 30,
|
|
3674
|
+
scaleStart = 1,
|
|
3675
|
+
scaleEnd = 1.2,
|
|
3676
|
+
repeat = 1,
|
|
3677
|
+
intensity = 20,
|
|
3678
|
+
speedPerChar = 100,
|
|
3679
|
+
cursor = true,
|
|
3680
|
+
mode = "enter",
|
|
3681
|
+
direction = "left"
|
|
3682
|
+
// Default direction
|
|
3683
|
+
} = config;
|
|
3684
|
+
let base = "", visible = "", keyframes = "";
|
|
3685
|
+
switch (config.animation) {
|
|
3686
|
+
case "Fade":
|
|
3687
|
+
base = `opacity:0; transition:opacity ${duration}ms ${easing} ${delay}ms;`;
|
|
3688
|
+
visible = `opacity:1;`;
|
|
3689
|
+
break;
|
|
3690
|
+
case "FadeInUp":
|
|
3691
|
+
base = `opacity:0; transform:translateY(${distance}px); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3692
|
+
visible = `opacity:1; transform:translateY(0);`;
|
|
3693
|
+
break;
|
|
3694
|
+
case "Slide":
|
|
3695
|
+
const slideTransform = this.getSlideTransform(direction, distance);
|
|
3696
|
+
base = `opacity:0; transform:${slideTransform.start}; transition:all ${duration}ms ${easing} ${delay}ms; will-change: transform, opacity;`;
|
|
3697
|
+
visible = `opacity:1; transform:${slideTransform.end}; will-change: unset;`;
|
|
3698
|
+
break;
|
|
3699
|
+
case "ZoomIn":
|
|
3700
|
+
if (mode === "enter") {
|
|
3701
|
+
base = `opacity:0; transform:scale(${scaleStart}); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3702
|
+
visible = `opacity:1; transform:scale(${scaleEnd});`;
|
|
3703
|
+
} else {
|
|
3704
|
+
base = `transform:scale(${scaleStart}); transition:transform ${duration / 1e3}s ${easing} ${delay / 1e3}s;`;
|
|
3705
|
+
visible = `transform:scale(${scaleEnd});`;
|
|
3706
|
+
}
|
|
3707
|
+
break;
|
|
3708
|
+
case "Bounce":
|
|
3709
|
+
keyframes = `
|
|
3710
|
+
@keyframes bounce {
|
|
3711
|
+
0%,20%,50%,80%,100% { transform: translateY(0); }
|
|
3712
|
+
40% { transform: translateY(-${intensity}px); }
|
|
3713
|
+
60% { transform: translateY(-${intensity / 2}px); }
|
|
3714
|
+
}
|
|
3715
|
+
`;
|
|
3716
|
+
if (mode === "enter") {
|
|
3717
|
+
base = `opacity:0;`;
|
|
3718
|
+
visible = `opacity:1; animation:bounce ${duration}ms ${easing} ${delay}ms ${repeat};`;
|
|
3719
|
+
} else {
|
|
3720
|
+
base = ``;
|
|
3721
|
+
visible = `animation:bounce ${duration / 1e3}s ${easing} ${delay / 1e3}s ${repeat};`;
|
|
3722
|
+
}
|
|
3723
|
+
break;
|
|
3724
|
+
case "Typewriter":
|
|
3725
|
+
keyframes = `
|
|
3726
|
+
@keyframes typewriter { from { width: 0 } to { width: 100% } }
|
|
3727
|
+
@keyframes blink { 50% { border-color: transparent } }
|
|
3728
|
+
`;
|
|
3729
|
+
base = `
|
|
3730
|
+
overflow:hidden;
|
|
3731
|
+
border-right:${cursor ? "2px solid black" : "none"};
|
|
3732
|
+
white-space:nowrap;
|
|
3733
|
+
width:0;
|
|
3734
|
+
margin:0 auto;
|
|
3735
|
+
`;
|
|
3736
|
+
visible = `
|
|
3737
|
+
animation:typewriter ${speedPerChar * 30}ms steps(30,end) ${delay}ms forwards
|
|
3738
|
+
${cursor ? ", blink .75s step-end infinite" : ""};
|
|
3739
|
+
`;
|
|
3740
|
+
break;
|
|
3741
|
+
}
|
|
3742
|
+
if (mode === "hover") {
|
|
3743
|
+
return `
|
|
3744
|
+
${keyframes}
|
|
3745
|
+
${guid} { ${base} }
|
|
3746
|
+
${guid}:hover { ${visible} }
|
|
3747
|
+
`;
|
|
3748
|
+
} else {
|
|
3749
|
+
return `
|
|
3750
|
+
${keyframes}
|
|
3751
|
+
${guid} { ${base} }
|
|
3752
|
+
${guid}.visible { ${visible} }
|
|
3753
|
+
`;
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
// Helper method to generate slide transforms based on direction
|
|
3757
|
+
static getSlideTransform(direction, distance) {
|
|
3758
|
+
switch (direction) {
|
|
3759
|
+
case "left":
|
|
3760
|
+
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
3761
|
+
case "right":
|
|
3762
|
+
return { start: `translateX(-${distance}px)`, end: `translateX(0)` };
|
|
3763
|
+
case "up":
|
|
3764
|
+
return { start: `translateY(${distance}px)`, end: `translateY(0)` };
|
|
3765
|
+
case "down":
|
|
3766
|
+
return { start: `translateY(-${distance}px)`, end: `translateY(0)` };
|
|
3767
|
+
default:
|
|
3768
|
+
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3771
|
+
};
|
|
3772
|
+
var AnimationUtility_default = AnimationUtility;
|
|
3773
|
+
|
|
3774
|
+
// src/components/Pagination.tsx
|
|
3775
|
+
var import_react51 = require("react");
|
|
3776
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3777
|
+
var Pagination = (props) => {
|
|
3778
|
+
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
3779
|
+
const builder = (0, import_react51.useMemo)(() => {
|
|
3780
|
+
const b = new OdataBuilder(path);
|
|
3781
|
+
if (query) b.setQuery(query);
|
|
3782
|
+
return b;
|
|
3783
|
+
}, [path, query]);
|
|
3784
|
+
const activePageNumber = builder.getPageNumber(Constants.pagesize);
|
|
3785
|
+
const totalItems = dataset?.count || 0;
|
|
3786
|
+
const itemsPerPage = parseInt(builder.top || Constants.pagesize.toString());
|
|
3787
|
+
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
3788
|
+
const startItem = totalItems > 0 ? (activePageNumber - 1) * itemsPerPage + 1 : 0;
|
|
3789
|
+
const endItem = Math.min(activePageNumber * itemsPerPage, totalItems);
|
|
3790
|
+
const getPaginationRange = () => {
|
|
3791
|
+
const delta = 1;
|
|
3792
|
+
const range = [];
|
|
3793
|
+
if (totalPages <= 7) {
|
|
3794
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
3795
|
+
}
|
|
3796
|
+
range.push(1);
|
|
3797
|
+
let start = Math.max(2, activePageNumber - delta);
|
|
3798
|
+
let end = Math.min(totalPages - 1, activePageNumber + delta);
|
|
3799
|
+
if (activePageNumber - delta <= 2) {
|
|
3800
|
+
end = Math.min(totalPages - 1, 4);
|
|
3801
|
+
}
|
|
3802
|
+
if (activePageNumber + delta >= totalPages - 1) {
|
|
3803
|
+
start = Math.max(2, totalPages - 4);
|
|
3804
|
+
}
|
|
3805
|
+
if (start > 2) {
|
|
3806
|
+
range.push("...");
|
|
3807
|
+
}
|
|
3808
|
+
for (let i = start; i <= end; i++) {
|
|
3809
|
+
range.push(i);
|
|
3810
|
+
}
|
|
3811
|
+
if (end < totalPages - 1) {
|
|
3812
|
+
range.push("...");
|
|
3813
|
+
}
|
|
3814
|
+
if (totalPages > 1) {
|
|
3815
|
+
range.push(totalPages);
|
|
3816
|
+
}
|
|
3817
|
+
return range;
|
|
3529
3818
|
};
|
|
3530
|
-
|
|
3531
|
-
|
|
3819
|
+
const paginationRange = getPaginationRange();
|
|
3820
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3821
|
+
Hyperlink,
|
|
3822
|
+
{
|
|
3823
|
+
linkType: "Link" /* Link */,
|
|
3824
|
+
className: `
|
|
3825
|
+
min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2.5 md:px-3
|
|
3826
|
+
border text-sm font-medium transition-colors duration-150
|
|
3827
|
+
${activePageNumber === page ? "bg-primary-base font-semibold" : ""}
|
|
3828
|
+
`,
|
|
3829
|
+
href: builder.getNewPageUrl(page),
|
|
3830
|
+
children
|
|
3831
|
+
}
|
|
3832
|
+
);
|
|
3833
|
+
const NavigationButton = ({ page, disabled, children }) => {
|
|
3834
|
+
if (disabled) {
|
|
3835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
3836
|
+
}
|
|
3837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3838
|
+
Hyperlink,
|
|
3839
|
+
{
|
|
3840
|
+
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
|
|
3841
|
+
href: builder.getNewPageUrl(page),
|
|
3842
|
+
children
|
|
3843
|
+
}
|
|
3844
|
+
);
|
|
3845
|
+
};
|
|
3846
|
+
if (totalPages <= 1 && totalItems === 0) return null;
|
|
3847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
3848
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
3849
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "text-sm", children: [
|
|
3850
|
+
"Showing ",
|
|
3851
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "font-semibold", children: [
|
|
3852
|
+
startItem,
|
|
3853
|
+
"-",
|
|
3854
|
+
endItem
|
|
3855
|
+
] }),
|
|
3856
|
+
" ",
|
|
3857
|
+
"out of ",
|
|
3858
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
3859
|
+
" results"
|
|
3860
|
+
] }),
|
|
3861
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3863
|
+
NavigationButton,
|
|
3864
|
+
{
|
|
3865
|
+
page: activePageNumber - 1,
|
|
3866
|
+
disabled: activePageNumber === 1,
|
|
3867
|
+
children: [
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
3869
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
3870
|
+
]
|
|
3871
|
+
}
|
|
3872
|
+
),
|
|
3873
|
+
paginationRange.map((item, index) => {
|
|
3874
|
+
if (item === "...") {
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3876
|
+
"span",
|
|
3877
|
+
{
|
|
3878
|
+
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
3879
|
+
children: "..."
|
|
3880
|
+
},
|
|
3881
|
+
`ellipsis-${index}`
|
|
3882
|
+
);
|
|
3883
|
+
}
|
|
3884
|
+
const page = item;
|
|
3885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(PageButton, { page, children: page }, page);
|
|
3886
|
+
}),
|
|
3887
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3888
|
+
NavigationButton,
|
|
3889
|
+
{
|
|
3890
|
+
page: activePageNumber + 1,
|
|
3891
|
+
disabled: activePageNumber === totalPages,
|
|
3892
|
+
children: [
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
3894
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
3895
|
+
]
|
|
3896
|
+
}
|
|
3897
|
+
)
|
|
3898
|
+
] }),
|
|
3899
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3902
|
+
"input",
|
|
3903
|
+
{
|
|
3904
|
+
type: "number",
|
|
3905
|
+
min: "1",
|
|
3906
|
+
max: totalPages,
|
|
3907
|
+
defaultValue: activePageNumber,
|
|
3908
|
+
className: "w-20 h-10 px-3 border rounded text-sm focus:outline-none focus:ring-2 focus:border-transparent",
|
|
3909
|
+
onKeyDown: (e) => {
|
|
3910
|
+
if (e.key === "Enter") {
|
|
3911
|
+
const input = e.target;
|
|
3912
|
+
const page = parseInt(input.value);
|
|
3913
|
+
if (page >= 1 && page <= totalPages && page !== activePageNumber) {
|
|
3914
|
+
window.location.href = builder.getNewPageUrl(page);
|
|
3915
|
+
}
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
) })
|
|
3920
|
+
] })
|
|
3921
|
+
] }),
|
|
3922
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
3923
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
3924
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3925
|
+
Hyperlink,
|
|
3926
|
+
{
|
|
3927
|
+
className: `
|
|
3928
|
+
px-3 py-1 text-sm rounded border transition-colors duration-150
|
|
3929
|
+
${itemsPerPage === size ? "bg-primary-base font-medium" : "bg-neutral-weak"}
|
|
3930
|
+
`,
|
|
3931
|
+
href: builder.getNewPageSizeUrl(size),
|
|
3932
|
+
children: size
|
|
3933
|
+
},
|
|
3934
|
+
size
|
|
3935
|
+
)) }),
|
|
3936
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "per page" })
|
|
3937
|
+
] }) })
|
|
3938
|
+
] });
|
|
3939
|
+
};
|
|
3940
|
+
var Pagination_default = Pagination;
|
|
3941
|
+
|
|
3942
|
+
// src/components/utilities/PathUtility.tsx
|
|
3943
|
+
var PathUtility = class {
|
|
3944
|
+
constructor() {
|
|
3532
3945
|
}
|
|
3533
|
-
|
|
3534
|
-
if (
|
|
3535
|
-
|
|
3536
|
-
return obj.map(convertKeysToCamelCase);
|
|
3946
|
+
normalizePath(path) {
|
|
3947
|
+
if (path == null) {
|
|
3948
|
+
return "/";
|
|
3537
3949
|
}
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3950
|
+
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
3951
|
+
return trimmedPath === "" ? "/" : "/" + trimmedPath + "/";
|
|
3952
|
+
}
|
|
3953
|
+
joinAndNormalizePaths(path1, path2) {
|
|
3954
|
+
path1 = path1.replace(/\/$/, "");
|
|
3955
|
+
path2 = path2.replace(/^\//, "");
|
|
3956
|
+
const joinedPath = `${path1}/${path2}`;
|
|
3957
|
+
const normalizedPath = joinedPath.replace(/\/{2,}/g, "/");
|
|
3958
|
+
return normalizedPath === "" ? "/" : "/" + normalizedPath;
|
|
3959
|
+
}
|
|
3960
|
+
removeLeadingAndTrailingSlashes(path) {
|
|
3961
|
+
if (path == null) {
|
|
3962
|
+
return "/";
|
|
3963
|
+
}
|
|
3964
|
+
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
3965
|
+
return trimmedPath;
|
|
3966
|
+
}
|
|
3967
|
+
removeTrailingSlash(path) {
|
|
3968
|
+
if (path == null) {
|
|
3969
|
+
return "/";
|
|
3970
|
+
}
|
|
3971
|
+
const trimmedPath = path.replace(/\/$/, "");
|
|
3972
|
+
return trimmedPath;
|
|
3973
|
+
}
|
|
3974
|
+
joinPaths(path1, path2) {
|
|
3975
|
+
if (!path1.endsWith("/") && !path2.startsWith("/")) {
|
|
3976
|
+
return `${path1}/${path2}`;
|
|
3977
|
+
} else if (path1.endsWith("/") && path2.startsWith("/")) {
|
|
3978
|
+
return `${path1}${path2.substr(1)}`;
|
|
3979
|
+
} else {
|
|
3980
|
+
return `${path1}${path2}`;
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3983
|
+
getFirstSegment(path) {
|
|
3984
|
+
if (!path || path === "/") {
|
|
3985
|
+
return "";
|
|
3986
|
+
}
|
|
3987
|
+
const segments = path.split("/").filter(Boolean);
|
|
3988
|
+
return segments.length > 0 ? segments[0] : "";
|
|
3989
|
+
}
|
|
3990
|
+
};
|
|
3991
|
+
var PathUtility_default = new PathUtility();
|
|
3992
|
+
|
|
3993
|
+
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
3994
|
+
var import_react52 = __toESM(require("react"));
|
|
3995
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3996
|
+
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
3997
|
+
const ref = (0, import_react52.useRef)(null);
|
|
3998
|
+
(0, import_react52.useEffect)(() => {
|
|
3999
|
+
if (!hasEnterAnimation || !ref.current) return;
|
|
4000
|
+
const observer = new IntersectionObserver(
|
|
4001
|
+
(entries) => {
|
|
4002
|
+
entries.forEach((entry) => {
|
|
4003
|
+
if (entry.isIntersecting) {
|
|
4004
|
+
entry.target.classList.add("visible");
|
|
4005
|
+
observer.unobserve(entry.target);
|
|
4006
|
+
}
|
|
4007
|
+
});
|
|
4008
|
+
},
|
|
4009
|
+
{ threshold: 0.1 }
|
|
4010
|
+
);
|
|
4011
|
+
observer.observe(ref.current);
|
|
4012
|
+
return () => observer.disconnect();
|
|
4013
|
+
}, [hasEnterAnimation]);
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
4015
|
+
//@ts-ignore
|
|
4016
|
+
import_react52.default.cloneElement(children, { ref }) });
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
// src/components/Slider.tsx
|
|
4020
|
+
var import_react53 = require("react");
|
|
4021
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4022
|
+
var Slider = ({
|
|
4023
|
+
children,
|
|
4024
|
+
slidesToShow = 4,
|
|
4025
|
+
infinite_scroll = false,
|
|
4026
|
+
autoplay = false,
|
|
4027
|
+
autoplay_speed = 3e3,
|
|
4028
|
+
show_arrows = false,
|
|
4029
|
+
show_dots = false,
|
|
4030
|
+
scaleOnHover = false,
|
|
4031
|
+
className = "",
|
|
4032
|
+
arrowClassName = "bg-black/50 hover:bg-black/80 text-white rounded-full w-10 h-10 flex items-center justify-center",
|
|
4033
|
+
dotActiveClassName = "bg-gray-300",
|
|
4034
|
+
dotInactiveClassName = "bg-gray-600",
|
|
4035
|
+
gap,
|
|
4036
|
+
pillStyle = "cumulative",
|
|
4037
|
+
progressPosition = "bottom"
|
|
4038
|
+
}) => {
|
|
4039
|
+
const [currentSlide, setCurrentSlide] = (0, import_react53.useState)(0);
|
|
4040
|
+
const [transition, setTransition] = (0, import_react53.useState)(true);
|
|
4041
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react53.useState)(
|
|
4042
|
+
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4043
|
+
);
|
|
4044
|
+
const [isPlaying, setIsPlaying] = (0, import_react53.useState)(autoplay);
|
|
4045
|
+
(0, import_react53.useEffect)(() => {
|
|
4046
|
+
if (typeof slidesToShow === "number") return;
|
|
4047
|
+
const handleResize = () => {
|
|
4048
|
+
if (window.innerWidth >= 1024) {
|
|
4049
|
+
setSlidesToShowState(slidesToShow.large);
|
|
4050
|
+
} else if (window.innerWidth >= 768) {
|
|
4051
|
+
setSlidesToShowState(slidesToShow.medium);
|
|
4052
|
+
} else {
|
|
4053
|
+
setSlidesToShowState(slidesToShow.small);
|
|
4054
|
+
}
|
|
4055
|
+
};
|
|
4056
|
+
handleResize();
|
|
4057
|
+
window.addEventListener("resize", handleResize);
|
|
4058
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
4059
|
+
}, [slidesToShow]);
|
|
4060
|
+
(0, import_react53.useEffect)(() => {
|
|
4061
|
+
if (!autoplay) return;
|
|
4062
|
+
const timer = setInterval(() => {
|
|
4063
|
+
if (isPlaying) {
|
|
4064
|
+
nextSlide();
|
|
4065
|
+
}
|
|
4066
|
+
}, autoplay_speed);
|
|
4067
|
+
return () => clearInterval(timer);
|
|
4068
|
+
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4069
|
+
const totalSlides = import_react53.Children.count(children);
|
|
4070
|
+
const maxSlide = totalSlides - slidesToShowState;
|
|
4071
|
+
const nextSlide = () => {
|
|
4072
|
+
if (currentSlide >= maxSlide) {
|
|
4073
|
+
if (infinite_scroll) {
|
|
4074
|
+
setTransition(true);
|
|
4075
|
+
setCurrentSlide(0);
|
|
4076
|
+
}
|
|
4077
|
+
} else {
|
|
4078
|
+
setTransition(true);
|
|
4079
|
+
setCurrentSlide(currentSlide + 1);
|
|
4080
|
+
}
|
|
4081
|
+
};
|
|
4082
|
+
const prevSlide = () => {
|
|
4083
|
+
if (currentSlide <= 0) {
|
|
4084
|
+
if (infinite_scroll) {
|
|
4085
|
+
setTransition(true);
|
|
4086
|
+
setCurrentSlide(maxSlide);
|
|
4087
|
+
}
|
|
4088
|
+
} else {
|
|
4089
|
+
setTransition(true);
|
|
4090
|
+
setCurrentSlide(currentSlide - 1);
|
|
4091
|
+
}
|
|
4092
|
+
};
|
|
4093
|
+
const goToSlide = (index) => {
|
|
4094
|
+
setTransition(true);
|
|
4095
|
+
setCurrentSlide(index);
|
|
4096
|
+
};
|
|
4097
|
+
const handlePillClick = (index) => {
|
|
4098
|
+
goToSlide(index);
|
|
4099
|
+
if (autoplay) {
|
|
4100
|
+
setIsPlaying(true);
|
|
4101
|
+
}
|
|
4102
|
+
};
|
|
4103
|
+
const handleMouseEnter = () => {
|
|
4104
|
+
if (autoplay) {
|
|
4105
|
+
setIsPlaying(false);
|
|
4106
|
+
}
|
|
4107
|
+
};
|
|
4108
|
+
const handleMouseLeave = () => {
|
|
4109
|
+
if (autoplay) {
|
|
4110
|
+
setIsPlaying(true);
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4114
|
+
const slides = import_react53.Children.map(children, (child, index) => {
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4116
|
+
"div",
|
|
4117
|
+
{
|
|
4118
|
+
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4119
|
+
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4120
|
+
children: (0, import_react53.cloneElement)(child, {
|
|
4121
|
+
className: `w-full`
|
|
4122
|
+
})
|
|
4123
|
+
},
|
|
4124
|
+
index
|
|
3544
4125
|
);
|
|
4126
|
+
});
|
|
4127
|
+
const getProgressPositionClass = () => {
|
|
4128
|
+
switch (progressPosition) {
|
|
4129
|
+
case "top":
|
|
4130
|
+
return "top-4";
|
|
4131
|
+
case "bottom-outside":
|
|
4132
|
+
return "bottom-4 translate-y-full mt-4";
|
|
4133
|
+
case "bottom":
|
|
4134
|
+
default:
|
|
4135
|
+
return "bottom-4";
|
|
4136
|
+
}
|
|
4137
|
+
};
|
|
4138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4139
|
+
"div",
|
|
4140
|
+
{
|
|
4141
|
+
className: `relative w-full overflow-hidden ${className}`,
|
|
4142
|
+
onMouseEnter: handleMouseEnter,
|
|
4143
|
+
onMouseLeave: handleMouseLeave,
|
|
4144
|
+
children: [
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4146
|
+
"div",
|
|
4147
|
+
{
|
|
4148
|
+
className: "flex h-full",
|
|
4149
|
+
style: {
|
|
4150
|
+
transition: transition ? "transform 0.5s ease" : "none",
|
|
4151
|
+
transform: `translateX(${translateX}%)`
|
|
4152
|
+
},
|
|
4153
|
+
children: slides
|
|
4154
|
+
}
|
|
4155
|
+
),
|
|
4156
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
4157
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4158
|
+
ArrowButton,
|
|
4159
|
+
{
|
|
4160
|
+
direction: "left",
|
|
4161
|
+
onClick: prevSlide,
|
|
4162
|
+
visible: infinite_scroll || currentSlide > 0,
|
|
4163
|
+
className: arrowClassName,
|
|
4164
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4165
|
+
}
|
|
4166
|
+
),
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4168
|
+
ArrowButton,
|
|
4169
|
+
{
|
|
4170
|
+
direction: "right",
|
|
4171
|
+
onClick: nextSlide,
|
|
4172
|
+
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4173
|
+
className: arrowClassName,
|
|
4174
|
+
children: [
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4176
|
+
" "
|
|
4177
|
+
]
|
|
4178
|
+
}
|
|
4179
|
+
)
|
|
4180
|
+
] }),
|
|
4181
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4182
|
+
ProgressPill,
|
|
4183
|
+
{
|
|
4184
|
+
active: index === currentSlide,
|
|
4185
|
+
duration: autoplay_speed,
|
|
4186
|
+
index,
|
|
4187
|
+
onClick: () => handlePillClick(index),
|
|
4188
|
+
isPlaying: isPlaying && index === currentSlide && autoplay,
|
|
4189
|
+
style: pillStyle,
|
|
4190
|
+
activeClassName: dotActiveClassName,
|
|
4191
|
+
inactiveClassName: dotInactiveClassName,
|
|
4192
|
+
currentSlide,
|
|
4193
|
+
totalSlides
|
|
4194
|
+
},
|
|
4195
|
+
index
|
|
4196
|
+
)) })
|
|
4197
|
+
]
|
|
4198
|
+
}
|
|
4199
|
+
);
|
|
4200
|
+
};
|
|
4201
|
+
var ArrowButton = ({
|
|
4202
|
+
direction,
|
|
4203
|
+
onClick,
|
|
4204
|
+
visible,
|
|
4205
|
+
children,
|
|
4206
|
+
className = ""
|
|
4207
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4208
|
+
"button",
|
|
4209
|
+
{
|
|
4210
|
+
className: `
|
|
4211
|
+
absolute top-1/2 -translate-y-1/2 z-10
|
|
4212
|
+
${direction === "left" ? "left-2.5" : "right-2.5"}
|
|
4213
|
+
${!visible && "hidden"}
|
|
4214
|
+
${className}
|
|
4215
|
+
`,
|
|
4216
|
+
onClick,
|
|
4217
|
+
"aria-label": direction === "left" ? "Previous slide" : "Next slide",
|
|
4218
|
+
children
|
|
3545
4219
|
}
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
4220
|
+
);
|
|
4221
|
+
var ProgressPill = ({
|
|
4222
|
+
active,
|
|
4223
|
+
duration,
|
|
4224
|
+
index,
|
|
4225
|
+
onClick,
|
|
4226
|
+
isPlaying,
|
|
4227
|
+
style = "modern",
|
|
4228
|
+
activeClassName = "",
|
|
4229
|
+
inactiveClassName = "",
|
|
4230
|
+
currentSlide,
|
|
4231
|
+
totalSlides
|
|
4232
|
+
}) => {
|
|
4233
|
+
const [progress, setProgress] = (0, import_react53.useState)(0);
|
|
4234
|
+
(0, import_react53.useEffect)(() => {
|
|
4235
|
+
if (active) {
|
|
4236
|
+
setProgress(0);
|
|
4237
|
+
}
|
|
4238
|
+
}, [active, index]);
|
|
4239
|
+
(0, import_react53.useEffect)(() => {
|
|
4240
|
+
if (!active || !isPlaying) {
|
|
4241
|
+
if (!active) {
|
|
4242
|
+
setProgress(0);
|
|
3566
4243
|
}
|
|
3567
|
-
return
|
|
3568
|
-
}
|
|
4244
|
+
return;
|
|
4245
|
+
}
|
|
4246
|
+
const startTime = Date.now();
|
|
4247
|
+
const interval = setInterval(() => {
|
|
4248
|
+
const elapsed = Date.now() - startTime;
|
|
4249
|
+
const newProgress = elapsed / duration * 100;
|
|
4250
|
+
if (newProgress >= 100) {
|
|
4251
|
+
setProgress(100);
|
|
4252
|
+
clearInterval(interval);
|
|
4253
|
+
} else {
|
|
4254
|
+
setProgress(newProgress);
|
|
4255
|
+
}
|
|
4256
|
+
}, 50);
|
|
4257
|
+
return () => clearInterval(interval);
|
|
4258
|
+
}, [active, isPlaying, duration, index]);
|
|
4259
|
+
const isFilled = index < currentSlide;
|
|
4260
|
+
const isActive = index === currentSlide;
|
|
4261
|
+
const shouldShowProgress = isActive || style === "cumulative" && isFilled;
|
|
4262
|
+
const baseClasses = "cursor-pointer transition-all duration-300 ease-out";
|
|
4263
|
+
const getStyleClasses = () => {
|
|
4264
|
+
switch (style) {
|
|
4265
|
+
case "minimal":
|
|
4266
|
+
return `
|
|
4267
|
+
${isActive ? "w-8" : "w-2"} h-2 rounded-full
|
|
4268
|
+
${isActive ? activeClassName || "bg-white" : inactiveClassName || "bg-white/50"}
|
|
4269
|
+
hover:scale-110
|
|
4270
|
+
`;
|
|
4271
|
+
case "cumulative":
|
|
4272
|
+
return `
|
|
4273
|
+
w-4 h-1 rounded-full overflow-hidden relative
|
|
4274
|
+
${isFilled ? activeClassName || "bg-white" : inactiveClassName || "bg-white/30"}
|
|
4275
|
+
`;
|
|
4276
|
+
case "modern":
|
|
4277
|
+
return `
|
|
4278
|
+
w-8 h-1.5 rounded-full overflow-hidden relative
|
|
4279
|
+
${isActive ? inactiveClassName || "bg-white/30" : inactiveClassName || "bg-white/30"}
|
|
4280
|
+
hover:h-2
|
|
4281
|
+
`;
|
|
4282
|
+
case "default":
|
|
4283
|
+
default:
|
|
4284
|
+
return `
|
|
4285
|
+
w-6 h-1.5 rounded-full
|
|
4286
|
+
${isActive ? activeClassName || "bg-white" : inactiveClassName || "bg-white/50"}
|
|
4287
|
+
hover:w-8
|
|
4288
|
+
`;
|
|
4289
|
+
}
|
|
4290
|
+
};
|
|
4291
|
+
const renderProgressBar = () => {
|
|
4292
|
+
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4293
|
+
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4295
|
+
"div",
|
|
4296
|
+
{
|
|
4297
|
+
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
4298
|
+
style: { width: `${displayProgress}%` }
|
|
4299
|
+
}
|
|
4300
|
+
);
|
|
4301
|
+
}
|
|
4302
|
+
return null;
|
|
4303
|
+
};
|
|
4304
|
+
const renderCumulativeFill = () => {
|
|
4305
|
+
if (style === "cumulative" && isFilled && !isActive) {
|
|
4306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4307
|
+
"div",
|
|
4308
|
+
{
|
|
4309
|
+
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
4310
|
+
style: { width: "100%" }
|
|
4311
|
+
}
|
|
4312
|
+
);
|
|
4313
|
+
}
|
|
4314
|
+
return null;
|
|
4315
|
+
};
|
|
4316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4317
|
+
"button",
|
|
4318
|
+
{
|
|
4319
|
+
className: `${baseClasses} ${getStyleClasses()}`,
|
|
4320
|
+
onClick,
|
|
4321
|
+
"aria-label": `Go to slide ${index + 1}`,
|
|
4322
|
+
"aria-current": isActive ? "true" : "false",
|
|
4323
|
+
children: [
|
|
4324
|
+
renderProgressBar(),
|
|
4325
|
+
renderCumulativeFill()
|
|
4326
|
+
]
|
|
4327
|
+
}
|
|
4328
|
+
);
|
|
4329
|
+
};
|
|
4330
|
+
var Slider_default = Slider;
|
|
4331
|
+
|
|
4332
|
+
// src/components/NoDataFound.tsx
|
|
4333
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4334
|
+
var NoDataFound = () => {
|
|
4335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
4336
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4337
|
+
"svg",
|
|
4338
|
+
{
|
|
4339
|
+
className: "w-10 h-10",
|
|
4340
|
+
fill: "none",
|
|
4341
|
+
stroke: "currentColor",
|
|
4342
|
+
viewBox: "0 0 24 24",
|
|
4343
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4345
|
+
"path",
|
|
4346
|
+
{
|
|
4347
|
+
strokeLinecap: "round",
|
|
4348
|
+
strokeLinejoin: "round",
|
|
4349
|
+
strokeWidth: "1.5",
|
|
4350
|
+
d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
|
|
4351
|
+
}
|
|
4352
|
+
)
|
|
4353
|
+
}
|
|
4354
|
+
) }) }),
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
4356
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
4357
|
+
] });
|
|
4358
|
+
};
|
|
4359
|
+
var NoDataFound_default = NoDataFound;
|
|
4360
|
+
|
|
4361
|
+
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4362
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4363
|
+
function toCamelCase(str) {
|
|
4364
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
4365
|
+
}
|
|
4366
|
+
function convertKeysToCamelCase(obj) {
|
|
4367
|
+
if (!obj || typeof obj !== "object") return obj;
|
|
4368
|
+
if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
|
|
4369
|
+
return Object.fromEntries(
|
|
4370
|
+
Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [
|
|
4371
|
+
toCamelCase(key),
|
|
4372
|
+
convertKeysToCamelCase(value)
|
|
4373
|
+
])
|
|
4374
|
+
);
|
|
4375
|
+
}
|
|
4376
|
+
var getNestedValue = (obj, path) => {
|
|
4377
|
+
if (!obj || !path) return void 0;
|
|
4378
|
+
return path.split(".").reduce((current, key) => {
|
|
4379
|
+
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4380
|
+
}, obj);
|
|
4381
|
+
};
|
|
4382
|
+
function generateCompleteBackgroundString(layers) {
|
|
4383
|
+
if (!layers || !Array.isArray(layers)) return "";
|
|
4384
|
+
return layers.filter((layer) => layer && layer.type && layer.value).map((layer) => {
|
|
4385
|
+
if (layer.type === "image" && typeof layer.value === "object") {
|
|
4386
|
+
const imageValue = layer.value;
|
|
4387
|
+
if (!imageValue.assetUrl) return "";
|
|
4388
|
+
const url = `url('${AssetUtility_default.resolveUrl(
|
|
4389
|
+
ApiPathServerUtility.getApiPath(),
|
|
4390
|
+
imageValue.assetUrl
|
|
4391
|
+
)}')`;
|
|
4392
|
+
const repeat = layer.repeat || "no-repeat";
|
|
4393
|
+
const position = layer.position || "center";
|
|
4394
|
+
const size = layer.size || "auto";
|
|
4395
|
+
const attachment = layer.attachment || "scroll";
|
|
4396
|
+
return `${url} ${position} / ${size} ${repeat} ${attachment}`;
|
|
4397
|
+
}
|
|
4398
|
+
if (layer.type === "gradient" && typeof layer.value === "object") {
|
|
4399
|
+
const gradient = layer.value;
|
|
4400
|
+
if (!gradient.colors || !gradient.direction) return "";
|
|
4401
|
+
const colors = gradient.colors.map(
|
|
4402
|
+
(colorStop) => `color-mix(in srgb, ${colorStop.color}, transparent ${colorStop.transparency ?? 0}%) ${colorStop.start || "0%"}`
|
|
4403
|
+
).join(", ");
|
|
4404
|
+
return `linear-gradient(${gradient.direction}, ${colors})`;
|
|
4405
|
+
}
|
|
4406
|
+
return "";
|
|
4407
|
+
}).filter((bg) => bg.trim() !== "").join(", ");
|
|
4408
|
+
}
|
|
4409
|
+
var generateCssString = (guid, stylesObject, mobileStylesObject) => {
|
|
4410
|
+
let gridColumns = stylesObject.gridTemplateColumns ? stylesObject.gridTemplateColumns.match(/\d+/g) : [];
|
|
4411
|
+
let hasGridProperties = gridColumns.length > 0;
|
|
4412
|
+
let largeCols = hasGridProperties ? parseInt(gridColumns[0]) : 4;
|
|
4413
|
+
let tabletColumns = hasGridProperties ? Math.ceil(parseInt(gridColumns[0]) / 2) : 2;
|
|
4414
|
+
let mobileColumns = 1;
|
|
4415
|
+
let cssRules = Object.entries(stylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4416
|
+
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4417
|
+
return `${cssKey}: ${value};`;
|
|
4418
|
+
});
|
|
4419
|
+
let css = `#${guid} {
|
|
4420
|
+
${cssRules.join(
|
|
4421
|
+
"\n"
|
|
4422
|
+
)}
|
|
4423
|
+
transition: all 0.3s ease-in-out; }`;
|
|
4424
|
+
if (mobileStylesObject) {
|
|
4425
|
+
let mobileCssRules = Object.entries(mobileStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4426
|
+
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4427
|
+
return `${cssKey}: ${value};`;
|
|
4428
|
+
});
|
|
4429
|
+
if (mobileCssRules.length > 0) {
|
|
4430
|
+
css += `
|
|
4431
|
+
@media (max-width: 480px) { #${guid} {
|
|
4432
|
+
${mobileCssRules.join(
|
|
4433
|
+
"\n"
|
|
4434
|
+
)}
|
|
4435
|
+
} }`;
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
if (hasGridProperties) {
|
|
4439
|
+
css += `
|
|
4440
|
+
@media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
4441
|
+
css += `
|
|
4442
|
+
@media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
4443
|
+
css += `
|
|
4444
|
+
@media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
|
|
3569
4445
|
}
|
|
4446
|
+
const output = {
|
|
4447
|
+
css,
|
|
4448
|
+
gridColsLarge: largeCols,
|
|
4449
|
+
gridColsMedium: tabletColumns,
|
|
4450
|
+
gridColsSmall: mobileColumns
|
|
4451
|
+
};
|
|
4452
|
+
return output;
|
|
4453
|
+
};
|
|
4454
|
+
var DivContainer = async (props) => {
|
|
4455
|
+
const NodeTypes2 = {
|
|
4456
|
+
paragraph: ParagraphNode_default,
|
|
4457
|
+
heading: HeadingNode_default,
|
|
4458
|
+
list: ListNode_default,
|
|
4459
|
+
quote: QuoteNode_default,
|
|
4460
|
+
code: CodeNode_default,
|
|
4461
|
+
image: ImageNode_default,
|
|
4462
|
+
horizontalrule: HorizontalRuleNode_default,
|
|
4463
|
+
"layout-container": LayoutContainerNode_default,
|
|
4464
|
+
widget: WidgetNode_default,
|
|
4465
|
+
embed: EmbedNode_default,
|
|
4466
|
+
"div-container": DivContainer,
|
|
4467
|
+
text: TextNode_default,
|
|
4468
|
+
datafield: DatafieldNode_default,
|
|
4469
|
+
"svg-icon": SVGIconNode_default
|
|
4470
|
+
};
|
|
4471
|
+
const styles = props.node.cssProperties;
|
|
4472
|
+
const mobileStyles = props.node.mobileCssProperties;
|
|
4473
|
+
const dataBindingProperties = props.node.dataBinding;
|
|
4474
|
+
const updatedStyles = convertKeysToCamelCase(styles);
|
|
3570
4475
|
var background = generateCompleteBackgroundString(props.node.backgroundLayers);
|
|
3571
4476
|
let containerPaddingClass = "";
|
|
3572
4477
|
if (props.node.containerPadding == "small") {
|
|
@@ -3576,103 +4481,183 @@ var DivContainer = (props) => {
|
|
|
3576
4481
|
}
|
|
3577
4482
|
const updatedStyle = { ...updatedStyles };
|
|
3578
4483
|
const backgroundStyle = background && background !== "" ? { background } : {};
|
|
4484
|
+
const combinedStyles = {
|
|
4485
|
+
...backgroundStyle
|
|
4486
|
+
};
|
|
4487
|
+
if (props.node.enableBackgroundClipText) {
|
|
4488
|
+
combinedStyles.WebkitBackgroundClip = "text";
|
|
4489
|
+
combinedStyles.backgroundClip = "text";
|
|
4490
|
+
}
|
|
3579
4491
|
const guid = "css" + crypto.randomUUID().toLocaleLowerCase();
|
|
3580
|
-
const
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
4492
|
+
const { enterAnimation, exitAnimation, hoverAnimation } = props.node;
|
|
4493
|
+
let animationCSS = "";
|
|
4494
|
+
if (enterAnimation?.name) {
|
|
4495
|
+
animationCSS += AnimationUtility_default.generateAnimationCSS(
|
|
4496
|
+
{ animation: enterAnimation.name, mode: "enter", ...enterAnimation.properties },
|
|
4497
|
+
`#${guid}`
|
|
4498
|
+
);
|
|
4499
|
+
}
|
|
4500
|
+
if (hoverAnimation?.name) {
|
|
4501
|
+
animationCSS += AnimationUtility_default.generateAnimationCSS(
|
|
4502
|
+
{ animation: hoverAnimation.name, mode: "hover", ...hoverAnimation.properties },
|
|
4503
|
+
`#${guid}`
|
|
4504
|
+
);
|
|
4505
|
+
}
|
|
4506
|
+
const shouldHideContainer = () => {
|
|
4507
|
+
if (!props.node.fieldVisibleOnTrue) return false;
|
|
4508
|
+
const fieldValue = getNestedValue(props.dataitem, props.node.fieldVisibleOnTrue);
|
|
4509
|
+
return fieldValue !== void 0 && fieldValue === false;
|
|
4510
|
+
};
|
|
4511
|
+
const isHidden = shouldHideContainer();
|
|
4512
|
+
let odataString = void 0;
|
|
4513
|
+
let endpoint = void 0;
|
|
4514
|
+
let result = null;
|
|
4515
|
+
let response = null;
|
|
4516
|
+
let childCollectionData = null;
|
|
4517
|
+
if (dataBindingProperties) {
|
|
4518
|
+
const serviceClient = new ServiceClient(props.apiBaseUrl, props.session);
|
|
4519
|
+
endpoint = dataBindingProperties.dataSource;
|
|
4520
|
+
endpoint = endpoint.replace(/\{(\w+)\}/g, (_, key) => {
|
|
4521
|
+
return props.routeParameters?.[key] ?? `{${key}}`;
|
|
3588
4522
|
});
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
if (hoverStylesObject) {
|
|
3595
|
-
let hoverCssRules = Object.entries(hoverStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
3596
|
-
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3597
|
-
return `${cssKey}: ${value};`;
|
|
3598
|
-
});
|
|
3599
|
-
if (hoverCssRules.length > 0) {
|
|
3600
|
-
css2 += `
|
|
3601
|
-
#${guid}:hover {
|
|
3602
|
-
${hoverCssRules.join("\n")}
|
|
3603
|
-
}`;
|
|
4523
|
+
if (dataBindingProperties.applyODataParams) {
|
|
4524
|
+
odataString = OdataBuilder.getOdataQueryString(props.query);
|
|
4525
|
+
if (odataString) {
|
|
4526
|
+
const separator = endpoint.includes("?") ? "&" : "?";
|
|
4527
|
+
endpoint += separator + odataString;
|
|
3604
4528
|
}
|
|
3605
4529
|
}
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
4530
|
+
response = await serviceClient.get(endpoint);
|
|
4531
|
+
result = response?.result;
|
|
4532
|
+
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
4533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(NoDataFound_default, {});
|
|
4534
|
+
}
|
|
4535
|
+
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
4536
|
+
childCollectionData = getNestedValue(props.dataitem, dataBindingProperties.childCollectionName);
|
|
4537
|
+
}
|
|
4538
|
+
}
|
|
4539
|
+
const cssResult = generateCssString(guid, updatedStyle, mobileStyles);
|
|
4540
|
+
function renderNode(node, props2, dataitem, key, href) {
|
|
4541
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4542
|
+
if (!SelectedNode) return null;
|
|
4543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4544
|
+
SelectedNode,
|
|
4545
|
+
{
|
|
4546
|
+
node,
|
|
4547
|
+
parentTag: Wrapper,
|
|
4548
|
+
routeParameters: props2.routeParameters,
|
|
4549
|
+
query: props2.query,
|
|
4550
|
+
session: props2.session,
|
|
4551
|
+
host: props2.host,
|
|
4552
|
+
path: props2.path,
|
|
4553
|
+
apiBaseUrl: props2.apiBaseUrl,
|
|
4554
|
+
breadcrumb: props2.breadcrumb,
|
|
4555
|
+
dataitem,
|
|
4556
|
+
href
|
|
3616
4557
|
}
|
|
4558
|
+
) }, key);
|
|
4559
|
+
}
|
|
4560
|
+
function renderChildren(nodes, props2, data, key, href) {
|
|
4561
|
+
if (!nodes) return null;
|
|
4562
|
+
const childNodes = nodes.map((node, index) => {
|
|
4563
|
+
if (node.type === "div-container" && node.dataBinding?.childCollectionName && data) {
|
|
4564
|
+
return renderNode(node, props2, data, index, href);
|
|
4565
|
+
}
|
|
4566
|
+
return renderNode(node, props2, data, index, href);
|
|
4567
|
+
});
|
|
4568
|
+
return childNodes;
|
|
4569
|
+
}
|
|
4570
|
+
function queryObjectToString(query) {
|
|
4571
|
+
if (!query) return "";
|
|
4572
|
+
return Object.entries(query).map(
|
|
4573
|
+
([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`
|
|
4574
|
+
).join("&");
|
|
4575
|
+
}
|
|
4576
|
+
function resolveHrefTemplate(template, dataItem) {
|
|
4577
|
+
return template.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
4578
|
+
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
4579
|
+
});
|
|
4580
|
+
}
|
|
4581
|
+
const dataToRender = (() => {
|
|
4582
|
+
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
4583
|
+
return childCollectionData;
|
|
3617
4584
|
}
|
|
3618
|
-
if (
|
|
3619
|
-
|
|
3620
|
-
@media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
3621
|
-
css2 += `
|
|
3622
|
-
@media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
3623
|
-
css2 += `
|
|
3624
|
-
@media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
|
|
4585
|
+
if (result && props.node.dataBinding?.responseType === "array") {
|
|
4586
|
+
return result;
|
|
3625
4587
|
}
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
4588
|
+
if (result && props.node.dataBinding?.responseType === "object") {
|
|
4589
|
+
return [result];
|
|
4590
|
+
}
|
|
4591
|
+
return [props.dataitem];
|
|
4592
|
+
})();
|
|
4593
|
+
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
4594
|
+
let Wrapper;
|
|
4595
|
+
let wrapperProps;
|
|
4596
|
+
switch (true) {
|
|
4597
|
+
case props.node.componentProperties?.type === "slider":
|
|
4598
|
+
Wrapper = Slider_default;
|
|
4599
|
+
const largeCols = props.node.componentProperties?.columns || 4;
|
|
4600
|
+
const slidesToShow = {
|
|
4601
|
+
large: largeCols,
|
|
4602
|
+
medium: Math.ceil(largeCols / 2),
|
|
4603
|
+
small: 1
|
|
4604
|
+
};
|
|
4605
|
+
wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
|
|
4606
|
+
break;
|
|
4607
|
+
case !!(props.node.href || props.href):
|
|
4608
|
+
Wrapper = "a";
|
|
4609
|
+
let href = props.node.href || props.href;
|
|
4610
|
+
if (href?.includes("{")) {
|
|
4611
|
+
href = resolveHrefTemplate(href, props.dataitem);
|
|
4612
|
+
}
|
|
4613
|
+
const currentPath = decodeURIComponent(PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query));
|
|
4614
|
+
const resolvedHref = decodeURIComponent(href || "");
|
|
4615
|
+
const isSelected = currentPath === resolvedHref;
|
|
4616
|
+
wrapperProps = { href, "data-isSelected": isSelected, "data-path": currentPath, "data-href": resolvedHref, class: "no-link-color" };
|
|
4617
|
+
break;
|
|
4618
|
+
default: {
|
|
4619
|
+
const replacementTag = props.node.replaceDivTagWith;
|
|
4620
|
+
const allowedTags = ["div", "section", "article", "details", "summary"];
|
|
4621
|
+
if (replacementTag && allowedTags.includes(replacementTag)) {
|
|
4622
|
+
Wrapper = replacementTag;
|
|
4623
|
+
} else {
|
|
4624
|
+
Wrapper = "div";
|
|
4625
|
+
}
|
|
4626
|
+
wrapperProps = {};
|
|
4627
|
+
break;
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
if (isHidden) {
|
|
4631
|
+
return null;
|
|
4632
|
+
}
|
|
4633
|
+
const classNames = [
|
|
4634
|
+
containerPaddingClass,
|
|
4635
|
+
props.node.autoFormat && "auto-format",
|
|
4636
|
+
props.node.bgClass
|
|
4637
|
+
].filter(Boolean).join(" ");
|
|
4638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react54.default.Fragment, { children: [
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4640
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4641
|
+
Wrapper,
|
|
3633
4642
|
{
|
|
3634
4643
|
id: guid,
|
|
3635
|
-
style:
|
|
3636
|
-
className:
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
routeParameters: props.routeParameters,
|
|
3644
|
-
query: props.query,
|
|
3645
|
-
session: props.session,
|
|
3646
|
-
host: props.host,
|
|
3647
|
-
path: props.path,
|
|
3648
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3649
|
-
breadcrumb: props.breadcrumb
|
|
3650
|
-
}
|
|
3651
|
-
) }, index);
|
|
3652
|
-
})
|
|
4644
|
+
style: combinedStyles,
|
|
4645
|
+
className: classNames || void 0,
|
|
4646
|
+
...wrapperProps,
|
|
4647
|
+
children: dataToRender.map(
|
|
4648
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4649
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react54.default.Fragment, { children: child }, i)
|
|
4650
|
+
) : renderChildren(props.node.children, props, item, idx)
|
|
4651
|
+
)
|
|
3653
4652
|
}
|
|
3654
|
-
) })
|
|
3655
|
-
|
|
3656
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3657
|
-
SelectedNode,
|
|
3658
|
-
{
|
|
3659
|
-
node,
|
|
3660
|
-
routeParameters: props.routeParameters,
|
|
3661
|
-
query: props.query,
|
|
3662
|
-
session: props.session,
|
|
3663
|
-
host: props.host,
|
|
3664
|
-
path: props.path,
|
|
3665
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3666
|
-
breadcrumb: props.breadcrumb
|
|
3667
|
-
}
|
|
3668
|
-
) }, index);
|
|
3669
|
-
}) })
|
|
4653
|
+
) }) }),
|
|
4654
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
3670
4655
|
] });
|
|
3671
4656
|
};
|
|
3672
4657
|
var DivContainer_default = DivContainer;
|
|
3673
4658
|
|
|
3674
4659
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3675
|
-
var
|
|
4660
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3676
4661
|
var NodeTypes = {
|
|
3677
4662
|
["paragraph"]: ParagraphNode_default,
|
|
3678
4663
|
["heading"]: HeadingNode_default,
|
|
@@ -3700,11 +4685,11 @@ var PageBodyRenderer = (props) => {
|
|
|
3700
4685
|
if (pageBodyTree && pageBodyTree.root) {
|
|
3701
4686
|
rootNode = pageBodyTree.root;
|
|
3702
4687
|
}
|
|
3703
|
-
return /* @__PURE__ */ (0,
|
|
4688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
3704
4689
|
{
|
|
3705
4690
|
}
|
|
3706
4691
|
const SelectedNode = NodeTypes[node.type];
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
4692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3708
4693
|
SelectedNode,
|
|
3709
4694
|
{
|
|
3710
4695
|
node,
|
|
@@ -3717,7 +4702,7 @@ var PageBodyRenderer = (props) => {
|
|
|
3717
4702
|
apiBaseUrl: props.apiBaseUrl,
|
|
3718
4703
|
widgetRegistry: props.widgetRegistry
|
|
3719
4704
|
}
|
|
3720
|
-
) }) : /* @__PURE__ */ (0,
|
|
4705
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3721
4706
|
SelectedNode,
|
|
3722
4707
|
{
|
|
3723
4708
|
node,
|
|
@@ -3742,4 +4727,3 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
3742
4727
|
ViewControl,
|
|
3743
4728
|
ViewControlTypes
|
|
3744
4729
|
});
|
|
3745
|
-
//# sourceMappingURL=index.js.map
|