@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260323045408 → 0.8.1-dev.20260323060538
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1122 -181
- package/dist/index.mjs +1122 -181
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1422,7 +1422,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1422
1422
|
const containerRef = (0, import_react27.useRef)(null);
|
|
1423
1423
|
const [isCreateOpen, setIsCreateOpen] = (0, import_react27.useState)(false);
|
|
1424
1424
|
const [formData, setFormData] = (0, import_react27.useState)({});
|
|
1425
|
-
const
|
|
1425
|
+
const getNestedValue2 = (obj, path) => {
|
|
1426
1426
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
1427
1427
|
};
|
|
1428
1428
|
(0, import_react27.useEffect)(() => {
|
|
@@ -1460,7 +1460,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1460
1460
|
props.dataSourceDependsOn
|
|
1461
1461
|
]);
|
|
1462
1462
|
const filteredItems = list?.filter((item) => {
|
|
1463
|
-
const value =
|
|
1463
|
+
const value = getNestedValue2(item, props.dataTextFieldName);
|
|
1464
1464
|
return value?.toLowerCase().includes(searchTerm?.toLowerCase());
|
|
1465
1465
|
});
|
|
1466
1466
|
const playBeep = () => {
|
|
@@ -1491,7 +1491,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1491
1491
|
}, [searchTerm]);
|
|
1492
1492
|
const handleSelect = (event, item) => {
|
|
1493
1493
|
event.preventDefault();
|
|
1494
|
-
setSearchTerm(
|
|
1494
|
+
setSearchTerm(getNestedValue2(item, props.dataTextFieldName));
|
|
1495
1495
|
if (props.callback) {
|
|
1496
1496
|
const val = {};
|
|
1497
1497
|
props.callback({
|
|
@@ -1638,7 +1638,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
1638
1638
|
role: "option",
|
|
1639
1639
|
tabIndex: -1,
|
|
1640
1640
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
1641
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children:
|
|
1641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: getNestedValue2(item, props.dataTextFieldName) })
|
|
1642
1642
|
}
|
|
1643
1643
|
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
1644
1644
|
}
|
|
@@ -1937,51 +1937,146 @@ var OdataBuilder = class {
|
|
|
1937
1937
|
this.baseUrl = url;
|
|
1938
1938
|
this.top = Constants.pagesize.toString();
|
|
1939
1939
|
this.skip = "0";
|
|
1940
|
+
this.keyword = "";
|
|
1940
1941
|
this.filterBy = "";
|
|
1941
1942
|
this.orderBy = "";
|
|
1942
1943
|
}
|
|
1944
|
+
// parseSearchParams(ReadonlyUrlSearchParams): DataQuery {
|
|
1945
|
+
// this.top = top;
|
|
1946
|
+
// return this;
|
|
1947
|
+
// }
|
|
1943
1948
|
setQuery(odata) {
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
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;
|
|
1949
2018
|
return this;
|
|
1950
2019
|
}
|
|
1951
2020
|
getPageNumber(pageSize) {
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
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)}`;
|
|
1956
2038
|
}
|
|
1957
|
-
|
|
2039
|
+
console.log(url);
|
|
2040
|
+
return url;
|
|
1958
2041
|
}
|
|
1959
2042
|
getNewOrderByUrl(orderBy) {
|
|
1960
|
-
let url = `${this.baseUrl}?$skip
|
|
1961
|
-
if (this.filterBy) {
|
|
1962
|
-
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)}`;
|
|
1963
2046
|
}
|
|
1964
|
-
url
|
|
2047
|
+
url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
|
|
1965
2048
|
return url;
|
|
1966
2049
|
}
|
|
1967
2050
|
getNewFilterUrl(filterBy) {
|
|
1968
|
-
let url = `${this.baseUrl}?$skip
|
|
1969
|
-
if (filterBy) {
|
|
1970
|
-
url
|
|
2051
|
+
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
2052
|
+
if (filterBy !== null && filterBy !== "") {
|
|
2053
|
+
url = url + `&$filter=${encodeURIComponent(filterBy)}`;
|
|
1971
2054
|
}
|
|
1972
|
-
if (this.orderBy) {
|
|
1973
|
-
url
|
|
2055
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
2056
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
1974
2057
|
}
|
|
1975
2058
|
return url;
|
|
1976
2059
|
}
|
|
1977
2060
|
getNewPageUrl(page) {
|
|
1978
|
-
|
|
2061
|
+
let skip = page * Constants.pagesize - Constants.pagesize;
|
|
1979
2062
|
let url = `${this.baseUrl}?$skip=${skip}&$top=${this.top}&$count=true`;
|
|
1980
|
-
if (this.filterBy) {
|
|
1981
|
-
url
|
|
2063
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
2064
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
1982
2065
|
}
|
|
1983
|
-
if (this.orderBy) {
|
|
1984
|
-
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)}`;
|
|
1985
2080
|
}
|
|
1986
2081
|
return url;
|
|
1987
2082
|
}
|
|
@@ -2537,7 +2632,7 @@ var DataList = (props) => {
|
|
|
2537
2632
|
var DataList_default = DataList;
|
|
2538
2633
|
|
|
2539
2634
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2540
|
-
var
|
|
2635
|
+
var import_react55 = __toESM(require("react"));
|
|
2541
2636
|
|
|
2542
2637
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2543
2638
|
var import_react37 = __toESM(require("react"));
|
|
@@ -2563,17 +2658,17 @@ var TextNode = (props) => {
|
|
|
2563
2658
|
}
|
|
2564
2659
|
return styleObject;
|
|
2565
2660
|
}
|
|
2566
|
-
function
|
|
2661
|
+
function toCamelCase2(str) {
|
|
2567
2662
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2568
2663
|
}
|
|
2569
|
-
function
|
|
2664
|
+
function convertKeysToCamelCase2(obj) {
|
|
2570
2665
|
if (Array.isArray(obj)) {
|
|
2571
|
-
return obj.map(
|
|
2666
|
+
return obj.map(convertKeysToCamelCase2);
|
|
2572
2667
|
} else if (obj !== null && typeof obj === "object") {
|
|
2573
2668
|
return Object.fromEntries(
|
|
2574
2669
|
Object.entries(obj).filter(([_, value]) => value !== "").map(([key, value]) => [
|
|
2575
|
-
|
|
2576
|
-
|
|
2670
|
+
toCamelCase2(key),
|
|
2671
|
+
convertKeysToCamelCase2(value)
|
|
2577
2672
|
])
|
|
2578
2673
|
);
|
|
2579
2674
|
}
|
|
@@ -2593,7 +2688,7 @@ var TextNode = (props) => {
|
|
|
2593
2688
|
if (format === 1024) classes.push("capitalize");
|
|
2594
2689
|
return classes.join(" ");
|
|
2595
2690
|
}
|
|
2596
|
-
const styles =
|
|
2691
|
+
const styles = convertKeysToCamelCase2(cssStringToJson(props.node.style));
|
|
2597
2692
|
function replacePlaceholders(template, dataItem) {
|
|
2598
2693
|
return template.replace(/{(\w+)}/g, (_, key) => {
|
|
2599
2694
|
return key in dataItem ? dataItem[key] : `{${key}}`;
|
|
@@ -2714,13 +2809,13 @@ var DatafieldNode = (props) => {
|
|
|
2714
2809
|
}
|
|
2715
2810
|
return styleObject;
|
|
2716
2811
|
}
|
|
2717
|
-
function
|
|
2812
|
+
function toCamelCase2(str) {
|
|
2718
2813
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2719
2814
|
}
|
|
2720
|
-
function
|
|
2815
|
+
function convertKeysToCamelCase2(obj) {
|
|
2721
2816
|
if (!obj || typeof obj !== "object") return obj;
|
|
2722
2817
|
return Object.fromEntries(
|
|
2723
|
-
Object.entries(obj).map(([key, value2]) => [
|
|
2818
|
+
Object.entries(obj).map(([key, value2]) => [toCamelCase2(key), value2])
|
|
2724
2819
|
);
|
|
2725
2820
|
}
|
|
2726
2821
|
const Formats = [
|
|
@@ -2737,7 +2832,7 @@ var DatafieldNode = (props) => {
|
|
|
2737
2832
|
"italic underline",
|
|
2738
2833
|
"italic underline font-medium"
|
|
2739
2834
|
];
|
|
2740
|
-
const styles =
|
|
2835
|
+
const styles = convertKeysToCamelCase2(cssStringToJson(props.node.style));
|
|
2741
2836
|
const fieldName = props.node.fieldName;
|
|
2742
2837
|
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
2743
2838
|
console.log(fieldName, value, "haha");
|
|
@@ -3566,69 +3661,824 @@ var FormContainerNode = (props) => {
|
|
|
3566
3661
|
var FormContainerNode_default = FormContainerNode;
|
|
3567
3662
|
|
|
3568
3663
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3569
|
-
var
|
|
3570
|
-
|
|
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");
|
|
3571
3776
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3572
|
-
var
|
|
3573
|
-
const {
|
|
3574
|
-
const
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
[
|
|
3588
|
-
|
|
3589
|
-
|
|
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;
|
|
3590
3818
|
};
|
|
3591
|
-
|
|
3592
|
-
|
|
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() {
|
|
3593
3945
|
}
|
|
3594
|
-
|
|
3595
|
-
if (
|
|
3596
|
-
|
|
3597
|
-
return obj.map(convertKeysToCamelCase);
|
|
3946
|
+
normalizePath(path) {
|
|
3947
|
+
if (path == null) {
|
|
3948
|
+
return "/";
|
|
3598
3949
|
}
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
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 = __toESM(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
|
+
if (!import_react53.default.isValidElement(child)) return null;
|
|
4116
|
+
const childProps = child.props;
|
|
4117
|
+
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4119
|
+
"div",
|
|
4120
|
+
{
|
|
4121
|
+
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4122
|
+
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4123
|
+
children: (0, import_react53.cloneElement)(child, {
|
|
4124
|
+
className: mergedClassName
|
|
4125
|
+
})
|
|
4126
|
+
},
|
|
4127
|
+
index
|
|
3605
4128
|
);
|
|
4129
|
+
});
|
|
4130
|
+
const getProgressPositionClass = () => {
|
|
4131
|
+
switch (progressPosition) {
|
|
4132
|
+
case "top":
|
|
4133
|
+
return "top-4";
|
|
4134
|
+
case "bottom-outside":
|
|
4135
|
+
return "bottom-4 translate-y-full mt-4";
|
|
4136
|
+
case "bottom":
|
|
4137
|
+
default:
|
|
4138
|
+
return "bottom-4";
|
|
4139
|
+
}
|
|
4140
|
+
};
|
|
4141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4142
|
+
"div",
|
|
4143
|
+
{
|
|
4144
|
+
className: `relative w-full overflow-hidden ${className}`,
|
|
4145
|
+
onMouseEnter: handleMouseEnter,
|
|
4146
|
+
onMouseLeave: handleMouseLeave,
|
|
4147
|
+
children: [
|
|
4148
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4149
|
+
"div",
|
|
4150
|
+
{
|
|
4151
|
+
className: "flex h-full",
|
|
4152
|
+
style: {
|
|
4153
|
+
transition: transition ? "transform 0.5s ease" : "none",
|
|
4154
|
+
transform: `translateX(${translateX}%)`
|
|
4155
|
+
},
|
|
4156
|
+
children: slides
|
|
4157
|
+
}
|
|
4158
|
+
),
|
|
4159
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4161
|
+
ArrowButton,
|
|
4162
|
+
{
|
|
4163
|
+
direction: "left",
|
|
4164
|
+
onClick: prevSlide,
|
|
4165
|
+
visible: infinite_scroll || currentSlide > 0,
|
|
4166
|
+
className: arrowClassName,
|
|
4167
|
+
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" }) })
|
|
4168
|
+
}
|
|
4169
|
+
),
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4171
|
+
ArrowButton,
|
|
4172
|
+
{
|
|
4173
|
+
direction: "right",
|
|
4174
|
+
onClick: nextSlide,
|
|
4175
|
+
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4176
|
+
className: arrowClassName,
|
|
4177
|
+
children: [
|
|
4178
|
+
/* @__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" }) }),
|
|
4179
|
+
" "
|
|
4180
|
+
]
|
|
4181
|
+
}
|
|
4182
|
+
)
|
|
4183
|
+
] }),
|
|
4184
|
+
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)(
|
|
4185
|
+
ProgressPill,
|
|
4186
|
+
{
|
|
4187
|
+
active: index === currentSlide,
|
|
4188
|
+
duration: autoplay_speed,
|
|
4189
|
+
index,
|
|
4190
|
+
onClick: () => handlePillClick(index),
|
|
4191
|
+
isPlaying: isPlaying && index === currentSlide && autoplay,
|
|
4192
|
+
style: pillStyle,
|
|
4193
|
+
activeClassName: dotActiveClassName,
|
|
4194
|
+
inactiveClassName: dotInactiveClassName,
|
|
4195
|
+
currentSlide,
|
|
4196
|
+
totalSlides
|
|
4197
|
+
},
|
|
4198
|
+
index
|
|
4199
|
+
)) })
|
|
4200
|
+
]
|
|
4201
|
+
}
|
|
4202
|
+
);
|
|
4203
|
+
};
|
|
4204
|
+
var ArrowButton = ({
|
|
4205
|
+
direction,
|
|
4206
|
+
onClick,
|
|
4207
|
+
visible,
|
|
4208
|
+
children,
|
|
4209
|
+
className = ""
|
|
4210
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4211
|
+
"button",
|
|
4212
|
+
{
|
|
4213
|
+
className: `
|
|
4214
|
+
absolute top-1/2 -translate-y-1/2 z-10
|
|
4215
|
+
${direction === "left" ? "left-2.5" : "right-2.5"}
|
|
4216
|
+
${!visible && "hidden"}
|
|
4217
|
+
${className}
|
|
4218
|
+
`,
|
|
4219
|
+
onClick,
|
|
4220
|
+
"aria-label": direction === "left" ? "Previous slide" : "Next slide",
|
|
4221
|
+
children
|
|
3606
4222
|
}
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
4223
|
+
);
|
|
4224
|
+
var ProgressPill = ({
|
|
4225
|
+
active,
|
|
4226
|
+
duration,
|
|
4227
|
+
index,
|
|
4228
|
+
onClick,
|
|
4229
|
+
isPlaying,
|
|
4230
|
+
style = "modern",
|
|
4231
|
+
activeClassName = "",
|
|
4232
|
+
inactiveClassName = "",
|
|
4233
|
+
currentSlide,
|
|
4234
|
+
totalSlides
|
|
4235
|
+
}) => {
|
|
4236
|
+
const [progress, setProgress] = (0, import_react53.useState)(0);
|
|
4237
|
+
(0, import_react53.useEffect)(() => {
|
|
4238
|
+
if (active) {
|
|
4239
|
+
setProgress(0);
|
|
4240
|
+
}
|
|
4241
|
+
}, [active, index]);
|
|
4242
|
+
(0, import_react53.useEffect)(() => {
|
|
4243
|
+
if (!active || !isPlaying) {
|
|
4244
|
+
if (!active) {
|
|
4245
|
+
setProgress(0);
|
|
3627
4246
|
}
|
|
3628
|
-
return
|
|
3629
|
-
}
|
|
4247
|
+
return;
|
|
4248
|
+
}
|
|
4249
|
+
const startTime = Date.now();
|
|
4250
|
+
const interval = setInterval(() => {
|
|
4251
|
+
const elapsed = Date.now() - startTime;
|
|
4252
|
+
const newProgress = elapsed / duration * 100;
|
|
4253
|
+
if (newProgress >= 100) {
|
|
4254
|
+
setProgress(100);
|
|
4255
|
+
clearInterval(interval);
|
|
4256
|
+
} else {
|
|
4257
|
+
setProgress(newProgress);
|
|
4258
|
+
}
|
|
4259
|
+
}, 50);
|
|
4260
|
+
return () => clearInterval(interval);
|
|
4261
|
+
}, [active, isPlaying, duration, index]);
|
|
4262
|
+
const isFilled = index < currentSlide;
|
|
4263
|
+
const isActive = index === currentSlide;
|
|
4264
|
+
const shouldShowProgress = isActive || style === "cumulative" && isFilled;
|
|
4265
|
+
const baseClasses = "cursor-pointer transition-all duration-300 ease-out";
|
|
4266
|
+
const getStyleClasses = () => {
|
|
4267
|
+
switch (style) {
|
|
4268
|
+
case "minimal":
|
|
4269
|
+
return `
|
|
4270
|
+
${isActive ? "w-8" : "w-2"} h-2 rounded-full
|
|
4271
|
+
${isActive ? activeClassName || "bg-white" : inactiveClassName || "bg-white/50"}
|
|
4272
|
+
hover:scale-110
|
|
4273
|
+
`;
|
|
4274
|
+
case "cumulative":
|
|
4275
|
+
return `
|
|
4276
|
+
w-4 h-1 rounded-full overflow-hidden relative
|
|
4277
|
+
${isFilled ? activeClassName || "bg-white" : inactiveClassName || "bg-white/30"}
|
|
4278
|
+
`;
|
|
4279
|
+
case "modern":
|
|
4280
|
+
return `
|
|
4281
|
+
w-8 h-1.5 rounded-full overflow-hidden relative
|
|
4282
|
+
${isActive ? inactiveClassName || "bg-white/30" : inactiveClassName || "bg-white/30"}
|
|
4283
|
+
hover:h-2
|
|
4284
|
+
`;
|
|
4285
|
+
case "default":
|
|
4286
|
+
default:
|
|
4287
|
+
return `
|
|
4288
|
+
w-6 h-1.5 rounded-full
|
|
4289
|
+
${isActive ? activeClassName || "bg-white" : inactiveClassName || "bg-white/50"}
|
|
4290
|
+
hover:w-8
|
|
4291
|
+
`;
|
|
4292
|
+
}
|
|
4293
|
+
};
|
|
4294
|
+
const renderProgressBar = () => {
|
|
4295
|
+
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4296
|
+
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4298
|
+
"div",
|
|
4299
|
+
{
|
|
4300
|
+
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`,
|
|
4301
|
+
style: { width: `${displayProgress}%` }
|
|
4302
|
+
}
|
|
4303
|
+
);
|
|
4304
|
+
}
|
|
4305
|
+
return null;
|
|
4306
|
+
};
|
|
4307
|
+
const renderCumulativeFill = () => {
|
|
4308
|
+
if (style === "cumulative" && isFilled && !isActive) {
|
|
4309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4310
|
+
"div",
|
|
4311
|
+
{
|
|
4312
|
+
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
4313
|
+
style: { width: "100%" }
|
|
4314
|
+
}
|
|
4315
|
+
);
|
|
4316
|
+
}
|
|
4317
|
+
return null;
|
|
4318
|
+
};
|
|
4319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4320
|
+
"button",
|
|
4321
|
+
{
|
|
4322
|
+
className: `${baseClasses} ${getStyleClasses()}`,
|
|
4323
|
+
onClick,
|
|
4324
|
+
"aria-label": `Go to slide ${index + 1}`,
|
|
4325
|
+
"aria-current": isActive ? "true" : "false",
|
|
4326
|
+
children: [
|
|
4327
|
+
renderProgressBar(),
|
|
4328
|
+
renderCumulativeFill()
|
|
4329
|
+
]
|
|
4330
|
+
}
|
|
4331
|
+
);
|
|
4332
|
+
};
|
|
4333
|
+
var Slider_default = Slider;
|
|
4334
|
+
|
|
4335
|
+
// src/components/NoDataFound.tsx
|
|
4336
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4337
|
+
var NoDataFound = () => {
|
|
4338
|
+
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: [
|
|
4339
|
+
/* @__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)(
|
|
4340
|
+
"svg",
|
|
4341
|
+
{
|
|
4342
|
+
className: "w-10 h-10",
|
|
4343
|
+
fill: "none",
|
|
4344
|
+
stroke: "currentColor",
|
|
4345
|
+
viewBox: "0 0 24 24",
|
|
4346
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4348
|
+
"path",
|
|
4349
|
+
{
|
|
4350
|
+
strokeLinecap: "round",
|
|
4351
|
+
strokeLinejoin: "round",
|
|
4352
|
+
strokeWidth: "1.5",
|
|
4353
|
+
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"
|
|
4354
|
+
}
|
|
4355
|
+
)
|
|
4356
|
+
}
|
|
4357
|
+
) }) }),
|
|
4358
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
4359
|
+
/* @__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." })
|
|
4360
|
+
] });
|
|
4361
|
+
};
|
|
4362
|
+
var NoDataFound_default = NoDataFound;
|
|
4363
|
+
|
|
4364
|
+
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4365
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4366
|
+
function toCamelCase(str) {
|
|
4367
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
4368
|
+
}
|
|
4369
|
+
function convertKeysToCamelCase(obj) {
|
|
4370
|
+
if (!obj || typeof obj !== "object") return obj;
|
|
4371
|
+
if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
|
|
4372
|
+
return Object.fromEntries(
|
|
4373
|
+
Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [
|
|
4374
|
+
toCamelCase(key),
|
|
4375
|
+
convertKeysToCamelCase(value)
|
|
4376
|
+
])
|
|
4377
|
+
);
|
|
4378
|
+
}
|
|
4379
|
+
var getNestedValue = (obj, path) => {
|
|
4380
|
+
if (!obj || !path) return void 0;
|
|
4381
|
+
return path.split(".").reduce((current, key) => {
|
|
4382
|
+
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4383
|
+
}, obj);
|
|
4384
|
+
};
|
|
4385
|
+
function generateCompleteBackgroundString(layers, resolveAssetUrl, apiBaseUrl) {
|
|
4386
|
+
if (!layers || !Array.isArray(layers)) return "";
|
|
4387
|
+
return layers.filter((layer) => layer && layer.type && layer.value).map((layer) => {
|
|
4388
|
+
if (layer.type === "image" && typeof layer.value === "object") {
|
|
4389
|
+
const imageValue = layer.value;
|
|
4390
|
+
if (!imageValue.assetUrl) return "";
|
|
4391
|
+
const resolvedAssetUrl = resolveAssetUrl?.(imageValue.assetUrl) ?? AssetUtility_default.resolveUrl(apiBaseUrl, imageValue.assetUrl);
|
|
4392
|
+
if (!resolvedAssetUrl) return "";
|
|
4393
|
+
const url = `url('${resolvedAssetUrl}')`;
|
|
4394
|
+
const repeat = layer.repeat || "no-repeat";
|
|
4395
|
+
const position = layer.position || "center";
|
|
4396
|
+
const size = layer.size || "auto";
|
|
4397
|
+
const attachment = layer.attachment || "scroll";
|
|
4398
|
+
return `${url} ${position} / ${size} ${repeat} ${attachment}`;
|
|
4399
|
+
}
|
|
4400
|
+
if (layer.type === "gradient" && typeof layer.value === "object") {
|
|
4401
|
+
const gradient = layer.value;
|
|
4402
|
+
if (!gradient.colors || !gradient.direction) return "";
|
|
4403
|
+
const colors = gradient.colors.map(
|
|
4404
|
+
(colorStop) => `color-mix(in srgb, ${colorStop.color}, transparent ${colorStop.transparency ?? 0}%) ${colorStop.start || "0%"}`
|
|
4405
|
+
).join(", ");
|
|
4406
|
+
return `linear-gradient(${gradient.direction}, ${colors})`;
|
|
4407
|
+
}
|
|
4408
|
+
return "";
|
|
4409
|
+
}).filter((bg) => bg.trim() !== "").join(", ");
|
|
4410
|
+
}
|
|
4411
|
+
var generateCssString = (guid, stylesObject, mobileStylesObject) => {
|
|
4412
|
+
let gridColumns = stylesObject.gridTemplateColumns ? stylesObject.gridTemplateColumns.match(/\d+/g) : [];
|
|
4413
|
+
let hasGridProperties = gridColumns.length > 0;
|
|
4414
|
+
let largeCols = hasGridProperties ? parseInt(gridColumns[0]) : 4;
|
|
4415
|
+
let tabletColumns = hasGridProperties ? Math.ceil(parseInt(gridColumns[0]) / 2) : 2;
|
|
4416
|
+
let mobileColumns = 1;
|
|
4417
|
+
let cssRules = Object.entries(stylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4418
|
+
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4419
|
+
return `${cssKey}: ${value};`;
|
|
4420
|
+
});
|
|
4421
|
+
let css = `#${guid} {
|
|
4422
|
+
${cssRules.join(
|
|
4423
|
+
"\n"
|
|
4424
|
+
)}
|
|
4425
|
+
transition: all 0.3s ease-in-out; }`;
|
|
4426
|
+
if (mobileStylesObject) {
|
|
4427
|
+
let mobileCssRules = Object.entries(mobileStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4428
|
+
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4429
|
+
return `${cssKey}: ${value};`;
|
|
4430
|
+
});
|
|
4431
|
+
if (mobileCssRules.length > 0) {
|
|
4432
|
+
css += `
|
|
4433
|
+
@media (max-width: 480px) { #${guid} {
|
|
4434
|
+
${mobileCssRules.join(
|
|
4435
|
+
"\n"
|
|
4436
|
+
)}
|
|
4437
|
+
} }`;
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4440
|
+
if (hasGridProperties) {
|
|
4441
|
+
css += `
|
|
4442
|
+
@media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
4443
|
+
css += `
|
|
4444
|
+
@media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
4445
|
+
css += `
|
|
4446
|
+
@media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
|
|
3630
4447
|
}
|
|
3631
|
-
|
|
4448
|
+
const output = {
|
|
4449
|
+
css,
|
|
4450
|
+
gridColsLarge: largeCols,
|
|
4451
|
+
gridColsMedium: tabletColumns,
|
|
4452
|
+
gridColsSmall: mobileColumns
|
|
4453
|
+
};
|
|
4454
|
+
return output;
|
|
4455
|
+
};
|
|
4456
|
+
var DivContainer = async (props) => {
|
|
4457
|
+
const NodeTypes2 = {
|
|
4458
|
+
paragraph: ParagraphNode_default,
|
|
4459
|
+
heading: HeadingNode_default,
|
|
4460
|
+
list: ListNode_default,
|
|
4461
|
+
quote: QuoteNode_default,
|
|
4462
|
+
code: CodeNode_default,
|
|
4463
|
+
image: ImageNode_default,
|
|
4464
|
+
horizontalrule: HorizontalRuleNode_default,
|
|
4465
|
+
"layout-container": LayoutContainerNode_default,
|
|
4466
|
+
widget: WidgetNode_default,
|
|
4467
|
+
embed: EmbedNode_default,
|
|
4468
|
+
"div-container": DivContainer,
|
|
4469
|
+
text: TextNode_default,
|
|
4470
|
+
datafield: DatafieldNode_default,
|
|
4471
|
+
"svg-icon": SVGIconNode_default
|
|
4472
|
+
};
|
|
4473
|
+
const styles = props.node.cssProperties;
|
|
4474
|
+
const mobileStyles = props.node.mobileCssProperties;
|
|
4475
|
+
const dataBindingProperties = props.node.dataBinding;
|
|
4476
|
+
const updatedStyles = convertKeysToCamelCase(styles);
|
|
4477
|
+
var background = generateCompleteBackgroundString(
|
|
4478
|
+
props.node.backgroundLayers,
|
|
4479
|
+
props.resolveAssetUrl,
|
|
4480
|
+
props.apiBaseUrl
|
|
4481
|
+
);
|
|
3632
4482
|
let containerPaddingClass = "";
|
|
3633
4483
|
if (props.node.containerPadding == "small") {
|
|
3634
4484
|
containerPaddingClass = "container-small";
|
|
@@ -3637,103 +4487,190 @@ var DivContainer = (props) => {
|
|
|
3637
4487
|
}
|
|
3638
4488
|
const updatedStyle = { ...updatedStyles };
|
|
3639
4489
|
const backgroundStyle = background && background !== "" ? { background } : {};
|
|
4490
|
+
const combinedStyles = {
|
|
4491
|
+
...backgroundStyle
|
|
4492
|
+
};
|
|
4493
|
+
if (props.node.enableBackgroundClipText) {
|
|
4494
|
+
combinedStyles.WebkitBackgroundClip = "text";
|
|
4495
|
+
combinedStyles.backgroundClip = "text";
|
|
4496
|
+
}
|
|
3640
4497
|
const guid = "css" + crypto.randomUUID().toLocaleLowerCase();
|
|
3641
|
-
const
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
4498
|
+
const { enterAnimation, exitAnimation, hoverAnimation } = props.node;
|
|
4499
|
+
let animationCSS = "";
|
|
4500
|
+
if (enterAnimation?.name) {
|
|
4501
|
+
animationCSS += AnimationUtility_default.generateAnimationCSS(
|
|
4502
|
+
{ animation: enterAnimation.name, mode: "enter", ...enterAnimation.properties },
|
|
4503
|
+
`#${guid}`
|
|
4504
|
+
);
|
|
4505
|
+
}
|
|
4506
|
+
if (hoverAnimation?.name) {
|
|
4507
|
+
animationCSS += AnimationUtility_default.generateAnimationCSS(
|
|
4508
|
+
{ animation: hoverAnimation.name, mode: "hover", ...hoverAnimation.properties },
|
|
4509
|
+
`#${guid}`
|
|
4510
|
+
);
|
|
4511
|
+
}
|
|
4512
|
+
const shouldHideContainer = () => {
|
|
4513
|
+
if (!props.node.fieldVisibleOnTrue) return false;
|
|
4514
|
+
const fieldValue = getNestedValue(props.dataitem, props.node.fieldVisibleOnTrue);
|
|
4515
|
+
return fieldValue !== void 0 && fieldValue === false;
|
|
4516
|
+
};
|
|
4517
|
+
const isHidden = shouldHideContainer();
|
|
4518
|
+
let odataString = void 0;
|
|
4519
|
+
let endpoint = void 0;
|
|
4520
|
+
let result = null;
|
|
4521
|
+
let response = null;
|
|
4522
|
+
let childCollectionData = null;
|
|
4523
|
+
if (dataBindingProperties) {
|
|
4524
|
+
endpoint = dataBindingProperties.dataSource;
|
|
4525
|
+
endpoint = endpoint.replace(/\{(\w+)\}/g, (_, key) => {
|
|
4526
|
+
return props.routeParameters?.[key] ?? `{${key}}`;
|
|
3649
4527
|
});
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
if (hoverStylesObject) {
|
|
3656
|
-
let hoverCssRules = Object.entries(hoverStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
3657
|
-
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3658
|
-
return `${cssKey}: ${value};`;
|
|
3659
|
-
});
|
|
3660
|
-
if (hoverCssRules.length > 0) {
|
|
3661
|
-
css2 += `
|
|
3662
|
-
#${guid}:hover {
|
|
3663
|
-
${hoverCssRules.join("\n")}
|
|
3664
|
-
}`;
|
|
4528
|
+
if (dataBindingProperties.applyODataParams) {
|
|
4529
|
+
odataString = OdataBuilder.getOdataQueryString(props.query);
|
|
4530
|
+
if (odataString) {
|
|
4531
|
+
const separator = endpoint.includes("?") ? "&" : "?";
|
|
4532
|
+
endpoint += separator + odataString;
|
|
3665
4533
|
}
|
|
3666
4534
|
}
|
|
3667
|
-
if (
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
4535
|
+
if (props.serviceClient) {
|
|
4536
|
+
response = await props.serviceClient.get(endpoint);
|
|
4537
|
+
result = response?.result;
|
|
4538
|
+
} else {
|
|
4539
|
+
console.warn(
|
|
4540
|
+
"DivContainer data binding needs `serviceClient` prop but none was provided."
|
|
4541
|
+
);
|
|
4542
|
+
}
|
|
4543
|
+
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || Array.isArray(result) && result.length == 0)) {
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(NoDataFound_default, {});
|
|
4545
|
+
}
|
|
4546
|
+
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
4547
|
+
childCollectionData = getNestedValue(props.dataitem, dataBindingProperties.childCollectionName);
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4550
|
+
const cssResult = generateCssString(guid, updatedStyle, mobileStyles);
|
|
4551
|
+
function renderNode(node, props2, dataitem, key, href) {
|
|
4552
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4553
|
+
if (!SelectedNode) return null;
|
|
4554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4555
|
+
SelectedNode,
|
|
4556
|
+
{
|
|
4557
|
+
node,
|
|
4558
|
+
parentTag: Wrapper,
|
|
4559
|
+
routeParameters: props2.routeParameters,
|
|
4560
|
+
query: props2.query,
|
|
4561
|
+
session: props2.session,
|
|
4562
|
+
host: props2.host,
|
|
4563
|
+
path: props2.path,
|
|
4564
|
+
apiBaseUrl: props2.apiBaseUrl,
|
|
4565
|
+
serviceClient: props2.serviceClient,
|
|
4566
|
+
resolveAssetUrl: props2.resolveAssetUrl,
|
|
4567
|
+
breadcrumb: props2.breadcrumb,
|
|
4568
|
+
dataitem,
|
|
4569
|
+
href
|
|
3677
4570
|
}
|
|
4571
|
+
) }, key);
|
|
4572
|
+
}
|
|
4573
|
+
function renderChildren(nodes, props2, data, key, href) {
|
|
4574
|
+
if (!nodes) return null;
|
|
4575
|
+
const childNodes = nodes.map((node, index) => {
|
|
4576
|
+
if (node.type === "div-container" && node.dataBinding?.childCollectionName && data) {
|
|
4577
|
+
return renderNode(node, props2, data, index, href);
|
|
4578
|
+
}
|
|
4579
|
+
return renderNode(node, props2, data, index, href);
|
|
4580
|
+
});
|
|
4581
|
+
return childNodes;
|
|
4582
|
+
}
|
|
4583
|
+
function queryObjectToString(query) {
|
|
4584
|
+
if (!query) return "";
|
|
4585
|
+
return Object.entries(query).map(
|
|
4586
|
+
([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`
|
|
4587
|
+
).join("&");
|
|
4588
|
+
}
|
|
4589
|
+
function resolveHrefTemplate(template, dataItem) {
|
|
4590
|
+
return template.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
4591
|
+
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4594
|
+
const dataToRender = (() => {
|
|
4595
|
+
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
4596
|
+
return childCollectionData;
|
|
3678
4597
|
}
|
|
3679
|
-
if (
|
|
3680
|
-
|
|
3681
|
-
@media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
3682
|
-
css2 += `
|
|
3683
|
-
@media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
|
|
3684
|
-
css2 += `
|
|
3685
|
-
@media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
|
|
4598
|
+
if (result && props.node.dataBinding?.responseType === "array") {
|
|
4599
|
+
return result;
|
|
3686
4600
|
}
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
4601
|
+
if (result && props.node.dataBinding?.responseType === "object") {
|
|
4602
|
+
return [result];
|
|
4603
|
+
}
|
|
4604
|
+
return [props.dataitem];
|
|
4605
|
+
})();
|
|
4606
|
+
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
4607
|
+
let Wrapper;
|
|
4608
|
+
let wrapperProps;
|
|
4609
|
+
switch (true) {
|
|
4610
|
+
case props.node.componentProperties?.type === "slider":
|
|
4611
|
+
Wrapper = Slider_default;
|
|
4612
|
+
const largeCols = props.node.componentProperties?.columns || 4;
|
|
4613
|
+
const slidesToShow = {
|
|
4614
|
+
large: largeCols,
|
|
4615
|
+
medium: Math.ceil(largeCols / 2),
|
|
4616
|
+
small: 1
|
|
4617
|
+
};
|
|
4618
|
+
wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
|
|
4619
|
+
break;
|
|
4620
|
+
case !!(props.node.href || props.href):
|
|
4621
|
+
Wrapper = "a";
|
|
4622
|
+
let href = props.node.href || props.href;
|
|
4623
|
+
if (href?.includes("{")) {
|
|
4624
|
+
href = resolveHrefTemplate(href, props.dataitem);
|
|
4625
|
+
}
|
|
4626
|
+
const currentPath = decodeURIComponent(PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query));
|
|
4627
|
+
const resolvedHref = decodeURIComponent(href || "");
|
|
4628
|
+
const isSelected = currentPath === resolvedHref;
|
|
4629
|
+
wrapperProps = { href, "data-isSelected": isSelected, "data-path": currentPath, "data-href": resolvedHref, class: "no-link-color" };
|
|
4630
|
+
break;
|
|
4631
|
+
default: {
|
|
4632
|
+
const replacementTag = props.node.replaceDivTagWith;
|
|
4633
|
+
const allowedTags = ["div", "section", "article", "details", "summary"];
|
|
4634
|
+
if (replacementTag && allowedTags.includes(replacementTag)) {
|
|
4635
|
+
Wrapper = replacementTag;
|
|
4636
|
+
} else {
|
|
4637
|
+
Wrapper = "div";
|
|
4638
|
+
}
|
|
4639
|
+
wrapperProps = {};
|
|
4640
|
+
break;
|
|
4641
|
+
}
|
|
4642
|
+
}
|
|
4643
|
+
if (isHidden) {
|
|
4644
|
+
return null;
|
|
4645
|
+
}
|
|
4646
|
+
const classNames = [
|
|
4647
|
+
containerPaddingClass,
|
|
4648
|
+
props.node.autoFormat && "auto-format",
|
|
4649
|
+
props.node.bgClass
|
|
4650
|
+
].filter(Boolean).join(" ");
|
|
4651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react54.default.Fragment, { children: [
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4653
|
+
/* @__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)(
|
|
4654
|
+
Wrapper,
|
|
3694
4655
|
{
|
|
3695
4656
|
id: guid,
|
|
3696
|
-
style:
|
|
3697
|
-
className:
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
routeParameters: props.routeParameters,
|
|
3705
|
-
query: props.query,
|
|
3706
|
-
session: props.session,
|
|
3707
|
-
host: props.host,
|
|
3708
|
-
path: props.path,
|
|
3709
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3710
|
-
breadcrumb: props.breadcrumb
|
|
3711
|
-
}
|
|
3712
|
-
) }, index);
|
|
3713
|
-
})
|
|
4657
|
+
style: combinedStyles,
|
|
4658
|
+
className: classNames || void 0,
|
|
4659
|
+
...wrapperProps,
|
|
4660
|
+
children: dataToRender.map(
|
|
4661
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4662
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react54.default.Fragment, { children: child }, i)
|
|
4663
|
+
) : renderChildren(props.node.children, props, item, idx)
|
|
4664
|
+
)
|
|
3714
4665
|
}
|
|
3715
|
-
) })
|
|
3716
|
-
|
|
3717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3718
|
-
SelectedNode,
|
|
3719
|
-
{
|
|
3720
|
-
node,
|
|
3721
|
-
routeParameters: props.routeParameters,
|
|
3722
|
-
query: props.query,
|
|
3723
|
-
session: props.session,
|
|
3724
|
-
host: props.host,
|
|
3725
|
-
path: props.path,
|
|
3726
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3727
|
-
breadcrumb: props.breadcrumb
|
|
3728
|
-
}
|
|
3729
|
-
) }, index);
|
|
3730
|
-
}) })
|
|
4666
|
+
) }) }),
|
|
4667
|
+
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 }) })
|
|
3731
4668
|
] });
|
|
3732
4669
|
};
|
|
3733
4670
|
var DivContainer_default = DivContainer;
|
|
3734
4671
|
|
|
3735
4672
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3736
|
-
var
|
|
4673
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3737
4674
|
var NodeTypes = {
|
|
3738
4675
|
["paragraph"]: ParagraphNode_default,
|
|
3739
4676
|
["heading"]: HeadingNode_default,
|
|
@@ -3761,11 +4698,11 @@ var PageBodyRenderer = (props) => {
|
|
|
3761
4698
|
if (pageBodyTree && pageBodyTree.root) {
|
|
3762
4699
|
rootNode = pageBodyTree.root;
|
|
3763
4700
|
}
|
|
3764
|
-
return /* @__PURE__ */ (0,
|
|
4701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
3765
4702
|
{
|
|
3766
4703
|
}
|
|
3767
4704
|
const SelectedNode = NodeTypes[node.type];
|
|
3768
|
-
return /* @__PURE__ */ (0,
|
|
4705
|
+
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)(
|
|
3769
4706
|
SelectedNode,
|
|
3770
4707
|
{
|
|
3771
4708
|
node,
|
|
@@ -3776,9 +4713,11 @@ var PageBodyRenderer = (props) => {
|
|
|
3776
4713
|
host: props.host,
|
|
3777
4714
|
path: props.path,
|
|
3778
4715
|
apiBaseUrl: props.apiBaseUrl,
|
|
3779
|
-
widgetRegistry: props.widgetRegistry
|
|
4716
|
+
widgetRegistry: props.widgetRegistry,
|
|
4717
|
+
serviceClient: props.serviceClient,
|
|
4718
|
+
resolveAssetUrl: props.resolveAssetUrl
|
|
3780
4719
|
}
|
|
3781
|
-
) }) : /* @__PURE__ */ (0,
|
|
4720
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3782
4721
|
SelectedNode,
|
|
3783
4722
|
{
|
|
3784
4723
|
node,
|
|
@@ -3788,7 +4727,9 @@ var PageBodyRenderer = (props) => {
|
|
|
3788
4727
|
host: props.host,
|
|
3789
4728
|
path: props.path,
|
|
3790
4729
|
apiBaseUrl: props.apiBaseUrl,
|
|
3791
|
-
widgetRegistry: props.widgetRegistry
|
|
4730
|
+
widgetRegistry: props.widgetRegistry,
|
|
4731
|
+
serviceClient: props.serviceClient,
|
|
4732
|
+
resolveAssetUrl: props.resolveAssetUrl
|
|
3792
4733
|
}
|
|
3793
4734
|
) }) }) }, index);
|
|
3794
4735
|
}) });
|