@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260903063823 → 0.8.1-dev.20260905065929
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/AvatarViewClient-4GOKYZYT.mjs +108 -0
- package/dist/AvatarViewClient-S3GJZZZS.mjs +106 -0
- package/dist/{DataBindingControls-GWNAJ7PR.mjs → DataBindingControls-UUDERFAD.mjs} +1 -1
- package/dist/{Slider-554BKC7N.mjs → Slider-6GJY6M4D.mjs} +8 -6
- package/dist/{Slider-PEIVH6A5.mjs → Slider-ZA2GRRGS.mjs} +10 -4
- package/dist/{chunk-Q3LFGHLM.mjs → chunk-7JWVEYJY.mjs} +1 -1
- package/dist/index.js +385 -316
- package/dist/index.mjs +303 -349
- package/dist/server.js +298 -229
- package/dist/server.mjs +133 -179
- package/package.json +1 -1
- package/dist/{InputControlClient-GRH7VSJR.mjs → InputControlClient-5NX4CEZB.mjs} +5 -5
- package/dist/{Pagination-PGAK7KDA.mjs → Pagination-CQKMBXXJ.mjs} +1 -1
package/dist/index.js
CHANGED
|
@@ -2070,12 +2070,123 @@ var init_CommentRendererClient = __esm({
|
|
|
2070
2070
|
}
|
|
2071
2071
|
});
|
|
2072
2072
|
|
|
2073
|
+
// src/components/controls/view/AvatarViewClient.tsx
|
|
2074
|
+
var AvatarViewClient_exports = {};
|
|
2075
|
+
__export(AvatarViewClient_exports, {
|
|
2076
|
+
default: () => AvatarViewClient_default
|
|
2077
|
+
});
|
|
2078
|
+
var import_react21, import_jsx_runtime28, AVATAR_COLORS, getAvatarColor, getInitials, getContactImageInfo, AvatarViewClient, AvatarViewClient_default;
|
|
2079
|
+
var init_AvatarViewClient = __esm({
|
|
2080
|
+
"src/components/controls/view/AvatarViewClient.tsx"() {
|
|
2081
|
+
"use strict";
|
|
2082
|
+
"use client";
|
|
2083
|
+
import_react21 = __toESM(require("react"));
|
|
2084
|
+
init_AssetUtility();
|
|
2085
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2086
|
+
AVATAR_COLORS = [
|
|
2087
|
+
"bg-error-strong",
|
|
2088
|
+
"bg-accent-base",
|
|
2089
|
+
"bg-warning-base",
|
|
2090
|
+
"bg-success-base",
|
|
2091
|
+
"bg-info-base",
|
|
2092
|
+
"bg-primary-base",
|
|
2093
|
+
"bg-secondary-base"
|
|
2094
|
+
];
|
|
2095
|
+
getAvatarColor = (text) => {
|
|
2096
|
+
let hash = 0;
|
|
2097
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
2098
|
+
hash = hash * 31 + text.charCodeAt(i) >>> 0;
|
|
2099
|
+
}
|
|
2100
|
+
return AVATAR_COLORS[hash % AVATAR_COLORS.length];
|
|
2101
|
+
};
|
|
2102
|
+
getInitials = (text) => {
|
|
2103
|
+
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
2104
|
+
if (words.length === 0) {
|
|
2105
|
+
return "?";
|
|
2106
|
+
}
|
|
2107
|
+
if (words.length === 1) {
|
|
2108
|
+
return words[0].slice(0, 2).toUpperCase();
|
|
2109
|
+
}
|
|
2110
|
+
return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
|
|
2111
|
+
};
|
|
2112
|
+
getContactImageInfo = (text) => {
|
|
2113
|
+
if (!text.includes("-")) {
|
|
2114
|
+
return null;
|
|
2115
|
+
}
|
|
2116
|
+
const parts = text.split("-");
|
|
2117
|
+
if (parts.length <= 1) {
|
|
2118
|
+
return null;
|
|
2119
|
+
}
|
|
2120
|
+
const first = parts[0].trim();
|
|
2121
|
+
if (!/^\d+$/.test(first)) {
|
|
2122
|
+
return null;
|
|
2123
|
+
}
|
|
2124
|
+
return {
|
|
2125
|
+
contactId: first,
|
|
2126
|
+
name: parts.slice(1).join("-").trim() || text
|
|
2127
|
+
};
|
|
2128
|
+
};
|
|
2129
|
+
AvatarViewClient = (props) => {
|
|
2130
|
+
const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
|
|
2131
|
+
const [imageFailed, setImageFailed] = import_react21.default.useState(false);
|
|
2132
|
+
import_react21.default.useEffect(() => {
|
|
2133
|
+
setImageFailed(false);
|
|
2134
|
+
}, [text, props.assetBaseUrl]);
|
|
2135
|
+
if (!text) {
|
|
2136
|
+
return null;
|
|
2137
|
+
}
|
|
2138
|
+
const size = props.width ?? "1.75rem";
|
|
2139
|
+
const contactInfo = getContactImageInfo(text);
|
|
2140
|
+
const imageUrl = contactInfo ? AssetUtility_default.resolveUrl(
|
|
2141
|
+
props.assetBaseUrl,
|
|
2142
|
+
`itemassets/contacts/contact-${contactInfo.contactId}`
|
|
2143
|
+
) : void 0;
|
|
2144
|
+
const displayName = contactInfo?.name ?? text;
|
|
2145
|
+
if (imageUrl && !imageFailed) {
|
|
2146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2147
|
+
"img",
|
|
2148
|
+
{
|
|
2149
|
+
className: "avatar-view inline-block flex-shrink-0 rounded-full object-cover select-none",
|
|
2150
|
+
src: imageUrl,
|
|
2151
|
+
alt: displayName,
|
|
2152
|
+
title: displayName,
|
|
2153
|
+
"aria-label": displayName,
|
|
2154
|
+
loading: "lazy",
|
|
2155
|
+
onError: () => setImageFailed(true),
|
|
2156
|
+
style: {
|
|
2157
|
+
width: size,
|
|
2158
|
+
height: size
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
);
|
|
2162
|
+
}
|
|
2163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2164
|
+
"span",
|
|
2165
|
+
{
|
|
2166
|
+
className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(displayName)}`,
|
|
2167
|
+
title: displayName,
|
|
2168
|
+
"aria-label": displayName,
|
|
2169
|
+
style: {
|
|
2170
|
+
width: size,
|
|
2171
|
+
height: size,
|
|
2172
|
+
fontSize: "0.6875rem",
|
|
2173
|
+
letterSpacing: "0.02em",
|
|
2174
|
+
lineHeight: 1
|
|
2175
|
+
},
|
|
2176
|
+
children: getInitials(displayName)
|
|
2177
|
+
}
|
|
2178
|
+
);
|
|
2179
|
+
};
|
|
2180
|
+
AvatarViewClient_default = AvatarViewClient;
|
|
2181
|
+
}
|
|
2182
|
+
});
|
|
2183
|
+
|
|
2073
2184
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
2074
|
-
var
|
|
2185
|
+
var import_react23, import_jsx_runtime30, MultilineTextInput, MultilineTextInput_default;
|
|
2075
2186
|
var init_MultilineTextInput = __esm({
|
|
2076
2187
|
"src/components/controls/edit/MultilineTextInput.tsx"() {
|
|
2077
2188
|
"use strict";
|
|
2078
|
-
|
|
2189
|
+
import_react23 = __toESM(require("react"));
|
|
2079
2190
|
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2080
2191
|
MultilineTextInput = (props) => {
|
|
2081
2192
|
const textChangeHandler = (event) => {
|
|
@@ -2095,7 +2206,7 @@ var init_MultilineTextInput = __esm({
|
|
|
2095
2206
|
if (props.value !== void 0 && props.value !== null) {
|
|
2096
2207
|
value = props.value;
|
|
2097
2208
|
}
|
|
2098
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react23.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "block mb-1", children: [
|
|
2099
2210
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2100
2211
|
" ",
|
|
2101
2212
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2124,11 +2235,11 @@ var init_MultilineTextInput = __esm({
|
|
|
2124
2235
|
});
|
|
2125
2236
|
|
|
2126
2237
|
// src/components/controls/edit/LineTextInput.tsx
|
|
2127
|
-
var
|
|
2238
|
+
var import_react24, import_jsx_runtime31, LineTextInput, LineTextInput_default;
|
|
2128
2239
|
var init_LineTextInput = __esm({
|
|
2129
2240
|
"src/components/controls/edit/LineTextInput.tsx"() {
|
|
2130
2241
|
"use strict";
|
|
2131
|
-
|
|
2242
|
+
import_react24 = __toESM(require("react"));
|
|
2132
2243
|
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2133
2244
|
LineTextInput = (props) => {
|
|
2134
2245
|
const textChangeHandler = (event) => {
|
|
@@ -2148,7 +2259,7 @@ var init_LineTextInput = __esm({
|
|
|
2148
2259
|
if (props.value !== void 0 && props.value !== null) {
|
|
2149
2260
|
value = props.value;
|
|
2150
2261
|
}
|
|
2151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react24.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "block", children: [
|
|
2152
2263
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
2153
2264
|
" ",
|
|
2154
2265
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "bg-error-weak !bg-transparent", children: "*" }),
|
|
@@ -2181,11 +2292,11 @@ var init_LineTextInput = __esm({
|
|
|
2181
2292
|
});
|
|
2182
2293
|
|
|
2183
2294
|
// src/components/controls/edit/MoneyInput.tsx
|
|
2184
|
-
var
|
|
2295
|
+
var import_react25, import_jsx_runtime32, MoneyInput, MoneyInput_default;
|
|
2185
2296
|
var init_MoneyInput = __esm({
|
|
2186
2297
|
"src/components/controls/edit/MoneyInput.tsx"() {
|
|
2187
2298
|
"use strict";
|
|
2188
|
-
|
|
2299
|
+
import_react25 = __toESM(require("react"));
|
|
2189
2300
|
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2190
2301
|
MoneyInput = (props) => {
|
|
2191
2302
|
const textChangeHandler = (event) => {
|
|
@@ -2215,7 +2326,7 @@ var init_MoneyInput = __esm({
|
|
|
2215
2326
|
e.preventDefault();
|
|
2216
2327
|
}
|
|
2217
2328
|
};
|
|
2218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react25.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "block mb-1", children: [
|
|
2219
2330
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2220
2331
|
" ",
|
|
2221
2332
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2282,14 +2393,14 @@ var init_InputControlType = __esm({
|
|
|
2282
2393
|
});
|
|
2283
2394
|
|
|
2284
2395
|
// src/components/controls/edit/Select.tsx
|
|
2285
|
-
var
|
|
2396
|
+
var import_react26, import_jsx_runtime33, Select, Select_default;
|
|
2286
2397
|
var init_Select = __esm({
|
|
2287
2398
|
"src/components/controls/edit/Select.tsx"() {
|
|
2288
2399
|
"use strict";
|
|
2289
|
-
|
|
2400
|
+
import_react26 = require("react");
|
|
2290
2401
|
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2291
2402
|
Select = (props) => {
|
|
2292
|
-
const [list, setList] = (0,
|
|
2403
|
+
const [list, setList] = (0, import_react26.useState)();
|
|
2293
2404
|
const getSafeValue = (val) => {
|
|
2294
2405
|
if (val === null || val === void 0) return "";
|
|
2295
2406
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -2326,7 +2437,7 @@ var init_Select = __esm({
|
|
|
2326
2437
|
groupKey: props.groupKey
|
|
2327
2438
|
});
|
|
2328
2439
|
};
|
|
2329
|
-
(0,
|
|
2440
|
+
(0, import_react26.useEffect)(() => {
|
|
2330
2441
|
async function fetchData() {
|
|
2331
2442
|
if (props.dataset) {
|
|
2332
2443
|
setList(props.dataset);
|
|
@@ -2410,11 +2521,11 @@ var init_Select = __esm({
|
|
|
2410
2521
|
});
|
|
2411
2522
|
|
|
2412
2523
|
// src/components/controls/edit/PercentageInput.tsx
|
|
2413
|
-
var
|
|
2524
|
+
var import_react27, import_jsx_runtime34, PercentageInput, PercentageInput_default;
|
|
2414
2525
|
var init_PercentageInput = __esm({
|
|
2415
2526
|
"src/components/controls/edit/PercentageInput.tsx"() {
|
|
2416
2527
|
"use strict";
|
|
2417
|
-
|
|
2528
|
+
import_react27 = __toESM(require("react"));
|
|
2418
2529
|
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2419
2530
|
PercentageInput = (props) => {
|
|
2420
2531
|
const textChangeHandler = (event) => {
|
|
@@ -2444,7 +2555,7 @@ var init_PercentageInput = __esm({
|
|
|
2444
2555
|
e.preventDefault();
|
|
2445
2556
|
}
|
|
2446
2557
|
};
|
|
2447
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react27.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "block mb-1", children: [
|
|
2448
2559
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
2449
2560
|
" ",
|
|
2450
2561
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2475,11 +2586,11 @@ var init_PercentageInput = __esm({
|
|
|
2475
2586
|
});
|
|
2476
2587
|
|
|
2477
2588
|
// src/components/controls/edit/PhoneInput.tsx
|
|
2478
|
-
var
|
|
2589
|
+
var import_react28, import_jsx_runtime35, PhoneInput, PhoneInput_default;
|
|
2479
2590
|
var init_PhoneInput = __esm({
|
|
2480
2591
|
"src/components/controls/edit/PhoneInput.tsx"() {
|
|
2481
2592
|
"use strict";
|
|
2482
|
-
|
|
2593
|
+
import_react28 = __toESM(require("react"));
|
|
2483
2594
|
import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2484
2595
|
PhoneInput = (props) => {
|
|
2485
2596
|
const textChangeHandler = (event) => {
|
|
@@ -2499,7 +2610,7 @@ var init_PhoneInput = __esm({
|
|
|
2499
2610
|
if (props.value !== void 0 && props.value !== null) {
|
|
2500
2611
|
value = props.value;
|
|
2501
2612
|
}
|
|
2502
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react28.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "block mb-1", children: [
|
|
2503
2614
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2504
2615
|
" ",
|
|
2505
2616
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2531,11 +2642,11 @@ var init_PhoneInput = __esm({
|
|
|
2531
2642
|
});
|
|
2532
2643
|
|
|
2533
2644
|
// src/components/controls/edit/NumberInput.tsx
|
|
2534
|
-
var
|
|
2645
|
+
var import_react29, import_jsx_runtime36, NumberInput, NumberInput_default;
|
|
2535
2646
|
var init_NumberInput = __esm({
|
|
2536
2647
|
"src/components/controls/edit/NumberInput.tsx"() {
|
|
2537
2648
|
"use strict";
|
|
2538
|
-
|
|
2649
|
+
import_react29 = __toESM(require("react"));
|
|
2539
2650
|
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2540
2651
|
NumberInput = (props) => {
|
|
2541
2652
|
const textChangeHandler = (event) => {
|
|
@@ -2559,7 +2670,7 @@ var init_NumberInput = __esm({
|
|
|
2559
2670
|
if (props.value !== void 0 && props.value !== null) {
|
|
2560
2671
|
value = props.value;
|
|
2561
2672
|
}
|
|
2562
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react29.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "block", children: [
|
|
2563
2674
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
2564
2675
|
" ",
|
|
2565
2676
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2590,11 +2701,11 @@ var init_NumberInput = __esm({
|
|
|
2590
2701
|
});
|
|
2591
2702
|
|
|
2592
2703
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
2593
|
-
var
|
|
2704
|
+
var import_react30, import_jsx_runtime37, CheckboxInput, CheckboxInput_default;
|
|
2594
2705
|
var init_CheckboxInput = __esm({
|
|
2595
2706
|
"src/components/controls/edit/CheckboxInput.tsx"() {
|
|
2596
2707
|
"use strict";
|
|
2597
|
-
|
|
2708
|
+
import_react30 = __toESM(require("react"));
|
|
2598
2709
|
import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2599
2710
|
CheckboxInput = (props) => {
|
|
2600
2711
|
const textChangeHandler = (event) => {
|
|
@@ -2612,7 +2723,7 @@ var init_CheckboxInput = __esm({
|
|
|
2612
2723
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
2613
2724
|
value = true;
|
|
2614
2725
|
}
|
|
2615
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react30.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mb-1", children: [
|
|
2616
2727
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
2617
2728
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2618
2729
|
"label",
|
|
@@ -2649,11 +2760,11 @@ var init_CheckboxInput = __esm({
|
|
|
2649
2760
|
});
|
|
2650
2761
|
|
|
2651
2762
|
// src/components/controls/edit/OtpInput.tsx
|
|
2652
|
-
var
|
|
2763
|
+
var import_react31, import_jsx_runtime38, OtpInput, OtpInput_default;
|
|
2653
2764
|
var init_OtpInput = __esm({
|
|
2654
2765
|
"src/components/controls/edit/OtpInput.tsx"() {
|
|
2655
2766
|
"use strict";
|
|
2656
|
-
|
|
2767
|
+
import_react31 = __toESM(require("react"));
|
|
2657
2768
|
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2658
2769
|
OtpInput = (props) => {
|
|
2659
2770
|
const textChangeHandler = (event) => {
|
|
@@ -2676,7 +2787,7 @@ var init_OtpInput = __esm({
|
|
|
2676
2787
|
if (props.value !== void 0 && props.value !== null) {
|
|
2677
2788
|
value = props.value;
|
|
2678
2789
|
}
|
|
2679
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react31.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
2680
2791
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2681
2792
|
" ",
|
|
2682
2793
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2708,11 +2819,11 @@ var init_OtpInput = __esm({
|
|
|
2708
2819
|
});
|
|
2709
2820
|
|
|
2710
2821
|
// src/components/controls/edit/DateTimeInput.tsx
|
|
2711
|
-
var
|
|
2822
|
+
var import_react32, import_jsx_runtime39, DateTimeInput, DateTimeInput_default;
|
|
2712
2823
|
var init_DateTimeInput = __esm({
|
|
2713
2824
|
"src/components/controls/edit/DateTimeInput.tsx"() {
|
|
2714
2825
|
"use strict";
|
|
2715
|
-
|
|
2826
|
+
import_react32 = __toESM(require("react"));
|
|
2716
2827
|
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2717
2828
|
DateTimeInput = (props) => {
|
|
2718
2829
|
const textChangeHandler = (event) => {
|
|
@@ -2745,7 +2856,7 @@ var init_DateTimeInput = __esm({
|
|
|
2745
2856
|
e.preventDefault();
|
|
2746
2857
|
}
|
|
2747
2858
|
};
|
|
2748
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react32.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "block mb-1", children: [
|
|
2749
2860
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
2750
2861
|
" ",
|
|
2751
2862
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -2778,15 +2889,15 @@ var init_DateTimeInput = __esm({
|
|
|
2778
2889
|
});
|
|
2779
2890
|
|
|
2780
2891
|
// src/components/controls/edit/ColorInput.tsx
|
|
2781
|
-
var
|
|
2892
|
+
var import_react33, import_jsx_runtime40, ColorInput, ColorInput_default;
|
|
2782
2893
|
var init_ColorInput = __esm({
|
|
2783
2894
|
"src/components/controls/edit/ColorInput.tsx"() {
|
|
2784
2895
|
"use strict";
|
|
2785
|
-
|
|
2896
|
+
import_react33 = __toESM(require("react"));
|
|
2786
2897
|
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2787
2898
|
ColorInput = (props) => {
|
|
2788
|
-
const [color, setColor] =
|
|
2789
|
-
(0,
|
|
2899
|
+
const [color, setColor] = import_react33.default.useState("#3b82f6");
|
|
2900
|
+
(0, import_react33.useEffect)(() => {
|
|
2790
2901
|
if (props.value !== void 0 && props.value !== null) {
|
|
2791
2902
|
if (typeof props.value === "string") {
|
|
2792
2903
|
setColor(props.value);
|
|
@@ -2830,22 +2941,22 @@ var init_ColorInput = __esm({
|
|
|
2830
2941
|
});
|
|
2831
2942
|
|
|
2832
2943
|
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
2833
|
-
var
|
|
2944
|
+
var import_react34, import_jsx_runtime41, SelectWithSearchInput, SelectWithSearchInput_default;
|
|
2834
2945
|
var init_SelectWithSearchInput = __esm({
|
|
2835
2946
|
"src/components/controls/edit/SelectWithSearchInput.tsx"() {
|
|
2836
2947
|
"use strict";
|
|
2837
2948
|
"use client";
|
|
2838
|
-
|
|
2949
|
+
import_react34 = __toESM(require("react"));
|
|
2839
2950
|
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2840
2951
|
SelectWithSearchInput = (props) => {
|
|
2841
|
-
const [isOpen, setIsOpen] = (0,
|
|
2842
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2843
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
2844
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2952
|
+
const [isOpen, setIsOpen] = (0, import_react34.useState)(false);
|
|
2953
|
+
const [searchTerm, setSearchTerm] = (0, import_react34.useState)("");
|
|
2954
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react34.useState)(-1);
|
|
2955
|
+
const [selectedItem, setSelectedItem] = (0, import_react34.useState)(
|
|
2845
2956
|
null
|
|
2846
2957
|
);
|
|
2847
|
-
const [list, setList] = (0,
|
|
2848
|
-
const loadData =
|
|
2958
|
+
const [list, setList] = (0, import_react34.useState)([]);
|
|
2959
|
+
const loadData = import_react34.default.useCallback(async () => {
|
|
2849
2960
|
if (props.dataset) {
|
|
2850
2961
|
setList(props.dataset);
|
|
2851
2962
|
return;
|
|
@@ -2870,10 +2981,10 @@ var init_SelectWithSearchInput = __esm({
|
|
|
2870
2981
|
props.dataSourceDependsOn,
|
|
2871
2982
|
props.dependentValue
|
|
2872
2983
|
]);
|
|
2873
|
-
(0,
|
|
2984
|
+
(0, import_react34.useEffect)(() => {
|
|
2874
2985
|
loadData();
|
|
2875
2986
|
}, [loadData]);
|
|
2876
|
-
(0,
|
|
2987
|
+
(0, import_react34.useEffect)(() => {
|
|
2877
2988
|
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
2878
2989
|
const selected = list.find(
|
|
2879
2990
|
(x) => x[props.dataKeyFieldName] == props.value
|
|
@@ -2920,8 +3031,8 @@ var init_SelectWithSearchInput = __esm({
|
|
|
2920
3031
|
handleSelect(e, filteredItems[highlightedIndex]);
|
|
2921
3032
|
}
|
|
2922
3033
|
};
|
|
2923
|
-
const dropdownRef = (0,
|
|
2924
|
-
(0,
|
|
3034
|
+
const dropdownRef = (0, import_react34.useRef)(null);
|
|
3035
|
+
(0, import_react34.useEffect)(() => {
|
|
2925
3036
|
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
2926
3037
|
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
2927
3038
|
highlightedItem?.scrollIntoView({
|
|
@@ -3097,12 +3208,12 @@ var init_StyleTypes = __esm({
|
|
|
3097
3208
|
});
|
|
3098
3209
|
|
|
3099
3210
|
// src/components/ClientButton.tsx
|
|
3100
|
-
var
|
|
3211
|
+
var import_react35, import_jsx_runtime42, ClientButton, ClientButton_default;
|
|
3101
3212
|
var init_ClientButton = __esm({
|
|
3102
3213
|
"src/components/ClientButton.tsx"() {
|
|
3103
3214
|
"use strict";
|
|
3104
3215
|
"use client";
|
|
3105
|
-
|
|
3216
|
+
import_react35 = __toESM(require("react"));
|
|
3106
3217
|
init_ToastService();
|
|
3107
3218
|
init_StyleTypes();
|
|
3108
3219
|
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
@@ -3115,7 +3226,7 @@ var init_ClientButton = __esm({
|
|
|
3115
3226
|
}
|
|
3116
3227
|
};
|
|
3117
3228
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
3118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react35.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3119
3230
|
"button",
|
|
3120
3231
|
{
|
|
3121
3232
|
type: "button",
|
|
@@ -3130,17 +3241,17 @@ var init_ClientButton = __esm({
|
|
|
3130
3241
|
});
|
|
3131
3242
|
|
|
3132
3243
|
// src/components/Confirm.tsx
|
|
3133
|
-
var
|
|
3244
|
+
var import_react36, import_jsx_runtime43, Confirm, Confirm_default;
|
|
3134
3245
|
var init_Confirm = __esm({
|
|
3135
3246
|
"src/components/Confirm.tsx"() {
|
|
3136
3247
|
"use strict";
|
|
3137
3248
|
"use client";
|
|
3138
|
-
|
|
3249
|
+
import_react36 = require("react");
|
|
3139
3250
|
init_ClientButton();
|
|
3140
3251
|
init_StyleTypes();
|
|
3141
3252
|
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3142
3253
|
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
3143
|
-
const [showModal, setShowModal] = (0,
|
|
3254
|
+
const [showModal, setShowModal] = (0, import_react36.useState)(true);
|
|
3144
3255
|
const handleConfirmAction = () => {
|
|
3145
3256
|
setShowModal(false);
|
|
3146
3257
|
if (onConfirm) {
|
|
@@ -3185,21 +3296,21 @@ var init_Confirm = __esm({
|
|
|
3185
3296
|
});
|
|
3186
3297
|
|
|
3187
3298
|
// src/components/Button.tsx
|
|
3188
|
-
var
|
|
3299
|
+
var import_react37, import_jsx_runtime44, Button, Button_default;
|
|
3189
3300
|
var init_Button = __esm({
|
|
3190
3301
|
"src/components/Button.tsx"() {
|
|
3191
3302
|
"use strict";
|
|
3192
3303
|
"use client";
|
|
3193
|
-
|
|
3304
|
+
import_react37 = __toESM(require("react"));
|
|
3194
3305
|
init_ToastService();
|
|
3195
3306
|
init_StyleTypes();
|
|
3196
3307
|
init_Confirm();
|
|
3197
3308
|
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3198
3309
|
Button = (props) => {
|
|
3199
|
-
const [inProgress, setInProgress] = (0,
|
|
3200
|
-
const [isActionPerformed, setIsActionPerformed] = (0,
|
|
3201
|
-
const [responseMessage, setResponseMessage] = (0,
|
|
3202
|
-
const [showModal, setShowModal] = (0,
|
|
3310
|
+
const [inProgress, setInProgress] = (0, import_react37.useState)(false);
|
|
3311
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react37.useState)(false);
|
|
3312
|
+
const [responseMessage, setResponseMessage] = (0, import_react37.useState)(null);
|
|
3313
|
+
const [showModal, setShowModal] = (0, import_react37.useState)(null);
|
|
3203
3314
|
const execute = async (event) => {
|
|
3204
3315
|
event.preventDefault();
|
|
3205
3316
|
event.stopPropagation();
|
|
@@ -3262,7 +3373,7 @@ var init_Button = __esm({
|
|
|
3262
3373
|
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
3263
3374
|
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
3264
3375
|
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
3265
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react37.default.Fragment, { children: [
|
|
3266
3377
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3267
3378
|
"button",
|
|
3268
3379
|
{
|
|
@@ -3314,28 +3425,28 @@ var init_Button = __esm({
|
|
|
3314
3425
|
});
|
|
3315
3426
|
|
|
3316
3427
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
3317
|
-
var
|
|
3428
|
+
var import_react38, import_jsx_runtime45, SelectWithSearchPanel, SelectWithSearchPanel_default;
|
|
3318
3429
|
var init_SelectWithSearchPanel = __esm({
|
|
3319
3430
|
"src/components/controls/edit/SelectWithSearchPanel.tsx"() {
|
|
3320
3431
|
"use strict";
|
|
3321
3432
|
"use client";
|
|
3322
3433
|
init_Button();
|
|
3323
|
-
|
|
3434
|
+
import_react38 = __toESM(require("react"));
|
|
3324
3435
|
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3325
3436
|
SelectWithSearchPanel = (props) => {
|
|
3326
|
-
const [isOpen, setIsOpen] = (0,
|
|
3327
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
3328
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
3329
|
-
const [list, setList] = (0,
|
|
3330
|
-
const listRef = (0,
|
|
3331
|
-
const [isError, setIsError] = (0,
|
|
3332
|
-
const containerRef = (0,
|
|
3333
|
-
const [isCreateOpen, setIsCreateOpen] = (0,
|
|
3334
|
-
const [formData, setFormData] = (0,
|
|
3437
|
+
const [isOpen, setIsOpen] = (0, import_react38.useState)(false);
|
|
3438
|
+
const [searchTerm, setSearchTerm] = (0, import_react38.useState)("");
|
|
3439
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react38.useState)(0);
|
|
3440
|
+
const [list, setList] = (0, import_react38.useState)([]);
|
|
3441
|
+
const listRef = (0, import_react38.useRef)(null);
|
|
3442
|
+
const [isError, setIsError] = (0, import_react38.useState)(false);
|
|
3443
|
+
const containerRef = (0, import_react38.useRef)(null);
|
|
3444
|
+
const [isCreateOpen, setIsCreateOpen] = (0, import_react38.useState)(false);
|
|
3445
|
+
const [formData, setFormData] = (0, import_react38.useState)({});
|
|
3335
3446
|
const getNestedValue7 = (obj, path) => {
|
|
3336
3447
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
3337
3448
|
};
|
|
3338
|
-
(0,
|
|
3449
|
+
(0, import_react38.useEffect)(() => {
|
|
3339
3450
|
const handleClickOutside = (event) => {
|
|
3340
3451
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
3341
3452
|
setIsOpen(false);
|
|
@@ -3346,7 +3457,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3346
3457
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
3347
3458
|
};
|
|
3348
3459
|
}, []);
|
|
3349
|
-
(0,
|
|
3460
|
+
(0, import_react38.useEffect)(() => {
|
|
3350
3461
|
async function fetchData() {
|
|
3351
3462
|
if (props.dataset) {
|
|
3352
3463
|
setList(props.dataset);
|
|
@@ -3388,7 +3499,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3388
3499
|
audioCtx.close();
|
|
3389
3500
|
}, 250);
|
|
3390
3501
|
};
|
|
3391
|
-
(0,
|
|
3502
|
+
(0, import_react38.useEffect)(() => {
|
|
3392
3503
|
const filteredItems2 = list?.filter(
|
|
3393
3504
|
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
3394
3505
|
);
|
|
@@ -3453,7 +3564,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3453
3564
|
const handleInputChange = (event, field) => {
|
|
3454
3565
|
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
3455
3566
|
};
|
|
3456
|
-
const handleSaveModal = (0,
|
|
3567
|
+
const handleSaveModal = (0, import_react38.useCallback)(async () => {
|
|
3457
3568
|
console.log("Form Data:", formData);
|
|
3458
3569
|
return formData;
|
|
3459
3570
|
}, []);
|
|
@@ -3478,7 +3589,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3478
3589
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
3479
3590
|
}
|
|
3480
3591
|
) }),
|
|
3481
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react38.default.Fragment, { children: [
|
|
3482
3593
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
3483
3594
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
3484
3595
|
"Select a",
|
|
@@ -3569,11 +3680,11 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3569
3680
|
});
|
|
3570
3681
|
|
|
3571
3682
|
// src/components/controls/edit/EmailInput.tsx
|
|
3572
|
-
var
|
|
3683
|
+
var import_react39, import_jsx_runtime46, EmailInput, EmailInput_default;
|
|
3573
3684
|
var init_EmailInput = __esm({
|
|
3574
3685
|
"src/components/controls/edit/EmailInput.tsx"() {
|
|
3575
3686
|
"use strict";
|
|
3576
|
-
|
|
3687
|
+
import_react39 = __toESM(require("react"));
|
|
3577
3688
|
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3578
3689
|
EmailInput = (props) => {
|
|
3579
3690
|
const textChangeHandler = (event) => {
|
|
@@ -3599,7 +3710,7 @@ var init_EmailInput = __esm({
|
|
|
3599
3710
|
if (props.value !== void 0 && props.value !== null) {
|
|
3600
3711
|
value = props.value;
|
|
3601
3712
|
}
|
|
3602
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react39.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "block mb-1", children: [
|
|
3603
3714
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
3604
3715
|
" ",
|
|
3605
3716
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -3627,12 +3738,12 @@ var init_EmailInput = __esm({
|
|
|
3627
3738
|
});
|
|
3628
3739
|
|
|
3629
3740
|
// src/components/controls/edit/TimeInput.tsx
|
|
3630
|
-
var
|
|
3741
|
+
var import_react40, import_jsx_runtime47, TimeInput, TimeInput_default;
|
|
3631
3742
|
var init_TimeInput = __esm({
|
|
3632
3743
|
"src/components/controls/edit/TimeInput.tsx"() {
|
|
3633
3744
|
"use strict";
|
|
3634
3745
|
"use client";
|
|
3635
|
-
|
|
3746
|
+
import_react40 = __toESM(require("react"));
|
|
3636
3747
|
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3637
3748
|
TimeInput = (props) => {
|
|
3638
3749
|
const timeChangeHandler = (event) => {
|
|
@@ -3646,7 +3757,7 @@ var init_TimeInput = __esm({
|
|
|
3646
3757
|
});
|
|
3647
3758
|
}
|
|
3648
3759
|
};
|
|
3649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react40.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "block mb-1", children: [
|
|
3650
3761
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
3651
3762
|
" ",
|
|
3652
3763
|
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
@@ -3791,12 +3902,12 @@ var init_Icon = __esm({
|
|
|
3791
3902
|
});
|
|
3792
3903
|
|
|
3793
3904
|
// src/components/controls/edit/AssetUpload.tsx
|
|
3794
|
-
var
|
|
3905
|
+
var import_react41, import_jsx_runtime54, AssetUpload, AssetUpload_default;
|
|
3795
3906
|
var init_AssetUpload = __esm({
|
|
3796
3907
|
"src/components/controls/edit/AssetUpload.tsx"() {
|
|
3797
3908
|
"use strict";
|
|
3798
3909
|
"use client";
|
|
3799
|
-
|
|
3910
|
+
import_react41 = __toESM(require("react"));
|
|
3800
3911
|
init_ClientButton();
|
|
3801
3912
|
init_StyleTypes();
|
|
3802
3913
|
init_AssetUtility();
|
|
@@ -3823,8 +3934,8 @@ var init_AssetUpload = __esm({
|
|
|
3823
3934
|
}
|
|
3824
3935
|
return "image";
|
|
3825
3936
|
};
|
|
3826
|
-
const [assetType, setAssetType] =
|
|
3827
|
-
(0,
|
|
3937
|
+
const [assetType, setAssetType] = import_react41.default.useState(getInitialTab);
|
|
3938
|
+
(0, import_react41.useEffect)(() => {
|
|
3828
3939
|
setAssetType(getInitialTab());
|
|
3829
3940
|
}, [props.value]);
|
|
3830
3941
|
const assetUploadCallback = (newAsset) => {
|
|
@@ -3899,7 +4010,7 @@ var init_AssetUpload = __esm({
|
|
|
3899
4010
|
}
|
|
3900
4011
|
return false;
|
|
3901
4012
|
};
|
|
3902
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react41.default.Fragment, { children: [
|
|
3903
4014
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { className: "block mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
|
|
3904
4015
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
|
|
3905
4016
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
@@ -4000,11 +4111,11 @@ var init_AssetUpload = __esm({
|
|
|
4000
4111
|
});
|
|
4001
4112
|
|
|
4002
4113
|
// src/components/controls/edit/SwitchInput.tsx
|
|
4003
|
-
var
|
|
4114
|
+
var import_react42, import_jsx_runtime55, SwitchInput, SwitchInput_default;
|
|
4004
4115
|
var init_SwitchInput = __esm({
|
|
4005
4116
|
"src/components/controls/edit/SwitchInput.tsx"() {
|
|
4006
4117
|
"use strict";
|
|
4007
|
-
|
|
4118
|
+
import_react42 = __toESM(require("react"));
|
|
4008
4119
|
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4009
4120
|
SwitchInput = (props) => {
|
|
4010
4121
|
const textChangeHandler = (event) => {
|
|
@@ -4022,7 +4133,7 @@ var init_SwitchInput = __esm({
|
|
|
4022
4133
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
4023
4134
|
value = true;
|
|
4024
4135
|
}
|
|
4025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-start justify-between gap-4 py-3", children: [
|
|
4026
4137
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0", children: [
|
|
4027
4138
|
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4028
4139
|
"label",
|
|
@@ -4160,15 +4271,15 @@ var init_DateTimeUtility = __esm({
|
|
|
4160
4271
|
});
|
|
4161
4272
|
|
|
4162
4273
|
// src/components/controls/edit/DateInput.tsx
|
|
4163
|
-
var
|
|
4274
|
+
var import_react43, import_jsx_runtime56, DateInput, DateInput_default;
|
|
4164
4275
|
var init_DateInput = __esm({
|
|
4165
4276
|
"src/components/controls/edit/DateInput.tsx"() {
|
|
4166
4277
|
"use strict";
|
|
4167
|
-
|
|
4278
|
+
import_react43 = require("react");
|
|
4168
4279
|
init_DateTimeUtility();
|
|
4169
4280
|
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4170
4281
|
DateInput = (props) => {
|
|
4171
|
-
const value = (0,
|
|
4282
|
+
const value = (0, import_react43.useMemo)(() => {
|
|
4172
4283
|
if (props.value === void 0 || props.value === null || props.value === "") {
|
|
4173
4284
|
return "";
|
|
4174
4285
|
}
|
|
@@ -4226,16 +4337,16 @@ var init_DateInput = __esm({
|
|
|
4226
4337
|
});
|
|
4227
4338
|
|
|
4228
4339
|
// src/components/controls/edit/RadioInput.tsx
|
|
4229
|
-
var
|
|
4340
|
+
var import_react44, import_jsx_runtime57, RadioInput, RadioInput_default;
|
|
4230
4341
|
var init_RadioInput = __esm({
|
|
4231
4342
|
"src/components/controls/edit/RadioInput.tsx"() {
|
|
4232
4343
|
"use strict";
|
|
4233
|
-
|
|
4344
|
+
import_react44 = require("react");
|
|
4234
4345
|
init_Icon();
|
|
4235
4346
|
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4236
4347
|
RadioInput = (props) => {
|
|
4237
|
-
const [list, setList] = (0,
|
|
4238
|
-
(0,
|
|
4348
|
+
const [list, setList] = (0, import_react44.useState)([]);
|
|
4349
|
+
(0, import_react44.useEffect)(() => {
|
|
4239
4350
|
async function loadData() {
|
|
4240
4351
|
if (props.dataset) {
|
|
4241
4352
|
setList(props.dataset);
|
|
@@ -4340,12 +4451,12 @@ var InputControlClient_exports = {};
|
|
|
4340
4451
|
__export(InputControlClient_exports, {
|
|
4341
4452
|
default: () => InputControlClient_default
|
|
4342
4453
|
});
|
|
4343
|
-
var
|
|
4454
|
+
var import_react45, import_jsx_runtime59, InputControl, InputControlClient_default;
|
|
4344
4455
|
var init_InputControlClient = __esm({
|
|
4345
4456
|
"src/components/controls/edit/InputControlClient.tsx"() {
|
|
4346
4457
|
"use strict";
|
|
4347
4458
|
"use client";
|
|
4348
|
-
|
|
4459
|
+
import_react45 = __toESM(require("react"));
|
|
4349
4460
|
init_MultilineTextInput();
|
|
4350
4461
|
init_LineTextInput();
|
|
4351
4462
|
init_MoneyInput();
|
|
@@ -4368,7 +4479,7 @@ var init_InputControlClient = __esm({
|
|
|
4368
4479
|
init_RadioInput();
|
|
4369
4480
|
init_ReferenceInput();
|
|
4370
4481
|
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4371
|
-
InputControl =
|
|
4482
|
+
InputControl = import_react45.default.forwardRef(
|
|
4372
4483
|
(props, ref) => {
|
|
4373
4484
|
const ControlComponents = {
|
|
4374
4485
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -4393,7 +4504,7 @@ var init_InputControlClient = __esm({
|
|
|
4393
4504
|
[InputControlType_default.referenceInput]: ReferenceInput_default
|
|
4394
4505
|
};
|
|
4395
4506
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
4396
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react45.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
4397
4508
|
}
|
|
4398
4509
|
);
|
|
4399
4510
|
InputControl.displayName = "InputControl";
|
|
@@ -4402,12 +4513,12 @@ var init_InputControlClient = __esm({
|
|
|
4402
4513
|
});
|
|
4403
4514
|
|
|
4404
4515
|
// src/components/controls/edit/InputControl.tsx
|
|
4405
|
-
var
|
|
4516
|
+
var import_dynamic7, InputControl2, InputControl_default;
|
|
4406
4517
|
var init_InputControl = __esm({
|
|
4407
4518
|
"src/components/controls/edit/InputControl.tsx"() {
|
|
4408
4519
|
"use strict";
|
|
4409
|
-
|
|
4410
|
-
InputControl2 = (0,
|
|
4520
|
+
import_dynamic7 = __toESM(require("next/dynamic"));
|
|
4521
|
+
InputControl2 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
4411
4522
|
ssr: false
|
|
4412
4523
|
});
|
|
4413
4524
|
InputControl_default = InputControl2;
|
|
@@ -4649,29 +4760,29 @@ var LinkNodeButton_exports = {};
|
|
|
4649
4760
|
__export(LinkNodeButton_exports, {
|
|
4650
4761
|
default: () => LinkNodeButton_default
|
|
4651
4762
|
});
|
|
4652
|
-
var
|
|
4763
|
+
var import_react46, import_jsx_runtime63, LinkNodeButton, LinkNodeButton_default;
|
|
4653
4764
|
var init_LinkNodeButton = __esm({
|
|
4654
4765
|
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
4655
4766
|
"use strict";
|
|
4656
4767
|
"use client";
|
|
4657
|
-
|
|
4768
|
+
import_react46 = require("react");
|
|
4658
4769
|
init_Button();
|
|
4659
4770
|
init_ServiceClient();
|
|
4660
4771
|
init_ToastService();
|
|
4661
4772
|
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4662
4773
|
LinkNodeButton = (props) => {
|
|
4663
4774
|
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
4664
|
-
const [isLoading, setIsLoading] = (0,
|
|
4665
|
-
const [successMessage, setSuccessMessage] = (0,
|
|
4775
|
+
const [isLoading, setIsLoading] = (0, import_react46.useState)(false);
|
|
4776
|
+
const [successMessage, setSuccessMessage] = (0, import_react46.useState)(null);
|
|
4666
4777
|
console.log("LinkNodeButton props:", props);
|
|
4667
|
-
const extractFieldNames = (0,
|
|
4778
|
+
const extractFieldNames = (0, import_react46.useCallback)((template) => {
|
|
4668
4779
|
if (!template) return [];
|
|
4669
4780
|
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
4670
4781
|
const matches = Array.from(template.matchAll(regex));
|
|
4671
4782
|
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
4672
4783
|
return fieldNames;
|
|
4673
4784
|
}, []);
|
|
4674
|
-
const replaceTemplateVariables = (0,
|
|
4785
|
+
const replaceTemplateVariables = (0, import_react46.useCallback)(
|
|
4675
4786
|
(template, responseData) => {
|
|
4676
4787
|
if (!template) return template;
|
|
4677
4788
|
let result = template;
|
|
@@ -4703,7 +4814,7 @@ var init_LinkNodeButton = __esm({
|
|
|
4703
4814
|
},
|
|
4704
4815
|
[props.routeParameters, dataitem, extractFieldNames]
|
|
4705
4816
|
);
|
|
4706
|
-
const getNestedValue7 = (0,
|
|
4817
|
+
const getNestedValue7 = (0, import_react46.useCallback)((obj, path) => {
|
|
4707
4818
|
if (!obj || !path) return void 0;
|
|
4708
4819
|
if (obj[path] !== void 0) {
|
|
4709
4820
|
return obj[path];
|
|
@@ -4718,7 +4829,7 @@ var init_LinkNodeButton = __esm({
|
|
|
4718
4829
|
}
|
|
4719
4830
|
return current;
|
|
4720
4831
|
}, []);
|
|
4721
|
-
const onClick = (0,
|
|
4832
|
+
const onClick = (0, import_react46.useCallback)(async () => {
|
|
4722
4833
|
if (!node.postUrl) {
|
|
4723
4834
|
return {
|
|
4724
4835
|
isSuccessful: false,
|
|
@@ -4884,9 +4995,9 @@ __export(CopyButton_exports, {
|
|
|
4884
4995
|
default: () => CopyButton
|
|
4885
4996
|
});
|
|
4886
4997
|
function CopyButton({ text }) {
|
|
4887
|
-
const [copied, setCopied] = (0,
|
|
4888
|
-
const timeoutRef = (0,
|
|
4889
|
-
(0,
|
|
4998
|
+
const [copied, setCopied] = (0, import_react53.useState)(false);
|
|
4999
|
+
const timeoutRef = (0, import_react53.useRef)(null);
|
|
5000
|
+
(0, import_react53.useEffect)(() => {
|
|
4890
5001
|
return () => {
|
|
4891
5002
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4892
5003
|
};
|
|
@@ -4930,25 +5041,25 @@ function CopyButton({ text }) {
|
|
|
4930
5041
|
}
|
|
4931
5042
|
);
|
|
4932
5043
|
}
|
|
4933
|
-
var
|
|
5044
|
+
var import_react53, import_jsx_runtime73;
|
|
4934
5045
|
var init_CopyButton = __esm({
|
|
4935
5046
|
"src/components/CopyButton.tsx"() {
|
|
4936
5047
|
"use strict";
|
|
4937
5048
|
"use client";
|
|
4938
|
-
|
|
5049
|
+
import_react53 = require("react");
|
|
4939
5050
|
import_jsx_runtime73 = require("react/jsx-runtime");
|
|
4940
5051
|
}
|
|
4941
5052
|
});
|
|
4942
5053
|
|
|
4943
5054
|
// src/components/IFrameLoaderView.tsx
|
|
4944
|
-
var
|
|
5055
|
+
var import_react56, import_jsx_runtime77, IFrameLoaderView, IFrameLoaderView_default;
|
|
4945
5056
|
var init_IFrameLoaderView = __esm({
|
|
4946
5057
|
"src/components/IFrameLoaderView.tsx"() {
|
|
4947
5058
|
"use strict";
|
|
4948
|
-
|
|
5059
|
+
import_react56 = __toESM(require("react"));
|
|
4949
5060
|
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4950
5061
|
IFrameLoaderView = (props) => {
|
|
4951
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
5062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_react56.default.Fragment, { children: [
|
|
4952
5063
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
4953
5064
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
4954
5065
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -4993,12 +5104,12 @@ var IframeClient_exports = {};
|
|
|
4993
5104
|
__export(IframeClient_exports, {
|
|
4994
5105
|
default: () => IframeClient_default
|
|
4995
5106
|
});
|
|
4996
|
-
var
|
|
5107
|
+
var import_react57, import_jsx_runtime78, IframeClient, IframeClient_default;
|
|
4997
5108
|
var init_IframeClient = __esm({
|
|
4998
5109
|
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
4999
5110
|
"use strict";
|
|
5000
5111
|
"use client";
|
|
5001
|
-
|
|
5112
|
+
import_react57 = __toESM(require("react"));
|
|
5002
5113
|
init_IFrameLoaderView();
|
|
5003
5114
|
import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5004
5115
|
IframeClient = ({
|
|
@@ -5006,10 +5117,10 @@ var init_IframeClient = __esm({
|
|
|
5006
5117
|
width,
|
|
5007
5118
|
height
|
|
5008
5119
|
}) => {
|
|
5009
|
-
const iframeRef = (0,
|
|
5010
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
5011
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
5012
|
-
(0,
|
|
5120
|
+
const iframeRef = (0, import_react57.useRef)(null);
|
|
5121
|
+
const [iframeHeight, setIframeHeight] = (0, import_react57.useState)("100%");
|
|
5122
|
+
const [isDataFound, setIsDataFound] = (0, import_react57.useState)(null);
|
|
5123
|
+
(0, import_react57.useEffect)(() => {
|
|
5013
5124
|
const handleReceiveMessage = (event) => {
|
|
5014
5125
|
const eventName = event?.data?.eventName;
|
|
5015
5126
|
const payload = event?.data?.payload;
|
|
@@ -5024,7 +5135,7 @@ var init_IframeClient = __esm({
|
|
|
5024
5135
|
window.addEventListener("message", handleReceiveMessage);
|
|
5025
5136
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
5026
5137
|
}, []);
|
|
5027
|
-
(0,
|
|
5138
|
+
(0, import_react57.useEffect)(() => {
|
|
5028
5139
|
const handleResize = () => {
|
|
5029
5140
|
if (iframeRef.current) {
|
|
5030
5141
|
iframeRef.current.contentWindow?.postMessage(
|
|
@@ -5039,7 +5150,7 @@ var init_IframeClient = __esm({
|
|
|
5039
5150
|
const handleIframeLoad = () => {
|
|
5040
5151
|
setIsDataFound(true);
|
|
5041
5152
|
};
|
|
5042
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5043
5154
|
"iframe",
|
|
5044
5155
|
{
|
|
5045
5156
|
ref: iframeRef,
|
|
@@ -5298,12 +5409,12 @@ var Pagination_exports = {};
|
|
|
5298
5409
|
__export(Pagination_exports, {
|
|
5299
5410
|
default: () => Pagination_default
|
|
5300
5411
|
});
|
|
5301
|
-
var
|
|
5412
|
+
var import_react58, import_jsx_runtime84, Pagination, Pagination_default;
|
|
5302
5413
|
var init_Pagination = __esm({
|
|
5303
5414
|
"src/components/Pagination.tsx"() {
|
|
5304
5415
|
"use strict";
|
|
5305
5416
|
"use client";
|
|
5306
|
-
|
|
5417
|
+
import_react58 = require("react");
|
|
5307
5418
|
init_OdataBuilder();
|
|
5308
5419
|
init_Icon();
|
|
5309
5420
|
init_StyleTypes();
|
|
@@ -5312,7 +5423,7 @@ var init_Pagination = __esm({
|
|
|
5312
5423
|
import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5313
5424
|
Pagination = (props) => {
|
|
5314
5425
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5315
|
-
const builder = (0,
|
|
5426
|
+
const builder = (0, import_react58.useMemo)(() => {
|
|
5316
5427
|
const b = new OdataBuilder(path);
|
|
5317
5428
|
if (query) b.setQuery(query);
|
|
5318
5429
|
return b;
|
|
@@ -5482,12 +5593,12 @@ var DataBindingControls_exports = {};
|
|
|
5482
5593
|
__export(DataBindingControls_exports, {
|
|
5483
5594
|
default: () => DataBindingControls_default
|
|
5484
5595
|
});
|
|
5485
|
-
var
|
|
5596
|
+
var import_react59, import_navigation, import_jsx_runtime85, humanize, escapeODataString, parseFacetSelections, buildFacetFilter, parseODataSearch, normalizeSortOption, DUMMY_FACETS, DUMMY_SORT_OPTIONS, DataBindingControls, DataBindingControls_default;
|
|
5486
5597
|
var init_DataBindingControls = __esm({
|
|
5487
5598
|
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
5488
5599
|
"use strict";
|
|
5489
5600
|
"use client";
|
|
5490
|
-
|
|
5601
|
+
import_react59 = require("react");
|
|
5491
5602
|
import_navigation = require("next/navigation");
|
|
5492
5603
|
init_InputControl();
|
|
5493
5604
|
init_InputControlType();
|
|
@@ -5568,12 +5679,12 @@ var init_DataBindingControls = __esm({
|
|
|
5568
5679
|
const selectedFacetValues = parseFacetSelections(currentFilter);
|
|
5569
5680
|
const currentSort = query?.["$orderby"] ?? query?.orderBy ?? "";
|
|
5570
5681
|
const currentSearch = parseODataSearch(query?.["$search"]);
|
|
5571
|
-
const [searchText, setSearchText] = (0,
|
|
5572
|
-
const lastNavigationUrl = (0,
|
|
5573
|
-
(0,
|
|
5682
|
+
const [searchText, setSearchText] = (0, import_react59.useState)(currentSearch);
|
|
5683
|
+
const lastNavigationUrl = (0, import_react59.useRef)(null);
|
|
5684
|
+
(0, import_react59.useEffect)(() => {
|
|
5574
5685
|
setSearchText(currentSearch);
|
|
5575
5686
|
}, [currentSearch]);
|
|
5576
|
-
const getQueryUrl = (0,
|
|
5687
|
+
const getQueryUrl = (0, import_react59.useCallback)(
|
|
5577
5688
|
(updates) => {
|
|
5578
5689
|
const params = new URLSearchParams(query ?? {});
|
|
5579
5690
|
Object.entries(updates).forEach(([key, value]) => {
|
|
@@ -5603,7 +5714,7 @@ var init_DataBindingControls = __esm({
|
|
|
5603
5714
|
filter: void 0
|
|
5604
5715
|
});
|
|
5605
5716
|
};
|
|
5606
|
-
const navigateWithoutReload = (0,
|
|
5717
|
+
const navigateWithoutReload = (0, import_react59.useCallback)(
|
|
5607
5718
|
(url) => {
|
|
5608
5719
|
if (lastNavigationUrl.current === url) {
|
|
5609
5720
|
return;
|
|
@@ -5619,7 +5730,7 @@ var init_DataBindingControls = __esm({
|
|
|
5619
5730
|
},
|
|
5620
5731
|
[router]
|
|
5621
5732
|
);
|
|
5622
|
-
(0,
|
|
5733
|
+
(0, import_react59.useEffect)(() => {
|
|
5623
5734
|
const trimmedSearchText = searchText.trim();
|
|
5624
5735
|
if (trimmedSearchText === currentSearch.trim()) {
|
|
5625
5736
|
return;
|
|
@@ -5723,12 +5834,12 @@ var Slider_exports = {};
|
|
|
5723
5834
|
__export(Slider_exports, {
|
|
5724
5835
|
default: () => Slider_default
|
|
5725
5836
|
});
|
|
5726
|
-
var
|
|
5837
|
+
var import_react60, import_jsx_runtime86, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
5727
5838
|
var init_Slider = __esm({
|
|
5728
5839
|
"src/components/Slider.tsx"() {
|
|
5729
5840
|
"use strict";
|
|
5730
5841
|
"use client";
|
|
5731
|
-
|
|
5842
|
+
import_react60 = __toESM(require("react"));
|
|
5732
5843
|
import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5733
5844
|
Slider = ({
|
|
5734
5845
|
children,
|
|
@@ -5745,15 +5856,16 @@ var init_Slider = __esm({
|
|
|
5745
5856
|
dotInactiveClassName = "bg-gray-600",
|
|
5746
5857
|
gap,
|
|
5747
5858
|
pillStyle = "cumulative",
|
|
5748
|
-
progressPosition = "bottom"
|
|
5859
|
+
progressPosition = "bottom",
|
|
5860
|
+
scrollByColumns = false
|
|
5749
5861
|
}) => {
|
|
5750
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
5751
|
-
const [transition, setTransition] = (0,
|
|
5752
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
5862
|
+
const [currentSlide, setCurrentSlide] = (0, import_react60.useState)(0);
|
|
5863
|
+
const [transition, setTransition] = (0, import_react60.useState)(true);
|
|
5864
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react60.useState)(
|
|
5753
5865
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
5754
5866
|
);
|
|
5755
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
5756
|
-
(0,
|
|
5867
|
+
const [isPlaying, setIsPlaying] = (0, import_react60.useState)(autoplay);
|
|
5868
|
+
(0, import_react60.useEffect)(() => {
|
|
5757
5869
|
if (typeof slidesToShow === "number") return;
|
|
5758
5870
|
const handleResize = () => {
|
|
5759
5871
|
if (window.innerWidth >= 1024) {
|
|
@@ -5768,7 +5880,7 @@ var init_Slider = __esm({
|
|
|
5768
5880
|
window.addEventListener("resize", handleResize);
|
|
5769
5881
|
return () => window.removeEventListener("resize", handleResize);
|
|
5770
5882
|
}, [slidesToShow]);
|
|
5771
|
-
(0,
|
|
5883
|
+
(0, import_react60.useEffect)(() => {
|
|
5772
5884
|
if (!autoplay) return;
|
|
5773
5885
|
const timer = setInterval(() => {
|
|
5774
5886
|
if (isPlaying) {
|
|
@@ -5777,8 +5889,9 @@ var init_Slider = __esm({
|
|
|
5777
5889
|
}, autoplay_speed);
|
|
5778
5890
|
return () => clearInterval(timer);
|
|
5779
5891
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
5780
|
-
const totalSlides =
|
|
5781
|
-
const maxSlide = totalSlides - slidesToShowState;
|
|
5892
|
+
const totalSlides = import_react60.Children.count(children);
|
|
5893
|
+
const maxSlide = Math.max(0, totalSlides - slidesToShowState);
|
|
5894
|
+
const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
|
|
5782
5895
|
const nextSlide = () => {
|
|
5783
5896
|
if (currentSlide >= maxSlide) {
|
|
5784
5897
|
if (infinite_scroll) {
|
|
@@ -5787,7 +5900,8 @@ var init_Slider = __esm({
|
|
|
5787
5900
|
}
|
|
5788
5901
|
} else {
|
|
5789
5902
|
setTransition(true);
|
|
5790
|
-
|
|
5903
|
+
const nextIndex = currentSlide + step;
|
|
5904
|
+
setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
|
|
5791
5905
|
}
|
|
5792
5906
|
};
|
|
5793
5907
|
const prevSlide = () => {
|
|
@@ -5798,7 +5912,8 @@ var init_Slider = __esm({
|
|
|
5798
5912
|
}
|
|
5799
5913
|
} else {
|
|
5800
5914
|
setTransition(true);
|
|
5801
|
-
|
|
5915
|
+
const prevIndex = currentSlide - step;
|
|
5916
|
+
setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
|
|
5802
5917
|
}
|
|
5803
5918
|
};
|
|
5804
5919
|
const goToSlide = (index) => {
|
|
@@ -5822,8 +5937,8 @@ var init_Slider = __esm({
|
|
|
5822
5937
|
}
|
|
5823
5938
|
};
|
|
5824
5939
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
5825
|
-
const slides =
|
|
5826
|
-
if (!
|
|
5940
|
+
const slides = import_react60.Children.map(children, (child, index) => {
|
|
5941
|
+
if (!import_react60.default.isValidElement(child)) return null;
|
|
5827
5942
|
const childProps = child.props;
|
|
5828
5943
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
5829
5944
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
@@ -5831,7 +5946,7 @@ var init_Slider = __esm({
|
|
|
5831
5946
|
{
|
|
5832
5947
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
5833
5948
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
5834
|
-
children: (0,
|
|
5949
|
+
children: (0, import_react60.cloneElement)(child, {
|
|
5835
5950
|
className: mergedClassName
|
|
5836
5951
|
})
|
|
5837
5952
|
},
|
|
@@ -5944,13 +6059,13 @@ var init_Slider = __esm({
|
|
|
5944
6059
|
currentSlide,
|
|
5945
6060
|
totalSlides
|
|
5946
6061
|
}) => {
|
|
5947
|
-
const [progress, setProgress] = (0,
|
|
5948
|
-
(0,
|
|
6062
|
+
const [progress, setProgress] = (0, import_react60.useState)(0);
|
|
6063
|
+
(0, import_react60.useEffect)(() => {
|
|
5949
6064
|
if (active) {
|
|
5950
6065
|
setProgress(0);
|
|
5951
6066
|
}
|
|
5952
6067
|
}, [active, index]);
|
|
5953
|
-
(0,
|
|
6068
|
+
(0, import_react60.useEffect)(() => {
|
|
5954
6069
|
if (!active || !isPlaying) {
|
|
5955
6070
|
if (!active) {
|
|
5956
6071
|
setProgress(0);
|
|
@@ -6080,7 +6195,7 @@ __export(index_exports, {
|
|
|
6080
6195
|
module.exports = __toCommonJS(index_exports);
|
|
6081
6196
|
|
|
6082
6197
|
// src/components/controls/view/ViewControl.tsx
|
|
6083
|
-
var
|
|
6198
|
+
var import_react22 = __toESM(require("react"));
|
|
6084
6199
|
|
|
6085
6200
|
// src/components/controls/view/ViewControlTypes.tsx
|
|
6086
6201
|
var ViewControlTypes = {
|
|
@@ -6451,56 +6566,10 @@ var CommentRenderer = (0, import_dynamic5.default)(() => Promise.resolve().then(
|
|
|
6451
6566
|
var Commentrenderer_default = CommentRenderer;
|
|
6452
6567
|
|
|
6453
6568
|
// src/components/controls/view/AvatarView.tsx
|
|
6454
|
-
var
|
|
6455
|
-
var
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
"bg-warning-base",
|
|
6459
|
-
"bg-success-base",
|
|
6460
|
-
"bg-info-base",
|
|
6461
|
-
"bg-primary-base",
|
|
6462
|
-
"bg-secondary-base"
|
|
6463
|
-
];
|
|
6464
|
-
var getAvatarColor = (text) => {
|
|
6465
|
-
let hash = 0;
|
|
6466
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
6467
|
-
hash = hash * 31 + text.charCodeAt(i) >>> 0;
|
|
6468
|
-
}
|
|
6469
|
-
return AVATAR_COLORS[hash % AVATAR_COLORS.length];
|
|
6470
|
-
};
|
|
6471
|
-
var getInitials = (text) => {
|
|
6472
|
-
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
6473
|
-
if (words.length === 0) {
|
|
6474
|
-
return "?";
|
|
6475
|
-
}
|
|
6476
|
-
if (words.length === 1) {
|
|
6477
|
-
return words[0].slice(0, 2).toUpperCase();
|
|
6478
|
-
}
|
|
6479
|
-
return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
|
|
6480
|
-
};
|
|
6481
|
-
var AvatarView = (props) => {
|
|
6482
|
-
const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
|
|
6483
|
-
if (!text) {
|
|
6484
|
-
return null;
|
|
6485
|
-
}
|
|
6486
|
-
const size = props.width ?? "1.75rem";
|
|
6487
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6488
|
-
"span",
|
|
6489
|
-
{
|
|
6490
|
-
className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(text)}`,
|
|
6491
|
-
title: text,
|
|
6492
|
-
"aria-label": text,
|
|
6493
|
-
style: {
|
|
6494
|
-
width: size,
|
|
6495
|
-
height: size,
|
|
6496
|
-
fontSize: "0.6875rem",
|
|
6497
|
-
letterSpacing: "0.02em",
|
|
6498
|
-
lineHeight: 1
|
|
6499
|
-
},
|
|
6500
|
-
children: getInitials(text)
|
|
6501
|
-
}
|
|
6502
|
-
);
|
|
6503
|
-
};
|
|
6569
|
+
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
6570
|
+
var AvatarView = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_AvatarViewClient(), AvatarViewClient_exports)), {
|
|
6571
|
+
ssr: false
|
|
6572
|
+
});
|
|
6504
6573
|
var AvatarView_default = AvatarView;
|
|
6505
6574
|
|
|
6506
6575
|
// src/components/controls/view/ViewControl.tsx
|
|
@@ -6536,7 +6605,7 @@ var ViewControl = (props) => {
|
|
|
6536
6605
|
[ViewControlTypes_default.avatar]: AvatarView_default
|
|
6537
6606
|
};
|
|
6538
6607
|
const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
|
|
6539
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react22.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
6540
6609
|
};
|
|
6541
6610
|
var ViewControl_default = ViewControl;
|
|
6542
6611
|
|
|
@@ -6545,10 +6614,10 @@ init_InputControl();
|
|
|
6545
6614
|
init_InputControlType();
|
|
6546
6615
|
|
|
6547
6616
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
6548
|
-
var
|
|
6617
|
+
var import_react62 = __toESM(require("react"));
|
|
6549
6618
|
|
|
6550
6619
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
6551
|
-
var
|
|
6620
|
+
var import_react48 = __toESM(require("react"));
|
|
6552
6621
|
|
|
6553
6622
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
6554
6623
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -6630,13 +6699,13 @@ var LineBreakNode = () => {
|
|
|
6630
6699
|
var LineBreakNode_default = LineBreakNode;
|
|
6631
6700
|
|
|
6632
6701
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
6633
|
-
var
|
|
6702
|
+
var import_react47 = __toESM(require("react"));
|
|
6634
6703
|
|
|
6635
6704
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
6636
6705
|
init_AssetUtility();
|
|
6637
|
-
var
|
|
6706
|
+
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
6638
6707
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6639
|
-
var HlsPlayer3 = (0,
|
|
6708
|
+
var HlsPlayer3 = (0, import_dynamic8.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
6640
6709
|
var getNestedValue = (obj, path) => {
|
|
6641
6710
|
if (!obj || !path) return void 0;
|
|
6642
6711
|
return path.split(".").reduce((current, key) => {
|
|
@@ -6744,9 +6813,9 @@ var ImageNode_default = ImageNode;
|
|
|
6744
6813
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
6745
6814
|
init_StyleTypes();
|
|
6746
6815
|
init_Hyperlink();
|
|
6747
|
-
var
|
|
6816
|
+
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
6748
6817
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6749
|
-
var LinkNodeButton2 = (0,
|
|
6818
|
+
var LinkNodeButton2 = (0, import_dynamic9.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
6750
6819
|
ssr: false
|
|
6751
6820
|
});
|
|
6752
6821
|
function getNestedValue2(obj, path) {
|
|
@@ -6804,7 +6873,7 @@ var LinkNode = (props) => {
|
|
|
6804
6873
|
console.warn("Unknown node type:", childNode.type);
|
|
6805
6874
|
return null;
|
|
6806
6875
|
}
|
|
6807
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6808
6877
|
SelectedNode,
|
|
6809
6878
|
{
|
|
6810
6879
|
node: childNode,
|
|
@@ -7048,7 +7117,7 @@ var ParagraphNode = (props) => {
|
|
|
7048
7117
|
if (isInlineOnlyParent) {
|
|
7049
7118
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_jsx_runtime68.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
7050
7119
|
const SelectedNode = NodeTypes2[node.type];
|
|
7051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react48.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7052
7121
|
SelectedNode,
|
|
7053
7122
|
{
|
|
7054
7123
|
node,
|
|
@@ -7064,7 +7133,7 @@ var ParagraphNode = (props) => {
|
|
|
7064
7133
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: " " + formatClasses, children: [
|
|
7065
7134
|
hasChildren && props.node.children.map((node, index) => {
|
|
7066
7135
|
const SelectedNode = NodeTypes2[node.type];
|
|
7067
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react48.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7068
7137
|
SelectedNode,
|
|
7069
7138
|
{
|
|
7070
7139
|
node,
|
|
@@ -7082,7 +7151,7 @@ var ParagraphNode = (props) => {
|
|
|
7082
7151
|
var ParagraphNode_default = ParagraphNode;
|
|
7083
7152
|
|
|
7084
7153
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
7085
|
-
var
|
|
7154
|
+
var import_react49 = __toESM(require("react"));
|
|
7086
7155
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
7087
7156
|
var HeadingNode = (props) => {
|
|
7088
7157
|
const NodeTypes2 = {
|
|
@@ -7099,22 +7168,22 @@ var HeadingNode = (props) => {
|
|
|
7099
7168
|
{
|
|
7100
7169
|
}
|
|
7101
7170
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
7102
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children:
|
|
7171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: import_react49.default.createElement(
|
|
7103
7172
|
HeadingTag,
|
|
7104
7173
|
{ className: formatClasses },
|
|
7105
7174
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
7106
7175
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
7107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
7176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react49.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, assetBaseUrl: props.assetBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
7108
7177
|
})
|
|
7109
7178
|
) });
|
|
7110
7179
|
};
|
|
7111
7180
|
var HeadingNode_default = HeadingNode;
|
|
7112
7181
|
|
|
7113
7182
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
7114
|
-
var
|
|
7183
|
+
var import_react51 = __toESM(require("react"));
|
|
7115
7184
|
|
|
7116
7185
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
7117
|
-
var
|
|
7186
|
+
var import_react50 = __toESM(require("react"));
|
|
7118
7187
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
7119
7188
|
var ListItemNode = (props) => {
|
|
7120
7189
|
const NodeTypes2 = {
|
|
@@ -7143,7 +7212,7 @@ var ListItemNode = (props) => {
|
|
|
7143
7212
|
}
|
|
7144
7213
|
} else {
|
|
7145
7214
|
foundFirstBreak = false;
|
|
7146
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
7215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
7147
7216
|
}
|
|
7148
7217
|
}) });
|
|
7149
7218
|
};
|
|
@@ -7155,21 +7224,21 @@ var ListNode = (props) => {
|
|
|
7155
7224
|
const NodeTypes2 = {
|
|
7156
7225
|
listitem: ListItemNode_default
|
|
7157
7226
|
};
|
|
7158
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
7227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_react51.default.Fragment, { children: [
|
|
7159
7228
|
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
7160
7229
|
const SelectedNode = NodeTypes2[node.type];
|
|
7161
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
7230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
7162
7231
|
}) }),
|
|
7163
7232
|
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
7164
7233
|
const SelectedNode = NodeTypes2[node.type];
|
|
7165
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
7234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
7166
7235
|
}) })
|
|
7167
7236
|
] });
|
|
7168
7237
|
};
|
|
7169
7238
|
var ListNode_default = ListNode;
|
|
7170
7239
|
|
|
7171
7240
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
7172
|
-
var
|
|
7241
|
+
var import_react52 = __toESM(require("react"));
|
|
7173
7242
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
7174
7243
|
var QuoteNode = (props) => {
|
|
7175
7244
|
const NodeTypes2 = {
|
|
@@ -7179,16 +7248,16 @@ var QuoteNode = (props) => {
|
|
|
7179
7248
|
};
|
|
7180
7249
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
7181
7250
|
const SelectedNode = NodeTypes2[node.type];
|
|
7182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react52.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
7183
7252
|
}) });
|
|
7184
7253
|
};
|
|
7185
7254
|
var QuoteNode_default = QuoteNode;
|
|
7186
7255
|
|
|
7187
7256
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
7188
|
-
var
|
|
7189
|
-
var
|
|
7257
|
+
var import_react54 = __toESM(require("react"));
|
|
7258
|
+
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
7190
7259
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
7191
|
-
var CopyButton2 = (0,
|
|
7260
|
+
var CopyButton2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
7192
7261
|
ssr: false,
|
|
7193
7262
|
// optional: fallback UI while loading
|
|
7194
7263
|
loading: () => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
@@ -7212,7 +7281,7 @@ var CodeNode = (props) => {
|
|
|
7212
7281
|
] }),
|
|
7213
7282
|
/* @__PURE__ */ (0, import_jsx_runtime74.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) => {
|
|
7214
7283
|
const SelectedNode = NodeTypes2[node.type];
|
|
7215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react54.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7216
7285
|
SelectedNode,
|
|
7217
7286
|
{
|
|
7218
7287
|
node,
|
|
@@ -7234,7 +7303,7 @@ var HorizontalRuleNode = () => {
|
|
|
7234
7303
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
7235
7304
|
|
|
7236
7305
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
7237
|
-
var
|
|
7306
|
+
var import_react55 = __toESM(require("react"));
|
|
7238
7307
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
7239
7308
|
var WidgetNode = (props) => {
|
|
7240
7309
|
const getWidgetParameters = () => {
|
|
@@ -7308,7 +7377,7 @@ var WidgetNode = (props) => {
|
|
|
7308
7377
|
}
|
|
7309
7378
|
return (
|
|
7310
7379
|
// eslint-disable-next-line react-hooks/static-components
|
|
7311
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7380
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7312
7381
|
WidgetRenderer,
|
|
7313
7382
|
{
|
|
7314
7383
|
params: widgetParams,
|
|
@@ -7325,13 +7394,13 @@ var WidgetNode = (props) => {
|
|
|
7325
7394
|
var WidgetNode_default = WidgetNode;
|
|
7326
7395
|
|
|
7327
7396
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7328
|
-
var
|
|
7329
|
-
var
|
|
7397
|
+
var import_dynamic14 = __toESM(require("next/dynamic"));
|
|
7398
|
+
var import_react61 = __toESM(require("react"));
|
|
7330
7399
|
|
|
7331
7400
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
7332
|
-
var
|
|
7401
|
+
var import_dynamic11 = __toESM(require("next/dynamic"));
|
|
7333
7402
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7334
|
-
var IframeClient2 = (0,
|
|
7403
|
+
var IframeClient2 = (0, import_dynamic11.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
7335
7404
|
ssr: false
|
|
7336
7405
|
});
|
|
7337
7406
|
var EmbedNode = (props) => {
|
|
@@ -7573,9 +7642,9 @@ var NoDataFound_default = NoDataFound;
|
|
|
7573
7642
|
|
|
7574
7643
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
7575
7644
|
init_AssetUtility();
|
|
7576
|
-
var
|
|
7645
|
+
var import_dynamic12 = __toESM(require("next/dynamic"));
|
|
7577
7646
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7578
|
-
var HlsPlayer4 = (0,
|
|
7647
|
+
var HlsPlayer4 = (0, import_dynamic12.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
7579
7648
|
var deviceToMediaQuery = (device) => {
|
|
7580
7649
|
switch (device) {
|
|
7581
7650
|
case "lg":
|
|
@@ -8422,9 +8491,9 @@ var DocumentNode = (props) => {
|
|
|
8422
8491
|
var DocumentNode_default = DocumentNode;
|
|
8423
8492
|
|
|
8424
8493
|
// src/components/pageRenderingEngine/nodes/GoogleMapNode.tsx
|
|
8425
|
-
var
|
|
8494
|
+
var import_dynamic13 = __toESM(require("next/dynamic"));
|
|
8426
8495
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
8427
|
-
var IframeClient3 = (0,
|
|
8496
|
+
var IframeClient3 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
8428
8497
|
ssr: false
|
|
8429
8498
|
});
|
|
8430
8499
|
var GoogleMapNode = (props) => {
|
|
@@ -8442,11 +8511,11 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
8442
8511
|
|
|
8443
8512
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
8444
8513
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
8445
|
-
var Pagination2 = (0,
|
|
8446
|
-
var DataBindingControls2 = (0,
|
|
8514
|
+
var Pagination2 = (0, import_dynamic14.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
8515
|
+
var DataBindingControls2 = (0, import_dynamic14.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
8447
8516
|
ssr: true
|
|
8448
8517
|
});
|
|
8449
|
-
var Slider2 = (0,
|
|
8518
|
+
var Slider2 = (0, import_dynamic14.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
8450
8519
|
ssr: false
|
|
8451
8520
|
});
|
|
8452
8521
|
function toCamelCase(str) {
|
|
@@ -8725,7 +8794,7 @@ var DivContainer = async (props) => {
|
|
|
8725
8794
|
}
|
|
8726
8795
|
const SelectedNode = NodeTypes2[node.type];
|
|
8727
8796
|
if (!SelectedNode) return null;
|
|
8728
|
-
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8729
8798
|
SelectedNode,
|
|
8730
8799
|
{
|
|
8731
8800
|
node,
|
|
@@ -8817,7 +8886,7 @@ var DivContainer = async (props) => {
|
|
|
8817
8886
|
item,
|
|
8818
8887
|
idx,
|
|
8819
8888
|
props.href ? void 0 : item?.links?.view
|
|
8820
|
-
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8889
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react61.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8821
8890
|
);
|
|
8822
8891
|
}
|
|
8823
8892
|
return props.node.children.flatMap((node, childIndex) => {
|
|
@@ -8949,14 +9018,14 @@ var DivContainer = async (props) => {
|
|
|
8949
9018
|
dataset: response
|
|
8950
9019
|
}
|
|
8951
9020
|
) : null;
|
|
8952
|
-
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
9021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react61.default.Fragment, { children: [
|
|
8953
9022
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8954
9023
|
"style",
|
|
8955
9024
|
{
|
|
8956
9025
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
8957
9026
|
}
|
|
8958
9027
|
),
|
|
8959
|
-
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
9028
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react61.default.Fragment, { children: [
|
|
8960
9029
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8961
9030
|
DataBindingControls2,
|
|
8962
9031
|
{
|
|
@@ -8994,7 +9063,7 @@ var DivContainer = async (props) => {
|
|
|
8994
9063
|
]
|
|
8995
9064
|
}
|
|
8996
9065
|
)
|
|
8997
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
9066
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react61.default.Fragment, { children: [
|
|
8998
9067
|
renderedContainer,
|
|
8999
9068
|
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: paginationControl })
|
|
9000
9069
|
] })
|
|
@@ -9041,14 +9110,14 @@ var PageBodyRenderer = (props) => {
|
|
|
9041
9110
|
}
|
|
9042
9111
|
return true;
|
|
9043
9112
|
};
|
|
9044
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react62.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
9045
9114
|
{
|
|
9046
9115
|
}
|
|
9047
9116
|
const SelectedNode = NodeTypes[node.type];
|
|
9048
9117
|
if (!shouldRenderNode(node)) {
|
|
9049
9118
|
return null;
|
|
9050
9119
|
}
|
|
9051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react62.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react62.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react62.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9052
9121
|
SelectedNode,
|
|
9053
9122
|
{
|
|
9054
9123
|
node,
|
|
@@ -9064,7 +9133,7 @@ var PageBodyRenderer = (props) => {
|
|
|
9064
9133
|
device: props.device,
|
|
9065
9134
|
widgetRenderer: props.widgetRenderer
|
|
9066
9135
|
}
|
|
9067
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9136
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react62.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9068
9137
|
SelectedNode,
|
|
9069
9138
|
{
|
|
9070
9139
|
node,
|
|
@@ -9085,10 +9154,10 @@ var PageBodyRenderer = (props) => {
|
|
|
9085
9154
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
9086
9155
|
|
|
9087
9156
|
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
9088
|
-
var
|
|
9157
|
+
var import_react63 = require("react");
|
|
9089
9158
|
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
9090
9159
|
function EnterAnimationHydrator() {
|
|
9091
|
-
(0,
|
|
9160
|
+
(0, import_react63.useEffect)(() => {
|
|
9092
9161
|
let observer;
|
|
9093
9162
|
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
9094
9163
|
const revealAnimatedElements = () => {
|
|
@@ -9133,22 +9202,22 @@ function EnterAnimationHydrator() {
|
|
|
9133
9202
|
}
|
|
9134
9203
|
|
|
9135
9204
|
// src/components/Toast.tsx
|
|
9136
|
-
var
|
|
9205
|
+
var import_react64 = require("react");
|
|
9137
9206
|
init_ToastService();
|
|
9138
9207
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
9139
9208
|
var Toast = () => {
|
|
9140
|
-
const [showToast, setShowToast] = (0,
|
|
9141
|
-
const [message, setMessage] = (0,
|
|
9142
|
-
const [messageType, setMessageType] = (0,
|
|
9143
|
-
const timeoutRef = (0,
|
|
9144
|
-
const closeToast = (0,
|
|
9209
|
+
const [showToast, setShowToast] = (0, import_react64.useState)(false);
|
|
9210
|
+
const [message, setMessage] = (0, import_react64.useState)("");
|
|
9211
|
+
const [messageType, setMessageType] = (0, import_react64.useState)("error");
|
|
9212
|
+
const timeoutRef = (0, import_react64.useRef)(null);
|
|
9213
|
+
const closeToast = (0, import_react64.useCallback)(() => {
|
|
9145
9214
|
if (timeoutRef.current) {
|
|
9146
9215
|
clearTimeout(timeoutRef.current);
|
|
9147
9216
|
timeoutRef.current = null;
|
|
9148
9217
|
}
|
|
9149
9218
|
setShowToast(false);
|
|
9150
9219
|
}, []);
|
|
9151
|
-
const showMessage = (0,
|
|
9220
|
+
const showMessage = (0, import_react64.useCallback)((message2, messageType2) => {
|
|
9152
9221
|
if (timeoutRef.current) {
|
|
9153
9222
|
clearTimeout(timeoutRef.current);
|
|
9154
9223
|
}
|
|
@@ -9160,7 +9229,7 @@ var Toast = () => {
|
|
|
9160
9229
|
timeoutRef.current = null;
|
|
9161
9230
|
}, 4e3);
|
|
9162
9231
|
}, []);
|
|
9163
|
-
(0,
|
|
9232
|
+
(0, import_react64.useEffect)(() => {
|
|
9164
9233
|
ToastService_default.initialize(showMessage, closeToast);
|
|
9165
9234
|
return () => {
|
|
9166
9235
|
closeToast();
|
|
@@ -9254,15 +9323,15 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
9254
9323
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
9255
9324
|
|
|
9256
9325
|
// src/components/dataForm/DataList.tsx
|
|
9257
|
-
var
|
|
9326
|
+
var import_react67 = __toESM(require("react"));
|
|
9258
9327
|
init_InputControl();
|
|
9259
9328
|
var import_navigation3 = require("next/navigation");
|
|
9260
9329
|
|
|
9261
9330
|
// src/components/dataForm/NoContentView.tsx
|
|
9262
|
-
var
|
|
9331
|
+
var import_react65 = __toESM(require("react"));
|
|
9263
9332
|
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
9264
9333
|
var NoContentView = (props) => {
|
|
9265
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react65.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
9266
9335
|
};
|
|
9267
9336
|
var NoContentView_default = NoContentView;
|
|
9268
9337
|
|
|
@@ -9270,10 +9339,10 @@ var NoContentView_default = NoContentView;
|
|
|
9270
9339
|
init_InputControlType();
|
|
9271
9340
|
|
|
9272
9341
|
// src/components/dataForm/ContentView.tsx
|
|
9273
|
-
var
|
|
9342
|
+
var import_react66 = __toESM(require("react"));
|
|
9274
9343
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
9275
9344
|
var ContentView = (props) => {
|
|
9276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
9345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react66.default.Fragment, { children: [
|
|
9277
9346
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
9278
9347
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
9279
9348
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -9370,12 +9439,12 @@ var DataList = (props) => {
|
|
|
9370
9439
|
let activePageNumber = 0;
|
|
9371
9440
|
let pages = 0;
|
|
9372
9441
|
console.log(props.addLinkText);
|
|
9373
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
9374
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
9375
|
-
(0,
|
|
9442
|
+
const [isDataFound, setIsDataFound] = (0, import_react67.useState)(null);
|
|
9443
|
+
const [searchTerm, setSearchTerm] = (0, import_react67.useState)(props.query?.searchTerm ?? "");
|
|
9444
|
+
(0, import_react67.useEffect)(() => {
|
|
9376
9445
|
setSearchTerm(props.query?.searchTerm ?? "");
|
|
9377
9446
|
}, [props.query?.searchTerm]);
|
|
9378
|
-
(0,
|
|
9447
|
+
(0, import_react67.useEffect)(() => {
|
|
9379
9448
|
if (props?.dataset) {
|
|
9380
9449
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
9381
9450
|
setIsDataFound(true);
|
|
@@ -9384,7 +9453,7 @@ var DataList = (props) => {
|
|
|
9384
9453
|
}
|
|
9385
9454
|
}
|
|
9386
9455
|
}, [props.dataset]);
|
|
9387
|
-
(0,
|
|
9456
|
+
(0, import_react67.useEffect)(() => {
|
|
9388
9457
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
9389
9458
|
const filterQuery = props.query["$filter"];
|
|
9390
9459
|
props.filters.forEach((filter) => {
|
|
@@ -9412,11 +9481,11 @@ var DataList = (props) => {
|
|
|
9412
9481
|
inputValues: {},
|
|
9413
9482
|
lastPropertyChanged: ""
|
|
9414
9483
|
};
|
|
9415
|
-
const [formState, dispatch] = (0,
|
|
9484
|
+
const [formState, dispatch] = (0, import_react67.useReducer)(FormReducer_default, initialState);
|
|
9416
9485
|
const getSearchableColumns = () => {
|
|
9417
9486
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
9418
9487
|
};
|
|
9419
|
-
const handleFilterChange = (0,
|
|
9488
|
+
const handleFilterChange = (0, import_react67.useCallback)(
|
|
9420
9489
|
(updatedValues) => {
|
|
9421
9490
|
dispatch({
|
|
9422
9491
|
type: FORM_INPUT_UPDATE,
|
|
@@ -9447,7 +9516,7 @@ var DataList = (props) => {
|
|
|
9447
9516
|
},
|
|
9448
9517
|
[dispatch, props, router]
|
|
9449
9518
|
);
|
|
9450
|
-
(0,
|
|
9519
|
+
(0, import_react67.useEffect)(() => {
|
|
9451
9520
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
9452
9521
|
return;
|
|
9453
9522
|
}
|
|
@@ -9485,7 +9554,7 @@ var DataList = (props) => {
|
|
|
9485
9554
|
const renderPageNumbers = () => {
|
|
9486
9555
|
if (pages <= 10) {
|
|
9487
9556
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
9488
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9557
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9489
9558
|
Hyperlink,
|
|
9490
9559
|
{
|
|
9491
9560
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -9499,7 +9568,7 @@ var DataList = (props) => {
|
|
|
9499
9568
|
const showLastPages = activePageNumber > pages - 5;
|
|
9500
9569
|
if (showFirstPages) {
|
|
9501
9570
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
9502
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9571
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9503
9572
|
Hyperlink,
|
|
9504
9573
|
{
|
|
9505
9574
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -9565,7 +9634,7 @@ var DataList = (props) => {
|
|
|
9565
9634
|
),
|
|
9566
9635
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
9567
9636
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
9568
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9637
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9569
9638
|
Hyperlink,
|
|
9570
9639
|
{
|
|
9571
9640
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -9597,7 +9666,7 @@ var DataList = (props) => {
|
|
|
9597
9666
|
Array.from(
|
|
9598
9667
|
{ length: 5 },
|
|
9599
9668
|
(_, index) => activePageNumber - 2 + index
|
|
9600
|
-
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9669
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9601
9670
|
Hyperlink,
|
|
9602
9671
|
{
|
|
9603
9672
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -9643,7 +9712,7 @@ var DataList = (props) => {
|
|
|
9643
9712
|
}
|
|
9644
9713
|
}
|
|
9645
9714
|
};
|
|
9646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
9715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_react67.default.Fragment, { children: [
|
|
9647
9716
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(ContentView_default, { isDataFound, children: [
|
|
9648
9717
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
9649
9718
|
"div",
|
|
@@ -9736,7 +9805,7 @@ var DataList = (props) => {
|
|
|
9736
9805
|
}
|
|
9737
9806
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("tr", { className: validityClass, children: [
|
|
9738
9807
|
props?.columns?.map((column, colindex) => {
|
|
9739
|
-
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9740
9809
|
"td",
|
|
9741
9810
|
{
|
|
9742
9811
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -9932,7 +10001,7 @@ var DataList = (props) => {
|
|
|
9932
10001
|
var DataList_default = DataList;
|
|
9933
10002
|
|
|
9934
10003
|
// src/components/dataForm/DataListRenderer.tsx
|
|
9935
|
-
var
|
|
10004
|
+
var import_react68 = __toESM(require("react"));
|
|
9936
10005
|
init_ServiceClient();
|
|
9937
10006
|
init_OdataBuilder();
|
|
9938
10007
|
init_SelectWithSearchInput();
|
|
@@ -9992,14 +10061,14 @@ var DataListRenderer = ({
|
|
|
9992
10061
|
widgetProps
|
|
9993
10062
|
}) => {
|
|
9994
10063
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
9995
|
-
const [columns, setColumns] = (0,
|
|
9996
|
-
const [dataset, setDataset] = (0,
|
|
9997
|
-
const [filter, setFilters] = (0,
|
|
9998
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
9999
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
10000
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
10064
|
+
const [columns, setColumns] = (0, import_react68.useState)([]);
|
|
10065
|
+
const [dataset, setDataset] = (0, import_react68.useState)();
|
|
10066
|
+
const [filter, setFilters] = (0, import_react68.useState)([]);
|
|
10067
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react68.useState)("");
|
|
10068
|
+
const [addLinkText, setAddLinkText] = (0, import_react68.useState)("");
|
|
10069
|
+
const [serviceRoute, setServiceRoute] = (0, import_react68.useState)("");
|
|
10001
10070
|
const pathname = (0, import_navigation4.usePathname)();
|
|
10002
|
-
(0,
|
|
10071
|
+
(0, import_react68.useEffect)(() => {
|
|
10003
10072
|
if (!formDefinition) return;
|
|
10004
10073
|
setColumns(mapApiToColumns(formDefinition));
|
|
10005
10074
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -10012,7 +10081,7 @@ var DataListRenderer = ({
|
|
|
10012
10081
|
setAddLinkHref(resolvedAddLinkHref);
|
|
10013
10082
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
10014
10083
|
}, [formDefinition, params]);
|
|
10015
|
-
(0,
|
|
10084
|
+
(0, import_react68.useEffect)(() => {
|
|
10016
10085
|
const fetchData = async () => {
|
|
10017
10086
|
if (!serviceRoute) return;
|
|
10018
10087
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -10032,7 +10101,7 @@ var DataListRenderer = ({
|
|
|
10032
10101
|
isActive: landingPageUrl === pathname
|
|
10033
10102
|
};
|
|
10034
10103
|
});
|
|
10035
|
-
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
10104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_react68.default.Fragment, { children: [
|
|
10036
10105
|
resolvedTabs.length > 0 && // <NavigationTabsV2
|
|
10037
10106
|
// tabs={resolvedTabs}
|
|
10038
10107
|
// params={(widgetProps?.params ?? params) as Record<string, any>}
|
|
@@ -10060,14 +10129,14 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
10060
10129
|
init_InputControlType();
|
|
10061
10130
|
|
|
10062
10131
|
// src/components/dataForm/DataForm.tsx
|
|
10063
|
-
var
|
|
10132
|
+
var import_react70 = __toESM(require("react"));
|
|
10064
10133
|
init_InputControl();
|
|
10065
10134
|
init_Icon();
|
|
10066
10135
|
init_Button();
|
|
10067
10136
|
init_StyleTypes();
|
|
10068
10137
|
|
|
10069
10138
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
10070
|
-
var
|
|
10139
|
+
var import_react69 = __toESM(require("react"));
|
|
10071
10140
|
init_InputControl();
|
|
10072
10141
|
|
|
10073
10142
|
// src/components/dataForm/StyleTypes.tsx
|
|
@@ -10107,7 +10176,7 @@ var DataFormChildSection = (props) => {
|
|
|
10107
10176
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
10108
10177
|
};
|
|
10109
10178
|
const childItemsToRender = getChildItemsForRendering();
|
|
10110
|
-
const handleChildInputChange = (0,
|
|
10179
|
+
const handleChildInputChange = (0, import_react69.useCallback)(
|
|
10111
10180
|
(updatedValues) => {
|
|
10112
10181
|
if (isOneToOne) {
|
|
10113
10182
|
props.callback({
|
|
@@ -10134,7 +10203,7 @@ var DataFormChildSection = (props) => {
|
|
|
10134
10203
|
},
|
|
10135
10204
|
[props, isOneToOne, childItemsToRender]
|
|
10136
10205
|
);
|
|
10137
|
-
const onAddRow = (0,
|
|
10206
|
+
const onAddRow = (0, import_react69.useCallback)(() => {
|
|
10138
10207
|
props.callback({
|
|
10139
10208
|
sectionName: props.section.name,
|
|
10140
10209
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -10143,7 +10212,7 @@ var DataFormChildSection = (props) => {
|
|
|
10143
10212
|
rowIndex: -1
|
|
10144
10213
|
});
|
|
10145
10214
|
}, [props]);
|
|
10146
|
-
const onDeleteRow = (0,
|
|
10215
|
+
const onDeleteRow = (0, import_react69.useCallback)(
|
|
10147
10216
|
(filteredIndex) => {
|
|
10148
10217
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
10149
10218
|
if (visibleItem) {
|
|
@@ -10163,7 +10232,7 @@ var DataFormChildSection = (props) => {
|
|
|
10163
10232
|
childItemsToRender,
|
|
10164
10233
|
allChildItems: childItems
|
|
10165
10234
|
});
|
|
10166
|
-
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
10235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react69.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
10167
10236
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
10168
10237
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
10169
10238
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
@@ -10185,7 +10254,7 @@ var DataFormChildSection = (props) => {
|
|
|
10185
10254
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
10186
10255
|
const { item, originalIndex } = visibleItem;
|
|
10187
10256
|
const rowKey = originalIndex;
|
|
10188
|
-
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
10257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react69.default.Fragment, { children: section.sectionRows.map(
|
|
10189
10258
|
(sectionRow, sectionRowIndex) => {
|
|
10190
10259
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
10191
10260
|
"tr",
|
|
@@ -10256,7 +10325,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
10256
10325
|
// src/components/dataForm/DataForm.tsx
|
|
10257
10326
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
10258
10327
|
var DataForm = (props) => {
|
|
10259
|
-
const formRef = (0,
|
|
10328
|
+
const formRef = (0, import_react70.useRef)(null);
|
|
10260
10329
|
console.log(props.dataItem, "dssads");
|
|
10261
10330
|
const initialState = {
|
|
10262
10331
|
inputValues: {},
|
|
@@ -10265,9 +10334,9 @@ var DataForm = (props) => {
|
|
|
10265
10334
|
const childInitialState = {
|
|
10266
10335
|
inputValues: []
|
|
10267
10336
|
};
|
|
10268
|
-
const [formState, dispatch] = (0,
|
|
10337
|
+
const [formState, dispatch] = (0, import_react70.useReducer)(FormReducer_default, initialState);
|
|
10269
10338
|
console.log(props.sections, "sections");
|
|
10270
|
-
const clearHiddenChildSections = (0,
|
|
10339
|
+
const clearHiddenChildSections = (0, import_react70.useCallback)(
|
|
10271
10340
|
(changedProperty, newValues) => {
|
|
10272
10341
|
if (!props.sections) return;
|
|
10273
10342
|
const allChildSections = [];
|
|
@@ -10305,7 +10374,7 @@ var DataForm = (props) => {
|
|
|
10305
10374
|
},
|
|
10306
10375
|
[props.sections, formState.inputValues]
|
|
10307
10376
|
);
|
|
10308
|
-
const handleInputChange = (0,
|
|
10377
|
+
const handleInputChange = (0, import_react70.useCallback)(
|
|
10309
10378
|
async (updatedValues) => {
|
|
10310
10379
|
dispatch({
|
|
10311
10380
|
type: FORM_INPUT_UPDATE,
|
|
@@ -10320,7 +10389,7 @@ var DataForm = (props) => {
|
|
|
10320
10389
|
},
|
|
10321
10390
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
10322
10391
|
);
|
|
10323
|
-
const fetchData = (0,
|
|
10392
|
+
const fetchData = (0, import_react70.useCallback)(async () => {
|
|
10324
10393
|
if (!props.rules) return;
|
|
10325
10394
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
10326
10395
|
return;
|
|
@@ -10351,7 +10420,7 @@ var DataForm = (props) => {
|
|
|
10351
10420
|
console.error("Error fetching data:", error);
|
|
10352
10421
|
}
|
|
10353
10422
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
10354
|
-
(0,
|
|
10423
|
+
(0, import_react70.useEffect)(() => {
|
|
10355
10424
|
fetchData();
|
|
10356
10425
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
10357
10426
|
function replacePlaceholders(template, context, params) {
|
|
@@ -10371,7 +10440,7 @@ var DataForm = (props) => {
|
|
|
10371
10440
|
}
|
|
10372
10441
|
);
|
|
10373
10442
|
}
|
|
10374
|
-
const handleChildSectionChangeCallback = (0,
|
|
10443
|
+
const handleChildSectionChangeCallback = (0, import_react70.useCallback)(
|
|
10375
10444
|
(params) => {
|
|
10376
10445
|
dispatch({
|
|
10377
10446
|
type: params.actionType,
|
|
@@ -10416,7 +10485,7 @@ var DataForm = (props) => {
|
|
|
10416
10485
|
});
|
|
10417
10486
|
return cloned;
|
|
10418
10487
|
}
|
|
10419
|
-
const onClick = (0,
|
|
10488
|
+
const onClick = (0, import_react70.useCallback)(async () => {
|
|
10420
10489
|
if (props.onClick) {
|
|
10421
10490
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
10422
10491
|
const normalizedValues = normalizeChildSections(
|
|
@@ -10432,21 +10501,21 @@ var DataForm = (props) => {
|
|
|
10432
10501
|
return { isSuccessful: true };
|
|
10433
10502
|
}
|
|
10434
10503
|
}, [formState, props]);
|
|
10435
|
-
const handleAdditionalOnClick = (0,
|
|
10504
|
+
const handleAdditionalOnClick = (0, import_react70.useCallback)(async () => {
|
|
10436
10505
|
if (props.additionalActions?.onClick) {
|
|
10437
10506
|
return await props.additionalActions.onClick(formState);
|
|
10438
10507
|
} else {
|
|
10439
10508
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
10440
10509
|
}
|
|
10441
10510
|
}, [formState, props]);
|
|
10442
|
-
const onDelete = (0,
|
|
10511
|
+
const onDelete = (0, import_react70.useCallback)(async () => {
|
|
10443
10512
|
if (props.onDelete) {
|
|
10444
10513
|
return await props.onDelete(formState);
|
|
10445
10514
|
} else {
|
|
10446
10515
|
return { isSuccessful: true };
|
|
10447
10516
|
}
|
|
10448
10517
|
}, [formState, props]);
|
|
10449
|
-
(0,
|
|
10518
|
+
(0, import_react70.useEffect)(() => {
|
|
10450
10519
|
if (props.dataItem) {
|
|
10451
10520
|
dispatch({
|
|
10452
10521
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -10474,7 +10543,7 @@ var DataForm = (props) => {
|
|
|
10474
10543
|
return false;
|
|
10475
10544
|
}
|
|
10476
10545
|
}
|
|
10477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react70.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
10478
10547
|
props.title && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "inline-flex items-center gap-2 px-6 py-3 border border-neutral-200 bg-white shadow-sm rounded-t-md", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10479
10548
|
"div",
|
|
10480
10549
|
{
|
|
@@ -10508,7 +10577,7 @@ var DataForm = (props) => {
|
|
|
10508
10577
|
}
|
|
10509
10578
|
},
|
|
10510
10579
|
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
10511
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react70.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
10512
10581
|
section.sectionRows?.map(
|
|
10513
10582
|
(sectionRow, sectionRowIndex) => {
|
|
10514
10583
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -10519,7 +10588,7 @@ var DataForm = (props) => {
|
|
|
10519
10588
|
sectionRow.visible
|
|
10520
10589
|
);
|
|
10521
10590
|
}
|
|
10522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
10591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react70.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
10523
10592
|
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
10524
10593
|
"div",
|
|
10525
10594
|
{
|