@owp/core 2.5.15 → 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 (27) hide show
  1. package/dist/components/OwpPicker/OwpTimePicker.js +147 -185
  2. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  3. package/dist/components/OwpQuerySelector/OwpQuerySelector.js +184 -177
  4. package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
  5. package/dist/components/OwpTable/internal/treeGridTableStyle.js +16 -21
  6. package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
  7. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +237 -215
  8. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  9. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +153 -0
  10. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -0
  11. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +301 -209
  12. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  13. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +141 -127
  14. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  15. package/dist/constants/treeGrid.js +32 -26
  16. package/dist/constants/treeGrid.js.map +1 -1
  17. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  18. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  19. package/dist/owp-app.css +1 -1
  20. package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
  21. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +9 -1
  22. package/dist/types/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.d.ts +14 -0
  23. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +9 -1
  24. package/dist/types/constants/treeGrid.d.ts +3 -3
  25. package/dist/utils/treeGridUtil.js +81 -76
  26. package/dist/utils/treeGridUtil.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,83 +1,109 @@
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) => {
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
+ 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 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(
30
+ Boolean
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) => {
13
39
  if (!e || !e.startsWith("data:"))
14
40
  return e;
15
- const t = V.get(e);
41
+ const t = g.get(e);
16
42
  if (t)
17
43
  return t;
18
44
  try {
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;
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;
24
50
  } catch {
25
51
  return e;
26
52
  }
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) => {
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) => {
33
59
  if (!e)
34
60
  return;
35
- const o = n.canEdit, c = n.highlightColumns ?? [], d = n.highlightBackgroundColor;
36
- if (!(o === void 0 && !c.length)) {
61
+ const r = n.canEdit, d = n.highlightColumns ?? [], E = n.highlightBackgroundColor;
62
+ if (!(r === void 0 && !d.length)) {
37
63
  typeof e.StartUpdate == "function" && e.StartUpdate();
38
64
  try {
39
- o !== void 0 && (t.CanEdit = o), c.forEach((G) => {
65
+ r !== void 0 && (t.CanEdit = r), d.forEach((G) => {
40
66
  G && (e.SetValue(
41
67
  t,
42
68
  `${G}Class`,
43
- d ? H : "",
69
+ E ? z : "",
44
70
  0
45
- ), e.SetValue(t, `${G}Color`, d ?? "", 0));
71
+ ), e.SetValue(t, `${G}Color`, E ?? "", 0));
46
72
  });
47
73
  } finally {
48
74
  typeof e.EndUpdate == "function" && e.EndUpdate();
49
75
  }
50
76
  typeof e.RefreshRow == "function" && e.RefreshRow(t);
51
77
  }
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) => {
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) => {
53
79
  if (!(!e || n === "cancel")) {
54
80
  if (n === "remove") {
55
- e.RemoveRow(t), o(e);
81
+ e.RemoveRow(t), r(e);
56
82
  return;
57
83
  }
58
84
  e.DeleteRowT(t, 3);
59
85
  }
60
- }, "applyTreeGridBeforeRowUndeleteAction"), Se = /* @__PURE__ */ f((e, t, n) => e ? { Url: he(t) } : { Data: { Body: [fe(n) ? [] : n] } }, "buildTreeGridDataSource"), Me = /* @__PURE__ */ f(({
86
+ }, "applyTreeGridBeforeRowUndeleteAction"), Fe = /* @__PURE__ */ c((e, t, n) => e ? { Url: Ne(t) } : { Data: { Body: [pe(n) ? [] : n] } }, "buildTreeGridDataSource"), ct = /* @__PURE__ */ c(({
61
87
  id: e,
62
88
  layoutUrl: t,
63
89
  layoutData: n,
64
- dataUrl: o,
65
- bodyData: c,
66
- useDataUrl: d,
90
+ dataUrl: r,
91
+ bodyData: d,
92
+ useDataUrl: E,
67
93
  width: G,
68
- height: R,
69
- languageId: p
94
+ height: C,
95
+ languageId: a
70
96
  }) => ({
71
97
  id: e,
72
- Layout: n ? { Data: n } : { Url: A(t ?? "") },
73
- Data: Se(d, o, c),
98
+ Layout: n ? { Data: n } : { Url: L(t ?? "") },
99
+ Data: Fe(E, r, d),
74
100
  Text: {
75
- Url: g(p)
101
+ Url: ce(a)
76
102
  },
77
103
  width: G,
78
- height: R,
104
+ height: C,
79
105
  Debug: "Error"
80
- }), "buildTreeGridInitializationOptions"), N = /* @__PURE__ */ f((e) => se(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), F = /* @__PURE__ */ f((e) => {
106
+ }), "buildTreeGridInitializationOptions"), $ = /* @__PURE__ */ c((e) => he(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), P = /* @__PURE__ */ c((e) => {
81
107
  if (typeof e == "number")
82
108
  return Number.isFinite(e) && e > 0 ? e : void 0;
83
109
  if (typeof e != "string")
@@ -87,272 +113,338 @@ const We = 300, ae = [255, 255, 166], de = [240, 240, 240], le = [248, 248, 248]
87
113
  return;
88
114
  const n = Number(t);
89
115
  return Number.isFinite(n) && n > 0 ? n : void 0;
90
- }, "parseTreeGridPositiveNumber"), $ = /* @__PURE__ */ f((e, t, n, o) => {
116
+ }, "parseTreeGridPositiveNumber"), H = /* @__PURE__ */ c((e, t, n, r) => {
91
117
  if (!t || !n)
92
118
  return;
93
- const c = e.GetAttribute(t, n, o), d = F(c);
94
- return d !== void 0 ? d : F(
95
- t[`${n}${o}`]
119
+ const d = e.GetAttribute(t, n, r), E = P(d);
120
+ return E !== void 0 ? E : P(
121
+ t[`${n}${r}`]
96
122
  );
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)
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)
100
126
  return;
101
127
  const G = /* @__PURE__ */ new Set();
102
- let R = 0;
128
+ let C = 0;
103
129
  typeof e.StartUpdate == "function" && e.StartUpdate();
104
130
  try {
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);
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);
108
134
  });
109
135
  });
110
136
  } finally {
111
137
  typeof e.EndUpdate == "function" && e.EndUpdate();
112
138
  }
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,
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,
117
143
  updatedRowCount: G.size
118
144
  }));
119
- }, "applyTreeGridGroupHeaderSortButtonAttributes"), me = /* @__PURE__ */ f((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), ye = /* @__PURE__ */ f((e) => {
145
+ }, "applyTreeGridGroupHeaderSortButtonAttributes"), Ve = /* @__PURE__ */ c((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), ge = /* @__PURE__ */ c((e) => {
120
146
  const t = e == null ? void 0 : e.Visible;
121
147
  return !!e && t !== 0 && t !== !1 && t !== "0";
122
- }, "isVisibleTreeGridRow"), _e = /* @__PURE__ */ f((e) => {
148
+ }, "isVisibleTreeGridRow"), Me = /* @__PURE__ */ c((e) => {
123
149
  const t = e == null ? void 0 : e.Added;
124
150
  return !!e && t !== 0 && t !== !1 && t !== "0" && t !== void 0;
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) => {
132
- if (!t || !n || !E(t))
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) => {
152
+ const r = e.GetAttribute(t, n, "Color");
153
+ return r != null && r !== "";
154
+ }, "hasExplicitTreeGridCellColor"), He = /* @__PURE__ */ c((e, t, n, r) => {
155
+ if (!(!t || r === void 0 || !$e(e, t, n) || Pe(e, t, n)))
156
+ return r;
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;
159
+ if (!(t === void 0 || !Number.isFinite(t)))
160
+ return [t >> 16 & 255, t >> 8 & 255, t & 255];
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
164
+ ), "blendChannel");
165
+ return [
166
+ r(e[0], t[0]),
167
+ r(e[1], t[1]),
168
+ r(e[2], t[2])
169
+ ];
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))
133
175
  return !1;
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(({
176
+ const r = e.IsSelected(t, n);
177
+ return r !== 0 && r !== !1 && r !== void 0 && r !== null;
178
+ }, "isTreeGridSelectedCellState"), je = /* @__PURE__ */ c((e, t, n, r) => {
179
+ if (!t || !O(e, t, n) || !Z(e.GetAttribute(t, n, "Class")))
180
+ return;
181
+ const d = j(r), E = j(
182
+ e.GetAttribute(t, n, "Color") ?? se
183
+ );
184
+ if (!(!d || !E))
185
+ return Q(
186
+ J(
187
+ d,
188
+ E,
189
+ Le
190
+ )
191
+ );
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
199
+ )
200
+ );
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(({
137
202
  grid: e,
138
203
  row: t,
139
204
  col: n,
140
- r: o,
141
- g: c,
142
- b: d,
205
+ r,
206
+ g: d,
207
+ b: E,
143
208
  selectedCellBackgroundColor: G,
144
- hoverCellBackgroundColor: R
209
+ hoverCellBackgroundColor: C
145
210
  }) => {
146
- if (ve(e, t, n) && m(o, c, d, ae))
211
+ const a = je(
212
+ e,
213
+ t,
214
+ n,
215
+ G
216
+ );
217
+ if (a)
218
+ return a;
219
+ if (O(e, t, n) && A(r, d, E, De))
147
220
  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) => {
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) => {
151
224
  if (!e)
152
225
  return !1;
153
226
  if (typeof e.GetFirst == "function" && typeof e.GetNext == "function") {
154
227
  let t = e.GetFirst();
155
228
  for (; t; ) {
156
- if (E(t))
229
+ if (S(t))
157
230
  return !0;
158
231
  t = e.GetNext(t);
159
232
  }
160
233
  return !1;
161
234
  }
162
- return Object.values(e.Rows ?? {}).some((t) => E(t));
163
- }, "hasTreeGridDisplayDataRows"), ze = /* @__PURE__ */ f((e, t, n) => {
164
- var c;
165
- const o = (c = e.Data) == null ? void 0 : c.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;
166
239
  e.Data.Data = {
167
- ...o,
240
+ ...r,
168
241
  Data: { Body: [t || []] },
169
242
  Url: ""
170
243
  }, e.ReloadBody(n);
171
- }, "replaceTreeGridBodyData"), qe = /* @__PURE__ */ f(({
244
+ }, "replaceTreeGridBodyData"), ft = /* @__PURE__ */ c(({
172
245
  id: e,
173
246
  latestEventHandlersRef: t,
174
- highlightEditableCellsRef: n,
175
- highlightChangedCellsRef: o,
176
- syncDeletedRowCanEditRef: c,
177
- editableCellBackgroundColorValueRef: d,
178
- changedCellBackgroundColorRef: G,
179
- selectedCellBackgroundColorRef: R,
247
+ layoutHasExplicitEnterModeRef: n,
248
+ highlightEditableCellsRef: r,
249
+ highlightChangedCellsRef: d,
250
+ syncDeletedRowCanEditRef: E,
251
+ editableCellBackgroundColorValueRef: G,
252
+ changedCellBackgroundColorRef: C,
253
+ selectedCellBackgroundColorRef: a,
180
254
  hoverCellBackgroundColorRef: p,
181
- treeGridInstanceRef: C,
182
- treeGridInitStartedAtRef: v,
183
- latestLayoutOverridesRef: q,
184
- appliedLayoutOverridesRef: Y,
185
- appliedBodyDataPropRef: K,
186
- latestColumnEditRulesRef: Q,
255
+ treeGridInstanceRef: v,
256
+ treeGridInitStartedAtRef: B,
257
+ latestLayoutOverridesRef: ee,
258
+ appliedLayoutOverridesRef: te,
259
+ appliedBodyDataPropRef: ne,
260
+ latestColumnEditRulesRef: re,
187
261
  latestColumnEditRuleLookupRef: w,
188
- appliedColumnEditRulesRef: J,
189
- columnEditRulesStateRef: B,
190
- hasAppliedInitialLayoutRef: O,
191
- syncHasDisplayDataRows: S,
192
- setIsTreeGridReady: X
262
+ appliedColumnEditRulesRef: oe,
263
+ columnEditRulesStateRef: U,
264
+ hasAppliedInitialLayoutRef: N,
265
+ syncHasDisplayDataRows: D,
266
+ setIsTreeGridReady: ie
193
267
  }) => {
194
- const h = t.current;
195
- window.TGSetEvent("OnRowAdd", e, (r, i) => {
268
+ const R = t.current;
269
+ if (window.TGSetEvent("OnRowAdd", e, (i, o) => {
196
270
  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);
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;
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) => {
277
+ var T;
204
278
  if (u !== 3)
205
279
  return u;
206
- const s = (l = t.current) == null ? void 0 : l.onBeforeRowUndelete;
280
+ const s = (T = t.current) == null ? void 0 : T.onBeforeRowUndelete;
207
281
  if (typeof s != "function")
208
282
  return u;
209
- const a = /* @__PURE__ */ f((T) => {
283
+ const f = /* @__PURE__ */ c((l) => {
210
284
  window.setTimeout(() => {
211
- Ee(
212
- C.current ?? r,
213
- i,
214
- T,
215
- S
285
+ xe(
286
+ v.current ?? i,
287
+ o,
288
+ l,
289
+ D
216
290
  );
217
291
  }, 0);
218
292
  }, "scheduleAction");
219
293
  try {
220
- const T = s(r, i);
221
- return Ce(T) ? (T.then(a).catch(() => {
222
- a("undelete");
223
- }), 0) : (a(T), 0);
294
+ const l = s(i, o);
295
+ return ke(l) ? (l.then(f).catch(() => {
296
+ f("undelete");
297
+ }), 0) : (f(l), 0);
224
298
  } catch {
225
- return a("undelete"), 0;
299
+ return f("undelete"), 0;
226
300
  }
227
- }), typeof (h == null ? void 0 : h.onRowClick) == "function" && window.TGSetEvent(
228
- "OnClick",
229
- e,
230
- _((r, i, u, s, a, l) => {
231
- var T, y;
232
- (y = (T = t.current) == null ? void 0 : T.onRowClick) == null || y.call(
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
+ _,
306
+ o,
307
+ u,
308
+ s,
309
+ f,
233
310
  T,
234
- r,
235
- i,
311
+ l
312
+ );
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,
236
319
  u,
237
320
  s,
238
- a,
321
+ f,
322
+ T,
239
323
  l
240
324
  );
241
- }, 300)
242
- ), typeof (h == null ? void 0 : h.onClickButton) == "function" && window.TGSetEvent(
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(
243
331
  "OnClickButton",
244
332
  e,
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,
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,
250
337
  i,
338
+ o,
251
339
  u,
252
340
  s
253
341
  );
254
342
  }, 300)
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,
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,
260
348
  highlightColumns: s
261
- }), S(r), (l = (a = t.current) == null ? void 0 : a.onRowDelete) == null || l.call(
262
- a,
263
- r,
349
+ }), D(i), (T = (f = t.current) == null ? void 0 : f.onRowDelete) == null || T.call(
350
+ f,
264
351
  i,
352
+ o,
265
353
  u
266
354
  );
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,
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,
272
360
  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(
278
- r,
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(
279
369
  i,
370
+ o,
280
371
  u,
281
- d.current
372
+ G.current
282
373
  );
283
- }), window.TGSetEvent("OnGetColor", e, (r, i, u, s, a, l, T) => {
284
- if (!T)
285
- return Oe({
286
- grid: r,
287
- 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,
288
379
  col: u,
289
380
  r: s,
290
- g: a,
291
- b: l,
292
- selectedCellBackgroundColor: R.current,
381
+ g: f,
382
+ b: T,
383
+ selectedCellBackgroundColor: a.current,
293
384
  hoverCellBackgroundColor: p.current
294
385
  });
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,
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,
300
391
  col: u,
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(
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(
306
397
  "OnSelect",
307
398
  e,
308
- _((r) => {
399
+ y((i) => {
309
400
  var u, s;
310
- const i = r.GetSelRows() ?? [];
311
- (s = (u = t.current) == null ? void 0 : u.onSelect) == null || s.call(u, i);
401
+ const o = i.GetSelRows() ?? [];
402
+ (s = (u = t.current) == null ? void 0 : u.onSelect) == null || s.call(u, o);
312
403
  }, 100)
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(
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(
316
407
  s,
317
- r,
318
408
  i,
409
+ o,
319
410
  u
320
411
  );
321
- }), window.TGSetEvent("OnSort", e, (r, i) => {
412
+ }), window.TGSetEvent("OnSort", e, (i, o) => {
322
413
  var u;
323
- if (!(!i || !z(r, r.ARow, i)))
324
- return W(e, "group header sort blocked"), ce(e, "group header sort blocked", {
325
- rowId: (u = r.ARow) == null ? void 0 : u.id,
326
- 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
327
418
  }), -1;
328
- }), window.TGSetEvent("OnRenderStart", e, (r) => {
329
- P(r, e, !1);
330
- }), 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(
331
422
  "OnReady",
332
423
  e,
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(
338
- r,
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,
339
430
  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)
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)
344
435
  )
345
- }), v.current = null, (u = (i = t.current) == null ? void 0 : i.onReady) == null || u.call(i, r);
436
+ }), B.current = null, (u = (o = t.current) == null ? void 0 : o.onReady) == null || u.call(o, i);
346
437
  }
347
438
  }, 100)
348
439
  );
349
440
  }, "bindTreeGridEvents");
350
441
  export {
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
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
357
449
  };
358
450
  //# sourceMappingURL=treeGridRuntime.js.map