ms-data-grid 0.0.149 → 0.0.151
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/esm2022/lib/data-grid/data-grid.component.mjs +138 -1108
- package/esm2022/lib/services/cell-selection.service.mjs +544 -0
- package/esm2022/lib/services/common.service.mjs +75 -1
- package/esm2022/lib/services/copy-service.service.mjs +42 -11
- package/fesm2022/ms-data-grid.mjs +805 -1129
- package/fesm2022/ms-data-grid.mjs.map +1 -1
- package/lib/data-grid/data-grid.component.d.ts +18 -59
- package/lib/services/cell-selection.service.d.ts +66 -0
- package/lib/services/common.service.d.ts +4 -0
- package/lib/services/copy-service.service.d.ts +2 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { CommonService } from '../services/common.service';
|
|
|
5
5
|
import { CdkDrag, CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragMove, CdkDragSortEvent } from '@angular/cdk/drag-drop';
|
|
6
6
|
import { CdkDropList } from '@angular/cdk/drag-drop';
|
|
7
7
|
import { CopyServiceService } from '../services/copy-service.service';
|
|
8
|
+
import { CellSelectionService } from '../services/cell-selection.service';
|
|
8
9
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
9
10
|
import { ExportService } from '../services/export.service';
|
|
10
11
|
import { CellHostDirective } from '../directives/cellHost.directive';
|
|
@@ -53,6 +54,7 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
53
54
|
private actionValidator;
|
|
54
55
|
private validationsService;
|
|
55
56
|
private htmlSanatizerService;
|
|
57
|
+
cellSelectionService: CellSelectionService;
|
|
56
58
|
rowAnimation: RowAnimationType;
|
|
57
59
|
paginationConfig: any;
|
|
58
60
|
dataSet: any[];
|
|
@@ -211,28 +213,13 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
211
213
|
fontFamilies: string[];
|
|
212
214
|
fontSizes: string[];
|
|
213
215
|
hasScroll: boolean;
|
|
214
|
-
constructor(columnService: SplitColumnsService, cdr: ChangeDetectorRef, commonSevice: CommonService, elementRef: ElementRef, ngZone: NgZone, copyService: CopyServiceService, renderer: Renderer2, sanitizer: DomSanitizer, exportService: ExportService, datePipe: DatePipe, formatCurrency: FormatCurrencyPipe, actionValidator: RowActionService, validationsService: ValidationsService, htmlSanatizerService: HtmlContentSanitizerService);
|
|
215
|
-
cellText: any;
|
|
216
|
-
nestedHeader: ElementRef;
|
|
217
|
-
ngAfterViewInit(): Promise<void>;
|
|
218
|
-
private injector;
|
|
219
|
-
createCellInjector(row: any, col: any): Injector;
|
|
220
|
-
private renderCustomCells;
|
|
221
|
-
shouldRestoreScroll: boolean;
|
|
222
|
-
ngAfterViewChecked(): void;
|
|
223
|
-
ngOnInit(): void;
|
|
224
|
-
dataSetLoading: boolean;
|
|
225
|
-
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
226
|
-
setColumnsColumnDropdownValus(): Promise<void>;
|
|
227
|
-
applyRowsSelectionState(): void;
|
|
228
|
-
clearSelectionState(tableType: string): void;
|
|
229
|
-
applyFilteroptionList(): Promise<void>;
|
|
230
216
|
leftPinnedColumns: any[];
|
|
231
217
|
centerColumns: any[];
|
|
232
218
|
rightPinnedColumns: any[];
|
|
233
219
|
previewLeftPinnedColumns: any[];
|
|
234
220
|
previewCenterColumns: any[];
|
|
235
221
|
previewRightPinnedColumns: any[];
|
|
222
|
+
private injector;
|
|
236
223
|
dataGridContainer: ElementRef<HTMLDivElement>;
|
|
237
224
|
taskManagementContainer: ElementRef<HTMLDivElement>;
|
|
238
225
|
nestedTableContainer: ElementRef<HTMLDivElement>;
|
|
@@ -245,6 +232,21 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
245
232
|
globalSearchInput: ElementRef<HTMLInputElement>;
|
|
246
233
|
columnsGroupedBox: ElementRef<HTMLDivElement>;
|
|
247
234
|
centerFakeScrollbar: ElementRef<HTMLDivElement>;
|
|
235
|
+
constructor(columnService: SplitColumnsService, cdr: ChangeDetectorRef, commonSevice: CommonService, elementRef: ElementRef, ngZone: NgZone, copyService: CopyServiceService, renderer: Renderer2, sanitizer: DomSanitizer, exportService: ExportService, datePipe: DatePipe, formatCurrency: FormatCurrencyPipe, actionValidator: RowActionService, validationsService: ValidationsService, htmlSanatizerService: HtmlContentSanitizerService, cellSelectionService: CellSelectionService);
|
|
236
|
+
cellText: any;
|
|
237
|
+
nestedHeader: ElementRef;
|
|
238
|
+
ngAfterViewInit(): Promise<void>;
|
|
239
|
+
createCellInjector(row: any, col: any): Injector;
|
|
240
|
+
private renderCustomCells;
|
|
241
|
+
shouldRestoreScroll: boolean;
|
|
242
|
+
ngAfterViewChecked(): void;
|
|
243
|
+
ngOnInit(): void;
|
|
244
|
+
dataSetLoading: boolean;
|
|
245
|
+
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
246
|
+
setColumnsColumnDropdownValus(): Promise<void>;
|
|
247
|
+
applyRowsSelectionState(): void;
|
|
248
|
+
clearSelectionState(tableType: string): void;
|
|
249
|
+
applyFilteroptionList(): Promise<void>;
|
|
248
250
|
updateColumnWidthsAndGroups(columns?: any): Promise<void>;
|
|
249
251
|
refreshPreviewColumns(columns?: any): Promise<void>;
|
|
250
252
|
SetColumnsDefaultWidth(): Promise<void>;
|
|
@@ -363,7 +365,6 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
363
365
|
trackById(index: number, item: any): any;
|
|
364
366
|
flattenedData: any[];
|
|
365
367
|
updateFlattenedData(): void;
|
|
366
|
-
private fakeScrollRaf;
|
|
367
368
|
translateY: number;
|
|
368
369
|
lastScrollTop: number;
|
|
369
370
|
pendingAnimationFrame: number | null;
|
|
@@ -532,43 +533,6 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
532
533
|
onGlobalSearch(): void;
|
|
533
534
|
onSearchInput(event: Event): void;
|
|
534
535
|
checkFilterChangesEffect(): any;
|
|
535
|
-
selectedCells: any[];
|
|
536
|
-
selectedKeys: Set<string>;
|
|
537
|
-
selectionStart: any;
|
|
538
|
-
isSelecting: boolean;
|
|
539
|
-
startSelection(rowIndex: number, colIndex: number, subColIndex: number | null, field: string, event: MouseEvent, section: string): void;
|
|
540
|
-
extendSelection(rowIndex: number, colIndex: number, subColIndex: number | null, field: string, event: MouseEvent, section: string): void;
|
|
541
|
-
getColumnSelectionRange(startCol: number, endCol: number, startSub: number, endSub: number): {
|
|
542
|
-
colIndex: number;
|
|
543
|
-
subColIndex: number;
|
|
544
|
-
}[];
|
|
545
|
-
getSubColumnCount(colIndex: number): number;
|
|
546
|
-
isGroupColumn(colIndex: number): boolean;
|
|
547
|
-
endSelection(): void;
|
|
548
|
-
isSelected(rowIndex: number, colIndex: number, subColIndex: number | null, field: string, section: string): boolean;
|
|
549
|
-
private selectionBounds;
|
|
550
|
-
updateSelectionBoundaries(): void;
|
|
551
|
-
findLeftMostCell(): {
|
|
552
|
-
colIndex: number;
|
|
553
|
-
subColIndex: number;
|
|
554
|
-
} | null;
|
|
555
|
-
findRightMostCell(): {
|
|
556
|
-
colIndex: number;
|
|
557
|
-
subColIndex: number;
|
|
558
|
-
} | null;
|
|
559
|
-
isTopBorder(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
560
|
-
isBottomBorder(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
561
|
-
isLeftBorder(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
562
|
-
isRightBorder(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
563
|
-
isTopLeftCorner(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
564
|
-
isTopRightCorner(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
565
|
-
isBottomLeftCorner(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
566
|
-
isBottomRightCorner(rowIndex: number, colIndex: number, subColIndex: number | null, section: string): boolean;
|
|
567
|
-
cellSelectionAutoScrollInterval: any;
|
|
568
|
-
private scrollSpeed;
|
|
569
|
-
private scrollMargin;
|
|
570
|
-
handleCellAutoScroll(event: MouseEvent): void;
|
|
571
|
-
stopAutoScroll(): void;
|
|
572
536
|
rowSelectedIndexes: Set<number>;
|
|
573
537
|
rowSelecting: boolean;
|
|
574
538
|
rowSelectionStartIndex: number | null;
|
|
@@ -591,7 +555,6 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
591
555
|
goToPreviousPage(): void;
|
|
592
556
|
goToFirstPage(): void;
|
|
593
557
|
goToLastPage(): void;
|
|
594
|
-
selectAllCells(): void;
|
|
595
558
|
undo(): void;
|
|
596
559
|
redo(): void;
|
|
597
560
|
onPaste(event: ClipboardEvent): Promise<void>;
|
|
@@ -655,10 +618,6 @@ export declare class DataGridComponent implements OnChanges, AfterViewInit, OnIn
|
|
|
655
618
|
blurInput(event: Event, row: any, col: any): void;
|
|
656
619
|
getValidActions(element: any): string[];
|
|
657
620
|
private isStatusField;
|
|
658
|
-
/**
|
|
659
|
-
* Capitalizes the first letter of each word in a string
|
|
660
|
-
* Handles: spaced words, camelCase, snake_case, kebab-case, and compound words
|
|
661
|
-
*/
|
|
662
621
|
private capitalizeStatus;
|
|
663
622
|
gridContext: {
|
|
664
623
|
applyFilter: (col: any) => void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface CellPos {
|
|
3
|
+
rowIndex: number;
|
|
4
|
+
colIndex: number;
|
|
5
|
+
subColIndex: number;
|
|
6
|
+
field: string;
|
|
7
|
+
key: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class CellSelectionService {
|
|
10
|
+
selectedCells: CellPos[];
|
|
11
|
+
selectedKeys: Set<string>;
|
|
12
|
+
selectionStart: CellPos | null;
|
|
13
|
+
isSelecting: boolean;
|
|
14
|
+
activeCell: CellPos | null;
|
|
15
|
+
private cellSelectionAutoScrollInterval;
|
|
16
|
+
private scrollSpeed;
|
|
17
|
+
private scrollMargin;
|
|
18
|
+
columns: any[];
|
|
19
|
+
getColumnByIndex: (index: number) => any;
|
|
20
|
+
verticalContainer: HTMLElement | null;
|
|
21
|
+
horizontalContainer: HTMLElement | null;
|
|
22
|
+
selectionBounds: {
|
|
23
|
+
top: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
left: {
|
|
26
|
+
colIndex: number;
|
|
27
|
+
subColIndex: number;
|
|
28
|
+
} | null;
|
|
29
|
+
right: {
|
|
30
|
+
colIndex: number;
|
|
31
|
+
subColIndex: number;
|
|
32
|
+
} | null;
|
|
33
|
+
};
|
|
34
|
+
startSelection(row: any, column: any, subColIndex: number | null, event: MouseEvent): void;
|
|
35
|
+
extendSelection(row: any, column: any, subColIndex: number | null, event: MouseEvent): void;
|
|
36
|
+
endSelection(): void;
|
|
37
|
+
handleCellAutoScroll(event: MouseEvent): void;
|
|
38
|
+
stopAutoScroll(): void;
|
|
39
|
+
isSelected(rowIndex: number, colIndex: number, subColIndex?: number | null): boolean;
|
|
40
|
+
updateSelectionBoundaries(): void;
|
|
41
|
+
isTopBorder(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
42
|
+
isBottomBorder(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
43
|
+
isLeftBorder(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
44
|
+
isRightBorder(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
45
|
+
isTopLeftCorner(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
46
|
+
isTopRightCorner(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
47
|
+
isBottomLeftCorner(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
48
|
+
isBottomRightCorner(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
49
|
+
setActiveCell(rowIndex: number, colIndex: number, subColIndex?: number): void;
|
|
50
|
+
isActiveCell(rowIndex: number, colIndex: number, subColIndex?: number): boolean;
|
|
51
|
+
selectAllCells(dataSet: any[], columns: any[]): void;
|
|
52
|
+
moveActiveCell(direction: 'up' | 'down' | 'left' | 'right', shiftKey: boolean, dataSet: any[], columns: any[]): void;
|
|
53
|
+
ctrlKeyPressed: boolean;
|
|
54
|
+
private isColumnVisible;
|
|
55
|
+
private findNextVisibleCol;
|
|
56
|
+
private findPrevVisibleCol;
|
|
57
|
+
scrollActiveCellIntoView(rowIndex: number, colIndex: number): void;
|
|
58
|
+
extendSelectionByKeyboard(target: CellPos): void;
|
|
59
|
+
private getEdgeCell;
|
|
60
|
+
rowHeight: number;
|
|
61
|
+
private scrollCellIntoViewImmediate;
|
|
62
|
+
private isLastRow;
|
|
63
|
+
get selectedColumnIndices(): number[];
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CellSelectionService, never>;
|
|
65
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CellSelectionService>;
|
|
66
|
+
}
|
|
@@ -3,6 +3,7 @@ export declare class CommonService {
|
|
|
3
3
|
private datePipe;
|
|
4
4
|
constructor();
|
|
5
5
|
mainContainerLeft: number;
|
|
6
|
+
fontFamilies: string[];
|
|
6
7
|
gethasVisibleColumns(columns: any[]): boolean;
|
|
7
8
|
gethasInVisibleColumns(columns: any[]): boolean;
|
|
8
9
|
getTotalColumnsLength(columns: any[]): number;
|
|
@@ -15,6 +16,9 @@ export declare class CommonService {
|
|
|
15
16
|
updateActiveFilteredColumns(columns: any[]): any[];
|
|
16
17
|
hasFieldChanged(current: any, original: any, type: string): boolean;
|
|
17
18
|
copyDropdownDataRecursively(columns: any[]): Promise<any[]>;
|
|
19
|
+
assignUniqueColumnIndexes(columns: any[], ctx?: {
|
|
20
|
+
index: number;
|
|
21
|
+
}): any[];
|
|
18
22
|
formatDateValue(value: any, momentFormat?: string): string;
|
|
19
23
|
private convertMomentToAngularDateFormat;
|
|
20
24
|
private parseDDMMYYYY;
|
|
@@ -3,6 +3,8 @@ export declare class CopyServiceService {
|
|
|
3
3
|
constructor();
|
|
4
4
|
getSelectedDataForCopy(dataSet: any[], columns: any[], rowSelectedIndexes: Set<number>, selectedCells: any[], getNestedValue: (obj: any, path: string) => any): any[][];
|
|
5
5
|
copyToClipboard(selectedData: any[][], selector?: string): void;
|
|
6
|
+
private flashSelectedCells;
|
|
7
|
+
private legacyCopy;
|
|
6
8
|
updateRows: any[];
|
|
7
9
|
currentColums: any;
|
|
8
10
|
pasteFromClipboardText(text: string, dataSet: any[], columns: any[], startRowIndex: number, startColIndex: number, startSubColIndex?: number): Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-data-grid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.151",
|
|
4
4
|
"description": "A powerful, customizable Angular data grid component with advanced features like sorting, filtering, pagination, column pinning, and taskbar actions. Perfect for enterprise applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|