@owp/core 2.5.38 → 2.5.40

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.
@@ -1,120 +1,120 @@
1
- var q = Object.defineProperty;
2
- var l = (e, t) => q(e, "name", { value: t, configurable: !0 });
3
- import { TREEGRID_CELL_CHANGED_CLASS as z, TREEGRID_CELL_HIGHLIGHT_COLOR as O } from "../constants/treeGrid.js";
4
- import { TREEGRID_INPUT_CELL_COLOR as Tt, TREEGRID_WARNING_CELL_COLOR as Gt } from "../constants/treeGrid.js";
5
- import { parseTreeGridXmlToJson as N } from "../components/OwpTreeGrid/internal/treeGridLayout.js";
6
- import { resolveTreeGridSelectedRows as U } from "../components/OwpTreeGrid/internal/treeGridSelection.js";
1
+ var M = Object.defineProperty;
2
+ var l = (e, t) => M(e, "name", { value: t, configurable: !0 });
3
+ import { TREEGRID_CELL_CHANGED_CLASS as X, TREEGRID_CELL_HIGHLIGHT_COLOR as p } from "../constants/treeGrid.js";
4
+ import { TREEGRID_INPUT_CELL_COLOR as _t, TREEGRID_WARNING_CELL_COLOR as Dt } from "../constants/treeGrid.js";
5
+ import { parseTreeGridXmlToJson as Q } from "../components/OwpTreeGrid/internal/treeGridLayout.js";
6
+ import { resolveTreeGridSelectedRows as g } from "../components/OwpTreeGrid/internal/treeGridSelection.js";
7
7
  import { emitTreeGridBodyRowsChanged as _ } from "./internal/treeGridBodyRowsEvent.js";
8
8
  import { isArray as D } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
9
- import { lowerCase as P } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/lowerCase.js";
10
- import { isPlainObject as y } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isPlainObject.js";
11
- import { get as W } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/get.js";
12
- import { isEmpty as Y } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
13
- import { without as M } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/without.js";
14
- const X = ["Added", "Changed"], Q = ["OWP", "IPX"], g = /^H{1,2}(?::m{1,2})?(?::s{1,2})?$/, B = "__owpAddedByAddTreeGridRowById", E = "__owpAddedRowHighlightColumns", L = "__owpAddedRowInitialValueKeys", v = "__owpAddedRowBaselineValues", G = "__owpCellStyleBaselineValues", h = "Selected", J = /* @__PURE__ */ l(({
9
+ import { lowerCase as J } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/string/lowerCase.js";
10
+ import { isPlainObject as h } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isPlainObject.js";
11
+ import { get as Z } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/get.js";
12
+ import { isEmpty as ee } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
13
+ import { without as L } from "../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/without.js";
14
+ const te = ["Added", "Changed"], re = ["OWP", "IPX"], ne = /^H{1,2}(?::m{1,2})?(?::s{1,2})?$/, F = "__owpAddedByAddTreeGridRowById", E = "__owpAddedRowHighlightColumns", $ = "__owpAddedRowInitialValueKeys", A = "__owpAddedRowInitialValues", K = "__owpAddedRowBaselineValues", G = "__owpCellStyleBaselineValues", y = "Selected", se = /* @__PURE__ */ l(({
15
15
  label: e
16
- }) => `${e} 필수 입력`, "DEFAULT_TREE_GRID_REQUIRED_CELL_MESSAGE_FACTORY"), Z = [
16
+ }) => `${e} 필수 입력`, "DEFAULT_TREE_GRID_REQUIRED_CELL_MESSAGE_FACTORY"), le = [
17
17
  "added"
18
- ], S = /* @__PURE__ */ l((e) => D(e) ? e.filter((t) => typeof t == "string" && t !== "") : [], "normalizeTreeGridStringValues"), A = S, p = /* @__PURE__ */ l((e) => {
19
- e && (e[B] = 1);
20
- }, "markTreeGridRowAddedById"), ee = /* @__PURE__ */ l((e) => {
21
- const t = e == null ? void 0 : e[B];
18
+ ], I = /* @__PURE__ */ l((e) => D(e) ? e.filter((t) => typeof t == "string" && t !== "") : [], "normalizeTreeGridStringValues"), S = I, ae = /* @__PURE__ */ l((e) => {
19
+ e && (e[F] = 1);
20
+ }, "markTreeGridRowAddedById"), ie = /* @__PURE__ */ l((e) => {
21
+ const t = e == null ? void 0 : e[F];
22
22
  return !!e && t !== 0 && t !== !1 && t !== void 0;
23
23
  }, "isTreeGridRowAddedById"), m = /* @__PURE__ */ l((e) => {
24
24
  const t = e == null ? void 0 : e.Added;
25
- return t === 1 || t === "1" || t === !0 || ee(e);
26
- }, "isTreeGridAddedRow"), te = /* @__PURE__ */ l((e) => {
25
+ return t === 1 || t === "1" || t === !0 || ie(e);
26
+ }, "isTreeGridAddedRow"), ce = /* @__PURE__ */ l((e) => {
27
27
  const t = e == null ? void 0 : e.Changed;
28
28
  return !m(e) && (t === 1 || t === "1" || t === !0);
29
- }, "isTreeGridChangedRow"), k = /* @__PURE__ */ l((e) => {
29
+ }, "isTreeGridChangedRow"), j = /* @__PURE__ */ l((e) => {
30
30
  const t = e == null ? void 0 : e.Deleted;
31
31
  return t === 1 || t === "1" || t === !0;
32
- }, "isTreeGridDeletedRow"), re = /* @__PURE__ */ l((e) => {
33
- const t = D(e) ? e : e ? [e] : Z;
32
+ }, "isTreeGridDeletedRow"), de = /* @__PURE__ */ l((e) => {
33
+ const t = D(e) ? e : e ? [e] : le;
34
34
  return t.includes("all") ? /* @__PURE__ */ new Set(["all"]) : new Set(
35
35
  t.filter(
36
36
  (r) => r === "added" || r === "changed"
37
37
  )
38
38
  );
39
- }, "normalizeTreeGridRequiredCellTargetRows"), ne = /* @__PURE__ */ l((e, t) => k(e) ? !1 : t.has("all") ? e.Kind === "Data" || m(e) : t.has("added") && m(e) || t.has("changed") && te(e), "shouldValidateTreeGridRequiredCellRow"), se = /* @__PURE__ */ l((e) => !!e && !k(e) && (e.Kind === "Data" || m(e)), "shouldValidateExplicitTreeGridRequiredCellRow"), le = /* @__PURE__ */ l((e, t) => {
39
+ }, "normalizeTreeGridRequiredCellTargetRows"), oe = /* @__PURE__ */ l((e, t) => j(e) ? !1 : t.has("all") ? e.Kind === "Data" || m(e) : t.has("added") && m(e) || t.has("changed") && ce(e), "shouldValidateTreeGridRequiredCellRow"), ue = /* @__PURE__ */ l((e) => !!e && !j(e) && (e.Kind === "Data" || m(e)), "shouldValidateExplicitTreeGridRequiredCellRow"), fe = /* @__PURE__ */ l((e, t) => {
40
40
  var r;
41
41
  if (t)
42
42
  return typeof t.id != "string" ? t : ((r = e.Rows) == null ? void 0 : r[t.id]) ?? t;
43
- }, "resolveLiveTreeGridRequiredCellRow"), ie = /* @__PURE__ */ l((e, t) => {
43
+ }, "resolveLiveTreeGridRequiredCellRow"), Re = /* @__PURE__ */ l((e, t) => {
44
44
  const r = /* @__PURE__ */ new Set(), n = [];
45
45
  return t.forEach((s) => {
46
- const i = le(e, s);
47
- !se(i) || r.has(i) || (r.add(i), n.push(i));
46
+ const a = fe(e, s);
47
+ !ue(a) || r.has(a) || (r.add(a), n.push(a));
48
48
  }), n;
49
- }, "normalizeExplicitTreeGridRequiredCellRows"), ae = /* @__PURE__ */ l((e, t) => {
49
+ }, "normalizeExplicitTreeGridRequiredCellRows"), Te = /* @__PURE__ */ l((e, t) => {
50
50
  if (t.rows !== void 0)
51
- return ie(e, t.rows);
52
- const r = re(t.targetRows);
51
+ return Re(e, t.rows);
52
+ const r = de(t.targetRows);
53
53
  return Object.values(e.Rows ?? {}).filter(
54
- (n) => ne(n, r)
54
+ (n) => oe(n, r)
55
55
  );
56
- }, "getTreeGridRequiredCellRows"), Qe = /* @__PURE__ */ l((e, t) => {
56
+ }, "getTreeGridRequiredCellRows"), rt = /* @__PURE__ */ l((e, t) => {
57
57
  if (!e || !t)
58
58
  return;
59
- const r = e, n = A(
59
+ const r = e, n = S(
60
60
  r[E]
61
61
  );
62
62
  n.includes(t) || (r[E] = [...n, t]);
63
- }, "appendTreeGridAddedRowHighlightColumn"), ge = /* @__PURE__ */ l((e, t) => {
63
+ }, "appendTreeGridAddedRowHighlightColumn"), nt = /* @__PURE__ */ l((e, t) => {
64
64
  if (!e || !t)
65
65
  return;
66
- const r = e, s = A(
66
+ const r = e, s = S(
67
67
  r[E]
68
- ).filter((i) => i !== t);
68
+ ).filter((a) => a !== t);
69
69
  if (s.length) {
70
70
  r[E] = s;
71
71
  return;
72
72
  }
73
73
  delete r[E];
74
- }, "removeTreeGridAddedRowHighlightColumn"), Je = /* @__PURE__ */ l((e) => A(
74
+ }, "removeTreeGridAddedRowHighlightColumn"), st = /* @__PURE__ */ l((e) => S(
75
75
  e == null ? void 0 : e[E]
76
- ), "getTreeGridAddedRowHighlightColumns"), F = /* @__PURE__ */ l((e, t, r) => {
77
- var i, a, c, d, f;
78
- const n = ((i = e.GetType) == null ? void 0 : i.call(e, t, r)) || ((c = (a = e.Cols) == null ? void 0 : a[r]) == null ? void 0 : c.Type) || "", s = ((d = e.GetValue) == null ? void 0 : d.call(e, t, r)) ?? t[r];
76
+ ), "getTreeGridAddedRowHighlightColumns"), O = /* @__PURE__ */ l((e, t, r) => {
77
+ var a, i, c, d, o;
78
+ const n = ((a = e.GetType) == null ? void 0 : a.call(e, t, r)) || ((c = (i = e.Cols) == null ? void 0 : i[r]) == null ? void 0 : c.Type) || "", s = ((d = e.GetValue) == null ? void 0 : d.call(e, t, r)) ?? t[r];
79
79
  if (n === "Enum" || n === "Select")
80
80
  return s == null ? "" : `${s}`;
81
81
  try {
82
- const R = (f = e.GetString) == null ? void 0 : f.call(e, t, r);
82
+ const R = (o = e.GetString) == null ? void 0 : o.call(e, t, r);
83
83
  if (R != null)
84
84
  return `${R}`;
85
85
  } catch {
86
86
  }
87
87
  return s == null ? "" : `${s}`;
88
- }, "getTreeGridCellComparableValue"), ce = /* @__PURE__ */ l((e, t) => {
88
+ }, "getTreeGridCellComparableValue"), Ge = /* @__PURE__ */ l((e, t) => {
89
89
  const r = Object.fromEntries(
90
90
  Object.keys(e.Cols ?? {}).map((n) => [
91
91
  n,
92
- F(e, t, n)
92
+ O(e, t, n)
93
93
  ])
94
94
  );
95
- t[v] = r;
96
- }, "markTreeGridAddedRowBaselineValues"), Ze = /* @__PURE__ */ l((e, t) => {
95
+ t[K] = r;
96
+ }, "markTreeGridAddedRowBaselineValues"), lt = /* @__PURE__ */ l((e, t) => {
97
97
  var r;
98
- return (r = e == null ? void 0 : e[v]) == null ? void 0 : r[t];
99
- }, "getTreeGridAddedRowBaselineValue"), de = /* @__PURE__ */ l((e, t, r) => {
98
+ return (r = e == null ? void 0 : e[K]) == null ? void 0 : r[t];
99
+ }, "getTreeGridAddedRowBaselineValue"), Ee = /* @__PURE__ */ l((e, t, r) => {
100
100
  var s;
101
101
  const n = t;
102
102
  n[G] ?? (n[G] = {}), !((s = n[G]) != null && s[r]) && (n[G][r] = {
103
103
  className: e.GetAttribute(t, r, "Class"),
104
104
  color: e.GetAttribute(t, r, "Color")
105
105
  });
106
- }, "preserveTreeGridCellStyleBaseline"), oe = /* @__PURE__ */ l((e, t) => {
106
+ }, "preserveTreeGridCellStyleBaseline"), Ce = /* @__PURE__ */ l((e, t) => {
107
107
  var r;
108
108
  return (r = e[G]) == null ? void 0 : r[t];
109
- }, "getTreeGridCellStyleBaseline"), ue = /* @__PURE__ */ l(async () => {
109
+ }, "getTreeGridCellStyleBaseline"), me = /* @__PURE__ */ l(async () => {
110
110
  const { exportTreeGridExcel: e } = await import("./treeGridExportExcelUtil.js");
111
111
  return e;
112
- }, "loadExportTreeGridExcel"), fe = /* @__PURE__ */ l((e) => Object.values((e == null ? void 0 : e.Rows) ?? {}).filter((t) => t.Kind === "Data"), "getDataRows"), Re = /* @__PURE__ */ l((e) => e != null && e.length ? e.map((t) => {
112
+ }, "loadExportTreeGridExcel"), he = /* @__PURE__ */ l((e) => Object.values((e == null ? void 0 : e.Rows) ?? {}).filter((t) => t.Kind === "Data"), "getDataRows"), ye = /* @__PURE__ */ l((e) => e != null && e.length ? e.map((t) => {
113
113
  if (typeof t == "string") {
114
114
  const n = t.trim();
115
115
  return n ? { key: n } : null;
116
116
  }
117
- if (!y(t) || typeof t.key != "string")
117
+ if (!h(t) || typeof t.key != "string")
118
118
  return null;
119
119
  const r = t.key.trim();
120
120
  return r ? {
@@ -122,135 +122,175 @@ const X = ["Added", "Changed"], Q = ["OWP", "IPX"], g = /^H{1,2}(?::m{1,2})?(?::
122
122
  label: typeof t.label == "string" ? t.label.trim() : void 0,
123
123
  message: typeof t.message == "string" ? t.message : void 0
124
124
  } : null;
125
- }).filter((t) => !!t) : [], "normalizeTreeGridRequiredCellColumns"), $ = /* @__PURE__ */ l((e, t, r) => {
125
+ }).filter((t) => !!t) : [], "normalizeTreeGridRequiredCellColumns"), w = /* @__PURE__ */ l((e, t, r) => {
126
126
  var s;
127
127
  const n = (s = e.CanEdit) == null ? void 0 : s.call(e, t, r);
128
128
  return n === 1 || n === "1" || n === !0;
129
- }, "isTreeGridEditableCell"), Te = /* @__PURE__ */ l((e, t, r) => {
130
- const n = Re(r.columns);
129
+ }, "isTreeGridEditableCell"), _e = /* @__PURE__ */ l((e, t, r) => {
130
+ const n = ye(r.columns);
131
131
  return n.length ? n.filter((s) => {
132
- var i;
133
- return !!((i = e.Cols) != null && i[s.key]);
134
- }) : r.editableOnly ? Object.keys(e.Cols ?? {}).filter((s) => ve(e, s) && $(e, t, s)).map((s) => ({ key: s })) : [];
135
- }, "getTreeGridRequiredCellColumns"), Ge = /* @__PURE__ */ l((e, t) => {
136
- var n, s, i;
132
+ var a;
133
+ return !!((a = e.Cols) != null && a[s.key]);
134
+ }) : r.editableOnly ? Object.keys(e.Cols ?? {}).filter((s) => b(e, s) && w(e, t, s)).map((s) => ({ key: s })) : [];
135
+ }, "getTreeGridRequiredCellColumns"), De = /* @__PURE__ */ l((e, t) => {
136
+ var n, s, a;
137
137
  if (t.label)
138
138
  return t.label;
139
139
  try {
140
- const a = (n = e.GetCaption) == null ? void 0 : n.call(e, t.key);
141
- if (a)
142
- return `${a}`.trim();
140
+ const i = (n = e.GetCaption) == null ? void 0 : n.call(e, t.key);
141
+ if (i)
142
+ return `${i}`.trim();
143
143
  } catch {
144
144
  }
145
- const r = (i = (s = e.Cols) == null ? void 0 : s[t.key]) == null ? void 0 : i.Caption;
145
+ const r = (a = (s = e.Cols) == null ? void 0 : s[t.key]) == null ? void 0 : a.Caption;
146
146
  return r ? `${r}`.trim() : t.key;
147
- }, "getTreeGridRequiredCellLabel"), Ee = /* @__PURE__ */ l((e, t, r) => t.message ? t.message : (r ?? J)(e), "getTreeGridRequiredCellMessage"), Ce = /* @__PURE__ */ l((e) => e.trim() === "", "isBlankTreeGridRequiredCellValue"), me = /* @__PURE__ */ l((e, t, r) => {
148
- !t || r.focusFirstError === !1 || (e.Focus(t.row, t.col), r.startEditFirstError === !0 && $(e, t.row, t.col) && e.StartEdit(t.row, t.col));
149
- }, "focusFirstTreeGridRequiredCellError"), C = /* @__PURE__ */ l((e) => typeof e == "string" && g.test(e.trim()), "isTreeGridTimeDateFormat"), x = /* @__PURE__ */ l((e, t, r) => {
150
- var i;
151
- const n = t, s = (i = e.Cols) == null ? void 0 : i[r];
147
+ }, "getTreeGridRequiredCellLabel"), Ae = /* @__PURE__ */ l((e, t, r) => t.message ? t.message : (r ?? se)(e), "getTreeGridRequiredCellMessage"), Ie = /* @__PURE__ */ l((e) => e.trim() === "", "isBlankTreeGridRequiredCellValue"), Se = /* @__PURE__ */ l((e, t, r) => {
148
+ !t || r.focusFirstError === !1 || (e.Focus(t.row, t.col), r.startEditFirstError === !0 && w(e, t.row, t.col) && e.StartEdit(t.row, t.col));
149
+ }, "focusFirstTreeGridRequiredCellError"), C = /* @__PURE__ */ l((e) => typeof e == "string" && ne.test(e.trim()), "isTreeGridTimeDateFormat"), x = /* @__PURE__ */ l((e, t, r) => {
150
+ var a;
151
+ const n = t, s = (a = e.Cols) == null ? void 0 : a[r];
152
152
  return (s == null ? void 0 : s.Type) === "Date" && (C(n[`${r}EditFormat`]) || C(n[`${r}Format`]) || C(s.EditFormat) || C(s.Format));
153
- }, "isTreeGridTimeDateColumn"), j = /* @__PURE__ */ l((e, t, r) => {
153
+ }, "isTreeGridTimeDateColumn"), q = /* @__PURE__ */ l((e, t, r) => {
154
154
  var s;
155
155
  const n = t[r];
156
156
  try {
157
- const i = (s = e.GetString) == null ? void 0 : s.call(e, t, r);
158
- if (i != null && `${i}` != "")
159
- return `${i}`;
157
+ const a = (s = e.GetString) == null ? void 0 : s.call(e, t, r);
158
+ if (a != null && `${a}` != "")
159
+ return `${a}`;
160
160
  } catch {
161
161
  }
162
162
  return n == null ? "" : `${n}`;
163
- }, "getTreeGridTimeDateDisplayValue"), ye = /* @__PURE__ */ l((e, t) => {
163
+ }, "getTreeGridTimeDateDisplayValue"), be = /* @__PURE__ */ l((e, t) => {
164
164
  const r = { ...t };
165
165
  return Object.keys(e.Cols ?? {}).forEach((n) => {
166
- x(e, t, n) && (r[n] = j(e, t, n));
166
+ x(e, t, n) && (r[n] = q(e, t, n));
167
167
  }), r;
168
- }, "normalizeTreeGridExternalRow"), w = /* @__PURE__ */ l((e, t) => t.map((r) => ye(e, r)), "normalizeTreeGridExternalRows"), H = /* @__PURE__ */ l((e) => e === 1 || e === !0 || e === "1" || e === "true", "isTreeGridExplicitEnabledConfigValue"), he = /* @__PURE__ */ l((e) => H(e.SelectingSingle), "isTreeGridSingleSelectionLayout"), _e = /* @__PURE__ */ l((e) => y(e) ? H(
169
- e[h]
170
- ) : !1, "isTreeGridSelectedInitialValue"), De = /* @__PURE__ */ l((e) => {
171
- if (!y(e))
168
+ }, "normalizeTreeGridExternalRow"), H = /* @__PURE__ */ l((e, t) => t.map((r) => be(e, r)), "normalizeTreeGridExternalRows"), k = /* @__PURE__ */ l((e) => e === 1 || e === !0 || e === "1" || e === "true", "isTreeGridExplicitEnabledConfigValue"), Ve = /* @__PURE__ */ l((e) => k(e.SelectingSingle), "isTreeGridSingleSelectionLayout"), Be = /* @__PURE__ */ l((e) => h(e) ? k(
169
+ e[y]
170
+ ) : !1, "isTreeGridSelectedInitialValue"), Le = /* @__PURE__ */ l((e) => {
171
+ if (!h(e))
172
172
  return e;
173
173
  const t = e;
174
- return h in t ? Object.fromEntries(
174
+ return y in t ? Object.fromEntries(
175
175
  Object.entries(t).filter(
176
- ([r]) => r !== h
176
+ ([r]) => r !== y
177
177
  )
178
178
  ) : e;
179
- }, "omitTreeGridSelectedInitialValue"), Se = /* @__PURE__ */ l((e, t) => {
179
+ }, "omitTreeGridSelectedInitialValue"), ve = /* @__PURE__ */ l((e, t) => {
180
180
  const r = (t == null ? void 0 : t.insertPosition) ?? "top", n = t == null ? void 0 : t.parent, s = t == null ? void 0 : t.anchorRow;
181
- let i = n ?? (s ? s.parentNode : null) ?? e.GetFirst(), a = null;
181
+ let a = n ?? (s ? s.parentNode : null) ?? e.GetFirst(), i = null;
182
182
  switch (r) {
183
183
  case "top":
184
- a = e.GetFirst();
184
+ i = e.GetFirst();
185
185
  break;
186
186
  case "last":
187
- i = e.GetNext(e.GetLast(), e.RowCount > 0 ? e.RowCount + 1 : 0), a = i;
187
+ a = e.GetNext(e.GetLast(), e.RowCount > 0 ? e.RowCount + 1 : 0), i = a;
188
188
  break;
189
189
  case "above":
190
- a = s ?? e.GetFirst();
190
+ i = s ?? e.GetFirst();
191
191
  break;
192
192
  case "below":
193
- a = (s == null ? void 0 : s.nextSibling) ?? e.GetFirst();
193
+ i = (s == null ? void 0 : s.nextSibling) ?? e.GetFirst();
194
194
  break;
195
195
  }
196
- return { resolvedParent: i, next: a };
197
- }, "resolveRowInsertionTarget"), Ae = /* @__PURE__ */ l((e, t, r) => {
198
- if (!y(r))
196
+ return { resolvedParent: a, next: i };
197
+ }, "resolveRowInsertionTarget"), Fe = /* @__PURE__ */ l((e, t, r) => {
198
+ if (!h(r))
199
199
  return;
200
- const n = Object.keys(r).filter(Boolean);
201
- t[L] = n, Object.entries(r).forEach(([s, i]) => {
202
- var a, c;
203
- if (((c = (a = e.Cols) == null ? void 0 : a[s]) == null ? void 0 : c.Type) === "Date" && typeof i == "string") {
204
- e.SetString(t, s, i, 0);
200
+ const n = r, s = Object.keys(n).filter(Boolean), a = t;
201
+ a[$] = s, a[A] = Object.fromEntries(
202
+ s.map((i) => [i, n[i]])
203
+ ), Object.entries(n).forEach(([i, c]) => {
204
+ var d, o;
205
+ if (((o = (d = e.Cols) == null ? void 0 : d[i]) == null ? void 0 : o.Type) === "Date" && typeof c == "string") {
206
+ e.SetString(t, i, c, 0);
205
207
  return;
206
208
  }
207
- t[s] = i;
209
+ t[i] = c;
208
210
  });
209
- }, "assignInitialRowValues"), be = /* @__PURE__ */ l((e, t, r) => {
210
- const n = S(r);
211
+ }, "assignInitialRowValues"), $e = /* @__PURE__ */ l((e, t, r) => {
212
+ const n = I(r);
211
213
  if (!n.length)
212
214
  return;
213
215
  const s = t;
214
- n.forEach((i) => {
215
- var a;
216
- (a = e.Cols) != null && a[i] && (s[`${i}CanEdit`] = 1);
216
+ n.forEach((a) => {
217
+ var i;
218
+ (i = e.Cols) != null && i[a] && (s[`${a}CanEdit`] = 1);
217
219
  });
218
- }, "assignEditableAddedRowColumns"), Ie = /* @__PURE__ */ l((e) => Q.some((t) => e.startsWith(t)), "isTreeGridDataKey"), Ve = /* @__PURE__ */ l((e, t) => {
220
+ }, "assignEditableAddedRowColumns"), Ke = /* @__PURE__ */ l((e) => re.some((t) => e.startsWith(t)), "isTreeGridDataKey"), z = /* @__PURE__ */ l((e, t) => {
219
221
  var r;
220
222
  return !!((r = e == null ? void 0 : e.Cols) != null && r[t]);
221
- }, "isTreeGridColumnDataKey"), Be = /* @__PURE__ */ l((e) => e != null && e !== "", "hasTreeGridUploadValue"), Le = /* @__PURE__ */ l((e) => e === 0 || e === !1 || e === "0", "isHiddenTreeGridValue"), ve = /* @__PURE__ */ l((e, t) => {
223
+ }, "isTreeGridColumnDataKey"), je = /* @__PURE__ */ l((e) => e != null && e !== "", "hasTreeGridUploadValue"), Oe = /* @__PURE__ */ l((e) => e === 0 || e === !1 || e === "0", "isHiddenTreeGridValue"), b = /* @__PURE__ */ l((e, t) => {
222
224
  var r, n;
223
- return !Le((n = (r = e == null ? void 0 : e.Cols) == null ? void 0 : r[t]) == null ? void 0 : n.Visible);
224
- }, "isVisibleTreeGridColumn"), ke = /* @__PURE__ */ l((e, t) => S(
225
- e == null ? void 0 : e[L]
226
- ).includes(t), "isTreeGridAddedRowInitialValueKey"), Fe = /* @__PURE__ */ l((e, t) => {
225
+ return !Oe((n = (r = e == null ? void 0 : e.Cols) == null ? void 0 : r[t]) == null ? void 0 : n.Visible);
226
+ }, "isVisibleTreeGridColumn"), U = /* @__PURE__ */ l((e) => I(
227
+ e == null ? void 0 : e[$]
228
+ ), "getTreeGridAddedRowInitialValueKeys"), N = /* @__PURE__ */ l((e, t) => U(e).includes(t), "isTreeGridAddedRowInitialValueKey"), we = /* @__PURE__ */ l((e, t) => {
229
+ const r = e == null ? void 0 : e[A];
230
+ return Object.prototype.hasOwnProperty.call(r ?? {}, t);
231
+ }, "hasTreeGridAddedRowInitialValue"), xe = /* @__PURE__ */ l((e, t) => {
232
+ var r;
233
+ return (r = e == null ? void 0 : e[A]) == null ? void 0 : r[t];
234
+ }, "getTreeGridAddedRowInitialValue"), qe = /* @__PURE__ */ l((e, t) => {
227
235
  var r;
228
236
  return typeof t.id == "string" ? (r = e == null ? void 0 : e.Rows) == null ? void 0 : r[t.id] : null;
229
- }, "getLiveTreeGridChangedRow"), $e = /* @__PURE__ */ l((e, t, r, n = !1) => Be(t[r]) ? Ve(e, r) || Ie(r) ? !0 : n && ke(Fe(e, t), r) : !1, "shouldIncludeTreeGridChangeDataKey"), V = /* @__PURE__ */ l((e, t, r, n = !1) => Object.fromEntries(
230
- M(Object.keys(t), ...r).filter(
231
- (s) => $e(e, t, s, n)
232
- ).map((s) => [s, t[s]])
233
- ), "normalizeTreeGridChangeRow"), xe = /* @__PURE__ */ l((e, t, r) => t.filter((n) => W(n, r) === "1" && n.Deleted !== "1").map(
234
- (n) => r === "Changed" ? V(e, n, ["id", "Changed"]) : V(e, n, ["id"], !0)
235
- ).filter((n) => !Y(n)), "getChangedRowsByStatus"), je = /* @__PURE__ */ l((e, t) => e ? t.map((r) => {
237
+ }, "getLiveTreeGridChangedRow"), P = /* @__PURE__ */ l((e, t, r, n) => !n || !z(e, r) || b(e, r) ? !1 : N(t, r), "shouldUseTreeGridAddedRowInitialValue"), W = /* @__PURE__ */ l((e, t, r, n, s) => P(e, r, n, s) && we(r, n) ? xe(r, n) : t[n], "resolveTreeGridChangeDataValue"), He = /* @__PURE__ */ l((e, t, r, n = !1) => {
238
+ const s = L(Object.keys(e), ...t);
239
+ return n ? L(
240
+ [.../* @__PURE__ */ new Set([...s, ...U(r)])],
241
+ ...t
242
+ ) : s;
243
+ }, "getTreeGridChangeDataKeys"), ke = /* @__PURE__ */ l((e, t, r, n, s = !1) => {
244
+ const a = P(
245
+ e,
246
+ r,
247
+ n,
248
+ s
249
+ ), i = W(
250
+ e,
251
+ t,
252
+ r,
253
+ n,
254
+ s
255
+ );
256
+ return !je(i) && !(a && i === "") ? !1 : z(e, n) ? !s || b(e, n) || a : Ke(n) ? !0 : N(r, n);
257
+ }, "shouldIncludeTreeGridChangeDataKey"), v = /* @__PURE__ */ l((e, t, r, n = !1, s = !1) => {
258
+ const a = n ? qe(e, t) : null;
259
+ return Object.fromEntries(
260
+ He(t, r, a, n).filter(
261
+ (i) => ke(
262
+ e,
263
+ t,
264
+ a,
265
+ i,
266
+ s
267
+ )
268
+ ).map((i) => [
269
+ i,
270
+ W(e, t, a, i, s)
271
+ ])
272
+ );
273
+ }, "normalizeTreeGridChangeRow"), ze = /* @__PURE__ */ l((e, t, r) => t.filter((n) => Z(n, r) === "1" && n.Deleted !== "1").map(
274
+ (n) => r === "Changed" ? v(e, n, ["id", "Changed"]) : v(e, n, ["id"], !0, !0)
275
+ ).filter((n) => !ee(n)), "getChangedRowsByStatus"), Ue = /* @__PURE__ */ l((e, t) => e ? t.map((r) => {
236
276
  const n = typeof r.id == "string" ? e.Rows[r.id] : null;
237
277
  if (!n)
238
278
  return r;
239
279
  const s = { ...r };
240
- return Object.keys(r).forEach((i) => {
241
- x(e, n, i) && (s[i] = j(e, n, i));
280
+ return Object.keys(r).forEach((a) => {
281
+ x(e, n, a) && (s[a] = q(e, n, a));
242
282
  }), s;
243
- }) : t, "normalizeTreeGridChangedRows"), we = /* @__PURE__ */ l((e) => {
283
+ }) : t, "normalizeTreeGridChangedRows"), Ne = /* @__PURE__ */ l((e) => {
244
284
  var t;
245
285
  try {
246
286
  (t = e == null ? void 0 : e.EndEdit) == null || t.call(e, 1);
247
287
  } catch {
248
288
  }
249
- }, "commitTreeGridActiveEdit"), u = /* @__PURE__ */ l((e) => Grids[e], "getTreeGridById"), pe = /* @__PURE__ */ l((e) => {
250
- const t = u(e);
251
- return t ? w(t, fe(t)) : [];
252
- }, "getTreeGridDataRowsById"), et = /* @__PURE__ */ l((e, t) => {
253
- const r = u(e);
289
+ }, "commitTreeGridActiveEdit"), f = /* @__PURE__ */ l((e) => Grids[e], "getTreeGridById"), at = /* @__PURE__ */ l((e) => {
290
+ const t = f(e);
291
+ return t ? H(t, he(t)) : [];
292
+ }, "getTreeGridDataRowsById"), it = /* @__PURE__ */ l((e, t) => {
293
+ const r = f(e);
254
294
  if (!r)
255
295
  return;
256
296
  const n = r.Data.Data;
@@ -261,80 +301,80 @@ const X = ["Added", "Changed"], Q = ["OWP", "IPX"], g = /^H{1,2}(?::m{1,2})?(?::
261
301
  }, r.ReloadBody(), window.setTimeout(() => {
262
302
  _(e);
263
303
  }, 0);
264
- }, "reloadTreeGridBodyById"), tt = /* @__PURE__ */ l((e, t) => {
265
- const r = u(e);
304
+ }, "reloadTreeGridBodyById"), ct = /* @__PURE__ */ l((e, t) => {
305
+ const r = f(e);
266
306
  if (!r)
267
307
  return;
268
- const n = t == null ? void 0 : t.canSelect, s = t == null ? void 0 : t.initialValues, i = t == null ? void 0 : t.editableColumns, a = he(r), c = !!n && a, d = c && _e(s), f = d ? De(s) : s;
269
- c && b(e);
270
- const { resolvedParent: R, next: T } = Se(r, t), o = r.AddRow(R, T, 1);
271
- p(o), Ae(r, o, f), ce(r, o), o.CanEdit = 1, o.CanDelete = 1, o.CanSelect = n ? 1 : 0, be(r, o, i), d && r.SelectRow(o, 1), r.Focus(o), r.RefreshRow(o), r.Calculate(1, 1), window.setTimeout(() => {
308
+ const n = t == null ? void 0 : t.canSelect, s = t == null ? void 0 : t.initialValues, a = t == null ? void 0 : t.editableColumns, i = Ve(r), c = !!n && i, d = c && Be(s), o = d ? Le(s) : s;
309
+ c && V(e);
310
+ const { resolvedParent: R, next: T } = ve(r, t), u = r.AddRow(R, T, 1);
311
+ ae(u), Fe(r, u, o), Ge(r, u), u.CanEdit = 1, u.CanDelete = 1, u.CanSelect = n ? 1 : 0, $e(r, u, a), d && r.SelectRow(u, 1), r.Focus(u), r.RefreshRow(u), r.Calculate(1, 1), window.setTimeout(() => {
272
312
  _(e);
273
313
  }, 0);
274
- }, "addTreeGridRowById"), rt = /* @__PURE__ */ l((e, t) => {
275
- const r = u(e);
314
+ }, "addTreeGridRowById"), dt = /* @__PURE__ */ l((e, t) => {
315
+ const r = f(e);
276
316
  if (!r)
277
317
  return { valid: !1, errors: [] };
278
- const n = ae(r, t), s = [], i = t.refresh === !1 ? 0 : 1;
318
+ const n = Te(r, t), s = [], a = t.refresh === !1 ? 0 : 1;
279
319
  n.forEach((c) => {
280
- Te(r, c, t).forEach((d) => {
281
- const f = d.key, R = F(r, c, f), T = Ge(r, d), o = {
320
+ _e(r, c, t).forEach((d) => {
321
+ const o = d.key, R = O(r, c, o), T = De(r, d), u = {
282
322
  grid: r,
283
323
  row: c,
284
- col: f,
285
- key: f,
324
+ col: o,
325
+ key: o,
286
326
  label: T,
287
327
  value: R
288
328
  };
289
- if (!Ce(R)) {
290
- r.SetAttribute(c, f, "Error", "", i);
329
+ if (!Ie(R)) {
330
+ r.SetAttribute(c, o, "Error", "", a);
291
331
  return;
292
332
  }
293
- const I = Ee(
294
- o,
333
+ const B = Ae(
334
+ u,
295
335
  d,
296
336
  t.messageFactory
297
- ), K = { ...o, message: I };
298
- r.SetAttribute(c, f, "Error", I, i), s.push(K);
337
+ ), Y = { ...u, message: B };
338
+ r.SetAttribute(c, o, "Error", B, a), s.push(Y);
299
339
  });
300
340
  });
301
- const a = s[0];
302
- return me(r, a, t), {
303
- valid: !a,
341
+ const i = s[0];
342
+ return Se(r, i, t), {
343
+ valid: !i,
304
344
  errors: s,
305
- firstError: a
345
+ firstError: i
306
346
  };
307
- }, "validateTreeGridRequiredCellsById"), nt = /* @__PURE__ */ l((e) => {
308
- const t = u(e);
309
- we(t);
310
- const r = N(t == null ? void 0 : t.GetXmlData("changes,allcols,nogrid,noio"));
347
+ }, "validateTreeGridRequiredCellsById"), ot = /* @__PURE__ */ l((e) => {
348
+ const t = f(e);
349
+ Ne(t);
350
+ const r = Q(t == null ? void 0 : t.GetXmlData("changes,allcols,nogrid,noio"));
311
351
  return D(r) ? Object.fromEntries(
312
- X.map((n) => [
313
- P(n),
314
- xe(
352
+ te.map((n) => [
353
+ J(n),
354
+ ze(
315
355
  t,
316
- je(t, r),
356
+ Ue(t, r),
317
357
  n
318
358
  )
319
359
  ])
320
360
  ) : { added: [], changed: [] };
321
- }, "getTreeGridRowChangesById"), st = /* @__PURE__ */ l((e, t) => {
322
- const r = u(e);
323
- r && ue().then(
361
+ }, "getTreeGridRowChangesById"), ut = /* @__PURE__ */ l((e, t) => {
362
+ const r = f(e);
363
+ r && me().then(
324
364
  (n) => n(r, { exportName: t ?? "" })
325
365
  );
326
- }, "exportTreeGridToExcelById"), lt = /* @__PURE__ */ l((e, t) => {
327
- const r = u(e), n = r == null ? void 0 : r.GetSelRows();
366
+ }, "exportTreeGridToExcelById"), ft = /* @__PURE__ */ l((e, t) => {
367
+ const r = f(e), n = r == null ? void 0 : r.GetSelRows();
328
368
  if (!r || !n)
329
369
  return [];
330
- const s = U(
370
+ const s = g(
331
371
  r,
332
372
  n,
333
373
  t
334
374
  );
335
- return w(r, s);
336
- }, "getTreeGridSelectedRowsById"), it = /* @__PURE__ */ l((e, t) => {
337
- const r = u(e);
375
+ return H(r, s);
376
+ }, "getTreeGridSelectedRowsById"), Rt = /* @__PURE__ */ l((e, t) => {
377
+ const r = f(e);
338
378
  if (!r || !(t != null && t.targetKey))
339
379
  return;
340
380
  const n = t == null ? void 0 : t.targetKey;
@@ -343,66 +383,66 @@ const X = ["Added", "Changed"], Q = ["OWP", "IPX"], g = /^H{1,2}(?::m{1,2})?(?::
343
383
  return;
344
384
  }
345
385
  r.HideCol(n);
346
- }, "setTreeGridColumnVisibilityById"), at = /* @__PURE__ */ l((e, t) => {
347
- const r = u(e), n = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
348
- !r || !n || !s || (de(r, n, s), r.SetValue(n, `${s}Class`, z), r.SetValue(n, `${s}Color`, t.backgroundColor ?? O), t.refresh !== !1 && r.RefreshCell(n, s));
349
- }, "highlightTreeGridCellById"), ct = /* @__PURE__ */ l((e, t) => {
350
- const r = u(e), n = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
386
+ }, "setTreeGridColumnVisibilityById"), Tt = /* @__PURE__ */ l((e, t) => {
387
+ const r = f(e), n = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
388
+ !r || !n || !s || (Ee(r, n, s), r.SetValue(n, `${s}Class`, X), r.SetValue(n, `${s}Color`, t.backgroundColor ?? p), t.refresh !== !1 && r.RefreshCell(n, s));
389
+ }, "highlightTreeGridCellById"), Gt = /* @__PURE__ */ l((e, t) => {
390
+ const r = f(e), n = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
351
391
  if (!r || !n || !s)
352
392
  return;
353
- const i = oe(n, s);
354
- r.SetValue(n, `${s}Class`, (i == null ? void 0 : i.className) ?? ""), r.SetValue(n, `${s}Color`, (i == null ? void 0 : i.color) ?? ""), r.RefreshCell(n, s);
355
- }, "clearTreeGridCellHighlightById"), b = /* @__PURE__ */ l((e) => {
356
- const t = u(e);
393
+ const a = Ce(n, s);
394
+ r.SetValue(n, `${s}Class`, (a == null ? void 0 : a.className) ?? ""), r.SetValue(n, `${s}Color`, (a == null ? void 0 : a.color) ?? ""), r.RefreshCell(n, s);
395
+ }, "clearTreeGridCellHighlightById"), V = /* @__PURE__ */ l((e) => {
396
+ const t = f(e);
357
397
  t && t.ActionDeselectAll(1, 0);
358
- }, "resetTreeGridSelectionById"), dt = /* @__PURE__ */ l((e) => {
359
- e.forEach(b);
360
- }, "resetTreeGridSelectionsByIds"), He = /* @__PURE__ */ l((e) => {
361
- const t = u(e);
362
- t && (t.ActionUndoAll(1, 0), b(e), t.Calculate(1, 1), window.setTimeout(() => {
398
+ }, "resetTreeGridSelectionById"), Et = /* @__PURE__ */ l((e) => {
399
+ e.forEach(V);
400
+ }, "resetTreeGridSelectionsByIds"), Pe = /* @__PURE__ */ l((e) => {
401
+ const t = f(e);
402
+ t && (t.ActionUndoAll(1, 0), V(e), t.Calculate(1, 1), window.setTimeout(() => {
363
403
  _(e);
364
404
  }, 0));
365
- }, "resetTreeGridChangesById"), ot = /* @__PURE__ */ l((e) => {
366
- e.forEach(He);
367
- }, "resetTreeGridChangesByIds"), ut = /* @__PURE__ */ l((e, t, r, n, s) => {
405
+ }, "resetTreeGridChangesById"), Ct = /* @__PURE__ */ l((e) => {
406
+ e.forEach(Pe);
407
+ }, "resetTreeGridChangesByIds"), mt = /* @__PURE__ */ l((e, t, r, n, s) => {
368
408
  if (!(r != null && r.length))
369
409
  return;
370
- const i = u(e);
371
- if (!i)
410
+ const a = f(e);
411
+ if (!a)
372
412
  return;
373
- const a = r.map((d) => {
374
- const f = d;
375
- return `${s.map((T) => f[T]).find((T) => T != null && T !== "") ?? ""}`;
413
+ const i = r.map((d) => {
414
+ const o = d;
415
+ return `${s.map((T) => o[T]).find((T) => T != null && T !== "") ?? ""}`;
376
416
  }).join("|"), c = r.map((d) => `${d[n] ?? ""}`).join("|");
377
- i.SetAttribute(null, t, "Type", "Enum", 0, 0), i.SetAttribute(null, t, "Enum", `|${a}`, 0, 0), i.SetAttribute(null, t, "EnumKeys", `|${c}`, 1, 0);
417
+ a.SetAttribute(null, t, "Type", "Enum", 0, 0), a.SetAttribute(null, t, "Enum", `|${i}`, 0, 0), a.SetAttribute(null, t, "EnumKeys", `|${c}`, 1, 0);
378
418
  }, "setTreeGridColumnEnumOptionsById");
379
419
  export {
380
- z as TREEGRID_CELL_CHANGED_CLASS,
381
- O as TREEGRID_CELL_HIGHLIGHT_COLOR,
382
- Tt as TREEGRID_INPUT_CELL_COLOR,
383
- Gt as TREEGRID_WARNING_CELL_COLOR,
384
- tt as addTreeGridRowById,
385
- Qe as appendTreeGridAddedRowHighlightColumn,
386
- ct as clearTreeGridCellHighlightById,
387
- st as exportTreeGridToExcelById,
388
- Ze as getTreeGridAddedRowBaselineValue,
389
- Je as getTreeGridAddedRowHighlightColumns,
390
- u as getTreeGridById,
391
- F as getTreeGridCellComparableValue,
392
- pe as getTreeGridDataRowsById,
393
- nt as getTreeGridRowChangesById,
394
- lt as getTreeGridSelectedRowsById,
395
- at as highlightTreeGridCellById,
396
- ee as isTreeGridRowAddedById,
397
- w as normalizeTreeGridExternalRows,
398
- et as reloadTreeGridBodyById,
399
- ge as removeTreeGridAddedRowHighlightColumn,
400
- He as resetTreeGridChangesById,
401
- ot as resetTreeGridChangesByIds,
402
- b as resetTreeGridSelectionById,
403
- dt as resetTreeGridSelectionsByIds,
404
- ut as setTreeGridColumnEnumOptionsById,
405
- it as setTreeGridColumnVisibilityById,
406
- rt as validateTreeGridRequiredCellsById
420
+ X as TREEGRID_CELL_CHANGED_CLASS,
421
+ p as TREEGRID_CELL_HIGHLIGHT_COLOR,
422
+ _t as TREEGRID_INPUT_CELL_COLOR,
423
+ Dt as TREEGRID_WARNING_CELL_COLOR,
424
+ ct as addTreeGridRowById,
425
+ rt as appendTreeGridAddedRowHighlightColumn,
426
+ Gt as clearTreeGridCellHighlightById,
427
+ ut as exportTreeGridToExcelById,
428
+ lt as getTreeGridAddedRowBaselineValue,
429
+ st as getTreeGridAddedRowHighlightColumns,
430
+ f as getTreeGridById,
431
+ O as getTreeGridCellComparableValue,
432
+ at as getTreeGridDataRowsById,
433
+ ot as getTreeGridRowChangesById,
434
+ ft as getTreeGridSelectedRowsById,
435
+ Tt as highlightTreeGridCellById,
436
+ ie as isTreeGridRowAddedById,
437
+ H as normalizeTreeGridExternalRows,
438
+ it as reloadTreeGridBodyById,
439
+ nt as removeTreeGridAddedRowHighlightColumn,
440
+ Pe as resetTreeGridChangesById,
441
+ Ct as resetTreeGridChangesByIds,
442
+ V as resetTreeGridSelectionById,
443
+ Et as resetTreeGridSelectionsByIds,
444
+ mt as setTreeGridColumnEnumOptionsById,
445
+ Rt as setTreeGridColumnVisibilityById,
446
+ dt as validateTreeGridRequiredCellsById
407
447
  };
408
448
  //# sourceMappingURL=treeGridUtil.js.map