@myrmidon/paged-data-browsers 3.0.0 → 4.0.1
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/README.md +13 -0
- package/fesm2022/myrmidon-paged-data-browsers.mjs +178 -205
- package/fesm2022/myrmidon-paged-data-browsers.mjs.map +1 -1
- package/lib/components/browser-tree-node/browser-tree-node.component.d.ts +19 -16
- package/lib/components/compact-pager/compact-pager.component.d.ts +6 -5
- package/lib/components/range-view/range-view.component.d.ts +7 -9
- package/lib/services/paged-list.store.d.ts +1 -1
- package/lib/services/paged-tree.store.d.ts +13 -8
- package/package.json +2 -2
- package/public-api.d.ts +0 -1
- package/lib/paged-data-browsers.module.d.ts +0 -23
package/README.md
CHANGED
|
@@ -6,6 +6,19 @@ There are currently two components, one for displaying a flat list of data, and
|
|
|
6
6
|
|
|
7
7
|
Also, there is a LRU cache service and a compact pager used in the paged tree component.
|
|
8
8
|
|
|
9
|
+
## Paged List
|
|
10
|
+
|
|
11
|
+
Paged list support is provided by a single utility class, [PagedListStore](src/lib/services/paged-list.store.ts). This templated class provides logic for:
|
|
12
|
+
|
|
13
|
+
- a filter object of type `F`;
|
|
14
|
+
- a list element object of type `E`.
|
|
15
|
+
|
|
16
|
+
So you need:
|
|
17
|
+
|
|
18
|
+
- a filter class to represent your elements filter (for `F`).
|
|
19
|
+
- an element item class (for `E`).
|
|
20
|
+
- a service to fetch data, implementing interface [PagedListStoreService<F, E>](src/lib/services/paged-list.store.ts). In this shell, a [local service](../../../src/app/services/mock-paged-list-store.service.ts) provides mock data.
|
|
21
|
+
|
|
9
22
|
## Paged Tree
|
|
10
23
|
|
|
11
24
|
### Services
|
|
@@ -1,102 +1,99 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from '@angular/material/button';
|
|
4
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
-
import * as i2 from '@angular/material/icon';
|
|
6
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
2
|
+
import { input, output, Component, computed } from '@angular/core';
|
|
7
3
|
import * as i1$1 from '@angular/common';
|
|
8
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i1 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
9
|
import * as i2$1 from '@angular/material/badge';
|
|
10
10
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
11
11
|
import * as i5 from '@angular/material/tooltip';
|
|
12
12
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import
|
|
14
|
-
import { NgToolsModule } from '@myrmidon/ng-tools';
|
|
13
|
+
import { ColorToContrastPipe, StringToColorPipe } from '@myrmidon/ngx-tools';
|
|
15
14
|
import { BehaviorSubject, of, tap, forkJoin } from 'rxjs';
|
|
16
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
17
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
18
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
19
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
20
|
-
import { MatInputModule } from '@angular/material/input';
|
|
21
|
-
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
22
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
23
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
24
15
|
|
|
25
16
|
class CompactPagerComponent {
|
|
26
17
|
constructor() {
|
|
27
|
-
this.paging = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.pagingChange = new EventEmitter();
|
|
18
|
+
this.paging = input({ pageNumber: 0, pageCount: 0, total: 0 });
|
|
19
|
+
/**
|
|
20
|
+
* Emits the new paging information when the user changes the page.
|
|
21
|
+
*/
|
|
22
|
+
this.pagingChange = output();
|
|
33
23
|
}
|
|
34
24
|
onFirst() {
|
|
35
|
-
this.
|
|
36
|
-
this.pagingChange.emit(this.paging);
|
|
25
|
+
this.pagingChange.emit({ ...this.paging(), pageNumber: 1 });
|
|
37
26
|
}
|
|
38
27
|
onPrevious() {
|
|
39
|
-
if (this.paging.pageNumber > 1) {
|
|
40
|
-
this.
|
|
41
|
-
|
|
28
|
+
if (this.paging().pageNumber > 1) {
|
|
29
|
+
this.pagingChange.emit({
|
|
30
|
+
...this.paging(),
|
|
31
|
+
pageNumber: this.paging().pageNumber - 1,
|
|
32
|
+
});
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
onNext() {
|
|
45
|
-
if (this.paging.pageNumber < this.paging.pageCount) {
|
|
46
|
-
this.
|
|
47
|
-
|
|
36
|
+
if (this.paging().pageNumber < this.paging().pageCount) {
|
|
37
|
+
this.pagingChange.emit({
|
|
38
|
+
...this.paging(),
|
|
39
|
+
pageNumber: this.paging().pageNumber + 1,
|
|
40
|
+
});
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
onLast() {
|
|
51
|
-
if (this.paging.pageNumber < this.paging.pageCount) {
|
|
52
|
-
this.
|
|
53
|
-
|
|
44
|
+
if (this.paging().pageNumber < this.paging().pageCount) {
|
|
45
|
+
this.pagingChange.emit({
|
|
46
|
+
...this.paging(),
|
|
47
|
+
pageNumber: this.paging().pageCount,
|
|
48
|
+
});
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CompactPagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
57
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: CompactPagerComponent, isStandalone:
|
|
52
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: CompactPagerComponent, isStandalone: true, selector: "pdb-compact-pager", inputs: { paging: { classPropertyName: "paging", publicName: "paging", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pagingChange: "pagingChange" }, ngImport: i0, template: "@if (paging().pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging().total }} </span>\n </div>\n}\n", styles: ["#pages,#total{color:silver}.form-row{display:flex;gap:2px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
58
53
|
}
|
|
59
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CompactPagerComponent, decorators: [{
|
|
60
55
|
type: Component,
|
|
61
|
-
args: [{ selector: 'pdb-compact-pager',
|
|
62
|
-
}]
|
|
63
|
-
type: Input
|
|
64
|
-
}], pagingChange: [{
|
|
65
|
-
type: Output
|
|
66
|
-
}] } });
|
|
56
|
+
args: [{ selector: 'pdb-compact-pager', imports: [CommonModule, MatButtonModule, MatIconModule], template: "@if (paging().pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging().total }} </span>\n </div>\n}\n", styles: ["#pages,#total{color:silver}.form-row{display:flex;gap:2px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"] }]
|
|
57
|
+
}] });
|
|
67
58
|
|
|
68
59
|
class RangeViewComponent {
|
|
69
60
|
constructor() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The domain of the range view (start, limit).
|
|
63
|
+
*/
|
|
64
|
+
this.domain = input([0, 100]);
|
|
65
|
+
/**
|
|
66
|
+
* The range of the range view (start, limit).
|
|
67
|
+
*/
|
|
68
|
+
this.range = input([0, 100]);
|
|
69
|
+
/**
|
|
70
|
+
* The width of the component.
|
|
71
|
+
*/
|
|
72
|
+
this.width = input(100);
|
|
73
|
+
/**
|
|
74
|
+
* The height of the component.
|
|
75
|
+
*/
|
|
76
|
+
this.height = input(5);
|
|
77
|
+
this.scaledRange = computed(() => {
|
|
78
|
+
const domain = this.domain();
|
|
79
|
+
const range = this.range();
|
|
80
|
+
const width = this.width();
|
|
81
|
+
const domainWidth = domain[1] - domain[0];
|
|
82
|
+
const rangeWidth = range[1] - range[0];
|
|
83
|
+
const rangeStart = range[0] - domain[0];
|
|
84
|
+
return [
|
|
85
|
+
(rangeStart / domainWidth) * width,
|
|
86
|
+
((rangeStart + rangeWidth) / domainWidth) * width,
|
|
87
|
+
];
|
|
88
|
+
});
|
|
84
89
|
}
|
|
85
90
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: RangeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
86
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
91
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: RangeViewComponent, isStandalone: true, selector: "pdb-range-view", inputs: { domain: { classPropertyName: "domain", publicName: "domain", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange()[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\n [attr.height]=\"height()\"\n />\n</svg>\n", styles: ["#rdomain{fill:#d3d3d3;stroke-width:3;stroke:#c1ba9b}#rrange{fill:#91aad3;stroke-width:3}\n"] }); }
|
|
87
92
|
}
|
|
88
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: RangeViewComponent, decorators: [{
|
|
89
94
|
type: Component,
|
|
90
|
-
args: [{ selector: 'pdb-range-view',
|
|
91
|
-
}], ctorParameters: () => []
|
|
92
|
-
type: Input
|
|
93
|
-
}], range: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], width: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}], height: [{
|
|
98
|
-
type: Input
|
|
99
|
-
}] } });
|
|
95
|
+
args: [{ selector: 'pdb-range-view', template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange()[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\n [attr.height]=\"height()\"\n />\n</svg>\n", styles: ["#rdomain{fill:#d3d3d3;stroke-width:3;stroke:#c1ba9b}#rrange{fill:#91aad3;stroke-width:3}\n"] }]
|
|
96
|
+
}], ctorParameters: () => [] });
|
|
100
97
|
|
|
101
98
|
/**
|
|
102
99
|
* Browser tree node component view. This wraps some HTML content providing
|
|
@@ -108,32 +105,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
108
105
|
* <pdb-browser-tree-node>
|
|
109
106
|
*/
|
|
110
107
|
class BrowserTreeNodeComponent {
|
|
111
|
-
/**
|
|
112
|
-
* The node to display.
|
|
113
|
-
*/
|
|
114
|
-
get node() {
|
|
115
|
-
return this._node;
|
|
116
|
-
}
|
|
117
|
-
set node(value) {
|
|
118
|
-
if (this._node === value) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this._node = value;
|
|
122
|
-
}
|
|
123
108
|
constructor() {
|
|
109
|
+
/**
|
|
110
|
+
* The node to display.
|
|
111
|
+
*/
|
|
112
|
+
this.node = input();
|
|
113
|
+
/**
|
|
114
|
+
* The paging information for the node's children.
|
|
115
|
+
*/
|
|
116
|
+
this.paging = input();
|
|
117
|
+
/**
|
|
118
|
+
* True to show debug information.
|
|
119
|
+
*/
|
|
120
|
+
this.debug = input();
|
|
121
|
+
/**
|
|
122
|
+
* True to hide the node's loc and label. This is useful if you want to
|
|
123
|
+
* provide your own view for the node, between the expansion toggle and
|
|
124
|
+
* the filter edit button. In this case, in your consumer template provide
|
|
125
|
+
* your own view as the content of this component. If instead you are fine
|
|
126
|
+
* with the default loc and label, and just want to add more data to
|
|
127
|
+
* the view, then you can just add your own content to this component's
|
|
128
|
+
* template, without setting this property to true.
|
|
129
|
+
*/
|
|
130
|
+
this.hideLabel = input();
|
|
131
|
+
/**
|
|
132
|
+
* True to hide the node's location (y and x).
|
|
133
|
+
*/
|
|
134
|
+
this.hideLoc = input();
|
|
135
|
+
/**
|
|
136
|
+
* True to hide the node's paging control unless hovered.
|
|
137
|
+
*/
|
|
138
|
+
this.hidePaging = input();
|
|
139
|
+
/**
|
|
140
|
+
* True to hide the node's filter edit button.
|
|
141
|
+
*/
|
|
142
|
+
this.hideFilter = input();
|
|
124
143
|
/**
|
|
125
144
|
* The indent size for the node's children.
|
|
126
145
|
*/
|
|
127
|
-
this.indentSize = 30;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
146
|
+
this.indentSize = input(30);
|
|
147
|
+
/**
|
|
148
|
+
* The width of the range view.
|
|
149
|
+
*/
|
|
150
|
+
this.rangeWidth = input(250);
|
|
151
|
+
/**
|
|
152
|
+
* Emits when the user wants to toggle the expanded state of the node.
|
|
153
|
+
*/
|
|
154
|
+
this.toggleExpandedRequest = output();
|
|
155
|
+
/**
|
|
156
|
+
* Emits when the user wants to change the page number of the node's children.
|
|
157
|
+
*/
|
|
158
|
+
this.changePageRequest = output();
|
|
159
|
+
/**
|
|
160
|
+
* Emits when the user wants to edit the node's filter.
|
|
161
|
+
*/
|
|
162
|
+
this.editNodeFilterRequest = output();
|
|
131
163
|
}
|
|
132
164
|
onToggleExpanded() {
|
|
133
|
-
if (!this.
|
|
165
|
+
if (!this.node()) {
|
|
134
166
|
return;
|
|
135
167
|
}
|
|
136
|
-
this.toggleExpandedRequest.emit(this.
|
|
168
|
+
this.toggleExpandedRequest.emit(this.node());
|
|
137
169
|
}
|
|
138
170
|
onPagingChange(node, paging) {
|
|
139
171
|
this.changePageRequest.emit({
|
|
@@ -142,39 +174,33 @@ class BrowserTreeNodeComponent {
|
|
|
142
174
|
});
|
|
143
175
|
}
|
|
144
176
|
onEditFilter() {
|
|
145
|
-
if (this.
|
|
146
|
-
this.editNodeFilterRequest.emit(this.
|
|
177
|
+
if (this.node()) {
|
|
178
|
+
this.editNodeFilterRequest.emit(this.node());
|
|
147
179
|
}
|
|
148
180
|
}
|
|
149
181
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: BrowserTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
150
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: BrowserTreeNodeComponent, isStandalone:
|
|
182
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: BrowserTreeNodeComponent, isStandalone: true, selector: "pdb-browser-tree-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, paging: { classPropertyName: "paging", publicName: "paging", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, hideLoc: { classPropertyName: "hideLoc", publicName: "hideLoc", isSignal: true, isRequired: false, transformFunction: null }, hidePaging: { classPropertyName: "hidePaging", publicName: "hidePaging", isSignal: true, isRequired: false, transformFunction: null }, hideFilter: { classPropertyName: "hideFilter", publicName: "hideFilter", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, rangeWidth: { classPropertyName: "rangeWidth", publicName: "rangeWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleExpandedRequest: "toggleExpandedRequest", changePageRequest: "changePageRequest", editNodeFilterRequest: "editNodeFilterRequest" }, ngImport: i0, template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n", styles: [":root{--browser-tree-node-margin-bottom: 4px;--browser-tree-node-padding: 4px 6px;--browser-tree-node-border: 1px solid #98a8d4;--browser-tree-node-border-radius: 6px;--browser-tree-node-hover-bg-color: #d6dee9}#node{margin-bottom:var(--browser-tree-node-margin-bottom);padding:var(--browser-tree-node-padding);border:var(--browser-tree-node-border);border-radius:var(--browser-tree-node-border-radius)}#node:hover{background-color:var(--browser-tree-node-hover-bg-color)}.form-row{display:flex;gap:8px;align-items:center}.form-row *{flex:0 0 auto}.form-row span{flex:0 1 auto;white-space:normal}#node #pager{display:none}#node:hover #pager{display:block}span.loc{font-size:.85em;color:#666;vertical-align:middle}span.tag{border:1px solid #aaa;border-radius:4px;padding:0 4px}fieldset{border:1px solid silver;border-radius:6px;padding:4px 6px;margin:4px 0}legend{color:silver}.muted{opacity:.3}.muted:hover{opacity:1}.debug{font-size:.85em;color:#9c3d3e}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i2$1.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type:
|
|
183
|
+
// ngx-tools
|
|
184
|
+
ColorToContrastPipe, name: "colorToContrast" }, { kind: "pipe", type: StringToColorPipe, name: "stringToColor" }, { kind: "component", type:
|
|
185
|
+
// local
|
|
186
|
+
CompactPagerComponent, selector: "pdb-compact-pager", inputs: ["paging"], outputs: ["pagingChange"] }, { kind: "component", type: RangeViewComponent, selector: "pdb-range-view", inputs: ["domain", "range", "width", "height"] }] }); }
|
|
151
187
|
}
|
|
152
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: BrowserTreeNodeComponent, decorators: [{
|
|
153
189
|
type: Component,
|
|
154
|
-
args: [{ selector: 'pdb-browser-tree-node',
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
type: Input
|
|
169
|
-
}], indentSize: [{
|
|
170
|
-
type: Input
|
|
171
|
-
}], toggleExpandedRequest: [{
|
|
172
|
-
type: Output
|
|
173
|
-
}], changePageRequest: [{
|
|
174
|
-
type: Output
|
|
175
|
-
}], editNodeFilterRequest: [{
|
|
176
|
-
type: Output
|
|
177
|
-
}] } });
|
|
190
|
+
args: [{ selector: 'pdb-browser-tree-node', imports: [
|
|
191
|
+
CommonModule,
|
|
192
|
+
MatBadgeModule,
|
|
193
|
+
MatButtonModule,
|
|
194
|
+
MatIconModule,
|
|
195
|
+
MatTooltipModule,
|
|
196
|
+
// ngx-tools
|
|
197
|
+
ColorToContrastPipe,
|
|
198
|
+
StringToColorPipe,
|
|
199
|
+
// local
|
|
200
|
+
CompactPagerComponent,
|
|
201
|
+
RangeViewComponent,
|
|
202
|
+
], template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n", styles: [":root{--browser-tree-node-margin-bottom: 4px;--browser-tree-node-padding: 4px 6px;--browser-tree-node-border: 1px solid #98a8d4;--browser-tree-node-border-radius: 6px;--browser-tree-node-hover-bg-color: #d6dee9}#node{margin-bottom:var(--browser-tree-node-margin-bottom);padding:var(--browser-tree-node-padding);border:var(--browser-tree-node-border);border-radius:var(--browser-tree-node-border-radius)}#node:hover{background-color:var(--browser-tree-node-hover-bg-color)}.form-row{display:flex;gap:8px;align-items:center}.form-row *{flex:0 0 auto}.form-row span{flex:0 1 auto;white-space:normal}#node #pager{display:none}#node:hover #pager{display:block}span.loc{font-size:.85em;color:#666;vertical-align:middle}span.tag{border:1px solid #aaa;border-radius:4px;padding:0 4px}fieldset{border:1px solid silver;border-radius:6px;padding:4px 6px;margin:4px 0}legend{color:silver}.muted{opacity:.3}.muted:hover{opacity:1}.debug{font-size:.85em;color:#9c3d3e}\n"] }]
|
|
203
|
+
}] });
|
|
178
204
|
|
|
179
205
|
/**
|
|
180
206
|
* A Least Recently Used cache that can be used to store any type of object.
|
|
@@ -560,7 +586,7 @@ class PagedTreeStore {
|
|
|
560
586
|
if (this._customCacheKeyBuilder) {
|
|
561
587
|
return this._customCacheKeyBuilder(pageNumber, filter);
|
|
562
588
|
}
|
|
563
|
-
return JSON.stringify({
|
|
589
|
+
return JSON.stringify({ ...filter, pageNumber });
|
|
564
590
|
}
|
|
565
591
|
/**
|
|
566
592
|
* Get the specified page of nodes, either from cache or from the server.
|
|
@@ -677,9 +703,6 @@ class PagedTreeStore {
|
|
|
677
703
|
* @returns Promise with true if the node was expanded, false otherwise.
|
|
678
704
|
*/
|
|
679
705
|
expand(id) {
|
|
680
|
-
if (!id) {
|
|
681
|
-
return Promise.resolve(false);
|
|
682
|
-
}
|
|
683
706
|
return new Promise((resolve, reject) => {
|
|
684
707
|
const node = this._nodes$.value.find((n) => n.id === id);
|
|
685
708
|
if (!node || node.hasChildren === false || node.expanded) {
|
|
@@ -714,12 +737,22 @@ class PagedTreeStore {
|
|
|
714
737
|
/**
|
|
715
738
|
* Expand all the descendants of the node with the specified ID.
|
|
716
739
|
*
|
|
717
|
-
* @param id The ID of the node to expand
|
|
740
|
+
* @param id The ID of the node to expand, or undefined to expand the
|
|
741
|
+
* descendants of all the root level nodes.
|
|
718
742
|
* @returns Promise.
|
|
719
743
|
*/
|
|
720
744
|
expandAll(id) {
|
|
721
|
-
if (
|
|
722
|
-
|
|
745
|
+
if (id === undefined) {
|
|
746
|
+
// for each root level node call expandAll
|
|
747
|
+
const nodes = [...this._nodes$.value];
|
|
748
|
+
let i = 0;
|
|
749
|
+
while (i < nodes.length) {
|
|
750
|
+
if (nodes[i].parentId === undefined) {
|
|
751
|
+
this.expandAll(nodes[i].id);
|
|
752
|
+
}
|
|
753
|
+
i++;
|
|
754
|
+
}
|
|
755
|
+
return Promise.resolve(true);
|
|
723
756
|
}
|
|
724
757
|
// get the parent node to start from
|
|
725
758
|
const nodes = this._nodes$.value;
|
|
@@ -774,9 +807,6 @@ class PagedTreeStore {
|
|
|
774
807
|
* @returns Promise with true if the node was collapsed, false otherwise.
|
|
775
808
|
*/
|
|
776
809
|
collapse(id) {
|
|
777
|
-
if (!id) {
|
|
778
|
-
return Promise.resolve(false);
|
|
779
|
-
}
|
|
780
810
|
return new Promise((resolve, reject) => {
|
|
781
811
|
const node = this._nodes$.value.find((n) => n.id === id);
|
|
782
812
|
if (!node || node.hasChildren === false || !node.expanded) {
|
|
@@ -791,12 +821,39 @@ class PagedTreeStore {
|
|
|
791
821
|
else {
|
|
792
822
|
this._dirty = true;
|
|
793
823
|
this.removeDescendants(nodes, nodeIndex);
|
|
794
|
-
this._nodes$.next(nodes);
|
|
795
824
|
node.expanded = false;
|
|
825
|
+
// reset paging info
|
|
826
|
+
if (node?.paging) {
|
|
827
|
+
node.paging.pageNumber = 1;
|
|
828
|
+
}
|
|
829
|
+
this._nodes$.next(nodes);
|
|
796
830
|
resolve(true);
|
|
797
831
|
}
|
|
798
832
|
});
|
|
799
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Collapse all the descendants of the node with the specified ID.
|
|
836
|
+
*
|
|
837
|
+
* @param id The ID of the node to collapse, or undefined to collapse the
|
|
838
|
+
* descendants of all the root level nodes.
|
|
839
|
+
* @returns Promise.
|
|
840
|
+
*/
|
|
841
|
+
collapseAll(id) {
|
|
842
|
+
if (id === undefined) {
|
|
843
|
+
// for each expanded root level node
|
|
844
|
+
const nodes = [...this._nodes$.value.filter((n) => n.expanded)];
|
|
845
|
+
let i = 0;
|
|
846
|
+
while (i < nodes.length) {
|
|
847
|
+
if (nodes[i].parentId === undefined) {
|
|
848
|
+
this.collapseAll(nodes[i].id);
|
|
849
|
+
}
|
|
850
|
+
i++;
|
|
851
|
+
}
|
|
852
|
+
return Promise.resolve(true);
|
|
853
|
+
}
|
|
854
|
+
this.collapse(id);
|
|
855
|
+
return Promise.resolve(true);
|
|
856
|
+
}
|
|
800
857
|
/**
|
|
801
858
|
* Change the page including the node with the specified ID.
|
|
802
859
|
* @param parentId The ID of the parent node whose children are inside the page
|
|
@@ -850,17 +907,6 @@ class PagedTreeStore {
|
|
|
850
907
|
});
|
|
851
908
|
});
|
|
852
909
|
}
|
|
853
|
-
/**
|
|
854
|
-
* Collapse all the nodes in the store.
|
|
855
|
-
*/
|
|
856
|
-
collapseAll() {
|
|
857
|
-
if (this.isEmpty()) {
|
|
858
|
-
return;
|
|
859
|
-
}
|
|
860
|
-
// collapse the first node
|
|
861
|
-
const root = this._nodes$.value[0];
|
|
862
|
-
this.collapse(root.id);
|
|
863
|
-
}
|
|
864
910
|
/**
|
|
865
911
|
* Clear the store. The cache is cleared and the nodes are removed.
|
|
866
912
|
*/
|
|
@@ -887,79 +933,6 @@ class PagedTreeStore {
|
|
|
887
933
|
}
|
|
888
934
|
}
|
|
889
935
|
|
|
890
|
-
class PagedDataBrowsersModule {
|
|
891
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PagedDataBrowsersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
892
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: PagedDataBrowsersModule, declarations: [CompactPagerComponent,
|
|
893
|
-
RangeViewComponent,
|
|
894
|
-
BrowserTreeNodeComponent], imports: [CommonModule,
|
|
895
|
-
ReactiveFormsModule,
|
|
896
|
-
// material
|
|
897
|
-
MatBadgeModule,
|
|
898
|
-
MatButtonModule,
|
|
899
|
-
MatChipsModule,
|
|
900
|
-
MatDialogModule,
|
|
901
|
-
MatFormFieldModule,
|
|
902
|
-
MatIconModule,
|
|
903
|
-
MatInputModule,
|
|
904
|
-
MatPaginatorModule,
|
|
905
|
-
MatProgressBarModule,
|
|
906
|
-
MatSelectModule,
|
|
907
|
-
MatTooltipModule,
|
|
908
|
-
// myrmidon
|
|
909
|
-
NgToolsModule], exports: [CompactPagerComponent,
|
|
910
|
-
RangeViewComponent,
|
|
911
|
-
BrowserTreeNodeComponent] }); }
|
|
912
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PagedDataBrowsersModule, imports: [CommonModule,
|
|
913
|
-
ReactiveFormsModule,
|
|
914
|
-
// material
|
|
915
|
-
MatBadgeModule,
|
|
916
|
-
MatButtonModule,
|
|
917
|
-
MatChipsModule,
|
|
918
|
-
MatDialogModule,
|
|
919
|
-
MatFormFieldModule,
|
|
920
|
-
MatIconModule,
|
|
921
|
-
MatInputModule,
|
|
922
|
-
MatPaginatorModule,
|
|
923
|
-
MatProgressBarModule,
|
|
924
|
-
MatSelectModule,
|
|
925
|
-
MatTooltipModule,
|
|
926
|
-
// myrmidon
|
|
927
|
-
NgToolsModule] }); }
|
|
928
|
-
}
|
|
929
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PagedDataBrowsersModule, decorators: [{
|
|
930
|
-
type: NgModule,
|
|
931
|
-
args: [{
|
|
932
|
-
declarations: [
|
|
933
|
-
CompactPagerComponent,
|
|
934
|
-
RangeViewComponent,
|
|
935
|
-
BrowserTreeNodeComponent,
|
|
936
|
-
],
|
|
937
|
-
imports: [
|
|
938
|
-
CommonModule,
|
|
939
|
-
ReactiveFormsModule,
|
|
940
|
-
// material
|
|
941
|
-
MatBadgeModule,
|
|
942
|
-
MatButtonModule,
|
|
943
|
-
MatChipsModule,
|
|
944
|
-
MatDialogModule,
|
|
945
|
-
MatFormFieldModule,
|
|
946
|
-
MatIconModule,
|
|
947
|
-
MatInputModule,
|
|
948
|
-
MatPaginatorModule,
|
|
949
|
-
MatProgressBarModule,
|
|
950
|
-
MatSelectModule,
|
|
951
|
-
MatTooltipModule,
|
|
952
|
-
// myrmidon
|
|
953
|
-
NgToolsModule
|
|
954
|
-
],
|
|
955
|
-
exports: [
|
|
956
|
-
CompactPagerComponent,
|
|
957
|
-
RangeViewComponent,
|
|
958
|
-
BrowserTreeNodeComponent,
|
|
959
|
-
],
|
|
960
|
-
}]
|
|
961
|
-
}] });
|
|
962
|
-
|
|
963
936
|
/*
|
|
964
937
|
* Public API Surface of paged-data-browsers
|
|
965
938
|
*/
|
|
@@ -968,5 +941,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
968
941
|
* Generated bundle index. Do not edit.
|
|
969
942
|
*/
|
|
970
943
|
|
|
971
|
-
export { BrowserTreeNodeComponent, CompactPagerComponent, DEFAULT_PAGED_LIST_STORE_OPTIONS, LRUCache,
|
|
944
|
+
export { BrowserTreeNodeComponent, CompactPagerComponent, DEFAULT_PAGED_LIST_STORE_OPTIONS, LRUCache, PagedListStore, PagedTreeStore, RangeViewComponent };
|
|
972
945
|
//# sourceMappingURL=myrmidon-paged-data-browsers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"myrmidon-paged-data-browsers.mjs","sources":["../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/lru-cache.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-list.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-tree.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/paged-data-browsers.module.ts","../../../../projects/myrmidon/paged-data-browsers/src/public-api.ts","../../../../projects/myrmidon/paged-data-browsers/src/myrmidon-paged-data-browsers.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { PagingInfo } from '../../services/paged-tree.store';\n\n@Component({\n selector: 'pdb-compact-pager',\n templateUrl: './compact-pager.component.html',\n styleUrls: ['./compact-pager.component.scss'],\n standalone: false\n})\nexport class CompactPagerComponent {\n @Input()\n public paging: PagingInfo;\n\n @Output()\n public pagingChange: EventEmitter<PagingInfo>;\n\n constructor() {\n this.paging = {\n pageNumber: 0,\n pageCount: 0,\n total: 0,\n };\n this.pagingChange = new EventEmitter<PagingInfo>();\n }\n\n public onFirst(): void {\n this.paging = { ...this.paging, pageNumber: 1 };\n this.pagingChange.emit(this.paging);\n }\n\n public onPrevious(): void {\n if (this.paging.pageNumber > 1) {\n this.paging = { ...this.paging, pageNumber: this.paging.pageNumber - 1 };\n this.pagingChange.emit(this.paging);\n }\n }\n\n public onNext(): void {\n if (this.paging.pageNumber < this.paging.pageCount) {\n this.paging = { ...this.paging, pageNumber: this.paging.pageNumber + 1 };\n this.pagingChange.emit(this.paging);\n }\n }\n\n public onLast(): void {\n if (this.paging.pageNumber < this.paging.pageCount) {\n this.paging = { ...this.paging, pageNumber: this.paging.pageCount };\n this.pagingChange.emit(this.paging);\n }\n }\n}\n","@if (paging.pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging.pageNumber }}/{{ paging.pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging.pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging.pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging.pageNumber === paging.pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging.pageNumber === paging.pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging.total }} </span>\n </div>\n}\n","import { Component, Input, OnChanges } from '@angular/core';\n\n@Component({\n selector: 'pdb-range-view',\n templateUrl: './range-view.component.html',\n styleUrls: ['./range-view.component.scss'],\n standalone: false\n})\nexport class RangeViewComponent implements OnChanges {\n /**\n * The domain of the range view (start, limit).\n */\n @Input() public domain: Array<number>;\n /**\n * The range of the range view (start, limit).\n */\n @Input() public range: Array<number>;\n /**\n * The width of the component.\n */\n @Input() public width: number;\n /**\n * The height of the component.\n */\n @Input() public height: number;\n\n public scaledRange: Array<number>;\n\n constructor() {\n this.domain = [0, 100];\n this.range = [0, 100];\n this.width = 100;\n this.height = 5;\n this.scaledRange = [];\n }\n\n ngOnChanges() {\n const domainWidth = this.domain[1] - this.domain[0];\n const rangeWidth = this.range[1] - this.range[0];\n const rangeStart = this.range[0] - this.domain[0];\n\n this.scaledRange = [\n (rangeStart / domainWidth) * this.width,\n ((rangeStart + rangeWidth) / domainWidth) * this.width,\n ];\n }\n}\n","<svg [attr.width]=\"width\" [attr.height]=\"height\">\n <rect id=\"rdomain\" [attr.width]=\"width\" [attr.height]=\"height\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange[1] - scaledRange[0]\"\n [attr.height]=\"height\"\n />\n</svg>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';\n\n/**\n * A request to change the page number of a node's children.\n */\nexport interface PageChangeRequest {\n node: PagedTreeNode<any>;\n paging: PagingInfo;\n}\n\n/**\n * Browser tree node component view. This wraps some HTML content providing\n * a toggle button to expand/collapse the node, a paging control for the\n * node's children, and a button to edit the node's filter. You should then\n * provide the HTML content to display the node's data inside this component, e.g.\n * <pdb-browser-tree-node [node]=\"node\">\n * <your-node-view [node]=\"node\" />\n * <pdb-browser-tree-node>\n */\n@Component({\n selector: 'pdb-browser-tree-node',\n templateUrl: './browser-tree-node.component.html',\n styleUrls: ['./browser-tree-node.component.css'],\n standalone: false\n})\nexport class BrowserTreeNodeComponent {\n private _node: PagedTreeNode<any> | undefined | null;\n\n /**\n * The node to display.\n */\n @Input()\n public get node(): PagedTreeNode<any> | undefined | null {\n return this._node;\n }\n\n public set node(value: PagedTreeNode<any> | undefined | null) {\n if (this._node === value) {\n return;\n }\n this._node = value;\n }\n\n /**\n * The paging information for the node's children.\n */\n @Input()\n paging?: PagingInfo;\n\n /**\n * True to show debug information.\n */\n @Input()\n public debug?: boolean;\n\n /**\n * True to hide the node's loc and label. This is useful if you want to\n * provide your own view for the node, between the expansion toggle and\n * the filter edit button. In this case, in your consumer template provide\n * your own view as the content of this component. If instead you are fine\n * with the default loc and label, and just want to add more data to\n * the view, then you can just add your own content to this component's\n * template, without setting this property to true.\n */\n @Input()\n public hideLabel?: boolean;\n\n /**\n * True to hide the node's location (y and x).\n */\n @Input()\n public hideLoc?: boolean;\n\n /**\n * True to hide the node's paging control unless hovered.\n */\n @Input()\n public hidePaging?: boolean;\n\n /**\n * True to hide the node's filter edit button.\n */\n @Input()\n public hideFilter?: boolean;\n\n /**\n * The indent size for the node's children.\n */\n @Input()\n public indentSize = 30;\n\n /**\n * Emits when the user wants to toggle the expanded state of the node.\n */\n @Output()\n public toggleExpandedRequest: EventEmitter<PagedTreeNode<any>>;\n\n /**\n * Emits when the user wants to change the page number of the node's children.\n */\n @Output()\n public changePageRequest: EventEmitter<PageChangeRequest>;\n\n @Output()\n public editNodeFilterRequest: EventEmitter<PagedTreeNode<any>>;\n\n constructor() {\n this.toggleExpandedRequest = new EventEmitter<PagedTreeNode<any>>();\n this.changePageRequest = new EventEmitter<PageChangeRequest>();\n this.editNodeFilterRequest = new EventEmitter<PagedTreeNode<any>>();\n }\n\n public onToggleExpanded(): void {\n if (!this._node) {\n return;\n }\n this.toggleExpandedRequest.emit(this._node as PagedTreeNode<any>);\n }\n\n public onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void {\n this.changePageRequest.emit({\n node,\n paging,\n });\n }\n\n public onEditFilter(): void {\n if (this._node) {\n this.editNodeFilterRequest.emit(this._node);\n }\n }\n}\n","@if (node) {\n<div id=\"node\" [style.margin-left.px]=\"(node.y - 1) * indentSize\">\n <!-- pager -->\n @if ($any(node).expanded && paging && paging.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging\"\n (pagingChange)=\"onPagingChange($any(node), $event)\"\n />\n <pdb-range-view\n [width]=\"250\"\n [domain]=\"[0, paging.pageCount]\"\n [range]=\"[paging.pageNumber - 1, paging.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"$any(node).expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node.hasChildren === true || node.hasChildren === undefined\n ? $any(node).expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node.tag | stringToColor),\n color: node.tag | stringToColor | colorToContrast\n }\"\n >{{ node.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc) {\n <span class=\"loc\">{{ node.y }}.{{ node.x }}</span> - }\n {{ node.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug) {\n <span class=\"debug\"\n >#{{ node.id }}\n <span\n >| {{ $any(node).paging.pageNumber }}/{{\n $any(node).paging.pageCount\n }}\n ({{ $any(node).paging.total }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter){ @if (!$any(node).filter && node.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if ($any(node).filter && node.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"$any(node).filter ? 'F' : ''\"\n >filter_alt</mat-icon\n >\n </button>\n </div>\n } }\n </div>\n</div>\n}\n","/**\r\n * A Least Recently Used cache that can be used to store any type of object.\r\n * The cache works in two modes: considering the size of the objects or not.\r\n * If the size is considered, the cache will have a maximum size and will\r\n * remove the oldest objects when the maximum size is reached. Note that\r\n * the size is only roughly estimated. This avoids removing too many\r\n * entries from the cache when the maximum is reached.\r\n * If the size is not considered, the cache will have a maximum number of\r\n * objects and will remove the oldest objects when the maximum number is\r\n * reached.\r\n */\r\nexport class LRUCache<T> {\r\n private _maxSize: number;\r\n private _totalSize: number;\r\n private _considerSize: boolean;\r\n private _cache: Map<string, T>;\r\n private _sizes: Map<string, number>;\r\n\r\n /**\r\n * Creates a new cache.\r\n * @param maxSize The maximum size of the cache. This is either\r\n * the maximum number of items in the cache (when considerSize\r\n * is false) or the maximum total size of all items in the\r\n * cache in bytes (when considerSize is true).\r\n * @param considerSize True if the size of the objects should be\r\n * considered.\r\n */\r\n constructor(maxSize: number, considerSize: boolean = false) {\r\n this._maxSize = maxSize;\r\n this._totalSize = 0;\r\n this._considerSize = considerSize;\r\n this._cache = new Map<string, T>();\r\n this._sizes = new Map<string, number>();\r\n }\r\n\r\n /**\r\n * Get an item from the cache.\r\n * @param key The key of the item to get.\r\n * @returns The item or undefined if the item is not in the cache.\r\n */\r\n public get(key: string): T | undefined {\r\n let item: T | undefined = this._cache.get(key);\r\n if (item) {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n }\r\n return item;\r\n }\r\n\r\n /**\r\n * Check if an item is in the cache.\r\n * @param key The key of the item to check.\r\n * @returns True if the item is in cache.\r\n */\r\n public has(key: string): boolean {\r\n return this._cache.has(key);\r\n }\r\n\r\n /**\r\n * Put an item in the cache.\r\n * @param key The key of the item to put.\r\n * @param item The item to put.\r\n * @param size The estimated size of the item in bytes.\r\n * This must be calculated by the caller but only when\r\n * considerSize is true.\r\n */\r\n public put(key: string, item: T, size: number): void {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n this._sizes.set(key, size);\r\n if (this._considerSize) {\r\n this._totalSize += size;\r\n while (this._totalSize > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n let oldestSize = this._sizes.get(oldestKey);\r\n if (oldestSize) {\r\n this._totalSize -= oldestSize;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n } else {\r\n while (this._cache.size > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._sizes.clear();\r\n this._totalSize = 0;\r\n }\r\n\r\n /**\r\n * Estimate the size of an object in bytes.\r\n * @param obj The object to calculate the size of.\r\n * @returns The estimated size of the object in bytes.\r\n */\r\n public static calculateObjectSize(obj: any): number {\r\n if (!obj) {\r\n return 0;\r\n }\r\n let totalSize = 0;\r\n let keys = Object.keys(obj);\r\n for (let key of keys) {\r\n let value = obj[key];\r\n if (typeof value === 'string') {\r\n totalSize += value.length * 2;\r\n } else if (typeof value === 'number') {\r\n totalSize += 8;\r\n } else if (typeof value === 'boolean') {\r\n totalSize += 4;\r\n } else if (typeof value === 'object' && value !== null) {\r\n totalSize += this.calculateObjectSize(value);\r\n }\r\n }\r\n return totalSize;\r\n }\r\n}\r\n","import { BehaviorSubject, Observable } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ng-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\n\r\n/**\r\n * Options for the paged list store.\r\n */\r\nexport interface PagedListStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n}\r\n\r\n/**\r\n * Default options for the paged list store.\r\n */\r\nexport const DEFAULT_PAGED_LIST_STORE_OPTIONS: PagedListStoreOptions = {\r\n pageSize: 20,\r\n cacheSize: 50,\r\n};\r\n\r\n/**\r\n * The interface to be implemented by the service used by PagedListStore.\r\n */\r\nexport interface PagedListStoreService<F, E> {\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The size of the page to load.\r\n * @param filter The filter to apply.\r\n */\r\n loadPage(\r\n pageNumber: number,\r\n pageSize: number,\r\n filter: F\r\n ): Observable<DataPage<E>>;\r\n}\r\n\r\n/**\r\n * A generic paged list store using a filter object of type F\r\n * and a list of elements of type E.\r\n */\r\nexport class PagedListStore<F, E> {\r\n private _pageSize: number;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private _page$: BehaviorSubject<DataPage<E>>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _cache: LRUCache<DataPage<E>>;\r\n\r\n /**\r\n * The page. It is updated when the page is changed or the filter is changed.\r\n */\r\n public page$: Observable<Readonly<DataPage<E>>>;\r\n\r\n /**\r\n * The filter. It is updated when the filter is changed.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create a new paged list store.\r\n * @param options Options for the paged list store.\r\n */\r\n constructor(\r\n private _service: PagedListStoreService<F, E>,\r\n options: PagedListStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<E>>(options.cacheSize);\r\n // page\r\n this._page$ = new BehaviorSubject<DataPage<E>>({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n this.page$ = this._page$.asObservable();\r\n // filter\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n }\r\n\r\n /**\r\n * Returns true if the store is empty, false otherwise.\r\n * @returns true if the store is empty, false otherwise.\r\n */\r\n public isEmpty(): boolean {\r\n return this._page$.value.items.length === 0;\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ pageNumber, ...filter });\r\n }\r\n\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber the page number to load.\r\n */\r\n private loadPage(pageNumber: number): Observable<DataPage<E>> {\r\n return this._service.loadPage(\r\n pageNumber,\r\n this._pageSize,\r\n this._filter$.value\r\n );\r\n }\r\n\r\n /**\r\n * Set the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The page size.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setPage(pageNumber: number, pageSize?: number): Promise<void> {\r\n if (pageSize && pageSize !== this._pageSize) {\r\n this._pageSize = pageSize;\r\n }\r\n return new Promise((resolve, reject) => {\r\n // if page is in cache, return it\r\n const key = this.buildCacheKey(pageNumber, this._filter$.value);\r\n const cachedPage = this._cache.get(key);\r\n if (cachedPage) {\r\n this._page$.next(cachedPage);\r\n resolve();\r\n return;\r\n }\r\n\r\n // else load page\r\n this.loadPage(pageNumber).subscribe({\r\n next: (page) => {\r\n this._page$.next(page);\r\n this._cache.put(key, page, 0);\r\n resolve();\r\n },\r\n error: reject,\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Get the current page.\r\n * @returns The current page.\r\n */\r\n public getPage(): DataPage<E> {\r\n return this._page$.value;\r\n }\r\n\r\n /**\r\n * Apply the given filter and load the first page.\r\n * @param filter The filter to apply.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setFilter(filter: F): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this._filter$.next(filter);\r\n this.setPage(1).then(resolve, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Get the current filter.\r\n * @returns The current filter.\r\n */\r\n public getFilter(): F {\r\n return this._filter$.value;\r\n }\r\n\r\n /**\r\n * Reset the filter and load the first page. The cache is cleared.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public reset(): Promise<void> {\r\n this._cache.clear();\r\n return this.setFilter({} as F);\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the page is emptied.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._page$.next({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","import { BehaviorSubject, Observable, forkJoin, of, tap } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ng-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\nimport { DEFAULT_PAGED_LIST_STORE_OPTIONS } from './paged-list.store';\r\n\r\n/**\r\n * A tree node. Your data service should return a list of these nodes\r\n * or of any type extending this interface.\r\n */\r\nexport interface TreeNode {\r\n id: number;\r\n parentId?: number;\r\n y: number;\r\n x: number;\r\n label: string;\r\n tag?: string;\r\n hasChildren?: boolean;\r\n}\r\n\r\n/**\r\n * A filter for tree nodes.\r\n */\r\nexport interface TreeNodeFilter {\r\n tags?: string[];\r\n parentId?: number;\r\n}\r\n\r\n/**\r\n * Paging information for a paged tree node.\r\n */\r\nexport interface PagingInfo {\r\n pageNumber: number;\r\n pageCount: number;\r\n total: number;\r\n}\r\n\r\n/**\r\n * A tree node with paging information, used in NodeBrowserStore.\r\n */\r\nexport interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {\r\n paging: PagingInfo;\r\n expanded?: boolean;\r\n filter?: F;\r\n}\r\n\r\n/**\r\n * The interface to be implemented by the service used by NodeBrowserStore\r\n * to load nodes.\r\n */\r\nexport interface PagedTreeStoreService<F extends TreeNodeFilter> {\r\n /**\r\n * Get the specified page of nodes.\r\n * @param filter The filter.\r\n * @param pageNumber The page number.\r\n * @param pageSize The page size.\r\n * @param hasMockRoot If true, the root node is a mock node provided by your\r\n * service, which implies that its Y value is 0 rather than 1. Default is\r\n * false, meaning that your service will return a single root node with Y\r\n * value 1.\r\n */\r\n getNodes(\r\n filter: F,\r\n pageNumber: number,\r\n pageSize: number,\r\n hasMockRoot?: boolean\r\n ): Observable<DataPage<TreeNode>>;\r\n}\r\n\r\n/**\r\n * Options for the NodeBrowserStore.\r\n */\r\nexport interface PagedTreeStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n /**\r\n * If true, the root node is a mock node provided by your service, which\r\n * implies that its Y value is 0 rather than 1. Default is false, meaning\r\n * that your service will return a single root node with Y value 1.\r\n */\r\n hasMockRoot?: boolean;\r\n}\r\n\r\n/**\r\n * A store for the node browser component. This store is used to keep a\r\n * list of nodes, and to load them from the API. It also keeps the root\r\n * node. Every tree node in the list is extended with page number,\r\n * page count and total items, plus expansion-related metadata.\r\n * The store keeps a flat list of these tree nodes, allowing users to\r\n * expand and collapse them.\r\n * F is the type of the filter object, E is the type of the paged tree nodes.\r\n */\r\nexport class PagedTreeStore<\r\n E extends PagedTreeNode<F>,\r\n F extends TreeNodeFilter\r\n> {\r\n private _nodes$: BehaviorSubject<E[]>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private readonly _cache: LRUCache<DataPage<TreeNode>>;\r\n private readonly _hasMockRoot: boolean;\r\n\r\n private _pageSize: number;\r\n // dirty state: this is reset when the store is reset, and set to true\r\n // when the store is changed\r\n private _dirty?: boolean;\r\n\r\n /**\r\n * The flat list of paged nodes in this store.\r\n */\r\n public nodes$: Observable<Readonly<E[]>>;\r\n\r\n /**\r\n * The global filter for all the nodes.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create an instance of the store.\r\n * @param _service The service used to load nodes.\r\n * @param options The options to configure this store.\r\n */\r\n constructor(\r\n private _service: PagedTreeStoreService<F>,\r\n options: PagedTreeStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<TreeNode>>(options.cacheSize);\r\n this._customCacheKeyBuilder = options.buildCacheKey;\r\n this._nodes$ = new BehaviorSubject<E[]>([]);\r\n this.nodes$ = this._nodes$.asObservable();\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n this._dirty = true;\r\n this._hasMockRoot = options.hasMockRoot || false;\r\n }\r\n\r\n /**\r\n * Gets the global filter, eventually overridden with values\r\n * from the specified node's filter.\r\n * @param node The optional node.\r\n * @returns The filter.\r\n */\r\n private getFilter(node?: PagedTreeNode<F>): F {\r\n return node?.filter\r\n ? {\r\n ...this._filter$.value,\r\n ...node.filter,\r\n }\r\n : this._filter$.value;\r\n }\r\n\r\n /**\r\n * Checks if this store is empty.\r\n * @returns True if this store is empty.\r\n */\r\n public isEmpty(): boolean {\r\n return this._nodes$.value.length === 0;\r\n }\r\n\r\n /**\r\n * Gets all the nodes in the store.\r\n * @returns The nodes.\r\n */\r\n public getNodes(): Readonly<PagedTreeNode<F>[]> {\r\n return this._nodes$.value;\r\n }\r\n\r\n /**\r\n * Get the root node of the tree.\r\n * @returns The root node of the tree or undefined if empty.\r\n */\r\n public getRootNode(): PagedTreeNode<F> | undefined {\r\n return this._nodes$.value[0];\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ pageNumber, ...filter });\r\n }\r\n\r\n /**\r\n * Get the specified page of nodes, either from cache or from the server.\r\n * When the page is retrieved from the server, it is stored in cache.\r\n * @param filter The filter to apply.\r\n * @param pageNumber The page number to get.\r\n * @returns Observable of the page of nodes.\r\n */\r\n private getPageFromCacheOrServer(\r\n filter: F,\r\n pageNumber: number\r\n ): Observable<DataPage<TreeNode>> {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n const pageInCache = this._cache.get(key);\r\n\r\n if (pageInCache) {\r\n return of(pageInCache);\r\n } else {\r\n return this._service\r\n .getNodes(filter, pageNumber, this._pageSize, this._hasMockRoot)\r\n .pipe(\r\n tap((page) => {\r\n this._cache.put(key, page, 0);\r\n })\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create paged tree nodes from a page of tree nodes, by providing further\r\n * metadata like page number, page count and total items.\r\n * @param page The page to create nodes from.\r\n * @returns Paged nodes.\r\n */\r\n private createPageNodes(page: DataPage<TreeNode>): E[] {\r\n return page.items.map((n) => {\r\n return {\r\n ...n,\r\n hasChildren: n.hasChildren,\r\n paging: {\r\n pageNumber: page.pageNumber,\r\n pageCount: page.pageCount,\r\n total: page.total,\r\n },\r\n } as E;\r\n });\r\n }\r\n\r\n /**\r\n * Sets the filter for this store. Whenever the filter is set,\r\n * the store is reset.\r\n * @param filter The filter.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public setFilter(filter: F): Promise<boolean> {\r\n if (this._filter$.value === filter) {\r\n return Promise.resolve(false);\r\n }\r\n this._filter$.next(filter);\r\n this._dirty = true;\r\n return this.reset();\r\n }\r\n\r\n /**\r\n * Reset the store, loading the root nodes and their children.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public reset(): Promise<boolean> {\r\n if (!this._dirty) {\r\n return Promise.resolve(false);\r\n }\r\n this._cache.clear();\r\n const filter = this._filter$.value;\r\n\r\n return new Promise<boolean>((resolve, reject) => {\r\n this._service\r\n .getNodes(\r\n {\r\n ...filter,\r\n parentId: undefined,\r\n },\r\n 1,\r\n this._pageSize,\r\n this._hasMockRoot\r\n )\r\n .subscribe({\r\n next: (page: DataPage<TreeNode>) => {\r\n this._nodes$.next(this.createPageNodes(page));\r\n\r\n // get the children of each node thus calculating their hasChildren property\r\n const childrenObservables = this._nodes$.value.map((node) =>\r\n this.getPageFromCacheOrServer({ ...filter, parentId: node.id }, 1)\r\n );\r\n forkJoin(childrenObservables).subscribe((childrenPages) => {\r\n childrenPages.forEach((page, i) => {\r\n this._nodes$.value[i].hasChildren = page.total > 0;\r\n });\r\n });\r\n\r\n this._dirty = false;\r\n resolve(true);\r\n },\r\n error: (error) => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Set the node filter for the node with the specified ID.\r\n * @param id The node ID.\r\n * @param filter The filter to set.\r\n * @returns Promise with true if filter was set, false otherwise.\r\n */\r\n public setNodeFilter(id: number, filter?: F | null): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node) {\r\n reject(`Node ID ${id} not found in store`);\r\n }\r\n node!.filter = filter || undefined;\r\n return this.changePage(id, 1);\r\n });\r\n }\r\n\r\n /**\r\n * Expand the node with the specified ID. If the node is not expandable,\r\n * or it is already expanded, this method does nothing.\r\n * @param node The ID of the node to expand.\r\n * @returns Promise with true if the node was expanded, false otherwise.\r\n */\r\n public expand(id: number): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(node), parentId: id },\r\n 1\r\n ).subscribe((page) => {\r\n // no children, set hasChildren to false\r\n if (!page.total) {\r\n node!.hasChildren = false;\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // insert page nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node!);\r\n if (index === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n const pageNodes = this.createPageNodes(page);\r\n nodes.splice(index + 1, 0, ...(pageNodes as E[]));\r\n this._nodes$.next(nodes);\r\n node!.hasChildren = true;\r\n node!.expanded = true;\r\n resolve(true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Expand all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to expand.\r\n * @returns Promise.\r\n */\r\n public expandAll(id: number): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n // get the parent node to start from\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.findIndex((n) => n.id === id);\r\n if (nodeIndex === -1) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n // collect all the descendant nodes IDs\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n const nodesToExpand = nodes.slice(nodeIndex, i).map((n) => n.id);\r\n\r\n // expand all the descendant nodes\r\n return new Promise<boolean>((resolve, reject) => {\r\n nodesToExpand.forEach((id) => {\r\n this.expand(id);\r\n this.expandAll(id);\r\n });\r\n resolve(true);\r\n });\r\n }\r\n\r\n public getChildren(id: number): E[] {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false) {\r\n return [];\r\n }\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node);\r\n if (index === -1) {\r\n return [];\r\n }\r\n const children: E[] = [];\r\n let i = index + 1;\r\n while (i < nodes.length && nodes[i].y > node.y) {\r\n children.push(nodes[i]);\r\n i++;\r\n }\r\n return children;\r\n }\r\n\r\n private removeDescendants(\r\n nodes: PagedTreeNode<F>[],\r\n nodeIndex: number\r\n ): void {\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n nodes.splice(nodeIndex + 1, i - nodeIndex - 1);\r\n }\r\n\r\n /**\r\n * Collapse the node with the specified ID. If the node is not expandable,\r\n * or it is already collapsed, this method does nothing.\r\n * @param node The node to collapse.\r\n * @returns Promise with true if the node was collapsed, false otherwise.\r\n */\r\n public collapse(id: number): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || !node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n // remove all the descendant nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(node!);\r\n if (nodeIndex === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n this._dirty = true;\r\n this.removeDescendants(nodes, nodeIndex);\r\n this._nodes$.next(nodes);\r\n node!.expanded = false;\r\n resolve(true);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Change the page including the node with the specified ID.\r\n * @param parentId The ID of the parent node whose children are inside the page\r\n * you want to change.\r\n * @param pageNumber The new page number.\r\n * @returns Promise with true if the page was changed, false otherwise.\r\n */\r\n public changePage(parentId: number, pageNumber: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // get the parent node\r\n const parentNode = this._nodes$.value.find((n) => n.id === parentId);\r\n if (!parentNode) {\r\n resolve(false);\r\n }\r\n\r\n // get the page\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(parentNode), parentId },\r\n pageNumber\r\n ).subscribe((page) => {\r\n // if page is empty do nothing\r\n if (!page.total) {\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // remove all the nodes in the same page of node\r\n // with all their descendants\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(parentNode!) + 1;\r\n const pageNodes = this.createPageNodes(page);\r\n\r\n // find the first node of the node's page\r\n let start = nodeIndex;\r\n const oldPageNr = nodes[start].paging.pageNumber;\r\n while (\r\n start > 0 &&\r\n nodes[start - 1].parentId === parentId &&\r\n nodes[start - 1].paging.pageNumber === oldPageNr\r\n ) {\r\n start--;\r\n }\r\n\r\n // find the last node of the node's page,\r\n // including all their descendants\r\n let end = start;\r\n const y = nodes[start].y;\r\n while (end < nodes.length && nodes[end].y >= y) {\r\n end++;\r\n }\r\n // replace all these nodes with the new ones\r\n nodes.splice(start, end - start);\r\n nodes.splice(start, 0, ...(pageNodes as E[]));\r\n\r\n // update the parent node paging info\r\n parentNode!.paging.pageNumber = page.pageNumber;\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Collapse all the nodes in the store.\r\n */\r\n public collapseAll(): void {\r\n if (this.isEmpty()) {\r\n return;\r\n }\r\n // collapse the first node\r\n const root = this._nodes$.value[0];\r\n this.collapse(root.id);\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the nodes are removed.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._nodes$.next([]);\r\n this._dirty = true;\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatBadgeModule } from '@angular/material/badge';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatPaginatorModule } from '@angular/material/paginator';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { NgToolsModule } from '@myrmidon/ng-tools';\n\nimport { CompactPagerComponent } from './components/compact-pager/compact-pager.component';\nimport { RangeViewComponent } from './components/range-view/range-view.component';\nimport { BrowserTreeNodeComponent } from './components/browser-tree-node/browser-tree-node.component';\n\n@NgModule({\n declarations: [\n CompactPagerComponent,\n RangeViewComponent,\n BrowserTreeNodeComponent,\n ],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // material\n MatBadgeModule,\n MatButtonModule,\n MatChipsModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatPaginatorModule,\n MatProgressBarModule,\n MatSelectModule,\n MatTooltipModule,\n // myrmidon\n NgToolsModule\n ],\n exports: [\n CompactPagerComponent,\n RangeViewComponent,\n BrowserTreeNodeComponent,\n ],\n})\nexport class PagedDataBrowsersModule {}\n","/*\n * Public API Surface of paged-data-browsers\n */\n\nexport * from './lib/components/compact-pager/compact-pager.component';\nexport * from './lib/components/range-view/range-view.component';\nexport * from './lib/components/browser-tree-node/browser-tree-node.component';\n\nexport * from './lib/services/paged-list.store';\nexport * from './lib/services/paged-tree.store';\nexport * from './lib/services/lru-cache';\n\nexport * from './lib/paged-data-browsers.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i4","i6.CompactPagerComponent","i7.RangeViewComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAUa,qBAAqB,CAAA;AAOhC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,KAAK,EAAE,CAAC;SACT;AACD,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAc;;IAG7C,OAAO,GAAA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ACd,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,cAAc;YACd,kBAAkB;YAClB,oBAAoB;YACpB,eAAe;YACf,gBAAgB;;YAEhB,aAAa,CAAA,EAAA,CAAA,CAAA;;2FAQJ,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBA9BnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,qBAAqB;wBACrB,kBAAkB;wBAClB,wBAAwB;AACzB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;;wBAEnB,cAAc;wBACd,eAAe;wBACf,cAAc;wBACd,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,kBAAkB;wBAClB,oBAAoB;wBACpB,eAAe;wBACf,gBAAgB;;wBAEhB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,qBAAqB;wBACrB,kBAAkB;wBAClB,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;ACnDD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"myrmidon-paged-data-browsers.mjs","sources":["../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/lru-cache.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-list.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-tree.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/public-api.ts","../../../../projects/myrmidon/paged-data-browsers/src/myrmidon-paged-data-browsers.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { PagingInfo } from '../../services/paged-tree.store';\n\n@Component({\n selector: 'pdb-compact-pager',\n imports: [CommonModule, MatButtonModule, MatIconModule],\n templateUrl: './compact-pager.component.html',\n styleUrls: ['./compact-pager.component.scss'],\n})\nexport class CompactPagerComponent {\n public paging = input<PagingInfo>({ pageNumber: 0, pageCount: 0, total: 0 });\n\n /**\n * Emits the new paging information when the user changes the page.\n */\n public readonly pagingChange = output<PagingInfo>();\n\n public onFirst(): void {\n this.pagingChange.emit({ ...this.paging(), pageNumber: 1 });\n }\n\n public onPrevious(): void {\n if (this.paging().pageNumber > 1) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber - 1,\n });\n }\n }\n\n public onNext(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber + 1,\n });\n }\n }\n\n public onLast(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageCount,\n });\n }\n }\n}\n","@if (paging().pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging().total }} </span>\n </div>\n}\n","import { Component, computed, input, signal } from '@angular/core';\n\n@Component({\n selector: 'pdb-range-view',\n templateUrl: './range-view.component.html',\n styleUrls: ['./range-view.component.scss'],\n})\nexport class RangeViewComponent {\n /**\n * The domain of the range view (start, limit).\n */\n public domain = input([0, 100]);\n /**\n * The range of the range view (start, limit).\n */\n public range = input([0, 100]);\n /**\n * The width of the component.\n */\n public width = input(100);\n /**\n * The height of the component.\n */\n public height = input(5);\n\n public scaledRange = computed(() => {\n const domain = this.domain();\n const range = this.range();\n const width = this.width();\n\n const domainWidth = domain[1] - domain[0];\n const rangeWidth = range[1] - range[0];\n const rangeStart = range[0] - domain[0];\n\n return [\n (rangeStart / domainWidth) * width,\n ((rangeStart + rangeWidth) / domainWidth) * width,\n ];\n });\n\n constructor() {}\n}\n","<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange()[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\n [attr.height]=\"height()\"\n />\n</svg>\n","import { Component, input, output } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { MatBadgeModule } from '@angular/material/badge';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { ColorToContrastPipe, StringToColorPipe } from '@myrmidon/ngx-tools';\n\nimport { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';\nimport { CompactPagerComponent } from '../compact-pager/compact-pager.component';\nimport { RangeViewComponent } from '../range-view/range-view.component';\n\n/**\n * A request to change the page number of a node's children.\n */\nexport interface PageChangeRequest {\n node: PagedTreeNode<any>;\n paging: PagingInfo;\n}\n\n/**\n * Browser tree node component view. This wraps some HTML content providing\n * a toggle button to expand/collapse the node, a paging control for the\n * node's children, and a button to edit the node's filter. You should then\n * provide the HTML content to display the node's data inside this component, e.g.\n * <pdb-browser-tree-node [node]=\"node\">\n * <your-node-view [node]=\"node\" />\n * <pdb-browser-tree-node>\n */\n@Component({\n selector: 'pdb-browser-tree-node',\n imports: [\n CommonModule,\n MatBadgeModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule,\n // ngx-tools\n ColorToContrastPipe,\n StringToColorPipe,\n // local\n CompactPagerComponent,\n RangeViewComponent,\n ],\n templateUrl: './browser-tree-node.component.html',\n styleUrls: ['./browser-tree-node.component.css'],\n})\nexport class BrowserTreeNodeComponent {\n /**\n * The node to display.\n */\n public readonly node = input<PagedTreeNode<any> | undefined | null>();\n\n /**\n * The paging information for the node's children.\n */\n public readonly paging = input<PagingInfo>();\n\n /**\n * True to show debug information.\n */\n public readonly debug = input<boolean>();\n\n /**\n * True to hide the node's loc and label. This is useful if you want to\n * provide your own view for the node, between the expansion toggle and\n * the filter edit button. In this case, in your consumer template provide\n * your own view as the content of this component. If instead you are fine\n * with the default loc and label, and just want to add more data to\n * the view, then you can just add your own content to this component's\n * template, without setting this property to true.\n */\n public readonly hideLabel = input<boolean>();\n\n /**\n * True to hide the node's location (y and x).\n */\n public readonly hideLoc = input<boolean>();\n\n /**\n * True to hide the node's paging control unless hovered.\n */\n public readonly hidePaging = input<boolean>();\n\n /**\n * True to hide the node's filter edit button.\n */\n public readonly hideFilter = input<boolean>();\n\n /**\n * The indent size for the node's children.\n */\n public readonly indentSize = input(30);\n\n /**\n * The width of the range view.\n */\n public readonly rangeWidth = input(250);\n\n /**\n * Emits when the user wants to toggle the expanded state of the node.\n */\n public readonly toggleExpandedRequest = output<PagedTreeNode<any>>();\n\n /**\n * Emits when the user wants to change the page number of the node's children.\n */\n public readonly changePageRequest = output<PageChangeRequest>();\n\n /**\n * Emits when the user wants to edit the node's filter.\n */\n public readonly editNodeFilterRequest = output<PagedTreeNode<any>>();\n\n public onToggleExpanded(): void {\n if (!this.node()) {\n return;\n }\n this.toggleExpandedRequest.emit(this.node() as PagedTreeNode<any>);\n }\n\n public onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void {\n this.changePageRequest.emit({\n node,\n paging,\n });\n }\n\n public onEditFilter(): void {\n if (this.node()) {\n this.editNodeFilterRequest.emit(this.node() as PagedTreeNode<any>);\n }\n }\n}\n","@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n","/**\r\n * A Least Recently Used cache that can be used to store any type of object.\r\n * The cache works in two modes: considering the size of the objects or not.\r\n * If the size is considered, the cache will have a maximum size and will\r\n * remove the oldest objects when the maximum size is reached. Note that\r\n * the size is only roughly estimated. This avoids removing too many\r\n * entries from the cache when the maximum is reached.\r\n * If the size is not considered, the cache will have a maximum number of\r\n * objects and will remove the oldest objects when the maximum number is\r\n * reached.\r\n */\r\nexport class LRUCache<T> {\r\n private _maxSize: number;\r\n private _totalSize: number;\r\n private _considerSize: boolean;\r\n private _cache: Map<string, T>;\r\n private _sizes: Map<string, number>;\r\n\r\n /**\r\n * Creates a new cache.\r\n * @param maxSize The maximum size of the cache. This is either\r\n * the maximum number of items in the cache (when considerSize\r\n * is false) or the maximum total size of all items in the\r\n * cache in bytes (when considerSize is true).\r\n * @param considerSize True if the size of the objects should be\r\n * considered.\r\n */\r\n constructor(maxSize: number, considerSize: boolean = false) {\r\n this._maxSize = maxSize;\r\n this._totalSize = 0;\r\n this._considerSize = considerSize;\r\n this._cache = new Map<string, T>();\r\n this._sizes = new Map<string, number>();\r\n }\r\n\r\n /**\r\n * Get an item from the cache.\r\n * @param key The key of the item to get.\r\n * @returns The item or undefined if the item is not in the cache.\r\n */\r\n public get(key: string): T | undefined {\r\n let item: T | undefined = this._cache.get(key);\r\n if (item) {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n }\r\n return item;\r\n }\r\n\r\n /**\r\n * Check if an item is in the cache.\r\n * @param key The key of the item to check.\r\n * @returns True if the item is in cache.\r\n */\r\n public has(key: string): boolean {\r\n return this._cache.has(key);\r\n }\r\n\r\n /**\r\n * Put an item in the cache.\r\n * @param key The key of the item to put.\r\n * @param item The item to put.\r\n * @param size The estimated size of the item in bytes.\r\n * This must be calculated by the caller but only when\r\n * considerSize is true.\r\n */\r\n public put(key: string, item: T, size: number): void {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n this._sizes.set(key, size);\r\n if (this._considerSize) {\r\n this._totalSize += size;\r\n while (this._totalSize > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n let oldestSize = this._sizes.get(oldestKey);\r\n if (oldestSize) {\r\n this._totalSize -= oldestSize;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n } else {\r\n while (this._cache.size > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._sizes.clear();\r\n this._totalSize = 0;\r\n }\r\n\r\n /**\r\n * Estimate the size of an object in bytes.\r\n * @param obj The object to calculate the size of.\r\n * @returns The estimated size of the object in bytes.\r\n */\r\n public static calculateObjectSize(obj: any): number {\r\n if (!obj) {\r\n return 0;\r\n }\r\n let totalSize = 0;\r\n let keys = Object.keys(obj);\r\n for (let key of keys) {\r\n let value = obj[key];\r\n if (typeof value === 'string') {\r\n totalSize += value.length * 2;\r\n } else if (typeof value === 'number') {\r\n totalSize += 8;\r\n } else if (typeof value === 'boolean') {\r\n totalSize += 4;\r\n } else if (typeof value === 'object' && value !== null) {\r\n totalSize += this.calculateObjectSize(value);\r\n }\r\n }\r\n return totalSize;\r\n }\r\n}\r\n","import { BehaviorSubject, Observable } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\n\r\n/**\r\n * Options for the paged list store.\r\n */\r\nexport interface PagedListStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n}\r\n\r\n/**\r\n * Default options for the paged list store.\r\n */\r\nexport const DEFAULT_PAGED_LIST_STORE_OPTIONS: PagedListStoreOptions = {\r\n pageSize: 20,\r\n cacheSize: 50,\r\n};\r\n\r\n/**\r\n * The interface to be implemented by the service used by PagedListStore.\r\n */\r\nexport interface PagedListStoreService<F, E> {\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The size of the page to load.\r\n * @param filter The filter to apply.\r\n */\r\n loadPage(\r\n pageNumber: number,\r\n pageSize: number,\r\n filter: F\r\n ): Observable<DataPage<E>>;\r\n}\r\n\r\n/**\r\n * A generic paged list store using a filter object of type F\r\n * and a list of elements of type E.\r\n */\r\nexport class PagedListStore<F, E> {\r\n private _pageSize: number;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private _page$: BehaviorSubject<DataPage<E>>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _cache: LRUCache<DataPage<E>>;\r\n\r\n /**\r\n * The page. It is updated when the page is changed or the filter is changed.\r\n */\r\n public page$: Observable<Readonly<DataPage<E>>>;\r\n\r\n /**\r\n * The filter. It is updated when the filter is changed.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create a new paged list store.\r\n * @param options Options for the paged list store.\r\n */\r\n constructor(\r\n private _service: PagedListStoreService<F, E>,\r\n options: PagedListStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<E>>(options.cacheSize);\r\n // page\r\n this._page$ = new BehaviorSubject<DataPage<E>>({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n this.page$ = this._page$.asObservable();\r\n // filter\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n }\r\n\r\n /**\r\n * Returns true if the store is empty, false otherwise.\r\n * @returns true if the store is empty, false otherwise.\r\n */\r\n public isEmpty(): boolean {\r\n return this._page$.value.items.length === 0;\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ pageNumber, ...filter });\r\n }\r\n\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber the page number to load.\r\n */\r\n private loadPage(pageNumber: number): Observable<DataPage<E>> {\r\n return this._service.loadPage(\r\n pageNumber,\r\n this._pageSize,\r\n this._filter$.value\r\n );\r\n }\r\n\r\n /**\r\n * Set the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The page size.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setPage(pageNumber: number, pageSize?: number): Promise<void> {\r\n if (pageSize && pageSize !== this._pageSize) {\r\n this._pageSize = pageSize;\r\n }\r\n return new Promise((resolve, reject) => {\r\n // if page is in cache, return it\r\n const key = this.buildCacheKey(pageNumber, this._filter$.value);\r\n const cachedPage = this._cache.get(key);\r\n if (cachedPage) {\r\n this._page$.next(cachedPage);\r\n resolve();\r\n return;\r\n }\r\n\r\n // else load page\r\n this.loadPage(pageNumber).subscribe({\r\n next: (page) => {\r\n this._page$.next(page);\r\n this._cache.put(key, page, 0);\r\n resolve();\r\n },\r\n error: reject,\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Get the current page.\r\n * @returns The current page.\r\n */\r\n public getPage(): DataPage<E> {\r\n return this._page$.value;\r\n }\r\n\r\n /**\r\n * Apply the given filter and load the first page.\r\n * @param filter The filter to apply.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setFilter(filter: F): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this._filter$.next(filter);\r\n this.setPage(1).then(resolve, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Get the current filter.\r\n * @returns The current filter.\r\n */\r\n public getFilter(): F {\r\n return this._filter$.value;\r\n }\r\n\r\n /**\r\n * Reset the filter and load the first page. The cache is cleared.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public reset(): Promise<void> {\r\n this._cache.clear();\r\n return this.setFilter({} as F);\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the page is emptied.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._page$.next({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","import { BehaviorSubject, Observable, forkJoin, of, tap } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\nimport { DEFAULT_PAGED_LIST_STORE_OPTIONS } from './paged-list.store';\r\n\r\n/**\r\n * A tree node. Your data service should return a list of these nodes\r\n * or of any type extending this interface.\r\n */\r\nexport interface TreeNode {\r\n id: number;\r\n parentId?: number;\r\n y: number;\r\n x: number;\r\n label: string;\r\n tag?: string;\r\n hasChildren?: boolean;\r\n}\r\n\r\n/**\r\n * A filter for tree nodes.\r\n */\r\nexport interface TreeNodeFilter {\r\n tags?: string[];\r\n parentId?: number;\r\n}\r\n\r\n/**\r\n * Paging information for a paged tree node.\r\n */\r\nexport interface PagingInfo {\r\n pageNumber: number;\r\n pageCount: number;\r\n total: number;\r\n}\r\n\r\n/**\r\n * A tree node with paging information, used in NodeBrowserStore.\r\n */\r\nexport interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {\r\n paging: PagingInfo;\r\n expanded?: boolean;\r\n filter?: F;\r\n}\r\n\r\n/**\r\n * The interface to be implemented by the service used by NodeBrowserStore\r\n * to load nodes.\r\n */\r\nexport interface PagedTreeStoreService<F extends TreeNodeFilter> {\r\n /**\r\n * Get the specified page of nodes.\r\n * @param filter The filter.\r\n * @param pageNumber The page number.\r\n * @param pageSize The page size.\r\n * @param hasMockRoot If true, the root node is a mock node provided by your\r\n * service, which implies that its Y value is 0 rather than 1. Default is\r\n * false, meaning that your service will return a single root node with Y\r\n * value 1.\r\n */\r\n getNodes(\r\n filter: F,\r\n pageNumber: number,\r\n pageSize: number,\r\n hasMockRoot?: boolean\r\n ): Observable<DataPage<TreeNode>>;\r\n}\r\n\r\n/**\r\n * Options for the NodeBrowserStore.\r\n */\r\nexport interface PagedTreeStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n /**\r\n * If true, the root node is a mock node provided by your service, which\r\n * implies that its Y value is 0 rather than 1. Default is false, meaning\r\n * that there are many root-level nodes, all with parent ID = undefined.\r\n */\r\n hasMockRoot?: boolean;\r\n}\r\n\r\n/**\r\n * A store for the node browser component. This store is used to keep a\r\n * list of nodes, and to load them from the API. It also keeps the root\r\n * node. Every tree node in the list is extended with page number,\r\n * page count and total items, plus expansion-related metadata.\r\n * The store keeps a flat list of these tree nodes, allowing users to\r\n * expand and collapse them.\r\n * F is the type of the filter object, E is the type of the paged tree nodes.\r\n */\r\nexport class PagedTreeStore<\r\n E extends PagedTreeNode<F>,\r\n F extends TreeNodeFilter\r\n> {\r\n private _nodes$: BehaviorSubject<E[]>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private readonly _cache: LRUCache<DataPage<TreeNode>>;\r\n private readonly _hasMockRoot: boolean;\r\n\r\n private _pageSize: number;\r\n // dirty state: this is reset when the store is reset, and set to true\r\n // when the store is changed\r\n private _dirty?: boolean;\r\n\r\n /**\r\n * The flat list of paged nodes in this store.\r\n */\r\n public nodes$: Observable<Readonly<E[]>>;\r\n\r\n /**\r\n * The global filter for all the nodes.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create an instance of the store.\r\n * @param _service The service used to load nodes.\r\n * @param options The options to configure this store.\r\n */\r\n constructor(\r\n private _service: PagedTreeStoreService<F>,\r\n options: PagedTreeStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<TreeNode>>(options.cacheSize);\r\n this._customCacheKeyBuilder = options.buildCacheKey;\r\n this._nodes$ = new BehaviorSubject<E[]>([]);\r\n this.nodes$ = this._nodes$.asObservable();\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n this._dirty = true;\r\n this._hasMockRoot = options.hasMockRoot || false;\r\n }\r\n\r\n /**\r\n * Gets the global filter, eventually overridden with values\r\n * from the specified node's filter.\r\n * @param node The optional node.\r\n * @returns The filter.\r\n */\r\n private getFilter(node?: PagedTreeNode<F>): F {\r\n return node?.filter\r\n ? {\r\n ...this._filter$.value,\r\n ...node.filter,\r\n }\r\n : this._filter$.value;\r\n }\r\n\r\n /**\r\n * Checks if this store is empty.\r\n * @returns True if this store is empty.\r\n */\r\n public isEmpty(): boolean {\r\n return this._nodes$.value.length === 0;\r\n }\r\n\r\n /**\r\n * Gets all the nodes in the store.\r\n * @returns The nodes.\r\n */\r\n public getNodes(): Readonly<PagedTreeNode<F>[]> {\r\n return this._nodes$.value;\r\n }\r\n\r\n /**\r\n * Get the root node of the tree.\r\n * @returns The root node of the tree or undefined if empty.\r\n */\r\n public getRootNode(): PagedTreeNode<F> | undefined {\r\n return this._nodes$.value[0];\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ ...filter, pageNumber });\r\n }\r\n\r\n /**\r\n * Get the specified page of nodes, either from cache or from the server.\r\n * When the page is retrieved from the server, it is stored in cache.\r\n * @param filter The filter to apply.\r\n * @param pageNumber The page number to get.\r\n * @returns Observable of the page of nodes.\r\n */\r\n private getPageFromCacheOrServer(\r\n filter: F,\r\n pageNumber: number\r\n ): Observable<DataPage<TreeNode>> {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n const pageInCache = this._cache.get(key);\r\n\r\n if (pageInCache) {\r\n return of(pageInCache);\r\n } else {\r\n return this._service\r\n .getNodes(filter, pageNumber, this._pageSize, this._hasMockRoot)\r\n .pipe(\r\n tap((page) => {\r\n this._cache.put(key, page, 0);\r\n })\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create paged tree nodes from a page of tree nodes, by providing further\r\n * metadata like page number, page count and total items.\r\n * @param page The page to create nodes from.\r\n * @returns Paged nodes.\r\n */\r\n private createPageNodes(page: DataPage<TreeNode>): E[] {\r\n return page.items.map((n) => {\r\n return {\r\n ...n,\r\n hasChildren: n.hasChildren,\r\n paging: {\r\n pageNumber: page.pageNumber,\r\n pageCount: page.pageCount,\r\n total: page.total,\r\n },\r\n } as E;\r\n });\r\n }\r\n\r\n /**\r\n * Sets the filter for this store. Whenever the filter is set,\r\n * the store is reset.\r\n * @param filter The filter.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public setFilter(filter: F): Promise<boolean> {\r\n if (this._filter$.value === filter) {\r\n return Promise.resolve(false);\r\n }\r\n this._filter$.next(filter);\r\n this._dirty = true;\r\n return this.reset();\r\n }\r\n\r\n /**\r\n * Reset the store, loading the root nodes and their children.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public reset(): Promise<boolean> {\r\n if (!this._dirty) {\r\n return Promise.resolve(false);\r\n }\r\n this._cache.clear();\r\n const filter = this._filter$.value;\r\n\r\n return new Promise<boolean>((resolve, reject) => {\r\n this._service\r\n .getNodes(\r\n {\r\n ...filter,\r\n parentId: undefined,\r\n },\r\n 1,\r\n this._pageSize,\r\n this._hasMockRoot\r\n )\r\n .subscribe({\r\n next: (page: DataPage<TreeNode>) => {\r\n this._nodes$.next(this.createPageNodes(page));\r\n\r\n // get the children of each node thus calculating their hasChildren property\r\n const childrenObservables = this._nodes$.value.map((node) =>\r\n this.getPageFromCacheOrServer({ ...filter, parentId: node.id }, 1)\r\n );\r\n forkJoin(childrenObservables).subscribe((childrenPages) => {\r\n childrenPages.forEach((page, i) => {\r\n this._nodes$.value[i].hasChildren = page.total > 0;\r\n });\r\n });\r\n\r\n this._dirty = false;\r\n resolve(true);\r\n },\r\n error: (error) => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Set the node filter for the node with the specified ID.\r\n * @param id The node ID.\r\n * @param filter The filter to set.\r\n * @returns Promise with true if filter was set, false otherwise.\r\n */\r\n public setNodeFilter(id: number, filter?: F | null): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node) {\r\n reject(`Node ID ${id} not found in store`);\r\n }\r\n node!.filter = filter || undefined;\r\n return this.changePage(id, 1);\r\n });\r\n }\r\n\r\n /**\r\n * Expand the node with the specified ID. If the node is not expandable,\r\n * or it is already expanded, this method does nothing.\r\n * @param node The ID of the node to expand.\r\n * @returns Promise with true if the node was expanded, false otherwise.\r\n */\r\n public expand(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(node), parentId: id },\r\n 1\r\n ).subscribe((page) => {\r\n // no children, set hasChildren to false\r\n if (!page.total) {\r\n node!.hasChildren = false;\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // insert page nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node!);\r\n if (index === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n const pageNodes = this.createPageNodes(page);\r\n nodes.splice(index + 1, 0, ...(pageNodes as E[]));\r\n this._nodes$.next(nodes);\r\n node!.hasChildren = true;\r\n node!.expanded = true;\r\n resolve(true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Expand all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to expand, or undefined to expand the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public expandAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each root level node call expandAll\r\n const nodes = [...this._nodes$.value];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.expandAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n // get the parent node to start from\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.findIndex((n) => n.id === id);\r\n if (nodeIndex === -1) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n // collect all the descendant nodes IDs\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n const nodesToExpand = nodes.slice(nodeIndex, i).map((n) => n.id);\r\n\r\n // expand all the descendant nodes\r\n return new Promise<boolean>((resolve, reject) => {\r\n nodesToExpand.forEach((id) => {\r\n this.expand(id);\r\n this.expandAll(id);\r\n });\r\n resolve(true);\r\n });\r\n }\r\n\r\n public getChildren(id: number): E[] {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false) {\r\n return [];\r\n }\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node);\r\n if (index === -1) {\r\n return [];\r\n }\r\n const children: E[] = [];\r\n let i = index + 1;\r\n while (i < nodes.length && nodes[i].y > node.y) {\r\n children.push(nodes[i]);\r\n i++;\r\n }\r\n return children;\r\n }\r\n\r\n private removeDescendants(\r\n nodes: PagedTreeNode<F>[],\r\n nodeIndex: number\r\n ): void {\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n nodes.splice(nodeIndex + 1, i - nodeIndex - 1);\r\n }\r\n\r\n /**\r\n * Collapse the node with the specified ID. If the node is not expandable,\r\n * or it is already collapsed, this method does nothing.\r\n * @param node The node to collapse.\r\n * @returns Promise with true if the node was collapsed, false otherwise.\r\n */\r\n public collapse(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || !node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n // remove all the descendant nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(node!);\r\n if (nodeIndex === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n this._dirty = true;\r\n this.removeDescendants(nodes, nodeIndex);\r\n node!.expanded = false;\r\n // reset paging info\r\n if (node?.paging) {\r\n node.paging.pageNumber = 1;\r\n }\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Collapse all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to collapse, or undefined to collapse the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public collapseAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each expanded root level node\r\n const nodes = [...this._nodes$.value.filter((n) => n.expanded)];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.collapseAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n this.collapse(id);\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Change the page including the node with the specified ID.\r\n * @param parentId The ID of the parent node whose children are inside the page\r\n * you want to change.\r\n * @param pageNumber The new page number.\r\n * @returns Promise with true if the page was changed, false otherwise.\r\n */\r\n public changePage(parentId: number, pageNumber: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // get the parent node\r\n const parentNode = this._nodes$.value.find((n) => n.id === parentId);\r\n if (!parentNode) {\r\n resolve(false);\r\n }\r\n\r\n // get the page\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(parentNode), parentId },\r\n pageNumber\r\n ).subscribe((page) => {\r\n // if page is empty do nothing\r\n if (!page.total) {\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // remove all the nodes in the same page of node\r\n // with all their descendants\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(parentNode!) + 1;\r\n const pageNodes = this.createPageNodes(page);\r\n\r\n // find the first node of the node's page\r\n let start = nodeIndex;\r\n const oldPageNr = nodes[start].paging.pageNumber;\r\n while (\r\n start > 0 &&\r\n nodes[start - 1].parentId === parentId &&\r\n nodes[start - 1].paging.pageNumber === oldPageNr\r\n ) {\r\n start--;\r\n }\r\n\r\n // find the last node of the node's page,\r\n // including all their descendants\r\n let end = start;\r\n const y = nodes[start].y;\r\n while (end < nodes.length && nodes[end].y >= y) {\r\n end++;\r\n }\r\n // replace all these nodes with the new ones\r\n nodes.splice(start, end - start);\r\n nodes.splice(start, 0, ...(pageNodes as E[]));\r\n\r\n // update the parent node paging info\r\n parentNode!.paging.pageNumber = page.pageNumber;\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the nodes are removed.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._nodes$.next([]);\r\n this._dirty = true;\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","/*\n * Public API Surface of paged-data-browsers\n */\n\nexport * from './lib/components/compact-pager/compact-pager.component';\nexport * from './lib/components/range-view/range-view.component';\nexport * from './lib/components/browser-tree-node/browser-tree-node.component';\n\nexport * from './lib/services/paged-list.store';\nexport * from './lib/services/paged-tree.store';\nexport * from './lib/services/lru-cache';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;MAca,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOS,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAa,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAE5E;;AAEG;QACa,IAAY,CAAA,YAAA,GAAG,MAAM,EAAc;AAgCpD;IA9BQ,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;;IAGtD,UAAU,GAAA;QACf,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,CAAC,EAAE;AAChC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACrB,GAAG,IAAI,CAAC,MAAM,EAAE;gBAChB,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,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,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxB,oBAAA,OAAO,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;AAC9C,wBAAA,GAAG,EAAE;;;oBAGP,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC;oBAChC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAI,SAAiB,CAAC;;oBAG7C,UAAW,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;AAC/C,oBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;oBACxB,OAAO,CAAC,IAAI,CAAC;;AAEjB,aAAC,CAAC;AACJ,SAAC,CAAC;;AAGJ;;AAEG;IACI,KAAK,GAAA;AACV,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;AACnB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;AACrB,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;;AAGpB;;AAEG;IACI,UAAU,GAAA;AACf,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;;AAGrB;;;;;AAKG;IACI,aAAa,CAAC,UAAkB,EAAE,MAAS,EAAA;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE9B;;ACtmBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
/**
|
|
@@ -18,20 +17,18 @@ export interface PageChangeRequest {
|
|
|
18
17
|
* <pdb-browser-tree-node>
|
|
19
18
|
*/
|
|
20
19
|
export declare class BrowserTreeNodeComponent {
|
|
21
|
-
private _node;
|
|
22
20
|
/**
|
|
23
21
|
* The node to display.
|
|
24
22
|
*/
|
|
25
|
-
|
|
26
|
-
set node(value: PagedTreeNode<any> | undefined | null);
|
|
23
|
+
readonly node: import("@angular/core").InputSignal<PagedTreeNode<any> | null | undefined>;
|
|
27
24
|
/**
|
|
28
25
|
* The paging information for the node's children.
|
|
29
26
|
*/
|
|
30
|
-
paging
|
|
27
|
+
readonly paging: import("@angular/core").InputSignal<PagingInfo | undefined>;
|
|
31
28
|
/**
|
|
32
29
|
* True to show debug information.
|
|
33
30
|
*/
|
|
34
|
-
debug
|
|
31
|
+
readonly debug: import("@angular/core").InputSignal<boolean | undefined>;
|
|
35
32
|
/**
|
|
36
33
|
* True to hide the node's loc and label. This is useful if you want to
|
|
37
34
|
* provide your own view for the node, between the expansion toggle and
|
|
@@ -41,36 +38,42 @@ export declare class BrowserTreeNodeComponent {
|
|
|
41
38
|
* the view, then you can just add your own content to this component's
|
|
42
39
|
* template, without setting this property to true.
|
|
43
40
|
*/
|
|
44
|
-
hideLabel
|
|
41
|
+
readonly hideLabel: import("@angular/core").InputSignal<boolean | undefined>;
|
|
45
42
|
/**
|
|
46
43
|
* True to hide the node's location (y and x).
|
|
47
44
|
*/
|
|
48
|
-
hideLoc
|
|
45
|
+
readonly hideLoc: import("@angular/core").InputSignal<boolean | undefined>;
|
|
49
46
|
/**
|
|
50
47
|
* True to hide the node's paging control unless hovered.
|
|
51
48
|
*/
|
|
52
|
-
hidePaging
|
|
49
|
+
readonly hidePaging: import("@angular/core").InputSignal<boolean | undefined>;
|
|
53
50
|
/**
|
|
54
51
|
* True to hide the node's filter edit button.
|
|
55
52
|
*/
|
|
56
|
-
hideFilter
|
|
53
|
+
readonly hideFilter: import("@angular/core").InputSignal<boolean | undefined>;
|
|
57
54
|
/**
|
|
58
55
|
* The indent size for the node's children.
|
|
59
56
|
*/
|
|
60
|
-
indentSize: number
|
|
57
|
+
readonly indentSize: import("@angular/core").InputSignal<number>;
|
|
58
|
+
/**
|
|
59
|
+
* The width of the range view.
|
|
60
|
+
*/
|
|
61
|
+
readonly rangeWidth: import("@angular/core").InputSignal<number>;
|
|
61
62
|
/**
|
|
62
63
|
* Emits when the user wants to toggle the expanded state of the node.
|
|
63
64
|
*/
|
|
64
|
-
toggleExpandedRequest:
|
|
65
|
+
readonly toggleExpandedRequest: import("@angular/core").OutputEmitterRef<PagedTreeNode<any>>;
|
|
65
66
|
/**
|
|
66
67
|
* Emits when the user wants to change the page number of the node's children.
|
|
67
68
|
*/
|
|
68
|
-
changePageRequest:
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
readonly changePageRequest: import("@angular/core").OutputEmitterRef<PageChangeRequest>;
|
|
70
|
+
/**
|
|
71
|
+
* Emits when the user wants to edit the node's filter.
|
|
72
|
+
*/
|
|
73
|
+
readonly editNodeFilterRequest: import("@angular/core").OutputEmitterRef<PagedTreeNode<any>>;
|
|
71
74
|
onToggleExpanded(): void;
|
|
72
75
|
onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void;
|
|
73
76
|
onEditFilter(): void;
|
|
74
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTreeNodeComponent, never>;
|
|
75
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BrowserTreeNodeComponent, "pdb-browser-tree-node", never, { "node": { "alias": "node"; "required": false; }; "paging": { "alias": "paging"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "hideLabel": { "alias": "hideLabel"; "required": false; }; "hideLoc": { "alias": "hideLoc"; "required": false; }; "hidePaging": { "alias": "hidePaging"; "required": false; }; "hideFilter": { "alias": "hideFilter"; "required": false; }; "indentSize": { "alias": "indentSize"; "required": false; }; }, { "toggleExpandedRequest": "toggleExpandedRequest"; "changePageRequest": "changePageRequest"; "editNodeFilterRequest": "editNodeFilterRequest"; }, never, ["*"],
|
|
78
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BrowserTreeNodeComponent, "pdb-browser-tree-node", never, { "node": { "alias": "node"; "required": false; "isSignal": true; }; "paging": { "alias": "paging"; "required": false; "isSignal": true; }; "debug": { "alias": "debug"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "hideLoc": { "alias": "hideLoc"; "required": false; "isSignal": true; }; "hidePaging": { "alias": "hidePaging"; "required": false; "isSignal": true; }; "hideFilter": { "alias": "hideFilter"; "required": false; "isSignal": true; }; "indentSize": { "alias": "indentSize"; "required": false; "isSignal": true; }; "rangeWidth": { "alias": "rangeWidth"; "required": false; "isSignal": true; }; }, { "toggleExpandedRequest": "toggleExpandedRequest"; "changePageRequest": "changePageRequest"; "editNodeFilterRequest": "editNodeFilterRequest"; }, never, ["*"], true, never>;
|
|
76
79
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { PagingInfo } from '../../services/paged-tree.store';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
export declare class CompactPagerComponent {
|
|
5
|
-
paging: PagingInfo
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
paging: import("@angular/core").InputSignal<PagingInfo>;
|
|
5
|
+
/**
|
|
6
|
+
* Emits the new paging information when the user changes the page.
|
|
7
|
+
*/
|
|
8
|
+
readonly pagingChange: import("@angular/core").OutputEmitterRef<PagingInfo>;
|
|
8
9
|
onFirst(): void;
|
|
9
10
|
onPrevious(): void;
|
|
10
11
|
onNext(): void;
|
|
11
12
|
onLast(): void;
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<CompactPagerComponent, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CompactPagerComponent, "pdb-compact-pager", never, { "paging": { "alias": "paging"; "required": false; }; }, { "pagingChange": "pagingChange"; }, never, never,
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompactPagerComponent, "pdb-compact-pager", never, { "paging": { "alias": "paging"; "required": false; "isSignal": true; }; }, { "pagingChange": "pagingChange"; }, never, never, true, never>;
|
|
14
15
|
}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { OnChanges } from '@angular/core';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class RangeViewComponent
|
|
2
|
+
export declare class RangeViewComponent {
|
|
4
3
|
/**
|
|
5
4
|
* The domain of the range view (start, limit).
|
|
6
5
|
*/
|
|
7
|
-
domain:
|
|
6
|
+
domain: import("@angular/core").InputSignal<number[]>;
|
|
8
7
|
/**
|
|
9
8
|
* The range of the range view (start, limit).
|
|
10
9
|
*/
|
|
11
|
-
range:
|
|
10
|
+
range: import("@angular/core").InputSignal<number[]>;
|
|
12
11
|
/**
|
|
13
12
|
* The width of the component.
|
|
14
13
|
*/
|
|
15
|
-
width: number
|
|
14
|
+
width: import("@angular/core").InputSignal<number>;
|
|
16
15
|
/**
|
|
17
16
|
* The height of the component.
|
|
18
17
|
*/
|
|
19
|
-
height: number
|
|
20
|
-
scaledRange:
|
|
18
|
+
height: import("@angular/core").InputSignal<number>;
|
|
19
|
+
scaledRange: import("@angular/core").Signal<number[]>;
|
|
21
20
|
constructor();
|
|
22
|
-
ngOnChanges(): void;
|
|
23
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<RangeViewComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RangeViewComponent, "pdb-range-view", never, { "domain": { "alias": "domain"; "required": false; }; "range": { "alias": "range"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never,
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RangeViewComponent, "pdb-range-view", never, { "domain": { "alias": "domain"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
25
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { DataPage } from '@myrmidon/
|
|
2
|
+
import { DataPage } from '@myrmidon/ngx-tools';
|
|
3
3
|
/**
|
|
4
4
|
* A tree node. Your data service should return a list of these nodes
|
|
5
5
|
* or of any type extending this interface.
|
|
@@ -76,7 +76,7 @@ export interface PagedTreeStoreOptions {
|
|
|
76
76
|
/**
|
|
77
77
|
* If true, the root node is a mock node provided by your service, which
|
|
78
78
|
* implies that its Y value is 0 rather than 1. Default is false, meaning
|
|
79
|
-
* that
|
|
79
|
+
* that there are many root-level nodes, all with parent ID = undefined.
|
|
80
80
|
*/
|
|
81
81
|
hasMockRoot?: boolean;
|
|
82
82
|
}
|
|
@@ -194,10 +194,11 @@ export declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNo
|
|
|
194
194
|
/**
|
|
195
195
|
* Expand all the descendants of the node with the specified ID.
|
|
196
196
|
*
|
|
197
|
-
* @param id The ID of the node to expand
|
|
197
|
+
* @param id The ID of the node to expand, or undefined to expand the
|
|
198
|
+
* descendants of all the root level nodes.
|
|
198
199
|
* @returns Promise.
|
|
199
200
|
*/
|
|
200
|
-
expandAll(id
|
|
201
|
+
expandAll(id?: number): Promise<boolean>;
|
|
201
202
|
getChildren(id: number): E[];
|
|
202
203
|
private removeDescendants;
|
|
203
204
|
/**
|
|
@@ -207,6 +208,14 @@ export declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNo
|
|
|
207
208
|
* @returns Promise with true if the node was collapsed, false otherwise.
|
|
208
209
|
*/
|
|
209
210
|
collapse(id: number): Promise<boolean>;
|
|
211
|
+
/**
|
|
212
|
+
* Collapse all the descendants of the node with the specified ID.
|
|
213
|
+
*
|
|
214
|
+
* @param id The ID of the node to collapse, or undefined to collapse the
|
|
215
|
+
* descendants of all the root level nodes.
|
|
216
|
+
* @returns Promise.
|
|
217
|
+
*/
|
|
218
|
+
collapseAll(id?: number): Promise<boolean>;
|
|
210
219
|
/**
|
|
211
220
|
* Change the page including the node with the specified ID.
|
|
212
221
|
* @param parentId The ID of the parent node whose children are inside the page
|
|
@@ -215,10 +224,6 @@ export declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNo
|
|
|
215
224
|
* @returns Promise with true if the page was changed, false otherwise.
|
|
216
225
|
*/
|
|
217
226
|
changePage(parentId: number, pageNumber: number): Promise<boolean>;
|
|
218
|
-
/**
|
|
219
|
-
* Collapse all the nodes in the store.
|
|
220
|
-
*/
|
|
221
|
-
collapseAll(): void;
|
|
222
227
|
/**
|
|
223
228
|
* Clear the store. The cache is cleared and the nodes are removed.
|
|
224
229
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/paged-data-browsers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Generic simple paged data browsers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data browsers"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@angular/core": "^19.0.0",
|
|
19
19
|
"@angular/forms": "^19.0.0",
|
|
20
20
|
"@angular/material": "^19.0.0",
|
|
21
|
-
"@myrmidon/
|
|
21
|
+
"@myrmidon/ngx-tools": "^0.0.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"tslib": "^2.3.0"
|
package/public-api.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export * from './lib/components/browser-tree-node/browser-tree-node.component';
|
|
|
4
4
|
export * from './lib/services/paged-list.store';
|
|
5
5
|
export * from './lib/services/paged-tree.store';
|
|
6
6
|
export * from './lib/services/lru-cache';
|
|
7
|
-
export * from './lib/paged-data-browsers.module';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./components/compact-pager/compact-pager.component";
|
|
3
|
-
import * as i2 from "./components/range-view/range-view.component";
|
|
4
|
-
import * as i3 from "./components/browser-tree-node/browser-tree-node.component";
|
|
5
|
-
import * as i4 from "@angular/common";
|
|
6
|
-
import * as i5 from "@angular/forms";
|
|
7
|
-
import * as i6 from "@angular/material/badge";
|
|
8
|
-
import * as i7 from "@angular/material/button";
|
|
9
|
-
import * as i8 from "@angular/material/chips";
|
|
10
|
-
import * as i9 from "@angular/material/dialog";
|
|
11
|
-
import * as i10 from "@angular/material/form-field";
|
|
12
|
-
import * as i11 from "@angular/material/icon";
|
|
13
|
-
import * as i12 from "@angular/material/input";
|
|
14
|
-
import * as i13 from "@angular/material/paginator";
|
|
15
|
-
import * as i14 from "@angular/material/progress-bar";
|
|
16
|
-
import * as i15 from "@angular/material/select";
|
|
17
|
-
import * as i16 from "@angular/material/tooltip";
|
|
18
|
-
import * as i17 from "@myrmidon/ng-tools";
|
|
19
|
-
export declare class PagedDataBrowsersModule {
|
|
20
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PagedDataBrowsersModule, never>;
|
|
21
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<PagedDataBrowsersModule, [typeof i1.CompactPagerComponent, typeof i2.RangeViewComponent, typeof i3.BrowserTreeNodeComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.MatBadgeModule, typeof i7.MatButtonModule, typeof i8.MatChipsModule, typeof i9.MatDialogModule, typeof i10.MatFormFieldModule, typeof i11.MatIconModule, typeof i12.MatInputModule, typeof i13.MatPaginatorModule, typeof i14.MatProgressBarModule, typeof i15.MatSelectModule, typeof i16.MatTooltipModule, typeof i17.NgToolsModule], [typeof i1.CompactPagerComponent, typeof i2.RangeViewComponent, typeof i3.BrowserTreeNodeComponent]>;
|
|
22
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<PagedDataBrowsersModule>;
|
|
23
|
-
}
|