@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260423051720 → 0.8.1-dev.20260423070204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HlsPlayer-CTZICLSJ.mjs → HlsPlayer-GV3FOPYT.mjs} +1 -1
- package/dist/{chunk-VNSFFK3H.mjs → chunk-TXHD4F4A.mjs} +24 -4
- package/dist/index.d.mts +112 -1
- package/dist/index.d.ts +112 -1
- package/dist/index.js +1029 -852
- package/dist/index.mjs +571 -416
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,15 +89,15 @@ var init_StyleTypes = __esm({
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
// src/components/ClientButton.tsx
|
|
92
|
-
var
|
|
92
|
+
var import_react23, import_jsx_runtime24, ClientButton, ClientButton_default;
|
|
93
93
|
var init_ClientButton = __esm({
|
|
94
94
|
"src/components/ClientButton.tsx"() {
|
|
95
95
|
"use strict";
|
|
96
96
|
"use client";
|
|
97
|
-
|
|
97
|
+
import_react23 = __toESM(require("react"));
|
|
98
98
|
init_ToastService();
|
|
99
99
|
init_StyleTypes();
|
|
100
|
-
|
|
100
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
101
101
|
ClientButton = (props) => {
|
|
102
102
|
const execute = async (event) => {
|
|
103
103
|
if (props.onClick !== void 0) {
|
|
@@ -107,7 +107,7 @@ var init_ClientButton = __esm({
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
110
|
-
return /* @__PURE__ */ (0,
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react23.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
111
111
|
"button",
|
|
112
112
|
{
|
|
113
113
|
type: "button",
|
|
@@ -122,17 +122,17 @@ var init_ClientButton = __esm({
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
// src/components/Confirm.tsx
|
|
125
|
-
var
|
|
125
|
+
var import_react24, import_jsx_runtime25, Confirm, Confirm_default;
|
|
126
126
|
var init_Confirm = __esm({
|
|
127
127
|
"src/components/Confirm.tsx"() {
|
|
128
128
|
"use strict";
|
|
129
129
|
"use client";
|
|
130
|
-
|
|
130
|
+
import_react24 = require("react");
|
|
131
131
|
init_ClientButton();
|
|
132
132
|
init_StyleTypes();
|
|
133
|
-
|
|
133
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
134
134
|
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
135
|
-
const [showModal, setShowModal] = (0,
|
|
135
|
+
const [showModal, setShowModal] = (0, import_react24.useState)(true);
|
|
136
136
|
const handleConfirmAction = () => {
|
|
137
137
|
setShowModal(false);
|
|
138
138
|
if (onConfirm) {
|
|
@@ -145,13 +145,13 @@ var init_Confirm = __esm({
|
|
|
145
145
|
onCancel();
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
return /* @__PURE__ */ (0,
|
|
149
|
-
/* @__PURE__ */ (0,
|
|
150
|
-
/* @__PURE__ */ (0,
|
|
151
|
-
/* @__PURE__ */ (0,
|
|
152
|
-
/* @__PURE__ */ (0,
|
|
153
|
-
/* @__PURE__ */ (0,
|
|
154
|
-
/* @__PURE__ */ (0,
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mb-4", children: message }),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
155
155
|
ClientButton_default,
|
|
156
156
|
{
|
|
157
157
|
onClick: handleCancelAction,
|
|
@@ -159,7 +159,7 @@ var init_Confirm = __esm({
|
|
|
159
159
|
children: "Cancel"
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */ (0,
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
163
163
|
ClientButton_default,
|
|
164
164
|
{
|
|
165
165
|
onClick: handleConfirmAction,
|
|
@@ -177,21 +177,21 @@ var init_Confirm = __esm({
|
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
// src/components/Button.tsx
|
|
180
|
-
var
|
|
180
|
+
var import_react25, import_jsx_runtime26, Button, Button_default;
|
|
181
181
|
var init_Button = __esm({
|
|
182
182
|
"src/components/Button.tsx"() {
|
|
183
183
|
"use strict";
|
|
184
184
|
"use client";
|
|
185
|
-
|
|
185
|
+
import_react25 = __toESM(require("react"));
|
|
186
186
|
init_ToastService();
|
|
187
187
|
init_StyleTypes();
|
|
188
188
|
init_Confirm();
|
|
189
|
-
|
|
189
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
190
190
|
Button = (props) => {
|
|
191
|
-
const [inProgress, setInProgress] = (0,
|
|
192
|
-
const [isActionPerformed, setIsActionPerformed] = (0,
|
|
193
|
-
const [responseMessage, setResponseMessage] = (0,
|
|
194
|
-
const [showModal, setShowModal] = (0,
|
|
191
|
+
const [inProgress, setInProgress] = (0, import_react25.useState)(false);
|
|
192
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react25.useState)(false);
|
|
193
|
+
const [responseMessage, setResponseMessage] = (0, import_react25.useState)(null);
|
|
194
|
+
const [showModal, setShowModal] = (0, import_react25.useState)(null);
|
|
195
195
|
const execute = async (event) => {
|
|
196
196
|
event.preventDefault();
|
|
197
197
|
event.stopPropagation();
|
|
@@ -235,14 +235,14 @@ var init_Button = __esm({
|
|
|
235
235
|
return new Promise((resolve) => {
|
|
236
236
|
const onConfirm = () => resolve(true);
|
|
237
237
|
const onCancel = () => resolve(false);
|
|
238
|
-
setShowModal(/* @__PURE__ */ (0,
|
|
238
|
+
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
239
239
|
});
|
|
240
240
|
};
|
|
241
241
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
242
242
|
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
243
243
|
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
244
|
-
return /* @__PURE__ */ (0,
|
|
245
|
-
/* @__PURE__ */ (0,
|
|
244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react25.default.Fragment, { children: [
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
246
246
|
"button",
|
|
247
247
|
{
|
|
248
248
|
type: "submit",
|
|
@@ -252,9 +252,9 @@ var init_Button = __esm({
|
|
|
252
252
|
className: buttonClass + " relative " + props.className,
|
|
253
253
|
children: [
|
|
254
254
|
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
255
|
-
inProgress && /* @__PURE__ */ (0,
|
|
256
|
-
/* @__PURE__ */ (0,
|
|
257
|
-
/* @__PURE__ */ (0,
|
|
255
|
+
inProgress && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react25.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { className: "animate-spin ml-2 mr-3 h-5 w-5 " + progressClass, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
258
258
|
] }) })
|
|
259
259
|
]
|
|
260
260
|
}
|
|
@@ -266,20 +266,238 @@ var init_Button = __esm({
|
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
+
// src/clients/CacheManage.tsx
|
|
270
|
+
var import_node_cache, CacheManager;
|
|
271
|
+
var init_CacheManage = __esm({
|
|
272
|
+
"src/clients/CacheManage.tsx"() {
|
|
273
|
+
"use strict";
|
|
274
|
+
import_node_cache = __toESM(require("node-cache"));
|
|
275
|
+
CacheManager = class _CacheManager {
|
|
276
|
+
constructor() {
|
|
277
|
+
this.maxCacheSize = 1e3;
|
|
278
|
+
this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
|
|
279
|
+
}
|
|
280
|
+
static getInstance() {
|
|
281
|
+
if (!_CacheManager.instance) {
|
|
282
|
+
_CacheManager.instance = new _CacheManager();
|
|
283
|
+
}
|
|
284
|
+
return _CacheManager.instance;
|
|
285
|
+
}
|
|
286
|
+
get(key) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
set(key, data, ttl) {
|
|
290
|
+
}
|
|
291
|
+
clear() {
|
|
292
|
+
this.cache.flushAll();
|
|
293
|
+
}
|
|
294
|
+
size() {
|
|
295
|
+
return this.cache.keys().length;
|
|
296
|
+
}
|
|
297
|
+
destroy() {
|
|
298
|
+
this.cache.close();
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// src/clients/ServiceClient.tsx
|
|
305
|
+
var ServerApiError, ServiceClient, ServiceClient_default;
|
|
306
|
+
var init_ServiceClient = __esm({
|
|
307
|
+
"src/clients/ServiceClient.tsx"() {
|
|
308
|
+
"use strict";
|
|
309
|
+
init_CacheManage();
|
|
310
|
+
ServerApiError = class extends Error {
|
|
311
|
+
constructor(data, status) {
|
|
312
|
+
super(data.message || "---");
|
|
313
|
+
this.status = status;
|
|
314
|
+
this.data = data;
|
|
315
|
+
this.data.isSuccessful = false;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
ServiceClient = class {
|
|
319
|
+
constructor(apiBaseUrl, session) {
|
|
320
|
+
this.cacheManager = CacheManager.getInstance();
|
|
321
|
+
this.baseUrl = apiBaseUrl;
|
|
322
|
+
this.session = session;
|
|
323
|
+
}
|
|
324
|
+
buildFullPath(path, params) {
|
|
325
|
+
let updatedPath = path;
|
|
326
|
+
if (params) {
|
|
327
|
+
Object.keys(params).forEach((key) => {
|
|
328
|
+
updatedPath = updatedPath.replace(
|
|
329
|
+
`{${key}}`,
|
|
330
|
+
String(params[key])
|
|
331
|
+
);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
return this.baseUrl + updatedPath;
|
|
335
|
+
}
|
|
336
|
+
getConfig() {
|
|
337
|
+
const config = { headers: {} };
|
|
338
|
+
if (this.session) {
|
|
339
|
+
if (this.session.oAuthToken) {
|
|
340
|
+
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
341
|
+
}
|
|
342
|
+
config.headers["cid"] = this.session.cid || "";
|
|
343
|
+
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
344
|
+
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
345
|
+
}
|
|
346
|
+
return config;
|
|
347
|
+
}
|
|
348
|
+
handleFetchError(error) {
|
|
349
|
+
console.log(error);
|
|
350
|
+
const serverApiError = error;
|
|
351
|
+
if (serverApiError) {
|
|
352
|
+
return serverApiError.data;
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
message: "There is some error. Please try after sometime.",
|
|
356
|
+
isSuccessful: false
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
async fetchJsonWithCache(fullPath, config) {
|
|
360
|
+
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
361
|
+
const cachedData = this.cacheManager.get(cacheKey);
|
|
362
|
+
if (cachedData) {
|
|
363
|
+
return cachedData;
|
|
364
|
+
}
|
|
365
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
366
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
367
|
+
if (!response.ok) {
|
|
368
|
+
const apiErrorData = await response.json();
|
|
369
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
370
|
+
}
|
|
371
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
372
|
+
let revalidate = null;
|
|
373
|
+
if (cacheControl) {
|
|
374
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
375
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
376
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
377
|
+
revalidate = maxAge * 1e3;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const data = await response.json();
|
|
381
|
+
data.isSuccessful = true;
|
|
382
|
+
if (revalidate !== null && revalidate > 0) {
|
|
383
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
384
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
385
|
+
}
|
|
386
|
+
return data;
|
|
387
|
+
}
|
|
388
|
+
// private async refreshToken(): Promise<void> {
|
|
389
|
+
// console.log("*******************calling refresh token***********************");
|
|
390
|
+
// try {
|
|
391
|
+
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
392
|
+
// method: 'POST',
|
|
393
|
+
// headers: {
|
|
394
|
+
// 'Content-Type': 'application/json'
|
|
395
|
+
// },
|
|
396
|
+
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
397
|
+
// });
|
|
398
|
+
// if (!response.ok) {
|
|
399
|
+
// throw new Error("Failed to refresh token");
|
|
400
|
+
// }
|
|
401
|
+
// const responseData = await response.json();
|
|
402
|
+
// this.session.oAuthToken = responseData.result.accessToken;
|
|
403
|
+
// if (typeof window === "undefined") {
|
|
404
|
+
// // Running on the server
|
|
405
|
+
// } else {
|
|
406
|
+
// await fetch("/api/login", {
|
|
407
|
+
// method: "post",
|
|
408
|
+
// headers: {
|
|
409
|
+
// "Content-Type": "application/json",
|
|
410
|
+
// },
|
|
411
|
+
// body: JSON.stringify({ session: this.session }),
|
|
412
|
+
// });
|
|
413
|
+
// }
|
|
414
|
+
// } catch (error: any) {
|
|
415
|
+
// throw new Error("Failed to refresh token");
|
|
416
|
+
// }
|
|
417
|
+
// }
|
|
418
|
+
async handleRequest(request) {
|
|
419
|
+
try {
|
|
420
|
+
return await request();
|
|
421
|
+
} catch (error) {
|
|
422
|
+
throw error;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
async post(path, data) {
|
|
426
|
+
const request = async () => {
|
|
427
|
+
const fullPath = this.baseUrl + path;
|
|
428
|
+
const config = this.getConfig();
|
|
429
|
+
const response = await fetch(fullPath, {
|
|
430
|
+
method: "POST",
|
|
431
|
+
headers: {
|
|
432
|
+
...config.headers,
|
|
433
|
+
"Content-Type": "application/json"
|
|
434
|
+
},
|
|
435
|
+
body: JSON.stringify(data)
|
|
436
|
+
});
|
|
437
|
+
if (!response.ok) {
|
|
438
|
+
const apiErrorData = await response.json();
|
|
439
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
440
|
+
}
|
|
441
|
+
const responseData = await response.json();
|
|
442
|
+
responseData.isSuccessful = true;
|
|
443
|
+
return responseData;
|
|
444
|
+
};
|
|
445
|
+
try {
|
|
446
|
+
return await this.handleRequest(request);
|
|
447
|
+
} catch (error) {
|
|
448
|
+
return this.handleFetchError(error);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
async getSingle(path, params) {
|
|
452
|
+
const request = async () => {
|
|
453
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
454
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
455
|
+
) : void 0;
|
|
456
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
457
|
+
const config = this.getConfig();
|
|
458
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
459
|
+
};
|
|
460
|
+
try {
|
|
461
|
+
return await this.handleRequest(request);
|
|
462
|
+
} catch (error) {
|
|
463
|
+
return this.handleFetchError(error);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
async get(path, params) {
|
|
467
|
+
const request = async () => {
|
|
468
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
469
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
470
|
+
) : void 0;
|
|
471
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
472
|
+
const config = this.getConfig();
|
|
473
|
+
console.log(fullPath);
|
|
474
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
475
|
+
};
|
|
476
|
+
try {
|
|
477
|
+
return await this.handleRequest(request);
|
|
478
|
+
} catch (error) {
|
|
479
|
+
return this.handleFetchError(error);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
ServiceClient_default = ServiceClient;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
|
|
269
487
|
// src/components/HlsPlayer.tsx
|
|
270
488
|
var HlsPlayer_exports = {};
|
|
271
489
|
__export(HlsPlayer_exports, {
|
|
272
490
|
default: () => HlsPlayer_default
|
|
273
491
|
});
|
|
274
|
-
var
|
|
492
|
+
var import_react35, import_hls, import_jsx_runtime44, HlsPlayer, HlsPlayer_default;
|
|
275
493
|
var init_HlsPlayer = __esm({
|
|
276
494
|
"src/components/HlsPlayer.tsx"() {
|
|
277
495
|
"use strict";
|
|
278
496
|
"use client";
|
|
279
|
-
|
|
497
|
+
import_react35 = __toESM(require("react"));
|
|
280
498
|
import_hls = __toESM(require("hls.js"));
|
|
281
|
-
|
|
282
|
-
HlsPlayer =
|
|
499
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
500
|
+
HlsPlayer = import_react35.default.memo(
|
|
283
501
|
({
|
|
284
502
|
sources,
|
|
285
503
|
assetUrl,
|
|
@@ -291,17 +509,18 @@ var init_HlsPlayer = __esm({
|
|
|
291
509
|
playOptions = "autoplay",
|
|
292
510
|
placementCode = ""
|
|
293
511
|
}) => {
|
|
294
|
-
const videoRef = (0,
|
|
295
|
-
const hlsRef = (0,
|
|
296
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
297
|
-
const [isHovered, setIsHovered] = (0,
|
|
298
|
-
const [isMobile, setIsMobile] = (0,
|
|
299
|
-
const [isControlsVisible, setIsControlsVisible] = (0,
|
|
300
|
-
const
|
|
301
|
-
const
|
|
512
|
+
const videoRef = (0, import_react35.useRef)(null);
|
|
513
|
+
const hlsRef = (0, import_react35.useRef)(null);
|
|
514
|
+
const [isPlaying, setIsPlaying] = (0, import_react35.useState)(playOptions === "autoplay");
|
|
515
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
516
|
+
const [isMobile, setIsMobile] = (0, import_react35.useState)(false);
|
|
517
|
+
const [isControlsVisible, setIsControlsVisible] = (0, import_react35.useState)(true);
|
|
518
|
+
const [isPosterVisible, setIsPosterVisible] = (0, import_react35.useState)(true);
|
|
519
|
+
const wasManuallyPausedRef = (0, import_react35.useRef)(false);
|
|
520
|
+
const inactivityTimerRef = (0, import_react35.useRef)(null);
|
|
302
521
|
const INACTIVITY_DELAY = 2500;
|
|
303
522
|
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
304
|
-
(0,
|
|
523
|
+
(0, import_react35.useEffect)(() => {
|
|
305
524
|
const checkMobile = () => {
|
|
306
525
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
307
526
|
const isSmallScreen = window.innerWidth <= 768;
|
|
@@ -314,7 +533,21 @@ var init_HlsPlayer = __esm({
|
|
|
314
533
|
window.addEventListener("resize", checkMobile);
|
|
315
534
|
return () => window.removeEventListener("resize", checkMobile);
|
|
316
535
|
}, []);
|
|
317
|
-
|
|
536
|
+
(0, import_react35.useEffect)(() => {
|
|
537
|
+
const v = videoRef.current;
|
|
538
|
+
if (!v) return;
|
|
539
|
+
const onPlaying = () => setIsPosterVisible(false);
|
|
540
|
+
const onPause = () => {
|
|
541
|
+
if (v.currentTime === 0) setIsPosterVisible(true);
|
|
542
|
+
};
|
|
543
|
+
v.addEventListener("playing", onPlaying);
|
|
544
|
+
v.addEventListener("pause", onPause);
|
|
545
|
+
return () => {
|
|
546
|
+
v.removeEventListener("playing", onPlaying);
|
|
547
|
+
v.removeEventListener("pause", onPause);
|
|
548
|
+
};
|
|
549
|
+
}, []);
|
|
550
|
+
const resetInactivityTimer = (0, import_react35.useCallback)(() => {
|
|
318
551
|
setIsControlsVisible(true);
|
|
319
552
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
320
553
|
if (isPlaying) {
|
|
@@ -324,18 +557,18 @@ var init_HlsPlayer = __esm({
|
|
|
324
557
|
);
|
|
325
558
|
}
|
|
326
559
|
}, [isPlaying]);
|
|
327
|
-
(0,
|
|
560
|
+
(0, import_react35.useEffect)(() => {
|
|
328
561
|
if (!isPlaying) {
|
|
329
562
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
330
563
|
setIsControlsVisible(true);
|
|
331
564
|
}
|
|
332
565
|
}, [isPlaying]);
|
|
333
|
-
(0,
|
|
566
|
+
(0, import_react35.useEffect)(() => {
|
|
334
567
|
return () => {
|
|
335
568
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
336
569
|
};
|
|
337
570
|
}, []);
|
|
338
|
-
(0,
|
|
571
|
+
(0, import_react35.useEffect)(() => {
|
|
339
572
|
const v = videoRef.current;
|
|
340
573
|
if (!v || resolvedSources.length === 0) return;
|
|
341
574
|
if (hlsRef.current) {
|
|
@@ -367,7 +600,7 @@ var init_HlsPlayer = __esm({
|
|
|
367
600
|
v.load();
|
|
368
601
|
}
|
|
369
602
|
}, [JSON.stringify(resolvedSources)]);
|
|
370
|
-
const handlePlayPause = (0,
|
|
603
|
+
const handlePlayPause = (0, import_react35.useCallback)(() => {
|
|
371
604
|
const v = videoRef.current;
|
|
372
605
|
if (!v) return;
|
|
373
606
|
if (v.paused) {
|
|
@@ -379,7 +612,7 @@ var init_HlsPlayer = __esm({
|
|
|
379
612
|
setIsPlaying(false);
|
|
380
613
|
}
|
|
381
614
|
}, []);
|
|
382
|
-
const handleMouseEnter = (0,
|
|
615
|
+
const handleMouseEnter = (0, import_react35.useCallback)(() => {
|
|
383
616
|
if (isMobile) return;
|
|
384
617
|
setIsHovered(true);
|
|
385
618
|
resetInactivityTimer();
|
|
@@ -387,7 +620,7 @@ var init_HlsPlayer = __esm({
|
|
|
387
620
|
videoRef.current.play().then(() => setIsPlaying(true));
|
|
388
621
|
}
|
|
389
622
|
}, [playOptions, isMobile, resetInactivityTimer]);
|
|
390
|
-
const handleMouseLeave = (0,
|
|
623
|
+
const handleMouseLeave = (0, import_react35.useCallback)(() => {
|
|
391
624
|
if (isMobile) return;
|
|
392
625
|
setIsHovered(false);
|
|
393
626
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -398,14 +631,15 @@ var init_HlsPlayer = __esm({
|
|
|
398
631
|
setIsPlaying(false);
|
|
399
632
|
}
|
|
400
633
|
}, [playOptions, isMobile, isPlaying]);
|
|
401
|
-
const handleMouseMove = (0,
|
|
634
|
+
const handleMouseMove = (0, import_react35.useCallback)(() => {
|
|
402
635
|
if (isMobile) return;
|
|
403
636
|
resetInactivityTimer();
|
|
404
637
|
}, [isMobile, resetInactivityTimer]);
|
|
405
638
|
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
406
639
|
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
640
|
+
const isPlayOnHover = playOptions === "playOnHover";
|
|
407
641
|
if (resolvedSources.length === 0) return null;
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
409
643
|
"div",
|
|
410
644
|
{
|
|
411
645
|
className: "relative w-full aspect-video bg-black",
|
|
@@ -413,19 +647,19 @@ var init_HlsPlayer = __esm({
|
|
|
413
647
|
onMouseLeave: handleMouseLeave,
|
|
414
648
|
onMouseMove: handleMouseMove,
|
|
415
649
|
children: [
|
|
416
|
-
/* @__PURE__ */ (0,
|
|
650
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
417
651
|
"video",
|
|
418
652
|
{
|
|
419
653
|
ref: videoRef,
|
|
420
654
|
className: "w-full h-full object-contain",
|
|
421
655
|
poster: fallbackPoster,
|
|
422
656
|
controls: showControls && (isMobile || isPlaying),
|
|
423
|
-
muted: playOptions === "autoplay" ||
|
|
657
|
+
muted: playOptions === "autoplay" || isPlayOnHover,
|
|
424
658
|
autoPlay: playOptions === "autoplay",
|
|
425
659
|
loop,
|
|
426
660
|
playsInline: true,
|
|
427
661
|
onClick: !isMobile ? handlePlayPause : void 0,
|
|
428
|
-
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0,
|
|
662
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
429
663
|
"source",
|
|
430
664
|
{
|
|
431
665
|
src,
|
|
@@ -436,13 +670,17 @@ var init_HlsPlayer = __esm({
|
|
|
436
670
|
))
|
|
437
671
|
}
|
|
438
672
|
),
|
|
439
|
-
!isMobile &&
|
|
673
|
+
!isMobile && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
440
674
|
"picture",
|
|
441
675
|
{
|
|
442
|
-
className:
|
|
676
|
+
className: "absolute inset-0 pointer-events-none",
|
|
677
|
+
style: {
|
|
678
|
+
opacity: isPosterVisible && (!isPlayOnHover || !isHovered) ? 1 : 0,
|
|
679
|
+
transition: "opacity 0.4s ease"
|
|
680
|
+
},
|
|
443
681
|
children: [
|
|
444
|
-
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0,
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
682
|
+
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("source", { media, srcSet: src }, i)),
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
446
684
|
"img",
|
|
447
685
|
{
|
|
448
686
|
src: fallbackPoster,
|
|
@@ -455,7 +693,7 @@ var init_HlsPlayer = __esm({
|
|
|
455
693
|
]
|
|
456
694
|
}
|
|
457
695
|
),
|
|
458
|
-
!isMobile && /* @__PURE__ */ (0,
|
|
696
|
+
!isMobile && !isPlayOnHover && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
459
697
|
"div",
|
|
460
698
|
{
|
|
461
699
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
@@ -463,7 +701,7 @@ var init_HlsPlayer = __esm({
|
|
|
463
701
|
opacity: isControlsVisible ? 1 : 0,
|
|
464
702
|
transition: "opacity 0.3s ease"
|
|
465
703
|
},
|
|
466
|
-
children: /* @__PURE__ */ (0,
|
|
704
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
467
705
|
"button",
|
|
468
706
|
{
|
|
469
707
|
type: "button",
|
|
@@ -502,13 +740,13 @@ var init_HlsPlayer = __esm({
|
|
|
502
740
|
},
|
|
503
741
|
children: isPlaying ? (
|
|
504
742
|
/* Pause — two rounded bars */
|
|
505
|
-
/* @__PURE__ */ (0,
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
/* @__PURE__ */ (0,
|
|
743
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "3.5", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" }),
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "12", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" })
|
|
508
746
|
] })
|
|
509
747
|
) : (
|
|
510
748
|
/* Play — solid triangle, nudged right for optical balance */
|
|
511
|
-
/* @__PURE__ */ (0,
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M5 3.5L17 10L5 16.5V3.5Z", fill: "white" }) })
|
|
512
750
|
)
|
|
513
751
|
}
|
|
514
752
|
)
|
|
@@ -524,251 +762,33 @@ var init_HlsPlayer = __esm({
|
|
|
524
762
|
}
|
|
525
763
|
});
|
|
526
764
|
|
|
527
|
-
// src/clients/CacheManage.tsx
|
|
528
|
-
var import_node_cache, CacheManager;
|
|
529
|
-
var init_CacheManage = __esm({
|
|
530
|
-
"src/clients/CacheManage.tsx"() {
|
|
531
|
-
"use strict";
|
|
532
|
-
import_node_cache = __toESM(require("node-cache"));
|
|
533
|
-
CacheManager = class _CacheManager {
|
|
534
|
-
constructor() {
|
|
535
|
-
this.maxCacheSize = 1e3;
|
|
536
|
-
this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
|
|
537
|
-
}
|
|
538
|
-
static getInstance() {
|
|
539
|
-
if (!_CacheManager.instance) {
|
|
540
|
-
_CacheManager.instance = new _CacheManager();
|
|
541
|
-
}
|
|
542
|
-
return _CacheManager.instance;
|
|
543
|
-
}
|
|
544
|
-
get(key) {
|
|
545
|
-
return null;
|
|
546
|
-
}
|
|
547
|
-
set(key, data, ttl) {
|
|
548
|
-
}
|
|
549
|
-
clear() {
|
|
550
|
-
this.cache.flushAll();
|
|
551
|
-
}
|
|
552
|
-
size() {
|
|
553
|
-
return this.cache.keys().length;
|
|
554
|
-
}
|
|
555
|
-
destroy() {
|
|
556
|
-
this.cache.close();
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
// src/clients/ServiceClient.tsx
|
|
563
|
-
var ServerApiError, ServiceClient, ServiceClient_default;
|
|
564
|
-
var init_ServiceClient = __esm({
|
|
565
|
-
"src/clients/ServiceClient.tsx"() {
|
|
566
|
-
"use strict";
|
|
567
|
-
init_CacheManage();
|
|
568
|
-
ServerApiError = class extends Error {
|
|
569
|
-
constructor(data, status) {
|
|
570
|
-
super(data.message || "---");
|
|
571
|
-
this.status = status;
|
|
572
|
-
this.data = data;
|
|
573
|
-
this.data.isSuccessful = false;
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
ServiceClient = class {
|
|
577
|
-
constructor(apiBaseUrl, session) {
|
|
578
|
-
this.cacheManager = CacheManager.getInstance();
|
|
579
|
-
this.baseUrl = apiBaseUrl;
|
|
580
|
-
this.session = session;
|
|
581
|
-
}
|
|
582
|
-
buildFullPath(path, params) {
|
|
583
|
-
let updatedPath = path;
|
|
584
|
-
if (params) {
|
|
585
|
-
Object.keys(params).forEach((key) => {
|
|
586
|
-
updatedPath = updatedPath.replace(
|
|
587
|
-
`{${key}}`,
|
|
588
|
-
String(params[key])
|
|
589
|
-
);
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
return this.baseUrl + updatedPath;
|
|
593
|
-
}
|
|
594
|
-
getConfig() {
|
|
595
|
-
const config = { headers: {} };
|
|
596
|
-
if (this.session) {
|
|
597
|
-
if (this.session.oAuthToken) {
|
|
598
|
-
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
599
|
-
}
|
|
600
|
-
config.headers["cid"] = this.session.cid || "";
|
|
601
|
-
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
602
|
-
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
603
|
-
}
|
|
604
|
-
return config;
|
|
605
|
-
}
|
|
606
|
-
handleFetchError(error) {
|
|
607
|
-
console.log(error);
|
|
608
|
-
const serverApiError = error;
|
|
609
|
-
if (serverApiError) {
|
|
610
|
-
return serverApiError.data;
|
|
611
|
-
}
|
|
612
|
-
return {
|
|
613
|
-
message: "There is some error. Please try after sometime.",
|
|
614
|
-
isSuccessful: false
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
async fetchJsonWithCache(fullPath, config) {
|
|
618
|
-
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
619
|
-
const cachedData = this.cacheManager.get(cacheKey);
|
|
620
|
-
if (cachedData) {
|
|
621
|
-
return cachedData;
|
|
622
|
-
}
|
|
623
|
-
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
624
|
-
const response = await fetch(fullPath, { headers: config.headers });
|
|
625
|
-
if (!response.ok) {
|
|
626
|
-
const apiErrorData = await response.json();
|
|
627
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
628
|
-
}
|
|
629
|
-
const cacheControl = response.headers.get("Cache-Control");
|
|
630
|
-
let revalidate = null;
|
|
631
|
-
if (cacheControl) {
|
|
632
|
-
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
633
|
-
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
634
|
-
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
635
|
-
revalidate = maxAge * 1e3;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
const data = await response.json();
|
|
639
|
-
data.isSuccessful = true;
|
|
640
|
-
if (revalidate !== null && revalidate > 0) {
|
|
641
|
-
console.log("revalidate............I am caching:" + revalidate);
|
|
642
|
-
this.cacheManager.set(cacheKey, data, revalidate);
|
|
643
|
-
}
|
|
644
|
-
return data;
|
|
645
|
-
}
|
|
646
|
-
// private async refreshToken(): Promise<void> {
|
|
647
|
-
// console.log("*******************calling refresh token***********************");
|
|
648
|
-
// try {
|
|
649
|
-
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
650
|
-
// method: 'POST',
|
|
651
|
-
// headers: {
|
|
652
|
-
// 'Content-Type': 'application/json'
|
|
653
|
-
// },
|
|
654
|
-
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
655
|
-
// });
|
|
656
|
-
// if (!response.ok) {
|
|
657
|
-
// throw new Error("Failed to refresh token");
|
|
658
|
-
// }
|
|
659
|
-
// const responseData = await response.json();
|
|
660
|
-
// this.session.oAuthToken = responseData.result.accessToken;
|
|
661
|
-
// if (typeof window === "undefined") {
|
|
662
|
-
// // Running on the server
|
|
663
|
-
// } else {
|
|
664
|
-
// await fetch("/api/login", {
|
|
665
|
-
// method: "post",
|
|
666
|
-
// headers: {
|
|
667
|
-
// "Content-Type": "application/json",
|
|
668
|
-
// },
|
|
669
|
-
// body: JSON.stringify({ session: this.session }),
|
|
670
|
-
// });
|
|
671
|
-
// }
|
|
672
|
-
// } catch (error: any) {
|
|
673
|
-
// throw new Error("Failed to refresh token");
|
|
674
|
-
// }
|
|
675
|
-
// }
|
|
676
|
-
async handleRequest(request) {
|
|
677
|
-
try {
|
|
678
|
-
return await request();
|
|
679
|
-
} catch (error) {
|
|
680
|
-
throw error;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
async post(path, data) {
|
|
684
|
-
const request = async () => {
|
|
685
|
-
const fullPath = this.baseUrl + path;
|
|
686
|
-
const config = this.getConfig();
|
|
687
|
-
const response = await fetch(fullPath, {
|
|
688
|
-
method: "POST",
|
|
689
|
-
headers: {
|
|
690
|
-
...config.headers,
|
|
691
|
-
"Content-Type": "application/json"
|
|
692
|
-
},
|
|
693
|
-
body: JSON.stringify(data)
|
|
694
|
-
});
|
|
695
|
-
if (!response.ok) {
|
|
696
|
-
const apiErrorData = await response.json();
|
|
697
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
698
|
-
}
|
|
699
|
-
const responseData = await response.json();
|
|
700
|
-
responseData.isSuccessful = true;
|
|
701
|
-
return responseData;
|
|
702
|
-
};
|
|
703
|
-
try {
|
|
704
|
-
return await this.handleRequest(request);
|
|
705
|
-
} catch (error) {
|
|
706
|
-
return this.handleFetchError(error);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
async getSingle(path, params) {
|
|
710
|
-
const request = async () => {
|
|
711
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
712
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
713
|
-
) : void 0;
|
|
714
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
715
|
-
const config = this.getConfig();
|
|
716
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
717
|
-
};
|
|
718
|
-
try {
|
|
719
|
-
return await this.handleRequest(request);
|
|
720
|
-
} catch (error) {
|
|
721
|
-
return this.handleFetchError(error);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
async get(path, params) {
|
|
725
|
-
const request = async () => {
|
|
726
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
727
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
728
|
-
) : void 0;
|
|
729
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
730
|
-
const config = this.getConfig();
|
|
731
|
-
console.log(fullPath);
|
|
732
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
733
|
-
};
|
|
734
|
-
try {
|
|
735
|
-
return await this.handleRequest(request);
|
|
736
|
-
} catch (error) {
|
|
737
|
-
return this.handleFetchError(error);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
};
|
|
741
|
-
ServiceClient_default = ServiceClient;
|
|
742
|
-
}
|
|
743
|
-
});
|
|
744
|
-
|
|
745
765
|
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
746
766
|
var LinkNodeButton_exports = {};
|
|
747
767
|
__export(LinkNodeButton_exports, {
|
|
748
768
|
default: () => LinkNodeButton_default
|
|
749
769
|
});
|
|
750
|
-
var
|
|
770
|
+
var import_react37, import_jsx_runtime47, LinkNodeButton, LinkNodeButton_default;
|
|
751
771
|
var init_LinkNodeButton = __esm({
|
|
752
772
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
753
773
|
"use strict";
|
|
754
774
|
"use client";
|
|
755
|
-
|
|
775
|
+
import_react37 = require("react");
|
|
756
776
|
init_Button();
|
|
757
777
|
init_ServiceClient();
|
|
758
778
|
init_ToastService();
|
|
759
|
-
|
|
779
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
760
780
|
LinkNodeButton = (props) => {
|
|
761
781
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
762
|
-
const [isLoading, setIsLoading] = (0,
|
|
763
|
-
const [error, setError] = (0,
|
|
764
|
-
const extractFieldNames = (0,
|
|
782
|
+
const [isLoading, setIsLoading] = (0, import_react37.useState)(false);
|
|
783
|
+
const [error, setError] = (0, import_react37.useState)(null);
|
|
784
|
+
const extractFieldNames = (0, import_react37.useCallback)((template) => {
|
|
765
785
|
if (!template) return [];
|
|
766
786
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
767
787
|
const matches = Array.from(template.matchAll(regex));
|
|
768
788
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
769
789
|
return fieldNames;
|
|
770
790
|
}, []);
|
|
771
|
-
const replaceTemplateVariables = (0,
|
|
791
|
+
const replaceTemplateVariables = (0, import_react37.useCallback)((template, responseData) => {
|
|
772
792
|
if (!template) return template;
|
|
773
793
|
let result = template;
|
|
774
794
|
const fieldNames = extractFieldNames(template);
|
|
@@ -797,7 +817,7 @@ var init_LinkNodeButton = __esm({
|
|
|
797
817
|
}
|
|
798
818
|
return result;
|
|
799
819
|
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
800
|
-
const getNestedValue3 = (0,
|
|
820
|
+
const getNestedValue3 = (0, import_react37.useCallback)((obj, path) => {
|
|
801
821
|
if (!obj || !path) return void 0;
|
|
802
822
|
if (obj[path] !== void 0) {
|
|
803
823
|
return obj[path];
|
|
@@ -812,7 +832,7 @@ var init_LinkNodeButton = __esm({
|
|
|
812
832
|
}
|
|
813
833
|
return current;
|
|
814
834
|
}, []);
|
|
815
|
-
const onClick = (0,
|
|
835
|
+
const onClick = (0, import_react37.useCallback)(async (e) => {
|
|
816
836
|
if (!node.postUrl) {
|
|
817
837
|
setError("No POST URL configured for this button");
|
|
818
838
|
return;
|
|
@@ -899,11 +919,11 @@ var init_LinkNodeButton = __esm({
|
|
|
899
919
|
return children;
|
|
900
920
|
}
|
|
901
921
|
if (linkText) {
|
|
902
|
-
return /* @__PURE__ */ (0,
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: linkText });
|
|
903
923
|
}
|
|
904
924
|
return node.title || "Button";
|
|
905
925
|
};
|
|
906
|
-
return /* @__PURE__ */ (0,
|
|
926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
907
927
|
Button_default,
|
|
908
928
|
{
|
|
909
929
|
ButtonType: linkType,
|
|
@@ -924,9 +944,9 @@ __export(CopyButton_exports, {
|
|
|
924
944
|
default: () => CopyButton
|
|
925
945
|
});
|
|
926
946
|
function CopyButton({ text }) {
|
|
927
|
-
const [copied, setCopied] = (0,
|
|
928
|
-
const timeoutRef = (0,
|
|
929
|
-
(0,
|
|
947
|
+
const [copied, setCopied] = (0, import_react44.useState)(false);
|
|
948
|
+
const timeoutRef = (0, import_react44.useRef)(null);
|
|
949
|
+
(0, import_react44.useEffect)(() => {
|
|
930
950
|
return () => {
|
|
931
951
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
932
952
|
};
|
|
@@ -941,13 +961,13 @@ function CopyButton({ text }) {
|
|
|
941
961
|
console.error("Failed to copy: ", err);
|
|
942
962
|
}
|
|
943
963
|
};
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
945
965
|
"button",
|
|
946
966
|
{
|
|
947
967
|
onClick: handleCopy,
|
|
948
968
|
className: "flex gap-1 items-center hover:text-white transition",
|
|
949
969
|
children: [
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
951
971
|
"svg",
|
|
952
972
|
{
|
|
953
973
|
width: "16",
|
|
@@ -955,7 +975,7 @@ function CopyButton({ text }) {
|
|
|
955
975
|
viewBox: "0 0 24 24",
|
|
956
976
|
className: "w-4 h-4",
|
|
957
977
|
fill: "currentColor",
|
|
958
|
-
children: /* @__PURE__ */ (0,
|
|
978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
959
979
|
"path",
|
|
960
980
|
{
|
|
961
981
|
fillRule: "evenodd",
|
|
@@ -970,54 +990,54 @@ function CopyButton({ text }) {
|
|
|
970
990
|
}
|
|
971
991
|
);
|
|
972
992
|
}
|
|
973
|
-
var
|
|
993
|
+
var import_react44, import_jsx_runtime57;
|
|
974
994
|
var init_CopyButton = __esm({
|
|
975
995
|
"src/components/CopyButton.tsx"() {
|
|
976
996
|
"use strict";
|
|
977
997
|
"use client";
|
|
978
|
-
|
|
979
|
-
|
|
998
|
+
import_react44 = require("react");
|
|
999
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
980
1000
|
}
|
|
981
1001
|
});
|
|
982
1002
|
|
|
983
1003
|
// src/components/IFrameLoaderView.tsx
|
|
984
|
-
var
|
|
1004
|
+
var import_react48, import_jsx_runtime63, IFrameLoaderView, IFrameLoaderView_default;
|
|
985
1005
|
var init_IFrameLoaderView = __esm({
|
|
986
1006
|
"src/components/IFrameLoaderView.tsx"() {
|
|
987
1007
|
"use strict";
|
|
988
|
-
|
|
989
|
-
|
|
1008
|
+
import_react48 = __toESM(require("react"));
|
|
1009
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
990
1010
|
IFrameLoaderView = (props) => {
|
|
991
|
-
return /* @__PURE__ */ (0,
|
|
992
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
993
|
-
/* @__PURE__ */ (0,
|
|
994
|
-
/* @__PURE__ */ (0,
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react48.default.Fragment, { children: [
|
|
1012
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
1015
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ml-2", children: [
|
|
1016
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
998
1018
|
] })
|
|
999
1019
|
] }),
|
|
1000
|
-
/* @__PURE__ */ (0,
|
|
1001
|
-
/* @__PURE__ */ (0,
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1005
|
-
/* @__PURE__ */ (0,
|
|
1006
|
-
/* @__PURE__ */ (0,
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1024
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1025
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1007
1027
|
] }),
|
|
1008
|
-
/* @__PURE__ */ (0,
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1029
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1030
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1014
1034
|
] }),
|
|
1015
|
-
/* @__PURE__ */ (0,
|
|
1016
|
-
/* @__PURE__ */ (0,
|
|
1017
|
-
/* @__PURE__ */ (0,
|
|
1018
|
-
/* @__PURE__ */ (0,
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1035
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1021
1041
|
] })
|
|
1022
1042
|
] })
|
|
1023
1043
|
] }) }),
|
|
@@ -1033,19 +1053,19 @@ var IframeClient_exports = {};
|
|
|
1033
1053
|
__export(IframeClient_exports, {
|
|
1034
1054
|
default: () => IframeClient_default
|
|
1035
1055
|
});
|
|
1036
|
-
var
|
|
1056
|
+
var import_react49, import_jsx_runtime64, IframeClient, IframeClient_default;
|
|
1037
1057
|
var init_IframeClient = __esm({
|
|
1038
1058
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1039
1059
|
"use strict";
|
|
1040
1060
|
"use client";
|
|
1041
|
-
|
|
1061
|
+
import_react49 = __toESM(require("react"));
|
|
1042
1062
|
init_IFrameLoaderView();
|
|
1043
|
-
|
|
1063
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
1044
1064
|
IframeClient = ({ src }) => {
|
|
1045
|
-
const iframeRef = (0,
|
|
1046
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
1047
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
1048
|
-
(0,
|
|
1065
|
+
const iframeRef = (0, import_react49.useRef)(null);
|
|
1066
|
+
const [iframeHeight, setIframeHeight] = (0, import_react49.useState)("100%");
|
|
1067
|
+
const [isDataFound, setIsDataFound] = (0, import_react49.useState)(null);
|
|
1068
|
+
(0, import_react49.useEffect)(() => {
|
|
1049
1069
|
const handleReceiveMessage = (event) => {
|
|
1050
1070
|
const eventName = event?.data?.eventName;
|
|
1051
1071
|
const payload = event?.data?.payload;
|
|
@@ -1060,7 +1080,7 @@ var init_IframeClient = __esm({
|
|
|
1060
1080
|
window.addEventListener("message", handleReceiveMessage);
|
|
1061
1081
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
1062
1082
|
}, []);
|
|
1063
|
-
(0,
|
|
1083
|
+
(0, import_react49.useEffect)(() => {
|
|
1064
1084
|
const handleResize = () => {
|
|
1065
1085
|
if (iframeRef.current) {
|
|
1066
1086
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -1072,7 +1092,7 @@ var init_IframeClient = __esm({
|
|
|
1072
1092
|
const handleIframeLoad = () => {
|
|
1073
1093
|
setIsDataFound(true);
|
|
1074
1094
|
};
|
|
1075
|
-
return /* @__PURE__ */ (0,
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
1076
1096
|
"iframe",
|
|
1077
1097
|
{
|
|
1078
1098
|
ref: iframeRef,
|
|
@@ -1095,6 +1115,7 @@ __export(index_exports, {
|
|
|
1095
1115
|
CheckboxInput: () => CheckboxInput_default,
|
|
1096
1116
|
ColorInput: () => ColorInput_default,
|
|
1097
1117
|
DataList: () => DataList_default,
|
|
1118
|
+
DataListRenderer: () => DataListRenderer_default,
|
|
1098
1119
|
DateTimeInput: () => DateTimeInput_default,
|
|
1099
1120
|
EmailInput: () => EmailInput_default,
|
|
1100
1121
|
InputControl: () => InputControl_default,
|
|
@@ -1116,13 +1137,14 @@ __export(index_exports, {
|
|
|
1116
1137
|
module.exports = __toCommonJS(index_exports);
|
|
1117
1138
|
|
|
1118
1139
|
// src/components/controls/view/ViewControl.tsx
|
|
1119
|
-
var
|
|
1140
|
+
var import_react10 = __toESM(require("react"));
|
|
1120
1141
|
|
|
1121
1142
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1122
1143
|
var ViewControlTypes = {
|
|
1123
1144
|
lineText: "lineText",
|
|
1124
1145
|
asset: "asset",
|
|
1125
1146
|
multilineTextBullets: "multilineTextBullets",
|
|
1147
|
+
boolean: "boolean",
|
|
1126
1148
|
money: "money",
|
|
1127
1149
|
date: "date",
|
|
1128
1150
|
time: "time",
|
|
@@ -1360,50 +1382,94 @@ var DateView = (props) => {
|
|
|
1360
1382
|
};
|
|
1361
1383
|
var DateView_default = DateView;
|
|
1362
1384
|
|
|
1363
|
-
// src/components/controls/view/
|
|
1385
|
+
// src/components/controls/view/BooleanView.tsx
|
|
1364
1386
|
var import_react3 = __toESM(require("react"));
|
|
1365
1387
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1388
|
+
var BooleanView = (props) => {
|
|
1389
|
+
const { value, customProps } = props;
|
|
1390
|
+
const showOnlyTrueIcon = customProps?.showOnlyTrueIcon;
|
|
1391
|
+
console.log("BooleanView Debug:", {
|
|
1392
|
+
value,
|
|
1393
|
+
type: typeof value,
|
|
1394
|
+
customProps,
|
|
1395
|
+
showOnlyTrueIcon
|
|
1396
|
+
});
|
|
1397
|
+
const booleanValue = import_react3.default.useMemo(() => {
|
|
1398
|
+
if (typeof value === "boolean") return value;
|
|
1399
|
+
if (typeof value === "string") {
|
|
1400
|
+
return value.toLowerCase() === "true";
|
|
1401
|
+
}
|
|
1402
|
+
if (typeof value === "number") {
|
|
1403
|
+
return value === 1;
|
|
1404
|
+
}
|
|
1405
|
+
return false;
|
|
1406
|
+
}, [value]);
|
|
1407
|
+
if (showOnlyTrueIcon) {
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1409
|
+
"svg",
|
|
1410
|
+
{
|
|
1411
|
+
className: "w-15 h-8 text-green-600",
|
|
1412
|
+
fill: "currentColor",
|
|
1413
|
+
viewBox: "0 0 20 20",
|
|
1414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1415
|
+
"path",
|
|
1416
|
+
{
|
|
1417
|
+
fillRule: "evenodd",
|
|
1418
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
1419
|
+
clipRule: "evenodd"
|
|
1420
|
+
}
|
|
1421
|
+
)
|
|
1422
|
+
}
|
|
1423
|
+
) });
|
|
1424
|
+
}
|
|
1425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
1426
|
+
};
|
|
1427
|
+
var BooleanView_default = BooleanView;
|
|
1428
|
+
|
|
1429
|
+
// src/components/controls/view/LineTextView.tsx
|
|
1430
|
+
var import_react4 = __toESM(require("react"));
|
|
1431
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1366
1432
|
var LineText = (props) => {
|
|
1367
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.default.Fragment, { children: props.value });
|
|
1368
1434
|
};
|
|
1369
1435
|
var LineTextView_default = LineText;
|
|
1370
1436
|
|
|
1371
1437
|
// src/components/controls/view/MoneyView.tsx
|
|
1372
|
-
var
|
|
1373
|
-
var
|
|
1438
|
+
var import_react5 = __toESM(require("react"));
|
|
1439
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1374
1440
|
var Money = (props) => {
|
|
1375
1441
|
const parsedNumber = parseFloat(props.value);
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: parsedNumber < 0 ? "text-alert" : "", children: [
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-0.5", children: "\u20B9" }),
|
|
1378
1444
|
parsedNumber.toLocaleString()
|
|
1379
1445
|
] }) });
|
|
1380
1446
|
};
|
|
1381
1447
|
var MoneyView_default = Money;
|
|
1382
1448
|
|
|
1383
1449
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1384
|
-
var
|
|
1385
|
-
var
|
|
1450
|
+
var import_react6 = __toESM(require("react"));
|
|
1451
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1386
1452
|
var MultilineTextBullets = (props) => {
|
|
1387
1453
|
const lines = props.value?.split("\\n");
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: line }, index);
|
|
1390
1456
|
}) }) });
|
|
1391
1457
|
};
|
|
1392
1458
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1393
1459
|
|
|
1394
1460
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1461
|
+
var import_react7 = __toESM(require("react"));
|
|
1462
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1397
1463
|
var MultilineText = (props) => {
|
|
1398
|
-
return /* @__PURE__ */ (0,
|
|
1464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react7.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
1399
1465
|
};
|
|
1400
1466
|
var MultilineTextView_default = MultilineText;
|
|
1401
1467
|
|
|
1402
1468
|
// src/components/controls/view/PercentageView.tsx
|
|
1403
|
-
var
|
|
1404
|
-
var
|
|
1469
|
+
var import_react8 = __toESM(require("react"));
|
|
1470
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1405
1471
|
var PercentageView = (props) => {
|
|
1406
|
-
return /* @__PURE__ */ (0,
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react8.default.Fragment, { children: [
|
|
1407
1473
|
props.value,
|
|
1408
1474
|
"%"
|
|
1409
1475
|
] });
|
|
@@ -1411,16 +1477,16 @@ var PercentageView = (props) => {
|
|
|
1411
1477
|
var PercentageView_default = PercentageView;
|
|
1412
1478
|
|
|
1413
1479
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1414
|
-
var
|
|
1415
|
-
var
|
|
1480
|
+
var import_react9 = __toESM(require("react"));
|
|
1481
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1416
1482
|
var ProgressIndicator = (props) => {
|
|
1417
1483
|
const percentage = 100;
|
|
1418
1484
|
const circumference = Math.PI * 56;
|
|
1419
1485
|
const offset = circumference * (1 - percentage / 100);
|
|
1420
|
-
return /* @__PURE__ */ (0,
|
|
1421
|
-
/* @__PURE__ */ (0,
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1423
|
-
/* @__PURE__ */ (0,
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative w-48 h-48", children: [
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full border border-gray-200" }),
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-full h-full rounded-full border-t-8 border-green-500", style: { transform: `rotate(-90deg)`, clipPath: `inset(0px ${offset}px 0px 0px)` } }) }),
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-lg font-bold text-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
1424
1490
|
percentage,
|
|
1425
1491
|
"%"
|
|
1426
1492
|
] }) })
|
|
@@ -1429,29 +1495,30 @@ var ProgressIndicator = (props) => {
|
|
|
1429
1495
|
var ProgressIndicator_default = ProgressIndicator;
|
|
1430
1496
|
|
|
1431
1497
|
// src/components/controls/view/AiGeneratedSummary.tsx
|
|
1432
|
-
var
|
|
1498
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1433
1499
|
var AiGeneratedSummary = (props) => {
|
|
1434
1500
|
const lines = props.value?.split("\n").filter((line) => line.trim() !== "") || [];
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1439
|
-
/* @__PURE__ */ (0,
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "group rounded-xl border-2 bg-white shadow-sm border-p overflow-hidden", children: [
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { className: "flex items-start justify-between cursor-pointer list-none", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-3 ", children: [
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-primary-base bg-transparent rounded mt-1 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" }) }) }),
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-lg font-semibold ", children: "Quick Read" }),
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm text-gray-500 mb-0", children: "Summary is AI-generated, author-reviewed" })
|
|
1441
1507
|
] })
|
|
1442
1508
|
] }) }),
|
|
1443
|
-
/* @__PURE__ */ (0,
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "list-disc pl-6 space-y-3 text-gray-700", children: lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "m-0", children: line }, index)) }) })
|
|
1444
1510
|
] });
|
|
1445
1511
|
};
|
|
1446
1512
|
var AiGeneratedSummary_default = AiGeneratedSummary;
|
|
1447
1513
|
|
|
1448
1514
|
// src/components/controls/view/ViewControl.tsx
|
|
1449
|
-
var
|
|
1515
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1450
1516
|
var ViewControl = (props) => {
|
|
1451
1517
|
const ControlComponents = {
|
|
1452
1518
|
[ViewControlTypes_default.lineText]: LineTextView_default,
|
|
1453
1519
|
// [ViewControlTypes.asset]: Asset,
|
|
1454
1520
|
[ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
|
|
1521
|
+
[ViewControlTypes_default.boolean]: BooleanView_default,
|
|
1455
1522
|
[ViewControlTypes_default.money]: MoneyView_default,
|
|
1456
1523
|
[ViewControlTypes_default.date]: DateView_default,
|
|
1457
1524
|
[ViewControlTypes_default.time]: DateView_default,
|
|
@@ -1467,16 +1534,16 @@ var ViewControl = (props) => {
|
|
|
1467
1534
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1468
1535
|
};
|
|
1469
1536
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1470
|
-
return /* @__PURE__ */ (0,
|
|
1537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react10.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
1471
1538
|
};
|
|
1472
1539
|
var ViewControl_default = ViewControl;
|
|
1473
1540
|
|
|
1474
1541
|
// src/components/controls/edit/InputControl.tsx
|
|
1475
|
-
var
|
|
1542
|
+
var import_react30 = __toESM(require("react"));
|
|
1476
1543
|
|
|
1477
1544
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1478
|
-
var
|
|
1479
|
-
var
|
|
1545
|
+
var import_react11 = __toESM(require("react"));
|
|
1546
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1480
1547
|
var MultilineTextInput = (props) => {
|
|
1481
1548
|
const textChangeHandler = (event) => {
|
|
1482
1549
|
const text = event.target.value;
|
|
@@ -1495,11 +1562,11 @@ var MultilineTextInput = (props) => {
|
|
|
1495
1562
|
if (props.value !== void 0 && props.value !== null) {
|
|
1496
1563
|
value = props.value;
|
|
1497
1564
|
}
|
|
1498
|
-
return /* @__PURE__ */ (0,
|
|
1499
|
-
/* @__PURE__ */ (0,
|
|
1565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react11.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block mb-1", children: [
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1500
1567
|
" ",
|
|
1501
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1568
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1503
1570
|
"textarea",
|
|
1504
1571
|
{
|
|
1505
1572
|
name: props.name,
|
|
@@ -1516,14 +1583,14 @@ var MultilineTextInput = (props) => {
|
|
|
1516
1583
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
1517
1584
|
}
|
|
1518
1585
|
),
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1520
1587
|
] }) });
|
|
1521
1588
|
};
|
|
1522
1589
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1523
1590
|
|
|
1524
1591
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1525
|
-
var
|
|
1526
|
-
var
|
|
1592
|
+
var import_react12 = __toESM(require("react"));
|
|
1593
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1527
1594
|
var LineTextInput = (props) => {
|
|
1528
1595
|
const textChangeHandler = (event) => {
|
|
1529
1596
|
const text = event.target.value;
|
|
@@ -1542,11 +1609,11 @@ var LineTextInput = (props) => {
|
|
|
1542
1609
|
if (props.value !== void 0 && props.value !== null) {
|
|
1543
1610
|
value = props.value;
|
|
1544
1611
|
}
|
|
1545
|
-
return /* @__PURE__ */ (0,
|
|
1546
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react12.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "block", children: [
|
|
1613
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1547
1614
|
" ",
|
|
1548
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1615
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1550
1617
|
"input",
|
|
1551
1618
|
{
|
|
1552
1619
|
type: "text",
|
|
@@ -1566,14 +1633,14 @@ var LineTextInput = (props) => {
|
|
|
1566
1633
|
`
|
|
1567
1634
|
}
|
|
1568
1635
|
),
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1570
1637
|
] }) });
|
|
1571
1638
|
};
|
|
1572
1639
|
var LineTextInput_default = LineTextInput;
|
|
1573
1640
|
|
|
1574
1641
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1642
|
+
var import_react13 = __toESM(require("react"));
|
|
1643
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1577
1644
|
var MoneyInput = (props) => {
|
|
1578
1645
|
const textChangeHandler = (event) => {
|
|
1579
1646
|
const rawValue = event.target.value;
|
|
@@ -1602,11 +1669,11 @@ var MoneyInput = (props) => {
|
|
|
1602
1669
|
e.preventDefault();
|
|
1603
1670
|
}
|
|
1604
1671
|
};
|
|
1605
|
-
return /* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "block mb-1", children: [
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1607
1674
|
" ",
|
|
1608
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1675
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1610
1677
|
"input",
|
|
1611
1678
|
{
|
|
1612
1679
|
type: "number",
|
|
@@ -1626,7 +1693,7 @@ var MoneyInput = (props) => {
|
|
|
1626
1693
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1627
1694
|
}
|
|
1628
1695
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1630
1697
|
] }) });
|
|
1631
1698
|
};
|
|
1632
1699
|
var MoneyInput_default = MoneyInput;
|
|
@@ -1656,10 +1723,10 @@ var InputControlType = {
|
|
|
1656
1723
|
var InputControlType_default = InputControlType;
|
|
1657
1724
|
|
|
1658
1725
|
// src/components/controls/edit/Select.tsx
|
|
1659
|
-
var
|
|
1660
|
-
var
|
|
1726
|
+
var import_react14 = require("react");
|
|
1727
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1661
1728
|
var Select = (props) => {
|
|
1662
|
-
const [list, setList] = (0,
|
|
1729
|
+
const [list, setList] = (0, import_react14.useState)([]);
|
|
1663
1730
|
const getSafeValue = (val) => {
|
|
1664
1731
|
if (val === null || val === void 0) return "";
|
|
1665
1732
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1688,7 +1755,7 @@ var Select = (props) => {
|
|
|
1688
1755
|
groupKey: props.groupKey
|
|
1689
1756
|
});
|
|
1690
1757
|
};
|
|
1691
|
-
(0,
|
|
1758
|
+
(0, import_react14.useEffect)(() => {
|
|
1692
1759
|
async function fetchData() {
|
|
1693
1760
|
if (props.dataset) {
|
|
1694
1761
|
setList(props.dataset);
|
|
@@ -1715,11 +1782,11 @@ var Select = (props) => {
|
|
|
1715
1782
|
props.dataSourceDependsOn
|
|
1716
1783
|
]);
|
|
1717
1784
|
const value = getSafeValue(props.value);
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
1719
|
-
props.attributes?.label && /* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "block", children: [
|
|
1786
|
+
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
1720
1787
|
" ",
|
|
1721
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0,
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1788
|
+
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1723
1790
|
"select",
|
|
1724
1791
|
{
|
|
1725
1792
|
name: props.name,
|
|
@@ -1730,23 +1797,23 @@ var Select = (props) => {
|
|
|
1730
1797
|
disabled: props.attributes?.readOnly,
|
|
1731
1798
|
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",
|
|
1732
1799
|
children: [
|
|
1733
|
-
/* @__PURE__ */ (0,
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1734
1801
|
list.map((item, index) => {
|
|
1735
1802
|
const keyField = props.dataKeyFieldName;
|
|
1736
1803
|
const textField = props.dataTextFieldName;
|
|
1737
|
-
return /* @__PURE__ */ (0,
|
|
1804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
1738
1805
|
})
|
|
1739
1806
|
]
|
|
1740
1807
|
}
|
|
1741
1808
|
),
|
|
1742
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
|
|
1743
1810
|
] });
|
|
1744
1811
|
};
|
|
1745
1812
|
var Select_default = Select;
|
|
1746
1813
|
|
|
1747
1814
|
// src/components/controls/edit/PercentageInput.tsx
|
|
1748
|
-
var
|
|
1749
|
-
var
|
|
1815
|
+
var import_react15 = __toESM(require("react"));
|
|
1816
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1750
1817
|
var PercentageInput = (props) => {
|
|
1751
1818
|
const textChangeHandler = (event) => {
|
|
1752
1819
|
const rawValue = event.target.value;
|
|
@@ -1775,11 +1842,11 @@ var PercentageInput = (props) => {
|
|
|
1775
1842
|
e.preventDefault();
|
|
1776
1843
|
}
|
|
1777
1844
|
};
|
|
1778
|
-
return /* @__PURE__ */ (0,
|
|
1779
|
-
/* @__PURE__ */ (0,
|
|
1845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react15.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "block mb-1", children: [
|
|
1846
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
1780
1847
|
" ",
|
|
1781
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1848
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1783
1850
|
"input",
|
|
1784
1851
|
{
|
|
1785
1852
|
type: "number",
|
|
@@ -1798,14 +1865,14 @@ var PercentageInput = (props) => {
|
|
|
1798
1865
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1799
1866
|
}
|
|
1800
1867
|
),
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1868
|
+
/* @__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 : "" })
|
|
1802
1869
|
] }) });
|
|
1803
1870
|
};
|
|
1804
1871
|
var PercentageInput_default = PercentageInput;
|
|
1805
1872
|
|
|
1806
1873
|
// src/components/controls/edit/PhoneInput.tsx
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
1874
|
+
var import_react16 = __toESM(require("react"));
|
|
1875
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1809
1876
|
var PhoneInput = (props) => {
|
|
1810
1877
|
const textChangeHandler = (event) => {
|
|
1811
1878
|
const text = event.target.value;
|
|
@@ -1824,13 +1891,13 @@ var PhoneInput = (props) => {
|
|
|
1824
1891
|
if (props.value !== void 0 && props.value !== null) {
|
|
1825
1892
|
value = props.value;
|
|
1826
1893
|
}
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react16.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "block mb-1", children: [
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1829
1896
|
" ",
|
|
1830
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1897
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1898
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center rounded border ", children: [
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "px-3", children: props.prefix }),
|
|
1900
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1834
1901
|
"input",
|
|
1835
1902
|
{
|
|
1836
1903
|
type: "text",
|
|
@@ -1848,14 +1915,14 @@ var PhoneInput = (props) => {
|
|
|
1848
1915
|
}
|
|
1849
1916
|
)
|
|
1850
1917
|
] }),
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
/* @__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 : "" })
|
|
1852
1919
|
] }) });
|
|
1853
1920
|
};
|
|
1854
1921
|
var PhoneInput_default = PhoneInput;
|
|
1855
1922
|
|
|
1856
1923
|
// src/components/controls/edit/NumberInput.tsx
|
|
1857
|
-
var
|
|
1858
|
-
var
|
|
1924
|
+
var import_react17 = __toESM(require("react"));
|
|
1925
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1859
1926
|
var NumberInput = (props) => {
|
|
1860
1927
|
const textChangeHandler = (event) => {
|
|
1861
1928
|
const text = event.target.value;
|
|
@@ -1878,11 +1945,11 @@ var NumberInput = (props) => {
|
|
|
1878
1945
|
if (props.value !== void 0 && props.value !== null) {
|
|
1879
1946
|
value = props.value;
|
|
1880
1947
|
}
|
|
1881
|
-
return /* @__PURE__ */ (0,
|
|
1882
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react17.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "block", children: [
|
|
1949
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1883
1950
|
" ",
|
|
1884
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1885
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1886
1953
|
"input",
|
|
1887
1954
|
{
|
|
1888
1955
|
type: "number",
|
|
@@ -1901,14 +1968,14 @@ var NumberInput = (props) => {
|
|
|
1901
1968
|
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 "
|
|
1902
1969
|
}
|
|
1903
1970
|
),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1971
|
+
/* @__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 : "" })
|
|
1905
1972
|
] }) });
|
|
1906
1973
|
};
|
|
1907
1974
|
var NumberInput_default = NumberInput;
|
|
1908
1975
|
|
|
1909
1976
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
1910
|
-
var
|
|
1911
|
-
var
|
|
1977
|
+
var import_react18 = __toESM(require("react"));
|
|
1978
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1912
1979
|
var CheckboxInput = (props) => {
|
|
1913
1980
|
const textChangeHandler = (event) => {
|
|
1914
1981
|
let text = event.target.checked;
|
|
@@ -1925,11 +1992,11 @@ var CheckboxInput = (props) => {
|
|
|
1925
1992
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
1926
1993
|
value = true;
|
|
1927
1994
|
}
|
|
1928
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "inline-block mb-1", children: [
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
1930
1997
|
" ",
|
|
1931
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1998
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1933
2000
|
"input",
|
|
1934
2001
|
{
|
|
1935
2002
|
type: "checkbox",
|
|
@@ -1946,14 +2013,14 @@ var CheckboxInput = (props) => {
|
|
|
1946
2013
|
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 "
|
|
1947
2014
|
}
|
|
1948
2015
|
),
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1950
2017
|
] }) });
|
|
1951
2018
|
};
|
|
1952
2019
|
var CheckboxInput_default = CheckboxInput;
|
|
1953
2020
|
|
|
1954
2021
|
// src/components/controls/edit/OtpInput.tsx
|
|
1955
|
-
var
|
|
1956
|
-
var
|
|
2022
|
+
var import_react19 = __toESM(require("react"));
|
|
2023
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1957
2024
|
var OtpInput = (props) => {
|
|
1958
2025
|
const textChangeHandler = (event) => {
|
|
1959
2026
|
const text = event.target.value;
|
|
@@ -1975,11 +2042,11 @@ var OtpInput = (props) => {
|
|
|
1975
2042
|
if (props.value !== void 0 && props.value !== null) {
|
|
1976
2043
|
value = props.value;
|
|
1977
2044
|
}
|
|
1978
|
-
return /* @__PURE__ */ (0,
|
|
1979
|
-
/* @__PURE__ */ (0,
|
|
2045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react19.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2046
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1980
2047
|
" ",
|
|
1981
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
2048
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1983
2050
|
"input",
|
|
1984
2051
|
{
|
|
1985
2052
|
type: "text",
|
|
@@ -1999,14 +2066,14 @@ var OtpInput = (props) => {
|
|
|
1999
2066
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
2000
2067
|
}
|
|
2001
2068
|
),
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2069
|
+
/* @__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 : "" })
|
|
2003
2070
|
] }) });
|
|
2004
2071
|
};
|
|
2005
2072
|
var OtpInput_default = OtpInput;
|
|
2006
2073
|
|
|
2007
2074
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2075
|
+
var import_react20 = __toESM(require("react"));
|
|
2076
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2010
2077
|
var DateTimeInput = (props) => {
|
|
2011
2078
|
const textChangeHandler = (event) => {
|
|
2012
2079
|
const localDate = new Date(event.target.value);
|
|
@@ -2038,12 +2105,12 @@ var DateTimeInput = (props) => {
|
|
|
2038
2105
|
e.preventDefault();
|
|
2039
2106
|
}
|
|
2040
2107
|
};
|
|
2041
|
-
return /* @__PURE__ */ (0,
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react20.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "block mb-1", children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2043
2110
|
" ",
|
|
2044
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2111
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2047
2114
|
"input",
|
|
2048
2115
|
{
|
|
2049
2116
|
type: "datetime-local",
|
|
@@ -2061,19 +2128,19 @@ var DateTimeInput = (props) => {
|
|
|
2061
2128
|
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 "
|
|
2062
2129
|
}
|
|
2063
2130
|
),
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: timeZoneAbbr })
|
|
2065
2132
|
] }),
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2133
|
+
/* @__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 : "" })
|
|
2067
2134
|
] }) });
|
|
2068
2135
|
};
|
|
2069
2136
|
var DateTimeInput_default = DateTimeInput;
|
|
2070
2137
|
|
|
2071
2138
|
// src/components/controls/edit/ColorInput.tsx
|
|
2072
|
-
var
|
|
2073
|
-
var
|
|
2139
|
+
var import_react21 = __toESM(require("react"));
|
|
2140
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2074
2141
|
var ColorInput = (props) => {
|
|
2075
|
-
const [color, setColor] =
|
|
2076
|
-
(0,
|
|
2142
|
+
const [color, setColor] = import_react21.default.useState("#3b82f6");
|
|
2143
|
+
(0, import_react21.useEffect)(() => {
|
|
2077
2144
|
if (props.value !== void 0 && props.value !== null) {
|
|
2078
2145
|
if (typeof props.value === "string") {
|
|
2079
2146
|
setColor(props.value);
|
|
@@ -2092,11 +2159,11 @@ var ColorInput = (props) => {
|
|
|
2092
2159
|
});
|
|
2093
2160
|
}
|
|
2094
2161
|
};
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "block mb-1", children: [
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2097
2164
|
" ",
|
|
2098
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2165
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2100
2167
|
"input",
|
|
2101
2168
|
{
|
|
2102
2169
|
type: "color",
|
|
@@ -2109,21 +2176,21 @@ var ColorInput = (props) => {
|
|
|
2109
2176
|
className: `w-[78px] h-12 block cursor-pointer`
|
|
2110
2177
|
}
|
|
2111
2178
|
),
|
|
2112
|
-
props?.attributes?.errorMessage && /* @__PURE__ */ (0,
|
|
2179
|
+
props?.attributes?.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 bg-error-weak text-sm", children: props.attributes.errorMessage })
|
|
2113
2180
|
] });
|
|
2114
2181
|
};
|
|
2115
2182
|
var ColorInput_default = ColorInput;
|
|
2116
2183
|
|
|
2117
2184
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2185
|
+
var import_react22 = require("react");
|
|
2186
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2120
2187
|
var SelectWithSearchInput = (props) => {
|
|
2121
|
-
const [isOpen, setIsOpen] = (0,
|
|
2122
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2123
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2124
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2125
|
-
const [list, setList] = (0,
|
|
2126
|
-
(0,
|
|
2188
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
2189
|
+
const [searchTerm, setSearchTerm] = (0, import_react22.useState)("");
|
|
2190
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react22.useState)(-1);
|
|
2191
|
+
const [selectedItem, setSelectedItem] = (0, import_react22.useState)(null);
|
|
2192
|
+
const [list, setList] = (0, import_react22.useState)([]);
|
|
2193
|
+
(0, import_react22.useEffect)(() => {
|
|
2127
2194
|
async function fetchData() {
|
|
2128
2195
|
if (props.dataset) {
|
|
2129
2196
|
setList(props.dataset);
|
|
@@ -2177,8 +2244,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2177
2244
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2178
2245
|
}
|
|
2179
2246
|
};
|
|
2180
|
-
const dropdownRef = (0,
|
|
2181
|
-
(0,
|
|
2247
|
+
const dropdownRef = (0, import_react22.useRef)(null);
|
|
2248
|
+
(0, import_react22.useEffect)(() => {
|
|
2182
2249
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2183
2250
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2184
2251
|
highlightedItem?.scrollIntoView({
|
|
@@ -2187,15 +2254,15 @@ var SelectWithSearchInput = (props) => {
|
|
|
2187
2254
|
});
|
|
2188
2255
|
}
|
|
2189
2256
|
}, [highlightedIndex]);
|
|
2190
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { children: [
|
|
2192
2259
|
props.attributes?.label,
|
|
2193
2260
|
" ",
|
|
2194
2261
|
" ",
|
|
2195
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2262
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2196
2263
|
] }),
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2265
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2199
2266
|
"input",
|
|
2200
2267
|
{
|
|
2201
2268
|
type: "text",
|
|
@@ -2211,13 +2278,13 @@ var SelectWithSearchInput = (props) => {
|
|
|
2211
2278
|
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 "
|
|
2212
2279
|
}
|
|
2213
2280
|
),
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2215
2282
|
"button",
|
|
2216
2283
|
{
|
|
2217
2284
|
type: "button",
|
|
2218
2285
|
onClick: () => setIsOpen(!isOpen),
|
|
2219
2286
|
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
2220
|
-
children: /* @__PURE__ */ (0,
|
|
2287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2221
2288
|
"svg",
|
|
2222
2289
|
{
|
|
2223
2290
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2226,7 +2293,7 @@ var SelectWithSearchInput = (props) => {
|
|
|
2226
2293
|
strokeWidth: 1.5,
|
|
2227
2294
|
stroke: "currentColor",
|
|
2228
2295
|
className: "w-full h-full",
|
|
2229
|
-
children: /* @__PURE__ */ (0,
|
|
2296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2230
2297
|
"path",
|
|
2231
2298
|
{
|
|
2232
2299
|
strokeLinecap: "round",
|
|
@@ -2239,12 +2306,12 @@ var SelectWithSearchInput = (props) => {
|
|
|
2239
2306
|
}
|
|
2240
2307
|
)
|
|
2241
2308
|
] }),
|
|
2242
|
-
isOpen && /* @__PURE__ */ (0,
|
|
2309
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2243
2310
|
"div",
|
|
2244
2311
|
{
|
|
2245
2312
|
ref: dropdownRef,
|
|
2246
2313
|
className: "absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-48 overflow-y-auto",
|
|
2247
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2314
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2248
2315
|
"button",
|
|
2249
2316
|
{
|
|
2250
2317
|
onClick: (e) => handleSelect(e, item),
|
|
@@ -2252,10 +2319,10 @@ var SelectWithSearchInput = (props) => {
|
|
|
2252
2319
|
role: "option",
|
|
2253
2320
|
tabIndex: -1,
|
|
2254
2321
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2255
|
-
children: /* @__PURE__ */ (0,
|
|
2322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
2256
2323
|
},
|
|
2257
2324
|
item[props.dataKeyFieldName]
|
|
2258
|
-
)) : /* @__PURE__ */ (0,
|
|
2325
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2259
2326
|
}
|
|
2260
2327
|
)
|
|
2261
2328
|
] });
|
|
@@ -2264,22 +2331,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2264
2331
|
|
|
2265
2332
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2266
2333
|
init_Button();
|
|
2267
|
-
var
|
|
2268
|
-
var
|
|
2334
|
+
var import_react26 = __toESM(require("react"));
|
|
2335
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2269
2336
|
var SelectWithSearchPanel = (props) => {
|
|
2270
|
-
const [isOpen, setIsOpen] = (0,
|
|
2271
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2272
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2273
|
-
const [list, setList] = (0,
|
|
2274
|
-
const listRef = (0,
|
|
2275
|
-
const [isError, setIsError] = (0,
|
|
2276
|
-
const containerRef = (0,
|
|
2277
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
2278
|
-
const [formData, setFormData] = (0,
|
|
2337
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
|
|
2338
|
+
const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
|
|
2339
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(0);
|
|
2340
|
+
const [list, setList] = (0, import_react26.useState)([]);
|
|
2341
|
+
const listRef = (0, import_react26.useRef)(null);
|
|
2342
|
+
const [isError, setIsError] = (0, import_react26.useState)(false);
|
|
2343
|
+
const containerRef = (0, import_react26.useRef)(null);
|
|
2344
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react26.useState)(false);
|
|
2345
|
+
const [formData, setFormData] = (0, import_react26.useState)({});
|
|
2279
2346
|
const getNestedValue3 = (obj, path) => {
|
|
2280
2347
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2281
2348
|
};
|
|
2282
|
-
(0,
|
|
2349
|
+
(0, import_react26.useEffect)(() => {
|
|
2283
2350
|
const handleClickOutside = (event) => {
|
|
2284
2351
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2285
2352
|
setIsOpen(false);
|
|
@@ -2290,7 +2357,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2290
2357
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2291
2358
|
};
|
|
2292
2359
|
}, []);
|
|
2293
|
-
(0,
|
|
2360
|
+
(0, import_react26.useEffect)(() => {
|
|
2294
2361
|
async function fetchData() {
|
|
2295
2362
|
if (props.dataset) {
|
|
2296
2363
|
setList(props.dataset);
|
|
@@ -2332,7 +2399,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2332
2399
|
audioCtx.close();
|
|
2333
2400
|
}, 250);
|
|
2334
2401
|
};
|
|
2335
|
-
(0,
|
|
2402
|
+
(0, import_react26.useEffect)(() => {
|
|
2336
2403
|
const filteredItems2 = list?.filter(
|
|
2337
2404
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2338
2405
|
);
|
|
@@ -2397,18 +2464,18 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2397
2464
|
const handleInputChange = (event, field) => {
|
|
2398
2465
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2399
2466
|
};
|
|
2400
|
-
const handleSaveModal = (0,
|
|
2467
|
+
const handleSaveModal = (0, import_react26.useCallback)(async () => {
|
|
2401
2468
|
console.log("Form Data:", formData);
|
|
2402
2469
|
return formData;
|
|
2403
2470
|
}, []);
|
|
2404
|
-
return /* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "text-sm mb-1 font-medium", children: [
|
|
2406
2473
|
props.attributes?.label,
|
|
2407
2474
|
" ",
|
|
2408
2475
|
" ",
|
|
2409
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2476
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2410
2477
|
] }),
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2412
2479
|
"input",
|
|
2413
2480
|
{
|
|
2414
2481
|
type: "text",
|
|
@@ -2422,14 +2489,14 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2422
2489
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2423
2490
|
}
|
|
2424
2491
|
) }),
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2427
|
-
/* @__PURE__ */ (0,
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react26.default.Fragment, { children: [
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
2494
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
2428
2495
|
"Select a",
|
|
2429
2496
|
" ",
|
|
2430
2497
|
props.attributes?.label || props.attributes?.heading
|
|
2431
2498
|
] }) }),
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200 h-10", children: props.createFields && props.createFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2433
2500
|
"button",
|
|
2434
2501
|
{
|
|
2435
2502
|
type: "button",
|
|
@@ -2442,12 +2509,12 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2442
2509
|
}
|
|
2443
2510
|
) })
|
|
2444
2511
|
] }),
|
|
2445
|
-
isCreateOpen && /* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2512
|
+
isCreateOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed right-0 w-1/4 h-full top-[62px] bg-white shadow-lg border-l border-gray-200 z-50", children: [
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md font-medium text-white", children: [
|
|
2447
2514
|
"Create New ",
|
|
2448
2515
|
props.attributes?.label
|
|
2449
2516
|
] }) }),
|
|
2450
|
-
/* @__PURE__ */ (0,
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2451
2518
|
"button",
|
|
2452
2519
|
{
|
|
2453
2520
|
type: "button",
|
|
@@ -2456,10 +2523,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2456
2523
|
children: "Close"
|
|
2457
2524
|
}
|
|
2458
2525
|
) }),
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2460
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0,
|
|
2461
|
-
/* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-4", children: [
|
|
2527
|
+
props.createFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-4", children: [
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2463
2530
|
"input",
|
|
2464
2531
|
{
|
|
2465
2532
|
type: field.type,
|
|
@@ -2475,7 +2542,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2475
2542
|
}
|
|
2476
2543
|
)
|
|
2477
2544
|
] }, field.name)),
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Button_default, { onClick: async () => {
|
|
2479
2546
|
handleSaveModal();
|
|
2480
2547
|
return { isSuccessful: true };
|
|
2481
2548
|
}, className: "w-full", children: [
|
|
@@ -2484,13 +2551,13 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2484
2551
|
] })
|
|
2485
2552
|
] })
|
|
2486
2553
|
] }),
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2488
2555
|
"div",
|
|
2489
2556
|
{
|
|
2490
2557
|
ref: listRef,
|
|
2491
2558
|
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",
|
|
2492
2559
|
style: { height: "calc(100vh - 130px)" },
|
|
2493
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2560
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2494
2561
|
"button",
|
|
2495
2562
|
{
|
|
2496
2563
|
onClick: (e) => {
|
|
@@ -2500,9 +2567,9 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2500
2567
|
role: "option",
|
|
2501
2568
|
tabIndex: -1,
|
|
2502
2569
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2503
|
-
children: /* @__PURE__ */ (0,
|
|
2570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: getNestedValue3(item, props.dataTextFieldName) })
|
|
2504
2571
|
}
|
|
2505
|
-
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0,
|
|
2572
|
+
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2506
2573
|
}
|
|
2507
2574
|
)
|
|
2508
2575
|
] }) })
|
|
@@ -2511,10 +2578,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2511
2578
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2512
2579
|
|
|
2513
2580
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2514
|
-
var
|
|
2515
|
-
var
|
|
2581
|
+
var import_react27 = __toESM(require("react"));
|
|
2582
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2516
2583
|
var BooleanSelect = (props) => {
|
|
2517
|
-
const [list, setList] = (0,
|
|
2584
|
+
const [list, setList] = (0, import_react27.useState)();
|
|
2518
2585
|
const textChangeHandler = (event) => {
|
|
2519
2586
|
const text = event.target.value;
|
|
2520
2587
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2527,7 +2594,7 @@ var BooleanSelect = (props) => {
|
|
|
2527
2594
|
});
|
|
2528
2595
|
}
|
|
2529
2596
|
};
|
|
2530
|
-
(0,
|
|
2597
|
+
(0, import_react27.useEffect)(() => {
|
|
2531
2598
|
async function fetchData() {
|
|
2532
2599
|
console.log("in select");
|
|
2533
2600
|
if (props.dataset) {
|
|
@@ -2561,11 +2628,11 @@ var BooleanSelect = (props) => {
|
|
|
2561
2628
|
if (props.value !== void 0 && props.value !== null) {
|
|
2562
2629
|
value = props.value;
|
|
2563
2630
|
}
|
|
2564
|
-
return /* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react27.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "block", children: [
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2566
2633
|
" ",
|
|
2567
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2569
2636
|
"select",
|
|
2570
2637
|
{
|
|
2571
2638
|
name: props.name,
|
|
@@ -2577,9 +2644,9 @@ var BooleanSelect = (props) => {
|
|
|
2577
2644
|
disabled: props?.attributes?.readOnly,
|
|
2578
2645
|
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 ",
|
|
2579
2646
|
children: [
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2647
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
2581
2648
|
list && list.map((item, i) => {
|
|
2582
|
-
return /* @__PURE__ */ (0,
|
|
2649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2583
2650
|
"option",
|
|
2584
2651
|
{
|
|
2585
2652
|
className: "fac-select-option",
|
|
@@ -2592,14 +2659,14 @@ var BooleanSelect = (props) => {
|
|
|
2592
2659
|
]
|
|
2593
2660
|
}
|
|
2594
2661
|
),
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2662
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2596
2663
|
] }) });
|
|
2597
2664
|
};
|
|
2598
2665
|
var BooleanSelect_default = BooleanSelect;
|
|
2599
2666
|
|
|
2600
2667
|
// src/components/controls/edit/EmailInput.tsx
|
|
2601
|
-
var
|
|
2602
|
-
var
|
|
2668
|
+
var import_react28 = __toESM(require("react"));
|
|
2669
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2603
2670
|
var EmailInput = (props) => {
|
|
2604
2671
|
const textChangeHandler = (event) => {
|
|
2605
2672
|
const text = event.target.value;
|
|
@@ -2624,11 +2691,11 @@ var EmailInput = (props) => {
|
|
|
2624
2691
|
if (props.value !== void 0 && props.value !== null) {
|
|
2625
2692
|
value = props.value;
|
|
2626
2693
|
}
|
|
2627
|
-
return /* @__PURE__ */ (0,
|
|
2628
|
-
/* @__PURE__ */ (0,
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react28.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "block mb-1", children: [
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
2629
2696
|
" ",
|
|
2630
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2697
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2632
2699
|
"input",
|
|
2633
2700
|
{
|
|
2634
2701
|
type: "email",
|
|
@@ -2644,14 +2711,14 @@ var EmailInput = (props) => {
|
|
|
2644
2711
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
2645
2712
|
}
|
|
2646
2713
|
),
|
|
2647
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 mb-0 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2648
2715
|
] }) });
|
|
2649
2716
|
};
|
|
2650
2717
|
var EmailInput_default = EmailInput;
|
|
2651
2718
|
|
|
2652
2719
|
// src/components/controls/edit/TimeInput.tsx
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2720
|
+
var import_react29 = __toESM(require("react"));
|
|
2721
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2655
2722
|
var TimeInput = (props) => {
|
|
2656
2723
|
const timeChangeHandler = (event) => {
|
|
2657
2724
|
const timeValue = event.target.value;
|
|
@@ -2664,11 +2731,11 @@ var TimeInput = (props) => {
|
|
|
2664
2731
|
});
|
|
2665
2732
|
}
|
|
2666
2733
|
};
|
|
2667
|
-
return /* @__PURE__ */ (0,
|
|
2668
|
-
/* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "block mb-1", children: [
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2669
2736
|
" ",
|
|
2670
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2737
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2672
2739
|
"input",
|
|
2673
2740
|
{
|
|
2674
2741
|
type: "time",
|
|
@@ -2681,14 +2748,14 @@ var TimeInput = (props) => {
|
|
|
2681
2748
|
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"
|
|
2682
2749
|
}
|
|
2683
2750
|
) }),
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
2685
2752
|
] }) });
|
|
2686
2753
|
};
|
|
2687
2754
|
var TimeInput_default = TimeInput;
|
|
2688
2755
|
|
|
2689
2756
|
// src/components/controls/edit/InputControl.tsx
|
|
2690
|
-
var
|
|
2691
|
-
var InputControl =
|
|
2757
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2758
|
+
var InputControl = import_react30.default.forwardRef(
|
|
2692
2759
|
(props, ref) => {
|
|
2693
2760
|
const ControlComponents = {
|
|
2694
2761
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -2709,58 +2776,58 @@ var InputControl = import_react29.default.forwardRef(
|
|
|
2709
2776
|
[InputControlType_default.timeInput]: TimeInput_default
|
|
2710
2777
|
};
|
|
2711
2778
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react30.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
2713
2780
|
}
|
|
2714
2781
|
);
|
|
2715
2782
|
InputControl.displayName = "InputControl";
|
|
2716
2783
|
var InputControl_default = InputControl;
|
|
2717
2784
|
|
|
2718
2785
|
// src/components/dataForm/DataList.tsx
|
|
2719
|
-
var
|
|
2786
|
+
var import_react33 = __toESM(require("react"));
|
|
2720
2787
|
var import_navigation = require("next/navigation");
|
|
2721
2788
|
|
|
2722
2789
|
// src/components/dataForm/NoContentView.tsx
|
|
2723
|
-
var
|
|
2724
|
-
var
|
|
2790
|
+
var import_react31 = __toESM(require("react"));
|
|
2791
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2725
2792
|
var NoContentView = (props) => {
|
|
2726
|
-
return /* @__PURE__ */ (0,
|
|
2793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react31.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
2727
2794
|
};
|
|
2728
2795
|
var NoContentView_default = NoContentView;
|
|
2729
2796
|
|
|
2730
2797
|
// src/components/dataForm/ContentView.tsx
|
|
2731
|
-
var
|
|
2732
|
-
var
|
|
2798
|
+
var import_react32 = __toESM(require("react"));
|
|
2799
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2733
2800
|
var ContentView = (props) => {
|
|
2734
|
-
return /* @__PURE__ */ (0,
|
|
2735
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
2736
|
-
/* @__PURE__ */ (0,
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2738
|
-
/* @__PURE__ */ (0,
|
|
2739
|
-
/* @__PURE__ */ (0,
|
|
2740
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react32.default.Fragment, { children: [
|
|
2802
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ml-2", children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
2741
2808
|
] })
|
|
2742
2809
|
] }),
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2745
|
-
/* @__PURE__ */ (0,
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
2749
|
-
/* @__PURE__ */ (0,
|
|
2810
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2750
2817
|
] }),
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2752
|
-
/* @__PURE__ */ (0,
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2755
|
-
/* @__PURE__ */ (0,
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2757
2824
|
] }),
|
|
2758
|
-
/* @__PURE__ */ (0,
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2760
|
-
/* @__PURE__ */ (0,
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
2762
|
-
/* @__PURE__ */ (0,
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2764
2831
|
] })
|
|
2765
2832
|
] })
|
|
2766
2833
|
] }) }),
|
|
@@ -2772,7 +2839,7 @@ var ContentView_default = ContentView;
|
|
|
2772
2839
|
// src/components/dataForm/Hyperlink.tsx
|
|
2773
2840
|
var import_link = __toESM(require("next/link"));
|
|
2774
2841
|
init_StyleTypes();
|
|
2775
|
-
var
|
|
2842
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2776
2843
|
function Hyperlink(props) {
|
|
2777
2844
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : "";
|
|
2778
2845
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -2780,7 +2847,7 @@ function Hyperlink(props) {
|
|
|
2780
2847
|
if (target == "_blank") {
|
|
2781
2848
|
additionalProps.rel = "noopener noreferrer";
|
|
2782
2849
|
}
|
|
2783
|
-
return /* @__PURE__ */ (0,
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: props.href ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2784
2851
|
import_link.default,
|
|
2785
2852
|
{
|
|
2786
2853
|
href: props.href,
|
|
@@ -2790,7 +2857,7 @@ function Hyperlink(props) {
|
|
|
2790
2857
|
target,
|
|
2791
2858
|
children: props.children
|
|
2792
2859
|
}
|
|
2793
|
-
) : props.isHeading ? /* @__PURE__ */ (0,
|
|
2860
|
+
) : props.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: props.className, children: props.children }) });
|
|
2794
2861
|
}
|
|
2795
2862
|
|
|
2796
2863
|
// src/components/dataForm/DataList.tsx
|
|
@@ -2951,30 +3018,30 @@ var OdataBuilder = class {
|
|
|
2951
3018
|
};
|
|
2952
3019
|
|
|
2953
3020
|
// src/svg/chevron-updown.tsx
|
|
2954
|
-
var
|
|
3021
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2955
3022
|
var ChevronUpDown = (props) => {
|
|
2956
|
-
return /* @__PURE__ */ (0,
|
|
3023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) });
|
|
2957
3024
|
};
|
|
2958
3025
|
var chevron_updown_default = ChevronUpDown;
|
|
2959
3026
|
|
|
2960
3027
|
// src/svg/chevron-down.tsx
|
|
2961
|
-
var
|
|
3028
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2962
3029
|
var ChevronDown = (props) => {
|
|
2963
|
-
return /* @__PURE__ */ (0,
|
|
3030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) });
|
|
2964
3031
|
};
|
|
2965
3032
|
var chevron_down_default = ChevronDown;
|
|
2966
3033
|
|
|
2967
3034
|
// src/svg/chevron-up.tsx
|
|
2968
|
-
var
|
|
3035
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2969
3036
|
var ChevronUp = (props) => {
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
3037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) });
|
|
2971
3038
|
};
|
|
2972
3039
|
var chevron_up_default = ChevronUp;
|
|
2973
3040
|
|
|
2974
3041
|
// src/svg/plus.tsx
|
|
2975
|
-
var
|
|
3042
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2976
3043
|
var Plus = (props) => {
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
3044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) });
|
|
2978
3045
|
};
|
|
2979
3046
|
var plus_default = Plus;
|
|
2980
3047
|
|
|
@@ -2988,14 +3055,14 @@ var Icons = {
|
|
|
2988
3055
|
var Icons_default = Icons;
|
|
2989
3056
|
|
|
2990
3057
|
// src/svg/Icon.tsx
|
|
2991
|
-
var
|
|
3058
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2992
3059
|
var Icon = ({ name, className, ...props }) => {
|
|
2993
3060
|
const IconComponent = Icons_default[name];
|
|
2994
3061
|
if (!IconComponent) {
|
|
2995
3062
|
console.error(`Icon "${name}" not found.`);
|
|
2996
3063
|
return null;
|
|
2997
3064
|
}
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconComponent, { ...props, className });
|
|
2999
3066
|
};
|
|
3000
3067
|
var Icon_default = Icon;
|
|
3001
3068
|
|
|
@@ -3044,7 +3111,7 @@ function FormReducer(state, action) {
|
|
|
3044
3111
|
var FormReducer_default = FormReducer;
|
|
3045
3112
|
|
|
3046
3113
|
// src/components/dataForm/DataList.tsx
|
|
3047
|
-
var
|
|
3114
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3048
3115
|
var DataList = (props) => {
|
|
3049
3116
|
console.log(props.dataset, "datasetssssss");
|
|
3050
3117
|
const router = (0, import_navigation.useRouter)();
|
|
@@ -3053,8 +3120,8 @@ var DataList = (props) => {
|
|
|
3053
3120
|
let activePageNumber = 0;
|
|
3054
3121
|
let pages = 0;
|
|
3055
3122
|
console.log(props.addLinkText);
|
|
3056
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3057
|
-
(0,
|
|
3123
|
+
const [isDataFound, setIsDataFound] = (0, import_react33.useState)(null);
|
|
3124
|
+
(0, import_react33.useEffect)(() => {
|
|
3058
3125
|
if (props?.dataset) {
|
|
3059
3126
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
3060
3127
|
setIsDataFound(true);
|
|
@@ -3067,7 +3134,7 @@ var DataList = (props) => {
|
|
|
3067
3134
|
if (path.includes(".")) {
|
|
3068
3135
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
3069
3136
|
} else if (Array.isArray(obj[path])) {
|
|
3070
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
3137
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: item }, index));
|
|
3071
3138
|
} else {
|
|
3072
3139
|
return obj[path];
|
|
3073
3140
|
}
|
|
@@ -3076,8 +3143,8 @@ var DataList = (props) => {
|
|
|
3076
3143
|
inputValues: {},
|
|
3077
3144
|
lastPropertyChanged: ""
|
|
3078
3145
|
};
|
|
3079
|
-
const [formState, dispatch] = (0,
|
|
3080
|
-
const handleFilterChange = (0,
|
|
3146
|
+
const [formState, dispatch] = (0, import_react33.useReducer)(FormReducer_default, initialState);
|
|
3147
|
+
const handleFilterChange = (0, import_react33.useCallback)(
|
|
3081
3148
|
(updatedValues) => {
|
|
3082
3149
|
dispatch({
|
|
3083
3150
|
type: FORM_INPUT_UPDATE,
|
|
@@ -3123,30 +3190,30 @@ var DataList = (props) => {
|
|
|
3123
3190
|
const renderPageNumbers = () => {
|
|
3124
3191
|
if (pages <= 10) {
|
|
3125
3192
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
3126
|
-
(page) => /* @__PURE__ */ (0,
|
|
3193
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3127
3194
|
Hyperlink,
|
|
3128
3195
|
{
|
|
3129
3196
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3130
3197
|
href: builder.getNewPageUrl(page),
|
|
3131
3198
|
children: page
|
|
3132
3199
|
}
|
|
3133
|
-
) : /* @__PURE__ */ (0,
|
|
3200
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3134
3201
|
);
|
|
3135
3202
|
} else {
|
|
3136
3203
|
const showFirstPages = activePageNumber <= 5;
|
|
3137
3204
|
const showLastPages = activePageNumber > pages - 5;
|
|
3138
3205
|
if (showFirstPages) {
|
|
3139
|
-
return /* @__PURE__ */ (0,
|
|
3140
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
3206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3207
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3141
3208
|
Hyperlink,
|
|
3142
3209
|
{
|
|
3143
3210
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3144
3211
|
href: builder.getNewPageUrl(page),
|
|
3145
3212
|
children: page
|
|
3146
3213
|
}
|
|
3147
|
-
) : /* @__PURE__ */ (0,
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3214
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3150
3217
|
Hyperlink,
|
|
3151
3218
|
{
|
|
3152
3219
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3154,7 +3221,7 @@ var DataList = (props) => {
|
|
|
3154
3221
|
children: pages - 1
|
|
3155
3222
|
}
|
|
3156
3223
|
),
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3158
3225
|
Hyperlink,
|
|
3159
3226
|
{
|
|
3160
3227
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3162,7 +3229,7 @@ var DataList = (props) => {
|
|
|
3162
3229
|
children: pages
|
|
3163
3230
|
}
|
|
3164
3231
|
),
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3166
3233
|
"select",
|
|
3167
3234
|
{
|
|
3168
3235
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3174,18 +3241,18 @@ var DataList = (props) => {
|
|
|
3174
3241
|
}
|
|
3175
3242
|
},
|
|
3176
3243
|
children: [
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
3178
3245
|
Array.from(
|
|
3179
3246
|
{ length: Math.max(0, pages - 10) },
|
|
3180
3247
|
(_, index) => index + 9
|
|
3181
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3248
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3182
3249
|
]
|
|
3183
3250
|
}
|
|
3184
3251
|
) })
|
|
3185
3252
|
] });
|
|
3186
3253
|
} else if (showLastPages) {
|
|
3187
|
-
return /* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3255
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3189
3256
|
Hyperlink,
|
|
3190
3257
|
{
|
|
3191
3258
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3193,7 +3260,7 @@ var DataList = (props) => {
|
|
|
3193
3260
|
children: "1"
|
|
3194
3261
|
}
|
|
3195
3262
|
),
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3263
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3197
3264
|
Hyperlink,
|
|
3198
3265
|
{
|
|
3199
3266
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3201,21 +3268,21 @@ var DataList = (props) => {
|
|
|
3201
3268
|
children: "2"
|
|
3202
3269
|
}
|
|
3203
3270
|
),
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3205
3272
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
3206
|
-
(page) => /* @__PURE__ */ (0,
|
|
3273
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3207
3274
|
Hyperlink,
|
|
3208
3275
|
{
|
|
3209
3276
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3210
3277
|
href: builder.getNewPageUrl(page),
|
|
3211
3278
|
children: page
|
|
3212
3279
|
}
|
|
3213
|
-
) : /* @__PURE__ */ (0,
|
|
3280
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3214
3281
|
)
|
|
3215
3282
|
] });
|
|
3216
3283
|
} else {
|
|
3217
|
-
return /* @__PURE__ */ (0,
|
|
3218
|
-
/* @__PURE__ */ (0,
|
|
3284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3219
3286
|
Hyperlink,
|
|
3220
3287
|
{
|
|
3221
3288
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3223,7 +3290,7 @@ var DataList = (props) => {
|
|
|
3223
3290
|
children: "1"
|
|
3224
3291
|
}
|
|
3225
3292
|
),
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3227
3294
|
Hyperlink,
|
|
3228
3295
|
{
|
|
3229
3296
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3231,20 +3298,20 @@ var DataList = (props) => {
|
|
|
3231
3298
|
children: "2"
|
|
3232
3299
|
}
|
|
3233
3300
|
),
|
|
3234
|
-
/* @__PURE__ */ (0,
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3235
3302
|
Array.from(
|
|
3236
3303
|
{ length: 5 },
|
|
3237
3304
|
(_, index) => activePageNumber - 2 + index
|
|
3238
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3305
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3239
3306
|
Hyperlink,
|
|
3240
3307
|
{
|
|
3241
3308
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3242
3309
|
href: builder.getNewPageUrl(page),
|
|
3243
3310
|
children: page
|
|
3244
3311
|
}
|
|
3245
|
-
) : /* @__PURE__ */ (0,
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3312
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3248
3315
|
Hyperlink,
|
|
3249
3316
|
{
|
|
3250
3317
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3252,7 +3319,7 @@ var DataList = (props) => {
|
|
|
3252
3319
|
children: pages - 1
|
|
3253
3320
|
}
|
|
3254
3321
|
),
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3256
3323
|
Hyperlink,
|
|
3257
3324
|
{
|
|
3258
3325
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3260,7 +3327,7 @@ var DataList = (props) => {
|
|
|
3260
3327
|
children: pages
|
|
3261
3328
|
}
|
|
3262
3329
|
),
|
|
3263
|
-
/* @__PURE__ */ (0,
|
|
3330
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3264
3331
|
"select",
|
|
3265
3332
|
{
|
|
3266
3333
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3272,8 +3339,8 @@ var DataList = (props) => {
|
|
|
3272
3339
|
}
|
|
3273
3340
|
},
|
|
3274
3341
|
children: [
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3276
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: "", children: "Jump to" }),
|
|
3343
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3277
3344
|
]
|
|
3278
3345
|
}
|
|
3279
3346
|
) })
|
|
@@ -3281,16 +3348,16 @@ var DataList = (props) => {
|
|
|
3281
3348
|
}
|
|
3282
3349
|
}
|
|
3283
3350
|
};
|
|
3284
|
-
return /* @__PURE__ */ (0,
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3286
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react33.default.Fragment, { children: [
|
|
3352
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ContentView_default, { isDataFound, children: [
|
|
3353
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3287
3354
|
"div",
|
|
3288
3355
|
{
|
|
3289
3356
|
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`,
|
|
3290
3357
|
children: [
|
|
3291
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3293
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3358
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3359
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3360
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3294
3361
|
InputControl_default,
|
|
3295
3362
|
{
|
|
3296
3363
|
name: filter.name,
|
|
@@ -3305,15 +3372,15 @@ var DataList = (props) => {
|
|
|
3305
3372
|
},
|
|
3306
3373
|
filter.name
|
|
3307
3374
|
)),
|
|
3308
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3375
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3309
3376
|
Hyperlink,
|
|
3310
3377
|
{
|
|
3311
3378
|
className: "gap-1",
|
|
3312
3379
|
linkType: "Primary" /* Solid */,
|
|
3313
3380
|
href: props.addLinkHref,
|
|
3314
3381
|
children: [
|
|
3315
|
-
/* @__PURE__ */ (0,
|
|
3316
|
-
/* @__PURE__ */ (0,
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3317
3384
|
]
|
|
3318
3385
|
}
|
|
3319
3386
|
)
|
|
@@ -3321,8 +3388,8 @@ var DataList = (props) => {
|
|
|
3321
3388
|
]
|
|
3322
3389
|
}
|
|
3323
3390
|
),
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3391
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
3392
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3326
3393
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3327
3394
|
let icon = "chevronUpDown";
|
|
3328
3395
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3332,36 +3399,36 @@ var DataList = (props) => {
|
|
|
3332
3399
|
icon = "chevronUp";
|
|
3333
3400
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3334
3401
|
}
|
|
3335
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3336
3403
|
"th",
|
|
3337
3404
|
{
|
|
3338
3405
|
className: "px-6 py-3 text-left font-medium cursor-pointer bg-neutral-soft " + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
3339
|
-
children: /* @__PURE__ */ (0,
|
|
3340
|
-
/* @__PURE__ */ (0,
|
|
3341
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
3406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "!text-neutral-contrast ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3407
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-black", children: column.label }),
|
|
3408
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3342
3409
|
] }) })
|
|
3343
3410
|
},
|
|
3344
3411
|
column.name
|
|
3345
3412
|
);
|
|
3346
3413
|
}) }) }),
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
3348
3415
|
let validityClass = "";
|
|
3349
3416
|
console.log("dataitem", dataitem);
|
|
3350
3417
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
3351
3418
|
validityClass = "bg-alert-200";
|
|
3352
3419
|
}
|
|
3353
|
-
return /* @__PURE__ */ (0,
|
|
3420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
3354
3421
|
console.log("column", column);
|
|
3355
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3356
3423
|
"td",
|
|
3357
3424
|
{
|
|
3358
3425
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
3359
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
3426
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3360
3427
|
Hyperlink,
|
|
3361
3428
|
{
|
|
3362
3429
|
className: "",
|
|
3363
3430
|
href: `https://${dataitem[column.name]}`,
|
|
3364
|
-
children: /* @__PURE__ */ (0,
|
|
3431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3365
3432
|
ViewControl_default,
|
|
3366
3433
|
{
|
|
3367
3434
|
controlType: column.controlType,
|
|
@@ -3374,11 +3441,11 @@ var DataList = (props) => {
|
|
|
3374
3441
|
}
|
|
3375
3442
|
)
|
|
3376
3443
|
}
|
|
3377
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
3444
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3378
3445
|
Hyperlink,
|
|
3379
3446
|
{
|
|
3380
3447
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
3381
|
-
children: /* @__PURE__ */ (0,
|
|
3448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3382
3449
|
ViewControl_default,
|
|
3383
3450
|
{
|
|
3384
3451
|
controlType: column.controlType,
|
|
@@ -3388,7 +3455,7 @@ var DataList = (props) => {
|
|
|
3388
3455
|
}
|
|
3389
3456
|
)
|
|
3390
3457
|
}
|
|
3391
|
-
) : /* @__PURE__ */ (0,
|
|
3458
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3392
3459
|
ViewControl_default,
|
|
3393
3460
|
{
|
|
3394
3461
|
controlType: column.controlType,
|
|
@@ -3402,10 +3469,10 @@ var DataList = (props) => {
|
|
|
3402
3469
|
}) }, index);
|
|
3403
3470
|
}) })
|
|
3404
3471
|
] }) }),
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3406
|
-
/* @__PURE__ */ (0,
|
|
3407
|
-
/* @__PURE__ */ (0,
|
|
3408
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-gray-700", children: label }),
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
3475
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3409
3476
|
Hyperlink,
|
|
3410
3477
|
{
|
|
3411
3478
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3413,9 +3480,9 @@ var DataList = (props) => {
|
|
|
3413
3480
|
children: "Prev"
|
|
3414
3481
|
}
|
|
3415
3482
|
),
|
|
3416
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
3483
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-l-md border border-gray-300 bg-gray-200 text-gray-500 hover:bg-gray-200", children: "Prev" }),
|
|
3417
3484
|
renderPageNumbers(),
|
|
3418
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
3485
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3419
3486
|
Hyperlink,
|
|
3420
3487
|
{
|
|
3421
3488
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3423,19 +3490,19 @@ var DataList = (props) => {
|
|
|
3423
3490
|
children: "Next"
|
|
3424
3491
|
}
|
|
3425
3492
|
),
|
|
3426
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
3493
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
3427
3494
|
] })
|
|
3428
3495
|
] }) })
|
|
3429
3496
|
] }),
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3431
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
3498
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3432
3499
|
"div",
|
|
3433
3500
|
{
|
|
3434
3501
|
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`,
|
|
3435
3502
|
children: [
|
|
3436
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3437
|
-
/* @__PURE__ */ (0,
|
|
3438
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3503
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3504
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3505
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3439
3506
|
InputControl_default,
|
|
3440
3507
|
{
|
|
3441
3508
|
name: filter.name,
|
|
@@ -3450,15 +3517,15 @@ var DataList = (props) => {
|
|
|
3450
3517
|
},
|
|
3451
3518
|
filter.name
|
|
3452
3519
|
)),
|
|
3453
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3520
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3454
3521
|
Hyperlink,
|
|
3455
3522
|
{
|
|
3456
3523
|
className: "gap-1",
|
|
3457
3524
|
linkType: "Primary" /* Solid */,
|
|
3458
3525
|
href: props.addLinkHref,
|
|
3459
3526
|
children: [
|
|
3460
|
-
/* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3528
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3462
3529
|
]
|
|
3463
3530
|
}
|
|
3464
3531
|
)
|
|
@@ -3466,8 +3533,8 @@ var DataList = (props) => {
|
|
|
3466
3533
|
]
|
|
3467
3534
|
}
|
|
3468
3535
|
),
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3470
|
-
/* @__PURE__ */ (0,
|
|
3536
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
3537
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3471
3538
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3472
3539
|
let icon = "chevronUpDown";
|
|
3473
3540
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3477,33 +3544,142 @@ var DataList = (props) => {
|
|
|
3477
3544
|
icon = "chevronUp";
|
|
3478
3545
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3479
3546
|
}
|
|
3480
|
-
return /* @__PURE__ */ (0,
|
|
3547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3481
3548
|
"th",
|
|
3482
3549
|
{
|
|
3483
3550
|
className: "px-6 py-3 text-left font-medium cursor-pointer bg-neutral-soft " + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
3484
|
-
children: /* @__PURE__ */ (0,
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3486
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
3551
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "text-body-950", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: column.label }),
|
|
3553
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3487
3554
|
] }) })
|
|
3488
3555
|
},
|
|
3489
3556
|
column.name
|
|
3490
3557
|
);
|
|
3491
3558
|
}) }) }) }) }),
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3559
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
3493
3560
|
] })
|
|
3494
3561
|
] })
|
|
3495
3562
|
] });
|
|
3496
3563
|
};
|
|
3497
3564
|
var DataList_default = DataList;
|
|
3498
3565
|
|
|
3566
|
+
// src/components/dataForm/DataListRenderer.tsx
|
|
3567
|
+
var import_react34 = __toESM(require("react"));
|
|
3568
|
+
init_ServiceClient();
|
|
3569
|
+
var import_navigation2 = require("next/navigation");
|
|
3570
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3571
|
+
var viewControlMap = {
|
|
3572
|
+
number: ViewControlTypes.number,
|
|
3573
|
+
lineText: ViewControlTypes.lineText,
|
|
3574
|
+
multilineText: ViewControlTypes.multilineText,
|
|
3575
|
+
date: ViewControlTypes.date,
|
|
3576
|
+
boolean: ViewControlTypes.boolean
|
|
3577
|
+
};
|
|
3578
|
+
function resolveRoutePlaceholders(route, params) {
|
|
3579
|
+
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
3580
|
+
const value = params[key];
|
|
3581
|
+
if (value === void 0 || value === null) {
|
|
3582
|
+
console.warn(`No value found for route param: ${key}`);
|
|
3583
|
+
return "";
|
|
3584
|
+
}
|
|
3585
|
+
return value;
|
|
3586
|
+
});
|
|
3587
|
+
}
|
|
3588
|
+
function mapApiToColumns(siteForm) {
|
|
3589
|
+
const cols = siteForm?.siteFormDataList?.siteFormDataListColumns ?? [];
|
|
3590
|
+
return cols.map((col) => ({
|
|
3591
|
+
label: col.label,
|
|
3592
|
+
name: col.columnName,
|
|
3593
|
+
controlType: viewControlMap[col.controlTypeCode] ?? ViewControlTypes.lineText,
|
|
3594
|
+
enableSorting: col.enableSorting ?? false,
|
|
3595
|
+
width: "w-2/12",
|
|
3596
|
+
showAsLink: col.showAsLink ?? false,
|
|
3597
|
+
linkUrlSegment: col.linkUrlSegment ?? void 0,
|
|
3598
|
+
emptyValueLabel: col.emptyValueLabel ?? void 0
|
|
3599
|
+
}));
|
|
3600
|
+
}
|
|
3601
|
+
function mapApiToFilters(siteForm) {
|
|
3602
|
+
const filter = siteForm?.siteFormDataList?.siteFormDataListFilters ?? [];
|
|
3603
|
+
return filter.map((fil) => ({
|
|
3604
|
+
placeholder: fil.placeholder,
|
|
3605
|
+
name: fil.columnName,
|
|
3606
|
+
servicePath: fil.serviceRoute,
|
|
3607
|
+
dataTextFieldName: fil.dataTextFieldName,
|
|
3608
|
+
controlType: SelectWithSearchInput_default,
|
|
3609
|
+
dataKeyFieldName: fil.dataKeyFieldName,
|
|
3610
|
+
dataTypeCode: fil.isKeyNumber ? "number" : "string"
|
|
3611
|
+
}));
|
|
3612
|
+
}
|
|
3613
|
+
var DataListRenderer = ({
|
|
3614
|
+
formDefinition,
|
|
3615
|
+
apiBaseUrl,
|
|
3616
|
+
session,
|
|
3617
|
+
params,
|
|
3618
|
+
query,
|
|
3619
|
+
path,
|
|
3620
|
+
widgetProps
|
|
3621
|
+
}) => {
|
|
3622
|
+
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
3623
|
+
const [columns, setColumns] = (0, import_react34.useState)([]);
|
|
3624
|
+
const [dataset, setDataset] = (0, import_react34.useState)();
|
|
3625
|
+
const [filter, setFilters] = (0, import_react34.useState)([]);
|
|
3626
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react34.useState)("");
|
|
3627
|
+
const [addLinkText, setAddLinkText] = (0, import_react34.useState)("");
|
|
3628
|
+
const [serviceRoute, setServiceRoute] = (0, import_react34.useState)("");
|
|
3629
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
3630
|
+
(0, import_react34.useEffect)(() => {
|
|
3631
|
+
if (!formDefinition) return;
|
|
3632
|
+
setColumns(mapApiToColumns(formDefinition));
|
|
3633
|
+
setFilters(mapApiToFilters(formDefinition));
|
|
3634
|
+
setServiceRoute(formDefinition?.siteFormDataList?.serviceRoute ?? "/");
|
|
3635
|
+
const rawAddLinkHref = formDefinition?.siteFormDataList?.addLinkHref ?? "";
|
|
3636
|
+
const resolvedAddLinkHref = resolveRoutePlaceholders(
|
|
3637
|
+
rawAddLinkHref,
|
|
3638
|
+
params
|
|
3639
|
+
);
|
|
3640
|
+
setAddLinkHref(resolvedAddLinkHref);
|
|
3641
|
+
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
3642
|
+
}, [formDefinition, params]);
|
|
3643
|
+
(0, import_react34.useEffect)(() => {
|
|
3644
|
+
const fetchData = async () => {
|
|
3645
|
+
if (!serviceRoute) return;
|
|
3646
|
+
let resolvedRoute = resolveRoutePlaceholders(serviceRoute, params);
|
|
3647
|
+
const queryString = OdataBuilder.getOdataQueryString(query);
|
|
3648
|
+
const separator = resolvedRoute.includes("?") ? "&" : "?";
|
|
3649
|
+
const finalUrl = resolvedRoute + (queryString ? separator + queryString : "");
|
|
3650
|
+
const result = await serviceClient.get(finalUrl);
|
|
3651
|
+
setDataset(result);
|
|
3652
|
+
};
|
|
3653
|
+
fetchData();
|
|
3654
|
+
}, [serviceRoute, query, params]);
|
|
3655
|
+
const [tabItem, setTabItem] = (0, import_react34.useState)();
|
|
3656
|
+
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
3657
|
+
const activeHref = activeTab ? resolveRoutePlaceholders(activeTab.landingPageUrl, params) : pathname;
|
|
3658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3659
|
+
DataList_default,
|
|
3660
|
+
{
|
|
3661
|
+
addLinkHref,
|
|
3662
|
+
addLinkText,
|
|
3663
|
+
title: (formDefinition?.formTitle || "") + "-V2",
|
|
3664
|
+
path,
|
|
3665
|
+
columns,
|
|
3666
|
+
dataset,
|
|
3667
|
+
filters: filter,
|
|
3668
|
+
serviceClient,
|
|
3669
|
+
query
|
|
3670
|
+
}
|
|
3671
|
+
) });
|
|
3672
|
+
};
|
|
3673
|
+
var DataListRenderer_default = DataListRenderer;
|
|
3674
|
+
|
|
3499
3675
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3500
|
-
var
|
|
3676
|
+
var import_react53 = __toESM(require("react"));
|
|
3501
3677
|
|
|
3502
3678
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3503
|
-
var
|
|
3679
|
+
var import_react39 = __toESM(require("react"));
|
|
3504
3680
|
|
|
3505
3681
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3506
|
-
var
|
|
3682
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3507
3683
|
var TextNode = (props) => {
|
|
3508
3684
|
function cssStringToJson(cssString) {
|
|
3509
3685
|
const styleObject = {};
|
|
@@ -3561,32 +3737,32 @@ var TextNode = (props) => {
|
|
|
3561
3737
|
});
|
|
3562
3738
|
}
|
|
3563
3739
|
function renderWithLineBreaks(text) {
|
|
3564
|
-
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0,
|
|
3740
|
+
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
3565
3741
|
line,
|
|
3566
|
-
index < arr.length - 1 && /* @__PURE__ */ (0,
|
|
3742
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("br", {})
|
|
3567
3743
|
] }, index));
|
|
3568
3744
|
}
|
|
3569
3745
|
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
3570
3746
|
const finalText = props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text;
|
|
3571
3747
|
return (
|
|
3572
3748
|
// @ts-expect-error custom code
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3749
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: typeof finalText === "string" ? renderWithLineBreaks(finalText) : finalText })
|
|
3574
3750
|
);
|
|
3575
3751
|
};
|
|
3576
3752
|
var TextNode_default = TextNode;
|
|
3577
3753
|
|
|
3578
3754
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
3579
|
-
var
|
|
3755
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3580
3756
|
var LineBreakNode = () => {
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
3582
3758
|
};
|
|
3583
3759
|
var LineBreakNode_default = LineBreakNode;
|
|
3584
3760
|
|
|
3585
3761
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3586
|
-
var
|
|
3762
|
+
var import_react38 = __toESM(require("react"));
|
|
3587
3763
|
|
|
3588
3764
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3589
|
-
var
|
|
3765
|
+
var import_react36 = __toESM(require("react"));
|
|
3590
3766
|
|
|
3591
3767
|
// src/components/utilities/AssetUtility.tsx
|
|
3592
3768
|
var AssetUtility = class {
|
|
@@ -3614,7 +3790,7 @@ var import_dynamic = __toESM(require("next/dynamic"));
|
|
|
3614
3790
|
|
|
3615
3791
|
// src/components/DeviceAssetSelector.tsx
|
|
3616
3792
|
init_HlsPlayer();
|
|
3617
|
-
var
|
|
3793
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3618
3794
|
var DeviceAssetSelector = ({
|
|
3619
3795
|
assets,
|
|
3620
3796
|
assetBaseUrl,
|
|
@@ -3689,7 +3865,7 @@ var DeviceAssetSelector = ({
|
|
|
3689
3865
|
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3690
3866
|
const renderMedia = () => {
|
|
3691
3867
|
if (isHls) {
|
|
3692
|
-
return /* @__PURE__ */ (0,
|
|
3868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3693
3869
|
HlsPlayer_default,
|
|
3694
3870
|
{
|
|
3695
3871
|
assetUrl: resolvedAssetUrl,
|
|
@@ -3706,7 +3882,7 @@ var DeviceAssetSelector = ({
|
|
|
3706
3882
|
} else {
|
|
3707
3883
|
return (
|
|
3708
3884
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3710
3886
|
"img",
|
|
3711
3887
|
{
|
|
3712
3888
|
style: styles,
|
|
@@ -3722,17 +3898,17 @@ var DeviceAssetSelector = ({
|
|
|
3722
3898
|
}
|
|
3723
3899
|
};
|
|
3724
3900
|
if (width) {
|
|
3725
|
-
return /* @__PURE__ */ (0,
|
|
3901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3726
3902
|
}
|
|
3727
3903
|
if (nodeProps?.format) {
|
|
3728
|
-
return /* @__PURE__ */ (0,
|
|
3904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3729
3905
|
}
|
|
3730
3906
|
return renderMedia();
|
|
3731
3907
|
};
|
|
3732
3908
|
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3733
3909
|
|
|
3734
3910
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3735
|
-
var
|
|
3911
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3736
3912
|
var HlsPlayer2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3737
3913
|
ssr: false
|
|
3738
3914
|
});
|
|
@@ -3775,7 +3951,7 @@ var ImageNode = (props) => {
|
|
|
3775
3951
|
console.error("Error parsing assets in ImageNode:", error);
|
|
3776
3952
|
}
|
|
3777
3953
|
if (assets && assets.length > 0) {
|
|
3778
|
-
return /* @__PURE__ */ (0,
|
|
3954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3779
3955
|
DeviceAssetSelector_default,
|
|
3780
3956
|
{
|
|
3781
3957
|
device: props.device,
|
|
@@ -3824,7 +4000,7 @@ var ImageNode = (props) => {
|
|
|
3824
4000
|
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3825
4001
|
const renderMedia = () => {
|
|
3826
4002
|
if (isHls) {
|
|
3827
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3828
4004
|
HlsPlayer2,
|
|
3829
4005
|
{
|
|
3830
4006
|
assetUrl: imageUrl,
|
|
@@ -3839,7 +4015,7 @@ var ImageNode = (props) => {
|
|
|
3839
4015
|
}
|
|
3840
4016
|
);
|
|
3841
4017
|
} else {
|
|
3842
|
-
return /* @__PURE__ */ (0,
|
|
4018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react36.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3843
4019
|
"img",
|
|
3844
4020
|
{
|
|
3845
4021
|
style: styles,
|
|
@@ -3854,7 +4030,7 @@ var ImageNode = (props) => {
|
|
|
3854
4030
|
}
|
|
3855
4031
|
};
|
|
3856
4032
|
if (props.node.width) {
|
|
3857
|
-
return /* @__PURE__ */ (0,
|
|
4033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3858
4034
|
}
|
|
3859
4035
|
return renderMedia();
|
|
3860
4036
|
};
|
|
@@ -3863,7 +4039,7 @@ var ImageNode_default = ImageNode;
|
|
|
3863
4039
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3864
4040
|
init_StyleTypes();
|
|
3865
4041
|
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3866
|
-
var
|
|
4042
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3867
4043
|
var LinkNodeButton2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3868
4044
|
ssr: false
|
|
3869
4045
|
});
|
|
@@ -3910,13 +4086,13 @@ var LinkNode = (props) => {
|
|
|
3910
4086
|
const isButton = node.isButton === true;
|
|
3911
4087
|
const renderChildren = () => {
|
|
3912
4088
|
if (!node.children || node.children.length === 0) return null;
|
|
3913
|
-
return /* @__PURE__ */ (0,
|
|
4089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: node.children.map((childNode, index) => {
|
|
3914
4090
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3915
4091
|
if (!SelectedNode) {
|
|
3916
4092
|
console.warn("Unknown node type:", childNode.type);
|
|
3917
4093
|
return null;
|
|
3918
4094
|
}
|
|
3919
|
-
return /* @__PURE__ */ (0,
|
|
4095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react38.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3920
4096
|
SelectedNode,
|
|
3921
4097
|
{
|
|
3922
4098
|
node: childNode,
|
|
@@ -3929,15 +4105,15 @@ var LinkNode = (props) => {
|
|
|
3929
4105
|
};
|
|
3930
4106
|
const renderFallback = () => {
|
|
3931
4107
|
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3932
|
-
return /* @__PURE__ */ (0,
|
|
4108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: linkText });
|
|
3933
4109
|
}
|
|
3934
4110
|
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3935
|
-
return /* @__PURE__ */ (0,
|
|
4111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("br", {});
|
|
3936
4112
|
}
|
|
3937
4113
|
return null;
|
|
3938
4114
|
};
|
|
3939
4115
|
if (isButton) {
|
|
3940
|
-
return /* @__PURE__ */ (0,
|
|
4116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3941
4117
|
LinkNodeButton2,
|
|
3942
4118
|
{
|
|
3943
4119
|
node,
|
|
@@ -3955,7 +4131,7 @@ var LinkNode = (props) => {
|
|
|
3955
4131
|
}
|
|
3956
4132
|
);
|
|
3957
4133
|
}
|
|
3958
|
-
return /* @__PURE__ */ (0,
|
|
4134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3959
4135
|
Hyperlink,
|
|
3960
4136
|
{
|
|
3961
4137
|
href: linkUrl || "#",
|
|
@@ -3971,10 +4147,10 @@ var LinkNode = (props) => {
|
|
|
3971
4147
|
var LinkNode_default = LinkNode;
|
|
3972
4148
|
|
|
3973
4149
|
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3974
|
-
var
|
|
4150
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3975
4151
|
var SVGIconNode = ({ node }) => {
|
|
3976
4152
|
if (!node?.svgCode) return null;
|
|
3977
|
-
return /* @__PURE__ */ (0,
|
|
4153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3978
4154
|
"span",
|
|
3979
4155
|
{
|
|
3980
4156
|
style: {
|
|
@@ -3991,7 +4167,7 @@ var SVGIconNode_default = SVGIconNode;
|
|
|
3991
4167
|
|
|
3992
4168
|
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3993
4169
|
var import_katex = __toESM(require("katex"));
|
|
3994
|
-
var
|
|
4170
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3995
4171
|
var EquationNode = ({ node }) => {
|
|
3996
4172
|
const { equation, inline } = node;
|
|
3997
4173
|
let html = "";
|
|
@@ -4006,7 +4182,7 @@ var EquationNode = ({ node }) => {
|
|
|
4006
4182
|
});
|
|
4007
4183
|
}
|
|
4008
4184
|
if (inline) {
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4010
4186
|
"span",
|
|
4011
4187
|
{
|
|
4012
4188
|
className: "katex-inline",
|
|
@@ -4014,7 +4190,7 @@ var EquationNode = ({ node }) => {
|
|
|
4014
4190
|
}
|
|
4015
4191
|
);
|
|
4016
4192
|
}
|
|
4017
|
-
return /* @__PURE__ */ (0,
|
|
4193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4018
4194
|
"div",
|
|
4019
4195
|
{
|
|
4020
4196
|
className: "katex-block my-3 text-center",
|
|
@@ -4025,7 +4201,7 @@ var EquationNode = ({ node }) => {
|
|
|
4025
4201
|
var EquationNode_default = EquationNode;
|
|
4026
4202
|
|
|
4027
4203
|
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
4028
|
-
var
|
|
4204
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4029
4205
|
function getNestedProperty(obj, path) {
|
|
4030
4206
|
if (!obj || !path) return null;
|
|
4031
4207
|
if (path.includes(".")) {
|
|
@@ -4038,7 +4214,7 @@ function getNestedProperty(obj, path) {
|
|
|
4038
4214
|
}
|
|
4039
4215
|
const value = obj[path];
|
|
4040
4216
|
if (Array.isArray(value)) {
|
|
4041
|
-
return value.map((item, index) => /* @__PURE__ */ (0,
|
|
4217
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: String(item) }, index));
|
|
4042
4218
|
}
|
|
4043
4219
|
return value;
|
|
4044
4220
|
}
|
|
@@ -4099,7 +4275,7 @@ var DatafieldNode = (props) => {
|
|
|
4099
4275
|
const dataType = props.node.dataType;
|
|
4100
4276
|
if (isEmptyValue) return null;
|
|
4101
4277
|
if (dataType === "rawContent") {
|
|
4102
|
-
return /* @__PURE__ */ (0,
|
|
4278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4103
4279
|
PageBodyRenderer_default,
|
|
4104
4280
|
{
|
|
4105
4281
|
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
@@ -4115,12 +4291,12 @@ var DatafieldNode = (props) => {
|
|
|
4115
4291
|
}
|
|
4116
4292
|
);
|
|
4117
4293
|
}
|
|
4118
|
-
return /* @__PURE__ */ (0,
|
|
4294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4119
4295
|
"span",
|
|
4120
4296
|
{
|
|
4121
4297
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
4122
4298
|
style: styles,
|
|
4123
|
-
children: /* @__PURE__ */ (0,
|
|
4299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4124
4300
|
ViewControl_default,
|
|
4125
4301
|
{
|
|
4126
4302
|
controlType: dataType,
|
|
@@ -4133,7 +4309,7 @@ var DatafieldNode = (props) => {
|
|
|
4133
4309
|
var DatafieldNode_default = DatafieldNode;
|
|
4134
4310
|
|
|
4135
4311
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4136
|
-
var
|
|
4312
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4137
4313
|
var ParagraphNode = (props) => {
|
|
4138
4314
|
const NodeTypes2 = {
|
|
4139
4315
|
["text"]: TextNode_default,
|
|
@@ -4153,9 +4329,9 @@ var ParagraphNode = (props) => {
|
|
|
4153
4329
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
4154
4330
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
4155
4331
|
if (isInlineOnlyParent) {
|
|
4156
|
-
return /* @__PURE__ */ (0,
|
|
4332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
4157
4333
|
const SelectedNode = NodeTypes2[node.type];
|
|
4158
|
-
return /* @__PURE__ */ (0,
|
|
4334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4159
4335
|
SelectedNode,
|
|
4160
4336
|
{
|
|
4161
4337
|
node,
|
|
@@ -4167,10 +4343,10 @@ var ParagraphNode = (props) => {
|
|
|
4167
4343
|
) }, index);
|
|
4168
4344
|
}) });
|
|
4169
4345
|
}
|
|
4170
|
-
return /* @__PURE__ */ (0,
|
|
4346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: " " + formatClasses, children: [
|
|
4171
4347
|
hasChildren && props.node.children.map((node, index) => {
|
|
4172
4348
|
const SelectedNode = NodeTypes2[node.type];
|
|
4173
|
-
return /* @__PURE__ */ (0,
|
|
4349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4174
4350
|
SelectedNode,
|
|
4175
4351
|
{
|
|
4176
4352
|
node,
|
|
@@ -4181,14 +4357,14 @@ var ParagraphNode = (props) => {
|
|
|
4181
4357
|
}
|
|
4182
4358
|
) }, index);
|
|
4183
4359
|
}),
|
|
4184
|
-
!hasChildren && /* @__PURE__ */ (0,
|
|
4360
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
4185
4361
|
] });
|
|
4186
4362
|
};
|
|
4187
4363
|
var ParagraphNode_default = ParagraphNode;
|
|
4188
4364
|
|
|
4189
4365
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
4190
|
-
var
|
|
4191
|
-
var
|
|
4366
|
+
var import_react40 = __toESM(require("react"));
|
|
4367
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4192
4368
|
var HeadingNode = (props) => {
|
|
4193
4369
|
const NodeTypes2 = {
|
|
4194
4370
|
["text"]: TextNode_default,
|
|
@@ -4204,23 +4380,23 @@ var HeadingNode = (props) => {
|
|
|
4204
4380
|
{
|
|
4205
4381
|
}
|
|
4206
4382
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
4207
|
-
return /* @__PURE__ */ (0,
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: import_react40.default.createElement(
|
|
4208
4384
|
HeadingTag,
|
|
4209
4385
|
{ className: formatClasses },
|
|
4210
4386
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
4211
4387
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4213
4389
|
})
|
|
4214
4390
|
) });
|
|
4215
4391
|
};
|
|
4216
4392
|
var HeadingNode_default = HeadingNode;
|
|
4217
4393
|
|
|
4218
4394
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4219
|
-
var
|
|
4395
|
+
var import_react42 = __toESM(require("react"));
|
|
4220
4396
|
|
|
4221
4397
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
4222
|
-
var
|
|
4223
|
-
var
|
|
4398
|
+
var import_react41 = __toESM(require("react"));
|
|
4399
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4224
4400
|
var ListItemNode = (props) => {
|
|
4225
4401
|
const NodeTypes2 = {
|
|
4226
4402
|
text: TextNode_default,
|
|
@@ -4237,66 +4413,66 @@ var ListItemNode = (props) => {
|
|
|
4237
4413
|
liStyle.fontSize = match[1].trim();
|
|
4238
4414
|
}
|
|
4239
4415
|
}
|
|
4240
|
-
return /* @__PURE__ */ (0,
|
|
4416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
4241
4417
|
const SelectedNode = NodeTypes2[node.type];
|
|
4242
4418
|
if (node.type === "linebreak") {
|
|
4243
4419
|
if (!foundFirstBreak) {
|
|
4244
4420
|
foundFirstBreak = true;
|
|
4245
|
-
return /* @__PURE__ */ (0,
|
|
4421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", {}, index);
|
|
4246
4422
|
} else {
|
|
4247
|
-
return /* @__PURE__ */ (0,
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
4248
4424
|
}
|
|
4249
4425
|
} else {
|
|
4250
4426
|
foundFirstBreak = false;
|
|
4251
|
-
return /* @__PURE__ */ (0,
|
|
4427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4252
4428
|
}
|
|
4253
4429
|
}) });
|
|
4254
4430
|
};
|
|
4255
4431
|
var ListItemNode_default = ListItemNode;
|
|
4256
4432
|
|
|
4257
4433
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4258
|
-
var
|
|
4434
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4259
4435
|
var ListNode = (props) => {
|
|
4260
4436
|
const NodeTypes2 = {
|
|
4261
4437
|
listitem: ListItemNode_default
|
|
4262
4438
|
};
|
|
4263
|
-
return /* @__PURE__ */ (0,
|
|
4264
|
-
props.node.listType == "bullet" && /* @__PURE__ */ (0,
|
|
4439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react42.default.Fragment, { children: [
|
|
4440
|
+
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4265
4441
|
const SelectedNode = NodeTypes2[node.type];
|
|
4266
|
-
return /* @__PURE__ */ (0,
|
|
4442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4267
4443
|
}) }),
|
|
4268
|
-
props.node.listType == "number" && /* @__PURE__ */ (0,
|
|
4444
|
+
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4269
4445
|
const SelectedNode = NodeTypes2[node.type];
|
|
4270
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4271
4447
|
}) })
|
|
4272
4448
|
] });
|
|
4273
4449
|
};
|
|
4274
4450
|
var ListNode_default = ListNode;
|
|
4275
4451
|
|
|
4276
4452
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4277
|
-
var
|
|
4278
|
-
var
|
|
4453
|
+
var import_react43 = __toESM(require("react"));
|
|
4454
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4279
4455
|
var QuoteNode = (props) => {
|
|
4280
4456
|
const NodeTypes2 = {
|
|
4281
4457
|
["text"]: TextNode_default,
|
|
4282
4458
|
["linebreak"]: LineBreakNode_default,
|
|
4283
4459
|
["link"]: LinkNode_default
|
|
4284
4460
|
};
|
|
4285
|
-
return /* @__PURE__ */ (0,
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4286
4462
|
const SelectedNode = NodeTypes2[node.type];
|
|
4287
|
-
return /* @__PURE__ */ (0,
|
|
4463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4288
4464
|
}) });
|
|
4289
4465
|
};
|
|
4290
4466
|
var QuoteNode_default = QuoteNode;
|
|
4291
4467
|
|
|
4292
4468
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4293
|
-
var
|
|
4469
|
+
var import_react45 = __toESM(require("react"));
|
|
4294
4470
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
4295
|
-
var
|
|
4471
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4296
4472
|
var CopyButton2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4297
4473
|
ssr: false,
|
|
4298
4474
|
// optional: fallback UI while loading
|
|
4299
|
-
loading: () => /* @__PURE__ */ (0,
|
|
4475
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4300
4476
|
});
|
|
4301
4477
|
var CodeNode = (props) => {
|
|
4302
4478
|
const NodeTypes2 = {
|
|
@@ -4310,14 +4486,14 @@ var CodeNode = (props) => {
|
|
|
4310
4486
|
if (node.type === "link") return node.text || node.url || "";
|
|
4311
4487
|
return "";
|
|
4312
4488
|
}).join("") ?? "";
|
|
4313
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4316
|
-
/* @__PURE__ */ (0,
|
|
4489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: "Code Snippet" }),
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CopyButton2, { text: textContent })
|
|
4317
4493
|
] }),
|
|
4318
|
-
/* @__PURE__ */ (0,
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
4319
4495
|
const SelectedNode = NodeTypes2[node.type];
|
|
4320
|
-
return /* @__PURE__ */ (0,
|
|
4496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react45.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4321
4497
|
SelectedNode,
|
|
4322
4498
|
{
|
|
4323
4499
|
node,
|
|
@@ -4332,15 +4508,15 @@ var CodeNode = (props) => {
|
|
|
4332
4508
|
var CodeNode_default = CodeNode;
|
|
4333
4509
|
|
|
4334
4510
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
4335
|
-
var
|
|
4511
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4336
4512
|
var HorizontalRuleNode = () => {
|
|
4337
|
-
return /* @__PURE__ */ (0,
|
|
4513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("hr", {});
|
|
4338
4514
|
};
|
|
4339
4515
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4340
4516
|
|
|
4341
4517
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4342
|
-
var
|
|
4343
|
-
var
|
|
4518
|
+
var import_react46 = __toESM(require("react"));
|
|
4519
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4344
4520
|
var WidgetNode = (props) => {
|
|
4345
4521
|
const getWidgetParameters = () => {
|
|
4346
4522
|
const widgetInputParameters = {
|
|
@@ -4397,7 +4573,7 @@ var WidgetNode = (props) => {
|
|
|
4397
4573
|
};
|
|
4398
4574
|
const widgetCode = props.node?.widgetCode;
|
|
4399
4575
|
if (!widgetCode) {
|
|
4400
|
-
return /* @__PURE__ */ (0,
|
|
4576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: "Invalid widget" });
|
|
4401
4577
|
}
|
|
4402
4578
|
const widgetParams = getWidgetParameters();
|
|
4403
4579
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -4406,7 +4582,7 @@ var WidgetNode = (props) => {
|
|
|
4406
4582
|
}
|
|
4407
4583
|
return (
|
|
4408
4584
|
// eslint-disable-next-line react-hooks/static-components
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4410
4586
|
WidgetRenderer,
|
|
4411
4587
|
{
|
|
4412
4588
|
params: widgetParams,
|
|
@@ -4423,12 +4599,12 @@ var WidgetNode = (props) => {
|
|
|
4423
4599
|
var WidgetNode_default = WidgetNode;
|
|
4424
4600
|
|
|
4425
4601
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4426
|
-
var
|
|
4602
|
+
var import_react47 = __toESM(require("react"));
|
|
4427
4603
|
|
|
4428
4604
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4429
|
-
var
|
|
4605
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4430
4606
|
var InputControlNode = (props) => {
|
|
4431
|
-
return /* @__PURE__ */ (0,
|
|
4607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4432
4608
|
InputControl_default,
|
|
4433
4609
|
{
|
|
4434
4610
|
name: props.node.name,
|
|
@@ -4458,22 +4634,22 @@ var InputControlNode_default = InputControlNode;
|
|
|
4458
4634
|
|
|
4459
4635
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4460
4636
|
init_ServiceClient();
|
|
4461
|
-
var
|
|
4637
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4462
4638
|
var FormContainerNode = (props) => {
|
|
4463
4639
|
const NodeTypes2 = {
|
|
4464
4640
|
["input-control"]: InputControlNode_default
|
|
4465
4641
|
};
|
|
4466
4642
|
const { node } = props;
|
|
4467
|
-
const formRef = (0,
|
|
4643
|
+
const formRef = (0, import_react47.useRef)(null);
|
|
4468
4644
|
const initialState = {
|
|
4469
4645
|
inputValues: {},
|
|
4470
4646
|
lastPropertyChanged: ""
|
|
4471
4647
|
};
|
|
4472
|
-
const [formState, dispatch] = (0,
|
|
4473
|
-
const handleInputChange = (0,
|
|
4648
|
+
const [formState, dispatch] = (0, import_react47.useReducer)(FormReducer_default, initialState);
|
|
4649
|
+
const handleInputChange = (0, import_react47.useCallback)((updatedValues) => {
|
|
4474
4650
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4475
4651
|
}, [dispatch]);
|
|
4476
|
-
(0,
|
|
4652
|
+
(0, import_react47.useEffect)(() => {
|
|
4477
4653
|
const fetchInitialData = async () => {
|
|
4478
4654
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4479
4655
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4488,12 +4664,12 @@ var FormContainerNode = (props) => {
|
|
|
4488
4664
|
};
|
|
4489
4665
|
fetchInitialData();
|
|
4490
4666
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4491
|
-
return /* @__PURE__ */ (0,
|
|
4667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
4492
4668
|
node.children && node.children.map((node2, index) => {
|
|
4493
4669
|
{
|
|
4494
4670
|
}
|
|
4495
4671
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react47.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4497
4673
|
InputControlNode_default,
|
|
4498
4674
|
{
|
|
4499
4675
|
value: formState.inputValues[node2.name],
|
|
@@ -4502,17 +4678,17 @@ var FormContainerNode = (props) => {
|
|
|
4502
4678
|
}
|
|
4503
4679
|
) }, index);
|
|
4504
4680
|
}),
|
|
4505
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
4681
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
4506
4682
|
] });
|
|
4507
4683
|
};
|
|
4508
4684
|
var FormContainerNode_default = FormContainerNode;
|
|
4509
4685
|
|
|
4510
4686
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4511
|
-
var
|
|
4687
|
+
var import_react52 = __toESM(require("react"));
|
|
4512
4688
|
|
|
4513
4689
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4514
4690
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
4515
|
-
var
|
|
4691
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4516
4692
|
var IframeClient2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4517
4693
|
ssr: false
|
|
4518
4694
|
});
|
|
@@ -4525,7 +4701,7 @@ var EmbedNode = (props) => {
|
|
|
4525
4701
|
} else {
|
|
4526
4702
|
src = props.node.embedSrc;
|
|
4527
4703
|
}
|
|
4528
|
-
return /* @__PURE__ */ (0,
|
|
4704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(IframeClient2, { src }) });
|
|
4529
4705
|
};
|
|
4530
4706
|
var EmbedNode_default = EmbedNode;
|
|
4531
4707
|
|
|
@@ -4533,8 +4709,8 @@ var EmbedNode_default = EmbedNode;
|
|
|
4533
4709
|
init_ServiceClient();
|
|
4534
4710
|
|
|
4535
4711
|
// src/components/Slider.tsx
|
|
4536
|
-
var
|
|
4537
|
-
var
|
|
4712
|
+
var import_react50 = __toESM(require("react"));
|
|
4713
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4538
4714
|
var Slider = ({
|
|
4539
4715
|
children,
|
|
4540
4716
|
slidesToShow = 4,
|
|
@@ -4552,13 +4728,13 @@ var Slider = ({
|
|
|
4552
4728
|
pillStyle = "cumulative",
|
|
4553
4729
|
progressPosition = "bottom"
|
|
4554
4730
|
}) => {
|
|
4555
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4556
|
-
const [transition, setTransition] = (0,
|
|
4557
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4731
|
+
const [currentSlide, setCurrentSlide] = (0, import_react50.useState)(0);
|
|
4732
|
+
const [transition, setTransition] = (0, import_react50.useState)(true);
|
|
4733
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react50.useState)(
|
|
4558
4734
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4559
4735
|
);
|
|
4560
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4561
|
-
(0,
|
|
4736
|
+
const [isPlaying, setIsPlaying] = (0, import_react50.useState)(autoplay);
|
|
4737
|
+
(0, import_react50.useEffect)(() => {
|
|
4562
4738
|
if (typeof slidesToShow === "number") return;
|
|
4563
4739
|
const handleResize = () => {
|
|
4564
4740
|
if (window.innerWidth >= 1024) {
|
|
@@ -4573,7 +4749,7 @@ var Slider = ({
|
|
|
4573
4749
|
window.addEventListener("resize", handleResize);
|
|
4574
4750
|
return () => window.removeEventListener("resize", handleResize);
|
|
4575
4751
|
}, [slidesToShow]);
|
|
4576
|
-
(0,
|
|
4752
|
+
(0, import_react50.useEffect)(() => {
|
|
4577
4753
|
if (!autoplay) return;
|
|
4578
4754
|
const timer = setInterval(() => {
|
|
4579
4755
|
if (isPlaying) {
|
|
@@ -4582,7 +4758,7 @@ var Slider = ({
|
|
|
4582
4758
|
}, autoplay_speed);
|
|
4583
4759
|
return () => clearInterval(timer);
|
|
4584
4760
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4585
|
-
const totalSlides =
|
|
4761
|
+
const totalSlides = import_react50.Children.count(children);
|
|
4586
4762
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4587
4763
|
const nextSlide = () => {
|
|
4588
4764
|
if (currentSlide >= maxSlide) {
|
|
@@ -4627,16 +4803,16 @@ var Slider = ({
|
|
|
4627
4803
|
}
|
|
4628
4804
|
};
|
|
4629
4805
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4630
|
-
const slides =
|
|
4631
|
-
if (!
|
|
4806
|
+
const slides = import_react50.Children.map(children, (child, index) => {
|
|
4807
|
+
if (!import_react50.default.isValidElement(child)) return null;
|
|
4632
4808
|
const childProps = child.props;
|
|
4633
4809
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4634
|
-
return /* @__PURE__ */ (0,
|
|
4810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4635
4811
|
"div",
|
|
4636
4812
|
{
|
|
4637
4813
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4638
4814
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4639
|
-
children: (0,
|
|
4815
|
+
children: (0, import_react50.cloneElement)(child, {
|
|
4640
4816
|
className: mergedClassName
|
|
4641
4817
|
})
|
|
4642
4818
|
},
|
|
@@ -4654,14 +4830,14 @@ var Slider = ({
|
|
|
4654
4830
|
return "bottom-4";
|
|
4655
4831
|
}
|
|
4656
4832
|
};
|
|
4657
|
-
return /* @__PURE__ */ (0,
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4658
4834
|
"div",
|
|
4659
4835
|
{
|
|
4660
4836
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4661
4837
|
onMouseEnter: handleMouseEnter,
|
|
4662
4838
|
onMouseLeave: handleMouseLeave,
|
|
4663
4839
|
children: [
|
|
4664
|
-
/* @__PURE__ */ (0,
|
|
4840
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4665
4841
|
"div",
|
|
4666
4842
|
{
|
|
4667
4843
|
className: "flex h-full",
|
|
@@ -4672,18 +4848,18 @@ var Slider = ({
|
|
|
4672
4848
|
children: slides
|
|
4673
4849
|
}
|
|
4674
4850
|
),
|
|
4675
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4676
|
-
/* @__PURE__ */ (0,
|
|
4851
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4677
4853
|
ArrowButton,
|
|
4678
4854
|
{
|
|
4679
4855
|
direction: "left",
|
|
4680
4856
|
onClick: prevSlide,
|
|
4681
4857
|
visible: infinite_scroll || currentSlide > 0,
|
|
4682
4858
|
className: arrowClassName,
|
|
4683
|
-
children: /* @__PURE__ */ (0,
|
|
4859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4684
4860
|
}
|
|
4685
4861
|
),
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4862
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4687
4863
|
ArrowButton,
|
|
4688
4864
|
{
|
|
4689
4865
|
direction: "right",
|
|
@@ -4691,13 +4867,13 @@ var Slider = ({
|
|
|
4691
4867
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4692
4868
|
className: arrowClassName,
|
|
4693
4869
|
children: [
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4870
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4695
4871
|
" "
|
|
4696
4872
|
]
|
|
4697
4873
|
}
|
|
4698
4874
|
)
|
|
4699
4875
|
] }),
|
|
4700
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4876
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4701
4877
|
ProgressPill,
|
|
4702
4878
|
{
|
|
4703
4879
|
active: index === currentSlide,
|
|
@@ -4723,7 +4899,7 @@ var ArrowButton = ({
|
|
|
4723
4899
|
visible,
|
|
4724
4900
|
children,
|
|
4725
4901
|
className = ""
|
|
4726
|
-
}) => /* @__PURE__ */ (0,
|
|
4902
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4727
4903
|
"button",
|
|
4728
4904
|
{
|
|
4729
4905
|
className: `
|
|
@@ -4749,13 +4925,13 @@ var ProgressPill = ({
|
|
|
4749
4925
|
currentSlide,
|
|
4750
4926
|
totalSlides
|
|
4751
4927
|
}) => {
|
|
4752
|
-
const [progress, setProgress] = (0,
|
|
4753
|
-
(0,
|
|
4928
|
+
const [progress, setProgress] = (0, import_react50.useState)(0);
|
|
4929
|
+
(0, import_react50.useEffect)(() => {
|
|
4754
4930
|
if (active) {
|
|
4755
4931
|
setProgress(0);
|
|
4756
4932
|
}
|
|
4757
4933
|
}, [active, index]);
|
|
4758
|
-
(0,
|
|
4934
|
+
(0, import_react50.useEffect)(() => {
|
|
4759
4935
|
if (!active || !isPlaying) {
|
|
4760
4936
|
if (!active) {
|
|
4761
4937
|
setProgress(0);
|
|
@@ -4810,7 +4986,7 @@ var ProgressPill = ({
|
|
|
4810
4986
|
const renderProgressBar = () => {
|
|
4811
4987
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4812
4988
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4813
|
-
return /* @__PURE__ */ (0,
|
|
4989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4814
4990
|
"div",
|
|
4815
4991
|
{
|
|
4816
4992
|
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`,
|
|
@@ -4822,7 +4998,7 @@ var ProgressPill = ({
|
|
|
4822
4998
|
};
|
|
4823
4999
|
const renderCumulativeFill = () => {
|
|
4824
5000
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4825
|
-
return /* @__PURE__ */ (0,
|
|
5001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4826
5002
|
"div",
|
|
4827
5003
|
{
|
|
4828
5004
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4832,7 +5008,7 @@ var ProgressPill = ({
|
|
|
4832
5008
|
}
|
|
4833
5009
|
return null;
|
|
4834
5010
|
};
|
|
4835
|
-
return /* @__PURE__ */ (0,
|
|
5011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4836
5012
|
"button",
|
|
4837
5013
|
{
|
|
4838
5014
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -5008,10 +5184,10 @@ var PathUtility = class {
|
|
|
5008
5184
|
var PathUtility_default = new PathUtility();
|
|
5009
5185
|
|
|
5010
5186
|
// src/components/NoDataFound.tsx
|
|
5011
|
-
var
|
|
5187
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5012
5188
|
var NoDataFound = () => {
|
|
5013
|
-
return /* @__PURE__ */ (0,
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5015
5191
|
"svg",
|
|
5016
5192
|
{
|
|
5017
5193
|
className: "w-10 h-10",
|
|
@@ -5019,7 +5195,7 @@ var NoDataFound = () => {
|
|
|
5019
5195
|
stroke: "currentColor",
|
|
5020
5196
|
viewBox: "0 0 24 24",
|
|
5021
5197
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5022
|
-
children: /* @__PURE__ */ (0,
|
|
5198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5023
5199
|
"path",
|
|
5024
5200
|
{
|
|
5025
5201
|
strokeLinecap: "round",
|
|
@@ -5030,19 +5206,19 @@ var NoDataFound = () => {
|
|
|
5030
5206
|
)
|
|
5031
5207
|
}
|
|
5032
5208
|
) }) }),
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
5035
5211
|
] });
|
|
5036
5212
|
};
|
|
5037
5213
|
var NoDataFound_default = NoDataFound;
|
|
5038
5214
|
|
|
5039
5215
|
// src/components/Pagination.tsx
|
|
5040
|
-
var
|
|
5216
|
+
var import_react51 = require("react");
|
|
5041
5217
|
init_StyleTypes();
|
|
5042
|
-
var
|
|
5218
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5043
5219
|
var Pagination = (props) => {
|
|
5044
5220
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5045
|
-
const builder = (0,
|
|
5221
|
+
const builder = (0, import_react51.useMemo)(() => {
|
|
5046
5222
|
const b = new OdataBuilder(path);
|
|
5047
5223
|
if (query) b.setQuery(query);
|
|
5048
5224
|
return b;
|
|
@@ -5083,7 +5259,7 @@ var Pagination = (props) => {
|
|
|
5083
5259
|
return range;
|
|
5084
5260
|
};
|
|
5085
5261
|
const paginationRange = getPaginationRange();
|
|
5086
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
5262
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5087
5263
|
Hyperlink,
|
|
5088
5264
|
{
|
|
5089
5265
|
linkType: "Link" /* Link */,
|
|
@@ -5098,9 +5274,9 @@ var Pagination = (props) => {
|
|
|
5098
5274
|
);
|
|
5099
5275
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
5100
5276
|
if (disabled) {
|
|
5101
|
-
return /* @__PURE__ */ (0,
|
|
5277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
5102
5278
|
}
|
|
5103
|
-
return /* @__PURE__ */ (0,
|
|
5279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5104
5280
|
Hyperlink,
|
|
5105
5281
|
{
|
|
5106
5282
|
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",
|
|
@@ -5110,35 +5286,35 @@ var Pagination = (props) => {
|
|
|
5110
5286
|
);
|
|
5111
5287
|
};
|
|
5112
5288
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
5113
|
-
return /* @__PURE__ */ (0,
|
|
5114
|
-
/* @__PURE__ */ (0,
|
|
5115
|
-
/* @__PURE__ */ (0,
|
|
5289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
5290
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
5291
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "text-sm", children: [
|
|
5116
5292
|
"Showing ",
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "font-semibold", children: [
|
|
5118
5294
|
startItem,
|
|
5119
5295
|
"-",
|
|
5120
5296
|
endItem
|
|
5121
5297
|
] }),
|
|
5122
5298
|
" ",
|
|
5123
5299
|
"out of ",
|
|
5124
|
-
/* @__PURE__ */ (0,
|
|
5300
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
5125
5301
|
" results"
|
|
5126
5302
|
] }),
|
|
5127
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
5128
|
-
/* @__PURE__ */ (0,
|
|
5303
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5304
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5129
5305
|
NavigationButton,
|
|
5130
5306
|
{
|
|
5131
5307
|
page: activePageNumber - 1,
|
|
5132
5308
|
disabled: activePageNumber === 1,
|
|
5133
5309
|
children: [
|
|
5134
|
-
/* @__PURE__ */ (0,
|
|
5135
|
-
/* @__PURE__ */ (0,
|
|
5310
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
5311
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
5136
5312
|
]
|
|
5137
5313
|
}
|
|
5138
5314
|
),
|
|
5139
5315
|
paginationRange.map((item, index) => {
|
|
5140
5316
|
if (item === "...") {
|
|
5141
|
-
return /* @__PURE__ */ (0,
|
|
5317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5142
5318
|
"span",
|
|
5143
5319
|
{
|
|
5144
5320
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -5148,23 +5324,23 @@ var Pagination = (props) => {
|
|
|
5148
5324
|
);
|
|
5149
5325
|
}
|
|
5150
5326
|
const page = item;
|
|
5151
|
-
return /* @__PURE__ */ (0,
|
|
5327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PageButton, { page, children: page }, page);
|
|
5152
5328
|
}),
|
|
5153
|
-
/* @__PURE__ */ (0,
|
|
5329
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5154
5330
|
NavigationButton,
|
|
5155
5331
|
{
|
|
5156
5332
|
page: activePageNumber + 1,
|
|
5157
5333
|
disabled: activePageNumber === totalPages,
|
|
5158
5334
|
children: [
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5160
|
-
/* @__PURE__ */ (0,
|
|
5335
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
5336
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
5161
5337
|
]
|
|
5162
5338
|
}
|
|
5163
5339
|
)
|
|
5164
5340
|
] }),
|
|
5165
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
5166
|
-
/* @__PURE__ */ (0,
|
|
5167
|
-
/* @__PURE__ */ (0,
|
|
5341
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5342
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
5343
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5168
5344
|
"input",
|
|
5169
5345
|
{
|
|
5170
5346
|
type: "number",
|
|
@@ -5185,9 +5361,9 @@ var Pagination = (props) => {
|
|
|
5185
5361
|
) })
|
|
5186
5362
|
] })
|
|
5187
5363
|
] }),
|
|
5188
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
5189
|
-
/* @__PURE__ */ (0,
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5364
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
5365
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5191
5367
|
Hyperlink,
|
|
5192
5368
|
{
|
|
5193
5369
|
className: `
|
|
@@ -5199,7 +5375,7 @@ var Pagination = (props) => {
|
|
|
5199
5375
|
},
|
|
5200
5376
|
size
|
|
5201
5377
|
)) }),
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "per page" })
|
|
5203
5379
|
] }) })
|
|
5204
5380
|
] });
|
|
5205
5381
|
};
|
|
@@ -5207,7 +5383,7 @@ var Pagination_default = Pagination;
|
|
|
5207
5383
|
|
|
5208
5384
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5209
5385
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5210
|
-
var
|
|
5386
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5211
5387
|
var HlsPlayer3 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5212
5388
|
var deviceToMediaQuery = (device) => {
|
|
5213
5389
|
switch (device) {
|
|
@@ -5276,8 +5452,8 @@ var ImageGalleryNode = (props) => {
|
|
|
5276
5452
|
right: "justify-end"
|
|
5277
5453
|
};
|
|
5278
5454
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5279
|
-
return /* @__PURE__ */ (0,
|
|
5280
|
-
hlsSources.length > 0 && /* @__PURE__ */ (0,
|
|
5455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
5456
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5281
5457
|
HlsPlayer3,
|
|
5282
5458
|
{
|
|
5283
5459
|
sources: hlsSources,
|
|
@@ -5291,14 +5467,14 @@ var ImageGalleryNode = (props) => {
|
|
|
5291
5467
|
session: props.session
|
|
5292
5468
|
}
|
|
5293
5469
|
) }),
|
|
5294
|
-
staticFallback && /* @__PURE__ */ (0,
|
|
5470
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("picture", { children: [
|
|
5295
5471
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5296
5472
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5297
5473
|
if (!match) return null;
|
|
5298
5474
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5299
5475
|
if (!srcUrl) return null;
|
|
5300
5476
|
const mediaQuery = deviceToMediaQuery(match.device);
|
|
5301
|
-
return /* @__PURE__ */ (0,
|
|
5477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5302
5478
|
"source",
|
|
5303
5479
|
{
|
|
5304
5480
|
media: mediaQuery,
|
|
@@ -5322,7 +5498,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5322
5498
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5323
5499
|
return (
|
|
5324
5500
|
// eslint-disable-next-line @next/next/no-img-element
|
|
5325
|
-
/* @__PURE__ */ (0,
|
|
5501
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5326
5502
|
"img",
|
|
5327
5503
|
{
|
|
5328
5504
|
loading: "lazy",
|
|
@@ -5343,7 +5519,7 @@ var ImageGalleryNode_default = ImageGalleryNode;
|
|
|
5343
5519
|
|
|
5344
5520
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5345
5521
|
var import_link2 = __toESM(require("next/link"));
|
|
5346
|
-
var
|
|
5522
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5347
5523
|
function toCamelCase(str) {
|
|
5348
5524
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
5349
5525
|
}
|
|
@@ -5548,7 +5724,7 @@ var DivContainer = async (props) => {
|
|
|
5548
5724
|
response = await serviceClient.get(endpoint);
|
|
5549
5725
|
result = response?.result;
|
|
5550
5726
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5551
|
-
return /* @__PURE__ */ (0,
|
|
5727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NoDataFound_default, {});
|
|
5552
5728
|
}
|
|
5553
5729
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5554
5730
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5565,7 +5741,7 @@ var DivContainer = async (props) => {
|
|
|
5565
5741
|
}
|
|
5566
5742
|
const SelectedNode = NodeTypes2[node.type];
|
|
5567
5743
|
if (!SelectedNode) return null;
|
|
5568
|
-
return /* @__PURE__ */ (0,
|
|
5744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5569
5745
|
SelectedNode,
|
|
5570
5746
|
{
|
|
5571
5747
|
node,
|
|
@@ -5667,9 +5843,9 @@ var DivContainer = async (props) => {
|
|
|
5667
5843
|
props.node.autoFormat && "auto-format",
|
|
5668
5844
|
props.node.bgClass
|
|
5669
5845
|
].filter(Boolean).join(" ");
|
|
5670
|
-
return /* @__PURE__ */ (0,
|
|
5671
|
-
/* @__PURE__ */ (0,
|
|
5672
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react52.default.Fragment, { children: [
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5848
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5673
5849
|
Wrapper,
|
|
5674
5850
|
{
|
|
5675
5851
|
id: guid,
|
|
@@ -5678,18 +5854,18 @@ var DivContainer = async (props) => {
|
|
|
5678
5854
|
...wrapperProps,
|
|
5679
5855
|
children: dataToRender.map(
|
|
5680
5856
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5681
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
5857
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: child }, i)
|
|
5682
5858
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5683
5859
|
)
|
|
5684
5860
|
}
|
|
5685
5861
|
) }),
|
|
5686
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
5862
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
5687
5863
|
] });
|
|
5688
5864
|
};
|
|
5689
5865
|
var DivContainer_default = DivContainer;
|
|
5690
5866
|
|
|
5691
5867
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5692
|
-
var
|
|
5868
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5693
5869
|
var NodeTypes = {
|
|
5694
5870
|
["paragraph"]: ParagraphNode_default,
|
|
5695
5871
|
["heading"]: HeadingNode_default,
|
|
@@ -5717,11 +5893,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5717
5893
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5718
5894
|
rootNode = pageBodyTree.root;
|
|
5719
5895
|
}
|
|
5720
|
-
return /* @__PURE__ */ (0,
|
|
5896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5721
5897
|
{
|
|
5722
5898
|
}
|
|
5723
5899
|
const SelectedNode = NodeTypes[node.type];
|
|
5724
|
-
return /* @__PURE__ */ (0,
|
|
5900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5725
5901
|
SelectedNode,
|
|
5726
5902
|
{
|
|
5727
5903
|
node,
|
|
@@ -5737,7 +5913,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5737
5913
|
device: props.device,
|
|
5738
5914
|
widgetRenderer: props.widgetRenderer
|
|
5739
5915
|
}
|
|
5740
|
-
) }) : /* @__PURE__ */ (0,
|
|
5916
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5741
5917
|
SelectedNode,
|
|
5742
5918
|
{
|
|
5743
5919
|
node,
|
|
@@ -5758,13 +5934,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5758
5934
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5759
5935
|
|
|
5760
5936
|
// src/components/Toast.tsx
|
|
5761
|
-
var
|
|
5937
|
+
var import_react54 = require("react");
|
|
5762
5938
|
init_ToastService();
|
|
5763
|
-
var
|
|
5939
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5764
5940
|
var Toast = () => {
|
|
5765
|
-
const [showToast, setShowToast] = (0,
|
|
5766
|
-
const [message, setMessage] = (0,
|
|
5767
|
-
const [messageType, setMessageType] = (0,
|
|
5941
|
+
const [showToast, setShowToast] = (0, import_react54.useState)(false);
|
|
5942
|
+
const [message, setMessage] = (0, import_react54.useState)("");
|
|
5943
|
+
const [messageType, setMessageType] = (0, import_react54.useState)("error");
|
|
5768
5944
|
ToastService_default.showError = function(message2) {
|
|
5769
5945
|
setShowToast(true);
|
|
5770
5946
|
setMessage(message2);
|
|
@@ -5803,8 +5979,8 @@ var Toast = () => {
|
|
|
5803
5979
|
const closeToast = () => {
|
|
5804
5980
|
setShowToast(false);
|
|
5805
5981
|
};
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5807
|
-
/* @__PURE__ */ (0,
|
|
5982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5808
5984
|
"span",
|
|
5809
5985
|
{
|
|
5810
5986
|
className: "font-medium text-inherit text-sm",
|
|
@@ -5812,7 +5988,7 @@ var Toast = () => {
|
|
|
5812
5988
|
children: message
|
|
5813
5989
|
}
|
|
5814
5990
|
),
|
|
5815
|
-
/* @__PURE__ */ (0,
|
|
5991
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5816
5992
|
"svg",
|
|
5817
5993
|
{
|
|
5818
5994
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5820,7 +5996,7 @@ var Toast = () => {
|
|
|
5820
5996
|
fill: "none",
|
|
5821
5997
|
viewBox: "0 0 24 24",
|
|
5822
5998
|
stroke: "currentColor",
|
|
5823
|
-
children: /* @__PURE__ */ (0,
|
|
5999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
5824
6000
|
}
|
|
5825
6001
|
) })
|
|
5826
6002
|
] }) }) });
|
|
@@ -5835,6 +6011,7 @@ init_ToastService();
|
|
|
5835
6011
|
CheckboxInput,
|
|
5836
6012
|
ColorInput,
|
|
5837
6013
|
DataList,
|
|
6014
|
+
DataListRenderer,
|
|
5838
6015
|
DateTimeInput,
|
|
5839
6016
|
EmailInput,
|
|
5840
6017
|
InputControl,
|