@owp/core 2.5.29 → 2.5.31

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