comins-table 0.1.8 → 0.1.9
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 +9 -0
- package/DESIGN.md +132 -0
- package/README.md +47 -11
- package/dist/clipboard.js +1 -1
- package/dist/{core-BF1H3EEK.js → core-D01wEe-7.js} +78 -70
- package/dist/core-D01wEe-7.js.map +1 -0
- package/dist/core.d.ts +12 -2
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1715 -1617
- package/dist/index.js.map +1 -1
- package/dist/selection.d.ts +1 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +1 -1
- package/package.json +4 -2
- package/styles.css +4 -0
- package/dist/core-BF1H3EEK.js.map +0 -1
|
@@ -183,6 +183,7 @@ function f(t, n, r = []) {
|
|
|
183
183
|
function p() {
|
|
184
184
|
return {
|
|
185
185
|
cell: null,
|
|
186
|
+
cells: [],
|
|
186
187
|
range: null,
|
|
187
188
|
rowIds: []
|
|
188
189
|
};
|
|
@@ -291,10 +292,10 @@ function D(e, t, n, r, i) {
|
|
|
291
292
|
let a = S(e, t, n, r), o = w(e, t, n, r);
|
|
292
293
|
return o?.disabled !== void 0 && C(o.disabled, a) === !0 ? !1 : C(i === "copy" ? o?.copyable : o?.pasteable, a);
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
+
function te(e, t) {
|
|
295
296
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
+
function O({ columnLayout: e, columnGroups: t, columns: n, getRowId: r = i, pagination: u, rows: d, showHeader: m = !0, sort: h = null, sortModel: g, theme: _ = {} }) {
|
|
298
299
|
let v = a(d), b = o(n), x = s(b, t), S = y(b, g ?? (h ? [h] : []));
|
|
299
300
|
return {
|
|
300
301
|
columnOrder: f(b, e, x),
|
|
@@ -316,16 +317,16 @@ function k({ columnLayout: e, columnGroups: t, columns: n, getRowId: r = i, pagi
|
|
|
316
317
|
theme: _
|
|
317
318
|
};
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function ne(e, t) {
|
|
320
321
|
return t ? e.rows.filter(t) : [...e.rows];
|
|
321
322
|
}
|
|
322
|
-
function
|
|
323
|
+
function re(e, t) {
|
|
323
324
|
return h(e, a(t), { resetSelection: !0 });
|
|
324
325
|
}
|
|
325
|
-
function
|
|
326
|
+
function k(e, t) {
|
|
326
327
|
return h(e, [...e.rows, ...t]);
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
+
function A(e, t) {
|
|
329
330
|
let n = new Map(t.map((e) => [e.id, e.patch]));
|
|
330
331
|
return h(e, e.rows.map((t, r) => {
|
|
331
332
|
let i = e.rowIds[r], a = i === void 0 ? void 0 : n.get(i);
|
|
@@ -335,14 +336,14 @@ function j(e, t) {
|
|
|
335
336
|
} : t;
|
|
336
337
|
}));
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
+
function ie(e, t) {
|
|
339
340
|
let n = new Set(t);
|
|
340
341
|
return h(e, e.rows.filter((t, r) => {
|
|
341
342
|
let i = e.rowIds[r];
|
|
342
343
|
return i === void 0 || !n.has(i);
|
|
343
344
|
}));
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
+
function ae(e, t) {
|
|
346
347
|
return {
|
|
347
348
|
...e,
|
|
348
349
|
theme: {
|
|
@@ -351,13 +352,13 @@ function ie(e, t) {
|
|
|
351
352
|
}
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
+
function oe(e, t) {
|
|
355
356
|
return {
|
|
356
357
|
...e,
|
|
357
358
|
showHeader: t
|
|
358
359
|
};
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function se(e, t) {
|
|
361
362
|
return {
|
|
362
363
|
...e,
|
|
363
364
|
pagination: {
|
|
@@ -366,10 +367,10 @@ function oe(e, t) {
|
|
|
366
367
|
}
|
|
367
368
|
};
|
|
368
369
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
370
|
+
function j(e, t) {
|
|
371
|
+
return M(e, t ? [t] : []);
|
|
371
372
|
}
|
|
372
|
-
function
|
|
373
|
+
function M(e, t) {
|
|
373
374
|
let n = y(e.columns, t), r = n[0] ?? null;
|
|
374
375
|
return v(e.sortModel, n) ? e : {
|
|
375
376
|
...e,
|
|
@@ -377,10 +378,10 @@ function N(e, t) {
|
|
|
377
378
|
sortModel: n
|
|
378
379
|
};
|
|
379
380
|
}
|
|
380
|
-
function
|
|
381
|
-
return
|
|
381
|
+
function ce(e) {
|
|
382
|
+
return M(e, []);
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function le(e, t, n) {
|
|
384
385
|
return {
|
|
385
386
|
...e,
|
|
386
387
|
columnState: {
|
|
@@ -392,7 +393,7 @@ function ce(e, t, n) {
|
|
|
392
393
|
}
|
|
393
394
|
};
|
|
394
395
|
}
|
|
395
|
-
function
|
|
396
|
+
function ue(e, t, n) {
|
|
396
397
|
return {
|
|
397
398
|
...e,
|
|
398
399
|
columnState: {
|
|
@@ -404,7 +405,7 @@ function le(e, t, n) {
|
|
|
404
405
|
}
|
|
405
406
|
};
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
+
function de(e, t, n) {
|
|
408
409
|
return d(e.columnGroups, t) ? {
|
|
409
410
|
...e,
|
|
410
411
|
columnGroupState: {
|
|
@@ -416,38 +417,38 @@ function ue(e, t, n) {
|
|
|
416
417
|
}
|
|
417
418
|
} : e;
|
|
418
419
|
}
|
|
419
|
-
function
|
|
420
|
+
function fe(e, t) {
|
|
420
421
|
return e.columnState[t.id]?.width ?? t.width ?? 100;
|
|
421
422
|
}
|
|
422
|
-
function
|
|
423
|
+
function N(e) {
|
|
423
424
|
return Math.max(88, e.minWidth ?? 88);
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
+
function P(e) {
|
|
426
427
|
return e.maxWidth ?? Infinity;
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
+
function F(e, t, n) {
|
|
429
430
|
return Math.min(n, Math.max(t, e));
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
-
let r = t.map((t) =>
|
|
432
|
+
function I(e, t, n) {
|
|
433
|
+
let r = t.map((t) => F(fe(e, t), N(t), P(t))), i = new Set(t.map((e, t) => t)), a = t.map(N), o = t.map(P), s = F(n, a.reduce((e, t) => e + t, 0), o.reduce((e, t) => e + t, 0));
|
|
433
434
|
for (; i.size > 0;) {
|
|
434
435
|
let e = s - r.reduce((e, t) => e + t, 0);
|
|
435
436
|
if (Math.abs(e) < .001) break;
|
|
436
437
|
let t = [...i], n = t.reduce((e, t) => e + Math.max(r[t] ?? 0, 0), 0), c = !1;
|
|
437
438
|
for (let s of t) {
|
|
438
|
-
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d =
|
|
439
|
+
let l = r[s] ?? 0, u = l + e * (n > 0 ? l / n : 1 / t.length), d = F(u, a[s] ?? 0, o[s] ?? Infinity);
|
|
439
440
|
r[s] = d, Math.abs(d - u) > .001 && (i.delete(s), c = !0);
|
|
440
441
|
}
|
|
441
442
|
if (!c) break;
|
|
442
443
|
}
|
|
443
444
|
return r;
|
|
444
445
|
}
|
|
445
|
-
function
|
|
446
|
+
function L(e, t, n) {
|
|
446
447
|
let r = d(e.columnGroups, t);
|
|
447
448
|
if (!r || e.columnGroupState[r.id]?.hidden === !0) return e;
|
|
448
449
|
let i = r.children.map((t) => _(e, t)).filter((e) => !!e).filter((t) => e.columnState[t.id]?.hidden !== !0);
|
|
449
450
|
if (i.length === 0) return e;
|
|
450
|
-
let a =
|
|
451
|
+
let a = I(e, i, n), o = { ...e.columnState };
|
|
451
452
|
return i.forEach((e, t) => {
|
|
452
453
|
o[e.id] = {
|
|
453
454
|
...o[e.id],
|
|
@@ -458,7 +459,7 @@ function R(e, t, n) {
|
|
|
458
459
|
columnState: o
|
|
459
460
|
};
|
|
460
461
|
}
|
|
461
|
-
function
|
|
462
|
+
function R(e, t) {
|
|
462
463
|
let n = new Map(e.columnOrder.map((e, t) => [e, t])), r = new Map(t.map((e, t) => [e, t])), i = u(e.columnGroups);
|
|
463
464
|
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;
|
|
464
465
|
for (let t of e.columnGroups) {
|
|
@@ -468,7 +469,7 @@ function z(e, t) {
|
|
|
468
469
|
}
|
|
469
470
|
return !1;
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
+
function z(e, t, n) {
|
|
472
473
|
let r = _(e, t), i = u(e.columnGroups).get(t);
|
|
473
474
|
if (!r || r.lockPosition || !i && e.columnState[t]?.pinned !== void 0) return e;
|
|
474
475
|
u(e.columnGroups);
|
|
@@ -486,12 +487,12 @@ function B(e, t, n) {
|
|
|
486
487
|
let r = a.findIndex((e) => t.children.includes(e)), i = r + n.length;
|
|
487
488
|
if (o > r && o < i) return e;
|
|
488
489
|
}
|
|
489
|
-
return a.splice(o, 0, t),
|
|
490
|
+
return a.splice(o, 0, t), R(e, a) || a.every((t, n) => t === e.columnOrder[n]) ? e : {
|
|
490
491
|
...e,
|
|
491
492
|
columnOrder: a
|
|
492
493
|
};
|
|
493
494
|
}
|
|
494
|
-
function
|
|
495
|
+
function B(e, t, n) {
|
|
495
496
|
let r = d(e.columnGroups, t);
|
|
496
497
|
if (!r || r.lockPosition || e.columnGroupState[t]?.pinned !== void 0) return e;
|
|
497
498
|
let i = e.columnOrder.filter((e) => r.children.includes(e));
|
|
@@ -501,12 +502,12 @@ function V(e, t, n) {
|
|
|
501
502
|
...i,
|
|
502
503
|
...a.slice(o)
|
|
503
504
|
];
|
|
504
|
-
return
|
|
505
|
+
return R(e, s) || s.every((t, n) => t === e.columnOrder[n]) ? e : {
|
|
505
506
|
...e,
|
|
506
507
|
columnOrder: s
|
|
507
508
|
};
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
+
function V(e) {
|
|
510
511
|
let t = e.columnGroups.length === 0 ? void 0 : Object.fromEntries(e.columnGroups.map((t) => [t.id, { ...e.columnGroupState[t.id] }]));
|
|
511
512
|
return {
|
|
512
513
|
columns: { ...e.columnState },
|
|
@@ -514,7 +515,7 @@ function H(e) {
|
|
|
514
515
|
order: [...e.columnOrder]
|
|
515
516
|
};
|
|
516
517
|
}
|
|
517
|
-
function
|
|
518
|
+
function pe(e, t) {
|
|
518
519
|
return {
|
|
519
520
|
...e,
|
|
520
521
|
columnOrder: f(e.columns, t, e.columnGroups),
|
|
@@ -522,7 +523,7 @@ function fe(e, t) {
|
|
|
522
523
|
columnState: c(e.columns, t)
|
|
523
524
|
};
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function me(e, t, n = {}) {
|
|
526
527
|
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];
|
|
527
528
|
return {
|
|
528
529
|
...e,
|
|
@@ -532,7 +533,7 @@ function pe(e, t, n = {}) {
|
|
|
532
533
|
}
|
|
533
534
|
};
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
+
function he(e, t) {
|
|
536
537
|
return {
|
|
537
538
|
...e,
|
|
538
539
|
selection: {
|
|
@@ -541,27 +542,33 @@ function me(e, t) {
|
|
|
541
542
|
}
|
|
542
543
|
};
|
|
543
544
|
}
|
|
544
|
-
function
|
|
545
|
+
function H(e, t) {
|
|
546
|
+
return e.rowId === t.rowId && e.columnId === t.columnId;
|
|
547
|
+
}
|
|
548
|
+
function ge(e, t, n = {}) {
|
|
549
|
+
let r = e.selection.cells ?? (e.selection.cell ? [e.selection.cell] : []), i = r.some((e) => H(e, t)), a = n.multi ? n.toggle && i ? r.filter((e) => !H(e, t)) : i ? r : [...r, t] : n.toggle && i ? [] : [t], o = a.some((e) => H(e, t)) ? t : a.at(-1) ?? null;
|
|
545
550
|
return {
|
|
546
551
|
...e,
|
|
547
552
|
selection: {
|
|
548
553
|
...e.selection,
|
|
549
|
-
cell:
|
|
554
|
+
cell: o,
|
|
555
|
+
cells: a,
|
|
550
556
|
range: null
|
|
551
557
|
}
|
|
552
558
|
};
|
|
553
559
|
}
|
|
554
|
-
function
|
|
560
|
+
function _e(e, t) {
|
|
555
561
|
return {
|
|
556
562
|
...e,
|
|
557
563
|
selection: {
|
|
558
564
|
...e.selection,
|
|
559
565
|
cell: t.focus,
|
|
566
|
+
cells: [],
|
|
560
567
|
range: t
|
|
561
568
|
}
|
|
562
569
|
};
|
|
563
570
|
}
|
|
564
|
-
function
|
|
571
|
+
function ve(e) {
|
|
565
572
|
return {
|
|
566
573
|
...e,
|
|
567
574
|
selection: {
|
|
@@ -570,17 +577,18 @@ function _e(e) {
|
|
|
570
577
|
}
|
|
571
578
|
};
|
|
572
579
|
}
|
|
573
|
-
function
|
|
580
|
+
function ye(e) {
|
|
574
581
|
return {
|
|
575
582
|
...e,
|
|
576
583
|
selection: p()
|
|
577
584
|
};
|
|
578
585
|
}
|
|
579
|
-
function
|
|
586
|
+
function be(e, t) {
|
|
580
587
|
return e.selection.rowIds.includes(t);
|
|
581
588
|
}
|
|
582
589
|
function U(e, t) {
|
|
583
|
-
|
|
590
|
+
let n = e.selection.cells;
|
|
591
|
+
return n && n.length > 0 ? n.some((e) => H(e, t)) : e.selection.cell !== null && H(e.selection.cell, t);
|
|
584
592
|
}
|
|
585
593
|
function W(e, t = e.selection.range, n = e.rowIds) {
|
|
586
594
|
if (!t) return [];
|
|
@@ -599,7 +607,7 @@ function W(e, t = e.selection.range, n = e.rowIds) {
|
|
|
599
607
|
}
|
|
600
608
|
return a;
|
|
601
609
|
}
|
|
602
|
-
function
|
|
610
|
+
function xe(e, t, n = e.rowIds) {
|
|
603
611
|
return W(e, e.selection.range, n).some((e) => e.rowId === t.rowId && e.columnId === t.columnId);
|
|
604
612
|
}
|
|
605
613
|
function G(e) {
|
|
@@ -630,7 +638,7 @@ function G(e) {
|
|
|
630
638
|
"right"
|
|
631
639
|
].flatMap((e) => i.filter((t) => t.pinned === e).flatMap((e) => e.columns));
|
|
632
640
|
}
|
|
633
|
-
function
|
|
641
|
+
function Se(e) {
|
|
634
642
|
let t = G(e);
|
|
635
643
|
if (e.columnGroups.length === 0) return [t.map((e) => ({
|
|
636
644
|
colSpan: 1,
|
|
@@ -685,21 +693,21 @@ function K(e, t = e.rows.map((e, t) => t)) {
|
|
|
685
693
|
for (let t of e.sortModel) {
|
|
686
694
|
let n = _(e, t.columnId);
|
|
687
695
|
if (!n?.sort) continue;
|
|
688
|
-
let a = q(e, r, n.id), o = q(e, i, n.id), s = typeof n.sort == "function" ? n.sort(a, o, r, i) :
|
|
696
|
+
let a = q(e, r, n.id), o = q(e, i, n.id), s = typeof n.sort == "function" ? n.sort(a, o, r, i) : te(a, o);
|
|
689
697
|
if (s !== 0) return t.direction === "desc" ? s * -1 : s;
|
|
690
698
|
}
|
|
691
699
|
return t - n;
|
|
692
700
|
});
|
|
693
701
|
}
|
|
694
|
-
function
|
|
695
|
-
let n =
|
|
702
|
+
function Ce(e, t) {
|
|
703
|
+
let n = j(e, t);
|
|
696
704
|
return h(n, K(n).map((e) => n.rows[e]));
|
|
697
705
|
}
|
|
698
|
-
function
|
|
706
|
+
function we(e, t = {}) {
|
|
699
707
|
let n = t.pageIndex ?? e.pagination.pageIndex, r = t.pageSize ?? e.pagination.pageSize, i = Math.max(0, n) * Math.max(1, r);
|
|
700
708
|
return K(e).slice(i, i + Math.max(1, r)).map((t) => e.rows[t]);
|
|
701
709
|
}
|
|
702
|
-
function
|
|
710
|
+
function Te(e, { overscan: t = 2, rowHeight: n, scrollTop: r, viewportHeight: i }) {
|
|
703
711
|
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;
|
|
704
712
|
return {
|
|
705
713
|
bottomSpacerHeight: Math.max(0, c - d - (u - l) * a),
|
|
@@ -710,13 +718,13 @@ function we(e, { overscan: t = 2, rowHeight: n, scrollTop: r, viewportHeight: i
|
|
|
710
718
|
totalHeight: c
|
|
711
719
|
};
|
|
712
720
|
}
|
|
713
|
-
function
|
|
721
|
+
function Ee(e, t, n) {
|
|
714
722
|
let r = g(e, t);
|
|
715
723
|
if (r < 0) return e;
|
|
716
724
|
let i = [...e.rows], [a] = i.splice(r, 1);
|
|
717
725
|
return a === void 0 ? e : (i.splice(Math.max(0, Math.min(n, i.length)), 0, a), h(e, i));
|
|
718
726
|
}
|
|
719
|
-
function
|
|
727
|
+
function De(e, t) {
|
|
720
728
|
let n = g(e, t.sourceRowId), r = t.targetRowId === void 0 ? -1 : g(e, t.targetRowId);
|
|
721
729
|
if (n < 0 || t.targetRowId === t.sourceRowId || t.targetRowId !== void 0 && r < 0) return e;
|
|
722
730
|
let i = e.rows[n];
|
|
@@ -748,23 +756,23 @@ function q(e, t, n) {
|
|
|
748
756
|
let r = _(e, n);
|
|
749
757
|
return r ? b(t, r.field) : void 0;
|
|
750
758
|
}
|
|
751
|
-
function
|
|
759
|
+
function Oe(e, t, n, r) {
|
|
752
760
|
let i = q(e, t, r.id);
|
|
753
761
|
return r.cell?.format ? r.cell.format(S(e, t, n, r)) : i == null ? "" : String(i);
|
|
754
762
|
}
|
|
755
|
-
function
|
|
763
|
+
function ke(e, t, n, r) {
|
|
756
764
|
let i = w(e, t, n, r);
|
|
757
765
|
return i?.disabled !== void 0 && C(i.disabled, S(e, t, n, r)) === !0;
|
|
758
766
|
}
|
|
759
|
-
function
|
|
767
|
+
function Ae(e, t, n, r) {
|
|
760
768
|
let i = S(e, t, n, r), a = w(e, t, n, r)?.className;
|
|
761
769
|
return typeof a == "function" ? a(i) : a;
|
|
762
770
|
}
|
|
763
|
-
function
|
|
771
|
+
function je(e, t, n, r) {
|
|
764
772
|
let i = S(e, t, n, r), a = w(e, t, n, r)?.style;
|
|
765
773
|
return typeof a == "function" ? a(i) : a;
|
|
766
774
|
}
|
|
767
|
-
function
|
|
775
|
+
function Me(e, t) {
|
|
768
776
|
let n = e.rows[g(e, t)];
|
|
769
777
|
if (n === void 0) throw Error(`Cannot copy missing row: ${String(t)}`);
|
|
770
778
|
return {
|
|
@@ -773,10 +781,10 @@ function je(e, t) {
|
|
|
773
781
|
text: JSON.stringify(n)
|
|
774
782
|
};
|
|
775
783
|
}
|
|
776
|
-
function
|
|
784
|
+
function Ne(e, t, n) {
|
|
777
785
|
if (n.mode === "append") {
|
|
778
786
|
let r = n.getNewRowId?.(t.row);
|
|
779
|
-
return
|
|
787
|
+
return k(e, [r === void 0 ? t.row : E(t.row, r)]);
|
|
780
788
|
}
|
|
781
789
|
if (n.mode === "insert-after") {
|
|
782
790
|
let r = g(e, n.targetRowId);
|
|
@@ -784,7 +792,7 @@ function Me(e, t, n) {
|
|
|
784
792
|
let i = e.getRowId(t.row, r), a = n.getPastedRowId?.(t.row) ?? ee(e.rowIds, i), o = E(t.row, a), s = [...e.rows];
|
|
785
793
|
return s.splice(r + 1, 0, o), h(e, s);
|
|
786
794
|
}
|
|
787
|
-
return
|
|
795
|
+
return A(e, [{
|
|
788
796
|
id: n.targetRowId,
|
|
789
797
|
patch: E(t.row, n.targetRowId)
|
|
790
798
|
}]);
|
|
@@ -801,12 +809,12 @@ function J(e, { columnId: t, rowId: n }) {
|
|
|
801
809
|
}
|
|
802
810
|
function Y(e, { columnId: t, rowId: n }, r) {
|
|
803
811
|
let i = _(e, t), a = e.rows[g(e, n)];
|
|
804
|
-
return !r || !i || !D(e, a, n, i, "paste") ? e :
|
|
812
|
+
return !r || !i || !D(e, a, n, i, "paste") ? e : A(e, [{
|
|
805
813
|
id: n,
|
|
806
814
|
patch: (e) => x(e, i.field, r.value)
|
|
807
815
|
}]);
|
|
808
816
|
}
|
|
809
|
-
function
|
|
817
|
+
function Pe(e, t = e.selection.range, n = e.rowIds) {
|
|
810
818
|
if (!t) return null;
|
|
811
819
|
let r = T(e, t, n);
|
|
812
820
|
if (!r) return null;
|
|
@@ -834,7 +842,7 @@ function Ne(e, t = e.selection.range, n = e.rowIds) {
|
|
|
834
842
|
text: i.map((e) => e.map((e) => e?.text ?? "").join(" ")).join("\n")
|
|
835
843
|
};
|
|
836
844
|
}
|
|
837
|
-
function
|
|
845
|
+
function Fe(e, t, n, r = e.rowIds) {
|
|
838
846
|
if (!n) return e;
|
|
839
847
|
let i = G(e), a = r.indexOf(t.rowId), o = i.findIndex((e) => e.id === t.columnId), s = [...e.rows];
|
|
840
848
|
if (a < 0 || o < 0) return e;
|
|
@@ -847,7 +855,7 @@ function Pe(e, t, n, r = e.rowIds) {
|
|
|
847
855
|
});
|
|
848
856
|
}), c ? h(e, s) : e;
|
|
849
857
|
}
|
|
850
|
-
function
|
|
858
|
+
function Ie(e, { source: t, target: n }) {
|
|
851
859
|
let r = J(e, t);
|
|
852
860
|
return r ? W(e, n).reduce((e, t) => Y(e, t, r), e) : e;
|
|
853
861
|
}
|
|
@@ -856,11 +864,11 @@ function X({ columnOrder: e, columns: t }) {
|
|
|
856
864
|
let n = new Map(t.map((e) => [e.id, e]));
|
|
857
865
|
return e.map((e) => n.get(e)).filter((e) => !!e);
|
|
858
866
|
}
|
|
859
|
-
function
|
|
867
|
+
function Le(e) {
|
|
860
868
|
return e == null ? "" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? String(e) : JSON.stringify(e);
|
|
861
869
|
}
|
|
862
870
|
function Z(e) {
|
|
863
|
-
let t =
|
|
871
|
+
let t = Le(e);
|
|
864
872
|
return /[",\r\n]/u.test(t) ? `"${t.replaceAll("\"", "\"\"")}"` : t;
|
|
865
873
|
}
|
|
866
874
|
function Q(e, t) {
|
|
@@ -869,14 +877,14 @@ function Q(e, t) {
|
|
|
869
877
|
function $(e, t, n, r) {
|
|
870
878
|
return r === "formatted" && e.format ? e.format(t, n) : e.value(t, n);
|
|
871
879
|
}
|
|
872
|
-
function
|
|
880
|
+
function Re({ columnOrder: e, columns: t, headerOverrides: n, rows: r, valueSource: i = "raw" }) {
|
|
873
881
|
let a = X({
|
|
874
882
|
columnOrder: e,
|
|
875
883
|
columns: t
|
|
876
884
|
});
|
|
877
885
|
return [a.map((e) => Z(Q(e, n))).join(","), ...r.map((e, t) => a.map((n) => Z($(n, e, t, i))).join(","))].join("\n");
|
|
878
886
|
}
|
|
879
|
-
function
|
|
887
|
+
function ze({ columnOrder: e, columns: t, headerOverrides: n, rows: r, valueSource: i = "raw" }) {
|
|
880
888
|
let a = X({
|
|
881
889
|
columnOrder: e,
|
|
882
890
|
columns: t
|
|
@@ -884,6 +892,6 @@ function Re({ columnOrder: e, columns: t, headerOverrides: n, rows: r, valueSour
|
|
|
884
892
|
return JSON.stringify(o, null, 2);
|
|
885
893
|
}
|
|
886
894
|
//#endregion
|
|
887
|
-
export { r as $,
|
|
895
|
+
export { r as $, Ee as A, he as B, G as C, be as D, U as E, ne as F, le as G, de as H, re as I, M as J, oe as K, ge as L, Y as M, Fe as N, z as O, Ne as P, A as Q, _e as R, Te as S, xe as T, L as U, V, ue as W, ae as X, j as Y, Ce as Z, q as _, ce as a, W as b, Me as c, Re as d, n as et, ze as f, je as g, Ae as h, ye as i, De as j, B as k, O as l, Oe as m, pe as n, J as o, Ie as p, se as q, ve as r, Pe as s, k as t, t as tt, ie as u, Se as v, ke as w, K as x, we as y, me as z };
|
|
888
896
|
|
|
889
|
-
//# sourceMappingURL=core-
|
|
897
|
+
//# sourceMappingURL=core-D01wEe-7.js.map
|