ngx-deebodata 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -375,6 +375,7 @@ class DataTableService {
|
|
|
375
375
|
mapperWorkerId = 1;
|
|
376
376
|
dTblHeight = 500;
|
|
377
377
|
defltRHgt = "50px";
|
|
378
|
+
defltRHgtNum = 50;
|
|
378
379
|
isSorting = signal(false, ...(ngDevMode ? [{ debugName: "isSorting" }] : /* istanbul ignore next */ []));
|
|
379
380
|
isFiltering = signal(false, ...(ngDevMode ? [{ debugName: "isFiltering" }] : /* istanbul ignore next */ []));
|
|
380
381
|
showCharts = signal(false, ...(ngDevMode ? [{ debugName: "showCharts" }] : /* istanbul ignore next */ []));
|
|
@@ -2393,7 +2394,7 @@ class RowGroupPanel {
|
|
|
2393
2394
|
this.panelData = this.dataTableService.currFilData.filter(d => d[this.dataTableService.currGroup] === this.groupValue);
|
|
2394
2395
|
this.count = this.panelData.length;
|
|
2395
2396
|
let n = 0;
|
|
2396
|
-
const defNum =
|
|
2397
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
2397
2398
|
const init = Math.max(this.dataTableService.dTblHeight / defNum);
|
|
2398
2399
|
const addCell = (text, prop, row, visible) => {
|
|
2399
2400
|
if (prop && row) {
|
|
@@ -2489,8 +2490,7 @@ class RowGroupPanel {
|
|
|
2489
2490
|
}
|
|
2490
2491
|
setLastRowIndex() {
|
|
2491
2492
|
const realMax = this.panelData.length - 1;
|
|
2492
|
-
const
|
|
2493
|
-
const wannabeMax = (this.rows.length - 1) + Math.floor(this.aboveHgt / defNum);
|
|
2493
|
+
const wannabeMax = (this.rows.length - 1) + Math.floor(this.aboveHgt / this.dataTableService.defltRHgtNum);
|
|
2494
2494
|
this.lastElRowIndex = Math.min(wannabeMax, realMax);
|
|
2495
2495
|
return this.lastElRowIndex;
|
|
2496
2496
|
}
|
|
@@ -2555,7 +2555,7 @@ class RowGroupPanel {
|
|
|
2555
2555
|
const top = event.target.scrollTop;
|
|
2556
2556
|
const left = event.target.scrollLeft;
|
|
2557
2557
|
/*horiz scroll*/
|
|
2558
|
-
|
|
2558
|
+
this.execHorizScroll(left);
|
|
2559
2559
|
/*horiz scroll*/
|
|
2560
2560
|
/*vert scroll*/
|
|
2561
2561
|
if (top === this.verticalRest) {
|
|
@@ -2563,7 +2563,7 @@ class RowGroupPanel {
|
|
|
2563
2563
|
return this.setRowNumPlacement();
|
|
2564
2564
|
}
|
|
2565
2565
|
this.isScrolling = true;
|
|
2566
|
-
|
|
2566
|
+
this.execVertScroll(top);
|
|
2567
2567
|
/*vert scroll*/
|
|
2568
2568
|
}
|
|
2569
2569
|
execHorizScroll(left, reverse) {
|
|
@@ -2701,13 +2701,10 @@ class RowGroupPanel {
|
|
|
2701
2701
|
return;
|
|
2702
2702
|
const rTop = (bbds?.top - this.verticalRest);
|
|
2703
2703
|
const gap = this.tblBot - rTop;
|
|
2704
|
-
const defNum =
|
|
2704
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
2705
2705
|
if (gap > 0) {
|
|
2706
2706
|
let h = 0;
|
|
2707
2707
|
let z = this.lastElRowIndex + 1;
|
|
2708
|
-
const last = document.querySelector("#panelDataGrid" + this.elifyGrouping + " #dataTableRow" + this.lastElRowIndex);
|
|
2709
|
-
if (last && this.dataTableService.elIsBelowFold(last, this.tblBot))
|
|
2710
|
-
return;
|
|
2711
2708
|
let bhToSub = 0;
|
|
2712
2709
|
let ahToAdd = 0;
|
|
2713
2710
|
const rowsInGap = Math.ceil(gap / defNum);
|
|
@@ -2745,10 +2742,10 @@ class RowGroupPanel {
|
|
|
2745
2742
|
}
|
|
2746
2743
|
h += 1;
|
|
2747
2744
|
}
|
|
2748
|
-
if (rowsToAdd.length)
|
|
2749
|
-
this.rows = [...this.rows, ...rowsToAdd];
|
|
2750
2745
|
if (bhToSub)
|
|
2751
2746
|
this.belowHgt -= bhToSub;
|
|
2747
|
+
if (rowsToAdd.length)
|
|
2748
|
+
this.rows = [...this.rows, ...rowsToAdd];
|
|
2752
2749
|
if (this.showRowNumbers)
|
|
2753
2750
|
this.rowNums = [...this.rowNums, ...numsToAdd];
|
|
2754
2751
|
if (ahToAdd)
|
|
@@ -2761,7 +2758,7 @@ class RowGroupPanel {
|
|
|
2761
2758
|
const lastVisInd = this.columns.indexOf(this.dataTableService.visibleCols[(vlen - 1)]) + 1;
|
|
2762
2759
|
const ael = this.aboveArea?.nativeElement;
|
|
2763
2760
|
const abds = ael?.getBoundingClientRect();
|
|
2764
|
-
const defNum =
|
|
2761
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
2765
2762
|
const rbot = abds?.bottom || 0;
|
|
2766
2763
|
const gap = rbot - this.tblTop;
|
|
2767
2764
|
if (gap > 0) {
|
|
@@ -2772,6 +2769,7 @@ class RowGroupPanel {
|
|
|
2772
2769
|
return;
|
|
2773
2770
|
let bhToAdd = 0;
|
|
2774
2771
|
let ahToSub = 0;
|
|
2772
|
+
let mRows = [...this.rows];
|
|
2775
2773
|
const rowsInGap = Math.ceil(gap / defNum);
|
|
2776
2774
|
const min = Math.max(0, (z - rowsInGap));
|
|
2777
2775
|
for (z; z >= min; z--) {
|
|
@@ -2796,7 +2794,7 @@ class RowGroupPanel {
|
|
|
2796
2794
|
cells.push(cell);
|
|
2797
2795
|
}
|
|
2798
2796
|
nRow.cells = [...cells];
|
|
2799
|
-
|
|
2797
|
+
mRows = [nRow, ...mRows];
|
|
2800
2798
|
if (this.showRowNumbers)
|
|
2801
2799
|
this.rowNums = [(z + 1), ...this.rowNums];
|
|
2802
2800
|
ahToSub += defNum;
|
|
@@ -2805,9 +2803,9 @@ class RowGroupPanel {
|
|
|
2805
2803
|
}
|
|
2806
2804
|
h += 1;
|
|
2807
2805
|
}
|
|
2808
|
-
if (ahToSub)
|
|
2806
|
+
if (ahToSub)
|
|
2809
2807
|
this.aboveHgt -= ahToSub;
|
|
2810
|
-
|
|
2808
|
+
this.rows = [...mRows];
|
|
2811
2809
|
if (bhToAdd)
|
|
2812
2810
|
this.belowHgt += bhToAdd;
|
|
2813
2811
|
}
|
|
@@ -2818,13 +2816,12 @@ class RowGroupPanel {
|
|
|
2818
2816
|
const changes = justids.length;
|
|
2819
2817
|
if (changes > 0) {
|
|
2820
2818
|
const justindx = els.map((e, i) => i);
|
|
2821
|
-
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2822
2819
|
this.rows = this.rows.filter(r => !justids.includes(r.id));
|
|
2823
2820
|
if (this.showRowNumbers)
|
|
2824
2821
|
this.rowNums = this.rowNums.filter((c, i) => !justindx.includes(i));
|
|
2825
2822
|
const item = this.dataTableService.mainData[(this.rows[0]?.index || -1)];
|
|
2826
2823
|
if (item)
|
|
2827
|
-
this.aboveHgt = this.dataTableService.findObjIndxInData(item, this.panelData) *
|
|
2824
|
+
this.aboveHgt = this.dataTableService.findObjIndxInData(item, this.panelData) * this.dataTableService.defltRHgtNum;
|
|
2828
2825
|
}
|
|
2829
2826
|
}
|
|
2830
2827
|
clearBelowFoldRows() {
|
|
@@ -2832,7 +2829,6 @@ class RowGroupPanel {
|
|
|
2832
2829
|
const justids = els.map(e => e.id);
|
|
2833
2830
|
let changes = justids.length;
|
|
2834
2831
|
if (changes > 0) {
|
|
2835
|
-
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2836
2832
|
this.rows = this.rows.filter(r => !justids.includes(r.id));
|
|
2837
2833
|
if (this.showRowNumbers) {
|
|
2838
2834
|
for (let p = (changes - 1); p >= 0; p--)
|
|
@@ -2841,7 +2837,7 @@ class RowGroupPanel {
|
|
|
2841
2837
|
const rlen = this.rows.length;
|
|
2842
2838
|
const item = this.dataTableService.mainData[(this.rows[(rlen - 1)]?.index || -1)];
|
|
2843
2839
|
if (item)
|
|
2844
|
-
this.belowHgt = ((this.panelData.length - 1) - this.dataTableService.findObjIndxInData(item, this.panelData)) *
|
|
2840
|
+
this.belowHgt = ((this.panelData.length - 1) - this.dataTableService.findObjIndxInData(item, this.panelData)) * this.dataTableService.defltRHgtNum;
|
|
2845
2841
|
this.setLastRowIndex();
|
|
2846
2842
|
}
|
|
2847
2843
|
}
|
|
@@ -4873,8 +4869,10 @@ class NgxDeebodata {
|
|
|
4873
4869
|
this.handleValidation();
|
|
4874
4870
|
}
|
|
4875
4871
|
execSetters() {
|
|
4876
|
-
if (this.defRowHgt && /\d+px/g.test(this.defRowHgt))
|
|
4872
|
+
if (this.defRowHgt && /\d+px/g.test(this.defRowHgt)) {
|
|
4877
4873
|
this.dataTableService.defltRHgt = this.defRowHgt;
|
|
4874
|
+
this.dataTableService.defltRHgtNum = parseInt(this.defRowHgt.replace(/[ ]?(px|vh|\%)/g, ""));
|
|
4875
|
+
}
|
|
4878
4876
|
if (this.defGridHgt)
|
|
4879
4877
|
this.dataTableService.dTblHeight = this.defGridHgt;
|
|
4880
4878
|
if (this.myColumnSymbols)
|
|
@@ -5423,8 +5421,7 @@ class NgxDeebodata {
|
|
|
5423
5421
|
}
|
|
5424
5422
|
setLastRowIndex() {
|
|
5425
5423
|
const realMax = this.dataTableService.currFilData.length - 1;
|
|
5426
|
-
const
|
|
5427
|
-
const wannabeMax = (this.rows.length - 1) + Math.floor(this.aboveHgt() / defNum);
|
|
5424
|
+
const wannabeMax = (this.rows.length - 1) + Math.floor(this.aboveHgt() / this.dataTableService.defltRHgtNum);
|
|
5428
5425
|
this.lastElRowIndex = Math.min(wannabeMax, realMax);
|
|
5429
5426
|
return this.lastElRowIndex;
|
|
5430
5427
|
}
|
|
@@ -5436,7 +5433,7 @@ class NgxDeebodata {
|
|
|
5436
5433
|
const len = data.length;
|
|
5437
5434
|
const colLen = cols.length;
|
|
5438
5435
|
this.maxCols = this.setMaxCols();
|
|
5439
|
-
const defNum =
|
|
5436
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
5440
5437
|
const init = Math.max(this.dataTableService.dTblHeight / defNum);
|
|
5441
5438
|
this.dataTableService.useColWid = Math.ceil((this.dataTableBody.nativeElement.getBoundingClientRect().width - 16) / Math.min(colLen, this.maxCols)) + "px";
|
|
5442
5439
|
for (i; i < colLen; i++) {
|
|
@@ -5907,13 +5904,10 @@ class NgxDeebodata {
|
|
|
5907
5904
|
const bbds = bel.getBoundingClientRect();
|
|
5908
5905
|
const rTop = (bbds.top - this.verticalRest);
|
|
5909
5906
|
const gap = this.dataTableService.tblBot - rTop;
|
|
5910
|
-
const defNum =
|
|
5907
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
5911
5908
|
if (gap > 0) {
|
|
5912
5909
|
let h = 0;
|
|
5913
5910
|
let z = this.lastElRowIndex + 1;
|
|
5914
|
-
// const last = document.getElementById("dataTableRow" + this.lastElRowIndex)
|
|
5915
|
-
// if(last && this.dataTableService.elIsBelowFold(last, this.dataTableService.tblBot))
|
|
5916
|
-
// return;
|
|
5917
5911
|
let bhToSub = 0;
|
|
5918
5912
|
let ahToAdd = 0;
|
|
5919
5913
|
const rowsInGap = Math.ceil(gap / defNum);
|
|
@@ -5966,7 +5960,7 @@ class NgxDeebodata {
|
|
|
5966
5960
|
const lastVisInd = actvCols.indexOf(this.dataTableService.visibleCols[(vlen - 1)]) + 1;
|
|
5967
5961
|
const ael = this.aboveArea.nativeElement;
|
|
5968
5962
|
const abds = ael.getBoundingClientRect();
|
|
5969
|
-
const defNum =
|
|
5963
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
5970
5964
|
const rbot = abds.bottom;
|
|
5971
5965
|
const gap = rbot - (this.dataTableService.tblTop);
|
|
5972
5966
|
if (gap > 0) {
|
|
@@ -6014,9 +6008,9 @@ class NgxDeebodata {
|
|
|
6014
6008
|
if (ahToSub)
|
|
6015
6009
|
this.aboveHgt.set(Math.max(0, (this.aboveHgt() - ahToSub)));
|
|
6016
6010
|
this.rows = [...mRows];
|
|
6017
|
-
this.dtChecks = [...mChks];
|
|
6018
6011
|
if (bhToAdd)
|
|
6019
6012
|
this.belowHgt.set(this.belowHgt() + bhToAdd);
|
|
6013
|
+
this.dtChecks = [...mChks];
|
|
6020
6014
|
}
|
|
6021
6015
|
}
|
|
6022
6016
|
clearAboveFoldRows() {
|
|
@@ -6025,12 +6019,11 @@ class NgxDeebodata {
|
|
|
6025
6019
|
const justindx = els.map(e => e.index);
|
|
6026
6020
|
const changes = justids.length;
|
|
6027
6021
|
if (changes > 0) {
|
|
6028
|
-
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
6029
6022
|
this.rows = this.rows.filter(r => justids.indexOf(r.id) < 0);
|
|
6030
6023
|
this.dtChecks = this.dtChecks.filter(c => justindx.indexOf(c) < 0);
|
|
6031
6024
|
const item = this.dataTableService.mainData[(this.rows[0]?.index || -1)];
|
|
6032
6025
|
if (item)
|
|
6033
|
-
this.aboveHgt.set(Math.max(0, this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData) *
|
|
6026
|
+
this.aboveHgt.set(Math.max(0, this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData) * this.dataTableService.defltRHgtNum));
|
|
6034
6027
|
}
|
|
6035
6028
|
}
|
|
6036
6029
|
clearBelowFoldRows() {
|
|
@@ -6039,13 +6032,12 @@ class NgxDeebodata {
|
|
|
6039
6032
|
const justindx = els.map(e => e.index);
|
|
6040
6033
|
let changes = justids.length;
|
|
6041
6034
|
if (changes > 0) {
|
|
6042
|
-
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
6043
6035
|
this.rows = this.rows.filter(r => justids.indexOf(r.id) < 0);
|
|
6044
6036
|
this.dtChecks = this.dtChecks.filter(c => justindx.indexOf(c) < 0);
|
|
6045
6037
|
const rlen = this.rows.length;
|
|
6046
6038
|
const item = this.dataTableService.mainData[(this.rows[(rlen - 1)]?.index || -1)];
|
|
6047
6039
|
if (item)
|
|
6048
|
-
this.belowHgt.set(Math.max(0, ((this.dataTableService.currFilData.length - 1) - this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData)) *
|
|
6040
|
+
this.belowHgt.set(Math.max(0, ((this.dataTableService.currFilData.length - 1) - this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData)) * this.dataTableService.defltRHgtNum));
|
|
6049
6041
|
this.setLastRowIndex();
|
|
6050
6042
|
}
|
|
6051
6043
|
}
|
|
@@ -6053,8 +6045,7 @@ class NgxDeebodata {
|
|
|
6053
6045
|
if (this.dataTableBody) {
|
|
6054
6046
|
const ind = row - 1;
|
|
6055
6047
|
const tbl = this.dataTableBody.nativeElement;
|
|
6056
|
-
|
|
6057
|
-
tbl.scrollTop = ind * defNum;
|
|
6048
|
+
tbl.scrollTop = ind * this.dataTableService.defltRHgtNum;
|
|
6058
6049
|
setTimeout(() => { this.setRowSelChecksPlacement(true); });
|
|
6059
6050
|
}
|
|
6060
6051
|
}
|
|
@@ -6629,7 +6620,7 @@ class NgxDeebodata {
|
|
|
6629
6620
|
}
|
|
6630
6621
|
this.lastElRowIndex = 0;
|
|
6631
6622
|
let n = 0;
|
|
6632
|
-
const defNum =
|
|
6623
|
+
const defNum = this.dataTableService.defltRHgtNum;
|
|
6633
6624
|
const init = Math.max(this.dataTableService.dTblHeight / defNum);
|
|
6634
6625
|
const len = this.dataTableService.currFilData.length;
|
|
6635
6626
|
if (!len) { //always just add 1
|