analytica-frontend-lib 1.2.14 → 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.
package/dist/index.mjs CHANGED
@@ -1150,7 +1150,7 @@ var CheckboxGroup = ({
1150
1150
  }
1151
1151
  const selectedIdsArr = getSelectedIdsForFilters(filters);
1152
1152
  if (selectedIdsArr.some((arr) => arr.length === 0)) {
1153
- return [{ itens: category?.itens || [] }];
1153
+ return [{ itens: [] }];
1154
1154
  }
1155
1155
  const combinations = cartesian(selectedIdsArr);
1156
1156
  const groupedMap = {};
@@ -1160,7 +1160,7 @@ var CheckboxGroup = ({
1160
1160
  const groupedItems = Object.values(groupedMap).filter(
1161
1161
  (g) => g.itens.length
1162
1162
  );
1163
- return groupedItems.length ? groupedItems : [{ itens: category?.itens || [] }];
1163
+ return groupedItems.length ? groupedItems : [{ itens: [] }];
1164
1164
  };
1165
1165
  const formattedItemsMap = useMemo(() => {
1166
1166
  const formattedItemsMap2 = {};
@@ -1383,6 +1383,10 @@ var CheckboxGroup = ({
1383
1383
  if (hasOnlyOneItem) {
1384
1384
  return null;
1385
1385
  }
1386
+ const formattedItems = getFormattedItems(category.key);
1387
+ const hasNoItems = formattedItems.every(
1388
+ (group) => !group.itens || group.itens.length === 0
1389
+ );
1386
1390
  return /* @__PURE__ */ jsxs8("div", { children: [
1387
1391
  /* @__PURE__ */ jsx12(
1388
1392
  CardAccordation,
@@ -1394,7 +1398,7 @@ var CheckboxGroup = ({
1394
1398
  openAccordion === category.key && "bg-background-50 border-none"
1395
1399
  ),
1396
1400
  trigger: renderAccordionTrigger(category, isEnabled),
1397
- children: /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3 pt-2", children: getFormattedItems(category.key).map(
1401
+ children: /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ jsx12("div", { className: "px-2 py-4", children: /* @__PURE__ */ jsx12(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
1398
1402
  (formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
1399
1403
  ) })
1400
1404
  }