impact-nova 1.7.1 → 1.7.3
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/accordion.d.ts +5 -0
- package/dist/components/ui/accordion.js +51 -39
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +207 -209
- package/dist/components/ui/ag-grid-react/index.js +86 -84
- package/dist/components/ui/ag-grid-react/theme.js +4 -0
- package/dist/components/ui/data-table/data-table-column-list.js +84 -78
- package/dist/components/ui/expandable-sku/expandable-sku.d.ts +38 -0
- package/dist/components/ui/expandable-sku/expandable-sku.js +244 -0
- package/dist/components/ui/expandable-sku/expandable-sku.types.d.ts +35 -0
- package/dist/components/ui/expandable-sku/index.d.ts +2 -0
- package/dist/components/ui/expandable-sku/index.js +4 -0
- package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
- package/dist/components/ui/filter-strip/filter-tag-list.js +1 -0
- package/dist/components/ui/select/select.js +221 -210
- package/dist/icons/assets/eye.svg.js +5 -0
- package/dist/icons/assets/eyeOff.svg.js +5 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +203 -199
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +57 -0
- package/dist/index.js +318 -300
- package/dist/lib/virtualized/index.d.ts +9 -0
- package/dist/lib/virtualized/sectioned.d.ts +37 -0
- package/dist/lib/virtualized/sectioned.js +38 -0
- package/dist/lib/virtualized/selection-counts.d.ts +14 -0
- package/dist/lib/virtualized/selection-counts.js +12 -0
- package/dist/lib/virtualized/types.d.ts +131 -0
- package/dist/lib/virtualized/useDataGrid.d.ts +15 -0
- package/dist/lib/virtualized/useDataGrid.js +12 -0
- package/dist/lib/virtualized/useDataSource.d.ts +8 -0
- package/dist/lib/virtualized/useDataSource.js +34 -0
- package/dist/lib/virtualized/useDebouncedValue.d.ts +4 -0
- package/dist/lib/virtualized/useDebouncedValue.js +11 -0
- package/dist/lib/virtualized/useRowState.d.ts +15 -0
- package/dist/lib/virtualized/useRowState.js +127 -0
- package/dist/lib/virtualized/useVirtualizedList.d.ts +72 -0
- package/dist/lib/virtualized/useVirtualizedList.js +155 -0
- package/dist/lib/virtualized/useVirtualizedRows.d.ts +22 -0
- package/dist/lib/virtualized/useVirtualizedRows.js +27 -0
- package/package.json +23 -1
- package/tailwind.config.js +2 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as V, useRef as
|
|
1
|
+
import { jsxs as U, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as V, useRef as D, useState as f, useCallback as F, useMemo as y, useEffect as W, Suspense as _ } from "react";
|
|
3
3
|
import { ModuleRegistry as $, AllCommunityModule as q, ValidationModule as K } from "ag-grid-community";
|
|
4
|
-
import { AllEnterpriseModule as
|
|
5
|
-
import { AgGridReact as
|
|
6
|
-
import { customAgGridTheme as
|
|
4
|
+
import { AllEnterpriseModule as z } from "ag-grid-enterprise";
|
|
5
|
+
import { AgGridReact as J } from "ag-grid-react";
|
|
6
|
+
import { customAgGridTheme as X } from "./theme.js";
|
|
7
7
|
import { CustomHeader as B } from "./headers/custom-header.js";
|
|
8
8
|
import { CustomHeaderGroup as Q } from "./headers/custom-header-group.js";
|
|
9
|
-
import { GridHeaderContext as
|
|
10
|
-
import { convertToAgGridFilterModel as
|
|
11
|
-
import { ColumnSettingsMenu as
|
|
12
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
9
|
+
import { GridHeaderContext as Y } from "./headers/context/grid-header-context.js";
|
|
10
|
+
import { convertToAgGridFilterModel as Z, getMultiFilterIndices as ee, convertFromAgGridFilterModel as te } from "./headers/utils/filter-utils.js";
|
|
11
|
+
import { ColumnSettingsMenu as re } from "./headers/column-menu/column-settings-menu.js";
|
|
12
|
+
import { AG_GRID_VALUE_FORMATTERS as ne } from "./value-formatters.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
const
|
|
15
|
-
$.registerModules([q,
|
|
16
|
-
function
|
|
14
|
+
const oe = V(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
|
|
15
|
+
$.registerModules([q, z, K]);
|
|
16
|
+
function ye({
|
|
17
17
|
children: c,
|
|
18
|
-
defaultColDef:
|
|
18
|
+
defaultColDef: o,
|
|
19
19
|
defaultColGroupDef: i,
|
|
20
|
-
columnDefs:
|
|
20
|
+
columnDefs: g,
|
|
21
21
|
valueFormatters: d,
|
|
22
22
|
onGridReady: m,
|
|
23
23
|
...u
|
|
24
24
|
}) {
|
|
25
|
-
const r =
|
|
25
|
+
const r = D(null), s = D(null), [h, M] = f(null), [G, C] = f(!1), [b, x] = f(null), [R, S] = f(!1), [A, k] = f(null), [N, E] = f(null), O = F((e) => {
|
|
26
26
|
if (!r.current) return;
|
|
27
|
-
const t =
|
|
27
|
+
const t = Z(e);
|
|
28
28
|
r.current.setFilterModel(t), r.current.onFilterChanged();
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), v = y(() => ({
|
|
30
30
|
openSearch: (e) => {
|
|
31
31
|
if (!r.current) return;
|
|
32
32
|
const t = r.current.getGridOption("context") || {};
|
|
@@ -38,76 +38,78 @@ function Fe({
|
|
|
38
38
|
r.current.setGridOption("context", { ...e, activeSearchColumnId: null }), r.current.refreshHeader();
|
|
39
39
|
},
|
|
40
40
|
openAdvancedFilter: (e) => {
|
|
41
|
-
x(e || null),
|
|
41
|
+
x(e || null), C(!0);
|
|
42
42
|
},
|
|
43
43
|
closeAdvancedFilter: () => {
|
|
44
|
-
|
|
44
|
+
C(!1), x(null);
|
|
45
45
|
},
|
|
46
46
|
applyAdvancedFilter: (e) => {
|
|
47
|
-
|
|
47
|
+
O(e);
|
|
48
48
|
},
|
|
49
49
|
openMenu: (e, t) => {
|
|
50
|
-
k(e),
|
|
50
|
+
k(e), E(t), S(!0);
|
|
51
51
|
},
|
|
52
52
|
closeMenu: () => {
|
|
53
|
-
S(!1), k(null),
|
|
53
|
+
S(!1), k(null), E(null);
|
|
54
54
|
},
|
|
55
|
-
activeMenuColumnId:
|
|
56
|
-
}), [
|
|
55
|
+
activeMenuColumnId: A
|
|
56
|
+
}), [O, A]), T = F((e) => {
|
|
57
57
|
r.current = e.api, M(e.api), e.api.setGridOption("context", { activeSearchColumnId: null }), m && m(e);
|
|
58
58
|
}, [m]);
|
|
59
59
|
W(() => {
|
|
60
60
|
const e = s.current;
|
|
61
61
|
if (!e) return;
|
|
62
|
-
const t = (
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
66
|
-
const
|
|
62
|
+
const t = (n) => {
|
|
63
|
+
if (n.key !== "Enter" && n.key !== " ") return;
|
|
64
|
+
const l = n.target;
|
|
65
|
+
if (!l.classList.contains("ag-cell") && !l.classList.contains("ag-header-cell")) return;
|
|
66
|
+
const p = l.querySelector(
|
|
67
67
|
'button, [role="checkbox"], [role="switch"], [role="combobox"], [role="button"], [role="link"], a, input, select, textarea, .cursor-pointer'
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
p && (n.preventDefault(), n.stopPropagation(), p.click(), p.focus());
|
|
70
70
|
};
|
|
71
71
|
return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
|
|
72
72
|
}, []);
|
|
73
|
-
const
|
|
73
|
+
const H = y(() => ({
|
|
74
74
|
headerComponent: B,
|
|
75
|
-
...
|
|
75
|
+
...o,
|
|
76
76
|
suppressHeaderKeyboardEvent: (e) => {
|
|
77
|
-
const { event: t } = e;
|
|
77
|
+
const { event: t } = e, n = t.target;
|
|
78
|
+
if (n.tagName === "INPUT" || n.tagName === "TEXTAREA")
|
|
79
|
+
return !(t.key === "Enter" || t.key === "Escape" || t.key === "Tab");
|
|
78
80
|
if (t.key === "Enter" || t.key === " ") {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return t.preventDefault(),
|
|
81
|
+
const p = n.closest(".ag-header-cell");
|
|
82
|
+
if (p) {
|
|
83
|
+
const I = p.querySelector('[role="checkbox"], button, [role="switch"], input');
|
|
84
|
+
if (I)
|
|
85
|
+
return t.preventDefault(), I.click(), !0;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
|
-
return
|
|
88
|
+
return o?.suppressHeaderKeyboardEvent?.(e) ?? !1;
|
|
87
89
|
},
|
|
88
90
|
headerComponentParams: {
|
|
89
|
-
...
|
|
91
|
+
...o?.headerComponentParams
|
|
90
92
|
}
|
|
91
|
-
}), [
|
|
93
|
+
}), [o]), j = y(() => ({
|
|
92
94
|
headerGroupComponent: Q,
|
|
93
95
|
...i,
|
|
94
96
|
headerGroupComponentParams: {
|
|
95
97
|
...i?.headerGroupComponentParams
|
|
96
98
|
}
|
|
97
|
-
}), [i]), L =
|
|
98
|
-
...
|
|
99
|
+
}), [i]), L = y(() => ({
|
|
100
|
+
...ne,
|
|
99
101
|
// Always available - value formatters
|
|
100
102
|
...u.components,
|
|
101
103
|
// User components override
|
|
102
104
|
...d
|
|
103
105
|
// Optional custom formatters override defaults
|
|
104
|
-
}), [d, u.components]),
|
|
106
|
+
}), [d, u.components]), P = F((e) => {
|
|
105
107
|
if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
|
|
106
|
-
const t = Object.entries(e.value).map(([
|
|
108
|
+
const t = Object.entries(e.value).map(([n, l]) => l && typeof l == "object" && "value" in l ? l.value : typeof l != "object" && typeof l < "u" ? l : null).filter((n) => n != null);
|
|
107
109
|
return t.length > 0 ? t.join(" ") : "";
|
|
108
110
|
}
|
|
109
111
|
return e.value;
|
|
110
|
-
}, []), w =
|
|
112
|
+
}, []), w = F((e) => {
|
|
111
113
|
if (typeof e.value == "string") {
|
|
112
114
|
const t = e.value.trim();
|
|
113
115
|
if (t.startsWith("{") || t.startsWith("["))
|
|
@@ -119,18 +121,18 @@ function Fe({
|
|
|
119
121
|
}
|
|
120
122
|
return e.value;
|
|
121
123
|
}, []);
|
|
122
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ U(Y.Provider, { value: v, children: [
|
|
123
125
|
/* @__PURE__ */ a("div", { ref: s, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ a(
|
|
124
|
-
|
|
126
|
+
J,
|
|
125
127
|
{
|
|
126
|
-
theme:
|
|
127
|
-
defaultColDef:
|
|
128
|
-
columnDefs:
|
|
128
|
+
theme: X,
|
|
129
|
+
defaultColDef: H,
|
|
130
|
+
columnDefs: g,
|
|
129
131
|
cellSelection: !0,
|
|
130
132
|
defaultColGroupDef: j,
|
|
131
|
-
onGridReady:
|
|
133
|
+
onGridReady: T,
|
|
132
134
|
components: L,
|
|
133
|
-
processCellForClipboard:
|
|
135
|
+
processCellForClipboard: P,
|
|
134
136
|
processCellFromClipboard: w,
|
|
135
137
|
ensureDomOrder: !0,
|
|
136
138
|
suppressHeaderFocus: !1,
|
|
@@ -163,73 +165,73 @@ function Fe({
|
|
|
163
165
|
) }),
|
|
164
166
|
c,
|
|
165
167
|
/* @__PURE__ */ a(
|
|
166
|
-
|
|
168
|
+
le,
|
|
167
169
|
{
|
|
168
170
|
isOpen: G,
|
|
169
|
-
columnId:
|
|
170
|
-
gridApi:
|
|
171
|
-
onClose:
|
|
172
|
-
onApply:
|
|
171
|
+
columnId: b,
|
|
172
|
+
gridApi: h,
|
|
173
|
+
onClose: v.closeAdvancedFilter,
|
|
174
|
+
onApply: v.applyAdvancedFilter
|
|
173
175
|
}
|
|
174
176
|
),
|
|
175
177
|
/* @__PURE__ */ a(
|
|
176
|
-
|
|
178
|
+
ie,
|
|
177
179
|
{
|
|
178
180
|
isOpen: R,
|
|
179
|
-
columnId:
|
|
180
|
-
gridApi:
|
|
181
|
-
anchor:
|
|
182
|
-
onClose:
|
|
181
|
+
columnId: A,
|
|
182
|
+
gridApi: h,
|
|
183
|
+
anchor: N,
|
|
184
|
+
onClose: v.closeMenu
|
|
183
185
|
}
|
|
184
186
|
)
|
|
185
187
|
] });
|
|
186
188
|
}
|
|
187
|
-
function
|
|
189
|
+
function le({
|
|
188
190
|
isOpen: c,
|
|
189
|
-
columnId:
|
|
191
|
+
columnId: o,
|
|
190
192
|
gridApi: i,
|
|
191
|
-
onClose:
|
|
193
|
+
onClose: g,
|
|
192
194
|
onApply: d
|
|
193
195
|
}) {
|
|
194
|
-
if (!c || !
|
|
195
|
-
const m = i.getColumn(
|
|
196
|
+
if (!c || !o || !i) return null;
|
|
197
|
+
const m = i.getColumn(o);
|
|
196
198
|
if (!m) return null;
|
|
197
|
-
const u = m.getColDef(), r = u.headerComponentParams, s =
|
|
199
|
+
const u = m.getColDef(), r = u.headerComponentParams, s = ee(u), h = s.text !== -1 || s.number !== -1 || s.date !== -1, M = s.set !== -1, C = u.filter === "agMultiColumnFilter" && (h || M) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || r?.selectOptions ? "select" : "text", b = te(i.getFilterModel());
|
|
198
200
|
return /* @__PURE__ */ a(_, { fallback: null, children: /* @__PURE__ */ a(
|
|
199
|
-
|
|
201
|
+
oe,
|
|
200
202
|
{
|
|
201
203
|
isOpen: c,
|
|
202
|
-
onClose:
|
|
204
|
+
onClose: g,
|
|
203
205
|
onApply: d,
|
|
204
|
-
columnId:
|
|
205
|
-
columnLabel: u.headerName ||
|
|
206
|
-
columnType:
|
|
206
|
+
columnId: o,
|
|
207
|
+
columnLabel: u.headerName || o,
|
|
208
|
+
columnType: C,
|
|
207
209
|
selectOptions: r?.selectOptions,
|
|
208
210
|
isMultiSelect: r?.isMultiSelect,
|
|
209
|
-
initialModel:
|
|
211
|
+
initialModel: b,
|
|
210
212
|
api: i
|
|
211
213
|
}
|
|
212
214
|
) });
|
|
213
215
|
}
|
|
214
|
-
function
|
|
216
|
+
function ie({
|
|
215
217
|
isOpen: c,
|
|
216
|
-
columnId:
|
|
218
|
+
columnId: o,
|
|
217
219
|
gridApi: i,
|
|
218
|
-
anchor:
|
|
220
|
+
anchor: g,
|
|
219
221
|
onClose: d
|
|
220
222
|
}) {
|
|
221
|
-
return !c || !
|
|
222
|
-
|
|
223
|
+
return !c || !o || !i ? null : /* @__PURE__ */ a(
|
|
224
|
+
re,
|
|
223
225
|
{
|
|
224
226
|
isOpen: c,
|
|
225
|
-
columnId:
|
|
227
|
+
columnId: o,
|
|
226
228
|
gridApi: i,
|
|
227
|
-
anchor:
|
|
229
|
+
anchor: g,
|
|
228
230
|
onClose: d
|
|
229
231
|
}
|
|
230
232
|
);
|
|
231
233
|
}
|
|
232
234
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
ye as AgGridWrapper,
|
|
236
|
+
ye as default
|
|
235
237
|
};
|
|
@@ -9,6 +9,9 @@ const d = e.withPart(r).withParams({
|
|
|
9
9
|
checkboxCheckedBackgroundColor: "#ECEEFD",
|
|
10
10
|
checkboxCheckedBorderColor: "#4259EE",
|
|
11
11
|
checkboxCheckedShapeColor: "#4259EE",
|
|
12
|
+
checkboxIndeterminateBackgroundColor: "transparent",
|
|
13
|
+
checkboxIndeterminateBorderColor: "#4259EE",
|
|
14
|
+
checkboxIndeterminateShapeColor: "#4259EE",
|
|
12
15
|
columnBorder: !0,
|
|
13
16
|
columnDropCellBorder: !0,
|
|
14
17
|
fontFamily: "inherit",
|
|
@@ -38,6 +41,7 @@ const d = e.withPart(r).withParams({
|
|
|
38
41
|
menuShadow: "#00000040 0px 0px 2px 0px",
|
|
39
42
|
menuTextColor: "#1F2B4D",
|
|
40
43
|
pinnedRowBackgroundColor: "#F4F1F9",
|
|
44
|
+
pinnedSourceRowBackgroundColor: "#F4F1F9",
|
|
41
45
|
pinnedRowBorder: !1
|
|
42
46
|
});
|
|
43
47
|
export {
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
import { jsx as M } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { NestedList as
|
|
5
|
-
import { SelectionMode as
|
|
6
|
-
import { mergePartialOrderedColumnState as
|
|
7
|
-
import { useImpactNovaI18n as
|
|
8
|
-
const
|
|
2
|
+
import { useState as E, useRef as P, useCallback as m, useEffect as q } from "react";
|
|
3
|
+
import { useDataTable as B } from "./data-table-context.js";
|
|
4
|
+
import { NestedList as H } from "../nested-list/nested-list.js";
|
|
5
|
+
import { SelectionMode as J } from "../types/nested-list.types.js";
|
|
6
|
+
import { mergePartialOrderedColumnState as Q } from "./data-table-column-state.js";
|
|
7
|
+
import { useImpactNovaI18n as X } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
+
const ne = ({
|
|
9
9
|
enableApplyDiscard: b = !1,
|
|
10
10
|
showSearch: R = !0,
|
|
11
11
|
showSelectAll: w = !0,
|
|
12
12
|
showCollapse: L = !0
|
|
13
13
|
}) => {
|
|
14
|
-
const { gridApi: l } =
|
|
15
|
-
if (!l ||
|
|
16
|
-
const
|
|
17
|
-
U.current =
|
|
18
|
-
const
|
|
14
|
+
const { gridApi: l } = B(), { t: f } = X(), [j, x] = E([]), [A, F] = E(!1), d = P(!1), [K, V] = E(!1), U = P(/* @__PURE__ */ new Map()), y = m(() => {
|
|
15
|
+
if (!l || d.current) return;
|
|
16
|
+
const o = l.getColumnState(), c = new Map(o.map((t) => [t.colId, t]));
|
|
17
|
+
U.current = c;
|
|
18
|
+
const n = l.getColumns() || [], u = new Map(n.map((t) => [t.getColId(), t])), a = [], e = [], S = /* @__PURE__ */ new Map(), D = (t, s) => {
|
|
19
19
|
const r = t.getGroupId();
|
|
20
|
-
let
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
return
|
|
20
|
+
let i = S.get(r);
|
|
21
|
+
if (i) return i;
|
|
22
|
+
const h = t.getOriginalParent(), g = h ? D(h, s).children : s, C = t.getColGroupDef();
|
|
23
|
+
return i = {
|
|
24
24
|
id: r,
|
|
25
25
|
label: C?.headerName || r,
|
|
26
26
|
checked: !0,
|
|
27
27
|
children: [],
|
|
28
28
|
category: "group"
|
|
29
|
-
}, S.set(r,
|
|
29
|
+
}, S.set(r, i), g.push(i), i;
|
|
30
30
|
};
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
let r = l.getDisplayNameForColumn(
|
|
31
|
+
let T = 0, O = 0, v = 0, z = 0;
|
|
32
|
+
o.forEach((t) => {
|
|
33
|
+
const s = u.get(t.colId);
|
|
34
|
+
if (!s) return;
|
|
35
|
+
let r = l.getDisplayNameForColumn(s, "header");
|
|
36
36
|
if (r === "") return;
|
|
37
37
|
if (r == null) {
|
|
38
|
-
const G =
|
|
38
|
+
const G = s.getColDef();
|
|
39
39
|
if (G.headerName === "") return;
|
|
40
40
|
r = G.headerName || G.field || t.colId;
|
|
41
41
|
}
|
|
42
42
|
if (!r || r.trim() === "")
|
|
43
43
|
return;
|
|
44
|
-
const
|
|
44
|
+
const i = !t.hide, h = {
|
|
45
45
|
id: t.colId,
|
|
46
46
|
label: r,
|
|
47
|
-
checked:
|
|
47
|
+
checked: i
|
|
48
48
|
};
|
|
49
|
-
t.pinned ? (
|
|
50
|
-
const g = t.pinned ?
|
|
51
|
-
C?.getColGroupDef().children ?
|
|
49
|
+
t.pinned ? (T++, i && O++) : (v++, i && z++);
|
|
50
|
+
const g = t.pinned ? a : e, C = s.getOriginalParent();
|
|
51
|
+
C?.getColGroupDef().children ? D(C, g).children.push(h) : g.push(h);
|
|
52
52
|
});
|
|
53
|
-
const
|
|
54
|
-
let
|
|
53
|
+
const I = (t) => {
|
|
54
|
+
let s = t.length > 0;
|
|
55
55
|
for (const r of t)
|
|
56
|
-
r.children && (r.checked =
|
|
57
|
-
return
|
|
56
|
+
r.children && (r.checked = I(r.children)), r.checked || (s = !1);
|
|
57
|
+
return s;
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
59
|
+
I(a), I(e);
|
|
60
|
+
const k = [];
|
|
61
|
+
a.length > 0 && k.push({
|
|
62
62
|
id: "root-frozen",
|
|
63
|
-
label:
|
|
64
|
-
checked:
|
|
65
|
-
children:
|
|
63
|
+
label: f("dataTable.frozenColumns"),
|
|
64
|
+
checked: T > 0 && O === T,
|
|
65
|
+
children: a,
|
|
66
66
|
category: "structure",
|
|
67
67
|
isDragDisabled: !0
|
|
68
|
-
}), e.length > 0 &&
|
|
68
|
+
}), e.length > 0 && k.push({
|
|
69
69
|
id: "root-scrollable",
|
|
70
|
-
label:
|
|
71
|
-
checked:
|
|
70
|
+
label: f("dataTable.scrollableColumns"),
|
|
71
|
+
checked: v > 0 && z === v,
|
|
72
72
|
children: e,
|
|
73
73
|
category: "structure",
|
|
74
74
|
isDragDisabled: !0
|
|
75
|
-
}),
|
|
76
|
-
}, [l,
|
|
77
|
-
|
|
75
|
+
}), x(k), F(!0);
|
|
76
|
+
}, [l, f]);
|
|
77
|
+
q(() => {
|
|
78
78
|
if (!l) return;
|
|
79
|
-
const
|
|
79
|
+
const o = setTimeout(() => y(), 0), c = [
|
|
80
80
|
"columnVisible",
|
|
81
81
|
"columnPinned",
|
|
82
82
|
"columnMoved",
|
|
@@ -85,77 +85,83 @@ const le = ({
|
|
|
85
85
|
"columnGroupOpened",
|
|
86
86
|
"columnRowGroupChanged",
|
|
87
87
|
"columnPivotModeChanged",
|
|
88
|
-
"columnEverythingChanged"
|
|
88
|
+
"columnEverythingChanged",
|
|
89
|
+
"dragStopped",
|
|
90
|
+
"columnValueChanged",
|
|
91
|
+
"displayedColumnsChanged"
|
|
89
92
|
];
|
|
90
|
-
let
|
|
93
|
+
let n = null;
|
|
91
94
|
const u = () => {
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
n && clearTimeout(n), n = setTimeout(() => {
|
|
96
|
+
n = null;
|
|
97
|
+
const a = !d.current;
|
|
98
|
+
d.current = !1, y(), a && V((e) => !e);
|
|
94
99
|
}, 150);
|
|
95
100
|
};
|
|
96
|
-
return l.isDestroyed() ||
|
|
97
|
-
clearTimeout(
|
|
101
|
+
return l.isDestroyed() || c.forEach((a) => l.addEventListener(a, u)), () => {
|
|
102
|
+
clearTimeout(o), n && clearTimeout(n), l.isDestroyed() || c.forEach((a) => l.removeEventListener(a, u));
|
|
98
103
|
};
|
|
99
|
-
}, [l,
|
|
100
|
-
const
|
|
101
|
-
const
|
|
104
|
+
}, [l, y]);
|
|
105
|
+
const N = m((o) => {
|
|
106
|
+
const c = [], n = (u, a) => {
|
|
102
107
|
u.forEach((e) => {
|
|
103
108
|
if (e.id === "root-frozen") {
|
|
104
|
-
e.children &&
|
|
109
|
+
e.children && n(e.children, "left");
|
|
105
110
|
return;
|
|
106
111
|
}
|
|
107
112
|
if (e.id === "root-scrollable") {
|
|
108
|
-
e.children &&
|
|
113
|
+
e.children && n(e.children, null);
|
|
109
114
|
return;
|
|
110
115
|
}
|
|
111
|
-
e.category === "group" || e.children && e.children.length > 0 ? e.children &&
|
|
116
|
+
e.category === "group" || e.children && e.children.length > 0 ? e.children && n(e.children, a) : l?.getColumn(e.id) && c.push({
|
|
112
117
|
colId: e.id,
|
|
113
|
-
pinned:
|
|
118
|
+
pinned: a,
|
|
114
119
|
hide: !e.checked
|
|
115
120
|
});
|
|
116
121
|
});
|
|
117
122
|
};
|
|
118
|
-
return o
|
|
119
|
-
}, [l]), p =
|
|
123
|
+
return n(o, null), c;
|
|
124
|
+
}, [l]), p = m((o) => {
|
|
120
125
|
if (!l) return;
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
126
|
+
d.current = !0;
|
|
127
|
+
const c = N(o);
|
|
128
|
+
if (c.length === 0) {
|
|
124
129
|
setTimeout(() => {
|
|
125
|
-
|
|
130
|
+
d.current = !1;
|
|
126
131
|
}, 300);
|
|
127
132
|
return;
|
|
128
133
|
}
|
|
129
|
-
const
|
|
134
|
+
const n = l.getColumnState(), u = Q(n, c);
|
|
130
135
|
l.applyColumnState({
|
|
131
136
|
state: u,
|
|
132
137
|
applyOrder: !0
|
|
133
138
|
}), setTimeout(() => {
|
|
134
|
-
|
|
139
|
+
d.current = !1;
|
|
135
140
|
}, 300);
|
|
136
|
-
}, [l,
|
|
137
|
-
p(
|
|
138
|
-
}, [p]),
|
|
139
|
-
b || p(
|
|
141
|
+
}, [l, N]), W = m((o) => {
|
|
142
|
+
p(o);
|
|
143
|
+
}, [p]), _ = m((o) => {
|
|
144
|
+
b || p(o), x(o);
|
|
140
145
|
}, [b, p]);
|
|
141
146
|
return A ? /* @__PURE__ */ M("div", { className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ M(
|
|
142
|
-
|
|
147
|
+
H,
|
|
143
148
|
{
|
|
144
149
|
items: j,
|
|
145
|
-
onChange:
|
|
146
|
-
onSubmit:
|
|
150
|
+
onChange: _,
|
|
151
|
+
onSubmit: W,
|
|
147
152
|
enableApplyDiscard: b,
|
|
148
153
|
enableSearch: R,
|
|
149
154
|
enableSelectAll: w,
|
|
150
155
|
enableDragDrop: !0,
|
|
151
156
|
enableCollapse: !0,
|
|
152
157
|
enableGlobalCollapse: L,
|
|
153
|
-
selectionMode:
|
|
154
|
-
searchPlaceholder:
|
|
158
|
+
selectionMode: J.CASCADE_DOWN,
|
|
159
|
+
searchPlaceholder: f("dataTable.searchColumnsPlaceholder"),
|
|
155
160
|
className: "h-full"
|
|
156
|
-
}
|
|
157
|
-
|
|
161
|
+
},
|
|
162
|
+
K ? "sync-a" : "sync-b"
|
|
163
|
+
) }) : /* @__PURE__ */ M("div", { className: "p-4 text-[13px] text-content-placeholder", children: f("dataTable.loadingColumns") });
|
|
158
164
|
};
|
|
159
165
|
export {
|
|
160
|
-
|
|
166
|
+
ne as DataTableColumnList
|
|
161
167
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SkuRowSelection, SkuRowSection } from './expandable-sku.types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type { SkuRowAttributesSection, SkuRowCustomSection, SkuRowMetricColumn, SkuRowMetricsSection, SkuRowSelection, SkuRowSection, } from './expandable-sku.types';
|
|
4
|
+
export interface ExpandableSkuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
|
|
5
|
+
/** Primary line (e.g. SKU code). */
|
|
6
|
+
sku: string;
|
|
7
|
+
/** Secondary line (e.g. product title). */
|
|
8
|
+
subtitle?: React.ReactNode;
|
|
9
|
+
/** Optional slot next to the SKU (e.g. Mapped badge). */
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* When set, a checkbox is shown. Omit entirely to hide selection (read-only / detail rows).
|
|
13
|
+
*/
|
|
14
|
+
selection?: SkuRowSelection;
|
|
15
|
+
/**
|
|
16
|
+
* Row highlight (lavender shell + white detail card). Also applied when `selection.checked` is true
|
|
17
|
+
* so checkbox-only usage picks up the same UI without passing `selected`.
|
|
18
|
+
*/
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
/** Controlled expanded state. */
|
|
21
|
+
expanded?: boolean;
|
|
22
|
+
/** Uncontrolled default. Ignored when `expanded` is passed. */
|
|
23
|
+
defaultExpanded?: boolean;
|
|
24
|
+
onExpandedChange?: (open: boolean) => void;
|
|
25
|
+
/** Disable expand/collapse interaction. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Ordered blocks inside the expanded panel. */
|
|
28
|
+
sections?: ReadonlyArray<SkuRowSection>;
|
|
29
|
+
/** Extra content after preset `sections` (inside the panel card). */
|
|
30
|
+
panelFooter?: React.ReactNode;
|
|
31
|
+
expandAriaLabel?: string;
|
|
32
|
+
collapseAriaLabel?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Expandable SKU : optional checkbox, title stack, chevron when there is panel content,
|
|
36
|
+
* and a collapsible body with metrics, attribute pills, or custom sections.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ExpandableSku: React.ForwardRefExoticComponent<ExpandableSkuProps & React.RefAttributes<HTMLDivElement>>;
|