open-grid 1.5.1 → 1.6.0
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/CHANGELOG.md +460 -418
- package/README.ja.md +39 -0
- package/README.md +39 -0
- package/README.zh.md +39 -0
- package/dist/{OpenGrid-CT9bV6On.cjs → OpenGrid-DgZtbVD0.cjs} +343 -338
- package/dist/{OpenGrid-DACnZdEy.js → OpenGrid-E11B7Xa7.js} +782 -777
- package/dist/angular/fesm2022/open-grid-angular.mjs +247 -0
- package/dist/angular/index.d.ts +5 -0
- package/dist/angular/lib/open-grid.component.d.ts +97 -0
- package/dist/angular/public-api.d.ts +6 -0
- package/dist/{index-Brfso4Ry.cjs → index-B_e5BXnW.cjs} +2 -2
- package/dist/{index-al9Mbv3E.js → index-Brnev66-.js} +2 -2
- package/dist/open-grid-base.css +4 -4
- package/dist/open-grid-header.cjs +4 -4
- package/dist/open-grid-header.css +21 -21
- package/dist/open-grid-header.js +4 -4
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-skins.css +2 -2
- package/dist/open-grid-themes.css +48 -48
- package/dist/open-grid-typography.cjs +2 -2
- package/dist/open-grid-typography.js +2 -2
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/core/DetailManager.d.ts +1 -1
- package/dist/types/core/ExportManager.d.ts +7 -0
- package/dist/types/core/ExtensionPointRegistry.d.ts +2 -2
- package/dist/types/core/OpenGrid.d.ts +14 -9
- package/dist/types/core/appearance/AppearanceAxis.d.ts +54 -6
- package/dist/types/core/appearance/HeaderRegistry.d.ts +213 -21
- package/dist/types/core/appearance/TypographyRegistry.d.ts +63 -3
- package/dist/types/core/chart/DataExtractor.d.ts +1 -1
- package/dist/types/core/detail/DetailGlyph.d.ts +3 -3
- package/dist/types/core/types.d.ts +9 -9
- package/dist/types/header/index.d.ts +146 -6
- package/dist/types/typography/index.d.ts +134 -4
- package/package.json +42 -13
- package/dist/OpenGrid-CT9bV6On.cjs.map +0 -1
- package/dist/OpenGrid-DACnZdEy.js.map +0 -1
- package/dist/Registry-CPJYOqCn.js.map +0 -1
- package/dist/Registry-D74ZmdDz.cjs.map +0 -1
- package/dist/index-Brfso4Ry.cjs.map +0 -1
- package/dist/index-CeJ-0-80.cjs.map +0 -1
- package/dist/index-DnarQ4eR.js.map +0 -1
- package/dist/index-al9Mbv3E.js.map +0 -1
- package/dist/open-grid-header.cjs.map +0 -1
- package/dist/open-grid-header.js.map +0 -1
- package/dist/open-grid-react.cjs.map +0 -1
- package/dist/open-grid-react.js.map +0 -1
- package/dist/open-grid-typography.cjs.map +0 -1
- package/dist/open-grid-typography.js.map +0 -1
- package/dist/open-grid-vue.cjs.map +0 -1
- package/dist/open-grid-vue.js.map +0 -1
- package/dist/open-grid.cjs.map +0 -1
- package/dist/open-grid.js.map +0 -1
- package/dist/xlsx.min-BQ1o3sB6.cjs.map +0 -1
- package/dist/xlsx.min-Bbz2ZypC.js.map +0 -1
|
@@ -318,8 +318,8 @@ class FilterPanel {
|
|
|
318
318
|
a.style.cssText = "flex:1;padding:3px 4px;border:1px solid var(--og-border-color,#e0e0e0);border-radius:var(--og-radius-md,3px);font-size:12px;";
|
|
319
319
|
const l = [{ label: this._t("filter.opContains"), value: "contains" }, { label: this._t("filter.opEq"), value: "=" }, { label: this._t("filter.opNe"), value: "!=" }, { label: this._t("filter.opStartsWith"), value: "startsWith" }, { label: this._t("filter.opEndsWith"), value: "endsWith" }, { label: this._t("filter.opGt"), value: ">" }, { label: this._t("filter.opLt"), value: "<" }, { label: this._t("filter.opGte"), value: ">=" }, { label: this._t("filter.opLte"), value: "<=" }];
|
|
320
320
|
for (const g of l) {
|
|
321
|
-
const
|
|
322
|
-
|
|
321
|
+
const m = document.createElement("option");
|
|
322
|
+
m.value = g.value, m.textContent = g.label, a.appendChild(m);
|
|
323
323
|
}
|
|
324
324
|
i[0] && (a.value = i[0].operator), r.appendChild(a), this._el.appendChild(r);
|
|
325
325
|
const d = document.createElement("input");
|
|
@@ -455,8 +455,8 @@ class OGDecimal {
|
|
|
455
455
|
if (i < e) s = s * 10n ** BigInt(e - i);
|
|
456
456
|
else if (i > e) {
|
|
457
457
|
const h = 10n ** BigInt(i - e), u = h / 2n, p = s < 0n, f = p ? -s : s, g = f % h;
|
|
458
|
-
let
|
|
459
|
-
g >= u && (
|
|
458
|
+
let m = f / h;
|
|
459
|
+
g >= u && (m += 1n), s = p ? -m : m;
|
|
460
460
|
}
|
|
461
461
|
i = e;
|
|
462
462
|
const o = s < 0n, a = (o ? -s : s).toString().padStart(e + 1, "0"), l = a.slice(0, a.length - e) || "0", d = e > 0 ? "." + a.slice(a.length - e) : "";
|
|
@@ -749,8 +749,8 @@ function formatNumber(n, e, s, i, o, r) {
|
|
|
749
749
|
if (!e) return s != null ? a.toFixed(s) : String(a);
|
|
750
750
|
const l = e.indexOf(";"), d = l >= 0 ? e.slice(l + 1) : null, c = a < 0 && d != null ? d : l >= 0 ? e.slice(0, l) : e, h = a < 0 && d != null ? Math.abs(a) : a, u = c.match(/[#0][#0,]*(?:\.[#0]+)?/);
|
|
751
751
|
if (!u) return String(a);
|
|
752
|
-
const p = u[0], f = c.slice(0, u.index), g = c.slice(u.index + p.length),
|
|
753
|
-
return f +
|
|
752
|
+
const p = u[0], f = c.slice(0, u.index), g = c.slice(u.index + p.length), m = p.includes(","), w = p.includes(".") ? p.split(".")[1].length : s ?? 0, _ = h.toLocaleString("ko-KR", { minimumFractionDigits: w, maximumFractionDigits: w, useGrouping: m });
|
|
753
|
+
return f + _ + g;
|
|
754
754
|
}
|
|
755
755
|
function formatDate(n, e = "yyyy-MM-dd", s, i) {
|
|
756
756
|
if (!n) return "";
|
|
@@ -947,13 +947,13 @@ class SparklineRenderer {
|
|
|
947
947
|
const h = Math.max(...i, 1), u = Math.min(...i, 0), p = h - u || 1, f = i.length;
|
|
948
948
|
if (l === "bar") {
|
|
949
949
|
const g = o / f;
|
|
950
|
-
i.forEach((
|
|
951
|
-
const
|
|
952
|
-
c.fillStyle = a, c.fillRect(w * g + 1, r -
|
|
950
|
+
i.forEach((m, w) => {
|
|
951
|
+
const _ = (m - u) / p * (r - 2);
|
|
952
|
+
c.fillStyle = a, c.fillRect(w * g + 1, r - _ - 1, g - 2, _);
|
|
953
953
|
});
|
|
954
954
|
} else {
|
|
955
|
-
const g = i.map((
|
|
956
|
-
l === "area" && (c.fillStyle = a + "33", c.beginPath(), c.moveTo(g[0].x, r), g.forEach((
|
|
955
|
+
const g = i.map((m, w) => ({ x: w / (f - 1 || 1) * o, y: r - (m - u) / p * (r - 4) - 2 }));
|
|
956
|
+
l === "area" && (c.fillStyle = a + "33", c.beginPath(), c.moveTo(g[0].x, r), g.forEach((m) => c.lineTo(m.x, m.y)), c.lineTo(g[g.length - 1].x, r), c.closePath(), c.fill()), c.strokeStyle = a, c.lineWidth = 1.5, c.beginPath(), g.forEach((m, w) => w === 0 ? c.moveTo(m.x, m.y) : c.lineTo(m.x, m.y)), c.stroke();
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
return s.appendChild(d), s;
|
|
@@ -1095,299 +1095,299 @@ class GridRenderer {
|
|
|
1095
1095
|
const a = this._ap, l = r._frozenCount ?? 0, d = !!((_a = r.masterDetail) == null ? void 0 : _a.enabled) && (((_b = r.masterDetail) == null ? void 0 : _b.toggle) ?? "expander-col") === "expander-col", c = 28;
|
|
1096
1096
|
let h = 0;
|
|
1097
1097
|
r.stateColumn && (h += 24), r.draggable && (h += 18), r.rowNumber && (h += 44), r.checkColumn && (h += 36), d && (h += c);
|
|
1098
|
-
const u = h + s.reduce((w,
|
|
1098
|
+
const u = h + s.reduce((w, _, y) => w + (i[y] ?? r.defaultColumnWidth), 0);
|
|
1099
1099
|
this._header.style.background = "var(--og-header-bg,#f5f5f5)";
|
|
1100
1100
|
const p = _el("table", "og-header-table");
|
|
1101
1101
|
p.setAttribute("role", "presentation"), p.style.cssText = `table-layout:fixed;border-collapse:collapse;border-spacing:0;margin:0;width:${u}px;background:var(--og-header-bg,#f5f5f5);`;
|
|
1102
1102
|
const f = e.length;
|
|
1103
1103
|
let g = 0;
|
|
1104
|
-
const
|
|
1104
|
+
const m = (w, _, y, v = "") => {
|
|
1105
1105
|
const R = _el("th", `og-header-cell og-extra-col ${v}`);
|
|
1106
|
-
R.setAttribute("rowspan", String(f)), R.textContent = y, _style(R, { width: `${
|
|
1106
|
+
R.setAttribute("rowspan", String(f)), R.textContent = y, _style(R, { width: `${_}px`, minWidth: `${_}px`, textAlign: "center", borderRight: a.border(), borderBottom: a.border(), borderTop: "0", borderLeft: "0", lineHeight: "normal", verticalAlign: "middle", padding: "0", fontSize: "11px", color: "#999", userSelect: "none", boxSizing: "border-box", background: "var(--og-header-bg,#f5f5f5)" }), l > 0 && (R.style.position = "sticky", R.style.left = `${g}px`, R.style.zIndex = "4"), g += _, w.appendChild(R);
|
|
1107
1107
|
};
|
|
1108
1108
|
for (let w = 0; w < e.length; w++) {
|
|
1109
|
-
const
|
|
1110
|
-
if (
|
|
1111
|
-
if (r.stateColumn && _
|
|
1109
|
+
const _ = _el("tr", "og-header-row");
|
|
1110
|
+
if (_.style.height = `${r.headerHeight}px`, w === 0) {
|
|
1111
|
+
if (r.stateColumn && m(_, 24, ""), r.draggable && m(_, 18, ""), r.rowNumber && m(_, 44, "No"), r.checkColumn) {
|
|
1112
1112
|
const y = _el("th", "og-header-cell og-extra-col");
|
|
1113
1113
|
y.setAttribute("rowspan", String(f)), y.style.cssText = `width:36px;min-width:36px;text-align:center;border-right:${a.border()};border-bottom:${a.border()};border-top:0;border-left:0;line-height:normal;vertical-align:middle;background:var(--og-header-bg,#f5f5f5);box-sizing:border-box;`, l > 0 && (y.style.position = "sticky", y.style.left = `${g}px`, y.style.zIndex = "4"), g += 36;
|
|
1114
1114
|
const v = document.createElement("input");
|
|
1115
|
-
v.type = "checkbox", v.setAttribute("aria-label", this._t("row.selectAllAria")), v.style.cssText = "width:16px;height:16px;", v.addEventListener("change", () => this._cbs.onAllCheck(v.checked)), y.appendChild(v),
|
|
1115
|
+
v.type = "checkbox", v.setAttribute("aria-label", this._t("row.selectAllAria")), v.style.cssText = "width:16px;height:16px;", v.addEventListener("change", () => this._cbs.onAllCheck(v.checked)), y.appendChild(v), _.appendChild(y);
|
|
1116
1116
|
}
|
|
1117
|
-
d && _
|
|
1117
|
+
d && m(_, c, "", "og-detail-toggle-col");
|
|
1118
1118
|
}
|
|
1119
1119
|
for (const y of e[w] ?? []) {
|
|
1120
1120
|
const v = _el("th", "og-header-cell"), R = y.column;
|
|
1121
1121
|
y.colSpan > 1 && (v.colSpan = y.colSpan), y.rowSpan > 1 && (v.rowSpan = y.rowSpan);
|
|
1122
|
-
const
|
|
1122
|
+
const F = y.colSpan === 1 ? s.findIndex((M) => M.field === R.field) : -1;
|
|
1123
1123
|
if (y.colSpan === 1) {
|
|
1124
|
-
const M =
|
|
1124
|
+
const M = F >= 0 ? i[F] ?? r.defaultColumnWidth : R.width ?? r.defaultColumnWidth;
|
|
1125
1125
|
v.style.width = `${M}px`, v.style.minWidth = `${M}px`;
|
|
1126
1126
|
}
|
|
1127
|
-
const S = o.find((M) => M.field === R.field),
|
|
1128
|
-
if (v.setAttribute("role", "columnheader"), v.setAttribute("scope", "col"),
|
|
1127
|
+
const S = o.find((M) => M.field === R.field), D = R.sortable !== false && r.sortable && y.colSpan === 1;
|
|
1128
|
+
if (v.setAttribute("role", "columnheader"), v.setAttribute("scope", "col"), D && (v.setAttribute("aria-sort", S ? S.dir === "asc" ? "ascending" : "descending" : "none"), v.tabIndex = F === 0 ? 0 : -1, v.addEventListener("keydown", (M) => {
|
|
1129
1129
|
if (M.key === "Enter" || M.key === " ") M.preventDefault(), this._cbs.onHeaderClick(R.field, M.shiftKey);
|
|
1130
1130
|
else if (M.key === "ArrowRight") {
|
|
1131
1131
|
M.preventDefault();
|
|
1132
|
-
const
|
|
1133
|
-
(
|
|
1132
|
+
const A = v.nextElementSibling;
|
|
1133
|
+
(A == null ? void 0 : A.tagName) === "TH" && A.focus();
|
|
1134
1134
|
} else if (M.key === "ArrowLeft") {
|
|
1135
1135
|
M.preventDefault();
|
|
1136
|
-
const
|
|
1137
|
-
(
|
|
1136
|
+
const A = v.previousElementSibling;
|
|
1137
|
+
(A == null ? void 0 : A.tagName) === "TH" && A.focus();
|
|
1138
1138
|
}
|
|
1139
|
-
})),
|
|
1139
|
+
})), F >= 0 && F < l) {
|
|
1140
1140
|
let M = 0;
|
|
1141
1141
|
r.stateColumn && (M += 24), r.draggable && (M += 18), r.rowNumber && (M += 44), r.checkColumn && (M += 36), d && (M += c);
|
|
1142
|
-
for (let
|
|
1143
|
-
v.classList.add("og-frozen"),
|
|
1142
|
+
for (let A = 0; A < F; A++) M += i[A] ?? r.defaultColumnWidth;
|
|
1143
|
+
v.classList.add("og-frozen"), F === l - 1 && v.classList.add("og-frozen-last"), v.style.left = `${M}px`;
|
|
1144
1144
|
}
|
|
1145
|
-
const
|
|
1145
|
+
const I = R.header ?? R.field, T = typeof I == "string" && I.indexOf(`
|
|
1146
1146
|
`) >= 0, C = R.headerWrap === true || T;
|
|
1147
|
-
_style(v, { padding: "4px 8px", boxSizing: "border-box", background: "var(--og-header-bg)", color: "var(--og-header-color)", lineHeight: C ? "1.3" : "normal", verticalAlign: "middle", fontSize: "var(--og-font-size)", textAlign: R.headerAlign ?? "center", borderTop: "0", borderLeft: "0", borderRight: a.border(), borderBottom: a.border(), userSelect: "none", cursor:
|
|
1148
|
-
const
|
|
1149
|
-
if (C ? (
|
|
1150
|
-
`).forEach((
|
|
1151
|
-
H > 0 &&
|
|
1152
|
-
})) : (
|
|
1147
|
+
_style(v, { padding: "4px 8px", boxSizing: "border-box", background: "var(--og-header-bg)", color: "var(--og-header-color)", lineHeight: C ? "1.3" : "normal", verticalAlign: "middle", fontSize: "var(--og-font-size)", textAlign: R.headerAlign ?? "center", borderTop: "0", borderLeft: "0", borderRight: a.border(), borderBottom: a.border(), userSelect: "none", cursor: D ? "pointer" : "default", whiteSpace: C ? "normal" : "nowrap", overflow: C ? "visible" : "hidden", textOverflow: C ? "clip" : "ellipsis", wordBreak: C ? "break-word" : "normal", position: "relative" }), v.title = (typeof R.tooltip == "string" ? R.tooltip : I) ?? "";
|
|
1148
|
+
const L = _el("span");
|
|
1149
|
+
if (C ? (L.style.cssText = "overflow:visible;text-overflow:clip;white-space:normal;word-break:break-word;", String(I).split(`
|
|
1150
|
+
`).forEach((A, H) => {
|
|
1151
|
+
H > 0 && L.appendChild(document.createElement("br")), L.appendChild(document.createTextNode(A));
|
|
1152
|
+
})) : (L.textContent = I, L.style.cssText = "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"), v.appendChild(L), S) {
|
|
1153
1153
|
v.classList.add("og-sorted");
|
|
1154
1154
|
const M = _el("span", "og-sort-icon");
|
|
1155
1155
|
M.textContent = S.dir === "asc" ? " ↑" : " ↓", v.appendChild(M);
|
|
1156
1156
|
}
|
|
1157
1157
|
if (R.filterable !== false && r.filterable && y.colSpan === 1) {
|
|
1158
|
-
const M = _el("span", "og-filter-icon"),
|
|
1159
|
-
M.textContent =
|
|
1158
|
+
const M = _el("span", "og-filter-icon"), A = (((_d = (_c = r._activeFilters) == null ? void 0 : _c[R.field]) == null ? void 0 : _d.length) ?? 0) > 0;
|
|
1159
|
+
M.textContent = A ? "⊿" : "▿", M.title = this._t("grid.filterTooltip"), M.style.cssText = "margin-left:3px;cursor:pointer;font-size:10px;opacity:0.6;", A && M.classList.add("og-filter-icon--active"), M.addEventListener("click", (H) => {
|
|
1160
1160
|
H.stopPropagation(), this._cbs.onFilterIconClick(R.field, M);
|
|
1161
1161
|
}), v.appendChild(M);
|
|
1162
1162
|
}
|
|
1163
1163
|
if (R.resizable !== false) {
|
|
1164
1164
|
const M = _el("div", "og-resize-handle");
|
|
1165
1165
|
M.style.cssText = "position:absolute;right:0;top:0;bottom:0;width:4px;cursor:col-resize;z-index:1;", v.appendChild(M);
|
|
1166
|
-
const
|
|
1166
|
+
const A = F;
|
|
1167
1167
|
_addResizer(M, v, (H) => {
|
|
1168
|
-
|
|
1168
|
+
A >= 0 && this._cbs.onColResize(A, H);
|
|
1169
1169
|
});
|
|
1170
1170
|
}
|
|
1171
|
-
r.columnReorder &&
|
|
1171
|
+
r.columnReorder && F >= 0 && y.colSpan === 1 && (v.draggable = true, v.addEventListener("dragstart", (M) => {
|
|
1172
1172
|
var _a2;
|
|
1173
|
-
this._cbs.onColDragStart(
|
|
1173
|
+
this._cbs.onColDragStart(F), v.classList.add("og-col-dragging"), (_a2 = M.dataTransfer) == null ? void 0 : _a2.setData("text/plain", String(F));
|
|
1174
1174
|
}), v.addEventListener("dragend", () => {
|
|
1175
1175
|
v.classList.remove("og-col-dragging"), this._header.querySelectorAll(".og-col-drop-over").forEach((M) => M.classList.remove("og-col-drop-over"));
|
|
1176
1176
|
}), v.addEventListener("dragover", (M) => {
|
|
1177
1177
|
M.preventDefault();
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1178
|
+
const A = this._cbs.getColDragIdx();
|
|
1179
|
+
A !== null && A !== F && (this._header.querySelectorAll(".og-col-drop-over").forEach((H) => H.classList.remove("og-col-drop-over")), v.classList.add("og-col-drop-over"));
|
|
1180
1180
|
}), v.addEventListener("dragleave", () => {
|
|
1181
1181
|
v.classList.remove("og-col-drop-over");
|
|
1182
1182
|
}), v.addEventListener("drop", (M) => {
|
|
1183
|
-
M.preventDefault(), v.classList.remove("og-col-drop-over"), this._cbs.onColDrop(
|
|
1184
|
-
})),
|
|
1183
|
+
M.preventDefault(), v.classList.remove("og-col-drop-over"), this._cbs.onColDrop(F);
|
|
1184
|
+
})), D && v.addEventListener("click", (M) => {
|
|
1185
1185
|
M.target.classList.contains("og-resize-handle") || this._cbs.onHeaderClick(R.field, M.shiftKey);
|
|
1186
|
-
}),
|
|
1186
|
+
}), _.appendChild(v);
|
|
1187
1187
|
}
|
|
1188
|
-
p.appendChild(
|
|
1188
|
+
p.appendChild(_);
|
|
1189
1189
|
}
|
|
1190
1190
|
this._header.appendChild(p);
|
|
1191
1191
|
}
|
|
1192
1192
|
renderBody(e) {
|
|
1193
1193
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
1194
|
-
const { startIndex: s, endIndex: i, data: o, leaves: r, widths: a, offsetY: l, totalHeight: d, selectedRows: c, checkedRows: h, groupFlatRows: u = null, onGroupToggle: p, onTreeToggle: f, extraOpts: g = {}, mergeEngine:
|
|
1195
|
-
let
|
|
1194
|
+
const { startIndex: s, endIndex: i, data: o, leaves: r, widths: a, offsetY: l, totalHeight: d, selectedRows: c, checkedRows: h, groupFlatRows: u = null, onGroupToggle: p, onTreeToggle: f, extraOpts: g = {}, mergeEngine: m, detailApi: w } = e;
|
|
1195
|
+
let _ = e.opts;
|
|
1196
1196
|
const y = this._ap;
|
|
1197
|
-
Object.keys(g).length && (
|
|
1198
|
-
const v =
|
|
1197
|
+
Object.keys(g).length && (_ = { ..._, ...g }), w == null ? void 0 : w.onBeforeTeardown(), this._body.innerHTML = "", this._cellMap.clear();
|
|
1198
|
+
const v = _.autoHeight === true;
|
|
1199
1199
|
this._body.classList.toggle("og-autoheight", v), this._body.style.height = v ? "" : `${d}px`;
|
|
1200
|
-
const R =
|
|
1201
|
-
let
|
|
1202
|
-
|
|
1203
|
-
const
|
|
1204
|
-
if (this._body.style.minWidth = `${
|
|
1200
|
+
const R = _._frozenCount ?? 0, F = !!w && (w.toggleMode ?? "expander-col") === "expander-col", S = 28;
|
|
1201
|
+
let D = 0;
|
|
1202
|
+
_.stateColumn && (D += 24), _.draggable && (D += 18), _.rowNumber && (D += 44), _.checkColumn && (D += 36), F && (D += S);
|
|
1203
|
+
const I = D + r.reduce((C, L, j) => C + (a[j] ?? _.defaultColumnWidth), 0);
|
|
1204
|
+
if (this._body.style.minWidth = `${I}px`, i < s) return;
|
|
1205
1205
|
const T = document.createDocumentFragment();
|
|
1206
1206
|
if (u && w) for (let C = s - 1; C >= 0; C--) {
|
|
1207
|
-
const
|
|
1208
|
-
if (!(
|
|
1209
|
-
if (
|
|
1210
|
-
const
|
|
1211
|
-
this._appendDetailPanel(T,
|
|
1207
|
+
const L = u[C];
|
|
1208
|
+
if (!(L && L._isDetailFiller === true)) {
|
|
1209
|
+
if (L && L._isDetailHead === true && C + L._span - 1 >= s) {
|
|
1210
|
+
const j = l + (C - s) * _.rowHeight;
|
|
1211
|
+
this._appendDetailPanel(T, L._rowId, j, L._span * _.rowHeight, I, w);
|
|
1212
1212
|
}
|
|
1213
1213
|
break;
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
for (let C = s; C <= i; C++) {
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
if (
|
|
1220
|
-
const x =
|
|
1221
|
-
this._appendDetailPanel(T, x._rowId,
|
|
1217
|
+
const L = u ? u[C] : null;
|
|
1218
|
+
if (L && L._isDetailFiller === true) continue;
|
|
1219
|
+
if (L && L._isDetailHead === true && w) {
|
|
1220
|
+
const x = L, E = l + (C - s) * _.rowHeight;
|
|
1221
|
+
this._appendDetailPanel(T, x._rowId, E, x._span * _.rowHeight, I, w);
|
|
1222
1222
|
continue;
|
|
1223
1223
|
}
|
|
1224
|
-
if (
|
|
1225
|
-
const
|
|
1226
|
-
if (
|
|
1227
|
-
const x =
|
|
1228
|
-
|
|
1229
|
-
let
|
|
1230
|
-
if (
|
|
1224
|
+
if (L && L._isDetailHead === true) continue;
|
|
1225
|
+
const j = L && L._isGroup === true, M = L && L._isTree === true;
|
|
1226
|
+
if (j) {
|
|
1227
|
+
const x = L, E = `__${x._groupField}:${x._groupValue}`, $ = _el("div", "og-group-row"), te = l + (C - s) * _.rowHeight;
|
|
1228
|
+
$.style.cssText = [v ? "" : `top:${te}px;height:${_.rowHeight}px;`, "display:flex;align-items:stretch;cursor:pointer;", `padding-left:${4 + x._depth * 12}px;`, "background:var(--og-header-bg,#f5f5f5);", `border:0;border-bottom:${y.divider()};`].join(""), $.setAttribute("role", "row"), $.setAttribute("aria-expanded", x._expanded ? "true" : "false"), $.setAttribute("aria-rowindex", String(C + 1)), $.setAttribute("aria-level", String(x._depth + 1));
|
|
1229
|
+
let B = 0;
|
|
1230
|
+
if (_.stateColumn && (B += 24), _.draggable && (B += 18), _.rowNumber && (B += 44), _.checkColumn && (B += 36), F && (B += S), B > 0) {
|
|
1231
1231
|
const b = _el("div", "og-group-state-cell");
|
|
1232
|
-
b.style.cssText = [`width:${
|
|
1233
|
-
const
|
|
1234
|
-
if (
|
|
1232
|
+
b.style.cssText = [`width:${B}px;min-width:${B}px;flex-shrink:0;`, "display:flex;align-items:center;justify-content:center;", "font-size:10px;font-weight:700;gap:2px;", `border-right:${y.border()};`].join("");
|
|
1233
|
+
const N = x._states ?? { added: 0, edited: 0, removed: 0 };
|
|
1234
|
+
if (N.added > 0) {
|
|
1235
1235
|
const O = _el("span");
|
|
1236
|
-
O.textContent = `+${
|
|
1236
|
+
O.textContent = `+${N.added}`, O.style.cssText = `color:var(--og-row-added-bg,#2e7d32);background:#e8f5e9;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
|
|
1237
1237
|
}
|
|
1238
|
-
if (
|
|
1238
|
+
if (N.edited > 0) {
|
|
1239
1239
|
const O = _el("span");
|
|
1240
|
-
O.textContent = `M${
|
|
1240
|
+
O.textContent = `M${N.edited}`, O.style.cssText = `color:#e65100;background:#fff8e1;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
|
|
1241
1241
|
}
|
|
1242
|
-
if (
|
|
1242
|
+
if (N.removed > 0) {
|
|
1243
1243
|
const O = _el("span");
|
|
1244
|
-
O.textContent = `D${
|
|
1244
|
+
O.textContent = `D${N.removed}`, O.style.cssText = `color:var(--og-row-removed-bg,#c62828);background:#ffebee;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
|
|
1245
1245
|
}
|
|
1246
|
-
|
|
1246
|
+
$.appendChild(b);
|
|
1247
1247
|
}
|
|
1248
1248
|
let J = false;
|
|
1249
1249
|
for (let b = 0; b < r.length; b++) {
|
|
1250
|
-
const
|
|
1251
|
-
if (
|
|
1252
|
-
const X = x._summaryFmt[
|
|
1253
|
-
|
|
1250
|
+
const N = r[b], O = a[b] ?? _.defaultColumnWidth, re = x._summaryFmt !== void 0 && N.field in (x._summaryFmt ?? {}), V = _el("div", "og-group-cell");
|
|
1251
|
+
if (V.style.cssText = [`width:${O}px;min-width:${O}px;flex-shrink:0;`, `padding:${y.cellPadding()};box-sizing:border-box;overflow:hidden;`, `border-right:${y.border()};`, "display:flex;align-items:center;", "white-space:nowrap;text-overflow:ellipsis;"].join(""), re) {
|
|
1252
|
+
const X = x._summaryFmt[N.field];
|
|
1253
|
+
V.textContent = X !== "" ? X : "-", V.style.justifyContent = "flex-end", V.style.color = "var(--og-primary,#1976d2)", V.style.fontWeight = "600";
|
|
1254
1254
|
} else if (!J) {
|
|
1255
1255
|
J = true;
|
|
1256
1256
|
const X = _el("span", "og-group-arrow");
|
|
1257
|
-
X.textContent = x._expanded ? "▾ " : "▸ ", X.style.cssText = "color:var(--og-primary,#1976d2);margin-right:4px;flex-shrink:0;",
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1257
|
+
X.textContent = x._expanded ? "▾ " : "▸ ", X.style.cssText = "color:var(--og-primary,#1976d2);margin-right:4px;flex-shrink:0;", V.appendChild(X);
|
|
1258
|
+
const q = _el("span", "og-group-label");
|
|
1259
|
+
q.textContent = this._t("group.badge", { label: x._groupLabel, count: x._childCount }), q.style.cssText = "overflow:hidden;text-overflow:ellipsis;font-weight:600;", V.appendChild(q), V.style.gap = "0";
|
|
1260
1260
|
}
|
|
1261
|
-
|
|
1261
|
+
$.appendChild(V);
|
|
1262
1262
|
}
|
|
1263
|
-
|
|
1263
|
+
$.addEventListener("click", () => p == null ? void 0 : p(E)), T.appendChild($);
|
|
1264
1264
|
continue;
|
|
1265
1265
|
}
|
|
1266
|
-
const
|
|
1266
|
+
const A = M ? L : null, H = A ? A.data : u ? L : o.getRowByIndex(C);
|
|
1267
1267
|
if (!H) continue;
|
|
1268
|
-
const G = M ||
|
|
1269
|
-
if (
|
|
1270
|
-
const x = l + (C - s) *
|
|
1271
|
-
|
|
1268
|
+
const G = M || j ? "none" : o.getRowState(C), z = _el("div", "og-row");
|
|
1269
|
+
if (z.setAttribute("role", "row"), z.setAttribute("aria-rowindex", String(C + 1)), !v) {
|
|
1270
|
+
const x = l + (C - s) * _.rowHeight;
|
|
1271
|
+
z.style.top = `${x}px`, z.style.height = `${_.rowHeight}px`;
|
|
1272
1272
|
}
|
|
1273
1273
|
let W = C % 2 === 0 ? "var(--og-row-bg,#fff)" : "var(--og-row-alt-bg,#fafafa)";
|
|
1274
|
-
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1277
|
-
this._cbs.onCellClick(
|
|
1274
|
+
z.style.background = W, G === "added" && z.classList.add("og-state-added"), G === "edited" && z.classList.add("og-state-edited"), G === "removed" && z.classList.add("og-state-removed"), c.has(C) && z.classList.add("og-selected"), z.setAttribute("aria-selected", c.has(C) ? "true" : "false"), G === "added" && (W = "var(--og-row-added-bg,#e8f5e9)"), G === "edited" && (W = "var(--og-row-edited-bg,#fff8e1)"), G === "removed" && (W = "var(--og-row-removed-bg,#ffebee)"), c.has(C) && (W = "var(--og-row-selected-bg,#bbdefb)");
|
|
1275
|
+
const he = C;
|
|
1276
|
+
z.addEventListener("click", (x) => {
|
|
1277
|
+
this._cbs.onCellClick(he, -1, x);
|
|
1278
1278
|
});
|
|
1279
|
-
const
|
|
1280
|
-
let
|
|
1281
|
-
if (
|
|
1282
|
-
const x = _el("div", "og-cell og-col-state"),
|
|
1283
|
-
x.textContent =
|
|
1279
|
+
const ne = /* @__PURE__ */ new Map();
|
|
1280
|
+
let Y = 0;
|
|
1281
|
+
if (_.stateColumn) {
|
|
1282
|
+
const x = _el("div", "og-cell og-col-state"), E = { added: "✚", edited: "✎", removed: "✖", none: "" }, $ = { added: "#2e7d32", edited: "#bf360c", removed: "#c62828", none: "" };
|
|
1283
|
+
x.textContent = E[G] ?? "", x.style.color = $[G] ?? "", x.title = G, R > 0 && (x.style.position = "sticky", x.style.left = `${Y}px`, x.style.zIndex = "2", x.style.background = W), Y += 24, z.appendChild(x);
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1287
|
-
const x =
|
|
1288
|
-
R > 0 && (x.style.position = "sticky", x.style.left = `${
|
|
1285
|
+
const ae = this._cbs.getDndManager();
|
|
1286
|
+
if (_.draggable && ae) {
|
|
1287
|
+
const x = ae.attachHandle(z, C, _._totalRows ?? i + 1);
|
|
1288
|
+
R > 0 && (x.style.position = "sticky", x.style.left = `${Y}px`, x.style.zIndex = "2", x.style.background = W), Y += 18, z.appendChild(x);
|
|
1289
1289
|
}
|
|
1290
|
-
if (
|
|
1290
|
+
if (_.rowNumber) {
|
|
1291
1291
|
const x = _el("div", "og-cell og-col-rownum");
|
|
1292
|
-
x.textContent = String(C + 1), R > 0 && (x.style.position = "sticky", x.style.left = `${
|
|
1292
|
+
x.textContent = String(C + 1), R > 0 && (x.style.position = "sticky", x.style.left = `${Y}px`, x.style.zIndex = "2", x.style.background = W), Y += 44, z.appendChild(x);
|
|
1293
1293
|
}
|
|
1294
|
-
if (
|
|
1295
|
-
const x = _el("div", "og-cell og-col-check"),
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}), x.appendChild(
|
|
1294
|
+
if (_.checkColumn) {
|
|
1295
|
+
const x = _el("div", "og-cell og-col-check"), E = document.createElement("input");
|
|
1296
|
+
E.type = "checkbox", E.checked = h.has(C), E.setAttribute("aria-label", this._t("row.selectAria", { n: C + 1 })), E.addEventListener("click", ($) => $.stopPropagation()), E.addEventListener("change", ($) => {
|
|
1297
|
+
$.stopPropagation(), this._cbs.onRowCheck(C, E.checked);
|
|
1298
|
+
}), x.appendChild(E), R > 0 && (x.style.position = "sticky", x.style.left = `${Y}px`, x.style.zIndex = "2", x.style.background = W), Y += 36, z.appendChild(x);
|
|
1299
1299
|
}
|
|
1300
|
-
if (
|
|
1300
|
+
if (F) {
|
|
1301
1301
|
const x = _el("div", "og-cell og-col-detail-toggle");
|
|
1302
1302
|
x.style.cssText = "display:flex;align-items:center;justify-content:center;flex-shrink:0;box-sizing:border-box;";
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
const J =
|
|
1303
|
+
const E = w.getRowId(H), $ = !!E && w.isExpanded(E), te = w.getGlyph($), B = _el("span", "og-detail-expander");
|
|
1304
|
+
B.textContent = te.glyph, B.title = te.title, B.setAttribute("role", "button"), B.setAttribute("tabindex", "0"), B.setAttribute("aria-label", te.ariaLabel), E && B.setAttribute("aria-controls", `og-detail-${E}`), B.style.cssText = "cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-width:22px;min-height:22px;user-select:none;line-height:1;";
|
|
1305
|
+
const J = E, b = C, N = (O) => {
|
|
1306
1306
|
O.stopPropagation(), J && w.onToggle(b, J);
|
|
1307
1307
|
};
|
|
1308
|
-
|
|
1309
|
-
(O.key === "Enter" || O.key === " ") && (O.preventDefault(),
|
|
1310
|
-
}), x.appendChild(
|
|
1308
|
+
B.addEventListener("click", N), B.addEventListener("keydown", (O) => {
|
|
1309
|
+
(O.key === "Enter" || O.key === " ") && (O.preventDefault(), N(O));
|
|
1310
|
+
}), x.appendChild(B), R > 0 && (x.style.position = "sticky", x.style.left = `${Y}px`, x.style.zIndex = "2", x.style.background = W), x.style.width = `${S}px`, x.style.minWidth = `${S}px`, Y += S, z.appendChild(x), E && z.setAttribute("aria-expanded", $ ? "true" : "false");
|
|
1311
1311
|
}
|
|
1312
1312
|
for (let x = 0; x < r.length; x++) {
|
|
1313
|
-
const
|
|
1313
|
+
const E = r[x], $ = a[x] ?? _.defaultColumnWidth, te = _.editable && E.editable !== false, B = x === 0, J = m && !m.isEmpty ? m.getInfo(C, x) : null;
|
|
1314
1314
|
if (J == null ? void 0 : J.hidden) {
|
|
1315
1315
|
const k = _el("div", "og-cell og-cell--merge-ph");
|
|
1316
|
-
k.style.cssText = `width:${
|
|
1316
|
+
k.style.cssText = `width:${$}px;min-width:${$}px;flex-shrink:0;visibility:hidden;box-sizing:border-box;`, z.appendChild(k);
|
|
1317
1317
|
continue;
|
|
1318
1318
|
}
|
|
1319
1319
|
const b = _el("div", "og-cell");
|
|
1320
1320
|
b.setAttribute("role", "gridcell"), b.setAttribute("aria-colindex", String(x + 1));
|
|
1321
|
-
const
|
|
1322
|
-
let
|
|
1323
|
-
if (O > 1) for (let k = 1; k < O; k++)
|
|
1321
|
+
const N = (J == null ? void 0 : J.rowSpan) ?? 1, O = (J == null ? void 0 : J.colSpan) ?? 1, re = N > 1 ? N * _.rowHeight : _.rowHeight;
|
|
1322
|
+
let V = $;
|
|
1323
|
+
if (O > 1) for (let k = 1; k < O; k++) V += a[x + k] ?? _.defaultColumnWidth;
|
|
1324
1324
|
const X = x < R;
|
|
1325
|
-
let
|
|
1325
|
+
let q = 0;
|
|
1326
1326
|
if (X) {
|
|
1327
|
-
|
|
1328
|
-
for (let k = 0; k < x; k++)
|
|
1327
|
+
_.stateColumn && (q += 24), _.draggable && (q += 18), _.rowNumber && (q += 44), _.checkColumn && (q += 36), F && (q += S);
|
|
1328
|
+
for (let k = 0; k < x; k++) q += a[k] ?? _.defaultColumnWidth;
|
|
1329
1329
|
b.classList.add("og-frozen-cell"), x === R - 1 && b.classList.add("og-frozen-last");
|
|
1330
1330
|
}
|
|
1331
|
-
b.style.width = `${
|
|
1332
|
-
const se = H ? H[
|
|
1333
|
-
b.setAttribute("aria-label", `${
|
|
1334
|
-
const Z = ((_e = (_d = this._cbs).getFormulaMeta) == null ? void 0 : _e.call(_d, C,
|
|
1331
|
+
b.style.width = `${V}px`, b.style.minWidth = `${V}px`, b.style.maxWidth = `${V}px`, N > 1 && (b.style.height = `${re}px`), X && (b.style.background = W), A && B && (b.style.padding = "0"), b.style.overflow = "hidden", N > 1 ? (b.style.height = `${re}px`, b.style.position = "absolute", b.style.zIndex = "3", b.style.background = W && W !== "inherit" ? W : "var(--og-row-bg, #fff)", b.style.borderTop = "0", b.style.borderLeft = "0", b.style.borderBottom = "1px solid var(--og-border-color, #e0e0e0)") : X && (b.style.position = "sticky", b.style.left = `${q}px`, b.style.zIndex = "1"), E.type === "number" || E.align === "right" ? b.classList.add("og-cell--right") : E.align === "center" && b.classList.add("og-cell--center"), te && b.classList.add("og-cell--editable"), E.wrap && b.classList.add("og-cell--wrap"), te || b.setAttribute("aria-readonly", "true"), O > 1 && b.setAttribute("aria-colspan", String(O)), N > 1 && b.setAttribute("aria-rowspan", String(N)), ((_a = _._focusCell) == null ? void 0 : _a.ri) === C && ((_b = _._focusCell) == null ? void 0 : _b.ci) === x && (b.classList.add("og-cell-focused"), b.tabIndex = -1), ((_c = _._rangeRects) == null ? void 0 : _c.some((k) => C >= k.startRow && C <= k.endRow && x >= k.startCol && x <= k.endCol)) && (b.classList.add("og-range-selected"), b.style.background = "var(--og-range-bg, rgba(25,118,210,0.12))");
|
|
1332
|
+
const se = H ? H[E.field] : null;
|
|
1333
|
+
b.setAttribute("aria-label", `${E.header}: ${se == null ? "" : String(se)}`), E.tooltip != null ? b.title = typeof E.tooltip == "function" ? String(E.tooltip(se, H) ?? "") : String(E.tooltip) : _.tooltips && se != null && se !== "" && (b.title = String(se));
|
|
1334
|
+
const Z = ((_e = (_d = this._cbs).getFormulaMeta) == null ? void 0 : _e.call(_d, C, E.field)) ?? null;
|
|
1335
1335
|
if (Z) {
|
|
1336
1336
|
const k = se == null ? this._t("cell.emptyValue") : String(se);
|
|
1337
1337
|
if (Z.error) {
|
|
1338
|
-
const
|
|
1338
|
+
const P = _FORMULA_ERROR_KEY$1[Z.error], Q = P ? this._t(P) : this._t("formulaError.fallback");
|
|
1339
1339
|
b.setAttribute("aria-label", this._t("formula.ariaError", { src: Z.src, message: Q })), b.title = `${Z.error} — ${Q}`, b.style.color = "var(--og-formula-error-color, #c62828)";
|
|
1340
1340
|
} else {
|
|
1341
|
-
const
|
|
1342
|
-
b.setAttribute("aria-label", this._t("formula.ariaValue", { src: Z.src, value: k, approx:
|
|
1341
|
+
const P = Z.approx ? this._t("formula.approxSuffix") : "";
|
|
1342
|
+
b.setAttribute("aria-label", this._t("formula.ariaValue", { src: Z.src, value: k, approx: P })), b.title = `${Z.src}${P}`;
|
|
1343
1343
|
}
|
|
1344
|
-
if (((_f =
|
|
1344
|
+
if (((_f = _.formula) == null ? void 0 : _f.cellMarker) !== false) {
|
|
1345
1345
|
b.classList.add("og-formula-cell");
|
|
1346
|
-
const
|
|
1347
|
-
b.style.backgroundImage = `linear-gradient(135deg, ${
|
|
1346
|
+
const P = Z.error ? "var(--og-formula-error-color, #c62828)" : "var(--og-formula-marker-color, #1976d2)", Q = b.style.background || b.style.backgroundColor;
|
|
1347
|
+
b.style.backgroundImage = `linear-gradient(135deg, ${P} 0 6px, transparent 6px)`, b.style.backgroundRepeat = "no-repeat", b.style.backgroundPosition = "top right", b.style.backgroundSize = "8px 8px", Q && (b.style.backgroundColor = Q);
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
-
let
|
|
1355
|
-
if (
|
|
1356
|
-
const k = _el("div", "og-tree-cell"),
|
|
1357
|
-
for (let
|
|
1350
|
+
const le = (_h = (_g = this._cbs).resolveRenderHook) == null ? void 0 : _h.call(_g, "cellClass", C, E.field);
|
|
1351
|
+
le && (b.className += " " + le);
|
|
1352
|
+
const de = (_j = (_i = this._cbs).resolveRenderHook) == null ? void 0 : _j.call(_i, "ariaLabel", C, E.field);
|
|
1353
|
+
de != null && b.setAttribute("aria-label", String(de));
|
|
1354
|
+
let ce = b;
|
|
1355
|
+
if (A && B) {
|
|
1356
|
+
const k = _el("div", "og-tree-cell"), P = A._ancestorHasMore ?? [];
|
|
1357
|
+
for (let U = 0; U < A._depth; U++) {
|
|
1358
1358
|
const ee = _el("span", "og-tree-guide");
|
|
1359
|
-
|
|
1359
|
+
P[U] && ee.classList.add("og-tree-guide--line"), k.appendChild(ee);
|
|
1360
1360
|
}
|
|
1361
|
-
if (
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1361
|
+
if (A._depth > 0) {
|
|
1362
|
+
const U = _el("span", "og-tree-connector");
|
|
1363
|
+
U.classList.add(A._isLastChild ? "og-tree-connector--last" : "og-tree-connector--mid"), k.appendChild(U);
|
|
1364
1364
|
}
|
|
1365
1365
|
const Q = _el("span", "og-tree-toggle-wrap");
|
|
1366
|
-
if (!
|
|
1367
|
-
const
|
|
1368
|
-
Q.appendChild(
|
|
1366
|
+
if (!A._hasChildren) {
|
|
1367
|
+
const U = _el("span", "og-tree-leaf-dot");
|
|
1368
|
+
Q.appendChild(U);
|
|
1369
1369
|
}
|
|
1370
1370
|
k.appendChild(Q);
|
|
1371
|
-
const
|
|
1372
|
-
if (
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
ee.stopPropagation(), f == null ? void 0 : f(
|
|
1376
|
-
}),
|
|
1377
|
-
(ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), ee.stopPropagation(), f == null ? void 0 : f(
|
|
1371
|
+
const K = document.createElement("i");
|
|
1372
|
+
if (A._hasChildren) {
|
|
1373
|
+
const U = _resolveTreeIcon(E.treeNodeIcon, H, true, A._expanded);
|
|
1374
|
+
K.className = A._expanded ? `${U} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--open og-tree-node-icon--toggle` : `${U} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--toggle`, K.setAttribute("role", "button"), K.setAttribute("tabindex", "0"), K.setAttribute("aria-expanded", A._expanded ? "true" : "false"), K.setAttribute("aria-label", this._t(A._expanded ? "tree.collapse" : "tree.expand")), K.addEventListener("click", (ee) => {
|
|
1375
|
+
ee.stopPropagation(), f == null ? void 0 : f(A._treeId);
|
|
1376
|
+
}), K.addEventListener("keydown", (ee) => {
|
|
1377
|
+
(ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), ee.stopPropagation(), f == null ? void 0 : f(A._treeId));
|
|
1378
1378
|
});
|
|
1379
1379
|
} else {
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1380
|
+
const U = _resolveTreeIcon(E.treeNodeIcon, H, false, false);
|
|
1381
|
+
K.setAttribute("aria-hidden", "true"), K.className = `${U} og-tree-node-icon og-tree-node-icon--leaf`;
|
|
1382
1382
|
}
|
|
1383
|
-
k.appendChild(
|
|
1383
|
+
k.appendChild(K), b.appendChild(k), ce = k;
|
|
1384
1384
|
}
|
|
1385
|
-
if (
|
|
1386
|
-
const k = H[
|
|
1387
|
-
Object.assign(b.style,
|
|
1385
|
+
if (E.cellStyle) {
|
|
1386
|
+
const k = H[E.field], P = typeof E.cellStyle == "function" ? E.cellStyle(k, H, C) : E.cellStyle;
|
|
1387
|
+
Object.assign(b.style, P);
|
|
1388
1388
|
}
|
|
1389
|
-
const ue = createRenderer(
|
|
1390
|
-
|
|
1389
|
+
const ue = createRenderer(E).render({ value: H[E.field], row: H, rowIndex: C, column: E, colIndex: x, isSelected: c.has(C), rowState: G, displayValue: ((_l = (_k = this._cbs).resolveRenderHook) == null ? void 0 : _l.call(_k, "displayText", C, E.field)) ?? ((_n = (_m = this._cbs).getDisplayText) == null ? void 0 : _n.call(_m, C, E.field)) ?? null, displayFormatter: ((_p = (_o = this._cbs).getDisplayFormatter) == null ? void 0 : _p.call(_o)) ?? null, hasCellFormula: Z != null, t: (k, P) => this._t(k, P) });
|
|
1390
|
+
ce.appendChild(ue), (_r = (_q = this._cbs).applyCF) == null ? void 0 : _r.call(_q, b, C, E.field, H ? H[E.field] : void 0, V, re);
|
|
1391
1391
|
const ie = C, oe = x;
|
|
1392
1392
|
if (b.addEventListener("click", (k) => {
|
|
1393
1393
|
k.stopPropagation(), this._cbs.onCellClick(ie, oe, k);
|
|
@@ -1403,17 +1403,17 @@ class GridRenderer {
|
|
|
1403
1403
|
k.stopPropagation(), this._cbs.onCellMouseUp(ie, oe, k);
|
|
1404
1404
|
}), b.addEventListener("mousemove", (k) => {
|
|
1405
1405
|
k.stopPropagation(), this._cbs.onCellMouseMove(ie, oe, k);
|
|
1406
|
-
}),
|
|
1406
|
+
}), ne.set(x, b), N > 1) {
|
|
1407
1407
|
const k = document.createElement("div");
|
|
1408
|
-
k.style.cssText = [`width:${
|
|
1409
|
-
let
|
|
1410
|
-
|
|
1411
|
-
for (let
|
|
1412
|
-
const Q = l + (C - s) *
|
|
1413
|
-
b.style.left = `${
|
|
1414
|
-
} else
|
|
1408
|
+
k.style.cssText = [`width:${$}px;min-width:${$}px;height:${_.rowHeight}px;`, "flex-shrink:0;box-sizing:border-box;", `border-right:${y.border()};`].join(""), z.appendChild(k);
|
|
1409
|
+
let P = 0;
|
|
1410
|
+
_.stateColumn && (P += 24), _.draggable && (P += 18), _.rowNumber && (P += 44), _.checkColumn && (P += 36), F && (P += S);
|
|
1411
|
+
for (let K = 0; K < x; K++) P += a[K] ?? _.defaultColumnWidth;
|
|
1412
|
+
const Q = l + (C - s) * _.rowHeight;
|
|
1413
|
+
b.style.left = `${P}px`, b.style.top = `${Q}px`, T.appendChild(b);
|
|
1414
|
+
} else z.appendChild(b);
|
|
1415
1415
|
}
|
|
1416
|
-
this._cellMap.set(C,
|
|
1416
|
+
this._cellMap.set(C, ne), T.appendChild(z);
|
|
1417
1417
|
}
|
|
1418
1418
|
if (o.rowCount === 0) {
|
|
1419
1419
|
const C = _el("div", "og-empty-message");
|
|
@@ -1476,9 +1476,9 @@ function applyGuardrails(n, e) {
|
|
|
1476
1476
|
const s = { ...e }, i = [], o = s["--og-focus-width"];
|
|
1477
1477
|
if (o != null) {
|
|
1478
1478
|
const r = parseFloat(String(o));
|
|
1479
|
-
!Number.isNaN(r) && r < 2 && (s["--og-focus-width"] = "2px", i.push(`focus-width ${o} → 2px (가시 포커스 최소 2px,
|
|
1479
|
+
!Number.isNaN(r) && r < 2 && (s["--og-focus-width"] = "2px", i.push(`focus-width ${o} → 2px (가시 포커스 최소 2px, 접근성 가드레일)`));
|
|
1480
1480
|
}
|
|
1481
|
-
return s["--og-focus-style"] === "none" && (s["--og-focus-style"] = "solid", i.push("focus-style none → solid (가시 포커스 비협상,
|
|
1481
|
+
return s["--og-focus-style"] === "none" && (s["--og-focus-style"] = "solid", i.push("focus-style none → solid (가시 포커스 비협상, 접근성 가드레일)")), { delta: s, warnings: i };
|
|
1482
1482
|
}
|
|
1483
1483
|
class SkinRegistry {
|
|
1484
1484
|
constructor() {
|
|
@@ -1521,7 +1521,7 @@ const SKIN_SHARP = { "--og-radius-sm": "0", "--og-radius-md": "0", "--og-radius-
|
|
|
1521
1521
|
for (const [n, e] of BUILTIN_SKINS) skinRegistry.registerBuiltin(n, e);
|
|
1522
1522
|
const DEFAULT_AXIS_VALUE = "default", EMPTY_RESOLUTION = Object.freeze({ tokens: Object.freeze({}) });
|
|
1523
1523
|
function assertNamespace(n, e, s) {
|
|
1524
|
-
for (const i of Object.keys(s)) if (!e.has(i)) throw new Error(`[AppearanceAxis:${n}] 토큰 "${i}" 은 ${n} 축 이름공간이 아닙니다. 각 축은 자기 이름공간 토큰만 소유합니다(축
|
|
1524
|
+
for (const i of Object.keys(s)) if (!e.has(i)) throw new Error(`[AppearanceAxis:${n}] 토큰 "${i}" 은 ${n} 축 이름공간이 아닙니다. 각 축은 자기 이름공간 토큰만 소유합니다(축 섞임 금지 — 이름-분리 물리 직교, 불변식 1).`);
|
|
1525
1525
|
}
|
|
1526
1526
|
class TokenAxis {
|
|
1527
1527
|
constructor(e) {
|
|
@@ -1907,10 +1907,10 @@ function _groupByFields(n, e, s, i, o, r, a, l) {
|
|
|
1907
1907
|
const h = [];
|
|
1908
1908
|
for (const [u, p] of c) {
|
|
1909
1909
|
const f = `${r}__${d}:${u}`, g = o.has(f);
|
|
1910
|
-
let
|
|
1911
|
-
s < e.length - 1 ?
|
|
1912
|
-
const { summary: w, summaryFmt:
|
|
1913
|
-
h.push({ _isGroup: true, _groupField: d, _groupValue: u, _groupLabel: u == null ? t("group.nullLabel") : String(u), _depth: s, _expanded: g, _childCount: p.length, _summary: w, _summaryFmt:
|
|
1910
|
+
let m;
|
|
1911
|
+
s < e.length - 1 ? m = _groupByFields(p, e, s + 1, i, o, f, a, l) : m = p;
|
|
1912
|
+
const { summary: w, summaryFmt: _ } = _calcSummary(p, i), y = _calcStates(p, a);
|
|
1913
|
+
h.push({ _isGroup: true, _groupField: d, _groupValue: u, _groupLabel: u == null ? t("group.nullLabel") : String(u), _depth: s, _expanded: g, _childCount: p.length, _summary: w, _summaryFmt: _, _states: y, children: m });
|
|
1914
1914
|
}
|
|
1915
1915
|
return h;
|
|
1916
1916
|
}
|
|
@@ -2530,18 +2530,18 @@ function resolveRangeMembers(n, e, s, i) {
|
|
|
2530
2530
|
if (!s.hasField(n.a.field) || !s.hasField(n.b.field)) throw new FormulaEvalError("#REF");
|
|
2531
2531
|
const a = s.displayedRowIds(), l = a.indexOf(o), d = a.indexOf(r);
|
|
2532
2532
|
if (l === -1 || d === -1) throw new FormulaEvalError("#REF");
|
|
2533
|
-
const c = Math.min(l, d), h = Math.max(l, d), u = a.slice(c, h + 1), p = s.visibleFields(), f = p.indexOf(n.a.field), g = p.indexOf(n.b.field), [
|
|
2533
|
+
const c = Math.min(l, d), h = Math.max(l, d), u = a.slice(c, h + 1), p = s.visibleFields(), f = p.indexOf(n.a.field), g = p.indexOf(n.b.field), [m, w] = f === -1 || g === -1 ? [null, null] : [Math.min(f, g), Math.max(f, g)], _ = [];
|
|
2534
2534
|
for (const y of u) {
|
|
2535
|
-
if (
|
|
2536
|
-
i.add(cellKey(y, n.a.field)),
|
|
2535
|
+
if (m === null || w === null) {
|
|
2536
|
+
i.add(cellKey(y, n.a.field)), _.push(s.getCellValue(y, n.a.field));
|
|
2537
2537
|
continue;
|
|
2538
2538
|
}
|
|
2539
|
-
for (let v =
|
|
2539
|
+
for (let v = m; v <= w; v++) {
|
|
2540
2540
|
const R = p[v];
|
|
2541
|
-
i.add(cellKey(y, R)),
|
|
2541
|
+
i.add(cellKey(y, R)), _.push(s.getCellValue(y, R));
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
return
|
|
2544
|
+
return _;
|
|
2545
2545
|
}
|
|
2546
2546
|
function toNumericOrThrow(n) {
|
|
2547
2547
|
if (n == null || n === "") return OGDecimal.zero();
|
|
@@ -3371,6 +3371,29 @@ class ExportManager {
|
|
|
3371
3371
|
const o = s.replace("#", "").toUpperCase();
|
|
3372
3372
|
return o.length === 3 ? o[0] + o[0] + o[1] + o[1] + o[2] + o[2] : o.length === 6 ? o : "";
|
|
3373
3373
|
}
|
|
3374
|
+
_xlsxNumFmt(e) {
|
|
3375
|
+
return typeof e == "string" && /^[#0,.%]+$/.test(e) ? e : void 0;
|
|
3376
|
+
}
|
|
3377
|
+
_applySheetStyle(e, s, i, o, r, a) {
|
|
3378
|
+
var _a, _b;
|
|
3379
|
+
let l = "1565C0", d = "FFFFFF", c = "FFFFFF", h = "EEF2FF", u = "212121", p = "BDBDBD", f = 10;
|
|
3380
|
+
if (a === "theme") {
|
|
3381
|
+
const _ = (v) => this._hexToXlsxRgb(v);
|
|
3382
|
+
l = _(this._readCssVar("--og-header-bg")) || l, d = _(this._readCssVar("--og-header-color")) || d, c = _(this._readCssVar("--og-row-bg")) || c, h = _(this._readCssVar("--og-row-alt-bg")) || h, u = _(this._readCssVar("--og-row-color")) || u, p = _(this._readCssVar("--og-border-color")) || p;
|
|
3383
|
+
const y = this._readCssVar("--og-font-size");
|
|
3384
|
+
y && (f = Math.max(8, Math.round(parseFloat(y) * 0.75)));
|
|
3385
|
+
}
|
|
3386
|
+
const g = a === "none", m = ((_b = (_a = this._d).getMeta) == null ? void 0 : _b.call(_a).exportFont) ?? "맑은 고딕", w = { hdrFont: g ? {} : { bold: true, color: { rgb: d }, sz: f, name: m }, dataFont: g ? {} : { sz: f, color: { rgb: u }, name: m }, hdrFill: g ? {} : { patternType: "solid", fgColor: { rgb: l } }, evenFill: g ? {} : { patternType: "solid", fgColor: { rgb: c } }, oddFill: g ? {} : { patternType: "solid", fgColor: { rgb: h } }, hdrBorder: g ? {} : { top: { style: "medium", color: { rgb: l } }, bottom: { style: "medium", color: { rgb: l } }, left: { style: "thin", color: { rgb: l } }, right: { style: "thin", color: { rgb: l } } }, dataBorder: g ? {} : { top: { style: "thin", color: { rgb: p } }, bottom: { style: "thin", color: { rgb: p } }, left: { style: "thin", color: { rgb: p } }, right: { style: "thin", color: { rgb: p } } } };
|
|
3387
|
+
i.forEach((_, y) => {
|
|
3388
|
+
const v = r && y === 0, F = (r ? y - 1 : y) % 2 === 0;
|
|
3389
|
+
_.forEach((S, D) => {
|
|
3390
|
+
const I = e.encode_cell({ r: y, c: D });
|
|
3391
|
+
s[I] || (s[I] = { t: "s", v: "" });
|
|
3392
|
+
const T = o[D], C = T.type === "number" || T.align === "right", L = v ? "center" : C ? "right" : T.align ?? "left", j = v ? void 0 : this._xlsxNumFmt(T.format);
|
|
3393
|
+
j && s[I].t === "n" && (s[I].z = j), s[I].s = { font: v ? w.hdrFont : w.dataFont, fill: v ? w.hdrFill : F ? w.evenFill : w.oddFill, border: v ? w.hdrBorder : w.dataBorder, alignment: { horizontal: L, vertical: "center", wrapText: false }, ...j ? { numFmt: j } : {} };
|
|
3394
|
+
});
|
|
3395
|
+
});
|
|
3396
|
+
}
|
|
3374
3397
|
exportExcel(e) {
|
|
3375
3398
|
const s = typeof e == "string" ? { filename: e } : e ?? {};
|
|
3376
3399
|
let i = s.filename ?? "export";
|
|
@@ -3380,37 +3403,19 @@ class ExportManager {
|
|
|
3380
3403
|
return !((_a = s.exceptFields) == null ? void 0 : _a.includes(c.field));
|
|
3381
3404
|
}), l = s.includeHeader !== false, d = (this._d.getStrategy ?? ((c, h) => h))("cellSerializer", (c, h, u) => h.type === "number" && typeof c == "number" ? c : typeof c == "boolean" ? c ? "✓" : "" : typeof c == "object" ? "" : String(c));
|
|
3382
3405
|
Promise.resolve().then(() => require("./xlsx.min-BQ1o3sB6.cjs")).then((c) => c.xlsx_min).then(({ utils: c, writeFile: h }) => {
|
|
3383
|
-
var _a
|
|
3406
|
+
var _a;
|
|
3384
3407
|
const u = [];
|
|
3385
|
-
l && u.push(a.map((
|
|
3386
|
-
for (const
|
|
3387
|
-
const
|
|
3388
|
-
if (s.maskOnExport &&
|
|
3389
|
-
const
|
|
3390
|
-
return
|
|
3408
|
+
l && u.push(a.map((w) => w.header));
|
|
3409
|
+
for (const w of r) u.push(a.map((_) => {
|
|
3410
|
+
const y = w[_.field];
|
|
3411
|
+
if (s.maskOnExport && _.mask && this._d.getMaskEnabled(_.field)) return applyMask(y == null ? "" : String(y), _.mask);
|
|
3412
|
+
const v = y;
|
|
3413
|
+
return v == null || v === "" ? "" : d(v, _, w);
|
|
3391
3414
|
}));
|
|
3392
3415
|
const p = c.aoa_to_sheet(u), f = this._d.getColWidths(), g = this._d.getColLayout();
|
|
3393
|
-
p["!cols"] = a.map((
|
|
3394
|
-
const
|
|
3395
|
-
|
|
3396
|
-
if (_ === "theme") {
|
|
3397
|
-
const E = (M) => this._hexToXlsxRgb(M);
|
|
3398
|
-
w = E(this._readCssVar("--og-header-bg")) || w, m = E(this._readCssVar("--og-header-color")) || m, y = E(this._readCssVar("--og-row-bg")) || y, v = E(this._readCssVar("--og-row-alt-bg")) || v, R = E(this._readCssVar("--og-row-color")) || R, A = E(this._readCssVar("--og-border-color")) || A;
|
|
3399
|
-
const B = this._readCssVar("--og-font-size");
|
|
3400
|
-
B && (S = Math.max(8, Math.round(parseFloat(B) * 0.75)));
|
|
3401
|
-
}
|
|
3402
|
-
const I = _ === "none", D = ((_b = (_a = this._d).getMeta) == null ? void 0 : _b.call(_a).exportFont) ?? "맑은 고딕", T = { hdrFont: I ? {} : { bold: true, color: { rgb: m }, sz: S, name: D }, dataFont: I ? {} : { sz: S, color: { rgb: R }, name: D }, hdrFill: I ? {} : { patternType: "solid", fgColor: { rgb: w } }, evenFill: I ? {} : { patternType: "solid", fgColor: { rgb: y } }, oddFill: I ? {} : { patternType: "solid", fgColor: { rgb: v } }, hdrBorder: I ? {} : { top: { style: "medium", color: { rgb: w } }, bottom: { style: "medium", color: { rgb: w } }, left: { style: "thin", color: { rgb: w } }, right: { style: "thin", color: { rgb: w } } }, dataBorder: I ? {} : { top: { style: "thin", color: { rgb: A } }, bottom: { style: "thin", color: { rgb: A } }, left: { style: "thin", color: { rgb: A } }, right: { style: "thin", color: { rgb: A } } } };
|
|
3403
|
-
u.forEach((E, B) => {
|
|
3404
|
-
const M = l && B === 0, H = (l ? B - 1 : B) % 2 === 0;
|
|
3405
|
-
E.forEach((G, $) => {
|
|
3406
|
-
const W = c.encode_cell({ r: B, c: $ });
|
|
3407
|
-
p[W] || (p[W] = { t: "s", v: "" });
|
|
3408
|
-
const re = a[$], ae = re.type === "number" || re.align === "right", q = M ? "center" : ae ? "right" : re.align ?? "left";
|
|
3409
|
-
p[W].s = { font: M ? T.hdrFont : T.dataFont, fill: M ? T.hdrFill : H ? T.evenFill : T.oddFill, border: M ? T.hdrBorder : T.dataBorder, alignment: { horizontal: q, vertical: "center", wrapText: false } };
|
|
3410
|
-
});
|
|
3411
|
-
});
|
|
3412
|
-
const C = c.book_new();
|
|
3413
|
-
c.book_append_sheet(C, p, o), h(C, i, { cellStyles: true }), (_c = s.onAfter) == null ? void 0 : _c.call(s, new Blob([]));
|
|
3416
|
+
p["!cols"] = a.map((w) => ({ wpx: f[g.getColumnIndex(w.field)] ?? 100 })), p["!rows"] = u.map((w, _) => ({ hpx: _ === 0 && l ? 22 : 19 })), this._applySheetStyle(c, p, u, a, l, s.styleMode ?? "theme");
|
|
3417
|
+
const m = c.book_new();
|
|
3418
|
+
c.book_append_sheet(m, p, o), h(m, i, { cellStyles: true }), (_a = s.onAfter) == null ? void 0 : _a.call(s, new Blob([]));
|
|
3414
3419
|
}).catch(() => {
|
|
3415
3420
|
console.error("Excel 내보내기 실패: xlsx 패키지를 확인하세요.");
|
|
3416
3421
|
});
|
|
@@ -3434,7 +3439,7 @@ class ExportManager {
|
|
|
3434
3439
|
const s = (e == null ? void 0 : e.title) ?? "OPEN_GRID", i = (e == null ? void 0 : e.footerText) ?? "", o = this._d.getData(), r = this._d.getColLayout().visibleLeaves.filter((g) => {
|
|
3435
3440
|
var _a2;
|
|
3436
3441
|
return !((_a2 = e == null ? void 0 : e.excludeFields) == null ? void 0 : _a2.includes(g.field));
|
|
3437
|
-
}), a = r.map((g) => `<th>${g.header ?? g.field}</th>`).join(""), l = o.map((g) => `<tr>${r.map((
|
|
3442
|
+
}), a = r.map((g) => `<th>${g.header ?? g.field}</th>`).join(""), l = o.map((g) => `<tr>${r.map((m) => `<td>${String(g[m.field] ?? "")}</td>`).join("")}</tr>`).join(""), d = i ? `<div class="og-print-footer">${i}</div>` : "", h = (((_b = (_a = this._d).getMeta) == null ? void 0 : _b.call(_a)) ?? { intlLocale: "ko-KR" }).intlLocale, u = this._d.t ? this._d.t("export.printSummary", { rows: o.length, cols: r.length, date: (/* @__PURE__ */ new Date()).toLocaleString(h) }) : `${o.length}행 × ${r.length}열 · ${(/* @__PURE__ */ new Date()).toLocaleString(h)}`, p = `<!DOCTYPE html>
|
|
3438
3443
|
<html lang="${h}"><head>
|
|
3439
3444
|
<meta charset="UTF-8"><title>${s}</title>
|
|
3440
3445
|
<style>
|
|
@@ -3468,15 +3473,15 @@ ${d}
|
|
|
3468
3473
|
}
|
|
3469
3474
|
const i = e ?? "workbook.xlsx", o = (this._d.getStrategy ?? ((r, a) => a))("cellSerializer", (r, a, l) => typeof r == "boolean" ? r ? "✓" : "" : a.type === "number" && typeof r == "number" ? r : String(r));
|
|
3470
3475
|
Promise.resolve().then(() => require("./xlsx.min-BQ1o3sB6.cjs")).then((r) => r.xlsx_min).then(({ utils: r, writeFile: a }) => {
|
|
3471
|
-
const l = r.book_new(), d = this._d.getOptions();
|
|
3472
|
-
for (const
|
|
3473
|
-
const
|
|
3474
|
-
for (const
|
|
3475
|
-
const
|
|
3476
|
-
return
|
|
3476
|
+
const l = r.book_new(), d = this._d.getOptions(), c = s.getActive();
|
|
3477
|
+
for (const h of s.getNames()) {
|
|
3478
|
+
const u = s.get(h), p = u.columns.length ? u.columns : d.columns, f = h === c ? this._d.getData() : u.data, g = [p.map((w) => w.header)];
|
|
3479
|
+
for (const w of f) g.push(p.map((_) => {
|
|
3480
|
+
const y = w[_.field];
|
|
3481
|
+
return y == null ? "" : o(y, _, w);
|
|
3477
3482
|
}));
|
|
3478
|
-
const
|
|
3479
|
-
|
|
3483
|
+
const m = r.aoa_to_sheet(g);
|
|
3484
|
+
m["!cols"] = p.map((w) => ({ wpx: w.width ?? 100 })), m["!rows"] = g.map((w, _) => ({ hpx: _ === 0 ? 22 : 19 })), this._applySheetStyle(r, m, g, p, true, "theme"), r.book_append_sheet(l, m, h);
|
|
3480
3485
|
}
|
|
3481
3486
|
a(l, i.endsWith(".xlsx") ? i : i + ".xlsx", { cellStyles: true });
|
|
3482
3487
|
}).catch(() => console.error("exportSheetsExcel: xlsx 패키지를 확인하세요."));
|
|
@@ -3488,8 +3493,8 @@ class FooterManager {
|
|
|
3488
3493
|
}
|
|
3489
3494
|
fmtNum(e, s) {
|
|
3490
3495
|
if (!s) return Math.round(e).toLocaleString("ko-KR");
|
|
3491
|
-
const i = s.match(/[#0][#0,]*(?:\.[#0]+)?|\d+/), o = i ? s.slice(0, i.index) : "", r = i ? s.slice(i.index + i[0].length) : "", a = i ? i[0] : s, l = a.includes("#") || a.includes(","), d = a.match(/\.(\d+)$/), c = d ? parseInt(d[1], 10) : /^\d+$/.test(a) ? parseInt(a, 10) : 0, h = Math.abs(e).toFixed(c), [u = "0", p] = h.split("."), f = l ? u.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : u, g = p !== void 0 ? `${f}.${p}` : f,
|
|
3492
|
-
return e < 0 ? `-${
|
|
3496
|
+
const i = s.match(/[#0][#0,]*(?:\.[#0]+)?|\d+/), o = i ? s.slice(0, i.index) : "", r = i ? s.slice(i.index + i[0].length) : "", a = i ? i[0] : s, l = a.includes("#") || a.includes(","), d = a.match(/\.(\d+)$/), c = d ? parseInt(d[1], 10) : /^\d+$/.test(a) ? parseInt(a, 10) : 0, h = Math.abs(e).toFixed(c), [u = "0", p] = h.split("."), f = l ? u.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : u, g = p !== void 0 ? `${f}.${p}` : f, m = `${o}${g}${r}`;
|
|
3497
|
+
return e < 0 ? `-${m}` : m;
|
|
3493
3498
|
}
|
|
3494
3499
|
computeValues() {
|
|
3495
3500
|
const e = this._d.getOptions().footer;
|
|
@@ -3534,14 +3539,14 @@ class FooterManager {
|
|
|
3534
3539
|
for (let y = 0; y < p; y++) f += a[h + y] ?? 100;
|
|
3535
3540
|
const g = r[h];
|
|
3536
3541
|
h += p;
|
|
3537
|
-
const
|
|
3538
|
-
|
|
3539
|
-
const w = u.field,
|
|
3540
|
-
if (
|
|
3541
|
-
const y =
|
|
3542
|
-
|
|
3543
|
-
} else u.label && (
|
|
3544
|
-
d.appendChild(
|
|
3542
|
+
const m = document.createElement("div");
|
|
3543
|
+
m.style.cssText = [`width:${f}px;min-width:${f}px;flex-shrink:0;`, "padding:4px 8px;box-sizing:border-box;overflow:hidden;", "border-right:1px solid var(--og-border-color,#e0e0e0);", "white-space:nowrap;text-overflow:ellipsis;"].join("");
|
|
3544
|
+
const w = u.field, _ = w ? l.get(w) : null;
|
|
3545
|
+
if (_) {
|
|
3546
|
+
const y = _._formatted ?? String(_._value ?? ""), v = u.label ? `${u.label}: ` : "";
|
|
3547
|
+
m.textContent = v + y, m.title = `${((_b = u.op) == null ? void 0 : _b.toUpperCase()) ?? ""} = ${y}`, m.style.color = "var(--og-primary,#1976d2)", m.style.textAlign = u.align ?? ((g == null ? void 0 : g.type) === "number", "right");
|
|
3548
|
+
} else u.label && (m.textContent = u.label, m.style.textAlign = u.align ?? "left", m.style.color = "var(--og-row-color,#212121)");
|
|
3549
|
+
d.appendChild(m);
|
|
3545
3550
|
}
|
|
3546
3551
|
i.footerPosition === "top" ? e.insertBefore(d, e.firstChild) : e.appendChild(d);
|
|
3547
3552
|
}
|
|
@@ -3726,7 +3731,7 @@ class KeyboardManager {
|
|
|
3726
3731
|
for (let u = 0; u < l.length; u++) {
|
|
3727
3732
|
const p = l[u].split(" ");
|
|
3728
3733
|
for (let f = 0; f < p.length; f++) {
|
|
3729
|
-
const g = r + u,
|
|
3734
|
+
const g = r + u, m = a + f, w = d[m];
|
|
3730
3735
|
w && g < c.rowCount && h.push({ rowIndex: g, field: w.field, value: p[f] });
|
|
3731
3736
|
}
|
|
3732
3737
|
}
|
|
@@ -3851,17 +3856,17 @@ class CellEventHandler {
|
|
|
3851
3856
|
if (l && d) {
|
|
3852
3857
|
const c = d.editable !== false && (d.editable !== void 0 || o.editable);
|
|
3853
3858
|
if (isToggleCol(d) && c) {
|
|
3854
|
-
const
|
|
3855
|
-
this._d.writeCell(e, d.field, !
|
|
3859
|
+
const m = l[d.field];
|
|
3860
|
+
this._d.writeCell(e, d.field, !m);
|
|
3856
3861
|
}
|
|
3857
3862
|
if (d.type === "radio") {
|
|
3858
|
-
const
|
|
3859
|
-
for (const w of this._d.getColLayout().visibleLeaves) w.type === "radio" && w.field !== d.field && (!
|
|
3863
|
+
const m = d.group;
|
|
3864
|
+
for (const w of this._d.getColLayout().visibleLeaves) w.type === "radio" && w.field !== d.field && (!m || w.group === m) && this._d.getData().updateCell(e, w.field, false);
|
|
3860
3865
|
this._d.writeCell(e, d.field, true);
|
|
3861
3866
|
}
|
|
3862
3867
|
let h = l[d.field];
|
|
3863
3868
|
if (h === void 0 && d.formula) try {
|
|
3864
|
-
const
|
|
3869
|
+
const m = d.formulaPrecision ?? 30, w = evaluateFormula(d.formula, l, m);
|
|
3865
3870
|
h = w instanceof OGDecimal ? d.precision != null ? w.toFixed(d.precision) : w.toString() : String(w);
|
|
3866
3871
|
} catch {
|
|
3867
3872
|
}
|
|
@@ -4130,20 +4135,20 @@ function buildFillPlan(n, e, s, i, o) {
|
|
|
4130
4135
|
l++;
|
|
4131
4136
|
}, c = r ? range(n.startCol, n.endCol) : range(n.startRow, n.endRow);
|
|
4132
4137
|
for (const h of c) {
|
|
4133
|
-
const u = r ? o.fieldAt(h) : void 0, p = r ? range(n.startRow, n.endRow).map((
|
|
4134
|
-
const y = r ? u : o.fieldAt(
|
|
4135
|
-
return y ? o.getCellValue(
|
|
4136
|
-
}), g = i === "series" ? detectSeries(f) : { kind: "copy" },
|
|
4137
|
-
(s === "down" || s === "right" ?
|
|
4138
|
-
const v = y + 1, R = r ?
|
|
4138
|
+
const u = r ? o.fieldAt(h) : void 0, p = r ? range(n.startRow, n.endRow).map((_) => ({ ri: _, ci: h })) : range(n.startCol, n.endCol).map((_) => ({ ri: h, ci: _ })), f = p.map((_) => {
|
|
4139
|
+
const y = r ? u : o.fieldAt(_.ci);
|
|
4140
|
+
return y ? o.getCellValue(_.ri, y) : void 0;
|
|
4141
|
+
}), g = i === "series" ? detectSeries(f) : { kind: "copy" }, m = r ? range(e.startRow, e.endRow) : range(e.startCol, e.endCol);
|
|
4142
|
+
(s === "down" || s === "right" ? m : [...m].reverse()).forEach((_, y) => {
|
|
4143
|
+
const v = y + 1, R = r ? _ : h, F = r ? h : _, S = r ? u : o.fieldAt(_);
|
|
4139
4144
|
if (!S) return;
|
|
4140
4145
|
if (g.kind !== "copy") {
|
|
4141
4146
|
const C = extrapolateValue(g, f, s, v);
|
|
4142
4147
|
a.push(planValueOrSkip(o, R, S, C, d));
|
|
4143
4148
|
return;
|
|
4144
4149
|
}
|
|
4145
|
-
const
|
|
4146
|
-
T && a.push(planCopyCell(o, R,
|
|
4150
|
+
const D = copyTileIndex(s, v, p.length), I = p[D], T = r ? u : o.fieldAt(I.ci);
|
|
4151
|
+
T && a.push(planCopyCell(o, R, F, S, I.ri, I.ci, T, d));
|
|
4147
4152
|
});
|
|
4148
4153
|
}
|
|
4149
4154
|
return { items: a, skippedFormula: l };
|
|
@@ -4181,12 +4186,12 @@ function buildPastePlan(n, e, s) {
|
|
|
4181
4186
|
for (let h = 0; h < l; h++) for (let u = 0; u < d; u++) {
|
|
4182
4187
|
const p = e.startRow + h, f = e.startCol + u, g = s.fieldAt(f);
|
|
4183
4188
|
if (!g) continue;
|
|
4184
|
-
const
|
|
4185
|
-
if (
|
|
4189
|
+
const m = s.resolveFlatRow(p);
|
|
4190
|
+
if (m.kind !== "data" || !m.rowId) {
|
|
4186
4191
|
c.push({ rowIndex: p, field: g, action: "skip", reason: "non-data-row" });
|
|
4187
4192
|
continue;
|
|
4188
4193
|
}
|
|
4189
|
-
if (s.isEditable && !s.isEditable(
|
|
4194
|
+
if (s.isEditable && !s.isEditable(m.rowId, g)) {
|
|
4190
4195
|
c.push({ rowIndex: p, field: g, action: "skip", reason: "not-editable" });
|
|
4191
4196
|
continue;
|
|
4192
4197
|
}
|
|
@@ -4346,19 +4351,19 @@ class RangeSelectionManager {
|
|
|
4346
4351
|
const r = this._rangeOpts(), a = r.seriesFill ? o : "copy", l = { resolveFlatRow: (g) => this._d.getFlatModel().resolveFlatRow(g), fieldAt: (g) => {
|
|
4347
4352
|
var _a2;
|
|
4348
4353
|
return (_a2 = this._d.getColLayout().visibleLeaves[g]) == null ? void 0 : _a2.field;
|
|
4349
|
-
}, getCellValue: (g,
|
|
4354
|
+
}, getCellValue: (g, m) => this._d.getData().getCellValue(g, m), isEditable: (g, m) => this._isEditable(g, m), hasCellFormula: (g, m) => {
|
|
4350
4355
|
var _a2, _b2;
|
|
4351
|
-
return ((_b2 = (_a2 = this._d).hasCellFormula) == null ? void 0 : _b2.call(_a2, g,
|
|
4352
|
-
}, offsetFormula: (g,
|
|
4356
|
+
return ((_b2 = (_a2 = this._d).hasCellFormula) == null ? void 0 : _b2.call(_a2, g, m)) ?? false;
|
|
4357
|
+
}, offsetFormula: (g, m, w, _) => {
|
|
4353
4358
|
var _a2, _b2;
|
|
4354
|
-
return ((_b2 = (_a2 = this._d).offsetFormula) == null ? void 0 : _b2.call(_a2, g,
|
|
4359
|
+
return ((_b2 = (_a2 = this._d).offsetFormula) == null ? void 0 : _b2.call(_a2, g, m, w, _)) ?? "";
|
|
4355
4360
|
}, overwriteFormula: r.fillOverwriteFormula }, d = buildFillPlan(e, s, i, a, l), c = [], h = [], u = [];
|
|
4356
4361
|
for (const g of d.items) if (g.action === "value") {
|
|
4357
|
-
const
|
|
4358
|
-
c.push({ rowIndex: g.rowIndex, field: g.field, oldValue:
|
|
4362
|
+
const m = this._d.getData().getCellValue(g.rowIndex, g.field);
|
|
4363
|
+
c.push({ rowIndex: g.rowIndex, field: g.field, oldValue: m, newValue: g.value }), h.push({ rowIndex: g.rowIndex, field: g.field, value: g.value });
|
|
4359
4364
|
} else if (g.action === "setFormula" && g.formula != null) {
|
|
4360
|
-
const
|
|
4361
|
-
|
|
4365
|
+
const m = this._d.getFlatModel().resolveFlatRow(g.rowIndex);
|
|
4366
|
+
m.kind === "data" && m.rowId && (u.push({ rowId: m.rowId, field: g.field, formula: g.formula }), c.push({ rowIndex: g.rowIndex, field: g.field, oldValue: this._d.getData().getCellValue(g.rowIndex, g.field), newValue: g.formula }));
|
|
4362
4367
|
}
|
|
4363
4368
|
const p = { source: e, target: s, mode: a, written: c, skippedFormula: d.skippedFormula, cancel: false };
|
|
4364
4369
|
if (this._d.emit("rangeFill", p), (_b = (_a = this._d.getOptions()).onRangeFill) == null ? void 0 : _b.call(_a, p), p.cancel) return;
|
|
@@ -4441,8 +4446,8 @@ class RangeSelectionManager {
|
|
|
4441
4446
|
if (Object.assign(this._borderEl.style, { display: "block", left: `${d}px`, top: `${c}px`, width: `${Math.max(0, h - d)}px`, height: `${Math.max(0, u - c)}px` }), this._rangeOpts().fillHandle ? Object.assign(this._handleEl.style, { display: "block", left: `${h}px`, top: `${u}px` }) : this._handleEl.style.display = "none", this._fillPreview) {
|
|
4442
4447
|
const p = this._fillPreview.target, f = e.getCellEl(p.startRow, p.startCol), g = e.getCellEl(p.endRow, p.endCol);
|
|
4443
4448
|
if (f && g) {
|
|
4444
|
-
const
|
|
4445
|
-
Object.assign(this._previewEl.style, { display: "block", left: `${
|
|
4449
|
+
const m = f.getBoundingClientRect(), w = g.getBoundingClientRect(), _ = Math.min(m.left, w.left) - i.left, y = Math.min(m.top, w.top) - i.top, v = Math.max(m.right, w.right) - i.left, R = Math.max(m.bottom, w.bottom) - i.top;
|
|
4450
|
+
Object.assign(this._previewEl.style, { display: "block", left: `${_}px`, top: `${y}px`, width: `${Math.max(0, v - _)}px`, height: `${Math.max(0, R - y)}px` });
|
|
4446
4451
|
return;
|
|
4447
4452
|
}
|
|
4448
4453
|
}
|
|
@@ -4971,23 +4976,23 @@ function extractChartData(n, e, s = {}) {
|
|
|
4971
4976
|
l = s.category ?? y.categoryField, d = y.seriesCols.map((v) => v.field);
|
|
4972
4977
|
}
|
|
4973
4978
|
const c = new Map(a.map((y) => [y.field, y])), h = l ? i.map((y) => String(y[l] ?? "")) : i.map((y, v) => String(v + 1)), u = d.map((y) => {
|
|
4974
|
-
const v = seriesSpecField(y), R = c.get(v),
|
|
4975
|
-
return
|
|
4979
|
+
const v = seriesSpecField(y), R = c.get(v), F = seriesSpecName(y, (R == null ? void 0 : R.header) ?? v), S = i.map((C) => coerceNumber(C[v])), D = typeof y == "string" ? void 0 : y.pattern, I = typeof y == "string" ? void 0 : y.color, T = { name: F, data: S };
|
|
4980
|
+
return D && (T.pattern = D), I && (T.color = I), T;
|
|
4976
4981
|
}), p = i.length;
|
|
4977
|
-
let f = h, g = u,
|
|
4982
|
+
let f = h, g = u, m, w = false;
|
|
4978
4983
|
if (s.aggregate && h.length > 0) {
|
|
4979
4984
|
const y = [], v = /* @__PURE__ */ new Map();
|
|
4980
4985
|
for (let R = 0; R < h.length; R++) {
|
|
4981
|
-
const
|
|
4982
|
-
v.has(
|
|
4986
|
+
const F = h[R];
|
|
4987
|
+
v.has(F) ? v.get(F).push(R) : (v.set(F, [R]), y.push(F));
|
|
4983
4988
|
}
|
|
4984
|
-
y.length < h.length && (f = y, g = u.map((R) => ({ ...R, data: y.map((
|
|
4985
|
-
const
|
|
4986
|
-
return
|
|
4987
|
-
}) })),
|
|
4989
|
+
y.length < h.length && (f = y, g = u.map((R) => ({ ...R, data: y.map((F) => {
|
|
4990
|
+
const D = v.get(F).map((I) => R.data[I]).filter((I) => I !== null);
|
|
4991
|
+
return D.length ? aggregateValues(D, F, s.aggregate) : null;
|
|
4992
|
+
}) })), m = typeof s.aggregate == "function" ? "custom" : s.aggregate, w = true);
|
|
4988
4993
|
}
|
|
4989
|
-
const
|
|
4990
|
-
return
|
|
4994
|
+
const _ = { categories: f, series: g, meta: { sourceKind: o, total: p, sampled: w, a11yTable: buildA11yTable({ categories: f, series: g }, { title: s.title, numberFormat: s.numberFormat }) } };
|
|
4995
|
+
return m && (_.meta.aggregatedOp = m), { model: _, rangeFallback: r };
|
|
4991
4996
|
}
|
|
4992
4997
|
function isLineLike(n) {
|
|
4993
4998
|
return n === "line" || n === "area";
|
|
@@ -5017,11 +5022,11 @@ function lttbIndices(n, e) {
|
|
|
5017
5022
|
const p = u - h;
|
|
5018
5023
|
for (let v = h; v < u; v++) d += v, c += i(v);
|
|
5019
5024
|
p > 0 && (d /= p, c /= p);
|
|
5020
|
-
const f = Math.floor(l * r) + 1, g = Math.floor((l + 1) * r) + 1,
|
|
5021
|
-
let
|
|
5025
|
+
const f = Math.floor(l * r) + 1, g = Math.floor((l + 1) * r) + 1, m = a, w = i(a);
|
|
5026
|
+
let _ = -1, y = f;
|
|
5022
5027
|
for (let v = f; v < g && v < s; v++) {
|
|
5023
|
-
const R = Math.abs((
|
|
5024
|
-
R >
|
|
5028
|
+
const R = Math.abs((m - d) * (i(v) - w) - (m - v) * (c - w)) * 0.5;
|
|
5029
|
+
R > _ && (_ = R, y = v);
|
|
5025
5030
|
}
|
|
5026
5031
|
o.push(y), a = y;
|
|
5027
5032
|
}
|
|
@@ -5043,16 +5048,16 @@ function downsampleModel(n, e, s, i = {}) {
|
|
|
5043
5048
|
let p = [...h].sort((f, g) => f - g);
|
|
5044
5049
|
if (p.length > e) {
|
|
5045
5050
|
const f = /* @__PURE__ */ new Set([0, o - 1]), g = n.series.map((w) => envelopeIndices(w.data));
|
|
5046
|
-
let
|
|
5047
|
-
for (;
|
|
5048
|
-
|
|
5051
|
+
let m = true;
|
|
5052
|
+
for (; m && f.size < e; ) {
|
|
5053
|
+
m = false;
|
|
5049
5054
|
for (const w of g) {
|
|
5050
5055
|
if (f.size >= e) break;
|
|
5051
|
-
const
|
|
5052
|
-
|
|
5056
|
+
const _ = w.find((y) => !f.has(y));
|
|
5057
|
+
_ !== void 0 && (f.add(_), m = true);
|
|
5053
5058
|
}
|
|
5054
5059
|
}
|
|
5055
|
-
p = [...f].sort((w,
|
|
5060
|
+
p = [...f].sort((w, _) => w - _).slice(0, e);
|
|
5056
5061
|
}
|
|
5057
5062
|
r = p.map((f) => n.categories[f]), a = n.series.map((f) => ({ ...f, data: p.map((g) => f.data[g]) }));
|
|
5058
5063
|
} else {
|
|
@@ -5063,16 +5068,16 @@ function downsampleModel(n, e, s, i = {}) {
|
|
|
5063
5068
|
const p = Math.floor(u * c), f = Math.min(Math.floor((u + 1) * c), o);
|
|
5064
5069
|
if (p >= f) continue;
|
|
5065
5070
|
h.push([p, f]);
|
|
5066
|
-
const g = n.categories[p],
|
|
5067
|
-
r.push(f - p > 1 ? `${g}…${
|
|
5071
|
+
const g = n.categories[p], m = n.categories[f - 1];
|
|
5072
|
+
r.push(f - p > 1 ? `${g}…${m}` : g);
|
|
5068
5073
|
}
|
|
5069
5074
|
a = n.series.map((u) => ({ ...u, data: h.map(([p, f]) => {
|
|
5070
|
-
let g = 0,
|
|
5075
|
+
let g = 0, m = false;
|
|
5071
5076
|
for (let w = p; w < f; w++) {
|
|
5072
|
-
const
|
|
5073
|
-
|
|
5077
|
+
const _ = numericOf(u.data[w]);
|
|
5078
|
+
_ != null && (g += _, m = true);
|
|
5074
5079
|
}
|
|
5075
|
-
return
|
|
5080
|
+
return m ? g : null;
|
|
5076
5081
|
}) }));
|
|
5077
5082
|
}
|
|
5078
5083
|
return { model: { categories: r, series: a, meta: { ...n.meta, sampled: true, sampledFrom: o, sampledTo: r.length, a11yTable: buildA11yTable({ categories: r, series: a }, { title: i.title, numberFormat: i.numberFormat }) } }, sampled: true };
|
|
@@ -5305,21 +5310,21 @@ class CanvasAdapter {
|
|
|
5305
5310
|
}), (!Number.isFinite(s) || !Number.isFinite(i)) && (s = 0, i = 1), (this._spec.type === "bar" || this._spec.type === "bar-stacked" || this._spec.type === "bar-grouped") && (s = Math.min(0, s), i = Math.max(0, i)), { min: s, max: i };
|
|
5306
5311
|
}
|
|
5307
5312
|
_computeGeometry(e, s) {
|
|
5308
|
-
const i = [], o = this._plotRect(), a = e.categories.length || 1, { min: l, max: d } = this._valueExtent(e), c = niceScale(l, d, 6), h = (
|
|
5309
|
-
const w = (
|
|
5313
|
+
const i = [], o = this._plotRect(), a = e.categories.length || 1, { min: l, max: d } = this._valueExtent(e), c = niceScale(l, d, 6), h = (m) => {
|
|
5314
|
+
const w = (m - c.min) / (c.max - c.min || 1);
|
|
5310
5315
|
return o.y + o.h - w * o.h;
|
|
5311
|
-
}, u = h(0 < c.min ? c.min : 0 > c.max ? c.max : 0), p = o.w / a, f = s.type === "line" || s.type === "area", g = e.series.map((
|
|
5312
|
-
if (f) for (const { s:
|
|
5313
|
-
const v = o.x + p * y + p / 2, R =
|
|
5316
|
+
}, u = h(0 < c.min ? c.min : 0 > c.max ? c.max : 0), p = o.w / a, f = s.type === "line" || s.type === "area", g = e.series.map((m, w) => ({ s: m, si: w })).filter(({ si: m }) => !this._hidden.has(m));
|
|
5317
|
+
if (f) for (const { s: m, si: w } of g) m.data.forEach((_, y) => {
|
|
5318
|
+
const v = o.x + p * y + p / 2, R = _ == null ? NaN : h(_);
|
|
5314
5319
|
Number.isNaN(R) || i.push({ seriesIndex: w, categoryIndex: y, x: v - MARKER_R, y: R - MARKER_R, w: MARKER_R * 2, h: MARKER_R * 2, cx: v, cy: R });
|
|
5315
5320
|
});
|
|
5316
5321
|
else {
|
|
5317
|
-
const
|
|
5322
|
+
const m = g.length || 1, w = p * 0.72, _ = w / m;
|
|
5318
5323
|
g.forEach(({ s: y, si: v }, R) => {
|
|
5319
|
-
y.data.forEach((
|
|
5320
|
-
if (
|
|
5321
|
-
const
|
|
5322
|
-
i.push({ seriesIndex: v, categoryIndex: S, x:
|
|
5324
|
+
y.data.forEach((F, S) => {
|
|
5325
|
+
if (F == null || Number.isNaN(F)) return;
|
|
5326
|
+
const I = o.x + p * S + (p - w) / 2 + _ * R, T = h(F), C = Math.min(T, u), L = Math.abs(u - T);
|
|
5327
|
+
i.push({ seriesIndex: v, categoryIndex: S, x: I, y: C, w: _, h: L, cx: I + _ / 2, cy: C + L / 2 });
|
|
5323
5328
|
});
|
|
5324
5329
|
});
|
|
5325
5330
|
}
|
|
@@ -5333,33 +5338,33 @@ class CanvasAdapter {
|
|
|
5333
5338
|
const r = i.getContext ? i.getContext("2d") : null;
|
|
5334
5339
|
if (!r) return;
|
|
5335
5340
|
r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, this._w, this._h);
|
|
5336
|
-
const a = s.theme, l = this._plotRect(), { min: d, max: c } = this._valueExtent(e), h = niceScale(d, c, 6), u = (
|
|
5337
|
-
const w = (
|
|
5341
|
+
const a = s.theme, l = this._plotRect(), { min: d, max: c } = this._valueExtent(e), h = niceScale(d, c, 6), u = (m) => {
|
|
5342
|
+
const w = (m - h.min) / (h.max - h.min || 1);
|
|
5338
5343
|
return l.y + l.h - w * l.h;
|
|
5339
5344
|
};
|
|
5340
5345
|
r.strokeStyle = (a == null ? void 0 : a.gridLine) || (a == null ? void 0 : a.border) || "#e0e0e0", r.fillStyle = (a == null ? void 0 : a.text) || "#212121", r.lineWidth = 1, r.font = `${(a == null ? void 0 : a.fontSize) || 12}px ${(a == null ? void 0 : a.fontFamily) || "sans-serif"}`, r.textAlign = "right", r.textBaseline = "middle";
|
|
5341
|
-
for (const
|
|
5342
|
-
const w = u(
|
|
5343
|
-
r.beginPath(), r.moveTo(l.x, w), r.lineTo(l.x + l.w, w), r.stroke(), r.fillText(fmt(
|
|
5346
|
+
for (const m of h.ticks) {
|
|
5347
|
+
const w = u(m);
|
|
5348
|
+
r.beginPath(), r.moveTo(l.x, w), r.lineTo(l.x + l.w, w), r.stroke(), r.fillText(fmt(m, s, "y"), l.x - 6, w);
|
|
5344
5349
|
}
|
|
5345
5350
|
r.textAlign = "center", r.textBaseline = "top";
|
|
5346
5351
|
const p = l.w / (e.categories.length || 1);
|
|
5347
|
-
e.categories.forEach((
|
|
5348
|
-
const
|
|
5349
|
-
r.fillText(String(
|
|
5352
|
+
e.categories.forEach((m, w) => {
|
|
5353
|
+
const _ = l.x + p * w + p / 2;
|
|
5354
|
+
r.fillText(String(m), _, l.y + l.h + 6);
|
|
5350
5355
|
});
|
|
5351
5356
|
const f = this._styles(e, s);
|
|
5352
5357
|
if (s.type === "line" || s.type === "area") {
|
|
5353
|
-
const
|
|
5358
|
+
const m = /* @__PURE__ */ new Map();
|
|
5354
5359
|
for (const w of this._geoms) {
|
|
5355
|
-
let
|
|
5356
|
-
|
|
5360
|
+
let _ = m.get(w.seriesIndex);
|
|
5361
|
+
_ || (_ = [], m.set(w.seriesIndex, _)), _.push(w);
|
|
5357
5362
|
}
|
|
5358
|
-
for (const [w,
|
|
5359
|
-
|
|
5360
|
-
for (const y of
|
|
5363
|
+
for (const [w, _] of m) {
|
|
5364
|
+
_.sort((y, v) => y.categoryIndex - v.categoryIndex), r.strokeStyle = f[w].color, r.lineWidth = 2, r.setLineDash(dashFor(f[w].pattern)), r.beginPath(), _.forEach((y, v) => v === 0 ? r.moveTo(y.cx, y.cy) : r.lineTo(y.cx, y.cy)), r.stroke(), r.setLineDash([]), r.fillStyle = f[w].color;
|
|
5365
|
+
for (const y of _) r.beginPath(), r.arc(y.cx, y.cy, MARKER_R, 0, Math.PI * 2), r.fill();
|
|
5361
5366
|
}
|
|
5362
|
-
} else for (const
|
|
5367
|
+
} else for (const m of this._geoms) r.fillStyle = f[m.seriesIndex].color, r.fillRect(m.x, m.y, m.w, m.h), paintPattern(r, m, f[m.seriesIndex].pattern);
|
|
5363
5368
|
}
|
|
5364
5369
|
_localXY(e) {
|
|
5365
5370
|
var _a;
|
|
@@ -5437,7 +5442,7 @@ class ChartManager {
|
|
|
5437
5442
|
try {
|
|
5438
5443
|
this._charts.set(s, u);
|
|
5439
5444
|
const { model: p, rangeFallback: f } = this._extract(u);
|
|
5440
|
-
u.model = p, u.spec = this._buildSpec(e, p), u.renderSize = this._resolveRenderSize(e, d), r.init(d, u.spec), r.resize(u.renderSize.width, u.renderSize.height), r.render(p, u.spec), (_a = r.onPointClick) == null ? void 0 : _a.call(r, (
|
|
5445
|
+
u.model = p, u.spec = this._buildSpec(e, p), u.renderSize = this._resolveRenderSize(e, d), r.init(d, u.spec), r.resize(u.renderSize.width, u.renderSize.height), r.render(p, u.spec), (_a = r.onPointClick) == null ? void 0 : _a.call(r, (m) => this._onPointClick(u, m)), this._renderBadges(u, f, a), e.live !== false && this._subscribeLive(u), this._attachResizeObserver(u);
|
|
5441
5446
|
const g = this._makeInstance(u);
|
|
5442
5447
|
return this._bindOptionCallbacks(u), this._emit(u, "chartCreate", g), this._d.emit("chartCreate", g), g;
|
|
5443
5448
|
} catch (p) {
|
|
@@ -5823,16 +5828,16 @@ function openCrossGridMapper(n, e) {
|
|
|
5823
5828
|
d.style.cssText = "padding:6px 20px;";
|
|
5824
5829
|
const c = `<option value="">${t("crossGrid.emptyOption")}</option>` + n.map((S) => `<option value="${esc(S.field)}">${esc(S.header)} <${esc(S.field)}></option>`).join("");
|
|
5825
5830
|
for (const S of e) {
|
|
5826
|
-
const I = document.createElement("div");
|
|
5827
|
-
I.style.cssText = "display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f0f0f0;";
|
|
5828
5831
|
const D = document.createElement("div");
|
|
5829
|
-
D.style.cssText = "flex
|
|
5832
|
+
D.style.cssText = "display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f0f0f0;";
|
|
5833
|
+
const I = document.createElement("div");
|
|
5834
|
+
I.style.cssText = "flex:1;font-size:13px;min-width:0;", I.innerHTML = `<span style="font-weight:600;">${esc(S.header)}</span><span style="color:#999;font-size:11.5px;"> <${esc(S.field)}></span>`;
|
|
5830
5835
|
const T = document.createElement("span");
|
|
5831
5836
|
T.textContent = "←", T.style.cssText = "color:#888;flex-shrink:0;";
|
|
5832
5837
|
const C = document.createElement("select");
|
|
5833
5838
|
C.style.cssText = "flex:1;min-width:0;padding:6px 8px;border:1px solid #ccc;border-radius:6px;font-size:13px;background:#fff;", C.innerHTML = c, C.value = o[S.field] ?? NONE, C.addEventListener("change", () => {
|
|
5834
|
-
o[S.field] = C.value,
|
|
5835
|
-
}),
|
|
5839
|
+
o[S.field] = C.value, m();
|
|
5840
|
+
}), D.append(I, T, C), d.appendChild(D);
|
|
5836
5841
|
}
|
|
5837
5842
|
a.appendChild(d);
|
|
5838
5843
|
const h = document.createElement("div");
|
|
@@ -5846,10 +5851,10 @@ function openCrossGridMapper(n, e) {
|
|
|
5846
5851
|
function g() {
|
|
5847
5852
|
return buildMappingScript(o);
|
|
5848
5853
|
}
|
|
5849
|
-
function
|
|
5854
|
+
function m() {
|
|
5850
5855
|
f.textContent = g();
|
|
5851
5856
|
}
|
|
5852
|
-
|
|
5857
|
+
m(), p.addEventListener("click", () => {
|
|
5853
5858
|
var _a;
|
|
5854
5859
|
const S = g();
|
|
5855
5860
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(S).then(() => {
|
|
@@ -5860,20 +5865,20 @@ function openCrossGridMapper(n, e) {
|
|
|
5860
5865
|
});
|
|
5861
5866
|
const w = document.createElement("div");
|
|
5862
5867
|
w.style.cssText = "display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;";
|
|
5863
|
-
const
|
|
5864
|
-
|
|
5868
|
+
const _ = document.createElement("button");
|
|
5869
|
+
_.type = "button", _.textContent = t("crossGrid.cancel"), _.style.cssText = "font-size:13px;padding:8px 16px;border:1px solid #ccc;border-radius:7px;background:#fff;cursor:pointer;";
|
|
5865
5870
|
const y = document.createElement("button");
|
|
5866
|
-
y.type = "button", y.textContent = t("crossGrid.applyMove"), y.style.cssText = "font-size:13px;padding:8px 16px;border:0;border-radius:7px;background:#1976d2;color:#fff;cursor:pointer;font-weight:600;", w.append(
|
|
5871
|
+
y.type = "button", y.textContent = t("crossGrid.applyMove"), y.style.cssText = "font-size:13px;padding:8px 16px;border:0;border-radius:7px;background:#1976d2;color:#fff;cursor:pointer;font-weight:600;", w.append(_, y), a.appendChild(w);
|
|
5867
5872
|
let v = false;
|
|
5868
5873
|
function R(S) {
|
|
5869
|
-
v || (v = true, document.removeEventListener("keydown",
|
|
5874
|
+
v || (v = true, document.removeEventListener("keydown", F), r.remove(), s(S));
|
|
5870
5875
|
}
|
|
5871
|
-
function
|
|
5876
|
+
function F(S) {
|
|
5872
5877
|
S.key === "Escape" && R(null);
|
|
5873
5878
|
}
|
|
5874
|
-
|
|
5879
|
+
_.addEventListener("click", () => R(null)), r.addEventListener("mousedown", (S) => {
|
|
5875
5880
|
S.target === r && R(null);
|
|
5876
|
-
}), y.addEventListener("click", () => R({ mapping: { ...o }, script: g() })), document.addEventListener("keydown",
|
|
5881
|
+
}), y.addEventListener("click", () => R({ mapping: { ...o }, script: g() })), document.addEventListener("keydown", F), document.body.appendChild(r), y.focus();
|
|
5877
5882
|
});
|
|
5878
5883
|
}
|
|
5879
5884
|
function esc(n) {
|
|
@@ -6905,7 +6910,7 @@ const _OpenGrid = class _OpenGrid extends EventEmitter {
|
|
|
6905
6910
|
this._cf = null, this._cfStats.clear(), this._doRender(...this._visRange());
|
|
6906
6911
|
return;
|
|
6907
6912
|
}
|
|
6908
|
-
const s = await Promise.resolve().then(() => require("./index-
|
|
6913
|
+
const s = await Promise.resolve().then(() => require("./index-B_e5BXnW.cjs"));
|
|
6909
6914
|
this._cf = new s.CFEngine(new s.CFRuleStore(e)), this._cfAppearance = s.staticAppearanceView(), this._cfComputeStats = s.computeColumnStats, this._recomputeCFStats(), this._doRender(...this._visRange());
|
|
6910
6915
|
}
|
|
6911
6916
|
_recomputeCFStats() {
|
|
@@ -7382,4 +7387,4 @@ _OpenGrid.defaults = { strategy(e, s) {
|
|
|
7382
7387
|
} };
|
|
7383
7388
|
let OpenGrid = _OpenGrid;
|
|
7384
7389
|
exports.DEFAULT_ICON_ROLES = DEFAULT_ICON_ROLES, exports.IconRegistry = IconRegistry, exports.LocaleRegistry = LocaleRegistry, exports.OpenGrid = OpenGrid, exports.SkinRegistry = SkinRegistry, exports.buildTree = buildTree, exports.contrastRatio = contrastRatio, exports.iconRegistry = iconRegistry, exports.localeRegistry = localeRegistry, exports.parseColor = parseColor, exports.renderIcon = renderIcon, exports.skinRegistry = skinRegistry, exports.t = t;
|
|
7385
|
-
//# sourceMappingURL=OpenGrid-
|
|
7390
|
+
//# sourceMappingURL=OpenGrid-DgZtbVD0.cjs.map
|