impact-nova 1.5.0 → 1.5.3
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.
|
@@ -24,6 +24,8 @@ export interface LinkCellRendererProps extends ICellRendererParams {
|
|
|
24
24
|
tooltipField?: string;
|
|
25
25
|
/** Whether to disable link behavior on pinned rows (default: true) */
|
|
26
26
|
disableOnPinnedRows?: boolean;
|
|
27
|
+
/** When true, text is plain (no blue/link styling) and click does nothing */
|
|
28
|
+
disableLinkStyle?: boolean;
|
|
27
29
|
/** Validation rules for disabling the link */
|
|
28
30
|
validationRules?: ValidationRules;
|
|
29
31
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { useMemo as S, useCallback as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { evaluateValidationRules as
|
|
5
|
-
import { getIconComponent as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as c, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as S, useCallback as T } from "react";
|
|
3
|
+
import { Badge as V } from "../../badge.js";
|
|
4
|
+
import { evaluateValidationRules as I, getFieldValue as m, mapBadgeVariant as L, mapBadgeColor as U } from "./cell-renderer-utils.js";
|
|
5
|
+
import { getIconComponent as H } from "../../../../icons/index.js";
|
|
6
|
+
import { Tooltip as _, TooltipTrigger as z, TooltipContent as M } from "../../tooltip.js";
|
|
7
|
+
const Q = (e, t, r, a) => {
|
|
8
8
|
if (!t) return e;
|
|
9
9
|
let l = e;
|
|
10
10
|
return l = l.replace(/\$\{value\}/g, String(a ?? "")), l = l.replace(/\$\{field\}/g, String(r ?? "")), Object.keys(t).forEach((i) => {
|
|
11
11
|
const o = new RegExp(`\\$\\{${i}\\}`, "g");
|
|
12
12
|
l = l.replace(o, String(t[i] ?? ""));
|
|
13
13
|
}), l;
|
|
14
|
-
},
|
|
14
|
+
}, W = ({
|
|
15
15
|
iconConfig: e,
|
|
16
16
|
rowData: t,
|
|
17
17
|
rowId: r,
|
|
@@ -19,8 +19,8 @@ const M = (e, t, r, a) => {
|
|
|
19
19
|
}) => {
|
|
20
20
|
let l = null;
|
|
21
21
|
const i = m(e.iconField, e.icon, t);
|
|
22
|
-
if (typeof i == "string" ? l =
|
|
23
|
-
const o = m(e.backgroundColorField, e.backgroundColor, t), s = m(e.colorField, e.color, t) ?? "#60697D",
|
|
22
|
+
if (typeof i == "string" ? l = H(i, { size: 16 }) : l = i, !l) return null;
|
|
23
|
+
const o = m(e.backgroundColorField, e.backgroundColor, t), s = m(e.colorField, e.color, t) ?? "#60697D", f = m(e.tooltipField, e.tooltip, t), h = /* @__PURE__ */ c(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
26
|
className: `flex items-center justify-center ${e.onClick ? "cursor-pointer" : ""} ${e.showOnHover ? "opacity-0 group-hover:opacity-100 transition-opacity" : ""}`,
|
|
@@ -37,11 +37,11 @@ const M = (e, t, r, a) => {
|
|
|
37
37
|
children: l
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
-
return
|
|
41
|
-
/* @__PURE__ */ c(
|
|
42
|
-
/* @__PURE__ */ c(
|
|
43
|
-
] }) :
|
|
44
|
-
},
|
|
40
|
+
return f ? /* @__PURE__ */ w(_, { children: [
|
|
41
|
+
/* @__PURE__ */ c(z, { asChild: !0, children: h }),
|
|
42
|
+
/* @__PURE__ */ c(M, { variant: "tertiary", side: e.tooltipSide || "top", children: f })
|
|
43
|
+
] }) : h;
|
|
44
|
+
}, q = ({
|
|
45
45
|
badgeConfig: e,
|
|
46
46
|
rowData: t,
|
|
47
47
|
rowId: r,
|
|
@@ -51,16 +51,16 @@ const M = (e, t, r, a) => {
|
|
|
51
51
|
if (!l) return null;
|
|
52
52
|
const i = m(e.colorField, e.color, t), o = m(e.variantField, e.variant, t);
|
|
53
53
|
return /* @__PURE__ */ c(
|
|
54
|
-
|
|
54
|
+
V,
|
|
55
55
|
{
|
|
56
56
|
className: "font-medium",
|
|
57
|
-
color:
|
|
58
|
-
variant:
|
|
57
|
+
color: U(i),
|
|
58
|
+
variant: L(o),
|
|
59
59
|
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData: t ?? {} }) : void 0,
|
|
60
60
|
children: l
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
},
|
|
63
|
+
}, A = (e) => {
|
|
64
64
|
const {
|
|
65
65
|
value: t,
|
|
66
66
|
data: r,
|
|
@@ -69,39 +69,40 @@ const M = (e, t, r, a) => {
|
|
|
69
69
|
onClick: i,
|
|
70
70
|
redirectUrl: o,
|
|
71
71
|
updateQueryParams: s,
|
|
72
|
-
navigate:
|
|
73
|
-
setSearchParams:
|
|
72
|
+
navigate: f,
|
|
73
|
+
setSearchParams: h,
|
|
74
74
|
rightSideContent: v,
|
|
75
75
|
valueFormatter: k,
|
|
76
76
|
disableOnPinnedRows: b = !0,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
disableLinkStyle: $,
|
|
78
|
+
validationRules: R
|
|
79
|
+
} = e, y = a.id ?? String(r?.id ?? ""), d = l?.field ?? "", E = r && typeof r == "object" && "_isPinned" in r && r._isPinned === !0, F = S(() => $ || b && E || I(R, r) ? !1 : !!(s || o || i), [$, b, E, s, o, i, R, r]), C = T(
|
|
79
80
|
(u) => {
|
|
80
|
-
if (u.stopPropagation(), s &&
|
|
81
|
-
|
|
81
|
+
if (u.stopPropagation(), s && h)
|
|
82
|
+
h((n) => {
|
|
82
83
|
const g = new URLSearchParams(n);
|
|
83
|
-
return Object.entries(s).forEach(([x,
|
|
84
|
-
let p = String(
|
|
85
|
-
p = p.replace(/\$\{value\}/g, String(t ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((
|
|
86
|
-
const
|
|
87
|
-
p = p.replace(
|
|
84
|
+
return Object.entries(s).forEach(([x, B]) => {
|
|
85
|
+
let p = String(B);
|
|
86
|
+
p = p.replace(/\$\{value\}/g, String(t ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((j) => {
|
|
87
|
+
const O = new RegExp(`\\$\\{${j}\\}`, "g");
|
|
88
|
+
p = p.replace(O, String(r[j] ?? ""));
|
|
88
89
|
}), g.set(x, p);
|
|
89
90
|
}), g;
|
|
90
91
|
});
|
|
91
|
-
else if (o &&
|
|
92
|
-
const n =
|
|
93
|
-
|
|
92
|
+
else if (o && f) {
|
|
93
|
+
const n = Q(o, r, d, t);
|
|
94
|
+
f(n);
|
|
94
95
|
} else i && i({ rowId: y, field: d, rowData: r ?? {}, value: t });
|
|
95
96
|
},
|
|
96
|
-
[s,
|
|
97
|
-
),
|
|
97
|
+
[s, h, o, f, i, r, d, t, y]
|
|
98
|
+
), N = S(() => k ? k(t, r ?? {}) : String(t ?? ""), [t, k, r]), P = S(() => {
|
|
98
99
|
if (!v?.items || v.items.length === 0) return null;
|
|
99
100
|
const u = [];
|
|
100
101
|
return v.items.forEach((n, g) => {
|
|
101
102
|
if (n.type === "icon" && n.icon)
|
|
102
103
|
u.push(
|
|
103
104
|
/* @__PURE__ */ c(
|
|
104
|
-
|
|
105
|
+
W,
|
|
105
106
|
{
|
|
106
107
|
iconConfig: n.icon,
|
|
107
108
|
rowData: r,
|
|
@@ -114,7 +115,7 @@ const M = (e, t, r, a) => {
|
|
|
114
115
|
else if (n.type === "badge" && n.badge)
|
|
115
116
|
u.push(
|
|
116
117
|
/* @__PURE__ */ c(
|
|
117
|
-
|
|
118
|
+
q,
|
|
118
119
|
{
|
|
119
120
|
badgeConfig: n.badge,
|
|
120
121
|
rowData: r,
|
|
@@ -130,19 +131,19 @@ const M = (e, t, r, a) => {
|
|
|
130
131
|
}
|
|
131
132
|
}), u.length > 0 ? u : null;
|
|
132
133
|
}, [v, r, y, d]);
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ w("div", { className: "w-full h-full flex items-center justify-between gap-2 group ag-cell-inner-padding", children: [
|
|
134
135
|
/* @__PURE__ */ c(
|
|
135
136
|
"div",
|
|
136
137
|
{
|
|
137
|
-
className: `flex-1 truncate ${
|
|
138
|
-
onClick:
|
|
139
|
-
children:
|
|
138
|
+
className: `flex-1 truncate min-w-0 ${F ? "text-blue-600 cursor-pointer hover:underline font-medium" : ""}`,
|
|
139
|
+
onClick: F ? C : void 0,
|
|
140
|
+
children: N
|
|
140
141
|
}
|
|
141
142
|
),
|
|
142
|
-
|
|
143
|
+
P && /* @__PURE__ */ c("div", { className: "flex items-center gap-1 flex-shrink-0", children: P })
|
|
143
144
|
] });
|
|
144
145
|
};
|
|
145
|
-
|
|
146
|
+
A.displayName = "LinkCellRenderer";
|
|
146
147
|
export {
|
|
147
|
-
|
|
148
|
+
A as LinkCellRenderer
|
|
148
149
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-nova",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|