impact-nova 1.7.39 → 1.7.41
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/editors/date-cell-editor.js +58 -48
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +0 -2
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +212 -218
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -2
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +97 -127
- package/dist/components/ui/ag-grid-react/headers/components/date-filter-picker.d.ts +39 -0
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +433 -299
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +33 -1
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +60 -26
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.d.ts +11 -10
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +284 -260
- package/dist/components/ui/ag-grid-react/index.js +24 -25
- package/dist/components/ui/data-table/column-indicator.d.ts +17 -0
- package/dist/components/ui/data-table/column-indicator.js +30 -0
- package/dist/components/ui/data-table/data-table-column-list.js +210 -154
- package/dist/components/ui/data-table/data-table.js +60 -59
- package/dist/components/ui/data-table/index.d.ts +3 -0
- package/dist/components/ui/data-table/index.js +34 -28
- package/dist/components/ui/data-table/indicator-legend.d.ts +8 -0
- package/dist/components/ui/data-table/indicator-legend.js +20 -0
- package/dist/components/ui/data-table/pin-switch.d.ts +30 -0
- package/dist/components/ui/data-table/pin-switch.js +75 -0
- package/dist/components/ui/date-picker/date-picker.js +65 -63
- package/dist/components/ui/date-picker/date-range-picker.js +77 -75
- package/dist/components/ui/nested-list/components/NestedListContent.js +7 -7
- package/dist/components/ui/nested-list/components/SortableItem.d.ts +10 -0
- package/dist/components/ui/nested-list/components/SortableItem.js +91 -83
- package/dist/components/ui/nested-list/nested-list.js +184 -178
- package/dist/components/ui/types/ag-grid.types.d.ts +16 -2
- package/dist/components/ui/types/date-picker.types.d.ts +4 -0
- package/dist/components/ui/types/nested-list.types.d.ts +12 -0
- package/dist/i18n/defaultMessages.d.ts +10 -0
- package/dist/i18n/defaultMessages.js +16 -8
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/kn.js +8 -0
- package/dist/icons/assets/archive.svg.js +5 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +280 -278
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +180 -174
- package/package.json +1 -1
- package/tailwind.config.js +16 -0
|
@@ -13,13 +13,13 @@ import { AG_GRID_VALUE_FORMATTERS as ye } from "./value-formatters.js";
|
|
|
13
13
|
/* empty css */
|
|
14
14
|
const be = re(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
|
|
15
15
|
ie.registerModules([se, ce, ue]);
|
|
16
|
-
const x = "",
|
|
16
|
+
const x = "", I = "", H = (s) => {
|
|
17
17
|
if (!s) return;
|
|
18
18
|
const r = s.cellRendererParams?.splits;
|
|
19
19
|
if (Array.isArray(r) && r.length > 0) return r;
|
|
20
20
|
const l = s.cellEditorParams?.splits;
|
|
21
21
|
if (Array.isArray(l) && l.length > 0) return l;
|
|
22
|
-
},
|
|
22
|
+
}, _ = (s, r) => {
|
|
23
23
|
const l = [];
|
|
24
24
|
for (const g of r) {
|
|
25
25
|
const f = g?.field?.split(".").pop();
|
|
@@ -44,7 +44,7 @@ const x = "", T = "", H = (s) => {
|
|
|
44
44
|
l.push("");
|
|
45
45
|
}
|
|
46
46
|
return l;
|
|
47
|
-
},
|
|
47
|
+
}, V = (s) => {
|
|
48
48
|
if (typeof navigator < "u" && navigator.clipboard?.writeText) {
|
|
49
49
|
navigator.clipboard.writeText(s).catch(() => K(s));
|
|
50
50
|
return;
|
|
@@ -69,7 +69,7 @@ function De({
|
|
|
69
69
|
onGridReady: a,
|
|
70
70
|
...u
|
|
71
71
|
}) {
|
|
72
|
-
const c = b(null), h = b(null), [F, w] = j(null), [
|
|
72
|
+
const c = b(null), h = b(null), [F, w] = j(null), [P, M] = j(!1), [O, D] = j(null), [W, L] = j(!1), S = b(null), T = b(null), E = b(null), U = v(() => [], []), $ = C(() => ({
|
|
73
73
|
numericColumn: {
|
|
74
74
|
cellClass: "ag-right-aligned-cell",
|
|
75
75
|
headerClass: "ag-right-aligned-header",
|
|
@@ -102,10 +102,10 @@ function De({
|
|
|
102
102
|
c.current.setGridOption("context", { ...e, activeSearchColumnId: null }), c.current.refreshHeader();
|
|
103
103
|
},
|
|
104
104
|
openAdvancedFilter: (e) => {
|
|
105
|
-
D(e || null),
|
|
105
|
+
D(e || null), M(!0);
|
|
106
106
|
},
|
|
107
107
|
closeAdvancedFilter: () => {
|
|
108
|
-
|
|
108
|
+
M(!1), D(null);
|
|
109
109
|
},
|
|
110
110
|
applyAdvancedFilter: (e) => {
|
|
111
111
|
if (!c.current) return;
|
|
@@ -113,17 +113,17 @@ function De({
|
|
|
113
113
|
c.current.setFilterModel(t), c.current.onFilterChanged();
|
|
114
114
|
},
|
|
115
115
|
openMenu: (e, t, o = "column") => {
|
|
116
|
-
|
|
116
|
+
S.current = e, T.current = t, E.current = o, L(!0);
|
|
117
117
|
},
|
|
118
118
|
closeMenu: () => {
|
|
119
|
-
|
|
119
|
+
S.current = null, T.current = null, E.current = null, L(!1);
|
|
120
120
|
},
|
|
121
121
|
// Getters read from refs - O(1) per header, no memory allocation
|
|
122
122
|
get activeMenuColumnId() {
|
|
123
|
-
return
|
|
123
|
+
return S.current;
|
|
124
124
|
},
|
|
125
125
|
get activeMenuVariant() {
|
|
126
|
-
return
|
|
126
|
+
return E.current;
|
|
127
127
|
}
|
|
128
128
|
}), []), q = v((e) => {
|
|
129
129
|
c.current = e.api, w(e.api);
|
|
@@ -157,7 +157,7 @@ function De({
|
|
|
157
157
|
suppressHeaderKeyboardEvent: (e) => {
|
|
158
158
|
const { event: t } = e, o = t.target;
|
|
159
159
|
if (o.tagName === "INPUT" || o.tagName === "TEXTAREA")
|
|
160
|
-
return !(t.key === "
|
|
160
|
+
return !(t.key === "Escape" || t.key === "Tab");
|
|
161
161
|
if (t.key === "Enter" || t.key === " ") {
|
|
162
162
|
const n = o.closest(".ag-header-cell");
|
|
163
163
|
if (n) {
|
|
@@ -189,12 +189,12 @@ function De({
|
|
|
189
189
|
if (t == null || typeof t != "object") return t;
|
|
190
190
|
const o = H(e.column?.getColDef());
|
|
191
191
|
if (o && o.length > 0) {
|
|
192
|
-
const n =
|
|
192
|
+
const n = _(t, o);
|
|
193
193
|
if (o.length === 1) {
|
|
194
194
|
const d = o[0]?.field?.split(".").pop(), y = d ? t[d] : void 0;
|
|
195
195
|
return y && typeof y == "object" && "value" in y ? y.value ?? "" : n[0];
|
|
196
196
|
}
|
|
197
|
-
return
|
|
197
|
+
return I + n.join(x);
|
|
198
198
|
}
|
|
199
199
|
const i = Object.entries(t).map(([, n]) => n && typeof n == "object" && "value" in n ? n.value : typeof n != "object" && typeof n < "u" ? n : null).filter((n) => n != null);
|
|
200
200
|
return i.length === 0 ? "" : i.length === 1 ? i[0] : i.join(x);
|
|
@@ -211,8 +211,8 @@ function De({
|
|
|
211
211
|
return e.value;
|
|
212
212
|
}, []), Y = v((e) => {
|
|
213
213
|
const t = e?.data ?? "";
|
|
214
|
-
if (!t.includes(x) && !t.includes(
|
|
215
|
-
|
|
214
|
+
if (!t.includes(x) && !t.includes(I)) {
|
|
215
|
+
V(t);
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
const o = [], i = t.split(`
|
|
@@ -223,7 +223,7 @@ function De({
|
|
|
223
223
|
o.push("");
|
|
224
224
|
continue;
|
|
225
225
|
}
|
|
226
|
-
const k = d.split(" ").map((p) => p.startsWith(
|
|
226
|
+
const k = d.split(" ").map((p) => p.startsWith(I) ? { isSplit: !0, slots: p.slice(1).split(x) } : { isSplit: !1, slots: p.split(x) }), N = Math.max(1, ...k.map((p) => p.slots.length));
|
|
227
227
|
if (N === 1) {
|
|
228
228
|
o.push(k.map((p) => p.slots[0] ?? "").join(" "));
|
|
229
229
|
continue;
|
|
@@ -233,7 +233,7 @@ function De({
|
|
|
233
233
|
o.push(te.join(" "));
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
|
|
236
|
+
V(o.join(`
|
|
237
237
|
`));
|
|
238
238
|
}, []), R = v((e) => {
|
|
239
239
|
const t = e.value;
|
|
@@ -241,7 +241,7 @@ function De({
|
|
|
241
241
|
if (typeof t != "object") return String(t);
|
|
242
242
|
const o = H(e.column?.getColDef());
|
|
243
243
|
if (o && o.length > 0) {
|
|
244
|
-
const n =
|
|
244
|
+
const n = _(t, o);
|
|
245
245
|
return o.length === 1 ? n[0] : n.join(`
|
|
246
246
|
`);
|
|
247
247
|
}
|
|
@@ -293,7 +293,7 @@ function De({
|
|
|
293
293
|
/* @__PURE__ */ m(
|
|
294
294
|
xe,
|
|
295
295
|
{
|
|
296
|
-
isOpen:
|
|
296
|
+
isOpen: P,
|
|
297
297
|
columnId: O,
|
|
298
298
|
gridApi: F,
|
|
299
299
|
onClose: A.closeAdvancedFilter,
|
|
@@ -304,10 +304,10 @@ function De({
|
|
|
304
304
|
Fe,
|
|
305
305
|
{
|
|
306
306
|
isOpen: W,
|
|
307
|
-
columnId:
|
|
307
|
+
columnId: S.current,
|
|
308
308
|
gridApi: F,
|
|
309
|
-
anchor:
|
|
310
|
-
variant:
|
|
309
|
+
anchor: T.current,
|
|
310
|
+
variant: E.current,
|
|
311
311
|
onClose: A.closeMenu
|
|
312
312
|
}
|
|
313
313
|
)
|
|
@@ -323,7 +323,7 @@ function xe({
|
|
|
323
323
|
if (!s || !r || !l) return null;
|
|
324
324
|
const a = l.getColumn(r);
|
|
325
325
|
if (!a) return null;
|
|
326
|
-
const u = a.getColDef(), c = u.headerComponentParams, h = he(u), F = h.text !== -1 || h.number !== -1 || h.date !== -1, w = h.set !== -1,
|
|
326
|
+
const u = a.getColDef(), c = u.headerComponentParams, h = he(u), F = h.text !== -1 || h.number !== -1 || h.date !== -1, w = h.set !== -1, M = u.filter === "agMultiColumnFilter" && (F || w) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || c?.selectOptions ? "select" : "text", O = Ce(l.getFilterModel());
|
|
327
327
|
return /* @__PURE__ */ m(le, { fallback: null, children: /* @__PURE__ */ m(
|
|
328
328
|
be,
|
|
329
329
|
{
|
|
@@ -332,10 +332,9 @@ function xe({
|
|
|
332
332
|
onApply: f,
|
|
333
333
|
columnId: r,
|
|
334
334
|
columnLabel: u.headerName || r,
|
|
335
|
-
columnType:
|
|
335
|
+
columnType: M,
|
|
336
336
|
selectOptions: c?.selectOptions,
|
|
337
337
|
isMultiSelect: c?.isMultiSelect,
|
|
338
|
-
datePickerVariant: c?.datePickerVariant,
|
|
339
338
|
initialModel: O,
|
|
340
339
|
api: l
|
|
341
340
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type IndicatorType = 'sort' | 'filter';
|
|
2
|
+
interface ColumnIndicatorProps {
|
|
3
|
+
/** Type of indicator - determines color and label */
|
|
4
|
+
type: IndicatorType;
|
|
5
|
+
/** Additional CSS classes */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Small colored badge indicating column state (sorted or filtered).
|
|
10
|
+
* Uses design tokens for colors and i18n for accessibility labels.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <ColumnIndicator type="sort" />
|
|
14
|
+
* <ColumnIndicator type="filter" />
|
|
15
|
+
*/
|
|
16
|
+
export declare const ColumnIndicator: React.FC<ColumnIndicatorProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
3
|
+
import { useImpactNovaI18n as s } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
4
|
+
const c = ({
|
|
5
|
+
type: r,
|
|
6
|
+
className: l
|
|
7
|
+
}) => {
|
|
8
|
+
const { t: a } = s(), t = {
|
|
9
|
+
sort: {
|
|
10
|
+
colorClass: "bg-indicator-sort",
|
|
11
|
+
label: a("dataTable.indicatorSortedAriaLabel")
|
|
12
|
+
},
|
|
13
|
+
filter: {
|
|
14
|
+
colorClass: "bg-indicator-filter",
|
|
15
|
+
label: a("dataTable.indicatorFilteredAriaLabel")
|
|
16
|
+
}
|
|
17
|
+
}, { colorClass: i, label: o } = t[r];
|
|
18
|
+
return /* @__PURE__ */ e(
|
|
19
|
+
"span",
|
|
20
|
+
{
|
|
21
|
+
className: n("w-2 h-2 rounded-[2px] inline-block shrink-0", i, l),
|
|
22
|
+
title: o,
|
|
23
|
+
"aria-label": o
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
c.displayName = "ColumnIndicator";
|
|
28
|
+
export {
|
|
29
|
+
c as ColumnIndicator
|
|
30
|
+
};
|
|
@@ -1,106 +1,114 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { NestedList as
|
|
5
|
-
import { SelectionMode as
|
|
6
|
-
import { mergePartialOrderedColumnState as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as ce, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as R, useCallback as g, useEffect as J } from "react";
|
|
3
|
+
import { useDataTable as se } from "./data-table-context.js";
|
|
4
|
+
import { NestedList as ae } from "../nested-list/nested-list.js";
|
|
5
|
+
import { SelectionMode as de } from "../types/nested-list.types.js";
|
|
6
|
+
import { mergePartialOrderedColumnState as ue } from "./data-table-column-state.js";
|
|
7
|
+
import { PinSwitch as fe } from "./pin-switch.js";
|
|
8
|
+
import { ColumnIndicator as Q } from "./column-indicator.js";
|
|
9
|
+
import { IndicatorLegend as pe } from "./indicator-legend.js";
|
|
10
|
+
import { useImpactNovaI18n as he } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
11
|
+
function me(E) {
|
|
12
|
+
const P = [];
|
|
13
|
+
let C = E.getOriginalParent();
|
|
14
|
+
for (; C; ) {
|
|
15
|
+
const w = C.getColGroupDef();
|
|
16
|
+
w?.headerName && w?.children && P.push(C), C = C.getOriginalParent();
|
|
14
17
|
}
|
|
15
|
-
return
|
|
18
|
+
return P.reverse(), P;
|
|
16
19
|
}
|
|
17
|
-
const
|
|
18
|
-
enableApplyDiscard:
|
|
19
|
-
showSearch:
|
|
20
|
-
showSelectAll:
|
|
21
|
-
showCollapse:
|
|
20
|
+
const ge = 300, K = 100, Ee = ({
|
|
21
|
+
enableApplyDiscard: E = !1,
|
|
22
|
+
showSearch: P = !0,
|
|
23
|
+
showSelectAll: C = !0,
|
|
24
|
+
showCollapse: w = !0
|
|
22
25
|
}) => {
|
|
23
|
-
const { gridApi:
|
|
24
|
-
if (!
|
|
25
|
-
const r =
|
|
26
|
-
f.set(
|
|
27
|
-
let
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
id:
|
|
39
|
-
label:
|
|
26
|
+
const { gridApi: n } = se(), { t: L } = he(), [X, F] = W([]), [Z, ee] = W(!1), N = R(!1), $ = R(null), M = R(0), V = R({}), [B, te] = W(!1), x = g(() => {
|
|
27
|
+
if (!n || N.current) return;
|
|
28
|
+
const r = n.getColumnState(), i = n.getColumns() || [], t = new Map(i.map((o) => [o.getColId(), o])), s = [], l = [], e = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
29
|
+
f.set(s, "f"), f.set(l, "s");
|
|
30
|
+
let p = 0;
|
|
31
|
+
const T = (o) => {
|
|
32
|
+
let c = f.get(o);
|
|
33
|
+
return c === void 0 && (c = `n${p++}`, f.set(o, c)), c;
|
|
34
|
+
}, h = (o, c) => {
|
|
35
|
+
const a = o.getGroupId(), S = T(c), D = `${a}::${S}`, k = e.get(D);
|
|
36
|
+
if (k && k.list === c && c[c.length - 1] === k.node)
|
|
37
|
+
return k.node;
|
|
38
|
+
const _ = v.get(D) || 0;
|
|
39
|
+
v.set(D, _ + 1);
|
|
40
|
+
const O = o.getColGroupDef(), A = {
|
|
41
|
+
id: _ === 0 ? `${a}__${S}` : `${a}__${S}__${_}`,
|
|
42
|
+
label: O?.headerName || a,
|
|
40
43
|
checked: !0,
|
|
41
44
|
children: [],
|
|
42
45
|
category: "group"
|
|
43
46
|
};
|
|
44
|
-
return
|
|
47
|
+
return c.push(A), e.set(D, { list: c, node: A }), A;
|
|
45
48
|
};
|
|
46
|
-
let
|
|
47
|
-
r.forEach((
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
49
|
+
let d = 0, j = 0, m = 0, u = 0;
|
|
50
|
+
r.forEach((o) => {
|
|
51
|
+
const c = t.get(o.colId);
|
|
52
|
+
if (!c) return;
|
|
53
|
+
let a = n.getDisplayNameForColumn(c, "header");
|
|
54
|
+
if (a === "") return;
|
|
55
|
+
if (a == null) {
|
|
56
|
+
const b = c.getColDef();
|
|
57
|
+
if (b.headerName === "") return;
|
|
58
|
+
a = b.headerName || b.field || o.colId;
|
|
56
59
|
}
|
|
57
|
-
if (!
|
|
60
|
+
if (!a || a.trim() === "")
|
|
58
61
|
return;
|
|
59
|
-
const
|
|
60
|
-
id:
|
|
61
|
-
label:
|
|
62
|
-
checked:
|
|
62
|
+
const S = !o.hide, D = !!o.sort, k = c.isFilterActive(), _ = o.pinned === "left" ? "left" : o.pinned === "right" ? "right" : null, O = {
|
|
63
|
+
id: o.colId,
|
|
64
|
+
label: a,
|
|
65
|
+
checked: S,
|
|
66
|
+
data: {
|
|
67
|
+
hasSortApplied: D,
|
|
68
|
+
hasFilterApplied: k,
|
|
69
|
+
pinned: _
|
|
70
|
+
}
|
|
63
71
|
};
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
68
|
-
for (const
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
o.pinned ? (d++, S && j++) : (m++, S && u++);
|
|
73
|
+
const U = o.pinned ? s : l, A = me(c);
|
|
74
|
+
if (A.length > 0) {
|
|
75
|
+
let b = U, q = null;
|
|
76
|
+
for (const ie of A)
|
|
77
|
+
q = h(ie, b), b = q.children;
|
|
78
|
+
q.children.push(O);
|
|
71
79
|
} else
|
|
72
|
-
|
|
80
|
+
U.push(O);
|
|
73
81
|
});
|
|
74
|
-
const
|
|
75
|
-
let
|
|
76
|
-
for (const
|
|
77
|
-
|
|
78
|
-
return
|
|
82
|
+
const I = (o) => {
|
|
83
|
+
let c = o.length > 0;
|
|
84
|
+
for (const a of o)
|
|
85
|
+
a.children && (a.checked = I(a.children)), a.checked || (c = !1);
|
|
86
|
+
return c;
|
|
79
87
|
};
|
|
80
|
-
|
|
81
|
-
const
|
|
88
|
+
I(s), I(l);
|
|
89
|
+
const G = [
|
|
82
90
|
{
|
|
83
91
|
id: "root-frozen",
|
|
84
|
-
label:
|
|
85
|
-
checked:
|
|
86
|
-
children:
|
|
92
|
+
label: L("dataTable.frozenColumns"),
|
|
93
|
+
checked: d > 0 && j === d,
|
|
94
|
+
children: s,
|
|
87
95
|
category: "structure",
|
|
88
96
|
isDragDisabled: !0
|
|
89
97
|
},
|
|
90
98
|
{
|
|
91
99
|
id: "root-scrollable",
|
|
92
|
-
label:
|
|
93
|
-
checked: m > 0 &&
|
|
94
|
-
children:
|
|
100
|
+
label: L("dataTable.scrollableColumns"),
|
|
101
|
+
checked: m > 0 && u === m,
|
|
102
|
+
children: l,
|
|
95
103
|
category: "structure",
|
|
96
104
|
isDragDisabled: !0
|
|
97
105
|
}
|
|
98
106
|
];
|
|
99
|
-
F(
|
|
100
|
-
}, [
|
|
101
|
-
|
|
102
|
-
if (!
|
|
103
|
-
const r = setTimeout(() =>
|
|
107
|
+
F(G), ee(!0);
|
|
108
|
+
}, [n, L]);
|
|
109
|
+
J(() => {
|
|
110
|
+
if (!n) return;
|
|
111
|
+
const r = setTimeout(() => x(), 0), i = [
|
|
104
112
|
"columnVisible",
|
|
105
113
|
"columnPinned",
|
|
106
114
|
"columnMoved",
|
|
@@ -112,115 +120,163 @@ const ce = 300, q = 100, he = ({
|
|
|
112
120
|
"columnEverythingChanged",
|
|
113
121
|
"dragStopped",
|
|
114
122
|
"columnValueChanged",
|
|
115
|
-
"displayedColumnsChanged"
|
|
123
|
+
"displayedColumnsChanged",
|
|
124
|
+
"sortChanged",
|
|
125
|
+
"filterChanged"
|
|
116
126
|
];
|
|
117
|
-
let
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
|
|
127
|
+
let t = null;
|
|
128
|
+
const s = () => {
|
|
129
|
+
t && clearTimeout(t), t = setTimeout(() => {
|
|
130
|
+
if (t = null, N.current) return;
|
|
131
|
+
const l = $.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
|
|
132
|
+
l && (M.current = l.scrollTop), x(), te((e) => !e);
|
|
123
133
|
}, 150);
|
|
124
134
|
};
|
|
125
|
-
return
|
|
126
|
-
clearTimeout(r),
|
|
135
|
+
return n.isDestroyed() || i.forEach((l) => n.addEventListener(l, s)), () => {
|
|
136
|
+
clearTimeout(r), t && clearTimeout(t), n.isDestroyed() || i.forEach((l) => n.removeEventListener(l, s));
|
|
127
137
|
};
|
|
128
|
-
}, [
|
|
129
|
-
if (
|
|
138
|
+
}, [n, x]), J(() => {
|
|
139
|
+
if (M.current === 0) return;
|
|
130
140
|
const r = requestAnimationFrame(() => {
|
|
131
|
-
const
|
|
132
|
-
|
|
141
|
+
const i = $.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
|
|
142
|
+
i && (i.scrollTop = M.current, M.current = 0);
|
|
133
143
|
});
|
|
134
144
|
return () => cancelAnimationFrame(r);
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
|
|
145
|
+
}, [B]);
|
|
146
|
+
const Y = g((r) => {
|
|
147
|
+
const i = [], t = (s, l) => {
|
|
148
|
+
s.forEach((e) => {
|
|
149
|
+
if (e.id === "root-frozen") {
|
|
150
|
+
e.children && t(e.children, "left");
|
|
141
151
|
return;
|
|
142
152
|
}
|
|
143
|
-
if (
|
|
144
|
-
|
|
153
|
+
if (e.id === "root-scrollable") {
|
|
154
|
+
e.children && t(e.children, null);
|
|
145
155
|
return;
|
|
146
156
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
if (e.category === "group" || e.children && e.children.length > 0)
|
|
158
|
+
e.children && t(e.children, l);
|
|
159
|
+
else if (n?.getColumn(e.id)) {
|
|
160
|
+
let p;
|
|
161
|
+
if (l === null)
|
|
162
|
+
p = null;
|
|
163
|
+
else {
|
|
164
|
+
const h = e.data?.pinned;
|
|
165
|
+
p = h === "left" || h === "right" ? h : l;
|
|
166
|
+
}
|
|
167
|
+
i.push({
|
|
168
|
+
colId: e.id,
|
|
169
|
+
pinned: p,
|
|
170
|
+
hide: !e.checked
|
|
171
|
+
});
|
|
172
|
+
}
|
|
152
173
|
});
|
|
153
174
|
};
|
|
154
|
-
return
|
|
155
|
-
}, [
|
|
156
|
-
if (!
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
175
|
+
return t(r, null), i;
|
|
176
|
+
}, [n]), z = g((r) => {
|
|
177
|
+
if (!n) return;
|
|
178
|
+
N.current = !0;
|
|
179
|
+
const i = Y(r);
|
|
180
|
+
if (i.length === 0) {
|
|
160
181
|
setTimeout(() => {
|
|
161
|
-
|
|
162
|
-
},
|
|
182
|
+
N.current = !1;
|
|
183
|
+
}, K);
|
|
163
184
|
return;
|
|
164
185
|
}
|
|
165
|
-
const
|
|
166
|
-
|
|
186
|
+
const t = n.getColumnState(), s = ue(t, i), l = new Set(t.filter((d) => d.pinned).map((d) => d.colId)), e = s.filter((d) => d.pinned && !l.has(d.colId)), v = new Set(e.map((d) => d.colId));
|
|
187
|
+
n.applyColumnState({ state: s, applyOrder: !0 });
|
|
167
188
|
const f = () => {
|
|
168
|
-
|
|
189
|
+
N.current = !1, x();
|
|
169
190
|
};
|
|
170
|
-
if (
|
|
171
|
-
setTimeout(f,
|
|
191
|
+
if (v.size === 0) {
|
|
192
|
+
setTimeout(f, K);
|
|
172
193
|
return;
|
|
173
194
|
}
|
|
174
|
-
let
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
const
|
|
180
|
-
return
|
|
195
|
+
let p = !1, T = null;
|
|
196
|
+
const h = () => {
|
|
197
|
+
if (p || n.isDestroyed()) return;
|
|
198
|
+
const d = n.getColumnState();
|
|
199
|
+
if (e.filter((m) => {
|
|
200
|
+
const u = d.find((I) => I.colId === m.colId);
|
|
201
|
+
return u && !u.pinned;
|
|
181
202
|
}).length > 0) {
|
|
182
|
-
|
|
183
|
-
const m =
|
|
203
|
+
p = !0, T && clearTimeout(T), n.removeEventListener("columnPinned", h);
|
|
204
|
+
const m = s.filter((u) => u.pinned && !v.has(u.colId));
|
|
184
205
|
if (m.length > 0) {
|
|
185
|
-
const
|
|
186
|
-
(
|
|
206
|
+
const u = m[0], I = s.map(
|
|
207
|
+
(G) => G.colId === u.colId ? { ...G, pinned: null } : G
|
|
187
208
|
);
|
|
188
|
-
|
|
209
|
+
n.applyColumnState({ state: I, applyOrder: !0 });
|
|
189
210
|
}
|
|
190
|
-
setTimeout(f,
|
|
211
|
+
setTimeout(f, K);
|
|
191
212
|
}
|
|
192
213
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
}, [
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
|
|
202
|
-
|
|
214
|
+
n.addEventListener("columnPinned", h), T = setTimeout(() => {
|
|
215
|
+
n.removeEventListener("columnPinned", h), p || f();
|
|
216
|
+
}, ge);
|
|
217
|
+
}, [n, Y, x]), ne = g((r) => {
|
|
218
|
+
z(r);
|
|
219
|
+
}, [z]), re = g((r) => {
|
|
220
|
+
E || z(r), F(r);
|
|
221
|
+
}, [E, z]), H = g((r, i) => {
|
|
222
|
+
F((t) => {
|
|
223
|
+
const s = (l) => l.map((e) => e.id === r ? {
|
|
224
|
+
...e,
|
|
225
|
+
data: {
|
|
226
|
+
...e.data,
|
|
227
|
+
pinned: i
|
|
228
|
+
}
|
|
229
|
+
} : e.children ? {
|
|
230
|
+
...e,
|
|
231
|
+
children: s(e.children)
|
|
232
|
+
} : e);
|
|
233
|
+
return s(t);
|
|
234
|
+
}), n && n.applyColumnState({
|
|
235
|
+
state: [{ colId: r, pinned: i }]
|
|
236
|
+
});
|
|
237
|
+
}, [n]), le = g((r, i) => {
|
|
238
|
+
if (!i.isLeaf) return null;
|
|
239
|
+
const t = r.data;
|
|
240
|
+
return !t?.hasSortApplied && !t?.hasFilterApplied ? null : /* @__PURE__ */ ce("span", { className: "inline-flex items-center gap-1 ml-1.5 shrink-0", children: [
|
|
241
|
+
t?.hasSortApplied && /* @__PURE__ */ y(Q, { type: "sort" }),
|
|
242
|
+
t?.hasFilterApplied && /* @__PURE__ */ y(Q, { type: "filter" })
|
|
243
|
+
] });
|
|
244
|
+
}, []), oe = g((r, i) => {
|
|
245
|
+
const t = r.data;
|
|
246
|
+
return r.category === "structure" ? r.id !== "root-frozen" ? null : /* @__PURE__ */ y(pe, {}) : !i.isLeaf || !(t?.pinned === "left" || t?.pinned === "right") ? null : /* @__PURE__ */ y(
|
|
247
|
+
fe,
|
|
248
|
+
{
|
|
249
|
+
value: t?.pinned ?? null,
|
|
250
|
+
onChange: (l) => H(r.id, l),
|
|
251
|
+
className: "shrink-0"
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}, [H]);
|
|
255
|
+
return Z ? /* @__PURE__ */ y("div", { ref: $, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ y(
|
|
256
|
+
ae,
|
|
203
257
|
{
|
|
204
|
-
items:
|
|
205
|
-
onChange:
|
|
206
|
-
onSubmit:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
258
|
+
items: X,
|
|
259
|
+
onChange: re,
|
|
260
|
+
onSubmit: ne,
|
|
261
|
+
renderLabelExtras: le,
|
|
262
|
+
renderActions: oe,
|
|
263
|
+
enableApplyDiscard: E,
|
|
264
|
+
enableSearch: P,
|
|
265
|
+
enableSelectAll: C,
|
|
210
266
|
enableDragDrop: !0,
|
|
211
267
|
enableCollapse: !0,
|
|
212
|
-
enableGlobalCollapse:
|
|
213
|
-
selectionMode:
|
|
214
|
-
searchPlaceholder:
|
|
268
|
+
enableGlobalCollapse: w,
|
|
269
|
+
selectionMode: de.CASCADE_DOWN,
|
|
270
|
+
searchPlaceholder: L("dataTable.searchColumnsPlaceholder"),
|
|
215
271
|
className: "h-full",
|
|
216
|
-
initialCollapsedItems:
|
|
272
|
+
initialCollapsedItems: V.current,
|
|
217
273
|
onCollapseChange: (r) => {
|
|
218
|
-
|
|
274
|
+
V.current = r;
|
|
219
275
|
}
|
|
220
276
|
},
|
|
221
|
-
|
|
222
|
-
) }) : /* @__PURE__ */
|
|
277
|
+
B ? "sync-a" : "sync-b"
|
|
278
|
+
) }) : /* @__PURE__ */ y("div", { className: "p-4 text-[13px] text-content-placeholder", children: L("dataTable.loadingColumns") });
|
|
223
279
|
};
|
|
224
280
|
export {
|
|
225
|
-
|
|
281
|
+
Ee as DataTableColumnList
|
|
226
282
|
};
|