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