@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260831113446 → 0.8.1-dev.20260901054125
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/{CommentRendererClient-JYDYPHSQ.mjs → CommentRendererClient-FU5ZMGBV.mjs} +46 -2
- package/dist/{CommentRendererClient-5OIJYJ5Z.mjs → CommentRendererClient-L6GILW7U.mjs} +46 -2
- package/dist/{DataBindingControls-JLAO3NJL.mjs → DataBindingControls-GWNAJ7PR.mjs} +2 -2
- package/dist/{DataBindingControls-Y4JXUDZV.mjs → DataBindingControls-WC3HBVVQ.mjs} +2 -2
- package/dist/{InputControlClient-POQDFVL3.mjs → InputControlClient-GRH7VSJR.mjs} +2 -7
- package/dist/{InputControlClient-XC24HYZX.mjs → InputControlClient-NHZU2L64.mjs} +81 -262
- package/dist/{Pagination-T7Z2NXKO.mjs → Pagination-JGUQJ2DH.mjs} +2 -2
- package/dist/{Pagination-QBPYDD66.mjs → Pagination-LNJ27L7U.mjs} +2 -2
- package/dist/{chunk-5TQWVOWH.mjs → chunk-2VS554XP.mjs} +1 -1
- package/dist/{chunk-XTG4JW2O.mjs → chunk-5VGTT4A5.mjs} +35 -215
- package/dist/{chunk-E4VOFO5Q.mjs → chunk-DTWPZPSX.mjs} +0 -3
- package/dist/{chunk-4R7F7LBL.mjs → chunk-IEY342PD.mjs} +0 -3
- package/dist/{chunk-GGG5MJLN.mjs → chunk-Q3LFGHLM.mjs} +1 -1
- package/dist/{chunk-X5ERUUQV.mjs → chunk-RG3CISAA.mjs} +1 -1
- package/dist/index.d.mts +1 -8
- package/dist/index.d.ts +1 -8
- package/dist/index.js +749 -856
- package/dist/index.mjs +75 -29
- package/dist/server.js +275 -378
- package/dist/server.mjs +71 -23
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -2509,7 +2509,7 @@ var init_CommentFileNode = __esm({
|
|
|
2509
2509
|
});
|
|
2510
2510
|
|
|
2511
2511
|
// src/components/controls/view/CommentNodeRenderer.tsx
|
|
2512
|
-
var import_react24, import_jsx_runtime36, TextLeafNode, renderChildren, headingLevelFromTag, CommentNodeRenderer, CommentNodeRenderer_default;
|
|
2512
|
+
var import_react24, import_jsx_runtime36, LINK_STYLE, URL_PATTERN, linkifyText, TextLeafNode, renderChildren, headingLevelFromTag, CommentNodeRenderer, CommentNodeRenderer_default;
|
|
2513
2513
|
var init_CommentNodeRenderer = __esm({
|
|
2514
2514
|
"src/components/controls/view/CommentNodeRenderer.tsx"() {
|
|
2515
2515
|
"use strict";
|
|
@@ -2518,8 +2518,42 @@ var init_CommentNodeRenderer = __esm({
|
|
|
2518
2518
|
init_CommentImageNode();
|
|
2519
2519
|
init_CommentFileNode();
|
|
2520
2520
|
import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2521
|
+
LINK_STYLE = { textDecoration: "underline", wordBreak: "break-word" };
|
|
2522
|
+
URL_PATTERN = /(https?:\/\/[^\s<>"']+|www\.[^\s<>"']+)/gi;
|
|
2523
|
+
linkifyText = (text, keyPrefix) => {
|
|
2524
|
+
const parts = text.split(URL_PATTERN);
|
|
2525
|
+
if (parts.length === 1) {
|
|
2526
|
+
return text;
|
|
2527
|
+
}
|
|
2528
|
+
return parts.map((part, index) => {
|
|
2529
|
+
if (!part) {
|
|
2530
|
+
return null;
|
|
2531
|
+
}
|
|
2532
|
+
const isUrl = index % 2 === 1;
|
|
2533
|
+
if (!isUrl) {
|
|
2534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react24.default.Fragment, { children: part }, `${keyPrefix}-${index}`);
|
|
2535
|
+
}
|
|
2536
|
+
const trimmed = part.replace(/[.,;:!?)\]]+$/, "");
|
|
2537
|
+
const trailing = part.slice(trimmed.length);
|
|
2538
|
+
const href = trimmed.startsWith("www.") ? `https://${trimmed}` : trimmed;
|
|
2539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react24.default.Fragment, { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2541
|
+
"a",
|
|
2542
|
+
{
|
|
2543
|
+
href,
|
|
2544
|
+
target: "_blank",
|
|
2545
|
+
rel: "noopener noreferrer nofollow ugc",
|
|
2546
|
+
className: "comment-node-link bg-info-weak",
|
|
2547
|
+
style: LINK_STYLE,
|
|
2548
|
+
children: trimmed
|
|
2549
|
+
}
|
|
2550
|
+
),
|
|
2551
|
+
trailing
|
|
2552
|
+
] }, `${keyPrefix}-${index}`);
|
|
2553
|
+
});
|
|
2554
|
+
};
|
|
2521
2555
|
TextLeafNode = ({ node }) => {
|
|
2522
|
-
let content = node.text;
|
|
2556
|
+
let content = node.code ? node.text : linkifyText(node.text ?? "", node.id ?? "comment-text");
|
|
2523
2557
|
if (node.code) content = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("code", { className: "comment-node-code", children: content });
|
|
2524
2558
|
if (node.bold) content = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: content });
|
|
2525
2559
|
if (node.italic) content = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("em", { children: content });
|
|
@@ -2595,7 +2629,17 @@ var init_CommentNodeRenderer = __esm({
|
|
|
2595
2629
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CommentFileNode_default, { node: element, assetBaseUrl });
|
|
2596
2630
|
case "link": {
|
|
2597
2631
|
const url = typeof element.url === "string" ? element.url : "#";
|
|
2598
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2633
|
+
"a",
|
|
2634
|
+
{
|
|
2635
|
+
href: url,
|
|
2636
|
+
target: "_blank",
|
|
2637
|
+
rel: "noopener noreferrer",
|
|
2638
|
+
className: "comment-node-link bg-info-weak",
|
|
2639
|
+
style: LINK_STYLE,
|
|
2640
|
+
children: renderChildren(element.children, key, assetBaseUrl)
|
|
2641
|
+
}
|
|
2642
|
+
);
|
|
2599
2643
|
}
|
|
2600
2644
|
case "mention": {
|
|
2601
2645
|
const label = element.label ?? element.mentionName ?? element.text ?? "";
|
|
@@ -2961,7 +3005,6 @@ var init_InputControlType = __esm({
|
|
|
2961
3005
|
moneyInput: "money",
|
|
2962
3006
|
select: "select",
|
|
2963
3007
|
percentageInput: "percentage",
|
|
2964
|
-
asset: "asset",
|
|
2965
3008
|
assetUpload: "assetUpload",
|
|
2966
3009
|
phoneInput: "phone",
|
|
2967
3010
|
numberInput: "numberInput",
|
|
@@ -2972,11 +3015,9 @@ var init_InputControlType = __esm({
|
|
|
2972
3015
|
colorInput: "colorInput",
|
|
2973
3016
|
selectWithSearchInput: "selectWithSearchInput",
|
|
2974
3017
|
selectWithSearchPanel: "selectWithSearchPanel",
|
|
2975
|
-
booleanSelect: "booleanSelect",
|
|
2976
3018
|
switchInput: "switchInput",
|
|
2977
3019
|
dateInput: "dateInput",
|
|
2978
3020
|
radioInput: "radioInput",
|
|
2979
|
-
switcher: "switcher",
|
|
2980
3021
|
videoInput: "videoInput",
|
|
2981
3022
|
referenceInput: "referenceInput"
|
|
2982
3023
|
};
|
|
@@ -3584,6 +3625,7 @@ var init_LineTextInput = __esm({
|
|
|
3584
3625
|
value,
|
|
3585
3626
|
onChange: textChangeHandler,
|
|
3586
3627
|
onBlur: props?.onBlur,
|
|
3628
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
3587
3629
|
required: props?.attributes?.required,
|
|
3588
3630
|
placeholder: props?.attributes?.placeholder,
|
|
3589
3631
|
maxLength: props?.attributes?.maxLength,
|
|
@@ -4660,106 +4702,13 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
4660
4702
|
}
|
|
4661
4703
|
});
|
|
4662
4704
|
|
|
4663
|
-
// src/components/controls/edit/BooleanSelect.tsx
|
|
4664
|
-
var import_react51, import_jsx_runtime77, BooleanSelect, BooleanSelect_default;
|
|
4665
|
-
var init_BooleanSelect = __esm({
|
|
4666
|
-
"src/components/controls/edit/BooleanSelect.tsx"() {
|
|
4667
|
-
"use strict";
|
|
4668
|
-
import_react51 = __toESM(require("react"));
|
|
4669
|
-
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4670
|
-
BooleanSelect = (props) => {
|
|
4671
|
-
const [list, setList] = (0, import_react51.useState)();
|
|
4672
|
-
const textChangeHandler = (event) => {
|
|
4673
|
-
const text = event.target.value;
|
|
4674
|
-
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
4675
|
-
if (props.callback !== void 0) {
|
|
4676
|
-
props.callback({
|
|
4677
|
-
name: props.name,
|
|
4678
|
-
value: boolValue,
|
|
4679
|
-
index: props.index,
|
|
4680
|
-
groupKey: props.groupKey
|
|
4681
|
-
});
|
|
4682
|
-
}
|
|
4683
|
-
};
|
|
4684
|
-
(0, import_react51.useEffect)(() => {
|
|
4685
|
-
async function fetchData() {
|
|
4686
|
-
console.log("in select");
|
|
4687
|
-
if (props.dataset) {
|
|
4688
|
-
setList(props.dataset);
|
|
4689
|
-
} else if (props.dataSource && props.dataSource != "" && props.serviceClient) {
|
|
4690
|
-
let dataSource = props.dataSource;
|
|
4691
|
-
let response;
|
|
4692
|
-
if (props.dataSourceDependsOn) {
|
|
4693
|
-
if (props.dependentValue) {
|
|
4694
|
-
dataSource = dataSource.replace(
|
|
4695
|
-
`{${props.dataSourceDependsOn}}`,
|
|
4696
|
-
props.dependentValue
|
|
4697
|
-
);
|
|
4698
|
-
response = await props.serviceClient.get(dataSource);
|
|
4699
|
-
setList(response.result);
|
|
4700
|
-
}
|
|
4701
|
-
} else {
|
|
4702
|
-
response = await props.serviceClient.get(dataSource);
|
|
4703
|
-
setList(response.result);
|
|
4704
|
-
}
|
|
4705
|
-
}
|
|
4706
|
-
}
|
|
4707
|
-
fetchData();
|
|
4708
|
-
}, [
|
|
4709
|
-
props.dataSource,
|
|
4710
|
-
props.dependentValue,
|
|
4711
|
-
props.dataset,
|
|
4712
|
-
props.dataSourceDependsOn
|
|
4713
|
-
]);
|
|
4714
|
-
let value;
|
|
4715
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4716
|
-
value = props.value;
|
|
4717
|
-
}
|
|
4718
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("label", { className: "block", children: [
|
|
4719
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
4720
|
-
" ",
|
|
4721
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4722
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
4723
|
-
"select",
|
|
4724
|
-
{
|
|
4725
|
-
name: props.name,
|
|
4726
|
-
id: props.name,
|
|
4727
|
-
value,
|
|
4728
|
-
onChange: textChangeHandler,
|
|
4729
|
-
required: props?.attributes?.required,
|
|
4730
|
-
placeholder: props?.attributes?.placeholder,
|
|
4731
|
-
disabled: props?.attributes?.readOnly,
|
|
4732
|
-
className: "peer mt-1 py-1.5 block w-full text-black rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n ",
|
|
4733
|
-
children: [
|
|
4734
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
4735
|
-
list && list.map((item, i) => {
|
|
4736
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4737
|
-
"option",
|
|
4738
|
-
{
|
|
4739
|
-
className: "fac-select-option",
|
|
4740
|
-
value: item[props.dataKeyFieldName],
|
|
4741
|
-
children: item[props.dataTextFieldName]
|
|
4742
|
-
},
|
|
4743
|
-
item[props.dataKeyFieldName]
|
|
4744
|
-
);
|
|
4745
|
-
})
|
|
4746
|
-
]
|
|
4747
|
-
}
|
|
4748
|
-
),
|
|
4749
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4750
|
-
] }) });
|
|
4751
|
-
};
|
|
4752
|
-
BooleanSelect_default = BooleanSelect;
|
|
4753
|
-
}
|
|
4754
|
-
});
|
|
4755
|
-
|
|
4756
4705
|
// src/components/controls/edit/EmailInput.tsx
|
|
4757
|
-
var
|
|
4706
|
+
var import_react51, import_jsx_runtime77, EmailInput, EmailInput_default;
|
|
4758
4707
|
var init_EmailInput = __esm({
|
|
4759
4708
|
"src/components/controls/edit/EmailInput.tsx"() {
|
|
4760
4709
|
"use strict";
|
|
4761
|
-
|
|
4762
|
-
|
|
4710
|
+
import_react51 = __toESM(require("react"));
|
|
4711
|
+
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4763
4712
|
EmailInput = (props) => {
|
|
4764
4713
|
const textChangeHandler = (event) => {
|
|
4765
4714
|
const text = event.target.value;
|
|
@@ -4784,11 +4733,11 @@ var init_EmailInput = __esm({
|
|
|
4784
4733
|
if (props.value !== void 0 && props.value !== null) {
|
|
4785
4734
|
value = props.value;
|
|
4786
4735
|
}
|
|
4787
|
-
return /* @__PURE__ */ (0,
|
|
4788
|
-
/* @__PURE__ */ (0,
|
|
4736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("label", { className: "block mb-1", children: [
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
4789
4738
|
" ",
|
|
4790
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
4791
|
-
/* @__PURE__ */ (0,
|
|
4739
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4792
4741
|
"input",
|
|
4793
4742
|
{
|
|
4794
4743
|
type: "email",
|
|
@@ -4804,7 +4753,7 @@ var init_EmailInput = __esm({
|
|
|
4804
4753
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
4805
4754
|
}
|
|
4806
4755
|
),
|
|
4807
|
-
/* @__PURE__ */ (0,
|
|
4756
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 mb-0 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4808
4757
|
] }) });
|
|
4809
4758
|
};
|
|
4810
4759
|
EmailInput_default = EmailInput;
|
|
@@ -4812,13 +4761,13 @@ var init_EmailInput = __esm({
|
|
|
4812
4761
|
});
|
|
4813
4762
|
|
|
4814
4763
|
// src/components/controls/edit/TimeInput.tsx
|
|
4815
|
-
var
|
|
4764
|
+
var import_react52, import_jsx_runtime78, TimeInput, TimeInput_default;
|
|
4816
4765
|
var init_TimeInput = __esm({
|
|
4817
4766
|
"src/components/controls/edit/TimeInput.tsx"() {
|
|
4818
4767
|
"use strict";
|
|
4819
4768
|
"use client";
|
|
4820
|
-
|
|
4821
|
-
|
|
4769
|
+
import_react52 = __toESM(require("react"));
|
|
4770
|
+
import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4822
4771
|
TimeInput = (props) => {
|
|
4823
4772
|
const timeChangeHandler = (event) => {
|
|
4824
4773
|
const timeValue = event.target.value;
|
|
@@ -4831,11 +4780,11 @@ var init_TimeInput = __esm({
|
|
|
4831
4780
|
});
|
|
4832
4781
|
}
|
|
4833
4782
|
};
|
|
4834
|
-
return /* @__PURE__ */ (0,
|
|
4835
|
-
/* @__PURE__ */ (0,
|
|
4783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("label", { className: "block mb-1", children: [
|
|
4784
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
4836
4785
|
" ",
|
|
4837
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0,
|
|
4838
|
-
/* @__PURE__ */ (0,
|
|
4786
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4787
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4839
4788
|
"input",
|
|
4840
4789
|
{
|
|
4841
4790
|
type: "time",
|
|
@@ -4848,7 +4797,7 @@ var init_TimeInput = __esm({
|
|
|
4848
4797
|
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none"
|
|
4849
4798
|
}
|
|
4850
4799
|
) }),
|
|
4851
|
-
/* @__PURE__ */ (0,
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
4852
4801
|
] }) });
|
|
4853
4802
|
};
|
|
4854
4803
|
TimeInput_default = TimeInput;
|
|
@@ -4856,18 +4805,18 @@ var init_TimeInput = __esm({
|
|
|
4856
4805
|
});
|
|
4857
4806
|
|
|
4858
4807
|
// src/components/controls/edit/AssetUpload.tsx
|
|
4859
|
-
var
|
|
4808
|
+
var import_react53, import_jsx_runtime79, AssetUpload, AssetUpload_default;
|
|
4860
4809
|
var init_AssetUpload = __esm({
|
|
4861
4810
|
"src/components/controls/edit/AssetUpload.tsx"() {
|
|
4862
4811
|
"use strict";
|
|
4863
4812
|
"use client";
|
|
4864
|
-
|
|
4813
|
+
import_react53 = __toESM(require("react"));
|
|
4865
4814
|
init_ClientButton();
|
|
4866
4815
|
init_StyleTypes();
|
|
4867
4816
|
init_AssetUtility();
|
|
4868
4817
|
init_Hyperlink();
|
|
4869
4818
|
init_Icon();
|
|
4870
|
-
|
|
4819
|
+
import_jsx_runtime79 = require("react/jsx-runtime");
|
|
4871
4820
|
AssetUpload = (props) => {
|
|
4872
4821
|
const isDisabled = props.attributes?.disable ?? false;
|
|
4873
4822
|
let allValues = [];
|
|
@@ -4888,8 +4837,8 @@ var init_AssetUpload = __esm({
|
|
|
4888
4837
|
}
|
|
4889
4838
|
return "image";
|
|
4890
4839
|
};
|
|
4891
|
-
const [assetType, setAssetType] =
|
|
4892
|
-
(0,
|
|
4840
|
+
const [assetType, setAssetType] = import_react53.default.useState(getInitialTab);
|
|
4841
|
+
(0, import_react53.useEffect)(() => {
|
|
4893
4842
|
setAssetType(getInitialTab());
|
|
4894
4843
|
}, [props.value]);
|
|
4895
4844
|
const assetUploadCallback = (newAsset) => {
|
|
@@ -4964,10 +4913,10 @@ var init_AssetUpload = __esm({
|
|
|
4964
4913
|
}
|
|
4965
4914
|
return false;
|
|
4966
4915
|
};
|
|
4967
|
-
return /* @__PURE__ */ (0,
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4969
|
-
/* @__PURE__ */ (0,
|
|
4970
|
-
/* @__PURE__ */ (0,
|
|
4916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react53.default.Fragment, { children: [
|
|
4917
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("label", { className: "block mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
|
|
4918
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
|
|
4919
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4971
4920
|
ClientButton_default,
|
|
4972
4921
|
{
|
|
4973
4922
|
className: assetType === "image" ? "px-2 py-1 rounded bg-body-200 scale-95" : "text-neutral-700",
|
|
@@ -4977,7 +4926,7 @@ var init_AssetUpload = __esm({
|
|
|
4977
4926
|
children: "Image Upload"
|
|
4978
4927
|
}
|
|
4979
4928
|
),
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
4929
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4981
4930
|
ClientButton_default,
|
|
4982
4931
|
{
|
|
4983
4932
|
className: assetType === "video" ? "bg-body-200 px-2 py-1 rounded-md scale-95" : "text-neutral-700",
|
|
@@ -4988,13 +4937,13 @@ var init_AssetUpload = __esm({
|
|
|
4988
4937
|
}
|
|
4989
4938
|
)
|
|
4990
4939
|
] }),
|
|
4991
|
-
shouldShowDetails() && /* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
4993
|
-
/* @__PURE__ */ (0,
|
|
4994
|
-
/* @__PURE__ */ (0,
|
|
4995
|
-
/* @__PURE__ */ (0,
|
|
4996
|
-
/* @__PURE__ */ (0,
|
|
4997
|
-
/* @__PURE__ */ (0,
|
|
4940
|
+
shouldShowDetails() && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "relative mt-4 rounded-md p-4 border-2 border-dotted border-gray-300 bg-gray-50", children: [
|
|
4941
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "absolute -top-2.5 left-3 bg-primary-600 text-white text-xs px-2 py-0.5 rounded-full", children: getAssetType(allValues[0]) === "video" ? "Video" : "Image" }),
|
|
4942
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "flex flex-col gap-3", children: allValues.map((digitalAsset, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex justify-between items-start gap-5", children: [
|
|
4943
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "grid grid-cols-2 gap-x-8 gap-y-3 text-sm w-full", children: [
|
|
4944
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
|
|
4945
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-gray-500", children: "Title" }),
|
|
4946
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4998
4947
|
"input",
|
|
4999
4948
|
{
|
|
5000
4949
|
type: "text",
|
|
@@ -5006,18 +4955,18 @@ var init_AssetUpload = __esm({
|
|
|
5006
4955
|
}
|
|
5007
4956
|
)
|
|
5008
4957
|
] }),
|
|
5009
|
-
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0,
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
4958
|
+
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
|
|
4959
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-gray-500", children: "Resolution" }),
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("p", { className: "font-medium text-gray-900 mt-3", children: [
|
|
5012
4961
|
digitalAsset.intrinsicWidth,
|
|
5013
4962
|
"\xD7",
|
|
5014
4963
|
digitalAsset.intrinsicHeight
|
|
5015
4964
|
] })
|
|
5016
4965
|
] }),
|
|
5017
|
-
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0,
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5019
|
-
/* @__PURE__ */ (0,
|
|
5020
|
-
getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ (0,
|
|
4966
|
+
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-gray-500", children: "Image / Poster" }),
|
|
4968
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex-shrink-0 flex flex-col gap-3 mt-1", children: [
|
|
4969
|
+
getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5021
4970
|
"img",
|
|
5022
4971
|
{
|
|
5023
4972
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.posterUrl),
|
|
@@ -5025,7 +4974,7 @@ var init_AssetUpload = __esm({
|
|
|
5025
4974
|
className: "w-32 h-auto object-cover rounded border p-1"
|
|
5026
4975
|
}
|
|
5027
4976
|
),
|
|
5028
|
-
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0,
|
|
4977
|
+
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5029
4978
|
"img",
|
|
5030
4979
|
{
|
|
5031
4980
|
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.assetUrl),
|
|
@@ -5035,9 +4984,9 @@ var init_AssetUpload = __esm({
|
|
|
5035
4984
|
)
|
|
5036
4985
|
] })
|
|
5037
4986
|
] }),
|
|
5038
|
-
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
4987
|
+
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "col-span-2", children: [
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "text-gray-500", children: "HLS Link" }),
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5041
4990
|
Hyperlink,
|
|
5042
4991
|
{
|
|
5043
4992
|
href: digitalAsset.assetUrl,
|
|
@@ -5048,12 +4997,12 @@ var init_AssetUpload = __esm({
|
|
|
5048
4997
|
)
|
|
5049
4998
|
] })
|
|
5050
4999
|
] }),
|
|
5051
|
-
/* @__PURE__ */ (0,
|
|
5000
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5052
5001
|
"span",
|
|
5053
5002
|
{
|
|
5054
5003
|
onClick: () => !isDisabled && deleteFile(index),
|
|
5055
5004
|
className: isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
5056
|
-
children: /* @__PURE__ */ (0,
|
|
5005
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Icon_default, { className: "w-4 h-4 text-primary", name: "delete" })
|
|
5057
5006
|
}
|
|
5058
5007
|
)
|
|
5059
5008
|
] }, index)) })
|
|
@@ -5065,12 +5014,12 @@ var init_AssetUpload = __esm({
|
|
|
5065
5014
|
});
|
|
5066
5015
|
|
|
5067
5016
|
// src/components/controls/edit/SwitchInput.tsx
|
|
5068
|
-
var
|
|
5017
|
+
var import_react54, import_jsx_runtime80, SwitchInput, SwitchInput_default;
|
|
5069
5018
|
var init_SwitchInput = __esm({
|
|
5070
5019
|
"src/components/controls/edit/SwitchInput.tsx"() {
|
|
5071
5020
|
"use strict";
|
|
5072
|
-
|
|
5073
|
-
|
|
5021
|
+
import_react54 = __toESM(require("react"));
|
|
5022
|
+
import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5074
5023
|
SwitchInput = (props) => {
|
|
5075
5024
|
const textChangeHandler = (event) => {
|
|
5076
5025
|
let text = event.target.checked;
|
|
@@ -5087,28 +5036,28 @@ var init_SwitchInput = __esm({
|
|
|
5087
5036
|
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
5088
5037
|
value = true;
|
|
5089
5038
|
}
|
|
5090
|
-
return /* @__PURE__ */ (0,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5092
|
-
props?.attributes?.label && /* @__PURE__ */ (0,
|
|
5039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react54.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-start justify-between gap-4 py-3", children: [
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "min-w-0", children: [
|
|
5041
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
5093
5042
|
"label",
|
|
5094
5043
|
{
|
|
5095
5044
|
htmlFor: props.name,
|
|
5096
5045
|
className: "inline-block text-sm font-semibold text-slate-800",
|
|
5097
5046
|
children: [
|
|
5098
5047
|
props.attributes.label,
|
|
5099
|
-
props?.attributes?.required && /* @__PURE__ */ (0,
|
|
5048
|
+
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
5100
5049
|
]
|
|
5101
5050
|
}
|
|
5102
5051
|
),
|
|
5103
|
-
/* @__PURE__ */ (0,
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage || "" })
|
|
5104
5053
|
] }),
|
|
5105
|
-
/* @__PURE__ */ (0,
|
|
5054
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
5106
5055
|
"label",
|
|
5107
5056
|
{
|
|
5108
5057
|
htmlFor: props.name,
|
|
5109
5058
|
className: "relative inline-flex shrink-0 cursor-pointer items-center peer-disabled:cursor-not-allowed",
|
|
5110
5059
|
children: [
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5060
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5112
5061
|
"input",
|
|
5113
5062
|
{
|
|
5114
5063
|
type: "checkbox",
|
|
@@ -5121,13 +5070,13 @@ var init_SwitchInput = __esm({
|
|
|
5121
5070
|
className: "peer sr-only"
|
|
5122
5071
|
}
|
|
5123
5072
|
),
|
|
5124
|
-
/* @__PURE__ */ (0,
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5125
5074
|
"div",
|
|
5126
5075
|
{
|
|
5127
5076
|
className: "h-6 w-11 rounded-full bg-slate-200 shadow-inner\n transition-colors duration-200 ease-in-out\n peer-checked:bg-blue-600\n peer-focus-visible:ring-2 peer-focus-visible:ring-blue-300 peer-focus-visible:ring-offset-2\n peer-disabled:bg-slate-100"
|
|
5128
5077
|
}
|
|
5129
5078
|
),
|
|
5130
|
-
/* @__PURE__ */ (0,
|
|
5079
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5131
5080
|
"div",
|
|
5132
5081
|
{
|
|
5133
5082
|
className: "absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-default shadow\n transition-transform duration-200 ease-in-out\n peer-checked:translate-x-5\n peer-disabled:bg-slate-50"
|
|
@@ -5225,15 +5174,15 @@ var init_DateTimeUtility = __esm({
|
|
|
5225
5174
|
});
|
|
5226
5175
|
|
|
5227
5176
|
// src/components/controls/edit/DateInput.tsx
|
|
5228
|
-
var
|
|
5177
|
+
var import_react55, import_jsx_runtime81, DateInput, DateInput_default;
|
|
5229
5178
|
var init_DateInput = __esm({
|
|
5230
5179
|
"src/components/controls/edit/DateInput.tsx"() {
|
|
5231
5180
|
"use strict";
|
|
5232
|
-
|
|
5181
|
+
import_react55 = require("react");
|
|
5233
5182
|
init_DateTimeUtility();
|
|
5234
|
-
|
|
5183
|
+
import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5235
5184
|
DateInput = (props) => {
|
|
5236
|
-
const value = (0,
|
|
5185
|
+
const value = (0, import_react55.useMemo)(() => {
|
|
5237
5186
|
if (props.value === void 0 || props.value === null || props.value === "") {
|
|
5238
5187
|
return "";
|
|
5239
5188
|
}
|
|
@@ -5265,11 +5214,11 @@ var init_DateInput = __esm({
|
|
|
5265
5214
|
groupKey: props.groupKey
|
|
5266
5215
|
});
|
|
5267
5216
|
};
|
|
5268
|
-
return /* @__PURE__ */ (0,
|
|
5269
|
-
props.attributes?.label && /* @__PURE__ */ (0,
|
|
5217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("label", { className: "block mb-1", children: [
|
|
5218
|
+
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-sm font-medium", children: props.attributes.label }),
|
|
5270
5219
|
" ",
|
|
5271
|
-
props.attributes?.label && props.attributes.required && /* @__PURE__ */ (0,
|
|
5272
|
-
/* @__PURE__ */ (0,
|
|
5220
|
+
props.attributes?.label && props.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
5221
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5273
5222
|
"input",
|
|
5274
5223
|
{
|
|
5275
5224
|
type: "date",
|
|
@@ -5283,7 +5232,7 @@ var init_DateInput = __esm({
|
|
|
5283
5232
|
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
5284
5233
|
}
|
|
5285
5234
|
),
|
|
5286
|
-
/* @__PURE__ */ (0,
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
5287
5236
|
] });
|
|
5288
5237
|
};
|
|
5289
5238
|
DateInput_default = DateInput;
|
|
@@ -5291,16 +5240,16 @@ var init_DateInput = __esm({
|
|
|
5291
5240
|
});
|
|
5292
5241
|
|
|
5293
5242
|
// src/components/controls/edit/RadioInput.tsx
|
|
5294
|
-
var
|
|
5243
|
+
var import_react56, import_jsx_runtime82, RadioInput, RadioInput_default;
|
|
5295
5244
|
var init_RadioInput = __esm({
|
|
5296
5245
|
"src/components/controls/edit/RadioInput.tsx"() {
|
|
5297
5246
|
"use strict";
|
|
5298
|
-
|
|
5247
|
+
import_react56 = require("react");
|
|
5299
5248
|
init_Icon();
|
|
5300
|
-
|
|
5249
|
+
import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5301
5250
|
RadioInput = (props) => {
|
|
5302
|
-
const [list, setList] = (0,
|
|
5303
|
-
(0,
|
|
5251
|
+
const [list, setList] = (0, import_react56.useState)([]);
|
|
5252
|
+
(0, import_react56.useEffect)(() => {
|
|
5304
5253
|
async function loadData() {
|
|
5305
5254
|
if (props.dataset) {
|
|
5306
5255
|
setList(props.dataset);
|
|
@@ -5342,22 +5291,22 @@ var init_RadioInput = __esm({
|
|
|
5342
5291
|
});
|
|
5343
5292
|
}
|
|
5344
5293
|
};
|
|
5345
|
-
return /* @__PURE__ */ (0,
|
|
5346
|
-
/* @__PURE__ */ (0,
|
|
5347
|
-
/* @__PURE__ */ (0,
|
|
5294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "block", children: [
|
|
5295
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "text-sm font-medium", children: props.attributes?.label }),
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "flex flex-col gap-3", children: list.map((item, index) => {
|
|
5348
5297
|
const itemValue = item[props.dataKeyFieldName];
|
|
5349
5298
|
const isSelected = String(itemValue) === String(props.value ?? "");
|
|
5350
5299
|
const isRecommended = props.dataRecommendedValue !== void 0 && String(itemValue) === String(props.dataRecommendedValue);
|
|
5351
5300
|
const resultClassName = isSelected ? isRecommended ? "bg-success" : props.dataRecommendedValue ? "bg-alert" : "border-transparent" : "border-transparent";
|
|
5352
5301
|
const iconName = isSelected && props.dataRecommendedValue ? isRecommended ? "checkCircle" : "xCircle" : void 0;
|
|
5353
5302
|
const inputId = `${props.name}-${props.index ?? 0}-id-${index}`;
|
|
5354
|
-
return /* @__PURE__ */ (0,
|
|
5303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
5355
5304
|
"div",
|
|
5356
5305
|
{
|
|
5357
5306
|
className: `font-normal flex items-center justify-between gap-4 cursor-pointer border rounded p-2 ${resultClassName}`,
|
|
5358
5307
|
children: [
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5360
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex gap-4 items-start", children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5361
5310
|
"input",
|
|
5362
5311
|
{
|
|
5363
5312
|
type: "radio",
|
|
@@ -5371,125 +5320,30 @@ var init_RadioInput = __esm({
|
|
|
5371
5320
|
required: props.attributes?.required
|
|
5372
5321
|
}
|
|
5373
5322
|
),
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5323
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("label", { className: "text-body-950 pr-2", htmlFor: inputId, children: item[props.dataTextFieldName] })
|
|
5375
5324
|
] }),
|
|
5376
|
-
iconName && /* @__PURE__ */ (0,
|
|
5325
|
+
iconName && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Icon_default, { className: "w-5 h-5 text-success", name: iconName })
|
|
5377
5326
|
]
|
|
5378
5327
|
},
|
|
5379
5328
|
String(itemValue)
|
|
5380
5329
|
);
|
|
5381
5330
|
}) }),
|
|
5382
|
-
/* @__PURE__ */ (0,
|
|
5331
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
5383
5332
|
] });
|
|
5384
5333
|
};
|
|
5385
5334
|
RadioInput_default = RadioInput;
|
|
5386
5335
|
}
|
|
5387
5336
|
});
|
|
5388
5337
|
|
|
5389
|
-
// src/components/controls/edit/Switcher.tsx
|
|
5390
|
-
var import_react58, import_jsx_runtime84, Switcher, Switcher_default;
|
|
5391
|
-
var init_Switcher = __esm({
|
|
5392
|
-
"src/components/controls/edit/Switcher.tsx"() {
|
|
5393
|
-
"use strict";
|
|
5394
|
-
import_react58 = require("react");
|
|
5395
|
-
import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5396
|
-
Switcher = (props) => {
|
|
5397
|
-
const [list, setList] = (0, import_react58.useState)([]);
|
|
5398
|
-
(0, import_react58.useEffect)(() => {
|
|
5399
|
-
async function loadData() {
|
|
5400
|
-
if (props.dataset) {
|
|
5401
|
-
setList(props.dataset);
|
|
5402
|
-
return;
|
|
5403
|
-
}
|
|
5404
|
-
if (!props.dataSource || !props.serviceClient) {
|
|
5405
|
-
setList([]);
|
|
5406
|
-
return;
|
|
5407
|
-
}
|
|
5408
|
-
let dataSource = props.dataSource;
|
|
5409
|
-
if (props.dataSourceDependsOn) {
|
|
5410
|
-
if (!props.dependentValue) {
|
|
5411
|
-
setList([]);
|
|
5412
|
-
return;
|
|
5413
|
-
}
|
|
5414
|
-
dataSource = dataSource.replace(
|
|
5415
|
-
`{${props.dataSourceDependsOn}}`,
|
|
5416
|
-
props.dependentValue
|
|
5417
|
-
);
|
|
5418
|
-
}
|
|
5419
|
-
const response = await props.serviceClient.get(dataSource);
|
|
5420
|
-
setList(response.result ?? []);
|
|
5421
|
-
}
|
|
5422
|
-
loadData();
|
|
5423
|
-
}, [
|
|
5424
|
-
props.dataSource,
|
|
5425
|
-
props.dataSourceDependsOn,
|
|
5426
|
-
props.dataset,
|
|
5427
|
-
props.dependentValue,
|
|
5428
|
-
props.serviceClient
|
|
5429
|
-
]);
|
|
5430
|
-
const changeHandler = (event) => {
|
|
5431
|
-
props.callback?.({
|
|
5432
|
-
name: props.name,
|
|
5433
|
-
value: event.target.value,
|
|
5434
|
-
index: props.index,
|
|
5435
|
-
groupKey: props.groupKey
|
|
5436
|
-
});
|
|
5437
|
-
};
|
|
5438
|
-
const value = props.value === void 0 || props.value === null ? "" : String(props.value);
|
|
5439
|
-
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("label", { className: "block mb-1", children: [
|
|
5440
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-sm font-medium", children: props.attributes?.label }),
|
|
5441
|
-
list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
5442
|
-
"input",
|
|
5443
|
-
{
|
|
5444
|
-
type: "text",
|
|
5445
|
-
name: props.name,
|
|
5446
|
-
id: props.name,
|
|
5447
|
-
value,
|
|
5448
|
-
onChange: changeHandler,
|
|
5449
|
-
required: props.attributes?.required,
|
|
5450
|
-
placeholder: props.attributes?.placeholder,
|
|
5451
|
-
disabled: props.attributes?.readOnly,
|
|
5452
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
5453
|
-
}
|
|
5454
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
5455
|
-
"select",
|
|
5456
|
-
{
|
|
5457
|
-
name: props.name,
|
|
5458
|
-
id: props.name,
|
|
5459
|
-
value,
|
|
5460
|
-
onChange: changeHandler,
|
|
5461
|
-
required: props.attributes?.required,
|
|
5462
|
-
disabled: props.attributes?.readOnly,
|
|
5463
|
-
className: `peer select my-1 py-1 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`,
|
|
5464
|
-
children: [
|
|
5465
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
5466
|
-
list.map((item) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
5467
|
-
"option",
|
|
5468
|
-
{
|
|
5469
|
-
value: item[props.dataKeyFieldName],
|
|
5470
|
-
children: item[props.dataTextFieldName]
|
|
5471
|
-
},
|
|
5472
|
-
String(item[props.dataKeyFieldName])
|
|
5473
|
-
))
|
|
5474
|
-
]
|
|
5475
|
-
}
|
|
5476
|
-
),
|
|
5477
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
5478
|
-
] });
|
|
5479
|
-
};
|
|
5480
|
-
Switcher_default = Switcher;
|
|
5481
|
-
}
|
|
5482
|
-
});
|
|
5483
|
-
|
|
5484
5338
|
// src/components/controls/edit/ReferenceInput.tsx
|
|
5485
|
-
var
|
|
5339
|
+
var import_jsx_runtime83, ReferenceInput, ReferenceInput_default;
|
|
5486
5340
|
var init_ReferenceInput = __esm({
|
|
5487
5341
|
"src/components/controls/edit/ReferenceInput.tsx"() {
|
|
5488
5342
|
"use strict";
|
|
5489
5343
|
init_SelectWithSearchInput();
|
|
5490
|
-
|
|
5344
|
+
import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5491
5345
|
ReferenceInput = (props) => {
|
|
5492
|
-
return /* @__PURE__ */ (0,
|
|
5346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(SelectWithSearchInput_default, { ...props });
|
|
5493
5347
|
};
|
|
5494
5348
|
ReferenceInput_default = ReferenceInput;
|
|
5495
5349
|
}
|
|
@@ -5500,12 +5354,12 @@ var InputControlClient_exports = {};
|
|
|
5500
5354
|
__export(InputControlClient_exports, {
|
|
5501
5355
|
default: () => InputControlClient_default
|
|
5502
5356
|
});
|
|
5503
|
-
var
|
|
5357
|
+
var import_react57, import_jsx_runtime84, InputControl, InputControlClient_default;
|
|
5504
5358
|
var init_InputControlClient = __esm({
|
|
5505
5359
|
"src/components/controls/edit/InputControlClient.tsx"() {
|
|
5506
5360
|
"use strict";
|
|
5507
5361
|
"use client";
|
|
5508
|
-
|
|
5362
|
+
import_react57 = __toESM(require("react"));
|
|
5509
5363
|
init_MultilineTextInput();
|
|
5510
5364
|
init_LineTextInput();
|
|
5511
5365
|
init_MoneyInput();
|
|
@@ -5520,17 +5374,15 @@ var init_InputControlClient = __esm({
|
|
|
5520
5374
|
init_ColorInput();
|
|
5521
5375
|
init_SelectWithSearchInput();
|
|
5522
5376
|
init_SelectWithSearchPanel();
|
|
5523
|
-
init_BooleanSelect();
|
|
5524
5377
|
init_EmailInput();
|
|
5525
5378
|
init_TimeInput();
|
|
5526
5379
|
init_AssetUpload();
|
|
5527
5380
|
init_SwitchInput();
|
|
5528
5381
|
init_DateInput();
|
|
5529
5382
|
init_RadioInput();
|
|
5530
|
-
init_Switcher();
|
|
5531
5383
|
init_ReferenceInput();
|
|
5532
|
-
|
|
5533
|
-
InputControl =
|
|
5384
|
+
import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5385
|
+
InputControl = import_react57.default.forwardRef(
|
|
5534
5386
|
(props, ref) => {
|
|
5535
5387
|
const ControlComponents = {
|
|
5536
5388
|
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
@@ -5547,18 +5399,15 @@ var init_InputControlClient = __esm({
|
|
|
5547
5399
|
[InputControlType_default.colorInput]: ColorInput_default,
|
|
5548
5400
|
[InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
|
|
5549
5401
|
[InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
|
|
5550
|
-
[InputControlType_default.booleanSelect]: BooleanSelect_default,
|
|
5551
5402
|
[InputControlType_default.timeInput]: TimeInput_default,
|
|
5552
|
-
[InputControlType_default.asset]: AssetUpload_default,
|
|
5553
5403
|
[InputControlType_default.assetUpload]: AssetUpload_default,
|
|
5554
5404
|
[InputControlType_default.switchInput]: SwitchInput_default,
|
|
5555
5405
|
[InputControlType_default.dateInput]: DateInput_default,
|
|
5556
5406
|
[InputControlType_default.radioInput]: RadioInput_default,
|
|
5557
|
-
[InputControlType_default.switcher]: Switcher_default,
|
|
5558
5407
|
[InputControlType_default.referenceInput]: ReferenceInput_default
|
|
5559
5408
|
};
|
|
5560
5409
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
5561
|
-
return /* @__PURE__ */ (0,
|
|
5410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react57.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
5562
5411
|
}
|
|
5563
5412
|
);
|
|
5564
5413
|
InputControl.displayName = "InputControl";
|
|
@@ -5584,16 +5433,16 @@ var DataBindingControls_exports = {};
|
|
|
5584
5433
|
__export(DataBindingControls_exports, {
|
|
5585
5434
|
default: () => DataBindingControls_default
|
|
5586
5435
|
});
|
|
5587
|
-
var
|
|
5436
|
+
var import_react58, import_navigation, import_jsx_runtime85, humanize, escapeODataString, parseFacetSelections, buildFacetFilter, parseODataSearch, normalizeSortOption, DUMMY_FACETS, DUMMY_SORT_OPTIONS, DataBindingControls, DataBindingControls_default;
|
|
5588
5437
|
var init_DataBindingControls = __esm({
|
|
5589
5438
|
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
5590
5439
|
"use strict";
|
|
5591
5440
|
"use client";
|
|
5592
|
-
|
|
5441
|
+
import_react58 = require("react");
|
|
5593
5442
|
import_navigation = require("next/navigation");
|
|
5594
5443
|
init_InputControl();
|
|
5595
5444
|
init_InputControlType();
|
|
5596
|
-
|
|
5445
|
+
import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5597
5446
|
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
5598
5447
|
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
5599
5448
|
parseFacetSelections = (filter) => {
|
|
@@ -5670,12 +5519,12 @@ var init_DataBindingControls = __esm({
|
|
|
5670
5519
|
const selectedFacetValues = parseFacetSelections(currentFilter);
|
|
5671
5520
|
const currentSort = query?.["$orderby"] ?? query?.orderBy ?? "";
|
|
5672
5521
|
const currentSearch = parseODataSearch(query?.["$search"]);
|
|
5673
|
-
const [searchText, setSearchText] = (0,
|
|
5674
|
-
const lastNavigationUrl = (0,
|
|
5675
|
-
(0,
|
|
5522
|
+
const [searchText, setSearchText] = (0, import_react58.useState)(currentSearch);
|
|
5523
|
+
const lastNavigationUrl = (0, import_react58.useRef)(null);
|
|
5524
|
+
(0, import_react58.useEffect)(() => {
|
|
5676
5525
|
setSearchText(currentSearch);
|
|
5677
5526
|
}, [currentSearch]);
|
|
5678
|
-
const getQueryUrl = (0,
|
|
5527
|
+
const getQueryUrl = (0, import_react58.useCallback)(
|
|
5679
5528
|
(updates) => {
|
|
5680
5529
|
const params = new URLSearchParams(query ?? {});
|
|
5681
5530
|
Object.entries(updates).forEach(([key, value]) => {
|
|
@@ -5705,7 +5554,7 @@ var init_DataBindingControls = __esm({
|
|
|
5705
5554
|
filter: void 0
|
|
5706
5555
|
});
|
|
5707
5556
|
};
|
|
5708
|
-
const navigateWithoutReload = (0,
|
|
5557
|
+
const navigateWithoutReload = (0, import_react58.useCallback)(
|
|
5709
5558
|
(url) => {
|
|
5710
5559
|
if (lastNavigationUrl.current === url) {
|
|
5711
5560
|
return;
|
|
@@ -5721,7 +5570,7 @@ var init_DataBindingControls = __esm({
|
|
|
5721
5570
|
},
|
|
5722
5571
|
[router]
|
|
5723
5572
|
);
|
|
5724
|
-
(0,
|
|
5573
|
+
(0, import_react58.useEffect)(() => {
|
|
5725
5574
|
const trimmedSearchText = searchText.trim();
|
|
5726
5575
|
if (trimmedSearchText === currentSearch.trim()) {
|
|
5727
5576
|
return;
|
|
@@ -5742,8 +5591,8 @@ var init_DataBindingControls = __esm({
|
|
|
5742
5591
|
if (!shouldShowToolbar && !shouldShowFacets) {
|
|
5743
5592
|
return null;
|
|
5744
5593
|
}
|
|
5745
|
-
const renderFacetLinks = (field, values, stacked = false) => /* @__PURE__ */ (0,
|
|
5746
|
-
/* @__PURE__ */ (0,
|
|
5594
|
+
const renderFacetLinks = (field, values, stacked = false) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: stacked ? "flex flex-col gap-1" : "flex flex-wrap gap-2", children: [
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5747
5596
|
"button",
|
|
5748
5597
|
{
|
|
5749
5598
|
type: "button",
|
|
@@ -5755,7 +5604,7 @@ var init_DataBindingControls = __esm({
|
|
|
5755
5604
|
),
|
|
5756
5605
|
values.map((facet) => {
|
|
5757
5606
|
const isSelected = selectedFacetValues.get(field) === facet.value;
|
|
5758
|
-
return /* @__PURE__ */ (0,
|
|
5607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
5759
5608
|
"button",
|
|
5760
5609
|
{
|
|
5761
5610
|
type: "button",
|
|
@@ -5773,9 +5622,9 @@ var init_DataBindingControls = __esm({
|
|
|
5773
5622
|
);
|
|
5774
5623
|
})
|
|
5775
5624
|
] });
|
|
5776
|
-
return /* @__PURE__ */ (0,
|
|
5777
|
-
shouldShowToolbar && /* @__PURE__ */ (0,
|
|
5778
|
-
showSearchBar && /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: mode === "toolbar" ? "mb-6" : "flex flex-col gap-2", children: [
|
|
5626
|
+
shouldShowToolbar && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
5627
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "w-full max-w-xl", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5779
5628
|
InputControl_default,
|
|
5780
5629
|
{
|
|
5781
5630
|
name: "searchText",
|
|
@@ -5786,9 +5635,9 @@ var init_DataBindingControls = __esm({
|
|
|
5786
5635
|
inputClasses: "!mt-0"
|
|
5787
5636
|
}
|
|
5788
5637
|
) }),
|
|
5789
|
-
hasSortControls && /* @__PURE__ */ (0,
|
|
5790
|
-
/* @__PURE__ */ (0,
|
|
5791
|
-
/* @__PURE__ */ (0,
|
|
5638
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "font-medium", children: "Sort by" }),
|
|
5640
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5792
5641
|
InputControl_default,
|
|
5793
5642
|
{
|
|
5794
5643
|
name: "sortOptions",
|
|
@@ -5809,10 +5658,10 @@ var init_DataBindingControls = __esm({
|
|
|
5809
5658
|
)
|
|
5810
5659
|
] })
|
|
5811
5660
|
] }),
|
|
5812
|
-
shouldShowFacets && facetGroups.length === 1 && /* @__PURE__ */ (0,
|
|
5813
|
-
shouldShowFacets && facetGroups.length > 1 && /* @__PURE__ */ (0,
|
|
5814
|
-
/* @__PURE__ */ (0,
|
|
5815
|
-
/* @__PURE__ */ (0,
|
|
5661
|
+
shouldShowFacets && facetGroups.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("nav", { "aria-label": `${humanize(facetGroups[0][0])} filters`, children: renderFacetLinks(facetGroups[0][0], facetGroups[0][1]) }),
|
|
5662
|
+
shouldShowFacets && facetGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "flex flex-col gap-2", children: facetGroups.map(([field, values]) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("details", { className: "border-b", open: true, children: [
|
|
5663
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("summary", { className: "cursor-pointer font-semibold", children: humanize(field) }),
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "p-2", children: renderFacetLinks(field, values, true) })
|
|
5816
5665
|
] }, field)) })
|
|
5817
5666
|
] });
|
|
5818
5667
|
};
|
|
@@ -5825,13 +5674,13 @@ var Slider_exports = {};
|
|
|
5825
5674
|
__export(Slider_exports, {
|
|
5826
5675
|
default: () => Slider_default
|
|
5827
5676
|
});
|
|
5828
|
-
var
|
|
5677
|
+
var import_react59, import_jsx_runtime86, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
5829
5678
|
var init_Slider = __esm({
|
|
5830
5679
|
"src/components/Slider.tsx"() {
|
|
5831
5680
|
"use strict";
|
|
5832
5681
|
"use client";
|
|
5833
|
-
|
|
5834
|
-
|
|
5682
|
+
import_react59 = __toESM(require("react"));
|
|
5683
|
+
import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5835
5684
|
Slider = ({
|
|
5836
5685
|
children,
|
|
5837
5686
|
slidesToShow = 4,
|
|
@@ -5849,13 +5698,13 @@ var init_Slider = __esm({
|
|
|
5849
5698
|
pillStyle = "cumulative",
|
|
5850
5699
|
progressPosition = "bottom"
|
|
5851
5700
|
}) => {
|
|
5852
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
5853
|
-
const [transition, setTransition] = (0,
|
|
5854
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
5701
|
+
const [currentSlide, setCurrentSlide] = (0, import_react59.useState)(0);
|
|
5702
|
+
const [transition, setTransition] = (0, import_react59.useState)(true);
|
|
5703
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react59.useState)(
|
|
5855
5704
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
5856
5705
|
);
|
|
5857
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
5858
|
-
(0,
|
|
5706
|
+
const [isPlaying, setIsPlaying] = (0, import_react59.useState)(autoplay);
|
|
5707
|
+
(0, import_react59.useEffect)(() => {
|
|
5859
5708
|
if (typeof slidesToShow === "number") return;
|
|
5860
5709
|
const handleResize = () => {
|
|
5861
5710
|
if (window.innerWidth >= 1024) {
|
|
@@ -5870,7 +5719,7 @@ var init_Slider = __esm({
|
|
|
5870
5719
|
window.addEventListener("resize", handleResize);
|
|
5871
5720
|
return () => window.removeEventListener("resize", handleResize);
|
|
5872
5721
|
}, [slidesToShow]);
|
|
5873
|
-
(0,
|
|
5722
|
+
(0, import_react59.useEffect)(() => {
|
|
5874
5723
|
if (!autoplay) return;
|
|
5875
5724
|
const timer = setInterval(() => {
|
|
5876
5725
|
if (isPlaying) {
|
|
@@ -5879,7 +5728,7 @@ var init_Slider = __esm({
|
|
|
5879
5728
|
}, autoplay_speed);
|
|
5880
5729
|
return () => clearInterval(timer);
|
|
5881
5730
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
5882
|
-
const totalSlides =
|
|
5731
|
+
const totalSlides = import_react59.Children.count(children);
|
|
5883
5732
|
const maxSlide = totalSlides - slidesToShowState;
|
|
5884
5733
|
const nextSlide = () => {
|
|
5885
5734
|
if (currentSlide >= maxSlide) {
|
|
@@ -5924,16 +5773,16 @@ var init_Slider = __esm({
|
|
|
5924
5773
|
}
|
|
5925
5774
|
};
|
|
5926
5775
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
5927
|
-
const slides =
|
|
5928
|
-
if (!
|
|
5776
|
+
const slides = import_react59.Children.map(children, (child, index) => {
|
|
5777
|
+
if (!import_react59.default.isValidElement(child)) return null;
|
|
5929
5778
|
const childProps = child.props;
|
|
5930
5779
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
5931
|
-
return /* @__PURE__ */ (0,
|
|
5780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5932
5781
|
"div",
|
|
5933
5782
|
{
|
|
5934
5783
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
5935
5784
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
5936
|
-
children: (0,
|
|
5785
|
+
children: (0, import_react59.cloneElement)(child, {
|
|
5937
5786
|
className: mergedClassName
|
|
5938
5787
|
})
|
|
5939
5788
|
},
|
|
@@ -5951,14 +5800,14 @@ var init_Slider = __esm({
|
|
|
5951
5800
|
return "bottom-4";
|
|
5952
5801
|
}
|
|
5953
5802
|
};
|
|
5954
|
-
return /* @__PURE__ */ (0,
|
|
5803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
5955
5804
|
"div",
|
|
5956
5805
|
{
|
|
5957
5806
|
className: `relative w-full overflow-hidden ${className}`,
|
|
5958
5807
|
onMouseEnter: handleMouseEnter,
|
|
5959
5808
|
onMouseLeave: handleMouseLeave,
|
|
5960
5809
|
children: [
|
|
5961
|
-
/* @__PURE__ */ (0,
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5962
5811
|
"div",
|
|
5963
5812
|
{
|
|
5964
5813
|
className: "flex h-full",
|
|
@@ -5969,18 +5818,18 @@ var init_Slider = __esm({
|
|
|
5969
5818
|
children: slides
|
|
5970
5819
|
}
|
|
5971
5820
|
),
|
|
5972
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
5973
|
-
/* @__PURE__ */ (0,
|
|
5821
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
5822
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5974
5823
|
ArrowButton,
|
|
5975
5824
|
{
|
|
5976
5825
|
direction: "left",
|
|
5977
5826
|
onClick: prevSlide,
|
|
5978
5827
|
visible: infinite_scroll || currentSlide > 0,
|
|
5979
5828
|
className: arrowClassName,
|
|
5980
|
-
children: /* @__PURE__ */ (0,
|
|
5829
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
5981
5830
|
}
|
|
5982
5831
|
),
|
|
5983
|
-
/* @__PURE__ */ (0,
|
|
5832
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
5984
5833
|
ArrowButton,
|
|
5985
5834
|
{
|
|
5986
5835
|
direction: "right",
|
|
@@ -5988,13 +5837,13 @@ var init_Slider = __esm({
|
|
|
5988
5837
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
5989
5838
|
className: arrowClassName,
|
|
5990
5839
|
children: [
|
|
5991
|
-
/* @__PURE__ */ (0,
|
|
5840
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
5992
5841
|
" "
|
|
5993
5842
|
]
|
|
5994
5843
|
}
|
|
5995
5844
|
)
|
|
5996
5845
|
] }),
|
|
5997
|
-
show_dots && /* @__PURE__ */ (0,
|
|
5846
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5998
5847
|
ProgressPill,
|
|
5999
5848
|
{
|
|
6000
5849
|
active: index === currentSlide,
|
|
@@ -6020,7 +5869,7 @@ var init_Slider = __esm({
|
|
|
6020
5869
|
visible,
|
|
6021
5870
|
children,
|
|
6022
5871
|
className = ""
|
|
6023
|
-
}) => /* @__PURE__ */ (0,
|
|
5872
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6024
5873
|
"button",
|
|
6025
5874
|
{
|
|
6026
5875
|
className: `
|
|
@@ -6046,13 +5895,13 @@ var init_Slider = __esm({
|
|
|
6046
5895
|
currentSlide,
|
|
6047
5896
|
totalSlides
|
|
6048
5897
|
}) => {
|
|
6049
|
-
const [progress, setProgress] = (0,
|
|
6050
|
-
(0,
|
|
5898
|
+
const [progress, setProgress] = (0, import_react59.useState)(0);
|
|
5899
|
+
(0, import_react59.useEffect)(() => {
|
|
6051
5900
|
if (active) {
|
|
6052
5901
|
setProgress(0);
|
|
6053
5902
|
}
|
|
6054
5903
|
}, [active, index]);
|
|
6055
|
-
(0,
|
|
5904
|
+
(0, import_react59.useEffect)(() => {
|
|
6056
5905
|
if (!active || !isPlaying) {
|
|
6057
5906
|
if (!active) {
|
|
6058
5907
|
setProgress(0);
|
|
@@ -6107,7 +5956,7 @@ var init_Slider = __esm({
|
|
|
6107
5956
|
const renderProgressBar = () => {
|
|
6108
5957
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
6109
5958
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
6110
|
-
return /* @__PURE__ */ (0,
|
|
5959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6111
5960
|
"div",
|
|
6112
5961
|
{
|
|
6113
5962
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -6119,7 +5968,7 @@ var init_Slider = __esm({
|
|
|
6119
5968
|
};
|
|
6120
5969
|
const renderCumulativeFill = () => {
|
|
6121
5970
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
6122
|
-
return /* @__PURE__ */ (0,
|
|
5971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6123
5972
|
"div",
|
|
6124
5973
|
{
|
|
6125
5974
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -6129,7 +5978,7 @@ var init_Slider = __esm({
|
|
|
6129
5978
|
}
|
|
6130
5979
|
return null;
|
|
6131
5980
|
};
|
|
6132
|
-
return /* @__PURE__ */ (0,
|
|
5981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
6133
5982
|
"button",
|
|
6134
5983
|
{
|
|
6135
5984
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -6157,7 +6006,7 @@ __export(server_exports, {
|
|
|
6157
6006
|
module.exports = __toCommonJS(server_exports);
|
|
6158
6007
|
|
|
6159
6008
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
6160
|
-
var
|
|
6009
|
+
var import_react61 = __toESM(require("react"));
|
|
6161
6010
|
|
|
6162
6011
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
6163
6012
|
var import_react27 = __toESM(require("react"));
|
|
@@ -7399,7 +7248,7 @@ var WidgetNode_default = WidgetNode;
|
|
|
7399
7248
|
|
|
7400
7249
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7401
7250
|
var import_dynamic13 = __toESM(require("next/dynamic"));
|
|
7402
|
-
var
|
|
7251
|
+
var import_react60 = __toESM(require("react"));
|
|
7403
7252
|
|
|
7404
7253
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
7405
7254
|
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
@@ -8514,7 +8363,7 @@ var GoogleMapNode = (props) => {
|
|
|
8514
8363
|
var GoogleMapNode_default = GoogleMapNode;
|
|
8515
8364
|
|
|
8516
8365
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
8517
|
-
var
|
|
8366
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
8518
8367
|
var Pagination2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
8519
8368
|
var DataBindingControls2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
8520
8369
|
ssr: true
|
|
@@ -8755,7 +8604,8 @@ var DivContainer = async (props) => {
|
|
|
8755
8604
|
let result = null;
|
|
8756
8605
|
let response = null;
|
|
8757
8606
|
let childCollectionData = null;
|
|
8758
|
-
|
|
8607
|
+
let shouldShowNoDataMessage = props.forceNoDataMessage === true;
|
|
8608
|
+
if (dataBindingProperties && !shouldShowNoDataMessage) {
|
|
8759
8609
|
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
8760
8610
|
endpoint = dataBindingProperties.dataSource;
|
|
8761
8611
|
{
|
|
@@ -8772,15 +8622,17 @@ var DivContainer = async (props) => {
|
|
|
8772
8622
|
}
|
|
8773
8623
|
response = await serviceClient.get(endpoint);
|
|
8774
8624
|
result = response?.result;
|
|
8775
|
-
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
8776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(NoDataFound_default, {});
|
|
8777
|
-
}
|
|
8778
8625
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
8779
8626
|
childCollectionData = getNestedValue6(
|
|
8780
8627
|
props.dataitem,
|
|
8781
8628
|
dataBindingProperties.childCollectionName
|
|
8782
8629
|
);
|
|
8783
8630
|
}
|
|
8631
|
+
const effectiveResult = dataBindingProperties.childCollectionName ? childCollectionData : result;
|
|
8632
|
+
const hasNoData = effectiveResult === null || effectiveResult === void 0 || typeof effectiveResult === "string" && effectiveResult.trim() === "" || Array.isArray(effectiveResult) && effectiveResult.length === 0 || typeof effectiveResult === "object" && !Array.isArray(effectiveResult) && Object.keys(effectiveResult).length === 0;
|
|
8633
|
+
if (hasNoData && (props.node.repeatForEachItem === true || props.node.replicate === true)) {
|
|
8634
|
+
shouldShowNoDataMessage = dataBindingProperties.showNoResultsMessage;
|
|
8635
|
+
}
|
|
8784
8636
|
}
|
|
8785
8637
|
const cssResult = generateCssString(
|
|
8786
8638
|
guid,
|
|
@@ -8788,12 +8640,12 @@ var DivContainer = async (props) => {
|
|
|
8788
8640
|
tabletStyles,
|
|
8789
8641
|
mobileStyles
|
|
8790
8642
|
);
|
|
8791
|
-
function renderNode(node, props2, dataitem, key, href) {
|
|
8643
|
+
function renderNode(node, props2, dataitem, key, href, forceNoDataMessage = false) {
|
|
8792
8644
|
{
|
|
8793
8645
|
}
|
|
8794
8646
|
const SelectedNode = NodeTypes2[node.type];
|
|
8795
8647
|
if (!SelectedNode) return null;
|
|
8796
|
-
return /* @__PURE__ */ (0,
|
|
8648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react60.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8797
8649
|
SelectedNode,
|
|
8798
8650
|
{
|
|
8799
8651
|
node,
|
|
@@ -8809,7 +8661,8 @@ var DivContainer = async (props) => {
|
|
|
8809
8661
|
href,
|
|
8810
8662
|
assetBaseUrl: props2.assetBaseUrl,
|
|
8811
8663
|
device: props2.device,
|
|
8812
|
-
widgetRenderer: props2.widgetRenderer
|
|
8664
|
+
widgetRenderer: props2.widgetRenderer,
|
|
8665
|
+
forceNoDataMessage
|
|
8813
8666
|
}
|
|
8814
8667
|
) }, key);
|
|
8815
8668
|
}
|
|
@@ -8837,19 +8690,25 @@ var DivContainer = async (props) => {
|
|
|
8837
8690
|
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
8838
8691
|
});
|
|
8839
8692
|
}
|
|
8693
|
+
const arrayResult = result && props.node.dataBinding?.responseType === "array" && Array.isArray(result) ? result : null;
|
|
8694
|
+
const hasReplicatedChildren = Boolean(
|
|
8695
|
+
props.node.children?.some(
|
|
8696
|
+
(node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
|
|
8697
|
+
)
|
|
8698
|
+
);
|
|
8840
8699
|
const dataToRender = (() => {
|
|
8841
8700
|
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
8842
8701
|
return childCollectionData;
|
|
8843
8702
|
}
|
|
8844
|
-
if (
|
|
8845
|
-
return
|
|
8703
|
+
if (arrayResult && !hasReplicatedChildren) {
|
|
8704
|
+
return arrayResult;
|
|
8846
8705
|
}
|
|
8847
8706
|
if (result && props.node.dataBinding?.responseType === "object") {
|
|
8848
8707
|
return [result];
|
|
8849
8708
|
}
|
|
8850
8709
|
return [props.dataitem];
|
|
8851
8710
|
})();
|
|
8852
|
-
const backgroundDataItem = dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
8711
|
+
const backgroundDataItem = hasReplicatedChildren && arrayResult && arrayResult.length > 0 ? arrayResult[0] : dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
8853
8712
|
const background = generateCompleteBackgroundString(
|
|
8854
8713
|
props.node.backgroundLayers,
|
|
8855
8714
|
props.assetBaseUrl,
|
|
@@ -8864,6 +8723,52 @@ var DivContainer = async (props) => {
|
|
|
8864
8723
|
combinedStyles.backgroundClip = "text";
|
|
8865
8724
|
}
|
|
8866
8725
|
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
8726
|
+
const renderContainerChildren = () => {
|
|
8727
|
+
if (!hasReplicatedChildren) {
|
|
8728
|
+
return dataToRender.map(
|
|
8729
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren2(
|
|
8730
|
+
props.node.children,
|
|
8731
|
+
props,
|
|
8732
|
+
item,
|
|
8733
|
+
idx,
|
|
8734
|
+
props.href ? void 0 : item?.links?.view
|
|
8735
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react60.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8736
|
+
);
|
|
8737
|
+
}
|
|
8738
|
+
return props.node.children.flatMap((node, childIndex) => {
|
|
8739
|
+
if (node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)) {
|
|
8740
|
+
if (!arrayResult || arrayResult.length === 0) {
|
|
8741
|
+
return node?.dataBinding?.showNoResultsMessage ? [
|
|
8742
|
+
renderNode(
|
|
8743
|
+
node,
|
|
8744
|
+
props,
|
|
8745
|
+
props.dataitem,
|
|
8746
|
+
`no-results-${childIndex}`,
|
|
8747
|
+
void 0,
|
|
8748
|
+
true
|
|
8749
|
+
)
|
|
8750
|
+
] : [];
|
|
8751
|
+
}
|
|
8752
|
+
return arrayResult.map(
|
|
8753
|
+
(item, itemIndex) => renderNode(
|
|
8754
|
+
node,
|
|
8755
|
+
props,
|
|
8756
|
+
item,
|
|
8757
|
+
`replicated-${childIndex}-${itemIndex}`,
|
|
8758
|
+
item?.links?.view && !props.href ? item.links.view : void 0
|
|
8759
|
+
)
|
|
8760
|
+
);
|
|
8761
|
+
}
|
|
8762
|
+
return [
|
|
8763
|
+
renderNode(
|
|
8764
|
+
node,
|
|
8765
|
+
props,
|
|
8766
|
+
props.dataitem,
|
|
8767
|
+
`static-${childIndex}`
|
|
8768
|
+
)
|
|
8769
|
+
];
|
|
8770
|
+
});
|
|
8771
|
+
};
|
|
8867
8772
|
{
|
|
8868
8773
|
}
|
|
8869
8774
|
let Wrapper;
|
|
@@ -8930,25 +8835,17 @@ var DivContainer = async (props) => {
|
|
|
8930
8835
|
dataBindingProperties?.showFacets || dataBindingProperties?.showSortOptions || dataBindingProperties?.showSearchBar
|
|
8931
8836
|
);
|
|
8932
8837
|
const WrapperComponent = Wrapper;
|
|
8933
|
-
const renderedContainer = /* @__PURE__ */ (0,
|
|
8838
|
+
const renderedContainer = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8934
8839
|
WrapperComponent,
|
|
8935
8840
|
{
|
|
8936
8841
|
id: guid,
|
|
8937
8842
|
style: combinedStyles,
|
|
8938
8843
|
className: classNames || void 0,
|
|
8939
8844
|
...wrapperProps,
|
|
8940
|
-
children:
|
|
8941
|
-
(item, idx) => item?.links?.view && renderLink ? renderChildren2(
|
|
8942
|
-
props.node.children,
|
|
8943
|
-
props,
|
|
8944
|
-
item,
|
|
8945
|
-
idx,
|
|
8946
|
-
props.href ? void 0 : item?.links?.view
|
|
8947
|
-
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react62.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8948
|
-
)
|
|
8845
|
+
children: shouldShowNoDataMessage ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
8949
8846
|
}
|
|
8950
8847
|
);
|
|
8951
|
-
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0,
|
|
8848
|
+
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8952
8849
|
Pagination2,
|
|
8953
8850
|
{
|
|
8954
8851
|
path: props.path,
|
|
@@ -8956,15 +8853,15 @@ var DivContainer = async (props) => {
|
|
|
8956
8853
|
dataset: response
|
|
8957
8854
|
}
|
|
8958
8855
|
) : null;
|
|
8959
|
-
return /* @__PURE__ */ (0,
|
|
8960
|
-
/* @__PURE__ */ (0,
|
|
8856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react60.default.Fragment, { children: [
|
|
8857
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8961
8858
|
"style",
|
|
8962
8859
|
{
|
|
8963
8860
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
8964
8861
|
}
|
|
8965
8862
|
),
|
|
8966
|
-
showDataBindingControls ? /* @__PURE__ */ (0,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
8863
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react60.default.Fragment, { children: [
|
|
8864
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8968
8865
|
DataBindingControls2,
|
|
8969
8866
|
{
|
|
8970
8867
|
mode: "toolbar",
|
|
@@ -8976,18 +8873,18 @@ var DivContainer = async (props) => {
|
|
|
8976
8873
|
showSearchBar: dataBindingProperties?.showSearchBar
|
|
8977
8874
|
}
|
|
8978
8875
|
),
|
|
8979
|
-
/* @__PURE__ */ (0,
|
|
8876
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
8980
8877
|
"div",
|
|
8981
8878
|
{
|
|
8982
8879
|
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
8983
8880
|
children: [
|
|
8984
|
-
/* @__PURE__ */ (0,
|
|
8881
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "min-w-0", children: [
|
|
8985
8882
|
renderedContainer,
|
|
8986
8883
|
paginationControl
|
|
8987
8884
|
] }),
|
|
8988
|
-
dataBindingProperties?.showFacets && /* @__PURE__ */ (0,
|
|
8989
|
-
/* @__PURE__ */ (0,
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
8885
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("aside", { className: "border bg-default p-3 lg:sticky lg:top-[90px] lg:self-start", children: [
|
|
8886
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("h2", { className: "mb-2 text-lg font-semibold", children: "Filters" }),
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8991
8888
|
DataBindingControls2,
|
|
8992
8889
|
{
|
|
8993
8890
|
mode: "facets",
|
|
@@ -9001,16 +8898,16 @@ var DivContainer = async (props) => {
|
|
|
9001
8898
|
]
|
|
9002
8899
|
}
|
|
9003
8900
|
)
|
|
9004
|
-
] }) : /* @__PURE__ */ (0,
|
|
8901
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react60.default.Fragment, { children: [
|
|
9005
8902
|
renderedContainer,
|
|
9006
|
-
paginationControl && /* @__PURE__ */ (0,
|
|
8903
|
+
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: paginationControl })
|
|
9007
8904
|
] })
|
|
9008
8905
|
] });
|
|
9009
8906
|
};
|
|
9010
8907
|
var DivContainer_default = DivContainer;
|
|
9011
8908
|
|
|
9012
8909
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
9013
|
-
var
|
|
8910
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
9014
8911
|
var NodeTypes = {
|
|
9015
8912
|
["paragraph"]: ParagraphNode_default,
|
|
9016
8913
|
["heading"]: HeadingNode_default,
|
|
@@ -9048,14 +8945,14 @@ var PageBodyRenderer = (props) => {
|
|
|
9048
8945
|
}
|
|
9049
8946
|
return true;
|
|
9050
8947
|
};
|
|
9051
|
-
return /* @__PURE__ */ (0,
|
|
8948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react61.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
9052
8949
|
{
|
|
9053
8950
|
}
|
|
9054
8951
|
const SelectedNode = NodeTypes[node.type];
|
|
9055
8952
|
if (!shouldRenderNode(node)) {
|
|
9056
8953
|
return null;
|
|
9057
8954
|
}
|
|
9058
|
-
return /* @__PURE__ */ (0,
|
|
8955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react61.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react61.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9059
8956
|
SelectedNode,
|
|
9060
8957
|
{
|
|
9061
8958
|
node,
|
|
@@ -9071,7 +8968,7 @@ var PageBodyRenderer = (props) => {
|
|
|
9071
8968
|
device: props.device,
|
|
9072
8969
|
widgetRenderer: props.widgetRenderer
|
|
9073
8970
|
}
|
|
9074
|
-
) }) : /* @__PURE__ */ (0,
|
|
8971
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9075
8972
|
SelectedNode,
|
|
9076
8973
|
{
|
|
9077
8974
|
node,
|