open-grid 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
- package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
- package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
- package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
- package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
- package/dist/OpenGrid-CeXt04ho.js +98 -0
- package/dist/Registry-CrT46EAO.js +2 -0
- package/dist/Registry-DpHOpU5V.cjs +2 -0
- package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
- package/dist/XlsxChannel-DQHLGend.cjs +2 -0
- package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
- package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
- package/dist/fflate-Cs3txMgg.js +2 -0
- package/dist/fflate-G9RAFEgF.cjs +2 -0
- package/dist/index-1OXjJmct.js +2 -0
- package/dist/index-B5V7e4Xc.js +2 -0
- package/dist/index-DbKDox8y.cjs +2 -0
- package/dist/index-HaDoF1HM.cjs +2 -0
- package/dist/open-grid-react.cjs +1 -27
- package/dist/open-grid-react.js +1 -30
- package/dist/open-grid-vue.cjs +1 -31
- package/dist/open-grid-vue.js +1 -33
- package/dist/open-grid.cjs +6 -275
- package/dist/open-grid.js +6 -293
- package/dist/sinks-BCZFMGQJ.cjs +2 -0
- package/dist/sinks-qkBJ5bKn.js +2 -0
- package/dist/types/core/CFRenderBridge.d.ts +5 -1
- package/dist/types/core/CellEditManager.d.ts +26 -2
- package/dist/types/core/CellEventHandler.d.ts +6 -2
- package/dist/types/core/ColumnLayout.d.ts +8 -0
- package/dist/types/core/DataLayer.d.ts +48 -1
- package/dist/types/core/DetailManager.d.ts +43 -2
- package/dist/types/core/ExportManager.d.ts +25 -0
- package/dist/types/core/FindBarManager.d.ts +6 -2
- package/dist/types/core/FlatRowModel.d.ts +61 -3
- package/dist/types/core/FooterManager.d.ts +43 -1
- package/dist/types/core/FormulaController.d.ts +4 -4
- package/dist/types/core/GridComposer.d.ts +11 -1
- package/dist/types/core/GridRenderer.d.ts +84 -19
- package/dist/types/core/GroupTreeManager.d.ts +6 -4
- package/dist/types/core/KeyboardManager.d.ts +3 -2
- package/dist/types/core/MutationService.d.ts +10 -8
- package/dist/types/core/OpenGrid.d.ts +7 -5
- package/dist/types/core/RangeSelectionManager.d.ts +23 -2
- package/dist/types/core/RenderController.d.ts +126 -8
- package/dist/types/core/SortFilterManager.d.ts +10 -2
- package/dist/types/core/VirtualScroll.d.ts +12 -0
- package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
- package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
- package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
- package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
- package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
- package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
- package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
- package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
- package/dist/types/core/coordinate/ports.d.ts +5 -0
- package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
- package/dist/types/core/domain/footer/ports.d.ts +31 -0
- package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
- package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
- package/dist/types/core/domain/render/ports.d.ts +169 -0
- package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
- package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
- package/dist/types/core/domain/resize/ports.d.ts +64 -0
- package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
- package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
- package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
- package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
- package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
- package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
- package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
- package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
- package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
- package/dist/types/core/domain/sort/ports.d.ts +140 -0
- package/dist/types/core/export/ExportProgressView.d.ts +28 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +38 -1
- package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
- package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
- package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
- package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
- package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +20 -0
- package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
- package/dist/types/core/export/index.d.ts +2 -0
- package/dist/types/core/export/sinks.d.ts +81 -0
- package/dist/types/core/export/types.d.ts +63 -0
- package/dist/types/core/host/archCheck.d.ts +16 -1
- package/dist/types/core/i18n/locales/en.d.ts +6 -0
- package/dist/types/core/i18n/locales/ko.d.ts +6 -0
- package/dist/types/core/i18n/types.d.ts +8 -0
- package/dist/types/core/render/FooterView.d.ts +121 -0
- package/dist/types/core/render/GeometryApplier.d.ts +55 -0
- package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
- package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
- package/dist/types/core/render/RenderScheduler.d.ts +225 -0
- package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
- package/dist/types/core/render/ScrollFollower.d.ts +34 -0
- package/dist/types/core/render/ScrollObserver.d.ts +47 -0
- package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
- package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
- package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
- package/dist/types/core/render/body/BodyView.d.ts +185 -0
- package/dist/types/core/render/body/CellLocator.d.ts +36 -0
- package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
- package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
- package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
- package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
- package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
- package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
- package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
- package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
- package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
- package/dist/types/core/render/dom.d.ts +10 -0
- package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
- package/dist/types/core/render/header/HeaderView.d.ts +84 -0
- package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
- package/dist/types/core/render/ports.d.ts +218 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
- package/dist/types/core/types.d.ts +94 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
- package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
- package/dist/xlsx.min-i_b-4PvU.js +138 -0
- package/package.json +3 -8
- package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
- package/dist/OpenGrid-D6YxCsnV.js +0 -7472
- package/dist/Registry-CPJYOqCn.js +0 -74
- package/dist/Registry-D74ZmdDz.cjs +0 -71
- package/dist/index-CeJ-0-80.cjs +0 -260
- package/dist/index-D0DJtKYI.cjs +0 -452
- package/dist/index-DnarQ4eR.js +0 -266
- package/dist/index-VkKgQ506.js +0 -481
- package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
- package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
package/dist/index-DnarQ4eR.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
const a = (h) => {
|
|
2
|
-
const e = globalThis.requestAnimationFrame;
|
|
3
|
-
if (typeof e == "function") {
|
|
4
|
-
const i = e(() => h()), o = globalThis.cancelAnimationFrame;
|
|
5
|
-
return { cancel: () => o == null ? void 0 : o(i) };
|
|
6
|
-
}
|
|
7
|
-
const s = setTimeout(h, 16);
|
|
8
|
-
return { cancel: () => clearTimeout(s) };
|
|
9
|
-
};
|
|
10
|
-
class c {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
this._cells = /* @__PURE__ */ new Map(), this._upserts = /* @__PURE__ */ new Map(), this._removes = /* @__PURE__ */ new Set(), this._coalesced = 0, this._dropped = 0, this._disposed = false, this._cfg = e;
|
|
13
|
-
}
|
|
14
|
-
enqueue(e) {
|
|
15
|
-
if (!this._disposed) {
|
|
16
|
-
if (e.kind === "snapshot") {
|
|
17
|
-
this._dropped += this._cells.size + this._upserts.size + this._removes.size, this._cells.clear(), this._upserts.clear(), this._removes.clear(), this._snapshot = e, this._scheduleFrame();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this._mergeDelta(e), this._scheduleFrame();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
_mergeDelta(e) {
|
|
24
|
-
if (e.removes) for (const s of e.removes) {
|
|
25
|
-
this._removes.add(s), this._upserts.delete(s);
|
|
26
|
-
for (const i of this._cells.keys()) i.slice(0, i.indexOf("\0")) === s && this._cells.delete(i);
|
|
27
|
-
}
|
|
28
|
-
if (e.upserts) for (const s of e.upserts) {
|
|
29
|
-
if (this._removes.has(s.rowId)) continue;
|
|
30
|
-
const i = this._upserts.get(s.rowId);
|
|
31
|
-
i && this._coalesced++, this._upserts.set(s.rowId, { ...i ?? {}, ...s.row });
|
|
32
|
-
}
|
|
33
|
-
if (e.cells) for (const s of e.cells) {
|
|
34
|
-
if (this._removes.has(s.rowId)) continue;
|
|
35
|
-
const i = s.rowId + "\0" + s.field;
|
|
36
|
-
this._cells.has(i) && this._coalesced++, this._cells.set(i, { rowId: s.rowId, field: s.field, value: s.value });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
_scheduleFrame() {
|
|
40
|
-
this._frame || (this._frame = this._cfg.scheduleFrame(() => {
|
|
41
|
-
this._frame = void 0, this._flushFrame();
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
_flushFrame() {
|
|
45
|
-
if (this._disposed) return;
|
|
46
|
-
if (this._snapshot) {
|
|
47
|
-
const r = this._snapshot;
|
|
48
|
-
this._snapshot = void 0, this._cfg.flush({ cells: [], upserts: [], removes: [], snapshot: r, overflowToNextFrame: false });
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const e = this._cfg.maxBatchPerFrame ?? 0, s = [];
|
|
52
|
-
let i = false;
|
|
53
|
-
for (const [r, n] of this._cells) {
|
|
54
|
-
if (e > 0 && s.length >= e) {
|
|
55
|
-
i = true;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
s.push(n), this._cells.delete(r);
|
|
59
|
-
}
|
|
60
|
-
const o = [...this._upserts.entries()].map(([r, n]) => ({ rowId: r, row: n })), t = [...this._removes];
|
|
61
|
-
this._upserts.clear(), this._removes.clear(), !(s.length === 0 && o.length === 0 && t.length === 0) && (this._cfg.flush({ cells: s.map((r) => ({ rowId: r.rowId, field: r.field, value: r.value })), upserts: o, removes: t, overflowToNextFrame: i }), (i || this._cells.size > 0) && this._scheduleFrame());
|
|
62
|
-
}
|
|
63
|
-
get stats() {
|
|
64
|
-
return { pending: this._cells.size + this._upserts.size + this._removes.size, coalesced: this._coalesced, dropped: this._dropped };
|
|
65
|
-
}
|
|
66
|
-
dispose() {
|
|
67
|
-
var _a;
|
|
68
|
-
this._disposed = true, (_a = this._frame) == null ? void 0 : _a.cancel(), this._frame = void 0, this._cells.clear(), this._upserts.clear(), this._removes.clear(), this._snapshot = void 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
class d {
|
|
72
|
-
constructor(e) {
|
|
73
|
-
this.spi = "command", this.kind = "rt.apply", this.label = "rt.backgroundUpdate", this._at = 0, this._cellInverse = [], this._insertedRowIds = [], this._removedInverse = [], this._batch = e, this.footprint = d._footprintOf(e);
|
|
74
|
-
}
|
|
75
|
-
get appliedDelta() {
|
|
76
|
-
return this._applied;
|
|
77
|
-
}
|
|
78
|
-
do(e) {
|
|
79
|
-
this._at = e.clock.now(), this._cellInverse = [], this._insertedRowIds = [], this._removedInverse = [];
|
|
80
|
-
const s = [];
|
|
81
|
-
e.mutation.beginBatch();
|
|
82
|
-
try {
|
|
83
|
-
const i = [];
|
|
84
|
-
for (const t of this._batch.cells) {
|
|
85
|
-
const r = e.coords.indexOf(t.rowId);
|
|
86
|
-
r < 0 || (this._cellInverse.push({ rowId: t.rowId, field: t.field, oldValue: e.coords.getCellValue(t.rowId, t.field) }), i.push({ rowIndex: r, field: t.field, value: t.value }), s.push({ rowId: t.rowId, field: t.field }));
|
|
87
|
-
}
|
|
88
|
-
i.length > 0 && e.mutation.writeCells(i);
|
|
89
|
-
for (const t of this._batch.upserts) {
|
|
90
|
-
const r = e.coords.indexOf(t.rowId);
|
|
91
|
-
if (r >= 0) {
|
|
92
|
-
const n = [];
|
|
93
|
-
for (const [l, _] of Object.entries(t.row)) this._cellInverse.push({ rowId: t.rowId, field: l, oldValue: e.coords.getCellValue(t.rowId, l) }), n.push({ rowIndex: r, field: l, value: _ }), s.push({ rowId: t.rowId, field: l });
|
|
94
|
-
n.length > 0 && e.mutation.writeCells(n);
|
|
95
|
-
} else e.mutation.insertRow(t.row, "last"), this._insertedRowIds.push(t.rowId);
|
|
96
|
-
}
|
|
97
|
-
const o = [];
|
|
98
|
-
for (const t of this._batch.removes) {
|
|
99
|
-
const r = e.coords.indexOf(t);
|
|
100
|
-
r < 0 || (this._removedInverse.push({ rowId: t, snapshot: e.coords.getRowSnapshot(t) }), o.push({ rowId: t, index: r }));
|
|
101
|
-
}
|
|
102
|
-
o.length > 0 && e.mutation.deleteRows(o.sort((t, r) => r.index - t.index).map((t) => t.index)), this._applied = { changedCells: s, insertedRowIds: [...this._insertedRowIds], removedRowIds: this._removedInverse.map((t) => t.rowId), userInitiated: false };
|
|
103
|
-
} finally {
|
|
104
|
-
e.mutation.endBatch();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
undo(e) {
|
|
108
|
-
e.mutation.beginBatch();
|
|
109
|
-
try {
|
|
110
|
-
const s = this._insertedRowIds.map((o) => e.coords.indexOf(o)).filter((o) => o >= 0).sort((o, t) => t - o);
|
|
111
|
-
s.length > 0 && e.mutation.deleteRows(s);
|
|
112
|
-
for (const o of this._removedInverse) o.snapshot && e.mutation.insertRow(o.snapshot, "last");
|
|
113
|
-
const i = [];
|
|
114
|
-
for (const o of this._cellInverse) {
|
|
115
|
-
const t = e.coords.indexOf(o.rowId);
|
|
116
|
-
t >= 0 && i.push({ rowIndex: t, field: o.field, value: o.oldValue });
|
|
117
|
-
}
|
|
118
|
-
i.length > 0 && e.mutation.writeCells(i);
|
|
119
|
-
} finally {
|
|
120
|
-
e.mutation.endBatch();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
serialize() {
|
|
124
|
-
return { kind: this.kind, payload: { cells: this._batch.cells, upserts: this._batch.upserts, removes: this._batch.removes }, at: this._at };
|
|
125
|
-
}
|
|
126
|
-
static _footprintOf(e) {
|
|
127
|
-
if (e.snapshot || e.upserts.length > 0 || e.removes.length > 0) return { scope: "structure" };
|
|
128
|
-
const s = [...new Set(e.cells.map((o) => o.rowId))], i = [...new Set(e.cells.map((o) => o.field))];
|
|
129
|
-
return s.length === 1 && i.length === 1 ? { scope: "cell", rowId: s[0], field: i[0] } : { scope: "range", rowIds: s, fields: i };
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
class u {
|
|
133
|
-
constructor(e, s) {
|
|
134
|
-
this._statusListeners = /* @__PURE__ */ new Set(), this._attached = false, this._source = e, this._deps = s, this._now = s.now ?? (() => Date.now()), this._connection = e.status, this._scheduler = new c({ ...s.maxBatchPerFrame !== void 0 ? { maxBatchPerFrame: s.maxBatchPerFrame } : {}, scheduleFrame: s.scheduleFrame ?? a, flush: (i) => this._applyBatch(i) });
|
|
135
|
-
}
|
|
136
|
-
attach() {
|
|
137
|
-
this._attached || (this._attached = true, this._offData = this._source.onData((e) => this._onData(e)), this._offStatus = this._source.onStatus((e) => this._onStatus(e)), this._source.start());
|
|
138
|
-
}
|
|
139
|
-
detach() {
|
|
140
|
-
var _a, _b;
|
|
141
|
-
this._attached && (this._attached = false, (_a = this._offData) == null ? void 0 : _a.call(this), (_b = this._offStatus) == null ? void 0 : _b.call(this), this._offData = void 0, this._offStatus = void 0, this._source.stop(), this._scheduler.dispose());
|
|
142
|
-
}
|
|
143
|
-
get connection() {
|
|
144
|
-
return this._connection;
|
|
145
|
-
}
|
|
146
|
-
get backpressureStats() {
|
|
147
|
-
return this._scheduler.stats;
|
|
148
|
-
}
|
|
149
|
-
onConnection(e) {
|
|
150
|
-
return this._statusListeners.add(e), () => this._statusListeners.delete(e);
|
|
151
|
-
}
|
|
152
|
-
_onData(e) {
|
|
153
|
-
this._deps.freshness.markReceived(e.serverTime ?? this._now()), this._scheduler.enqueue(e);
|
|
154
|
-
}
|
|
155
|
-
_onStatus(e) {
|
|
156
|
-
this._connection = e, this._deps.announce.onConnection(e.status), this._deps.freshness.tick();
|
|
157
|
-
for (const s of this._statusListeners) s(e);
|
|
158
|
-
}
|
|
159
|
-
_applyBatch(e) {
|
|
160
|
-
const s = this._deps.stateGuard.capture();
|
|
161
|
-
if (e.snapshot) {
|
|
162
|
-
if (this._deps.applySnapshot) {
|
|
163
|
-
this._deps.applySnapshot(e.snapshot.rows);
|
|
164
|
-
const t = { changedCells: [], insertedRowIds: [], removedRowIds: [], userInitiated: false };
|
|
165
|
-
this._deps.stateGuard.restore(s, t), this._deps.announce.onBackgroundChange(t);
|
|
166
|
-
} else console.warn("[open-grid/realtime] snapshot received but no applySnapshot dep wired — skipped");
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
const i = new d(e);
|
|
170
|
-
this._deps.sink.beginBatch();
|
|
171
|
-
try {
|
|
172
|
-
this._deps.sink.dispatchSilent(i);
|
|
173
|
-
} finally {
|
|
174
|
-
this._deps.sink.endBatch();
|
|
175
|
-
}
|
|
176
|
-
const o = i.appliedDelta;
|
|
177
|
-
if (o && (this._deps.stateGuard.restore(s, o), this._deps.announce.onBackgroundChange(o), this._deps.chart)) {
|
|
178
|
-
const t = [.../* @__PURE__ */ new Set([...o.changedCells.map((r) => r.rowId), ...o.insertedRowIds, ...o.removedRowIds])];
|
|
179
|
-
t.length > 0 && this._deps.chart.markDirty(t);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
class f {
|
|
184
|
-
constructor(e, s) {
|
|
185
|
-
this._lastConflicts = [], this._src = e, this._coords = s;
|
|
186
|
-
}
|
|
187
|
-
get lastConflicts() {
|
|
188
|
-
return this._lastConflicts;
|
|
189
|
-
}
|
|
190
|
-
capture() {
|
|
191
|
-
const e = this._src.readEditing();
|
|
192
|
-
return { selection: this._src.readSelection(), scroll: this._src.readScroll(), ...e ? { editing: e } : {}, sortFilterSig: this._src.readSortFilterSig() };
|
|
193
|
-
}
|
|
194
|
-
restore(e, s) {
|
|
195
|
-
this._lastConflicts = [];
|
|
196
|
-
const i = new Set(s.removedRowIds), o = e.selection.filter((t) => !i.has(t.rowId) && this._coords.rowIdToIndex(t.rowId) >= 0);
|
|
197
|
-
this._src.writeSelection(o), e.scroll.anchorRowId && (i.has(e.scroll.anchorRowId) || this._coords.rowIdToIndex(e.scroll.anchorRowId) < 0) ? this._src.writeScroll({ pixelWithinRow: 0, scrollLeft: e.scroll.scrollLeft }) : this._src.writeScroll(e.scroll), e.editing && (!i.has(e.editing.rowId) && this._coords.rowIdToIndex(e.editing.rowId) >= 0 ? (s.changedCells.some((n) => n.rowId === e.editing.rowId && n.field === e.editing.field) && this._lastConflicts.push({ rowId: e.editing.rowId, field: e.editing.field }), this._src.writeEditing(e.editing)) : this._src.writeEditing(void 0));
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
class p {
|
|
201
|
-
constructor(e) {
|
|
202
|
-
this._lastState = "stale", this._listeners = /* @__PURE__ */ new Set(), this._staleAfterMs = e.staleAfterMs, this._now = e.now ?? (() => Date.now());
|
|
203
|
-
}
|
|
204
|
-
markReceived(e) {
|
|
205
|
-
this._lastReceivedAt = e, this._emitIfChanged();
|
|
206
|
-
}
|
|
207
|
-
compute() {
|
|
208
|
-
const e = this._now();
|
|
209
|
-
if (this._lastReceivedAt === void 0) return { state: "stale", ageMs: 1 / 0 };
|
|
210
|
-
const s = e - this._lastReceivedAt;
|
|
211
|
-
return { state: s > this._staleAfterMs ? "stale" : "fresh", ageMs: s, lastReceivedAt: this._lastReceivedAt };
|
|
212
|
-
}
|
|
213
|
-
tick() {
|
|
214
|
-
return this._emitIfChanged();
|
|
215
|
-
}
|
|
216
|
-
_emitIfChanged() {
|
|
217
|
-
const e = this.compute();
|
|
218
|
-
if (e.state !== this._lastState) {
|
|
219
|
-
this._lastState = e.state;
|
|
220
|
-
for (const s of this._listeners) s(e);
|
|
221
|
-
}
|
|
222
|
-
return e;
|
|
223
|
-
}
|
|
224
|
-
onChange(e) {
|
|
225
|
-
return this._listeners.add(e), () => this._listeners.delete(e);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
class w {
|
|
229
|
-
constructor(e) {
|
|
230
|
-
this._pendingCells = /* @__PURE__ */ new Set(), this._pendingRows = /* @__PURE__ */ new Set(), this._announce = e.announce, this._debounceMs = e.debounceMs ?? 500, this._schedule = e.schedule ?? ((s, i) => {
|
|
231
|
-
const o = setTimeout(s, i);
|
|
232
|
-
return { cancel: () => clearTimeout(o) };
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
onBackgroundChange(e) {
|
|
236
|
-
for (const s of e.changedCells) this._pendingCells.add(s.rowId + " " + s.field), this._pendingRows.add(s.rowId);
|
|
237
|
-
for (const s of e.insertedRowIds) this._pendingRows.add(s);
|
|
238
|
-
for (const s of e.removedRowIds) this._pendingRows.add(s);
|
|
239
|
-
this._arm();
|
|
240
|
-
}
|
|
241
|
-
_arm() {
|
|
242
|
-
this._timer || (this._timer = this._schedule(() => {
|
|
243
|
-
this._timer = void 0, this._flush();
|
|
244
|
-
}, this._debounceMs));
|
|
245
|
-
}
|
|
246
|
-
_flush() {
|
|
247
|
-
this._pendingCells.size === 0 && this._pendingRows.size === 0 || (this._announce({ kind: "background-update", changedCount: this._pendingCells.size, rowCount: this._pendingRows.size, label: "background", interruptsFocus: false }), this._pendingCells.clear(), this._pendingRows.clear());
|
|
248
|
-
}
|
|
249
|
-
onConnection(e) {
|
|
250
|
-
this._announce({ kind: "connection", changedCount: 0, rowCount: 0, label: "connection", interruptsFocus: false, connectionStatus: e });
|
|
251
|
-
}
|
|
252
|
-
dispose() {
|
|
253
|
-
var _a;
|
|
254
|
-
(_a = this._timer) == null ? void 0 : _a.cancel(), this._timer = void 0, this._pendingCells.clear(), this._pendingRows.clear();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
export {
|
|
258
|
-
c as BackpressureScheduler,
|
|
259
|
-
p as FreshnessClock,
|
|
260
|
-
f as LiveStateGuard,
|
|
261
|
-
u as RealtimeController,
|
|
262
|
-
w as RtAnnouncePolicy,
|
|
263
|
-
d as RtApplyCommand,
|
|
264
|
-
a as defaultFrameScheduler
|
|
265
|
-
};
|
|
266
|
-
//# sourceMappingURL=index-DnarQ4eR.js.map
|