@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260521115630 → 0.8.1-dev.20260522043844
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-4VB65GYW.mjs → HlsPlayer-GZR4QXJY.mjs} +1 -1
- package/dist/{chunk-JGRYFWF6.mjs → chunk-72PHGKW4.mjs} +34 -11
- package/dist/index.js +1112 -1061
- package/dist/index.mjs +579 -551
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -153,280 +153,19 @@ var init_DateViewClient = __esm({
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
// src/components/controls/view/DateTimeViewClient.tsx
|
|
157
|
-
var DateTimeViewClient_exports = {};
|
|
158
|
-
__export(DateTimeViewClient_exports, {
|
|
159
|
-
default: () => DateTimeViewClient_default
|
|
160
|
-
});
|
|
161
|
-
var import_jsx_runtime11, DateTimeViewClient, DateTimeViewClient_default;
|
|
162
|
-
var init_DateTimeViewClient = __esm({
|
|
163
|
-
"src/components/controls/view/DateTimeViewClient.tsx"() {
|
|
164
|
-
"use strict";
|
|
165
|
-
"use client";
|
|
166
|
-
init_DateViewClient();
|
|
167
|
-
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
168
|
-
DateTimeViewClient = (props) => {
|
|
169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DateViewClient_default, { ...props, controlType: "datetime" });
|
|
170
|
-
};
|
|
171
|
-
DateTimeViewClient_default = DateTimeViewClient;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// src/components/ToastService.tsx
|
|
176
|
-
var ToastService, ToastService_default;
|
|
177
|
-
var init_ToastService = __esm({
|
|
178
|
-
"src/components/ToastService.tsx"() {
|
|
179
|
-
"use strict";
|
|
180
|
-
ToastService = class _ToastService {
|
|
181
|
-
static initialize(showToast, closeToast) {
|
|
182
|
-
_ToastService.showToast = showToast;
|
|
183
|
-
_ToastService.closeToast = closeToast;
|
|
184
|
-
}
|
|
185
|
-
static showError(message) {
|
|
186
|
-
if (_ToastService.showToast) {
|
|
187
|
-
_ToastService.showToast(message, "error");
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
static showInfo(message) {
|
|
191
|
-
if (_ToastService.showToast) {
|
|
192
|
-
_ToastService.showToast(message, "info");
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
static showWarning(message) {
|
|
196
|
-
if (_ToastService.showToast) {
|
|
197
|
-
_ToastService.showToast(message, "warning");
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
static showSuccess(message) {
|
|
201
|
-
if (_ToastService.showToast) {
|
|
202
|
-
_ToastService.showToast(message, "success");
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
static close() {
|
|
206
|
-
if (_ToastService.closeToast) {
|
|
207
|
-
_ToastService.closeToast();
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
ToastService_default = ToastService;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// src/components/StyleTypes.tsx
|
|
216
|
-
var buttonClasses, progressClasses;
|
|
217
|
-
var init_StyleTypes = __esm({
|
|
218
|
-
"src/components/StyleTypes.tsx"() {
|
|
219
|
-
"use strict";
|
|
220
|
-
buttonClasses = /* @__PURE__ */ new Map([
|
|
221
|
-
[
|
|
222
|
-
"Primary" /* Solid */,
|
|
223
|
-
"btn-solid relative inline-flex items-center justify-center rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out"
|
|
224
|
-
],
|
|
225
|
-
[
|
|
226
|
-
"PrimaryHollow" /* Hollow */,
|
|
227
|
-
"btn-hollow inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"
|
|
228
|
-
],
|
|
229
|
-
["Link" /* Link */, "btn-link"]
|
|
230
|
-
]);
|
|
231
|
-
progressClasses = /* @__PURE__ */ new Map([
|
|
232
|
-
["Primary" /* Solid */, ""],
|
|
233
|
-
["PrimaryHollow" /* Hollow */, ""],
|
|
234
|
-
["Link" /* Link */, ""]
|
|
235
|
-
]);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
// src/components/ClientButton.tsx
|
|
240
|
-
var import_react23, import_jsx_runtime25, ClientButton, ClientButton_default;
|
|
241
|
-
var init_ClientButton = __esm({
|
|
242
|
-
"src/components/ClientButton.tsx"() {
|
|
243
|
-
"use strict";
|
|
244
|
-
"use client";
|
|
245
|
-
import_react23 = __toESM(require("react"));
|
|
246
|
-
init_ToastService();
|
|
247
|
-
init_StyleTypes();
|
|
248
|
-
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
249
|
-
ClientButton = (props) => {
|
|
250
|
-
const execute = async (event) => {
|
|
251
|
-
if (props.onClick !== void 0) {
|
|
252
|
-
props.onClick();
|
|
253
|
-
} else {
|
|
254
|
-
ToastService_default.showError("No action defined.");
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
258
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react23.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
259
|
-
"button",
|
|
260
|
-
{
|
|
261
|
-
type: "button",
|
|
262
|
-
onClick: execute,
|
|
263
|
-
className: buttonClass + " " + props.className,
|
|
264
|
-
children: props.children
|
|
265
|
-
}
|
|
266
|
-
) });
|
|
267
|
-
};
|
|
268
|
-
ClientButton_default = ClientButton;
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
// src/components/Confirm.tsx
|
|
273
|
-
var import_react24, import_jsx_runtime26, Confirm, Confirm_default;
|
|
274
|
-
var init_Confirm = __esm({
|
|
275
|
-
"src/components/Confirm.tsx"() {
|
|
276
|
-
"use strict";
|
|
277
|
-
"use client";
|
|
278
|
-
import_react24 = require("react");
|
|
279
|
-
init_ClientButton();
|
|
280
|
-
init_StyleTypes();
|
|
281
|
-
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
282
|
-
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
283
|
-
const [showModal, setShowModal] = (0, import_react24.useState)(true);
|
|
284
|
-
const handleConfirmAction = () => {
|
|
285
|
-
setShowModal(false);
|
|
286
|
-
if (onConfirm) {
|
|
287
|
-
onConfirm();
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
const handleCancelAction = () => {
|
|
291
|
-
setShowModal(false);
|
|
292
|
-
if (onCancel) {
|
|
293
|
-
onCancel();
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
297
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
298
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
299
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
300
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mb-4", children: message }),
|
|
301
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
302
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
303
|
-
ClientButton_default,
|
|
304
|
-
{
|
|
305
|
-
onClick: handleCancelAction,
|
|
306
|
-
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
307
|
-
children: "Cancel"
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
311
|
-
ClientButton_default,
|
|
312
|
-
{
|
|
313
|
-
onClick: handleConfirmAction,
|
|
314
|
-
children: "Confirm"
|
|
315
|
-
}
|
|
316
|
-
)
|
|
317
|
-
] })
|
|
318
|
-
] })
|
|
319
|
-
] }) });
|
|
320
|
-
};
|
|
321
|
-
Confirm_default = Confirm;
|
|
322
|
-
{
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
// src/components/Button.tsx
|
|
328
|
-
var import_react25, import_jsx_runtime27, Button, Button_default;
|
|
329
|
-
var init_Button = __esm({
|
|
330
|
-
"src/components/Button.tsx"() {
|
|
331
|
-
"use strict";
|
|
332
|
-
"use client";
|
|
333
|
-
import_react25 = __toESM(require("react"));
|
|
334
|
-
init_ToastService();
|
|
335
|
-
init_StyleTypes();
|
|
336
|
-
init_Confirm();
|
|
337
|
-
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
338
|
-
Button = (props) => {
|
|
339
|
-
const [inProgress, setInProgress] = (0, import_react25.useState)(false);
|
|
340
|
-
const [isActionPerformed, setIsActionPerformed] = (0, import_react25.useState)(false);
|
|
341
|
-
const [responseMessage, setResponseMessage] = (0, import_react25.useState)(null);
|
|
342
|
-
const [showModal, setShowModal] = (0, import_react25.useState)(null);
|
|
343
|
-
const execute = async (event) => {
|
|
344
|
-
event.preventDefault();
|
|
345
|
-
event.stopPropagation();
|
|
346
|
-
if (props.confirm) {
|
|
347
|
-
const confirmed = await showConfirmation("Are you sure you want to delete this item?");
|
|
348
|
-
setShowModal(null);
|
|
349
|
-
if (!confirmed) {
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
if (props.oneTimeAction && isActionPerformed) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
setInProgress(true);
|
|
357
|
-
let isValid = true;
|
|
358
|
-
if (props.onValidate !== void 0) {
|
|
359
|
-
isValid = await props.onValidate();
|
|
360
|
-
if (!isValid) {
|
|
361
|
-
setInProgress(false);
|
|
362
|
-
ToastService_default.showError("There are errors in the form. Please fix them before proceeding.");
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (props.onClick !== void 0) {
|
|
367
|
-
let response = await props.onClick();
|
|
368
|
-
if (response.isSuccessful) {
|
|
369
|
-
setIsActionPerformed(true);
|
|
370
|
-
setResponseMessage(response.message);
|
|
371
|
-
if (props.showToast) {
|
|
372
|
-
ToastService_default.showInfo(response.message || "");
|
|
373
|
-
}
|
|
374
|
-
} else {
|
|
375
|
-
ToastService_default.showError(response.message || "");
|
|
376
|
-
}
|
|
377
|
-
} else {
|
|
378
|
-
ToastService_default.showError("No action defined.");
|
|
379
|
-
}
|
|
380
|
-
setInProgress(false);
|
|
381
|
-
};
|
|
382
|
-
const showConfirmation = (message) => {
|
|
383
|
-
return new Promise((resolve) => {
|
|
384
|
-
const onConfirm = () => resolve(true);
|
|
385
|
-
const onCancel = () => resolve(false);
|
|
386
|
-
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
387
|
-
});
|
|
388
|
-
};
|
|
389
|
-
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
390
|
-
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
391
|
-
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react25.default.Fragment, { children: [
|
|
393
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
394
|
-
"button",
|
|
395
|
-
{
|
|
396
|
-
type: "submit",
|
|
397
|
-
onClick: execute,
|
|
398
|
-
disabled: props.disabled,
|
|
399
|
-
title: isDisabled ? "The button is disabled to prevent any action" : "",
|
|
400
|
-
className: buttonClass + " relative " + props.className,
|
|
401
|
-
children: [
|
|
402
|
-
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
403
|
-
inProgress && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react25.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime27.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: [
|
|
404
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
405
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.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" })
|
|
406
|
-
] }) })
|
|
407
|
-
]
|
|
408
|
-
}
|
|
409
|
-
),
|
|
410
|
-
showModal
|
|
411
|
-
] });
|
|
412
|
-
};
|
|
413
|
-
Button_default = Button;
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
|
|
417
156
|
// src/components/HlsPlayer.tsx
|
|
418
157
|
var HlsPlayer_exports = {};
|
|
419
158
|
__export(HlsPlayer_exports, {
|
|
420
159
|
default: () => HlsPlayer_default
|
|
421
160
|
});
|
|
422
|
-
var
|
|
161
|
+
var import_react4, import_hls, import_jsx_runtime4, pickSource, requestFullscreen, exitFullscreen, getFullscreenElement, HlsPlayer, HlsPlayer_default;
|
|
423
162
|
var init_HlsPlayer = __esm({
|
|
424
163
|
"src/components/HlsPlayer.tsx"() {
|
|
425
164
|
"use strict";
|
|
426
165
|
"use client";
|
|
427
|
-
|
|
166
|
+
import_react4 = __toESM(require("react"));
|
|
428
167
|
import_hls = __toESM(require("hls.js"));
|
|
429
|
-
|
|
168
|
+
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
430
169
|
pickSource = (sources) => {
|
|
431
170
|
for (const { src, media } of sources) {
|
|
432
171
|
if (media && window.matchMedia(media).matches) return src;
|
|
@@ -451,7 +190,7 @@ var init_HlsPlayer = __esm({
|
|
|
451
190
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
452
191
|
document.fullscreenElement ?? document.webkitFullscreenElement ?? null
|
|
453
192
|
);
|
|
454
|
-
HlsPlayer =
|
|
193
|
+
HlsPlayer = import_react4.default.memo(
|
|
455
194
|
({
|
|
456
195
|
sources,
|
|
457
196
|
assetUrl,
|
|
@@ -463,25 +202,26 @@ var init_HlsPlayer = __esm({
|
|
|
463
202
|
playOptions = "autoplay",
|
|
464
203
|
placementCode = ""
|
|
465
204
|
}) => {
|
|
466
|
-
const containerRef = (0,
|
|
467
|
-
const videoRef = (0,
|
|
468
|
-
const hlsRef = (0,
|
|
205
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
206
|
+
const videoRef = (0, import_react4.useRef)(null);
|
|
207
|
+
const hlsRef = (0, import_react4.useRef)(null);
|
|
469
208
|
const isPlayOnHover = playOptions === "playOnHover";
|
|
470
209
|
const startsMuted = playOptions === "autoplay" || isPlayOnHover;
|
|
471
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
472
|
-
const [isHovered, setIsHovered] = (0,
|
|
473
|
-
const [isMobile, setIsMobile] = (0,
|
|
474
|
-
const [isControlsVisible, setIsControlsVisible] = (0,
|
|
475
|
-
const [isPosterVisible, setIsPosterVisible] = (0,
|
|
476
|
-
const [isMuted, setIsMuted] = (0,
|
|
477
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
478
|
-
const wasManuallyPausedRef = (0,
|
|
479
|
-
const inactivityTimerRef = (0,
|
|
480
|
-
const clickTimerRef = (0,
|
|
210
|
+
const [isPlaying, setIsPlaying] = (0, import_react4.useState)(playOptions === "autoplay");
|
|
211
|
+
const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
|
|
212
|
+
const [isMobile, setIsMobile] = (0, import_react4.useState)(false);
|
|
213
|
+
const [isControlsVisible, setIsControlsVisible] = (0, import_react4.useState)(true);
|
|
214
|
+
const [isPosterVisible, setIsPosterVisible] = (0, import_react4.useState)(true);
|
|
215
|
+
const [isMuted, setIsMuted] = (0, import_react4.useState)(startsMuted);
|
|
216
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react4.useState)(false);
|
|
217
|
+
const wasManuallyPausedRef = (0, import_react4.useRef)(false);
|
|
218
|
+
const inactivityTimerRef = (0, import_react4.useRef)(null);
|
|
219
|
+
const clickTimerRef = (0, import_react4.useRef)(null);
|
|
220
|
+
const hlsInitializedRef = (0, import_react4.useRef)(false);
|
|
481
221
|
const INACTIVITY_DELAY = 2500;
|
|
482
222
|
const CLICK_DEBOUNCE = 220;
|
|
483
223
|
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
484
|
-
(0,
|
|
224
|
+
(0, import_react4.useEffect)(() => {
|
|
485
225
|
const checkMobile = () => {
|
|
486
226
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
487
227
|
const isSmallScreen = window.innerWidth <= 768;
|
|
@@ -494,7 +234,7 @@ var init_HlsPlayer = __esm({
|
|
|
494
234
|
window.addEventListener("resize", checkMobile);
|
|
495
235
|
return () => window.removeEventListener("resize", checkMobile);
|
|
496
236
|
}, []);
|
|
497
|
-
(0,
|
|
237
|
+
(0, import_react4.useEffect)(() => {
|
|
498
238
|
const onFullscreenChange = () => {
|
|
499
239
|
setIsFullscreen(getFullscreenElement() === containerRef.current);
|
|
500
240
|
};
|
|
@@ -505,7 +245,7 @@ var init_HlsPlayer = __esm({
|
|
|
505
245
|
document.removeEventListener("webkitfullscreenchange", onFullscreenChange);
|
|
506
246
|
};
|
|
507
247
|
}, []);
|
|
508
|
-
(0,
|
|
248
|
+
(0, import_react4.useEffect)(() => {
|
|
509
249
|
if (isPlaying) {
|
|
510
250
|
setIsPosterVisible(false);
|
|
511
251
|
} else {
|
|
@@ -513,7 +253,7 @@ var init_HlsPlayer = __esm({
|
|
|
513
253
|
if (!v || v.currentTime === 0) setIsPosterVisible(true);
|
|
514
254
|
}
|
|
515
255
|
}, [isPlaying]);
|
|
516
|
-
const resetInactivityTimer = (0,
|
|
256
|
+
const resetInactivityTimer = (0, import_react4.useCallback)(() => {
|
|
517
257
|
setIsControlsVisible(true);
|
|
518
258
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
519
259
|
if (isPlaying) {
|
|
@@ -523,19 +263,19 @@ var init_HlsPlayer = __esm({
|
|
|
523
263
|
);
|
|
524
264
|
}
|
|
525
265
|
}, [isPlaying]);
|
|
526
|
-
(0,
|
|
266
|
+
(0, import_react4.useEffect)(() => {
|
|
527
267
|
if (!isPlaying) {
|
|
528
268
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
529
269
|
setIsControlsVisible(true);
|
|
530
270
|
}
|
|
531
271
|
}, [isPlaying]);
|
|
532
|
-
(0,
|
|
272
|
+
(0, import_react4.useEffect)(() => {
|
|
533
273
|
return () => {
|
|
534
274
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
535
275
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
536
276
|
};
|
|
537
277
|
}, []);
|
|
538
|
-
(0,
|
|
278
|
+
const initHls = (0, import_react4.useCallback)((autoPlayAfterLoad) => {
|
|
539
279
|
const v = videoRef.current;
|
|
540
280
|
if (!v || resolvedSources.length === 0) return;
|
|
541
281
|
if (hlsRef.current) {
|
|
@@ -544,26 +284,40 @@ var init_HlsPlayer = __esm({
|
|
|
544
284
|
}
|
|
545
285
|
const chosenSrc = pickSource(resolvedSources);
|
|
546
286
|
if (!chosenSrc) return;
|
|
287
|
+
hlsInitializedRef.current = true;
|
|
547
288
|
if (import_hls.default.isSupported()) {
|
|
548
289
|
const hls = new import_hls.default();
|
|
549
290
|
hls.loadSource(chosenSrc);
|
|
550
291
|
hls.attachMedia(v);
|
|
551
292
|
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
552
|
-
if (
|
|
553
|
-
v.play().catch(console.error);
|
|
293
|
+
if (autoPlayAfterLoad && !wasManuallyPausedRef.current) {
|
|
294
|
+
v.play().catch(console.error).then(() => setIsPlaying(true));
|
|
554
295
|
}
|
|
555
296
|
});
|
|
556
297
|
hlsRef.current = hls;
|
|
557
|
-
return () => {
|
|
558
|
-
hls.destroy();
|
|
559
|
-
hlsRef.current = null;
|
|
560
|
-
};
|
|
561
298
|
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
562
299
|
v.src = chosenSrc;
|
|
563
300
|
v.load();
|
|
301
|
+
if (autoPlayAfterLoad) {
|
|
302
|
+
v.play().catch(console.error).then(() => setIsPlaying(true));
|
|
303
|
+
}
|
|
564
304
|
}
|
|
565
305
|
}, [JSON.stringify(resolvedSources)]);
|
|
566
|
-
|
|
306
|
+
(0, import_react4.useEffect)(() => {
|
|
307
|
+
if (isPlayOnHover) return;
|
|
308
|
+
initHls(
|
|
309
|
+
/* autoPlayAfterLoad */
|
|
310
|
+
playOptions === "autoplay"
|
|
311
|
+
);
|
|
312
|
+
return () => {
|
|
313
|
+
if (hlsRef.current) {
|
|
314
|
+
hlsRef.current.destroy();
|
|
315
|
+
hlsRef.current = null;
|
|
316
|
+
}
|
|
317
|
+
hlsInitializedRef.current = false;
|
|
318
|
+
};
|
|
319
|
+
}, [JSON.stringify(resolvedSources), isPlayOnHover]);
|
|
320
|
+
const handlePlayPause = (0, import_react4.useCallback)(() => {
|
|
567
321
|
const v = videoRef.current;
|
|
568
322
|
if (!v) return;
|
|
569
323
|
if (v.paused) {
|
|
@@ -575,13 +329,13 @@ var init_HlsPlayer = __esm({
|
|
|
575
329
|
setIsPlaying(false);
|
|
576
330
|
}
|
|
577
331
|
}, []);
|
|
578
|
-
const handleMuteToggle = (0,
|
|
332
|
+
const handleMuteToggle = (0, import_react4.useCallback)(() => {
|
|
579
333
|
const v = videoRef.current;
|
|
580
334
|
if (!v) return;
|
|
581
335
|
v.muted = !v.muted;
|
|
582
336
|
setIsMuted(v.muted);
|
|
583
337
|
}, []);
|
|
584
|
-
const handleFullscreenToggle = (0,
|
|
338
|
+
const handleFullscreenToggle = (0, import_react4.useCallback)(() => {
|
|
585
339
|
const container = containerRef.current;
|
|
586
340
|
if (!container) return;
|
|
587
341
|
if (getFullscreenElement() === container) {
|
|
@@ -590,28 +344,35 @@ var init_HlsPlayer = __esm({
|
|
|
590
344
|
requestFullscreen(container).catch(console.error);
|
|
591
345
|
}
|
|
592
346
|
}, []);
|
|
593
|
-
const handleVideoClick = (0,
|
|
347
|
+
const handleVideoClick = (0, import_react4.useCallback)(() => {
|
|
594
348
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
595
349
|
clickTimerRef.current = setTimeout(() => {
|
|
596
350
|
handlePlayPause();
|
|
597
351
|
}, CLICK_DEBOUNCE);
|
|
598
352
|
}, [handlePlayPause]);
|
|
599
|
-
const handleVideoDoubleClick = (0,
|
|
353
|
+
const handleVideoDoubleClick = (0, import_react4.useCallback)(() => {
|
|
600
354
|
if (clickTimerRef.current) {
|
|
601
355
|
clearTimeout(clickTimerRef.current);
|
|
602
356
|
clickTimerRef.current = null;
|
|
603
357
|
}
|
|
604
358
|
handleFullscreenToggle();
|
|
605
359
|
}, [handleFullscreenToggle]);
|
|
606
|
-
const handleMouseEnter = (0,
|
|
360
|
+
const handleMouseEnter = (0, import_react4.useCallback)(() => {
|
|
607
361
|
if (isMobile) return;
|
|
608
362
|
setIsHovered(true);
|
|
609
363
|
resetInactivityTimer();
|
|
610
|
-
if (isPlayOnHover &&
|
|
611
|
-
|
|
364
|
+
if (isPlayOnHover && !wasManuallyPausedRef.current) {
|
|
365
|
+
if (!hlsInitializedRef.current) {
|
|
366
|
+
initHls(
|
|
367
|
+
/* autoPlayAfterLoad */
|
|
368
|
+
true
|
|
369
|
+
);
|
|
370
|
+
} else if (videoRef.current) {
|
|
371
|
+
videoRef.current.play().then(() => setIsPlaying(true)).catch(console.error);
|
|
372
|
+
}
|
|
612
373
|
}
|
|
613
|
-
}, [isPlayOnHover, isMobile, resetInactivityTimer]);
|
|
614
|
-
const handleMouseLeave = (0,
|
|
374
|
+
}, [isPlayOnHover, isMobile, resetInactivityTimer, initHls]);
|
|
375
|
+
const handleMouseLeave = (0, import_react4.useCallback)(() => {
|
|
615
376
|
if (isMobile) return;
|
|
616
377
|
setIsHovered(false);
|
|
617
378
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -622,7 +383,7 @@ var init_HlsPlayer = __esm({
|
|
|
622
383
|
setIsPlaying(false);
|
|
623
384
|
}
|
|
624
385
|
}, [isPlayOnHover, isMobile, isPlaying]);
|
|
625
|
-
const handleMouseMove = (0,
|
|
386
|
+
const handleMouseMove = (0, import_react4.useCallback)(() => {
|
|
626
387
|
if (isMobile) return;
|
|
627
388
|
resetInactivityTimer();
|
|
628
389
|
}, [isMobile, resetInactivityTimer]);
|
|
@@ -652,7 +413,7 @@ var init_HlsPlayer = __esm({
|
|
|
652
413
|
if (resolvedSources.length === 0) return null;
|
|
653
414
|
const showMuteButton = !showControls && !isPlayOnHover;
|
|
654
415
|
const showExpandButton = !showControls && !isPlayOnHover;
|
|
655
|
-
return /* @__PURE__ */ (0,
|
|
416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
656
417
|
"div",
|
|
657
418
|
{
|
|
658
419
|
ref: containerRef,
|
|
@@ -661,7 +422,7 @@ var init_HlsPlayer = __esm({
|
|
|
661
422
|
onMouseLeave: handleMouseLeave,
|
|
662
423
|
onMouseMove: handleMouseMove,
|
|
663
424
|
children: [
|
|
664
|
-
/* @__PURE__ */ (0,
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
665
426
|
"video",
|
|
666
427
|
{
|
|
667
428
|
ref: videoRef,
|
|
@@ -672,9 +433,10 @@ var init_HlsPlayer = __esm({
|
|
|
672
433
|
autoPlay: playOptions === "autoplay",
|
|
673
434
|
loop,
|
|
674
435
|
playsInline: true,
|
|
436
|
+
preload: isPlayOnHover ? "none" : "auto",
|
|
675
437
|
onClick: handleVideoClick,
|
|
676
438
|
onDoubleClick: handleVideoDoubleClick,
|
|
677
|
-
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0,
|
|
439
|
+
children: !isPlayOnHover && resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
678
440
|
"source",
|
|
679
441
|
{
|
|
680
442
|
src,
|
|
@@ -685,7 +447,7 @@ var init_HlsPlayer = __esm({
|
|
|
685
447
|
))
|
|
686
448
|
}
|
|
687
449
|
),
|
|
688
|
-
fallbackPoster && /* @__PURE__ */ (0,
|
|
450
|
+
fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
689
451
|
"picture",
|
|
690
452
|
{
|
|
691
453
|
className: "absolute inset-0 pointer-events-none",
|
|
@@ -694,8 +456,8 @@ var init_HlsPlayer = __esm({
|
|
|
694
456
|
transition: "opacity 0.4s ease"
|
|
695
457
|
},
|
|
696
458
|
children: [
|
|
697
|
-
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0,
|
|
698
|
-
/* @__PURE__ */ (0,
|
|
459
|
+
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("source", { media, srcSet: src }, i)),
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
699
461
|
"img",
|
|
700
462
|
{
|
|
701
463
|
src: fallbackPoster,
|
|
@@ -709,7 +471,7 @@ var init_HlsPlayer = __esm({
|
|
|
709
471
|
]
|
|
710
472
|
}
|
|
711
473
|
),
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("style", { children: `
|
|
713
475
|
.hls-play-btn {
|
|
714
476
|
will-change: transform;
|
|
715
477
|
transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
@@ -718,7 +480,7 @@ var init_HlsPlayer = __esm({
|
|
|
718
480
|
transform: scale(1.08);
|
|
719
481
|
}
|
|
720
482
|
` }),
|
|
721
|
-
!isPlayOnHover && /* @__PURE__ */ (0,
|
|
483
|
+
!isPlayOnHover && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
722
484
|
"div",
|
|
723
485
|
{
|
|
724
486
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
@@ -726,7 +488,7 @@ var init_HlsPlayer = __esm({
|
|
|
726
488
|
opacity: isControlsVisible ? 1 : 0,
|
|
727
489
|
transition: "opacity 0.3s ease"
|
|
728
490
|
},
|
|
729
|
-
children: /* @__PURE__ */ (0,
|
|
491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
730
492
|
"button",
|
|
731
493
|
{
|
|
732
494
|
type: "button",
|
|
@@ -752,7 +514,7 @@ var init_HlsPlayer = __esm({
|
|
|
752
514
|
overflow: "hidden"
|
|
753
515
|
},
|
|
754
516
|
children: [
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
756
518
|
"div",
|
|
757
519
|
{
|
|
758
520
|
style: {
|
|
@@ -764,7 +526,7 @@ var init_HlsPlayer = __esm({
|
|
|
764
526
|
}
|
|
765
527
|
}
|
|
766
528
|
),
|
|
767
|
-
/* @__PURE__ */ (0,
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
768
530
|
"div",
|
|
769
531
|
{
|
|
770
532
|
style: {
|
|
@@ -778,7 +540,7 @@ var init_HlsPlayer = __esm({
|
|
|
778
540
|
),
|
|
779
541
|
isPlaying ? (
|
|
780
542
|
/* Pause — two rounded bars, sized to match play icon proportions */
|
|
781
|
-
/* @__PURE__ */ (0,
|
|
543
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
782
544
|
"svg",
|
|
783
545
|
{
|
|
784
546
|
width: playIconSize,
|
|
@@ -787,8 +549,8 @@ var init_HlsPlayer = __esm({
|
|
|
787
549
|
fill: "none",
|
|
788
550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
789
551
|
children: [
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
791
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "3.5", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" }),
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "12", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" })
|
|
792
554
|
]
|
|
793
555
|
}
|
|
794
556
|
)
|
|
@@ -798,7 +560,7 @@ var init_HlsPlayer = __esm({
|
|
|
798
560
|
* Original viewBox is "0,0,240,250" (with a 5.33x scale group inside).
|
|
799
561
|
* We flatten the transform: effective drawing area is 240×250 units.
|
|
800
562
|
*/
|
|
801
|
-
/* @__PURE__ */ (0,
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
802
564
|
"svg",
|
|
803
565
|
{
|
|
804
566
|
width: playIconSize,
|
|
@@ -807,7 +569,7 @@ var init_HlsPlayer = __esm({
|
|
|
807
569
|
fill: "none",
|
|
808
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
809
571
|
style: { transform: "translateX(4%)" },
|
|
810
|
-
children: /* @__PURE__ */ (0,
|
|
572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
811
573
|
"path",
|
|
812
574
|
{
|
|
813
575
|
d: "M60.78 21.93C48.57 22.41 37.33 32.78 37.33 45.87v164.26c0 17.92 19.96 29.67 35.64 20.99l148.31-82.17c16.12-8.93 16.12-33.04 0-41.97L72.97 24.81c-3.92-2.17-8.11-3.07-12.19-2.88z",
|
|
@@ -822,7 +584,7 @@ var init_HlsPlayer = __esm({
|
|
|
822
584
|
)
|
|
823
585
|
}
|
|
824
586
|
),
|
|
825
|
-
/* @__PURE__ */ (0,
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
826
588
|
"div",
|
|
827
589
|
{
|
|
828
590
|
className: "absolute bottom-4 right-4 pointer-events-none",
|
|
@@ -834,7 +596,7 @@ var init_HlsPlayer = __esm({
|
|
|
834
596
|
transition: "opacity 0.3s ease"
|
|
835
597
|
},
|
|
836
598
|
children: [
|
|
837
|
-
showMuteButton && /* @__PURE__ */ (0,
|
|
599
|
+
showMuteButton && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
838
600
|
"button",
|
|
839
601
|
{
|
|
840
602
|
type: "button",
|
|
@@ -844,18 +606,18 @@ var init_HlsPlayer = __esm({
|
|
|
844
606
|
handleMuteToggle();
|
|
845
607
|
},
|
|
846
608
|
style: iconButtonStyle,
|
|
847
|
-
children: isMuted ? /* @__PURE__ */ (0,
|
|
848
|
-
/* @__PURE__ */ (0,
|
|
849
|
-
/* @__PURE__ */ (0,
|
|
850
|
-
/* @__PURE__ */ (0,
|
|
851
|
-
] }) : /* @__PURE__ */ (0,
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
853
|
-
/* @__PURE__ */ (0,
|
|
854
|
-
/* @__PURE__ */ (0,
|
|
609
|
+
children: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: iconSvgSize, height: iconSvgSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M11 5L6 9H2v6h4l5 4V5Z", fill: "white" }),
|
|
611
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "23", y1: "9", x2: "17", y2: "15", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "17", y1: "9", x2: "23", y2: "15", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
613
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: iconSvgSize, height: iconSvgSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M11 5L6 9H2v6h4l5 4V5Z", fill: "white" }),
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
855
617
|
] })
|
|
856
618
|
}
|
|
857
619
|
),
|
|
858
|
-
showExpandButton && /* @__PURE__ */ (0,
|
|
620
|
+
showExpandButton && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
859
621
|
"button",
|
|
860
622
|
{
|
|
861
623
|
type: "button",
|
|
@@ -865,7 +627,7 @@ var init_HlsPlayer = __esm({
|
|
|
865
627
|
handleFullscreenToggle();
|
|
866
628
|
},
|
|
867
629
|
style: iconButtonStyle,
|
|
868
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
630
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: iconSvgSize, height: iconSvgSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 3v5H3M21 8h-5V3M3 16h5v5M16 21v-5h5", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: iconSvgSize, height: iconSvgSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 8V3h5M16 3h5v5M21 16v5h-5M8 21H3v-5", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
869
631
|
}
|
|
870
632
|
)
|
|
871
633
|
]
|
|
@@ -873,11 +635,272 @@ var init_HlsPlayer = __esm({
|
|
|
873
635
|
)
|
|
874
636
|
]
|
|
875
637
|
}
|
|
876
|
-
);
|
|
877
|
-
}
|
|
878
|
-
);
|
|
879
|
-
HlsPlayer.displayName = "HlsPlayer";
|
|
880
|
-
HlsPlayer_default = HlsPlayer;
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
);
|
|
641
|
+
HlsPlayer.displayName = "HlsPlayer";
|
|
642
|
+
HlsPlayer_default = HlsPlayer;
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
// src/components/controls/view/DateTimeViewClient.tsx
|
|
647
|
+
var DateTimeViewClient_exports = {};
|
|
648
|
+
__export(DateTimeViewClient_exports, {
|
|
649
|
+
default: () => DateTimeViewClient_default
|
|
650
|
+
});
|
|
651
|
+
var import_jsx_runtime14, DateTimeViewClient, DateTimeViewClient_default;
|
|
652
|
+
var init_DateTimeViewClient = __esm({
|
|
653
|
+
"src/components/controls/view/DateTimeViewClient.tsx"() {
|
|
654
|
+
"use strict";
|
|
655
|
+
"use client";
|
|
656
|
+
init_DateViewClient();
|
|
657
|
+
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
658
|
+
DateTimeViewClient = (props) => {
|
|
659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DateViewClient_default, { ...props, controlType: "datetime" });
|
|
660
|
+
};
|
|
661
|
+
DateTimeViewClient_default = DateTimeViewClient;
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
// src/components/ToastService.tsx
|
|
666
|
+
var ToastService, ToastService_default;
|
|
667
|
+
var init_ToastService = __esm({
|
|
668
|
+
"src/components/ToastService.tsx"() {
|
|
669
|
+
"use strict";
|
|
670
|
+
ToastService = class _ToastService {
|
|
671
|
+
static initialize(showToast, closeToast) {
|
|
672
|
+
_ToastService.showToast = showToast;
|
|
673
|
+
_ToastService.closeToast = closeToast;
|
|
674
|
+
}
|
|
675
|
+
static showError(message) {
|
|
676
|
+
if (_ToastService.showToast) {
|
|
677
|
+
_ToastService.showToast(message, "error");
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
static showInfo(message) {
|
|
681
|
+
if (_ToastService.showToast) {
|
|
682
|
+
_ToastService.showToast(message, "info");
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
static showWarning(message) {
|
|
686
|
+
if (_ToastService.showToast) {
|
|
687
|
+
_ToastService.showToast(message, "warning");
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
static showSuccess(message) {
|
|
691
|
+
if (_ToastService.showToast) {
|
|
692
|
+
_ToastService.showToast(message, "success");
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
static close() {
|
|
696
|
+
if (_ToastService.closeToast) {
|
|
697
|
+
_ToastService.closeToast();
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
ToastService_default = ToastService;
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
// src/components/StyleTypes.tsx
|
|
706
|
+
var buttonClasses, progressClasses;
|
|
707
|
+
var init_StyleTypes = __esm({
|
|
708
|
+
"src/components/StyleTypes.tsx"() {
|
|
709
|
+
"use strict";
|
|
710
|
+
buttonClasses = /* @__PURE__ */ new Map([
|
|
711
|
+
[
|
|
712
|
+
"Primary" /* Solid */,
|
|
713
|
+
"btn-solid relative inline-flex items-center justify-center rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out"
|
|
714
|
+
],
|
|
715
|
+
[
|
|
716
|
+
"PrimaryHollow" /* Hollow */,
|
|
717
|
+
"btn-hollow inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"
|
|
718
|
+
],
|
|
719
|
+
["Link" /* Link */, "btn-link"]
|
|
720
|
+
]);
|
|
721
|
+
progressClasses = /* @__PURE__ */ new Map([
|
|
722
|
+
["Primary" /* Solid */, ""],
|
|
723
|
+
["PrimaryHollow" /* Hollow */, ""],
|
|
724
|
+
["Link" /* Link */, ""]
|
|
725
|
+
]);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
// src/components/ClientButton.tsx
|
|
730
|
+
var import_react24, import_jsx_runtime28, ClientButton, ClientButton_default;
|
|
731
|
+
var init_ClientButton = __esm({
|
|
732
|
+
"src/components/ClientButton.tsx"() {
|
|
733
|
+
"use strict";
|
|
734
|
+
"use client";
|
|
735
|
+
import_react24 = __toESM(require("react"));
|
|
736
|
+
init_ToastService();
|
|
737
|
+
init_StyleTypes();
|
|
738
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
739
|
+
ClientButton = (props) => {
|
|
740
|
+
const execute = async (event) => {
|
|
741
|
+
if (props.onClick !== void 0) {
|
|
742
|
+
props.onClick();
|
|
743
|
+
} else {
|
|
744
|
+
ToastService_default.showError("No action defined.");
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react24.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
749
|
+
"button",
|
|
750
|
+
{
|
|
751
|
+
type: "button",
|
|
752
|
+
onClick: execute,
|
|
753
|
+
className: buttonClass + " " + props.className,
|
|
754
|
+
children: props.children
|
|
755
|
+
}
|
|
756
|
+
) });
|
|
757
|
+
};
|
|
758
|
+
ClientButton_default = ClientButton;
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// src/components/Confirm.tsx
|
|
763
|
+
var import_react25, import_jsx_runtime29, Confirm, Confirm_default;
|
|
764
|
+
var init_Confirm = __esm({
|
|
765
|
+
"src/components/Confirm.tsx"() {
|
|
766
|
+
"use strict";
|
|
767
|
+
"use client";
|
|
768
|
+
import_react25 = require("react");
|
|
769
|
+
init_ClientButton();
|
|
770
|
+
init_StyleTypes();
|
|
771
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
772
|
+
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
773
|
+
const [showModal, setShowModal] = (0, import_react25.useState)(true);
|
|
774
|
+
const handleConfirmAction = () => {
|
|
775
|
+
setShowModal(false);
|
|
776
|
+
if (onConfirm) {
|
|
777
|
+
onConfirm();
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
const handleCancelAction = () => {
|
|
781
|
+
setShowModal(false);
|
|
782
|
+
if (onCancel) {
|
|
783
|
+
onCancel();
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
787
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
789
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
790
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mb-4", children: message }),
|
|
791
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
793
|
+
ClientButton_default,
|
|
794
|
+
{
|
|
795
|
+
onClick: handleCancelAction,
|
|
796
|
+
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
797
|
+
children: "Cancel"
|
|
798
|
+
}
|
|
799
|
+
),
|
|
800
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
801
|
+
ClientButton_default,
|
|
802
|
+
{
|
|
803
|
+
onClick: handleConfirmAction,
|
|
804
|
+
children: "Confirm"
|
|
805
|
+
}
|
|
806
|
+
)
|
|
807
|
+
] })
|
|
808
|
+
] })
|
|
809
|
+
] }) });
|
|
810
|
+
};
|
|
811
|
+
Confirm_default = Confirm;
|
|
812
|
+
{
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
// src/components/Button.tsx
|
|
818
|
+
var import_react26, import_jsx_runtime30, Button, Button_default;
|
|
819
|
+
var init_Button = __esm({
|
|
820
|
+
"src/components/Button.tsx"() {
|
|
821
|
+
"use strict";
|
|
822
|
+
"use client";
|
|
823
|
+
import_react26 = __toESM(require("react"));
|
|
824
|
+
init_ToastService();
|
|
825
|
+
init_StyleTypes();
|
|
826
|
+
init_Confirm();
|
|
827
|
+
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
828
|
+
Button = (props) => {
|
|
829
|
+
const [inProgress, setInProgress] = (0, import_react26.useState)(false);
|
|
830
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react26.useState)(false);
|
|
831
|
+
const [responseMessage, setResponseMessage] = (0, import_react26.useState)(null);
|
|
832
|
+
const [showModal, setShowModal] = (0, import_react26.useState)(null);
|
|
833
|
+
const execute = async (event) => {
|
|
834
|
+
event.preventDefault();
|
|
835
|
+
event.stopPropagation();
|
|
836
|
+
if (props.confirm) {
|
|
837
|
+
const confirmed = await showConfirmation("Are you sure you want to delete this item?");
|
|
838
|
+
setShowModal(null);
|
|
839
|
+
if (!confirmed) {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (props.oneTimeAction && isActionPerformed) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
setInProgress(true);
|
|
847
|
+
let isValid = true;
|
|
848
|
+
if (props.onValidate !== void 0) {
|
|
849
|
+
isValid = await props.onValidate();
|
|
850
|
+
if (!isValid) {
|
|
851
|
+
setInProgress(false);
|
|
852
|
+
ToastService_default.showError("There are errors in the form. Please fix them before proceeding.");
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (props.onClick !== void 0) {
|
|
857
|
+
let response = await props.onClick();
|
|
858
|
+
if (response.isSuccessful) {
|
|
859
|
+
setIsActionPerformed(true);
|
|
860
|
+
setResponseMessage(response.message);
|
|
861
|
+
if (props.showToast) {
|
|
862
|
+
ToastService_default.showInfo(response.message || "");
|
|
863
|
+
}
|
|
864
|
+
} else {
|
|
865
|
+
ToastService_default.showError(response.message || "");
|
|
866
|
+
}
|
|
867
|
+
} else {
|
|
868
|
+
ToastService_default.showError("No action defined.");
|
|
869
|
+
}
|
|
870
|
+
setInProgress(false);
|
|
871
|
+
};
|
|
872
|
+
const showConfirmation = (message) => {
|
|
873
|
+
return new Promise((resolve) => {
|
|
874
|
+
const onConfirm = () => resolve(true);
|
|
875
|
+
const onCancel = () => resolve(false);
|
|
876
|
+
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
877
|
+
});
|
|
878
|
+
};
|
|
879
|
+
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
880
|
+
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
881
|
+
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react26.default.Fragment, { children: [
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
884
|
+
"button",
|
|
885
|
+
{
|
|
886
|
+
type: "submit",
|
|
887
|
+
onClick: execute,
|
|
888
|
+
disabled: props.disabled,
|
|
889
|
+
title: isDisabled ? "The button is disabled to prevent any action" : "",
|
|
890
|
+
className: buttonClass + " relative " + props.className,
|
|
891
|
+
children: [
|
|
892
|
+
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
893
|
+
inProgress && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react26.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime30.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: [
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.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" })
|
|
896
|
+
] }) })
|
|
897
|
+
]
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
showModal
|
|
901
|
+
] });
|
|
902
|
+
};
|
|
903
|
+
Button_default = Button;
|
|
881
904
|
}
|
|
882
905
|
});
|
|
883
906
|
|
|
@@ -1100,7 +1123,7 @@ var LinkNodeButton_exports = {};
|
|
|
1100
1123
|
__export(LinkNodeButton_exports, {
|
|
1101
1124
|
default: () => LinkNodeButton_default
|
|
1102
1125
|
});
|
|
1103
|
-
var import_react34,
|
|
1126
|
+
var import_react34, import_jsx_runtime46, LinkNodeButton, LinkNodeButton_default;
|
|
1104
1127
|
var init_LinkNodeButton = __esm({
|
|
1105
1128
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
1106
1129
|
"use strict";
|
|
@@ -1109,7 +1132,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1109
1132
|
init_Button();
|
|
1110
1133
|
init_ServiceClient();
|
|
1111
1134
|
init_ToastService();
|
|
1112
|
-
|
|
1135
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1113
1136
|
LinkNodeButton = (props) => {
|
|
1114
1137
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
1115
1138
|
const [isLoading, setIsLoading] = (0, import_react34.useState)(false);
|
|
@@ -1252,11 +1275,11 @@ var init_LinkNodeButton = __esm({
|
|
|
1252
1275
|
return children;
|
|
1253
1276
|
}
|
|
1254
1277
|
if (linkText) {
|
|
1255
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: linkText });
|
|
1256
1279
|
}
|
|
1257
1280
|
return node.title || "Button";
|
|
1258
1281
|
};
|
|
1259
|
-
return /* @__PURE__ */ (0,
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1260
1283
|
Button_default,
|
|
1261
1284
|
{
|
|
1262
1285
|
ButtonType: linkType,
|
|
@@ -1294,13 +1317,13 @@ function CopyButton({ text }) {
|
|
|
1294
1317
|
console.error("Failed to copy: ", err);
|
|
1295
1318
|
}
|
|
1296
1319
|
};
|
|
1297
|
-
return /* @__PURE__ */ (0,
|
|
1320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
1298
1321
|
"button",
|
|
1299
1322
|
{
|
|
1300
1323
|
onClick: handleCopy,
|
|
1301
1324
|
className: "flex gap-1 items-center hover:text-white transition",
|
|
1302
1325
|
children: [
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1304
1327
|
"svg",
|
|
1305
1328
|
{
|
|
1306
1329
|
width: "16",
|
|
@@ -1308,7 +1331,7 @@ function CopyButton({ text }) {
|
|
|
1308
1331
|
viewBox: "0 0 24 24",
|
|
1309
1332
|
className: "w-4 h-4",
|
|
1310
1333
|
fill: "currentColor",
|
|
1311
|
-
children: /* @__PURE__ */ (0,
|
|
1334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1312
1335
|
"path",
|
|
1313
1336
|
{
|
|
1314
1337
|
fillRule: "evenodd",
|
|
@@ -1323,54 +1346,54 @@ function CopyButton({ text }) {
|
|
|
1323
1346
|
}
|
|
1324
1347
|
);
|
|
1325
1348
|
}
|
|
1326
|
-
var import_react41,
|
|
1349
|
+
var import_react41, import_jsx_runtime56;
|
|
1327
1350
|
var init_CopyButton = __esm({
|
|
1328
1351
|
"src/components/CopyButton.tsx"() {
|
|
1329
1352
|
"use strict";
|
|
1330
1353
|
"use client";
|
|
1331
1354
|
import_react41 = require("react");
|
|
1332
|
-
|
|
1355
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1333
1356
|
}
|
|
1334
1357
|
});
|
|
1335
1358
|
|
|
1336
1359
|
// src/components/IFrameLoaderView.tsx
|
|
1337
|
-
var import_react45,
|
|
1360
|
+
var import_react45, import_jsx_runtime62, IFrameLoaderView, IFrameLoaderView_default;
|
|
1338
1361
|
var init_IFrameLoaderView = __esm({
|
|
1339
1362
|
"src/components/IFrameLoaderView.tsx"() {
|
|
1340
1363
|
"use strict";
|
|
1341
1364
|
import_react45 = __toESM(require("react"));
|
|
1342
|
-
|
|
1365
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
1343
1366
|
IFrameLoaderView = (props) => {
|
|
1344
|
-
return /* @__PURE__ */ (0,
|
|
1345
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
1346
|
-
/* @__PURE__ */ (0,
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_react45.default.Fragment, { children: [
|
|
1368
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ml-2", children: [
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
1351
1374
|
] })
|
|
1352
1375
|
] }),
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1354
|
-
/* @__PURE__ */ (0,
|
|
1355
|
-
/* @__PURE__ */ (0,
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "animate-pulse", children: [
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1360
1383
|
] }),
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1363
|
-
/* @__PURE__ */ (0,
|
|
1364
|
-
/* @__PURE__ */ (0,
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "animate-pulse", children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1389
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1367
1390
|
] }),
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "animate-pulse", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1393
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1394
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1374
1397
|
] })
|
|
1375
1398
|
] })
|
|
1376
1399
|
] }) }),
|
|
@@ -1386,14 +1409,14 @@ var IframeClient_exports = {};
|
|
|
1386
1409
|
__export(IframeClient_exports, {
|
|
1387
1410
|
default: () => IframeClient_default
|
|
1388
1411
|
});
|
|
1389
|
-
var import_react46,
|
|
1412
|
+
var import_react46, import_jsx_runtime63, IframeClient, IframeClient_default;
|
|
1390
1413
|
var init_IframeClient = __esm({
|
|
1391
1414
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1392
1415
|
"use strict";
|
|
1393
1416
|
"use client";
|
|
1394
1417
|
import_react46 = __toESM(require("react"));
|
|
1395
1418
|
init_IFrameLoaderView();
|
|
1396
|
-
|
|
1419
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
1397
1420
|
IframeClient = ({ src }) => {
|
|
1398
1421
|
const iframeRef = (0, import_react46.useRef)(null);
|
|
1399
1422
|
const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
|
|
@@ -1425,7 +1448,7 @@ var init_IframeClient = __esm({
|
|
|
1425
1448
|
const handleIframeLoad = () => {
|
|
1426
1449
|
setIsDataFound(true);
|
|
1427
1450
|
};
|
|
1428
|
-
return /* @__PURE__ */ (0,
|
|
1451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
1429
1452
|
"iframe",
|
|
1430
1453
|
{
|
|
1431
1454
|
ref: iframeRef,
|
|
@@ -1473,7 +1496,7 @@ __export(index_exports, {
|
|
|
1473
1496
|
module.exports = __toCommonJS(index_exports);
|
|
1474
1497
|
|
|
1475
1498
|
// src/components/controls/view/ViewControl.tsx
|
|
1476
|
-
var
|
|
1499
|
+
var import_react11 = __toESM(require("react"));
|
|
1477
1500
|
|
|
1478
1501
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1479
1502
|
var ViewControlTypes = {
|
|
@@ -1556,16 +1579,186 @@ var BooleanView = (props) => {
|
|
|
1556
1579
|
};
|
|
1557
1580
|
var BooleanView_default = BooleanView;
|
|
1558
1581
|
|
|
1582
|
+
// src/components/utilities/AssetUtility.tsx
|
|
1583
|
+
var AssetUtility = class {
|
|
1584
|
+
constructor() {
|
|
1585
|
+
}
|
|
1586
|
+
static resolveUrl(assetBaseUrl, url) {
|
|
1587
|
+
if (!url) return void 0;
|
|
1588
|
+
if (url.startsWith("http")) return url;
|
|
1589
|
+
if (!assetBaseUrl) return url;
|
|
1590
|
+
return `${assetBaseUrl}/${url}`;
|
|
1591
|
+
}
|
|
1592
|
+
// static getAssetUrl(apiBaseUrl: string) {
|
|
1593
|
+
// let domainName = apiBaseUrl.replace("https://", "");
|
|
1594
|
+
// return `https://cdn.g-assets.com/${domainName}`;
|
|
1595
|
+
// }
|
|
1596
|
+
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
1597
|
+
const domainName = apiBaseUrl.replace("https://", "");
|
|
1598
|
+
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
var AssetUtility_default = AssetUtility;
|
|
1602
|
+
|
|
1603
|
+
// src/components/DeviceAssetSelector.tsx
|
|
1604
|
+
init_HlsPlayer();
|
|
1605
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1606
|
+
var DeviceAssetSelector = ({
|
|
1607
|
+
assets,
|
|
1608
|
+
assetBaseUrl,
|
|
1609
|
+
session,
|
|
1610
|
+
// This should receive the session
|
|
1611
|
+
width,
|
|
1612
|
+
tag,
|
|
1613
|
+
customProps,
|
|
1614
|
+
nodeProps,
|
|
1615
|
+
device
|
|
1616
|
+
}) => {
|
|
1617
|
+
console.log("\u{1F511} Session in DeviceAssetSelector:", session);
|
|
1618
|
+
const targetTag = tag || nodeProps?.tag;
|
|
1619
|
+
const selectAssetByDevice = (assets2, currentDevice) => {
|
|
1620
|
+
if (!assets2 || assets2.length === 0) return void 0;
|
|
1621
|
+
const exactMatch = assets2.find((asset) => asset.device === currentDevice);
|
|
1622
|
+
if (exactMatch) return exactMatch;
|
|
1623
|
+
const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
|
|
1624
|
+
if (noDeviceMatch) return noDeviceMatch;
|
|
1625
|
+
return void 0;
|
|
1626
|
+
};
|
|
1627
|
+
const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
|
|
1628
|
+
if (!assets2 || assets2.length === 0) return void 0;
|
|
1629
|
+
if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
|
|
1630
|
+
const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
|
|
1631
|
+
if (taggedAssets.length === 0) {
|
|
1632
|
+
return selectAssetByDevice(assets2, currentDevice);
|
|
1633
|
+
}
|
|
1634
|
+
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
1635
|
+
if (exactTaggedMatch) return exactTaggedMatch;
|
|
1636
|
+
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
1637
|
+
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
1638
|
+
return void 0;
|
|
1639
|
+
};
|
|
1640
|
+
const selectAsset = () => {
|
|
1641
|
+
if (!assets || assets.length === 0) return void 0;
|
|
1642
|
+
if (targetTag) {
|
|
1643
|
+
return selectAssetByTagAndDevice(assets, device, targetTag);
|
|
1644
|
+
}
|
|
1645
|
+
return selectAssetByDevice(assets, device);
|
|
1646
|
+
};
|
|
1647
|
+
const selectedAsset = selectAsset();
|
|
1648
|
+
if (!selectedAsset) {
|
|
1649
|
+
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
1650
|
+
return null;
|
|
1651
|
+
}
|
|
1652
|
+
const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
|
|
1653
|
+
const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
|
|
1654
|
+
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
1655
|
+
const title = selectedAsset.title || nodeProps?.title;
|
|
1656
|
+
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
1657
|
+
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
1658
|
+
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
1659
|
+
const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
|
|
1660
|
+
const loop = customProps?.loop ?? nodeProps?.loop === "true";
|
|
1661
|
+
const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
|
|
1662
|
+
const styles = {};
|
|
1663
|
+
if (nodeProps?.height) {
|
|
1664
|
+
styles.height = nodeProps.height;
|
|
1665
|
+
}
|
|
1666
|
+
if (nodeProps?.borderRadius) {
|
|
1667
|
+
styles.borderRadius = nodeProps.borderRadius;
|
|
1668
|
+
}
|
|
1669
|
+
if (nodeProps?.width) {
|
|
1670
|
+
styles.width = nodeProps.width;
|
|
1671
|
+
}
|
|
1672
|
+
const FormatClass = {
|
|
1673
|
+
"center": "justify-center",
|
|
1674
|
+
"left": "justify-start",
|
|
1675
|
+
"right": "justify-end"
|
|
1676
|
+
};
|
|
1677
|
+
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
1678
|
+
const renderMedia = () => {
|
|
1679
|
+
if (isHls) {
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1681
|
+
HlsPlayer_default,
|
|
1682
|
+
{
|
|
1683
|
+
assetUrl: resolvedAssetUrl,
|
|
1684
|
+
posterUrl: resolvedThumbnailUrl,
|
|
1685
|
+
intrinsicWidth,
|
|
1686
|
+
intrinsicHeight,
|
|
1687
|
+
showControls,
|
|
1688
|
+
loop,
|
|
1689
|
+
playOptions,
|
|
1690
|
+
apiBaseUrl: assetBaseUrl,
|
|
1691
|
+
session
|
|
1692
|
+
}
|
|
1693
|
+
);
|
|
1694
|
+
} else {
|
|
1695
|
+
return (
|
|
1696
|
+
/* eslint-disable-next-line @next/next/no-img-element */
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1698
|
+
"img",
|
|
1699
|
+
{
|
|
1700
|
+
style: styles,
|
|
1701
|
+
loading: "lazy",
|
|
1702
|
+
className: "object-cover w-full",
|
|
1703
|
+
src: resolvedAssetUrl,
|
|
1704
|
+
width: selectedAsset.intrinsicWidth,
|
|
1705
|
+
alt: title || "Asset image",
|
|
1706
|
+
height: selectedAsset.intrinsicHeight
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
if (width) {
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width }, children: renderMedia() });
|
|
1714
|
+
}
|
|
1715
|
+
if (nodeProps?.format) {
|
|
1716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
1717
|
+
}
|
|
1718
|
+
return renderMedia();
|
|
1719
|
+
};
|
|
1720
|
+
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
1721
|
+
|
|
1722
|
+
// src/components/controls/view/Asset.tsx
|
|
1723
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1724
|
+
var MediaAsset = (props) => {
|
|
1725
|
+
let assets;
|
|
1726
|
+
if (props.value != void 0 && props.value != null && props.value != "") {
|
|
1727
|
+
try {
|
|
1728
|
+
assets = JSON.parse(props.value);
|
|
1729
|
+
console.log("Parsed Assets: ", assets);
|
|
1730
|
+
} catch (error) {
|
|
1731
|
+
console.error("Error parsing assets:", error);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
if (!assets || assets.length === 0) {
|
|
1735
|
+
return null;
|
|
1736
|
+
}
|
|
1737
|
+
console.log(props.customProps?.tag, "Tag in MediaAsset");
|
|
1738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1739
|
+
DeviceAssetSelector_default,
|
|
1740
|
+
{
|
|
1741
|
+
assets,
|
|
1742
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
1743
|
+
session: props,
|
|
1744
|
+
width: props.width,
|
|
1745
|
+
customProps: props.customProps,
|
|
1746
|
+
tag: props.customProps?.tag
|
|
1747
|
+
}
|
|
1748
|
+
);
|
|
1749
|
+
};
|
|
1750
|
+
var Asset_default = MediaAsset;
|
|
1751
|
+
|
|
1559
1752
|
// src/components/controls/view/LineTextView.tsx
|
|
1560
|
-
var
|
|
1561
|
-
var
|
|
1753
|
+
var import_react5 = __toESM(require("react"));
|
|
1754
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1562
1755
|
var LineText = (props) => {
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react5.default.Fragment, { children: props.value });
|
|
1564
1757
|
};
|
|
1565
1758
|
var LineTextView_default = LineText;
|
|
1566
1759
|
|
|
1567
1760
|
// src/components/controls/view/MoneyView.tsx
|
|
1568
|
-
var
|
|
1761
|
+
var import_react6 = __toESM(require("react"));
|
|
1569
1762
|
|
|
1570
1763
|
// src/components/utilities/CurrencyUtility.tsx
|
|
1571
1764
|
var CurrencyUtility = class {
|
|
@@ -1586,40 +1779,40 @@ var CurrencyUtility = class {
|
|
|
1586
1779
|
var CurrencyUtility_default = CurrencyUtility;
|
|
1587
1780
|
|
|
1588
1781
|
// src/components/controls/view/MoneyView.tsx
|
|
1589
|
-
var
|
|
1782
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1590
1783
|
var Money = (props) => {
|
|
1591
1784
|
const parsedNumber = parseFloat(props.value);
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react6.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react6.default.Fragment, { children: [
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-0.5", children: CurrencyUtility_default.getCurrencySymbol(props.unit) }),
|
|
1594
1787
|
parsedNumber.toLocaleString()
|
|
1595
1788
|
] }) });
|
|
1596
1789
|
};
|
|
1597
1790
|
var MoneyView_default = Money;
|
|
1598
1791
|
|
|
1599
1792
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1793
|
+
var import_react7 = __toESM(require("react"));
|
|
1794
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1602
1795
|
var MultilineTextBullets = (props) => {
|
|
1603
1796
|
const lines = props.value?.split("\\n");
|
|
1604
|
-
return /* @__PURE__ */ (0,
|
|
1605
|
-
return /* @__PURE__ */ (0,
|
|
1797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
1798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { children: line }, index);
|
|
1606
1799
|
}) }) });
|
|
1607
1800
|
};
|
|
1608
1801
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1609
1802
|
|
|
1610
1803
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1611
|
-
var
|
|
1612
|
-
var
|
|
1804
|
+
var import_react8 = __toESM(require("react"));
|
|
1805
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1613
1806
|
var MultilineText = (props) => {
|
|
1614
|
-
return /* @__PURE__ */ (0,
|
|
1807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react8.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
1615
1808
|
};
|
|
1616
1809
|
var MultilineTextView_default = MultilineText;
|
|
1617
1810
|
|
|
1618
1811
|
// src/components/controls/view/PercentageView.tsx
|
|
1619
|
-
var
|
|
1620
|
-
var
|
|
1812
|
+
var import_react9 = __toESM(require("react"));
|
|
1813
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1621
1814
|
var PercentageView = (props) => {
|
|
1622
|
-
return /* @__PURE__ */ (0,
|
|
1815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react9.default.Fragment, { children: [
|
|
1623
1816
|
props.value,
|
|
1624
1817
|
"%"
|
|
1625
1818
|
] });
|
|
@@ -1627,16 +1820,16 @@ var PercentageView = (props) => {
|
|
|
1627
1820
|
var PercentageView_default = PercentageView;
|
|
1628
1821
|
|
|
1629
1822
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1630
|
-
var
|
|
1631
|
-
var
|
|
1823
|
+
var import_react10 = __toESM(require("react"));
|
|
1824
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1632
1825
|
var ProgressIndicator = (props) => {
|
|
1633
1826
|
const percentage = 100;
|
|
1634
1827
|
const circumference = Math.PI * 56;
|
|
1635
1828
|
const offset = circumference * (1 - percentage / 100);
|
|
1636
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1638
|
-
/* @__PURE__ */ (0,
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react10.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative w-48 h-48", children: [
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full border border-gray-200" }),
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime12.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)` } }) }),
|
|
1832
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsxs)("span", { children: [
|
|
1640
1833
|
percentage,
|
|
1641
1834
|
"%"
|
|
1642
1835
|
] }) })
|
|
@@ -1645,18 +1838,18 @@ var ProgressIndicator = (props) => {
|
|
|
1645
1838
|
var ProgressIndicator_default = ProgressIndicator;
|
|
1646
1839
|
|
|
1647
1840
|
// src/components/controls/view/AiGeneratedSummary.tsx
|
|
1648
|
-
var
|
|
1841
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1649
1842
|
var AiGeneratedSummary = (props) => {
|
|
1650
1843
|
const lines = props.value?.split("\n").filter((line) => line.trim() !== "") || [];
|
|
1651
|
-
return /* @__PURE__ */ (0,
|
|
1652
|
-
/* @__PURE__ */ (0,
|
|
1653
|
-
/* @__PURE__ */ (0,
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1655
|
-
/* @__PURE__ */ (0,
|
|
1656
|
-
/* @__PURE__ */ (0,
|
|
1844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "group rounded-xl border-2 bg-white shadow-sm border-p overflow-hidden", children: [
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("summary", { className: "flex items-start justify-between cursor-pointer list-none", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-start gap-3 ", children: [
|
|
1846
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-primary-base bg-transparent rounded mt-1 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.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" }) }) }),
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { className: "text-lg font-semibold ", children: "Quick Read" }),
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-sm text-gray-500 mb-0", children: "Summary is AI-generated, author-reviewed" })
|
|
1657
1850
|
] })
|
|
1658
1851
|
] }) }),
|
|
1659
|
-
/* @__PURE__ */ (0,
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "list-disc pl-6 space-y-3 text-gray-700", children: lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { className: "m-0", children: line }, index)) }) })
|
|
1660
1853
|
] });
|
|
1661
1854
|
};
|
|
1662
1855
|
var AiGeneratedSummary_default = AiGeneratedSummary;
|
|
@@ -1669,11 +1862,11 @@ var DateTimeView = (0, import_dynamic2.default)(() => Promise.resolve().then(()
|
|
|
1669
1862
|
var DateTimeVew_default = DateTimeView;
|
|
1670
1863
|
|
|
1671
1864
|
// src/components/controls/view/ViewControl.tsx
|
|
1672
|
-
var
|
|
1865
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1673
1866
|
var ViewControl = (props) => {
|
|
1674
1867
|
const ControlComponents = {
|
|
1675
1868
|
[ViewControlTypes_default.lineText]: LineTextView_default,
|
|
1676
|
-
|
|
1869
|
+
[ViewControlTypes_default.asset]: Asset_default,
|
|
1677
1870
|
[ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
|
|
1678
1871
|
[ViewControlTypes_default.boolean]: BooleanView_default,
|
|
1679
1872
|
[ViewControlTypes_default.money]: MoneyView_default,
|
|
@@ -1691,16 +1884,16 @@ var ViewControl = (props) => {
|
|
|
1691
1884
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1692
1885
|
};
|
|
1693
1886
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1694
|
-
return /* @__PURE__ */ (0,
|
|
1887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
1695
1888
|
};
|
|
1696
1889
|
var ViewControl_default = ViewControl;
|
|
1697
1890
|
|
|
1698
1891
|
// src/components/controls/edit/InputControl.tsx
|
|
1699
|
-
var
|
|
1892
|
+
var import_react32 = __toESM(require("react"));
|
|
1700
1893
|
|
|
1701
1894
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1702
|
-
var
|
|
1703
|
-
var
|
|
1895
|
+
var import_react12 = __toESM(require("react"));
|
|
1896
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1704
1897
|
var MultilineTextInput = (props) => {
|
|
1705
1898
|
const textChangeHandler = (event) => {
|
|
1706
1899
|
const text = event.target.value;
|
|
@@ -1719,11 +1912,11 @@ var MultilineTextInput = (props) => {
|
|
|
1719
1912
|
if (props.value !== void 0 && props.value !== null) {
|
|
1720
1913
|
value = props.value;
|
|
1721
1914
|
}
|
|
1722
|
-
return /* @__PURE__ */ (0,
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react12.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "block mb-1", children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1724
1917
|
" ",
|
|
1725
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1727
1920
|
"textarea",
|
|
1728
1921
|
{
|
|
1729
1922
|
name: props.name,
|
|
@@ -1740,14 +1933,14 @@ var MultilineTextInput = (props) => {
|
|
|
1740
1933
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
1741
1934
|
}
|
|
1742
1935
|
),
|
|
1743
|
-
/* @__PURE__ */ (0,
|
|
1936
|
+
/* @__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 : "" })
|
|
1744
1937
|
] }) });
|
|
1745
1938
|
};
|
|
1746
1939
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1747
1940
|
|
|
1748
1941
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1749
|
-
var
|
|
1750
|
-
var
|
|
1942
|
+
var import_react13 = __toESM(require("react"));
|
|
1943
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1751
1944
|
var LineTextInput = (props) => {
|
|
1752
1945
|
const textChangeHandler = (event) => {
|
|
1753
1946
|
const text = event.target.value;
|
|
@@ -1766,11 +1959,11 @@ var LineTextInput = (props) => {
|
|
|
1766
1959
|
if (props.value !== void 0 && props.value !== null) {
|
|
1767
1960
|
value = props.value;
|
|
1768
1961
|
}
|
|
1769
|
-
return /* @__PURE__ */ (0,
|
|
1770
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react13.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "block", children: [
|
|
1963
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1771
1964
|
" ",
|
|
1772
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1773
|
-
/* @__PURE__ */ (0,
|
|
1965
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1774
1967
|
"input",
|
|
1775
1968
|
{
|
|
1776
1969
|
type: "text",
|
|
@@ -1790,14 +1983,14 @@ var LineTextInput = (props) => {
|
|
|
1790
1983
|
`
|
|
1791
1984
|
}
|
|
1792
1985
|
),
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1986
|
+
/* @__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 : "" })
|
|
1794
1987
|
] }) });
|
|
1795
1988
|
};
|
|
1796
1989
|
var LineTextInput_default = LineTextInput;
|
|
1797
1990
|
|
|
1798
1991
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1992
|
+
var import_react14 = __toESM(require("react"));
|
|
1993
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1801
1994
|
var MoneyInput = (props) => {
|
|
1802
1995
|
const textChangeHandler = (event) => {
|
|
1803
1996
|
const rawValue = event.target.value;
|
|
@@ -1826,11 +2019,11 @@ var MoneyInput = (props) => {
|
|
|
1826
2019
|
e.preventDefault();
|
|
1827
2020
|
}
|
|
1828
2021
|
};
|
|
1829
|
-
return /* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
2022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react14.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "block mb-1", children: [
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1831
2024
|
" ",
|
|
1832
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
2025
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1834
2027
|
"input",
|
|
1835
2028
|
{
|
|
1836
2029
|
type: "number",
|
|
@@ -1850,7 +2043,7 @@ var MoneyInput = (props) => {
|
|
|
1850
2043
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1851
2044
|
}
|
|
1852
2045
|
),
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
2046
|
+
/* @__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 : "" })
|
|
1854
2047
|
] }) });
|
|
1855
2048
|
};
|
|
1856
2049
|
var MoneyInput_default = MoneyInput;
|
|
@@ -1881,10 +2074,10 @@ var InputControlType = {
|
|
|
1881
2074
|
var InputControlType_default = InputControlType;
|
|
1882
2075
|
|
|
1883
2076
|
// src/components/controls/edit/Select.tsx
|
|
1884
|
-
var
|
|
1885
|
-
var
|
|
2077
|
+
var import_react15 = require("react");
|
|
2078
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1886
2079
|
var Select = (props) => {
|
|
1887
|
-
const [list, setList] = (0,
|
|
2080
|
+
const [list, setList] = (0, import_react15.useState)([]);
|
|
1888
2081
|
const getSafeValue = (val) => {
|
|
1889
2082
|
if (val === null || val === void 0) return "";
|
|
1890
2083
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1913,7 +2106,7 @@ var Select = (props) => {
|
|
|
1913
2106
|
groupKey: props.groupKey
|
|
1914
2107
|
});
|
|
1915
2108
|
};
|
|
1916
|
-
(0,
|
|
2109
|
+
(0, import_react15.useEffect)(() => {
|
|
1917
2110
|
async function fetchData() {
|
|
1918
2111
|
if (props.dataset) {
|
|
1919
2112
|
setList(props.dataset);
|
|
@@ -1940,11 +2133,11 @@ var Select = (props) => {
|
|
|
1940
2133
|
props.dataSourceDependsOn
|
|
1941
2134
|
]);
|
|
1942
2135
|
const value = getSafeValue(props.value);
|
|
1943
|
-
return /* @__PURE__ */ (0,
|
|
1944
|
-
props.attributes?.label && /* @__PURE__ */ (0,
|
|
2136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "block", children: [
|
|
2137
|
+
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
1945
2138
|
" ",
|
|
1946
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1948
2141
|
"select",
|
|
1949
2142
|
{
|
|
1950
2143
|
name: props.name,
|
|
@@ -1955,23 +2148,23 @@ var Select = (props) => {
|
|
|
1955
2148
|
disabled: props.attributes?.readOnly,
|
|
1956
2149
|
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",
|
|
1957
2150
|
children: [
|
|
1958
|
-
/* @__PURE__ */ (0,
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1959
2152
|
list.map((item, index) => {
|
|
1960
2153
|
const keyField = props.dataKeyFieldName;
|
|
1961
2154
|
const textField = props.dataTextFieldName;
|
|
1962
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
1963
2156
|
})
|
|
1964
2157
|
]
|
|
1965
2158
|
}
|
|
1966
2159
|
),
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
|
|
1968
2161
|
] });
|
|
1969
2162
|
};
|
|
1970
2163
|
var Select_default = Select;
|
|
1971
2164
|
|
|
1972
2165
|
// src/components/controls/edit/PercentageInput.tsx
|
|
1973
|
-
var
|
|
1974
|
-
var
|
|
2166
|
+
var import_react16 = __toESM(require("react"));
|
|
2167
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1975
2168
|
var PercentageInput = (props) => {
|
|
1976
2169
|
const textChangeHandler = (event) => {
|
|
1977
2170
|
const rawValue = event.target.value;
|
|
@@ -2000,11 +2193,11 @@ var PercentageInput = (props) => {
|
|
|
2000
2193
|
e.preventDefault();
|
|
2001
2194
|
}
|
|
2002
2195
|
};
|
|
2003
|
-
return /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react16.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "block mb-1", children: [
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
2005
2198
|
" ",
|
|
2006
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2199
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2008
2201
|
"input",
|
|
2009
2202
|
{
|
|
2010
2203
|
type: "number",
|
|
@@ -2023,14 +2216,14 @@ var PercentageInput = (props) => {
|
|
|
2023
2216
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
2024
2217
|
}
|
|
2025
2218
|
),
|
|
2026
|
-
/* @__PURE__ */ (0,
|
|
2219
|
+
/* @__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 : "" })
|
|
2027
2220
|
] }) });
|
|
2028
2221
|
};
|
|
2029
2222
|
var PercentageInput_default = PercentageInput;
|
|
2030
2223
|
|
|
2031
2224
|
// src/components/controls/edit/PhoneInput.tsx
|
|
2032
|
-
var
|
|
2033
|
-
var
|
|
2225
|
+
var import_react17 = __toESM(require("react"));
|
|
2226
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2034
2227
|
var PhoneInput = (props) => {
|
|
2035
2228
|
const textChangeHandler = (event) => {
|
|
2036
2229
|
const text = event.target.value;
|
|
@@ -2049,13 +2242,13 @@ var PhoneInput = (props) => {
|
|
|
2049
2242
|
if (props.value !== void 0 && props.value !== null) {
|
|
2050
2243
|
value = props.value;
|
|
2051
2244
|
}
|
|
2052
|
-
return /* @__PURE__ */ (0,
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
2245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react17.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "block mb-1", children: [
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2054
2247
|
" ",
|
|
2055
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2248
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center rounded border ", children: [
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "px-3", children: props.prefix }),
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2059
2252
|
"input",
|
|
2060
2253
|
{
|
|
2061
2254
|
type: "text",
|
|
@@ -2073,14 +2266,14 @@ var PhoneInput = (props) => {
|
|
|
2073
2266
|
}
|
|
2074
2267
|
)
|
|
2075
2268
|
] }),
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__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 : "" })
|
|
2077
2270
|
] }) });
|
|
2078
2271
|
};
|
|
2079
2272
|
var PhoneInput_default = PhoneInput;
|
|
2080
2273
|
|
|
2081
2274
|
// src/components/controls/edit/NumberInput.tsx
|
|
2082
|
-
var
|
|
2083
|
-
var
|
|
2275
|
+
var import_react18 = __toESM(require("react"));
|
|
2276
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2084
2277
|
var NumberInput = (props) => {
|
|
2085
2278
|
const textChangeHandler = (event) => {
|
|
2086
2279
|
const text = event.target.value;
|
|
@@ -2103,11 +2296,11 @@ var NumberInput = (props) => {
|
|
|
2103
2296
|
if (props.value !== void 0 && props.value !== null) {
|
|
2104
2297
|
value = props.value;
|
|
2105
2298
|
}
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
2299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "block", children: [
|
|
2300
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
2108
2301
|
" ",
|
|
2109
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2111
2304
|
"input",
|
|
2112
2305
|
{
|
|
2113
2306
|
type: "number",
|
|
@@ -2126,14 +2319,14 @@ var NumberInput = (props) => {
|
|
|
2126
2319
|
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 "
|
|
2127
2320
|
}
|
|
2128
2321
|
),
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2130
2323
|
] }) });
|
|
2131
2324
|
};
|
|
2132
2325
|
var NumberInput_default = NumberInput;
|
|
2133
2326
|
|
|
2134
2327
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
2135
|
-
var
|
|
2136
|
-
var
|
|
2328
|
+
var import_react19 = __toESM(require("react"));
|
|
2329
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2137
2330
|
var CheckboxInput = (props) => {
|
|
2138
2331
|
const textChangeHandler = (event) => {
|
|
2139
2332
|
let text = event.target.checked;
|
|
@@ -2150,11 +2343,11 @@ var CheckboxInput = (props) => {
|
|
|
2150
2343
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
2151
2344
|
value = true;
|
|
2152
2345
|
}
|
|
2153
|
-
return /* @__PURE__ */ (0,
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react19.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: "inline-block mb-1", children: [
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2155
2348
|
" ",
|
|
2156
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2349
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2158
2351
|
"input",
|
|
2159
2352
|
{
|
|
2160
2353
|
type: "checkbox",
|
|
@@ -2171,14 +2364,14 @@ var CheckboxInput = (props) => {
|
|
|
2171
2364
|
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 "
|
|
2172
2365
|
}
|
|
2173
2366
|
),
|
|
2174
|
-
/* @__PURE__ */ (0,
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2175
2368
|
] }) });
|
|
2176
2369
|
};
|
|
2177
2370
|
var CheckboxInput_default = CheckboxInput;
|
|
2178
2371
|
|
|
2179
2372
|
// src/components/controls/edit/OtpInput.tsx
|
|
2180
|
-
var
|
|
2181
|
-
var
|
|
2373
|
+
var import_react20 = __toESM(require("react"));
|
|
2374
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2182
2375
|
var OtpInput = (props) => {
|
|
2183
2376
|
const textChangeHandler = (event) => {
|
|
2184
2377
|
const text = event.target.value;
|
|
@@ -2200,11 +2393,11 @@ var OtpInput = (props) => {
|
|
|
2200
2393
|
if (props.value !== void 0 && props.value !== null) {
|
|
2201
2394
|
value = props.value;
|
|
2202
2395
|
}
|
|
2203
|
-
return /* @__PURE__ */ (0,
|
|
2204
|
-
/* @__PURE__ */ (0,
|
|
2396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react20.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2205
2398
|
" ",
|
|
2206
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2207
|
-
/* @__PURE__ */ (0,
|
|
2399
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2208
2401
|
"input",
|
|
2209
2402
|
{
|
|
2210
2403
|
type: "text",
|
|
@@ -2224,14 +2417,14 @@ var OtpInput = (props) => {
|
|
|
2224
2417
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
2225
2418
|
}
|
|
2226
2419
|
),
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2420
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2228
2421
|
] }) });
|
|
2229
2422
|
};
|
|
2230
2423
|
var OtpInput_default = OtpInput;
|
|
2231
2424
|
|
|
2232
2425
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2233
|
-
var
|
|
2234
|
-
var
|
|
2426
|
+
var import_react21 = __toESM(require("react"));
|
|
2427
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2235
2428
|
var DateTimeInput = (props) => {
|
|
2236
2429
|
const textChangeHandler = (event) => {
|
|
2237
2430
|
const localDate = new Date(event.target.value);
|
|
@@ -2263,12 +2456,12 @@ var DateTimeInput = (props) => {
|
|
|
2263
2456
|
e.preventDefault();
|
|
2264
2457
|
}
|
|
2265
2458
|
};
|
|
2266
|
-
return /* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react21.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "block mb-1", children: [
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2268
2461
|
" ",
|
|
2269
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2462
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2272
2465
|
"input",
|
|
2273
2466
|
{
|
|
2274
2467
|
type: "datetime-local",
|
|
@@ -2286,19 +2479,19 @@ var DateTimeInput = (props) => {
|
|
|
2286
2479
|
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 "
|
|
2287
2480
|
}
|
|
2288
2481
|
),
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: timeZoneAbbr })
|
|
2290
2483
|
] }),
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2292
2485
|
] }) });
|
|
2293
2486
|
};
|
|
2294
2487
|
var DateTimeInput_default = DateTimeInput;
|
|
2295
2488
|
|
|
2296
2489
|
// src/components/controls/edit/ColorInput.tsx
|
|
2297
|
-
var
|
|
2298
|
-
var
|
|
2490
|
+
var import_react22 = __toESM(require("react"));
|
|
2491
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2299
2492
|
var ColorInput = (props) => {
|
|
2300
|
-
const [color, setColor] =
|
|
2301
|
-
(0,
|
|
2493
|
+
const [color, setColor] = import_react22.default.useState("#3b82f6");
|
|
2494
|
+
(0, import_react22.useEffect)(() => {
|
|
2302
2495
|
if (props.value !== void 0 && props.value !== null) {
|
|
2303
2496
|
if (typeof props.value === "string") {
|
|
2304
2497
|
setColor(props.value);
|
|
@@ -2317,11 +2510,11 @@ var ColorInput = (props) => {
|
|
|
2317
2510
|
});
|
|
2318
2511
|
}
|
|
2319
2512
|
};
|
|
2320
|
-
return /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "block mb-1", children: [
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2322
2515
|
" ",
|
|
2323
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2516
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2325
2518
|
"input",
|
|
2326
2519
|
{
|
|
2327
2520
|
type: "color",
|
|
@@ -2334,21 +2527,21 @@ var ColorInput = (props) => {
|
|
|
2334
2527
|
className: `w-[78px] h-12 block cursor-pointer`
|
|
2335
2528
|
}
|
|
2336
2529
|
),
|
|
2337
|
-
props?.attributes?.errorMessage && /* @__PURE__ */ (0,
|
|
2530
|
+
props?.attributes?.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1 bg-error-weak text-sm", children: props.attributes.errorMessage })
|
|
2338
2531
|
] });
|
|
2339
2532
|
};
|
|
2340
2533
|
var ColorInput_default = ColorInput;
|
|
2341
2534
|
|
|
2342
2535
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2343
|
-
var
|
|
2344
|
-
var
|
|
2536
|
+
var import_react23 = require("react");
|
|
2537
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2345
2538
|
var SelectWithSearchInput = (props) => {
|
|
2346
|
-
const [isOpen, setIsOpen] = (0,
|
|
2347
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2348
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2349
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2350
|
-
const [list, setList] = (0,
|
|
2351
|
-
(0,
|
|
2539
|
+
const [isOpen, setIsOpen] = (0, import_react23.useState)(false);
|
|
2540
|
+
const [searchTerm, setSearchTerm] = (0, import_react23.useState)("");
|
|
2541
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react23.useState)(-1);
|
|
2542
|
+
const [selectedItem, setSelectedItem] = (0, import_react23.useState)(null);
|
|
2543
|
+
const [list, setList] = (0, import_react23.useState)([]);
|
|
2544
|
+
(0, import_react23.useEffect)(() => {
|
|
2352
2545
|
async function fetchData() {
|
|
2353
2546
|
if (props.dataset) {
|
|
2354
2547
|
setList(props.dataset);
|
|
@@ -2402,8 +2595,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2402
2595
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2403
2596
|
}
|
|
2404
2597
|
};
|
|
2405
|
-
const dropdownRef = (0,
|
|
2406
|
-
(0,
|
|
2598
|
+
const dropdownRef = (0, import_react23.useRef)(null);
|
|
2599
|
+
(0, import_react23.useEffect)(() => {
|
|
2407
2600
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2408
2601
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2409
2602
|
highlightedItem?.scrollIntoView({
|
|
@@ -2412,15 +2605,15 @@ var SelectWithSearchInput = (props) => {
|
|
|
2412
2605
|
});
|
|
2413
2606
|
}
|
|
2414
2607
|
}, [highlightedIndex]);
|
|
2415
|
-
return /* @__PURE__ */ (0,
|
|
2416
|
-
/* @__PURE__ */ (0,
|
|
2608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2609
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { children: [
|
|
2417
2610
|
props.attributes?.label,
|
|
2418
2611
|
" ",
|
|
2419
2612
|
" ",
|
|
2420
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2613
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2421
2614
|
] }),
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2615
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2616
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2424
2617
|
"input",
|
|
2425
2618
|
{
|
|
2426
2619
|
type: "text",
|
|
@@ -2436,13 +2629,13 @@ var SelectWithSearchInput = (props) => {
|
|
|
2436
2629
|
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 "
|
|
2437
2630
|
}
|
|
2438
2631
|
),
|
|
2439
|
-
/* @__PURE__ */ (0,
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2440
2633
|
"button",
|
|
2441
2634
|
{
|
|
2442
2635
|
type: "button",
|
|
2443
2636
|
onClick: () => setIsOpen(!isOpen),
|
|
2444
2637
|
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
2445
|
-
children: /* @__PURE__ */ (0,
|
|
2638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2446
2639
|
"svg",
|
|
2447
2640
|
{
|
|
2448
2641
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2451,7 +2644,7 @@ var SelectWithSearchInput = (props) => {
|
|
|
2451
2644
|
strokeWidth: 1.5,
|
|
2452
2645
|
stroke: "currentColor",
|
|
2453
2646
|
className: "w-full h-full",
|
|
2454
|
-
children: /* @__PURE__ */ (0,
|
|
2647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2455
2648
|
"path",
|
|
2456
2649
|
{
|
|
2457
2650
|
strokeLinecap: "round",
|
|
@@ -2464,12 +2657,12 @@ var SelectWithSearchInput = (props) => {
|
|
|
2464
2657
|
}
|
|
2465
2658
|
)
|
|
2466
2659
|
] }),
|
|
2467
|
-
isOpen && /* @__PURE__ */ (0,
|
|
2660
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2468
2661
|
"div",
|
|
2469
2662
|
{
|
|
2470
2663
|
ref: dropdownRef,
|
|
2471
2664
|
className: "absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-48 overflow-y-auto",
|
|
2472
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2665
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2473
2666
|
"button",
|
|
2474
2667
|
{
|
|
2475
2668
|
onClick: (e) => handleSelect(e, item),
|
|
@@ -2477,10 +2670,10 @@ var SelectWithSearchInput = (props) => {
|
|
|
2477
2670
|
role: "option",
|
|
2478
2671
|
tabIndex: -1,
|
|
2479
2672
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2480
|
-
children: /* @__PURE__ */ (0,
|
|
2673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
2481
2674
|
},
|
|
2482
2675
|
item[props.dataKeyFieldName]
|
|
2483
|
-
)) : /* @__PURE__ */ (0,
|
|
2676
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2484
2677
|
}
|
|
2485
2678
|
)
|
|
2486
2679
|
] });
|
|
@@ -2489,22 +2682,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2489
2682
|
|
|
2490
2683
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2491
2684
|
init_Button();
|
|
2492
|
-
var
|
|
2493
|
-
var
|
|
2685
|
+
var import_react27 = __toESM(require("react"));
|
|
2686
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2494
2687
|
var SelectWithSearchPanel = (props) => {
|
|
2495
|
-
const [isOpen, setIsOpen] = (0,
|
|
2496
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2497
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2498
|
-
const [list, setList] = (0,
|
|
2499
|
-
const listRef = (0,
|
|
2500
|
-
const [isError, setIsError] = (0,
|
|
2501
|
-
const containerRef = (0,
|
|
2502
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
2503
|
-
const [formData, setFormData] = (0,
|
|
2688
|
+
const [isOpen, setIsOpen] = (0, import_react27.useState)(false);
|
|
2689
|
+
const [searchTerm, setSearchTerm] = (0, import_react27.useState)("");
|
|
2690
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react27.useState)(0);
|
|
2691
|
+
const [list, setList] = (0, import_react27.useState)([]);
|
|
2692
|
+
const listRef = (0, import_react27.useRef)(null);
|
|
2693
|
+
const [isError, setIsError] = (0, import_react27.useState)(false);
|
|
2694
|
+
const containerRef = (0, import_react27.useRef)(null);
|
|
2695
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react27.useState)(false);
|
|
2696
|
+
const [formData, setFormData] = (0, import_react27.useState)({});
|
|
2504
2697
|
const getNestedValue3 = (obj, path) => {
|
|
2505
2698
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2506
2699
|
};
|
|
2507
|
-
(0,
|
|
2700
|
+
(0, import_react27.useEffect)(() => {
|
|
2508
2701
|
const handleClickOutside = (event) => {
|
|
2509
2702
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2510
2703
|
setIsOpen(false);
|
|
@@ -2515,7 +2708,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2515
2708
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2516
2709
|
};
|
|
2517
2710
|
}, []);
|
|
2518
|
-
(0,
|
|
2711
|
+
(0, import_react27.useEffect)(() => {
|
|
2519
2712
|
async function fetchData() {
|
|
2520
2713
|
if (props.dataset) {
|
|
2521
2714
|
setList(props.dataset);
|
|
@@ -2557,7 +2750,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2557
2750
|
audioCtx.close();
|
|
2558
2751
|
}, 250);
|
|
2559
2752
|
};
|
|
2560
|
-
(0,
|
|
2753
|
+
(0, import_react27.useEffect)(() => {
|
|
2561
2754
|
const filteredItems2 = list?.filter(
|
|
2562
2755
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2563
2756
|
);
|
|
@@ -2622,18 +2815,18 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2622
2815
|
const handleInputChange = (event, field) => {
|
|
2623
2816
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2624
2817
|
};
|
|
2625
|
-
const handleSaveModal = (0,
|
|
2818
|
+
const handleSaveModal = (0, import_react27.useCallback)(async () => {
|
|
2626
2819
|
console.log("Form Data:", formData);
|
|
2627
2820
|
return formData;
|
|
2628
2821
|
}, []);
|
|
2629
|
-
return /* @__PURE__ */ (0,
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "relative", children: [
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "text-sm mb-1 font-medium", children: [
|
|
2631
2824
|
props.attributes?.label,
|
|
2632
2825
|
" ",
|
|
2633
2826
|
" ",
|
|
2634
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2827
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2635
2828
|
] }),
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2637
2830
|
"input",
|
|
2638
2831
|
{
|
|
2639
2832
|
type: "text",
|
|
@@ -2647,14 +2840,14 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2647
2840
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2648
2841
|
}
|
|
2649
2842
|
) }),
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2651
|
-
/* @__PURE__ */ (0,
|
|
2652
|
-
/* @__PURE__ */ (0,
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react27.default.Fragment, { children: [
|
|
2844
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
2653
2846
|
"Select a",
|
|
2654
2847
|
" ",
|
|
2655
2848
|
props.attributes?.label || props.attributes?.heading
|
|
2656
2849
|
] }) }),
|
|
2657
|
-
/* @__PURE__ */ (0,
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.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_runtime31.jsx)(
|
|
2658
2851
|
"button",
|
|
2659
2852
|
{
|
|
2660
2853
|
type: "button",
|
|
@@ -2667,12 +2860,12 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2667
2860
|
}
|
|
2668
2861
|
) })
|
|
2669
2862
|
] }),
|
|
2670
|
-
isCreateOpen && /* @__PURE__ */ (0,
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2863
|
+
isCreateOpen && /* @__PURE__ */ (0, import_jsx_runtime31.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: [
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("h5", { className: "text-md font-medium text-white", children: [
|
|
2672
2865
|
"Create New ",
|
|
2673
2866
|
props.attributes?.label
|
|
2674
2867
|
] }) }),
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2676
2869
|
"button",
|
|
2677
2870
|
{
|
|
2678
2871
|
type: "button",
|
|
@@ -2681,10 +2874,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2681
2874
|
children: "Close"
|
|
2682
2875
|
}
|
|
2683
2876
|
) }),
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2685
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0,
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "p-4", children: [
|
|
2878
|
+
props.createFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mb-4", children: [
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
|
|
2880
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2688
2881
|
"input",
|
|
2689
2882
|
{
|
|
2690
2883
|
type: field.type,
|
|
@@ -2700,7 +2893,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2700
2893
|
}
|
|
2701
2894
|
)
|
|
2702
2895
|
] }, field.name)),
|
|
2703
|
-
/* @__PURE__ */ (0,
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Button_default, { onClick: async () => {
|
|
2704
2897
|
handleSaveModal();
|
|
2705
2898
|
return { isSuccessful: true };
|
|
2706
2899
|
}, className: "w-full", children: [
|
|
@@ -2709,13 +2902,13 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2709
2902
|
] })
|
|
2710
2903
|
] })
|
|
2711
2904
|
] }),
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2713
2906
|
"div",
|
|
2714
2907
|
{
|
|
2715
2908
|
ref: listRef,
|
|
2716
2909
|
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",
|
|
2717
2910
|
style: { height: "calc(100vh - 130px)" },
|
|
2718
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2911
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2719
2912
|
"button",
|
|
2720
2913
|
{
|
|
2721
2914
|
onClick: (e) => {
|
|
@@ -2725,9 +2918,9 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2725
2918
|
role: "option",
|
|
2726
2919
|
tabIndex: -1,
|
|
2727
2920
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2728
|
-
children: /* @__PURE__ */ (0,
|
|
2921
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: getNestedValue3(item, props.dataTextFieldName) })
|
|
2729
2922
|
}
|
|
2730
|
-
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0,
|
|
2923
|
+
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2731
2924
|
}
|
|
2732
2925
|
)
|
|
2733
2926
|
] }) })
|
|
@@ -2736,10 +2929,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2736
2929
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2737
2930
|
|
|
2738
2931
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2739
|
-
var
|
|
2740
|
-
var
|
|
2932
|
+
var import_react28 = __toESM(require("react"));
|
|
2933
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2741
2934
|
var BooleanSelect = (props) => {
|
|
2742
|
-
const [list, setList] = (0,
|
|
2935
|
+
const [list, setList] = (0, import_react28.useState)();
|
|
2743
2936
|
const textChangeHandler = (event) => {
|
|
2744
2937
|
const text = event.target.value;
|
|
2745
2938
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2752,7 +2945,7 @@ var BooleanSelect = (props) => {
|
|
|
2752
2945
|
});
|
|
2753
2946
|
}
|
|
2754
2947
|
};
|
|
2755
|
-
(0,
|
|
2948
|
+
(0, import_react28.useEffect)(() => {
|
|
2756
2949
|
async function fetchData() {
|
|
2757
2950
|
console.log("in select");
|
|
2758
2951
|
if (props.dataset) {
|
|
@@ -2786,11 +2979,11 @@ var BooleanSelect = (props) => {
|
|
|
2786
2979
|
if (props.value !== void 0 && props.value !== null) {
|
|
2787
2980
|
value = props.value;
|
|
2788
2981
|
}
|
|
2789
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react28.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "block", children: [
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2791
2984
|
" ",
|
|
2792
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
2985
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2986
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2794
2987
|
"select",
|
|
2795
2988
|
{
|
|
2796
2989
|
name: props.name,
|
|
@@ -2802,9 +2995,9 @@ var BooleanSelect = (props) => {
|
|
|
2802
2995
|
disabled: props?.attributes?.readOnly,
|
|
2803
2996
|
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 ",
|
|
2804
2997
|
children: [
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
2806
2999
|
list && list.map((item, i) => {
|
|
2807
|
-
return /* @__PURE__ */ (0,
|
|
3000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2808
3001
|
"option",
|
|
2809
3002
|
{
|
|
2810
3003
|
className: "fac-select-option",
|
|
@@ -2817,14 +3010,14 @@ var BooleanSelect = (props) => {
|
|
|
2817
3010
|
]
|
|
2818
3011
|
}
|
|
2819
3012
|
),
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2821
3014
|
] }) });
|
|
2822
3015
|
};
|
|
2823
3016
|
var BooleanSelect_default = BooleanSelect;
|
|
2824
3017
|
|
|
2825
3018
|
// src/components/controls/edit/EmailInput.tsx
|
|
2826
|
-
var
|
|
2827
|
-
var
|
|
3019
|
+
var import_react29 = __toESM(require("react"));
|
|
3020
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2828
3021
|
var EmailInput = (props) => {
|
|
2829
3022
|
const textChangeHandler = (event) => {
|
|
2830
3023
|
const text = event.target.value;
|
|
@@ -2849,11 +3042,11 @@ var EmailInput = (props) => {
|
|
|
2849
3042
|
if (props.value !== void 0 && props.value !== null) {
|
|
2850
3043
|
value = props.value;
|
|
2851
3044
|
}
|
|
2852
|
-
return /* @__PURE__ */ (0,
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
3045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "block mb-1", children: [
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
2854
3047
|
" ",
|
|
2855
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
3048
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2857
3050
|
"input",
|
|
2858
3051
|
{
|
|
2859
3052
|
type: "email",
|
|
@@ -2869,14 +3062,14 @@ var EmailInput = (props) => {
|
|
|
2869
3062
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
2870
3063
|
}
|
|
2871
3064
|
),
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.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 : "" })
|
|
2873
3066
|
] }) });
|
|
2874
3067
|
};
|
|
2875
3068
|
var EmailInput_default = EmailInput;
|
|
2876
3069
|
|
|
2877
3070
|
// src/components/controls/edit/TimeInput.tsx
|
|
2878
|
-
var
|
|
2879
|
-
var
|
|
3071
|
+
var import_react30 = __toESM(require("react"));
|
|
3072
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2880
3073
|
var TimeInput = (props) => {
|
|
2881
3074
|
const timeChangeHandler = (event) => {
|
|
2882
3075
|
const timeValue = event.target.value;
|
|
@@ -2889,11 +3082,11 @@ var TimeInput = (props) => {
|
|
|
2889
3082
|
});
|
|
2890
3083
|
}
|
|
2891
3084
|
};
|
|
2892
|
-
return /* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
3085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react30.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "block mb-1", children: [
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2894
3087
|
" ",
|
|
2895
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
3088
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2897
3090
|
"input",
|
|
2898
3091
|
{
|
|
2899
3092
|
type: "time",
|
|
@@ -2906,41 +3099,20 @@ var TimeInput = (props) => {
|
|
|
2906
3099
|
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"
|
|
2907
3100
|
}
|
|
2908
3101
|
) }),
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
2910
3103
|
] }) });
|
|
2911
3104
|
};
|
|
2912
3105
|
var TimeInput_default = TimeInput;
|
|
2913
3106
|
|
|
2914
3107
|
// src/components/controls/edit/AssetUpload.tsx
|
|
2915
|
-
var
|
|
3108
|
+
var import_react31 = __toESM(require("react"));
|
|
2916
3109
|
init_ClientButton();
|
|
2917
3110
|
init_StyleTypes();
|
|
2918
3111
|
|
|
2919
|
-
// src/components/utilities/AssetUtility.tsx
|
|
2920
|
-
var AssetUtility = class {
|
|
2921
|
-
constructor() {
|
|
2922
|
-
}
|
|
2923
|
-
static resolveUrl(assetBaseUrl, url) {
|
|
2924
|
-
if (!url) return void 0;
|
|
2925
|
-
if (url.startsWith("http")) return url;
|
|
2926
|
-
if (!assetBaseUrl) return url;
|
|
2927
|
-
return `${assetBaseUrl}/${url}`;
|
|
2928
|
-
}
|
|
2929
|
-
// static getAssetUrl(apiBaseUrl: string) {
|
|
2930
|
-
// let domainName = apiBaseUrl.replace("https://", "");
|
|
2931
|
-
// return `https://cdn.g-assets.com/${domainName}`;
|
|
2932
|
-
// }
|
|
2933
|
-
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
2934
|
-
const domainName = apiBaseUrl.replace("https://", "");
|
|
2935
|
-
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
2936
|
-
}
|
|
2937
|
-
};
|
|
2938
|
-
var AssetUtility_default = AssetUtility;
|
|
2939
|
-
|
|
2940
3112
|
// src/components/dataForm/Hyperlink.tsx
|
|
2941
3113
|
var import_link = __toESM(require("next/link"));
|
|
2942
3114
|
init_StyleTypes();
|
|
2943
|
-
var
|
|
3115
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2944
3116
|
function Hyperlink(props) {
|
|
2945
3117
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : buttonClasses.get("Link" /* Link */);
|
|
2946
3118
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -2948,7 +3120,7 @@ function Hyperlink(props) {
|
|
|
2948
3120
|
if (target == "_blank") {
|
|
2949
3121
|
additionalProps.rel = "noopener noreferrer";
|
|
2950
3122
|
}
|
|
2951
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: props.href ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2952
3124
|
import_link.default,
|
|
2953
3125
|
{
|
|
2954
3126
|
href: props.href,
|
|
@@ -2958,34 +3130,34 @@ function Hyperlink(props) {
|
|
|
2958
3130
|
target,
|
|
2959
3131
|
children: props.children
|
|
2960
3132
|
}
|
|
2961
|
-
) : props.isHeading ? /* @__PURE__ */ (0,
|
|
3133
|
+
) : props.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: props.className, children: props.children }) });
|
|
2962
3134
|
}
|
|
2963
3135
|
|
|
2964
3136
|
// src/svg/chevron-updown.tsx
|
|
2965
|
-
var
|
|
3137
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2966
3138
|
var ChevronUpDown = (props) => {
|
|
2967
|
-
return /* @__PURE__ */ (0,
|
|
3139
|
+
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: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) });
|
|
2968
3140
|
};
|
|
2969
3141
|
var chevron_updown_default = ChevronUpDown;
|
|
2970
3142
|
|
|
2971
3143
|
// src/svg/chevron-down.tsx
|
|
2972
|
-
var
|
|
3144
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2973
3145
|
var ChevronDown = (props) => {
|
|
2974
|
-
return /* @__PURE__ */ (0,
|
|
3146
|
+
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: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) });
|
|
2975
3147
|
};
|
|
2976
3148
|
var chevron_down_default = ChevronDown;
|
|
2977
3149
|
|
|
2978
3150
|
// src/svg/chevron-up.tsx
|
|
2979
|
-
var
|
|
3151
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2980
3152
|
var ChevronUp = (props) => {
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
3153
|
+
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: "M4.5 15.75l7.5-7.5 7.5 7.5" }) });
|
|
2982
3154
|
};
|
|
2983
3155
|
var chevron_up_default = ChevronUp;
|
|
2984
3156
|
|
|
2985
3157
|
// src/svg/plus.tsx
|
|
2986
|
-
var
|
|
3158
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2987
3159
|
var Plus = (props) => {
|
|
2988
|
-
return /* @__PURE__ */ (0,
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.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_runtime39.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) });
|
|
2989
3161
|
};
|
|
2990
3162
|
var plus_default = Plus;
|
|
2991
3163
|
|
|
@@ -2999,19 +3171,19 @@ var Icons = {
|
|
|
2999
3171
|
var Icons_default = Icons;
|
|
3000
3172
|
|
|
3001
3173
|
// src/svg/Icon.tsx
|
|
3002
|
-
var
|
|
3174
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3003
3175
|
var Icon = ({ name, className, ...props }) => {
|
|
3004
3176
|
const IconComponent = Icons_default[name];
|
|
3005
3177
|
if (!IconComponent) {
|
|
3006
3178
|
console.error(`Icon "${name}" not found.`);
|
|
3007
3179
|
return null;
|
|
3008
3180
|
}
|
|
3009
|
-
return /* @__PURE__ */ (0,
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconComponent, { ...props, className });
|
|
3010
3182
|
};
|
|
3011
3183
|
var Icon_default = Icon;
|
|
3012
3184
|
|
|
3013
3185
|
// src/components/controls/edit/AssetUpload.tsx
|
|
3014
|
-
var
|
|
3186
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3015
3187
|
var AssetUpload = (props) => {
|
|
3016
3188
|
const isDisabled = props.attributes?.disable ?? false;
|
|
3017
3189
|
let allValues = [];
|
|
@@ -3032,8 +3204,8 @@ var AssetUpload = (props) => {
|
|
|
3032
3204
|
}
|
|
3033
3205
|
return "image";
|
|
3034
3206
|
};
|
|
3035
|
-
const [assetType, setAssetType] =
|
|
3036
|
-
(0,
|
|
3207
|
+
const [assetType, setAssetType] = import_react31.default.useState(getInitialTab);
|
|
3208
|
+
(0, import_react31.useEffect)(() => {
|
|
3037
3209
|
setAssetType(getInitialTab());
|
|
3038
3210
|
}, [props.value]);
|
|
3039
3211
|
const assetUploadCallback = (newAsset) => {
|
|
@@ -3108,10 +3280,10 @@ var AssetUpload = (props) => {
|
|
|
3108
3280
|
}
|
|
3109
3281
|
return false;
|
|
3110
3282
|
};
|
|
3111
|
-
return /* @__PURE__ */ (0,
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react31.default.Fragment, { children: [
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { className: "block mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
|
|
3286
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3115
3287
|
ClientButton_default,
|
|
3116
3288
|
{
|
|
3117
3289
|
className: assetType === "image" ? "px-2 py-1 rounded bg-body-200 scale-95" : "text-neutral-700",
|
|
@@ -3121,7 +3293,7 @@ var AssetUpload = (props) => {
|
|
|
3121
3293
|
children: "Image Upload"
|
|
3122
3294
|
}
|
|
3123
3295
|
),
|
|
3124
|
-
/* @__PURE__ */ (0,
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3125
3297
|
ClientButton_default,
|
|
3126
3298
|
{
|
|
3127
3299
|
className: assetType === "video" ? "bg-body-200 px-2 py-1 rounded-md scale-95" : "text-neutral-700",
|
|
@@ -3132,13 +3304,13 @@ var AssetUpload = (props) => {
|
|
|
3132
3304
|
}
|
|
3133
3305
|
)
|
|
3134
3306
|
] }),
|
|
3135
|
-
shouldShowDetails() && /* @__PURE__ */ (0,
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3141
|
-
/* @__PURE__ */ (0,
|
|
3307
|
+
shouldShowDetails() && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative mt-4 rounded-md p-4 border-2 border-dotted border-gray-300 bg-gray-50", children: [
|
|
3308
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "absolute -top-2.5 left-3 bg-primary-600 text-white text-xs px-2 py-0.5 rounded-full", children: getAssetType(allValues[0]) === "video" ? "Video" : "Image" }),
|
|
3309
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex flex-col gap-3", children: allValues.map((digitalAsset, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-between items-start gap-5", children: [
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "grid grid-cols-2 gap-x-8 gap-y-3 text-sm w-full", children: [
|
|
3311
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
3312
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-gray-500", children: "Title" }),
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3142
3314
|
"input",
|
|
3143
3315
|
{
|
|
3144
3316
|
type: "text",
|
|
@@ -3150,18 +3322,18 @@ var AssetUpload = (props) => {
|
|
|
3150
3322
|
}
|
|
3151
3323
|
)
|
|
3152
3324
|
] }),
|
|
3153
|
-
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0,
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3325
|
+
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
3326
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-gray-500", children: "Resolution" }),
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "font-medium text-gray-900 mt-3", children: [
|
|
3156
3328
|
digitalAsset.intrinsicWidth,
|
|
3157
3329
|
"\xD7",
|
|
3158
3330
|
digitalAsset.intrinsicHeight
|
|
3159
3331
|
] })
|
|
3160
3332
|
] }),
|
|
3161
|
-
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0,
|
|
3162
|
-
/* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ (0,
|
|
3333
|
+
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
3334
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-gray-500", children: "Image / Poster" }),
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-shrink-0 flex flex-col gap-3 mt-1", children: [
|
|
3336
|
+
getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3165
3337
|
"img",
|
|
3166
3338
|
{
|
|
3167
3339
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.posterUrl),
|
|
@@ -3169,7 +3341,7 @@ var AssetUpload = (props) => {
|
|
|
3169
3341
|
className: "w-32 h-auto object-cover rounded border p-1"
|
|
3170
3342
|
}
|
|
3171
3343
|
),
|
|
3172
|
-
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0,
|
|
3344
|
+
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3173
3345
|
"img",
|
|
3174
3346
|
{
|
|
3175
3347
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.assetUrl),
|
|
@@ -3179,9 +3351,9 @@ var AssetUpload = (props) => {
|
|
|
3179
3351
|
)
|
|
3180
3352
|
] })
|
|
3181
3353
|
] }),
|
|
3182
|
-
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0,
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3354
|
+
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "col-span-2", children: [
|
|
3355
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-gray-500", children: "HLS Link" }),
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3185
3357
|
Hyperlink,
|
|
3186
3358
|
{
|
|
3187
3359
|
href: digitalAsset.assetUrl,
|
|
@@ -3192,12 +3364,12 @@ var AssetUpload = (props) => {
|
|
|
3192
3364
|
)
|
|
3193
3365
|
] })
|
|
3194
3366
|
] }),
|
|
3195
|
-
/* @__PURE__ */ (0,
|
|
3367
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3196
3368
|
"span",
|
|
3197
3369
|
{
|
|
3198
3370
|
onClick: () => !isDisabled && deleteFile(index),
|
|
3199
3371
|
className: isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
3200
|
-
children: /* @__PURE__ */ (0,
|
|
3372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon_default, { className: "w-4 h-4 text-primary", name: "delete" })
|
|
3201
3373
|
}
|
|
3202
3374
|
)
|
|
3203
3375
|
] }, index)) })
|
|
@@ -3207,8 +3379,8 @@ var AssetUpload = (props) => {
|
|
|
3207
3379
|
var AssetUpload_default = AssetUpload;
|
|
3208
3380
|
|
|
3209
3381
|
// src/components/controls/edit/InputControl.tsx
|
|
3210
|
-
var
|
|
3211
|
-
var InputControl =
|
|
3382
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3383
|
+
var InputControl = import_react32.default.forwardRef(
|
|
3212
3384
|
(props, ref) => {
|
|
3213
3385
|
const ControlComponents = {
|
|
3214
3386
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -3230,7 +3402,7 @@ var InputControl = import_react31.default.forwardRef(
|
|
|
3230
3402
|
[InputControlType_default.asset]: AssetUpload_default
|
|
3231
3403
|
};
|
|
3232
3404
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
3233
|
-
return /* @__PURE__ */ (0,
|
|
3405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react32.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
3234
3406
|
}
|
|
3235
3407
|
);
|
|
3236
3408
|
InputControl.displayName = "InputControl";
|
|
@@ -3243,7 +3415,7 @@ var import_react50 = __toESM(require("react"));
|
|
|
3243
3415
|
var import_react36 = __toESM(require("react"));
|
|
3244
3416
|
|
|
3245
3417
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3246
|
-
var
|
|
3418
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3247
3419
|
var TextNode = (props) => {
|
|
3248
3420
|
function cssStringToJson(cssString) {
|
|
3249
3421
|
const styleObject = {};
|
|
@@ -3298,26 +3470,26 @@ var TextNode = (props) => {
|
|
|
3298
3470
|
});
|
|
3299
3471
|
}
|
|
3300
3472
|
function renderWithLineBreaks(text) {
|
|
3301
|
-
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0,
|
|
3473
|
+
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
3302
3474
|
line,
|
|
3303
|
-
index < arr.length - 1 && /* @__PURE__ */ (0,
|
|
3475
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("br", {})
|
|
3304
3476
|
] }, index));
|
|
3305
3477
|
}
|
|
3306
3478
|
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
3307
3479
|
const finalText = props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text;
|
|
3308
3480
|
const content = typeof finalText === "string" ? renderWithLineBreaks(finalText) : finalText;
|
|
3309
|
-
const formattedContent = props.node.format & 64 ? /* @__PURE__ */ (0,
|
|
3481
|
+
const formattedContent = props.node.format & 64 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("sup", { children: content }) : props.node.format & 32 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("sub", { children: content }) : content;
|
|
3310
3482
|
return (
|
|
3311
3483
|
// @ts-expect-error custom code
|
|
3312
|
-
/* @__PURE__ */ (0,
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: formattedContent })
|
|
3313
3485
|
);
|
|
3314
3486
|
};
|
|
3315
3487
|
var TextNode_default = TextNode;
|
|
3316
3488
|
|
|
3317
3489
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
3318
|
-
var
|
|
3490
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3319
3491
|
var LineBreakNode = () => {
|
|
3320
|
-
return /* @__PURE__ */ (0,
|
|
3492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
3321
3493
|
};
|
|
3322
3494
|
var LineBreakNode_default = LineBreakNode;
|
|
3323
3495
|
|
|
@@ -3327,128 +3499,7 @@ var import_react35 = __toESM(require("react"));
|
|
|
3327
3499
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3328
3500
|
var import_react33 = __toESM(require("react"));
|
|
3329
3501
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
3330
|
-
|
|
3331
|
-
// src/components/DeviceAssetSelector.tsx
|
|
3332
|
-
init_HlsPlayer();
|
|
3333
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3334
|
-
var DeviceAssetSelector = ({
|
|
3335
|
-
assets,
|
|
3336
|
-
assetBaseUrl,
|
|
3337
|
-
session,
|
|
3338
|
-
// This should receive the session
|
|
3339
|
-
width,
|
|
3340
|
-
tag,
|
|
3341
|
-
customProps,
|
|
3342
|
-
nodeProps,
|
|
3343
|
-
device
|
|
3344
|
-
}) => {
|
|
3345
|
-
console.log("\u{1F511} Session in DeviceAssetSelector:", session);
|
|
3346
|
-
const targetTag = tag || nodeProps?.tag;
|
|
3347
|
-
const selectAssetByDevice = (assets2, currentDevice) => {
|
|
3348
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
3349
|
-
const exactMatch = assets2.find((asset) => asset.device === currentDevice);
|
|
3350
|
-
if (exactMatch) return exactMatch;
|
|
3351
|
-
const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
|
|
3352
|
-
if (noDeviceMatch) return noDeviceMatch;
|
|
3353
|
-
return void 0;
|
|
3354
|
-
};
|
|
3355
|
-
const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
|
|
3356
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
3357
|
-
if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
|
|
3358
|
-
const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
|
|
3359
|
-
if (taggedAssets.length === 0) {
|
|
3360
|
-
return selectAssetByDevice(assets2, currentDevice);
|
|
3361
|
-
}
|
|
3362
|
-
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
3363
|
-
if (exactTaggedMatch) return exactTaggedMatch;
|
|
3364
|
-
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
3365
|
-
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
3366
|
-
return void 0;
|
|
3367
|
-
};
|
|
3368
|
-
const selectAsset = () => {
|
|
3369
|
-
if (!assets || assets.length === 0) return void 0;
|
|
3370
|
-
if (targetTag) {
|
|
3371
|
-
return selectAssetByTagAndDevice(assets, device, targetTag);
|
|
3372
|
-
}
|
|
3373
|
-
return selectAssetByDevice(assets, device);
|
|
3374
|
-
};
|
|
3375
|
-
const selectedAsset = selectAsset();
|
|
3376
|
-
if (!selectedAsset) {
|
|
3377
|
-
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
3378
|
-
return null;
|
|
3379
|
-
}
|
|
3380
|
-
const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
|
|
3381
|
-
const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
|
|
3382
|
-
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
3383
|
-
const title = selectedAsset.title || nodeProps?.title;
|
|
3384
|
-
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
3385
|
-
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
3386
|
-
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
3387
|
-
const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
|
|
3388
|
-
const loop = customProps?.loop ?? nodeProps?.loop === "true";
|
|
3389
|
-
const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
|
|
3390
|
-
const styles = {};
|
|
3391
|
-
if (nodeProps?.height) {
|
|
3392
|
-
styles.height = nodeProps.height;
|
|
3393
|
-
}
|
|
3394
|
-
if (nodeProps?.borderRadius) {
|
|
3395
|
-
styles.borderRadius = nodeProps.borderRadius;
|
|
3396
|
-
}
|
|
3397
|
-
if (nodeProps?.width) {
|
|
3398
|
-
styles.width = nodeProps.width;
|
|
3399
|
-
}
|
|
3400
|
-
const FormatClass = {
|
|
3401
|
-
"center": "justify-center",
|
|
3402
|
-
"left": "justify-start",
|
|
3403
|
-
"right": "justify-end"
|
|
3404
|
-
};
|
|
3405
|
-
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3406
|
-
const renderMedia = () => {
|
|
3407
|
-
if (isHls) {
|
|
3408
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3409
|
-
HlsPlayer_default,
|
|
3410
|
-
{
|
|
3411
|
-
assetUrl: resolvedAssetUrl,
|
|
3412
|
-
posterUrl: resolvedThumbnailUrl,
|
|
3413
|
-
intrinsicWidth,
|
|
3414
|
-
intrinsicHeight,
|
|
3415
|
-
showControls,
|
|
3416
|
-
loop,
|
|
3417
|
-
playOptions,
|
|
3418
|
-
apiBaseUrl: assetBaseUrl,
|
|
3419
|
-
session
|
|
3420
|
-
}
|
|
3421
|
-
);
|
|
3422
|
-
} else {
|
|
3423
|
-
return (
|
|
3424
|
-
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3425
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3426
|
-
"img",
|
|
3427
|
-
{
|
|
3428
|
-
style: styles,
|
|
3429
|
-
loading: "lazy",
|
|
3430
|
-
className: "object-cover w-full",
|
|
3431
|
-
src: resolvedAssetUrl,
|
|
3432
|
-
width: selectedAsset.intrinsicWidth,
|
|
3433
|
-
alt: title || "Asset image",
|
|
3434
|
-
height: selectedAsset.intrinsicHeight
|
|
3435
|
-
}
|
|
3436
|
-
)
|
|
3437
|
-
);
|
|
3438
|
-
}
|
|
3439
|
-
};
|
|
3440
|
-
if (width) {
|
|
3441
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3442
|
-
}
|
|
3443
|
-
if (nodeProps?.format) {
|
|
3444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3445
|
-
}
|
|
3446
|
-
return renderMedia();
|
|
3447
|
-
};
|
|
3448
|
-
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3449
|
-
|
|
3450
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3451
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3502
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3452
3503
|
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3453
3504
|
ssr: false
|
|
3454
3505
|
});
|
|
@@ -3491,7 +3542,7 @@ var ImageNode = (props) => {
|
|
|
3491
3542
|
console.error("Error parsing assets in ImageNode:", error);
|
|
3492
3543
|
}
|
|
3493
3544
|
if (assets && assets.length > 0) {
|
|
3494
|
-
return /* @__PURE__ */ (0,
|
|
3545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3495
3546
|
DeviceAssetSelector_default,
|
|
3496
3547
|
{
|
|
3497
3548
|
device: props.device,
|
|
@@ -3540,7 +3591,7 @@ var ImageNode = (props) => {
|
|
|
3540
3591
|
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3541
3592
|
const renderMedia = () => {
|
|
3542
3593
|
if (isHls) {
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
3594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3544
3595
|
HlsPlayer2,
|
|
3545
3596
|
{
|
|
3546
3597
|
assetUrl: imageUrl,
|
|
@@ -3555,7 +3606,7 @@ var ImageNode = (props) => {
|
|
|
3555
3606
|
}
|
|
3556
3607
|
);
|
|
3557
3608
|
} else {
|
|
3558
|
-
return /* @__PURE__ */ (0,
|
|
3609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3559
3610
|
"img",
|
|
3560
3611
|
{
|
|
3561
3612
|
style: styles,
|
|
@@ -3570,7 +3621,7 @@ var ImageNode = (props) => {
|
|
|
3570
3621
|
}
|
|
3571
3622
|
};
|
|
3572
3623
|
if (props.node.width) {
|
|
3573
|
-
return /* @__PURE__ */ (0,
|
|
3624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3574
3625
|
}
|
|
3575
3626
|
return renderMedia();
|
|
3576
3627
|
};
|
|
@@ -3579,7 +3630,7 @@ var ImageNode_default = ImageNode;
|
|
|
3579
3630
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3580
3631
|
init_StyleTypes();
|
|
3581
3632
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
3582
|
-
var
|
|
3633
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3583
3634
|
var LinkNodeButton2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3584
3635
|
ssr: false
|
|
3585
3636
|
});
|
|
@@ -3626,13 +3677,13 @@ var LinkNode = (props) => {
|
|
|
3626
3677
|
const isButton = node.isButton === true;
|
|
3627
3678
|
const renderChildren = () => {
|
|
3628
3679
|
if (!node.children || node.children.length === 0) return null;
|
|
3629
|
-
return /* @__PURE__ */ (0,
|
|
3680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: node.children.map((childNode, index) => {
|
|
3630
3681
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3631
3682
|
if (!SelectedNode) {
|
|
3632
3683
|
console.warn("Unknown node type:", childNode.type);
|
|
3633
3684
|
return null;
|
|
3634
3685
|
}
|
|
3635
|
-
return /* @__PURE__ */ (0,
|
|
3686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react35.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3636
3687
|
SelectedNode,
|
|
3637
3688
|
{
|
|
3638
3689
|
node: childNode,
|
|
@@ -3645,15 +3696,15 @@ var LinkNode = (props) => {
|
|
|
3645
3696
|
};
|
|
3646
3697
|
const renderFallback = () => {
|
|
3647
3698
|
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3648
|
-
return /* @__PURE__ */ (0,
|
|
3699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: linkText });
|
|
3649
3700
|
}
|
|
3650
3701
|
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3651
|
-
return /* @__PURE__ */ (0,
|
|
3702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("br", {});
|
|
3652
3703
|
}
|
|
3653
3704
|
return null;
|
|
3654
3705
|
};
|
|
3655
3706
|
if (isButton) {
|
|
3656
|
-
return /* @__PURE__ */ (0,
|
|
3707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3657
3708
|
LinkNodeButton2,
|
|
3658
3709
|
{
|
|
3659
3710
|
node,
|
|
@@ -3671,7 +3722,7 @@ var LinkNode = (props) => {
|
|
|
3671
3722
|
}
|
|
3672
3723
|
);
|
|
3673
3724
|
}
|
|
3674
|
-
return /* @__PURE__ */ (0,
|
|
3725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3675
3726
|
Hyperlink,
|
|
3676
3727
|
{
|
|
3677
3728
|
href: linkUrl || "#",
|
|
@@ -3687,10 +3738,10 @@ var LinkNode = (props) => {
|
|
|
3687
3738
|
var LinkNode_default = LinkNode;
|
|
3688
3739
|
|
|
3689
3740
|
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3690
|
-
var
|
|
3741
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3691
3742
|
var SVGIconNode = ({ node }) => {
|
|
3692
3743
|
if (!node?.svgCode) return null;
|
|
3693
|
-
return /* @__PURE__ */ (0,
|
|
3744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3694
3745
|
"span",
|
|
3695
3746
|
{
|
|
3696
3747
|
style: {
|
|
@@ -3707,7 +3758,7 @@ var SVGIconNode_default = SVGIconNode;
|
|
|
3707
3758
|
|
|
3708
3759
|
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3709
3760
|
var import_katex = __toESM(require("katex"));
|
|
3710
|
-
var
|
|
3761
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3711
3762
|
var EquationNode = ({ node }) => {
|
|
3712
3763
|
const { equation, inline } = node;
|
|
3713
3764
|
let html = "";
|
|
@@ -3722,7 +3773,7 @@ var EquationNode = ({ node }) => {
|
|
|
3722
3773
|
});
|
|
3723
3774
|
}
|
|
3724
3775
|
if (inline) {
|
|
3725
|
-
return /* @__PURE__ */ (0,
|
|
3776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3726
3777
|
"span",
|
|
3727
3778
|
{
|
|
3728
3779
|
className: "katex-inline",
|
|
@@ -3730,7 +3781,7 @@ var EquationNode = ({ node }) => {
|
|
|
3730
3781
|
}
|
|
3731
3782
|
);
|
|
3732
3783
|
}
|
|
3733
|
-
return /* @__PURE__ */ (0,
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3734
3785
|
"div",
|
|
3735
3786
|
{
|
|
3736
3787
|
className: "katex-block my-3 text-center",
|
|
@@ -3741,7 +3792,7 @@ var EquationNode = ({ node }) => {
|
|
|
3741
3792
|
var EquationNode_default = EquationNode;
|
|
3742
3793
|
|
|
3743
3794
|
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3744
|
-
var
|
|
3795
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3745
3796
|
function getNestedProperty(obj, path) {
|
|
3746
3797
|
if (!obj || !path) return null;
|
|
3747
3798
|
if (path.includes(".")) {
|
|
@@ -3754,7 +3805,7 @@ function getNestedProperty(obj, path) {
|
|
|
3754
3805
|
}
|
|
3755
3806
|
const value = obj[path];
|
|
3756
3807
|
if (Array.isArray(value)) {
|
|
3757
|
-
return value.map((item, index) => /* @__PURE__ */ (0,
|
|
3808
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children: String(item) }, index));
|
|
3758
3809
|
}
|
|
3759
3810
|
return value;
|
|
3760
3811
|
}
|
|
@@ -3815,7 +3866,7 @@ var DatafieldNode = (props) => {
|
|
|
3815
3866
|
const dataType = props.node.dataType;
|
|
3816
3867
|
if (isEmptyValue) return null;
|
|
3817
3868
|
if (dataType === "rawContent") {
|
|
3818
|
-
return /* @__PURE__ */ (0,
|
|
3869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3819
3870
|
PageBodyRenderer_default,
|
|
3820
3871
|
{
|
|
3821
3872
|
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
@@ -3831,12 +3882,12 @@ var DatafieldNode = (props) => {
|
|
|
3831
3882
|
}
|
|
3832
3883
|
);
|
|
3833
3884
|
}
|
|
3834
|
-
return /* @__PURE__ */ (0,
|
|
3885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3835
3886
|
"span",
|
|
3836
3887
|
{
|
|
3837
3888
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
3838
3889
|
style: styles,
|
|
3839
|
-
children: /* @__PURE__ */ (0,
|
|
3890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3840
3891
|
ViewControl_default,
|
|
3841
3892
|
{
|
|
3842
3893
|
controlType: dataType,
|
|
@@ -3849,7 +3900,7 @@ var DatafieldNode = (props) => {
|
|
|
3849
3900
|
var DatafieldNode_default = DatafieldNode;
|
|
3850
3901
|
|
|
3851
3902
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3852
|
-
var
|
|
3903
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3853
3904
|
var ParagraphNode = (props) => {
|
|
3854
3905
|
const NodeTypes2 = {
|
|
3855
3906
|
["text"]: TextNode_default,
|
|
@@ -3869,9 +3920,9 @@ var ParagraphNode = (props) => {
|
|
|
3869
3920
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
3870
3921
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
3871
3922
|
if (isInlineOnlyParent) {
|
|
3872
|
-
return /* @__PURE__ */ (0,
|
|
3923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3873
3924
|
const SelectedNode = NodeTypes2[node.type];
|
|
3874
|
-
return /* @__PURE__ */ (0,
|
|
3925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3875
3926
|
SelectedNode,
|
|
3876
3927
|
{
|
|
3877
3928
|
node,
|
|
@@ -3883,10 +3934,10 @@ var ParagraphNode = (props) => {
|
|
|
3883
3934
|
) }, index);
|
|
3884
3935
|
}) });
|
|
3885
3936
|
}
|
|
3886
|
-
return /* @__PURE__ */ (0,
|
|
3937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3887
3938
|
hasChildren && props.node.children.map((node, index) => {
|
|
3888
3939
|
const SelectedNode = NodeTypes2[node.type];
|
|
3889
|
-
return /* @__PURE__ */ (0,
|
|
3940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3890
3941
|
SelectedNode,
|
|
3891
3942
|
{
|
|
3892
3943
|
node,
|
|
@@ -3897,14 +3948,14 @@ var ParagraphNode = (props) => {
|
|
|
3897
3948
|
}
|
|
3898
3949
|
) }, index);
|
|
3899
3950
|
}),
|
|
3900
|
-
!hasChildren && /* @__PURE__ */ (0,
|
|
3951
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
3901
3952
|
] });
|
|
3902
3953
|
};
|
|
3903
3954
|
var ParagraphNode_default = ParagraphNode;
|
|
3904
3955
|
|
|
3905
3956
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3906
3957
|
var import_react37 = __toESM(require("react"));
|
|
3907
|
-
var
|
|
3958
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3908
3959
|
var HeadingNode = (props) => {
|
|
3909
3960
|
const NodeTypes2 = {
|
|
3910
3961
|
["text"]: TextNode_default,
|
|
@@ -3920,12 +3971,12 @@ var HeadingNode = (props) => {
|
|
|
3920
3971
|
{
|
|
3921
3972
|
}
|
|
3922
3973
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3923
|
-
return /* @__PURE__ */ (0,
|
|
3974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: import_react37.default.createElement(
|
|
3924
3975
|
HeadingTag,
|
|
3925
3976
|
{ className: formatClasses },
|
|
3926
3977
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3927
3978
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3928
|
-
return /* @__PURE__ */ (0,
|
|
3979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3929
3980
|
})
|
|
3930
3981
|
) });
|
|
3931
3982
|
};
|
|
@@ -3936,7 +3987,7 @@ var import_react39 = __toESM(require("react"));
|
|
|
3936
3987
|
|
|
3937
3988
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3938
3989
|
var import_react38 = __toESM(require("react"));
|
|
3939
|
-
var
|
|
3990
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3940
3991
|
var ListItemNode = (props) => {
|
|
3941
3992
|
const NodeTypes2 = {
|
|
3942
3993
|
text: TextNode_default,
|
|
@@ -3953,37 +4004,37 @@ var ListItemNode = (props) => {
|
|
|
3953
4004
|
liStyle.fontSize = match[1].trim();
|
|
3954
4005
|
}
|
|
3955
4006
|
}
|
|
3956
|
-
return /* @__PURE__ */ (0,
|
|
4007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
3957
4008
|
const SelectedNode = NodeTypes2[node.type];
|
|
3958
4009
|
if (node.type === "linebreak") {
|
|
3959
4010
|
if (!foundFirstBreak) {
|
|
3960
4011
|
foundFirstBreak = true;
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {}, index);
|
|
3962
4013
|
} else {
|
|
3963
|
-
return /* @__PURE__ */ (0,
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
3964
4015
|
}
|
|
3965
4016
|
} else {
|
|
3966
4017
|
foundFirstBreak = false;
|
|
3967
|
-
return /* @__PURE__ */ (0,
|
|
4018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3968
4019
|
}
|
|
3969
4020
|
}) });
|
|
3970
4021
|
};
|
|
3971
4022
|
var ListItemNode_default = ListItemNode;
|
|
3972
4023
|
|
|
3973
4024
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3974
|
-
var
|
|
4025
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3975
4026
|
var ListNode = (props) => {
|
|
3976
4027
|
const NodeTypes2 = {
|
|
3977
4028
|
listitem: ListItemNode_default
|
|
3978
4029
|
};
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
3980
|
-
props.node.listType == "bullet" && /* @__PURE__ */ (0,
|
|
4030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react39.default.Fragment, { children: [
|
|
4031
|
+
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3981
4032
|
const SelectedNode = NodeTypes2[node.type];
|
|
3982
|
-
return /* @__PURE__ */ (0,
|
|
4033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3983
4034
|
}) }),
|
|
3984
|
-
props.node.listType == "number" && /* @__PURE__ */ (0,
|
|
4035
|
+
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3985
4036
|
const SelectedNode = NodeTypes2[node.type];
|
|
3986
|
-
return /* @__PURE__ */ (0,
|
|
4037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3987
4038
|
}) })
|
|
3988
4039
|
] });
|
|
3989
4040
|
};
|
|
@@ -3991,16 +4042,16 @@ var ListNode_default = ListNode;
|
|
|
3991
4042
|
|
|
3992
4043
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
3993
4044
|
var import_react40 = __toESM(require("react"));
|
|
3994
|
-
var
|
|
4045
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3995
4046
|
var QuoteNode = (props) => {
|
|
3996
4047
|
const NodeTypes2 = {
|
|
3997
4048
|
["text"]: TextNode_default,
|
|
3998
4049
|
["linebreak"]: LineBreakNode_default,
|
|
3999
4050
|
["link"]: LinkNode_default
|
|
4000
4051
|
};
|
|
4001
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4002
4053
|
const SelectedNode = NodeTypes2[node.type];
|
|
4003
|
-
return /* @__PURE__ */ (0,
|
|
4054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4004
4055
|
}) });
|
|
4005
4056
|
};
|
|
4006
4057
|
var QuoteNode_default = QuoteNode;
|
|
@@ -4008,11 +4059,11 @@ var QuoteNode_default = QuoteNode;
|
|
|
4008
4059
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4009
4060
|
var import_react42 = __toESM(require("react"));
|
|
4010
4061
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4011
|
-
var
|
|
4062
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4012
4063
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4013
4064
|
ssr: false,
|
|
4014
4065
|
// optional: fallback UI while loading
|
|
4015
|
-
loading: () => /* @__PURE__ */ (0,
|
|
4066
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4016
4067
|
});
|
|
4017
4068
|
var CodeNode = (props) => {
|
|
4018
4069
|
const NodeTypes2 = {
|
|
@@ -4026,14 +4077,14 @@ var CodeNode = (props) => {
|
|
|
4026
4077
|
if (node.type === "link") return node.text || node.url || "";
|
|
4027
4078
|
return "";
|
|
4028
4079
|
}).join("") ?? "";
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4031
|
-
/* @__PURE__ */ (0,
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: "Code Snippet" }),
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CopyButton2, { text: textContent })
|
|
4033
4084
|
] }),
|
|
4034
|
-
/* @__PURE__ */ (0,
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.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) => {
|
|
4035
4086
|
const SelectedNode = NodeTypes2[node.type];
|
|
4036
|
-
return /* @__PURE__ */ (0,
|
|
4087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4037
4088
|
SelectedNode,
|
|
4038
4089
|
{
|
|
4039
4090
|
node,
|
|
@@ -4048,15 +4099,15 @@ var CodeNode = (props) => {
|
|
|
4048
4099
|
var CodeNode_default = CodeNode;
|
|
4049
4100
|
|
|
4050
4101
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
4051
|
-
var
|
|
4102
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4052
4103
|
var HorizontalRuleNode = () => {
|
|
4053
|
-
return /* @__PURE__ */ (0,
|
|
4104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("hr", {});
|
|
4054
4105
|
};
|
|
4055
4106
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4056
4107
|
|
|
4057
4108
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4058
4109
|
var import_react43 = __toESM(require("react"));
|
|
4059
|
-
var
|
|
4110
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4060
4111
|
var WidgetNode = (props) => {
|
|
4061
4112
|
const getWidgetParameters = () => {
|
|
4062
4113
|
const widgetInputParameters = {
|
|
@@ -4120,7 +4171,7 @@ var WidgetNode = (props) => {
|
|
|
4120
4171
|
};
|
|
4121
4172
|
const widgetCode = props.node?.widgetCode;
|
|
4122
4173
|
if (!widgetCode) {
|
|
4123
|
-
return /* @__PURE__ */ (0,
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: "Invalid widget" });
|
|
4124
4175
|
}
|
|
4125
4176
|
const widgetParams = getWidgetParameters();
|
|
4126
4177
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -4129,7 +4180,7 @@ var WidgetNode = (props) => {
|
|
|
4129
4180
|
}
|
|
4130
4181
|
return (
|
|
4131
4182
|
// eslint-disable-next-line react-hooks/static-components
|
|
4132
|
-
/* @__PURE__ */ (0,
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react43.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4133
4184
|
WidgetRenderer,
|
|
4134
4185
|
{
|
|
4135
4186
|
params: widgetParams,
|
|
@@ -4149,9 +4200,9 @@ var WidgetNode_default = WidgetNode;
|
|
|
4149
4200
|
var import_react44 = __toESM(require("react"));
|
|
4150
4201
|
|
|
4151
4202
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4152
|
-
var
|
|
4203
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4153
4204
|
var InputControlNode = (props) => {
|
|
4154
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4155
4206
|
InputControl_default,
|
|
4156
4207
|
{
|
|
4157
4208
|
name: props.node.name,
|
|
@@ -4225,7 +4276,7 @@ var FormReducer_default = FormReducer;
|
|
|
4225
4276
|
|
|
4226
4277
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4227
4278
|
init_ServiceClient();
|
|
4228
|
-
var
|
|
4279
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4229
4280
|
var FormContainerNode = (props) => {
|
|
4230
4281
|
const NodeTypes2 = {
|
|
4231
4282
|
["input-control"]: InputControlNode_default
|
|
@@ -4255,12 +4306,12 @@ var FormContainerNode = (props) => {
|
|
|
4255
4306
|
};
|
|
4256
4307
|
fetchInitialData();
|
|
4257
4308
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4258
|
-
return /* @__PURE__ */ (0,
|
|
4309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
4259
4310
|
node.children && node.children.map((node2, index) => {
|
|
4260
4311
|
{
|
|
4261
4312
|
}
|
|
4262
4313
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4263
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react44.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4264
4315
|
InputControlNode_default,
|
|
4265
4316
|
{
|
|
4266
4317
|
value: formState.inputValues[node2.name],
|
|
@@ -4269,7 +4320,7 @@ var FormContainerNode = (props) => {
|
|
|
4269
4320
|
}
|
|
4270
4321
|
) }, index);
|
|
4271
4322
|
}),
|
|
4272
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
4323
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
4273
4324
|
] });
|
|
4274
4325
|
};
|
|
4275
4326
|
var FormContainerNode_default = FormContainerNode;
|
|
@@ -4279,7 +4330,7 @@ var import_react49 = __toESM(require("react"));
|
|
|
4279
4330
|
|
|
4280
4331
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4281
4332
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
4282
|
-
var
|
|
4333
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4283
4334
|
var IframeClient2 = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4284
4335
|
ssr: false
|
|
4285
4336
|
});
|
|
@@ -4292,7 +4343,7 @@ var EmbedNode = (props) => {
|
|
|
4292
4343
|
} else {
|
|
4293
4344
|
src = props.node.embedSrc;
|
|
4294
4345
|
}
|
|
4295
|
-
return /* @__PURE__ */ (0,
|
|
4346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(IframeClient2, { src }) });
|
|
4296
4347
|
};
|
|
4297
4348
|
var EmbedNode_default = EmbedNode;
|
|
4298
4349
|
|
|
@@ -4301,7 +4352,7 @@ init_ServiceClient();
|
|
|
4301
4352
|
|
|
4302
4353
|
// src/components/Slider.tsx
|
|
4303
4354
|
var import_react47 = __toESM(require("react"));
|
|
4304
|
-
var
|
|
4355
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4305
4356
|
var Slider = ({
|
|
4306
4357
|
children,
|
|
4307
4358
|
slidesToShow = 4,
|
|
@@ -4398,7 +4449,7 @@ var Slider = ({
|
|
|
4398
4449
|
if (!import_react47.default.isValidElement(child)) return null;
|
|
4399
4450
|
const childProps = child.props;
|
|
4400
4451
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4401
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4402
4453
|
"div",
|
|
4403
4454
|
{
|
|
4404
4455
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
@@ -4421,14 +4472,14 @@ var Slider = ({
|
|
|
4421
4472
|
return "bottom-4";
|
|
4422
4473
|
}
|
|
4423
4474
|
};
|
|
4424
|
-
return /* @__PURE__ */ (0,
|
|
4475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4425
4476
|
"div",
|
|
4426
4477
|
{
|
|
4427
4478
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4428
4479
|
onMouseEnter: handleMouseEnter,
|
|
4429
4480
|
onMouseLeave: handleMouseLeave,
|
|
4430
4481
|
children: [
|
|
4431
|
-
/* @__PURE__ */ (0,
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4432
4483
|
"div",
|
|
4433
4484
|
{
|
|
4434
4485
|
className: "flex h-full",
|
|
@@ -4439,18 +4490,18 @@ var Slider = ({
|
|
|
4439
4490
|
children: slides
|
|
4440
4491
|
}
|
|
4441
4492
|
),
|
|
4442
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4493
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4444
4495
|
ArrowButton,
|
|
4445
4496
|
{
|
|
4446
4497
|
direction: "left",
|
|
4447
4498
|
onClick: prevSlide,
|
|
4448
4499
|
visible: infinite_scroll || currentSlide > 0,
|
|
4449
4500
|
className: arrowClassName,
|
|
4450
|
-
children: /* @__PURE__ */ (0,
|
|
4501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.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_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4451
4502
|
}
|
|
4452
4503
|
),
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4454
4505
|
ArrowButton,
|
|
4455
4506
|
{
|
|
4456
4507
|
direction: "right",
|
|
@@ -4458,13 +4509,13 @@ var Slider = ({
|
|
|
4458
4509
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4459
4510
|
className: arrowClassName,
|
|
4460
4511
|
children: [
|
|
4461
|
-
/* @__PURE__ */ (0,
|
|
4512
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4462
4513
|
" "
|
|
4463
4514
|
]
|
|
4464
4515
|
}
|
|
4465
4516
|
)
|
|
4466
4517
|
] }),
|
|
4467
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4518
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime65.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_runtime65.jsx)(
|
|
4468
4519
|
ProgressPill,
|
|
4469
4520
|
{
|
|
4470
4521
|
active: index === currentSlide,
|
|
@@ -4490,7 +4541,7 @@ var ArrowButton = ({
|
|
|
4490
4541
|
visible,
|
|
4491
4542
|
children,
|
|
4492
4543
|
className = ""
|
|
4493
|
-
}) => /* @__PURE__ */ (0,
|
|
4544
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4494
4545
|
"button",
|
|
4495
4546
|
{
|
|
4496
4547
|
className: `
|
|
@@ -4577,7 +4628,7 @@ var ProgressPill = ({
|
|
|
4577
4628
|
const renderProgressBar = () => {
|
|
4578
4629
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4579
4630
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4580
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4581
4632
|
"div",
|
|
4582
4633
|
{
|
|
4583
4634
|
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`,
|
|
@@ -4589,7 +4640,7 @@ var ProgressPill = ({
|
|
|
4589
4640
|
};
|
|
4590
4641
|
const renderCumulativeFill = () => {
|
|
4591
4642
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4592
|
-
return /* @__PURE__ */ (0,
|
|
4643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4593
4644
|
"div",
|
|
4594
4645
|
{
|
|
4595
4646
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4599,7 +4650,7 @@ var ProgressPill = ({
|
|
|
4599
4650
|
}
|
|
4600
4651
|
return null;
|
|
4601
4652
|
};
|
|
4602
|
-
return /* @__PURE__ */ (0,
|
|
4653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4603
4654
|
"button",
|
|
4604
4655
|
{
|
|
4605
4656
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -4937,10 +4988,10 @@ var PathUtility = class {
|
|
|
4937
4988
|
var PathUtility_default = new PathUtility();
|
|
4938
4989
|
|
|
4939
4990
|
// src/components/NoDataFound.tsx
|
|
4940
|
-
var
|
|
4991
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4941
4992
|
var NoDataFound = () => {
|
|
4942
|
-
return /* @__PURE__ */ (0,
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4944
4995
|
"svg",
|
|
4945
4996
|
{
|
|
4946
4997
|
className: "w-10 h-10",
|
|
@@ -4948,7 +4999,7 @@ var NoDataFound = () => {
|
|
|
4948
4999
|
stroke: "currentColor",
|
|
4949
5000
|
viewBox: "0 0 24 24",
|
|
4950
5001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4951
|
-
children: /* @__PURE__ */ (0,
|
|
5002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4952
5003
|
"path",
|
|
4953
5004
|
{
|
|
4954
5005
|
strokeLinecap: "round",
|
|
@@ -4959,8 +5010,8 @@ var NoDataFound = () => {
|
|
|
4959
5010
|
)
|
|
4960
5011
|
}
|
|
4961
5012
|
) }) }),
|
|
4962
|
-
/* @__PURE__ */ (0,
|
|
4963
|
-
/* @__PURE__ */ (0,
|
|
5013
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
4964
5015
|
] });
|
|
4965
5016
|
};
|
|
4966
5017
|
var NoDataFound_default = NoDataFound;
|
|
@@ -4968,7 +5019,7 @@ var NoDataFound_default = NoDataFound;
|
|
|
4968
5019
|
// src/components/Pagination.tsx
|
|
4969
5020
|
var import_react48 = require("react");
|
|
4970
5021
|
init_StyleTypes();
|
|
4971
|
-
var
|
|
5022
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4972
5023
|
var Pagination = (props) => {
|
|
4973
5024
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
4974
5025
|
const builder = (0, import_react48.useMemo)(() => {
|
|
@@ -5012,7 +5063,7 @@ var Pagination = (props) => {
|
|
|
5012
5063
|
return range;
|
|
5013
5064
|
};
|
|
5014
5065
|
const paginationRange = getPaginationRange();
|
|
5015
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
5066
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5016
5067
|
Hyperlink,
|
|
5017
5068
|
{
|
|
5018
5069
|
linkType: "Link" /* Link */,
|
|
@@ -5027,9 +5078,9 @@ var Pagination = (props) => {
|
|
|
5027
5078
|
);
|
|
5028
5079
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
5029
5080
|
if (disabled) {
|
|
5030
|
-
return /* @__PURE__ */ (0,
|
|
5081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.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 });
|
|
5031
5082
|
}
|
|
5032
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5033
5084
|
Hyperlink,
|
|
5034
5085
|
{
|
|
5035
5086
|
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",
|
|
@@ -5039,35 +5090,35 @@ var Pagination = (props) => {
|
|
|
5039
5090
|
);
|
|
5040
5091
|
};
|
|
5041
5092
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
5042
|
-
return /* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "text-sm", children: [
|
|
5045
5096
|
"Showing ",
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "font-semibold", children: [
|
|
5047
5098
|
startItem,
|
|
5048
5099
|
"-",
|
|
5049
5100
|
endItem
|
|
5050
5101
|
] }),
|
|
5051
5102
|
" ",
|
|
5052
5103
|
"out of ",
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5104
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
5054
5105
|
" results"
|
|
5055
5106
|
] }),
|
|
5056
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
5057
|
-
/* @__PURE__ */ (0,
|
|
5107
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5058
5109
|
NavigationButton,
|
|
5059
5110
|
{
|
|
5060
5111
|
page: activePageNumber - 1,
|
|
5061
5112
|
disabled: activePageNumber === 1,
|
|
5062
5113
|
children: [
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
5064
|
-
/* @__PURE__ */ (0,
|
|
5114
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
5065
5116
|
]
|
|
5066
5117
|
}
|
|
5067
5118
|
),
|
|
5068
5119
|
paginationRange.map((item, index) => {
|
|
5069
5120
|
if (item === "...") {
|
|
5070
|
-
return /* @__PURE__ */ (0,
|
|
5121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5071
5122
|
"span",
|
|
5072
5123
|
{
|
|
5073
5124
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -5077,23 +5128,23 @@ var Pagination = (props) => {
|
|
|
5077
5128
|
);
|
|
5078
5129
|
}
|
|
5079
5130
|
const page = item;
|
|
5080
|
-
return /* @__PURE__ */ (0,
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PageButton, { page, children: page }, page);
|
|
5081
5132
|
}),
|
|
5082
|
-
/* @__PURE__ */ (0,
|
|
5133
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5083
5134
|
NavigationButton,
|
|
5084
5135
|
{
|
|
5085
5136
|
page: activePageNumber + 1,
|
|
5086
5137
|
disabled: activePageNumber === totalPages,
|
|
5087
5138
|
children: [
|
|
5088
|
-
/* @__PURE__ */ (0,
|
|
5089
|
-
/* @__PURE__ */ (0,
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
5090
5141
|
]
|
|
5091
5142
|
}
|
|
5092
5143
|
)
|
|
5093
5144
|
] }),
|
|
5094
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
5095
|
-
/* @__PURE__ */ (0,
|
|
5096
|
-
/* @__PURE__ */ (0,
|
|
5145
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5146
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
5147
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5097
5148
|
"input",
|
|
5098
5149
|
{
|
|
5099
5150
|
type: "number",
|
|
@@ -5114,9 +5165,9 @@ var Pagination = (props) => {
|
|
|
5114
5165
|
) })
|
|
5115
5166
|
] })
|
|
5116
5167
|
] }),
|
|
5117
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5119
|
-
/* @__PURE__ */ (0,
|
|
5168
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
5169
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5120
5171
|
Hyperlink,
|
|
5121
5172
|
{
|
|
5122
5173
|
className: `
|
|
@@ -5128,7 +5179,7 @@ var Pagination = (props) => {
|
|
|
5128
5179
|
},
|
|
5129
5180
|
size
|
|
5130
5181
|
)) }),
|
|
5131
|
-
/* @__PURE__ */ (0,
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "per page" })
|
|
5132
5183
|
] }) })
|
|
5133
5184
|
] });
|
|
5134
5185
|
};
|
|
@@ -5136,7 +5187,7 @@ var Pagination_default = Pagination;
|
|
|
5136
5187
|
|
|
5137
5188
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5138
5189
|
var import_dynamic7 = __toESM(require("next/dynamic"));
|
|
5139
|
-
var
|
|
5190
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5140
5191
|
var HlsPlayer3 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5141
5192
|
var deviceToMediaQuery = (device) => {
|
|
5142
5193
|
switch (device) {
|
|
@@ -5205,8 +5256,8 @@ var ImageGalleryNode = (props) => {
|
|
|
5205
5256
|
right: "justify-end"
|
|
5206
5257
|
};
|
|
5207
5258
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5208
|
-
return /* @__PURE__ */ (0,
|
|
5209
|
-
hlsSources.length > 0 && /* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
5260
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_jsx_runtime68.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5210
5261
|
HlsPlayer3,
|
|
5211
5262
|
{
|
|
5212
5263
|
sources: hlsSources,
|
|
@@ -5220,14 +5271,14 @@ var ImageGalleryNode = (props) => {
|
|
|
5220
5271
|
session: props.session
|
|
5221
5272
|
}
|
|
5222
5273
|
) }),
|
|
5223
|
-
staticFallback && /* @__PURE__ */ (0,
|
|
5274
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_jsx_runtime68.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("picture", { children: [
|
|
5224
5275
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5225
5276
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5226
5277
|
if (!match) return null;
|
|
5227
5278
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5228
5279
|
if (!srcUrl) return null;
|
|
5229
5280
|
const mediaQuery = deviceToMediaQuery(match.device);
|
|
5230
|
-
return /* @__PURE__ */ (0,
|
|
5281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5231
5282
|
"source",
|
|
5232
5283
|
{
|
|
5233
5284
|
media: mediaQuery,
|
|
@@ -5251,7 +5302,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5251
5302
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5252
5303
|
return (
|
|
5253
5304
|
// eslint-disable-next-line @next/next/no-img-element
|
|
5254
|
-
/* @__PURE__ */ (0,
|
|
5305
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5255
5306
|
"img",
|
|
5256
5307
|
{
|
|
5257
5308
|
loading: "lazy",
|
|
@@ -5272,7 +5323,7 @@ var ImageGalleryNode_default = ImageGalleryNode;
|
|
|
5272
5323
|
|
|
5273
5324
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5274
5325
|
var import_link2 = __toESM(require("next/link"));
|
|
5275
|
-
var
|
|
5326
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5276
5327
|
function toCamelCase(str) {
|
|
5277
5328
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
5278
5329
|
}
|
|
@@ -5479,7 +5530,7 @@ var DivContainer = async (props) => {
|
|
|
5479
5530
|
response = await serviceClient.get(endpoint);
|
|
5480
5531
|
result = response?.result;
|
|
5481
5532
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5482
|
-
return /* @__PURE__ */ (0,
|
|
5533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(NoDataFound_default, {});
|
|
5483
5534
|
}
|
|
5484
5535
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5485
5536
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5496,7 +5547,7 @@ var DivContainer = async (props) => {
|
|
|
5496
5547
|
}
|
|
5497
5548
|
const SelectedNode = NodeTypes2[node.type];
|
|
5498
5549
|
if (!SelectedNode) return null;
|
|
5499
|
-
return /* @__PURE__ */ (0,
|
|
5550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5500
5551
|
SelectedNode,
|
|
5501
5552
|
{
|
|
5502
5553
|
node,
|
|
@@ -5598,9 +5649,9 @@ var DivContainer = async (props) => {
|
|
|
5598
5649
|
props.node.autoFormat && "auto-format",
|
|
5599
5650
|
props.node.bgClass
|
|
5600
5651
|
].filter(Boolean).join(" ");
|
|
5601
|
-
return /* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
5603
|
-
/* @__PURE__ */ (0,
|
|
5652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react49.default.Fragment, { children: [
|
|
5653
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5604
5655
|
Wrapper,
|
|
5605
5656
|
{
|
|
5606
5657
|
id: guid,
|
|
@@ -5609,18 +5660,18 @@ var DivContainer = async (props) => {
|
|
|
5609
5660
|
...wrapperProps,
|
|
5610
5661
|
children: dataToRender.map(
|
|
5611
5662
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5612
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
5663
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: child }, i)
|
|
5613
5664
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5614
5665
|
)
|
|
5615
5666
|
}
|
|
5616
5667
|
) }),
|
|
5617
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
5668
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
5618
5669
|
] });
|
|
5619
5670
|
};
|
|
5620
5671
|
var DivContainer_default = DivContainer;
|
|
5621
5672
|
|
|
5622
5673
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5623
|
-
var
|
|
5674
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5624
5675
|
var NodeTypes = {
|
|
5625
5676
|
["paragraph"]: ParagraphNode_default,
|
|
5626
5677
|
["heading"]: HeadingNode_default,
|
|
@@ -5648,11 +5699,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5648
5699
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5649
5700
|
rootNode = pageBodyTree.root;
|
|
5650
5701
|
}
|
|
5651
|
-
return /* @__PURE__ */ (0,
|
|
5702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5652
5703
|
{
|
|
5653
5704
|
}
|
|
5654
5705
|
const SelectedNode = NodeTypes[node.type];
|
|
5655
|
-
return /* @__PURE__ */ (0,
|
|
5706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5656
5707
|
SelectedNode,
|
|
5657
5708
|
{
|
|
5658
5709
|
node,
|
|
@@ -5668,7 +5719,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5668
5719
|
device: props.device,
|
|
5669
5720
|
widgetRenderer: props.widgetRenderer
|
|
5670
5721
|
}
|
|
5671
|
-
) }) : /* @__PURE__ */ (0,
|
|
5722
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5672
5723
|
SelectedNode,
|
|
5673
5724
|
{
|
|
5674
5725
|
node,
|
|
@@ -5691,7 +5742,7 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
5691
5742
|
// src/components/Toast.tsx
|
|
5692
5743
|
var import_react51 = require("react");
|
|
5693
5744
|
init_ToastService();
|
|
5694
|
-
var
|
|
5745
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5695
5746
|
var Toast = () => {
|
|
5696
5747
|
const [showToast, setShowToast] = (0, import_react51.useState)(false);
|
|
5697
5748
|
const [message, setMessage] = (0, import_react51.useState)("");
|
|
@@ -5734,8 +5785,8 @@ var Toast = () => {
|
|
|
5734
5785
|
const closeToast = () => {
|
|
5735
5786
|
setShowToast(false);
|
|
5736
5787
|
};
|
|
5737
|
-
return /* @__PURE__ */ (0,
|
|
5738
|
-
/* @__PURE__ */ (0,
|
|
5788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime71.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_runtime71.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
5789
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5739
5790
|
"span",
|
|
5740
5791
|
{
|
|
5741
5792
|
className: "font-medium text-inherit text-sm",
|
|
@@ -5743,7 +5794,7 @@ var Toast = () => {
|
|
|
5743
5794
|
children: message
|
|
5744
5795
|
}
|
|
5745
5796
|
),
|
|
5746
|
-
/* @__PURE__ */ (0,
|
|
5797
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5747
5798
|
"svg",
|
|
5748
5799
|
{
|
|
5749
5800
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5751,7 +5802,7 @@ var Toast = () => {
|
|
|
5751
5802
|
fill: "none",
|
|
5752
5803
|
viewBox: "0 0 24 24",
|
|
5753
5804
|
stroke: "currentColor",
|
|
5754
|
-
children: /* @__PURE__ */ (0,
|
|
5805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
5755
5806
|
}
|
|
5756
5807
|
) })
|
|
5757
5808
|
] }) }) });
|
|
@@ -5764,7 +5815,7 @@ init_ToastService();
|
|
|
5764
5815
|
// src/components/NavigationTabsV2.tsx
|
|
5765
5816
|
var import_link3 = __toESM(require("next/link"));
|
|
5766
5817
|
var import_navigation = require("next/navigation");
|
|
5767
|
-
var
|
|
5818
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5768
5819
|
function resolveRoutePlaceholders(route, params) {
|
|
5769
5820
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
5770
5821
|
const value = params[key];
|
|
@@ -5789,8 +5840,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5789
5840
|
isActive: tab.isActive
|
|
5790
5841
|
})) || [];
|
|
5791
5842
|
if (mappedTabs.length === 0) return null;
|
|
5792
|
-
return /* @__PURE__ */ (0,
|
|
5793
|
-
return /* @__PURE__ */ (0,
|
|
5843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
5844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5794
5845
|
"div",
|
|
5795
5846
|
{
|
|
5796
5847
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -5808,46 +5859,46 @@ var import_navigation2 = require("next/navigation");
|
|
|
5808
5859
|
|
|
5809
5860
|
// src/components/dataForm/NoContentView.tsx
|
|
5810
5861
|
var import_react52 = __toESM(require("react"));
|
|
5811
|
-
var
|
|
5862
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5812
5863
|
var NoContentView = (props) => {
|
|
5813
|
-
return /* @__PURE__ */ (0,
|
|
5864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react52.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
5814
5865
|
};
|
|
5815
5866
|
var NoContentView_default = NoContentView;
|
|
5816
5867
|
|
|
5817
5868
|
// src/components/dataForm/ContentView.tsx
|
|
5818
5869
|
var import_react53 = __toESM(require("react"));
|
|
5819
|
-
var
|
|
5870
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5820
5871
|
var ContentView = (props) => {
|
|
5821
|
-
return /* @__PURE__ */ (0,
|
|
5822
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
5823
|
-
/* @__PURE__ */ (0,
|
|
5824
|
-
/* @__PURE__ */ (0,
|
|
5825
|
-
/* @__PURE__ */ (0,
|
|
5826
|
-
/* @__PURE__ */ (0,
|
|
5827
|
-
/* @__PURE__ */ (0,
|
|
5872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_react53.default.Fragment, { children: [
|
|
5873
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
5874
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
5875
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
5876
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ml-2", children: [
|
|
5877
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
5878
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
5828
5879
|
] })
|
|
5829
5880
|
] }),
|
|
5830
|
-
/* @__PURE__ */ (0,
|
|
5831
|
-
/* @__PURE__ */ (0,
|
|
5832
|
-
/* @__PURE__ */ (0,
|
|
5833
|
-
/* @__PURE__ */ (0,
|
|
5834
|
-
/* @__PURE__ */ (0,
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
/* @__PURE__ */ (0,
|
|
5881
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
5882
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "animate-pulse", children: [
|
|
5883
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
5884
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
5885
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
5886
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
5887
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
5837
5888
|
] }),
|
|
5838
|
-
/* @__PURE__ */ (0,
|
|
5839
|
-
/* @__PURE__ */ (0,
|
|
5840
|
-
/* @__PURE__ */ (0,
|
|
5841
|
-
/* @__PURE__ */ (0,
|
|
5842
|
-
/* @__PURE__ */ (0,
|
|
5843
|
-
/* @__PURE__ */ (0,
|
|
5889
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "animate-pulse", children: [
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
5892
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
5893
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
5894
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
5844
5895
|
] }),
|
|
5845
|
-
/* @__PURE__ */ (0,
|
|
5846
|
-
/* @__PURE__ */ (0,
|
|
5847
|
-
/* @__PURE__ */ (0,
|
|
5848
|
-
/* @__PURE__ */ (0,
|
|
5849
|
-
/* @__PURE__ */ (0,
|
|
5850
|
-
/* @__PURE__ */ (0,
|
|
5896
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "animate-pulse", children: [
|
|
5897
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
5899
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
5900
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
5901
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
5851
5902
|
] })
|
|
5852
5903
|
] })
|
|
5853
5904
|
] }) }),
|
|
@@ -5858,7 +5909,7 @@ var ContentView_default = ContentView;
|
|
|
5858
5909
|
|
|
5859
5910
|
// src/components/dataForm/DataList.tsx
|
|
5860
5911
|
init_StyleTypes();
|
|
5861
|
-
var
|
|
5912
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5862
5913
|
var DataList = (props) => {
|
|
5863
5914
|
console.log(props.dataset, "datasetssssss");
|
|
5864
5915
|
const router = (0, import_navigation2.useRouter)();
|
|
@@ -5881,7 +5932,7 @@ var DataList = (props) => {
|
|
|
5881
5932
|
if (path.includes(".")) {
|
|
5882
5933
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
5883
5934
|
} else if (Array.isArray(obj[path])) {
|
|
5884
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
5935
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { children: item }, index));
|
|
5885
5936
|
} else {
|
|
5886
5937
|
return obj[path];
|
|
5887
5938
|
}
|
|
@@ -5937,30 +5988,30 @@ var DataList = (props) => {
|
|
|
5937
5988
|
const renderPageNumbers = () => {
|
|
5938
5989
|
if (pages <= 10) {
|
|
5939
5990
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5940
|
-
(page) => /* @__PURE__ */ (0,
|
|
5991
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5941
5992
|
Hyperlink,
|
|
5942
5993
|
{
|
|
5943
5994
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
5944
5995
|
href: builder.getNewPageUrl(page),
|
|
5945
5996
|
children: page
|
|
5946
5997
|
}
|
|
5947
|
-
) : /* @__PURE__ */ (0,
|
|
5998
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
5948
5999
|
);
|
|
5949
6000
|
} else {
|
|
5950
6001
|
const showFirstPages = activePageNumber <= 5;
|
|
5951
6002
|
const showLastPages = activePageNumber > pages - 5;
|
|
5952
6003
|
if (showFirstPages) {
|
|
5953
|
-
return /* @__PURE__ */ (0,
|
|
5954
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
6004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6005
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5955
6006
|
Hyperlink,
|
|
5956
6007
|
{
|
|
5957
6008
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
5958
6009
|
href: builder.getNewPageUrl(page),
|
|
5959
6010
|
children: page
|
|
5960
6011
|
}
|
|
5961
|
-
) : /* @__PURE__ */ (0,
|
|
5962
|
-
/* @__PURE__ */ (0,
|
|
5963
|
-
/* @__PURE__ */ (0,
|
|
6012
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5964
6015
|
Hyperlink,
|
|
5965
6016
|
{
|
|
5966
6017
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5968,7 +6019,7 @@ var DataList = (props) => {
|
|
|
5968
6019
|
children: pages - 1
|
|
5969
6020
|
}
|
|
5970
6021
|
),
|
|
5971
|
-
/* @__PURE__ */ (0,
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5972
6023
|
Hyperlink,
|
|
5973
6024
|
{
|
|
5974
6025
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5976,7 +6027,7 @@ var DataList = (props) => {
|
|
|
5976
6027
|
children: pages
|
|
5977
6028
|
}
|
|
5978
6029
|
),
|
|
5979
|
-
/* @__PURE__ */ (0,
|
|
6030
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
5980
6031
|
"select",
|
|
5981
6032
|
{
|
|
5982
6033
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -5988,18 +6039,18 @@ var DataList = (props) => {
|
|
|
5988
6039
|
}
|
|
5989
6040
|
},
|
|
5990
6041
|
children: [
|
|
5991
|
-
/* @__PURE__ */ (0,
|
|
6042
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
5992
6043
|
Array.from(
|
|
5993
6044
|
{ length: Math.max(0, pages - 10) },
|
|
5994
6045
|
(_, index) => index + 9
|
|
5995
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
6046
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { value: page, children: page }, page))
|
|
5996
6047
|
]
|
|
5997
6048
|
}
|
|
5998
6049
|
) })
|
|
5999
6050
|
] });
|
|
6000
6051
|
} else if (showLastPages) {
|
|
6001
|
-
return /* @__PURE__ */ (0,
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6053
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6003
6054
|
Hyperlink,
|
|
6004
6055
|
{
|
|
6005
6056
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6007,7 +6058,7 @@ var DataList = (props) => {
|
|
|
6007
6058
|
children: "1"
|
|
6008
6059
|
}
|
|
6009
6060
|
),
|
|
6010
|
-
/* @__PURE__ */ (0,
|
|
6061
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6011
6062
|
Hyperlink,
|
|
6012
6063
|
{
|
|
6013
6064
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6015,21 +6066,21 @@ var DataList = (props) => {
|
|
|
6015
6066
|
children: "2"
|
|
6016
6067
|
}
|
|
6017
6068
|
),
|
|
6018
|
-
/* @__PURE__ */ (0,
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6019
6070
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6020
|
-
(page) => /* @__PURE__ */ (0,
|
|
6071
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6021
6072
|
Hyperlink,
|
|
6022
6073
|
{
|
|
6023
6074
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
6024
6075
|
href: builder.getNewPageUrl(page),
|
|
6025
6076
|
children: page
|
|
6026
6077
|
}
|
|
6027
|
-
) : /* @__PURE__ */ (0,
|
|
6078
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
6028
6079
|
)
|
|
6029
6080
|
] });
|
|
6030
6081
|
} else {
|
|
6031
|
-
return /* @__PURE__ */ (0,
|
|
6032
|
-
/* @__PURE__ */ (0,
|
|
6082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6033
6084
|
Hyperlink,
|
|
6034
6085
|
{
|
|
6035
6086
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6037,7 +6088,7 @@ var DataList = (props) => {
|
|
|
6037
6088
|
children: "1"
|
|
6038
6089
|
}
|
|
6039
6090
|
),
|
|
6040
|
-
/* @__PURE__ */ (0,
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6041
6092
|
Hyperlink,
|
|
6042
6093
|
{
|
|
6043
6094
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6045,20 +6096,20 @@ var DataList = (props) => {
|
|
|
6045
6096
|
children: "2"
|
|
6046
6097
|
}
|
|
6047
6098
|
),
|
|
6048
|
-
/* @__PURE__ */ (0,
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6049
6100
|
Array.from(
|
|
6050
6101
|
{ length: 5 },
|
|
6051
6102
|
(_, index) => activePageNumber - 2 + index
|
|
6052
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
6103
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6053
6104
|
Hyperlink,
|
|
6054
6105
|
{
|
|
6055
6106
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
6056
6107
|
href: builder.getNewPageUrl(page),
|
|
6057
6108
|
children: page
|
|
6058
6109
|
}
|
|
6059
|
-
) : /* @__PURE__ */ (0,
|
|
6060
|
-
/* @__PURE__ */ (0,
|
|
6061
|
-
/* @__PURE__ */ (0,
|
|
6110
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6062
6113
|
Hyperlink,
|
|
6063
6114
|
{
|
|
6064
6115
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6066,7 +6117,7 @@ var DataList = (props) => {
|
|
|
6066
6117
|
children: pages - 1
|
|
6067
6118
|
}
|
|
6068
6119
|
),
|
|
6069
|
-
/* @__PURE__ */ (0,
|
|
6120
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6070
6121
|
Hyperlink,
|
|
6071
6122
|
{
|
|
6072
6123
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6074,7 +6125,7 @@ var DataList = (props) => {
|
|
|
6074
6125
|
children: pages
|
|
6075
6126
|
}
|
|
6076
6127
|
),
|
|
6077
|
-
/* @__PURE__ */ (0,
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6078
6129
|
"select",
|
|
6079
6130
|
{
|
|
6080
6131
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -6086,8 +6137,8 @@ var DataList = (props) => {
|
|
|
6086
6137
|
}
|
|
6087
6138
|
},
|
|
6088
6139
|
children: [
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6090
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { value: "", children: "Jump to" }),
|
|
6141
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { value: page, children: page }, page))
|
|
6091
6142
|
]
|
|
6092
6143
|
}
|
|
6093
6144
|
) })
|
|
@@ -6095,16 +6146,16 @@ var DataList = (props) => {
|
|
|
6095
6146
|
}
|
|
6096
6147
|
}
|
|
6097
6148
|
};
|
|
6098
|
-
return /* @__PURE__ */ (0,
|
|
6099
|
-
/* @__PURE__ */ (0,
|
|
6100
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
6149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react54.default.Fragment, { children: [
|
|
6150
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ContentView_default, { isDataFound, children: [
|
|
6151
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6101
6152
|
"div",
|
|
6102
6153
|
{
|
|
6103
6154
|
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`,
|
|
6104
6155
|
children: [
|
|
6105
|
-
props.title ? /* @__PURE__ */ (0,
|
|
6106
|
-
/* @__PURE__ */ (0,
|
|
6107
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
6156
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", {}),
|
|
6157
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6158
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6108
6159
|
InputControl_default,
|
|
6109
6160
|
{
|
|
6110
6161
|
name: filter.name,
|
|
@@ -6119,15 +6170,15 @@ var DataList = (props) => {
|
|
|
6119
6170
|
},
|
|
6120
6171
|
filter.name
|
|
6121
6172
|
)),
|
|
6122
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
6173
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6123
6174
|
Hyperlink,
|
|
6124
6175
|
{
|
|
6125
6176
|
className: "gap-1",
|
|
6126
6177
|
linkType: "Primary" /* Solid */,
|
|
6127
6178
|
href: props.addLinkHref,
|
|
6128
6179
|
children: [
|
|
6129
|
-
/* @__PURE__ */ (0,
|
|
6130
|
-
/* @__PURE__ */ (0,
|
|
6180
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
6131
6182
|
]
|
|
6132
6183
|
}
|
|
6133
6184
|
)
|
|
@@ -6135,8 +6186,8 @@ var DataList = (props) => {
|
|
|
6135
6186
|
]
|
|
6136
6187
|
}
|
|
6137
6188
|
),
|
|
6138
|
-
/* @__PURE__ */ (0,
|
|
6139
|
-
/* @__PURE__ */ (0,
|
|
6189
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
6140
6191
|
let url = builder.getNewOrderByUrl(column.name);
|
|
6141
6192
|
let icon = "chevronUpDown";
|
|
6142
6193
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -6146,18 +6197,18 @@ var DataList = (props) => {
|
|
|
6146
6197
|
icon = "chevronUp";
|
|
6147
6198
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
6148
6199
|
}
|
|
6149
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6150
6201
|
"th",
|
|
6151
6202
|
{
|
|
6152
6203
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
6153
|
-
children: /* @__PURE__ */ (0,
|
|
6204
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6154
6205
|
Hyperlink,
|
|
6155
6206
|
{
|
|
6156
6207
|
href: column.enableSorting ? url : void 0,
|
|
6157
6208
|
className: "!text-neutral-contrast ",
|
|
6158
|
-
children: /* @__PURE__ */ (0,
|
|
6159
|
-
/* @__PURE__ */ (0,
|
|
6160
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
6209
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-black", children: column.label }),
|
|
6211
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
6161
6212
|
] })
|
|
6162
6213
|
}
|
|
6163
6214
|
)
|
|
@@ -6165,24 +6216,24 @@ var DataList = (props) => {
|
|
|
6165
6216
|
column.name
|
|
6166
6217
|
);
|
|
6167
6218
|
}) }) }),
|
|
6168
|
-
/* @__PURE__ */ (0,
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
6169
6220
|
let validityClass = "";
|
|
6170
6221
|
console.log("dataitem", dataitem);
|
|
6171
6222
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
6172
6223
|
validityClass = "bg-alert-200";
|
|
6173
6224
|
}
|
|
6174
|
-
return /* @__PURE__ */ (0,
|
|
6225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6175
6226
|
console.log("column", column);
|
|
6176
|
-
return /* @__PURE__ */ (0,
|
|
6227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6177
6228
|
"td",
|
|
6178
6229
|
{
|
|
6179
6230
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
6180
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
6231
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6181
6232
|
Hyperlink,
|
|
6182
6233
|
{
|
|
6183
6234
|
className: "",
|
|
6184
6235
|
href: `https://${dataitem[column.name]}`,
|
|
6185
|
-
children: /* @__PURE__ */ (0,
|
|
6236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6186
6237
|
ViewControl_default,
|
|
6187
6238
|
{
|
|
6188
6239
|
controlType: column.controlType,
|
|
@@ -6195,11 +6246,11 @@ var DataList = (props) => {
|
|
|
6195
6246
|
}
|
|
6196
6247
|
)
|
|
6197
6248
|
}
|
|
6198
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
6249
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6199
6250
|
Hyperlink,
|
|
6200
6251
|
{
|
|
6201
6252
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
6202
|
-
children: /* @__PURE__ */ (0,
|
|
6253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6203
6254
|
ViewControl_default,
|
|
6204
6255
|
{
|
|
6205
6256
|
controlType: column.controlType,
|
|
@@ -6209,7 +6260,7 @@ var DataList = (props) => {
|
|
|
6209
6260
|
}
|
|
6210
6261
|
)
|
|
6211
6262
|
}
|
|
6212
|
-
) : /* @__PURE__ */ (0,
|
|
6263
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6213
6264
|
ViewControl_default,
|
|
6214
6265
|
{
|
|
6215
6266
|
controlType: column.controlType,
|
|
@@ -6223,10 +6274,10 @@ var DataList = (props) => {
|
|
|
6223
6274
|
}) }, index);
|
|
6224
6275
|
}) })
|
|
6225
6276
|
] }) }),
|
|
6226
|
-
/* @__PURE__ */ (0,
|
|
6227
|
-
/* @__PURE__ */ (0,
|
|
6228
|
-
/* @__PURE__ */ (0,
|
|
6229
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
6277
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
6278
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-gray-700", children: label }),
|
|
6279
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
6280
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6230
6281
|
Hyperlink,
|
|
6231
6282
|
{
|
|
6232
6283
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -6234,9 +6285,9 @@ var DataList = (props) => {
|
|
|
6234
6285
|
children: "Prev"
|
|
6235
6286
|
}
|
|
6236
6287
|
),
|
|
6237
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
6288
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime75.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" }),
|
|
6238
6289
|
renderPageNumbers(),
|
|
6239
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
6290
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6240
6291
|
Hyperlink,
|
|
6241
6292
|
{
|
|
6242
6293
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -6244,19 +6295,19 @@ var DataList = (props) => {
|
|
|
6244
6295
|
children: "Next"
|
|
6245
6296
|
}
|
|
6246
6297
|
),
|
|
6247
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
6298
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
6248
6299
|
] })
|
|
6249
6300
|
] }) })
|
|
6250
6301
|
] }),
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6252
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
6302
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
6303
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6253
6304
|
"div",
|
|
6254
6305
|
{
|
|
6255
6306
|
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`,
|
|
6256
6307
|
children: [
|
|
6257
|
-
props.title ? /* @__PURE__ */ (0,
|
|
6258
|
-
/* @__PURE__ */ (0,
|
|
6259
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
6308
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", {}),
|
|
6309
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6310
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6260
6311
|
InputControl_default,
|
|
6261
6312
|
{
|
|
6262
6313
|
name: filter.name,
|
|
@@ -6271,15 +6322,15 @@ var DataList = (props) => {
|
|
|
6271
6322
|
},
|
|
6272
6323
|
filter.name
|
|
6273
6324
|
)),
|
|
6274
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
6325
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6275
6326
|
Hyperlink,
|
|
6276
6327
|
{
|
|
6277
6328
|
className: "gap-1",
|
|
6278
6329
|
linkType: "Primary" /* Solid */,
|
|
6279
6330
|
href: props.addLinkHref,
|
|
6280
6331
|
children: [
|
|
6281
|
-
/* @__PURE__ */ (0,
|
|
6282
|
-
/* @__PURE__ */ (0,
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
6333
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
6283
6334
|
]
|
|
6284
6335
|
}
|
|
6285
6336
|
)
|
|
@@ -6287,8 +6338,8 @@ var DataList = (props) => {
|
|
|
6287
6338
|
]
|
|
6288
6339
|
}
|
|
6289
6340
|
),
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6291
|
-
/* @__PURE__ */ (0,
|
|
6341
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
6342
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
6292
6343
|
let url = builder.getNewOrderByUrl(column.name);
|
|
6293
6344
|
let icon = "chevronUpDown";
|
|
6294
6345
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -6298,18 +6349,18 @@ var DataList = (props) => {
|
|
|
6298
6349
|
icon = "chevronUp";
|
|
6299
6350
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
6300
6351
|
}
|
|
6301
|
-
return /* @__PURE__ */ (0,
|
|
6352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6302
6353
|
"th",
|
|
6303
6354
|
{
|
|
6304
6355
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
6305
|
-
children: /* @__PURE__ */ (0,
|
|
6356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6306
6357
|
Hyperlink,
|
|
6307
6358
|
{
|
|
6308
6359
|
href: column.enableSorting ? url : void 0,
|
|
6309
6360
|
className: "text-body-950",
|
|
6310
|
-
children: /* @__PURE__ */ (0,
|
|
6311
|
-
/* @__PURE__ */ (0,
|
|
6312
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
6361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
6362
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: column.label }),
|
|
6363
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
6313
6364
|
] })
|
|
6314
6365
|
}
|
|
6315
6366
|
)
|
|
@@ -6317,7 +6368,7 @@ var DataList = (props) => {
|
|
|
6317
6368
|
column.name
|
|
6318
6369
|
);
|
|
6319
6370
|
}) }) }) }) }),
|
|
6320
|
-
/* @__PURE__ */ (0,
|
|
6371
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
6321
6372
|
] })
|
|
6322
6373
|
] })
|
|
6323
6374
|
] });
|
|
@@ -6328,7 +6379,7 @@ var DataList_default = DataList;
|
|
|
6328
6379
|
var import_react55 = __toESM(require("react"));
|
|
6329
6380
|
init_ServiceClient();
|
|
6330
6381
|
var import_navigation3 = require("next/navigation");
|
|
6331
|
-
var
|
|
6382
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
6332
6383
|
var viewControlMap = {
|
|
6333
6384
|
number: ViewControlTypes.number,
|
|
6334
6385
|
lineText: ViewControlTypes.lineText,
|
|
@@ -6417,9 +6468,9 @@ var DataListRenderer = ({
|
|
|
6417
6468
|
const [tabItem, setTabItem] = (0, import_react55.useState)();
|
|
6418
6469
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6419
6470
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6420
|
-
return /* @__PURE__ */ (0,
|
|
6421
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
6422
|
-
/* @__PURE__ */ (0,
|
|
6471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_react55.default.Fragment, { children: [
|
|
6472
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
6473
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6423
6474
|
DataList_default,
|
|
6424
6475
|
{
|
|
6425
6476
|
addLinkHref,
|
|
@@ -6469,7 +6520,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
6469
6520
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
6470
6521
|
|
|
6471
6522
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6472
|
-
var
|
|
6523
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
6473
6524
|
var DataFormChildSection = (props) => {
|
|
6474
6525
|
const { section } = props;
|
|
6475
6526
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -6537,14 +6588,14 @@ var DataFormChildSection = (props) => {
|
|
|
6537
6588
|
childItemsToRender,
|
|
6538
6589
|
allChildItems: childItems
|
|
6539
6590
|
});
|
|
6540
|
-
return /* @__PURE__ */ (0,
|
|
6541
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
6542
|
-
/* @__PURE__ */ (0,
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6544
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
6545
|
-
return /* @__PURE__ */ (0,
|
|
6591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
6592
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
6593
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
6594
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
6595
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("tr", { className: "", children: [
|
|
6546
6597
|
sectionRow.elements.map((field, index) => {
|
|
6547
|
-
return /* @__PURE__ */ (0,
|
|
6598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6548
6599
|
"th",
|
|
6549
6600
|
{
|
|
6550
6601
|
className: "py-3 font-normal text-left",
|
|
@@ -6553,21 +6604,21 @@ var DataFormChildSection = (props) => {
|
|
|
6553
6604
|
field.name
|
|
6554
6605
|
);
|
|
6555
6606
|
}),
|
|
6556
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
6607
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
6557
6608
|
] }, sectionRowIndex);
|
|
6558
6609
|
}) }),
|
|
6559
|
-
/* @__PURE__ */ (0,
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6560
6611
|
const { item, originalIndex } = visibleItem;
|
|
6561
6612
|
const rowKey = originalIndex;
|
|
6562
|
-
return /* @__PURE__ */ (0,
|
|
6613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: section.sectionRows.map(
|
|
6563
6614
|
(sectionRow, sectionRowIndex) => {
|
|
6564
|
-
return /* @__PURE__ */ (0,
|
|
6615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6565
6616
|
"tr",
|
|
6566
6617
|
{
|
|
6567
6618
|
className: "",
|
|
6568
6619
|
children: [
|
|
6569
6620
|
sectionRow.elements.map((field, index) => {
|
|
6570
|
-
return /* @__PURE__ */ (0,
|
|
6621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "w-11/12", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6571
6622
|
InputControl_default,
|
|
6572
6623
|
{
|
|
6573
6624
|
index: filteredIndex,
|
|
@@ -6587,7 +6638,7 @@ var DataFormChildSection = (props) => {
|
|
|
6587
6638
|
}
|
|
6588
6639
|
) }) }) }, field.name);
|
|
6589
6640
|
}),
|
|
6590
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
6641
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6591
6642
|
ClientButton_default,
|
|
6592
6643
|
{
|
|
6593
6644
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -6596,7 +6647,7 @@ var DataFormChildSection = (props) => {
|
|
|
6596
6647
|
},
|
|
6597
6648
|
dataRole: "delete",
|
|
6598
6649
|
tabIndex: -1,
|
|
6599
|
-
children: /* @__PURE__ */ (0,
|
|
6650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6600
6651
|
Icon_default,
|
|
6601
6652
|
{
|
|
6602
6653
|
className: "w-4 h-4",
|
|
@@ -6613,7 +6664,7 @@ var DataFormChildSection = (props) => {
|
|
|
6613
6664
|
) }, rowKey);
|
|
6614
6665
|
}) })
|
|
6615
6666
|
] }) }),
|
|
6616
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
6667
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6617
6668
|
ClientButton_default,
|
|
6618
6669
|
{
|
|
6619
6670
|
ButtonType: "Link" /* Link */,
|
|
@@ -6628,7 +6679,7 @@ var DataFormChildSection = (props) => {
|
|
|
6628
6679
|
var DataFormChildSection_default = DataFormChildSection;
|
|
6629
6680
|
|
|
6630
6681
|
// src/components/dataForm/DataForm.tsx
|
|
6631
|
-
var
|
|
6682
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6632
6683
|
var DataForm = (props) => {
|
|
6633
6684
|
const formRef = (0, import_react57.useRef)(null);
|
|
6634
6685
|
console.log(props.dataItem, "dssads");
|
|
@@ -6848,19 +6899,19 @@ var DataForm = (props) => {
|
|
|
6848
6899
|
return false;
|
|
6849
6900
|
}
|
|
6850
6901
|
}
|
|
6851
|
-
return /* @__PURE__ */ (0,
|
|
6852
|
-
props.title && /* @__PURE__ */ (0,
|
|
6902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
6903
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "inline-flex items-center gap-2 px-6 py-3 border border-neutral-200 bg-white shadow-sm rounded-t-md", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6853
6904
|
"div",
|
|
6854
6905
|
{
|
|
6855
6906
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
6856
6907
|
onClick: () => window.history.back(),
|
|
6857
6908
|
children: [
|
|
6858
|
-
/* @__PURE__ */ (0,
|
|
6859
|
-
/* @__PURE__ */ (0,
|
|
6909
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
6860
6911
|
]
|
|
6861
6912
|
}
|
|
6862
6913
|
) }),
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6864
6915
|
"form",
|
|
6865
6916
|
{
|
|
6866
6917
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -6881,8 +6932,8 @@ var DataForm = (props) => {
|
|
|
6881
6932
|
}
|
|
6882
6933
|
}
|
|
6883
6934
|
},
|
|
6884
|
-
children: /* @__PURE__ */ (0,
|
|
6885
|
-
return /* @__PURE__ */ (0,
|
|
6935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
6936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
6886
6937
|
section.sectionRows?.map(
|
|
6887
6938
|
(sectionRow, sectionRowIndex) => {
|
|
6888
6939
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6893,14 +6944,14 @@ var DataForm = (props) => {
|
|
|
6893
6944
|
sectionRow.visible
|
|
6894
6945
|
);
|
|
6895
6946
|
}
|
|
6896
|
-
return /* @__PURE__ */ (0,
|
|
6897
|
-
return /* @__PURE__ */ (0,
|
|
6947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
6948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6898
6949
|
"div",
|
|
6899
6950
|
{
|
|
6900
6951
|
className: sectionRow.grow ? "grow" : "",
|
|
6901
6952
|
children: [
|
|
6902
|
-
/* @__PURE__ */ (0,
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6953
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: field.controlType }),
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6904
6955
|
InputControl_default,
|
|
6905
6956
|
{
|
|
6906
6957
|
name: field.name,
|
|
@@ -6930,12 +6981,12 @@ var DataForm = (props) => {
|
|
|
6930
6981
|
}) }) }, sectionRowIndex);
|
|
6931
6982
|
}
|
|
6932
6983
|
),
|
|
6933
|
-
/* @__PURE__ */ (0,
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: section.childSections?.map(
|
|
6934
6985
|
(childSection, childSectionIndex) => {
|
|
6935
|
-
return /* @__PURE__ */ (0,
|
|
6986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
6936
6987
|
formState.inputValues,
|
|
6937
6988
|
childSection.visible
|
|
6938
|
-
) && /* @__PURE__ */ (0,
|
|
6989
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6939
6990
|
DataFormChildSection_default,
|
|
6940
6991
|
{
|
|
6941
6992
|
section: childSection,
|
|
@@ -6950,8 +7001,8 @@ var DataForm = (props) => {
|
|
|
6950
7001
|
}) })
|
|
6951
7002
|
}
|
|
6952
7003
|
),
|
|
6953
|
-
/* @__PURE__ */ (0,
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
7004
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
7005
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6955
7006
|
Button_default,
|
|
6956
7007
|
{
|
|
6957
7008
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -6959,7 +7010,7 @@ var DataForm = (props) => {
|
|
|
6959
7010
|
children: props.additionalActions.title
|
|
6960
7011
|
}
|
|
6961
7012
|
) }),
|
|
6962
|
-
/* @__PURE__ */ (0,
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6963
7014
|
Button_default,
|
|
6964
7015
|
{
|
|
6965
7016
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -6970,7 +7021,7 @@ var DataForm = (props) => {
|
|
|
6970
7021
|
children: "Delete"
|
|
6971
7022
|
}
|
|
6972
7023
|
) }),
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6974
7025
|
Button_default,
|
|
6975
7026
|
{
|
|
6976
7027
|
onValidate,
|
|
@@ -6988,7 +7039,7 @@ var DataForm_default = DataForm;
|
|
|
6988
7039
|
|
|
6989
7040
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
6990
7041
|
init_ServiceClient();
|
|
6991
|
-
var
|
|
7042
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
6992
7043
|
function getAction(actions, code) {
|
|
6993
7044
|
return actions?.find((a) => a.actionCode === code);
|
|
6994
7045
|
}
|
|
@@ -7014,9 +7065,9 @@ var DataFormRenderer = ({
|
|
|
7014
7065
|
"Delete"
|
|
7015
7066
|
);
|
|
7016
7067
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
7017
|
-
return /* @__PURE__ */ (0,
|
|
7018
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
7019
|
-
/* @__PURE__ */ (0,
|
|
7068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
7069
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
7070
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7020
7071
|
DataForm_default,
|
|
7021
7072
|
{
|
|
7022
7073
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|