@oondemand/oon-core-front 0.3.70 → 0.3.72
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 +40 -7
- 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
|
@@ -950,6 +950,7 @@ function DataGrid({
|
|
|
950
950
|
] }),
|
|
951
951
|
query.isLoading ? /* @__PURE__ */ jsx7(LoadingScreen, {}) : query.isError ? /* @__PURE__ */ jsx7(ErrorState, { error: query.error }) : /* @__PURE__ */ jsx7(Box2, { overflowX: "auto", children: /* @__PURE__ */ jsxs3(Table.Root, { size: "sm", minW: "900px", borderCollapse: "collapse", children: [
|
|
952
952
|
/* @__PURE__ */ jsx7(Table.Header, { children: /* @__PURE__ */ jsxs3(Table.Row, { bg: "#F4F7F9", children: [
|
|
953
|
+
actionCount ? /* @__PURE__ */ jsx7(Table.ColumnHeader, { w: "84px", h: "39px", px: "10px", py: "8px", color: "#667085", borderBottomWidth: "1px", borderColor: "#D5DDE3", fontSize: "10px", fontWeight: "600", textAlign: "center", children: "A\xE7\xF5es" }) : null,
|
|
953
954
|
columns.map((column) => /* @__PURE__ */ jsxs3(
|
|
954
955
|
Table.ColumnHeader,
|
|
955
956
|
{
|
|
@@ -972,16 +973,15 @@ function DataGrid({
|
|
|
972
973
|
]
|
|
973
974
|
},
|
|
974
975
|
column.field
|
|
975
|
-
))
|
|
976
|
-
actionCount ? /* @__PURE__ */ jsx7(Table.ColumnHeader, { w: "84px", h: "39px", px: "10px", py: "8px", color: "#667085", borderBottomWidth: "1px", borderColor: "#D5DDE3", fontSize: "10px", fontWeight: "600", textAlign: "center", children: "A\xE7\xF5es" }) : null
|
|
976
|
+
))
|
|
977
977
|
] }) }),
|
|
978
978
|
/* @__PURE__ */ jsx7(Table.Body, { children: rows.length === 0 ? /* @__PURE__ */ jsx7(Table.Row, { children: /* @__PURE__ */ jsx7(Table.Cell, { colSpan: columns.length + actionCount, children: /* @__PURE__ */ jsx7(Text3, { minH: "140px", display: "grid", placeItems: "center", color: "#98A2B3", fontSize: "12px", children: "Nenhum registro encontrado." }) }) }) : rows.map((row, index) => /* @__PURE__ */ jsxs3(Table.Row, { bg: index % 2 ? "#FBFCFD" : "white", _hover: { bg: "#F0F7FF" }, children: [
|
|
979
|
-
columns.map((column) => /* @__PURE__ */ jsx7(Table.Cell, { maxW: "250px", h: "42px", px: "10px", py: "8px", overflow: "hidden", color: "#52606D", borderBottomWidth: "1px", borderColor: "#EEF1F3", fontSize: "11px", textOverflow: "ellipsis", whiteSpace: "nowrap", children: renderColumnCell(row, column, cellRenderers) }, column.field)),
|
|
980
979
|
actionCount ? /* @__PURE__ */ jsx7(Table.Cell, { h: "42px", px: "10px", py: "5px", borderBottomWidth: "1px", borderColor: "#EEF1F3", textAlign: "center", children: /* @__PURE__ */ jsxs3(Flex2, { justify: "center", gap: "5px", children: [
|
|
981
980
|
onEdit ? /* @__PURE__ */ jsx7(Button2, { type: "button", "aria-label": "Editar", w: "31px", minW: "31px", h: "31px", p: 0, color: "#667085", bg: "white", borderWidth: "1px", borderColor: "#E5E9ED", borderRadius: "6px", onClick: () => onEdit(row), _hover: { color: "#036491", bg: "#F0F7FF", borderColor: "#B8D9EB" }, children: /* @__PURE__ */ jsx7(EditIcon, {}) }) : null,
|
|
982
981
|
onDelete ? /* @__PURE__ */ jsx7(Button2, { type: "button", "aria-label": "Excluir", w: "31px", minW: "31px", h: "31px", p: 0, color: "#667085", bg: "white", borderWidth: "1px", borderColor: "#E5E9ED", borderRadius: "6px", onClick: () => onDelete(row), _hover: { color: "#B42318", bg: "#FFF5F5", borderColor: "#FECACA" }, children: /* @__PURE__ */ jsx7(TrashIcon, {}) }) : null,
|
|
983
982
|
renderRowActions?.(row)
|
|
984
|
-
] }) }) : null
|
|
983
|
+
] }) }) : null,
|
|
984
|
+
columns.map((column) => /* @__PURE__ */ jsx7(Table.Cell, { maxW: "250px", h: "42px", px: "10px", py: "8px", overflow: "hidden", color: "#52606D", borderBottomWidth: "1px", borderColor: "#EEF1F3", fontSize: "11px", textOverflow: "ellipsis", whiteSpace: "nowrap", children: renderColumnCell(row, column, cellRenderers) }, column.field))
|
|
985
985
|
] }, row._id ?? index)) })
|
|
986
986
|
] }) }),
|
|
987
987
|
/* @__PURE__ */ jsxs3(Flex2, { minH: "56px", px: "14px", py: "10px", align: "center", justify: "flex-end", gap: "18px", color: "#7B8794", borderTopWidth: "1px", borderColor: "#E5E9ED", fontSize: "10px", flexWrap: "wrap", children: [
|
|
@@ -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.72",
|
|
4589
4622
|
repository: {
|
|
4590
4623
|
type: "git",
|
|
4591
4624
|
url: "git+https://github.com/oondemand/oon-platform.git",
|