From f0ed5580947a4a52cf12ba3ff4d7ef8b39f24d28 Mon Sep 17 00:00:00 2001 From: Ivan Donchev Date: Thu, 30 Jun 2022 20:44:25 +0300 Subject: [PATCH] feat(datagrid): range selection with shift key Signed-off-by: Ivan Donchev --- projects/angular/clarity.api.md | 5 +- .../src/data/datagrid/datagrid-row.html | 4 +- .../angular/src/data/datagrid/datagrid-row.ts | 58 ++++++++- .../src/data/datagrid/datagrid.spec.ts | 117 +++++++++++++++++- .../angular/src/data/datagrid/datagrid.ts | 25 +++- .../src/data/datagrid/providers/selection.ts | 9 ++ 6 files changed, 210 insertions(+), 8 deletions(-) diff --git a/projects/angular/clarity.api.md b/projects/angular/clarity.api.md index 4bd3cf256c..acf500c036 100644 --- a/projects/angular/clarity.api.md +++ b/projects/angular/clarity.api.md @@ -1124,7 +1124,7 @@ export class ClrDatagrid implements AfterContentInit, AfterViewInit, On // Warning: (ae-forgotten-export) The symbol "Page" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ColumnsService" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "KeyNavigationGridController" needs to be exported by the entry point index.d.ts - constructor(organizer: DatagridRenderOrganizer, items: Items, expandableRows: ExpandableRowsCount, selection: Selection_2, rowActionService: RowActionService, stateProvider: StateProvider, displayMode: DisplayModeService, renderer: Renderer2, detailService: DetailService, datagridId: string, el: ElementRef, page: Page, commonStrings: ClrCommonStringsService, columnsService: ColumnsService, keyNavigation: KeyNavigationGridController); + constructor(organizer: DatagridRenderOrganizer, items: Items, expandableRows: ExpandableRowsCount, selection: Selection_2, rowActionService: RowActionService, stateProvider: StateProvider, displayMode: DisplayModeService, renderer: Renderer2, detailService: DetailService, datagridId: string, document: any, el: ElementRef, page: Page, commonStrings: ClrCommonStringsService, columnsService: ColumnsService, keyNavigation: KeyNavigationGridController, zone: NgZone); get allSelected(): boolean; set allSelected(_value: boolean); // (undocumented) @@ -1704,11 +1704,12 @@ export class ClrDatagridPlaceholder { // @public (undocumented) export class ClrDatagridRow implements AfterContentInit, AfterViewInit { - constructor(selection: Selection_2, rowActionService: RowActionService, globalExpandable: ExpandableRowsCount, expand: DatagridIfExpandService, detailService: DetailService, displayMode: DisplayModeService, vcr: ViewContainerRef, renderer: Renderer2, el: ElementRef, commonStrings: ClrCommonStringsService); + constructor(selection: Selection_2, rowActionService: RowActionService, globalExpandable: ExpandableRowsCount, expand: DatagridIfExpandService, detailService: DetailService, displayMode: DisplayModeService, vcr: ViewContainerRef, renderer: Renderer2, el: ElementRef, commonStrings: ClrCommonStringsService, items: Items, document: any); // (undocumented) _calculatedCells: ViewContainerRef; // (undocumented) checkboxId: string; + clearRanges(event: MouseEvent): void; set clrDgDetailCloseLabel(label: string); // (undocumented) get clrDgDetailCloseLabel(): string; diff --git a/projects/angular/src/data/datagrid/datagrid-row.html b/projects/angular/src/data/datagrid/datagrid-row.html index ac4bb8810b..6e0a562c77 100644 --- a/projects/angular/src/data/datagrid/datagrid-row.html +++ b/projects/angular/src/data/datagrid/datagrid-row.html @@ -2,7 +2,7 @@ We need to wrap the #rowContent in label element if we are in rowSelectionMode. Clicking of that wrapper label will equate to clicking on the whole row, which triggers the checkbox to toggle. --> -