@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260521120239 → 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/index.js +1082 -1054
- package/dist/index.mjs +576 -548
- 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,26 +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,
|
|
481
|
-
const hlsInitializedRef = (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);
|
|
482
221
|
const INACTIVITY_DELAY = 2500;
|
|
483
222
|
const CLICK_DEBOUNCE = 220;
|
|
484
223
|
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
485
|
-
(0,
|
|
224
|
+
(0, import_react4.useEffect)(() => {
|
|
486
225
|
const checkMobile = () => {
|
|
487
226
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
488
227
|
const isSmallScreen = window.innerWidth <= 768;
|
|
@@ -495,7 +234,7 @@ var init_HlsPlayer = __esm({
|
|
|
495
234
|
window.addEventListener("resize", checkMobile);
|
|
496
235
|
return () => window.removeEventListener("resize", checkMobile);
|
|
497
236
|
}, []);
|
|
498
|
-
(0,
|
|
237
|
+
(0, import_react4.useEffect)(() => {
|
|
499
238
|
const onFullscreenChange = () => {
|
|
500
239
|
setIsFullscreen(getFullscreenElement() === containerRef.current);
|
|
501
240
|
};
|
|
@@ -506,7 +245,7 @@ var init_HlsPlayer = __esm({
|
|
|
506
245
|
document.removeEventListener("webkitfullscreenchange", onFullscreenChange);
|
|
507
246
|
};
|
|
508
247
|
}, []);
|
|
509
|
-
(0,
|
|
248
|
+
(0, import_react4.useEffect)(() => {
|
|
510
249
|
if (isPlaying) {
|
|
511
250
|
setIsPosterVisible(false);
|
|
512
251
|
} else {
|
|
@@ -514,7 +253,7 @@ var init_HlsPlayer = __esm({
|
|
|
514
253
|
if (!v || v.currentTime === 0) setIsPosterVisible(true);
|
|
515
254
|
}
|
|
516
255
|
}, [isPlaying]);
|
|
517
|
-
const resetInactivityTimer = (0,
|
|
256
|
+
const resetInactivityTimer = (0, import_react4.useCallback)(() => {
|
|
518
257
|
setIsControlsVisible(true);
|
|
519
258
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
520
259
|
if (isPlaying) {
|
|
@@ -524,19 +263,19 @@ var init_HlsPlayer = __esm({
|
|
|
524
263
|
);
|
|
525
264
|
}
|
|
526
265
|
}, [isPlaying]);
|
|
527
|
-
(0,
|
|
266
|
+
(0, import_react4.useEffect)(() => {
|
|
528
267
|
if (!isPlaying) {
|
|
529
268
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
530
269
|
setIsControlsVisible(true);
|
|
531
270
|
}
|
|
532
271
|
}, [isPlaying]);
|
|
533
|
-
(0,
|
|
272
|
+
(0, import_react4.useEffect)(() => {
|
|
534
273
|
return () => {
|
|
535
274
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
536
275
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
537
276
|
};
|
|
538
277
|
}, []);
|
|
539
|
-
const initHls = (0,
|
|
278
|
+
const initHls = (0, import_react4.useCallback)((autoPlayAfterLoad) => {
|
|
540
279
|
const v = videoRef.current;
|
|
541
280
|
if (!v || resolvedSources.length === 0) return;
|
|
542
281
|
if (hlsRef.current) {
|
|
@@ -564,7 +303,7 @@ var init_HlsPlayer = __esm({
|
|
|
564
303
|
}
|
|
565
304
|
}
|
|
566
305
|
}, [JSON.stringify(resolvedSources)]);
|
|
567
|
-
(0,
|
|
306
|
+
(0, import_react4.useEffect)(() => {
|
|
568
307
|
if (isPlayOnHover) return;
|
|
569
308
|
initHls(
|
|
570
309
|
/* autoPlayAfterLoad */
|
|
@@ -578,7 +317,7 @@ var init_HlsPlayer = __esm({
|
|
|
578
317
|
hlsInitializedRef.current = false;
|
|
579
318
|
};
|
|
580
319
|
}, [JSON.stringify(resolvedSources), isPlayOnHover]);
|
|
581
|
-
const handlePlayPause = (0,
|
|
320
|
+
const handlePlayPause = (0, import_react4.useCallback)(() => {
|
|
582
321
|
const v = videoRef.current;
|
|
583
322
|
if (!v) return;
|
|
584
323
|
if (v.paused) {
|
|
@@ -590,13 +329,13 @@ var init_HlsPlayer = __esm({
|
|
|
590
329
|
setIsPlaying(false);
|
|
591
330
|
}
|
|
592
331
|
}, []);
|
|
593
|
-
const handleMuteToggle = (0,
|
|
332
|
+
const handleMuteToggle = (0, import_react4.useCallback)(() => {
|
|
594
333
|
const v = videoRef.current;
|
|
595
334
|
if (!v) return;
|
|
596
335
|
v.muted = !v.muted;
|
|
597
336
|
setIsMuted(v.muted);
|
|
598
337
|
}, []);
|
|
599
|
-
const handleFullscreenToggle = (0,
|
|
338
|
+
const handleFullscreenToggle = (0, import_react4.useCallback)(() => {
|
|
600
339
|
const container = containerRef.current;
|
|
601
340
|
if (!container) return;
|
|
602
341
|
if (getFullscreenElement() === container) {
|
|
@@ -605,20 +344,20 @@ var init_HlsPlayer = __esm({
|
|
|
605
344
|
requestFullscreen(container).catch(console.error);
|
|
606
345
|
}
|
|
607
346
|
}, []);
|
|
608
|
-
const handleVideoClick = (0,
|
|
347
|
+
const handleVideoClick = (0, import_react4.useCallback)(() => {
|
|
609
348
|
if (clickTimerRef.current) clearTimeout(clickTimerRef.current);
|
|
610
349
|
clickTimerRef.current = setTimeout(() => {
|
|
611
350
|
handlePlayPause();
|
|
612
351
|
}, CLICK_DEBOUNCE);
|
|
613
352
|
}, [handlePlayPause]);
|
|
614
|
-
const handleVideoDoubleClick = (0,
|
|
353
|
+
const handleVideoDoubleClick = (0, import_react4.useCallback)(() => {
|
|
615
354
|
if (clickTimerRef.current) {
|
|
616
355
|
clearTimeout(clickTimerRef.current);
|
|
617
356
|
clickTimerRef.current = null;
|
|
618
357
|
}
|
|
619
358
|
handleFullscreenToggle();
|
|
620
359
|
}, [handleFullscreenToggle]);
|
|
621
|
-
const handleMouseEnter = (0,
|
|
360
|
+
const handleMouseEnter = (0, import_react4.useCallback)(() => {
|
|
622
361
|
if (isMobile) return;
|
|
623
362
|
setIsHovered(true);
|
|
624
363
|
resetInactivityTimer();
|
|
@@ -633,7 +372,7 @@ var init_HlsPlayer = __esm({
|
|
|
633
372
|
}
|
|
634
373
|
}
|
|
635
374
|
}, [isPlayOnHover, isMobile, resetInactivityTimer, initHls]);
|
|
636
|
-
const handleMouseLeave = (0,
|
|
375
|
+
const handleMouseLeave = (0, import_react4.useCallback)(() => {
|
|
637
376
|
if (isMobile) return;
|
|
638
377
|
setIsHovered(false);
|
|
639
378
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -644,7 +383,7 @@ var init_HlsPlayer = __esm({
|
|
|
644
383
|
setIsPlaying(false);
|
|
645
384
|
}
|
|
646
385
|
}, [isPlayOnHover, isMobile, isPlaying]);
|
|
647
|
-
const handleMouseMove = (0,
|
|
386
|
+
const handleMouseMove = (0, import_react4.useCallback)(() => {
|
|
648
387
|
if (isMobile) return;
|
|
649
388
|
resetInactivityTimer();
|
|
650
389
|
}, [isMobile, resetInactivityTimer]);
|
|
@@ -674,7 +413,7 @@ var init_HlsPlayer = __esm({
|
|
|
674
413
|
if (resolvedSources.length === 0) return null;
|
|
675
414
|
const showMuteButton = !showControls && !isPlayOnHover;
|
|
676
415
|
const showExpandButton = !showControls && !isPlayOnHover;
|
|
677
|
-
return /* @__PURE__ */ (0,
|
|
416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
678
417
|
"div",
|
|
679
418
|
{
|
|
680
419
|
ref: containerRef,
|
|
@@ -683,7 +422,7 @@ var init_HlsPlayer = __esm({
|
|
|
683
422
|
onMouseLeave: handleMouseLeave,
|
|
684
423
|
onMouseMove: handleMouseMove,
|
|
685
424
|
children: [
|
|
686
|
-
/* @__PURE__ */ (0,
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
687
426
|
"video",
|
|
688
427
|
{
|
|
689
428
|
ref: videoRef,
|
|
@@ -697,7 +436,7 @@ var init_HlsPlayer = __esm({
|
|
|
697
436
|
preload: isPlayOnHover ? "none" : "auto",
|
|
698
437
|
onClick: handleVideoClick,
|
|
699
438
|
onDoubleClick: handleVideoDoubleClick,
|
|
700
|
-
children: !isPlayOnHover && resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0,
|
|
439
|
+
children: !isPlayOnHover && resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
701
440
|
"source",
|
|
702
441
|
{
|
|
703
442
|
src,
|
|
@@ -708,7 +447,7 @@ var init_HlsPlayer = __esm({
|
|
|
708
447
|
))
|
|
709
448
|
}
|
|
710
449
|
),
|
|
711
|
-
fallbackPoster && /* @__PURE__ */ (0,
|
|
450
|
+
fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
712
451
|
"picture",
|
|
713
452
|
{
|
|
714
453
|
className: "absolute inset-0 pointer-events-none",
|
|
@@ -717,8 +456,8 @@ var init_HlsPlayer = __esm({
|
|
|
717
456
|
transition: "opacity 0.4s ease"
|
|
718
457
|
},
|
|
719
458
|
children: [
|
|
720
|
-
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0,
|
|
721
|
-
/* @__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)(
|
|
722
461
|
"img",
|
|
723
462
|
{
|
|
724
463
|
src: fallbackPoster,
|
|
@@ -732,7 +471,7 @@ var init_HlsPlayer = __esm({
|
|
|
732
471
|
]
|
|
733
472
|
}
|
|
734
473
|
),
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("style", { children: `
|
|
736
475
|
.hls-play-btn {
|
|
737
476
|
will-change: transform;
|
|
738
477
|
transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
@@ -741,7 +480,7 @@ var init_HlsPlayer = __esm({
|
|
|
741
480
|
transform: scale(1.08);
|
|
742
481
|
}
|
|
743
482
|
` }),
|
|
744
|
-
!isPlayOnHover && /* @__PURE__ */ (0,
|
|
483
|
+
!isPlayOnHover && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
745
484
|
"div",
|
|
746
485
|
{
|
|
747
486
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
@@ -749,7 +488,7 @@ var init_HlsPlayer = __esm({
|
|
|
749
488
|
opacity: isControlsVisible ? 1 : 0,
|
|
750
489
|
transition: "opacity 0.3s ease"
|
|
751
490
|
},
|
|
752
|
-
children: /* @__PURE__ */ (0,
|
|
491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
753
492
|
"button",
|
|
754
493
|
{
|
|
755
494
|
type: "button",
|
|
@@ -775,7 +514,7 @@ var init_HlsPlayer = __esm({
|
|
|
775
514
|
overflow: "hidden"
|
|
776
515
|
},
|
|
777
516
|
children: [
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
779
518
|
"div",
|
|
780
519
|
{
|
|
781
520
|
style: {
|
|
@@ -787,7 +526,7 @@ var init_HlsPlayer = __esm({
|
|
|
787
526
|
}
|
|
788
527
|
}
|
|
789
528
|
),
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
791
530
|
"div",
|
|
792
531
|
{
|
|
793
532
|
style: {
|
|
@@ -801,7 +540,7 @@ var init_HlsPlayer = __esm({
|
|
|
801
540
|
),
|
|
802
541
|
isPlaying ? (
|
|
803
542
|
/* Pause — two rounded bars, sized to match play icon proportions */
|
|
804
|
-
/* @__PURE__ */ (0,
|
|
543
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
805
544
|
"svg",
|
|
806
545
|
{
|
|
807
546
|
width: playIconSize,
|
|
@@ -810,8 +549,8 @@ var init_HlsPlayer = __esm({
|
|
|
810
549
|
fill: "none",
|
|
811
550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
812
551
|
children: [
|
|
813
|
-
/* @__PURE__ */ (0,
|
|
814
|
-
/* @__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" })
|
|
815
554
|
]
|
|
816
555
|
}
|
|
817
556
|
)
|
|
@@ -821,7 +560,7 @@ var init_HlsPlayer = __esm({
|
|
|
821
560
|
* Original viewBox is "0,0,240,250" (with a 5.33x scale group inside).
|
|
822
561
|
* We flatten the transform: effective drawing area is 240×250 units.
|
|
823
562
|
*/
|
|
824
|
-
/* @__PURE__ */ (0,
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
825
564
|
"svg",
|
|
826
565
|
{
|
|
827
566
|
width: playIconSize,
|
|
@@ -830,7 +569,7 @@ var init_HlsPlayer = __esm({
|
|
|
830
569
|
fill: "none",
|
|
831
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
832
571
|
style: { transform: "translateX(4%)" },
|
|
833
|
-
children: /* @__PURE__ */ (0,
|
|
572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
834
573
|
"path",
|
|
835
574
|
{
|
|
836
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",
|
|
@@ -845,7 +584,7 @@ var init_HlsPlayer = __esm({
|
|
|
845
584
|
)
|
|
846
585
|
}
|
|
847
586
|
),
|
|
848
|
-
/* @__PURE__ */ (0,
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
849
588
|
"div",
|
|
850
589
|
{
|
|
851
590
|
className: "absolute bottom-4 right-4 pointer-events-none",
|
|
@@ -857,7 +596,7 @@ var init_HlsPlayer = __esm({
|
|
|
857
596
|
transition: "opacity 0.3s ease"
|
|
858
597
|
},
|
|
859
598
|
children: [
|
|
860
|
-
showMuteButton && /* @__PURE__ */ (0,
|
|
599
|
+
showMuteButton && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
861
600
|
"button",
|
|
862
601
|
{
|
|
863
602
|
type: "button",
|
|
@@ -867,18 +606,18 @@ var init_HlsPlayer = __esm({
|
|
|
867
606
|
handleMuteToggle();
|
|
868
607
|
},
|
|
869
608
|
style: iconButtonStyle,
|
|
870
|
-
children: isMuted ? /* @__PURE__ */ (0,
|
|
871
|
-
/* @__PURE__ */ (0,
|
|
872
|
-
/* @__PURE__ */ (0,
|
|
873
|
-
/* @__PURE__ */ (0,
|
|
874
|
-
] }) : /* @__PURE__ */ (0,
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
876
|
-
/* @__PURE__ */ (0,
|
|
877
|
-
/* @__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" })
|
|
878
617
|
] })
|
|
879
618
|
}
|
|
880
619
|
),
|
|
881
|
-
showExpandButton && /* @__PURE__ */ (0,
|
|
620
|
+
showExpandButton && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
882
621
|
"button",
|
|
883
622
|
{
|
|
884
623
|
type: "button",
|
|
@@ -888,7 +627,7 @@ var init_HlsPlayer = __esm({
|
|
|
888
627
|
handleFullscreenToggle();
|
|
889
628
|
},
|
|
890
629
|
style: iconButtonStyle,
|
|
891
|
-
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" }) })
|
|
892
631
|
}
|
|
893
632
|
)
|
|
894
633
|
]
|
|
@@ -896,11 +635,272 @@ var init_HlsPlayer = __esm({
|
|
|
896
635
|
)
|
|
897
636
|
]
|
|
898
637
|
}
|
|
899
|
-
);
|
|
900
|
-
}
|
|
901
|
-
);
|
|
902
|
-
HlsPlayer.displayName = "HlsPlayer";
|
|
903
|
-
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;
|
|
904
904
|
}
|
|
905
905
|
});
|
|
906
906
|
|
|
@@ -1123,7 +1123,7 @@ var LinkNodeButton_exports = {};
|
|
|
1123
1123
|
__export(LinkNodeButton_exports, {
|
|
1124
1124
|
default: () => LinkNodeButton_default
|
|
1125
1125
|
});
|
|
1126
|
-
var import_react34,
|
|
1126
|
+
var import_react34, import_jsx_runtime46, LinkNodeButton, LinkNodeButton_default;
|
|
1127
1127
|
var init_LinkNodeButton = __esm({
|
|
1128
1128
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
1129
1129
|
"use strict";
|
|
@@ -1132,7 +1132,7 @@ var init_LinkNodeButton = __esm({
|
|
|
1132
1132
|
init_Button();
|
|
1133
1133
|
init_ServiceClient();
|
|
1134
1134
|
init_ToastService();
|
|
1135
|
-
|
|
1135
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1136
1136
|
LinkNodeButton = (props) => {
|
|
1137
1137
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
1138
1138
|
const [isLoading, setIsLoading] = (0, import_react34.useState)(false);
|
|
@@ -1275,11 +1275,11 @@ var init_LinkNodeButton = __esm({
|
|
|
1275
1275
|
return children;
|
|
1276
1276
|
}
|
|
1277
1277
|
if (linkText) {
|
|
1278
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: linkText });
|
|
1279
1279
|
}
|
|
1280
1280
|
return node.title || "Button";
|
|
1281
1281
|
};
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1283
1283
|
Button_default,
|
|
1284
1284
|
{
|
|
1285
1285
|
ButtonType: linkType,
|
|
@@ -1317,13 +1317,13 @@ function CopyButton({ text }) {
|
|
|
1317
1317
|
console.error("Failed to copy: ", err);
|
|
1318
1318
|
}
|
|
1319
1319
|
};
|
|
1320
|
-
return /* @__PURE__ */ (0,
|
|
1320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
1321
1321
|
"button",
|
|
1322
1322
|
{
|
|
1323
1323
|
onClick: handleCopy,
|
|
1324
1324
|
className: "flex gap-1 items-center hover:text-white transition",
|
|
1325
1325
|
children: [
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1327
1327
|
"svg",
|
|
1328
1328
|
{
|
|
1329
1329
|
width: "16",
|
|
@@ -1331,7 +1331,7 @@ function CopyButton({ text }) {
|
|
|
1331
1331
|
viewBox: "0 0 24 24",
|
|
1332
1332
|
className: "w-4 h-4",
|
|
1333
1333
|
fill: "currentColor",
|
|
1334
|
-
children: /* @__PURE__ */ (0,
|
|
1334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1335
1335
|
"path",
|
|
1336
1336
|
{
|
|
1337
1337
|
fillRule: "evenodd",
|
|
@@ -1346,54 +1346,54 @@ function CopyButton({ text }) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
);
|
|
1348
1348
|
}
|
|
1349
|
-
var import_react41,
|
|
1349
|
+
var import_react41, import_jsx_runtime56;
|
|
1350
1350
|
var init_CopyButton = __esm({
|
|
1351
1351
|
"src/components/CopyButton.tsx"() {
|
|
1352
1352
|
"use strict";
|
|
1353
1353
|
"use client";
|
|
1354
1354
|
import_react41 = require("react");
|
|
1355
|
-
|
|
1355
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1356
1356
|
}
|
|
1357
1357
|
});
|
|
1358
1358
|
|
|
1359
1359
|
// src/components/IFrameLoaderView.tsx
|
|
1360
|
-
var import_react45,
|
|
1360
|
+
var import_react45, import_jsx_runtime62, IFrameLoaderView, IFrameLoaderView_default;
|
|
1361
1361
|
var init_IFrameLoaderView = __esm({
|
|
1362
1362
|
"src/components/IFrameLoaderView.tsx"() {
|
|
1363
1363
|
"use strict";
|
|
1364
1364
|
import_react45 = __toESM(require("react"));
|
|
1365
|
-
|
|
1365
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
1366
1366
|
IFrameLoaderView = (props) => {
|
|
1367
|
-
return /* @__PURE__ */ (0,
|
|
1368
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__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" })
|
|
1374
1374
|
] })
|
|
1375
1375
|
] }),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1379
|
-
/* @__PURE__ */ (0,
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1381
|
-
/* @__PURE__ */ (0,
|
|
1382
|
-
/* @__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" })
|
|
1383
1383
|
] }),
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1388
|
-
/* @__PURE__ */ (0,
|
|
1389
|
-
/* @__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" })
|
|
1390
1390
|
] }),
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1396
|
-
/* @__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" })
|
|
1397
1397
|
] })
|
|
1398
1398
|
] })
|
|
1399
1399
|
] }) }),
|
|
@@ -1409,14 +1409,14 @@ var IframeClient_exports = {};
|
|
|
1409
1409
|
__export(IframeClient_exports, {
|
|
1410
1410
|
default: () => IframeClient_default
|
|
1411
1411
|
});
|
|
1412
|
-
var import_react46,
|
|
1412
|
+
var import_react46, import_jsx_runtime63, IframeClient, IframeClient_default;
|
|
1413
1413
|
var init_IframeClient = __esm({
|
|
1414
1414
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1415
1415
|
"use strict";
|
|
1416
1416
|
"use client";
|
|
1417
1417
|
import_react46 = __toESM(require("react"));
|
|
1418
1418
|
init_IFrameLoaderView();
|
|
1419
|
-
|
|
1419
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
1420
1420
|
IframeClient = ({ src }) => {
|
|
1421
1421
|
const iframeRef = (0, import_react46.useRef)(null);
|
|
1422
1422
|
const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
|
|
@@ -1448,7 +1448,7 @@ var init_IframeClient = __esm({
|
|
|
1448
1448
|
const handleIframeLoad = () => {
|
|
1449
1449
|
setIsDataFound(true);
|
|
1450
1450
|
};
|
|
1451
|
-
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)(
|
|
1452
1452
|
"iframe",
|
|
1453
1453
|
{
|
|
1454
1454
|
ref: iframeRef,
|
|
@@ -1496,7 +1496,7 @@ __export(index_exports, {
|
|
|
1496
1496
|
module.exports = __toCommonJS(index_exports);
|
|
1497
1497
|
|
|
1498
1498
|
// src/components/controls/view/ViewControl.tsx
|
|
1499
|
-
var
|
|
1499
|
+
var import_react11 = __toESM(require("react"));
|
|
1500
1500
|
|
|
1501
1501
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1502
1502
|
var ViewControlTypes = {
|
|
@@ -1579,16 +1579,186 @@ var BooleanView = (props) => {
|
|
|
1579
1579
|
};
|
|
1580
1580
|
var BooleanView_default = BooleanView;
|
|
1581
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
|
+
|
|
1582
1752
|
// src/components/controls/view/LineTextView.tsx
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1753
|
+
var import_react5 = __toESM(require("react"));
|
|
1754
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1585
1755
|
var LineText = (props) => {
|
|
1586
|
-
return /* @__PURE__ */ (0,
|
|
1756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react5.default.Fragment, { children: props.value });
|
|
1587
1757
|
};
|
|
1588
1758
|
var LineTextView_default = LineText;
|
|
1589
1759
|
|
|
1590
1760
|
// src/components/controls/view/MoneyView.tsx
|
|
1591
|
-
var
|
|
1761
|
+
var import_react6 = __toESM(require("react"));
|
|
1592
1762
|
|
|
1593
1763
|
// src/components/utilities/CurrencyUtility.tsx
|
|
1594
1764
|
var CurrencyUtility = class {
|
|
@@ -1609,40 +1779,40 @@ var CurrencyUtility = class {
|
|
|
1609
1779
|
var CurrencyUtility_default = CurrencyUtility;
|
|
1610
1780
|
|
|
1611
1781
|
// src/components/controls/view/MoneyView.tsx
|
|
1612
|
-
var
|
|
1782
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1613
1783
|
var Money = (props) => {
|
|
1614
1784
|
const parsedNumber = parseFloat(props.value);
|
|
1615
|
-
return /* @__PURE__ */ (0,
|
|
1616
|
-
/* @__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) }),
|
|
1617
1787
|
parsedNumber.toLocaleString()
|
|
1618
1788
|
] }) });
|
|
1619
1789
|
};
|
|
1620
1790
|
var MoneyView_default = Money;
|
|
1621
1791
|
|
|
1622
1792
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1623
|
-
var
|
|
1624
|
-
var
|
|
1793
|
+
var import_react7 = __toESM(require("react"));
|
|
1794
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1625
1795
|
var MultilineTextBullets = (props) => {
|
|
1626
1796
|
const lines = props.value?.split("\\n");
|
|
1627
|
-
return /* @__PURE__ */ (0,
|
|
1628
|
-
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);
|
|
1629
1799
|
}) }) });
|
|
1630
1800
|
};
|
|
1631
1801
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1632
1802
|
|
|
1633
1803
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1634
|
-
var
|
|
1635
|
-
var
|
|
1804
|
+
var import_react8 = __toESM(require("react"));
|
|
1805
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1636
1806
|
var MultilineText = (props) => {
|
|
1637
|
-
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 }) });
|
|
1638
1808
|
};
|
|
1639
1809
|
var MultilineTextView_default = MultilineText;
|
|
1640
1810
|
|
|
1641
1811
|
// src/components/controls/view/PercentageView.tsx
|
|
1642
|
-
var
|
|
1643
|
-
var
|
|
1812
|
+
var import_react9 = __toESM(require("react"));
|
|
1813
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1644
1814
|
var PercentageView = (props) => {
|
|
1645
|
-
return /* @__PURE__ */ (0,
|
|
1815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react9.default.Fragment, { children: [
|
|
1646
1816
|
props.value,
|
|
1647
1817
|
"%"
|
|
1648
1818
|
] });
|
|
@@ -1650,16 +1820,16 @@ var PercentageView = (props) => {
|
|
|
1650
1820
|
var PercentageView_default = PercentageView;
|
|
1651
1821
|
|
|
1652
1822
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1823
|
+
var import_react10 = __toESM(require("react"));
|
|
1824
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1655
1825
|
var ProgressIndicator = (props) => {
|
|
1656
1826
|
const percentage = 100;
|
|
1657
1827
|
const circumference = Math.PI * 56;
|
|
1658
1828
|
const offset = circumference * (1 - percentage / 100);
|
|
1659
|
-
return /* @__PURE__ */ (0,
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
/* @__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: [
|
|
1663
1833
|
percentage,
|
|
1664
1834
|
"%"
|
|
1665
1835
|
] }) })
|
|
@@ -1668,18 +1838,18 @@ var ProgressIndicator = (props) => {
|
|
|
1668
1838
|
var ProgressIndicator_default = ProgressIndicator;
|
|
1669
1839
|
|
|
1670
1840
|
// src/components/controls/view/AiGeneratedSummary.tsx
|
|
1671
|
-
var
|
|
1841
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1672
1842
|
var AiGeneratedSummary = (props) => {
|
|
1673
1843
|
const lines = props.value?.split("\n").filter((line) => line.trim() !== "") || [];
|
|
1674
|
-
return /* @__PURE__ */ (0,
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1679
|
-
/* @__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" })
|
|
1680
1850
|
] })
|
|
1681
1851
|
] }) }),
|
|
1682
|
-
/* @__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)) }) })
|
|
1683
1853
|
] });
|
|
1684
1854
|
};
|
|
1685
1855
|
var AiGeneratedSummary_default = AiGeneratedSummary;
|
|
@@ -1692,11 +1862,11 @@ var DateTimeView = (0, import_dynamic2.default)(() => Promise.resolve().then(()
|
|
|
1692
1862
|
var DateTimeVew_default = DateTimeView;
|
|
1693
1863
|
|
|
1694
1864
|
// src/components/controls/view/ViewControl.tsx
|
|
1695
|
-
var
|
|
1865
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1696
1866
|
var ViewControl = (props) => {
|
|
1697
1867
|
const ControlComponents = {
|
|
1698
1868
|
[ViewControlTypes_default.lineText]: LineTextView_default,
|
|
1699
|
-
|
|
1869
|
+
[ViewControlTypes_default.asset]: Asset_default,
|
|
1700
1870
|
[ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
|
|
1701
1871
|
[ViewControlTypes_default.boolean]: BooleanView_default,
|
|
1702
1872
|
[ViewControlTypes_default.money]: MoneyView_default,
|
|
@@ -1714,16 +1884,16 @@ var ViewControl = (props) => {
|
|
|
1714
1884
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1715
1885
|
};
|
|
1716
1886
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1717
|
-
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 });
|
|
1718
1888
|
};
|
|
1719
1889
|
var ViewControl_default = ViewControl;
|
|
1720
1890
|
|
|
1721
1891
|
// src/components/controls/edit/InputControl.tsx
|
|
1722
|
-
var
|
|
1892
|
+
var import_react32 = __toESM(require("react"));
|
|
1723
1893
|
|
|
1724
1894
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1725
|
-
var
|
|
1726
|
-
var
|
|
1895
|
+
var import_react12 = __toESM(require("react"));
|
|
1896
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1727
1897
|
var MultilineTextInput = (props) => {
|
|
1728
1898
|
const textChangeHandler = (event) => {
|
|
1729
1899
|
const text = event.target.value;
|
|
@@ -1742,11 +1912,11 @@ var MultilineTextInput = (props) => {
|
|
|
1742
1912
|
if (props.value !== void 0 && props.value !== null) {
|
|
1743
1913
|
value = props.value;
|
|
1744
1914
|
}
|
|
1745
|
-
return /* @__PURE__ */ (0,
|
|
1746
|
-
/* @__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 }),
|
|
1747
1917
|
" ",
|
|
1748
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1749
|
-
/* @__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)(
|
|
1750
1920
|
"textarea",
|
|
1751
1921
|
{
|
|
1752
1922
|
name: props.name,
|
|
@@ -1763,14 +1933,14 @@ var MultilineTextInput = (props) => {
|
|
|
1763
1933
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
1764
1934
|
}
|
|
1765
1935
|
),
|
|
1766
|
-
/* @__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 : "" })
|
|
1767
1937
|
] }) });
|
|
1768
1938
|
};
|
|
1769
1939
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1770
1940
|
|
|
1771
1941
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1772
|
-
var
|
|
1773
|
-
var
|
|
1942
|
+
var import_react13 = __toESM(require("react"));
|
|
1943
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1774
1944
|
var LineTextInput = (props) => {
|
|
1775
1945
|
const textChangeHandler = (event) => {
|
|
1776
1946
|
const text = event.target.value;
|
|
@@ -1789,11 +1959,11 @@ var LineTextInput = (props) => {
|
|
|
1789
1959
|
if (props.value !== void 0 && props.value !== null) {
|
|
1790
1960
|
value = props.value;
|
|
1791
1961
|
}
|
|
1792
|
-
return /* @__PURE__ */ (0,
|
|
1793
|
-
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 }),
|
|
1794
1964
|
" ",
|
|
1795
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1796
|
-
/* @__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)(
|
|
1797
1967
|
"input",
|
|
1798
1968
|
{
|
|
1799
1969
|
type: "text",
|
|
@@ -1813,14 +1983,14 @@ var LineTextInput = (props) => {
|
|
|
1813
1983
|
`
|
|
1814
1984
|
}
|
|
1815
1985
|
),
|
|
1816
|
-
/* @__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 : "" })
|
|
1817
1987
|
] }) });
|
|
1818
1988
|
};
|
|
1819
1989
|
var LineTextInput_default = LineTextInput;
|
|
1820
1990
|
|
|
1821
1991
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1822
|
-
var
|
|
1823
|
-
var
|
|
1992
|
+
var import_react14 = __toESM(require("react"));
|
|
1993
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1824
1994
|
var MoneyInput = (props) => {
|
|
1825
1995
|
const textChangeHandler = (event) => {
|
|
1826
1996
|
const rawValue = event.target.value;
|
|
@@ -1849,11 +2019,11 @@ var MoneyInput = (props) => {
|
|
|
1849
2019
|
e.preventDefault();
|
|
1850
2020
|
}
|
|
1851
2021
|
};
|
|
1852
|
-
return /* @__PURE__ */ (0,
|
|
1853
|
-
/* @__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 }),
|
|
1854
2024
|
" ",
|
|
1855
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1856
|
-
/* @__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)(
|
|
1857
2027
|
"input",
|
|
1858
2028
|
{
|
|
1859
2029
|
type: "number",
|
|
@@ -1873,7 +2043,7 @@ var MoneyInput = (props) => {
|
|
|
1873
2043
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1874
2044
|
}
|
|
1875
2045
|
),
|
|
1876
|
-
/* @__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 : "" })
|
|
1877
2047
|
] }) });
|
|
1878
2048
|
};
|
|
1879
2049
|
var MoneyInput_default = MoneyInput;
|
|
@@ -1904,10 +2074,10 @@ var InputControlType = {
|
|
|
1904
2074
|
var InputControlType_default = InputControlType;
|
|
1905
2075
|
|
|
1906
2076
|
// src/components/controls/edit/Select.tsx
|
|
1907
|
-
var
|
|
1908
|
-
var
|
|
2077
|
+
var import_react15 = require("react");
|
|
2078
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1909
2079
|
var Select = (props) => {
|
|
1910
|
-
const [list, setList] = (0,
|
|
2080
|
+
const [list, setList] = (0, import_react15.useState)([]);
|
|
1911
2081
|
const getSafeValue = (val) => {
|
|
1912
2082
|
if (val === null || val === void 0) return "";
|
|
1913
2083
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1936,7 +2106,7 @@ var Select = (props) => {
|
|
|
1936
2106
|
groupKey: props.groupKey
|
|
1937
2107
|
});
|
|
1938
2108
|
};
|
|
1939
|
-
(0,
|
|
2109
|
+
(0, import_react15.useEffect)(() => {
|
|
1940
2110
|
async function fetchData() {
|
|
1941
2111
|
if (props.dataset) {
|
|
1942
2112
|
setList(props.dataset);
|
|
@@ -1963,11 +2133,11 @@ var Select = (props) => {
|
|
|
1963
2133
|
props.dataSourceDependsOn
|
|
1964
2134
|
]);
|
|
1965
2135
|
const value = getSafeValue(props.value);
|
|
1966
|
-
return /* @__PURE__ */ (0,
|
|
1967
|
-
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 }),
|
|
1968
2138
|
" ",
|
|
1969
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0,
|
|
1970
|
-
/* @__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)(
|
|
1971
2141
|
"select",
|
|
1972
2142
|
{
|
|
1973
2143
|
name: props.name,
|
|
@@ -1978,23 +2148,23 @@ var Select = (props) => {
|
|
|
1978
2148
|
disabled: props.attributes?.readOnly,
|
|
1979
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",
|
|
1980
2150
|
children: [
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1982
2152
|
list.map((item, index) => {
|
|
1983
2153
|
const keyField = props.dataKeyFieldName;
|
|
1984
2154
|
const textField = props.dataTextFieldName;
|
|
1985
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
1986
2156
|
})
|
|
1987
2157
|
]
|
|
1988
2158
|
}
|
|
1989
2159
|
),
|
|
1990
|
-
/* @__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 || "" })
|
|
1991
2161
|
] });
|
|
1992
2162
|
};
|
|
1993
2163
|
var Select_default = Select;
|
|
1994
2164
|
|
|
1995
2165
|
// src/components/controls/edit/PercentageInput.tsx
|
|
1996
|
-
var
|
|
1997
|
-
var
|
|
2166
|
+
var import_react16 = __toESM(require("react"));
|
|
2167
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1998
2168
|
var PercentageInput = (props) => {
|
|
1999
2169
|
const textChangeHandler = (event) => {
|
|
2000
2170
|
const rawValue = event.target.value;
|
|
@@ -2023,11 +2193,11 @@ var PercentageInput = (props) => {
|
|
|
2023
2193
|
e.preventDefault();
|
|
2024
2194
|
}
|
|
2025
2195
|
};
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2027
|
-
/* @__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 + " %" : "" }),
|
|
2028
2198
|
" ",
|
|
2029
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2030
|
-
/* @__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)(
|
|
2031
2201
|
"input",
|
|
2032
2202
|
{
|
|
2033
2203
|
type: "number",
|
|
@@ -2046,14 +2216,14 @@ var PercentageInput = (props) => {
|
|
|
2046
2216
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
2047
2217
|
}
|
|
2048
2218
|
),
|
|
2049
|
-
/* @__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 : "" })
|
|
2050
2220
|
] }) });
|
|
2051
2221
|
};
|
|
2052
2222
|
var PercentageInput_default = PercentageInput;
|
|
2053
2223
|
|
|
2054
2224
|
// src/components/controls/edit/PhoneInput.tsx
|
|
2055
|
-
var
|
|
2056
|
-
var
|
|
2225
|
+
var import_react17 = __toESM(require("react"));
|
|
2226
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2057
2227
|
var PhoneInput = (props) => {
|
|
2058
2228
|
const textChangeHandler = (event) => {
|
|
2059
2229
|
const text = event.target.value;
|
|
@@ -2072,13 +2242,13 @@ var PhoneInput = (props) => {
|
|
|
2072
2242
|
if (props.value !== void 0 && props.value !== null) {
|
|
2073
2243
|
value = props.value;
|
|
2074
2244
|
}
|
|
2075
|
-
return /* @__PURE__ */ (0,
|
|
2076
|
-
/* @__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 }),
|
|
2077
2247
|
" ",
|
|
2078
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2081
|
-
/* @__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)(
|
|
2082
2252
|
"input",
|
|
2083
2253
|
{
|
|
2084
2254
|
type: "text",
|
|
@@ -2096,14 +2266,14 @@ var PhoneInput = (props) => {
|
|
|
2096
2266
|
}
|
|
2097
2267
|
)
|
|
2098
2268
|
] }),
|
|
2099
|
-
/* @__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 : "" })
|
|
2100
2270
|
] }) });
|
|
2101
2271
|
};
|
|
2102
2272
|
var PhoneInput_default = PhoneInput;
|
|
2103
2273
|
|
|
2104
2274
|
// src/components/controls/edit/NumberInput.tsx
|
|
2105
|
-
var
|
|
2106
|
-
var
|
|
2275
|
+
var import_react18 = __toESM(require("react"));
|
|
2276
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2107
2277
|
var NumberInput = (props) => {
|
|
2108
2278
|
const textChangeHandler = (event) => {
|
|
2109
2279
|
const text = event.target.value;
|
|
@@ -2126,11 +2296,11 @@ var NumberInput = (props) => {
|
|
|
2126
2296
|
if (props.value !== void 0 && props.value !== null) {
|
|
2127
2297
|
value = props.value;
|
|
2128
2298
|
}
|
|
2129
|
-
return /* @__PURE__ */ (0,
|
|
2130
|
-
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 }),
|
|
2131
2301
|
" ",
|
|
2132
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2133
|
-
/* @__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)(
|
|
2134
2304
|
"input",
|
|
2135
2305
|
{
|
|
2136
2306
|
type: "number",
|
|
@@ -2149,14 +2319,14 @@ var NumberInput = (props) => {
|
|
|
2149
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 "
|
|
2150
2320
|
}
|
|
2151
2321
|
),
|
|
2152
|
-
/* @__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 : "" })
|
|
2153
2323
|
] }) });
|
|
2154
2324
|
};
|
|
2155
2325
|
var NumberInput_default = NumberInput;
|
|
2156
2326
|
|
|
2157
2327
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
2158
|
-
var
|
|
2159
|
-
var
|
|
2328
|
+
var import_react19 = __toESM(require("react"));
|
|
2329
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2160
2330
|
var CheckboxInput = (props) => {
|
|
2161
2331
|
const textChangeHandler = (event) => {
|
|
2162
2332
|
let text = event.target.checked;
|
|
@@ -2173,11 +2343,11 @@ var CheckboxInput = (props) => {
|
|
|
2173
2343
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
2174
2344
|
value = true;
|
|
2175
2345
|
}
|
|
2176
|
-
return /* @__PURE__ */ (0,
|
|
2177
|
-
/* @__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 }),
|
|
2178
2348
|
" ",
|
|
2179
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2180
|
-
/* @__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)(
|
|
2181
2351
|
"input",
|
|
2182
2352
|
{
|
|
2183
2353
|
type: "checkbox",
|
|
@@ -2194,14 +2364,14 @@ var CheckboxInput = (props) => {
|
|
|
2194
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 "
|
|
2195
2365
|
}
|
|
2196
2366
|
),
|
|
2197
|
-
/* @__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 : "" })
|
|
2198
2368
|
] }) });
|
|
2199
2369
|
};
|
|
2200
2370
|
var CheckboxInput_default = CheckboxInput;
|
|
2201
2371
|
|
|
2202
2372
|
// src/components/controls/edit/OtpInput.tsx
|
|
2203
|
-
var
|
|
2204
|
-
var
|
|
2373
|
+
var import_react20 = __toESM(require("react"));
|
|
2374
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2205
2375
|
var OtpInput = (props) => {
|
|
2206
2376
|
const textChangeHandler = (event) => {
|
|
2207
2377
|
const text = event.target.value;
|
|
@@ -2223,11 +2393,11 @@ var OtpInput = (props) => {
|
|
|
2223
2393
|
if (props.value !== void 0 && props.value !== null) {
|
|
2224
2394
|
value = props.value;
|
|
2225
2395
|
}
|
|
2226
|
-
return /* @__PURE__ */ (0,
|
|
2227
|
-
/* @__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 }),
|
|
2228
2398
|
" ",
|
|
2229
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2230
|
-
/* @__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)(
|
|
2231
2401
|
"input",
|
|
2232
2402
|
{
|
|
2233
2403
|
type: "text",
|
|
@@ -2247,14 +2417,14 @@ var OtpInput = (props) => {
|
|
|
2247
2417
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
2248
2418
|
}
|
|
2249
2419
|
),
|
|
2250
|
-
/* @__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 : "" })
|
|
2251
2421
|
] }) });
|
|
2252
2422
|
};
|
|
2253
2423
|
var OtpInput_default = OtpInput;
|
|
2254
2424
|
|
|
2255
2425
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2256
|
-
var
|
|
2257
|
-
var
|
|
2426
|
+
var import_react21 = __toESM(require("react"));
|
|
2427
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2258
2428
|
var DateTimeInput = (props) => {
|
|
2259
2429
|
const textChangeHandler = (event) => {
|
|
2260
2430
|
const localDate = new Date(event.target.value);
|
|
@@ -2286,12 +2456,12 @@ var DateTimeInput = (props) => {
|
|
|
2286
2456
|
e.preventDefault();
|
|
2287
2457
|
}
|
|
2288
2458
|
};
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2290
|
-
/* @__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 }),
|
|
2291
2461
|
" ",
|
|
2292
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2294
|
-
/* @__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)(
|
|
2295
2465
|
"input",
|
|
2296
2466
|
{
|
|
2297
2467
|
type: "datetime-local",
|
|
@@ -2309,19 +2479,19 @@ var DateTimeInput = (props) => {
|
|
|
2309
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 "
|
|
2310
2480
|
}
|
|
2311
2481
|
),
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: timeZoneAbbr })
|
|
2313
2483
|
] }),
|
|
2314
|
-
/* @__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 : "" })
|
|
2315
2485
|
] }) });
|
|
2316
2486
|
};
|
|
2317
2487
|
var DateTimeInput_default = DateTimeInput;
|
|
2318
2488
|
|
|
2319
2489
|
// src/components/controls/edit/ColorInput.tsx
|
|
2320
|
-
var
|
|
2321
|
-
var
|
|
2490
|
+
var import_react22 = __toESM(require("react"));
|
|
2491
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2322
2492
|
var ColorInput = (props) => {
|
|
2323
|
-
const [color, setColor] =
|
|
2324
|
-
(0,
|
|
2493
|
+
const [color, setColor] = import_react22.default.useState("#3b82f6");
|
|
2494
|
+
(0, import_react22.useEffect)(() => {
|
|
2325
2495
|
if (props.value !== void 0 && props.value !== null) {
|
|
2326
2496
|
if (typeof props.value === "string") {
|
|
2327
2497
|
setColor(props.value);
|
|
@@ -2340,11 +2510,11 @@ var ColorInput = (props) => {
|
|
|
2340
2510
|
});
|
|
2341
2511
|
}
|
|
2342
2512
|
};
|
|
2343
|
-
return /* @__PURE__ */ (0,
|
|
2344
|
-
/* @__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 }),
|
|
2345
2515
|
" ",
|
|
2346
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2347
|
-
/* @__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)(
|
|
2348
2518
|
"input",
|
|
2349
2519
|
{
|
|
2350
2520
|
type: "color",
|
|
@@ -2357,21 +2527,21 @@ var ColorInput = (props) => {
|
|
|
2357
2527
|
className: `w-[78px] h-12 block cursor-pointer`
|
|
2358
2528
|
}
|
|
2359
2529
|
),
|
|
2360
|
-
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 })
|
|
2361
2531
|
] });
|
|
2362
2532
|
};
|
|
2363
2533
|
var ColorInput_default = ColorInput;
|
|
2364
2534
|
|
|
2365
2535
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2366
|
-
var
|
|
2367
|
-
var
|
|
2536
|
+
var import_react23 = require("react");
|
|
2537
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2368
2538
|
var SelectWithSearchInput = (props) => {
|
|
2369
|
-
const [isOpen, setIsOpen] = (0,
|
|
2370
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2371
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2372
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2373
|
-
const [list, setList] = (0,
|
|
2374
|
-
(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)(() => {
|
|
2375
2545
|
async function fetchData() {
|
|
2376
2546
|
if (props.dataset) {
|
|
2377
2547
|
setList(props.dataset);
|
|
@@ -2425,8 +2595,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2425
2595
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2426
2596
|
}
|
|
2427
2597
|
};
|
|
2428
|
-
const dropdownRef = (0,
|
|
2429
|
-
(0,
|
|
2598
|
+
const dropdownRef = (0, import_react23.useRef)(null);
|
|
2599
|
+
(0, import_react23.useEffect)(() => {
|
|
2430
2600
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2431
2601
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2432
2602
|
highlightedItem?.scrollIntoView({
|
|
@@ -2435,15 +2605,15 @@ var SelectWithSearchInput = (props) => {
|
|
|
2435
2605
|
});
|
|
2436
2606
|
}
|
|
2437
2607
|
}, [highlightedIndex]);
|
|
2438
|
-
return /* @__PURE__ */ (0,
|
|
2439
|
-
/* @__PURE__ */ (0,
|
|
2608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2609
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { children: [
|
|
2440
2610
|
props.attributes?.label,
|
|
2441
2611
|
" ",
|
|
2442
2612
|
" ",
|
|
2443
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2613
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2444
2614
|
] }),
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2615
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2616
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2447
2617
|
"input",
|
|
2448
2618
|
{
|
|
2449
2619
|
type: "text",
|
|
@@ -2459,13 +2629,13 @@ var SelectWithSearchInput = (props) => {
|
|
|
2459
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 "
|
|
2460
2630
|
}
|
|
2461
2631
|
),
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2463
2633
|
"button",
|
|
2464
2634
|
{
|
|
2465
2635
|
type: "button",
|
|
2466
2636
|
onClick: () => setIsOpen(!isOpen),
|
|
2467
2637
|
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
2468
|
-
children: /* @__PURE__ */ (0,
|
|
2638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2469
2639
|
"svg",
|
|
2470
2640
|
{
|
|
2471
2641
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2474,7 +2644,7 @@ var SelectWithSearchInput = (props) => {
|
|
|
2474
2644
|
strokeWidth: 1.5,
|
|
2475
2645
|
stroke: "currentColor",
|
|
2476
2646
|
className: "w-full h-full",
|
|
2477
|
-
children: /* @__PURE__ */ (0,
|
|
2647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2478
2648
|
"path",
|
|
2479
2649
|
{
|
|
2480
2650
|
strokeLinecap: "round",
|
|
@@ -2487,12 +2657,12 @@ var SelectWithSearchInput = (props) => {
|
|
|
2487
2657
|
}
|
|
2488
2658
|
)
|
|
2489
2659
|
] }),
|
|
2490
|
-
isOpen && /* @__PURE__ */ (0,
|
|
2660
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2491
2661
|
"div",
|
|
2492
2662
|
{
|
|
2493
2663
|
ref: dropdownRef,
|
|
2494
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",
|
|
2495
|
-
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)(
|
|
2496
2666
|
"button",
|
|
2497
2667
|
{
|
|
2498
2668
|
onClick: (e) => handleSelect(e, item),
|
|
@@ -2500,10 +2670,10 @@ var SelectWithSearchInput = (props) => {
|
|
|
2500
2670
|
role: "option",
|
|
2501
2671
|
tabIndex: -1,
|
|
2502
2672
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2503
|
-
children: /* @__PURE__ */ (0,
|
|
2673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
2504
2674
|
},
|
|
2505
2675
|
item[props.dataKeyFieldName]
|
|
2506
|
-
)) : /* @__PURE__ */ (0,
|
|
2676
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2507
2677
|
}
|
|
2508
2678
|
)
|
|
2509
2679
|
] });
|
|
@@ -2512,22 +2682,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2512
2682
|
|
|
2513
2683
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2514
2684
|
init_Button();
|
|
2515
|
-
var
|
|
2516
|
-
var
|
|
2685
|
+
var import_react27 = __toESM(require("react"));
|
|
2686
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2517
2687
|
var SelectWithSearchPanel = (props) => {
|
|
2518
|
-
const [isOpen, setIsOpen] = (0,
|
|
2519
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2520
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2521
|
-
const [list, setList] = (0,
|
|
2522
|
-
const listRef = (0,
|
|
2523
|
-
const [isError, setIsError] = (0,
|
|
2524
|
-
const containerRef = (0,
|
|
2525
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
2526
|
-
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)({});
|
|
2527
2697
|
const getNestedValue3 = (obj, path) => {
|
|
2528
2698
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2529
2699
|
};
|
|
2530
|
-
(0,
|
|
2700
|
+
(0, import_react27.useEffect)(() => {
|
|
2531
2701
|
const handleClickOutside = (event) => {
|
|
2532
2702
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2533
2703
|
setIsOpen(false);
|
|
@@ -2538,7 +2708,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2538
2708
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2539
2709
|
};
|
|
2540
2710
|
}, []);
|
|
2541
|
-
(0,
|
|
2711
|
+
(0, import_react27.useEffect)(() => {
|
|
2542
2712
|
async function fetchData() {
|
|
2543
2713
|
if (props.dataset) {
|
|
2544
2714
|
setList(props.dataset);
|
|
@@ -2580,7 +2750,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2580
2750
|
audioCtx.close();
|
|
2581
2751
|
}, 250);
|
|
2582
2752
|
};
|
|
2583
|
-
(0,
|
|
2753
|
+
(0, import_react27.useEffect)(() => {
|
|
2584
2754
|
const filteredItems2 = list?.filter(
|
|
2585
2755
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2586
2756
|
);
|
|
@@ -2645,18 +2815,18 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2645
2815
|
const handleInputChange = (event, field) => {
|
|
2646
2816
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2647
2817
|
};
|
|
2648
|
-
const handleSaveModal = (0,
|
|
2818
|
+
const handleSaveModal = (0, import_react27.useCallback)(async () => {
|
|
2649
2819
|
console.log("Form Data:", formData);
|
|
2650
2820
|
return formData;
|
|
2651
2821
|
}, []);
|
|
2652
|
-
return /* @__PURE__ */ (0,
|
|
2653
|
-
/* @__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: [
|
|
2654
2824
|
props.attributes?.label,
|
|
2655
2825
|
" ",
|
|
2656
2826
|
" ",
|
|
2657
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2827
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2658
2828
|
] }),
|
|
2659
|
-
/* @__PURE__ */ (0,
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2660
2830
|
"input",
|
|
2661
2831
|
{
|
|
2662
2832
|
type: "text",
|
|
@@ -2670,14 +2840,14 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2670
2840
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2671
2841
|
}
|
|
2672
2842
|
) }),
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2675
|
-
/* @__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: [
|
|
2676
2846
|
"Select a",
|
|
2677
2847
|
" ",
|
|
2678
2848
|
props.attributes?.label || props.attributes?.heading
|
|
2679
2849
|
] }) }),
|
|
2680
|
-
/* @__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)(
|
|
2681
2851
|
"button",
|
|
2682
2852
|
{
|
|
2683
2853
|
type: "button",
|
|
@@ -2690,12 +2860,12 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2690
2860
|
}
|
|
2691
2861
|
) })
|
|
2692
2862
|
] }),
|
|
2693
|
-
isCreateOpen && /* @__PURE__ */ (0,
|
|
2694
|
-
/* @__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: [
|
|
2695
2865
|
"Create New ",
|
|
2696
2866
|
props.attributes?.label
|
|
2697
2867
|
] }) }),
|
|
2698
|
-
/* @__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)(
|
|
2699
2869
|
"button",
|
|
2700
2870
|
{
|
|
2701
2871
|
type: "button",
|
|
@@ -2704,10 +2874,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2704
2874
|
children: "Close"
|
|
2705
2875
|
}
|
|
2706
2876
|
) }),
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2708
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0,
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2710
|
-
/* @__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)(
|
|
2711
2881
|
"input",
|
|
2712
2882
|
{
|
|
2713
2883
|
type: field.type,
|
|
@@ -2723,7 +2893,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2723
2893
|
}
|
|
2724
2894
|
)
|
|
2725
2895
|
] }, field.name)),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Button_default, { onClick: async () => {
|
|
2727
2897
|
handleSaveModal();
|
|
2728
2898
|
return { isSuccessful: true };
|
|
2729
2899
|
}, className: "w-full", children: [
|
|
@@ -2732,13 +2902,13 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2732
2902
|
] })
|
|
2733
2903
|
] })
|
|
2734
2904
|
] }),
|
|
2735
|
-
/* @__PURE__ */ (0,
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2736
2906
|
"div",
|
|
2737
2907
|
{
|
|
2738
2908
|
ref: listRef,
|
|
2739
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",
|
|
2740
2910
|
style: { height: "calc(100vh - 130px)" },
|
|
2741
|
-
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)(
|
|
2742
2912
|
"button",
|
|
2743
2913
|
{
|
|
2744
2914
|
onClick: (e) => {
|
|
@@ -2748,9 +2918,9 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2748
2918
|
role: "option",
|
|
2749
2919
|
tabIndex: -1,
|
|
2750
2920
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2751
|
-
children: /* @__PURE__ */ (0,
|
|
2921
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: getNestedValue3(item, props.dataTextFieldName) })
|
|
2752
2922
|
}
|
|
2753
|
-
) }, 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" })
|
|
2754
2924
|
}
|
|
2755
2925
|
)
|
|
2756
2926
|
] }) })
|
|
@@ -2759,10 +2929,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2759
2929
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2760
2930
|
|
|
2761
2931
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2762
|
-
var
|
|
2763
|
-
var
|
|
2932
|
+
var import_react28 = __toESM(require("react"));
|
|
2933
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2764
2934
|
var BooleanSelect = (props) => {
|
|
2765
|
-
const [list, setList] = (0,
|
|
2935
|
+
const [list, setList] = (0, import_react28.useState)();
|
|
2766
2936
|
const textChangeHandler = (event) => {
|
|
2767
2937
|
const text = event.target.value;
|
|
2768
2938
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2775,7 +2945,7 @@ var BooleanSelect = (props) => {
|
|
|
2775
2945
|
});
|
|
2776
2946
|
}
|
|
2777
2947
|
};
|
|
2778
|
-
(0,
|
|
2948
|
+
(0, import_react28.useEffect)(() => {
|
|
2779
2949
|
async function fetchData() {
|
|
2780
2950
|
console.log("in select");
|
|
2781
2951
|
if (props.dataset) {
|
|
@@ -2809,11 +2979,11 @@ var BooleanSelect = (props) => {
|
|
|
2809
2979
|
if (props.value !== void 0 && props.value !== null) {
|
|
2810
2980
|
value = props.value;
|
|
2811
2981
|
}
|
|
2812
|
-
return /* @__PURE__ */ (0,
|
|
2813
|
-
/* @__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 }),
|
|
2814
2984
|
" ",
|
|
2815
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2816
|
-
/* @__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)(
|
|
2817
2987
|
"select",
|
|
2818
2988
|
{
|
|
2819
2989
|
name: props.name,
|
|
@@ -2825,9 +2995,9 @@ var BooleanSelect = (props) => {
|
|
|
2825
2995
|
disabled: props?.attributes?.readOnly,
|
|
2826
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 ",
|
|
2827
2997
|
children: [
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
2829
2999
|
list && list.map((item, i) => {
|
|
2830
|
-
return /* @__PURE__ */ (0,
|
|
3000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2831
3001
|
"option",
|
|
2832
3002
|
{
|
|
2833
3003
|
className: "fac-select-option",
|
|
@@ -2840,14 +3010,14 @@ var BooleanSelect = (props) => {
|
|
|
2840
3010
|
]
|
|
2841
3011
|
}
|
|
2842
3012
|
),
|
|
2843
|
-
/* @__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 : "" })
|
|
2844
3014
|
] }) });
|
|
2845
3015
|
};
|
|
2846
3016
|
var BooleanSelect_default = BooleanSelect;
|
|
2847
3017
|
|
|
2848
3018
|
// src/components/controls/edit/EmailInput.tsx
|
|
2849
|
-
var
|
|
2850
|
-
var
|
|
3019
|
+
var import_react29 = __toESM(require("react"));
|
|
3020
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2851
3021
|
var EmailInput = (props) => {
|
|
2852
3022
|
const textChangeHandler = (event) => {
|
|
2853
3023
|
const text = event.target.value;
|
|
@@ -2872,11 +3042,11 @@ var EmailInput = (props) => {
|
|
|
2872
3042
|
if (props.value !== void 0 && props.value !== null) {
|
|
2873
3043
|
value = props.value;
|
|
2874
3044
|
}
|
|
2875
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__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 }),
|
|
2877
3047
|
" ",
|
|
2878
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2879
|
-
/* @__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)(
|
|
2880
3050
|
"input",
|
|
2881
3051
|
{
|
|
2882
3052
|
type: "email",
|
|
@@ -2892,14 +3062,14 @@ var EmailInput = (props) => {
|
|
|
2892
3062
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
2893
3063
|
}
|
|
2894
3064
|
),
|
|
2895
|
-
/* @__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 : "" })
|
|
2896
3066
|
] }) });
|
|
2897
3067
|
};
|
|
2898
3068
|
var EmailInput_default = EmailInput;
|
|
2899
3069
|
|
|
2900
3070
|
// src/components/controls/edit/TimeInput.tsx
|
|
2901
|
-
var
|
|
2902
|
-
var
|
|
3071
|
+
var import_react30 = __toESM(require("react"));
|
|
3072
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2903
3073
|
var TimeInput = (props) => {
|
|
2904
3074
|
const timeChangeHandler = (event) => {
|
|
2905
3075
|
const timeValue = event.target.value;
|
|
@@ -2912,11 +3082,11 @@ var TimeInput = (props) => {
|
|
|
2912
3082
|
});
|
|
2913
3083
|
}
|
|
2914
3084
|
};
|
|
2915
|
-
return /* @__PURE__ */ (0,
|
|
2916
|
-
/* @__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 }),
|
|
2917
3087
|
" ",
|
|
2918
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2919
|
-
/* @__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)(
|
|
2920
3090
|
"input",
|
|
2921
3091
|
{
|
|
2922
3092
|
type: "time",
|
|
@@ -2929,41 +3099,20 @@ var TimeInput = (props) => {
|
|
|
2929
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"
|
|
2930
3100
|
}
|
|
2931
3101
|
) }),
|
|
2932
|
-
/* @__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 ?? "" })
|
|
2933
3103
|
] }) });
|
|
2934
3104
|
};
|
|
2935
3105
|
var TimeInput_default = TimeInput;
|
|
2936
3106
|
|
|
2937
3107
|
// src/components/controls/edit/AssetUpload.tsx
|
|
2938
|
-
var
|
|
3108
|
+
var import_react31 = __toESM(require("react"));
|
|
2939
3109
|
init_ClientButton();
|
|
2940
3110
|
init_StyleTypes();
|
|
2941
3111
|
|
|
2942
|
-
// src/components/utilities/AssetUtility.tsx
|
|
2943
|
-
var AssetUtility = class {
|
|
2944
|
-
constructor() {
|
|
2945
|
-
}
|
|
2946
|
-
static resolveUrl(assetBaseUrl, url) {
|
|
2947
|
-
if (!url) return void 0;
|
|
2948
|
-
if (url.startsWith("http")) return url;
|
|
2949
|
-
if (!assetBaseUrl) return url;
|
|
2950
|
-
return `${assetBaseUrl}/${url}`;
|
|
2951
|
-
}
|
|
2952
|
-
// static getAssetUrl(apiBaseUrl: string) {
|
|
2953
|
-
// let domainName = apiBaseUrl.replace("https://", "");
|
|
2954
|
-
// return `https://cdn.g-assets.com/${domainName}`;
|
|
2955
|
-
// }
|
|
2956
|
-
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
2957
|
-
const domainName = apiBaseUrl.replace("https://", "");
|
|
2958
|
-
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
2959
|
-
}
|
|
2960
|
-
};
|
|
2961
|
-
var AssetUtility_default = AssetUtility;
|
|
2962
|
-
|
|
2963
3112
|
// src/components/dataForm/Hyperlink.tsx
|
|
2964
3113
|
var import_link = __toESM(require("next/link"));
|
|
2965
3114
|
init_StyleTypes();
|
|
2966
|
-
var
|
|
3115
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2967
3116
|
function Hyperlink(props) {
|
|
2968
3117
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : buttonClasses.get("Link" /* Link */);
|
|
2969
3118
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -2971,7 +3120,7 @@ function Hyperlink(props) {
|
|
|
2971
3120
|
if (target == "_blank") {
|
|
2972
3121
|
additionalProps.rel = "noopener noreferrer";
|
|
2973
3122
|
}
|
|
2974
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: props.href ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2975
3124
|
import_link.default,
|
|
2976
3125
|
{
|
|
2977
3126
|
href: props.href,
|
|
@@ -2981,34 +3130,34 @@ function Hyperlink(props) {
|
|
|
2981
3130
|
target,
|
|
2982
3131
|
children: props.children
|
|
2983
3132
|
}
|
|
2984
|
-
) : 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 }) });
|
|
2985
3134
|
}
|
|
2986
3135
|
|
|
2987
3136
|
// src/svg/chevron-updown.tsx
|
|
2988
|
-
var
|
|
3137
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2989
3138
|
var ChevronUpDown = (props) => {
|
|
2990
|
-
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" }) });
|
|
2991
3140
|
};
|
|
2992
3141
|
var chevron_updown_default = ChevronUpDown;
|
|
2993
3142
|
|
|
2994
3143
|
// src/svg/chevron-down.tsx
|
|
2995
|
-
var
|
|
3144
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2996
3145
|
var ChevronDown = (props) => {
|
|
2997
|
-
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" }) });
|
|
2998
3147
|
};
|
|
2999
3148
|
var chevron_down_default = ChevronDown;
|
|
3000
3149
|
|
|
3001
3150
|
// src/svg/chevron-up.tsx
|
|
3002
|
-
var
|
|
3151
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3003
3152
|
var ChevronUp = (props) => {
|
|
3004
|
-
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" }) });
|
|
3005
3154
|
};
|
|
3006
3155
|
var chevron_up_default = ChevronUp;
|
|
3007
3156
|
|
|
3008
3157
|
// src/svg/plus.tsx
|
|
3009
|
-
var
|
|
3158
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3010
3159
|
var Plus = (props) => {
|
|
3011
|
-
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" }) });
|
|
3012
3161
|
};
|
|
3013
3162
|
var plus_default = Plus;
|
|
3014
3163
|
|
|
@@ -3022,19 +3171,19 @@ var Icons = {
|
|
|
3022
3171
|
var Icons_default = Icons;
|
|
3023
3172
|
|
|
3024
3173
|
// src/svg/Icon.tsx
|
|
3025
|
-
var
|
|
3174
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3026
3175
|
var Icon = ({ name, className, ...props }) => {
|
|
3027
3176
|
const IconComponent = Icons_default[name];
|
|
3028
3177
|
if (!IconComponent) {
|
|
3029
3178
|
console.error(`Icon "${name}" not found.`);
|
|
3030
3179
|
return null;
|
|
3031
3180
|
}
|
|
3032
|
-
return /* @__PURE__ */ (0,
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconComponent, { ...props, className });
|
|
3033
3182
|
};
|
|
3034
3183
|
var Icon_default = Icon;
|
|
3035
3184
|
|
|
3036
3185
|
// src/components/controls/edit/AssetUpload.tsx
|
|
3037
|
-
var
|
|
3186
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3038
3187
|
var AssetUpload = (props) => {
|
|
3039
3188
|
const isDisabled = props.attributes?.disable ?? false;
|
|
3040
3189
|
let allValues = [];
|
|
@@ -3055,8 +3204,8 @@ var AssetUpload = (props) => {
|
|
|
3055
3204
|
}
|
|
3056
3205
|
return "image";
|
|
3057
3206
|
};
|
|
3058
|
-
const [assetType, setAssetType] =
|
|
3059
|
-
(0,
|
|
3207
|
+
const [assetType, setAssetType] = import_react31.default.useState(getInitialTab);
|
|
3208
|
+
(0, import_react31.useEffect)(() => {
|
|
3060
3209
|
setAssetType(getInitialTab());
|
|
3061
3210
|
}, [props.value]);
|
|
3062
3211
|
const assetUploadCallback = (newAsset) => {
|
|
@@ -3131,10 +3280,10 @@ var AssetUpload = (props) => {
|
|
|
3131
3280
|
}
|
|
3132
3281
|
return false;
|
|
3133
3282
|
};
|
|
3134
|
-
return /* @__PURE__ */ (0,
|
|
3135
|
-
/* @__PURE__ */ (0,
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__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)(
|
|
3138
3287
|
ClientButton_default,
|
|
3139
3288
|
{
|
|
3140
3289
|
className: assetType === "image" ? "px-2 py-1 rounded bg-body-200 scale-95" : "text-neutral-700",
|
|
@@ -3144,7 +3293,7 @@ var AssetUpload = (props) => {
|
|
|
3144
3293
|
children: "Image Upload"
|
|
3145
3294
|
}
|
|
3146
3295
|
),
|
|
3147
|
-
/* @__PURE__ */ (0,
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3148
3297
|
ClientButton_default,
|
|
3149
3298
|
{
|
|
3150
3299
|
className: assetType === "video" ? "bg-body-200 px-2 py-1 rounded-md scale-95" : "text-neutral-700",
|
|
@@ -3155,13 +3304,13 @@ var AssetUpload = (props) => {
|
|
|
3155
3304
|
}
|
|
3156
3305
|
)
|
|
3157
3306
|
] }),
|
|
3158
|
-
shouldShowDetails() && /* @__PURE__ */ (0,
|
|
3159
|
-
/* @__PURE__ */ (0,
|
|
3160
|
-
/* @__PURE__ */ (0,
|
|
3161
|
-
/* @__PURE__ */ (0,
|
|
3162
|
-
/* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__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)(
|
|
3165
3314
|
"input",
|
|
3166
3315
|
{
|
|
3167
3316
|
type: "text",
|
|
@@ -3173,18 +3322,18 @@ var AssetUpload = (props) => {
|
|
|
3173
3322
|
}
|
|
3174
3323
|
)
|
|
3175
3324
|
] }),
|
|
3176
|
-
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__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: [
|
|
3179
3328
|
digitalAsset.intrinsicWidth,
|
|
3180
3329
|
"\xD7",
|
|
3181
3330
|
digitalAsset.intrinsicHeight
|
|
3182
3331
|
] })
|
|
3183
3332
|
] }),
|
|
3184
|
-
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0,
|
|
3185
|
-
/* @__PURE__ */ (0,
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3187
|
-
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)(
|
|
3188
3337
|
"img",
|
|
3189
3338
|
{
|
|
3190
3339
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.posterUrl),
|
|
@@ -3192,7 +3341,7 @@ var AssetUpload = (props) => {
|
|
|
3192
3341
|
className: "w-32 h-auto object-cover rounded border p-1"
|
|
3193
3342
|
}
|
|
3194
3343
|
),
|
|
3195
|
-
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0,
|
|
3344
|
+
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3196
3345
|
"img",
|
|
3197
3346
|
{
|
|
3198
3347
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.assetUrl),
|
|
@@ -3202,9 +3351,9 @@ var AssetUpload = (props) => {
|
|
|
3202
3351
|
)
|
|
3203
3352
|
] })
|
|
3204
3353
|
] }),
|
|
3205
|
-
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0,
|
|
3206
|
-
/* @__PURE__ */ (0,
|
|
3207
|
-
/* @__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)(
|
|
3208
3357
|
Hyperlink,
|
|
3209
3358
|
{
|
|
3210
3359
|
href: digitalAsset.assetUrl,
|
|
@@ -3215,12 +3364,12 @@ var AssetUpload = (props) => {
|
|
|
3215
3364
|
)
|
|
3216
3365
|
] })
|
|
3217
3366
|
] }),
|
|
3218
|
-
/* @__PURE__ */ (0,
|
|
3367
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3219
3368
|
"span",
|
|
3220
3369
|
{
|
|
3221
3370
|
onClick: () => !isDisabled && deleteFile(index),
|
|
3222
3371
|
className: isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
3223
|
-
children: /* @__PURE__ */ (0,
|
|
3372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon_default, { className: "w-4 h-4 text-primary", name: "delete" })
|
|
3224
3373
|
}
|
|
3225
3374
|
)
|
|
3226
3375
|
] }, index)) })
|
|
@@ -3230,8 +3379,8 @@ var AssetUpload = (props) => {
|
|
|
3230
3379
|
var AssetUpload_default = AssetUpload;
|
|
3231
3380
|
|
|
3232
3381
|
// src/components/controls/edit/InputControl.tsx
|
|
3233
|
-
var
|
|
3234
|
-
var InputControl =
|
|
3382
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3383
|
+
var InputControl = import_react32.default.forwardRef(
|
|
3235
3384
|
(props, ref) => {
|
|
3236
3385
|
const ControlComponents = {
|
|
3237
3386
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -3253,7 +3402,7 @@ var InputControl = import_react31.default.forwardRef(
|
|
|
3253
3402
|
[InputControlType_default.asset]: AssetUpload_default
|
|
3254
3403
|
};
|
|
3255
3404
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
3256
|
-
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" });
|
|
3257
3406
|
}
|
|
3258
3407
|
);
|
|
3259
3408
|
InputControl.displayName = "InputControl";
|
|
@@ -3266,7 +3415,7 @@ var import_react50 = __toESM(require("react"));
|
|
|
3266
3415
|
var import_react36 = __toESM(require("react"));
|
|
3267
3416
|
|
|
3268
3417
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3269
|
-
var
|
|
3418
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3270
3419
|
var TextNode = (props) => {
|
|
3271
3420
|
function cssStringToJson(cssString) {
|
|
3272
3421
|
const styleObject = {};
|
|
@@ -3321,26 +3470,26 @@ var TextNode = (props) => {
|
|
|
3321
3470
|
});
|
|
3322
3471
|
}
|
|
3323
3472
|
function renderWithLineBreaks(text) {
|
|
3324
|
-
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: [
|
|
3325
3474
|
line,
|
|
3326
|
-
index < arr.length - 1 && /* @__PURE__ */ (0,
|
|
3475
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("br", {})
|
|
3327
3476
|
] }, index));
|
|
3328
3477
|
}
|
|
3329
3478
|
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
3330
3479
|
const finalText = props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text;
|
|
3331
3480
|
const content = typeof finalText === "string" ? renderWithLineBreaks(finalText) : finalText;
|
|
3332
|
-
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;
|
|
3333
3482
|
return (
|
|
3334
3483
|
// @ts-expect-error custom code
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: formattedContent })
|
|
3336
3485
|
);
|
|
3337
3486
|
};
|
|
3338
3487
|
var TextNode_default = TextNode;
|
|
3339
3488
|
|
|
3340
3489
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
3341
|
-
var
|
|
3490
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3342
3491
|
var LineBreakNode = () => {
|
|
3343
|
-
return /* @__PURE__ */ (0,
|
|
3492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
3344
3493
|
};
|
|
3345
3494
|
var LineBreakNode_default = LineBreakNode;
|
|
3346
3495
|
|
|
@@ -3350,128 +3499,7 @@ var import_react35 = __toESM(require("react"));
|
|
|
3350
3499
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3351
3500
|
var import_react33 = __toESM(require("react"));
|
|
3352
3501
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
3353
|
-
|
|
3354
|
-
// src/components/DeviceAssetSelector.tsx
|
|
3355
|
-
init_HlsPlayer();
|
|
3356
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3357
|
-
var DeviceAssetSelector = ({
|
|
3358
|
-
assets,
|
|
3359
|
-
assetBaseUrl,
|
|
3360
|
-
session,
|
|
3361
|
-
// This should receive the session
|
|
3362
|
-
width,
|
|
3363
|
-
tag,
|
|
3364
|
-
customProps,
|
|
3365
|
-
nodeProps,
|
|
3366
|
-
device
|
|
3367
|
-
}) => {
|
|
3368
|
-
console.log("\u{1F511} Session in DeviceAssetSelector:", session);
|
|
3369
|
-
const targetTag = tag || nodeProps?.tag;
|
|
3370
|
-
const selectAssetByDevice = (assets2, currentDevice) => {
|
|
3371
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
3372
|
-
const exactMatch = assets2.find((asset) => asset.device === currentDevice);
|
|
3373
|
-
if (exactMatch) return exactMatch;
|
|
3374
|
-
const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
|
|
3375
|
-
if (noDeviceMatch) return noDeviceMatch;
|
|
3376
|
-
return void 0;
|
|
3377
|
-
};
|
|
3378
|
-
const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
|
|
3379
|
-
if (!assets2 || assets2.length === 0) return void 0;
|
|
3380
|
-
if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
|
|
3381
|
-
const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
|
|
3382
|
-
if (taggedAssets.length === 0) {
|
|
3383
|
-
return selectAssetByDevice(assets2, currentDevice);
|
|
3384
|
-
}
|
|
3385
|
-
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
3386
|
-
if (exactTaggedMatch) return exactTaggedMatch;
|
|
3387
|
-
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
3388
|
-
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
3389
|
-
return void 0;
|
|
3390
|
-
};
|
|
3391
|
-
const selectAsset = () => {
|
|
3392
|
-
if (!assets || assets.length === 0) return void 0;
|
|
3393
|
-
if (targetTag) {
|
|
3394
|
-
return selectAssetByTagAndDevice(assets, device, targetTag);
|
|
3395
|
-
}
|
|
3396
|
-
return selectAssetByDevice(assets, device);
|
|
3397
|
-
};
|
|
3398
|
-
const selectedAsset = selectAsset();
|
|
3399
|
-
if (!selectedAsset) {
|
|
3400
|
-
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
3401
|
-
return null;
|
|
3402
|
-
}
|
|
3403
|
-
const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
|
|
3404
|
-
const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
|
|
3405
|
-
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
3406
|
-
const title = selectedAsset.title || nodeProps?.title;
|
|
3407
|
-
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
3408
|
-
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
3409
|
-
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
3410
|
-
const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
|
|
3411
|
-
const loop = customProps?.loop ?? nodeProps?.loop === "true";
|
|
3412
|
-
const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
|
|
3413
|
-
const styles = {};
|
|
3414
|
-
if (nodeProps?.height) {
|
|
3415
|
-
styles.height = nodeProps.height;
|
|
3416
|
-
}
|
|
3417
|
-
if (nodeProps?.borderRadius) {
|
|
3418
|
-
styles.borderRadius = nodeProps.borderRadius;
|
|
3419
|
-
}
|
|
3420
|
-
if (nodeProps?.width) {
|
|
3421
|
-
styles.width = nodeProps.width;
|
|
3422
|
-
}
|
|
3423
|
-
const FormatClass = {
|
|
3424
|
-
"center": "justify-center",
|
|
3425
|
-
"left": "justify-start",
|
|
3426
|
-
"right": "justify-end"
|
|
3427
|
-
};
|
|
3428
|
-
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3429
|
-
const renderMedia = () => {
|
|
3430
|
-
if (isHls) {
|
|
3431
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3432
|
-
HlsPlayer_default,
|
|
3433
|
-
{
|
|
3434
|
-
assetUrl: resolvedAssetUrl,
|
|
3435
|
-
posterUrl: resolvedThumbnailUrl,
|
|
3436
|
-
intrinsicWidth,
|
|
3437
|
-
intrinsicHeight,
|
|
3438
|
-
showControls,
|
|
3439
|
-
loop,
|
|
3440
|
-
playOptions,
|
|
3441
|
-
apiBaseUrl: assetBaseUrl,
|
|
3442
|
-
session
|
|
3443
|
-
}
|
|
3444
|
-
);
|
|
3445
|
-
} else {
|
|
3446
|
-
return (
|
|
3447
|
-
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3448
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3449
|
-
"img",
|
|
3450
|
-
{
|
|
3451
|
-
style: styles,
|
|
3452
|
-
loading: "lazy",
|
|
3453
|
-
className: "object-cover w-full",
|
|
3454
|
-
src: resolvedAssetUrl,
|
|
3455
|
-
width: selectedAsset.intrinsicWidth,
|
|
3456
|
-
alt: title || "Asset image",
|
|
3457
|
-
height: selectedAsset.intrinsicHeight
|
|
3458
|
-
}
|
|
3459
|
-
)
|
|
3460
|
-
);
|
|
3461
|
-
}
|
|
3462
|
-
};
|
|
3463
|
-
if (width) {
|
|
3464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3465
|
-
}
|
|
3466
|
-
if (nodeProps?.format) {
|
|
3467
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3468
|
-
}
|
|
3469
|
-
return renderMedia();
|
|
3470
|
-
};
|
|
3471
|
-
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3472
|
-
|
|
3473
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3474
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3502
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3475
3503
|
var HlsPlayer2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3476
3504
|
ssr: false
|
|
3477
3505
|
});
|
|
@@ -3514,7 +3542,7 @@ var ImageNode = (props) => {
|
|
|
3514
3542
|
console.error("Error parsing assets in ImageNode:", error);
|
|
3515
3543
|
}
|
|
3516
3544
|
if (assets && assets.length > 0) {
|
|
3517
|
-
return /* @__PURE__ */ (0,
|
|
3545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3518
3546
|
DeviceAssetSelector_default,
|
|
3519
3547
|
{
|
|
3520
3548
|
device: props.device,
|
|
@@ -3563,7 +3591,7 @@ var ImageNode = (props) => {
|
|
|
3563
3591
|
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3564
3592
|
const renderMedia = () => {
|
|
3565
3593
|
if (isHls) {
|
|
3566
|
-
return /* @__PURE__ */ (0,
|
|
3594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3567
3595
|
HlsPlayer2,
|
|
3568
3596
|
{
|
|
3569
3597
|
assetUrl: imageUrl,
|
|
@@ -3578,7 +3606,7 @@ var ImageNode = (props) => {
|
|
|
3578
3606
|
}
|
|
3579
3607
|
);
|
|
3580
3608
|
} else {
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3582
3610
|
"img",
|
|
3583
3611
|
{
|
|
3584
3612
|
style: styles,
|
|
@@ -3593,7 +3621,7 @@ var ImageNode = (props) => {
|
|
|
3593
3621
|
}
|
|
3594
3622
|
};
|
|
3595
3623
|
if (props.node.width) {
|
|
3596
|
-
return /* @__PURE__ */ (0,
|
|
3624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3597
3625
|
}
|
|
3598
3626
|
return renderMedia();
|
|
3599
3627
|
};
|
|
@@ -3602,7 +3630,7 @@ var ImageNode_default = ImageNode;
|
|
|
3602
3630
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3603
3631
|
init_StyleTypes();
|
|
3604
3632
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
3605
|
-
var
|
|
3633
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3606
3634
|
var LinkNodeButton2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3607
3635
|
ssr: false
|
|
3608
3636
|
});
|
|
@@ -3649,13 +3677,13 @@ var LinkNode = (props) => {
|
|
|
3649
3677
|
const isButton = node.isButton === true;
|
|
3650
3678
|
const renderChildren = () => {
|
|
3651
3679
|
if (!node.children || node.children.length === 0) return null;
|
|
3652
|
-
return /* @__PURE__ */ (0,
|
|
3680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: node.children.map((childNode, index) => {
|
|
3653
3681
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3654
3682
|
if (!SelectedNode) {
|
|
3655
3683
|
console.warn("Unknown node type:", childNode.type);
|
|
3656
3684
|
return null;
|
|
3657
3685
|
}
|
|
3658
|
-
return /* @__PURE__ */ (0,
|
|
3686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react35.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3659
3687
|
SelectedNode,
|
|
3660
3688
|
{
|
|
3661
3689
|
node: childNode,
|
|
@@ -3668,15 +3696,15 @@ var LinkNode = (props) => {
|
|
|
3668
3696
|
};
|
|
3669
3697
|
const renderFallback = () => {
|
|
3670
3698
|
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3671
|
-
return /* @__PURE__ */ (0,
|
|
3699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: linkText });
|
|
3672
3700
|
}
|
|
3673
3701
|
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3674
|
-
return /* @__PURE__ */ (0,
|
|
3702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("br", {});
|
|
3675
3703
|
}
|
|
3676
3704
|
return null;
|
|
3677
3705
|
};
|
|
3678
3706
|
if (isButton) {
|
|
3679
|
-
return /* @__PURE__ */ (0,
|
|
3707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3680
3708
|
LinkNodeButton2,
|
|
3681
3709
|
{
|
|
3682
3710
|
node,
|
|
@@ -3694,7 +3722,7 @@ var LinkNode = (props) => {
|
|
|
3694
3722
|
}
|
|
3695
3723
|
);
|
|
3696
3724
|
}
|
|
3697
|
-
return /* @__PURE__ */ (0,
|
|
3725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3698
3726
|
Hyperlink,
|
|
3699
3727
|
{
|
|
3700
3728
|
href: linkUrl || "#",
|
|
@@ -3710,10 +3738,10 @@ var LinkNode = (props) => {
|
|
|
3710
3738
|
var LinkNode_default = LinkNode;
|
|
3711
3739
|
|
|
3712
3740
|
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3713
|
-
var
|
|
3741
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3714
3742
|
var SVGIconNode = ({ node }) => {
|
|
3715
3743
|
if (!node?.svgCode) return null;
|
|
3716
|
-
return /* @__PURE__ */ (0,
|
|
3744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3717
3745
|
"span",
|
|
3718
3746
|
{
|
|
3719
3747
|
style: {
|
|
@@ -3730,7 +3758,7 @@ var SVGIconNode_default = SVGIconNode;
|
|
|
3730
3758
|
|
|
3731
3759
|
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3732
3760
|
var import_katex = __toESM(require("katex"));
|
|
3733
|
-
var
|
|
3761
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3734
3762
|
var EquationNode = ({ node }) => {
|
|
3735
3763
|
const { equation, inline } = node;
|
|
3736
3764
|
let html = "";
|
|
@@ -3745,7 +3773,7 @@ var EquationNode = ({ node }) => {
|
|
|
3745
3773
|
});
|
|
3746
3774
|
}
|
|
3747
3775
|
if (inline) {
|
|
3748
|
-
return /* @__PURE__ */ (0,
|
|
3776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3749
3777
|
"span",
|
|
3750
3778
|
{
|
|
3751
3779
|
className: "katex-inline",
|
|
@@ -3753,7 +3781,7 @@ var EquationNode = ({ node }) => {
|
|
|
3753
3781
|
}
|
|
3754
3782
|
);
|
|
3755
3783
|
}
|
|
3756
|
-
return /* @__PURE__ */ (0,
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3757
3785
|
"div",
|
|
3758
3786
|
{
|
|
3759
3787
|
className: "katex-block my-3 text-center",
|
|
@@ -3764,7 +3792,7 @@ var EquationNode = ({ node }) => {
|
|
|
3764
3792
|
var EquationNode_default = EquationNode;
|
|
3765
3793
|
|
|
3766
3794
|
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3767
|
-
var
|
|
3795
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3768
3796
|
function getNestedProperty(obj, path) {
|
|
3769
3797
|
if (!obj || !path) return null;
|
|
3770
3798
|
if (path.includes(".")) {
|
|
@@ -3777,7 +3805,7 @@ function getNestedProperty(obj, path) {
|
|
|
3777
3805
|
}
|
|
3778
3806
|
const value = obj[path];
|
|
3779
3807
|
if (Array.isArray(value)) {
|
|
3780
|
-
return value.map((item, index) => /* @__PURE__ */ (0,
|
|
3808
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children: String(item) }, index));
|
|
3781
3809
|
}
|
|
3782
3810
|
return value;
|
|
3783
3811
|
}
|
|
@@ -3838,7 +3866,7 @@ var DatafieldNode = (props) => {
|
|
|
3838
3866
|
const dataType = props.node.dataType;
|
|
3839
3867
|
if (isEmptyValue) return null;
|
|
3840
3868
|
if (dataType === "rawContent") {
|
|
3841
|
-
return /* @__PURE__ */ (0,
|
|
3869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3842
3870
|
PageBodyRenderer_default,
|
|
3843
3871
|
{
|
|
3844
3872
|
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
@@ -3854,12 +3882,12 @@ var DatafieldNode = (props) => {
|
|
|
3854
3882
|
}
|
|
3855
3883
|
);
|
|
3856
3884
|
}
|
|
3857
|
-
return /* @__PURE__ */ (0,
|
|
3885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3858
3886
|
"span",
|
|
3859
3887
|
{
|
|
3860
3888
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
3861
3889
|
style: styles,
|
|
3862
|
-
children: /* @__PURE__ */ (0,
|
|
3890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3863
3891
|
ViewControl_default,
|
|
3864
3892
|
{
|
|
3865
3893
|
controlType: dataType,
|
|
@@ -3872,7 +3900,7 @@ var DatafieldNode = (props) => {
|
|
|
3872
3900
|
var DatafieldNode_default = DatafieldNode;
|
|
3873
3901
|
|
|
3874
3902
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3875
|
-
var
|
|
3903
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3876
3904
|
var ParagraphNode = (props) => {
|
|
3877
3905
|
const NodeTypes2 = {
|
|
3878
3906
|
["text"]: TextNode_default,
|
|
@@ -3892,9 +3920,9 @@ var ParagraphNode = (props) => {
|
|
|
3892
3920
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
3893
3921
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
3894
3922
|
if (isInlineOnlyParent) {
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3896
3924
|
const SelectedNode = NodeTypes2[node.type];
|
|
3897
|
-
return /* @__PURE__ */ (0,
|
|
3925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3898
3926
|
SelectedNode,
|
|
3899
3927
|
{
|
|
3900
3928
|
node,
|
|
@@ -3906,10 +3934,10 @@ var ParagraphNode = (props) => {
|
|
|
3906
3934
|
) }, index);
|
|
3907
3935
|
}) });
|
|
3908
3936
|
}
|
|
3909
|
-
return /* @__PURE__ */ (0,
|
|
3937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3910
3938
|
hasChildren && props.node.children.map((node, index) => {
|
|
3911
3939
|
const SelectedNode = NodeTypes2[node.type];
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3913
3941
|
SelectedNode,
|
|
3914
3942
|
{
|
|
3915
3943
|
node,
|
|
@@ -3920,14 +3948,14 @@ var ParagraphNode = (props) => {
|
|
|
3920
3948
|
}
|
|
3921
3949
|
) }, index);
|
|
3922
3950
|
}),
|
|
3923
|
-
!hasChildren && /* @__PURE__ */ (0,
|
|
3951
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
3924
3952
|
] });
|
|
3925
3953
|
};
|
|
3926
3954
|
var ParagraphNode_default = ParagraphNode;
|
|
3927
3955
|
|
|
3928
3956
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3929
3957
|
var import_react37 = __toESM(require("react"));
|
|
3930
|
-
var
|
|
3958
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3931
3959
|
var HeadingNode = (props) => {
|
|
3932
3960
|
const NodeTypes2 = {
|
|
3933
3961
|
["text"]: TextNode_default,
|
|
@@ -3943,12 +3971,12 @@ var HeadingNode = (props) => {
|
|
|
3943
3971
|
{
|
|
3944
3972
|
}
|
|
3945
3973
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3946
|
-
return /* @__PURE__ */ (0,
|
|
3974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: import_react37.default.createElement(
|
|
3947
3975
|
HeadingTag,
|
|
3948
3976
|
{ className: formatClasses },
|
|
3949
3977
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
3950
3978
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3951
|
-
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);
|
|
3952
3980
|
})
|
|
3953
3981
|
) });
|
|
3954
3982
|
};
|
|
@@ -3959,7 +3987,7 @@ var import_react39 = __toESM(require("react"));
|
|
|
3959
3987
|
|
|
3960
3988
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3961
3989
|
var import_react38 = __toESM(require("react"));
|
|
3962
|
-
var
|
|
3990
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3963
3991
|
var ListItemNode = (props) => {
|
|
3964
3992
|
const NodeTypes2 = {
|
|
3965
3993
|
text: TextNode_default,
|
|
@@ -3976,37 +4004,37 @@ var ListItemNode = (props) => {
|
|
|
3976
4004
|
liStyle.fontSize = match[1].trim();
|
|
3977
4005
|
}
|
|
3978
4006
|
}
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
4007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
3980
4008
|
const SelectedNode = NodeTypes2[node.type];
|
|
3981
4009
|
if (node.type === "linebreak") {
|
|
3982
4010
|
if (!foundFirstBreak) {
|
|
3983
4011
|
foundFirstBreak = true;
|
|
3984
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {}, index);
|
|
3985
4013
|
} else {
|
|
3986
|
-
return /* @__PURE__ */ (0,
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
3987
4015
|
}
|
|
3988
4016
|
} else {
|
|
3989
4017
|
foundFirstBreak = false;
|
|
3990
|
-
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);
|
|
3991
4019
|
}
|
|
3992
4020
|
}) });
|
|
3993
4021
|
};
|
|
3994
4022
|
var ListItemNode_default = ListItemNode;
|
|
3995
4023
|
|
|
3996
4024
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3997
|
-
var
|
|
4025
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3998
4026
|
var ListNode = (props) => {
|
|
3999
4027
|
const NodeTypes2 = {
|
|
4000
4028
|
listitem: ListItemNode_default
|
|
4001
4029
|
};
|
|
4002
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
-
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) => {
|
|
4004
4032
|
const SelectedNode = NodeTypes2[node.type];
|
|
4005
|
-
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);
|
|
4006
4034
|
}) }),
|
|
4007
|
-
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) => {
|
|
4008
4036
|
const SelectedNode = NodeTypes2[node.type];
|
|
4009
|
-
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);
|
|
4010
4038
|
}) })
|
|
4011
4039
|
] });
|
|
4012
4040
|
};
|
|
@@ -4014,16 +4042,16 @@ var ListNode_default = ListNode;
|
|
|
4014
4042
|
|
|
4015
4043
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4016
4044
|
var import_react40 = __toESM(require("react"));
|
|
4017
|
-
var
|
|
4045
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4018
4046
|
var QuoteNode = (props) => {
|
|
4019
4047
|
const NodeTypes2 = {
|
|
4020
4048
|
["text"]: TextNode_default,
|
|
4021
4049
|
["linebreak"]: LineBreakNode_default,
|
|
4022
4050
|
["link"]: LinkNode_default
|
|
4023
4051
|
};
|
|
4024
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4025
4053
|
const SelectedNode = NodeTypes2[node.type];
|
|
4026
|
-
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);
|
|
4027
4055
|
}) });
|
|
4028
4056
|
};
|
|
4029
4057
|
var QuoteNode_default = QuoteNode;
|
|
@@ -4031,11 +4059,11 @@ var QuoteNode_default = QuoteNode;
|
|
|
4031
4059
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4032
4060
|
var import_react42 = __toESM(require("react"));
|
|
4033
4061
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
4034
|
-
var
|
|
4062
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4035
4063
|
var CopyButton2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4036
4064
|
ssr: false,
|
|
4037
4065
|
// optional: fallback UI while loading
|
|
4038
|
-
loading: () => /* @__PURE__ */ (0,
|
|
4066
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4039
4067
|
});
|
|
4040
4068
|
var CodeNode = (props) => {
|
|
4041
4069
|
const NodeTypes2 = {
|
|
@@ -4049,14 +4077,14 @@ var CodeNode = (props) => {
|
|
|
4049
4077
|
if (node.type === "link") return node.text || node.url || "";
|
|
4050
4078
|
return "";
|
|
4051
4079
|
}).join("") ?? "";
|
|
4052
|
-
return /* @__PURE__ */ (0,
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4054
|
-
/* @__PURE__ */ (0,
|
|
4055
|
-
/* @__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 })
|
|
4056
4084
|
] }),
|
|
4057
|
-
/* @__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) => {
|
|
4058
4086
|
const SelectedNode = NodeTypes2[node.type];
|
|
4059
|
-
return /* @__PURE__ */ (0,
|
|
4087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4060
4088
|
SelectedNode,
|
|
4061
4089
|
{
|
|
4062
4090
|
node,
|
|
@@ -4071,15 +4099,15 @@ var CodeNode = (props) => {
|
|
|
4071
4099
|
var CodeNode_default = CodeNode;
|
|
4072
4100
|
|
|
4073
4101
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
4074
|
-
var
|
|
4102
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4075
4103
|
var HorizontalRuleNode = () => {
|
|
4076
|
-
return /* @__PURE__ */ (0,
|
|
4104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("hr", {});
|
|
4077
4105
|
};
|
|
4078
4106
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4079
4107
|
|
|
4080
4108
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4081
4109
|
var import_react43 = __toESM(require("react"));
|
|
4082
|
-
var
|
|
4110
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4083
4111
|
var WidgetNode = (props) => {
|
|
4084
4112
|
const getWidgetParameters = () => {
|
|
4085
4113
|
const widgetInputParameters = {
|
|
@@ -4143,7 +4171,7 @@ var WidgetNode = (props) => {
|
|
|
4143
4171
|
};
|
|
4144
4172
|
const widgetCode = props.node?.widgetCode;
|
|
4145
4173
|
if (!widgetCode) {
|
|
4146
|
-
return /* @__PURE__ */ (0,
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: "Invalid widget" });
|
|
4147
4175
|
}
|
|
4148
4176
|
const widgetParams = getWidgetParameters();
|
|
4149
4177
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -4152,7 +4180,7 @@ var WidgetNode = (props) => {
|
|
|
4152
4180
|
}
|
|
4153
4181
|
return (
|
|
4154
4182
|
// eslint-disable-next-line react-hooks/static-components
|
|
4155
|
-
/* @__PURE__ */ (0,
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react43.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4156
4184
|
WidgetRenderer,
|
|
4157
4185
|
{
|
|
4158
4186
|
params: widgetParams,
|
|
@@ -4172,9 +4200,9 @@ var WidgetNode_default = WidgetNode;
|
|
|
4172
4200
|
var import_react44 = __toESM(require("react"));
|
|
4173
4201
|
|
|
4174
4202
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4175
|
-
var
|
|
4203
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4176
4204
|
var InputControlNode = (props) => {
|
|
4177
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4178
4206
|
InputControl_default,
|
|
4179
4207
|
{
|
|
4180
4208
|
name: props.node.name,
|
|
@@ -4248,7 +4276,7 @@ var FormReducer_default = FormReducer;
|
|
|
4248
4276
|
|
|
4249
4277
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4250
4278
|
init_ServiceClient();
|
|
4251
|
-
var
|
|
4279
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4252
4280
|
var FormContainerNode = (props) => {
|
|
4253
4281
|
const NodeTypes2 = {
|
|
4254
4282
|
["input-control"]: InputControlNode_default
|
|
@@ -4278,12 +4306,12 @@ var FormContainerNode = (props) => {
|
|
|
4278
4306
|
};
|
|
4279
4307
|
fetchInitialData();
|
|
4280
4308
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4281
|
-
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: [
|
|
4282
4310
|
node.children && node.children.map((node2, index) => {
|
|
4283
4311
|
{
|
|
4284
4312
|
}
|
|
4285
4313
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4286
|
-
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)(
|
|
4287
4315
|
InputControlNode_default,
|
|
4288
4316
|
{
|
|
4289
4317
|
value: formState.inputValues[node2.name],
|
|
@@ -4292,7 +4320,7 @@ var FormContainerNode = (props) => {
|
|
|
4292
4320
|
}
|
|
4293
4321
|
) }, index);
|
|
4294
4322
|
}),
|
|
4295
|
-
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" })
|
|
4296
4324
|
] });
|
|
4297
4325
|
};
|
|
4298
4326
|
var FormContainerNode_default = FormContainerNode;
|
|
@@ -4302,7 +4330,7 @@ var import_react49 = __toESM(require("react"));
|
|
|
4302
4330
|
|
|
4303
4331
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4304
4332
|
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
4305
|
-
var
|
|
4333
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4306
4334
|
var IframeClient2 = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4307
4335
|
ssr: false
|
|
4308
4336
|
});
|
|
@@ -4315,7 +4343,7 @@ var EmbedNode = (props) => {
|
|
|
4315
4343
|
} else {
|
|
4316
4344
|
src = props.node.embedSrc;
|
|
4317
4345
|
}
|
|
4318
|
-
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 }) });
|
|
4319
4347
|
};
|
|
4320
4348
|
var EmbedNode_default = EmbedNode;
|
|
4321
4349
|
|
|
@@ -4324,7 +4352,7 @@ init_ServiceClient();
|
|
|
4324
4352
|
|
|
4325
4353
|
// src/components/Slider.tsx
|
|
4326
4354
|
var import_react47 = __toESM(require("react"));
|
|
4327
|
-
var
|
|
4355
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4328
4356
|
var Slider = ({
|
|
4329
4357
|
children,
|
|
4330
4358
|
slidesToShow = 4,
|
|
@@ -4421,7 +4449,7 @@ var Slider = ({
|
|
|
4421
4449
|
if (!import_react47.default.isValidElement(child)) return null;
|
|
4422
4450
|
const childProps = child.props;
|
|
4423
4451
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4424
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4425
4453
|
"div",
|
|
4426
4454
|
{
|
|
4427
4455
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
@@ -4444,14 +4472,14 @@ var Slider = ({
|
|
|
4444
4472
|
return "bottom-4";
|
|
4445
4473
|
}
|
|
4446
4474
|
};
|
|
4447
|
-
return /* @__PURE__ */ (0,
|
|
4475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4448
4476
|
"div",
|
|
4449
4477
|
{
|
|
4450
4478
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4451
4479
|
onMouseEnter: handleMouseEnter,
|
|
4452
4480
|
onMouseLeave: handleMouseLeave,
|
|
4453
4481
|
children: [
|
|
4454
|
-
/* @__PURE__ */ (0,
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4455
4483
|
"div",
|
|
4456
4484
|
{
|
|
4457
4485
|
className: "flex h-full",
|
|
@@ -4462,18 +4490,18 @@ var Slider = ({
|
|
|
4462
4490
|
children: slides
|
|
4463
4491
|
}
|
|
4464
4492
|
),
|
|
4465
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4466
|
-
/* @__PURE__ */ (0,
|
|
4493
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4467
4495
|
ArrowButton,
|
|
4468
4496
|
{
|
|
4469
4497
|
direction: "left",
|
|
4470
4498
|
onClick: prevSlide,
|
|
4471
4499
|
visible: infinite_scroll || currentSlide > 0,
|
|
4472
4500
|
className: arrowClassName,
|
|
4473
|
-
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" }) })
|
|
4474
4502
|
}
|
|
4475
4503
|
),
|
|
4476
|
-
/* @__PURE__ */ (0,
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4477
4505
|
ArrowButton,
|
|
4478
4506
|
{
|
|
4479
4507
|
direction: "right",
|
|
@@ -4481,13 +4509,13 @@ var Slider = ({
|
|
|
4481
4509
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4482
4510
|
className: arrowClassName,
|
|
4483
4511
|
children: [
|
|
4484
|
-
/* @__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" }) }),
|
|
4485
4513
|
" "
|
|
4486
4514
|
]
|
|
4487
4515
|
}
|
|
4488
4516
|
)
|
|
4489
4517
|
] }),
|
|
4490
|
-
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)(
|
|
4491
4519
|
ProgressPill,
|
|
4492
4520
|
{
|
|
4493
4521
|
active: index === currentSlide,
|
|
@@ -4513,7 +4541,7 @@ var ArrowButton = ({
|
|
|
4513
4541
|
visible,
|
|
4514
4542
|
children,
|
|
4515
4543
|
className = ""
|
|
4516
|
-
}) => /* @__PURE__ */ (0,
|
|
4544
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4517
4545
|
"button",
|
|
4518
4546
|
{
|
|
4519
4547
|
className: `
|
|
@@ -4600,7 +4628,7 @@ var ProgressPill = ({
|
|
|
4600
4628
|
const renderProgressBar = () => {
|
|
4601
4629
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4602
4630
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4603
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4604
4632
|
"div",
|
|
4605
4633
|
{
|
|
4606
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`,
|
|
@@ -4612,7 +4640,7 @@ var ProgressPill = ({
|
|
|
4612
4640
|
};
|
|
4613
4641
|
const renderCumulativeFill = () => {
|
|
4614
4642
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4615
|
-
return /* @__PURE__ */ (0,
|
|
4643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4616
4644
|
"div",
|
|
4617
4645
|
{
|
|
4618
4646
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4622,7 +4650,7 @@ var ProgressPill = ({
|
|
|
4622
4650
|
}
|
|
4623
4651
|
return null;
|
|
4624
4652
|
};
|
|
4625
|
-
return /* @__PURE__ */ (0,
|
|
4653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4626
4654
|
"button",
|
|
4627
4655
|
{
|
|
4628
4656
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -4960,10 +4988,10 @@ var PathUtility = class {
|
|
|
4960
4988
|
var PathUtility_default = new PathUtility();
|
|
4961
4989
|
|
|
4962
4990
|
// src/components/NoDataFound.tsx
|
|
4963
|
-
var
|
|
4991
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4964
4992
|
var NoDataFound = () => {
|
|
4965
|
-
return /* @__PURE__ */ (0,
|
|
4966
|
-
/* @__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)(
|
|
4967
4995
|
"svg",
|
|
4968
4996
|
{
|
|
4969
4997
|
className: "w-10 h-10",
|
|
@@ -4971,7 +4999,7 @@ var NoDataFound = () => {
|
|
|
4971
4999
|
stroke: "currentColor",
|
|
4972
5000
|
viewBox: "0 0 24 24",
|
|
4973
5001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4974
|
-
children: /* @__PURE__ */ (0,
|
|
5002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4975
5003
|
"path",
|
|
4976
5004
|
{
|
|
4977
5005
|
strokeLinecap: "round",
|
|
@@ -4982,8 +5010,8 @@ var NoDataFound = () => {
|
|
|
4982
5010
|
)
|
|
4983
5011
|
}
|
|
4984
5012
|
) }) }),
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
/* @__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." })
|
|
4987
5015
|
] });
|
|
4988
5016
|
};
|
|
4989
5017
|
var NoDataFound_default = NoDataFound;
|
|
@@ -4991,7 +5019,7 @@ var NoDataFound_default = NoDataFound;
|
|
|
4991
5019
|
// src/components/Pagination.tsx
|
|
4992
5020
|
var import_react48 = require("react");
|
|
4993
5021
|
init_StyleTypes();
|
|
4994
|
-
var
|
|
5022
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4995
5023
|
var Pagination = (props) => {
|
|
4996
5024
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
4997
5025
|
const builder = (0, import_react48.useMemo)(() => {
|
|
@@ -5035,7 +5063,7 @@ var Pagination = (props) => {
|
|
|
5035
5063
|
return range;
|
|
5036
5064
|
};
|
|
5037
5065
|
const paginationRange = getPaginationRange();
|
|
5038
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
5066
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5039
5067
|
Hyperlink,
|
|
5040
5068
|
{
|
|
5041
5069
|
linkType: "Link" /* Link */,
|
|
@@ -5050,9 +5078,9 @@ var Pagination = (props) => {
|
|
|
5050
5078
|
);
|
|
5051
5079
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
5052
5080
|
if (disabled) {
|
|
5053
|
-
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 });
|
|
5054
5082
|
}
|
|
5055
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5056
5084
|
Hyperlink,
|
|
5057
5085
|
{
|
|
5058
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",
|
|
@@ -5062,35 +5090,35 @@ var Pagination = (props) => {
|
|
|
5062
5090
|
);
|
|
5063
5091
|
};
|
|
5064
5092
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
5065
|
-
return /* @__PURE__ */ (0,
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5067
|
-
/* @__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: [
|
|
5068
5096
|
"Showing ",
|
|
5069
|
-
/* @__PURE__ */ (0,
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "font-semibold", children: [
|
|
5070
5098
|
startItem,
|
|
5071
5099
|
"-",
|
|
5072
5100
|
endItem
|
|
5073
5101
|
] }),
|
|
5074
5102
|
" ",
|
|
5075
5103
|
"out of ",
|
|
5076
|
-
/* @__PURE__ */ (0,
|
|
5104
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
5077
5105
|
" results"
|
|
5078
5106
|
] }),
|
|
5079
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
5080
|
-
/* @__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)(
|
|
5081
5109
|
NavigationButton,
|
|
5082
5110
|
{
|
|
5083
5111
|
page: activePageNumber - 1,
|
|
5084
5112
|
disabled: activePageNumber === 1,
|
|
5085
5113
|
children: [
|
|
5086
|
-
/* @__PURE__ */ (0,
|
|
5087
|
-
/* @__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" })
|
|
5088
5116
|
]
|
|
5089
5117
|
}
|
|
5090
5118
|
),
|
|
5091
5119
|
paginationRange.map((item, index) => {
|
|
5092
5120
|
if (item === "...") {
|
|
5093
|
-
return /* @__PURE__ */ (0,
|
|
5121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5094
5122
|
"span",
|
|
5095
5123
|
{
|
|
5096
5124
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -5100,23 +5128,23 @@ var Pagination = (props) => {
|
|
|
5100
5128
|
);
|
|
5101
5129
|
}
|
|
5102
5130
|
const page = item;
|
|
5103
|
-
return /* @__PURE__ */ (0,
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PageButton, { page, children: page }, page);
|
|
5104
5132
|
}),
|
|
5105
|
-
/* @__PURE__ */ (0,
|
|
5133
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5106
5134
|
NavigationButton,
|
|
5107
5135
|
{
|
|
5108
5136
|
page: activePageNumber + 1,
|
|
5109
5137
|
disabled: activePageNumber === totalPages,
|
|
5110
5138
|
children: [
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5112
|
-
/* @__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" }) })
|
|
5113
5141
|
]
|
|
5114
5142
|
}
|
|
5115
5143
|
)
|
|
5116
5144
|
] }),
|
|
5117
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5119
|
-
/* @__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)(
|
|
5120
5148
|
"input",
|
|
5121
5149
|
{
|
|
5122
5150
|
type: "number",
|
|
@@ -5137,9 +5165,9 @@ var Pagination = (props) => {
|
|
|
5137
5165
|
) })
|
|
5138
5166
|
] })
|
|
5139
5167
|
] }),
|
|
5140
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
5141
|
-
/* @__PURE__ */ (0,
|
|
5142
|
-
/* @__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)(
|
|
5143
5171
|
Hyperlink,
|
|
5144
5172
|
{
|
|
5145
5173
|
className: `
|
|
@@ -5151,7 +5179,7 @@ var Pagination = (props) => {
|
|
|
5151
5179
|
},
|
|
5152
5180
|
size
|
|
5153
5181
|
)) }),
|
|
5154
|
-
/* @__PURE__ */ (0,
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm", children: "per page" })
|
|
5155
5183
|
] }) })
|
|
5156
5184
|
] });
|
|
5157
5185
|
};
|
|
@@ -5159,7 +5187,7 @@ var Pagination_default = Pagination;
|
|
|
5159
5187
|
|
|
5160
5188
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5161
5189
|
var import_dynamic7 = __toESM(require("next/dynamic"));
|
|
5162
|
-
var
|
|
5190
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5163
5191
|
var HlsPlayer3 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5164
5192
|
var deviceToMediaQuery = (device) => {
|
|
5165
5193
|
switch (device) {
|
|
@@ -5228,8 +5256,8 @@ var ImageGalleryNode = (props) => {
|
|
|
5228
5256
|
right: "justify-end"
|
|
5229
5257
|
};
|
|
5230
5258
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5231
|
-
return /* @__PURE__ */ (0,
|
|
5232
|
-
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)(
|
|
5233
5261
|
HlsPlayer3,
|
|
5234
5262
|
{
|
|
5235
5263
|
sources: hlsSources,
|
|
@@ -5243,14 +5271,14 @@ var ImageGalleryNode = (props) => {
|
|
|
5243
5271
|
session: props.session
|
|
5244
5272
|
}
|
|
5245
5273
|
) }),
|
|
5246
|
-
staticFallback && /* @__PURE__ */ (0,
|
|
5274
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_jsx_runtime68.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("picture", { children: [
|
|
5247
5275
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5248
5276
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5249
5277
|
if (!match) return null;
|
|
5250
5278
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5251
5279
|
if (!srcUrl) return null;
|
|
5252
5280
|
const mediaQuery = deviceToMediaQuery(match.device);
|
|
5253
|
-
return /* @__PURE__ */ (0,
|
|
5281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5254
5282
|
"source",
|
|
5255
5283
|
{
|
|
5256
5284
|
media: mediaQuery,
|
|
@@ -5274,7 +5302,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5274
5302
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5275
5303
|
return (
|
|
5276
5304
|
// eslint-disable-next-line @next/next/no-img-element
|
|
5277
|
-
/* @__PURE__ */ (0,
|
|
5305
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5278
5306
|
"img",
|
|
5279
5307
|
{
|
|
5280
5308
|
loading: "lazy",
|
|
@@ -5295,7 +5323,7 @@ var ImageGalleryNode_default = ImageGalleryNode;
|
|
|
5295
5323
|
|
|
5296
5324
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5297
5325
|
var import_link2 = __toESM(require("next/link"));
|
|
5298
|
-
var
|
|
5326
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5299
5327
|
function toCamelCase(str) {
|
|
5300
5328
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
5301
5329
|
}
|
|
@@ -5502,7 +5530,7 @@ var DivContainer = async (props) => {
|
|
|
5502
5530
|
response = await serviceClient.get(endpoint);
|
|
5503
5531
|
result = response?.result;
|
|
5504
5532
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5505
|
-
return /* @__PURE__ */ (0,
|
|
5533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(NoDataFound_default, {});
|
|
5506
5534
|
}
|
|
5507
5535
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5508
5536
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5519,7 +5547,7 @@ var DivContainer = async (props) => {
|
|
|
5519
5547
|
}
|
|
5520
5548
|
const SelectedNode = NodeTypes2[node.type];
|
|
5521
5549
|
if (!SelectedNode) return null;
|
|
5522
|
-
return /* @__PURE__ */ (0,
|
|
5550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5523
5551
|
SelectedNode,
|
|
5524
5552
|
{
|
|
5525
5553
|
node,
|
|
@@ -5621,9 +5649,9 @@ var DivContainer = async (props) => {
|
|
|
5621
5649
|
props.node.autoFormat && "auto-format",
|
|
5622
5650
|
props.node.bgClass
|
|
5623
5651
|
].filter(Boolean).join(" ");
|
|
5624
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
-
/* @__PURE__ */ (0,
|
|
5626
|
-
/* @__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)(
|
|
5627
5655
|
Wrapper,
|
|
5628
5656
|
{
|
|
5629
5657
|
id: guid,
|
|
@@ -5632,18 +5660,18 @@ var DivContainer = async (props) => {
|
|
|
5632
5660
|
...wrapperProps,
|
|
5633
5661
|
children: dataToRender.map(
|
|
5634
5662
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5635
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
5663
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: child }, i)
|
|
5636
5664
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5637
5665
|
)
|
|
5638
5666
|
}
|
|
5639
5667
|
) }),
|
|
5640
|
-
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 }) })
|
|
5641
5669
|
] });
|
|
5642
5670
|
};
|
|
5643
5671
|
var DivContainer_default = DivContainer;
|
|
5644
5672
|
|
|
5645
5673
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5646
|
-
var
|
|
5674
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5647
5675
|
var NodeTypes = {
|
|
5648
5676
|
["paragraph"]: ParagraphNode_default,
|
|
5649
5677
|
["heading"]: HeadingNode_default,
|
|
@@ -5671,11 +5699,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5671
5699
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5672
5700
|
rootNode = pageBodyTree.root;
|
|
5673
5701
|
}
|
|
5674
|
-
return /* @__PURE__ */ (0,
|
|
5702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5675
5703
|
{
|
|
5676
5704
|
}
|
|
5677
5705
|
const SelectedNode = NodeTypes[node.type];
|
|
5678
|
-
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)(
|
|
5679
5707
|
SelectedNode,
|
|
5680
5708
|
{
|
|
5681
5709
|
node,
|
|
@@ -5691,7 +5719,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5691
5719
|
device: props.device,
|
|
5692
5720
|
widgetRenderer: props.widgetRenderer
|
|
5693
5721
|
}
|
|
5694
|
-
) }) : /* @__PURE__ */ (0,
|
|
5722
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5695
5723
|
SelectedNode,
|
|
5696
5724
|
{
|
|
5697
5725
|
node,
|
|
@@ -5714,7 +5742,7 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
5714
5742
|
// src/components/Toast.tsx
|
|
5715
5743
|
var import_react51 = require("react");
|
|
5716
5744
|
init_ToastService();
|
|
5717
|
-
var
|
|
5745
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5718
5746
|
var Toast = () => {
|
|
5719
5747
|
const [showToast, setShowToast] = (0, import_react51.useState)(false);
|
|
5720
5748
|
const [message, setMessage] = (0, import_react51.useState)("");
|
|
@@ -5757,8 +5785,8 @@ var Toast = () => {
|
|
|
5757
5785
|
const closeToast = () => {
|
|
5758
5786
|
setShowToast(false);
|
|
5759
5787
|
};
|
|
5760
|
-
return /* @__PURE__ */ (0,
|
|
5761
|
-
/* @__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)(
|
|
5762
5790
|
"span",
|
|
5763
5791
|
{
|
|
5764
5792
|
className: "font-medium text-inherit text-sm",
|
|
@@ -5766,7 +5794,7 @@ var Toast = () => {
|
|
|
5766
5794
|
children: message
|
|
5767
5795
|
}
|
|
5768
5796
|
),
|
|
5769
|
-
/* @__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)(
|
|
5770
5798
|
"svg",
|
|
5771
5799
|
{
|
|
5772
5800
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5774,7 +5802,7 @@ var Toast = () => {
|
|
|
5774
5802
|
fill: "none",
|
|
5775
5803
|
viewBox: "0 0 24 24",
|
|
5776
5804
|
stroke: "currentColor",
|
|
5777
|
-
children: /* @__PURE__ */ (0,
|
|
5805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
5778
5806
|
}
|
|
5779
5807
|
) })
|
|
5780
5808
|
] }) }) });
|
|
@@ -5787,7 +5815,7 @@ init_ToastService();
|
|
|
5787
5815
|
// src/components/NavigationTabsV2.tsx
|
|
5788
5816
|
var import_link3 = __toESM(require("next/link"));
|
|
5789
5817
|
var import_navigation = require("next/navigation");
|
|
5790
|
-
var
|
|
5818
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5791
5819
|
function resolveRoutePlaceholders(route, params) {
|
|
5792
5820
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
5793
5821
|
const value = params[key];
|
|
@@ -5812,8 +5840,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
5812
5840
|
isActive: tab.isActive
|
|
5813
5841
|
})) || [];
|
|
5814
5842
|
if (mappedTabs.length === 0) return null;
|
|
5815
|
-
return /* @__PURE__ */ (0,
|
|
5816
|
-
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)(
|
|
5817
5845
|
"div",
|
|
5818
5846
|
{
|
|
5819
5847
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -5831,46 +5859,46 @@ var import_navigation2 = require("next/navigation");
|
|
|
5831
5859
|
|
|
5832
5860
|
// src/components/dataForm/NoContentView.tsx
|
|
5833
5861
|
var import_react52 = __toESM(require("react"));
|
|
5834
|
-
var
|
|
5862
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5835
5863
|
var NoContentView = (props) => {
|
|
5836
|
-
return /* @__PURE__ */ (0,
|
|
5864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react52.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
5837
5865
|
};
|
|
5838
5866
|
var NoContentView_default = NoContentView;
|
|
5839
5867
|
|
|
5840
5868
|
// src/components/dataForm/ContentView.tsx
|
|
5841
5869
|
var import_react53 = __toESM(require("react"));
|
|
5842
|
-
var
|
|
5870
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5843
5871
|
var ContentView = (props) => {
|
|
5844
|
-
return /* @__PURE__ */ (0,
|
|
5845
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
5846
|
-
/* @__PURE__ */ (0,
|
|
5847
|
-
/* @__PURE__ */ (0,
|
|
5848
|
-
/* @__PURE__ */ (0,
|
|
5849
|
-
/* @__PURE__ */ (0,
|
|
5850
|
-
/* @__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" })
|
|
5851
5879
|
] })
|
|
5852
5880
|
] }),
|
|
5853
|
-
/* @__PURE__ */ (0,
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
5855
|
-
/* @__PURE__ */ (0,
|
|
5856
|
-
/* @__PURE__ */ (0,
|
|
5857
|
-
/* @__PURE__ */ (0,
|
|
5858
|
-
/* @__PURE__ */ (0,
|
|
5859
|
-
/* @__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" })
|
|
5860
5888
|
] }),
|
|
5861
|
-
/* @__PURE__ */ (0,
|
|
5862
|
-
/* @__PURE__ */ (0,
|
|
5863
|
-
/* @__PURE__ */ (0,
|
|
5864
|
-
/* @__PURE__ */ (0,
|
|
5865
|
-
/* @__PURE__ */ (0,
|
|
5866
|
-
/* @__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" })
|
|
5867
5895
|
] }),
|
|
5868
|
-
/* @__PURE__ */ (0,
|
|
5869
|
-
/* @__PURE__ */ (0,
|
|
5870
|
-
/* @__PURE__ */ (0,
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
5872
|
-
/* @__PURE__ */ (0,
|
|
5873
|
-
/* @__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" })
|
|
5874
5902
|
] })
|
|
5875
5903
|
] })
|
|
5876
5904
|
] }) }),
|
|
@@ -5881,7 +5909,7 @@ var ContentView_default = ContentView;
|
|
|
5881
5909
|
|
|
5882
5910
|
// src/components/dataForm/DataList.tsx
|
|
5883
5911
|
init_StyleTypes();
|
|
5884
|
-
var
|
|
5912
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5885
5913
|
var DataList = (props) => {
|
|
5886
5914
|
console.log(props.dataset, "datasetssssss");
|
|
5887
5915
|
const router = (0, import_navigation2.useRouter)();
|
|
@@ -5904,7 +5932,7 @@ var DataList = (props) => {
|
|
|
5904
5932
|
if (path.includes(".")) {
|
|
5905
5933
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
5906
5934
|
} else if (Array.isArray(obj[path])) {
|
|
5907
|
-
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));
|
|
5908
5936
|
} else {
|
|
5909
5937
|
return obj[path];
|
|
5910
5938
|
}
|
|
@@ -5960,30 +5988,30 @@ var DataList = (props) => {
|
|
|
5960
5988
|
const renderPageNumbers = () => {
|
|
5961
5989
|
if (pages <= 10) {
|
|
5962
5990
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
5963
|
-
(page) => /* @__PURE__ */ (0,
|
|
5991
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5964
5992
|
Hyperlink,
|
|
5965
5993
|
{
|
|
5966
5994
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
5967
5995
|
href: builder.getNewPageUrl(page),
|
|
5968
5996
|
children: page
|
|
5969
5997
|
}
|
|
5970
|
-
) : /* @__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)
|
|
5971
5999
|
);
|
|
5972
6000
|
} else {
|
|
5973
6001
|
const showFirstPages = activePageNumber <= 5;
|
|
5974
6002
|
const showLastPages = activePageNumber > pages - 5;
|
|
5975
6003
|
if (showFirstPages) {
|
|
5976
|
-
return /* @__PURE__ */ (0,
|
|
5977
|
-
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)(
|
|
5978
6006
|
Hyperlink,
|
|
5979
6007
|
{
|
|
5980
6008
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
5981
6009
|
href: builder.getNewPageUrl(page),
|
|
5982
6010
|
children: page
|
|
5983
6011
|
}
|
|
5984
|
-
) : /* @__PURE__ */ (0,
|
|
5985
|
-
/* @__PURE__ */ (0,
|
|
5986
|
-
/* @__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)(
|
|
5987
6015
|
Hyperlink,
|
|
5988
6016
|
{
|
|
5989
6017
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5991,7 +6019,7 @@ var DataList = (props) => {
|
|
|
5991
6019
|
children: pages - 1
|
|
5992
6020
|
}
|
|
5993
6021
|
),
|
|
5994
|
-
/* @__PURE__ */ (0,
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5995
6023
|
Hyperlink,
|
|
5996
6024
|
{
|
|
5997
6025
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -5999,7 +6027,7 @@ var DataList = (props) => {
|
|
|
5999
6027
|
children: pages
|
|
6000
6028
|
}
|
|
6001
6029
|
),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6030
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6003
6031
|
"select",
|
|
6004
6032
|
{
|
|
6005
6033
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -6011,18 +6039,18 @@ var DataList = (props) => {
|
|
|
6011
6039
|
}
|
|
6012
6040
|
},
|
|
6013
6041
|
children: [
|
|
6014
|
-
/* @__PURE__ */ (0,
|
|
6042
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
6015
6043
|
Array.from(
|
|
6016
6044
|
{ length: Math.max(0, pages - 10) },
|
|
6017
6045
|
(_, index) => index + 9
|
|
6018
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
6046
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { value: page, children: page }, page))
|
|
6019
6047
|
]
|
|
6020
6048
|
}
|
|
6021
6049
|
) })
|
|
6022
6050
|
] });
|
|
6023
6051
|
} else if (showLastPages) {
|
|
6024
|
-
return /* @__PURE__ */ (0,
|
|
6025
|
-
/* @__PURE__ */ (0,
|
|
6052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6053
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6026
6054
|
Hyperlink,
|
|
6027
6055
|
{
|
|
6028
6056
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6030,7 +6058,7 @@ var DataList = (props) => {
|
|
|
6030
6058
|
children: "1"
|
|
6031
6059
|
}
|
|
6032
6060
|
),
|
|
6033
|
-
/* @__PURE__ */ (0,
|
|
6061
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6034
6062
|
Hyperlink,
|
|
6035
6063
|
{
|
|
6036
6064
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6038,21 +6066,21 @@ var DataList = (props) => {
|
|
|
6038
6066
|
children: "2"
|
|
6039
6067
|
}
|
|
6040
6068
|
),
|
|
6041
|
-
/* @__PURE__ */ (0,
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6042
6070
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
6043
|
-
(page) => /* @__PURE__ */ (0,
|
|
6071
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6044
6072
|
Hyperlink,
|
|
6045
6073
|
{
|
|
6046
6074
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
6047
6075
|
href: builder.getNewPageUrl(page),
|
|
6048
6076
|
children: page
|
|
6049
6077
|
}
|
|
6050
|
-
) : /* @__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)
|
|
6051
6079
|
)
|
|
6052
6080
|
] });
|
|
6053
6081
|
} else {
|
|
6054
|
-
return /* @__PURE__ */ (0,
|
|
6055
|
-
/* @__PURE__ */ (0,
|
|
6082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6056
6084
|
Hyperlink,
|
|
6057
6085
|
{
|
|
6058
6086
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6060,7 +6088,7 @@ var DataList = (props) => {
|
|
|
6060
6088
|
children: "1"
|
|
6061
6089
|
}
|
|
6062
6090
|
),
|
|
6063
|
-
/* @__PURE__ */ (0,
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6064
6092
|
Hyperlink,
|
|
6065
6093
|
{
|
|
6066
6094
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6068,20 +6096,20 @@ var DataList = (props) => {
|
|
|
6068
6096
|
children: "2"
|
|
6069
6097
|
}
|
|
6070
6098
|
),
|
|
6071
|
-
/* @__PURE__ */ (0,
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
6072
6100
|
Array.from(
|
|
6073
6101
|
{ length: 5 },
|
|
6074
6102
|
(_, index) => activePageNumber - 2 + index
|
|
6075
|
-
).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)(
|
|
6076
6104
|
Hyperlink,
|
|
6077
6105
|
{
|
|
6078
6106
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
6079
6107
|
href: builder.getNewPageUrl(page),
|
|
6080
6108
|
children: page
|
|
6081
6109
|
}
|
|
6082
|
-
) : /* @__PURE__ */ (0,
|
|
6083
|
-
/* @__PURE__ */ (0,
|
|
6084
|
-
/* @__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)(
|
|
6085
6113
|
Hyperlink,
|
|
6086
6114
|
{
|
|
6087
6115
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6089,7 +6117,7 @@ var DataList = (props) => {
|
|
|
6089
6117
|
children: pages - 1
|
|
6090
6118
|
}
|
|
6091
6119
|
),
|
|
6092
|
-
/* @__PURE__ */ (0,
|
|
6120
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6093
6121
|
Hyperlink,
|
|
6094
6122
|
{
|
|
6095
6123
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -6097,7 +6125,7 @@ var DataList = (props) => {
|
|
|
6097
6125
|
children: pages
|
|
6098
6126
|
}
|
|
6099
6127
|
),
|
|
6100
|
-
/* @__PURE__ */ (0,
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6101
6129
|
"select",
|
|
6102
6130
|
{
|
|
6103
6131
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -6109,8 +6137,8 @@ var DataList = (props) => {
|
|
|
6109
6137
|
}
|
|
6110
6138
|
},
|
|
6111
6139
|
children: [
|
|
6112
|
-
/* @__PURE__ */ (0,
|
|
6113
|
-
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))
|
|
6114
6142
|
]
|
|
6115
6143
|
}
|
|
6116
6144
|
) })
|
|
@@ -6118,16 +6146,16 @@ var DataList = (props) => {
|
|
|
6118
6146
|
}
|
|
6119
6147
|
}
|
|
6120
6148
|
};
|
|
6121
|
-
return /* @__PURE__ */ (0,
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6123
|
-
(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)(
|
|
6124
6152
|
"div",
|
|
6125
6153
|
{
|
|
6126
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`,
|
|
6127
6155
|
children: [
|
|
6128
|
-
props.title ? /* @__PURE__ */ (0,
|
|
6129
|
-
/* @__PURE__ */ (0,
|
|
6130
|
-
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)(
|
|
6131
6159
|
InputControl_default,
|
|
6132
6160
|
{
|
|
6133
6161
|
name: filter.name,
|
|
@@ -6142,15 +6170,15 @@ var DataList = (props) => {
|
|
|
6142
6170
|
},
|
|
6143
6171
|
filter.name
|
|
6144
6172
|
)),
|
|
6145
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
6173
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6146
6174
|
Hyperlink,
|
|
6147
6175
|
{
|
|
6148
6176
|
className: "gap-1",
|
|
6149
6177
|
linkType: "Primary" /* Solid */,
|
|
6150
6178
|
href: props.addLinkHref,
|
|
6151
6179
|
children: [
|
|
6152
|
-
/* @__PURE__ */ (0,
|
|
6153
|
-
/* @__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" })
|
|
6154
6182
|
]
|
|
6155
6183
|
}
|
|
6156
6184
|
)
|
|
@@ -6158,8 +6186,8 @@ var DataList = (props) => {
|
|
|
6158
6186
|
]
|
|
6159
6187
|
}
|
|
6160
6188
|
),
|
|
6161
|
-
/* @__PURE__ */ (0,
|
|
6162
|
-
/* @__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) => {
|
|
6163
6191
|
let url = builder.getNewOrderByUrl(column.name);
|
|
6164
6192
|
let icon = "chevronUpDown";
|
|
6165
6193
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -6169,18 +6197,18 @@ var DataList = (props) => {
|
|
|
6169
6197
|
icon = "chevronUp";
|
|
6170
6198
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
6171
6199
|
}
|
|
6172
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6173
6201
|
"th",
|
|
6174
6202
|
{
|
|
6175
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" : ""),
|
|
6176
|
-
children: /* @__PURE__ */ (0,
|
|
6204
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6177
6205
|
Hyperlink,
|
|
6178
6206
|
{
|
|
6179
6207
|
href: column.enableSorting ? url : void 0,
|
|
6180
6208
|
className: "!text-neutral-contrast ",
|
|
6181
|
-
children: /* @__PURE__ */ (0,
|
|
6182
|
-
/* @__PURE__ */ (0,
|
|
6183
|
-
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 })
|
|
6184
6212
|
] })
|
|
6185
6213
|
}
|
|
6186
6214
|
)
|
|
@@ -6188,24 +6216,24 @@ var DataList = (props) => {
|
|
|
6188
6216
|
column.name
|
|
6189
6217
|
);
|
|
6190
6218
|
}) }) }),
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
6192
6220
|
let validityClass = "";
|
|
6193
6221
|
console.log("dataitem", dataitem);
|
|
6194
6222
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
6195
6223
|
validityClass = "bg-alert-200";
|
|
6196
6224
|
}
|
|
6197
|
-
return /* @__PURE__ */ (0,
|
|
6225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
6198
6226
|
console.log("column", column);
|
|
6199
|
-
return /* @__PURE__ */ (0,
|
|
6227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6200
6228
|
"td",
|
|
6201
6229
|
{
|
|
6202
6230
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
6203
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
6231
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6204
6232
|
Hyperlink,
|
|
6205
6233
|
{
|
|
6206
6234
|
className: "",
|
|
6207
6235
|
href: `https://${dataitem[column.name]}`,
|
|
6208
|
-
children: /* @__PURE__ */ (0,
|
|
6236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6209
6237
|
ViewControl_default,
|
|
6210
6238
|
{
|
|
6211
6239
|
controlType: column.controlType,
|
|
@@ -6218,11 +6246,11 @@ var DataList = (props) => {
|
|
|
6218
6246
|
}
|
|
6219
6247
|
)
|
|
6220
6248
|
}
|
|
6221
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
6249
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6222
6250
|
Hyperlink,
|
|
6223
6251
|
{
|
|
6224
6252
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
6225
|
-
children: /* @__PURE__ */ (0,
|
|
6253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6226
6254
|
ViewControl_default,
|
|
6227
6255
|
{
|
|
6228
6256
|
controlType: column.controlType,
|
|
@@ -6232,7 +6260,7 @@ var DataList = (props) => {
|
|
|
6232
6260
|
}
|
|
6233
6261
|
)
|
|
6234
6262
|
}
|
|
6235
|
-
) : /* @__PURE__ */ (0,
|
|
6263
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6236
6264
|
ViewControl_default,
|
|
6237
6265
|
{
|
|
6238
6266
|
controlType: column.controlType,
|
|
@@ -6246,10 +6274,10 @@ var DataList = (props) => {
|
|
|
6246
6274
|
}) }, index);
|
|
6247
6275
|
}) })
|
|
6248
6276
|
] }) }),
|
|
6249
|
-
/* @__PURE__ */ (0,
|
|
6250
|
-
/* @__PURE__ */ (0,
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6252
|
-
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)(
|
|
6253
6281
|
Hyperlink,
|
|
6254
6282
|
{
|
|
6255
6283
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -6257,9 +6285,9 @@ var DataList = (props) => {
|
|
|
6257
6285
|
children: "Prev"
|
|
6258
6286
|
}
|
|
6259
6287
|
),
|
|
6260
|
-
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" }),
|
|
6261
6289
|
renderPageNumbers(),
|
|
6262
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
6290
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6263
6291
|
Hyperlink,
|
|
6264
6292
|
{
|
|
6265
6293
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -6267,19 +6295,19 @@ var DataList = (props) => {
|
|
|
6267
6295
|
children: "Next"
|
|
6268
6296
|
}
|
|
6269
6297
|
),
|
|
6270
|
-
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" })
|
|
6271
6299
|
] })
|
|
6272
6300
|
] }) })
|
|
6273
6301
|
] }),
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
(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)(
|
|
6276
6304
|
"div",
|
|
6277
6305
|
{
|
|
6278
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`,
|
|
6279
6307
|
children: [
|
|
6280
|
-
props.title ? /* @__PURE__ */ (0,
|
|
6281
|
-
/* @__PURE__ */ (0,
|
|
6282
|
-
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)(
|
|
6283
6311
|
InputControl_default,
|
|
6284
6312
|
{
|
|
6285
6313
|
name: filter.name,
|
|
@@ -6294,15 +6322,15 @@ var DataList = (props) => {
|
|
|
6294
6322
|
},
|
|
6295
6323
|
filter.name
|
|
6296
6324
|
)),
|
|
6297
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
6325
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6298
6326
|
Hyperlink,
|
|
6299
6327
|
{
|
|
6300
6328
|
className: "gap-1",
|
|
6301
6329
|
linkType: "Primary" /* Solid */,
|
|
6302
6330
|
href: props.addLinkHref,
|
|
6303
6331
|
children: [
|
|
6304
|
-
/* @__PURE__ */ (0,
|
|
6305
|
-
/* @__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" })
|
|
6306
6334
|
]
|
|
6307
6335
|
}
|
|
6308
6336
|
)
|
|
@@ -6310,8 +6338,8 @@ var DataList = (props) => {
|
|
|
6310
6338
|
]
|
|
6311
6339
|
}
|
|
6312
6340
|
),
|
|
6313
|
-
/* @__PURE__ */ (0,
|
|
6314
|
-
/* @__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) => {
|
|
6315
6343
|
let url = builder.getNewOrderByUrl(column.name);
|
|
6316
6344
|
let icon = "chevronUpDown";
|
|
6317
6345
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -6321,18 +6349,18 @@ var DataList = (props) => {
|
|
|
6321
6349
|
icon = "chevronUp";
|
|
6322
6350
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
6323
6351
|
}
|
|
6324
|
-
return /* @__PURE__ */ (0,
|
|
6352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6325
6353
|
"th",
|
|
6326
6354
|
{
|
|
6327
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" : ""),
|
|
6328
|
-
children: /* @__PURE__ */ (0,
|
|
6356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6329
6357
|
Hyperlink,
|
|
6330
6358
|
{
|
|
6331
6359
|
href: column.enableSorting ? url : void 0,
|
|
6332
6360
|
className: "text-body-950",
|
|
6333
|
-
children: /* @__PURE__ */ (0,
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
6335
|
-
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 })
|
|
6336
6364
|
] })
|
|
6337
6365
|
}
|
|
6338
6366
|
)
|
|
@@ -6340,7 +6368,7 @@ var DataList = (props) => {
|
|
|
6340
6368
|
column.name
|
|
6341
6369
|
);
|
|
6342
6370
|
}) }) }) }) }),
|
|
6343
|
-
/* @__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." })
|
|
6344
6372
|
] })
|
|
6345
6373
|
] })
|
|
6346
6374
|
] });
|
|
@@ -6351,7 +6379,7 @@ var DataList_default = DataList;
|
|
|
6351
6379
|
var import_react55 = __toESM(require("react"));
|
|
6352
6380
|
init_ServiceClient();
|
|
6353
6381
|
var import_navigation3 = require("next/navigation");
|
|
6354
|
-
var
|
|
6382
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
6355
6383
|
var viewControlMap = {
|
|
6356
6384
|
number: ViewControlTypes.number,
|
|
6357
6385
|
lineText: ViewControlTypes.lineText,
|
|
@@ -6440,9 +6468,9 @@ var DataListRenderer = ({
|
|
|
6440
6468
|
const [tabItem, setTabItem] = (0, import_react55.useState)();
|
|
6441
6469
|
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
6442
6470
|
const activeHref = activeTab ? resolveRoutePlaceholders2(activeTab.landingPageUrl, params) : pathname;
|
|
6443
|
-
return /* @__PURE__ */ (0,
|
|
6444
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
6445
|
-
/* @__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)(
|
|
6446
6474
|
DataList_default,
|
|
6447
6475
|
{
|
|
6448
6476
|
addLinkHref,
|
|
@@ -6492,7 +6520,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
6492
6520
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
6493
6521
|
|
|
6494
6522
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
6495
|
-
var
|
|
6523
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
6496
6524
|
var DataFormChildSection = (props) => {
|
|
6497
6525
|
const { section } = props;
|
|
6498
6526
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -6560,14 +6588,14 @@ var DataFormChildSection = (props) => {
|
|
|
6560
6588
|
childItemsToRender,
|
|
6561
6589
|
allChildItems: childItems
|
|
6562
6590
|
});
|
|
6563
|
-
return /* @__PURE__ */ (0,
|
|
6564
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
6565
|
-
/* @__PURE__ */ (0,
|
|
6566
|
-
/* @__PURE__ */ (0,
|
|
6567
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
6568
|
-
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: [
|
|
6569
6597
|
sectionRow.elements.map((field, index) => {
|
|
6570
|
-
return /* @__PURE__ */ (0,
|
|
6598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6571
6599
|
"th",
|
|
6572
6600
|
{
|
|
6573
6601
|
className: "py-3 font-normal text-left",
|
|
@@ -6576,21 +6604,21 @@ var DataFormChildSection = (props) => {
|
|
|
6576
6604
|
field.name
|
|
6577
6605
|
);
|
|
6578
6606
|
}),
|
|
6579
|
-
!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" })
|
|
6580
6608
|
] }, sectionRowIndex);
|
|
6581
6609
|
}) }),
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
6583
6611
|
const { item, originalIndex } = visibleItem;
|
|
6584
6612
|
const rowKey = originalIndex;
|
|
6585
|
-
return /* @__PURE__ */ (0,
|
|
6613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react56.default.Fragment, { children: section.sectionRows.map(
|
|
6586
6614
|
(sectionRow, sectionRowIndex) => {
|
|
6587
|
-
return /* @__PURE__ */ (0,
|
|
6615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6588
6616
|
"tr",
|
|
6589
6617
|
{
|
|
6590
6618
|
className: "",
|
|
6591
6619
|
children: [
|
|
6592
6620
|
sectionRow.elements.map((field, index) => {
|
|
6593
|
-
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)(
|
|
6594
6622
|
InputControl_default,
|
|
6595
6623
|
{
|
|
6596
6624
|
index: filteredIndex,
|
|
@@ -6610,7 +6638,7 @@ var DataFormChildSection = (props) => {
|
|
|
6610
6638
|
}
|
|
6611
6639
|
) }) }) }, field.name);
|
|
6612
6640
|
}),
|
|
6613
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
6641
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6614
6642
|
ClientButton_default,
|
|
6615
6643
|
{
|
|
6616
6644
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -6619,7 +6647,7 @@ var DataFormChildSection = (props) => {
|
|
|
6619
6647
|
},
|
|
6620
6648
|
dataRole: "delete",
|
|
6621
6649
|
tabIndex: -1,
|
|
6622
|
-
children: /* @__PURE__ */ (0,
|
|
6650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6623
6651
|
Icon_default,
|
|
6624
6652
|
{
|
|
6625
6653
|
className: "w-4 h-4",
|
|
@@ -6636,7 +6664,7 @@ var DataFormChildSection = (props) => {
|
|
|
6636
6664
|
) }, rowKey);
|
|
6637
6665
|
}) })
|
|
6638
6666
|
] }) }),
|
|
6639
|
-
!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)(
|
|
6640
6668
|
ClientButton_default,
|
|
6641
6669
|
{
|
|
6642
6670
|
ButtonType: "Link" /* Link */,
|
|
@@ -6651,7 +6679,7 @@ var DataFormChildSection = (props) => {
|
|
|
6651
6679
|
var DataFormChildSection_default = DataFormChildSection;
|
|
6652
6680
|
|
|
6653
6681
|
// src/components/dataForm/DataForm.tsx
|
|
6654
|
-
var
|
|
6682
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6655
6683
|
var DataForm = (props) => {
|
|
6656
6684
|
const formRef = (0, import_react57.useRef)(null);
|
|
6657
6685
|
console.log(props.dataItem, "dssads");
|
|
@@ -6871,19 +6899,19 @@ var DataForm = (props) => {
|
|
|
6871
6899
|
return false;
|
|
6872
6900
|
}
|
|
6873
6901
|
}
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
6875
|
-
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)(
|
|
6876
6904
|
"div",
|
|
6877
6905
|
{
|
|
6878
6906
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
6879
6907
|
onClick: () => window.history.back(),
|
|
6880
6908
|
children: [
|
|
6881
|
-
/* @__PURE__ */ (0,
|
|
6882
|
-
/* @__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 })
|
|
6883
6911
|
]
|
|
6884
6912
|
}
|
|
6885
6913
|
) }),
|
|
6886
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6887
6915
|
"form",
|
|
6888
6916
|
{
|
|
6889
6917
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -6904,8 +6932,8 @@ var DataForm = (props) => {
|
|
|
6904
6932
|
}
|
|
6905
6933
|
}
|
|
6906
6934
|
},
|
|
6907
|
-
children: /* @__PURE__ */ (0,
|
|
6908
|
-
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: [
|
|
6909
6937
|
section.sectionRows?.map(
|
|
6910
6938
|
(sectionRow, sectionRowIndex) => {
|
|
6911
6939
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -6916,14 +6944,14 @@ var DataForm = (props) => {
|
|
|
6916
6944
|
sectionRow.visible
|
|
6917
6945
|
);
|
|
6918
6946
|
}
|
|
6919
|
-
return /* @__PURE__ */ (0,
|
|
6920
|
-
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)(
|
|
6921
6949
|
"div",
|
|
6922
6950
|
{
|
|
6923
6951
|
className: sectionRow.grow ? "grow" : "",
|
|
6924
6952
|
children: [
|
|
6925
|
-
/* @__PURE__ */ (0,
|
|
6926
|
-
/* @__PURE__ */ (0,
|
|
6953
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: field.controlType }),
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6927
6955
|
InputControl_default,
|
|
6928
6956
|
{
|
|
6929
6957
|
name: field.name,
|
|
@@ -6953,12 +6981,12 @@ var DataForm = (props) => {
|
|
|
6953
6981
|
}) }) }, sectionRowIndex);
|
|
6954
6982
|
}
|
|
6955
6983
|
),
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: section.childSections?.map(
|
|
6957
6985
|
(childSection, childSectionIndex) => {
|
|
6958
|
-
return /* @__PURE__ */ (0,
|
|
6986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
6959
6987
|
formState.inputValues,
|
|
6960
6988
|
childSection.visible
|
|
6961
|
-
) && /* @__PURE__ */ (0,
|
|
6989
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6962
6990
|
DataFormChildSection_default,
|
|
6963
6991
|
{
|
|
6964
6992
|
section: childSection,
|
|
@@ -6973,8 +7001,8 @@ var DataForm = (props) => {
|
|
|
6973
7001
|
}) })
|
|
6974
7002
|
}
|
|
6975
7003
|
),
|
|
6976
|
-
/* @__PURE__ */ (0,
|
|
6977
|
-
/* @__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)(
|
|
6978
7006
|
Button_default,
|
|
6979
7007
|
{
|
|
6980
7008
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -6982,7 +7010,7 @@ var DataForm = (props) => {
|
|
|
6982
7010
|
children: props.additionalActions.title
|
|
6983
7011
|
}
|
|
6984
7012
|
) }),
|
|
6985
|
-
/* @__PURE__ */ (0,
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6986
7014
|
Button_default,
|
|
6987
7015
|
{
|
|
6988
7016
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -6993,7 +7021,7 @@ var DataForm = (props) => {
|
|
|
6993
7021
|
children: "Delete"
|
|
6994
7022
|
}
|
|
6995
7023
|
) }),
|
|
6996
|
-
/* @__PURE__ */ (0,
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6997
7025
|
Button_default,
|
|
6998
7026
|
{
|
|
6999
7027
|
onValidate,
|
|
@@ -7011,7 +7039,7 @@ var DataForm_default = DataForm;
|
|
|
7011
7039
|
|
|
7012
7040
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
7013
7041
|
init_ServiceClient();
|
|
7014
|
-
var
|
|
7042
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7015
7043
|
function getAction(actions, code) {
|
|
7016
7044
|
return actions?.find((a) => a.actionCode === code);
|
|
7017
7045
|
}
|
|
@@ -7037,9 +7065,9 @@ var DataFormRenderer = ({
|
|
|
7037
7065
|
"Delete"
|
|
7038
7066
|
);
|
|
7039
7067
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
7040
|
-
return /* @__PURE__ */ (0,
|
|
7041
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
7042
|
-
/* @__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)(
|
|
7043
7071
|
DataForm_default,
|
|
7044
7072
|
{
|
|
7045
7073
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|