@oondemand/oon-core-front 0.3.70 → 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 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
- px: isWorkStatus ? "12px" : "9px",
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
- action.label
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.70",
4621
+ version: "0.3.71",
4589
4622
  repository: {
4590
4623
  type: "git",
4591
4624
  url: "git+https://github.com/oondemand/oon-platform.git",