@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260423042903 → 0.8.1-dev.20260423063335
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/{HlsPlayer-IBPSMECZ.mjs → HlsPlayer-CTZICLSJ.mjs} +1 -1
- package/dist/{chunk-BV2VX3HP.mjs → chunk-VNSFFK3H.mjs} +38 -6
- package/dist/index.d.mts +112 -1
- package/dist/index.d.ts +112 -1
- package/dist/index.js +1014 -825
- package/dist/index.mjs +571 -416
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,15 +89,15 @@ var init_StyleTypes = __esm({
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
// src/components/ClientButton.tsx
|
|
92
|
-
var
|
|
92
|
+
var import_react23, import_jsx_runtime24, ClientButton, ClientButton_default;
|
|
93
93
|
var init_ClientButton = __esm({
|
|
94
94
|
"src/components/ClientButton.tsx"() {
|
|
95
95
|
"use strict";
|
|
96
96
|
"use client";
|
|
97
|
-
|
|
97
|
+
import_react23 = __toESM(require("react"));
|
|
98
98
|
init_ToastService();
|
|
99
99
|
init_StyleTypes();
|
|
100
|
-
|
|
100
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
101
101
|
ClientButton = (props) => {
|
|
102
102
|
const execute = async (event) => {
|
|
103
103
|
if (props.onClick !== void 0) {
|
|
@@ -107,7 +107,7 @@ var init_ClientButton = __esm({
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
110
|
-
return /* @__PURE__ */ (0,
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react23.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
111
111
|
"button",
|
|
112
112
|
{
|
|
113
113
|
type: "button",
|
|
@@ -122,17 +122,17 @@ var init_ClientButton = __esm({
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
// src/components/Confirm.tsx
|
|
125
|
-
var
|
|
125
|
+
var import_react24, import_jsx_runtime25, Confirm, Confirm_default;
|
|
126
126
|
var init_Confirm = __esm({
|
|
127
127
|
"src/components/Confirm.tsx"() {
|
|
128
128
|
"use strict";
|
|
129
129
|
"use client";
|
|
130
|
-
|
|
130
|
+
import_react24 = require("react");
|
|
131
131
|
init_ClientButton();
|
|
132
132
|
init_StyleTypes();
|
|
133
|
-
|
|
133
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
134
134
|
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
135
|
-
const [showModal, setShowModal] = (0,
|
|
135
|
+
const [showModal, setShowModal] = (0, import_react24.useState)(true);
|
|
136
136
|
const handleConfirmAction = () => {
|
|
137
137
|
setShowModal(false);
|
|
138
138
|
if (onConfirm) {
|
|
@@ -145,13 +145,13 @@ var init_Confirm = __esm({
|
|
|
145
145
|
onCancel();
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
return /* @__PURE__ */ (0,
|
|
149
|
-
/* @__PURE__ */ (0,
|
|
150
|
-
/* @__PURE__ */ (0,
|
|
151
|
-
/* @__PURE__ */ (0,
|
|
152
|
-
/* @__PURE__ */ (0,
|
|
153
|
-
/* @__PURE__ */ (0,
|
|
154
|
-
/* @__PURE__ */ (0,
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mb-4", children: message }),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
155
155
|
ClientButton_default,
|
|
156
156
|
{
|
|
157
157
|
onClick: handleCancelAction,
|
|
@@ -159,7 +159,7 @@ var init_Confirm = __esm({
|
|
|
159
159
|
children: "Cancel"
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */ (0,
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
163
163
|
ClientButton_default,
|
|
164
164
|
{
|
|
165
165
|
onClick: handleConfirmAction,
|
|
@@ -177,21 +177,21 @@ var init_Confirm = __esm({
|
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
// src/components/Button.tsx
|
|
180
|
-
var
|
|
180
|
+
var import_react25, import_jsx_runtime26, Button, Button_default;
|
|
181
181
|
var init_Button = __esm({
|
|
182
182
|
"src/components/Button.tsx"() {
|
|
183
183
|
"use strict";
|
|
184
184
|
"use client";
|
|
185
|
-
|
|
185
|
+
import_react25 = __toESM(require("react"));
|
|
186
186
|
init_ToastService();
|
|
187
187
|
init_StyleTypes();
|
|
188
188
|
init_Confirm();
|
|
189
|
-
|
|
189
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
190
190
|
Button = (props) => {
|
|
191
|
-
const [inProgress, setInProgress] = (0,
|
|
192
|
-
const [isActionPerformed, setIsActionPerformed] = (0,
|
|
193
|
-
const [responseMessage, setResponseMessage] = (0,
|
|
194
|
-
const [showModal, setShowModal] = (0,
|
|
191
|
+
const [inProgress, setInProgress] = (0, import_react25.useState)(false);
|
|
192
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react25.useState)(false);
|
|
193
|
+
const [responseMessage, setResponseMessage] = (0, import_react25.useState)(null);
|
|
194
|
+
const [showModal, setShowModal] = (0, import_react25.useState)(null);
|
|
195
195
|
const execute = async (event) => {
|
|
196
196
|
event.preventDefault();
|
|
197
197
|
event.stopPropagation();
|
|
@@ -235,14 +235,14 @@ var init_Button = __esm({
|
|
|
235
235
|
return new Promise((resolve) => {
|
|
236
236
|
const onConfirm = () => resolve(true);
|
|
237
237
|
const onCancel = () => resolve(false);
|
|
238
|
-
setShowModal(/* @__PURE__ */ (0,
|
|
238
|
+
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
239
239
|
});
|
|
240
240
|
};
|
|
241
241
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
242
242
|
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
243
243
|
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
244
|
-
return /* @__PURE__ */ (0,
|
|
245
|
-
/* @__PURE__ */ (0,
|
|
244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react25.default.Fragment, { children: [
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
246
246
|
"button",
|
|
247
247
|
{
|
|
248
248
|
type: "submit",
|
|
@@ -252,9 +252,9 @@ var init_Button = __esm({
|
|
|
252
252
|
className: buttonClass + " relative " + props.className,
|
|
253
253
|
children: [
|
|
254
254
|
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
255
|
-
inProgress && /* @__PURE__ */ (0,
|
|
256
|
-
/* @__PURE__ */ (0,
|
|
257
|
-
/* @__PURE__ */ (0,
|
|
255
|
+
inProgress && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react25.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { className: "animate-spin ml-2 mr-3 h-5 w-5 " + progressClass, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
258
258
|
] }) })
|
|
259
259
|
]
|
|
260
260
|
}
|
|
@@ -266,232 +266,6 @@ var init_Button = __esm({
|
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
-
// src/components/HlsPlayer.tsx
|
|
270
|
-
var HlsPlayer_exports = {};
|
|
271
|
-
__export(HlsPlayer_exports, {
|
|
272
|
-
default: () => HlsPlayer_default
|
|
273
|
-
});
|
|
274
|
-
var import_react33, import_hls, import_jsx_runtime42, HlsPlayer, HlsPlayer_default;
|
|
275
|
-
var init_HlsPlayer = __esm({
|
|
276
|
-
"src/components/HlsPlayer.tsx"() {
|
|
277
|
-
"use strict";
|
|
278
|
-
"use client";
|
|
279
|
-
import_react33 = __toESM(require("react"));
|
|
280
|
-
import_hls = __toESM(require("hls.js"));
|
|
281
|
-
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
282
|
-
HlsPlayer = import_react33.default.memo(
|
|
283
|
-
({
|
|
284
|
-
sources,
|
|
285
|
-
assetUrl,
|
|
286
|
-
posterUrl,
|
|
287
|
-
intrinsicWidth,
|
|
288
|
-
intrinsicHeight,
|
|
289
|
-
showControls = true,
|
|
290
|
-
loop = false,
|
|
291
|
-
playOptions = "autoplay",
|
|
292
|
-
placementCode = ""
|
|
293
|
-
}) => {
|
|
294
|
-
const videoRef = (0, import_react33.useRef)(null);
|
|
295
|
-
const hlsRef = (0, import_react33.useRef)(null);
|
|
296
|
-
const [isPlaying, setIsPlaying] = (0, import_react33.useState)(playOptions === "autoplay");
|
|
297
|
-
const [isHovered, setIsHovered] = (0, import_react33.useState)(false);
|
|
298
|
-
const [isMobile, setIsMobile] = (0, import_react33.useState)(false);
|
|
299
|
-
const wasManuallyPausedRef = (0, import_react33.useRef)(false);
|
|
300
|
-
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
301
|
-
(0, import_react33.useEffect)(() => {
|
|
302
|
-
const checkMobile = () => {
|
|
303
|
-
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
304
|
-
const isSmallScreen = window.innerWidth <= 768;
|
|
305
|
-
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
306
|
-
navigator.userAgent.toLowerCase()
|
|
307
|
-
);
|
|
308
|
-
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
309
|
-
};
|
|
310
|
-
checkMobile();
|
|
311
|
-
window.addEventListener("resize", checkMobile);
|
|
312
|
-
return () => window.removeEventListener("resize", checkMobile);
|
|
313
|
-
}, []);
|
|
314
|
-
(0, import_react33.useEffect)(() => {
|
|
315
|
-
const v = videoRef.current;
|
|
316
|
-
if (!v || resolvedSources.length === 0) return;
|
|
317
|
-
if (hlsRef.current) {
|
|
318
|
-
hlsRef.current.destroy();
|
|
319
|
-
hlsRef.current = null;
|
|
320
|
-
}
|
|
321
|
-
if (import_hls.default.isSupported()) {
|
|
322
|
-
const hls = new import_hls.default();
|
|
323
|
-
const onLoadStart = () => {
|
|
324
|
-
const chosenSrc = v.currentSrc;
|
|
325
|
-
if (!chosenSrc) return;
|
|
326
|
-
hls.loadSource(chosenSrc);
|
|
327
|
-
hls.attachMedia(v);
|
|
328
|
-
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
329
|
-
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
330
|
-
v.play().catch(console.error);
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
335
|
-
v.load();
|
|
336
|
-
hlsRef.current = hls;
|
|
337
|
-
return () => {
|
|
338
|
-
v.removeEventListener("loadstart", onLoadStart);
|
|
339
|
-
hls.destroy();
|
|
340
|
-
hlsRef.current = null;
|
|
341
|
-
};
|
|
342
|
-
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
343
|
-
v.load();
|
|
344
|
-
}
|
|
345
|
-
}, [JSON.stringify(resolvedSources)]);
|
|
346
|
-
const handlePlayPause = (0, import_react33.useCallback)(() => {
|
|
347
|
-
const v = videoRef.current;
|
|
348
|
-
if (!v) return;
|
|
349
|
-
if (v.paused) {
|
|
350
|
-
wasManuallyPausedRef.current = false;
|
|
351
|
-
v.play().then(() => setIsPlaying(true));
|
|
352
|
-
} else {
|
|
353
|
-
wasManuallyPausedRef.current = true;
|
|
354
|
-
v.pause();
|
|
355
|
-
setIsPlaying(false);
|
|
356
|
-
}
|
|
357
|
-
}, []);
|
|
358
|
-
const handleMouseEnter = (0, import_react33.useCallback)(() => {
|
|
359
|
-
if (isMobile) return;
|
|
360
|
-
setIsHovered(true);
|
|
361
|
-
if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
|
|
362
|
-
videoRef.current.play().then(() => setIsPlaying(true));
|
|
363
|
-
}
|
|
364
|
-
}, [playOptions, isMobile]);
|
|
365
|
-
const handleMouseLeave = (0, import_react33.useCallback)(() => {
|
|
366
|
-
if (isMobile) return;
|
|
367
|
-
setIsHovered(false);
|
|
368
|
-
if (playOptions === "playOnHover" && videoRef.current) {
|
|
369
|
-
videoRef.current.pause();
|
|
370
|
-
videoRef.current.currentTime = 0;
|
|
371
|
-
setIsPlaying(false);
|
|
372
|
-
}
|
|
373
|
-
}, [playOptions, isMobile]);
|
|
374
|
-
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
375
|
-
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
376
|
-
if (resolvedSources.length === 0) return null;
|
|
377
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
378
|
-
"div",
|
|
379
|
-
{
|
|
380
|
-
className: "relative w-full aspect-video bg-black",
|
|
381
|
-
onMouseEnter: handleMouseEnter,
|
|
382
|
-
onMouseLeave: handleMouseLeave,
|
|
383
|
-
children: [
|
|
384
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
385
|
-
"video",
|
|
386
|
-
{
|
|
387
|
-
ref: videoRef,
|
|
388
|
-
className: "w-full h-full object-contain",
|
|
389
|
-
poster: fallbackPoster,
|
|
390
|
-
controls: showControls && (isMobile || isPlaying),
|
|
391
|
-
muted: playOptions === "autoplay" || playOptions === "playOnHover",
|
|
392
|
-
autoPlay: playOptions === "autoplay",
|
|
393
|
-
loop,
|
|
394
|
-
playsInline: true,
|
|
395
|
-
onClick: !isMobile ? handlePlayPause : void 0,
|
|
396
|
-
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
397
|
-
"source",
|
|
398
|
-
{
|
|
399
|
-
src,
|
|
400
|
-
type: "application/x-mpegURL",
|
|
401
|
-
...media ? { media } : {}
|
|
402
|
-
},
|
|
403
|
-
i
|
|
404
|
-
))
|
|
405
|
-
}
|
|
406
|
-
),
|
|
407
|
-
!isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
408
|
-
"picture",
|
|
409
|
-
{
|
|
410
|
-
className: `absolute inset-0 transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`,
|
|
411
|
-
children: [
|
|
412
|
-
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("source", { media, srcSet: src }, i)),
|
|
413
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
414
|
-
"img",
|
|
415
|
-
{
|
|
416
|
-
src: fallbackPoster,
|
|
417
|
-
width: intrinsicWidth,
|
|
418
|
-
height: intrinsicHeight,
|
|
419
|
-
alt: "poster",
|
|
420
|
-
className: "w-full h-full object-cover"
|
|
421
|
-
}
|
|
422
|
-
)
|
|
423
|
-
]
|
|
424
|
-
}
|
|
425
|
-
),
|
|
426
|
-
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
427
|
-
"div",
|
|
428
|
-
{
|
|
429
|
-
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
430
|
-
style: {
|
|
431
|
-
opacity: !isPlaying || isHovered ? 1 : 0,
|
|
432
|
-
transition: "opacity 0.25s ease"
|
|
433
|
-
},
|
|
434
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
435
|
-
"button",
|
|
436
|
-
{
|
|
437
|
-
type: "button",
|
|
438
|
-
"aria-label": isPlaying ? "Pause" : "Play",
|
|
439
|
-
onClick: (e) => {
|
|
440
|
-
e.stopPropagation();
|
|
441
|
-
handlePlayPause();
|
|
442
|
-
},
|
|
443
|
-
style: {
|
|
444
|
-
pointerEvents: "auto",
|
|
445
|
-
width: 64,
|
|
446
|
-
height: 64,
|
|
447
|
-
borderRadius: "50%",
|
|
448
|
-
border: "1.5px solid rgba(255,255,255,0.18)",
|
|
449
|
-
cursor: "pointer",
|
|
450
|
-
display: "flex",
|
|
451
|
-
alignItems: "center",
|
|
452
|
-
justifyContent: "center",
|
|
453
|
-
background: "rgba(0, 0, 0, 0.45)",
|
|
454
|
-
backdropFilter: "blur(10px)",
|
|
455
|
-
WebkitBackdropFilter: "blur(10px)",
|
|
456
|
-
boxShadow: "0 4px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",
|
|
457
|
-
transition: "transform 0.18s ease, background 0.18s ease, border-color 0.18s ease"
|
|
458
|
-
},
|
|
459
|
-
onMouseEnter: (e) => {
|
|
460
|
-
const btn = e.currentTarget;
|
|
461
|
-
btn.style.transform = "scale(1.1)";
|
|
462
|
-
btn.style.background = "rgba(0,0,0,0.65)";
|
|
463
|
-
btn.style.borderColor = "rgba(255,255,255,0.32)";
|
|
464
|
-
},
|
|
465
|
-
onMouseLeave: (e) => {
|
|
466
|
-
const btn = e.currentTarget;
|
|
467
|
-
btn.style.transform = "scale(1)";
|
|
468
|
-
btn.style.background = "rgba(0,0,0,0.45)";
|
|
469
|
-
btn.style.borderColor = "rgba(255,255,255,0.18)";
|
|
470
|
-
},
|
|
471
|
-
children: isPlaying ? (
|
|
472
|
-
/* Pause — two rounded bars */
|
|
473
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
474
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("rect", { x: "3.5", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" }),
|
|
475
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("rect", { x: "12", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" })
|
|
476
|
-
] })
|
|
477
|
-
) : (
|
|
478
|
-
/* Play — solid triangle, nudged right for optical balance */
|
|
479
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { transform: "translateX(2px)" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M5 3.5L17 10L5 16.5V3.5Z", fill: "white" }) })
|
|
480
|
-
)
|
|
481
|
-
}
|
|
482
|
-
)
|
|
483
|
-
}
|
|
484
|
-
)
|
|
485
|
-
]
|
|
486
|
-
}
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
);
|
|
490
|
-
HlsPlayer.displayName = "HlsPlayer";
|
|
491
|
-
HlsPlayer_default = HlsPlayer;
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
|
|
495
269
|
// src/clients/CacheManage.tsx
|
|
496
270
|
var import_node_cache, CacheManager;
|
|
497
271
|
var init_CacheManage = __esm({
|
|
@@ -710,33 +484,291 @@ var init_ServiceClient = __esm({
|
|
|
710
484
|
}
|
|
711
485
|
});
|
|
712
486
|
|
|
487
|
+
// src/components/HlsPlayer.tsx
|
|
488
|
+
var HlsPlayer_exports = {};
|
|
489
|
+
__export(HlsPlayer_exports, {
|
|
490
|
+
default: () => HlsPlayer_default
|
|
491
|
+
});
|
|
492
|
+
var import_react35, import_hls, import_jsx_runtime44, HlsPlayer, HlsPlayer_default;
|
|
493
|
+
var init_HlsPlayer = __esm({
|
|
494
|
+
"src/components/HlsPlayer.tsx"() {
|
|
495
|
+
"use strict";
|
|
496
|
+
"use client";
|
|
497
|
+
import_react35 = __toESM(require("react"));
|
|
498
|
+
import_hls = __toESM(require("hls.js"));
|
|
499
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
500
|
+
HlsPlayer = import_react35.default.memo(
|
|
501
|
+
({
|
|
502
|
+
sources,
|
|
503
|
+
assetUrl,
|
|
504
|
+
posterUrl,
|
|
505
|
+
intrinsicWidth,
|
|
506
|
+
intrinsicHeight,
|
|
507
|
+
showControls = true,
|
|
508
|
+
loop = false,
|
|
509
|
+
playOptions = "autoplay",
|
|
510
|
+
placementCode = ""
|
|
511
|
+
}) => {
|
|
512
|
+
const videoRef = (0, import_react35.useRef)(null);
|
|
513
|
+
const hlsRef = (0, import_react35.useRef)(null);
|
|
514
|
+
const [isPlaying, setIsPlaying] = (0, import_react35.useState)(playOptions === "autoplay");
|
|
515
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
516
|
+
const [isMobile, setIsMobile] = (0, import_react35.useState)(false);
|
|
517
|
+
const [isControlsVisible, setIsControlsVisible] = (0, import_react35.useState)(true);
|
|
518
|
+
const wasManuallyPausedRef = (0, import_react35.useRef)(false);
|
|
519
|
+
const inactivityTimerRef = (0, import_react35.useRef)(null);
|
|
520
|
+
const INACTIVITY_DELAY = 2500;
|
|
521
|
+
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
522
|
+
(0, import_react35.useEffect)(() => {
|
|
523
|
+
const checkMobile = () => {
|
|
524
|
+
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
525
|
+
const isSmallScreen = window.innerWidth <= 768;
|
|
526
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
527
|
+
navigator.userAgent.toLowerCase()
|
|
528
|
+
);
|
|
529
|
+
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
530
|
+
};
|
|
531
|
+
checkMobile();
|
|
532
|
+
window.addEventListener("resize", checkMobile);
|
|
533
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
534
|
+
}, []);
|
|
535
|
+
const resetInactivityTimer = (0, import_react35.useCallback)(() => {
|
|
536
|
+
setIsControlsVisible(true);
|
|
537
|
+
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
538
|
+
if (isPlaying) {
|
|
539
|
+
inactivityTimerRef.current = setTimeout(
|
|
540
|
+
() => setIsControlsVisible(false),
|
|
541
|
+
INACTIVITY_DELAY
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
}, [isPlaying]);
|
|
545
|
+
(0, import_react35.useEffect)(() => {
|
|
546
|
+
if (!isPlaying) {
|
|
547
|
+
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
548
|
+
setIsControlsVisible(true);
|
|
549
|
+
}
|
|
550
|
+
}, [isPlaying]);
|
|
551
|
+
(0, import_react35.useEffect)(() => {
|
|
552
|
+
return () => {
|
|
553
|
+
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
554
|
+
};
|
|
555
|
+
}, []);
|
|
556
|
+
(0, import_react35.useEffect)(() => {
|
|
557
|
+
const v = videoRef.current;
|
|
558
|
+
if (!v || resolvedSources.length === 0) return;
|
|
559
|
+
if (hlsRef.current) {
|
|
560
|
+
hlsRef.current.destroy();
|
|
561
|
+
hlsRef.current = null;
|
|
562
|
+
}
|
|
563
|
+
if (import_hls.default.isSupported()) {
|
|
564
|
+
const hls = new import_hls.default();
|
|
565
|
+
const onLoadStart = () => {
|
|
566
|
+
const chosenSrc = v.currentSrc;
|
|
567
|
+
if (!chosenSrc) return;
|
|
568
|
+
hls.loadSource(chosenSrc);
|
|
569
|
+
hls.attachMedia(v);
|
|
570
|
+
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
571
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
572
|
+
v.play().catch(console.error);
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
577
|
+
v.load();
|
|
578
|
+
hlsRef.current = hls;
|
|
579
|
+
return () => {
|
|
580
|
+
v.removeEventListener("loadstart", onLoadStart);
|
|
581
|
+
hls.destroy();
|
|
582
|
+
hlsRef.current = null;
|
|
583
|
+
};
|
|
584
|
+
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
585
|
+
v.load();
|
|
586
|
+
}
|
|
587
|
+
}, [JSON.stringify(resolvedSources)]);
|
|
588
|
+
const handlePlayPause = (0, import_react35.useCallback)(() => {
|
|
589
|
+
const v = videoRef.current;
|
|
590
|
+
if (!v) return;
|
|
591
|
+
if (v.paused) {
|
|
592
|
+
wasManuallyPausedRef.current = false;
|
|
593
|
+
v.play().then(() => setIsPlaying(true));
|
|
594
|
+
} else {
|
|
595
|
+
wasManuallyPausedRef.current = true;
|
|
596
|
+
v.pause();
|
|
597
|
+
setIsPlaying(false);
|
|
598
|
+
}
|
|
599
|
+
}, []);
|
|
600
|
+
const handleMouseEnter = (0, import_react35.useCallback)(() => {
|
|
601
|
+
if (isMobile) return;
|
|
602
|
+
setIsHovered(true);
|
|
603
|
+
resetInactivityTimer();
|
|
604
|
+
if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
|
|
605
|
+
videoRef.current.play().then(() => setIsPlaying(true));
|
|
606
|
+
}
|
|
607
|
+
}, [playOptions, isMobile, resetInactivityTimer]);
|
|
608
|
+
const handleMouseLeave = (0, import_react35.useCallback)(() => {
|
|
609
|
+
if (isMobile) return;
|
|
610
|
+
setIsHovered(false);
|
|
611
|
+
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
612
|
+
if (isPlaying) setIsControlsVisible(false);
|
|
613
|
+
if (playOptions === "playOnHover" && videoRef.current) {
|
|
614
|
+
videoRef.current.pause();
|
|
615
|
+
videoRef.current.currentTime = 0;
|
|
616
|
+
setIsPlaying(false);
|
|
617
|
+
}
|
|
618
|
+
}, [playOptions, isMobile, isPlaying]);
|
|
619
|
+
const handleMouseMove = (0, import_react35.useCallback)(() => {
|
|
620
|
+
if (isMobile) return;
|
|
621
|
+
resetInactivityTimer();
|
|
622
|
+
}, [isMobile, resetInactivityTimer]);
|
|
623
|
+
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
624
|
+
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
625
|
+
if (resolvedSources.length === 0) return null;
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
className: "relative w-full aspect-video bg-black",
|
|
630
|
+
onMouseEnter: handleMouseEnter,
|
|
631
|
+
onMouseLeave: handleMouseLeave,
|
|
632
|
+
onMouseMove: handleMouseMove,
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
635
|
+
"video",
|
|
636
|
+
{
|
|
637
|
+
ref: videoRef,
|
|
638
|
+
className: "w-full h-full object-contain",
|
|
639
|
+
poster: fallbackPoster,
|
|
640
|
+
controls: showControls && (isMobile || isPlaying),
|
|
641
|
+
muted: playOptions === "autoplay" || playOptions === "playOnHover",
|
|
642
|
+
autoPlay: playOptions === "autoplay",
|
|
643
|
+
loop,
|
|
644
|
+
playsInline: true,
|
|
645
|
+
onClick: !isMobile ? handlePlayPause : void 0,
|
|
646
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
647
|
+
"source",
|
|
648
|
+
{
|
|
649
|
+
src,
|
|
650
|
+
type: "application/x-mpegURL",
|
|
651
|
+
...media ? { media } : {}
|
|
652
|
+
},
|
|
653
|
+
i
|
|
654
|
+
))
|
|
655
|
+
}
|
|
656
|
+
),
|
|
657
|
+
!isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
658
|
+
"picture",
|
|
659
|
+
{
|
|
660
|
+
className: `absolute inset-0 transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`,
|
|
661
|
+
children: [
|
|
662
|
+
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("source", { media, srcSet: src }, i)),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
664
|
+
"img",
|
|
665
|
+
{
|
|
666
|
+
src: fallbackPoster,
|
|
667
|
+
width: intrinsicWidth,
|
|
668
|
+
height: intrinsicHeight,
|
|
669
|
+
alt: "poster",
|
|
670
|
+
className: "w-full h-full object-cover"
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
),
|
|
676
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
677
|
+
"div",
|
|
678
|
+
{
|
|
679
|
+
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
680
|
+
style: {
|
|
681
|
+
opacity: isControlsVisible ? 1 : 0,
|
|
682
|
+
transition: "opacity 0.3s ease"
|
|
683
|
+
},
|
|
684
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
685
|
+
"button",
|
|
686
|
+
{
|
|
687
|
+
type: "button",
|
|
688
|
+
"aria-label": isPlaying ? "Pause" : "Play",
|
|
689
|
+
onClick: (e) => {
|
|
690
|
+
e.stopPropagation();
|
|
691
|
+
handlePlayPause();
|
|
692
|
+
},
|
|
693
|
+
style: {
|
|
694
|
+
pointerEvents: isControlsVisible ? "auto" : "none",
|
|
695
|
+
width: 64,
|
|
696
|
+
height: 64,
|
|
697
|
+
borderRadius: "50%",
|
|
698
|
+
border: "1.5px solid rgba(255,255,255,0.18)",
|
|
699
|
+
cursor: "pointer",
|
|
700
|
+
display: "flex",
|
|
701
|
+
alignItems: "center",
|
|
702
|
+
justifyContent: "center",
|
|
703
|
+
background: "rgba(0, 0, 0, 0.45)",
|
|
704
|
+
backdropFilter: "blur(10px)",
|
|
705
|
+
WebkitBackdropFilter: "blur(10px)",
|
|
706
|
+
boxShadow: "0 4px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",
|
|
707
|
+
transition: "transform 0.18s ease, background 0.18s ease, border-color 0.18s ease"
|
|
708
|
+
},
|
|
709
|
+
onMouseEnter: (e) => {
|
|
710
|
+
const btn = e.currentTarget;
|
|
711
|
+
btn.style.transform = "scale(1.1)";
|
|
712
|
+
btn.style.background = "rgba(0,0,0,0.65)";
|
|
713
|
+
btn.style.borderColor = "rgba(255,255,255,0.32)";
|
|
714
|
+
},
|
|
715
|
+
onMouseLeave: (e) => {
|
|
716
|
+
const btn = e.currentTarget;
|
|
717
|
+
btn.style.transform = "scale(1)";
|
|
718
|
+
btn.style.background = "rgba(0,0,0,0.45)";
|
|
719
|
+
btn.style.borderColor = "rgba(255,255,255,0.18)";
|
|
720
|
+
},
|
|
721
|
+
children: isPlaying ? (
|
|
722
|
+
/* Pause — two rounded bars */
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "3.5", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" }),
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "12", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" })
|
|
726
|
+
] })
|
|
727
|
+
) : (
|
|
728
|
+
/* Play — solid triangle, nudged right for optical balance */
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M5 3.5L17 10L5 16.5V3.5Z", fill: "white" }) })
|
|
730
|
+
)
|
|
731
|
+
}
|
|
732
|
+
)
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
HlsPlayer.displayName = "HlsPlayer";
|
|
741
|
+
HlsPlayer_default = HlsPlayer;
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
|
|
713
745
|
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
714
746
|
var LinkNodeButton_exports = {};
|
|
715
747
|
__export(LinkNodeButton_exports, {
|
|
716
748
|
default: () => LinkNodeButton_default
|
|
717
749
|
});
|
|
718
|
-
var
|
|
750
|
+
var import_react37, import_jsx_runtime47, LinkNodeButton, LinkNodeButton_default;
|
|
719
751
|
var init_LinkNodeButton = __esm({
|
|
720
752
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
721
753
|
"use strict";
|
|
722
754
|
"use client";
|
|
723
|
-
|
|
755
|
+
import_react37 = require("react");
|
|
724
756
|
init_Button();
|
|
725
757
|
init_ServiceClient();
|
|
726
758
|
init_ToastService();
|
|
727
|
-
|
|
759
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
728
760
|
LinkNodeButton = (props) => {
|
|
729
761
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
730
|
-
const [isLoading, setIsLoading] = (0,
|
|
731
|
-
const [error, setError] = (0,
|
|
732
|
-
const extractFieldNames = (0,
|
|
762
|
+
const [isLoading, setIsLoading] = (0, import_react37.useState)(false);
|
|
763
|
+
const [error, setError] = (0, import_react37.useState)(null);
|
|
764
|
+
const extractFieldNames = (0, import_react37.useCallback)((template) => {
|
|
733
765
|
if (!template) return [];
|
|
734
766
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
735
767
|
const matches = Array.from(template.matchAll(regex));
|
|
736
768
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
737
769
|
return fieldNames;
|
|
738
770
|
}, []);
|
|
739
|
-
const replaceTemplateVariables = (0,
|
|
771
|
+
const replaceTemplateVariables = (0, import_react37.useCallback)((template, responseData) => {
|
|
740
772
|
if (!template) return template;
|
|
741
773
|
let result = template;
|
|
742
774
|
const fieldNames = extractFieldNames(template);
|
|
@@ -765,7 +797,7 @@ var init_LinkNodeButton = __esm({
|
|
|
765
797
|
}
|
|
766
798
|
return result;
|
|
767
799
|
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
768
|
-
const getNestedValue3 = (0,
|
|
800
|
+
const getNestedValue3 = (0, import_react37.useCallback)((obj, path) => {
|
|
769
801
|
if (!obj || !path) return void 0;
|
|
770
802
|
if (obj[path] !== void 0) {
|
|
771
803
|
return obj[path];
|
|
@@ -780,7 +812,7 @@ var init_LinkNodeButton = __esm({
|
|
|
780
812
|
}
|
|
781
813
|
return current;
|
|
782
814
|
}, []);
|
|
783
|
-
const onClick = (0,
|
|
815
|
+
const onClick = (0, import_react37.useCallback)(async (e) => {
|
|
784
816
|
if (!node.postUrl) {
|
|
785
817
|
setError("No POST URL configured for this button");
|
|
786
818
|
return;
|
|
@@ -867,11 +899,11 @@ var init_LinkNodeButton = __esm({
|
|
|
867
899
|
return children;
|
|
868
900
|
}
|
|
869
901
|
if (linkText) {
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: linkText });
|
|
871
903
|
}
|
|
872
904
|
return node.title || "Button";
|
|
873
905
|
};
|
|
874
|
-
return /* @__PURE__ */ (0,
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
875
907
|
Button_default,
|
|
876
908
|
{
|
|
877
909
|
ButtonType: linkType,
|
|
@@ -892,9 +924,9 @@ __export(CopyButton_exports, {
|
|
|
892
924
|
default: () => CopyButton
|
|
893
925
|
});
|
|
894
926
|
function CopyButton({ text }) {
|
|
895
|
-
const [copied, setCopied] = (0,
|
|
896
|
-
const timeoutRef = (0,
|
|
897
|
-
(0,
|
|
927
|
+
const [copied, setCopied] = (0, import_react44.useState)(false);
|
|
928
|
+
const timeoutRef = (0, import_react44.useRef)(null);
|
|
929
|
+
(0, import_react44.useEffect)(() => {
|
|
898
930
|
return () => {
|
|
899
931
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
900
932
|
};
|
|
@@ -909,13 +941,13 @@ function CopyButton({ text }) {
|
|
|
909
941
|
console.error("Failed to copy: ", err);
|
|
910
942
|
}
|
|
911
943
|
};
|
|
912
|
-
return /* @__PURE__ */ (0,
|
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
913
945
|
"button",
|
|
914
946
|
{
|
|
915
947
|
onClick: handleCopy,
|
|
916
948
|
className: "flex gap-1 items-center hover:text-white transition",
|
|
917
949
|
children: [
|
|
918
|
-
/* @__PURE__ */ (0,
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
919
951
|
"svg",
|
|
920
952
|
{
|
|
921
953
|
width: "16",
|
|
@@ -923,7 +955,7 @@ function CopyButton({ text }) {
|
|
|
923
955
|
viewBox: "0 0 24 24",
|
|
924
956
|
className: "w-4 h-4",
|
|
925
957
|
fill: "currentColor",
|
|
926
|
-
children: /* @__PURE__ */ (0,
|
|
958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
927
959
|
"path",
|
|
928
960
|
{
|
|
929
961
|
fillRule: "evenodd",
|
|
@@ -938,54 +970,54 @@ function CopyButton({ text }) {
|
|
|
938
970
|
}
|
|
939
971
|
);
|
|
940
972
|
}
|
|
941
|
-
var
|
|
973
|
+
var import_react44, import_jsx_runtime57;
|
|
942
974
|
var init_CopyButton = __esm({
|
|
943
975
|
"src/components/CopyButton.tsx"() {
|
|
944
976
|
"use strict";
|
|
945
977
|
"use client";
|
|
946
|
-
|
|
947
|
-
|
|
978
|
+
import_react44 = require("react");
|
|
979
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
948
980
|
}
|
|
949
981
|
});
|
|
950
982
|
|
|
951
983
|
// src/components/IFrameLoaderView.tsx
|
|
952
|
-
var
|
|
984
|
+
var import_react48, import_jsx_runtime63, IFrameLoaderView, IFrameLoaderView_default;
|
|
953
985
|
var init_IFrameLoaderView = __esm({
|
|
954
986
|
"src/components/IFrameLoaderView.tsx"() {
|
|
955
987
|
"use strict";
|
|
956
|
-
|
|
957
|
-
|
|
988
|
+
import_react48 = __toESM(require("react"));
|
|
989
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
958
990
|
IFrameLoaderView = (props) => {
|
|
959
|
-
return /* @__PURE__ */ (0,
|
|
960
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
961
|
-
/* @__PURE__ */ (0,
|
|
962
|
-
/* @__PURE__ */ (0,
|
|
963
|
-
/* @__PURE__ */ (0,
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
965
|
-
/* @__PURE__ */ (0,
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react48.default.Fragment, { children: [
|
|
992
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ml-2", children: [
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
966
998
|
] })
|
|
967
999
|
] }),
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
969
|
-
/* @__PURE__ */ (0,
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
971
|
-
/* @__PURE__ */ (0,
|
|
972
|
-
/* @__PURE__ */ (0,
|
|
973
|
-
/* @__PURE__ */ (0,
|
|
974
|
-
/* @__PURE__ */ (0,
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1004
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
975
1007
|
] }),
|
|
976
|
-
/* @__PURE__ */ (0,
|
|
977
|
-
/* @__PURE__ */ (0,
|
|
978
|
-
/* @__PURE__ */ (0,
|
|
979
|
-
/* @__PURE__ */ (0,
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
981
|
-
/* @__PURE__ */ (0,
|
|
1008
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
982
1014
|
] }),
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
984
|
-
/* @__PURE__ */ (0,
|
|
985
|
-
/* @__PURE__ */ (0,
|
|
986
|
-
/* @__PURE__ */ (0,
|
|
987
|
-
/* @__PURE__ */ (0,
|
|
988
|
-
/* @__PURE__ */ (0,
|
|
1015
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1016
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1018
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1019
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
989
1021
|
] })
|
|
990
1022
|
] })
|
|
991
1023
|
] }) }),
|
|
@@ -1001,19 +1033,19 @@ var IframeClient_exports = {};
|
|
|
1001
1033
|
__export(IframeClient_exports, {
|
|
1002
1034
|
default: () => IframeClient_default
|
|
1003
1035
|
});
|
|
1004
|
-
var
|
|
1036
|
+
var import_react49, import_jsx_runtime64, IframeClient, IframeClient_default;
|
|
1005
1037
|
var init_IframeClient = __esm({
|
|
1006
1038
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1007
1039
|
"use strict";
|
|
1008
1040
|
"use client";
|
|
1009
|
-
|
|
1041
|
+
import_react49 = __toESM(require("react"));
|
|
1010
1042
|
init_IFrameLoaderView();
|
|
1011
|
-
|
|
1043
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
1012
1044
|
IframeClient = ({ src }) => {
|
|
1013
|
-
const iframeRef = (0,
|
|
1014
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
1015
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
1016
|
-
(0,
|
|
1045
|
+
const iframeRef = (0, import_react49.useRef)(null);
|
|
1046
|
+
const [iframeHeight, setIframeHeight] = (0, import_react49.useState)("100%");
|
|
1047
|
+
const [isDataFound, setIsDataFound] = (0, import_react49.useState)(null);
|
|
1048
|
+
(0, import_react49.useEffect)(() => {
|
|
1017
1049
|
const handleReceiveMessage = (event) => {
|
|
1018
1050
|
const eventName = event?.data?.eventName;
|
|
1019
1051
|
const payload = event?.data?.payload;
|
|
@@ -1028,7 +1060,7 @@ var init_IframeClient = __esm({
|
|
|
1028
1060
|
window.addEventListener("message", handleReceiveMessage);
|
|
1029
1061
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
1030
1062
|
}, []);
|
|
1031
|
-
(0,
|
|
1063
|
+
(0, import_react49.useEffect)(() => {
|
|
1032
1064
|
const handleResize = () => {
|
|
1033
1065
|
if (iframeRef.current) {
|
|
1034
1066
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -1040,7 +1072,7 @@ var init_IframeClient = __esm({
|
|
|
1040
1072
|
const handleIframeLoad = () => {
|
|
1041
1073
|
setIsDataFound(true);
|
|
1042
1074
|
};
|
|
1043
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
1044
1076
|
"iframe",
|
|
1045
1077
|
{
|
|
1046
1078
|
ref: iframeRef,
|
|
@@ -1063,6 +1095,7 @@ __export(index_exports, {
|
|
|
1063
1095
|
CheckboxInput: () => CheckboxInput_default,
|
|
1064
1096
|
ColorInput: () => ColorInput_default,
|
|
1065
1097
|
DataList: () => DataList_default,
|
|
1098
|
+
DataListRenderer: () => DataListRenderer_default,
|
|
1066
1099
|
DateTimeInput: () => DateTimeInput_default,
|
|
1067
1100
|
EmailInput: () => EmailInput_default,
|
|
1068
1101
|
InputControl: () => InputControl_default,
|
|
@@ -1084,13 +1117,14 @@ __export(index_exports, {
|
|
|
1084
1117
|
module.exports = __toCommonJS(index_exports);
|
|
1085
1118
|
|
|
1086
1119
|
// src/components/controls/view/ViewControl.tsx
|
|
1087
|
-
var
|
|
1120
|
+
var import_react10 = __toESM(require("react"));
|
|
1088
1121
|
|
|
1089
1122
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1090
1123
|
var ViewControlTypes = {
|
|
1091
1124
|
lineText: "lineText",
|
|
1092
1125
|
asset: "asset",
|
|
1093
1126
|
multilineTextBullets: "multilineTextBullets",
|
|
1127
|
+
boolean: "boolean",
|
|
1094
1128
|
money: "money",
|
|
1095
1129
|
date: "date",
|
|
1096
1130
|
time: "time",
|
|
@@ -1328,50 +1362,94 @@ var DateView = (props) => {
|
|
|
1328
1362
|
};
|
|
1329
1363
|
var DateView_default = DateView;
|
|
1330
1364
|
|
|
1331
|
-
// src/components/controls/view/
|
|
1365
|
+
// src/components/controls/view/BooleanView.tsx
|
|
1332
1366
|
var import_react3 = __toESM(require("react"));
|
|
1333
1367
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1368
|
+
var BooleanView = (props) => {
|
|
1369
|
+
const { value, customProps } = props;
|
|
1370
|
+
const showOnlyTrueIcon = customProps?.showOnlyTrueIcon;
|
|
1371
|
+
console.log("BooleanView Debug:", {
|
|
1372
|
+
value,
|
|
1373
|
+
type: typeof value,
|
|
1374
|
+
customProps,
|
|
1375
|
+
showOnlyTrueIcon
|
|
1376
|
+
});
|
|
1377
|
+
const booleanValue = import_react3.default.useMemo(() => {
|
|
1378
|
+
if (typeof value === "boolean") return value;
|
|
1379
|
+
if (typeof value === "string") {
|
|
1380
|
+
return value.toLowerCase() === "true";
|
|
1381
|
+
}
|
|
1382
|
+
if (typeof value === "number") {
|
|
1383
|
+
return value === 1;
|
|
1384
|
+
}
|
|
1385
|
+
return false;
|
|
1386
|
+
}, [value]);
|
|
1387
|
+
if (showOnlyTrueIcon) {
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1389
|
+
"svg",
|
|
1390
|
+
{
|
|
1391
|
+
className: "w-15 h-8 text-green-600",
|
|
1392
|
+
fill: "currentColor",
|
|
1393
|
+
viewBox: "0 0 20 20",
|
|
1394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1395
|
+
"path",
|
|
1396
|
+
{
|
|
1397
|
+
fillRule: "evenodd",
|
|
1398
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
1399
|
+
clipRule: "evenodd"
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
}
|
|
1403
|
+
) });
|
|
1404
|
+
}
|
|
1405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
1406
|
+
};
|
|
1407
|
+
var BooleanView_default = BooleanView;
|
|
1408
|
+
|
|
1409
|
+
// src/components/controls/view/LineTextView.tsx
|
|
1410
|
+
var import_react4 = __toESM(require("react"));
|
|
1411
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1334
1412
|
var LineText = (props) => {
|
|
1335
|
-
return /* @__PURE__ */ (0,
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.default.Fragment, { children: props.value });
|
|
1336
1414
|
};
|
|
1337
1415
|
var LineTextView_default = LineText;
|
|
1338
1416
|
|
|
1339
1417
|
// src/components/controls/view/MoneyView.tsx
|
|
1340
|
-
var
|
|
1341
|
-
var
|
|
1418
|
+
var import_react5 = __toESM(require("react"));
|
|
1419
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1342
1420
|
var Money = (props) => {
|
|
1343
1421
|
const parsedNumber = parseFloat(props.value);
|
|
1344
|
-
return /* @__PURE__ */ (0,
|
|
1345
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: parsedNumber < 0 ? "text-alert" : "", children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-0.5", children: "\u20B9" }),
|
|
1346
1424
|
parsedNumber.toLocaleString()
|
|
1347
1425
|
] }) });
|
|
1348
1426
|
};
|
|
1349
1427
|
var MoneyView_default = Money;
|
|
1350
1428
|
|
|
1351
1429
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1430
|
+
var import_react6 = __toESM(require("react"));
|
|
1431
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1354
1432
|
var MultilineTextBullets = (props) => {
|
|
1355
1433
|
const lines = props.value?.split("\\n");
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1357
|
-
return /* @__PURE__ */ (0,
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
1435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: line }, index);
|
|
1358
1436
|
}) }) });
|
|
1359
1437
|
};
|
|
1360
1438
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1361
1439
|
|
|
1362
1440
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1363
|
-
var
|
|
1364
|
-
var
|
|
1441
|
+
var import_react7 = __toESM(require("react"));
|
|
1442
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1365
1443
|
var MultilineText = (props) => {
|
|
1366
|
-
return /* @__PURE__ */ (0,
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react7.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
1367
1445
|
};
|
|
1368
1446
|
var MultilineTextView_default = MultilineText;
|
|
1369
1447
|
|
|
1370
1448
|
// src/components/controls/view/PercentageView.tsx
|
|
1371
|
-
var
|
|
1372
|
-
var
|
|
1449
|
+
var import_react8 = __toESM(require("react"));
|
|
1450
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1373
1451
|
var PercentageView = (props) => {
|
|
1374
|
-
return /* @__PURE__ */ (0,
|
|
1452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react8.default.Fragment, { children: [
|
|
1375
1453
|
props.value,
|
|
1376
1454
|
"%"
|
|
1377
1455
|
] });
|
|
@@ -1379,16 +1457,16 @@ var PercentageView = (props) => {
|
|
|
1379
1457
|
var PercentageView_default = PercentageView;
|
|
1380
1458
|
|
|
1381
1459
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1460
|
+
var import_react9 = __toESM(require("react"));
|
|
1461
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1384
1462
|
var ProgressIndicator = (props) => {
|
|
1385
1463
|
const percentage = 100;
|
|
1386
1464
|
const circumference = Math.PI * 56;
|
|
1387
1465
|
const offset = circumference * (1 - percentage / 100);
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative w-48 h-48", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full border border-gray-200" }),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-full h-full rounded-full border-t-8 border-green-500", style: { transform: `rotate(-90deg)`, clipPath: `inset(0px ${offset}px 0px 0px)` } }) }),
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-lg font-bold text-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
1392
1470
|
percentage,
|
|
1393
1471
|
"%"
|
|
1394
1472
|
] }) })
|
|
@@ -1397,29 +1475,30 @@ var ProgressIndicator = (props) => {
|
|
|
1397
1475
|
var ProgressIndicator_default = ProgressIndicator;
|
|
1398
1476
|
|
|
1399
1477
|
// src/components/controls/view/AiGeneratedSummary.tsx
|
|
1400
|
-
var
|
|
1478
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1401
1479
|
var AiGeneratedSummary = (props) => {
|
|
1402
1480
|
const lines = props.value?.split("\n").filter((line) => line.trim() !== "") || [];
|
|
1403
|
-
return /* @__PURE__ */ (0,
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "group rounded-xl border-2 bg-white shadow-sm border-p overflow-hidden", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { className: "flex items-start justify-between cursor-pointer list-none", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-3 ", children: [
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-primary-base bg-transparent rounded mt-1 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" }) }) }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-lg font-semibold ", children: "Quick Read" }),
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm text-gray-500 mb-0", children: "Summary is AI-generated, author-reviewed" })
|
|
1409
1487
|
] })
|
|
1410
1488
|
] }) }),
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "list-disc pl-6 space-y-3 text-gray-700", children: lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "m-0", children: line }, index)) }) })
|
|
1412
1490
|
] });
|
|
1413
1491
|
};
|
|
1414
1492
|
var AiGeneratedSummary_default = AiGeneratedSummary;
|
|
1415
1493
|
|
|
1416
1494
|
// src/components/controls/view/ViewControl.tsx
|
|
1417
|
-
var
|
|
1495
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1418
1496
|
var ViewControl = (props) => {
|
|
1419
1497
|
const ControlComponents = {
|
|
1420
1498
|
[ViewControlTypes_default.lineText]: LineTextView_default,
|
|
1421
1499
|
// [ViewControlTypes.asset]: Asset,
|
|
1422
1500
|
[ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
|
|
1501
|
+
[ViewControlTypes_default.boolean]: BooleanView_default,
|
|
1423
1502
|
[ViewControlTypes_default.money]: MoneyView_default,
|
|
1424
1503
|
[ViewControlTypes_default.date]: DateView_default,
|
|
1425
1504
|
[ViewControlTypes_default.time]: DateView_default,
|
|
@@ -1435,16 +1514,16 @@ var ViewControl = (props) => {
|
|
|
1435
1514
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1436
1515
|
};
|
|
1437
1516
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1438
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react10.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
1439
1518
|
};
|
|
1440
1519
|
var ViewControl_default = ViewControl;
|
|
1441
1520
|
|
|
1442
1521
|
// src/components/controls/edit/InputControl.tsx
|
|
1443
|
-
var
|
|
1522
|
+
var import_react30 = __toESM(require("react"));
|
|
1444
1523
|
|
|
1445
1524
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1446
|
-
var
|
|
1447
|
-
var
|
|
1525
|
+
var import_react11 = __toESM(require("react"));
|
|
1526
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1448
1527
|
var MultilineTextInput = (props) => {
|
|
1449
1528
|
const textChangeHandler = (event) => {
|
|
1450
1529
|
const text = event.target.value;
|
|
@@ -1463,11 +1542,11 @@ var MultilineTextInput = (props) => {
|
|
|
1463
1542
|
if (props.value !== void 0 && props.value !== null) {
|
|
1464
1543
|
value = props.value;
|
|
1465
1544
|
}
|
|
1466
|
-
return /* @__PURE__ */ (0,
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react11.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block mb-1", children: [
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1468
1547
|
" ",
|
|
1469
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1470
|
-
/* @__PURE__ */ (0,
|
|
1548
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1471
1550
|
"textarea",
|
|
1472
1551
|
{
|
|
1473
1552
|
name: props.name,
|
|
@@ -1484,14 +1563,14 @@ var MultilineTextInput = (props) => {
|
|
|
1484
1563
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
1485
1564
|
}
|
|
1486
1565
|
),
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1488
1567
|
] }) });
|
|
1489
1568
|
};
|
|
1490
1569
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1491
1570
|
|
|
1492
1571
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1493
|
-
var
|
|
1494
|
-
var
|
|
1572
|
+
var import_react12 = __toESM(require("react"));
|
|
1573
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1495
1574
|
var LineTextInput = (props) => {
|
|
1496
1575
|
const textChangeHandler = (event) => {
|
|
1497
1576
|
const text = event.target.value;
|
|
@@ -1510,11 +1589,11 @@ var LineTextInput = (props) => {
|
|
|
1510
1589
|
if (props.value !== void 0 && props.value !== null) {
|
|
1511
1590
|
value = props.value;
|
|
1512
1591
|
}
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
1514
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react12.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "block", children: [
|
|
1593
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1515
1594
|
" ",
|
|
1516
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1518
1597
|
"input",
|
|
1519
1598
|
{
|
|
1520
1599
|
type: "text",
|
|
@@ -1534,14 +1613,14 @@ var LineTextInput = (props) => {
|
|
|
1534
1613
|
`
|
|
1535
1614
|
}
|
|
1536
1615
|
),
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1538
1617
|
] }) });
|
|
1539
1618
|
};
|
|
1540
1619
|
var LineTextInput_default = LineTextInput;
|
|
1541
1620
|
|
|
1542
1621
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1543
|
-
var
|
|
1544
|
-
var
|
|
1622
|
+
var import_react13 = __toESM(require("react"));
|
|
1623
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1545
1624
|
var MoneyInput = (props) => {
|
|
1546
1625
|
const textChangeHandler = (event) => {
|
|
1547
1626
|
const rawValue = event.target.value;
|
|
@@ -1570,11 +1649,11 @@ var MoneyInput = (props) => {
|
|
|
1570
1649
|
e.preventDefault();
|
|
1571
1650
|
}
|
|
1572
1651
|
};
|
|
1573
|
-
return /* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "block mb-1", children: [
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1575
1654
|
" ",
|
|
1576
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1578
1657
|
"input",
|
|
1579
1658
|
{
|
|
1580
1659
|
type: "number",
|
|
@@ -1594,7 +1673,7 @@ var MoneyInput = (props) => {
|
|
|
1594
1673
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1595
1674
|
}
|
|
1596
1675
|
),
|
|
1597
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1598
1677
|
] }) });
|
|
1599
1678
|
};
|
|
1600
1679
|
var MoneyInput_default = MoneyInput;
|
|
@@ -1624,10 +1703,10 @@ var InputControlType = {
|
|
|
1624
1703
|
var InputControlType_default = InputControlType;
|
|
1625
1704
|
|
|
1626
1705
|
// src/components/controls/edit/Select.tsx
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1706
|
+
var import_react14 = require("react");
|
|
1707
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1629
1708
|
var Select = (props) => {
|
|
1630
|
-
const [list, setList] = (0,
|
|
1709
|
+
const [list, setList] = (0, import_react14.useState)([]);
|
|
1631
1710
|
const getSafeValue = (val) => {
|
|
1632
1711
|
if (val === null || val === void 0) return "";
|
|
1633
1712
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1656,7 +1735,7 @@ var Select = (props) => {
|
|
|
1656
1735
|
groupKey: props.groupKey
|
|
1657
1736
|
});
|
|
1658
1737
|
};
|
|
1659
|
-
(0,
|
|
1738
|
+
(0, import_react14.useEffect)(() => {
|
|
1660
1739
|
async function fetchData() {
|
|
1661
1740
|
if (props.dataset) {
|
|
1662
1741
|
setList(props.dataset);
|
|
@@ -1683,11 +1762,11 @@ var Select = (props) => {
|
|
|
1683
1762
|
props.dataSourceDependsOn
|
|
1684
1763
|
]);
|
|
1685
1764
|
const value = getSafeValue(props.value);
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
1687
|
-
props.attributes?.label && /* @__PURE__ */ (0,
|
|
1765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "block", children: [
|
|
1766
|
+
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
1688
1767
|
" ",
|
|
1689
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0,
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1691
1770
|
"select",
|
|
1692
1771
|
{
|
|
1693
1772
|
name: props.name,
|
|
@@ -1698,23 +1777,23 @@ var Select = (props) => {
|
|
|
1698
1777
|
disabled: props.attributes?.readOnly,
|
|
1699
1778
|
className: "peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",
|
|
1700
1779
|
children: [
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1780
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1702
1781
|
list.map((item, index) => {
|
|
1703
1782
|
const keyField = props.dataKeyFieldName;
|
|
1704
1783
|
const textField = props.dataTextFieldName;
|
|
1705
|
-
return /* @__PURE__ */ (0,
|
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
1706
1785
|
})
|
|
1707
1786
|
]
|
|
1708
1787
|
}
|
|
1709
1788
|
),
|
|
1710
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
|
|
1711
1790
|
] });
|
|
1712
1791
|
};
|
|
1713
1792
|
var Select_default = Select;
|
|
1714
1793
|
|
|
1715
1794
|
// src/components/controls/edit/PercentageInput.tsx
|
|
1716
|
-
var
|
|
1717
|
-
var
|
|
1795
|
+
var import_react15 = __toESM(require("react"));
|
|
1796
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1718
1797
|
var PercentageInput = (props) => {
|
|
1719
1798
|
const textChangeHandler = (event) => {
|
|
1720
1799
|
const rawValue = event.target.value;
|
|
@@ -1743,11 +1822,11 @@ var PercentageInput = (props) => {
|
|
|
1743
1822
|
e.preventDefault();
|
|
1744
1823
|
}
|
|
1745
1824
|
};
|
|
1746
|
-
return /* @__PURE__ */ (0,
|
|
1747
|
-
/* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react15.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "block mb-1", children: [
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
1748
1827
|
" ",
|
|
1749
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1828
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1751
1830
|
"input",
|
|
1752
1831
|
{
|
|
1753
1832
|
type: "number",
|
|
@@ -1766,14 +1845,14 @@ var PercentageInput = (props) => {
|
|
|
1766
1845
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1767
1846
|
}
|
|
1768
1847
|
),
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1770
1849
|
] }) });
|
|
1771
1850
|
};
|
|
1772
1851
|
var PercentageInput_default = PercentageInput;
|
|
1773
1852
|
|
|
1774
1853
|
// src/components/controls/edit/PhoneInput.tsx
|
|
1775
|
-
var
|
|
1776
|
-
var
|
|
1854
|
+
var import_react16 = __toESM(require("react"));
|
|
1855
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1777
1856
|
var PhoneInput = (props) => {
|
|
1778
1857
|
const textChangeHandler = (event) => {
|
|
1779
1858
|
const text = event.target.value;
|
|
@@ -1792,13 +1871,13 @@ var PhoneInput = (props) => {
|
|
|
1792
1871
|
if (props.value !== void 0 && props.value !== null) {
|
|
1793
1872
|
value = props.value;
|
|
1794
1873
|
}
|
|
1795
|
-
return /* @__PURE__ */ (0,
|
|
1796
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react16.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "block mb-1", children: [
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1797
1876
|
" ",
|
|
1798
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1800
|
-
/* @__PURE__ */ (0,
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1877
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center rounded border ", children: [
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "px-3", children: props.prefix }),
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1802
1881
|
"input",
|
|
1803
1882
|
{
|
|
1804
1883
|
type: "text",
|
|
@@ -1816,14 +1895,14 @@ var PhoneInput = (props) => {
|
|
|
1816
1895
|
}
|
|
1817
1896
|
)
|
|
1818
1897
|
] }),
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1898
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1820
1899
|
] }) });
|
|
1821
1900
|
};
|
|
1822
1901
|
var PhoneInput_default = PhoneInput;
|
|
1823
1902
|
|
|
1824
1903
|
// src/components/controls/edit/NumberInput.tsx
|
|
1825
|
-
var
|
|
1826
|
-
var
|
|
1904
|
+
var import_react17 = __toESM(require("react"));
|
|
1905
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1827
1906
|
var NumberInput = (props) => {
|
|
1828
1907
|
const textChangeHandler = (event) => {
|
|
1829
1908
|
const text = event.target.value;
|
|
@@ -1846,11 +1925,11 @@ var NumberInput = (props) => {
|
|
|
1846
1925
|
if (props.value !== void 0 && props.value !== null) {
|
|
1847
1926
|
value = props.value;
|
|
1848
1927
|
}
|
|
1849
|
-
return /* @__PURE__ */ (0,
|
|
1850
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react17.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "block", children: [
|
|
1929
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1851
1930
|
" ",
|
|
1852
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
1931
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1854
1933
|
"input",
|
|
1855
1934
|
{
|
|
1856
1935
|
type: "number",
|
|
@@ -1869,14 +1948,14 @@ var NumberInput = (props) => {
|
|
|
1869
1948
|
className: "peer py-1.5 block w-full rounded shadow-sm number-input input\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
1870
1949
|
}
|
|
1871
1950
|
),
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1873
1952
|
] }) });
|
|
1874
1953
|
};
|
|
1875
1954
|
var NumberInput_default = NumberInput;
|
|
1876
1955
|
|
|
1877
1956
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
1878
|
-
var
|
|
1879
|
-
var
|
|
1957
|
+
var import_react18 = __toESM(require("react"));
|
|
1958
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1880
1959
|
var CheckboxInput = (props) => {
|
|
1881
1960
|
const textChangeHandler = (event) => {
|
|
1882
1961
|
let text = event.target.checked;
|
|
@@ -1893,11 +1972,11 @@ var CheckboxInput = (props) => {
|
|
|
1893
1972
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
1894
1973
|
value = true;
|
|
1895
1974
|
}
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
1975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "inline-block mb-1", children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
1898
1977
|
" ",
|
|
1899
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1900
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1901
1980
|
"input",
|
|
1902
1981
|
{
|
|
1903
1982
|
type: "checkbox",
|
|
@@ -1914,14 +1993,14 @@ var CheckboxInput = (props) => {
|
|
|
1914
1993
|
className: "peer mt-1 py-1.5 block rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
1915
1994
|
}
|
|
1916
1995
|
),
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1918
1997
|
] }) });
|
|
1919
1998
|
};
|
|
1920
1999
|
var CheckboxInput_default = CheckboxInput;
|
|
1921
2000
|
|
|
1922
2001
|
// src/components/controls/edit/OtpInput.tsx
|
|
1923
|
-
var
|
|
1924
|
-
var
|
|
2002
|
+
var import_react19 = __toESM(require("react"));
|
|
2003
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1925
2004
|
var OtpInput = (props) => {
|
|
1926
2005
|
const textChangeHandler = (event) => {
|
|
1927
2006
|
const text = event.target.value;
|
|
@@ -1943,11 +2022,11 @@ var OtpInput = (props) => {
|
|
|
1943
2022
|
if (props.value !== void 0 && props.value !== null) {
|
|
1944
2023
|
value = props.value;
|
|
1945
2024
|
}
|
|
1946
|
-
return /* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
2025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react19.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1948
2027
|
" ",
|
|
1949
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2028
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1951
2030
|
"input",
|
|
1952
2031
|
{
|
|
1953
2032
|
type: "text",
|
|
@@ -1967,14 +2046,14 @@ var OtpInput = (props) => {
|
|
|
1967
2046
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
1968
2047
|
}
|
|
1969
2048
|
),
|
|
1970
|
-
/* @__PURE__ */ (0,
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1971
2050
|
] }) });
|
|
1972
2051
|
};
|
|
1973
2052
|
var OtpInput_default = OtpInput;
|
|
1974
2053
|
|
|
1975
2054
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
1976
|
-
var
|
|
1977
|
-
var
|
|
2055
|
+
var import_react20 = __toESM(require("react"));
|
|
2056
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1978
2057
|
var DateTimeInput = (props) => {
|
|
1979
2058
|
const textChangeHandler = (event) => {
|
|
1980
2059
|
const localDate = new Date(event.target.value);
|
|
@@ -2006,12 +2085,12 @@ var DateTimeInput = (props) => {
|
|
|
2006
2085
|
e.preventDefault();
|
|
2007
2086
|
}
|
|
2008
2087
|
};
|
|
2009
|
-
return /* @__PURE__ */ (0,
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react20.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "block mb-1", children: [
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2011
2090
|
" ",
|
|
2012
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2013
|
-
/* @__PURE__ */ (0,
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2091
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2015
2094
|
"input",
|
|
2016
2095
|
{
|
|
2017
2096
|
type: "datetime-local",
|
|
@@ -2029,19 +2108,19 @@ var DateTimeInput = (props) => {
|
|
|
2029
2108
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
2030
2109
|
}
|
|
2031
2110
|
),
|
|
2032
|
-
/* @__PURE__ */ (0,
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: timeZoneAbbr })
|
|
2033
2112
|
] }),
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2035
2114
|
] }) });
|
|
2036
2115
|
};
|
|
2037
2116
|
var DateTimeInput_default = DateTimeInput;
|
|
2038
2117
|
|
|
2039
2118
|
// src/components/controls/edit/ColorInput.tsx
|
|
2040
|
-
var
|
|
2041
|
-
var
|
|
2119
|
+
var import_react21 = __toESM(require("react"));
|
|
2120
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2042
2121
|
var ColorInput = (props) => {
|
|
2043
|
-
const [color, setColor] =
|
|
2044
|
-
(0,
|
|
2122
|
+
const [color, setColor] = import_react21.default.useState("#3b82f6");
|
|
2123
|
+
(0, import_react21.useEffect)(() => {
|
|
2045
2124
|
if (props.value !== void 0 && props.value !== null) {
|
|
2046
2125
|
if (typeof props.value === "string") {
|
|
2047
2126
|
setColor(props.value);
|
|
@@ -2060,11 +2139,11 @@ var ColorInput = (props) => {
|
|
|
2060
2139
|
});
|
|
2061
2140
|
}
|
|
2062
2141
|
};
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "block mb-1", children: [
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2065
2144
|
" ",
|
|
2066
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2145
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2068
2147
|
"input",
|
|
2069
2148
|
{
|
|
2070
2149
|
type: "color",
|
|
@@ -2077,21 +2156,21 @@ var ColorInput = (props) => {
|
|
|
2077
2156
|
className: `w-[78px] h-12 block cursor-pointer`
|
|
2078
2157
|
}
|
|
2079
2158
|
),
|
|
2080
|
-
props?.attributes?.errorMessage && /* @__PURE__ */ (0,
|
|
2159
|
+
props?.attributes?.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 bg-error-weak text-sm", children: props.attributes.errorMessage })
|
|
2081
2160
|
] });
|
|
2082
2161
|
};
|
|
2083
2162
|
var ColorInput_default = ColorInput;
|
|
2084
2163
|
|
|
2085
2164
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2086
|
-
var
|
|
2087
|
-
var
|
|
2165
|
+
var import_react22 = require("react");
|
|
2166
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2088
2167
|
var SelectWithSearchInput = (props) => {
|
|
2089
|
-
const [isOpen, setIsOpen] = (0,
|
|
2090
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2091
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2092
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2093
|
-
const [list, setList] = (0,
|
|
2094
|
-
(0,
|
|
2168
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
2169
|
+
const [searchTerm, setSearchTerm] = (0, import_react22.useState)("");
|
|
2170
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react22.useState)(-1);
|
|
2171
|
+
const [selectedItem, setSelectedItem] = (0, import_react22.useState)(null);
|
|
2172
|
+
const [list, setList] = (0, import_react22.useState)([]);
|
|
2173
|
+
(0, import_react22.useEffect)(() => {
|
|
2095
2174
|
async function fetchData() {
|
|
2096
2175
|
if (props.dataset) {
|
|
2097
2176
|
setList(props.dataset);
|
|
@@ -2145,8 +2224,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2145
2224
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2146
2225
|
}
|
|
2147
2226
|
};
|
|
2148
|
-
const dropdownRef = (0,
|
|
2149
|
-
(0,
|
|
2227
|
+
const dropdownRef = (0, import_react22.useRef)(null);
|
|
2228
|
+
(0, import_react22.useEffect)(() => {
|
|
2150
2229
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2151
2230
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2152
2231
|
highlightedItem?.scrollIntoView({
|
|
@@ -2155,15 +2234,15 @@ var SelectWithSearchInput = (props) => {
|
|
|
2155
2234
|
});
|
|
2156
2235
|
}
|
|
2157
2236
|
}, [highlightedIndex]);
|
|
2158
|
-
return /* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { children: [
|
|
2160
2239
|
props.attributes?.label,
|
|
2161
2240
|
" ",
|
|
2162
2241
|
" ",
|
|
2163
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2242
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2164
2243
|
] }),
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2167
2246
|
"input",
|
|
2168
2247
|
{
|
|
2169
2248
|
type: "text",
|
|
@@ -2179,13 +2258,13 @@ var SelectWithSearchInput = (props) => {
|
|
|
2179
2258
|
className: "peer py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
2180
2259
|
}
|
|
2181
2260
|
),
|
|
2182
|
-
/* @__PURE__ */ (0,
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2183
2262
|
"button",
|
|
2184
2263
|
{
|
|
2185
2264
|
type: "button",
|
|
2186
2265
|
onClick: () => setIsOpen(!isOpen),
|
|
2187
2266
|
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
2188
|
-
children: /* @__PURE__ */ (0,
|
|
2267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2189
2268
|
"svg",
|
|
2190
2269
|
{
|
|
2191
2270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2194,7 +2273,7 @@ var SelectWithSearchInput = (props) => {
|
|
|
2194
2273
|
strokeWidth: 1.5,
|
|
2195
2274
|
stroke: "currentColor",
|
|
2196
2275
|
className: "w-full h-full",
|
|
2197
|
-
children: /* @__PURE__ */ (0,
|
|
2276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2198
2277
|
"path",
|
|
2199
2278
|
{
|
|
2200
2279
|
strokeLinecap: "round",
|
|
@@ -2207,12 +2286,12 @@ var SelectWithSearchInput = (props) => {
|
|
|
2207
2286
|
}
|
|
2208
2287
|
)
|
|
2209
2288
|
] }),
|
|
2210
|
-
isOpen && /* @__PURE__ */ (0,
|
|
2289
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2211
2290
|
"div",
|
|
2212
2291
|
{
|
|
2213
2292
|
ref: dropdownRef,
|
|
2214
2293
|
className: "absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-48 overflow-y-auto",
|
|
2215
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2294
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2216
2295
|
"button",
|
|
2217
2296
|
{
|
|
2218
2297
|
onClick: (e) => handleSelect(e, item),
|
|
@@ -2220,10 +2299,10 @@ var SelectWithSearchInput = (props) => {
|
|
|
2220
2299
|
role: "option",
|
|
2221
2300
|
tabIndex: -1,
|
|
2222
2301
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2223
|
-
children: /* @__PURE__ */ (0,
|
|
2302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
2224
2303
|
},
|
|
2225
2304
|
item[props.dataKeyFieldName]
|
|
2226
|
-
)) : /* @__PURE__ */ (0,
|
|
2305
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2227
2306
|
}
|
|
2228
2307
|
)
|
|
2229
2308
|
] });
|
|
@@ -2232,22 +2311,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2232
2311
|
|
|
2233
2312
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2234
2313
|
init_Button();
|
|
2235
|
-
var
|
|
2236
|
-
var
|
|
2314
|
+
var import_react26 = __toESM(require("react"));
|
|
2315
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2237
2316
|
var SelectWithSearchPanel = (props) => {
|
|
2238
|
-
const [isOpen, setIsOpen] = (0,
|
|
2239
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2240
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2241
|
-
const [list, setList] = (0,
|
|
2242
|
-
const listRef = (0,
|
|
2243
|
-
const [isError, setIsError] = (0,
|
|
2244
|
-
const containerRef = (0,
|
|
2245
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
2246
|
-
const [formData, setFormData] = (0,
|
|
2317
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
|
|
2318
|
+
const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
|
|
2319
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(0);
|
|
2320
|
+
const [list, setList] = (0, import_react26.useState)([]);
|
|
2321
|
+
const listRef = (0, import_react26.useRef)(null);
|
|
2322
|
+
const [isError, setIsError] = (0, import_react26.useState)(false);
|
|
2323
|
+
const containerRef = (0, import_react26.useRef)(null);
|
|
2324
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react26.useState)(false);
|
|
2325
|
+
const [formData, setFormData] = (0, import_react26.useState)({});
|
|
2247
2326
|
const getNestedValue3 = (obj, path) => {
|
|
2248
2327
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2249
2328
|
};
|
|
2250
|
-
(0,
|
|
2329
|
+
(0, import_react26.useEffect)(() => {
|
|
2251
2330
|
const handleClickOutside = (event) => {
|
|
2252
2331
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2253
2332
|
setIsOpen(false);
|
|
@@ -2258,7 +2337,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2258
2337
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2259
2338
|
};
|
|
2260
2339
|
}, []);
|
|
2261
|
-
(0,
|
|
2340
|
+
(0, import_react26.useEffect)(() => {
|
|
2262
2341
|
async function fetchData() {
|
|
2263
2342
|
if (props.dataset) {
|
|
2264
2343
|
setList(props.dataset);
|
|
@@ -2300,7 +2379,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2300
2379
|
audioCtx.close();
|
|
2301
2380
|
}, 250);
|
|
2302
2381
|
};
|
|
2303
|
-
(0,
|
|
2382
|
+
(0, import_react26.useEffect)(() => {
|
|
2304
2383
|
const filteredItems2 = list?.filter(
|
|
2305
2384
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2306
2385
|
);
|
|
@@ -2365,18 +2444,18 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2365
2444
|
const handleInputChange = (event, field) => {
|
|
2366
2445
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2367
2446
|
};
|
|
2368
|
-
const handleSaveModal = (0,
|
|
2447
|
+
const handleSaveModal = (0, import_react26.useCallback)(async () => {
|
|
2369
2448
|
console.log("Form Data:", formData);
|
|
2370
2449
|
return formData;
|
|
2371
2450
|
}, []);
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
-
/* @__PURE__ */ (0,
|
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2452
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "text-sm mb-1 font-medium", children: [
|
|
2374
2453
|
props.attributes?.label,
|
|
2375
2454
|
" ",
|
|
2376
2455
|
" ",
|
|
2377
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2456
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2378
2457
|
] }),
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2380
2459
|
"input",
|
|
2381
2460
|
{
|
|
2382
2461
|
type: "text",
|
|
@@ -2390,14 +2469,14 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2390
2469
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2391
2470
|
}
|
|
2392
2471
|
) }),
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2395
|
-
/* @__PURE__ */ (0,
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react26.default.Fragment, { children: [
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
2396
2475
|
"Select a",
|
|
2397
2476
|
" ",
|
|
2398
2477
|
props.attributes?.label || props.attributes?.heading
|
|
2399
2478
|
] }) }),
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200 h-10", children: props.createFields && props.createFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2401
2480
|
"button",
|
|
2402
2481
|
{
|
|
2403
2482
|
type: "button",
|
|
@@ -2410,12 +2489,12 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2410
2489
|
}
|
|
2411
2490
|
) })
|
|
2412
2491
|
] }),
|
|
2413
|
-
isCreateOpen && /* @__PURE__ */ (0,
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2492
|
+
isCreateOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed right-0 w-1/4 h-full top-[62px] bg-white shadow-lg border-l border-gray-200 z-50", children: [
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md font-medium text-white", children: [
|
|
2415
2494
|
"Create New ",
|
|
2416
2495
|
props.attributes?.label
|
|
2417
2496
|
] }) }),
|
|
2418
|
-
/* @__PURE__ */ (0,
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2419
2498
|
"button",
|
|
2420
2499
|
{
|
|
2421
2500
|
type: "button",
|
|
@@ -2424,10 +2503,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2424
2503
|
children: "Close"
|
|
2425
2504
|
}
|
|
2426
2505
|
) }),
|
|
2427
|
-
/* @__PURE__ */ (0,
|
|
2428
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0,
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-4", children: [
|
|
2507
|
+
props.createFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-4", children: [
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2431
2510
|
"input",
|
|
2432
2511
|
{
|
|
2433
2512
|
type: field.type,
|
|
@@ -2443,7 +2522,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2443
2522
|
}
|
|
2444
2523
|
)
|
|
2445
2524
|
] }, field.name)),
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Button_default, { onClick: async () => {
|
|
2447
2526
|
handleSaveModal();
|
|
2448
2527
|
return { isSuccessful: true };
|
|
2449
2528
|
}, className: "w-full", children: [
|
|
@@ -2452,13 +2531,13 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2452
2531
|
] })
|
|
2453
2532
|
] })
|
|
2454
2533
|
] }),
|
|
2455
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2456
2535
|
"div",
|
|
2457
2536
|
{
|
|
2458
2537
|
ref: listRef,
|
|
2459
2538
|
className: "fixed z-10 right-0 mt-[130px] top-0 w-1/4 bg-white border-l border-gray-200 shadow-lg overflow-y-auto",
|
|
2460
2539
|
style: { height: "calc(100vh - 130px)" },
|
|
2461
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2540
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2462
2541
|
"button",
|
|
2463
2542
|
{
|
|
2464
2543
|
onClick: (e) => {
|
|
@@ -2468,9 +2547,9 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2468
2547
|
role: "option",
|
|
2469
2548
|
tabIndex: -1,
|
|
2470
2549
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2471
|
-
children: /* @__PURE__ */ (0,
|
|
2550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: getNestedValue3(item, props.dataTextFieldName) })
|
|
2472
2551
|
}
|
|
2473
|
-
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0,
|
|
2552
|
+
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2474
2553
|
}
|
|
2475
2554
|
)
|
|
2476
2555
|
] }) })
|
|
@@ -2479,10 +2558,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2479
2558
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2480
2559
|
|
|
2481
2560
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2482
|
-
var
|
|
2483
|
-
var
|
|
2561
|
+
var import_react27 = __toESM(require("react"));
|
|
2562
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2484
2563
|
var BooleanSelect = (props) => {
|
|
2485
|
-
const [list, setList] = (0,
|
|
2564
|
+
const [list, setList] = (0, import_react27.useState)();
|
|
2486
2565
|
const textChangeHandler = (event) => {
|
|
2487
2566
|
const text = event.target.value;
|
|
2488
2567
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2495,7 +2574,7 @@ var BooleanSelect = (props) => {
|
|
|
2495
2574
|
});
|
|
2496
2575
|
}
|
|
2497
2576
|
};
|
|
2498
|
-
(0,
|
|
2577
|
+
(0, import_react27.useEffect)(() => {
|
|
2499
2578
|
async function fetchData() {
|
|
2500
2579
|
console.log("in select");
|
|
2501
2580
|
if (props.dataset) {
|
|
@@ -2529,11 +2608,11 @@ var BooleanSelect = (props) => {
|
|
|
2529
2608
|
if (props.value !== void 0 && props.value !== null) {
|
|
2530
2609
|
value = props.value;
|
|
2531
2610
|
}
|
|
2532
|
-
return /* @__PURE__ */ (0,
|
|
2533
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react27.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "block", children: [
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2534
2613
|
" ",
|
|
2535
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2614
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2615
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2537
2616
|
"select",
|
|
2538
2617
|
{
|
|
2539
2618
|
name: props.name,
|
|
@@ -2545,9 +2624,9 @@ var BooleanSelect = (props) => {
|
|
|
2545
2624
|
disabled: props?.attributes?.readOnly,
|
|
2546
2625
|
className: "peer mt-1 py-1.5 block w-full text-black rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n ",
|
|
2547
2626
|
children: [
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
2549
2628
|
list && list.map((item, i) => {
|
|
2550
|
-
return /* @__PURE__ */ (0,
|
|
2629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2551
2630
|
"option",
|
|
2552
2631
|
{
|
|
2553
2632
|
className: "fac-select-option",
|
|
@@ -2560,14 +2639,14 @@ var BooleanSelect = (props) => {
|
|
|
2560
2639
|
]
|
|
2561
2640
|
}
|
|
2562
2641
|
),
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2564
2643
|
] }) });
|
|
2565
2644
|
};
|
|
2566
2645
|
var BooleanSelect_default = BooleanSelect;
|
|
2567
2646
|
|
|
2568
2647
|
// src/components/controls/edit/EmailInput.tsx
|
|
2569
|
-
var
|
|
2570
|
-
var
|
|
2648
|
+
var import_react28 = __toESM(require("react"));
|
|
2649
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2571
2650
|
var EmailInput = (props) => {
|
|
2572
2651
|
const textChangeHandler = (event) => {
|
|
2573
2652
|
const text = event.target.value;
|
|
@@ -2592,11 +2671,11 @@ var EmailInput = (props) => {
|
|
|
2592
2671
|
if (props.value !== void 0 && props.value !== null) {
|
|
2593
2672
|
value = props.value;
|
|
2594
2673
|
}
|
|
2595
|
-
return /* @__PURE__ */ (0,
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react28.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "block mb-1", children: [
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
2597
2676
|
" ",
|
|
2598
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2677
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2678
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2600
2679
|
"input",
|
|
2601
2680
|
{
|
|
2602
2681
|
type: "email",
|
|
@@ -2612,14 +2691,14 @@ var EmailInput = (props) => {
|
|
|
2612
2691
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
2613
2692
|
}
|
|
2614
2693
|
),
|
|
2615
|
-
/* @__PURE__ */ (0,
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 mb-0 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2616
2695
|
] }) });
|
|
2617
2696
|
};
|
|
2618
2697
|
var EmailInput_default = EmailInput;
|
|
2619
2698
|
|
|
2620
2699
|
// src/components/controls/edit/TimeInput.tsx
|
|
2621
|
-
var
|
|
2622
|
-
var
|
|
2700
|
+
var import_react29 = __toESM(require("react"));
|
|
2701
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2623
2702
|
var TimeInput = (props) => {
|
|
2624
2703
|
const timeChangeHandler = (event) => {
|
|
2625
2704
|
const timeValue = event.target.value;
|
|
@@ -2632,11 +2711,11 @@ var TimeInput = (props) => {
|
|
|
2632
2711
|
});
|
|
2633
2712
|
}
|
|
2634
2713
|
};
|
|
2635
|
-
return /* @__PURE__ */ (0,
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "block mb-1", children: [
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2637
2716
|
" ",
|
|
2638
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2717
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2640
2719
|
"input",
|
|
2641
2720
|
{
|
|
2642
2721
|
type: "time",
|
|
@@ -2649,14 +2728,14 @@ var TimeInput = (props) => {
|
|
|
2649
2728
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none"
|
|
2650
2729
|
}
|
|
2651
2730
|
) }),
|
|
2652
|
-
/* @__PURE__ */ (0,
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
2653
2732
|
] }) });
|
|
2654
2733
|
};
|
|
2655
2734
|
var TimeInput_default = TimeInput;
|
|
2656
2735
|
|
|
2657
2736
|
// src/components/controls/edit/InputControl.tsx
|
|
2658
|
-
var
|
|
2659
|
-
var InputControl =
|
|
2737
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2738
|
+
var InputControl = import_react30.default.forwardRef(
|
|
2660
2739
|
(props, ref) => {
|
|
2661
2740
|
const ControlComponents = {
|
|
2662
2741
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -2677,58 +2756,58 @@ var InputControl = import_react29.default.forwardRef(
|
|
|
2677
2756
|
[InputControlType_default.timeInput]: TimeInput_default
|
|
2678
2757
|
};
|
|
2679
2758
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
2680
|
-
return /* @__PURE__ */ (0,
|
|
2759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react30.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
2681
2760
|
}
|
|
2682
2761
|
);
|
|
2683
2762
|
InputControl.displayName = "InputControl";
|
|
2684
2763
|
var InputControl_default = InputControl;
|
|
2685
2764
|
|
|
2686
2765
|
// src/components/dataForm/DataList.tsx
|
|
2687
|
-
var
|
|
2766
|
+
var import_react33 = __toESM(require("react"));
|
|
2688
2767
|
var import_navigation = require("next/navigation");
|
|
2689
2768
|
|
|
2690
2769
|
// src/components/dataForm/NoContentView.tsx
|
|
2691
|
-
var
|
|
2692
|
-
var
|
|
2770
|
+
var import_react31 = __toESM(require("react"));
|
|
2771
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2693
2772
|
var NoContentView = (props) => {
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
2773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react31.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
2695
2774
|
};
|
|
2696
2775
|
var NoContentView_default = NoContentView;
|
|
2697
2776
|
|
|
2698
2777
|
// src/components/dataForm/ContentView.tsx
|
|
2699
|
-
var
|
|
2700
|
-
var
|
|
2778
|
+
var import_react32 = __toESM(require("react"));
|
|
2779
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2701
2780
|
var ContentView = (props) => {
|
|
2702
|
-
return /* @__PURE__ */ (0,
|
|
2703
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
2704
|
-
/* @__PURE__ */ (0,
|
|
2705
|
-
/* @__PURE__ */ (0,
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react32.default.Fragment, { children: [
|
|
2782
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
2783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ml-2", children: [
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
2709
2788
|
] })
|
|
2710
2789
|
] }),
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2795
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2718
2797
|
] }),
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2722
|
-
/* @__PURE__ */ (0,
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2725
2804
|
] }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2810
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2732
2811
|
] })
|
|
2733
2812
|
] })
|
|
2734
2813
|
] }) }),
|
|
@@ -2740,7 +2819,7 @@ var ContentView_default = ContentView;
|
|
|
2740
2819
|
// src/components/dataForm/Hyperlink.tsx
|
|
2741
2820
|
var import_link = __toESM(require("next/link"));
|
|
2742
2821
|
init_StyleTypes();
|
|
2743
|
-
var
|
|
2822
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2744
2823
|
function Hyperlink(props) {
|
|
2745
2824
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : "";
|
|
2746
2825
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -2748,7 +2827,7 @@ function Hyperlink(props) {
|
|
|
2748
2827
|
if (target == "_blank") {
|
|
2749
2828
|
additionalProps.rel = "noopener noreferrer";
|
|
2750
2829
|
}
|
|
2751
|
-
return /* @__PURE__ */ (0,
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: props.href ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2752
2831
|
import_link.default,
|
|
2753
2832
|
{
|
|
2754
2833
|
href: props.href,
|
|
@@ -2758,7 +2837,7 @@ function Hyperlink(props) {
|
|
|
2758
2837
|
target,
|
|
2759
2838
|
children: props.children
|
|
2760
2839
|
}
|
|
2761
|
-
) : props.isHeading ? /* @__PURE__ */ (0,
|
|
2840
|
+
) : props.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: props.className, children: props.children }) });
|
|
2762
2841
|
}
|
|
2763
2842
|
|
|
2764
2843
|
// src/components/dataForm/DataList.tsx
|
|
@@ -2919,30 +2998,30 @@ var OdataBuilder = class {
|
|
|
2919
2998
|
};
|
|
2920
2999
|
|
|
2921
3000
|
// src/svg/chevron-updown.tsx
|
|
2922
|
-
var
|
|
3001
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2923
3002
|
var ChevronUpDown = (props) => {
|
|
2924
|
-
return /* @__PURE__ */ (0,
|
|
3003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) });
|
|
2925
3004
|
};
|
|
2926
3005
|
var chevron_updown_default = ChevronUpDown;
|
|
2927
3006
|
|
|
2928
3007
|
// src/svg/chevron-down.tsx
|
|
2929
|
-
var
|
|
3008
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2930
3009
|
var ChevronDown = (props) => {
|
|
2931
|
-
return /* @__PURE__ */ (0,
|
|
3010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) });
|
|
2932
3011
|
};
|
|
2933
3012
|
var chevron_down_default = ChevronDown;
|
|
2934
3013
|
|
|
2935
3014
|
// src/svg/chevron-up.tsx
|
|
2936
|
-
var
|
|
3015
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2937
3016
|
var ChevronUp = (props) => {
|
|
2938
|
-
return /* @__PURE__ */ (0,
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) });
|
|
2939
3018
|
};
|
|
2940
3019
|
var chevron_up_default = ChevronUp;
|
|
2941
3020
|
|
|
2942
3021
|
// src/svg/plus.tsx
|
|
2943
|
-
var
|
|
3022
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2944
3023
|
var Plus = (props) => {
|
|
2945
|
-
return /* @__PURE__ */ (0,
|
|
3024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) });
|
|
2946
3025
|
};
|
|
2947
3026
|
var plus_default = Plus;
|
|
2948
3027
|
|
|
@@ -2956,14 +3035,14 @@ var Icons = {
|
|
|
2956
3035
|
var Icons_default = Icons;
|
|
2957
3036
|
|
|
2958
3037
|
// src/svg/Icon.tsx
|
|
2959
|
-
var
|
|
3038
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2960
3039
|
var Icon = ({ name, className, ...props }) => {
|
|
2961
3040
|
const IconComponent = Icons_default[name];
|
|
2962
3041
|
if (!IconComponent) {
|
|
2963
3042
|
console.error(`Icon "${name}" not found.`);
|
|
2964
3043
|
return null;
|
|
2965
3044
|
}
|
|
2966
|
-
return /* @__PURE__ */ (0,
|
|
3045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconComponent, { ...props, className });
|
|
2967
3046
|
};
|
|
2968
3047
|
var Icon_default = Icon;
|
|
2969
3048
|
|
|
@@ -3012,7 +3091,7 @@ function FormReducer(state, action) {
|
|
|
3012
3091
|
var FormReducer_default = FormReducer;
|
|
3013
3092
|
|
|
3014
3093
|
// src/components/dataForm/DataList.tsx
|
|
3015
|
-
var
|
|
3094
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3016
3095
|
var DataList = (props) => {
|
|
3017
3096
|
console.log(props.dataset, "datasetssssss");
|
|
3018
3097
|
const router = (0, import_navigation.useRouter)();
|
|
@@ -3021,8 +3100,8 @@ var DataList = (props) => {
|
|
|
3021
3100
|
let activePageNumber = 0;
|
|
3022
3101
|
let pages = 0;
|
|
3023
3102
|
console.log(props.addLinkText);
|
|
3024
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3025
|
-
(0,
|
|
3103
|
+
const [isDataFound, setIsDataFound] = (0, import_react33.useState)(null);
|
|
3104
|
+
(0, import_react33.useEffect)(() => {
|
|
3026
3105
|
if (props?.dataset) {
|
|
3027
3106
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
3028
3107
|
setIsDataFound(true);
|
|
@@ -3035,7 +3114,7 @@ var DataList = (props) => {
|
|
|
3035
3114
|
if (path.includes(".")) {
|
|
3036
3115
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
3037
3116
|
} else if (Array.isArray(obj[path])) {
|
|
3038
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
3117
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: item }, index));
|
|
3039
3118
|
} else {
|
|
3040
3119
|
return obj[path];
|
|
3041
3120
|
}
|
|
@@ -3044,8 +3123,8 @@ var DataList = (props) => {
|
|
|
3044
3123
|
inputValues: {},
|
|
3045
3124
|
lastPropertyChanged: ""
|
|
3046
3125
|
};
|
|
3047
|
-
const [formState, dispatch] = (0,
|
|
3048
|
-
const handleFilterChange = (0,
|
|
3126
|
+
const [formState, dispatch] = (0, import_react33.useReducer)(FormReducer_default, initialState);
|
|
3127
|
+
const handleFilterChange = (0, import_react33.useCallback)(
|
|
3049
3128
|
(updatedValues) => {
|
|
3050
3129
|
dispatch({
|
|
3051
3130
|
type: FORM_INPUT_UPDATE,
|
|
@@ -3091,30 +3170,30 @@ var DataList = (props) => {
|
|
|
3091
3170
|
const renderPageNumbers = () => {
|
|
3092
3171
|
if (pages <= 10) {
|
|
3093
3172
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
3094
|
-
(page) => /* @__PURE__ */ (0,
|
|
3173
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3095
3174
|
Hyperlink,
|
|
3096
3175
|
{
|
|
3097
3176
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3098
3177
|
href: builder.getNewPageUrl(page),
|
|
3099
3178
|
children: page
|
|
3100
3179
|
}
|
|
3101
|
-
) : /* @__PURE__ */ (0,
|
|
3180
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3102
3181
|
);
|
|
3103
3182
|
} else {
|
|
3104
3183
|
const showFirstPages = activePageNumber <= 5;
|
|
3105
3184
|
const showLastPages = activePageNumber > pages - 5;
|
|
3106
3185
|
if (showFirstPages) {
|
|
3107
|
-
return /* @__PURE__ */ (0,
|
|
3108
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
3186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3187
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3109
3188
|
Hyperlink,
|
|
3110
3189
|
{
|
|
3111
3190
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3112
3191
|
href: builder.getNewPageUrl(page),
|
|
3113
3192
|
children: page
|
|
3114
3193
|
}
|
|
3115
|
-
) : /* @__PURE__ */ (0,
|
|
3116
|
-
/* @__PURE__ */ (0,
|
|
3117
|
-
/* @__PURE__ */ (0,
|
|
3194
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3118
3197
|
Hyperlink,
|
|
3119
3198
|
{
|
|
3120
3199
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3122,7 +3201,7 @@ var DataList = (props) => {
|
|
|
3122
3201
|
children: pages - 1
|
|
3123
3202
|
}
|
|
3124
3203
|
),
|
|
3125
|
-
/* @__PURE__ */ (0,
|
|
3204
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3126
3205
|
Hyperlink,
|
|
3127
3206
|
{
|
|
3128
3207
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3130,7 +3209,7 @@ var DataList = (props) => {
|
|
|
3130
3209
|
children: pages
|
|
3131
3210
|
}
|
|
3132
3211
|
),
|
|
3133
|
-
/* @__PURE__ */ (0,
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3134
3213
|
"select",
|
|
3135
3214
|
{
|
|
3136
3215
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3142,18 +3221,18 @@ var DataList = (props) => {
|
|
|
3142
3221
|
}
|
|
3143
3222
|
},
|
|
3144
3223
|
children: [
|
|
3145
|
-
/* @__PURE__ */ (0,
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
3146
3225
|
Array.from(
|
|
3147
3226
|
{ length: Math.max(0, pages - 10) },
|
|
3148
3227
|
(_, index) => index + 9
|
|
3149
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3228
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3150
3229
|
]
|
|
3151
3230
|
}
|
|
3152
3231
|
) })
|
|
3153
3232
|
] });
|
|
3154
3233
|
} else if (showLastPages) {
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3157
3236
|
Hyperlink,
|
|
3158
3237
|
{
|
|
3159
3238
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3161,7 +3240,7 @@ var DataList = (props) => {
|
|
|
3161
3240
|
children: "1"
|
|
3162
3241
|
}
|
|
3163
3242
|
),
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3165
3244
|
Hyperlink,
|
|
3166
3245
|
{
|
|
3167
3246
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3169,21 +3248,21 @@ var DataList = (props) => {
|
|
|
3169
3248
|
children: "2"
|
|
3170
3249
|
}
|
|
3171
3250
|
),
|
|
3172
|
-
/* @__PURE__ */ (0,
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3173
3252
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
3174
|
-
(page) => /* @__PURE__ */ (0,
|
|
3253
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3175
3254
|
Hyperlink,
|
|
3176
3255
|
{
|
|
3177
3256
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3178
3257
|
href: builder.getNewPageUrl(page),
|
|
3179
3258
|
children: page
|
|
3180
3259
|
}
|
|
3181
|
-
) : /* @__PURE__ */ (0,
|
|
3260
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3182
3261
|
)
|
|
3183
3262
|
] });
|
|
3184
3263
|
} else {
|
|
3185
|
-
return /* @__PURE__ */ (0,
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3187
3266
|
Hyperlink,
|
|
3188
3267
|
{
|
|
3189
3268
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3191,7 +3270,7 @@ var DataList = (props) => {
|
|
|
3191
3270
|
children: "1"
|
|
3192
3271
|
}
|
|
3193
3272
|
),
|
|
3194
|
-
/* @__PURE__ */ (0,
|
|
3273
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3195
3274
|
Hyperlink,
|
|
3196
3275
|
{
|
|
3197
3276
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3199,20 +3278,20 @@ var DataList = (props) => {
|
|
|
3199
3278
|
children: "2"
|
|
3200
3279
|
}
|
|
3201
3280
|
),
|
|
3202
|
-
/* @__PURE__ */ (0,
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3203
3282
|
Array.from(
|
|
3204
3283
|
{ length: 5 },
|
|
3205
3284
|
(_, index) => activePageNumber - 2 + index
|
|
3206
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3285
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3207
3286
|
Hyperlink,
|
|
3208
3287
|
{
|
|
3209
3288
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3210
3289
|
href: builder.getNewPageUrl(page),
|
|
3211
3290
|
children: page
|
|
3212
3291
|
}
|
|
3213
|
-
) : /* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3292
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3216
3295
|
Hyperlink,
|
|
3217
3296
|
{
|
|
3218
3297
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3220,7 +3299,7 @@ var DataList = (props) => {
|
|
|
3220
3299
|
children: pages - 1
|
|
3221
3300
|
}
|
|
3222
3301
|
),
|
|
3223
|
-
/* @__PURE__ */ (0,
|
|
3302
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3224
3303
|
Hyperlink,
|
|
3225
3304
|
{
|
|
3226
3305
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3228,7 +3307,7 @@ var DataList = (props) => {
|
|
|
3228
3307
|
children: pages
|
|
3229
3308
|
}
|
|
3230
3309
|
),
|
|
3231
|
-
/* @__PURE__ */ (0,
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3232
3311
|
"select",
|
|
3233
3312
|
{
|
|
3234
3313
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3240,8 +3319,8 @@ var DataList = (props) => {
|
|
|
3240
3319
|
}
|
|
3241
3320
|
},
|
|
3242
3321
|
children: [
|
|
3243
|
-
/* @__PURE__ */ (0,
|
|
3244
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: "", children: "Jump to" }),
|
|
3323
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3245
3324
|
]
|
|
3246
3325
|
}
|
|
3247
3326
|
) })
|
|
@@ -3249,16 +3328,16 @@ var DataList = (props) => {
|
|
|
3249
3328
|
}
|
|
3250
3329
|
}
|
|
3251
3330
|
};
|
|
3252
|
-
return /* @__PURE__ */ (0,
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3254
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react33.default.Fragment, { children: [
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ContentView_default, { isDataFound, children: [
|
|
3333
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3255
3334
|
"div",
|
|
3256
3335
|
{
|
|
3257
3336
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200 sticky top-0`,
|
|
3258
3337
|
children: [
|
|
3259
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3260
|
-
/* @__PURE__ */ (0,
|
|
3261
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3338
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3340
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3262
3341
|
InputControl_default,
|
|
3263
3342
|
{
|
|
3264
3343
|
name: filter.name,
|
|
@@ -3273,15 +3352,15 @@ var DataList = (props) => {
|
|
|
3273
3352
|
},
|
|
3274
3353
|
filter.name
|
|
3275
3354
|
)),
|
|
3276
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3355
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3277
3356
|
Hyperlink,
|
|
3278
3357
|
{
|
|
3279
3358
|
className: "gap-1",
|
|
3280
3359
|
linkType: "Primary" /* Solid */,
|
|
3281
3360
|
href: props.addLinkHref,
|
|
3282
3361
|
children: [
|
|
3283
|
-
/* @__PURE__ */ (0,
|
|
3284
|
-
/* @__PURE__ */ (0,
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3285
3364
|
]
|
|
3286
3365
|
}
|
|
3287
3366
|
)
|
|
@@ -3289,8 +3368,8 @@ var DataList = (props) => {
|
|
|
3289
3368
|
]
|
|
3290
3369
|
}
|
|
3291
3370
|
),
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3293
|
-
/* @__PURE__ */ (0,
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
3372
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3294
3373
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3295
3374
|
let icon = "chevronUpDown";
|
|
3296
3375
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3300,36 +3379,36 @@ var DataList = (props) => {
|
|
|
3300
3379
|
icon = "chevronUp";
|
|
3301
3380
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3302
3381
|
}
|
|
3303
|
-
return /* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3304
3383
|
"th",
|
|
3305
3384
|
{
|
|
3306
3385
|
className: "px-6 py-3 text-left font-medium cursor-pointer bg-neutral-soft " + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
3307
|
-
children: /* @__PURE__ */ (0,
|
|
3308
|
-
/* @__PURE__ */ (0,
|
|
3309
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
3386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "!text-neutral-contrast ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-black", children: column.label }),
|
|
3388
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3310
3389
|
] }) })
|
|
3311
3390
|
},
|
|
3312
3391
|
column.name
|
|
3313
3392
|
);
|
|
3314
3393
|
}) }) }),
|
|
3315
|
-
/* @__PURE__ */ (0,
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
3316
3395
|
let validityClass = "";
|
|
3317
3396
|
console.log("dataitem", dataitem);
|
|
3318
3397
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
3319
3398
|
validityClass = "bg-alert-200";
|
|
3320
3399
|
}
|
|
3321
|
-
return /* @__PURE__ */ (0,
|
|
3400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
3322
3401
|
console.log("column", column);
|
|
3323
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3324
3403
|
"td",
|
|
3325
3404
|
{
|
|
3326
3405
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
3327
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
3406
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3328
3407
|
Hyperlink,
|
|
3329
3408
|
{
|
|
3330
3409
|
className: "",
|
|
3331
3410
|
href: `https://${dataitem[column.name]}`,
|
|
3332
|
-
children: /* @__PURE__ */ (0,
|
|
3411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3333
3412
|
ViewControl_default,
|
|
3334
3413
|
{
|
|
3335
3414
|
controlType: column.controlType,
|
|
@@ -3342,11 +3421,11 @@ var DataList = (props) => {
|
|
|
3342
3421
|
}
|
|
3343
3422
|
)
|
|
3344
3423
|
}
|
|
3345
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
3424
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3346
3425
|
Hyperlink,
|
|
3347
3426
|
{
|
|
3348
3427
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
3349
|
-
children: /* @__PURE__ */ (0,
|
|
3428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3350
3429
|
ViewControl_default,
|
|
3351
3430
|
{
|
|
3352
3431
|
controlType: column.controlType,
|
|
@@ -3356,7 +3435,7 @@ var DataList = (props) => {
|
|
|
3356
3435
|
}
|
|
3357
3436
|
)
|
|
3358
3437
|
}
|
|
3359
|
-
) : /* @__PURE__ */ (0,
|
|
3438
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3360
3439
|
ViewControl_default,
|
|
3361
3440
|
{
|
|
3362
3441
|
controlType: column.controlType,
|
|
@@ -3370,10 +3449,10 @@ var DataList = (props) => {
|
|
|
3370
3449
|
}) }, index);
|
|
3371
3450
|
}) })
|
|
3372
3451
|
] }) }),
|
|
3373
|
-
/* @__PURE__ */ (0,
|
|
3374
|
-
/* @__PURE__ */ (0,
|
|
3375
|
-
/* @__PURE__ */ (0,
|
|
3376
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
3452
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-gray-700", children: label }),
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
3455
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3377
3456
|
Hyperlink,
|
|
3378
3457
|
{
|
|
3379
3458
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3381,9 +3460,9 @@ var DataList = (props) => {
|
|
|
3381
3460
|
children: "Prev"
|
|
3382
3461
|
}
|
|
3383
3462
|
),
|
|
3384
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
3463
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-l-md border border-gray-300 bg-gray-200 text-gray-500 hover:bg-gray-200", children: "Prev" }),
|
|
3385
3464
|
renderPageNumbers(),
|
|
3386
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
3465
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3387
3466
|
Hyperlink,
|
|
3388
3467
|
{
|
|
3389
3468
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3391,19 +3470,19 @@ var DataList = (props) => {
|
|
|
3391
3470
|
children: "Next"
|
|
3392
3471
|
}
|
|
3393
3472
|
),
|
|
3394
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
3473
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
3395
3474
|
] })
|
|
3396
3475
|
] }) })
|
|
3397
3476
|
] }),
|
|
3398
|
-
/* @__PURE__ */ (0,
|
|
3399
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
3478
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3400
3479
|
"div",
|
|
3401
3480
|
{
|
|
3402
3481
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200`,
|
|
3403
3482
|
children: [
|
|
3404
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3406
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3483
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3485
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3407
3486
|
InputControl_default,
|
|
3408
3487
|
{
|
|
3409
3488
|
name: filter.name,
|
|
@@ -3418,15 +3497,15 @@ var DataList = (props) => {
|
|
|
3418
3497
|
},
|
|
3419
3498
|
filter.name
|
|
3420
3499
|
)),
|
|
3421
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3500
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3422
3501
|
Hyperlink,
|
|
3423
3502
|
{
|
|
3424
3503
|
className: "gap-1",
|
|
3425
3504
|
linkType: "Primary" /* Solid */,
|
|
3426
3505
|
href: props.addLinkHref,
|
|
3427
3506
|
children: [
|
|
3428
|
-
/* @__PURE__ */ (0,
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3430
3509
|
]
|
|
3431
3510
|
}
|
|
3432
3511
|
)
|
|
@@ -3434,8 +3513,8 @@ var DataList = (props) => {
|
|
|
3434
3513
|
]
|
|
3435
3514
|
}
|
|
3436
3515
|
),
|
|
3437
|
-
/* @__PURE__ */ (0,
|
|
3438
|
-
/* @__PURE__ */ (0,
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3439
3518
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3440
3519
|
let icon = "chevronUpDown";
|
|
3441
3520
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3445,33 +3524,142 @@ var DataList = (props) => {
|
|
|
3445
3524
|
icon = "chevronUp";
|
|
3446
3525
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3447
3526
|
}
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3449
3528
|
"th",
|
|
3450
3529
|
{
|
|
3451
3530
|
className: "px-6 py-3 text-left font-medium cursor-pointer bg-neutral-soft " + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
3452
|
-
children: /* @__PURE__ */ (0,
|
|
3453
|
-
/* @__PURE__ */ (0,
|
|
3454
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
3531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "text-body-950", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: column.label }),
|
|
3533
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3455
3534
|
] }) })
|
|
3456
3535
|
},
|
|
3457
3536
|
column.name
|
|
3458
3537
|
);
|
|
3459
3538
|
}) }) }) }) }),
|
|
3460
|
-
/* @__PURE__ */ (0,
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
3461
3540
|
] })
|
|
3462
3541
|
] })
|
|
3463
3542
|
] });
|
|
3464
3543
|
};
|
|
3465
3544
|
var DataList_default = DataList;
|
|
3466
3545
|
|
|
3546
|
+
// src/components/dataForm/DataListRenderer.tsx
|
|
3547
|
+
var import_react34 = __toESM(require("react"));
|
|
3548
|
+
init_ServiceClient();
|
|
3549
|
+
var import_navigation2 = require("next/navigation");
|
|
3550
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3551
|
+
var viewControlMap = {
|
|
3552
|
+
number: ViewControlTypes.number,
|
|
3553
|
+
lineText: ViewControlTypes.lineText,
|
|
3554
|
+
multilineText: ViewControlTypes.multilineText,
|
|
3555
|
+
date: ViewControlTypes.date,
|
|
3556
|
+
boolean: ViewControlTypes.boolean
|
|
3557
|
+
};
|
|
3558
|
+
function resolveRoutePlaceholders(route, params) {
|
|
3559
|
+
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
3560
|
+
const value = params[key];
|
|
3561
|
+
if (value === void 0 || value === null) {
|
|
3562
|
+
console.warn(`No value found for route param: ${key}`);
|
|
3563
|
+
return "";
|
|
3564
|
+
}
|
|
3565
|
+
return value;
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
function mapApiToColumns(siteForm) {
|
|
3569
|
+
const cols = siteForm?.siteFormDataList?.siteFormDataListColumns ?? [];
|
|
3570
|
+
return cols.map((col) => ({
|
|
3571
|
+
label: col.label,
|
|
3572
|
+
name: col.columnName,
|
|
3573
|
+
controlType: viewControlMap[col.controlTypeCode] ?? ViewControlTypes.lineText,
|
|
3574
|
+
enableSorting: col.enableSorting ?? false,
|
|
3575
|
+
width: "w-2/12",
|
|
3576
|
+
showAsLink: col.showAsLink ?? false,
|
|
3577
|
+
linkUrlSegment: col.linkUrlSegment ?? void 0,
|
|
3578
|
+
emptyValueLabel: col.emptyValueLabel ?? void 0
|
|
3579
|
+
}));
|
|
3580
|
+
}
|
|
3581
|
+
function mapApiToFilters(siteForm) {
|
|
3582
|
+
const filter = siteForm?.siteFormDataList?.siteFormDataListFilters ?? [];
|
|
3583
|
+
return filter.map((fil) => ({
|
|
3584
|
+
placeholder: fil.placeholder,
|
|
3585
|
+
name: fil.columnName,
|
|
3586
|
+
servicePath: fil.serviceRoute,
|
|
3587
|
+
dataTextFieldName: fil.dataTextFieldName,
|
|
3588
|
+
controlType: SelectWithSearchInput_default,
|
|
3589
|
+
dataKeyFieldName: fil.dataKeyFieldName,
|
|
3590
|
+
dataTypeCode: fil.isKeyNumber ? "number" : "string"
|
|
3591
|
+
}));
|
|
3592
|
+
}
|
|
3593
|
+
var DataListRenderer = ({
|
|
3594
|
+
formDefinition,
|
|
3595
|
+
apiBaseUrl,
|
|
3596
|
+
session,
|
|
3597
|
+
params,
|
|
3598
|
+
query,
|
|
3599
|
+
path,
|
|
3600
|
+
widgetProps
|
|
3601
|
+
}) => {
|
|
3602
|
+
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
3603
|
+
const [columns, setColumns] = (0, import_react34.useState)([]);
|
|
3604
|
+
const [dataset, setDataset] = (0, import_react34.useState)();
|
|
3605
|
+
const [filter, setFilters] = (0, import_react34.useState)([]);
|
|
3606
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react34.useState)("");
|
|
3607
|
+
const [addLinkText, setAddLinkText] = (0, import_react34.useState)("");
|
|
3608
|
+
const [serviceRoute, setServiceRoute] = (0, import_react34.useState)("");
|
|
3609
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
3610
|
+
(0, import_react34.useEffect)(() => {
|
|
3611
|
+
if (!formDefinition) return;
|
|
3612
|
+
setColumns(mapApiToColumns(formDefinition));
|
|
3613
|
+
setFilters(mapApiToFilters(formDefinition));
|
|
3614
|
+
setServiceRoute(formDefinition?.siteFormDataList?.serviceRoute ?? "/");
|
|
3615
|
+
const rawAddLinkHref = formDefinition?.siteFormDataList?.addLinkHref ?? "";
|
|
3616
|
+
const resolvedAddLinkHref = resolveRoutePlaceholders(
|
|
3617
|
+
rawAddLinkHref,
|
|
3618
|
+
params
|
|
3619
|
+
);
|
|
3620
|
+
setAddLinkHref(resolvedAddLinkHref);
|
|
3621
|
+
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
3622
|
+
}, [formDefinition, params]);
|
|
3623
|
+
(0, import_react34.useEffect)(() => {
|
|
3624
|
+
const fetchData = async () => {
|
|
3625
|
+
if (!serviceRoute) return;
|
|
3626
|
+
let resolvedRoute = resolveRoutePlaceholders(serviceRoute, params);
|
|
3627
|
+
const queryString = OdataBuilder.getOdataQueryString(query);
|
|
3628
|
+
const separator = resolvedRoute.includes("?") ? "&" : "?";
|
|
3629
|
+
const finalUrl = resolvedRoute + (queryString ? separator + queryString : "");
|
|
3630
|
+
const result = await serviceClient.get(finalUrl);
|
|
3631
|
+
setDataset(result);
|
|
3632
|
+
};
|
|
3633
|
+
fetchData();
|
|
3634
|
+
}, [serviceRoute, query, params]);
|
|
3635
|
+
const [tabItem, setTabItem] = (0, import_react34.useState)();
|
|
3636
|
+
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
3637
|
+
const activeHref = activeTab ? resolveRoutePlaceholders(activeTab.landingPageUrl, params) : pathname;
|
|
3638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3639
|
+
DataList_default,
|
|
3640
|
+
{
|
|
3641
|
+
addLinkHref,
|
|
3642
|
+
addLinkText,
|
|
3643
|
+
title: (formDefinition?.formTitle || "") + "-V2",
|
|
3644
|
+
path,
|
|
3645
|
+
columns,
|
|
3646
|
+
dataset,
|
|
3647
|
+
filters: filter,
|
|
3648
|
+
serviceClient,
|
|
3649
|
+
query
|
|
3650
|
+
}
|
|
3651
|
+
) });
|
|
3652
|
+
};
|
|
3653
|
+
var DataListRenderer_default = DataListRenderer;
|
|
3654
|
+
|
|
3467
3655
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3468
|
-
var
|
|
3656
|
+
var import_react53 = __toESM(require("react"));
|
|
3469
3657
|
|
|
3470
3658
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3471
|
-
var
|
|
3659
|
+
var import_react39 = __toESM(require("react"));
|
|
3472
3660
|
|
|
3473
3661
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3474
|
-
var
|
|
3662
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3475
3663
|
var TextNode = (props) => {
|
|
3476
3664
|
function cssStringToJson(cssString) {
|
|
3477
3665
|
const styleObject = {};
|
|
@@ -3529,32 +3717,32 @@ var TextNode = (props) => {
|
|
|
3529
3717
|
});
|
|
3530
3718
|
}
|
|
3531
3719
|
function renderWithLineBreaks(text) {
|
|
3532
|
-
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0,
|
|
3720
|
+
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
3533
3721
|
line,
|
|
3534
|
-
index < arr.length - 1 && /* @__PURE__ */ (0,
|
|
3722
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("br", {})
|
|
3535
3723
|
] }, index));
|
|
3536
3724
|
}
|
|
3537
3725
|
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
3538
3726
|
const finalText = props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text;
|
|
3539
3727
|
return (
|
|
3540
3728
|
// @ts-expect-error custom code
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: typeof finalText === "string" ? renderWithLineBreaks(finalText) : finalText })
|
|
3542
3730
|
);
|
|
3543
3731
|
};
|
|
3544
3732
|
var TextNode_default = TextNode;
|
|
3545
3733
|
|
|
3546
3734
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
3547
|
-
var
|
|
3735
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3548
3736
|
var LineBreakNode = () => {
|
|
3549
|
-
return /* @__PURE__ */ (0,
|
|
3737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
3550
3738
|
};
|
|
3551
3739
|
var LineBreakNode_default = LineBreakNode;
|
|
3552
3740
|
|
|
3553
3741
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3554
|
-
var
|
|
3742
|
+
var import_react38 = __toESM(require("react"));
|
|
3555
3743
|
|
|
3556
3744
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3557
|
-
var
|
|
3745
|
+
var import_react36 = __toESM(require("react"));
|
|
3558
3746
|
|
|
3559
3747
|
// src/components/utilities/AssetUtility.tsx
|
|
3560
3748
|
var AssetUtility = class {
|
|
@@ -3582,7 +3770,7 @@ var import_dynamic = __toESM(require("next/dynamic"));
|
|
|
3582
3770
|
|
|
3583
3771
|
// src/components/DeviceAssetSelector.tsx
|
|
3584
3772
|
init_HlsPlayer();
|
|
3585
|
-
var
|
|
3773
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3586
3774
|
var DeviceAssetSelector = ({
|
|
3587
3775
|
assets,
|
|
3588
3776
|
assetBaseUrl,
|
|
@@ -3657,7 +3845,7 @@ var DeviceAssetSelector = ({
|
|
|
3657
3845
|
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3658
3846
|
const renderMedia = () => {
|
|
3659
3847
|
if (isHls) {
|
|
3660
|
-
return /* @__PURE__ */ (0,
|
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3661
3849
|
HlsPlayer_default,
|
|
3662
3850
|
{
|
|
3663
3851
|
assetUrl: resolvedAssetUrl,
|
|
@@ -3674,7 +3862,7 @@ var DeviceAssetSelector = ({
|
|
|
3674
3862
|
} else {
|
|
3675
3863
|
return (
|
|
3676
3864
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3678
3866
|
"img",
|
|
3679
3867
|
{
|
|
3680
3868
|
style: styles,
|
|
@@ -3690,17 +3878,17 @@ var DeviceAssetSelector = ({
|
|
|
3690
3878
|
}
|
|
3691
3879
|
};
|
|
3692
3880
|
if (width) {
|
|
3693
|
-
return /* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3694
3882
|
}
|
|
3695
3883
|
if (nodeProps?.format) {
|
|
3696
|
-
return /* @__PURE__ */ (0,
|
|
3884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3697
3885
|
}
|
|
3698
3886
|
return renderMedia();
|
|
3699
3887
|
};
|
|
3700
3888
|
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3701
3889
|
|
|
3702
3890
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3703
|
-
var
|
|
3891
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3704
3892
|
var HlsPlayer2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3705
3893
|
ssr: false
|
|
3706
3894
|
});
|
|
@@ -3743,7 +3931,7 @@ var ImageNode = (props) => {
|
|
|
3743
3931
|
console.error("Error parsing assets in ImageNode:", error);
|
|
3744
3932
|
}
|
|
3745
3933
|
if (assets && assets.length > 0) {
|
|
3746
|
-
return /* @__PURE__ */ (0,
|
|
3934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3747
3935
|
DeviceAssetSelector_default,
|
|
3748
3936
|
{
|
|
3749
3937
|
device: props.device,
|
|
@@ -3792,7 +3980,7 @@ var ImageNode = (props) => {
|
|
|
3792
3980
|
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3793
3981
|
const renderMedia = () => {
|
|
3794
3982
|
if (isHls) {
|
|
3795
|
-
return /* @__PURE__ */ (0,
|
|
3983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3796
3984
|
HlsPlayer2,
|
|
3797
3985
|
{
|
|
3798
3986
|
assetUrl: imageUrl,
|
|
@@ -3807,7 +3995,7 @@ var ImageNode = (props) => {
|
|
|
3807
3995
|
}
|
|
3808
3996
|
);
|
|
3809
3997
|
} else {
|
|
3810
|
-
return /* @__PURE__ */ (0,
|
|
3998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react36.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3811
3999
|
"img",
|
|
3812
4000
|
{
|
|
3813
4001
|
style: styles,
|
|
@@ -3822,7 +4010,7 @@ var ImageNode = (props) => {
|
|
|
3822
4010
|
}
|
|
3823
4011
|
};
|
|
3824
4012
|
if (props.node.width) {
|
|
3825
|
-
return /* @__PURE__ */ (0,
|
|
4013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3826
4014
|
}
|
|
3827
4015
|
return renderMedia();
|
|
3828
4016
|
};
|
|
@@ -3831,7 +4019,7 @@ var ImageNode_default = ImageNode;
|
|
|
3831
4019
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3832
4020
|
init_StyleTypes();
|
|
3833
4021
|
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3834
|
-
var
|
|
4022
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3835
4023
|
var LinkNodeButton2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3836
4024
|
ssr: false
|
|
3837
4025
|
});
|
|
@@ -3878,13 +4066,13 @@ var LinkNode = (props) => {
|
|
|
3878
4066
|
const isButton = node.isButton === true;
|
|
3879
4067
|
const renderChildren = () => {
|
|
3880
4068
|
if (!node.children || node.children.length === 0) return null;
|
|
3881
|
-
return /* @__PURE__ */ (0,
|
|
4069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: node.children.map((childNode, index) => {
|
|
3882
4070
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3883
4071
|
if (!SelectedNode) {
|
|
3884
4072
|
console.warn("Unknown node type:", childNode.type);
|
|
3885
4073
|
return null;
|
|
3886
4074
|
}
|
|
3887
|
-
return /* @__PURE__ */ (0,
|
|
4075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react38.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3888
4076
|
SelectedNode,
|
|
3889
4077
|
{
|
|
3890
4078
|
node: childNode,
|
|
@@ -3897,15 +4085,15 @@ var LinkNode = (props) => {
|
|
|
3897
4085
|
};
|
|
3898
4086
|
const renderFallback = () => {
|
|
3899
4087
|
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3900
|
-
return /* @__PURE__ */ (0,
|
|
4088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: linkText });
|
|
3901
4089
|
}
|
|
3902
4090
|
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3903
|
-
return /* @__PURE__ */ (0,
|
|
4091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("br", {});
|
|
3904
4092
|
}
|
|
3905
4093
|
return null;
|
|
3906
4094
|
};
|
|
3907
4095
|
if (isButton) {
|
|
3908
|
-
return /* @__PURE__ */ (0,
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3909
4097
|
LinkNodeButton2,
|
|
3910
4098
|
{
|
|
3911
4099
|
node,
|
|
@@ -3923,7 +4111,7 @@ var LinkNode = (props) => {
|
|
|
3923
4111
|
}
|
|
3924
4112
|
);
|
|
3925
4113
|
}
|
|
3926
|
-
return /* @__PURE__ */ (0,
|
|
4114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3927
4115
|
Hyperlink,
|
|
3928
4116
|
{
|
|
3929
4117
|
href: linkUrl || "#",
|
|
@@ -3939,10 +4127,10 @@ var LinkNode = (props) => {
|
|
|
3939
4127
|
var LinkNode_default = LinkNode;
|
|
3940
4128
|
|
|
3941
4129
|
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3942
|
-
var
|
|
4130
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3943
4131
|
var SVGIconNode = ({ node }) => {
|
|
3944
4132
|
if (!node?.svgCode) return null;
|
|
3945
|
-
return /* @__PURE__ */ (0,
|
|
4133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3946
4134
|
"span",
|
|
3947
4135
|
{
|
|
3948
4136
|
style: {
|
|
@@ -3959,7 +4147,7 @@ var SVGIconNode_default = SVGIconNode;
|
|
|
3959
4147
|
|
|
3960
4148
|
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3961
4149
|
var import_katex = __toESM(require("katex"));
|
|
3962
|
-
var
|
|
4150
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3963
4151
|
var EquationNode = ({ node }) => {
|
|
3964
4152
|
const { equation, inline } = node;
|
|
3965
4153
|
let html = "";
|
|
@@ -3974,7 +4162,7 @@ var EquationNode = ({ node }) => {
|
|
|
3974
4162
|
});
|
|
3975
4163
|
}
|
|
3976
4164
|
if (inline) {
|
|
3977
|
-
return /* @__PURE__ */ (0,
|
|
4165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3978
4166
|
"span",
|
|
3979
4167
|
{
|
|
3980
4168
|
className: "katex-inline",
|
|
@@ -3982,7 +4170,7 @@ var EquationNode = ({ node }) => {
|
|
|
3982
4170
|
}
|
|
3983
4171
|
);
|
|
3984
4172
|
}
|
|
3985
|
-
return /* @__PURE__ */ (0,
|
|
4173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3986
4174
|
"div",
|
|
3987
4175
|
{
|
|
3988
4176
|
className: "katex-block my-3 text-center",
|
|
@@ -3993,7 +4181,7 @@ var EquationNode = ({ node }) => {
|
|
|
3993
4181
|
var EquationNode_default = EquationNode;
|
|
3994
4182
|
|
|
3995
4183
|
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3996
|
-
var
|
|
4184
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3997
4185
|
function getNestedProperty(obj, path) {
|
|
3998
4186
|
if (!obj || !path) return null;
|
|
3999
4187
|
if (path.includes(".")) {
|
|
@@ -4006,7 +4194,7 @@ function getNestedProperty(obj, path) {
|
|
|
4006
4194
|
}
|
|
4007
4195
|
const value = obj[path];
|
|
4008
4196
|
if (Array.isArray(value)) {
|
|
4009
|
-
return value.map((item, index) => /* @__PURE__ */ (0,
|
|
4197
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: String(item) }, index));
|
|
4010
4198
|
}
|
|
4011
4199
|
return value;
|
|
4012
4200
|
}
|
|
@@ -4067,7 +4255,7 @@ var DatafieldNode = (props) => {
|
|
|
4067
4255
|
const dataType = props.node.dataType;
|
|
4068
4256
|
if (isEmptyValue) return null;
|
|
4069
4257
|
if (dataType === "rawContent") {
|
|
4070
|
-
return /* @__PURE__ */ (0,
|
|
4258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4071
4259
|
PageBodyRenderer_default,
|
|
4072
4260
|
{
|
|
4073
4261
|
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
@@ -4083,12 +4271,12 @@ var DatafieldNode = (props) => {
|
|
|
4083
4271
|
}
|
|
4084
4272
|
);
|
|
4085
4273
|
}
|
|
4086
|
-
return /* @__PURE__ */ (0,
|
|
4274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4087
4275
|
"span",
|
|
4088
4276
|
{
|
|
4089
4277
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
4090
4278
|
style: styles,
|
|
4091
|
-
children: /* @__PURE__ */ (0,
|
|
4279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4092
4280
|
ViewControl_default,
|
|
4093
4281
|
{
|
|
4094
4282
|
controlType: dataType,
|
|
@@ -4101,7 +4289,7 @@ var DatafieldNode = (props) => {
|
|
|
4101
4289
|
var DatafieldNode_default = DatafieldNode;
|
|
4102
4290
|
|
|
4103
4291
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4104
|
-
var
|
|
4292
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4105
4293
|
var ParagraphNode = (props) => {
|
|
4106
4294
|
const NodeTypes2 = {
|
|
4107
4295
|
["text"]: TextNode_default,
|
|
@@ -4121,9 +4309,9 @@ var ParagraphNode = (props) => {
|
|
|
4121
4309
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
4122
4310
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
4123
4311
|
if (isInlineOnlyParent) {
|
|
4124
|
-
return /* @__PURE__ */ (0,
|
|
4312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
4125
4313
|
const SelectedNode = NodeTypes2[node.type];
|
|
4126
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4127
4315
|
SelectedNode,
|
|
4128
4316
|
{
|
|
4129
4317
|
node,
|
|
@@ -4135,10 +4323,10 @@ var ParagraphNode = (props) => {
|
|
|
4135
4323
|
) }, index);
|
|
4136
4324
|
}) });
|
|
4137
4325
|
}
|
|
4138
|
-
return /* @__PURE__ */ (0,
|
|
4326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: " " + formatClasses, children: [
|
|
4139
4327
|
hasChildren && props.node.children.map((node, index) => {
|
|
4140
4328
|
const SelectedNode = NodeTypes2[node.type];
|
|
4141
|
-
return /* @__PURE__ */ (0,
|
|
4329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4142
4330
|
SelectedNode,
|
|
4143
4331
|
{
|
|
4144
4332
|
node,
|
|
@@ -4149,14 +4337,14 @@ var ParagraphNode = (props) => {
|
|
|
4149
4337
|
}
|
|
4150
4338
|
) }, index);
|
|
4151
4339
|
}),
|
|
4152
|
-
!hasChildren && /* @__PURE__ */ (0,
|
|
4340
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
4153
4341
|
] });
|
|
4154
4342
|
};
|
|
4155
4343
|
var ParagraphNode_default = ParagraphNode;
|
|
4156
4344
|
|
|
4157
4345
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
4158
|
-
var
|
|
4159
|
-
var
|
|
4346
|
+
var import_react40 = __toESM(require("react"));
|
|
4347
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4160
4348
|
var HeadingNode = (props) => {
|
|
4161
4349
|
const NodeTypes2 = {
|
|
4162
4350
|
["text"]: TextNode_default,
|
|
@@ -4172,23 +4360,23 @@ var HeadingNode = (props) => {
|
|
|
4172
4360
|
{
|
|
4173
4361
|
}
|
|
4174
4362
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
4175
|
-
return /* @__PURE__ */ (0,
|
|
4363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: import_react40.default.createElement(
|
|
4176
4364
|
HeadingTag,
|
|
4177
4365
|
{ className: formatClasses },
|
|
4178
4366
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
4179
4367
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
4180
|
-
return /* @__PURE__ */ (0,
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4181
4369
|
})
|
|
4182
4370
|
) });
|
|
4183
4371
|
};
|
|
4184
4372
|
var HeadingNode_default = HeadingNode;
|
|
4185
4373
|
|
|
4186
4374
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4187
|
-
var
|
|
4375
|
+
var import_react42 = __toESM(require("react"));
|
|
4188
4376
|
|
|
4189
4377
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
4190
|
-
var
|
|
4191
|
-
var
|
|
4378
|
+
var import_react41 = __toESM(require("react"));
|
|
4379
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4192
4380
|
var ListItemNode = (props) => {
|
|
4193
4381
|
const NodeTypes2 = {
|
|
4194
4382
|
text: TextNode_default,
|
|
@@ -4205,66 +4393,66 @@ var ListItemNode = (props) => {
|
|
|
4205
4393
|
liStyle.fontSize = match[1].trim();
|
|
4206
4394
|
}
|
|
4207
4395
|
}
|
|
4208
|
-
return /* @__PURE__ */ (0,
|
|
4396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
4209
4397
|
const SelectedNode = NodeTypes2[node.type];
|
|
4210
4398
|
if (node.type === "linebreak") {
|
|
4211
4399
|
if (!foundFirstBreak) {
|
|
4212
4400
|
foundFirstBreak = true;
|
|
4213
|
-
return /* @__PURE__ */ (0,
|
|
4401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", {}, index);
|
|
4214
4402
|
} else {
|
|
4215
|
-
return /* @__PURE__ */ (0,
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
4216
4404
|
}
|
|
4217
4405
|
} else {
|
|
4218
4406
|
foundFirstBreak = false;
|
|
4219
|
-
return /* @__PURE__ */ (0,
|
|
4407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4220
4408
|
}
|
|
4221
4409
|
}) });
|
|
4222
4410
|
};
|
|
4223
4411
|
var ListItemNode_default = ListItemNode;
|
|
4224
4412
|
|
|
4225
4413
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4226
|
-
var
|
|
4414
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4227
4415
|
var ListNode = (props) => {
|
|
4228
4416
|
const NodeTypes2 = {
|
|
4229
4417
|
listitem: ListItemNode_default
|
|
4230
4418
|
};
|
|
4231
|
-
return /* @__PURE__ */ (0,
|
|
4232
|
-
props.node.listType == "bullet" && /* @__PURE__ */ (0,
|
|
4419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react42.default.Fragment, { children: [
|
|
4420
|
+
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4233
4421
|
const SelectedNode = NodeTypes2[node.type];
|
|
4234
|
-
return /* @__PURE__ */ (0,
|
|
4422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4235
4423
|
}) }),
|
|
4236
|
-
props.node.listType == "number" && /* @__PURE__ */ (0,
|
|
4424
|
+
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4237
4425
|
const SelectedNode = NodeTypes2[node.type];
|
|
4238
|
-
return /* @__PURE__ */ (0,
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4239
4427
|
}) })
|
|
4240
4428
|
] });
|
|
4241
4429
|
};
|
|
4242
4430
|
var ListNode_default = ListNode;
|
|
4243
4431
|
|
|
4244
4432
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4245
|
-
var
|
|
4246
|
-
var
|
|
4433
|
+
var import_react43 = __toESM(require("react"));
|
|
4434
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4247
4435
|
var QuoteNode = (props) => {
|
|
4248
4436
|
const NodeTypes2 = {
|
|
4249
4437
|
["text"]: TextNode_default,
|
|
4250
4438
|
["linebreak"]: LineBreakNode_default,
|
|
4251
4439
|
["link"]: LinkNode_default
|
|
4252
4440
|
};
|
|
4253
|
-
return /* @__PURE__ */ (0,
|
|
4441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4254
4442
|
const SelectedNode = NodeTypes2[node.type];
|
|
4255
|
-
return /* @__PURE__ */ (0,
|
|
4443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4256
4444
|
}) });
|
|
4257
4445
|
};
|
|
4258
4446
|
var QuoteNode_default = QuoteNode;
|
|
4259
4447
|
|
|
4260
4448
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4261
|
-
var
|
|
4449
|
+
var import_react45 = __toESM(require("react"));
|
|
4262
4450
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
4263
|
-
var
|
|
4451
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4264
4452
|
var CopyButton2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4265
4453
|
ssr: false,
|
|
4266
4454
|
// optional: fallback UI while loading
|
|
4267
|
-
loading: () => /* @__PURE__ */ (0,
|
|
4455
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4268
4456
|
});
|
|
4269
4457
|
var CodeNode = (props) => {
|
|
4270
4458
|
const NodeTypes2 = {
|
|
@@ -4278,14 +4466,14 @@ var CodeNode = (props) => {
|
|
|
4278
4466
|
if (node.type === "link") return node.text || node.url || "";
|
|
4279
4467
|
return "";
|
|
4280
4468
|
}).join("") ?? "";
|
|
4281
|
-
return /* @__PURE__ */ (0,
|
|
4282
|
-
/* @__PURE__ */ (0,
|
|
4283
|
-
/* @__PURE__ */ (0,
|
|
4284
|
-
/* @__PURE__ */ (0,
|
|
4469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
4470
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: "Code Snippet" }),
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CopyButton2, { text: textContent })
|
|
4285
4473
|
] }),
|
|
4286
|
-
/* @__PURE__ */ (0,
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
4287
4475
|
const SelectedNode = NodeTypes2[node.type];
|
|
4288
|
-
return /* @__PURE__ */ (0,
|
|
4476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react45.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4289
4477
|
SelectedNode,
|
|
4290
4478
|
{
|
|
4291
4479
|
node,
|
|
@@ -4300,15 +4488,15 @@ var CodeNode = (props) => {
|
|
|
4300
4488
|
var CodeNode_default = CodeNode;
|
|
4301
4489
|
|
|
4302
4490
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
4303
|
-
var
|
|
4491
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4304
4492
|
var HorizontalRuleNode = () => {
|
|
4305
|
-
return /* @__PURE__ */ (0,
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("hr", {});
|
|
4306
4494
|
};
|
|
4307
4495
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4308
4496
|
|
|
4309
4497
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4310
|
-
var
|
|
4311
|
-
var
|
|
4498
|
+
var import_react46 = __toESM(require("react"));
|
|
4499
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4312
4500
|
var WidgetNode = (props) => {
|
|
4313
4501
|
const getWidgetParameters = () => {
|
|
4314
4502
|
const widgetInputParameters = {
|
|
@@ -4365,7 +4553,7 @@ var WidgetNode = (props) => {
|
|
|
4365
4553
|
};
|
|
4366
4554
|
const widgetCode = props.node?.widgetCode;
|
|
4367
4555
|
if (!widgetCode) {
|
|
4368
|
-
return /* @__PURE__ */ (0,
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: "Invalid widget" });
|
|
4369
4557
|
}
|
|
4370
4558
|
const widgetParams = getWidgetParameters();
|
|
4371
4559
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -4374,7 +4562,7 @@ var WidgetNode = (props) => {
|
|
|
4374
4562
|
}
|
|
4375
4563
|
return (
|
|
4376
4564
|
// eslint-disable-next-line react-hooks/static-components
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4378
4566
|
WidgetRenderer,
|
|
4379
4567
|
{
|
|
4380
4568
|
params: widgetParams,
|
|
@@ -4391,12 +4579,12 @@ var WidgetNode = (props) => {
|
|
|
4391
4579
|
var WidgetNode_default = WidgetNode;
|
|
4392
4580
|
|
|
4393
4581
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4394
|
-
var
|
|
4582
|
+
var import_react47 = __toESM(require("react"));
|
|
4395
4583
|
|
|
4396
4584
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4397
|
-
var
|
|
4585
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4398
4586
|
var InputControlNode = (props) => {
|
|
4399
|
-
return /* @__PURE__ */ (0,
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4400
4588
|
InputControl_default,
|
|
4401
4589
|
{
|
|
4402
4590
|
name: props.node.name,
|
|
@@ -4426,22 +4614,22 @@ var InputControlNode_default = InputControlNode;
|
|
|
4426
4614
|
|
|
4427
4615
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4428
4616
|
init_ServiceClient();
|
|
4429
|
-
var
|
|
4617
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4430
4618
|
var FormContainerNode = (props) => {
|
|
4431
4619
|
const NodeTypes2 = {
|
|
4432
4620
|
["input-control"]: InputControlNode_default
|
|
4433
4621
|
};
|
|
4434
4622
|
const { node } = props;
|
|
4435
|
-
const formRef = (0,
|
|
4623
|
+
const formRef = (0, import_react47.useRef)(null);
|
|
4436
4624
|
const initialState = {
|
|
4437
4625
|
inputValues: {},
|
|
4438
4626
|
lastPropertyChanged: ""
|
|
4439
4627
|
};
|
|
4440
|
-
const [formState, dispatch] = (0,
|
|
4441
|
-
const handleInputChange = (0,
|
|
4628
|
+
const [formState, dispatch] = (0, import_react47.useReducer)(FormReducer_default, initialState);
|
|
4629
|
+
const handleInputChange = (0, import_react47.useCallback)((updatedValues) => {
|
|
4442
4630
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4443
4631
|
}, [dispatch]);
|
|
4444
|
-
(0,
|
|
4632
|
+
(0, import_react47.useEffect)(() => {
|
|
4445
4633
|
const fetchInitialData = async () => {
|
|
4446
4634
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4447
4635
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4456,12 +4644,12 @@ var FormContainerNode = (props) => {
|
|
|
4456
4644
|
};
|
|
4457
4645
|
fetchInitialData();
|
|
4458
4646
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4459
|
-
return /* @__PURE__ */ (0,
|
|
4647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
4460
4648
|
node.children && node.children.map((node2, index) => {
|
|
4461
4649
|
{
|
|
4462
4650
|
}
|
|
4463
4651
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4464
|
-
return /* @__PURE__ */ (0,
|
|
4652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react47.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4465
4653
|
InputControlNode_default,
|
|
4466
4654
|
{
|
|
4467
4655
|
value: formState.inputValues[node2.name],
|
|
@@ -4470,17 +4658,17 @@ var FormContainerNode = (props) => {
|
|
|
4470
4658
|
}
|
|
4471
4659
|
) }, index);
|
|
4472
4660
|
}),
|
|
4473
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
4661
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
4474
4662
|
] });
|
|
4475
4663
|
};
|
|
4476
4664
|
var FormContainerNode_default = FormContainerNode;
|
|
4477
4665
|
|
|
4478
4666
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4479
|
-
var
|
|
4667
|
+
var import_react52 = __toESM(require("react"));
|
|
4480
4668
|
|
|
4481
4669
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4482
4670
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
4483
|
-
var
|
|
4671
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4484
4672
|
var IframeClient2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4485
4673
|
ssr: false
|
|
4486
4674
|
});
|
|
@@ -4493,7 +4681,7 @@ var EmbedNode = (props) => {
|
|
|
4493
4681
|
} else {
|
|
4494
4682
|
src = props.node.embedSrc;
|
|
4495
4683
|
}
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(IframeClient2, { src }) });
|
|
4497
4685
|
};
|
|
4498
4686
|
var EmbedNode_default = EmbedNode;
|
|
4499
4687
|
|
|
@@ -4501,8 +4689,8 @@ var EmbedNode_default = EmbedNode;
|
|
|
4501
4689
|
init_ServiceClient();
|
|
4502
4690
|
|
|
4503
4691
|
// src/components/Slider.tsx
|
|
4504
|
-
var
|
|
4505
|
-
var
|
|
4692
|
+
var import_react50 = __toESM(require("react"));
|
|
4693
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4506
4694
|
var Slider = ({
|
|
4507
4695
|
children,
|
|
4508
4696
|
slidesToShow = 4,
|
|
@@ -4520,13 +4708,13 @@ var Slider = ({
|
|
|
4520
4708
|
pillStyle = "cumulative",
|
|
4521
4709
|
progressPosition = "bottom"
|
|
4522
4710
|
}) => {
|
|
4523
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4524
|
-
const [transition, setTransition] = (0,
|
|
4525
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4711
|
+
const [currentSlide, setCurrentSlide] = (0, import_react50.useState)(0);
|
|
4712
|
+
const [transition, setTransition] = (0, import_react50.useState)(true);
|
|
4713
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react50.useState)(
|
|
4526
4714
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4527
4715
|
);
|
|
4528
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4529
|
-
(0,
|
|
4716
|
+
const [isPlaying, setIsPlaying] = (0, import_react50.useState)(autoplay);
|
|
4717
|
+
(0, import_react50.useEffect)(() => {
|
|
4530
4718
|
if (typeof slidesToShow === "number") return;
|
|
4531
4719
|
const handleResize = () => {
|
|
4532
4720
|
if (window.innerWidth >= 1024) {
|
|
@@ -4541,7 +4729,7 @@ var Slider = ({
|
|
|
4541
4729
|
window.addEventListener("resize", handleResize);
|
|
4542
4730
|
return () => window.removeEventListener("resize", handleResize);
|
|
4543
4731
|
}, [slidesToShow]);
|
|
4544
|
-
(0,
|
|
4732
|
+
(0, import_react50.useEffect)(() => {
|
|
4545
4733
|
if (!autoplay) return;
|
|
4546
4734
|
const timer = setInterval(() => {
|
|
4547
4735
|
if (isPlaying) {
|
|
@@ -4550,7 +4738,7 @@ var Slider = ({
|
|
|
4550
4738
|
}, autoplay_speed);
|
|
4551
4739
|
return () => clearInterval(timer);
|
|
4552
4740
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4553
|
-
const totalSlides =
|
|
4741
|
+
const totalSlides = import_react50.Children.count(children);
|
|
4554
4742
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4555
4743
|
const nextSlide = () => {
|
|
4556
4744
|
if (currentSlide >= maxSlide) {
|
|
@@ -4595,16 +4783,16 @@ var Slider = ({
|
|
|
4595
4783
|
}
|
|
4596
4784
|
};
|
|
4597
4785
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4598
|
-
const slides =
|
|
4599
|
-
if (!
|
|
4786
|
+
const slides = import_react50.Children.map(children, (child, index) => {
|
|
4787
|
+
if (!import_react50.default.isValidElement(child)) return null;
|
|
4600
4788
|
const childProps = child.props;
|
|
4601
4789
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4602
|
-
return /* @__PURE__ */ (0,
|
|
4790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4603
4791
|
"div",
|
|
4604
4792
|
{
|
|
4605
4793
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4606
4794
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4607
|
-
children: (0,
|
|
4795
|
+
children: (0, import_react50.cloneElement)(child, {
|
|
4608
4796
|
className: mergedClassName
|
|
4609
4797
|
})
|
|
4610
4798
|
},
|
|
@@ -4622,14 +4810,14 @@ var Slider = ({
|
|
|
4622
4810
|
return "bottom-4";
|
|
4623
4811
|
}
|
|
4624
4812
|
};
|
|
4625
|
-
return /* @__PURE__ */ (0,
|
|
4813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4626
4814
|
"div",
|
|
4627
4815
|
{
|
|
4628
4816
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4629
4817
|
onMouseEnter: handleMouseEnter,
|
|
4630
4818
|
onMouseLeave: handleMouseLeave,
|
|
4631
4819
|
children: [
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4633
4821
|
"div",
|
|
4634
4822
|
{
|
|
4635
4823
|
className: "flex h-full",
|
|
@@ -4640,18 +4828,18 @@ var Slider = ({
|
|
|
4640
4828
|
children: slides
|
|
4641
4829
|
}
|
|
4642
4830
|
),
|
|
4643
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4831
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4645
4833
|
ArrowButton,
|
|
4646
4834
|
{
|
|
4647
4835
|
direction: "left",
|
|
4648
4836
|
onClick: prevSlide,
|
|
4649
4837
|
visible: infinite_scroll || currentSlide > 0,
|
|
4650
4838
|
className: arrowClassName,
|
|
4651
|
-
children: /* @__PURE__ */ (0,
|
|
4839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.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_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4652
4840
|
}
|
|
4653
4841
|
),
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4655
4843
|
ArrowButton,
|
|
4656
4844
|
{
|
|
4657
4845
|
direction: "right",
|
|
@@ -4659,13 +4847,13 @@ var Slider = ({
|
|
|
4659
4847
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4660
4848
|
className: arrowClassName,
|
|
4661
4849
|
children: [
|
|
4662
|
-
/* @__PURE__ */ (0,
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.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_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4663
4851
|
" "
|
|
4664
4852
|
]
|
|
4665
4853
|
}
|
|
4666
4854
|
)
|
|
4667
4855
|
] }),
|
|
4668
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4856
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime66.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_runtime66.jsx)(
|
|
4669
4857
|
ProgressPill,
|
|
4670
4858
|
{
|
|
4671
4859
|
active: index === currentSlide,
|
|
@@ -4691,7 +4879,7 @@ var ArrowButton = ({
|
|
|
4691
4879
|
visible,
|
|
4692
4880
|
children,
|
|
4693
4881
|
className = ""
|
|
4694
|
-
}) => /* @__PURE__ */ (0,
|
|
4882
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4695
4883
|
"button",
|
|
4696
4884
|
{
|
|
4697
4885
|
className: `
|
|
@@ -4717,13 +4905,13 @@ var ProgressPill = ({
|
|
|
4717
4905
|
currentSlide,
|
|
4718
4906
|
totalSlides
|
|
4719
4907
|
}) => {
|
|
4720
|
-
const [progress, setProgress] = (0,
|
|
4721
|
-
(0,
|
|
4908
|
+
const [progress, setProgress] = (0, import_react50.useState)(0);
|
|
4909
|
+
(0, import_react50.useEffect)(() => {
|
|
4722
4910
|
if (active) {
|
|
4723
4911
|
setProgress(0);
|
|
4724
4912
|
}
|
|
4725
4913
|
}, [active, index]);
|
|
4726
|
-
(0,
|
|
4914
|
+
(0, import_react50.useEffect)(() => {
|
|
4727
4915
|
if (!active || !isPlaying) {
|
|
4728
4916
|
if (!active) {
|
|
4729
4917
|
setProgress(0);
|
|
@@ -4778,7 +4966,7 @@ var ProgressPill = ({
|
|
|
4778
4966
|
const renderProgressBar = () => {
|
|
4779
4967
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4780
4968
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4781
|
-
return /* @__PURE__ */ (0,
|
|
4969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4782
4970
|
"div",
|
|
4783
4971
|
{
|
|
4784
4972
|
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`,
|
|
@@ -4790,7 +4978,7 @@ var ProgressPill = ({
|
|
|
4790
4978
|
};
|
|
4791
4979
|
const renderCumulativeFill = () => {
|
|
4792
4980
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4793
|
-
return /* @__PURE__ */ (0,
|
|
4981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4794
4982
|
"div",
|
|
4795
4983
|
{
|
|
4796
4984
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4800,7 +4988,7 @@ var ProgressPill = ({
|
|
|
4800
4988
|
}
|
|
4801
4989
|
return null;
|
|
4802
4990
|
};
|
|
4803
|
-
return /* @__PURE__ */ (0,
|
|
4991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4804
4992
|
"button",
|
|
4805
4993
|
{
|
|
4806
4994
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -4976,10 +5164,10 @@ var PathUtility = class {
|
|
|
4976
5164
|
var PathUtility_default = new PathUtility();
|
|
4977
5165
|
|
|
4978
5166
|
// src/components/NoDataFound.tsx
|
|
4979
|
-
var
|
|
5167
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4980
5168
|
var NoDataFound = () => {
|
|
4981
|
-
return /* @__PURE__ */ (0,
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
5169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4983
5171
|
"svg",
|
|
4984
5172
|
{
|
|
4985
5173
|
className: "w-10 h-10",
|
|
@@ -4987,7 +5175,7 @@ var NoDataFound = () => {
|
|
|
4987
5175
|
stroke: "currentColor",
|
|
4988
5176
|
viewBox: "0 0 24 24",
|
|
4989
5177
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4990
|
-
children: /* @__PURE__ */ (0,
|
|
5178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4991
5179
|
"path",
|
|
4992
5180
|
{
|
|
4993
5181
|
strokeLinecap: "round",
|
|
@@ -4998,19 +5186,19 @@ var NoDataFound = () => {
|
|
|
4998
5186
|
)
|
|
4999
5187
|
}
|
|
5000
5188
|
) }) }),
|
|
5001
|
-
/* @__PURE__ */ (0,
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
5189
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
5003
5191
|
] });
|
|
5004
5192
|
};
|
|
5005
5193
|
var NoDataFound_default = NoDataFound;
|
|
5006
5194
|
|
|
5007
5195
|
// src/components/Pagination.tsx
|
|
5008
|
-
var
|
|
5196
|
+
var import_react51 = require("react");
|
|
5009
5197
|
init_StyleTypes();
|
|
5010
|
-
var
|
|
5198
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5011
5199
|
var Pagination = (props) => {
|
|
5012
5200
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5013
|
-
const builder = (0,
|
|
5201
|
+
const builder = (0, import_react51.useMemo)(() => {
|
|
5014
5202
|
const b = new OdataBuilder(path);
|
|
5015
5203
|
if (query) b.setQuery(query);
|
|
5016
5204
|
return b;
|
|
@@ -5051,7 +5239,7 @@ var Pagination = (props) => {
|
|
|
5051
5239
|
return range;
|
|
5052
5240
|
};
|
|
5053
5241
|
const paginationRange = getPaginationRange();
|
|
5054
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
5242
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5055
5243
|
Hyperlink,
|
|
5056
5244
|
{
|
|
5057
5245
|
linkType: "Link" /* Link */,
|
|
@@ -5066,9 +5254,9 @@ var Pagination = (props) => {
|
|
|
5066
5254
|
);
|
|
5067
5255
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
5068
5256
|
if (disabled) {
|
|
5069
|
-
return /* @__PURE__ */ (0,
|
|
5257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.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 });
|
|
5070
5258
|
}
|
|
5071
|
-
return /* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5072
5260
|
Hyperlink,
|
|
5073
5261
|
{
|
|
5074
5262
|
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",
|
|
@@ -5078,35 +5266,35 @@ var Pagination = (props) => {
|
|
|
5078
5266
|
);
|
|
5079
5267
|
};
|
|
5080
5268
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
5081
|
-
return /* @__PURE__ */ (0,
|
|
5082
|
-
/* @__PURE__ */ (0,
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
5270
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "text-sm", children: [
|
|
5084
5272
|
"Showing ",
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "font-semibold", children: [
|
|
5086
5274
|
startItem,
|
|
5087
5275
|
"-",
|
|
5088
5276
|
endItem
|
|
5089
5277
|
] }),
|
|
5090
5278
|
" ",
|
|
5091
5279
|
"out of ",
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
5093
5281
|
" results"
|
|
5094
5282
|
] }),
|
|
5095
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
5096
|
-
/* @__PURE__ */ (0,
|
|
5283
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5097
5285
|
NavigationButton,
|
|
5098
5286
|
{
|
|
5099
5287
|
page: activePageNumber - 1,
|
|
5100
5288
|
disabled: activePageNumber === 1,
|
|
5101
5289
|
children: [
|
|
5102
|
-
/* @__PURE__ */ (0,
|
|
5103
|
-
/* @__PURE__ */ (0,
|
|
5290
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
5291
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
5104
5292
|
]
|
|
5105
5293
|
}
|
|
5106
5294
|
),
|
|
5107
5295
|
paginationRange.map((item, index) => {
|
|
5108
5296
|
if (item === "...") {
|
|
5109
|
-
return /* @__PURE__ */ (0,
|
|
5297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5110
5298
|
"span",
|
|
5111
5299
|
{
|
|
5112
5300
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -5116,23 +5304,23 @@ var Pagination = (props) => {
|
|
|
5116
5304
|
);
|
|
5117
5305
|
}
|
|
5118
5306
|
const page = item;
|
|
5119
|
-
return /* @__PURE__ */ (0,
|
|
5307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PageButton, { page, children: page }, page);
|
|
5120
5308
|
}),
|
|
5121
|
-
/* @__PURE__ */ (0,
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5122
5310
|
NavigationButton,
|
|
5123
5311
|
{
|
|
5124
5312
|
page: activePageNumber + 1,
|
|
5125
5313
|
disabled: activePageNumber === totalPages,
|
|
5126
5314
|
children: [
|
|
5127
|
-
/* @__PURE__ */ (0,
|
|
5128
|
-
/* @__PURE__ */ (0,
|
|
5315
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
5316
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
5129
5317
|
]
|
|
5130
5318
|
}
|
|
5131
5319
|
)
|
|
5132
5320
|
] }),
|
|
5133
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
5134
|
-
/* @__PURE__ */ (0,
|
|
5135
|
-
/* @__PURE__ */ (0,
|
|
5321
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
5323
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5136
5324
|
"input",
|
|
5137
5325
|
{
|
|
5138
5326
|
type: "number",
|
|
@@ -5153,9 +5341,9 @@ var Pagination = (props) => {
|
|
|
5153
5341
|
) })
|
|
5154
5342
|
] })
|
|
5155
5343
|
] }),
|
|
5156
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5344
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
5345
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
5346
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5159
5347
|
Hyperlink,
|
|
5160
5348
|
{
|
|
5161
5349
|
className: `
|
|
@@ -5167,7 +5355,7 @@ var Pagination = (props) => {
|
|
|
5167
5355
|
},
|
|
5168
5356
|
size
|
|
5169
5357
|
)) }),
|
|
5170
|
-
/* @__PURE__ */ (0,
|
|
5358
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "per page" })
|
|
5171
5359
|
] }) })
|
|
5172
5360
|
] });
|
|
5173
5361
|
};
|
|
@@ -5175,7 +5363,7 @@ var Pagination_default = Pagination;
|
|
|
5175
5363
|
|
|
5176
5364
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5177
5365
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5178
|
-
var
|
|
5366
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5179
5367
|
var HlsPlayer3 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5180
5368
|
var deviceToMediaQuery = (device) => {
|
|
5181
5369
|
switch (device) {
|
|
@@ -5244,8 +5432,8 @@ var ImageGalleryNode = (props) => {
|
|
|
5244
5432
|
right: "justify-end"
|
|
5245
5433
|
};
|
|
5246
5434
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5247
|
-
return /* @__PURE__ */ (0,
|
|
5248
|
-
hlsSources.length > 0 && /* @__PURE__ */ (0,
|
|
5435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
5436
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5249
5437
|
HlsPlayer3,
|
|
5250
5438
|
{
|
|
5251
5439
|
sources: hlsSources,
|
|
@@ -5259,14 +5447,14 @@ var ImageGalleryNode = (props) => {
|
|
|
5259
5447
|
session: props.session
|
|
5260
5448
|
}
|
|
5261
5449
|
) }),
|
|
5262
|
-
staticFallback && /* @__PURE__ */ (0,
|
|
5450
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("picture", { children: [
|
|
5263
5451
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5264
5452
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5265
5453
|
if (!match) return null;
|
|
5266
5454
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5267
5455
|
if (!srcUrl) return null;
|
|
5268
5456
|
const mediaQuery = deviceToMediaQuery(match.device);
|
|
5269
|
-
return /* @__PURE__ */ (0,
|
|
5457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5270
5458
|
"source",
|
|
5271
5459
|
{
|
|
5272
5460
|
media: mediaQuery,
|
|
@@ -5290,7 +5478,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5290
5478
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5291
5479
|
return (
|
|
5292
5480
|
// eslint-disable-next-line @next/next/no-img-element
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5294
5482
|
"img",
|
|
5295
5483
|
{
|
|
5296
5484
|
loading: "lazy",
|
|
@@ -5311,7 +5499,7 @@ var ImageGalleryNode_default = ImageGalleryNode;
|
|
|
5311
5499
|
|
|
5312
5500
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5313
5501
|
var import_link2 = __toESM(require("next/link"));
|
|
5314
|
-
var
|
|
5502
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5315
5503
|
function toCamelCase(str) {
|
|
5316
5504
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
5317
5505
|
}
|
|
@@ -5516,7 +5704,7 @@ var DivContainer = async (props) => {
|
|
|
5516
5704
|
response = await serviceClient.get(endpoint);
|
|
5517
5705
|
result = response?.result;
|
|
5518
5706
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5519
|
-
return /* @__PURE__ */ (0,
|
|
5707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NoDataFound_default, {});
|
|
5520
5708
|
}
|
|
5521
5709
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5522
5710
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5533,7 +5721,7 @@ var DivContainer = async (props) => {
|
|
|
5533
5721
|
}
|
|
5534
5722
|
const SelectedNode = NodeTypes2[node.type];
|
|
5535
5723
|
if (!SelectedNode) return null;
|
|
5536
|
-
return /* @__PURE__ */ (0,
|
|
5724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5537
5725
|
SelectedNode,
|
|
5538
5726
|
{
|
|
5539
5727
|
node,
|
|
@@ -5635,9 +5823,9 @@ var DivContainer = async (props) => {
|
|
|
5635
5823
|
props.node.autoFormat && "auto-format",
|
|
5636
5824
|
props.node.bgClass
|
|
5637
5825
|
].filter(Boolean).join(" ");
|
|
5638
|
-
return /* @__PURE__ */ (0,
|
|
5639
|
-
/* @__PURE__ */ (0,
|
|
5640
|
-
/* @__PURE__ */ (0,
|
|
5826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react52.default.Fragment, { children: [
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5641
5829
|
Wrapper,
|
|
5642
5830
|
{
|
|
5643
5831
|
id: guid,
|
|
@@ -5646,18 +5834,18 @@ var DivContainer = async (props) => {
|
|
|
5646
5834
|
...wrapperProps,
|
|
5647
5835
|
children: dataToRender.map(
|
|
5648
5836
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5649
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
5837
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: child }, i)
|
|
5650
5838
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5651
5839
|
)
|
|
5652
5840
|
}
|
|
5653
5841
|
) }),
|
|
5654
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
5842
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
5655
5843
|
] });
|
|
5656
5844
|
};
|
|
5657
5845
|
var DivContainer_default = DivContainer;
|
|
5658
5846
|
|
|
5659
5847
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5660
|
-
var
|
|
5848
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5661
5849
|
var NodeTypes = {
|
|
5662
5850
|
["paragraph"]: ParagraphNode_default,
|
|
5663
5851
|
["heading"]: HeadingNode_default,
|
|
@@ -5685,11 +5873,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5685
5873
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5686
5874
|
rootNode = pageBodyTree.root;
|
|
5687
5875
|
}
|
|
5688
|
-
return /* @__PURE__ */ (0,
|
|
5876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5689
5877
|
{
|
|
5690
5878
|
}
|
|
5691
5879
|
const SelectedNode = NodeTypes[node.type];
|
|
5692
|
-
return /* @__PURE__ */ (0,
|
|
5880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5693
5881
|
SelectedNode,
|
|
5694
5882
|
{
|
|
5695
5883
|
node,
|
|
@@ -5705,7 +5893,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5705
5893
|
device: props.device,
|
|
5706
5894
|
widgetRenderer: props.widgetRenderer
|
|
5707
5895
|
}
|
|
5708
|
-
) }) : /* @__PURE__ */ (0,
|
|
5896
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5709
5897
|
SelectedNode,
|
|
5710
5898
|
{
|
|
5711
5899
|
node,
|
|
@@ -5726,13 +5914,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5726
5914
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5727
5915
|
|
|
5728
5916
|
// src/components/Toast.tsx
|
|
5729
|
-
var
|
|
5917
|
+
var import_react54 = require("react");
|
|
5730
5918
|
init_ToastService();
|
|
5731
|
-
var
|
|
5919
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5732
5920
|
var Toast = () => {
|
|
5733
|
-
const [showToast, setShowToast] = (0,
|
|
5734
|
-
const [message, setMessage] = (0,
|
|
5735
|
-
const [messageType, setMessageType] = (0,
|
|
5921
|
+
const [showToast, setShowToast] = (0, import_react54.useState)(false);
|
|
5922
|
+
const [message, setMessage] = (0, import_react54.useState)("");
|
|
5923
|
+
const [messageType, setMessageType] = (0, import_react54.useState)("error");
|
|
5736
5924
|
ToastService_default.showError = function(message2) {
|
|
5737
5925
|
setShowToast(true);
|
|
5738
5926
|
setMessage(message2);
|
|
@@ -5771,8 +5959,8 @@ var Toast = () => {
|
|
|
5771
5959
|
const closeToast = () => {
|
|
5772
5960
|
setShowToast(false);
|
|
5773
5961
|
};
|
|
5774
|
-
return /* @__PURE__ */ (0,
|
|
5775
|
-
/* @__PURE__ */ (0,
|
|
5962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
5963
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5776
5964
|
"span",
|
|
5777
5965
|
{
|
|
5778
5966
|
className: "font-medium text-inherit text-sm",
|
|
@@ -5780,7 +5968,7 @@ var Toast = () => {
|
|
|
5780
5968
|
children: message
|
|
5781
5969
|
}
|
|
5782
5970
|
),
|
|
5783
|
-
/* @__PURE__ */ (0,
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5784
5972
|
"svg",
|
|
5785
5973
|
{
|
|
5786
5974
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5788,7 +5976,7 @@ var Toast = () => {
|
|
|
5788
5976
|
fill: "none",
|
|
5789
5977
|
viewBox: "0 0 24 24",
|
|
5790
5978
|
stroke: "currentColor",
|
|
5791
|
-
children: /* @__PURE__ */ (0,
|
|
5979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
5792
5980
|
}
|
|
5793
5981
|
) })
|
|
5794
5982
|
] }) }) });
|
|
@@ -5803,6 +5991,7 @@ init_ToastService();
|
|
|
5803
5991
|
CheckboxInput,
|
|
5804
5992
|
ColorInput,
|
|
5805
5993
|
DataList,
|
|
5994
|
+
DataListRenderer,
|
|
5806
5995
|
DateTimeInput,
|
|
5807
5996
|
EmailInput,
|
|
5808
5997
|
InputControl,
|