@elderbyte/ngx-starter 19.4.2 → 19.6.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/fesm2022/elderbyte-ngx-starter.mjs +2166 -1261
- package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/common/data/data-context/data-context-continuable-base.d.ts +3 -2
- package/lib/common/data/data-context/data-context-continuable-paged.d.ts +0 -1
- package/lib/common/data/data-context/data-context-continuable-token.d.ts +2 -0
- package/lib/common/data/data-context/data-context.d.ts +6 -0
- package/lib/common/data/data-context/mat-table-data-context-binding.d.ts +6 -1
- package/lib/common/data/datasource/data-source.d.ts +2 -0
- package/lib/common/data/datasource/local/local-list-data-source.d.ts +1 -1
- package/lib/common/data/sort-context.d.ts +1 -0
- package/lib/common/data/token-chunk-request.d.ts +12 -1
- package/lib/components/data-view/base/elder-data-view-base.d.ts +5 -16
- package/lib/components/data-view/common/drag-and-drop/data-view-dnd-controller.service.d.ts +70 -0
- package/lib/components/data-view/common/drag-and-drop/elder-data-view-dnd.directive.d.ts +66 -0
- package/lib/components/data-view/common/drag-and-drop/elder-data-view-item-drag.directive.d.ts +38 -0
- package/lib/components/data-view/common/drag-and-drop/events/data-view-drag-entered-event.d.ts +16 -0
- package/lib/components/data-view/common/drag-and-drop/events/data-view-drag-exited-event.d.ts +12 -0
- package/lib/components/data-view/common/drag-and-drop/events/data-view-item-drop-event.d.ts +74 -0
- package/lib/components/data-view/common/drag-and-drop/events/public_api.d.ts +3 -0
- package/lib/components/data-view/common/drag-and-drop/grouping/data-view-dnd-group-controller.service.d.ts +42 -0
- package/lib/components/data-view/common/drag-and-drop/grouping/elder-data-view-dnd-group.directive.d.ts +30 -0
- package/lib/components/data-view/common/drag-and-drop/grouping/public_api.d.ts +2 -0
- package/lib/components/data-view/common/drag-and-drop/local-data/data-view-dnd-model-util.d.ts +40 -0
- package/lib/components/data-view/common/drag-and-drop/local-data/elder-local-dnd-support.directive.d.ts +54 -0
- package/lib/components/data-view/common/drag-and-drop/local-data/public_api.d.ts +2 -0
- package/lib/components/data-view/common/drag-and-drop/public_api.d.ts +7 -0
- package/lib/components/data-view/common/elder-continuator/elder-continuator.component.d.ts +14 -0
- package/lib/components/data-view/common/elder-data-common.module.d.ts +14 -9
- package/lib/components/data-view/common/public_api.d.ts +2 -0
- package/lib/components/data-view/common/selection/data-context-selection.directive.d.ts +3 -1
- package/lib/components/data-view/grid/elder-grid/elder-grid.component.d.ts +7 -5
- package/lib/components/data-view/table/columns/elder-table-selection-cell/elder-table-selection-cell.component.d.ts +30 -0
- package/lib/components/data-view/table/drag-and-drop/elder-table-drop-list-connector.directive.d.ts +37 -0
- package/lib/components/data-view/table/drag-and-drop/public_api.d.ts +1 -0
- package/lib/components/data-view/table/elder-table/elder-table.component.d.ts +11 -5
- package/lib/components/data-view/table/elder-table-row.directive.d.ts +23 -12
- package/lib/components/data-view/table/elder-table.module.d.ts +27 -23
- package/package.json +1 -1
- package/src/lib/components/data-view/common/elder-continuator/elder-continuator.component.scss +17 -0
- package/src/lib/components/data-view/table/columns/elder-table-selection-cell/elder-table-selection-cell.component.scss +0 -0
- package/theming/components/_elder-table-theme.scss +24 -0
|
@@ -15,7 +15,7 @@ export declare abstract class DataContextContinuableBase<T> extends DataContextB
|
|
|
15
15
|
* *
|
|
16
16
|
**************************************************************************/
|
|
17
17
|
private readonly cblogger;
|
|
18
|
-
private _chunkSize
|
|
18
|
+
private readonly _chunkSize$;
|
|
19
19
|
/***************************************************************************
|
|
20
20
|
* *
|
|
21
21
|
* Constructors *
|
|
@@ -28,7 +28,8 @@ export declare abstract class DataContextContinuableBase<T> extends DataContextB
|
|
|
28
28
|
* *
|
|
29
29
|
**************************************************************************/
|
|
30
30
|
loadAll(sorts?: Sort[], filters?: Filter[]): void;
|
|
31
|
-
get chunkSize(): number
|
|
31
|
+
get chunkSize$(): Observable<number>;
|
|
32
|
+
get chunkSize(): number | undefined;
|
|
32
33
|
set chunkSize(size: number);
|
|
33
34
|
/***************************************************************************
|
|
34
35
|
* *
|
|
@@ -47,7 +47,6 @@ export declare class DataContextContinuablePaged<T> extends DataContextContinuab
|
|
|
47
47
|
* *
|
|
48
48
|
**************************************************************************/
|
|
49
49
|
private checkHasMoreData;
|
|
50
|
-
protected onChunkSizeChanged(newSize: number): void;
|
|
51
50
|
protected reloadInternal(): Observable<any>;
|
|
52
51
|
protected clearAll(silent?: boolean): void;
|
|
53
52
|
private fetchPage;
|
|
@@ -40,6 +40,8 @@ export declare class DataContextContinuableToken<T> extends DataContextContinuab
|
|
|
40
40
|
protected clearAll(silent?: boolean): void;
|
|
41
41
|
protected reloadInternal(): Observable<any>;
|
|
42
42
|
private fetchNextChunk;
|
|
43
|
+
private onChunkFetched;
|
|
44
|
+
private onChunkFetchError;
|
|
43
45
|
/**
|
|
44
46
|
* Load the data from the given page into the current data context
|
|
45
47
|
*/
|
|
@@ -146,6 +146,12 @@ export interface IDataContextContinuable<T> extends IDataContext<T> {
|
|
|
146
146
|
* paged context loads page by page until finished.
|
|
147
147
|
*/
|
|
148
148
|
loadAll(sorts?: Sort[], filters?: Filter[]): void;
|
|
149
|
+
/**
|
|
150
|
+
* Set the desired chunk size
|
|
151
|
+
*/
|
|
152
|
+
set chunkSize(size: number | undefined);
|
|
153
|
+
get chunkSize(): number;
|
|
154
|
+
get chunkSize$(): Observable<number | undefined>;
|
|
149
155
|
}
|
|
150
156
|
export interface IDataContextActivePage<T> extends IDataContext<T> {
|
|
151
157
|
/**
|
|
@@ -2,6 +2,7 @@ import { MatPaginator } from '@angular/material/paginator';
|
|
|
2
2
|
import { MatSort } from '@angular/material/sort';
|
|
3
3
|
import { IDataContext } from './data-context';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
+
import { ElderContinuatorComponent } from '../../../components/data-view/common/elder-continuator/elder-continuator.component';
|
|
5
6
|
export declare class MatTableDataContextBindingBuilder {
|
|
6
7
|
/***************************************************************************
|
|
7
8
|
* *
|
|
@@ -12,6 +13,7 @@ export declare class MatTableDataContextBindingBuilder {
|
|
|
12
13
|
private _dataContext$;
|
|
13
14
|
private _sorts$;
|
|
14
15
|
private _matPaginator$;
|
|
16
|
+
private _continuator$;
|
|
15
17
|
/***************************************************************************
|
|
16
18
|
* *
|
|
17
19
|
* Static Builder *
|
|
@@ -26,12 +28,14 @@ export declare class MatTableDataContextBindingBuilder {
|
|
|
26
28
|
**************************************************************************/
|
|
27
29
|
withSorts(sorts$: Observable<MatSort[]>): this;
|
|
28
30
|
withPaginator(paginator$: Observable<MatPaginator>): this;
|
|
31
|
+
withContinuator(continuator$: Observable<ElderContinuatorComponent>): this;
|
|
29
32
|
bindUntil(destroy$: Observable<any>): MatTableDataContextBinding;
|
|
30
33
|
}
|
|
31
34
|
export declare class MatTableDataContextBinding {
|
|
32
35
|
private readonly _dataContext$;
|
|
33
36
|
private readonly _matSorts$;
|
|
34
37
|
private readonly _matPaginator$;
|
|
38
|
+
private readonly _continuator$;
|
|
35
39
|
/***************************************************************************
|
|
36
40
|
* *
|
|
37
41
|
* Fields *
|
|
@@ -43,7 +47,7 @@ export declare class MatTableDataContextBinding {
|
|
|
43
47
|
* Constructor *
|
|
44
48
|
* *
|
|
45
49
|
**************************************************************************/
|
|
46
|
-
constructor(_dataContext$: Observable<IDataContext<any>>, _matSorts$: Observable<MatSort[]> | null, _matPaginator$: Observable<MatPaginator> | null, destroy$: Observable<any>);
|
|
50
|
+
constructor(_dataContext$: Observable<IDataContext<any>>, _matSorts$: Observable<MatSort[]> | null, _matPaginator$: Observable<MatPaginator> | null, _continuator$: Observable<ElderContinuatorComponent> | null, destroy$: Observable<any>);
|
|
47
51
|
/***************************************************************************
|
|
48
52
|
* *
|
|
49
53
|
* Private methods *
|
|
@@ -55,6 +59,7 @@ export declare class MatTableDataContextBinding {
|
|
|
55
59
|
private updateMatSort;
|
|
56
60
|
private bindMatSortsToDataContextUntil;
|
|
57
61
|
private bindPaginatorUntil;
|
|
62
|
+
private bindContinuatorUntil;
|
|
58
63
|
private toMatDirection;
|
|
59
64
|
private fromMatDirection;
|
|
60
65
|
}
|
|
@@ -5,6 +5,7 @@ import { Page, Pageable } from '../page';
|
|
|
5
5
|
import { TokenChunkRequest } from '../token-chunk-request';
|
|
6
6
|
import { ContinuableListing } from '../continuable-listing';
|
|
7
7
|
import { DataSourceChangeEvent } from './data-source-change-event';
|
|
8
|
+
import { LocalListDataSource } from "./local/local-list-data-source";
|
|
8
9
|
/***************************************************************************
|
|
9
10
|
* *
|
|
10
11
|
* Data Fetcher APIs *
|
|
@@ -55,5 +56,6 @@ export interface IContinuableDataSource<T> extends IContinuationFetcher<T>, IDat
|
|
|
55
56
|
**************************************************************************/
|
|
56
57
|
export declare function isDataSource(object: any): object is IDataSource<any>;
|
|
57
58
|
export declare function isListDataSource(object: IDataSource<any>): object is IListDataSource<any>;
|
|
59
|
+
export declare function isLocalListDataSource(object: IDataSource<any>): object is LocalListDataSource<any>;
|
|
58
60
|
export declare function isPagedDataSource(object: IDataSource<any>): object is IPagedDataSource<any>;
|
|
59
61
|
export declare function isContinuableDataSource(object: IDataSource<any>): object is IContinuableDataSource<any>;
|
|
@@ -58,7 +58,7 @@ export declare class LocalListDataSource<T> extends DataSourceBase<T> implements
|
|
|
58
58
|
deleteAll(toDelete: T[]): void;
|
|
59
59
|
deleteAllById(idsToDelete: any[]): void;
|
|
60
60
|
saveAll(toSave: T[]): void;
|
|
61
|
-
save(entity: T): void;
|
|
61
|
+
save(entity: T, index?: number): void;
|
|
62
62
|
/***************************************************************************
|
|
63
63
|
* *
|
|
64
64
|
* Private methods *
|
|
@@ -16,6 +16,7 @@ export declare class SortContext {
|
|
|
16
16
|
get sortsSnapshot(): Sort[];
|
|
17
17
|
findSortDirection(prop: string): SortDirection | undefined;
|
|
18
18
|
findSort(prop: string): Sort | undefined;
|
|
19
|
+
isEmpty(): boolean;
|
|
19
20
|
/***************************************************************************
|
|
20
21
|
* *
|
|
21
22
|
* Public API *
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { Sort } from './sort';
|
|
2
2
|
import { Filter } from './filters/filter';
|
|
3
|
+
import { ContinuableListing } from './continuable-listing';
|
|
3
4
|
export declare class TokenChunkRequest {
|
|
4
5
|
readonly nextContinuationToken: string | null | undefined;
|
|
5
6
|
readonly filters: Filter[];
|
|
6
7
|
readonly sorts: Sort[];
|
|
7
|
-
|
|
8
|
+
readonly chunkSize: number | undefined;
|
|
9
|
+
static first(filters: Filter[], sorts: Sort[], chunkSize: number | undefined): TokenChunkRequest;
|
|
10
|
+
static nextIfAvailable(listing: ContinuableListing<any>, filters: Filter[], sorts: Sort[]): TokenChunkRequest | undefined;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param nextContinuationToken The continuation token. If not defined, fetches the first chunk.
|
|
14
|
+
* @param filters Filters to send with the request.
|
|
15
|
+
* @param sorts Sorts to send with the request.
|
|
16
|
+
* @param chunkSize The desired chunk size. Since servers are in control of chunk-size (performance), this is only considered a hint which might be ignored.
|
|
17
|
+
*/
|
|
18
|
+
constructor(nextContinuationToken: string | null | undefined, filters: Filter[], sorts: Sort[], chunkSize: number | undefined);
|
|
8
19
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BooleanInput } from '@angular/cdk/coercion';
|
|
2
1
|
import { OnDestroy, OnInit, Signal } from '@angular/core';
|
|
3
2
|
import { Observable, Subject } from 'rxjs';
|
|
4
3
|
import { IDataContext, IDataContextActivePage, IDataContextContinuable } from '../../../common/data/data-context/data-context';
|
|
@@ -31,12 +30,8 @@ export declare abstract class ElderDataViewBaseComponent<T = any> implements IEl
|
|
|
31
30
|
* In more advanced scenarios where you plan to reuse the same data-context
|
|
32
31
|
* set this to false and release the resources yourself. (dataContext.close)
|
|
33
32
|
*/
|
|
34
|
-
cleanUp: boolean
|
|
35
|
-
|
|
36
|
-
* If true, this table is in dense mode.
|
|
37
|
-
* Heights are generally reduced.
|
|
38
|
-
*/
|
|
39
|
-
private _dense;
|
|
33
|
+
readonly cleanUp: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
34
|
+
readonly dense: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
40
35
|
private readonly _itemClickSubject;
|
|
41
36
|
private readonly EntityIdKeyFn;
|
|
42
37
|
protected readonly destroy$: Subject<void>;
|
|
@@ -46,7 +41,9 @@ export declare abstract class ElderDataViewBaseComponent<T = any> implements IEl
|
|
|
46
41
|
readonly canLoadMore: Signal<boolean | undefined>;
|
|
47
42
|
readonly viewData: Signal<T[] | undefined>;
|
|
48
43
|
readonly currentPage: Signal<PageRequest | undefined>;
|
|
44
|
+
readonly currentChunkSize: Signal<number | undefined>;
|
|
49
45
|
readonly currentSelection: Signal<T[] | undefined>;
|
|
46
|
+
readonly selectionSingleChange: Observable<any>;
|
|
50
47
|
/***************************************************************************
|
|
51
48
|
* *
|
|
52
49
|
* Constructor *
|
|
@@ -80,7 +77,6 @@ export declare abstract class ElderDataViewBaseComponent<T = any> implements IEl
|
|
|
80
77
|
set selectableEvaluatorFn(selectableEvaluatorFn: (entity: any) => boolean);
|
|
81
78
|
set selection(selection: any[]);
|
|
82
79
|
get selectionChange(): Observable<any[]>;
|
|
83
|
-
get selectionSingleChange(): Observable<any>;
|
|
84
80
|
set selectionMultiEnabled(enableMultiSelection: boolean);
|
|
85
81
|
abstract get selectionVisible(): boolean;
|
|
86
82
|
abstract set selectionVisible(selectionVisible: boolean);
|
|
@@ -90,13 +86,6 @@ export declare abstract class ElderDataViewBaseComponent<T = any> implements IEl
|
|
|
90
86
|
* *
|
|
91
87
|
**************************************************************************/
|
|
92
88
|
get itemClick(): Observable<any>;
|
|
93
|
-
/***************************************************************************
|
|
94
|
-
* *
|
|
95
|
-
* Style Properties *
|
|
96
|
-
* *
|
|
97
|
-
**************************************************************************/
|
|
98
|
-
set dense(value: BooleanInput);
|
|
99
|
-
get dense(): boolean;
|
|
100
89
|
/***************************************************************************
|
|
101
90
|
* *
|
|
102
91
|
* Event Entry Points *
|
|
@@ -124,5 +113,5 @@ export declare abstract class ElderDataViewBaseComponent<T = any> implements IEl
|
|
|
124
113
|
*/
|
|
125
114
|
protected autoCleanUp(): void;
|
|
126
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderDataViewBaseComponent<any>, never>;
|
|
127
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderDataViewBaseComponent<any>, never, never, { "interactionMode": { "alias": "interactionMode"; "required": false; }; "cleanUp": { "alias": "cleanUp"; "required": false; }; "
|
|
116
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderDataViewBaseComponent<any>, never, never, { "interactionMode": { "alias": "interactionMode"; "required": false; }; "cleanUp": { "alias": "cleanUp"; "required": false; "isSignal": true; }; "dense": { "alias": "dense"; "required": false; "isSignal": true; }; "selectableEvaluatorFn": { "alias": "selectableEvaluatorFn"; "required": false; }; "selection": { "alias": "selection"; "required": false; }; "selectionMultiEnabled": { "alias": "selectionMultiEnabled"; "required": false; }; }, { "selectionSingleChange": "selectionSingleChange"; "selectionChange": "selectionChange"; "itemClick": "itemClick"; }, never, never, true, never>;
|
|
128
117
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDropList } from '@angular/cdk/drag-drop';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
import { IElderDataView } from '../../base/elder-data-view';
|
|
4
|
+
import { DataViewItemDropEvent } from './events/data-view-item-drop-event';
|
|
5
|
+
import { IDataContext } from '../../../../common/data/data-context/data-context';
|
|
6
|
+
import { DataViewDragEnteredEvent } from './events/data-view-drag-entered-event';
|
|
7
|
+
import { DataViewDragExitedEvent } from './events/data-view-drag-exited-event';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Controller service for a single data view with drag and drop support
|
|
11
|
+
* (ElderDataViewDndDirective).
|
|
12
|
+
*/
|
|
13
|
+
export declare class DataViewDndControllerService<T> {
|
|
14
|
+
/***************************************************************************
|
|
15
|
+
* *
|
|
16
|
+
* Fields *
|
|
17
|
+
* *
|
|
18
|
+
**************************************************************************/
|
|
19
|
+
private readonly log;
|
|
20
|
+
private readonly _dropList$;
|
|
21
|
+
private readonly _dataView$;
|
|
22
|
+
private readonly _canDragItemPredicate$;
|
|
23
|
+
private readonly _ignoreSamePositionDrops$;
|
|
24
|
+
readonly itemDropped$: Subject<DataViewItemDropEvent<T>>;
|
|
25
|
+
readonly dropListEntered$: Subject<DataViewDragEnteredEvent<T>>;
|
|
26
|
+
readonly dropListExited$: Subject<DataViewDragExitedEvent<T>>;
|
|
27
|
+
/***************************************************************************
|
|
28
|
+
* *
|
|
29
|
+
* Constructor *
|
|
30
|
+
* *
|
|
31
|
+
**************************************************************************/
|
|
32
|
+
constructor();
|
|
33
|
+
/***************************************************************************
|
|
34
|
+
* *
|
|
35
|
+
* Properties *
|
|
36
|
+
* *
|
|
37
|
+
**************************************************************************/
|
|
38
|
+
get dropList$(): Observable<CdkDropList>;
|
|
39
|
+
get canDragItemPredicate$(): Observable<(item: T) => boolean>;
|
|
40
|
+
/***************************************************************************
|
|
41
|
+
* *
|
|
42
|
+
* Public API *
|
|
43
|
+
* *
|
|
44
|
+
**************************************************************************/
|
|
45
|
+
registerDataView(dataView: IElderDataView<T>): void;
|
|
46
|
+
register(cdkDropList: CdkDropList): void;
|
|
47
|
+
setCanDragItemPredicate(predicate: (item: T) => boolean): void;
|
|
48
|
+
setIgnoreSamePositionDrops(ignoreSamePositionDrops: boolean): void;
|
|
49
|
+
/***************************************************************************
|
|
50
|
+
* *
|
|
51
|
+
* Event Handling *
|
|
52
|
+
* *
|
|
53
|
+
**************************************************************************/
|
|
54
|
+
onItemDropped(event: CdkDragDrop<IDataContext<T>>): void;
|
|
55
|
+
onDropListEntered(event: CdkDragEnter<IDataContext<T>, T>): void;
|
|
56
|
+
onDropListExited(event: CdkDragExit<IDataContext<T>, T>): void;
|
|
57
|
+
/***************************************************************************
|
|
58
|
+
* *
|
|
59
|
+
* Private Methods *
|
|
60
|
+
* *
|
|
61
|
+
**************************************************************************/
|
|
62
|
+
private handleItemDropped;
|
|
63
|
+
private buildItemDropEvent;
|
|
64
|
+
private handleDropListEntered;
|
|
65
|
+
private buildDragEnteredEvent;
|
|
66
|
+
private handleDropListExited;
|
|
67
|
+
private buildDragExitedEvent;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataViewDndControllerService<any>, never>;
|
|
69
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DataViewDndControllerService<any>>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { OutputRef } from '@angular/core';
|
|
2
|
+
import { DataViewItemDropEvent } from './events/data-view-item-drop-event';
|
|
3
|
+
import { IElderDataView } from '../../base/elder-data-view';
|
|
4
|
+
import { DataViewDndControllerService } from './data-view-dnd-controller.service';
|
|
5
|
+
import { IDataContext } from '../../../../common/data/data-context/data-context';
|
|
6
|
+
import { DataViewDragEnteredEvent } from './events/data-view-drag-entered-event';
|
|
7
|
+
import { DataViewDragExitedEvent } from './events/data-view-drag-exited-event';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Directive adding drag and drop support on an Elder data view.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ElderDataViewDndDirective<T> {
|
|
13
|
+
private readonly dndController;
|
|
14
|
+
readonly _dataView: IElderDataView<T>;
|
|
15
|
+
/***************************************************************************
|
|
16
|
+
* *
|
|
17
|
+
* Fields *
|
|
18
|
+
* *
|
|
19
|
+
**************************************************************************/
|
|
20
|
+
private readonly log;
|
|
21
|
+
private readonly _dataContext;
|
|
22
|
+
private readonly _dropList;
|
|
23
|
+
/** Used to disconnect obsolete event bindings. */
|
|
24
|
+
private readonly _unsubscribeEventBindings;
|
|
25
|
+
/** Controls if drag and drop is generally enabled or not. */
|
|
26
|
+
readonly canDrag: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
27
|
+
/** Allows connecting different drop views together. */
|
|
28
|
+
readonly dropConnectedTo: import("@angular/core").InputSignal<string[]>;
|
|
29
|
+
/** Predicate to determine if an item is draggable or not. */
|
|
30
|
+
readonly canDragItemPredicate: import("@angular/core").InputSignal<(item: T) => boolean>;
|
|
31
|
+
/** Predicate to determine if one can enter a drop view. */
|
|
32
|
+
readonly canEnterPredicate: import("@angular/core").InputSignal<(item: T, context: IDataContext<T>) => boolean>;
|
|
33
|
+
/** If ture, will ignore drop events where the item was dropped at the same position from where it was dragged. */
|
|
34
|
+
readonly ignoreSamePositionDrops: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
35
|
+
/** Fired when an item is dropped. */
|
|
36
|
+
readonly itemDropped: OutputRef<DataViewItemDropEvent<T>>;
|
|
37
|
+
/** Fired when a drop view is entered while dragging. */
|
|
38
|
+
readonly dropListEntered: OutputRef<DataViewDragEnteredEvent<T>>;
|
|
39
|
+
/** Fired when a drop view is exited while dragging. */
|
|
40
|
+
readonly dropListExited: OutputRef<DataViewDragExitedEvent<T>>;
|
|
41
|
+
/***************************************************************************
|
|
42
|
+
* *
|
|
43
|
+
* Constructor *
|
|
44
|
+
* *
|
|
45
|
+
**************************************************************************/
|
|
46
|
+
constructor(dndController: DataViewDndControllerService<T>, _dataView: IElderDataView<T>);
|
|
47
|
+
/***************************************************************************
|
|
48
|
+
* *
|
|
49
|
+
* Properties *
|
|
50
|
+
* *
|
|
51
|
+
**************************************************************************/
|
|
52
|
+
get controller(): DataViewDndControllerService<T>;
|
|
53
|
+
/***************************************************************************
|
|
54
|
+
* *
|
|
55
|
+
* Private Methods *
|
|
56
|
+
* *
|
|
57
|
+
**************************************************************************/
|
|
58
|
+
private bindEvents;
|
|
59
|
+
private bindCanDrag;
|
|
60
|
+
private bindConnectedTo;
|
|
61
|
+
private bindCanEnterPredicate;
|
|
62
|
+
private dropEnterPredicate;
|
|
63
|
+
private bindData;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderDataViewDndDirective<any>, never>;
|
|
65
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderDataViewDndDirective<any>, "[elderDataViewDnd]", never, { "canDrag": { "alias": "canDrag"; "required": false; "isSignal": true; }; "dropConnectedTo": { "alias": "dropConnectedTo"; "required": false; "isSignal": true; }; "canDragItemPredicate": { "alias": "canDragItemPredicate"; "required": false; "isSignal": true; }; "canEnterPredicate": { "alias": "canEnterPredicate"; "required": false; "isSignal": true; }; "ignoreSamePositionDrops": { "alias": "ignoreSamePositionDrops"; "required": false; "isSignal": true; }; }, { "itemDropped": "itemDropped"; "dropListEntered": "dropListEntered"; "dropListExited": "dropListExited"; }, never, never, true, never>;
|
|
66
|
+
}
|
package/lib/components/data-view/common/drag-and-drop/elder-data-view-item-drag.directive.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CdkDrag } from '@angular/cdk/drag-drop';
|
|
2
|
+
import { DataViewDndControllerService } from './data-view-dnd-controller.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/cdk/drag-drop";
|
|
5
|
+
/**
|
|
6
|
+
* Adds drag and drop support for items of elder data view.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ElderDataViewItemDragDirective<T> {
|
|
9
|
+
readonly dndController: DataViewDndControllerService<T>;
|
|
10
|
+
readonly cdkDrag: CdkDrag;
|
|
11
|
+
/***************************************************************************
|
|
12
|
+
* *
|
|
13
|
+
* Fields *
|
|
14
|
+
* *
|
|
15
|
+
**************************************************************************/
|
|
16
|
+
/** The item that is being dragged. */
|
|
17
|
+
readonly item: import("@angular/core").InputSignal<T>;
|
|
18
|
+
/** Controls if the item can be dragged or not.
|
|
19
|
+
* We explicitly initialize with null and don't use booleanTransformFn since we need to know if the
|
|
20
|
+
* user defined this or if we should fall back to a superior predicate fn.
|
|
21
|
+
* */
|
|
22
|
+
readonly canDragItem: import("@angular/core").InputSignal<any>;
|
|
23
|
+
/***************************************************************************
|
|
24
|
+
* *
|
|
25
|
+
* Constructor *
|
|
26
|
+
* *
|
|
27
|
+
**************************************************************************/
|
|
28
|
+
constructor(dndController: DataViewDndControllerService<T>, cdkDrag: CdkDrag);
|
|
29
|
+
/***************************************************************************
|
|
30
|
+
* *
|
|
31
|
+
* Private Methods *
|
|
32
|
+
* *
|
|
33
|
+
**************************************************************************/
|
|
34
|
+
private bindCanDragItem;
|
|
35
|
+
private bindData;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderDataViewItemDragDirective<any>, [{ optional: true; }, null]>;
|
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderDataViewItemDragDirective<any>, "[elderElderDataViewItemDrag]", never, { "item": { "alias": "elderElderDataViewItemDrag"; "required": true; "isSignal": true; }; "canDragItem": { "alias": "canDragItem"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkDrag; inputs: {}; outputs: {}; }]>;
|
|
38
|
+
}
|
package/lib/components/data-view/common/drag-and-drop/events/data-view-drag-entered-event.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDataContext } from '../../../../../common/data/data-context/data-context';
|
|
2
|
+
export declare class DataViewDragEnteredEvent<T> {
|
|
3
|
+
/** Data context into which the user has moved the item. */
|
|
4
|
+
readonly context: IDataContext<T>;
|
|
5
|
+
/** Item that was moved into the container. */
|
|
6
|
+
readonly item: T;
|
|
7
|
+
/** Index at which the item has entered the container. */
|
|
8
|
+
readonly currentIndex: number;
|
|
9
|
+
constructor(
|
|
10
|
+
/** Data context into which the user has moved the item. */
|
|
11
|
+
context: IDataContext<T>,
|
|
12
|
+
/** Item that was moved into the container. */
|
|
13
|
+
item: T,
|
|
14
|
+
/** Index at which the item has entered the container. */
|
|
15
|
+
currentIndex: number);
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDataContext } from '../../../../../common/data/data-context/data-context';
|
|
2
|
+
export declare class DataViewDragExitedEvent<T> {
|
|
3
|
+
/** Data context from which the user has a removed an item. */
|
|
4
|
+
readonly context: IDataContext<T>;
|
|
5
|
+
/** Item that was removed from the container. */
|
|
6
|
+
readonly item: T;
|
|
7
|
+
constructor(
|
|
8
|
+
/** Data context from which the user has a removed an item. */
|
|
9
|
+
context: IDataContext<T>,
|
|
10
|
+
/** Item that was removed from the container. */
|
|
11
|
+
item: T);
|
|
12
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IDataContext } from '../../../../../common/data/data-context/data-context';
|
|
2
|
+
export declare class DataViewItemDropEvent<T> {
|
|
3
|
+
/**
|
|
4
|
+
* fromStack The stack where the card originated from
|
|
5
|
+
*/
|
|
6
|
+
readonly fromContext: IDataContext<T>;
|
|
7
|
+
/**
|
|
8
|
+
* toStack The stack where the card is dropped to
|
|
9
|
+
*/
|
|
10
|
+
readonly toContext: IDataContext<T>;
|
|
11
|
+
/**
|
|
12
|
+
* card The row-item domain model
|
|
13
|
+
*/
|
|
14
|
+
readonly item: T;
|
|
15
|
+
/**
|
|
16
|
+
* fromIndex Index of the item when it was picked up fromContext.
|
|
17
|
+
*/
|
|
18
|
+
readonly fromIndex: number;
|
|
19
|
+
/**
|
|
20
|
+
* toIndex Current index of the item in toContext.
|
|
21
|
+
*/
|
|
22
|
+
readonly toIndex: number;
|
|
23
|
+
/**
|
|
24
|
+
* isPointerOverContainer Whether the user's pointer was over the container when the item was dropped.
|
|
25
|
+
*/
|
|
26
|
+
readonly isPointerOverContainer: boolean;
|
|
27
|
+
/***************************************************************************
|
|
28
|
+
* *
|
|
29
|
+
* Constructor *
|
|
30
|
+
* *
|
|
31
|
+
**************************************************************************/
|
|
32
|
+
constructor(
|
|
33
|
+
/**
|
|
34
|
+
* fromStack The stack where the card originated from
|
|
35
|
+
*/
|
|
36
|
+
fromContext: IDataContext<T>,
|
|
37
|
+
/**
|
|
38
|
+
* toStack The stack where the card is dropped to
|
|
39
|
+
*/
|
|
40
|
+
toContext: IDataContext<T>,
|
|
41
|
+
/**
|
|
42
|
+
* card The row-item domain model
|
|
43
|
+
*/
|
|
44
|
+
item: T,
|
|
45
|
+
/**
|
|
46
|
+
* fromIndex Index of the item when it was picked up fromContext.
|
|
47
|
+
*/
|
|
48
|
+
fromIndex: number,
|
|
49
|
+
/**
|
|
50
|
+
* toIndex Current index of the item in toContext.
|
|
51
|
+
*/
|
|
52
|
+
toIndex: number,
|
|
53
|
+
/**
|
|
54
|
+
* isPointerOverContainer Whether the user's pointer was over the container when the item was dropped.
|
|
55
|
+
*/
|
|
56
|
+
isPointerOverContainer: boolean);
|
|
57
|
+
/***************************************************************************
|
|
58
|
+
* *
|
|
59
|
+
* Public API *
|
|
60
|
+
* *
|
|
61
|
+
**************************************************************************/
|
|
62
|
+
/**
|
|
63
|
+
* Returns true if the drop happened across drop contexts.
|
|
64
|
+
*/
|
|
65
|
+
isCrossContextDrop(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Returns true if the drop happened at the exact same position as the drag started
|
|
68
|
+
*/
|
|
69
|
+
isSamePositionDrop(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Returns message string stating the drag. Useful for logging.
|
|
72
|
+
*/
|
|
73
|
+
getDragLogMessage(): string;
|
|
74
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { DataViewItemDropEvent } from '../events/data-view-item-drop-event';
|
|
3
|
+
import { ElderDataViewDndDirective } from '../elder-data-view-dnd.directive';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Controller service for a single DataViewDndGroup.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DataViewDndGroupControllerService<T> {
|
|
9
|
+
/***************************************************************************
|
|
10
|
+
* *
|
|
11
|
+
* Fields *
|
|
12
|
+
* *
|
|
13
|
+
**************************************************************************/
|
|
14
|
+
private readonly log;
|
|
15
|
+
private readonly _dropViews$;
|
|
16
|
+
/**
|
|
17
|
+
* Subject emitting each time an item is dropped on any drop view of this group.
|
|
18
|
+
*/
|
|
19
|
+
readonly itemDropped$: Subject<DataViewItemDropEvent<T>>;
|
|
20
|
+
/***************************************************************************
|
|
21
|
+
* *
|
|
22
|
+
* Constructor *
|
|
23
|
+
* *
|
|
24
|
+
**************************************************************************/
|
|
25
|
+
constructor();
|
|
26
|
+
/***************************************************************************
|
|
27
|
+
* *
|
|
28
|
+
* Public API *
|
|
29
|
+
* *
|
|
30
|
+
**************************************************************************/
|
|
31
|
+
setDropViews(dropViews: readonly ElderDataViewDndDirective<T>[]): void;
|
|
32
|
+
/***************************************************************************
|
|
33
|
+
* *
|
|
34
|
+
* Private Methods *
|
|
35
|
+
* *
|
|
36
|
+
**************************************************************************/
|
|
37
|
+
private getItemDropObservables;
|
|
38
|
+
private getItemDropObservable;
|
|
39
|
+
private handleItemDrop;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataViewDndGroupControllerService<any>, never>;
|
|
41
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DataViewDndGroupControllerService<any>>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OutputRef } from '@angular/core';
|
|
2
|
+
import { ElderDataViewDndDirective } from '../elder-data-view-dnd.directive';
|
|
3
|
+
import { DataViewItemDropEvent } from '../events/data-view-item-drop-event';
|
|
4
|
+
import { DataViewDndGroupControllerService } from './data-view-dnd-group-controller.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/cdk/drag-drop";
|
|
7
|
+
/**
|
|
8
|
+
* Directive to group multiple drop data view together.
|
|
9
|
+
* Placing this directive to any element will automatically connect
|
|
10
|
+
* all ElderDataViewDndDirective elements beneath it.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ElderDataViewDndGroupDirective<T> {
|
|
13
|
+
private readonly groupController;
|
|
14
|
+
/***************************************************************************
|
|
15
|
+
* *
|
|
16
|
+
* Fields *
|
|
17
|
+
* *
|
|
18
|
+
**************************************************************************/
|
|
19
|
+
private readonly log;
|
|
20
|
+
readonly dropViews: import("@angular/core").Signal<readonly ElderDataViewDndDirective<T>[]>;
|
|
21
|
+
readonly itemDropped: OutputRef<DataViewItemDropEvent<T>>;
|
|
22
|
+
/***************************************************************************
|
|
23
|
+
* *
|
|
24
|
+
* Constructor *
|
|
25
|
+
* *
|
|
26
|
+
**************************************************************************/
|
|
27
|
+
constructor(groupController: DataViewDndGroupControllerService<T>);
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderDataViewDndGroupDirective<any>, never>;
|
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderDataViewDndGroupDirective<any>, "[elderDataViewDndGroup]", never, {}, { "itemDropped": "itemDropped"; }, ["dropViews"], never, true, [{ directive: typeof i1.CdkDropListGroup; inputs: {}; outputs: {}; }]>;
|
|
30
|
+
}
|
package/lib/components/data-view/common/drag-and-drop/local-data/data-view-dnd-model-util.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DataViewItemDropEvent } from '../events/data-view-item-drop-event';
|
|
2
|
+
import { LocalListDataSource } from '../../../../../common/data/datasource/local/local-list-data-source';
|
|
3
|
+
import { IDataContext } from '../../../../../common/data/data-context/data-context';
|
|
4
|
+
/**
|
|
5
|
+
* Support util for updating data view models
|
|
6
|
+
* according to drop events.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DataViewDndModelUtil {
|
|
9
|
+
/***************************************************************************
|
|
10
|
+
* *
|
|
11
|
+
* Fields *
|
|
12
|
+
* *
|
|
13
|
+
**************************************************************************/
|
|
14
|
+
private static readonly log;
|
|
15
|
+
/***************************************************************************
|
|
16
|
+
* *
|
|
17
|
+
* Public API *
|
|
18
|
+
* *
|
|
19
|
+
**************************************************************************/
|
|
20
|
+
static updateModel<T>(itemDropEvent: DataViewItemDropEvent<T>): void;
|
|
21
|
+
private static supportsModelUpdate;
|
|
22
|
+
private static moveItemAcrossContexts;
|
|
23
|
+
private static moveItemWithinContext;
|
|
24
|
+
}
|
|
25
|
+
export declare class ViewDropModelUpdateInstruction<T> {
|
|
26
|
+
readonly item: T;
|
|
27
|
+
readonly fromContext: IDataContext<T>;
|
|
28
|
+
readonly toContext: IDataContext<T>;
|
|
29
|
+
readonly fromIndex: number;
|
|
30
|
+
readonly toIndex: number;
|
|
31
|
+
static of<T>(dropEvent: DataViewItemDropEvent<T>): ViewDropModelUpdateInstruction<T>;
|
|
32
|
+
constructor(item: T, fromContext: IDataContext<T>, toContext: IDataContext<T>, fromIndex: number, toIndex: number);
|
|
33
|
+
/***************************************************************************
|
|
34
|
+
* *
|
|
35
|
+
* Properties *
|
|
36
|
+
* *
|
|
37
|
+
**************************************************************************/
|
|
38
|
+
get fromDataSource(): LocalListDataSource<T>;
|
|
39
|
+
get toDataSource(): LocalListDataSource<T>;
|
|
40
|
+
}
|