@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260423051720 → 0.8.1-dev.20260423063335
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +112 -1
- package/dist/index.d.ts +112 -1
- package/dist/index.js +1007 -850
- package/dist/index.mjs +568 -413
- 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,17 @@ 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 wasManuallyPausedRef = (0,
|
|
301
|
-
const inactivityTimerRef = (0,
|
|
512
|
+
const videoRef = (0, import_react35.useRef)(null);
|
|
513
|
+
const hlsRef = (0, import_react35.useRef)(null);
|
|
514
|
+
const [isPlaying, setIsPlaying] = (0, import_react35.useState)(playOptions === "autoplay");
|
|
515
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
516
|
+
const [isMobile, setIsMobile] = (0, import_react35.useState)(false);
|
|
517
|
+
const [isControlsVisible, setIsControlsVisible] = (0, import_react35.useState)(true);
|
|
518
|
+
const wasManuallyPausedRef = (0, import_react35.useRef)(false);
|
|
519
|
+
const inactivityTimerRef = (0, import_react35.useRef)(null);
|
|
302
520
|
const INACTIVITY_DELAY = 2500;
|
|
303
521
|
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl, posterUrl }] : [];
|
|
304
|
-
(0,
|
|
522
|
+
(0, import_react35.useEffect)(() => {
|
|
305
523
|
const checkMobile = () => {
|
|
306
524
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
307
525
|
const isSmallScreen = window.innerWidth <= 768;
|
|
@@ -314,7 +532,7 @@ var init_HlsPlayer = __esm({
|
|
|
314
532
|
window.addEventListener("resize", checkMobile);
|
|
315
533
|
return () => window.removeEventListener("resize", checkMobile);
|
|
316
534
|
}, []);
|
|
317
|
-
const resetInactivityTimer = (0,
|
|
535
|
+
const resetInactivityTimer = (0, import_react35.useCallback)(() => {
|
|
318
536
|
setIsControlsVisible(true);
|
|
319
537
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
320
538
|
if (isPlaying) {
|
|
@@ -324,18 +542,18 @@ var init_HlsPlayer = __esm({
|
|
|
324
542
|
);
|
|
325
543
|
}
|
|
326
544
|
}, [isPlaying]);
|
|
327
|
-
(0,
|
|
545
|
+
(0, import_react35.useEffect)(() => {
|
|
328
546
|
if (!isPlaying) {
|
|
329
547
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
330
548
|
setIsControlsVisible(true);
|
|
331
549
|
}
|
|
332
550
|
}, [isPlaying]);
|
|
333
|
-
(0,
|
|
551
|
+
(0, import_react35.useEffect)(() => {
|
|
334
552
|
return () => {
|
|
335
553
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
336
554
|
};
|
|
337
555
|
}, []);
|
|
338
|
-
(0,
|
|
556
|
+
(0, import_react35.useEffect)(() => {
|
|
339
557
|
const v = videoRef.current;
|
|
340
558
|
if (!v || resolvedSources.length === 0) return;
|
|
341
559
|
if (hlsRef.current) {
|
|
@@ -367,7 +585,7 @@ var init_HlsPlayer = __esm({
|
|
|
367
585
|
v.load();
|
|
368
586
|
}
|
|
369
587
|
}, [JSON.stringify(resolvedSources)]);
|
|
370
|
-
const handlePlayPause = (0,
|
|
588
|
+
const handlePlayPause = (0, import_react35.useCallback)(() => {
|
|
371
589
|
const v = videoRef.current;
|
|
372
590
|
if (!v) return;
|
|
373
591
|
if (v.paused) {
|
|
@@ -379,7 +597,7 @@ var init_HlsPlayer = __esm({
|
|
|
379
597
|
setIsPlaying(false);
|
|
380
598
|
}
|
|
381
599
|
}, []);
|
|
382
|
-
const handleMouseEnter = (0,
|
|
600
|
+
const handleMouseEnter = (0, import_react35.useCallback)(() => {
|
|
383
601
|
if (isMobile) return;
|
|
384
602
|
setIsHovered(true);
|
|
385
603
|
resetInactivityTimer();
|
|
@@ -387,7 +605,7 @@ var init_HlsPlayer = __esm({
|
|
|
387
605
|
videoRef.current.play().then(() => setIsPlaying(true));
|
|
388
606
|
}
|
|
389
607
|
}, [playOptions, isMobile, resetInactivityTimer]);
|
|
390
|
-
const handleMouseLeave = (0,
|
|
608
|
+
const handleMouseLeave = (0, import_react35.useCallback)(() => {
|
|
391
609
|
if (isMobile) return;
|
|
392
610
|
setIsHovered(false);
|
|
393
611
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -398,14 +616,14 @@ var init_HlsPlayer = __esm({
|
|
|
398
616
|
setIsPlaying(false);
|
|
399
617
|
}
|
|
400
618
|
}, [playOptions, isMobile, isPlaying]);
|
|
401
|
-
const handleMouseMove = (0,
|
|
619
|
+
const handleMouseMove = (0, import_react35.useCallback)(() => {
|
|
402
620
|
if (isMobile) return;
|
|
403
621
|
resetInactivityTimer();
|
|
404
622
|
}, [isMobile, resetInactivityTimer]);
|
|
405
623
|
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
406
624
|
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
407
625
|
if (resolvedSources.length === 0) return null;
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
409
627
|
"div",
|
|
410
628
|
{
|
|
411
629
|
className: "relative w-full aspect-video bg-black",
|
|
@@ -413,7 +631,7 @@ var init_HlsPlayer = __esm({
|
|
|
413
631
|
onMouseLeave: handleMouseLeave,
|
|
414
632
|
onMouseMove: handleMouseMove,
|
|
415
633
|
children: [
|
|
416
|
-
/* @__PURE__ */ (0,
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
417
635
|
"video",
|
|
418
636
|
{
|
|
419
637
|
ref: videoRef,
|
|
@@ -425,7 +643,7 @@ var init_HlsPlayer = __esm({
|
|
|
425
643
|
loop,
|
|
426
644
|
playsInline: true,
|
|
427
645
|
onClick: !isMobile ? handlePlayPause : void 0,
|
|
428
|
-
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0,
|
|
646
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
429
647
|
"source",
|
|
430
648
|
{
|
|
431
649
|
src,
|
|
@@ -436,13 +654,13 @@ var init_HlsPlayer = __esm({
|
|
|
436
654
|
))
|
|
437
655
|
}
|
|
438
656
|
),
|
|
439
|
-
!isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ (0,
|
|
657
|
+
!isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
440
658
|
"picture",
|
|
441
659
|
{
|
|
442
660
|
className: `absolute inset-0 transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`,
|
|
443
661
|
children: [
|
|
444
|
-
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0,
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
662
|
+
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("source", { media, srcSet: src }, i)),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
446
664
|
"img",
|
|
447
665
|
{
|
|
448
666
|
src: fallbackPoster,
|
|
@@ -455,7 +673,7 @@ var init_HlsPlayer = __esm({
|
|
|
455
673
|
]
|
|
456
674
|
}
|
|
457
675
|
),
|
|
458
|
-
!isMobile && /* @__PURE__ */ (0,
|
|
676
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
459
677
|
"div",
|
|
460
678
|
{
|
|
461
679
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
@@ -463,7 +681,7 @@ var init_HlsPlayer = __esm({
|
|
|
463
681
|
opacity: isControlsVisible ? 1 : 0,
|
|
464
682
|
transition: "opacity 0.3s ease"
|
|
465
683
|
},
|
|
466
|
-
children: /* @__PURE__ */ (0,
|
|
684
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
467
685
|
"button",
|
|
468
686
|
{
|
|
469
687
|
type: "button",
|
|
@@ -502,13 +720,13 @@ var init_HlsPlayer = __esm({
|
|
|
502
720
|
},
|
|
503
721
|
children: isPlaying ? (
|
|
504
722
|
/* Pause — two rounded bars */
|
|
505
|
-
/* @__PURE__ */ (0,
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
/* @__PURE__ */ (0,
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "3.5", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" }),
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("rect", { x: "12", y: "2.5", width: "4.5", height: "15", rx: "1.5", fill: "white" })
|
|
508
726
|
] })
|
|
509
727
|
) : (
|
|
510
728
|
/* Play — solid triangle, nudged right for optical balance */
|
|
511
|
-
/* @__PURE__ */ (0,
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M5 3.5L17 10L5 16.5V3.5Z", fill: "white" }) })
|
|
512
730
|
)
|
|
513
731
|
}
|
|
514
732
|
)
|
|
@@ -524,251 +742,33 @@ var init_HlsPlayer = __esm({
|
|
|
524
742
|
}
|
|
525
743
|
});
|
|
526
744
|
|
|
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
745
|
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
746
746
|
var LinkNodeButton_exports = {};
|
|
747
747
|
__export(LinkNodeButton_exports, {
|
|
748
748
|
default: () => LinkNodeButton_default
|
|
749
749
|
});
|
|
750
|
-
var
|
|
750
|
+
var import_react37, import_jsx_runtime47, LinkNodeButton, LinkNodeButton_default;
|
|
751
751
|
var init_LinkNodeButton = __esm({
|
|
752
752
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
753
753
|
"use strict";
|
|
754
754
|
"use client";
|
|
755
|
-
|
|
755
|
+
import_react37 = require("react");
|
|
756
756
|
init_Button();
|
|
757
757
|
init_ServiceClient();
|
|
758
758
|
init_ToastService();
|
|
759
|
-
|
|
759
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
760
760
|
LinkNodeButton = (props) => {
|
|
761
761
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
762
|
-
const [isLoading, setIsLoading] = (0,
|
|
763
|
-
const [error, setError] = (0,
|
|
764
|
-
const extractFieldNames = (0,
|
|
762
|
+
const [isLoading, setIsLoading] = (0, import_react37.useState)(false);
|
|
763
|
+
const [error, setError] = (0, import_react37.useState)(null);
|
|
764
|
+
const extractFieldNames = (0, import_react37.useCallback)((template) => {
|
|
765
765
|
if (!template) return [];
|
|
766
766
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
767
767
|
const matches = Array.from(template.matchAll(regex));
|
|
768
768
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
769
769
|
return fieldNames;
|
|
770
770
|
}, []);
|
|
771
|
-
const replaceTemplateVariables = (0,
|
|
771
|
+
const replaceTemplateVariables = (0, import_react37.useCallback)((template, responseData) => {
|
|
772
772
|
if (!template) return template;
|
|
773
773
|
let result = template;
|
|
774
774
|
const fieldNames = extractFieldNames(template);
|
|
@@ -797,7 +797,7 @@ var init_LinkNodeButton = __esm({
|
|
|
797
797
|
}
|
|
798
798
|
return result;
|
|
799
799
|
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
800
|
-
const getNestedValue3 = (0,
|
|
800
|
+
const getNestedValue3 = (0, import_react37.useCallback)((obj, path) => {
|
|
801
801
|
if (!obj || !path) return void 0;
|
|
802
802
|
if (obj[path] !== void 0) {
|
|
803
803
|
return obj[path];
|
|
@@ -812,7 +812,7 @@ var init_LinkNodeButton = __esm({
|
|
|
812
812
|
}
|
|
813
813
|
return current;
|
|
814
814
|
}, []);
|
|
815
|
-
const onClick = (0,
|
|
815
|
+
const onClick = (0, import_react37.useCallback)(async (e) => {
|
|
816
816
|
if (!node.postUrl) {
|
|
817
817
|
setError("No POST URL configured for this button");
|
|
818
818
|
return;
|
|
@@ -899,11 +899,11 @@ var init_LinkNodeButton = __esm({
|
|
|
899
899
|
return children;
|
|
900
900
|
}
|
|
901
901
|
if (linkText) {
|
|
902
|
-
return /* @__PURE__ */ (0,
|
|
902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: linkText });
|
|
903
903
|
}
|
|
904
904
|
return node.title || "Button";
|
|
905
905
|
};
|
|
906
|
-
return /* @__PURE__ */ (0,
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
907
907
|
Button_default,
|
|
908
908
|
{
|
|
909
909
|
ButtonType: linkType,
|
|
@@ -924,9 +924,9 @@ __export(CopyButton_exports, {
|
|
|
924
924
|
default: () => CopyButton
|
|
925
925
|
});
|
|
926
926
|
function CopyButton({ text }) {
|
|
927
|
-
const [copied, setCopied] = (0,
|
|
928
|
-
const timeoutRef = (0,
|
|
929
|
-
(0,
|
|
927
|
+
const [copied, setCopied] = (0, import_react44.useState)(false);
|
|
928
|
+
const timeoutRef = (0, import_react44.useRef)(null);
|
|
929
|
+
(0, import_react44.useEffect)(() => {
|
|
930
930
|
return () => {
|
|
931
931
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
932
932
|
};
|
|
@@ -941,13 +941,13 @@ function CopyButton({ text }) {
|
|
|
941
941
|
console.error("Failed to copy: ", err);
|
|
942
942
|
}
|
|
943
943
|
};
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
945
945
|
"button",
|
|
946
946
|
{
|
|
947
947
|
onClick: handleCopy,
|
|
948
948
|
className: "flex gap-1 items-center hover:text-white transition",
|
|
949
949
|
children: [
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
951
951
|
"svg",
|
|
952
952
|
{
|
|
953
953
|
width: "16",
|
|
@@ -955,7 +955,7 @@ function CopyButton({ text }) {
|
|
|
955
955
|
viewBox: "0 0 24 24",
|
|
956
956
|
className: "w-4 h-4",
|
|
957
957
|
fill: "currentColor",
|
|
958
|
-
children: /* @__PURE__ */ (0,
|
|
958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
959
959
|
"path",
|
|
960
960
|
{
|
|
961
961
|
fillRule: "evenodd",
|
|
@@ -970,54 +970,54 @@ function CopyButton({ text }) {
|
|
|
970
970
|
}
|
|
971
971
|
);
|
|
972
972
|
}
|
|
973
|
-
var
|
|
973
|
+
var import_react44, import_jsx_runtime57;
|
|
974
974
|
var init_CopyButton = __esm({
|
|
975
975
|
"src/components/CopyButton.tsx"() {
|
|
976
976
|
"use strict";
|
|
977
977
|
"use client";
|
|
978
|
-
|
|
979
|
-
|
|
978
|
+
import_react44 = require("react");
|
|
979
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
980
980
|
}
|
|
981
981
|
});
|
|
982
982
|
|
|
983
983
|
// src/components/IFrameLoaderView.tsx
|
|
984
|
-
var
|
|
984
|
+
var import_react48, import_jsx_runtime63, IFrameLoaderView, IFrameLoaderView_default;
|
|
985
985
|
var init_IFrameLoaderView = __esm({
|
|
986
986
|
"src/components/IFrameLoaderView.tsx"() {
|
|
987
987
|
"use strict";
|
|
988
|
-
|
|
989
|
-
|
|
988
|
+
import_react48 = __toESM(require("react"));
|
|
989
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
990
990
|
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,
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react48.default.Fragment, { children: [
|
|
992
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ml-2", children: [
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
998
998
|
] })
|
|
999
999
|
] }),
|
|
1000
|
-
/* @__PURE__ */ (0,
|
|
1001
|
-
/* @__PURE__ */ (0,
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1005
|
-
/* @__PURE__ */ (0,
|
|
1006
|
-
/* @__PURE__ */ (0,
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1004
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1007
1007
|
] }),
|
|
1008
|
-
/* @__PURE__ */ (0,
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1008
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1014
1014
|
] }),
|
|
1015
|
-
/* @__PURE__ */ (0,
|
|
1016
|
-
/* @__PURE__ */ (0,
|
|
1017
|
-
/* @__PURE__ */ (0,
|
|
1018
|
-
/* @__PURE__ */ (0,
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1015
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "animate-pulse", children: [
|
|
1016
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
1018
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
1019
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
1021
1021
|
] })
|
|
1022
1022
|
] })
|
|
1023
1023
|
] }) }),
|
|
@@ -1033,19 +1033,19 @@ var IframeClient_exports = {};
|
|
|
1033
1033
|
__export(IframeClient_exports, {
|
|
1034
1034
|
default: () => IframeClient_default
|
|
1035
1035
|
});
|
|
1036
|
-
var
|
|
1036
|
+
var import_react49, import_jsx_runtime64, IframeClient, IframeClient_default;
|
|
1037
1037
|
var init_IframeClient = __esm({
|
|
1038
1038
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
1039
1039
|
"use strict";
|
|
1040
1040
|
"use client";
|
|
1041
|
-
|
|
1041
|
+
import_react49 = __toESM(require("react"));
|
|
1042
1042
|
init_IFrameLoaderView();
|
|
1043
|
-
|
|
1043
|
+
import_jsx_runtime64 = require("react/jsx-runtime");
|
|
1044
1044
|
IframeClient = ({ src }) => {
|
|
1045
|
-
const iframeRef = (0,
|
|
1046
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
1047
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
1048
|
-
(0,
|
|
1045
|
+
const iframeRef = (0, import_react49.useRef)(null);
|
|
1046
|
+
const [iframeHeight, setIframeHeight] = (0, import_react49.useState)("100%");
|
|
1047
|
+
const [isDataFound, setIsDataFound] = (0, import_react49.useState)(null);
|
|
1048
|
+
(0, import_react49.useEffect)(() => {
|
|
1049
1049
|
const handleReceiveMessage = (event) => {
|
|
1050
1050
|
const eventName = event?.data?.eventName;
|
|
1051
1051
|
const payload = event?.data?.payload;
|
|
@@ -1060,7 +1060,7 @@ var init_IframeClient = __esm({
|
|
|
1060
1060
|
window.addEventListener("message", handleReceiveMessage);
|
|
1061
1061
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
1062
1062
|
}, []);
|
|
1063
|
-
(0,
|
|
1063
|
+
(0, import_react49.useEffect)(() => {
|
|
1064
1064
|
const handleResize = () => {
|
|
1065
1065
|
if (iframeRef.current) {
|
|
1066
1066
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -1072,7 +1072,7 @@ var init_IframeClient = __esm({
|
|
|
1072
1072
|
const handleIframeLoad = () => {
|
|
1073
1073
|
setIsDataFound(true);
|
|
1074
1074
|
};
|
|
1075
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
1076
1076
|
"iframe",
|
|
1077
1077
|
{
|
|
1078
1078
|
ref: iframeRef,
|
|
@@ -1095,6 +1095,7 @@ __export(index_exports, {
|
|
|
1095
1095
|
CheckboxInput: () => CheckboxInput_default,
|
|
1096
1096
|
ColorInput: () => ColorInput_default,
|
|
1097
1097
|
DataList: () => DataList_default,
|
|
1098
|
+
DataListRenderer: () => DataListRenderer_default,
|
|
1098
1099
|
DateTimeInput: () => DateTimeInput_default,
|
|
1099
1100
|
EmailInput: () => EmailInput_default,
|
|
1100
1101
|
InputControl: () => InputControl_default,
|
|
@@ -1116,13 +1117,14 @@ __export(index_exports, {
|
|
|
1116
1117
|
module.exports = __toCommonJS(index_exports);
|
|
1117
1118
|
|
|
1118
1119
|
// src/components/controls/view/ViewControl.tsx
|
|
1119
|
-
var
|
|
1120
|
+
var import_react10 = __toESM(require("react"));
|
|
1120
1121
|
|
|
1121
1122
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
1122
1123
|
var ViewControlTypes = {
|
|
1123
1124
|
lineText: "lineText",
|
|
1124
1125
|
asset: "asset",
|
|
1125
1126
|
multilineTextBullets: "multilineTextBullets",
|
|
1127
|
+
boolean: "boolean",
|
|
1126
1128
|
money: "money",
|
|
1127
1129
|
date: "date",
|
|
1128
1130
|
time: "time",
|
|
@@ -1360,50 +1362,94 @@ var DateView = (props) => {
|
|
|
1360
1362
|
};
|
|
1361
1363
|
var DateView_default = DateView;
|
|
1362
1364
|
|
|
1363
|
-
// src/components/controls/view/
|
|
1365
|
+
// src/components/controls/view/BooleanView.tsx
|
|
1364
1366
|
var import_react3 = __toESM(require("react"));
|
|
1365
1367
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1368
|
+
var BooleanView = (props) => {
|
|
1369
|
+
const { value, customProps } = props;
|
|
1370
|
+
const showOnlyTrueIcon = customProps?.showOnlyTrueIcon;
|
|
1371
|
+
console.log("BooleanView Debug:", {
|
|
1372
|
+
value,
|
|
1373
|
+
type: typeof value,
|
|
1374
|
+
customProps,
|
|
1375
|
+
showOnlyTrueIcon
|
|
1376
|
+
});
|
|
1377
|
+
const booleanValue = import_react3.default.useMemo(() => {
|
|
1378
|
+
if (typeof value === "boolean") return value;
|
|
1379
|
+
if (typeof value === "string") {
|
|
1380
|
+
return value.toLowerCase() === "true";
|
|
1381
|
+
}
|
|
1382
|
+
if (typeof value === "number") {
|
|
1383
|
+
return value === 1;
|
|
1384
|
+
}
|
|
1385
|
+
return false;
|
|
1386
|
+
}, [value]);
|
|
1387
|
+
if (showOnlyTrueIcon) {
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1389
|
+
"svg",
|
|
1390
|
+
{
|
|
1391
|
+
className: "w-15 h-8 text-green-600",
|
|
1392
|
+
fill: "currentColor",
|
|
1393
|
+
viewBox: "0 0 20 20",
|
|
1394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1395
|
+
"path",
|
|
1396
|
+
{
|
|
1397
|
+
fillRule: "evenodd",
|
|
1398
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
1399
|
+
clipRule: "evenodd"
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
}
|
|
1403
|
+
) });
|
|
1404
|
+
}
|
|
1405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
1406
|
+
};
|
|
1407
|
+
var BooleanView_default = BooleanView;
|
|
1408
|
+
|
|
1409
|
+
// src/components/controls/view/LineTextView.tsx
|
|
1410
|
+
var import_react4 = __toESM(require("react"));
|
|
1411
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1366
1412
|
var LineText = (props) => {
|
|
1367
|
-
return /* @__PURE__ */ (0,
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.default.Fragment, { children: props.value });
|
|
1368
1414
|
};
|
|
1369
1415
|
var LineTextView_default = LineText;
|
|
1370
1416
|
|
|
1371
1417
|
// src/components/controls/view/MoneyView.tsx
|
|
1372
|
-
var
|
|
1373
|
-
var
|
|
1418
|
+
var import_react5 = __toESM(require("react"));
|
|
1419
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1374
1420
|
var Money = (props) => {
|
|
1375
1421
|
const parsedNumber = parseFloat(props.value);
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.default.Fragment, { children: !Number.isNaN(parsedNumber) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: parsedNumber < 0 ? "text-alert" : "", children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-0.5", children: "\u20B9" }),
|
|
1378
1424
|
parsedNumber.toLocaleString()
|
|
1379
1425
|
] }) });
|
|
1380
1426
|
};
|
|
1381
1427
|
var MoneyView_default = Money;
|
|
1382
1428
|
|
|
1383
1429
|
// src/components/controls/view/MultilineTextBulletsView.tsx
|
|
1384
|
-
var
|
|
1385
|
-
var
|
|
1430
|
+
var import_react6 = __toESM(require("react"));
|
|
1431
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1386
1432
|
var MultilineTextBullets = (props) => {
|
|
1387
1433
|
const lines = props.value?.split("\\n");
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
1435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: line }, index);
|
|
1390
1436
|
}) }) });
|
|
1391
1437
|
};
|
|
1392
1438
|
var MultilineTextBulletsView_default = MultilineTextBullets;
|
|
1393
1439
|
|
|
1394
1440
|
// src/components/controls/view/MultilineTextView.tsx
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1441
|
+
var import_react7 = __toESM(require("react"));
|
|
1442
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1397
1443
|
var MultilineText = (props) => {
|
|
1398
|
-
return /* @__PURE__ */ (0,
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react7.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
1399
1445
|
};
|
|
1400
1446
|
var MultilineTextView_default = MultilineText;
|
|
1401
1447
|
|
|
1402
1448
|
// src/components/controls/view/PercentageView.tsx
|
|
1403
|
-
var
|
|
1404
|
-
var
|
|
1449
|
+
var import_react8 = __toESM(require("react"));
|
|
1450
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1405
1451
|
var PercentageView = (props) => {
|
|
1406
|
-
return /* @__PURE__ */ (0,
|
|
1452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react8.default.Fragment, { children: [
|
|
1407
1453
|
props.value,
|
|
1408
1454
|
"%"
|
|
1409
1455
|
] });
|
|
@@ -1411,16 +1457,16 @@ var PercentageView = (props) => {
|
|
|
1411
1457
|
var PercentageView_default = PercentageView;
|
|
1412
1458
|
|
|
1413
1459
|
// src/components/controls/view/ProgressIndicator.tsx
|
|
1414
|
-
var
|
|
1415
|
-
var
|
|
1460
|
+
var import_react9 = __toESM(require("react"));
|
|
1461
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1416
1462
|
var ProgressIndicator = (props) => {
|
|
1417
1463
|
const percentage = 100;
|
|
1418
1464
|
const circumference = Math.PI * 56;
|
|
1419
1465
|
const offset = circumference * (1 - percentage / 100);
|
|
1420
|
-
return /* @__PURE__ */ (0,
|
|
1421
|
-
/* @__PURE__ */ (0,
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1423
|
-
/* @__PURE__ */ (0,
|
|
1466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative w-48 h-48", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full border border-gray-200" }),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-full h-full rounded-full border-t-8 border-green-500", style: { transform: `rotate(-90deg)`, clipPath: `inset(0px ${offset}px 0px 0px)` } }) }),
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-lg font-bold text-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
1424
1470
|
percentage,
|
|
1425
1471
|
"%"
|
|
1426
1472
|
] }) })
|
|
@@ -1429,29 +1475,30 @@ var ProgressIndicator = (props) => {
|
|
|
1429
1475
|
var ProgressIndicator_default = ProgressIndicator;
|
|
1430
1476
|
|
|
1431
1477
|
// src/components/controls/view/AiGeneratedSummary.tsx
|
|
1432
|
-
var
|
|
1478
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1433
1479
|
var AiGeneratedSummary = (props) => {
|
|
1434
1480
|
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,
|
|
1481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "group rounded-xl border-2 bg-white shadow-sm border-p overflow-hidden", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { className: "flex items-start justify-between cursor-pointer list-none", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-3 ", children: [
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-primary-base bg-transparent rounded mt-1 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" }) }) }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-lg font-semibold ", children: "Quick Read" }),
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm text-gray-500 mb-0", children: "Summary is AI-generated, author-reviewed" })
|
|
1441
1487
|
] })
|
|
1442
1488
|
] }) }),
|
|
1443
|
-
/* @__PURE__ */ (0,
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "list-disc pl-6 space-y-3 text-gray-700", children: lines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "m-0", children: line }, index)) }) })
|
|
1444
1490
|
] });
|
|
1445
1491
|
};
|
|
1446
1492
|
var AiGeneratedSummary_default = AiGeneratedSummary;
|
|
1447
1493
|
|
|
1448
1494
|
// src/components/controls/view/ViewControl.tsx
|
|
1449
|
-
var
|
|
1495
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1450
1496
|
var ViewControl = (props) => {
|
|
1451
1497
|
const ControlComponents = {
|
|
1452
1498
|
[ViewControlTypes_default.lineText]: LineTextView_default,
|
|
1453
1499
|
// [ViewControlTypes.asset]: Asset,
|
|
1454
1500
|
[ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
|
|
1501
|
+
[ViewControlTypes_default.boolean]: BooleanView_default,
|
|
1455
1502
|
[ViewControlTypes_default.money]: MoneyView_default,
|
|
1456
1503
|
[ViewControlTypes_default.date]: DateView_default,
|
|
1457
1504
|
[ViewControlTypes_default.time]: DateView_default,
|
|
@@ -1467,16 +1514,16 @@ var ViewControl = (props) => {
|
|
|
1467
1514
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default
|
|
1468
1515
|
};
|
|
1469
1516
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
1470
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react10.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
1471
1518
|
};
|
|
1472
1519
|
var ViewControl_default = ViewControl;
|
|
1473
1520
|
|
|
1474
1521
|
// src/components/controls/edit/InputControl.tsx
|
|
1475
|
-
var
|
|
1522
|
+
var import_react30 = __toESM(require("react"));
|
|
1476
1523
|
|
|
1477
1524
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
1478
|
-
var
|
|
1479
|
-
var
|
|
1525
|
+
var import_react11 = __toESM(require("react"));
|
|
1526
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1480
1527
|
var MultilineTextInput = (props) => {
|
|
1481
1528
|
const textChangeHandler = (event) => {
|
|
1482
1529
|
const text = event.target.value;
|
|
@@ -1495,11 +1542,11 @@ var MultilineTextInput = (props) => {
|
|
|
1495
1542
|
if (props.value !== void 0 && props.value !== null) {
|
|
1496
1543
|
value = props.value;
|
|
1497
1544
|
}
|
|
1498
|
-
return /* @__PURE__ */ (0,
|
|
1499
|
-
/* @__PURE__ */ (0,
|
|
1545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react11.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block mb-1", children: [
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1500
1547
|
" ",
|
|
1501
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1548
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1503
1550
|
"textarea",
|
|
1504
1551
|
{
|
|
1505
1552
|
name: props.name,
|
|
@@ -1516,14 +1563,14 @@ var MultilineTextInput = (props) => {
|
|
|
1516
1563
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
1517
1564
|
}
|
|
1518
1565
|
),
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1520
1567
|
] }) });
|
|
1521
1568
|
};
|
|
1522
1569
|
var MultilineTextInput_default = MultilineTextInput;
|
|
1523
1570
|
|
|
1524
1571
|
// src/components/controls/edit/LineTextInput.tsx
|
|
1525
|
-
var
|
|
1526
|
-
var
|
|
1572
|
+
var import_react12 = __toESM(require("react"));
|
|
1573
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1527
1574
|
var LineTextInput = (props) => {
|
|
1528
1575
|
const textChangeHandler = (event) => {
|
|
1529
1576
|
const text = event.target.value;
|
|
@@ -1542,11 +1589,11 @@ var LineTextInput = (props) => {
|
|
|
1542
1589
|
if (props.value !== void 0 && props.value !== null) {
|
|
1543
1590
|
value = props.value;
|
|
1544
1591
|
}
|
|
1545
|
-
return /* @__PURE__ */ (0,
|
|
1546
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react12.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "block", children: [
|
|
1593
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1547
1594
|
" ",
|
|
1548
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1550
1597
|
"input",
|
|
1551
1598
|
{
|
|
1552
1599
|
type: "text",
|
|
@@ -1566,14 +1613,14 @@ var LineTextInput = (props) => {
|
|
|
1566
1613
|
`
|
|
1567
1614
|
}
|
|
1568
1615
|
),
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1570
1617
|
] }) });
|
|
1571
1618
|
};
|
|
1572
1619
|
var LineTextInput_default = LineTextInput;
|
|
1573
1620
|
|
|
1574
1621
|
// src/components/controls/edit/MoneyInput.tsx
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1622
|
+
var import_react13 = __toESM(require("react"));
|
|
1623
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1577
1624
|
var MoneyInput = (props) => {
|
|
1578
1625
|
const textChangeHandler = (event) => {
|
|
1579
1626
|
const rawValue = event.target.value;
|
|
@@ -1602,11 +1649,11 @@ var MoneyInput = (props) => {
|
|
|
1602
1649
|
e.preventDefault();
|
|
1603
1650
|
}
|
|
1604
1651
|
};
|
|
1605
|
-
return /* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "block mb-1", children: [
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1607
1654
|
" ",
|
|
1608
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1610
1657
|
"input",
|
|
1611
1658
|
{
|
|
1612
1659
|
type: "number",
|
|
@@ -1626,7 +1673,7 @@ var MoneyInput = (props) => {
|
|
|
1626
1673
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1627
1674
|
}
|
|
1628
1675
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1630
1677
|
] }) });
|
|
1631
1678
|
};
|
|
1632
1679
|
var MoneyInput_default = MoneyInput;
|
|
@@ -1656,10 +1703,10 @@ var InputControlType = {
|
|
|
1656
1703
|
var InputControlType_default = InputControlType;
|
|
1657
1704
|
|
|
1658
1705
|
// src/components/controls/edit/Select.tsx
|
|
1659
|
-
var
|
|
1660
|
-
var
|
|
1706
|
+
var import_react14 = require("react");
|
|
1707
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1661
1708
|
var Select = (props) => {
|
|
1662
|
-
const [list, setList] = (0,
|
|
1709
|
+
const [list, setList] = (0, import_react14.useState)([]);
|
|
1663
1710
|
const getSafeValue = (val) => {
|
|
1664
1711
|
if (val === null || val === void 0) return "";
|
|
1665
1712
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1688,7 +1735,7 @@ var Select = (props) => {
|
|
|
1688
1735
|
groupKey: props.groupKey
|
|
1689
1736
|
});
|
|
1690
1737
|
};
|
|
1691
|
-
(0,
|
|
1738
|
+
(0, import_react14.useEffect)(() => {
|
|
1692
1739
|
async function fetchData() {
|
|
1693
1740
|
if (props.dataset) {
|
|
1694
1741
|
setList(props.dataset);
|
|
@@ -1715,11 +1762,11 @@ var Select = (props) => {
|
|
|
1715
1762
|
props.dataSourceDependsOn
|
|
1716
1763
|
]);
|
|
1717
1764
|
const value = getSafeValue(props.value);
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
1719
|
-
props.attributes?.label && /* @__PURE__ */ (0,
|
|
1765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "block", children: [
|
|
1766
|
+
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
1720
1767
|
" ",
|
|
1721
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0,
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1723
1770
|
"select",
|
|
1724
1771
|
{
|
|
1725
1772
|
name: props.name,
|
|
@@ -1730,23 +1777,23 @@ var Select = (props) => {
|
|
|
1730
1777
|
disabled: props.attributes?.readOnly,
|
|
1731
1778
|
className: "peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",
|
|
1732
1779
|
children: [
|
|
1733
|
-
/* @__PURE__ */ (0,
|
|
1780
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1734
1781
|
list.map((item, index) => {
|
|
1735
1782
|
const keyField = props.dataKeyFieldName;
|
|
1736
1783
|
const textField = props.dataTextFieldName;
|
|
1737
|
-
return /* @__PURE__ */ (0,
|
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
1738
1785
|
})
|
|
1739
1786
|
]
|
|
1740
1787
|
}
|
|
1741
1788
|
),
|
|
1742
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
|
|
1743
1790
|
] });
|
|
1744
1791
|
};
|
|
1745
1792
|
var Select_default = Select;
|
|
1746
1793
|
|
|
1747
1794
|
// src/components/controls/edit/PercentageInput.tsx
|
|
1748
|
-
var
|
|
1749
|
-
var
|
|
1795
|
+
var import_react15 = __toESM(require("react"));
|
|
1796
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1750
1797
|
var PercentageInput = (props) => {
|
|
1751
1798
|
const textChangeHandler = (event) => {
|
|
1752
1799
|
const rawValue = event.target.value;
|
|
@@ -1775,11 +1822,11 @@ var PercentageInput = (props) => {
|
|
|
1775
1822
|
e.preventDefault();
|
|
1776
1823
|
}
|
|
1777
1824
|
};
|
|
1778
|
-
return /* @__PURE__ */ (0,
|
|
1779
|
-
/* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react15.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "block mb-1", children: [
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
1780
1827
|
" ",
|
|
1781
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1828
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1783
1830
|
"input",
|
|
1784
1831
|
{
|
|
1785
1832
|
type: "number",
|
|
@@ -1798,14 +1845,14 @@ var PercentageInput = (props) => {
|
|
|
1798
1845
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
1799
1846
|
}
|
|
1800
1847
|
),
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1802
1849
|
] }) });
|
|
1803
1850
|
};
|
|
1804
1851
|
var PercentageInput_default = PercentageInput;
|
|
1805
1852
|
|
|
1806
1853
|
// src/components/controls/edit/PhoneInput.tsx
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
1854
|
+
var import_react16 = __toESM(require("react"));
|
|
1855
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1809
1856
|
var PhoneInput = (props) => {
|
|
1810
1857
|
const textChangeHandler = (event) => {
|
|
1811
1858
|
const text = event.target.value;
|
|
@@ -1824,13 +1871,13 @@ var PhoneInput = (props) => {
|
|
|
1824
1871
|
if (props.value !== void 0 && props.value !== null) {
|
|
1825
1872
|
value = props.value;
|
|
1826
1873
|
}
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react16.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "block mb-1", children: [
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1829
1876
|
" ",
|
|
1830
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1877
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center rounded border ", children: [
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "px-3", children: props.prefix }),
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1834
1881
|
"input",
|
|
1835
1882
|
{
|
|
1836
1883
|
type: "text",
|
|
@@ -1848,14 +1895,14 @@ var PhoneInput = (props) => {
|
|
|
1848
1895
|
}
|
|
1849
1896
|
)
|
|
1850
1897
|
] }),
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1898
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1852
1899
|
] }) });
|
|
1853
1900
|
};
|
|
1854
1901
|
var PhoneInput_default = PhoneInput;
|
|
1855
1902
|
|
|
1856
1903
|
// src/components/controls/edit/NumberInput.tsx
|
|
1857
|
-
var
|
|
1858
|
-
var
|
|
1904
|
+
var import_react17 = __toESM(require("react"));
|
|
1905
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1859
1906
|
var NumberInput = (props) => {
|
|
1860
1907
|
const textChangeHandler = (event) => {
|
|
1861
1908
|
const text = event.target.value;
|
|
@@ -1878,11 +1925,11 @@ var NumberInput = (props) => {
|
|
|
1878
1925
|
if (props.value !== void 0 && props.value !== null) {
|
|
1879
1926
|
value = props.value;
|
|
1880
1927
|
}
|
|
1881
|
-
return /* @__PURE__ */ (0,
|
|
1882
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
1928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react17.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "block", children: [
|
|
1929
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
1883
1930
|
" ",
|
|
1884
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1885
|
-
/* @__PURE__ */ (0,
|
|
1931
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1886
1933
|
"input",
|
|
1887
1934
|
{
|
|
1888
1935
|
type: "number",
|
|
@@ -1901,14 +1948,14 @@ var NumberInput = (props) => {
|
|
|
1901
1948
|
className: "peer py-1.5 block w-full rounded shadow-sm number-input input\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
1902
1949
|
}
|
|
1903
1950
|
),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1905
1952
|
] }) });
|
|
1906
1953
|
};
|
|
1907
1954
|
var NumberInput_default = NumberInput;
|
|
1908
1955
|
|
|
1909
1956
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
1910
|
-
var
|
|
1911
|
-
var
|
|
1957
|
+
var import_react18 = __toESM(require("react"));
|
|
1958
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1912
1959
|
var CheckboxInput = (props) => {
|
|
1913
1960
|
const textChangeHandler = (event) => {
|
|
1914
1961
|
let text = event.target.checked;
|
|
@@ -1925,11 +1972,11 @@ var CheckboxInput = (props) => {
|
|
|
1925
1972
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
1926
1973
|
value = true;
|
|
1927
1974
|
}
|
|
1928
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "inline-block mb-1", children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
1930
1977
|
" ",
|
|
1931
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1933
1980
|
"input",
|
|
1934
1981
|
{
|
|
1935
1982
|
type: "checkbox",
|
|
@@ -1946,14 +1993,14 @@ var CheckboxInput = (props) => {
|
|
|
1946
1993
|
className: "peer mt-1 py-1.5 block rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
1947
1994
|
}
|
|
1948
1995
|
),
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
1950
1997
|
] }) });
|
|
1951
1998
|
};
|
|
1952
1999
|
var CheckboxInput_default = CheckboxInput;
|
|
1953
2000
|
|
|
1954
2001
|
// src/components/controls/edit/OtpInput.tsx
|
|
1955
|
-
var
|
|
1956
|
-
var
|
|
2002
|
+
var import_react19 = __toESM(require("react"));
|
|
2003
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1957
2004
|
var OtpInput = (props) => {
|
|
1958
2005
|
const textChangeHandler = (event) => {
|
|
1959
2006
|
const text = event.target.value;
|
|
@@ -1975,11 +2022,11 @@ var OtpInput = (props) => {
|
|
|
1975
2022
|
if (props.value !== void 0 && props.value !== null) {
|
|
1976
2023
|
value = props.value;
|
|
1977
2024
|
}
|
|
1978
|
-
return /* @__PURE__ */ (0,
|
|
1979
|
-
/* @__PURE__ */ (0,
|
|
2025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react19.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
1980
2027
|
" ",
|
|
1981
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
2028
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1983
2030
|
"input",
|
|
1984
2031
|
{
|
|
1985
2032
|
type: "text",
|
|
@@ -1999,14 +2046,14 @@ var OtpInput = (props) => {
|
|
|
1999
2046
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
2000
2047
|
}
|
|
2001
2048
|
),
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2003
2050
|
] }) });
|
|
2004
2051
|
};
|
|
2005
2052
|
var OtpInput_default = OtpInput;
|
|
2006
2053
|
|
|
2007
2054
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2055
|
+
var import_react20 = __toESM(require("react"));
|
|
2056
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2010
2057
|
var DateTimeInput = (props) => {
|
|
2011
2058
|
const textChangeHandler = (event) => {
|
|
2012
2059
|
const localDate = new Date(event.target.value);
|
|
@@ -2038,12 +2085,12 @@ var DateTimeInput = (props) => {
|
|
|
2038
2085
|
e.preventDefault();
|
|
2039
2086
|
}
|
|
2040
2087
|
};
|
|
2041
|
-
return /* @__PURE__ */ (0,
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react20.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "block mb-1", children: [
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2043
2090
|
" ",
|
|
2044
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2091
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2047
2094
|
"input",
|
|
2048
2095
|
{
|
|
2049
2096
|
type: "datetime-local",
|
|
@@ -2061,19 +2108,19 @@ var DateTimeInput = (props) => {
|
|
|
2061
2108
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
2062
2109
|
}
|
|
2063
2110
|
),
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: timeZoneAbbr })
|
|
2065
2112
|
] }),
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2067
2114
|
] }) });
|
|
2068
2115
|
};
|
|
2069
2116
|
var DateTimeInput_default = DateTimeInput;
|
|
2070
2117
|
|
|
2071
2118
|
// src/components/controls/edit/ColorInput.tsx
|
|
2072
|
-
var
|
|
2073
|
-
var
|
|
2119
|
+
var import_react21 = __toESM(require("react"));
|
|
2120
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2074
2121
|
var ColorInput = (props) => {
|
|
2075
|
-
const [color, setColor] =
|
|
2076
|
-
(0,
|
|
2122
|
+
const [color, setColor] = import_react21.default.useState("#3b82f6");
|
|
2123
|
+
(0, import_react21.useEffect)(() => {
|
|
2077
2124
|
if (props.value !== void 0 && props.value !== null) {
|
|
2078
2125
|
if (typeof props.value === "string") {
|
|
2079
2126
|
setColor(props.value);
|
|
@@ -2092,11 +2139,11 @@ var ColorInput = (props) => {
|
|
|
2092
2139
|
});
|
|
2093
2140
|
}
|
|
2094
2141
|
};
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "block mb-1", children: [
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2097
2144
|
" ",
|
|
2098
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2145
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2100
2147
|
"input",
|
|
2101
2148
|
{
|
|
2102
2149
|
type: "color",
|
|
@@ -2109,21 +2156,21 @@ var ColorInput = (props) => {
|
|
|
2109
2156
|
className: `w-[78px] h-12 block cursor-pointer`
|
|
2110
2157
|
}
|
|
2111
2158
|
),
|
|
2112
|
-
props?.attributes?.errorMessage && /* @__PURE__ */ (0,
|
|
2159
|
+
props?.attributes?.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 bg-error-weak text-sm", children: props.attributes.errorMessage })
|
|
2113
2160
|
] });
|
|
2114
2161
|
};
|
|
2115
2162
|
var ColorInput_default = ColorInput;
|
|
2116
2163
|
|
|
2117
2164
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2165
|
+
var import_react22 = require("react");
|
|
2166
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2120
2167
|
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,
|
|
2168
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
2169
|
+
const [searchTerm, setSearchTerm] = (0, import_react22.useState)("");
|
|
2170
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react22.useState)(-1);
|
|
2171
|
+
const [selectedItem, setSelectedItem] = (0, import_react22.useState)(null);
|
|
2172
|
+
const [list, setList] = (0, import_react22.useState)([]);
|
|
2173
|
+
(0, import_react22.useEffect)(() => {
|
|
2127
2174
|
async function fetchData() {
|
|
2128
2175
|
if (props.dataset) {
|
|
2129
2176
|
setList(props.dataset);
|
|
@@ -2177,8 +2224,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
2177
2224
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2178
2225
|
}
|
|
2179
2226
|
};
|
|
2180
|
-
const dropdownRef = (0,
|
|
2181
|
-
(0,
|
|
2227
|
+
const dropdownRef = (0, import_react22.useRef)(null);
|
|
2228
|
+
(0, import_react22.useEffect)(() => {
|
|
2182
2229
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2183
2230
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2184
2231
|
highlightedItem?.scrollIntoView({
|
|
@@ -2187,15 +2234,15 @@ var SelectWithSearchInput = (props) => {
|
|
|
2187
2234
|
});
|
|
2188
2235
|
}
|
|
2189
2236
|
}, [highlightedIndex]);
|
|
2190
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { children: [
|
|
2192
2239
|
props.attributes?.label,
|
|
2193
2240
|
" ",
|
|
2194
2241
|
" ",
|
|
2195
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2242
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2196
2243
|
] }),
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2199
2246
|
"input",
|
|
2200
2247
|
{
|
|
2201
2248
|
type: "text",
|
|
@@ -2211,13 +2258,13 @@ var SelectWithSearchInput = (props) => {
|
|
|
2211
2258
|
className: "peer py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
2212
2259
|
}
|
|
2213
2260
|
),
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2215
2262
|
"button",
|
|
2216
2263
|
{
|
|
2217
2264
|
type: "button",
|
|
2218
2265
|
onClick: () => setIsOpen(!isOpen),
|
|
2219
2266
|
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
2220
|
-
children: /* @__PURE__ */ (0,
|
|
2267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2221
2268
|
"svg",
|
|
2222
2269
|
{
|
|
2223
2270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2226,7 +2273,7 @@ var SelectWithSearchInput = (props) => {
|
|
|
2226
2273
|
strokeWidth: 1.5,
|
|
2227
2274
|
stroke: "currentColor",
|
|
2228
2275
|
className: "w-full h-full",
|
|
2229
|
-
children: /* @__PURE__ */ (0,
|
|
2276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2230
2277
|
"path",
|
|
2231
2278
|
{
|
|
2232
2279
|
strokeLinecap: "round",
|
|
@@ -2239,12 +2286,12 @@ var SelectWithSearchInput = (props) => {
|
|
|
2239
2286
|
}
|
|
2240
2287
|
)
|
|
2241
2288
|
] }),
|
|
2242
|
-
isOpen && /* @__PURE__ */ (0,
|
|
2289
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2243
2290
|
"div",
|
|
2244
2291
|
{
|
|
2245
2292
|
ref: dropdownRef,
|
|
2246
2293
|
className: "absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-48 overflow-y-auto",
|
|
2247
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2294
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2248
2295
|
"button",
|
|
2249
2296
|
{
|
|
2250
2297
|
onClick: (e) => handleSelect(e, item),
|
|
@@ -2252,10 +2299,10 @@ var SelectWithSearchInput = (props) => {
|
|
|
2252
2299
|
role: "option",
|
|
2253
2300
|
tabIndex: -1,
|
|
2254
2301
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2255
|
-
children: /* @__PURE__ */ (0,
|
|
2302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
2256
2303
|
},
|
|
2257
2304
|
item[props.dataKeyFieldName]
|
|
2258
|
-
)) : /* @__PURE__ */ (0,
|
|
2305
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2259
2306
|
}
|
|
2260
2307
|
)
|
|
2261
2308
|
] });
|
|
@@ -2264,22 +2311,22 @@ var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
|
2264
2311
|
|
|
2265
2312
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2266
2313
|
init_Button();
|
|
2267
|
-
var
|
|
2268
|
-
var
|
|
2314
|
+
var import_react26 = __toESM(require("react"));
|
|
2315
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2269
2316
|
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,
|
|
2317
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
|
|
2318
|
+
const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
|
|
2319
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(0);
|
|
2320
|
+
const [list, setList] = (0, import_react26.useState)([]);
|
|
2321
|
+
const listRef = (0, import_react26.useRef)(null);
|
|
2322
|
+
const [isError, setIsError] = (0, import_react26.useState)(false);
|
|
2323
|
+
const containerRef = (0, import_react26.useRef)(null);
|
|
2324
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react26.useState)(false);
|
|
2325
|
+
const [formData, setFormData] = (0, import_react26.useState)({});
|
|
2279
2326
|
const getNestedValue3 = (obj, path) => {
|
|
2280
2327
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
2281
2328
|
};
|
|
2282
|
-
(0,
|
|
2329
|
+
(0, import_react26.useEffect)(() => {
|
|
2283
2330
|
const handleClickOutside = (event) => {
|
|
2284
2331
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2285
2332
|
setIsOpen(false);
|
|
@@ -2290,7 +2337,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2290
2337
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2291
2338
|
};
|
|
2292
2339
|
}, []);
|
|
2293
|
-
(0,
|
|
2340
|
+
(0, import_react26.useEffect)(() => {
|
|
2294
2341
|
async function fetchData() {
|
|
2295
2342
|
if (props.dataset) {
|
|
2296
2343
|
setList(props.dataset);
|
|
@@ -2332,7 +2379,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2332
2379
|
audioCtx.close();
|
|
2333
2380
|
}, 250);
|
|
2334
2381
|
};
|
|
2335
|
-
(0,
|
|
2382
|
+
(0, import_react26.useEffect)(() => {
|
|
2336
2383
|
const filteredItems2 = list?.filter(
|
|
2337
2384
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
2338
2385
|
);
|
|
@@ -2397,18 +2444,18 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2397
2444
|
const handleInputChange = (event, field) => {
|
|
2398
2445
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
2399
2446
|
};
|
|
2400
|
-
const handleSaveModal = (0,
|
|
2447
|
+
const handleSaveModal = (0, import_react26.useCallback)(async () => {
|
|
2401
2448
|
console.log("Form Data:", formData);
|
|
2402
2449
|
return formData;
|
|
2403
2450
|
}, []);
|
|
2404
|
-
return /* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
2452
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "text-sm mb-1 font-medium", children: [
|
|
2406
2453
|
props.attributes?.label,
|
|
2407
2454
|
" ",
|
|
2408
2455
|
" ",
|
|
2409
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2456
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2410
2457
|
] }),
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2412
2459
|
"input",
|
|
2413
2460
|
{
|
|
2414
2461
|
type: "text",
|
|
@@ -2422,14 +2469,14 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2422
2469
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
2423
2470
|
}
|
|
2424
2471
|
) }),
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2427
|
-
/* @__PURE__ */ (0,
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react26.default.Fragment, { children: [
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
2428
2475
|
"Select a",
|
|
2429
2476
|
" ",
|
|
2430
2477
|
props.attributes?.label || props.attributes?.heading
|
|
2431
2478
|
] }) }),
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200 h-10", children: props.createFields && props.createFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2433
2480
|
"button",
|
|
2434
2481
|
{
|
|
2435
2482
|
type: "button",
|
|
@@ -2442,12 +2489,12 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2442
2489
|
}
|
|
2443
2490
|
) })
|
|
2444
2491
|
] }),
|
|
2445
|
-
isCreateOpen && /* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2492
|
+
isCreateOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fixed right-0 w-1/4 h-full top-[62px] bg-white shadow-lg border-l border-gray-200 z-50", children: [
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("h5", { className: "text-md font-medium text-white", children: [
|
|
2447
2494
|
"Create New ",
|
|
2448
2495
|
props.attributes?.label
|
|
2449
2496
|
] }) }),
|
|
2450
|
-
/* @__PURE__ */ (0,
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2451
2498
|
"button",
|
|
2452
2499
|
{
|
|
2453
2500
|
type: "button",
|
|
@@ -2456,10 +2503,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2456
2503
|
children: "Close"
|
|
2457
2504
|
}
|
|
2458
2505
|
) }),
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2460
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0,
|
|
2461
|
-
/* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-4", children: [
|
|
2507
|
+
props.createFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-4", children: [
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2463
2510
|
"input",
|
|
2464
2511
|
{
|
|
2465
2512
|
type: field.type,
|
|
@@ -2475,7 +2522,7 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2475
2522
|
}
|
|
2476
2523
|
)
|
|
2477
2524
|
] }, field.name)),
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Button_default, { onClick: async () => {
|
|
2479
2526
|
handleSaveModal();
|
|
2480
2527
|
return { isSuccessful: true };
|
|
2481
2528
|
}, className: "w-full", children: [
|
|
@@ -2484,13 +2531,13 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2484
2531
|
] })
|
|
2485
2532
|
] })
|
|
2486
2533
|
] }),
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2488
2535
|
"div",
|
|
2489
2536
|
{
|
|
2490
2537
|
ref: listRef,
|
|
2491
2538
|
className: "fixed z-10 right-0 mt-[130px] top-0 w-1/4 bg-white border-l border-gray-200 shadow-lg overflow-y-auto",
|
|
2492
2539
|
style: { height: "calc(100vh - 130px)" },
|
|
2493
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0,
|
|
2540
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2494
2541
|
"button",
|
|
2495
2542
|
{
|
|
2496
2543
|
onClick: (e) => {
|
|
@@ -2500,9 +2547,9 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2500
2547
|
role: "option",
|
|
2501
2548
|
tabIndex: -1,
|
|
2502
2549
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
2503
|
-
children: /* @__PURE__ */ (0,
|
|
2550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: getNestedValue3(item, props.dataTextFieldName) })
|
|
2504
2551
|
}
|
|
2505
|
-
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0,
|
|
2552
|
+
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
2506
2553
|
}
|
|
2507
2554
|
)
|
|
2508
2555
|
] }) })
|
|
@@ -2511,10 +2558,10 @@ var SelectWithSearchPanel = (props) => {
|
|
|
2511
2558
|
var SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
2512
2559
|
|
|
2513
2560
|
// src/components/controls/edit/BooleanSelect.tsx
|
|
2514
|
-
var
|
|
2515
|
-
var
|
|
2561
|
+
var import_react27 = __toESM(require("react"));
|
|
2562
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2516
2563
|
var BooleanSelect = (props) => {
|
|
2517
|
-
const [list, setList] = (0,
|
|
2564
|
+
const [list, setList] = (0, import_react27.useState)();
|
|
2518
2565
|
const textChangeHandler = (event) => {
|
|
2519
2566
|
const text = event.target.value;
|
|
2520
2567
|
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
@@ -2527,7 +2574,7 @@ var BooleanSelect = (props) => {
|
|
|
2527
2574
|
});
|
|
2528
2575
|
}
|
|
2529
2576
|
};
|
|
2530
|
-
(0,
|
|
2577
|
+
(0, import_react27.useEffect)(() => {
|
|
2531
2578
|
async function fetchData() {
|
|
2532
2579
|
console.log("in select");
|
|
2533
2580
|
if (props.dataset) {
|
|
@@ -2561,11 +2608,11 @@ var BooleanSelect = (props) => {
|
|
|
2561
2608
|
if (props.value !== void 0 && props.value !== null) {
|
|
2562
2609
|
value = props.value;
|
|
2563
2610
|
}
|
|
2564
|
-
return /* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react27.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "block", children: [
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2566
2613
|
" ",
|
|
2567
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2614
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2615
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2569
2616
|
"select",
|
|
2570
2617
|
{
|
|
2571
2618
|
name: props.name,
|
|
@@ -2577,9 +2624,9 @@ var BooleanSelect = (props) => {
|
|
|
2577
2624
|
disabled: props?.attributes?.readOnly,
|
|
2578
2625
|
className: "peer mt-1 py-1.5 block w-full text-black rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n ",
|
|
2579
2626
|
children: [
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
2581
2628
|
list && list.map((item, i) => {
|
|
2582
|
-
return /* @__PURE__ */ (0,
|
|
2629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2583
2630
|
"option",
|
|
2584
2631
|
{
|
|
2585
2632
|
className: "fac-select-option",
|
|
@@ -2592,14 +2639,14 @@ var BooleanSelect = (props) => {
|
|
|
2592
2639
|
]
|
|
2593
2640
|
}
|
|
2594
2641
|
),
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2596
2643
|
] }) });
|
|
2597
2644
|
};
|
|
2598
2645
|
var BooleanSelect_default = BooleanSelect;
|
|
2599
2646
|
|
|
2600
2647
|
// src/components/controls/edit/EmailInput.tsx
|
|
2601
|
-
var
|
|
2602
|
-
var
|
|
2648
|
+
var import_react28 = __toESM(require("react"));
|
|
2649
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2603
2650
|
var EmailInput = (props) => {
|
|
2604
2651
|
const textChangeHandler = (event) => {
|
|
2605
2652
|
const text = event.target.value;
|
|
@@ -2624,11 +2671,11 @@ var EmailInput = (props) => {
|
|
|
2624
2671
|
if (props.value !== void 0 && props.value !== null) {
|
|
2625
2672
|
value = props.value;
|
|
2626
2673
|
}
|
|
2627
|
-
return /* @__PURE__ */ (0,
|
|
2628
|
-
/* @__PURE__ */ (0,
|
|
2674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react28.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "block mb-1", children: [
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
2629
2676
|
" ",
|
|
2630
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2677
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2678
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2632
2679
|
"input",
|
|
2633
2680
|
{
|
|
2634
2681
|
type: "email",
|
|
@@ -2644,14 +2691,14 @@ var EmailInput = (props) => {
|
|
|
2644
2691
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
2645
2692
|
}
|
|
2646
2693
|
),
|
|
2647
|
-
/* @__PURE__ */ (0,
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 mb-0 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2648
2695
|
] }) });
|
|
2649
2696
|
};
|
|
2650
2697
|
var EmailInput_default = EmailInput;
|
|
2651
2698
|
|
|
2652
2699
|
// src/components/controls/edit/TimeInput.tsx
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2700
|
+
var import_react29 = __toESM(require("react"));
|
|
2701
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2655
2702
|
var TimeInput = (props) => {
|
|
2656
2703
|
const timeChangeHandler = (event) => {
|
|
2657
2704
|
const timeValue = event.target.value;
|
|
@@ -2664,11 +2711,11 @@ var TimeInput = (props) => {
|
|
|
2664
2711
|
});
|
|
2665
2712
|
}
|
|
2666
2713
|
};
|
|
2667
|
-
return /* @__PURE__ */ (0,
|
|
2668
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "block mb-1", children: [
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
2669
2716
|
" ",
|
|
2670
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2717
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2672
2719
|
"input",
|
|
2673
2720
|
{
|
|
2674
2721
|
type: "time",
|
|
@@ -2681,14 +2728,14 @@ var TimeInput = (props) => {
|
|
|
2681
2728
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none"
|
|
2682
2729
|
}
|
|
2683
2730
|
) }),
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
2685
2732
|
] }) });
|
|
2686
2733
|
};
|
|
2687
2734
|
var TimeInput_default = TimeInput;
|
|
2688
2735
|
|
|
2689
2736
|
// src/components/controls/edit/InputControl.tsx
|
|
2690
|
-
var
|
|
2691
|
-
var InputControl =
|
|
2737
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2738
|
+
var InputControl = import_react30.default.forwardRef(
|
|
2692
2739
|
(props, ref) => {
|
|
2693
2740
|
const ControlComponents = {
|
|
2694
2741
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -2709,58 +2756,58 @@ var InputControl = import_react29.default.forwardRef(
|
|
|
2709
2756
|
[InputControlType_default.timeInput]: TimeInput_default
|
|
2710
2757
|
};
|
|
2711
2758
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react30.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
|
|
2713
2760
|
}
|
|
2714
2761
|
);
|
|
2715
2762
|
InputControl.displayName = "InputControl";
|
|
2716
2763
|
var InputControl_default = InputControl;
|
|
2717
2764
|
|
|
2718
2765
|
// src/components/dataForm/DataList.tsx
|
|
2719
|
-
var
|
|
2766
|
+
var import_react33 = __toESM(require("react"));
|
|
2720
2767
|
var import_navigation = require("next/navigation");
|
|
2721
2768
|
|
|
2722
2769
|
// src/components/dataForm/NoContentView.tsx
|
|
2723
|
-
var
|
|
2724
|
-
var
|
|
2770
|
+
var import_react31 = __toESM(require("react"));
|
|
2771
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2725
2772
|
var NoContentView = (props) => {
|
|
2726
|
-
return /* @__PURE__ */ (0,
|
|
2773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react31.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
2727
2774
|
};
|
|
2728
2775
|
var NoContentView_default = NoContentView;
|
|
2729
2776
|
|
|
2730
2777
|
// src/components/dataForm/ContentView.tsx
|
|
2731
|
-
var
|
|
2732
|
-
var
|
|
2778
|
+
var import_react32 = __toESM(require("react"));
|
|
2779
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2733
2780
|
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,
|
|
2781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react32.default.Fragment, { children: [
|
|
2782
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
2783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ml-2", children: [
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
2741
2788
|
] })
|
|
2742
2789
|
] }),
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2745
|
-
/* @__PURE__ */ (0,
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
2749
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2795
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2750
2797
|
] }),
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2752
|
-
/* @__PURE__ */ (0,
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2755
|
-
/* @__PURE__ */ (0,
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2757
2804
|
] }),
|
|
2758
|
-
/* @__PURE__ */ (0,
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2760
|
-
/* @__PURE__ */ (0,
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
2762
|
-
/* @__PURE__ */ (0,
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "animate-pulse", children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
2810
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
2764
2811
|
] })
|
|
2765
2812
|
] })
|
|
2766
2813
|
] }) }),
|
|
@@ -2772,7 +2819,7 @@ var ContentView_default = ContentView;
|
|
|
2772
2819
|
// src/components/dataForm/Hyperlink.tsx
|
|
2773
2820
|
var import_link = __toESM(require("next/link"));
|
|
2774
2821
|
init_StyleTypes();
|
|
2775
|
-
var
|
|
2822
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2776
2823
|
function Hyperlink(props) {
|
|
2777
2824
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : "";
|
|
2778
2825
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -2780,7 +2827,7 @@ function Hyperlink(props) {
|
|
|
2780
2827
|
if (target == "_blank") {
|
|
2781
2828
|
additionalProps.rel = "noopener noreferrer";
|
|
2782
2829
|
}
|
|
2783
|
-
return /* @__PURE__ */ (0,
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: props.href ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2784
2831
|
import_link.default,
|
|
2785
2832
|
{
|
|
2786
2833
|
href: props.href,
|
|
@@ -2790,7 +2837,7 @@ function Hyperlink(props) {
|
|
|
2790
2837
|
target,
|
|
2791
2838
|
children: props.children
|
|
2792
2839
|
}
|
|
2793
|
-
) : props.isHeading ? /* @__PURE__ */ (0,
|
|
2840
|
+
) : props.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: props.className, children: props.children }) });
|
|
2794
2841
|
}
|
|
2795
2842
|
|
|
2796
2843
|
// src/components/dataForm/DataList.tsx
|
|
@@ -2951,30 +2998,30 @@ var OdataBuilder = class {
|
|
|
2951
2998
|
};
|
|
2952
2999
|
|
|
2953
3000
|
// src/svg/chevron-updown.tsx
|
|
2954
|
-
var
|
|
3001
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2955
3002
|
var ChevronUpDown = (props) => {
|
|
2956
|
-
return /* @__PURE__ */ (0,
|
|
3003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) });
|
|
2957
3004
|
};
|
|
2958
3005
|
var chevron_updown_default = ChevronUpDown;
|
|
2959
3006
|
|
|
2960
3007
|
// src/svg/chevron-down.tsx
|
|
2961
|
-
var
|
|
3008
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2962
3009
|
var ChevronDown = (props) => {
|
|
2963
|
-
return /* @__PURE__ */ (0,
|
|
3010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) });
|
|
2964
3011
|
};
|
|
2965
3012
|
var chevron_down_default = ChevronDown;
|
|
2966
3013
|
|
|
2967
3014
|
// src/svg/chevron-up.tsx
|
|
2968
|
-
var
|
|
3015
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2969
3016
|
var ChevronUp = (props) => {
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) });
|
|
2971
3018
|
};
|
|
2972
3019
|
var chevron_up_default = ChevronUp;
|
|
2973
3020
|
|
|
2974
3021
|
// src/svg/plus.tsx
|
|
2975
|
-
var
|
|
3022
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2976
3023
|
var Plus = (props) => {
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
3024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) });
|
|
2978
3025
|
};
|
|
2979
3026
|
var plus_default = Plus;
|
|
2980
3027
|
|
|
@@ -2988,14 +3035,14 @@ var Icons = {
|
|
|
2988
3035
|
var Icons_default = Icons;
|
|
2989
3036
|
|
|
2990
3037
|
// src/svg/Icon.tsx
|
|
2991
|
-
var
|
|
3038
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2992
3039
|
var Icon = ({ name, className, ...props }) => {
|
|
2993
3040
|
const IconComponent = Icons_default[name];
|
|
2994
3041
|
if (!IconComponent) {
|
|
2995
3042
|
console.error(`Icon "${name}" not found.`);
|
|
2996
3043
|
return null;
|
|
2997
3044
|
}
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
3045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconComponent, { ...props, className });
|
|
2999
3046
|
};
|
|
3000
3047
|
var Icon_default = Icon;
|
|
3001
3048
|
|
|
@@ -3044,7 +3091,7 @@ function FormReducer(state, action) {
|
|
|
3044
3091
|
var FormReducer_default = FormReducer;
|
|
3045
3092
|
|
|
3046
3093
|
// src/components/dataForm/DataList.tsx
|
|
3047
|
-
var
|
|
3094
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3048
3095
|
var DataList = (props) => {
|
|
3049
3096
|
console.log(props.dataset, "datasetssssss");
|
|
3050
3097
|
const router = (0, import_navigation.useRouter)();
|
|
@@ -3053,8 +3100,8 @@ var DataList = (props) => {
|
|
|
3053
3100
|
let activePageNumber = 0;
|
|
3054
3101
|
let pages = 0;
|
|
3055
3102
|
console.log(props.addLinkText);
|
|
3056
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3057
|
-
(0,
|
|
3103
|
+
const [isDataFound, setIsDataFound] = (0, import_react33.useState)(null);
|
|
3104
|
+
(0, import_react33.useEffect)(() => {
|
|
3058
3105
|
if (props?.dataset) {
|
|
3059
3106
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
3060
3107
|
setIsDataFound(true);
|
|
@@ -3067,7 +3114,7 @@ var DataList = (props) => {
|
|
|
3067
3114
|
if (path.includes(".")) {
|
|
3068
3115
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
3069
3116
|
} else if (Array.isArray(obj[path])) {
|
|
3070
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
3117
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: item }, index));
|
|
3071
3118
|
} else {
|
|
3072
3119
|
return obj[path];
|
|
3073
3120
|
}
|
|
@@ -3076,8 +3123,8 @@ var DataList = (props) => {
|
|
|
3076
3123
|
inputValues: {},
|
|
3077
3124
|
lastPropertyChanged: ""
|
|
3078
3125
|
};
|
|
3079
|
-
const [formState, dispatch] = (0,
|
|
3080
|
-
const handleFilterChange = (0,
|
|
3126
|
+
const [formState, dispatch] = (0, import_react33.useReducer)(FormReducer_default, initialState);
|
|
3127
|
+
const handleFilterChange = (0, import_react33.useCallback)(
|
|
3081
3128
|
(updatedValues) => {
|
|
3082
3129
|
dispatch({
|
|
3083
3130
|
type: FORM_INPUT_UPDATE,
|
|
@@ -3123,30 +3170,30 @@ var DataList = (props) => {
|
|
|
3123
3170
|
const renderPageNumbers = () => {
|
|
3124
3171
|
if (pages <= 10) {
|
|
3125
3172
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
3126
|
-
(page) => /* @__PURE__ */ (0,
|
|
3173
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3127
3174
|
Hyperlink,
|
|
3128
3175
|
{
|
|
3129
3176
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3130
3177
|
href: builder.getNewPageUrl(page),
|
|
3131
3178
|
children: page
|
|
3132
3179
|
}
|
|
3133
|
-
) : /* @__PURE__ */ (0,
|
|
3180
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3134
3181
|
);
|
|
3135
3182
|
} else {
|
|
3136
3183
|
const showFirstPages = activePageNumber <= 5;
|
|
3137
3184
|
const showLastPages = activePageNumber > pages - 5;
|
|
3138
3185
|
if (showFirstPages) {
|
|
3139
|
-
return /* @__PURE__ */ (0,
|
|
3140
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
3186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3187
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3141
3188
|
Hyperlink,
|
|
3142
3189
|
{
|
|
3143
3190
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3144
3191
|
href: builder.getNewPageUrl(page),
|
|
3145
3192
|
children: page
|
|
3146
3193
|
}
|
|
3147
|
-
) : /* @__PURE__ */ (0,
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3194
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3150
3197
|
Hyperlink,
|
|
3151
3198
|
{
|
|
3152
3199
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3154,7 +3201,7 @@ var DataList = (props) => {
|
|
|
3154
3201
|
children: pages - 1
|
|
3155
3202
|
}
|
|
3156
3203
|
),
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3204
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3158
3205
|
Hyperlink,
|
|
3159
3206
|
{
|
|
3160
3207
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3162,7 +3209,7 @@ var DataList = (props) => {
|
|
|
3162
3209
|
children: pages
|
|
3163
3210
|
}
|
|
3164
3211
|
),
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3166
3213
|
"select",
|
|
3167
3214
|
{
|
|
3168
3215
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3174,18 +3221,18 @@ var DataList = (props) => {
|
|
|
3174
3221
|
}
|
|
3175
3222
|
},
|
|
3176
3223
|
children: [
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
3178
3225
|
Array.from(
|
|
3179
3226
|
{ length: Math.max(0, pages - 10) },
|
|
3180
3227
|
(_, index) => index + 9
|
|
3181
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3228
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3182
3229
|
]
|
|
3183
3230
|
}
|
|
3184
3231
|
) })
|
|
3185
3232
|
] });
|
|
3186
3233
|
} else if (showLastPages) {
|
|
3187
|
-
return /* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3189
3236
|
Hyperlink,
|
|
3190
3237
|
{
|
|
3191
3238
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3193,7 +3240,7 @@ var DataList = (props) => {
|
|
|
3193
3240
|
children: "1"
|
|
3194
3241
|
}
|
|
3195
3242
|
),
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3197
3244
|
Hyperlink,
|
|
3198
3245
|
{
|
|
3199
3246
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3201,21 +3248,21 @@ var DataList = (props) => {
|
|
|
3201
3248
|
children: "2"
|
|
3202
3249
|
}
|
|
3203
3250
|
),
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3205
3252
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
3206
|
-
(page) => /* @__PURE__ */ (0,
|
|
3253
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3207
3254
|
Hyperlink,
|
|
3208
3255
|
{
|
|
3209
3256
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3210
3257
|
href: builder.getNewPageUrl(page),
|
|
3211
3258
|
children: page
|
|
3212
3259
|
}
|
|
3213
|
-
) : /* @__PURE__ */ (0,
|
|
3260
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)
|
|
3214
3261
|
)
|
|
3215
3262
|
] });
|
|
3216
3263
|
} else {
|
|
3217
|
-
return /* @__PURE__ */ (0,
|
|
3218
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3219
3266
|
Hyperlink,
|
|
3220
3267
|
{
|
|
3221
3268
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3223,7 +3270,7 @@ var DataList = (props) => {
|
|
|
3223
3270
|
children: "1"
|
|
3224
3271
|
}
|
|
3225
3272
|
),
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3273
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3227
3274
|
Hyperlink,
|
|
3228
3275
|
{
|
|
3229
3276
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3231,20 +3278,20 @@ var DataList = (props) => {
|
|
|
3231
3278
|
children: "2"
|
|
3232
3279
|
}
|
|
3233
3280
|
),
|
|
3234
|
-
/* @__PURE__ */ (0,
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3235
3282
|
Array.from(
|
|
3236
3283
|
{ length: 5 },
|
|
3237
3284
|
(_, index) => activePageNumber - 2 + index
|
|
3238
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
3285
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3239
3286
|
Hyperlink,
|
|
3240
3287
|
{
|
|
3241
3288
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
3242
3289
|
href: builder.getNewPageUrl(page),
|
|
3243
3290
|
children: page
|
|
3244
3291
|
}
|
|
3245
|
-
) : /* @__PURE__ */ (0,
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3292
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary text-white", children: page }) }, page)),
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3248
3295
|
Hyperlink,
|
|
3249
3296
|
{
|
|
3250
3297
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3252,7 +3299,7 @@ var DataList = (props) => {
|
|
|
3252
3299
|
children: pages - 1
|
|
3253
3300
|
}
|
|
3254
3301
|
),
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3302
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3256
3303
|
Hyperlink,
|
|
3257
3304
|
{
|
|
3258
3305
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -3260,7 +3307,7 @@ var DataList = (props) => {
|
|
|
3260
3307
|
children: pages
|
|
3261
3308
|
}
|
|
3262
3309
|
),
|
|
3263
|
-
/* @__PURE__ */ (0,
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3264
3311
|
"select",
|
|
3265
3312
|
{
|
|
3266
3313
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -3272,8 +3319,8 @@ var DataList = (props) => {
|
|
|
3272
3319
|
}
|
|
3273
3320
|
},
|
|
3274
3321
|
children: [
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3276
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: "", children: "Jump to" }),
|
|
3323
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("option", { value: page, children: page }, page))
|
|
3277
3324
|
]
|
|
3278
3325
|
}
|
|
3279
3326
|
) })
|
|
@@ -3281,16 +3328,16 @@ var DataList = (props) => {
|
|
|
3281
3328
|
}
|
|
3282
3329
|
}
|
|
3283
3330
|
};
|
|
3284
|
-
return /* @__PURE__ */ (0,
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3286
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react33.default.Fragment, { children: [
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ContentView_default, { isDataFound, children: [
|
|
3333
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3287
3334
|
"div",
|
|
3288
3335
|
{
|
|
3289
3336
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200 sticky top-0`,
|
|
3290
3337
|
children: [
|
|
3291
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3293
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3338
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3340
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3294
3341
|
InputControl_default,
|
|
3295
3342
|
{
|
|
3296
3343
|
name: filter.name,
|
|
@@ -3305,15 +3352,15 @@ var DataList = (props) => {
|
|
|
3305
3352
|
},
|
|
3306
3353
|
filter.name
|
|
3307
3354
|
)),
|
|
3308
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3355
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3309
3356
|
Hyperlink,
|
|
3310
3357
|
{
|
|
3311
3358
|
className: "gap-1",
|
|
3312
3359
|
linkType: "Primary" /* Solid */,
|
|
3313
3360
|
href: props.addLinkHref,
|
|
3314
3361
|
children: [
|
|
3315
|
-
/* @__PURE__ */ (0,
|
|
3316
|
-
/* @__PURE__ */ (0,
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3317
3364
|
]
|
|
3318
3365
|
}
|
|
3319
3366
|
)
|
|
@@ -3321,8 +3368,8 @@ var DataList = (props) => {
|
|
|
3321
3368
|
]
|
|
3322
3369
|
}
|
|
3323
3370
|
),
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
3372
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3326
3373
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3327
3374
|
let icon = "chevronUpDown";
|
|
3328
3375
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3332,36 +3379,36 @@ var DataList = (props) => {
|
|
|
3332
3379
|
icon = "chevronUp";
|
|
3333
3380
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3334
3381
|
}
|
|
3335
|
-
return /* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3336
3383
|
"th",
|
|
3337
3384
|
{
|
|
3338
3385
|
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,
|
|
3386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "!text-neutral-contrast ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-black", children: column.label }),
|
|
3388
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3342
3389
|
] }) })
|
|
3343
3390
|
},
|
|
3344
3391
|
column.name
|
|
3345
3392
|
);
|
|
3346
3393
|
}) }) }),
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
3348
3395
|
let validityClass = "";
|
|
3349
3396
|
console.log("dataitem", dataitem);
|
|
3350
3397
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
3351
3398
|
validityClass = "bg-alert-200";
|
|
3352
3399
|
}
|
|
3353
|
-
return /* @__PURE__ */ (0,
|
|
3400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
3354
3401
|
console.log("column", column);
|
|
3355
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3356
3403
|
"td",
|
|
3357
3404
|
{
|
|
3358
3405
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
3359
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
3406
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3360
3407
|
Hyperlink,
|
|
3361
3408
|
{
|
|
3362
3409
|
className: "",
|
|
3363
3410
|
href: `https://${dataitem[column.name]}`,
|
|
3364
|
-
children: /* @__PURE__ */ (0,
|
|
3411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3365
3412
|
ViewControl_default,
|
|
3366
3413
|
{
|
|
3367
3414
|
controlType: column.controlType,
|
|
@@ -3374,11 +3421,11 @@ var DataList = (props) => {
|
|
|
3374
3421
|
}
|
|
3375
3422
|
)
|
|
3376
3423
|
}
|
|
3377
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
3424
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3378
3425
|
Hyperlink,
|
|
3379
3426
|
{
|
|
3380
3427
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
3381
|
-
children: /* @__PURE__ */ (0,
|
|
3428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3382
3429
|
ViewControl_default,
|
|
3383
3430
|
{
|
|
3384
3431
|
controlType: column.controlType,
|
|
@@ -3388,7 +3435,7 @@ var DataList = (props) => {
|
|
|
3388
3435
|
}
|
|
3389
3436
|
)
|
|
3390
3437
|
}
|
|
3391
|
-
) : /* @__PURE__ */ (0,
|
|
3438
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3392
3439
|
ViewControl_default,
|
|
3393
3440
|
{
|
|
3394
3441
|
controlType: column.controlType,
|
|
@@ -3402,10 +3449,10 @@ var DataList = (props) => {
|
|
|
3402
3449
|
}) }, index);
|
|
3403
3450
|
}) })
|
|
3404
3451
|
] }) }),
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3406
|
-
/* @__PURE__ */ (0,
|
|
3407
|
-
/* @__PURE__ */ (0,
|
|
3408
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
3452
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-gray-700", children: label }),
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
3455
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3409
3456
|
Hyperlink,
|
|
3410
3457
|
{
|
|
3411
3458
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3413,9 +3460,9 @@ var DataList = (props) => {
|
|
|
3413
3460
|
children: "Prev"
|
|
3414
3461
|
}
|
|
3415
3462
|
),
|
|
3416
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
3463
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-l-md border border-gray-300 bg-gray-200 text-gray-500 hover:bg-gray-200", children: "Prev" }),
|
|
3417
3464
|
renderPageNumbers(),
|
|
3418
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
3465
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3419
3466
|
Hyperlink,
|
|
3420
3467
|
{
|
|
3421
3468
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -3423,19 +3470,19 @@ var DataList = (props) => {
|
|
|
3423
3470
|
children: "Next"
|
|
3424
3471
|
}
|
|
3425
3472
|
),
|
|
3426
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
3473
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
3427
3474
|
] })
|
|
3428
3475
|
] }) })
|
|
3429
3476
|
] }),
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3431
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
3478
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3432
3479
|
"div",
|
|
3433
3480
|
{
|
|
3434
3481
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200`,
|
|
3435
3482
|
children: [
|
|
3436
|
-
props.title ? /* @__PURE__ */ (0,
|
|
3437
|
-
/* @__PURE__ */ (0,
|
|
3438
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
3483
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3485
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3439
3486
|
InputControl_default,
|
|
3440
3487
|
{
|
|
3441
3488
|
name: filter.name,
|
|
@@ -3450,15 +3497,15 @@ var DataList = (props) => {
|
|
|
3450
3497
|
},
|
|
3451
3498
|
filter.name
|
|
3452
3499
|
)),
|
|
3453
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
3500
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3454
3501
|
Hyperlink,
|
|
3455
3502
|
{
|
|
3456
3503
|
className: "gap-1",
|
|
3457
3504
|
linkType: "Primary" /* Solid */,
|
|
3458
3505
|
href: props.addLinkHref,
|
|
3459
3506
|
children: [
|
|
3460
|
-
/* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
3462
3509
|
]
|
|
3463
3510
|
}
|
|
3464
3511
|
)
|
|
@@ -3466,8 +3513,8 @@ var DataList = (props) => {
|
|
|
3466
3513
|
]
|
|
3467
3514
|
}
|
|
3468
3515
|
),
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3470
|
-
/* @__PURE__ */ (0,
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
3471
3518
|
let url = builder.getNewOrderByUrl(column.name);
|
|
3472
3519
|
let icon = "chevronUpDown";
|
|
3473
3520
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -3477,33 +3524,142 @@ var DataList = (props) => {
|
|
|
3477
3524
|
icon = "chevronUp";
|
|
3478
3525
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
3479
3526
|
}
|
|
3480
|
-
return /* @__PURE__ */ (0,
|
|
3527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3481
3528
|
"th",
|
|
3482
3529
|
{
|
|
3483
3530
|
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,
|
|
3531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Hyperlink, { href: url, className: "text-body-950", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: column.label }),
|
|
3533
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
3487
3534
|
] }) })
|
|
3488
3535
|
},
|
|
3489
3536
|
column.name
|
|
3490
3537
|
);
|
|
3491
3538
|
}) }) }) }) }),
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
3493
3540
|
] })
|
|
3494
3541
|
] })
|
|
3495
3542
|
] });
|
|
3496
3543
|
};
|
|
3497
3544
|
var DataList_default = DataList;
|
|
3498
3545
|
|
|
3546
|
+
// src/components/dataForm/DataListRenderer.tsx
|
|
3547
|
+
var import_react34 = __toESM(require("react"));
|
|
3548
|
+
init_ServiceClient();
|
|
3549
|
+
var import_navigation2 = require("next/navigation");
|
|
3550
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3551
|
+
var viewControlMap = {
|
|
3552
|
+
number: ViewControlTypes.number,
|
|
3553
|
+
lineText: ViewControlTypes.lineText,
|
|
3554
|
+
multilineText: ViewControlTypes.multilineText,
|
|
3555
|
+
date: ViewControlTypes.date,
|
|
3556
|
+
boolean: ViewControlTypes.boolean
|
|
3557
|
+
};
|
|
3558
|
+
function resolveRoutePlaceholders(route, params) {
|
|
3559
|
+
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
3560
|
+
const value = params[key];
|
|
3561
|
+
if (value === void 0 || value === null) {
|
|
3562
|
+
console.warn(`No value found for route param: ${key}`);
|
|
3563
|
+
return "";
|
|
3564
|
+
}
|
|
3565
|
+
return value;
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
function mapApiToColumns(siteForm) {
|
|
3569
|
+
const cols = siteForm?.siteFormDataList?.siteFormDataListColumns ?? [];
|
|
3570
|
+
return cols.map((col) => ({
|
|
3571
|
+
label: col.label,
|
|
3572
|
+
name: col.columnName,
|
|
3573
|
+
controlType: viewControlMap[col.controlTypeCode] ?? ViewControlTypes.lineText,
|
|
3574
|
+
enableSorting: col.enableSorting ?? false,
|
|
3575
|
+
width: "w-2/12",
|
|
3576
|
+
showAsLink: col.showAsLink ?? false,
|
|
3577
|
+
linkUrlSegment: col.linkUrlSegment ?? void 0,
|
|
3578
|
+
emptyValueLabel: col.emptyValueLabel ?? void 0
|
|
3579
|
+
}));
|
|
3580
|
+
}
|
|
3581
|
+
function mapApiToFilters(siteForm) {
|
|
3582
|
+
const filter = siteForm?.siteFormDataList?.siteFormDataListFilters ?? [];
|
|
3583
|
+
return filter.map((fil) => ({
|
|
3584
|
+
placeholder: fil.placeholder,
|
|
3585
|
+
name: fil.columnName,
|
|
3586
|
+
servicePath: fil.serviceRoute,
|
|
3587
|
+
dataTextFieldName: fil.dataTextFieldName,
|
|
3588
|
+
controlType: SelectWithSearchInput_default,
|
|
3589
|
+
dataKeyFieldName: fil.dataKeyFieldName,
|
|
3590
|
+
dataTypeCode: fil.isKeyNumber ? "number" : "string"
|
|
3591
|
+
}));
|
|
3592
|
+
}
|
|
3593
|
+
var DataListRenderer = ({
|
|
3594
|
+
formDefinition,
|
|
3595
|
+
apiBaseUrl,
|
|
3596
|
+
session,
|
|
3597
|
+
params,
|
|
3598
|
+
query,
|
|
3599
|
+
path,
|
|
3600
|
+
widgetProps
|
|
3601
|
+
}) => {
|
|
3602
|
+
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
3603
|
+
const [columns, setColumns] = (0, import_react34.useState)([]);
|
|
3604
|
+
const [dataset, setDataset] = (0, import_react34.useState)();
|
|
3605
|
+
const [filter, setFilters] = (0, import_react34.useState)([]);
|
|
3606
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react34.useState)("");
|
|
3607
|
+
const [addLinkText, setAddLinkText] = (0, import_react34.useState)("");
|
|
3608
|
+
const [serviceRoute, setServiceRoute] = (0, import_react34.useState)("");
|
|
3609
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
3610
|
+
(0, import_react34.useEffect)(() => {
|
|
3611
|
+
if (!formDefinition) return;
|
|
3612
|
+
setColumns(mapApiToColumns(formDefinition));
|
|
3613
|
+
setFilters(mapApiToFilters(formDefinition));
|
|
3614
|
+
setServiceRoute(formDefinition?.siteFormDataList?.serviceRoute ?? "/");
|
|
3615
|
+
const rawAddLinkHref = formDefinition?.siteFormDataList?.addLinkHref ?? "";
|
|
3616
|
+
const resolvedAddLinkHref = resolveRoutePlaceholders(
|
|
3617
|
+
rawAddLinkHref,
|
|
3618
|
+
params
|
|
3619
|
+
);
|
|
3620
|
+
setAddLinkHref(resolvedAddLinkHref);
|
|
3621
|
+
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
3622
|
+
}, [formDefinition, params]);
|
|
3623
|
+
(0, import_react34.useEffect)(() => {
|
|
3624
|
+
const fetchData = async () => {
|
|
3625
|
+
if (!serviceRoute) return;
|
|
3626
|
+
let resolvedRoute = resolveRoutePlaceholders(serviceRoute, params);
|
|
3627
|
+
const queryString = OdataBuilder.getOdataQueryString(query);
|
|
3628
|
+
const separator = resolvedRoute.includes("?") ? "&" : "?";
|
|
3629
|
+
const finalUrl = resolvedRoute + (queryString ? separator + queryString : "");
|
|
3630
|
+
const result = await serviceClient.get(finalUrl);
|
|
3631
|
+
setDataset(result);
|
|
3632
|
+
};
|
|
3633
|
+
fetchData();
|
|
3634
|
+
}, [serviceRoute, query, params]);
|
|
3635
|
+
const [tabItem, setTabItem] = (0, import_react34.useState)();
|
|
3636
|
+
const activeTab = tabItem?.find((tab) => tab.isActive);
|
|
3637
|
+
const activeHref = activeTab ? resolveRoutePlaceholders(activeTab.landingPageUrl, params) : pathname;
|
|
3638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3639
|
+
DataList_default,
|
|
3640
|
+
{
|
|
3641
|
+
addLinkHref,
|
|
3642
|
+
addLinkText,
|
|
3643
|
+
title: (formDefinition?.formTitle || "") + "-V2",
|
|
3644
|
+
path,
|
|
3645
|
+
columns,
|
|
3646
|
+
dataset,
|
|
3647
|
+
filters: filter,
|
|
3648
|
+
serviceClient,
|
|
3649
|
+
query
|
|
3650
|
+
}
|
|
3651
|
+
) });
|
|
3652
|
+
};
|
|
3653
|
+
var DataListRenderer_default = DataListRenderer;
|
|
3654
|
+
|
|
3499
3655
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3500
|
-
var
|
|
3656
|
+
var import_react53 = __toESM(require("react"));
|
|
3501
3657
|
|
|
3502
3658
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3503
|
-
var
|
|
3659
|
+
var import_react39 = __toESM(require("react"));
|
|
3504
3660
|
|
|
3505
3661
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
3506
|
-
var
|
|
3662
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3507
3663
|
var TextNode = (props) => {
|
|
3508
3664
|
function cssStringToJson(cssString) {
|
|
3509
3665
|
const styleObject = {};
|
|
@@ -3561,32 +3717,32 @@ var TextNode = (props) => {
|
|
|
3561
3717
|
});
|
|
3562
3718
|
}
|
|
3563
3719
|
function renderWithLineBreaks(text) {
|
|
3564
|
-
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0,
|
|
3720
|
+
return text.split("\n").map((line, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
3565
3721
|
line,
|
|
3566
|
-
index < arr.length - 1 && /* @__PURE__ */ (0,
|
|
3722
|
+
index < arr.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("br", {})
|
|
3567
3723
|
] }, index));
|
|
3568
3724
|
}
|
|
3569
3725
|
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
3570
3726
|
const finalText = props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text;
|
|
3571
3727
|
return (
|
|
3572
3728
|
// @ts-expect-error custom code
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: typeof finalText === "string" ? renderWithLineBreaks(finalText) : finalText })
|
|
3574
3730
|
);
|
|
3575
3731
|
};
|
|
3576
3732
|
var TextNode_default = TextNode;
|
|
3577
3733
|
|
|
3578
3734
|
// src/components/pageRenderingEngine/nodes/LineBreakNode.tsx
|
|
3579
|
-
var
|
|
3735
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3580
3736
|
var LineBreakNode = () => {
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "py-0.5 lg:py-1.5" });
|
|
3582
3738
|
};
|
|
3583
3739
|
var LineBreakNode_default = LineBreakNode;
|
|
3584
3740
|
|
|
3585
3741
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3586
|
-
var
|
|
3742
|
+
var import_react38 = __toESM(require("react"));
|
|
3587
3743
|
|
|
3588
3744
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3589
|
-
var
|
|
3745
|
+
var import_react36 = __toESM(require("react"));
|
|
3590
3746
|
|
|
3591
3747
|
// src/components/utilities/AssetUtility.tsx
|
|
3592
3748
|
var AssetUtility = class {
|
|
@@ -3614,7 +3770,7 @@ var import_dynamic = __toESM(require("next/dynamic"));
|
|
|
3614
3770
|
|
|
3615
3771
|
// src/components/DeviceAssetSelector.tsx
|
|
3616
3772
|
init_HlsPlayer();
|
|
3617
|
-
var
|
|
3773
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3618
3774
|
var DeviceAssetSelector = ({
|
|
3619
3775
|
assets,
|
|
3620
3776
|
assetBaseUrl,
|
|
@@ -3689,7 +3845,7 @@ var DeviceAssetSelector = ({
|
|
|
3689
3845
|
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3690
3846
|
const renderMedia = () => {
|
|
3691
3847
|
if (isHls) {
|
|
3692
|
-
return /* @__PURE__ */ (0,
|
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3693
3849
|
HlsPlayer_default,
|
|
3694
3850
|
{
|
|
3695
3851
|
assetUrl: resolvedAssetUrl,
|
|
@@ -3706,7 +3862,7 @@ var DeviceAssetSelector = ({
|
|
|
3706
3862
|
} else {
|
|
3707
3863
|
return (
|
|
3708
3864
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3710
3866
|
"img",
|
|
3711
3867
|
{
|
|
3712
3868
|
style: styles,
|
|
@@ -3722,17 +3878,17 @@ var DeviceAssetSelector = ({
|
|
|
3722
3878
|
}
|
|
3723
3879
|
};
|
|
3724
3880
|
if (width) {
|
|
3725
|
-
return /* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3726
3882
|
}
|
|
3727
3883
|
if (nodeProps?.format) {
|
|
3728
|
-
return /* @__PURE__ */ (0,
|
|
3884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3729
3885
|
}
|
|
3730
3886
|
return renderMedia();
|
|
3731
3887
|
};
|
|
3732
3888
|
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3733
3889
|
|
|
3734
3890
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3735
|
-
var
|
|
3891
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3736
3892
|
var HlsPlayer2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3737
3893
|
ssr: false
|
|
3738
3894
|
});
|
|
@@ -3775,7 +3931,7 @@ var ImageNode = (props) => {
|
|
|
3775
3931
|
console.error("Error parsing assets in ImageNode:", error);
|
|
3776
3932
|
}
|
|
3777
3933
|
if (assets && assets.length > 0) {
|
|
3778
|
-
return /* @__PURE__ */ (0,
|
|
3934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3779
3935
|
DeviceAssetSelector_default,
|
|
3780
3936
|
{
|
|
3781
3937
|
device: props.device,
|
|
@@ -3824,7 +3980,7 @@ var ImageNode = (props) => {
|
|
|
3824
3980
|
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3825
3981
|
const renderMedia = () => {
|
|
3826
3982
|
if (isHls) {
|
|
3827
|
-
return /* @__PURE__ */ (0,
|
|
3983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3828
3984
|
HlsPlayer2,
|
|
3829
3985
|
{
|
|
3830
3986
|
assetUrl: imageUrl,
|
|
@@ -3839,7 +3995,7 @@ var ImageNode = (props) => {
|
|
|
3839
3995
|
}
|
|
3840
3996
|
);
|
|
3841
3997
|
} else {
|
|
3842
|
-
return /* @__PURE__ */ (0,
|
|
3998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react36.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3843
3999
|
"img",
|
|
3844
4000
|
{
|
|
3845
4001
|
style: styles,
|
|
@@ -3854,7 +4010,7 @@ var ImageNode = (props) => {
|
|
|
3854
4010
|
}
|
|
3855
4011
|
};
|
|
3856
4012
|
if (props.node.width) {
|
|
3857
|
-
return /* @__PURE__ */ (0,
|
|
4013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3858
4014
|
}
|
|
3859
4015
|
return renderMedia();
|
|
3860
4016
|
};
|
|
@@ -3863,7 +4019,7 @@ var ImageNode_default = ImageNode;
|
|
|
3863
4019
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3864
4020
|
init_StyleTypes();
|
|
3865
4021
|
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3866
|
-
var
|
|
4022
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3867
4023
|
var LinkNodeButton2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3868
4024
|
ssr: false
|
|
3869
4025
|
});
|
|
@@ -3910,13 +4066,13 @@ var LinkNode = (props) => {
|
|
|
3910
4066
|
const isButton = node.isButton === true;
|
|
3911
4067
|
const renderChildren = () => {
|
|
3912
4068
|
if (!node.children || node.children.length === 0) return null;
|
|
3913
|
-
return /* @__PURE__ */ (0,
|
|
4069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: node.children.map((childNode, index) => {
|
|
3914
4070
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
3915
4071
|
if (!SelectedNode) {
|
|
3916
4072
|
console.warn("Unknown node type:", childNode.type);
|
|
3917
4073
|
return null;
|
|
3918
4074
|
}
|
|
3919
|
-
return /* @__PURE__ */ (0,
|
|
4075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react38.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3920
4076
|
SelectedNode,
|
|
3921
4077
|
{
|
|
3922
4078
|
node: childNode,
|
|
@@ -3929,15 +4085,15 @@ var LinkNode = (props) => {
|
|
|
3929
4085
|
};
|
|
3930
4086
|
const renderFallback = () => {
|
|
3931
4087
|
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3932
|
-
return /* @__PURE__ */ (0,
|
|
4088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: linkText });
|
|
3933
4089
|
}
|
|
3934
4090
|
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3935
|
-
return /* @__PURE__ */ (0,
|
|
4091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("br", {});
|
|
3936
4092
|
}
|
|
3937
4093
|
return null;
|
|
3938
4094
|
};
|
|
3939
4095
|
if (isButton) {
|
|
3940
|
-
return /* @__PURE__ */ (0,
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3941
4097
|
LinkNodeButton2,
|
|
3942
4098
|
{
|
|
3943
4099
|
node,
|
|
@@ -3955,7 +4111,7 @@ var LinkNode = (props) => {
|
|
|
3955
4111
|
}
|
|
3956
4112
|
);
|
|
3957
4113
|
}
|
|
3958
|
-
return /* @__PURE__ */ (0,
|
|
4114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3959
4115
|
Hyperlink,
|
|
3960
4116
|
{
|
|
3961
4117
|
href: linkUrl || "#",
|
|
@@ -3971,10 +4127,10 @@ var LinkNode = (props) => {
|
|
|
3971
4127
|
var LinkNode_default = LinkNode;
|
|
3972
4128
|
|
|
3973
4129
|
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3974
|
-
var
|
|
4130
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3975
4131
|
var SVGIconNode = ({ node }) => {
|
|
3976
4132
|
if (!node?.svgCode) return null;
|
|
3977
|
-
return /* @__PURE__ */ (0,
|
|
4133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3978
4134
|
"span",
|
|
3979
4135
|
{
|
|
3980
4136
|
style: {
|
|
@@ -3991,7 +4147,7 @@ var SVGIconNode_default = SVGIconNode;
|
|
|
3991
4147
|
|
|
3992
4148
|
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3993
4149
|
var import_katex = __toESM(require("katex"));
|
|
3994
|
-
var
|
|
4150
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3995
4151
|
var EquationNode = ({ node }) => {
|
|
3996
4152
|
const { equation, inline } = node;
|
|
3997
4153
|
let html = "";
|
|
@@ -4006,7 +4162,7 @@ var EquationNode = ({ node }) => {
|
|
|
4006
4162
|
});
|
|
4007
4163
|
}
|
|
4008
4164
|
if (inline) {
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4010
4166
|
"span",
|
|
4011
4167
|
{
|
|
4012
4168
|
className: "katex-inline",
|
|
@@ -4014,7 +4170,7 @@ var EquationNode = ({ node }) => {
|
|
|
4014
4170
|
}
|
|
4015
4171
|
);
|
|
4016
4172
|
}
|
|
4017
|
-
return /* @__PURE__ */ (0,
|
|
4173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4018
4174
|
"div",
|
|
4019
4175
|
{
|
|
4020
4176
|
className: "katex-block my-3 text-center",
|
|
@@ -4025,7 +4181,7 @@ var EquationNode = ({ node }) => {
|
|
|
4025
4181
|
var EquationNode_default = EquationNode;
|
|
4026
4182
|
|
|
4027
4183
|
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
4028
|
-
var
|
|
4184
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4029
4185
|
function getNestedProperty(obj, path) {
|
|
4030
4186
|
if (!obj || !path) return null;
|
|
4031
4187
|
if (path.includes(".")) {
|
|
@@ -4038,7 +4194,7 @@ function getNestedProperty(obj, path) {
|
|
|
4038
4194
|
}
|
|
4039
4195
|
const value = obj[path];
|
|
4040
4196
|
if (Array.isArray(value)) {
|
|
4041
|
-
return value.map((item, index) => /* @__PURE__ */ (0,
|
|
4197
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: String(item) }, index));
|
|
4042
4198
|
}
|
|
4043
4199
|
return value;
|
|
4044
4200
|
}
|
|
@@ -4099,7 +4255,7 @@ var DatafieldNode = (props) => {
|
|
|
4099
4255
|
const dataType = props.node.dataType;
|
|
4100
4256
|
if (isEmptyValue) return null;
|
|
4101
4257
|
if (dataType === "rawContent") {
|
|
4102
|
-
return /* @__PURE__ */ (0,
|
|
4258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4103
4259
|
PageBodyRenderer_default,
|
|
4104
4260
|
{
|
|
4105
4261
|
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
@@ -4115,12 +4271,12 @@ var DatafieldNode = (props) => {
|
|
|
4115
4271
|
}
|
|
4116
4272
|
);
|
|
4117
4273
|
}
|
|
4118
|
-
return /* @__PURE__ */ (0,
|
|
4274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4119
4275
|
"span",
|
|
4120
4276
|
{
|
|
4121
4277
|
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
4122
4278
|
style: styles,
|
|
4123
|
-
children: /* @__PURE__ */ (0,
|
|
4279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4124
4280
|
ViewControl_default,
|
|
4125
4281
|
{
|
|
4126
4282
|
controlType: dataType,
|
|
@@ -4133,7 +4289,7 @@ var DatafieldNode = (props) => {
|
|
|
4133
4289
|
var DatafieldNode_default = DatafieldNode;
|
|
4134
4290
|
|
|
4135
4291
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4136
|
-
var
|
|
4292
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4137
4293
|
var ParagraphNode = (props) => {
|
|
4138
4294
|
const NodeTypes2 = {
|
|
4139
4295
|
["text"]: TextNode_default,
|
|
@@ -4153,9 +4309,9 @@ var ParagraphNode = (props) => {
|
|
|
4153
4309
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
4154
4310
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
4155
4311
|
if (isInlineOnlyParent) {
|
|
4156
|
-
return /* @__PURE__ */ (0,
|
|
4312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
4157
4313
|
const SelectedNode = NodeTypes2[node.type];
|
|
4158
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4159
4315
|
SelectedNode,
|
|
4160
4316
|
{
|
|
4161
4317
|
node,
|
|
@@ -4167,10 +4323,10 @@ var ParagraphNode = (props) => {
|
|
|
4167
4323
|
) }, index);
|
|
4168
4324
|
}) });
|
|
4169
4325
|
}
|
|
4170
|
-
return /* @__PURE__ */ (0,
|
|
4326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: " " + formatClasses, children: [
|
|
4171
4327
|
hasChildren && props.node.children.map((node, index) => {
|
|
4172
4328
|
const SelectedNode = NodeTypes2[node.type];
|
|
4173
|
-
return /* @__PURE__ */ (0,
|
|
4329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4174
4330
|
SelectedNode,
|
|
4175
4331
|
{
|
|
4176
4332
|
node,
|
|
@@ -4181,14 +4337,14 @@ var ParagraphNode = (props) => {
|
|
|
4181
4337
|
}
|
|
4182
4338
|
) }, index);
|
|
4183
4339
|
}),
|
|
4184
|
-
!hasChildren && /* @__PURE__ */ (0,
|
|
4340
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
4185
4341
|
] });
|
|
4186
4342
|
};
|
|
4187
4343
|
var ParagraphNode_default = ParagraphNode;
|
|
4188
4344
|
|
|
4189
4345
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
4190
|
-
var
|
|
4191
|
-
var
|
|
4346
|
+
var import_react40 = __toESM(require("react"));
|
|
4347
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4192
4348
|
var HeadingNode = (props) => {
|
|
4193
4349
|
const NodeTypes2 = {
|
|
4194
4350
|
["text"]: TextNode_default,
|
|
@@ -4204,23 +4360,23 @@ var HeadingNode = (props) => {
|
|
|
4204
4360
|
{
|
|
4205
4361
|
}
|
|
4206
4362
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
4207
|
-
return /* @__PURE__ */ (0,
|
|
4363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: import_react40.default.createElement(
|
|
4208
4364
|
HeadingTag,
|
|
4209
4365
|
{ className: formatClasses },
|
|
4210
4366
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
4211
4367
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4213
4369
|
})
|
|
4214
4370
|
) });
|
|
4215
4371
|
};
|
|
4216
4372
|
var HeadingNode_default = HeadingNode;
|
|
4217
4373
|
|
|
4218
4374
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4219
|
-
var
|
|
4375
|
+
var import_react42 = __toESM(require("react"));
|
|
4220
4376
|
|
|
4221
4377
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
4222
|
-
var
|
|
4223
|
-
var
|
|
4378
|
+
var import_react41 = __toESM(require("react"));
|
|
4379
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4224
4380
|
var ListItemNode = (props) => {
|
|
4225
4381
|
const NodeTypes2 = {
|
|
4226
4382
|
text: TextNode_default,
|
|
@@ -4237,66 +4393,66 @@ var ListItemNode = (props) => {
|
|
|
4237
4393
|
liStyle.fontSize = match[1].trim();
|
|
4238
4394
|
}
|
|
4239
4395
|
}
|
|
4240
|
-
return /* @__PURE__ */ (0,
|
|
4396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
4241
4397
|
const SelectedNode = NodeTypes2[node.type];
|
|
4242
4398
|
if (node.type === "linebreak") {
|
|
4243
4399
|
if (!foundFirstBreak) {
|
|
4244
4400
|
foundFirstBreak = true;
|
|
4245
|
-
return /* @__PURE__ */ (0,
|
|
4401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", {}, index);
|
|
4246
4402
|
} else {
|
|
4247
|
-
return /* @__PURE__ */ (0,
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
4248
4404
|
}
|
|
4249
4405
|
} else {
|
|
4250
4406
|
foundFirstBreak = false;
|
|
4251
|
-
return /* @__PURE__ */ (0,
|
|
4407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4252
4408
|
}
|
|
4253
4409
|
}) });
|
|
4254
4410
|
};
|
|
4255
4411
|
var ListItemNode_default = ListItemNode;
|
|
4256
4412
|
|
|
4257
4413
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4258
|
-
var
|
|
4414
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4259
4415
|
var ListNode = (props) => {
|
|
4260
4416
|
const NodeTypes2 = {
|
|
4261
4417
|
listitem: ListItemNode_default
|
|
4262
4418
|
};
|
|
4263
|
-
return /* @__PURE__ */ (0,
|
|
4264
|
-
props.node.listType == "bullet" && /* @__PURE__ */ (0,
|
|
4419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react42.default.Fragment, { children: [
|
|
4420
|
+
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4265
4421
|
const SelectedNode = NodeTypes2[node.type];
|
|
4266
|
-
return /* @__PURE__ */ (0,
|
|
4422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4267
4423
|
}) }),
|
|
4268
|
-
props.node.listType == "number" && /* @__PURE__ */ (0,
|
|
4424
|
+
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4269
4425
|
const SelectedNode = NodeTypes2[node.type];
|
|
4270
|
-
return /* @__PURE__ */ (0,
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4271
4427
|
}) })
|
|
4272
4428
|
] });
|
|
4273
4429
|
};
|
|
4274
4430
|
var ListNode_default = ListNode;
|
|
4275
4431
|
|
|
4276
4432
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4277
|
-
var
|
|
4278
|
-
var
|
|
4433
|
+
var import_react43 = __toESM(require("react"));
|
|
4434
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4279
4435
|
var QuoteNode = (props) => {
|
|
4280
4436
|
const NodeTypes2 = {
|
|
4281
4437
|
["text"]: TextNode_default,
|
|
4282
4438
|
["linebreak"]: LineBreakNode_default,
|
|
4283
4439
|
["link"]: LinkNode_default
|
|
4284
4440
|
};
|
|
4285
|
-
return /* @__PURE__ */ (0,
|
|
4441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4286
4442
|
const SelectedNode = NodeTypes2[node.type];
|
|
4287
|
-
return /* @__PURE__ */ (0,
|
|
4443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4288
4444
|
}) });
|
|
4289
4445
|
};
|
|
4290
4446
|
var QuoteNode_default = QuoteNode;
|
|
4291
4447
|
|
|
4292
4448
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4293
|
-
var
|
|
4449
|
+
var import_react45 = __toESM(require("react"));
|
|
4294
4450
|
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
4295
|
-
var
|
|
4451
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4296
4452
|
var CopyButton2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4297
4453
|
ssr: false,
|
|
4298
4454
|
// optional: fallback UI while loading
|
|
4299
|
-
loading: () => /* @__PURE__ */ (0,
|
|
4455
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4300
4456
|
});
|
|
4301
4457
|
var CodeNode = (props) => {
|
|
4302
4458
|
const NodeTypes2 = {
|
|
@@ -4310,14 +4466,14 @@ var CodeNode = (props) => {
|
|
|
4310
4466
|
if (node.type === "link") return node.text || node.url || "";
|
|
4311
4467
|
return "";
|
|
4312
4468
|
}).join("") ?? "";
|
|
4313
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4316
|
-
/* @__PURE__ */ (0,
|
|
4469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
4470
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: "Code Snippet" }),
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CopyButton2, { text: textContent })
|
|
4317
4473
|
] }),
|
|
4318
|
-
/* @__PURE__ */ (0,
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
4319
4475
|
const SelectedNode = NodeTypes2[node.type];
|
|
4320
|
-
return /* @__PURE__ */ (0,
|
|
4476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react45.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4321
4477
|
SelectedNode,
|
|
4322
4478
|
{
|
|
4323
4479
|
node,
|
|
@@ -4332,15 +4488,15 @@ var CodeNode = (props) => {
|
|
|
4332
4488
|
var CodeNode_default = CodeNode;
|
|
4333
4489
|
|
|
4334
4490
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
4335
|
-
var
|
|
4491
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4336
4492
|
var HorizontalRuleNode = () => {
|
|
4337
|
-
return /* @__PURE__ */ (0,
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("hr", {});
|
|
4338
4494
|
};
|
|
4339
4495
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4340
4496
|
|
|
4341
4497
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4342
|
-
var
|
|
4343
|
-
var
|
|
4498
|
+
var import_react46 = __toESM(require("react"));
|
|
4499
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4344
4500
|
var WidgetNode = (props) => {
|
|
4345
4501
|
const getWidgetParameters = () => {
|
|
4346
4502
|
const widgetInputParameters = {
|
|
@@ -4397,7 +4553,7 @@ var WidgetNode = (props) => {
|
|
|
4397
4553
|
};
|
|
4398
4554
|
const widgetCode = props.node?.widgetCode;
|
|
4399
4555
|
if (!widgetCode) {
|
|
4400
|
-
return /* @__PURE__ */ (0,
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: "Invalid widget" });
|
|
4401
4557
|
}
|
|
4402
4558
|
const widgetParams = getWidgetParameters();
|
|
4403
4559
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -4406,7 +4562,7 @@ var WidgetNode = (props) => {
|
|
|
4406
4562
|
}
|
|
4407
4563
|
return (
|
|
4408
4564
|
// eslint-disable-next-line react-hooks/static-components
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4410
4566
|
WidgetRenderer,
|
|
4411
4567
|
{
|
|
4412
4568
|
params: widgetParams,
|
|
@@ -4423,12 +4579,12 @@ var WidgetNode = (props) => {
|
|
|
4423
4579
|
var WidgetNode_default = WidgetNode;
|
|
4424
4580
|
|
|
4425
4581
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4426
|
-
var
|
|
4582
|
+
var import_react47 = __toESM(require("react"));
|
|
4427
4583
|
|
|
4428
4584
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
4429
|
-
var
|
|
4585
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4430
4586
|
var InputControlNode = (props) => {
|
|
4431
|
-
return /* @__PURE__ */ (0,
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4432
4588
|
InputControl_default,
|
|
4433
4589
|
{
|
|
4434
4590
|
name: props.node.name,
|
|
@@ -4458,22 +4614,22 @@ var InputControlNode_default = InputControlNode;
|
|
|
4458
4614
|
|
|
4459
4615
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4460
4616
|
init_ServiceClient();
|
|
4461
|
-
var
|
|
4617
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4462
4618
|
var FormContainerNode = (props) => {
|
|
4463
4619
|
const NodeTypes2 = {
|
|
4464
4620
|
["input-control"]: InputControlNode_default
|
|
4465
4621
|
};
|
|
4466
4622
|
const { node } = props;
|
|
4467
|
-
const formRef = (0,
|
|
4623
|
+
const formRef = (0, import_react47.useRef)(null);
|
|
4468
4624
|
const initialState = {
|
|
4469
4625
|
inputValues: {},
|
|
4470
4626
|
lastPropertyChanged: ""
|
|
4471
4627
|
};
|
|
4472
|
-
const [formState, dispatch] = (0,
|
|
4473
|
-
const handleInputChange = (0,
|
|
4628
|
+
const [formState, dispatch] = (0, import_react47.useReducer)(FormReducer_default, initialState);
|
|
4629
|
+
const handleInputChange = (0, import_react47.useCallback)((updatedValues) => {
|
|
4474
4630
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4475
4631
|
}, [dispatch]);
|
|
4476
|
-
(0,
|
|
4632
|
+
(0, import_react47.useEffect)(() => {
|
|
4477
4633
|
const fetchInitialData = async () => {
|
|
4478
4634
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4479
4635
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4488,12 +4644,12 @@ var FormContainerNode = (props) => {
|
|
|
4488
4644
|
};
|
|
4489
4645
|
fetchInitialData();
|
|
4490
4646
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4491
|
-
return /* @__PURE__ */ (0,
|
|
4647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
4492
4648
|
node.children && node.children.map((node2, index) => {
|
|
4493
4649
|
{
|
|
4494
4650
|
}
|
|
4495
4651
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react47.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4497
4653
|
InputControlNode_default,
|
|
4498
4654
|
{
|
|
4499
4655
|
value: formState.inputValues[node2.name],
|
|
@@ -4502,17 +4658,17 @@ var FormContainerNode = (props) => {
|
|
|
4502
4658
|
}
|
|
4503
4659
|
) }, index);
|
|
4504
4660
|
}),
|
|
4505
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
4661
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
4506
4662
|
] });
|
|
4507
4663
|
};
|
|
4508
4664
|
var FormContainerNode_default = FormContainerNode;
|
|
4509
4665
|
|
|
4510
4666
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4511
|
-
var
|
|
4667
|
+
var import_react52 = __toESM(require("react"));
|
|
4512
4668
|
|
|
4513
4669
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4514
4670
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
4515
|
-
var
|
|
4671
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4516
4672
|
var IframeClient2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4517
4673
|
ssr: false
|
|
4518
4674
|
});
|
|
@@ -4525,7 +4681,7 @@ var EmbedNode = (props) => {
|
|
|
4525
4681
|
} else {
|
|
4526
4682
|
src = props.node.embedSrc;
|
|
4527
4683
|
}
|
|
4528
|
-
return /* @__PURE__ */ (0,
|
|
4684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(IframeClient2, { src }) });
|
|
4529
4685
|
};
|
|
4530
4686
|
var EmbedNode_default = EmbedNode;
|
|
4531
4687
|
|
|
@@ -4533,8 +4689,8 @@ var EmbedNode_default = EmbedNode;
|
|
|
4533
4689
|
init_ServiceClient();
|
|
4534
4690
|
|
|
4535
4691
|
// src/components/Slider.tsx
|
|
4536
|
-
var
|
|
4537
|
-
var
|
|
4692
|
+
var import_react50 = __toESM(require("react"));
|
|
4693
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4538
4694
|
var Slider = ({
|
|
4539
4695
|
children,
|
|
4540
4696
|
slidesToShow = 4,
|
|
@@ -4552,13 +4708,13 @@ var Slider = ({
|
|
|
4552
4708
|
pillStyle = "cumulative",
|
|
4553
4709
|
progressPosition = "bottom"
|
|
4554
4710
|
}) => {
|
|
4555
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4556
|
-
const [transition, setTransition] = (0,
|
|
4557
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4711
|
+
const [currentSlide, setCurrentSlide] = (0, import_react50.useState)(0);
|
|
4712
|
+
const [transition, setTransition] = (0, import_react50.useState)(true);
|
|
4713
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react50.useState)(
|
|
4558
4714
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4559
4715
|
);
|
|
4560
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4561
|
-
(0,
|
|
4716
|
+
const [isPlaying, setIsPlaying] = (0, import_react50.useState)(autoplay);
|
|
4717
|
+
(0, import_react50.useEffect)(() => {
|
|
4562
4718
|
if (typeof slidesToShow === "number") return;
|
|
4563
4719
|
const handleResize = () => {
|
|
4564
4720
|
if (window.innerWidth >= 1024) {
|
|
@@ -4573,7 +4729,7 @@ var Slider = ({
|
|
|
4573
4729
|
window.addEventListener("resize", handleResize);
|
|
4574
4730
|
return () => window.removeEventListener("resize", handleResize);
|
|
4575
4731
|
}, [slidesToShow]);
|
|
4576
|
-
(0,
|
|
4732
|
+
(0, import_react50.useEffect)(() => {
|
|
4577
4733
|
if (!autoplay) return;
|
|
4578
4734
|
const timer = setInterval(() => {
|
|
4579
4735
|
if (isPlaying) {
|
|
@@ -4582,7 +4738,7 @@ var Slider = ({
|
|
|
4582
4738
|
}, autoplay_speed);
|
|
4583
4739
|
return () => clearInterval(timer);
|
|
4584
4740
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4585
|
-
const totalSlides =
|
|
4741
|
+
const totalSlides = import_react50.Children.count(children);
|
|
4586
4742
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4587
4743
|
const nextSlide = () => {
|
|
4588
4744
|
if (currentSlide >= maxSlide) {
|
|
@@ -4627,16 +4783,16 @@ var Slider = ({
|
|
|
4627
4783
|
}
|
|
4628
4784
|
};
|
|
4629
4785
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4630
|
-
const slides =
|
|
4631
|
-
if (!
|
|
4786
|
+
const slides = import_react50.Children.map(children, (child, index) => {
|
|
4787
|
+
if (!import_react50.default.isValidElement(child)) return null;
|
|
4632
4788
|
const childProps = child.props;
|
|
4633
4789
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4634
|
-
return /* @__PURE__ */ (0,
|
|
4790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4635
4791
|
"div",
|
|
4636
4792
|
{
|
|
4637
4793
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4638
4794
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4639
|
-
children: (0,
|
|
4795
|
+
children: (0, import_react50.cloneElement)(child, {
|
|
4640
4796
|
className: mergedClassName
|
|
4641
4797
|
})
|
|
4642
4798
|
},
|
|
@@ -4654,14 +4810,14 @@ var Slider = ({
|
|
|
4654
4810
|
return "bottom-4";
|
|
4655
4811
|
}
|
|
4656
4812
|
};
|
|
4657
|
-
return /* @__PURE__ */ (0,
|
|
4813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4658
4814
|
"div",
|
|
4659
4815
|
{
|
|
4660
4816
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4661
4817
|
onMouseEnter: handleMouseEnter,
|
|
4662
4818
|
onMouseLeave: handleMouseLeave,
|
|
4663
4819
|
children: [
|
|
4664
|
-
/* @__PURE__ */ (0,
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4665
4821
|
"div",
|
|
4666
4822
|
{
|
|
4667
4823
|
className: "flex h-full",
|
|
@@ -4672,18 +4828,18 @@ var Slider = ({
|
|
|
4672
4828
|
children: slides
|
|
4673
4829
|
}
|
|
4674
4830
|
),
|
|
4675
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4676
|
-
/* @__PURE__ */ (0,
|
|
4831
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4677
4833
|
ArrowButton,
|
|
4678
4834
|
{
|
|
4679
4835
|
direction: "left",
|
|
4680
4836
|
onClick: prevSlide,
|
|
4681
4837
|
visible: infinite_scroll || currentSlide > 0,
|
|
4682
4838
|
className: arrowClassName,
|
|
4683
|
-
children: /* @__PURE__ */ (0,
|
|
4839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4684
4840
|
}
|
|
4685
4841
|
),
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4687
4843
|
ArrowButton,
|
|
4688
4844
|
{
|
|
4689
4845
|
direction: "right",
|
|
@@ -4691,13 +4847,13 @@ var Slider = ({
|
|
|
4691
4847
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4692
4848
|
className: arrowClassName,
|
|
4693
4849
|
children: [
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4695
4851
|
" "
|
|
4696
4852
|
]
|
|
4697
4853
|
}
|
|
4698
4854
|
)
|
|
4699
4855
|
] }),
|
|
4700
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4856
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4701
4857
|
ProgressPill,
|
|
4702
4858
|
{
|
|
4703
4859
|
active: index === currentSlide,
|
|
@@ -4723,7 +4879,7 @@ var ArrowButton = ({
|
|
|
4723
4879
|
visible,
|
|
4724
4880
|
children,
|
|
4725
4881
|
className = ""
|
|
4726
|
-
}) => /* @__PURE__ */ (0,
|
|
4882
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4727
4883
|
"button",
|
|
4728
4884
|
{
|
|
4729
4885
|
className: `
|
|
@@ -4749,13 +4905,13 @@ var ProgressPill = ({
|
|
|
4749
4905
|
currentSlide,
|
|
4750
4906
|
totalSlides
|
|
4751
4907
|
}) => {
|
|
4752
|
-
const [progress, setProgress] = (0,
|
|
4753
|
-
(0,
|
|
4908
|
+
const [progress, setProgress] = (0, import_react50.useState)(0);
|
|
4909
|
+
(0, import_react50.useEffect)(() => {
|
|
4754
4910
|
if (active) {
|
|
4755
4911
|
setProgress(0);
|
|
4756
4912
|
}
|
|
4757
4913
|
}, [active, index]);
|
|
4758
|
-
(0,
|
|
4914
|
+
(0, import_react50.useEffect)(() => {
|
|
4759
4915
|
if (!active || !isPlaying) {
|
|
4760
4916
|
if (!active) {
|
|
4761
4917
|
setProgress(0);
|
|
@@ -4810,7 +4966,7 @@ var ProgressPill = ({
|
|
|
4810
4966
|
const renderProgressBar = () => {
|
|
4811
4967
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4812
4968
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4813
|
-
return /* @__PURE__ */ (0,
|
|
4969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4814
4970
|
"div",
|
|
4815
4971
|
{
|
|
4816
4972
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -4822,7 +4978,7 @@ var ProgressPill = ({
|
|
|
4822
4978
|
};
|
|
4823
4979
|
const renderCumulativeFill = () => {
|
|
4824
4980
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4825
|
-
return /* @__PURE__ */ (0,
|
|
4981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4826
4982
|
"div",
|
|
4827
4983
|
{
|
|
4828
4984
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4832,7 +4988,7 @@ var ProgressPill = ({
|
|
|
4832
4988
|
}
|
|
4833
4989
|
return null;
|
|
4834
4990
|
};
|
|
4835
|
-
return /* @__PURE__ */ (0,
|
|
4991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4836
4992
|
"button",
|
|
4837
4993
|
{
|
|
4838
4994
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -5008,10 +5164,10 @@ var PathUtility = class {
|
|
|
5008
5164
|
var PathUtility_default = new PathUtility();
|
|
5009
5165
|
|
|
5010
5166
|
// src/components/NoDataFound.tsx
|
|
5011
|
-
var
|
|
5167
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5012
5168
|
var NoDataFound = () => {
|
|
5013
|
-
return /* @__PURE__ */ (0,
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5015
5171
|
"svg",
|
|
5016
5172
|
{
|
|
5017
5173
|
className: "w-10 h-10",
|
|
@@ -5019,7 +5175,7 @@ var NoDataFound = () => {
|
|
|
5019
5175
|
stroke: "currentColor",
|
|
5020
5176
|
viewBox: "0 0 24 24",
|
|
5021
5177
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5022
|
-
children: /* @__PURE__ */ (0,
|
|
5178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5023
5179
|
"path",
|
|
5024
5180
|
{
|
|
5025
5181
|
strokeLinecap: "round",
|
|
@@ -5030,19 +5186,19 @@ var NoDataFound = () => {
|
|
|
5030
5186
|
)
|
|
5031
5187
|
}
|
|
5032
5188
|
) }) }),
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5189
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
5035
5191
|
] });
|
|
5036
5192
|
};
|
|
5037
5193
|
var NoDataFound_default = NoDataFound;
|
|
5038
5194
|
|
|
5039
5195
|
// src/components/Pagination.tsx
|
|
5040
|
-
var
|
|
5196
|
+
var import_react51 = require("react");
|
|
5041
5197
|
init_StyleTypes();
|
|
5042
|
-
var
|
|
5198
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5043
5199
|
var Pagination = (props) => {
|
|
5044
5200
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5045
|
-
const builder = (0,
|
|
5201
|
+
const builder = (0, import_react51.useMemo)(() => {
|
|
5046
5202
|
const b = new OdataBuilder(path);
|
|
5047
5203
|
if (query) b.setQuery(query);
|
|
5048
5204
|
return b;
|
|
@@ -5083,7 +5239,7 @@ var Pagination = (props) => {
|
|
|
5083
5239
|
return range;
|
|
5084
5240
|
};
|
|
5085
5241
|
const paginationRange = getPaginationRange();
|
|
5086
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
5242
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5087
5243
|
Hyperlink,
|
|
5088
5244
|
{
|
|
5089
5245
|
linkType: "Link" /* Link */,
|
|
@@ -5098,9 +5254,9 @@ var Pagination = (props) => {
|
|
|
5098
5254
|
);
|
|
5099
5255
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
5100
5256
|
if (disabled) {
|
|
5101
|
-
return /* @__PURE__ */ (0,
|
|
5257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
5102
5258
|
}
|
|
5103
|
-
return /* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5104
5260
|
Hyperlink,
|
|
5105
5261
|
{
|
|
5106
5262
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
|
|
@@ -5110,35 +5266,35 @@ var Pagination = (props) => {
|
|
|
5110
5266
|
);
|
|
5111
5267
|
};
|
|
5112
5268
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
5113
|
-
return /* @__PURE__ */ (0,
|
|
5114
|
-
/* @__PURE__ */ (0,
|
|
5115
|
-
/* @__PURE__ */ (0,
|
|
5269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
5270
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "text-sm", children: [
|
|
5116
5272
|
"Showing ",
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "font-semibold", children: [
|
|
5118
5274
|
startItem,
|
|
5119
5275
|
"-",
|
|
5120
5276
|
endItem
|
|
5121
5277
|
] }),
|
|
5122
5278
|
" ",
|
|
5123
5279
|
"out of ",
|
|
5124
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
5125
5281
|
" results"
|
|
5126
5282
|
] }),
|
|
5127
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
5128
|
-
/* @__PURE__ */ (0,
|
|
5283
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5129
5285
|
NavigationButton,
|
|
5130
5286
|
{
|
|
5131
5287
|
page: activePageNumber - 1,
|
|
5132
5288
|
disabled: activePageNumber === 1,
|
|
5133
5289
|
children: [
|
|
5134
|
-
/* @__PURE__ */ (0,
|
|
5135
|
-
/* @__PURE__ */ (0,
|
|
5290
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
5291
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
5136
5292
|
]
|
|
5137
5293
|
}
|
|
5138
5294
|
),
|
|
5139
5295
|
paginationRange.map((item, index) => {
|
|
5140
5296
|
if (item === "...") {
|
|
5141
|
-
return /* @__PURE__ */ (0,
|
|
5297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5142
5298
|
"span",
|
|
5143
5299
|
{
|
|
5144
5300
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -5148,23 +5304,23 @@ var Pagination = (props) => {
|
|
|
5148
5304
|
);
|
|
5149
5305
|
}
|
|
5150
5306
|
const page = item;
|
|
5151
|
-
return /* @__PURE__ */ (0,
|
|
5307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PageButton, { page, children: page }, page);
|
|
5152
5308
|
}),
|
|
5153
|
-
/* @__PURE__ */ (0,
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5154
5310
|
NavigationButton,
|
|
5155
5311
|
{
|
|
5156
5312
|
page: activePageNumber + 1,
|
|
5157
5313
|
disabled: activePageNumber === totalPages,
|
|
5158
5314
|
children: [
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5160
|
-
/* @__PURE__ */ (0,
|
|
5315
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
5316
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
5161
5317
|
]
|
|
5162
5318
|
}
|
|
5163
5319
|
)
|
|
5164
5320
|
] }),
|
|
5165
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
5166
|
-
/* @__PURE__ */ (0,
|
|
5167
|
-
/* @__PURE__ */ (0,
|
|
5321
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
5323
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5168
5324
|
"input",
|
|
5169
5325
|
{
|
|
5170
5326
|
type: "number",
|
|
@@ -5185,9 +5341,9 @@ var Pagination = (props) => {
|
|
|
5185
5341
|
) })
|
|
5186
5342
|
] })
|
|
5187
5343
|
] }),
|
|
5188
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
5189
|
-
/* @__PURE__ */ (0,
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5344
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
5345
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
5346
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5191
5347
|
Hyperlink,
|
|
5192
5348
|
{
|
|
5193
5349
|
className: `
|
|
@@ -5199,7 +5355,7 @@ var Pagination = (props) => {
|
|
|
5199
5355
|
},
|
|
5200
5356
|
size
|
|
5201
5357
|
)) }),
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5358
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm", children: "per page" })
|
|
5203
5359
|
] }) })
|
|
5204
5360
|
] });
|
|
5205
5361
|
};
|
|
@@ -5207,7 +5363,7 @@ var Pagination_default = Pagination;
|
|
|
5207
5363
|
|
|
5208
5364
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5209
5365
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5210
|
-
var
|
|
5366
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5211
5367
|
var HlsPlayer3 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5212
5368
|
var deviceToMediaQuery = (device) => {
|
|
5213
5369
|
switch (device) {
|
|
@@ -5276,8 +5432,8 @@ var ImageGalleryNode = (props) => {
|
|
|
5276
5432
|
right: "justify-end"
|
|
5277
5433
|
};
|
|
5278
5434
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5279
|
-
return /* @__PURE__ */ (0,
|
|
5280
|
-
hlsSources.length > 0 && /* @__PURE__ */ (0,
|
|
5435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
5436
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5281
5437
|
HlsPlayer3,
|
|
5282
5438
|
{
|
|
5283
5439
|
sources: hlsSources,
|
|
@@ -5291,14 +5447,14 @@ var ImageGalleryNode = (props) => {
|
|
|
5291
5447
|
session: props.session
|
|
5292
5448
|
}
|
|
5293
5449
|
) }),
|
|
5294
|
-
staticFallback && /* @__PURE__ */ (0,
|
|
5450
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("picture", { children: [
|
|
5295
5451
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5296
5452
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5297
5453
|
if (!match) return null;
|
|
5298
5454
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5299
5455
|
if (!srcUrl) return null;
|
|
5300
5456
|
const mediaQuery = deviceToMediaQuery(match.device);
|
|
5301
|
-
return /* @__PURE__ */ (0,
|
|
5457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5302
5458
|
"source",
|
|
5303
5459
|
{
|
|
5304
5460
|
media: mediaQuery,
|
|
@@ -5322,7 +5478,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5322
5478
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5323
5479
|
return (
|
|
5324
5480
|
// eslint-disable-next-line @next/next/no-img-element
|
|
5325
|
-
/* @__PURE__ */ (0,
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5326
5482
|
"img",
|
|
5327
5483
|
{
|
|
5328
5484
|
loading: "lazy",
|
|
@@ -5343,7 +5499,7 @@ var ImageGalleryNode_default = ImageGalleryNode;
|
|
|
5343
5499
|
|
|
5344
5500
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5345
5501
|
var import_link2 = __toESM(require("next/link"));
|
|
5346
|
-
var
|
|
5502
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5347
5503
|
function toCamelCase(str) {
|
|
5348
5504
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
5349
5505
|
}
|
|
@@ -5548,7 +5704,7 @@ var DivContainer = async (props) => {
|
|
|
5548
5704
|
response = await serviceClient.get(endpoint);
|
|
5549
5705
|
result = response?.result;
|
|
5550
5706
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5551
|
-
return /* @__PURE__ */ (0,
|
|
5707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NoDataFound_default, {});
|
|
5552
5708
|
}
|
|
5553
5709
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5554
5710
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5565,7 +5721,7 @@ var DivContainer = async (props) => {
|
|
|
5565
5721
|
}
|
|
5566
5722
|
const SelectedNode = NodeTypes2[node.type];
|
|
5567
5723
|
if (!SelectedNode) return null;
|
|
5568
|
-
return /* @__PURE__ */ (0,
|
|
5724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5569
5725
|
SelectedNode,
|
|
5570
5726
|
{
|
|
5571
5727
|
node,
|
|
@@ -5667,9 +5823,9 @@ var DivContainer = async (props) => {
|
|
|
5667
5823
|
props.node.autoFormat && "auto-format",
|
|
5668
5824
|
props.node.bgClass
|
|
5669
5825
|
].filter(Boolean).join(" ");
|
|
5670
|
-
return /* @__PURE__ */ (0,
|
|
5671
|
-
/* @__PURE__ */ (0,
|
|
5672
|
-
/* @__PURE__ */ (0,
|
|
5826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react52.default.Fragment, { children: [
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5673
5829
|
Wrapper,
|
|
5674
5830
|
{
|
|
5675
5831
|
id: guid,
|
|
@@ -5678,18 +5834,18 @@ var DivContainer = async (props) => {
|
|
|
5678
5834
|
...wrapperProps,
|
|
5679
5835
|
children: dataToRender.map(
|
|
5680
5836
|
(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,
|
|
5837
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react52.default.Fragment, { children: child }, i)
|
|
5682
5838
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5683
5839
|
)
|
|
5684
5840
|
}
|
|
5685
5841
|
) }),
|
|
5686
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
5842
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
5687
5843
|
] });
|
|
5688
5844
|
};
|
|
5689
5845
|
var DivContainer_default = DivContainer;
|
|
5690
5846
|
|
|
5691
5847
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5692
|
-
var
|
|
5848
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5693
5849
|
var NodeTypes = {
|
|
5694
5850
|
["paragraph"]: ParagraphNode_default,
|
|
5695
5851
|
["heading"]: HeadingNode_default,
|
|
@@ -5717,11 +5873,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5717
5873
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5718
5874
|
rootNode = pageBodyTree.root;
|
|
5719
5875
|
}
|
|
5720
|
-
return /* @__PURE__ */ (0,
|
|
5876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5721
5877
|
{
|
|
5722
5878
|
}
|
|
5723
5879
|
const SelectedNode = NodeTypes[node.type];
|
|
5724
|
-
return /* @__PURE__ */ (0,
|
|
5880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5725
5881
|
SelectedNode,
|
|
5726
5882
|
{
|
|
5727
5883
|
node,
|
|
@@ -5737,7 +5893,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5737
5893
|
device: props.device,
|
|
5738
5894
|
widgetRenderer: props.widgetRenderer
|
|
5739
5895
|
}
|
|
5740
|
-
) }) : /* @__PURE__ */ (0,
|
|
5896
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5741
5897
|
SelectedNode,
|
|
5742
5898
|
{
|
|
5743
5899
|
node,
|
|
@@ -5758,13 +5914,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5758
5914
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5759
5915
|
|
|
5760
5916
|
// src/components/Toast.tsx
|
|
5761
|
-
var
|
|
5917
|
+
var import_react54 = require("react");
|
|
5762
5918
|
init_ToastService();
|
|
5763
|
-
var
|
|
5919
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5764
5920
|
var Toast = () => {
|
|
5765
|
-
const [showToast, setShowToast] = (0,
|
|
5766
|
-
const [message, setMessage] = (0,
|
|
5767
|
-
const [messageType, setMessageType] = (0,
|
|
5921
|
+
const [showToast, setShowToast] = (0, import_react54.useState)(false);
|
|
5922
|
+
const [message, setMessage] = (0, import_react54.useState)("");
|
|
5923
|
+
const [messageType, setMessageType] = (0, import_react54.useState)("error");
|
|
5768
5924
|
ToastService_default.showError = function(message2) {
|
|
5769
5925
|
setShowToast(true);
|
|
5770
5926
|
setMessage(message2);
|
|
@@ -5803,8 +5959,8 @@ var Toast = () => {
|
|
|
5803
5959
|
const closeToast = () => {
|
|
5804
5960
|
setShowToast(false);
|
|
5805
5961
|
};
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5807
|
-
/* @__PURE__ */ (0,
|
|
5962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
5963
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5808
5964
|
"span",
|
|
5809
5965
|
{
|
|
5810
5966
|
className: "font-medium text-inherit text-sm",
|
|
@@ -5812,7 +5968,7 @@ var Toast = () => {
|
|
|
5812
5968
|
children: message
|
|
5813
5969
|
}
|
|
5814
5970
|
),
|
|
5815
|
-
/* @__PURE__ */ (0,
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5816
5972
|
"svg",
|
|
5817
5973
|
{
|
|
5818
5974
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5820,7 +5976,7 @@ var Toast = () => {
|
|
|
5820
5976
|
fill: "none",
|
|
5821
5977
|
viewBox: "0 0 24 24",
|
|
5822
5978
|
stroke: "currentColor",
|
|
5823
|
-
children: /* @__PURE__ */ (0,
|
|
5979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
5824
5980
|
}
|
|
5825
5981
|
) })
|
|
5826
5982
|
] }) }) });
|
|
@@ -5835,6 +5991,7 @@ init_ToastService();
|
|
|
5835
5991
|
CheckboxInput,
|
|
5836
5992
|
ColorInput,
|
|
5837
5993
|
DataList,
|
|
5994
|
+
DataListRenderer,
|
|
5838
5995
|
DateTimeInput,
|
|
5839
5996
|
EmailInput,
|
|
5840
5997
|
InputControl,
|