@owp/core 2.5.13 → 2.5.14

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.
@@ -1,55 +1,75 @@
1
- var K = Object.defineProperty;
2
- var f = (e, t) => K(e, "name", { value: t, configurable: !0 });
3
- import { getTreeGridTextResourceUrl as Q } from "../../../constants/treeGrid.js";
4
- import { highlightTreeGridCellById as J } from "../../../utils/treeGridUtil.js";
5
- import { enqueueSnackbar as X } from "notistack";
6
- import { applyTreeGridLayoutToGrid as Z } from "./treeGridLayout.js";
7
- import { resolveTreeGridColumnEditValue as g, resetTreeGridColumnEditRulesState as H, syncTreeGridColumnEditRules as ee } from "./treeGridColumnEditRules.js";
8
- import { countTreeGridPerf as F, logTreeGridPerf as te, measureTreeGridPerf as k } from "./utils/perf.js";
9
- import { debounce as b } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/debounce.js";
10
- import { get as ne } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/get.js";
11
- import { isEmpty as re } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
12
- const Le = 300, oe = [255, 255, 166], ue = [240, 240, 240], ce = [248, 248, 248], ie = [255, 255, 255], se = [255, 255, 254], fe = [242, 242, 242], U = "Button", P = /* @__PURE__ */ f((e) => (e == null ? void 0 : e.startsWith("data:")) || (e == null ? void 0 : e.startsWith("blob:")), "isTreeGridInlineUrl"), v = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ f((e) => {
1
+ var X = Object.defineProperty;
2
+ var a = (e, t) => X(e, "name", { value: t, configurable: !0 });
3
+ import { getTreeGridTextResourceUrl as Z, TREEGRID_CELL_HIGHLIGHT_CLASS as H } from "../../../constants/treeGrid.js";
4
+ import { isTreeGridRowAddedById as b, getTreeGridAddedRowHighlightColumns as w, highlightTreeGridCellById as ee, appendTreeGridAddedRowHighlightColumn as te } from "../../../utils/treeGridUtil.js";
5
+ import { enqueueSnackbar as ne } from "notistack";
6
+ import { applyTreeGridLayoutToGrid as re } from "./treeGridLayout.js";
7
+ import { resolveTreeGridColumnEditValue as oe, resetTreeGridColumnEditRulesState as ie, syncTreeGridColumnEditRules as ue } from "./treeGridColumnEditRules.js";
8
+ import { countTreeGridPerf as W, logTreeGridPerf as ce, measureTreeGridPerf as M } from "./utils/perf.js";
9
+ import { debounce as _ } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/debounce.js";
10
+ import { get as se } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/get.js";
11
+ import { isEmpty as ae } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
12
+ const $e = 300, de = [255, 255, 166], fe = [240, 240, 240], Ge = [248, 248, 248], le = [255, 255, 255], Te = [255, 255, 254], pe = [242, 242, 242], x = "Button", z = /* @__PURE__ */ a((e) => (e == null ? void 0 : e.startsWith("data:")) || (e == null ? void 0 : e.startsWith("blob:")), "isTreeGridInlineUrl"), V = /* @__PURE__ */ new Map(), Ce = /* @__PURE__ */ a((e) => {
13
13
  if (!e || !e.startsWith("data:"))
14
14
  return e;
15
- const t = v.get(e);
15
+ const t = V.get(e);
16
16
  if (t)
17
17
  return t;
18
18
  try {
19
- const [n, o = ""] = e.split(",", 2), s = /^data:([^;]*)(;base64)?$/i.exec(n), a = (s == null ? void 0 : s[1]) || "application/octet-stream", p = s != null && s[2] ? atob(o) : decodeURIComponent(o), l = new Uint8Array(p.length);
20
- for (let C = 0; C < p.length; C += 1)
21
- l[C] = p.charCodeAt(C);
22
- const T = URL.createObjectURL(new Blob([l], { type: a }));
23
- return v.set(e, T), T;
19
+ const [n, r = ""] = e.split(",", 2), c = /^data:([^;]*)(;base64)?$/i.exec(n), f = (c == null ? void 0 : c[1]) || "application/octet-stream", G = c != null && c[2] ? atob(r) : decodeURIComponent(r), p = new Uint8Array(G.length);
20
+ for (let R = 0; R < G.length; R += 1)
21
+ p[R] = G.charCodeAt(R);
22
+ const T = URL.createObjectURL(new Blob([p], { type: f }));
23
+ return V.set(e, T), T;
24
24
  } catch {
25
25
  return e;
26
26
  }
27
- }, "resolveTreeGridInlineUrl"), h = /* @__PURE__ */ f((e) => {
28
- if (!e || P(e))
29
- return ae(e);
30
- const t = e.indexOf("#"), [n, o] = t >= 0 ? [e.slice(0, t), e.slice(t)] : [e, ""], s = n.includes("?") ? "&" : "?";
31
- return `${n}${s}noCache=${Date.now()}${o}`;
32
- }, "appendNoCacheQuery"), de = /* @__PURE__ */ f((e) => e ? P(e) || e.includes("assets") ? h(e) : h(`undefined/${e}`) : "", "resolveTreeGridDataUrl"), Ge = /* @__PURE__ */ f((e, t, n) => e ? { Url: de(t) } : { Data: { Body: [re(n) ? [] : n] } }, "buildTreeGridDataSource"), xe = /* @__PURE__ */ f(({
27
+ }, "resolveTreeGridInlineUrl"), A = /* @__PURE__ */ a((e) => {
28
+ if (!e || z(e))
29
+ return Ce(e);
30
+ const t = e.indexOf("#"), [n, r] = t >= 0 ? [e.slice(0, t), e.slice(t)] : [e, ""], c = n.includes("?") ? "&" : "?";
31
+ return `${n}${c}noCache=${Date.now()}${r}`;
32
+ }, "appendNoCacheQuery"), N = /* @__PURE__ */ a((e, t, n) => {
33
+ if (!e)
34
+ return;
35
+ const r = n.canEdit, c = n.highlightColumns ?? [], f = n.highlightBackgroundColor;
36
+ if (!(r === void 0 && !c.length)) {
37
+ typeof e.StartUpdate == "function" && e.StartUpdate();
38
+ try {
39
+ r !== void 0 && (t.CanEdit = r), c.forEach((G) => {
40
+ G && (e.SetValue(
41
+ t,
42
+ `${G}Class`,
43
+ f ? H : "",
44
+ 0
45
+ ), e.SetValue(t, `${G}Color`, f ?? "", 0));
46
+ });
47
+ } finally {
48
+ typeof e.EndUpdate == "function" && e.EndUpdate();
49
+ }
50
+ typeof e.RefreshRow == "function" && e.RefreshRow(t);
51
+ }
52
+ }, "syncTreeGridDeletedRowState"), Re = /* @__PURE__ */ a((e) => e ? z(e) || e.includes("assets") ? A(e) : A(`undefined/${e}`) : "", "resolveTreeGridDataUrl"), he = /* @__PURE__ */ a((e, t, n) => e ? { Url: Re(t) } : { Data: { Body: [ae(n) ? [] : n] } }, "buildTreeGridDataSource"), Pe = /* @__PURE__ */ a(({
33
53
  id: e,
34
54
  layoutUrl: t,
35
55
  layoutData: n,
36
- dataUrl: o,
37
- bodyData: s,
38
- useDataUrl: a,
39
- width: p,
40
- height: l,
56
+ dataUrl: r,
57
+ bodyData: c,
58
+ useDataUrl: f,
59
+ width: G,
60
+ height: p,
41
61
  languageId: T
42
62
  }) => ({
43
63
  id: e,
44
- Layout: n ? { Data: n } : { Url: h(t ?? "") },
45
- Data: Ge(a, o, s),
64
+ Layout: n ? { Data: n } : { Url: A(t ?? "") },
65
+ Data: he(f, r, c),
46
66
  Text: {
47
- Url: Q(T)
67
+ Url: Z(T)
48
68
  },
49
- width: p,
50
- height: l,
69
+ width: G,
70
+ height: p,
51
71
  Debug: "Error"
52
- }), "buildTreeGridInitializationOptions"), L = /* @__PURE__ */ f((e) => ne(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), x = /* @__PURE__ */ f((e) => {
72
+ }), "buildTreeGridInitializationOptions"), k = /* @__PURE__ */ a((e) => se(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), F = /* @__PURE__ */ a((e) => {
53
73
  if (typeof e == "number")
54
74
  return Number.isFinite(e) && e > 0 ? e : void 0;
55
75
  if (typeof e != "string")
@@ -59,67 +79,67 @@ const Le = 300, oe = [255, 255, 166], ue = [240, 240, 240], ce = [248, 248, 248]
59
79
  return;
60
80
  const n = Number(t);
61
81
  return Number.isFinite(n) && n > 0 ? n : void 0;
62
- }, "parseTreeGridPositiveNumber"), N = /* @__PURE__ */ f((e, t, n, o) => {
82
+ }, "parseTreeGridPositiveNumber"), $ = /* @__PURE__ */ a((e, t, n, r) => {
63
83
  if (!t || !n)
64
84
  return;
65
- const s = e.GetAttribute(t, n, o), a = x(s);
66
- return a !== void 0 ? a : x(
67
- t[`${n}${o}`]
85
+ const c = e.GetAttribute(t, n, r), f = F(c);
86
+ return f !== void 0 ? f : F(
87
+ t[`${n}${r}`]
68
88
  );
69
- }, "getTreeGridHeaderCellSpanAttribute"), $ = /* @__PURE__ */ f((e, t, n) => !t || !n || t.Fixed !== "Head" || (N(e, t, n, "Span") ?? 1) <= 1 ? !1 : (N(e, t, n, "RowSpan") ?? 1) === 1, "isTreeGridGroupHeaderCell"), V = /* @__PURE__ */ f((e, t, n = !1) => {
70
- const o = typeof performance < "u" ? performance.now() : Date.now(), s = typeof e.GetFixedRows == "function" ? e.GetFixedRows().filter((T) => T.Fixed === "Head") : [], a = typeof e.GetCols == "function" ? e.GetCols() : [];
71
- if (!s.length || !a.length)
89
+ }, "getTreeGridHeaderCellSpanAttribute"), j = /* @__PURE__ */ a((e, t, n) => !t || !n || t.Fixed !== "Head" || ($(e, t, n, "Span") ?? 1) <= 1 ? !1 : ($(e, t, n, "RowSpan") ?? 1) === 1, "isTreeGridGroupHeaderCell"), P = /* @__PURE__ */ a((e, t, n = !1) => {
90
+ const r = typeof performance < "u" ? performance.now() : Date.now(), c = typeof e.GetFixedRows == "function" ? e.GetFixedRows().filter((T) => T.Fixed === "Head") : [], f = typeof e.GetCols == "function" ? e.GetCols() : [];
91
+ if (!c.length || !f.length)
72
92
  return;
73
- const p = /* @__PURE__ */ new Set();
74
- let l = 0;
93
+ const G = /* @__PURE__ */ new Set();
94
+ let p = 0;
75
95
  typeof e.StartUpdate == "function" && e.StartUpdate();
76
96
  try {
77
- s.forEach((T) => {
78
- a.forEach((C) => {
79
- $(e, T, C) && e.GetAttribute(T, C, U) !== "" && (e.SetAttribute(T, C, U, "", 0, 0), p.add(T), l += 1);
97
+ c.forEach((T) => {
98
+ f.forEach((R) => {
99
+ j(e, T, R) && e.GetAttribute(T, R, x) !== "" && (e.SetAttribute(T, R, x, "", 0, 0), G.add(T), p += 1);
80
100
  });
81
101
  });
82
102
  } finally {
83
103
  typeof e.EndUpdate == "function" && e.EndUpdate();
84
104
  }
85
- p.size && (n && p.forEach((T) => {
105
+ G.size && (n && G.forEach((T) => {
86
106
  typeof e.RefreshRow == "function" && e.RefreshRow(T);
87
- }), F(t, "group header button attribute apply"), k(t, "group header button attribute apply", o, {
88
- updatedCellCount: l,
89
- updatedRowCount: p.size
107
+ }), W(t, "group header button attribute apply"), M(t, "group header button attribute apply", r, {
108
+ updatedCellCount: p,
109
+ updatedRowCount: G.size
90
110
  }));
91
- }, "applyTreeGridGroupHeaderSortButtonAttributes"), Te = /* @__PURE__ */ f((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), pe = /* @__PURE__ */ f((e) => {
111
+ }, "applyTreeGridGroupHeaderSortButtonAttributes"), Ee = /* @__PURE__ */ a((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), Se = /* @__PURE__ */ a((e) => {
92
112
  const t = e == null ? void 0 : e.Visible;
93
113
  return !!e && t !== 0 && t !== !1 && t !== "0";
94
- }, "isVisibleTreeGridRow"), Re = /* @__PURE__ */ f((e) => {
114
+ }, "isVisibleTreeGridRow"), ye = /* @__PURE__ */ a((e) => {
95
115
  const t = e == null ? void 0 : e.Added;
96
116
  return !!e && t !== 0 && t !== !1 && t !== "0" && t !== void 0;
97
- }, "isAddedTreeGridRow"), E = /* @__PURE__ */ f((e) => !e || e.Fixed === "Foot" || !pe(e) ? !1 : e.Kind === "Data" || Re(e), "isDisplayTreeGridRow"), le = /* @__PURE__ */ f((e, t, n) => !t || !n || !E(t) ? !1 : e.CanEdit(t, n) === 1, "isEditableTreeGridCell"), Ce = /* @__PURE__ */ f((e, t, n) => {
98
- const o = e.GetAttribute(t, n, "Color");
99
- return o != null && o !== "";
100
- }, "hasExplicitTreeGridCellColor"), Se = /* @__PURE__ */ f((e, t, n, o) => {
101
- if (!(!t || o === void 0 || !le(e, t, n) || Ce(e, t, n)))
102
- return o;
103
- }, "getEditableTreeGridCellDefaultColor"), y = /* @__PURE__ */ f((e, t, n, o) => e === o[0] && t === o[1] && n === o[2], "matchesTreeGridRgbColor"), Ee = /* @__PURE__ */ f((e, t, n) => {
117
+ }, "isAddedTreeGridRow"), E = /* @__PURE__ */ a((e) => !e || e.Fixed === "Foot" || !Se(e) ? !1 : e.Kind === "Data" || ye(e), "isDisplayTreeGridRow"), me = /* @__PURE__ */ a((e, t, n) => !t || !n || !E(t) ? !1 : e.CanEdit(t, n) === 1, "isEditableTreeGridCell"), _e = /* @__PURE__ */ a((e, t, n) => {
118
+ const r = e.GetAttribute(t, n, "Color");
119
+ return r != null && r !== "";
120
+ }, "hasExplicitTreeGridCellColor"), De = /* @__PURE__ */ a((e, t, n, r) => {
121
+ if (!(!t || r === void 0 || !me(e, t, n) || _e(e, t, n)))
122
+ return r;
123
+ }, "getEditableTreeGridCellDefaultColor"), S = /* @__PURE__ */ a((e, t, n, r) => e === r[0] && t === r[1] && n === r[2], "matchesTreeGridRgbColor"), be = /* @__PURE__ */ a((e, t, n) => {
104
124
  if (!t || !n || !E(t))
105
125
  return !1;
106
- const o = e.IsSelected(t, n);
107
- return o !== 0 && o !== !1 && o !== void 0 && o !== null;
108
- }, "isTreeGridSelectedCellState"), _e = /* @__PURE__ */ f((e, t, n) => !t || !n || !E(t) || e.ARow !== t || e.ACol !== n ? !1 : e.CanEdit(t, n) === 0, "isTreeGridReadonlyHoveredCellState"), ye = /* @__PURE__ */ f((e, t, n) => !t || !n || !E(t) || e.ARow !== t || e.ACol !== n ? !1 : e.CanEdit(t, n) === 2, "isTreeGridPreviewHoveredCellState"), me = /* @__PURE__ */ f(({
126
+ const r = e.IsSelected(t, n);
127
+ return r !== 0 && r !== !1 && r !== void 0 && r !== null;
128
+ }, "isTreeGridSelectedCellState"), Ae = /* @__PURE__ */ a((e, t, n) => !t || !n || !E(t) || e.ARow !== t || e.ACol !== n ? !1 : e.CanEdit(t, n) === 0, "isTreeGridReadonlyHoveredCellState"), ve = /* @__PURE__ */ a((e, t, n) => !t || !n || !E(t) || e.ARow !== t || e.ACol !== n ? !1 : e.CanEdit(t, n) === 2, "isTreeGridPreviewHoveredCellState"), Be = /* @__PURE__ */ a(({
109
129
  grid: e,
110
130
  row: t,
111
131
  col: n,
112
- r: o,
113
- g: s,
114
- b: a,
115
- selectedCellBackgroundColor: p,
116
- hoverCellBackgroundColor: l
132
+ r,
133
+ g: c,
134
+ b: f,
135
+ selectedCellBackgroundColor: G,
136
+ hoverCellBackgroundColor: p
117
137
  }) => {
118
- if (Ee(e, t, n) && y(o, s, a, oe))
138
+ if (be(e, t, n) && S(r, c, f, de))
139
+ return G;
140
+ if (Ae(e, t, n) && (S(r, c, f, fe) || S(r, c, f, Ge)) || ve(e, t, n) && (S(r, c, f, le) || S(r, c, f, Te) || S(r, c, f, pe)))
119
141
  return p;
120
- if (_e(e, t, n) && (y(o, s, a, ue) || y(o, s, a, ce)) || ye(e, t, n) && (y(o, s, a, ie) || y(o, s, a, se) || y(o, s, a, fe)))
121
- return l;
122
- }, "resolveTreeGridStateBackgroundColor"), Ne = /* @__PURE__ */ f((e) => {
142
+ }, "resolveTreeGridStateBackgroundColor"), We = /* @__PURE__ */ a((e) => {
123
143
  if (!e)
124
144
  return !1;
125
145
  if (typeof e.GetFirst == "function" && typeof e.GetNext == "function") {
@@ -132,166 +152,172 @@ const Le = 300, oe = [255, 255, 166], ue = [240, 240, 240], ce = [248, 248, 248]
132
152
  return !1;
133
153
  }
134
154
  return Object.values(e.Rows ?? {}).some((t) => E(t));
135
- }, "hasTreeGridDisplayDataRows"), Ve = /* @__PURE__ */ f((e, t, n) => {
136
- var s;
137
- const o = (s = e.Data) == null ? void 0 : s.Data;
155
+ }, "hasTreeGridDisplayDataRows"), Me = /* @__PURE__ */ a((e, t, n) => {
156
+ var c;
157
+ const r = (c = e.Data) == null ? void 0 : c.Data;
138
158
  e.Data.Data = {
139
- ...o,
159
+ ...r,
140
160
  Data: { Body: [t || []] },
141
161
  Url: ""
142
162
  }, e.ReloadBody(n);
143
- }, "replaceTreeGridBodyData"), Fe = /* @__PURE__ */ f(({
163
+ }, "replaceTreeGridBodyData"), ze = /* @__PURE__ */ a(({
144
164
  id: e,
145
165
  latestEventHandlersRef: t,
146
166
  highlightEditableCellsRef: n,
147
- highlightChangedCellsRef: o,
148
- editableCellBackgroundColorValueRef: s,
149
- changedCellBackgroundColorRef: a,
167
+ highlightChangedCellsRef: r,
168
+ syncDeletedRowCanEditRef: c,
169
+ editableCellBackgroundColorValueRef: f,
170
+ changedCellBackgroundColorRef: G,
150
171
  selectedCellBackgroundColorRef: p,
151
- hoverCellBackgroundColorRef: l,
152
- treeGridInstanceRef: T,
153
- treeGridInitStartedAtRef: C,
154
- latestLayoutOverridesRef: W,
155
- appliedLayoutOverridesRef: M,
156
- appliedBodyDataPropRef: z,
157
- latestColumnEditRulesRef: j,
158
- latestColumnEditRuleLookupRef: w,
159
- appliedColumnEditRulesRef: q,
160
- columnEditRulesStateRef: O,
161
- hasAppliedInitialLayoutRef: A,
162
- syncHasDisplayDataRows: _,
163
- setIsTreeGridReady: Y
172
+ hoverCellBackgroundColorRef: T,
173
+ treeGridInstanceRef: R,
174
+ treeGridInitStartedAtRef: v,
175
+ latestLayoutOverridesRef: q,
176
+ appliedLayoutOverridesRef: Y,
177
+ appliedBodyDataPropRef: K,
178
+ latestColumnEditRulesRef: Q,
179
+ latestColumnEditRuleLookupRef: B,
180
+ appliedColumnEditRulesRef: g,
181
+ columnEditRulesStateRef: I,
182
+ hasAppliedInitialLayoutRef: O,
183
+ syncHasDisplayDataRows: y,
184
+ setIsTreeGridReady: J
164
185
  }) => {
165
- const d = t.current;
166
- window.TGSetEvent("OnRowAdd", e, (r, c) => {
167
- var u, i;
168
- c.CanEdit = 1, c.CanDelete = 1, (i = (u = t.current) == null ? void 0 : u.onRowAdd) == null || i.call(u, r, c);
169
- }), window.TGSetEvent("OnRowAdded", e, (r) => {
170
- _(r);
171
- }), typeof (d == null ? void 0 : d.onRowClick) == "function" && window.TGSetEvent(
186
+ const C = t.current;
187
+ window.TGSetEvent("OnRowAdd", e, (i, o) => {
188
+ var u, s;
189
+ o.CanEdit = 1, o.CanDelete = 1, (s = (u = t.current) == null ? void 0 : u.onRowAdd) == null || s.call(u, i, o);
190
+ }), window.TGSetEvent("OnRowAdded", e, (i) => {
191
+ y(i);
192
+ }), typeof (C == null ? void 0 : C.onRowClick) == "function" && window.TGSetEvent(
172
193
  "OnClick",
173
194
  e,
174
- b((r, c, u, i, G, R) => {
175
- var S, m;
176
- (m = (S = t.current) == null ? void 0 : S.onRowClick) == null || m.call(
177
- S,
178
- r,
179
- c,
180
- u,
195
+ _((i, o, u, s, d, l) => {
196
+ var h, m;
197
+ (m = (h = t.current) == null ? void 0 : h.onRowClick) == null || m.call(
198
+ h,
181
199
  i,
182
- G,
183
- R
200
+ o,
201
+ u,
202
+ s,
203
+ d,
204
+ l
184
205
  );
185
206
  }, 300)
186
- ), typeof (d == null ? void 0 : d.onClickButton) == "function" && window.TGSetEvent(
207
+ ), typeof (C == null ? void 0 : C.onClickButton) == "function" && window.TGSetEvent(
187
208
  "OnClickButton",
188
209
  e,
189
- b((r, c, u, i) => {
190
- var G, R;
191
- (R = (G = t.current) == null ? void 0 : G.onClickButton) == null || R.call(
192
- G,
193
- r,
194
- c,
210
+ _((i, o, u, s) => {
211
+ var d, l;
212
+ (l = (d = t.current) == null ? void 0 : d.onClickButton) == null || l.call(
213
+ d,
214
+ i,
215
+ o,
195
216
  u,
196
- i
217
+ s
197
218
  );
198
219
  }, 300)
199
- ), typeof (d == null ? void 0 : d.onRowDelete) == "function" ? window.TGSetEvent("OnRowDelete", e, (r, c, u) => {
200
- var i, G;
201
- _(r), (G = (i = t.current) == null ? void 0 : i.onRowDelete) == null || G.call(
220
+ ), window.TGSetEvent("OnRowDelete", e, (i, o, u) => {
221
+ var d, l;
222
+ const s = b(o) ? w(o) : [];
223
+ N(i, o, {
224
+ canEdit: c.current !== !1 ? 2 : void 0,
225
+ highlightColumns: s
226
+ }), y(i), (l = (d = t.current) == null ? void 0 : d.onRowDelete) == null || l.call(
227
+ d,
202
228
  i,
203
- r,
204
- c,
229
+ o,
205
230
  u
206
231
  );
207
- }) : window.TGSetEvent("OnRowDelete", e, (r) => {
208
- _(r);
209
- }), typeof (d == null ? void 0 : d.onRowUndelete) == "function" ? window.TGSetEvent("OnRowUndelete", e, (r, c) => {
210
- var u, i;
211
- _(r), (i = (u = t.current) == null ? void 0 : u.onRowUndelete) == null || i.call(u, r, c);
212
- }) : window.TGSetEvent("OnRowUndelete", e, (r) => {
213
- _(r);
214
- }), window.TGSetEvent("OnGetDefaultColor", e, (r, c, u) => {
215
- if (!(!n.current || !E(c)))
216
- return Se(
217
- r,
218
- c,
232
+ }), window.TGSetEvent("OnRowUndelete", e, (i, o) => {
233
+ var s, d;
234
+ const u = b(o) ? w(o) : [];
235
+ N(i, o, {
236
+ canEdit: c.current !== !1 ? 1 : void 0,
237
+ highlightColumns: u,
238
+ highlightBackgroundColor: u.length ? G.current : void 0
239
+ }), y(i), (d = (s = t.current) == null ? void 0 : s.onRowUndelete) == null || d.call(s, i, o);
240
+ }), window.TGSetEvent("OnGetDefaultColor", e, (i, o, u) => {
241
+ if (!(!n.current || !E(o)))
242
+ return De(
243
+ i,
244
+ o,
219
245
  u,
220
- s.current
246
+ f.current
221
247
  );
222
- }), window.TGSetEvent("OnGetColor", e, (r, c, u, i, G, R, S) => {
223
- if (!S)
224
- return me({
225
- grid: r,
226
- row: c,
248
+ }), window.TGSetEvent("OnGetColor", e, (i, o, u, s, d, l, h) => {
249
+ if (!h)
250
+ return Be({
251
+ grid: i,
252
+ row: o,
227
253
  col: u,
228
- r: i,
229
- g: G,
230
- b: R,
254
+ r: s,
255
+ g: d,
256
+ b: l,
231
257
  selectedCellBackgroundColor: p.current,
232
- hoverCellBackgroundColor: l.current
258
+ hoverCellBackgroundColor: T.current
233
259
  });
234
- }), window.TGSetEvent("OnAfterValueChanged", e, (r, c, u, i) => {
235
- var B, I;
236
- const G = w.current, R = G ? g(G, u, i) : void 0, S = R == null ? void 0 : R.value, m = S ?? i;
237
- R != null && R.invalidText && X(R.invalidText, { variant: "warning" }), S !== void 0 && r.SetValue(c, u, S, 1), o.current && E(c) && J(e, {
238
- row: c,
260
+ }), window.TGSetEvent("OnAfterValueChanged", e, (i, o, u, s) => {
261
+ var U, L;
262
+ const d = B.current, l = d ? oe(d, u, s) : void 0, h = l == null ? void 0 : l.value, m = h ?? s;
263
+ l != null && l.invalidText && ne(l.invalidText, { variant: "warning" }), h !== void 0 && i.SetValue(o, u, h, 1), r.current && E(o) && (ee(e, {
264
+ row: o,
239
265
  col: u,
240
- backgroundColor: a.current
241
- });
242
- const D = ((B = t.current) == null ? void 0 : B.onAfterValueChanged) ?? ((I = t.current) == null ? void 0 : I.onRowChange);
243
- D == null || D(r, c, u, m);
244
- }), typeof (d == null ? void 0 : d.onSelect) == "function" && window.TGSetEvent(
266
+ backgroundColor: G.current
267
+ }), b(o) && te(o, u));
268
+ const D = ((U = t.current) == null ? void 0 : U.onAfterValueChanged) ?? ((L = t.current) == null ? void 0 : L.onRowChange);
269
+ D == null || D(i, o, u, m);
270
+ }), typeof (C == null ? void 0 : C.onSelect) == "function" && window.TGSetEvent(
245
271
  "OnSelect",
246
272
  e,
247
- b((r) => {
248
- var u, i;
249
- const c = r.GetSelRows() ?? [];
250
- (i = (u = t.current) == null ? void 0 : u.onSelect) == null || i.call(u, c);
273
+ _((i) => {
274
+ var u, s;
275
+ const o = i.GetSelRows() ?? [];
276
+ (s = (u = t.current) == null ? void 0 : u.onSelect) == null || s.call(u, o);
251
277
  }, 100)
252
- ), typeof (d == null ? void 0 : d.onSave) == "function" && window.TGSetEvent("OnSave", e, (r, c, u) => {
253
- var i, G;
254
- (G = (i = t.current) == null ? void 0 : i.onSave) == null || G.call(
278
+ ), typeof (C == null ? void 0 : C.onSave) == "function" && window.TGSetEvent("OnSave", e, (i, o, u) => {
279
+ var s, d;
280
+ (d = (s = t.current) == null ? void 0 : s.onSave) == null || d.call(
281
+ s,
255
282
  i,
256
- r,
257
- c,
283
+ o,
258
284
  u
259
285
  );
260
- }), window.TGSetEvent("OnSort", e, (r, c) => {
286
+ }), window.TGSetEvent("OnSort", e, (i, o) => {
261
287
  var u;
262
- if (!(!c || !$(r, r.ARow, c)))
263
- return F(e, "group header sort blocked"), te(e, "group header sort blocked", {
264
- rowId: (u = r.ARow) == null ? void 0 : u.id,
265
- col: c
288
+ if (!(!o || !j(i, i.ARow, o)))
289
+ return W(e, "group header sort blocked"), ce(e, "group header sort blocked", {
290
+ rowId: (u = i.ARow) == null ? void 0 : u.id,
291
+ col: o
266
292
  }), -1;
267
- }), window.TGSetEvent("OnRenderStart", e, (r) => {
268
- V(r, e, !1);
293
+ }), window.TGSetEvent("OnRenderStart", e, (i) => {
294
+ P(i, e, !1);
269
295
  }), window.TGSetEvent(
270
296
  "OnReady",
271
297
  e,
272
- b((r) => {
273
- var c, u;
274
- if (!A.current) {
275
- const i = W.current;
276
- A.current = !0, Z(r, i), H(O.current), ee(
277
- r,
278
- w.current,
279
- O.current
280
- ), T.current = r, M.current = i, z.current = L(r), q.current = j.current, _(r), Y(!0), V(r, e, !0), k(e, "TreeGrid init ready", C.current, {
281
- bodyRowCount: Te(
282
- L(r)
298
+ _((i) => {
299
+ var o, u;
300
+ if (!O.current) {
301
+ const s = q.current;
302
+ O.current = !0, re(i, s), ie(I.current), ue(
303
+ i,
304
+ B.current,
305
+ I.current
306
+ ), R.current = i, Y.current = s, K.current = k(i), g.current = Q.current, y(i), J(!0), P(i, e, !0), M(e, "TreeGrid init ready", v.current, {
307
+ bodyRowCount: Ee(
308
+ k(i)
283
309
  )
284
- }), C.current = null, (u = (c = t.current) == null ? void 0 : c.onReady) == null || u.call(c, r);
310
+ }), v.current = null, (u = (o = t.current) == null ? void 0 : o.onReady) == null || u.call(o, i);
285
311
  }
286
312
  }, 100)
287
313
  );
288
314
  }, "bindTreeGridEvents");
289
315
  export {
290
- Le as TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS,
291
- Fe as bindTreeGridEvents,
292
- xe as buildTreeGridInitializationOptions,
293
- Te as getTreeGridBodyDataCount,
294
- Ne as hasTreeGridDisplayDataRows,
295
- Ve as replaceTreeGridBodyData
316
+ $e as TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS,
317
+ ze as bindTreeGridEvents,
318
+ Pe as buildTreeGridInitializationOptions,
319
+ Ee as getTreeGridBodyDataCount,
320
+ We as hasTreeGridDisplayDataRows,
321
+ Me as replaceTreeGridBodyData
296
322
  };
297
323
  //# sourceMappingURL=treeGridRuntime.js.map