impact-nova 1.5.5 → 1.5.7
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/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +39 -32
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +47 -47
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/select-cell-editor.js +39 -36
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +39 -39
- package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +18 -12
- package/dist/components/ui/badge.d.ts +2 -1
- package/dist/components/ui/badge.js +17 -12
- package/dist/components/ui/calendar.js +3 -2
- package/dist/components/ui/command-palette/command-palette.d.ts +20 -4
- package/dist/components/ui/command-palette/command-palette.js +210 -180
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +14 -3
- package/dist/components/ui/command-palette/shortcut-settings.js +97 -90
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +24 -22
- package/dist/components/ui/filter-strip/filter-tag-list.js +4 -4
- package/dist/components/ui/select/select.js +41 -41
- package/dist/components/ui/tabs.js +46 -45
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +108 -107
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,53 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import "lucide-react";
|
|
3
|
-
const
|
|
4
|
-
if (
|
|
3
|
+
const w = (i, r) => {
|
|
4
|
+
if (i == null || i === "") return "";
|
|
5
5
|
try {
|
|
6
|
-
const
|
|
7
|
-
return isNaN(
|
|
6
|
+
const e = i instanceof Date ? i : new Date(String(i));
|
|
7
|
+
return isNaN(e.getTime()) ? String(i) : r === "time" ? e.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) : r === "datetime-local" ? e.toLocaleString(void 0, {
|
|
8
8
|
year: "numeric",
|
|
9
9
|
month: "short",
|
|
10
10
|
day: "numeric",
|
|
11
11
|
hour: "2-digit",
|
|
12
12
|
minute: "2-digit"
|
|
13
|
-
}) :
|
|
13
|
+
}) : e.toLocaleDateString(void 0, {
|
|
14
14
|
year: "numeric",
|
|
15
15
|
month: "short",
|
|
16
16
|
day: "numeric"
|
|
17
17
|
});
|
|
18
18
|
} catch {
|
|
19
|
-
return String(
|
|
19
|
+
return String(i);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, y = (i) => {
|
|
22
22
|
const {
|
|
23
23
|
valueFormatted: r,
|
|
24
|
-
value:
|
|
25
|
-
dateType:
|
|
26
|
-
placeholder:
|
|
27
|
-
disabled:
|
|
28
|
-
colDef:
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
value: e,
|
|
25
|
+
dateType: p = "date",
|
|
26
|
+
placeholder: m = "Select date...",
|
|
27
|
+
disabled: o,
|
|
28
|
+
colDef: n,
|
|
29
|
+
data: l
|
|
30
|
+
} = i, d = e && typeof e == "object" && "cellMetadata" in e ? e.cellMetadata?._isDisabled : void 0, s = l && typeof l == "object" && "rowMetadata" in l ? l.rowMetadata?._isDisabled : void 0;
|
|
31
|
+
let a = !1;
|
|
32
|
+
if (!o) {
|
|
33
|
+
const b = n?._originalEditable;
|
|
34
|
+
n?.editable === !1 ? a = !1 : d === !1 ? a = !0 : d === !0 ? a = !1 : s === !1 ? a = !0 : s === !0 ? a = !1 : a = b === !0 || n?.editable === !0;
|
|
35
|
+
}
|
|
36
|
+
const c = e && typeof e == "object" && "value" in e, g = c ? e.value : e, h = (c ? null : r) ?? w(g, p), u = !h;
|
|
37
|
+
return /* @__PURE__ */ t(
|
|
31
38
|
"div",
|
|
32
39
|
{
|
|
33
|
-
className: `w-full h-full flex items-center ag-cell-inner-padding ${
|
|
34
|
-
children: /* @__PURE__ */
|
|
40
|
+
className: `w-full h-full flex items-center ag-cell-inner-padding ${o ? "opacity-60 cursor-not-allowed" : a ? "in-ag-editable-cell-highlight" : ""}`,
|
|
41
|
+
children: /* @__PURE__ */ f(
|
|
35
42
|
"div",
|
|
36
43
|
{
|
|
37
|
-
className:
|
|
44
|
+
className: `flex w-full items-center justify-between rounded-[8px] px-1.5 h-7 ${a ? "bg-white cursor-pointer" : "bg-inherit"}`,
|
|
38
45
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ t("span", { className: `truncate text-sm font-medium text-[#1f2b4d] ${u ? "text-[#dfe2e7]" : ""}`, children: u ? m : h }),
|
|
47
|
+
a && /* @__PURE__ */ t("span", { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground", children: /* @__PURE__ */ f("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
48
|
+
/* @__PURE__ */ t("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
49
|
+
/* @__PURE__ */ t("path", { d: "M16 2v4" }),
|
|
50
|
+
/* @__PURE__ */ t("path", { d: "M8 2v4" }),
|
|
51
|
+
/* @__PURE__ */ t("path", { d: "M3 10h18" }),
|
|
52
|
+
/* @__PURE__ */ t("path", { d: "M8 14h.01" }),
|
|
53
|
+
/* @__PURE__ */ t("path", { d: "M12 14h.01" }),
|
|
54
|
+
/* @__PURE__ */ t("path", { d: "M16 14h.01" }),
|
|
55
|
+
/* @__PURE__ */ t("path", { d: "M8 18h.01" }),
|
|
56
|
+
/* @__PURE__ */ t("path", { d: "M12 18h.01" }),
|
|
57
|
+
/* @__PURE__ */ t("path", { d: "M16 18h.01" })
|
|
51
58
|
] }) })
|
|
52
59
|
]
|
|
53
60
|
}
|
|
@@ -55,7 +62,7 @@ const u = (t, r) => {
|
|
|
55
62
|
}
|
|
56
63
|
);
|
|
57
64
|
};
|
|
58
|
-
|
|
65
|
+
y.displayName = "DateDisplayRenderer";
|
|
59
66
|
export {
|
|
60
|
-
|
|
67
|
+
y as DateDisplayRenderer
|
|
61
68
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Calendar as
|
|
4
|
-
const
|
|
5
|
-
if (!(
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useState as S, useImperativeHandle as P, useEffect as j, useCallback as u } from "react";
|
|
3
|
+
import { Calendar as I } from "../../../calendar.js";
|
|
4
|
+
const p = (o) => {
|
|
5
|
+
if (!(o == null || o === ""))
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
8
|
-
return isNaN(
|
|
7
|
+
const r = o instanceof Date ? o : new Date(String(o));
|
|
8
|
+
return isNaN(r.getTime()) ? void 0 : r;
|
|
9
9
|
} catch {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, O = N((o, r) => {
|
|
13
13
|
const {
|
|
14
|
-
value:
|
|
15
|
-
min:
|
|
16
|
-
max:
|
|
17
|
-
node:
|
|
18
|
-
column:
|
|
19
|
-
stopEditing:
|
|
20
|
-
} =
|
|
21
|
-
|
|
14
|
+
value: a,
|
|
15
|
+
min: m,
|
|
16
|
+
max: f,
|
|
17
|
+
node: l,
|
|
18
|
+
column: g,
|
|
19
|
+
stopEditing: h
|
|
20
|
+
} = o, s = a && typeof a == "object" && "value" in a, d = s ? a.cellMetadata : void 0, D = s ? a.value : a, v = p(D), [w, b] = S(v), [M, E] = S(v || /* @__PURE__ */ new Date());
|
|
21
|
+
P(r, () => ({
|
|
22
22
|
getValue() {
|
|
23
|
-
return
|
|
23
|
+
return a;
|
|
24
24
|
},
|
|
25
25
|
isCancelBeforeStart() {
|
|
26
26
|
return !1;
|
|
@@ -31,45 +31,45 @@ const d = (t) => {
|
|
|
31
31
|
isPopup() {
|
|
32
32
|
return !0;
|
|
33
33
|
}
|
|
34
|
-
})),
|
|
35
|
-
const e = "ag-custom-component-popup",
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
for (const
|
|
39
|
-
|
|
34
|
+
})), j(() => {
|
|
35
|
+
const e = "ag-custom-component-popup", i = (t) => {
|
|
36
|
+
t instanceof HTMLElement && t.hasAttribute("data-radix-popper-content-wrapper") && t.classList.add(e);
|
|
37
|
+
}, n = new MutationObserver((t) => {
|
|
38
|
+
for (const V of t)
|
|
39
|
+
V.addedNodes.forEach(i);
|
|
40
40
|
});
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
}), () =>
|
|
41
|
+
return n.observe(document.body, { childList: !0, subtree: !0 }), document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach((t) => {
|
|
42
|
+
t.classList.add(e);
|
|
43
|
+
}), () => n.disconnect();
|
|
44
44
|
}, []);
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
45
|
+
const c = u((e) => {
|
|
46
|
+
const i = g?.getColId();
|
|
47
|
+
if (i && l) {
|
|
48
|
+
const n = e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : null, t = s ? { value: n, ...d !== void 0 && { cellMetadata: d } } : n;
|
|
49
|
+
l.setDataValue(i, t);
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
51
|
+
h();
|
|
52
|
+
}, [g, l, h, s, d]), A = u((e) => {
|
|
53
|
+
b(e), c(e);
|
|
54
|
+
}, [c]), x = u(() => {
|
|
55
|
+
b(void 0), c(void 0);
|
|
56
|
+
}, [c]), y = m ? p(m) : void 0, L = f ? p(f) : void 0;
|
|
57
|
+
return /* @__PURE__ */ C("div", { className: "ag-custom-component-popup bg-white border border-input rounded-md shadow-lg", children: /* @__PURE__ */ C(
|
|
58
|
+
I,
|
|
59
59
|
{
|
|
60
60
|
mode: "single",
|
|
61
|
-
selected:
|
|
62
|
-
onSelect:
|
|
63
|
-
month:
|
|
64
|
-
onMonthChange:
|
|
65
|
-
disabled: { before:
|
|
61
|
+
selected: w,
|
|
62
|
+
onSelect: A,
|
|
63
|
+
month: M,
|
|
64
|
+
onMonthChange: E,
|
|
65
|
+
disabled: { before: y, after: L },
|
|
66
66
|
showFooter: !1,
|
|
67
|
-
onClear:
|
|
67
|
+
onClear: x,
|
|
68
68
|
captionLayout: "dropdown"
|
|
69
69
|
}
|
|
70
70
|
) });
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
O.displayName = "DateCellEditor";
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
O as DateCellEditor
|
|
75
75
|
};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x, useState as E, useRef as N, useImperativeHandle as O, useCallback as u } from "react";
|
|
3
|
+
import j from "../../../select/select.js";
|
|
4
|
+
const w = x((t, h) => {
|
|
5
5
|
const {
|
|
6
|
-
value:
|
|
7
|
-
options:
|
|
8
|
-
placeholder:
|
|
9
|
-
isSearchable:
|
|
10
|
-
isClearable:
|
|
11
|
-
stopEditing:
|
|
12
|
-
} = t, r =
|
|
6
|
+
value: l,
|
|
7
|
+
options: C = [],
|
|
8
|
+
placeholder: m = "Select...",
|
|
9
|
+
isSearchable: v = !0,
|
|
10
|
+
isClearable: b = !0,
|
|
11
|
+
stopEditing: o
|
|
12
|
+
} = t, n = l && typeof l == "object" && "value" in l, r = n ? l.cellMetadata : void 0, i = n ? l.value : l, c = C.map((e) => ({
|
|
13
13
|
value: e.value,
|
|
14
14
|
label: e.label,
|
|
15
15
|
isDisabled: e.isDisabled
|
|
16
|
-
})), [
|
|
17
|
-
|
|
18
|
-
),
|
|
19
|
-
|
|
16
|
+
})), [s, d] = E(
|
|
17
|
+
i != null ? String(i) : null
|
|
18
|
+
), f = N(!1);
|
|
19
|
+
O(h, () => ({
|
|
20
20
|
getValue() {
|
|
21
|
-
return
|
|
21
|
+
return n ? {
|
|
22
|
+
value: s,
|
|
23
|
+
...r !== void 0 && { cellMetadata: r }
|
|
24
|
+
} : s;
|
|
22
25
|
},
|
|
23
26
|
isCancelBeforeStart() {
|
|
24
27
|
return !1;
|
|
@@ -30,27 +33,27 @@ const N = v((t, f) => {
|
|
|
30
33
|
return !0;
|
|
31
34
|
}
|
|
32
35
|
}));
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
+
const S = c.find((e) => e.value === s) ?? null, a = u(() => {
|
|
37
|
+
f.current || (f.current = !0, o());
|
|
38
|
+
}, [o]), M = u(
|
|
36
39
|
(e) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
40
|
+
const p = e ? e.value : null;
|
|
41
|
+
d(p), t.onValueChange?.(p), a();
|
|
39
42
|
},
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
43
|
+
[a, d, t.onValueChange]
|
|
44
|
+
), V = u(() => {
|
|
45
|
+
a();
|
|
46
|
+
}, [a]);
|
|
47
|
+
return /* @__PURE__ */ g("div", { className: "w-full h-full flex items-center ag-cell-inner-padding ag-editable-cell-highlight", children: /* @__PURE__ */ g(
|
|
48
|
+
j,
|
|
46
49
|
{
|
|
47
|
-
options:
|
|
48
|
-
value:
|
|
49
|
-
onChange:
|
|
50
|
-
onMenuClose:
|
|
51
|
-
placeholder:
|
|
52
|
-
isSearchable:
|
|
53
|
-
isClearable:
|
|
50
|
+
options: c,
|
|
51
|
+
value: S,
|
|
52
|
+
onChange: M,
|
|
53
|
+
onMenuClose: V,
|
|
54
|
+
placeholder: m,
|
|
55
|
+
isSearchable: v,
|
|
56
|
+
isClearable: b,
|
|
54
57
|
isMulti: !1,
|
|
55
58
|
defaultMenuIsOpen: !0,
|
|
56
59
|
className: "!border-none !shadow-none !ring-0 !h-7 !rounded-[8px] !px-1.5",
|
|
@@ -58,7 +61,7 @@ const N = v((t, f) => {
|
|
|
58
61
|
}
|
|
59
62
|
) });
|
|
60
63
|
});
|
|
61
|
-
|
|
64
|
+
w.displayName = "SelectCellEditor";
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
w as SelectCellEditor
|
|
64
67
|
};
|
|
@@ -4,23 +4,23 @@ import { Badge as V } from "../../badge.js";
|
|
|
4
4
|
import { evaluateValidationRules as I, getFieldValue as m, mapBadgeVariant as L, mapBadgeColor as U } from "./cell-renderer-utils.js";
|
|
5
5
|
import { getIconComponent as H } from "../../../../icons/index.js";
|
|
6
6
|
import { Tooltip as _, TooltipTrigger as z, TooltipContent as M } from "../../tooltip.js";
|
|
7
|
-
const Q = (e,
|
|
8
|
-
if (!
|
|
9
|
-
let
|
|
10
|
-
return
|
|
7
|
+
const Q = (e, l, r, a) => {
|
|
8
|
+
if (!l) return e;
|
|
9
|
+
let t = e;
|
|
10
|
+
return t = t.replace(/\$\{value\}/g, String(a ?? "")), t = t.replace(/\$\{field\}/g, String(r ?? "")), Object.keys(l).forEach((i) => {
|
|
11
11
|
const o = new RegExp(`\\$\\{${i}\\}`, "g");
|
|
12
|
-
|
|
13
|
-
}),
|
|
12
|
+
t = t.replace(o, String(l[i] ?? ""));
|
|
13
|
+
}), t;
|
|
14
14
|
}, W = ({
|
|
15
15
|
iconConfig: e,
|
|
16
|
-
rowData:
|
|
16
|
+
rowData: l,
|
|
17
17
|
rowId: r,
|
|
18
18
|
field: a
|
|
19
19
|
}) => {
|
|
20
|
-
let
|
|
21
|
-
const i = m(e.iconField, e.icon,
|
|
22
|
-
if (typeof i == "string" ?
|
|
23
|
-
const o = m(e.backgroundColorField, e.backgroundColor,
|
|
20
|
+
let t = null;
|
|
21
|
+
const i = m(e.iconField, e.icon, l);
|
|
22
|
+
if (typeof i == "string" ? t = H(i, { size: 16 }) : t = i, !t) return null;
|
|
23
|
+
const o = m(e.backgroundColorField, e.backgroundColor, l), s = m(e.colorField, e.color, l) ?? "#60697D", f = m(e.tooltipField, e.tooltip, l), g = /* @__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" : ""}`,
|
|
@@ -33,72 +33,72 @@ const Q = (e, t, r, a) => {
|
|
|
33
33
|
minHeight: "18px",
|
|
34
34
|
color: s
|
|
35
35
|
},
|
|
36
|
-
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData:
|
|
37
|
-
children:
|
|
36
|
+
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData: l ?? {} }) : void 0,
|
|
37
|
+
children: t
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
return f ? /* @__PURE__ */ w(_, { children: [
|
|
41
|
-
/* @__PURE__ */ c(z, { asChild: !0, children:
|
|
41
|
+
/* @__PURE__ */ c(z, { asChild: !0, children: g }),
|
|
42
42
|
/* @__PURE__ */ c(M, { variant: "tertiary", side: e.tooltipSide || "top", children: f })
|
|
43
|
-
] }) :
|
|
43
|
+
] }) : null;
|
|
44
44
|
}, q = ({
|
|
45
45
|
badgeConfig: e,
|
|
46
|
-
rowData:
|
|
46
|
+
rowData: l,
|
|
47
47
|
rowId: r,
|
|
48
48
|
field: a
|
|
49
49
|
}) => {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
const i = m(e.colorField, e.color,
|
|
50
|
+
const t = m(e.labelField, e.label, l);
|
|
51
|
+
if (!t) return null;
|
|
52
|
+
const i = m(e.colorField, e.color, l), o = m(e.variantField, e.variant, l);
|
|
53
53
|
return /* @__PURE__ */ c(
|
|
54
54
|
V,
|
|
55
55
|
{
|
|
56
56
|
className: "font-medium",
|
|
57
57
|
color: U(i),
|
|
58
58
|
variant: L(o),
|
|
59
|
-
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData:
|
|
60
|
-
children:
|
|
59
|
+
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData: l ?? {} }) : void 0,
|
|
60
|
+
children: t
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
63
|
}, A = (e) => {
|
|
64
64
|
const {
|
|
65
|
-
value:
|
|
65
|
+
value: l,
|
|
66
66
|
data: r,
|
|
67
67
|
node: a,
|
|
68
|
-
colDef:
|
|
68
|
+
colDef: t,
|
|
69
69
|
onClick: i,
|
|
70
70
|
redirectUrl: o,
|
|
71
71
|
updateQueryParams: s,
|
|
72
72
|
navigate: f,
|
|
73
|
-
setSearchParams:
|
|
73
|
+
setSearchParams: g,
|
|
74
74
|
rightSideContent: v,
|
|
75
75
|
valueFormatter: k,
|
|
76
76
|
disableOnPinnedRows: b = !0,
|
|
77
77
|
disableLinkStyle: $,
|
|
78
78
|
validationRules: R
|
|
79
|
-
} = e, y = a.id ?? String(r?.id ?? ""), d =
|
|
79
|
+
} = e, y = a.id ?? String(r?.id ?? ""), d = t?.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(
|
|
80
80
|
(u) => {
|
|
81
|
-
if (u.stopPropagation(), s &&
|
|
82
|
-
|
|
83
|
-
const
|
|
81
|
+
if (u.stopPropagation(), s && g)
|
|
82
|
+
g((n) => {
|
|
83
|
+
const h = new URLSearchParams(n);
|
|
84
84
|
return Object.entries(s).forEach(([x, B]) => {
|
|
85
85
|
let p = String(B);
|
|
86
|
-
p = p.replace(/\$\{value\}/g, String(
|
|
86
|
+
p = p.replace(/\$\{value\}/g, String(l ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((j) => {
|
|
87
87
|
const O = new RegExp(`\\$\\{${j}\\}`, "g");
|
|
88
88
|
p = p.replace(O, String(r[j] ?? ""));
|
|
89
|
-
}),
|
|
90
|
-
}),
|
|
89
|
+
}), h.set(x, p);
|
|
90
|
+
}), h;
|
|
91
91
|
});
|
|
92
92
|
else if (o && f) {
|
|
93
|
-
const n = Q(o, r, d,
|
|
93
|
+
const n = Q(o, r, d, l);
|
|
94
94
|
f(n);
|
|
95
|
-
} else i && i({ rowId: y, field: d, rowData: r ?? {}, value:
|
|
95
|
+
} else i && i({ rowId: y, field: d, rowData: r ?? {}, value: l });
|
|
96
96
|
},
|
|
97
|
-
[s,
|
|
98
|
-
), N = S(() => k ? k(
|
|
97
|
+
[s, g, o, f, i, r, d, l, y]
|
|
98
|
+
), N = S(() => k ? k(l, r ?? {}) : String(l ?? ""), [l, k, r]), P = S(() => {
|
|
99
99
|
if (!v?.items || v.items.length === 0) return null;
|
|
100
100
|
const u = [];
|
|
101
|
-
return v.items.forEach((n,
|
|
101
|
+
return v.items.forEach((n, h) => {
|
|
102
102
|
if (n.type === "icon" && n.icon)
|
|
103
103
|
u.push(
|
|
104
104
|
/* @__PURE__ */ c(
|
|
@@ -109,7 +109,7 @@ const Q = (e, t, r, a) => {
|
|
|
109
109
|
rowId: y,
|
|
110
110
|
field: d
|
|
111
111
|
},
|
|
112
|
-
`icon-${
|
|
112
|
+
`icon-${h}`
|
|
113
113
|
)
|
|
114
114
|
);
|
|
115
115
|
else if (n.type === "badge" && n.badge)
|
|
@@ -122,12 +122,12 @@ const Q = (e, t, r, a) => {
|
|
|
122
122
|
rowId: y,
|
|
123
123
|
field: d
|
|
124
124
|
},
|
|
125
|
-
`badge-${
|
|
125
|
+
`badge-${h}`
|
|
126
126
|
)
|
|
127
127
|
);
|
|
128
128
|
else if (n.type === "dynamic" && n.dynamic) {
|
|
129
129
|
const x = typeof n.dynamic == "function" ? n.dynamic(r ?? {}) : n.dynamic;
|
|
130
|
-
u.push(/* @__PURE__ */ c("span", { children: x }, `dyn-${
|
|
130
|
+
u.push(/* @__PURE__ */ c("span", { children: x }, `dyn-${h}`));
|
|
131
131
|
}
|
|
132
132
|
}), u.length > 0 ? u : null;
|
|
133
133
|
}, [v, r, y, d]);
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ChevronDown as
|
|
3
|
-
const
|
|
4
|
-
const { value: e, options:
|
|
5
|
-
|
|
1
|
+
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown as g } from "lucide-react";
|
|
3
|
+
const h = (u) => {
|
|
4
|
+
const { value: e, options: b = [], placeholder: p = "Select...", disabled: o, colDef: i, data: t } = u, r = e && typeof e == "object" && "cellMetadata" in e ? e.cellMetadata?._isDisabled : void 0, d = t && typeof t == "object" && "rowMetadata" in t ? t.rowMetadata?._isDisabled : void 0;
|
|
5
|
+
let l = !1;
|
|
6
|
+
if (!o) {
|
|
7
|
+
const s = i?._originalEditable;
|
|
8
|
+
i?.editable === !1 ? l = !1 : r === !1 ? l = !0 : r === !0 ? l = !1 : d === !1 ? l = !0 : d === !0 ? l = !1 : l = s === !0 || i?.editable === !0;
|
|
9
|
+
}
|
|
10
|
+
const a = e && typeof e == "object" && "value" in e ? e.value : e, c = b.find((s) => s.value === String(a ?? ""))?.label ?? (a != null && a !== "" ? String(a) : ""), f = !c;
|
|
11
|
+
return /* @__PURE__ */ n(
|
|
6
12
|
"div",
|
|
7
13
|
{
|
|
8
|
-
className: `w-full h-full flex items-center ag-cell-inner-padding ${
|
|
9
|
-
children: /* @__PURE__ */
|
|
14
|
+
className: `w-full h-full flex items-center ag-cell-inner-padding ${o ? "opacity-60 cursor-not-allowed" : l ? "in-ag-editable-cell-highlight" : ""}`,
|
|
15
|
+
children: /* @__PURE__ */ m(
|
|
10
16
|
"div",
|
|
11
17
|
{
|
|
12
|
-
className:
|
|
18
|
+
className: `flex w-full items-center justify-between rounded-[8px] px-1.5 h-7 ${l ? "bg-white cursor-pointer" : "bg-inherit"}`,
|
|
13
19
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ n("span", { className: `truncate text-sm font-medium text-[#1f2b4d] ${f ? "text-[#dfe2e7]" : ""}`, children: f ? p : c }),
|
|
21
|
+
l && /* @__PURE__ */ n(g, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
|
|
16
22
|
]
|
|
17
23
|
}
|
|
18
24
|
)
|
|
19
25
|
}
|
|
20
26
|
);
|
|
21
27
|
};
|
|
22
|
-
|
|
28
|
+
h.displayName = "SelectDisplayRenderer";
|
|
23
29
|
export {
|
|
24
|
-
|
|
30
|
+
h as SelectDisplayRenderer
|
|
25
31
|
};
|
|
@@ -3,8 +3,9 @@ import * as React from "react";
|
|
|
3
3
|
declare const badgeVariants: (props?: {
|
|
4
4
|
variant?: "solid" | "outline" | "subtle";
|
|
5
5
|
color?: "primary" | "destructive" | "warning" | "success" | "neutral";
|
|
6
|
+
shape?: "circle" | "square";
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
7
8
|
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof badgeVariants> {
|
|
8
9
|
}
|
|
9
|
-
declare function Badge({ className, variant, color, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Badge({ className, variant, color, shape, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export { Badge, badgeVariants };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
"inline-flex items-center
|
|
3
|
+
import { cva as o } from "class-variance-authority";
|
|
4
|
+
import { cn as i } from "../../lib/utils.js";
|
|
5
|
+
const c = o(
|
|
6
|
+
"inline-flex items-center border px-2.5 py-0.5 text-sm leading-[18px] font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -17,6 +17,10 @@ const i = n(
|
|
|
17
17
|
warning: "",
|
|
18
18
|
destructive: "",
|
|
19
19
|
neutral: ""
|
|
20
|
+
},
|
|
21
|
+
shape: {
|
|
22
|
+
circle: "rounded-full",
|
|
23
|
+
square: "rounded"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
compoundVariants: [
|
|
@@ -41,21 +45,22 @@ const i = n(
|
|
|
41
45
|
],
|
|
42
46
|
defaultVariants: {
|
|
43
47
|
variant: "solid",
|
|
44
|
-
color: "primary"
|
|
48
|
+
color: "primary",
|
|
49
|
+
shape: "circle"
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
|
-
function
|
|
49
|
-
return /* @__PURE__ */
|
|
53
|
+
function m({ className: r, variant: t, color: a, shape: e, ...s }) {
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
50
55
|
"div",
|
|
51
56
|
{
|
|
52
|
-
className:
|
|
57
|
+
className: i(c({ variant: t, color: a, shape: e }), r),
|
|
53
58
|
"data-component": "badge",
|
|
54
|
-
...
|
|
59
|
+
...s
|
|
55
60
|
}
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
m as Badge,
|
|
65
|
+
c as badgeVariants
|
|
61
66
|
};
|
|
@@ -4,12 +4,13 @@ import { ChevronLeftIcon as we, ChevronRightIcon as ye } from "lucide-react";
|
|
|
4
4
|
import { getDefaultClassNames as Fe, DayPicker as He } from "react-day-picker";
|
|
5
5
|
import { cn as f } from "../../lib/utils.js";
|
|
6
6
|
import { Button as A } from "./button.js";
|
|
7
|
+
import "./button-variants.js";
|
|
7
8
|
import ce from "./select/select.js";
|
|
8
9
|
import { FISCAL_PATTERNS as Be, resolveWeekSelection as Te } from "../../lib/fiscal-calendar.js";
|
|
9
10
|
import { getIntlLocale as We, getDateFnsLocale as qe } from "../../i18n/getDateFnsLocale.js";
|
|
10
11
|
import { useImpactNovaI18n as Ge } from "../../i18n/ImpactNovaI18nContext.js";
|
|
11
12
|
const fe = u.createContext(0);
|
|
12
|
-
function
|
|
13
|
+
function st({
|
|
13
14
|
className: ae,
|
|
14
15
|
classNames: J,
|
|
15
16
|
showOutsideDays: D = !1,
|
|
@@ -750,6 +751,6 @@ function Je({
|
|
|
750
751
|
);
|
|
751
752
|
}
|
|
752
753
|
export {
|
|
753
|
-
|
|
754
|
+
st as Calendar,
|
|
754
755
|
Je as CalendarDayButton
|
|
755
756
|
};
|