@elderbyte/ngx-starter 19.8.0 → 19.9.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 +155 -66
- package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/data-view/grid/elder-grid/elder-grid.component.d.ts +12 -17
- package/lib/components/data-view/grid/elder-grid/layout/grid-row-layout-builder.d.ts +24 -0
- package/lib/components/data-view/grid/elder-grid/layout/grid-row.d.ts +5 -0
- package/lib/components/layout/public_api.d.ts +1 -0
- package/lib/components/layout/responsive/observer/resize-observer.directive.d.ts +41 -0
- package/lib/components/layout/responsive/public_api.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/components/data-view/grid/elder-grid/elder-grid.component.scss +2 -29
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { AfterViewInit, OnInit, Signal, TemplateRef, TrackByFunction, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
import { IDataContext, IDataContextContinuable } from '../../../../common/data/data-context/data-context';
|
|
4
4
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
5
5
|
import { SelectionModel } from '../../../../common/selection/selection-model';
|
|
6
6
|
import { ElderDataViewBaseComponent } from '../../base/elder-data-view-base';
|
|
7
7
|
import { MatPaginator } from '@angular/material/paginator';
|
|
8
8
|
import { ElderDataViewOptionsProvider } from '../../base/elder-data-view-options-provider';
|
|
9
|
-
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
10
9
|
import { CompositeSort } from '../../common/composite-sort/composite-sort';
|
|
11
10
|
import { ElderTileComponent } from '../elder-tile/elder-tile.component';
|
|
12
11
|
import { ElderContinuatorComponent } from '../../common/elder-continuator/elder-continuator.component';
|
|
12
|
+
import { GridRow } from './layout/grid-row';
|
|
13
|
+
import { ObservedElementDimension } from '../../../layout/responsive/observer/resize-observer.directive';
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
14
|
-
declare class GridRow<T> {
|
|
15
|
-
readonly id: string;
|
|
16
|
-
cells: T[];
|
|
17
|
-
constructor(id: string, cells: T[]);
|
|
18
|
-
}
|
|
19
15
|
export declare class ElderGridTileDirective {
|
|
20
16
|
templateRef: TemplateRef<any>;
|
|
21
17
|
viewContainer: ViewContainerRef;
|
|
@@ -34,7 +30,6 @@ export declare class ElderGridToolbarDirective {
|
|
|
34
30
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderGridToolbarDirective, "[elderGridToolbar]", never, {}, {}, never, never, true, never>;
|
|
35
31
|
}
|
|
36
32
|
export declare class ElderGridComponent<T = any> extends ElderDataViewBaseComponent<T> implements OnInit, AfterViewInit {
|
|
37
|
-
private breakpointObserver;
|
|
38
33
|
/***************************************************************************
|
|
39
34
|
* *
|
|
40
35
|
* Fields *
|
|
@@ -42,7 +37,6 @@ export declare class ElderGridComponent<T = any> extends ElderDataViewBaseCompon
|
|
|
42
37
|
**************************************************************************/
|
|
43
38
|
private readonly log;
|
|
44
39
|
private _staticColumnCount$;
|
|
45
|
-
private readonly sizeToColumns;
|
|
46
40
|
/**
|
|
47
41
|
* Load next chunk after current is done
|
|
48
42
|
*/
|
|
@@ -54,7 +48,10 @@ export declare class ElderGridComponent<T = any> extends ElderDataViewBaseCompon
|
|
|
54
48
|
private _tileTemplate;
|
|
55
49
|
readonly toolbarVisible: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
56
50
|
readonly footerVisible: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
51
|
+
protected readonly containerDimensions$: BehaviorSubject<ObservedElementDimension>;
|
|
57
52
|
readonly itemHeight: import("@angular/core").InputSignal<number>;
|
|
53
|
+
readonly itemWidth: import("@angular/core").InputSignal<number>;
|
|
54
|
+
private readonly itemWidth$;
|
|
58
55
|
readonly tileOutlined: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
59
56
|
readonly responsiveColumnCount: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
60
57
|
virtualScrollViewPort: CdkVirtualScrollViewport;
|
|
@@ -71,13 +68,13 @@ export declare class ElderGridComponent<T = any> extends ElderDataViewBaseCompon
|
|
|
71
68
|
private _toolbarTemplate;
|
|
72
69
|
readonly activeColumnCount$: Observable<number>;
|
|
73
70
|
readonly activeColumnCount: Signal<number>;
|
|
74
|
-
readonly
|
|
71
|
+
private readonly rowLayoutBuilder;
|
|
75
72
|
/***************************************************************************
|
|
76
73
|
* *
|
|
77
74
|
* Constructor *
|
|
78
75
|
* *
|
|
79
76
|
**************************************************************************/
|
|
80
|
-
constructor(selectionModel: SelectionModel<any>, dataViewOptionsProvider: ElderDataViewOptionsProvider
|
|
77
|
+
constructor(selectionModel: SelectionModel<any>, dataViewOptionsProvider: ElderDataViewOptionsProvider);
|
|
81
78
|
/***************************************************************************
|
|
82
79
|
* *
|
|
83
80
|
* Lifecycle *
|
|
@@ -106,18 +103,16 @@ export declare class ElderGridComponent<T = any> extends ElderDataViewBaseCompon
|
|
|
106
103
|
requestMoreDataZoned(event: unknown): void;
|
|
107
104
|
isTileVisible(tile: any): boolean;
|
|
108
105
|
hasItemFocus(item: T): boolean;
|
|
106
|
+
protected trackCellId(index: number, item: T): string;
|
|
109
107
|
/***************************************************************************
|
|
110
108
|
* *
|
|
111
109
|
* Private Methods *
|
|
112
110
|
* *
|
|
113
111
|
**************************************************************************/
|
|
114
112
|
private scrollTop;
|
|
115
|
-
private buildGridRow;
|
|
116
|
-
private rowId;
|
|
117
113
|
private responsiveColumn;
|
|
118
|
-
private
|
|
114
|
+
private calcColumnCount;
|
|
119
115
|
private getTileForItem;
|
|
120
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ElderGridComponent<any>, [{ optional: true; }, { optional: true; skipSelf: true; }
|
|
121
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ElderGridComponent<any>, "elder-grid", never, { "toolbarVisible": { "alias": "toolbarVisible"; "required": false; "isSignal": true; }; "footerVisible": { "alias": "footerVisible"; "required": false; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "tileOutlined": { "alias": "tileOutlined"; "required": false; "isSignal": true; }; "responsiveColumnCount": { "alias": "responsiveColumnCount"; "required": false; "isSignal": true; }; "availableSorts": { "alias": "availableSorts"; "required": false; }; "sortTranslationPrefix": { "alias": "sortTranslationPrefix"; "required": false; }; "hiddenField": { "alias": "hiddenField"; "required": false; }; "selectionVisible": { "alias": "selectionVisible"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "tileTemplate": { "alias": "tileTemplate"; "required": false; }; "toolbarTemplate": { "alias": "toolbarTemplate"; "required": false; }; "data": { "alias": "data"; "required": false; }; "columnCount": { "alias": "columnCount"; "required": false; }; }, {}, ["tileTemplateQuery", "toolbarTemplateQuery"], never, true, never>;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderGridComponent<any>, [{ optional: true; }, { optional: true; skipSelf: true; }]>;
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderGridComponent<any>, "elder-grid", never, { "toolbarVisible": { "alias": "toolbarVisible"; "required": false; "isSignal": true; }; "footerVisible": { "alias": "footerVisible"; "required": false; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "itemWidth": { "alias": "itemWidth"; "required": false; "isSignal": true; }; "tileOutlined": { "alias": "tileOutlined"; "required": false; "isSignal": true; }; "responsiveColumnCount": { "alias": "responsiveColumnCount"; "required": false; "isSignal": true; }; "availableSorts": { "alias": "availableSorts"; "required": false; }; "sortTranslationPrefix": { "alias": "sortTranslationPrefix"; "required": false; }; "hiddenField": { "alias": "hiddenField"; "required": false; }; "selectionVisible": { "alias": "selectionVisible"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "tileTemplate": { "alias": "tileTemplate"; "required": false; }; "toolbarTemplate": { "alias": "toolbarTemplate"; "required": false; }; "data": { "alias": "data"; "required": false; }; "columnCount": { "alias": "columnCount"; "required": false; }; }, {}, ["tileTemplateQuery", "toolbarTemplateQuery"], never, true, never>;
|
|
122
118
|
}
|
|
123
|
-
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GridRow } from './grid-row';
|
|
2
|
+
import { ElderDataViewBaseComponent } from '../../../base/elder-data-view-base';
|
|
3
|
+
export declare class GridRowLayoutBuilder<T> {
|
|
4
|
+
private readonly dataView;
|
|
5
|
+
/***************************************************************************
|
|
6
|
+
* *
|
|
7
|
+
* Constructor *
|
|
8
|
+
* *
|
|
9
|
+
**************************************************************************/
|
|
10
|
+
constructor(dataView: ElderDataViewBaseComponent<T>);
|
|
11
|
+
/***************************************************************************
|
|
12
|
+
* *
|
|
13
|
+
* Public API *
|
|
14
|
+
* *
|
|
15
|
+
**************************************************************************/
|
|
16
|
+
buildGridRows(items: T[], columnCount: number): GridRow<T>[];
|
|
17
|
+
/***************************************************************************
|
|
18
|
+
* *
|
|
19
|
+
* Private methods *
|
|
20
|
+
* *
|
|
21
|
+
**************************************************************************/
|
|
22
|
+
private rowId;
|
|
23
|
+
private getId;
|
|
24
|
+
}
|
|
@@ -6,3 +6,4 @@ export * from './pane/header/pane-subtitle.component';
|
|
|
6
6
|
export * from './pane/header/pane-actions.component';
|
|
7
7
|
export * from './basic-pane-layout/basic-pane-layout.component';
|
|
8
8
|
export * from './single-pane-wrapper/single-pane-wrapper.component';
|
|
9
|
+
export * from './responsive/public_api';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DestroyRef, ElementRef, Signal } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface ObservedElementDimension {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class ResizeObserverDirective {
|
|
9
|
+
private readonly host;
|
|
10
|
+
private readonly destroyRef;
|
|
11
|
+
/***************************************************************************
|
|
12
|
+
* *
|
|
13
|
+
* Fields *
|
|
14
|
+
* *
|
|
15
|
+
**************************************************************************/
|
|
16
|
+
private readonly resizeObserver;
|
|
17
|
+
private readonly _currentDimension$;
|
|
18
|
+
private readonly _currentDimensionChange;
|
|
19
|
+
private observing;
|
|
20
|
+
readonly enabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
21
|
+
readonly dimensionChange: Observable<ObservedElementDimension>;
|
|
22
|
+
readonly currentDimension$: Observable<ObservedElementDimension>;
|
|
23
|
+
readonly currentDimension: Signal<ObservedElementDimension>;
|
|
24
|
+
/***************************************************************************
|
|
25
|
+
* *
|
|
26
|
+
* Constructor *
|
|
27
|
+
* *
|
|
28
|
+
**************************************************************************/
|
|
29
|
+
constructor(host: ElementRef, destroyRef: DestroyRef);
|
|
30
|
+
/***************************************************************************
|
|
31
|
+
* *
|
|
32
|
+
* Private methods *
|
|
33
|
+
* *
|
|
34
|
+
**************************************************************************/
|
|
35
|
+
private observe;
|
|
36
|
+
private unobserve;
|
|
37
|
+
private onElementResize;
|
|
38
|
+
private toElementDimension;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeObserverDirective, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ResizeObserverDirective, "[elderResizeObserver]", never, { "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; }, { "dimensionChange": "dimensionChange"; "currentDimension$": "elderResizeObserver"; }, never, never, true, never>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './observer/resize-observer.directive';
|
package/package.json
CHANGED
|
@@ -12,41 +12,14 @@ $elder-tile-padding: 8px;
|
|
|
12
12
|
align-items: start;
|
|
13
13
|
justify-items: start;
|
|
14
14
|
overflow: hidden;
|
|
15
|
+
--elder-grid-column-count: 1;
|
|
15
16
|
|
|
16
17
|
padding: $elder-tile-padding ($elder-tile-padding * 2);
|
|
17
|
-
|
|
18
|
+
grid-template-columns: repeat(var(--elder-grid-column-count), minmax(0, 1fr));
|
|
18
19
|
&:first-child {
|
|
19
20
|
padding-top: ($elder-tile-padding * 2);
|
|
20
21
|
}
|
|
21
22
|
column-gap: ($elder-tile-padding * 2);
|
|
22
|
-
|
|
23
|
-
&.cols-1 {
|
|
24
|
-
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.cols-2 {
|
|
28
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.cols-3 {
|
|
32
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.cols-4 {
|
|
36
|
-
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.cols-5 {
|
|
40
|
-
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.cols-6 {
|
|
44
|
-
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.cols-7 {
|
|
48
|
-
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
49
|
-
}
|
|
50
23
|
}
|
|
51
24
|
|
|
52
25
|
.elder-grid-tile-hidden {
|