open-grid 1.6.1 → 1.7.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 (111) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/ExportProgressView-9Kt1SQxv.js +48 -0
  3. package/dist/ExportProgressView-B59uHIwt.cjs +48 -0
  4. package/dist/LcpMergeOrderer-BdUtV67j.js +114 -0
  5. package/dist/LcpMergeOrderer-C_ANVkGk.cjs +113 -0
  6. package/dist/OpenGrid-BUYQs1_w.cjs +9806 -0
  7. package/dist/OpenGrid-BmagF0yo.js +9819 -0
  8. package/dist/XlsxChannel-DOeHeP7h.cjs +95 -0
  9. package/dist/XlsxChannel-DdaiytFR.js +95 -0
  10. package/dist/XlsxWorkbookWriter-BTNtZ80J.js +199 -0
  11. package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +198 -0
  12. package/dist/{index-VkKgQ506.js → index-B9_g5Eg3.js} +2 -2
  13. package/dist/{index-D0DJtKYI.cjs → index-CnyumyPV.cjs} +2 -2
  14. package/dist/open-grid-react.cjs +1 -1
  15. package/dist/open-grid-react.js +1 -1
  16. package/dist/open-grid-vue.cjs +1 -1
  17. package/dist/open-grid-vue.js +1 -1
  18. package/dist/open-grid.cjs +1 -1
  19. package/dist/open-grid.js +2 -2
  20. package/dist/sinks-BWkWQexV.js +149 -0
  21. package/dist/sinks-DPK0VxYG.cjs +143 -0
  22. package/dist/types/core/CFRenderBridge.d.ts +5 -1
  23. package/dist/types/core/CellEditManager.d.ts +26 -2
  24. package/dist/types/core/CellEventHandler.d.ts +6 -2
  25. package/dist/types/core/ColumnLayout.d.ts +8 -0
  26. package/dist/types/core/DataLayer.d.ts +48 -1
  27. package/dist/types/core/DetailManager.d.ts +43 -2
  28. package/dist/types/core/ExportManager.d.ts +24 -0
  29. package/dist/types/core/FindBarManager.d.ts +6 -2
  30. package/dist/types/core/FlatRowModel.d.ts +61 -3
  31. package/dist/types/core/FooterManager.d.ts +43 -1
  32. package/dist/types/core/FormulaController.d.ts +4 -4
  33. package/dist/types/core/GridComposer.d.ts +11 -1
  34. package/dist/types/core/GridRenderer.d.ts +84 -19
  35. package/dist/types/core/GroupTreeManager.d.ts +6 -4
  36. package/dist/types/core/KeyboardManager.d.ts +3 -2
  37. package/dist/types/core/MutationService.d.ts +10 -8
  38. package/dist/types/core/OpenGrid.d.ts +7 -5
  39. package/dist/types/core/RangeSelectionManager.d.ts +23 -2
  40. package/dist/types/core/RenderController.d.ts +126 -8
  41. package/dist/types/core/SortFilterManager.d.ts +10 -2
  42. package/dist/types/core/VirtualScroll.d.ts +12 -0
  43. package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
  44. package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
  45. package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
  46. package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
  47. package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
  48. package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
  49. package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
  50. package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
  51. package/dist/types/core/coordinate/ports.d.ts +5 -0
  52. package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
  53. package/dist/types/core/domain/footer/ports.d.ts +31 -0
  54. package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
  55. package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
  56. package/dist/types/core/domain/render/ports.d.ts +169 -0
  57. package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
  58. package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
  59. package/dist/types/core/domain/resize/ports.d.ts +64 -0
  60. package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
  61. package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
  62. package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
  63. package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
  64. package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
  65. package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
  66. package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
  67. package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
  68. package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
  69. package/dist/types/core/domain/sort/ports.d.ts +140 -0
  70. package/dist/types/core/export/ExportProgressView.d.ts +28 -0
  71. package/dist/types/core/export/channels/XlsxChannel.d.ts +29 -0
  72. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +17 -0
  73. package/dist/types/core/export/index.d.ts +2 -0
  74. package/dist/types/core/export/sinks.d.ts +81 -0
  75. package/dist/types/core/host/archCheck.d.ts +16 -1
  76. package/dist/types/core/i18n/locales/en.d.ts +6 -0
  77. package/dist/types/core/i18n/locales/ko.d.ts +6 -0
  78. package/dist/types/core/i18n/types.d.ts +8 -0
  79. package/dist/types/core/render/FooterView.d.ts +121 -0
  80. package/dist/types/core/render/GeometryApplier.d.ts +55 -0
  81. package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
  82. package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
  83. package/dist/types/core/render/RenderScheduler.d.ts +225 -0
  84. package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
  85. package/dist/types/core/render/ScrollFollower.d.ts +34 -0
  86. package/dist/types/core/render/ScrollObserver.d.ts +47 -0
  87. package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
  88. package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
  89. package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
  90. package/dist/types/core/render/body/BodyView.d.ts +185 -0
  91. package/dist/types/core/render/body/CellLocator.d.ts +36 -0
  92. package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
  93. package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
  94. package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
  95. package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
  96. package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
  97. package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
  98. package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
  99. package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
  100. package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
  101. package/dist/types/core/render/dom.d.ts +10 -0
  102. package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
  103. package/dist/types/core/render/header/HeaderView.d.ts +84 -0
  104. package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
  105. package/dist/types/core/render/ports.d.ts +218 -0
  106. package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
  107. package/dist/types/core/types.d.ts +70 -0
  108. package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
  109. package/package.json +2 -8
  110. package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
  111. package/dist/OpenGrid-D6YxCsnV.js +0 -7472
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("vue"), OpenGrid$1 = require("./OpenGrid-CLk8Vt7j.cjs"), _sfc_main = vue.defineComponent({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
3
+ const vue = require("vue"), OpenGrid$1 = require("./OpenGrid-BUYQs1_w.cjs"), _sfc_main = vue.defineComponent({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
4
  const e = n, o = r, c = vue.ref(), a = vue.shallowRef(null);
5
5
  let i = null;
6
6
  const s = vue.computed(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height, width: typeof e.width == "number" ? `${e.width}px` : e.width }));
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as f, ref as p, shallowRef as m, computed as h, onMounted as g, watch as d, onUnmounted as y, openBlock as b, createElementBlock as v, normalizeStyle as C } from "vue";
2
- import { O as k } from "./OpenGrid-D6YxCsnV.js";
2
+ import { O as k } from "./OpenGrid-BmagF0yo.js";
3
3
  const w = f({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
4
  const e = n, o = r, c = p(), a = m(null);
5
5
  let i = null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const OpenGrid = require("./OpenGrid-CLk8Vt7j.cjs"), Registry = require("./Registry-D74ZmdDz.cjs");
3
+ const OpenGrid = require("./OpenGrid-BUYQs1_w.cjs"), Registry = require("./Registry-D74ZmdDz.cjs");
4
4
  class GridShuttle {
5
5
  constructor(t, e, n, o = {}) {
6
6
  this._left = t, this._right = e;
package/dist/open-grid.js CHANGED
@@ -1,5 +1,5 @@
1
- import { b, t as T } from "./OpenGrid-D6YxCsnV.js";
2
- import { D, I, L, O, S, i, l, r, s } from "./OpenGrid-D6YxCsnV.js";
1
+ import { b, t as T } from "./OpenGrid-BmagF0yo.js";
2
+ import { D, I, L, O, S, i, l, r, s } from "./OpenGrid-BmagF0yo.js";
3
3
  import { R, T as T2, i as i2 } from "./Registry-CPJYOqCn.js";
4
4
  class C {
5
5
  constructor(t, e, r2, o = {}) {
@@ -0,0 +1,149 @@
1
+ const o = new TextEncoder();
2
+ class l {
3
+ constructor(e = 8 * 1024 * 1024) {
4
+ this._highWaterMark = e, this._chunks = [], this._bytes = 0, this._closed = false, this._aborted = false;
5
+ }
6
+ write(e) {
7
+ return this._closed || this._aborted ? Promise.reject(new Error("sink closed/aborted")) : (this._chunks.push(e), this._bytes += typeof e == "string" ? o.encode(e).length : e.length, Promise.resolve());
8
+ }
9
+ close() {
10
+ return this._closed = true, Promise.resolve();
11
+ }
12
+ abort(e) {
13
+ this._aborted = true, e !== void 0 && (this._abortReason = e);
14
+ }
15
+ get desiredSize() {
16
+ return this._highWaterMark - this._bytes;
17
+ }
18
+ toString() {
19
+ return this._chunks.map((e) => typeof e == "string" ? e : new TextDecoder().decode(e)).join("");
20
+ }
21
+ get bytesWritten() {
22
+ return this._bytes;
23
+ }
24
+ get closed() {
25
+ return this._closed;
26
+ }
27
+ get aborted() {
28
+ return this._aborted;
29
+ }
30
+ get abortReason() {
31
+ return this._abortReason;
32
+ }
33
+ }
34
+ class c {
35
+ constructor(e, t = Number.POSITIVE_INFINITY) {
36
+ this._download = e, this._highWaterMark = t, this._buf = "", this._bytes = 0, this._closed = false;
37
+ }
38
+ write(e) {
39
+ const t = typeof e == "string" ? e : new TextDecoder().decode(e);
40
+ return this._buf += t, this._bytes += o.encode(t).length, Promise.resolve();
41
+ }
42
+ close() {
43
+ return this._closed || (this._closed = true, this._download(this._buf)), Promise.resolve();
44
+ }
45
+ abort() {
46
+ this._closed = true;
47
+ }
48
+ get desiredSize() {
49
+ return this._highWaterMark - this._bytes;
50
+ }
51
+ }
52
+ const a = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
53
+ function _(s) {
54
+ return typeof s == "string" ? o.encode(s).length : s.length;
55
+ }
56
+ class h {
57
+ constructor(e, t = 8 * 1024 * 1024) {
58
+ this._writable = e, this._highWaterMark = t, this._pending = 0, this._closed = false, this._aborted = false;
59
+ }
60
+ async write(e) {
61
+ if (this._closed || this._aborted) throw new Error("sink closed/aborted");
62
+ const t = _(e);
63
+ this._pending += t;
64
+ try {
65
+ await this._writable.write(e);
66
+ } finally {
67
+ this._pending -= t;
68
+ }
69
+ }
70
+ async close() {
71
+ this._closed || this._aborted || (this._closed = true, await this._writable.close());
72
+ }
73
+ abort(e) {
74
+ var _a, _b;
75
+ if (!this._aborted) {
76
+ this._aborted = true;
77
+ try {
78
+ const t = (_b = (_a = this._writable).abort) == null ? void 0 : _b.call(_a, e);
79
+ t && typeof t.catch == "function" && t.catch(() => {
80
+ });
81
+ } catch {
82
+ }
83
+ }
84
+ }
85
+ get desiredSize() {
86
+ return this._highWaterMark - this._pending;
87
+ }
88
+ }
89
+ class n {
90
+ constructor(e = {}) {
91
+ this._parts = [], this._bytes = 0, this._closed = false, this._aborted = false, this._fileName = e.fileName ?? "export.xlsx", this._mime = e.mime ?? a, this._hwm = e.highWaterMark ?? 1024 * 1024 * 1024, this._download = e.download;
92
+ }
93
+ write(e) {
94
+ if (this._closed || this._aborted) return Promise.reject(new Error("sink closed/aborted"));
95
+ const t = typeof e == "string" ? o.encode(e) : e;
96
+ return this._parts.push(t), this._bytes += t.length, Promise.resolve();
97
+ }
98
+ close() {
99
+ if (this._closed || this._aborted) return Promise.resolve();
100
+ this._closed = true;
101
+ const e = new Blob(this._parts, { type: this._mime });
102
+ return this._parts.length = 0, this._download ? this._download(e, this._fileName) : n._anchorDownload(e, this._fileName), Promise.resolve();
103
+ }
104
+ abort() {
105
+ this._aborted = true, this._parts.length = 0;
106
+ }
107
+ get desiredSize() {
108
+ return this._hwm - this._bytes;
109
+ }
110
+ get bytesWritten() {
111
+ return this._bytes;
112
+ }
113
+ static _anchorDownload(e, t) {
114
+ if (typeof document > "u" || typeof URL > "u" || !URL.createObjectURL) return;
115
+ const i = URL.createObjectURL(e);
116
+ try {
117
+ const r = document.createElement("a");
118
+ r.href = i, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), r.remove();
119
+ } finally {
120
+ URL.revokeObjectURL(i);
121
+ }
122
+ }
123
+ }
124
+ function d(s = {}) {
125
+ if (s.fsAccess === "off") return false;
126
+ const e = s.env !== void 0 ? s.env : typeof window < "u" ? window : void 0;
127
+ return !!e && typeof e.showSaveFilePicker == "function";
128
+ }
129
+ function f(s = {}) {
130
+ const e = s.fileName ?? "export.xlsx", t = s.mime ?? a;
131
+ if (d(s)) {
132
+ const i = s.env !== void 0 ? s.env : window;
133
+ return { kind: "fs", async create() {
134
+ const r = await i.showSaveFilePicker({ suggestedName: e, types: [{ description: "Excel", accept: { [t]: [".xlsx"] } }] });
135
+ return new h(await r.createWritable(), s.highWaterMark);
136
+ } };
137
+ }
138
+ return { kind: "blob", create: () => Promise.resolve(new n({ fileName: e, mime: t, highWaterMark: s.highWaterMark, download: s.download })) };
139
+ }
140
+ export {
141
+ n as BlobDownloadByteSink,
142
+ c as DownloadByteSink,
143
+ h as FileSystemByteSink,
144
+ l as MemoryByteSink,
145
+ a as XLSX_MIME,
146
+ d as canUseFileSystemAccess,
147
+ f as pickExcelSink
148
+ };
149
+ //# sourceMappingURL=sinks-BWkWQexV.js.map
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ENC = new TextEncoder();
4
+ class MemoryByteSink {
5
+ constructor(e = 8 * 1024 * 1024) {
6
+ this._highWaterMark = e, this._chunks = [], this._bytes = 0, this._closed = false, this._aborted = false;
7
+ }
8
+ write(e) {
9
+ return this._closed || this._aborted ? Promise.reject(new Error("sink closed/aborted")) : (this._chunks.push(e), this._bytes += typeof e == "string" ? ENC.encode(e).length : e.length, Promise.resolve());
10
+ }
11
+ close() {
12
+ return this._closed = true, Promise.resolve();
13
+ }
14
+ abort(e) {
15
+ this._aborted = true, e !== void 0 && (this._abortReason = e);
16
+ }
17
+ get desiredSize() {
18
+ return this._highWaterMark - this._bytes;
19
+ }
20
+ toString() {
21
+ return this._chunks.map((e) => typeof e == "string" ? e : new TextDecoder().decode(e)).join("");
22
+ }
23
+ get bytesWritten() {
24
+ return this._bytes;
25
+ }
26
+ get closed() {
27
+ return this._closed;
28
+ }
29
+ get aborted() {
30
+ return this._aborted;
31
+ }
32
+ get abortReason() {
33
+ return this._abortReason;
34
+ }
35
+ }
36
+ class DownloadByteSink {
37
+ constructor(e, t = Number.POSITIVE_INFINITY) {
38
+ this._download = e, this._highWaterMark = t, this._buf = "", this._bytes = 0, this._closed = false;
39
+ }
40
+ write(e) {
41
+ const t = typeof e == "string" ? e : new TextDecoder().decode(e);
42
+ return this._buf += t, this._bytes += ENC.encode(t).length, Promise.resolve();
43
+ }
44
+ close() {
45
+ return this._closed || (this._closed = true, this._download(this._buf)), Promise.resolve();
46
+ }
47
+ abort() {
48
+ this._closed = true;
49
+ }
50
+ get desiredSize() {
51
+ return this._highWaterMark - this._bytes;
52
+ }
53
+ }
54
+ const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
55
+ function byteLen(s) {
56
+ return typeof s == "string" ? ENC.encode(s).length : s.length;
57
+ }
58
+ class FileSystemByteSink {
59
+ constructor(e, t = 8 * 1024 * 1024) {
60
+ this._writable = e, this._highWaterMark = t, this._pending = 0, this._closed = false, this._aborted = false;
61
+ }
62
+ async write(e) {
63
+ if (this._closed || this._aborted) throw new Error("sink closed/aborted");
64
+ const t = byteLen(e);
65
+ this._pending += t;
66
+ try {
67
+ await this._writable.write(e);
68
+ } finally {
69
+ this._pending -= t;
70
+ }
71
+ }
72
+ async close() {
73
+ this._closed || this._aborted || (this._closed = true, await this._writable.close());
74
+ }
75
+ abort(e) {
76
+ var _a, _b;
77
+ if (!this._aborted) {
78
+ this._aborted = true;
79
+ try {
80
+ const t = (_b = (_a = this._writable).abort) == null ? void 0 : _b.call(_a, e);
81
+ t && typeof t.catch == "function" && t.catch(() => {
82
+ });
83
+ } catch {
84
+ }
85
+ }
86
+ }
87
+ get desiredSize() {
88
+ return this._highWaterMark - this._pending;
89
+ }
90
+ }
91
+ class BlobDownloadByteSink {
92
+ constructor(e = {}) {
93
+ this._parts = [], this._bytes = 0, this._closed = false, this._aborted = false, this._fileName = e.fileName ?? "export.xlsx", this._mime = e.mime ?? XLSX_MIME, this._hwm = e.highWaterMark ?? 1024 * 1024 * 1024, this._download = e.download;
94
+ }
95
+ write(e) {
96
+ if (this._closed || this._aborted) return Promise.reject(new Error("sink closed/aborted"));
97
+ const t = typeof e == "string" ? ENC.encode(e) : e;
98
+ return this._parts.push(t), this._bytes += t.length, Promise.resolve();
99
+ }
100
+ close() {
101
+ if (this._closed || this._aborted) return Promise.resolve();
102
+ this._closed = true;
103
+ const e = new Blob(this._parts, { type: this._mime });
104
+ return this._parts.length = 0, this._download ? this._download(e, this._fileName) : BlobDownloadByteSink._anchorDownload(e, this._fileName), Promise.resolve();
105
+ }
106
+ abort() {
107
+ this._aborted = true, this._parts.length = 0;
108
+ }
109
+ get desiredSize() {
110
+ return this._hwm - this._bytes;
111
+ }
112
+ get bytesWritten() {
113
+ return this._bytes;
114
+ }
115
+ static _anchorDownload(e, t) {
116
+ if (typeof document > "u" || typeof URL > "u" || !URL.createObjectURL) return;
117
+ const i = URL.createObjectURL(e);
118
+ try {
119
+ const r = document.createElement("a");
120
+ r.href = i, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), r.remove();
121
+ } finally {
122
+ URL.revokeObjectURL(i);
123
+ }
124
+ }
125
+ }
126
+ function canUseFileSystemAccess(s = {}) {
127
+ if (s.fsAccess === "off") return false;
128
+ const e = s.env !== void 0 ? s.env : typeof window < "u" ? window : void 0;
129
+ return !!e && typeof e.showSaveFilePicker == "function";
130
+ }
131
+ function pickExcelSink(s = {}) {
132
+ const e = s.fileName ?? "export.xlsx", t = s.mime ?? XLSX_MIME;
133
+ if (canUseFileSystemAccess(s)) {
134
+ const i = s.env !== void 0 ? s.env : window;
135
+ return { kind: "fs", async create() {
136
+ const r = await i.showSaveFilePicker({ suggestedName: e, types: [{ description: "Excel", accept: { [t]: [".xlsx"] } }] });
137
+ return new FileSystemByteSink(await r.createWritable(), s.highWaterMark);
138
+ } };
139
+ }
140
+ return { kind: "blob", create: () => Promise.resolve(new BlobDownloadByteSink({ fileName: e, mime: t, highWaterMark: s.highWaterMark, download: s.download })) };
141
+ }
142
+ exports.BlobDownloadByteSink = BlobDownloadByteSink, exports.DownloadByteSink = DownloadByteSink, exports.FileSystemByteSink = FileSystemByteSink, exports.MemoryByteSink = MemoryByteSink, exports.XLSX_MIME = XLSX_MIME, exports.canUseFileSystemAccess = canUseFileSystemAccess, exports.pickExcelSink = pickExcelSink;
143
+ //# sourceMappingURL=sinks-DPK0VxYG.cjs.map
@@ -9,5 +9,9 @@ import { VisualSpec } from './cf/encoders.js';
9
9
  * @param specs - CFEngine.paintFor 산출 시각 스펙 배열 / The VisualSpec array from CFEngine.paintFor
10
10
  * @param cellW - 셀 콘텐츠 폭(px) — 데이터바 길이 산출 / Cell content width (px) for bar length
11
11
  * @param cellH - 셀 콘텐츠 높이(px) / Cell content height (px)
12
+ * @param track - (선택) 데이터 막대를 만들 때마다 막대와 비율을 알린다. 컬럼 폭이 바뀌면 막대 폭을 다시 쓸 객체가 그 자리를 기억하게 하려는 것 — 막대 폭은 여기서 지금처럼 쓴다.
13
+ *
14
+ * (Optional) notified with each data bar and its ratio, so the object that rewrites widths on a column-width change
15
+ * can remember the spot; the bar width is still written here as before.
12
16
  */
13
- export declare function applyVisualSpecs(cellEl: HTMLElement, specs: VisualSpec[], cellW: number, _cellH: number): void;
17
+ export declare function applyVisualSpecs(cellEl: HTMLElement, specs: VisualSpec[], cellW: number, _cellH: number, track?: (bar: HTMLElement, ratio: number) => void): void;
@@ -3,6 +3,8 @@ import { ColumnLayout } from './ColumnLayout.js';
3
3
  import { GridRenderer } from './GridRenderer.js';
4
4
  import { CellEditor } from './editors/CellEditor.js';
5
5
  import { ColumnDef } from './types.js';
6
+ import { IRenderRequest } from './domain/render/ports.js';
7
+ import { IBodyPin } from './render/ports.js';
6
8
  /**
7
9
  * {@link CellEditManager} 의존성 주입 계약. / Dependency-injection contract for {@link CellEditManager}.
8
10
  *
@@ -23,8 +25,8 @@ export interface CellEditDeps<T extends Record<string, any>> {
23
25
  getOptions: () => any;
24
26
  /** 그리드 이벤트를 발행한다. / Emit a grid event. */
25
27
  emit: (event: string, ...args: any[]) => void;
26
- /** 바디를 다시 그린다. / Re-render the body. */
27
- doRender: () => void;
28
+ /** 그리기 요청을 낸다(보이는 범위 다시 그리기 등). / Submit a render request (e.g. repaint the visible range). */
29
+ submitRender: (req: IRenderRequest) => void;
28
30
  /** 스크린리더용 상태 안내. / Announce a status message for screen readers. */
29
31
  announce: (msg: string) => void;
30
32
  /** i18n: 편집 셀 위치 announce 해석 + 에디터 ctx 로케일 주입. / i18n: resolve edit-cell announce + inject locale into editor ctx. */
@@ -33,6 +35,16 @@ export interface CellEditDeps<T extends Record<string, any>> {
33
35
  writeCell: (ri: number, field: string, value: any) => void;
34
36
  /** 지정 행이 보이도록 스크롤한다. / Scroll so the given row is visible. */
35
37
  scrollToRow: (ri: number) => void;
38
+ /**
39
+ * 지정 컬럼이 보이도록 가로로 옮긴다(이미 보이면 아무것도 안 함). 없으면 가로로는 따라가지 않는다.
40
+ * / Scroll horizontally so the column is visible (no-op when already visible). Without it, no horizontal follow.
41
+ */
42
+ revealColumn?: (ci: number) => void;
43
+ /**
44
+ * 본문에 「이 행은 세로 창 밖으로 나가도 떼지 말라」를 알리는 곳(없으면 알리지 않음 — 지금 동작). 편집 시작 때 그 행을, 끝·취소 때 null 을 넘긴다.
45
+ * / Where to tell the body "keep this row even outside the vertical window"; the edited row on start, null on end.
46
+ */
47
+ getBodyPin?: () => IBodyPin | null | undefined;
36
48
  /** 현재 보이는(펼쳐진) 리프 컬럼 목록 조회. / Look up the currently visible leaf columns. */
37
49
  getVisibleLeaves: () => ColumnDef<T>[];
38
50
  /** F3: 해당 셀이 수식을 갖는지 조회. / F3: check whether the cell currently holds a formula. */
@@ -57,6 +69,8 @@ export declare class CellEditManager<T extends Record<string, any> = any> {
57
69
  private _editCell;
58
70
  private _focusCell;
59
71
  private _dragColIdx;
72
+ /** 마지막으로 돌려준 「꼭 그려 둘 컬럼」 목록(값이 같으면 같은 배열). / Last pinned-columns answer, reused while unchanged. */
73
+ private _pinned;
60
74
  private _d;
61
75
  constructor(deps: CellEditDeps<T>);
62
76
  /** 현재 마운트된 에디터 인스턴스(없으면 `null`). / The currently mounted editor instance (or `null`). */
@@ -74,6 +88,16 @@ export declare class CellEditManager<T extends Record<string, any> = any> {
74
88
  /** 컬럼 드래그 중인 컬럼 인덱스(없으면 `null`). / Column index currently being column-dragged (or `null`). */
75
89
  get dragColIdx(): number | null;
76
90
  set dragColIdx(v: number | null);
91
+ /**
92
+ * 가로로 화면 밖에 밀려나도 칸을 그려 둘 컬럼: 편집 중인 컬럼과 키보드 포커스 컬럼(오름차순, 겹치면 하나, 없으면 빈 배열).
93
+ * 가로 창을 정하는 쪽이 프레임마다 묻는다 — 편집기·포커스 표시가 든 칸을 창 밖으로 떼지 않으려고. 값이 같으면 같은 배열을 돌려준다.
94
+ *
95
+ * Columns whose cells stay rendered even when scrolled out horizontally: the editing column and the keyboard
96
+ * focus column (ascending, de-duplicated). The column-window owner asks every frame; same answer, same array.
97
+ */
98
+ pinnedColumns(): readonly number[];
99
+ /** 꼭 그려 둘 컬럼이 바뀌었으면 창을 다시 정하라고 알린다. / Ask for a new column window when pinned columns changed. */
100
+ private _notifyPinned;
77
101
  /**
78
102
  * 키보드 포커스 셀을 설정하고, 스크롤·재렌더·상태 announce 를 처리한다. / Set the keyboard-focused cell; handles scroll, re-render, and status announce.
79
103
  *
@@ -2,6 +2,7 @@ import { DataLayer } from './DataLayer.js';
2
2
  import { ColumnLayout } from './ColumnLayout.js';
3
3
  import { CellEditManager } from './CellEditManager.js';
4
4
  import { RowManager } from './RowManager.js';
5
+ import { IRenderRequest } from './domain/render/ports.js';
5
6
  /**
6
7
  * {@link CellEventHandler} 의존성 주입 계약. / Dependency-injection contract for {@link CellEventHandler}.
7
8
  *
@@ -25,8 +26,11 @@ export interface CellEventDeps<T extends Record<string, any>> {
25
26
  emit: (event: string, ...args: any[]) => void;
26
27
  /** 셀 값을 기록한다(토글/라디오 컬럼 등에서 사용). / Write a cell value (used by toggle/radio columns, etc.). */
27
28
  writeCell: (ri: number, field: string, value: any) => void;
28
- /** 바디를 다시 그린다. / Re-render the body. */
29
- doRender: () => void;
29
+ /**
30
+ * 그리기 요청을 낸다(받는 쪽이 계획대로 그린다). 이 객체는 무엇을 그릴지 정하지 않고 「무엇이 바뀌었나」만 알린다.
31
+ * / Submit a render request (the receiver paints per plan). This object reports what changed, not what to paint.
32
+ */
33
+ submitRender: (req: IRenderRequest) => void;
30
34
  /** 그리드 컨테이너 엘리먼트 조회. / Look up the grid container element. */
31
35
  getContainer: () => HTMLElement;
32
36
  /** 'cells' 모드 클릭/Shift+클릭 위임 — RangeSelectionManager.handleClick 로 연결
@@ -41,6 +41,14 @@ export declare class ColumnLayout<T = any> {
41
41
  private _flatLeaves;
42
42
  private _maxDepth;
43
43
  private _frozenCount;
44
+ /**
45
+ * 표시 잎 배열의 캐시. 그리기마다 여러 번 묻는 값이라 구성이 바뀔 때만 새로 만들고, 그 사이에는 같은 배열(같은 참조)을 돌려준다.
46
+ * 구성을 바꾸는 곳(잎을 다시 만드는 _process, 숨김, 보임)이 이것을 비운다.
47
+ *
48
+ * Cache of the visible-leaf array. Asked many times per paint, so it is rebuilt only when the column set changes and
49
+ * the same array (same reference) is returned in between. Every place that changes the set (_process, hide, show) clears it.
50
+ */
51
+ private _visibleCache;
44
52
  /**
45
53
  * 컬럼 정의로 배치 엔진 생성 후 즉시 리프·깊이를 계산. / Create the layout engine and immediately compute leaves/depth.
46
54
  *
@@ -1,4 +1,5 @@
1
1
  import { SortItem, FilterItem } from './types.js';
2
+ import { IRowSource } from './domain/sort/ports.js';
2
3
  type RowState = 'added' | 'edited' | 'removed' | 'none';
3
4
  /**
4
5
  * 그리드 데이터 모델 계층(C0 DataLayer). / Grid data model layer (contract C0 DataLayer).
@@ -16,7 +17,7 @@ type RowState = 'added' | 'edited' | 'removed' | 'none';
16
17
  * layer.updateCell(0, 'name', 'Park');
17
18
  * layer.getChanges(); // { added, edited, removed }
18
19
  */
19
- export declare class DataLayer<T extends Record<string, any> = any> {
20
+ export declare class DataLayer<T extends Record<string, any> = any> implements IRowSource<T> {
20
21
  private _data;
21
22
  private _original;
22
23
  private _meta;
@@ -38,6 +39,20 @@ export declare class DataLayer<T extends Record<string, any> = any> {
38
39
  private _findQuery;
39
40
  private _findFields;
40
41
  private _getStrategy;
42
+ private readonly _keys;
43
+ private readonly _sorter;
44
+ private _structureVersion;
45
+ /**
46
+ * 구조 판 번호 — 행 집합이나 표시 순서가 바뀔 때만 1씩 오른다. / Structure version — bumps only when the row set or display order changes.
47
+ *
48
+ * 안쪽 전용. 오르는 곳은 일곱 군데뿐이다: setData · clearData · addRow · removeRow · moveRow · 정렬 결과 적용(applySort) ·
49
+ * 필터 결과 적용(applyFilter). 칸 값 변경(updateCell·행 객체 직접 수정)으로는 오르지 않는다 — 값이 아니라 구조를 가리키므로,
50
+ * 합성 행 캐시처럼 「행 자리」만 기억하는 쪽이 무효화 열쇠로 쓴다.
51
+ * Internal use only. It bumps in exactly seven places: setData, clearData, addRow, removeRow, moveRow, applying a sort
52
+ * result (applySort) and applying a filter result (applyFilter). Value edits never bump it — it tracks structure, not
53
+ * values, so caches that only remember row positions (e.g. composed flat rows) can use it as an invalidation key.
54
+ */
55
+ get structureVersion(): number;
41
56
  /**
42
57
  * 데이터 계층 생성. / Create the data layer.
43
58
  *
@@ -253,6 +268,38 @@ export declare class DataLayer<T extends Record<string, any> = any> {
253
268
  * @param sortList - {field, dir} 정렬 키 목록(우선순위 순) / Sort keys {field, dir} in priority order
254
269
  */
255
270
  applySort(sortList: SortItem[]): void;
271
+ /**
272
+ * 정렬 원천: 원 자료(복사 아님). / Sort source: the source rows (not a copy).
273
+ *
274
+ * 안쪽 전용(정렬 객체가 읽음). 원 배열 그 자체이므로 받은 쪽은 읽기만 하고 고치지 않는다 —
275
+ * 길이를 바꾸거나 칸을 갈면 이 계층의 표시 순서·rowId 지도와 어긋난다. 10만 행을 정렬마다 베끼지 않으려고 복사하지 않는다.
276
+ * Internal use only (read by the sort objects). It is the live array: read it, never mutate it — changing its
277
+ * length or slots desynchronises the display order and rowId map. Not copied, to avoid a 100k-row copy per sort.
278
+ */
279
+ get rows(): readonly T[];
280
+ /**
281
+ * 정렬 원천: 지금 표시 순서에서 삭제 행을 뺀 원 자료 색인. / Sort source: current display order minus removed rows.
282
+ *
283
+ * @returns 원 자료 색인 배열 / Source indexes
284
+ */
285
+ displayOrder(): readonly number[];
286
+ /**
287
+ * 정렬 결과(원 자료 색인의 순열)를 표시 순서로 받아 적는다. / Record a sort result as the display order.
288
+ *
289
+ * 안쪽 전용(정렬 객체가 따로 낸 순서를 받아 적을 때 — applySort 는 출발 순서 길이로 같은 검사를 거친다). order 는 displayOrder() 의 **순열**이어야 한다 — 길이만 검사하고
290
+ * 중복·범위 밖은 보지 않는다(뜨거운 길이라 10만 칸 검사를 늘 치르지 않으려고). 받은 배열은 베껴 두므로 부른 쪽이 뒤에 고쳐도 되고,
291
+ * 이 메서드는 받은 배열을 고치지 않는다.
292
+ * Internal use only (applySort runs the same check against its start length). order must be a permutation of displayOrder(): only the length is
293
+ * checked (no duplicate/range scan on this hot path). The input is copied and never mutated.
294
+ *
295
+ * @param order - displayOrder() 와 같은 길이의 원 자료 색인 / Source indexes, same length as displayOrder()
296
+ * @throws RangeError 길이가 다르면 / when the length differs
297
+ */
298
+ applyOrder(order: ArrayLike<number>): void;
299
+ /** 길이가 expected 와 같을 때만 표시 순서로 받아 적는다(정렬 결과 적용의 한 자리). / Record order if its length is expected. */
300
+ private _setOrder;
301
+ /** 삭제 표시가 안 된 행인가. / Whether the row at source index i is not marked removed. */
302
+ private _isNotRemoved;
256
303
  /**
257
304
  * 컬럼별 필터 + F3 찾기 바(전체 컬럼 OR)를 적용해 표시 인덱스를 재계산. / Recompute the display index by applying per-column filters plus the F3 find bar (cross-column OR).
258
305
  *
@@ -1,5 +1,6 @@
1
1
  import { VirtualScroll } from './VirtualScroll.js';
2
2
  import { FlatRowModel } from './FlatRowModel.js';
3
+ import { IRenderRequest } from './domain/render/ports.js';
3
4
  /** expandRow/collapseRow/toggleRow/isRowExpanded/getDetailInstance 공통 인자(§6.2, C0.2).
4
5
  * / Common argument shape for expandRow/collapseRow/toggleRow/isRowExpanded/getDetailInstance (§6.2, C0.2). */
5
6
  export type DetailRowRef = number | {
@@ -25,8 +26,9 @@ export interface DetailManagerDeps<T extends Record<string, any> = any> {
25
26
  getRowId: (row: T) => string;
26
27
  /** stable rowId → 현재 행(삭제됐으면 undefined). DataLayer.getRowById 위임. / stable rowId → current row (undefined if deleted). Delegates to DataLayer.getRowById. */
27
28
  getRowById: (rowId: string) => T | undefined;
28
- /** group/tree rebuild 와 동일한 관용구 — 전체(0..n-1) 재렌더. / Same idiom as group/tree rebuild — re-renders the full (0..n-1) range. */
29
- doRenderFull: (n: number) => void;
29
+ /** 그리기 요청을 낸다 — 펼침·접힘 뒤 묶음·나무와 같은 관용구로 전 행(0..n-1)을 다시 그린다. 그리기는 요청 통로 하나로만 들어가 횟수·범위를 한곳에서 정한다.
30
+ * / Submit a render request — after expand/collapse, repaint every row (0..n-1), the same idiom as group/tree. Rendering enters through a single request channel so count and range are decided in one place. */
31
+ submitRender: (req: IRenderRequest) => void;
30
32
  /** 그리드 이벤트 발행. / Emit a grid event. */
31
33
  emit: (ev: string, payload: any) => void;
32
34
  /** aria-live 영역에 메시지를 공지. / Announce a message via the aria-live region. */
@@ -58,6 +60,17 @@ export declare class DetailManager<T extends Record<string, any> = any> {
58
60
  private _hosts;
59
61
  /** FR-9(UX-REVIEW-08): collapse 직전 패널 내부에 포커스가 있었는지 rowId 로 기억. */
60
62
  private _focusPendingRestore;
63
+ /** 펼침·접힘·디테일 높이 옵션이 바뀔 때마다 오르는 판 번호(합성 결과 재사용의 열쇠). */
64
+ private _activeVersion;
65
+ /** 판 번호를 마지막으로 맞춰 본 디테일 높이 옵션 값들. */
66
+ private _seenRowHeight;
67
+ private _seenHeight;
68
+ private _seenSlots;
69
+ private _seenEnabled;
70
+ /** 「지금 자료에 있는 펼침이 있나」 메모와 그 메모를 만든 때의 두 판 번호. */
71
+ private _liveMemo;
72
+ private _liveMemoActive;
73
+ private _liveMemoData;
61
74
  constructor(deps: DetailManagerDeps<T>);
62
75
  private _mdOpts;
63
76
  /** masterDetail.enabled 여부(옵션 자체 — 펼침 개수와 무관). / Whether masterDetail.enabled is set (the option itself — independent of how many rows are expanded). */
@@ -66,6 +79,34 @@ export declare class DetailManager<T extends Record<string, any> = any> {
66
79
  * / §3.2 v2: "isActive" = feature on AND at least one row expanded (used to branch
67
80
  * FlatRowModel composition/rendering). */
68
81
  get isActive(): boolean;
82
+ /**
83
+ * 끼워 넣는 결과가 바뀔 수 있을 때마다 오르는 판 번호 — 펼침·접힘, 그리고 결과를 바꾸는 옵션
84
+ * (`masterDetail.enabled`·`height`·`detailRowCount`, 그리드 `rowHeight`). 행 모델은 이 번호가 같은
85
+ * 동안 합성 결과를 다시 쓴다. 옵션은 바뀌어도 알림이 없으므로 물을 때마다 지난 값과 맞대 본다
86
+ * (칸마다 불리므로 문자열·객체를 만들지 않고 값 넷만 견준다).
87
+ *
88
+ * A version bumped whenever the inserted result may change — expand/collapse and the options that shape
89
+ * the result (`masterDetail.enabled`·`height`·`detailRowCount`, grid `rowHeight`). The row model reuses
90
+ * its composed result while this number stays the same. Options change without notice, so each read
91
+ * compares them with the last seen values (it runs per cell, so it compares four values and allocates nothing).
92
+ * @internal
93
+ */
94
+ get activeVersion(): number;
95
+ /**
96
+ * 행 모델이 합성할지 고를 때 묻는 술어 — 기능이 켜져 있고, 펼쳐 둔 행 가운데 **지금 자료에 있는 것**이
97
+ * 하나라도 있으면 참. 펼침 상태는 행 id 로 보관하고 자료를 바꿔도 솎지 않는다(같은 id 로 다시 넣으면
98
+ * 그대로 펼쳐 보이게). 그래서 옛 자료의 id 만 남은 경우 끼워 넣을 행이 없는데도 늘 합성하던 것을,
99
+ * 여기서 「끼울 곳이 있나」로 가려 직통으로 돌린다. 결과는 같다 — 그 id 들은 어느 행과도 맞지 않는다.
100
+ * 펼침 판 번호와 자료 구조 판 번호가 그대로면 지난 답을 쓴다(칸마다 불림).
101
+ *
102
+ * Predicate the row model asks when choosing whether to compose — true when the feature is on and at
103
+ * least one expanded row is **present in the current data**. Expansion is kept by row id and is not
104
+ * pruned when data changes (re-adding the same id shows it expanded again). So when only ids from old
105
+ * data remain there is nothing to insert, yet the grid used to compose every time; this check sends it
106
+ * back to the direct path. The result is the same — those ids match no row. The last answer is reused
107
+ * while the expansion version and the data structure version are unchanged (it runs per cell).
108
+ */
109
+ private _hasLiveExpansion;
69
110
  /** 현재 설정된 최대 중첩 깊이. / Currently configured maximum nesting depth. */
70
111
  get maxDepth(): number;
71
112
  private _resolveRowId;
@@ -1,6 +1,23 @@
1
1
  import { ColumnLayout } from './ColumnLayout.js';
2
2
  import { WorksheetManager } from './WorksheetManager.js';
3
3
  import { ExportOptions, PrintOptions } from './types.js';
4
+ import { IArtifactSource, IByteSink, ExportRunCtx, ExportResult } from './export/types.js';
5
+ /** 스트리밍 경로가 지연 로드하는 모듈 묶음(시험에서 교체 가능). / Lazily-loaded modules of the streaming path (swappable in tests). */
6
+ export interface StreamModules {
7
+ pickExcelSink: (o: {
8
+ fileName?: string;
9
+ fsAccess?: 'auto' | 'off';
10
+ }) => {
11
+ kind: 'fs' | 'blob';
12
+ create(): Promise<IByteSink>;
13
+ };
14
+ createChannel: (o: {
15
+ sheetName?: string;
16
+ includeHeader?: boolean;
17
+ }) => {
18
+ writeStreaming(src: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
19
+ };
20
+ }
4
21
  /**
5
22
  * ExportManager 의존성 주입 인터페이스. / Dependency-injection interface for ExportManager.
6
23
  *
@@ -32,6 +49,8 @@ export interface ExportDeps<T extends Record<string, any>> {
32
49
  intlLocale: string;
33
50
  exportFont?: string;
34
51
  };
52
+ /** 스트리밍 경로 모듈 로더(미주입 시 지연 import). / Streaming module loader (lazy import when absent). */
53
+ loadStreamModules?: () => Promise<StreamModules>;
35
54
  }
36
55
  /**
37
56
  * 그리드 데이터 내보내기(Excel/CSV/JSON/인쇄) 관리자. / Manages exporting grid data (Excel/CSV/JSON/print).
@@ -68,6 +87,11 @@ export declare class ExportManager<T extends Record<string, any> = any> {
68
87
  * grid.exportExcel({ filename: 'orders', maskOnExport: true });
69
88
  */
70
89
  exportExcel(options?: ExportOptions | string): void;
90
+ /**
91
+ * @internal 대량 엑셀 스트리밍 경로: 행 청크를 흘려 쓰며 진척바·취소를 제공한다.
92
+ * / Large-export streaming path: flows row chunks, with progress bar and cancel.
93
+ */
94
+ private _exportExcelStreaming;
71
95
  /**
72
96
  * 현재 그리드 데이터를 UTF-8 BOM 포함 CSV 로 내보낸다. / Export the current grid data as a UTF-8 (BOM) CSV file.
73
97
  *