@proef/common-ui 2.3.0 → 2.5.0

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.
Files changed (35) hide show
  1. package/dist/esm/legacy/components/molecules/DataTable/DataTable.js +171 -91
  2. package/dist/esm/legacy/components/molecules/DataTable/DataTable.js.map +1 -1
  3. package/dist/esm/v1/capabilities/overlay/useFloatingPanel.js +5 -2
  4. package/dist/esm/v1/capabilities/overlay/useFloatingPanel.js.map +1 -1
  5. package/dist/esm/v1/components/data/Pagination/Pagination.js +30 -26
  6. package/dist/esm/v1/components/data/Pagination/Pagination.js.map +1 -1
  7. package/dist/esm/v1/components/forms/FormField/FormField.js +3 -2
  8. package/dist/esm/v1/components/forms/FormField/FormField.js.map +1 -1
  9. package/dist/esm/v1/components/layout/AppShell/AppShell.js +8 -3
  10. package/dist/esm/v1/components/layout/AppShell/AppShell.js.map +1 -1
  11. package/dist/esm/v1/components/layout/Page/Page.js +1 -1
  12. package/dist/esm/v1/components/layout/Page/Page.js.map +1 -1
  13. package/dist/esm/v1/components/layout/PageHeader/PageHeader.js +21 -18
  14. package/dist/esm/v1/components/layout/PageHeader/PageHeader.js.map +1 -1
  15. package/dist/esm/v1/components/lists/ListFinder/ListFinder.js +16 -16
  16. package/dist/esm/v1/components/lists/ListFinder/ListFinder.js.map +1 -1
  17. package/dist/esm/v1/components/overlays/Dialog/Dialog.js +2 -2
  18. package/dist/esm/v1/components/overlays/Dialog/Dialog.js.map +1 -1
  19. package/dist/esm/v1/primitives/buttons/SegmentedControl/SegmentedControl.js +3 -3
  20. package/dist/esm/v1/primitives/buttons/SegmentedControl/SegmentedControl.js.map +1 -1
  21. package/dist/esm/v1/primitives/display/Kpi/Kpi.js +6 -3
  22. package/dist/esm/v1/primitives/display/Kpi/Kpi.js.map +1 -1
  23. package/dist/esm/v1/primitives/forms/SelectInput/SelectInput.js +28 -8
  24. package/dist/esm/v1/primitives/forms/SelectInput/SelectInput.js.map +1 -1
  25. package/dist/esm/v1/primitives/lists/ListItem/ListItem.js +5 -5
  26. package/dist/esm/v1/primitives/lists/ListItem/ListItem.js.map +1 -1
  27. package/dist/esm/v1/primitives/navigation/Tabs/Tabs.js +97 -36
  28. package/dist/esm/v1/primitives/navigation/Tabs/Tabs.js.map +1 -1
  29. package/dist/style.components.css +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/style.layered.css +1 -1
  32. package/dist/types/legacy/components/molecules/DataTable/DataTable.d.ts +9 -1
  33. package/dist/types/v1/primitives/forms/SelectInput/SelectInput.d.ts +12 -0
  34. package/dist/types/v1/primitives/lists/ListItem/ListItem.d.ts +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useMemo, useRef, useLayoutEffect, Fragment } from "react";
3
3
  import { FilterChips } from "../../../../v1/primitives/display/FilterChips/FilterChips.js";
4
4
  import { Pagination } from "../../../../v1/components/data/Pagination/Pagination.js";
@@ -48,6 +48,20 @@ const Layers = ({ size = 11, className }) => /* @__PURE__ */ jsxs("svg", { xmlns
48
48
  ] });
49
49
  const Caret = ({ size = 11, className }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className, children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" }) });
50
50
  const Spinner = ({ size = 16, className }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: `animate-spin ${className ?? ""}`, "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
51
+ const MOBILE_QUERY = "(max-width: 639px)";
52
+ function useEcraEstreito() {
53
+ const ler = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(MOBILE_QUERY).matches;
54
+ const [estreito, setEstreito] = useState(ler);
55
+ useEffect(() => {
56
+ if (typeof window.matchMedia !== "function") return;
57
+ const mq = window.matchMedia(MOBILE_QUERY);
58
+ const mudar = () => setEstreito(mq.matches);
59
+ mudar();
60
+ mq.addEventListener?.("change", mudar);
61
+ return () => mq.removeEventListener?.("change", mudar);
62
+ }, []);
63
+ return estreito;
64
+ }
51
65
  const EMPTY = "—";
52
66
  const MAX_OPCOES_FILTRO = 50;
53
67
  const DEFAULT_STICKY_WIDTH = 160;
@@ -225,9 +239,11 @@ function DataTable({
225
239
  onGroupByChange,
226
240
  onSortChange,
227
241
  onColumnFiltersChange,
228
- scrollAffordance = false
242
+ scrollAffordance = false,
243
+ mobileCards = true
229
244
  }) {
230
245
  const L = { ...DEFAULT_LABELS, ...labels };
246
+ const estreito = useEcraEstreito();
231
247
  const [larguras, setLarguras] = useState(() => {
232
248
  if (!storageKey) return {};
233
249
  try {
@@ -1131,10 +1147,71 @@ function DataTable({
1131
1147
  !recolhido && (no.filhos.length > 0 ? renderGrupos(no.filhos, nivel + 1) : no.items.map((row) => renderLinha(row, indicePorLinha.get(row) ?? 0)))
1132
1148
  ] }, no.path);
1133
1149
  });
1150
+ const renderCartoes = () => {
1151
+ const vazio = /* @__PURE__ */ jsx("span", { className: "text-slate-400", children: EMPTY });
1152
+ const conteudo = (row, c) => c.render ? c.render(row) : rawValue(row, c) ?? vazio;
1153
+ const [principal, ...resto] = columns;
1154
+ const campos = resto.filter((c) => c.label);
1155
+ const semValor = (row, c) => {
1156
+ if (!c.value && !(c.key in row)) return false;
1157
+ const v = rawValue(row, c);
1158
+ return v === null || v === "";
1159
+ };
1160
+ const acoes = resto.filter((c) => !c.label);
1161
+ const aviso = (texto) => /* @__PURE__ */ jsx("div", { className: "py-12 text-center text-sm text-slate-400", children: texto });
1162
+ return /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900 text-[13px] dark:text-slate-200", children: isLoading || aEsperarDataset ? aviso(
1163
+ /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center gap-2", children: [
1164
+ /* @__PURE__ */ jsx(Spinner, { size: 16, className: "text-proef-blue dark:text-proef-turquoise" }),
1165
+ L.loading
1166
+ ] })
1167
+ ) : sorted.length === 0 ? aviso(
1168
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1169
+ emptyIcon && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-2", children: emptyIcon }),
1170
+ /* @__PURE__ */ jsx("p", { className: "m-0", children: L.empty }),
1171
+ emptySubLabel && /* @__PURE__ */ jsx("p", { className: "m-0 text-xs mt-1", children: emptySubLabel })
1172
+ ] })
1173
+ ) : /* @__PURE__ */ jsx("ul", { className: "m-0 list-none p-0 divide-y divide-slate-100 dark:divide-slate-800", children: pageData.map((row, i) => {
1174
+ const k = chaveDe(row, i);
1175
+ const marcada = selectable && selectedKeys.has(k);
1176
+ const selecionavel = !!selectable && podeSelecionar(row);
1177
+ return /* @__PURE__ */ jsxs(
1178
+ "li",
1179
+ {
1180
+ onClick: () => onRowClick?.(row),
1181
+ className: `px-3 py-3 space-y-1.5 ${onRowClick ? "cursor-pointer active:bg-slate-100 dark:active:bg-slate-800" : ""} ${marcada ? "bg-proef-turquoise/5" : ""} ${rowClassName?.(row) ?? ""}`,
1182
+ children: [
1183
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
1184
+ selectable && /* @__PURE__ */ jsx(
1185
+ "span",
1186
+ {
1187
+ role: "checkbox",
1188
+ "aria-checked": !!marcada,
1189
+ "aria-disabled": !selecionavel || void 0,
1190
+ onClick: (e) => {
1191
+ e.stopPropagation();
1192
+ if (selecionavel) alternarLinha(k);
1193
+ },
1194
+ className: `mt-0.5 w-4 h-4 shrink-0 flex items-center justify-center border rounded ${marcada ? "bg-proef-navy dark:bg-proef-turquoise border-proef-navy dark:border-proef-turquoise text-white dark:text-proef-navy" : "border-slate-300 dark:border-slate-600"} ${selecionavel ? "" : "opacity-40"}`,
1195
+ children: marcada && /* @__PURE__ */ jsx("span", { className: "text-[9px] leading-none", children: "✓" })
1196
+ }
1197
+ ),
1198
+ principal && /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 font-semibold break-words", children: conteudo(row, principal) }),
1199
+ acoes.length > 0 && /* @__PURE__ */ jsx("div", { className: "-my-1 flex shrink-0 items-center gap-1", onClick: (e) => e.stopPropagation(), children: acoes.map((c) => /* @__PURE__ */ jsx(Fragment, { children: conteudo(row, c) }, c.key)) })
1200
+ ] }),
1201
+ campos.filter((c) => !semValor(row, c)).map((c) => /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
1202
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] uppercase tracking-wide text-slate-500 dark:text-slate-400 pt-px", children: c.label }),
1203
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 text-right break-words", children: conteudo(row, c) })
1204
+ ] }, c.key))
1205
+ ]
1206
+ },
1207
+ k
1208
+ );
1209
+ }) }) });
1210
+ };
1134
1211
  return /* @__PURE__ */ jsxs("div", { children: [
1135
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 mb-2.5", children: [
1136
- /* @__PURE__ */ jsx("span", { className: "text-xs text-slate-500 dark:text-slate-400", children: isLoading ? "" : L.results.replace("{count}", String(totalResultados)) }),
1137
- /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: [
1212
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 mb-2.5 max-sm:[&>div>:has(input[type=search])]:order-first max-sm:[&>div>:has(input[type=search])]:w-full", children: [
1213
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-slate-500 dark:text-slate-400 max-sm:mr-auto", children: isLoading ? "" : L.results.replace("{count}", String(totalResultados)) }),
1214
+ /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2 max-sm:contents", children: [
1138
1215
  extraToolbar,
1139
1216
  exportFileName && sorted.length > 0 && // Mesmo aspeto do botão Colunas ao lado (o navy cheio competia com as ações da página).
1140
1217
  /* @__PURE__ */ jsxs(
@@ -1149,7 +1226,7 @@ function DataTable({
1149
1226
  /* @__PURE__ */ jsx("polyline", { points: "7 10 12 15 17 10" }),
1150
1227
  /* @__PURE__ */ jsx("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
1151
1228
  ] }),
1152
- L.export
1229
+ /* @__PURE__ */ jsx("span", { className: "max-sm:sr-only", children: L.export })
1153
1230
  ]
1154
1231
  }
1155
1232
  )
@@ -1203,95 +1280,98 @@ function DataTable({
1203
1280
  clearAllLabel: L.clearAll
1204
1281
  }
1205
1282
  ),
1206
- /* @__PURE__ */ jsx(
1207
- "div",
1208
- {
1209
- className: `overflow-auto rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900 ${scrollAffordance ? "outline-none focus-visible:ring-2 focus-visible:ring-proef-blue dark:focus-visible:ring-proef-turquoise" : ""}`,
1210
- style: { maxHeight },
1211
- ...scrollAffordance ? { tabIndex: 0, role: "region", "aria-label": L.scrollRegion ?? DEFAULT_LABELS.scrollRegion, onKeyDown: rolarComTeclado } : {},
1212
- children: /* @__PURE__ */ jsxs("table", { className: "w-full text-[13px] border-collapse dark:text-slate-200", children: [
1213
- /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-[2]", children: /* @__PURE__ */ jsxs("tr", { children: [
1214
- selectable && /* @__PURE__ */ jsx("th", { className: "bg-slate-50 dark:bg-slate-800 px-3 py-2.5 border-b border-slate-200 dark:border-slate-700 w-10 sticky left-0 z-[3]", children: /* @__PURE__ */ jsx(
1215
- "button",
1216
- {
1217
- onClick: alternarTodas,
1218
- className: `appearance-none cursor-pointer w-4 h-4 flex items-center justify-center border transition-colors rounded ${todasVisiveisMarcadas ? "bg-proef-navy dark:bg-proef-turquoise border-proef-navy dark:border-proef-turquoise text-white dark:text-proef-navy" : algumaVisivelMarcada ? "bg-slate-300 dark:bg-slate-600 border-slate-300 dark:border-slate-600 text-white" : "bg-white dark:bg-slate-900 border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500"}`,
1219
- children: (todasVisiveisMarcadas || algumaVisivelMarcada) && /* @__PURE__ */ jsx("span", { className: "text-[9px] leading-none", children: "✓" })
1220
- }
1221
- ) }),
1222
- columns.map((c) => {
1223
- const podeOrdenar = c.sortable !== false;
1224
- const podeAgrupar = agrupavel(c);
1225
- const agrupada = groupByKeys.includes(c.key);
1226
- return /* @__PURE__ */ jsxs(
1227
- "th",
1283
+ mobileCards && estreito && !isGrouped ? renderCartoes() : (
1284
+ /* rounded-xl: os mesmos cantos dos cartões da biblioteca (Ui.tsx) e das tabelas dos portais. */
1285
+ /* @__PURE__ */ jsx(
1286
+ "div",
1287
+ {
1288
+ className: `overflow-auto rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900 ${scrollAffordance ? "outline-none focus-visible:ring-2 focus-visible:ring-proef-blue dark:focus-visible:ring-proef-turquoise" : ""}`,
1289
+ style: { maxHeight },
1290
+ ...scrollAffordance ? { tabIndex: 0, role: "region", "aria-label": L.scrollRegion ?? DEFAULT_LABELS.scrollRegion, onKeyDown: rolarComTeclado } : {},
1291
+ children: /* @__PURE__ */ jsxs("table", { className: "w-full text-[13px] border-collapse dark:text-slate-200", children: [
1292
+ /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-[2]", children: /* @__PURE__ */ jsxs("tr", { children: [
1293
+ selectable && /* @__PURE__ */ jsx("th", { className: "bg-slate-50 dark:bg-slate-800 px-3 py-2.5 border-b border-slate-200 dark:border-slate-700 w-10 sticky left-0 z-[3]", children: /* @__PURE__ */ jsx(
1294
+ "button",
1228
1295
  {
1229
- style: {
1230
- ...c.width ? { minWidth: c.width } : {},
1231
- ...larguras[c.key] ? { width: larguras[c.key], minWidth: larguras[c.key], maxWidth: larguras[c.key] } : {},
1232
- ...estiloPreso(c) ?? {}
1233
- },
1234
- className: `group/th relative bg-slate-50 dark:bg-slate-800 text-[11.5px] uppercase tracking-wide text-slate-500 dark:text-slate-400 font-semibold px-3 py-2.5 border-b border-slate-200 dark:border-slate-700 whitespace-nowrap select-none ${alignClass(
1235
- c.align
1236
- )} ${c.sticky ? `sticky z-[3] bg-slate-50 dark:bg-slate-800 ${c.sticky === "right" ? "border-l border-slate-200 dark:border-slate-700" : ""}` : ""} ${c.headerClassName ?? ""}`,
1237
- children: [
1238
- resizableColumns && // Pega no limite direito: arrastar redimensiona; duplo clique repõe a largura automática
1239
- /* @__PURE__ */ jsx(
1240
- "span",
1241
- {
1242
- role: "separator",
1243
- "aria-orientation": "vertical",
1244
- title: L.resizeColumn,
1245
- onMouseDown: (e) => iniciarResize(e, c.key),
1246
- onDoubleClick: () => reporLargura(c.key),
1247
- onClick: (e) => e.stopPropagation(),
1248
- className: "absolute right-0 top-0 z-[4] h-full w-1.5 cursor-col-resize bg-transparent hover:bg-proef-blue/40 group-hover/th:bg-slate-300/60 dark:group-hover/th:bg-slate-600/60"
1249
- }
1250
- ),
1251
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1252
- podeOrdenar ? /* @__PURE__ */ jsxs(
1253
- "button",
1254
- {
1255
- onClick: () => toggleSort(c.key),
1256
- className: "appearance-none bg-transparent border-0 cursor-pointer p-0 uppercase tracking-wide text-slate-500 dark:text-slate-400 hover:text-proef-blue dark:hover:text-proef-turquoise font-semibold",
1257
- children: [
1258
- c.label,
1259
- sort?.key === c.key && /* @__PURE__ */ jsx("span", { className: "ml-1", children: sort.dir === 1 ? "▲" : "▼" })
1260
- ]
1261
- }
1262
- ) : /* @__PURE__ */ jsx("span", { children: c.label }),
1263
- podeAgrupar && /* @__PURE__ */ jsx(
1264
- "button",
1296
+ onClick: alternarTodas,
1297
+ className: `appearance-none cursor-pointer w-4 h-4 flex items-center justify-center border transition-colors rounded ${todasVisiveisMarcadas ? "bg-proef-navy dark:bg-proef-turquoise border-proef-navy dark:border-proef-turquoise text-white dark:text-proef-navy" : algumaVisivelMarcada ? "bg-slate-300 dark:bg-slate-600 border-slate-300 dark:border-slate-600 text-white" : "bg-white dark:bg-slate-900 border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500"}`,
1298
+ children: (todasVisiveisMarcadas || algumaVisivelMarcada) && /* @__PURE__ */ jsx("span", { className: "text-[9px] leading-none", children: "✓" })
1299
+ }
1300
+ ) }),
1301
+ columns.map((c) => {
1302
+ const podeOrdenar = c.sortable !== false;
1303
+ const podeAgrupar = agrupavel(c);
1304
+ const agrupada = groupByKeys.includes(c.key);
1305
+ return /* @__PURE__ */ jsxs(
1306
+ "th",
1307
+ {
1308
+ style: {
1309
+ ...c.width ? { minWidth: c.width } : {},
1310
+ ...larguras[c.key] ? { width: larguras[c.key], minWidth: larguras[c.key], maxWidth: larguras[c.key] } : {},
1311
+ ...estiloPreso(c) ?? {}
1312
+ },
1313
+ className: `group/th relative bg-slate-50 dark:bg-slate-800 text-[11.5px] uppercase tracking-wide text-slate-500 dark:text-slate-400 font-semibold px-3 py-2.5 border-b border-slate-200 dark:border-slate-700 whitespace-nowrap select-none ${alignClass(
1314
+ c.align
1315
+ )} ${c.sticky ? `sticky z-[3] bg-slate-50 dark:bg-slate-800 ${c.sticky === "right" ? "border-l border-slate-200 dark:border-slate-700" : ""}` : ""} ${c.headerClassName ?? ""}`,
1316
+ children: [
1317
+ resizableColumns && // Pega no limite direito: arrastar redimensiona; duplo clique repõe a largura automática
1318
+ /* @__PURE__ */ jsx(
1319
+ "span",
1265
1320
  {
1266
- onClick: () => alternarGrupo(c.key),
1267
- title: (agrupada ? L.ungroup : L.groupBy).replace("{label}", c.label),
1268
- className: `appearance-none bg-transparent border-0 cursor-pointer p-0.5 transition-colors ${agrupada ? "text-violet-600 dark:text-violet-300" : "text-slate-300 dark:text-slate-600 hover:text-slate-500 dark:hover:text-slate-300"}`,
1269
- children: /* @__PURE__ */ jsx(Layers, { size: 10 })
1321
+ role: "separator",
1322
+ "aria-orientation": "vertical",
1323
+ title: L.resizeColumn,
1324
+ onMouseDown: (e) => iniciarResize(e, c.key),
1325
+ onDoubleClick: () => reporLargura(c.key),
1326
+ onClick: (e) => e.stopPropagation(),
1327
+ className: "absolute right-0 top-0 z-[4] h-full w-1.5 cursor-col-resize bg-transparent hover:bg-proef-blue/40 group-hover/th:bg-slate-300/60 dark:group-hover/th:bg-slate-600/60"
1270
1328
  }
1271
1329
  ),
1272
- botaoFunil(c)
1273
- ] }),
1274
- c.headerExtra && /* @__PURE__ */ jsx("div", { className: "mt-0.5 normal-case font-normal tracking-normal", children: c.headerExtra(filtered) })
1275
- ]
1276
- },
1277
- c.key
1278
- );
1279
- })
1280
- ] }) }),
1281
- /* @__PURE__ */ jsx("tbody", { children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm font-bold uppercase tracking-widest text-slate-400", children: /* @__PURE__ */ jsxs("div", { role: "status", "aria-live": "polite", className: "inline-flex items-center gap-2", children: [
1282
- /* @__PURE__ */ jsx(Spinner, { size: 16, className: "text-proef-blue dark:text-proef-turquoise" }),
1283
- /* @__PURE__ */ jsx("span", { children: L.loading })
1284
- ] }) }) }) : aEsperarDataset ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm font-bold uppercase tracking-widest text-slate-400", children: L.loading }) }) : isGrouped ? grupos.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm text-slate-400", children: L.empty }) }) : renderGrupos(grupos, 0) : sorted.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { colSpan: nColunas, className: "py-16 text-center", children: [
1285
- emptyIcon && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-2", children: emptyIcon }),
1286
- /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-400", children: L.empty }),
1287
- emptySubLabel && /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-400 mt-1", children: emptySubLabel })
1288
- ] }) }) : pageData.map((row, i) => renderLinha(row, i)) }),
1289
- totalRow && !isLoading && !aEsperarDataset && sorted.length > 0 && /* @__PURE__ */ jsx("tfoot", { className: "sticky bottom-0 z-[2]", children: /* @__PURE__ */ jsxs("tr", { className: "bg-slate-100 dark:bg-slate-800 font-black text-slate-800 dark:text-slate-100", children: [
1290
- /* @__PURE__ */ jsx("td", { colSpan: colunasRotuloGrupo, className: "px-3 py-2 border-t-2 border-slate-200 dark:border-slate-700 text-[10px] uppercase tracking-widest", children: L.total }),
1291
- colunasComValor.map((c) => /* @__PURE__ */ jsx("td", { className: `px-3 py-2 border-t-2 border-slate-200 dark:border-slate-700 whitespace-nowrap text-xs ${alignClass(c.align)}`, children: c.groupAggregate?.(sorted) }, c.key))
1292
- ] }) })
1293
- ] })
1294
- }
1330
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1331
+ podeOrdenar ? /* @__PURE__ */ jsxs(
1332
+ "button",
1333
+ {
1334
+ onClick: () => toggleSort(c.key),
1335
+ className: "appearance-none bg-transparent border-0 cursor-pointer p-0 uppercase tracking-wide text-slate-500 dark:text-slate-400 hover:text-proef-blue dark:hover:text-proef-turquoise font-semibold",
1336
+ children: [
1337
+ c.label,
1338
+ sort?.key === c.key && /* @__PURE__ */ jsx("span", { className: "ml-1", children: sort.dir === 1 ? "▲" : "▼" })
1339
+ ]
1340
+ }
1341
+ ) : /* @__PURE__ */ jsx("span", { children: c.label }),
1342
+ podeAgrupar && /* @__PURE__ */ jsx(
1343
+ "button",
1344
+ {
1345
+ onClick: () => alternarGrupo(c.key),
1346
+ title: (agrupada ? L.ungroup : L.groupBy).replace("{label}", c.label),
1347
+ className: `appearance-none bg-transparent border-0 cursor-pointer p-0.5 transition-colors ${agrupada ? "text-violet-600 dark:text-violet-300" : "text-slate-300 dark:text-slate-600 hover:text-slate-500 dark:hover:text-slate-300"}`,
1348
+ children: /* @__PURE__ */ jsx(Layers, { size: 10 })
1349
+ }
1350
+ ),
1351
+ botaoFunil(c)
1352
+ ] }),
1353
+ c.headerExtra && /* @__PURE__ */ jsx("div", { className: "mt-0.5 normal-case font-normal tracking-normal", children: c.headerExtra(filtered) })
1354
+ ]
1355
+ },
1356
+ c.key
1357
+ );
1358
+ })
1359
+ ] }) }),
1360
+ /* @__PURE__ */ jsx("tbody", { children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm font-bold uppercase tracking-widest text-slate-400", children: /* @__PURE__ */ jsxs("div", { role: "status", "aria-live": "polite", className: "inline-flex items-center gap-2", children: [
1361
+ /* @__PURE__ */ jsx(Spinner, { size: 16, className: "text-proef-blue dark:text-proef-turquoise" }),
1362
+ /* @__PURE__ */ jsx("span", { children: L.loading })
1363
+ ] }) }) }) : aEsperarDataset ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm font-bold uppercase tracking-widest text-slate-400", children: L.loading }) }) : isGrouped ? grupos.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: nColunas, className: "py-16 text-center text-sm text-slate-400", children: L.empty }) }) : renderGrupos(grupos, 0) : sorted.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { colSpan: nColunas, className: "py-16 text-center", children: [
1364
+ emptyIcon && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-2", children: emptyIcon }),
1365
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-400", children: L.empty }),
1366
+ emptySubLabel && /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-400 mt-1", children: emptySubLabel })
1367
+ ] }) }) : pageData.map((row, i) => renderLinha(row, i)) }),
1368
+ totalRow && !isLoading && !aEsperarDataset && sorted.length > 0 && /* @__PURE__ */ jsx("tfoot", { className: "sticky bottom-0 z-[2]", children: /* @__PURE__ */ jsxs("tr", { className: "bg-slate-100 dark:bg-slate-800 font-black text-slate-800 dark:text-slate-100", children: [
1369
+ /* @__PURE__ */ jsx("td", { colSpan: colunasRotuloGrupo, className: "px-3 py-2 border-t-2 border-slate-200 dark:border-slate-700 text-[10px] uppercase tracking-widest", children: L.total }),
1370
+ colunasComValor.map((c) => /* @__PURE__ */ jsx("td", { className: `px-3 py-2 border-t-2 border-slate-200 dark:border-slate-700 whitespace-nowrap text-xs ${alignClass(c.align)}`, children: c.groupAggregate?.(sorted) }, c.key))
1371
+ ] }) })
1372
+ ] })
1373
+ }
1374
+ )
1295
1375
  ),
1296
1376
  !isLoading && paginando && (totalPages > 1 || (pageSizeOptions?.length ?? 0) > 0) && /* @__PURE__ */ jsx(
1297
1377
  Pagination,