analytica-frontend-lib 1.2.13 → 1.2.15

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.
@@ -768,7 +768,7 @@ var CheckboxGroup = ({
768
768
  }
769
769
  const selectedIdsArr = getSelectedIdsForFilters(filters);
770
770
  if (selectedIdsArr.some((arr) => arr.length === 0)) {
771
- return [{ itens: category?.itens || [] }];
771
+ return [{ itens: [] }];
772
772
  }
773
773
  const combinations = cartesian(selectedIdsArr);
774
774
  const groupedMap = {};
@@ -778,7 +778,7 @@ var CheckboxGroup = ({
778
778
  const groupedItems = Object.values(groupedMap).filter(
779
779
  (g) => g.itens.length
780
780
  );
781
- return groupedItems.length ? groupedItems : [{ itens: category?.itens || [] }];
781
+ return groupedItems.length ? groupedItems : [{ itens: [] }];
782
782
  };
783
783
  const formattedItemsMap = useMemo(() => {
784
784
  const formattedItemsMap2 = {};
@@ -1001,6 +1001,10 @@ var CheckboxGroup = ({
1001
1001
  if (hasOnlyOneItem) {
1002
1002
  return null;
1003
1003
  }
1004
+ const formattedItems = getFormattedItems(category.key);
1005
+ const hasNoItems = formattedItems.every(
1006
+ (group) => !group.itens || group.itens.length === 0
1007
+ );
1004
1008
  return /* @__PURE__ */ jsxs6("div", { children: [
1005
1009
  /* @__PURE__ */ jsx7(
1006
1010
  CardAccordation,
@@ -1012,7 +1016,7 @@ var CheckboxGroup = ({
1012
1016
  openAccordion === category.key && "bg-background-50 border-none"
1013
1017
  ),
1014
1018
  trigger: renderAccordionTrigger(category, isEnabled),
1015
- children: /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-3 pt-2", children: getFormattedItems(category.key).map(
1019
+ children: /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ jsx7("div", { className: "px-2 py-4", children: /* @__PURE__ */ jsx7(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
1016
1020
  (formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
1017
1021
  ) })
1018
1022
  }