@lincros-ui/components 0.2.22 → 0.2.25
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 +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4885,7 +4885,7 @@ function useSidebarState(routePaths) {
|
|
|
4885
4885
|
return expandedMenus.includes(menuTitle);
|
|
4886
4886
|
};
|
|
4887
4887
|
const isMenuItemActive = (url) => {
|
|
4888
|
-
return location.pathname
|
|
4888
|
+
return location.pathname === url;
|
|
4889
4889
|
};
|
|
4890
4890
|
const isExactMenuItemActive = (url) => {
|
|
4891
4891
|
return location.pathname === url;
|
|
@@ -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
|
};
|
|
@@ -5481,7 +5488,7 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5481
5488
|
...filters.taskTypes,
|
|
5482
5489
|
...filters.businessUnits,
|
|
5483
5490
|
// Não contar status como filtro ativo se for o padrão
|
|
5484
|
-
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([
|
|
5491
|
+
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort()) ? filters.status : []
|
|
5485
5492
|
].filter((value) => value !== "").length;
|
|
5486
5493
|
return /* @__PURE__ */ jsxs("div", { className: "bg-white border-b border-gray-200 p-4 space-y-4", children: [
|
|
5487
5494
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|