@nice2dev/ui 1.4.14 → 1.4.15

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/{NiceColorPicker-BLwYNSXJ.cjs → NiceColorPicker-79rkvaSk.cjs} +1 -1
  3. package/dist/NiceDataGrid-B1AOjgjm.cjs +10 -0
  4. package/dist/NiceForm-fmePSeA9.cjs +1 -0
  5. package/dist/{NiceHtmlEditor-BzECmDO3.cjs → NiceHtmlEditor-By7R1wRo.cjs} +1 -1
  6. package/dist/{NiceMention-CYRqPKGU.cjs → NiceMention-i7n2BoMw.cjs} +1 -1
  7. package/dist/{NiceModuleLifecyclePanel-CiYbPcHV.cjs → NiceModuleLifecyclePanel-DVHQuhc-.cjs} +1 -1
  8. package/dist/{NicePagination-BAxwqeEd.cjs → NicePagination-D9JguOl0.cjs} +1 -1
  9. package/dist/NicePivotGrid-B_7iQJys.cjs +2 -0
  10. package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +587 -0
  11. package/dist/{NiceScheduler-BqYiHPvz.cjs → NiceScheduler-B2DamQ_L.cjs} +1 -1
  12. package/dist/backup/NiceBackupScheduler.mjs +171 -119
  13. package/dist/charts/NiceOrganizationChart.mjs +159 -59
  14. package/dist/charts/orgChartExport.mjs +71 -0
  15. package/dist/charts/tidyTree.mjs +43 -0
  16. package/dist/charts-C3Q3r8Yz.cjs +918 -0
  17. package/dist/charts.cjs +1 -1
  18. package/dist/charts.d.ts +9 -0
  19. package/dist/{core-lazy-BQexApr7.cjs → core-lazy-ChKRuEPb.cjs} +1 -1
  20. package/dist/data/NiceDataGrid.mjs +301 -320
  21. package/dist/data/NiceRowEditDialog.mjs +57 -0
  22. package/dist/data/NiceTreeGrid.mjs +478 -433
  23. package/dist/data.cjs +1 -1
  24. package/dist/data.d.ts +43 -2
  25. package/dist/{devops-cgRBnZVX.cjs → devops-o6Zm0VKB.cjs} +3 -3
  26. package/dist/devops.cjs +1 -1
  27. package/dist/editors/forms/NiceForm.mjs +216 -167
  28. package/dist/editors/inputs/NiceUpload.mjs +238 -238
  29. package/dist/editors.cjs +1 -1
  30. package/dist/editors.d.ts +13 -1
  31. package/dist/feedback.cjs +1 -1
  32. package/dist/index.cjs +254 -254
  33. package/dist/index.d.ts +198 -5
  34. package/dist/index.mjs +928 -920
  35. package/dist/lazy.cjs +1 -1
  36. package/dist/lazy.d.ts +11 -1
  37. package/dist/navigation.cjs +1 -1
  38. package/dist/no-code/NiceDataMapper.mjs +398 -361
  39. package/dist/no-code-CN_q6TcB.cjs +331 -0
  40. package/dist/no-code.cjs +1 -1
  41. package/dist/no-code.d.ts +11 -1
  42. package/dist/style.css +1 -1
  43. package/dist/tools/NicePermissionMatrix.mjs +171 -138
  44. package/dist/tools/NiceRoleEditor.mjs +334 -297
  45. package/package.json +4 -4
  46. package/dist/NiceDataGrid-D3qRQSjy.cjs +0 -10
  47. package/dist/NiceForm-BWb4LTQJ.cjs +0 -1
  48. package/dist/NicePivotGrid-Cxu5PECg.cjs +0 -152
  49. package/dist/NiceSavedQueryPanel-C1nxEmMu.cjs +0 -587
  50. package/dist/charts-BzlvCCg9.cjs +0 -768
  51. package/dist/no-code-B1jzfUF5.cjs +0 -331
@@ -1,38 +1,39 @@
1
1
  import { jsx as a, jsxs as h, Fragment as ve } from "react/jsx-runtime";
2
- import { useNiceTranslation as ur, useNiceAccessMode as gr, useControllableState as nt, useVirtualScroll as fr, useTreeFocus as hr, NiceThemeContext as pr, useOverlayFocus as mr, useRovingFocus as yr, NiceIcon as ee } from "@nice2dev/ui-core";
3
- import _r, { useCallback as u, useMemo as g, useState as A, useRef as T, useEffect as be, useContext as kr, memo as br } from "react";
4
- import { createPortal as vr } from "react-dom";
5
- import { NiceHighlight as wr } from "../typography/NiceHighlight.mjs";
6
- import { buildTreeFromNested as Cr, buildTreeFromFlat as Sr, attachLoadedChildren as xr, collectParentKeys as Pt, filterTreeBySearch as Nr, filterTreeChecked as Er, collectExpandableKeys as Tr, sortTree as Ar, flattenVisible as Mr, collectKeys as Dr } from "./NiceTreeGrid.helpers.mjs";
7
- import { buildTreeCheckIndex as Kr, normalizeCheckedKeys as Rr, computeTreeCheck as Sn, emitCheckedKeys as Gt, toggleTreeCheck as Pr, setTreeChecked as xn } from "./treeCheck.mjs";
8
- import { useTreeRowDrop as Gr, treeKeyboardMove as Lr, treeKeyboardTarget as Or } from "./treeRowDrop.mjs";
9
- const Ir = [], $r = [], Lt = [], zr = /* @__PURE__ */ new Set(), Vr = /* @__PURE__ */ new Map(), Yr = [], Br = /* @__PURE__ */ new Map(), Fr = /* @__PURE__ */ new Map(), Nn = [
2
+ import { useNiceTranslation as vr, useNiceAccessMode as wr, useControllableState as at, useVirtualScroll as Cr, useTreeFocus as Sr, NiceThemeContext as xr, useOverlayFocus as Nr, useRovingFocus as Er, NiceIcon as te } from "@nice2dev/ui-core";
3
+ import Tr, { useCallback as u, useMemo as g, useState as T, useRef as A, useEffect as be, useContext as Ar, memo as Mr } from "react";
4
+ import { createPortal as Dr } from "react-dom";
5
+ import { NiceHighlight as Rr } from "../typography/NiceHighlight.mjs";
6
+ import { NiceRowEditDialog as Kr, rowEditFormItems as Pr } from "./NiceRowEditDialog.mjs";
7
+ import { buildTreeFromNested as Gr, buildTreeFromFlat as Lr, attachLoadedChildren as Ir, collectParentKeys as It, filterTreeBySearch as Or, filterTreeChecked as $r, collectExpandableKeys as zr, sortTree as Vr, flattenVisible as Yr, collectKeys as Br } from "./NiceTreeGrid.helpers.mjs";
8
+ import { buildTreeCheckIndex as Fr, normalizeCheckedKeys as jr, computeTreeCheck as An, emitCheckedKeys as Ot, toggleTreeCheck as Hr, setTreeChecked as Mn } from "./treeCheck.mjs";
9
+ import { useTreeRowDrop as Ur, treeKeyboardMove as Wr, treeKeyboardTarget as qr } from "./treeRowDrop.mjs";
10
+ const Xr = [], Jr = [], $t = [], Qr = /* @__PURE__ */ new Set(), Zr = /* @__PURE__ */ new Map(), ea = [], ta = /* @__PURE__ */ new Map(), na = /* @__PURE__ */ new Map(), Dn = [
10
11
  "expandAll",
11
12
  "collapseAll",
12
13
  "onlyChecked",
13
14
  "clearChecked"
14
- ], En = 10;
15
- function jr({
16
- node: w,
17
- level: te,
18
- posInSet: ne,
15
+ ], Rn = 10;
16
+ function ra({
17
+ node: b,
18
+ level: ne,
19
+ posInSet: Y,
19
20
  setSize: we,
20
21
  rowIndex: Ce,
21
22
  ariaRowIndex: Se,
22
- columns: G,
23
+ columns: L,
23
24
  highlight: xe,
24
25
  query: re,
25
26
  expandable: C,
26
27
  expanded: E,
27
28
  busy: ae,
28
29
  expandLabel: Ne,
29
- collapseLabel: ce,
30
- subtreeAction: le,
30
+ collapseLabel: oe,
31
+ subtreeAction: ce,
31
32
  subtreeLabel: Ee,
32
- checkMode: L,
33
+ checkMode: I,
33
34
  hasCheckbox: S,
34
- checkState: oe,
35
- checkLabel: rt,
35
+ checkState: le,
36
+ checkLabel: ot,
36
37
  locked: p,
37
38
  countChecked: Te,
38
39
  countTotal: ie,
@@ -41,108 +42,108 @@ function jr({
41
42
  selected: O,
42
43
  selectLabel: se,
43
44
  readOnly: De,
44
- className: Ke,
45
- clickable: Re,
46
- height: M,
47
- draggable: at,
45
+ className: Re,
46
+ clickable: Ke,
47
+ height: D,
48
+ draggable: ct,
48
49
  drop: Pe,
49
- dragging: ct,
50
- handlers: I
50
+ dragging: lt,
51
+ handlers: $
51
52
  }) {
52
- const Y = S ? /* @__PURE__ */ a(
53
+ const B = S ? /* @__PURE__ */ a(
53
54
  "input",
54
55
  {
55
56
  type: "checkbox",
56
57
  className: "nice-treegrid__check-input",
57
- checked: oe === "checked",
58
+ checked: le === "checked",
58
59
  ref: (m) => {
59
- m && (m.indeterminate = oe === "indeterminate");
60
+ m && (m.indeterminate = le === "indeterminate");
60
61
  },
61
62
  disabled: p || De,
62
63
  tabIndex: -1,
63
- "aria-label": rt,
64
+ "aria-label": ot,
64
65
  onClick: (m) => m.stopPropagation(),
65
66
  onChange: (m) => {
66
- I.toggleCheck(w.key), m.currentTarget.closest("tr")?.focus({ preventScroll: !0 });
67
+ $.toggleCheck(b.key), m.currentTarget.closest("tr")?.focus({ preventScroll: !0 });
67
68
  }
68
69
  }
69
70
  ) : null, Ge = [
70
71
  "nice-treegrid__row",
71
- L !== "none" && !S ? "nice-treegrid__row--info" : "",
72
+ I !== "none" && !S ? "nice-treegrid__row--info" : "",
72
73
  p ? "nice-treegrid__row--disabled" : "",
73
- S && oe === "checked" ? "nice-treegrid__row--checked" : "",
74
+ S && le === "checked" ? "nice-treegrid__row--checked" : "",
74
75
  O ? "nice-datagrid__row--selected" : "",
75
76
  Pe ? `nice-treegrid__row--drop-${Pe}` : "",
76
- ct ? "nice-treegrid__row--dragging" : "",
77
- Ke ?? ""
77
+ lt ? "nice-treegrid__row--dragging" : "",
78
+ Re ?? ""
78
79
  ].filter(Boolean).join(" ");
79
80
  return /* @__PURE__ */ h(
80
81
  "tr",
81
82
  {
82
83
  className: Ge,
83
- "data-key": w.key,
84
- draggable: at || void 0,
84
+ "data-key": b.key,
85
+ draggable: ct || void 0,
85
86
  tabIndex: -1,
86
- "aria-level": te,
87
- "aria-posinset": ne,
87
+ "aria-level": ne,
88
+ "aria-posinset": Y,
88
89
  "aria-setsize": we,
89
90
  "aria-rowindex": Se,
90
91
  "aria-expanded": C ? E : void 0,
91
92
  "aria-selected": O,
92
93
  "aria-disabled": p || void 0,
93
94
  "aria-busy": ae || void 0,
94
- onClick: () => I.rowClick(w),
95
- style: Re || M !== void 0 ? { cursor: Re ? "pointer" : void 0, height: M } : void 0,
95
+ onClick: () => $.rowClick(b),
96
+ style: Ke || D !== void 0 ? { cursor: Ke ? "pointer" : void 0, height: D } : void 0,
96
97
  children: [
97
- L === "column" && /* @__PURE__ */ a("td", { className: "nice-datagrid__checkbox nice-treegrid__check-cell", children: Y }),
98
+ I === "column" && /* @__PURE__ */ a("td", { className: "nice-datagrid__checkbox nice-treegrid__check-cell", children: B }),
98
99
  Me && /* @__PURE__ */ a("td", { className: "nice-datagrid__checkbox", children: /* @__PURE__ */ a(
99
100
  "input",
100
101
  {
101
102
  type: "checkbox",
102
103
  checked: !!O,
103
- onChange: () => I.toggleSelected(w.key),
104
+ onChange: () => $.toggleSelected(b.key),
104
105
  onClick: (m) => m.stopPropagation(),
105
106
  disabled: De,
106
107
  tabIndex: -1,
107
108
  "aria-label": se
108
109
  }
109
110
  ) }),
110
- G.map((m, B) => {
111
- const de = w.data[m.field];
111
+ L.map((m, F) => {
112
+ const de = b.data[m.field];
112
113
  return /* @__PURE__ */ h("td", { style: { textAlign: m.align }, children: [
113
- B === 0 && /* @__PURE__ */ h(ve, { children: [
114
- /* @__PURE__ */ a("span", { className: "nice-treegrid__indent", style: { width: (te - 1) * 20 } }),
114
+ F === 0 && /* @__PURE__ */ h(ve, { children: [
115
+ /* @__PURE__ */ a("span", { className: "nice-treegrid__indent", style: { width: (ne - 1) * 20 } }),
115
116
  /* @__PURE__ */ a(
116
117
  "button",
117
118
  {
118
119
  type: "button",
119
120
  className: `nice-treegrid__toggle ${C ? "" : "nice-treegrid__toggle--leaf"}`,
120
- onClick: ($) => {
121
- $.stopPropagation(), C && I.toggleExpand(w.key, $.altKey || $.shiftKey);
121
+ onClick: (z) => {
122
+ z.stopPropagation(), C && $.toggleExpand(b.key, z.altKey || z.shiftKey);
122
123
  },
123
124
  tabIndex: -1,
124
125
  "aria-hidden": C ? void 0 : !0,
125
- "aria-label": C ? E ? ce : Ne : void 0,
126
- children: C ? /* @__PURE__ */ a(ee, { name: E ? "chevron-down" : "chevron-right", size: 12 }) : ""
126
+ "aria-label": C ? E ? oe : Ne : void 0,
127
+ children: C ? /* @__PURE__ */ a(te, { name: E ? "chevron-down" : "chevron-right", size: 12 }) : ""
127
128
  }
128
129
  ),
129
- L === "tree" && /* @__PURE__ */ a(
130
+ I === "tree" && /* @__PURE__ */ a(
130
131
  "span",
131
132
  {
132
133
  className: `nice-treegrid__check${S ? "" : " nice-treegrid__check--none"}`,
133
- children: Y
134
+ children: B
134
135
  }
135
136
  )
136
137
  ] }),
137
- m.render ? m.render(de, w.data, Ce) : xe[B] && re ? /* @__PURE__ */ a(
138
- wr,
138
+ m.render ? m.render(de, b.data, Ce) : xe[F] && re ? /* @__PURE__ */ a(
139
+ Rr,
139
140
  {
140
141
  text: String(de ?? ""),
141
142
  query: re,
142
143
  highlightClassName: "nice-treegrid__match"
143
144
  }
144
145
  ) : String(de ?? ""),
145
- B === 0 && ie > 0 && /* @__PURE__ */ h(
146
+ F === 0 && ie > 0 && /* @__PURE__ */ h(
146
147
  "span",
147
148
  {
148
149
  className: `nice-treegrid__count${Te === ie ? " nice-treegrid__count--full" : ""}`,
@@ -154,7 +155,7 @@ function jr({
154
155
  ]
155
156
  }
156
157
  ),
157
- B === 0 && le && /* @__PURE__ */ a(
158
+ F === 0 && ce && /* @__PURE__ */ a(
158
159
  "button",
159
160
  {
160
161
  type: "button",
@@ -162,10 +163,10 @@ function jr({
162
163
  tabIndex: -1,
163
164
  "aria-label": Ee,
164
165
  title: Ee,
165
- onClick: ($) => {
166
- $.stopPropagation(), I.setSubtreeExpanded(w.key, le === "expand");
166
+ onClick: (z) => {
167
+ z.stopPropagation(), $.setSubtreeExpanded(b.key, ce === "expand");
167
168
  },
168
- children: /* @__PURE__ */ a(ee, { name: le === "expand" ? "expand" : "collapse", size: 12 })
169
+ children: /* @__PURE__ */ a(te, { name: ce === "expand" ? "expand" : "collapse", size: 12 })
169
170
  }
170
171
  )
171
172
  ] }, m.field);
@@ -174,28 +175,28 @@ function jr({
174
175
  }
175
176
  );
176
177
  }
177
- const Hr = /* @__PURE__ */ br(jr);
178
- function na({
179
- columns: w = Ir,
180
- data: te = $r,
181
- keyField: ne = "id",
178
+ const aa = /* @__PURE__ */ Mr(ra);
179
+ function pa({
180
+ columns: b = Xr,
181
+ data: ne = Jr,
182
+ keyField: Y = "id",
182
183
  parentKeyField: we = "parentId",
183
184
  nested: Ce = !1,
184
185
  childrenField: Se = "children",
185
- expandedKeys: G,
186
+ expandedKeys: L,
186
187
  defaultExpandedKeys: xe,
187
188
  onExpandedChange: re,
188
189
  hasChildren: C,
189
190
  loadChildren: E,
190
191
  rowActions: ae,
191
192
  defaultExpandAll: Ne = !1,
192
- sortable: ce = !0,
193
- sortField: le,
193
+ sortable: oe = !0,
194
+ sortField: ce,
194
195
  sortDirection: Ee,
195
- onSort: L,
196
+ onSort: I,
196
197
  selectable: S,
197
- selectedKeys: oe,
198
- onSelectionChange: rt,
198
+ selectedKeys: le,
199
+ onSelectionChange: ot,
199
200
  checkable: p,
200
201
  checkedKeys: Te,
201
202
  defaultCheckedKeys: ie,
@@ -204,64 +205,70 @@ function na({
204
205
  isRowCheckable: O,
205
206
  isRowDisabled: se,
206
207
  checkboxPlacement: De = "tree",
207
- checkOnRowClick: Ke,
208
- showCheckedCount: Re,
209
- checkedSummary: M,
210
- showSelectAll: at = !0,
208
+ checkOnRowClick: Re,
209
+ showCheckedCount: Ke,
210
+ checkedSummary: D,
211
+ showSelectAll: ct = !0,
211
212
  showOnlyChecked: Pe,
212
- defaultShowOnlyChecked: ct,
213
- onShowOnlyCheckedChange: I,
214
- toolbarActions: Y,
213
+ defaultShowOnlyChecked: lt,
214
+ onShowOnlyCheckedChange: $,
215
+ toolbarActions: B,
215
216
  searchable: Ge,
216
217
  searchPlaceholder: m,
217
- searchText: B,
218
+ searchText: F,
218
219
  defaultSearchText: de,
219
- onSearchChange: $,
220
- searchFields: Ot,
220
+ onSearchChange: z,
221
+ searchFields: zt,
221
222
  searchFilter: ue,
222
- searchKeepDescendants: It = !1,
223
- searchAutoExpand: $t = !0,
224
- highlightMatches: zt = !0,
225
- rowClassName: lt,
226
- getRowLabel: Vt,
227
- virtualScroll: Tn,
223
+ searchKeepDescendants: Vt = !1,
224
+ searchAutoExpand: Yt = !0,
225
+ highlightMatches: Bt = !0,
226
+ rowClassName: it,
227
+ getRowLabel: Ft,
228
+ virtualScroll: Kn,
228
229
  rowHeight: ge = 36,
229
- height: ot,
230
- striped: An,
231
- compact: Mn,
232
- size: Dn = "md",
233
- loading: Yt,
234
- disabled: Kn,
235
- readOnly: Rn,
230
+ height: st,
231
+ striped: Pn,
232
+ compact: Gn,
233
+ size: Ln = "md",
234
+ loading: jt,
235
+ disabled: In,
236
+ readOnly: On,
236
237
  error: Le,
237
- emptyText: Pn,
238
- toolbar: Bt,
239
- onRowClick: Ft,
240
- contextMenuItems: Oe,
241
- rowDraggable: it,
242
- canDrop: jt,
243
- onRowDrop: st,
244
- className: Gn,
245
- style: Ln,
246
- id: Ht,
247
- testId: On,
248
- "data-testid": In,
249
- accessMode: $n,
250
- "aria-label": zn,
251
- "aria-labelledby": Vn
238
+ emptyText: $n,
239
+ toolbar: Ht,
240
+ onRowClick: Ut,
241
+ contextMenuItems: Ie,
242
+ rowDraggable: dt,
243
+ canDrop: Wt,
244
+ onRowDrop: ut,
245
+ editMode: zn,
246
+ formItems: Vn,
247
+ formColumns: Yn = 2,
248
+ editFormTitle: Bn,
249
+ formProps: Fn,
250
+ onRowEdit: qt,
251
+ className: jn,
252
+ style: Hn,
253
+ id: Xt,
254
+ testId: Un,
255
+ "data-testid": Wn,
256
+ accessMode: qn,
257
+ "aria-label": Xn,
258
+ "aria-labelledby": Jn
252
259
  }) {
253
- const { t: i } = ur(), dt = gr($n, Ht), z = !!Kn || dt === "disabled", D = !!Rn || dt === "readOnly", Ie = u(
254
- (e, t) => Ce ? Cr(e, Se, ne, t) : Sr(e, ne, we, t),
255
- [ne, we, Ce, Se]
256
- ), ut = g(() => Ie(te, 0), [Ie, te]), [fe, Yn] = A(Br), [gt, ft] = A(Fr), b = g(
257
- () => fe.size > 0 ? xr(ut, fe, Ie) : ut,
258
- [ut, fe, Ie]
260
+ const { t: i } = vr(), gt = wr(qn, Xt), R = !!In || gt === "disabled", M = !!On || gt === "readOnly", Oe = u(
261
+ (e, t) => Ce ? Gr(e, Se, Y, t) : Lr(e, Y, we, t),
262
+ [Y, we, Ce, Se]
263
+ ), ft = g(() => Oe(ne, 0), [Oe, ne]), [fe, Qn] = T(ta), [ht, pt] = T(na), v = g(
264
+ () => fe.size > 0 ? Ir(ft, fe, Oe) : ft,
265
+ [ft, fe, Oe]
259
266
  ), f = g(() => {
260
267
  const e = /* @__PURE__ */ new Map(), t = (n) => n.forEach((r) => {
261
268
  e.set(r.key, r), t(r.children);
262
269
  });
263
- return t(b), e;
264
- }, [b]), $e = !!C || !!E, v = u(
270
+ return t(v), e;
271
+ }, [v]), $e = !!C || !!E, w = u(
265
272
  (e) => {
266
273
  if (!$e)
267
274
  return !1;
@@ -269,185 +276,185 @@ function na({
269
276
  return !!t && t.children.length === 0 && !fe.has(e) && (C ? C(t.data) : !0);
270
277
  },
271
278
  [$e, f, fe, C]
272
- ), ht = T(/* @__PURE__ */ new Set()), pt = T(!0);
273
- be(() => (pt.current = !0, () => {
274
- pt.current = !1;
279
+ ), mt = A(/* @__PURE__ */ new Set()), yt = A(!0);
280
+ be(() => (yt.current = !0, () => {
281
+ yt.current = !1;
275
282
  }), []);
276
- const Ut = u(
283
+ const Jt = u(
277
284
  (e) => {
278
285
  const t = f.get(e);
279
- if (!E || !t || ht.current.has(e))
286
+ if (!E || !t || mt.current.has(e))
280
287
  return;
281
- ht.current.add(e);
288
+ mt.current.add(e);
282
289
  const n = (r) => {
283
- ht.current.delete(e), pt.current && (r && Yn((o) => new Map(o).set(e, r)), ft((o) => {
284
- const l = new Map(o);
285
- return r ? l.delete(e) : l.set(e, "error"), l;
290
+ mt.current.delete(e), yt.current && (r && Qn((l) => new Map(l).set(e, r)), pt((l) => {
291
+ const c = new Map(l);
292
+ return r ? c.delete(e) : c.set(e, "error"), c;
286
293
  }));
287
294
  };
288
- ft((r) => new Map(r).set(e, "loading")), E(t.data).then(
295
+ pt((r) => new Map(r).set(e, "loading")), E(t.data).then(
289
296
  (r) => n(Array.isArray(r) ? r : []),
290
297
  () => n(null)
291
298
  );
292
299
  },
293
300
  [E, f]
294
- ), Bn = u((e) => {
295
- ft((t) => {
301
+ ), Zn = u((e) => {
302
+ pt((t) => {
296
303
  const n = new Map(t);
297
304
  return n.delete(e), n;
298
305
  });
299
- }, []), K = g(() => w.filter((e) => !e.hidden), [w]), ze = g(() => Pt(b), [b]), [mt, Fn] = A(null), he = g(() => {
300
- if (G)
301
- return new Set(G);
302
- if (mt)
303
- return mt;
304
- const e = new Set(xe ?? Lt);
306
+ }, []), K = g(() => b.filter((e) => !e.hidden), [b]), ze = g(() => It(v), [v]), [_t, er] = T(null), he = g(() => {
307
+ if (L)
308
+ return new Set(L);
309
+ if (_t)
310
+ return _t;
311
+ const e = new Set(xe ?? $t);
305
312
  return Ne && ze.forEach((t) => e.add(t)), e;
306
- }, [G, mt, xe, Ne, ze]), yt = T(he);
307
- yt.current = he;
313
+ }, [L, _t, xe, Ne, ze]), kt = A(he);
314
+ kt.current = he;
308
315
  const Ve = u(
309
316
  (e) => {
310
- yt.current = e, G || Fn(e), re?.([...e]);
317
+ kt.current = e, L || er(e), re?.([...e]);
311
318
  },
312
- [G, re]
313
- ), [Wt, jn] = A({
319
+ [L, re]
320
+ ), [Qt, tr] = T({
314
321
  field: "",
315
322
  dir: null
316
- }), F = le ?? Wt.field, R = Ee ?? Wt.dir, Hn = u(
323
+ }), j = ce ?? Qt.field, P = Ee ?? Qt.dir, nr = u(
317
324
  (e) => {
318
- const t = F === e ? R === "asc" ? "desc" : R === "desc" ? null : "asc" : "asc";
319
- L ? L(e, t) : jn({ field: e, dir: t });
325
+ const t = j === e ? P === "asc" ? "desc" : P === "desc" ? null : "asc" : "asc";
326
+ I ? I(e, t) : tr({ field: e, dir: t });
320
327
  },
321
- [F, R, L]
322
- ), [Un, qt] = nt({
323
- value: oe,
324
- fallbackValue: zr,
325
- onChange: rt,
328
+ [j, P, I]
329
+ ), [rr, Zt] = at({
330
+ value: le,
331
+ fallbackValue: Qr,
332
+ onChange: ot,
326
333
  componentName: "NiceTreeGrid"
327
334
  }), Ye = u(
328
335
  (e) => {
329
- qt((t) => {
336
+ Zt((t) => {
330
337
  const n = new Set(t);
331
338
  return n.has(e) ? n.delete(e) : n.add(e), n;
332
339
  });
333
340
  },
334
- [qt]
335
- ), c = g(
336
- () => p ? Kr(b, {
341
+ [Zt]
342
+ ), o = g(
343
+ () => p ? Fr(v, {
337
344
  getKey: (e) => e.key,
338
345
  getChildren: (e) => e.children,
339
346
  isCheckable: O ? (e) => O(e.data) : void 0,
340
347
  isDisabled: se ? (e) => se(e.data) : void 0
341
348
  }) : null,
342
- [p, b, O, se]
343
- ), [Xt, Jt] = nt({
349
+ [p, v, O, se]
350
+ ), [en, tn] = at({
344
351
  value: Te,
345
352
  defaultValue: ie,
346
- fallbackValue: Lt,
353
+ fallbackValue: $t,
347
354
  componentName: "NiceTreeGrid"
348
355
  }), s = g(
349
- () => c ? Rr(c, Xt) : null,
350
- [c, Xt]
356
+ () => o ? jr(o, en) : null,
357
+ [o, en]
351
358
  ), y = g(
352
- () => c && s ? Sn(c, s.leaves) : null,
353
- [c, s]
354
- ), Qt = g(() => {
355
- if (typeof M != "function" || !c || !s || !y)
359
+ () => o && s ? An(o, s.leaves) : null,
360
+ [o, s]
361
+ ), nn = g(() => {
362
+ if (typeof D != "function" || !o || !s || !y)
356
363
  return null;
357
- const e = Gt(c, s.leaves, "leaves"), t = [];
364
+ const e = Ot(o, s.leaves, "leaves"), t = [];
358
365
  return e.forEach((n) => {
359
366
  const r = f.get(n);
360
367
  r && t.push(r.data);
361
368
  }), { checked: y.total.checked, total: y.total.total, leafKeys: e, rows: t };
362
- }, [M, c, s, y, f]), j = u(
369
+ }, [D, o, s, y, f]), H = u(
363
370
  (e, t) => {
364
- if (!c || !s || e === s.leaves)
371
+ if (!o || !s || e === s.leaves)
365
372
  return;
366
- const n = Gt(c, e, Me, s.unknown);
367
- Jt(n), Ae?.(n, {
373
+ const n = Ot(o, e, Me, s.unknown);
374
+ tn(n), Ae?.(n, {
368
375
  ...t,
369
- leafKeys: Gt(c, e, "leaves"),
370
- halfCheckedKeys: [...Sn(c, e).halfChecked]
376
+ leafKeys: Ot(o, e, "leaves"),
377
+ halfCheckedKeys: [...An(o, e).halfChecked]
371
378
  });
372
379
  },
373
- [c, s, Me, Jt, Ae]
380
+ [o, s, Me, tn, Ae]
374
381
  ), Be = u(
375
382
  (e) => {
376
- if (!c || !s)
383
+ if (!o || !s)
377
384
  return;
378
- const t = Pr(c, s.leaves, e);
379
- j(t, {
385
+ const t = Hr(o, s.leaves, e);
386
+ H(t, {
380
387
  source: "row",
381
388
  checked: t.size > s.leaves.size,
382
389
  key: e,
383
390
  row: f.get(e)?.data
384
391
  });
385
392
  },
386
- [c, s, j, f]
387
- ), [Fe, _t] = nt({
388
- value: B,
393
+ [o, s, H, f]
394
+ ), [Fe, bt] = at({
395
+ value: F,
389
396
  defaultValue: de,
390
397
  fallbackValue: "",
391
- onChange: $,
398
+ onChange: z,
392
399
  componentName: "NiceTreeGrid"
393
400
  }), x = Fe.trim(), je = g(
394
- () => Ot ?? K.map((e) => e.field),
395
- [Ot, K]
396
- ), H = g(() => {
401
+ () => zt ?? K.map((e) => e.field),
402
+ [zt, K]
403
+ ), U = g(() => {
397
404
  if (!x)
398
405
  return null;
399
406
  const e = x.toLowerCase();
400
- return Nr(b, ue ? (n) => ue(n.data, x) : (n) => je.some(
407
+ return Or(v, ue ? (n) => ue(n.data, x) : (n) => je.some(
401
408
  (r) => String(n.data[r] ?? "").toLowerCase().includes(e)
402
- ), It);
403
- }, [b, x, ue, je, It]), pe = H?.tree ?? b, [Zt, Wn] = nt({
409
+ ), Vt);
410
+ }, [v, x, ue, je, Vt]), pe = U?.tree ?? v, [rn, ar] = at({
404
411
  value: Pe,
405
- defaultValue: ct,
412
+ defaultValue: lt,
406
413
  fallbackValue: !1,
407
- onChange: I,
414
+ onChange: $,
408
415
  componentName: "NiceTreeGrid"
409
- }), P = !!p && Zt && y !== null, U = g(
410
- () => P && y && c ? Er(pe, {
416
+ }), G = !!p && rn && y !== null, W = g(
417
+ () => G && y && o ? $r(pe, {
411
418
  state: y.state,
412
- isCheckable: c.isCheckable,
413
- isLeaf: c.isLeaf
419
+ isCheckable: o.isCheckable,
420
+ isLeaf: o.isLeaf
414
421
  }) : pe,
415
- [P, y, c, pe]
416
- ), W = x !== "" || P, q = `${x}
417
- ${P ? 1 : 0}`, [en, tn] = A(
422
+ [G, y, o, pe]
423
+ ), q = x !== "" || G, X = `${x}
424
+ ${G ? 1 : 0}`, [an, on] = T(
418
425
  () => ({ key: "", map: /* @__PURE__ */ new Map() })
419
- ), nn = en.key === q ? en.map : Vr, rn = g(() => {
426
+ ), cn = an.key === X ? an.map : Zr, ln = g(() => {
420
427
  const e = /* @__PURE__ */ new Set();
421
- return H && $t && H.expand.forEach((t) => e.add(t)), P && c && Pt(U).forEach((t) => {
422
- c.isLeaf(t) || e.add(t);
428
+ return U && Yt && U.expand.forEach((t) => e.add(t)), G && o && It(W).forEach((t) => {
429
+ o.isLeaf(t) || e.add(t);
423
430
  }), e;
424
- }, [H, $t, P, c, U]), N = u(
425
- (e) => W ? nn.get(e) ?? (he.has(e) || rn.has(e)) : he.has(e),
426
- [W, nn, he, rn]
431
+ }, [U, Yt, G, o, W]), N = u(
432
+ (e) => q ? cn.get(e) ?? (he.has(e) || ln.has(e)) : he.has(e),
433
+ [q, cn, he, ln]
427
434
  ), He = u(
428
435
  (e, t) => {
429
- const n = yt.current;
436
+ const n = kt.current;
430
437
  if (e.some((r) => n.has(r) !== t)) {
431
438
  const r = new Set(n);
432
- e.forEach((o) => t ? r.add(o) : r.delete(o)), Ve(r);
439
+ e.forEach((l) => t ? r.add(l) : r.delete(l)), Ve(r);
433
440
  }
434
- W && tn((r) => {
435
- const o = new Map(r.key === q ? r.map : void 0);
436
- return e.forEach((l) => o.set(l, t)), { key: q, map: o };
441
+ q && on((r) => {
442
+ const l = new Map(r.key === X ? r.map : void 0);
443
+ return e.forEach((c) => l.set(c, t)), { key: X, map: l };
437
444
  });
438
445
  },
439
- [Ve, W, q]
440
- ), an = u(
441
- (e) => e.children.length > 0 || v(e.key),
442
- [v]
443
- ), me = T(/* @__PURE__ */ new Set()), Ue = u(
446
+ [Ve, q, X]
447
+ ), sn = u(
448
+ (e) => e.children.length > 0 || w(e.key),
449
+ [w]
450
+ ), me = A(/* @__PURE__ */ new Set()), Ue = u(
444
451
  (e, t) => {
445
- const n = e.flatMap((r) => Tr(r, an));
452
+ const n = e.flatMap((r) => zr(r, sn));
446
453
  n.forEach((r) => {
447
- t ? v(r) && me.current.add(r) : me.current.delete(r);
454
+ t ? w(r) && me.current.add(r) : me.current.delete(r);
448
455
  }), He(n, t);
449
456
  },
450
- [an, v, He]
457
+ [sn, w, He]
451
458
  ), ye = u(
452
459
  (e, t) => {
453
460
  const n = f.get(e);
@@ -460,188 +467,193 @@ ${P ? 1 : 0}`, [en, tn] = A(
460
467
  t ? ye(e, n) : He([e], n);
461
468
  },
462
469
  [N, ye, He]
463
- ), cn = T({ nodeByKey: f, isPending: v, setSubtreesExpanded: Ue });
464
- cn.current = { nodeByKey: f, isPending: v, setSubtreesExpanded: Ue }, be(() => {
465
- const { nodeByKey: e, isPending: t, setSubtreesExpanded: n } = cn.current, r = [];
466
- for (const o of [...me.current]) {
467
- const l = e.get(o);
468
- (!l || l.children.length > 0 || !t(o)) && (me.current.delete(o), r.push(...l?.children ?? []));
470
+ ), dn = A({ nodeByKey: f, isPending: w, setSubtreesExpanded: Ue });
471
+ dn.current = { nodeByKey: f, isPending: w, setSubtreesExpanded: Ue }, be(() => {
472
+ const { nodeByKey: e, isPending: t, setSubtreesExpanded: n } = dn.current, r = [];
473
+ for (const l of [...me.current]) {
474
+ const c = e.get(l);
475
+ (!c || c.children.length > 0 || !t(l)) && (me.current.delete(l), r.push(...c?.children ?? []));
469
476
  }
470
477
  r.length > 0 && n(r, !0);
471
- }, [b]);
472
- const qn = u(
478
+ }, [v]);
479
+ const or = u(
473
480
  (e) => {
474
- e || me.current.clear(), Ve(e ? new Set(ze) : /* @__PURE__ */ new Set()), W && tn({
475
- key: q,
476
- map: new Map(Pt(U).map((t) => [t, e]))
481
+ e || me.current.clear(), Ve(e ? new Set(ze) : /* @__PURE__ */ new Set()), q && on({
482
+ key: X,
483
+ map: new Map(It(W).map((t) => [t, e]))
477
484
  });
478
485
  },
479
- [Ve, ze, W, q, U]
486
+ [Ve, ze, q, X, W]
480
487
  ), qe = g(
481
- () => Ar(U, F, R),
482
- [U, F, R]
483
- ), ln = u(
484
- (e) => v(e.key) ? gt.get(e.key) === "error" ? "error" : "loading" : null,
485
- [v, gt]
488
+ () => Vr(W, j, P),
489
+ [W, j, P]
490
+ ), un = u(
491
+ (e) => w(e.key) ? ht.get(e.key) === "error" ? "error" : "loading" : null,
492
+ [w, ht]
486
493
  ), k = g(
487
- () => Mr(qe, N, $e ? ln : void 0),
488
- [qe, N, $e, ln]
489
- ), kt = ae === !0 || Array.isArray(ae) && ae.includes("expandSubtree"), Xn = g(() => {
494
+ () => Yr(qe, N, $e ? un : void 0),
495
+ [qe, N, $e, un]
496
+ ), vt = ae === !0 || Array.isArray(ae) && ae.includes("expandSubtree"), cr = g(() => {
490
497
  const e = /* @__PURE__ */ new Set();
491
- if (!kt)
498
+ if (!vt)
492
499
  return e;
493
500
  const t = (n) => {
494
501
  if (n.children.length === 0)
495
- return !v(n.key);
502
+ return !w(n.key);
496
503
  let r = N(n.key);
497
- return n.children.forEach((o) => {
498
- t(o) || (r = !1);
504
+ return n.children.forEach((l) => {
505
+ t(l) || (r = !1);
499
506
  }), r && e.add(n.key), r;
500
507
  };
501
- return b.forEach(t), e;
502
- }, [kt, b, v, N]);
508
+ return v.forEach(t), e;
509
+ }, [vt, v, w, N]);
503
510
  be(() => {
504
511
  E && k.forEach((e) => {
505
- e.placeholder === "loading" && Ut(e.node.key);
512
+ e.placeholder === "loading" && Jt(e.node.key);
506
513
  });
507
- }, [k, E, Ut]);
508
- const X = g(() => c ? x ? Dr(pe).filter((e) => c.isLeaf(e)) : c.leaves : Lt, [c, x, pe]), on = g(() => {
509
- if (!s || X.length === 0)
514
+ }, [k, E, Jt]);
515
+ const J = g(() => o ? x ? Br(pe).filter((e) => o.isLeaf(e)) : o.leaves : $t, [o, x, pe]), gn = g(() => {
516
+ if (!s || J.length === 0)
510
517
  return "unchecked";
511
518
  let e = 0;
512
- for (const t of X)
519
+ for (const t of J)
513
520
  s.leaves.has(t) && e++;
514
- return e === 0 ? "unchecked" : e === X.length ? "checked" : "indeterminate";
515
- }, [s, X]), Jn = u(() => {
516
- if (!c || !s)
521
+ return e === 0 ? "unchecked" : e === J.length ? "checked" : "indeterminate";
522
+ }, [s, J]), lr = u(() => {
523
+ if (!o || !s)
517
524
  return;
518
- const e = X.filter((n) => !c.isLocked(n)), t = !e.every((n) => s.leaves.has(n));
519
- j(xn(c, s.leaves, e, t), {
525
+ const e = J.filter((n) => !o.isLocked(n)), t = !e.every((n) => s.leaves.has(n));
526
+ H(Mn(o, s.leaves, e, t), {
520
527
  source: "selectAll",
521
528
  checked: t
522
529
  });
523
- }, [c, s, X, j]), Qn = u(() => {
524
- c && s && j(xn(c, s.leaves, c.leaves, !1), {
530
+ }, [o, s, J, H]), ir = u(() => {
531
+ o && s && H(Mn(o, s.leaves, o.leaves, !1), {
525
532
  source: "clear",
526
533
  checked: !1
527
534
  });
528
- }, [c, s, j]), sn = (e) => {
529
- D || z || (p && Ke && c?.isCheckable(e.key) ? Be(e.key) : p && S && Ye(e.key), Ft?.(e.data));
530
- }, J = T({
535
+ }, [o, s, H]), fn = (e) => {
536
+ M || R || (p && Re && o?.isCheckable(e.key) ? Be(e.key) : p && S && Ye(e.key), Ut?.(e.data));
537
+ }, Q = A({
531
538
  toggleExpand: We,
532
539
  setSubtreeExpanded: ye,
533
540
  toggleCheck: Be,
534
541
  toggleSelected: Ye,
535
- rowClick: sn
542
+ rowClick: fn
536
543
  });
537
- J.current = {
544
+ Q.current = {
538
545
  toggleExpand: We,
539
546
  setSubtreeExpanded: ye,
540
547
  toggleCheck: Be,
541
548
  toggleSelected: Ye,
542
- rowClick: sn
549
+ rowClick: fn
543
550
  };
544
- const dn = g(
551
+ const hn = g(
545
552
  () => ({
546
- toggleExpand: (e, t) => J.current.toggleExpand(e, t),
547
- setSubtreeExpanded: (e, t) => J.current.setSubtreeExpanded(e, t),
548
- toggleCheck: (e) => J.current.toggleCheck(e),
549
- toggleSelected: (e) => J.current.toggleSelected(e),
550
- rowClick: (e) => J.current.rowClick(e)
553
+ toggleExpand: (e, t) => Q.current.toggleExpand(e, t),
554
+ setSubtreeExpanded: (e, t) => Q.current.setSubtreeExpanded(e, t),
555
+ toggleCheck: (e) => Q.current.toggleCheck(e),
556
+ toggleSelected: (e) => Q.current.toggleSelected(e),
557
+ rowClick: (e) => Q.current.rowClick(e)
551
558
  }),
552
559
  []
553
- ), V = !!it && !!st && !D && !z, bt = g(() => {
560
+ ), V = !!dt && !!ut && !M && !R, wt = g(() => {
554
561
  const e = /* @__PURE__ */ new Map();
555
562
  if (!V)
556
563
  return e;
557
564
  const t = (n, r) => {
558
- const o = n.map((l) => l.key);
559
- n.forEach((l) => {
560
- e.set(l.key, { parent: r, siblings: o }), t(l.children, l.key);
565
+ const l = n.map((c) => c.key);
566
+ n.forEach((c) => {
567
+ e.set(c.key, { parent: r, siblings: l }), t(c.children, c.key);
561
568
  });
562
569
  };
563
570
  return t(qe, null), e;
564
- }, [V, qe]), un = u(
571
+ }, [V, qe]), pn = u(
565
572
  (e, t) => {
566
573
  const n = /* @__PURE__ */ new Set();
567
- for (let r = e; r != null && !n.has(r); r = bt.get(r)?.parent) {
574
+ for (let r = e; r != null && !n.has(r); r = wt.get(r)?.parent) {
568
575
  if (r === t)
569
576
  return !0;
570
577
  n.add(r);
571
578
  }
572
579
  return !1;
573
580
  },
574
- [bt]
575
- ), vt = (e) => {
581
+ [wt]
582
+ ), Ct = (e) => {
576
583
  const t = f.get(e);
577
- return !!t && (typeof it == "function" ? it(t.data) : !0);
578
- }, gn = (e, t, n) => {
579
- const r = f.get(e), o = f.get(t);
580
- return !r || !o || un(t, e) ? !1 : jt ? jt(r.data, o.data, n) : !0;
581
- }, Xe = Gr({
584
+ return !!t && (typeof dt == "function" ? dt(t.data) : !0);
585
+ }, mn = (e, t, n) => {
586
+ const r = f.get(e), l = f.get(t);
587
+ return !r || !l || pn(t, e) ? !1 : Wt ? Wt(r.data, l.data, n) : !0;
588
+ }, Xe = Ur({
582
589
  enabled: V,
583
590
  rowSelector: "tr.nice-treegrid__row",
584
- canDrag: vt,
585
- isWithin: un,
586
- canDrop: gn,
587
- onDrop: (e, t, n) => st?.(e, t, n),
591
+ canDrag: Ct,
592
+ isWithin: pn,
593
+ canDrop: mn,
594
+ onDrop: (e, t, n) => ut?.(e, t, n),
588
595
  onHoverOpen: (e) => {
589
596
  const t = f.get(e);
590
- t && (t.children.length > 0 || v(e)) && !N(e) && We(e);
597
+ t && (t.children.length > 0 || w(e)) && !N(e) && We(e);
591
598
  }
592
- }), [Zn, fn] = A(""), _ = !!Tn, Je = T(null), [hn, er] = A(typeof ot == "number" ? ot : 480);
599
+ }), [sr, yn] = T(""), St = zn === "popup" && !!qt && !M && !R, [Je, Qe] = T(
600
+ null
601
+ ), _n = (e) => {
602
+ const t = e === void 0 ? void 0 : f.get(e);
603
+ St && t && Qe({ key: t.key, data: { ...t.data } });
604
+ }, _ = !!Kn, Ze = A(null), [kn, dr] = T(typeof st == "number" ? st : 480);
593
605
  be(() => {
594
- const e = Je.current;
606
+ const e = Ze.current;
595
607
  if (!_ || !e || typeof ResizeObserver > "u")
596
608
  return;
597
609
  const t = new ResizeObserver(() => {
598
- e.clientHeight > 0 && er(e.clientHeight);
610
+ e.clientHeight > 0 && dr(e.clientHeight);
599
611
  });
600
612
  return t.observe(e), () => t.disconnect();
601
613
  }, [_]);
602
- const wt = fr({
614
+ const xt = Cr({
603
615
  itemCount: _ ? k.length : 0,
604
616
  itemHeight: ge,
605
- containerHeight: hn,
617
+ containerHeight: kn,
606
618
  overscan: 8
607
- }), Ct = _ ? wt.startIndex : 0, St = _ ? wt.endIndex : k.length, xt = T(null), pn = T(N);
608
- pn.current = N, hr(xt, {
619
+ }), Nt = _ ? xt.startIndex : 0, Et = _ ? xt.endIndex : k.length, Tt = A(null), bn = A(N);
620
+ bn.current = N, Sr(Tt, {
609
621
  itemSelector: "tr.nice-treegrid__row",
610
- enabled: !z,
622
+ enabled: !R,
611
623
  onToggle: (e, t) => {
612
624
  const n = e.dataset.key;
613
- n !== void 0 && e.hasAttribute("aria-expanded") && pn.current(n) !== t && dn.toggleExpand(n);
625
+ n !== void 0 && e.hasAttribute("aria-expanded") && bn.current(n) !== t && hn.toggleExpand(n);
614
626
  }
615
627
  });
616
- const tr = kr(pr), Nt = T(null), [Q, mn] = A(null), Et = u(() => mn(null), []);
617
- mr(Nt, {
618
- open: !!Q,
628
+ const ur = Ar(xr), At = A(null), [Z, vn] = T(null), Mt = u(() => vn(null), []);
629
+ Nr(At, {
630
+ open: !!Z,
619
631
  modal: !1,
620
632
  initialFocus: '[role="menuitem"]:not([disabled])',
621
- onClose: Et
622
- }), yr(Nt, { orientation: "vertical", itemSelector: '[role="menuitem"]' });
623
- const yn = (e, t, n) => {
624
- const r = Oe ? f.get(e) : void 0, o = r ? Oe?.(r.data) : void 0;
625
- return o?.some((l) => !l.divider) ? (mn({ key: e, x: t, y: n, items: o }), !0) : !1;
626
- }, Tt = u(
627
- (e) => [...xt.current?.querySelectorAll("tr.nice-treegrid__row") ?? []].find(
633
+ onClose: Mt
634
+ }), Er(At, { orientation: "vertical", itemSelector: '[role="menuitem"]' });
635
+ const wn = (e, t, n) => {
636
+ const r = Ie ? f.get(e) : void 0, l = r ? Ie?.(r.data) : void 0;
637
+ return l?.some((c) => !c.divider) ? (vn({ key: e, x: t, y: n, items: l }), !0) : !1;
638
+ }, Dt = u(
639
+ (e) => [...Tt.current?.querySelectorAll("tr.nice-treegrid__row") ?? []].find(
628
640
  (t) => t.dataset.key === e
629
641
  ),
630
642
  []
631
- ), [At, Mt] = A(null);
643
+ ), [Rt, Kt] = T(null);
632
644
  be(() => {
633
- if (At === null)
645
+ if (Rt === null)
634
646
  return;
635
- const e = Tt(At);
636
- e && (e.focus(), Mt(null));
637
- }, [At, Ct, St, Tt]);
638
- const nr = (e) => {
647
+ const e = Dt(Rt);
648
+ e && (e.focus(), Kt(null));
649
+ }, [Rt, Nt, Et, Dt]);
650
+ const gr = (e) => {
639
651
  const t = k[e]?.placeholder ? e - 1 : e, n = k[t]?.node.key;
640
652
  if (n === void 0)
641
653
  return;
642
- const r = Tt(n);
643
- r ? r.focus() : _ && Je.current && (Je.current.scrollTop = Math.max(0, t * ge - hn / 2), Mt(n));
644
- }, rr = (e) => {
654
+ const r = Dt(n);
655
+ r ? r.focus() : _ && Ze.current && (Ze.current.scrollTop = Math.max(0, t * ge - kn / 2), Kt(n));
656
+ }, fr = (e) => {
645
657
  const t = e.target;
646
658
  if (e.altKey || e.ctrlKey || e.metaKey || !t.matches?.("tr.nice-treegrid__row"))
647
659
  return;
@@ -649,74 +661,74 @@ ${P ? 1 : 0}`, [en, tn] = A(
649
661
  if (e.shiftKey && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
650
662
  if (t.hasAttribute("aria-expanded")) {
651
663
  e.preventDefault();
652
- const l = getComputedStyle(t).direction === "rtl";
653
- ye(n, e.key === "ArrowRight" !== l);
664
+ const c = getComputedStyle(t).direction === "rtl";
665
+ ye(n, e.key === "ArrowRight" !== c);
654
666
  }
655
667
  return;
656
668
  }
657
669
  if (e.key === " ") {
658
- if (D)
670
+ if (M)
659
671
  return;
660
- p && c?.isCheckable(n) ? (e.preventDefault(), Be(n)) : S && (e.preventDefault(), Ye(n));
672
+ p && o?.isCheckable(n) ? (e.preventDefault(), Be(n)) : S && (e.preventDefault(), Ye(n));
661
673
  return;
662
674
  }
663
675
  if (!(e.key === "PageDown" || e.key === "PageUp") && !(_ && (e.key === "Home" || e.key === "End")))
664
676
  return;
665
- const o = k.findIndex((l) => l.node.key === n);
666
- o < 0 || (e.preventDefault(), nr(
667
- e.key === "PageDown" ? Math.min(k.length - 1, o + En) : e.key === "PageUp" ? Math.max(0, o - En) : e.key === "Home" ? 0 : k.length - 1
677
+ const l = k.findIndex((c) => c.node.key === n);
678
+ l < 0 || (e.preventDefault(), gr(
679
+ e.key === "PageDown" ? Math.min(k.length - 1, l + Rn) : e.key === "PageUp" ? Math.max(0, l - Rn) : e.key === "Home" ? 0 : k.length - 1
668
680
  ));
669
- }, ar = i("controls.expand", "Expand"), cr = i("controls.collapse", "Collapse"), _n = K[0]?.field, Qe = (e) => Vt ? Vt(e.data) : String((_n != null ? e.data[_n] : void 0) ?? e.key), kn = (e, t) => i("treeGrid.checkedSummary", "{checked} of {total} selected").replace("{checked}", String(e)).replace("{total}", String(t)), lr = (e) => {
681
+ }, hr = i("controls.expand", "Expand"), pr = i("controls.collapse", "Collapse"), Cn = K[0]?.field, et = (e) => Ft ? Ft(e.data) : String((Cn != null ? e.data[Cn] : void 0) ?? e.key), Sn = (e, t) => i("treeGrid.checkedSummary", "{checked} of {total} selected").replace("{checked}", String(e)).replace("{total}", String(t)), mr = (e) => {
670
682
  const t = e.target;
671
683
  if (!V || !t.matches?.("tr.nice-treegrid__row"))
672
684
  return !1;
673
- const n = Lr(e, getComputedStyle(t).direction === "rtl");
685
+ const n = Wr(e, getComputedStyle(t).direction === "rtl");
674
686
  if (!n)
675
687
  return !1;
676
688
  e.preventDefault();
677
- const r = t.dataset.key ?? "", o = bt.get(r), l = o ? Or(n, r, o.parent, o.siblings) : null, d = f.get(r), Z = l ? f.get(l.key) : void 0;
678
- if (!l || !d || !Z || !vt(r) || !gn(r, l.key, l.position))
679
- return fn(
689
+ const r = t.dataset.key ?? "", l = wt.get(r), c = l ? qr(n, r, l.parent, l.siblings) : null, d = f.get(r), ee = c ? f.get(c.key) : void 0;
690
+ if (!c || !d || !ee || !Ct(r) || !mn(r, c.key, c.position))
691
+ return yn(
680
692
  i("treeDrop.cannotMove", "Cannot move {label} there").replace(
681
693
  "{label}",
682
- d ? Qe(d) : r
694
+ d ? et(d) : r
683
695
  )
684
696
  ), !0;
685
- l.position === "inside" && !N(l.key) && We(l.key), st?.(r, l.key, l.position), Mt(r);
686
- const tt = l.position === "before" ? i("treeDrop.movedBefore", "{label} moved before {target}") : l.position === "after" ? i("treeDrop.movedAfter", "{label} moved after {target}") : i("treeDrop.movedInside", "{label} moved into {target}");
687
- return fn(
688
- tt.replace("{label}", Qe(d)).replace("{target}", Qe(Z))
697
+ c.position === "inside" && !N(c.key) && We(c.key), ut?.(r, c.key, c.position), Kt(r);
698
+ const rt = c.position === "before" ? i("treeDrop.movedBefore", "{label} moved before {target}") : c.position === "after" ? i("treeDrop.movedAfter", "{label} moved after {target}") : i("treeDrop.movedInside", "{label} moved into {target}");
699
+ return yn(
700
+ rt.replace("{label}", et(d)).replace("{target}", et(ee))
689
701
  ), !0;
690
- }, or = g(() => {
702
+ }, yr = g(() => {
691
703
  const e = new Set(je);
692
- return K.map((t) => zt && !ue && e.has(t.field));
693
- }, [K, je, zt, ue]), Dt = Y === !0 ? p ? Nn : Nn.slice(0, 2) : Array.isArray(Y) ? Y.filter((e) => p || e === "expandAll" || e === "collapseAll") : Yr, Ze = p ? De === "column" ? "column" : "tree" : "none", et = !!S && !p, _e = K.length + (Ze === "column" || et ? 1 : 0), bn = [
694
- ["checked", !y || M === !1 ? null : Qt && typeof M == "function" ? M(Qt) : kn(y.total.checked, y.total.total)],
704
+ return K.map((t) => Bt && !ue && e.has(t.field));
705
+ }, [K, je, Bt, ue]), Pt = B === !0 ? p ? Dn : Dn.slice(0, 2) : Array.isArray(B) ? B.filter((e) => p || e === "expandAll" || e === "collapseAll") : ea, tt = p ? De === "column" ? "column" : "tree" : "none", nt = !!S && !p, _e = K.length + (tt === "column" || nt ? 1 : 0), xn = [
706
+ ["checked", !y || D === !1 ? null : nn && typeof D == "function" ? D(nn) : Sn(y.total.checked, y.total.total)],
695
707
  [
696
708
  "matches",
697
- H ? i("treeGrid.matchCount", "{count} matching rows").replace(
709
+ U ? i("treeGrid.matchCount", "{count} matching rows").replace(
698
710
  "{count}",
699
- String(H.matched.size)
711
+ String(U.matched.size)
700
712
  ) : null
701
713
  ]
702
714
  ].filter(([, e]) => e != null && e !== !1 && e !== "");
703
- if (dt === "hidden")
715
+ if (gt === "hidden")
704
716
  return null;
705
- const Kt = p && at && c && c.leaves.length > 0 ? /* @__PURE__ */ a(
717
+ const Gt = p && ct && o && o.leaves.length > 0 ? /* @__PURE__ */ a(
706
718
  "input",
707
719
  {
708
720
  type: "checkbox",
709
721
  className: "nice-treegrid__check-input nice-treegrid__select-all",
710
- checked: on === "checked",
722
+ checked: gn === "checked",
711
723
  ref: (e) => {
712
- e && (e.indeterminate = on === "indeterminate");
724
+ e && (e.indeterminate = gn === "indeterminate");
713
725
  },
714
- disabled: D || z,
726
+ disabled: M || R,
715
727
  "aria-label": x ? i("treeGrid.selectAllResults", "Select all results") : i("controls.selectAll", "Select all"),
716
728
  onClick: (e) => e.stopPropagation(),
717
- onChange: Jn
729
+ onChange: lr
718
730
  }
719
- ) : null, ir = (e) => {
731
+ ) : null, _r = (e) => {
720
732
  const t = {
721
733
  expandAll: { icon: "expand", label: i("treeGrid.expandAll", "Expand all") },
722
734
  collapseAll: { icon: "collapse", label: i("treeGrid.collapseAll", "Collapse all") },
@@ -727,26 +739,26 @@ ${P ? 1 : 0}`, [en, tn] = A(
727
739
  "button",
728
740
  {
729
741
  type: "button",
730
- className: `nice-btn nice-btn--sm nice-btn--ghost nice-treegrid__action${e === "onlyChecked" && P ? " nice-treegrid__action--active" : ""}`,
731
- "aria-pressed": e === "onlyChecked" ? P : void 0,
732
- disabled: z || e === "clearChecked" && (D || !y || y.total.checked === 0),
742
+ className: `nice-btn nice-btn--sm nice-btn--ghost nice-treegrid__action${e === "onlyChecked" && G ? " nice-treegrid__action--active" : ""}`,
743
+ "aria-pressed": e === "onlyChecked" ? G : void 0,
744
+ disabled: R || e === "clearChecked" && (M || !y || y.total.checked === 0),
733
745
  onClick: () => {
734
- e === "expandAll" || e === "collapseAll" ? qn(e === "expandAll") : e === "onlyChecked" ? Wn(!Zt) : Qn();
746
+ e === "expandAll" || e === "collapseAll" ? or(e === "expandAll") : e === "onlyChecked" ? ar(!rn) : ir();
735
747
  },
736
748
  children: [
737
- /* @__PURE__ */ a(ee, { name: t.icon, size: 14 }),
749
+ /* @__PURE__ */ a(te, { name: t.icon, size: 14 }),
738
750
  /* @__PURE__ */ a("span", { children: t.label })
739
751
  ]
740
752
  },
741
753
  e
742
754
  );
743
- }, sr = (e) => {
744
- const { node: t, level: n, posInSet: r, setSize: o, placeholder: l } = k[e], d = t.key;
745
- if (l)
755
+ }, kr = (e) => {
756
+ const { node: t, level: n, posInSet: r, setSize: l, placeholder: c } = k[e], d = t.key;
757
+ if (c)
746
758
  return /* @__PURE__ */ a(
747
759
  "tr",
748
760
  {
749
- className: `nice-treegrid__placeholder nice-treegrid__placeholder--${l}`,
761
+ className: `nice-treegrid__placeholder nice-treegrid__placeholder--${c}`,
750
762
  "aria-level": n,
751
763
  style: _ ? { height: ge } : void 0,
752
764
  children: /* @__PURE__ */ h("td", { colSpan: _e, children: [
@@ -758,7 +770,7 @@ ${P ? 1 : 0}`, [en, tn] = A(
758
770
  "aria-hidden": "true"
759
771
  }
760
772
  ),
761
- l === "loading" ? /* @__PURE__ */ h(ve, { children: [
773
+ c === "loading" ? /* @__PURE__ */ h(ve, { children: [
762
774
  /* @__PURE__ */ a("span", { className: "nice-spinner nice-spinner--sm", "aria-hidden": "true" }),
763
775
  /* @__PURE__ */ a("span", { role: "status", children: i("treeGrid.loading", "Loading…") })
764
776
  ] }) : /* @__PURE__ */ h(ve, { children: [
@@ -768,82 +780,82 @@ ${P ? 1 : 0}`, [en, tn] = A(
768
780
  {
769
781
  type: "button",
770
782
  className: "nice-btn nice-btn--sm nice-btn--ghost",
771
- onClick: () => Bn(d),
783
+ onClick: () => Zn(d),
772
784
  children: i("treeGrid.retry", "Retry")
773
785
  }
774
786
  )
775
787
  ] })
776
788
  ] })
777
789
  },
778
- `${d}\0${l}`
790
+ `${d}\0${c}`
779
791
  );
780
- const Z = t.children.length > 0 || v(d), tt = Z && N(d), Rt = kt && Z ? Xn.has(d) ? "collapse" : "expand" : null, Cn = !!c?.isCheckable(d), ke = Re && y && c && !c.isLeaf(d) ? y.count(d) : null, dr = Qe(t);
792
+ const ee = t.children.length > 0 || w(d), rt = ee && N(d), Lt = vt && ee ? cr.has(d) ? "collapse" : "expand" : null, Tn = !!o?.isCheckable(d), ke = Ke && y && o && !o.isLeaf(d) ? y.count(d) : null, br = et(t);
781
793
  return /* @__PURE__ */ a(
782
- Hr,
794
+ aa,
783
795
  {
784
796
  node: t,
785
797
  level: n,
786
798
  posInSet: r,
787
- setSize: o,
799
+ setSize: l,
788
800
  rowIndex: e,
789
801
  ariaRowIndex: _ ? e + 2 : void 0,
790
802
  columns: K,
791
- highlight: or,
803
+ highlight: yr,
792
804
  query: x,
793
- expandable: Z,
794
- expanded: tt,
795
- busy: tt && gt.get(d) === "loading",
796
- expandLabel: ar,
797
- collapseLabel: cr,
798
- subtreeAction: Rt,
799
- subtreeLabel: Rt === "expand" ? i("treeGrid.expandSubtree", "Expand all below") : Rt === "collapse" ? i("treeGrid.collapseSubtree", "Collapse all below") : "",
800
- checkMode: Ze,
801
- hasCheckbox: Cn,
805
+ expandable: ee,
806
+ expanded: rt,
807
+ busy: rt && ht.get(d) === "loading",
808
+ expandLabel: hr,
809
+ collapseLabel: pr,
810
+ subtreeAction: Lt,
811
+ subtreeLabel: Lt === "expand" ? i("treeGrid.expandSubtree", "Expand all below") : Lt === "collapse" ? i("treeGrid.collapseSubtree", "Collapse all below") : "",
812
+ checkMode: tt,
813
+ hasCheckbox: Tn,
802
814
  checkState: y ? y.state(d) : "unchecked",
803
- checkLabel: Cn ? i("treeGrid.checkRow", "Select {label}").replace("{label}", dr) : "",
804
- locked: !!c?.isLocked(d),
815
+ checkLabel: Tn ? i("treeGrid.checkRow", "Select {label}").replace("{label}", br) : "",
816
+ locked: !!o?.isLocked(d),
805
817
  countChecked: ke?.checked ?? 0,
806
818
  countTotal: ke?.total ?? 0,
807
- countTitle: ke ? kn(ke.checked, ke.total) : "",
808
- selectColumn: et,
809
- selected: S ? Un.has(d) : void 0,
810
- selectLabel: et ? i("controls.selectRow", "Select row {key}").replace("{key}", d) : "",
811
- readOnly: D,
812
- className: typeof lt == "function" ? lt(t.data, e) : lt,
813
- clickable: !D && (!!Ft || !!Ke || !!p && !!S),
819
+ countTitle: ke ? Sn(ke.checked, ke.total) : "",
820
+ selectColumn: nt,
821
+ selected: S ? rr.has(d) : void 0,
822
+ selectLabel: nt ? i("controls.selectRow", "Select row {key}").replace("{key}", d) : "",
823
+ readOnly: M,
824
+ className: typeof it == "function" ? it(t.data, e) : it,
825
+ clickable: !M && (!!Ut || !!Re || !!p && !!S),
814
826
  height: _ ? ge : void 0,
815
- draggable: V && vt(d),
827
+ draggable: V && Ct(d),
816
828
  drop: Xe.target?.key === d ? Xe.target.position : null,
817
829
  dragging: Xe.dragKey === d,
818
- handlers: dn
830
+ handlers: hn
819
831
  },
820
832
  d
821
833
  );
822
- }, vn = [];
823
- for (let e = Ct; e < St; e++)
824
- vn.push(sr(e));
825
- const wn = (e, t) => e > 0 ? /* @__PURE__ */ a("tr", { className: "nice-treegrid__spacer", "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: _e, style: { height: e * ge } }) }, t) : null;
834
+ }, Nn = [];
835
+ for (let e = Nt; e < Et; e++)
836
+ Nn.push(kr(e));
837
+ const En = (e, t) => e > 0 ? /* @__PURE__ */ a("tr", { className: "nice-treegrid__spacer", "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: _e, style: { height: e * ge } }) }, t) : null;
826
838
  return /* @__PURE__ */ h(
827
839
  "div",
828
840
  {
829
- id: Ht,
830
- "data-testid": In ?? On,
831
- className: `nice-treegrid nice-datagrid ${z ? "nice-treegrid--disabled" : ""} ${D ? "nice-treegrid--readonly" : ""} ${Le ? "nice-treegrid--error" : ""} ${_ ? "nice-treegrid--virtual" : ""} ${Gn || ""}`,
832
- style: Ln,
833
- "aria-disabled": z || void 0,
834
- "aria-busy": Yt || void 0,
841
+ id: Xt,
842
+ "data-testid": Wn ?? Un,
843
+ className: `nice-treegrid nice-datagrid ${R ? "nice-treegrid--disabled" : ""} ${M ? "nice-treegrid--readonly" : ""} ${Le ? "nice-treegrid--error" : ""} ${_ ? "nice-treegrid--virtual" : ""} ${jn || ""}`,
844
+ style: Hn,
845
+ "aria-disabled": R || void 0,
846
+ "aria-busy": jt || void 0,
835
847
  "aria-invalid": !!Le || void 0,
836
848
  children: [
837
- (Ge || Bt || Dt.length > 0) && /* @__PURE__ */ h("div", { className: "nice-datagrid__toolbar nice-treegrid__toolbar", children: [
849
+ (Ge || Ht || Pt.length > 0) && /* @__PURE__ */ h("div", { className: "nice-datagrid__toolbar nice-treegrid__toolbar", children: [
838
850
  Ge && /* @__PURE__ */ h("div", { className: "nice-datagrid__search nice-treegrid__search", children: [
839
851
  /* @__PURE__ */ a(
840
852
  "input",
841
853
  {
842
854
  type: "search",
843
855
  value: Fe,
844
- onChange: (e) => _t(e.target.value),
856
+ onChange: (e) => bt(e.target.value),
845
857
  onKeyDown: (e) => {
846
- e.key === "Escape" && Fe && (e.preventDefault(), _t(""));
858
+ e.key === "Escape" && Fe && (e.preventDefault(), bt(""));
847
859
  },
848
860
  placeholder: m || i("controls.search", "Search..."),
849
861
  "aria-label": m || i("controls.search", "Search...")
@@ -854,15 +866,15 @@ ${P ? 1 : 0}`, [en, tn] = A(
854
866
  {
855
867
  type: "button",
856
868
  className: "nice-treegrid__search-clear",
857
- onClick: () => _t(""),
869
+ onClick: () => bt(""),
858
870
  "aria-label": i("treeGrid.clearSearch", "Clear search"),
859
- children: /* @__PURE__ */ a(ee, { name: "close", size: 12 })
871
+ children: /* @__PURE__ */ a(te, { name: "close", size: 12 })
860
872
  }
861
873
  )
862
874
  ] }),
863
- Dt.length > 0 && /* @__PURE__ */ a("div", { className: "nice-treegrid__actions", children: Dt.map(ir) }),
864
- Bt,
865
- bn.length > 0 && /* @__PURE__ */ a("span", { className: "nice-treegrid__summary", role: "status", children: bn.map(([e, t], n) => /* @__PURE__ */ h(_r.Fragment, { children: [
875
+ Pt.length > 0 && /* @__PURE__ */ a("div", { className: "nice-treegrid__actions", children: Pt.map(_r) }),
876
+ Ht,
877
+ xn.length > 0 && /* @__PURE__ */ a("span", { className: "nice-treegrid__summary", role: "status", children: xn.map(([e, t], n) => /* @__PURE__ */ h(Tr.Fragment, { children: [
866
878
  n > 0 && " · ",
867
879
  t
868
880
  ] }, e)) })
@@ -870,48 +882,57 @@ ${P ? 1 : 0}`, [en, tn] = A(
870
882
  /* @__PURE__ */ a(
871
883
  "div",
872
884
  {
873
- ref: Je,
885
+ ref: Ze,
874
886
  className: "nice-datagrid__table-wrap",
875
- style: _ ? { height: ot ?? 480, overflow: "auto" } : void 0,
876
- onScroll: _ ? wt.onScroll : void 0,
887
+ style: _ ? { height: st ?? 480, overflow: "auto" } : void 0,
888
+ onScroll: _ ? xt.onScroll : void 0,
877
889
  children: /* @__PURE__ */ h(
878
890
  "table",
879
891
  {
880
- ref: xt,
892
+ ref: Tt,
881
893
  role: "treegrid",
882
- "aria-label": zn,
883
- "aria-labelledby": Vn,
894
+ "aria-label": Xn,
895
+ "aria-labelledby": Jn,
884
896
  "aria-multiselectable": S || p || void 0,
885
897
  "aria-rowcount": _ ? k.length + 1 : void 0,
886
- className: `nice-table nice-table--${Dn} ${An ? "nice-table--striped" : ""} ${Mn ? "nice-table--compact" : ""}`,
898
+ className: `nice-table nice-table--${Ln} ${Pn ? "nice-table--striped" : ""} ${Gn ? "nice-table--compact" : ""}`,
887
899
  onKeyDownCapture: (e) => {
888
- if (Oe && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey)) {
900
+ if (Ie && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey)) {
889
901
  const t = e.target.closest("tr.nice-treegrid__row"), n = t?.getBoundingClientRect();
890
- if (t?.dataset.key !== void 0 && n && yn(t.dataset.key, n.left + 24, n.bottom)) {
902
+ if (t?.dataset.key !== void 0 && n && wn(t.dataset.key, n.left + 24, n.bottom)) {
891
903
  e.preventDefault(), e.stopPropagation();
892
904
  return;
893
905
  }
894
906
  }
895
- lr(e) || rr(e);
907
+ if (!mr(e)) {
908
+ if (St && e.key === "F2") {
909
+ const t = e.target.closest("tr.nice-treegrid__row");
910
+ if (t) {
911
+ e.preventDefault(), _n(t.dataset.key);
912
+ return;
913
+ }
914
+ }
915
+ fr(e);
916
+ }
896
917
  },
897
- onContextMenu: Oe ? (e) => {
918
+ onContextMenu: Ie ? (e) => {
898
919
  const t = e.target.closest(
899
920
  "tr.nice-treegrid__row"
900
921
  );
901
- t?.dataset.key !== void 0 && yn(t.dataset.key, e.clientX, e.clientY) && e.preventDefault();
922
+ t?.dataset.key !== void 0 && wn(t.dataset.key, e.clientX, e.clientY) && e.preventDefault();
902
923
  } : void 0,
903
924
  children: [
904
925
  /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ h("tr", { children: [
905
- Ze === "column" && /* @__PURE__ */ a("th", { className: "nice-datagrid__checkbox nice-treegrid__th-check", children: Kt }),
906
- et && /* @__PURE__ */ a("th", { className: "nice-datagrid__checkbox", style: { width: 36 } }),
926
+ tt === "column" && /* @__PURE__ */ a("th", { className: "nice-datagrid__checkbox nice-treegrid__th-check", children: Gt }),
927
+ nt && /* @__PURE__ */ a("th", { className: "nice-datagrid__checkbox", style: { width: 36 } }),
907
928
  K.map((e, t) => /* @__PURE__ */ h(
908
929
  "th",
909
930
  {
910
931
  style: { width: e.width, minWidth: e.minWidth, textAlign: e.align },
911
- className: ce && e.sortable !== !1 ? "nice-datagrid__th--sortable" : void 0,
912
- onClick: () => ce && e.sortable !== !1 && Hn(e.field),
932
+ className: oe && e.sortable !== !1 ? "nice-datagrid__th--sortable" : void 0,
933
+ onClick: () => oe && e.sortable !== !1 && nr(e.field),
913
934
  children: [
914
- t === 0 && Ze === "tree" && Kt && /* @__PURE__ */ h(ve, { children: [
935
+ t === 0 && tt === "tree" && Gt && /* @__PURE__ */ h(ve, { children: [
915
936
  /* @__PURE__ */ a(
916
937
  "span",
917
938
  {
@@ -919,18 +940,18 @@ ${P ? 1 : 0}`, [en, tn] = A(
919
940
  "aria-hidden": "true"
920
941
  }
921
942
  ),
922
- /* @__PURE__ */ a("span", { className: "nice-treegrid__check", children: Kt })
943
+ /* @__PURE__ */ a("span", { className: "nice-treegrid__check", children: Gt })
923
944
  ] }),
924
945
  e.header,
925
- ce && e.sortable !== !1 && /* @__PURE__ */ a(
946
+ oe && e.sortable !== !1 && /* @__PURE__ */ a(
926
947
  "span",
927
948
  {
928
949
  className: "nice-table__sort-icon",
929
- style: { opacity: F === e.field && R ? void 0 : 0.3 },
950
+ style: { opacity: j === e.field && P ? void 0 : 0.3 },
930
951
  children: /* @__PURE__ */ a(
931
- ee,
952
+ te,
932
953
  {
933
- name: F === e.field && R ? R === "asc" ? "sort-asc" : "sort-desc" : "sort",
954
+ name: j === e.field && P ? P === "asc" ? "sort-asc" : "sort-desc" : "sort",
934
955
  size: 12
935
956
  }
936
957
  )
@@ -941,34 +962,43 @@ ${P ? 1 : 0}`, [en, tn] = A(
941
962
  e.field
942
963
  ))
943
964
  ] }) }),
944
- /* @__PURE__ */ a("tbody", { ...V ? Xe.handlers : void 0, children: Yt ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: _e, className: "nice-datagrid__empty", children: /* @__PURE__ */ a("div", { className: "nice-spinner nice-spinner--md", style: { margin: "0 auto" } }) }) }) : Le ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
945
- "td",
965
+ /* @__PURE__ */ a(
966
+ "tbody",
946
967
  {
947
- colSpan: _e,
948
- className: "nice-datagrid__empty nice-treegrid__error",
949
- role: "alert",
950
- children: Le
968
+ ...V ? Xe.handlers : void 0,
969
+ onDoubleClick: St ? (e) => _n(
970
+ e.target.closest("tr.nice-treegrid__row")?.dataset.key
971
+ ) : void 0,
972
+ children: jt ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: _e, className: "nice-datagrid__empty", children: /* @__PURE__ */ a("div", { className: "nice-spinner nice-spinner--md", style: { margin: "0 auto" } }) }) }) : Le ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
973
+ "td",
974
+ {
975
+ colSpan: _e,
976
+ className: "nice-datagrid__empty nice-treegrid__error",
977
+ role: "alert",
978
+ children: Le
979
+ }
980
+ ) }) : k.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: _e, className: "nice-datagrid__empty", children: x ? i("controls.noResults", "No results") : $n || i("controls.noData", "No data available") }) }) : /* @__PURE__ */ h(ve, { children: [
981
+ En(Nt, "top"),
982
+ Nn,
983
+ En(k.length - Et, "bottom")
984
+ ] })
951
985
  }
952
- ) }) : k.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: _e, className: "nice-datagrid__empty", children: x ? i("controls.noResults", "No results") : Pn || i("controls.noData", "No data available") }) }) : /* @__PURE__ */ h(ve, { children: [
953
- wn(Ct, "top"),
954
- vn,
955
- wn(k.length - St, "bottom")
956
- ] }) })
986
+ )
957
987
  ]
958
988
  }
959
989
  )
960
990
  }
961
991
  ),
962
- Q && typeof document < "u" && vr(
992
+ Z && typeof document < "u" && Dr(
963
993
  /* @__PURE__ */ a(
964
994
  "div",
965
995
  {
966
- ref: Nt,
996
+ ref: At,
967
997
  className: "nice-treegrid__menu",
968
998
  role: "menu",
969
999
  "aria-label": i("treeGrid.rowMenu", "Row actions"),
970
- style: { position: "fixed", left: Q.x, top: Q.y },
971
- children: Q.items.map(
1000
+ style: { position: "fixed", left: Z.x, top: Z.y },
1001
+ children: Z.items.map(
972
1002
  (e) => e.divider ? /* @__PURE__ */ a("div", { className: "nice-treegrid__menu-divider", role: "separator" }, e.id) : /* @__PURE__ */ h(
973
1003
  "button",
974
1004
  {
@@ -977,10 +1007,10 @@ ${P ? 1 : 0}`, [en, tn] = A(
977
1007
  className: `nice-treegrid__menu-item${e.danger ? " nice-treegrid__menu-item--danger" : ""}`,
978
1008
  disabled: e.disabled,
979
1009
  onClick: () => {
980
- Et(), e.onSelect?.();
1010
+ Mt(), e.onSelect?.();
981
1011
  },
982
1012
  children: [
983
- e.icon && /* @__PURE__ */ a(ee, { name: e.icon, size: 14 }),
1013
+ e.icon && /* @__PURE__ */ a(te, { name: e.icon, size: 14 }),
984
1014
  e.label
985
1015
  ]
986
1016
  },
@@ -989,15 +1019,30 @@ ${P ? 1 : 0}`, [en, tn] = A(
989
1019
  )
990
1020
  }
991
1021
  ),
992
- tr?.portalTarget ?? document.body
1022
+ ur?.portalTarget ?? document.body
1023
+ ),
1024
+ Je && /* @__PURE__ */ a(
1025
+ Kr,
1026
+ {
1027
+ title: Bn,
1028
+ items: Vn ?? Pr(b, Y),
1029
+ data: Je.data,
1030
+ columns: Yn,
1031
+ formProps: Fn,
1032
+ onClose: () => Qe(null),
1033
+ onFieldChange: (e, t) => Qe((n) => n && { ...n, data: { ...n.data, [e]: t } }),
1034
+ onSubmit: (e) => {
1035
+ qt?.(Je.key, { ...Je.data, ...e }), Qe(null);
1036
+ }
1037
+ }
993
1038
  ),
994
- V && /* @__PURE__ */ a("span", { className: "nice-sr-only", role: "status", "aria-live": "polite", children: Zn }),
995
- Q && // a click outside the menu closes it
996
- /* @__PURE__ */ a("div", { className: "nice-treegrid__menu-backdrop", "aria-hidden": "true", onMouseDown: Et })
1039
+ V && /* @__PURE__ */ a("span", { className: "nice-sr-only", role: "status", "aria-live": "polite", children: sr }),
1040
+ Z && // a click outside the menu closes it
1041
+ /* @__PURE__ */ a("div", { className: "nice-treegrid__menu-backdrop", "aria-hidden": "true", onMouseDown: Mt })
997
1042
  ]
998
1043
  }
999
1044
  );
1000
1045
  }
1001
1046
  export {
1002
- na as NiceTreeGrid
1047
+ pa as NiceTreeGrid
1003
1048
  };