@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260627092052 → 0.8.1-dev.20260629084835

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/index.js CHANGED
@@ -6143,10 +6143,7 @@ function convertKeysToCamelCase(obj) {
6143
6143
  if (!obj || typeof obj !== "object") return obj;
6144
6144
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
6145
6145
  return Object.fromEntries(
6146
- Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [
6147
- toCamelCase(key),
6148
- convertKeysToCamelCase(value)
6149
- ])
6146
+ Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [toCamelCase(key), convertKeysToCamelCase(value)])
6150
6147
  );
6151
6148
  }
6152
6149
  var getNestedValue5 = (obj, path) => {
@@ -6194,14 +6191,8 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
6194
6191
  const imageValue = layer.value;
6195
6192
  let assetUrl = imageValue.assetUrl || "";
6196
6193
  if (layer.datafield && dataItem) {
6197
- const fieldValue = getNestedValue5(
6198
- dataItem,
6199
- layer.datafield
6200
- );
6201
- const resolvedAssetUrl = resolveAssetUrl2(
6202
- fieldValue,
6203
- layer.tag
6204
- );
6194
+ const fieldValue = getNestedValue5(dataItem, layer.datafield);
6195
+ const resolvedAssetUrl = resolveAssetUrl2(fieldValue, layer.tag);
6205
6196
  if (resolvedAssetUrl) {
6206
6197
  assetUrl = resolvedAssetUrl;
6207
6198
  }
@@ -6209,10 +6200,7 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
6209
6200
  if (!assetUrl) {
6210
6201
  return "";
6211
6202
  }
6212
- const url = `url('${AssetUtility_default.resolveUrl(
6213
- apiBaseUrl,
6214
- assetUrl
6215
- )}')`;
6203
+ const url = `url('${AssetUtility_default.resolveUrl(apiBaseUrl, assetUrl)}')`;
6216
6204
  const repeat = layer.repeat || "no-repeat";
6217
6205
  const position = layer.position || "center";
6218
6206
  const size = layer.size || "auto";
@@ -6341,24 +6329,32 @@ var DivContainer = async (props) => {
6341
6329
  let animationCSS = "";
6342
6330
  if (enterAnimation?.name) {
6343
6331
  animationCSS += AnimationUtility_default.generateAnimationCSS(
6344
- { animation: enterAnimation.name, mode: "enter", ...enterAnimation.properties },
6332
+ {
6333
+ animation: enterAnimation.name,
6334
+ mode: "enter",
6335
+ ...enterAnimation.properties
6336
+ },
6345
6337
  `#${guid}`
6346
6338
  );
6347
6339
  }
6348
6340
  if (hoverAnimation?.name) {
6349
6341
  animationCSS += AnimationUtility_default.generateAnimationCSS(
6350
- { animation: hoverAnimation.name, mode: "hover", ...hoverAnimation.properties },
6342
+ {
6343
+ animation: hoverAnimation.name,
6344
+ mode: "hover",
6345
+ ...hoverAnimation.properties
6346
+ },
6351
6347
  `#${guid}`
6352
6348
  );
6353
6349
  }
6354
6350
  const shouldHideContainer = () => {
6355
6351
  if (!props.node.fieldVisibleOnTrue) return false;
6356
- const condition = props.node.fieldVisibleOnTrue;
6352
+ const condition = props.node.fieldVisibleOnTrue.trim();
6357
6353
  const isNegated = condition.startsWith("!");
6358
- const fieldName = isNegated ? condition.substring(1) : condition;
6354
+ const fieldName = isNegated ? condition.substring(1).trim() : condition;
6359
6355
  const fieldValue = getNestedValue5(props.dataitem, fieldName);
6360
- if (fieldValue === void 0) {
6361
- return false;
6356
+ if (fieldValue == null || fieldValue === 0) {
6357
+ return true;
6362
6358
  }
6363
6359
  return isNegated ? fieldValue === true : fieldValue === false;
6364
6360
  };
@@ -6398,7 +6394,10 @@ var DivContainer = async (props) => {
6398
6394
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(NoDataFound_default, {});
6399
6395
  }
6400
6396
  if (dataBindingProperties.childCollectionName && props.dataitem) {
6401
- childCollectionData = getNestedValue5(props.dataitem, dataBindingProperties.childCollectionName);
6397
+ childCollectionData = getNestedValue5(
6398
+ props.dataitem,
6399
+ dataBindingProperties.childCollectionName
6400
+ );
6402
6401
  }
6403
6402
  }
6404
6403
  const cssResult = generateCssString(
@@ -6435,7 +6434,10 @@ var DivContainer = async (props) => {
6435
6434
  function renderChildren(nodes, props2, data, key, href) {
6436
6435
  if (!nodes) return null;
6437
6436
  const childNodes = nodes.map((node, index) => {
6438
- if (node.type === "div-container" && node.dataBinding?.childCollectionName && data) {
6437
+ if (
6438
+ // @ts-expect-error custom code
6439
+ node.type === "div-container" && node.dataBinding?.childCollectionName && data
6440
+ ) {
6439
6441
  return renderNode(node, props2, data, index, href);
6440
6442
  }
6441
6443
  return renderNode(node, props2, data, index, href);
@@ -6494,7 +6496,10 @@ var DivContainer = async (props) => {
6494
6496
  medium: Math.ceil(largeCols / 2),
6495
6497
  small: 1
6496
6498
  };
6497
- wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
6499
+ wrapperProps = {
6500
+ ...props.node.componentProperties,
6501
+ slidesToShow
6502
+ };
6498
6503
  break;
6499
6504
  case !!(props.node.href || props.href):
6500
6505
  Wrapper = import_link2.default;
@@ -6502,11 +6507,18 @@ var DivContainer = async (props) => {
6502
6507
  if (href?.includes("{")) {
6503
6508
  href = resolveHrefTemplate(href, props.dataitem);
6504
6509
  }
6505
- const currentPath = decodeURIComponent(PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query));
6510
+ const currentPath = decodeURIComponent(
6511
+ PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query)
6512
+ );
6506
6513
  const resolvedHref = decodeURIComponent(href || "");
6507
6514
  const isSelected = currentPath === resolvedHref;
6508
6515
  noLinkColor = true;
6509
- wrapperProps = { href, "data-isSelected": isSelected, "data-path": currentPath, "data-href": resolvedHref };
6516
+ wrapperProps = {
6517
+ href,
6518
+ "data-isSelected": isSelected,
6519
+ "data-path": currentPath,
6520
+ "data-href": resolvedHref
6521
+ };
6510
6522
  break;
6511
6523
  default: {
6512
6524
  const replacementTag = props.node.replaceDivTagWith;
@@ -6532,7 +6544,12 @@ var DivContainer = async (props) => {
6532
6544
  noLinkColor && "no-link-color"
6533
6545
  ].filter(Boolean).join(" ");
6534
6546
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_react50.default.Fragment, { children: [
6535
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
6547
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
6548
+ "style",
6549
+ {
6550
+ dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
6551
+ }
6552
+ ),
6536
6553
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
6537
6554
  Wrapper,
6538
6555
  {
@@ -6541,13 +6558,24 @@ var DivContainer = async (props) => {
6541
6558
  className: classNames || void 0,
6542
6559
  ...wrapperProps,
6543
6560
  children: dataToRender.map(
6544
- (item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
6545
- (child, i) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react50.default.Fragment, { children: child }, i)
6546
- ) : renderChildren(props.node.children, props, item, idx)
6561
+ (item, idx) => item?.links?.view && renderLink ? renderChildren(
6562
+ props.node.children,
6563
+ props,
6564
+ item,
6565
+ idx,
6566
+ props.href ? void 0 : item?.links?.view
6567
+ )?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react50.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
6547
6568
  )
6548
6569
  }
6549
6570
  ) }),
6550
- dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
6571
+ dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
6572
+ Pagination_default,
6573
+ {
6574
+ path: props.path,
6575
+ query: props.query,
6576
+ dataset: response
6577
+ }
6578
+ ) })
6551
6579
  ] });
6552
6580
  };
6553
6581
  var DivContainer_default = DivContainer;
package/dist/index.mjs CHANGED
@@ -4537,10 +4537,7 @@ function convertKeysToCamelCase(obj) {
4537
4537
  if (!obj || typeof obj !== "object") return obj;
4538
4538
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
4539
4539
  return Object.fromEntries(
4540
- Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [
4541
- toCamelCase(key),
4542
- convertKeysToCamelCase(value)
4543
- ])
4540
+ Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [toCamelCase(key), convertKeysToCamelCase(value)])
4544
4541
  );
4545
4542
  }
4546
4543
  var getNestedValue5 = (obj, path) => {
@@ -4588,14 +4585,8 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
4588
4585
  const imageValue = layer.value;
4589
4586
  let assetUrl = imageValue.assetUrl || "";
4590
4587
  if (layer.datafield && dataItem) {
4591
- const fieldValue = getNestedValue5(
4592
- dataItem,
4593
- layer.datafield
4594
- );
4595
- const resolvedAssetUrl = resolveAssetUrl2(
4596
- fieldValue,
4597
- layer.tag
4598
- );
4588
+ const fieldValue = getNestedValue5(dataItem, layer.datafield);
4589
+ const resolvedAssetUrl = resolveAssetUrl2(fieldValue, layer.tag);
4599
4590
  if (resolvedAssetUrl) {
4600
4591
  assetUrl = resolvedAssetUrl;
4601
4592
  }
@@ -4603,10 +4594,7 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
4603
4594
  if (!assetUrl) {
4604
4595
  return "";
4605
4596
  }
4606
- const url = `url('${AssetUtility_default.resolveUrl(
4607
- apiBaseUrl,
4608
- assetUrl
4609
- )}')`;
4597
+ const url = `url('${AssetUtility_default.resolveUrl(apiBaseUrl, assetUrl)}')`;
4610
4598
  const repeat = layer.repeat || "no-repeat";
4611
4599
  const position = layer.position || "center";
4612
4600
  const size = layer.size || "auto";
@@ -4735,24 +4723,32 @@ var DivContainer = async (props) => {
4735
4723
  let animationCSS = "";
4736
4724
  if (enterAnimation?.name) {
4737
4725
  animationCSS += AnimationUtility_default.generateAnimationCSS(
4738
- { animation: enterAnimation.name, mode: "enter", ...enterAnimation.properties },
4726
+ {
4727
+ animation: enterAnimation.name,
4728
+ mode: "enter",
4729
+ ...enterAnimation.properties
4730
+ },
4739
4731
  `#${guid}`
4740
4732
  );
4741
4733
  }
4742
4734
  if (hoverAnimation?.name) {
4743
4735
  animationCSS += AnimationUtility_default.generateAnimationCSS(
4744
- { animation: hoverAnimation.name, mode: "hover", ...hoverAnimation.properties },
4736
+ {
4737
+ animation: hoverAnimation.name,
4738
+ mode: "hover",
4739
+ ...hoverAnimation.properties
4740
+ },
4745
4741
  `#${guid}`
4746
4742
  );
4747
4743
  }
4748
4744
  const shouldHideContainer = () => {
4749
4745
  if (!props.node.fieldVisibleOnTrue) return false;
4750
- const condition = props.node.fieldVisibleOnTrue;
4746
+ const condition = props.node.fieldVisibleOnTrue.trim();
4751
4747
  const isNegated = condition.startsWith("!");
4752
- const fieldName = isNegated ? condition.substring(1) : condition;
4748
+ const fieldName = isNegated ? condition.substring(1).trim() : condition;
4753
4749
  const fieldValue = getNestedValue5(props.dataitem, fieldName);
4754
- if (fieldValue === void 0) {
4755
- return false;
4750
+ if (fieldValue == null || fieldValue === 0) {
4751
+ return true;
4756
4752
  }
4757
4753
  return isNegated ? fieldValue === true : fieldValue === false;
4758
4754
  };
@@ -4792,7 +4788,10 @@ var DivContainer = async (props) => {
4792
4788
  return /* @__PURE__ */ jsx60(NoDataFound_default, {});
4793
4789
  }
4794
4790
  if (dataBindingProperties.childCollectionName && props.dataitem) {
4795
- childCollectionData = getNestedValue5(props.dataitem, dataBindingProperties.childCollectionName);
4791
+ childCollectionData = getNestedValue5(
4792
+ props.dataitem,
4793
+ dataBindingProperties.childCollectionName
4794
+ );
4796
4795
  }
4797
4796
  }
4798
4797
  const cssResult = generateCssString(
@@ -4829,7 +4828,10 @@ var DivContainer = async (props) => {
4829
4828
  function renderChildren(nodes, props2, data, key, href) {
4830
4829
  if (!nodes) return null;
4831
4830
  const childNodes = nodes.map((node, index) => {
4832
- if (node.type === "div-container" && node.dataBinding?.childCollectionName && data) {
4831
+ if (
4832
+ // @ts-expect-error custom code
4833
+ node.type === "div-container" && node.dataBinding?.childCollectionName && data
4834
+ ) {
4833
4835
  return renderNode(node, props2, data, index, href);
4834
4836
  }
4835
4837
  return renderNode(node, props2, data, index, href);
@@ -4888,7 +4890,10 @@ var DivContainer = async (props) => {
4888
4890
  medium: Math.ceil(largeCols / 2),
4889
4891
  small: 1
4890
4892
  };
4891
- wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
4893
+ wrapperProps = {
4894
+ ...props.node.componentProperties,
4895
+ slidesToShow
4896
+ };
4892
4897
  break;
4893
4898
  case !!(props.node.href || props.href):
4894
4899
  Wrapper = Link2;
@@ -4896,11 +4901,18 @@ var DivContainer = async (props) => {
4896
4901
  if (href?.includes("{")) {
4897
4902
  href = resolveHrefTemplate(href, props.dataitem);
4898
4903
  }
4899
- const currentPath = decodeURIComponent(PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query));
4904
+ const currentPath = decodeURIComponent(
4905
+ PathUtility_default.removeTrailingSlash(props.path) + "?" + queryObjectToString(props.query)
4906
+ );
4900
4907
  const resolvedHref = decodeURIComponent(href || "");
4901
4908
  const isSelected = currentPath === resolvedHref;
4902
4909
  noLinkColor = true;
4903
- wrapperProps = { href, "data-isSelected": isSelected, "data-path": currentPath, "data-href": resolvedHref };
4910
+ wrapperProps = {
4911
+ href,
4912
+ "data-isSelected": isSelected,
4913
+ "data-path": currentPath,
4914
+ "data-href": resolvedHref
4915
+ };
4904
4916
  break;
4905
4917
  default: {
4906
4918
  const replacementTag = props.node.replaceDivTagWith;
@@ -4926,7 +4938,12 @@ var DivContainer = async (props) => {
4926
4938
  noLinkColor && "no-link-color"
4927
4939
  ].filter(Boolean).join(" ");
4928
4940
  return /* @__PURE__ */ jsxs33(React41.Fragment, { children: [
4929
- /* @__PURE__ */ jsx60("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
4941
+ /* @__PURE__ */ jsx60(
4942
+ "style",
4943
+ {
4944
+ dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
4945
+ }
4946
+ ),
4930
4947
  /* @__PURE__ */ jsx60(React41.Fragment, { children: /* @__PURE__ */ jsx60(
4931
4948
  Wrapper,
4932
4949
  {
@@ -4935,13 +4952,24 @@ var DivContainer = async (props) => {
4935
4952
  className: classNames || void 0,
4936
4953
  ...wrapperProps,
4937
4954
  children: dataToRender.map(
4938
- (item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
4939
- (child, i) => /* @__PURE__ */ jsx60(React41.Fragment, { children: child }, i)
4940
- ) : renderChildren(props.node.children, props, item, idx)
4955
+ (item, idx) => item?.links?.view && renderLink ? renderChildren(
4956
+ props.node.children,
4957
+ props,
4958
+ item,
4959
+ idx,
4960
+ props.href ? void 0 : item?.links?.view
4961
+ )?.map((child, i) => /* @__PURE__ */ jsx60(React41.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
4941
4962
  )
4942
4963
  }
4943
4964
  ) }),
4944
- dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ jsx60("div", { children: /* @__PURE__ */ jsx60(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
4965
+ dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ jsx60("div", { children: /* @__PURE__ */ jsx60(
4966
+ Pagination_default,
4967
+ {
4968
+ path: props.path,
4969
+ query: props.query,
4970
+ dataset: response
4971
+ }
4972
+ ) })
4945
4973
  ] });
4946
4974
  };
4947
4975
  var DivContainer_default = DivContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260627092052",
3
+ "version": "0.8.1-dev.20260629084835",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",