ngx-deebodata-community 0.1.2 → 0.1.4
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 +1 -1
- package/ng-package.json +7 -0
- package/package.json +20 -38
- 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 +6 -0
- package/src/lib/data-table/data-table-module/data-cell/data-cell.spec.ts +23 -0
- package/src/lib/data-table/data-table-module/data-cell/data-cell.ts +276 -0
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.css +19 -0
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.html +47 -0
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.spec.ts +23 -0
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.ts +206 -0
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.css +65 -0
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.html +10 -0
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.spec.ts +23 -0
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.ts +45 -0
- package/src/lib/data-table/data-table-module/ngx-deebodata-community/ngx-deebodata-community-component.css +75 -0
- package/src/lib/data-table/data-table-module/ngx-deebodata-community/ngx-deebodata-community-component.html +106 -0
- package/src/lib/data-table/data-table-module/ngx-deebodata-community/ngx-deebodata-community.spec.ts +23 -0
- package/src/lib/data-table/data-table-module/ngx-deebodata-community/ngx-deebodata-community.ts +1776 -0
- package/src/lib/data-table/data-table-module/worker.worker.ts +44 -0
- package/src/lib/interfaces/cell-edit.ts +7 -0
- package/src/lib/interfaces/column-header.ts +10 -0
- package/src/lib/interfaces/column-symbol.ts +4 -0
- package/src/lib/interfaces/data-cell.ts +13 -0
- package/src/lib/interfaces/data-row.ts +11 -0
- package/src/lib/interfaces/row-number.ts +4 -0
- package/src/lib/services/common-service.spec.ts +16 -0
- package/src/lib/services/common-service.ts +331 -0
- package/src/lib/services/data-table-service.spec.ts +16 -0
- package/src/lib/services/data-table-service.ts +513 -0
- package/src/lib/services/table-drag-service.spec.ts +16 -0
- package/src/lib/services/table-drag-service.ts +347 -0
- package/src/lib/styles.css +714 -0
- package/src/public-api.ts +7 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/ngx-deebodata-community.mjs +0 -3539
- package/fesm2022/ngx-deebodata-community.mjs.map +0 -1
- package/types/ngx-deebodata-community.d.ts +0 -363
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, ViewChild, ElementRef, } from '@angular/core';
|
|
2
|
+
import { ColumnHeader } from '../../../interfaces/column-header';
|
|
3
|
+
import { CommonService } from '../../../services/common-service';
|
|
4
|
+
import { DataTableService } from '../../../services/data-table-service';
|
|
5
|
+
import { CommonModule, DecimalPipe } from '@angular/common';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { TableDragService } from '../../../services/table-drag-service';
|
|
8
|
+
|
|
9
|
+
export interface columnWidthResize{
|
|
10
|
+
column: string
|
|
11
|
+
value: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-data-table-header',
|
|
16
|
+
imports: [CommonModule, FormsModule, DecimalPipe, ],
|
|
17
|
+
templateUrl: './data-table-header.html',
|
|
18
|
+
styleUrls: ['./data-table-header.css', '../../../styles.css']
|
|
19
|
+
})
|
|
20
|
+
export class DataTableHeader {
|
|
21
|
+
|
|
22
|
+
constructor(public common: CommonService,
|
|
23
|
+
public tblDragService: TableDragService,
|
|
24
|
+
public dataTableService: DataTableService,){
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
init = false;
|
|
29
|
+
showBtnX = false;
|
|
30
|
+
autoMaxed = false
|
|
31
|
+
text: string = ""
|
|
32
|
+
elCol: string = "";
|
|
33
|
+
canTabScroll = true
|
|
34
|
+
compOpts: string[] = []
|
|
35
|
+
filterBuildUp: any[] = []
|
|
36
|
+
@Input() colWid: string = "";
|
|
37
|
+
@Input() canFreeze: boolean = false;
|
|
38
|
+
@Input() columnHeader!: ColumnHeader;
|
|
39
|
+
@Output("sort") sort: EventEmitter<string> = new EventEmitter()
|
|
40
|
+
@Output("render") render: EventEmitter<any> = new EventEmitter()
|
|
41
|
+
@Output("width") width: EventEmitter<columnWidthResize> = new EventEmitter()
|
|
42
|
+
@Output("height") height: EventEmitter<number> = new EventEmitter()
|
|
43
|
+
@Output("reset") reset: EventEmitter<string> = new EventEmitter()
|
|
44
|
+
@Output("freeze") freeze: EventEmitter<string> = new EventEmitter()
|
|
45
|
+
@Output("scrollOnFocus") scrollOnFocus: EventEmitter<string> = new EventEmitter()
|
|
46
|
+
@ViewChild('colHeader', { static: true }) colHeaderEl!: ElementRef<HTMLElement>
|
|
47
|
+
@ViewChild('filterInput', { static: true }) filterInputEl!: ElementRef<HTMLInputElement>
|
|
48
|
+
@ViewChild('compSelect', { static: true }) compSelectEl!: ElementRef<HTMLSelectElement>
|
|
49
|
+
|
|
50
|
+
ngOnInit() {
|
|
51
|
+
this.elCol = this.common.elifyCol(this.columnHeader.column)
|
|
52
|
+
this.text = this.common.titleCase(this.columnHeader.column)
|
|
53
|
+
this.compOpts = [...this.dataTableService.comparatorOpts[this.columnHeader.dataType]]
|
|
54
|
+
this.tblDragService.headDims.subscribe( d => { this.updateUiColCellTheme(d.prop, d.value) })
|
|
55
|
+
this.dataTableService.setIdealColumnWidth.subscribe( c => { this.handleColResDblClick(this.columnHeader.column, true) })
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ngAfterViewInit() {
|
|
59
|
+
if(this.columnHeader.dataType === "date"){
|
|
60
|
+
setTimeout( () => {
|
|
61
|
+
this.filterInputEl?.nativeElement.addEventListener("change", e => { this.filterDateOnKeyUp(e) })
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
preventTabScroll() {
|
|
67
|
+
this.canTabScroll = false
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
emitTabFocus(col: string) {
|
|
71
|
+
if(this.canTabScroll)
|
|
72
|
+
this.scrollOnFocus.emit(col)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
freezeColOnClick(e: any, prop: string) {
|
|
76
|
+
e && e.stopPropagation()
|
|
77
|
+
try{
|
|
78
|
+
const currCol = this.dataTableService.dataFilSrtTracker[prop]
|
|
79
|
+
if(currCol){
|
|
80
|
+
this.dataTableService.dataFilSrtTracker[prop].freeze = !currCol.freeze
|
|
81
|
+
const nowVal = this.dataTableService.dataFilSrtTracker[prop].freeze
|
|
82
|
+
if(nowVal)
|
|
83
|
+
this.columnHeader.freeze = true
|
|
84
|
+
else
|
|
85
|
+
this.columnHeader.freeze = false
|
|
86
|
+
this.freeze.emit(prop)
|
|
87
|
+
}
|
|
88
|
+
}catch(e){}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
doSortOnClick(e: any, col: string) {
|
|
92
|
+
e && e.stopPropagation()
|
|
93
|
+
this.canTabScroll = true
|
|
94
|
+
if(!this.dataTableService.isSorting){
|
|
95
|
+
this.dataTableService.isSorting = true
|
|
96
|
+
setTimeout( () => {
|
|
97
|
+
this.dataTableService.doSortOnField(col)
|
|
98
|
+
this.render.emit({value: (this.dataTableService.dataFilSrtTracker[col].filter || ""), field: col})
|
|
99
|
+
if(!this.dataTableService.currSelRows.length && this.dataTableService.arefilSrtTrkPropsDefault())
|
|
100
|
+
this.reset.emit(col)
|
|
101
|
+
this.dataTableService.isSorting = false
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
resetColFilter(event: any, field: string) {
|
|
107
|
+
event && event.stopPropagation()
|
|
108
|
+
const fil = this.filterInputEl.nativeElement
|
|
109
|
+
const comp = this.compSelectEl.nativeElement
|
|
110
|
+
if(fil){
|
|
111
|
+
fil.value = "";
|
|
112
|
+
comp.value = ""
|
|
113
|
+
this.dataTableService.dataFilSrtTracker[field].comparator = null
|
|
114
|
+
this.filterOnKeyUp(event, field, "", true)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
filterDateOnKeyUp(event: any) {
|
|
119
|
+
const elId: string = event.target?.id?.replace(/filter/g, "")
|
|
120
|
+
const field: string = this.common.replaceUniSep(elId)
|
|
121
|
+
this.filterOnKeyUp(event, field, event.target.value)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
filterOnKeyUp(event:any, field: string, val: any, manual?: any) {
|
|
125
|
+
const filObj = {value: val, field: field}
|
|
126
|
+
if(field && !this.dataTableService.isFiltering){
|
|
127
|
+
if(!manual && event && event.type !== "change" && !this.common.keyCanSearch(event))
|
|
128
|
+
return;
|
|
129
|
+
this.dataTableService.isFiltering = true
|
|
130
|
+
this.dataTableService.dataFilSrtTracker[field].filter = val || ""
|
|
131
|
+
this.dataTableService.columnFilter(this.dataTableService.mainData, field, this.dataTableService.dataFilSrtTracker, this.dataTableService.sortOrder, manual)
|
|
132
|
+
this.render.emit(filObj)
|
|
133
|
+
setTimeout( () => {
|
|
134
|
+
this.dataTableService.isFiltering = false
|
|
135
|
+
const buildUpLen = this.filterBuildUp.length
|
|
136
|
+
if(buildUpLen){
|
|
137
|
+
const filBld = this.filterBuildUp[(buildUpLen-1)]
|
|
138
|
+
this.filterOnKeyUp(null, filBld.field, filBld.value, true)
|
|
139
|
+
this.filterBuildUp = []
|
|
140
|
+
if((this.dataTableService.dataFilSrtTracker[field].filter ||
|
|
141
|
+
(this.dataTableService.dataFilSrtTracker[field].comparator && this.dataTableService.dataFilSrtTracker[field].comparator != "Equals")
|
|
142
|
+
)){
|
|
143
|
+
this.showBtnX = true
|
|
144
|
+
} else {
|
|
145
|
+
this.showBtnX = false
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, 500)
|
|
149
|
+
if((this.dataTableService.dataFilSrtTracker[field].filter ||
|
|
150
|
+
(this.dataTableService.dataFilSrtTracker[field].comparator && this.dataTableService.dataFilSrtTracker[field].comparator != "Equals")
|
|
151
|
+
)){
|
|
152
|
+
this.showBtnX = true
|
|
153
|
+
} else {
|
|
154
|
+
this.showBtnX = false
|
|
155
|
+
}
|
|
156
|
+
const tlFil = <HTMLInputElement>document.getElementsByName("topLevelDataFilter")[0]
|
|
157
|
+
if(tlFil)
|
|
158
|
+
tlFil.value = ""
|
|
159
|
+
} else {
|
|
160
|
+
if(!this.filterBuildUp.find( f => f.value === val && f.field === field))
|
|
161
|
+
this.filterBuildUp.push(filObj)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
handleComparatorChange(col: string, comp: string) {
|
|
166
|
+
if(col){
|
|
167
|
+
const value = this.dataTableService.dataFilSrtTracker[col].filter
|
|
168
|
+
this.dataTableService.dataFilSrtTracker[col].comparator = comp
|
|
169
|
+
this.filterOnKeyUp(null, col, (value || ""), true)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
updateUiColCellTheme(cssProp: string, val: number, col?: string) {
|
|
174
|
+
if(cssProp === "height")
|
|
175
|
+
this.height.emit(val)
|
|
176
|
+
const prop = col || this.common.replaceUniSep(this.dataTableService.currColumnEdit)
|
|
177
|
+
if(prop && this.dataTableService.dataFilSrtTracker[prop]){
|
|
178
|
+
if(cssProp === "width"){
|
|
179
|
+
this.dataTableService.dataFilSrtTracker[prop].colWidth = (val || parseInt(this.colWid)).toString()
|
|
180
|
+
this.width.emit({column: prop, value: val || parseInt(this.colWid)})
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
handleColResDblClick(prop: string, auto?: boolean) {
|
|
186
|
+
if(this.dataTableService.dataFilSrtTracker[prop] && (!auto || (!this.autoMaxed && this.dataTableService.visibleCols.includes(prop)))){
|
|
187
|
+
let i = 0
|
|
188
|
+
let wids = []
|
|
189
|
+
let useWid = 50
|
|
190
|
+
const els = document.getElementsByClassName("data-cell-" + this.common.elifyCol(prop))
|
|
191
|
+
const nw = els[0]?.getBoundingClientRect().width || 0
|
|
192
|
+
const len = els.length
|
|
193
|
+
if(len){
|
|
194
|
+
for(i; i < len; i++)
|
|
195
|
+
wids.push(els[i].scrollWidth)
|
|
196
|
+
useWid =wids.sort()[(len-1)]
|
|
197
|
+
if(useWid && useWid > nw){
|
|
198
|
+
const cswid = Math.ceil(Math.max((useWid+1), parseInt(this.dataTableService.useColWid.replace(/[ ]?px/g, ""))))
|
|
199
|
+
this.updateUiColCellTheme("width", cswid, prop)
|
|
200
|
+
this.autoMaxed = true
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
:host{
|
|
2
|
+
--accent-color:rgb(50, 50, 50);
|
|
3
|
+
--grid-color:rgb(199, 199, 199);
|
|
4
|
+
--pad-left-base: 33px;
|
|
5
|
+
--row-num-width: 75px;
|
|
6
|
+
--reg-font-size: 17px
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.data-table-footer{
|
|
10
|
+
padding:15px;
|
|
11
|
+
border-bottom-left-radius:7px;
|
|
12
|
+
border-bottom-right-radius:7px;
|
|
13
|
+
box-shadow:0 1px 3px 1px var(--grid-color);
|
|
14
|
+
-moz-box-shadow:0 1px 3px 1px var(--grid-color);
|
|
15
|
+
-webkit-box-shadow:0 1px 3px 1px var(--grid-color)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.skip-to-contain{
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.skip-to-options-hide{
|
|
25
|
+
opacity: 0;
|
|
26
|
+
max-height: 0;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
max-width: 0;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.skip-to-options{
|
|
33
|
+
right: 0;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
bottom:33px;
|
|
36
|
+
border-radius: 3px;
|
|
37
|
+
position: absolute;
|
|
38
|
+
background: white;
|
|
39
|
+
vertical-align: middle;
|
|
40
|
+
opacity: 1 !important;
|
|
41
|
+
overflow: auto !important;
|
|
42
|
+
min-width: 175px !important;
|
|
43
|
+
max-width: 200px !important;
|
|
44
|
+
max-height: 200px !important;
|
|
45
|
+
min-height: 150px;
|
|
46
|
+
box-shadow:0 0 3px 2px var(--grid-color);
|
|
47
|
+
-moz-box-shadow:0 0 3px 2px var(--grid-color);
|
|
48
|
+
-webkit-box-shadow:0 0 3px 2px var(--grid-color);
|
|
49
|
+
transition: opacity 0.2s ease;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.skip-to-options div{
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
padding: 15px 7px;
|
|
55
|
+
text-align: left !important;
|
|
56
|
+
border-bottom: 1px solid var(--grid-color);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.skip-to-options div:hover{
|
|
60
|
+
text-decoration: underline;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.skip-to-options div:last-of-type{
|
|
64
|
+
border-bottom: none;
|
|
65
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div id="tableFooter" class="data-table-footer" (mousemove)="tblDragService.checkPaginatorBorderCursor($event)"
|
|
2
|
+
(mousemove)="tblDragService.handleTableHeightAdjust($event)" (mousedown)="tblDragService.handleTableHeightAdjust($event)"
|
|
3
|
+
(mouseup)="tblDragService.handleColResMouseUp($event)">
|
|
4
|
+
<div class="three-qtr-wid">
|
|
5
|
+
<div class="inline v-mid semi-heavy lg-text">{{totalRowStr}}</div> <div class="inline v-mid">row{{totalRows === 1 ? "" : "s"}}</div>
|
|
6
|
+
@if(filSortStr){
|
|
7
|
+
<div class="inline v-mid" [innerHTML]="filSortStr"></div>
|
|
8
|
+
}
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.spec.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { DataTablePaginator } from './data-table-paginator';
|
|
4
|
+
|
|
5
|
+
describe('DataTablePaginator', () => {
|
|
6
|
+
let component: DataTablePaginator;
|
|
7
|
+
let fixture: ComponentFixture<DataTablePaginator>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [DataTablePaginator]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(DataTablePaginator);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, SimpleChanges, } from '@angular/core';
|
|
2
|
+
import { DataTableService } from '../../../services/data-table-service';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { TableDragService } from '../../../services/table-drag-service';
|
|
6
|
+
import { CommonService } from '../../../services/common-service';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-data-table-paginator',
|
|
10
|
+
imports: [CommonModule, FormsModule,],
|
|
11
|
+
templateUrl: './data-table-paginator.html',
|
|
12
|
+
styleUrls: ['./data-table-paginator.css', '../../../styles.css']
|
|
13
|
+
})
|
|
14
|
+
export class DataTablePaginator {
|
|
15
|
+
|
|
16
|
+
constructor(public dataTableService: DataTableService,
|
|
17
|
+
public tblDragService: TableDragService,
|
|
18
|
+
public common: CommonService,) {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
init = true
|
|
23
|
+
isKeying = false
|
|
24
|
+
totalRowStr = "";
|
|
25
|
+
rowinating = false
|
|
26
|
+
@Input() totalRows: number = 0;
|
|
27
|
+
@Input() filSortStr: string = "";
|
|
28
|
+
|
|
29
|
+
ngOnChanges(changes: SimpleChanges){
|
|
30
|
+
if(!this.init && changes){
|
|
31
|
+
if(changes["totalRows"])
|
|
32
|
+
this.setUpPagi()
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ngOnInit() {
|
|
37
|
+
this.setUpPagi()
|
|
38
|
+
this.init = false
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setUpPagi() {
|
|
42
|
+
this.totalRowStr = this.totalRows.toLocaleString(undefined, { maximumFractionDigits: 0 })
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
:host{
|
|
2
|
+
--accent-color:rgb(50, 50, 50);
|
|
3
|
+
--grid-color:rgb(199, 199, 199);
|
|
4
|
+
--pad-left-base: 33px;
|
|
5
|
+
--row-num-width: 75px;
|
|
6
|
+
--reg-font-size: 17px
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
input[name=topLevelDataFilter]{
|
|
10
|
+
float: left;
|
|
11
|
+
padding: 7px 5px;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
box-shadow: 0 0 1px 1px var(--grid-color);
|
|
14
|
+
-moz-box-shadow: 0 0 1px 1px var(--grid-color);
|
|
15
|
+
-webkit-box-shadow: 0 0 1px 1px var(--grid-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.deebo-dd-contain-div{
|
|
19
|
+
margin: 0 31px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dt-checks{
|
|
23
|
+
margin-left: var(--row-num-width);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.row-numbers{
|
|
27
|
+
margin-top: 11px;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
width: var(--row-num-width);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.row-num-header{
|
|
33
|
+
background: #e9e9e9;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
border-bottom: 1px solid var(--accent-color);
|
|
36
|
+
border-right: 1px solid var(--accent-color);
|
|
37
|
+
box-shadow:0 -1px 3px 1px var(--grid-color);
|
|
38
|
+
-moz-box-shadow:0 -1px 3px 1px var(--grid-color);
|
|
39
|
+
-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.num-row{
|
|
43
|
+
white-space:nowrap;
|
|
44
|
+
box-sizing:border-box;
|
|
45
|
+
border-left: 1px solid var(--grid-color);
|
|
46
|
+
border-bottom: 1px solid var(--grid-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.inline-table{
|
|
50
|
+
display: inline-block;
|
|
51
|
+
width: calc(100% - var(--row-num-width));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.special-edit-container{
|
|
55
|
+
z-index: 5;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.edit-input{
|
|
59
|
+
border: none;
|
|
60
|
+
font-size: 15px;
|
|
61
|
+
box-shadow:none;
|
|
62
|
+
position: absolute;
|
|
63
|
+
background: white;
|
|
64
|
+
-moz-box-shadow:none;
|
|
65
|
+
-webkit-box-shadow: none;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.edit-input[type=number]{
|
|
70
|
+
text-align: right;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.edit-input[type=date]{
|
|
74
|
+
padding-left: 17px;
|
|
75
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<div class="deebo-data-grid-section">
|
|
2
|
+
<div class="controls">
|
|
3
|
+
<input type="text" #topLevelDataFilter autocomplete="off" name="topLevelDataFilter" placeholder="Filter any column..."
|
|
4
|
+
(input)="topFilterOnKeyUp($event)" (keyup)="topFilterOnKeyUp($event)" maxlength="255" [(ngModel)]="topLevelFilter"
|
|
5
|
+
[disabled]="!dataTableService.mainData.length || handlingSelRows" autocomplete="off" />
|
|
6
|
+
<button type="button" [disabled]="!dataTableService.currSelRows.length || handlingSelRows" (click)="clearSelectedRows()" class="btn-ctrl-sel-rows">Deselect Rows</button>
|
|
7
|
+
<button #btnTogSelRows type="button" [disabled]="!dataTableService.currSelRows.length || handlingSelRows" (click)="toggleSelectedRows()" class="btn-ctrl-sel-rows">
|
|
8
|
+
<i class="material-icons" aria-hidden="false">check_box_outline_blank</i> <span>{{togSelRows}}</span>
|
|
9
|
+
</button>
|
|
10
|
+
<button [disabled]="!topLevelFilter && dataTableService.arefilSrtTrkPropsDefault()"
|
|
11
|
+
class="btn-reset" (click)="resetCurrentData()" >Reset</button>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="relly" [ngClass]="{'dt-checks': rowNumbers, 'hide' : dataTableService.isFiltering ||
|
|
14
|
+
dataTableService.isSorting }">
|
|
15
|
+
@for (chk of dtChecks; track $index) {
|
|
16
|
+
<input [id]="'checkDataTableRow' + chk" class="select-row-check invisible"
|
|
17
|
+
[checked]="dataTableService.currSelRows.indexOf(chk) > -1" type="checkbox" [name]="'checkDataTableRow' + chk"
|
|
18
|
+
(click)="toggleSingleRowSelected(chk)" (keyup.enter)="toggleSingleRowSelected(chk)" [value]="'dataTableRow' + chk" >
|
|
19
|
+
}
|
|
20
|
+
</div>
|
|
21
|
+
<div #validatedEdit class="relly special-edit-container invisible">
|
|
22
|
+
@if (validatedEditType === 'date'){
|
|
23
|
+
<input id="selEditDate" name="selEditDate" type="date" class="edit-input"
|
|
24
|
+
(change)="execCellEdit($event, true)" (input)="execCellEdit($event, true)" (blur)="execCellEdit($event)" />
|
|
25
|
+
}
|
|
26
|
+
@if (validatedEditType === 'number'){
|
|
27
|
+
<input id="selEditNum" name="selEditNum" type="number" class="edit-input"
|
|
28
|
+
(keyup)="execCellEdit($event, true)" (input)="execCellEdit($event, true)" (blur)="execCellEdit($event)" (keyup.enter)="execCellEdit($event)" />
|
|
29
|
+
}
|
|
30
|
+
</div>
|
|
31
|
+
<div class="relly" style="z-index: 6;">
|
|
32
|
+
<div #fCellDragger tabindex="0" id="fCellDragger" (focus)="focusCellDragger()" (blur)="execValClear(true)"
|
|
33
|
+
(mousedown)="focusCellDraggerFromMouseDown()" (keydown)="handleFDragTab($event)" (keydown)="handleDraggerKD($event)"
|
|
34
|
+
[ngClass]="{'hide': dataTableService.currEditIndex < 0, 'focused-cell-dragger': dataTableService.currEditIndex > -1 }"></div>
|
|
35
|
+
</div>
|
|
36
|
+
<div [ngClass]="{'row-numbers': rowNumbers, 'hide': !rowNumbers}" >
|
|
37
|
+
<div #rowNumHeader class="row-num-header flex-center"><div class="semi-heavy">No.</div></div>
|
|
38
|
+
<div style="overflow: hidden;" [style.height]="dataTableService.dTblHeight + 'px'">
|
|
39
|
+
<div #rowNumBody style="overflow: auto">
|
|
40
|
+
@for (num of rowNos; track num.number) {
|
|
41
|
+
<div [id]="'rn' + num.number" class="flex-center num-row" [style.height]="num.height || dataTableService.defltRHgt">
|
|
42
|
+
<div class="small-text">{{num.number | number}}</div>
|
|
43
|
+
</div>
|
|
44
|
+
}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div><div #dataTable class="data-table" [class.inline-table]="rowNumbers">
|
|
48
|
+
<div #dataTableHeaders class="data-table-headers">
|
|
49
|
+
@for (col of columnHeaders; track col.column; let i = $index) {
|
|
50
|
+
<app-data-table-header
|
|
51
|
+
[columnHeader]="col"
|
|
52
|
+
[colWid]="dataTableService.useColWid"
|
|
53
|
+
[canFreeze]="i === 0 ? true : false"
|
|
54
|
+
(reset)="resetCurrentData($event)"
|
|
55
|
+
(freeze)="freezeColCells($event)"
|
|
56
|
+
(scrollOnFocus)="checkTabHorizScroll($event)"
|
|
57
|
+
(height)="setHeaderHeight($event, true)"
|
|
58
|
+
(render)="renderCurrData(false, $event.field)"
|
|
59
|
+
(width)="handleSingleColResize($event.value, $event.column)"
|
|
60
|
+
></app-data-table-header>
|
|
61
|
+
}
|
|
62
|
+
</div>
|
|
63
|
+
<div #dataTableBody id="dataTableBody" style="overflow: auto;" [style.height]="dataTableService.dTblHeight + 'px'" (scroll)="handleScroll($event)"
|
|
64
|
+
[class.table-working]="dataTableService.isFiltering || dataTableService.isSorting" (scrollend)="handleScrollEnd()">
|
|
65
|
+
<div #aboveArea [style.height]="aboveHgt() + 'px'"></div>
|
|
66
|
+
@for(row of rows; track row.index){
|
|
67
|
+
<div [id]="row.id" class="data-table-row" [attr.data-index]="row.index"
|
|
68
|
+
[class.data-row-selected]="!dataTableService.displayOnlySelRows && dataTableService.currSelRows.indexOf(row.index) > -1"
|
|
69
|
+
[ngStyle]="{'width': row.width, 'height': row.height}" >
|
|
70
|
+
@for(cell of row.cells; track cell.column){
|
|
71
|
+
@if (isScrolling){
|
|
72
|
+
<div class="data-cell data-cell-{{common.elifyCol(cell.column)}}" [class.data-cell-riiight]="cell.dataType === 'number'"
|
|
73
|
+
[ngClass]="{ 'col-item-freeze': cell.freeze, 'holding-check': cell.column === dataTableService.firstCol }"
|
|
74
|
+
[ngStyle]="{'width': cell.width || dataTableService.useColWid, 'height': row.height}" >{{cell.text}}@if (cell.html){<div class="mock-html"></div>}</div>
|
|
75
|
+
} @else {
|
|
76
|
+
<app-data-cell [cell]="cell"
|
|
77
|
+
[rowId]="row.id"
|
|
78
|
+
[rawText]="cell.rawText"
|
|
79
|
+
[rowHeight]="row.height || ''"
|
|
80
|
+
(edit)="execCellEdit($event)"
|
|
81
|
+
(dragListen)="listenToCellDraggerMouseMove = $event"
|
|
82
|
+
[colWid]="cell.width || dataTableService.useColWid"
|
|
83
|
+
(width)="handleSingleColResize($event)"
|
|
84
|
+
(height)="setSingleRowHgt($event, row.id, true)"
|
|
85
|
+
(clearVEditFocus)="validatedEditType = $event"
|
|
86
|
+
(validateEditFocus)="handleValidatedCellEditFocus($event)"
|
|
87
|
+
></app-data-cell>
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
<div #belowArea [style.height]="belowHgt() + 'px'"></div>
|
|
93
|
+
@if(!dataTableService.currFilData.length){
|
|
94
|
+
<div [style.height]="dataTableService.dTblHeight + 'px'" class="data-table-row flex-center data-table-row-no-data" style="width: 100%; white-space: normal;">
|
|
95
|
+
<div class="center">{{dataTableService.noDataMsg}}</div>
|
|
96
|
+
</div>
|
|
97
|
+
}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
@if(paginatorReady){
|
|
101
|
+
<app-data-table-paginator
|
|
102
|
+
[filSortStr]="allFilSortInfo"
|
|
103
|
+
[totalRows]="dataTableService.currFilData.length"
|
|
104
|
+
></app-data-table-paginator><!--not an actual paginator-->
|
|
105
|
+
}
|
|
106
|
+
</div>
|
package/src/lib/data-table/data-table-module/ngx-deebodata-community/ngx-deebodata-community.spec.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { NgxDeebodataCommunity } from './ngx-deebodata-community';
|
|
4
|
+
|
|
5
|
+
describe('NgxDeebodataCommunity', () => {
|
|
6
|
+
let component: NgxDeebodataCommunity;
|
|
7
|
+
let fixture: ComponentFixture<NgxDeebodataCommunity>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [NgxDeebodataCommunity]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(NgxDeebodataCommunity);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
await fixture.whenStable();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|