@lincros-ui/components 0.2.24 → 0.2.26
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.cjs +15 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5425,20 +5425,28 @@ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths
|
|
|
5425
5425
|
}
|
|
5426
5426
|
);
|
|
5427
5427
|
}
|
|
5428
|
-
var FilterBar = ({
|
|
5428
|
+
var FilterBar = ({
|
|
5429
|
+
onFilterChange,
|
|
5430
|
+
filters,
|
|
5431
|
+
operators,
|
|
5432
|
+
taskTypes,
|
|
5433
|
+
businessUnits,
|
|
5434
|
+
statusOptions: statusOptionsProp,
|
|
5435
|
+
defaultStatus: defaultStatusProp
|
|
5436
|
+
}) => {
|
|
5429
5437
|
const [openPopovers, setOpenPopovers] = useState({
|
|
5430
5438
|
businessUnits: false,
|
|
5431
5439
|
operators: false,
|
|
5432
5440
|
taskTypes: false,
|
|
5433
5441
|
status: false
|
|
5434
5442
|
});
|
|
5435
|
-
const statusOptions = [
|
|
5436
|
-
{ value: "pending", label: "Pendente" },
|
|
5443
|
+
const statusOptions = statusOptionsProp ?? [
|
|
5437
5444
|
{ value: "in-progress", label: "Em Andamento (IA)" },
|
|
5438
|
-
{ value: "human-interaction", label: "
|
|
5445
|
+
{ value: "human-interaction", label: "Pendente (Humano)" },
|
|
5439
5446
|
{ value: "completed", label: "Conclu\xEDdo" },
|
|
5440
5447
|
{ value: "alert", label: "Precisam de Intera\xE7\xE3o" }
|
|
5441
5448
|
];
|
|
5449
|
+
const defaultStatus = defaultStatusProp ?? ["in-progress", "human-interaction"];
|
|
5442
5450
|
const updateFilter = (key, value) => {
|
|
5443
5451
|
const newFilters = { ...filters, [key]: value };
|
|
5444
5452
|
onFilterChange(newFilters);
|
|
@@ -5447,7 +5455,7 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5447
5455
|
if (key === "vehicleId" || key === "operatorType") {
|
|
5448
5456
|
updateFilter(key, "");
|
|
5449
5457
|
} else if (key === "status") {
|
|
5450
|
-
updateFilter(key,
|
|
5458
|
+
updateFilter(key, defaultStatus);
|
|
5451
5459
|
} else {
|
|
5452
5460
|
updateFilter(key, []);
|
|
5453
5461
|
}
|
|
@@ -5459,8 +5467,7 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5459
5467
|
taskTypes: [],
|
|
5460
5468
|
businessUnits: [],
|
|
5461
5469
|
operatorType: "",
|
|
5462
|
-
status:
|
|
5463
|
-
// Manter padrão ao limpar tudo
|
|
5470
|
+
status: defaultStatus,
|
|
5464
5471
|
startDate: "",
|
|
5465
5472
|
endDate: ""
|
|
5466
5473
|
};
|
|
@@ -5473,7 +5480,6 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5473
5480
|
updateFilter(key, newArray);
|
|
5474
5481
|
};
|
|
5475
5482
|
const activeFiltersCount = [
|
|
5476
|
-
filters.vehicleId,
|
|
5477
5483
|
filters.operatorType,
|
|
5478
5484
|
filters.startDate,
|
|
5479
5485
|
filters.endDate,
|
|
@@ -5481,31 +5487,10 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5481
5487
|
...filters.taskTypes,
|
|
5482
5488
|
...filters.businessUnits,
|
|
5483
5489
|
// Não contar status como filtro ativo se for o padrão
|
|
5484
|
-
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([
|
|
5490
|
+
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort()) ? filters.status : []
|
|
5485
5491
|
].filter((value) => value !== "").length;
|
|
5486
5492
|
return /* @__PURE__ */ jsxs("div", { className: "bg-white border-b border-gray-200 p-4 space-y-4", children: [
|
|
5487
5493
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
5488
|
-
/* @__PURE__ */ jsx("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ jsx(
|
|
5489
|
-
Input,
|
|
5490
|
-
{
|
|
5491
|
-
placeholder: "Buscar por placa...",
|
|
5492
|
-
value: filters.vehicleId,
|
|
5493
|
-
onChange: (e) => updateFilter("vehicleId", e.target.value),
|
|
5494
|
-
leftIcon: /* @__PURE__ */ jsx(Search, { className: "w-4 h-4" }),
|
|
5495
|
-
rightIcon: filters.vehicleId ? /* @__PURE__ */ jsx(
|
|
5496
|
-
Button,
|
|
5497
|
-
{
|
|
5498
|
-
variant: "ghost",
|
|
5499
|
-
size: "sm",
|
|
5500
|
-
onClick: () => clearFilter("vehicleId"),
|
|
5501
|
-
className: "h-6 w-6 p-0 hover:bg-gray-100 -mr-2",
|
|
5502
|
-
children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" })
|
|
5503
|
-
}
|
|
5504
|
-
) : void 0,
|
|
5505
|
-
className: "w-48",
|
|
5506
|
-
showValidationIcon: false
|
|
5507
|
-
}
|
|
5508
|
-
) }),
|
|
5509
5494
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
5510
5495
|
/* @__PURE__ */ jsx(
|
|
5511
5496
|
Input,
|
|
@@ -5773,20 +5758,6 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5773
5758
|
] }),
|
|
5774
5759
|
activeFiltersCount > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
5775
5760
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600", children: "Filtros ativos:" }),
|
|
5776
|
-
filters.vehicleId && /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
|
|
5777
|
-
"Placa: ",
|
|
5778
|
-
filters.vehicleId,
|
|
5779
|
-
/* @__PURE__ */ jsx(
|
|
5780
|
-
Button,
|
|
5781
|
-
{
|
|
5782
|
-
variant: "ghost",
|
|
5783
|
-
size: "sm",
|
|
5784
|
-
onClick: () => clearFilter("vehicleId"),
|
|
5785
|
-
className: "icon-size p-0 hover:bg-gray-200 ml-1",
|
|
5786
|
-
children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" })
|
|
5787
|
-
}
|
|
5788
|
-
)
|
|
5789
|
-
] }),
|
|
5790
5761
|
filters.operatorType && /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
|
|
5791
5762
|
"Tipo: ",
|
|
5792
5763
|
filters.operatorType === "ia" ? "IA" : "Humano",
|