@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/server.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  OdataBuilder
3
- } from "./chunk-5TQWVOWH.mjs";
3
+ } from "./chunk-2VS554XP.mjs";
4
4
  import {
5
5
  Hyperlink
6
6
  } from "./chunk-2R26M6CK.mjs";
7
- import "./chunk-4R7F7LBL.mjs";
7
+ import "./chunk-IEY342PD.mjs";
8
8
  import {
9
9
  ServiceClient_default
10
10
  } from "./chunk-WXZMRMRS.mjs";
@@ -743,7 +743,7 @@ var TimeUntilStarts_default = TimeUntilStarts;
743
743
 
744
744
  // src/components/controls/view/Commentrenderer.tsx
745
745
  import dynamic7 from "next/dynamic";
746
- var CommentRenderer = dynamic7(() => import("./CommentRendererClient-JYDYPHSQ.mjs"), {
746
+ var CommentRenderer = dynamic7(() => import("./CommentRendererClient-FU5ZMGBV.mjs"), {
747
747
  ssr: false
748
748
  });
749
749
  var Commentrenderer_default = CommentRenderer;
@@ -2359,8 +2359,8 @@ var GoogleMapNode_default = GoogleMapNode;
2359
2359
 
2360
2360
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
2361
2361
  import { jsx as jsx37, jsxs as jsxs14 } from "react/jsx-runtime";
2362
- var Pagination = dynamic12(() => import("./Pagination-QBPYDD66.mjs"), { ssr: true });
2363
- var DataBindingControls = dynamic12(() => import("./DataBindingControls-Y4JXUDZV.mjs"), {
2362
+ var Pagination = dynamic12(() => import("./Pagination-LNJ27L7U.mjs"), { ssr: true });
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
- if (dataBindingProperties) {
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 (result && props.node.dataBinding?.responseType === "array") {
2689
- return result;
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: dataToRender.map(
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(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clyrex-digital/clyrex-controls-dev",
3
- "version": "0.8.1-dev.20260831113446",
3
+ "version": "0.8.1-dev.20260901054125",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",