@toolbox-web/grid 0.2.1 → 0.2.2
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/README.md +50 -59
- package/all.d.ts +1 -47
- package/all.js +195 -239
- package/all.js.map +1 -1
- package/index.d.ts +1 -47
- package/index.js +129 -118
- package/index.js.map +1 -1
- package/lib/plugins/clipboard/index.js +11 -5
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +9 -4
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +11 -5
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/export/index.js +7 -3
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +16 -149
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +13 -6
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +13 -6
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +11 -5
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +13 -6
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +11 -5
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +13 -6
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +19 -9
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +11 -5
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js +13 -6
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +11 -5
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +15 -7
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +3 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +13 -6
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +15 -156
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +6 -6
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -142
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
package/all.js
CHANGED
|
@@ -72,19 +72,22 @@ class mn extends x {
|
|
|
72
72
|
quoteStrings: !1
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
//
|
|
75
|
+
// #region Internal State
|
|
76
76
|
/** The last copied text (for reference/debugging) */
|
|
77
77
|
lastCopied = null;
|
|
78
|
-
//
|
|
78
|
+
// #endregion
|
|
79
|
+
// #region Lifecycle
|
|
79
80
|
detach() {
|
|
80
81
|
this.lastCopied = null;
|
|
81
82
|
}
|
|
82
|
-
//
|
|
83
|
+
// #endregion
|
|
84
|
+
// #region Event Handlers
|
|
83
85
|
onKeyDown(e) {
|
|
84
86
|
const t = (e.ctrlKey || e.metaKey) && e.key === "c", n = (e.ctrlKey || e.metaKey) && e.key === "v";
|
|
85
87
|
return t ? (this.#t(e.target), !0) : n ? (this.#e(), !0) : !1;
|
|
86
88
|
}
|
|
87
|
-
//
|
|
89
|
+
// #endregion
|
|
90
|
+
// #region Private Methods
|
|
88
91
|
/**
|
|
89
92
|
* Handle copy operation
|
|
90
93
|
*/
|
|
@@ -209,7 +212,8 @@ class mn extends x {
|
|
|
209
212
|
c = l == null ? "" : String(l);
|
|
210
213
|
return { text: c, field: n, value: l };
|
|
211
214
|
}
|
|
212
|
-
//
|
|
215
|
+
// #endregion
|
|
216
|
+
// #region Public API
|
|
213
217
|
/**
|
|
214
218
|
* Copy currently selected rows to clipboard.
|
|
215
219
|
* @returns The copied text
|
|
@@ -252,6 +256,7 @@ class mn extends x {
|
|
|
252
256
|
getLastCopied() {
|
|
253
257
|
return this.lastCopied;
|
|
254
258
|
}
|
|
259
|
+
// #endregion
|
|
255
260
|
}
|
|
256
261
|
const de = 100;
|
|
257
262
|
function Q(r) {
|
|
@@ -317,7 +322,7 @@ class wn extends x {
|
|
|
317
322
|
overscan: 3
|
|
318
323
|
};
|
|
319
324
|
}
|
|
320
|
-
//
|
|
325
|
+
// #region Internal State
|
|
321
326
|
isVirtualized = !1;
|
|
322
327
|
startCol = 0;
|
|
323
328
|
endCol = 0;
|
|
@@ -325,7 +330,8 @@ class wn extends x {
|
|
|
325
330
|
totalWidth = 0;
|
|
326
331
|
columnWidths = [];
|
|
327
332
|
columnOffsets = [];
|
|
328
|
-
//
|
|
333
|
+
// #endregion
|
|
334
|
+
// #region Lifecycle
|
|
329
335
|
attach(e) {
|
|
330
336
|
super.attach(e);
|
|
331
337
|
const t = this.columns;
|
|
@@ -334,7 +340,8 @@ class wn extends x {
|
|
|
334
340
|
detach() {
|
|
335
341
|
this.columnWidths = [], this.columnOffsets = [], this.isVirtualized = !1, this.startCol = 0, this.endCol = 0, this.scrollLeft = 0, this.totalWidth = 0;
|
|
336
342
|
}
|
|
337
|
-
//
|
|
343
|
+
// #endregion
|
|
344
|
+
// #region Hooks
|
|
338
345
|
processColumns(e) {
|
|
339
346
|
const t = Ve(e.length, this.config.threshold ?? 30, this.config.autoEnable ?? !0);
|
|
340
347
|
if (this.isVirtualized = t ?? !1, this.columnWidths = ce(e), this.columnOffsets = ue(e), this.totalWidth = he(e), !t)
|
|
@@ -362,7 +369,8 @@ class wn extends x {
|
|
|
362
369
|
onScroll(e) {
|
|
363
370
|
!this.isVirtualized || Math.abs(e.scrollLeft - this.scrollLeft) < 1 || (this.scrollLeft = e.scrollLeft, this.requestRender());
|
|
364
371
|
}
|
|
365
|
-
//
|
|
372
|
+
// #endregion
|
|
373
|
+
// #region Public API
|
|
366
374
|
/**
|
|
367
375
|
* Check if column virtualization is currently active.
|
|
368
376
|
*/
|
|
@@ -396,6 +404,7 @@ class wn extends x {
|
|
|
396
404
|
getTotalWidth() {
|
|
397
405
|
return this.totalWidth;
|
|
398
406
|
}
|
|
407
|
+
// #endregion
|
|
399
408
|
}
|
|
400
409
|
const We = ".tbw-context-menu{position:fixed;background:light-dark(#f5f5f5,#2a2a2a);color:light-dark(#222,#eee);border:1px solid light-dark(#d0d0d4,#454545);border-radius:4px;box-shadow:0 2px 10px #00000026;min-width:160px;padding:4px 0;z-index:10000;font-size:13px;font-family:system-ui,sans-serif}.tbw-context-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;gap:8px}.tbw-context-menu-item:hover:not(.disabled){background:light-dark(#e8e8e8,#3a3a3a)}.tbw-context-menu-item.disabled{opacity:.5;cursor:default}.tbw-context-menu-item.danger{color:light-dark(#c00,#f66)}.tbw-context-menu-icon{width:16px;text-align:center}.tbw-context-menu-label{flex:1}.tbw-context-menu-shortcut{color:light-dark(#888,#888);font-size:11px}.tbw-context-menu-arrow{font-size:10px;color:light-dark(#888,#888)}.tbw-context-menu-separator{height:1px;background:light-dark(#d0d0d4,#454545);margin:4px 0}";
|
|
401
410
|
function Y(r, e) {
|
|
@@ -475,19 +484,21 @@ class bn extends x {
|
|
|
475
484
|
items: O
|
|
476
485
|
};
|
|
477
486
|
}
|
|
478
|
-
//
|
|
487
|
+
// #region Internal State
|
|
479
488
|
isOpen = !1;
|
|
480
489
|
position = { x: 0, y: 0 };
|
|
481
490
|
params = null;
|
|
482
491
|
menuElement = null;
|
|
483
|
-
//
|
|
492
|
+
// #endregion
|
|
493
|
+
// #region Lifecycle
|
|
484
494
|
attach(e) {
|
|
485
495
|
super.attach(e), this.installGlobalHandlers(), B++;
|
|
486
496
|
}
|
|
487
497
|
detach() {
|
|
488
498
|
this.menuElement && (this.menuElement.remove(), this.menuElement = null), this.isOpen = !1, this.params = null, this.uninstallGlobalHandlers();
|
|
489
499
|
}
|
|
490
|
-
//
|
|
500
|
+
// #endregion
|
|
501
|
+
// #region Private Methods
|
|
491
502
|
installGlobalHandlers() {
|
|
492
503
|
!E && typeof document < "u" && (E = document.createElement("style"), E.id = "tbw-context-menu-styles", E.textContent = We, document.head.appendChild(E)), _ || (_ = () => {
|
|
493
504
|
document.querySelectorAll(".tbw-context-menu").forEach((t) => t.remove());
|
|
@@ -502,7 +513,8 @@ class bn extends x {
|
|
|
502
513
|
uninstallGlobalHandlers() {
|
|
503
514
|
B--, !(B > 0) && (_ && (document.removeEventListener("click", _), _ = null), I && (document.removeEventListener("keydown", I), I = null), E && (E.remove(), E = null));
|
|
504
515
|
}
|
|
505
|
-
//
|
|
516
|
+
// #endregion
|
|
517
|
+
// #region Hooks
|
|
506
518
|
afterRender() {
|
|
507
519
|
const e = this.shadowRoot;
|
|
508
520
|
if (!e) return;
|
|
@@ -550,7 +562,8 @@ class bn extends x {
|
|
|
550
562
|
), document.body.appendChild(this.menuElement), ge(this.menuElement, o.clientX, o.clientY), this.isOpen = !0, this.emit("context-menu-open", { params: a, items: d }));
|
|
551
563
|
}));
|
|
552
564
|
}
|
|
553
|
-
//
|
|
565
|
+
// #endregion
|
|
566
|
+
// #region Public API
|
|
554
567
|
/**
|
|
555
568
|
* Programmatically show the context menu at the specified position.
|
|
556
569
|
* @param x - X coordinate
|
|
@@ -590,6 +603,7 @@ class bn extends x {
|
|
|
590
603
|
isMenuOpen() {
|
|
591
604
|
return this.isOpen;
|
|
592
605
|
}
|
|
606
|
+
// #endregion
|
|
593
607
|
// Styles are injected globally via installGlobalHandlers() since menu renders in document.body
|
|
594
608
|
}
|
|
595
609
|
function pe(r, e = !0) {
|
|
@@ -679,10 +693,11 @@ class vn extends x {
|
|
|
679
693
|
onlySelected: !1
|
|
680
694
|
};
|
|
681
695
|
}
|
|
682
|
-
//
|
|
696
|
+
// #region Internal State
|
|
683
697
|
isExportingFlag = !1;
|
|
684
698
|
lastExportInfo = null;
|
|
685
|
-
//
|
|
699
|
+
// #endregion
|
|
700
|
+
// #region Private Methods
|
|
686
701
|
performExport(e, t) {
|
|
687
702
|
const n = this.config, o = {
|
|
688
703
|
format: e,
|
|
@@ -749,7 +764,8 @@ class vn extends x {
|
|
|
749
764
|
return null;
|
|
750
765
|
}
|
|
751
766
|
}
|
|
752
|
-
//
|
|
767
|
+
// #endregion
|
|
768
|
+
// #region Public API
|
|
753
769
|
/**
|
|
754
770
|
* Export data to CSV format.
|
|
755
771
|
* @param params - Optional export parameters
|
|
@@ -785,6 +801,7 @@ class vn extends x {
|
|
|
785
801
|
getLastExport() {
|
|
786
802
|
return this.lastExportInfo;
|
|
787
803
|
}
|
|
804
|
+
// #endregion
|
|
788
805
|
}
|
|
789
806
|
function Xe(r) {
|
|
790
807
|
const { totalRows: e, viewportHeight: t, scrollTop: n, rowHeight: o, overscan: i } = r, s = Math.ceil(t / o);
|
|
@@ -864,148 +881,7 @@ function me(r, e) {
|
|
|
864
881
|
}
|
|
865
882
|
return [...t].sort((n, o) => typeof n == "number" && typeof o == "number" ? n - o : String(n).localeCompare(String(o)));
|
|
866
883
|
}
|
|
867
|
-
const nt = '.header-cell.filtered:before{content:"";position:absolute;top:4px;right:4px;width:6px;height:6px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}.tbw-filter-btn{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:4px;opacity:.4;transition:opacity .15s;color:inherit;vertical-align:middle}.tbw-filter-btn:hover,.tbw-filter-btn.active{opacity:1}.tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}', ot =
|
|
868
|
-
.tbw-filter-panel {
|
|
869
|
-
position: fixed;
|
|
870
|
-
background: var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));
|
|
871
|
-
color: var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));
|
|
872
|
-
border: 1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));
|
|
873
|
-
border-radius: var(--tbw-filter-panel-radius, var(--tbw-border-radius, 4px));
|
|
874
|
-
box-shadow: 0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0,0,0,0.1), rgba(0,0,0,0.3))));
|
|
875
|
-
padding: 12px;
|
|
876
|
-
z-index: 10000;
|
|
877
|
-
min-width: 200px;
|
|
878
|
-
max-width: 280px;
|
|
879
|
-
max-height: 350px;
|
|
880
|
-
display: flex;
|
|
881
|
-
flex-direction: column;
|
|
882
|
-
font-family: var(--tbw-font-family, system-ui, sans-serif);
|
|
883
|
-
font-size: var(--tbw-font-size, 13px);
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
.tbw-filter-search {
|
|
887
|
-
margin-bottom: 8px;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
.tbw-filter-search-input {
|
|
891
|
-
width: 100%;
|
|
892
|
-
padding: 6px 10px;
|
|
893
|
-
background: var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));
|
|
894
|
-
color: inherit;
|
|
895
|
-
border: 1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));
|
|
896
|
-
border-radius: var(--tbw-filter-input-radius, 4px);
|
|
897
|
-
font-size: inherit;
|
|
898
|
-
box-sizing: border-box;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
.tbw-filter-search-input:focus {
|
|
902
|
-
outline: none;
|
|
903
|
-
border-color: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));
|
|
904
|
-
box-shadow: 0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%);
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.tbw-filter-actions {
|
|
908
|
-
display: flex;
|
|
909
|
-
padding: 4px 2px;
|
|
910
|
-
margin-bottom: 8px;
|
|
911
|
-
border-bottom: 1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
.tbw-filter-action-btn {
|
|
915
|
-
background: transparent;
|
|
916
|
-
border: none;
|
|
917
|
-
color: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));
|
|
918
|
-
cursor: pointer;
|
|
919
|
-
font-size: 12px;
|
|
920
|
-
padding: 2px 0;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
.tbw-filter-action-btn:hover {
|
|
924
|
-
text-decoration: underline;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
.tbw-filter-values {
|
|
928
|
-
flex: 1;
|
|
929
|
-
overflow-y: auto;
|
|
930
|
-
margin-bottom: 8px;
|
|
931
|
-
max-height: 180px;
|
|
932
|
-
position: relative;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.tbw-filter-values-spacer {
|
|
936
|
-
width: 1px;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
.tbw-filter-values-content {
|
|
940
|
-
position: absolute;
|
|
941
|
-
top: 0;
|
|
942
|
-
left: 0;
|
|
943
|
-
right: 0;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
.tbw-filter-value-item {
|
|
947
|
-
display: flex;
|
|
948
|
-
align-items: center;
|
|
949
|
-
gap: 8px;
|
|
950
|
-
padding: 4px 2px;
|
|
951
|
-
cursor: pointer;
|
|
952
|
-
border-radius: 3px;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
.tbw-filter-value-item:hover {
|
|
956
|
-
background: var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)));
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
.tbw-filter-checkbox {
|
|
960
|
-
margin: 0;
|
|
961
|
-
cursor: pointer;
|
|
962
|
-
accent-color: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
.tbw-filter-no-match {
|
|
966
|
-
color: var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));
|
|
967
|
-
padding: 8px 0;
|
|
968
|
-
text-align: center;
|
|
969
|
-
font-style: italic;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
.tbw-filter-buttons {
|
|
973
|
-
display: flex;
|
|
974
|
-
gap: 8px;
|
|
975
|
-
padding-top: 8px;
|
|
976
|
-
border-top: 1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
.tbw-filter-apply-btn {
|
|
980
|
-
flex: 1;
|
|
981
|
-
padding: 6px 12px;
|
|
982
|
-
background: var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));
|
|
983
|
-
color: var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));
|
|
984
|
-
border: none;
|
|
985
|
-
border-radius: 4px;
|
|
986
|
-
cursor: pointer;
|
|
987
|
-
font-size: 13px;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.tbw-filter-apply-btn:hover {
|
|
991
|
-
filter: brightness(0.9);
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
.tbw-filter-clear-btn {
|
|
995
|
-
flex: 1;
|
|
996
|
-
padding: 6px 12px;
|
|
997
|
-
background: transparent;
|
|
998
|
-
color: var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));
|
|
999
|
-
border: 1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));
|
|
1000
|
-
border-radius: 4px;
|
|
1001
|
-
cursor: pointer;
|
|
1002
|
-
font-size: 13px;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.tbw-filter-clear-btn:hover {
|
|
1006
|
-
background: var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)));
|
|
1007
|
-
}
|
|
1008
|
-
`;
|
|
884
|
+
const nt = '.header-cell.filtered:before{content:"";position:absolute;top:4px;right:4px;width:6px;height:6px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}.tbw-filter-btn{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:4px;opacity:.4;transition:opacity .15s;color:inherit;vertical-align:middle}.tbw-filter-btn:hover,.tbw-filter-btn.active{opacity:1}.tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}', ot = ".tbw-filter-panel{position:fixed;background:var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));color:var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));border:1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-panel-radius, var(--tbw-border-radius, 4px));box-shadow:0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3))));padding:12px;z-index:10000;min-width:200px;max-width:280px;max-height:350px;display:flex;flex-direction:column;font-family:var(--tbw-font-family, system-ui, sans-serif);font-size:var(--tbw-font-size, 13px)}.tbw-filter-search{margin-bottom:8px}.tbw-filter-search-input{width:100%;padding:6px 10px;background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, 4px);font-size:inherit;box-sizing:border-box}.tbw-filter-search-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-actions{display:flex;padding:4px 2px;margin-bottom:8px;border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-action-btn{background:transparent;border:none;color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));cursor:pointer;font-size:12px;padding:2px 0}.tbw-filter-action-btn:hover{text-decoration:underline}.tbw-filter-values{flex:1;overflow-y:auto;margin-bottom:8px;max-height:180px;position:relative}.tbw-filter-values-spacer{width:1px}.tbw-filter-values-content{position:absolute;top:0;left:0;right:0}.tbw-filter-value-item{display:flex;align-items:center;gap:8px;padding:4px 2px;cursor:pointer;border-radius:3px}.tbw-filter-value-item:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-checkbox{margin:0;cursor:pointer;accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}.tbw-filter-no-match{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding:8px 0;text-align:center;font-style:italic}.tbw-filter-buttons{display:flex;gap:8px;padding-top:8px;border-top:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-apply-btn{flex:1;padding:6px 12px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));color:var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));border:none;border-radius:4px;cursor:pointer;font-size:13px}.tbw-filter-apply-btn:hover{filter:brightness(.9)}.tbw-filter-clear-btn{flex:1;padding:6px 12px;background:transparent;color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:4px;cursor:pointer;font-size:13px}.tbw-filter-clear-btn:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}";
|
|
1009
885
|
class A extends x {
|
|
1010
886
|
name = "filtering";
|
|
1011
887
|
version = "1.0.0";
|
|
@@ -1017,7 +893,7 @@ class A extends x {
|
|
|
1017
893
|
useWorker: !0
|
|
1018
894
|
};
|
|
1019
895
|
}
|
|
1020
|
-
//
|
|
896
|
+
// #region Internal State
|
|
1021
897
|
filters = /* @__PURE__ */ new Map();
|
|
1022
898
|
cachedResult = null;
|
|
1023
899
|
cacheKey = null;
|
|
@@ -1033,14 +909,16 @@ class A extends x {
|
|
|
1033
909
|
static LIST_OVERSCAN = 3;
|
|
1034
910
|
static LIST_BYPASS_THRESHOLD = 50;
|
|
1035
911
|
// Don't virtualize if < 50 items
|
|
1036
|
-
//
|
|
912
|
+
// #endregion
|
|
913
|
+
// #region Lifecycle
|
|
1037
914
|
attach(e) {
|
|
1038
915
|
super.attach(e), this.injectGlobalStyles();
|
|
1039
916
|
}
|
|
1040
917
|
detach() {
|
|
1041
918
|
this.filters.clear(), this.cachedResult = null, this.cacheKey = null, this.openPanelField = null, this.panelElement && (this.panelElement.remove(), this.panelElement = null), this.searchText.clear(), this.excludedValues.clear(), this.panelAbortController?.abort(), this.panelAbortController = null;
|
|
1042
919
|
}
|
|
1043
|
-
//
|
|
920
|
+
// #endregion
|
|
921
|
+
// #region Hooks
|
|
1044
922
|
processRows(e) {
|
|
1045
923
|
const t = [...this.filters.values()];
|
|
1046
924
|
if (!t.length) return [...e];
|
|
@@ -1066,7 +944,8 @@ class A extends x {
|
|
|
1066
944
|
}), n.appendChild(l);
|
|
1067
945
|
});
|
|
1068
946
|
}
|
|
1069
|
-
//
|
|
947
|
+
// #endregion
|
|
948
|
+
// #region Public API
|
|
1070
949
|
/**
|
|
1071
950
|
* Set a filter on a specific field.
|
|
1072
951
|
* Pass null to remove the filter.
|
|
@@ -1151,7 +1030,8 @@ class A extends x {
|
|
|
1151
1030
|
getUniqueValues(e) {
|
|
1152
1031
|
return me(this.sourceRows, e);
|
|
1153
1032
|
}
|
|
1154
|
-
//
|
|
1033
|
+
// #endregion
|
|
1034
|
+
// #region Private Methods
|
|
1155
1035
|
/**
|
|
1156
1036
|
* Inject global styles for filter panel (rendered in document.body)
|
|
1157
1037
|
*/
|
|
@@ -1362,7 +1242,8 @@ class A extends x {
|
|
|
1362
1242
|
filteredRowCount: 0
|
|
1363
1243
|
}), this.requestRender();
|
|
1364
1244
|
}
|
|
1365
|
-
//
|
|
1245
|
+
// #endregion
|
|
1246
|
+
// #region Column State Hooks
|
|
1366
1247
|
/**
|
|
1367
1248
|
* Return filter state for a column if it has an active filter.
|
|
1368
1249
|
*/
|
|
@@ -1395,8 +1276,10 @@ class A extends x {
|
|
|
1395
1276
|
};
|
|
1396
1277
|
this.filters.set(e, n), this.cachedResult = null, this.cacheKey = null;
|
|
1397
1278
|
}
|
|
1398
|
-
//
|
|
1279
|
+
// #endregion
|
|
1280
|
+
// #region Styles
|
|
1399
1281
|
styles = nt;
|
|
1282
|
+
// #endregion
|
|
1400
1283
|
}
|
|
1401
1284
|
function it(r) {
|
|
1402
1285
|
if (!r.length) return [];
|
|
@@ -1471,14 +1354,16 @@ class xn extends x {
|
|
|
1471
1354
|
showGroupBorders: !0
|
|
1472
1355
|
};
|
|
1473
1356
|
}
|
|
1474
|
-
//
|
|
1357
|
+
// #region Internal State
|
|
1475
1358
|
groups = [];
|
|
1476
1359
|
isActive = !1;
|
|
1477
|
-
//
|
|
1360
|
+
// #endregion
|
|
1361
|
+
// #region Lifecycle
|
|
1478
1362
|
detach() {
|
|
1479
1363
|
this.groups = [], this.isActive = !1;
|
|
1480
1364
|
}
|
|
1481
|
-
//
|
|
1365
|
+
// #endregion
|
|
1366
|
+
// #region Static Detection
|
|
1482
1367
|
/**
|
|
1483
1368
|
* Auto-detect column groups from column configuration.
|
|
1484
1369
|
*/
|
|
@@ -1486,7 +1371,8 @@ class xn extends x {
|
|
|
1486
1371
|
const n = t?.columns;
|
|
1487
1372
|
return Array.isArray(n) ? lt(n) : !1;
|
|
1488
1373
|
}
|
|
1489
|
-
//
|
|
1374
|
+
// #endregion
|
|
1375
|
+
// #region Hooks
|
|
1490
1376
|
processColumns(e) {
|
|
1491
1377
|
const t = it(e);
|
|
1492
1378
|
return t.length === 0 ? (this.isActive = !1, this.groups = [], [...e]) : (this.isActive = !0, this.groups = t, [...e]);
|
|
@@ -1509,7 +1395,8 @@ class xn extends x {
|
|
|
1509
1395
|
const o = e.querySelector(".header-row");
|
|
1510
1396
|
o && rt(o, this.groups, this.columns);
|
|
1511
1397
|
}
|
|
1512
|
-
//
|
|
1398
|
+
// #endregion
|
|
1399
|
+
// #region Public API
|
|
1513
1400
|
/**
|
|
1514
1401
|
* Check if column groups are active.
|
|
1515
1402
|
* @returns Whether grouping is active
|
|
@@ -1539,8 +1426,10 @@ class xn extends x {
|
|
|
1539
1426
|
refresh() {
|
|
1540
1427
|
this.requestRender();
|
|
1541
1428
|
}
|
|
1542
|
-
//
|
|
1429
|
+
// #endregion
|
|
1430
|
+
// #region Styles
|
|
1543
1431
|
styles = at;
|
|
1432
|
+
// #endregion
|
|
1544
1433
|
}
|
|
1545
1434
|
function dt({ rows: r, config: e, expanded: t }) {
|
|
1546
1435
|
const n = e.groupOn;
|
|
@@ -1603,15 +1492,17 @@ class Cn extends x {
|
|
|
1603
1492
|
aggregators: {}
|
|
1604
1493
|
};
|
|
1605
1494
|
}
|
|
1606
|
-
//
|
|
1495
|
+
// #region Internal State
|
|
1607
1496
|
expandedKeys = /* @__PURE__ */ new Set();
|
|
1608
1497
|
flattenedRows = [];
|
|
1609
1498
|
isActive = !1;
|
|
1610
|
-
//
|
|
1499
|
+
// #endregion
|
|
1500
|
+
// #region Lifecycle
|
|
1611
1501
|
detach() {
|
|
1612
1502
|
this.expandedKeys.clear(), this.flattenedRows = [], this.isActive = !1;
|
|
1613
1503
|
}
|
|
1614
|
-
//
|
|
1504
|
+
// #endregion
|
|
1505
|
+
// #region Hooks
|
|
1615
1506
|
/**
|
|
1616
1507
|
* Auto-detect grouping configuration from grid config.
|
|
1617
1508
|
* Called by plugin system to determine if plugin should activate.
|
|
@@ -1671,7 +1562,8 @@ class Cn extends x {
|
|
|
1671
1562
|
}
|
|
1672
1563
|
afterRender() {
|
|
1673
1564
|
}
|
|
1674
|
-
//
|
|
1565
|
+
// #endregion
|
|
1566
|
+
// #region Private Rendering Helpers
|
|
1675
1567
|
renderFullWidthGroupRow(e, t, n) {
|
|
1676
1568
|
const o = this.config, i = document.createElement("div");
|
|
1677
1569
|
i.className = "cell group-full", i.style.gridColumn = "1 / -1", i.setAttribute("role", "gridcell");
|
|
@@ -1720,7 +1612,8 @@ class Cn extends x {
|
|
|
1720
1612
|
t.appendChild(h);
|
|
1721
1613
|
});
|
|
1722
1614
|
}
|
|
1723
|
-
//
|
|
1615
|
+
// #endregion
|
|
1616
|
+
// #region Public API
|
|
1724
1617
|
/**
|
|
1725
1618
|
* Expand all groups.
|
|
1726
1619
|
*/
|
|
@@ -1827,8 +1720,10 @@ class Cn extends x {
|
|
|
1827
1720
|
setGroupOn(e) {
|
|
1828
1721
|
this.config.groupOn = e, this.requestRender();
|
|
1829
1722
|
}
|
|
1830
|
-
//
|
|
1723
|
+
// #endregion
|
|
1724
|
+
// #region Styles
|
|
1831
1725
|
styles = pt;
|
|
1726
|
+
// #endregion
|
|
1832
1727
|
}
|
|
1833
1728
|
function z(r, e) {
|
|
1834
1729
|
const t = new Set(r);
|
|
@@ -1865,14 +1760,16 @@ class yn extends x {
|
|
|
1865
1760
|
showExpandColumn: !0
|
|
1866
1761
|
};
|
|
1867
1762
|
}
|
|
1868
|
-
//
|
|
1763
|
+
// #region Internal State
|
|
1869
1764
|
expandedRows = /* @__PURE__ */ new Set();
|
|
1870
1765
|
detailElements = /* @__PURE__ */ new Map();
|
|
1871
|
-
//
|
|
1766
|
+
// #endregion
|
|
1767
|
+
// #region Lifecycle
|
|
1872
1768
|
detach() {
|
|
1873
1769
|
this.expandedRows.clear(), this.detailElements.clear();
|
|
1874
1770
|
}
|
|
1875
|
-
//
|
|
1771
|
+
// #endregion
|
|
1772
|
+
// #region Hooks
|
|
1876
1773
|
processColumns(e) {
|
|
1877
1774
|
if (!this.config.detailRenderer)
|
|
1878
1775
|
return [...e];
|
|
@@ -2013,7 +1910,8 @@ class yn extends x {
|
|
|
2013
1910
|
}
|
|
2014
1911
|
return i;
|
|
2015
1912
|
}
|
|
2016
|
-
//
|
|
1913
|
+
// #endregion
|
|
1914
|
+
// #region Public API
|
|
2017
1915
|
/**
|
|
2018
1916
|
* Expand the detail row at the given index.
|
|
2019
1917
|
* @param rowIndex - Index of the row to expand
|
|
@@ -2082,8 +1980,10 @@ class yn extends x {
|
|
|
2082
1980
|
const t = this.rows[e];
|
|
2083
1981
|
return t ? this.detailElements.get(t) : void 0;
|
|
2084
1982
|
}
|
|
2085
|
-
//
|
|
1983
|
+
// #endregion
|
|
1984
|
+
// #region Styles
|
|
2086
1985
|
styles = vt;
|
|
1986
|
+
// #endregion
|
|
2087
1987
|
}
|
|
2088
1988
|
function xt(r, e, t) {
|
|
2089
1989
|
return e.length ? [...r].sort((n, o) => {
|
|
@@ -2119,13 +2019,15 @@ class Rn extends x {
|
|
|
2119
2019
|
showSortIndex: !0
|
|
2120
2020
|
};
|
|
2121
2021
|
}
|
|
2122
|
-
//
|
|
2022
|
+
// #region Internal State
|
|
2123
2023
|
sortModel = [];
|
|
2124
|
-
//
|
|
2024
|
+
// #endregion
|
|
2025
|
+
// #region Lifecycle
|
|
2125
2026
|
detach() {
|
|
2126
2027
|
this.sortModel = [];
|
|
2127
2028
|
}
|
|
2128
|
-
//
|
|
2029
|
+
// #endregion
|
|
2030
|
+
// #region Hooks
|
|
2129
2031
|
processRows(e) {
|
|
2130
2032
|
return this.sortModel.length === 0 ? [...e] : xt([...e], this.sortModel, [...this.columns]);
|
|
2131
2033
|
}
|
|
@@ -2153,7 +2055,8 @@ class Rn extends x {
|
|
|
2153
2055
|
o.removeAttribute("data-sort");
|
|
2154
2056
|
});
|
|
2155
2057
|
}
|
|
2156
|
-
//
|
|
2058
|
+
// #endregion
|
|
2059
|
+
// #region Public API
|
|
2157
2060
|
/**
|
|
2158
2061
|
* Get the current sort model.
|
|
2159
2062
|
* @returns Copy of the current sort model
|
|
@@ -2190,7 +2093,8 @@ class Rn extends x {
|
|
|
2190
2093
|
getSortDirection(e) {
|
|
2191
2094
|
return be(this.sortModel, e);
|
|
2192
2095
|
}
|
|
2193
|
-
//
|
|
2096
|
+
// #endregion
|
|
2097
|
+
// #region Column State Hooks
|
|
2194
2098
|
/**
|
|
2195
2099
|
* Return sort state for a column if it's in the sort model.
|
|
2196
2100
|
*/
|
|
@@ -2218,8 +2122,10 @@ class Rn extends x {
|
|
|
2218
2122
|
};
|
|
2219
2123
|
n !== -1 ? this.sortModel[n] = o : this.sortModel.splice(t.sort.priority, 0, o);
|
|
2220
2124
|
}
|
|
2221
|
-
//
|
|
2125
|
+
// #endregion
|
|
2126
|
+
// #region Styles
|
|
2222
2127
|
styles = Rt;
|
|
2128
|
+
// #endregion
|
|
2223
2129
|
}
|
|
2224
2130
|
function St(r) {
|
|
2225
2131
|
return r.filter((e) => e.sticky === "left");
|
|
@@ -2269,15 +2175,17 @@ class Sn extends x {
|
|
|
2269
2175
|
get defaultConfig() {
|
|
2270
2176
|
return {};
|
|
2271
2177
|
}
|
|
2272
|
-
//
|
|
2178
|
+
// #region Internal State
|
|
2273
2179
|
isApplied = !1;
|
|
2274
2180
|
leftOffsets = /* @__PURE__ */ new Map();
|
|
2275
2181
|
rightOffsets = /* @__PURE__ */ new Map();
|
|
2276
|
-
//
|
|
2182
|
+
// #endregion
|
|
2183
|
+
// #region Lifecycle
|
|
2277
2184
|
detach() {
|
|
2278
2185
|
this.leftOffsets.clear(), this.rightOffsets.clear(), this.isApplied = !1;
|
|
2279
2186
|
}
|
|
2280
|
-
//
|
|
2187
|
+
// #endregion
|
|
2188
|
+
// #region Detection
|
|
2281
2189
|
/**
|
|
2282
2190
|
* Auto-detect sticky columns from column configuration.
|
|
2283
2191
|
*/
|
|
@@ -2285,7 +2193,8 @@ class Sn extends x {
|
|
|
2285
2193
|
const n = t?.columns;
|
|
2286
2194
|
return Array.isArray(n) ? V(n) : !1;
|
|
2287
2195
|
}
|
|
2288
|
-
//
|
|
2196
|
+
// #endregion
|
|
2197
|
+
// #region Hooks
|
|
2289
2198
|
processColumns(e) {
|
|
2290
2199
|
return this.isApplied = V([...e]), [...e];
|
|
2291
2200
|
}
|
|
@@ -2301,7 +2210,8 @@ class Sn extends x {
|
|
|
2301
2210
|
ve(e, t);
|
|
2302
2211
|
});
|
|
2303
2212
|
}
|
|
2304
|
-
//
|
|
2213
|
+
// #endregion
|
|
2214
|
+
// #region Public API
|
|
2305
2215
|
/**
|
|
2306
2216
|
* Re-apply sticky offsets (e.g., after column resize).
|
|
2307
2217
|
*/
|
|
@@ -2329,6 +2239,7 @@ class Sn extends x {
|
|
|
2329
2239
|
clearStickyPositions() {
|
|
2330
2240
|
xe(this.grid);
|
|
2331
2241
|
}
|
|
2242
|
+
// #endregion
|
|
2332
2243
|
}
|
|
2333
2244
|
function W(r, e) {
|
|
2334
2245
|
const t = document.createElement("div");
|
|
@@ -2424,16 +2335,18 @@ class En extends x {
|
|
|
2424
2335
|
showFilteredCount: !0
|
|
2425
2336
|
};
|
|
2426
2337
|
}
|
|
2427
|
-
//
|
|
2338
|
+
// #region Internal State
|
|
2428
2339
|
infoBarElement = null;
|
|
2429
2340
|
topAggregationContainer = null;
|
|
2430
2341
|
bottomAggregationContainer = null;
|
|
2431
2342
|
footerWrapper = null;
|
|
2432
|
-
//
|
|
2343
|
+
// #endregion
|
|
2344
|
+
// #region Lifecycle
|
|
2433
2345
|
detach() {
|
|
2434
2346
|
this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null), this.topAggregationContainer && (this.topAggregationContainer.remove(), this.topAggregationContainer = null), this.bottomAggregationContainer && (this.bottomAggregationContainer.remove(), this.bottomAggregationContainer = null), this.footerWrapper && (this.footerWrapper.remove(), this.footerWrapper = null);
|
|
2435
2347
|
}
|
|
2436
|
-
//
|
|
2348
|
+
// #endregion
|
|
2349
|
+
// #region Hooks
|
|
2437
2350
|
afterRender() {
|
|
2438
2351
|
const e = this.shadowRoot;
|
|
2439
2352
|
if (!e) return;
|
|
@@ -2475,7 +2388,8 @@ class En extends x {
|
|
|
2475
2388
|
this.rows
|
|
2476
2389
|
)), c && (this.infoBarElement = W(this.config, i), this.footerWrapper.appendChild(this.infoBarElement))) : this.cleanupFooter();
|
|
2477
2390
|
}
|
|
2478
|
-
//
|
|
2391
|
+
// #endregion
|
|
2392
|
+
// #region Private Methods
|
|
2479
2393
|
cleanup() {
|
|
2480
2394
|
this.infoBarElement && (this.infoBarElement.remove(), this.infoBarElement = null), this.topAggregationContainer && (this.topAggregationContainer.remove(), this.topAggregationContainer = null), this.bottomAggregationContainer && (this.bottomAggregationContainer.remove(), this.bottomAggregationContainer = null), this.footerWrapper && (this.footerWrapper.remove(), this.footerWrapper = null);
|
|
2481
2395
|
}
|
|
@@ -2496,7 +2410,8 @@ class En extends x {
|
|
|
2496
2410
|
return null;
|
|
2497
2411
|
}
|
|
2498
2412
|
}
|
|
2499
|
-
//
|
|
2413
|
+
// #endregion
|
|
2414
|
+
// #region Public API
|
|
2500
2415
|
/**
|
|
2501
2416
|
* Refresh the status bar to reflect current grid state.
|
|
2502
2417
|
*/
|
|
@@ -2545,8 +2460,10 @@ class En extends x {
|
|
|
2545
2460
|
removeAggregationRow(e) {
|
|
2546
2461
|
this.config.aggregationRows && (this.config.aggregationRows = this.config.aggregationRows.filter((t) => t.id !== e), this.requestRender());
|
|
2547
2462
|
}
|
|
2548
|
-
//
|
|
2463
|
+
// #endregion
|
|
2464
|
+
// #region Styles
|
|
2549
2465
|
styles = At;
|
|
2466
|
+
// #endregion
|
|
2550
2467
|
}
|
|
2551
2468
|
const _t = Ge;
|
|
2552
2469
|
function It(r) {
|
|
@@ -2949,7 +2866,7 @@ class L extends x {
|
|
|
2949
2866
|
showGrandTotal: !0
|
|
2950
2867
|
};
|
|
2951
2868
|
}
|
|
2952
|
-
//
|
|
2869
|
+
// #region Internal State
|
|
2953
2870
|
isActive = !1;
|
|
2954
2871
|
hasInitialized = !1;
|
|
2955
2872
|
pivotResult = null;
|
|
@@ -2965,11 +2882,13 @@ class L extends x {
|
|
|
2965
2882
|
hasValidPivotConfig() {
|
|
2966
2883
|
return (this.config.valueFields?.length ?? 0) > 0;
|
|
2967
2884
|
}
|
|
2968
|
-
//
|
|
2885
|
+
// #endregion
|
|
2886
|
+
// #region Lifecycle
|
|
2969
2887
|
detach() {
|
|
2970
2888
|
this.isActive = !1, this.hasInitialized = !1, this.pivotResult = null, this.fieldHeaderMap.clear(), this.originalColumns = [], this.panelContainer = null, this.cleanupGrandTotalFooter();
|
|
2971
2889
|
}
|
|
2972
|
-
//
|
|
2890
|
+
// #endregion
|
|
2891
|
+
// #region Shell Integration
|
|
2973
2892
|
getToolPanel() {
|
|
2974
2893
|
return {
|
|
2975
2894
|
id: L.PANEL_ID,
|
|
@@ -2980,7 +2899,8 @@ class L extends x {
|
|
|
2980
2899
|
render: (e) => this.renderPanel(e)
|
|
2981
2900
|
};
|
|
2982
2901
|
}
|
|
2983
|
-
//
|
|
2902
|
+
// #endregion
|
|
2903
|
+
// #region Hooks
|
|
2984
2904
|
processRows(e) {
|
|
2985
2905
|
if (!this.hasInitialized && this.config.active !== !1 && this.hasValidPivotConfig() && (this.hasInitialized = !0, this.isActive = !0), !this.isActive)
|
|
2986
2906
|
return [...e];
|
|
@@ -3086,7 +3006,8 @@ class L extends x {
|
|
|
3086
3006
|
cleanupGrandTotalFooter() {
|
|
3087
3007
|
this.grandTotalFooter && (this.grandTotalFooter.remove(), this.grandTotalFooter = null);
|
|
3088
3008
|
}
|
|
3089
|
-
//
|
|
3009
|
+
// #endregion
|
|
3010
|
+
// #region Expand/Collapse API
|
|
3090
3011
|
toggle(e) {
|
|
3091
3012
|
this.expandedKeys.has(e) ? this.expandedKeys.delete(e) : this.expandedKeys.add(e), this.requestRender();
|
|
3092
3013
|
}
|
|
@@ -3110,7 +3031,8 @@ class L extends x {
|
|
|
3110
3031
|
isExpanded(e) {
|
|
3111
3032
|
return this.expandedKeys.has(e);
|
|
3112
3033
|
}
|
|
3113
|
-
//
|
|
3034
|
+
// #endregion
|
|
3035
|
+
// #region Public API
|
|
3114
3036
|
enablePivot() {
|
|
3115
3037
|
this.originalColumns.length === 0 && this.captureOriginalColumns(), this.isActive = !0, this.requestRender();
|
|
3116
3038
|
}
|
|
@@ -3135,7 +3057,8 @@ class L extends x {
|
|
|
3135
3057
|
refresh() {
|
|
3136
3058
|
this.pivotResult = null, this.requestRender();
|
|
3137
3059
|
}
|
|
3138
|
-
//
|
|
3060
|
+
// #endregion
|
|
3061
|
+
// #region Tool Panel API
|
|
3139
3062
|
showPanel() {
|
|
3140
3063
|
this.grid.openToolPanel(L.PANEL_ID);
|
|
3141
3064
|
}
|
|
@@ -3148,7 +3071,8 @@ class L extends x {
|
|
|
3148
3071
|
isPanelVisible() {
|
|
3149
3072
|
return this.grid.activeToolPanel === L.PANEL_ID;
|
|
3150
3073
|
}
|
|
3151
|
-
//
|
|
3074
|
+
// #endregion
|
|
3075
|
+
// #region Private Helpers
|
|
3152
3076
|
get gridColumns() {
|
|
3153
3077
|
return this.grid.columns ?? [];
|
|
3154
3078
|
}
|
|
@@ -3221,8 +3145,10 @@ class L extends x {
|
|
|
3221
3145
|
const n = this.config.valueFields ?? [], o = n.findIndex((i) => i.field === e);
|
|
3222
3146
|
o >= 0 && (n[o] = { ...n[o], aggFunc: t }, this.config.valueFields = [...n]), this.isActive && this.refresh();
|
|
3223
3147
|
}
|
|
3224
|
-
//
|
|
3148
|
+
// #endregion
|
|
3149
|
+
// #region Styles
|
|
3225
3150
|
styles = Wt;
|
|
3151
|
+
// #endregion
|
|
3226
3152
|
}
|
|
3227
3153
|
function $t(r) {
|
|
3228
3154
|
const e = r.sticky;
|
|
@@ -3246,12 +3172,13 @@ class kn extends x {
|
|
|
3246
3172
|
animationDuration: 200
|
|
3247
3173
|
};
|
|
3248
3174
|
}
|
|
3249
|
-
//
|
|
3175
|
+
// #region Internal State
|
|
3250
3176
|
isDragging = !1;
|
|
3251
3177
|
draggedField = null;
|
|
3252
3178
|
draggedIndex = null;
|
|
3253
3179
|
dropIndex = null;
|
|
3254
|
-
//
|
|
3180
|
+
// #endregion
|
|
3181
|
+
// #region Lifecycle
|
|
3255
3182
|
attach(e) {
|
|
3256
3183
|
super.attach(e), e.addEventListener(
|
|
3257
3184
|
"column-reorder-request",
|
|
@@ -3265,7 +3192,8 @@ class kn extends x {
|
|
|
3265
3192
|
detach() {
|
|
3266
3193
|
this.isDragging = !1, this.draggedField = null, this.draggedIndex = null, this.dropIndex = null;
|
|
3267
3194
|
}
|
|
3268
|
-
//
|
|
3195
|
+
// #endregion
|
|
3196
|
+
// #region Hooks
|
|
3269
3197
|
// Note: No processColumns hook needed - we directly update the grid's column order
|
|
3270
3198
|
afterRender() {
|
|
3271
3199
|
const e = this.shadowRoot;
|
|
@@ -3306,7 +3234,8 @@ class kn extends x {
|
|
|
3306
3234
|
}));
|
|
3307
3235
|
});
|
|
3308
3236
|
}
|
|
3309
|
-
//
|
|
3237
|
+
// #endregion
|
|
3238
|
+
// #region Public API
|
|
3310
3239
|
/**
|
|
3311
3240
|
* Get the current column order from the grid.
|
|
3312
3241
|
* @returns Array of field names in display order
|
|
@@ -3344,8 +3273,10 @@ class kn extends x {
|
|
|
3344
3273
|
const e = this.columns.map((t) => t.field);
|
|
3345
3274
|
this.grid.setColumnOrder(e), this.grid.requestStateChange?.();
|
|
3346
3275
|
}
|
|
3347
|
-
//
|
|
3276
|
+
// #endregion
|
|
3277
|
+
// #region Styles
|
|
3348
3278
|
styles = jt;
|
|
3279
|
+
// #endregion
|
|
3349
3280
|
}
|
|
3350
3281
|
function D(r) {
|
|
3351
3282
|
return {
|
|
@@ -3423,7 +3354,7 @@ class An extends x {
|
|
|
3423
3354
|
mode: "cell"
|
|
3424
3355
|
};
|
|
3425
3356
|
}
|
|
3426
|
-
//
|
|
3357
|
+
// #region Internal State
|
|
3427
3358
|
/** Row selection state (row mode) */
|
|
3428
3359
|
selected = /* @__PURE__ */ new Set();
|
|
3429
3360
|
lastSelected = null;
|
|
@@ -3435,11 +3366,13 @@ class An extends x {
|
|
|
3435
3366
|
isDragging = !1;
|
|
3436
3367
|
/** Cell selection state (cell mode) */
|
|
3437
3368
|
selectedCell = null;
|
|
3438
|
-
//
|
|
3369
|
+
// #endregion
|
|
3370
|
+
// #region Lifecycle
|
|
3439
3371
|
detach() {
|
|
3440
3372
|
this.selected.clear(), this.ranges = [], this.activeRange = null, this.cellAnchor = null, this.isDragging = !1, this.selectedCell = null;
|
|
3441
3373
|
}
|
|
3442
|
-
//
|
|
3374
|
+
// #endregion
|
|
3375
|
+
// #region Event Handlers
|
|
3443
3376
|
onCellClick(e) {
|
|
3444
3377
|
const { rowIndex: t, colIndex: n, originalEvent: o } = e, { mode: i } = this.config;
|
|
3445
3378
|
if (i === "cell")
|
|
@@ -3573,7 +3506,8 @@ class An extends x {
|
|
|
3573
3506
|
onScrollRender() {
|
|
3574
3507
|
this.#t();
|
|
3575
3508
|
}
|
|
3576
|
-
//
|
|
3509
|
+
// #endregion
|
|
3510
|
+
// #region Public API
|
|
3577
3511
|
/**
|
|
3578
3512
|
* Get the selected cell (cell mode only).
|
|
3579
3513
|
*/
|
|
@@ -3624,7 +3558,8 @@ class An extends x {
|
|
|
3624
3558
|
ranges: X(this.ranges)
|
|
3625
3559
|
}), this.requestAfterRender();
|
|
3626
3560
|
}
|
|
3627
|
-
//
|
|
3561
|
+
// #endregion
|
|
3562
|
+
// #region Private Helpers
|
|
3628
3563
|
#e() {
|
|
3629
3564
|
return Qt(
|
|
3630
3565
|
this.config.mode,
|
|
@@ -3636,8 +3571,10 @@ class An extends x {
|
|
|
3636
3571
|
this.columns.length
|
|
3637
3572
|
);
|
|
3638
3573
|
}
|
|
3639
|
-
//
|
|
3574
|
+
// #endregion
|
|
3575
|
+
// #region Styles
|
|
3640
3576
|
styles = Jt;
|
|
3577
|
+
// #endregion
|
|
3641
3578
|
}
|
|
3642
3579
|
function q(r, e) {
|
|
3643
3580
|
return Math.floor(r / e);
|
|
@@ -3680,18 +3617,20 @@ class _n extends x {
|
|
|
3680
3617
|
maxConcurrentRequests: 2
|
|
3681
3618
|
};
|
|
3682
3619
|
}
|
|
3683
|
-
//
|
|
3620
|
+
// #region Internal State
|
|
3684
3621
|
dataSource = null;
|
|
3685
3622
|
totalRowCount = 0;
|
|
3686
3623
|
loadedBlocks = /* @__PURE__ */ new Map();
|
|
3687
3624
|
loadingBlocks = /* @__PURE__ */ new Set();
|
|
3688
3625
|
lastRequestId = 0;
|
|
3689
3626
|
scrollDebounceTimer;
|
|
3690
|
-
//
|
|
3627
|
+
// #endregion
|
|
3628
|
+
// #region Lifecycle
|
|
3691
3629
|
detach() {
|
|
3692
3630
|
this.dataSource = null, this.totalRowCount = 0, this.loadedBlocks.clear(), this.loadingBlocks.clear(), this.lastRequestId = 0, this.scrollDebounceTimer && (clearTimeout(this.scrollDebounceTimer), this.scrollDebounceTimer = void 0);
|
|
3693
3631
|
}
|
|
3694
|
-
//
|
|
3632
|
+
// #endregion
|
|
3633
|
+
// #region Private Methods
|
|
3695
3634
|
/**
|
|
3696
3635
|
* Check current viewport and load any missing blocks.
|
|
3697
3636
|
*/
|
|
@@ -3709,7 +3648,8 @@ class _n extends x {
|
|
|
3709
3648
|
});
|
|
3710
3649
|
}
|
|
3711
3650
|
}
|
|
3712
|
-
//
|
|
3651
|
+
// #endregion
|
|
3652
|
+
// #region Hooks
|
|
3713
3653
|
processRows(e) {
|
|
3714
3654
|
if (!this.dataSource) return [...e];
|
|
3715
3655
|
const t = [];
|
|
@@ -3724,7 +3664,8 @@ class _n extends x {
|
|
|
3724
3664
|
this.loadRequiredBlocks();
|
|
3725
3665
|
}, on));
|
|
3726
3666
|
}
|
|
3727
|
-
//
|
|
3667
|
+
// #endregion
|
|
3668
|
+
// #region Public API
|
|
3728
3669
|
/**
|
|
3729
3670
|
* Set the data source for server-side loading.
|
|
3730
3671
|
* @param dataSource - Data source implementing the getRows method
|
|
@@ -3768,6 +3709,7 @@ class _n extends x {
|
|
|
3768
3709
|
getLoadedBlockCount() {
|
|
3769
3710
|
return this.loadedBlocks.size;
|
|
3770
3711
|
}
|
|
3712
|
+
// #endregion
|
|
3771
3713
|
}
|
|
3772
3714
|
function ne(r, e, t) {
|
|
3773
3715
|
return r.id !== void 0 ? String(r.id) : t ? `${t}-${e}` : String(e);
|
|
@@ -3863,7 +3805,7 @@ class In extends x {
|
|
|
3863
3805
|
showExpandIcons: !0
|
|
3864
3806
|
};
|
|
3865
3807
|
}
|
|
3866
|
-
//
|
|
3808
|
+
// #region Internal State
|
|
3867
3809
|
/** Set of expanded row keys */
|
|
3868
3810
|
expandedKeys = /* @__PURE__ */ new Set();
|
|
3869
3811
|
/** Whether initial expansion (based on defaultExpanded config) has been applied */
|
|
@@ -3872,11 +3814,13 @@ class In extends x {
|
|
|
3872
3814
|
flattenedRows = [];
|
|
3873
3815
|
/** Map from key to flattened row for quick lookup */
|
|
3874
3816
|
rowKeyMap = /* @__PURE__ */ new Map();
|
|
3875
|
-
//
|
|
3817
|
+
// #endregion
|
|
3818
|
+
// #region Lifecycle
|
|
3876
3819
|
detach() {
|
|
3877
3820
|
this.expandedKeys.clear(), this.initialExpansionDone = !1, this.flattenedRows = [], this.rowKeyMap.clear();
|
|
3878
3821
|
}
|
|
3879
|
-
//
|
|
3822
|
+
// #endregion
|
|
3823
|
+
// #region Auto-Detection
|
|
3880
3824
|
/**
|
|
3881
3825
|
* Detects if tree functionality should be enabled based on data structure.
|
|
3882
3826
|
* Called by the grid during plugin initialization.
|
|
@@ -3886,7 +3830,8 @@ class In extends x {
|
|
|
3886
3830
|
const t = this.config.childrenField ?? ln(e) ?? "children";
|
|
3887
3831
|
return Le(e, t);
|
|
3888
3832
|
}
|
|
3889
|
-
//
|
|
3833
|
+
// #endregion
|
|
3834
|
+
// #region Data Processing
|
|
3890
3835
|
processRows(e) {
|
|
3891
3836
|
const t = this.config.childrenField ?? "children";
|
|
3892
3837
|
if (!Le(e, t))
|
|
@@ -3930,7 +3875,8 @@ class In extends x {
|
|
|
3930
3875
|
}
|
|
3931
3876
|
return o;
|
|
3932
3877
|
}
|
|
3933
|
-
//
|
|
3878
|
+
// #endregion
|
|
3879
|
+
// #region Event Handlers
|
|
3934
3880
|
onCellClick(e) {
|
|
3935
3881
|
const t = e.originalEvent?.target;
|
|
3936
3882
|
if (!t?.classList.contains("tree-toggle")) return !1;
|
|
@@ -3944,7 +3890,8 @@ class In extends x {
|
|
|
3944
3890
|
depth: o.depth
|
|
3945
3891
|
}), this.requestRender(), !0) : !1;
|
|
3946
3892
|
}
|
|
3947
|
-
//
|
|
3893
|
+
// #endregion
|
|
3894
|
+
// #region Public API
|
|
3948
3895
|
/**
|
|
3949
3896
|
* Expand a specific node by key.
|
|
3950
3897
|
*/
|
|
@@ -4005,8 +3952,10 @@ class In extends x {
|
|
|
4005
3952
|
expandToKey(e) {
|
|
4006
3953
|
this.expandedKeys = sn(this.rows, e, this.config, this.expandedKeys), this.requestRender();
|
|
4007
3954
|
}
|
|
4008
|
-
//
|
|
3955
|
+
// #endregion
|
|
3956
|
+
// #region Styles
|
|
4009
3957
|
styles = an;
|
|
3958
|
+
// #endregion
|
|
4010
3959
|
}
|
|
4011
3960
|
function dn(r, e, t) {
|
|
4012
3961
|
const n = [...r.undoStack, e];
|
|
@@ -4109,7 +4058,7 @@ class Fn extends x {
|
|
|
4109
4058
|
}
|
|
4110
4059
|
return !1;
|
|
4111
4060
|
}
|
|
4112
|
-
//
|
|
4061
|
+
// #region Public API Methods
|
|
4113
4062
|
/**
|
|
4114
4063
|
* Record a cell edit for undo/redo tracking.
|
|
4115
4064
|
* Call this when a cell value changes.
|
|
@@ -4184,6 +4133,7 @@ class Fn extends x {
|
|
|
4184
4133
|
getRedoStack() {
|
|
4185
4134
|
return [...this.redoStack];
|
|
4186
4135
|
}
|
|
4136
|
+
// #endregion
|
|
4187
4137
|
}
|
|
4188
4138
|
const pn = '.tbw-visibility-content{display:flex;flex-direction:column;height:100%}.tbw-visibility-list{flex:1;overflow-y:auto;padding:8px}.tbw-visibility-row{display:flex;align-items:center;gap:8px;padding:6px 4px;cursor:pointer;font-size:13px;border-radius:var(--tbw-border-radius, 4px);position:relative}.tbw-visibility-row:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}.tbw-visibility-row input[type=checkbox]{cursor:pointer}.tbw-visibility-row.locked span{color:var(--tbw-color-fg-muted, #888)}.tbw-visibility-handle{cursor:grab;color:var(--tbw-color-fg-muted, #888);font-size:10px;letter-spacing:-2px;user-select:none;flex-shrink:0}.tbw-visibility-row.reorderable:hover .tbw-visibility-handle{color:var(--tbw-color-fg, #1f2937)}.tbw-visibility-label{display:flex;align-items:center;gap:8px;flex:1;cursor:pointer}.tbw-visibility-row.dragging{opacity:.5;cursor:grabbing}.tbw-visibility-row.drop-before:before{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-row.drop-after:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--tbw-reorder-indicator, var(--tbw-color-accent, #3b82f6))}.tbw-visibility-show-all{margin:8px;padding:8px 12px;border:1px solid var(--tbw-visibility-border, var(--tbw-color-border, #e5e7eb));border-radius:var(--tbw-border-radius, 4px);background:var(--tbw-visibility-btn-bg, var(--tbw-color-header-bg, #f9fafb));color:var(--tbw-color-fg, #1f2937);cursor:pointer;font-size:13px}.tbw-visibility-show-all:hover{background:var(--tbw-visibility-hover, var(--tbw-color-row-hover, #f3f4f6))}';
|
|
4189
4139
|
function Ne(r) {
|
|
@@ -4200,18 +4150,20 @@ class T extends x {
|
|
|
4200
4150
|
allowHideAll: !1
|
|
4201
4151
|
};
|
|
4202
4152
|
}
|
|
4203
|
-
//
|
|
4153
|
+
// #region Internal State
|
|
4204
4154
|
columnListElement = null;
|
|
4205
4155
|
// Drag state for reorder integration
|
|
4206
4156
|
isDragging = !1;
|
|
4207
4157
|
draggedField = null;
|
|
4208
4158
|
draggedIndex = null;
|
|
4209
4159
|
dropIndex = null;
|
|
4210
|
-
//
|
|
4160
|
+
// #endregion
|
|
4161
|
+
// #region Lifecycle
|
|
4211
4162
|
detach() {
|
|
4212
4163
|
this.columnListElement = null, this.isDragging = !1, this.draggedField = null, this.draggedIndex = null, this.dropIndex = null;
|
|
4213
4164
|
}
|
|
4214
|
-
//
|
|
4165
|
+
// #endregion
|
|
4166
|
+
// #region Shell Integration
|
|
4215
4167
|
/**
|
|
4216
4168
|
* Register the column visibility tool panel with the shell.
|
|
4217
4169
|
*/
|
|
@@ -4226,7 +4178,8 @@ class T extends x {
|
|
|
4226
4178
|
render: (e) => this.renderPanelContent(e)
|
|
4227
4179
|
};
|
|
4228
4180
|
}
|
|
4229
|
-
//
|
|
4181
|
+
// #endregion
|
|
4182
|
+
// #region Public API
|
|
4230
4183
|
/**
|
|
4231
4184
|
* Show the visibility sidebar panel.
|
|
4232
4185
|
*/
|
|
@@ -4323,7 +4276,8 @@ class T extends x {
|
|
|
4323
4276
|
isPanelVisible() {
|
|
4324
4277
|
return this.grid.activeToolPanel === T.PANEL_ID;
|
|
4325
4278
|
}
|
|
4326
|
-
//
|
|
4279
|
+
// #endregion
|
|
4280
|
+
// #region Private Methods
|
|
4327
4281
|
/**
|
|
4328
4282
|
* Render the panel content into the shell's tool panel container.
|
|
4329
4283
|
* Returns a cleanup function.
|
|
@@ -4409,8 +4363,10 @@ class T extends x {
|
|
|
4409
4363
|
}
|
|
4410
4364
|
});
|
|
4411
4365
|
}
|
|
4412
|
-
//
|
|
4366
|
+
// #endregion
|
|
4367
|
+
// #region Styles
|
|
4413
4368
|
styles = pn;
|
|
4369
|
+
// #endregion
|
|
4414
4370
|
}
|
|
4415
4371
|
export {
|
|
4416
4372
|
x as BaseGridPlugin,
|