• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

6.28
/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.pipes.ts
1
import { Inject, Pipe, PipeTransform } from '@angular/core';
2
import { cloneArray, resolveNestedPath } from '../../core/utils';
3
import { DataUtil } from '../../data-operations/data-util';
4
import { FilteringExpressionsTree, IFilteringExpressionsTree } from '../../data-operations/filtering-expressions-tree';
5
import { DefaultPivotGridRecordSortingStrategy } from '../../data-operations/pivot-sort-strategy';
6
import { FilterUtil, IFilteringStrategy } from '../../data-operations/filtering-strategy';
7
import {
8
    DimensionValuesFilteringStrategy, PivotColumnDimensionsStrategy,
9
    PivotRowDimensionsStrategy
10
} from '../../data-operations/pivot-strategy';
11
import { ISortingExpression } from '../../data-operations/sorting-strategy';
12
import { GridBaseAPIService } from '../api.service';
13
import { GridType, IGX_GRID_BASE, PivotGridType } from '../common/grid.interface';
14
import { IGridSortingStrategy } from '../common/strategy';
15
import { IgxGridBaseDirective } from '../grid-base.directive';
16
import { DEFAULT_PIVOT_KEYS, IPivotConfiguration, IPivotDimension, IPivotGridColumn, IPivotGridGroupRecord, IPivotGridHorizontalGroup, IPivotGridRecord, IPivotKeys, IPivotValue } from './pivot-grid.interface';
17
import { PivotSortUtil } from './pivot-sort-util';
18
import { PivotUtil } from './pivot-util';
19
import { IDataCloneStrategy } from '../../data-operations/data-clone-strategy';
20

21
/**
22
 * @hidden
23
 */
24
@Pipe({
25
    name: 'pivotGridRow',
26
    pure: true,
27
    standalone: true
28
})
29
export class IgxPivotRowPipe implements PipeTransform {
2✔
30

UNCOV
31
    constructor(@Inject(IGX_GRID_BASE) private grid?: PivotGridType) { }
×
32

33
    public transform(
34
        collection: any,
35
        config: IPivotConfiguration,
36
        cloneStrategy: IDataCloneStrategy,
37
        _: Map<any, boolean>,
38
        _pipeTrigger?: number,
39
        __?
40
    ): IPivotGridRecord[] {
UNCOV
41
        const pivotKeys = config.pivotKeys || DEFAULT_PIVOT_KEYS;
×
UNCOV
42
        const enabledRows = config.rows?.filter(x => x.enabled) || [];
×
UNCOV
43
        const enabledColumns = config.columns?.filter(x => x.enabled) || [];
×
UNCOV
44
        const enabledValues = config.values?.filter(x => x.enabled) || [];
×
UNCOV
45
        if (enabledRows.length === 0 && enabledColumns.length === 0 && enabledValues.length === 0) {
×
46
            // nothing to group and aggregate by ...
UNCOV
47
            return [];
×
48
        }
UNCOV
49
        const rowStrategy = config.rowStrategy || PivotRowDimensionsStrategy.instance();
×
UNCOV
50
        const data = cloneArray(collection, true);
×
UNCOV
51
        return rowStrategy.process(data, enabledRows, config.values, cloneStrategy, pivotKeys);
×
52
    }
53
}
54

55
/**
56
 * @hidden
57
 * Transforms generic array data into IPivotGridRecord[]
58
 */
59
@Pipe({
60
    name: 'pivotGridAutoTransform',
61
    pure: true,
62
    standalone: true
63
})
64
export class IgxPivotAutoTransform implements PipeTransform {
2✔
65
    public transform(
66
        collection: any[],
67
        config: IPivotConfiguration,
68
        _pipeTrigger?: number,
69
        __?,
70
    ): IPivotGridRecord[] {
UNCOV
71
        let needsTransformation = false;
×
UNCOV
72
        if (collection.length > 0) {
×
UNCOV
73
            needsTransformation = !this.isPivotRecord(collection[0]);
×
74
        }
75

UNCOV
76
        if (!needsTransformation) return collection;
×
77

UNCOV
78
        const res = this.processCollectionToPivotRecord(config, collection);
×
UNCOV
79
        return res;
×
80
    }
81

82
    protected isPivotRecord(arg: IPivotGridRecord): arg is IPivotGridRecord {
UNCOV
83
        return !!(arg as IPivotGridRecord).aggregationValues;
×
84
    }
85

86
    protected processCollectionToPivotRecord(config: IPivotConfiguration, collection: any[]): IPivotGridRecord[] {
UNCOV
87
        const pivotKeys: IPivotKeys = config.pivotKeys || DEFAULT_PIVOT_KEYS;
×
UNCOV
88
        const enabledRows = config.rows.filter(x => x.enabled);
×
UNCOV
89
        const allFlat: IPivotDimension[] = PivotUtil.flatten(enabledRows);
×
UNCOV
90
        const result: IPivotGridRecord[] = [];
×
UNCOV
91
        for (const rec of collection) {
×
UNCOV
92
            const pivotRec: IPivotGridRecord = {
×
93
                dimensionValues: new Map<string, string>(),
94
                aggregationValues: new Map<string, string>(),
95
                children: new Map<string, IPivotGridRecord[]>(),
96
                dimensions: []
97
            };
UNCOV
98
            const keys = Object.keys(rec)
×
UNCOV
99
            for (const key of keys) {
×
UNCOV
100
                const dim = allFlat.find(x => x.memberName === key);
×
UNCOV
101
                if (dim) {
×
102
                    //field has matching dimension
UNCOV
103
                    pivotRec.dimensions.push(dim);
×
UNCOV
104
                    pivotRec.dimensionValues.set(key, rec[key]);
×
UNCOV
105
                } else if (key.indexOf(pivotKeys.rowDimensionSeparator + pivotKeys.records) !== -1) {
×
106
                    // field that contains child collection
UNCOV
107
                    const dimKey = key.slice(0, key.indexOf(pivotKeys.rowDimensionSeparator + pivotKeys.records));
×
UNCOV
108
                    const childData = rec[key];
×
UNCOV
109
                    const childPivotData = this.processCollectionToPivotRecord(config, childData);
×
UNCOV
110
                    pivotRec.children.set(dimKey, childPivotData);
×
111
                } else {
112
                    // an aggregation
UNCOV
113
                    pivotRec.aggregationValues.set(key, rec[key]);
×
114
                }
115
            }
UNCOV
116
            const flattened = PivotUtil.flatten(config.rows);
×
UNCOV
117
            pivotRec.dimensions.sort((x, y) => flattened.indexOf(x) - flattened.indexOf(y));
×
UNCOV
118
            result.push(pivotRec);
×
119
        }
UNCOV
120
        return result;
×
121
    }
122

123
}
124

125
/**
126
 * @hidden
127
 */
128
@Pipe({
129
    name: 'pivotGridRowExpansion',
130
    pure: true,
131
    standalone: true
132
})
133
export class IgxPivotRowExpansionPipe implements PipeTransform {
2✔
134

UNCOV
135
    constructor(@Inject(IGX_GRID_BASE) private grid?: PivotGridType) { }
×
136

137
    public transform(
138
        collection: IPivotGridRecord[],
139
        config: IPivotConfiguration,
140
        expansionStates: Map<any, boolean>,
141
        defaultExpand: boolean,
142
        _pipeTrigger?: number,
143
        __?,
144
    ): IPivotGridRecord[] {
UNCOV
145
        const enabledRows = config.rows?.filter(x => x.enabled) || [];
×
UNCOV
146
        const data = collection ? cloneArray(collection, true) : [];
×
UNCOV
147
        const horizontalRowDimensions = [];
×
UNCOV
148
        for (const row of enabledRows) {
×
UNCOV
149
            if (this.grid?.hasHorizontalLayout) {
×
UNCOV
150
                PivotUtil.flattenGroupsHorizontally(
×
151
                    data,
152
                    row,
153
                    expansionStates,
154
                    defaultExpand,
155
                    horizontalRowDimensions,
156
                    this.grid.pivotUI.horizontalSummariesPosition
157
            );
158
            } else {
UNCOV
159
                PivotUtil.flattenGroups(data, row, expansionStates, defaultExpand);
×
160
            }
161
        }
162

UNCOV
163
        let finalData = data;
×
UNCOV
164
        if (this.grid?.hasHorizontalLayout) {
×
UNCOV
165
            const allRowDims = PivotUtil.flatten(this.grid.rowDimensions);
×
UNCOV
166
            this.grid.visibleRowDimensions = allRowDims.filter((rowDim) => horizontalRowDimensions.some(targetDim => targetDim.memberName === rowDim.memberName));
×
167
        } else {
UNCOV
168
            if (this.grid) {
×
UNCOV
169
                this.grid.visibleRowDimensions = enabledRows;
×
170
            }
UNCOV
171
            finalData = enabledRows.length > 0 ?
×
UNCOV
172
            finalData.filter(x => x.dimensions.length === enabledRows.length) : finalData;
×
173
        }
174

UNCOV
175
        if (this.grid) {
×
UNCOV
176
            this.grid.setFilteredSortedData(finalData, false);
×
177
        }
UNCOV
178
        return finalData;
×
179
    }
180
}
181

182
/**
183
 * @hidden
184
 */
185
@Pipe({
186
    name: 'pivotGridCellMerging',
187
    pure: true,
188
    standalone: true
189
})
190
export class IgxPivotCellMergingPipe implements PipeTransform {
2✔
UNCOV
191
    constructor(@Inject(IGX_GRID_BASE) private grid: PivotGridType) { }
×
192
    public transform(
193
        collection: IPivotGridRecord[],
194
        config: IPivotConfiguration,
195
        dim: IPivotDimension,
196
        _pipeTrigger?: number
197
    ): IPivotGridGroupRecord[] {
UNCOV
198
        if (collection.length === 0 || config.rows.length === 0) return collection;
×
UNCOV
199
        const data: IPivotGridGroupRecord[] = collection ? cloneArray(collection, true) : [];
×
UNCOV
200
        const res: IPivotGridGroupRecord[] = [];
×
201

UNCOV
202
        let groupData: IPivotGridGroupRecord[] = [];
×
203
        let prevId;
UNCOV
204
        const enabledRows = this.grid.hasHorizontalLayout ? (this.grid as any).visibleRowDimensions :  config.rows?.filter(x => x.enabled);
×
UNCOV
205
        const dimIndex = enabledRows.indexOf(dim);
×
UNCOV
206
        for (const rec of data) {
×
207
            let currentDim;
UNCOV
208
            if (this.grid.hasHorizontalLayout) {
×
209
                currentDim = dim;
×
210
                rec.dimensions = enabledRows;
×
211
            } else {
UNCOV
212
                currentDim = rec.dimensions[dimIndex];
×
213
            }
214

UNCOV
215
            const id = PivotUtil.getRecordKey(rec, currentDim);
×
UNCOV
216
            if (groupData.length > 0 && prevId !== id) {
×
UNCOV
217
                const h = groupData.length > 1 ? groupData.length * this.grid.renderedRowHeight : undefined;
×
UNCOV
218
                groupData[0].height = h;
×
UNCOV
219
                groupData[0].rowSpan = groupData.length;
×
UNCOV
220
                res.push(groupData[0]);
×
UNCOV
221
                groupData = [];
×
222
            }
UNCOV
223
            groupData.push(rec);
×
UNCOV
224
            prevId = id;
×
225
        }
UNCOV
226
        if (groupData.length > 0) {
×
UNCOV
227
            const h = groupData.length > 1 ? groupData.length * this.grid.rowHeight + (groupData.length - 1) + 1 : undefined;
×
UNCOV
228
            groupData[0].height = h;
×
UNCOV
229
            groupData[0].rowSpan = groupData.length;
×
UNCOV
230
            res.push(groupData[0]);
×
231
        }
UNCOV
232
        return res;
×
233
    }
234
}
235

236
/**
237
 * @hidden
238
 */
239
@Pipe({
240
    name: "pivotGridHorizontalRowGrouping",
241
    standalone: true
242
})
243
export class IgxPivotGridHorizontalRowGrouping implements PipeTransform {
2✔
UNCOV
244
    constructor(@Inject(IGX_GRID_BASE) private grid: GridType) { }
×
245
    public transform(
246
        collection: IPivotGridRecord[],
247
        config: IPivotConfiguration,
248
        _pipeTrigger?: number,
249
        _regroupTrigger?: number
250
    ): IPivotGridRecord[][] {
UNCOV
251
        if (collection.length === 0 || config.rows.length === 0) return null;
×
UNCOV
252
        const data: IPivotGridRecord[] = collection ? cloneArray(collection, true) : [];
×
UNCOV
253
        const res: IPivotGridRecord[][] = [];
×
254

UNCOV
255
        const groupDim = config.rows.filter(dim => dim.enabled)[0];
×
UNCOV
256
        let curGroup = [];
×
UNCOV
257
        let curGroupValue = data[0].dimensionValues.get(groupDim.memberName);
×
UNCOV
258
        for (const [index, curRec] of data.entries()) {
×
UNCOV
259
            curRec.dataIndex = index;
×
UNCOV
260
            const curRecValue = curRec.dimensionValues.get(groupDim.memberName);
×
UNCOV
261
            if (curGroup.length === 0 || curRecValue === curGroupValue) {
×
UNCOV
262
                curGroup.push(curRec);
×
263
            } else {
UNCOV
264
                curGroup["height"] = this.grid.renderedRowHeight * curGroup.length;
×
UNCOV
265
                res.push(curGroup);
×
UNCOV
266
                curGroup = [curRec];
×
UNCOV
267
                curGroupValue = curRecValue;
×
268
            }
269
        }
UNCOV
270
        res.push(curGroup);
×
271

UNCOV
272
        return res;
×
273
    }
274
}
275

276
/**
277
 * @hidden
278
 */
279
@Pipe({
280
    name: "pivotGridHorizontalRowCellMerging",
281
    standalone: true
282
})
283
export class IgxPivotGridHorizontalRowCellMerging implements PipeTransform {
2✔
UNCOV
284
    constructor(@Inject(IGX_GRID_BASE) private grid: PivotGridType) { }
×
285
    public transform(
286
        collection: IPivotGridRecord[],
287
        config: IPivotConfiguration,
288
        _pipeTrigger?: number
289
    ): IPivotGridHorizontalGroup[] {
UNCOV
290
        if (collection.length === 0 || config.rows.length === 0) return [{
×
291
            colStart: 1,
292
            colSpan: 1,
293
            rowStart: 1,
294
            rowSpan: 1,
295
            records: collection
296
        }];
UNCOV
297
        const data: IPivotGridRecord[] = collection ? cloneArray(collection, true) : [];
×
UNCOV
298
        const res: IPivotGridHorizontalGroup[] = [];
×
299

300
        // Merge vertically for each row dimension.
UNCOV
301
        const verticalMergeGroups: IPivotGridHorizontalGroup[][] = [ ...data.map(_ => []) ];
×
UNCOV
302
        for (let dimIndex = 0; dimIndex < this.grid.visibleRowDimensions.length; dimIndex++) {
×
UNCOV
303
            const curDim = this.grid.visibleRowDimensions[dimIndex];
×
UNCOV
304
            let curGroup: IPivotGridHorizontalGroup = {
×
305
                colStart: dimIndex + 1,
306
                colSpan: 1,
307
                rowStart: 1,
308
                rowSpan: 1,
309
                value: data[0].dimensionValues.get(curDim.memberName),
310
                rootDimension: curDim,
311
                dimensions: [curDim],
312
                records: [data[0]]
313
            };
UNCOV
314
            for(let i = 1; i < data.length; i++) {
×
UNCOV
315
                const curRec = data[i];
×
UNCOV
316
                const curRecValue = curRec.dimensionValues.get(curDim.memberName);
×
UNCOV
317
                const previousRowCell = verticalMergeGroups[i][verticalMergeGroups[i].length - 1];
×
UNCOV
318
                if (curRecValue === curGroup.value && !previousRowCell) {
×
319
                    // If previousRowCell is non existing, its merged so we can push in this vertigal group as well.
UNCOV
320
                    curGroup.rowSpan++;
×
UNCOV
321
                    curGroup.records.push(curRec);
×
322
                } else {
UNCOV
323
                    verticalMergeGroups[curGroup.rowStart - 1].push(curGroup);
×
UNCOV
324
                    curGroup = {
×
325
                        colStart: dimIndex + 1,
326
                        colSpan: 1,
327
                        rowStart: curGroup.rowStart + curGroup.rowSpan,
328
                        rowSpan: 1,
329
                        value: curRec.dimensionValues.get(curDim.memberName),
330
                        rootDimension: curDim,
331
                        dimensions: [curDim],
332
                        records: [curRec]
333
                    };
334
                }
335
            }
336

UNCOV
337
            verticalMergeGroups[curGroup.rowStart - 1].push(curGroup);
×
338
        }
339

340
        // Merge rows in a single array
UNCOV
341
        const sortedGroups = verticalMergeGroups.reduce((prev, cur) => prev.concat(...cur), []);
×
342

343
        // Horizontally merge any groups that can be merged or have been
UNCOV
344
        res.push(sortedGroups[0]);
×
UNCOV
345
        let prevGroup = sortedGroups[0];
×
UNCOV
346
        for (let i = 1; i < sortedGroups.length; i++) {
×
UNCOV
347
            const curGroup = sortedGroups[i];
×
UNCOV
348
            if (curGroup.value && prevGroup.value !== curGroup.value) {
×
UNCOV
349
                prevGroup = curGroup;
×
UNCOV
350
                res.push(curGroup);
×
351
            } else {
UNCOV
352
                prevGroup.dimensions.push(curGroup.rootDimension);
×
UNCOV
353
                prevGroup.colSpan++;
×
354
            }
355
        }
356

UNCOV
357
        return res;
×
358
    }
359
}
360

361
/**
362
 * @hidden
363
 */
364
@Pipe({
365
    name: 'pivotGridColumn',
366
    pure: true,
367
    standalone: true
368
})
369
export class IgxPivotColumnPipe implements PipeTransform {
2✔
370

371
    public transform(
372
        collection: IPivotGridRecord[],
373
        config: IPivotConfiguration,
374
        cloneStrategy: IDataCloneStrategy,
375
        _: Map<any, boolean>,
376
        _pipeTrigger?: number,
377
        __?
378
    ): IPivotGridRecord[] {
UNCOV
379
        const pivotKeys = config.pivotKeys || DEFAULT_PIVOT_KEYS;
×
UNCOV
380
        const enabledColumns = config.columns?.filter(x => x.enabled) || [];
×
UNCOV
381
        const enabledValues = config.values?.filter(x => x.enabled) || [];
×
382

UNCOV
383
        const colStrategy = config.columnStrategy || PivotColumnDimensionsStrategy.instance();
×
UNCOV
384
        const data = cloneArray(collection, true);
×
UNCOV
385
        return colStrategy.process(data, enabledColumns, enabledValues, cloneStrategy, pivotKeys);
×
386
    }
387
}
388

389
/**
390
 * @hidden
391
 */
392
@Pipe({
393
    name: 'pivotGridFilter',
394
    pure: true,
395
    standalone: true
396
})
397
export class IgxPivotGridFilterPipe implements PipeTransform {
2✔
UNCOV
398
    constructor(private gridAPI: GridBaseAPIService<IgxGridBaseDirective & GridType>) { }
×
399
    public transform(collection: any[],
400
        config: IPivotConfiguration,
401
        filterStrategy: IFilteringStrategy,
402
        advancedExpressionsTree: IFilteringExpressionsTree,
403
        _filterPipeTrigger: number,
404
        _pipeTrigger: number): any[] {
UNCOV
405
        const expressionsTree = PivotUtil.buildExpressionTree(config);
×
406

UNCOV
407
        const state = {
×
408
            expressionsTree,
409
            strategy: filterStrategy || new DimensionValuesFilteringStrategy(),
×
410
            advancedExpressionsTree
411
        };
412

UNCOV
413
        if (FilteringExpressionsTree.empty(state.expressionsTree) && FilteringExpressionsTree.empty(state.advancedExpressionsTree)) {
×
UNCOV
414
            return collection;
×
415
        }
416

UNCOV
417
        const result = FilterUtil.filter(cloneArray(collection, true), state, this.gridAPI.grid);
×
418

UNCOV
419
        return result;
×
420
    }
421
}
422

423

424
/**
425
 * @hidden
426
 */
427
@Pipe({
428
    name: 'pivotGridColumnSort',
429
    pure: true,
430
    standalone: true
431
})
432
export class IgxPivotGridColumnSortingPipe implements PipeTransform {
2✔
433
    public transform(
434
        collection: IPivotGridRecord[],
435
        expressions: ISortingExpression[],
436
        sorting: IGridSortingStrategy,
437
        _pipeTrigger: number
438
    ): IPivotGridRecord[] {
439
        let result: IPivotGridRecord[];
440

UNCOV
441
        if (!expressions.length) {
×
UNCOV
442
            result = collection;
×
443
        } else {
UNCOV
444
            for (const expr of expressions) {
×
UNCOV
445
                expr.strategy = DefaultPivotGridRecordSortingStrategy.instance();
×
446
            }
UNCOV
447
            result = PivotUtil.sort(cloneArray(collection, true), expressions, sorting);
×
448
        }
UNCOV
449
        return result;
×
450
    }
451
}
452

453
/**
454
 * @hidden
455
 */
456
@Pipe({
457
    name: 'pivotGridSort',
458
    pure: true,
459
    standalone: true
460
})
461
export class IgxPivotGridSortingPipe implements PipeTransform {
2✔
UNCOV
462
    constructor(private gridAPI: GridBaseAPIService<IgxGridBaseDirective & GridType>) { }
×
463
    public transform(collection: any[], config: IPivotConfiguration, sorting: IGridSortingStrategy, _pipeTrigger: number): any[] {
464
        let result: any[];
UNCOV
465
        const allDimensions = config.rows || [];
×
UNCOV
466
        const enabledDimensions = allDimensions.filter(x => x && x.enabled);
×
UNCOV
467
        const expressions = PivotSortUtil.generateDimensionSortingExpressions(enabledDimensions);
×
UNCOV
468
        if (!expressions.length) {
×
UNCOV
469
            result = collection;
×
470
        } else {
UNCOV
471
            result = DataUtil.sort(cloneArray(collection, true), expressions, sorting, this.gridAPI.grid);
×
472
        }
473

UNCOV
474
        return result;
×
475
    }
476
}
477

478
/**
479
 * @hidden
480
 */
481
@Pipe({
482
    name: "filterPivotItems",
483
    standalone: true
484
})
485
export class IgxFilterPivotItemsPipe implements PipeTransform {
2✔
486
    public transform(
487
        collection: (IPivotDimension | IPivotValue)[],
488
        filterCriteria: string,
489
        _pipeTrigger: number
490
    ): any[] {
UNCOV
491
        if (!collection) {
×
492
            return collection;
×
493
        }
UNCOV
494
        let copy = collection.slice(0);
×
UNCOV
495
        if (filterCriteria && filterCriteria.length > 0) {
×
UNCOV
496
            const filterFunc = (c) => {
×
UNCOV
497
                const filterText = c.member || c.memberName;
×
UNCOV
498
                if (!filterText) {
×
499
                    return false;
×
500
                }
UNCOV
501
                return (
×
502
                    filterText
×
503
                        .toLocaleLowerCase()
504
                        .indexOf(filterCriteria.toLocaleLowerCase()) >= 0 ||
505
                    (c.children?.some(filterFunc) ?? false)
506
                );
507
            };
UNCOV
508
            copy = collection.filter(filterFunc);
×
509
        }
UNCOV
510
        return copy;
×
511
    }
512
}
513

514
export interface GridStyleCSSProperty {
515
    [prop: string]: any;
516
}
517

518
@Pipe({
519
    name: 'igxPivotCellStyleClasses',
520
    standalone: true
521
})
522
export class IgxPivotGridCellStyleClassesPipe implements PipeTransform {
2✔
523

524
    public transform(cssClasses: GridStyleCSSProperty, _: any, rowData: IPivotGridRecord, columnData: IPivotGridColumn, index: number, __: number): string {
UNCOV
525
        if (!cssClasses) {
×
UNCOV
526
            return '';
×
527
        }
528

UNCOV
529
        const result = [];
×
530

UNCOV
531
        for (const cssClass of Object.keys(cssClasses)) {
×
UNCOV
532
            const callbackOrValue = cssClasses[cssClass];
×
UNCOV
533
            const apply = typeof callbackOrValue === 'function' ?
×
534
                callbackOrValue(rowData, columnData, resolveNestedPath(rowData, columnData.field), index) : callbackOrValue;
UNCOV
535
            if (apply) {
×
UNCOV
536
                result.push(cssClass);
×
537
            }
538
        }
539

UNCOV
540
        return result.join(' ');
×
541
    }
542
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc