@owp/core 2.5.13 → 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 (55) 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/index3.js +2 -2
  7. package/dist/_virtual/index4.js +2 -2
  8. package/dist/_virtual/index5.js +2 -2
  9. package/dist/components/OwpDialog/OwpAlertDialog.js +46 -0
  10. package/dist/components/OwpDialog/OwpAlertDialog.js.map +1 -0
  11. package/dist/components/OwpDialog/OwpDialog.js +41 -38
  12. package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
  13. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +163 -153
  14. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  15. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +234 -173
  16. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  17. package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js +7 -6
  18. package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.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/inko@1.1.1/node_modules/inko/index.js +1 -1
  26. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  27. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  28. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  29. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  30. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  31. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  32. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  33. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  34. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  35. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  36. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  37. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/index.js +1 -1
  38. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  39. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  40. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  41. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  42. package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  43. package/dist/types/components/OwpDialog/OwpAlertDialog.d.ts +25 -0
  44. package/dist/types/components/OwpDialog/OwpDialog.d.ts +2 -0
  45. package/dist/types/components/OwpDialog/index.d.ts +1 -0
  46. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +3 -1
  47. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +8 -3
  48. package/dist/types/hooks/useConfirm.d.ts +7 -14
  49. package/dist/types/utils/treeGridUtil.d.ts +23 -0
  50. package/dist/utils/treeGridExportExcelUtil.js +118 -118
  51. package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
  52. package/dist/utils/treeGridUtil.js +123 -103
  53. package/dist/utils/treeGridUtil.js.map +1 -1
  54. package/dist/utils.js +81 -75
  55. package/package.json +1 -1
@@ -1,55 +1,83 @@
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 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
+ 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 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
- 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, 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"), 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__ */ 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
+ if (!e)
34
+ return;
35
+ const o = n.canEdit, c = n.highlightColumns ?? [], d = n.highlightBackgroundColor;
36
+ if (!(o === void 0 && !c.length)) {
37
+ typeof e.StartUpdate == "function" && e.StartUpdate();
38
+ try {
39
+ o !== void 0 && (t.CanEdit = o), c.forEach((G) => {
40
+ G && (e.SetValue(
41
+ t,
42
+ `${G}Class`,
43
+ d ? H : "",
44
+ 0
45
+ ), e.SetValue(t, `${G}Color`, d ?? "", 0));
46
+ });
47
+ } finally {
48
+ typeof e.EndUpdate == "function" && e.EndUpdate();
49
+ }
50
+ typeof e.RefreshRow == "function" && e.RefreshRow(t);
51
+ }
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(({
33
61
  id: e,
34
62
  layoutUrl: t,
35
63
  layoutData: n,
36
64
  dataUrl: o,
37
- bodyData: s,
38
- useDataUrl: a,
39
- width: p,
40
- height: l,
41
- languageId: T
65
+ bodyData: c,
66
+ useDataUrl: d,
67
+ width: G,
68
+ height: R,
69
+ languageId: p
42
70
  }) => ({
43
71
  id: e,
44
- Layout: n ? { Data: n } : { Url: h(t ?? "") },
45
- Data: Ge(a, o, s),
72
+ Layout: n ? { Data: n } : { Url: A(t ?? "") },
73
+ Data: Se(d, o, c),
46
74
  Text: {
47
- Url: Q(T)
75
+ Url: g(p)
48
76
  },
49
- width: p,
50
- height: l,
77
+ width: G,
78
+ height: R,
51
79
  Debug: "Error"
52
- }), "buildTreeGridInitializationOptions"), L = /* @__PURE__ */ f((e) => ne(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), x = /* @__PURE__ */ f((e) => {
80
+ }), "buildTreeGridInitializationOptions"), N = /* @__PURE__ */ f((e) => se(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), F = /* @__PURE__ */ f((e) => {
53
81
  if (typeof e == "number")
54
82
  return Number.isFinite(e) && e > 0 ? e : void 0;
55
83
  if (typeof e != "string")
@@ -59,67 +87,67 @@ const Le = 300, oe = [255, 255, 166], ue = [240, 240, 240], ce = [248, 248, 248]
59
87
  return;
60
88
  const n = Number(t);
61
89
  return Number.isFinite(n) && n > 0 ? n : void 0;
62
- }, "parseTreeGridPositiveNumber"), N = /* @__PURE__ */ f((e, t, n, o) => {
90
+ }, "parseTreeGridPositiveNumber"), $ = /* @__PURE__ */ f((e, t, n, o) => {
63
91
  if (!t || !n)
64
92
  return;
65
- const s = e.GetAttribute(t, n, o), a = x(s);
66
- return a !== void 0 ? a : x(
93
+ const c = e.GetAttribute(t, n, o), d = F(c);
94
+ return d !== void 0 ? d : F(
67
95
  t[`${n}${o}`]
68
96
  );
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)
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)
72
100
  return;
73
- const p = /* @__PURE__ */ new Set();
74
- let l = 0;
101
+ const G = /* @__PURE__ */ new Set();
102
+ let R = 0;
75
103
  typeof e.StartUpdate == "function" && e.StartUpdate();
76
104
  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);
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);
80
108
  });
81
109
  });
82
110
  } finally {
83
111
  typeof e.EndUpdate == "function" && e.EndUpdate();
84
112
  }
85
- p.size && (n && p.forEach((T) => {
86
- 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
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,
117
+ updatedRowCount: G.size
90
118
  }));
91
- }, "applyTreeGridGroupHeaderSortButtonAttributes"), Te = /* @__PURE__ */ f((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), pe = /* @__PURE__ */ f((e) => {
119
+ }, "applyTreeGridGroupHeaderSortButtonAttributes"), me = /* @__PURE__ */ f((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), ye = /* @__PURE__ */ f((e) => {
92
120
  const t = e == null ? void 0 : e.Visible;
93
121
  return !!e && t !== 0 && t !== !1 && t !== "0";
94
- }, "isVisibleTreeGridRow"), Re = /* @__PURE__ */ f((e) => {
122
+ }, "isVisibleTreeGridRow"), _e = /* @__PURE__ */ f((e) => {
95
123
  const t = e == null ? void 0 : e.Added;
96
124
  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) => {
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) => {
98
126
  const o = e.GetAttribute(t, n, "Color");
99
127
  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)))
128
+ }, "hasExplicitTreeGridCellColor"), Ae = /* @__PURE__ */ f((e, t, n, o) => {
129
+ if (!(!t || o === void 0 || !be(e, t, n) || De(e, t, n)))
102
130
  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) => {
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) => {
104
132
  if (!t || !n || !E(t))
105
133
  return !1;
106
134
  const o = e.IsSelected(t, n);
107
135
  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(({
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(({
109
137
  grid: e,
110
138
  row: t,
111
139
  col: n,
112
140
  r: o,
113
- g: s,
114
- b: a,
115
- selectedCellBackgroundColor: p,
116
- hoverCellBackgroundColor: l
141
+ g: c,
142
+ b: d,
143
+ selectedCellBackgroundColor: G,
144
+ hoverCellBackgroundColor: R
117
145
  }) => {
118
- if (Ee(e, t, n) && y(o, s, a, oe))
119
- 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) => {
146
+ if (ve(e, t, n) && m(o, c, d, ae))
147
+ return G;
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) => {
123
151
  if (!e)
124
152
  return !1;
125
153
  if (typeof e.GetFirst == "function" && typeof e.GetNext == "function") {
@@ -132,166 +160,199 @@ const Le = 300, oe = [255, 255, 166], ue = [240, 240, 240], ce = [248, 248, 248]
132
160
  return !1;
133
161
  }
134
162
  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;
163
+ }, "hasTreeGridDisplayDataRows"), ze = /* @__PURE__ */ f((e, t, n) => {
164
+ var c;
165
+ const o = (c = e.Data) == null ? void 0 : c.Data;
138
166
  e.Data.Data = {
139
167
  ...o,
140
168
  Data: { Body: [t || []] },
141
169
  Url: ""
142
170
  }, e.ReloadBody(n);
143
- }, "replaceTreeGridBodyData"), Fe = /* @__PURE__ */ f(({
171
+ }, "replaceTreeGridBodyData"), qe = /* @__PURE__ */ f(({
144
172
  id: e,
145
173
  latestEventHandlersRef: t,
146
174
  highlightEditableCellsRef: n,
147
175
  highlightChangedCellsRef: o,
148
- editableCellBackgroundColorValueRef: s,
149
- changedCellBackgroundColorRef: a,
150
- selectedCellBackgroundColorRef: p,
151
- hoverCellBackgroundColorRef: l,
152
- treeGridInstanceRef: T,
153
- treeGridInitStartedAtRef: C,
154
- latestLayoutOverridesRef: W,
155
- appliedLayoutOverridesRef: M,
156
- appliedBodyDataPropRef: z,
157
- latestColumnEditRulesRef: j,
176
+ syncDeletedRowCanEditRef: c,
177
+ editableCellBackgroundColorValueRef: d,
178
+ changedCellBackgroundColorRef: G,
179
+ selectedCellBackgroundColorRef: R,
180
+ hoverCellBackgroundColorRef: p,
181
+ treeGridInstanceRef: C,
182
+ treeGridInitStartedAtRef: v,
183
+ latestLayoutOverridesRef: q,
184
+ appliedLayoutOverridesRef: Y,
185
+ appliedBodyDataPropRef: K,
186
+ latestColumnEditRulesRef: Q,
158
187
  latestColumnEditRuleLookupRef: w,
159
- appliedColumnEditRulesRef: q,
160
- columnEditRulesStateRef: O,
161
- hasAppliedInitialLayoutRef: A,
162
- syncHasDisplayDataRows: _,
163
- setIsTreeGridReady: Y
188
+ appliedColumnEditRulesRef: J,
189
+ columnEditRulesStateRef: B,
190
+ hasAppliedInitialLayoutRef: O,
191
+ syncHasDisplayDataRows: S,
192
+ setIsTreeGridReady: X
164
193
  }) => {
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);
194
+ const h = t.current;
195
+ window.TGSetEvent("OnRowAdd", e, (r, i) => {
196
+ var u, s;
197
+ i.CanEdit = 1, i.CanDelete = 1, (s = (u = t.current) == null ? void 0 : u.onRowAdd) == null || s.call(u, r, i);
169
198
  }), window.TGSetEvent("OnRowAdded", e, (r) => {
170
- _(r);
171
- }), typeof (d == null ? void 0 : d.onRowClick) == "function" && window.TGSetEvent(
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(
172
228
  "OnClick",
173
229
  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,
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,
178
234
  r,
179
- c,
180
- u,
181
235
  i,
182
- G,
183
- R
236
+ u,
237
+ s,
238
+ a,
239
+ l
184
240
  );
185
241
  }, 300)
186
- ), typeof (d == null ? void 0 : d.onClickButton) == "function" && window.TGSetEvent(
242
+ ), typeof (h == null ? void 0 : h.onClickButton) == "function" && window.TGSetEvent(
187
243
  "OnClickButton",
188
244
  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,
245
+ _((r, i, u, s) => {
246
+ var a, l;
247
+ (l = (a = t.current) == null ? void 0 : a.onClickButton) == null || l.call(
248
+ a,
193
249
  r,
194
- c,
250
+ i,
195
251
  u,
196
- i
252
+ s
197
253
  );
198
254
  }, 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(
202
- i,
255
+ ), window.TGSetEvent("OnRowDelete", e, (r, i, u) => {
256
+ var a, l;
257
+ const s = D(i) ? L(i) : [];
258
+ k(r, i, {
259
+ canEdit: c.current !== !1 ? 2 : void 0,
260
+ highlightColumns: s
261
+ }), S(r), (l = (a = t.current) == null ? void 0 : a.onRowDelete) == null || l.call(
262
+ a,
203
263
  r,
204
- c,
264
+ i,
205
265
  u
206
266
  );
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(
267
+ }), window.TGSetEvent("OnRowUndelete", e, (r, i) => {
268
+ var s, a;
269
+ const u = D(i) ? L(i) : [];
270
+ k(r, i, {
271
+ canEdit: c.current !== !1 ? 1 : void 0,
272
+ highlightColumns: u,
273
+ highlightBackgroundColor: u.length ? G.current : void 0
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(
217
278
  r,
218
- c,
279
+ i,
219
280
  u,
220
- s.current
281
+ d.current
221
282
  );
222
- }), window.TGSetEvent("OnGetColor", e, (r, c, u, i, G, R, S) => {
223
- if (!S)
224
- return me({
283
+ }), window.TGSetEvent("OnGetColor", e, (r, i, u, s, a, l, T) => {
284
+ if (!T)
285
+ return Oe({
225
286
  grid: r,
226
- row: c,
287
+ row: i,
227
288
  col: u,
228
- r: i,
229
- g: G,
230
- b: R,
231
- selectedCellBackgroundColor: p.current,
232
- hoverCellBackgroundColor: l.current
289
+ r: s,
290
+ g: a,
291
+ b: l,
292
+ selectedCellBackgroundColor: R.current,
293
+ hoverCellBackgroundColor: p.current
233
294
  });
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,
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,
239
300
  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(
301
+ backgroundColor: G.current
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(
245
306
  "OnSelect",
246
307
  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);
308
+ _((r) => {
309
+ var u, s;
310
+ const i = r.GetSelRows() ?? [];
311
+ (s = (u = t.current) == null ? void 0 : u.onSelect) == null || s.call(u, i);
251
312
  }, 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(
255
- i,
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(
316
+ s,
256
317
  r,
257
- c,
318
+ i,
258
319
  u
259
320
  );
260
- }), window.TGSetEvent("OnSort", e, (r, c) => {
321
+ }), window.TGSetEvent("OnSort", e, (r, i) => {
261
322
  var u;
262
- if (!(!c || !$(r, r.ARow, c)))
263
- return F(e, "group header sort blocked"), te(e, "group header sort blocked", {
323
+ if (!(!i || !z(r, r.ARow, i)))
324
+ return W(e, "group header sort blocked"), ce(e, "group header sort blocked", {
264
325
  rowId: (u = r.ARow) == null ? void 0 : u.id,
265
- col: c
326
+ col: i
266
327
  }), -1;
267
328
  }), window.TGSetEvent("OnRenderStart", e, (r) => {
268
- V(r, e, !1);
329
+ P(r, e, !1);
269
330
  }), window.TGSetEvent(
270
331
  "OnReady",
271
332
  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(
333
+ _((r) => {
334
+ var i, u;
335
+ if (!O.current) {
336
+ const s = q.current;
337
+ O.current = !0, re(r, s), ie(B.current), ue(
277
338
  r,
278
339
  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)
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)
283
344
  )
284
- }), C.current = null, (u = (c = t.current) == null ? void 0 : c.onReady) == null || u.call(c, r);
345
+ }), v.current = null, (u = (i = t.current) == null ? void 0 : i.onReady) == null || u.call(i, r);
285
346
  }
286
347
  }, 100)
287
348
  );
288
349
  }, "bindTreeGridEvents");
289
350
  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
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
296
357
  };
297
358
  //# sourceMappingURL=treeGridRuntime.js.map