@proef/common-ui 2.6.49 → 2.6.51
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/esm/index.js +190 -147
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/legacy/components/molecules/DataTable/DataTable.js +7 -1
- package/dist/esm/legacy/components/molecules/DataTable/DataTable.js.map +1 -1
- package/dist/esm/legacy/components/molecules/PhotoAvatar/identidade.js.map +1 -1
- package/dist/esm/legacy/components/molecules/PhotoAvatar/pessoas.js.map +1 -1
- package/dist/esm/v1/components/data/MarkerMap/MarkerMap.js +256 -0
- package/dist/esm/v1/components/data/MarkerMap/MarkerMap.js.map +1 -0
- package/dist/esm/v1/components/data/ResourceGantt/ResourceGantt.js +290 -0
- package/dist/esm/v1/components/data/ResourceGantt/ResourceGantt.js.map +1 -0
- package/dist/esm/v1/components/data/StackedBarChart/StackedBarChart.js +87 -0
- package/dist/esm/v1/components/data/StackedBarChart/StackedBarChart.js.map +1 -0
- package/dist/esm/v1/components/data/StackedBarList/StackedBarList.js +48 -0
- package/dist/esm/v1/components/data/StackedBarList/StackedBarList.js.map +1 -0
- package/dist/esm/v1/components/forms/LabeledField/LabeledField.js +22 -0
- package/dist/esm/v1/components/forms/LabeledField/LabeledField.js.map +1 -0
- package/dist/esm/v1/components/tables/PlainTable/PlainTable.js +36 -0
- package/dist/esm/v1/components/tables/PlainTable/PlainTable.js.map +1 -0
- package/dist/esm/v1/components/tables/Table/ColumnFilter.js +25 -34
- package/dist/esm/v1/components/tables/Table/ColumnFilter.js.map +1 -1
- package/dist/esm/v1/components/tables/Table/Table.js +42 -24
- package/dist/esm/v1/components/tables/Table/Table.js.map +1 -1
- package/dist/esm/v1/foundations/icons/icons.js +43 -0
- package/dist/esm/v1/foundations/icons/icons.js.map +1 -1
- package/dist/esm/v1/primitives/buttons/Button/Button.js +4 -3
- package/dist/esm/v1/primitives/buttons/Button/Button.js.map +1 -1
- package/dist/esm/v1/primitives/buttons/LinkButton/LinkButton.js +21 -0
- package/dist/esm/v1/primitives/buttons/LinkButton/LinkButton.js.map +1 -0
- package/dist/esm/v1/primitives/display/ColoredValue/ColoredValue.js +11 -0
- package/dist/esm/v1/primitives/display/ColoredValue/ColoredValue.js.map +1 -0
- package/dist/esm/v1/primitives/display/PriorityIcon/PriorityIcon.js +14 -0
- package/dist/esm/v1/primitives/display/PriorityIcon/PriorityIcon.js.map +1 -0
- package/dist/esm/v1/primitives/display/SectionTitle/SectionTitle.js +13 -0
- package/dist/esm/v1/primitives/display/SectionTitle/SectionTitle.js.map +1 -0
- package/dist/esm/v1/primitives/forms/CheckboxField/CheckboxField.js +13 -0
- package/dist/esm/v1/primitives/forms/CheckboxField/CheckboxField.js.map +1 -0
- package/dist/esm/v1/primitives/forms/RangeCalendar/RangeCalendar.js +88 -0
- package/dist/esm/v1/primitives/forms/RangeCalendar/RangeCalendar.js.map +1 -0
- package/dist/esm/v1/primitives/forms/SearchInput/SearchInput.js +4 -2
- package/dist/esm/v1/primitives/forms/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/v1/primitives/navigation/Tabs/Tabs.js +14 -7
- package/dist/esm/v1/primitives/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/style.components.css +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/types/legacy/components/molecules/DataTable/DataTable.d.ts +22 -3
- package/dist/types/legacy/exports/molecules.d.ts +1 -1
- package/dist/types/v1/components/data/MarkerMap/MarkerMap.d.ts +94 -0
- package/dist/types/v1/components/data/ResourceGantt/ResourceGantt.d.ts +193 -0
- package/dist/types/v1/components/data/StackedBarChart/StackedBarChart.d.ts +33 -0
- package/dist/types/v1/components/data/StackedBarList/StackedBarList.d.ts +66 -0
- package/dist/types/v1/components/forms/LabeledField/LabeledField.d.ts +24 -0
- package/dist/types/v1/components/tables/PlainTable/PlainTable.d.ts +28 -0
- package/dist/types/v1/components/tables/Table/ColumnFilter.d.ts +2 -2
- package/dist/types/v1/components/tables/Table/Table.d.ts +35 -3
- package/dist/types/v1/foundations/icons/icons.d.ts +14 -0
- package/dist/types/v1/index.d.ts +25 -1
- package/dist/types/v1/primitives/buttons/Button/Button.d.ts +5 -2
- package/dist/types/v1/primitives/buttons/LinkButton/LinkButton.d.ts +13 -0
- package/dist/types/v1/primitives/display/ColoredValue/ColoredValue.d.ts +15 -0
- package/dist/types/v1/primitives/display/PriorityIcon/PriorityIcon.d.ts +15 -0
- package/dist/types/v1/primitives/display/SectionTitle/SectionTitle.d.ts +19 -0
- package/dist/types/v1/primitives/forms/CheckboxField/CheckboxField.d.ts +17 -0
- package/dist/types/v1/primitives/forms/RangeCalendar/RangeCalendar.d.ts +25 -0
- package/dist/types/v1/primitives/navigation/Tabs/Tabs.d.ts +16 -0
- package/package.json +1 -1
|
@@ -73,6 +73,10 @@ function TableBase({
|
|
|
73
73
|
filterableColumns: colunasFiltraveis,
|
|
74
74
|
onFiltersChange: onFiltros,
|
|
75
75
|
hideFilterChips: semFaixaFiltros = false,
|
|
76
|
+
wrapHeaders: titulosPartem = false,
|
|
77
|
+
hideGroupChips: semChipsGrupo = false,
|
|
78
|
+
hideRowCount: semContagem = false,
|
|
79
|
+
normalCaseHeaders: titulosNormais = false,
|
|
76
80
|
clientPage: paginaCliente,
|
|
77
81
|
onVisibleChange: onVista,
|
|
78
82
|
frozenColumns: colunasFixas = 0,
|
|
@@ -87,6 +91,7 @@ function TableBase({
|
|
|
87
91
|
skeleton: esqueletoAoCarregar = false,
|
|
88
92
|
fadeRight: esbaterDireita = false,
|
|
89
93
|
rowClassName,
|
|
94
|
+
rowBackground,
|
|
90
95
|
maxHeight,
|
|
91
96
|
labels
|
|
92
97
|
}) {
|
|
@@ -169,9 +174,14 @@ function TableBase({
|
|
|
169
174
|
}
|
|
170
175
|
return void 0;
|
|
171
176
|
};
|
|
177
|
+
const chavesBusca = /* @__PURE__ */ new Set([
|
|
178
|
+
...colunasBase.filter((c) => c.filterType === "search").map((c) => c.key),
|
|
179
|
+
...colunasBase.flatMap((c) => c.extraFilters ?? []).filter((e) => e.filterType === "search").map((e) => e.key)
|
|
180
|
+
]);
|
|
181
|
+
const contem = (v, q) => String(v ?? "").toLowerCase().includes(q.toLowerCase());
|
|
172
182
|
const getUniqueValues = (colKey) => {
|
|
173
183
|
if (noServidor) {
|
|
174
|
-
return colunasBase.find((c) => c.key === colKey)?.filterOptions ?? [];
|
|
184
|
+
return colunasBase.find((c) => c.key === colKey)?.filterOptions ?? colunasBase.flatMap((c) => c.extraFilters ?? []).find((e) => e.key === colKey)?.filterOptions ?? [];
|
|
175
185
|
}
|
|
176
186
|
const valueFn = resolveValueFn(colKey);
|
|
177
187
|
if (!valueFn) return [];
|
|
@@ -180,7 +190,7 @@ function TableBase({
|
|
|
180
190
|
if (otherKey === colKey || !selectedVals || selectedVals.size === 0) continue;
|
|
181
191
|
const otherFn = resolveValueFn(otherKey);
|
|
182
192
|
if (!otherFn) continue;
|
|
183
|
-
source = source.filter((row) => {
|
|
193
|
+
source = chavesBusca.has(otherKey) ? source.filter((row) => contem(otherFn(row), [...selectedVals][0])) : source.filter((row) => {
|
|
184
194
|
const v = otherFn(row);
|
|
185
195
|
return selectedVals.has(v == null || v === "" ? "—" : String(v));
|
|
186
196
|
});
|
|
@@ -258,6 +268,10 @@ function TableBase({
|
|
|
258
268
|
if (!selectedVals || selectedVals.size === 0) continue;
|
|
259
269
|
const valueFn = resolveValueFn(colKey);
|
|
260
270
|
if (!valueFn) continue;
|
|
271
|
+
if (chavesBusca.has(colKey)) {
|
|
272
|
+
result = result.filter((row) => contem(valueFn(row), [...selectedVals][0]));
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
261
275
|
result = result.filter((row) => {
|
|
262
276
|
const v = valueFn(row);
|
|
263
277
|
return selectedVals.has(v == null || v === "" ? "—" : String(v));
|
|
@@ -672,7 +686,10 @@ function TableBase({
|
|
|
672
686
|
for (const th of Array.from(cabecalhoRef.current?.children ?? [])) ro.observe(th);
|
|
673
687
|
return () => ro.disconnect();
|
|
674
688
|
}, [nFixas, columns, data, esquerdas]);
|
|
675
|
-
const fundoLinha = (k) =>
|
|
689
|
+
const fundoLinha = (k, row) => {
|
|
690
|
+
const destaque = row !== void 0 ? rowBackground?.(row) : void 0;
|
|
691
|
+
return `${selectable && selectedKeys.has(k) ? "bg-[#f2fdf9] dark:bg-[#062a20]" : destaque ?? "bg-white dark:bg-slate-950"} ${destaque ? "" : "group-hover/linha:bg-slate-50 dark:group-hover/linha:bg-slate-900"}`;
|
|
692
|
+
};
|
|
676
693
|
const cabecaFixa = (i) => {
|
|
677
694
|
const realcadaAqui = realcada !== null && realcada === chaveDoIndice(i);
|
|
678
695
|
const linhaDeBaixo = bordasSeparadas && !fundoNosTitulos;
|
|
@@ -731,14 +748,14 @@ function TableBase({
|
|
|
731
748
|
{
|
|
732
749
|
onClick: () => onRowClick?.(row),
|
|
733
750
|
onDoubleClick: () => onRowDoubleClick?.(row),
|
|
734
|
-
className: `group/linha hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors ${onRowClick || onRowDoubleClick ? "cursor-pointer" : ""} ${selectable && selectedKeys.has(rowKey(row)) ? "bg-proef-turquoise/5" : ""} ${rowClassName?.(row) ?? ""}`,
|
|
751
|
+
className: `group/linha hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors ${onRowClick || onRowDoubleClick ? "cursor-pointer" : ""} ${selectable && selectedKeys.has(rowKey(row)) ? "bg-proef-turquoise/5" : ""} ${rowBackground?.(row) ?? ""} ${rowClassName?.(row) ?? ""}`,
|
|
735
752
|
children: [
|
|
736
|
-
selectable && /* @__PURE__ */ jsx("td", { style: fixa(0, fundoLinha(rowKey(row))).style, className: `px-4 py-3 ${fixa(0, fundoLinha(rowKey(row))).className}`, onClick: (e) => {
|
|
753
|
+
selectable && /* @__PURE__ */ jsx("td", { style: fixa(0, fundoLinha(rowKey(row), row)).style, className: `px-4 py-3 ${fixa(0, fundoLinha(rowKey(row), row)).className}`, onClick: (e) => {
|
|
737
754
|
e.stopPropagation();
|
|
738
755
|
toggleRow(rowKey(row));
|
|
739
756
|
}, children: /* @__PURE__ */ jsx("div", { className: `w-4 h-4 flex items-center justify-center rounded-sm border transition-colors ${selectedKeys.has(rowKey(row)) ? "bg-primary border-primary" : "border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500"}`, children: selectedKeys.has(rowKey(row)) && /* @__PURE__ */ jsx(CheckIcon, { size: 9, strokeWidth: 3, className: "text-white" }) }) }),
|
|
740
757
|
columns.map((col, i) => {
|
|
741
|
-
const f = fixa(i + (selectable ? 1 : 0), fundoLinha(rowKey(row)));
|
|
758
|
+
const f = fixa(i + (selectable ? 1 : 0), fundoLinha(rowKey(row), row));
|
|
742
759
|
return /* @__PURE__ */ jsx("td", { style: f.style, className: `px-3 py-1.5 ${col.cellClassName ?? ""} ${f.className} ${recuoFim(i)} ${realce(col.key)} ${transicaoRealce}`, "data-col": col.key, children: col.render(row) }, col.key);
|
|
743
760
|
})
|
|
744
761
|
]
|
|
@@ -980,7 +997,7 @@ function TableBase({
|
|
|
980
997
|
});
|
|
981
998
|
const ecraEstreito = useEcraEstreito();
|
|
982
999
|
const janelaAtiva = preencheAltura && ecraEstreito && !isGrouped && !aCarregar && paginatedData.length > JANELA_MINIMO_LINHAS;
|
|
983
|
-
const fundoPorPintar = janelaAtiva && !rowClassName;
|
|
1000
|
+
const fundoPorPintar = janelaAtiva && !rowClassName && !rowBackground;
|
|
984
1001
|
const versaoLinhas = `${realcada ?? ""}|${esquerdas.join(",")}|${nFixas}|${selectable ? 1 : 0}|${barraSobreposta ? 1 : 0}|${transicaoRealce}|${onRowClick || onRowDoubleClick ? 1 : 0}|${fundoPorPintar ? 1 : 0}`;
|
|
985
1002
|
const [janela, setJanela] = useState({ inicio: 0, fim: JANELA_MINIMO_LINHAS });
|
|
986
1003
|
const [dadosDaJanela, setDadosDaJanela] = useState(paginatedData);
|
|
@@ -1122,7 +1139,7 @@ function TableBase({
|
|
|
1122
1139
|
) : null;
|
|
1123
1140
|
const grupoColunas = largurasVista ? /* @__PURE__ */ jsx("colgroup", { children: chavesVista.map((k) => /* @__PURE__ */ jsx("col", { style: { width: largurasVista[k] } }, k)) }) : null;
|
|
1124
1141
|
const estiloTabela = largurasVista ? { tableLayout: "fixed", width: chavesVista.reduce((a, k) => a + (largurasVista[k] ?? 0), 0), minWidth: "100%" } : { width: "max-content" };
|
|
1125
|
-
const cabecalho = (fixoNoTopo) => /* @__PURE__ */ jsx("thead", { className: fixoNoTopo ? "sticky top-0 z-20" : void 0, children: /* @__PURE__ */ jsxs("tr", { ref: cabecalhoRef, className: `text-[11.5px] font-semibold uppercase text-slate-500 dark:text-slate-400 tracking-wide ${!bordasSeparadas ? "border-b border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-900" : fundoNosTitulos ? "[&>th]:border-b [&>th]:border-slate-200 dark:[&>th]:border-slate-700" : "shadow-[inset_0_-1px_0_0_var(--tbl-s200)]"}`, children: [
|
|
1142
|
+
const cabecalho = (fixoNoTopo) => /* @__PURE__ */ jsx("thead", { className: fixoNoTopo ? "sticky top-0 z-20" : void 0, children: /* @__PURE__ */ jsxs("tr", { ref: cabecalhoRef, className: `text-[11.5px] font-semibold ${titulosNormais ? "normal-case" : "uppercase"} text-slate-500 dark:text-slate-400 tracking-wide ${!bordasSeparadas ? "border-b border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-900" : fundoNosTitulos ? "[&>th]:border-b [&>th]:border-slate-200 dark:[&>th]:border-slate-700" : "shadow-[inset_0_-1px_0_0_var(--tbl-s200)]"}`, children: [
|
|
1126
1143
|
selectable && /* @__PURE__ */ jsx("th", { style: cabecaFixa(0).style, className: `px-4 py-2.5 max-lg:[@media(max-height:500px)]:py-1 w-10 ${fundoNosTitulos ? "bg-slate-50 dark:bg-slate-900" : ""} ${cabecaFixa(0).className}`, children: /* @__PURE__ */ jsx("button", { onClick: toggleAll, className: `w-4 h-4 flex items-center justify-center rounded-sm border transition-colors ${allVisibleSelected ? "bg-primary border-primary" : someVisibleSelected ? "bg-slate-300 dark:bg-slate-600 border-slate-300 dark:border-slate-600" : "border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500"}`, children: (allVisibleSelected || someVisibleSelected) && /* @__PURE__ */ jsx(CheckIcon, { size: 9, strokeWidth: 3, className: "text-white" }) }) }),
|
|
1127
1144
|
columns.map((col, i) => {
|
|
1128
1145
|
const canSort = noServidor ? col.sortable === true : col.sortable !== false && !!col.value;
|
|
@@ -1141,7 +1158,7 @@ function TableBase({
|
|
|
1141
1158
|
className: `px-4 py-2.5 max-lg:[@media(max-height:500px)]:py-1 ${cabecaFixa(i + (selectable ? 1 : 0)).style ? "" : "relative"} ${col.headerClassName ?? ""} ${cabecaFixa(i + (selectable ? 1 : 0)).className} ${arrastavel ? "cursor-grab" : ""} ${realce(col.key, true)} ${transicaoRealce}`,
|
|
1142
1159
|
"data-col": col.key,
|
|
1143
1160
|
children: [
|
|
1144
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
1161
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center gap-1.5 group/hdr ${titulosPartem ? "whitespace-normal" : "whitespace-nowrap"} select-none`, children: [
|
|
1145
1162
|
canSort ? /* @__PURE__ */ jsxs(
|
|
1146
1163
|
"button",
|
|
1147
1164
|
{
|
|
@@ -1202,8 +1219,8 @@ function TableBase({
|
|
|
1202
1219
|
labels: L,
|
|
1203
1220
|
canSort,
|
|
1204
1221
|
ancora: ancoraFiltro,
|
|
1205
|
-
tipo: col.filterType === "date" ? "data" : col.filterType === "number" ? "numero" : "texto",
|
|
1206
|
-
valores: col.filterType === "date" ? [] : getUniqueValues(col.key),
|
|
1222
|
+
tipo: col.filterType === "date" ? "data" : col.filterType === "number" ? "numero" : col.filterType === "search" ? "busca" : "texto",
|
|
1223
|
+
valores: col.filterType === "date" || col.filterType === "search" ? [] : getUniqueValues(col.key),
|
|
1207
1224
|
seleccionados: columnFilters[col.key] ?? /* @__PURE__ */ new Set(),
|
|
1208
1225
|
intervalo: dateFilters[col.key] ?? {},
|
|
1209
1226
|
numero: numFilters[col.key] ?? {},
|
|
@@ -1258,8 +1275,8 @@ function TableBase({
|
|
|
1258
1275
|
title: L.filterBy(sf.label),
|
|
1259
1276
|
"aria-label": L.filterBy(sf.label),
|
|
1260
1277
|
"aria-expanded": isEfOpen,
|
|
1261
|
-
className: `p-0.5 transition-colors ${isEfFiltered || isEfOpen ? "text-
|
|
1262
|
-
children: /* @__PURE__ */ jsx(FilterIcon, { size:
|
|
1278
|
+
className: `p-0.5 transition-colors ${isEfFiltered || isEfOpen ? "text-proef-blue opacity-100" : "text-slate-400 dark:text-slate-500 opacity-50 group-hover/hdr:opacity-100 hover:text-slate-600 dark:hover:text-slate-300"}`,
|
|
1279
|
+
children: /* @__PURE__ */ jsx(FilterIcon, { size: 10 })
|
|
1263
1280
|
}
|
|
1264
1281
|
),
|
|
1265
1282
|
isEfOpen && ancoraFiltro && /* @__PURE__ */ jsx(
|
|
@@ -1268,8 +1285,8 @@ function TableBase({
|
|
|
1268
1285
|
labels: L,
|
|
1269
1286
|
label: sf.label,
|
|
1270
1287
|
ancora: ancoraFiltro,
|
|
1271
|
-
tipo: sf.filterType === "date" ? "data" : sf.filterType === "number" ? "numero" : "texto",
|
|
1272
|
-
valores: sf.filterType === "date" ? [] : getUniqueValues(sf.key),
|
|
1288
|
+
tipo: sf.filterType === "date" ? "data" : sf.filterType === "number" ? "numero" : sf.filterType === "search" ? "busca" : "texto",
|
|
1289
|
+
valores: sf.filterType === "date" || sf.filterType === "search" ? [] : getUniqueValues(sf.key),
|
|
1273
1290
|
seleccionados: columnFilters[sf.key] ?? /* @__PURE__ */ new Set(),
|
|
1274
1291
|
intervalo: dateFilters[sf.key] ?? {},
|
|
1275
1292
|
numero: numFilters[sf.key] ?? {},
|
|
@@ -1319,7 +1336,7 @@ function TableBase({
|
|
|
1319
1336
|
linhasDesenhadas.map((row) => {
|
|
1320
1337
|
const chave = rowKey(row);
|
|
1321
1338
|
const seleccionada = !!selectable && selectedKeys.has(chave);
|
|
1322
|
-
const classeExtra = rowClassName?.(row) ?? ""
|
|
1339
|
+
const classeExtra = `${rowBackground?.(row) ?? ""} ${rowClassName?.(row) ?? ""}`;
|
|
1323
1340
|
return /* @__PURE__ */ jsx(LinhaCorpo, { dados: row, seleccionada, versao: versaoLinhas, colunas: columns, classeExtra, conteudo: () => /* @__PURE__ */ jsxs(
|
|
1324
1341
|
"tr",
|
|
1325
1342
|
{
|
|
@@ -1327,12 +1344,12 @@ function TableBase({
|
|
|
1327
1344
|
onDoubleClick: () => accoesLinha.current.onRowDoubleClick?.(row),
|
|
1328
1345
|
className: `group/linha hover:bg-slate-50 dark:hover:bg-slate-900 transition-colors ${onRowClick || onRowDoubleClick ? "cursor-pointer" : ""} ${seleccionada ? fundoPorPintar ? "bg-[#f2fdf9] dark:bg-[#062a20]" : "bg-proef-turquoise/5" : fundoPorPintar ? "bg-white dark:bg-slate-950" : ""} ${classeExtra}`,
|
|
1329
1346
|
children: [
|
|
1330
|
-
selectable && /* @__PURE__ */ jsx("td", { style: fixa(0, fundoLinha(chave)).style, className: `px-4 py-3 max-lg:py-1 ${fixa(0, fundoLinha(chave)).className}`, onClick: (e) => {
|
|
1347
|
+
selectable && /* @__PURE__ */ jsx("td", { style: fixa(0, fundoLinha(chave, row)).style, className: `px-4 py-3 max-lg:py-1 ${fixa(0, fundoLinha(chave, row)).className}`, onClick: (e) => {
|
|
1331
1348
|
e.stopPropagation();
|
|
1332
1349
|
accoesLinha.current.toggleRow(chave);
|
|
1333
1350
|
}, children: /* @__PURE__ */ jsx("div", { className: `w-4 h-4 flex items-center justify-center rounded-sm border transition-colors ${seleccionada ? "bg-primary border-primary" : "border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500"}`, children: seleccionada && /* @__PURE__ */ jsx(CheckIcon, { size: 9, strokeWidth: 3, className: "text-white" }) }) }),
|
|
1334
1351
|
columns.map((col, i) => {
|
|
1335
|
-
const f = fixa(i + (selectable ? 1 : 0), fundoLinha(chave));
|
|
1352
|
+
const f = fixa(i + (selectable ? 1 : 0), fundoLinha(chave, row));
|
|
1336
1353
|
return /* @__PURE__ */ jsx("td", { style: f.style, className: `px-3 py-1.5 max-lg:py-1 ${col.cellClassName ?? ""} ${f.className} ${recuoFim(i)} ${realce(col.key)} ${transicaoRealce}`, "data-col": col.key, children: col.render(row) }, col.key);
|
|
1337
1354
|
})
|
|
1338
1355
|
]
|
|
@@ -1381,7 +1398,7 @@ function TableBase({
|
|
|
1381
1398
|
// Os intervalos Mín/Máx também levam chip: sem ele, um filtro de números
|
|
1382
1399
|
// escondia linhas sem nada à vista que o dissesse.
|
|
1383
1400
|
...Object.entries(numFilters).filter(([, r]) => numFilterActive(r)).map(([k, r]) => itemChip(`n-${k}`, "filtro", nomeDoFiltro(k), textoNum(r), () => clearColumnFilter(k)))
|
|
1384
|
-
].filter((i) => !semFaixaFiltros || i.tipo === "grupo");
|
|
1401
|
+
].filter((i) => (!semFaixaFiltros || i.tipo === "grupo") && !(semChipsGrupo && i.tipo === "grupo"));
|
|
1385
1402
|
const chip = (it, focavel = true) => /* @__PURE__ */ jsxs("div", { className: "shrink-0 whitespace-nowrap h-7 flex items-center gap-1.5 pl-2.5 pr-1 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-950 text-caption", children: [
|
|
1386
1403
|
it.tipo === "grupo" && /* @__PURE__ */ jsx(LayersIcon, { size: 12, className: "text-slate-400 dark:text-slate-500" }),
|
|
1387
1404
|
/* @__PURE__ */ jsx("span", { className: "text-slate-500 dark:text-slate-400", children: it.rotulo }),
|
|
@@ -1399,7 +1416,7 @@ function TableBase({
|
|
|
1399
1416
|
)
|
|
1400
1417
|
] }, it.chave);
|
|
1401
1418
|
const classeLimpar = "shrink-0 whitespace-nowrap text-caption font-medium text-slate-500 dark:text-slate-400 hover:text-red-600 transition-colors";
|
|
1402
|
-
const chipsGrupo = isGrouped ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1419
|
+
const chipsGrupo = isGrouped && !semChipsGrupo ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1403
1420
|
itensChips.filter((i) => i.tipo === "grupo").map((i) => chip(i)),
|
|
1404
1421
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: clearAllGroups, className: classeLimpar, children: L.clearGroups })
|
|
1405
1422
|
] }) : null;
|
|
@@ -1461,9 +1478,10 @@ function TableBase({
|
|
|
1461
1478
|
useEffect(() => {
|
|
1462
1479
|
if (!chipsEscondidos.length) setMaisAberto(false);
|
|
1463
1480
|
}, [chipsEscondidos.length]);
|
|
1464
|
-
const
|
|
1481
|
+
const topoVazio = !!topo && semContagem && !(topo.pageSizeOptions && topo.onPageSizeChange) && itensChips.length === 0 && !topoACarregar && !(totalPaginasTopo > 1 && !isGrouped);
|
|
1482
|
+
const barraTopo = topo && !topoVazio ? /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-white dark:bg-slate-950 border-b border-slate-200 dark:border-slate-700 flex items-center justify-between gap-3 text-caption text-slate-500 dark:text-slate-400 shrink-0", children: [
|
|
1465
1483
|
/* @__PURE__ */ jsxs("div", { className: "shrink-0 flex items-center gap-3", children: [
|
|
1466
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1484
|
+
!semContagem && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1467
1485
|
topoACarregar ? esqueletoTopo : /* @__PURE__ */ jsx("span", { className: "font-semibold text-slate-800 dark:text-slate-100 tabular-nums", children: contagem }),
|
|
1468
1486
|
filtradaTopo && !topoACarregar && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1469
1487
|
L.of,
|
|
@@ -1516,7 +1534,7 @@ function TableBase({
|
|
|
1516
1534
|
type: "button",
|
|
1517
1535
|
onClick: () => {
|
|
1518
1536
|
clearAllFilters();
|
|
1519
|
-
clearAllGroups();
|
|
1537
|
+
if (!semChipsGrupo) clearAllGroups();
|
|
1520
1538
|
},
|
|
1521
1539
|
className: `ml-auto ${classeLimpar}`,
|
|
1522
1540
|
children: L.clearAll
|
|
@@ -1550,7 +1568,7 @@ function TableBase({
|
|
|
1550
1568
|
scroll pelo meio. */
|
|
1551
1569
|
/* @__PURE__ */ jsxs("div", { ref: raizRef, className: `v1-reset text-control text-slate-800 dark:text-slate-100 ${preencheAltura ? "h-full min-h-0 flex flex-col" : ""} ${comCaixa ? "rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-950 overflow-hidden" : ""}`, children: [
|
|
1552
1570
|
barraTopo,
|
|
1553
|
-
!topo && isGrouped && /* @__PURE__ */ jsx("div", { className: "px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 flex items-center gap-1.5 flex-wrap", children: chipsGrupo }),
|
|
1571
|
+
!topo && isGrouped && !semChipsGrupo && /* @__PURE__ */ jsx("div", { className: "px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 flex items-center gap-1.5 flex-wrap", children: chipsGrupo }),
|
|
1554
1572
|
!topo && totalActiveFilters > 0 && !semFaixaFiltros && /* @__PURE__ */ jsx("div", { className: "px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 flex items-center gap-1.5 flex-wrap", children: chipsFiltro }),
|
|
1555
1573
|
preencheAltura ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1556
1574
|
!barraSobreposta && /* @__PURE__ */ jsx(
|