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