@owp/core 2.5.14 → 2.5.16

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