@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260901043813 → 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/{DataBindingControls-GA2UILYQ.mjs → DataBindingControls-GWNAJ7PR.mjs} +1 -1
- package/dist/{DataBindingControls-ANAEGFPF.mjs → DataBindingControls-WC3HBVVQ.mjs} +1 -1
- package/dist/{InputControlClient-ZM6VEU6Q.mjs → InputControlClient-GRH7VSJR.mjs} +1 -1
- package/dist/{InputControlClient-HDT3N6ZI.mjs → InputControlClient-NHZU2L64.mjs} +1 -0
- package/dist/{chunk-PE3NKJNR.mjs → chunk-5VGTT4A5.mjs} +1 -0
- package/dist/{chunk-37F2HMKK.mjs → chunk-Q3LFGHLM.mjs} +1 -1
- package/dist/index.js +69 -18
- package/dist/index.mjs +71 -21
- package/dist/server.js +67 -18
- package/dist/server.mjs +67 -19
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { useRouter } from "next/navigation";
|
|
|
9
9
|
|
|
10
10
|
// src/components/controls/edit/InputControl.tsx
|
|
11
11
|
import dynamic from "next/dynamic";
|
|
12
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
12
|
+
var InputControl = dynamic(() => import("./InputControlClient-NHZU2L64.mjs"), {
|
|
13
13
|
ssr: false
|
|
14
14
|
});
|
|
15
15
|
var InputControl_default = InputControl;
|
|
@@ -101,6 +101,7 @@ var LineTextInput = (props) => {
|
|
|
101
101
|
value,
|
|
102
102
|
onChange: textChangeHandler,
|
|
103
103
|
onBlur: props?.onBlur,
|
|
104
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
104
105
|
required: props?.attributes?.required,
|
|
105
106
|
placeholder: props?.attributes?.placeholder,
|
|
106
107
|
maxLength: props?.attributes?.maxLength,
|
|
@@ -85,6 +85,7 @@ var LineTextInput = (props) => {
|
|
|
85
85
|
value,
|
|
86
86
|
onChange: textChangeHandler,
|
|
87
87
|
onBlur: props?.onBlur,
|
|
88
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
88
89
|
required: props?.attributes?.required,
|
|
89
90
|
placeholder: props?.attributes?.placeholder,
|
|
90
91
|
maxLength: props?.attributes?.maxLength,
|
|
@@ -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-GRH7VSJR.mjs"), {
|
|
7
7
|
ssr: false
|
|
8
8
|
});
|
|
9
9
|
var InputControl_default = InputControl;
|
package/dist/index.js
CHANGED
|
@@ -2114,6 +2114,7 @@ var init_LineTextInput = __esm({
|
|
|
2114
2114
|
value,
|
|
2115
2115
|
onChange: textChangeHandler,
|
|
2116
2116
|
onBlur: props?.onBlur,
|
|
2117
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
2117
2118
|
required: props?.attributes?.required,
|
|
2118
2119
|
placeholder: props?.attributes?.placeholder,
|
|
2119
2120
|
maxLength: props?.attributes?.maxLength,
|
|
@@ -8634,7 +8635,8 @@ var DivContainer = async (props) => {
|
|
|
8634
8635
|
let result = null;
|
|
8635
8636
|
let response = null;
|
|
8636
8637
|
let childCollectionData = null;
|
|
8637
|
-
|
|
8638
|
+
let shouldShowNoDataMessage = props.forceNoDataMessage === true;
|
|
8639
|
+
if (dataBindingProperties && !shouldShowNoDataMessage) {
|
|
8638
8640
|
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
8639
8641
|
endpoint = dataBindingProperties.dataSource;
|
|
8640
8642
|
{
|
|
@@ -8651,15 +8653,17 @@ var DivContainer = async (props) => {
|
|
|
8651
8653
|
}
|
|
8652
8654
|
response = await serviceClient.get(endpoint);
|
|
8653
8655
|
result = response?.result;
|
|
8654
|
-
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
8655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NoDataFound_default, {});
|
|
8656
|
-
}
|
|
8657
8656
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
8658
8657
|
childCollectionData = getNestedValue6(
|
|
8659
8658
|
props.dataitem,
|
|
8660
8659
|
dataBindingProperties.childCollectionName
|
|
8661
8660
|
);
|
|
8662
8661
|
}
|
|
8662
|
+
const effectiveResult = dataBindingProperties.childCollectionName ? childCollectionData : result;
|
|
8663
|
+
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;
|
|
8664
|
+
if (hasNoData && (props.node.repeatForEachItem === true || props.node.replicate === true)) {
|
|
8665
|
+
shouldShowNoDataMessage = dataBindingProperties.showNoResultsMessage;
|
|
8666
|
+
}
|
|
8663
8667
|
}
|
|
8664
8668
|
const cssResult = generateCssString(
|
|
8665
8669
|
guid,
|
|
@@ -8667,7 +8671,7 @@ var DivContainer = async (props) => {
|
|
|
8667
8671
|
tabletStyles,
|
|
8668
8672
|
mobileStyles
|
|
8669
8673
|
);
|
|
8670
|
-
function renderNode(node, props2, dataitem, key, href) {
|
|
8674
|
+
function renderNode(node, props2, dataitem, key, href, forceNoDataMessage = false) {
|
|
8671
8675
|
{
|
|
8672
8676
|
}
|
|
8673
8677
|
const SelectedNode = NodeTypes2[node.type];
|
|
@@ -8688,7 +8692,8 @@ var DivContainer = async (props) => {
|
|
|
8688
8692
|
href,
|
|
8689
8693
|
assetBaseUrl: props2.assetBaseUrl,
|
|
8690
8694
|
device: props2.device,
|
|
8691
|
-
widgetRenderer: props2.widgetRenderer
|
|
8695
|
+
widgetRenderer: props2.widgetRenderer,
|
|
8696
|
+
forceNoDataMessage
|
|
8692
8697
|
}
|
|
8693
8698
|
) }, key);
|
|
8694
8699
|
}
|
|
@@ -8716,19 +8721,25 @@ var DivContainer = async (props) => {
|
|
|
8716
8721
|
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
8717
8722
|
});
|
|
8718
8723
|
}
|
|
8724
|
+
const arrayResult = result && props.node.dataBinding?.responseType === "array" && Array.isArray(result) ? result : null;
|
|
8725
|
+
const hasReplicatedChildren = Boolean(
|
|
8726
|
+
props.node.children?.some(
|
|
8727
|
+
(node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
|
|
8728
|
+
)
|
|
8729
|
+
);
|
|
8719
8730
|
const dataToRender = (() => {
|
|
8720
8731
|
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
8721
8732
|
return childCollectionData;
|
|
8722
8733
|
}
|
|
8723
|
-
if (
|
|
8724
|
-
return
|
|
8734
|
+
if (arrayResult && !hasReplicatedChildren) {
|
|
8735
|
+
return arrayResult;
|
|
8725
8736
|
}
|
|
8726
8737
|
if (result && props.node.dataBinding?.responseType === "object") {
|
|
8727
8738
|
return [result];
|
|
8728
8739
|
}
|
|
8729
8740
|
return [props.dataitem];
|
|
8730
8741
|
})();
|
|
8731
|
-
const backgroundDataItem = dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
8742
|
+
const backgroundDataItem = hasReplicatedChildren && arrayResult && arrayResult.length > 0 ? arrayResult[0] : dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
8732
8743
|
const background = generateCompleteBackgroundString(
|
|
8733
8744
|
props.node.backgroundLayers,
|
|
8734
8745
|
props.assetBaseUrl,
|
|
@@ -8743,6 +8754,52 @@ var DivContainer = async (props) => {
|
|
|
8743
8754
|
combinedStyles.backgroundClip = "text";
|
|
8744
8755
|
}
|
|
8745
8756
|
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
8757
|
+
const renderContainerChildren = () => {
|
|
8758
|
+
if (!hasReplicatedChildren) {
|
|
8759
|
+
return dataToRender.map(
|
|
8760
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren2(
|
|
8761
|
+
props.node.children,
|
|
8762
|
+
props,
|
|
8763
|
+
item,
|
|
8764
|
+
idx,
|
|
8765
|
+
props.href ? void 0 : item?.links?.view
|
|
8766
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react60.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8767
|
+
);
|
|
8768
|
+
}
|
|
8769
|
+
return props.node.children.flatMap((node, childIndex) => {
|
|
8770
|
+
if (node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)) {
|
|
8771
|
+
if (!arrayResult || arrayResult.length === 0) {
|
|
8772
|
+
return node?.dataBinding?.showNoResultsMessage ? [
|
|
8773
|
+
renderNode(
|
|
8774
|
+
node,
|
|
8775
|
+
props,
|
|
8776
|
+
props.dataitem,
|
|
8777
|
+
`no-results-${childIndex}`,
|
|
8778
|
+
void 0,
|
|
8779
|
+
true
|
|
8780
|
+
)
|
|
8781
|
+
] : [];
|
|
8782
|
+
}
|
|
8783
|
+
return arrayResult.map(
|
|
8784
|
+
(item, itemIndex) => renderNode(
|
|
8785
|
+
node,
|
|
8786
|
+
props,
|
|
8787
|
+
item,
|
|
8788
|
+
`replicated-${childIndex}-${itemIndex}`,
|
|
8789
|
+
item?.links?.view && !props.href ? item.links.view : void 0
|
|
8790
|
+
)
|
|
8791
|
+
);
|
|
8792
|
+
}
|
|
8793
|
+
return [
|
|
8794
|
+
renderNode(
|
|
8795
|
+
node,
|
|
8796
|
+
props,
|
|
8797
|
+
props.dataitem,
|
|
8798
|
+
`static-${childIndex}`
|
|
8799
|
+
)
|
|
8800
|
+
];
|
|
8801
|
+
});
|
|
8802
|
+
};
|
|
8746
8803
|
{
|
|
8747
8804
|
}
|
|
8748
8805
|
let Wrapper;
|
|
@@ -8816,15 +8873,7 @@ var DivContainer = async (props) => {
|
|
|
8816
8873
|
style: combinedStyles,
|
|
8817
8874
|
className: classNames || void 0,
|
|
8818
8875
|
...wrapperProps,
|
|
8819
|
-
children:
|
|
8820
|
-
(item, idx) => item?.links?.view && renderLink ? renderChildren2(
|
|
8821
|
-
props.node.children,
|
|
8822
|
-
props,
|
|
8823
|
-
item,
|
|
8824
|
-
idx,
|
|
8825
|
-
props.href ? void 0 : item?.links?.view
|
|
8826
|
-
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react60.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8827
|
-
)
|
|
8876
|
+
children: shouldShowNoDataMessage ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
8828
8877
|
}
|
|
8829
8878
|
);
|
|
8830
8879
|
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
@@ -9546,6 +9595,7 @@ var DataList = (props) => {
|
|
|
9546
9595
|
value: searchTerm,
|
|
9547
9596
|
callback: (e) => setSearchTerm(e.value),
|
|
9548
9597
|
attributes: {
|
|
9598
|
+
autoFocus: true,
|
|
9549
9599
|
placeholder: `Search by ${props.columns.filter((col) => col.isSearchable).map((col) => col.label).join(", ")}`
|
|
9550
9600
|
}
|
|
9551
9601
|
}
|
|
@@ -9743,6 +9793,7 @@ var DataList = (props) => {
|
|
|
9743
9793
|
value: searchTerm,
|
|
9744
9794
|
callback: (e) => setSearchTerm(e.value),
|
|
9745
9795
|
attributes: {
|
|
9796
|
+
autoFocus: true,
|
|
9746
9797
|
placeholder: `Search by ${props.columns.filter((col) => col.isSearchable).map((col) => col.label).join(", ")}`
|
|
9747
9798
|
}
|
|
9748
9799
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-RG3CISAA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
InputControl_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q3LFGHLM.mjs";
|
|
9
9
|
import "./chunk-JDX47MFV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
CheckboxInput_default,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
SelectWithSearchInput_default,
|
|
25
25
|
Select_default,
|
|
26
26
|
TimeInput_default
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5VGTT4A5.mjs";
|
|
28
28
|
import {
|
|
29
29
|
Hyperlink,
|
|
30
30
|
Icon_default
|
|
@@ -2392,7 +2392,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2392
2392
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2393
2393
|
import { jsx as jsx37, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2394
2394
|
var Pagination = dynamic12(() => import("./Pagination-JGUQJ2DH.mjs"), { ssr: true });
|
|
2395
|
-
var DataBindingControls = dynamic12(() => import("./DataBindingControls-
|
|
2395
|
+
var DataBindingControls = dynamic12(() => import("./DataBindingControls-GWNAJ7PR.mjs"), {
|
|
2396
2396
|
ssr: true
|
|
2397
2397
|
});
|
|
2398
2398
|
var Slider = dynamic12(() => import("./Slider-554BKC7N.mjs"), {
|
|
@@ -2631,7 +2631,8 @@ var DivContainer = async (props) => {
|
|
|
2631
2631
|
let result = null;
|
|
2632
2632
|
let response = null;
|
|
2633
2633
|
let childCollectionData = null;
|
|
2634
|
-
|
|
2634
|
+
let shouldShowNoDataMessage = props.forceNoDataMessage === true;
|
|
2635
|
+
if (dataBindingProperties && !shouldShowNoDataMessage) {
|
|
2635
2636
|
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
2636
2637
|
endpoint = dataBindingProperties.dataSource;
|
|
2637
2638
|
{
|
|
@@ -2648,15 +2649,17 @@ var DivContainer = async (props) => {
|
|
|
2648
2649
|
}
|
|
2649
2650
|
response = await serviceClient.get(endpoint);
|
|
2650
2651
|
result = response?.result;
|
|
2651
|
-
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
2652
|
-
return /* @__PURE__ */ jsx37(NoDataFound_default, {});
|
|
2653
|
-
}
|
|
2654
2652
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
2655
2653
|
childCollectionData = getNestedValue6(
|
|
2656
2654
|
props.dataitem,
|
|
2657
2655
|
dataBindingProperties.childCollectionName
|
|
2658
2656
|
);
|
|
2659
2657
|
}
|
|
2658
|
+
const effectiveResult = dataBindingProperties.childCollectionName ? childCollectionData : result;
|
|
2659
|
+
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;
|
|
2660
|
+
if (hasNoData && (props.node.repeatForEachItem === true || props.node.replicate === true)) {
|
|
2661
|
+
shouldShowNoDataMessage = dataBindingProperties.showNoResultsMessage;
|
|
2662
|
+
}
|
|
2660
2663
|
}
|
|
2661
2664
|
const cssResult = generateCssString(
|
|
2662
2665
|
guid,
|
|
@@ -2664,7 +2667,7 @@ var DivContainer = async (props) => {
|
|
|
2664
2667
|
tabletStyles,
|
|
2665
2668
|
mobileStyles
|
|
2666
2669
|
);
|
|
2667
|
-
function renderNode(node, props2, dataitem, key, href) {
|
|
2670
|
+
function renderNode(node, props2, dataitem, key, href, forceNoDataMessage = false) {
|
|
2668
2671
|
{
|
|
2669
2672
|
}
|
|
2670
2673
|
const SelectedNode = NodeTypes2[node.type];
|
|
@@ -2685,7 +2688,8 @@ var DivContainer = async (props) => {
|
|
|
2685
2688
|
href,
|
|
2686
2689
|
assetBaseUrl: props2.assetBaseUrl,
|
|
2687
2690
|
device: props2.device,
|
|
2688
|
-
widgetRenderer: props2.widgetRenderer
|
|
2691
|
+
widgetRenderer: props2.widgetRenderer,
|
|
2692
|
+
forceNoDataMessage
|
|
2689
2693
|
}
|
|
2690
2694
|
) }, key);
|
|
2691
2695
|
}
|
|
@@ -2713,19 +2717,25 @@ var DivContainer = async (props) => {
|
|
|
2713
2717
|
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
2714
2718
|
});
|
|
2715
2719
|
}
|
|
2720
|
+
const arrayResult = result && props.node.dataBinding?.responseType === "array" && Array.isArray(result) ? result : null;
|
|
2721
|
+
const hasReplicatedChildren = Boolean(
|
|
2722
|
+
props.node.children?.some(
|
|
2723
|
+
(node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
|
|
2724
|
+
)
|
|
2725
|
+
);
|
|
2716
2726
|
const dataToRender = (() => {
|
|
2717
2727
|
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
2718
2728
|
return childCollectionData;
|
|
2719
2729
|
}
|
|
2720
|
-
if (
|
|
2721
|
-
return
|
|
2730
|
+
if (arrayResult && !hasReplicatedChildren) {
|
|
2731
|
+
return arrayResult;
|
|
2722
2732
|
}
|
|
2723
2733
|
if (result && props.node.dataBinding?.responseType === "object") {
|
|
2724
2734
|
return [result];
|
|
2725
2735
|
}
|
|
2726
2736
|
return [props.dataitem];
|
|
2727
2737
|
})();
|
|
2728
|
-
const backgroundDataItem = dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
2738
|
+
const backgroundDataItem = hasReplicatedChildren && arrayResult && arrayResult.length > 0 ? arrayResult[0] : dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
2729
2739
|
const background = generateCompleteBackgroundString(
|
|
2730
2740
|
props.node.backgroundLayers,
|
|
2731
2741
|
props.assetBaseUrl,
|
|
@@ -2740,6 +2750,52 @@ var DivContainer = async (props) => {
|
|
|
2740
2750
|
combinedStyles.backgroundClip = "text";
|
|
2741
2751
|
}
|
|
2742
2752
|
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
2753
|
+
const renderContainerChildren = () => {
|
|
2754
|
+
if (!hasReplicatedChildren) {
|
|
2755
|
+
return dataToRender.map(
|
|
2756
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
2757
|
+
props.node.children,
|
|
2758
|
+
props,
|
|
2759
|
+
item,
|
|
2760
|
+
idx,
|
|
2761
|
+
props.href ? void 0 : item?.links?.view
|
|
2762
|
+
)?.map((child, i) => /* @__PURE__ */ jsx37(React23.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
2763
|
+
);
|
|
2764
|
+
}
|
|
2765
|
+
return props.node.children.flatMap((node, childIndex) => {
|
|
2766
|
+
if (node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)) {
|
|
2767
|
+
if (!arrayResult || arrayResult.length === 0) {
|
|
2768
|
+
return node?.dataBinding?.showNoResultsMessage ? [
|
|
2769
|
+
renderNode(
|
|
2770
|
+
node,
|
|
2771
|
+
props,
|
|
2772
|
+
props.dataitem,
|
|
2773
|
+
`no-results-${childIndex}`,
|
|
2774
|
+
void 0,
|
|
2775
|
+
true
|
|
2776
|
+
)
|
|
2777
|
+
] : [];
|
|
2778
|
+
}
|
|
2779
|
+
return arrayResult.map(
|
|
2780
|
+
(item, itemIndex) => renderNode(
|
|
2781
|
+
node,
|
|
2782
|
+
props,
|
|
2783
|
+
item,
|
|
2784
|
+
`replicated-${childIndex}-${itemIndex}`,
|
|
2785
|
+
item?.links?.view && !props.href ? item.links.view : void 0
|
|
2786
|
+
)
|
|
2787
|
+
);
|
|
2788
|
+
}
|
|
2789
|
+
return [
|
|
2790
|
+
renderNode(
|
|
2791
|
+
node,
|
|
2792
|
+
props,
|
|
2793
|
+
props.dataitem,
|
|
2794
|
+
`static-${childIndex}`
|
|
2795
|
+
)
|
|
2796
|
+
];
|
|
2797
|
+
});
|
|
2798
|
+
};
|
|
2743
2799
|
{
|
|
2744
2800
|
}
|
|
2745
2801
|
let Wrapper;
|
|
@@ -2813,15 +2869,7 @@ var DivContainer = async (props) => {
|
|
|
2813
2869
|
style: combinedStyles,
|
|
2814
2870
|
className: classNames || void 0,
|
|
2815
2871
|
...wrapperProps,
|
|
2816
|
-
children:
|
|
2817
|
-
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
2818
|
-
props.node.children,
|
|
2819
|
-
props,
|
|
2820
|
-
item,
|
|
2821
|
-
idx,
|
|
2822
|
-
props.href ? void 0 : item?.links?.view
|
|
2823
|
-
)?.map((child, i) => /* @__PURE__ */ jsx37(React23.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
2824
|
-
)
|
|
2872
|
+
children: shouldShowNoDataMessage ? /* @__PURE__ */ jsx37(NoDataFound_default, {}) : renderContainerChildren()
|
|
2825
2873
|
}
|
|
2826
2874
|
);
|
|
2827
2875
|
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ jsx37(
|
|
@@ -3513,6 +3561,7 @@ var DataList = (props) => {
|
|
|
3513
3561
|
value: searchTerm,
|
|
3514
3562
|
callback: (e) => setSearchTerm(e.value),
|
|
3515
3563
|
attributes: {
|
|
3564
|
+
autoFocus: true,
|
|
3516
3565
|
placeholder: `Search by ${props.columns.filter((col) => col.isSearchable).map((col) => col.label).join(", ")}`
|
|
3517
3566
|
}
|
|
3518
3567
|
}
|
|
@@ -3710,6 +3759,7 @@ var DataList = (props) => {
|
|
|
3710
3759
|
value: searchTerm,
|
|
3711
3760
|
callback: (e) => setSearchTerm(e.value),
|
|
3712
3761
|
attributes: {
|
|
3762
|
+
autoFocus: true,
|
|
3713
3763
|
placeholder: `Search by ${props.columns.filter((col) => col.isSearchable).map((col) => col.label).join(", ")}`
|
|
3714
3764
|
}
|
|
3715
3765
|
}
|
package/dist/server.js
CHANGED
|
@@ -3625,6 +3625,7 @@ var init_LineTextInput = __esm({
|
|
|
3625
3625
|
value,
|
|
3626
3626
|
onChange: textChangeHandler,
|
|
3627
3627
|
onBlur: props?.onBlur,
|
|
3628
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
3628
3629
|
required: props?.attributes?.required,
|
|
3629
3630
|
placeholder: props?.attributes?.placeholder,
|
|
3630
3631
|
maxLength: props?.attributes?.maxLength,
|
|
@@ -8603,7 +8604,8 @@ var DivContainer = async (props) => {
|
|
|
8603
8604
|
let result = null;
|
|
8604
8605
|
let response = null;
|
|
8605
8606
|
let childCollectionData = null;
|
|
8606
|
-
|
|
8607
|
+
let shouldShowNoDataMessage = props.forceNoDataMessage === true;
|
|
8608
|
+
if (dataBindingProperties && !shouldShowNoDataMessage) {
|
|
8607
8609
|
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
8608
8610
|
endpoint = dataBindingProperties.dataSource;
|
|
8609
8611
|
{
|
|
@@ -8620,15 +8622,17 @@ var DivContainer = async (props) => {
|
|
|
8620
8622
|
}
|
|
8621
8623
|
response = await serviceClient.get(endpoint);
|
|
8622
8624
|
result = response?.result;
|
|
8623
|
-
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
8624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NoDataFound_default, {});
|
|
8625
|
-
}
|
|
8626
8625
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
8627
8626
|
childCollectionData = getNestedValue6(
|
|
8628
8627
|
props.dataitem,
|
|
8629
8628
|
dataBindingProperties.childCollectionName
|
|
8630
8629
|
);
|
|
8631
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
|
+
}
|
|
8632
8636
|
}
|
|
8633
8637
|
const cssResult = generateCssString(
|
|
8634
8638
|
guid,
|
|
@@ -8636,7 +8640,7 @@ var DivContainer = async (props) => {
|
|
|
8636
8640
|
tabletStyles,
|
|
8637
8641
|
mobileStyles
|
|
8638
8642
|
);
|
|
8639
|
-
function renderNode(node, props2, dataitem, key, href) {
|
|
8643
|
+
function renderNode(node, props2, dataitem, key, href, forceNoDataMessage = false) {
|
|
8640
8644
|
{
|
|
8641
8645
|
}
|
|
8642
8646
|
const SelectedNode = NodeTypes2[node.type];
|
|
@@ -8657,7 +8661,8 @@ var DivContainer = async (props) => {
|
|
|
8657
8661
|
href,
|
|
8658
8662
|
assetBaseUrl: props2.assetBaseUrl,
|
|
8659
8663
|
device: props2.device,
|
|
8660
|
-
widgetRenderer: props2.widgetRenderer
|
|
8664
|
+
widgetRenderer: props2.widgetRenderer,
|
|
8665
|
+
forceNoDataMessage
|
|
8661
8666
|
}
|
|
8662
8667
|
) }, key);
|
|
8663
8668
|
}
|
|
@@ -8685,19 +8690,25 @@ var DivContainer = async (props) => {
|
|
|
8685
8690
|
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
8686
8691
|
});
|
|
8687
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
|
+
);
|
|
8688
8699
|
const dataToRender = (() => {
|
|
8689
8700
|
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
8690
8701
|
return childCollectionData;
|
|
8691
8702
|
}
|
|
8692
|
-
if (
|
|
8693
|
-
return
|
|
8703
|
+
if (arrayResult && !hasReplicatedChildren) {
|
|
8704
|
+
return arrayResult;
|
|
8694
8705
|
}
|
|
8695
8706
|
if (result && props.node.dataBinding?.responseType === "object") {
|
|
8696
8707
|
return [result];
|
|
8697
8708
|
}
|
|
8698
8709
|
return [props.dataitem];
|
|
8699
8710
|
})();
|
|
8700
|
-
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;
|
|
8701
8712
|
const background = generateCompleteBackgroundString(
|
|
8702
8713
|
props.node.backgroundLayers,
|
|
8703
8714
|
props.assetBaseUrl,
|
|
@@ -8712,6 +8723,52 @@ var DivContainer = async (props) => {
|
|
|
8712
8723
|
combinedStyles.backgroundClip = "text";
|
|
8713
8724
|
}
|
|
8714
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
|
+
};
|
|
8715
8772
|
{
|
|
8716
8773
|
}
|
|
8717
8774
|
let Wrapper;
|
|
@@ -8785,15 +8842,7 @@ var DivContainer = async (props) => {
|
|
|
8785
8842
|
style: combinedStyles,
|
|
8786
8843
|
className: classNames || void 0,
|
|
8787
8844
|
...wrapperProps,
|
|
8788
|
-
children:
|
|
8789
|
-
(item, idx) => item?.links?.view && renderLink ? renderChildren2(
|
|
8790
|
-
props.node.children,
|
|
8791
|
-
props,
|
|
8792
|
-
item,
|
|
8793
|
-
idx,
|
|
8794
|
-
props.href ? void 0 : item?.links?.view
|
|
8795
|
-
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react60.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
8796
|
-
)
|
|
8845
|
+
children: shouldShowNoDataMessage ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
8797
8846
|
}
|
|
8798
8847
|
);
|
|
8799
8848
|
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
package/dist/server.mjs
CHANGED
|
@@ -2360,7 +2360,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2360
2360
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2361
2361
|
import { jsx as jsx37, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2362
2362
|
var Pagination = dynamic12(() => import("./Pagination-LNJ27L7U.mjs"), { ssr: true });
|
|
2363
|
-
var DataBindingControls = dynamic12(() => import("./DataBindingControls-
|
|
2363
|
+
var DataBindingControls = dynamic12(() => import("./DataBindingControls-WC3HBVVQ.mjs"), {
|
|
2364
2364
|
ssr: true
|
|
2365
2365
|
});
|
|
2366
2366
|
var Slider = dynamic12(() => import("./Slider-PEIVH6A5.mjs"), {
|
|
@@ -2599,7 +2599,8 @@ var DivContainer = async (props) => {
|
|
|
2599
2599
|
let result = null;
|
|
2600
2600
|
let response = null;
|
|
2601
2601
|
let childCollectionData = null;
|
|
2602
|
-
|
|
2602
|
+
let shouldShowNoDataMessage = props.forceNoDataMessage === true;
|
|
2603
|
+
if (dataBindingProperties && !shouldShowNoDataMessage) {
|
|
2603
2604
|
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
2604
2605
|
endpoint = dataBindingProperties.dataSource;
|
|
2605
2606
|
{
|
|
@@ -2616,15 +2617,17 @@ var DivContainer = async (props) => {
|
|
|
2616
2617
|
}
|
|
2617
2618
|
response = await serviceClient.get(endpoint);
|
|
2618
2619
|
result = response?.result;
|
|
2619
|
-
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
2620
|
-
return /* @__PURE__ */ jsx37(NoDataFound_default, {});
|
|
2621
|
-
}
|
|
2622
2620
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
2623
2621
|
childCollectionData = getNestedValue6(
|
|
2624
2622
|
props.dataitem,
|
|
2625
2623
|
dataBindingProperties.childCollectionName
|
|
2626
2624
|
);
|
|
2627
2625
|
}
|
|
2626
|
+
const effectiveResult = dataBindingProperties.childCollectionName ? childCollectionData : result;
|
|
2627
|
+
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;
|
|
2628
|
+
if (hasNoData && (props.node.repeatForEachItem === true || props.node.replicate === true)) {
|
|
2629
|
+
shouldShowNoDataMessage = dataBindingProperties.showNoResultsMessage;
|
|
2630
|
+
}
|
|
2628
2631
|
}
|
|
2629
2632
|
const cssResult = generateCssString(
|
|
2630
2633
|
guid,
|
|
@@ -2632,7 +2635,7 @@ var DivContainer = async (props) => {
|
|
|
2632
2635
|
tabletStyles,
|
|
2633
2636
|
mobileStyles
|
|
2634
2637
|
);
|
|
2635
|
-
function renderNode(node, props2, dataitem, key, href) {
|
|
2638
|
+
function renderNode(node, props2, dataitem, key, href, forceNoDataMessage = false) {
|
|
2636
2639
|
{
|
|
2637
2640
|
}
|
|
2638
2641
|
const SelectedNode = NodeTypes2[node.type];
|
|
@@ -2653,7 +2656,8 @@ var DivContainer = async (props) => {
|
|
|
2653
2656
|
href,
|
|
2654
2657
|
assetBaseUrl: props2.assetBaseUrl,
|
|
2655
2658
|
device: props2.device,
|
|
2656
|
-
widgetRenderer: props2.widgetRenderer
|
|
2659
|
+
widgetRenderer: props2.widgetRenderer,
|
|
2660
|
+
forceNoDataMessage
|
|
2657
2661
|
}
|
|
2658
2662
|
) }, key);
|
|
2659
2663
|
}
|
|
@@ -2681,19 +2685,25 @@ var DivContainer = async (props) => {
|
|
|
2681
2685
|
return dataItem[key] !== void 0 ? dataItem[key] : match;
|
|
2682
2686
|
});
|
|
2683
2687
|
}
|
|
2688
|
+
const arrayResult = result && props.node.dataBinding?.responseType === "array" && Array.isArray(result) ? result : null;
|
|
2689
|
+
const hasReplicatedChildren = Boolean(
|
|
2690
|
+
props.node.children?.some(
|
|
2691
|
+
(node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
|
|
2692
|
+
)
|
|
2693
|
+
);
|
|
2684
2694
|
const dataToRender = (() => {
|
|
2685
2695
|
if (childCollectionData && Array.isArray(childCollectionData)) {
|
|
2686
2696
|
return childCollectionData;
|
|
2687
2697
|
}
|
|
2688
|
-
if (
|
|
2689
|
-
return
|
|
2698
|
+
if (arrayResult && !hasReplicatedChildren) {
|
|
2699
|
+
return arrayResult;
|
|
2690
2700
|
}
|
|
2691
2701
|
if (result && props.node.dataBinding?.responseType === "object") {
|
|
2692
2702
|
return [result];
|
|
2693
2703
|
}
|
|
2694
2704
|
return [props.dataitem];
|
|
2695
2705
|
})();
|
|
2696
|
-
const backgroundDataItem = dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
2706
|
+
const backgroundDataItem = hasReplicatedChildren && arrayResult && arrayResult.length > 0 ? arrayResult[0] : dataToRender.length > 0 ? dataToRender[0] : props.dataitem;
|
|
2697
2707
|
const background = generateCompleteBackgroundString(
|
|
2698
2708
|
props.node.backgroundLayers,
|
|
2699
2709
|
props.assetBaseUrl,
|
|
@@ -2708,6 +2718,52 @@ var DivContainer = async (props) => {
|
|
|
2708
2718
|
combinedStyles.backgroundClip = "text";
|
|
2709
2719
|
}
|
|
2710
2720
|
const renderLink = result && props.node.dataBinding?.responseType === "array" ? true : false;
|
|
2721
|
+
const renderContainerChildren = () => {
|
|
2722
|
+
if (!hasReplicatedChildren) {
|
|
2723
|
+
return dataToRender.map(
|
|
2724
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
2725
|
+
props.node.children,
|
|
2726
|
+
props,
|
|
2727
|
+
item,
|
|
2728
|
+
idx,
|
|
2729
|
+
props.href ? void 0 : item?.links?.view
|
|
2730
|
+
)?.map((child, i) => /* @__PURE__ */ jsx37(React23.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
2731
|
+
);
|
|
2732
|
+
}
|
|
2733
|
+
return props.node.children.flatMap((node, childIndex) => {
|
|
2734
|
+
if (node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)) {
|
|
2735
|
+
if (!arrayResult || arrayResult.length === 0) {
|
|
2736
|
+
return node?.dataBinding?.showNoResultsMessage ? [
|
|
2737
|
+
renderNode(
|
|
2738
|
+
node,
|
|
2739
|
+
props,
|
|
2740
|
+
props.dataitem,
|
|
2741
|
+
`no-results-${childIndex}`,
|
|
2742
|
+
void 0,
|
|
2743
|
+
true
|
|
2744
|
+
)
|
|
2745
|
+
] : [];
|
|
2746
|
+
}
|
|
2747
|
+
return arrayResult.map(
|
|
2748
|
+
(item, itemIndex) => renderNode(
|
|
2749
|
+
node,
|
|
2750
|
+
props,
|
|
2751
|
+
item,
|
|
2752
|
+
`replicated-${childIndex}-${itemIndex}`,
|
|
2753
|
+
item?.links?.view && !props.href ? item.links.view : void 0
|
|
2754
|
+
)
|
|
2755
|
+
);
|
|
2756
|
+
}
|
|
2757
|
+
return [
|
|
2758
|
+
renderNode(
|
|
2759
|
+
node,
|
|
2760
|
+
props,
|
|
2761
|
+
props.dataitem,
|
|
2762
|
+
`static-${childIndex}`
|
|
2763
|
+
)
|
|
2764
|
+
];
|
|
2765
|
+
});
|
|
2766
|
+
};
|
|
2711
2767
|
{
|
|
2712
2768
|
}
|
|
2713
2769
|
let Wrapper;
|
|
@@ -2781,15 +2837,7 @@ var DivContainer = async (props) => {
|
|
|
2781
2837
|
style: combinedStyles,
|
|
2782
2838
|
className: classNames || void 0,
|
|
2783
2839
|
...wrapperProps,
|
|
2784
|
-
children:
|
|
2785
|
-
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
2786
|
-
props.node.children,
|
|
2787
|
-
props,
|
|
2788
|
-
item,
|
|
2789
|
-
idx,
|
|
2790
|
-
props.href ? void 0 : item?.links?.view
|
|
2791
|
-
)?.map((child, i) => /* @__PURE__ */ jsx37(React23.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
2792
|
-
)
|
|
2840
|
+
children: shouldShowNoDataMessage ? /* @__PURE__ */ jsx37(NoDataFound_default, {}) : renderContainerChildren()
|
|
2793
2841
|
}
|
|
2794
2842
|
);
|
|
2795
2843
|
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ jsx37(
|