impact-nova 2.1.0-alpha.3 → 2.1.0-alpha.5
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-tooltip-overflow.d.ts +3 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +6 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -21
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +1 -2
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.js +12 -6
- package/dist/components/data/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +19 -19
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/switch-display-renderer.js +15 -15
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +33 -33
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +66 -62
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +6 -6
- package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +18 -18
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +40 -29
- package/dist/components/data/ag-grid-react/headers/custom-header.js +102 -98
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +156 -148
- package/dist/components/data/ag-grid-react/theme.js +3 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +5 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +13 -0
- package/dist/components/data/ag-grid-react/useGridAutoSizeStrategyOnResize.js +8 -5
- package/dist/components/data/data-table/data-table-column-apply.d.ts +16 -0
- package/dist/components/data/data-table/data-table-column-apply.js +18 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +13 -3
- package/dist/components/data/data-table/data-table-column-list.js +198 -191
- package/dist/components/data/data-table/data-table-constants.d.ts +3 -4
- package/dist/components/data/data-table/data-table-context.d.ts +3 -6
- package/dist/components/data/data-table/data-table-context.js +21 -10
- package/dist/components/data/data-table/data-table-saved-views.js +26 -26
- package/dist/components/data/data-table/data-table-sheet-portal-store.d.ts +13 -0
- package/dist/components/data/data-table/data-table-sheet-portal-store.js +36 -0
- package/dist/components/data/data-table/data-table-sheet.d.ts +3 -6
- package/dist/components/data/data-table/data-table-sheet.js +1 -1
- package/dist/components/data/data-table/data-table-view-menu.js +40 -40
- package/dist/components/data/data-table/data-table.d.ts +8 -10
- package/dist/components/data/data-table/data-table.js +131 -113
- package/dist/components/data/data-table/data-table.types.d.ts +35 -0
- package/dist/components/data/data-table/index.js +28 -27
- package/dist/components/data/data-table/indicator-legend.js +6 -6
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +8 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +72 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.d.ts +13 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.js +25 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.d.ts +6 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +41 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +31 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +233 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.d.ts +18 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +133 -0
- package/dist/components/data/expandable-list-item/expandable-list-item.d.ts +5 -0
- package/dist/components/data/{expandable-sku/expandable-sku.types.d.ts → expandable-list-item/expandable-list-item.types.d.ts} +7 -7
- package/dist/components/data/expandable-list-item/index.d.ts +5 -0
- package/dist/components/data/expandable-list-item/index.js +19 -0
- package/dist/components/data/nested-list/components/NestedListHeader.js +11 -11
- package/dist/components/data/nested-list/components/SortableItem.js +2 -2
- package/dist/components/data-display/avatar/avatar.types.d.ts +2 -0
- package/dist/components/data-display/badge/badge.types.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +11 -11
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +7 -7
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +31 -31
- package/dist/components/data-display/card/card.js +8 -8
- package/dist/components/data-display/chart/chart.types.d.ts +9 -0
- package/dist/components/data-display/skeleton/skeleton.js +6 -6
- package/dist/components/data-display/statistics-card/statistics-card.js +14 -14
- package/dist/components/feedback/alert-dialog/alert-dialog.js +19 -19
- package/dist/components/feedback/dialog/dialog.js +1 -1
- package/dist/components/feedback/drawer/drawer.js +18 -18
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +68 -55
- package/dist/components/feedback/popover/popover.js +8 -1
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/tooltip/tooltip.js +22 -22
- package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
- package/dist/components/flows/command-palette/command-palette.js +104 -104
- package/dist/components/flows/command-palette/shortcut-settings.js +34 -34
- package/dist/components/flows/filter-strip/filter-tag-list.js +4 -4
- package/dist/components/flows/notification-panel/notification-list.js +17 -17
- package/dist/components/flows/notification-panel/notification-panel.js +4 -4
- package/dist/components/flows/notification-panel/notification-panel.types.d.ts +3 -0
- package/dist/components/flows/wizard/wizard.js +8 -8
- package/dist/components/forms/combobox/combobox.js +20 -20
- package/dist/components/forms/date-picker/date-picker.js +17 -17
- package/dist/components/forms/date-picker/date-range-picker.js +3 -3
- package/dist/components/forms/date-picker/month-picker.js +1 -1
- package/dist/components/forms/date-picker/month-range-picker.js +42 -42
- package/dist/components/forms/date-picker/week-picker.js +15 -15
- package/dist/components/forms/date-picker/week-range-picker.js +3 -3
- package/dist/components/forms/file-upload/file-upload.js +33 -33
- package/dist/components/forms/input/input.js +8 -8
- package/dist/components/forms/input/input.variants.js +3 -3
- package/dist/components/forms/select/components/SelectMenuPanel.d.ts +1 -2
- package/dist/components/forms/select/components/SelectMenuPanel.js +17 -19
- package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
- package/dist/components/forms/select/components/SelectTrigger.js +119 -116
- package/dist/components/forms/select/components/Submenu.js +7 -7
- package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
- package/dist/components/forms/select/select.js +88 -88
- package/dist/components/forms/select/select.variants.js +5 -5
- package/dist/components/layout/sidebar/sidebar.d.ts +7 -50
- package/dist/components/layout/sidebar/sidebar.js +12 -11
- package/dist/components/layout/sidebar/sidebar.types.d.ts +35 -1
- package/dist/components/primitives/button-group/button-group.js +32 -32
- package/dist/components/primitives/chips/chips.variants.js +5 -5
- package/dist/components/primitives/empty-container/empty-container.types.d.ts +3 -0
- package/dist/components/primitives/kbd/kbd.variants.js +3 -3
- package/dist/components/primitives/stepper/stepper.js +6 -6
- package/dist/components/primitives/tag/tag.variants.js +2 -2
- package/dist/impact-nova-components.css +97 -0
- package/dist/impact-nova-tokens.scss +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +446 -413
- package/dist/lib/compose-refs.d.ts +8 -0
- package/dist/lib/compose-refs.js +14 -0
- package/dist/lib/primitives/field.types.d.ts +8 -2
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +33 -16
- package/dist/lib/virtualized/useVirtualizedList.d.ts +2 -0
- package/dist/lib/virtualized/useVirtualizedList.js +115 -109
- package/dist/lib/virtualized/virtualized-list-context.d.ts +12 -0
- package/dist/lib/virtualized/virtualized-list-context.js +21 -0
- package/dist/lib/virtualized/virtualized-list-parts.d.ts +51 -0
- package/dist/lib/virtualized/virtualized-list-parts.js +175 -0
- package/dist/lib/virtualized/virtualized-list-utils.d.ts +5 -0
- package/dist/lib/virtualized/virtualized-list-utils.js +6 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +24 -15
- package/tailwind.config.js +1 -0
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.d.ts +0 -15
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.js +0 -27
- package/dist/components/data/expandable-sku/expandable-sku.d.ts +0 -38
- package/dist/components/data/expandable-sku/expandable-sku.js +0 -245
- package/dist/components/data/expandable-sku/index.d.ts +0 -2
- package/dist/components/data/expandable-sku/index.js +0 -4
|
@@ -1,115 +1,117 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { NestedList as
|
|
5
|
-
import { SelectionMode as
|
|
6
|
-
import { useImpactNovaI18n as
|
|
7
|
-
import { mergePartialOrderedColumnState as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs as ae, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as K, useRef as L, useCallback as C, useEffect as J } from "react";
|
|
3
|
+
import { useDataTable as ue } from "./data-table-context.js";
|
|
4
|
+
import { NestedList as de } from "../nested-list/nested-list.js";
|
|
5
|
+
import { SelectionMode as fe } from "../nested-list/nested-list.types.js";
|
|
6
|
+
import { useImpactNovaI18n as pe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
7
|
+
import { mergePartialOrderedColumnState as Q } from "./data-table-column-state.js";
|
|
8
|
+
import { afterSynchronousColumnApply as U, GRID_AUTO_UNPIN_WAIT_MS as he, readGridColumnPinned as me, EXTERNAL_SYNC_DEBOUNCE_MS as ge } from "./data-table-column-apply.js";
|
|
9
|
+
import { subscribeGridApiEvents as Ce, subscribeGridApiEvent as be } from "../ag-grid-react/grid-api-event-subscription.js";
|
|
10
|
+
import { PinSwitch as Se } from "./pin-switch.js";
|
|
11
|
+
import { ColumnIndicator as Z } from "./column-indicator.js";
|
|
12
|
+
import { IndicatorLegend as Ie } from "./indicator-legend.js";
|
|
13
|
+
function ye(P) {
|
|
14
|
+
const E = [];
|
|
15
|
+
let b = P.getOriginalParent();
|
|
16
|
+
for (; b; ) {
|
|
17
|
+
const M = b.getColGroupDef();
|
|
18
|
+
M?.headerName && M?.children && E.push(b), b = b.getOriginalParent();
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
+
return E.reverse(), E;
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
-
enableApplyDiscard:
|
|
23
|
-
showSearch:
|
|
24
|
-
showSelectAll:
|
|
25
|
-
showCollapse:
|
|
22
|
+
const Me = ({
|
|
23
|
+
enableApplyDiscard: P = !1,
|
|
24
|
+
showSearch: E = !0,
|
|
25
|
+
showSelectAll: b = !0,
|
|
26
|
+
showCollapse: M = !0
|
|
26
27
|
}) => {
|
|
27
|
-
const { gridApi:
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
const { gridApi: n } = ue(), { t: x } = pe(), [ee, $] = K([]), [te, ne] = K(!1), m = L(!1), j = L(null), O = L(0), V = L({}), [X, re] = K(!1), S = C(() => {
|
|
29
|
+
if (!n || m.current) return;
|
|
30
|
+
const e = n.getColumnState(), t = n.getAllGridColumns?.() ?? n.getColumns() ?? [], o = new Map(t.map((l) => [l.getColId(), l])), i = [], u = [], r = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
31
|
+
s.set(i, "f"), s.set(u, "s");
|
|
31
32
|
let p = 0;
|
|
32
|
-
const
|
|
33
|
-
let
|
|
34
|
-
return
|
|
35
|
-
}, h = (
|
|
36
|
-
const a =
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
id:
|
|
43
|
-
label:
|
|
33
|
+
const A = (l) => {
|
|
34
|
+
let c = s.get(l);
|
|
35
|
+
return c === void 0 && (c = `n${p++}`, s.set(l, c)), c;
|
|
36
|
+
}, h = (l, c) => {
|
|
37
|
+
const a = l.getGroupId(), y = A(c), T = `${a}::${y}`, k = r.get(T);
|
|
38
|
+
if (k && k.list === c && c[c.length - 1] === k.node)
|
|
39
|
+
return k.node;
|
|
40
|
+
const D = g.get(T) || 0;
|
|
41
|
+
g.set(T, D + 1);
|
|
42
|
+
const w = l.getColGroupDef(), N = {
|
|
43
|
+
id: D === 0 ? `${a}__${y}` : `${a}__${y}__${D}`,
|
|
44
|
+
label: w?.headerName || a,
|
|
44
45
|
checked: !0,
|
|
45
46
|
children: [],
|
|
46
47
|
category: "group"
|
|
47
48
|
};
|
|
48
|
-
return
|
|
49
|
+
return c.push(N), r.set(T, { list: c, node: N }), N;
|
|
49
50
|
};
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
let a =
|
|
51
|
+
let z = 0, d = 0, F = 0, I = 0;
|
|
52
|
+
e.forEach((l) => {
|
|
53
|
+
const c = o.get(l.colId) ?? n.getColumn(l.colId);
|
|
54
|
+
if (!c) return;
|
|
55
|
+
let a = n.getDisplayNameForColumn(c, "header");
|
|
55
56
|
if (a === "") return;
|
|
56
57
|
if (a == null) {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
a =
|
|
58
|
+
const G = c.getColDef();
|
|
59
|
+
if (G.headerName === "") return;
|
|
60
|
+
a = G.headerName || G.field || l.colId;
|
|
60
61
|
}
|
|
61
62
|
if (!a || a.trim() === "")
|
|
62
63
|
return;
|
|
63
|
-
const
|
|
64
|
-
id:
|
|
64
|
+
const y = !l.hide, T = !!l.sort, k = c.isFilterActive(), D = l.pinned ?? c.getPinned() ?? null, w = D === "left" ? "left" : D === "right" ? "right" : null, q = {
|
|
65
|
+
id: l.colId,
|
|
65
66
|
label: a,
|
|
66
|
-
checked:
|
|
67
|
+
checked: y,
|
|
67
68
|
data: {
|
|
68
|
-
hasSortApplied:
|
|
69
|
-
hasFilterApplied:
|
|
70
|
-
pinned:
|
|
69
|
+
hasSortApplied: T,
|
|
70
|
+
hasFilterApplied: k,
|
|
71
|
+
pinned: w
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
let
|
|
77
|
-
for (const
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
w ? (z++, y && d++) : (F++, y && I++);
|
|
75
|
+
const N = w ? i : u, W = ye(c);
|
|
76
|
+
if (W.length > 0) {
|
|
77
|
+
let G = N, B = null;
|
|
78
|
+
for (const se of W)
|
|
79
|
+
B = h(se, G), G = B.children;
|
|
80
|
+
B.children.push(q);
|
|
80
81
|
} else
|
|
81
|
-
|
|
82
|
+
N.push(q);
|
|
82
83
|
});
|
|
83
|
-
const
|
|
84
|
-
let
|
|
85
|
-
for (const a of
|
|
86
|
-
a.children && (a.checked =
|
|
87
|
-
return
|
|
84
|
+
const f = (l) => {
|
|
85
|
+
let c = l.length > 0;
|
|
86
|
+
for (const a of l)
|
|
87
|
+
a.children && (a.checked = f(a.children)), a.checked || (c = !1);
|
|
88
|
+
return c;
|
|
88
89
|
};
|
|
89
|
-
|
|
90
|
-
const
|
|
90
|
+
f(i), f(u);
|
|
91
|
+
const _ = [
|
|
91
92
|
{
|
|
92
93
|
id: "root-frozen",
|
|
93
|
-
label:
|
|
94
|
-
checked:
|
|
95
|
-
children:
|
|
94
|
+
label: x("dataTable.frozenColumns"),
|
|
95
|
+
checked: z > 0 && d === z,
|
|
96
|
+
children: i,
|
|
96
97
|
category: "structure",
|
|
97
98
|
isDragDisabled: !0
|
|
98
99
|
},
|
|
99
100
|
{
|
|
100
101
|
id: "root-scrollable",
|
|
101
|
-
label:
|
|
102
|
-
checked:
|
|
103
|
-
children:
|
|
102
|
+
label: x("dataTable.scrollableColumns"),
|
|
103
|
+
checked: F > 0 && I === F,
|
|
104
|
+
children: u,
|
|
104
105
|
category: "structure",
|
|
105
106
|
isDragDisabled: !0
|
|
106
107
|
}
|
|
107
108
|
];
|
|
108
|
-
$(
|
|
109
|
-
}, [
|
|
109
|
+
$(_), ne(!0);
|
|
110
|
+
}, [n, x]);
|
|
110
111
|
J(() => {
|
|
111
|
-
if (!
|
|
112
|
-
|
|
112
|
+
if (!n) return;
|
|
113
|
+
queueMicrotask(() => S());
|
|
114
|
+
const e = [
|
|
113
115
|
"columnVisible",
|
|
114
116
|
"columnPinned",
|
|
115
117
|
"columnMoved",
|
|
@@ -126,163 +128,168 @@ const be = 300, K = 100, xe = ({
|
|
|
126
128
|
"filterChanged"
|
|
127
129
|
];
|
|
128
130
|
let t = null;
|
|
129
|
-
const
|
|
130
|
-
t && clearTimeout(t), t = setTimeout(() => {
|
|
131
|
-
if (t = null,
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
},
|
|
131
|
+
const o = () => {
|
|
132
|
+
m.current || (t && clearTimeout(t), t = setTimeout(() => {
|
|
133
|
+
if (t = null, m.current) return;
|
|
134
|
+
const i = j.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
|
|
135
|
+
i && (O.current = i.scrollTop), S(), re((u) => !u);
|
|
136
|
+
}, ge));
|
|
135
137
|
};
|
|
136
|
-
if (!
|
|
137
|
-
const
|
|
138
|
+
if (!n.isDestroyed()) {
|
|
139
|
+
const i = Ce(n, e, o);
|
|
138
140
|
return () => {
|
|
139
|
-
|
|
141
|
+
t && clearTimeout(t), i();
|
|
140
142
|
};
|
|
141
143
|
}
|
|
142
144
|
return () => {
|
|
143
|
-
|
|
145
|
+
t && clearTimeout(t);
|
|
144
146
|
};
|
|
145
|
-
}, [
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
|
|
147
|
+
}, [n, S]), J(() => {
|
|
148
|
+
if (O.current === 0) return;
|
|
149
|
+
const e = requestAnimationFrame(() => {
|
|
150
|
+
const t = j.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
|
|
151
|
+
t && (t.scrollTop = O.current, O.current = 0);
|
|
150
152
|
});
|
|
151
|
-
return () => cancelAnimationFrame(
|
|
152
|
-
}, [
|
|
153
|
-
const Y =
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
if (
|
|
157
|
-
|
|
153
|
+
return () => cancelAnimationFrame(e);
|
|
154
|
+
}, [X]);
|
|
155
|
+
const Y = C((e) => {
|
|
156
|
+
const t = [], o = (i, u) => {
|
|
157
|
+
i.forEach((r) => {
|
|
158
|
+
if (r.id === "root-frozen") {
|
|
159
|
+
r.children && o(r.children, "left");
|
|
158
160
|
return;
|
|
159
161
|
}
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
+
if (r.id === "root-scrollable") {
|
|
163
|
+
r.children && o(r.children, null);
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
else if (
|
|
166
|
+
if (r.category === "group" || r.children && r.children.length > 0)
|
|
167
|
+
r.children && o(r.children, u);
|
|
168
|
+
else if (n?.getColumn(r.id)) {
|
|
167
169
|
let p;
|
|
168
|
-
if (
|
|
170
|
+
if (u === null)
|
|
169
171
|
p = null;
|
|
170
172
|
else {
|
|
171
|
-
const h =
|
|
172
|
-
p = h === "left" || h === "right" ? h :
|
|
173
|
+
const h = r.data?.pinned;
|
|
174
|
+
p = h === "left" || h === "right" ? h : u;
|
|
173
175
|
}
|
|
174
|
-
|
|
175
|
-
colId:
|
|
176
|
+
t.push({
|
|
177
|
+
colId: r.id,
|
|
176
178
|
pinned: p,
|
|
177
|
-
hide: !
|
|
179
|
+
hide: !r.checked
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
182
|
});
|
|
181
183
|
};
|
|
182
|
-
return
|
|
183
|
-
}, [
|
|
184
|
-
if (!
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
184
|
+
return o(e, null), t;
|
|
185
|
+
}, [n]), R = C((e) => {
|
|
186
|
+
if (!n) return;
|
|
187
|
+
m.current = !0;
|
|
188
|
+
const t = Y(e);
|
|
189
|
+
if (t.length === 0) {
|
|
190
|
+
U(() => {
|
|
191
|
+
m.current = !1;
|
|
192
|
+
});
|
|
191
193
|
return;
|
|
192
194
|
}
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
195
|
+
const o = n.getColumnState(), i = Q(o, t), u = new Set(o.filter((d) => d.pinned).map((d) => d.colId)), r = i.filter((d) => d.pinned && !u.has(d.colId)), g = new Set(r.map((d) => d.colId));
|
|
196
|
+
n.applyColumnState({ state: i, applyOrder: !0 });
|
|
197
|
+
const s = () => {
|
|
198
|
+
m.current = !1, S();
|
|
197
199
|
};
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
+
if (g.size === 0) {
|
|
201
|
+
U(s);
|
|
200
202
|
return;
|
|
201
203
|
}
|
|
202
|
-
let p = !1,
|
|
203
|
-
h =
|
|
204
|
-
if (p ||
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
return
|
|
204
|
+
let p = !1, A = null, h = null;
|
|
205
|
+
h = be(n, "columnPinned", () => {
|
|
206
|
+
if (p || n.isDestroyed()) return;
|
|
207
|
+
const d = n.getColumnState();
|
|
208
|
+
if (r.filter((I) => {
|
|
209
|
+
const f = d.find((_) => _.colId === I.colId);
|
|
210
|
+
return f && !f.pinned;
|
|
209
211
|
}).length > 0) {
|
|
210
|
-
p = !0,
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
const
|
|
214
|
-
(
|
|
212
|
+
p = !0, A && clearTimeout(A), h?.();
|
|
213
|
+
const I = i.filter((f) => f.pinned && !g.has(f.colId));
|
|
214
|
+
if (I.length > 0) {
|
|
215
|
+
const f = I[0], _ = i.map(
|
|
216
|
+
(l) => l.colId === f.colId ? { ...l, pinned: null } : l
|
|
215
217
|
);
|
|
216
|
-
|
|
218
|
+
n.applyColumnState({ state: _, applyOrder: !0 });
|
|
217
219
|
}
|
|
218
|
-
|
|
220
|
+
U(s);
|
|
219
221
|
}
|
|
220
|
-
}),
|
|
221
|
-
h?.(), p ||
|
|
222
|
-
},
|
|
223
|
-
}, [
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
|
|
227
|
-
}, [
|
|
228
|
-
$((
|
|
229
|
-
const
|
|
230
|
-
...
|
|
222
|
+
}), A = setTimeout(() => {
|
|
223
|
+
h?.(), p || s();
|
|
224
|
+
}, he);
|
|
225
|
+
}, [n, Y, S]), le = C((e) => {
|
|
226
|
+
R(e);
|
|
227
|
+
}, [R]), oe = C((e) => {
|
|
228
|
+
P || R(e), $(e);
|
|
229
|
+
}, [P, R]), H = C((e, t) => {
|
|
230
|
+
if ($((u) => {
|
|
231
|
+
const r = (g) => g.map((s) => s.id === e ? {
|
|
232
|
+
...s,
|
|
231
233
|
data: {
|
|
232
|
-
...
|
|
233
|
-
pinned:
|
|
234
|
+
...s.data,
|
|
235
|
+
pinned: t
|
|
234
236
|
}
|
|
235
|
-
} :
|
|
236
|
-
...
|
|
237
|
-
children: s
|
|
238
|
-
} :
|
|
239
|
-
return
|
|
240
|
-
}),
|
|
241
|
-
|
|
237
|
+
} : s.children ? {
|
|
238
|
+
...s,
|
|
239
|
+
children: r(s.children)
|
|
240
|
+
} : s);
|
|
241
|
+
return r(u);
|
|
242
|
+
}), !n) return;
|
|
243
|
+
m.current = !0;
|
|
244
|
+
const o = n.getColumnState(), i = Q(o, [
|
|
245
|
+
{ colId: e, pinned: t }
|
|
246
|
+
]);
|
|
247
|
+
n.applyColumnState({ state: i, applyOrder: !0 }), U(() => {
|
|
248
|
+
m.current = !1, me(n, e) !== t && S();
|
|
242
249
|
});
|
|
243
|
-
}, [
|
|
244
|
-
if (!
|
|
245
|
-
const
|
|
246
|
-
return !
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
}, [n, S]), ce = C((e, t) => {
|
|
251
|
+
if (!t.isLeaf) return null;
|
|
252
|
+
const o = e.data;
|
|
253
|
+
return !o?.hasSortApplied && !o?.hasFilterApplied ? null : /* @__PURE__ */ ae("span", { className: "inline-flex items-center gap-1 ml-1.5 shrink-0", children: [
|
|
254
|
+
o?.hasSortApplied && /* @__PURE__ */ v(Z, { type: "sort" }),
|
|
255
|
+
o?.hasFilterApplied && /* @__PURE__ */ v(Z, { type: "filter" })
|
|
249
256
|
] });
|
|
250
|
-
}, []),
|
|
251
|
-
const
|
|
252
|
-
return
|
|
253
|
-
|
|
257
|
+
}, []), ie = C((e, t) => {
|
|
258
|
+
const o = e.data;
|
|
259
|
+
return e.category === "structure" ? e.id !== "root-frozen" ? null : /* @__PURE__ */ v(Ie, {}) : !t.isLeaf || !(o?.pinned === "left" || o?.pinned === "right") ? null : /* @__PURE__ */ v(
|
|
260
|
+
Se,
|
|
254
261
|
{
|
|
255
|
-
value:
|
|
256
|
-
onChange: (
|
|
262
|
+
value: o?.pinned ?? null,
|
|
263
|
+
onChange: (u) => H(e.id, u),
|
|
257
264
|
className: "shrink-0"
|
|
258
265
|
}
|
|
259
266
|
);
|
|
260
267
|
}, [H]);
|
|
261
|
-
return
|
|
262
|
-
|
|
268
|
+
return te ? /* @__PURE__ */ v("div", { ref: j, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ v(
|
|
269
|
+
de,
|
|
263
270
|
{
|
|
264
|
-
items:
|
|
265
|
-
onChange:
|
|
266
|
-
onSubmit:
|
|
267
|
-
renderLabelExtras:
|
|
268
|
-
renderActions:
|
|
269
|
-
enableApplyDiscard:
|
|
270
|
-
enableSearch:
|
|
271
|
-
enableSelectAll:
|
|
271
|
+
items: ee,
|
|
272
|
+
onChange: oe,
|
|
273
|
+
onSubmit: le,
|
|
274
|
+
renderLabelExtras: ce,
|
|
275
|
+
renderActions: ie,
|
|
276
|
+
enableApplyDiscard: P,
|
|
277
|
+
enableSearch: E,
|
|
278
|
+
enableSelectAll: b,
|
|
272
279
|
enableDragDrop: !0,
|
|
273
280
|
enableCollapse: !0,
|
|
274
|
-
enableGlobalCollapse:
|
|
275
|
-
selectionMode:
|
|
276
|
-
searchPlaceholder:
|
|
281
|
+
enableGlobalCollapse: M,
|
|
282
|
+
selectionMode: fe.CASCADE_DOWN,
|
|
283
|
+
searchPlaceholder: x("dataTable.searchColumnsPlaceholder"),
|
|
277
284
|
className: "h-full",
|
|
278
285
|
initialCollapsedItems: V.current,
|
|
279
|
-
onCollapseChange: (
|
|
280
|
-
V.current =
|
|
286
|
+
onCollapseChange: (e) => {
|
|
287
|
+
V.current = e;
|
|
281
288
|
}
|
|
282
289
|
},
|
|
283
|
-
|
|
284
|
-
) }) : /* @__PURE__ */
|
|
290
|
+
X ? "sync-a" : "sync-b"
|
|
291
|
+
) }) : /* @__PURE__ */ v("div", { className: "p-4 text-[13px] text-content-placeholder", children: x("dataTable.loadingColumns") });
|
|
285
292
|
};
|
|
286
293
|
export {
|
|
287
|
-
|
|
294
|
+
Me as DataTableColumnList
|
|
288
295
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Minimum height (px) for the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* refreshes on sheet open/close).
|
|
2
|
+
* Minimum height (px) for the scoped settings sheet host while open.
|
|
3
|
+
* Applied on `DataTableContent`'s layout frame (not the absolute portal layer)
|
|
4
|
+
* so short grids grow enough for a usable column list without re-rendering AG Grid.
|
|
6
5
|
*/
|
|
7
6
|
export declare const DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX = 400;
|
|
8
7
|
/** DOM class toggled imperatively for viewport-fill table shell (styles in `src/index.scss`). */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { DataTableSheetPortalStore } from './data-table-sheet-portal-store';
|
|
2
3
|
export type DataTableFontSize = "small" | "medium" | "large";
|
|
3
4
|
export type DataTableNumericFormat = "full" | "k" | "m" | "b" | "full_precision";
|
|
4
5
|
export type DataTableRowHeight = "default" | "compact" | "comfort";
|
|
@@ -15,16 +16,12 @@ export interface DataTableContextValue {
|
|
|
15
16
|
setRowHeight: (height: DataTableRowHeight) => void;
|
|
16
17
|
}
|
|
17
18
|
export declare const DataTableContext: import('react').Context<DataTableContextValue | null>;
|
|
19
|
+
export declare const DataTableSheetPortalStoreContext: import('react').Context<DataTableSheetPortalStore | null>;
|
|
18
20
|
export declare const useDataTable: () => DataTableContextValue;
|
|
19
|
-
|
|
20
|
-
* Separate context for sheet-portal state that changes on every sheet open/close.
|
|
21
|
-
* Isolated from `DataTableContext` so that `scopedSheetOpen` toggling does NOT
|
|
22
|
-
* force grid consumers (`DataTableContent`, `AgGridWrapper`) to re-render.
|
|
23
|
-
*/
|
|
21
|
+
export declare const useDataTableSheetPortalStore: () => DataTableSheetPortalStore;
|
|
24
22
|
export interface DataTableSheetPortalContextValue {
|
|
25
23
|
sheetTarget: HTMLDivElement | null;
|
|
26
24
|
setSheetTarget: (node: HTMLDivElement | null) => void;
|
|
27
25
|
scopedSheetOpen: boolean;
|
|
28
26
|
}
|
|
29
|
-
export declare const DataTableSheetPortalContext: import('react').Context<DataTableSheetPortalContextValue | null>;
|
|
30
27
|
export declare const useDataTableSheetPortal: () => DataTableSheetPortalContextValue;
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
import { createContext as e, useContext as a } from "react";
|
|
2
|
-
|
|
2
|
+
import { useDataTableSheetPortalSnapshot as s } from "./data-table-sheet-portal-store.js";
|
|
3
|
+
const n = e(
|
|
3
4
|
null
|
|
4
|
-
), l = () => {
|
|
5
|
-
const t = a(
|
|
5
|
+
), l = e(null), b = () => {
|
|
6
|
+
const t = a(n);
|
|
6
7
|
if (!t)
|
|
7
8
|
throw new Error("useDataTable must be used within a DataTable");
|
|
8
9
|
return t;
|
|
9
|
-
},
|
|
10
|
-
const t = a(
|
|
10
|
+
}, u = () => {
|
|
11
|
+
const t = a(l);
|
|
11
12
|
if (!t)
|
|
12
|
-
throw new Error(
|
|
13
|
+
throw new Error(
|
|
14
|
+
"useDataTableSheetPortalStore must be used within a DataTable"
|
|
15
|
+
);
|
|
13
16
|
return t;
|
|
17
|
+
}, c = () => {
|
|
18
|
+
const t = u(), { sheetTarget: o, scopedSheetOpen: r } = s(t);
|
|
19
|
+
return {
|
|
20
|
+
sheetTarget: o,
|
|
21
|
+
scopedSheetOpen: r,
|
|
22
|
+
setSheetTarget: t.setSheetTarget
|
|
23
|
+
};
|
|
14
24
|
};
|
|
15
25
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
n as DataTableContext,
|
|
27
|
+
l as DataTableSheetPortalStoreContext,
|
|
28
|
+
b as useDataTable,
|
|
29
|
+
c as useDataTableSheetPortal,
|
|
30
|
+
u as useDataTableSheetPortalStore
|
|
20
31
|
};
|