ngx-deebodata 0.0.2 → 0.0.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/fesm2022/ngx-deebodata.mjs +6863 -0
- package/fesm2022/ngx-deebodata.mjs.map +1 -0
- package/package.json +35 -16
- package/types/ngx-deebodata.d.ts +439 -0
- package/ng-package.json +0 -7
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.css +0 -156
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.html +0 -29
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.ts +0 -286
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.css +0 -27
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.html +0 -53
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.spec.ts +0 -23
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.ts +0 -214
- package/src/lib/data-table/charts/column-chart/column-chart.css +0 -19
- package/src/lib/data-table/charts/column-chart/column-chart.html +0 -47
- package/src/lib/data-table/charts/column-chart/column-chart.spec.ts +0 -23
- package/src/lib/data-table/charts/column-chart/column-chart.ts +0 -178
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.css +0 -33
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.html +0 -59
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.ts +0 -661
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.css +0 -61
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.html +0 -27
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.spec.ts +0 -23
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.ts +0 -210
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.css +0 -0
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.html +0 -15
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.ts +0 -197
- package/src/lib/data-table/data-table-module/data-cell/data-cell.css +0 -0
- package/src/lib/data-table/data-table-module/data-cell/data-cell.html +0 -6
- package/src/lib/data-table/data-table-module/data-cell/data-cell.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-cell/data-cell.ts +0 -271
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.css +0 -25
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.html +0 -55
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.ts +0 -261
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.css +0 -69
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.html +0 -24
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.ts +0 -125
- package/src/lib/data-table/data-table-module/export-component/export-component.css +0 -91
- package/src/lib/data-table/data-table-module/export-component/export-component.html +0 -16
- package/src/lib/data-table/data-table-module/export-component/export-component.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/export-component/export-component.ts +0 -206
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.css +0 -91
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.html +0 -193
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.ts +0 -2226
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.css +0 -14
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.html +0 -27
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.ts +0 -58
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.css +0 -23
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.html +0 -48
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.ts +0 -599
- package/src/lib/data-table/data-table-module/worker.worker.ts +0 -44
- package/src/lib/interfaces/cell-edit.ts +0 -5
- package/src/lib/interfaces/column-header.ts +0 -10
- package/src/lib/interfaces/column-styles.ts +0 -14
- package/src/lib/interfaces/column-symbol.ts +0 -4
- package/src/lib/interfaces/data-cell.ts +0 -14
- package/src/lib/interfaces/data-row.ts +0 -11
- package/src/lib/interfaces/row-number.ts +0 -4
- package/src/lib/services/common-service.spec.ts +0 -16
- package/src/lib/services/common-service.ts +0 -336
- package/src/lib/services/data-table-service.spec.ts +0 -16
- package/src/lib/services/data-table-service.ts +0 -597
- package/src/lib/services/table-drag-service.spec.ts +0 -16
- package/src/lib/services/table-drag-service.ts +0 -347
- package/src/lib/styles.css +0 -1065
- package/src/public-api.ts +0 -8
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { DataTableService } from './data-table-service';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import { CommonService } from './common-service';
|
|
5
|
-
|
|
6
|
-
@Injectable({
|
|
7
|
-
providedIn: 'root'
|
|
8
|
-
})
|
|
9
|
-
export class TableDragService {
|
|
10
|
-
|
|
11
|
-
constructor(private dataTableService: DataTableService,
|
|
12
|
-
private common: CommonService,
|
|
13
|
-
) {}
|
|
14
|
-
|
|
15
|
-
currDataRow: any;
|
|
16
|
-
currColForDataRow: any;
|
|
17
|
-
dTblHeight: number = 500;
|
|
18
|
-
currColumnEdit: string = ""
|
|
19
|
-
listenForMouseUp: boolean = false;
|
|
20
|
-
listenForSelectStart: boolean = false;
|
|
21
|
-
listenForColMvMouseUp: boolean = false;
|
|
22
|
-
colDragStartFrmHeaderTracker: any = { col: null, xstart: null, ystart: null, resized: false }
|
|
23
|
-
colDragStartFrmCellTracker: any = { col: null, row: null, xstart: null, ystart: null, resized: false }
|
|
24
|
-
tblDragStartFrmPagiTracker: any = { row: null, ystart: null, resized: false }
|
|
25
|
-
didResizeOnEvent: boolean = false
|
|
26
|
-
colMoving: boolean = false
|
|
27
|
-
headDims: Subject<any> = new Subject()
|
|
28
|
-
cellDims: Subject<any> = new Subject()
|
|
29
|
-
columnMove: Subject<any> = new Subject()
|
|
30
|
-
dTblHeightOutput: Subject<number> = new Subject()
|
|
31
|
-
|
|
32
|
-
checkItemBorderCursor(e: MouseEvent, noColResize?: boolean) {
|
|
33
|
-
try{
|
|
34
|
-
if(this.colMoving)
|
|
35
|
-
return
|
|
36
|
-
const el = e.target
|
|
37
|
-
if(el instanceof Element && /(col-header|data-cell)/g.test(el.className)){
|
|
38
|
-
const offsx = 11; const offsy = 9;
|
|
39
|
-
const cls = "moveable-col"
|
|
40
|
-
const rcls = "moveable-row"
|
|
41
|
-
const bds = el.getBoundingClientRect()
|
|
42
|
-
if(noColResize){
|
|
43
|
-
} else {
|
|
44
|
-
if(e.offsetX >= bds.width-offsx){
|
|
45
|
-
el.classList.add(cls)
|
|
46
|
-
el.classList.remove(rcls)
|
|
47
|
-
} else {
|
|
48
|
-
el.classList.remove(cls)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if(e.offsetY >= bds.height-offsy){
|
|
52
|
-
el.classList.add(rcls)
|
|
53
|
-
el.classList.remove(cls)
|
|
54
|
-
} else {
|
|
55
|
-
el.classList.remove(rcls)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}catch(err){}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
checkPaginatorBorderCursor(e: MouseEvent) {
|
|
62
|
-
try{
|
|
63
|
-
const el = e.target
|
|
64
|
-
if(el instanceof Element && /data-table-footer/g.test(el.className)){
|
|
65
|
-
const offsy = 9;
|
|
66
|
-
const rcls = "moveable-row"
|
|
67
|
-
const bds = el.getBoundingClientRect()
|
|
68
|
-
if(e.offsetY >= bds.height-offsy){
|
|
69
|
-
el.classList.add(rcls)
|
|
70
|
-
} else {
|
|
71
|
-
el.classList.remove(rcls)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}catch(err){}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
handleHeaderSizeAdjust(e: any) {
|
|
78
|
-
e && e.preventDefault()
|
|
79
|
-
let col
|
|
80
|
-
const cls = "moveable-col"
|
|
81
|
-
const rcls = "moveable-row"
|
|
82
|
-
const clist = e.target.classList
|
|
83
|
-
if(e.type === "mousedown"){
|
|
84
|
-
if(e && e.target.id && /columnHeader/g.test(e.target.id))
|
|
85
|
-
col = e.target
|
|
86
|
-
if(e && e.target.parentElement.id && /columnHeader/g.test(e.target.parentElement.id))
|
|
87
|
-
col = e.target.parentElement
|
|
88
|
-
if(col){
|
|
89
|
-
const cBds = col.getBoundingClientRect()
|
|
90
|
-
if(clist.contains(cls)){
|
|
91
|
-
let rootCol;
|
|
92
|
-
let useX = e.offsetX
|
|
93
|
-
if(useX > ((cBds.right-cBds.left)/2)){//the one we're aiming for IS the target
|
|
94
|
-
useX = (useX - cBds.width)
|
|
95
|
-
rootCol = col.id.replace(/columnHeader/g, "")
|
|
96
|
-
} else {
|
|
97
|
-
if(!col.nextElementSibling && (e.offsetX > ((cBds.right-cBds.left)/2)))//last and grabbing the end of it
|
|
98
|
-
rootCol = col.id.replace(/columnHeader/g, "")
|
|
99
|
-
else
|
|
100
|
-
rootCol = col.previousElementSibling.id.replace(/columnHeader/g, "")
|
|
101
|
-
}
|
|
102
|
-
this.dataTableService.currColumnEdit =rootCol
|
|
103
|
-
this.colDragStartFrmHeaderTracker = { col: rootCol, xstart: useX, ystart: null, resized: false }
|
|
104
|
-
this.listenForMouseUp = true
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if(clist.contains(rcls)){
|
|
108
|
-
this.dataTableService.currColumnEdit = null
|
|
109
|
-
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: e.pageY, resized: false }
|
|
110
|
-
this.listenForMouseUp = true
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if(!clist.contains(cls) && !clist.contains(rcls)){//drag column to diff position
|
|
114
|
-
let rootCol;
|
|
115
|
-
this.colMoving = true
|
|
116
|
-
rootCol = col.id.replace(/columnHeader/g, "")
|
|
117
|
-
this.dataTableService.currColumnEdit =rootCol
|
|
118
|
-
this.colDragStartFrmHeaderTracker = { col: rootCol, xstart: null, ystart: null, resized: false }
|
|
119
|
-
this.listenForColMvMouseUp = true
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if(e.type === "mousemove"){
|
|
125
|
-
if(!this.colMoving){
|
|
126
|
-
if(this.colDragStartFrmHeaderTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmHeaderTracker.col)
|
|
127
|
-
this.doHeaderWidth(e)
|
|
128
|
-
|
|
129
|
-
if(this.colDragStartFrmHeaderTracker.ystart)
|
|
130
|
-
this.doHeaderHeight(e)
|
|
131
|
-
} else {
|
|
132
|
-
if(this.listenForColMvMouseUp)
|
|
133
|
-
this.handleColMoveMouseUp(e)
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
handleCellSizeAdjust(e: any, rootCol?: string) {
|
|
139
|
-
let col
|
|
140
|
-
const cls = "moveable-col"
|
|
141
|
-
const rcls = "moveable-row"
|
|
142
|
-
const clist = e.target.classList
|
|
143
|
-
if(e.type === "mousedown" && /data-cell/g.test(e.target.className)){
|
|
144
|
-
if(e && e.target && /data-cell/g.test(e.target.className))
|
|
145
|
-
col = e.target
|
|
146
|
-
if(e && e.target.parentElement && /data-cell/g.test(e.target.parentElement.className))
|
|
147
|
-
col = e.target.parentElement
|
|
148
|
-
if(clist.contains(cls)){
|
|
149
|
-
if(col){
|
|
150
|
-
let useX = e.offsetX
|
|
151
|
-
const cBds = col.getBoundingClientRect()
|
|
152
|
-
if(useX > ((cBds.right-cBds.left)/2)){//the one we're aiming for IS the target
|
|
153
|
-
useX = (useX - cBds.width)
|
|
154
|
-
}
|
|
155
|
-
if(rootCol){
|
|
156
|
-
this.dataTableService.currColumnEdit =rootCol
|
|
157
|
-
this.colDragStartFrmCellTracker = { col: rootCol, row: null, xstart: useX, ystart:null, resized: false }
|
|
158
|
-
this.listenForMouseUp = true
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if(clist.contains(rcls)){
|
|
164
|
-
this.dataTableService.currColumnEdit = null
|
|
165
|
-
if(!this.currDataRow){
|
|
166
|
-
this.currColForDataRow = rootCol//this lets us process the sub once on a given cell
|
|
167
|
-
this.currDataRow = document.getElementById(col.getAttribute("data-index"))
|
|
168
|
-
}
|
|
169
|
-
this.colDragStartFrmCellTracker = { col: null, row: this.currDataRow, xstart: null, ystart: e.offsetY, resized: false }
|
|
170
|
-
this.listenForMouseUp = true
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if(e.type === "mousemove"){
|
|
174
|
-
if(this.colDragStartFrmCellTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmCellTracker.col)
|
|
175
|
-
this.doCellWidth(e)
|
|
176
|
-
|
|
177
|
-
if(this.colDragStartFrmCellTracker.row && this.colDragStartFrmCellTracker.ystart)
|
|
178
|
-
this.doRowHeight(e)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
handleTableHeightAdjust(e: any) {
|
|
183
|
-
const rcls = "moveable-row"
|
|
184
|
-
const clist = e.target.classList
|
|
185
|
-
if(e.type === "mousedown" && /data-table-footer/g.test(e.target.className)){
|
|
186
|
-
this.listenForSelectStart = true
|
|
187
|
-
if(clist.contains(rcls)){
|
|
188
|
-
this.tblDragStartFrmPagiTracker = { row: e.target, ystart: e.offsetY, resized: false }
|
|
189
|
-
this.listenForMouseUp = true
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if(e.type === "mousemove"){
|
|
193
|
-
if(this.tblDragStartFrmPagiTracker.row && this.tblDragStartFrmPagiTracker.ystart)
|
|
194
|
-
this.doTblHeight(e)
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
doHeaderWidth(e: any) {
|
|
199
|
-
try{
|
|
200
|
-
const head = document.getElementById("columnHeader" + this.colDragStartFrmHeaderTracker.col)
|
|
201
|
-
if(head){
|
|
202
|
-
const hbds = head?.getBoundingClientRect()
|
|
203
|
-
const useWid = e.pageX - (hbds.left+window.scrollX)
|
|
204
|
-
this.colDragStartFrmHeaderTracker.resized = true
|
|
205
|
-
this.headDims.next({ prop: "width", value: Math.floor(Math.max(30, useWid)) })
|
|
206
|
-
}
|
|
207
|
-
}catch(err){}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
doHeaderHeight(e: any) {
|
|
211
|
-
try{
|
|
212
|
-
const hdrs = document.querySelector(".col-header:not(.col-header-minimized)") || document.getElementById("dataTableHeaders")
|
|
213
|
-
if(hdrs){
|
|
214
|
-
const hdrbds = hdrs.getBoundingClientRect()
|
|
215
|
-
const useHgt= e.pageY - (hdrbds.top+window.scrollY)
|
|
216
|
-
this.colDragStartFrmHeaderTracker.resized = true
|
|
217
|
-
this.headDims.next({ prop: "height", value: Math.floor(Math.max(30, useHgt)) })
|
|
218
|
-
}
|
|
219
|
-
}catch(err){}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
doCellWidth(e: any) {
|
|
223
|
-
try{
|
|
224
|
-
const head = document.getElementById("columnHeader" + this.colDragStartFrmCellTracker.col)//this looks outta place but is ok here
|
|
225
|
-
if(head){
|
|
226
|
-
const useWid = e.pageX - (head.getBoundingClientRect().left+window.scrollX)
|
|
227
|
-
this.colDragStartFrmCellTracker.resized = true
|
|
228
|
-
this.cellDims.next({ prop: "width", value: Math.floor(Math.max(30, useWid)) })
|
|
229
|
-
}
|
|
230
|
-
}catch(err){}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
doRowHeight(e: any) {
|
|
234
|
-
try{
|
|
235
|
-
const rowbds = this.colDragStartFrmCellTracker.row.getBoundingClientRect()
|
|
236
|
-
const useHgt = e.pageY - (rowbds.top+window.scrollY)
|
|
237
|
-
this.colDragStartFrmCellTracker.resized = true
|
|
238
|
-
this.cellDims.next({ row: this.colDragStartFrmCellTracker.row, prop: "height", value: Math.floor(Math.max(30, useHgt)) })
|
|
239
|
-
}catch(err){}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
doTblHeight(e: any) {
|
|
243
|
-
try{
|
|
244
|
-
const rowbds = this.tblDragStartFrmPagiTracker.row.getBoundingClientRect()
|
|
245
|
-
const useHgt = e.pageY - (rowbds.bottom+window.scrollY)
|
|
246
|
-
this.tblDragStartFrmPagiTracker.resized = true
|
|
247
|
-
let max = 1000
|
|
248
|
-
if(isNaN(max))
|
|
249
|
-
max = 700;
|
|
250
|
-
const tblWant = Math.min((this.dTblHeight + useHgt), max);
|
|
251
|
-
this.dTblHeight = Math.floor(Math.max(tblWant, 100))
|
|
252
|
-
this.dTblHeightOutput.next(this.dTblHeight)
|
|
253
|
-
}catch(err){}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
handleColResMouseUp(e: any) {
|
|
257
|
-
try{ e && e.preventDefault() } catch(e) {}
|
|
258
|
-
if(this.colMoving)
|
|
259
|
-
return;
|
|
260
|
-
this.listenForMouseUp = false
|
|
261
|
-
if(this.colDragStartFrmHeaderTracker.ystart)
|
|
262
|
-
this.doHeaderHeight(e)
|
|
263
|
-
if(this.colDragStartFrmCellTracker.ystart)
|
|
264
|
-
this.doRowHeight(e)
|
|
265
|
-
if(this.colDragStartFrmHeaderTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmHeaderTracker.col)
|
|
266
|
-
this.doHeaderWidth(e)
|
|
267
|
-
if(this.colDragStartFrmCellTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmCellTracker.col)
|
|
268
|
-
this.doCellWidth(e)
|
|
269
|
-
if(this.tblDragStartFrmPagiTracker.ystart){
|
|
270
|
-
this.doTblHeight(e)
|
|
271
|
-
this.listenForSelectStart = false
|
|
272
|
-
}
|
|
273
|
-
this.didResizeOnEvent = (this.colDragStartFrmCellTracker.resized ||
|
|
274
|
-
this.colDragStartFrmHeaderTracker.resized || this.tblDragStartFrmPagiTracker.resized)
|
|
275
|
-
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: null, resized: false }
|
|
276
|
-
this.colDragStartFrmCellTracker = { col: null, row: null, xstart: null, ystart: null, resized: false }
|
|
277
|
-
this.tblDragStartFrmPagiTracker = { row: null, ystart: null, resized: false }
|
|
278
|
-
this.currDataRow = null;
|
|
279
|
-
this.currColForDataRow = null
|
|
280
|
-
if(window.getSelection)
|
|
281
|
-
window.getSelection()?.removeAllRanges();
|
|
282
|
-
if(this.dataTableService.currColumnEdit){
|
|
283
|
-
const prop = this.common.replaceUniSep(this.dataTableService.currColumnEdit)
|
|
284
|
-
if(this.dataTableService.dataFilSrtTracker[prop] && this.dataTableService.dataFilSrtTracker[prop].colWidth){
|
|
285
|
-
const useWid = Math.min(2500, (parseInt(this.dataTableService.dataFilSrtTracker[prop].colWidth.replace(/[ ]?px/g, ""))))
|
|
286
|
-
this.cellDims.next({ prop: "width", value: (Math.floor(Math.max(50, useWid))) })
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
setTimeout( () => { //let the click event process first
|
|
290
|
-
this.dataTableService.currColumnEdit = null
|
|
291
|
-
this.didResizeOnEvent = false
|
|
292
|
-
if(window.getSelection)
|
|
293
|
-
window.getSelection()?.removeAllRanges();
|
|
294
|
-
})
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
handleColMoveMouseUp(e: any) {
|
|
298
|
-
try{ e && e.preventDefault() } catch(e) {}
|
|
299
|
-
const isMUp = e && e.type === "mouseup";
|
|
300
|
-
if(isMUp){
|
|
301
|
-
this.listenForColMvMouseUp = false
|
|
302
|
-
this.didResizeOnEvent = true
|
|
303
|
-
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: null, resized: false }
|
|
304
|
-
}
|
|
305
|
-
if(this.colMoving){
|
|
306
|
-
if(window.getSelection)
|
|
307
|
-
window.getSelection()?.removeAllRanges();
|
|
308
|
-
if(this.dataTableService.currColumnEdit){
|
|
309
|
-
const colRef = document.getElementById("columnHeader" + this.dataTableService.currColumnEdit)
|
|
310
|
-
if(colRef){
|
|
311
|
-
let xDrop = e.clientX
|
|
312
|
-
let i = 0;
|
|
313
|
-
let lfts = []
|
|
314
|
-
let wantlfts = []
|
|
315
|
-
const cols = document.getElementsByClassName("col-header")
|
|
316
|
-
const len = cols.length
|
|
317
|
-
const nwColLft = Math.floor(colRef.getBoundingClientRect().left)
|
|
318
|
-
for(i; i < len; i++){
|
|
319
|
-
const col = cols[i]
|
|
320
|
-
if(!col.classList.contains("col-header-minimized")){
|
|
321
|
-
const elLft = Math.floor(col.getBoundingClientRect().left)
|
|
322
|
-
lfts.push(elLft)
|
|
323
|
-
if(col.id !== colRef.id)
|
|
324
|
-
wantlfts.push(elLft)
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
wantlfts.push(xDrop)
|
|
328
|
-
wantlfts = wantlfts.sort( (a, b) => a-b )
|
|
329
|
-
if(lfts.length && lfts.length === wantlfts.length)
|
|
330
|
-
this.columnMove.next({ ls: lfts, nl: nwColLft, wl: wantlfts, x: xDrop })
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if(isMUp){
|
|
334
|
-
setTimeout( () => { //let the click event process first
|
|
335
|
-
this.dataTableService.currColumnEdit = null
|
|
336
|
-
this.didResizeOnEvent = false
|
|
337
|
-
this.colMoving = false
|
|
338
|
-
})
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
stopWindowSelection(e: any) {
|
|
344
|
-
e.preventDefault()
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
}
|