@owp/core 2.5.16 → 2.5.17

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