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