@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260917110459 → 0.8.1-dev.20260919052532
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/{DataBindingControls-GRHOY57C.mjs → DataBindingControls-54BNRIUZ.mjs} +1 -1
- package/dist/{DataBindingControls-5HQK4HQH.mjs → DataBindingControls-AJKE3EWG.mjs} +1 -1
- package/dist/{InputControlClient-2MSQ6AFW.mjs → InputControlClient-IZXNAD2P.mjs} +13 -7
- package/dist/{InputControlClient-LD7GLFTL.mjs → InputControlClient-SROI2BE2.mjs} +1 -1
- package/dist/{chunk-BF4G3ZGG.mjs → chunk-A5UTFK4O.mjs} +13 -7
- package/dist/{chunk-H72AVQXX.mjs → chunk-XMAYRT62.mjs} +1 -1
- package/dist/index.js +41 -36
- package/dist/index.mjs +31 -32
- package/dist/server.js +41 -36
- package/dist/server.mjs +29 -30
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { useRouter } from "next/navigation";
|
|
|
13
13
|
|
|
14
14
|
// src/components/controls/edit/InputControl.tsx
|
|
15
15
|
import dynamic from "next/dynamic";
|
|
16
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
16
|
+
var InputControl = dynamic(() => import("./InputControlClient-IZXNAD2P.mjs"), {
|
|
17
17
|
ssr: false
|
|
18
18
|
});
|
|
19
19
|
var InputControl_default = InputControl;
|
|
@@ -732,14 +732,14 @@ var SelectWithSearchInput = (props) => {
|
|
|
732
732
|
useEffect3(() => {
|
|
733
733
|
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
734
734
|
const selected = list.find(
|
|
735
|
-
(x) => x[props.dataKeyFieldName]
|
|
735
|
+
(x) => String(x[props.dataKeyFieldName]) === String(props.value)
|
|
736
736
|
);
|
|
737
737
|
if (selected) {
|
|
738
738
|
setSearchTerm(selected[props.dataTextFieldName]);
|
|
739
739
|
setSelectedItem(selected);
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
}, [props.value, list]);
|
|
742
|
+
}, [props.value, list, props.dataKeyFieldName, props.dataTextFieldName]);
|
|
743
743
|
const filteredItems = list.filter((item) => {
|
|
744
744
|
const text = item[props.dataTextFieldName] ?? "";
|
|
745
745
|
return text.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
@@ -800,15 +800,21 @@ var SelectWithSearchInput = (props) => {
|
|
|
800
800
|
type: "text",
|
|
801
801
|
value: searchTerm,
|
|
802
802
|
onChange: (e) => {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
if (!isReadOnly) {
|
|
804
|
+
setSearchTerm(e.target.value);
|
|
805
|
+
setIsOpen(true);
|
|
806
|
+
setHighlightedIndex(-1);
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
onFocus: () => {
|
|
810
|
+
if (!isReadOnly) {
|
|
811
|
+
setIsOpen(true);
|
|
812
|
+
}
|
|
806
813
|
},
|
|
807
|
-
onFocus: () => setIsOpen(true),
|
|
808
814
|
onKeyDown: handleKeyDown,
|
|
809
815
|
placeholder: props.attributes?.placeholder ?? "Search...",
|
|
810
816
|
readOnly: isReadOnly,
|
|
811
|
-
disabled:
|
|
817
|
+
disabled: isReadOnly,
|
|
812
818
|
className: `peer mt-2 py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm
|
|
813
819
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
814
820
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none
|
|
@@ -716,14 +716,14 @@ var SelectWithSearchInput = (props) => {
|
|
|
716
716
|
useEffect3(() => {
|
|
717
717
|
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
718
718
|
const selected = list.find(
|
|
719
|
-
(x) => x[props.dataKeyFieldName]
|
|
719
|
+
(x) => String(x[props.dataKeyFieldName]) === String(props.value)
|
|
720
720
|
);
|
|
721
721
|
if (selected) {
|
|
722
722
|
setSearchTerm(selected[props.dataTextFieldName]);
|
|
723
723
|
setSelectedItem(selected);
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
}, [props.value, list]);
|
|
726
|
+
}, [props.value, list, props.dataKeyFieldName, props.dataTextFieldName]);
|
|
727
727
|
const filteredItems = list.filter((item) => {
|
|
728
728
|
const text = item[props.dataTextFieldName] ?? "";
|
|
729
729
|
return text.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
@@ -784,15 +784,21 @@ var SelectWithSearchInput = (props) => {
|
|
|
784
784
|
type: "text",
|
|
785
785
|
value: searchTerm,
|
|
786
786
|
onChange: (e) => {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
787
|
+
if (!isReadOnly) {
|
|
788
|
+
setSearchTerm(e.target.value);
|
|
789
|
+
setIsOpen(true);
|
|
790
|
+
setHighlightedIndex(-1);
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
onFocus: () => {
|
|
794
|
+
if (!isReadOnly) {
|
|
795
|
+
setIsOpen(true);
|
|
796
|
+
}
|
|
790
797
|
},
|
|
791
|
-
onFocus: () => setIsOpen(true),
|
|
792
798
|
onKeyDown: handleKeyDown,
|
|
793
799
|
placeholder: props.attributes?.placeholder ?? "Search...",
|
|
794
800
|
readOnly: isReadOnly,
|
|
795
|
-
disabled:
|
|
801
|
+
disabled: isReadOnly,
|
|
796
802
|
className: `peer mt-2 py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm
|
|
797
803
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
798
804
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/components/controls/edit/InputControl.tsx
|
|
5
5
|
import dynamic from "next/dynamic";
|
|
6
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
6
|
+
var InputControl = dynamic(() => import("./InputControlClient-SROI2BE2.mjs"), {
|
|
7
7
|
ssr: false
|
|
8
8
|
});
|
|
9
9
|
var InputControl_default = InputControl;
|
package/dist/index.js
CHANGED
|
@@ -2975,14 +2975,14 @@ var init_SelectWithSearchInput = __esm({
|
|
|
2975
2975
|
(0, import_react34.useEffect)(() => {
|
|
2976
2976
|
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
2977
2977
|
const selected = list.find(
|
|
2978
|
-
(x) => x[props.dataKeyFieldName]
|
|
2978
|
+
(x) => String(x[props.dataKeyFieldName]) === String(props.value)
|
|
2979
2979
|
);
|
|
2980
2980
|
if (selected) {
|
|
2981
2981
|
setSearchTerm(selected[props.dataTextFieldName]);
|
|
2982
2982
|
setSelectedItem(selected);
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
|
-
}, [props.value, list]);
|
|
2985
|
+
}, [props.value, list, props.dataKeyFieldName, props.dataTextFieldName]);
|
|
2986
2986
|
const filteredItems = list.filter((item) => {
|
|
2987
2987
|
const text = item[props.dataTextFieldName] ?? "";
|
|
2988
2988
|
return text.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
@@ -3043,15 +3043,21 @@ var init_SelectWithSearchInput = __esm({
|
|
|
3043
3043
|
type: "text",
|
|
3044
3044
|
value: searchTerm,
|
|
3045
3045
|
onChange: (e) => {
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3046
|
+
if (!isReadOnly) {
|
|
3047
|
+
setSearchTerm(e.target.value);
|
|
3048
|
+
setIsOpen(true);
|
|
3049
|
+
setHighlightedIndex(-1);
|
|
3050
|
+
}
|
|
3051
|
+
},
|
|
3052
|
+
onFocus: () => {
|
|
3053
|
+
if (!isReadOnly) {
|
|
3054
|
+
setIsOpen(true);
|
|
3055
|
+
}
|
|
3049
3056
|
},
|
|
3050
|
-
onFocus: () => setIsOpen(true),
|
|
3051
3057
|
onKeyDown: handleKeyDown,
|
|
3052
3058
|
placeholder: props.attributes?.placeholder ?? "Search...",
|
|
3053
3059
|
readOnly: isReadOnly,
|
|
3054
|
-
disabled:
|
|
3060
|
+
disabled: isReadOnly,
|
|
3055
3061
|
className: `peer mt-2 py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm
|
|
3056
3062
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
3057
3063
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none
|
|
@@ -8157,6 +8163,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
8157
8163
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
8158
8164
|
}, obj);
|
|
8159
8165
|
};
|
|
8166
|
+
var parseDocuments = (value) => {
|
|
8167
|
+
if (typeof value === "string") {
|
|
8168
|
+
const trimmed = value.trim();
|
|
8169
|
+
if (!trimmed) return [];
|
|
8170
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
8171
|
+
try {
|
|
8172
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
8173
|
+
} catch {
|
|
8174
|
+
return [];
|
|
8175
|
+
}
|
|
8176
|
+
}
|
|
8177
|
+
return [{ assetUrl: trimmed }];
|
|
8178
|
+
}
|
|
8179
|
+
if (Array.isArray(value)) {
|
|
8180
|
+
return value.filter(
|
|
8181
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
8182
|
+
);
|
|
8183
|
+
}
|
|
8184
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
8185
|
+
const asset = value;
|
|
8186
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
8187
|
+
}
|
|
8188
|
+
return [];
|
|
8189
|
+
};
|
|
8160
8190
|
var PdfIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
8161
8191
|
"svg",
|
|
8162
8192
|
{
|
|
@@ -8467,38 +8497,13 @@ var getFileDetails2 = (url) => {
|
|
|
8467
8497
|
return { Icon: Icon2, extLabel };
|
|
8468
8498
|
};
|
|
8469
8499
|
var DocumentNode = (props) => {
|
|
8470
|
-
console.log("DocumentNode rendered");
|
|
8471
|
-
console.log("props", props);
|
|
8472
|
-
console.log("node", props.node);
|
|
8473
8500
|
let documents = [];
|
|
8474
8501
|
if (props.dataitem && props.node.documentKey) {
|
|
8475
8502
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
const parsed = JSON.parse(trimmed);
|
|
8481
|
-
if (Array.isArray(parsed)) {
|
|
8482
|
-
documents = parsed.filter(
|
|
8483
|
-
(item) => item && item.assetUrl
|
|
8484
|
-
);
|
|
8485
|
-
} else if (parsed?.assetUrl) {
|
|
8486
|
-
documents = [parsed];
|
|
8487
|
-
}
|
|
8488
|
-
} catch {
|
|
8489
|
-
}
|
|
8490
|
-
} else {
|
|
8491
|
-
documents = [
|
|
8492
|
-
{
|
|
8493
|
-
assetUrl: docData
|
|
8494
|
-
}
|
|
8495
|
-
];
|
|
8496
|
-
}
|
|
8497
|
-
} else if (Array.isArray(docData)) {
|
|
8498
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
8499
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
8500
|
-
documents = [docData];
|
|
8501
|
-
}
|
|
8503
|
+
documents = parseDocuments(docData);
|
|
8504
|
+
}
|
|
8505
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
8506
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
8502
8507
|
}
|
|
8503
8508
|
if (documents.length === 0) {
|
|
8504
8509
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-SNDGEYWZ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
InputControl_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XMAYRT62.mjs";
|
|
12
12
|
import "./chunk-JDX47MFV.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CheckboxInput_default,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
SelectWithSearchInput_default,
|
|
28
28
|
Select_default,
|
|
29
29
|
TimeInput_default
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-A5UTFK4O.mjs";
|
|
31
31
|
import {
|
|
32
32
|
Hyperlink,
|
|
33
33
|
Icon_default
|
|
@@ -1926,6 +1926,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
1926
1926
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
1927
1927
|
}, obj);
|
|
1928
1928
|
};
|
|
1929
|
+
var parseDocuments = (value) => {
|
|
1930
|
+
if (typeof value === "string") {
|
|
1931
|
+
const trimmed = value.trim();
|
|
1932
|
+
if (!trimmed) return [];
|
|
1933
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
1934
|
+
try {
|
|
1935
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
1936
|
+
} catch {
|
|
1937
|
+
return [];
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
return [{ assetUrl: trimmed }];
|
|
1941
|
+
}
|
|
1942
|
+
if (Array.isArray(value)) {
|
|
1943
|
+
return value.filter(
|
|
1944
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
1948
|
+
const asset = value;
|
|
1949
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
1950
|
+
}
|
|
1951
|
+
return [];
|
|
1952
|
+
};
|
|
1929
1953
|
var PdfIcon = () => /* @__PURE__ */ jsxs13(
|
|
1930
1954
|
"svg",
|
|
1931
1955
|
{
|
|
@@ -2236,38 +2260,13 @@ var getFileDetails = (url) => {
|
|
|
2236
2260
|
return { Icon, extLabel };
|
|
2237
2261
|
};
|
|
2238
2262
|
var DocumentNode = (props) => {
|
|
2239
|
-
console.log("DocumentNode rendered");
|
|
2240
|
-
console.log("props", props);
|
|
2241
|
-
console.log("node", props.node);
|
|
2242
2263
|
let documents = [];
|
|
2243
2264
|
if (props.dataitem && props.node.documentKey) {
|
|
2244
2265
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
const parsed = JSON.parse(trimmed);
|
|
2250
|
-
if (Array.isArray(parsed)) {
|
|
2251
|
-
documents = parsed.filter(
|
|
2252
|
-
(item) => item && item.assetUrl
|
|
2253
|
-
);
|
|
2254
|
-
} else if (parsed?.assetUrl) {
|
|
2255
|
-
documents = [parsed];
|
|
2256
|
-
}
|
|
2257
|
-
} catch {
|
|
2258
|
-
}
|
|
2259
|
-
} else {
|
|
2260
|
-
documents = [
|
|
2261
|
-
{
|
|
2262
|
-
assetUrl: docData
|
|
2263
|
-
}
|
|
2264
|
-
];
|
|
2265
|
-
}
|
|
2266
|
-
} else if (Array.isArray(docData)) {
|
|
2267
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
2268
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
2269
|
-
documents = [docData];
|
|
2270
|
-
}
|
|
2266
|
+
documents = parseDocuments(docData);
|
|
2267
|
+
}
|
|
2268
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
2269
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
2271
2270
|
}
|
|
2272
2271
|
if (documents.length === 0) {
|
|
2273
2272
|
return /* @__PURE__ */ jsx34(Fragment6, { children: /* @__PURE__ */ jsxs13("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
|
@@ -2392,7 +2391,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2392
2391
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2393
2392
|
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2394
2393
|
var Pagination = dynamic13(() => import("./Pagination-BDWRNSFB.mjs"), { ssr: true });
|
|
2395
|
-
var DataBindingControls = dynamic13(() => import("./DataBindingControls-
|
|
2394
|
+
var DataBindingControls = dynamic13(() => import("./DataBindingControls-AJKE3EWG.mjs"), {
|
|
2396
2395
|
ssr: true
|
|
2397
2396
|
});
|
|
2398
2397
|
var Slider = dynamic13(() => import("./Slider-IVPJBPE5.mjs"), {
|
package/dist/server.js
CHANGED
|
@@ -4454,14 +4454,14 @@ var init_SelectWithSearchInput = __esm({
|
|
|
4454
4454
|
(0, import_react50.useEffect)(() => {
|
|
4455
4455
|
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
4456
4456
|
const selected = list.find(
|
|
4457
|
-
(x) => x[props.dataKeyFieldName]
|
|
4457
|
+
(x) => String(x[props.dataKeyFieldName]) === String(props.value)
|
|
4458
4458
|
);
|
|
4459
4459
|
if (selected) {
|
|
4460
4460
|
setSearchTerm(selected[props.dataTextFieldName]);
|
|
4461
4461
|
setSelectedItem(selected);
|
|
4462
4462
|
}
|
|
4463
4463
|
}
|
|
4464
|
-
}, [props.value, list]);
|
|
4464
|
+
}, [props.value, list, props.dataKeyFieldName, props.dataTextFieldName]);
|
|
4465
4465
|
const filteredItems = list.filter((item) => {
|
|
4466
4466
|
const text = item[props.dataTextFieldName] ?? "";
|
|
4467
4467
|
return text.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
@@ -4522,15 +4522,21 @@ var init_SelectWithSearchInput = __esm({
|
|
|
4522
4522
|
type: "text",
|
|
4523
4523
|
value: searchTerm,
|
|
4524
4524
|
onChange: (e) => {
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4525
|
+
if (!isReadOnly) {
|
|
4526
|
+
setSearchTerm(e.target.value);
|
|
4527
|
+
setIsOpen(true);
|
|
4528
|
+
setHighlightedIndex(-1);
|
|
4529
|
+
}
|
|
4530
|
+
},
|
|
4531
|
+
onFocus: () => {
|
|
4532
|
+
if (!isReadOnly) {
|
|
4533
|
+
setIsOpen(true);
|
|
4534
|
+
}
|
|
4528
4535
|
},
|
|
4529
|
-
onFocus: () => setIsOpen(true),
|
|
4530
4536
|
onKeyDown: handleKeyDown,
|
|
4531
4537
|
placeholder: props.attributes?.placeholder ?? "Search...",
|
|
4532
4538
|
readOnly: isReadOnly,
|
|
4533
|
-
disabled:
|
|
4539
|
+
disabled: isReadOnly,
|
|
4534
4540
|
className: `peer mt-2 py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm
|
|
4535
4541
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
4536
4542
|
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none
|
|
@@ -8126,6 +8132,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
8126
8132
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
8127
8133
|
}, obj);
|
|
8128
8134
|
};
|
|
8135
|
+
var parseDocuments = (value) => {
|
|
8136
|
+
if (typeof value === "string") {
|
|
8137
|
+
const trimmed = value.trim();
|
|
8138
|
+
if (!trimmed) return [];
|
|
8139
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
8140
|
+
try {
|
|
8141
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
8142
|
+
} catch {
|
|
8143
|
+
return [];
|
|
8144
|
+
}
|
|
8145
|
+
}
|
|
8146
|
+
return [{ assetUrl: trimmed }];
|
|
8147
|
+
}
|
|
8148
|
+
if (Array.isArray(value)) {
|
|
8149
|
+
return value.filter(
|
|
8150
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
8151
|
+
);
|
|
8152
|
+
}
|
|
8153
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
8154
|
+
const asset = value;
|
|
8155
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
8156
|
+
}
|
|
8157
|
+
return [];
|
|
8158
|
+
};
|
|
8129
8159
|
var PdfIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8130
8160
|
"svg",
|
|
8131
8161
|
{
|
|
@@ -8436,38 +8466,13 @@ var getFileDetails2 = (url) => {
|
|
|
8436
8466
|
return { Icon: Icon2, extLabel };
|
|
8437
8467
|
};
|
|
8438
8468
|
var DocumentNode = (props) => {
|
|
8439
|
-
console.log("DocumentNode rendered");
|
|
8440
|
-
console.log("props", props);
|
|
8441
|
-
console.log("node", props.node);
|
|
8442
8469
|
let documents = [];
|
|
8443
8470
|
if (props.dataitem && props.node.documentKey) {
|
|
8444
8471
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
const parsed = JSON.parse(trimmed);
|
|
8450
|
-
if (Array.isArray(parsed)) {
|
|
8451
|
-
documents = parsed.filter(
|
|
8452
|
-
(item) => item && item.assetUrl
|
|
8453
|
-
);
|
|
8454
|
-
} else if (parsed?.assetUrl) {
|
|
8455
|
-
documents = [parsed];
|
|
8456
|
-
}
|
|
8457
|
-
} catch {
|
|
8458
|
-
}
|
|
8459
|
-
} else {
|
|
8460
|
-
documents = [
|
|
8461
|
-
{
|
|
8462
|
-
assetUrl: docData
|
|
8463
|
-
}
|
|
8464
|
-
];
|
|
8465
|
-
}
|
|
8466
|
-
} else if (Array.isArray(docData)) {
|
|
8467
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
8468
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
8469
|
-
documents = [docData];
|
|
8470
|
-
}
|
|
8472
|
+
documents = parseDocuments(docData);
|
|
8473
|
+
}
|
|
8474
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
8475
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
8471
8476
|
}
|
|
8472
8477
|
if (documents.length === 0) {
|
|
8473
8478
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_jsx_runtime56.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
package/dist/server.mjs
CHANGED
|
@@ -1894,6 +1894,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
1894
1894
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
1895
1895
|
}, obj);
|
|
1896
1896
|
};
|
|
1897
|
+
var parseDocuments = (value) => {
|
|
1898
|
+
if (typeof value === "string") {
|
|
1899
|
+
const trimmed = value.trim();
|
|
1900
|
+
if (!trimmed) return [];
|
|
1901
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
1902
|
+
try {
|
|
1903
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
1904
|
+
} catch {
|
|
1905
|
+
return [];
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
return [{ assetUrl: trimmed }];
|
|
1909
|
+
}
|
|
1910
|
+
if (Array.isArray(value)) {
|
|
1911
|
+
return value.filter(
|
|
1912
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1915
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
1916
|
+
const asset = value;
|
|
1917
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
1918
|
+
}
|
|
1919
|
+
return [];
|
|
1920
|
+
};
|
|
1897
1921
|
var PdfIcon = () => /* @__PURE__ */ jsxs13(
|
|
1898
1922
|
"svg",
|
|
1899
1923
|
{
|
|
@@ -2204,38 +2228,13 @@ var getFileDetails = (url) => {
|
|
|
2204
2228
|
return { Icon, extLabel };
|
|
2205
2229
|
};
|
|
2206
2230
|
var DocumentNode = (props) => {
|
|
2207
|
-
console.log("DocumentNode rendered");
|
|
2208
|
-
console.log("props", props);
|
|
2209
|
-
console.log("node", props.node);
|
|
2210
2231
|
let documents = [];
|
|
2211
2232
|
if (props.dataitem && props.node.documentKey) {
|
|
2212
2233
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
const parsed = JSON.parse(trimmed);
|
|
2218
|
-
if (Array.isArray(parsed)) {
|
|
2219
|
-
documents = parsed.filter(
|
|
2220
|
-
(item) => item && item.assetUrl
|
|
2221
|
-
);
|
|
2222
|
-
} else if (parsed?.assetUrl) {
|
|
2223
|
-
documents = [parsed];
|
|
2224
|
-
}
|
|
2225
|
-
} catch {
|
|
2226
|
-
}
|
|
2227
|
-
} else {
|
|
2228
|
-
documents = [
|
|
2229
|
-
{
|
|
2230
|
-
assetUrl: docData
|
|
2231
|
-
}
|
|
2232
|
-
];
|
|
2233
|
-
}
|
|
2234
|
-
} else if (Array.isArray(docData)) {
|
|
2235
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
2236
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
2237
|
-
documents = [docData];
|
|
2238
|
-
}
|
|
2234
|
+
documents = parseDocuments(docData);
|
|
2235
|
+
}
|
|
2236
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
2237
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
2239
2238
|
}
|
|
2240
2239
|
if (documents.length === 0) {
|
|
2241
2240
|
return /* @__PURE__ */ jsx34(Fragment6, { children: /* @__PURE__ */ jsxs13("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
|
@@ -2360,7 +2359,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2360
2359
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2361
2360
|
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2362
2361
|
var Pagination = dynamic13(() => import("./Pagination-OSLUL7SF.mjs"), { ssr: true });
|
|
2363
|
-
var DataBindingControls = dynamic13(() => import("./DataBindingControls-
|
|
2362
|
+
var DataBindingControls = dynamic13(() => import("./DataBindingControls-54BNRIUZ.mjs"), {
|
|
2364
2363
|
ssr: true
|
|
2365
2364
|
});
|
|
2366
2365
|
var Slider = dynamic13(() => import("./Slider-QIGKP6AE.mjs"), {
|