@swimlane/ngx-datatable 21.1.0 → 22.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/assets/app.css +0 -2
- package/fesm2022/swimlane-ngx-datatable.mjs +1173 -1683
- package/fesm2022/swimlane-ngx-datatable.mjs.map +1 -1
- package/index.css +1 -247
- package/index.d.ts +1678 -3
- package/index.scss +1 -319
- package/package.json +4 -4
- package/themes/bootstrap.css +5 -0
- package/themes/bootstrap.scss +7 -0
- package/themes/dark.css +5 -1
- package/themes/dark.scss +6 -1
- package/themes/material.css +5 -17
- package/themes/material.scss +6 -17
- package/lib/components/body/body-cell.component.d.ts +0 -73
- package/lib/components/body/body-group-header-template.directive.d.ts +0 -7
- package/lib/components/body/body-group-header.directive.d.ts +0 -34
- package/lib/components/body/body-row-def.component.d.ts +0 -34
- package/lib/components/body/body-row-wrapper.component.d.ts +0 -44
- package/lib/components/body/body-row.component.d.ts +0 -47
- package/lib/components/body/body.component.d.ts +0 -231
- package/lib/components/body/ghost-loader/ghost-loader.component.d.ts +0 -12
- package/lib/components/body/progress-bar.component.d.ts +0 -5
- package/lib/components/body/scroller.component.d.ts +0 -24
- package/lib/components/body/selection.component.d.ts +0 -28
- package/lib/components/body/summary/summary-row.component.d.ts +0 -24
- package/lib/components/columns/column-cell.directive.d.ts +0 -9
- package/lib/components/columns/column-ghost-cell.directive.d.ts +0 -6
- package/lib/components/columns/column-header.directive.d.ts +0 -7
- package/lib/components/columns/column.directive.d.ts +0 -68
- package/lib/components/columns/tree.directive.d.ts +0 -7
- package/lib/components/datatable.component.d.ts +0 -591
- package/lib/components/footer/footer-template.directive.d.ts +0 -7
- package/lib/components/footer/footer.component.d.ts +0 -23
- package/lib/components/footer/footer.directive.d.ts +0 -18
- package/lib/components/footer/pager.component.d.ts +0 -30
- package/lib/components/header/header-cell.component.d.ts +0 -52
- package/lib/components/header/header.component.d.ts +0 -75
- package/lib/components/row-detail/row-detail-template.directive.d.ts +0 -7
- package/lib/components/row-detail/row-detail.directive.d.ts +0 -31
- package/lib/directives/disable-row.directive.d.ts +0 -22
- package/lib/directives/draggable.directive.d.ts +0 -38
- package/lib/directives/long-press.directive.d.ts +0 -39
- package/lib/directives/orderable.directive.d.ts +0 -34
- package/lib/directives/resizeable.directive.d.ts +0 -25
- package/lib/directives/visibility.directive.d.ts +0 -26
- package/lib/ngx-datatable.module.d.ts +0 -50
- package/lib/services/column-changes.service.d.ts +0 -13
- package/lib/services/scrollbar-helper.service.d.ts +0 -12
- package/lib/types/internal.types.d.ts +0 -31
- package/lib/types/public.types.d.ts +0 -142
- package/lib/types/table-column.type.d.ts +0 -163
- package/lib/utils/camel-case.d.ts +0 -10
- package/lib/utils/column-helper.d.ts +0 -11
- package/lib/utils/column-prop-getters.d.ts +0 -29
- package/lib/utils/column.d.ts +0 -19
- package/lib/utils/id.d.ts +0 -5
- package/lib/utils/keys.d.ts +0 -8
- package/lib/utils/math.d.ts +0 -30
- package/lib/utils/row-height-cache.d.ts +0 -52
- package/lib/utils/selection.d.ts +0 -2
- package/lib/utils/sort.d.ts +0 -17
- package/lib/utils/table-token.d.ts +0 -7
- package/lib/utils/throttle.d.ts +0 -17
- package/lib/utils/tree.d.ts +0 -40
- package/public-api.d.ts +0 -48
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, EventEmitter, TemplateRef, Output, ContentChild, Input, inject, Injectable, booleanAttribute, numberAttribute, Renderer2, ElementRef, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef,
|
|
2
|
+
import { Directive, EventEmitter, TemplateRef, Output, ContentChild, Input, inject, Injectable, booleanAttribute, numberAttribute, Renderer2, ElementRef, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, HostListener, KeyValueDiffers, InjectionToken, ViewContainerRef, Injector, signal, IterableDiffers, ViewChild, computed, DOCUMENT, ContentChildren, NgZone, input, effect, NgModule } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
|
-
import { Subject, fromEvent,
|
|
5
|
-
import { NgTemplateOutlet,
|
|
4
|
+
import { Subject, fromEvent, takeUntil as takeUntil$1 } from 'rxjs';
|
|
5
|
+
import { NgTemplateOutlet, NgStyle, NgClass } from '@angular/common';
|
|
6
6
|
import { takeUntil } from 'rxjs/operators';
|
|
7
7
|
|
|
8
8
|
class DataTableFooterTemplateDirective {
|
|
9
9
|
static ngTemplateContextGuard(directive, context) {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
13
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
13
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DataTableFooterTemplateDirective, isStandalone: true, selector: "[ngx-datatable-footer-template]", ngImport: i0 }); }
|
|
14
14
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableFooterTemplateDirective, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
18
|
-
selector: '[ngx-datatable-footer-template]'
|
|
19
|
-
standalone: true
|
|
18
|
+
selector: '[ngx-datatable-footer-template]'
|
|
20
19
|
}]
|
|
21
20
|
}] });
|
|
22
21
|
|
|
@@ -24,14 +23,13 @@ class DatatableGroupHeaderTemplateDirective {
|
|
|
24
23
|
static ngTemplateContextGuard(directive, context) {
|
|
25
24
|
return true;
|
|
26
25
|
}
|
|
27
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
28
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableGroupHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
27
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableGroupHeaderTemplateDirective, isStandalone: true, selector: "[ngx-datatable-group-header-template]", ngImport: i0 }); }
|
|
29
28
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableGroupHeaderTemplateDirective, decorators: [{
|
|
31
30
|
type: Directive,
|
|
32
31
|
args: [{
|
|
33
|
-
selector: '[ngx-datatable-group-header-template]'
|
|
34
|
-
standalone: true
|
|
32
|
+
selector: '[ngx-datatable-group-header-template]'
|
|
35
33
|
}]
|
|
36
34
|
}] });
|
|
37
35
|
|
|
@@ -80,14 +78,13 @@ class DatatableGroupHeaderDirective {
|
|
|
80
78
|
value: false
|
|
81
79
|
});
|
|
82
80
|
}
|
|
83
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
84
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableGroupHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
82
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableGroupHeaderDirective, isStandalone: true, selector: "ngx-datatable-group-header", inputs: { rowHeight: "rowHeight", checkboxable: "checkboxable", _templateInput: ["template", "_templateInput"] }, outputs: { toggle: "toggle" }, queries: [{ propertyName: "_templateQuery", first: true, predicate: DatatableGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0 }); }
|
|
85
83
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableGroupHeaderDirective, decorators: [{
|
|
87
85
|
type: Directive,
|
|
88
86
|
args: [{
|
|
89
|
-
selector: 'ngx-datatable-group-header'
|
|
90
|
-
standalone: true
|
|
87
|
+
selector: 'ngx-datatable-group-header'
|
|
91
88
|
}]
|
|
92
89
|
}], propDecorators: { rowHeight: [{
|
|
93
90
|
type: Input
|
|
@@ -114,6 +111,7 @@ function emptyStringGetter() {
|
|
|
114
111
|
* If prop == null, returns the emptyStringGetter.
|
|
115
112
|
*/
|
|
116
113
|
function getterForProp(prop) {
|
|
114
|
+
// TODO requires better typing which will also involve adjust TableColum. So postponing it.
|
|
117
115
|
if (prop == null) {
|
|
118
116
|
return emptyStringGetter;
|
|
119
117
|
}
|
|
@@ -200,7 +198,7 @@ function deepValueGetter(obj, path) {
|
|
|
200
198
|
}
|
|
201
199
|
|
|
202
200
|
function optionalGetterForProp(prop) {
|
|
203
|
-
return prop
|
|
201
|
+
return prop ? row => getterForProp(prop)(row, prop) : undefined;
|
|
204
202
|
}
|
|
205
203
|
/**
|
|
206
204
|
* This functions rearrange items by their parents
|
|
@@ -240,212 +238,54 @@ function optionalGetterForProp(prop) {
|
|
|
240
238
|
*/
|
|
241
239
|
function groupRowsByParents(rows, from, to) {
|
|
242
240
|
if (from && to) {
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
nodeById[0] = new TreeNode(); // that's the root node
|
|
247
|
-
const uniqIDs = rows.reduce((arr, item) => {
|
|
248
|
-
const toValue = to(item);
|
|
249
|
-
if (arr.indexOf(toValue) === -1) {
|
|
250
|
-
arr.push(toValue);
|
|
251
|
-
}
|
|
252
|
-
return arr;
|
|
253
|
-
}, []);
|
|
254
|
-
for (let i = 0; i < l; i++) {
|
|
255
|
-
// make TreeNode objects for each item
|
|
256
|
-
nodeById[to(rows[i])] = new TreeNode(rows[i]);
|
|
257
|
-
}
|
|
258
|
-
for (let i = 0; i < l; i++) {
|
|
259
|
-
// link all TreeNode objects
|
|
260
|
-
node = nodeById[to(rows[i])];
|
|
261
|
-
let parent = 0;
|
|
241
|
+
const treeRows = rows.filter(row => !!row).map(row => new TreeNode(row));
|
|
242
|
+
const uniqIDs = new Map(treeRows.map(node => [to(node.row), node]));
|
|
243
|
+
const rootNodes = treeRows.reduce((root, node) => {
|
|
262
244
|
const fromValue = from(node.row);
|
|
263
|
-
|
|
264
|
-
|
|
245
|
+
const parent = uniqIDs.get(fromValue);
|
|
246
|
+
if (parent) {
|
|
247
|
+
node.row.level = parent.row.level + 1; // TODO: should be reflected by type, that level is defined
|
|
248
|
+
node.parent = parent;
|
|
249
|
+
parent.children.push(node);
|
|
265
250
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}, true);
|
|
274
|
-
return resolvedRows;
|
|
251
|
+
else {
|
|
252
|
+
node.row.level = 0;
|
|
253
|
+
root.push(node);
|
|
254
|
+
}
|
|
255
|
+
return root;
|
|
256
|
+
}, []);
|
|
257
|
+
return rootNodes.flatMap(child => child.flatten());
|
|
275
258
|
}
|
|
276
259
|
else {
|
|
277
260
|
return rows;
|
|
278
261
|
}
|
|
279
262
|
}
|
|
280
263
|
class TreeNode {
|
|
281
|
-
constructor(row
|
|
282
|
-
if (!row) {
|
|
283
|
-
row = {
|
|
284
|
-
level: -1,
|
|
285
|
-
treeStatus: 'expanded'
|
|
286
|
-
};
|
|
287
|
-
}
|
|
264
|
+
constructor(row) {
|
|
288
265
|
this.row = row;
|
|
289
|
-
this.parent = null;
|
|
290
266
|
this.children = [];
|
|
291
267
|
}
|
|
292
|
-
flatten(
|
|
293
|
-
if (this.row
|
|
294
|
-
|
|
295
|
-
const child = this.children[i];
|
|
296
|
-
f.apply(child, Array.prototype.slice.call(arguments, 2));
|
|
297
|
-
if (recursive) {
|
|
298
|
-
child.flatten.apply(child, arguments);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Converts strings from something to camel case
|
|
307
|
-
* http://stackoverflow.com/questions/10425287/convert-dash-separated-string-to-camelcase
|
|
308
|
-
*/
|
|
309
|
-
function camelCase(str) {
|
|
310
|
-
// Replace special characters with a space
|
|
311
|
-
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
|
|
312
|
-
// put a space before an uppercase letter
|
|
313
|
-
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
|
|
314
|
-
// Lower case first character and some other stuff
|
|
315
|
-
str = str
|
|
316
|
-
.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g, '')
|
|
317
|
-
.trim()
|
|
318
|
-
.toLowerCase();
|
|
319
|
-
// uppercase characters preceded by a space or number
|
|
320
|
-
str = str.replace(/([ 0-9]+)([a-zA-Z])/g, function (a, b, c) {
|
|
321
|
-
return b.trim() + c.toUpperCase();
|
|
322
|
-
});
|
|
323
|
-
return str;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Converts strings from camel case to words
|
|
327
|
-
* http://stackoverflow.com/questions/7225407/convert-camelcasetext-to-camel-case-text
|
|
328
|
-
*/
|
|
329
|
-
function deCamelCase(str) {
|
|
330
|
-
return str.replace(/([A-Z])/g, match => ` ${match}`).replace(/^./, match => match.toUpperCase());
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Creates a unique object id.
|
|
335
|
-
* http://stackoverflow.com/questions/6248666/how-to-generate-short-uid-like-ax4j9z-in-js
|
|
336
|
-
*/
|
|
337
|
-
function id() {
|
|
338
|
-
return ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Sets the column defaults
|
|
343
|
-
*/
|
|
344
|
-
function setColumnDefaults(columns, defaultColumnWidth = 150) {
|
|
345
|
-
if (!columns) {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
// Only one column should hold the tree view
|
|
349
|
-
// Thus if multiple columns are provided with
|
|
350
|
-
// isTreeColumn as true we take only the first one
|
|
351
|
-
let treeColumnFound = false;
|
|
352
|
-
for (const column of columns) {
|
|
353
|
-
if (!column.$$id) {
|
|
354
|
-
column.$$id = id();
|
|
355
|
-
}
|
|
356
|
-
// prop can be numeric; zero is valid not a missing prop
|
|
357
|
-
// translate name => prop
|
|
358
|
-
if (isNullOrUndefined(column.prop) && column.name) {
|
|
359
|
-
column.prop = camelCase(column.name);
|
|
360
|
-
}
|
|
361
|
-
if (!column.$$valueGetter) {
|
|
362
|
-
column.$$valueGetter = getterForProp(column.prop);
|
|
363
|
-
}
|
|
364
|
-
// format props if no name passed
|
|
365
|
-
if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
|
|
366
|
-
column.name = deCamelCase(String(column.prop));
|
|
367
|
-
}
|
|
368
|
-
if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
|
|
369
|
-
column.name = ''; // Fixes IE and Edge displaying `null`
|
|
370
|
-
}
|
|
371
|
-
if (!('resizeable' in column)) {
|
|
372
|
-
column.resizeable = true;
|
|
373
|
-
}
|
|
374
|
-
if (!('sortable' in column)) {
|
|
375
|
-
column.sortable = true;
|
|
376
|
-
}
|
|
377
|
-
if (!('draggable' in column)) {
|
|
378
|
-
column.draggable = true;
|
|
379
|
-
}
|
|
380
|
-
if (!('canAutoResize' in column)) {
|
|
381
|
-
column.canAutoResize = true;
|
|
382
|
-
}
|
|
383
|
-
if (!('width' in column)) {
|
|
384
|
-
column.width = defaultColumnWidth;
|
|
385
|
-
}
|
|
386
|
-
if (!('isTreeColumn' in column)) {
|
|
387
|
-
column.isTreeColumn = false;
|
|
268
|
+
flatten() {
|
|
269
|
+
if (this.row.treeStatus === 'expanded') {
|
|
270
|
+
return [this.row, ...this.children.flatMap(child => child.flatten())];
|
|
388
271
|
}
|
|
389
272
|
else {
|
|
390
|
-
|
|
391
|
-
// If the first column with isTreeColumn is true found
|
|
392
|
-
// we mark that treeCoulmn is found
|
|
393
|
-
treeColumnFound = true;
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
// After that isTreeColumn property for any other column
|
|
397
|
-
// will be set as false
|
|
398
|
-
column.isTreeColumn = false;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
function isNullOrUndefined(value) {
|
|
404
|
-
return value === null || value === undefined;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Translates templates definitions to objects
|
|
408
|
-
*/
|
|
409
|
-
function translateTemplates(templates) {
|
|
410
|
-
const result = [];
|
|
411
|
-
for (const temp of templates) {
|
|
412
|
-
const col = {};
|
|
413
|
-
const props = Object.getOwnPropertyNames(temp);
|
|
414
|
-
for (const prop of props) {
|
|
415
|
-
col[prop] = temp[prop];
|
|
416
|
-
}
|
|
417
|
-
if (temp.headerTemplate) {
|
|
418
|
-
col.headerTemplate = temp.headerTemplate;
|
|
419
|
-
}
|
|
420
|
-
if (temp.cellTemplate) {
|
|
421
|
-
col.cellTemplate = temp.cellTemplate;
|
|
422
|
-
}
|
|
423
|
-
if (temp.ghostCellTemplate) {
|
|
424
|
-
col.ghostCellTemplate = temp.ghostCellTemplate;
|
|
273
|
+
return [this.row];
|
|
425
274
|
}
|
|
426
|
-
if (temp.summaryFunc) {
|
|
427
|
-
col.summaryFunc = temp.summaryFunc;
|
|
428
|
-
}
|
|
429
|
-
if (temp.summaryTemplate) {
|
|
430
|
-
col.summaryTemplate = temp.summaryTemplate;
|
|
431
|
-
}
|
|
432
|
-
result.push(col);
|
|
433
275
|
}
|
|
434
|
-
return result;
|
|
435
276
|
}
|
|
436
277
|
|
|
437
278
|
class DataTableColumnHeaderDirective {
|
|
438
279
|
static ngTemplateContextGuard(directive, context) {
|
|
439
280
|
return true;
|
|
440
281
|
}
|
|
441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
442
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
283
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DataTableColumnHeaderDirective, isStandalone: true, selector: "[ngx-datatable-header-template]", ngImport: i0 }); }
|
|
443
284
|
}
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnHeaderDirective, decorators: [{
|
|
445
286
|
type: Directive,
|
|
446
287
|
args: [{
|
|
447
|
-
selector: '[ngx-datatable-header-template]'
|
|
448
|
-
standalone: true
|
|
288
|
+
selector: '[ngx-datatable-header-template]'
|
|
449
289
|
}]
|
|
450
290
|
}] });
|
|
451
291
|
|
|
@@ -456,14 +296,13 @@ class DataTableColumnCellDirective {
|
|
|
456
296
|
static ngTemplateContextGuard(dir, ctx) {
|
|
457
297
|
return true;
|
|
458
298
|
}
|
|
459
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
460
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
299
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
300
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DataTableColumnCellDirective, isStandalone: true, selector: "[ngx-datatable-cell-template]", ngImport: i0 }); }
|
|
461
301
|
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnCellDirective, decorators: [{
|
|
463
303
|
type: Directive,
|
|
464
304
|
args: [{
|
|
465
|
-
selector: '[ngx-datatable-cell-template]'
|
|
466
|
-
standalone: true
|
|
305
|
+
selector: '[ngx-datatable-cell-template]'
|
|
467
306
|
}]
|
|
468
307
|
}] });
|
|
469
308
|
|
|
@@ -471,14 +310,13 @@ class DataTableColumnCellTreeToggle {
|
|
|
471
310
|
constructor() {
|
|
472
311
|
this.template = inject(TemplateRef);
|
|
473
312
|
}
|
|
474
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
475
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
313
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnCellTreeToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
314
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DataTableColumnCellTreeToggle, isStandalone: true, selector: "[ngx-datatable-tree-toggle]", ngImport: i0 }); }
|
|
476
315
|
}
|
|
477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnCellTreeToggle, decorators: [{
|
|
478
317
|
type: Directive,
|
|
479
318
|
args: [{
|
|
480
|
-
selector: '[ngx-datatable-tree-toggle]'
|
|
481
|
-
standalone: true
|
|
319
|
+
selector: '[ngx-datatable-tree-toggle]'
|
|
482
320
|
}]
|
|
483
321
|
}] });
|
|
484
322
|
|
|
@@ -496,10 +334,10 @@ class ColumnChangesService {
|
|
|
496
334
|
onInputChange() {
|
|
497
335
|
this.columnInputChanges.next(undefined);
|
|
498
336
|
}
|
|
499
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
500
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ColumnChangesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
338
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ColumnChangesService }); }
|
|
501
339
|
}
|
|
502
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ColumnChangesService, decorators: [{
|
|
503
341
|
type: Injectable
|
|
504
342
|
}] });
|
|
505
343
|
|
|
@@ -507,14 +345,13 @@ class DataTableColumnGhostCellDirective {
|
|
|
507
345
|
static ngTemplateContextGuard(directive, context) {
|
|
508
346
|
return true;
|
|
509
347
|
}
|
|
510
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
511
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnGhostCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
349
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DataTableColumnGhostCellDirective, isStandalone: true, selector: "[ngx-datatable-ghost-cell-template]", ngImport: i0 }); }
|
|
512
350
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnGhostCellDirective, decorators: [{
|
|
514
352
|
type: Directive,
|
|
515
353
|
args: [{
|
|
516
|
-
selector: '[ngx-datatable-ghost-cell-template]'
|
|
517
|
-
standalone: true
|
|
354
|
+
selector: '[ngx-datatable-ghost-cell-template]'
|
|
518
355
|
}]
|
|
519
356
|
}] });
|
|
520
357
|
|
|
@@ -543,14 +380,13 @@ class DataTableColumnDirective {
|
|
|
543
380
|
this.columnChangesService.onInputChange();
|
|
544
381
|
}
|
|
545
382
|
}
|
|
546
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
547
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
383
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
384
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.5", type: DataTableColumnDirective, isStandalone: true, selector: "ngx-datatable-column", inputs: { name: "name", prop: "prop", bindAsUnsafeHtml: ["bindAsUnsafeHtml", "bindAsUnsafeHtml", booleanAttribute], frozenLeft: ["frozenLeft", "frozenLeft", booleanAttribute], frozenRight: ["frozenRight", "frozenRight", booleanAttribute], flexGrow: ["flexGrow", "flexGrow", numberAttribute], resizeable: ["resizeable", "resizeable", booleanAttribute], comparator: "comparator", pipe: "pipe", sortable: ["sortable", "sortable", booleanAttribute], draggable: ["draggable", "draggable", booleanAttribute], canAutoResize: ["canAutoResize", "canAutoResize", booleanAttribute], minWidth: ["minWidth", "minWidth", numberAttribute], width: ["width", "width", numberAttribute], maxWidth: ["maxWidth", "maxWidth", numberAttribute], checkboxable: ["checkboxable", "checkboxable", booleanAttribute], headerCheckboxable: ["headerCheckboxable", "headerCheckboxable", booleanAttribute], headerClass: "headerClass", cellClass: "cellClass", isTreeColumn: ["isTreeColumn", "isTreeColumn", booleanAttribute], treeLevelIndent: "treeLevelIndent", summaryFunc: "summaryFunc", summaryTemplate: "summaryTemplate", _cellTemplateInput: ["cellTemplate", "_cellTemplateInput"], _headerTemplateInput: ["headerTemplate", "_headerTemplateInput"], _treeToggleTemplateInput: ["treeToggleTemplate", "_treeToggleTemplateInput"], _ghostCellTemplateInput: ["ghostCellTemplate", "_ghostCellTemplateInput"] }, queries: [{ propertyName: "_cellTemplateQuery", first: true, predicate: DataTableColumnCellDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "_headerTemplateQuery", first: true, predicate: DataTableColumnHeaderDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "_treeToggleTemplateQuery", first: true, predicate: DataTableColumnCellTreeToggle, descendants: true, read: TemplateRef, static: true }, { propertyName: "_ghostCellTemplateQuery", first: true, predicate: DataTableColumnGhostCellDirective, descendants: true, read: TemplateRef, static: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
548
385
|
}
|
|
549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableColumnDirective, decorators: [{
|
|
550
387
|
type: Directive,
|
|
551
388
|
args: [{
|
|
552
|
-
selector: 'ngx-datatable-column'
|
|
553
|
-
standalone: true
|
|
389
|
+
selector: 'ngx-datatable-column'
|
|
554
390
|
}]
|
|
555
391
|
}], propDecorators: { name: [{
|
|
556
392
|
type: Input
|
|
@@ -642,14 +478,13 @@ class DatatableRowDetailTemplateDirective {
|
|
|
642
478
|
static ngTemplateContextGuard(directive, context) {
|
|
643
479
|
return true;
|
|
644
480
|
}
|
|
645
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
646
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
481
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDetailTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
482
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableRowDetailTemplateDirective, isStandalone: true, selector: "[ngx-datatable-row-detail-template]", ngImport: i0 }); }
|
|
647
483
|
}
|
|
648
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDetailTemplateDirective, decorators: [{
|
|
649
485
|
type: Directive,
|
|
650
486
|
args: [{
|
|
651
|
-
selector: '[ngx-datatable-row-detail-template]'
|
|
652
|
-
standalone: true
|
|
487
|
+
selector: '[ngx-datatable-row-detail-template]'
|
|
653
488
|
}]
|
|
654
489
|
}] });
|
|
655
490
|
|
|
@@ -695,14 +530,13 @@ class DatatableRowDetailDirective {
|
|
|
695
530
|
value: false
|
|
696
531
|
});
|
|
697
532
|
}
|
|
698
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
699
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
533
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDetailDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
534
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableRowDetailDirective, isStandalone: true, selector: "ngx-datatable-row-detail", inputs: { rowHeight: "rowHeight", _templateInput: ["template", "_templateInput"] }, outputs: { toggle: "toggle" }, queries: [{ propertyName: "_templateQuery", first: true, predicate: DatatableRowDetailTemplateDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0 }); }
|
|
700
535
|
}
|
|
701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDetailDirective, decorators: [{
|
|
702
537
|
type: Directive,
|
|
703
538
|
args: [{
|
|
704
|
-
selector: 'ngx-datatable-row-detail'
|
|
705
|
-
standalone: true
|
|
539
|
+
selector: 'ngx-datatable-row-detail'
|
|
706
540
|
}]
|
|
707
541
|
}], propDecorators: { rowHeight: [{
|
|
708
542
|
type: Input
|
|
@@ -720,31 +554,15 @@ class DatatableFooterDirective {
|
|
|
720
554
|
get template() {
|
|
721
555
|
return this._templateInput || this._templateQuery;
|
|
722
556
|
}
|
|
723
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
724
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
557
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
558
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableFooterDirective, isStandalone: true, selector: "ngx-datatable-footer", inputs: { _templateInput: ["template", "_templateInput"] }, queries: [{ propertyName: "_templateQuery", first: true, predicate: DataTableFooterTemplateDirective, descendants: true, read: TemplateRef }], ngImport: i0 }); }
|
|
725
559
|
}
|
|
726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableFooterDirective, decorators: [{
|
|
727
561
|
type: Directive,
|
|
728
562
|
args: [{
|
|
729
|
-
selector: 'ngx-datatable-footer'
|
|
730
|
-
standalone: true
|
|
563
|
+
selector: 'ngx-datatable-footer'
|
|
731
564
|
}]
|
|
732
|
-
}], propDecorators: {
|
|
733
|
-
type: Input,
|
|
734
|
-
args: [{ transform: numberAttribute }]
|
|
735
|
-
}], totalMessage: [{
|
|
736
|
-
type: Input
|
|
737
|
-
}], selectedMessage: [{
|
|
738
|
-
type: Input
|
|
739
|
-
}], pagerLeftArrowIcon: [{
|
|
740
|
-
type: Input
|
|
741
|
-
}], pagerRightArrowIcon: [{
|
|
742
|
-
type: Input
|
|
743
|
-
}], pagerPreviousIcon: [{
|
|
744
|
-
type: Input
|
|
745
|
-
}], pagerNextIcon: [{
|
|
746
|
-
type: Input
|
|
747
|
-
}], _templateInput: [{
|
|
565
|
+
}], propDecorators: { _templateInput: [{
|
|
748
566
|
type: Input,
|
|
749
567
|
args: ['template']
|
|
750
568
|
}], _templateQuery: [{
|
|
@@ -755,8 +573,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
755
573
|
class ScrollerComponent {
|
|
756
574
|
constructor() {
|
|
757
575
|
this.renderer = inject(Renderer2);
|
|
758
|
-
this.scrollbarV = false;
|
|
759
|
-
this.scrollbarH = false;
|
|
760
576
|
this.scroll = new EventEmitter();
|
|
761
577
|
this.scrollYPos = 0;
|
|
762
578
|
this.scrollXPos = 0;
|
|
@@ -769,14 +585,14 @@ class ScrollerComponent {
|
|
|
769
585
|
// manual bind so we don't always listen
|
|
770
586
|
if (this.scrollbarV || this.scrollbarH) {
|
|
771
587
|
const renderer = this.renderer;
|
|
772
|
-
this.parentElement = renderer.parentNode(
|
|
588
|
+
this.parentElement = renderer.parentNode(this.element);
|
|
773
589
|
this._scrollEventListener = this.onScrolled.bind(this);
|
|
774
|
-
this.parentElement
|
|
590
|
+
this.parentElement?.addEventListener('scroll', this._scrollEventListener);
|
|
775
591
|
}
|
|
776
592
|
}
|
|
777
593
|
ngOnDestroy() {
|
|
778
594
|
if (this._scrollEventListener) {
|
|
779
|
-
this.parentElement
|
|
595
|
+
this.parentElement?.removeEventListener('scroll', this._scrollEventListener);
|
|
780
596
|
this._scrollEventListener = null;
|
|
781
597
|
}
|
|
782
598
|
}
|
|
@@ -798,7 +614,7 @@ class ScrollerComponent {
|
|
|
798
614
|
if (this.scrollYPos < this.prevScrollYPos) {
|
|
799
615
|
direction = 'down';
|
|
800
616
|
}
|
|
801
|
-
else
|
|
617
|
+
else {
|
|
802
618
|
direction = 'up';
|
|
803
619
|
}
|
|
804
620
|
this.scroll.emit({
|
|
@@ -809,10 +625,10 @@ class ScrollerComponent {
|
|
|
809
625
|
this.prevScrollYPos = this.scrollYPos;
|
|
810
626
|
this.prevScrollXPos = this.scrollXPos;
|
|
811
627
|
}
|
|
812
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
813
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ScrollerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: ScrollerComponent, isStandalone: true, selector: "datatable-scroller", inputs: { scrollbarV: "scrollbarV", scrollbarH: "scrollbarH", scrollHeight: "scrollHeight", scrollWidth: "scrollWidth" }, outputs: { scroll: "scroll" }, host: { properties: { "style.height.px": "this.scrollHeight", "style.width.px": "this.scrollWidth" }, classAttribute: "datatable-scroll" }, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
814
630
|
}
|
|
815
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ScrollerComponent, decorators: [{
|
|
816
632
|
type: Component,
|
|
817
633
|
args: [{
|
|
818
634
|
selector: 'datatable-scroller',
|
|
@@ -820,8 +636,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
820
636
|
host: {
|
|
821
637
|
class: 'datatable-scroll'
|
|
822
638
|
},
|
|
823
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
824
|
-
standalone: true
|
|
639
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
825
640
|
}]
|
|
826
641
|
}], propDecorators: { scrollbarV: [{
|
|
827
642
|
type: Input
|
|
@@ -877,29 +692,10 @@ function columnGroupWidths(groups, all) {
|
|
|
877
692
|
};
|
|
878
693
|
}
|
|
879
694
|
/**
|
|
880
|
-
* Calculates the total width of all columns
|
|
881
|
-
*/
|
|
882
|
-
function columnTotalWidth(columns, prop) {
|
|
883
|
-
let totalWidth = 0;
|
|
884
|
-
if (columns) {
|
|
885
|
-
for (const c of columns) {
|
|
886
|
-
const has = prop && c[prop];
|
|
887
|
-
const width = has ? c[prop] : c.width;
|
|
888
|
-
totalWidth = totalWidth + parseFloat(width);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
return totalWidth;
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Calculates the total width of all columns and their groups
|
|
695
|
+
* Calculates the total width of all columns
|
|
895
696
|
*/
|
|
896
|
-
function
|
|
897
|
-
|
|
898
|
-
for (const column of columns) {
|
|
899
|
-
const has = prop && column[prop];
|
|
900
|
-
totalWidth = totalWidth + (has ? column[prop] : column.width);
|
|
901
|
-
}
|
|
902
|
-
return totalWidth;
|
|
697
|
+
function columnTotalWidth(columns) {
|
|
698
|
+
return columns?.reduce((total, column) => total + column.width, 0) ?? 0;
|
|
903
699
|
}
|
|
904
700
|
function columnsByPinArr(val) {
|
|
905
701
|
const colsByPin = columnsByPin(val);
|
|
@@ -942,7 +738,7 @@ class RowHeightCache {
|
|
|
942
738
|
* @param detailRowHeight The detail row height.
|
|
943
739
|
*/
|
|
944
740
|
initCache(details) {
|
|
945
|
-
const { rows, rowHeight, detailRowHeight, externalVirtual,
|
|
741
|
+
const { rows, rowHeight, detailRowHeight, externalVirtual, indexOffset, rowCount, rowExpansions } = details;
|
|
946
742
|
const isFn = typeof rowHeight === 'function';
|
|
947
743
|
const isDetailFn = typeof detailRowHeight === 'function';
|
|
948
744
|
if (!isFn && isNaN(rowHeight)) {
|
|
@@ -970,7 +766,7 @@ class RowHeightCache {
|
|
|
970
766
|
const expanded = rowExpansions.has(row);
|
|
971
767
|
if (row && expanded) {
|
|
972
768
|
if (isDetailFn) {
|
|
973
|
-
const index =
|
|
769
|
+
const index = indexOffset + i;
|
|
974
770
|
currentRowHeight += detailRowHeight(row, index);
|
|
975
771
|
}
|
|
976
772
|
else {
|
|
@@ -1090,32 +886,13 @@ var SelectionType;
|
|
|
1090
886
|
SelectionType["checkbox"] = "checkbox";
|
|
1091
887
|
})(SelectionType || (SelectionType = {}));
|
|
1092
888
|
|
|
1093
|
-
class DataTableGhostLoaderComponent {
|
|
1094
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DataTableGhostLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1095
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.9", type: DataTableGhostLoaderComponent, isStandalone: true, selector: "ghost-loader", inputs: { columns: "columns", pageSize: ["pageSize", "pageSize", numberAttribute], rowHeight: "rowHeight", ghostBodyHeight: ["ghostBodyHeight", "ghostBodyHeight", numberAttribute] }, ngImport: i0, template: "<div [style.height]=\"ghostBodyHeight + 'px'\" class=\"ghost-loader ghost-cell-container\">\n @for (item of [].constructor(pageSize); track item) {\n <div [style.height]=\"rowHeight + 'px'\" class=\"ghost-element\">\n @for (col of columns; track col) {\n @if (!col.ghostCellTemplate) {\n <div class=\"line ghost-cell-strip\" [style.width]=\"col?.width + 'px'\"> </div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"col.ghostCellTemplate\"> </ng-template>\n }\n }\n </div>\n }\n</div>\n", styles: ["@keyframes ghost{0%{background-position:0vw 0}to{background-position:100vw 0}}.ghost-loader{overflow:hidden}.ghost-loader .line{width:100%;height:12px;animation-name:ghost;animation-iteration-count:infinite;animation-timing-function:linear}.ghost-loader .ghost-element{display:flex}:host.ghost-overlay{position:sticky;top:20px}:host.ghost-overlay .ghost-loader .line{margin:.9rem 1.2rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1096
|
-
}
|
|
1097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DataTableGhostLoaderComponent, decorators: [{
|
|
1098
|
-
type: Component,
|
|
1099
|
-
args: [{ selector: `ghost-loader`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div [style.height]=\"ghostBodyHeight + 'px'\" class=\"ghost-loader ghost-cell-container\">\n @for (item of [].constructor(pageSize); track item) {\n <div [style.height]=\"rowHeight + 'px'\" class=\"ghost-element\">\n @for (col of columns; track col) {\n @if (!col.ghostCellTemplate) {\n <div class=\"line ghost-cell-strip\" [style.width]=\"col?.width + 'px'\"> </div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"col.ghostCellTemplate\"> </ng-template>\n }\n }\n </div>\n }\n</div>\n", styles: ["@keyframes ghost{0%{background-position:0vw 0}to{background-position:100vw 0}}.ghost-loader{overflow:hidden}.ghost-loader .line{width:100%;height:12px;animation-name:ghost;animation-iteration-count:infinite;animation-timing-function:linear}.ghost-loader .ghost-element{display:flex}:host.ghost-overlay{position:sticky;top:20px}:host.ghost-overlay .ghost-loader .line{margin:.9rem 1.2rem}\n"] }]
|
|
1100
|
-
}], propDecorators: { columns: [{
|
|
1101
|
-
type: Input
|
|
1102
|
-
}], pageSize: [{
|
|
1103
|
-
type: Input,
|
|
1104
|
-
args: [{ transform: numberAttribute }]
|
|
1105
|
-
}], rowHeight: [{
|
|
1106
|
-
type: Input
|
|
1107
|
-
}], ghostBodyHeight: [{
|
|
1108
|
-
type: Input,
|
|
1109
|
-
args: [{ transform: numberAttribute }]
|
|
1110
|
-
}] } });
|
|
1111
|
-
|
|
1112
889
|
class DataTableBodyCellComponent {
|
|
1113
|
-
set
|
|
1114
|
-
this.
|
|
1115
|
-
this.
|
|
890
|
+
set disabled(value) {
|
|
891
|
+
this.cellContext.disabled = value;
|
|
892
|
+
this._disabled = value;
|
|
1116
893
|
}
|
|
1117
|
-
get
|
|
1118
|
-
return this.
|
|
894
|
+
get disabled() {
|
|
895
|
+
return this._disabled;
|
|
1119
896
|
}
|
|
1120
897
|
set group(group) {
|
|
1121
898
|
this._group = group;
|
|
@@ -1153,7 +930,8 @@ class DataTableBodyCellComponent {
|
|
|
1153
930
|
}
|
|
1154
931
|
set rowIndex(val) {
|
|
1155
932
|
this._rowIndex = val;
|
|
1156
|
-
this.cellContext.rowIndex = val;
|
|
933
|
+
this.cellContext.rowIndex = val?.index;
|
|
934
|
+
this.cellContext.rowInGroupIndex = val?.indexInGroup;
|
|
1157
935
|
this.checkValueUpdates();
|
|
1158
936
|
this.cd.markForCheck();
|
|
1159
937
|
}
|
|
@@ -1232,7 +1010,7 @@ class DataTableBodyCellComponent {
|
|
|
1232
1010
|
if (!this.sortDir) {
|
|
1233
1011
|
cls += ' sort-active';
|
|
1234
1012
|
}
|
|
1235
|
-
if (this.isFocused && !this.
|
|
1013
|
+
if (this.isFocused && !this._disabled) {
|
|
1236
1014
|
cls += ' active';
|
|
1237
1015
|
}
|
|
1238
1016
|
if (this.sortDir === SortDirection.asc) {
|
|
@@ -1241,7 +1019,7 @@ class DataTableBodyCellComponent {
|
|
|
1241
1019
|
if (this.sortDir === SortDirection.desc) {
|
|
1242
1020
|
cls += ' sort-desc';
|
|
1243
1021
|
}
|
|
1244
|
-
if (this.
|
|
1022
|
+
if (this._disabled) {
|
|
1245
1023
|
cls += ' row-disabled';
|
|
1246
1024
|
}
|
|
1247
1025
|
return cls;
|
|
@@ -1264,7 +1042,6 @@ class DataTableBodyCellComponent {
|
|
|
1264
1042
|
}
|
|
1265
1043
|
constructor() {
|
|
1266
1044
|
this.cd = inject(ChangeDetectorRef);
|
|
1267
|
-
this.ghostLoadingIndicator = false;
|
|
1268
1045
|
this.activate = new EventEmitter();
|
|
1269
1046
|
this.treeAction = new EventEmitter();
|
|
1270
1047
|
this.isFocused = false;
|
|
@@ -1278,26 +1055,19 @@ class DataTableBodyCellComponent {
|
|
|
1278
1055
|
column: this.column,
|
|
1279
1056
|
rowHeight: this.rowHeight,
|
|
1280
1057
|
isSelected: this.isSelected,
|
|
1281
|
-
rowIndex: this.rowIndex,
|
|
1058
|
+
rowIndex: this.rowIndex?.index,
|
|
1059
|
+
rowInGroupIndex: this.rowIndex?.indexInGroup,
|
|
1282
1060
|
treeStatus: this.treeStatus,
|
|
1283
|
-
|
|
1061
|
+
disabled: this._disabled,
|
|
1284
1062
|
onTreeAction: () => this.onTreeAction()
|
|
1285
1063
|
};
|
|
1286
1064
|
}
|
|
1287
1065
|
ngDoCheck() {
|
|
1288
1066
|
this.checkValueUpdates();
|
|
1289
1067
|
}
|
|
1290
|
-
ngOnDestroy() {
|
|
1291
|
-
if (this.cellTemplate) {
|
|
1292
|
-
this.cellTemplate.clear();
|
|
1293
|
-
}
|
|
1294
|
-
if (this.ghostLoaderTemplate) {
|
|
1295
|
-
this.ghostLoaderTemplate.clear();
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
1068
|
checkValueUpdates() {
|
|
1299
1069
|
let value = '';
|
|
1300
|
-
if (!this.row || !this.column) {
|
|
1070
|
+
if (!this.row || !this.column || this.column.prop == undefined) {
|
|
1301
1071
|
value = '';
|
|
1302
1072
|
}
|
|
1303
1073
|
else {
|
|
@@ -1313,7 +1083,7 @@ class DataTableBodyCellComponent {
|
|
|
1313
1083
|
if (this.value !== value) {
|
|
1314
1084
|
this.value = value;
|
|
1315
1085
|
this.cellContext.value = value;
|
|
1316
|
-
this.cellContext.
|
|
1086
|
+
this.cellContext.disabled = this._disabled;
|
|
1317
1087
|
this.sanitizedValue = value !== null && value !== undefined ? this.stripHtml(value) : value;
|
|
1318
1088
|
this.cd.markForCheck();
|
|
1319
1089
|
}
|
|
@@ -1386,12 +1156,10 @@ class DataTableBodyCellComponent {
|
|
|
1386
1156
|
}
|
|
1387
1157
|
calcSortDir(sorts) {
|
|
1388
1158
|
if (!sorts) {
|
|
1389
|
-
return;
|
|
1159
|
+
return undefined;
|
|
1390
1160
|
}
|
|
1391
1161
|
const sort = sorts.find(s => s.prop === this.column.prop);
|
|
1392
|
-
|
|
1393
|
-
return sort.dir;
|
|
1394
|
-
}
|
|
1162
|
+
return sort?.dir;
|
|
1395
1163
|
}
|
|
1396
1164
|
stripHtml(html) {
|
|
1397
1165
|
if (!html.replace) {
|
|
@@ -1406,15 +1174,14 @@ class DataTableBodyCellComponent {
|
|
|
1406
1174
|
const levelIndent = column.treeLevelIndent != null ? column.treeLevelIndent : 50;
|
|
1407
1175
|
return column.isTreeColumn ? row.level * levelIndent : 0;
|
|
1408
1176
|
}
|
|
1409
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1410
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1411
|
-
@if (row) {
|
|
1177
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1178
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableBodyCellComponent, isStandalone: true, selector: "datatable-body-cell", inputs: { displayCheck: "displayCheck", disabled: "disabled", group: "group", rowHeight: "rowHeight", isSelected: "isSelected", expanded: "expanded", rowIndex: "rowIndex", column: "column", row: "row", sorts: "sorts", treeStatus: "treeStatus" }, outputs: { activate: "activate", treeAction: "treeAction" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "click": "onClick($event)", "dblclick": "onDblClick($event)", "keydown": "onKeyDown($event)" }, properties: { "class": "this.columnCssClasses", "style.width.px": "this.width", "style.minWidth.px": "this.minWidth", "style.maxWidth.px": "this.maxWidth", "style.height": "this.height" } }, ngImport: i0, template: `
|
|
1412
1179
|
<div class="datatable-body-cell-label" [style.margin-left.px]="calcLeftMargin(column, row)">
|
|
1413
1180
|
@if (column.checkboxable && (!displayCheck || displayCheck(row, column, value))) {
|
|
1414
1181
|
<label class="datatable-checkbox">
|
|
1415
1182
|
<input
|
|
1416
1183
|
type="checkbox"
|
|
1417
|
-
[disabled]="
|
|
1184
|
+
[disabled]="disabled"
|
|
1418
1185
|
[checked]="isSelected"
|
|
1419
1186
|
(click)="onCheckboxChange($event)"
|
|
1420
1187
|
/>
|
|
@@ -1447,32 +1214,21 @@ class DataTableBodyCellComponent {
|
|
|
1447
1214
|
} @else {
|
|
1448
1215
|
<span [title]="sanitizedValue">{{ value }}</span>
|
|
1449
1216
|
} } @else {
|
|
1450
|
-
<ng-template
|
|
1451
|
-
#cellTemplate
|
|
1452
|
-
[ngTemplateOutlet]="column.cellTemplate"
|
|
1453
|
-
[ngTemplateOutletContext]="cellContext"
|
|
1454
|
-
>
|
|
1217
|
+
<ng-template [ngTemplateOutlet]="column.cellTemplate" [ngTemplateOutletContext]="cellContext">
|
|
1455
1218
|
</ng-template>
|
|
1456
1219
|
}
|
|
1457
1220
|
</div>
|
|
1458
|
-
|
|
1459
|
-
<ghost-loader [columns]="[column]" [pageSize]="1"></ghost-loader>
|
|
1460
|
-
} }
|
|
1461
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DataTableGhostLoaderComponent, selector: "ghost-loader", inputs: ["columns", "pageSize", "rowHeight", "ghostBodyHeight"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1221
|
+
`, isInline: true, styles: [":host{overflow-x:hidden;vertical-align:top;display:inline-block;line-height:1.625}:host:focus{outline:none}:host-context(ngx-datatable.fixed-row) :host{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1462
1222
|
}
|
|
1463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyCellComponent, decorators: [{
|
|
1464
1224
|
type: Component,
|
|
1465
|
-
args: [{
|
|
1466
|
-
selector: 'datatable-body-cell',
|
|
1467
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1468
|
-
template: `
|
|
1469
|
-
@if (row) {
|
|
1225
|
+
args: [{ selector: 'datatable-body-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1470
1226
|
<div class="datatable-body-cell-label" [style.margin-left.px]="calcLeftMargin(column, row)">
|
|
1471
1227
|
@if (column.checkboxable && (!displayCheck || displayCheck(row, column, value))) {
|
|
1472
1228
|
<label class="datatable-checkbox">
|
|
1473
1229
|
<input
|
|
1474
1230
|
type="checkbox"
|
|
1475
|
-
[disabled]="
|
|
1231
|
+
[disabled]="disabled"
|
|
1476
1232
|
[checked]="isSelected"
|
|
1477
1233
|
(click)="onCheckboxChange($event)"
|
|
1478
1234
|
/>
|
|
@@ -1505,23 +1261,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1505
1261
|
} @else {
|
|
1506
1262
|
<span [title]="sanitizedValue">{{ value }}</span>
|
|
1507
1263
|
} } @else {
|
|
1508
|
-
<ng-template
|
|
1509
|
-
#cellTemplate
|
|
1510
|
-
[ngTemplateOutlet]="column.cellTemplate"
|
|
1511
|
-
[ngTemplateOutletContext]="cellContext"
|
|
1512
|
-
>
|
|
1264
|
+
<ng-template [ngTemplateOutlet]="column.cellTemplate" [ngTemplateOutletContext]="cellContext">
|
|
1513
1265
|
</ng-template>
|
|
1514
1266
|
}
|
|
1515
1267
|
</div>
|
|
1516
|
-
|
|
1517
|
-
<ghost-loader [columns]="[column]" [pageSize]="1"></ghost-loader>
|
|
1518
|
-
} }
|
|
1519
|
-
`,
|
|
1520
|
-
imports: [NgTemplateOutlet, DataTableGhostLoaderComponent, AsyncPipe]
|
|
1521
|
-
}]
|
|
1268
|
+
`, imports: [NgTemplateOutlet], styles: [":host{overflow-x:hidden;vertical-align:top;display:inline-block;line-height:1.625}:host:focus{outline:none}:host-context(ngx-datatable.fixed-row) :host{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
1522
1269
|
}], ctorParameters: () => [], propDecorators: { displayCheck: [{
|
|
1523
1270
|
type: Input
|
|
1524
|
-
}],
|
|
1271
|
+
}], disabled: [{
|
|
1525
1272
|
type: Input
|
|
1526
1273
|
}], group: [{
|
|
1527
1274
|
type: Input
|
|
@@ -1541,18 +1288,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1541
1288
|
type: Input
|
|
1542
1289
|
}], treeStatus: [{
|
|
1543
1290
|
type: Input
|
|
1544
|
-
}], ghostLoadingIndicator: [{
|
|
1545
|
-
type: Input
|
|
1546
1291
|
}], activate: [{
|
|
1547
1292
|
type: Output
|
|
1548
1293
|
}], treeAction: [{
|
|
1549
1294
|
type: Output
|
|
1550
|
-
}], cellTemplate: [{
|
|
1551
|
-
type: ViewChild,
|
|
1552
|
-
args: ['cellTemplate', { read: ViewContainerRef, static: true }]
|
|
1553
|
-
}], ghostLoaderTemplate: [{
|
|
1554
|
-
type: ViewChild,
|
|
1555
|
-
args: ['ghostLoaderTemplate', { read: ViewContainerRef, static: true }]
|
|
1556
1295
|
}], columnCssClasses: [{
|
|
1557
1296
|
type: HostBinding,
|
|
1558
1297
|
args: ['class']
|
|
@@ -1589,7 +1328,6 @@ class DataTableBodyRowComponent {
|
|
|
1589
1328
|
constructor() {
|
|
1590
1329
|
this.cd = inject(ChangeDetectorRef);
|
|
1591
1330
|
this.treeStatus = 'collapsed';
|
|
1592
|
-
this.ghostLoadingIndicator = false;
|
|
1593
1331
|
this.verticalScrollVisible = false;
|
|
1594
1332
|
this.activate = new EventEmitter();
|
|
1595
1333
|
this.treeAction = new EventEmitter();
|
|
@@ -1616,24 +1354,18 @@ class DataTableBodyRowComponent {
|
|
|
1616
1354
|
get innerWidth() {
|
|
1617
1355
|
return this._innerWidth;
|
|
1618
1356
|
}
|
|
1619
|
-
set offsetX(val) {
|
|
1620
|
-
this._offsetX = val;
|
|
1621
|
-
}
|
|
1622
|
-
get offsetX() {
|
|
1623
|
-
return this._offsetX;
|
|
1624
|
-
}
|
|
1625
1357
|
get cssClass() {
|
|
1626
1358
|
let cls = 'datatable-body-row';
|
|
1627
1359
|
if (this.isSelected) {
|
|
1628
1360
|
cls += ' active';
|
|
1629
1361
|
}
|
|
1630
|
-
if (this.
|
|
1362
|
+
if (this.innerRowIndex % 2 !== 0) {
|
|
1631
1363
|
cls += ' datatable-row-odd';
|
|
1632
1364
|
}
|
|
1633
|
-
if (this.
|
|
1365
|
+
if (this.innerRowIndex % 2 === 0) {
|
|
1634
1366
|
cls += ' datatable-row-even';
|
|
1635
1367
|
}
|
|
1636
|
-
if (this.
|
|
1368
|
+
if (this.disabled) {
|
|
1637
1369
|
cls += ' row-disabled';
|
|
1638
1370
|
}
|
|
1639
1371
|
if (this.rowClass) {
|
|
@@ -1666,9 +1398,7 @@ class DataTableBodyRowComponent {
|
|
|
1666
1398
|
}
|
|
1667
1399
|
}
|
|
1668
1400
|
onActivate(event, index) {
|
|
1669
|
-
event.cellIndex
|
|
1670
|
-
event.rowElement = this._element;
|
|
1671
|
-
this.activate.emit(event);
|
|
1401
|
+
this.activate.emit({ ...event, rowElement: this._element, cellIndex: index });
|
|
1672
1402
|
}
|
|
1673
1403
|
onKeyDown(event) {
|
|
1674
1404
|
const key = event.key;
|
|
@@ -1707,13 +1437,17 @@ class DataTableBodyRowComponent {
|
|
|
1707
1437
|
onTreeAction() {
|
|
1708
1438
|
this.treeAction.emit();
|
|
1709
1439
|
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1440
|
+
/** Returns the row index, or if in a group, the index within a group. */
|
|
1441
|
+
get innerRowIndex() {
|
|
1442
|
+
return this.rowIndex?.indexInGroup ?? this.rowIndex?.index ?? 0;
|
|
1443
|
+
}
|
|
1444
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1445
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableBodyRowComponent, isStandalone: true, selector: "datatable-body-row", inputs: { columns: "columns", innerWidth: "innerWidth", expanded: "expanded", rowClass: "rowClass", row: "row", group: "group", isSelected: "isSelected", rowIndex: "rowIndex", displayCheck: "displayCheck", treeStatus: "treeStatus", verticalScrollVisible: "verticalScrollVisible", disabled: "disabled", rowHeight: "rowHeight" }, outputs: { activate: "activate", treeAction: "treeAction" }, host: { listeners: { "keydown": "onKeyDown($event)", "mouseenter": "onMouseenter($event)" }, properties: { "class": "this.cssClass", "style.height.px": "this.rowHeight", "style.width.px": "this.columnsTotalWidths" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
1446
|
+
@for (colGroup of _columnsByPin; track colGroup.type) { @if (colGroup.columns.length) {
|
|
1713
1447
|
<div
|
|
1714
1448
|
class="datatable-row-{{ colGroup.type }} datatable-row-group"
|
|
1715
1449
|
[style.width.px]="_columnGroupWidths[colGroup.type]"
|
|
1716
|
-
[class.row-disabled]="
|
|
1450
|
+
[class.row-disabled]="disabled"
|
|
1717
1451
|
>
|
|
1718
1452
|
@for (column of colGroup.columns; track column.$$id; let ii = $index) {
|
|
1719
1453
|
<datatable-body-cell
|
|
@@ -1727,29 +1461,25 @@ class DataTableBodyRowComponent {
|
|
|
1727
1461
|
[column]="column"
|
|
1728
1462
|
[rowHeight]="rowHeight"
|
|
1729
1463
|
[displayCheck]="displayCheck"
|
|
1730
|
-
[
|
|
1464
|
+
[disabled]="disabled"
|
|
1731
1465
|
[treeStatus]="treeStatus"
|
|
1732
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
1733
1466
|
(activate)="onActivate($event, ii)"
|
|
1734
1467
|
(treeAction)="onTreeAction()"
|
|
1735
1468
|
>
|
|
1736
1469
|
</datatable-body-cell>
|
|
1737
1470
|
}
|
|
1738
1471
|
</div>
|
|
1739
|
-
}
|
|
1740
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DataTableBodyCellComponent, selector: "datatable-body-cell", inputs: ["displayCheck", "
|
|
1472
|
+
} }
|
|
1473
|
+
`, isInline: true, styles: [":host{display:flex;outline:none}:host-context(ngx-datatable.fixed-row) :host{white-space:nowrap}.datatable-row-group{display:flex;position:relative}\n"], dependencies: [{ kind: "component", type: DataTableBodyCellComponent, selector: "datatable-body-cell", inputs: ["displayCheck", "disabled", "group", "rowHeight", "isSelected", "expanded", "rowIndex", "column", "row", "sorts", "treeStatus"], outputs: ["activate", "treeAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1741
1474
|
}
|
|
1742
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyRowComponent, decorators: [{
|
|
1743
1476
|
type: Component,
|
|
1744
|
-
args: [{
|
|
1745
|
-
|
|
1746
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1747
|
-
template: `
|
|
1748
|
-
@for (colGroup of _columnsByPin; track colGroup.type; let i = $index) {
|
|
1477
|
+
args: [{ selector: 'datatable-body-row', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1478
|
+
@for (colGroup of _columnsByPin; track colGroup.type) { @if (colGroup.columns.length) {
|
|
1749
1479
|
<div
|
|
1750
1480
|
class="datatable-row-{{ colGroup.type }} datatable-row-group"
|
|
1751
1481
|
[style.width.px]="_columnGroupWidths[colGroup.type]"
|
|
1752
|
-
[class.row-disabled]="
|
|
1482
|
+
[class.row-disabled]="disabled"
|
|
1753
1483
|
>
|
|
1754
1484
|
@for (column of colGroup.columns; track column.$$id; let ii = $index) {
|
|
1755
1485
|
<datatable-body-cell
|
|
@@ -1763,19 +1493,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1763
1493
|
[column]="column"
|
|
1764
1494
|
[rowHeight]="rowHeight"
|
|
1765
1495
|
[displayCheck]="displayCheck"
|
|
1766
|
-
[
|
|
1496
|
+
[disabled]="disabled"
|
|
1767
1497
|
[treeStatus]="treeStatus"
|
|
1768
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
1769
1498
|
(activate)="onActivate($event, ii)"
|
|
1770
1499
|
(treeAction)="onTreeAction()"
|
|
1771
1500
|
>
|
|
1772
1501
|
</datatable-body-cell>
|
|
1773
1502
|
}
|
|
1774
1503
|
</div>
|
|
1775
|
-
}
|
|
1776
|
-
`,
|
|
1777
|
-
imports: [DataTableBodyCellComponent, AsyncPipe]
|
|
1778
|
-
}]
|
|
1504
|
+
} }
|
|
1505
|
+
`, imports: [DataTableBodyCellComponent], styles: [":host{display:flex;outline:none}:host-context(ngx-datatable.fixed-row) :host{white-space:nowrap}.datatable-row-group{display:flex;position:relative}\n"] }]
|
|
1779
1506
|
}], propDecorators: { columns: [{
|
|
1780
1507
|
type: Input
|
|
1781
1508
|
}], innerWidth: [{
|
|
@@ -1796,13 +1523,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1796
1523
|
type: Input
|
|
1797
1524
|
}], treeStatus: [{
|
|
1798
1525
|
type: Input
|
|
1799
|
-
}], ghostLoadingIndicator: [{
|
|
1800
|
-
type: Input
|
|
1801
1526
|
}], verticalScrollVisible: [{
|
|
1802
1527
|
type: Input
|
|
1803
|
-
}],
|
|
1804
|
-
type: Input
|
|
1805
|
-
}], offsetX: [{
|
|
1528
|
+
}], disabled: [{
|
|
1806
1529
|
type: Input
|
|
1807
1530
|
}], cssClass: [{
|
|
1808
1531
|
type: HostBinding,
|
|
@@ -1827,6 +1550,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1827
1550
|
args: ['mouseenter', ['$event']]
|
|
1828
1551
|
}] } });
|
|
1829
1552
|
|
|
1553
|
+
/**
|
|
1554
|
+
* Extracts the position (x, y coordinates) from a MouseEvent or TouchEvent.
|
|
1555
|
+
*
|
|
1556
|
+
* @param {MouseEvent | TouchEvent} event - The event object from which to extract the position. Can be either a MouseEvent or a TouchEvent.
|
|
1557
|
+
* @return {{ x: number, y: number }} An object containing the x and y coordinates of the event relative to the viewport.
|
|
1558
|
+
*/
|
|
1559
|
+
function getPositionFromEvent(event) {
|
|
1560
|
+
return event instanceof MouseEvent ? event : event.changedTouches[0];
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1830
1563
|
/**
|
|
1831
1564
|
* Draggable Directive for Angular2
|
|
1832
1565
|
*
|
|
@@ -1871,17 +1604,18 @@ class DraggableDirective {
|
|
|
1871
1604
|
}
|
|
1872
1605
|
}
|
|
1873
1606
|
onMousedown(event) {
|
|
1607
|
+
const isMouse = event instanceof MouseEvent;
|
|
1874
1608
|
// we only want to drag the inner header text
|
|
1875
1609
|
const isDragElm = event.target.classList.contains('draggable');
|
|
1876
1610
|
if (isDragElm && (this.dragX || this.dragY)) {
|
|
1877
1611
|
event.preventDefault();
|
|
1878
1612
|
this.isDragging = true;
|
|
1879
|
-
const mouseDownPos =
|
|
1880
|
-
const mouseup = fromEvent(document, 'mouseup');
|
|
1881
|
-
this.subscription = mouseup.subscribe(
|
|
1882
|
-
const mouseMoveSub = fromEvent(document, 'mousemove')
|
|
1613
|
+
const mouseDownPos = getPositionFromEvent(event);
|
|
1614
|
+
const mouseup = fromEvent(document, isMouse ? 'mouseup' : 'touchend');
|
|
1615
|
+
this.subscription = mouseup.subscribe(ev => this.onMouseup(ev));
|
|
1616
|
+
const mouseMoveSub = fromEvent(document, isMouse ? 'mousemove' : 'touchmove')
|
|
1883
1617
|
.pipe(takeUntil(mouseup))
|
|
1884
|
-
.subscribe(
|
|
1618
|
+
.subscribe(ev => this.move(ev, mouseDownPos));
|
|
1885
1619
|
this.subscription.add(mouseMoveSub);
|
|
1886
1620
|
this.dragStart.emit({
|
|
1887
1621
|
event,
|
|
@@ -1894,8 +1628,9 @@ class DraggableDirective {
|
|
|
1894
1628
|
if (!this.isDragging) {
|
|
1895
1629
|
return;
|
|
1896
1630
|
}
|
|
1897
|
-
const
|
|
1898
|
-
const
|
|
1631
|
+
const { clientX, clientY } = getPositionFromEvent(event);
|
|
1632
|
+
const x = clientX - mouseDownPos.clientX;
|
|
1633
|
+
const y = clientY - mouseDownPos.clientY;
|
|
1899
1634
|
if (this.dragX) {
|
|
1900
1635
|
this.element.style.left = `${x}px`;
|
|
1901
1636
|
}
|
|
@@ -1915,14 +1650,13 @@ class DraggableDirective {
|
|
|
1915
1650
|
this.subscription = undefined;
|
|
1916
1651
|
}
|
|
1917
1652
|
}
|
|
1918
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1919
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
1653
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DraggableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1654
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.5", type: DraggableDirective, isStandalone: true, selector: "[draggable]", inputs: { dragEventTarget: "dragEventTarget", dragModel: "dragModel", dragX: ["dragX", "dragX", booleanAttribute], dragY: ["dragY", "dragY", booleanAttribute] }, outputs: { dragStart: "dragStart", dragging: "dragging", dragEnd: "dragEnd" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1920
1655
|
}
|
|
1921
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DraggableDirective, decorators: [{
|
|
1922
1657
|
type: Directive,
|
|
1923
1658
|
args: [{
|
|
1924
|
-
selector: '[draggable]'
|
|
1925
|
-
standalone: true
|
|
1659
|
+
selector: '[draggable]'
|
|
1926
1660
|
}]
|
|
1927
1661
|
}], propDecorators: { dragEventTarget: [{
|
|
1928
1662
|
type: Input
|
|
@@ -1950,23 +1684,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1950
1684
|
class DatatableRowDefComponent {
|
|
1951
1685
|
constructor() {
|
|
1952
1686
|
this.rowDef = inject(RowDefToken);
|
|
1687
|
+
this.rowContext = {
|
|
1688
|
+
...this.rowDef.rowDefInternal,
|
|
1689
|
+
disabled: this.rowDef.rowDefInternalDisabled
|
|
1690
|
+
};
|
|
1953
1691
|
}
|
|
1954
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1955
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1692
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1693
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DatatableRowDefComponent, isStandalone: true, selector: "datatable-row-def", ngImport: i0, template: `@if (rowDef.rowDefInternal.rowTemplate) {
|
|
1956
1694
|
<ng-container
|
|
1957
1695
|
[ngTemplateOutlet]="rowDef.rowDefInternal.rowTemplate"
|
|
1958
|
-
[ngTemplateOutletContext]="
|
|
1696
|
+
[ngTemplateOutletContext]="rowContext"
|
|
1959
1697
|
/>
|
|
1960
1698
|
}`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
1961
1699
|
}
|
|
1962
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefComponent, decorators: [{
|
|
1963
1701
|
type: Component,
|
|
1964
1702
|
args: [{
|
|
1965
1703
|
selector: 'datatable-row-def',
|
|
1966
1704
|
template: `@if (rowDef.rowDefInternal.rowTemplate) {
|
|
1967
1705
|
<ng-container
|
|
1968
1706
|
[ngTemplateOutlet]="rowDef.rowDefInternal.rowTemplate"
|
|
1969
|
-
[ngTemplateOutletContext]="
|
|
1707
|
+
[ngTemplateOutletContext]="rowContext"
|
|
1970
1708
|
/>
|
|
1971
1709
|
}`,
|
|
1972
1710
|
imports: [NgTemplateOutlet]
|
|
@@ -1976,14 +1714,13 @@ class DatatableRowDefDirective {
|
|
|
1976
1714
|
static ngTemplateContextGuard(_dir, ctx) {
|
|
1977
1715
|
return true;
|
|
1978
1716
|
}
|
|
1979
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1980
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1717
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1718
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableRowDefDirective, isStandalone: true, selector: "[rowDef]", ngImport: i0 }); }
|
|
1981
1719
|
}
|
|
1982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefDirective, decorators: [{
|
|
1983
1721
|
type: Directive,
|
|
1984
1722
|
args: [{
|
|
1985
|
-
selector: '[rowDef]'
|
|
1986
|
-
standalone: true
|
|
1723
|
+
selector: '[rowDef]'
|
|
1987
1724
|
}]
|
|
1988
1725
|
}] });
|
|
1989
1726
|
/**
|
|
@@ -2007,17 +1744,18 @@ class DatatableRowDefInternalDirective {
|
|
|
2007
1744
|
})
|
|
2008
1745
|
});
|
|
2009
1746
|
}
|
|
2010
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2011
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1747
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefInternalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1748
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableRowDefInternalDirective, isStandalone: true, selector: "[rowDefInternal]", inputs: { rowDefInternal: "rowDefInternal", rowDefInternalDisabled: "rowDefInternalDisabled" }, ngImport: i0 }); }
|
|
2012
1749
|
}
|
|
2013
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableRowDefInternalDirective, decorators: [{
|
|
2014
1751
|
type: Directive,
|
|
2015
1752
|
args: [{
|
|
2016
|
-
selector: '[rowDefInternal]'
|
|
2017
|
-
standalone: true
|
|
1753
|
+
selector: '[rowDefInternal]'
|
|
2018
1754
|
}]
|
|
2019
1755
|
}], propDecorators: { rowDefInternal: [{
|
|
2020
1756
|
type: Input
|
|
1757
|
+
}], rowDefInternalDisabled: [{
|
|
1758
|
+
type: Input
|
|
2021
1759
|
}] } });
|
|
2022
1760
|
const RowDefToken = new InjectionToken('RowDef');
|
|
2023
1761
|
|
|
@@ -2038,63 +1776,43 @@ class DataTableRowWrapperComponent {
|
|
|
2038
1776
|
this.iterableDiffers = inject(IterableDiffers);
|
|
2039
1777
|
this.tableComponent = inject(DatatableComponentToken);
|
|
2040
1778
|
this.cd = inject(ChangeDetectorRef);
|
|
2041
|
-
this.group = computed(() => {
|
|
2042
|
-
if (typeof this.row === 'object' && 'value' in this.row) {
|
|
2043
|
-
return this.row;
|
|
2044
|
-
}
|
|
2045
|
-
});
|
|
2046
1779
|
}
|
|
2047
1780
|
ngOnInit() {
|
|
2048
|
-
if (this.disableCheck) {
|
|
2049
|
-
const isRowDisabled = this.disableCheck(this.row);
|
|
2050
|
-
this.disable$ = new BehaviorSubject(isRowDisabled);
|
|
2051
|
-
this.rowContext.disableRow$ = this.disable$;
|
|
2052
|
-
}
|
|
2053
1781
|
this.selectedRowsDiffer = this.iterableDiffers.find(this.selected ?? []).create();
|
|
2054
1782
|
}
|
|
2055
1783
|
ngOnChanges(changes) {
|
|
2056
1784
|
if (changes['row']) {
|
|
2057
1785
|
// this component renders either a group header or a row. Never both.
|
|
2058
1786
|
if (this.isGroup(this.row)) {
|
|
2059
|
-
this.
|
|
1787
|
+
this.context = {
|
|
2060
1788
|
group: this.row,
|
|
2061
1789
|
expanded: this.expanded,
|
|
2062
1790
|
rowIndex: this.rowIndex
|
|
2063
1791
|
};
|
|
2064
1792
|
}
|
|
2065
1793
|
else {
|
|
2066
|
-
this.
|
|
1794
|
+
this.context = {
|
|
2067
1795
|
row: this.row,
|
|
2068
1796
|
expanded: this.expanded,
|
|
2069
1797
|
rowIndex: this.rowIndex,
|
|
2070
|
-
|
|
1798
|
+
disabled: this.disabled
|
|
2071
1799
|
};
|
|
2072
1800
|
}
|
|
2073
1801
|
}
|
|
2074
1802
|
if (changes['rowIndex']) {
|
|
2075
|
-
|
|
1803
|
+
this.context.rowIndex = this.rowIndex;
|
|
2076
1804
|
}
|
|
2077
1805
|
if (changes['expanded']) {
|
|
2078
|
-
|
|
2079
|
-
if (this.rowContext) {
|
|
2080
|
-
this.rowContext.expanded = this.expanded;
|
|
2081
|
-
}
|
|
1806
|
+
this.context.expanded = this.expanded;
|
|
2082
1807
|
}
|
|
2083
1808
|
}
|
|
2084
1809
|
ngDoCheck() {
|
|
2085
|
-
if (this.disableCheck) {
|
|
2086
|
-
const isRowDisabled = this.disableCheck(this.row);
|
|
2087
|
-
if (isRowDisabled !== this.disable$.value) {
|
|
2088
|
-
this.disable$.next(isRowDisabled);
|
|
2089
|
-
this.cd.markForCheck();
|
|
2090
|
-
}
|
|
2091
|
-
}
|
|
2092
1810
|
if (this.rowDiffer.diff(this.row)) {
|
|
2093
|
-
if (this.
|
|
2094
|
-
this.
|
|
1811
|
+
if ('group' in this.context) {
|
|
1812
|
+
this.context.group = this.row;
|
|
2095
1813
|
}
|
|
2096
1814
|
else {
|
|
2097
|
-
this.
|
|
1815
|
+
this.context.row = this.row;
|
|
2098
1816
|
}
|
|
2099
1817
|
this.cd.markForCheck();
|
|
2100
1818
|
}
|
|
@@ -2102,10 +1820,13 @@ class DataTableRowWrapperComponent {
|
|
|
2102
1820
|
// on currently selected rows to check if it is modified
|
|
2103
1821
|
// if any of the row of this group is not present in `selected` rows array
|
|
2104
1822
|
// mark group header checkbox state as indeterminate
|
|
2105
|
-
if (this.
|
|
2106
|
-
|
|
1823
|
+
if (this.isGroup(this.row) &&
|
|
1824
|
+
this.groupHeader?.checkboxable &&
|
|
1825
|
+
this.selectedRowsDiffer.diff(this.selected)) {
|
|
1826
|
+
const thisRow = this.row;
|
|
1827
|
+
const selectedRows = this.selected.filter(row => thisRow.value.find((item) => item === row));
|
|
2107
1828
|
if (this.checkBoxInput) {
|
|
2108
|
-
if (selectedRows.length && selectedRows.length !== this.
|
|
1829
|
+
if (selectedRows.length && selectedRows.length !== this.row.value.length) {
|
|
2109
1830
|
this.checkBoxInput.nativeElement.indeterminate = true;
|
|
2110
1831
|
}
|
|
2111
1832
|
else {
|
|
@@ -2118,14 +1839,14 @@ class DataTableRowWrapperComponent {
|
|
|
2118
1839
|
onContextmenu($event) {
|
|
2119
1840
|
this.rowContextmenu.emit({ event: $event, row: this.row });
|
|
2120
1841
|
}
|
|
2121
|
-
onCheckboxChange(groupSelected) {
|
|
1842
|
+
onCheckboxChange(groupSelected, group) {
|
|
2122
1843
|
// First remove all rows of this group from `selected`
|
|
2123
1844
|
this.selected = [
|
|
2124
|
-
...this.selected.filter(row => !
|
|
1845
|
+
...this.selected.filter(row => !group.value.find((item) => item === row))
|
|
2125
1846
|
];
|
|
2126
1847
|
// If checkbox is checked then add all rows of this group in `selected`
|
|
2127
1848
|
if (groupSelected) {
|
|
2128
|
-
this.selected = [...this.selected, ...
|
|
1849
|
+
this.selected = [...this.selected, ...group.value];
|
|
2129
1850
|
}
|
|
2130
1851
|
// Update `selected` of DatatableComponent with newly evaluated `selected`
|
|
2131
1852
|
this.tableComponent.selected = [...this.selected];
|
|
@@ -2137,30 +1858,30 @@ class DataTableRowWrapperComponent {
|
|
|
2137
1858
|
isGroup(row) {
|
|
2138
1859
|
return !!this.groupHeader;
|
|
2139
1860
|
}
|
|
2140
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2141
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2142
|
-
@if (groupHeader?.template) {
|
|
1861
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableRowWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1862
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableRowWrapperComponent, isStandalone: true, selector: "datatable-row-wrapper", inputs: { innerWidth: "innerWidth", rowDetail: "rowDetail", groupHeader: "groupHeader", offsetX: "offsetX", detailRowHeight: "detailRowHeight", groupHeaderRowHeight: "groupHeaderRowHeight", row: "row", groupedRows: "groupedRows", selected: "selected", disabled: "disabled", rowIndex: "rowIndex", expanded: ["expanded", "expanded", booleanAttribute] }, outputs: { rowContextmenu: "rowContextmenu" }, host: { listeners: { "contextmenu": "onContextmenu($event)" }, classAttribute: "datatable-row-wrapper" }, viewQueries: [{ propertyName: "checkBoxInput", first: true, predicate: ["select"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
1863
|
+
@if (isGroup(row) && groupHeader?.template) {
|
|
2143
1864
|
<div
|
|
2144
1865
|
class="datatable-group-header"
|
|
2145
1866
|
[style.height.px]="groupHeaderRowHeight"
|
|
2146
1867
|
[style.width.px]="innerWidth"
|
|
2147
1868
|
>
|
|
2148
1869
|
<div class="datatable-group-cell">
|
|
2149
|
-
@if (groupHeader
|
|
1870
|
+
@if (groupHeader!.checkboxable) {
|
|
2150
1871
|
<div>
|
|
2151
1872
|
<label class="datatable-checkbox">
|
|
2152
1873
|
<input
|
|
2153
1874
|
#select
|
|
2154
1875
|
type="checkbox"
|
|
2155
|
-
[checked]="selectedGroupRows().length ===
|
|
2156
|
-
(change)="onCheckboxChange(select.checked)"
|
|
1876
|
+
[checked]="selectedGroupRows().length === row.value.length"
|
|
1877
|
+
(change)="onCheckboxChange(select.checked, row)"
|
|
2157
1878
|
/>
|
|
2158
1879
|
</label>
|
|
2159
1880
|
</div>
|
|
2160
1881
|
}
|
|
2161
1882
|
<ng-template
|
|
2162
|
-
[ngTemplateOutlet]="groupHeader
|
|
2163
|
-
[ngTemplateOutletContext]="
|
|
1883
|
+
[ngTemplateOutlet]="groupHeader!.template!"
|
|
1884
|
+
[ngTemplateOutletContext]="context"
|
|
2164
1885
|
>
|
|
2165
1886
|
</ng-template>
|
|
2166
1887
|
</div>
|
|
@@ -2169,40 +1890,37 @@ class DataTableRowWrapperComponent {
|
|
|
2169
1890
|
<ng-content> </ng-content>
|
|
2170
1891
|
} @if (rowDetail?.template && expanded) {
|
|
2171
1892
|
<div [style.height.px]="detailRowHeight" class="datatable-row-detail">
|
|
2172
|
-
<ng-template [ngTemplateOutlet]="rowDetail
|
|
1893
|
+
<ng-template [ngTemplateOutlet]="rowDetail!.template!" [ngTemplateOutletContext]="context">
|
|
2173
1894
|
</ng-template>
|
|
2174
1895
|
</div>
|
|
2175
1896
|
}
|
|
2176
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1897
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column}.datatable-row-detail{overflow-y:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2177
1898
|
}
|
|
2178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableRowWrapperComponent, decorators: [{
|
|
2179
1900
|
type: Component,
|
|
2180
|
-
args: [{
|
|
2181
|
-
|
|
2182
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2183
|
-
template: `
|
|
2184
|
-
@if (groupHeader?.template) {
|
|
1901
|
+
args: [{ selector: 'datatable-row-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1902
|
+
@if (isGroup(row) && groupHeader?.template) {
|
|
2185
1903
|
<div
|
|
2186
1904
|
class="datatable-group-header"
|
|
2187
1905
|
[style.height.px]="groupHeaderRowHeight"
|
|
2188
1906
|
[style.width.px]="innerWidth"
|
|
2189
1907
|
>
|
|
2190
1908
|
<div class="datatable-group-cell">
|
|
2191
|
-
@if (groupHeader
|
|
1909
|
+
@if (groupHeader!.checkboxable) {
|
|
2192
1910
|
<div>
|
|
2193
1911
|
<label class="datatable-checkbox">
|
|
2194
1912
|
<input
|
|
2195
1913
|
#select
|
|
2196
1914
|
type="checkbox"
|
|
2197
|
-
[checked]="selectedGroupRows().length ===
|
|
2198
|
-
(change)="onCheckboxChange(select.checked)"
|
|
1915
|
+
[checked]="selectedGroupRows().length === row.value.length"
|
|
1916
|
+
(change)="onCheckboxChange(select.checked, row)"
|
|
2199
1917
|
/>
|
|
2200
1918
|
</label>
|
|
2201
1919
|
</div>
|
|
2202
1920
|
}
|
|
2203
1921
|
<ng-template
|
|
2204
|
-
[ngTemplateOutlet]="groupHeader
|
|
2205
|
-
[ngTemplateOutletContext]="
|
|
1922
|
+
[ngTemplateOutlet]="groupHeader!.template!"
|
|
1923
|
+
[ngTemplateOutletContext]="context"
|
|
2206
1924
|
>
|
|
2207
1925
|
</ng-template>
|
|
2208
1926
|
</div>
|
|
@@ -2211,16 +1929,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
2211
1929
|
<ng-content> </ng-content>
|
|
2212
1930
|
} @if (rowDetail?.template && expanded) {
|
|
2213
1931
|
<div [style.height.px]="detailRowHeight" class="datatable-row-detail">
|
|
2214
|
-
<ng-template [ngTemplateOutlet]="rowDetail
|
|
1932
|
+
<ng-template [ngTemplateOutlet]="rowDetail!.template!" [ngTemplateOutletContext]="context">
|
|
2215
1933
|
</ng-template>
|
|
2216
1934
|
</div>
|
|
2217
1935
|
}
|
|
2218
|
-
`,
|
|
2219
|
-
host: {
|
|
1936
|
+
`, host: {
|
|
2220
1937
|
class: 'datatable-row-wrapper'
|
|
2221
|
-
},
|
|
2222
|
-
imports: [NgTemplateOutlet]
|
|
2223
|
-
}]
|
|
1938
|
+
}, imports: [NgTemplateOutlet], styles: [":host{display:flex;flex-direction:column}.datatable-row-detail{overflow-y:hidden}\n"] }]
|
|
2224
1939
|
}], propDecorators: { checkBoxInput: [{
|
|
2225
1940
|
type: ViewChild,
|
|
2226
1941
|
args: ['select']
|
|
@@ -2240,10 +1955,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
2240
1955
|
type: Input
|
|
2241
1956
|
}], groupedRows: [{
|
|
2242
1957
|
type: Input
|
|
2243
|
-
}], disableCheck: [{
|
|
2244
|
-
type: Input
|
|
2245
1958
|
}], selected: [{
|
|
2246
1959
|
type: Input
|
|
1960
|
+
}], disabled: [{
|
|
1961
|
+
type: Input
|
|
2247
1962
|
}], rowContextmenu: [{
|
|
2248
1963
|
type: Output
|
|
2249
1964
|
}], rowIndex: [{
|
|
@@ -2267,14 +1982,14 @@ function defaultSumFunc(cells) {
|
|
|
2267
1982
|
return cellsWithValues.reduce((res, cell) => res + cell);
|
|
2268
1983
|
}
|
|
2269
1984
|
function noopSumFunc(cells) {
|
|
2270
|
-
return
|
|
1985
|
+
return;
|
|
2271
1986
|
}
|
|
2272
1987
|
class DataTableSummaryRowComponent {
|
|
2273
1988
|
constructor() {
|
|
2274
1989
|
this.summaryRow = {};
|
|
2275
1990
|
}
|
|
2276
1991
|
ngOnChanges() {
|
|
2277
|
-
if (!this.columns || !this.rows) {
|
|
1992
|
+
if (!this.columns.length || !this.rows.length) {
|
|
2278
1993
|
return;
|
|
2279
1994
|
}
|
|
2280
1995
|
this.updateInternalColumns();
|
|
@@ -2289,7 +2004,7 @@ class DataTableSummaryRowComponent {
|
|
|
2289
2004
|
updateValues() {
|
|
2290
2005
|
this.summaryRow = {};
|
|
2291
2006
|
this.columns
|
|
2292
|
-
.filter(col => !col.summaryTemplate)
|
|
2007
|
+
.filter(col => !col.summaryTemplate && col.prop)
|
|
2293
2008
|
.forEach(col => {
|
|
2294
2009
|
const cellsFromSingleColumn = this.rows.map(row => row[col.prop]);
|
|
2295
2010
|
const sumFunc = this.getSummaryFunction(col);
|
|
@@ -2309,23 +2024,22 @@ class DataTableSummaryRowComponent {
|
|
|
2309
2024
|
return column.summaryFunc;
|
|
2310
2025
|
}
|
|
2311
2026
|
}
|
|
2312
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2313
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2027
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableSummaryRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2028
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableSummaryRowComponent, isStandalone: true, selector: "datatable-summary-row", inputs: { rows: "rows", columns: "columns", rowHeight: "rowHeight", innerWidth: "innerWidth" }, host: { classAttribute: "datatable-summary-row" }, usesOnChanges: true, ngImport: i0, template: `
|
|
2314
2029
|
@if (summaryRow && _internalColumns) {
|
|
2315
2030
|
<datatable-body-row
|
|
2316
2031
|
tabindex="-1"
|
|
2317
2032
|
[innerWidth]="innerWidth"
|
|
2318
|
-
[offsetX]="offsetX"
|
|
2319
2033
|
[columns]="_internalColumns"
|
|
2320
2034
|
[rowHeight]="rowHeight"
|
|
2321
2035
|
[row]="summaryRow"
|
|
2322
|
-
[rowIndex]="-1"
|
|
2036
|
+
[rowIndex]="{ index: -1 }"
|
|
2323
2037
|
>
|
|
2324
2038
|
</datatable-body-row>
|
|
2325
2039
|
}
|
|
2326
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DataTableBodyRowComponent, selector: "datatable-body-row", inputs: ["columns", "innerWidth", "expanded", "rowClass", "row", "group", "isSelected", "rowIndex", "displayCheck", "treeStatus", "
|
|
2040
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DataTableBodyRowComponent, selector: "datatable-body-row", inputs: ["columns", "innerWidth", "expanded", "rowClass", "row", "group", "isSelected", "rowIndex", "displayCheck", "treeStatus", "verticalScrollVisible", "disabled", "rowHeight"], outputs: ["activate", "treeAction"] }] }); }
|
|
2327
2041
|
}
|
|
2328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableSummaryRowComponent, decorators: [{
|
|
2329
2043
|
type: Component,
|
|
2330
2044
|
args: [{
|
|
2331
2045
|
selector: 'datatable-summary-row',
|
|
@@ -2334,11 +2048,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
2334
2048
|
<datatable-body-row
|
|
2335
2049
|
tabindex="-1"
|
|
2336
2050
|
[innerWidth]="innerWidth"
|
|
2337
|
-
[offsetX]="offsetX"
|
|
2338
2051
|
[columns]="_internalColumns"
|
|
2339
2052
|
[rowHeight]="rowHeight"
|
|
2340
2053
|
[row]="summaryRow"
|
|
2341
|
-
[rowIndex]="-1"
|
|
2054
|
+
[rowIndex]="{ index: -1 }"
|
|
2342
2055
|
>
|
|
2343
2056
|
</datatable-body-row>
|
|
2344
2057
|
}
|
|
@@ -2354,12 +2067,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
2354
2067
|
type: Input
|
|
2355
2068
|
}], rowHeight: [{
|
|
2356
2069
|
type: Input
|
|
2357
|
-
}], offsetX: [{
|
|
2358
|
-
type: Input
|
|
2359
2070
|
}], innerWidth: [{
|
|
2360
2071
|
type: Input
|
|
2361
2072
|
}] } });
|
|
2362
2073
|
|
|
2074
|
+
class DataTableGhostLoaderComponent {
|
|
2075
|
+
constructor() {
|
|
2076
|
+
this.cellMode = false;
|
|
2077
|
+
}
|
|
2078
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableGhostLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2079
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableGhostLoaderComponent, isStandalone: true, selector: "ghost-loader", inputs: { columns: "columns", pageSize: ["pageSize", "pageSize", numberAttribute], rowHeight: "rowHeight", ghostBodyHeight: ["ghostBodyHeight", "ghostBodyHeight", numberAttribute], cellMode: ["cellMode", "cellMode", booleanAttribute] }, ngImport: i0, template: "<div [style.height.px]=\"ghostBodyHeight\" class=\"ghost-loader ghost-cell-container\">\n @for (item of [].constructor(pageSize); track item) {\n <div [style.height.px]=\"rowHeight\" class=\"ghost-element\" [class.datatable-body-row]=\"cellMode\">\n @for (col of columns; track col) {\n <div class=\"ghost-cell\" [class.datatable-body-cell]=\"cellMode\" [style.width.px]=\"col.width\">\n @if (!col.ghostCellTemplate) {\n <div class=\"line ghost-cell-strip\"></div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"col.ghostCellTemplate\"></ng-template>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@keyframes ghost{0%{background-position:0vw 0}to{background-position:100vw 0}}.ghost-loader{overflow:hidden}.ghost-loader .line{width:100%;height:12px;animation-name:ghost;animation-iteration-count:infinite;animation-timing-function:linear}.ghost-loader .ghost-element{display:flex;align-items:center}:host.ghost-overlay{position:sticky;top:20px}:host.ghost-overlay .ghost-cell{padding-inline:1.2rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2080
|
+
}
|
|
2081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableGhostLoaderComponent, decorators: [{
|
|
2082
|
+
type: Component,
|
|
2083
|
+
args: [{ selector: `ghost-loader`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div [style.height.px]=\"ghostBodyHeight\" class=\"ghost-loader ghost-cell-container\">\n @for (item of [].constructor(pageSize); track item) {\n <div [style.height.px]=\"rowHeight\" class=\"ghost-element\" [class.datatable-body-row]=\"cellMode\">\n @for (col of columns; track col) {\n <div class=\"ghost-cell\" [class.datatable-body-cell]=\"cellMode\" [style.width.px]=\"col.width\">\n @if (!col.ghostCellTemplate) {\n <div class=\"line ghost-cell-strip\"></div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"col.ghostCellTemplate\"></ng-template>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@keyframes ghost{0%{background-position:0vw 0}to{background-position:100vw 0}}.ghost-loader{overflow:hidden}.ghost-loader .line{width:100%;height:12px;animation-name:ghost;animation-iteration-count:infinite;animation-timing-function:linear}.ghost-loader .ghost-element{display:flex;align-items:center}:host.ghost-overlay{position:sticky;top:20px}:host.ghost-overlay .ghost-cell{padding-inline:1.2rem}\n"] }]
|
|
2084
|
+
}], propDecorators: { columns: [{
|
|
2085
|
+
type: Input
|
|
2086
|
+
}], pageSize: [{
|
|
2087
|
+
type: Input,
|
|
2088
|
+
args: [{ transform: numberAttribute }]
|
|
2089
|
+
}], rowHeight: [{
|
|
2090
|
+
type: Input
|
|
2091
|
+
}], ghostBodyHeight: [{
|
|
2092
|
+
type: Input,
|
|
2093
|
+
args: [{ transform: numberAttribute }]
|
|
2094
|
+
}], cellMode: [{
|
|
2095
|
+
type: Input,
|
|
2096
|
+
args: [{ transform: booleanAttribute }]
|
|
2097
|
+
}] } });
|
|
2098
|
+
|
|
2099
|
+
class DatatableBodyRowDirective {
|
|
2100
|
+
static ngTemplateContextGuard(directive, context) {
|
|
2101
|
+
return true;
|
|
2102
|
+
}
|
|
2103
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableBodyRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2104
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: DatatableBodyRowDirective, isStandalone: true, selector: "[ngx-datatable-body-row]", ngImport: i0 }); }
|
|
2105
|
+
}
|
|
2106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableBodyRowDirective, decorators: [{
|
|
2107
|
+
type: Directive,
|
|
2108
|
+
args: [{
|
|
2109
|
+
selector: '[ngx-datatable-body-row]'
|
|
2110
|
+
}]
|
|
2111
|
+
}] });
|
|
2112
|
+
|
|
2363
2113
|
function selectRows(selected, row, comparefn) {
|
|
2364
2114
|
const selectedIndex = comparefn(row, selected);
|
|
2365
2115
|
if (selectedIndex > -1) {
|
|
@@ -2392,7 +2142,7 @@ function selectRowsBetween(selected, rows, index, prevIndex) {
|
|
|
2392
2142
|
if ((reverse && lesser) || (!reverse && greater)) {
|
|
2393
2143
|
// if in the positive range to be added to `selected`, and
|
|
2394
2144
|
// not already in the selected array, add it
|
|
2395
|
-
if (i >= range.start && i <= range.end) {
|
|
2145
|
+
if (i >= range.start && i <= range.end && row) {
|
|
2396
2146
|
selected.push(row);
|
|
2397
2147
|
}
|
|
2398
2148
|
}
|
|
@@ -2400,195 +2150,24 @@ function selectRowsBetween(selected, rows, index, prevIndex) {
|
|
|
2400
2150
|
return selected;
|
|
2401
2151
|
}
|
|
2402
2152
|
|
|
2403
|
-
class
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2153
|
+
class DataTableBodyComponent {
|
|
2154
|
+
set pageSize(val) {
|
|
2155
|
+
if (val !== this._pageSize) {
|
|
2156
|
+
this._pageSize = val;
|
|
2157
|
+
this.recalcLayout();
|
|
2158
|
+
// Emits the page event if page size has been changed
|
|
2159
|
+
this._offsetEvent = -1;
|
|
2160
|
+
this.updatePage('up');
|
|
2161
|
+
this.updatePage('down');
|
|
2411
2162
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
else if (event.key === 'a' && (event.ctrlKey || event.metaKey)) {
|
|
2421
|
-
// select all rows except dummy rows which are added for ghostloader in case of virtual scroll
|
|
2422
|
-
selected = this.rows.filter(rowItem => !!rowItem);
|
|
2423
|
-
}
|
|
2424
|
-
else if (event.ctrlKey || event.metaKey || multiClick || chkbox) {
|
|
2425
|
-
selected = selectRows([...this.selected], row, this.getRowSelectedIdx.bind(this));
|
|
2426
|
-
}
|
|
2427
|
-
else {
|
|
2428
|
-
selected = selectRows([], row, this.getRowSelectedIdx.bind(this));
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
else {
|
|
2432
|
-
selected = selectRows([], row, this.getRowSelectedIdx.bind(this));
|
|
2433
|
-
}
|
|
2434
|
-
if (typeof this.selectCheck === 'function') {
|
|
2435
|
-
selected = selected.filter(this.selectCheck.bind(this));
|
|
2436
|
-
}
|
|
2437
|
-
if (typeof this.disableCheck === 'function') {
|
|
2438
|
-
selected = selected.filter(rowData => !this.disableCheck(rowData));
|
|
2439
|
-
}
|
|
2440
|
-
this.selected.splice(0, this.selected.length);
|
|
2441
|
-
this.selected.push(...selected);
|
|
2442
|
-
this.prevIndex = index;
|
|
2443
|
-
this.select.emit({
|
|
2444
|
-
selected
|
|
2445
|
-
});
|
|
2446
|
-
}
|
|
2447
|
-
onActivate(model, index) {
|
|
2448
|
-
const { type, event, row } = model;
|
|
2449
|
-
const chkbox = this.selectionType === SelectionType.checkbox;
|
|
2450
|
-
const select = (!chkbox && (type === 'click' || type === 'dblclick')) || (chkbox && type === 'checkbox');
|
|
2451
|
-
if (select) {
|
|
2452
|
-
this.selectRow(event, index, row);
|
|
2453
|
-
}
|
|
2454
|
-
else if (type === 'keydown') {
|
|
2455
|
-
if (event.key === Keys.return) {
|
|
2456
|
-
this.selectRow(event, index, row);
|
|
2457
|
-
}
|
|
2458
|
-
else if (event.key === 'a' && (event.ctrlKey || event.metaKey)) {
|
|
2459
|
-
this.selectRow(event, 0, this.rows[this.rows.length - 1]);
|
|
2460
|
-
}
|
|
2461
|
-
else {
|
|
2462
|
-
this.onKeyboardFocus(model);
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
this.activate.emit(model);
|
|
2466
|
-
}
|
|
2467
|
-
onKeyboardFocus(model) {
|
|
2468
|
-
const { key } = model.event;
|
|
2469
|
-
const shouldFocus = key === Keys.up || key === Keys.down || key === Keys.right || key === Keys.left;
|
|
2470
|
-
if (shouldFocus) {
|
|
2471
|
-
const isCellSelection = this.selectionType === SelectionType.cell;
|
|
2472
|
-
if (typeof this.disableCheck === 'function') {
|
|
2473
|
-
const isRowDisabled = this.disableCheck(model.row);
|
|
2474
|
-
if (isRowDisabled) {
|
|
2475
|
-
return;
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
if (!model.cellElement || !isCellSelection) {
|
|
2479
|
-
this.focusRow(model.rowElement, key);
|
|
2480
|
-
}
|
|
2481
|
-
else if (isCellSelection) {
|
|
2482
|
-
this.focusCell(model.cellElement, model.rowElement, key, model.cellIndex);
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
focusRow(rowElement, key) {
|
|
2487
|
-
const nextRowElement = this.getPrevNextRow(rowElement, key);
|
|
2488
|
-
if (nextRowElement) {
|
|
2489
|
-
nextRowElement.focus();
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
getPrevNextRow(rowElement, key) {
|
|
2493
|
-
const parentElement = rowElement.parentElement;
|
|
2494
|
-
if (parentElement) {
|
|
2495
|
-
let focusElement;
|
|
2496
|
-
if (key === Keys.up) {
|
|
2497
|
-
focusElement = parentElement.previousElementSibling;
|
|
2498
|
-
}
|
|
2499
|
-
else if (key === Keys.down) {
|
|
2500
|
-
focusElement = parentElement.nextElementSibling;
|
|
2501
|
-
}
|
|
2502
|
-
if (focusElement && focusElement.children.length) {
|
|
2503
|
-
return focusElement.children[0];
|
|
2504
|
-
}
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
focusCell(cellElement, rowElement, key, cellIndex) {
|
|
2508
|
-
let nextCellElement;
|
|
2509
|
-
if (key === Keys.left) {
|
|
2510
|
-
nextCellElement = cellElement.previousElementSibling;
|
|
2511
|
-
}
|
|
2512
|
-
else if (key === Keys.right) {
|
|
2513
|
-
nextCellElement = cellElement.nextElementSibling;
|
|
2514
|
-
}
|
|
2515
|
-
else if (key === Keys.up || key === Keys.down) {
|
|
2516
|
-
const nextRowElement = this.getPrevNextRow(rowElement, key);
|
|
2517
|
-
if (nextRowElement) {
|
|
2518
|
-
const children = nextRowElement.getElementsByClassName('datatable-body-cell');
|
|
2519
|
-
if (children.length) {
|
|
2520
|
-
nextCellElement = children[cellIndex];
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
if (nextCellElement &&
|
|
2525
|
-
'focus' in nextCellElement &&
|
|
2526
|
-
typeof nextCellElement.focus === 'function') {
|
|
2527
|
-
nextCellElement.focus();
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
getRowSelected(row) {
|
|
2531
|
-
return this.getRowSelectedIdx(row, this.selected) > -1;
|
|
2532
|
-
}
|
|
2533
|
-
getRowSelectedIdx(row, selected) {
|
|
2534
|
-
if (!selected || !selected.length) {
|
|
2535
|
-
return -1;
|
|
2536
|
-
}
|
|
2537
|
-
const rowId = this.rowIdentity(row);
|
|
2538
|
-
return selected.findIndex(r => {
|
|
2539
|
-
const id = this.rowIdentity(r);
|
|
2540
|
-
return id === rowId;
|
|
2541
|
-
});
|
|
2542
|
-
}
|
|
2543
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DataTableSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2544
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: DataTableSelectionComponent, isStandalone: true, selector: "datatable-selection", inputs: { rows: "rows", selected: "selected", selectEnabled: "selectEnabled", selectionType: "selectionType", rowIdentity: "rowIdentity", selectCheck: "selectCheck", disableCheck: "disableCheck" }, outputs: { activate: "activate", select: "select" }, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2545
|
-
}
|
|
2546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DataTableSelectionComponent, decorators: [{
|
|
2547
|
-
type: Component,
|
|
2548
|
-
args: [{
|
|
2549
|
-
selector: 'datatable-selection',
|
|
2550
|
-
template: ` <ng-content></ng-content> `,
|
|
2551
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2552
|
-
standalone: true
|
|
2553
|
-
}]
|
|
2554
|
-
}], propDecorators: { rows: [{
|
|
2555
|
-
type: Input
|
|
2556
|
-
}], selected: [{
|
|
2557
|
-
type: Input
|
|
2558
|
-
}], selectEnabled: [{
|
|
2559
|
-
type: Input
|
|
2560
|
-
}], selectionType: [{
|
|
2561
|
-
type: Input
|
|
2562
|
-
}], rowIdentity: [{
|
|
2563
|
-
type: Input
|
|
2564
|
-
}], selectCheck: [{
|
|
2565
|
-
type: Input
|
|
2566
|
-
}], disableCheck: [{
|
|
2567
|
-
type: Input
|
|
2568
|
-
}], activate: [{
|
|
2569
|
-
type: Output
|
|
2570
|
-
}], select: [{
|
|
2571
|
-
type: Output
|
|
2572
|
-
}] } });
|
|
2573
|
-
|
|
2574
|
-
class DataTableBodyComponent {
|
|
2575
|
-
set pageSize(val) {
|
|
2576
|
-
if (val !== this._pageSize) {
|
|
2577
|
-
this._pageSize = val;
|
|
2578
|
-
this.recalcLayout();
|
|
2579
|
-
// Emits the page event if page size has been changed
|
|
2580
|
-
this._offsetEvent = -1;
|
|
2581
|
-
this.updatePage('up');
|
|
2582
|
-
this.updatePage('down');
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
get pageSize() {
|
|
2586
|
-
return this._pageSize;
|
|
2587
|
-
}
|
|
2588
|
-
set rows(val) {
|
|
2589
|
-
if (val !== this._rows) {
|
|
2590
|
-
this._rows = val;
|
|
2591
|
-
this.recalcLayout();
|
|
2163
|
+
}
|
|
2164
|
+
get pageSize() {
|
|
2165
|
+
return this._pageSize;
|
|
2166
|
+
}
|
|
2167
|
+
set rows(val) {
|
|
2168
|
+
if (val !== this._rows) {
|
|
2169
|
+
this._rows = val;
|
|
2170
|
+
this.recalcLayout();
|
|
2592
2171
|
}
|
|
2593
2172
|
}
|
|
2594
2173
|
get rows() {
|
|
@@ -2607,9 +2186,6 @@ class DataTableBodyComponent {
|
|
|
2607
2186
|
if (val !== this._offset) {
|
|
2608
2187
|
this._offset = val;
|
|
2609
2188
|
if (!this.scrollbarV || (this.scrollbarV && !this.virtualization)) {
|
|
2610
|
-
if (!isNaN(this._offset) && this.ghostLoadingIndicator) {
|
|
2611
|
-
this.rows = [];
|
|
2612
|
-
}
|
|
2613
2189
|
this.recalcLayout();
|
|
2614
2190
|
}
|
|
2615
2191
|
}
|
|
@@ -2663,7 +2239,6 @@ class DataTableBodyComponent {
|
|
|
2663
2239
|
this.page = new EventEmitter();
|
|
2664
2240
|
this.activate = new EventEmitter();
|
|
2665
2241
|
this.select = new EventEmitter();
|
|
2666
|
-
this.detailToggle = new EventEmitter();
|
|
2667
2242
|
this.rowContextmenu = new EventEmitter(false);
|
|
2668
2243
|
this.treeAction = new EventEmitter();
|
|
2669
2244
|
/**
|
|
@@ -2684,7 +2259,6 @@ class DataTableBodyComponent {
|
|
|
2684
2259
|
this.rowHeightsCache = signal(new RowHeightCache());
|
|
2685
2260
|
this.offsetY = 0;
|
|
2686
2261
|
this.indexes = signal({ first: 0, last: 0 });
|
|
2687
|
-
this.rowIndexes = new WeakMap();
|
|
2688
2262
|
this.rowExpansions = [];
|
|
2689
2263
|
this._offsetEvent = -1;
|
|
2690
2264
|
/**
|
|
@@ -2705,83 +2279,30 @@ class DataTableBodyComponent {
|
|
|
2705
2279
|
return typeof rowHeight === 'function' ? rowHeight(row, index) : rowHeight;
|
|
2706
2280
|
};
|
|
2707
2281
|
/**
|
|
2708
|
-
* Calculates the
|
|
2709
|
-
*
|
|
2710
|
-
*
|
|
2711
|
-
*
|
|
2712
|
-
*
|
|
2713
|
-
* transform: translate3d(0px, 0px, 0px); -> row0
|
|
2714
|
-
* transform: translate3d(0px, 30px, 0px); -> row1
|
|
2715
|
-
* transform: translate3d(0px, 130px, 0px); -> row2
|
|
2716
|
-
*
|
|
2717
|
-
* Row heights have to be calculated based on the row heights cache as we wont
|
|
2718
|
-
* be able to determine which row is of what height before hand. In the above
|
|
2719
|
-
* case the positionY of the translate3d for row2 would be the sum of all the
|
|
2720
|
-
* heights of the rows before it (i.e. row0 and row1).
|
|
2721
|
-
*
|
|
2722
|
-
* @returns the CSS3 style to be applied
|
|
2282
|
+
* Calculates the offset of the rendered rows.
|
|
2283
|
+
* As virtual rows are not shown, we have to move all rendered rows
|
|
2284
|
+
* by the total size of previous non-rendered rows.
|
|
2285
|
+
* If each row has a size of 10px and the first 10 rows are not rendered due to scroll,
|
|
2286
|
+
* then we have a renderOffset of 100px.
|
|
2723
2287
|
*/
|
|
2724
|
-
this.
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
styles.width = this.columnGroupWidths.total;
|
|
2731
|
-
}
|
|
2732
|
-
if (this.scrollbarV && this.virtualization) {
|
|
2733
|
-
let idx = 0;
|
|
2734
|
-
if (Array.isArray(rows)) {
|
|
2735
|
-
// Get the latest row rowindex in a group
|
|
2736
|
-
const row = rows[rows.length - 1];
|
|
2737
|
-
idx = row ? this.getRowIndex(row) : 0;
|
|
2738
|
-
}
|
|
2739
|
-
else {
|
|
2740
|
-
if (rows) {
|
|
2741
|
-
idx = this.getRowIndex(rows);
|
|
2742
|
-
}
|
|
2743
|
-
else {
|
|
2744
|
-
// When ghost cells are enabled use index to get the position of them
|
|
2745
|
-
idx = this.indexes().first + index;
|
|
2746
|
-
}
|
|
2747
|
-
}
|
|
2748
|
-
// const pos = idx * rowHeight;
|
|
2749
|
-
// The position of this row would be the sum of all row heights
|
|
2750
|
-
// until the previous row position.
|
|
2751
|
-
styles.transform = `translateY(${this.rowHeightsCache().query(idx - 1)}px)`;
|
|
2752
|
-
}
|
|
2753
|
-
rowsStyles.push(styles);
|
|
2754
|
-
});
|
|
2755
|
-
return rowsStyles;
|
|
2756
|
-
});
|
|
2757
|
-
/**
|
|
2758
|
-
* Calculate bottom summary row offset for scrollbar mode.
|
|
2759
|
-
* For more information about cache and offset calculation
|
|
2760
|
-
* see description for `rowsStyles` signal
|
|
2761
|
-
*
|
|
2762
|
-
* @returns the CSS3 style to be applied
|
|
2763
|
-
*/
|
|
2764
|
-
this.bottomSummaryRowsStyles = computed(() => {
|
|
2765
|
-
if (!this.scrollbarV || !this.rows || !this.rows.length || !this.rowsToRender()) {
|
|
2766
|
-
return null;
|
|
2288
|
+
this.renderOffset = computed(() => {
|
|
2289
|
+
if (this.scrollbarV && this.virtualization) {
|
|
2290
|
+
return `translateY(${this.rowHeightsCache().query(this.indexes().first - 1)}px)`;
|
|
2291
|
+
}
|
|
2292
|
+
else {
|
|
2293
|
+
return '';
|
|
2767
2294
|
}
|
|
2768
|
-
const pos = this.rowHeightsCache().query(this.rows.length - 1);
|
|
2769
|
-
return {
|
|
2770
|
-
transform: `translateY(${pos}px)`,
|
|
2771
|
-
position: 'absolute'
|
|
2772
|
-
};
|
|
2773
2295
|
});
|
|
2774
2296
|
// declare fn here so we can get access to the `this` property
|
|
2775
2297
|
this.rowTrackingFn = (index, row) => {
|
|
2776
2298
|
if (this.ghostLoadingIndicator) {
|
|
2777
2299
|
return index;
|
|
2778
2300
|
}
|
|
2779
|
-
if (this.trackByProp) {
|
|
2301
|
+
if (this.trackByProp && row) {
|
|
2780
2302
|
return row[this.trackByProp];
|
|
2781
2303
|
}
|
|
2782
2304
|
else {
|
|
2783
|
-
|
|
2784
|
-
return idx;
|
|
2305
|
+
return row;
|
|
2785
2306
|
}
|
|
2786
2307
|
};
|
|
2787
2308
|
}
|
|
@@ -2892,46 +2413,14 @@ class DataTableBodyComponent {
|
|
|
2892
2413
|
*/
|
|
2893
2414
|
updateRows() {
|
|
2894
2415
|
const { first, last } = this.indexes();
|
|
2895
|
-
let rowIndex = first;
|
|
2896
|
-
let idx = 0;
|
|
2897
|
-
const temp = [];
|
|
2898
2416
|
// if grouprowsby has been specified treat row paging
|
|
2899
2417
|
// parameters as group paging parameters ie if limit 10 has been
|
|
2900
2418
|
// specified treat it as 10 groups rather than 10 rows
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
if (group.value) {
|
|
2907
|
-
// add indexes for each group item
|
|
2908
|
-
group.value.forEach((g, i) => {
|
|
2909
|
-
const _idx = `${rowIndex}-${i}`;
|
|
2910
|
-
this.rowIndexes.set(g, _idx);
|
|
2911
|
-
});
|
|
2912
|
-
}
|
|
2913
|
-
temp[idx] = group;
|
|
2914
|
-
idx++;
|
|
2915
|
-
// Group index in this context
|
|
2916
|
-
rowIndex++;
|
|
2917
|
-
}
|
|
2918
|
-
}
|
|
2919
|
-
else {
|
|
2920
|
-
while (rowIndex < last && rowIndex < this.rowCount) {
|
|
2921
|
-
const row = this.rows[rowIndex];
|
|
2922
|
-
if (row) {
|
|
2923
|
-
// add indexes for each row
|
|
2924
|
-
this.rowIndexes.set(row, rowIndex);
|
|
2925
|
-
temp[idx] = row;
|
|
2926
|
-
}
|
|
2927
|
-
else if (this.ghostLoadingIndicator && this.virtualization) {
|
|
2928
|
-
temp[idx] = undefined;
|
|
2929
|
-
}
|
|
2930
|
-
idx++;
|
|
2931
|
-
rowIndex++;
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
return temp;
|
|
2419
|
+
const rows = this.groupedRows
|
|
2420
|
+
? this.groupedRows.slice(first, Math.min(last, this.groupedRows.length))
|
|
2421
|
+
: this.rows.slice(first, Math.min(last, this.rowCount));
|
|
2422
|
+
rows.length = last - first;
|
|
2423
|
+
return rows;
|
|
2935
2424
|
}
|
|
2936
2425
|
/**
|
|
2937
2426
|
* Get the row height
|
|
@@ -3013,11 +2502,11 @@ class DataTableBodyComponent {
|
|
|
3013
2502
|
// rows array is changed.
|
|
3014
2503
|
this.rowHeightsCache().clearCache();
|
|
3015
2504
|
// Initialize the tree only if there are rows inside the tree.
|
|
3016
|
-
if (this.rows
|
|
2505
|
+
if (this.rows.length) {
|
|
3017
2506
|
const rowExpansions = new Set();
|
|
3018
2507
|
if (this.rowDetail) {
|
|
3019
2508
|
for (const row of this.rows) {
|
|
3020
|
-
if (this.getRowExpanded(row)) {
|
|
2509
|
+
if (row && this.getRowExpanded(row)) {
|
|
3021
2510
|
rowExpansions.add(row);
|
|
3022
2511
|
}
|
|
3023
2512
|
}
|
|
@@ -3027,27 +2516,13 @@ class DataTableBodyComponent {
|
|
|
3027
2516
|
rowHeight: this.rowHeight,
|
|
3028
2517
|
detailRowHeight: this.getDetailRowHeight,
|
|
3029
2518
|
externalVirtual: this.scrollbarV && this.externalPaging,
|
|
2519
|
+
indexOffset: this.indexes().first,
|
|
3030
2520
|
rowCount: this.rowCount,
|
|
3031
|
-
rowIndexes: this.rowIndexes,
|
|
3032
2521
|
rowExpansions
|
|
3033
2522
|
});
|
|
3034
2523
|
this.rowHeightsCache.set(Object.create(this.rowHeightsCache()));
|
|
3035
2524
|
}
|
|
3036
2525
|
}
|
|
3037
|
-
/**
|
|
3038
|
-
* Gets the index for the view port
|
|
3039
|
-
*/
|
|
3040
|
-
getAdjustedViewPortIndex() {
|
|
3041
|
-
// Capture the row index of the first row that is visible on the viewport.
|
|
3042
|
-
// If the scroll bar is just below the row which is highlighted then make that as the
|
|
3043
|
-
// first index.
|
|
3044
|
-
const viewPortFirstRowIndex = this.indexes().first;
|
|
3045
|
-
if (this.scrollbarV && this.virtualization) {
|
|
3046
|
-
const offsetScroll = this.rowHeightsCache().query(viewPortFirstRowIndex - 1);
|
|
3047
|
-
return offsetScroll <= this.offsetY ? viewPortFirstRowIndex - 1 : viewPortFirstRowIndex;
|
|
3048
|
-
}
|
|
3049
|
-
return viewPortFirstRowIndex;
|
|
3050
|
-
}
|
|
3051
2526
|
/**
|
|
3052
2527
|
* Toggle the Expansion of the row i.e. if the row is expanded then it will
|
|
3053
2528
|
* collapse and vice versa. Note that the expanded status is stored as
|
|
@@ -3055,17 +2530,8 @@ class DataTableBodyComponent {
|
|
|
3055
2530
|
* status in case of sorting and filtering of the row set.
|
|
3056
2531
|
*/
|
|
3057
2532
|
toggleRowExpansion(row) {
|
|
3058
|
-
// Capture the row index of the first row that is visible on the viewport.
|
|
3059
|
-
const viewPortFirstRowIndex = this.getAdjustedViewPortIndex();
|
|
3060
2533
|
const rowExpandedIdx = this.getRowExpandedIdx(row, this.rowExpansions);
|
|
3061
2534
|
const expanded = rowExpandedIdx > -1;
|
|
3062
|
-
// If the detailRowHeight is auto --> only in case of non-virtualized scroll
|
|
3063
|
-
if (this.scrollbarV && this.virtualization) {
|
|
3064
|
-
const detailRowHeight = this.getDetailRowHeight(row) * (expanded ? -1 : 1);
|
|
3065
|
-
// const idx = this.rowIndexes.get(row) || 0;
|
|
3066
|
-
const idx = this.getRowIndex(row);
|
|
3067
|
-
this.rowHeightsCache().update(idx, detailRowHeight);
|
|
3068
|
-
}
|
|
3069
2535
|
// Update the toggled row and update thive nevere heights in the cache.
|
|
3070
2536
|
if (expanded) {
|
|
3071
2537
|
this.rowExpansions.splice(rowExpandedIdx, 1);
|
|
@@ -3073,10 +2539,10 @@ class DataTableBodyComponent {
|
|
|
3073
2539
|
else {
|
|
3074
2540
|
this.rowExpansions.push(row);
|
|
3075
2541
|
}
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
}
|
|
2542
|
+
// If the detailRowHeight is auto --> only in case of non-virtualized scroll
|
|
2543
|
+
if (this.scrollbarV && this.virtualization) {
|
|
2544
|
+
this.refreshRowHeightCache();
|
|
2545
|
+
}
|
|
3080
2546
|
}
|
|
3081
2547
|
/**
|
|
3082
2548
|
* Expand/Collapse all the rows no matter what their state is.
|
|
@@ -3084,8 +2550,6 @@ class DataTableBodyComponent {
|
|
|
3084
2550
|
toggleAllRows(expanded) {
|
|
3085
2551
|
// clear prev expansions
|
|
3086
2552
|
this.rowExpansions = [];
|
|
3087
|
-
// Capture the row index of the first row that is visible on the viewport.
|
|
3088
|
-
const viewPortFirstRowIndex = this.getAdjustedViewPortIndex();
|
|
3089
2553
|
const rows = this.groupedRows ?? this.rows;
|
|
3090
2554
|
if (expanded) {
|
|
3091
2555
|
for (const row of rows) {
|
|
@@ -3096,11 +2560,6 @@ class DataTableBodyComponent {
|
|
|
3096
2560
|
// Refresh the full row heights cache since every row was affected.
|
|
3097
2561
|
this.recalcLayout();
|
|
3098
2562
|
}
|
|
3099
|
-
// Emit all rows that have been expanded.
|
|
3100
|
-
this.detailToggle.emit({
|
|
3101
|
-
rows: rows,
|
|
3102
|
-
currentIndex: viewPortFirstRowIndex
|
|
3103
|
-
});
|
|
3104
2563
|
}
|
|
3105
2564
|
/**
|
|
3106
2565
|
* Recalculates the table
|
|
@@ -3130,12 +2589,6 @@ class DataTableBodyComponent {
|
|
|
3130
2589
|
return id === rowId;
|
|
3131
2590
|
});
|
|
3132
2591
|
}
|
|
3133
|
-
/**
|
|
3134
|
-
* Gets the row index given a row
|
|
3135
|
-
*/
|
|
3136
|
-
getRowIndex(row) {
|
|
3137
|
-
return this.rowIndexes.get(row) || 0;
|
|
3138
|
-
}
|
|
3139
2592
|
onTreeAction(row) {
|
|
3140
2593
|
this.treeAction.emit({ row });
|
|
3141
2594
|
}
|
|
@@ -3207,14 +2660,155 @@ class DataTableBodyComponent {
|
|
|
3207
2660
|
const colsByPin = columnsByPin(this._columns);
|
|
3208
2661
|
this.columnGroupWidths = columnGroupWidths(colsByPin, this._columns);
|
|
3209
2662
|
}
|
|
2663
|
+
selectRow(event, index, row) {
|
|
2664
|
+
if (!this.selectEnabled) {
|
|
2665
|
+
return;
|
|
2666
|
+
}
|
|
2667
|
+
const chkbox = this.selectionType === SelectionType.checkbox;
|
|
2668
|
+
const multi = this.selectionType === SelectionType.multi;
|
|
2669
|
+
const multiClick = this.selectionType === SelectionType.multiClick;
|
|
2670
|
+
let selected = [];
|
|
2671
|
+
// TODO: this code needs cleanup. Casting it to KeyboardEvent is not correct as it could also be other types.
|
|
2672
|
+
if (multi || chkbox || multiClick) {
|
|
2673
|
+
if (event.shiftKey) {
|
|
2674
|
+
selected = selectRowsBetween([], this.rows, index, this.prevIndex);
|
|
2675
|
+
}
|
|
2676
|
+
else if (event.key === 'a' &&
|
|
2677
|
+
(event.ctrlKey || event.metaKey)) {
|
|
2678
|
+
// select all rows except dummy rows which are added for ghostloader in case of virtual scroll
|
|
2679
|
+
selected = this.rows.filter(rowItem => !!rowItem);
|
|
2680
|
+
}
|
|
2681
|
+
else if (event.ctrlKey ||
|
|
2682
|
+
event.metaKey ||
|
|
2683
|
+
multiClick ||
|
|
2684
|
+
chkbox) {
|
|
2685
|
+
selected = selectRows([...this.selected], row, this.getRowSelectedIdx.bind(this));
|
|
2686
|
+
}
|
|
2687
|
+
else {
|
|
2688
|
+
selected = selectRows([], row, this.getRowSelectedIdx.bind(this));
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
else {
|
|
2692
|
+
selected = selectRows([], row, this.getRowSelectedIdx.bind(this));
|
|
2693
|
+
}
|
|
2694
|
+
if (typeof this.selectCheck === 'function') {
|
|
2695
|
+
selected = selected.filter(this.selectCheck.bind(this));
|
|
2696
|
+
}
|
|
2697
|
+
if (typeof this.disableRowCheck === 'function') {
|
|
2698
|
+
selected = selected.filter(rowData => !this.disableRowCheck(rowData));
|
|
2699
|
+
}
|
|
2700
|
+
this.selected.splice(0, this.selected.length);
|
|
2701
|
+
this.selected.push(...selected);
|
|
2702
|
+
this.prevIndex = index;
|
|
2703
|
+
this.select.emit({
|
|
2704
|
+
selected
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
onActivate(model, index) {
|
|
2708
|
+
const { type, event, row } = model;
|
|
2709
|
+
const chkbox = this.selectionType === SelectionType.checkbox;
|
|
2710
|
+
const select = (!chkbox && (type === 'click' || type === 'dblclick')) || (chkbox && type === 'checkbox');
|
|
2711
|
+
if (select) {
|
|
2712
|
+
this.selectRow(event, index, row);
|
|
2713
|
+
}
|
|
2714
|
+
else if (type === 'keydown') {
|
|
2715
|
+
if (event.key === Keys.return) {
|
|
2716
|
+
this.selectRow(event, index, row);
|
|
2717
|
+
}
|
|
2718
|
+
else if (event.key === 'a' &&
|
|
2719
|
+
(event.ctrlKey || event.metaKey)) {
|
|
2720
|
+
this.selectRow(event, 0, row); // The row property is ignored in this case. So we can pass anything.
|
|
2721
|
+
}
|
|
2722
|
+
else {
|
|
2723
|
+
this.onKeyboardFocus(model);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
this.activate.emit(model);
|
|
2727
|
+
}
|
|
2728
|
+
onKeyboardFocus(model) {
|
|
2729
|
+
const { key } = model.event;
|
|
2730
|
+
const shouldFocus = key === Keys.up || key === Keys.down || key === Keys.right || key === Keys.left;
|
|
2731
|
+
if (shouldFocus) {
|
|
2732
|
+
const isCellSelection = this.selectionType === SelectionType.cell;
|
|
2733
|
+
if (typeof this.disableRowCheck === 'function') {
|
|
2734
|
+
const isRowDisabled = this.disableRowCheck(model.row);
|
|
2735
|
+
if (isRowDisabled) {
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
if (!model.cellElement || !isCellSelection) {
|
|
2740
|
+
this.focusRow(model.rowElement, key);
|
|
2741
|
+
}
|
|
2742
|
+
else if (isCellSelection && model.cellIndex !== undefined) {
|
|
2743
|
+
this.focusCell(model.cellElement, model.rowElement, key, model.cellIndex);
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
focusRow(rowElement, key) {
|
|
2748
|
+
const nextRowElement = this.getPrevNextRow(rowElement, key);
|
|
2749
|
+
if (nextRowElement) {
|
|
2750
|
+
nextRowElement.focus();
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
getPrevNextRow(rowElement, key) {
|
|
2754
|
+
const parentElement = rowElement.parentElement;
|
|
2755
|
+
if (parentElement) {
|
|
2756
|
+
let focusElement = null;
|
|
2757
|
+
if (key === Keys.up) {
|
|
2758
|
+
focusElement = parentElement.previousElementSibling;
|
|
2759
|
+
}
|
|
2760
|
+
else if (key === Keys.down) {
|
|
2761
|
+
focusElement = parentElement.nextElementSibling;
|
|
2762
|
+
}
|
|
2763
|
+
if (focusElement && focusElement.children.length) {
|
|
2764
|
+
return focusElement.children[0];
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
focusCell(cellElement, rowElement, key, cellIndex) {
|
|
2769
|
+
let nextCellElement = null;
|
|
2770
|
+
if (key === Keys.left) {
|
|
2771
|
+
nextCellElement = cellElement.previousElementSibling;
|
|
2772
|
+
}
|
|
2773
|
+
else if (key === Keys.right) {
|
|
2774
|
+
nextCellElement = cellElement.nextElementSibling;
|
|
2775
|
+
}
|
|
2776
|
+
else if (key === Keys.up || key === Keys.down) {
|
|
2777
|
+
const nextRowElement = this.getPrevNextRow(rowElement, key);
|
|
2778
|
+
if (nextRowElement) {
|
|
2779
|
+
const children = nextRowElement.getElementsByClassName('datatable-body-cell');
|
|
2780
|
+
if (children.length) {
|
|
2781
|
+
nextCellElement = children[cellIndex];
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
if (nextCellElement &&
|
|
2786
|
+
'focus' in nextCellElement &&
|
|
2787
|
+
typeof nextCellElement.focus === 'function') {
|
|
2788
|
+
nextCellElement.focus();
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
getRowSelected(row) {
|
|
2792
|
+
return this.getRowSelectedIdx(row, this.selected) > -1;
|
|
2793
|
+
}
|
|
2794
|
+
getRowSelectedIdx(row, selected) {
|
|
2795
|
+
if (!selected || !selected.length) {
|
|
2796
|
+
return -1;
|
|
2797
|
+
}
|
|
2798
|
+
const rowId = this.rowIdentity(row);
|
|
2799
|
+
return selected.findIndex(r => {
|
|
2800
|
+
const id = this.rowIdentity(r);
|
|
2801
|
+
return id === rowId;
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
3210
2804
|
isGroup(row) {
|
|
3211
2805
|
return !!this.groupedRows;
|
|
3212
2806
|
}
|
|
3213
2807
|
isRow(row) {
|
|
3214
2808
|
return !this.groupedRows;
|
|
3215
2809
|
}
|
|
3216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3217
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2810
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2811
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableBodyComponent, isStandalone: true, selector: "datatable-body", inputs: { rowDefTemplate: "rowDefTemplate", scrollbarV: "scrollbarV", scrollbarH: "scrollbarH", loadingIndicator: "loadingIndicator", ghostLoadingIndicator: "ghostLoadingIndicator", externalPaging: "externalPaging", rowHeight: "rowHeight", offsetX: "offsetX", selectionType: "selectionType", selected: "selected", rowIdentity: "rowIdentity", rowDetail: "rowDetail", groupHeader: "groupHeader", selectCheck: "selectCheck", displayCheck: "displayCheck", trackByProp: "trackByProp", rowClass: "rowClass", groupedRows: "groupedRows", groupExpansionDefault: "groupExpansionDefault", innerWidth: "innerWidth", groupRowsBy: "groupRowsBy", virtualization: "virtualization", summaryRow: "summaryRow", summaryPosition: "summaryPosition", summaryHeight: "summaryHeight", rowDraggable: "rowDraggable", rowDragEvents: "rowDragEvents", disableRowCheck: "disableRowCheck", pageSize: "pageSize", rows: "rows", columns: "columns", offset: "offset", rowCount: "rowCount", bodyHeight: "bodyHeight", verticalScrollVisible: "verticalScrollVisible" }, outputs: { scroll: "scroll", page: "page", activate: "activate", select: "select", rowContextmenu: "rowContextmenu", treeAction: "treeAction" }, host: { properties: { "style.width": "this.bodyWidth", "style.height": "this.bodyHeight" }, classAttribute: "datatable-body" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ScrollerComponent, descendants: true }], ngImport: i0, template: `
|
|
3218
2812
|
@if (loadingIndicator) {
|
|
3219
2813
|
<div class="custom-loading-indicator-wrapper">
|
|
3220
2814
|
<div class="custom-loading-content">
|
|
@@ -3232,201 +2826,164 @@ class DataTableBodyComponent {
|
|
|
3232
2826
|
>
|
|
3233
2827
|
</ghost-loader>
|
|
3234
2828
|
}
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
2829
|
+
@if (rows.length) {
|
|
2830
|
+
<datatable-scroller
|
|
2831
|
+
[scrollbarV]="scrollbarV"
|
|
2832
|
+
[scrollbarH]="scrollbarH"
|
|
2833
|
+
[scrollHeight]="scrollHeight()"
|
|
2834
|
+
[scrollWidth]="columnGroupWidths?.total"
|
|
2835
|
+
(scroll)="onBodyScroll($event)"
|
|
2836
|
+
>
|
|
2837
|
+
@if (summaryRow && summaryPosition === 'top') {
|
|
2838
|
+
<datatable-summary-row
|
|
2839
|
+
[rowHeight]="summaryHeight"
|
|
2840
|
+
[innerWidth]="innerWidth"
|
|
2841
|
+
[rows]="rows"
|
|
2842
|
+
[columns]="columns"
|
|
2843
|
+
>
|
|
2844
|
+
</datatable-summary-row>
|
|
2845
|
+
}
|
|
2846
|
+
<ng-template
|
|
2847
|
+
ngx-datatable-body-row
|
|
2848
|
+
#bodyRow
|
|
2849
|
+
let-row="row"
|
|
2850
|
+
let-index="index"
|
|
2851
|
+
let-indexInGroup="indexInGroup"
|
|
2852
|
+
let-groupedRows="groupedRows"
|
|
2853
|
+
let-disabled="disabled"
|
|
3254
2854
|
>
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
(rowContextmenu)="rowContextmenu.emit($event)"
|
|
3285
|
-
>
|
|
3286
|
-
@if (rowDefTemplate) {
|
|
3287
|
-
<ng-container
|
|
3288
|
-
*rowDefInternal="{
|
|
3289
|
-
template: rowDefTemplate,
|
|
3290
|
-
rowTemplate: bodyRow,
|
|
3291
|
-
row: group,
|
|
3292
|
-
index: i
|
|
3293
|
-
}"
|
|
3294
|
-
/>
|
|
3295
|
-
} @else {
|
|
3296
|
-
@if (isRow(group)) {
|
|
3297
|
-
<datatable-body-row
|
|
3298
|
-
role="row"
|
|
3299
|
-
tabindex="-1"
|
|
3300
|
-
#rowElement
|
|
3301
|
-
[disable$]="rowWrapper.disable$"
|
|
3302
|
-
[isSelected]="selector.getRowSelected(group)"
|
|
3303
|
-
[innerWidth]="innerWidth"
|
|
3304
|
-
[offsetX]="offsetX"
|
|
3305
|
-
[columns]="columns"
|
|
3306
|
-
[rowHeight]="getRowHeight(group)"
|
|
3307
|
-
[row]="group"
|
|
3308
|
-
[rowIndex]="getRowIndex(group)"
|
|
3309
|
-
[expanded]="getRowExpanded(group)"
|
|
3310
|
-
[rowClass]="rowClass"
|
|
3311
|
-
[displayCheck]="displayCheck"
|
|
3312
|
-
[treeStatus]="group?.treeStatus"
|
|
3313
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
3314
|
-
[draggable]="rowDraggable"
|
|
3315
|
-
[verticalScrollVisible]="verticalScrollVisible"
|
|
3316
|
-
(treeAction)="onTreeAction(group)"
|
|
3317
|
-
(activate)="selector.onActivate($event, indexes().first + i)"
|
|
3318
|
-
(drop)="drop($event, group, rowElement)"
|
|
3319
|
-
(dragover)="dragOver($event, group)"
|
|
3320
|
-
(dragenter)="dragEnter($event, group, rowElement)"
|
|
3321
|
-
(dragleave)="dragLeave($event, group, rowElement)"
|
|
3322
|
-
(dragstart)="drag($event, group, rowElement)"
|
|
3323
|
-
(dragend)="dragEnd($event, group)"
|
|
3324
|
-
>
|
|
3325
|
-
</datatable-body-row>
|
|
3326
|
-
}
|
|
3327
|
-
}
|
|
2855
|
+
<datatable-body-row
|
|
2856
|
+
role="row"
|
|
2857
|
+
tabindex="-1"
|
|
2858
|
+
#rowElement
|
|
2859
|
+
[disabled]="disabled"
|
|
2860
|
+
[isSelected]="getRowSelected(row)"
|
|
2861
|
+
[innerWidth]="innerWidth"
|
|
2862
|
+
[columns]="columns"
|
|
2863
|
+
[rowHeight]="getRowHeight(row)"
|
|
2864
|
+
[row]="row"
|
|
2865
|
+
[group]="groupedRows"
|
|
2866
|
+
[rowIndex]="{ index: index, indexInGroup: indexInGroup }"
|
|
2867
|
+
[expanded]="getRowExpanded(row)"
|
|
2868
|
+
[rowClass]="rowClass"
|
|
2869
|
+
[displayCheck]="displayCheck"
|
|
2870
|
+
[treeStatus]="row?.treeStatus"
|
|
2871
|
+
[draggable]="rowDraggable"
|
|
2872
|
+
[verticalScrollVisible]="verticalScrollVisible"
|
|
2873
|
+
(treeAction)="onTreeAction(row)"
|
|
2874
|
+
(activate)="onActivate($event, index)"
|
|
2875
|
+
(drop)="drop($event, row, rowElement)"
|
|
2876
|
+
(dragover)="dragOver($event, row)"
|
|
2877
|
+
(dragenter)="dragEnter($event, row, rowElement)"
|
|
2878
|
+
(dragleave)="dragLeave($event, row, rowElement)"
|
|
2879
|
+
(dragstart)="drag($event, row, rowElement)"
|
|
2880
|
+
(dragend)="dragEnd($event, row)"
|
|
2881
|
+
>
|
|
2882
|
+
</datatable-body-row>
|
|
2883
|
+
</ng-template>
|
|
3328
2884
|
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
2885
|
+
<div [style.transform]="renderOffset()">
|
|
2886
|
+
@for (group of rowsToRender(); track rowTrackingFn(i, group); let i = $index) {
|
|
2887
|
+
@if (!group && ghostLoadingIndicator) {
|
|
2888
|
+
<ghost-loader cellMode [columns]="columns" [pageSize]="1" [rowHeight]="rowHeight" />
|
|
2889
|
+
} @else if (group) {
|
|
2890
|
+
@let disabled = isRow(group) && disableRowCheck && disableRowCheck(group);
|
|
2891
|
+
<!-- $any(group) is needed as the typing is broken and the feature as well. See #147. -->
|
|
2892
|
+
<!-- FIXME: This has to be revisited and fixed. -->
|
|
2893
|
+
<datatable-row-wrapper
|
|
2894
|
+
[attr.hidden]="
|
|
2895
|
+
ghostLoadingIndicator && (!rowCount || !virtualization || !scrollbarV)
|
|
2896
|
+
? true
|
|
2897
|
+
: null
|
|
2898
|
+
"
|
|
2899
|
+
[groupedRows]="groupedRows"
|
|
2900
|
+
[innerWidth]="innerWidth"
|
|
2901
|
+
[style.width]="groupedRows ? columnGroupWidths.total : undefined"
|
|
2902
|
+
[rowDetail]="rowDetail"
|
|
2903
|
+
[groupHeader]="groupHeader"
|
|
2904
|
+
[offsetX]="offsetX"
|
|
2905
|
+
[detailRowHeight]="getDetailRowHeight(group && $any(group)[i], i)"
|
|
2906
|
+
[groupHeaderRowHeight]="getGroupHeaderRowHeight(group && $any(group)[i], i)"
|
|
2907
|
+
[row]="group"
|
|
2908
|
+
[disabled]="disabled"
|
|
2909
|
+
[expanded]="getRowExpanded(group)"
|
|
2910
|
+
[rowIndex]="indexes().first + i"
|
|
2911
|
+
[selected]="selected"
|
|
2912
|
+
(rowContextmenu)="rowContextmenu.emit($event)"
|
|
2913
|
+
>
|
|
2914
|
+
@if (rowDefTemplate) {
|
|
2915
|
+
<ng-container
|
|
2916
|
+
*rowDefInternal="
|
|
2917
|
+
{
|
|
2918
|
+
template: rowDefTemplate,
|
|
2919
|
+
rowTemplate: bodyRow,
|
|
2920
|
+
row: group,
|
|
2921
|
+
index: i
|
|
2922
|
+
};
|
|
2923
|
+
disabled: disabled
|
|
2924
|
+
"
|
|
2925
|
+
/>
|
|
2926
|
+
} @else {
|
|
2927
|
+
@if (isRow(group)) {
|
|
2928
|
+
<ng-container
|
|
2929
|
+
[ngTemplateOutlet]="bodyRow"
|
|
2930
|
+
[ngTemplateOutletContext]="{
|
|
2931
|
+
row: group,
|
|
2932
|
+
index: indexes().first + i,
|
|
2933
|
+
disabled
|
|
2934
|
+
}"
|
|
2935
|
+
></ng-container>
|
|
2936
|
+
}
|
|
3360
2937
|
}
|
|
3361
|
-
</ng-template>
|
|
3362
2938
|
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
[rowIndex]="getRowIndex(row)"
|
|
3379
|
-
[expanded]="getRowExpanded(row)"
|
|
3380
|
-
[rowClass]="rowClass"
|
|
3381
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
3382
|
-
[draggable]="rowDraggable"
|
|
3383
|
-
[verticalScrollVisible]="verticalScrollVisible"
|
|
3384
|
-
(activate)="selector.onActivate($event, i)"
|
|
3385
|
-
(drop)="drop($event, row, rowElement)"
|
|
3386
|
-
(dragover)="dragOver($event, row)"
|
|
3387
|
-
(dragenter)="dragEnter($event, row, rowElement)"
|
|
3388
|
-
(dragleave)="dragLeave($event, row, rowElement)"
|
|
3389
|
-
(dragstart)="drag($event, row, rowElement)"
|
|
3390
|
-
(dragend)="dragEnd($event, row)"
|
|
3391
|
-
>
|
|
3392
|
-
</datatable-body-row>
|
|
2939
|
+
@if (isGroup(group)) {
|
|
2940
|
+
<!-- The row typecast is due to angular compiler acting weird. It is obvious that it is of type TRow, but the compiler does not understand. -->
|
|
2941
|
+
@for (row of group.value; track rowTrackingFn($index, row)) {
|
|
2942
|
+
@let disabled = disableRowCheck && disableRowCheck(row);
|
|
2943
|
+
<ng-container
|
|
2944
|
+
[ngTemplateOutlet]="bodyRow"
|
|
2945
|
+
[ngTemplateOutletContext]="{
|
|
2946
|
+
row,
|
|
2947
|
+
groupedRows: group?.value,
|
|
2948
|
+
index: indexes().first + i,
|
|
2949
|
+
indexInGroup: $index,
|
|
2950
|
+
disabled
|
|
2951
|
+
}"
|
|
2952
|
+
></ng-container>
|
|
2953
|
+
}
|
|
3393
2954
|
}
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
}
|
|
3397
|
-
@if (summaryRow && summaryPosition === 'bottom') {
|
|
3398
|
-
<datatable-summary-row
|
|
3399
|
-
role="row"
|
|
3400
|
-
[ngStyle]="bottomSummaryRowsStyles()"
|
|
3401
|
-
[rowHeight]="summaryHeight"
|
|
3402
|
-
[offsetX]="offsetX"
|
|
3403
|
-
[innerWidth]="innerWidth"
|
|
3404
|
-
[rows]="rows"
|
|
3405
|
-
[columns]="columns"
|
|
3406
|
-
>
|
|
3407
|
-
</datatable-summary-row>
|
|
2955
|
+
</datatable-row-wrapper>
|
|
2956
|
+
}
|
|
3408
2957
|
}
|
|
3409
|
-
</
|
|
3410
|
-
|
|
3411
|
-
@if (
|
|
3412
|
-
<datatable-
|
|
3413
|
-
|
|
3414
|
-
[
|
|
3415
|
-
[
|
|
3416
|
-
[
|
|
3417
|
-
|
|
2958
|
+
</div>
|
|
2959
|
+
</datatable-scroller>
|
|
2960
|
+
@if (summaryRow && summaryPosition === 'bottom') {
|
|
2961
|
+
<datatable-summary-row
|
|
2962
|
+
role="row"
|
|
2963
|
+
[rowHeight]="summaryHeight"
|
|
2964
|
+
[innerWidth]="innerWidth"
|
|
2965
|
+
[rows]="rows"
|
|
2966
|
+
[columns]="columns"
|
|
3418
2967
|
>
|
|
3419
|
-
|
|
3420
|
-
></datatable-scroller>
|
|
2968
|
+
</datatable-summary-row>
|
|
3421
2969
|
}
|
|
3422
|
-
|
|
3423
|
-
|
|
2970
|
+
}
|
|
2971
|
+
@if (!rows?.length && !loadingIndicator && !ghostLoadingIndicator) {
|
|
2972
|
+
<datatable-scroller
|
|
2973
|
+
[scrollbarV]="scrollbarV"
|
|
2974
|
+
[scrollbarH]="scrollbarH"
|
|
2975
|
+
[scrollHeight]="scrollHeight()"
|
|
2976
|
+
[style.width]="scrollbarH ? columnGroupWidths?.total + 'px' : '100%'"
|
|
2977
|
+
(scroll)="onBodyScroll($event)"
|
|
2978
|
+
>
|
|
2979
|
+
<ng-content select="[empty-content]"></ng-content>
|
|
2980
|
+
</datatable-scroller>
|
|
2981
|
+
}
|
|
2982
|
+
`, isInline: true, styles: [":host{position:relative;z-index:10;display:block;overflow:hidden}:host-context(ngx-datatable.scroll-horz) :host{overflow-x:auto;-webkit-overflow-scrolling:touch}datatable-scroller{display:block}:host-context(ngx-datatable.fixed-row) datatable-scroller{white-space:nowrap}:host-context(ngx-datatable.scroll-vertical) :host{overflow-y:auto}[hidden]{display:none!important}\n"], dependencies: [{ kind: "component", type: DataTableGhostLoaderComponent, selector: "ghost-loader", inputs: ["columns", "pageSize", "rowHeight", "ghostBodyHeight", "cellMode"] }, { kind: "component", type: ScrollerComponent, selector: "datatable-scroller", inputs: ["scrollbarV", "scrollbarH", "scrollHeight", "scrollWidth"], outputs: ["scroll"] }, { kind: "component", type: DataTableSummaryRowComponent, selector: "datatable-summary-row", inputs: ["rows", "columns", "rowHeight", "innerWidth"] }, { kind: "component", type: DataTableRowWrapperComponent, selector: "datatable-row-wrapper", inputs: ["innerWidth", "rowDetail", "groupHeader", "offsetX", "detailRowHeight", "groupHeaderRowHeight", "row", "groupedRows", "selected", "disabled", "rowIndex", "expanded"], outputs: ["rowContextmenu"] }, { kind: "directive", type: DatatableRowDefInternalDirective, selector: "[rowDefInternal]", inputs: ["rowDefInternal", "rowDefInternalDisabled"] }, { kind: "component", type: DataTableBodyRowComponent, selector: "datatable-body-row", inputs: ["columns", "innerWidth", "expanded", "rowClass", "row", "group", "isSelected", "rowIndex", "displayCheck", "treeStatus", "verticalScrollVisible", "disabled", "rowHeight"], outputs: ["activate", "treeAction"] }, { kind: "directive", type: DraggableDirective, selector: "[draggable]", inputs: ["dragEventTarget", "dragModel", "dragX", "dragY"], outputs: ["dragStart", "dragging", "dragEnd"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DatatableBodyRowDirective, selector: "[ngx-datatable-body-row]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3424
2983
|
}
|
|
3425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableBodyComponent, decorators: [{
|
|
3426
2985
|
type: Component,
|
|
3427
|
-
args: [{
|
|
3428
|
-
selector: 'datatable-body',
|
|
3429
|
-
template: `
|
|
2986
|
+
args: [{ selector: 'datatable-body', template: `
|
|
3430
2987
|
@if (loadingIndicator) {
|
|
3431
2988
|
<div class="custom-loading-indicator-wrapper">
|
|
3432
2989
|
<div class="custom-loading-content">
|
|
@@ -3444,211 +3001,172 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
3444
3001
|
>
|
|
3445
3002
|
</ghost-loader>
|
|
3446
3003
|
}
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3004
|
+
@if (rows.length) {
|
|
3005
|
+
<datatable-scroller
|
|
3006
|
+
[scrollbarV]="scrollbarV"
|
|
3007
|
+
[scrollbarH]="scrollbarH"
|
|
3008
|
+
[scrollHeight]="scrollHeight()"
|
|
3009
|
+
[scrollWidth]="columnGroupWidths?.total"
|
|
3010
|
+
(scroll)="onBodyScroll($event)"
|
|
3011
|
+
>
|
|
3012
|
+
@if (summaryRow && summaryPosition === 'top') {
|
|
3013
|
+
<datatable-summary-row
|
|
3014
|
+
[rowHeight]="summaryHeight"
|
|
3015
|
+
[innerWidth]="innerWidth"
|
|
3016
|
+
[rows]="rows"
|
|
3017
|
+
[columns]="columns"
|
|
3018
|
+
>
|
|
3019
|
+
</datatable-summary-row>
|
|
3020
|
+
}
|
|
3021
|
+
<ng-template
|
|
3022
|
+
ngx-datatable-body-row
|
|
3023
|
+
#bodyRow
|
|
3024
|
+
let-row="row"
|
|
3025
|
+
let-index="index"
|
|
3026
|
+
let-indexInGroup="indexInGroup"
|
|
3027
|
+
let-groupedRows="groupedRows"
|
|
3028
|
+
let-disabled="disabled"
|
|
3466
3029
|
>
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
(rowContextmenu)="rowContextmenu.emit($event)"
|
|
3497
|
-
>
|
|
3498
|
-
@if (rowDefTemplate) {
|
|
3499
|
-
<ng-container
|
|
3500
|
-
*rowDefInternal="{
|
|
3501
|
-
template: rowDefTemplate,
|
|
3502
|
-
rowTemplate: bodyRow,
|
|
3503
|
-
row: group,
|
|
3504
|
-
index: i
|
|
3505
|
-
}"
|
|
3506
|
-
/>
|
|
3507
|
-
} @else {
|
|
3508
|
-
@if (isRow(group)) {
|
|
3509
|
-
<datatable-body-row
|
|
3510
|
-
role="row"
|
|
3511
|
-
tabindex="-1"
|
|
3512
|
-
#rowElement
|
|
3513
|
-
[disable$]="rowWrapper.disable$"
|
|
3514
|
-
[isSelected]="selector.getRowSelected(group)"
|
|
3515
|
-
[innerWidth]="innerWidth"
|
|
3516
|
-
[offsetX]="offsetX"
|
|
3517
|
-
[columns]="columns"
|
|
3518
|
-
[rowHeight]="getRowHeight(group)"
|
|
3519
|
-
[row]="group"
|
|
3520
|
-
[rowIndex]="getRowIndex(group)"
|
|
3521
|
-
[expanded]="getRowExpanded(group)"
|
|
3522
|
-
[rowClass]="rowClass"
|
|
3523
|
-
[displayCheck]="displayCheck"
|
|
3524
|
-
[treeStatus]="group?.treeStatus"
|
|
3525
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
3526
|
-
[draggable]="rowDraggable"
|
|
3527
|
-
[verticalScrollVisible]="verticalScrollVisible"
|
|
3528
|
-
(treeAction)="onTreeAction(group)"
|
|
3529
|
-
(activate)="selector.onActivate($event, indexes().first + i)"
|
|
3530
|
-
(drop)="drop($event, group, rowElement)"
|
|
3531
|
-
(dragover)="dragOver($event, group)"
|
|
3532
|
-
(dragenter)="dragEnter($event, group, rowElement)"
|
|
3533
|
-
(dragleave)="dragLeave($event, group, rowElement)"
|
|
3534
|
-
(dragstart)="drag($event, group, rowElement)"
|
|
3535
|
-
(dragend)="dragEnd($event, group)"
|
|
3536
|
-
>
|
|
3537
|
-
</datatable-body-row>
|
|
3538
|
-
}
|
|
3539
|
-
}
|
|
3030
|
+
<datatable-body-row
|
|
3031
|
+
role="row"
|
|
3032
|
+
tabindex="-1"
|
|
3033
|
+
#rowElement
|
|
3034
|
+
[disabled]="disabled"
|
|
3035
|
+
[isSelected]="getRowSelected(row)"
|
|
3036
|
+
[innerWidth]="innerWidth"
|
|
3037
|
+
[columns]="columns"
|
|
3038
|
+
[rowHeight]="getRowHeight(row)"
|
|
3039
|
+
[row]="row"
|
|
3040
|
+
[group]="groupedRows"
|
|
3041
|
+
[rowIndex]="{ index: index, indexInGroup: indexInGroup }"
|
|
3042
|
+
[expanded]="getRowExpanded(row)"
|
|
3043
|
+
[rowClass]="rowClass"
|
|
3044
|
+
[displayCheck]="displayCheck"
|
|
3045
|
+
[treeStatus]="row?.treeStatus"
|
|
3046
|
+
[draggable]="rowDraggable"
|
|
3047
|
+
[verticalScrollVisible]="verticalScrollVisible"
|
|
3048
|
+
(treeAction)="onTreeAction(row)"
|
|
3049
|
+
(activate)="onActivate($event, index)"
|
|
3050
|
+
(drop)="drop($event, row, rowElement)"
|
|
3051
|
+
(dragover)="dragOver($event, row)"
|
|
3052
|
+
(dragenter)="dragEnter($event, row, rowElement)"
|
|
3053
|
+
(dragleave)="dragLeave($event, row, rowElement)"
|
|
3054
|
+
(dragstart)="drag($event, row, rowElement)"
|
|
3055
|
+
(dragend)="dragEnd($event, row)"
|
|
3056
|
+
>
|
|
3057
|
+
</datatable-body-row>
|
|
3058
|
+
</ng-template>
|
|
3540
3059
|
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3060
|
+
<div [style.transform]="renderOffset()">
|
|
3061
|
+
@for (group of rowsToRender(); track rowTrackingFn(i, group); let i = $index) {
|
|
3062
|
+
@if (!group && ghostLoadingIndicator) {
|
|
3063
|
+
<ghost-loader cellMode [columns]="columns" [pageSize]="1" [rowHeight]="rowHeight" />
|
|
3064
|
+
} @else if (group) {
|
|
3065
|
+
@let disabled = isRow(group) && disableRowCheck && disableRowCheck(group);
|
|
3066
|
+
<!-- $any(group) is needed as the typing is broken and the feature as well. See #147. -->
|
|
3067
|
+
<!-- FIXME: This has to be revisited and fixed. -->
|
|
3068
|
+
<datatable-row-wrapper
|
|
3069
|
+
[attr.hidden]="
|
|
3070
|
+
ghostLoadingIndicator && (!rowCount || !virtualization || !scrollbarV)
|
|
3071
|
+
? true
|
|
3072
|
+
: null
|
|
3073
|
+
"
|
|
3074
|
+
[groupedRows]="groupedRows"
|
|
3075
|
+
[innerWidth]="innerWidth"
|
|
3076
|
+
[style.width]="groupedRows ? columnGroupWidths.total : undefined"
|
|
3077
|
+
[rowDetail]="rowDetail"
|
|
3078
|
+
[groupHeader]="groupHeader"
|
|
3079
|
+
[offsetX]="offsetX"
|
|
3080
|
+
[detailRowHeight]="getDetailRowHeight(group && $any(group)[i], i)"
|
|
3081
|
+
[groupHeaderRowHeight]="getGroupHeaderRowHeight(group && $any(group)[i], i)"
|
|
3082
|
+
[row]="group"
|
|
3083
|
+
[disabled]="disabled"
|
|
3084
|
+
[expanded]="getRowExpanded(group)"
|
|
3085
|
+
[rowIndex]="indexes().first + i"
|
|
3086
|
+
[selected]="selected"
|
|
3087
|
+
(rowContextmenu)="rowContextmenu.emit($event)"
|
|
3088
|
+
>
|
|
3089
|
+
@if (rowDefTemplate) {
|
|
3090
|
+
<ng-container
|
|
3091
|
+
*rowDefInternal="
|
|
3092
|
+
{
|
|
3093
|
+
template: rowDefTemplate,
|
|
3094
|
+
rowTemplate: bodyRow,
|
|
3095
|
+
row: group,
|
|
3096
|
+
index: i
|
|
3097
|
+
};
|
|
3098
|
+
disabled: disabled
|
|
3099
|
+
"
|
|
3100
|
+
/>
|
|
3101
|
+
} @else {
|
|
3102
|
+
@if (isRow(group)) {
|
|
3103
|
+
<ng-container
|
|
3104
|
+
[ngTemplateOutlet]="bodyRow"
|
|
3105
|
+
[ngTemplateOutletContext]="{
|
|
3106
|
+
row: group,
|
|
3107
|
+
index: indexes().first + i,
|
|
3108
|
+
disabled
|
|
3109
|
+
}"
|
|
3110
|
+
></ng-container>
|
|
3111
|
+
}
|
|
3572
3112
|
}
|
|
3573
|
-
</ng-template>
|
|
3574
3113
|
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
[rowIndex]="getRowIndex(row)"
|
|
3591
|
-
[expanded]="getRowExpanded(row)"
|
|
3592
|
-
[rowClass]="rowClass"
|
|
3593
|
-
[ghostLoadingIndicator]="ghostLoadingIndicator"
|
|
3594
|
-
[draggable]="rowDraggable"
|
|
3595
|
-
[verticalScrollVisible]="verticalScrollVisible"
|
|
3596
|
-
(activate)="selector.onActivate($event, i)"
|
|
3597
|
-
(drop)="drop($event, row, rowElement)"
|
|
3598
|
-
(dragover)="dragOver($event, row)"
|
|
3599
|
-
(dragenter)="dragEnter($event, row, rowElement)"
|
|
3600
|
-
(dragleave)="dragLeave($event, row, rowElement)"
|
|
3601
|
-
(dragstart)="drag($event, row, rowElement)"
|
|
3602
|
-
(dragend)="dragEnd($event, row)"
|
|
3603
|
-
>
|
|
3604
|
-
</datatable-body-row>
|
|
3114
|
+
@if (isGroup(group)) {
|
|
3115
|
+
<!-- The row typecast is due to angular compiler acting weird. It is obvious that it is of type TRow, but the compiler does not understand. -->
|
|
3116
|
+
@for (row of group.value; track rowTrackingFn($index, row)) {
|
|
3117
|
+
@let disabled = disableRowCheck && disableRowCheck(row);
|
|
3118
|
+
<ng-container
|
|
3119
|
+
[ngTemplateOutlet]="bodyRow"
|
|
3120
|
+
[ngTemplateOutletContext]="{
|
|
3121
|
+
row,
|
|
3122
|
+
groupedRows: group?.value,
|
|
3123
|
+
index: indexes().first + i,
|
|
3124
|
+
indexInGroup: $index,
|
|
3125
|
+
disabled
|
|
3126
|
+
}"
|
|
3127
|
+
></ng-container>
|
|
3128
|
+
}
|
|
3605
3129
|
}
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
}
|
|
3609
|
-
@if (summaryRow && summaryPosition === 'bottom') {
|
|
3610
|
-
<datatable-summary-row
|
|
3611
|
-
role="row"
|
|
3612
|
-
[ngStyle]="bottomSummaryRowsStyles()"
|
|
3613
|
-
[rowHeight]="summaryHeight"
|
|
3614
|
-
[offsetX]="offsetX"
|
|
3615
|
-
[innerWidth]="innerWidth"
|
|
3616
|
-
[rows]="rows"
|
|
3617
|
-
[columns]="columns"
|
|
3618
|
-
>
|
|
3619
|
-
</datatable-summary-row>
|
|
3130
|
+
</datatable-row-wrapper>
|
|
3131
|
+
}
|
|
3620
3132
|
}
|
|
3621
|
-
</
|
|
3622
|
-
|
|
3623
|
-
@if (
|
|
3624
|
-
<datatable-
|
|
3625
|
-
|
|
3626
|
-
[
|
|
3627
|
-
[
|
|
3628
|
-
[
|
|
3629
|
-
|
|
3133
|
+
</div>
|
|
3134
|
+
</datatable-scroller>
|
|
3135
|
+
@if (summaryRow && summaryPosition === 'bottom') {
|
|
3136
|
+
<datatable-summary-row
|
|
3137
|
+
role="row"
|
|
3138
|
+
[rowHeight]="summaryHeight"
|
|
3139
|
+
[innerWidth]="innerWidth"
|
|
3140
|
+
[rows]="rows"
|
|
3141
|
+
[columns]="columns"
|
|
3630
3142
|
>
|
|
3631
|
-
|
|
3632
|
-
></datatable-scroller>
|
|
3143
|
+
</datatable-summary-row>
|
|
3633
3144
|
}
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3145
|
+
}
|
|
3146
|
+
@if (!rows?.length && !loadingIndicator && !ghostLoadingIndicator) {
|
|
3147
|
+
<datatable-scroller
|
|
3148
|
+
[scrollbarV]="scrollbarV"
|
|
3149
|
+
[scrollbarH]="scrollbarH"
|
|
3150
|
+
[scrollHeight]="scrollHeight()"
|
|
3151
|
+
[style.width]="scrollbarH ? columnGroupWidths?.total + 'px' : '100%'"
|
|
3152
|
+
(scroll)="onBodyScroll($event)"
|
|
3153
|
+
>
|
|
3154
|
+
<ng-content select="[empty-content]"></ng-content>
|
|
3155
|
+
</datatable-scroller>
|
|
3156
|
+
}
|
|
3157
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
3638
3158
|
class: 'datatable-body'
|
|
3639
|
-
},
|
|
3640
|
-
imports: [
|
|
3159
|
+
}, imports: [
|
|
3641
3160
|
DataTableGhostLoaderComponent,
|
|
3642
|
-
DataTableSelectionComponent,
|
|
3643
3161
|
ScrollerComponent,
|
|
3644
3162
|
DataTableSummaryRowComponent,
|
|
3645
3163
|
DataTableRowWrapperComponent,
|
|
3646
|
-
NgStyle,
|
|
3647
3164
|
DatatableRowDefInternalDirective,
|
|
3648
3165
|
DataTableBodyRowComponent,
|
|
3649
|
-
DraggableDirective
|
|
3650
|
-
|
|
3651
|
-
|
|
3166
|
+
DraggableDirective,
|
|
3167
|
+
NgTemplateOutlet,
|
|
3168
|
+
DatatableBodyRowDirective
|
|
3169
|
+
], styles: [":host{position:relative;z-index:10;display:block;overflow:hidden}:host-context(ngx-datatable.scroll-horz) :host{overflow-x:auto;-webkit-overflow-scrolling:touch}datatable-scroller{display:block}:host-context(ngx-datatable.fixed-row) datatable-scroller{white-space:nowrap}:host-context(ngx-datatable.scroll-vertical) :host{overflow-y:auto}[hidden]{display:none!important}\n"] }]
|
|
3652
3170
|
}], ctorParameters: () => [], propDecorators: { rowDefTemplate: [{
|
|
3653
3171
|
type: Input
|
|
3654
3172
|
}], scrollbarV: [{
|
|
@@ -3733,8 +3251,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
3733
3251
|
type: Output
|
|
3734
3252
|
}], select: [{
|
|
3735
3253
|
type: Output
|
|
3736
|
-
}], detailToggle: [{
|
|
3737
|
-
type: Output
|
|
3738
3254
|
}], rowContextmenu: [{
|
|
3739
3255
|
type: Output
|
|
3740
3256
|
}], treeAction: [{
|
|
@@ -3764,13 +3280,13 @@ class ScrollbarHelper {
|
|
|
3764
3280
|
inner.style.width = '100%';
|
|
3765
3281
|
outer.appendChild(inner);
|
|
3766
3282
|
const widthWithScroll = inner.offsetWidth;
|
|
3767
|
-
|
|
3283
|
+
this.document.body.removeChild(outer);
|
|
3768
3284
|
return widthNoScroll - widthWithScroll;
|
|
3769
3285
|
}
|
|
3770
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3771
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3286
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ScrollbarHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3287
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ScrollbarHelper, providedIn: 'root' }); }
|
|
3772
3288
|
}
|
|
3773
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ScrollbarHelper, decorators: [{
|
|
3774
3290
|
type: Injectable,
|
|
3775
3291
|
args: [{ providedIn: 'root' }]
|
|
3776
3292
|
}] });
|
|
@@ -3780,20 +3296,14 @@ class LongPressDirective {
|
|
|
3780
3296
|
this.pressEnabled = true;
|
|
3781
3297
|
this.duration = 500;
|
|
3782
3298
|
this.longPressStart = new EventEmitter();
|
|
3783
|
-
this.longPressing = new EventEmitter();
|
|
3784
3299
|
this.longPressEnd = new EventEmitter();
|
|
3785
|
-
this.
|
|
3786
|
-
this.
|
|
3787
|
-
}
|
|
3788
|
-
get press() {
|
|
3789
|
-
return this.pressing;
|
|
3790
|
-
}
|
|
3791
|
-
get isLongPress() {
|
|
3792
|
-
return this.isLongPressing;
|
|
3300
|
+
this.pressing = signal(false);
|
|
3301
|
+
this.isLongPressing = signal(false);
|
|
3793
3302
|
}
|
|
3794
3303
|
onMouseDown(event) {
|
|
3304
|
+
const isMouse = event instanceof MouseEvent;
|
|
3795
3305
|
// don't do right/middle clicks
|
|
3796
|
-
if (
|
|
3306
|
+
if (!this.pressEnabled || (isMouse && event.button !== 0)) {
|
|
3797
3307
|
return;
|
|
3798
3308
|
}
|
|
3799
3309
|
// don't start drag if its on resize handle
|
|
@@ -3801,57 +3311,27 @@ class LongPressDirective {
|
|
|
3801
3311
|
if (target.classList.contains('resize-handle')) {
|
|
3802
3312
|
return;
|
|
3803
3313
|
}
|
|
3804
|
-
this.
|
|
3805
|
-
this.
|
|
3806
|
-
|
|
3807
|
-
this.
|
|
3808
|
-
const mouseup = fromEvent(document, 'mouseup');
|
|
3809
|
-
this.subscription = mouseup.subscribe((ev) => this.onMouseup());
|
|
3314
|
+
this.pressing.set(true);
|
|
3315
|
+
this.isLongPressing.set(false);
|
|
3316
|
+
const mouseup = fromEvent(document, isMouse ? 'mouseup' : 'touchend');
|
|
3317
|
+
this.subscription = mouseup.subscribe(() => this.endPress());
|
|
3810
3318
|
this.timeout = setTimeout(() => {
|
|
3811
|
-
this.isLongPressing
|
|
3319
|
+
this.isLongPressing.set(true);
|
|
3812
3320
|
this.longPressStart.emit({
|
|
3813
3321
|
event,
|
|
3814
3322
|
model: this.pressModel
|
|
3815
3323
|
});
|
|
3816
|
-
this.subscription.add(fromEvent(document, 'mousemove')
|
|
3817
|
-
.pipe(takeUntil(mouseup))
|
|
3818
|
-
.subscribe((mouseEvent) => this.onMouseMove(mouseEvent)));
|
|
3819
|
-
this.loop(event);
|
|
3820
3324
|
}, this.duration);
|
|
3821
|
-
this.loop(event);
|
|
3822
|
-
}
|
|
3823
|
-
onMouseMove(event) {
|
|
3824
|
-
if (this.pressing && !this.isLongPressing) {
|
|
3825
|
-
const xThres = Math.abs(event.clientX - this.mouseX) > 10;
|
|
3826
|
-
const yThres = Math.abs(event.clientY - this.mouseY) > 10;
|
|
3827
|
-
if (xThres || yThres) {
|
|
3828
|
-
this.endPress();
|
|
3829
|
-
}
|
|
3830
|
-
}
|
|
3831
|
-
}
|
|
3832
|
-
loop(event) {
|
|
3833
|
-
if (this.isLongPressing) {
|
|
3834
|
-
this.timeout = setTimeout(() => {
|
|
3835
|
-
this.longPressing.emit({
|
|
3836
|
-
event,
|
|
3837
|
-
model: this.pressModel
|
|
3838
|
-
});
|
|
3839
|
-
this.loop(event);
|
|
3840
|
-
}, 50);
|
|
3841
|
-
}
|
|
3842
3325
|
}
|
|
3843
3326
|
endPress() {
|
|
3844
3327
|
clearTimeout(this.timeout);
|
|
3845
|
-
this.isLongPressing
|
|
3846
|
-
this.pressing
|
|
3328
|
+
this.isLongPressing.set(false);
|
|
3329
|
+
this.pressing.set(false);
|
|
3847
3330
|
this._destroySubscription();
|
|
3848
3331
|
this.longPressEnd.emit({
|
|
3849
3332
|
model: this.pressModel
|
|
3850
3333
|
});
|
|
3851
3334
|
}
|
|
3852
|
-
onMouseup() {
|
|
3853
|
-
this.endPress();
|
|
3854
|
-
}
|
|
3855
3335
|
ngOnDestroy() {
|
|
3856
3336
|
clearTimeout(this.timeout);
|
|
3857
3337
|
this._destroySubscription();
|
|
@@ -3862,14 +3342,19 @@ class LongPressDirective {
|
|
|
3862
3342
|
this.subscription = undefined;
|
|
3863
3343
|
}
|
|
3864
3344
|
}
|
|
3865
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3866
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
3345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: LongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3346
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.5", type: LongPressDirective, isStandalone: true, selector: "[long-press]", inputs: { pressEnabled: ["pressEnabled", "pressEnabled", booleanAttribute], pressModel: "pressModel", duration: ["duration", "duration", numberAttribute] }, outputs: { longPressStart: "longPressStart", longPressEnd: "longPressEnd" }, host: { listeners: { "touchstart": "onMouseDown($event)", "mousedown": "onMouseDown($event)" }, properties: { "class.press": "pressing()", "class.longpress": "isLongPressing()" } }, ngImport: i0 }); }
|
|
3867
3347
|
}
|
|
3868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: LongPressDirective, decorators: [{
|
|
3869
3349
|
type: Directive,
|
|
3870
3350
|
args: [{
|
|
3871
3351
|
selector: '[long-press]',
|
|
3872
|
-
|
|
3352
|
+
host: {
|
|
3353
|
+
'(touchstart)': 'onMouseDown($event)',
|
|
3354
|
+
'(mousedown)': 'onMouseDown($event)',
|
|
3355
|
+
'[class.press]': 'pressing()',
|
|
3356
|
+
'[class.longpress]': 'isLongPressing()'
|
|
3357
|
+
}
|
|
3873
3358
|
}]
|
|
3874
3359
|
}], propDecorators: { pressEnabled: [{
|
|
3875
3360
|
type: Input,
|
|
@@ -3881,108 +3366,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
3881
3366
|
args: [{ transform: numberAttribute }]
|
|
3882
3367
|
}], longPressStart: [{
|
|
3883
3368
|
type: Output
|
|
3884
|
-
}], longPressing: [{
|
|
3885
|
-
type: Output
|
|
3886
3369
|
}], longPressEnd: [{
|
|
3887
3370
|
type: Output
|
|
3888
|
-
}], press: [{
|
|
3889
|
-
type: HostBinding,
|
|
3890
|
-
args: ['class.press']
|
|
3891
|
-
}], isLongPress: [{
|
|
3892
|
-
type: HostBinding,
|
|
3893
|
-
args: ['class.longpress']
|
|
3894
|
-
}], onMouseDown: [{
|
|
3895
|
-
type: HostListener,
|
|
3896
|
-
args: ['mousedown', ['$event']]
|
|
3897
|
-
}] } });
|
|
3898
|
-
|
|
3899
|
-
class ResizeableDirective {
|
|
3900
|
-
constructor() {
|
|
3901
|
-
this.renderer = inject(Renderer2);
|
|
3902
|
-
this.resizeEnabled = true;
|
|
3903
|
-
this.resize = new EventEmitter();
|
|
3904
|
-
this.resizing = new EventEmitter();
|
|
3905
|
-
this.element = inject(ElementRef).nativeElement;
|
|
3906
|
-
}
|
|
3907
|
-
ngAfterViewInit() {
|
|
3908
|
-
const renderer2 = this.renderer;
|
|
3909
|
-
this.resizeHandle = renderer2.createElement('span');
|
|
3910
|
-
if (this.resizeEnabled) {
|
|
3911
|
-
renderer2.addClass(this.resizeHandle, 'resize-handle');
|
|
3912
|
-
}
|
|
3913
|
-
else {
|
|
3914
|
-
renderer2.addClass(this.resizeHandle, 'resize-handle--not-resizable');
|
|
3915
|
-
}
|
|
3916
|
-
renderer2.appendChild(this.element, this.resizeHandle);
|
|
3917
|
-
}
|
|
3918
|
-
ngOnDestroy() {
|
|
3919
|
-
this._destroySubscription();
|
|
3920
|
-
if (this.renderer.destroyNode) {
|
|
3921
|
-
this.renderer.destroyNode(this.resizeHandle);
|
|
3922
|
-
}
|
|
3923
|
-
else if (this.resizeHandle) {
|
|
3924
|
-
this.renderer.removeChild(this.renderer.parentNode(this.resizeHandle), this.resizeHandle);
|
|
3925
|
-
}
|
|
3926
|
-
}
|
|
3927
|
-
onMouseup() {
|
|
3928
|
-
if (this.subscription && !this.subscription.closed) {
|
|
3929
|
-
this._destroySubscription();
|
|
3930
|
-
this.resize.emit(this.element.clientWidth);
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
onMousedown(event) {
|
|
3934
|
-
const isHandle = event.target.classList.contains('resize-handle');
|
|
3935
|
-
const initialWidth = this.element.clientWidth;
|
|
3936
|
-
const mouseDownScreenX = event.screenX;
|
|
3937
|
-
if (isHandle) {
|
|
3938
|
-
event.stopPropagation();
|
|
3939
|
-
const mouseup = fromEvent(document, 'mouseup');
|
|
3940
|
-
this.subscription = mouseup.subscribe((ev) => this.onMouseup());
|
|
3941
|
-
const mouseMoveSub = fromEvent(document, 'mousemove')
|
|
3942
|
-
.pipe(takeUntil(mouseup))
|
|
3943
|
-
.subscribe((e) => this.move(e, initialWidth, mouseDownScreenX));
|
|
3944
|
-
this.subscription.add(mouseMoveSub);
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
move(event, initialWidth, mouseDownScreenX) {
|
|
3948
|
-
const movementX = event.screenX - mouseDownScreenX;
|
|
3949
|
-
const newWidth = initialWidth + movementX;
|
|
3950
|
-
this.resizing.emit(newWidth);
|
|
3951
|
-
}
|
|
3952
|
-
_destroySubscription() {
|
|
3953
|
-
if (this.subscription) {
|
|
3954
|
-
this.subscription.unsubscribe();
|
|
3955
|
-
this.subscription = undefined;
|
|
3956
|
-
}
|
|
3957
|
-
}
|
|
3958
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ResizeableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3959
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.9", type: ResizeableDirective, isStandalone: true, selector: "[resizeable]", inputs: { resizeEnabled: ["resizeEnabled", "resizeEnabled", booleanAttribute], minWidth: ["minWidth", "minWidth", numberAttribute], maxWidth: ["maxWidth", "maxWidth", numberAttribute] }, outputs: { resize: "resize", resizing: "resizing" }, host: { listeners: { "mousedown": "onMousedown($event)" }, properties: { "class.resizeable": "this.resizeEnabled" } }, ngImport: i0 }); }
|
|
3960
|
-
}
|
|
3961
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ResizeableDirective, decorators: [{
|
|
3962
|
-
type: Directive,
|
|
3963
|
-
args: [{
|
|
3964
|
-
selector: '[resizeable]',
|
|
3965
|
-
standalone: true
|
|
3966
|
-
}]
|
|
3967
|
-
}], propDecorators: { resizeEnabled: [{
|
|
3968
|
-
type: HostBinding,
|
|
3969
|
-
args: ['class.resizeable']
|
|
3970
|
-
}, {
|
|
3971
|
-
type: Input,
|
|
3972
|
-
args: [{ transform: booleanAttribute }]
|
|
3973
|
-
}], minWidth: [{
|
|
3974
|
-
type: Input,
|
|
3975
|
-
args: [{ transform: numberAttribute }]
|
|
3976
|
-
}], maxWidth: [{
|
|
3977
|
-
type: Input,
|
|
3978
|
-
args: [{ transform: numberAttribute }]
|
|
3979
|
-
}], resize: [{
|
|
3980
|
-
type: Output
|
|
3981
|
-
}], resizing: [{
|
|
3982
|
-
type: Output
|
|
3983
|
-
}], onMousedown: [{
|
|
3984
|
-
type: HostListener,
|
|
3985
|
-
args: ['mousedown', ['$event']]
|
|
3986
3371
|
}] } });
|
|
3987
3372
|
|
|
3988
3373
|
/**
|
|
@@ -4065,15 +3450,9 @@ function sortRows(rows, columns, dirs) {
|
|
|
4065
3450
|
if (!dirs || !dirs.length || !columns) {
|
|
4066
3451
|
return [...rows];
|
|
4067
3452
|
}
|
|
4068
|
-
/**
|
|
4069
|
-
* record the row ordering of results from prior sort operations (if applicable)
|
|
4070
|
-
* this is necessary to guarantee stable sorting behavior
|
|
4071
|
-
*/
|
|
4072
|
-
const rowToIndexMap = new Map();
|
|
4073
|
-
rows.forEach((row, index) => rowToIndexMap.set(row, index));
|
|
4074
3453
|
const temp = [...rows];
|
|
4075
3454
|
const cols = columns.reduce((obj, col) => {
|
|
4076
|
-
if (col.
|
|
3455
|
+
if (col.sortable) {
|
|
4077
3456
|
obj[col.prop] = col.comparator;
|
|
4078
3457
|
}
|
|
4079
3458
|
return obj;
|
|
@@ -4086,10 +3465,10 @@ function sortRows(rows, columns, dirs) {
|
|
|
4086
3465
|
prop,
|
|
4087
3466
|
dir: dir.dir,
|
|
4088
3467
|
valueGetter: getterForProp(prop),
|
|
4089
|
-
compareFn: cols[prop]
|
|
3468
|
+
compareFn: cols[prop]
|
|
4090
3469
|
};
|
|
4091
3470
|
});
|
|
4092
|
-
return temp.sort(
|
|
3471
|
+
return temp.sort((rowA, rowB) => {
|
|
4093
3472
|
for (const cachedDir of cachedDirs) {
|
|
4094
3473
|
// Get property and valuegetters for column to be sorted
|
|
4095
3474
|
const { prop, valueGetter } = cachedDir;
|
|
@@ -4111,13 +3490,7 @@ function sortRows(rows, columns, dirs) {
|
|
|
4111
3490
|
return comparison;
|
|
4112
3491
|
}
|
|
4113
3492
|
}
|
|
4114
|
-
|
|
4115
|
-
return 0;
|
|
4116
|
-
}
|
|
4117
|
-
/**
|
|
4118
|
-
* all else being equal, preserve original order of the rows (stable sort)
|
|
4119
|
-
*/
|
|
4120
|
-
return rowToIndexMap.get(rowA) < rowToIndexMap.get(rowB) ? -1 : 1;
|
|
3493
|
+
return 0;
|
|
4121
3494
|
});
|
|
4122
3495
|
}
|
|
4123
3496
|
function sortGroupedRows(groupedRows, columns, dirs, sortOnGroupHeader) {
|
|
@@ -4218,6 +3591,9 @@ class DataTableHeaderCellComponent {
|
|
|
4218
3591
|
this.sort = new EventEmitter();
|
|
4219
3592
|
this.select = new EventEmitter();
|
|
4220
3593
|
this.columnContextmenu = new EventEmitter(false);
|
|
3594
|
+
this.resize = new EventEmitter();
|
|
3595
|
+
this.resizing = new EventEmitter();
|
|
3596
|
+
this.element = inject(ElementRef).nativeElement;
|
|
4221
3597
|
// Counter to reset sort once user sort asc and desc.
|
|
4222
3598
|
this.totalSortStatesApplied = 0;
|
|
4223
3599
|
this.cellContext = {
|
|
@@ -4230,6 +3606,9 @@ class DataTableHeaderCellComponent {
|
|
|
4230
3606
|
}
|
|
4231
3607
|
onContextmenu($event) {
|
|
4232
3608
|
this.columnContextmenu.emit({ event: $event, column: this.column });
|
|
3609
|
+
if (this.column.draggable) {
|
|
3610
|
+
$event.preventDefault();
|
|
3611
|
+
}
|
|
4233
3612
|
}
|
|
4234
3613
|
enter() {
|
|
4235
3614
|
this.onSort();
|
|
@@ -4241,6 +3620,9 @@ class DataTableHeaderCellComponent {
|
|
|
4241
3620
|
this.totalSortStatesApplied = 1;
|
|
4242
3621
|
}
|
|
4243
3622
|
}
|
|
3623
|
+
ngOnDestroy() {
|
|
3624
|
+
this.destroySubscription();
|
|
3625
|
+
}
|
|
4244
3626
|
calcSortDir(sorts) {
|
|
4245
3627
|
if (sorts && this.column) {
|
|
4246
3628
|
const sort = sorts.find((s) => {
|
|
@@ -4270,24 +3652,53 @@ class DataTableHeaderCellComponent {
|
|
|
4270
3652
|
}
|
|
4271
3653
|
calcSortClass(sortDir) {
|
|
4272
3654
|
if (!this.cellContext.column.sortable) {
|
|
4273
|
-
return;
|
|
3655
|
+
return undefined;
|
|
4274
3656
|
}
|
|
4275
3657
|
if (sortDir === SortDirection.asc) {
|
|
4276
|
-
return `sort-btn sort-asc ${this.sortAscendingIcon}`;
|
|
3658
|
+
return `sort-btn sort-asc ${this.sortAscendingIcon ?? 'datatable-icon-up'}`;
|
|
4277
3659
|
}
|
|
4278
3660
|
else if (sortDir === SortDirection.desc) {
|
|
4279
|
-
return `sort-btn sort-desc ${this.sortDescendingIcon}`;
|
|
3661
|
+
return `sort-btn sort-desc ${this.sortDescendingIcon ?? 'datatable-icon-down'}`;
|
|
4280
3662
|
}
|
|
4281
3663
|
else {
|
|
4282
|
-
return `sort-btn ${this.sortUnsetIcon}`;
|
|
3664
|
+
return `sort-btn ${this.sortUnsetIcon ?? 'datatable-icon-sort-unset'}`;
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
onMousedown(event) {
|
|
3668
|
+
const isMouse = event instanceof MouseEvent;
|
|
3669
|
+
const initialWidth = this.element.clientWidth;
|
|
3670
|
+
const { screenX } = getPositionFromEvent(event);
|
|
3671
|
+
event.stopPropagation();
|
|
3672
|
+
const mouseup = fromEvent(document, isMouse ? 'mouseup' : 'touchend');
|
|
3673
|
+
this.subscription = mouseup.subscribe(() => this.onMouseup());
|
|
3674
|
+
const mouseMoveSub = fromEvent(document, isMouse ? 'mousemove' : 'touchmove')
|
|
3675
|
+
.pipe(takeUntil$1(mouseup))
|
|
3676
|
+
.subscribe((e) => this.move(e, initialWidth, screenX));
|
|
3677
|
+
this.subscription.add(mouseMoveSub);
|
|
3678
|
+
}
|
|
3679
|
+
onMouseup() {
|
|
3680
|
+
if (this.subscription && !this.subscription.closed) {
|
|
3681
|
+
this.destroySubscription();
|
|
3682
|
+
this.resize.emit({ width: this.element.clientWidth, column: this.column });
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
move(event, initialWidth, mouseDownScreenX) {
|
|
3686
|
+
const movementX = getPositionFromEvent(event).screenX - mouseDownScreenX;
|
|
3687
|
+
const newWidth = initialWidth + movementX;
|
|
3688
|
+
this.resizing.emit({ width: newWidth, column: this.column });
|
|
3689
|
+
}
|
|
3690
|
+
destroySubscription() {
|
|
3691
|
+
if (this.subscription) {
|
|
3692
|
+
this.subscription.unsubscribe();
|
|
3693
|
+
this.subscription = undefined;
|
|
4283
3694
|
}
|
|
4284
3695
|
}
|
|
4285
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4286
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3696
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3697
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableHeaderCellComponent, isStandalone: true, selector: "datatable-header-cell", inputs: { sortType: "sortType", sortAscendingIcon: "sortAscendingIcon", sortDescendingIcon: "sortDescendingIcon", sortUnsetIcon: "sortUnsetIcon", isTarget: "isTarget", targetMarkerTemplate: "targetMarkerTemplate", targetMarkerContext: "targetMarkerContext", enableClearingSortState: "enableClearingSortState", allRowsSelected: "allRowsSelected", selectionType: "selectionType", column: "column", headerHeight: "headerHeight", sorts: "sorts" }, outputs: { sort: "sort", select: "select", columnContextmenu: "columnContextmenu", resize: "resize", resizing: "resizing" }, host: { listeners: { "contextmenu": "onContextmenu($event)", "keydown.enter": "enter()" }, properties: { "attr.resizeable": "column.resizeable", "style.height.px": "this.headerHeight", "class": "this.columnCssClasses", "attr.title": "this.name", "style.minWidth.px": "this.minWidth", "style.maxWidth.px": "this.maxWidth", "style.width.px": "this.width", "tabindex": "this.tabindex" }, classAttribute: "datatable-header-cell" }, ngImport: i0, template: `
|
|
4287
3698
|
<div class="datatable-header-cell-template-wrap">
|
|
4288
3699
|
@if (isTarget) {
|
|
4289
3700
|
<ng-template
|
|
4290
|
-
[ngTemplateOutlet]="targetMarkerTemplate"
|
|
3701
|
+
[ngTemplateOutlet]="targetMarkerTemplate!"
|
|
4291
3702
|
[ngTemplateOutletContext]="targetMarkerContext"
|
|
4292
3703
|
>
|
|
4293
3704
|
</ng-template>
|
|
@@ -4310,17 +3721,22 @@ class DataTableHeaderCellComponent {
|
|
|
4310
3721
|
}
|
|
4311
3722
|
<span (click)="onSort()" [class]="sortClass"> </span>
|
|
4312
3723
|
</div>
|
|
4313
|
-
|
|
3724
|
+
@if (column.resizeable) {
|
|
3725
|
+
<span
|
|
3726
|
+
class="resize-handle"
|
|
3727
|
+
(mousedown)="onMousedown($event)"
|
|
3728
|
+
(touchstart)="onMousedown($event)"
|
|
3729
|
+
></span>
|
|
3730
|
+
}
|
|
3731
|
+
`, isInline: true, styles: [":host{overflow-x:hidden;vertical-align:top;line-height:1.625;position:relative;display:inline-block}:host:focus{outline:none}:host-context(ngx-datatable.fixed-header) :host{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host.sortable .datatable-header-cell-wrapper{cursor:pointer}:host.longpress .datatable-header-cell-wrapper{cursor:move}.datatable-header-cell-template-wrap{height:inherit}.sort-btn{line-height:100%;vertical-align:middle;display:inline-block;cursor:pointer}.resize-handle,.resize-handle--not-resizable{display:inline-block;position:absolute;right:0;top:0;bottom:0;width:5px;padding:0 4px;visibility:hidden}.resize-handle{cursor:ew-resize}:host(.resizeable:hover) .resize-handle{visibility:visible}@media (hover: none){:host{touch-action:none}:host .resize-handle{visibility:visible}:host .datatable-header-cell-label.draggable{-webkit-user-select:none;user-select:none}}.resize-handle--not-resizable :host(:hover){visibility:visible}:host::ng-deep .targetMarker{position:absolute;top:0;bottom:0}:host::ng-deep .targetMarker.dragFromLeft{right:0}:host::ng-deep .targetMarker.dragFromRight{left:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4314
3732
|
}
|
|
4315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableHeaderCellComponent, decorators: [{
|
|
4316
3734
|
type: Component,
|
|
4317
|
-
args: [{
|
|
4318
|
-
selector: 'datatable-header-cell',
|
|
4319
|
-
template: `
|
|
3735
|
+
args: [{ selector: 'datatable-header-cell', template: `
|
|
4320
3736
|
<div class="datatable-header-cell-template-wrap">
|
|
4321
3737
|
@if (isTarget) {
|
|
4322
3738
|
<ng-template
|
|
4323
|
-
[ngTemplateOutlet]="targetMarkerTemplate"
|
|
3739
|
+
[ngTemplateOutlet]="targetMarkerTemplate!"
|
|
4324
3740
|
[ngTemplateOutletContext]="targetMarkerContext"
|
|
4325
3741
|
>
|
|
4326
3742
|
</ng-template>
|
|
@@ -4343,13 +3759,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
4343
3759
|
}
|
|
4344
3760
|
<span (click)="onSort()" [class]="sortClass"> </span>
|
|
4345
3761
|
</div>
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
3762
|
+
@if (column.resizeable) {
|
|
3763
|
+
<span
|
|
3764
|
+
class="resize-handle"
|
|
3765
|
+
(mousedown)="onMousedown($event)"
|
|
3766
|
+
(touchstart)="onMousedown($event)"
|
|
3767
|
+
></span>
|
|
3768
|
+
}
|
|
3769
|
+
`, host: {
|
|
3770
|
+
'class': 'datatable-header-cell',
|
|
3771
|
+
'[attr.resizeable]': 'column.resizeable'
|
|
3772
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], styles: [":host{overflow-x:hidden;vertical-align:top;line-height:1.625;position:relative;display:inline-block}:host:focus{outline:none}:host-context(ngx-datatable.fixed-header) :host{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host.sortable .datatable-header-cell-wrapper{cursor:pointer}:host.longpress .datatable-header-cell-wrapper{cursor:move}.datatable-header-cell-template-wrap{height:inherit}.sort-btn{line-height:100%;vertical-align:middle;display:inline-block;cursor:pointer}.resize-handle,.resize-handle--not-resizable{display:inline-block;position:absolute;right:0;top:0;bottom:0;width:5px;padding:0 4px;visibility:hidden}.resize-handle{cursor:ew-resize}:host(.resizeable:hover) .resize-handle{visibility:visible}@media (hover: none){:host{touch-action:none}:host .resize-handle{visibility:visible}:host .datatable-header-cell-label.draggable{-webkit-user-select:none;user-select:none}}.resize-handle--not-resizable :host(:hover){visibility:visible}:host::ng-deep .targetMarker{position:absolute;top:0;bottom:0}:host::ng-deep .targetMarker.dragFromLeft{right:0}:host::ng-deep .targetMarker.dragFromRight{left:0}\n"] }]
|
|
4353
3773
|
}], ctorParameters: () => [], propDecorators: { sortType: [{
|
|
4354
3774
|
type: Input
|
|
4355
3775
|
}], sortAscendingIcon: [{
|
|
@@ -4385,6 +3805,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
4385
3805
|
type: Output
|
|
4386
3806
|
}], columnContextmenu: [{
|
|
4387
3807
|
type: Output
|
|
3808
|
+
}], resize: [{
|
|
3809
|
+
type: Output
|
|
3810
|
+
}], resizing: [{
|
|
3811
|
+
type: Output
|
|
4388
3812
|
}], columnCssClasses: [{
|
|
4389
3813
|
type: HostBinding,
|
|
4390
3814
|
args: ['class']
|
|
@@ -4494,9 +3918,9 @@ class OrderableDirective {
|
|
|
4494
3918
|
const target = this.isTarget(model, event);
|
|
4495
3919
|
if (target) {
|
|
4496
3920
|
this.reorder.emit({
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
model
|
|
3921
|
+
prevValue: prevPos.index,
|
|
3922
|
+
newValue: target.i,
|
|
3923
|
+
column: model
|
|
4500
3924
|
});
|
|
4501
3925
|
}
|
|
4502
3926
|
this.lastDraggingIndex = undefined;
|
|
@@ -4504,9 +3928,8 @@ class OrderableDirective {
|
|
|
4504
3928
|
}
|
|
4505
3929
|
isTarget(model, event) {
|
|
4506
3930
|
let i = 0;
|
|
4507
|
-
const
|
|
4508
|
-
const
|
|
4509
|
-
const targets = this.document.elementsFromPoint(x, y);
|
|
3931
|
+
const { clientX, clientY } = getPositionFromEvent(event);
|
|
3932
|
+
const targets = this.document.elementsFromPoint(clientX, clientY);
|
|
4510
3933
|
for (const id in this.positions) {
|
|
4511
3934
|
// current column position which throws event.
|
|
4512
3935
|
const pos = this.positions[id];
|
|
@@ -4526,14 +3949,13 @@ class OrderableDirective {
|
|
|
4526
3949
|
return acc;
|
|
4527
3950
|
}, {});
|
|
4528
3951
|
}
|
|
4529
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4530
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3952
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: OrderableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3953
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: OrderableDirective, isStandalone: true, selector: "[orderable]", outputs: { reorder: "reorder", targetChanged: "targetChanged" }, queries: [{ propertyName: "draggables", predicate: DraggableDirective, descendants: true }], ngImport: i0 }); }
|
|
4531
3954
|
}
|
|
4532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: OrderableDirective, decorators: [{
|
|
4533
3956
|
type: Directive,
|
|
4534
3957
|
args: [{
|
|
4535
|
-
selector: '[orderable]'
|
|
4536
|
-
standalone: true
|
|
3958
|
+
selector: '[orderable]'
|
|
4537
3959
|
}]
|
|
4538
3960
|
}], propDecorators: { reorder: [{
|
|
4539
3961
|
type: Output
|
|
@@ -4642,17 +4064,17 @@ class DataTableHeaderComponent {
|
|
|
4642
4064
|
}
|
|
4643
4065
|
return '100%';
|
|
4644
4066
|
}
|
|
4645
|
-
onColumnResized(width, column) {
|
|
4067
|
+
onColumnResized({ width, column }) {
|
|
4646
4068
|
this.resize.emit(this.makeResizeEvent(width, column));
|
|
4647
4069
|
}
|
|
4648
|
-
onColumnResizing(width, column) {
|
|
4070
|
+
onColumnResizing({ width, column }) {
|
|
4649
4071
|
this.resizing.emit(this.makeResizeEvent(width, column));
|
|
4650
4072
|
}
|
|
4651
4073
|
makeResizeEvent(width, column) {
|
|
4652
|
-
if (width <= column.minWidth) {
|
|
4074
|
+
if (column.minWidth && width <= column.minWidth) {
|
|
4653
4075
|
width = column.minWidth;
|
|
4654
4076
|
}
|
|
4655
|
-
else if (width >= column.maxWidth) {
|
|
4077
|
+
else if (column.maxWidth && width >= column.maxWidth) {
|
|
4656
4078
|
width = column.maxWidth;
|
|
4657
4079
|
}
|
|
4658
4080
|
return {
|
|
@@ -4661,15 +4083,11 @@ class DataTableHeaderComponent {
|
|
|
4661
4083
|
newValue: width
|
|
4662
4084
|
};
|
|
4663
4085
|
}
|
|
4664
|
-
onColumnReordered(
|
|
4665
|
-
const column = this.getColumn(
|
|
4086
|
+
onColumnReordered(event) {
|
|
4087
|
+
const column = this.getColumn(event.newValue);
|
|
4666
4088
|
column.isTarget = false;
|
|
4667
4089
|
column.targetMarkerContext = undefined;
|
|
4668
|
-
this.reorder.emit(
|
|
4669
|
-
column: model,
|
|
4670
|
-
prevValue: prevIndex,
|
|
4671
|
-
newValue: newIndex
|
|
4672
|
-
});
|
|
4090
|
+
this.reorder.emit(event);
|
|
4673
4091
|
}
|
|
4674
4092
|
onTargetChanged({ prevIndex, newIndex, initialIndex }) {
|
|
4675
4093
|
if (prevIndex || prevIndex === 0) {
|
|
@@ -4758,8 +4176,8 @@ class DataTableHeaderComponent {
|
|
|
4758
4176
|
width: `${widths[group]}px`
|
|
4759
4177
|
};
|
|
4760
4178
|
}
|
|
4761
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4762
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4180
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableHeaderComponent, isStandalone: true, selector: "datatable-header", inputs: { sortAscendingIcon: "sortAscendingIcon", sortDescendingIcon: "sortDescendingIcon", sortUnsetIcon: "sortUnsetIcon", scrollbarH: "scrollbarH", dealsWithGroup: "dealsWithGroup", targetMarkerTemplate: "targetMarkerTemplate", enableClearingSortState: "enableClearingSortState", innerWidth: "innerWidth", sorts: "sorts", sortType: "sortType", allRowsSelected: "allRowsSelected", selectionType: "selectionType", reorderable: "reorderable", verticalScrollVisible: "verticalScrollVisible", headerHeight: "headerHeight", columns: "columns", offsetX: "offsetX" }, outputs: { sort: "sort", reorder: "reorder", resize: "resize", resizing: "resizing", select: "select", columnContextmenu: "columnContextmenu" }, host: { properties: { "style.height": "this.headerHeight", "style.width": "this.headerWidth" }, classAttribute: "datatable-header" }, usesOnChanges: true, ngImport: i0, template: `
|
|
4763
4181
|
<div
|
|
4764
4182
|
role="row"
|
|
4765
4183
|
orderable
|
|
@@ -4768,15 +4186,17 @@ class DataTableHeaderComponent {
|
|
|
4768
4186
|
[style.width.px]="_columnGroupWidths.total"
|
|
4769
4187
|
class="datatable-header-inner"
|
|
4770
4188
|
>
|
|
4771
|
-
@for (colGroup of _columnsByPin; track colGroup.type) {
|
|
4772
|
-
<div
|
|
4189
|
+
@for (colGroup of _columnsByPin; track colGroup.type) { @if (colGroup.columns.length) {
|
|
4190
|
+
<div
|
|
4191
|
+
class="datatable-row-group"
|
|
4192
|
+
[ngClass]="'datatable-row-' + colGroup.type"
|
|
4193
|
+
[ngStyle]="_styleByGroup[colGroup.type]"
|
|
4194
|
+
>
|
|
4773
4195
|
@for (column of colGroup.columns; track column.$$id) {
|
|
4774
4196
|
<datatable-header-cell
|
|
4775
4197
|
role="columnheader"
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
(resize)="onColumnResized($event, column)"
|
|
4779
|
-
(resizing)="onColumnResizing($event, column)"
|
|
4198
|
+
(resize)="onColumnResized($event)"
|
|
4199
|
+
(resizing)="onColumnResizing($event)"
|
|
4780
4200
|
long-press
|
|
4781
4201
|
[pressModel]="column"
|
|
4782
4202
|
[pressEnabled]="reorderable && column.draggable"
|
|
@@ -4807,15 +4227,13 @@ class DataTableHeaderComponent {
|
|
|
4807
4227
|
</datatable-header-cell>
|
|
4808
4228
|
}
|
|
4809
4229
|
</div>
|
|
4810
|
-
}
|
|
4230
|
+
} }
|
|
4811
4231
|
</div>
|
|
4812
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: OrderableDirective, selector: "[orderable]", outputs: ["reorder", "targetChanged"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: DataTableHeaderCellComponent, selector: "datatable-header-cell", inputs: ["sortType", "sortAscendingIcon", "sortDescendingIcon", "sortUnsetIcon", "isTarget", "targetMarkerTemplate", "targetMarkerContext", "enableClearingSortState", "allRowsSelected", "selectionType", "column", "headerHeight", "sorts"], outputs: ["sort", "select", "columnContextmenu"] }, { kind: "directive", type:
|
|
4232
|
+
`, isInline: true, styles: [":host{display:block;overflow:hidden}.datatable-header-inner{display:flex}:host-context(ngx-datatable.fixed-header) .datatable-header-inner{white-space:nowrap}.datatable-row-group{display:flex}.datatable-row-left,.datatable-row-right{position:sticky;z-index:9}.datatable-row-left{left:0}.datatable-row-right{right:0}\n"], dependencies: [{ kind: "directive", type: OrderableDirective, selector: "[orderable]", outputs: ["reorder", "targetChanged"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: DataTableHeaderCellComponent, selector: "datatable-header-cell", inputs: ["sortType", "sortAscendingIcon", "sortDescendingIcon", "sortUnsetIcon", "isTarget", "targetMarkerTemplate", "targetMarkerContext", "enableClearingSortState", "allRowsSelected", "selectionType", "column", "headerHeight", "sorts"], outputs: ["sort", "select", "columnContextmenu", "resize", "resizing"] }, { kind: "directive", type: LongPressDirective, selector: "[long-press]", inputs: ["pressEnabled", "pressModel", "duration"], outputs: ["longPressStart", "longPressEnd"] }, { kind: "directive", type: DraggableDirective, selector: "[draggable]", inputs: ["dragEventTarget", "dragModel", "dragX", "dragY"], outputs: ["dragStart", "dragging", "dragEnd"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4813
4233
|
}
|
|
4814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableHeaderComponent, decorators: [{
|
|
4815
4235
|
type: Component,
|
|
4816
|
-
args: [{
|
|
4817
|
-
selector: 'datatable-header',
|
|
4818
|
-
template: `
|
|
4236
|
+
args: [{ selector: 'datatable-header', template: `
|
|
4819
4237
|
<div
|
|
4820
4238
|
role="row"
|
|
4821
4239
|
orderable
|
|
@@ -4824,15 +4242,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
4824
4242
|
[style.width.px]="_columnGroupWidths.total"
|
|
4825
4243
|
class="datatable-header-inner"
|
|
4826
4244
|
>
|
|
4827
|
-
@for (colGroup of _columnsByPin; track colGroup.type) {
|
|
4828
|
-
<div
|
|
4245
|
+
@for (colGroup of _columnsByPin; track colGroup.type) { @if (colGroup.columns.length) {
|
|
4246
|
+
<div
|
|
4247
|
+
class="datatable-row-group"
|
|
4248
|
+
[ngClass]="'datatable-row-' + colGroup.type"
|
|
4249
|
+
[ngStyle]="_styleByGroup[colGroup.type]"
|
|
4250
|
+
>
|
|
4829
4251
|
@for (column of colGroup.columns; track column.$$id) {
|
|
4830
4252
|
<datatable-header-cell
|
|
4831
4253
|
role="columnheader"
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
(resize)="onColumnResized($event, column)"
|
|
4835
|
-
(resizing)="onColumnResizing($event, column)"
|
|
4254
|
+
(resize)="onColumnResized($event)"
|
|
4255
|
+
(resizing)="onColumnResizing($event)"
|
|
4836
4256
|
long-press
|
|
4837
4257
|
[pressModel]="column"
|
|
4838
4258
|
[pressEnabled]="reorderable && column.draggable"
|
|
@@ -4863,22 +4283,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
4863
4283
|
</datatable-header-cell>
|
|
4864
4284
|
}
|
|
4865
4285
|
</div>
|
|
4866
|
-
}
|
|
4286
|
+
} }
|
|
4867
4287
|
</div>
|
|
4868
|
-
`,
|
|
4869
|
-
host: {
|
|
4288
|
+
`, host: {
|
|
4870
4289
|
class: 'datatable-header'
|
|
4871
|
-
},
|
|
4872
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4873
|
-
imports: [
|
|
4290
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
4874
4291
|
OrderableDirective,
|
|
4875
4292
|
NgStyle,
|
|
4876
4293
|
DataTableHeaderCellComponent,
|
|
4877
|
-
ResizeableDirective,
|
|
4878
4294
|
LongPressDirective,
|
|
4879
|
-
DraggableDirective
|
|
4880
|
-
|
|
4881
|
-
|
|
4295
|
+
DraggableDirective,
|
|
4296
|
+
NgClass
|
|
4297
|
+
], styles: [":host{display:block;overflow:hidden}.datatable-header-inner{display:flex}:host-context(ngx-datatable.fixed-header) .datatable-header-inner{white-space:nowrap}.datatable-row-group{display:flex}.datatable-row-left,.datatable-row-right{position:sticky;z-index:9}.datatable-row-left{left:0}.datatable-row-right{right:0}\n"] }]
|
|
4882
4298
|
}], propDecorators: { sortAscendingIcon: [{
|
|
4883
4299
|
type: Input
|
|
4884
4300
|
}], sortDescendingIcon: [{
|
|
@@ -4987,7 +4403,7 @@ function throttleable(duration, options) {
|
|
|
4987
4403
|
enumerable: descriptor.enumerable,
|
|
4988
4404
|
value: throttle(descriptor.value, duration, options)
|
|
4989
4405
|
});
|
|
4990
|
-
return
|
|
4406
|
+
return target[key];
|
|
4991
4407
|
}
|
|
4992
4408
|
};
|
|
4993
4409
|
};
|
|
@@ -5008,7 +4424,7 @@ function getTotalFlexGrow(columns) {
|
|
|
5008
4424
|
* Inspired by: https://github.com/facebook/fixed-data-table/blob/master/src/FixedDataTableWidthHelper.js
|
|
5009
4425
|
*/
|
|
5010
4426
|
function adjustColumnWidths(allColumns, expectedWidth) {
|
|
5011
|
-
const columnsWidth =
|
|
4427
|
+
const columnsWidth = columnTotalWidth(allColumns);
|
|
5012
4428
|
const totalFlexGrow = getTotalFlexGrow(allColumns);
|
|
5013
4429
|
const colsByGroup = columnsByPin(allColumns);
|
|
5014
4430
|
if (columnsWidth !== expectedWidth) {
|
|
@@ -5020,21 +4436,17 @@ function adjustColumnWidths(allColumns, expectedWidth) {
|
|
|
5020
4436
|
*/
|
|
5021
4437
|
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) {
|
|
5022
4438
|
// calculate total width and flexgrow points for columns that can be resized
|
|
5023
|
-
for (const
|
|
5024
|
-
if (
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
else {
|
|
5035
|
-
column.width = 0;
|
|
5036
|
-
}
|
|
5037
|
-
}
|
|
4439
|
+
for (const column of Object.values(colsByGroup).flat()) {
|
|
4440
|
+
if (column.$$oldWidth) {
|
|
4441
|
+
// when manually resized, switch off auto-resize
|
|
4442
|
+
column.canAutoResize = false;
|
|
4443
|
+
}
|
|
4444
|
+
if (!column.canAutoResize) {
|
|
4445
|
+
maxWidth -= column.width;
|
|
4446
|
+
totalFlexGrow -= column.flexGrow ? column.flexGrow : 0;
|
|
4447
|
+
}
|
|
4448
|
+
else {
|
|
4449
|
+
column.width = 0;
|
|
5038
4450
|
}
|
|
5039
4451
|
}
|
|
5040
4452
|
const hasMinWidth = {};
|
|
@@ -5043,21 +4455,17 @@ function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) {
|
|
|
5043
4455
|
do {
|
|
5044
4456
|
const widthPerFlexPoint = remainingWidth / totalFlexGrow;
|
|
5045
4457
|
remainingWidth = 0;
|
|
5046
|
-
for (const
|
|
5047
|
-
if
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
else {
|
|
5058
|
-
column.width = newWidth;
|
|
5059
|
-
}
|
|
5060
|
-
}
|
|
4458
|
+
for (const column of Object.values(colsByGroup).flat()) {
|
|
4459
|
+
// if the column can be resize and it hasn't reached its minimum width yet
|
|
4460
|
+
if (column.canAutoResize && !hasMinWidth[column.prop]) {
|
|
4461
|
+
const newWidth = column.width + column.flexGrow * widthPerFlexPoint;
|
|
4462
|
+
if (column.minWidth !== undefined && newWidth < column.minWidth) {
|
|
4463
|
+
remainingWidth += newWidth - column.minWidth;
|
|
4464
|
+
column.width = column.minWidth;
|
|
4465
|
+
hasMinWidth[column.prop] = true;
|
|
4466
|
+
}
|
|
4467
|
+
else {
|
|
4468
|
+
column.width = newWidth;
|
|
5061
4469
|
}
|
|
5062
4470
|
}
|
|
5063
4471
|
}
|
|
@@ -5169,11 +4577,15 @@ function getContentWidth(allColumns, defaultColWidth = 150) {
|
|
|
5169
4577
|
|
|
5170
4578
|
class DataTablePagerComponent {
|
|
5171
4579
|
constructor() {
|
|
4580
|
+
this.dataTable = inject(DatatableComponent, { optional: true });
|
|
5172
4581
|
this.change = new EventEmitter();
|
|
5173
4582
|
this._count = 0;
|
|
5174
4583
|
this._page = 1;
|
|
5175
4584
|
this._size = 0;
|
|
5176
4585
|
}
|
|
4586
|
+
get messages() {
|
|
4587
|
+
return this.dataTable?.messages ?? {};
|
|
4588
|
+
}
|
|
5177
4589
|
set size(val) {
|
|
5178
4590
|
this._size = val;
|
|
5179
4591
|
this.pages = this.calcPages();
|
|
@@ -5246,90 +4658,114 @@ class DataTablePagerComponent {
|
|
|
5246
4658
|
}
|
|
5247
4659
|
return pages;
|
|
5248
4660
|
}
|
|
5249
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5250
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTablePagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4662
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTablePagerComponent, isStandalone: true, selector: "datatable-pager", inputs: { pagerLeftArrowIcon: "pagerLeftArrowIcon", pagerRightArrowIcon: "pagerRightArrowIcon", pagerPreviousIcon: "pagerPreviousIcon", pagerNextIcon: "pagerNextIcon", size: "size", count: "count", page: "page" }, outputs: { change: "change" }, host: { classAttribute: "datatable-pager" }, ngImport: i0, template: `
|
|
5251
4663
|
<ul class="pager">
|
|
5252
4664
|
<li [class.disabled]="!canPrevious()">
|
|
5253
|
-
<a
|
|
5254
|
-
|
|
4665
|
+
<a
|
|
4666
|
+
role="button"
|
|
4667
|
+
[attr.aria-label]="messages.ariaFirstPageMessage ?? 'go to first page'"
|
|
4668
|
+
(click)="selectPage(1)"
|
|
4669
|
+
>
|
|
4670
|
+
<i class="{{ pagerPreviousIcon ?? 'datatable-icon-prev' }}"></i>
|
|
5255
4671
|
</a>
|
|
5256
4672
|
</li>
|
|
5257
4673
|
<li [class.disabled]="!canPrevious()">
|
|
5258
|
-
<a
|
|
5259
|
-
|
|
4674
|
+
<a
|
|
4675
|
+
role="button"
|
|
4676
|
+
[attr.aria-label]="messages.ariaPreviousPageMessage ?? 'go to previous page'"
|
|
4677
|
+
(click)="prevPage()"
|
|
4678
|
+
>
|
|
4679
|
+
<i class="{{ pagerLeftArrowIcon ?? 'datatable-icon-left' }}"></i>
|
|
5260
4680
|
</a>
|
|
5261
4681
|
</li>
|
|
5262
4682
|
@for (pg of pages; track pg.number) {
|
|
5263
4683
|
<li
|
|
5264
|
-
|
|
5265
|
-
[attr.aria-label]="'page ' + pg.number"
|
|
4684
|
+
[attr.aria-label]="(messages.ariaPageNMessage ?? 'page') + ' ' + pg.number"
|
|
5266
4685
|
class="pages"
|
|
5267
4686
|
[class.active]="pg.number === page"
|
|
5268
4687
|
>
|
|
5269
|
-
<a (click)="selectPage(pg.number)">
|
|
4688
|
+
<a role="button" (click)="selectPage(pg.number)">
|
|
5270
4689
|
{{ pg.text }}
|
|
5271
4690
|
</a>
|
|
5272
4691
|
</li>
|
|
5273
4692
|
}
|
|
5274
4693
|
<li [class.disabled]="!canNext()">
|
|
5275
|
-
<a
|
|
5276
|
-
|
|
4694
|
+
<a
|
|
4695
|
+
role="button"
|
|
4696
|
+
[attr.aria-label]="messages.ariaNextPageMessage ?? 'go to next page'"
|
|
4697
|
+
(click)="nextPage()"
|
|
4698
|
+
>
|
|
4699
|
+
<i class="{{ pagerRightArrowIcon ?? 'datatable-icon-right' }}"></i>
|
|
5277
4700
|
</a>
|
|
5278
4701
|
</li>
|
|
5279
4702
|
<li [class.disabled]="!canNext()">
|
|
5280
|
-
<a
|
|
5281
|
-
|
|
4703
|
+
<a
|
|
4704
|
+
role="button"
|
|
4705
|
+
[attr.aria-label]="messages.ariaLastPageMessage ?? 'go to last page'"
|
|
4706
|
+
(click)="selectPage(totalPages)"
|
|
4707
|
+
>
|
|
4708
|
+
<i class="{{ pagerNextIcon ?? 'datatable-icon-skip' }}"></i>
|
|
5282
4709
|
</a>
|
|
5283
4710
|
</li>
|
|
5284
4711
|
</ul>
|
|
5285
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4712
|
+
`, isInline: true, styles: [":host-context(datatable-footer .selected-count) .datatable-pager{flex:1 1 60%}:host{flex:1 1 80%;text-align:right}.pager,.pager li{padding:0;margin:0;display:inline-block;list-style:none}.pager li,.pager li a{outline:none}.pager li a{cursor:pointer;display:inline-block}.pager li.disabled a{cursor:not-allowed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5286
4713
|
}
|
|
5287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTablePagerComponent, decorators: [{
|
|
5288
4715
|
type: Component,
|
|
5289
|
-
args: [{
|
|
5290
|
-
selector: 'datatable-pager',
|
|
5291
|
-
template: `
|
|
4716
|
+
args: [{ selector: 'datatable-pager', template: `
|
|
5292
4717
|
<ul class="pager">
|
|
5293
4718
|
<li [class.disabled]="!canPrevious()">
|
|
5294
|
-
<a
|
|
5295
|
-
|
|
4719
|
+
<a
|
|
4720
|
+
role="button"
|
|
4721
|
+
[attr.aria-label]="messages.ariaFirstPageMessage ?? 'go to first page'"
|
|
4722
|
+
(click)="selectPage(1)"
|
|
4723
|
+
>
|
|
4724
|
+
<i class="{{ pagerPreviousIcon ?? 'datatable-icon-prev' }}"></i>
|
|
5296
4725
|
</a>
|
|
5297
4726
|
</li>
|
|
5298
4727
|
<li [class.disabled]="!canPrevious()">
|
|
5299
|
-
<a
|
|
5300
|
-
|
|
4728
|
+
<a
|
|
4729
|
+
role="button"
|
|
4730
|
+
[attr.aria-label]="messages.ariaPreviousPageMessage ?? 'go to previous page'"
|
|
4731
|
+
(click)="prevPage()"
|
|
4732
|
+
>
|
|
4733
|
+
<i class="{{ pagerLeftArrowIcon ?? 'datatable-icon-left' }}"></i>
|
|
5301
4734
|
</a>
|
|
5302
4735
|
</li>
|
|
5303
4736
|
@for (pg of pages; track pg.number) {
|
|
5304
4737
|
<li
|
|
5305
|
-
|
|
5306
|
-
[attr.aria-label]="'page ' + pg.number"
|
|
4738
|
+
[attr.aria-label]="(messages.ariaPageNMessage ?? 'page') + ' ' + pg.number"
|
|
5307
4739
|
class="pages"
|
|
5308
4740
|
[class.active]="pg.number === page"
|
|
5309
4741
|
>
|
|
5310
|
-
<a (click)="selectPage(pg.number)">
|
|
4742
|
+
<a role="button" (click)="selectPage(pg.number)">
|
|
5311
4743
|
{{ pg.text }}
|
|
5312
4744
|
</a>
|
|
5313
4745
|
</li>
|
|
5314
4746
|
}
|
|
5315
4747
|
<li [class.disabled]="!canNext()">
|
|
5316
|
-
<a
|
|
5317
|
-
|
|
4748
|
+
<a
|
|
4749
|
+
role="button"
|
|
4750
|
+
[attr.aria-label]="messages.ariaNextPageMessage ?? 'go to next page'"
|
|
4751
|
+
(click)="nextPage()"
|
|
4752
|
+
>
|
|
4753
|
+
<i class="{{ pagerRightArrowIcon ?? 'datatable-icon-right' }}"></i>
|
|
5318
4754
|
</a>
|
|
5319
4755
|
</li>
|
|
5320
4756
|
<li [class.disabled]="!canNext()">
|
|
5321
|
-
<a
|
|
5322
|
-
|
|
4757
|
+
<a
|
|
4758
|
+
role="button"
|
|
4759
|
+
[attr.aria-label]="messages.ariaLastPageMessage ?? 'go to last page'"
|
|
4760
|
+
(click)="selectPage(totalPages)"
|
|
4761
|
+
>
|
|
4762
|
+
<i class="{{ pagerNextIcon ?? 'datatable-icon-skip' }}"></i>
|
|
5323
4763
|
</a>
|
|
5324
4764
|
</li>
|
|
5325
4765
|
</ul>
|
|
5326
|
-
`,
|
|
5327
|
-
host: {
|
|
4766
|
+
`, host: {
|
|
5328
4767
|
class: 'datatable-pager'
|
|
5329
|
-
},
|
|
5330
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5331
|
-
standalone: true
|
|
5332
|
-
}]
|
|
4768
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host-context(datatable-footer .selected-count) .datatable-pager{flex:1 1 60%}:host{flex:1 1 80%;text-align:right}.pager,.pager li{padding:0;margin:0;display:inline-block;list-style:none}.pager li,.pager li a{outline:none}.pager li a{cursor:pointer;display:inline-block}.pager li.disabled a{cursor:not-allowed}\n"] }]
|
|
5333
4769
|
}], propDecorators: { pagerLeftArrowIcon: [{
|
|
5334
4770
|
type: Input
|
|
5335
4771
|
}], pagerRightArrowIcon: [{
|
|
@@ -5359,16 +4795,16 @@ class DataTableFooterComponent {
|
|
|
5359
4795
|
get curPage() {
|
|
5360
4796
|
return this.offset + 1;
|
|
5361
4797
|
}
|
|
5362
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5363
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4799
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DataTableFooterComponent, isStandalone: true, selector: "datatable-footer", inputs: { footerHeight: "footerHeight", rowCount: "rowCount", pageSize: "pageSize", offset: "offset", pagerLeftArrowIcon: "pagerLeftArrowIcon", pagerRightArrowIcon: "pagerRightArrowIcon", pagerPreviousIcon: "pagerPreviousIcon", pagerNextIcon: "pagerNextIcon", totalMessage: "totalMessage", footerTemplate: "footerTemplate", selectedCount: "selectedCount", selectedMessage: "selectedMessage" }, outputs: { page: "page" }, host: { classAttribute: "datatable-footer" }, ngImport: i0, template: `
|
|
5364
4800
|
<div
|
|
5365
4801
|
class="datatable-footer-inner"
|
|
5366
4802
|
[ngClass]="{ 'selected-count': selectedMessage }"
|
|
5367
4803
|
[style.height.px]="footerHeight"
|
|
5368
4804
|
>
|
|
5369
|
-
@if (footerTemplate) {
|
|
4805
|
+
@if (footerTemplate?.template) {
|
|
5370
4806
|
<ng-template
|
|
5371
|
-
[ngTemplateOutlet]="footerTemplate
|
|
4807
|
+
[ngTemplateOutlet]="footerTemplate!.template!"
|
|
5372
4808
|
[ngTemplateOutletContext]="{
|
|
5373
4809
|
rowCount: rowCount,
|
|
5374
4810
|
pageSize: pageSize,
|
|
@@ -5385,6 +4821,7 @@ class DataTableFooterComponent {
|
|
|
5385
4821
|
}
|
|
5386
4822
|
{{ rowCount?.toLocaleString() }} {{ totalMessage }}
|
|
5387
4823
|
</div>
|
|
4824
|
+
@if (isVisible) {
|
|
5388
4825
|
<datatable-pager
|
|
5389
4826
|
[pagerLeftArrowIcon]="pagerLeftArrowIcon"
|
|
5390
4827
|
[pagerRightArrowIcon]="pagerRightArrowIcon"
|
|
@@ -5393,27 +4830,24 @@ class DataTableFooterComponent {
|
|
|
5393
4830
|
[page]="curPage"
|
|
5394
4831
|
[size]="pageSize"
|
|
5395
4832
|
[count]="rowCount"
|
|
5396
|
-
[hidden]="!isVisible"
|
|
5397
4833
|
(change)="page.emit($event)"
|
|
5398
4834
|
>
|
|
5399
4835
|
</datatable-pager>
|
|
5400
|
-
}
|
|
4836
|
+
} }
|
|
5401
4837
|
</div>
|
|
5402
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DataTablePagerComponent, selector: "datatable-pager", inputs: ["pagerLeftArrowIcon", "pagerRightArrowIcon", "pagerPreviousIcon", "pagerNextIcon", "size", "count", "page"], outputs: ["change"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4838
|
+
`, isInline: true, styles: [":host{display:block;width:100%;overflow:auto}.datatable-footer-inner{display:flex;align-items:center;width:100%}.page-count{flex:1 1 20%}.selected-count .page-count{flex:1 1 40%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DataTablePagerComponent, selector: "datatable-pager", inputs: ["pagerLeftArrowIcon", "pagerRightArrowIcon", "pagerPreviousIcon", "pagerNextIcon", "size", "count", "page"], outputs: ["change"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5403
4839
|
}
|
|
5404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4840
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DataTableFooterComponent, decorators: [{
|
|
5405
4841
|
type: Component,
|
|
5406
|
-
args: [{
|
|
5407
|
-
selector: 'datatable-footer',
|
|
5408
|
-
template: `
|
|
4842
|
+
args: [{ selector: 'datatable-footer', template: `
|
|
5409
4843
|
<div
|
|
5410
4844
|
class="datatable-footer-inner"
|
|
5411
4845
|
[ngClass]="{ 'selected-count': selectedMessage }"
|
|
5412
4846
|
[style.height.px]="footerHeight"
|
|
5413
4847
|
>
|
|
5414
|
-
@if (footerTemplate) {
|
|
4848
|
+
@if (footerTemplate?.template) {
|
|
5415
4849
|
<ng-template
|
|
5416
|
-
[ngTemplateOutlet]="footerTemplate
|
|
4850
|
+
[ngTemplateOutlet]="footerTemplate!.template!"
|
|
5417
4851
|
[ngTemplateOutletContext]="{
|
|
5418
4852
|
rowCount: rowCount,
|
|
5419
4853
|
pageSize: pageSize,
|
|
@@ -5430,6 +4864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
5430
4864
|
}
|
|
5431
4865
|
{{ rowCount?.toLocaleString() }} {{ totalMessage }}
|
|
5432
4866
|
</div>
|
|
4867
|
+
@if (isVisible) {
|
|
5433
4868
|
<datatable-pager
|
|
5434
4869
|
[pagerLeftArrowIcon]="pagerLeftArrowIcon"
|
|
5435
4870
|
[pagerRightArrowIcon]="pagerRightArrowIcon"
|
|
@@ -5438,19 +4873,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
5438
4873
|
[page]="curPage"
|
|
5439
4874
|
[size]="pageSize"
|
|
5440
4875
|
[count]="rowCount"
|
|
5441
|
-
[hidden]="!isVisible"
|
|
5442
4876
|
(change)="page.emit($event)"
|
|
5443
4877
|
>
|
|
5444
4878
|
</datatable-pager>
|
|
5445
|
-
}
|
|
4879
|
+
} }
|
|
5446
4880
|
</div>
|
|
5447
|
-
`,
|
|
5448
|
-
host: {
|
|
4881
|
+
`, host: {
|
|
5449
4882
|
class: 'datatable-footer'
|
|
5450
|
-
},
|
|
5451
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5452
|
-
imports: [NgClass, NgTemplateOutlet, DataTablePagerComponent]
|
|
5453
|
-
}]
|
|
4883
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, NgTemplateOutlet, DataTablePagerComponent], styles: [":host{display:block;width:100%;overflow:auto}.datatable-footer-inner{display:flex;align-items:center;width:100%}.page-count{flex:1 1 20%}.selected-count .page-count{flex:1 1 40%}\n"] }]
|
|
5454
4884
|
}], propDecorators: { footerHeight: [{
|
|
5455
4885
|
type: Input
|
|
5456
4886
|
}], rowCount: [{
|
|
@@ -5527,14 +4957,13 @@ class VisibilityDirective {
|
|
|
5527
4957
|
};
|
|
5528
4958
|
this.timeout = setTimeout(() => check());
|
|
5529
4959
|
}
|
|
5530
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5531
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
4960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: VisibilityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4961
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: VisibilityDirective, isStandalone: true, selector: "[visibilityObserver]", outputs: { visible: "visible" }, host: { properties: { "class.visible": "this.isVisible" } }, ngImport: i0 }); }
|
|
5532
4962
|
}
|
|
5533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: VisibilityDirective, decorators: [{
|
|
5534
4964
|
type: Directive,
|
|
5535
4965
|
args: [{
|
|
5536
|
-
selector: '[visibilityObserver]'
|
|
5537
|
-
standalone: true
|
|
4966
|
+
selector: '[visibilityObserver]'
|
|
5538
4967
|
}]
|
|
5539
4968
|
}], propDecorators: { isVisible: [{
|
|
5540
4969
|
type: HostBinding,
|
|
@@ -5544,8 +4973,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
5544
4973
|
}] } });
|
|
5545
4974
|
|
|
5546
4975
|
class ProgressBarComponent {
|
|
5547
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5548
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4976
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4977
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: ProgressBarComponent, isStandalone: true, selector: "datatable-progress", ngImport: i0, template: `
|
|
5549
4978
|
<div class="progress-linear" role="progressbar">
|
|
5550
4979
|
<div class="container">
|
|
5551
4980
|
<div class="bar"></div>
|
|
@@ -5553,7 +4982,7 @@ class ProgressBarComponent {
|
|
|
5553
4982
|
</div>
|
|
5554
4983
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5555
4984
|
}
|
|
5556
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4985
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
5557
4986
|
type: Component,
|
|
5558
4987
|
args: [{
|
|
5559
4988
|
selector: 'datatable-progress',
|
|
@@ -5564,17 +4993,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
5564
4993
|
</div>
|
|
5565
4994
|
</div>
|
|
5566
4995
|
`,
|
|
5567
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5568
|
-
standalone: true
|
|
4996
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5569
4997
|
}]
|
|
5570
4998
|
}] });
|
|
5571
4999
|
|
|
5000
|
+
/**
|
|
5001
|
+
* Converts strings from something to camel case
|
|
5002
|
+
* http://stackoverflow.com/questions/10425287/convert-dash-separated-string-to-camelcase
|
|
5003
|
+
*/
|
|
5004
|
+
function camelCase(str) {
|
|
5005
|
+
// Replace special characters with a space
|
|
5006
|
+
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
|
|
5007
|
+
// put a space before an uppercase letter
|
|
5008
|
+
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
|
|
5009
|
+
// Lower case first character and some other stuff
|
|
5010
|
+
str = str
|
|
5011
|
+
.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g, '')
|
|
5012
|
+
.trim()
|
|
5013
|
+
.toLowerCase();
|
|
5014
|
+
// uppercase characters preceded by a space or number
|
|
5015
|
+
str = str.replace(/([ 0-9]+)([a-zA-Z])/g, function (a, b, c) {
|
|
5016
|
+
return b.trim() + c.toUpperCase();
|
|
5017
|
+
});
|
|
5018
|
+
return str;
|
|
5019
|
+
}
|
|
5020
|
+
/**
|
|
5021
|
+
* Converts strings from camel case to words
|
|
5022
|
+
* http://stackoverflow.com/questions/7225407/convert-camelcasetext-to-camel-case-text
|
|
5023
|
+
*/
|
|
5024
|
+
function deCamelCase(str) {
|
|
5025
|
+
return str.replace(/([A-Z])/g, match => ` ${match}`).replace(/^./, match => match.toUpperCase());
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
/**
|
|
5029
|
+
* Creates a unique object id.
|
|
5030
|
+
* http://stackoverflow.com/questions/6248666/how-to-generate-short-uid-like-ax4j9z-in-js
|
|
5031
|
+
*/
|
|
5032
|
+
function id() {
|
|
5033
|
+
return ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);
|
|
5034
|
+
}
|
|
5035
|
+
|
|
5036
|
+
function toInternalColumn(columns, defaultColumnWidth = 150) {
|
|
5037
|
+
let hasTreeColumn = false;
|
|
5038
|
+
// TS fails to infer the type here.
|
|
5039
|
+
return columns.map(column => {
|
|
5040
|
+
const prop = column.prop ?? (column.name ? camelCase(column.name) : undefined);
|
|
5041
|
+
// Only one column should hold the tree view,
|
|
5042
|
+
// Thus if multiple columns are provided with
|
|
5043
|
+
// isTreeColumn as true, we take only the first one
|
|
5044
|
+
const isTreeColumn = !!column.isTreeColumn && !hasTreeColumn;
|
|
5045
|
+
hasTreeColumn = hasTreeColumn || isTreeColumn;
|
|
5046
|
+
// TODO: add check if prop or name is provided if sorting is enabled.
|
|
5047
|
+
return {
|
|
5048
|
+
...column,
|
|
5049
|
+
$$id: id(),
|
|
5050
|
+
$$valueGetter: getterForProp(prop),
|
|
5051
|
+
prop,
|
|
5052
|
+
name: column.name ?? (prop ? deCamelCase(String(prop)) : ''),
|
|
5053
|
+
resizeable: column.resizeable ?? true,
|
|
5054
|
+
sortable: column.sortable ?? true,
|
|
5055
|
+
comparator: column.comparator ?? orderByComparator,
|
|
5056
|
+
draggable: column.draggable ?? true,
|
|
5057
|
+
canAutoResize: column.canAutoResize ?? true,
|
|
5058
|
+
width: column.width ?? defaultColumnWidth,
|
|
5059
|
+
isTreeColumn,
|
|
5060
|
+
// in case of the directive, those are getters, so call them explicitly.
|
|
5061
|
+
headerTemplate: column.headerTemplate,
|
|
5062
|
+
cellTemplate: column.cellTemplate,
|
|
5063
|
+
summaryTemplate: column.summaryTemplate,
|
|
5064
|
+
ghostCellTemplate: column.ghostCellTemplate
|
|
5065
|
+
}; // TS cannot cast here
|
|
5066
|
+
});
|
|
5067
|
+
}
|
|
5068
|
+
|
|
5069
|
+
const NGX_DATATABLE_CONFIG = new InjectionToken('ngx-datatable.config');
|
|
5070
|
+
/**
|
|
5071
|
+
* Provides a global configuration for ngx-datatable.
|
|
5072
|
+
*
|
|
5073
|
+
* @param overrides The overrides of the table configuration.
|
|
5074
|
+
*/
|
|
5075
|
+
function providedNgxDatatableConfig(overrides) {
|
|
5076
|
+
return {
|
|
5077
|
+
provide: NGX_DATATABLE_CONFIG,
|
|
5078
|
+
useValue: overrides
|
|
5079
|
+
};
|
|
5080
|
+
}
|
|
5081
|
+
|
|
5572
5082
|
class DatatableComponent {
|
|
5573
5083
|
/**
|
|
5574
5084
|
* Rows that are displayed in the table.
|
|
5575
5085
|
*/
|
|
5576
5086
|
set rows(val) {
|
|
5577
|
-
this._rows = val;
|
|
5087
|
+
this._rows = val ?? [];
|
|
5578
5088
|
// This will ensure that datatable detects changes on doing like this rows = [...rows];
|
|
5579
5089
|
this.rowDiffer.diff([]);
|
|
5580
5090
|
if (val) {
|
|
@@ -5593,7 +5103,7 @@ class DatatableComponent {
|
|
|
5593
5103
|
set groupRowsBy(val) {
|
|
5594
5104
|
if (val) {
|
|
5595
5105
|
this._groupRowsBy = val;
|
|
5596
|
-
if (this.
|
|
5106
|
+
if (this._groupRowsBy) {
|
|
5597
5107
|
// creates a new array with the data grouped
|
|
5598
5108
|
this.groupedRows = this.groupArrayBy(this._rows, this._groupRowsBy);
|
|
5599
5109
|
}
|
|
@@ -5607,8 +5117,7 @@ class DatatableComponent {
|
|
|
5607
5117
|
*/
|
|
5608
5118
|
set columns(val) {
|
|
5609
5119
|
if (val) {
|
|
5610
|
-
this._internalColumns =
|
|
5611
|
-
setColumnDefaults(this._internalColumns, this._defaultColumnWidth);
|
|
5120
|
+
this._internalColumns = toInternalColumn(val, this._defaultColumnWidth);
|
|
5612
5121
|
this.recalculateColumns();
|
|
5613
5122
|
}
|
|
5614
5123
|
this._columns = val;
|
|
@@ -5667,7 +5176,7 @@ class DatatableComponent {
|
|
|
5667
5176
|
this._ghostLoadingIndicator = val;
|
|
5668
5177
|
if (val && this.scrollbarV && !this.externalPaging) {
|
|
5669
5178
|
// in case where we don't have predefined total page length
|
|
5670
|
-
this.rows = [...
|
|
5179
|
+
this.rows = [...this.rows, undefined]; // undefined row will render ghost cell row at the end of the page
|
|
5671
5180
|
}
|
|
5672
5181
|
}
|
|
5673
5182
|
get ghostLoadingIndicator() {
|
|
@@ -5760,7 +5269,9 @@ class DatatableComponent {
|
|
|
5760
5269
|
this.scrollbarHelper = inject(ScrollbarHelper);
|
|
5761
5270
|
this.cd = inject(ChangeDetectorRef);
|
|
5762
5271
|
this.columnChangesService = inject(ColumnChangesService);
|
|
5763
|
-
this.configuration = inject(
|
|
5272
|
+
this.configuration = inject(NGX_DATATABLE_CONFIG, { optional: true }) ??
|
|
5273
|
+
// This is the old injection token for backward compatibility.
|
|
5274
|
+
inject('configuration', { optional: true });
|
|
5764
5275
|
/**
|
|
5765
5276
|
* List of row objects that should be
|
|
5766
5277
|
* represented as selected in the grid.
|
|
@@ -5839,31 +5350,25 @@ class DatatableComponent {
|
|
|
5839
5350
|
/**
|
|
5840
5351
|
* Css class overrides
|
|
5841
5352
|
*/
|
|
5842
|
-
this.cssClasses = {
|
|
5843
|
-
sortAscending: 'datatable-icon-up',
|
|
5844
|
-
sortDescending: 'datatable-icon-down',
|
|
5845
|
-
sortUnset: 'datatable-icon-sort-unset',
|
|
5846
|
-
pagerLeftArrow: 'datatable-icon-left',
|
|
5847
|
-
pagerRightArrow: 'datatable-icon-right',
|
|
5848
|
-
pagerPrevious: 'datatable-icon-prev',
|
|
5849
|
-
pagerNext: 'datatable-icon-skip'
|
|
5850
|
-
};
|
|
5353
|
+
this.cssClasses = {};
|
|
5851
5354
|
/**
|
|
5852
5355
|
* Message overrides for localization
|
|
5853
5356
|
*
|
|
5854
|
-
*
|
|
5855
|
-
*
|
|
5856
|
-
*
|
|
5357
|
+
* @defaultValue
|
|
5358
|
+
* ```
|
|
5359
|
+
* {
|
|
5360
|
+
* emptyMessage: 'No data to display',
|
|
5361
|
+
* totalMessage: 'total',
|
|
5362
|
+
* selectedMessage: 'selected',
|
|
5363
|
+
* ariaFirstPageMessage: 'go to first page',
|
|
5364
|
+
* ariaPreviousPageMessage: 'go to previous page',
|
|
5365
|
+
* ariaPageNMessage: 'page',
|
|
5366
|
+
* ariaNextPageMessage: 'go to next page',
|
|
5367
|
+
* ariaLastPageMessage: 'go to last page'
|
|
5368
|
+
* }
|
|
5369
|
+
* ```
|
|
5857
5370
|
*/
|
|
5858
|
-
this.messages = {
|
|
5859
|
-
// Message to show when array is presented
|
|
5860
|
-
// but contains no values
|
|
5861
|
-
emptyMessage: 'No data to display',
|
|
5862
|
-
// Footer total message
|
|
5863
|
-
totalMessage: 'total',
|
|
5864
|
-
// Footer selected message
|
|
5865
|
-
selectedMessage: 'selected'
|
|
5866
|
-
};
|
|
5371
|
+
this.messages = {};
|
|
5867
5372
|
/**
|
|
5868
5373
|
* A boolean you can use to set the detault behaviour of rows and groups
|
|
5869
5374
|
* whether they will start expanded or not. If ommited the default is NOT expanded.
|
|
@@ -5949,9 +5454,11 @@ class DatatableComponent {
|
|
|
5949
5454
|
this.element = inject(ElementRef).nativeElement;
|
|
5950
5455
|
this.rowDiffer = inject(KeyValueDiffers).find([]).create();
|
|
5951
5456
|
this.rowCount = 0;
|
|
5952
|
-
this._offsetX =
|
|
5457
|
+
this._offsetX = 0;
|
|
5953
5458
|
this._count = 0;
|
|
5954
5459
|
this._offset = 0;
|
|
5460
|
+
this._rows = [];
|
|
5461
|
+
this._internalRows = [];
|
|
5955
5462
|
this._subscriptions = [];
|
|
5956
5463
|
this._ghostLoadingIndicator = false;
|
|
5957
5464
|
this.verticalScrollVisible = false;
|
|
@@ -6018,7 +5525,8 @@ class DatatableComponent {
|
|
|
6018
5525
|
count: this.count,
|
|
6019
5526
|
pageSize: this.pageSize,
|
|
6020
5527
|
limit: this.limit,
|
|
6021
|
-
offset: 0
|
|
5528
|
+
offset: 0,
|
|
5529
|
+
sorts: this.sorts
|
|
6022
5530
|
});
|
|
6023
5531
|
}
|
|
6024
5532
|
});
|
|
@@ -6039,10 +5547,8 @@ class DatatableComponent {
|
|
|
6039
5547
|
*/
|
|
6040
5548
|
translateColumns(val) {
|
|
6041
5549
|
if (val) {
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
this._internalColumns = translateTemplates(arr);
|
|
6045
|
-
setColumnDefaults(this._internalColumns, this._defaultColumnWidth);
|
|
5550
|
+
if (val.length) {
|
|
5551
|
+
this._internalColumns = toInternalColumn(val, this._defaultColumnWidth);
|
|
6046
5552
|
this.recalculateColumns();
|
|
6047
5553
|
if (!this.externalSorting && this.rows?.length) {
|
|
6048
5554
|
this.sortInternalRows();
|
|
@@ -6062,12 +5568,17 @@ class DatatableComponent {
|
|
|
6062
5568
|
const map = new Map();
|
|
6063
5569
|
let i = 0;
|
|
6064
5570
|
originalArray.forEach(item => {
|
|
5571
|
+
if (!item) {
|
|
5572
|
+
// skip undefined items
|
|
5573
|
+
return;
|
|
5574
|
+
}
|
|
6065
5575
|
const key = item[groupBy];
|
|
6066
|
-
|
|
5576
|
+
const value = map.get(key);
|
|
5577
|
+
if (!value) {
|
|
6067
5578
|
map.set(key, [item]);
|
|
6068
5579
|
}
|
|
6069
5580
|
else {
|
|
6070
|
-
|
|
5581
|
+
value.push(item);
|
|
6071
5582
|
}
|
|
6072
5583
|
i++;
|
|
6073
5584
|
});
|
|
@@ -6090,7 +5601,7 @@ class DatatableComponent {
|
|
|
6090
5601
|
}
|
|
6091
5602
|
// auto group by parent on new update
|
|
6092
5603
|
this._internalRows = groupRowsByParents(this._internalRows, optionalGetterForProp(this.treeFromRelation), optionalGetterForProp(this.treeToRelation));
|
|
6093
|
-
if (this.
|
|
5604
|
+
if (this._groupRowsBy) {
|
|
6094
5605
|
// If a column has been specified in _groupRowsBy create a new array with the data grouped by that row
|
|
6095
5606
|
this.groupedRows = this.groupArrayBy(this._rows, this._groupRowsBy);
|
|
6096
5607
|
}
|
|
@@ -6201,7 +5712,8 @@ class DatatableComponent {
|
|
|
6201
5712
|
count: this.count,
|
|
6202
5713
|
pageSize: this.pageSize,
|
|
6203
5714
|
limit: this.limit,
|
|
6204
|
-
offset: this.offset
|
|
5715
|
+
offset: this.offset,
|
|
5716
|
+
sorts: this.sorts
|
|
6205
5717
|
});
|
|
6206
5718
|
}
|
|
6207
5719
|
}
|
|
@@ -6209,9 +5721,8 @@ class DatatableComponent {
|
|
|
6209
5721
|
* The body triggered a scroll event.
|
|
6210
5722
|
*/
|
|
6211
5723
|
onBodyScroll(event) {
|
|
6212
|
-
this._offsetX
|
|
5724
|
+
this._offsetX = event.offsetX;
|
|
6213
5725
|
this.scroll.emit(event);
|
|
6214
|
-
this.cd.detectChanges();
|
|
6215
5726
|
}
|
|
6216
5727
|
/**
|
|
6217
5728
|
* The footer triggered a page event.
|
|
@@ -6223,7 +5734,8 @@ class DatatableComponent {
|
|
|
6223
5734
|
count: this.count,
|
|
6224
5735
|
pageSize: this.pageSize,
|
|
6225
5736
|
limit: this.limit,
|
|
6226
|
-
offset: this.offset
|
|
5737
|
+
offset: this.offset,
|
|
5738
|
+
sorts: this.sorts
|
|
6227
5739
|
});
|
|
6228
5740
|
if (this.selectAllRowsOnPage) {
|
|
6229
5741
|
this.selected = [];
|
|
@@ -6259,9 +5771,6 @@ class DatatableComponent {
|
|
|
6259
5771
|
*/
|
|
6260
5772
|
calcRowCount() {
|
|
6261
5773
|
if (!this.externalPaging) {
|
|
6262
|
-
if (!this.rows) {
|
|
6263
|
-
return 0;
|
|
6264
|
-
}
|
|
6265
5774
|
if (this.groupedRows) {
|
|
6266
5775
|
return this.groupedRows.length;
|
|
6267
5776
|
}
|
|
@@ -6294,18 +5803,12 @@ class DatatableComponent {
|
|
|
6294
5803
|
if (column === undefined) {
|
|
6295
5804
|
return;
|
|
6296
5805
|
}
|
|
6297
|
-
|
|
6298
|
-
const cols = this._internalColumns.map(
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
// set this so we can force the column
|
|
6304
|
-
// width distribution to be to this value
|
|
6305
|
-
c.$$oldWidth = newValue;
|
|
6306
|
-
}
|
|
6307
|
-
return c;
|
|
6308
|
-
});
|
|
5806
|
+
const idx = this._internalColumns.indexOf(column);
|
|
5807
|
+
const cols = this._internalColumns.map(col => ({ ...col }));
|
|
5808
|
+
cols[idx].width = newValue;
|
|
5809
|
+
// set this so we can force the column
|
|
5810
|
+
// width distribution to be to this value
|
|
5811
|
+
cols[idx].$$oldWidth = newValue;
|
|
6309
5812
|
this.recalculateColumns(cols, idx);
|
|
6310
5813
|
this._internalColumns = cols;
|
|
6311
5814
|
this.resize.emit({
|
|
@@ -6326,7 +5829,8 @@ class DatatableComponent {
|
|
|
6326
5829
|
/**
|
|
6327
5830
|
* The header triggered a column re-order event.
|
|
6328
5831
|
*/
|
|
6329
|
-
onColumnReorder(
|
|
5832
|
+
onColumnReorder(event) {
|
|
5833
|
+
const { column, newValue, prevValue } = event;
|
|
6330
5834
|
const cols = this._internalColumns.map(c => ({ ...c }));
|
|
6331
5835
|
if (this.swapColumns) {
|
|
6332
5836
|
const prevCol = cols[newValue];
|
|
@@ -6350,11 +5854,7 @@ class DatatableComponent {
|
|
|
6350
5854
|
}
|
|
6351
5855
|
}
|
|
6352
5856
|
this._internalColumns = cols;
|
|
6353
|
-
this.reorder.emit(
|
|
6354
|
-
column,
|
|
6355
|
-
newValue,
|
|
6356
|
-
prevValue
|
|
6357
|
-
});
|
|
5857
|
+
this.reorder.emit(event);
|
|
6358
5858
|
}
|
|
6359
5859
|
/**
|
|
6360
5860
|
* The header triggered a column sort event.
|
|
@@ -6384,7 +5884,8 @@ class DatatableComponent {
|
|
|
6384
5884
|
count: this.count,
|
|
6385
5885
|
pageSize: this.pageSize,
|
|
6386
5886
|
limit: this.limit,
|
|
6387
|
-
offset: this.offset
|
|
5887
|
+
offset: this.offset,
|
|
5888
|
+
sorts: this.sorts
|
|
6388
5889
|
});
|
|
6389
5890
|
this.sort.emit(event);
|
|
6390
5891
|
}
|
|
@@ -6401,16 +5902,16 @@ class DatatableComponent {
|
|
|
6401
5902
|
this.selected = [];
|
|
6402
5903
|
// do the opposite here
|
|
6403
5904
|
if (!allSelected) {
|
|
6404
|
-
this.selected.push(...this._internalRows.slice(first, last));
|
|
5905
|
+
this.selected.push(...this._internalRows.slice(first, last).filter(row => !!row));
|
|
6405
5906
|
}
|
|
6406
5907
|
}
|
|
6407
5908
|
else {
|
|
6408
5909
|
let relevantRows;
|
|
6409
5910
|
if (this.disableRowCheck) {
|
|
6410
|
-
relevantRows = this.rows.filter(row => !this.disableRowCheck(row));
|
|
5911
|
+
relevantRows = this.rows.filter((row => row && !this.disableRowCheck(row)));
|
|
6411
5912
|
}
|
|
6412
5913
|
else {
|
|
6413
|
-
relevantRows = this.rows;
|
|
5914
|
+
relevantRows = this.rows.filter(row => !!row);
|
|
6414
5915
|
}
|
|
6415
5916
|
// before we splice, chk if we currently have all selected
|
|
6416
5917
|
const allSelected = this.selected.length === relevantRows.length;
|
|
@@ -6437,7 +5938,7 @@ class DatatableComponent {
|
|
|
6437
5938
|
onTreeAction(event) {
|
|
6438
5939
|
const row = event.row;
|
|
6439
5940
|
// TODO: For duplicated items this will not work
|
|
6440
|
-
const rowIndex = this._rows.findIndex(r => r[this.treeToRelation] === event.row[this.treeToRelation]);
|
|
5941
|
+
const rowIndex = this._rows.findIndex(r => r && r[this.treeToRelation] === event.row[this.treeToRelation]);
|
|
6441
5942
|
this.treeAction.emit({ row, rowIndex });
|
|
6442
5943
|
}
|
|
6443
5944
|
ngOnDestroy() {
|
|
@@ -6473,21 +5974,21 @@ class DatatableComponent {
|
|
|
6473
5974
|
this._internalRows = sortRows(this._internalRows, this._internalColumns, this.sorts);
|
|
6474
5975
|
}
|
|
6475
5976
|
}
|
|
6476
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
6477
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
5977
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5978
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: DatatableComponent, isStandalone: true, selector: "ngx-datatable", inputs: { targetMarkerTemplate: "targetMarkerTemplate", rows: "rows", groupRowsBy: "groupRowsBy", groupedRows: "groupedRows", columns: "columns", selected: "selected", scrollbarV: ["scrollbarV", "scrollbarV", booleanAttribute], scrollbarVDynamic: ["scrollbarVDynamic", "scrollbarVDynamic", booleanAttribute], scrollbarH: ["scrollbarH", "scrollbarH", booleanAttribute], rowHeight: "rowHeight", columnMode: "columnMode", headerHeight: ["headerHeight", "headerHeight", numberAttribute], footerHeight: ["footerHeight", "footerHeight", numberAttribute], externalPaging: ["externalPaging", "externalPaging", booleanAttribute], externalSorting: ["externalSorting", "externalSorting", booleanAttribute], limit: ["limit", "limit", numberAttribute], count: ["count", "count", numberAttribute], offset: ["offset", "offset", numberAttribute], loadingIndicator: ["loadingIndicator", "loadingIndicator", booleanAttribute], ghostLoadingIndicator: ["ghostLoadingIndicator", "ghostLoadingIndicator", booleanAttribute], selectionType: "selectionType", reorderable: ["reorderable", "reorderable", booleanAttribute], swapColumns: ["swapColumns", "swapColumns", booleanAttribute], sortType: "sortType", sorts: "sorts", cssClasses: "cssClasses", messages: "messages", rowClass: "rowClass", selectCheck: "selectCheck", displayCheck: "displayCheck", groupExpansionDefault: ["groupExpansionDefault", "groupExpansionDefault", booleanAttribute], trackByProp: "trackByProp", selectAllRowsOnPage: ["selectAllRowsOnPage", "selectAllRowsOnPage", booleanAttribute], virtualization: ["virtualization", "virtualization", booleanAttribute], treeFromRelation: "treeFromRelation", treeToRelation: "treeToRelation", summaryRow: ["summaryRow", "summaryRow", booleanAttribute], summaryHeight: ["summaryHeight", "summaryHeight", numberAttribute], summaryPosition: "summaryPosition", disableRowCheck: "disableRowCheck", rowDraggable: ["rowDraggable", "rowDraggable", booleanAttribute], enableClearingSortState: ["enableClearingSortState", "enableClearingSortState", booleanAttribute], rowIdentity: "rowIdentity" }, outputs: { scroll: "scroll", activate: "activate", select: "select", sort: "sort", page: "page", reorder: "reorder", resize: "resize", tableContextmenu: "tableContextmenu", treeAction: "treeAction", rowDragEvents: "rowDragEvents" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "class.fixed-header": "this.isFixedHeader", "class.fixed-row": "this.isFixedRow", "class.scroll-vertical": "this.isVertScroll", "class.virtualized": "this.isVirtualized", "class.scroll-horz": "this.isHorScroll", "class.selectable": "this.isSelectable", "class.checkbox-selection": "this.isCheckboxSelection", "class.cell-selection": "this.isCellSelection", "class.single-selection": "this.isSingleSelection", "class.multi-selection": "this.isMultiSelection", "class.multi-click-selection": "this.isMultiClickSelection" }, classAttribute: "ngx-datatable" }, providers: [
|
|
6478
5979
|
{
|
|
6479
5980
|
provide: DatatableComponentToken,
|
|
6480
5981
|
useExisting: DatatableComponent
|
|
6481
5982
|
},
|
|
6482
5983
|
ColumnChangesService
|
|
6483
|
-
], queries: [{ propertyName: "rowDetail", first: true, predicate: DatatableRowDetailDirective, descendants: true }, { propertyName: "groupHeader", first: true, predicate: DatatableGroupHeaderDirective, descendants: true }, { propertyName: "footer", first: true, predicate: DatatableFooterDirective, descendants: true }, { propertyName: "rowDefTemplate", first: true, predicate: DatatableRowDefDirective, descendants: true, read: TemplateRef }, { propertyName: "columnTemplates", predicate: DataTableColumnDirective }], viewQueries: [{ propertyName: "bodyComponent", first: true, predicate: DataTableBodyComponent, descendants: true }, { propertyName: "headerComponent", first: true, predicate: DataTableHeaderComponent, descendants: true }, { propertyName: "bodyElement", first: true, predicate: DataTableBodyComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<div visibilityObserver (visible)=\"recalculate()\">\n <div role=\"table\">\n @if (headerHeight) {\n <datatable-header\n role=\"rowgroup\"\n [sorts]=\"sorts\"\n [sortType]=\"sortType\"\n [scrollbarH]=\"scrollbarH\"\n [innerWidth]=\"_innerWidth\"\n [offsetX]=\"_offsetX | async\"\n [dealsWithGroup]=\"groupedRows !== undefined\"\n [columns]=\"_internalColumns\"\n [headerHeight]=\"headerHeight\"\n [reorderable]=\"reorderable\"\n [targetMarkerTemplate]=\"targetMarkerTemplate\"\n [sortAscendingIcon]=\"cssClasses.sortAscending\"\n [sortDescendingIcon]=\"cssClasses.sortDescending\"\n [sortUnsetIcon]=\"cssClasses.sortUnset\"\n [allRowsSelected]=\"allRowsSelected\"\n [selectionType]=\"selectionType\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n [enableClearingSortState]=\"enableClearingSortState\"\n (sort)=\"onColumnSort($event)\"\n (resize)=\"onColumnResize($event)\"\n (resizing)=\"onColumnResizing($event)\"\n (reorder)=\"onColumnReorder($event)\"\n (select)=\"onHeaderSelect()\"\n (columnContextmenu)=\"onColumnContextmenu($event)\"\n >\n </datatable-header>\n }\n <datatable-body\n tabindex=\"0\"\n role=\"rowgroup\"\n [groupRowsBy]=\"groupRowsBy\"\n [groupedRows]=\"groupedRows\"\n [rows]=\"_internalRows\"\n [groupExpansionDefault]=\"groupExpansionDefault\"\n [scrollbarV]=\"scrollbarV\"\n [scrollbarH]=\"scrollbarH\"\n [virtualization]=\"virtualization\"\n [loadingIndicator]=\"loadingIndicator\"\n [ghostLoadingIndicator]=\"ghostLoadingIndicator\"\n [externalPaging]=\"externalPaging\"\n [rowHeight]=\"rowHeight\"\n [rowCount]=\"rowCount\"\n [offset]=\"offset\"\n [trackByProp]=\"trackByProp\"\n [columns]=\"_internalColumns\"\n [pageSize]=\"pageSize\"\n [offsetX]=\"_offsetX | async\"\n [rowDetail]=\"rowDetail\"\n [groupHeader]=\"groupHeader\"\n [selected]=\"selected\"\n [innerWidth]=\"_innerWidth\"\n [bodyHeight]=\"bodyHeight\"\n [selectionType]=\"selectionType\"\n [rowIdentity]=\"rowIdentity\"\n [rowClass]=\"rowClass\"\n [selectCheck]=\"selectCheck\"\n [displayCheck]=\"displayCheck\"\n [summaryRow]=\"summaryRow\"\n [summaryHeight]=\"summaryHeight\"\n [summaryPosition]=\"summaryPosition\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n (page)=\"onBodyPage($event)\"\n (activate)=\"activate.emit($event)\"\n (rowContextmenu)=\"onRowContextmenu($event)\"\n (select)=\"onBodySelect($event)\"\n (scroll)=\"onBodyScroll($event)\"\n (treeAction)=\"onTreeAction($event)\"\n [disableRowCheck]=\"disableRowCheck\"\n [rowDraggable]=\"rowDraggable\"\n [rowDragEvents]=\"rowDragEvents\"\n [rowDefTemplate]=\"rowDefTemplate\"\n >\n <ng-content select=\"[loading-indicator]\" ngProjectAs=\"[loading-indicator]\">\n <datatable-progress></datatable-progress>\n </ng-content>\n <ng-content select=\"[empty-content]\" ngProjectAs=\"[empty-content]\">\n <div class=\"empty-row\" [innerHTML]=\"messages.emptyMessage\"></div>\n </ng-content>\n </datatable-body>\n </div>\n @if (footerHeight) {\n <datatable-footer\n [rowCount]=\"groupedRows !== undefined ? _internalRows.length : rowCount\"\n [pageSize]=\"pageSize\"\n [offset]=\"offset\"\n [footerHeight]=\"footerHeight\"\n [footerTemplate]=\"footer\"\n [totalMessage]=\"messages.totalMessage\"\n [pagerLeftArrowIcon]=\"cssClasses.pagerLeftArrow\"\n [pagerRightArrowIcon]=\"cssClasses.pagerRightArrow\"\n [pagerPreviousIcon]=\"cssClasses.pagerPrevious\"\n [selectedCount]=\"selected.length\"\n [selectedMessage]=\"!!selectionType && messages.selectedMessage\"\n [pagerNextIcon]=\"cssClasses.pagerNext\"\n (page)=\"onFooterPage($event)\"\n >\n </datatable-footer>\n }\n</div>\n", styles: [".ngx-datatable{display:block;overflow:hidden;justify-content:center;position:relative;transform:translateZ(0)}.ngx-datatable [hidden]{display:none!important}.ngx-datatable *,.ngx-datatable *:before,.ngx-datatable *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.ngx-datatable.scroll-vertical .datatable-body{overflow-y:auto}.ngx-datatable.scroll-vertical.virtualized .datatable-body .datatable-row-wrapper{position:absolute}.ngx-datatable.scroll-horz .datatable-body{overflow-x:auto;-webkit-overflow-scrolling:touch}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner{white-space:nowrap}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-datatable.fixed-row .datatable-scroll,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row{white-space:nowrap}.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-cell,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-group-cell{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ngx-datatable .datatable-body-row,.ngx-datatable .datatable-row-center,.ngx-datatable .datatable-header-inner{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;flex-direction:row;-webkit-flex-flow:row;-moz-flex-flow:row;-ms-flex-flow:row;-o-flex-flow:row;flex-flow:row}.ngx-datatable .datatable-body-cell,.ngx-datatable .datatable-header-cell{overflow-x:hidden;vertical-align:top;display:inline-block;line-height:1.625}.ngx-datatable .datatable-body-cell:focus,.ngx-datatable .datatable-header-cell:focus{outline:none}.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-row-right,.ngx-datatable .datatable-group-header{z-index:9;position:sticky!important}.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-group-header{left:0}.ngx-datatable .datatable-row-right{right:0}.ngx-datatable .datatable-row-center,.ngx-datatable .datatable-row-group{position:relative}.ngx-datatable .datatable-header{display:block;overflow:hidden}.ngx-datatable .datatable-header .datatable-header-inner{align-items:stretch;-webkit-align-items:stretch}.ngx-datatable .datatable-header .datatable-header-cell{position:relative;display:inline-block}.ngx-datatable .datatable-header .datatable-header-cell.sortable .datatable-header-cell-wrapper{cursor:pointer}.ngx-datatable .datatable-header .datatable-header-cell.longpress .datatable-header-cell-wrapper{cursor:move}.ngx-datatable .datatable-header .datatable-header-cell .sort-btn{line-height:100%;vertical-align:middle;display:inline-block;cursor:pointer}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell .resize-handle--not-resizable{display:inline-block;position:absolute;right:0;top:0;bottom:0;width:5px;padding:0 4px;visibility:hidden}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle{cursor:ew-resize}.ngx-datatable .datatable-header .datatable-header-cell.resizeable:hover .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell:hover .resize-handle--not-resizable{visibility:visible}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker{position:absolute;top:0;bottom:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromLeft{right:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromRight{left:0}.ngx-datatable .datatable-header .datatable-header-cell .datatable-header-cell-template-wrap{height:inherit}.ngx-datatable .datatable-body{position:relative;z-index:10;display:block;overflow:hidden}.ngx-datatable .datatable-body .datatable-scroll{display:inline-block}.ngx-datatable .datatable-body .datatable-row-detail{overflow-y:hidden}.ngx-datatable .datatable-body .datatable-row-wrapper{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ngx-datatable .datatable-body .datatable-body-row{outline:none}.ngx-datatable .datatable-body .datatable-body-row>div{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.ngx-datatable .datatable-footer{display:block;width:100%;overflow:auto}.ngx-datatable .datatable-footer .datatable-footer-inner{display:flex;align-items:center;width:100%}.ngx-datatable .datatable-footer .selected-count .page-count{flex:1 1 40%}.ngx-datatable .datatable-footer .selected-count .datatable-pager{flex:1 1 60%}.ngx-datatable .datatable-footer .page-count{flex:1 1 20%}.ngx-datatable .datatable-footer .datatable-pager{flex:1 1 80%;text-align:right}.ngx-datatable .datatable-footer .datatable-pager .pager,.ngx-datatable .datatable-footer .datatable-pager .pager li{padding:0;margin:0;display:inline-block;list-style:none}.ngx-datatable .datatable-footer .datatable-pager .pager li,.ngx-datatable .datatable-footer .datatable-pager .pager li a{outline:none}.ngx-datatable .datatable-footer .datatable-pager .pager li a{cursor:pointer;display:inline-block}.ngx-datatable .datatable-footer .datatable-pager .pager li.disabled a{cursor:not-allowed}\n"], dependencies: [{ kind: "directive", type: VisibilityDirective, selector: "[visibilityObserver]", outputs: ["visible"] }, { kind: "component", type: DataTableHeaderComponent, selector: "datatable-header", inputs: ["sortAscendingIcon", "sortDescendingIcon", "sortUnsetIcon", "scrollbarH", "dealsWithGroup", "targetMarkerTemplate", "enableClearingSortState", "innerWidth", "sorts", "sortType", "allRowsSelected", "selectionType", "reorderable", "verticalScrollVisible", "headerHeight", "columns", "offsetX"], outputs: ["sort", "reorder", "resize", "resizing", "select", "columnContextmenu"] }, { kind: "component", type: DataTableBodyComponent, selector: "datatable-body", inputs: ["rowDefTemplate", "scrollbarV", "scrollbarH", "loadingIndicator", "ghostLoadingIndicator", "externalPaging", "rowHeight", "offsetX", "selectionType", "selected", "rowIdentity", "rowDetail", "groupHeader", "selectCheck", "displayCheck", "trackByProp", "rowClass", "groupedRows", "groupExpansionDefault", "innerWidth", "groupRowsBy", "virtualization", "summaryRow", "summaryPosition", "summaryHeight", "rowDraggable", "rowDragEvents", "disableRowCheck", "pageSize", "rows", "columns", "offset", "rowCount", "bodyHeight", "verticalScrollVisible"], outputs: ["scroll", "page", "activate", "select", "detailToggle", "rowContextmenu", "treeAction"] }, { kind: "component", type: DataTableFooterComponent, selector: "datatable-footer", inputs: ["footerHeight", "rowCount", "pageSize", "offset", "pagerLeftArrowIcon", "pagerRightArrowIcon", "pagerPreviousIcon", "pagerNextIcon", "totalMessage", "footerTemplate", "selectedCount", "selectedMessage"], outputs: ["page"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: ProgressBarComponent, selector: "datatable-progress" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5984
|
+
], queries: [{ propertyName: "rowDetail", first: true, predicate: DatatableRowDetailDirective, descendants: true }, { propertyName: "groupHeader", first: true, predicate: DatatableGroupHeaderDirective, descendants: true }, { propertyName: "footer", first: true, predicate: DatatableFooterDirective, descendants: true }, { propertyName: "rowDefTemplate", first: true, predicate: DatatableRowDefDirective, descendants: true, read: TemplateRef }, { propertyName: "columnTemplates", predicate: DataTableColumnDirective }], viewQueries: [{ propertyName: "bodyComponent", first: true, predicate: DataTableBodyComponent, descendants: true }, { propertyName: "headerComponent", first: true, predicate: DataTableHeaderComponent, descendants: true }, { propertyName: "bodyElement", first: true, predicate: DataTableBodyComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<div visibilityObserver (visible)=\"recalculate()\">\n <div role=\"table\">\n @if (headerHeight) {\n <datatable-header\n role=\"rowgroup\"\n [sorts]=\"sorts\"\n [sortType]=\"sortType\"\n [scrollbarH]=\"scrollbarH\"\n [innerWidth]=\"_innerWidth\"\n [offsetX]=\"_offsetX\"\n [dealsWithGroup]=\"groupedRows !== undefined\"\n [columns]=\"_internalColumns\"\n [headerHeight]=\"headerHeight\"\n [reorderable]=\"reorderable\"\n [targetMarkerTemplate]=\"targetMarkerTemplate\"\n [sortAscendingIcon]=\"cssClasses.sortAscending\"\n [sortDescendingIcon]=\"cssClasses.sortDescending\"\n [sortUnsetIcon]=\"cssClasses.sortUnset\"\n [allRowsSelected]=\"allRowsSelected\"\n [selectionType]=\"selectionType\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n [enableClearingSortState]=\"enableClearingSortState\"\n (sort)=\"onColumnSort($event)\"\n (resize)=\"onColumnResize($event)\"\n (resizing)=\"onColumnResizing($event)\"\n (reorder)=\"onColumnReorder($event)\"\n (select)=\"onHeaderSelect()\"\n (columnContextmenu)=\"onColumnContextmenu($event)\"\n >\n </datatable-header>\n }\n <datatable-body\n tabindex=\"0\"\n role=\"rowgroup\"\n [groupRowsBy]=\"groupRowsBy\"\n [groupedRows]=\"groupedRows\"\n [rows]=\"_internalRows\"\n [groupExpansionDefault]=\"groupExpansionDefault\"\n [scrollbarV]=\"scrollbarV\"\n [scrollbarH]=\"scrollbarH\"\n [virtualization]=\"virtualization\"\n [loadingIndicator]=\"loadingIndicator\"\n [ghostLoadingIndicator]=\"ghostLoadingIndicator\"\n [externalPaging]=\"externalPaging\"\n [rowHeight]=\"rowHeight\"\n [rowCount]=\"rowCount\"\n [offset]=\"offset\"\n [trackByProp]=\"trackByProp\"\n [columns]=\"_internalColumns\"\n [pageSize]=\"pageSize\"\n [offsetX]=\"_offsetX\"\n [rowDetail]=\"rowDetail\"\n [groupHeader]=\"groupHeader\"\n [selected]=\"selected\"\n [innerWidth]=\"_innerWidth\"\n [bodyHeight]=\"bodyHeight\"\n [selectionType]=\"selectionType\"\n [rowIdentity]=\"rowIdentity\"\n [rowClass]=\"rowClass\"\n [selectCheck]=\"selectCheck\"\n [displayCheck]=\"displayCheck\"\n [summaryRow]=\"summaryRow\"\n [summaryHeight]=\"summaryHeight\"\n [summaryPosition]=\"summaryPosition\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n (page)=\"onBodyPage($event)\"\n (activate)=\"activate.emit($event)\"\n (rowContextmenu)=\"onRowContextmenu($event)\"\n (select)=\"onBodySelect($event)\"\n (scroll)=\"onBodyScroll($event)\"\n (treeAction)=\"onTreeAction($event)\"\n [disableRowCheck]=\"disableRowCheck\"\n [rowDraggable]=\"rowDraggable\"\n [rowDragEvents]=\"rowDragEvents\"\n [rowDefTemplate]=\"rowDefTemplate\"\n >\n <ng-content select=\"[loading-indicator]\" ngProjectAs=\"[loading-indicator]\">\n <datatable-progress></datatable-progress>\n </ng-content>\n <ng-content select=\"[empty-content]\" ngProjectAs=\"[empty-content]\">\n <div role=\"row\">\n <div\n role=\"cell\"\n class=\"empty-row\"\n [innerHTML]=\"messages.emptyMessage ?? 'No data to display'\"\n ></div>\n </div>\n </ng-content>\n </datatable-body>\n </div>\n @if (footerHeight) {\n <datatable-footer\n [rowCount]=\"groupedRows !== undefined ? _internalRows.length : rowCount\"\n [pageSize]=\"pageSize\"\n [offset]=\"offset\"\n [footerHeight]=\"footerHeight\"\n [footerTemplate]=\"footer\"\n [totalMessage]=\"messages.totalMessage ?? 'total'\"\n [pagerLeftArrowIcon]=\"cssClasses.pagerLeftArrow\"\n [pagerRightArrowIcon]=\"cssClasses.pagerRightArrow\"\n [pagerPreviousIcon]=\"cssClasses.pagerPrevious\"\n [selectedCount]=\"selected.length\"\n [selectedMessage]=\"!!selectionType && (messages.selectedMessage ?? 'selected')\"\n [pagerNextIcon]=\"cssClasses.pagerNext\"\n (page)=\"onFooterPage($event)\"\n >\n </datatable-footer>\n }\n</div>\n", styles: [":host{display:block;overflow:hidden;justify-content:center;position:relative;transform:translateZ(0)}\n"], dependencies: [{ kind: "directive", type: VisibilityDirective, selector: "[visibilityObserver]", outputs: ["visible"] }, { kind: "component", type: DataTableHeaderComponent, selector: "datatable-header", inputs: ["sortAscendingIcon", "sortDescendingIcon", "sortUnsetIcon", "scrollbarH", "dealsWithGroup", "targetMarkerTemplate", "enableClearingSortState", "innerWidth", "sorts", "sortType", "allRowsSelected", "selectionType", "reorderable", "verticalScrollVisible", "headerHeight", "columns", "offsetX"], outputs: ["sort", "reorder", "resize", "resizing", "select", "columnContextmenu"] }, { kind: "component", type: DataTableBodyComponent, selector: "datatable-body", inputs: ["rowDefTemplate", "scrollbarV", "scrollbarH", "loadingIndicator", "ghostLoadingIndicator", "externalPaging", "rowHeight", "offsetX", "selectionType", "selected", "rowIdentity", "rowDetail", "groupHeader", "selectCheck", "displayCheck", "trackByProp", "rowClass", "groupedRows", "groupExpansionDefault", "innerWidth", "groupRowsBy", "virtualization", "summaryRow", "summaryPosition", "summaryHeight", "rowDraggable", "rowDragEvents", "disableRowCheck", "pageSize", "rows", "columns", "offset", "rowCount", "bodyHeight", "verticalScrollVisible"], outputs: ["scroll", "page", "activate", "select", "rowContextmenu", "treeAction"] }, { kind: "component", type: DataTableFooterComponent, selector: "datatable-footer", inputs: ["footerHeight", "rowCount", "pageSize", "offset", "pagerLeftArrowIcon", "pagerRightArrowIcon", "pagerPreviousIcon", "pagerNextIcon", "totalMessage", "footerTemplate", "selectedCount", "selectedMessage"], outputs: ["page"] }, { kind: "component", type: ProgressBarComponent, selector: "datatable-progress" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6484
5985
|
}
|
|
6485
5986
|
__decorate([
|
|
6486
5987
|
throttleable(5)
|
|
6487
5988
|
], DatatableComponent.prototype, "onWindowResize", null);
|
|
6488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DatatableComponent, decorators: [{
|
|
6489
5990
|
type: Component,
|
|
6490
|
-
args: [{ selector: 'ngx-datatable', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5991
|
+
args: [{ selector: 'ngx-datatable', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6491
5992
|
class: 'ngx-datatable'
|
|
6492
5993
|
}, providers: [
|
|
6493
5994
|
{
|
|
@@ -6500,9 +6001,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
6500
6001
|
DataTableHeaderComponent,
|
|
6501
6002
|
DataTableBodyComponent,
|
|
6502
6003
|
DataTableFooterComponent,
|
|
6503
|
-
AsyncPipe,
|
|
6504
6004
|
ProgressBarComponent
|
|
6505
|
-
], template: "<div visibilityObserver (visible)=\"recalculate()\">\n <div role=\"table\">\n @if (headerHeight) {\n
|
|
6005
|
+
], template: "<div visibilityObserver (visible)=\"recalculate()\">\n <div role=\"table\">\n @if (headerHeight) {\n <datatable-header\n role=\"rowgroup\"\n [sorts]=\"sorts\"\n [sortType]=\"sortType\"\n [scrollbarH]=\"scrollbarH\"\n [innerWidth]=\"_innerWidth\"\n [offsetX]=\"_offsetX\"\n [dealsWithGroup]=\"groupedRows !== undefined\"\n [columns]=\"_internalColumns\"\n [headerHeight]=\"headerHeight\"\n [reorderable]=\"reorderable\"\n [targetMarkerTemplate]=\"targetMarkerTemplate\"\n [sortAscendingIcon]=\"cssClasses.sortAscending\"\n [sortDescendingIcon]=\"cssClasses.sortDescending\"\n [sortUnsetIcon]=\"cssClasses.sortUnset\"\n [allRowsSelected]=\"allRowsSelected\"\n [selectionType]=\"selectionType\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n [enableClearingSortState]=\"enableClearingSortState\"\n (sort)=\"onColumnSort($event)\"\n (resize)=\"onColumnResize($event)\"\n (resizing)=\"onColumnResizing($event)\"\n (reorder)=\"onColumnReorder($event)\"\n (select)=\"onHeaderSelect()\"\n (columnContextmenu)=\"onColumnContextmenu($event)\"\n >\n </datatable-header>\n }\n <datatable-body\n tabindex=\"0\"\n role=\"rowgroup\"\n [groupRowsBy]=\"groupRowsBy\"\n [groupedRows]=\"groupedRows\"\n [rows]=\"_internalRows\"\n [groupExpansionDefault]=\"groupExpansionDefault\"\n [scrollbarV]=\"scrollbarV\"\n [scrollbarH]=\"scrollbarH\"\n [virtualization]=\"virtualization\"\n [loadingIndicator]=\"loadingIndicator\"\n [ghostLoadingIndicator]=\"ghostLoadingIndicator\"\n [externalPaging]=\"externalPaging\"\n [rowHeight]=\"rowHeight\"\n [rowCount]=\"rowCount\"\n [offset]=\"offset\"\n [trackByProp]=\"trackByProp\"\n [columns]=\"_internalColumns\"\n [pageSize]=\"pageSize\"\n [offsetX]=\"_offsetX\"\n [rowDetail]=\"rowDetail\"\n [groupHeader]=\"groupHeader\"\n [selected]=\"selected\"\n [innerWidth]=\"_innerWidth\"\n [bodyHeight]=\"bodyHeight\"\n [selectionType]=\"selectionType\"\n [rowIdentity]=\"rowIdentity\"\n [rowClass]=\"rowClass\"\n [selectCheck]=\"selectCheck\"\n [displayCheck]=\"displayCheck\"\n [summaryRow]=\"summaryRow\"\n [summaryHeight]=\"summaryHeight\"\n [summaryPosition]=\"summaryPosition\"\n [verticalScrollVisible]=\"verticalScrollVisible\"\n (page)=\"onBodyPage($event)\"\n (activate)=\"activate.emit($event)\"\n (rowContextmenu)=\"onRowContextmenu($event)\"\n (select)=\"onBodySelect($event)\"\n (scroll)=\"onBodyScroll($event)\"\n (treeAction)=\"onTreeAction($event)\"\n [disableRowCheck]=\"disableRowCheck\"\n [rowDraggable]=\"rowDraggable\"\n [rowDragEvents]=\"rowDragEvents\"\n [rowDefTemplate]=\"rowDefTemplate\"\n >\n <ng-content select=\"[loading-indicator]\" ngProjectAs=\"[loading-indicator]\">\n <datatable-progress></datatable-progress>\n </ng-content>\n <ng-content select=\"[empty-content]\" ngProjectAs=\"[empty-content]\">\n <div role=\"row\">\n <div\n role=\"cell\"\n class=\"empty-row\"\n [innerHTML]=\"messages.emptyMessage ?? 'No data to display'\"\n ></div>\n </div>\n </ng-content>\n </datatable-body>\n </div>\n @if (footerHeight) {\n <datatable-footer\n [rowCount]=\"groupedRows !== undefined ? _internalRows.length : rowCount\"\n [pageSize]=\"pageSize\"\n [offset]=\"offset\"\n [footerHeight]=\"footerHeight\"\n [footerTemplate]=\"footer\"\n [totalMessage]=\"messages.totalMessage ?? 'total'\"\n [pagerLeftArrowIcon]=\"cssClasses.pagerLeftArrow\"\n [pagerRightArrowIcon]=\"cssClasses.pagerRightArrow\"\n [pagerPreviousIcon]=\"cssClasses.pagerPrevious\"\n [selectedCount]=\"selected.length\"\n [selectedMessage]=\"!!selectionType && (messages.selectedMessage ?? 'selected')\"\n [pagerNextIcon]=\"cssClasses.pagerNext\"\n (page)=\"onFooterPage($event)\"\n >\n </datatable-footer>\n }\n</div>\n", styles: [":host{display:block;overflow:hidden;justify-content:center;position:relative;transform:translateZ(0)}\n"] }]
|
|
6506
6006
|
}], ctorParameters: () => [], propDecorators: { targetMarkerTemplate: [{
|
|
6507
6007
|
type: Input
|
|
6508
6008
|
}], rows: [{
|
|
@@ -6707,40 +6207,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
6707
6207
|
*/
|
|
6708
6208
|
class DisableRowDirective {
|
|
6709
6209
|
constructor() {
|
|
6710
|
-
this.
|
|
6711
|
-
this.
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
get disabled() {
|
|
6720
|
-
return this._disabled;
|
|
6210
|
+
this.elementRef = inject(ElementRef);
|
|
6211
|
+
this.disabled = input(false, {
|
|
6212
|
+
transform: booleanAttribute
|
|
6213
|
+
});
|
|
6214
|
+
effect(() => {
|
|
6215
|
+
if (this.disabled()) {
|
|
6216
|
+
this.disableAllElements();
|
|
6217
|
+
}
|
|
6218
|
+
});
|
|
6721
6219
|
}
|
|
6722
6220
|
disableAllElements() {
|
|
6723
|
-
const
|
|
6724
|
-
if (!
|
|
6221
|
+
const hostElement = this.elementRef?.nativeElement;
|
|
6222
|
+
if (!hostElement) {
|
|
6725
6223
|
return;
|
|
6726
6224
|
}
|
|
6727
|
-
Array.from(
|
|
6728
|
-
child
|
|
6225
|
+
Array.from(hostElement.querySelectorAll('*')).forEach(child => {
|
|
6226
|
+
child.setAttribute('disabled', '');
|
|
6729
6227
|
});
|
|
6730
6228
|
}
|
|
6731
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
6732
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
6229
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DisableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6230
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.5", type: DisableRowDirective, isStandalone: true, selector: "[disable-row]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
6733
6231
|
}
|
|
6734
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
6232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DisableRowDirective, decorators: [{
|
|
6735
6233
|
type: Directive,
|
|
6736
6234
|
args: [{
|
|
6737
|
-
selector: '[disable-row]'
|
|
6738
|
-
standalone: true
|
|
6235
|
+
selector: '[disable-row]'
|
|
6739
6236
|
}]
|
|
6740
|
-
}],
|
|
6741
|
-
type: Input,
|
|
6742
|
-
args: [{ transform: booleanAttribute }]
|
|
6743
|
-
}] } });
|
|
6237
|
+
}], ctorParameters: () => [] });
|
|
6744
6238
|
|
|
6745
6239
|
class NgxDatatableModule {
|
|
6746
6240
|
/**
|
|
@@ -6750,14 +6244,13 @@ class NgxDatatableModule {
|
|
|
6750
6244
|
static forRoot(configuration) {
|
|
6751
6245
|
return {
|
|
6752
6246
|
ngModule: NgxDatatableModule,
|
|
6753
|
-
providers: [
|
|
6247
|
+
providers: [providedNgxDatatableConfig(configuration)]
|
|
6754
6248
|
};
|
|
6755
6249
|
}
|
|
6756
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
6757
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
6250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NgxDatatableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6251
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.5", ngImport: i0, type: NgxDatatableModule, imports: [DataTableFooterTemplateDirective,
|
|
6758
6252
|
DatatableComponent,
|
|
6759
6253
|
DataTableColumnDirective,
|
|
6760
|
-
DataTablePagerComponent,
|
|
6761
6254
|
DatatableRowDetailDirective,
|
|
6762
6255
|
DatatableGroupHeaderDirective,
|
|
6763
6256
|
DatatableRowDetailTemplateDirective,
|
|
@@ -6780,21 +6273,19 @@ class NgxDatatableModule {
|
|
|
6780
6273
|
DataTableColumnCellTreeToggle,
|
|
6781
6274
|
DataTableFooterTemplateDirective,
|
|
6782
6275
|
DatatableFooterDirective,
|
|
6783
|
-
DataTablePagerComponent,
|
|
6784
6276
|
DatatableGroupHeaderTemplateDirective,
|
|
6785
6277
|
DisableRowDirective,
|
|
6786
6278
|
DatatableRowDefComponent,
|
|
6787
6279
|
DatatableRowDefDirective] }); }
|
|
6788
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
6280
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NgxDatatableModule }); }
|
|
6789
6281
|
}
|
|
6790
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
6282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NgxDatatableModule, decorators: [{
|
|
6791
6283
|
type: NgModule,
|
|
6792
6284
|
args: [{
|
|
6793
6285
|
imports: [
|
|
6794
6286
|
DataTableFooterTemplateDirective,
|
|
6795
6287
|
DatatableComponent,
|
|
6796
6288
|
DataTableColumnDirective,
|
|
6797
|
-
DataTablePagerComponent,
|
|
6798
6289
|
DatatableRowDetailDirective,
|
|
6799
6290
|
DatatableGroupHeaderDirective,
|
|
6800
6291
|
DatatableRowDetailTemplateDirective,
|
|
@@ -6820,7 +6311,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
6820
6311
|
DataTableColumnCellTreeToggle,
|
|
6821
6312
|
DataTableFooterTemplateDirective,
|
|
6822
6313
|
DatatableFooterDirective,
|
|
6823
|
-
DataTablePagerComponent,
|
|
6824
6314
|
DatatableGroupHeaderTemplateDirective,
|
|
6825
6315
|
DisableRowDirective,
|
|
6826
6316
|
DatatableRowDefComponent,
|
|
@@ -6838,5 +6328,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
6838
6328
|
* Generated bundle index. Do not edit.
|
|
6839
6329
|
*/
|
|
6840
6330
|
|
|
6841
|
-
export {
|
|
6331
|
+
export { ColumnMode, ContextmenuType, DataTableColumnCellDirective, DataTableColumnCellTreeToggle, DataTableColumnDirective, DataTableColumnGhostCellDirective, DataTableColumnHeaderDirective, DataTableFooterTemplateDirective, DatatableComponent, DatatableFooterDirective, DatatableGroupHeaderDirective, DatatableGroupHeaderTemplateDirective, DatatableRowDefComponent, DatatableRowDefDirective, DatatableRowDefInternalDirective, DatatableRowDetailDirective, DatatableRowDetailTemplateDirective, DisableRowDirective, NgxDatatableModule, SelectionType, SortDirection, SortType, providedNgxDatatableConfig };
|
|
6842
6332
|
//# sourceMappingURL=swimlane-ngx-datatable.mjs.map
|