impact-nova 2.5.20 → 2.5.22
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/data/data-table/build-column-tree-from-grid.d.ts +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +52 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +1 -0
- package/dist/components/data/data-table/column-picker-authority.js +61 -59
- package/dist/components/data/data-table/column-savability.d.ts +3 -0
- package/dist/components/data/data-table/column-savability.js +10 -0
- package/dist/components/data/data-table/data-table-column-list.js +117 -89
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +1 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +23 -22
- package/dist/components/data/data-table/index.d.ts +2 -0
- package/dist/components/data/data-table/index.js +32 -28
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +14 -13
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +6 -2
- package/dist/components/data-display/calendar/calendar-available-view.js +18 -19
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +33 -33
- package/dist/components/data-display/calendar/calendar-year-panes.js +68 -58
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +13 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +60 -51
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/form-react/Fields/TextFieldWithBackendValidation.js +27 -26
- package/dist/form-react/types/fields.types.d.ts +5 -0
- package/dist/index.js +273 -269
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,64 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { CalendarPeriodCell as
|
|
6
|
-
import { PERIOD_RANGE_GRID_CLASSNAME as
|
|
7
|
-
import { getYearRangeProps as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
pickerYear:
|
|
11
|
-
resolvedStartYear:
|
|
12
|
-
resolvedEndYear:
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight as u } from "impact-nova-icons";
|
|
3
|
+
import { cn as S } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as x } from "../../primitives/button/button.js";
|
|
5
|
+
import { CalendarPeriodCell as Y } from "./calendar-period-cell.js";
|
|
6
|
+
import { PERIOD_RANGE_GRID_CLASSNAME as Z } from "./calendar-selection-appearance.js";
|
|
7
|
+
import { getYearPageYears as D, yearPageHasSelectableYear as E, getYearRangeProps as W, isYearRangeSelection as q } from "./calendar-year-utils.js";
|
|
8
|
+
const F = 12, J = 6, K = "w-[320px] min-w-[320px] max-w-[320px]";
|
|
9
|
+
function ot({
|
|
10
|
+
pickerYear: A,
|
|
11
|
+
resolvedStartYear: c,
|
|
12
|
+
resolvedEndYear: a,
|
|
13
13
|
previousYearLabel: R,
|
|
14
|
-
nextYearLabel:
|
|
15
|
-
yearLabels:
|
|
14
|
+
nextYearLabel: _,
|
|
15
|
+
yearLabels: l,
|
|
16
16
|
yearCaptions: p,
|
|
17
17
|
showFooter: v = !0,
|
|
18
|
-
pendingYearSelection:
|
|
19
|
-
selectedYear:
|
|
20
|
-
isYearSelected:
|
|
21
|
-
isYearDisabled:
|
|
22
|
-
onYearPageChange:
|
|
23
|
-
onYearClick:
|
|
18
|
+
pendingYearSelection: P,
|
|
19
|
+
selectedYear: w,
|
|
20
|
+
isYearSelected: C,
|
|
21
|
+
isYearDisabled: r,
|
|
22
|
+
onYearPageChange: g,
|
|
23
|
+
onYearClick: B
|
|
24
24
|
}) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const s = !!p, t = s ? J : F, n = Math.floor(A / t) * t, G = n + t - 1, i = D(n, t), h = i[0] ?? n, f = i[i.length - 1] ?? G, d = v ? P : w, N = q(d) ? d : void 0, I = E({
|
|
26
|
+
pageStart: n - t,
|
|
27
|
+
pageSize: t,
|
|
28
|
+
resolvedStartYear: c,
|
|
29
|
+
resolvedEndYear: a,
|
|
30
|
+
isYearDisabled: r
|
|
31
|
+
}), b = E({
|
|
32
|
+
pageStart: n + t,
|
|
33
|
+
pageSize: t,
|
|
34
|
+
resolvedStartYear: c,
|
|
35
|
+
resolvedEndYear: a,
|
|
36
|
+
isYearDisabled: r
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ m(
|
|
29
39
|
"div",
|
|
30
40
|
{
|
|
31
41
|
"data-slot": "year-panes",
|
|
32
|
-
className:
|
|
42
|
+
className: S("flex flex-col gap-4 overflow-hidden p-3", K),
|
|
33
43
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
|
|
35
45
|
/* @__PURE__ */ e(
|
|
36
|
-
|
|
46
|
+
x,
|
|
37
47
|
{
|
|
38
48
|
variant: "ghost",
|
|
39
49
|
size: "icon",
|
|
40
50
|
className: "h-7 w-7 shrink-0",
|
|
41
51
|
"aria-label": R,
|
|
42
|
-
disabled:
|
|
43
|
-
onClick: () =>
|
|
44
|
-
children: /* @__PURE__ */ e(
|
|
52
|
+
disabled: !I,
|
|
53
|
+
onClick: () => g(n - t),
|
|
54
|
+
children: /* @__PURE__ */ e(u, { size: 16, className: "rotate-180" })
|
|
45
55
|
}
|
|
46
56
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
57
|
+
/* @__PURE__ */ m("div", { className: "text-sm font-medium text-content", children: [
|
|
58
|
+
l?.(h) ?? h,
|
|
49
59
|
" – ",
|
|
50
|
-
|
|
60
|
+
l?.(f) ?? f
|
|
51
61
|
] }),
|
|
52
62
|
/* @__PURE__ */ e(
|
|
53
|
-
|
|
63
|
+
x,
|
|
54
64
|
{
|
|
55
65
|
variant: "ghost",
|
|
56
66
|
size: "icon",
|
|
57
67
|
className: "h-7 w-7",
|
|
58
|
-
"aria-label":
|
|
59
|
-
disabled:
|
|
60
|
-
onClick: () =>
|
|
61
|
-
children: /* @__PURE__ */ e(
|
|
68
|
+
"aria-label": _,
|
|
69
|
+
disabled: !b,
|
|
70
|
+
onClick: () => g(n + t),
|
|
71
|
+
children: /* @__PURE__ */ e(u, { className: "h-4 w-4" })
|
|
62
72
|
}
|
|
63
73
|
)
|
|
64
74
|
] }),
|
|
@@ -66,26 +76,26 @@ function V({
|
|
|
66
76
|
"div",
|
|
67
77
|
{
|
|
68
78
|
"data-period-grid": "",
|
|
69
|
-
className:
|
|
70
|
-
children:
|
|
71
|
-
const
|
|
79
|
+
className: S(Z, s ? "grid-cols-2" : "grid-cols-3"),
|
|
80
|
+
children: i.map((o) => {
|
|
81
|
+
const z = o < c || o > a || r(o), k = C(o), O = !!N, { isStart: j, isEnd: M, isMiddle: H } = W(o, d), T = p?.(o);
|
|
72
82
|
return /* @__PURE__ */ e(
|
|
73
|
-
|
|
83
|
+
Y,
|
|
74
84
|
{
|
|
75
|
-
selected:
|
|
85
|
+
selected: k,
|
|
76
86
|
disabled: z,
|
|
77
|
-
isRange:
|
|
78
|
-
isStart:
|
|
79
|
-
isEnd:
|
|
80
|
-
isMiddle:
|
|
81
|
-
hasRangeEnd: !!
|
|
82
|
-
size:
|
|
83
|
-
columns:
|
|
84
|
-
onClick: () =>
|
|
85
|
-
caption:
|
|
86
|
-
children:
|
|
87
|
+
isRange: O,
|
|
88
|
+
isStart: j,
|
|
89
|
+
isEnd: M,
|
|
90
|
+
isMiddle: H,
|
|
91
|
+
hasRangeEnd: !!N?.to,
|
|
92
|
+
size: s ? "year-caption" : "year",
|
|
93
|
+
columns: s ? 2 : 3,
|
|
94
|
+
onClick: () => B(o),
|
|
95
|
+
caption: T,
|
|
96
|
+
children: l?.(o) ?? String(o)
|
|
87
97
|
},
|
|
88
|
-
|
|
98
|
+
o
|
|
89
99
|
);
|
|
90
100
|
})
|
|
91
101
|
}
|
|
@@ -95,8 +105,8 @@ function V({
|
|
|
95
105
|
);
|
|
96
106
|
}
|
|
97
107
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
ot as CalendarYearPanes,
|
|
109
|
+
J as YEAR_CAPTION_PAGE_SIZE,
|
|
110
|
+
F as YEAR_PAGE_SIZE,
|
|
111
|
+
K as YEAR_PANE_WIDTH_CLASS
|
|
102
112
|
};
|
|
@@ -11,6 +11,19 @@ export declare function getYearRangeProps(year: number, currentSelection: YearSe
|
|
|
11
11
|
};
|
|
12
12
|
export declare function nextYearSelection(selection: YearSelection, prev: YearSelection | YearSelection[] | YearRange | undefined, yearMode: "single" | "multiple" | "range" | "multi-range"): YearSelection | YearSelection[] | YearRange | undefined;
|
|
13
13
|
export declare function isYearSelectedForSelection(year: number, currentSelection: YearSelection | YearSelection[] | YearRange | undefined): boolean;
|
|
14
|
+
/** Full page of years (never shrink the grid when bounds are tight). */
|
|
15
|
+
export declare function getYearPageYears(pageStart: number, pageSize: number): number[];
|
|
16
|
+
/**
|
|
17
|
+
* Prev/next stay enabled only when the target page has at least one selectable year.
|
|
18
|
+
* Disabled / out-of-nav years still render on the current page.
|
|
19
|
+
*/
|
|
20
|
+
export declare function yearPageHasSelectableYear(options: {
|
|
21
|
+
pageStart: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
resolvedStartYear: number;
|
|
24
|
+
resolvedEndYear: number;
|
|
25
|
+
isYearDisabled: (year: number) => boolean;
|
|
26
|
+
}): boolean;
|
|
14
27
|
export declare function isYearDisabledForBounds(year: number, disabled?: unknown, options?: {
|
|
15
28
|
calendarKind?: "gregorian" | "fiscal";
|
|
16
29
|
fiscalConfig?: FiscalCalendarConfig;
|
|
@@ -1,75 +1,84 @@
|
|
|
1
1
|
import { localDateFromCivil as d } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
-
import { buildFiscalYear as
|
|
3
|
-
import { isDateIntervalDisabled as
|
|
4
|
-
function
|
|
2
|
+
import { buildFiscalYear as u } from "../../../lib/fiscal-calendar/build-year.js";
|
|
3
|
+
import { isDateIntervalDisabled as m } from "./calendar-month-utils.js";
|
|
4
|
+
function A(r) {
|
|
5
5
|
return r ? new Date(r.fy ?? r.year, 0, 1) : /* @__PURE__ */ new Date();
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function e(r) {
|
|
8
8
|
return r.fy ?? r.year;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function o(r, s) {
|
|
11
|
+
return e(r) === e(s);
|
|
12
12
|
}
|
|
13
13
|
function l(r) {
|
|
14
14
|
return !!(r && !Array.isArray(r) && ("from" in r || "to" in r));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!l(
|
|
16
|
+
function E(r, s) {
|
|
17
|
+
if (!l(s))
|
|
18
18
|
return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
if (!
|
|
22
|
-
return { isStart: !1, isEnd: t ?
|
|
23
|
-
const
|
|
24
|
-
if (!t) return { isStart: r ===
|
|
25
|
-
const
|
|
19
|
+
const f = s.from, t = s.to;
|
|
20
|
+
if (!f && !t) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
21
|
+
if (!f)
|
|
22
|
+
return { isStart: !1, isEnd: t ? e(t) === r : !1, isMiddle: !1 };
|
|
23
|
+
const n = e(f);
|
|
24
|
+
if (!t) return { isStart: r === n, isEnd: !1, isMiddle: !1 };
|
|
25
|
+
const i = e(t);
|
|
26
26
|
return {
|
|
27
|
-
isStart: r ===
|
|
28
|
-
isEnd: r ===
|
|
29
|
-
isMiddle: r >
|
|
27
|
+
isStart: r === n,
|
|
28
|
+
isEnd: r === i,
|
|
29
|
+
isMiddle: r > n && r < i
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
return
|
|
32
|
+
function b(r, s, f) {
|
|
33
|
+
if (f === "single") return r;
|
|
34
|
+
if (f === "multiple") {
|
|
35
|
+
const n = Array.isArray(s) ? s : [];
|
|
36
|
+
return n.some((a) => o(a, r)) ? n.filter((a) => !o(a, r)) : [...n, r];
|
|
37
37
|
}
|
|
38
|
-
const t =
|
|
39
|
-
return !t?.from || t.to ? { from: r } :
|
|
38
|
+
const t = s;
|
|
39
|
+
return !t?.from || t.to ? { from: r } : o(r, t.from) ? t : e(r) < e(t.from) ? { from: r, to: t.from } : { from: t.from, to: r };
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
if (Array.isArray(
|
|
45
|
-
return
|
|
46
|
-
if (l(
|
|
47
|
-
const t =
|
|
48
|
-
if (!t) return
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const a = n
|
|
52
|
-
return r >=
|
|
41
|
+
function w(r, s) {
|
|
42
|
+
if (!s) return !1;
|
|
43
|
+
const f = { year: r, fy: r };
|
|
44
|
+
if (Array.isArray(s))
|
|
45
|
+
return s.some((t) => e(t) === r);
|
|
46
|
+
if (l(s)) {
|
|
47
|
+
const t = s.from, n = s.to;
|
|
48
|
+
if (!t) return n ? e(n) === r : !1;
|
|
49
|
+
const i = e(t);
|
|
50
|
+
if (!n) return r === i;
|
|
51
|
+
const a = e(n);
|
|
52
|
+
return r >= i && r <= a;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return o(s, f) || s.year === r;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
function c(r, s) {
|
|
57
|
+
return Array.from({ length: s }, (f, t) => r + t);
|
|
58
|
+
}
|
|
59
|
+
function F(r) {
|
|
60
|
+
const { pageStart: s, pageSize: f, resolvedStartYear: t, resolvedEndYear: n, isYearDisabled: i } = r;
|
|
61
|
+
return c(s, f).some((a) => a < t || a > n ? !1 : !i(a));
|
|
62
|
+
}
|
|
63
|
+
function M(r, s, f) {
|
|
64
|
+
let t = new Date(r, 0, 1), n = new Date(r, 11, 31, 23, 59, 59, 999);
|
|
65
|
+
if (f?.calendarKind === "fiscal" && f.fiscalConfig)
|
|
59
66
|
try {
|
|
60
|
-
const
|
|
61
|
-
t = d(
|
|
67
|
+
const i = u(f.fiscalConfig, r);
|
|
68
|
+
t = d(i.start), n = d(i.end);
|
|
62
69
|
} catch {
|
|
63
70
|
}
|
|
64
|
-
return
|
|
71
|
+
return m(t, n, s);
|
|
65
72
|
}
|
|
66
73
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
c as getYearPageYears,
|
|
75
|
+
E as getYearRangeProps,
|
|
76
|
+
o as isSameYear,
|
|
77
|
+
M as isYearDisabledForBounds,
|
|
70
78
|
l as isYearRangeSelection,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
w as isYearSelectedForSelection,
|
|
80
|
+
b as nextYearSelection,
|
|
81
|
+
A as viewMonthFromYear,
|
|
82
|
+
e as yearKey,
|
|
83
|
+
F as yearPageHasSelectableYear
|
|
75
84
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as l, TooltipTrigger as n, TooltipContent as o } from "./tooltip.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const p = (i, r, a) => /* @__PURE__ */ t(l, { children: [
|
|
4
5
|
/* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "inline-flex items-center justify-center h-full w-full", children: i }) }),
|
|
5
6
|
/* @__PURE__ */ e(o, { variant: "tertiary", className: a, children: r })
|
|
6
7
|
] }), h = (i, r) => /* @__PURE__ */ t(l, { children: [
|
|
@@ -9,5 +10,5 @@ const d = (i, r, a) => /* @__PURE__ */ t(l, { children: [
|
|
|
9
10
|
] });
|
|
10
11
|
export {
|
|
11
12
|
h as defaultAccordionTooltipRender,
|
|
12
|
-
|
|
13
|
+
p as defaultTabTooltipRender
|
|
13
14
|
};
|
|
@@ -2,17 +2,17 @@ import { jsx as r, jsxs as h, Fragment as z } from "react/jsx-runtime";
|
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import { Person as G, Monitor as U, PriorityAlert as q, Locked as O, Reset as B } from "impact-nova-icons";
|
|
4
4
|
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
+
import { Kbd as $ } from "../../primitives/kbd/kbd.js";
|
|
6
|
+
import { keybindingToString as H } from "../../primitives/kbd/keybinding-display.js";
|
|
5
7
|
import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
6
|
-
import { ModuleRegistry as
|
|
7
|
-
import { AllEnterpriseModule as
|
|
8
|
-
import { DataTable as
|
|
8
|
+
import { ModuleRegistry as V, AllCommunityModule as J } from "ag-grid-community";
|
|
9
|
+
import { AllEnterpriseModule as Q } from "ag-grid-enterprise";
|
|
10
|
+
import { DataTable as X, DataTableContent as Y } from "../../data/data-table/data-table.js";
|
|
9
11
|
import { AG_CELL_NO_PADDING as F } from "../../data/ag-grid-react/cell-renderers/index.js";
|
|
10
|
-
import { Kbd as X } from "../../primitives/kbd/kbd.js";
|
|
11
|
-
import { keybindingToString as Y } from "../../primitives/kbd/keybinding-display.js";
|
|
12
12
|
import { useCommandPalette as Z } from "./use-command-palette.js";
|
|
13
13
|
import { COMMAND_SOURCE_LABELS as m, keybindingFromEvent as W, isReservedShortcut as ee } from "./utils.js";
|
|
14
14
|
import { BadgeCellRenderer as te } from "../../data/ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
15
|
-
|
|
15
|
+
V.registerModules([J, Q]);
|
|
16
16
|
function re(a) {
|
|
17
17
|
const t = a.data;
|
|
18
18
|
return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
@@ -69,7 +69,7 @@ function ne(a) {
|
|
|
69
69
|
"flex items-center justify-end h-full w-full text-end",
|
|
70
70
|
t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
|
|
71
71
|
),
|
|
72
|
-
children: /* @__PURE__ */ r(
|
|
72
|
+
children: /* @__PURE__ */ r($, { keybinding: t.keybinding, size: "sm" })
|
|
73
73
|
}
|
|
74
74
|
) : t.customisable ? /* @__PURE__ */ r(
|
|
75
75
|
"button",
|
|
@@ -133,7 +133,7 @@ function le({
|
|
|
133
133
|
description: e.description || "",
|
|
134
134
|
category: e.category || "General",
|
|
135
135
|
keybinding: i,
|
|
136
|
-
keybindingDisplay: i ?
|
|
136
|
+
keybindingDisplay: i ? H(i) : "",
|
|
137
137
|
scope: e.scope,
|
|
138
138
|
source: D,
|
|
139
139
|
sourceColor: T ? "primary" : "neutral",
|
|
@@ -278,10 +278,10 @@ function le({
|
|
|
278
278
|
u?.type === "conflict" ? /* @__PURE__ */ r(q, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
279
279
|
/* @__PURE__ */ r("span", { children: u ? u.text : L })
|
|
280
280
|
] }) : null;
|
|
281
|
-
return /* @__PURE__ */ h(
|
|
281
|
+
return /* @__PURE__ */ h(X, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
|
|
282
282
|
s ? s(E) : E,
|
|
283
283
|
/* @__PURE__ */ r(
|
|
284
|
-
|
|
284
|
+
Y,
|
|
285
285
|
{
|
|
286
286
|
rowData: y,
|
|
287
287
|
columnDefs: I,
|
|
@@ -6,8 +6,8 @@ import { cn as o } from "../../../lib/utils.js";
|
|
|
6
6
|
import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
|
|
7
7
|
import { Button as D } from "../../primitives/button/button.js";
|
|
8
8
|
import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Kbd as S } from "../../primitives/kbd/kbd.js";
|
|
10
|
+
import { OverflowTooltip as j } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
11
11
|
import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
12
|
import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
|
|
13
13
|
import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
|
|
@@ -145,14 +145,14 @@ const O = ({
|
|
|
145
145
|
),
|
|
146
146
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
147
147
|
/* @__PURE__ */ e(
|
|
148
|
-
|
|
148
|
+
j,
|
|
149
149
|
{
|
|
150
150
|
triggerClassName: "truncate font-['Manrope'] block min-w-0",
|
|
151
151
|
content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
|
|
152
152
|
t.label,
|
|
153
153
|
" ",
|
|
154
154
|
/* @__PURE__ */ e(
|
|
155
|
-
|
|
155
|
+
S,
|
|
156
156
|
{
|
|
157
157
|
keybinding: t.tooltipKeybinding,
|
|
158
158
|
size: "sm"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as x } from "../../../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
3
4
|
import { OverflowTooltip as m } from "../../../feedback/tooltip/overflow-tooltip.js";
|
|
4
5
|
import { isInvertedSelection as h, isOptionArray as d } from "../utils/select.js";
|
|
5
|
-
function
|
|
6
|
+
function C({
|
|
6
7
|
isMulti: u,
|
|
7
8
|
isDisabled: p,
|
|
8
9
|
internalValue: o,
|
|
@@ -52,5 +53,5 @@ function w({
|
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
C as SelectTriggerValue
|
|
56
57
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "@radix-ui/react-popover";
|
|
3
3
|
import { Checkbox as P } from "../../checkbox/checkbox.js";
|
|
4
|
+
import "react";
|
|
4
5
|
import { OverflowTooltip as y } from "../../../feedback/tooltip/overflow-tooltip.js";
|
|
5
6
|
import { ChevronRight as A, Checkmark as O } from "impact-nova-icons";
|
|
6
7
|
import { cn as v } from "../../../../lib/utils.js";
|
|
7
8
|
import { useOverlayPortalContainer as T } from "../../../../lib/overlay/overlay-portal-context.js";
|
|
8
9
|
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as _ } from "../../../../lib/overlay/overlay-host.constants.js";
|
|
9
10
|
import { useSuppressOptionClickForTextSelection as E } from "../hooks/useSuppressOptionClickForTextSelection.js";
|
|
10
|
-
const
|
|
11
|
+
const R = ({
|
|
11
12
|
parentOption: n,
|
|
12
13
|
isMulti: u,
|
|
13
14
|
isReadOnly: l,
|
|
@@ -105,5 +106,5 @@ const G = ({
|
|
|
105
106
|
] });
|
|
106
107
|
};
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
R as Submenu
|
|
109
110
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { useRef as p, useState as
|
|
1
|
+
import { jsx as m, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useState as T } from "react";
|
|
3
3
|
import { Controller as k } from "react-hook-form";
|
|
4
4
|
import { SmartInput as I } from "../../components/forms/smart-input/smart-input.js";
|
|
5
5
|
const B = ({
|
|
@@ -8,35 +8,35 @@ const B = ({
|
|
|
8
8
|
isDisabled: x,
|
|
9
9
|
formHelpers: t
|
|
10
10
|
}) => {
|
|
11
|
-
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] =
|
|
11
|
+
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] = T(!1), C = async (n) => {
|
|
12
12
|
if (i?.validationConfig?.omitValidation?.includes(
|
|
13
13
|
e.id
|
|
14
14
|
)) {
|
|
15
15
|
o.current = !1, l.current = null, await t.form.trigger(e.id);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
if (!(!
|
|
18
|
+
if (!(!n || n.trim() === "")) {
|
|
19
19
|
f(!0);
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
21
|
+
const r = e.handlerName ? t.formContext?.functions?.[e.handlerName] : void 0;
|
|
22
22
|
let a;
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
23
|
+
if (r) {
|
|
24
|
+
const s = i?.validationConfig?.fieldValuesToIncludeInApiRequest || [], d = s.length > 0 ? s.reduce(
|
|
25
25
|
(u, c) => (u[c] = t.form.getValues(c), u),
|
|
26
26
|
{}
|
|
27
27
|
) : {};
|
|
28
|
-
a = await
|
|
28
|
+
a = await r({
|
|
29
29
|
formHelpers: t,
|
|
30
30
|
fieldId: e.id,
|
|
31
|
-
newValue:
|
|
31
|
+
newValue: n,
|
|
32
32
|
oldValue: t.getPreviousFieldValue(e.id),
|
|
33
|
-
payload: { includedFieldValues:
|
|
33
|
+
payload: { includedFieldValues: d }
|
|
34
34
|
});
|
|
35
35
|
} else {
|
|
36
36
|
if (!i?.validationConfig)
|
|
37
37
|
throw new Error("Validation config is required");
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const s = i.validationConfig.method || "POST", d = i.validationConfig.fieldValuesToIncludeInApiRequest || [], u = d.length > 0 ? d.reduce(
|
|
39
|
+
(w, V) => (w[V] = t.form.getValues(V), w),
|
|
40
40
|
{}
|
|
41
41
|
) : {}, c = i.validationConfig.apiEndpoint;
|
|
42
42
|
if (!c)
|
|
@@ -45,8 +45,8 @@ const B = ({
|
|
|
45
45
|
{
|
|
46
46
|
formHelpers: t,
|
|
47
47
|
apiEndpoint: c,
|
|
48
|
-
value:
|
|
49
|
-
method:
|
|
48
|
+
value: n,
|
|
49
|
+
method: s,
|
|
50
50
|
fieldValuesToIncludeInApiRequest: u
|
|
51
51
|
}
|
|
52
52
|
), !a)
|
|
@@ -55,10 +55,10 @@ const B = ({
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
a?.is_valid ? (o.current = !1, l.current = null, await t.form.trigger(e.id)) : (o.current = !0, l.current = a?.message?.trim() || `This ${e.label} is already taken`, await t.form.trigger(e.id));
|
|
58
|
-
} catch (
|
|
59
|
-
o.current = !0, l.current =
|
|
58
|
+
} catch (r) {
|
|
59
|
+
o.current = !0, l.current = r instanceof Error ? r.message : `This ${e.label} is already taken`, await t.form.trigger(e.id), t.formContext?.transport?.showFormErrorToast?.({
|
|
60
60
|
title: "Error",
|
|
61
|
-
description:
|
|
61
|
+
description: r instanceof Error ? r.message : "Something went wrong"
|
|
62
62
|
});
|
|
63
63
|
} finally {
|
|
64
64
|
f(!1);
|
|
@@ -77,34 +77,35 @@ const B = ({
|
|
|
77
77
|
backendValidation: () => o.current ? l.current || "Validation pending" : !0
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
render: ({ field:
|
|
81
|
-
const a = !!
|
|
82
|
-
return /* @__PURE__ */
|
|
80
|
+
render: ({ field: n, fieldState: r }) => {
|
|
81
|
+
const a = !!r.error && r.error.message !== "Validation pending", s = n.value, d = a && !h ? r.error?.message : void 0;
|
|
82
|
+
return /* @__PURE__ */ v("div", { className: "w-full min-w-0", children: [
|
|
83
83
|
/* @__PURE__ */ m(
|
|
84
84
|
I,
|
|
85
85
|
{
|
|
86
86
|
label: e.label,
|
|
87
87
|
type: "text",
|
|
88
|
-
value:
|
|
88
|
+
value: s ?? void 0,
|
|
89
89
|
onChange: (u) => {
|
|
90
|
-
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null),
|
|
90
|
+
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null), n.onChange(u);
|
|
91
91
|
},
|
|
92
92
|
onBlur: () => {
|
|
93
|
-
|
|
93
|
+
n.onBlur(), C(s ?? "");
|
|
94
94
|
},
|
|
95
95
|
placeholder: e.placeholder,
|
|
96
96
|
required: e.isRequired,
|
|
97
97
|
disabled: x,
|
|
98
98
|
error: a && !h,
|
|
99
|
-
helperText: h ? "Validating…" : a ? void 0 : e.helpText
|
|
99
|
+
helperText: h ? "Validating…" : a ? void 0 : e.helpText,
|
|
100
|
+
allowSpecialCharacters: i.allowSpecialCharacters
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
|
|
103
|
+
d ? /* @__PURE__ */ m(
|
|
103
104
|
"p",
|
|
104
105
|
{
|
|
105
106
|
className: "mt-2 text-sm leading-snug text-[#DC2626] break-words",
|
|
106
107
|
role: "alert",
|
|
107
|
-
children:
|
|
108
|
+
children: d
|
|
108
109
|
}
|
|
109
110
|
) : null
|
|
110
111
|
] });
|
|
@@ -466,6 +466,11 @@ export type CheckboxField = BaseField & {
|
|
|
466
466
|
};
|
|
467
467
|
export type TextFieldWithBackendValidation = BaseField & {
|
|
468
468
|
fieldType: "text_with_backend_validation";
|
|
469
|
+
/**
|
|
470
|
+
* When false (default), only letters, numbers, and spaces are kept.
|
|
471
|
+
* Set true to allow punctuation and symbols (same behavior as `text`).
|
|
472
|
+
*/
|
|
473
|
+
allowSpecialCharacters?: boolean;
|
|
469
474
|
/** Legacy built-in path — optional when field.handlerName is set */
|
|
470
475
|
validationConfig?: {
|
|
471
476
|
method?: "GET" | "POST";
|