ngx-deebodata-community 0.0.1
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.
|
@@ -0,0 +1,3494 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, ViewChild, Output, Input, Component, signal, input, HostListener } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule, DecimalPipe } from '@angular/common';
|
|
5
|
+
import * as i5 from '@angular/forms';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import * as i2 from '@angular/common/http';
|
|
9
|
+
|
|
10
|
+
class CommonService {
|
|
11
|
+
uniSep = "X_";
|
|
12
|
+
replaceUniSep(val) {
|
|
13
|
+
return (val && typeof val === "string") ? val.replace(/\X_/g, " ") : (val ? val : null);
|
|
14
|
+
}
|
|
15
|
+
elifyCol(col) {
|
|
16
|
+
return col.replace(/ /g, this.uniSep);
|
|
17
|
+
}
|
|
18
|
+
titleCase(str) {
|
|
19
|
+
if (!str || str === "")
|
|
20
|
+
return str;
|
|
21
|
+
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substring(1));
|
|
22
|
+
}
|
|
23
|
+
idCol(col) {
|
|
24
|
+
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))
|
|
25
|
+
return true;
|
|
26
|
+
return col && typeof col === "string" && col.toLocaleLowerCase().endsWith("id") && /[-_ ][I+i+][D+d+]/g.test(col);
|
|
27
|
+
}
|
|
28
|
+
mapLongDate(val) {
|
|
29
|
+
let dtStr = "";
|
|
30
|
+
let yrStr = "";
|
|
31
|
+
const dt = val.match(/\d{1,2}\,/g);
|
|
32
|
+
const yr = val.match(/ \d{4}/g);
|
|
33
|
+
if (dt && dt.length)
|
|
34
|
+
dtStr = dt[(dt.length - 1)];
|
|
35
|
+
if (yr && yr.length)
|
|
36
|
+
yrStr = yr[(yr.length - 1)];
|
|
37
|
+
if (!dt || !yr)
|
|
38
|
+
return new Date(val);
|
|
39
|
+
return new Date(yrStr + "," + this.mapTxtMonths(val) + "," + dtStr);
|
|
40
|
+
}
|
|
41
|
+
mapTxtMonths(val) {
|
|
42
|
+
if (/(jan|january)/g.test(val))
|
|
43
|
+
return "01";
|
|
44
|
+
if (/(feb|february)/g.test(val))
|
|
45
|
+
return "02";
|
|
46
|
+
if (/(mar|march)/g.test(val))
|
|
47
|
+
return "03";
|
|
48
|
+
if (/(apr|april)/g.test(val))
|
|
49
|
+
return "04";
|
|
50
|
+
if (/may/g.test(val))
|
|
51
|
+
return "05";
|
|
52
|
+
if (/(jun|june)/g.test(val))
|
|
53
|
+
return "06";
|
|
54
|
+
if (/(jul|july)/g.test(val))
|
|
55
|
+
return "07";
|
|
56
|
+
if (/(aug|august)/g.test(val))
|
|
57
|
+
return "08";
|
|
58
|
+
if (/(sept|september)/g.test(val))
|
|
59
|
+
return "09";
|
|
60
|
+
if (/(oct|october)/g.test(val))
|
|
61
|
+
return "10";
|
|
62
|
+
if (/(nov|november)/g.test(val))
|
|
63
|
+
return "11";
|
|
64
|
+
if (/(dec|december)/g.test(val))
|
|
65
|
+
return "12";
|
|
66
|
+
return "06";
|
|
67
|
+
}
|
|
68
|
+
testShortDate(val) {
|
|
69
|
+
const isDtReg = new RegExp(/\d+(\/|-| )\d+(\/|-| )\d+/);
|
|
70
|
+
if (val && isDtReg.test(val) && /^\d+$/g.test(val.replace(/(\/|-| )/g, "")) && val.length <= 10)
|
|
71
|
+
return true;
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
testISODate(val) {
|
|
75
|
+
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;
|
|
76
|
+
}
|
|
77
|
+
testLongDate(val) {
|
|
78
|
+
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}/;
|
|
79
|
+
if (val && dtReg.test(val) && val.length < 29)
|
|
80
|
+
return true;
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
coerceDate(val) {
|
|
84
|
+
try {
|
|
85
|
+
if (!val)
|
|
86
|
+
return null;
|
|
87
|
+
if (this.testLongDate(val))
|
|
88
|
+
return this.mapLongDate(val);
|
|
89
|
+
const fFour = val.substring(0, 4);
|
|
90
|
+
const moGuess = val.substring(5, 7);
|
|
91
|
+
const dtGuess = val.substring(8, 10); //2024-10-30
|
|
92
|
+
if ((this.testISODate(val.replace(/ /g, "")) || (/^\d+$/g.test(fFour) && /^\d+$/g.test(moGuess) && /^\d+$/g.test(dtGuess))))
|
|
93
|
+
return new Date(fFour + "," + moGuess + "," + dtGuess);
|
|
94
|
+
if (/\d{2}(\/|-| )\d{2}(\/|-| )\d{4}/g.test(val)) //10-30-2023
|
|
95
|
+
return new Date(val.substring(6, 10) + "," + (val.substring(0, 2)) + "," + val.substring(3, 5));
|
|
96
|
+
if (/\d{2}(\/|-| )\d{1}(\/|-| )\d{4}/g.test(val)) //10-5-2023
|
|
97
|
+
return new Date(val.substring(5, 9) + "," + (val.substring(0, 2)) + "," + ("0" + val.substring(3, 4)));
|
|
98
|
+
if (/\d{1}(\/|-| )\d{2}(\/|-| )\d{4}/g.test(val)) //5-26-2025
|
|
99
|
+
return new Date(val.substring(5, 9) + "," + ("0" + val.substring(0, 1)) + "," + val.substring(2, 4));
|
|
100
|
+
if (/\d{1}(\/|-| )\d{1}(\/|-| )\d{4}/g.test(val)) //5-6-2025
|
|
101
|
+
return new Date(val.substring(4, 8) + "," + ("0" + val.substring(0, 1)) + "," + ("0" + val.substring(2, 3)));
|
|
102
|
+
if (/\d{2}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val)) //10-30-23
|
|
103
|
+
return new Date(("20" + val.substring(6, 8)) + "," + (val.substring(0, 2)) + "," + val.substring(3, 5));
|
|
104
|
+
if (/\d{2}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val)) //11-6-25
|
|
105
|
+
return new Date(("20" + val.substring(5, 7)) + "," + (val.substring(0, 2)) + "," + ("0" + val.substring(3, 4)));
|
|
106
|
+
if (/\d{1}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val)) //5-16-25
|
|
107
|
+
return new Date(("20" + val.substring(5, 7)) + "," + ("0" + val.substring(0, 1)) + "," + val.substring(2, 4));
|
|
108
|
+
if (/\d{1}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val)) //5-6-25
|
|
109
|
+
return new Date(("20" + val.substring(4, 6)) + "," + ("0" + val.substring(0, 1)) + "," + ("0" + val.substring(2, 3)));
|
|
110
|
+
if (/\d{4}(\/|-| )\d{2}(\/|-| )\d{2}/g.test(val)) //2025-12-16
|
|
111
|
+
return new Date(val.substring(0, 4) + "," + (val.substring(5, 7)) + "," + val.substring(8, 10));
|
|
112
|
+
if (/\d{4}(\/|-| )\d{2}(\/|-| )\d{1}/g.test(val)) //2025-12-6
|
|
113
|
+
return new Date(val.substring(0, 4) + "," + (val.substring(5, 7)) + "," + ("0" + val.substring(8, 9)));
|
|
114
|
+
if (/\d{4}(\/|-| )\d{1}(\/|-| )\d{2}/g.test(val))
|
|
115
|
+
return new Date(val.substring(0, 4) + "," + ("0" + val.substring(5, 6)) + "," + val.substring(7, 9));
|
|
116
|
+
if (/\d{4}(\/|-| )\d{1}(\/|-| )\d{1}/g.test(val)) //2025-6-5
|
|
117
|
+
return new Date(val.substring(0, 4) + "," + ("0" + val.substring(5, 6)) + "," + ("0" + val.substring(7, 8)));
|
|
118
|
+
return val;
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
return val;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
isADateObject(val) {
|
|
125
|
+
return val && typeof val === "object" && typeof val.getTime === "function";
|
|
126
|
+
}
|
|
127
|
+
stripSpecChars(word) {
|
|
128
|
+
try {
|
|
129
|
+
const okword = word?.trim().replace(/[~_\-]/g, " ").replace(/[`!@#$%^&*()|+=?;:'",.<>\{\}\[\]\\\/]/g, "").replace(/ /g, " ").replace(/ /g, " ").replace(/^\d+/, '').trim();
|
|
130
|
+
return okword;
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
return word;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
doBigData(num) {
|
|
137
|
+
try {
|
|
138
|
+
let str = num ? num.toLocaleString(undefined, { maximumFractionDigits: 1 }).split(".")[0] : '0';
|
|
139
|
+
if (num) {
|
|
140
|
+
let arr = str.split(",");
|
|
141
|
+
let dec;
|
|
142
|
+
if (arr.length > 0)
|
|
143
|
+
dec = arr[1].substring(0, 1);
|
|
144
|
+
str = str.
|
|
145
|
+
replace(/,\d{3},\d{3},\d{3}/, (dec === "0" ? "B" : ("." + dec + "B"))).
|
|
146
|
+
replace(/,\d{3},\d{3}/, (dec === "0" ? "M" : ("." + dec + "M"))).
|
|
147
|
+
replace(/,\d{3}/, (dec === "0" ? "K" : ("." + dec + "K")));
|
|
148
|
+
}
|
|
149
|
+
return str;
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
return num ? num.toLocaleString(undefined, { maximumFractionDigits: 1 }).
|
|
153
|
+
replace(/,\d{3},\d{3},\d{3}/, "B").
|
|
154
|
+
replace(/,\d{3},\d{3}/, "M").
|
|
155
|
+
replace(/,\d{3}/, "K") : '0';
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
mystartsWith(str, query) {
|
|
159
|
+
try {
|
|
160
|
+
var qLen = query.length;
|
|
161
|
+
return str.substring(0, qLen) === query ? true : false;
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
isEnterKey(event) {
|
|
168
|
+
if (event) {
|
|
169
|
+
if (typeof event.key !== "undefined") {
|
|
170
|
+
return event.key === 'Enter';
|
|
171
|
+
}
|
|
172
|
+
else if (typeof event.keyIdentifier !== "undefined") {
|
|
173
|
+
return event.keyIdentifier === 'Enter';
|
|
174
|
+
}
|
|
175
|
+
else if (typeof event.keyCode !== "undefined") {
|
|
176
|
+
return event.keyCode === 13;
|
|
177
|
+
}
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
isTabKey(event) {
|
|
183
|
+
if (event) {
|
|
184
|
+
if (typeof event.key !== "undefined") {
|
|
185
|
+
return event.key === 'Tab';
|
|
186
|
+
}
|
|
187
|
+
else if (typeof event.keyIdentifier !== "undefined") {
|
|
188
|
+
return event.keyIdentifier === 'Tab';
|
|
189
|
+
}
|
|
190
|
+
else if (typeof event.keyCode !== "undefined") {
|
|
191
|
+
return event.keyCode === 9;
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
keyCanSearch(event) {
|
|
198
|
+
return (this.isSearchKey(event) ||
|
|
199
|
+
this.isBackKey(event) ||
|
|
200
|
+
this.isDeleteKey(event) ||
|
|
201
|
+
this.isSpaceKey(event));
|
|
202
|
+
}
|
|
203
|
+
isSearchKey(event) {
|
|
204
|
+
if (event && event.key !== undefined) {
|
|
205
|
+
return /^[A-Za-z0-9, ()&:\-.,#$!@]$/.test(event.key);
|
|
206
|
+
}
|
|
207
|
+
else if (event.keyIdentifier !== undefined) {
|
|
208
|
+
return (/Key([a-zA-Z])/.test(event.keyIdentifier) ||
|
|
209
|
+
this.mystartsWith(event.keyIdentifier, "Digit") ||
|
|
210
|
+
this.mystartsWith(event.keyIdentifier, "Numpad"));
|
|
211
|
+
}
|
|
212
|
+
else if (event.keyCode !== undefined) {
|
|
213
|
+
return ((event.keyCode >= 65 && event.keyCode <= 90) ||
|
|
214
|
+
(event.keyCode >= 48 && event.keyCode <= 57) ||
|
|
215
|
+
(event.keyCode >= 96 && event.keyCode <= 105));
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
isBackKey(event) {
|
|
220
|
+
if (event && event.key !== undefined) {
|
|
221
|
+
return event.key === 'Backspace';
|
|
222
|
+
}
|
|
223
|
+
else if (event.keyIdentifier !== undefined) {
|
|
224
|
+
return event.keyIdentifier === 'Backspace';
|
|
225
|
+
}
|
|
226
|
+
else if (event.keyCode !== undefined) {
|
|
227
|
+
return event.keyCode === 8;
|
|
228
|
+
}
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
isDeleteKey(event) {
|
|
232
|
+
if (event && event.key !== undefined) {
|
|
233
|
+
return event.key === 'Delete';
|
|
234
|
+
}
|
|
235
|
+
else if (event.keyIdentifier !== undefined) {
|
|
236
|
+
return event.keyIdentifier === 'Delete';
|
|
237
|
+
}
|
|
238
|
+
else if (event.keyCode !== undefined) {
|
|
239
|
+
return event.keyCode === 46;
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
isSpaceKey(event) {
|
|
244
|
+
if (event && event.key !== undefined) {
|
|
245
|
+
return event.key == " ";
|
|
246
|
+
}
|
|
247
|
+
else if (event.keyIdentifier !== undefined) {
|
|
248
|
+
return event.keyIdentifier == " ";
|
|
249
|
+
}
|
|
250
|
+
else if (event.keyCode !== undefined) {
|
|
251
|
+
return event.keyCode === 32;
|
|
252
|
+
}
|
|
253
|
+
else if (event.code !== undefined) {
|
|
254
|
+
return event.code === "Space";
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
isDownKey(event) {
|
|
259
|
+
if (event && event.key !== undefined) {
|
|
260
|
+
return event.key === 'ArrowDown';
|
|
261
|
+
}
|
|
262
|
+
else if (event.keyIdentifier !== undefined) {
|
|
263
|
+
return event.keyIdentifier === 'ArrowDown';
|
|
264
|
+
}
|
|
265
|
+
else if (event.keyCode !== undefined) {
|
|
266
|
+
return event.keyCode === 40;
|
|
267
|
+
}
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
isUpKey(event) {
|
|
271
|
+
if (event && event.key !== undefined) {
|
|
272
|
+
return event.key === 'ArrowUp';
|
|
273
|
+
}
|
|
274
|
+
else if (event.keyIdentifier !== undefined) {
|
|
275
|
+
return event.keyIdentifier === 'ArrowUp';
|
|
276
|
+
}
|
|
277
|
+
else if (event.keyCode !== undefined) {
|
|
278
|
+
return event.keyCode === 38;
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
dontSan(val) {
|
|
283
|
+
if (val && (this.testShortDate(val) || this.testISODate(val)))
|
|
284
|
+
return true;
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
sanitizeUi(val) {
|
|
288
|
+
if (val) {
|
|
289
|
+
if (this.dontSan(val))
|
|
290
|
+
return val;
|
|
291
|
+
var entityMap = {
|
|
292
|
+
'<': '<',
|
|
293
|
+
'>': '>',
|
|
294
|
+
};
|
|
295
|
+
return typeof val === "string" ? val.replace(/[<>]/g, s => {
|
|
296
|
+
return entityMap[s];
|
|
297
|
+
}) : val;
|
|
298
|
+
}
|
|
299
|
+
else
|
|
300
|
+
return val === 0 ? val : '';
|
|
301
|
+
}
|
|
302
|
+
unbindMouseEvent(e) {
|
|
303
|
+
e && e.stopPropagation();
|
|
304
|
+
}
|
|
305
|
+
getRgbParts(rgb) {
|
|
306
|
+
try {
|
|
307
|
+
const clst = rgb.replace(/rgb[\(\)]/g, "").split(",");
|
|
308
|
+
return { r: parseInt(clst[0].trim()), g: parseInt(clst[1].trim()), b: parseInt(clst[2].trim()) };
|
|
309
|
+
}
|
|
310
|
+
catch (e) {
|
|
311
|
+
return { r: 255, g: 255, b: 255 };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
componentToHex(c) {
|
|
315
|
+
const hex = c.toString(16);
|
|
316
|
+
return hex.length == 1 ? "0" + hex : hex;
|
|
317
|
+
}
|
|
318
|
+
rgbToHex(r, g, b) {
|
|
319
|
+
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
320
|
+
}
|
|
321
|
+
hexToRgb(hex) {
|
|
322
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
323
|
+
return result ? {
|
|
324
|
+
r: parseInt(result[1], 16),
|
|
325
|
+
g: parseInt(result[2], 16),
|
|
326
|
+
b: parseInt(result[3], 16)
|
|
327
|
+
} : null;
|
|
328
|
+
}
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CommonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
330
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CommonService, providedIn: 'root' });
|
|
331
|
+
}
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CommonService, decorators: [{
|
|
333
|
+
type: Injectable,
|
|
334
|
+
args: [{
|
|
335
|
+
providedIn: 'root'
|
|
336
|
+
}]
|
|
337
|
+
}] });
|
|
338
|
+
|
|
339
|
+
class DataTableService {
|
|
340
|
+
common;
|
|
341
|
+
http;
|
|
342
|
+
constructor(common, http) {
|
|
343
|
+
this.common = common;
|
|
344
|
+
this.http = http;
|
|
345
|
+
}
|
|
346
|
+
sortOrder = [];
|
|
347
|
+
mainData = [];
|
|
348
|
+
mainDataLen = 0;
|
|
349
|
+
tblTop = 0;
|
|
350
|
+
tblBot = 0;
|
|
351
|
+
tblLeft = 0;
|
|
352
|
+
tblRight = 0;
|
|
353
|
+
dpLim = 1000;
|
|
354
|
+
currFilData = [];
|
|
355
|
+
currMapping = {};
|
|
356
|
+
mapperWorkerId = 1;
|
|
357
|
+
dTblHeight = 500;
|
|
358
|
+
defltRHgt = "50px";
|
|
359
|
+
isSorting = false;
|
|
360
|
+
isFiltering = false;
|
|
361
|
+
themeColor1 = null;
|
|
362
|
+
themeColor2 = null;
|
|
363
|
+
currEditCol = "";
|
|
364
|
+
currEditIndex = -1;
|
|
365
|
+
visibleCols = [];
|
|
366
|
+
currColumnEdit = null;
|
|
367
|
+
useColWid = "100px";
|
|
368
|
+
firstCol = "";
|
|
369
|
+
primaryKey = "";
|
|
370
|
+
autoScrollOnEdit = false;
|
|
371
|
+
setIdealColumnWidth = new Subject();
|
|
372
|
+
currSelRows = []; //just be an index of mainData
|
|
373
|
+
displayOnlySelRows = false;
|
|
374
|
+
noDataMsg = "Loading Demo...";
|
|
375
|
+
deboTotal = "deebo_total";
|
|
376
|
+
bgSep = "__forbargX";
|
|
377
|
+
errorLoading = false;
|
|
378
|
+
dataFilSrtTracker = {};
|
|
379
|
+
comparatorOpts = {
|
|
380
|
+
text: ["Equals", "Not Equal", "Empty", "Not Empty", "Contains"],
|
|
381
|
+
number: ["Equals", "Not Equal", "Empty", "Not Empty"],
|
|
382
|
+
date: ["Equals", "Not on", "Empty", "Not Empty"],
|
|
383
|
+
};
|
|
384
|
+
badStrings = ["null", "NULL", "Null", "undefined", "UNDEFINED", "Undefined"];
|
|
385
|
+
/*numeric columns can have a predefined symbol up to 2 characters long,
|
|
386
|
+
add these based on columns (object properties) coming from your api*/
|
|
387
|
+
columnSymbols = [
|
|
388
|
+
{ column: "width", symbol: "px" },
|
|
389
|
+
];
|
|
390
|
+
getNewTrackerObj(colName) {
|
|
391
|
+
const symbol = this.columnSymbols.filter(c => c.column === colName)[0]?.symbol?.substring(0, 2);
|
|
392
|
+
return {
|
|
393
|
+
filter: "",
|
|
394
|
+
comparator: "",
|
|
395
|
+
sort: null,
|
|
396
|
+
type: "string",
|
|
397
|
+
minimize: false,
|
|
398
|
+
freeze: false,
|
|
399
|
+
colWidth: null,
|
|
400
|
+
colCellSymbol: symbol,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
setTblVertBounds() {
|
|
404
|
+
this.tblBot = (document.getElementById("tableFooter")?.getBoundingClientRect().top || 0);
|
|
405
|
+
this.tblTop = (document.getElementsByClassName("data-table-headers")[0]?.getBoundingClientRect().bottom || 0);
|
|
406
|
+
}
|
|
407
|
+
setTblHorizBounds() {
|
|
408
|
+
const dtBds = document.getElementsByClassName("data-table")[0]?.getBoundingClientRect();
|
|
409
|
+
if (dtBds) {
|
|
410
|
+
this.tblLeft = (dtBds.left || 0) - 200;
|
|
411
|
+
this.tblRight = (dtBds.right || 0) + 250;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
setTblBounds() {
|
|
415
|
+
this.setTblVertBounds(); //critical, do it again it's ok
|
|
416
|
+
this.setTblHorizBounds();
|
|
417
|
+
}
|
|
418
|
+
elIsAboveFold(el, top) {
|
|
419
|
+
if (el) {
|
|
420
|
+
const elRect = el.getBoundingClientRect();
|
|
421
|
+
if (el && elRect && elRect.bottom < top)
|
|
422
|
+
return true;
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
elIsBelowFold(el, top) {
|
|
428
|
+
if (el) {
|
|
429
|
+
const elRect = el.getBoundingClientRect();
|
|
430
|
+
if (el && elRect && elRect.top > top)
|
|
431
|
+
return true;
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
buildDataFilSrtTracker(data) {
|
|
437
|
+
let i = 0;
|
|
438
|
+
let obj = {};
|
|
439
|
+
const len = data.length;
|
|
440
|
+
for (i; i < len; i++)
|
|
441
|
+
obj[data[i]] = this.getNewTrackerObj(data[i]);
|
|
442
|
+
return obj;
|
|
443
|
+
}
|
|
444
|
+
resetFilSrtTracker() {
|
|
445
|
+
for (const prop in this.dataFilSrtTracker) {
|
|
446
|
+
const fsObj = this.dataFilSrtTracker[prop];
|
|
447
|
+
const oType = fsObj["type"]; //keep
|
|
448
|
+
const oWid = fsObj["colWidth"]; //keep
|
|
449
|
+
const sym = fsObj["colCellSymbol"]; //keep
|
|
450
|
+
const min = false;
|
|
451
|
+
const compToUse = "";
|
|
452
|
+
this.dataFilSrtTracker[prop] = { filter: "", comparator: compToUse, sort: null, type: oType, minimize: min,
|
|
453
|
+
freeze: false, colWidth: oWid, colCellSymbol: sym,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
figureCellText(text, notNum, symbol) {
|
|
458
|
+
if (this.common.isADateObject(text))
|
|
459
|
+
return { prop: "textContent", value: text.toLocaleDateString() };
|
|
460
|
+
if ((text && this.badStrings.indexOf(text) < 0) || (text === 0)) {
|
|
461
|
+
if (notNum) {
|
|
462
|
+
const isProd = true;
|
|
463
|
+
if (/[<>]/g.test(text) || (!/(blob:)?((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-:]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w\-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w\.\/-]*))?)/g.test(text)))
|
|
464
|
+
return { prop: "textContent", value: text };
|
|
465
|
+
let useText = text;
|
|
466
|
+
const urls = text.matchAll(/(blob:)?((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-:]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w\-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w\.\/-]*))?)/g);
|
|
467
|
+
if (urls) {
|
|
468
|
+
try {
|
|
469
|
+
let imgs = [];
|
|
470
|
+
let ancs = [];
|
|
471
|
+
const blobSchm = (isProd ? "blob:https://" : "blob:http://");
|
|
472
|
+
const blobUrl = blobSchm + location.host;
|
|
473
|
+
let i = 0;
|
|
474
|
+
let a = 0;
|
|
475
|
+
for (const url of urls) {
|
|
476
|
+
const low = (url[0] && typeof url[0] === "string") ? url[0].toLocaleLowerCase() : "";
|
|
477
|
+
if ((this.common.mystartsWith(low, "https") || this.common.mystartsWith(low, blobUrl)) && /(blob|\.)/g.test(low)) {
|
|
478
|
+
if (imgs.indexOf(url[0]) < 0 && (this.common.mystartsWith(low, blobUrl) ||
|
|
479
|
+
/\.(webp|jpeg|jpg|png|jfif|pjpeg|pjp|avif)/g.test(url[0].toLocaleLowerCase()))) {
|
|
480
|
+
imgs.push(url[0].split("?")[0]);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
if (ancs.indexOf(url[0]) < 0)
|
|
484
|
+
ancs.push(url[0] /*.split("?")[0]*/);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
const ilen = imgs.length;
|
|
489
|
+
const alen = ancs.length;
|
|
490
|
+
for (i; i < ilen; i++)
|
|
491
|
+
useText = useText.replace(new RegExp(imgs[i], "g"), ' <img src="' + imgs[i] + '" alt="Image in cell data" /> ');
|
|
492
|
+
for (a; a < alen; a++) { //only get ones with space at first
|
|
493
|
+
const anc = ancs[a];
|
|
494
|
+
useText = useText.replace(new RegExp((anc.replace(/\?/g, "\\?") + " "), "g"), (' <a href="' + anc + '" target="_blank">' + anc + '</a> '));
|
|
495
|
+
if (useText.endsWith(anc))
|
|
496
|
+
useText = useText.replace(new RegExp(" " + anc.replace(/\?/g, "\\?"), "g"), (' <a href="' + anc + '" target="_blank">' + anc + '</a>'));
|
|
497
|
+
if (useText === anc)
|
|
498
|
+
useText = useText.replace(new RegExp(anc.replace(/\?/g, "\\?"), "g"), ('<a href="' + anc + '" target="_blank">' + anc + '</a>'));
|
|
499
|
+
}
|
|
500
|
+
if (imgs.length || ancs.length)
|
|
501
|
+
return { prop: "innerHTML", value: useText, ancs: ancs };
|
|
502
|
+
return { prop: "textContent", value: this.common.sanitizeUi(text) };
|
|
503
|
+
}
|
|
504
|
+
catch (e) {
|
|
505
|
+
return { prop: "textContent", value: this.common.sanitizeUi(text) };
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return { prop: "textContent", value: this.common.sanitizeUi(text) };
|
|
509
|
+
}
|
|
510
|
+
try {
|
|
511
|
+
const minFracDigs = (symbol && ["$", "€", "£", "¥", "₣", "₹"].indexOf(symbol) > -1) ? 2 : 0;
|
|
512
|
+
if (typeof text === "number")
|
|
513
|
+
return { prop: "textContent", value: text.toLocaleString(undefined, { minimumFractionDigits: minFracDigs, maximumFractionDigits: 2 }) };
|
|
514
|
+
const numVal = /\./g.test(text) ? parseFloat(text) : parseInt(text);
|
|
515
|
+
if (!isNaN(numVal))
|
|
516
|
+
return { prop: "textContent", value: numVal.toLocaleString(undefined, { minimumFractionDigits: minFracDigs, maximumFractionDigits: 2 }) };
|
|
517
|
+
return { prop: "textContent", value: this.common.sanitizeUi(text) };
|
|
518
|
+
}
|
|
519
|
+
catch (e) {
|
|
520
|
+
return { prop: "textContent", value: this.common.sanitizeUi(text) };
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return { prop: "textContent", value: " " };
|
|
524
|
+
}
|
|
525
|
+
figureFilterType(col) {
|
|
526
|
+
const item = this.dataFilSrtTracker[col];
|
|
527
|
+
if (item) {
|
|
528
|
+
switch (item.type) {
|
|
529
|
+
case "string":
|
|
530
|
+
return "text";
|
|
531
|
+
case "number":
|
|
532
|
+
return "number";
|
|
533
|
+
case "date":
|
|
534
|
+
return "date";
|
|
535
|
+
default:
|
|
536
|
+
return "text";
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return "text";
|
|
540
|
+
}
|
|
541
|
+
mapCompToSym(comp) {
|
|
542
|
+
switch (comp) { //not all comps will get converted
|
|
543
|
+
case "Equals":
|
|
544
|
+
return "=";
|
|
545
|
+
case "Not Equal":
|
|
546
|
+
return "!=";
|
|
547
|
+
}
|
|
548
|
+
return comp;
|
|
549
|
+
}
|
|
550
|
+
clearAllFocused() {
|
|
551
|
+
const els = document.getElementsByClassName("focused-el");
|
|
552
|
+
const len = els.length;
|
|
553
|
+
for (var i = (len - 1); i >= 0; i--)
|
|
554
|
+
els[i].classList.remove("focused-el");
|
|
555
|
+
}
|
|
556
|
+
clearDCellFcsd() {
|
|
557
|
+
const els = document.getElementsByClassName("dragger-cell-focused");
|
|
558
|
+
const len = els.length;
|
|
559
|
+
for (let i = (len - 1); i >= 0; i--) {
|
|
560
|
+
const el = els[i];
|
|
561
|
+
if (el)
|
|
562
|
+
el.classList.remove("dragger-cell-focused");
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
findObjIndxInData(item, data) {
|
|
566
|
+
try {
|
|
567
|
+
if (this.primaryKey)
|
|
568
|
+
return (data || this.mainData).indexOf((data || this.mainData).find(d => d[this.primaryKey] === item[this.primaryKey]));
|
|
569
|
+
let i = 0;
|
|
570
|
+
let eq = 0;
|
|
571
|
+
const propLen = Object.keys(item).length;
|
|
572
|
+
const len = (data || this.mainData)?.length;
|
|
573
|
+
for (i; i < len; i++) {
|
|
574
|
+
eq = 0;
|
|
575
|
+
const mD = (data || this.mainData)[i];
|
|
576
|
+
for (const prop in item) {
|
|
577
|
+
if (item[prop] === mD[prop])
|
|
578
|
+
eq += 1;
|
|
579
|
+
if (eq === propLen) //they all equal
|
|
580
|
+
return i;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return -1;
|
|
584
|
+
}
|
|
585
|
+
catch (e) {
|
|
586
|
+
return -1;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
oneLevelSort(data, sortOrder, obj) {
|
|
590
|
+
let sortData = data.filter((d) => true);
|
|
591
|
+
if (sortOrder.length) {
|
|
592
|
+
const field = sortOrder[0];
|
|
593
|
+
if (field) {
|
|
594
|
+
const dir = obj[field]["sort"] === "asc" ? 1 : -1;
|
|
595
|
+
sortData = sortData.sort((a, b) => {
|
|
596
|
+
if (!a[field] && a[field] !== 0)
|
|
597
|
+
return 1;
|
|
598
|
+
if (!b[field] && b[field] !== 0)
|
|
599
|
+
return -1;
|
|
600
|
+
if (a[field] > b[field])
|
|
601
|
+
return (1 * dir);
|
|
602
|
+
if ((a[field] === b[field]) || (JSON.stringify(a[field]) === JSON.stringify(b[field])))
|
|
603
|
+
return 0;
|
|
604
|
+
return (-1 * dir);
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return sortData;
|
|
609
|
+
}
|
|
610
|
+
doSortOnField(field) {
|
|
611
|
+
if (!this.sortOrder.length) {
|
|
612
|
+
this.sortOrder.push(field);
|
|
613
|
+
this.dataFilSrtTracker[field]["sort"] = "asc";
|
|
614
|
+
}
|
|
615
|
+
else {
|
|
616
|
+
if (this.sortOrder.indexOf(field) > -1) { //clicking already sorted field
|
|
617
|
+
const currSort = this.dataFilSrtTracker[field]["sort"];
|
|
618
|
+
switch (currSort) {
|
|
619
|
+
case "desc":
|
|
620
|
+
this.dataFilSrtTracker[field]["sort"] = null;
|
|
621
|
+
this.sortOrder = this.sortOrder.filter((s) => s !== field);
|
|
622
|
+
break;
|
|
623
|
+
case "asc":
|
|
624
|
+
this.dataFilSrtTracker[field]["sort"] = "desc";
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
const currSrted = this.sortOrder[0];
|
|
630
|
+
if (currSrted)
|
|
631
|
+
this.dataFilSrtTracker[currSrted]["sort"] = null;
|
|
632
|
+
this.sortOrder = []; //clear wha'ts there
|
|
633
|
+
this.sortOrder.push(field);
|
|
634
|
+
this.dataFilSrtTracker[field]["sort"] = "asc";
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
this.currFilData = this.oneLevelSort(this.currFilData, this.sortOrder, this.dataFilSrtTracker);
|
|
638
|
+
}
|
|
639
|
+
nLevelFilter(data, filterVal, comparator, field) {
|
|
640
|
+
const sixHrs = (1000 * 60 * 60 * 6);
|
|
641
|
+
const oneDay = (1000 * 60 * 60 * 24);
|
|
642
|
+
const symReg = new RegExp(/[$€£₹¥¢\,]/, "g");
|
|
643
|
+
const isDtReg = new RegExp(/\d+(\/|-)\d+(\/|-)\d+/);
|
|
644
|
+
if (filterVal && typeof filterVal === "string") {
|
|
645
|
+
filterVal = filterVal.toLocaleLowerCase();
|
|
646
|
+
if (!this.common.idCol(field) && !isDtReg.test(filterVal) && !isNaN(parseInt(filterVal.replace(symReg, "")))) //not viewed as num, but can be
|
|
647
|
+
filterVal = /\./g.test(filterVal) ? parseFloat(filterVal.replace(symReg, "")) : parseInt(filterVal.replace(symReg, ""));
|
|
648
|
+
if (this.common.testShortDate(filterVal) || this.common.testISODate(filterVal) || this.common.testLongDate(filterVal))
|
|
649
|
+
filterVal = new Date(filterVal);
|
|
650
|
+
}
|
|
651
|
+
return data.filter((d) => {
|
|
652
|
+
if ((!filterVal && filterVal != "0") && (!comparator || (comparator && comparator !== "Not Empty" && comparator !== "Empty")))
|
|
653
|
+
return true;
|
|
654
|
+
let colVal = d[field];
|
|
655
|
+
if (typeof colVal === "string")
|
|
656
|
+
colVal = colVal.toLocaleLowerCase();
|
|
657
|
+
if (!comparator) { //what we did originally
|
|
658
|
+
if (typeof colVal === "string")
|
|
659
|
+
return (colVal == filterVal || colVal.startsWith(filterVal) || colVal.indexOf(filterVal) > -1);
|
|
660
|
+
if (typeof colVal === "number")
|
|
661
|
+
return (colVal == filterVal); //assume equals
|
|
662
|
+
if (this.common.isADateObject(filterVal) && this.common.isADateObject(colVal))
|
|
663
|
+
return Math.abs(colVal.getTime() - filterVal.getTime()) < sixHrs;
|
|
664
|
+
return colVal == filterVal;
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
if (comparator === "Equals") {
|
|
668
|
+
if (this.common.isADateObject(filterVal) && this.common.isADateObject(colVal))
|
|
669
|
+
return Math.abs(colVal.getTime() - filterVal.getTime()) < sixHrs;
|
|
670
|
+
return colVal == filterVal;
|
|
671
|
+
}
|
|
672
|
+
if (comparator === "Not Equal" || comparator === "Not on") {
|
|
673
|
+
if (this.common.isADateObject(filterVal) && this.common.isADateObject(colVal))
|
|
674
|
+
return Math.abs(colVal.getTime() - filterVal.getTime()) > oneDay;
|
|
675
|
+
return colVal != filterVal;
|
|
676
|
+
}
|
|
677
|
+
if (comparator === "Contains")
|
|
678
|
+
return colVal && ((typeof colVal === "string" && colVal.indexOf(filterVal) > -1) || colVal == filterVal);
|
|
679
|
+
if (comparator === "Not Empty") {
|
|
680
|
+
if (!filterVal && filterVal != "0")
|
|
681
|
+
return !!colVal || (colVal === 0); //just return non empty
|
|
682
|
+
//treat it like normal filter
|
|
683
|
+
if (typeof colVal === "string")
|
|
684
|
+
return (colVal == filterVal || colVal.startsWith(filterVal) || colVal.indexOf(filterVal) > -1);
|
|
685
|
+
if (typeof colVal === "number")
|
|
686
|
+
return (colVal == filterVal || colVal.toString().startsWith(filterVal) || colVal.toString().indexOf(filterVal) > -1);
|
|
687
|
+
if (this.common.isADateObject(filterVal) && this.common.isADateObject(colVal))
|
|
688
|
+
return Math.abs(colVal.getTime() - filterVal.getTime()) < sixHrs;
|
|
689
|
+
return colVal == filterVal;
|
|
690
|
+
}
|
|
691
|
+
if (comparator === "Empty")
|
|
692
|
+
return (!colVal && colVal !== 0);
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
}).sort((a, b) => {
|
|
696
|
+
if (comparator)
|
|
697
|
+
return 0;
|
|
698
|
+
const colVal = a[field];
|
|
699
|
+
if (colVal && typeof colVal === "string")
|
|
700
|
+
return (colVal.toLocaleLowerCase() == filterVal || colVal.toLocaleLowerCase().startsWith(filterVal)) ? -1 : 1;
|
|
701
|
+
if (colVal && typeof colVal === "number")
|
|
702
|
+
return (colVal == filterVal || colVal.toString().startsWith(filterVal)) ? -1 : 1;
|
|
703
|
+
return 0;
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
columnFilter(dataI, field, dataObj, sortOrder, manual) {
|
|
707
|
+
if (manual && !this.displayOnlySelRows && !dataObj[field].filter && this.arefilSrtTrkPropsDefault(true))
|
|
708
|
+
return this.currFilData = this.mainData.filter((d) => true);
|
|
709
|
+
const initData = !this.displayOnlySelRows ? dataI :
|
|
710
|
+
dataI.filter((d, ind) => { return this.currSelRows.indexOf(ind) > -1; });
|
|
711
|
+
let dataM = this.nLevelFilter(initData, dataObj[field].filter, dataObj[field].comparator, field);
|
|
712
|
+
const doWithoutFilt = ["Not Empty", "Empty"];
|
|
713
|
+
for (const prop in dataObj) {
|
|
714
|
+
if (field === prop)
|
|
715
|
+
continue;
|
|
716
|
+
if (dataObj[prop].filter || (dataObj[prop].comparator && doWithoutFilt.indexOf(dataObj[prop].comparator) > -1))
|
|
717
|
+
dataM = this.nLevelFilter(dataM, dataObj[prop].filter, dataObj[prop].comparator, prop);
|
|
718
|
+
}
|
|
719
|
+
this.currFilData = this.oneLevelSort(dataM, sortOrder, dataObj);
|
|
720
|
+
return this.currFilData;
|
|
721
|
+
}
|
|
722
|
+
getAllFilSrtInfo() {
|
|
723
|
+
let filinfo = "Filtered By:";
|
|
724
|
+
let srtinfo = "Sorted By:";
|
|
725
|
+
const doWithoutFilt = ["Not Empty", "Empty"];
|
|
726
|
+
const initB = " <span>";
|
|
727
|
+
for (const prop in this.dataFilSrtTracker) {
|
|
728
|
+
const obj = this.dataFilSrtTracker[prop];
|
|
729
|
+
const colNm = this.common.sanitizeUi(this.common.titleCase(prop));
|
|
730
|
+
if (obj && (obj.filter || (obj.comparator && doWithoutFilt.indexOf(obj.comparator) > -1))) {
|
|
731
|
+
const comp = this.mapCompToSym(obj.comparator ? obj.comparator : (obj.type === "string" ? "Contains" : "Equals"));
|
|
732
|
+
let propFilTxt = (initB + colNm + "</span> " + comp);
|
|
733
|
+
if (obj.filter)
|
|
734
|
+
propFilTxt += (initB + this.common.sanitizeUi(obj.filter) + "</span>");
|
|
735
|
+
if (propFilTxt.endsWith("Equals"))
|
|
736
|
+
propFilTxt = "";
|
|
737
|
+
if (filinfo === "Filtered By:") {
|
|
738
|
+
filinfo += propFilTxt;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
filinfo += ("," + propFilTxt);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
let s = 0;
|
|
746
|
+
const solen = this.sortOrder.length;
|
|
747
|
+
for (s; s < solen; s++) {
|
|
748
|
+
const prop = this.sortOrder[s];
|
|
749
|
+
const obj = this.dataFilSrtTracker[prop];
|
|
750
|
+
if (obj && obj.sort) {
|
|
751
|
+
const colNm = this.common.sanitizeUi(this.common.titleCase(prop));
|
|
752
|
+
const propSrtTxt = (initB + colNm + "</span> " + obj.sort);
|
|
753
|
+
if (srtinfo === "Sorted By:") {
|
|
754
|
+
srtinfo += propSrtTxt;
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
srtinfo += ("," + propSrtTxt);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (filinfo === "Filtered By:")
|
|
762
|
+
filinfo = "";
|
|
763
|
+
if (srtinfo === "Sorted By:")
|
|
764
|
+
srtinfo = "";
|
|
765
|
+
if (filinfo && srtinfo)
|
|
766
|
+
return (" • " + filinfo + " • " + srtinfo);
|
|
767
|
+
if (filinfo && !srtinfo)
|
|
768
|
+
return (" • " + filinfo);
|
|
769
|
+
if (!filinfo && srtinfo)
|
|
770
|
+
return (" • " + srtinfo);
|
|
771
|
+
return "";
|
|
772
|
+
}
|
|
773
|
+
easyFilter(val, dataI, sortOrder) {
|
|
774
|
+
const initData = !this.displayOnlySelRows ? dataI :
|
|
775
|
+
dataI.filter((d, ind) => { return this.currSelRows.indexOf(ind) > -1; });
|
|
776
|
+
let dataM = this.allDataFilter(val, initData);
|
|
777
|
+
this.currFilData = this.oneLevelSort(dataM, sortOrder, this.dataFilSrtTracker);
|
|
778
|
+
}
|
|
779
|
+
allDataFilter(filterVal, data) {
|
|
780
|
+
const sixHrs = (1000 * 60 * 60 * 6);
|
|
781
|
+
const symReg = new RegExp(/[$€£₹¥¢\,]/, "g");
|
|
782
|
+
const isDtReg = new RegExp(/\d+(\/|-)\d+(\/|-)\d+/);
|
|
783
|
+
if (filterVal && typeof filterVal === "string") {
|
|
784
|
+
filterVal = filterVal.toLocaleLowerCase();
|
|
785
|
+
if (!isDtReg.test(filterVal) && !isNaN(parseInt(filterVal.replace(symReg, "")))) //not viewed as num, but can be
|
|
786
|
+
filterVal = /\./g.test(filterVal) ? parseFloat(filterVal.replace(symReg, "")) : parseInt(filterVal.replace(symReg, ""));
|
|
787
|
+
if (this.common.testShortDate(filterVal) || this.common.testISODate(filterVal) || this.common.testLongDate(filterVal))
|
|
788
|
+
filterVal = new Date(filterVal);
|
|
789
|
+
}
|
|
790
|
+
return data.filter((d) => {
|
|
791
|
+
if (!filterVal && filterVal != "0")
|
|
792
|
+
return true;
|
|
793
|
+
for (const prop in d) {
|
|
794
|
+
let colVal = d[prop];
|
|
795
|
+
if (typeof colVal === "string")
|
|
796
|
+
colVal = colVal.toLocaleLowerCase();
|
|
797
|
+
if (typeof colVal === "string" && (colVal == filterVal || colVal.startsWith(filterVal) || colVal.indexOf(filterVal) > -1))
|
|
798
|
+
return true;
|
|
799
|
+
if (typeof colVal === "number" && (colVal == filterVal || colVal.toString().startsWith(filterVal) || colVal.toString().indexOf(filterVal) > -1))
|
|
800
|
+
return true;
|
|
801
|
+
if (this.common.isADateObject(filterVal) && this.common.isADateObject(colVal) &&
|
|
802
|
+
(Math.abs(colVal.getTime() - filterVal.getTime()) < sixHrs || (colVal == filterVal ||
|
|
803
|
+
colVal.startsWith(filterVal) || colVal.indexOf(filterVal) > -1)))
|
|
804
|
+
return true;
|
|
805
|
+
if (colVal == filterVal)
|
|
806
|
+
return true;
|
|
807
|
+
}
|
|
808
|
+
return false;
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
arefilSrtTrkPropsDefault(ignoreColFM) {
|
|
812
|
+
for (const prop in this.dataFilSrtTracker) {
|
|
813
|
+
// const elId= prop.replace(/ /g, this.common.uniSep)
|
|
814
|
+
const obj = this.dataFilSrtTracker[prop];
|
|
815
|
+
if (obj && (obj.filter || obj.comparator || obj.sort || obj.minimize || obj.freeze)) {
|
|
816
|
+
const fm = ignoreColFM ? true : (!obj.minimize && !obj.freeze);
|
|
817
|
+
const defComp = !obj.comparator || ["Equals", "Contains"].indexOf(obj.comparator) > -1;
|
|
818
|
+
if (!obj.filter && !obj.sort && fm && defComp /*&& document.getElementById("selectComp" + elId) */) {
|
|
819
|
+
//let it go
|
|
820
|
+
}
|
|
821
|
+
else
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return true;
|
|
826
|
+
}
|
|
827
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTableService, deps: [{ token: CommonService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
828
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTableService, providedIn: 'root' });
|
|
829
|
+
}
|
|
830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTableService, decorators: [{
|
|
831
|
+
type: Injectable,
|
|
832
|
+
args: [{
|
|
833
|
+
providedIn: 'root'
|
|
834
|
+
}]
|
|
835
|
+
}], ctorParameters: () => [{ type: CommonService }, { type: i2.HttpClient }] });
|
|
836
|
+
|
|
837
|
+
class TableDragService {
|
|
838
|
+
dataTableService;
|
|
839
|
+
common;
|
|
840
|
+
constructor(dataTableService, common) {
|
|
841
|
+
this.dataTableService = dataTableService;
|
|
842
|
+
this.common = common;
|
|
843
|
+
}
|
|
844
|
+
currDataRow;
|
|
845
|
+
currColForDataRow;
|
|
846
|
+
dTblHeight = 500;
|
|
847
|
+
currColumnEdit = "";
|
|
848
|
+
listenForMouseUp = false;
|
|
849
|
+
listenForSelectStart = false;
|
|
850
|
+
listenForColMvMouseUp = false;
|
|
851
|
+
colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: null, resized: false };
|
|
852
|
+
colDragStartFrmCellTracker = { col: null, row: null, xstart: null, ystart: null, resized: false };
|
|
853
|
+
tblDragStartFrmPagiTracker = { row: null, ystart: null, resized: false };
|
|
854
|
+
didResizeOnEvent = false;
|
|
855
|
+
colMoving = false;
|
|
856
|
+
headDims = new Subject();
|
|
857
|
+
cellDims = new Subject();
|
|
858
|
+
columnMove = new Subject();
|
|
859
|
+
dTblHeightOutput = new Subject();
|
|
860
|
+
checkItemBorderCursor(e, noColResize) {
|
|
861
|
+
try {
|
|
862
|
+
if (this.colMoving)
|
|
863
|
+
return;
|
|
864
|
+
const el = e.target;
|
|
865
|
+
if (el instanceof Element && /(col-header|data-cell)/g.test(el.className)) {
|
|
866
|
+
const offsx = 11;
|
|
867
|
+
const offsy = 9;
|
|
868
|
+
const cls = "moveable-col";
|
|
869
|
+
const rcls = "moveable-row";
|
|
870
|
+
const bds = el.getBoundingClientRect();
|
|
871
|
+
if (noColResize) {
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
if (e.offsetX >= bds.width - offsx) {
|
|
875
|
+
el.classList.add(cls);
|
|
876
|
+
el.classList.remove(rcls);
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
el.classList.remove(cls);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (e.offsetY >= bds.height - offsy) {
|
|
883
|
+
el.classList.add(rcls);
|
|
884
|
+
el.classList.remove(cls);
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
el.classList.remove(rcls);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
catch (err) { }
|
|
892
|
+
}
|
|
893
|
+
checkPaginatorBorderCursor(e) {
|
|
894
|
+
try {
|
|
895
|
+
const el = e.target;
|
|
896
|
+
if (el instanceof Element && /data-table-footer/g.test(el.className)) {
|
|
897
|
+
const offsy = 9;
|
|
898
|
+
const rcls = "moveable-row";
|
|
899
|
+
const bds = el.getBoundingClientRect();
|
|
900
|
+
if (e.offsetY >= bds.height - offsy) {
|
|
901
|
+
el.classList.add(rcls);
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
el.classList.remove(rcls);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
catch (err) { }
|
|
909
|
+
}
|
|
910
|
+
handleHeaderSizeAdjust(e) {
|
|
911
|
+
e && e.preventDefault();
|
|
912
|
+
let col;
|
|
913
|
+
const cls = "moveable-col";
|
|
914
|
+
const rcls = "moveable-row";
|
|
915
|
+
const clist = e.target.classList;
|
|
916
|
+
if (e.type === "mousedown") {
|
|
917
|
+
if (e && e.target.id && /columnHeader/g.test(e.target.id))
|
|
918
|
+
col = e.target;
|
|
919
|
+
if (e && e.target.parentElement.id && /columnHeader/g.test(e.target.parentElement.id))
|
|
920
|
+
col = e.target.parentElement;
|
|
921
|
+
if (col) {
|
|
922
|
+
const cBds = col.getBoundingClientRect();
|
|
923
|
+
if (clist.contains(cls)) {
|
|
924
|
+
let rootCol;
|
|
925
|
+
let useX = e.offsetX;
|
|
926
|
+
if (useX > ((cBds.right - cBds.left) / 2)) { //the one we're aiming for IS the target
|
|
927
|
+
useX = (useX - cBds.width);
|
|
928
|
+
rootCol = col.id.replace(/columnHeader/g, "");
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
if (!col.nextElementSibling && (e.offsetX > ((cBds.right - cBds.left) / 2))) //last and grabbing the end of it
|
|
932
|
+
rootCol = col.id.replace(/columnHeader/g, "");
|
|
933
|
+
else
|
|
934
|
+
rootCol = col.previousElementSibling.id.replace(/columnHeader/g, "");
|
|
935
|
+
}
|
|
936
|
+
this.dataTableService.currColumnEdit = rootCol;
|
|
937
|
+
this.colDragStartFrmHeaderTracker = { col: rootCol, xstart: useX, ystart: null, resized: false };
|
|
938
|
+
this.listenForMouseUp = true;
|
|
939
|
+
}
|
|
940
|
+
if (clist.contains(rcls)) {
|
|
941
|
+
this.dataTableService.currColumnEdit = null;
|
|
942
|
+
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: e.pageY, resized: false };
|
|
943
|
+
this.listenForMouseUp = true;
|
|
944
|
+
}
|
|
945
|
+
if (!clist.contains(cls) && !clist.contains(rcls)) { //drag column to diff position
|
|
946
|
+
let rootCol;
|
|
947
|
+
this.colMoving = true;
|
|
948
|
+
rootCol = col.id.replace(/columnHeader/g, "");
|
|
949
|
+
this.dataTableService.currColumnEdit = rootCol;
|
|
950
|
+
this.colDragStartFrmHeaderTracker = { col: rootCol, xstart: null, ystart: null, resized: false };
|
|
951
|
+
this.listenForColMvMouseUp = true;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
if (e.type === "mousemove") {
|
|
956
|
+
if (!this.colMoving) {
|
|
957
|
+
if (this.colDragStartFrmHeaderTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmHeaderTracker.col)
|
|
958
|
+
this.doHeaderWidth(e);
|
|
959
|
+
if (this.colDragStartFrmHeaderTracker.ystart)
|
|
960
|
+
this.doHeaderHeight(e);
|
|
961
|
+
}
|
|
962
|
+
else {
|
|
963
|
+
if (this.listenForColMvMouseUp)
|
|
964
|
+
this.handleColMoveMouseUp(e);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
handleCellSizeAdjust(e, rootCol) {
|
|
969
|
+
let col;
|
|
970
|
+
const cls = "moveable-col";
|
|
971
|
+
const rcls = "moveable-row";
|
|
972
|
+
const clist = e.target.classList;
|
|
973
|
+
if (e.type === "mousedown" && /data-cell/g.test(e.target.className)) {
|
|
974
|
+
if (e && e.target && /data-cell/g.test(e.target.className))
|
|
975
|
+
col = e.target;
|
|
976
|
+
if (e && e.target.parentElement && /data-cell/g.test(e.target.parentElement.className))
|
|
977
|
+
col = e.target.parentElement;
|
|
978
|
+
if (clist.contains(cls)) {
|
|
979
|
+
if (col) {
|
|
980
|
+
let useX = e.offsetX;
|
|
981
|
+
const cBds = col.getBoundingClientRect();
|
|
982
|
+
if (useX > ((cBds.right - cBds.left) / 2)) { //the one we're aiming for IS the target
|
|
983
|
+
useX = (useX - cBds.width);
|
|
984
|
+
}
|
|
985
|
+
if (rootCol) {
|
|
986
|
+
this.dataTableService.currColumnEdit = rootCol;
|
|
987
|
+
this.colDragStartFrmCellTracker = { col: rootCol, row: null, xstart: useX, ystart: null, resized: false };
|
|
988
|
+
this.listenForMouseUp = true;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
if (clist.contains(rcls)) {
|
|
993
|
+
this.dataTableService.currColumnEdit = null;
|
|
994
|
+
if (!this.currDataRow) {
|
|
995
|
+
this.currColForDataRow = rootCol; //this lets us process the sub once on a given cell
|
|
996
|
+
this.currDataRow = document.getElementById(col.getAttribute("data-index"));
|
|
997
|
+
}
|
|
998
|
+
this.colDragStartFrmCellTracker = { col: null, row: this.currDataRow, xstart: null, ystart: e.offsetY, resized: false };
|
|
999
|
+
this.listenForMouseUp = true;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
if (e.type === "mousemove") {
|
|
1003
|
+
if (this.colDragStartFrmCellTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmCellTracker.col)
|
|
1004
|
+
this.doCellWidth(e);
|
|
1005
|
+
if (this.colDragStartFrmCellTracker.row && this.colDragStartFrmCellTracker.ystart)
|
|
1006
|
+
this.doRowHeight(e);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
handleTableHeightAdjust(e) {
|
|
1010
|
+
const rcls = "moveable-row";
|
|
1011
|
+
const clist = e.target.classList;
|
|
1012
|
+
if (e.type === "mousedown" && /data-table-footer/g.test(e.target.className)) {
|
|
1013
|
+
this.listenForSelectStart = true;
|
|
1014
|
+
if (clist.contains(rcls)) {
|
|
1015
|
+
this.tblDragStartFrmPagiTracker = { row: e.target, ystart: e.offsetY, resized: false };
|
|
1016
|
+
this.listenForMouseUp = true;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
if (e.type === "mousemove") {
|
|
1020
|
+
if (this.tblDragStartFrmPagiTracker.row && this.tblDragStartFrmPagiTracker.ystart)
|
|
1021
|
+
this.doTblHeight(e);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
doHeaderWidth(e) {
|
|
1025
|
+
try {
|
|
1026
|
+
const head = document.getElementById("columnHeader" + this.colDragStartFrmHeaderTracker.col);
|
|
1027
|
+
if (head) {
|
|
1028
|
+
const hbds = head?.getBoundingClientRect();
|
|
1029
|
+
const useWid = e.pageX - (hbds.left + window.scrollX);
|
|
1030
|
+
this.colDragStartFrmHeaderTracker.resized = true;
|
|
1031
|
+
this.headDims.next({ prop: "width", value: Math.floor(Math.max(30, useWid)) });
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
catch (err) { }
|
|
1035
|
+
}
|
|
1036
|
+
doHeaderHeight(e) {
|
|
1037
|
+
try {
|
|
1038
|
+
const hdrs = document.querySelector(".col-header:not(.col-header-minimized)") || document.getElementById("dataTableHeaders");
|
|
1039
|
+
if (hdrs) {
|
|
1040
|
+
const hdrbds = hdrs.getBoundingClientRect();
|
|
1041
|
+
const useHgt = e.pageY - (hdrbds.top + window.scrollY);
|
|
1042
|
+
this.colDragStartFrmHeaderTracker.resized = true;
|
|
1043
|
+
this.headDims.next({ prop: "height", value: Math.floor(Math.max(30, useHgt)) });
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
catch (err) { }
|
|
1047
|
+
}
|
|
1048
|
+
doCellWidth(e) {
|
|
1049
|
+
try {
|
|
1050
|
+
const head = document.getElementById("columnHeader" + this.colDragStartFrmCellTracker.col); //this looks outta place but is ok here
|
|
1051
|
+
if (head) {
|
|
1052
|
+
const useWid = e.pageX - (head.getBoundingClientRect().left + window.scrollX);
|
|
1053
|
+
this.colDragStartFrmCellTracker.resized = true;
|
|
1054
|
+
this.cellDims.next({ prop: "width", value: Math.floor(Math.max(30, useWid)) });
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
catch (err) { }
|
|
1058
|
+
}
|
|
1059
|
+
doRowHeight(e) {
|
|
1060
|
+
try {
|
|
1061
|
+
const rowbds = this.colDragStartFrmCellTracker.row.getBoundingClientRect();
|
|
1062
|
+
const useHgt = e.pageY - (rowbds.top + window.scrollY);
|
|
1063
|
+
this.colDragStartFrmCellTracker.resized = true;
|
|
1064
|
+
this.cellDims.next({ row: this.colDragStartFrmCellTracker.row, prop: "height", value: Math.floor(Math.max(30, useHgt)) });
|
|
1065
|
+
}
|
|
1066
|
+
catch (err) { }
|
|
1067
|
+
}
|
|
1068
|
+
doTblHeight(e) {
|
|
1069
|
+
try {
|
|
1070
|
+
const rowbds = this.tblDragStartFrmPagiTracker.row.getBoundingClientRect();
|
|
1071
|
+
const useHgt = e.pageY - (rowbds.bottom + window.scrollY);
|
|
1072
|
+
this.tblDragStartFrmPagiTracker.resized = true;
|
|
1073
|
+
let max = 1000;
|
|
1074
|
+
if (isNaN(max))
|
|
1075
|
+
max = 700;
|
|
1076
|
+
const tblWant = Math.min((this.dTblHeight + useHgt), max);
|
|
1077
|
+
this.dTblHeight = Math.floor(Math.max(tblWant, 100));
|
|
1078
|
+
this.dTblHeightOutput.next(this.dTblHeight);
|
|
1079
|
+
}
|
|
1080
|
+
catch (err) { }
|
|
1081
|
+
}
|
|
1082
|
+
handleColResMouseUp(e) {
|
|
1083
|
+
try {
|
|
1084
|
+
e && e.preventDefault();
|
|
1085
|
+
}
|
|
1086
|
+
catch (e) { }
|
|
1087
|
+
if (this.colMoving)
|
|
1088
|
+
return;
|
|
1089
|
+
this.listenForMouseUp = false;
|
|
1090
|
+
if (this.colDragStartFrmHeaderTracker.ystart)
|
|
1091
|
+
this.doHeaderHeight(e);
|
|
1092
|
+
if (this.colDragStartFrmCellTracker.ystart)
|
|
1093
|
+
this.doRowHeight(e);
|
|
1094
|
+
if (this.colDragStartFrmHeaderTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmHeaderTracker.col)
|
|
1095
|
+
this.doHeaderWidth(e);
|
|
1096
|
+
if (this.colDragStartFrmCellTracker.col && this.dataTableService.currColumnEdit === this.colDragStartFrmCellTracker.col)
|
|
1097
|
+
this.doCellWidth(e);
|
|
1098
|
+
if (this.tblDragStartFrmPagiTracker.ystart) {
|
|
1099
|
+
this.doTblHeight(e);
|
|
1100
|
+
this.listenForSelectStart = false;
|
|
1101
|
+
}
|
|
1102
|
+
this.didResizeOnEvent = (this.colDragStartFrmCellTracker.resized ||
|
|
1103
|
+
this.colDragStartFrmHeaderTracker.resized || this.tblDragStartFrmPagiTracker.resized);
|
|
1104
|
+
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: null, resized: false };
|
|
1105
|
+
this.colDragStartFrmCellTracker = { col: null, row: null, xstart: null, ystart: null, resized: false };
|
|
1106
|
+
this.tblDragStartFrmPagiTracker = { row: null, ystart: null, resized: false };
|
|
1107
|
+
this.currDataRow = null;
|
|
1108
|
+
this.currColForDataRow = null;
|
|
1109
|
+
if (window.getSelection)
|
|
1110
|
+
window.getSelection()?.removeAllRanges();
|
|
1111
|
+
if (this.dataTableService.currColumnEdit) {
|
|
1112
|
+
const prop = this.common.replaceUniSep(this.dataTableService.currColumnEdit);
|
|
1113
|
+
if (this.dataTableService.dataFilSrtTracker[prop] && this.dataTableService.dataFilSrtTracker[prop].colWidth) {
|
|
1114
|
+
const useWid = Math.min(2500, (parseInt(this.dataTableService.dataFilSrtTracker[prop].colWidth.replace(/[ ]?px/g, ""))));
|
|
1115
|
+
this.cellDims.next({ prop: "width", value: (Math.floor(Math.max(50, useWid))) });
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
setTimeout(() => {
|
|
1119
|
+
this.dataTableService.currColumnEdit = null;
|
|
1120
|
+
this.didResizeOnEvent = false;
|
|
1121
|
+
if (window.getSelection)
|
|
1122
|
+
window.getSelection()?.removeAllRanges();
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
handleColMoveMouseUp(e) {
|
|
1126
|
+
try {
|
|
1127
|
+
e && e.preventDefault();
|
|
1128
|
+
}
|
|
1129
|
+
catch (e) { }
|
|
1130
|
+
const isMUp = e && e.type === "mouseup";
|
|
1131
|
+
if (isMUp) {
|
|
1132
|
+
this.listenForColMvMouseUp = false;
|
|
1133
|
+
this.didResizeOnEvent = true;
|
|
1134
|
+
this.colDragStartFrmHeaderTracker = { col: null, xstart: null, ystart: null, resized: false };
|
|
1135
|
+
}
|
|
1136
|
+
if (this.colMoving) {
|
|
1137
|
+
if (window.getSelection)
|
|
1138
|
+
window.getSelection()?.removeAllRanges();
|
|
1139
|
+
if (this.dataTableService.currColumnEdit) {
|
|
1140
|
+
const colRef = document.getElementById("columnHeader" + this.dataTableService.currColumnEdit);
|
|
1141
|
+
if (colRef) {
|
|
1142
|
+
let xDrop = e.clientX;
|
|
1143
|
+
let i = 0;
|
|
1144
|
+
let lfts = [];
|
|
1145
|
+
let wantlfts = [];
|
|
1146
|
+
const cols = document.getElementsByClassName("col-header");
|
|
1147
|
+
const len = cols.length;
|
|
1148
|
+
const nwColLft = Math.floor(colRef.getBoundingClientRect().left);
|
|
1149
|
+
for (i; i < len; i++) {
|
|
1150
|
+
const col = cols[i];
|
|
1151
|
+
if (!col.classList.contains("col-header-minimized")) {
|
|
1152
|
+
const elLft = Math.floor(col.getBoundingClientRect().left);
|
|
1153
|
+
lfts.push(elLft);
|
|
1154
|
+
if (col.id !== colRef.id)
|
|
1155
|
+
wantlfts.push(elLft);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
wantlfts.push(xDrop);
|
|
1159
|
+
wantlfts = wantlfts.sort((a, b) => a - b);
|
|
1160
|
+
if (lfts.length && lfts.length === wantlfts.length)
|
|
1161
|
+
this.columnMove.next({ ls: lfts, nl: nwColLft, wl: wantlfts, x: xDrop });
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
if (isMUp) {
|
|
1165
|
+
setTimeout(() => {
|
|
1166
|
+
this.dataTableService.currColumnEdit = null;
|
|
1167
|
+
this.didResizeOnEvent = false;
|
|
1168
|
+
this.colMoving = false;
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
stopWindowSelection(e) {
|
|
1174
|
+
e.preventDefault();
|
|
1175
|
+
return false;
|
|
1176
|
+
}
|
|
1177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TableDragService, deps: [{ token: DataTableService }, { token: CommonService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1178
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TableDragService, providedIn: 'root' });
|
|
1179
|
+
}
|
|
1180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TableDragService, decorators: [{
|
|
1181
|
+
type: Injectable,
|
|
1182
|
+
args: [{
|
|
1183
|
+
providedIn: 'root'
|
|
1184
|
+
}]
|
|
1185
|
+
}], ctorParameters: () => [{ type: DataTableService }, { type: CommonService }] });
|
|
1186
|
+
|
|
1187
|
+
class DataTableHeader {
|
|
1188
|
+
common;
|
|
1189
|
+
tblDragService;
|
|
1190
|
+
dataTableService;
|
|
1191
|
+
constructor(common, tblDragService, dataTableService) {
|
|
1192
|
+
this.common = common;
|
|
1193
|
+
this.tblDragService = tblDragService;
|
|
1194
|
+
this.dataTableService = dataTableService;
|
|
1195
|
+
}
|
|
1196
|
+
init = false;
|
|
1197
|
+
showBtnX = false;
|
|
1198
|
+
autoMaxed = false;
|
|
1199
|
+
text = "";
|
|
1200
|
+
elCol = "";
|
|
1201
|
+
canTabScroll = true;
|
|
1202
|
+
compOpts = [];
|
|
1203
|
+
filterBuildUp = [];
|
|
1204
|
+
colWid = "";
|
|
1205
|
+
canFreeze = false;
|
|
1206
|
+
columnHeader;
|
|
1207
|
+
sort = new EventEmitter();
|
|
1208
|
+
render = new EventEmitter();
|
|
1209
|
+
width = new EventEmitter();
|
|
1210
|
+
height = new EventEmitter();
|
|
1211
|
+
reset = new EventEmitter();
|
|
1212
|
+
freeze = new EventEmitter();
|
|
1213
|
+
scrollOnFocus = new EventEmitter();
|
|
1214
|
+
colHeaderEl;
|
|
1215
|
+
filterInputEl;
|
|
1216
|
+
compSelectEl;
|
|
1217
|
+
ngOnInit() {
|
|
1218
|
+
this.elCol = this.common.elifyCol(this.columnHeader.column);
|
|
1219
|
+
this.text = this.common.titleCase(this.columnHeader.column);
|
|
1220
|
+
this.compOpts = [...this.dataTableService.comparatorOpts[this.columnHeader.dataType]];
|
|
1221
|
+
this.tblDragService.headDims.subscribe(d => { this.updateUiColCellTheme(d.prop, d.value); });
|
|
1222
|
+
this.dataTableService.setIdealColumnWidth.subscribe(c => { this.handleColResDblClick(this.columnHeader.column, true); });
|
|
1223
|
+
}
|
|
1224
|
+
ngAfterViewInit() {
|
|
1225
|
+
if (this.columnHeader.dataType === "date") {
|
|
1226
|
+
setTimeout(() => {
|
|
1227
|
+
this.filterInputEl?.nativeElement.addEventListener("change", e => { this.filterDateOnKeyUp(e); });
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
preventTabScroll() {
|
|
1232
|
+
this.canTabScroll = false;
|
|
1233
|
+
}
|
|
1234
|
+
emitTabFocus(col) {
|
|
1235
|
+
if (this.canTabScroll)
|
|
1236
|
+
this.scrollOnFocus.emit(col);
|
|
1237
|
+
}
|
|
1238
|
+
freezeColOnClick(e, prop) {
|
|
1239
|
+
e && e.stopPropagation();
|
|
1240
|
+
try {
|
|
1241
|
+
const currCol = this.dataTableService.dataFilSrtTracker[prop];
|
|
1242
|
+
if (currCol) {
|
|
1243
|
+
this.dataTableService.dataFilSrtTracker[prop].freeze = !currCol.freeze;
|
|
1244
|
+
const nowVal = this.dataTableService.dataFilSrtTracker[prop].freeze;
|
|
1245
|
+
if (nowVal)
|
|
1246
|
+
this.columnHeader.freeze = true;
|
|
1247
|
+
else
|
|
1248
|
+
this.columnHeader.freeze = false;
|
|
1249
|
+
this.freeze.emit(prop);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
catch (e) { }
|
|
1253
|
+
}
|
|
1254
|
+
doSortOnClick(e, col) {
|
|
1255
|
+
e && e.stopPropagation();
|
|
1256
|
+
this.canTabScroll = true;
|
|
1257
|
+
if (!this.dataTableService.isSorting) {
|
|
1258
|
+
this.dataTableService.isSorting = true;
|
|
1259
|
+
setTimeout(() => {
|
|
1260
|
+
this.dataTableService.doSortOnField(col);
|
|
1261
|
+
this.render.emit({ value: (this.dataTableService.dataFilSrtTracker[col].filter || ""), field: col });
|
|
1262
|
+
if (!this.dataTableService.currSelRows.length && this.dataTableService.arefilSrtTrkPropsDefault())
|
|
1263
|
+
this.reset.emit(col);
|
|
1264
|
+
this.dataTableService.isSorting = false;
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
resetColFilter(event, field) {
|
|
1269
|
+
event && event.stopPropagation();
|
|
1270
|
+
const fil = this.filterInputEl.nativeElement;
|
|
1271
|
+
const comp = this.compSelectEl.nativeElement;
|
|
1272
|
+
if (fil) {
|
|
1273
|
+
fil.value = "";
|
|
1274
|
+
comp.value = "";
|
|
1275
|
+
this.dataTableService.dataFilSrtTracker[field].comparator = null;
|
|
1276
|
+
this.filterOnKeyUp(event, field, "", true);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
filterDateOnKeyUp(event) {
|
|
1280
|
+
const elId = event.target?.id?.replace(/filter/g, "");
|
|
1281
|
+
const field = this.common.replaceUniSep(elId);
|
|
1282
|
+
this.filterOnKeyUp(event, field, event.target.value);
|
|
1283
|
+
}
|
|
1284
|
+
filterOnKeyUp(event, field, val, manual) {
|
|
1285
|
+
const filObj = { value: val, field: field };
|
|
1286
|
+
if (field && !this.dataTableService.isFiltering) {
|
|
1287
|
+
if (!manual && event && event.type !== "change" && !this.common.keyCanSearch(event))
|
|
1288
|
+
return;
|
|
1289
|
+
this.dataTableService.isFiltering = true;
|
|
1290
|
+
this.dataTableService.dataFilSrtTracker[field].filter = val || "";
|
|
1291
|
+
this.dataTableService.columnFilter(this.dataTableService.mainData, field, this.dataTableService.dataFilSrtTracker, this.dataTableService.sortOrder, manual);
|
|
1292
|
+
this.render.emit(filObj);
|
|
1293
|
+
setTimeout(() => {
|
|
1294
|
+
this.dataTableService.isFiltering = false;
|
|
1295
|
+
const buildUpLen = this.filterBuildUp.length;
|
|
1296
|
+
if (buildUpLen) {
|
|
1297
|
+
const filBld = this.filterBuildUp[(buildUpLen - 1)];
|
|
1298
|
+
this.filterOnKeyUp(null, filBld.field, filBld.value, true);
|
|
1299
|
+
this.filterBuildUp = [];
|
|
1300
|
+
if ((this.dataTableService.dataFilSrtTracker[field].filter ||
|
|
1301
|
+
(this.dataTableService.dataFilSrtTracker[field].comparator && this.dataTableService.dataFilSrtTracker[field].comparator != "Equals"))) {
|
|
1302
|
+
this.showBtnX = true;
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
this.showBtnX = false;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}, 500);
|
|
1309
|
+
if ((this.dataTableService.dataFilSrtTracker[field].filter ||
|
|
1310
|
+
(this.dataTableService.dataFilSrtTracker[field].comparator && this.dataTableService.dataFilSrtTracker[field].comparator != "Equals"))) {
|
|
1311
|
+
this.showBtnX = true;
|
|
1312
|
+
}
|
|
1313
|
+
else {
|
|
1314
|
+
this.showBtnX = false;
|
|
1315
|
+
}
|
|
1316
|
+
const tlFil = document.getElementsByName("topLevelDataFilter")[0];
|
|
1317
|
+
if (tlFil)
|
|
1318
|
+
tlFil.value = "";
|
|
1319
|
+
}
|
|
1320
|
+
else {
|
|
1321
|
+
if (!this.filterBuildUp.find(f => f.value === val && f.field === field))
|
|
1322
|
+
this.filterBuildUp.push(filObj);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
handleComparatorChange(col, comp) {
|
|
1326
|
+
if (col) {
|
|
1327
|
+
const value = this.dataTableService.dataFilSrtTracker[col].filter;
|
|
1328
|
+
this.dataTableService.dataFilSrtTracker[col].comparator = comp;
|
|
1329
|
+
this.filterOnKeyUp(null, col, (value || ""), true);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
updateUiColCellTheme(cssProp, val, col) {
|
|
1333
|
+
if (cssProp === "height")
|
|
1334
|
+
this.height.emit(val);
|
|
1335
|
+
const prop = col || this.common.replaceUniSep(this.dataTableService.currColumnEdit);
|
|
1336
|
+
if (prop && this.dataTableService.dataFilSrtTracker[prop]) {
|
|
1337
|
+
if (cssProp === "width") {
|
|
1338
|
+
this.dataTableService.dataFilSrtTracker[prop].colWidth = (val || parseInt(this.colWid)).toString();
|
|
1339
|
+
this.width.emit({ column: prop, value: val || parseInt(this.colWid) });
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
handleColResDblClick(prop, auto) {
|
|
1344
|
+
if (this.dataTableService.dataFilSrtTracker[prop] && (!auto || (!this.autoMaxed && this.dataTableService.visibleCols.includes(prop)))) {
|
|
1345
|
+
let i = 0;
|
|
1346
|
+
let wids = [];
|
|
1347
|
+
let useWid = 50;
|
|
1348
|
+
const els = document.getElementsByClassName("data-cell-" + this.common.elifyCol(prop));
|
|
1349
|
+
const nw = els[0]?.getBoundingClientRect().width || 0;
|
|
1350
|
+
const len = els.length;
|
|
1351
|
+
if (len) {
|
|
1352
|
+
for (i; i < len; i++)
|
|
1353
|
+
wids.push(els[i].scrollWidth);
|
|
1354
|
+
useWid = wids.sort()[(len - 1)];
|
|
1355
|
+
if (useWid && useWid > nw) {
|
|
1356
|
+
const cswid = Math.ceil(Math.max((useWid + 1), parseInt(this.dataTableService.useColWid.replace(/[ ]?px/g, ""))));
|
|
1357
|
+
this.updateUiColCellTheme("width", cswid, prop);
|
|
1358
|
+
this.autoMaxed = true;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTableHeader, deps: [{ token: CommonService }, { token: TableDragService }, { token: DataTableService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1364
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: DataTableHeader, isStandalone: true, selector: "app-data-table-header", inputs: { colWid: "colWid", canFreeze: "canFreeze", columnHeader: "columnHeader" }, outputs: { sort: "sort", render: "render", width: "width", height: "height", reset: "reset", freeze: "freeze", scrollOnFocus: "scrollOnFocus" }, viewQueries: [{ propertyName: "colHeaderEl", first: true, predicate: ["colHeader"], descendants: true, static: true }, { propertyName: "filterInputEl", first: true, predicate: ["filterInput"], descendants: true, static: true }, { propertyName: "compSelectEl", first: true, predicate: ["compSelect"], descendants: true, static: true }], ngImport: i0, template: "<div #colHeader [id]=\"'columnHeader' + elCol\" class=\"col-header\" (dblclick)=\"handleColResDblClick(columnHeader.column)\"\r\n[ngClass]=\"{ 'col-item-freeze': columnHeader.freeze, }\"\r\n[ngStyle]=\"{'width': columnHeader.width, 'height': columnHeader.height, 'lineHeight': columnHeader.lineHeight}\"\r\n(mousedown)=\"tblDragService.handleHeaderSizeAdjust($event)\" (mouseup)=\"tblDragService.handleColResMouseUp($event)\"\r\n(mousemove)=\"tblDragService.checkItemBorderCursor($event)\" (mousemove)=\"tblDragService.handleHeaderSizeAdjust($event)\">\r\n <span (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\"\r\n (click)=\"doSortOnClick($event, columnHeader.column)\" [class.span-disabled]=\"dataTableService.isSorting\">{{text}}</span>\r\n <button [id]=\"'btnSort' + elCol\" type=\"button\" [disabled]=\"dataTableService.isSorting\" (click)=\"doSortOnClick($event, columnHeader.column)\" class=\"data-sort-arr\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"preventTabScroll()\" (mouseup)=\"common.unbindMouseEvent($event)\"\r\n (focus)=\"emitTabFocus(elCol)\">\r\n <i class=\"material-icons v-mid\">{{dataTableService.dataFilSrtTracker[columnHeader.column].sort === \"asc\" ? \"arrow_downward\" : \"arrow_upward\"}}</i>\r\n </button>\r\n @if(dataTableService.sortOrder.indexOf(columnHeader.column) > -1){\r\n <sup [class.prevent]=\"dataTableService.isSorting\" (click)=\"doSortOnClick($event, columnHeader.column)\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" \r\n class=\"sort-order-indicator\">{{(dataTableService.sortOrder.indexOf(columnHeader.column)+1) | number}}</sup>\r\n }\r\n @if(canFreeze){\r\n <button type=\"button\" (click)=\"freezeColOnClick($event, columnHeader.column)\" class=\"btn-freeze-col\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <i class=\"material-icons\">featured_play_list</i>\r\n </button>\r\n }\r\n <br>\r\n @if(dataTableService.dataFilSrtTracker[columnHeader.column].filter){\r\n <button type=\"button\" class=\"btn-x-filter\" (click)=\"resetColFilter($event, columnHeader.column)\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >×</button>\r\n }\r\n <input #filterInput [name]=\"'filter' + elCol\" [id]=\"'filter' + elCol\"\r\n (input)=\"filterOnKeyUp($event, columnHeader.column, $any($event).target.value)\" maxlength=\"255\" autocomplete=\"off\" \r\n (keyup)=\"filterOnKeyUp($event, columnHeader.column, $any($event).target.value)\" [attr.type]=\"columnHeader.dataType\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" />\r\n <select #compSelect [id]=\"'selectComp' + elCol\" [name]=\"'selectComp' + elCol\" [(ngModel)]=\"dataTableService.dataFilSrtTracker[columnHeader.column].comparator\" \r\n (change)=\"handleComparatorChange(columnHeader.column, $any($event).target.value)\" class=\"select-filter-comparator\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <option value=\"\">Comparison?</option>\r\n @for(opt of compOpts; track opt){\r\n <option [value]=\"opt\" >{{opt}}</option>\r\n }\r\n </select>\r\n <div class=\"inline relly\" style=\"z-index: 1;\">\r\n <button class=\"btn-fil-comp\" type=\"button\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <i class=\"material-icons\" aria-hidden=\"false\">filter_list</i>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".btn-x-filter{padding:0;float:left;border:none;color:maroon;background:none;font-weight:600;font-size:x-large;line-height:16px;margin:17px 0 0 3px}.btn-x-filter:hover{background:#fdf3f3}.span-disabled{opacity:.5}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }] });
|
|
1365
|
+
}
|
|
1366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTableHeader, decorators: [{
|
|
1367
|
+
type: Component,
|
|
1368
|
+
args: [{ selector: 'app-data-table-header', imports: [CommonModule, FormsModule, DecimalPipe,], template: "<div #colHeader [id]=\"'columnHeader' + elCol\" class=\"col-header\" (dblclick)=\"handleColResDblClick(columnHeader.column)\"\r\n[ngClass]=\"{ 'col-item-freeze': columnHeader.freeze, }\"\r\n[ngStyle]=\"{'width': columnHeader.width, 'height': columnHeader.height, 'lineHeight': columnHeader.lineHeight}\"\r\n(mousedown)=\"tblDragService.handleHeaderSizeAdjust($event)\" (mouseup)=\"tblDragService.handleColResMouseUp($event)\"\r\n(mousemove)=\"tblDragService.checkItemBorderCursor($event)\" (mousemove)=\"tblDragService.handleHeaderSizeAdjust($event)\">\r\n <span (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\"\r\n (click)=\"doSortOnClick($event, columnHeader.column)\" [class.span-disabled]=\"dataTableService.isSorting\">{{text}}</span>\r\n <button [id]=\"'btnSort' + elCol\" type=\"button\" [disabled]=\"dataTableService.isSorting\" (click)=\"doSortOnClick($event, columnHeader.column)\" class=\"data-sort-arr\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"preventTabScroll()\" (mouseup)=\"common.unbindMouseEvent($event)\"\r\n (focus)=\"emitTabFocus(elCol)\">\r\n <i class=\"material-icons v-mid\">{{dataTableService.dataFilSrtTracker[columnHeader.column].sort === \"asc\" ? \"arrow_downward\" : \"arrow_upward\"}}</i>\r\n </button>\r\n @if(dataTableService.sortOrder.indexOf(columnHeader.column) > -1){\r\n <sup [class.prevent]=\"dataTableService.isSorting\" (click)=\"doSortOnClick($event, columnHeader.column)\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" \r\n class=\"sort-order-indicator\">{{(dataTableService.sortOrder.indexOf(columnHeader.column)+1) | number}}</sup>\r\n }\r\n @if(canFreeze){\r\n <button type=\"button\" (click)=\"freezeColOnClick($event, columnHeader.column)\" class=\"btn-freeze-col\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <i class=\"material-icons\">featured_play_list</i>\r\n </button>\r\n }\r\n <br>\r\n @if(dataTableService.dataFilSrtTracker[columnHeader.column].filter){\r\n <button type=\"button\" class=\"btn-x-filter\" (click)=\"resetColFilter($event, columnHeader.column)\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >×</button>\r\n }\r\n <input #filterInput [name]=\"'filter' + elCol\" [id]=\"'filter' + elCol\"\r\n (input)=\"filterOnKeyUp($event, columnHeader.column, $any($event).target.value)\" maxlength=\"255\" autocomplete=\"off\" \r\n (keyup)=\"filterOnKeyUp($event, columnHeader.column, $any($event).target.value)\" [attr.type]=\"columnHeader.dataType\" \r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" />\r\n <select #compSelect [id]=\"'selectComp' + elCol\" [name]=\"'selectComp' + elCol\" [(ngModel)]=\"dataTableService.dataFilSrtTracker[columnHeader.column].comparator\" \r\n (change)=\"handleComparatorChange(columnHeader.column, $any($event).target.value)\" class=\"select-filter-comparator\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <option value=\"\">Comparison?</option>\r\n @for(opt of compOpts; track opt){\r\n <option [value]=\"opt\" >{{opt}}</option>\r\n }\r\n </select>\r\n <div class=\"inline relly\" style=\"z-index: 1;\">\r\n <button class=\"btn-fil-comp\" type=\"button\"\r\n (mousemove)=\"common.unbindMouseEvent($event)\" (mousedown)=\"common.unbindMouseEvent($event)\" (mouseup)=\"common.unbindMouseEvent($event)\" >\r\n <i class=\"material-icons\" aria-hidden=\"false\">filter_list</i>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".btn-x-filter{padding:0;float:left;border:none;color:maroon;background:none;font-weight:600;font-size:x-large;line-height:16px;margin:17px 0 0 3px}.btn-x-filter:hover{background:#fdf3f3}.span-disabled{opacity:.5}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"] }]
|
|
1369
|
+
}], ctorParameters: () => [{ type: CommonService }, { type: TableDragService }, { type: DataTableService }], propDecorators: { colWid: [{
|
|
1370
|
+
type: Input
|
|
1371
|
+
}], canFreeze: [{
|
|
1372
|
+
type: Input
|
|
1373
|
+
}], columnHeader: [{
|
|
1374
|
+
type: Input
|
|
1375
|
+
}], sort: [{
|
|
1376
|
+
type: Output,
|
|
1377
|
+
args: ["sort"]
|
|
1378
|
+
}], render: [{
|
|
1379
|
+
type: Output,
|
|
1380
|
+
args: ["render"]
|
|
1381
|
+
}], width: [{
|
|
1382
|
+
type: Output,
|
|
1383
|
+
args: ["width"]
|
|
1384
|
+
}], height: [{
|
|
1385
|
+
type: Output,
|
|
1386
|
+
args: ["height"]
|
|
1387
|
+
}], reset: [{
|
|
1388
|
+
type: Output,
|
|
1389
|
+
args: ["reset"]
|
|
1390
|
+
}], freeze: [{
|
|
1391
|
+
type: Output,
|
|
1392
|
+
args: ["freeze"]
|
|
1393
|
+
}], scrollOnFocus: [{
|
|
1394
|
+
type: Output,
|
|
1395
|
+
args: ["scrollOnFocus"]
|
|
1396
|
+
}], colHeaderEl: [{
|
|
1397
|
+
type: ViewChild,
|
|
1398
|
+
args: ['colHeader', { static: true }]
|
|
1399
|
+
}], filterInputEl: [{
|
|
1400
|
+
type: ViewChild,
|
|
1401
|
+
args: ['filterInput', { static: true }]
|
|
1402
|
+
}], compSelectEl: [{
|
|
1403
|
+
type: ViewChild,
|
|
1404
|
+
args: ['compSelect', { static: true }]
|
|
1405
|
+
}] } });
|
|
1406
|
+
|
|
1407
|
+
class DataTablePaginator {
|
|
1408
|
+
dataTableService;
|
|
1409
|
+
tblDragService;
|
|
1410
|
+
common;
|
|
1411
|
+
constructor(dataTableService, tblDragService, common) {
|
|
1412
|
+
this.dataTableService = dataTableService;
|
|
1413
|
+
this.tblDragService = tblDragService;
|
|
1414
|
+
this.common = common;
|
|
1415
|
+
}
|
|
1416
|
+
init = true;
|
|
1417
|
+
isKeying = false;
|
|
1418
|
+
totalRowStr = "";
|
|
1419
|
+
rowinating = false;
|
|
1420
|
+
totalRows = 0;
|
|
1421
|
+
filSortStr = "";
|
|
1422
|
+
ngOnChanges(changes) {
|
|
1423
|
+
if (!this.init && changes) {
|
|
1424
|
+
if (changes["totalRows"])
|
|
1425
|
+
this.setUpPagi();
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
ngOnInit() {
|
|
1429
|
+
this.setUpPagi();
|
|
1430
|
+
this.init = false;
|
|
1431
|
+
}
|
|
1432
|
+
setUpPagi() {
|
|
1433
|
+
this.totalRowStr = this.totalRows.toLocaleString(undefined, { maximumFractionDigits: 0 });
|
|
1434
|
+
}
|
|
1435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTablePaginator, deps: [{ token: DataTableService }, { token: TableDragService }, { token: CommonService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: DataTablePaginator, isStandalone: true, selector: "app-data-table-paginator", inputs: { totalRows: "totalRows", filSortStr: "filSortStr" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"tableFooter\" class=\"data-table-footer\" (mousemove)=\"tblDragService.checkPaginatorBorderCursor($event)\" \r\n(mousemove)=\"tblDragService.handleTableHeightAdjust($event)\" (mousedown)=\"tblDragService.handleTableHeightAdjust($event)\" \r\n(mouseup)=\"tblDragService.handleColResMouseUp($event)\">\r\n <div class=\"three-qtr-wid\">\r\n <div class=\"inline v-mid semi-heavy lg-text\">{{totalRowStr}}</div> <div class=\"inline v-mid\">row{{totalRows === 1 ? \"\" : \"s\"}}</div>\r\n @if(filSortStr){\r\n <div class=\"inline v-mid\" [innerHTML]=\"filSortStr\"></div>\r\n }\r\n </div>\r\n</div>", styles: [":host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.data-table-footer{padding:15px;border-bottom-left-radius:7px;border-bottom-right-radius:7px;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.skip-to-contain{position:relative;display:inline-block;vertical-align:middle}.skip-to-options-hide{opacity:0;max-height:0;min-width:0;max-width:0;overflow:hidden}.skip-to-options{right:0;z-index:10;bottom:33px;border-radius:3px;position:absolute;background:#fff;vertical-align:middle;opacity:1!important;overflow:auto!important;min-width:175px!important;max-width:200px!important;max-height:200px!important;min-height:150px;box-shadow:0 0 3px 2px var(--grid-color);-moz-box-shadow:0 0 3px 2px var(--grid-color);-webkit-box-shadow:0 0 3px 2px var(--grid-color);transition:opacity .2s ease}.skip-to-options div{cursor:pointer;padding:15px 7px;text-align:left!important;border-bottom:1px solid var(--grid-color)}.skip-to-options div:hover{text-decoration:underline}.skip-to-options div:last-of-type{border-bottom:none}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }] });
|
|
1437
|
+
}
|
|
1438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataTablePaginator, decorators: [{
|
|
1439
|
+
type: Component,
|
|
1440
|
+
args: [{ selector: 'app-data-table-paginator', imports: [CommonModule, FormsModule,], template: "<div id=\"tableFooter\" class=\"data-table-footer\" (mousemove)=\"tblDragService.checkPaginatorBorderCursor($event)\" \r\n(mousemove)=\"tblDragService.handleTableHeightAdjust($event)\" (mousedown)=\"tblDragService.handleTableHeightAdjust($event)\" \r\n(mouseup)=\"tblDragService.handleColResMouseUp($event)\">\r\n <div class=\"three-qtr-wid\">\r\n <div class=\"inline v-mid semi-heavy lg-text\">{{totalRowStr}}</div> <div class=\"inline v-mid\">row{{totalRows === 1 ? \"\" : \"s\"}}</div>\r\n @if(filSortStr){\r\n <div class=\"inline v-mid\" [innerHTML]=\"filSortStr\"></div>\r\n }\r\n </div>\r\n</div>", styles: [":host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.data-table-footer{padding:15px;border-bottom-left-radius:7px;border-bottom-right-radius:7px;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.skip-to-contain{position:relative;display:inline-block;vertical-align:middle}.skip-to-options-hide{opacity:0;max-height:0;min-width:0;max-width:0;overflow:hidden}.skip-to-options{right:0;z-index:10;bottom:33px;border-radius:3px;position:absolute;background:#fff;vertical-align:middle;opacity:1!important;overflow:auto!important;min-width:175px!important;max-width:200px!important;max-height:200px!important;min-height:150px;box-shadow:0 0 3px 2px var(--grid-color);-moz-box-shadow:0 0 3px 2px var(--grid-color);-webkit-box-shadow:0 0 3px 2px var(--grid-color);transition:opacity .2s ease}.skip-to-options div{cursor:pointer;padding:15px 7px;text-align:left!important;border-bottom:1px solid var(--grid-color)}.skip-to-options div:hover{text-decoration:underline}.skip-to-options div:last-of-type{border-bottom:none}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"] }]
|
|
1441
|
+
}], ctorParameters: () => [{ type: DataTableService }, { type: TableDragService }, { type: CommonService }], propDecorators: { totalRows: [{
|
|
1442
|
+
type: Input
|
|
1443
|
+
}], filSortStr: [{
|
|
1444
|
+
type: Input
|
|
1445
|
+
}] } });
|
|
1446
|
+
|
|
1447
|
+
class DataCellComponent {
|
|
1448
|
+
tblDragService;
|
|
1449
|
+
dataTableService;
|
|
1450
|
+
common;
|
|
1451
|
+
constructor(tblDragService, dataTableService, common) {
|
|
1452
|
+
this.tblDragService = tblDragService;
|
|
1453
|
+
this.dataTableService = dataTableService;
|
|
1454
|
+
this.common = common;
|
|
1455
|
+
}
|
|
1456
|
+
init = true;
|
|
1457
|
+
ready = false;
|
|
1458
|
+
canEdit = false;
|
|
1459
|
+
elCol = "";
|
|
1460
|
+
cellStyle = {};
|
|
1461
|
+
setCellEditScrlActionTO = null;
|
|
1462
|
+
rawText;
|
|
1463
|
+
cell;
|
|
1464
|
+
rowId = ""; //starts with dataTableRow
|
|
1465
|
+
colWid = "";
|
|
1466
|
+
rowHeight = "";
|
|
1467
|
+
noColResize = false;
|
|
1468
|
+
width = new EventEmitter();
|
|
1469
|
+
height = new EventEmitter();
|
|
1470
|
+
edit = new EventEmitter();
|
|
1471
|
+
dragListen = new EventEmitter();
|
|
1472
|
+
validateEditFocus = new EventEmitter();
|
|
1473
|
+
clearVEditFocus = new EventEmitter();
|
|
1474
|
+
cellElem;
|
|
1475
|
+
rightAlign = ""; //for numbers, always add a space in front
|
|
1476
|
+
symbolCls = ""; //also for numbers only, always add a space in front
|
|
1477
|
+
ngOnChanges(changes) {
|
|
1478
|
+
if (!this.init) {
|
|
1479
|
+
if (this.cell.visible || changes["rowHeight"]) {
|
|
1480
|
+
if (typeof changes !== "undefined" && (changes["cell"] || changes["rowHeight"] || changes["colWid"]))
|
|
1481
|
+
this.applyDimensions();
|
|
1482
|
+
if (this.cell.visible && !this.ready)
|
|
1483
|
+
this.handleSettingText();
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
ngOnInit() {
|
|
1488
|
+
if (this.cell.visible)
|
|
1489
|
+
this.applyDimensions();
|
|
1490
|
+
if (this.cell.column)
|
|
1491
|
+
this.elCol = this.common.elifyCol(this.cell.column);
|
|
1492
|
+
this.rightAlign = this.cell.dataType === "number" ? " data-cell-riiight" : "";
|
|
1493
|
+
this.applySymbol();
|
|
1494
|
+
this.canEdit = this.cell.editable && !this.validateEdit(); //to see if free text edit
|
|
1495
|
+
this.init = false;
|
|
1496
|
+
this.tblDragService.cellDims.subscribe(d => { this.updateUiColCellTheme(d.prop, d.value); });
|
|
1497
|
+
}
|
|
1498
|
+
ngAfterViewInit() {
|
|
1499
|
+
if (this.cell.visible)
|
|
1500
|
+
this.handleSettingText();
|
|
1501
|
+
}
|
|
1502
|
+
validateEdit() {
|
|
1503
|
+
if (!this.cell.html && (["number", "date"].includes(this.cell.dataType)))
|
|
1504
|
+
return true;
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
applySymbol() {
|
|
1508
|
+
const sym = this.dataTableService.dataFilSrtTracker[this.cell.column]["colCellSymbol"];
|
|
1509
|
+
if (sym) {
|
|
1510
|
+
this.symbolCls = ["$", "€", "£", "¥", "₣", "₹"].indexOf(sym) > -1 ? " has-symbol-b" : " has-symbol";
|
|
1511
|
+
this.cellElem.nativeElement.setAttribute("data-symbol", sym);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
handleSettingText() {
|
|
1515
|
+
if (this.cell.text || (this.cell.html && !/<img/g.test(this.cell.html)))
|
|
1516
|
+
return this.setCellText();
|
|
1517
|
+
if (this.cell.html)
|
|
1518
|
+
setTimeout(() => { this.setCellText(); }, 100);
|
|
1519
|
+
}
|
|
1520
|
+
setCellText() {
|
|
1521
|
+
const cell = this.cellElem.nativeElement;
|
|
1522
|
+
if (this.cell.text && !cell.textContent)
|
|
1523
|
+
cell.textContent = this.cell.text;
|
|
1524
|
+
if (this.cell.html && !cell.innerHTML)
|
|
1525
|
+
cell.innerHTML = this.cell.html;
|
|
1526
|
+
this.ready = true;
|
|
1527
|
+
if (this.cell.html) {
|
|
1528
|
+
setTimeout(() => {
|
|
1529
|
+
const ancOIm = (document.querySelector("#" + this.rowId + " .data-cell-" + this.elCol + " a") ||
|
|
1530
|
+
document.querySelector("#" + this.rowId + " .data-cell-" + this.elCol + " img"));
|
|
1531
|
+
if (ancOIm) {
|
|
1532
|
+
ancOIm.addEventListener("mousemove", e => { e && e.stopPropagation(); });
|
|
1533
|
+
ancOIm.addEventListener("mousedown", e => { e && e.stopPropagation(); });
|
|
1534
|
+
ancOIm.addEventListener("mouseup", e => { e && e.stopPropagation(); });
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
applyDimensions() {
|
|
1540
|
+
this.cellStyle = { "width": (this.cell.width || this.colWid), "height": this.rowHeight };
|
|
1541
|
+
}
|
|
1542
|
+
updateUiColCellTheme(cssProp, val) {
|
|
1543
|
+
const rProp = this.common.replaceUniSep(this.tblDragService.currColForDataRow);
|
|
1544
|
+
if (cssProp === "height" && (this.cell.column === this.tblDragService.currColForDataRow || this.cell.column === rProp) &&
|
|
1545
|
+
this.tblDragService.currDataRow.id === this.rowId)
|
|
1546
|
+
this.height.emit(val);
|
|
1547
|
+
const prop = this.common.replaceUniSep(this.dataTableService.currColumnEdit);
|
|
1548
|
+
if (prop && this.dataTableService.dataFilSrtTracker[prop]) {
|
|
1549
|
+
if (cssProp === "width") {
|
|
1550
|
+
this.dataTableService.dataFilSrtTracker[prop].colWidth = (val || parseInt(this.colWid)).toString() + "px";
|
|
1551
|
+
this.width.emit(val || parseInt(this.colWid));
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
handleColResDblClick(prop) {
|
|
1556
|
+
if (this.dataTableService.dataFilSrtTracker[prop]) {
|
|
1557
|
+
let i = 0;
|
|
1558
|
+
let wids = [];
|
|
1559
|
+
let useWid = 50;
|
|
1560
|
+
const elCol = this.common.elifyCol(prop);
|
|
1561
|
+
const els = document.getElementsByClassName("data-cell-" + elCol);
|
|
1562
|
+
const nw = els[0]?.getBoundingClientRect().width || 0;
|
|
1563
|
+
const len = els.length;
|
|
1564
|
+
for (i; i < len; i++)
|
|
1565
|
+
wids.push(els[i].scrollWidth);
|
|
1566
|
+
useWid = wids.sort()[(len - 1)];
|
|
1567
|
+
if (useWid && useWid > nw) {
|
|
1568
|
+
const cswid = (Math.ceil(useWid + 1));
|
|
1569
|
+
this.dataTableService.currColumnEdit = elCol;
|
|
1570
|
+
this.updateUiColCellTheme("width", cswid);
|
|
1571
|
+
setTimeout(() => this.dataTableService.currColumnEdit = null);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
validateRawText(text, dataType) {
|
|
1576
|
+
if (dataType === "number" && (!text || /[a-zA-Z \/]/g.test(text)))
|
|
1577
|
+
return "";
|
|
1578
|
+
return text;
|
|
1579
|
+
}
|
|
1580
|
+
setToEditAfterTO() {
|
|
1581
|
+
this.setCellEditScrlActionTO = setTimeout(() => {
|
|
1582
|
+
if (this.dataTableService.currEditCol === this.cell.column)
|
|
1583
|
+
this.setCellToEdit(true);
|
|
1584
|
+
}, 100);
|
|
1585
|
+
}
|
|
1586
|
+
setCellToEdit(noHScrl) {
|
|
1587
|
+
if (this.tblDragService.didResizeOnEvent || !this.cell.editable) {
|
|
1588
|
+
if (!this.cell.editable) {
|
|
1589
|
+
this.dataTableService.clearAllFocused();
|
|
1590
|
+
this.dataTableService.clearDCellFcsd();
|
|
1591
|
+
this.clearVEditFocus.emit("");
|
|
1592
|
+
this.dataTableService.currEditCol = "";
|
|
1593
|
+
this.setCellEditScrlActionTO = null;
|
|
1594
|
+
this.dataTableService.autoScrollOnEdit = false;
|
|
1595
|
+
this.dataTableService.currEditIndex = -1;
|
|
1596
|
+
}
|
|
1597
|
+
return; //not editable or was really a drag event, not click
|
|
1598
|
+
}
|
|
1599
|
+
this.dataTableService.currEditCol = this.cell.column;
|
|
1600
|
+
this.dataTableService.currEditIndex = parseInt(this.rowId.replace(/^dataTableRow/, ""));
|
|
1601
|
+
const cell = this.cellElem.nativeElement;
|
|
1602
|
+
const cellWid = parseInt(this.dataTableService.useColWid?.replace(/px/g, "") || "250");
|
|
1603
|
+
if (cell.getBoundingClientRect().right + cellWid >= this.dataTableService.tblRight) {
|
|
1604
|
+
if (!noHScrl) {
|
|
1605
|
+
this.dataTableService.autoScrollOnEdit = true;
|
|
1606
|
+
const grid = document.getElementById("dataTableBody");
|
|
1607
|
+
grid.scrollBy((cellWid + 1), 0);
|
|
1608
|
+
}
|
|
1609
|
+
if (!this.setCellEditScrlActionTO) {
|
|
1610
|
+
return this.setToEditAfterTO();
|
|
1611
|
+
}
|
|
1612
|
+
else {
|
|
1613
|
+
window.clearTimeout(this.setCellEditScrlActionTO);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
this.dataTableService.clearAllFocused();
|
|
1617
|
+
this.dataTableService.clearDCellFcsd();
|
|
1618
|
+
this.setCellEditScrlActionTO = null;
|
|
1619
|
+
setTimeout(() => this.dataTableService.autoScrollOnEdit = false);
|
|
1620
|
+
if (this.needsVal()) {
|
|
1621
|
+
const okText = this.validateRawText(this.cell.rawText, this.cell.dataType);
|
|
1622
|
+
if (this.cell.rawText && !okText)
|
|
1623
|
+
return;
|
|
1624
|
+
this.validateEditFocus.emit({ type: this.cell.dataType, value: okText });
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
this.clearVEditFocus.emit("");
|
|
1628
|
+
setTimeout(() => {
|
|
1629
|
+
const fCellDragger = document.getElementsByClassName("focused-cell-dragger")[0];
|
|
1630
|
+
const par = fCellDragger?.parentElement;
|
|
1631
|
+
if (fCellDragger && par) {
|
|
1632
|
+
const cbds = cell.getBoundingClientRect();
|
|
1633
|
+
const rbds = par.getBoundingClientRect();
|
|
1634
|
+
fCellDragger.style.left = (Math.ceil(cbds.left - rbds.left) + cbds.width - 4) + "px";
|
|
1635
|
+
fCellDragger.style.top = (Math.ceil(cbds.bottom - rbds.top) - 4) + "px";
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
needsVal() {
|
|
1640
|
+
if (!this.cell.html && (["number", "date"].includes(this.cell.dataType)))
|
|
1641
|
+
return true;
|
|
1642
|
+
return false;
|
|
1643
|
+
}
|
|
1644
|
+
emitEdit(event) {
|
|
1645
|
+
if (!this.cell.editable || this.needsVal() /*only for validated edits*/ ||
|
|
1646
|
+
(event.relatedTarget && event.relatedTarget.classList.contains("edit-input")))
|
|
1647
|
+
return;
|
|
1648
|
+
this.execFreeEdit();
|
|
1649
|
+
}
|
|
1650
|
+
execFreeEdit() {
|
|
1651
|
+
const el = this.cellElem.nativeElement;
|
|
1652
|
+
const val = el.textContent;
|
|
1653
|
+
if (val !== this.rawText)
|
|
1654
|
+
this.edit.emit({ column: this.cell.column, value: val });
|
|
1655
|
+
else {
|
|
1656
|
+
setTimeout(() => {
|
|
1657
|
+
const actEl = document.activeElement;
|
|
1658
|
+
if (actEl && actEl.id === "fCellDragger") {
|
|
1659
|
+
el.classList.add("dragger-cell-focused");
|
|
1660
|
+
this.dragListen.emit(true);
|
|
1661
|
+
}
|
|
1662
|
+
else {
|
|
1663
|
+
if (!actEl || (actEl && !/data-cell/g.test(actEl?.className))) {
|
|
1664
|
+
this.dataTableService.currEditIndex = -1;
|
|
1665
|
+
const fCellDragger = document.getElementsByClassName("focused-cell-dragger")[0];
|
|
1666
|
+
if (fCellDragger && !this.dataTableService.autoScrollOnEdit) {
|
|
1667
|
+
fCellDragger.style.removeProperty("top");
|
|
1668
|
+
fCellDragger.style.removeProperty("left");
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataCellComponent, deps: [{ token: TableDragService }, { token: DataTableService }, { token: CommonService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1676
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: DataCellComponent, isStandalone: true, selector: "app-data-cell", inputs: { rawText: "rawText", cell: "cell", rowId: "rowId", colWid: "colWid", rowHeight: "rowHeight", noColResize: "noColResize" }, outputs: { width: "width", height: "height", edit: "edit", dragListen: "dragListen", validateEditFocus: "validateEditFocus", clearVEditFocus: "clearVEditFocus" }, viewQueries: [{ propertyName: "cellElem", first: true, predicate: ["cellEl"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div #cellEl [attr.contenteditable]=\"canEdit\" [ngStyle]=\"cellStyle\" class=\"data-cell data-cell-{{elCol}}{{rightAlign}}{{symbolCls}}\" \r\n[ngClass]=\"{ 'col-item-freeze': cell.freeze, 'holding-check': cell.column === dataTableService.firstCol }\" tabindex=\"0\"\r\n(mousemove)=\"tblDragService.checkItemBorderCursor($event, noColResize)\" (mousemove)=\"tblDragService.handleCellSizeAdjust($event, elCol)\"\r\n(mousedown)=\"tblDragService.handleCellSizeAdjust($event, elCol)\" (focus)=\"setCellToEdit()\" (blur)=\"emitEdit($event)\"\r\n[attr.data-index]=\"rowId\" (dblclick)=\"handleColResDblClick(cell.column)\"\r\n></div>", styles: ["@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1677
|
+
}
|
|
1678
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DataCellComponent, decorators: [{
|
|
1679
|
+
type: Component,
|
|
1680
|
+
args: [{ selector: 'app-data-cell', imports: [CommonModule], template: "<div #cellEl [attr.contenteditable]=\"canEdit\" [ngStyle]=\"cellStyle\" class=\"data-cell data-cell-{{elCol}}{{rightAlign}}{{symbolCls}}\" \r\n[ngClass]=\"{ 'col-item-freeze': cell.freeze, 'holding-check': cell.column === dataTableService.firstCol }\" tabindex=\"0\"\r\n(mousemove)=\"tblDragService.checkItemBorderCursor($event, noColResize)\" (mousemove)=\"tblDragService.handleCellSizeAdjust($event, elCol)\"\r\n(mousedown)=\"tblDragService.handleCellSizeAdjust($event, elCol)\" (focus)=\"setCellToEdit()\" (blur)=\"emitEdit($event)\"\r\n[attr.data-index]=\"rowId\" (dblclick)=\"handleColResDblClick(cell.column)\"\r\n></div>", styles: ["@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"] }]
|
|
1681
|
+
}], ctorParameters: () => [{ type: TableDragService }, { type: DataTableService }, { type: CommonService }], propDecorators: { rawText: [{
|
|
1682
|
+
type: Input
|
|
1683
|
+
}], cell: [{
|
|
1684
|
+
type: Input
|
|
1685
|
+
}], rowId: [{
|
|
1686
|
+
type: Input
|
|
1687
|
+
}], colWid: [{
|
|
1688
|
+
type: Input
|
|
1689
|
+
}], rowHeight: [{
|
|
1690
|
+
type: Input
|
|
1691
|
+
}], noColResize: [{
|
|
1692
|
+
type: Input
|
|
1693
|
+
}], width: [{
|
|
1694
|
+
type: Output,
|
|
1695
|
+
args: ["width"]
|
|
1696
|
+
}], height: [{
|
|
1697
|
+
type: Output,
|
|
1698
|
+
args: ["height"]
|
|
1699
|
+
}], edit: [{
|
|
1700
|
+
type: Output,
|
|
1701
|
+
args: ["edit"]
|
|
1702
|
+
}], dragListen: [{
|
|
1703
|
+
type: Output,
|
|
1704
|
+
args: ["dragListen"]
|
|
1705
|
+
}], validateEditFocus: [{
|
|
1706
|
+
type: Output,
|
|
1707
|
+
args: ["validateEditFocus"]
|
|
1708
|
+
}], clearVEditFocus: [{
|
|
1709
|
+
type: Output,
|
|
1710
|
+
args: ["clearVEditFocus"]
|
|
1711
|
+
}], cellElem: [{
|
|
1712
|
+
type: ViewChild,
|
|
1713
|
+
args: ['cellEl', { static: true }]
|
|
1714
|
+
}] } });
|
|
1715
|
+
|
|
1716
|
+
class NgxDeebodataCommunity {
|
|
1717
|
+
dataTableService;
|
|
1718
|
+
tblDragService;
|
|
1719
|
+
common;
|
|
1720
|
+
onWindowClick(e) {
|
|
1721
|
+
if (this.validatedEditType && (!document.activeElement || (document.activeElement && !document.activeElement.className)))
|
|
1722
|
+
this.clearValidatedEdit(e);
|
|
1723
|
+
}
|
|
1724
|
+
onWindowMouseUp(e) {
|
|
1725
|
+
if (this.tblDragService.listenForMouseUp) {
|
|
1726
|
+
this.tblDragService.handleColResMouseUp(e);
|
|
1727
|
+
this.dataTableBody?.nativeElement.scrollBy(1, 0);
|
|
1728
|
+
}
|
|
1729
|
+
if (this.tblDragService.listenForColMvMouseUp)
|
|
1730
|
+
this.tblDragService.handleColMoveMouseUp(e);
|
|
1731
|
+
if (this.listenToCellDraggerMouseMove) {
|
|
1732
|
+
this.listenToCellDraggerMouseMove = false;
|
|
1733
|
+
this.clearDragEditFlag();
|
|
1734
|
+
try {
|
|
1735
|
+
this.fCellDragger.nativeElement.blur();
|
|
1736
|
+
}
|
|
1737
|
+
catch (e) { }
|
|
1738
|
+
}
|
|
1739
|
+
if (this.listenToCellDraggerMouseUp)
|
|
1740
|
+
this.handleDraggerMU(e);
|
|
1741
|
+
this.handleScrlBarDrag();
|
|
1742
|
+
}
|
|
1743
|
+
onWindowMouseMove(e) {
|
|
1744
|
+
if (this.listenToCellDraggerMouseMove)
|
|
1745
|
+
this.handleCellDraggerEdit(e);
|
|
1746
|
+
}
|
|
1747
|
+
onWindowSelectStart(e) {
|
|
1748
|
+
if (this.listenToCellDraggerMouseMove)
|
|
1749
|
+
e.preventDefault();
|
|
1750
|
+
if (this.tblDragService.listenForSelectStart)
|
|
1751
|
+
this.tblDragService.stopWindowSelection(e);
|
|
1752
|
+
}
|
|
1753
|
+
onWindowResize(e) {
|
|
1754
|
+
this.dataTableService.setTblBounds();
|
|
1755
|
+
this.clearValidatedEdit();
|
|
1756
|
+
}
|
|
1757
|
+
onWindowScroll(e) {
|
|
1758
|
+
this.dataTableService.setTblBounds();
|
|
1759
|
+
this.clearValidatedEdit();
|
|
1760
|
+
}
|
|
1761
|
+
constructor(dataTableService, tblDragService, common) {
|
|
1762
|
+
this.dataTableService = dataTableService;
|
|
1763
|
+
this.tblDragService = tblDragService;
|
|
1764
|
+
this.common = common;
|
|
1765
|
+
}
|
|
1766
|
+
rows = [];
|
|
1767
|
+
aboveHgt = signal(0, ...(ngDevMode ? [{ debugName: "aboveHgt" }] : /* istanbul ignore next */ []));
|
|
1768
|
+
belowHgt = signal(0, ...(ngDevMode ? [{ debugName: "belowHgt" }] : /* istanbul ignore next */ []));
|
|
1769
|
+
dtChecks = [];
|
|
1770
|
+
rowNos = [];
|
|
1771
|
+
verticalRest = 0;
|
|
1772
|
+
horizRest = 0;
|
|
1773
|
+
isScrolling = false;
|
|
1774
|
+
useRowWid = "";
|
|
1775
|
+
paginatorReady = false;
|
|
1776
|
+
handlingSelRows = false;
|
|
1777
|
+
columnOfInterest = "";
|
|
1778
|
+
desRowHeight = "50";
|
|
1779
|
+
listenToCellDraggerMouseMove = false;
|
|
1780
|
+
listenToCellDraggerMouseUp = false;
|
|
1781
|
+
topLevelFilter = "";
|
|
1782
|
+
allFilSortInfo = "";
|
|
1783
|
+
lockVScroll = false;
|
|
1784
|
+
filterBuildUp = [];
|
|
1785
|
+
togSelRows = "Selected Rows";
|
|
1786
|
+
maxCols = 0;
|
|
1787
|
+
lastElRowIndex = 0;
|
|
1788
|
+
columnHeaders = [];
|
|
1789
|
+
columnNames = [];
|
|
1790
|
+
linkCell;
|
|
1791
|
+
linkCells = [];
|
|
1792
|
+
validatedEditType = "";
|
|
1793
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1794
|
+
color1 = "";
|
|
1795
|
+
color2 = "";
|
|
1796
|
+
primaryKey = "";
|
|
1797
|
+
defRowHgt = "50px";
|
|
1798
|
+
defGridHgt = 500;
|
|
1799
|
+
altRowColor = "#fafafa";
|
|
1800
|
+
myColumnSymbols = [];
|
|
1801
|
+
editable = true;
|
|
1802
|
+
rowNumbers = true;
|
|
1803
|
+
cellEdit = new EventEmitter();
|
|
1804
|
+
dataTable;
|
|
1805
|
+
dataTableBody;
|
|
1806
|
+
aboveArea;
|
|
1807
|
+
belowArea;
|
|
1808
|
+
validatedEdit;
|
|
1809
|
+
rowNumHeader;
|
|
1810
|
+
rowNumBody;
|
|
1811
|
+
fCellDragger;
|
|
1812
|
+
selFilContainer;
|
|
1813
|
+
btnTogSelRows;
|
|
1814
|
+
dataTableHeaders;
|
|
1815
|
+
topLevelDataFilter;
|
|
1816
|
+
ngOnInit() {
|
|
1817
|
+
if (this.defRowHgt && /\d+px/g.test(this.defRowHgt))
|
|
1818
|
+
this.dataTableService.defltRHgt = this.defRowHgt;
|
|
1819
|
+
if (this.defGridHgt)
|
|
1820
|
+
this.dataTableService.dTblHeight = this.defGridHgt;
|
|
1821
|
+
if (this.myColumnSymbols)
|
|
1822
|
+
this.dataTableService.columnSymbols = [...this.myColumnSymbols];
|
|
1823
|
+
let tdata = this.convertNeededCols([...this.data()]);
|
|
1824
|
+
this.dataTableService.mainData = tdata.filter((d) => true);
|
|
1825
|
+
this.dataTableService.currFilData = tdata.filter((d) => true);
|
|
1826
|
+
this.dataTableService.mainDataLen = this.dataTableService.mainData.length;
|
|
1827
|
+
this.buildInitUiDataTable(tdata, this.color1, this.color2); //hex or rgb values work best
|
|
1828
|
+
if (!this.dataTableService.errorLoading)
|
|
1829
|
+
this.dataTableService.noDataMsg = "No data to display for this configuration.";
|
|
1830
|
+
this.tblDragService.dTblHeightOutput.subscribe(h => this.setTableHeight(h));
|
|
1831
|
+
this.tblDragService.columnMove.subscribe(c => this.processColMove(c));
|
|
1832
|
+
setTimeout(() => this.setTableHeight(510), 1000); //for demo
|
|
1833
|
+
}
|
|
1834
|
+
getAllColsAtRuntime(excludeHidden) {
|
|
1835
|
+
let cols = (typeof this.dataTableService.mainData[0] === "object" ? Object.keys(this.dataTableService.mainData[0]) :
|
|
1836
|
+
(Object.keys(this.dataTableService.dataFilSrtTracker)));
|
|
1837
|
+
if (!excludeHidden)
|
|
1838
|
+
return cols;
|
|
1839
|
+
return cols.filter((c) => {
|
|
1840
|
+
return !this.dataTableService.dataFilSrtTracker[c].minimize;
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
setMaxCols() {
|
|
1844
|
+
const el = this.dataTable.nativeElement;
|
|
1845
|
+
if (el) {
|
|
1846
|
+
const elWid = el.getBoundingClientRect().width;
|
|
1847
|
+
return elWid >= 1024 ? 5 : (elWid > 760 ? 3 : 2);
|
|
1848
|
+
}
|
|
1849
|
+
const wid = window.innerWidth;
|
|
1850
|
+
return wid >= 1024 ? 5 : (wid > 760 ? 3 : 2);
|
|
1851
|
+
}
|
|
1852
|
+
getAllColWidth(colLen) {
|
|
1853
|
+
try {
|
|
1854
|
+
if (!colLen || colLen === 0)
|
|
1855
|
+
return 0;
|
|
1856
|
+
const colWid = parseInt(this.dataTableService.useColWid.replace(/[ ]?px/g, ""));
|
|
1857
|
+
let i = 0;
|
|
1858
|
+
let wid = 0;
|
|
1859
|
+
for (const prop in this.dataTableService.dataFilSrtTracker) {
|
|
1860
|
+
if (this.dataTableService.dataFilSrtTracker[prop].minimize)
|
|
1861
|
+
continue;
|
|
1862
|
+
i += 1;
|
|
1863
|
+
const ownColWid = this.dataTableService.dataFilSrtTracker[prop].colWidth;
|
|
1864
|
+
wid += (ownColWid ? parseInt(ownColWid.replace(/[ ]?px/g, "")) : colWid);
|
|
1865
|
+
}
|
|
1866
|
+
if (i === colLen)
|
|
1867
|
+
return Math.floor(wid);
|
|
1868
|
+
return Math.floor(colWid * colLen);
|
|
1869
|
+
}
|
|
1870
|
+
catch (e) {
|
|
1871
|
+
try {
|
|
1872
|
+
return Math.floor(parseInt(this.dataTableService.useColWid.replace(/[ ]?px/g, "")) * colLen);
|
|
1873
|
+
}
|
|
1874
|
+
catch (e) {
|
|
1875
|
+
return window.innerWidth;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
removeAllFreezeCols() {
|
|
1880
|
+
const len = this.columnHeaders.length;
|
|
1881
|
+
const rlen = this.rows.length;
|
|
1882
|
+
for (var i = (len - 1); i >= 0; i--)
|
|
1883
|
+
try {
|
|
1884
|
+
this.columnHeaders[i].freeze = false;
|
|
1885
|
+
}
|
|
1886
|
+
catch (e) { }
|
|
1887
|
+
for (var o = (rlen - 1); o >= 0; o--) {
|
|
1888
|
+
try {
|
|
1889
|
+
const row = this.rows[o];
|
|
1890
|
+
const clen = row.cells?.length;
|
|
1891
|
+
if (clen && clen > 0) {
|
|
1892
|
+
for (var n = (clen - 1); n >= 0; n--) {
|
|
1893
|
+
const cell = row.cells?.[n];
|
|
1894
|
+
if (cell)
|
|
1895
|
+
cell.freeze = false;
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
catch (e) { }
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
setTableHeight(h) {
|
|
1903
|
+
this.dataTableService.dTblHeight = h;
|
|
1904
|
+
setTimeout(() => {
|
|
1905
|
+
this.dataTableService.setTblBounds();
|
|
1906
|
+
this.dataTableBody?.nativeElement.scrollBy(0, (this.scrollDir === "down" ? 1 : -1));
|
|
1907
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
processColMove(event) {
|
|
1911
|
+
let lfts = event.ls;
|
|
1912
|
+
let nwColLft = event.nl;
|
|
1913
|
+
let wantlfts = event.wl;
|
|
1914
|
+
let xDrop = event.x;
|
|
1915
|
+
const wLf = wantlfts.indexOf(xDrop);
|
|
1916
|
+
if (wLf != lfts.indexOf(nwColLft)) {
|
|
1917
|
+
const inAft = wLf - 1;
|
|
1918
|
+
this.columnHeaders = this.columnHeaders.filter(c => this.common.elifyCol(c.column) !== this.dataTableService.currColumnEdit);
|
|
1919
|
+
const rwCol = this.common.replaceUniSep(this.dataTableService.currColumnEdit);
|
|
1920
|
+
const trkr = this.dataTableService.dataFilSrtTracker[rwCol];
|
|
1921
|
+
const addCol = { column: rwCol, width: (trkr["colWidth"] || this.dataTableService.useColWid),
|
|
1922
|
+
hideMinCol: false, freeze: false, minimized: trkr["minimize"], dataType: this.dataTableService.figureFilterType(rwCol) };
|
|
1923
|
+
if (inAft === -1) { //they want it first
|
|
1924
|
+
this.columnHeaders.unshift(addCol);
|
|
1925
|
+
}
|
|
1926
|
+
else {
|
|
1927
|
+
if (inAft >= (wantlfts.length - 2)) { //last
|
|
1928
|
+
this.columnHeaders.push(addCol);
|
|
1929
|
+
}
|
|
1930
|
+
else {
|
|
1931
|
+
if (this.columnHeaders[inAft])
|
|
1932
|
+
this.columnHeaders.splice((inAft + 1), 0, addCol);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
setTimeout(() => {
|
|
1936
|
+
let i = 0;
|
|
1937
|
+
const els = document.getElementsByClassName("col-header");
|
|
1938
|
+
const len = els.length;
|
|
1939
|
+
this.columnHeaders = [];
|
|
1940
|
+
for (i; i < len; i++) {
|
|
1941
|
+
const col = this.common.replaceUniSep(els[i].id.replace(/^columnHeader/, ""));
|
|
1942
|
+
if (!this.columnHeaders.map(c => c.column).includes(col)) {
|
|
1943
|
+
const trkr = this.dataTableService.dataFilSrtTracker[col];
|
|
1944
|
+
const addCol = { column: col, width: (trkr["colWidth"] || this.dataTableService.useColWid),
|
|
1945
|
+
hideMinCol: false, freeze: false, minimized: trkr["minimize"], dataType: this.dataTableService.figureFilterType(col) };
|
|
1946
|
+
this.columnHeaders.push(addCol);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
this.columnNames = this.columnHeaders.map(c => c.column);
|
|
1950
|
+
const dtB = this.dataTableBody.nativeElement;
|
|
1951
|
+
if (dtB) {
|
|
1952
|
+
const willSclTo = dtB.scrollLeft;
|
|
1953
|
+
this.renderCurrData(false);
|
|
1954
|
+
setTimeout(() => { dtB.scrollLeft = willSclTo; });
|
|
1955
|
+
}
|
|
1956
|
+
}, 100);
|
|
1957
|
+
}
|
|
1958
|
+
this.clearValidatedEdit(null, true);
|
|
1959
|
+
}
|
|
1960
|
+
setColHeaderHgt() {
|
|
1961
|
+
let z = 0;
|
|
1962
|
+
let i = 0;
|
|
1963
|
+
let x = 0;
|
|
1964
|
+
let hgts = [];
|
|
1965
|
+
const cols = document.getElementsByClassName("col-header");
|
|
1966
|
+
const cLen = this.columnHeaders?.length;
|
|
1967
|
+
for (x; x < cLen; x++) {
|
|
1968
|
+
const col = this.columnHeaders[x];
|
|
1969
|
+
col.height = undefined;
|
|
1970
|
+
col.lineHeight = undefined;
|
|
1971
|
+
}
|
|
1972
|
+
for (z; z < cLen; z++) {
|
|
1973
|
+
if (cols[z])
|
|
1974
|
+
hgts.push(cols[z].getBoundingClientRect().height);
|
|
1975
|
+
}
|
|
1976
|
+
const maxHgt = hgts.sort((a, b) => a > b ? -1 : 1)[0];
|
|
1977
|
+
const useHgt = Math.ceil(maxHgt);
|
|
1978
|
+
for (i; i < cLen; i++) {
|
|
1979
|
+
const col = this.columnHeaders[i];
|
|
1980
|
+
if (col && !col.minimized) {
|
|
1981
|
+
col.height = useHgt + "px";
|
|
1982
|
+
const elCol = cols[i];
|
|
1983
|
+
if (elCol && elCol.firstElementChild && elCol.firstElementChild.getBoundingClientRect().height < 40)
|
|
1984
|
+
col.lineHeight = Math.floor(((useHgt / 2) - 21)) + "px";
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
if (this.dataTableHeaders)
|
|
1988
|
+
this.dataTableHeaders.nativeElement.style.height = useHgt + "px";
|
|
1989
|
+
if (this.rowNumHeader)
|
|
1990
|
+
this.rowNumHeader.nativeElement.style.height = useHgt + "px";
|
|
1991
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
1992
|
+
}
|
|
1993
|
+
renameColSpecChars(data) {
|
|
1994
|
+
if (data && data.some(d => d && typeof d === "object")) {
|
|
1995
|
+
let specCharCols = [];
|
|
1996
|
+
if (data[0] && typeof data[0] === "object") {
|
|
1997
|
+
for (const prop in data[0]) {
|
|
1998
|
+
if (/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g.test(prop))
|
|
1999
|
+
specCharCols.push(prop);
|
|
2000
|
+
}
|
|
2001
|
+
let c = 0;
|
|
2002
|
+
let i = 0;
|
|
2003
|
+
const dlen = data.length;
|
|
2004
|
+
const len = specCharCols.length;
|
|
2005
|
+
for (c; c < len; c++) {
|
|
2006
|
+
const prop = specCharCols[c];
|
|
2007
|
+
const okNwNam = this.common.stripSpecChars(prop);
|
|
2008
|
+
for (i; i < dlen; i++) {
|
|
2009
|
+
if (data[i] && typeof data[i] === "object") {
|
|
2010
|
+
const desc = Object.getOwnPropertyDescriptor(data[i], prop);
|
|
2011
|
+
if (desc) {
|
|
2012
|
+
try {
|
|
2013
|
+
Object.defineProperty(data[i], okNwNam, desc);
|
|
2014
|
+
delete data[i][prop];
|
|
2015
|
+
}
|
|
2016
|
+
catch (e) { }
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
i = 0;
|
|
2021
|
+
}
|
|
2022
|
+
return data?.filter(d => true);
|
|
2023
|
+
}
|
|
2024
|
+
return data?.filter(d => true);
|
|
2025
|
+
}
|
|
2026
|
+
return data?.filter(d => true);
|
|
2027
|
+
}
|
|
2028
|
+
scoopOutObjsInObjs(data) {
|
|
2029
|
+
let i = 0;
|
|
2030
|
+
let ndata = [];
|
|
2031
|
+
const len = data?.length;
|
|
2032
|
+
if (data && data.some((d) => { return d && typeof d === "object"; })) {
|
|
2033
|
+
for (i; i < len; i++) {
|
|
2034
|
+
try {
|
|
2035
|
+
const dta = data[i];
|
|
2036
|
+
if (dta && typeof dta === "object") {
|
|
2037
|
+
let nobj = {};
|
|
2038
|
+
for (const prop in dta) {
|
|
2039
|
+
const val = dta[prop];
|
|
2040
|
+
if (val && typeof val === "object" && typeof val.getTime === "undefined" && typeof val.filter === "undefined" && Object.keys(val).length) {
|
|
2041
|
+
for (const iprp in val)
|
|
2042
|
+
nobj[iprp] = val[iprp];
|
|
2043
|
+
}
|
|
2044
|
+
else {
|
|
2045
|
+
nobj[prop] = val;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
ndata.push(nobj);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
catch (e) { }
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
else {
|
|
2055
|
+
ndata = data?.filter((d) => { return true; });
|
|
2056
|
+
}
|
|
2057
|
+
return ndata;
|
|
2058
|
+
}
|
|
2059
|
+
convertNeededCols(data) {
|
|
2060
|
+
data = this.scoopOutObjsInObjs(data);
|
|
2061
|
+
data = this.renameColSpecChars(data);
|
|
2062
|
+
let nData = data?.filter((d) => true);
|
|
2063
|
+
const symReg = new RegExp(/[$€£₹¥¢%\,\"\']/, "g");
|
|
2064
|
+
const isDtReg = new RegExp(/\d+(\/|-)\d+(\/|-)\d+/);
|
|
2065
|
+
let i = 0;
|
|
2066
|
+
const len = data?.length;
|
|
2067
|
+
let allCols = [];
|
|
2068
|
+
if (data && data.some((d) => d && typeof d === "object")) {
|
|
2069
|
+
allCols = this.getDataColumns(data); //gets all possible props in array
|
|
2070
|
+
this.dataTableService.dataFilSrtTracker = this.dataTableService.buildDataFilSrtTracker(allCols);
|
|
2071
|
+
for (i; i < len; i++) {
|
|
2072
|
+
try {
|
|
2073
|
+
if (data[i] && typeof data[i] === "object") {
|
|
2074
|
+
for (const prop in data[i]) {
|
|
2075
|
+
if (!allCols.includes(prop)) {
|
|
2076
|
+
delete data[i][prop];
|
|
2077
|
+
continue;
|
|
2078
|
+
}
|
|
2079
|
+
const val = data[i][prop];
|
|
2080
|
+
if (val && typeof val === "string") {
|
|
2081
|
+
const tval = val.trim();
|
|
2082
|
+
const low = tval.toLocaleLowerCase();
|
|
2083
|
+
if (this.common.testLongDate(low))
|
|
2084
|
+
nData[i][prop] = this.common.coerceDate(low);
|
|
2085
|
+
if (!this.common.testLongDate(low) && (this.common.testShortDate(tval) || this.common.testISODate(tval)))
|
|
2086
|
+
nData[i][prop] = this.common.coerceDate(tval);
|
|
2087
|
+
if (this.common.testISODate(tval.replace(/ /g, "")))
|
|
2088
|
+
nData[i][prop] = this.common.coerceDate(tval.replace(/ /g, ""));
|
|
2089
|
+
if (low === "null" || low === "undefined")
|
|
2090
|
+
nData[i][prop] = null;
|
|
2091
|
+
if (!this.common.idCol(prop) && !isDtReg.test(tval) && !/[A-Za-z]/g.test(val) && /^[0-9,]+[\.]{0,1}?[0-9,]*$/g.test(tval.replace(symReg, "")) && !isNaN(parseInt(tval.replace(symReg, "")))) //not viewed as num, but can be
|
|
2092
|
+
nData[i][prop] = /\./g.test(val) ? parseFloat(tval.replace(symReg, "")) : parseInt(tval.replace(symReg, ""));
|
|
2093
|
+
}
|
|
2094
|
+
if (val && typeof val === "object" && typeof val.getTime === "undefined") /**not dates */
|
|
2095
|
+
try {
|
|
2096
|
+
nData[i][prop] = JSON.stringify(val).replace(/[\[\]{}\"]/g, "").replace(/:/g, ": ").replace(/,/g, ", ").replace(/ /g, " ");
|
|
2097
|
+
}
|
|
2098
|
+
catch (e) { }
|
|
2099
|
+
}
|
|
2100
|
+
const keys = Object.keys(data[i]);
|
|
2101
|
+
const diff = allCols.filter((c) => keys.indexOf(c) < 0);
|
|
2102
|
+
const dLen = diff.length;
|
|
2103
|
+
if (dLen) { //obj doesn't have all props
|
|
2104
|
+
let n = 0;
|
|
2105
|
+
for (n; n < dLen; n++)
|
|
2106
|
+
nData[i][diff[n]] = "";
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
catch (e) { }
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
//read data that's already not a string
|
|
2114
|
+
if (allCols && allCols.length) { //array of objs
|
|
2115
|
+
let a = 0;
|
|
2116
|
+
const alen = allCols.length;
|
|
2117
|
+
for (a; a < alen; a++) {
|
|
2118
|
+
const col = allCols[a];
|
|
2119
|
+
const colData = nData?.map((d) => d[col]);
|
|
2120
|
+
if (colData && colData.every((d) => !d))
|
|
2121
|
+
continue;
|
|
2122
|
+
if (!this.common.idCol(col) && colData && colData.every((d) => !d || typeof d === "number")) {
|
|
2123
|
+
try {
|
|
2124
|
+
this.dataTableService.dataFilSrtTracker[col]["type"] = "number";
|
|
2125
|
+
}
|
|
2126
|
+
catch (e) { }
|
|
2127
|
+
}
|
|
2128
|
+
if (colData && colData.every((d) => { return !d || this.common.isADateObject(d); })) {
|
|
2129
|
+
try {
|
|
2130
|
+
this.dataTableService.dataFilSrtTracker[col]["type"] = "date";
|
|
2131
|
+
}
|
|
2132
|
+
catch (e) { }
|
|
2133
|
+
}
|
|
2134
|
+
if (colData && colData.every((d) => !d || typeof d === "boolean")) {
|
|
2135
|
+
nData = nData.map((d) => {
|
|
2136
|
+
d[col] = d[col]?.toString() || "false";
|
|
2137
|
+
return d;
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
return nData;
|
|
2143
|
+
}
|
|
2144
|
+
setRowSelChecksPlacement() {
|
|
2145
|
+
let i = 0;
|
|
2146
|
+
const radd = 12;
|
|
2147
|
+
const els = document.getElementsByClassName("select-row-check");
|
|
2148
|
+
const len = els.length;
|
|
2149
|
+
const dtBody = this.dataTableBody.nativeElement;
|
|
2150
|
+
const tbds = dtBody.getBoundingClientRect();
|
|
2151
|
+
const initT = this.initCheckTop();
|
|
2152
|
+
const col1Frozen = document.getElementsByClassName("col-item-freeze").length;
|
|
2153
|
+
for (i; i < len; i++) {
|
|
2154
|
+
const chk = els[i];
|
|
2155
|
+
const row = document.getElementById(chk.value);
|
|
2156
|
+
if (row) {
|
|
2157
|
+
const tTop = tbds.top;
|
|
2158
|
+
const rbds = row.getBoundingClientRect();
|
|
2159
|
+
const hh = (rbds.height / 2);
|
|
2160
|
+
const top = Math.floor(initT + ((rbds.bottom - (hh + radd)) - tTop));
|
|
2161
|
+
chk.style.top = Math.floor(top) + "px";
|
|
2162
|
+
if ((rbds.top + (hh - radd)) < tTop || ((rbds.bottom - (hh - radd)) >= (tTop + tbds.height)) || (dtBody.scrollLeft > 35 && !col1Frozen)) {
|
|
2163
|
+
chk.classList.add("hide");
|
|
2164
|
+
continue;
|
|
2165
|
+
}
|
|
2166
|
+
chk.className = "select-row-check";
|
|
2167
|
+
}
|
|
2168
|
+
else {
|
|
2169
|
+
chk.classList.add("hide");
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
this.setRowNumbers();
|
|
2173
|
+
}
|
|
2174
|
+
setRowNumbers() {
|
|
2175
|
+
const rlen = this.rows.length;
|
|
2176
|
+
if (this.rowNumbers && rlen) {
|
|
2177
|
+
const hasHgt = this.rowNos.filter(r => r.height);
|
|
2178
|
+
this.rowNos = [];
|
|
2179
|
+
let n = (this.lastElRowIndex + 1) - rlen;
|
|
2180
|
+
for (n; n <= this.lastElRowIndex; n++) {
|
|
2181
|
+
let rn = { number: n + 1 };
|
|
2182
|
+
if (hasHgt.length) {
|
|
2183
|
+
const hh = hasHgt.find(h => h.number === n + 1);
|
|
2184
|
+
if (hh)
|
|
2185
|
+
rn.height = hh.height;
|
|
2186
|
+
}
|
|
2187
|
+
this.rowNos.push(rn);
|
|
2188
|
+
}
|
|
2189
|
+
const r1 = document.getElementById("dataTableRow" + this.rows[0]?.index);
|
|
2190
|
+
if (r1) {
|
|
2191
|
+
const useCalc = -(this.dataTableService.tblTop - r1.getBoundingClientRect().top);
|
|
2192
|
+
this.rowNumBody.nativeElement.style.marginTop = Math.min(useCalc, 0) + "px";
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
initCheckTop() {
|
|
2197
|
+
const headHt = this.dataTableHeaders.nativeElement.getBoundingClientRect().height;
|
|
2198
|
+
return headHt + 17; //dt table marg top is 17
|
|
2199
|
+
}
|
|
2200
|
+
toggleSelectedRows(forceUnsel) {
|
|
2201
|
+
this.handlingSelRows = true;
|
|
2202
|
+
setTimeout(() => {
|
|
2203
|
+
this.dataTableService.displayOnlySelRows = !this.dataTableService.displayOnlySelRows;
|
|
2204
|
+
if (forceUnsel)
|
|
2205
|
+
this.dataTableService.displayOnlySelRows = false;
|
|
2206
|
+
const icn = this.btnTogSelRows.nativeElement.firstElementChild;
|
|
2207
|
+
if (this.dataTableService.displayOnlySelRows) {
|
|
2208
|
+
this.dataTableService.currFilData = this.dataTableService.mainData.
|
|
2209
|
+
filter((d, ind) => this.dataTableService.currSelRows.indexOf(ind) > -1);
|
|
2210
|
+
if (icn) {
|
|
2211
|
+
icn.textContent = "check_box";
|
|
2212
|
+
icn.classList.add("sel-rows-checked");
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
else {
|
|
2216
|
+
this.dataTableService.currFilData = this.dataTableService.mainData.filter((d) => true);
|
|
2217
|
+
if (icn) {
|
|
2218
|
+
icn.classList.remove("sel-rows-checked");
|
|
2219
|
+
icn.textContent = "check_box_outline_blank";
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
if (this.dataTableService.arefilSrtTrkPropsDefault(true)) {
|
|
2223
|
+
this.renderCurrData(false);
|
|
2224
|
+
}
|
|
2225
|
+
else {
|
|
2226
|
+
const col = this.columnHeaders[0].column; //just fil by 1st col
|
|
2227
|
+
const fil = this.dataTableService.dataFilSrtTracker[col].filter;
|
|
2228
|
+
if (col)
|
|
2229
|
+
this.execFilter(col, (fil || ""));
|
|
2230
|
+
}
|
|
2231
|
+
setTimeout(() => this.handlingSelRows = false);
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
toggleSingleRowSelected(useInd) {
|
|
2235
|
+
if (this.tblDragService.didResizeOnEvent)
|
|
2236
|
+
return false;
|
|
2237
|
+
try {
|
|
2238
|
+
if (this.dataTableService.currSelRows.indexOf(useInd) > -1) { //it's already selected
|
|
2239
|
+
this.dataTableService.currSelRows = this.dataTableService.currSelRows.filter((r) => r !== useInd);
|
|
2240
|
+
if (this.dataTableService.displayOnlySelRows) {
|
|
2241
|
+
const btnTog = this.btnTogSelRows.nativeElement;
|
|
2242
|
+
btnTog.click();
|
|
2243
|
+
btnTog.click();
|
|
2244
|
+
if (!this.dataTableService.currSelRows.length)
|
|
2245
|
+
btnTog.click();
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
else {
|
|
2249
|
+
if (this.dataTableService.currSelRows.indexOf(useInd) < 0)
|
|
2250
|
+
this.dataTableService.currSelRows.push(useInd);
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
catch (e) { }
|
|
2254
|
+
return this.setBtnTogRows(this.dataTableService.currSelRows.length);
|
|
2255
|
+
}
|
|
2256
|
+
setBtnTogRows(amt) {
|
|
2257
|
+
if (amt) {
|
|
2258
|
+
this.togSelRows = amt.toLocaleString(undefined, { maximumFractionDigits: 0 }) + " Selected Row" + (amt == 1 ? "" : "s");
|
|
2259
|
+
}
|
|
2260
|
+
else {
|
|
2261
|
+
this.togSelRows = "Selected Rows";
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
clearSelectedRows() {
|
|
2265
|
+
this.handlingSelRows = true;
|
|
2266
|
+
this.dataTableService.currSelRows = [];
|
|
2267
|
+
const fullClear = this.dataTableService.displayOnlySelRows ? true : false;
|
|
2268
|
+
this.dataTableService.displayOnlySelRows = false;
|
|
2269
|
+
this.setBtnTogRows();
|
|
2270
|
+
if (fullClear)
|
|
2271
|
+
return this.toggleSelectedRows(true);
|
|
2272
|
+
setTimeout(() => this.handlingSelRows = false);
|
|
2273
|
+
}
|
|
2274
|
+
getDataColumns(data) {
|
|
2275
|
+
let i = 0;
|
|
2276
|
+
let cols = Object.keys(data[0]);
|
|
2277
|
+
const len = data.length;
|
|
2278
|
+
for (i; i < len; i++) {
|
|
2279
|
+
const obj = data[i];
|
|
2280
|
+
const keys = Object.keys(obj);
|
|
2281
|
+
const notInCols = keys.filter((k) => cols.indexOf(k) < 0);
|
|
2282
|
+
if (typeof obj === "object" && notInCols.length) {
|
|
2283
|
+
let n = 0;
|
|
2284
|
+
const dLen = notInCols.length;
|
|
2285
|
+
for (n; n < dLen; n++)
|
|
2286
|
+
cols.push(notInCols[n]);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
let f = 0;
|
|
2290
|
+
let fincols = [];
|
|
2291
|
+
const strpdcols = cols.map((c) => this.common.stripSpecChars(c));
|
|
2292
|
+
const slen = strpdcols.length;
|
|
2293
|
+
for (f; f < slen; f++) {
|
|
2294
|
+
const scol = strpdcols[f];
|
|
2295
|
+
if (!fincols.includes(scol))
|
|
2296
|
+
fincols.push(scol);
|
|
2297
|
+
}
|
|
2298
|
+
return fincols;
|
|
2299
|
+
}
|
|
2300
|
+
setLastRowIndex() {
|
|
2301
|
+
const realMax = this.dataTableService.currFilData.length - 1;
|
|
2302
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2303
|
+
const wannabeMax = (this.rows.length - 1) + Math.floor(this.aboveHgt() / defNum);
|
|
2304
|
+
this.lastElRowIndex = Math.min(wannabeMax, realMax);
|
|
2305
|
+
return this.lastElRowIndex;
|
|
2306
|
+
}
|
|
2307
|
+
buildInitUiDataTable(data, color1, color2) {
|
|
2308
|
+
try {
|
|
2309
|
+
const cols = Object.keys(data[0]);
|
|
2310
|
+
let i = 0;
|
|
2311
|
+
let n = 0;
|
|
2312
|
+
const len = data.length;
|
|
2313
|
+
const colLen = cols.length;
|
|
2314
|
+
this.maxCols = this.setMaxCols();
|
|
2315
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2316
|
+
const init = Math.max(this.dataTableService.dTblHeight / defNum);
|
|
2317
|
+
this.dataTableService.useColWid = Math.ceil((this.dataTableBody.nativeElement.getBoundingClientRect().width - 16) / Math.min(colLen, this.maxCols)) + "px";
|
|
2318
|
+
for (i; i < colLen; i++) {
|
|
2319
|
+
this.columnHeaders.push({ column: cols[i], width: this.dataTableService.useColWid, hideMinCol: false, freeze: false, minimized: false, dataType: this.dataTableService.figureFilterType(cols[i]) });
|
|
2320
|
+
if (i < this.maxCols)
|
|
2321
|
+
this.dataTableService.visibleCols.push(cols[i]);
|
|
2322
|
+
}
|
|
2323
|
+
this.columnNames = this.columnHeaders.map(c => c.column);
|
|
2324
|
+
const initVisCols = cols.filter((c, ind) => ind <= (this.maxCols + 1));
|
|
2325
|
+
const addCell = (text, prop, row, indx) => {
|
|
2326
|
+
if (prop && row) {
|
|
2327
|
+
const notNum = (this.dataTableService.figureFilterType(prop) != "number" || /(year|yr|fy)/g.test(prop.toLocaleLowerCase())) ? true : false;
|
|
2328
|
+
const useTxt = this.dataTableService.figureCellText(text, notNum, this.dataTableService.dataFilSrtTracker[prop]["colCellSymbol"]);
|
|
2329
|
+
row.cells?.push({
|
|
2330
|
+
column: prop,
|
|
2331
|
+
freeze: false,
|
|
2332
|
+
minimized: false,
|
|
2333
|
+
rawText: text,
|
|
2334
|
+
visible: initVisCols.includes(prop),
|
|
2335
|
+
width: this.dataTableService.useColWid,
|
|
2336
|
+
editable: useTxt.prop === "textContent" ? this.editable : false,
|
|
2337
|
+
dataType: this.dataTableService.figureFilterType(prop),
|
|
2338
|
+
text: (useTxt.prop === "textContent" ? useTxt.value : ""),
|
|
2339
|
+
html: (useTxt.prop !== "textContent" ? useTxt.value : ""),
|
|
2340
|
+
});
|
|
2341
|
+
this.dataTableService.dataFilSrtTracker[prop].colWidth = this.dataTableService.useColWid;
|
|
2342
|
+
}
|
|
2343
|
+
if (row && prop && row.cells && row.cells.length === 1)
|
|
2344
|
+
this.dtChecks.push(indx);
|
|
2345
|
+
};
|
|
2346
|
+
this.useRowWid = this.getAllColWidth(colLen) + "px";
|
|
2347
|
+
const limit = Math.min(init, len);
|
|
2348
|
+
for (n; n < limit; n++) {
|
|
2349
|
+
this.rows.push({ id: "dataTableRow" + n, index: n, width: this.useRowWid, cells: [], height: this.dataTableService.defltRHgt });
|
|
2350
|
+
let k = 0;
|
|
2351
|
+
for (k; k < colLen; k++)
|
|
2352
|
+
addCell(data[n][cols[k]], cols[k], this.rows[n], n);
|
|
2353
|
+
this.dataTableService.currMapping[n] = n;
|
|
2354
|
+
}
|
|
2355
|
+
this.setLastRowIndex();
|
|
2356
|
+
this.paginatorReady = true;
|
|
2357
|
+
this.handleTheme(color1, color2);
|
|
2358
|
+
setTimeout(() => {
|
|
2359
|
+
this.setColHeaderHgt();
|
|
2360
|
+
this.setHoldingCheckCls();
|
|
2361
|
+
this.setRowSelChecksPlacement();
|
|
2362
|
+
this.dataTableService.setTblBounds();
|
|
2363
|
+
});
|
|
2364
|
+
setTimeout(() => {
|
|
2365
|
+
this.dataTableService.setIdealColumnWidth.next(true);
|
|
2366
|
+
if (len > init) {
|
|
2367
|
+
let total = 0;
|
|
2368
|
+
let z = this.lastElRowIndex + 1;
|
|
2369
|
+
for (z; z < len; z++) {
|
|
2370
|
+
total += 1;
|
|
2371
|
+
this.dataTableService.currMapping[z] = z;
|
|
2372
|
+
}
|
|
2373
|
+
this.belowHgt.set(total * defNum);
|
|
2374
|
+
}
|
|
2375
|
+
this.setColsOnVisScreen();
|
|
2376
|
+
}, 250);
|
|
2377
|
+
this.getPrimaryKey(cols);
|
|
2378
|
+
}
|
|
2379
|
+
catch (e) { }
|
|
2380
|
+
}
|
|
2381
|
+
getPrimaryKey(cols) {
|
|
2382
|
+
let i = 0;
|
|
2383
|
+
const len = cols.length;
|
|
2384
|
+
if (this.primaryKey) { //means they set 1 manually
|
|
2385
|
+
const colData = this.dataTableService.mainData.map((d) => d[this.primaryKey]);
|
|
2386
|
+
if (colData.length && !colData.some((c) => !c)) {
|
|
2387
|
+
const map = new Set(colData);
|
|
2388
|
+
if (map.size === this.dataTableService.mainDataLen) {
|
|
2389
|
+
this.dataTableService.primaryKey = this.primaryKey;
|
|
2390
|
+
return this.dataTableService.primaryKey; //they set a good one
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
for (i; i < len; i++) {
|
|
2395
|
+
const col = cols[i];
|
|
2396
|
+
if (this.common.idCol(col)) {
|
|
2397
|
+
const colData = this.dataTableService.mainData.map(d => d[col]);
|
|
2398
|
+
if (colData && !colData.some(c => !c)) { //no null vals
|
|
2399
|
+
const map = new Set(colData);
|
|
2400
|
+
if (map.size === this.dataTableService.mainDataLen) { //all unique vals
|
|
2401
|
+
this.dataTableService.primaryKey = col;
|
|
2402
|
+
return this.dataTableService.primaryKey;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
return "";
|
|
2408
|
+
}
|
|
2409
|
+
execFilter(field, val) {
|
|
2410
|
+
this.dataTableService.isFiltering = true;
|
|
2411
|
+
this.dataTableService.dataFilSrtTracker[field].filter = val || "";
|
|
2412
|
+
this.dataTableService.columnFilter(this.dataTableService.mainData, field, this.dataTableService.dataFilSrtTracker, this.dataTableService.sortOrder, true);
|
|
2413
|
+
this.renderCurrData(false, field);
|
|
2414
|
+
setTimeout(() => { this.dataTableService.isFiltering = false; }, 500);
|
|
2415
|
+
}
|
|
2416
|
+
topFilterOnKeyUp(event) {
|
|
2417
|
+
if (event && !this.common.keyCanSearch(event))
|
|
2418
|
+
return;
|
|
2419
|
+
if (!this.dataTableService.isFiltering) {
|
|
2420
|
+
this.dataTableService.isFiltering = true;
|
|
2421
|
+
this.dataTableService.easyFilter((this.topLevelFilter || ""), this.dataTableService.mainData, this.dataTableService.sortOrder);
|
|
2422
|
+
if (!this.topLevelFilter && !this.dataTableService.arefilSrtTrkPropsDefault()) {
|
|
2423
|
+
let altField = Object.keys(this.dataTableService.mainData[0])[0];
|
|
2424
|
+
this.dataTableService.columnFilter(this.dataTableService.mainData, altField, this.dataTableService.dataFilSrtTracker, this.dataTableService.sortOrder, false);
|
|
2425
|
+
}
|
|
2426
|
+
this.renderCurrData(false, "topLevelDataFilter");
|
|
2427
|
+
setTimeout(() => {
|
|
2428
|
+
this.dataTableService.isFiltering = false;
|
|
2429
|
+
const buildUpLen = this.filterBuildUp.length;
|
|
2430
|
+
if (buildUpLen) {
|
|
2431
|
+
this.topFilterOnKeyUp(null);
|
|
2432
|
+
this.filterBuildUp = [];
|
|
2433
|
+
}
|
|
2434
|
+
}, 500);
|
|
2435
|
+
}
|
|
2436
|
+
else {
|
|
2437
|
+
if (this.filterBuildUp.indexOf(this.topLevelFilter) < 0)
|
|
2438
|
+
this.filterBuildUp.push(this.topLevelFilter);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
setHorizPos(event) {
|
|
2442
|
+
const head = this.dataTableHeaders.nativeElement;
|
|
2443
|
+
if (event > 0)
|
|
2444
|
+
head.style.marginLeft = -event + "px";
|
|
2445
|
+
else
|
|
2446
|
+
head.style.removeProperty("margin-left");
|
|
2447
|
+
this.horizRest = event;
|
|
2448
|
+
}
|
|
2449
|
+
blurContEd() {
|
|
2450
|
+
const actEl = document.activeElement;
|
|
2451
|
+
if (actEl && actEl.getAttribute("contenteditable"))
|
|
2452
|
+
actEl.blur();
|
|
2453
|
+
}
|
|
2454
|
+
setColsOnVisScreen() {
|
|
2455
|
+
const lftPlus = this.rowNumbers ? 75 : 0; //ctrl+f "--row-num-width" in css
|
|
2456
|
+
let i = 0;
|
|
2457
|
+
let vCols = [];
|
|
2458
|
+
const useCols = this.columnHeaders.filter(c => !c.minimized).map(c => c.column);
|
|
2459
|
+
const len = useCols.length;
|
|
2460
|
+
for (i; i < len; i++) {
|
|
2461
|
+
const col = useCols[i];
|
|
2462
|
+
const el = document.getElementById("columnHeader" + this.common.elifyCol(col));
|
|
2463
|
+
if (el) {
|
|
2464
|
+
const elbds = el.getBoundingClientRect();
|
|
2465
|
+
if (elbds.left >= (this.dataTableService.tblLeft - lftPlus) && elbds.right < this.dataTableService.tblRight)
|
|
2466
|
+
vCols.push(col);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
this.dataTableService.visibleCols = [...vCols];
|
|
2470
|
+
}
|
|
2471
|
+
handleScrlBarDrag() {
|
|
2472
|
+
requestAnimationFrame(() => {
|
|
2473
|
+
if (this.dataTableBody) {
|
|
2474
|
+
const tbl = this.dataTableBody.nativeElement;
|
|
2475
|
+
this.execVertScroll(tbl.scrollTop);
|
|
2476
|
+
if (tbl.scrollLeft !== this.horizRest)
|
|
2477
|
+
this.execHorizScroll(tbl.scrollLeft);
|
|
2478
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
handleScroll(event) {
|
|
2483
|
+
const top = event.target.scrollTop;
|
|
2484
|
+
const left = event.target.scrollLeft;
|
|
2485
|
+
/*horiz scroll*/
|
|
2486
|
+
if (left !== this.horizRest)
|
|
2487
|
+
requestAnimationFrame(() => { this.execHorizScroll(left); });
|
|
2488
|
+
/*horiz scroll*/
|
|
2489
|
+
/*vert scroll*/
|
|
2490
|
+
if (top === this.verticalRest || this.lockVScroll) {
|
|
2491
|
+
this.isScrolling = false;
|
|
2492
|
+
if (!this.dataTableService.autoScrollOnEdit)
|
|
2493
|
+
this.clearValidatedEdit();
|
|
2494
|
+
return this.setRowSelChecksPlacement();
|
|
2495
|
+
}
|
|
2496
|
+
this.isScrolling = true;
|
|
2497
|
+
requestAnimationFrame(() => { this.execVertScroll(top); });
|
|
2498
|
+
/*vert scroll*/
|
|
2499
|
+
if (top % 2 === 0)
|
|
2500
|
+
this.clearValidatedEdit();
|
|
2501
|
+
}
|
|
2502
|
+
execHorizScroll(left) {
|
|
2503
|
+
const head = this.dataTableHeaders.nativeElement;
|
|
2504
|
+
if (left > 0)
|
|
2505
|
+
head.style.marginLeft = -left + "px";
|
|
2506
|
+
else
|
|
2507
|
+
head.style.removeProperty("margin-left");
|
|
2508
|
+
this.setColsOnVisScreen();
|
|
2509
|
+
this.execHorizBodyScroll();
|
|
2510
|
+
this.horizRest = left;
|
|
2511
|
+
this.setColsOnVisScreen();
|
|
2512
|
+
}
|
|
2513
|
+
execVertScroll(top) {
|
|
2514
|
+
if (top >= this.verticalRest) {
|
|
2515
|
+
this.execVertScrollDown(this.columnNames, this.columnNames.length);
|
|
2516
|
+
this.clearAboveFoldRows();
|
|
2517
|
+
this.scrollDir = "down";
|
|
2518
|
+
}
|
|
2519
|
+
else { //scrolling back up
|
|
2520
|
+
this.execVertScrollUp(this.columnNames, this.columnNames.length);
|
|
2521
|
+
this.clearBelowFoldRows();
|
|
2522
|
+
this.scrollDir = "up";
|
|
2523
|
+
}
|
|
2524
|
+
this.verticalRest = top;
|
|
2525
|
+
if (this.rowNumbers && top % 2 === 0)
|
|
2526
|
+
this.setRowNumbers();
|
|
2527
|
+
}
|
|
2528
|
+
scrollDir = "down";
|
|
2529
|
+
handleScrollEnd() {
|
|
2530
|
+
this.isScrolling = false;
|
|
2531
|
+
this.lockVScroll = false;
|
|
2532
|
+
setTimeout(() => {
|
|
2533
|
+
this.dataTableService.autoScrollOnEdit = false;
|
|
2534
|
+
this.setColsOnVisScreen();
|
|
2535
|
+
this.setRowSelChecksPlacement();
|
|
2536
|
+
if (this.listenToCellDraggerMouseMove)
|
|
2537
|
+
this.settleCellDragger();
|
|
2538
|
+
setTimeout(() => { this.cleanUpPossibles(); });
|
|
2539
|
+
});
|
|
2540
|
+
}
|
|
2541
|
+
addCell(text, prop, visible) {
|
|
2542
|
+
const useProp = this.dataTableService.dataFilSrtTracker[prop];
|
|
2543
|
+
const notNum = (this.dataTableService.figureFilterType(prop) != "number" || /(year|yr|fy)/g.test(prop.toLocaleLowerCase())) ? true : false;
|
|
2544
|
+
const useTxt = this.dataTableService.figureCellText(text, notNum, useProp["colCellSymbol"]);
|
|
2545
|
+
return {
|
|
2546
|
+
column: prop,
|
|
2547
|
+
rawText: text,
|
|
2548
|
+
editable: useTxt.prop !== "textContent" ? false : this.editable,
|
|
2549
|
+
dataType: this.dataTableService.figureFilterType(prop),
|
|
2550
|
+
freeze: useProp.freeze,
|
|
2551
|
+
visible: visible,
|
|
2552
|
+
minimized: useProp.minimize,
|
|
2553
|
+
width: useProp.colWidth || this.dataTableService.useColWid,
|
|
2554
|
+
text: useTxt.prop === "textContent" ? useTxt.value : "",
|
|
2555
|
+
html: useTxt.prop !== "textContent" ? useTxt.value : "",
|
|
2556
|
+
};
|
|
2557
|
+
}
|
|
2558
|
+
execHorizBodyScroll() {
|
|
2559
|
+
const allcols = this.getAllColsAtRuntime(null);
|
|
2560
|
+
let i = 0;
|
|
2561
|
+
const clen = allcols.length;
|
|
2562
|
+
const rlen = this.rows.length;
|
|
2563
|
+
const lftPlus = this.rowNumbers ? 75 : 0; //ctrl+f "--row-num-width" in css
|
|
2564
|
+
let positions = [];
|
|
2565
|
+
const row0 = this.rows[0];
|
|
2566
|
+
for (let p = (clen - 1); p >= 0; p--) {
|
|
2567
|
+
const col = allcols[p];
|
|
2568
|
+
const elcol = this.common.elifyCol(col);
|
|
2569
|
+
const head = document.getElementById("columnHeader" + elcol);
|
|
2570
|
+
if (head) {
|
|
2571
|
+
const bds = head.getBoundingClientRect();
|
|
2572
|
+
if (bds.left > this.dataTableService.tblRight)
|
|
2573
|
+
continue;
|
|
2574
|
+
const cell = row0?.cells?.find(c => c.column === col);
|
|
2575
|
+
if (cell) {
|
|
2576
|
+
if (!cell.visible && (this.dataTableService.visibleCols.includes(col) || (bds.left >= (this.dataTableService.tblLeft - lftPlus) && bds.right < (this.dataTableService.tblRight + lftPlus)))) //visible
|
|
2577
|
+
positions.push({ col: col, vis: true });
|
|
2578
|
+
if (cell.visible && !this.dataTableService.visibleCols.includes(col) && !positions.find((p) => p.col === col))
|
|
2579
|
+
positions.push({ col: col, vis: false });
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
const plen = positions.length;
|
|
2584
|
+
for (i; i < rlen; i++) {
|
|
2585
|
+
let c = 0;
|
|
2586
|
+
const row = this.rows[i];
|
|
2587
|
+
if (row) {
|
|
2588
|
+
for (c; c < plen; c++) {
|
|
2589
|
+
const pos = positions[c];
|
|
2590
|
+
if (pos) {
|
|
2591
|
+
if (pos.vis) {
|
|
2592
|
+
row.cells = row.cells?.map(c => {
|
|
2593
|
+
if (c.column === pos.col)
|
|
2594
|
+
return this.addCell(c.rawText, pos.col, true);
|
|
2595
|
+
return c;
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
else {
|
|
2599
|
+
const rCell = row.cells?.find(c => c.column === pos.col);
|
|
2600
|
+
if (rCell) {
|
|
2601
|
+
rCell.visible = false;
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
setTimeout(() => {
|
|
2609
|
+
this.dataTableService.setIdealColumnWidth.next(true);
|
|
2610
|
+
this.setColsOnVisScreen();
|
|
2611
|
+
setTimeout(() => { this.cleanUpPossibles(); });
|
|
2612
|
+
}, 50);
|
|
2613
|
+
}
|
|
2614
|
+
cleanUpPossibles() {
|
|
2615
|
+
let i = 0;
|
|
2616
|
+
const len = this.rows.length;
|
|
2617
|
+
const lftPlus = this.rowNumbers ? 75 : 0; //ctrl+f "--row-num-width" in css
|
|
2618
|
+
for (i; i < len; i++) {
|
|
2619
|
+
const row = this.rows[i];
|
|
2620
|
+
if (row) {
|
|
2621
|
+
let p = 0;
|
|
2622
|
+
if (row.cells?.length) {
|
|
2623
|
+
const rclen = row.cells.length;
|
|
2624
|
+
for (p; p < rclen; p++) {
|
|
2625
|
+
const cell = row.cells[p];
|
|
2626
|
+
if (cell) {
|
|
2627
|
+
const ccol = cell.column;
|
|
2628
|
+
const el = document.querySelector("#" + row.id + " .data-cell-" + this.common.elifyCol(ccol));
|
|
2629
|
+
if ((el && el.getBoundingClientRect().right < (this.dataTableService.tblLeft - lftPlus)) && (!el?.innerHTML || !el.getAttribute("style"))) {
|
|
2630
|
+
row.cells[p].visible = true;
|
|
2631
|
+
row.cells[p] = { ...this.addCell(cell.rawText, ccol, true) };
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
execVertScrollDown(cols, colLen) {
|
|
2640
|
+
let canAdd = 0;
|
|
2641
|
+
const actvCols = this.columnHeaders.map(c => c.column);
|
|
2642
|
+
const vlen = this.dataTableService.visibleCols.length;
|
|
2643
|
+
const lastVisInd = actvCols.indexOf(this.dataTableService.visibleCols[(vlen - 1)]) + 1;
|
|
2644
|
+
const bel = this.belowArea.nativeElement;
|
|
2645
|
+
const bbds = bel.getBoundingClientRect();
|
|
2646
|
+
const rTop = (bbds.top - this.verticalRest);
|
|
2647
|
+
const gap = this.dataTableService.tblBot - rTop;
|
|
2648
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2649
|
+
if (gap > 0) {
|
|
2650
|
+
let h = 0;
|
|
2651
|
+
let z = this.lastElRowIndex + 1;
|
|
2652
|
+
const last = document.getElementById("dataTableRow" + this.lastElRowIndex);
|
|
2653
|
+
if (last && this.dataTableService.elIsBelowFold(last, this.dataTableService.tblBot))
|
|
2654
|
+
return;
|
|
2655
|
+
let bhToSub = 0;
|
|
2656
|
+
let ahToAdd = 0;
|
|
2657
|
+
const rowsInGap = Math.ceil(gap / defNum);
|
|
2658
|
+
canAdd = z + (rowsInGap);
|
|
2659
|
+
let chksToAdd = [];
|
|
2660
|
+
let rowsToAdd = [];
|
|
2661
|
+
const goTo = Math.min(this.dataTableService.currFilData.length, canAdd);
|
|
2662
|
+
for (z; z < goTo; z++) {
|
|
2663
|
+
const wldBeElTop = bbds.top + (defNum * h);
|
|
2664
|
+
const wldBeElBot = wldBeElTop + defNum;
|
|
2665
|
+
if (wldBeElBot < this.dataTableService.tblTop) {
|
|
2666
|
+
ahToAdd += defNum;
|
|
2667
|
+
bhToSub += defNum;
|
|
2668
|
+
}
|
|
2669
|
+
else {
|
|
2670
|
+
if (wldBeElTop <= this.dataTableService.tblBot) {
|
|
2671
|
+
const item = this.dataTableService.currFilData[z];
|
|
2672
|
+
const index = this.dataTableService.currMapping[z] || this.dataTableService.findObjIndxInData(item);
|
|
2673
|
+
if (index > -1 && !this.rows.find(r => r.index === index)) {
|
|
2674
|
+
const nRow = { id: "dataTableRow" + index, index: index, width: this.useRowWid, cells: [], height: this.dataTableService.defltRHgt };
|
|
2675
|
+
let cells = [];
|
|
2676
|
+
for (let k = (colLen - 1); k >= 0; k--) {
|
|
2677
|
+
const col = cols[k];
|
|
2678
|
+
const cell = this.addCell(item[col], col, (k <= lastVisInd));
|
|
2679
|
+
if (typeof cell !== "string")
|
|
2680
|
+
cells.unshift(cell);
|
|
2681
|
+
}
|
|
2682
|
+
nRow.cells = [...cells];
|
|
2683
|
+
chksToAdd.push(index);
|
|
2684
|
+
rowsToAdd.push(nRow);
|
|
2685
|
+
bhToSub += defNum;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
h += 1;
|
|
2690
|
+
}
|
|
2691
|
+
this.rows = [...this.rows, ...rowsToAdd];
|
|
2692
|
+
if (bhToSub)
|
|
2693
|
+
this.belowHgt.set(Math.max(0, (this.belowHgt() - bhToSub)));
|
|
2694
|
+
if (chksToAdd.length)
|
|
2695
|
+
this.dtChecks = [...this.dtChecks, ...chksToAdd];
|
|
2696
|
+
if (ahToAdd)
|
|
2697
|
+
this.aboveHgt.set(this.aboveHgt() + ahToAdd);
|
|
2698
|
+
this.setLastRowIndex();
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
execVertScrollUp(cols, colLen) {
|
|
2702
|
+
const actvCols = this.columnHeaders.map(c => c.column);
|
|
2703
|
+
const vlen = this.dataTableService.visibleCols.length;
|
|
2704
|
+
const lastVisInd = actvCols.indexOf(this.dataTableService.visibleCols[(vlen - 1)]) + 1;
|
|
2705
|
+
const ael = this.aboveArea.nativeElement;
|
|
2706
|
+
const abds = ael.getBoundingClientRect();
|
|
2707
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2708
|
+
const rbot = abds.bottom;
|
|
2709
|
+
const gap = rbot - (this.dataTableService.tblTop);
|
|
2710
|
+
if (gap > 0) {
|
|
2711
|
+
let h = 0;
|
|
2712
|
+
const rlen = this.rows.length;
|
|
2713
|
+
let z = (this.lastElRowIndex - rlen);
|
|
2714
|
+
if (z < 0)
|
|
2715
|
+
return;
|
|
2716
|
+
let bhToAdd = 0;
|
|
2717
|
+
let ahToSub = 0;
|
|
2718
|
+
const rowsInGap = Math.ceil(gap / defNum);
|
|
2719
|
+
const min = Math.max(0, (z - rowsInGap));
|
|
2720
|
+
for (z; z >= min; z--) {
|
|
2721
|
+
const wldBeElBot = rbot - (defNum * h);
|
|
2722
|
+
const wldBeElTop = wldBeElBot - defNum;
|
|
2723
|
+
if (wldBeElTop > this.dataTableService.tblBot) {
|
|
2724
|
+
bhToAdd += defNum;
|
|
2725
|
+
ahToSub += defNum;
|
|
2726
|
+
}
|
|
2727
|
+
else {
|
|
2728
|
+
if (wldBeElBot > this.dataTableService.tblTop) {
|
|
2729
|
+
const item = this.dataTableService.currFilData[z];
|
|
2730
|
+
const index = this.dataTableService.currMapping[z] || this.dataTableService.findObjIndxInData(item);
|
|
2731
|
+
if (index > -1) {
|
|
2732
|
+
let k = 0;
|
|
2733
|
+
const nRow = { id: "dataTableRow" + index, index: index, width: this.useRowWid, cells: [], height: this.dataTableService.defltRHgt };
|
|
2734
|
+
let cells = [];
|
|
2735
|
+
for (k; k < colLen; k++) {
|
|
2736
|
+
const col = cols[k];
|
|
2737
|
+
const cell = this.addCell(item[col], col, (k <= lastVisInd));
|
|
2738
|
+
if (typeof cell !== "string")
|
|
2739
|
+
cells.push(cell);
|
|
2740
|
+
}
|
|
2741
|
+
nRow.cells = [...cells];
|
|
2742
|
+
this.rows = [nRow, ...this.rows];
|
|
2743
|
+
this.dtChecks = [index, ...this.dtChecks];
|
|
2744
|
+
ahToSub += defNum;
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
h += 1;
|
|
2749
|
+
}
|
|
2750
|
+
if (ahToSub)
|
|
2751
|
+
this.aboveHgt.set(Math.max(0, (this.aboveHgt() - ahToSub)));
|
|
2752
|
+
if (bhToAdd)
|
|
2753
|
+
this.belowHgt.set(this.belowHgt() + bhToAdd);
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
clearAboveFoldRows() {
|
|
2757
|
+
const els = this.rows.filter(r => this.dataTableService.elIsAboveFold(document.getElementById(r.id), (this.dataTableService.tblTop)));
|
|
2758
|
+
const justids = els.map(e => e.id);
|
|
2759
|
+
const justindx = els.map(e => e.index);
|
|
2760
|
+
const changes = justids.length;
|
|
2761
|
+
if (changes > 0) {
|
|
2762
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2763
|
+
this.rows = this.rows.filter(r => !justids.includes(r.id));
|
|
2764
|
+
this.dtChecks = this.dtChecks.filter(c => !justindx.includes(c));
|
|
2765
|
+
const item = this.dataTableService.mainData[(this.rows[0]?.index || -1)];
|
|
2766
|
+
if (item)
|
|
2767
|
+
this.aboveHgt.set(Math.max(0, this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData) * defNum));
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
clearBelowFoldRows() {
|
|
2771
|
+
const els = this.rows.filter(r => this.dataTableService.elIsBelowFold(document.getElementById(r.id), this.dataTableService.tblBot));
|
|
2772
|
+
const justids = els.map(e => e.id);
|
|
2773
|
+
const justindx = els.map(e => e.index);
|
|
2774
|
+
let changes = justids.length;
|
|
2775
|
+
if (changes > 0) {
|
|
2776
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2777
|
+
this.rows = this.rows.filter(r => !justids.includes(r.id));
|
|
2778
|
+
this.dtChecks = this.dtChecks.filter(c => !justindx.includes(c));
|
|
2779
|
+
const rlen = this.rows.length;
|
|
2780
|
+
const item = this.dataTableService.mainData[(this.rows[(rlen - 1)]?.index || -1)];
|
|
2781
|
+
if (item)
|
|
2782
|
+
this.belowHgt.set(Math.max(0, ((this.dataTableService.currFilData.length - 1) - this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData)) * defNum));
|
|
2783
|
+
this.setLastRowIndex();
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
jumpToRow(row) {
|
|
2787
|
+
if (this.dataTableBody) {
|
|
2788
|
+
const ind = row - 1;
|
|
2789
|
+
const tbl = this.dataTableBody.nativeElement;
|
|
2790
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
2791
|
+
tbl.scrollTop = ind * defNum;
|
|
2792
|
+
this.execVertScroll(tbl.scrollTop);
|
|
2793
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
valEditFocusTo = null;
|
|
2797
|
+
handleValidatedCellEditFocus(cellData) {
|
|
2798
|
+
this.validatedEditType = cellData.type;
|
|
2799
|
+
if (this.valEditFocusTo) {
|
|
2800
|
+
clearTimeout(this.valEditFocusTo);
|
|
2801
|
+
this.valEditFocusTo = null;
|
|
2802
|
+
}
|
|
2803
|
+
this.valEditFocusTo = setTimeout(() => {
|
|
2804
|
+
const rel = this.validatedEdit.nativeElement;
|
|
2805
|
+
let el;
|
|
2806
|
+
const elD = document.querySelector(".relly.edit-input");
|
|
2807
|
+
if (!elD) //look for the one that's relly (relative) positioned first
|
|
2808
|
+
el = document.getElementsByClassName("edit-input")[0];
|
|
2809
|
+
const cell = document.querySelector("#dataTableRow" + this.dataTableService.currEditIndex + " .data-cell-" + this.common.elifyCol(this.dataTableService.currEditCol));
|
|
2810
|
+
if ((el || elD) && cell) {
|
|
2811
|
+
const rbds = rel.getBoundingClientRect();
|
|
2812
|
+
const cbds = cell.getBoundingClientRect();
|
|
2813
|
+
(el || elD).style.top = (cellData.type === "text" ? (Math.ceil(cbds.bottom - rbds.top) + 1) : (Math.ceil(cbds.top - rbds.top) + 1)) + "px";
|
|
2814
|
+
(el || elD).style.left = (Math.ceil(cbds.left - rbds.left) + 1) + "px";
|
|
2815
|
+
(el || elD).style.width = (cbds.width - 2) + "px";
|
|
2816
|
+
(el || elD).style.height = (cbds.height - 2) + "px";
|
|
2817
|
+
if (el) {
|
|
2818
|
+
el.value = cellData.type === "date" ? new Date(cellData.value)?.toISOString().split("T")[0] : cellData.value;
|
|
2819
|
+
setTimeout(() => { el.focus(); });
|
|
2820
|
+
}
|
|
2821
|
+
rel.classList.remove("invisible");
|
|
2822
|
+
this.fCellDragger.nativeElement.style.left = (Math.ceil(cbds.left - rbds.left) + cbds.width - 4) + "px";
|
|
2823
|
+
this.fCellDragger.nativeElement.style.top = (Math.ceil(cbds.bottom - rbds.top) - 4) + "px";
|
|
2824
|
+
}
|
|
2825
|
+
}, 10);
|
|
2826
|
+
}
|
|
2827
|
+
clearFCellDragger() {
|
|
2828
|
+
if (!this.dataTableService.autoScrollOnEdit) {
|
|
2829
|
+
this.fCellDragger.nativeElement.style.removeProperty("top");
|
|
2830
|
+
this.fCellDragger.nativeElement.style.removeProperty("left");
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
clearValidatedEdit(e, clearDrag) {
|
|
2834
|
+
if (this.listenToCellDraggerMouseMove)
|
|
2835
|
+
return;
|
|
2836
|
+
if ((e && e.type === "blur") || (e && e.type === "focus" && e.relatedTarget?.id === "fCellDragger")) {
|
|
2837
|
+
setTimeout(() => { this.handleCellDraggerInit(); });
|
|
2838
|
+
}
|
|
2839
|
+
else {
|
|
2840
|
+
this.execValClear(clearDrag);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
execValClear(clearDrag) {
|
|
2844
|
+
this.blurContEd();
|
|
2845
|
+
this.dataTableService.currEditIndex = -1;
|
|
2846
|
+
this.dataTableService.currEditCol = "";
|
|
2847
|
+
this.validatedEditType = "";
|
|
2848
|
+
this.validatedEdit.nativeElement.classList.add("invisible");
|
|
2849
|
+
if (clearDrag)
|
|
2850
|
+
this.clearCellDEdits();
|
|
2851
|
+
setTimeout(() => { this.dataTableService.clearAllFocused(); });
|
|
2852
|
+
}
|
|
2853
|
+
handleDraggerMU(e) {
|
|
2854
|
+
if (e && e.target && e.target.id && e.target.id.startsWith("selEdit"))
|
|
2855
|
+
return;
|
|
2856
|
+
this.listenToCellDraggerMouseUp = false;
|
|
2857
|
+
if (this.listenToCellDraggerMouseMove) {
|
|
2858
|
+
this.listenToCellDraggerMouseMove = false;
|
|
2859
|
+
this.clearCellDEdits();
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
handleDraggerKD(e) {
|
|
2863
|
+
const row = document.getElementById("dataTableRow" + this.dataTableService.currEditIndex);
|
|
2864
|
+
if (row && this.dataTableService.currEditCol) {
|
|
2865
|
+
let targRow;
|
|
2866
|
+
let bds;
|
|
2867
|
+
if (e && this.common.isDownKey(e))
|
|
2868
|
+
targRow = row.nextElementSibling;
|
|
2869
|
+
if (e && this.common.isUpKey(e))
|
|
2870
|
+
targRow = row.previousElementSibling;
|
|
2871
|
+
if (targRow) {
|
|
2872
|
+
bds = targRow.getBoundingClientRect();
|
|
2873
|
+
this.listenToCellDraggerMouseMove = true;
|
|
2874
|
+
const execDragEOnDK = (e) => {
|
|
2875
|
+
this.handleCellDraggerEdit(e);
|
|
2876
|
+
};
|
|
2877
|
+
targRow.addEventListener("mousemove", execDragEOnDK);
|
|
2878
|
+
const mouseEvent = new MouseEvent('mousemove', {
|
|
2879
|
+
view: window,
|
|
2880
|
+
bubbles: false,
|
|
2881
|
+
cancelable: false,
|
|
2882
|
+
clientX: bds.right, // X-coordinate relative to the viewport
|
|
2883
|
+
clientY: bds.bottom, // Y-coordinate relative to the viewport
|
|
2884
|
+
});
|
|
2885
|
+
targRow.dispatchEvent(mouseEvent);
|
|
2886
|
+
targRow.removeEventListener("mousemove", execDragEOnDK);
|
|
2887
|
+
setTimeout(() => { this.listenToCellDraggerMouseMove = false; });
|
|
2888
|
+
if (e.target.getBoundingClientRect().bottom > (this.dataTableService.tblBot - 100))
|
|
2889
|
+
this.dataTableBody.nativeElement.scrollBy(0, this.dataTableService.dTblHeight / 2);
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
clearCellDEdits() {
|
|
2894
|
+
this.clearFCellDragger();
|
|
2895
|
+
this.dataTableService.clearDCellFcsd();
|
|
2896
|
+
this.clearDragEditFlag();
|
|
2897
|
+
}
|
|
2898
|
+
clearDragEditFlag() {
|
|
2899
|
+
this.rows = this.rows.map(r => {
|
|
2900
|
+
if (r.editedInDrag)
|
|
2901
|
+
r.editedInDrag = false;
|
|
2902
|
+
return r;
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
handleCellDraggerInit() {
|
|
2906
|
+
const actEl = document.activeElement;
|
|
2907
|
+
if (actEl && actEl.id === "fCellDragger") {
|
|
2908
|
+
this.focusCellDragger();
|
|
2909
|
+
}
|
|
2910
|
+
else {
|
|
2911
|
+
if (!actEl || (actEl && !/data-cell/g.test(actEl?.className)))
|
|
2912
|
+
this.execValClear();
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
focusCellDragger() {
|
|
2916
|
+
this.validatedEditType = "";
|
|
2917
|
+
this.validatedEdit.nativeElement.classList.add("invisible");
|
|
2918
|
+
const cell = document.querySelector("#dataTableRow" + this.dataTableService.currEditIndex + " .data-cell-" + this.common.elifyCol(this.dataTableService.currEditCol));
|
|
2919
|
+
if (cell)
|
|
2920
|
+
cell.classList.add("dragger-cell-focused");
|
|
2921
|
+
this.listenToCellDraggerMouseUp = true;
|
|
2922
|
+
}
|
|
2923
|
+
focusCellDraggerFromMouseDown() {
|
|
2924
|
+
this.listenToCellDraggerMouseMove = true;
|
|
2925
|
+
}
|
|
2926
|
+
handleFDragTab(e) {
|
|
2927
|
+
if (e && this.common.isTabKey(e)) {
|
|
2928
|
+
const cell = document.getElementsByClassName("dragger-cell-focused")[0];
|
|
2929
|
+
const nxtCell = cell.parentElement?.nextElementSibling?.firstElementChild;
|
|
2930
|
+
if (cell && nxtCell) {
|
|
2931
|
+
this.dataTableService.autoScrollOnEdit = true;
|
|
2932
|
+
setTimeout(() => { nxtCell.focus(); });
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
settleCellDragger() {
|
|
2937
|
+
const els = document.getElementsByClassName("dragger-cell-focused");
|
|
2938
|
+
const len = els.length;
|
|
2939
|
+
const cell = this.scrollDir === "down" ? els[(len - 1)] : els[0];
|
|
2940
|
+
if (cell) {
|
|
2941
|
+
const fCellDragger = document.getElementsByClassName("focused-cell-dragger")[0];
|
|
2942
|
+
const par = fCellDragger?.parentElement;
|
|
2943
|
+
if (fCellDragger && par) {
|
|
2944
|
+
const cbds = cell.getBoundingClientRect();
|
|
2945
|
+
const rbds = par.getBoundingClientRect();
|
|
2946
|
+
fCellDragger.style.left = (Math.ceil(cbds.left - rbds.left) + cbds.width - 4) + "px";
|
|
2947
|
+
fCellDragger.style.top = (Math.ceil(cbds.bottom - rbds.top) - 4) + "px";
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
handleCellDraggerEdit(e) {
|
|
2952
|
+
if (e && e.target) {
|
|
2953
|
+
let dragId = -1;
|
|
2954
|
+
const targ = e.target;
|
|
2955
|
+
try {
|
|
2956
|
+
if (/dataTableRow/g.test(targ.id)) {
|
|
2957
|
+
dragId = parseInt(targ.id.replace("dataTableRow", ""));
|
|
2958
|
+
}
|
|
2959
|
+
else {
|
|
2960
|
+
if (/data-cell/g.test(targ.className))
|
|
2961
|
+
dragId = parseInt(targ.getAttribute("data-index").replace("dataTableRow", ""));
|
|
2962
|
+
}
|
|
2963
|
+
let cell;
|
|
2964
|
+
const row = this.rows.find(r => r.index === dragId);
|
|
2965
|
+
const els = document.getElementsByClassName("dragger-cell-focused");
|
|
2966
|
+
if (dragId > -1 && (row && !row.editedInDrag)) {
|
|
2967
|
+
const item = this.dataTableService.mainData[this.dataTableService.currEditIndex];
|
|
2968
|
+
const val = item[this.dataTableService.currEditCol];
|
|
2969
|
+
const currEInd = this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData);
|
|
2970
|
+
const currDrgInd = this.dataTableService.findObjIndxInData(this.dataTableService.mainData[dragId], this.dataTableService.currFilData);
|
|
2971
|
+
this.scrollDir = currDrgInd > currEInd ? "down" : "up";
|
|
2972
|
+
this.dataTableService.currEditIndex = dragId;
|
|
2973
|
+
this.execCellEdit({ column: this.dataTableService.currEditCol, value: val }, true);
|
|
2974
|
+
row.editedInDrag = true;
|
|
2975
|
+
cell = document.querySelector("#dataTableRow" + dragId + " .data-cell-" + this.common.elifyCol(this.dataTableService.currEditCol));
|
|
2976
|
+
}
|
|
2977
|
+
if (els.length > 1) {
|
|
2978
|
+
const dir = this.scrollDir === "down" ? 1 : -1;
|
|
2979
|
+
const toScl = dir * (Math.ceil((e.offsetY || 20)) / 2);
|
|
2980
|
+
this.dataTableBody.nativeElement.scrollBy(0, toScl);
|
|
2981
|
+
}
|
|
2982
|
+
const fCellDragger = document.getElementsByClassName("focused-cell-dragger")[0];
|
|
2983
|
+
const par = fCellDragger?.parentElement;
|
|
2984
|
+
if (cell && fCellDragger && par) {
|
|
2985
|
+
const cbds = cell.getBoundingClientRect();
|
|
2986
|
+
const rbds = par.getBoundingClientRect();
|
|
2987
|
+
fCellDragger.style.left = (Math.ceil(cbds.left - rbds.left) + cbds.width - 4) + "px";
|
|
2988
|
+
fCellDragger.style.top = (Math.ceil(cbds.bottom - rbds.top) - 4) + "px";
|
|
2989
|
+
}
|
|
2990
|
+
if (!cell) {
|
|
2991
|
+
const len = els.length;
|
|
2992
|
+
if (len) {
|
|
2993
|
+
if (e.clientY > this.dataTableService.tblBot) {
|
|
2994
|
+
cell = els[(len - 1)];
|
|
2995
|
+
}
|
|
2996
|
+
if (e.clientY < this.dataTableService.tblTop) {
|
|
2997
|
+
cell = els[0];
|
|
2998
|
+
}
|
|
2999
|
+
if (cell && fCellDragger && par) {
|
|
3000
|
+
const cbds = cell.getBoundingClientRect();
|
|
3001
|
+
const rbds = par.getBoundingClientRect();
|
|
3002
|
+
fCellDragger.style.left = (Math.ceil(cbds.left - rbds.left) + cbds.width - 4) + "px";
|
|
3003
|
+
fCellDragger.style.top = (Math.ceil(cbds.bottom - rbds.top) - 4) + "px";
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
catch (e) { }
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
validateRawText(text, dataType) {
|
|
3012
|
+
if (dataType === "number" && (!text || /[a-zA-Z \/]/g.test(text)))
|
|
3013
|
+
return "";
|
|
3014
|
+
return text;
|
|
3015
|
+
}
|
|
3016
|
+
execCellEdit(e, noBlur, forceVal /*from dropdown select, normally a string*/) {
|
|
3017
|
+
if (this.dataTableService.currEditIndex > -1) {
|
|
3018
|
+
let cfDIdx;
|
|
3019
|
+
const valEl = document.getElementsByClassName("edit-input")[0];
|
|
3020
|
+
let val = forceVal ? forceVal : (valEl ? valEl.value : e.value);
|
|
3021
|
+
if (val && !this.validateRawText(val, this.validatedEditType)) {
|
|
3022
|
+
if (!noBlur)
|
|
3023
|
+
this.clearValidatedEdit(e);
|
|
3024
|
+
return;
|
|
3025
|
+
}
|
|
3026
|
+
if (val && typeof val === "string" && this.validatedEditType === "date")
|
|
3027
|
+
val = this.common.coerceDate(val);
|
|
3028
|
+
if (val && typeof val === "string" && this.validatedEditType === "number")
|
|
3029
|
+
val = /\./g.test(val) ? parseFloat(val) : parseInt(val);
|
|
3030
|
+
const realProp = this.dataTableService.currEditCol || e.column;
|
|
3031
|
+
this.dataTableService.mainData[this.dataTableService.currEditIndex][realProp] = val;
|
|
3032
|
+
const item = this.dataTableService.mainData[this.dataTableService.currEditIndex];
|
|
3033
|
+
if (item) {
|
|
3034
|
+
cfDIdx = this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData);
|
|
3035
|
+
if (cfDIdx > -1)
|
|
3036
|
+
this.dataTableService.currFilData[cfDIdx][realProp] = val;
|
|
3037
|
+
}
|
|
3038
|
+
let cell;
|
|
3039
|
+
const row = this.rows.find(r => r.index === this.dataTableService.currEditIndex);
|
|
3040
|
+
if (row) {
|
|
3041
|
+
cell = row.cells?.find(c => c.column === this.dataTableService.currEditCol || c.column === e.column);
|
|
3042
|
+
if (cell)
|
|
3043
|
+
cell.rawText = val;
|
|
3044
|
+
}
|
|
3045
|
+
const dtType = this.dataTableService.figureFilterType(realProp);
|
|
3046
|
+
const notNum = (dtType != "number" || /(year|yr|fy)/g.test(realProp.toLocaleLowerCase())) ? true : false;
|
|
3047
|
+
const useTxt = this.dataTableService.figureCellText(val, notNum);
|
|
3048
|
+
const cellEl = document.querySelector("#dataTableRow" + this.dataTableService.currEditIndex + " .data-cell-" + this.common.elifyCol(realProp));
|
|
3049
|
+
if (cellEl) {
|
|
3050
|
+
if (useTxt.prop === "textContent")
|
|
3051
|
+
cellEl.textContent = useTxt.value;
|
|
3052
|
+
else
|
|
3053
|
+
cellEl.innerHTML = useTxt.value;
|
|
3054
|
+
if (cell) {
|
|
3055
|
+
cell.text = useTxt.prop === "textContent" ? useTxt.value : "";
|
|
3056
|
+
if (this.listenToCellDraggerMouseMove)
|
|
3057
|
+
cellEl.classList.add("dragger-cell-focused");
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
const rowKey = (this.dataTableService.primaryKey ? this.dataTableService.mainData[this.dataTableService.currEditIndex][this.dataTableService.primaryKey] :
|
|
3061
|
+
this.dataTableService.currEditIndex);
|
|
3062
|
+
const edit = {
|
|
3063
|
+
value: val,
|
|
3064
|
+
column: realProp,
|
|
3065
|
+
row: rowKey,
|
|
3066
|
+
};
|
|
3067
|
+
this.cellEdit.emit(edit);
|
|
3068
|
+
if (!noBlur)
|
|
3069
|
+
this.clearValidatedEdit(e);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
handleSingleColResize(val, column) {
|
|
3073
|
+
if (val && (this.dataTableService.currColumnEdit || column)) {
|
|
3074
|
+
const cols = this.getAllColsAtRuntime(null);
|
|
3075
|
+
const colLen = cols.length;
|
|
3076
|
+
const rawCol = column || this.common.replaceUniSep(this.dataTableService.currColumnEdit);
|
|
3077
|
+
const thecol = this.columnHeaders.find(c => (c && c.column === rawCol));
|
|
3078
|
+
if (thecol) {
|
|
3079
|
+
thecol.width = (val + "px");
|
|
3080
|
+
this.dataTableService.dataFilSrtTracker[thecol.column]["colWidth"] = (val + "px");
|
|
3081
|
+
}
|
|
3082
|
+
let i = 0;
|
|
3083
|
+
const toResize = this.rows.filter(r => r.cells?.length);
|
|
3084
|
+
const len = toResize.length;
|
|
3085
|
+
for (i; i < len; i++) {
|
|
3086
|
+
const ind = toResize[i].index;
|
|
3087
|
+
const row = this.rows.find(r => r.index === ind);
|
|
3088
|
+
if (row) {
|
|
3089
|
+
row.cells = row.cells?.map(c => {
|
|
3090
|
+
if (c && c.column === rawCol)
|
|
3091
|
+
c.width = (val + "px");
|
|
3092
|
+
return c;
|
|
3093
|
+
});
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
setTimeout(() => {
|
|
3097
|
+
const allColW = this.getAllColWidth(colLen);
|
|
3098
|
+
this.setDataRowWidthsOnMinimize(allColW);
|
|
3099
|
+
this.setRowSelChecksPlacement();
|
|
3100
|
+
});
|
|
3101
|
+
this.clearValidatedEdit();
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
setHeaderHeight(val, force) {
|
|
3105
|
+
if (val && typeof val === "string")
|
|
3106
|
+
val = Math.ceil(parseInt(val));
|
|
3107
|
+
const rHgt = force ? val : Math.max(val, parseInt(this.desRowHeight));
|
|
3108
|
+
const useHgt = Math.floor(rHgt) + "px";
|
|
3109
|
+
const row = this.dataTableHeaders.nativeElement;
|
|
3110
|
+
row["style"]["height"] = useHgt;
|
|
3111
|
+
this.columnHeaders.forEach(c => { c.height = useHgt; });
|
|
3112
|
+
if (this.rowNumbers && this.rowNumHeader)
|
|
3113
|
+
this.rowNumHeader.nativeElement.style.height = useHgt;
|
|
3114
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
3115
|
+
}
|
|
3116
|
+
setSingleRowHgt(val, row, force) {
|
|
3117
|
+
if (val && typeof val === "string")
|
|
3118
|
+
val = Math.ceil(parseInt(val));
|
|
3119
|
+
const rHgt = force ? val : Math.max(val, (parseInt(this.desRowHeight) || Math.ceil(row.getBoundingClientRect().height)));
|
|
3120
|
+
const useHgt = Math.floor(rHgt) + "px";
|
|
3121
|
+
if (typeof row === "string" && this.tblDragService.colDragStartFrmCellTracker.row && this.tblDragService.colDragStartFrmCellTracker.ystart) {
|
|
3122
|
+
const drow = this.rows.find(r => r.id === row);
|
|
3123
|
+
if (drow) {
|
|
3124
|
+
drow.height = useHgt;
|
|
3125
|
+
if (this.rowNumbers) {
|
|
3126
|
+
const item = this.dataTableService.mainData[drow?.index];
|
|
3127
|
+
if (item) {
|
|
3128
|
+
const indx = this.dataTableService.findObjIndxInData(item, this.dataTableService.currFilData) + 1;
|
|
3129
|
+
const rNum = this.rowNos.find(r => r.number === indx);
|
|
3130
|
+
if (rNum)
|
|
3131
|
+
rNum.height = useHgt;
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); });
|
|
3137
|
+
this.clearValidatedEdit();
|
|
3138
|
+
}
|
|
3139
|
+
checkTabHorizScroll(id) {
|
|
3140
|
+
const colH = document.getElementById("columnHeader" + id);
|
|
3141
|
+
const dtb = this.dataTableBody.nativeElement;
|
|
3142
|
+
if (colH && dtb) {
|
|
3143
|
+
let left = (colH.getBoundingClientRect().left - 50);
|
|
3144
|
+
if (colH) {
|
|
3145
|
+
left -= (this.rowNumbers ? 75 : 0);
|
|
3146
|
+
dtb.scrollBy(left, 0);
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
handleTheme(co1, co2) {
|
|
3151
|
+
try {
|
|
3152
|
+
let rule1;
|
|
3153
|
+
let rule1a;
|
|
3154
|
+
let rule2;
|
|
3155
|
+
let rule3;
|
|
3156
|
+
let rule4;
|
|
3157
|
+
let rule5;
|
|
3158
|
+
let rule6;
|
|
3159
|
+
if (co1) {
|
|
3160
|
+
this.dataTableService.themeColor1 = co1;
|
|
3161
|
+
rule1 = ".col-header span, .col-header sup, .col-header button .material-icons, " +
|
|
3162
|
+
".data-table-footer div, .btn-fil-comp i{color: " + co1 + " !important}";
|
|
3163
|
+
rule1a = ".col-header select, .col-header input:not(input[type=file]){box-shadow:0 0 1px 1px " + co1 + ";" +
|
|
3164
|
+
"-webkit-box-shadow:0 0 1px 1px " + co1 + "}";
|
|
3165
|
+
}
|
|
3166
|
+
if (co2) {
|
|
3167
|
+
this.dataTableService.themeColor2 = co2;
|
|
3168
|
+
rule2 = ".col-header, .data-table-footer, .btn-fil-comp{background: " + co2 + " !important}";
|
|
3169
|
+
const tblbxSh = "0 -1px 3px 1px ";
|
|
3170
|
+
const tblFbxSh = "0 1px 3px -3px ";
|
|
3171
|
+
if (this.dataTableService.mainDataLen) {
|
|
3172
|
+
rule2 = ".col-header, .btn-fil-comp{background: " + co2 + " !important}";
|
|
3173
|
+
rule3 = ".data-table{ box-shadow: " + tblbxSh + co2 + "; -webkit-box-shadow: " + tblbxSh + co2 + "; -moz-box-shadow: " + tblbxSh + co2 + "}";
|
|
3174
|
+
rule6 = ".data-table-footer{background: " + co2 + "; box-shadow: " + tblFbxSh + co2 + "; -webkit-box-shadow: " + tblFbxSh + co2 + "; -moz-box-shadow: " + tblFbxSh + co2 + "}";
|
|
3175
|
+
}
|
|
3176
|
+
rule5 = ".data-cell{ border-bottom: 1px solid " + co2 + " !important; border-right: 1px solid " + co2 + " !important}";
|
|
3177
|
+
}
|
|
3178
|
+
if (this.altRowColor)
|
|
3179
|
+
rule4 = ".data-table-row:not(.data-row-selected):nth-of-type(odd){background:" + this.altRowColor + "}";
|
|
3180
|
+
if (rule1 || rule1a || rule2 || rule3 || rule4 || rule5 || rule6) {
|
|
3181
|
+
const el = document.createElement("style");
|
|
3182
|
+
document.head.appendChild(el);
|
|
3183
|
+
if (rule1)
|
|
3184
|
+
el.sheet?.insertRule(rule1);
|
|
3185
|
+
if (rule1a)
|
|
3186
|
+
el.sheet?.insertRule(rule1a);
|
|
3187
|
+
if (rule2)
|
|
3188
|
+
el.sheet?.insertRule(rule2);
|
|
3189
|
+
if (rule3)
|
|
3190
|
+
el.sheet?.insertRule(rule3);
|
|
3191
|
+
if (rule4)
|
|
3192
|
+
el.sheet?.insertRule(rule4);
|
|
3193
|
+
if (rule5)
|
|
3194
|
+
el.sheet?.insertRule(rule5);
|
|
3195
|
+
if (rule6)
|
|
3196
|
+
el.sheet?.insertRule(rule6);
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
catch (e) { }
|
|
3200
|
+
}
|
|
3201
|
+
renderCurrData(reset, field) {
|
|
3202
|
+
const thead = this.dataTableHeaders.nativeElement;
|
|
3203
|
+
const tbody = this.dataTableBody.nativeElement;
|
|
3204
|
+
const tbodyX = tbody.scrollLeft;
|
|
3205
|
+
this.rows = [];
|
|
3206
|
+
this.aboveHgt.set(0);
|
|
3207
|
+
this.belowHgt.set(0);
|
|
3208
|
+
this.rowNos = [];
|
|
3209
|
+
this.dtChecks = [];
|
|
3210
|
+
this.clearValidatedEdit(null, true);
|
|
3211
|
+
this.dataTableService.currMapping = {};
|
|
3212
|
+
this.horizRest = 0;
|
|
3213
|
+
tbody.scrollTop = 0;
|
|
3214
|
+
this.verticalRest = 0;
|
|
3215
|
+
let didXScrl = false;
|
|
3216
|
+
if (reset && !field && thead && tbody) {
|
|
3217
|
+
thead.style.marginLeft = "0px";
|
|
3218
|
+
tbody.scrollLeft = 0;
|
|
3219
|
+
this.horizRest = 0;
|
|
3220
|
+
}
|
|
3221
|
+
this.lastElRowIndex = 0;
|
|
3222
|
+
let n = 0;
|
|
3223
|
+
const defNum = parseInt(this.dataTableService.defltRHgt.replace(/[ ]?px/g, ""));
|
|
3224
|
+
const init = Math.max(this.dataTableService.dTblHeight / defNum);
|
|
3225
|
+
const len = this.dataTableService.currFilData.length;
|
|
3226
|
+
if (!len) { //always just add 1
|
|
3227
|
+
this.allFilSortInfo = this.dataTableService.getAllFilSrtInfo();
|
|
3228
|
+
return setTimeout(() => { this.styleEmptyFilDataRow(tbody, tbodyX); });
|
|
3229
|
+
}
|
|
3230
|
+
const uCols = [...this.columnHeaders];
|
|
3231
|
+
const colLen = uCols.length;
|
|
3232
|
+
const addCell = (text, prop, row, indx, visible) => {
|
|
3233
|
+
if (prop && row) {
|
|
3234
|
+
const notNum = (this.dataTableService.figureFilterType(prop) != "number" || /(year|yr|fy)/g.test(prop.toLocaleLowerCase())) ? true : false;
|
|
3235
|
+
const useTxt = this.dataTableService.figureCellText(text, notNum, this.dataTableService.dataFilSrtTracker[prop]["colCellSymbol"]);
|
|
3236
|
+
row.cells?.push({
|
|
3237
|
+
column: prop,
|
|
3238
|
+
rawText: text,
|
|
3239
|
+
visible: visible,
|
|
3240
|
+
editable: useTxt.prop === "textContent" ? this.editable : false,
|
|
3241
|
+
dataType: this.dataTableService.figureFilterType(prop),
|
|
3242
|
+
freeze: this.dataTableService.dataFilSrtTracker[prop].freeze,
|
|
3243
|
+
minimized: this.dataTableService.dataFilSrtTracker[prop].minimize,
|
|
3244
|
+
width: this.dataTableService.dataFilSrtTracker[prop].colWidth || this.dataTableService.useColWid,
|
|
3245
|
+
text: useTxt.prop === "textContent" ? useTxt.value : "",
|
|
3246
|
+
html: useTxt.prop !== "textContent" ? useTxt.value : "",
|
|
3247
|
+
});
|
|
3248
|
+
}
|
|
3249
|
+
if (row && prop && row.cells && row.cells.length === 1)
|
|
3250
|
+
this.dtChecks.push(indx);
|
|
3251
|
+
if (field && field === prop && !didXScrl) {
|
|
3252
|
+
setTimeout(() => {
|
|
3253
|
+
tbody.scrollLeft = tbodyX;
|
|
3254
|
+
if (thead)
|
|
3255
|
+
thead.style.marginLeft = (-tbodyX + "px");
|
|
3256
|
+
this.horizRest = tbodyX;
|
|
3257
|
+
}, 100);
|
|
3258
|
+
didXScrl = true;
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
this.useRowWid = this.getAllColWidth(colLen) + "px";
|
|
3262
|
+
const limit = Math.min(init, len);
|
|
3263
|
+
this.maxCols = this.setMaxCols();
|
|
3264
|
+
let horizLim = Math.min(this.maxCols, colLen);
|
|
3265
|
+
if (field && field !== "topLevelDataFilter") {
|
|
3266
|
+
let room = 0;
|
|
3267
|
+
let offst = 3;
|
|
3268
|
+
const fhead = document.getElementById("columnHeader" + this.common.elifyCol(field));
|
|
3269
|
+
if (fhead) {
|
|
3270
|
+
const bds = fhead.getBoundingClientRect();
|
|
3271
|
+
room = this.dataTableService.tblRight - bds.right;
|
|
3272
|
+
if (room > 0)
|
|
3273
|
+
offst = Math.ceil(room / bds.width);
|
|
3274
|
+
}
|
|
3275
|
+
horizLim = Math.max(horizLim, (uCols.map(c => c.column).indexOf(field) + offst));
|
|
3276
|
+
}
|
|
3277
|
+
for (n; n < limit; n++) {
|
|
3278
|
+
const item = this.dataTableService.currFilData[n];
|
|
3279
|
+
const index = !reset ? this.dataTableService.findObjIndxInData(item) : n;
|
|
3280
|
+
if (index > -1) {
|
|
3281
|
+
const row = { id: "dataTableRow" + index, index: index, width: this.useRowWid, cells: [], height: this.dataTableService.defltRHgt };
|
|
3282
|
+
this.rows.push(row);
|
|
3283
|
+
let k = 0;
|
|
3284
|
+
for (k; k < colLen; k++) {
|
|
3285
|
+
const col = uCols[k]?.column;
|
|
3286
|
+
if (col)
|
|
3287
|
+
addCell(item[col], col, row, index, (k <= horizLim));
|
|
3288
|
+
}
|
|
3289
|
+
this.dataTableService.currMapping[n] = index;
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
this.setLastRowIndex();
|
|
3293
|
+
this.allFilSortInfo = this.dataTableService.getAllFilSrtInfo();
|
|
3294
|
+
this.dataTableService.mapperWorkerId += 1; //a reset but needs to incr so prev don't affect mapping
|
|
3295
|
+
if (len) {
|
|
3296
|
+
if (len > init) {
|
|
3297
|
+
let total = 0;
|
|
3298
|
+
let z = this.lastElRowIndex + 1;
|
|
3299
|
+
for (z; z < len; z++) {
|
|
3300
|
+
total += 1;
|
|
3301
|
+
if (reset)
|
|
3302
|
+
this.dataTableService.currMapping[z] = z;
|
|
3303
|
+
}
|
|
3304
|
+
this.belowHgt.set(total * defNum);
|
|
3305
|
+
if (!reset) {
|
|
3306
|
+
if (typeof Worker !== 'undefined') {
|
|
3307
|
+
// Create a new
|
|
3308
|
+
let worker;
|
|
3309
|
+
worker = new Worker(new URL('../worker.worker.ts', import.meta.url));
|
|
3310
|
+
worker.onmessage = ({ data }) => {
|
|
3311
|
+
if (this.dataTableService.mapperWorkerId === data.id)
|
|
3312
|
+
this.dataTableService.currMapping = { ...data.map };
|
|
3313
|
+
};
|
|
3314
|
+
if (worker)
|
|
3315
|
+
worker.postMessage({ id: this.dataTableService.mapperWorkerId, pk: this.dataTableService.primaryKey, main: this.dataTableService.mainData, curr: this.dataTableService.currFilData });
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
this.dataTableService.setIdealColumnWidth.next(true);
|
|
3320
|
+
setTimeout(() => { this.setRowSelChecksPlacement(); this.setHoldingCheckCls(); });
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
styleEmptyFilDataRow(tbody, tbodyX) {
|
|
3324
|
+
const row = document.getElementsByClassName("data-table-row-no-data")[0];
|
|
3325
|
+
if (row) {
|
|
3326
|
+
row.style.width = this.dataTableHeaders.nativeElement.scrollWidth + "px";
|
|
3327
|
+
setTimeout(() => tbody.scrollLeft = tbodyX, 100);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
freezeColCells(col) {
|
|
3331
|
+
this.rows = this.rows.map(r => {
|
|
3332
|
+
r.cells = r.cells?.map(c => {
|
|
3333
|
+
if (c && c.column === col)
|
|
3334
|
+
c.freeze = !c.freeze;
|
|
3335
|
+
return c;
|
|
3336
|
+
});
|
|
3337
|
+
return r;
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
setTableWidthOnChange() {
|
|
3341
|
+
const cols = this.getAllColsAtRuntime(null);
|
|
3342
|
+
this.maxCols = this.setMaxCols();
|
|
3343
|
+
const colLen = cols.length;
|
|
3344
|
+
setTimeout(() => {
|
|
3345
|
+
this.setDataRowWidthsOnMinimize(this.getAllColWidth(colLen));
|
|
3346
|
+
}, 375);
|
|
3347
|
+
this.setHoldingCheckCls();
|
|
3348
|
+
this.setColsOnVisScreen();
|
|
3349
|
+
setTimeout(() => { this.setColHeaderHgt(); });
|
|
3350
|
+
}
|
|
3351
|
+
setHoldingCheckCls() {
|
|
3352
|
+
this.dataTableService.firstCol = this.columnHeaders.filter(c => !c.minimized)[0].column;
|
|
3353
|
+
}
|
|
3354
|
+
setDataRowWidthsOnMinimize(width) {
|
|
3355
|
+
let i = 0;
|
|
3356
|
+
const wid = width + "px";
|
|
3357
|
+
const rLen = this.rows.length;
|
|
3358
|
+
for (i; i < rLen; i++)
|
|
3359
|
+
this.rows[i].width = wid;
|
|
3360
|
+
this.useRowWid = wid;
|
|
3361
|
+
}
|
|
3362
|
+
clearFilInputs() {
|
|
3363
|
+
let i = 0;
|
|
3364
|
+
const els = document.querySelectorAll(".col-header input");
|
|
3365
|
+
const len = els.length;
|
|
3366
|
+
for (i; i < len; i++) {
|
|
3367
|
+
const el = els[i];
|
|
3368
|
+
if (el)
|
|
3369
|
+
el.value = "";
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
resetCurrentData(col) {
|
|
3373
|
+
this.topLevelFilter = "";
|
|
3374
|
+
this.dataTableService.sortOrder = [];
|
|
3375
|
+
this.clearSelectedRows();
|
|
3376
|
+
this.removeAllFreezeCols();
|
|
3377
|
+
this.clearFilInputs();
|
|
3378
|
+
this.resetVisCols();
|
|
3379
|
+
this.allFilSortInfo = "";
|
|
3380
|
+
this.columnOfInterest = "";
|
|
3381
|
+
this.dataTableService.setTblBounds();
|
|
3382
|
+
this.dataTableService.resetFilSrtTracker();
|
|
3383
|
+
this.dataTableService.currFilData = this.dataTableService.mainData.filter(d => { return true; });
|
|
3384
|
+
this.renderCurrData(true, col);
|
|
3385
|
+
}
|
|
3386
|
+
resetVisCols() {
|
|
3387
|
+
let i = 0;
|
|
3388
|
+
this.dataTableService.visibleCols = [];
|
|
3389
|
+
const len = this.columnHeaders.length;
|
|
3390
|
+
for (i; i < len; i++) {
|
|
3391
|
+
if (i < this.maxCols)
|
|
3392
|
+
this.dataTableService.visibleCols.push(this.columnHeaders[i].column);
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgxDeebodataCommunity, deps: [{ token: DataTableService }, { token: TableDragService }, { token: CommonService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3396
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: NgxDeebodataCommunity, isStandalone: true, selector: "ngx-deebodata-community", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, color1: { classPropertyName: "color1", publicName: "color1", isSignal: false, isRequired: false, transformFunction: null }, color2: { classPropertyName: "color2", publicName: "color2", isSignal: false, isRequired: false, transformFunction: null }, primaryKey: { classPropertyName: "primaryKey", publicName: "primaryKey", isSignal: false, isRequired: false, transformFunction: null }, defRowHgt: { classPropertyName: "defRowHgt", publicName: "defRowHgt", isSignal: false, isRequired: false, transformFunction: null }, defGridHgt: { classPropertyName: "defGridHgt", publicName: "defGridHgt", isSignal: false, isRequired: false, transformFunction: null }, altRowColor: { classPropertyName: "altRowColor", publicName: "altRowColor", isSignal: false, isRequired: false, transformFunction: null }, myColumnSymbols: { classPropertyName: "myColumnSymbols", publicName: "myColumnSymbols", isSignal: false, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: false, isRequired: false, transformFunction: null }, rowNumbers: { classPropertyName: "rowNumbers", publicName: "rowNumbers", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { cellEdit: "cellEdit" }, host: { listeners: { "window:click": "onWindowClick($event)", "window:mouseup": "onWindowMouseUp($event)", "window:mousemove": "onWindowMouseMove($event)", "window:selectstart": "onWindowSelectStart($event)", "window:resize": "onWindowResize($event)", "window:scroll": "onWindowScroll($event)" } }, viewQueries: [{ propertyName: "dataTable", first: true, predicate: ["dataTable"], descendants: true, static: true }, { propertyName: "dataTableBody", first: true, predicate: ["dataTableBody"], descendants: true, static: true }, { propertyName: "aboveArea", first: true, predicate: ["aboveArea"], descendants: true, static: true }, { propertyName: "belowArea", first: true, predicate: ["belowArea"], descendants: true, static: true }, { propertyName: "validatedEdit", first: true, predicate: ["validatedEdit"], descendants: true, static: true }, { propertyName: "rowNumHeader", first: true, predicate: ["rowNumHeader"], descendants: true, static: true }, { propertyName: "rowNumBody", first: true, predicate: ["rowNumBody"], descendants: true, static: true }, { propertyName: "fCellDragger", first: true, predicate: ["fCellDragger"], descendants: true, static: true }, { propertyName: "selFilContainer", first: true, predicate: ["selFilContainer"], descendants: true, static: true }, { propertyName: "btnTogSelRows", first: true, predicate: ["btnTogSelRows"], descendants: true, static: true }, { propertyName: "dataTableHeaders", first: true, predicate: ["dataTableHeaders"], descendants: true, static: true }, { propertyName: "topLevelDataFilter", first: true, predicate: ["topLevelDataFilter"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"deebo-data-grid-section\">\r\n <div class=\"controls\">\r\n <input type=\"text\" #topLevelDataFilter autocomplete=\"off\" name=\"topLevelDataFilter\" placeholder=\"Filter any column...\" \r\n (input)=\"topFilterOnKeyUp($event)\" (keyup)=\"topFilterOnKeyUp($event)\" maxlength=\"255\" [(ngModel)]=\"topLevelFilter\" \r\n [disabled]=\"!dataTableService.mainData.length || handlingSelRows\" autocomplete=\"off\" />\r\n <button type=\"button\" [disabled]=\"!dataTableService.currSelRows.length || handlingSelRows\" (click)=\"clearSelectedRows()\" class=\"btn-ctrl-sel-rows\">Deselect Rows</button>\r\n <button #btnTogSelRows type=\"button\" [disabled]=\"!dataTableService.currSelRows.length || handlingSelRows\" (click)=\"toggleSelectedRows()\" class=\"btn-ctrl-sel-rows\">\r\n <i class=\"material-icons\" aria-hidden=\"false\">check_box_outline_blank</i> <span>{{togSelRows}}</span>\r\n </button>\r\n <button [disabled]=\"!topLevelFilter && dataTableService.arefilSrtTrkPropsDefault()\" \r\n class=\"btn-reset\" (click)=\"resetCurrentData()\" >Reset</button>\r\n </div>\r\n <div class=\"relly\" [ngClass]=\"{'dt-checks': rowNumbers, 'hide' : dataTableService.isFiltering || \r\n dataTableService.isSorting }\">\r\n @for (chk of dtChecks; track $index) {\r\n <input [id]=\"'checkDataTableRow' + chk\" class=\"select-row-check invisible\" \r\n [checked]=\"dataTableService.currSelRows.indexOf(chk) > -1\" type=\"checkbox\" [name]=\"'checkDataTableRow' + chk\"\r\n (click)=\"toggleSingleRowSelected(chk)\" (keyup.enter)=\"toggleSingleRowSelected(chk)\" [value]=\"'dataTableRow' + chk\" >\r\n }\r\n </div>\r\n <div #validatedEdit class=\"relly special-edit-container invisible\">\r\n @if (validatedEditType === 'date'){\r\n <input id=\"selEditDate\" name=\"selEditDate\" type=\"date\" class=\"edit-input\" \r\n (change)=\"execCellEdit($event, true)\" (input)=\"execCellEdit($event, true)\" (blur)=\"execCellEdit($event)\" />\r\n }\r\n @if (validatedEditType === 'number'){\r\n <input id=\"selEditNum\" name=\"selEditNum\" type=\"number\" class=\"edit-input\" \r\n (keyup)=\"execCellEdit($event, true)\" (input)=\"execCellEdit($event, true)\" (blur)=\"execCellEdit($event)\" (keyup.enter)=\"execCellEdit($event)\" />\r\n }\r\n </div>\r\n <div class=\"relly\" style=\"z-index: 6;\">\r\n <div #fCellDragger tabindex=\"0\" id=\"fCellDragger\" (focus)=\"focusCellDragger()\" (blur)=\"execValClear(true)\"\r\n (mousedown)=\"focusCellDraggerFromMouseDown()\" (keydown)=\"handleFDragTab($event)\" (keydown)=\"handleDraggerKD($event)\"\r\n [ngClass]=\"{'hide': dataTableService.currEditIndex < 0, 'focused-cell-dragger': dataTableService.currEditIndex > -1 }\"></div>\r\n </div>\r\n <div [ngClass]=\"{'row-numbers': rowNumbers, 'hide': !rowNumbers}\" >\r\n <div #rowNumHeader class=\"row-num-header flex-center\"><div class=\"semi-heavy\">No.</div></div>\r\n <div style=\"overflow: hidden;\" [style.height]=\"dataTableService.dTblHeight + 'px'\">\r\n <div #rowNumBody style=\"overflow: auto\">\r\n @for (num of rowNos; track num.number) {\r\n <div [id]=\"'rn' + num.number\" class=\"flex-center num-row\" [style.height]=\"num.height || dataTableService.defltRHgt\">\r\n <div class=\"small-text\">{{num.number | number}}</div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div><div #dataTable class=\"data-table\" [class.inline-table]=\"rowNumbers\">\r\n <div #dataTableHeaders class=\"data-table-headers\">\r\n @for (col of columnHeaders; track col.column; let i = $index) {\r\n <app-data-table-header\r\n [columnHeader]=\"col\"\r\n [colWid]=\"dataTableService.useColWid\"\r\n [canFreeze]=\"i === 0 ? true : false\"\r\n (reset)=\"resetCurrentData($event)\"\r\n (freeze)=\"freezeColCells($event)\"\r\n (scrollOnFocus)=\"checkTabHorizScroll($event)\"\r\n (height)=\"setHeaderHeight($event, true)\"\r\n (render)=\"renderCurrData(false, $event.field)\"\r\n (width)=\"handleSingleColResize($event.value, $event.column)\"\r\n ></app-data-table-header>\r\n }\r\n </div>\r\n <div #dataTableBody id=\"dataTableBody\" style=\"overflow: auto;\" [style.height]=\"dataTableService.dTblHeight + 'px'\" (scroll)=\"handleScroll($event)\"\r\n [class.table-working]=\"dataTableService.isFiltering || dataTableService.isSorting\" (scrollend)=\"handleScrollEnd()\">\r\n <div #aboveArea [style.height]=\"aboveHgt() + 'px'\"></div>\r\n @for(row of rows; track row.index){\r\n <div [id]=\"row.id\" class=\"data-table-row\" [attr.data-index]=\"row.index\"\r\n [class.data-row-selected]=\"!dataTableService.displayOnlySelRows && dataTableService.currSelRows.indexOf(row.index) > -1\"\r\n [ngStyle]=\"{'width': row.width, 'height': row.height}\" >\r\n @for(cell of row.cells; track cell.column){\r\n @if (isScrolling){\r\n <div class=\"data-cell data-cell-{{common.elifyCol(cell.column)}}\" [class.data-cell-riiight]=\"cell.dataType === 'number'\"\r\n [ngClass]=\"{ 'col-item-freeze': cell.freeze, 'holding-check': cell.column === dataTableService.firstCol }\"\r\n [ngStyle]=\"{'width': cell.width || dataTableService.useColWid, 'height': row.height}\" >{{cell.text}}@if (cell.html){<div class=\"mock-html\"></div>}</div>\r\n } @else {\r\n <app-data-cell [cell]=\"cell\" \r\n [rowId]=\"row.id\" \r\n [rawText]=\"cell.rawText\"\r\n [rowHeight]=\"row.height || ''\"\r\n (edit)=\"execCellEdit($event)\"\r\n (dragListen)=\"listenToCellDraggerMouseMove = $event\"\r\n [colWid]=\"cell.width || dataTableService.useColWid\"\r\n (width)=\"handleSingleColResize($event)\"\r\n (height)=\"setSingleRowHgt($event, row.id, true)\"\r\n (clearVEditFocus)=\"validatedEditType = $event\"\r\n (validateEditFocus)=\"handleValidatedCellEditFocus($event)\"\r\n ></app-data-cell>\r\n }\r\n }\r\n </div>\r\n }\r\n <div #belowArea [style.height]=\"belowHgt() + 'px'\"></div>\r\n @if(!dataTableService.currFilData.length){\r\n <div [style.height]=\"dataTableService.dTblHeight + 'px'\" class=\"data-table-row flex-center data-table-row-no-data\" style=\"width: 100%; white-space: normal;\">\r\n <div class=\"center\">{{dataTableService.noDataMsg}}</div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if(paginatorReady){\r\n <app-data-table-paginator\r\n [filSortStr]=\"allFilSortInfo\"\r\n [totalRows]=\"dataTableService.currFilData.length\"\r\n ></app-data-table-paginator><!--not an actual paginator-->\r\n }\r\n</div>", styles: [":host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }input[name=topLevelDataFilter]{float:left;padding:7px 5px;vertical-align:middle;box-shadow:0 0 1px 1px var(--grid-color);-moz-box-shadow:0 0 1px 1px var(--grid-color);-webkit-box-shadow:0 0 1px 1px var(--grid-color)}.deebo-dd-contain-div{margin:0 31px}.dt-checks{margin-left:var(--row-num-width)}.row-numbers{margin-top:11px;display:inline-block;width:var(--row-num-width)}.row-num-header{background:#e9e9e9;box-sizing:border-box;border-bottom:1px solid var(--accent-color);border-right:1px solid var(--accent-color);box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.num-row{white-space:nowrap;box-sizing:border-box;border-left:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}.inline-table{display:inline-block;width:calc(100% - var(--row-num-width))}.special-edit-container{z-index:5}.edit-input{border:none;font-size:15px;box-shadow:none;position:absolute;background:#fff;-moz-box-shadow:none;-webkit-box-shadow:none;box-sizing:border-box}.edit-input[type=number]{text-align:right}.edit-input[type=date]{padding-left:17px}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"], dependencies: [{ kind: "component", type: DataTableHeader, selector: "app-data-table-header", inputs: ["colWid", "canFreeze", "columnHeader"], outputs: ["sort", "render", "width", "height", "reset", "freeze", "scrollOnFocus"] }, { kind: "component", type: DataCellComponent, selector: "app-data-cell", inputs: ["rawText", "cell", "rowId", "colWid", "rowHeight", "noColResize"], outputs: ["width", "height", "edit", "dragListen", "validateEditFocus", "clearVEditFocus"] }, { kind: "component", type: DataTablePaginator, selector: "app-data-table-paginator", inputs: ["totalRows", "filSortStr"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }] });
|
|
3397
|
+
}
|
|
3398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: NgxDeebodataCommunity, decorators: [{
|
|
3399
|
+
type: Component,
|
|
3400
|
+
args: [{ selector: 'ngx-deebodata-community', imports: [
|
|
3401
|
+
DataTableHeader,
|
|
3402
|
+
DataCellComponent,
|
|
3403
|
+
DataTablePaginator,
|
|
3404
|
+
CommonModule,
|
|
3405
|
+
FormsModule,
|
|
3406
|
+
DecimalPipe,
|
|
3407
|
+
], template: "<div class=\"deebo-data-grid-section\">\r\n <div class=\"controls\">\r\n <input type=\"text\" #topLevelDataFilter autocomplete=\"off\" name=\"topLevelDataFilter\" placeholder=\"Filter any column...\" \r\n (input)=\"topFilterOnKeyUp($event)\" (keyup)=\"topFilterOnKeyUp($event)\" maxlength=\"255\" [(ngModel)]=\"topLevelFilter\" \r\n [disabled]=\"!dataTableService.mainData.length || handlingSelRows\" autocomplete=\"off\" />\r\n <button type=\"button\" [disabled]=\"!dataTableService.currSelRows.length || handlingSelRows\" (click)=\"clearSelectedRows()\" class=\"btn-ctrl-sel-rows\">Deselect Rows</button>\r\n <button #btnTogSelRows type=\"button\" [disabled]=\"!dataTableService.currSelRows.length || handlingSelRows\" (click)=\"toggleSelectedRows()\" class=\"btn-ctrl-sel-rows\">\r\n <i class=\"material-icons\" aria-hidden=\"false\">check_box_outline_blank</i> <span>{{togSelRows}}</span>\r\n </button>\r\n <button [disabled]=\"!topLevelFilter && dataTableService.arefilSrtTrkPropsDefault()\" \r\n class=\"btn-reset\" (click)=\"resetCurrentData()\" >Reset</button>\r\n </div>\r\n <div class=\"relly\" [ngClass]=\"{'dt-checks': rowNumbers, 'hide' : dataTableService.isFiltering || \r\n dataTableService.isSorting }\">\r\n @for (chk of dtChecks; track $index) {\r\n <input [id]=\"'checkDataTableRow' + chk\" class=\"select-row-check invisible\" \r\n [checked]=\"dataTableService.currSelRows.indexOf(chk) > -1\" type=\"checkbox\" [name]=\"'checkDataTableRow' + chk\"\r\n (click)=\"toggleSingleRowSelected(chk)\" (keyup.enter)=\"toggleSingleRowSelected(chk)\" [value]=\"'dataTableRow' + chk\" >\r\n }\r\n </div>\r\n <div #validatedEdit class=\"relly special-edit-container invisible\">\r\n @if (validatedEditType === 'date'){\r\n <input id=\"selEditDate\" name=\"selEditDate\" type=\"date\" class=\"edit-input\" \r\n (change)=\"execCellEdit($event, true)\" (input)=\"execCellEdit($event, true)\" (blur)=\"execCellEdit($event)\" />\r\n }\r\n @if (validatedEditType === 'number'){\r\n <input id=\"selEditNum\" name=\"selEditNum\" type=\"number\" class=\"edit-input\" \r\n (keyup)=\"execCellEdit($event, true)\" (input)=\"execCellEdit($event, true)\" (blur)=\"execCellEdit($event)\" (keyup.enter)=\"execCellEdit($event)\" />\r\n }\r\n </div>\r\n <div class=\"relly\" style=\"z-index: 6;\">\r\n <div #fCellDragger tabindex=\"0\" id=\"fCellDragger\" (focus)=\"focusCellDragger()\" (blur)=\"execValClear(true)\"\r\n (mousedown)=\"focusCellDraggerFromMouseDown()\" (keydown)=\"handleFDragTab($event)\" (keydown)=\"handleDraggerKD($event)\"\r\n [ngClass]=\"{'hide': dataTableService.currEditIndex < 0, 'focused-cell-dragger': dataTableService.currEditIndex > -1 }\"></div>\r\n </div>\r\n <div [ngClass]=\"{'row-numbers': rowNumbers, 'hide': !rowNumbers}\" >\r\n <div #rowNumHeader class=\"row-num-header flex-center\"><div class=\"semi-heavy\">No.</div></div>\r\n <div style=\"overflow: hidden;\" [style.height]=\"dataTableService.dTblHeight + 'px'\">\r\n <div #rowNumBody style=\"overflow: auto\">\r\n @for (num of rowNos; track num.number) {\r\n <div [id]=\"'rn' + num.number\" class=\"flex-center num-row\" [style.height]=\"num.height || dataTableService.defltRHgt\">\r\n <div class=\"small-text\">{{num.number | number}}</div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div><div #dataTable class=\"data-table\" [class.inline-table]=\"rowNumbers\">\r\n <div #dataTableHeaders class=\"data-table-headers\">\r\n @for (col of columnHeaders; track col.column; let i = $index) {\r\n <app-data-table-header\r\n [columnHeader]=\"col\"\r\n [colWid]=\"dataTableService.useColWid\"\r\n [canFreeze]=\"i === 0 ? true : false\"\r\n (reset)=\"resetCurrentData($event)\"\r\n (freeze)=\"freezeColCells($event)\"\r\n (scrollOnFocus)=\"checkTabHorizScroll($event)\"\r\n (height)=\"setHeaderHeight($event, true)\"\r\n (render)=\"renderCurrData(false, $event.field)\"\r\n (width)=\"handleSingleColResize($event.value, $event.column)\"\r\n ></app-data-table-header>\r\n }\r\n </div>\r\n <div #dataTableBody id=\"dataTableBody\" style=\"overflow: auto;\" [style.height]=\"dataTableService.dTblHeight + 'px'\" (scroll)=\"handleScroll($event)\"\r\n [class.table-working]=\"dataTableService.isFiltering || dataTableService.isSorting\" (scrollend)=\"handleScrollEnd()\">\r\n <div #aboveArea [style.height]=\"aboveHgt() + 'px'\"></div>\r\n @for(row of rows; track row.index){\r\n <div [id]=\"row.id\" class=\"data-table-row\" [attr.data-index]=\"row.index\"\r\n [class.data-row-selected]=\"!dataTableService.displayOnlySelRows && dataTableService.currSelRows.indexOf(row.index) > -1\"\r\n [ngStyle]=\"{'width': row.width, 'height': row.height}\" >\r\n @for(cell of row.cells; track cell.column){\r\n @if (isScrolling){\r\n <div class=\"data-cell data-cell-{{common.elifyCol(cell.column)}}\" [class.data-cell-riiight]=\"cell.dataType === 'number'\"\r\n [ngClass]=\"{ 'col-item-freeze': cell.freeze, 'holding-check': cell.column === dataTableService.firstCol }\"\r\n [ngStyle]=\"{'width': cell.width || dataTableService.useColWid, 'height': row.height}\" >{{cell.text}}@if (cell.html){<div class=\"mock-html\"></div>}</div>\r\n } @else {\r\n <app-data-cell [cell]=\"cell\" \r\n [rowId]=\"row.id\" \r\n [rawText]=\"cell.rawText\"\r\n [rowHeight]=\"row.height || ''\"\r\n (edit)=\"execCellEdit($event)\"\r\n (dragListen)=\"listenToCellDraggerMouseMove = $event\"\r\n [colWid]=\"cell.width || dataTableService.useColWid\"\r\n (width)=\"handleSingleColResize($event)\"\r\n (height)=\"setSingleRowHgt($event, row.id, true)\"\r\n (clearVEditFocus)=\"validatedEditType = $event\"\r\n (validateEditFocus)=\"handleValidatedCellEditFocus($event)\"\r\n ></app-data-cell>\r\n }\r\n }\r\n </div>\r\n }\r\n <div #belowArea [style.height]=\"belowHgt() + 'px'\"></div>\r\n @if(!dataTableService.currFilData.length){\r\n <div [style.height]=\"dataTableService.dTblHeight + 'px'\" class=\"data-table-row flex-center data-table-row-no-data\" style=\"width: 100%; white-space: normal;\">\r\n <div class=\"center\">{{dataTableService.noDataMsg}}</div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if(paginatorReady){\r\n <app-data-table-paginator\r\n [filSortStr]=\"allFilSortInfo\"\r\n [totalRows]=\"dataTableService.currFilData.length\"\r\n ></app-data-table-paginator><!--not an actual paginator-->\r\n }\r\n</div>", styles: [":host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }input[name=topLevelDataFilter]{float:left;padding:7px 5px;vertical-align:middle;box-shadow:0 0 1px 1px var(--grid-color);-moz-box-shadow:0 0 1px 1px var(--grid-color);-webkit-box-shadow:0 0 1px 1px var(--grid-color)}.deebo-dd-contain-div{margin:0 31px}.dt-checks{margin-left:var(--row-num-width)}.row-numbers{margin-top:11px;display:inline-block;width:var(--row-num-width)}.row-num-header{background:#e9e9e9;box-sizing:border-box;border-bottom:1px solid var(--accent-color);border-right:1px solid var(--accent-color);box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.num-row{white-space:nowrap;box-sizing:border-box;border-left:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}.inline-table{display:inline-block;width:calc(100% - var(--row-num-width))}.special-edit-container{z-index:5}.edit-input{border:none;font-size:15px;box-shadow:none;position:absolute;background:#fff;-moz-box-shadow:none;-webkit-box-shadow:none;box-sizing:border-box}.edit-input[type=number]{text-align:right}.edit-input[type=date]{padding-left:17px}\n", "@charset \"UTF-8\";@font-face{font-family:Roboto Condensed;src:url(https://d2ffvluimla00s.cloudfront.net/RobotoCondensed-VariableFont_wght.ttf) format(\"ttf\")}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(https://d2ffvluimla00s.cloudfront.net/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}.deebo-data-grid-section{font-family:Roboto Condensed,Arial,Helvetica,sans-serif}:host{--accent-color:rgb(50, 50, 50);--grid-color:rgb(199, 199, 199);--pad-left-base: 33px;--row-num-width: 75px;--reg-font-size: 17px }.relly{position:relative}.hide{display:none!important;max-height:0;max-width:0;top:0;left:0;opacity:0}.ovy{overflow:auto}.no-ovy-y{overflow-y:hidden!important}.pad-top-sm{padding-top:4px!important}.pad-top-ten{padding-top:10px!important}.pad-top-teen{padding-top:17px}.pad-top-thirty,.pad-top-trey{padding-top:33px}.pad-top-much{padding-top:75px}.o-visible{overflow:visible}.dontwrap{white-space:nowrap}.inline-b{display:inline-block}.inline{display:inline}.half-wid{width:50%;vertical-align:top;display:inline-block}.qtr-wid{width:25%;vertical-align:top;display:inline-block}.third-wid{width:33.3%;vertical-align:top;display:inline-block}.two-third-wid{width:66.6%;vertical-align:top;display:inline-block}.three-qtr-wid{width:75%;vertical-align:top;display:inline-block}.v-top{vertical-align:top!important}.v-mid{vertical-align:middle!important}.v-bot{vertical-align:bottom!important}.lg-text{font-size:larger}.xlg-text{font-size:x-large!important}.md-text{font-size:var(--reg-font-size)!important}.small-text{font-size:small}.tiny-text{font-size:x-small}.invisible{visibility:hidden}.flex-center{display:flex;justify-content:center;align-items:center}.flex-item{flex:1 1 auto}.o-x-hidden{overflow-x:hidden!important}.no-weight{font-weight:400!important}.semi-heavy{font-weight:500!important}.heavy{font-weight:700!important}.marauto{margin:0 auto}.center{text-align:center}.left{text-align:left}.right{text-align:right}.btn-reset{border:none;color:#fff;padding:7px 11px;background:maroon}.error-message{color:maroon;font-weight:500}.success{color:green;font-weight:500}.neutral{color:var(--accent-color)}input,select{border:none;padding:4px;border-radius:3px;box-sizing:border-box;font-family:Roboto Condensed,Arial,Helvetica,sans-serif;box-shadow:0 0 1px 1px #afafaf;-moz-box-shadow:0 0 1px 1px #afafaf;-webkit-box-shadow:0 0 1px 1px #afafaf}input[type=radio],input[type=checkbox]{cursor:pointer;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}button{cursor:pointer}button:focus,input:focus,select:focus,textarea:focus,a:focus{outline-width:0}button:disabled,input:disabled,select:disabled{opacity:.5;cursor:not-allowed}.prevent{opacity:.5;cursor:not-allowed;pointer-events:none}.controls{text-align:right;padding:16px 11px 6px 1px;max-width:100%;clear:both;overflow-x:auto;white-space:nowrap}.controls button{font-size:var(--reg-font-size);margin-right:31px;vertical-align:middle}.controls button span{vertical-align:middle}.controls button:last-of-type{margin-right:0}.data-table{margin-top:11px;overflow:hidden;box-shadow:0 -1px 3px 1px var(--grid-color);-moz-box-shadow:0 -1px 3px 1px var(--grid-color);-webkit-box-shadow:0 -1px 3px 1px var(--grid-color)}.sel-rows-checked{color:#00a8f399!important}.save-hilite{padding:2px 4px;border-radius:3px;background:#ebebeb;box-shadow:0 0 3px 1px var(--accent-color);-moz-box-shadow:0 0px 3px 1px var(--accent-color);-webkit-box-shadow:0 0px 3px 1px var(--accent-color)}.btn-ctrl-sel-rows{border:none;padding:3px 4px;border-radius:3px;background:#f5f5f5;vertical-align:middle;box-shadow:0 0 2px 1px var(--accent-color);-moz-box-shadow:0 0 2px 1px var(--accent-color);-webkit-box-shadow:0 0 2px 1px var(--accent-color)}.deebo-dd-contain-div:last-of-type{margin-right:0!important}.btn-ctrl-sel-rows:hover{background:#ebebeb;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-center-selected{padding:2px 4px;border-radius:5px;background:#f5f5f5;box-shadow:0 0 6px 2px gray;-moz-box-shadow:0 0 6px 2px gray;-webkit-box-shadow:0 0 6px 2px gray}.btn-ctrl-sel-rows .material-icons{font-size:18px;font-weight:600;vertical-align:middle}.btn-ctrl-sel-rows .material-icons:not(.error-message){color:var(--accent-color)}.data-table-headers{cursor:pointer;white-space:nowrap;border-bottom:1px solid var(--grid-color)}.data-table-row{white-space:nowrap}.data-table-row:hover,.data-table-row .col-item-freeze:hover{background:#f3f3f3}.data-row-selected{background:#d6d6d6!important}.table-working{opacity:.1;pointer-events:none}.select-row-check{left:9px;z-index:10;cursor:pointer;margin:0;position:absolute;padding:0!important}.gb-row-num{left:2px;z-index:10;cursor:pointer;margin:0;font-size:x-small;position:absolute;padding:0!important}.mock-html{width:50%;height:18px;margin:0 auto;border-radius:11px;background:var(--grid-color)}.abs-right{top:7px;right:7px;position:absolute}.has-symbol:after{content:attr(data-symbol);padding-left:3px}.has-symbol-b:before{content:attr(data-symbol);padding-right:3px}.data-table-row-no-data{font-size:xx-large;color:gray;font-weight:500;text-shadow:-1px -1px var(--accent-color)}.data-row-selected .col-item-freeze,.data-row-selected .data-cell,.data-row-selected:hover,.data-row-selected .col-item-freeze:hover,.data-row-selected .data-cell:hover{background:#d6d6d6!important}.data-table-headers .col-item-freeze:first-of-type{border-bottom:1px solid var(--grid-color)}.col-header{z-index:2;width:125px;overflow:auto;cursor:grab;padding:7px 3px;text-align:center;position:relative;box-sizing:border-box;display:inline-block;vertical-align:top;white-space:pre-wrap;word-wrap:break-word;background:#fafafa;border-right:1px solid var(--grid-color)}.col-header button,.col-header span,.col-header select{cursor:pointer;vertical-align:middle}.col-header input{vertical-align:middle}.col-header-img-container{overflow-y:hidden;text-align:center;display:inline-block;vertical-align:middle;background-size:cover;background-position:center;background-repeat:no-repeat}.btn-maximize-col{border:none;border-radius:5px;background:#f5f5f5;box-shadow:0 0 3px 2px gray;font-size:var(--reg-font-size);margin-right:27px;padding:4px}.no-btn{border:none;background:none}.col-item-freeze{left:0;z-index:3;position:sticky;background:#fff;box-shadow:2px 0 3px 0 var(--grid-color);-moz-box-shadow:2px 0px 3px 0px var(--grid-color);-webkit-box-shadow:2px 0px 3px 0px var(--grid-color)}.col-header input,.select-filter{width:40%;margin:11px 0 1px}.sel-fil-container{z-index:5}.edit-input-option-cont{left:0;right:0}.edit-input-opt{font-size:15px;padding:11px 0 11px 17px}.selfil-opt-contain,.edit-input-option-cont{overflow:auto;max-height:240px;border-radius:5px;position:absolute;background:#fff;box-shadow:0 1px 3px 1px var(--grid-color);-moz-box-shadow:0 1px 3px 1px var(--grid-color);-webkit-box-shadow:0 1px 3px 1px var(--grid-color)}.selfil-div,.edit-input-opt{cursor:pointer;text-align:left;border-bottom:1px solid var(--grid-color)}.selfil-div:hover,.edit-input-opt:hover{background:#ebebeb}.selfil-div:last-of-type,.edit-input-opt:last-of-type{border-bottom:none}.selfil-div label{width:calc(100% - 22px);font-size:15px;cursor:pointer;padding:11px;display:inline-block}.selfil-div label input[type=checkbox]{margin-right:11px;vertical-align:middle}.select-filter-comparator{width:36px;z-index:3;opacity:0;position:relative;margin:11px 0 1px 15px}.btn-fil-comp{top:2px;left:-36px;border:none;position:absolute;background:#fafafa}.btn-fil-comp i{color:var(--accent-color)}@media screen and (min-width:960px){.col-header input,.select-filter,.select-filter-comparator{margin-top:7px;margin-bottom:1px}}.data-cell{width:125px;padding:11px 6px 11px 17px;overflow:auto;font-size:15px;word-wrap:break-word;white-space:pre-line;vertical-align:top;box-sizing:border-box;display:inline-flex;align-items:center;border-right:1px solid var(--grid-color);border-bottom:1px solid var(--grid-color)}input.edit-input{border-radius:0}.data-cell:focus,input.edit-input:focus{outline:1px solid #00a8f3}.dragger-cell-focused{background:#00a8f333;border-left:1px solid #00a8f3;border-right:1px solid #00a8f3!important}.focused-cell-dragger{width:9px;height:9px;cursor:crosshair;position:absolute;background:#00a8f3;box-shadow:0 0 1px 1px var(--accent-color);-moz-box-shadow:0 0 1px 1px var(--accent-color);-webkit-box-shadow:0 0 1px 1px var(--accent-color)}.holding-check{padding-left:44px}.data-cell-riiight{padding:11px 17px 11px 6px;justify-content:right}.data-cell-ceeenter{padding:11px 6px;justify-content:center!important}.data-cell img{max-width:100px;height:auto;margin:0;vertical-align:middle}.cell-og-link{line-height:0;visibility:hidden}.cell-og-link:before{visibility:visible;content:attr(data-title)}.moveable-col{cursor:col-resize!important}.moveable-row{cursor:row-resize!important}.data-sort-arr{cursor:pointer;margin-left:11px;border:none;background:none;padding:0 0 0 2px;color:var(--accent-color)}.data-sort-arr .material-icons{font-size:20px}.data-col-info{left:10px;top:12px;padding:0;border:none;cursor:pointer;background:none;position:absolute;color:var(--accent-color)}.data-col-info .material-icons{font-size:16px}.sort-order-indicator{font-weight:600;vertical-align:middle;font-size:16px}.btn-freeze-col{float:left;border:none;cursor:pointer;background:none}.btn-freeze-col .material-icons{font-size:16px;color:var(--accent-color)}.col-header span{word-wrap:break-word;vertical-align:middle;font-size:var(--reg-font-size)}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;font-feature-settings:\"liga\";-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}\n"] }]
|
|
3408
|
+
}], ctorParameters: () => [{ type: DataTableService }, { type: TableDragService }, { type: CommonService }], propDecorators: { onWindowClick: [{
|
|
3409
|
+
type: HostListener,
|
|
3410
|
+
args: ['window:click', ['$event']]
|
|
3411
|
+
}], onWindowMouseUp: [{
|
|
3412
|
+
type: HostListener,
|
|
3413
|
+
args: ['window:mouseup', ['$event']]
|
|
3414
|
+
}], onWindowMouseMove: [{
|
|
3415
|
+
type: HostListener,
|
|
3416
|
+
args: ['window:mousemove', ['$event']]
|
|
3417
|
+
}], onWindowSelectStart: [{
|
|
3418
|
+
type: HostListener,
|
|
3419
|
+
args: ['window:selectstart', ['$event']]
|
|
3420
|
+
}], onWindowResize: [{
|
|
3421
|
+
type: HostListener,
|
|
3422
|
+
args: ['window:resize', ['$event']]
|
|
3423
|
+
}], onWindowScroll: [{
|
|
3424
|
+
type: HostListener,
|
|
3425
|
+
args: ['window:scroll', ['$event']]
|
|
3426
|
+
}], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], color1: [{
|
|
3427
|
+
type: Input
|
|
3428
|
+
}], color2: [{
|
|
3429
|
+
type: Input
|
|
3430
|
+
}], primaryKey: [{
|
|
3431
|
+
type: Input
|
|
3432
|
+
}], defRowHgt: [{
|
|
3433
|
+
type: Input
|
|
3434
|
+
}], defGridHgt: [{
|
|
3435
|
+
type: Input
|
|
3436
|
+
}], altRowColor: [{
|
|
3437
|
+
type: Input
|
|
3438
|
+
}], myColumnSymbols: [{
|
|
3439
|
+
type: Input
|
|
3440
|
+
}], editable: [{
|
|
3441
|
+
type: Input
|
|
3442
|
+
}], rowNumbers: [{
|
|
3443
|
+
type: Input
|
|
3444
|
+
}], cellEdit: [{
|
|
3445
|
+
type: Output,
|
|
3446
|
+
args: ["cellEdit"]
|
|
3447
|
+
}], dataTable: [{
|
|
3448
|
+
type: ViewChild,
|
|
3449
|
+
args: ["dataTable", { static: true }]
|
|
3450
|
+
}], dataTableBody: [{
|
|
3451
|
+
type: ViewChild,
|
|
3452
|
+
args: ["dataTableBody", { static: true }]
|
|
3453
|
+
}], aboveArea: [{
|
|
3454
|
+
type: ViewChild,
|
|
3455
|
+
args: ["aboveArea", { static: true }]
|
|
3456
|
+
}], belowArea: [{
|
|
3457
|
+
type: ViewChild,
|
|
3458
|
+
args: ["belowArea", { static: true }]
|
|
3459
|
+
}], validatedEdit: [{
|
|
3460
|
+
type: ViewChild,
|
|
3461
|
+
args: ["validatedEdit", { static: true }]
|
|
3462
|
+
}], rowNumHeader: [{
|
|
3463
|
+
type: ViewChild,
|
|
3464
|
+
args: ["rowNumHeader", { static: true }]
|
|
3465
|
+
}], rowNumBody: [{
|
|
3466
|
+
type: ViewChild,
|
|
3467
|
+
args: ["rowNumBody", { static: true }]
|
|
3468
|
+
}], fCellDragger: [{
|
|
3469
|
+
type: ViewChild,
|
|
3470
|
+
args: ["fCellDragger", { static: true }]
|
|
3471
|
+
}], selFilContainer: [{
|
|
3472
|
+
type: ViewChild,
|
|
3473
|
+
args: ["selFilContainer", { static: true }]
|
|
3474
|
+
}], btnTogSelRows: [{
|
|
3475
|
+
type: ViewChild,
|
|
3476
|
+
args: ["btnTogSelRows", { static: true }]
|
|
3477
|
+
}], dataTableHeaders: [{
|
|
3478
|
+
type: ViewChild,
|
|
3479
|
+
args: ["dataTableHeaders", { static: true }]
|
|
3480
|
+
}], topLevelDataFilter: [{
|
|
3481
|
+
type: ViewChild,
|
|
3482
|
+
args: ["topLevelDataFilter", { static: true }]
|
|
3483
|
+
}] } });
|
|
3484
|
+
|
|
3485
|
+
/*
|
|
3486
|
+
* Public API Surface of ngx-deebodata-community
|
|
3487
|
+
*/
|
|
3488
|
+
|
|
3489
|
+
/**
|
|
3490
|
+
* Generated bundle index. Do not edit.
|
|
3491
|
+
*/
|
|
3492
|
+
|
|
3493
|
+
export { NgxDeebodataCommunity };
|
|
3494
|
+
//# sourceMappingURL=ngx-deebodata-community.mjs.map
|