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