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.
Files changed (59) hide show
  1. package/CHANGELOG.md +460 -418
  2. package/README.ja.md +39 -0
  3. package/README.md +39 -0
  4. package/README.zh.md +39 -0
  5. package/dist/{OpenGrid-CT9bV6On.cjs → OpenGrid-DgZtbVD0.cjs} +343 -338
  6. package/dist/{OpenGrid-DACnZdEy.js → OpenGrid-E11B7Xa7.js} +782 -777
  7. package/dist/angular/fesm2022/open-grid-angular.mjs +247 -0
  8. package/dist/angular/index.d.ts +5 -0
  9. package/dist/angular/lib/open-grid.component.d.ts +97 -0
  10. package/dist/angular/public-api.d.ts +6 -0
  11. package/dist/{index-Brfso4Ry.cjs → index-B_e5BXnW.cjs} +2 -2
  12. package/dist/{index-al9Mbv3E.js → index-Brnev66-.js} +2 -2
  13. package/dist/open-grid-base.css +4 -4
  14. package/dist/open-grid-header.cjs +4 -4
  15. package/dist/open-grid-header.css +21 -21
  16. package/dist/open-grid-header.js +4 -4
  17. package/dist/open-grid-react.cjs +1 -1
  18. package/dist/open-grid-react.js +1 -1
  19. package/dist/open-grid-skins.css +2 -2
  20. package/dist/open-grid-themes.css +48 -48
  21. package/dist/open-grid-typography.cjs +2 -2
  22. package/dist/open-grid-typography.js +2 -2
  23. package/dist/open-grid-vue.cjs +1 -1
  24. package/dist/open-grid-vue.js +1 -1
  25. package/dist/open-grid.cjs +1 -1
  26. package/dist/open-grid.js +2 -2
  27. package/dist/types/core/DetailManager.d.ts +1 -1
  28. package/dist/types/core/ExportManager.d.ts +7 -0
  29. package/dist/types/core/ExtensionPointRegistry.d.ts +2 -2
  30. package/dist/types/core/OpenGrid.d.ts +14 -9
  31. package/dist/types/core/appearance/AppearanceAxis.d.ts +54 -6
  32. package/dist/types/core/appearance/HeaderRegistry.d.ts +213 -21
  33. package/dist/types/core/appearance/TypographyRegistry.d.ts +63 -3
  34. package/dist/types/core/chart/DataExtractor.d.ts +1 -1
  35. package/dist/types/core/detail/DetailGlyph.d.ts +3 -3
  36. package/dist/types/core/types.d.ts +9 -9
  37. package/dist/types/header/index.d.ts +146 -6
  38. package/dist/types/typography/index.d.ts +134 -4
  39. package/package.json +42 -13
  40. package/dist/OpenGrid-CT9bV6On.cjs.map +0 -1
  41. package/dist/OpenGrid-DACnZdEy.js.map +0 -1
  42. package/dist/Registry-CPJYOqCn.js.map +0 -1
  43. package/dist/Registry-D74ZmdDz.cjs.map +0 -1
  44. package/dist/index-Brfso4Ry.cjs.map +0 -1
  45. package/dist/index-CeJ-0-80.cjs.map +0 -1
  46. package/dist/index-DnarQ4eR.js.map +0 -1
  47. package/dist/index-al9Mbv3E.js.map +0 -1
  48. package/dist/open-grid-header.cjs.map +0 -1
  49. package/dist/open-grid-header.js.map +0 -1
  50. package/dist/open-grid-react.cjs.map +0 -1
  51. package/dist/open-grid-react.js.map +0 -1
  52. package/dist/open-grid-typography.cjs.map +0 -1
  53. package/dist/open-grid-typography.js.map +0 -1
  54. package/dist/open-grid-vue.cjs.map +0 -1
  55. package/dist/open-grid-vue.js.map +0 -1
  56. package/dist/open-grid.cjs.map +0 -1
  57. package/dist/open-grid.js.map +0 -1
  58. package/dist/xlsx.min-BQ1o3sB6.cjs.map +0 -1
  59. 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 _ = document.createElement("option");
322
- _.value = g.value, _.textContent = g.label, a.appendChild(_);
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 _ = f / h;
459
- g >= u && (_ += 1n), s = p ? -_ : _;
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), _ = p.includes(","), w = p.includes(".") ? p.split(".")[1].length : s ?? 0, m = h.toLocaleString("ko-KR", { minimumFractionDigits: w, maximumFractionDigits: w, useGrouping: _ });
753
- return f + m + g;
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((_, w) => {
951
- const m = (_ - u) / p * (r - 2);
952
- c.fillStyle = a, c.fillRect(w * g + 1, r - m - 1, g - 2, m);
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((_, w) => ({ x: w / (f - 1 || 1) * o, y: r - (_ - u) / p * (r - 4) - 2 }));
956
- l === "area" && (c.fillStyle = a + "33", c.beginPath(), c.moveTo(g[0].x, r), g.forEach((_) => c.lineTo(_.x, _.y)), c.lineTo(g[g.length - 1].x, r), c.closePath(), c.fill()), c.strokeStyle = a, c.lineWidth = 1.5, c.beginPath(), g.forEach((_, w) => w === 0 ? c.moveTo(_.x, _.y) : c.lineTo(_.x, _.y)), c.stroke();
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, m, y) => w + (i[y] ?? r.defaultColumnWidth), 0);
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 _ = (w, m, y, v = "") => {
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: `${m}px`, minWidth: `${m}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 += m, w.appendChild(R);
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 m = _el("tr", "og-header-row");
1110
- if (m.style.height = `${r.headerHeight}px`, w === 0) {
1111
- if (r.stateColumn && _(m, 24, ""), r.draggable && _(m, 18, ""), r.rowNumber && _(m, 44, "No"), r.checkColumn) {
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), m.appendChild(y);
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 && _(m, c, "", "og-detail-toggle-col");
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 A = y.colSpan === 1 ? s.findIndex((M) => M.field === R.field) : -1;
1122
+ const F = y.colSpan === 1 ? s.findIndex((M) => M.field === R.field) : -1;
1123
1123
  if (y.colSpan === 1) {
1124
- const M = A >= 0 ? i[A] ?? r.defaultColumnWidth : R.width ?? r.defaultColumnWidth;
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), I = R.sortable !== false && r.sortable && y.colSpan === 1;
1128
- if (v.setAttribute("role", "columnheader"), v.setAttribute("scope", "col"), I && (v.setAttribute("aria-sort", S ? S.dir === "asc" ? "ascending" : "descending" : "none"), v.tabIndex = A === 0 ? 0 : -1, v.addEventListener("keydown", (M) => {
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 L = v.nextElementSibling;
1133
- (L == null ? void 0 : L.tagName) === "TH" && L.focus();
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 L = v.previousElementSibling;
1137
- (L == null ? void 0 : L.tagName) === "TH" && L.focus();
1136
+ const A = v.previousElementSibling;
1137
+ (A == null ? void 0 : A.tagName) === "TH" && A.focus();
1138
1138
  }
1139
- })), A >= 0 && A < l) {
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 L = 0; L < A; L++) M += i[L] ?? r.defaultColumnWidth;
1143
- v.classList.add("og-frozen"), A === l - 1 && v.classList.add("og-frozen-last"), v.style.left = `${M}px`;
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 D = R.header ?? R.field, T = typeof D == "string" && D.indexOf(`
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: I ? "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 : D) ?? "";
1148
- const E = _el("span");
1149
- if (C ? (E.style.cssText = "overflow:visible;text-overflow:clip;white-space:normal;word-break:break-word;", String(D).split(`
1150
- `).forEach((L, H) => {
1151
- H > 0 && E.appendChild(document.createElement("br")), E.appendChild(document.createTextNode(L));
1152
- })) : (E.textContent = D, E.style.cssText = "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"), v.appendChild(E), S) {
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"), L = (((_d = (_c = r._activeFilters) == null ? void 0 : _c[R.field]) == null ? void 0 : _d.length) ?? 0) > 0;
1159
- M.textContent = L ? "⊿" : "▿", M.title = this._t("grid.filterTooltip"), M.style.cssText = "margin-left:3px;cursor:pointer;font-size:10px;opacity:0.6;", L && M.classList.add("og-filter-icon--active"), M.addEventListener("click", (H) => {
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 L = A;
1166
+ const A = F;
1167
1167
  _addResizer(M, v, (H) => {
1168
- L >= 0 && this._cbs.onColResize(L, H);
1168
+ A >= 0 && this._cbs.onColResize(A, H);
1169
1169
  });
1170
1170
  }
1171
- r.columnReorder && A >= 0 && y.colSpan === 1 && (v.draggable = true, v.addEventListener("dragstart", (M) => {
1171
+ r.columnReorder && F >= 0 && y.colSpan === 1 && (v.draggable = true, v.addEventListener("dragstart", (M) => {
1172
1172
  var _a2;
1173
- this._cbs.onColDragStart(A), v.classList.add("og-col-dragging"), (_a2 = M.dataTransfer) == null ? void 0 : _a2.setData("text/plain", String(A));
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 L = this._cbs.getColDragIdx();
1179
- L !== null && L !== A && (this._header.querySelectorAll(".og-col-drop-over").forEach((H) => H.classList.remove("og-col-drop-over")), v.classList.add("og-col-drop-over"));
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(A);
1184
- })), I && v.addEventListener("click", (M) => {
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
- }), m.appendChild(v);
1186
+ }), _.appendChild(v);
1187
1187
  }
1188
- p.appendChild(m);
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: _, detailApi: w } = e;
1195
- let m = e.opts;
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 && (m = { ...m, ...g }), w == null ? void 0 : w.onBeforeTeardown(), this._body.innerHTML = "", this._cellMap.clear();
1198
- const v = m.autoHeight === true;
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 = m._frozenCount ?? 0, A = !!w && (w.toggleMode ?? "expander-col") === "expander-col", S = 28;
1201
- let I = 0;
1202
- m.stateColumn && (I += 24), m.draggable && (I += 18), m.rowNumber && (I += 44), m.checkColumn && (I += 36), A && (I += S);
1203
- const D = I + r.reduce((C, E, B) => C + (a[B] ?? m.defaultColumnWidth), 0);
1204
- if (this._body.style.minWidth = `${D}px`, i < s) return;
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 E = u[C];
1208
- if (!(E && E._isDetailFiller === true)) {
1209
- if (E && E._isDetailHead === true && C + E._span - 1 >= s) {
1210
- const B = l + (C - s) * m.rowHeight;
1211
- this._appendDetailPanel(T, E._rowId, B, E._span * m.rowHeight, D, w);
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 E = u ? u[C] : null;
1218
- if (E && E._isDetailFiller === true) continue;
1219
- if (E && E._isDetailHead === true && w) {
1220
- const x = E, F = l + (C - s) * m.rowHeight;
1221
- this._appendDetailPanel(T, x._rowId, F, x._span * m.rowHeight, D, w);
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 (E && E._isDetailHead === true) continue;
1225
- const B = E && E._isGroup === true, M = E && E._isTree === true;
1226
- if (B) {
1227
- const x = E, F = `__${x._groupField}:${x._groupValue}`, z = _el("div", "og-group-row"), te = l + (C - s) * m.rowHeight;
1228
- z.style.cssText = [v ? "" : `top:${te}px;height:${m.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(""), z.setAttribute("role", "row"), z.setAttribute("aria-expanded", x._expanded ? "true" : "false"), z.setAttribute("aria-rowindex", String(C + 1)), z.setAttribute("aria-level", String(x._depth + 1));
1229
- let P = 0;
1230
- if (m.stateColumn && (P += 24), m.draggable && (P += 18), m.rowNumber && (P += 44), m.checkColumn && (P += 36), A && (P += S), P > 0) {
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:${P}px;min-width:${P}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 V = x._states ?? { added: 0, edited: 0, removed: 0 };
1234
- if (V.added > 0) {
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 = `+${V.added}`, O.style.cssText = `color:var(--og-row-added-bg,#2e7d32);background:#e8f5e9;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
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 (V.edited > 0) {
1238
+ if (N.edited > 0) {
1239
1239
  const O = _el("span");
1240
- O.textContent = `M${V.edited}`, O.style.cssText = `color:#e65100;background:#fff8e1;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
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 (V.removed > 0) {
1242
+ if (N.removed > 0) {
1243
1243
  const O = _el("span");
1244
- O.textContent = `D${V.removed}`, O.style.cssText = `color:var(--og-row-removed-bg,#c62828);background:#ffebee;padding:1px 3px;border-radius:${y.radius(3)};`, b.appendChild(O);
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
- z.appendChild(b);
1246
+ $.appendChild(b);
1247
1247
  }
1248
1248
  let J = false;
1249
1249
  for (let b = 0; b < r.length; b++) {
1250
- const V = r[b], O = a[b] ?? m.defaultColumnWidth, ne = x._summaryFmt !== void 0 && V.field in (x._summaryFmt ?? {}), K = _el("div", "og-group-cell");
1251
- if (K.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(""), ne) {
1252
- const X = x._summaryFmt[V.field];
1253
- K.textContent = X !== "" ? X : "-", K.style.justifyContent = "flex-end", K.style.color = "var(--og-primary,#1976d2)", K.style.fontWeight = "600";
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;", K.appendChild(X);
1258
- const Y = _el("span", "og-group-label");
1259
- Y.textContent = this._t("group.badge", { label: x._groupLabel, count: x._childCount }), Y.style.cssText = "overflow:hidden;text-overflow:ellipsis;font-weight:600;", K.appendChild(Y), K.style.gap = "0";
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
- z.appendChild(K);
1261
+ $.appendChild(V);
1262
1262
  }
1263
- z.addEventListener("click", () => p == null ? void 0 : p(F)), T.appendChild(z);
1263
+ $.addEventListener("click", () => p == null ? void 0 : p(E)), T.appendChild($);
1264
1264
  continue;
1265
1265
  }
1266
- const L = M ? E : null, H = L ? L.data : u ? E : o.getRowByIndex(C);
1266
+ const A = M ? L : null, H = A ? A.data : u ? L : o.getRowByIndex(C);
1267
1267
  if (!H) continue;
1268
- const G = M || B ? "none" : o.getRowState(C), $ = _el("div", "og-row");
1269
- if ($.setAttribute("role", "row"), $.setAttribute("aria-rowindex", String(C + 1)), !v) {
1270
- const x = l + (C - s) * m.rowHeight;
1271
- $.style.top = `${x}px`, $.style.height = `${m.rowHeight}px`;
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
- $.style.background = W, G === "added" && $.classList.add("og-state-added"), G === "edited" && $.classList.add("og-state-edited"), G === "removed" && $.classList.add("og-state-removed"), c.has(C) && $.classList.add("og-selected"), $.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 re = C;
1276
- $.addEventListener("click", (x) => {
1277
- this._cbs.onCellClick(re, -1, x);
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 ae = /* @__PURE__ */ new Map();
1280
- let q = 0;
1281
- if (m.stateColumn) {
1282
- const x = _el("div", "og-cell og-col-state"), F = { added: "✚", edited: "✎", removed: "✖", none: "" }, z = { added: "#2e7d32", edited: "#bf360c", removed: "#c62828", none: "" };
1283
- x.textContent = F[G] ?? "", x.style.color = z[G] ?? "", x.title = G, R > 0 && (x.style.position = "sticky", x.style.left = `${q}px`, x.style.zIndex = "2", x.style.background = W), q += 24, $.appendChild(x);
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 le = this._cbs.getDndManager();
1286
- if (m.draggable && le) {
1287
- const x = le.attachHandle($, C, m._totalRows ?? i + 1);
1288
- R > 0 && (x.style.position = "sticky", x.style.left = `${q}px`, x.style.zIndex = "2", x.style.background = W), q += 18, $.appendChild(x);
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 (m.rowNumber) {
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 = `${q}px`, x.style.zIndex = "2", x.style.background = W), q += 44, $.appendChild(x);
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 (m.checkColumn) {
1295
- const x = _el("div", "og-cell og-col-check"), F = document.createElement("input");
1296
- F.type = "checkbox", F.checked = h.has(C), F.setAttribute("aria-label", this._t("row.selectAria", { n: C + 1 })), F.addEventListener("click", (z) => z.stopPropagation()), F.addEventListener("change", (z) => {
1297
- z.stopPropagation(), this._cbs.onRowCheck(C, F.checked);
1298
- }), x.appendChild(F), R > 0 && (x.style.position = "sticky", x.style.left = `${q}px`, x.style.zIndex = "2", x.style.background = W), q += 36, $.appendChild(x);
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 (A) {
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 F = w.getRowId(H), z = !!F && w.isExpanded(F), te = w.getGlyph(z), P = _el("span", "og-detail-expander");
1304
- P.textContent = te.glyph, P.title = te.title, P.setAttribute("role", "button"), P.setAttribute("tabindex", "0"), P.setAttribute("aria-label", te.ariaLabel), F && P.setAttribute("aria-controls", `og-detail-${F}`), P.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 = F, b = C, V = (O) => {
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
- P.addEventListener("click", V), P.addEventListener("keydown", (O) => {
1309
- (O.key === "Enter" || O.key === " ") && (O.preventDefault(), V(O));
1310
- }), x.appendChild(P), R > 0 && (x.style.position = "sticky", x.style.left = `${q}px`, x.style.zIndex = "2", x.style.background = W), x.style.width = `${S}px`, x.style.minWidth = `${S}px`, q += S, $.appendChild(x), F && $.setAttribute("aria-expanded", z ? "true" : "false");
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 F = r[x], z = a[x] ?? m.defaultColumnWidth, te = m.editable && F.editable !== false, P = x === 0, J = _ && !_.isEmpty ? _.getInfo(C, x) : null;
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:${z}px;min-width:${z}px;flex-shrink:0;visibility:hidden;box-sizing:border-box;`, $.appendChild(k);
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 V = (J == null ? void 0 : J.rowSpan) ?? 1, O = (J == null ? void 0 : J.colSpan) ?? 1, ne = V > 1 ? V * m.rowHeight : m.rowHeight;
1322
- let K = z;
1323
- if (O > 1) for (let k = 1; k < O; k++) K += a[x + k] ?? m.defaultColumnWidth;
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 Y = 0;
1325
+ let q = 0;
1326
1326
  if (X) {
1327
- m.stateColumn && (Y += 24), m.draggable && (Y += 18), m.rowNumber && (Y += 44), m.checkColumn && (Y += 36), A && (Y += S);
1328
- for (let k = 0; k < x; k++) Y += a[k] ?? m.defaultColumnWidth;
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 = `${K}px`, b.style.minWidth = `${K}px`, b.style.maxWidth = `${K}px`, V > 1 && (b.style.height = `${ne}px`), X && (b.style.background = W), L && P && (b.style.padding = "0"), b.style.overflow = "hidden", V > 1 ? (b.style.height = `${ne}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 = `${Y}px`, b.style.zIndex = "1"), F.type === "number" || F.align === "right" ? b.classList.add("og-cell--right") : F.align === "center" && b.classList.add("og-cell--center"), te && b.classList.add("og-cell--editable"), F.wrap && b.classList.add("og-cell--wrap"), te || b.setAttribute("aria-readonly", "true"), O > 1 && b.setAttribute("aria-colspan", String(O)), V > 1 && b.setAttribute("aria-rowspan", String(V)), ((_a = m._focusCell) == null ? void 0 : _a.ri) === C && ((_b = m._focusCell) == null ? void 0 : _b.ci) === x && (b.classList.add("og-cell-focused"), b.tabIndex = -1), ((_c = m._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[F.field] : null;
1333
- b.setAttribute("aria-label", `${F.header}: ${se == null ? "" : String(se)}`), F.tooltip != null ? b.title = typeof F.tooltip == "function" ? String(F.tooltip(se, H) ?? "") : String(F.tooltip) : m.tooltips && se != null && se !== "" && (b.title = String(se));
1334
- const Z = ((_e = (_d = this._cbs).getFormulaMeta) == null ? void 0 : _e.call(_d, C, F.field)) ?? null;
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 N = _FORMULA_ERROR_KEY$1[Z.error], Q = N ? this._t(N) : this._t("formulaError.fallback");
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 N = Z.approx ? this._t("formula.approxSuffix") : "";
1342
- b.setAttribute("aria-label", this._t("formula.ariaValue", { src: Z.src, value: k, approx: N })), b.title = `${Z.src}${N}`;
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 = m.formula) == null ? void 0 : _f.cellMarker) !== false) {
1344
+ if (((_f = _.formula) == null ? void 0 : _f.cellMarker) !== false) {
1345
1345
  b.classList.add("og-formula-cell");
1346
- const N = 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, ${N} 0 6px, transparent 6px)`, b.style.backgroundRepeat = "no-repeat", b.style.backgroundPosition = "top right", b.style.backgroundSize = "8px 8px", Q && (b.style.backgroundColor = Q);
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 de = (_h = (_g = this._cbs).resolveRenderHook) == null ? void 0 : _h.call(_g, "cellClass", C, F.field);
1351
- de && (b.className += " " + de);
1352
- const ce = (_j = (_i = this._cbs).resolveRenderHook) == null ? void 0 : _j.call(_i, "ariaLabel", C, F.field);
1353
- ce != null && b.setAttribute("aria-label", String(ce));
1354
- let he = b;
1355
- if (L && P) {
1356
- const k = _el("div", "og-tree-cell"), N = L._ancestorHasMore ?? [];
1357
- for (let j = 0; j < L._depth; j++) {
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
- N[j] && ee.classList.add("og-tree-guide--line"), k.appendChild(ee);
1359
+ P[U] && ee.classList.add("og-tree-guide--line"), k.appendChild(ee);
1360
1360
  }
1361
- if (L._depth > 0) {
1362
- const j = _el("span", "og-tree-connector");
1363
- j.classList.add(L._isLastChild ? "og-tree-connector--last" : "og-tree-connector--mid"), k.appendChild(j);
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 (!L._hasChildren) {
1367
- const j = _el("span", "og-tree-leaf-dot");
1368
- Q.appendChild(j);
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 U = document.createElement("i");
1372
- if (L._hasChildren) {
1373
- const j = _resolveTreeIcon(F.treeNodeIcon, H, true, L._expanded);
1374
- U.className = L._expanded ? `${j} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--open og-tree-node-icon--toggle` : `${j} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--toggle`, U.setAttribute("role", "button"), U.setAttribute("tabindex", "0"), U.setAttribute("aria-expanded", L._expanded ? "true" : "false"), U.setAttribute("aria-label", this._t(L._expanded ? "tree.collapse" : "tree.expand")), U.addEventListener("click", (ee) => {
1375
- ee.stopPropagation(), f == null ? void 0 : f(L._treeId);
1376
- }), U.addEventListener("keydown", (ee) => {
1377
- (ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), ee.stopPropagation(), f == null ? void 0 : f(L._treeId));
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 j = _resolveTreeIcon(F.treeNodeIcon, H, false, false);
1381
- U.setAttribute("aria-hidden", "true"), U.className = `${j} og-tree-node-icon og-tree-node-icon--leaf`;
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(U), b.appendChild(k), he = k;
1383
+ k.appendChild(K), b.appendChild(k), ce = k;
1384
1384
  }
1385
- if (F.cellStyle) {
1386
- const k = H[F.field], N = typeof F.cellStyle == "function" ? F.cellStyle(k, H, C) : F.cellStyle;
1387
- Object.assign(b.style, N);
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(F).render({ value: H[F.field], row: H, rowIndex: C, column: F, colIndex: x, isSelected: c.has(C), rowState: G, displayValue: ((_l = (_k = this._cbs).resolveRenderHook) == null ? void 0 : _l.call(_k, "displayText", C, F.field)) ?? ((_n = (_m = this._cbs).getDisplayText) == null ? void 0 : _n.call(_m, C, F.field)) ?? null, displayFormatter: ((_p = (_o = this._cbs).getDisplayFormatter) == null ? void 0 : _p.call(_o)) ?? null, hasCellFormula: Z != null, t: (k, N) => this._t(k, N) });
1390
- he.appendChild(ue), (_r = (_q = this._cbs).applyCF) == null ? void 0 : _r.call(_q, b, C, F.field, H ? H[F.field] : void 0, K, ne);
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
- }), ae.set(x, b), V > 1) {
1406
+ }), ne.set(x, b), N > 1) {
1407
1407
  const k = document.createElement("div");
1408
- k.style.cssText = [`width:${z}px;min-width:${z}px;height:${m.rowHeight}px;`, "flex-shrink:0;box-sizing:border-box;", `border-right:${y.border()};`].join(""), $.appendChild(k);
1409
- let N = 0;
1410
- m.stateColumn && (N += 24), m.draggable && (N += 18), m.rowNumber && (N += 44), m.checkColumn && (N += 36), A && (N += S);
1411
- for (let U = 0; U < x; U++) N += a[U] ?? m.defaultColumnWidth;
1412
- const Q = l + (C - s) * m.rowHeight;
1413
- b.style.left = `${N}px`, b.style.top = `${Q}px`, T.appendChild(b);
1414
- } else $.appendChild(b);
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, ae), T.appendChild($);
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, HANMS)`));
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 (가시 포커스 비협상, HANMS)")), { delta: s, warnings: i };
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} 축 이름공간이 아닙니다. 각 축은 자기 이름공간 토큰만 소유합니다(축 오염 금지 — 이름-분리 물리 직교, 불변식 1).`);
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 ? _ = _groupByFields(p, e, s + 1, i, o, f, a, l) : _ = p;
1912
- const { summary: w, summaryFmt: m } = _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: m, _states: y, children: _ });
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), [_, w] = f === -1 || g === -1 ? [null, null] : [Math.min(f, g), Math.max(f, g)], m = [];
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 (_ === null || w === null) {
2536
- i.add(cellKey(y, n.a.field)), m.push(s.getCellValue(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 = _; v <= w; v++) {
2539
+ for (let v = m; v <= w; v++) {
2540
2540
  const R = p[v];
2541
- i.add(cellKey(y, R)), m.push(s.getCellValue(y, R));
2541
+ i.add(cellKey(y, R)), _.push(s.getCellValue(y, R));
2542
2542
  }
2543
2543
  }
2544
- return m;
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, _b, _c;
3406
+ var _a;
3384
3407
  const u = [];
3385
- l && u.push(a.map((E) => E.header));
3386
- for (const E of r) u.push(a.map((B) => {
3387
- const M = E[B.field];
3388
- if (s.maskOnExport && B.mask && this._d.getMaskEnabled(B.field)) return applyMask(M == null ? "" : String(M), B.mask);
3389
- const L = M;
3390
- return L == null || L === "" ? "" : d(L, B, E);
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((E) => ({ wpx: f[g.getColumnIndex(E.field)] ?? 100 })), p["!rows"] = u.map((E, B) => ({ hpx: B === 0 && l ? 22 : 19 }));
3394
- const _ = s.styleMode ?? "theme";
3395
- let w = "1565C0", m = "FFFFFF", y = "FFFFFF", v = "EEF2FF", R = "212121", A = "BDBDBD", S = 10;
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((_) => `<td>${String(g[_.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>
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 c of s.getNames()) {
3473
- const h = s.get(c), u = h.columns.length ? h.columns : d.columns, p = [u.map((g) => g.header)];
3474
- for (const g of h.data) p.push(u.map((_) => {
3475
- const w = g[_.field];
3476
- return w == null ? "" : o(w, _, g);
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 f = r.aoa_to_sheet(p);
3479
- f["!cols"] = u.map(() => ({ wpx: 100 })), r.book_append_sheet(l, f, c);
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, _ = `${o}${g}${r}`;
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 _ = document.createElement("div");
3538
- _.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("");
3539
- const w = u.field, m = w ? l.get(w) : null;
3540
- if (m) {
3541
- const y = m._formatted ?? String(m._value ?? ""), v = u.label ? `${u.label}: ` : "";
3542
- _.textContent = v + y, _.title = `${((_b = u.op) == null ? void 0 : _b.toUpperCase()) ?? ""} = ${y}`, _.style.color = "var(--og-primary,#1976d2)", _.style.textAlign = u.align ?? ((g == null ? void 0 : g.type) === "number", "right");
3543
- } else u.label && (_.textContent = u.label, _.style.textAlign = u.align ?? "left", _.style.color = "var(--og-row-color,#212121)");
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, _ = a + f, w = d[_];
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 _ = l[d.field];
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 _ = d.group;
3859
- for (const w of this._d.getColLayout().visibleLeaves) w.type === "radio" && w.field !== d.field && (!_ || w.group === _) && this._d.getData().updateCell(e, w.field, false);
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 _ = d.formulaPrecision ?? 30, w = evaluateFormula(d.formula, l, _);
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((m) => ({ ri: m, ci: h })) : range(n.startCol, n.endCol).map((m) => ({ ri: h, ci: m })), f = p.map((m) => {
4134
- const y = r ? u : o.fieldAt(m.ci);
4135
- return y ? o.getCellValue(m.ri, y) : void 0;
4136
- }), g = i === "series" ? detectSeries(f) : { kind: "copy" }, _ = r ? range(e.startRow, e.endRow) : range(e.startCol, e.endCol);
4137
- (s === "down" || s === "right" ? _ : [..._].reverse()).forEach((m, y) => {
4138
- const v = y + 1, R = r ? m : h, A = r ? h : m, S = r ? u : o.fieldAt(m);
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 I = copyTileIndex(s, v, p.length), D = p[I], T = r ? u : o.fieldAt(D.ci);
4146
- T && a.push(planCopyCell(o, R, A, S, D.ri, D.ci, T, d));
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 _ = s.resolveFlatRow(p);
4185
- if (_.kind !== "data" || !_.rowId) {
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(_.rowId, g)) {
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, _) => this._d.getData().getCellValue(g, _), isEditable: (g, _) => this._isEditable(g, _), hasCellFormula: (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, _)) ?? false;
4352
- }, offsetFormula: (g, _, w, m) => {
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, _, w, m)) ?? "";
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 _ = this._d.getData().getCellValue(g.rowIndex, g.field);
4358
- c.push({ rowIndex: g.rowIndex, field: g.field, oldValue: _, newValue: g.value }), h.push({ rowIndex: g.rowIndex, field: g.field, value: g.value });
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 _ = this._d.getFlatModel().resolveFlatRow(g.rowIndex);
4361
- _.kind === "data" && _.rowId && (u.push({ rowId: _.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 }));
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 _ = f.getBoundingClientRect(), w = g.getBoundingClientRect(), m = Math.min(_.left, w.left) - i.left, y = Math.min(_.top, w.top) - i.top, v = Math.max(_.right, w.right) - i.left, R = Math.max(_.bottom, w.bottom) - i.top;
4445
- Object.assign(this._previewEl.style, { display: "block", left: `${m}px`, top: `${y}px`, width: `${Math.max(0, v - m)}px`, height: `${Math.max(0, R - y)}px` });
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), A = seriesSpecName(y, (R == null ? void 0 : R.header) ?? v), S = i.map((C) => coerceNumber(C[v])), I = typeof y == "string" ? void 0 : y.pattern, D = typeof y == "string" ? void 0 : y.color, T = { name: A, data: S };
4975
- return I && (T.pattern = I), D && (T.color = D), T;
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, _, w = false;
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 A = h[R];
4982
- v.has(A) ? v.get(A).push(R) : (v.set(A, [R]), y.push(A));
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((A) => {
4985
- const I = v.get(A).map((D) => R.data[D]).filter((D) => D !== null);
4986
- return I.length ? aggregateValues(I, A, s.aggregate) : null;
4987
- }) })), _ = typeof s.aggregate == "function" ? "custom" : s.aggregate, w = true);
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 m = { categories: f, series: g, meta: { sourceKind: o, total: p, sampled: w, a11yTable: buildA11yTable({ categories: f, series: g }, { title: s.title, numberFormat: s.numberFormat }) } };
4990
- return _ && (m.meta.aggregatedOp = _), { model: m, rangeFallback: r };
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, _ = a, w = i(a);
5021
- let m = -1, y = f;
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((_ - d) * (i(v) - w) - (_ - v) * (c - w)) * 0.5;
5024
- R > m && (m = R, y = v);
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 _ = true;
5047
- for (; _ && f.size < e; ) {
5048
- _ = false;
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 m = w.find((y) => !f.has(y));
5052
- m !== void 0 && (f.add(m), _ = true);
5056
+ const _ = w.find((y) => !f.has(y));
5057
+ _ !== void 0 && (f.add(_), m = true);
5053
5058
  }
5054
5059
  }
5055
- p = [...f].sort((w, m) => w - m).slice(0, e);
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], _ = n.categories[f - 1];
5067
- r.push(f - p > 1 ? `${g}…${_}` : 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, _ = false;
5075
+ let g = 0, m = false;
5071
5076
  for (let w = p; w < f; w++) {
5072
- const m = numericOf(u.data[w]);
5073
- m != null && (g += m, _ = true);
5077
+ const _ = numericOf(u.data[w]);
5078
+ _ != null && (g += _, m = true);
5074
5079
  }
5075
- return _ ? g : null;
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 = (_ - c.min) / (c.max - c.min || 1);
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((_, w) => ({ s: _, si: w })).filter(({ si: _ }) => !this._hidden.has(_));
5312
- if (f) for (const { s: _, si: w } of g) _.data.forEach((m, y) => {
5313
- const v = o.x + p * y + p / 2, R = m == null ? NaN : h(m);
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 _ = g.length || 1, w = p * 0.72, m = w / _;
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((A, S) => {
5320
- if (A == null || Number.isNaN(A)) return;
5321
- const D = o.x + p * S + (p - w) / 2 + m * R, T = h(A), C = Math.min(T, u), E = Math.abs(u - T);
5322
- i.push({ seriesIndex: v, categoryIndex: S, x: D, y: C, w: m, h: E, cx: D + m / 2, cy: C + E / 2 });
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 = (_ - h.min) / (h.max - h.min || 1);
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 _ of h.ticks) {
5342
- const w = u(_);
5343
- r.beginPath(), r.moveTo(l.x, w), r.lineTo(l.x + l.w, w), r.stroke(), r.fillText(fmt(_, s, "y"), l.x - 6, w);
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((_, w) => {
5348
- const m = l.x + p * w + p / 2;
5349
- r.fillText(String(_), m, l.y + l.h + 6);
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 _ = /* @__PURE__ */ new Map();
5358
+ const m = /* @__PURE__ */ new Map();
5354
5359
  for (const w of this._geoms) {
5355
- let m = _.get(w.seriesIndex);
5356
- m || (m = [], _.set(w.seriesIndex, m)), m.push(w);
5360
+ let _ = m.get(w.seriesIndex);
5361
+ _ || (_ = [], m.set(w.seriesIndex, _)), _.push(w);
5357
5362
  }
5358
- for (const [w, m] of _) {
5359
- m.sort((y, v) => y.categoryIndex - v.categoryIndex), r.strokeStyle = f[w].color, r.lineWidth = 2, r.setLineDash(dashFor(f[w].pattern)), r.beginPath(), m.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;
5360
- for (const y of m) r.beginPath(), r.arc(y.cx, y.cy, MARKER_R, 0, Math.PI * 2), r.fill();
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 _ of this._geoms) r.fillStyle = f[_.seriesIndex].color, r.fillRect(_.x, _.y, _.w, _.h), paintPattern(r, _, f[_.seriesIndex].pattern);
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, (_) => this._onPointClick(u, _)), this._renderBadges(u, f, a), e.live !== false && this._subscribeLive(u), this._attachResizeObserver(u);
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)} &lt;${esc(S.field)}&gt;</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:1;font-size:13px;min-width:0;", D.innerHTML = `<span style="font-weight:600;">${esc(S.header)}</span><span style="color:#999;font-size:11.5px;"> &lt;${esc(S.field)}&gt;</span>`;
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;"> &lt;${esc(S.field)}&gt;</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
- }), I.append(D, T, C), d.appendChild(I);
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
- _(), p.addEventListener("click", () => {
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 m = document.createElement("button");
5864
- m.type = "button", m.textContent = t("crossGrid.cancel"), m.style.cssText = "font-size:13px;padding:8px 16px;border:1px solid #ccc;border-radius:7px;background:#fff;cursor:pointer;";
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(m, y), a.appendChild(w);
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", A), r.remove(), s(S));
5874
+ v || (v = true, document.removeEventListener("keydown", F), r.remove(), s(S));
5870
5875
  }
5871
- function A(S) {
5876
+ function F(S) {
5872
5877
  S.key === "Escape" && R(null);
5873
5878
  }
5874
- m.addEventListener("click", () => R(null)), r.addEventListener("mousedown", (S) => {
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", A), document.body.appendChild(r), y.focus();
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-Brfso4Ry.cjs"));
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-CT9bV6On.cjs.map
7390
+ //# sourceMappingURL=OpenGrid-DgZtbVD0.cjs.map