comins-table 0.2.1 → 0.2.3
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 +85 -0
- package/README.md +6 -2
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/browser/measurements.d.ts.map +1 -1
- package/dist/browser/viewport-requests.d.ts.map +1 -1
- package/dist/cell-fill.d.ts +7 -0
- package/dist/cell-fill.d.ts.map +1 -1
- package/dist/{clipboard-CNrbmDue.js → clipboard-DZmm2iRM.js} +172 -146
- package/dist/clipboard-DZmm2iRM.js.map +1 -0
- package/dist/clipboard.js +2 -2
- package/dist/column-filter.d.ts +6 -1
- package/dist/column-filter.d.ts.map +1 -1
- package/dist/column-pinning.d.ts.map +1 -1
- package/dist/component-renderer.d.ts.map +1 -1
- package/dist/core/editing/xlsx-data.d.ts +12 -0
- package/dist/core/editing/xlsx-data.d.ts.map +1 -0
- package/dist/core/editing/xlsx-model.d.ts +103 -0
- package/dist/core/editing/xlsx-model.d.ts.map +1 -0
- package/dist/core/layout/columns.d.ts.map +1 -1
- package/dist/core/layout/virtual.d.ts.map +1 -1
- package/dist/core/model.d.ts +2 -0
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/rows/filter-value.d.ts +12 -0
- package/dist/core/rows/filter-value.d.ts.map +1 -0
- package/dist/core/rows/filtering.d.ts +27 -7
- package/dist/core/rows/filtering.d.ts.map +1 -1
- package/dist/core/rows/values-filter.d.ts +46 -0
- package/dist/core/rows/values-filter.d.ts.map +1 -0
- package/dist/core/viewport/data.d.ts.map +1 -1
- package/dist/{core-compat-B4I2OHGY.js → core-compat-CQ_YgTHr.js} +8 -3
- package/dist/core-compat-CQ_YgTHr.js.map +1 -0
- package/dist/core.d.ts +5 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +3 -3
- package/dist/engine-iWefk5Rv.js +146 -0
- package/dist/engine-iWefk5Rv.js.map +1 -0
- package/dist/export-B_Q9_Whp.js +184 -0
- package/dist/export-B_Q9_Whp.js.map +1 -0
- package/dist/filtering.d.ts +23 -25
- package/dist/filtering.d.ts.map +1 -1
- package/dist/grouping.d.ts +8 -0
- package/dist/grouping.d.ts.map +1 -1
- package/dist/index.d.ts +32 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2819 -2314
- package/dist/index.js.map +1 -1
- package/dist/react/cell-tooltip.d.ts +20 -0
- package/dist/react/cell-tooltip.d.ts.map +1 -0
- package/dist/react/core-compat.d.ts.map +1 -1
- package/dist/react/state.d.ts.map +1 -1
- package/dist/react/table-transfer.d.ts +4 -0
- package/dist/react/table-transfer.d.ts.map +1 -1
- package/dist/react/value-filter-types.d.ts +79 -0
- package/dist/react/value-filter-types.d.ts.map +1 -0
- package/dist/react/value-filter.d.ts +897 -0
- package/dist/react/value-filter.d.ts.map +1 -0
- package/dist/react-types.d.ts +10 -1
- package/dist/react-types.d.ts.map +1 -1
- package/dist/selection.js +1 -1
- package/dist/summary.d.ts +9 -0
- package/dist/summary.d.ts.map +1 -1
- package/dist/tree-drag.d.ts.map +1 -1
- package/dist/values-filter-pFAPWz1Q.js +497 -0
- package/dist/values-filter-pFAPWz1Q.js.map +1 -0
- package/dist/workbook-C7MXhUjt.js +349 -0
- package/dist/workbook-C7MXhUjt.js.map +1 -0
- package/dist/xlsx/engine.d.ts +5 -0
- package/dist/xlsx/engine.d.ts.map +1 -0
- package/dist/xlsx/errors.d.ts +12 -0
- package/dist/xlsx/errors.d.ts.map +1 -0
- package/dist/xlsx/export.d.ts +3 -0
- package/dist/xlsx/export.d.ts.map +1 -0
- package/dist/xlsx/styles.d.ts +37 -0
- package/dist/xlsx/styles.d.ts.map +1 -0
- package/dist/xlsx/text.d.ts +7 -0
- package/dist/xlsx/text.d.ts.map +1 -0
- package/dist/xlsx/workbook.d.ts +32 -0
- package/dist/xlsx/workbook.d.ts.map +1 -0
- package/dist/xlsx/xml.d.ts +14 -0
- package/dist/xlsx/xml.d.ts.map +1 -0
- package/dist/xlsx/zip.d.ts +9 -0
- package/dist/xlsx/zip.d.ts.map +1 -0
- package/dist/xlsx.d.ts +7 -0
- package/dist/xlsx.d.ts.map +1 -0
- package/dist/xlsx.js +39 -0
- package/dist/xlsx.js.map +1 -0
- package/dist/zip-Oz81THHH.js +62 -0
- package/dist/zip-Oz81THHH.js.map +1 -0
- package/package.json +22 -12
- package/styles.css +35 -0
- package/dist/clipboard-CNrbmDue.js.map +0 -1
- package/dist/core-compat-B4I2OHGY.js.map +0 -1
- package/dist/export-structure-Dy2zOqbj.js +0 -166
- package/dist/export-structure-Dy2zOqbj.js.map +0 -1
|
@@ -25,7 +25,7 @@ function n(e, t) {
|
|
|
25
25
|
}
|
|
26
26
|
function r(e, t) {
|
|
27
27
|
return t.split(".").reduce((e, t) => {
|
|
28
|
-
if (
|
|
28
|
+
if (typeof e == "object" && e) return e[t];
|
|
29
29
|
}, e);
|
|
30
30
|
}
|
|
31
31
|
function i(e, t, n) {
|
|
@@ -87,6 +87,15 @@ function d(e) {
|
|
|
87
87
|
return e === "left" || e === "right" ? e : void 0;
|
|
88
88
|
}
|
|
89
89
|
function f(e, t) {
|
|
90
|
+
for (let n of e) if (n.pinned !== void 0) return p(e, t);
|
|
91
|
+
let n = /* @__PURE__ */ new Map(), r = [];
|
|
92
|
+
for (let t of e) for (let e of t.columnIds) n.set(e, {}), r.push(e);
|
|
93
|
+
return {
|
|
94
|
+
columns: n,
|
|
95
|
+
orderedColumnIds: r
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function p(e, t) {
|
|
90
99
|
let n = e.filter((e) => e.pinned === "left"), r = e.filter((e) => e.pinned === void 0), i = e.filter((e) => e.pinned === "right"), a = [], o = [], s = [...n], c = [...i], l = Number.isFinite(t) ? Math.max(0, t) : 0, u = l < 48 ? 0 : l - 48, d = (e) => e.reduce((e, t) => e + t.columnWidths.reduce((e, t) => e + Math.max(0, t), 0), 0);
|
|
91
100
|
for (; d(s) + d(c) > u;) if (d(s) > d(c) && s.length > 0) a.unshift(s.pop());
|
|
92
101
|
else if (c.length > 0) o.push(c.shift());
|
|
@@ -137,13 +146,13 @@ function f(e, t) {
|
|
|
137
146
|
orderedColumnIds: f.flatMap((e) => [...e.columnIds])
|
|
138
147
|
};
|
|
139
148
|
}
|
|
140
|
-
function
|
|
149
|
+
function m(e, t, n, r, i = 48) {
|
|
141
150
|
let a = e.find((e) => e.id === n);
|
|
142
151
|
if (!a?.pinned || a.columnIds.length === 0 || a.columnIds.some((e) => t.columns.get(e)?.pinned !== a.pinned)) return;
|
|
143
152
|
let o = e.reduce((e, n) => n.id === a.id || !n.pinned || n.columnIds.some((e) => t.columns.get(e)?.pinned !== n.pinned) ? e : e + n.columnWidths.reduce((e, t) => e + (Number.isFinite(t) ? Math.max(0, t) : 0), 0), 0);
|
|
144
153
|
return Math.max(0, (Number.isFinite(r) ? Math.max(0, r) : 0) - (Number.isFinite(i) ? Math.max(0, i) : 48) - o);
|
|
145
154
|
}
|
|
146
|
-
function
|
|
155
|
+
function h(e, t, n) {
|
|
147
156
|
let r = Math.min(e.orderedColumnIds.length, Math.max(t, t + Math.max(1, Math.floor(n)))), i = [];
|
|
148
157
|
for (let n = Math.max(0, t); n < r; n += 1) {
|
|
149
158
|
let t = e.orderedColumnIds[n], r = t ? e.columns.get(t) ?? {} : {}, a = i.at(-1);
|
|
@@ -161,13 +170,13 @@ function m(e, t, n) {
|
|
|
161
170
|
}
|
|
162
171
|
return i;
|
|
163
172
|
}
|
|
164
|
-
function
|
|
173
|
+
function g(e) {
|
|
165
174
|
return e.map((e) => ({
|
|
166
175
|
...e,
|
|
167
176
|
id: e.id ?? e.field
|
|
168
177
|
}));
|
|
169
178
|
}
|
|
170
|
-
function
|
|
179
|
+
function _(e, t = []) {
|
|
171
180
|
let n = new Set(e.map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = [];
|
|
172
181
|
for (let e of t) {
|
|
173
182
|
if (i.has(e.id)) continue;
|
|
@@ -179,7 +188,7 @@ function g(e, t = []) {
|
|
|
179
188
|
}
|
|
180
189
|
return a;
|
|
181
190
|
}
|
|
182
|
-
function
|
|
191
|
+
function v(e, t) {
|
|
183
192
|
let n = {};
|
|
184
193
|
for (let r of e) n[r.id] = {
|
|
185
194
|
hidden: t?.columns?.[r.id]?.hidden ?? r.hidden,
|
|
@@ -188,7 +197,7 @@ function _(e, t) {
|
|
|
188
197
|
};
|
|
189
198
|
return n;
|
|
190
199
|
}
|
|
191
|
-
function
|
|
200
|
+
function y(e, t) {
|
|
192
201
|
let n = {};
|
|
193
202
|
for (let r of e) n[r.id] = {
|
|
194
203
|
hidden: t?.groups?.[r.id]?.hidden ?? r.hidden,
|
|
@@ -196,34 +205,52 @@ function v(e, t) {
|
|
|
196
205
|
};
|
|
197
206
|
return n;
|
|
198
207
|
}
|
|
199
|
-
function
|
|
208
|
+
function b(e) {
|
|
200
209
|
let t = /* @__PURE__ */ new Map();
|
|
201
210
|
for (let n of e) for (let e of n.children) t.set(e, n.id);
|
|
202
211
|
return t;
|
|
203
212
|
}
|
|
204
|
-
function
|
|
213
|
+
function x(e, t) {
|
|
205
214
|
return e.find((e) => e.id === t);
|
|
206
215
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
216
|
+
function S(e, t, n = []) {
|
|
217
|
+
if (t?.order?.length) return C(e, t, n);
|
|
218
|
+
let r = e.map((e) => e.id);
|
|
219
|
+
if (n.length === 0) return r;
|
|
220
|
+
let i = b(n), a = new Map(n.map((e) => [e.id, e])), o = /* @__PURE__ */ new Set(), s = [];
|
|
221
|
+
for (let e of r) {
|
|
222
|
+
let t = i.get(e), n = t ? a.get(t) : void 0;
|
|
223
|
+
if (!t || !n) {
|
|
224
|
+
s.push(e);
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (!o.has(t)) {
|
|
228
|
+
for (let e of r) n.children.includes(e) && s.push(e);
|
|
229
|
+
o.add(t);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return s;
|
|
233
|
+
}
|
|
234
|
+
function C(e, t, n = []) {
|
|
235
|
+
let r = e.map((e) => e.id), i = new Set(r), a = (t?.order ?? []).filter((e) => i.has(e)), o = r.filter((e) => !a.includes(e)), s = [...a, ...o], c = new Map(e.map((e) => [e.id, e])), l = b(n), u = new Map(n.map((e) => [e.id, e])), f = (e) => !l.has(e) && d(t === void 0 ? c.get(e)?.pinned : t.columns?.[e]?.pinned) !== void 0, p = (e) => d(t === void 0 ? u.get(e)?.pinned : t.groups?.[e]?.pinned) !== void 0, m = (e) => {
|
|
209
236
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
210
237
|
for (let r of e) {
|
|
211
|
-
let i =
|
|
238
|
+
let i = l.get(r);
|
|
212
239
|
if (!i) {
|
|
213
240
|
n.push({
|
|
214
241
|
columnIds: [r],
|
|
215
242
|
key: `column:${r}`,
|
|
216
|
-
locked:
|
|
243
|
+
locked: c.get(r)?.lockPosition === !0 || f(r)
|
|
217
244
|
});
|
|
218
245
|
continue;
|
|
219
246
|
}
|
|
220
247
|
if (t.has(i)) continue;
|
|
221
|
-
let a =
|
|
248
|
+
let a = u.get(i);
|
|
222
249
|
if (!a) {
|
|
223
250
|
n.push({
|
|
224
251
|
columnIds: [r],
|
|
225
252
|
key: `column:${r}`,
|
|
226
|
-
locked:
|
|
253
|
+
locked: c.get(r)?.lockPosition === !0 || f(r)
|
|
227
254
|
});
|
|
228
255
|
continue;
|
|
229
256
|
}
|
|
@@ -231,37 +258,37 @@ function x(e, t, n = []) {
|
|
|
231
258
|
n.push({
|
|
232
259
|
columnIds: o,
|
|
233
260
|
key: `group:${i}`,
|
|
234
|
-
locked: a.lockPosition ||
|
|
261
|
+
locked: a.lockPosition || p(i) || o.some((e) => c.get(e)?.lockPosition === !0)
|
|
235
262
|
}), t.add(i);
|
|
236
263
|
}
|
|
237
264
|
return n;
|
|
238
|
-
},
|
|
239
|
-
for (let e of
|
|
240
|
-
let
|
|
241
|
-
for (let e of
|
|
242
|
-
let t =
|
|
243
|
-
|
|
265
|
+
}, h = m(r), g = m(s), _ = new Map(h.map((e) => [e.key, e])), v = /* @__PURE__ */ new Map(), y = 0;
|
|
266
|
+
for (let e of h) v.set(e.key, y), e.locked && (y += 1);
|
|
267
|
+
let x = Array.from({ length: y + 1 }, () => []), S = new Map(g.map((e) => [e.key, e]));
|
|
268
|
+
for (let e of g) {
|
|
269
|
+
let t = _.get(e.key);
|
|
270
|
+
t && !t.locked && x[v.get(e.key) ?? 0]?.push(e);
|
|
244
271
|
}
|
|
245
|
-
let
|
|
246
|
-
for (let e of
|
|
247
|
-
return
|
|
248
|
-
let t =
|
|
272
|
+
let C = [], w = 0;
|
|
273
|
+
for (let e of h) e.locked && (C.push(...x[w] ?? []), C.push(S.get(e.key) ?? e), w += 1);
|
|
274
|
+
return C.push(...x[w] ?? []), C.flatMap((e) => {
|
|
275
|
+
let t = _.get(e.key);
|
|
249
276
|
if (!t || e.columnIds.length === 1) return e.columnIds;
|
|
250
|
-
let n = new Set(t.columnIds.filter((e) =>
|
|
277
|
+
let n = new Set(t.columnIds.filter((e) => c.get(e)?.lockPosition));
|
|
251
278
|
if (n.size === 0) return e.columnIds;
|
|
252
279
|
let r = /* @__PURE__ */ new Map(), i = 0;
|
|
253
280
|
for (let e of t.columnIds) r.set(e, i), n.has(e) && (i += 1);
|
|
254
281
|
let a = Array.from({ length: i + 1 }, () => []);
|
|
255
282
|
for (let t of e.columnIds) n.has(t) || a[r.get(t) ?? 0]?.push(t);
|
|
256
|
-
let o = [],
|
|
257
|
-
for (let e of t.columnIds) n.has(e) && (o.push(...a[
|
|
258
|
-
return o.push(...a[
|
|
283
|
+
let o = [], s = 0;
|
|
284
|
+
for (let e of t.columnIds) n.has(e) && (o.push(...a[s] ?? []), o.push(e), s += 1);
|
|
285
|
+
return o.push(...a[s] ?? []), o;
|
|
259
286
|
});
|
|
260
287
|
}
|
|
261
|
-
function
|
|
288
|
+
function w(e, t, n) {
|
|
262
289
|
return i(e, t, n);
|
|
263
290
|
}
|
|
264
|
-
function
|
|
291
|
+
function ee(e, t, n) {
|
|
265
292
|
return {
|
|
266
293
|
...e,
|
|
267
294
|
columnState: {
|
|
@@ -273,8 +300,8 @@ function C(e, t, n) {
|
|
|
273
300
|
}
|
|
274
301
|
};
|
|
275
302
|
}
|
|
276
|
-
function
|
|
277
|
-
return
|
|
303
|
+
function te(e, t, n) {
|
|
304
|
+
return x(e.columnGroups, t) ? {
|
|
278
305
|
...e,
|
|
279
306
|
columnGroupState: {
|
|
280
307
|
...e.columnGroupState,
|
|
@@ -285,26 +312,26 @@ function ee(e, t, n) {
|
|
|
285
312
|
}
|
|
286
313
|
} : e;
|
|
287
314
|
}
|
|
288
|
-
function
|
|
315
|
+
function ne(e, t) {
|
|
289
316
|
return e.columnState[t.id]?.width ?? t.width ?? 100;
|
|
290
317
|
}
|
|
291
|
-
function
|
|
318
|
+
function T(e) {
|
|
292
319
|
return Math.max(88, e.minWidth ?? 88);
|
|
293
320
|
}
|
|
294
|
-
function
|
|
321
|
+
function E(e) {
|
|
295
322
|
return e.maxWidth ?? Infinity;
|
|
296
323
|
}
|
|
297
|
-
function
|
|
324
|
+
function D(e, t, n) {
|
|
298
325
|
return Math.min(n, Math.max(t, e));
|
|
299
326
|
}
|
|
300
|
-
function
|
|
301
|
-
let r = t.map((t) =>
|
|
327
|
+
function O(e, t, n) {
|
|
328
|
+
let r = t.map((t) => D(ne(e, t), T(t), E(t))), i = new Set(t.map((e, t) => t)), a = t.map(T), o = t.map(E), s = D(n, a.reduce((e, t) => e + t, 0), o.reduce((e, t) => e + t, 0));
|
|
302
329
|
for (; i.size > 0;) {
|
|
303
330
|
let e = s - r.reduce((e, t) => e + t, 0);
|
|
304
331
|
if (Math.abs(e) < .001) break;
|
|
305
332
|
let t = [...i], n = t.reduce((e, t) => e + Math.max(r[t] ?? 0, 0), 0), c = !1;
|
|
306
333
|
for (let s of t) {
|
|
307
|
-
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d =
|
|
334
|
+
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d = D(u, a[s] ?? 0, o[s] ?? Infinity);
|
|
308
335
|
r[s] = d, Math.abs(d - u) > .001 && (i.delete(s), c = !0);
|
|
309
336
|
}
|
|
310
337
|
if (!c) break;
|
|
@@ -312,11 +339,11 @@ function ne(e, t, n) {
|
|
|
312
339
|
return r;
|
|
313
340
|
}
|
|
314
341
|
function re(e, t, r) {
|
|
315
|
-
let i =
|
|
342
|
+
let i = x(e.columnGroups, t);
|
|
316
343
|
if (!i || e.columnGroupState[i.id]?.hidden === !0) return e;
|
|
317
344
|
let a = i.children.map((t) => n(e, t)).filter((e) => !!e).filter((t) => e.columnState[t.id]?.hidden !== !0);
|
|
318
345
|
if (a.length === 0) return e;
|
|
319
|
-
let o =
|
|
346
|
+
let o = O(e, a, r), s = { ...e.columnState };
|
|
320
347
|
return a.forEach((e, t) => {
|
|
321
348
|
s[e.id] = {
|
|
322
349
|
...s[e.id],
|
|
@@ -327,8 +354,8 @@ function re(e, t, r) {
|
|
|
327
354
|
columnState: s
|
|
328
355
|
};
|
|
329
356
|
}
|
|
330
|
-
function
|
|
331
|
-
let n = new Map(e.columnOrder.map((e, t) => [e, t])), r = new Map(t.map((e, t) => [e, t])), i =
|
|
357
|
+
function k(e, t) {
|
|
358
|
+
let n = new Map(e.columnOrder.map((e, t) => [e, t])), r = new Map(t.map((e, t) => [e, t])), i = b(e.columnGroups);
|
|
332
359
|
for (let t of e.columns) if ((t.lockPosition || !i.has(t.id) && e.columnState[t.id]?.pinned !== void 0) && n.get(t.id) !== r.get(t.id)) return !0;
|
|
333
360
|
for (let t of e.columnGroups) {
|
|
334
361
|
if (!t.lockPosition && e.columnGroupState[t.id]?.pinned === void 0) continue;
|
|
@@ -338,14 +365,14 @@ function D(e, t) {
|
|
|
338
365
|
return !1;
|
|
339
366
|
}
|
|
340
367
|
function ie(e, t, r) {
|
|
341
|
-
let i = n(e, t), a =
|
|
368
|
+
let i = n(e, t), a = b(e.columnGroups).get(t);
|
|
342
369
|
if (!i || i.lockPosition || !a && e.columnState[t]?.pinned !== void 0) return e;
|
|
343
|
-
|
|
370
|
+
b(e.columnGroups);
|
|
344
371
|
let o = e.columnOrder.filter((e) => e !== t);
|
|
345
372
|
if (o.length === e.columnOrder.length) return e;
|
|
346
373
|
let s = Math.max(0, Math.min(r, o.length));
|
|
347
374
|
if (a) {
|
|
348
|
-
let t =
|
|
375
|
+
let t = x(e.columnGroups, a);
|
|
349
376
|
if (!t) return e;
|
|
350
377
|
let n = o.filter((e) => t.children.includes(e)), r = o.findIndex((e) => t.children.includes(e)), i = r + n.length;
|
|
351
378
|
if (s < r || s > i) return e;
|
|
@@ -355,13 +382,13 @@ function ie(e, t, r) {
|
|
|
355
382
|
let r = o.findIndex((e) => t.children.includes(e)), i = r + n.length;
|
|
356
383
|
if (s > r && s < i) return e;
|
|
357
384
|
}
|
|
358
|
-
return o.splice(s, 0, t),
|
|
385
|
+
return o.splice(s, 0, t), k(e, o) || o.every((t, n) => t === e.columnOrder[n]) ? e : {
|
|
359
386
|
...e,
|
|
360
387
|
columnOrder: o
|
|
361
388
|
};
|
|
362
389
|
}
|
|
363
|
-
function
|
|
364
|
-
let r =
|
|
390
|
+
function ae(e, t, n) {
|
|
391
|
+
let r = x(e.columnGroups, t);
|
|
365
392
|
if (!r || r.lockPosition || e.columnGroupState[t]?.pinned !== void 0) return e;
|
|
366
393
|
let i = e.columnOrder.filter((e) => r.children.includes(e));
|
|
367
394
|
if (i.length === 0) return e;
|
|
@@ -370,12 +397,12 @@ function O(e, t, n) {
|
|
|
370
397
|
...i,
|
|
371
398
|
...a.slice(o)
|
|
372
399
|
];
|
|
373
|
-
return
|
|
400
|
+
return k(e, s) || s.every((t, n) => t === e.columnOrder[n]) ? e : {
|
|
374
401
|
...e,
|
|
375
402
|
columnOrder: s
|
|
376
403
|
};
|
|
377
404
|
}
|
|
378
|
-
function
|
|
405
|
+
function oe(e) {
|
|
379
406
|
let t = e.columnGroups.length === 0 ? void 0 : Object.fromEntries(e.columnGroups.map((t) => [t.id, { ...e.columnGroupState[t.id] }]));
|
|
380
407
|
return {
|
|
381
408
|
columns: { ...e.columnState },
|
|
@@ -383,16 +410,16 @@ function k(e) {
|
|
|
383
410
|
order: [...e.columnOrder]
|
|
384
411
|
};
|
|
385
412
|
}
|
|
386
|
-
function
|
|
413
|
+
function se(e, t) {
|
|
387
414
|
return {
|
|
388
415
|
...e,
|
|
389
|
-
columnOrder:
|
|
390
|
-
columnGroupState:
|
|
391
|
-
columnState:
|
|
416
|
+
columnOrder: S(e.columns, t, e.columnGroups),
|
|
417
|
+
columnGroupState: y(e.columnGroups, t),
|
|
418
|
+
columnState: v(e.columns, t)
|
|
392
419
|
};
|
|
393
420
|
}
|
|
394
421
|
function A(e) {
|
|
395
|
-
let t =
|
|
422
|
+
let t = b(e.columnGroups), r = new Map(e.columnGroups.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [];
|
|
396
423
|
for (let o of e.columnOrder) {
|
|
397
424
|
let s = n(e, o);
|
|
398
425
|
if (!s || e.columnState[s.id]?.hidden === !0) continue;
|
|
@@ -419,7 +446,7 @@ function A(e) {
|
|
|
419
446
|
"right"
|
|
420
447
|
].flatMap((e) => a.filter((t) => t.pinned === e).flatMap((e) => e.columns));
|
|
421
448
|
}
|
|
422
|
-
function
|
|
449
|
+
function ce(e) {
|
|
423
450
|
let t = A(e);
|
|
424
451
|
if (e.columnGroups.length === 0) return [t.map((e) => ({
|
|
425
452
|
colSpan: 1,
|
|
@@ -428,8 +455,7 @@ function oe(e) {
|
|
|
428
455
|
kind: "column",
|
|
429
456
|
rowSpan: 1
|
|
430
457
|
}))];
|
|
431
|
-
new
|
|
432
|
-
let n = y(e.columnGroups), r = new Map(e.columnGroups.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [], o = [];
|
|
458
|
+
let n = b(e.columnGroups), r = new Map(e.columnGroups.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [], o = [];
|
|
433
459
|
for (let e of t) {
|
|
434
460
|
let s = e.id, c = n.get(s);
|
|
435
461
|
if (!c) {
|
|
@@ -488,7 +514,7 @@ function M(e, t, n = e.rowIds) {
|
|
|
488
514
|
visibleColumns: r
|
|
489
515
|
};
|
|
490
516
|
}
|
|
491
|
-
function
|
|
517
|
+
function le(e, t, n = {}) {
|
|
492
518
|
let r = e.selection.rowIds, i = r.includes(t), a = n.multi ? n.toggle && i ? r.filter((e) => e !== t) : i ? r : [...r, t] : n.toggle && i ? [] : [t];
|
|
493
519
|
return {
|
|
494
520
|
...e,
|
|
@@ -498,7 +524,7 @@ function se(e, t, n = {}) {
|
|
|
498
524
|
}
|
|
499
525
|
};
|
|
500
526
|
}
|
|
501
|
-
function
|
|
527
|
+
function N(e, t) {
|
|
502
528
|
return {
|
|
503
529
|
...e,
|
|
504
530
|
selection: {
|
|
@@ -507,11 +533,11 @@ function ce(e, t) {
|
|
|
507
533
|
}
|
|
508
534
|
};
|
|
509
535
|
}
|
|
510
|
-
function
|
|
536
|
+
function P(e, t) {
|
|
511
537
|
return e.rowId === t.rowId && e.columnId === t.columnId;
|
|
512
538
|
}
|
|
513
|
-
function
|
|
514
|
-
let r = e.selection.cells ?? (e.selection.cell ? [e.selection.cell] : []), i = r.some((e) =>
|
|
539
|
+
function ue(e, t, n = {}) {
|
|
540
|
+
let r = e.selection.cells ?? (e.selection.cell ? [e.selection.cell] : []), i = r.some((e) => P(e, t)), a = n.multi ? n.toggle && i ? r.filter((e) => !P(e, t)) : i ? r : [...r, t] : n.toggle && i ? [] : [t], o = a.some((e) => P(e, t)) ? t : a.at(-1) ?? null;
|
|
515
541
|
return {
|
|
516
542
|
...e,
|
|
517
543
|
selection: {
|
|
@@ -522,7 +548,7 @@ function le(e, t, n = {}) {
|
|
|
522
548
|
}
|
|
523
549
|
};
|
|
524
550
|
}
|
|
525
|
-
function
|
|
551
|
+
function de(e, t) {
|
|
526
552
|
return {
|
|
527
553
|
...e,
|
|
528
554
|
selection: {
|
|
@@ -533,7 +559,7 @@ function ue(e, t) {
|
|
|
533
559
|
}
|
|
534
560
|
};
|
|
535
561
|
}
|
|
536
|
-
function
|
|
562
|
+
function fe(e) {
|
|
537
563
|
return {
|
|
538
564
|
...e,
|
|
539
565
|
selection: {
|
|
@@ -542,20 +568,20 @@ function de(e) {
|
|
|
542
568
|
}
|
|
543
569
|
};
|
|
544
570
|
}
|
|
545
|
-
function
|
|
571
|
+
function pe(e) {
|
|
546
572
|
return {
|
|
547
573
|
...e,
|
|
548
574
|
selection: j()
|
|
549
575
|
};
|
|
550
576
|
}
|
|
551
|
-
function
|
|
577
|
+
function me(e, t) {
|
|
552
578
|
return e.selection.rowIds.includes(t);
|
|
553
579
|
}
|
|
554
|
-
function
|
|
580
|
+
function he(e, t) {
|
|
555
581
|
let n = e.selection.cells;
|
|
556
|
-
return n && n.length > 0 ? n.some((e) =>
|
|
582
|
+
return n && n.length > 0 ? n.some((e) => P(e, t)) : e.selection.cell !== null && P(e.selection.cell, t);
|
|
557
583
|
}
|
|
558
|
-
function
|
|
584
|
+
function F(e, t = e.selection.range, n = e.rowIds) {
|
|
559
585
|
if (!t) return [];
|
|
560
586
|
let r = A(e), i = M(e, t, n);
|
|
561
587
|
if (!i) return [];
|
|
@@ -572,22 +598,22 @@ function P(e, t = e.selection.range, n = e.rowIds) {
|
|
|
572
598
|
}
|
|
573
599
|
return a;
|
|
574
600
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
601
|
+
function I(e, t, n = e.rowIds) {
|
|
602
|
+
return F(e, e.selection.range, n).some((e) => e.rowId === t.rowId && e.columnId === t.columnId);
|
|
577
603
|
}
|
|
578
604
|
//#endregion
|
|
579
605
|
//#region src/core/state/table.ts
|
|
580
|
-
function
|
|
606
|
+
function L(e, t) {
|
|
581
607
|
return t;
|
|
582
608
|
}
|
|
583
|
-
function
|
|
609
|
+
function R(e) {
|
|
584
610
|
return e;
|
|
585
611
|
}
|
|
586
|
-
function
|
|
612
|
+
function ge(e, t) {
|
|
587
613
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
588
614
|
}
|
|
589
615
|
function z(e, t, n = {}) {
|
|
590
|
-
let r = t.map(e.getRowId), i = n.resetSelection === !0 || !
|
|
616
|
+
let r = t.map(e.getRowId), i = n.resetSelection === !0 || !ge(e.rowIds, r);
|
|
591
617
|
return {
|
|
592
618
|
...e,
|
|
593
619
|
rowIds: r,
|
|
@@ -595,7 +621,7 @@ function z(e, t, n = {}) {
|
|
|
595
621
|
selection: i ? j() : e.selection
|
|
596
622
|
};
|
|
597
623
|
}
|
|
598
|
-
function
|
|
624
|
+
function _e(e, t) {
|
|
599
625
|
return e.length === t.length && e.every((e, n) => e.columnId === t[n]?.columnId && e.direction === t[n]?.direction);
|
|
600
626
|
}
|
|
601
627
|
function B(e, t) {
|
|
@@ -606,17 +632,17 @@ function B(e, t) {
|
|
|
606
632
|
}));
|
|
607
633
|
return i;
|
|
608
634
|
}
|
|
609
|
-
function
|
|
635
|
+
function ve(e, t) {
|
|
610
636
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
|
|
611
637
|
}
|
|
612
|
-
function
|
|
613
|
-
let l =
|
|
638
|
+
function ye({ columnLayout: e, columnGroups: t, columns: n, getRowId: r = L, pagination: i, rows: a, showHeader: o = !0, sort: s = null, sortModel: c }) {
|
|
639
|
+
let l = R(a), u = g(n), d = _(u, t), f = B(u, c ?? (s ? [s] : []));
|
|
614
640
|
return {
|
|
615
|
-
columnOrder:
|
|
641
|
+
columnOrder: S(u, e, d),
|
|
616
642
|
columnGroups: d,
|
|
617
|
-
columnGroupState:
|
|
643
|
+
columnGroupState: y(d, e),
|
|
618
644
|
columns: u,
|
|
619
|
-
columnState:
|
|
645
|
+
columnState: v(u, e),
|
|
620
646
|
getRowId: r,
|
|
621
647
|
pagination: {
|
|
622
648
|
pageIndex: i?.pageIndex ?? 0,
|
|
@@ -630,11 +656,11 @@ function _e({ columnLayout: e, columnGroups: t, columns: n, getRowId: r = I, pag
|
|
|
630
656
|
sortModel: f
|
|
631
657
|
};
|
|
632
658
|
}
|
|
633
|
-
function
|
|
659
|
+
function be(e, t) {
|
|
634
660
|
return t ? e.rows.filter(t) : [...e.rows];
|
|
635
661
|
}
|
|
636
|
-
function
|
|
637
|
-
return z(e,
|
|
662
|
+
function xe(e, t) {
|
|
663
|
+
return z(e, R(t), { resetSelection: !0 });
|
|
638
664
|
}
|
|
639
665
|
function V(e, t) {
|
|
640
666
|
return z(e, [...e.rows, ...t]);
|
|
@@ -649,20 +675,20 @@ function H(e, t) {
|
|
|
649
675
|
} : t;
|
|
650
676
|
}));
|
|
651
677
|
}
|
|
652
|
-
function
|
|
678
|
+
function U(e, t) {
|
|
653
679
|
let n = new Set(t);
|
|
654
680
|
return z(e, e.rows.filter((t, r) => {
|
|
655
681
|
let i = e.rowIds[r];
|
|
656
682
|
return i === void 0 || !n.has(i);
|
|
657
683
|
}));
|
|
658
684
|
}
|
|
659
|
-
function
|
|
685
|
+
function Se(e, t) {
|
|
660
686
|
return {
|
|
661
687
|
...e,
|
|
662
688
|
showHeader: t
|
|
663
689
|
};
|
|
664
690
|
}
|
|
665
|
-
function
|
|
691
|
+
function Ce(e, t) {
|
|
666
692
|
return {
|
|
667
693
|
...e,
|
|
668
694
|
pagination: {
|
|
@@ -671,43 +697,43 @@ function Se(e, t) {
|
|
|
671
697
|
}
|
|
672
698
|
};
|
|
673
699
|
}
|
|
674
|
-
function U(e, t) {
|
|
675
|
-
return W(e, t ? [t] : []);
|
|
676
|
-
}
|
|
677
700
|
function W(e, t) {
|
|
701
|
+
return G(e, t ? [t] : []);
|
|
702
|
+
}
|
|
703
|
+
function G(e, t) {
|
|
678
704
|
let n = B(e.columns, t), r = n[0] ?? null;
|
|
679
|
-
return
|
|
705
|
+
return _e(e.sortModel, n) ? e : {
|
|
680
706
|
...e,
|
|
681
707
|
sort: r,
|
|
682
708
|
sortModel: n
|
|
683
709
|
};
|
|
684
710
|
}
|
|
685
|
-
function
|
|
686
|
-
return
|
|
711
|
+
function we(e) {
|
|
712
|
+
return G(e, []);
|
|
687
713
|
}
|
|
688
|
-
function
|
|
714
|
+
function K(e, t = e.rows.map((e, t) => t)) {
|
|
689
715
|
let r = [...t];
|
|
690
716
|
return e.sortModel.length === 0 ? r : [...r].sort((t, r) => {
|
|
691
717
|
let i = e.rows[t], a = e.rows[r];
|
|
692
718
|
for (let t of e.sortModel) {
|
|
693
719
|
let r = n(e, t.columnId);
|
|
694
720
|
if (!r?.sort) continue;
|
|
695
|
-
let o =
|
|
721
|
+
let o = q(e, i, r.id), s = q(e, a, r.id), c = typeof r.sort == "function" ? r.sort(o, s, i, a) : ve(o, s);
|
|
696
722
|
if (c !== 0) return t.direction === "desc" ? c * -1 : c;
|
|
697
723
|
}
|
|
698
724
|
return t - r;
|
|
699
725
|
});
|
|
700
726
|
}
|
|
701
|
-
function
|
|
702
|
-
let n =
|
|
703
|
-
return z(n,
|
|
727
|
+
function Te(e, t) {
|
|
728
|
+
let n = W(e, t);
|
|
729
|
+
return z(n, K(n).map((e) => n.rows[e]));
|
|
704
730
|
}
|
|
705
|
-
function
|
|
731
|
+
function Ee(e, t = {}) {
|
|
706
732
|
let n = t.pageIndex ?? e.pagination.pageIndex, r = t.pageSize ?? e.pagination.pageSize, i = Math.max(0, n) * Math.max(1, r);
|
|
707
|
-
return
|
|
733
|
+
return K(e).slice(i, i + Math.max(1, r)).map((t) => e.rows[t]);
|
|
708
734
|
}
|
|
709
|
-
function
|
|
710
|
-
let a = Math.max(1, n), o =
|
|
735
|
+
function De(e, { overscan: t = 2, rowHeight: n, scrollTop: r, viewportHeight: i }) {
|
|
736
|
+
let a = Math.max(1, n), o = K(e), s = o.length, c = s * a, l = Math.max(0, Math.floor(Math.max(0, r) / a) - Math.max(0, t)), u = Math.min(s, Math.ceil((Math.max(0, r) + Math.max(0, i)) / a) + Math.max(0, t)), d = l * a;
|
|
711
737
|
return {
|
|
712
738
|
bottomSpacerHeight: Math.max(0, c - d - (u - l) * a),
|
|
713
739
|
endIndex: u,
|
|
@@ -717,13 +743,13 @@ function Ee(e, { overscan: t = 2, rowHeight: n, scrollTop: r, viewportHeight: i
|
|
|
717
743
|
totalHeight: c
|
|
718
744
|
};
|
|
719
745
|
}
|
|
720
|
-
function
|
|
746
|
+
function Oe(e, n, r) {
|
|
721
747
|
let i = t(e, n);
|
|
722
748
|
if (i < 0) return e;
|
|
723
749
|
let a = [...e.rows], [o] = a.splice(i, 1);
|
|
724
750
|
return o === void 0 ? e : (a.splice(Math.max(0, Math.min(r, a.length)), 0, o), z(e, a));
|
|
725
751
|
}
|
|
726
|
-
function
|
|
752
|
+
function ke(e, n) {
|
|
727
753
|
let r = t(e, n.sourceRowId), i = n.targetRowId === void 0 ? -1 : t(e, n.targetRowId);
|
|
728
754
|
if (r < 0 || n.targetRowId === n.sourceRowId || n.targetRowId !== void 0 && i < 0) return e;
|
|
729
755
|
let a = e.rows[r];
|
|
@@ -751,13 +777,13 @@ function Oe(e, n) {
|
|
|
751
777
|
}
|
|
752
778
|
return l.splice(u, 0, c), z(e, l);
|
|
753
779
|
}
|
|
754
|
-
function
|
|
780
|
+
function q(e, t, i) {
|
|
755
781
|
let a = n(e, i);
|
|
756
782
|
return a ? r(t, a.field) : void 0;
|
|
757
783
|
}
|
|
758
784
|
//#endregion
|
|
759
785
|
//#region src/core/editing/cells.ts
|
|
760
|
-
function
|
|
786
|
+
function J(e, t, n) {
|
|
761
787
|
if (!e || typeof e != "object") return e;
|
|
762
788
|
let r = t.split("."), [i] = r;
|
|
763
789
|
if (!i) return e;
|
|
@@ -771,7 +797,7 @@ function q(e, t, n) {
|
|
|
771
797
|
o[e] = a, n && (o = a);
|
|
772
798
|
}), o[r.at(-1)] = n, a;
|
|
773
799
|
}
|
|
774
|
-
function
|
|
800
|
+
function Y(e, t, n, r, i = e.rowIds.indexOf(n)) {
|
|
775
801
|
return {
|
|
776
802
|
column: {
|
|
777
803
|
definition: r,
|
|
@@ -789,52 +815,52 @@ function J(e, t, n, r, i = e.rowIds.indexOf(n)) {
|
|
|
789
815
|
selected: e.selection.rowIds.includes(n)
|
|
790
816
|
},
|
|
791
817
|
selection: { selectedRowCount: e.selection.rowIds.length },
|
|
792
|
-
value:
|
|
818
|
+
value: q(e, t, r.id)
|
|
793
819
|
};
|
|
794
820
|
}
|
|
795
|
-
function
|
|
821
|
+
function X(e, t) {
|
|
796
822
|
return e === void 0 ? !0 : typeof e == "boolean" ? e : e(t);
|
|
797
823
|
}
|
|
798
|
-
function
|
|
824
|
+
function Z(e, t, n, r, i, a = e.rowIds.indexOf(n)) {
|
|
799
825
|
if (t === void 0) return !1;
|
|
800
|
-
let o =
|
|
801
|
-
return s?.disabled !== void 0 &&
|
|
826
|
+
let o = Y(e, t, n, r, a), s = r.cell;
|
|
827
|
+
return s?.disabled !== void 0 && X(s.disabled, o) === !0 ? !1 : X(i === "copy" ? s?.copyable : s?.pasteable, o);
|
|
802
828
|
}
|
|
803
|
-
function
|
|
829
|
+
function Ae(e, t, n, r) {
|
|
804
830
|
let i = r.cell?.disabled;
|
|
805
|
-
return i !== void 0 &&
|
|
831
|
+
return i !== void 0 && X(i, Y(e, t, n, r)) === !0;
|
|
806
832
|
}
|
|
807
|
-
function
|
|
833
|
+
function je(e, { columnId: r, rowId: i }) {
|
|
808
834
|
let a = e.rows[t(e, i)], o = n(e, r);
|
|
809
|
-
if (!o || !
|
|
810
|
-
let s =
|
|
835
|
+
if (!o || !Z(e, a, i, o, "copy")) return null;
|
|
836
|
+
let s = q(e, a, r);
|
|
811
837
|
return {
|
|
812
838
|
kind: "cell",
|
|
813
839
|
text: s == null ? "" : String(s),
|
|
814
840
|
value: s
|
|
815
841
|
};
|
|
816
842
|
}
|
|
817
|
-
function
|
|
843
|
+
function Me(e, { columnId: r, rowId: i }, a) {
|
|
818
844
|
let o = n(e, r), s = e.rows[t(e, i)];
|
|
819
|
-
return !a || !o || !
|
|
845
|
+
return !a || !o || !Z(e, s, i, o, "paste") ? e : H(e, [{
|
|
820
846
|
id: i,
|
|
821
|
-
patch: (e) =>
|
|
847
|
+
patch: (e) => J(e, o.field, a.value)
|
|
822
848
|
}]);
|
|
823
849
|
}
|
|
824
850
|
//#endregion
|
|
825
851
|
//#region src/core/editing/clipboard.ts
|
|
826
|
-
function
|
|
852
|
+
function Q(e, t) {
|
|
827
853
|
return e && typeof e == "object" && "id" in e ? {
|
|
828
854
|
...e,
|
|
829
855
|
id: t
|
|
830
856
|
} : e;
|
|
831
857
|
}
|
|
832
|
-
function
|
|
858
|
+
function Ne(e, t) {
|
|
833
859
|
let n = 1, r = `${String(t)}-copy-${n}`, i = new Set(e.map(String));
|
|
834
860
|
for (; i.has(r);) n += 1, r = `${String(t)}-copy-${n}`;
|
|
835
861
|
return r;
|
|
836
862
|
}
|
|
837
|
-
function
|
|
863
|
+
function Pe(e, n) {
|
|
838
864
|
let r = e.rows[t(e, n)];
|
|
839
865
|
if (r === void 0) throw Error(`Cannot copy missing row: ${String(n)}`);
|
|
840
866
|
return {
|
|
@@ -843,23 +869,23 @@ function Me(e, n) {
|
|
|
843
869
|
text: JSON.stringify(r)
|
|
844
870
|
};
|
|
845
871
|
}
|
|
846
|
-
function
|
|
872
|
+
function Fe(e, n, r) {
|
|
847
873
|
if (r.mode === "append") {
|
|
848
874
|
let t = r.getNewRowId?.(n.row);
|
|
849
|
-
return V(e, [t === void 0 ? n.row :
|
|
875
|
+
return V(e, [t === void 0 ? n.row : Q(n.row, t)]);
|
|
850
876
|
}
|
|
851
877
|
if (r.mode === "insert-after") {
|
|
852
878
|
let i = t(e, r.targetRowId);
|
|
853
879
|
if (i < 0) return e;
|
|
854
|
-
let a = e.getRowId(n.row, i), o = r.getPastedRowId?.(n.row) ??
|
|
880
|
+
let a = e.getRowId(n.row, i), o = r.getPastedRowId?.(n.row) ?? Ne(e.rowIds, a), s = Q(n.row, o), c = [...e.rows];
|
|
855
881
|
return c.splice(i + 1, 0, s), z(e, c);
|
|
856
882
|
}
|
|
857
883
|
return H(e, [{
|
|
858
884
|
id: r.targetRowId,
|
|
859
|
-
patch:
|
|
885
|
+
patch: Q(n.row, r.targetRowId)
|
|
860
886
|
}]);
|
|
861
887
|
}
|
|
862
|
-
function
|
|
888
|
+
function Ie(e, n = e.selection.range, r = e.rowIds) {
|
|
863
889
|
if (!n) return null;
|
|
864
890
|
let i = M(e, n, r);
|
|
865
891
|
if (!i) return null;
|
|
@@ -868,11 +894,11 @@ function Pe(e, n = e.selection.range, r = e.rowIds) {
|
|
|
868
894
|
let r = i.rowIds[n], o = r === void 0 ? -1 : t(e, r), s = e.rows[o], c = [];
|
|
869
895
|
for (let t = i.columnStart; t <= i.columnEnd; t += 1) {
|
|
870
896
|
let n = i.visibleColumns[t];
|
|
871
|
-
if (s === void 0 || r === void 0 || !n || !
|
|
897
|
+
if (s === void 0 || r === void 0 || !n || !Z(e, s, r, n, "copy")) {
|
|
872
898
|
c.push(null);
|
|
873
899
|
continue;
|
|
874
900
|
}
|
|
875
|
-
let a =
|
|
901
|
+
let a = q(e, s, n.id);
|
|
876
902
|
c.push({
|
|
877
903
|
columnId: n.id,
|
|
878
904
|
text: a == null ? "" : String(a),
|
|
@@ -887,7 +913,7 @@ function Pe(e, n = e.selection.range, r = e.rowIds) {
|
|
|
887
913
|
text: a.map((e) => e.map((e) => e?.text ?? "").join(" ")).join("\n")
|
|
888
914
|
};
|
|
889
915
|
}
|
|
890
|
-
function
|
|
916
|
+
function Le(e, n, r, i = e.rowIds) {
|
|
891
917
|
if (!r) return e;
|
|
892
918
|
let a = A(e), o = i.indexOf(n.rowId), s = a.findIndex((e) => e.id === n.columnId), c = [...e.rows];
|
|
893
919
|
if (o < 0 || s < 0) return e;
|
|
@@ -896,16 +922,16 @@ function Fe(e, n, r, i = e.rowIds) {
|
|
|
896
922
|
let u = i[o + r], d = u === void 0 ? -1 : t(e, u), f = c[d];
|
|
897
923
|
f !== void 0 && u !== void 0 && n.forEach((t, n) => {
|
|
898
924
|
let r = a[s + n];
|
|
899
|
-
|
|
925
|
+
t && r && Z(e, f, u, r, "paste") && (c[d] = J(c[d], r.field, t.value), l = !0);
|
|
900
926
|
});
|
|
901
927
|
}), l ? z(e, c) : e;
|
|
902
928
|
}
|
|
903
|
-
function
|
|
929
|
+
function Re(t, n, r, i = t.rowIds) {
|
|
904
930
|
let a = e(r), o = A(t), s = i.indexOf(n.rowId), c = o.findIndex((e) => e.id === n.columnId);
|
|
905
931
|
return s < 0 || c < 0 ? t : $(t, i, s, c, a.length, a.reduce((e, t) => Math.max(e, t.length), 0), (e, n, r, i, o, s) => {
|
|
906
932
|
let c = a[e]?.[n];
|
|
907
933
|
if (c === void 0) return null;
|
|
908
|
-
let l =
|
|
934
|
+
let l = Y(t, i, o, r, s);
|
|
909
935
|
return { value: r.cell?.parseClipboard ? r.cell.parseClipboard({
|
|
910
936
|
...l,
|
|
911
937
|
text: c
|
|
@@ -919,14 +945,14 @@ function $(e, t, n, i, a, o, s) {
|
|
|
919
945
|
let a = t[n + f], p = l.get(a), m = p === void 0 ? void 0 : e.rows[p];
|
|
920
946
|
if (p !== void 0 && m !== void 0) for (let t = 0; t < o && i + t < c.length; t++) {
|
|
921
947
|
let n = c[i + t];
|
|
922
|
-
if (!
|
|
948
|
+
if (!Z(e, m, a, n, "paste", p)) continue;
|
|
923
949
|
let o = s(f, t, n, m, a, p);
|
|
924
|
-
|
|
950
|
+
o && !Object.is(r(u[p], n.field), o.value) && (u[p] = J(u[p], n.field, o.value), d = !0);
|
|
925
951
|
}
|
|
926
952
|
}
|
|
927
953
|
return d ? z(e, u) : e;
|
|
928
954
|
}
|
|
929
|
-
function
|
|
955
|
+
function ze(e, { source: t, target: n }, i = e.rowIds) {
|
|
930
956
|
let a = M(e, "anchor" in t ? t : {
|
|
931
957
|
anchor: t,
|
|
932
958
|
focus: t
|
|
@@ -938,13 +964,13 @@ function Le(e, { source: t, target: n }, i = e.rowIds) {
|
|
|
938
964
|
let o = i[a.rowStart + n], s = l.get(o), u = s === void 0 ? void 0 : e.rows[s];
|
|
939
965
|
return Array.from({ length: c }, (t, n) => {
|
|
940
966
|
let i = a.visibleColumns[a.columnStart + n];
|
|
941
|
-
return u === void 0 || !
|
|
967
|
+
return u === void 0 || !Z(e, u, o, i, "copy", s) ? null : { value: r(u, i.field) };
|
|
942
968
|
});
|
|
943
969
|
}), d = (e, t) => (e % t + t) % t;
|
|
944
970
|
return $(e, i, o.rowStart, o.columnStart, o.rowEnd - o.rowStart + 1, o.columnEnd - o.columnStart + 1, (t, n, i, l, f, p) => {
|
|
945
971
|
let m = u[d(o.rowStart + t - a.rowStart, s)][d(o.columnStart + n - a.columnStart, c)];
|
|
946
972
|
if (m && !Object.is(r(l, i.field), m.value) && i.cell?.validateFill) {
|
|
947
|
-
let t =
|
|
973
|
+
let t = Y(e, l, f, i, p);
|
|
948
974
|
if (i.cell.validateFill({
|
|
949
975
|
...t,
|
|
950
976
|
value: m.value
|
|
@@ -954,6 +980,6 @@ function Le(e, { source: t, target: n }, i = e.rowIds) {
|
|
|
954
980
|
});
|
|
955
981
|
}
|
|
956
982
|
//#endregion
|
|
957
|
-
export { f as $,
|
|
983
|
+
export { f as $, pe as A, ce as B, Se as C, Te as D, W as E, ue as F, g as G, ie as H, de as I, re as J, oe as K, le as L, I as M, he as N, H as O, me as P, m as Q, N as R, xe as S, G as T, ae as U, A as V, _ as W, w as X, ee as Y, h as Z, K as _, Fe as a, ke as b, Ae as c, V as d, c as et, we as f, Ee as g, q as h, Le as i, e as it, F as j, fe as k, Me as l, U as m, Pe as n, a as nt, Re as o, ye as p, te as q, ze as r, u as rt, je as s, Ie as t, o as tt, J as u, De as v, Ce as w, be as x, Oe as y, se as z };
|
|
958
984
|
|
|
959
|
-
//# sourceMappingURL=clipboard-
|
|
985
|
+
//# sourceMappingURL=clipboard-DZmm2iRM.js.map
|