@myrmidon/paged-data-browsers 5.0.1 → 5.0.3

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.
@@ -15,7 +15,7 @@ import { BehaviorSubject, of, tap, forkJoin } from 'rxjs';
15
15
 
16
16
  class CompactPagerComponent {
17
17
  constructor() {
18
- this.paging = input({ pageNumber: 0, pageCount: 0, total: 0 });
18
+ this.paging = input({ pageNumber: 0, pageCount: 0, total: 0 }, ...(ngDevMode ? [{ debugName: "paging" }] : []));
19
19
  /**
20
20
  * Emits the new paging information when the user changes the page.
21
21
  */
@@ -48,12 +48,12 @@ class CompactPagerComponent {
48
48
  });
49
49
  }
50
50
  }
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CompactPagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.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) {\r\n <div class=\"form-row\">\r\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onFirst()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onPrevious()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>navigate_before</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onNext()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>navigate_next</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onLast()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n </button>\r\n <span id=\"total\">{{ paging().total }} </span>\r\n </div>\r\n}\r\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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
51
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: CompactPagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", 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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
53
53
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CompactPagerComponent, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: CompactPagerComponent, decorators: [{
55
55
  type: Component,
56
- args: [{ selector: 'pdb-compact-pager', imports: [CommonModule, MatButtonModule, MatIconModule], template: "@if (paging().pageCount) {\r\n <div class=\"form-row\">\r\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onFirst()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onPrevious()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>navigate_before</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onNext()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>navigate_next</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onLast()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n </button>\r\n <span id=\"total\">{{ paging().total }} </span>\r\n </div>\r\n}\r\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"] }]
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
57
  }] });
58
58
 
59
59
  class RangeViewComponent {
@@ -61,19 +61,19 @@ class RangeViewComponent {
61
61
  /**
62
62
  * The domain of the range view (start, limit).
63
63
  */
64
- this.domain = input([0, 100]);
64
+ this.domain = input([0, 100], ...(ngDevMode ? [{ debugName: "domain" }] : []));
65
65
  /**
66
66
  * The range of the range view (start, limit).
67
67
  */
68
- this.range = input([0, 100]);
68
+ this.range = input([0, 100], ...(ngDevMode ? [{ debugName: "range" }] : []));
69
69
  /**
70
70
  * The width of the component.
71
71
  */
72
- this.width = input(100);
72
+ this.width = input(100, ...(ngDevMode ? [{ debugName: "width" }] : []));
73
73
  /**
74
74
  * The height of the component.
75
75
  */
76
- this.height = input(5);
76
+ this.height = input(5, ...(ngDevMode ? [{ debugName: "height" }] : []));
77
77
  this.scaledRange = computed(() => {
78
78
  const domain = this.domain();
79
79
  const range = this.range();
@@ -85,14 +85,14 @@ class RangeViewComponent {
85
85
  (rangeStart / domainWidth) * width,
86
86
  ((rangeStart + rangeWidth) / domainWidth) * width,
87
87
  ];
88
- });
88
+ }, ...(ngDevMode ? [{ debugName: "scaledRange" }] : []));
89
89
  }
90
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RangeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
91
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.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()\">\r\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\r\n <rect\r\n id=\"rrange\"\r\n [attr.x]=\"scaledRange()[0]\"\r\n [attr.y]=\"0\"\r\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\r\n [attr.height]=\"height()\"\r\n />\r\n</svg>\r\n", styles: ["#rdomain{fill:#d3d3d3;stroke-width:3;stroke:#c1ba9b}#rrange{fill:#91aad3;stroke-width:3}\n"] }); }
90
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: RangeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
91
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", 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"] }); }
92
92
  }
93
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RangeViewComponent, decorators: [{
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: RangeViewComponent, decorators: [{
94
94
  type: Component,
95
- args: [{ selector: 'pdb-range-view', template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\r\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\r\n <rect\r\n id=\"rrange\"\r\n [attr.x]=\"scaledRange()[0]\"\r\n [attr.y]=\"0\"\r\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\r\n [attr.height]=\"height()\"\r\n />\r\n</svg>\r\n", styles: ["#rdomain{fill:#d3d3d3;stroke-width:3;stroke:#c1ba9b}#rrange{fill:#91aad3;stroke-width:3}\n"] }]
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
96
  }], ctorParameters: () => [] });
97
97
 
98
98
  /**
@@ -109,15 +109,15 @@ class BrowserTreeNodeComponent {
109
109
  /**
110
110
  * The node to display.
111
111
  */
112
- this.node = input();
112
+ this.node = input(...(ngDevMode ? [undefined, { debugName: "node" }] : []));
113
113
  /**
114
114
  * The paging information for the node's children.
115
115
  */
116
- this.paging = input();
116
+ this.paging = input(...(ngDevMode ? [undefined, { debugName: "paging" }] : []));
117
117
  /**
118
118
  * True to show debug information.
119
119
  */
120
- this.debug = input();
120
+ this.debug = input(...(ngDevMode ? [undefined, { debugName: "debug" }] : []));
121
121
  /**
122
122
  * True to hide the node's loc and label. This is useful if you want to
123
123
  * provide your own view for the node, between the expansion toggle and
@@ -127,27 +127,27 @@ class BrowserTreeNodeComponent {
127
127
  * the view, then you can just add your own content to this component's
128
128
  * template, without setting this property to true.
129
129
  */
130
- this.hideLabel = input();
130
+ this.hideLabel = input(...(ngDevMode ? [undefined, { debugName: "hideLabel" }] : []));
131
131
  /**
132
132
  * True to hide the node's location (y and x).
133
133
  */
134
- this.hideLoc = input();
134
+ this.hideLoc = input(...(ngDevMode ? [undefined, { debugName: "hideLoc" }] : []));
135
135
  /**
136
136
  * True to hide the node's paging control unless hovered.
137
137
  */
138
- this.hidePaging = input();
138
+ this.hidePaging = input(...(ngDevMode ? [undefined, { debugName: "hidePaging" }] : []));
139
139
  /**
140
140
  * True to hide the node's filter edit button.
141
141
  */
142
- this.hideFilter = input();
142
+ this.hideFilter = input(...(ngDevMode ? [undefined, { debugName: "hideFilter" }] : []));
143
143
  /**
144
144
  * The indent size for the node's children.
145
145
  */
146
- this.indentSize = input(30);
146
+ this.indentSize = input(30, ...(ngDevMode ? [{ debugName: "indentSize" }] : []));
147
147
  /**
148
148
  * The width of the range view.
149
149
  */
150
- this.rangeWidth = input(250);
150
+ this.rangeWidth = input(250, ...(ngDevMode ? [{ debugName: "rangeWidth" }] : []));
151
151
  /**
152
152
  * Emits when the user wants to toggle the expanded state of the node.
153
153
  */
@@ -178,14 +178,14 @@ class BrowserTreeNodeComponent {
178
178
  this.editNodeFilterRequest.emit(this.node());
179
179
  }
180
180
  }
181
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BrowserTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
182
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.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()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>{{\r\n node()!.hasChildren === true || node()!.hasChildren === undefined\r\n ? node()?.expanded\r\n ? \"expand_less\"\r\n : \"expand_more\"\r\n : \"stop\"\r\n }}</mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { 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:
181
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: BrowserTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
182
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", 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()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>\r\n @if (node()!.hasChildren === true) { @if (node()!.expanded) {\r\n chevron_left } @else { chevron_right } } @else { stop }\r\n </mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { 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: "component", type:
185
183
  // local
186
- CompactPagerComponent, selector: "pdb-compact-pager", inputs: ["paging"], outputs: ["pagingChange"] }, { kind: "component", type: RangeViewComponent, selector: "pdb-range-view", inputs: ["domain", "range", "width", "height"] }] }); }
184
+ CompactPagerComponent, selector: "pdb-compact-pager", inputs: ["paging"], outputs: ["pagingChange"] }, { kind: "component", type: RangeViewComponent, selector: "pdb-range-view", inputs: ["domain", "range", "width", "height"] }, { kind: "pipe", type:
185
+ // ngx-tools
186
+ ColorToContrastPipe, name: "colorToContrast" }, { kind: "pipe", type: StringToColorPipe, name: "stringToColor" }] }); }
187
187
  }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BrowserTreeNodeComponent, decorators: [{
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: BrowserTreeNodeComponent, decorators: [{
189
189
  type: Component,
190
190
  args: [{ selector: 'pdb-browser-tree-node', imports: [
191
191
  CommonModule,
@@ -199,7 +199,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
199
199
  // local
200
200
  CompactPagerComponent,
201
201
  RangeViewComponent,
202
- ], template: "@if (node()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>{{\r\n node()!.hasChildren === true || node()!.hasChildren === undefined\r\n ? node()?.expanded\r\n ? \"expand_less\"\r\n : \"expand_more\"\r\n : \"stop\"\r\n }}</mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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"] }]
202
+ ], template: "@if (node()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>\r\n @if (node()!.hasChildren === true) { @if (node()!.expanded) {\r\n chevron_left } @else { chevron_right } } @else { stop }\r\n </mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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
203
  }] });
204
204
 
205
205
  /**
@@ -739,39 +739,42 @@ class PagedTreeStore {
739
739
  * descendants of all the root level nodes.
740
740
  * @returns Promise.
741
741
  */
742
- expandAll(id) {
742
+ async expandAll(id) {
743
743
  if (id === undefined) {
744
744
  // for each root level node call expandAll
745
745
  const nodes = [...this._nodes$.value];
746
- let i = 0;
747
- while (i < nodes.length) {
748
- if (nodes[i].parentId === undefined) {
749
- this.expandAll(nodes[i].id);
746
+ const promises = [];
747
+ for (const node of nodes) {
748
+ if (node.parentId === undefined) {
749
+ promises.push(this.expandAll(node.id));
750
750
  }
751
- i++;
752
751
  }
753
- return Promise.resolve(true);
752
+ await Promise.all(promises);
753
+ return true;
754
754
  }
755
755
  // get the parent node to start from
756
756
  const nodes = this._nodes$.value;
757
757
  const nodeIndex = nodes.findIndex((n) => n.id === id);
758
758
  if (nodeIndex === -1) {
759
- return Promise.resolve(false);
759
+ return false;
760
760
  }
761
- // collect all the descendant nodes IDs
762
- let i = nodeIndex + 1;
763
- while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {
764
- i++;
761
+ const node = nodes[nodeIndex];
762
+ // first expand this node if it has children and isn't already expanded
763
+ if (node.hasChildren && !node.expanded) {
764
+ await this.expand(id);
765
765
  }
766
- const nodesToExpand = nodes.slice(nodeIndex, i).map((n) => n.id);
767
- // expand all the descendant nodes
768
- return new Promise((resolve, reject) => {
769
- nodesToExpand.forEach((id) => {
770
- this.expand(id);
771
- this.expandAll(id);
772
- });
773
- resolve(true);
774
- });
766
+ // then expand all its immediate children recursively
767
+ const children = this.getChildren(id);
768
+ const promises = [];
769
+ for (const child of children) {
770
+ if (child.hasChildren) {
771
+ promises.push(this.expandAll(child.id));
772
+ }
773
+ }
774
+ if (promises.length > 0) {
775
+ await Promise.all(promises);
776
+ }
777
+ return true;
775
778
  }
776
779
  getChildren(id) {
777
780
  const node = this._nodes$.value.find((n) => n.id === id);
@@ -929,6 +932,108 @@ class PagedTreeStore {
929
932
  const key = this.buildCacheKey(pageNumber, filter);
930
933
  return this._cache.has(key);
931
934
  }
935
+ /**
936
+ * Remove all hilite properties from all nodes in the store.
937
+ */
938
+ removeHilites() {
939
+ const nodes = this._nodes$.value;
940
+ nodes.forEach((node) => {
941
+ node.hilite = undefined;
942
+ });
943
+ this._nodes$.next(nodes);
944
+ }
945
+ /**
946
+ * Find all nodes whose labels include the specified search text,
947
+ * highlight them, and ensure they are visible by expanding their ancestors.
948
+ * @param searchText The text to search for in node labels (case-insensitive).
949
+ * @returns Promise that resolves when all matching nodes are highlighted and visible.
950
+ */
951
+ async findLabels(searchText) {
952
+ if (!searchText || searchText.trim().length === 0) {
953
+ this.removeHilites();
954
+ return;
955
+ }
956
+ // First remove all existing hilites
957
+ this.removeHilites();
958
+ const searchLower = searchText.toLowerCase();
959
+ const matchingNodes = [];
960
+ // Find all matching nodes (including those not currently visible)
961
+ // We need to search through all possible nodes, not just visible ones
962
+ await this.searchAllNodes(searchLower, matchingNodes);
963
+ // Highlight the matching nodes
964
+ matchingNodes.forEach((node) => {
965
+ node.hilite = true;
966
+ });
967
+ // Ensure all matching nodes are visible by expanding their ancestor paths
968
+ const expansionPromises = [];
969
+ for (const node of matchingNodes) {
970
+ expansionPromises.push(this.ensureNodeVisible(node.id));
971
+ }
972
+ await Promise.all(expansionPromises);
973
+ // Update the nodes observable
974
+ this._nodes$.next(this._nodes$.value);
975
+ }
976
+ /**
977
+ * Search through all nodes recursively to find matches, including nodes
978
+ * that are not currently loaded/visible.
979
+ * @param searchLower The search text in lowercase.
980
+ * @param matchingNodes Array to collect matching nodes.
981
+ */
982
+ async searchAllNodes(searchLower, matchingNodes) {
983
+ // Start with root nodes
984
+ const rootNodes = this._nodes$.value.filter((n) => n.parentId === undefined);
985
+ for (const rootNode of rootNodes) {
986
+ await this.searchNodeAndDescendants(rootNode, searchLower, matchingNodes);
987
+ }
988
+ }
989
+ /**
990
+ * Recursively search a node and all its descendants for label matches.
991
+ * @param node The node to search.
992
+ * @param searchLower The search text in lowercase.
993
+ * @param matchingNodes Array to collect matching nodes.
994
+ */
995
+ async searchNodeAndDescendants(node, searchLower, matchingNodes) {
996
+ // Check if current node matches
997
+ if (node.label.toLowerCase().includes(searchLower)) {
998
+ matchingNodes.push(node);
999
+ }
1000
+ // If node has children, we need to load them to search through them
1001
+ if (node.hasChildren) {
1002
+ // Expand the node if not already expanded to load its children
1003
+ if (!node.expanded) {
1004
+ await this.expand(node.id);
1005
+ }
1006
+ // Get all direct children and search them recursively
1007
+ const children = this.getChildren(node.id);
1008
+ for (const child of children) {
1009
+ await this.searchNodeAndDescendants(child, searchLower, matchingNodes);
1010
+ }
1011
+ }
1012
+ }
1013
+ /**
1014
+ * Ensure a node is visible by expanding all its ancestors.
1015
+ * @param nodeId The ID of the node to make visible.
1016
+ */
1017
+ async ensureNodeVisible(nodeId) {
1018
+ const node = this._nodes$.value.find((n) => n.id === nodeId);
1019
+ if (!node) {
1020
+ return;
1021
+ }
1022
+ // Find the path from root to this node
1023
+ const ancestorPath = [];
1024
+ let currentNode = node;
1025
+ while (currentNode && currentNode.parentId !== undefined) {
1026
+ ancestorPath.unshift(currentNode.parentId);
1027
+ currentNode = this._nodes$.value.find((n) => n.id === currentNode.parentId);
1028
+ }
1029
+ // Expand all ancestors in order
1030
+ for (const ancestorId of ancestorPath) {
1031
+ const ancestor = this._nodes$.value.find((n) => n.id === ancestorId);
1032
+ if (ancestor && ancestor.hasChildren && !ancestor.expanded) {
1033
+ await this.expand(ancestorId);
1034
+ }
1035
+ }
1036
+ }
932
1037
  }
933
1038
 
934
1039
  /*
@@ -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/public-api.ts","../../../../projects/myrmidon/paged-data-browsers/src/myrmidon-paged-data-browsers.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\n\r\nimport { PagingInfo } from '../../services/paged-tree.store';\r\n\r\n@Component({\r\n selector: 'pdb-compact-pager',\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n templateUrl: './compact-pager.component.html',\r\n styleUrls: ['./compact-pager.component.scss'],\r\n})\r\nexport class CompactPagerComponent {\r\n public paging = input<PagingInfo>({ pageNumber: 0, pageCount: 0, total: 0 });\r\n\r\n /**\r\n * Emits the new paging information when the user changes the page.\r\n */\r\n public readonly pagingChange = output<PagingInfo>();\r\n\r\n public onFirst(): void {\r\n this.pagingChange.emit({ ...this.paging(), pageNumber: 1 });\r\n }\r\n\r\n public onPrevious(): void {\r\n if (this.paging().pageNumber > 1) {\r\n this.pagingChange.emit({\r\n ...this.paging(),\r\n pageNumber: this.paging().pageNumber - 1,\r\n });\r\n }\r\n }\r\n\r\n public onNext(): void {\r\n if (this.paging().pageNumber < this.paging().pageCount) {\r\n this.pagingChange.emit({\r\n ...this.paging(),\r\n pageNumber: this.paging().pageNumber + 1,\r\n });\r\n }\r\n }\r\n\r\n public onLast(): void {\r\n if (this.paging().pageNumber < this.paging().pageCount) {\r\n this.pagingChange.emit({\r\n ...this.paging(),\r\n pageNumber: this.paging().pageCount,\r\n });\r\n }\r\n }\r\n}\r\n","@if (paging().pageCount) {\r\n <div class=\"form-row\">\r\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onFirst()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>first_page</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onPrevious()\"\r\n [disabled]=\"paging().pageNumber < 2\"\r\n >\r\n <mat-icon>navigate_before</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onNext()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>navigate_next</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n (click)=\"onLast()\"\r\n [disabled]=\"paging().pageNumber === paging().pageCount\"\r\n >\r\n <mat-icon>last_page</mat-icon>\r\n </button>\r\n <span id=\"total\">{{ paging().total }} </span>\r\n </div>\r\n}\r\n","import { Component, computed, input, signal } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'pdb-range-view',\r\n templateUrl: './range-view.component.html',\r\n styleUrls: ['./range-view.component.scss'],\r\n})\r\nexport class RangeViewComponent {\r\n /**\r\n * The domain of the range view (start, limit).\r\n */\r\n public domain = input([0, 100]);\r\n /**\r\n * The range of the range view (start, limit).\r\n */\r\n public range = input([0, 100]);\r\n /**\r\n * The width of the component.\r\n */\r\n public width = input(100);\r\n /**\r\n * The height of the component.\r\n */\r\n public height = input(5);\r\n\r\n public scaledRange = computed(() => {\r\n const domain = this.domain();\r\n const range = this.range();\r\n const width = this.width();\r\n\r\n const domainWidth = domain[1] - domain[0];\r\n const rangeWidth = range[1] - range[0];\r\n const rangeStart = range[0] - domain[0];\r\n\r\n return [\r\n (rangeStart / domainWidth) * width,\r\n ((rangeStart + rangeWidth) / domainWidth) * width,\r\n ];\r\n });\r\n\r\n constructor() {}\r\n}\r\n","<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\r\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\r\n <rect\r\n id=\"rrange\"\r\n [attr.x]=\"scaledRange()[0]\"\r\n [attr.y]=\"0\"\r\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\r\n [attr.height]=\"height()\"\r\n />\r\n</svg>\r\n","import { Component, input, output } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatBadgeModule } from '@angular/material/badge';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\nimport { ColorToContrastPipe, StringToColorPipe } from '@myrmidon/ngx-tools';\r\n\r\nimport { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';\r\nimport { CompactPagerComponent } from '../compact-pager/compact-pager.component';\r\nimport { RangeViewComponent } from '../range-view/range-view.component';\r\n\r\n/**\r\n * A request to change the page number of a node's children.\r\n */\r\nexport interface PageChangeRequest {\r\n node: PagedTreeNode<any>;\r\n paging: PagingInfo;\r\n}\r\n\r\n/**\r\n * Browser tree node component view. This wraps some HTML content providing\r\n * a toggle button to expand/collapse the node, a paging control for the\r\n * node's children, and a button to edit the node's filter. You should then\r\n * provide the HTML content to display the node's data inside this component, e.g.\r\n * <pdb-browser-tree-node [node]=\"node\">\r\n * <your-node-view [node]=\"node\" />\r\n * <pdb-browser-tree-node>\r\n */\r\n@Component({\r\n selector: 'pdb-browser-tree-node',\r\n imports: [\r\n CommonModule,\r\n MatBadgeModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n // ngx-tools\r\n ColorToContrastPipe,\r\n StringToColorPipe,\r\n // local\r\n CompactPagerComponent,\r\n RangeViewComponent,\r\n ],\r\n templateUrl: './browser-tree-node.component.html',\r\n styleUrls: ['./browser-tree-node.component.css'],\r\n})\r\nexport class BrowserTreeNodeComponent {\r\n /**\r\n * The node to display.\r\n */\r\n public readonly node = input<PagedTreeNode<any> | undefined | null>();\r\n\r\n /**\r\n * The paging information for the node's children.\r\n */\r\n public readonly paging = input<PagingInfo>();\r\n\r\n /**\r\n * True to show debug information.\r\n */\r\n public readonly debug = input<boolean>();\r\n\r\n /**\r\n * True to hide the node's loc and label. This is useful if you want to\r\n * provide your own view for the node, between the expansion toggle and\r\n * the filter edit button. In this case, in your consumer template provide\r\n * your own view as the content of this component. If instead you are fine\r\n * with the default loc and label, and just want to add more data to\r\n * the view, then you can just add your own content to this component's\r\n * template, without setting this property to true.\r\n */\r\n public readonly hideLabel = input<boolean>();\r\n\r\n /**\r\n * True to hide the node's location (y and x).\r\n */\r\n public readonly hideLoc = input<boolean>();\r\n\r\n /**\r\n * True to hide the node's paging control unless hovered.\r\n */\r\n public readonly hidePaging = input<boolean>();\r\n\r\n /**\r\n * True to hide the node's filter edit button.\r\n */\r\n public readonly hideFilter = input<boolean>();\r\n\r\n /**\r\n * The indent size for the node's children.\r\n */\r\n public readonly indentSize = input(30);\r\n\r\n /**\r\n * The width of the range view.\r\n */\r\n public readonly rangeWidth = input(250);\r\n\r\n /**\r\n * Emits when the user wants to toggle the expanded state of the node.\r\n */\r\n public readonly toggleExpandedRequest = output<PagedTreeNode<any>>();\r\n\r\n /**\r\n * Emits when the user wants to change the page number of the node's children.\r\n */\r\n public readonly changePageRequest = output<PageChangeRequest>();\r\n\r\n /**\r\n * Emits when the user wants to edit the node's filter.\r\n */\r\n public readonly editNodeFilterRequest = output<PagedTreeNode<any>>();\r\n\r\n public onToggleExpanded(): void {\r\n if (!this.node()) {\r\n return;\r\n }\r\n this.toggleExpandedRequest.emit(this.node() as PagedTreeNode<any>);\r\n }\r\n\r\n public onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void {\r\n this.changePageRequest.emit({\r\n node,\r\n paging,\r\n });\r\n }\r\n\r\n public onEditFilter(): void {\r\n if (this.node()) {\r\n this.editNodeFilterRequest.emit(this.node() as PagedTreeNode<any>);\r\n }\r\n }\r\n}\r\n","@if (node()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>{{\r\n node()!.hasChildren === true || node()!.hasChildren === undefined\r\n ? node()?.expanded\r\n ? \"expand_less\"\r\n : \"expand_more\"\r\n : \"stop\"\r\n }}</mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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 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 return;\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","/*\r\n * Public API Surface of paged-data-browsers\r\n */\r\n\r\nexport * from './lib/components/compact-pager/compact-pager.component';\r\nexport * from './lib/components/range-view/range-view.component';\r\nexport * from './lib/components/browser-tree-node/browser-tree-node.component';\r\n\r\nexport * from './lib/services/paged-list.store';\r\nexport * from './lib/services/paged-tree.store';\r\nexport * from './lib/services/lru-cache';\r\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,CAAC,UAAU,GAAG,CAAC;AACzC,aAAA,CAAC;;;IAIC,MAAM,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,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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;;ACpmBD;;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';\r\n\r\n@Component({\r\n selector: 'pdb-range-view',\r\n templateUrl: './range-view.component.html',\r\n styleUrls: ['./range-view.component.scss'],\r\n})\r\nexport class RangeViewComponent {\r\n /**\r\n * The domain of the range view (start, limit).\r\n */\r\n public domain = input([0, 100]);\r\n /**\r\n * The range of the range view (start, limit).\r\n */\r\n public range = input([0, 100]);\r\n /**\r\n * The width of the component.\r\n */\r\n public width = input(100);\r\n /**\r\n * The height of the component.\r\n */\r\n public height = input(5);\r\n\r\n public scaledRange = computed(() => {\r\n const domain = this.domain();\r\n const range = this.range();\r\n const width = this.width();\r\n\r\n const domainWidth = domain[1] - domain[0];\r\n const rangeWidth = range[1] - range[0];\r\n const rangeStart = range[0] - domain[0];\r\n\r\n return [\r\n (rangeStart / domainWidth) * width,\r\n ((rangeStart + rangeWidth) / domainWidth) * width,\r\n ];\r\n });\r\n\r\n constructor() {}\r\n}\r\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()) {\r\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\r\n <!-- pager -->\r\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\r\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\r\n <pdb-compact-pager\r\n [paging]=\"paging()!\"\r\n (pagingChange)=\"onPagingChange(node()!, $event)\"\r\n />\r\n <pdb-range-view\r\n [width]=\"rangeWidth()\"\r\n [domain]=\"[0, paging()!.pageCount]\"\r\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\r\n />\r\n </div>\r\n }\r\n <!-- node -->\r\n <div class=\"form-row\">\r\n <!-- expand/collapse button -->\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\r\n i18n-matTooltip\r\n [disabled]=\"node()!.hasChildren === false\"\r\n (click)=\"onToggleExpanded()\"\r\n >\r\n <mat-icon class=\"mat-primary\" i18n>\r\n @if (node()!.hasChildren === true) { @if (node()!.expanded) {\r\n chevron_left } @else { chevron_right } } @else { stop }\r\n </mat-icon>\r\n </button>\r\n\r\n <!-- tag -->\r\n @if (!hideLabel()) {\r\n <span\r\n class=\"tag\"\r\n [ngStyle]=\"{\r\n 'background-color': (node()!.tag | stringToColor),\r\n color: node()!.tag | stringToColor | colorToContrast\r\n }\"\r\n >{{ node()!.tag }}</span\r\n >\r\n\r\n <!-- loc and label -->\r\n @if (!hideLoc()) {\r\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\r\n {{ node()!.label }}\r\n }\r\n\r\n <!-- PROJECTED NODE -->\r\n <ng-content></ng-content>\r\n\r\n <!-- debug -->\r\n @if (debug()) {\r\n <span class=\"debug\"\r\n >#{{ node()!.id }}\r\n <span\r\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\r\n node()!.paging.total\r\n }})</span\r\n ></span\r\n >\r\n }\r\n\r\n <!-- filter -->\r\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matTooltip=\"Add filter\"\r\n i18n-matTooltip\r\n (click)=\"onEditFilter()\"\r\n >\r\n <mat-icon>filter_list</mat-icon>\r\n </button>\r\n </div>\r\n } @if (node()?.filter && node()?.y) {\r\n <div class=\"muted\">\r\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\r\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\r\n </button>\r\n </div>\r\n } }\r\n </div>\r\n</div>\r\n}\r\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 hilite?: 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 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 return;\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 async 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 const promises: Promise<boolean>[] = [];\r\n for (const node of nodes) {\r\n if (node.parentId === undefined) {\r\n promises.push(this.expandAll(node.id));\r\n }\r\n }\r\n await Promise.all(promises);\r\n return 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 false;\r\n }\r\n\r\n const node = nodes[nodeIndex];\r\n\r\n // first expand this node if it has children and isn't already expanded\r\n if (node.hasChildren && !node.expanded) {\r\n await this.expand(id);\r\n }\r\n\r\n // then expand all its immediate children recursively\r\n const children = this.getChildren(id);\r\n const promises: Promise<boolean>[] = [];\r\n for (const child of children) {\r\n if (child.hasChildren) {\r\n promises.push(this.expandAll(child.id));\r\n }\r\n }\r\n\r\n if (promises.length > 0) {\r\n await Promise.all(promises);\r\n }\r\n\r\n return true;\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 /**\r\n * Remove all hilite properties from all nodes in the store.\r\n */\r\n public removeHilites(): void {\r\n const nodes = this._nodes$.value;\r\n nodes.forEach((node) => {\r\n node.hilite = undefined;\r\n });\r\n this._nodes$.next(nodes);\r\n }\r\n\r\n /**\r\n * Find all nodes whose labels include the specified search text,\r\n * highlight them, and ensure they are visible by expanding their ancestors.\r\n * @param searchText The text to search for in node labels (case-insensitive).\r\n * @returns Promise that resolves when all matching nodes are highlighted and visible.\r\n */\r\n public async findLabels(searchText: string): Promise<void> {\r\n if (!searchText || searchText.trim().length === 0) {\r\n this.removeHilites();\r\n return;\r\n }\r\n\r\n // First remove all existing hilites\r\n this.removeHilites();\r\n\r\n const searchLower = searchText.toLowerCase();\r\n const matchingNodes: E[] = [];\r\n\r\n // Find all matching nodes (including those not currently visible)\r\n // We need to search through all possible nodes, not just visible ones\r\n await this.searchAllNodes(searchLower, matchingNodes);\r\n\r\n // Highlight the matching nodes\r\n matchingNodes.forEach((node) => {\r\n node.hilite = true;\r\n });\r\n\r\n // Ensure all matching nodes are visible by expanding their ancestor paths\r\n const expansionPromises: Promise<void>[] = [];\r\n for (const node of matchingNodes) {\r\n expansionPromises.push(this.ensureNodeVisible(node.id));\r\n }\r\n\r\n await Promise.all(expansionPromises);\r\n\r\n // Update the nodes observable\r\n this._nodes$.next(this._nodes$.value);\r\n }\r\n\r\n /**\r\n * Search through all nodes recursively to find matches, including nodes\r\n * that are not currently loaded/visible.\r\n * @param searchLower The search text in lowercase.\r\n * @param matchingNodes Array to collect matching nodes.\r\n */\r\n private async searchAllNodes(\r\n searchLower: string,\r\n matchingNodes: E[]\r\n ): Promise<void> {\r\n // Start with root nodes\r\n const rootNodes = this._nodes$.value.filter(\r\n (n) => n.parentId === undefined\r\n );\r\n\r\n for (const rootNode of rootNodes) {\r\n await this.searchNodeAndDescendants(rootNode, searchLower, matchingNodes);\r\n }\r\n }\r\n\r\n /**\r\n * Recursively search a node and all its descendants for label matches.\r\n * @param node The node to search.\r\n * @param searchLower The search text in lowercase.\r\n * @param matchingNodes Array to collect matching nodes.\r\n */\r\n private async searchNodeAndDescendants(\r\n node: E,\r\n searchLower: string,\r\n matchingNodes: E[]\r\n ): Promise<void> {\r\n // Check if current node matches\r\n if (node.label.toLowerCase().includes(searchLower)) {\r\n matchingNodes.push(node);\r\n }\r\n\r\n // If node has children, we need to load them to search through them\r\n if (node.hasChildren) {\r\n // Expand the node if not already expanded to load its children\r\n if (!node.expanded) {\r\n await this.expand(node.id);\r\n }\r\n\r\n // Get all direct children and search them recursively\r\n const children = this.getChildren(node.id);\r\n for (const child of children) {\r\n await this.searchNodeAndDescendants(child, searchLower, matchingNodes);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Ensure a node is visible by expanding all its ancestors.\r\n * @param nodeId The ID of the node to make visible.\r\n */\r\n private async ensureNodeVisible(nodeId: number): Promise<void> {\r\n const node = this._nodes$.value.find((n) => n.id === nodeId);\r\n if (!node) {\r\n return;\r\n }\r\n\r\n // Find the path from root to this node\r\n const ancestorPath: number[] = [];\r\n let currentNode: PagedTreeNode<F> | undefined = node;\r\n\r\n while (currentNode && currentNode.parentId !== undefined) {\r\n ancestorPath.unshift(currentNode.parentId);\r\n currentNode = this._nodes$.value.find(\r\n (n) => n.id === currentNode!.parentId\r\n );\r\n }\r\n\r\n // Expand all ancestors in order\r\n for (const ancestorId of ancestorPath) {\r\n const ancestor = this._nodes$.value.find((n) => n.id === ancestorId);\r\n if (ancestor && ancestor.hasChildren && !ancestor.expanded) {\r\n await this.expand(ancestorId);\r\n }\r\n }\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,kDAAC;AAE5E;;AAEG;QACa,IAAA,CAAA,YAAY,GAAG,MAAM,EAAc;AAgCpD,IAAA;IA9BQ,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IAC7D;IAEO,UAAU,GAAA;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AK,CAAC,IAAI,CACnC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,WAAY,CAAC,QAAQ,CACtC;QACH;;AAGA,QAAA,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC;YACpE,IAAI,QAAQ,IAAI,QAAQ,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AAC1D,gBAAA,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;YAC/B;QACF;IACF;AACD;;AC9uBD;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -14,6 +14,7 @@ interface TreeNode {
14
14
  label: string;
15
15
  tag?: string;
16
16
  hasChildren?: boolean;
17
+ hilite?: boolean;
17
18
  }
18
19
  /**
19
20
  * A filter for tree nodes.
@@ -241,6 +242,36 @@ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilte
241
242
  * @returns True if the page is in cache, false otherwise.
242
243
  */
243
244
  hasCachedPage(pageNumber: number, filter: F): boolean;
245
+ /**
246
+ * Remove all hilite properties from all nodes in the store.
247
+ */
248
+ removeHilites(): void;
249
+ /**
250
+ * Find all nodes whose labels include the specified search text,
251
+ * highlight them, and ensure they are visible by expanding their ancestors.
252
+ * @param searchText The text to search for in node labels (case-insensitive).
253
+ * @returns Promise that resolves when all matching nodes are highlighted and visible.
254
+ */
255
+ findLabels(searchText: string): Promise<void>;
256
+ /**
257
+ * Search through all nodes recursively to find matches, including nodes
258
+ * that are not currently loaded/visible.
259
+ * @param searchLower The search text in lowercase.
260
+ * @param matchingNodes Array to collect matching nodes.
261
+ */
262
+ private searchAllNodes;
263
+ /**
264
+ * Recursively search a node and all its descendants for label matches.
265
+ * @param node The node to search.
266
+ * @param searchLower The search text in lowercase.
267
+ * @param matchingNodes Array to collect matching nodes.
268
+ */
269
+ private searchNodeAndDescendants;
270
+ /**
271
+ * Ensure a node is visible by expanding all its ancestors.
272
+ * @param nodeId The ID of the node to make visible.
273
+ */
274
+ private ensureNodeVisible;
244
275
  }
245
276
 
246
277
  declare class CompactPagerComponent {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/paged-data-browsers",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "Generic simple paged data browsers.",
5
5
  "keywords": [
6
6
  "data browsers"