impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.9
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/ag-grid-react/ag-grid.types.d.ts +6 -0
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
- package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +109 -100
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +93 -21
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
- package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
- package/dist/components/data/data-table/data-table-saved-views.js +37 -37
- package/dist/components/data/data-table/data-table.js +78 -73
- package/dist/components/data/data-table/data-table.types.d.ts +7 -1
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +20 -17
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
- package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
- package/dist/components/feedback/dialog/dialog.js +3 -3
- package/dist/components/feedback/drawer/drawer.js +32 -32
- package/dist/components/feedback/sheet/sheet.js +8 -8
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +245 -258
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-summary.js +41 -41
- package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
- package/dist/components/flows/wizard/wizard.js +32 -32
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +70 -70
- package/dist/components/forms/date-picker/date-picker.js +31 -30
- package/dist/components/forms/file-upload/file-upload.js +146 -168
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +123 -120
- package/dist/components/forms/select/select.types.d.ts +95 -204
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +113 -116
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/sidebar/sidebar.js +5 -5
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/kbd/kbd.variants.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova-base.scss +8 -5
- package/dist/impact-nova-components.css +2 -2
- package/dist/impact-nova-tokens.scss +346 -189
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +505 -499
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- 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/dist/tailwind.config.js +297 -0
- package/dist/theme/tailwind-colors.js +199 -0
- package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +32 -259
- package/tailwind.config.js +0 -335
|
@@ -14,12 +14,17 @@ export interface RuntimeColumnDefsResult {
|
|
|
14
14
|
runtimeColumnDefs: (ColDef | ColGroupDef)[];
|
|
15
15
|
extractedRuntimeDefaults: ExtractedColumnRuntimeDefaults;
|
|
16
16
|
}
|
|
17
|
+
export interface SuppressInitialRuntimeState {
|
|
18
|
+
columnPinning?: boolean;
|
|
19
|
+
columnVisibility?: boolean;
|
|
20
|
+
}
|
|
17
21
|
/**
|
|
18
|
-
* AG Grid reapplies `colDef.pinned` / `colDef.hide` on column-definition
|
|
19
|
-
*
|
|
22
|
+
* AG Grid reapplies stateful `colDef.pinned` / `colDef.hide` on column-definition
|
|
23
|
+
* refresh. Apps may pass `pinned` / `hide` (or `initialPinned` / `initialHide`);
|
|
24
|
+
* DataTable maps them to initial attrs on grid-facing defs and `initialState`.
|
|
20
25
|
*/
|
|
21
26
|
export declare function extractRuntimeColumnDefs(columnDefs: (ColDef | ColGroupDef)[] | undefined): RuntimeColumnDefsResult;
|
|
22
27
|
/** @deprecated Use `extractedRuntimeDefaults.columnPinning` from `extractRuntimeColumnDefs`. */
|
|
23
28
|
export declare function getExtractedColumnPinning(result: RuntimeColumnDefsResult): ExtractedColumnPinning;
|
|
24
|
-
export declare function mergeInitialColumnPinningState(userInitialState: GridState | undefined, extractedColumnPinning: ExtractedColumnPinning): GridState | undefined;
|
|
25
|
-
export declare function mergeInitialGridRuntimeState(userInitialState: GridState | undefined, extractedRuntimeDefaults: ExtractedColumnRuntimeDefaults): GridState | undefined;
|
|
29
|
+
export declare function mergeInitialColumnPinningState(userInitialState: GridState | undefined, extractedColumnPinning: ExtractedColumnPinning, suppress?: SuppressInitialRuntimeState): GridState | undefined;
|
|
30
|
+
export declare function mergeInitialGridRuntimeState(userInitialState: GridState | undefined, extractedRuntimeDefaults: ExtractedColumnRuntimeDefaults, suppress?: SuppressInitialRuntimeState): GridState | undefined;
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
return typeof
|
|
1
|
+
function h(i) {
|
|
2
|
+
const n = i.colId ?? i.field;
|
|
3
|
+
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
5
|
+
function c(i, n, e) {
|
|
6
|
+
if (n === "left" || n === !0) {
|
|
7
|
+
e.leftColIds.push(i);
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
n === "right" && e.rightColIds.push(i);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
const { pinned:
|
|
17
|
-
return
|
|
12
|
+
function m(i, n) {
|
|
13
|
+
const e = h(i), d = i.pinned ?? i.initialPinned, t = i.hide ?? i.initialHide;
|
|
14
|
+
if (e && (d != null && c(e, d, n.columnPinning), t === !0 && n.columnVisibility.hiddenColIds.push(e)), !(i.pinned !== void 0 || i.hide !== void 0 || i.initialPinned !== void 0 || i.initialHide !== void 0))
|
|
15
|
+
return i;
|
|
16
|
+
const { pinned: o, hide: C, initialPinned: f, initialHide: P, ...s } = i, l = { ...s };
|
|
17
|
+
return d !== void 0 && (l.initialPinned = d), t !== void 0 && (l.initialHide = t), l;
|
|
18
18
|
}
|
|
19
|
-
function u(
|
|
20
|
-
let
|
|
21
|
-
const
|
|
19
|
+
function u(i, n) {
|
|
20
|
+
let e = !1;
|
|
21
|
+
const d = i.map((t) => {
|
|
22
22
|
if ("children" in t && t.children) {
|
|
23
|
-
const
|
|
23
|
+
const o = u(
|
|
24
24
|
t.children,
|
|
25
|
-
|
|
25
|
+
n
|
|
26
26
|
);
|
|
27
|
-
return
|
|
27
|
+
return o === t.children ? t : (e = !0, {
|
|
28
28
|
...t,
|
|
29
|
-
children:
|
|
29
|
+
children: o
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const r = m(
|
|
33
33
|
t,
|
|
34
|
-
|
|
34
|
+
n
|
|
35
35
|
);
|
|
36
|
-
return
|
|
36
|
+
return r !== t && (e = !0), r;
|
|
37
37
|
});
|
|
38
|
-
return
|
|
38
|
+
return e ? d : i;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function g() {
|
|
41
41
|
return {
|
|
42
42
|
columnPinning: { leftColIds: [], rightColIds: [] },
|
|
43
43
|
columnVisibility: { hiddenColIds: [] }
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return !
|
|
46
|
+
function v(i) {
|
|
47
|
+
const n = g();
|
|
48
|
+
return !i || i.length === 0 ? { runtimeColumnDefs: [], extractedRuntimeDefaults: n } : {
|
|
49
49
|
runtimeColumnDefs: u(
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
i,
|
|
51
|
+
n
|
|
52
52
|
),
|
|
53
|
-
extractedRuntimeDefaults:
|
|
53
|
+
extractedRuntimeDefaults: n
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
56
|
+
function y(i, n, e) {
|
|
57
|
+
const d = !e?.columnPinning && (n.columnPinning.leftColIds.length > 0 || n.columnPinning.rightColIds.length > 0), t = !e?.columnVisibility && n.columnVisibility.hiddenColIds.length > 0;
|
|
58
|
+
if (!i && !d && !t)
|
|
59
59
|
return;
|
|
60
|
-
const
|
|
61
|
-
return !
|
|
60
|
+
const r = { ...i };
|
|
61
|
+
return !i?.columnPinning && d && (r.columnPinning = n.columnPinning), !i?.columnVisibility && t && (r.columnVisibility = n.columnVisibility), !r.columnPinning && !r.columnVisibility && Object.keys(r).length === 0 ? i : Object.keys(r).length > 0 ? r : void 0;
|
|
62
62
|
}
|
|
63
63
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
v as extractRuntimeColumnDefs,
|
|
65
|
+
y as mergeInitialGridRuntimeState
|
|
66
66
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, Fragment as W, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { ChevronRight as
|
|
3
|
+
import { ChevronRight as xe, Star as I, Search as ye, Bookmark as we, Pencil as Ne, Bin as Te } from "impact-nova-icons";
|
|
4
4
|
import { cn as k } from "../../../lib/utils.js";
|
|
5
5
|
import { useImpactNovaI18n as ke } from "../../../i18n/use-impact-nova-i18n.js";
|
|
6
6
|
import { Popover as Ve, PopoverTrigger as Ce, PopoverContent as Se } from "../../feedback/popover/popover.js";
|
|
@@ -14,7 +14,7 @@ import { Prompt as De } from "../../forms/prompt/prompt.js";
|
|
|
14
14
|
function Me(b) {
|
|
15
15
|
return b.isSystemView ? "system" : b.isDefaultView ? "default" : b.isActive ? "active" : "other";
|
|
16
16
|
}
|
|
17
|
-
const Ae = ["default", "active", "system"],
|
|
17
|
+
const Ae = ["default", "active", "system"], _e = ({
|
|
18
18
|
isSaveViewEnabled: b = !0,
|
|
19
19
|
views: o,
|
|
20
20
|
activeViewSummary: te,
|
|
@@ -24,7 +24,7 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
24
24
|
onMenuOpenChange: E,
|
|
25
25
|
onSearch: V,
|
|
26
26
|
isLoadingViews: L = !1,
|
|
27
|
-
customListContent:
|
|
27
|
+
customListContent: U,
|
|
28
28
|
disableApply: ie = !1,
|
|
29
29
|
className: re,
|
|
30
30
|
onSaveViewClick: le,
|
|
@@ -32,7 +32,7 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
32
32
|
onCancel: oe,
|
|
33
33
|
onEditView: de,
|
|
34
34
|
onDeleteView: ce,
|
|
35
|
-
onSetDefaultView:
|
|
35
|
+
onSetDefaultView: Q
|
|
36
36
|
}) => {
|
|
37
37
|
const { t: a } = ke(), C = R !== void 0, [me, y] = n.useState(null), [ue, pe] = n.useState(
|
|
38
38
|
ne
|
|
@@ -41,17 +41,17 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
41
41
|
C || pe(e), E?.(e);
|
|
42
42
|
},
|
|
43
43
|
[C, E]
|
|
44
|
-
), [v, S] = n.useState("All"), [w, z] = n.useState(""), [
|
|
44
|
+
), [v, S] = n.useState("All"), [w, z] = n.useState(""), [F, D] = n.useState("");
|
|
45
45
|
n.useEffect(() => {
|
|
46
46
|
const e = window.setTimeout(() => D(w), 300);
|
|
47
47
|
return () => window.clearTimeout(e);
|
|
48
48
|
}, [w]), n.useEffect(() => {
|
|
49
|
-
V && V(
|
|
50
|
-
}, [
|
|
51
|
-
const
|
|
49
|
+
V && V(F);
|
|
50
|
+
}, [F, V]);
|
|
51
|
+
const Y = n.useMemo(
|
|
52
52
|
() => o.find((e) => e.isActive),
|
|
53
53
|
[o]
|
|
54
|
-
), d =
|
|
54
|
+
), d = Y ?? null, _ = te ?? Y?.viewName ?? a("dataTable.savedViewsNotApplicable"), [N, M] = n.useState(null), [g, $] = n.useState(null), K = n.useRef(!1);
|
|
55
55
|
n.useEffect(() => {
|
|
56
56
|
const e = u && !K.current;
|
|
57
57
|
if (K.current = u, e) {
|
|
@@ -59,20 +59,20 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
59
59
|
M(r?.id ?? null), S("All"), z(""), D("");
|
|
60
60
|
}
|
|
61
61
|
}, [u, o]);
|
|
62
|
-
const
|
|
62
|
+
const x = n.useMemo(() => v === "All" ? o : o.filter((e) => e.viewType === v), [o, v]), f = w.trim().toLowerCase(), T = n.useCallback(
|
|
63
63
|
(e, r) => r ? (e.viewName ?? "").trim().toLowerCase().includes(r) : !0,
|
|
64
64
|
[]
|
|
65
65
|
), A = n.useMemo(() => {
|
|
66
|
-
let e =
|
|
66
|
+
let e = x;
|
|
67
67
|
return f && (e = e.filter((r) => T(r, f))), e;
|
|
68
|
-
}, [
|
|
69
|
-
if (
|
|
70
|
-
const e = Object.groupBy(
|
|
68
|
+
}, [x, f, T]), h = n.useMemo(() => {
|
|
69
|
+
if (x.length === 0) return [];
|
|
70
|
+
const e = Object.groupBy(x, Me);
|
|
71
71
|
return Ae.flatMap((r) => {
|
|
72
72
|
const c = e[r]?.[0];
|
|
73
73
|
return c ? f && !T(c, f) ? [] : [c] : [];
|
|
74
74
|
});
|
|
75
|
-
}, [
|
|
75
|
+
}, [x, f, T]), P = n.useMemo(() => {
|
|
76
76
|
const e = new Set(h.map((r) => r.id));
|
|
77
77
|
return A.filter((r) => !e.has(r.id));
|
|
78
78
|
}, [A, h]), G = N === null ? null : o.find((e) => e.id === N) ?? null, fe = () => {
|
|
@@ -85,7 +85,7 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
85
85
|
if (!b)
|
|
86
86
|
return null;
|
|
87
87
|
const ve = o.length > 0, H = (e, r, c) => {
|
|
88
|
-
const O = N === e.id, s = me === e.id, J = r === "priority" && !!e.isActive,
|
|
88
|
+
const O = N === e.id, s = me === e.id, J = r === "priority" && !!e.isActive, ge = r === "list" && !!e.isActive;
|
|
89
89
|
return /* @__PURE__ */ i(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
@@ -119,7 +119,7 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
119
119
|
{
|
|
120
120
|
className: k(
|
|
121
121
|
"min-w-0 flex-1 truncate relative z-10",
|
|
122
|
-
|
|
122
|
+
ge && "underline decoration-primary decoration-2 underline-offset-2"
|
|
123
123
|
),
|
|
124
124
|
children: e.viewName
|
|
125
125
|
}
|
|
@@ -161,13 +161,13 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
161
161
|
type: "button",
|
|
162
162
|
variant: "ghost",
|
|
163
163
|
size: "iconSm",
|
|
164
|
-
className: "text-
|
|
164
|
+
className: "text-warning hover:text-badge-warning-ink disabled:opacity-50",
|
|
165
165
|
"aria-label": a("dataTable.savedViewsDefaultAction"),
|
|
166
166
|
disabled: s,
|
|
167
167
|
onClick: (l) => {
|
|
168
|
-
l.stopPropagation(), l.preventDefault(), s || (y(e.id), setTimeout(() => y(null), 1200),
|
|
168
|
+
l.stopPropagation(), l.preventDefault(), s || (y(e.id), setTimeout(() => y(null), 1200), Q?.(e, { activeView: d }));
|
|
169
169
|
},
|
|
170
|
-
children: s ? /* @__PURE__ */ t("div", { className: "size-3.5 animate-spin motion-reduce:animate-none rounded-full border-2 border-
|
|
170
|
+
children: s ? /* @__PURE__ */ t("div", { className: "size-3.5 animate-spin motion-reduce:animate-none rounded-full border-2 border-warning border-t-transparent" }) : /* @__PURE__ */ t(I, { className: "size-3.5 fill-current text-warning" })
|
|
171
171
|
}
|
|
172
172
|
) : /* @__PURE__ */ t(
|
|
173
173
|
m,
|
|
@@ -175,13 +175,13 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
175
175
|
type: "button",
|
|
176
176
|
variant: "ghost",
|
|
177
177
|
size: "iconSm",
|
|
178
|
-
className: "text-
|
|
178
|
+
className: "text-warning hover:text-badge-warning-ink disabled:opacity-50",
|
|
179
179
|
"aria-label": a("dataTable.savedViewsSetDefault"),
|
|
180
180
|
disabled: s,
|
|
181
181
|
onClick: (l) => {
|
|
182
|
-
l.stopPropagation(), l.preventDefault(), s || (y(e.id), setTimeout(() => y(null), 1200),
|
|
182
|
+
l.stopPropagation(), l.preventDefault(), s || (y(e.id), setTimeout(() => y(null), 1200), Q?.(e, { activeView: d }));
|
|
183
183
|
},
|
|
184
|
-
children: s ? /* @__PURE__ */ t("div", { className: "size-3.5 animate-spin motion-reduce:animate-none rounded-full border-2 border-
|
|
184
|
+
children: s ? /* @__PURE__ */ t("div", { className: "size-3.5 animate-spin motion-reduce:animate-none rounded-full border-2 border-warning border-t-transparent" }) : /* @__PURE__ */ t(I, { className: "size-3.5 text-warning" })
|
|
185
185
|
}
|
|
186
186
|
)
|
|
187
187
|
] })
|
|
@@ -201,8 +201,8 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
201
201
|
),
|
|
202
202
|
children: [
|
|
203
203
|
L ? /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-hidden", children: [
|
|
204
|
-
/* @__PURE__ */ t(B, { className: "h-6 w-24 rounded-full bg-
|
|
205
|
-
/* @__PURE__ */ t(B, { className: "h-6 w-6 shrink-0 rounded-md bg-
|
|
204
|
+
/* @__PURE__ */ t(B, { className: "h-6 w-24 rounded-full bg-scrim-skeleton" }),
|
|
205
|
+
/* @__PURE__ */ t(B, { className: "h-6 w-6 shrink-0 rounded-md bg-scrim-skeleton" })
|
|
206
206
|
] }) : ve ? /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center justify-start gap-1 overflow-hidden", children: /* @__PURE__ */ i(Ve, { open: u, onOpenChange: be, children: [
|
|
207
207
|
/* @__PURE__ */ t(Ce, { asChild: !0, children: /* @__PURE__ */ i(
|
|
208
208
|
"button",
|
|
@@ -220,20 +220,20 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
220
220
|
color: "success",
|
|
221
221
|
variant: "outline",
|
|
222
222
|
className: "w-fit max-w-full min-w-0 shrink font-['Manrope']",
|
|
223
|
-
children:
|
|
223
|
+
children: _
|
|
224
224
|
}
|
|
225
225
|
) }),
|
|
226
|
-
/* @__PURE__ */ t(q, { variant: "tertiary", side: "top", children:
|
|
226
|
+
/* @__PURE__ */ t(q, { variant: "tertiary", side: "top", children: _ })
|
|
227
227
|
] }),
|
|
228
228
|
/* @__PURE__ */ t(
|
|
229
229
|
"span",
|
|
230
230
|
{
|
|
231
231
|
className: k(
|
|
232
|
-
"flex size-6 shrink-0 items-center justify-center rounded-md bg-
|
|
232
|
+
"flex size-6 shrink-0 items-center justify-center rounded-md bg-canvas-elevated transition-transform duration-200",
|
|
233
233
|
u && "rotate-180"
|
|
234
234
|
),
|
|
235
235
|
"aria-hidden": !0,
|
|
236
|
-
children: /* @__PURE__ */ t(
|
|
236
|
+
children: /* @__PURE__ */ t(xe, { className: "size-3.5 rotate-90 text-content-charcoal" })
|
|
237
237
|
}
|
|
238
238
|
)
|
|
239
239
|
]
|
|
@@ -243,13 +243,13 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
243
243
|
Se,
|
|
244
244
|
{
|
|
245
245
|
align: "start",
|
|
246
|
-
className: "z-[50] w-[min(100vw-24px,280px)] p-0 shadow-
|
|
246
|
+
className: "z-[50] w-[min(100vw-24px,280px)] p-0 shadow-elevation-floating overflow-visible",
|
|
247
247
|
sideOffset: 8,
|
|
248
248
|
children: /* @__PURE__ */ i("div", { className: "flex flex-col py-2", children: [
|
|
249
249
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between gap-2 px-3 pb-2", children: [
|
|
250
250
|
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: a("dataTable.savedViewsTitle") }),
|
|
251
251
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-content-tertiary font-['Manrope']", children: [
|
|
252
|
-
/* @__PURE__ */ t(I, { className: "size-3.5 fill-current text-
|
|
252
|
+
/* @__PURE__ */ t(I, { className: "size-3.5 fill-current text-warning" }),
|
|
253
253
|
a("dataTable.savedViewsDefault")
|
|
254
254
|
] })
|
|
255
255
|
] }),
|
|
@@ -310,7 +310,7 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
310
310
|
"aria-label": a("dataTable.savedViewsSearchPlaceholder")
|
|
311
311
|
}
|
|
312
312
|
) }),
|
|
313
|
-
/* @__PURE__ */ t("div", { className: "min-h-[72px] px-1", children:
|
|
313
|
+
/* @__PURE__ */ t("div", { className: "min-h-[72px] px-1", children: U || (L ? /* @__PURE__ */ t("div", { className: "flex max-h-[160px] flex-col gap-2 overflow-y-auto px-2 py-1", children: [1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ t(B, { className: "h-9 w-full rounded-lg" }, e)) }) : A.length === 0 && h.length === 0 ? /* @__PURE__ */ t("div", { className: "flex min-h-[100px] flex-col items-center justify-center px-4 py-6 text-center", children: /* @__PURE__ */ t("span", { className: "text-sm leading-relaxed text-content-tertiary font-['Manrope']", children: a("dataTable.savedViewsEmptyList") }) }) : /* @__PURE__ */ i("div", { className: "flex max-h-[220px] flex-col gap-0 overflow-y-auto", children: [
|
|
314
314
|
h.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col px-1 pb-1 ", children: h.map(
|
|
315
315
|
(e) => H(
|
|
316
316
|
e,
|
|
@@ -381,22 +381,22 @@ const Ae = ["default", "active", "system"], Ye = ({
|
|
|
381
381
|
De,
|
|
382
382
|
{
|
|
383
383
|
variant: "destructive",
|
|
384
|
-
open:
|
|
384
|
+
open: g !== null,
|
|
385
385
|
onOpenChange: (e) => {
|
|
386
386
|
e || $(null);
|
|
387
387
|
},
|
|
388
388
|
title: a("dataTable.savedViewsDeleteConfirmTitle"),
|
|
389
|
-
description:
|
|
390
|
-
viewName:
|
|
389
|
+
description: g ? a("dataTable.savedViewsDeleteConfirmDescription", {
|
|
390
|
+
viewName: g.viewName
|
|
391
391
|
}) : void 0,
|
|
392
392
|
confirmLabel: a("dataTable.savedViewsDeleteConfirmButton"),
|
|
393
393
|
onConfirm: () => {
|
|
394
|
-
|
|
394
|
+
g && ce?.(g, { activeView: d });
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
)
|
|
398
398
|
] });
|
|
399
399
|
};
|
|
400
400
|
export {
|
|
401
|
-
|
|
401
|
+
_e as DataTableSavedViews
|
|
402
402
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useState as g, useMemo as
|
|
3
|
-
import { AgGridWrapper as
|
|
1
|
+
import { jsx as n, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useMemo as u, useCallback as D, useEffect as w, memo as v } from "react";
|
|
3
|
+
import { AgGridWrapper as O } from "../ag-grid-react/index.js";
|
|
4
4
|
import { cn as H } from "../../../lib/utils.js";
|
|
5
|
-
import { DataTableContext as
|
|
6
|
-
import { createDataTableSheetPortalStore as
|
|
7
|
-
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as
|
|
8
|
-
import { extractRuntimeColumnDefs as
|
|
9
|
-
const
|
|
5
|
+
import { DataTableContext as F, DataTableSheetPortalStoreContext as I, useDataTable as N, useDataTableSheetPortal as P } from "./data-table-context.js";
|
|
6
|
+
import { createDataTableSheetPortalStore as z } from "./data-table-sheet-portal-store.js";
|
|
7
|
+
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as B } from "./data-table-constants.js";
|
|
8
|
+
import { extractRuntimeColumnDefs as M, mergeInitialGridRuntimeState as j } from "./data-table-column-def-pin.js";
|
|
9
|
+
const _ = {
|
|
10
10
|
default: 46,
|
|
11
11
|
compact: 30,
|
|
12
12
|
comfort: 52
|
|
13
|
-
},
|
|
14
|
-
children:
|
|
13
|
+
}, U = ({
|
|
14
|
+
children: i,
|
|
15
15
|
className: t
|
|
16
16
|
}) => {
|
|
17
|
-
const [r, e] = g(null), [o,
|
|
18
|
-
l.registerScopedSheetDepth(
|
|
19
|
-
}, [l]), p = D((
|
|
20
|
-
e(
|
|
17
|
+
const [r, e] = g(null), [o, c] = g("medium"), [a, S] = g("full"), [s, f] = g("default"), l = u(() => z(), []), m = D((d) => {
|
|
18
|
+
l.registerScopedSheetDepth(d);
|
|
19
|
+
}, [l]), p = D((d) => {
|
|
20
|
+
e(d);
|
|
21
21
|
}, []), x = {
|
|
22
22
|
small: "12px",
|
|
23
23
|
medium: "14px",
|
|
24
24
|
large: "16px"
|
|
25
|
-
}[o], b = `${
|
|
25
|
+
}[o], b = `${_[s]}px`, T = u(
|
|
26
26
|
() => ({
|
|
27
27
|
gridApi: r,
|
|
28
28
|
registerApi: p,
|
|
29
|
-
registerScopedSheetDepth:
|
|
29
|
+
registerScopedSheetDepth: m,
|
|
30
30
|
fontSize: o,
|
|
31
|
-
setFontSize:
|
|
32
|
-
numericFormat:
|
|
31
|
+
setFontSize: c,
|
|
32
|
+
numericFormat: a,
|
|
33
33
|
setNumericFormat: S,
|
|
34
34
|
rowHeight: s,
|
|
35
|
-
setRowHeight:
|
|
35
|
+
setRowHeight: f
|
|
36
36
|
}),
|
|
37
37
|
[
|
|
38
38
|
r,
|
|
39
39
|
p,
|
|
40
|
-
|
|
40
|
+
m,
|
|
41
41
|
o,
|
|
42
|
-
|
|
42
|
+
a,
|
|
43
43
|
s
|
|
44
44
|
]
|
|
45
45
|
);
|
|
46
|
-
return /* @__PURE__ */ n(
|
|
47
|
-
|
|
46
|
+
return /* @__PURE__ */ n(F.Provider, { value: T, children: /* @__PURE__ */ n(
|
|
47
|
+
I.Provider,
|
|
48
48
|
{
|
|
49
49
|
value: l,
|
|
50
50
|
children: /* @__PURE__ */ n(
|
|
@@ -59,19 +59,19 @@ const P = {
|
|
|
59
59
|
"--ag-font-size": x,
|
|
60
60
|
"--ag-row-height": b
|
|
61
61
|
},
|
|
62
|
-
children:
|
|
62
|
+
children: i
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
) });
|
|
67
|
-
},
|
|
67
|
+
}, A = {
|
|
68
68
|
full: "full_no",
|
|
69
69
|
k: "thou",
|
|
70
70
|
m: "mil",
|
|
71
71
|
b: "bil",
|
|
72
72
|
full_precision: "full_precision"
|
|
73
|
-
},
|
|
74
|
-
const { setSheetTarget: t } =
|
|
73
|
+
}, k = v(function() {
|
|
74
|
+
const { setSheetTarget: t } = P();
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
@@ -79,105 +79,110 @@ const P = {
|
|
|
79
79
|
className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible"
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
}),
|
|
82
|
+
}), L = v(function({
|
|
83
83
|
className: t,
|
|
84
84
|
children: r
|
|
85
85
|
}) {
|
|
86
|
-
const { scopedSheetOpen: e } =
|
|
87
|
-
return /* @__PURE__ */
|
|
86
|
+
const { scopedSheetOpen: e } = P();
|
|
87
|
+
return /* @__PURE__ */ E(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
className: H(
|
|
91
91
|
"relative flex-1 min-h-0 w-full bg-canvas-elevated rounded-b-[inherit] grid-rounded-bottom",
|
|
92
92
|
t
|
|
93
93
|
),
|
|
94
|
-
style: e ? { minHeight:
|
|
94
|
+
style: e ? { minHeight: B } : void 0,
|
|
95
95
|
children: [
|
|
96
96
|
r,
|
|
97
|
-
/* @__PURE__ */ n(
|
|
97
|
+
/* @__PURE__ */ n(k, {})
|
|
98
98
|
]
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
|
-
}),
|
|
101
|
+
}), W = v(function({
|
|
102
102
|
resolvedRowHeight: t,
|
|
103
103
|
mergedContext: r,
|
|
104
104
|
onGridReady: e,
|
|
105
105
|
columnDefs: o,
|
|
106
|
-
maintainColumnOrder:
|
|
107
|
-
...
|
|
106
|
+
maintainColumnOrder: c = !0,
|
|
107
|
+
...a
|
|
108
108
|
}) {
|
|
109
109
|
return /* @__PURE__ */ n(
|
|
110
|
-
|
|
110
|
+
O,
|
|
111
111
|
{
|
|
112
|
-
...
|
|
112
|
+
...a,
|
|
113
113
|
columnDefs: o,
|
|
114
114
|
rowHeight: t,
|
|
115
115
|
onGridReady: e,
|
|
116
116
|
context: r,
|
|
117
|
-
maintainColumnOrder:
|
|
117
|
+
maintainColumnOrder: c
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
});
|
|
121
|
-
function
|
|
121
|
+
function Z(i) {
|
|
122
122
|
const {
|
|
123
123
|
registerApi: t,
|
|
124
124
|
rowHeight: r,
|
|
125
125
|
gridApi: e,
|
|
126
126
|
numericFormat: o
|
|
127
127
|
} = N(), {
|
|
128
|
-
className:
|
|
129
|
-
onGridReady:
|
|
128
|
+
className: c,
|
|
129
|
+
onGridReady: a,
|
|
130
130
|
rowHeight: S,
|
|
131
131
|
context: s,
|
|
132
|
-
columnDefs:
|
|
132
|
+
columnDefs: f,
|
|
133
133
|
initialState: l,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
suppressInitialRuntimeState: m,
|
|
135
|
+
maintainColumnOrder: p = !0,
|
|
136
|
+
...x
|
|
137
|
+
} = i, b = _[r], T = S ?? b, { runtimeColumnDefs: d, extractedRuntimeDefaults: y } = u(
|
|
138
|
+
() => M(f ?? void 0),
|
|
139
|
+
[f]
|
|
140
|
+
), C = u(
|
|
141
|
+
() => j(
|
|
142
|
+
l,
|
|
143
|
+
y,
|
|
144
|
+
m
|
|
145
|
+
),
|
|
146
|
+
[l, y, m]
|
|
147
|
+
), G = u(
|
|
143
148
|
() => ({
|
|
144
149
|
...s,
|
|
145
|
-
formatType:
|
|
150
|
+
formatType: A[o]
|
|
146
151
|
}),
|
|
147
152
|
[s, o]
|
|
148
153
|
);
|
|
149
|
-
|
|
154
|
+
w(() => {
|
|
150
155
|
e?.resetRowHeights();
|
|
151
|
-
}, [r, e]),
|
|
156
|
+
}, [r, e]), w(() => {
|
|
152
157
|
if (e) {
|
|
153
158
|
const h = e.getGridOption("context") || {};
|
|
154
159
|
e.setGridOption("context", {
|
|
155
160
|
...h,
|
|
156
|
-
formatType:
|
|
161
|
+
formatType: A[o]
|
|
157
162
|
}), e.refreshCells({ force: !0 });
|
|
158
163
|
}
|
|
159
164
|
}, [o, e]);
|
|
160
|
-
const
|
|
165
|
+
const R = D(
|
|
161
166
|
(h) => {
|
|
162
|
-
t(h.api),
|
|
167
|
+
t(h.api), a?.(h);
|
|
163
168
|
},
|
|
164
|
-
[t,
|
|
169
|
+
[t, a]
|
|
165
170
|
);
|
|
166
|
-
return /* @__PURE__ */ n(
|
|
167
|
-
|
|
171
|
+
return /* @__PURE__ */ n(L, { className: c, children: /* @__PURE__ */ n(
|
|
172
|
+
W,
|
|
168
173
|
{
|
|
169
|
-
...
|
|
170
|
-
columnDefs:
|
|
171
|
-
initialState:
|
|
172
|
-
maintainColumnOrder:
|
|
173
|
-
resolvedRowHeight:
|
|
174
|
-
mergedContext:
|
|
175
|
-
onGridReady:
|
|
174
|
+
...x,
|
|
175
|
+
columnDefs: d,
|
|
176
|
+
initialState: C,
|
|
177
|
+
maintainColumnOrder: p,
|
|
178
|
+
resolvedRowHeight: T,
|
|
179
|
+
mergedContext: G,
|
|
180
|
+
onGridReady: R
|
|
176
181
|
}
|
|
177
182
|
) });
|
|
178
183
|
}
|
|
179
|
-
const
|
|
180
|
-
children:
|
|
184
|
+
const ee = ({
|
|
185
|
+
children: i,
|
|
181
186
|
className: t
|
|
182
187
|
}) => /* @__PURE__ */ n(
|
|
183
188
|
"div",
|
|
@@ -187,11 +192,11 @@ const Z = ({
|
|
|
187
192
|
"flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]",
|
|
188
193
|
t
|
|
189
194
|
),
|
|
190
|
-
children:
|
|
195
|
+
children: i
|
|
191
196
|
}
|
|
192
197
|
);
|
|
193
198
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
U as DataTable,
|
|
200
|
+
Z as DataTableContent,
|
|
201
|
+
ee as DataTableToolbar
|
|
197
202
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgGridWrapperProps } from '../ag-grid-react/ag-grid.types';
|
|
2
|
+
import { SuppressInitialRuntimeState } from './data-table-column-def-pin';
|
|
2
3
|
import type * as React from "react";
|
|
3
4
|
/**
|
|
4
5
|
* Root layout provider for data tables. Compose toolbar, sheet, and `DataTableContent` as children.
|
|
@@ -8,11 +9,16 @@ export type DataTableProps = {
|
|
|
8
9
|
className?: string;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
|
-
* AG Grid surface — forwards
|
|
12
|
+
* AG Grid surface — forwards `AgGridReact` grid options (`rowData`, `columnDefs`, `rowModelType`, …)
|
|
12
13
|
* with Impact Nova styling. See https://www.ag-grid.com/react-data-grid/grid-options/
|
|
13
14
|
*/
|
|
14
15
|
export type DataTableContentProps<TData = unknown> = AgGridWrapperProps<TData> & {
|
|
15
16
|
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Skip injecting extracted column pinning/visibility into `initialState` on
|
|
19
|
+
* first paint — use when a saved view will apply immediately after mount.
|
|
20
|
+
*/
|
|
21
|
+
suppressInitialRuntimeState?: SuppressInitialRuntimeState;
|
|
16
22
|
};
|
|
17
23
|
/**
|
|
18
24
|
* Top bar above the grid. Optional — omit to remove the toolbar from the DOM.
|