@oondemand/oon-core-front 0.3.69 → 0.3.71
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.d.ts +2 -0
- package/dist/index.js +58 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -321,6 +321,8 @@ type OonRowActionDef = {
|
|
|
321
321
|
id?: string;
|
|
322
322
|
label: string;
|
|
323
323
|
icon?: string;
|
|
324
|
+
/** Exibe somente o ícone, preservando label em title e aria-label. */
|
|
325
|
+
iconOnly?: boolean;
|
|
324
326
|
type: "openDetailModal" | "navigate" | "apiAction" | "customAction";
|
|
325
327
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
326
328
|
endpoint?: string;
|
package/dist/index.js
CHANGED
|
@@ -2359,6 +2359,33 @@ function unwrap2(value2) {
|
|
|
2359
2359
|
if (data && typeof data === "object") return data;
|
|
2360
2360
|
return record;
|
|
2361
2361
|
}
|
|
2362
|
+
function RowActionIcon({ name }) {
|
|
2363
|
+
const normalized2 = String(name || "").trim().toLowerCase();
|
|
2364
|
+
if (["trash", "delete", "remove", "lixeira"].includes(normalized2)) {
|
|
2365
|
+
return /* @__PURE__ */ jsxs8(
|
|
2366
|
+
"svg",
|
|
2367
|
+
{
|
|
2368
|
+
"aria-hidden": "true",
|
|
2369
|
+
width: "15",
|
|
2370
|
+
height: "15",
|
|
2371
|
+
viewBox: "0 0 24 24",
|
|
2372
|
+
fill: "none",
|
|
2373
|
+
stroke: "currentColor",
|
|
2374
|
+
strokeWidth: "2",
|
|
2375
|
+
strokeLinecap: "round",
|
|
2376
|
+
strokeLinejoin: "round",
|
|
2377
|
+
children: [
|
|
2378
|
+
/* @__PURE__ */ jsx13("path", { d: "M3 6h18" }),
|
|
2379
|
+
/* @__PURE__ */ jsx13("path", { d: "M8 6V4h8v2" }),
|
|
2380
|
+
/* @__PURE__ */ jsx13("path", { d: "M19 6l-1 14H6L5 6" }),
|
|
2381
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 11v5" }),
|
|
2382
|
+
/* @__PURE__ */ jsx13("path", { d: "M14 11v5" })
|
|
2383
|
+
]
|
|
2384
|
+
}
|
|
2385
|
+
);
|
|
2386
|
+
}
|
|
2387
|
+
return null;
|
|
2388
|
+
}
|
|
2362
2389
|
function emitOperationalEvent(action, row, changes) {
|
|
2363
2390
|
if (typeof window === "undefined" || typeof window.dispatchEvent !== "function") return;
|
|
2364
2391
|
if (!action.operationalKind) return;
|
|
@@ -2390,6 +2417,8 @@ function CoreRowAction({ action, row, parent, onOpenDetail, onRefresh, onUpdate
|
|
|
2390
2417
|
const tone = pipelineAction.tone ? ACTION_TONES[pipelineAction.tone] : void 0;
|
|
2391
2418
|
const isWorkStatus = pipelineAction.group === "workStatus";
|
|
2392
2419
|
const isSelected = isWorkStatus && !!pipelineAction.field && effectiveRow[pipelineAction.field] === pipelineAction.value;
|
|
2420
|
+
const icon = /* @__PURE__ */ jsx13(RowActionIcon, { name: action.icon });
|
|
2421
|
+
const iconOnly = Boolean(action.iconOnly && icon);
|
|
2393
2422
|
if (evaluateCondition(action.hiddenWhen, effectiveRow)) return null;
|
|
2394
2423
|
const disabled = evaluateCondition(action.disabledWhen, effectiveRow) || loading;
|
|
2395
2424
|
const confirmAction = () => action.confirm ? window.confirm(action.confirm.description ?? action.confirm.title ?? `Executar ${action.label}?`) : true;
|
|
@@ -2455,9 +2484,12 @@ function CoreRowAction({ action, row, parent, onOpenDetail, onRefresh, onUpdate
|
|
|
2455
2484
|
type: "button",
|
|
2456
2485
|
size: "xs",
|
|
2457
2486
|
minH: isWorkStatus ? "32px" : "28px",
|
|
2458
|
-
|
|
2487
|
+
minW: iconOnly ? "28px" : void 0,
|
|
2488
|
+
px: iconOnly ? "6px" : isWorkStatus ? "12px" : "9px",
|
|
2459
2489
|
borderRadius: isWorkStatus ? "full" : "6px",
|
|
2460
2490
|
fontSize: "10px",
|
|
2491
|
+
"aria-label": iconOnly ? action.label : void 0,
|
|
2492
|
+
title: iconOnly ? action.label : void 0,
|
|
2461
2493
|
fontWeight: "700",
|
|
2462
2494
|
variant: tone ? "outline" : void 0,
|
|
2463
2495
|
bg: isWorkStatus && !isSelected ? "white" : tone?.bg,
|
|
@@ -2473,7 +2505,8 @@ function CoreRowAction({ action, row, parent, onOpenDetail, onRefresh, onUpdate
|
|
|
2473
2505
|
_disabled: tone ? { opacity: isSelected ? 1 : 0.55, cursor: "not-allowed" } : void 0,
|
|
2474
2506
|
children: [
|
|
2475
2507
|
isWorkStatus ? /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", style: { width: 8, height: 8, display: "inline-block", marginRight: 7, borderRadius: "999px", background: tone?.color ?? "#64748B", boxShadow: isSelected ? "0 0 0 2px rgba(255,255,255,.9)" : "none" } }) : null,
|
|
2476
|
-
|
|
2508
|
+
icon,
|
|
2509
|
+
iconOnly ? null : action.label
|
|
2477
2510
|
]
|
|
2478
2511
|
}
|
|
2479
2512
|
),
|
|
@@ -4585,7 +4618,7 @@ function Sidebar({ app, menu, registry }) {
|
|
|
4585
4618
|
// package.json
|
|
4586
4619
|
var package_default = {
|
|
4587
4620
|
name: "@oondemand/oon-core-front",
|
|
4588
|
-
version: "0.3.
|
|
4621
|
+
version: "0.3.71",
|
|
4589
4622
|
repository: {
|
|
4590
4623
|
type: "git",
|
|
4591
4624
|
url: "git+https://github.com/oondemand/oon-platform.git",
|
|
@@ -6870,6 +6903,16 @@ function CoreIntegrationTickets({ provider = "omie" }) {
|
|
|
6870
6903
|
await queue.refetch();
|
|
6871
6904
|
}
|
|
6872
6905
|
});
|
|
6906
|
+
const processPending = useMutation5({
|
|
6907
|
+
mutationFn: async () => http.post(
|
|
6908
|
+
"/integrations/queue/process",
|
|
6909
|
+
{ provider, limit: 100 },
|
|
6910
|
+
{ headers: { "x-oon-origin": "integration" } }
|
|
6911
|
+
),
|
|
6912
|
+
onSuccess: async () => {
|
|
6913
|
+
await queue.refetch();
|
|
6914
|
+
}
|
|
6915
|
+
});
|
|
6873
6916
|
useEffect10(() => {
|
|
6874
6917
|
const totalPages2 = queue.data?.pagination?.totalPages ?? 1;
|
|
6875
6918
|
if (page > totalPages2) setPage(Math.max(1, totalPages2));
|
|
@@ -6884,7 +6927,7 @@ function CoreIntegrationTickets({ provider = "omie" }) {
|
|
|
6884
6927
|
const totalPages = Math.max(1, pagination?.totalPages ?? 1);
|
|
6885
6928
|
const totalItems = pagination?.totalItems ?? 0;
|
|
6886
6929
|
const statuses = queue.data?.summary?.statuses ?? {};
|
|
6887
|
-
const operationError = action.error || queue.error;
|
|
6930
|
+
const operationError = action.error || processPending.error || queue.error;
|
|
6888
6931
|
return /* @__PURE__ */ jsxs25(Stack11, { gap: 5, children: [
|
|
6889
6932
|
/* @__PURE__ */ jsxs25(Flex17, { align: "start", justify: "space-between", gap: 3, wrap: "wrap", children: [
|
|
6890
6933
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
@@ -6900,6 +6943,17 @@ function CoreIntegrationTickets({ provider = "omie" }) {
|
|
|
6900
6943
|
setView("board");
|
|
6901
6944
|
setPage(1);
|
|
6902
6945
|
}, children: "Quadro" }),
|
|
6946
|
+
/* @__PURE__ */ jsx40(
|
|
6947
|
+
Button17,
|
|
6948
|
+
{
|
|
6949
|
+
size: "sm",
|
|
6950
|
+
colorPalette: "blue",
|
|
6951
|
+
loading: processPending.isPending,
|
|
6952
|
+
disabled: processPending.isPending,
|
|
6953
|
+
onClick: () => processPending.mutate(),
|
|
6954
|
+
children: "Processar pendentes"
|
|
6955
|
+
}
|
|
6956
|
+
),
|
|
6903
6957
|
/* @__PURE__ */ jsx40(Button17, { size: "sm", variant: "outline", loading: queue.isFetching, onClick: () => queue.refetch(), children: "Atualizar" })
|
|
6904
6958
|
] })
|
|
6905
6959
|
] }),
|