@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.cjs
CHANGED
|
@@ -5482,20 +5482,28 @@ function ProtectedRoute({ children, useAuthContext, tenantId, useSSO, routePaths
|
|
|
5482
5482
|
}
|
|
5483
5483
|
);
|
|
5484
5484
|
}
|
|
5485
|
-
var FilterBar = ({
|
|
5485
|
+
var FilterBar = ({
|
|
5486
|
+
onFilterChange,
|
|
5487
|
+
filters,
|
|
5488
|
+
operators,
|
|
5489
|
+
taskTypes,
|
|
5490
|
+
businessUnits,
|
|
5491
|
+
statusOptions: statusOptionsProp,
|
|
5492
|
+
defaultStatus: defaultStatusProp
|
|
5493
|
+
}) => {
|
|
5486
5494
|
const [openPopovers, setOpenPopovers] = React37.useState({
|
|
5487
5495
|
businessUnits: false,
|
|
5488
5496
|
operators: false,
|
|
5489
5497
|
taskTypes: false,
|
|
5490
5498
|
status: false
|
|
5491
5499
|
});
|
|
5492
|
-
const statusOptions = [
|
|
5493
|
-
{ value: "pending", label: "Pendente" },
|
|
5500
|
+
const statusOptions = statusOptionsProp ?? [
|
|
5494
5501
|
{ value: "in-progress", label: "Em Andamento (IA)" },
|
|
5495
|
-
{ value: "human-interaction", label: "
|
|
5502
|
+
{ value: "human-interaction", label: "Pendente (Humano)" },
|
|
5496
5503
|
{ value: "completed", label: "Conclu\xEDdo" },
|
|
5497
5504
|
{ value: "alert", label: "Precisam de Intera\xE7\xE3o" }
|
|
5498
5505
|
];
|
|
5506
|
+
const defaultStatus = defaultStatusProp ?? ["in-progress", "human-interaction"];
|
|
5499
5507
|
const updateFilter = (key, value) => {
|
|
5500
5508
|
const newFilters = { ...filters, [key]: value };
|
|
5501
5509
|
onFilterChange(newFilters);
|
|
@@ -5504,7 +5512,7 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5504
5512
|
if (key === "vehicleId" || key === "operatorType") {
|
|
5505
5513
|
updateFilter(key, "");
|
|
5506
5514
|
} else if (key === "status") {
|
|
5507
|
-
updateFilter(key,
|
|
5515
|
+
updateFilter(key, defaultStatus);
|
|
5508
5516
|
} else {
|
|
5509
5517
|
updateFilter(key, []);
|
|
5510
5518
|
}
|
|
@@ -5516,8 +5524,7 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5516
5524
|
taskTypes: [],
|
|
5517
5525
|
businessUnits: [],
|
|
5518
5526
|
operatorType: "",
|
|
5519
|
-
status:
|
|
5520
|
-
// Manter padrão ao limpar tudo
|
|
5527
|
+
status: defaultStatus,
|
|
5521
5528
|
startDate: "",
|
|
5522
5529
|
endDate: ""
|
|
5523
5530
|
};
|
|
@@ -5530,7 +5537,6 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5530
5537
|
updateFilter(key, newArray);
|
|
5531
5538
|
};
|
|
5532
5539
|
const activeFiltersCount = [
|
|
5533
|
-
filters.vehicleId,
|
|
5534
5540
|
filters.operatorType,
|
|
5535
5541
|
filters.startDate,
|
|
5536
5542
|
filters.endDate,
|
|
@@ -5538,31 +5544,10 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5538
5544
|
...filters.taskTypes,
|
|
5539
5545
|
...filters.businessUnits,
|
|
5540
5546
|
// Não contar status como filtro ativo se for o padrão
|
|
5541
|
-
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([
|
|
5547
|
+
...JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort()) ? filters.status : []
|
|
5542
5548
|
].filter((value) => value !== "").length;
|
|
5543
5549
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white border-b border-gray-200 p-4 space-y-4", children: [
|
|
5544
5550
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
5545
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5546
|
-
Input,
|
|
5547
|
-
{
|
|
5548
|
-
placeholder: "Buscar por placa...",
|
|
5549
|
-
value: filters.vehicleId,
|
|
5550
|
-
onChange: (e) => updateFilter("vehicleId", e.target.value),
|
|
5551
|
-
leftIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" }),
|
|
5552
|
-
rightIcon: filters.vehicleId ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5553
|
-
Button,
|
|
5554
|
-
{
|
|
5555
|
-
variant: "ghost",
|
|
5556
|
-
size: "sm",
|
|
5557
|
-
onClick: () => clearFilter("vehicleId"),
|
|
5558
|
-
className: "h-6 w-6 p-0 hover:bg-gray-100 -mr-2",
|
|
5559
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
|
|
5560
|
-
}
|
|
5561
|
-
) : void 0,
|
|
5562
|
-
className: "w-48",
|
|
5563
|
-
showValidationIcon: false
|
|
5564
|
-
}
|
|
5565
|
-
) }),
|
|
5566
5551
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
5567
5552
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5568
5553
|
Input,
|
|
@@ -5830,20 +5815,6 @@ var FilterBar = ({ onFilterChange, filters, operators, taskTypes, businessUnits
|
|
|
5830
5815
|
] }),
|
|
5831
5816
|
activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
5832
5817
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-600", children: "Filtros ativos:" }),
|
|
5833
|
-
filters.vehicleId && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
|
|
5834
|
-
"Placa: ",
|
|
5835
|
-
filters.vehicleId,
|
|
5836
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5837
|
-
Button,
|
|
5838
|
-
{
|
|
5839
|
-
variant: "ghost",
|
|
5840
|
-
size: "sm",
|
|
5841
|
-
onClick: () => clearFilter("vehicleId"),
|
|
5842
|
-
className: "icon-size p-0 hover:bg-gray-200 ml-1",
|
|
5843
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
|
|
5844
|
-
}
|
|
5845
|
-
)
|
|
5846
|
-
] }),
|
|
5847
5818
|
filters.operatorType && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
|
|
5848
5819
|
"Tipo: ",
|
|
5849
5820
|
filters.operatorType === "ia" ? "IA" : "Humano",
|