@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260323123345 → 0.8.1-dev.20260324072940
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 +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +914 -878
- package/dist/index.mjs +909 -873
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79,6 +79,8 @@ var DateView = (props) => {
|
|
|
79
79
|
let timezone;
|
|
80
80
|
try {
|
|
81
81
|
const val = props.value && props.value.toString().includes("Z") ? props.value : props.value + "Z";
|
|
82
|
+
{
|
|
83
|
+
}
|
|
82
84
|
const parsedDate = new Date(val);
|
|
83
85
|
const timezoneOffset = parsedDate.getTimezoneOffset();
|
|
84
86
|
timezone = import_moment_timezone.default.tz.zone(import_moment_timezone.default.tz.guess())?.abbr(timezoneOffset);
|
|
@@ -196,6 +198,8 @@ var StatusView_default = Status;
|
|
|
196
198
|
var import_react8 = __toESM(require("react"));
|
|
197
199
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
198
200
|
var Money = (props) => {
|
|
201
|
+
{
|
|
202
|
+
}
|
|
199
203
|
const parsedNumber = parseFloat(props.value);
|
|
200
204
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: parsedNumber < 0 ? "text-alert" : "", children: [
|
|
201
205
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-0.5", children: "\u20B9" }),
|
|
@@ -208,6 +212,8 @@ var MoneyView_default = Money;
|
|
|
208
212
|
var import_react9 = __toESM(require("react"));
|
|
209
213
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
210
214
|
var MultilineTextBullets = (props) => {
|
|
215
|
+
{
|
|
216
|
+
}
|
|
211
217
|
const lines = props.value?.split("\\n");
|
|
212
218
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
213
219
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { children: line }, index);
|
|
@@ -240,7 +246,7 @@ var ViewControl = import_react11.default.forwardRef(
|
|
|
240
246
|
[ViewControlTypes_default.booleanView]: BooleanView_default
|
|
241
247
|
// [ViewControlTypes.booleanView]: BooleanView
|
|
242
248
|
};
|
|
243
|
-
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
249
|
+
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
244
250
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react11.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
245
251
|
}
|
|
246
252
|
);
|
|
@@ -2541,17 +2547,17 @@ var DataList = (props) => {
|
|
|
2541
2547
|
var DataList_default = DataList;
|
|
2542
2548
|
|
|
2543
2549
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2544
|
-
var
|
|
2550
|
+
var import_react51 = __toESM(require("react"));
|
|
2545
2551
|
|
|
2546
2552
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2547
2553
|
var import_react36 = __toESM(require("react"));
|
|
2548
2554
|
|
|
2549
2555
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
2550
|
-
var import_jsx_runtime41 =
|
|
2556
|
+
var import_jsx_runtime41 = (
|
|
2557
|
+
// @ts-expect-error custom code
|
|
2558
|
+
require("react/jsx-runtime")
|
|
2559
|
+
);
|
|
2551
2560
|
var TextNode = (props) => {
|
|
2552
|
-
const NodeTypes2 = {
|
|
2553
|
-
["text"]: TextNode
|
|
2554
|
-
};
|
|
2555
2561
|
function cssStringToJson(cssString) {
|
|
2556
2562
|
const styleObject = {};
|
|
2557
2563
|
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
@@ -2599,7 +2605,11 @@ var TextNode = (props) => {
|
|
|
2599
2605
|
}
|
|
2600
2606
|
const styles = convertKeysToCamelCase2(cssStringToJson(props.node.style));
|
|
2601
2607
|
function replacePlaceholders(template, dataItem) {
|
|
2608
|
+
{
|
|
2609
|
+
}
|
|
2602
2610
|
return template.replace(/{(\w+)}/g, (_, key) => {
|
|
2611
|
+
{
|
|
2612
|
+
}
|
|
2603
2613
|
return key in dataItem ? dataItem[key] : `{${key}}`;
|
|
2604
2614
|
});
|
|
2605
2615
|
}
|
|
@@ -2610,7 +2620,7 @@ var TextNode_default = TextNode;
|
|
|
2610
2620
|
|
|
2611
2621
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
2612
2622
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2613
|
-
var LineBreakNode = (
|
|
2623
|
+
var LineBreakNode = () => {
|
|
2614
2624
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
2615
2625
|
};
|
|
2616
2626
|
var LineBreakNode_default = LineBreakNode;
|
|
@@ -2695,12 +2705,18 @@ var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
|
2695
2705
|
function getNestedProperty(obj, path) {
|
|
2696
2706
|
if (!obj || !path) return null;
|
|
2697
2707
|
if (path.includes(".")) {
|
|
2698
|
-
return path.split(".").reduce((prev, curr) =>
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2708
|
+
return path.split(".").reduce((prev, curr) => {
|
|
2709
|
+
if (prev && typeof prev === "object") {
|
|
2710
|
+
return prev[curr];
|
|
2711
|
+
}
|
|
2712
|
+
return null;
|
|
2713
|
+
}, obj);
|
|
2714
|
+
}
|
|
2715
|
+
const value = obj[path];
|
|
2716
|
+
if (Array.isArray(value)) {
|
|
2717
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: String(item) }, index));
|
|
2703
2718
|
}
|
|
2719
|
+
return value;
|
|
2704
2720
|
}
|
|
2705
2721
|
var DatafieldNode = (props) => {
|
|
2706
2722
|
function cssStringToJson(cssString) {
|
|
@@ -2710,9 +2726,7 @@ var DatafieldNode = (props) => {
|
|
|
2710
2726
|
matches.forEach((match) => {
|
|
2711
2727
|
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
2712
2728
|
if (parts && parts.length === 3) {
|
|
2713
|
-
|
|
2714
|
-
const value2 = parts[2].trim();
|
|
2715
|
-
styleObject[property] = value2;
|
|
2729
|
+
styleObject[parts[1].trim()] = parts[2].trim();
|
|
2716
2730
|
}
|
|
2717
2731
|
});
|
|
2718
2732
|
}
|
|
@@ -2722,9 +2736,11 @@ var DatafieldNode = (props) => {
|
|
|
2722
2736
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2723
2737
|
}
|
|
2724
2738
|
function convertKeysToCamelCase2(obj) {
|
|
2725
|
-
if (!obj || typeof obj !== "object") return obj;
|
|
2726
2739
|
return Object.fromEntries(
|
|
2727
|
-
Object.entries(obj).map(([key, value2]) => [
|
|
2740
|
+
Object.entries(obj).map(([key, value2]) => [
|
|
2741
|
+
toCamelCase2(key),
|
|
2742
|
+
value2
|
|
2743
|
+
])
|
|
2728
2744
|
);
|
|
2729
2745
|
}
|
|
2730
2746
|
const Formats = [
|
|
@@ -2741,11 +2757,12 @@ var DatafieldNode = (props) => {
|
|
|
2741
2757
|
"italic underline",
|
|
2742
2758
|
"italic underline font-medium"
|
|
2743
2759
|
];
|
|
2744
|
-
const styles = convertKeysToCamelCase2(
|
|
2745
|
-
|
|
2760
|
+
const styles = convertKeysToCamelCase2(
|
|
2761
|
+
cssStringToJson(props.node.style)
|
|
2762
|
+
);
|
|
2763
|
+
const fieldName = props.node.fieldName ?? "";
|
|
2746
2764
|
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
2747
|
-
|
|
2748
|
-
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && Object.keys(value).length === 0;
|
|
2765
|
+
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
2749
2766
|
const maxLines = props.node.maxLines;
|
|
2750
2767
|
if (maxLines && Number(maxLines) > 0) {
|
|
2751
2768
|
Object.assign(styles, {
|
|
@@ -2756,14 +2773,12 @@ var DatafieldNode = (props) => {
|
|
|
2756
2773
|
});
|
|
2757
2774
|
}
|
|
2758
2775
|
const dataType = props.node.dataType;
|
|
2759
|
-
if (isEmptyValue)
|
|
2760
|
-
|
|
2761
|
-
}
|
|
2762
|
-
if (dataType == "rawContent") {
|
|
2776
|
+
if (isEmptyValue) return null;
|
|
2777
|
+
if (dataType === "rawContent") {
|
|
2763
2778
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2764
2779
|
PageBodyRenderer_default,
|
|
2765
2780
|
{
|
|
2766
|
-
rawBody: value ?? `@databound[${fieldName}]
|
|
2781
|
+
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
2767
2782
|
routeParameters: props.routeParameters,
|
|
2768
2783
|
query: props.query,
|
|
2769
2784
|
session: props.session,
|
|
@@ -2780,7 +2795,13 @@ var DatafieldNode = (props) => {
|
|
|
2780
2795
|
{
|
|
2781
2796
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
2782
2797
|
style: styles,
|
|
2783
|
-
children:
|
|
2798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2799
|
+
ViewControl_default,
|
|
2800
|
+
{
|
|
2801
|
+
controlType: dataType,
|
|
2802
|
+
value: value ?? `@databound[${fieldName}]`
|
|
2803
|
+
}
|
|
2804
|
+
)
|
|
2784
2805
|
}
|
|
2785
2806
|
);
|
|
2786
2807
|
};
|
|
@@ -2803,7 +2824,7 @@ var ParagraphNode = (props) => {
|
|
|
2803
2824
|
};
|
|
2804
2825
|
{
|
|
2805
2826
|
}
|
|
2806
|
-
|
|
2827
|
+
const formatClasses = FormatClass[props.node.format] || "";
|
|
2807
2828
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
2808
2829
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
2809
2830
|
if (isInlineOnlyParent) {
|
|
@@ -2848,7 +2869,6 @@ var HeadingNode = (props) => {
|
|
|
2848
2869
|
["text"]: TextNode_default,
|
|
2849
2870
|
["link"]: LinkNode_default,
|
|
2850
2871
|
["svg-icon"]: SVGIconNode_default,
|
|
2851
|
-
// ["linebreak"]: LineBreakNodeNew,
|
|
2852
2872
|
["datafield"]: DatafieldNode_default
|
|
2853
2873
|
};
|
|
2854
2874
|
const HeadingTag = `${props.node.tag}`;
|
|
@@ -2857,7 +2877,7 @@ var HeadingNode = (props) => {
|
|
|
2857
2877
|
};
|
|
2858
2878
|
{
|
|
2859
2879
|
}
|
|
2860
|
-
|
|
2880
|
+
const formatClasses = FormatClass[props.node.format] || "";
|
|
2861
2881
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: import_react37.default.createElement(
|
|
2862
2882
|
HeadingTag,
|
|
2863
2883
|
{ className: formatClasses },
|
|
@@ -3001,8 +3021,10 @@ function CopyButton({ text }) {
|
|
|
3001
3021
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3002
3022
|
var CodeNode = (props) => {
|
|
3003
3023
|
const NodeTypes2 = {
|
|
3024
|
+
// @ts-expect-error custom code
|
|
3004
3025
|
["text"]: TextNode_default,
|
|
3005
3026
|
["linebreak"]: LineBreakNode_default,
|
|
3027
|
+
// @ts-expect-error custom code
|
|
3006
3028
|
["link"]: LinkNode_default
|
|
3007
3029
|
};
|
|
3008
3030
|
const textContent = props.node?.children?.map((node) => {
|
|
@@ -3026,28 +3048,22 @@ var CodeNode_default = CodeNode;
|
|
|
3026
3048
|
|
|
3027
3049
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
3028
3050
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3029
|
-
var HorizontalRuleNode = (
|
|
3051
|
+
var HorizontalRuleNode = () => {
|
|
3030
3052
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("hr", {});
|
|
3031
3053
|
};
|
|
3032
3054
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
3033
3055
|
|
|
3034
|
-
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
3035
|
-
var import_react47 = __toESM(require("react"));
|
|
3036
|
-
|
|
3037
3056
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3038
3057
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3039
3058
|
var ImageNode = (props) => {
|
|
3040
|
-
const { node,
|
|
3041
|
-
let imageUrl;
|
|
3059
|
+
const { node, assetBaseUrl = "" } = props;
|
|
3042
3060
|
if (!node.imageUrl) return null;
|
|
3061
|
+
let imageUrl;
|
|
3043
3062
|
if (node.imageUrl.startsWith("http")) {
|
|
3044
3063
|
imageUrl = node.imageUrl;
|
|
3045
|
-
} else if (resolveAssetUrl) {
|
|
3046
|
-
imageUrl = resolveAssetUrl(node.imageUrl);
|
|
3047
3064
|
} else {
|
|
3048
|
-
imageUrl = `${
|
|
3065
|
+
imageUrl = assetBaseUrl ? `${assetBaseUrl}/${node.imageUrl}` : node.imageUrl;
|
|
3049
3066
|
}
|
|
3050
|
-
if (!imageUrl) return null;
|
|
3051
3067
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_jsx_runtime55.Fragment, { children: node.width ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { width: node.width }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3052
3068
|
"img",
|
|
3053
3069
|
{
|
|
@@ -3073,21 +3089,37 @@ var ImageNode = (props) => {
|
|
|
3073
3089
|
var ImageNode_default = ImageNode;
|
|
3074
3090
|
|
|
3075
3091
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3076
|
-
var import_react43 = require("react");
|
|
3092
|
+
var import_react43 = __toESM(require("react"));
|
|
3093
|
+
|
|
3094
|
+
// src/components/pageRenderingEngine/nodes/WidgetRegistry.tsx
|
|
3095
|
+
var registry = {};
|
|
3096
|
+
var getWidget = (code) => {
|
|
3097
|
+
return registry[code];
|
|
3098
|
+
};
|
|
3099
|
+
|
|
3100
|
+
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3077
3101
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3102
|
+
function resolveWidget(code) {
|
|
3103
|
+
return getWidget(code);
|
|
3104
|
+
}
|
|
3078
3105
|
var WidgetNode = (props) => {
|
|
3079
3106
|
const getWidgetParameters = () => {
|
|
3080
|
-
const widgetInputParameters = {
|
|
3081
|
-
|
|
3107
|
+
const widgetInputParameters = {
|
|
3108
|
+
...props.routeParameters ?? {}
|
|
3109
|
+
};
|
|
3110
|
+
const rawWidgetParams = props.node.widgetParameters ?? props.node.widgetParams;
|
|
3082
3111
|
let widgetParameters = {};
|
|
3083
3112
|
const isJSON = (str) => {
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
return str.startsWith("{") && str.endsWith("}") || str.startsWith("[") && str.endsWith("]");
|
|
3113
|
+
const s = str.trim();
|
|
3114
|
+
return s.startsWith("{") && s.endsWith("}") || s.startsWith("[") && s.endsWith("]");
|
|
3087
3115
|
};
|
|
3088
3116
|
if (rawWidgetParams) {
|
|
3089
3117
|
if (typeof rawWidgetParams === "string" && isJSON(rawWidgetParams)) {
|
|
3090
|
-
|
|
3118
|
+
try {
|
|
3119
|
+
widgetParameters = JSON.parse(rawWidgetParams);
|
|
3120
|
+
} catch {
|
|
3121
|
+
widgetParameters = {};
|
|
3122
|
+
}
|
|
3091
3123
|
} else if (typeof rawWidgetParams === "object") {
|
|
3092
3124
|
widgetParameters = rawWidgetParams;
|
|
3093
3125
|
}
|
|
@@ -3100,9 +3132,11 @@ var WidgetNode = (props) => {
|
|
|
3100
3132
|
return props.routeParameters?.[actualKey] ?? val;
|
|
3101
3133
|
}
|
|
3102
3134
|
return val;
|
|
3103
|
-
}
|
|
3135
|
+
}
|
|
3136
|
+
if (Array.isArray(val)) {
|
|
3104
3137
|
return val.map(resolveValue);
|
|
3105
|
-
}
|
|
3138
|
+
}
|
|
3139
|
+
if (val && typeof val === "object") {
|
|
3106
3140
|
const out = {};
|
|
3107
3141
|
for (const k of Object.keys(val)) {
|
|
3108
3142
|
out[k] = resolveValue(val[k]);
|
|
@@ -3111,80 +3145,366 @@ var WidgetNode = (props) => {
|
|
|
3111
3145
|
}
|
|
3112
3146
|
return val;
|
|
3113
3147
|
};
|
|
3114
|
-
Object.keys(widgetParameters)
|
|
3148
|
+
for (const key of Object.keys(widgetParameters)) {
|
|
3115
3149
|
const rawVal = widgetParameters[key];
|
|
3116
3150
|
if (rawVal === "route") {
|
|
3117
|
-
|
|
3118
|
-
widgetInputParameters[key] = props.path;
|
|
3119
|
-
} else {
|
|
3120
|
-
widgetInputParameters[key] = widgetInputParameters[key] ?? null;
|
|
3121
|
-
}
|
|
3151
|
+
widgetInputParameters[key] = key === "itemPath" ? props.path : widgetInputParameters[key] ?? null;
|
|
3122
3152
|
} else {
|
|
3123
3153
|
widgetInputParameters[key] = resolveValue(rawVal);
|
|
3124
3154
|
}
|
|
3125
|
-
}
|
|
3126
|
-
widgetInputParameters["widgetTitle"] = props.node
|
|
3155
|
+
}
|
|
3156
|
+
widgetInputParameters["widgetTitle"] = props.node.widgetTitle;
|
|
3127
3157
|
return widgetInputParameters;
|
|
3128
3158
|
};
|
|
3129
|
-
const
|
|
3159
|
+
const widgetCode = props.node.widgetCode;
|
|
3160
|
+
const SelectedWidget = resolveWidget(widgetCode);
|
|
3130
3161
|
if (!SelectedWidget) {
|
|
3131
|
-
console.warn("Widget not found:",
|
|
3162
|
+
console.warn("Widget not found:", widgetCode);
|
|
3132
3163
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
3133
3164
|
"Widget not found: ",
|
|
3134
|
-
|
|
3165
|
+
widgetCode
|
|
3135
3166
|
] });
|
|
3136
3167
|
}
|
|
3137
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "container mt-2", children: "..." }), children:
|
|
3138
|
-
|
|
3168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "container mt-2", children: "..." }), children: import_react43.default.createElement(SelectedWidget, {
|
|
3169
|
+
params: getWidgetParameters(),
|
|
3170
|
+
query: props.query,
|
|
3171
|
+
session: props.session,
|
|
3172
|
+
host: props.host,
|
|
3173
|
+
path: props.path,
|
|
3174
|
+
apiBaseUrl: props.apiBaseUrl
|
|
3175
|
+
}) });
|
|
3176
|
+
};
|
|
3177
|
+
var WidgetNode_default = WidgetNode;
|
|
3178
|
+
|
|
3179
|
+
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3180
|
+
var import_react44 = __toESM(require("react"));
|
|
3181
|
+
|
|
3182
|
+
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3183
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3184
|
+
var InputControlNode = (props) => {
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3186
|
+
InputControl_default,
|
|
3139
3187
|
{
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3188
|
+
name: props.node.name,
|
|
3189
|
+
controlType: "lineTextInput",
|
|
3190
|
+
value: props.value,
|
|
3191
|
+
callback: props.callback,
|
|
3192
|
+
attributes: {
|
|
3193
|
+
pattern: props.node.pattern,
|
|
3194
|
+
maxLength: props.node.maxLength,
|
|
3195
|
+
minLength: props.node.minLength,
|
|
3196
|
+
//maxValue:props.node.maxV,
|
|
3197
|
+
//minValue?: number,
|
|
3198
|
+
readOnly: props.node.readOnly,
|
|
3199
|
+
label: "name",
|
|
3200
|
+
//props.node.label,
|
|
3201
|
+
hintText: props.node.hintText,
|
|
3202
|
+
placeholder: props.node.placeholder,
|
|
3203
|
+
required: props.node.required,
|
|
3204
|
+
errorMessage: props.node.errorMessage,
|
|
3205
|
+
helpText: props.node.helpText,
|
|
3206
|
+
autoFocus: props.node.autoFocus
|
|
3207
|
+
}
|
|
3146
3208
|
}
|
|
3147
3209
|
) });
|
|
3148
3210
|
};
|
|
3149
|
-
var
|
|
3211
|
+
var InputControlNode_default = InputControlNode;
|
|
3212
|
+
|
|
3213
|
+
// src/clients/CacheManage.tsx
|
|
3214
|
+
var import_node_cache = __toESM(require("node-cache"));
|
|
3215
|
+
var CacheManager = class _CacheManager {
|
|
3216
|
+
constructor() {
|
|
3217
|
+
this.maxCacheSize = 1e3;
|
|
3218
|
+
this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
|
|
3219
|
+
}
|
|
3220
|
+
static getInstance() {
|
|
3221
|
+
if (!_CacheManager.instance) {
|
|
3222
|
+
_CacheManager.instance = new _CacheManager();
|
|
3223
|
+
}
|
|
3224
|
+
return _CacheManager.instance;
|
|
3225
|
+
}
|
|
3226
|
+
get(key) {
|
|
3227
|
+
return null;
|
|
3228
|
+
}
|
|
3229
|
+
set(key, data, ttl) {
|
|
3230
|
+
}
|
|
3231
|
+
clear() {
|
|
3232
|
+
this.cache.flushAll();
|
|
3233
|
+
}
|
|
3234
|
+
size() {
|
|
3235
|
+
return this.cache.keys().length;
|
|
3236
|
+
}
|
|
3237
|
+
destroy() {
|
|
3238
|
+
this.cache.close();
|
|
3239
|
+
}
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3242
|
+
// src/clients/ServiceClient.tsx
|
|
3243
|
+
var ServerApiError = class extends Error {
|
|
3244
|
+
constructor(data, status) {
|
|
3245
|
+
super(data.message || "---");
|
|
3246
|
+
this.status = status;
|
|
3247
|
+
this.data = data;
|
|
3248
|
+
this.data.isSuccessful = false;
|
|
3249
|
+
}
|
|
3250
|
+
};
|
|
3251
|
+
var ServiceClient = class {
|
|
3252
|
+
constructor(apiBaseUrl, session) {
|
|
3253
|
+
this.cacheManager = CacheManager.getInstance();
|
|
3254
|
+
this.baseUrl = apiBaseUrl;
|
|
3255
|
+
this.session = session;
|
|
3256
|
+
}
|
|
3257
|
+
buildFullPath(path, params) {
|
|
3258
|
+
let updatedPath = path;
|
|
3259
|
+
if (params) {
|
|
3260
|
+
Object.keys(params).forEach((key) => {
|
|
3261
|
+
updatedPath = updatedPath.replace(
|
|
3262
|
+
`{${key}}`,
|
|
3263
|
+
String(params[key])
|
|
3264
|
+
);
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
return this.baseUrl + updatedPath;
|
|
3268
|
+
}
|
|
3269
|
+
getConfig() {
|
|
3270
|
+
const config = { headers: {} };
|
|
3271
|
+
if (this.session) {
|
|
3272
|
+
if (this.session.oAuthToken) {
|
|
3273
|
+
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
3274
|
+
}
|
|
3275
|
+
config.headers["cid"] = this.session.cid || "";
|
|
3276
|
+
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
3277
|
+
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
3278
|
+
}
|
|
3279
|
+
return config;
|
|
3280
|
+
}
|
|
3281
|
+
handleFetchError(error) {
|
|
3282
|
+
console.log(error);
|
|
3283
|
+
const serverApiError = error;
|
|
3284
|
+
if (serverApiError) {
|
|
3285
|
+
return serverApiError.data;
|
|
3286
|
+
}
|
|
3287
|
+
return {
|
|
3288
|
+
message: "There is some error. Please try after sometime.",
|
|
3289
|
+
isSuccessful: false
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
async fetchJsonWithCache(fullPath, config) {
|
|
3293
|
+
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
3294
|
+
const cachedData = this.cacheManager.get(cacheKey);
|
|
3295
|
+
if (cachedData) {
|
|
3296
|
+
return cachedData;
|
|
3297
|
+
}
|
|
3298
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
3299
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
3300
|
+
if (!response.ok) {
|
|
3301
|
+
const apiErrorData = await response.json();
|
|
3302
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
3303
|
+
}
|
|
3304
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
3305
|
+
let revalidate = null;
|
|
3306
|
+
if (cacheControl) {
|
|
3307
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3308
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3309
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3310
|
+
revalidate = maxAge * 1e3;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
const data = await response.json();
|
|
3314
|
+
data.isSuccessful = true;
|
|
3315
|
+
if (revalidate !== null && revalidate > 0) {
|
|
3316
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
3317
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
3318
|
+
}
|
|
3319
|
+
return data;
|
|
3320
|
+
}
|
|
3321
|
+
// private async refreshToken(): Promise<void> {
|
|
3322
|
+
// console.log("*******************calling refresh token***********************");
|
|
3323
|
+
// try {
|
|
3324
|
+
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
3325
|
+
// method: 'POST',
|
|
3326
|
+
// headers: {
|
|
3327
|
+
// 'Content-Type': 'application/json'
|
|
3328
|
+
// },
|
|
3329
|
+
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
3330
|
+
// });
|
|
3331
|
+
// if (!response.ok) {
|
|
3332
|
+
// throw new Error("Failed to refresh token");
|
|
3333
|
+
// }
|
|
3334
|
+
// const responseData = await response.json();
|
|
3335
|
+
// this.session.oAuthToken = responseData.result.accessToken;
|
|
3336
|
+
// if (typeof window === "undefined") {
|
|
3337
|
+
// // Running on the server
|
|
3338
|
+
// } else {
|
|
3339
|
+
// await fetch("/api/login", {
|
|
3340
|
+
// method: "post",
|
|
3341
|
+
// headers: {
|
|
3342
|
+
// "Content-Type": "application/json",
|
|
3343
|
+
// },
|
|
3344
|
+
// body: JSON.stringify({ session: this.session }),
|
|
3345
|
+
// });
|
|
3346
|
+
// }
|
|
3347
|
+
// } catch (error: any) {
|
|
3348
|
+
// throw new Error("Failed to refresh token");
|
|
3349
|
+
// }
|
|
3350
|
+
// }
|
|
3351
|
+
async handleRequest(request) {
|
|
3352
|
+
try {
|
|
3353
|
+
return await request();
|
|
3354
|
+
} catch (error) {
|
|
3355
|
+
throw error;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
async post(path, data) {
|
|
3359
|
+
const request = async () => {
|
|
3360
|
+
const fullPath = this.baseUrl + path;
|
|
3361
|
+
const config = this.getConfig();
|
|
3362
|
+
const response = await fetch(fullPath, {
|
|
3363
|
+
method: "POST",
|
|
3364
|
+
headers: {
|
|
3365
|
+
...config.headers,
|
|
3366
|
+
"Content-Type": "application/json"
|
|
3367
|
+
},
|
|
3368
|
+
body: JSON.stringify(data)
|
|
3369
|
+
});
|
|
3370
|
+
if (!response.ok) {
|
|
3371
|
+
const apiErrorData = await response.json();
|
|
3372
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
3373
|
+
}
|
|
3374
|
+
const responseData = await response.json();
|
|
3375
|
+
responseData.isSuccessful = true;
|
|
3376
|
+
return responseData;
|
|
3377
|
+
};
|
|
3378
|
+
try {
|
|
3379
|
+
return await this.handleRequest(request);
|
|
3380
|
+
} catch (error) {
|
|
3381
|
+
return this.handleFetchError(error);
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
async getSingle(path, params) {
|
|
3385
|
+
const request = async () => {
|
|
3386
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
3387
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3388
|
+
) : void 0;
|
|
3389
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3390
|
+
const config = this.getConfig();
|
|
3391
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
3392
|
+
};
|
|
3393
|
+
try {
|
|
3394
|
+
return await this.handleRequest(request);
|
|
3395
|
+
} catch (error) {
|
|
3396
|
+
return this.handleFetchError(error);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
async get(path, params) {
|
|
3400
|
+
const request = async () => {
|
|
3401
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
3402
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3403
|
+
) : void 0;
|
|
3404
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3405
|
+
const config = this.getConfig();
|
|
3406
|
+
console.log(fullPath);
|
|
3407
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
3408
|
+
};
|
|
3409
|
+
try {
|
|
3410
|
+
return await this.handleRequest(request);
|
|
3411
|
+
} catch (error) {
|
|
3412
|
+
return this.handleFetchError(error);
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
};
|
|
3416
|
+
var ServiceClient_default = ServiceClient;
|
|
3417
|
+
|
|
3418
|
+
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3419
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3420
|
+
var FormContainerNode = (props) => {
|
|
3421
|
+
const NodeTypes2 = {
|
|
3422
|
+
["input-control"]: InputControlNode_default
|
|
3423
|
+
};
|
|
3424
|
+
const { node } = props;
|
|
3425
|
+
const formRef = (0, import_react44.useRef)(null);
|
|
3426
|
+
const initialState = {
|
|
3427
|
+
inputValues: {},
|
|
3428
|
+
lastPropertyChanged: ""
|
|
3429
|
+
};
|
|
3430
|
+
const [formState, dispatch] = (0, import_react44.useReducer)(FormReducer_default, initialState);
|
|
3431
|
+
const handleInputChange = (0, import_react44.useCallback)((updatedValues) => {
|
|
3432
|
+
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
3433
|
+
}, [dispatch]);
|
|
3434
|
+
(0, import_react44.useEffect)(() => {
|
|
3435
|
+
const fetchInitialData = async () => {
|
|
3436
|
+
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
3437
|
+
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
3438
|
+
if (response.isSuccessful) {
|
|
3439
|
+
dispatch({
|
|
3440
|
+
type: FORM_INITIAL_UPDATE,
|
|
3441
|
+
values: response.result,
|
|
3442
|
+
// @ts-expect-error custom code
|
|
3443
|
+
name: "all"
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
};
|
|
3447
|
+
fetchInitialData();
|
|
3448
|
+
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
3449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
3450
|
+
node.children && node.children.map((node2, index) => {
|
|
3451
|
+
{
|
|
3452
|
+
}
|
|
3453
|
+
const SelectedNode = NodeTypes2[node2.type];
|
|
3454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react44.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3455
|
+
InputControlNode_default,
|
|
3456
|
+
{
|
|
3457
|
+
value: formState.inputValues[node2.name],
|
|
3458
|
+
callback: handleInputChange,
|
|
3459
|
+
node: node2
|
|
3460
|
+
}
|
|
3461
|
+
) }, index);
|
|
3462
|
+
}),
|
|
3463
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
3464
|
+
] });
|
|
3465
|
+
};
|
|
3466
|
+
var FormContainerNode_default = FormContainerNode;
|
|
3467
|
+
|
|
3468
|
+
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3469
|
+
var import_react50 = __toESM(require("react"));
|
|
3150
3470
|
|
|
3151
3471
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3152
|
-
var
|
|
3472
|
+
var import_react46 = __toESM(require("react"));
|
|
3153
3473
|
|
|
3154
3474
|
// src/components/IFrameLoaderView.tsx
|
|
3155
|
-
var
|
|
3156
|
-
var
|
|
3475
|
+
var import_react45 = __toESM(require("react"));
|
|
3476
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3157
3477
|
var IFrameLoaderView = (props) => {
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3159
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
3160
|
-
/* @__PURE__ */ (0,
|
|
3161
|
-
/* @__PURE__ */ (0,
|
|
3162
|
-
/* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_react45.default.Fragment, { children: [
|
|
3479
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ml-2", children: [
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
3165
3485
|
] })
|
|
3166
3486
|
] }),
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3168
|
-
/* @__PURE__ */ (0,
|
|
3169
|
-
/* @__PURE__ */ (0,
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3172
|
-
/* @__PURE__ */ (0,
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3487
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
3488
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "animate-pulse", children: [
|
|
3489
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3490
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3491
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3174
3494
|
] }),
|
|
3175
|
-
/* @__PURE__ */ (0,
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "animate-pulse", children: [
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3498
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3499
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3181
3501
|
] }),
|
|
3182
|
-
/* @__PURE__ */ (0,
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3185
|
-
/* @__PURE__ */ (0,
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "animate-pulse", children: [
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3504
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3505
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3188
3508
|
] })
|
|
3189
3509
|
] })
|
|
3190
3510
|
] }) }),
|
|
@@ -3194,12 +3514,12 @@ var IFrameLoaderView = (props) => {
|
|
|
3194
3514
|
var IFrameLoaderView_default = IFrameLoaderView;
|
|
3195
3515
|
|
|
3196
3516
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3197
|
-
var
|
|
3517
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3198
3518
|
var IframeClient = ({ src }) => {
|
|
3199
|
-
const iframeRef = (0,
|
|
3200
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
3201
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3202
|
-
(0,
|
|
3519
|
+
const iframeRef = (0, import_react46.useRef)(null);
|
|
3520
|
+
const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
|
|
3521
|
+
const [isDataFound, setIsDataFound] = (0, import_react46.useState)(null);
|
|
3522
|
+
(0, import_react46.useEffect)(() => {
|
|
3203
3523
|
const handleReceiveMessage = (event) => {
|
|
3204
3524
|
const eventName = event?.data?.eventName;
|
|
3205
3525
|
const payload = event?.data?.payload;
|
|
@@ -3214,7 +3534,7 @@ var IframeClient = ({ src }) => {
|
|
|
3214
3534
|
window.addEventListener("message", handleReceiveMessage);
|
|
3215
3535
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
3216
3536
|
}, []);
|
|
3217
|
-
(0,
|
|
3537
|
+
(0, import_react46.useEffect)(() => {
|
|
3218
3538
|
const handleResize = () => {
|
|
3219
3539
|
if (iframeRef.current) {
|
|
3220
3540
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -3226,13 +3546,14 @@ var IframeClient = ({ src }) => {
|
|
|
3226
3546
|
const handleIframeLoad = () => {
|
|
3227
3547
|
setIsDataFound(true);
|
|
3228
3548
|
};
|
|
3229
|
-
return /* @__PURE__ */ (0,
|
|
3549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3230
3550
|
"iframe",
|
|
3231
3551
|
{
|
|
3232
3552
|
ref: iframeRef,
|
|
3233
3553
|
src,
|
|
3234
3554
|
className: "w-full h-full border-none",
|
|
3235
3555
|
scrolling: "no",
|
|
3556
|
+
style: { height: iframeHeight },
|
|
3236
3557
|
onLoad: handleIframeLoad
|
|
3237
3558
|
}
|
|
3238
3559
|
) }) });
|
|
@@ -3240,7 +3561,7 @@ var IframeClient = ({ src }) => {
|
|
|
3240
3561
|
var IframeClient_default = IframeClient;
|
|
3241
3562
|
|
|
3242
3563
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3243
|
-
var
|
|
3564
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3244
3565
|
var EmbedNode = (props) => {
|
|
3245
3566
|
let src;
|
|
3246
3567
|
if (props.node.provider == "youtube") {
|
|
@@ -3250,106 +3571,10 @@ var EmbedNode = (props) => {
|
|
|
3250
3571
|
} else {
|
|
3251
3572
|
src = props.node.embedSrc;
|
|
3252
3573
|
}
|
|
3253
|
-
return /* @__PURE__ */ (0,
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(IframeClient_default, { src }) });
|
|
3254
3575
|
};
|
|
3255
3576
|
var EmbedNode_default = EmbedNode;
|
|
3256
3577
|
|
|
3257
|
-
// src/components/pageRenderingEngine/nodes/VideoNode.tsx
|
|
3258
|
-
var import_react46 = __toESM(require("react"));
|
|
3259
|
-
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3260
|
-
var VideoNode = (props) => {
|
|
3261
|
-
let src;
|
|
3262
|
-
if (props.node.provider == "youtube") {
|
|
3263
|
-
src = `https://www.youtube-nocookie.com/embed/${props.node.videoId}`;
|
|
3264
|
-
} else if (props.node.provider == "bunny") {
|
|
3265
|
-
src = `https://iframe.mediadelivery.net/embed/${props.node.videoId}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3266
|
-
}
|
|
3267
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.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 }) });
|
|
3268
|
-
};
|
|
3269
|
-
var VideoNode_default = VideoNode;
|
|
3270
|
-
|
|
3271
|
-
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
3272
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3273
|
-
var LayoutItemNode = (props) => {
|
|
3274
|
-
const NodeTypes2 = {
|
|
3275
|
-
["paragraph"]: ParagraphNode_default,
|
|
3276
|
-
["heading"]: HeadingNode_default,
|
|
3277
|
-
["list"]: ListNode_default,
|
|
3278
|
-
["quote"]: QuoteNode_default,
|
|
3279
|
-
["code"]: CodeNode_default,
|
|
3280
|
-
["horizontalrule"]: HorizontalRuleNode_default,
|
|
3281
|
-
["image"]: ImageNode_default,
|
|
3282
|
-
["layout-container"]: LayoutContainerNode_default,
|
|
3283
|
-
["link"]: LinkNode_default,
|
|
3284
|
-
["widget"]: WidgetNode_default,
|
|
3285
|
-
["youtube"]: VideoNode_default,
|
|
3286
|
-
["video"]: VideoNode_default,
|
|
3287
|
-
["embed"]: EmbedNode_default
|
|
3288
|
-
};
|
|
3289
|
-
let cssClasses = "";
|
|
3290
|
-
if (props.order) {
|
|
3291
|
-
cssClasses = "order-" + props.order + " lg:order-1";
|
|
3292
|
-
}
|
|
3293
|
-
if (props.node.itemBoxShadow) {
|
|
3294
|
-
{
|
|
3295
|
-
}
|
|
3296
|
-
cssClasses = cssClasses + " " + (props.node.itemBoxShadow || "");
|
|
3297
|
-
}
|
|
3298
|
-
const styles = {};
|
|
3299
|
-
if (props.node.itemBorderWidth) {
|
|
3300
|
-
styles.borderWidth = props.node.itemBorderWidth;
|
|
3301
|
-
cssClasses = cssClasses + " px-4 py-2";
|
|
3302
|
-
}
|
|
3303
|
-
if (props.node.itemBorderRadius) {
|
|
3304
|
-
styles.borderRadius = props.node.itemBorderRadius;
|
|
3305
|
-
styles.overflow = "hidden";
|
|
3306
|
-
}
|
|
3307
|
-
function removeParagraphsAtStartAndEnd(layoutItem) {
|
|
3308
|
-
let startIndex = 0;
|
|
3309
|
-
{
|
|
3310
|
-
}
|
|
3311
|
-
while (startIndex < layoutItem.children.length && layoutItem.children[startIndex].type === "paragraph" && layoutItem.children[startIndex].children.filter((x) => x.type == "linebreak").length == layoutItem.children[startIndex].children.length) {
|
|
3312
|
-
startIndex++;
|
|
3313
|
-
}
|
|
3314
|
-
let endIndex = layoutItem.children.length - 1;
|
|
3315
|
-
{
|
|
3316
|
-
}
|
|
3317
|
-
while (endIndex >= 0 && layoutItem.children[endIndex].type === "paragraph" && layoutItem.children[endIndex].children.filter((x) => x.type == "linebreak").length == layoutItem.children[endIndex].children.length) {
|
|
3318
|
-
endIndex--;
|
|
3319
|
-
}
|
|
3320
|
-
if (startIndex <= endIndex) {
|
|
3321
|
-
layoutItem.children = layoutItem.children.slice(startIndex, endIndex + 1);
|
|
3322
|
-
} else {
|
|
3323
|
-
layoutItem.children = [];
|
|
3324
|
-
}
|
|
3325
|
-
return layoutItem;
|
|
3326
|
-
}
|
|
3327
|
-
let updatedLayout = props.node;
|
|
3328
|
-
if (props.node.itemBoxShadow || props.node.itemBorderWidth) {
|
|
3329
|
-
updatedLayout = props.node;
|
|
3330
|
-
} else {
|
|
3331
|
-
updatedLayout = removeParagraphsAtStartAndEnd(props.node);
|
|
3332
|
-
}
|
|
3333
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "layout-item " + cssClasses, style: { ...styles }, children: updatedLayout.children.map((node, index) => {
|
|
3334
|
-
{
|
|
3335
|
-
}
|
|
3336
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react47.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3338
|
-
SelectedNode,
|
|
3339
|
-
{
|
|
3340
|
-
node,
|
|
3341
|
-
routeParameters: props.routeParameters,
|
|
3342
|
-
query: props.query,
|
|
3343
|
-
session: props.session,
|
|
3344
|
-
host: props.host,
|
|
3345
|
-
path: props.path,
|
|
3346
|
-
apiBaseUrl: props.apiBaseUrl
|
|
3347
|
-
}
|
|
3348
|
-
) }, index);
|
|
3349
|
-
}) }) });
|
|
3350
|
-
};
|
|
3351
|
-
var LayoutItemNode_default = LayoutItemNode;
|
|
3352
|
-
|
|
3353
3578
|
// src/components/utilities/AssetUtility.tsx
|
|
3354
3579
|
var AssetUtility = class {
|
|
3355
3580
|
constructor() {
|
|
@@ -3363,573 +3588,9 @@ var AssetUtility = class {
|
|
|
3363
3588
|
};
|
|
3364
3589
|
var AssetUtility_default = AssetUtility;
|
|
3365
3590
|
|
|
3366
|
-
// src/components/
|
|
3591
|
+
// src/components/Slider.tsx
|
|
3592
|
+
var import_react47 = __toESM(require("react"));
|
|
3367
3593
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3368
|
-
var LayoutContainerNode = (props) => {
|
|
3369
|
-
const VERTICAL_ALIGNMENT_CLASSES = {
|
|
3370
|
-
start: "items-start",
|
|
3371
|
-
center: "items-center place-content-center",
|
|
3372
|
-
end: "items-end",
|
|
3373
|
-
stretch: "items-stretch",
|
|
3374
|
-
baseline: "items-baseline"
|
|
3375
|
-
};
|
|
3376
|
-
const LAYOUTGRID_COLS_CLASSES = {
|
|
3377
|
-
"1fr": "layout-grid-col-1",
|
|
3378
|
-
"1fr 1fr": "layout-grid-col-2-equal",
|
|
3379
|
-
"1fr 2fr": "layout-grid-col-2-widths-33-67",
|
|
3380
|
-
"2fr 1fr": "layout-grid-col-2-widths-67-33",
|
|
3381
|
-
"3fr 2fr": "layout-grid-col-2-widths-60-40",
|
|
3382
|
-
"3fr 1fr": "layout-grid-col-2-widths-75-25",
|
|
3383
|
-
"1fr 1fr 1fr": "layout-grid-col-3-equal",
|
|
3384
|
-
"1fr 2fr 1fr": "layout-grid-col-3-widths-25-50-25",
|
|
3385
|
-
"1fr 6fr 1fr": "layout-grid-col-3-widths-15-70-15",
|
|
3386
|
-
"1fr 1fr 1fr 1fr": "layout-grid-col-4-equal"
|
|
3387
|
-
};
|
|
3388
|
-
const sectionWidth = props.node.sectionWidth || "fixed";
|
|
3389
|
-
let gridCssClasses = LAYOUTGRID_COLS_CLASSES[props.node.templateColumns] || "";
|
|
3390
|
-
if (props.node.contentVerticalAlignment) {
|
|
3391
|
-
gridCssClasses += " " + (VERTICAL_ALIGNMENT_CLASSES[props.node.contentVerticalAlignment] || "");
|
|
3392
|
-
}
|
|
3393
|
-
const columnGap = props.node.columnGap || "0.5rem";
|
|
3394
|
-
const styles = {};
|
|
3395
|
-
let cssClasses = "layout_grid";
|
|
3396
|
-
let addPadding = false;
|
|
3397
|
-
if (props.node.backgroundColor) {
|
|
3398
|
-
styles.backgroundColor = props.node.backgroundColor;
|
|
3399
|
-
}
|
|
3400
|
-
if (props.node.borderWidth) {
|
|
3401
|
-
styles.borderWidth = props.node.borderWidth;
|
|
3402
|
-
addPadding = true;
|
|
3403
|
-
}
|
|
3404
|
-
if (props.node.borderRadius) {
|
|
3405
|
-
styles.borderRadius = props.node.borderRadius;
|
|
3406
|
-
}
|
|
3407
|
-
if (props.node.boxShadow && props.node.boxShadow !== "shadow-none") {
|
|
3408
|
-
cssClasses += " " + props.node.boxShadow;
|
|
3409
|
-
addPadding = true;
|
|
3410
|
-
}
|
|
3411
|
-
const backgroundLayers = [];
|
|
3412
|
-
if (props.node.backgroundImage) {
|
|
3413
|
-
const resolved = AssetUtility_default.resolveUrl(
|
|
3414
|
-
props.apiBaseUrl,
|
|
3415
|
-
props.node.backgroundImage
|
|
3416
|
-
);
|
|
3417
|
-
if (resolved) {
|
|
3418
|
-
backgroundLayers.push(`url('${resolved}')`);
|
|
3419
|
-
addPadding = true;
|
|
3420
|
-
}
|
|
3421
|
-
}
|
|
3422
|
-
if (props.node.gradientColor1 && props.node.gradientColor2) {
|
|
3423
|
-
backgroundLayers.push(
|
|
3424
|
-
`linear-gradient(to bottom, ${props.node.gradientColor1}, ${props.node.gradientColor2})`
|
|
3425
|
-
);
|
|
3426
|
-
addPadding = true;
|
|
3427
|
-
} else if (props.node.gradientColor1) {
|
|
3428
|
-
backgroundLayers.push(props.node.gradientColor1);
|
|
3429
|
-
addPadding = true;
|
|
3430
|
-
} else if (props.node.gradientColor2) {
|
|
3431
|
-
backgroundLayers.push(props.node.gradientColor2);
|
|
3432
|
-
addPadding = true;
|
|
3433
|
-
}
|
|
3434
|
-
if (backgroundLayers.length) {
|
|
3435
|
-
styles.background = backgroundLayers.join(", ");
|
|
3436
|
-
}
|
|
3437
|
-
const renderChildren = () => props.node.children?.map((node, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3438
|
-
LayoutItemNode_default,
|
|
3439
|
-
{
|
|
3440
|
-
node,
|
|
3441
|
-
order: props.node.smOrder === "reverse" ? props.node.children.length - index : index,
|
|
3442
|
-
routeParameters: props.routeParameters,
|
|
3443
|
-
query: props.query,
|
|
3444
|
-
session: props.session,
|
|
3445
|
-
host: props.host,
|
|
3446
|
-
path: props.path,
|
|
3447
|
-
apiBaseUrl: props.apiBaseUrl
|
|
3448
|
-
},
|
|
3449
|
-
index
|
|
3450
|
-
));
|
|
3451
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
3452
|
-
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)(
|
|
3453
|
-
"div",
|
|
3454
|
-
{
|
|
3455
|
-
className: `grid gap-y-4 lg:gap-y-0 ${gridCssClasses} ${addPadding ? "py-8 lg:py-6" : ""}`,
|
|
3456
|
-
style: { columnGap, minHeight: props.node.height },
|
|
3457
|
-
children: renderChildren()
|
|
3458
|
-
}
|
|
3459
|
-
) }) }),
|
|
3460
|
-
sectionWidth === "full" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3461
|
-
"div",
|
|
3462
|
-
{
|
|
3463
|
-
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "p-8 lg:p-0" : ""}`,
|
|
3464
|
-
style: { columnGap, ...styles },
|
|
3465
|
-
children: renderChildren()
|
|
3466
|
-
}
|
|
3467
|
-
),
|
|
3468
|
-
sectionWidth === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "container", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3469
|
-
"div",
|
|
3470
|
-
{
|
|
3471
|
-
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "px-8 py-6 lg:px-6 lg:py-6" : ""}`,
|
|
3472
|
-
style: { columnGap, ...styles },
|
|
3473
|
-
children: renderChildren()
|
|
3474
|
-
}
|
|
3475
|
-
) })
|
|
3476
|
-
] });
|
|
3477
|
-
};
|
|
3478
|
-
var LayoutContainerNode_default = LayoutContainerNode;
|
|
3479
|
-
|
|
3480
|
-
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3481
|
-
var import_react48 = __toESM(require("react"));
|
|
3482
|
-
|
|
3483
|
-
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3484
|
-
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3485
|
-
var InputControlNode = (props) => {
|
|
3486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3487
|
-
InputControl_default,
|
|
3488
|
-
{
|
|
3489
|
-
name: props.node.name,
|
|
3490
|
-
controlType: "lineTextInput",
|
|
3491
|
-
value: props.value,
|
|
3492
|
-
callback: props.callback,
|
|
3493
|
-
attributes: {
|
|
3494
|
-
pattern: props.node.pattern,
|
|
3495
|
-
maxLength: props.node.maxLength,
|
|
3496
|
-
minLength: props.node.minLength,
|
|
3497
|
-
//maxValue:props.node.maxV,
|
|
3498
|
-
//minValue?: number,
|
|
3499
|
-
readOnly: props.node.readOnly,
|
|
3500
|
-
label: "name",
|
|
3501
|
-
//props.node.label,
|
|
3502
|
-
hintText: props.node.hintText,
|
|
3503
|
-
placeholder: props.node.placeholder,
|
|
3504
|
-
required: props.node.required,
|
|
3505
|
-
errorMessage: props.node.errorMessage,
|
|
3506
|
-
helpText: props.node.helpText,
|
|
3507
|
-
autoFocus: props.node.autoFocus
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
) });
|
|
3511
|
-
};
|
|
3512
|
-
var InputControlNode_default = InputControlNode;
|
|
3513
|
-
|
|
3514
|
-
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3515
|
-
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3516
|
-
var FormContainerNode = (props) => {
|
|
3517
|
-
const NodeTypes2 = {
|
|
3518
|
-
["input-control"]: InputControlNode_default
|
|
3519
|
-
};
|
|
3520
|
-
const { node } = props;
|
|
3521
|
-
const formRef = (0, import_react48.useRef)(null);
|
|
3522
|
-
const initialState = {
|
|
3523
|
-
inputValues: {},
|
|
3524
|
-
lastPropertyChanged: ""
|
|
3525
|
-
};
|
|
3526
|
-
const [formState, dispatch] = (0, import_react48.useReducer)(FormReducer_default, initialState);
|
|
3527
|
-
const handleInputChange = (0, import_react48.useCallback)((updatedValues) => {
|
|
3528
|
-
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
3529
|
-
}, [dispatch]);
|
|
3530
|
-
const onValidate = async () => {
|
|
3531
|
-
if (formRef.current && !formRef.current.checkValidity()) {
|
|
3532
|
-
formRef.current.classList.add("validated");
|
|
3533
|
-
return false;
|
|
3534
|
-
} else {
|
|
3535
|
-
return true;
|
|
3536
|
-
}
|
|
3537
|
-
};
|
|
3538
|
-
(0, import_react48.useEffect)(() => {
|
|
3539
|
-
const fetchInitialData = async () => {
|
|
3540
|
-
if (!props.fetchData || !node.dataFetchApi) return;
|
|
3541
|
-
const response = await props.fetchData(
|
|
3542
|
-
node.dataFetchApi,
|
|
3543
|
-
props.routeParameters
|
|
3544
|
-
);
|
|
3545
|
-
if (response?.isSuccessful) {
|
|
3546
|
-
dispatch({
|
|
3547
|
-
type: FORM_INITIAL_UPDATE,
|
|
3548
|
-
values: response.result,
|
|
3549
|
-
name: "all"
|
|
3550
|
-
});
|
|
3551
|
-
}
|
|
3552
|
-
};
|
|
3553
|
-
fetchInitialData();
|
|
3554
|
-
}, [props.fetchData, node.dataFetchApi, props.routeParameters]);
|
|
3555
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
3556
|
-
node.children && node.children.map((node2, index) => {
|
|
3557
|
-
{
|
|
3558
|
-
}
|
|
3559
|
-
const SelectedNode = NodeTypes2[node2.type];
|
|
3560
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react48.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3561
|
-
InputControlNode_default,
|
|
3562
|
-
{
|
|
3563
|
-
value: formState.inputValues[node2.name],
|
|
3564
|
-
callback: handleInputChange,
|
|
3565
|
-
node: node2
|
|
3566
|
-
}
|
|
3567
|
-
) }, index);
|
|
3568
|
-
}),
|
|
3569
|
-
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
3570
|
-
] });
|
|
3571
|
-
};
|
|
3572
|
-
var FormContainerNode_default = FormContainerNode;
|
|
3573
|
-
|
|
3574
|
-
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3575
|
-
var import_react52 = __toESM(require("react"));
|
|
3576
|
-
|
|
3577
|
-
// src/components/utilities/AnimationUtility.tsx
|
|
3578
|
-
var AnimationUtility = class {
|
|
3579
|
-
static generateAnimationCSS(config, guid) {
|
|
3580
|
-
const {
|
|
3581
|
-
duration = 700,
|
|
3582
|
-
delay = 0,
|
|
3583
|
-
easing = "ease-out",
|
|
3584
|
-
distance = 30,
|
|
3585
|
-
scaleStart = 1,
|
|
3586
|
-
scaleEnd = 1.2,
|
|
3587
|
-
repeat = 1,
|
|
3588
|
-
intensity = 20,
|
|
3589
|
-
speedPerChar = 100,
|
|
3590
|
-
cursor = true,
|
|
3591
|
-
mode = "enter",
|
|
3592
|
-
direction = "left"
|
|
3593
|
-
// Default direction
|
|
3594
|
-
} = config;
|
|
3595
|
-
let base = "", visible = "", keyframes = "";
|
|
3596
|
-
switch (config.animation) {
|
|
3597
|
-
case "Fade":
|
|
3598
|
-
base = `opacity:0; transition:opacity ${duration}ms ${easing} ${delay}ms;`;
|
|
3599
|
-
visible = `opacity:1;`;
|
|
3600
|
-
break;
|
|
3601
|
-
case "FadeInUp":
|
|
3602
|
-
base = `opacity:0; transform:translateY(${distance}px); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3603
|
-
visible = `opacity:1; transform:translateY(0);`;
|
|
3604
|
-
break;
|
|
3605
|
-
case "Slide":
|
|
3606
|
-
const slideTransform = this.getSlideTransform(direction, distance);
|
|
3607
|
-
base = `opacity:0; transform:${slideTransform.start}; transition:all ${duration}ms ${easing} ${delay}ms; will-change: transform, opacity;`;
|
|
3608
|
-
visible = `opacity:1; transform:${slideTransform.end}; will-change: unset;`;
|
|
3609
|
-
break;
|
|
3610
|
-
case "ZoomIn":
|
|
3611
|
-
if (mode === "enter") {
|
|
3612
|
-
base = `opacity:0; transform:scale(${scaleStart}); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3613
|
-
visible = `opacity:1; transform:scale(${scaleEnd});`;
|
|
3614
|
-
} else {
|
|
3615
|
-
base = `transform:scale(${scaleStart}); transition:transform ${duration / 1e3}s ${easing} ${delay / 1e3}s;`;
|
|
3616
|
-
visible = `transform:scale(${scaleEnd});`;
|
|
3617
|
-
}
|
|
3618
|
-
break;
|
|
3619
|
-
case "Bounce":
|
|
3620
|
-
keyframes = `
|
|
3621
|
-
@keyframes bounce {
|
|
3622
|
-
0%,20%,50%,80%,100% { transform: translateY(0); }
|
|
3623
|
-
40% { transform: translateY(-${intensity}px); }
|
|
3624
|
-
60% { transform: translateY(-${intensity / 2}px); }
|
|
3625
|
-
}
|
|
3626
|
-
`;
|
|
3627
|
-
if (mode === "enter") {
|
|
3628
|
-
base = `opacity:0;`;
|
|
3629
|
-
visible = `opacity:1; animation:bounce ${duration}ms ${easing} ${delay}ms ${repeat};`;
|
|
3630
|
-
} else {
|
|
3631
|
-
base = ``;
|
|
3632
|
-
visible = `animation:bounce ${duration / 1e3}s ${easing} ${delay / 1e3}s ${repeat};`;
|
|
3633
|
-
}
|
|
3634
|
-
break;
|
|
3635
|
-
case "Typewriter":
|
|
3636
|
-
keyframes = `
|
|
3637
|
-
@keyframes typewriter { from { width: 0 } to { width: 100% } }
|
|
3638
|
-
@keyframes blink { 50% { border-color: transparent } }
|
|
3639
|
-
`;
|
|
3640
|
-
base = `
|
|
3641
|
-
overflow:hidden;
|
|
3642
|
-
border-right:${cursor ? "2px solid black" : "none"};
|
|
3643
|
-
white-space:nowrap;
|
|
3644
|
-
width:0;
|
|
3645
|
-
margin:0 auto;
|
|
3646
|
-
`;
|
|
3647
|
-
visible = `
|
|
3648
|
-
animation:typewriter ${speedPerChar * 30}ms steps(30,end) ${delay}ms forwards
|
|
3649
|
-
${cursor ? ", blink .75s step-end infinite" : ""};
|
|
3650
|
-
`;
|
|
3651
|
-
break;
|
|
3652
|
-
}
|
|
3653
|
-
if (mode === "hover") {
|
|
3654
|
-
return `
|
|
3655
|
-
${keyframes}
|
|
3656
|
-
${guid} { ${base} }
|
|
3657
|
-
${guid}:hover { ${visible} }
|
|
3658
|
-
`;
|
|
3659
|
-
} else {
|
|
3660
|
-
return `
|
|
3661
|
-
${keyframes}
|
|
3662
|
-
${guid} { ${base} }
|
|
3663
|
-
${guid}.visible { ${visible} }
|
|
3664
|
-
`;
|
|
3665
|
-
}
|
|
3666
|
-
}
|
|
3667
|
-
// Helper method to generate slide transforms based on direction
|
|
3668
|
-
static getSlideTransform(direction, distance) {
|
|
3669
|
-
switch (direction) {
|
|
3670
|
-
case "left":
|
|
3671
|
-
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
3672
|
-
case "right":
|
|
3673
|
-
return { start: `translateX(-${distance}px)`, end: `translateX(0)` };
|
|
3674
|
-
case "up":
|
|
3675
|
-
return { start: `translateY(${distance}px)`, end: `translateY(0)` };
|
|
3676
|
-
case "down":
|
|
3677
|
-
return { start: `translateY(-${distance}px)`, end: `translateY(0)` };
|
|
3678
|
-
default:
|
|
3679
|
-
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
3680
|
-
}
|
|
3681
|
-
}
|
|
3682
|
-
};
|
|
3683
|
-
var AnimationUtility_default = AnimationUtility;
|
|
3684
|
-
|
|
3685
|
-
// src/components/Pagination.tsx
|
|
3686
|
-
var import_react49 = require("react");
|
|
3687
|
-
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3688
|
-
var Pagination = (props) => {
|
|
3689
|
-
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
3690
|
-
const builder = (0, import_react49.useMemo)(() => {
|
|
3691
|
-
const b = new OdataBuilder(path);
|
|
3692
|
-
if (query) b.setQuery(query);
|
|
3693
|
-
return b;
|
|
3694
|
-
}, [path, query]);
|
|
3695
|
-
const activePageNumber = builder.getPageNumber(Constants.pagesize);
|
|
3696
|
-
const totalItems = dataset?.count || 0;
|
|
3697
|
-
const itemsPerPage = parseInt(builder.top || Constants.pagesize.toString());
|
|
3698
|
-
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
3699
|
-
const startItem = totalItems > 0 ? (activePageNumber - 1) * itemsPerPage + 1 : 0;
|
|
3700
|
-
const endItem = Math.min(activePageNumber * itemsPerPage, totalItems);
|
|
3701
|
-
const getPaginationRange = () => {
|
|
3702
|
-
const delta = 1;
|
|
3703
|
-
const range = [];
|
|
3704
|
-
if (totalPages <= 7) {
|
|
3705
|
-
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
3706
|
-
}
|
|
3707
|
-
range.push(1);
|
|
3708
|
-
let start = Math.max(2, activePageNumber - delta);
|
|
3709
|
-
let end = Math.min(totalPages - 1, activePageNumber + delta);
|
|
3710
|
-
if (activePageNumber - delta <= 2) {
|
|
3711
|
-
end = Math.min(totalPages - 1, 4);
|
|
3712
|
-
}
|
|
3713
|
-
if (activePageNumber + delta >= totalPages - 1) {
|
|
3714
|
-
start = Math.max(2, totalPages - 4);
|
|
3715
|
-
}
|
|
3716
|
-
if (start > 2) {
|
|
3717
|
-
range.push("...");
|
|
3718
|
-
}
|
|
3719
|
-
for (let i = start; i <= end; i++) {
|
|
3720
|
-
range.push(i);
|
|
3721
|
-
}
|
|
3722
|
-
if (end < totalPages - 1) {
|
|
3723
|
-
range.push("...");
|
|
3724
|
-
}
|
|
3725
|
-
if (totalPages > 1) {
|
|
3726
|
-
range.push(totalPages);
|
|
3727
|
-
}
|
|
3728
|
-
return range;
|
|
3729
|
-
};
|
|
3730
|
-
const paginationRange = getPaginationRange();
|
|
3731
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3732
|
-
Hyperlink,
|
|
3733
|
-
{
|
|
3734
|
-
linkType: "Link" /* Link */,
|
|
3735
|
-
className: `
|
|
3736
|
-
min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2.5 md:px-3
|
|
3737
|
-
border text-sm font-medium transition-colors duration-150
|
|
3738
|
-
${activePageNumber === page ? "bg-primary-base font-semibold" : ""}
|
|
3739
|
-
`,
|
|
3740
|
-
href: builder.getNewPageUrl(page),
|
|
3741
|
-
children
|
|
3742
|
-
}
|
|
3743
|
-
);
|
|
3744
|
-
const NavigationButton = ({ page, disabled, children }) => {
|
|
3745
|
-
if (disabled) {
|
|
3746
|
-
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 });
|
|
3747
|
-
}
|
|
3748
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3749
|
-
Hyperlink,
|
|
3750
|
-
{
|
|
3751
|
-
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",
|
|
3752
|
-
href: builder.getNewPageUrl(page),
|
|
3753
|
-
children
|
|
3754
|
-
}
|
|
3755
|
-
);
|
|
3756
|
-
};
|
|
3757
|
-
if (totalPages <= 1 && totalItems === 0) return null;
|
|
3758
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
3759
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
3760
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "text-sm", children: [
|
|
3761
|
-
"Showing ",
|
|
3762
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "font-semibold", children: [
|
|
3763
|
-
startItem,
|
|
3764
|
-
"-",
|
|
3765
|
-
endItem
|
|
3766
|
-
] }),
|
|
3767
|
-
" ",
|
|
3768
|
-
"out of ",
|
|
3769
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
3770
|
-
" results"
|
|
3771
|
-
] }),
|
|
3772
|
-
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
3773
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3774
|
-
NavigationButton,
|
|
3775
|
-
{
|
|
3776
|
-
page: activePageNumber - 1,
|
|
3777
|
-
disabled: activePageNumber === 1,
|
|
3778
|
-
children: [
|
|
3779
|
-
/* @__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" }) }),
|
|
3780
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
3781
|
-
]
|
|
3782
|
-
}
|
|
3783
|
-
),
|
|
3784
|
-
paginationRange.map((item, index) => {
|
|
3785
|
-
if (item === "...") {
|
|
3786
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3787
|
-
"span",
|
|
3788
|
-
{
|
|
3789
|
-
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
3790
|
-
children: "..."
|
|
3791
|
-
},
|
|
3792
|
-
`ellipsis-${index}`
|
|
3793
|
-
);
|
|
3794
|
-
}
|
|
3795
|
-
const page = item;
|
|
3796
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(PageButton, { page, children: page }, page);
|
|
3797
|
-
}),
|
|
3798
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3799
|
-
NavigationButton,
|
|
3800
|
-
{
|
|
3801
|
-
page: activePageNumber + 1,
|
|
3802
|
-
disabled: activePageNumber === totalPages,
|
|
3803
|
-
children: [
|
|
3804
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
3805
|
-
/* @__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" }) })
|
|
3806
|
-
]
|
|
3807
|
-
}
|
|
3808
|
-
)
|
|
3809
|
-
] }),
|
|
3810
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
3811
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
3812
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3813
|
-
"input",
|
|
3814
|
-
{
|
|
3815
|
-
type: "number",
|
|
3816
|
-
min: "1",
|
|
3817
|
-
max: totalPages,
|
|
3818
|
-
defaultValue: activePageNumber,
|
|
3819
|
-
className: "w-20 h-10 px-3 border rounded text-sm focus:outline-none focus:ring-2 focus:border-transparent",
|
|
3820
|
-
onKeyDown: (e) => {
|
|
3821
|
-
if (e.key === "Enter") {
|
|
3822
|
-
const input = e.target;
|
|
3823
|
-
const page = parseInt(input.value);
|
|
3824
|
-
if (page >= 1 && page <= totalPages && page !== activePageNumber) {
|
|
3825
|
-
window.location.href = builder.getNewPageUrl(page);
|
|
3826
|
-
}
|
|
3827
|
-
}
|
|
3828
|
-
}
|
|
3829
|
-
}
|
|
3830
|
-
) })
|
|
3831
|
-
] })
|
|
3832
|
-
] }),
|
|
3833
|
-
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: [
|
|
3834
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
3835
|
-
/* @__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)(
|
|
3836
|
-
Hyperlink,
|
|
3837
|
-
{
|
|
3838
|
-
className: `
|
|
3839
|
-
px-3 py-1 text-sm rounded border transition-colors duration-150
|
|
3840
|
-
${itemsPerPage === size ? "bg-primary-base font-medium" : "bg-neutral-weak"}
|
|
3841
|
-
`,
|
|
3842
|
-
href: builder.getNewPageSizeUrl(size),
|
|
3843
|
-
children: size
|
|
3844
|
-
},
|
|
3845
|
-
size
|
|
3846
|
-
)) }),
|
|
3847
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "per page" })
|
|
3848
|
-
] }) })
|
|
3849
|
-
] });
|
|
3850
|
-
};
|
|
3851
|
-
var Pagination_default = Pagination;
|
|
3852
|
-
|
|
3853
|
-
// src/components/utilities/PathUtility.tsx
|
|
3854
|
-
var PathUtility = class {
|
|
3855
|
-
constructor() {
|
|
3856
|
-
}
|
|
3857
|
-
normalizePath(path) {
|
|
3858
|
-
if (path == null) {
|
|
3859
|
-
return "/";
|
|
3860
|
-
}
|
|
3861
|
-
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
3862
|
-
return trimmedPath === "" ? "/" : "/" + trimmedPath + "/";
|
|
3863
|
-
}
|
|
3864
|
-
joinAndNormalizePaths(path1, path2) {
|
|
3865
|
-
path1 = path1.replace(/\/$/, "");
|
|
3866
|
-
path2 = path2.replace(/^\//, "");
|
|
3867
|
-
const joinedPath = `${path1}/${path2}`;
|
|
3868
|
-
const normalizedPath = joinedPath.replace(/\/{2,}/g, "/");
|
|
3869
|
-
return normalizedPath === "" ? "/" : "/" + normalizedPath;
|
|
3870
|
-
}
|
|
3871
|
-
removeLeadingAndTrailingSlashes(path) {
|
|
3872
|
-
if (path == null) {
|
|
3873
|
-
return "/";
|
|
3874
|
-
}
|
|
3875
|
-
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
3876
|
-
return trimmedPath;
|
|
3877
|
-
}
|
|
3878
|
-
removeTrailingSlash(path) {
|
|
3879
|
-
if (path == null) {
|
|
3880
|
-
return "/";
|
|
3881
|
-
}
|
|
3882
|
-
const trimmedPath = path.replace(/\/$/, "");
|
|
3883
|
-
return trimmedPath;
|
|
3884
|
-
}
|
|
3885
|
-
joinPaths(path1, path2) {
|
|
3886
|
-
if (!path1.endsWith("/") && !path2.startsWith("/")) {
|
|
3887
|
-
return `${path1}/${path2}`;
|
|
3888
|
-
} else if (path1.endsWith("/") && path2.startsWith("/")) {
|
|
3889
|
-
return `${path1}${path2.substr(1)}`;
|
|
3890
|
-
} else {
|
|
3891
|
-
return `${path1}${path2}`;
|
|
3892
|
-
}
|
|
3893
|
-
}
|
|
3894
|
-
getFirstSegment(path) {
|
|
3895
|
-
if (!path || path === "/") {
|
|
3896
|
-
return "";
|
|
3897
|
-
}
|
|
3898
|
-
const segments = path.split("/").filter(Boolean);
|
|
3899
|
-
return segments.length > 0 ? segments[0] : "";
|
|
3900
|
-
}
|
|
3901
|
-
};
|
|
3902
|
-
var PathUtility_default = new PathUtility();
|
|
3903
|
-
|
|
3904
|
-
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
3905
|
-
var import_react50 = __toESM(require("react"));
|
|
3906
|
-
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3907
|
-
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
3908
|
-
const ref = (0, import_react50.useRef)(null);
|
|
3909
|
-
(0, import_react50.useEffect)(() => {
|
|
3910
|
-
if (!hasEnterAnimation || !ref.current) return;
|
|
3911
|
-
const observer = new IntersectionObserver(
|
|
3912
|
-
(entries) => {
|
|
3913
|
-
entries.forEach((entry) => {
|
|
3914
|
-
if (entry.isIntersecting) {
|
|
3915
|
-
entry.target.classList.add("visible");
|
|
3916
|
-
observer.unobserve(entry.target);
|
|
3917
|
-
}
|
|
3918
|
-
});
|
|
3919
|
-
},
|
|
3920
|
-
{ threshold: 0.1 }
|
|
3921
|
-
);
|
|
3922
|
-
observer.observe(ref.current);
|
|
3923
|
-
return () => observer.disconnect();
|
|
3924
|
-
}, [hasEnterAnimation]);
|
|
3925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
3926
|
-
//@ts-ignore
|
|
3927
|
-
import_react50.default.cloneElement(children, { ref }) });
|
|
3928
|
-
}
|
|
3929
|
-
|
|
3930
|
-
// src/components/Slider.tsx
|
|
3931
|
-
var import_react51 = __toESM(require("react"));
|
|
3932
|
-
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3933
3594
|
var Slider = ({
|
|
3934
3595
|
children,
|
|
3935
3596
|
slidesToShow = 4,
|
|
@@ -3947,13 +3608,13 @@ var Slider = ({
|
|
|
3947
3608
|
pillStyle = "cumulative",
|
|
3948
3609
|
progressPosition = "bottom"
|
|
3949
3610
|
}) => {
|
|
3950
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
3951
|
-
const [transition, setTransition] = (0,
|
|
3952
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
3611
|
+
const [currentSlide, setCurrentSlide] = (0, import_react47.useState)(0);
|
|
3612
|
+
const [transition, setTransition] = (0, import_react47.useState)(true);
|
|
3613
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react47.useState)(
|
|
3953
3614
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
3954
3615
|
);
|
|
3955
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3956
|
-
(0,
|
|
3616
|
+
const [isPlaying, setIsPlaying] = (0, import_react47.useState)(autoplay);
|
|
3617
|
+
(0, import_react47.useEffect)(() => {
|
|
3957
3618
|
if (typeof slidesToShow === "number") return;
|
|
3958
3619
|
const handleResize = () => {
|
|
3959
3620
|
if (window.innerWidth >= 1024) {
|
|
@@ -3968,7 +3629,7 @@ var Slider = ({
|
|
|
3968
3629
|
window.addEventListener("resize", handleResize);
|
|
3969
3630
|
return () => window.removeEventListener("resize", handleResize);
|
|
3970
3631
|
}, [slidesToShow]);
|
|
3971
|
-
(0,
|
|
3632
|
+
(0, import_react47.useEffect)(() => {
|
|
3972
3633
|
if (!autoplay) return;
|
|
3973
3634
|
const timer = setInterval(() => {
|
|
3974
3635
|
if (isPlaying) {
|
|
@@ -3977,7 +3638,7 @@ var Slider = ({
|
|
|
3977
3638
|
}, autoplay_speed);
|
|
3978
3639
|
return () => clearInterval(timer);
|
|
3979
3640
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
3980
|
-
const totalSlides =
|
|
3641
|
+
const totalSlides = import_react47.Children.count(children);
|
|
3981
3642
|
const maxSlide = totalSlides - slidesToShowState;
|
|
3982
3643
|
const nextSlide = () => {
|
|
3983
3644
|
if (currentSlide >= maxSlide) {
|
|
@@ -4022,16 +3683,16 @@ var Slider = ({
|
|
|
4022
3683
|
}
|
|
4023
3684
|
};
|
|
4024
3685
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4025
|
-
const slides =
|
|
4026
|
-
if (!
|
|
3686
|
+
const slides = import_react47.Children.map(children, (child, index) => {
|
|
3687
|
+
if (!import_react47.default.isValidElement(child)) return null;
|
|
4027
3688
|
const childProps = child.props;
|
|
4028
3689
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
3690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4030
3691
|
"div",
|
|
4031
3692
|
{
|
|
4032
3693
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4033
3694
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4034
|
-
children: (0,
|
|
3695
|
+
children: (0, import_react47.cloneElement)(child, {
|
|
4035
3696
|
className: mergedClassName
|
|
4036
3697
|
})
|
|
4037
3698
|
},
|
|
@@ -4049,14 +3710,14 @@ var Slider = ({
|
|
|
4049
3710
|
return "bottom-4";
|
|
4050
3711
|
}
|
|
4051
3712
|
};
|
|
4052
|
-
return /* @__PURE__ */ (0,
|
|
3713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4053
3714
|
"div",
|
|
4054
3715
|
{
|
|
4055
3716
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4056
3717
|
onMouseEnter: handleMouseEnter,
|
|
4057
3718
|
onMouseLeave: handleMouseLeave,
|
|
4058
3719
|
children: [
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4060
3721
|
"div",
|
|
4061
3722
|
{
|
|
4062
3723
|
className: "flex h-full",
|
|
@@ -4067,18 +3728,18 @@ var Slider = ({
|
|
|
4067
3728
|
children: slides
|
|
4068
3729
|
}
|
|
4069
3730
|
),
|
|
4070
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
3731
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
3732
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4072
3733
|
ArrowButton,
|
|
4073
3734
|
{
|
|
4074
3735
|
direction: "left",
|
|
4075
3736
|
onClick: prevSlide,
|
|
4076
3737
|
visible: infinite_scroll || currentSlide > 0,
|
|
4077
3738
|
className: arrowClassName,
|
|
4078
|
-
children: /* @__PURE__ */ (0,
|
|
3739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.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_runtime62.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4079
3740
|
}
|
|
4080
3741
|
),
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4082
3743
|
ArrowButton,
|
|
4083
3744
|
{
|
|
4084
3745
|
direction: "right",
|
|
@@ -4086,13 +3747,13 @@ var Slider = ({
|
|
|
4086
3747
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4087
3748
|
className: arrowClassName,
|
|
4088
3749
|
children: [
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.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_runtime62.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4090
3751
|
" "
|
|
4091
3752
|
]
|
|
4092
3753
|
}
|
|
4093
3754
|
)
|
|
4094
3755
|
] }),
|
|
4095
|
-
show_dots && /* @__PURE__ */ (0,
|
|
3756
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime62.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_runtime62.jsx)(
|
|
4096
3757
|
ProgressPill,
|
|
4097
3758
|
{
|
|
4098
3759
|
active: index === currentSlide,
|
|
@@ -4118,7 +3779,7 @@ var ArrowButton = ({
|
|
|
4118
3779
|
visible,
|
|
4119
3780
|
children,
|
|
4120
3781
|
className = ""
|
|
4121
|
-
}) => /* @__PURE__ */ (0,
|
|
3782
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4122
3783
|
"button",
|
|
4123
3784
|
{
|
|
4124
3785
|
className: `
|
|
@@ -4144,13 +3805,13 @@ var ProgressPill = ({
|
|
|
4144
3805
|
currentSlide,
|
|
4145
3806
|
totalSlides
|
|
4146
3807
|
}) => {
|
|
4147
|
-
const [progress, setProgress] = (0,
|
|
4148
|
-
(0,
|
|
3808
|
+
const [progress, setProgress] = (0, import_react47.useState)(0);
|
|
3809
|
+
(0, import_react47.useEffect)(() => {
|
|
4149
3810
|
if (active) {
|
|
4150
3811
|
setProgress(0);
|
|
4151
3812
|
}
|
|
4152
3813
|
}, [active, index]);
|
|
4153
|
-
(0,
|
|
3814
|
+
(0, import_react47.useEffect)(() => {
|
|
4154
3815
|
if (!active || !isPlaying) {
|
|
4155
3816
|
if (!active) {
|
|
4156
3817
|
setProgress(0);
|
|
@@ -4201,53 +3862,238 @@ var ProgressPill = ({
|
|
|
4201
3862
|
hover:w-8
|
|
4202
3863
|
`;
|
|
4203
3864
|
}
|
|
4204
|
-
};
|
|
4205
|
-
const renderProgressBar = () => {
|
|
4206
|
-
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4207
|
-
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4208
|
-
return /* @__PURE__ */ (0,
|
|
4209
|
-
"div",
|
|
4210
|
-
{
|
|
4211
|
-
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`,
|
|
4212
|
-
style: { width: `${displayProgress}%` }
|
|
4213
|
-
}
|
|
4214
|
-
);
|
|
3865
|
+
};
|
|
3866
|
+
const renderProgressBar = () => {
|
|
3867
|
+
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
3868
|
+
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
3869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3870
|
+
"div",
|
|
3871
|
+
{
|
|
3872
|
+
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`,
|
|
3873
|
+
style: { width: `${displayProgress}%` }
|
|
3874
|
+
}
|
|
3875
|
+
);
|
|
3876
|
+
}
|
|
3877
|
+
return null;
|
|
3878
|
+
};
|
|
3879
|
+
const renderCumulativeFill = () => {
|
|
3880
|
+
if (style === "cumulative" && isFilled && !isActive) {
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3882
|
+
"div",
|
|
3883
|
+
{
|
|
3884
|
+
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
3885
|
+
style: { width: "100%" }
|
|
3886
|
+
}
|
|
3887
|
+
);
|
|
3888
|
+
}
|
|
3889
|
+
return null;
|
|
3890
|
+
};
|
|
3891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
3892
|
+
"button",
|
|
3893
|
+
{
|
|
3894
|
+
className: `${baseClasses} ${getStyleClasses()}`,
|
|
3895
|
+
onClick,
|
|
3896
|
+
"aria-label": `Go to slide ${index + 1}`,
|
|
3897
|
+
"aria-current": isActive ? "true" : "false",
|
|
3898
|
+
children: [
|
|
3899
|
+
renderProgressBar(),
|
|
3900
|
+
renderCumulativeFill()
|
|
3901
|
+
]
|
|
3902
|
+
}
|
|
3903
|
+
);
|
|
3904
|
+
};
|
|
3905
|
+
var Slider_default = Slider;
|
|
3906
|
+
|
|
3907
|
+
// src/components/utilities/AnimationUtility.tsx
|
|
3908
|
+
var AnimationUtility = class {
|
|
3909
|
+
static generateAnimationCSS(config, guid) {
|
|
3910
|
+
const {
|
|
3911
|
+
duration = 700,
|
|
3912
|
+
delay = 0,
|
|
3913
|
+
easing = "ease-out",
|
|
3914
|
+
distance = 30,
|
|
3915
|
+
scaleStart = 1,
|
|
3916
|
+
scaleEnd = 1.2,
|
|
3917
|
+
repeat = 1,
|
|
3918
|
+
intensity = 20,
|
|
3919
|
+
speedPerChar = 100,
|
|
3920
|
+
cursor = true,
|
|
3921
|
+
mode = "enter",
|
|
3922
|
+
direction = "left"
|
|
3923
|
+
// Default direction
|
|
3924
|
+
} = config;
|
|
3925
|
+
let base = "", visible = "", keyframes = "";
|
|
3926
|
+
switch (config.animation) {
|
|
3927
|
+
case "Fade":
|
|
3928
|
+
base = `opacity:0; transition:opacity ${duration}ms ${easing} ${delay}ms;`;
|
|
3929
|
+
visible = `opacity:1;`;
|
|
3930
|
+
break;
|
|
3931
|
+
case "FadeInUp":
|
|
3932
|
+
base = `opacity:0; transform:translateY(${distance}px); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3933
|
+
visible = `opacity:1; transform:translateY(0);`;
|
|
3934
|
+
break;
|
|
3935
|
+
case "Slide":
|
|
3936
|
+
const slideTransform = this.getSlideTransform(direction, distance);
|
|
3937
|
+
base = `opacity:0; transform:${slideTransform.start}; transition:all ${duration}ms ${easing} ${delay}ms; will-change: transform, opacity;`;
|
|
3938
|
+
visible = `opacity:1; transform:${slideTransform.end}; will-change: unset;`;
|
|
3939
|
+
break;
|
|
3940
|
+
case "ZoomIn":
|
|
3941
|
+
if (mode === "enter") {
|
|
3942
|
+
base = `opacity:0; transform:scale(${scaleStart}); transition:all ${duration}ms ${easing} ${delay}ms;`;
|
|
3943
|
+
visible = `opacity:1; transform:scale(${scaleEnd});`;
|
|
3944
|
+
} else {
|
|
3945
|
+
base = `transform:scale(${scaleStart}); transition:transform ${duration / 1e3}s ${easing} ${delay / 1e3}s;`;
|
|
3946
|
+
visible = `transform:scale(${scaleEnd});`;
|
|
3947
|
+
}
|
|
3948
|
+
break;
|
|
3949
|
+
case "Bounce":
|
|
3950
|
+
keyframes = `
|
|
3951
|
+
@keyframes bounce {
|
|
3952
|
+
0%,20%,50%,80%,100% { transform: translateY(0); }
|
|
3953
|
+
40% { transform: translateY(-${intensity}px); }
|
|
3954
|
+
60% { transform: translateY(-${intensity / 2}px); }
|
|
3955
|
+
}
|
|
3956
|
+
`;
|
|
3957
|
+
if (mode === "enter") {
|
|
3958
|
+
base = `opacity:0;`;
|
|
3959
|
+
visible = `opacity:1; animation:bounce ${duration}ms ${easing} ${delay}ms ${repeat};`;
|
|
3960
|
+
} else {
|
|
3961
|
+
base = ``;
|
|
3962
|
+
visible = `animation:bounce ${duration / 1e3}s ${easing} ${delay / 1e3}s ${repeat};`;
|
|
3963
|
+
}
|
|
3964
|
+
break;
|
|
3965
|
+
case "Typewriter":
|
|
3966
|
+
keyframes = `
|
|
3967
|
+
@keyframes typewriter { from { width: 0 } to { width: 100% } }
|
|
3968
|
+
@keyframes blink { 50% { border-color: transparent } }
|
|
3969
|
+
`;
|
|
3970
|
+
base = `
|
|
3971
|
+
overflow:hidden;
|
|
3972
|
+
border-right:${cursor ? "2px solid black" : "none"};
|
|
3973
|
+
white-space:nowrap;
|
|
3974
|
+
width:0;
|
|
3975
|
+
margin:0 auto;
|
|
3976
|
+
`;
|
|
3977
|
+
visible = `
|
|
3978
|
+
animation:typewriter ${speedPerChar * 30}ms steps(30,end) ${delay}ms forwards
|
|
3979
|
+
${cursor ? ", blink .75s step-end infinite" : ""};
|
|
3980
|
+
`;
|
|
3981
|
+
break;
|
|
3982
|
+
}
|
|
3983
|
+
if (mode === "hover") {
|
|
3984
|
+
return `
|
|
3985
|
+
${keyframes}
|
|
3986
|
+
${guid} { ${base} }
|
|
3987
|
+
${guid}:hover { ${visible} }
|
|
3988
|
+
`;
|
|
3989
|
+
} else {
|
|
3990
|
+
return `
|
|
3991
|
+
${keyframes}
|
|
3992
|
+
${guid} { ${base} }
|
|
3993
|
+
${guid}.visible { ${visible} }
|
|
3994
|
+
`;
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
// Helper method to generate slide transforms based on direction
|
|
3998
|
+
static getSlideTransform(direction, distance) {
|
|
3999
|
+
switch (direction) {
|
|
4000
|
+
case "left":
|
|
4001
|
+
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
4002
|
+
case "right":
|
|
4003
|
+
return { start: `translateX(-${distance}px)`, end: `translateX(0)` };
|
|
4004
|
+
case "up":
|
|
4005
|
+
return { start: `translateY(${distance}px)`, end: `translateY(0)` };
|
|
4006
|
+
case "down":
|
|
4007
|
+
return { start: `translateY(-${distance}px)`, end: `translateY(0)` };
|
|
4008
|
+
default:
|
|
4009
|
+
return { start: `translateX(${distance}px)`, end: `translateX(0)` };
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
};
|
|
4013
|
+
var AnimationUtility_default = AnimationUtility;
|
|
4014
|
+
|
|
4015
|
+
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
4016
|
+
var import_react48 = __toESM(require("react"));
|
|
4017
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4018
|
+
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
4019
|
+
const ref = (0, import_react48.useRef)(null);
|
|
4020
|
+
(0, import_react48.useEffect)(() => {
|
|
4021
|
+
if (!hasEnterAnimation || !ref.current) return;
|
|
4022
|
+
const observer = new IntersectionObserver(
|
|
4023
|
+
(entries) => {
|
|
4024
|
+
entries.forEach((entry) => {
|
|
4025
|
+
if (entry.isIntersecting) {
|
|
4026
|
+
entry.target.classList.add("visible");
|
|
4027
|
+
observer.unobserve(entry.target);
|
|
4028
|
+
}
|
|
4029
|
+
});
|
|
4030
|
+
},
|
|
4031
|
+
{ threshold: 0.1 }
|
|
4032
|
+
);
|
|
4033
|
+
observer.observe(ref.current);
|
|
4034
|
+
return () => observer.disconnect();
|
|
4035
|
+
}, [hasEnterAnimation]);
|
|
4036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
4037
|
+
//@ts-ignore
|
|
4038
|
+
import_react48.default.cloneElement(children, { ref }) });
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
// src/components/utilities/PathUtility.tsx
|
|
4042
|
+
var PathUtility = class {
|
|
4043
|
+
constructor() {
|
|
4044
|
+
}
|
|
4045
|
+
normalizePath(path) {
|
|
4046
|
+
if (path == null) {
|
|
4047
|
+
return "/";
|
|
4048
|
+
}
|
|
4049
|
+
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
4050
|
+
return trimmedPath === "" ? "/" : "/" + trimmedPath + "/";
|
|
4051
|
+
}
|
|
4052
|
+
joinAndNormalizePaths(path1, path2) {
|
|
4053
|
+
path1 = path1.replace(/\/$/, "");
|
|
4054
|
+
path2 = path2.replace(/^\//, "");
|
|
4055
|
+
const joinedPath = `${path1}/${path2}`;
|
|
4056
|
+
const normalizedPath = joinedPath.replace(/\/{2,}/g, "/");
|
|
4057
|
+
return normalizedPath === "" ? "/" : "/" + normalizedPath;
|
|
4058
|
+
}
|
|
4059
|
+
removeLeadingAndTrailingSlashes(path) {
|
|
4060
|
+
if (path == null) {
|
|
4061
|
+
return "/";
|
|
4062
|
+
}
|
|
4063
|
+
const trimmedPath = path.replace(/^\/|\/$/g, "");
|
|
4064
|
+
return trimmedPath;
|
|
4065
|
+
}
|
|
4066
|
+
removeTrailingSlash(path) {
|
|
4067
|
+
if (path == null) {
|
|
4068
|
+
return "/";
|
|
4215
4069
|
}
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
);
|
|
4070
|
+
const trimmedPath = path.replace(/\/$/, "");
|
|
4071
|
+
return trimmedPath;
|
|
4072
|
+
}
|
|
4073
|
+
joinPaths(path1, path2) {
|
|
4074
|
+
if (!path1.endsWith("/") && !path2.startsWith("/")) {
|
|
4075
|
+
return `${path1}/${path2}`;
|
|
4076
|
+
} else if (path1.endsWith("/") && path2.startsWith("/")) {
|
|
4077
|
+
return `${path1}${path2.substr(1)}`;
|
|
4078
|
+
} else {
|
|
4079
|
+
return `${path1}${path2}`;
|
|
4227
4080
|
}
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
{
|
|
4233
|
-
className: `${baseClasses} ${getStyleClasses()}`,
|
|
4234
|
-
onClick,
|
|
4235
|
-
"aria-label": `Go to slide ${index + 1}`,
|
|
4236
|
-
"aria-current": isActive ? "true" : "false",
|
|
4237
|
-
children: [
|
|
4238
|
-
renderProgressBar(),
|
|
4239
|
-
renderCumulativeFill()
|
|
4240
|
-
]
|
|
4081
|
+
}
|
|
4082
|
+
getFirstSegment(path) {
|
|
4083
|
+
if (!path || path === "/") {
|
|
4084
|
+
return "";
|
|
4241
4085
|
}
|
|
4242
|
-
|
|
4086
|
+
const segments = path.split("/").filter(Boolean);
|
|
4087
|
+
return segments.length > 0 ? segments[0] : "";
|
|
4088
|
+
}
|
|
4243
4089
|
};
|
|
4244
|
-
var
|
|
4090
|
+
var PathUtility_default = new PathUtility();
|
|
4245
4091
|
|
|
4246
4092
|
// src/components/NoDataFound.tsx
|
|
4247
|
-
var
|
|
4093
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4248
4094
|
var NoDataFound = () => {
|
|
4249
|
-
return /* @__PURE__ */ (0,
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4251
4097
|
"svg",
|
|
4252
4098
|
{
|
|
4253
4099
|
className: "w-10 h-10",
|
|
@@ -4255,7 +4101,7 @@ var NoDataFound = () => {
|
|
|
4255
4101
|
stroke: "currentColor",
|
|
4256
4102
|
viewBox: "0 0 24 24",
|
|
4257
4103
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4258
|
-
children: /* @__PURE__ */ (0,
|
|
4104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4259
4105
|
"path",
|
|
4260
4106
|
{
|
|
4261
4107
|
strokeLinecap: "round",
|
|
@@ -4266,14 +4112,182 @@ var NoDataFound = () => {
|
|
|
4266
4112
|
)
|
|
4267
4113
|
}
|
|
4268
4114
|
) }) }),
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4270
|
-
/* @__PURE__ */ (0,
|
|
4115
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
4271
4117
|
] });
|
|
4272
4118
|
};
|
|
4273
4119
|
var NoDataFound_default = NoDataFound;
|
|
4274
4120
|
|
|
4121
|
+
// src/components/Pagination.tsx
|
|
4122
|
+
var import_react49 = require("react");
|
|
4123
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4124
|
+
var Pagination = (props) => {
|
|
4125
|
+
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
4126
|
+
const builder = (0, import_react49.useMemo)(() => {
|
|
4127
|
+
const b = new OdataBuilder(path);
|
|
4128
|
+
if (query) b.setQuery(query);
|
|
4129
|
+
return b;
|
|
4130
|
+
}, [path, query]);
|
|
4131
|
+
const activePageNumber = builder.getPageNumber(Constants.pagesize);
|
|
4132
|
+
const totalItems = dataset?.count || 0;
|
|
4133
|
+
const itemsPerPage = parseInt(builder.top || Constants.pagesize.toString());
|
|
4134
|
+
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
4135
|
+
const startItem = totalItems > 0 ? (activePageNumber - 1) * itemsPerPage + 1 : 0;
|
|
4136
|
+
const endItem = Math.min(activePageNumber * itemsPerPage, totalItems);
|
|
4137
|
+
const getPaginationRange = () => {
|
|
4138
|
+
const delta = 1;
|
|
4139
|
+
const range = [];
|
|
4140
|
+
if (totalPages <= 7) {
|
|
4141
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4142
|
+
}
|
|
4143
|
+
range.push(1);
|
|
4144
|
+
let start = Math.max(2, activePageNumber - delta);
|
|
4145
|
+
let end = Math.min(totalPages - 1, activePageNumber + delta);
|
|
4146
|
+
if (activePageNumber - delta <= 2) {
|
|
4147
|
+
end = Math.min(totalPages - 1, 4);
|
|
4148
|
+
}
|
|
4149
|
+
if (activePageNumber + delta >= totalPages - 1) {
|
|
4150
|
+
start = Math.max(2, totalPages - 4);
|
|
4151
|
+
}
|
|
4152
|
+
if (start > 2) {
|
|
4153
|
+
range.push("...");
|
|
4154
|
+
}
|
|
4155
|
+
for (let i = start; i <= end; i++) {
|
|
4156
|
+
range.push(i);
|
|
4157
|
+
}
|
|
4158
|
+
if (end < totalPages - 1) {
|
|
4159
|
+
range.push("...");
|
|
4160
|
+
}
|
|
4161
|
+
if (totalPages > 1) {
|
|
4162
|
+
range.push(totalPages);
|
|
4163
|
+
}
|
|
4164
|
+
return range;
|
|
4165
|
+
};
|
|
4166
|
+
const paginationRange = getPaginationRange();
|
|
4167
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4168
|
+
Hyperlink,
|
|
4169
|
+
{
|
|
4170
|
+
linkType: "Link" /* Link */,
|
|
4171
|
+
className: `
|
|
4172
|
+
min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2.5 md:px-3
|
|
4173
|
+
border text-sm font-medium transition-colors duration-150
|
|
4174
|
+
${activePageNumber === page ? "bg-primary-base font-semibold" : ""}
|
|
4175
|
+
`,
|
|
4176
|
+
href: builder.getNewPageUrl(page),
|
|
4177
|
+
children
|
|
4178
|
+
}
|
|
4179
|
+
);
|
|
4180
|
+
const NavigationButton = ({ page, disabled, children }) => {
|
|
4181
|
+
if (disabled) {
|
|
4182
|
+
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 });
|
|
4183
|
+
}
|
|
4184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4185
|
+
Hyperlink,
|
|
4186
|
+
{
|
|
4187
|
+
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",
|
|
4188
|
+
href: builder.getNewPageUrl(page),
|
|
4189
|
+
children
|
|
4190
|
+
}
|
|
4191
|
+
);
|
|
4192
|
+
};
|
|
4193
|
+
if (totalPages <= 1 && totalItems === 0) return null;
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "text-sm", children: [
|
|
4197
|
+
"Showing ",
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "font-semibold", children: [
|
|
4199
|
+
startItem,
|
|
4200
|
+
"-",
|
|
4201
|
+
endItem
|
|
4202
|
+
] }),
|
|
4203
|
+
" ",
|
|
4204
|
+
"out of ",
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
4206
|
+
" results"
|
|
4207
|
+
] }),
|
|
4208
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4210
|
+
NavigationButton,
|
|
4211
|
+
{
|
|
4212
|
+
page: activePageNumber - 1,
|
|
4213
|
+
disabled: activePageNumber === 1,
|
|
4214
|
+
children: [
|
|
4215
|
+
/* @__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" }) }),
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
4217
|
+
]
|
|
4218
|
+
}
|
|
4219
|
+
),
|
|
4220
|
+
paginationRange.map((item, index) => {
|
|
4221
|
+
if (item === "...") {
|
|
4222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4223
|
+
"span",
|
|
4224
|
+
{
|
|
4225
|
+
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
4226
|
+
children: "..."
|
|
4227
|
+
},
|
|
4228
|
+
`ellipsis-${index}`
|
|
4229
|
+
);
|
|
4230
|
+
}
|
|
4231
|
+
const page = item;
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(PageButton, { page, children: page }, page);
|
|
4233
|
+
}),
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4235
|
+
NavigationButton,
|
|
4236
|
+
{
|
|
4237
|
+
page: activePageNumber + 1,
|
|
4238
|
+
disabled: activePageNumber === totalPages,
|
|
4239
|
+
children: [
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
4241
|
+
/* @__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" }) })
|
|
4242
|
+
]
|
|
4243
|
+
}
|
|
4244
|
+
)
|
|
4245
|
+
] }),
|
|
4246
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4249
|
+
"input",
|
|
4250
|
+
{
|
|
4251
|
+
type: "number",
|
|
4252
|
+
min: "1",
|
|
4253
|
+
max: totalPages,
|
|
4254
|
+
defaultValue: activePageNumber,
|
|
4255
|
+
className: "w-20 h-10 px-3 border rounded text-sm focus:outline-none focus:ring-2 focus:border-transparent",
|
|
4256
|
+
onKeyDown: (e) => {
|
|
4257
|
+
if (e.key === "Enter") {
|
|
4258
|
+
const input = e.target;
|
|
4259
|
+
const page = parseInt(input.value);
|
|
4260
|
+
if (page >= 1 && page <= totalPages && page !== activePageNumber) {
|
|
4261
|
+
window.location.href = builder.getNewPageUrl(page);
|
|
4262
|
+
}
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
) })
|
|
4267
|
+
] })
|
|
4268
|
+
] }),
|
|
4269
|
+
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: [
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
4271
|
+
/* @__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)(
|
|
4272
|
+
Hyperlink,
|
|
4273
|
+
{
|
|
4274
|
+
className: `
|
|
4275
|
+
px-3 py-1 text-sm rounded border transition-colors duration-150
|
|
4276
|
+
${itemsPerPage === size ? "bg-primary-base font-medium" : "bg-neutral-weak"}
|
|
4277
|
+
`,
|
|
4278
|
+
href: builder.getNewPageSizeUrl(size),
|
|
4279
|
+
children: size
|
|
4280
|
+
},
|
|
4281
|
+
size
|
|
4282
|
+
)) }),
|
|
4283
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "per page" })
|
|
4284
|
+
] }) })
|
|
4285
|
+
] });
|
|
4286
|
+
};
|
|
4287
|
+
var Pagination_default = Pagination;
|
|
4288
|
+
|
|
4275
4289
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4276
|
-
var
|
|
4290
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4277
4291
|
function toCamelCase(str) {
|
|
4278
4292
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
4279
4293
|
}
|
|
@@ -4290,18 +4304,23 @@ function convertKeysToCamelCase(obj) {
|
|
|
4290
4304
|
var getNestedValue = (obj, path) => {
|
|
4291
4305
|
if (!obj || !path) return void 0;
|
|
4292
4306
|
return path.split(".").reduce((current, key) => {
|
|
4307
|
+
{
|
|
4308
|
+
}
|
|
4293
4309
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
4294
4310
|
}, obj);
|
|
4295
4311
|
};
|
|
4296
|
-
|
|
4312
|
+
{
|
|
4313
|
+
}
|
|
4314
|
+
function generateCompleteBackgroundString(layers, apiBaseUrl) {
|
|
4297
4315
|
if (!layers || !Array.isArray(layers)) return "";
|
|
4298
4316
|
return layers.filter((layer) => layer && layer.type && layer.value).map((layer) => {
|
|
4299
4317
|
if (layer.type === "image" && typeof layer.value === "object") {
|
|
4300
4318
|
const imageValue = layer.value;
|
|
4301
4319
|
if (!imageValue.assetUrl) return "";
|
|
4302
|
-
const
|
|
4303
|
-
|
|
4304
|
-
|
|
4320
|
+
const url = `url('${AssetUtility_default.resolveUrl(
|
|
4321
|
+
apiBaseUrl,
|
|
4322
|
+
imageValue.assetUrl
|
|
4323
|
+
)}')`;
|
|
4305
4324
|
const repeat = layer.repeat || "no-repeat";
|
|
4306
4325
|
const position = layer.position || "center";
|
|
4307
4326
|
const size = layer.size || "auto";
|
|
@@ -4320,12 +4339,16 @@ function generateCompleteBackgroundString(layers, resolveAssetUrl, apiBaseUrl) {
|
|
|
4320
4339
|
}).filter((bg) => bg.trim() !== "").join(", ");
|
|
4321
4340
|
}
|
|
4322
4341
|
var generateCssString = (guid, stylesObject, mobileStylesObject) => {
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4342
|
+
{
|
|
4343
|
+
}
|
|
4344
|
+
const gridColumns = stylesObject.gridTemplateColumns ? stylesObject.gridTemplateColumns.match(/\d+/g) : [];
|
|
4345
|
+
const hasGridProperties = gridColumns.length > 0;
|
|
4346
|
+
const largeCols = hasGridProperties ? parseInt(gridColumns[0]) : 4;
|
|
4347
|
+
const tabletColumns = hasGridProperties ? Math.ceil(parseInt(gridColumns[0]) / 2) : 2;
|
|
4348
|
+
const mobileColumns = 1;
|
|
4349
|
+
{
|
|
4350
|
+
}
|
|
4351
|
+
const cssRules = Object.entries(stylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4329
4352
|
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4330
4353
|
return `${cssKey}: ${value};`;
|
|
4331
4354
|
});
|
|
@@ -4335,7 +4358,7 @@ ${cssRules.join(
|
|
|
4335
4358
|
)}
|
|
4336
4359
|
transition: all 0.3s ease-in-out; }`;
|
|
4337
4360
|
if (mobileStylesObject) {
|
|
4338
|
-
|
|
4361
|
+
const mobileCssRules = Object.entries(mobileStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
|
|
4339
4362
|
const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4340
4363
|
return `${cssKey}: ${value};`;
|
|
4341
4364
|
});
|
|
@@ -4373,7 +4396,6 @@ var DivContainer = async (props) => {
|
|
|
4373
4396
|
code: CodeNode_default,
|
|
4374
4397
|
image: ImageNode_default,
|
|
4375
4398
|
horizontalrule: HorizontalRuleNode_default,
|
|
4376
|
-
"layout-container": LayoutContainerNode_default,
|
|
4377
4399
|
widget: WidgetNode_default,
|
|
4378
4400
|
embed: EmbedNode_default,
|
|
4379
4401
|
"div-container": DivContainer,
|
|
@@ -4385,17 +4407,15 @@ var DivContainer = async (props) => {
|
|
|
4385
4407
|
const mobileStyles = props.node.mobileCssProperties;
|
|
4386
4408
|
const dataBindingProperties = props.node.dataBinding;
|
|
4387
4409
|
const updatedStyles = convertKeysToCamelCase(styles);
|
|
4388
|
-
|
|
4389
|
-
props.node.backgroundLayers,
|
|
4390
|
-
props.resolveAssetUrl,
|
|
4391
|
-
props.apiBaseUrl
|
|
4392
|
-
);
|
|
4410
|
+
const background = generateCompleteBackgroundString(props.node.backgroundLayers, props.apiBaseUrl);
|
|
4393
4411
|
let containerPaddingClass = "";
|
|
4394
4412
|
if (props.node.containerPadding == "small") {
|
|
4395
4413
|
containerPaddingClass = "container-small";
|
|
4396
4414
|
} else if (props.node.containerPadding == "large") {
|
|
4397
4415
|
containerPaddingClass = "container-large";
|
|
4398
4416
|
}
|
|
4417
|
+
{
|
|
4418
|
+
}
|
|
4399
4419
|
const updatedStyle = { ...updatedStyles };
|
|
4400
4420
|
const backgroundStyle = background && background !== "" ? { background } : {};
|
|
4401
4421
|
const combinedStyles = {
|
|
@@ -4426,13 +4446,30 @@ var DivContainer = async (props) => {
|
|
|
4426
4446
|
return fieldValue !== void 0 && fieldValue === false;
|
|
4427
4447
|
};
|
|
4428
4448
|
const isHidden = shouldHideContainer();
|
|
4429
|
-
|
|
4430
|
-
let
|
|
4431
|
-
let
|
|
4449
|
+
let odataString = void 0;
|
|
4450
|
+
let endpoint = void 0;
|
|
4451
|
+
let result = null;
|
|
4452
|
+
let response = null;
|
|
4432
4453
|
let childCollectionData = null;
|
|
4433
4454
|
if (dataBindingProperties) {
|
|
4434
|
-
|
|
4435
|
-
|
|
4455
|
+
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4456
|
+
endpoint = dataBindingProperties.dataSource;
|
|
4457
|
+
{
|
|
4458
|
+
}
|
|
4459
|
+
endpoint = endpoint.replace(/\{(\w+)\}/g, (_, key) => {
|
|
4460
|
+
return props.routeParameters?.[key] ?? `{${key}}`;
|
|
4461
|
+
});
|
|
4462
|
+
if (dataBindingProperties.applyODataParams) {
|
|
4463
|
+
odataString = OdataBuilder.getOdataQueryString(props.query);
|
|
4464
|
+
if (odataString) {
|
|
4465
|
+
const separator = endpoint.includes("?") ? "&" : "?";
|
|
4466
|
+
endpoint += separator + odataString;
|
|
4467
|
+
}
|
|
4468
|
+
}
|
|
4469
|
+
response = await serviceClient.get(endpoint);
|
|
4470
|
+
result = response?.result;
|
|
4471
|
+
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
4472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(NoDataFound_default, {});
|
|
4436
4473
|
}
|
|
4437
4474
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
4438
4475
|
childCollectionData = getNestedValue(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -4440,9 +4477,11 @@ var DivContainer = async (props) => {
|
|
|
4440
4477
|
}
|
|
4441
4478
|
const cssResult = generateCssString(guid, updatedStyle, mobileStyles);
|
|
4442
4479
|
function renderNode(node, props2, dataitem, key, href) {
|
|
4480
|
+
{
|
|
4481
|
+
}
|
|
4443
4482
|
const SelectedNode = NodeTypes2[node.type];
|
|
4444
4483
|
if (!SelectedNode) return null;
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4446
4485
|
SelectedNode,
|
|
4447
4486
|
{
|
|
4448
4487
|
node,
|
|
@@ -4453,11 +4492,9 @@ var DivContainer = async (props) => {
|
|
|
4453
4492
|
host: props2.host,
|
|
4454
4493
|
path: props2.path,
|
|
4455
4494
|
apiBaseUrl: props2.apiBaseUrl,
|
|
4456
|
-
resolveAssetUrl: props2.resolveAssetUrl,
|
|
4457
4495
|
breadcrumb: props2.breadcrumb,
|
|
4458
4496
|
dataitem,
|
|
4459
|
-
href
|
|
4460
|
-
dataMap: props2.dataMap
|
|
4497
|
+
href
|
|
4461
4498
|
}
|
|
4462
4499
|
) }, key);
|
|
4463
4500
|
}
|
|
@@ -4495,6 +4532,8 @@ var DivContainer = async (props) => {
|
|
|
4495
4532
|
return [props.dataitem];
|
|
4496
4533
|
})();
|
|
4497
4534
|
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
4535
|
+
{
|
|
4536
|
+
}
|
|
4498
4537
|
let Wrapper;
|
|
4499
4538
|
let wrapperProps;
|
|
4500
4539
|
switch (true) {
|
|
@@ -4523,6 +4562,8 @@ var DivContainer = async (props) => {
|
|
|
4523
4562
|
const replacementTag = props.node.replaceDivTagWith;
|
|
4524
4563
|
const allowedTags = ["div", "section", "article", "details", "summary"];
|
|
4525
4564
|
if (replacementTag && allowedTags.includes(replacementTag)) {
|
|
4565
|
+
{
|
|
4566
|
+
}
|
|
4526
4567
|
Wrapper = replacementTag;
|
|
4527
4568
|
} else {
|
|
4528
4569
|
Wrapper = "div";
|
|
@@ -4539,9 +4580,9 @@ var DivContainer = async (props) => {
|
|
|
4539
4580
|
props.node.autoFormat && "auto-format",
|
|
4540
4581
|
props.node.bgClass
|
|
4541
4582
|
].filter(Boolean).join(" ");
|
|
4542
|
-
return /* @__PURE__ */ (0,
|
|
4543
|
-
/* @__PURE__ */ (0,
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react50.default.Fragment, { children: [
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4545
4586
|
Wrapper,
|
|
4546
4587
|
{
|
|
4547
4588
|
id: guid,
|
|
@@ -4550,18 +4591,18 @@ var DivContainer = async (props) => {
|
|
|
4550
4591
|
...wrapperProps,
|
|
4551
4592
|
children: dataToRender.map(
|
|
4552
4593
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4553
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
4594
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react50.default.Fragment, { children: child }, i)
|
|
4554
4595
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4555
4596
|
)
|
|
4556
4597
|
}
|
|
4557
4598
|
) }) }),
|
|
4558
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
4599
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
4559
4600
|
] });
|
|
4560
4601
|
};
|
|
4561
4602
|
var DivContainer_default = DivContainer;
|
|
4562
4603
|
|
|
4563
4604
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
4564
|
-
var
|
|
4605
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4565
4606
|
var NodeTypes = {
|
|
4566
4607
|
["paragraph"]: ParagraphNode_default,
|
|
4567
4608
|
["heading"]: HeadingNode_default,
|
|
@@ -4570,7 +4611,6 @@ var NodeTypes = {
|
|
|
4570
4611
|
["code"]: CodeNode_default,
|
|
4571
4612
|
["image"]: ImageNode_default,
|
|
4572
4613
|
["horizontalrule"]: HorizontalRuleNode_default,
|
|
4573
|
-
["layout-container"]: LayoutContainerNode_default,
|
|
4574
4614
|
["widget"]: WidgetNode_default,
|
|
4575
4615
|
["form-container"]: FormContainerNode_default,
|
|
4576
4616
|
["div-container"]: DivContainer_default,
|
|
@@ -4589,11 +4629,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4589
4629
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4590
4630
|
rootNode = pageBodyTree.root;
|
|
4591
4631
|
}
|
|
4592
|
-
return /* @__PURE__ */ (0,
|
|
4632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4593
4633
|
{
|
|
4594
4634
|
}
|
|
4595
4635
|
const SelectedNode = NodeTypes[node.type];
|
|
4596
|
-
return /* @__PURE__ */ (0,
|
|
4636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4597
4637
|
SelectedNode,
|
|
4598
4638
|
{
|
|
4599
4639
|
node,
|
|
@@ -4604,12 +4644,10 @@ var PageBodyRenderer = (props) => {
|
|
|
4604
4644
|
host: props.host,
|
|
4605
4645
|
path: props.path,
|
|
4606
4646
|
apiBaseUrl: props.apiBaseUrl,
|
|
4607
|
-
widgetRegistry: props.widgetRegistry,
|
|
4608
4647
|
serviceClient: props.serviceClient,
|
|
4609
|
-
|
|
4610
|
-
dataMap: props.dataMap
|
|
4648
|
+
assetBaseUrl: props.assetBaseUrl
|
|
4611
4649
|
}
|
|
4612
|
-
) }) : /* @__PURE__ */ (0,
|
|
4650
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4613
4651
|
SelectedNode,
|
|
4614
4652
|
{
|
|
4615
4653
|
node,
|
|
@@ -4619,10 +4657,8 @@ var PageBodyRenderer = (props) => {
|
|
|
4619
4657
|
host: props.host,
|
|
4620
4658
|
path: props.path,
|
|
4621
4659
|
apiBaseUrl: props.apiBaseUrl,
|
|
4622
|
-
widgetRegistry: props.widgetRegistry,
|
|
4623
4660
|
serviceClient: props.serviceClient,
|
|
4624
|
-
|
|
4625
|
-
dataMap: props.dataMap
|
|
4661
|
+
assetBaseUrl: props.assetBaseUrl
|
|
4626
4662
|
}
|
|
4627
4663
|
) }) }) }, index);
|
|
4628
4664
|
}) });
|