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,14 +0,0 @@
|
|
|
1
|
-
export interface DataCell {
|
|
2
|
-
column: string;
|
|
3
|
-
width?: string;
|
|
4
|
-
freeze: boolean;
|
|
5
|
-
text?: string;
|
|
6
|
-
html?: any;
|
|
7
|
-
rawText: string;
|
|
8
|
-
dataType: string;
|
|
9
|
-
minimized: boolean;
|
|
10
|
-
editable: boolean;
|
|
11
|
-
visible: boolean;
|
|
12
|
-
specialColClass: string;
|
|
13
|
-
top?: number;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { CommonService } from './common-service';
|
|
4
|
-
|
|
5
|
-
describe('CommonService', () => {
|
|
6
|
-
let service: CommonService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(CommonService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import { Injectable, signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Injectable({
|
|
4
|
-
providedIn: 'root'
|
|
5
|
-
})
|
|
6
|
-
export class CommonService {
|
|
7
|
-
|
|
8
|
-
uniSep: string = "X_";
|
|
9
|
-
|
|
10
|
-
replaceUniSep(val: any) {
|
|
11
|
-
return (val && typeof val === "string") ? val.replace(/\X_/g, " ") : (val ? val : null)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
elifyCol(col: string) {
|
|
15
|
-
return col.replace(/ /g, this.uniSep)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
titleCase(str: any) {
|
|
19
|
-
if(!str || str === "")
|
|
20
|
-
return str
|
|
21
|
-
return str.replace(/\w\S*/g, (txt: string) => txt.charAt(0).toUpperCase() + txt.substring(1) );
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
idCol(col: string) {
|
|
25
|
-
if(col && (col === "id" || col === "ID" || col === "Id" || /[Z+z+][I+i+][P+p+][ _\-]?/g.test(col)) || /[S+s+][S+s+][N+n+][ _\-]?/g.test(col))
|
|
26
|
-
return true
|
|
27
|
-
return col && typeof col === "string" && col.toLocaleLowerCase().endsWith("id") && /[-_ ][I+i+][D+d+]/g.test(col)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
mapLongDate(val: string) {
|
|
31
|
-
let dtStr = ""
|
|
32
|
-
let yrStr = ""
|
|
33
|
-
const dt = val.match(/\d{1,2}\,/g)
|
|
34
|
-
const yr = val.match(/ \d{4}/g)
|
|
35
|
-
if(dt && dt.length)
|
|
36
|
-
dtStr = dt[(dt.length-1)]
|
|
37
|
-
if(yr && yr.length)
|
|
38
|
-
yrStr = yr[(yr.length-1)]
|
|
39
|
-
if(!dt || !yr)
|
|
40
|
-
return new Date(val)
|
|
41
|
-
return new Date(yrStr + "," + this.mapTxtMonths(val) + "," + dtStr)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
mapTxtMonths(val: string) {
|
|
45
|
-
if(/(jan|january)/g.test(val))
|
|
46
|
-
return "01"
|
|
47
|
-
if(/(feb|february)/g.test(val))
|
|
48
|
-
return "02"
|
|
49
|
-
if(/(mar|march)/g.test(val))
|
|
50
|
-
return "03"
|
|
51
|
-
if(/(apr|april)/g.test(val))
|
|
52
|
-
return "04"
|
|
53
|
-
if(/may/g.test(val))
|
|
54
|
-
return "05"
|
|
55
|
-
if(/(jun|june)/g.test(val))
|
|
56
|
-
return "06"
|
|
57
|
-
if(/(jul|july)/g.test(val))
|
|
58
|
-
return "07"
|
|
59
|
-
if(/(aug|august)/g.test(val))
|
|
60
|
-
return "08"
|
|
61
|
-
if(/(sept|september)/g.test(val))
|
|
62
|
-
return "09"
|
|
63
|
-
if(/(oct|october)/g.test(val))
|
|
64
|
-
return "10"
|
|
65
|
-
if(/(nov|november)/g.test(val))
|
|
66
|
-
return "11"
|
|
67
|
-
if(/(dec|december)/g.test(val))
|
|
68
|
-
return "12"
|
|
69
|
-
return "06"
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
testShortDate(val: string) {
|
|
73
|
-
const isDtReg = new RegExp(/\d+(\/|-| )\d+(\/|-| )\d+/)
|
|
74
|
-
if(val && isDtReg.test(val) && /^\d+$/g.test(val.replace(/(\/|-| )/g, "")) && val.length <= 10)
|
|
75
|
-
return true
|
|
76
|
-
return false
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
testISODate(val: string) {
|
|
80
|
-
return (val && /\d{4}-[01]\d-[0-3]\d(T|t)[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|(Z|z))/.test(val)) ? true : false
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
testLongDate(val: string) {
|
|
84
|
-
const dtReg = /(jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sept|september|oct|october|nov|november|dec|december) \d{1,2}\, \d{4}/
|
|
85
|
-
if(val && dtReg.test(val) && val.length < 29)
|
|
86
|
-
return true
|
|
87
|
-
return false
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
coerceDate(val: any) {
|
|
91
|
-
try{
|
|
92
|
-
if(!val)
|
|
93
|
-
return null
|
|
94
|
-
if(this.testLongDate(val))
|
|
95
|
-
return this.mapLongDate(val)
|
|
96
|
-
const fFour = val.substring(0,4)
|
|
97
|
-
const moGuess = val.substring(5,7)
|
|
98
|
-
const dtGuess = val.substring(8,10)//2024-10-30
|
|
99
|
-
if((this.testISODate(val.replace(/ /g, "")) || (/^\d+$/g.test(fFour) && /^\d+$/g.test(moGuess) && /^\d+$/g.test(dtGuess))))
|
|
100
|
-
return new Date(fFour + "," + moGuess + "," + dtGuess)
|
|
101
|
-
if(/\d{2}(\/|-| )\d{2}(\/|-| )\d{4}/g.test(val))//10-30-2023
|
|
102
|
-
return new Date(val.substring(6,10) + "," + (val.substring(0,2)) + "," + val.substring(3,5))
|
|
103
|
-
if(/\d{2}(\/|-| )\d{1}(\/|-| )\d{4}/g.test(val))//10-5-2023
|
|
104
|
-
return new Date(val.substring(5,9) + "," + (val.substring(0,2)) + "," + ("0"+val.substring(3,4)))
|
|
105
|
-
if(/\d{1}(\/|-| )\d{2}(\/|-| )\d{4}/g.test(val))//5-26-2025
|
|
106
|
-
return new Date(val.substring(5,9) + "," + ("0"+val.substring(0,1)) + "," + val.substring(2,4))
|
|
107
|
-
if(/\d{1}(\/|-| )\d{1}(\/|-| )\d{4}/g.test(val))//5-6-2025
|
|
108
|
-
return new Date(val.substring(4,8) + "," + ("0"+val.substring(0,1)) + "," + ("0"+val.substring(2,3)))
|
|
109
|
-
|
|
110
|
-
if(/\d{2}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val))//10-30-23
|
|
111
|
-
return new Date(("20" + val.substring(6,8)) + "," + (val.substring(0,2)) + "," + val.substring(3,5))
|
|
112
|
-
if(/\d{2}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val))//11-6-25
|
|
113
|
-
return new Date(("20" + val.substring(5,7)) + "," + (val.substring(0,2)) + "," + ("0"+val.substring(3,4)))
|
|
114
|
-
if(/\d{1}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val))//5-16-25
|
|
115
|
-
return new Date(("20" + val.substring(5,7)) + "," + ("0"+val.substring(0,1)) + "," + val.substring(2,4))
|
|
116
|
-
if(/\d{1}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val))//5-6-25
|
|
117
|
-
return new Date(("20" + val.substring(4,6)) + "," + ("0"+val.substring(0,1)) + "," + ("0"+val.substring(2,3)))
|
|
118
|
-
|
|
119
|
-
if(/\d{4}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val))//2025-12-16
|
|
120
|
-
return new Date(val.substring(0,4) + "," + (val.substring(5,7)) + "," + val.substring(8,10))
|
|
121
|
-
if(/\d{4}(\/|-| )\d{2}(\/|-| )\d{1}/g.test(val))//2025-12-6
|
|
122
|
-
return new Date(val.substring(0,4) + "," + (val.substring(5,7)) + "," + ("0"+val.substring(8,9)))
|
|
123
|
-
if(/\d{4}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val))
|
|
124
|
-
return new Date(val.substring(0,4) + "," + ("0"+val.substring(5,6)) + "," + val.substring(7,9))
|
|
125
|
-
if(/\d{4}(\/|-| )\d{1}(\/|-| )\d{1}/g.test(val))//2025-6-5
|
|
126
|
-
return new Date(val.substring(0,4) + "," + ("0"+val.substring(5,6)) + "," + ("0"+val.substring(7,8)))
|
|
127
|
-
return val
|
|
128
|
-
} catch(e){
|
|
129
|
-
return val
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
isADateObject(val: any) {
|
|
134
|
-
return val && typeof val === "object" && typeof val.getTime === "function"
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
stripSpecChars(word: any) {
|
|
138
|
-
try{
|
|
139
|
-
const okword = word?.trim().replace(/[~_\-]/g, " ").replace(/[`!@#$%^&*()|+=?;:'",.<>\{\}\[\]\\\/]/g, "").replace(/ /g, " ").replace(/ /g, " ").replace(/^\d+/, '').trim()
|
|
140
|
-
return okword
|
|
141
|
-
} catch(e){ return word }
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
doBigData(num: number) {
|
|
145
|
-
try{
|
|
146
|
-
let str = num ? num.toLocaleString(undefined, { maximumFractionDigits: 1 }).split(".")[0] : '0'
|
|
147
|
-
if(num){
|
|
148
|
-
let arr = str.split(",")
|
|
149
|
-
let dec;
|
|
150
|
-
if(arr.length > 0)
|
|
151
|
-
dec = arr[1].substring(0, 1)
|
|
152
|
-
str = str.
|
|
153
|
-
replace(/,\d{3},\d{3},\d{3}/, (dec === "0" ? "B" : ("." + dec + "B"))).
|
|
154
|
-
replace(/,\d{3},\d{3}/, (dec === "0" ? "M" : ("." + dec + "M"))).
|
|
155
|
-
replace(/,\d{3}/, (dec === "0" ? "K" : ("." + dec + "K")))
|
|
156
|
-
}
|
|
157
|
-
return str
|
|
158
|
-
} catch(e){
|
|
159
|
-
return num ? num.toLocaleString(undefined, { maximumFractionDigits: 1 }).
|
|
160
|
-
replace(/,\d{3},\d{3},\d{3}/,"B").
|
|
161
|
-
replace(/,\d{3},\d{3}/,"M").
|
|
162
|
-
replace(/,\d{3}/,"K") : '0'
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
mystartsWith(str: string, query: string) {
|
|
167
|
-
try{
|
|
168
|
-
var qLen = query.length
|
|
169
|
-
return str.substring(0, qLen) === query ? true : false
|
|
170
|
-
}catch(e){ return false }
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
isEnterKey(event: any) {
|
|
174
|
-
if(event){
|
|
175
|
-
if (typeof event.key !== "undefined") {
|
|
176
|
-
return event.key === 'Enter'
|
|
177
|
-
} else if (typeof event.keyIdentifier !== "undefined") {
|
|
178
|
-
return event.keyIdentifier === 'Enter'
|
|
179
|
-
} else if (typeof event.keyCode !== "undefined") {
|
|
180
|
-
return event.keyCode === 13
|
|
181
|
-
}
|
|
182
|
-
return false
|
|
183
|
-
}
|
|
184
|
-
return false
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
isTabKey(event: any) {
|
|
188
|
-
if(event){
|
|
189
|
-
if (typeof event.key !== "undefined") {
|
|
190
|
-
return event.key === 'Tab'
|
|
191
|
-
} else if (typeof event.keyIdentifier !== "undefined") {
|
|
192
|
-
return event.keyIdentifier === 'Tab'
|
|
193
|
-
} else if (typeof event.keyCode !== "undefined") {
|
|
194
|
-
return event.keyCode === 9
|
|
195
|
-
}
|
|
196
|
-
return false
|
|
197
|
-
}
|
|
198
|
-
return false
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
keyCanSearch(event: any) {
|
|
202
|
-
return (this.isSearchKey(event) ||
|
|
203
|
-
this.isBackKey(event) ||
|
|
204
|
-
this.isDeleteKey(event) ||
|
|
205
|
-
this.isSpaceKey(event))
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
isSearchKey(event: any) {
|
|
209
|
-
if (event && event.key !== undefined) {
|
|
210
|
-
return /^[A-Za-z0-9, ()&:\-.,#$!@]$/.test(event.key)
|
|
211
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
212
|
-
return (/Key([a-zA-Z])/.test(event.keyIdentifier) ||
|
|
213
|
-
this.mystartsWith(event.keyIdentifier, "Digit") ||
|
|
214
|
-
this.mystartsWith(event.keyIdentifier, "Numpad"))
|
|
215
|
-
} else if (event.keyCode !== undefined) {
|
|
216
|
-
return ((event.keyCode >= 65 && event.keyCode <= 90) ||
|
|
217
|
-
(event.keyCode >= 48 && event.keyCode <= 57) ||
|
|
218
|
-
(event.keyCode >= 96 && event.keyCode <= 105))
|
|
219
|
-
}
|
|
220
|
-
return false
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
isBackKey(event: any) {
|
|
224
|
-
if (event && event.key !== undefined) {
|
|
225
|
-
return event.key === 'Backspace'
|
|
226
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
227
|
-
return event.keyIdentifier === 'Backspace'
|
|
228
|
-
} else if (event.keyCode !== undefined) {
|
|
229
|
-
return event.keyCode === 8
|
|
230
|
-
}
|
|
231
|
-
return false
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
isDeleteKey(event: any) {
|
|
235
|
-
if (event && event.key !== undefined) {
|
|
236
|
-
return event.key === 'Delete'
|
|
237
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
238
|
-
return event.keyIdentifier === 'Delete'
|
|
239
|
-
} else if (event.keyCode !== undefined) {
|
|
240
|
-
return event.keyCode === 46
|
|
241
|
-
}
|
|
242
|
-
return false
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
isSpaceKey(event: any) {
|
|
246
|
-
if (event && event.key !== undefined) {
|
|
247
|
-
return event.key == " "
|
|
248
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
249
|
-
return event.keyIdentifier == " "
|
|
250
|
-
} else if (event.keyCode !== undefined) {
|
|
251
|
-
return event.keyCode === 32
|
|
252
|
-
} else if (event.code !== undefined) {
|
|
253
|
-
return event.code === "Space"
|
|
254
|
-
}
|
|
255
|
-
return false
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
isDownKey(event: any) {
|
|
259
|
-
if (event && event.key !== undefined) {
|
|
260
|
-
return event.key === 'ArrowDown'
|
|
261
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
262
|
-
return event.keyIdentifier === 'ArrowDown'
|
|
263
|
-
} else if (event.keyCode !== undefined) {
|
|
264
|
-
return event.keyCode === 40
|
|
265
|
-
}
|
|
266
|
-
return false
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
isUpKey(event: any) {
|
|
270
|
-
if (event && event.key !== undefined) {
|
|
271
|
-
return event.key === 'ArrowUp'
|
|
272
|
-
} else if (event.keyIdentifier !== undefined) {
|
|
273
|
-
return event.keyIdentifier === 'ArrowUp'
|
|
274
|
-
} else if (event.keyCode !== undefined) {
|
|
275
|
-
return event.keyCode === 38
|
|
276
|
-
}
|
|
277
|
-
return false
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
dontSan(val: any) {
|
|
281
|
-
if(val && (this.testShortDate(val) || this.testISODate(val)))
|
|
282
|
-
return true
|
|
283
|
-
return false
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
sanitizeUi(val: any) {
|
|
287
|
-
if(val){
|
|
288
|
-
if(this.dontSan(val))
|
|
289
|
-
return val;
|
|
290
|
-
var entityMap: any = {
|
|
291
|
-
'<': '<',
|
|
292
|
-
'>': '>',
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
return typeof val === "string" ? val.replace(/[<>]/g, s => {
|
|
296
|
-
return entityMap[s];
|
|
297
|
-
}) : val
|
|
298
|
-
} else
|
|
299
|
-
return val === 0 ? val : ''
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
unbindMouseEvent(e: any) {
|
|
303
|
-
e && e.stopPropagation()
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
goodLs = signal<boolean>(false);
|
|
307
|
-
|
|
308
|
-
getRgbParts(rgb: string) {
|
|
309
|
-
try{
|
|
310
|
-
const clst = rgb.replace(/rgb[\(\)]/g, "").split(",")
|
|
311
|
-
return {r: parseInt(clst[0].trim()), g: parseInt(clst[1].trim()), b: parseInt(clst[2].trim())}
|
|
312
|
-
} catch(e) { return {r: 255, g: 255, b: 255} }
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
componentToHex(c: any) {
|
|
316
|
-
const hex = c.toString(16);
|
|
317
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
rgbToHex(r: any, g: any, b: any) {
|
|
321
|
-
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
hexToRgb(hex: any) {
|
|
325
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
326
|
-
return result ? {
|
|
327
|
-
r: parseInt(result[1], 16),
|
|
328
|
-
g: parseInt(result[2], 16),
|
|
329
|
-
b: parseInt(result[3], 16)
|
|
330
|
-
} : null;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
setLs() {
|
|
334
|
-
this.goodLs.set(true)
|
|
335
|
-
}
|
|
336
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DataTableService } from './data-table-service';
|
|
4
|
-
|
|
5
|
-
describe('DataTableService', () => {
|
|
6
|
-
let service: DataTableService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(DataTableService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|