@myrmidon/paged-data-browsers 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,6 +144,10 @@ class BrowserTreeNodeComponent {
|
|
|
144
144
|
* The indent size for the node's children.
|
|
145
145
|
*/
|
|
146
146
|
this.indentSize = input(30);
|
|
147
|
+
/**
|
|
148
|
+
* The width of the range view.
|
|
149
|
+
*/
|
|
150
|
+
this.rangeWidth = input(250);
|
|
147
151
|
/**
|
|
148
152
|
* Emits when the user wants to toggle the expanded state of the node.
|
|
149
153
|
*/
|
|
@@ -175,7 +179,7 @@ class BrowserTreeNodeComponent {
|
|
|
175
179
|
}
|
|
176
180
|
}
|
|
177
181
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: BrowserTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: BrowserTreeNodeComponent, isStandalone: true, selector: "pdb-browser-tree-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, paging: { classPropertyName: "paging", publicName: "paging", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, hideLoc: { classPropertyName: "hideLoc", publicName: "hideLoc", isSignal: true, isRequired: false, transformFunction: null }, hidePaging: { classPropertyName: "hidePaging", publicName: "hidePaging", isSignal: true, isRequired: false, transformFunction: null }, hideFilter: { classPropertyName: "hideFilter", publicName: "hideFilter", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleExpandedRequest: "toggleExpandedRequest", changePageRequest: "changePageRequest", editNodeFilterRequest: "editNodeFilterRequest" }, ngImport: i0, template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"
|
|
182
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: BrowserTreeNodeComponent, isStandalone: true, selector: "pdb-browser-tree-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, paging: { classPropertyName: "paging", publicName: "paging", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, hideLoc: { classPropertyName: "hideLoc", publicName: "hideLoc", isSignal: true, isRequired: false, transformFunction: null }, hidePaging: { classPropertyName: "hidePaging", publicName: "hidePaging", isSignal: true, isRequired: false, transformFunction: null }, hideFilter: { classPropertyName: "hideFilter", publicName: "hideFilter", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, rangeWidth: { classPropertyName: "rangeWidth", publicName: "rangeWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleExpandedRequest: "toggleExpandedRequest", changePageRequest: "changePageRequest", editNodeFilterRequest: "editNodeFilterRequest" }, ngImport: i0, template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n", styles: [":root{--browser-tree-node-margin-bottom: 4px;--browser-tree-node-padding: 4px 6px;--browser-tree-node-border: 1px solid #98a8d4;--browser-tree-node-border-radius: 6px;--browser-tree-node-hover-bg-color: #d6dee9}#node{margin-bottom:var(--browser-tree-node-margin-bottom);padding:var(--browser-tree-node-padding);border:var(--browser-tree-node-border);border-radius:var(--browser-tree-node-border-radius)}#node:hover{background-color:var(--browser-tree-node-hover-bg-color)}.form-row{display:flex;gap:8px;align-items:center}.form-row *{flex:0 0 auto}.form-row span{flex:0 1 auto;white-space:normal}#node #pager{display:none}#node:hover #pager{display:block}span.loc{font-size:.85em;color:#666;vertical-align:middle}span.tag{border:1px solid #aaa;border-radius:4px;padding:0 4px}fieldset{border:1px solid silver;border-radius:6px;padding:4px 6px;margin:4px 0}legend{color:silver}.muted{opacity:.3}.muted:hover{opacity:1}.debug{font-size:.85em;color:#9c3d3e}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i2$1.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type:
|
|
179
183
|
// ngx-tools
|
|
180
184
|
ColorToContrastPipe, name: "colorToContrast" }, { kind: "pipe", type: StringToColorPipe, name: "stringToColor" }, { kind: "component", type:
|
|
181
185
|
// local
|
|
@@ -195,7 +199,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
195
199
|
// local
|
|
196
200
|
CompactPagerComponent,
|
|
197
201
|
RangeViewComponent,
|
|
198
|
-
], template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"
|
|
202
|
+
], template: "@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n", styles: [":root{--browser-tree-node-margin-bottom: 4px;--browser-tree-node-padding: 4px 6px;--browser-tree-node-border: 1px solid #98a8d4;--browser-tree-node-border-radius: 6px;--browser-tree-node-hover-bg-color: #d6dee9}#node{margin-bottom:var(--browser-tree-node-margin-bottom);padding:var(--browser-tree-node-padding);border:var(--browser-tree-node-border);border-radius:var(--browser-tree-node-border-radius)}#node:hover{background-color:var(--browser-tree-node-hover-bg-color)}.form-row{display:flex;gap:8px;align-items:center}.form-row *{flex:0 0 auto}.form-row span{flex:0 1 auto;white-space:normal}#node #pager{display:none}#node:hover #pager{display:block}span.loc{font-size:.85em;color:#666;vertical-align:middle}span.tag{border:1px solid #aaa;border-radius:4px;padding:0 4px}fieldset{border:1px solid silver;border-radius:6px;padding:4px 6px;margin:4px 0}legend{color:silver}.muted{opacity:.3}.muted:hover{opacity:1}.debug{font-size:.85em;color:#9c3d3e}\n"] }]
|
|
199
203
|
}] });
|
|
200
204
|
|
|
201
205
|
/**
|
|
@@ -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';\n\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { PagingInfo } from '../../services/paged-tree.store';\n\n@Component({\n selector: 'pdb-compact-pager',\n imports: [CommonModule, MatButtonModule, MatIconModule],\n templateUrl: './compact-pager.component.html',\n styleUrls: ['./compact-pager.component.scss'],\n})\nexport class CompactPagerComponent {\n public paging = input<PagingInfo>({ pageNumber: 0, pageCount: 0, total: 0 });\n\n /**\n * Emits the new paging information when the user changes the page.\n */\n public readonly pagingChange = output<PagingInfo>();\n\n public onFirst(): void {\n this.pagingChange.emit({ ...this.paging(), pageNumber: 1 });\n }\n\n public onPrevious(): void {\n if (this.paging().pageNumber > 1) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber - 1,\n });\n }\n }\n\n public onNext(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber + 1,\n });\n }\n }\n\n public onLast(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageCount,\n });\n }\n }\n}\n","@if (paging().pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging().total }} </span>\n </div>\n}\n","import { Component, computed, input, signal } from '@angular/core';\n\n@Component({\n selector: 'pdb-range-view',\n templateUrl: './range-view.component.html',\n styleUrls: ['./range-view.component.scss'],\n})\nexport class RangeViewComponent {\n /**\n * The domain of the range view (start, limit).\n */\n public domain = input([0, 100]);\n /**\n * The range of the range view (start, limit).\n */\n public range = input([0, 100]);\n /**\n * The width of the component.\n */\n public width = input(100);\n /**\n * The height of the component.\n */\n public height = input(5);\n\n public scaledRange = computed(() => {\n const domain = this.domain();\n const range = this.range();\n const width = this.width();\n\n const domainWidth = domain[1] - domain[0];\n const rangeWidth = range[1] - range[0];\n const rangeStart = range[0] - domain[0];\n\n return [\n (rangeStart / domainWidth) * width,\n ((rangeStart + rangeWidth) / domainWidth) * width,\n ];\n });\n\n constructor() {}\n}\n","<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange()[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\n [attr.height]=\"height()\"\n />\n</svg>\n","import { Component, input, output } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { MatBadgeModule } from '@angular/material/badge';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { ColorToContrastPipe, StringToColorPipe } from '@myrmidon/ngx-tools';\n\nimport { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';\nimport { CompactPagerComponent } from '../compact-pager/compact-pager.component';\nimport { RangeViewComponent } from '../range-view/range-view.component';\n\n/**\n * A request to change the page number of a node's children.\n */\nexport interface PageChangeRequest {\n node: PagedTreeNode<any>;\n paging: PagingInfo;\n}\n\n/**\n * Browser tree node component view. This wraps some HTML content providing\n * a toggle button to expand/collapse the node, a paging control for the\n * node's children, and a button to edit the node's filter. You should then\n * provide the HTML content to display the node's data inside this component, e.g.\n * <pdb-browser-tree-node [node]=\"node\">\n * <your-node-view [node]=\"node\" />\n * <pdb-browser-tree-node>\n */\n@Component({\n selector: 'pdb-browser-tree-node',\n imports: [\n CommonModule,\n MatBadgeModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule,\n // ngx-tools\n ColorToContrastPipe,\n StringToColorPipe,\n // local\n CompactPagerComponent,\n RangeViewComponent,\n ],\n templateUrl: './browser-tree-node.component.html',\n styleUrls: ['./browser-tree-node.component.css'],\n})\nexport class BrowserTreeNodeComponent {\n /**\n * The node to display.\n */\n public readonly node = input<PagedTreeNode<any> | undefined | null>();\n\n /**\n * The paging information for the node's children.\n */\n public readonly paging = input<PagingInfo>();\n\n /**\n * True to show debug information.\n */\n public readonly debug = input<boolean>();\n\n /**\n * True to hide the node's loc and label. This is useful if you want to\n * provide your own view for the node, between the expansion toggle and\n * the filter edit button. In this case, in your consumer template provide\n * your own view as the content of this component. If instead you are fine\n * with the default loc and label, and just want to add more data to\n * the view, then you can just add your own content to this component's\n * template, without setting this property to true.\n */\n public readonly hideLabel = input<boolean>();\n\n /**\n * True to hide the node's location (y and x).\n */\n public readonly hideLoc = input<boolean>();\n\n /**\n * True to hide the node's paging control unless hovered.\n */\n public readonly hidePaging = input<boolean>();\n\n /**\n * True to hide the node's filter edit button.\n */\n public readonly hideFilter = input<boolean>();\n\n /**\n * The indent size for the node's children.\n */\n public readonly indentSize = input(30);\n\n /**\n * Emits when the user wants to toggle the expanded state of the node.\n */\n public readonly toggleExpandedRequest = output<PagedTreeNode<any>>();\n\n /**\n * Emits when the user wants to change the page number of the node's children.\n */\n public readonly changePageRequest = output<PageChangeRequest>();\n\n /**\n * Emits when the user wants to edit the node's filter.\n */\n public readonly editNodeFilterRequest = output<PagedTreeNode<any>>();\n\n public onToggleExpanded(): void {\n if (!this.node()) {\n return;\n }\n this.toggleExpandedRequest.emit(this.node() as PagedTreeNode<any>);\n }\n\n public onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void {\n this.changePageRequest.emit({\n node,\n paging,\n });\n }\n\n public onEditFilter(): void {\n if (this.node()) {\n this.editNodeFilterRequest.emit(this.node() as PagedTreeNode<any>);\n }\n }\n}\n","@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"250\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n","/**\r\n * A Least Recently Used cache that can be used to store any type of object.\r\n * The cache works in two modes: considering the size of the objects or not.\r\n * If the size is considered, the cache will have a maximum size and will\r\n * remove the oldest objects when the maximum size is reached. Note that\r\n * the size is only roughly estimated. This avoids removing too many\r\n * entries from the cache when the maximum is reached.\r\n * If the size is not considered, the cache will have a maximum number of\r\n * objects and will remove the oldest objects when the maximum number is\r\n * reached.\r\n */\r\nexport class LRUCache<T> {\r\n private _maxSize: number;\r\n private _totalSize: number;\r\n private _considerSize: boolean;\r\n private _cache: Map<string, T>;\r\n private _sizes: Map<string, number>;\r\n\r\n /**\r\n * Creates a new cache.\r\n * @param maxSize The maximum size of the cache. This is either\r\n * the maximum number of items in the cache (when considerSize\r\n * is false) or the maximum total size of all items in the\r\n * cache in bytes (when considerSize is true).\r\n * @param considerSize True if the size of the objects should be\r\n * considered.\r\n */\r\n constructor(maxSize: number, considerSize: boolean = false) {\r\n this._maxSize = maxSize;\r\n this._totalSize = 0;\r\n this._considerSize = considerSize;\r\n this._cache = new Map<string, T>();\r\n this._sizes = new Map<string, number>();\r\n }\r\n\r\n /**\r\n * Get an item from the cache.\r\n * @param key The key of the item to get.\r\n * @returns The item or undefined if the item is not in the cache.\r\n */\r\n public get(key: string): T | undefined {\r\n let item: T | undefined = this._cache.get(key);\r\n if (item) {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n }\r\n return item;\r\n }\r\n\r\n /**\r\n * Check if an item is in the cache.\r\n * @param key The key of the item to check.\r\n * @returns True if the item is in cache.\r\n */\r\n public has(key: string): boolean {\r\n return this._cache.has(key);\r\n }\r\n\r\n /**\r\n * Put an item in the cache.\r\n * @param key The key of the item to put.\r\n * @param item The item to put.\r\n * @param size The estimated size of the item in bytes.\r\n * This must be calculated by the caller but only when\r\n * considerSize is true.\r\n */\r\n public put(key: string, item: T, size: number): void {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n this._sizes.set(key, size);\r\n if (this._considerSize) {\r\n this._totalSize += size;\r\n while (this._totalSize > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n let oldestSize = this._sizes.get(oldestKey);\r\n if (oldestSize) {\r\n this._totalSize -= oldestSize;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n } else {\r\n while (this._cache.size > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._sizes.clear();\r\n this._totalSize = 0;\r\n }\r\n\r\n /**\r\n * Estimate the size of an object in bytes.\r\n * @param obj The object to calculate the size of.\r\n * @returns The estimated size of the object in bytes.\r\n */\r\n public static calculateObjectSize(obj: any): number {\r\n if (!obj) {\r\n return 0;\r\n }\r\n let totalSize = 0;\r\n let keys = Object.keys(obj);\r\n for (let key of keys) {\r\n let value = obj[key];\r\n if (typeof value === 'string') {\r\n totalSize += value.length * 2;\r\n } else if (typeof value === 'number') {\r\n totalSize += 8;\r\n } else if (typeof value === 'boolean') {\r\n totalSize += 4;\r\n } else if (typeof value === 'object' && value !== null) {\r\n totalSize += this.calculateObjectSize(value);\r\n }\r\n }\r\n return totalSize;\r\n }\r\n}\r\n","import { BehaviorSubject, Observable } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\n\r\n/**\r\n * Options for the paged list store.\r\n */\r\nexport interface PagedListStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n}\r\n\r\n/**\r\n * Default options for the paged list store.\r\n */\r\nexport const DEFAULT_PAGED_LIST_STORE_OPTIONS: PagedListStoreOptions = {\r\n pageSize: 20,\r\n cacheSize: 50,\r\n};\r\n\r\n/**\r\n * The interface to be implemented by the service used by PagedListStore.\r\n */\r\nexport interface PagedListStoreService<F, E> {\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The size of the page to load.\r\n * @param filter The filter to apply.\r\n */\r\n loadPage(\r\n pageNumber: number,\r\n pageSize: number,\r\n filter: F\r\n ): Observable<DataPage<E>>;\r\n}\r\n\r\n/**\r\n * A generic paged list store using a filter object of type F\r\n * and a list of elements of type E.\r\n */\r\nexport class PagedListStore<F, E> {\r\n private _pageSize: number;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private _page$: BehaviorSubject<DataPage<E>>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _cache: LRUCache<DataPage<E>>;\r\n\r\n /**\r\n * The page. It is updated when the page is changed or the filter is changed.\r\n */\r\n public page$: Observable<Readonly<DataPage<E>>>;\r\n\r\n /**\r\n * The filter. It is updated when the filter is changed.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create a new paged list store.\r\n * @param options Options for the paged list store.\r\n */\r\n constructor(\r\n private _service: PagedListStoreService<F, E>,\r\n options: PagedListStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<E>>(options.cacheSize);\r\n // page\r\n this._page$ = new BehaviorSubject<DataPage<E>>({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n this.page$ = this._page$.asObservable();\r\n // filter\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n }\r\n\r\n /**\r\n * Returns true if the store is empty, false otherwise.\r\n * @returns true if the store is empty, false otherwise.\r\n */\r\n public isEmpty(): boolean {\r\n return this._page$.value.items.length === 0;\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ pageNumber, ...filter });\r\n }\r\n\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber the page number to load.\r\n */\r\n private loadPage(pageNumber: number): Observable<DataPage<E>> {\r\n return this._service.loadPage(\r\n pageNumber,\r\n this._pageSize,\r\n this._filter$.value\r\n );\r\n }\r\n\r\n /**\r\n * Set the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The page size.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setPage(pageNumber: number, pageSize?: number): Promise<void> {\r\n if (pageSize && pageSize !== this._pageSize) {\r\n this._pageSize = pageSize;\r\n }\r\n return new Promise((resolve, reject) => {\r\n // if page is in cache, return it\r\n const key = this.buildCacheKey(pageNumber, this._filter$.value);\r\n const cachedPage = this._cache.get(key);\r\n if (cachedPage) {\r\n this._page$.next(cachedPage);\r\n resolve();\r\n return;\r\n }\r\n\r\n // else load page\r\n this.loadPage(pageNumber).subscribe({\r\n next: (page) => {\r\n this._page$.next(page);\r\n this._cache.put(key, page, 0);\r\n resolve();\r\n },\r\n error: reject,\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Get the current page.\r\n * @returns The current page.\r\n */\r\n public getPage(): DataPage<E> {\r\n return this._page$.value;\r\n }\r\n\r\n /**\r\n * Apply the given filter and load the first page.\r\n * @param filter The filter to apply.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setFilter(filter: F): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this._filter$.next(filter);\r\n this.setPage(1).then(resolve, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Get the current filter.\r\n * @returns The current filter.\r\n */\r\n public getFilter(): F {\r\n return this._filter$.value;\r\n }\r\n\r\n /**\r\n * Reset the filter and load the first page. The cache is cleared.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public reset(): Promise<void> {\r\n this._cache.clear();\r\n return this.setFilter({} as F);\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the page is emptied.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._page$.next({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","import { BehaviorSubject, Observable, forkJoin, of, tap } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\nimport { DEFAULT_PAGED_LIST_STORE_OPTIONS } from './paged-list.store';\r\n\r\n/**\r\n * A tree node. Your data service should return a list of these nodes\r\n * or of any type extending this interface.\r\n */\r\nexport interface TreeNode {\r\n id: number;\r\n parentId?: number;\r\n y: number;\r\n x: number;\r\n label: string;\r\n tag?: string;\r\n hasChildren?: boolean;\r\n}\r\n\r\n/**\r\n * A filter for tree nodes.\r\n */\r\nexport interface TreeNodeFilter {\r\n tags?: string[];\r\n parentId?: number;\r\n}\r\n\r\n/**\r\n * Paging information for a paged tree node.\r\n */\r\nexport interface PagingInfo {\r\n pageNumber: number;\r\n pageCount: number;\r\n total: number;\r\n}\r\n\r\n/**\r\n * A tree node with paging information, used in NodeBrowserStore.\r\n */\r\nexport interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {\r\n paging: PagingInfo;\r\n expanded?: boolean;\r\n filter?: F;\r\n}\r\n\r\n/**\r\n * The interface to be implemented by the service used by NodeBrowserStore\r\n * to load nodes.\r\n */\r\nexport interface PagedTreeStoreService<F extends TreeNodeFilter> {\r\n /**\r\n * Get the specified page of nodes.\r\n * @param filter The filter.\r\n * @param pageNumber The page number.\r\n * @param pageSize The page size.\r\n * @param hasMockRoot If true, the root node is a mock node provided by your\r\n * service, which implies that its Y value is 0 rather than 1. Default is\r\n * false, meaning that your service will return a single root node with Y\r\n * value 1.\r\n */\r\n getNodes(\r\n filter: F,\r\n pageNumber: number,\r\n pageSize: number,\r\n hasMockRoot?: boolean\r\n ): Observable<DataPage<TreeNode>>;\r\n}\r\n\r\n/**\r\n * Options for the NodeBrowserStore.\r\n */\r\nexport interface PagedTreeStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n /**\r\n * If true, the root node is a mock node provided by your service, which\r\n * implies that its Y value is 0 rather than 1. Default is false, meaning\r\n * that there are many root-level nodes, all with parent ID = undefined.\r\n */\r\n hasMockRoot?: boolean;\r\n}\r\n\r\n/**\r\n * A store for the node browser component. This store is used to keep a\r\n * list of nodes, and to load them from the API. It also keeps the root\r\n * node. Every tree node in the list is extended with page number,\r\n * page count and total items, plus expansion-related metadata.\r\n * The store keeps a flat list of these tree nodes, allowing users to\r\n * expand and collapse them.\r\n * F is the type of the filter object, E is the type of the paged tree nodes.\r\n */\r\nexport class PagedTreeStore<\r\n E extends PagedTreeNode<F>,\r\n F extends TreeNodeFilter\r\n> {\r\n private _nodes$: BehaviorSubject<E[]>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private readonly _cache: LRUCache<DataPage<TreeNode>>;\r\n private readonly _hasMockRoot: boolean;\r\n\r\n private _pageSize: number;\r\n // dirty state: this is reset when the store is reset, and set to true\r\n // when the store is changed\r\n private _dirty?: boolean;\r\n\r\n /**\r\n * The flat list of paged nodes in this store.\r\n */\r\n public nodes$: Observable<Readonly<E[]>>;\r\n\r\n /**\r\n * The global filter for all the nodes.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create an instance of the store.\r\n * @param _service The service used to load nodes.\r\n * @param options The options to configure this store.\r\n */\r\n constructor(\r\n private _service: PagedTreeStoreService<F>,\r\n options: PagedTreeStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<TreeNode>>(options.cacheSize);\r\n this._customCacheKeyBuilder = options.buildCacheKey;\r\n this._nodes$ = new BehaviorSubject<E[]>([]);\r\n this.nodes$ = this._nodes$.asObservable();\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n this._dirty = true;\r\n this._hasMockRoot = options.hasMockRoot || false;\r\n }\r\n\r\n /**\r\n * Gets the global filter, eventually overridden with values\r\n * from the specified node's filter.\r\n * @param node The optional node.\r\n * @returns The filter.\r\n */\r\n private getFilter(node?: PagedTreeNode<F>): F {\r\n return node?.filter\r\n ? {\r\n ...this._filter$.value,\r\n ...node.filter,\r\n }\r\n : this._filter$.value;\r\n }\r\n\r\n /**\r\n * Checks if this store is empty.\r\n * @returns True if this store is empty.\r\n */\r\n public isEmpty(): boolean {\r\n return this._nodes$.value.length === 0;\r\n }\r\n\r\n /**\r\n * Gets all the nodes in the store.\r\n * @returns The nodes.\r\n */\r\n public getNodes(): Readonly<PagedTreeNode<F>[]> {\r\n return this._nodes$.value;\r\n }\r\n\r\n /**\r\n * Get the root node of the tree.\r\n * @returns The root node of the tree or undefined if empty.\r\n */\r\n public getRootNode(): PagedTreeNode<F> | undefined {\r\n return this._nodes$.value[0];\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ ...filter, pageNumber });\r\n }\r\n\r\n /**\r\n * Get the specified page of nodes, either from cache or from the server.\r\n * When the page is retrieved from the server, it is stored in cache.\r\n * @param filter The filter to apply.\r\n * @param pageNumber The page number to get.\r\n * @returns Observable of the page of nodes.\r\n */\r\n private getPageFromCacheOrServer(\r\n filter: F,\r\n pageNumber: number\r\n ): Observable<DataPage<TreeNode>> {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n const pageInCache = this._cache.get(key);\r\n\r\n if (pageInCache) {\r\n return of(pageInCache);\r\n } else {\r\n return this._service\r\n .getNodes(filter, pageNumber, this._pageSize, this._hasMockRoot)\r\n .pipe(\r\n tap((page) => {\r\n this._cache.put(key, page, 0);\r\n })\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create paged tree nodes from a page of tree nodes, by providing further\r\n * metadata like page number, page count and total items.\r\n * @param page The page to create nodes from.\r\n * @returns Paged nodes.\r\n */\r\n private createPageNodes(page: DataPage<TreeNode>): E[] {\r\n return page.items.map((n) => {\r\n return {\r\n ...n,\r\n hasChildren: n.hasChildren,\r\n paging: {\r\n pageNumber: page.pageNumber,\r\n pageCount: page.pageCount,\r\n total: page.total,\r\n },\r\n } as E;\r\n });\r\n }\r\n\r\n /**\r\n * Sets the filter for this store. Whenever the filter is set,\r\n * the store is reset.\r\n * @param filter The filter.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public setFilter(filter: F): Promise<boolean> {\r\n if (this._filter$.value === filter) {\r\n return Promise.resolve(false);\r\n }\r\n this._filter$.next(filter);\r\n this._dirty = true;\r\n return this.reset();\r\n }\r\n\r\n /**\r\n * Reset the store, loading the root nodes and their children.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public reset(): Promise<boolean> {\r\n if (!this._dirty) {\r\n return Promise.resolve(false);\r\n }\r\n this._cache.clear();\r\n const filter = this._filter$.value;\r\n\r\n return new Promise<boolean>((resolve, reject) => {\r\n this._service\r\n .getNodes(\r\n {\r\n ...filter,\r\n parentId: undefined,\r\n },\r\n 1,\r\n this._pageSize,\r\n this._hasMockRoot\r\n )\r\n .subscribe({\r\n next: (page: DataPage<TreeNode>) => {\r\n this._nodes$.next(this.createPageNodes(page));\r\n\r\n // get the children of each node thus calculating their hasChildren property\r\n const childrenObservables = this._nodes$.value.map((node) =>\r\n this.getPageFromCacheOrServer({ ...filter, parentId: node.id }, 1)\r\n );\r\n forkJoin(childrenObservables).subscribe((childrenPages) => {\r\n childrenPages.forEach((page, i) => {\r\n this._nodes$.value[i].hasChildren = page.total > 0;\r\n });\r\n });\r\n\r\n this._dirty = false;\r\n resolve(true);\r\n },\r\n error: (error) => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Set the node filter for the node with the specified ID.\r\n * @param id The node ID.\r\n * @param filter The filter to set.\r\n * @returns Promise with true if filter was set, false otherwise.\r\n */\r\n public setNodeFilter(id: number, filter?: F | null): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node) {\r\n reject(`Node ID ${id} not found in store`);\r\n }\r\n node!.filter = filter || undefined;\r\n return this.changePage(id, 1);\r\n });\r\n }\r\n\r\n /**\r\n * Expand the node with the specified ID. If the node is not expandable,\r\n * or it is already expanded, this method does nothing.\r\n * @param node The ID of the node to expand.\r\n * @returns Promise with true if the node was expanded, false otherwise.\r\n */\r\n public expand(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(node), parentId: id },\r\n 1\r\n ).subscribe((page) => {\r\n // no children, set hasChildren to false\r\n if (!page.total) {\r\n node!.hasChildren = false;\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // insert page nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node!);\r\n if (index === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n const pageNodes = this.createPageNodes(page);\r\n nodes.splice(index + 1, 0, ...(pageNodes as E[]));\r\n this._nodes$.next(nodes);\r\n node!.hasChildren = true;\r\n node!.expanded = true;\r\n resolve(true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Expand all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to expand, or undefined to expand the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public expandAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each root level node call expandAll\r\n const nodes = [...this._nodes$.value];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.expandAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n // get the parent node to start from\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.findIndex((n) => n.id === id);\r\n if (nodeIndex === -1) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n // collect all the descendant nodes IDs\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n const nodesToExpand = nodes.slice(nodeIndex, i).map((n) => n.id);\r\n\r\n // expand all the descendant nodes\r\n return new Promise<boolean>((resolve, reject) => {\r\n nodesToExpand.forEach((id) => {\r\n this.expand(id);\r\n this.expandAll(id);\r\n });\r\n resolve(true);\r\n });\r\n }\r\n\r\n public getChildren(id: number): E[] {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false) {\r\n return [];\r\n }\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node);\r\n if (index === -1) {\r\n return [];\r\n }\r\n const children: E[] = [];\r\n let i = index + 1;\r\n while (i < nodes.length && nodes[i].y > node.y) {\r\n children.push(nodes[i]);\r\n i++;\r\n }\r\n return children;\r\n }\r\n\r\n private removeDescendants(\r\n nodes: PagedTreeNode<F>[],\r\n nodeIndex: number\r\n ): void {\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n nodes.splice(nodeIndex + 1, i - nodeIndex - 1);\r\n }\r\n\r\n /**\r\n * Collapse the node with the specified ID. If the node is not expandable,\r\n * or it is already collapsed, this method does nothing.\r\n * @param node The node to collapse.\r\n * @returns Promise with true if the node was collapsed, false otherwise.\r\n */\r\n public collapse(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || !node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n // remove all the descendant nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(node!);\r\n if (nodeIndex === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n this._dirty = true;\r\n this.removeDescendants(nodes, nodeIndex);\r\n node!.expanded = false;\r\n // reset paging info\r\n if (node?.paging) {\r\n node.paging.pageNumber = 1;\r\n }\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Collapse all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to collapse, or undefined to collapse the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public collapseAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each expanded root level node\r\n const nodes = [...this._nodes$.value.filter((n) => n.expanded)];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.collapseAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n this.collapse(id);\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Change the page including the node with the specified ID.\r\n * @param parentId The ID of the parent node whose children are inside the page\r\n * you want to change.\r\n * @param pageNumber The new page number.\r\n * @returns Promise with true if the page was changed, false otherwise.\r\n */\r\n public changePage(parentId: number, pageNumber: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // get the parent node\r\n const parentNode = this._nodes$.value.find((n) => n.id === parentId);\r\n if (!parentNode) {\r\n resolve(false);\r\n }\r\n\r\n // get the page\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(parentNode), parentId },\r\n pageNumber\r\n ).subscribe((page) => {\r\n // if page is empty do nothing\r\n if (!page.total) {\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // remove all the nodes in the same page of node\r\n // with all their descendants\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(parentNode!) + 1;\r\n const pageNodes = this.createPageNodes(page);\r\n\r\n // find the first node of the node's page\r\n let start = nodeIndex;\r\n const oldPageNr = nodes[start].paging.pageNumber;\r\n while (\r\n start > 0 &&\r\n nodes[start - 1].parentId === parentId &&\r\n nodes[start - 1].paging.pageNumber === oldPageNr\r\n ) {\r\n start--;\r\n }\r\n\r\n // find the last node of the node's page,\r\n // including all their descendants\r\n let end = start;\r\n const y = nodes[start].y;\r\n while (end < nodes.length && nodes[end].y >= y) {\r\n end++;\r\n }\r\n // replace all these nodes with the new ones\r\n nodes.splice(start, end - start);\r\n nodes.splice(start, 0, ...(pageNodes as E[]));\r\n\r\n // update the parent node paging info\r\n parentNode!.paging.pageNumber = page.pageNumber;\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the nodes are removed.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._nodes$.next([]);\r\n this._dirty = true;\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","/*\n * Public API Surface of paged-data-browsers\n */\n\nexport * from './lib/components/compact-pager/compact-pager.component';\nexport * from './lib/components/range-view/range-view.component';\nexport * from './lib/components/browser-tree-node/browser-tree-node.component';\n\nexport * from './lib/services/paged-list.store';\nexport * from './lib/services/paged-tree.store';\nexport * from './lib/services/lru-cache';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;MAca,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOS,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAa,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAE5E;;AAEG;QACa,IAAY,CAAA,YAAA,GAAG,MAAM,EAAc;AAgCpD;IA9BQ,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;;IAGtD,UAAU,GAAA;QACf,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,CAAC,EAAE;AAChC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACrB,GAAG,IAAI,CAAC,MAAM,EAAE;gBAChB,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,CAAC;AACzC,aAAA,CAAC;;;IAIC,MAAM,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE;AACtD,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,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE;AACtD,YA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,CAAC,MAAM,GAAG,IAAI;;AAGpB;;AAEG;IACI,UAAU,GAAA;AACf,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;;AAGrB;;;;;AAKG;IACI,aAAa,CAAC,UAAkB,EAAE,MAAS,EAAA;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE9B;;ACtmBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"myrmidon-paged-data-browsers.mjs","sources":["../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/compact-pager/compact-pager.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/range-view/range-view.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/components/browser-tree-node/browser-tree-node.component.html","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/lru-cache.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-list.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/lib/services/paged-tree.store.ts","../../../../projects/myrmidon/paged-data-browsers/src/public-api.ts","../../../../projects/myrmidon/paged-data-browsers/src/myrmidon-paged-data-browsers.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { PagingInfo } from '../../services/paged-tree.store';\n\n@Component({\n selector: 'pdb-compact-pager',\n imports: [CommonModule, MatButtonModule, MatIconModule],\n templateUrl: './compact-pager.component.html',\n styleUrls: ['./compact-pager.component.scss'],\n})\nexport class CompactPagerComponent {\n public paging = input<PagingInfo>({ pageNumber: 0, pageCount: 0, total: 0 });\n\n /**\n * Emits the new paging information when the user changes the page.\n */\n public readonly pagingChange = output<PagingInfo>();\n\n public onFirst(): void {\n this.pagingChange.emit({ ...this.paging(), pageNumber: 1 });\n }\n\n public onPrevious(): void {\n if (this.paging().pageNumber > 1) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber - 1,\n });\n }\n }\n\n public onNext(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageNumber + 1,\n });\n }\n }\n\n public onLast(): void {\n if (this.paging().pageNumber < this.paging().pageCount) {\n this.pagingChange.emit({\n ...this.paging(),\n pageNumber: this.paging().pageCount,\n });\n }\n }\n}\n","@if (paging().pageCount) {\n <div class=\"form-row\">\n <span id=\"pages\">{{ paging().pageNumber }}/{{ paging().pageCount }}</span>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onFirst()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>first_page</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onPrevious()\"\n [disabled]=\"paging().pageNumber < 2\"\n >\n <mat-icon>navigate_before</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onNext()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>navigate_next</mat-icon>\n </button>\n <button\n type=\"button\"\n mat-icon-button\n (click)=\"onLast()\"\n [disabled]=\"paging().pageNumber === paging().pageCount\"\n >\n <mat-icon>last_page</mat-icon>\n </button>\n <span id=\"total\">{{ paging().total }} </span>\n </div>\n}\n","import { Component, computed, input, signal } from '@angular/core';\n\n@Component({\n selector: 'pdb-range-view',\n templateUrl: './range-view.component.html',\n styleUrls: ['./range-view.component.scss'],\n})\nexport class RangeViewComponent {\n /**\n * The domain of the range view (start, limit).\n */\n public domain = input([0, 100]);\n /**\n * The range of the range view (start, limit).\n */\n public range = input([0, 100]);\n /**\n * The width of the component.\n */\n public width = input(100);\n /**\n * The height of the component.\n */\n public height = input(5);\n\n public scaledRange = computed(() => {\n const domain = this.domain();\n const range = this.range();\n const width = this.width();\n\n const domainWidth = domain[1] - domain[0];\n const rangeWidth = range[1] - range[0];\n const rangeStart = range[0] - domain[0];\n\n return [\n (rangeStart / domainWidth) * width,\n ((rangeStart + rangeWidth) / domainWidth) * width,\n ];\n });\n\n constructor() {}\n}\n","<svg [attr.width]=\"width()\" [attr.height]=\"height()\">\n <rect id=\"rdomain\" [attr.width]=\"width()\" [attr.height]=\"height()\" />\n <rect\n id=\"rrange\"\n [attr.x]=\"scaledRange()[0]\"\n [attr.y]=\"0\"\n [attr.width]=\"scaledRange()[1] - scaledRange()[0]\"\n [attr.height]=\"height()\"\n />\n</svg>\n","import { Component, input, output } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { MatBadgeModule } from '@angular/material/badge';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { ColorToContrastPipe, StringToColorPipe } from '@myrmidon/ngx-tools';\n\nimport { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';\nimport { CompactPagerComponent } from '../compact-pager/compact-pager.component';\nimport { RangeViewComponent } from '../range-view/range-view.component';\n\n/**\n * A request to change the page number of a node's children.\n */\nexport interface PageChangeRequest {\n node: PagedTreeNode<any>;\n paging: PagingInfo;\n}\n\n/**\n * Browser tree node component view. This wraps some HTML content providing\n * a toggle button to expand/collapse the node, a paging control for the\n * node's children, and a button to edit the node's filter. You should then\n * provide the HTML content to display the node's data inside this component, e.g.\n * <pdb-browser-tree-node [node]=\"node\">\n * <your-node-view [node]=\"node\" />\n * <pdb-browser-tree-node>\n */\n@Component({\n selector: 'pdb-browser-tree-node',\n imports: [\n CommonModule,\n MatBadgeModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule,\n // ngx-tools\n ColorToContrastPipe,\n StringToColorPipe,\n // local\n CompactPagerComponent,\n RangeViewComponent,\n ],\n templateUrl: './browser-tree-node.component.html',\n styleUrls: ['./browser-tree-node.component.css'],\n})\nexport class BrowserTreeNodeComponent {\n /**\n * The node to display.\n */\n public readonly node = input<PagedTreeNode<any> | undefined | null>();\n\n /**\n * The paging information for the node's children.\n */\n public readonly paging = input<PagingInfo>();\n\n /**\n * True to show debug information.\n */\n public readonly debug = input<boolean>();\n\n /**\n * True to hide the node's loc and label. This is useful if you want to\n * provide your own view for the node, between the expansion toggle and\n * the filter edit button. In this case, in your consumer template provide\n * your own view as the content of this component. If instead you are fine\n * with the default loc and label, and just want to add more data to\n * the view, then you can just add your own content to this component's\n * template, without setting this property to true.\n */\n public readonly hideLabel = input<boolean>();\n\n /**\n * True to hide the node's location (y and x).\n */\n public readonly hideLoc = input<boolean>();\n\n /**\n * True to hide the node's paging control unless hovered.\n */\n public readonly hidePaging = input<boolean>();\n\n /**\n * True to hide the node's filter edit button.\n */\n public readonly hideFilter = input<boolean>();\n\n /**\n * The indent size for the node's children.\n */\n public readonly indentSize = input(30);\n\n /**\n * The width of the range view.\n */\n public readonly rangeWidth = input(250);\n\n /**\n * Emits when the user wants to toggle the expanded state of the node.\n */\n public readonly toggleExpandedRequest = output<PagedTreeNode<any>>();\n\n /**\n * Emits when the user wants to change the page number of the node's children.\n */\n public readonly changePageRequest = output<PageChangeRequest>();\n\n /**\n * Emits when the user wants to edit the node's filter.\n */\n public readonly editNodeFilterRequest = output<PagedTreeNode<any>>();\n\n public onToggleExpanded(): void {\n if (!this.node()) {\n return;\n }\n this.toggleExpandedRequest.emit(this.node() as PagedTreeNode<any>);\n }\n\n public onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void {\n this.changePageRequest.emit({\n node,\n paging,\n });\n }\n\n public onEditFilter(): void {\n if (this.node()) {\n this.editNodeFilterRequest.emit(this.node() as PagedTreeNode<any>);\n }\n }\n}\n","@if (node()) {\n<div id=\"node\" [style.margin-left.px]=\"(node()!.y - 1) * indentSize()\">\n <!-- pager -->\n @if (node()!.expanded && paging() && paging()!.pageCount > 1) {\n <div id=\"pager\" [style.display]=\"hidePaging() ? 'inherit' : 'block'\">\n <pdb-compact-pager\n [paging]=\"paging()!\"\n (pagingChange)=\"onPagingChange(node()!, $event)\"\n />\n <pdb-range-view\n [width]=\"rangeWidth()\"\n [domain]=\"[0, paging()!.pageCount]\"\n [range]=\"[paging()!.pageNumber - 1, paging()!.pageNumber]\"\n />\n </div>\n }\n <!-- node -->\n <div class=\"form-row\">\n <!-- expand/collapse button -->\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"node()?.expanded ? 'Collapse' : 'Expand'\"\n i18n-matTooltip\n [disabled]=\"node()!.hasChildren === false\"\n (click)=\"onToggleExpanded()\"\n >\n <mat-icon class=\"mat-primary\" i18n>{{\n node()!.hasChildren === true || node()!.hasChildren === undefined\n ? node()?.expanded\n ? \"expand_less\"\n : \"expand_more\"\n : \"stop\"\n }}</mat-icon>\n </button>\n\n <!-- tag -->\n @if (!hideLabel()) {\n <span\n class=\"tag\"\n [ngStyle]=\"{\n 'background-color': (node()!.tag | stringToColor),\n color: node()!.tag | stringToColor | colorToContrast\n }\"\n >{{ node()!.tag }}</span\n >\n\n <!-- loc and label -->\n @if (!hideLoc()) {\n <span class=\"loc\">{{ node()!.y }}.{{ node()!.x }}</span> - }\n {{ node()!.label }}\n }\n\n <!-- PROJECTED NODE -->\n <ng-content></ng-content>\n\n <!-- debug -->\n @if (debug()) {\n <span class=\"debug\"\n >#{{ node()!.id }}\n <span\n >| {{ node()!.paging.pageNumber }}/{{ node()!.paging.pageCount }} ({{\n node()!.paging.total\n }})</span\n ></span\n >\n }\n\n <!-- filter -->\n @if (!hideFilter()){ @if (!node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button\n type=\"button\"\n mat-icon-button\n matTooltip=\"Add filter\"\n i18n-matTooltip\n (click)=\"onEditFilter()\"\n >\n <mat-icon>filter_list</mat-icon>\n </button>\n </div>\n } @if (node()?.filter && node()?.y) {\n <div class=\"muted\">\n <button type=\"button\" mat-icon-button (click)=\"onEditFilter()\">\n <mat-icon [matBadge]=\"node()?.filter ? 'F' : ''\">filter_alt</mat-icon>\n </button>\n </div>\n } }\n </div>\n</div>\n}\n","/**\r\n * A Least Recently Used cache that can be used to store any type of object.\r\n * The cache works in two modes: considering the size of the objects or not.\r\n * If the size is considered, the cache will have a maximum size and will\r\n * remove the oldest objects when the maximum size is reached. Note that\r\n * the size is only roughly estimated. This avoids removing too many\r\n * entries from the cache when the maximum is reached.\r\n * If the size is not considered, the cache will have a maximum number of\r\n * objects and will remove the oldest objects when the maximum number is\r\n * reached.\r\n */\r\nexport class LRUCache<T> {\r\n private _maxSize: number;\r\n private _totalSize: number;\r\n private _considerSize: boolean;\r\n private _cache: Map<string, T>;\r\n private _sizes: Map<string, number>;\r\n\r\n /**\r\n * Creates a new cache.\r\n * @param maxSize The maximum size of the cache. This is either\r\n * the maximum number of items in the cache (when considerSize\r\n * is false) or the maximum total size of all items in the\r\n * cache in bytes (when considerSize is true).\r\n * @param considerSize True if the size of the objects should be\r\n * considered.\r\n */\r\n constructor(maxSize: number, considerSize: boolean = false) {\r\n this._maxSize = maxSize;\r\n this._totalSize = 0;\r\n this._considerSize = considerSize;\r\n this._cache = new Map<string, T>();\r\n this._sizes = new Map<string, number>();\r\n }\r\n\r\n /**\r\n * Get an item from the cache.\r\n * @param key The key of the item to get.\r\n * @returns The item or undefined if the item is not in the cache.\r\n */\r\n public get(key: string): T | undefined {\r\n let item: T | undefined = this._cache.get(key);\r\n if (item) {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n }\r\n return item;\r\n }\r\n\r\n /**\r\n * Check if an item is in the cache.\r\n * @param key The key of the item to check.\r\n * @returns True if the item is in cache.\r\n */\r\n public has(key: string): boolean {\r\n return this._cache.has(key);\r\n }\r\n\r\n /**\r\n * Put an item in the cache.\r\n * @param key The key of the item to put.\r\n * @param item The item to put.\r\n * @param size The estimated size of the item in bytes.\r\n * This must be calculated by the caller but only when\r\n * considerSize is true.\r\n */\r\n public put(key: string, item: T, size: number): void {\r\n this._cache.delete(key);\r\n this._cache.set(key, item);\r\n this._sizes.set(key, size);\r\n if (this._considerSize) {\r\n this._totalSize += size;\r\n while (this._totalSize > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n let oldestSize = this._sizes.get(oldestKey);\r\n if (oldestSize) {\r\n this._totalSize -= oldestSize;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n } else {\r\n while (this._cache.size > this._maxSize) {\r\n const oldestKey = this._cache.keys().next().value;\r\n if (!oldestKey) {\r\n break;\r\n }\r\n this._cache.delete(oldestKey);\r\n this._sizes.delete(oldestKey);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._sizes.clear();\r\n this._totalSize = 0;\r\n }\r\n\r\n /**\r\n * Estimate the size of an object in bytes.\r\n * @param obj The object to calculate the size of.\r\n * @returns The estimated size of the object in bytes.\r\n */\r\n public static calculateObjectSize(obj: any): number {\r\n if (!obj) {\r\n return 0;\r\n }\r\n let totalSize = 0;\r\n let keys = Object.keys(obj);\r\n for (let key of keys) {\r\n let value = obj[key];\r\n if (typeof value === 'string') {\r\n totalSize += value.length * 2;\r\n } else if (typeof value === 'number') {\r\n totalSize += 8;\r\n } else if (typeof value === 'boolean') {\r\n totalSize += 4;\r\n } else if (typeof value === 'object' && value !== null) {\r\n totalSize += this.calculateObjectSize(value);\r\n }\r\n }\r\n return totalSize;\r\n }\r\n}\r\n","import { BehaviorSubject, Observable } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\n\r\n/**\r\n * Options for the paged list store.\r\n */\r\nexport interface PagedListStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n}\r\n\r\n/**\r\n * Default options for the paged list store.\r\n */\r\nexport const DEFAULT_PAGED_LIST_STORE_OPTIONS: PagedListStoreOptions = {\r\n pageSize: 20,\r\n cacheSize: 50,\r\n};\r\n\r\n/**\r\n * The interface to be implemented by the service used by PagedListStore.\r\n */\r\nexport interface PagedListStoreService<F, E> {\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The size of the page to load.\r\n * @param filter The filter to apply.\r\n */\r\n loadPage(\r\n pageNumber: number,\r\n pageSize: number,\r\n filter: F\r\n ): Observable<DataPage<E>>;\r\n}\r\n\r\n/**\r\n * A generic paged list store using a filter object of type F\r\n * and a list of elements of type E.\r\n */\r\nexport class PagedListStore<F, E> {\r\n private _pageSize: number;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private _page$: BehaviorSubject<DataPage<E>>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _cache: LRUCache<DataPage<E>>;\r\n\r\n /**\r\n * The page. It is updated when the page is changed or the filter is changed.\r\n */\r\n public page$: Observable<Readonly<DataPage<E>>>;\r\n\r\n /**\r\n * The filter. It is updated when the filter is changed.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create a new paged list store.\r\n * @param options Options for the paged list store.\r\n */\r\n constructor(\r\n private _service: PagedListStoreService<F, E>,\r\n options: PagedListStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<E>>(options.cacheSize);\r\n // page\r\n this._page$ = new BehaviorSubject<DataPage<E>>({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n this.page$ = this._page$.asObservable();\r\n // filter\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n }\r\n\r\n /**\r\n * Returns true if the store is empty, false otherwise.\r\n * @returns true if the store is empty, false otherwise.\r\n */\r\n public isEmpty(): boolean {\r\n return this._page$.value.items.length === 0;\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ pageNumber, ...filter });\r\n }\r\n\r\n /**\r\n * Load the page with the given number.\r\n * @param pageNumber the page number to load.\r\n */\r\n private loadPage(pageNumber: number): Observable<DataPage<E>> {\r\n return this._service.loadPage(\r\n pageNumber,\r\n this._pageSize,\r\n this._filter$.value\r\n );\r\n }\r\n\r\n /**\r\n * Set the page with the given number.\r\n * @param pageNumber The page number to load.\r\n * @param pageSize The page size.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setPage(pageNumber: number, pageSize?: number): Promise<void> {\r\n if (pageSize && pageSize !== this._pageSize) {\r\n this._pageSize = pageSize;\r\n }\r\n return new Promise((resolve, reject) => {\r\n // if page is in cache, return it\r\n const key = this.buildCacheKey(pageNumber, this._filter$.value);\r\n const cachedPage = this._cache.get(key);\r\n if (cachedPage) {\r\n this._page$.next(cachedPage);\r\n resolve();\r\n return;\r\n }\r\n\r\n // else load page\r\n this.loadPage(pageNumber).subscribe({\r\n next: (page) => {\r\n this._page$.next(page);\r\n this._cache.put(key, page, 0);\r\n resolve();\r\n },\r\n error: reject,\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Get the current page.\r\n * @returns The current page.\r\n */\r\n public getPage(): DataPage<E> {\r\n return this._page$.value;\r\n }\r\n\r\n /**\r\n * Apply the given filter and load the first page.\r\n * @param filter The filter to apply.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public setFilter(filter: F): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this._filter$.next(filter);\r\n this.setPage(1).then(resolve, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Get the current filter.\r\n * @returns The current filter.\r\n */\r\n public getFilter(): F {\r\n return this._filter$.value;\r\n }\r\n\r\n /**\r\n * Reset the filter and load the first page. The cache is cleared.\r\n * @returns Promise which resolves when the page is loaded.\r\n */\r\n public reset(): Promise<void> {\r\n this._cache.clear();\r\n return this.setFilter({} as F);\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the page is emptied.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._page$.next({\r\n pageNumber: 0,\r\n pageCount: 0,\r\n pageSize: 0,\r\n total: 0,\r\n items: [],\r\n });\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","import { BehaviorSubject, Observable, forkJoin, of, tap } from 'rxjs';\r\n\r\nimport { DataPage } from '@myrmidon/ngx-tools';\r\n\r\nimport { LRUCache } from './lru-cache';\r\nimport { DEFAULT_PAGED_LIST_STORE_OPTIONS } from './paged-list.store';\r\n\r\n/**\r\n * A tree node. Your data service should return a list of these nodes\r\n * or of any type extending this interface.\r\n */\r\nexport interface TreeNode {\r\n id: number;\r\n parentId?: number;\r\n y: number;\r\n x: number;\r\n label: string;\r\n tag?: string;\r\n hasChildren?: boolean;\r\n}\r\n\r\n/**\r\n * A filter for tree nodes.\r\n */\r\nexport interface TreeNodeFilter {\r\n tags?: string[];\r\n parentId?: number;\r\n}\r\n\r\n/**\r\n * Paging information for a paged tree node.\r\n */\r\nexport interface PagingInfo {\r\n pageNumber: number;\r\n pageCount: number;\r\n total: number;\r\n}\r\n\r\n/**\r\n * A tree node with paging information, used in NodeBrowserStore.\r\n */\r\nexport interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {\r\n paging: PagingInfo;\r\n expanded?: boolean;\r\n filter?: F;\r\n}\r\n\r\n/**\r\n * The interface to be implemented by the service used by NodeBrowserStore\r\n * to load nodes.\r\n */\r\nexport interface PagedTreeStoreService<F extends TreeNodeFilter> {\r\n /**\r\n * Get the specified page of nodes.\r\n * @param filter The filter.\r\n * @param pageNumber The page number.\r\n * @param pageSize The page size.\r\n * @param hasMockRoot If true, the root node is a mock node provided by your\r\n * service, which implies that its Y value is 0 rather than 1. Default is\r\n * false, meaning that your service will return a single root node with Y\r\n * value 1.\r\n */\r\n getNodes(\r\n filter: F,\r\n pageNumber: number,\r\n pageSize: number,\r\n hasMockRoot?: boolean\r\n ): Observable<DataPage<TreeNode>>;\r\n}\r\n\r\n/**\r\n * Options for the NodeBrowserStore.\r\n */\r\nexport interface PagedTreeStoreOptions {\r\n /**\r\n * The size of pages in the store.\r\n */\r\n pageSize: number;\r\n /**\r\n * The size of the cache for pages in the store.\r\n */\r\n cacheSize: number;\r\n /**\r\n * A custom function for building the cache key for the given page number\r\n * and filter.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n buildCacheKey?: (pageNumber: number, filter: any) => string;\r\n /**\r\n * If true, the root node is a mock node provided by your service, which\r\n * implies that its Y value is 0 rather than 1. Default is false, meaning\r\n * that there are many root-level nodes, all with parent ID = undefined.\r\n */\r\n hasMockRoot?: boolean;\r\n}\r\n\r\n/**\r\n * A store for the node browser component. This store is used to keep a\r\n * list of nodes, and to load them from the API. It also keeps the root\r\n * node. Every tree node in the list is extended with page number,\r\n * page count and total items, plus expansion-related metadata.\r\n * The store keeps a flat list of these tree nodes, allowing users to\r\n * expand and collapse them.\r\n * F is the type of the filter object, E is the type of the paged tree nodes.\r\n */\r\nexport class PagedTreeStore<\r\n E extends PagedTreeNode<F>,\r\n F extends TreeNodeFilter\r\n> {\r\n private _nodes$: BehaviorSubject<E[]>;\r\n private _filter$: BehaviorSubject<F>;\r\n private readonly _customCacheKeyBuilder?: (\r\n pageNumber: number,\r\n filter: any\r\n ) => string;\r\n private readonly _cache: LRUCache<DataPage<TreeNode>>;\r\n private readonly _hasMockRoot: boolean;\r\n\r\n private _pageSize: number;\r\n // dirty state: this is reset when the store is reset, and set to true\r\n // when the store is changed\r\n private _dirty?: boolean;\r\n\r\n /**\r\n * The flat list of paged nodes in this store.\r\n */\r\n public nodes$: Observable<Readonly<E[]>>;\r\n\r\n /**\r\n * The global filter for all the nodes.\r\n */\r\n public filter$: Observable<Readonly<F>>;\r\n\r\n /**\r\n * The size of nodes pages in this store. If you change it, the store\r\n * is reset. The default value is 20.\r\n */\r\n public get pageSize(): number {\r\n return this._pageSize;\r\n }\r\n public set pageSize(value: number) {\r\n if (this._pageSize === value) {\r\n return;\r\n }\r\n this._pageSize = value;\r\n this.reset();\r\n }\r\n\r\n /**\r\n * Create an instance of the store.\r\n * @param _service The service used to load nodes.\r\n * @param options The options to configure this store.\r\n */\r\n constructor(\r\n private _service: PagedTreeStoreService<F>,\r\n options: PagedTreeStoreOptions = DEFAULT_PAGED_LIST_STORE_OPTIONS\r\n ) {\r\n this._pageSize = options.pageSize;\r\n this._cache = new LRUCache<DataPage<TreeNode>>(options.cacheSize);\r\n this._customCacheKeyBuilder = options.buildCacheKey;\r\n this._nodes$ = new BehaviorSubject<E[]>([]);\r\n this.nodes$ = this._nodes$.asObservable();\r\n this._filter$ = new BehaviorSubject<F>({} as F);\r\n this.filter$ = this._filter$.asObservable();\r\n this._dirty = true;\r\n this._hasMockRoot = options.hasMockRoot || false;\r\n }\r\n\r\n /**\r\n * Gets the global filter, eventually overridden with values\r\n * from the specified node's filter.\r\n * @param node The optional node.\r\n * @returns The filter.\r\n */\r\n private getFilter(node?: PagedTreeNode<F>): F {\r\n return node?.filter\r\n ? {\r\n ...this._filter$.value,\r\n ...node.filter,\r\n }\r\n : this._filter$.value;\r\n }\r\n\r\n /**\r\n * Checks if this store is empty.\r\n * @returns True if this store is empty.\r\n */\r\n public isEmpty(): boolean {\r\n return this._nodes$.value.length === 0;\r\n }\r\n\r\n /**\r\n * Gets all the nodes in the store.\r\n * @returns The nodes.\r\n */\r\n public getNodes(): Readonly<PagedTreeNode<F>[]> {\r\n return this._nodes$.value;\r\n }\r\n\r\n /**\r\n * Get the root node of the tree.\r\n * @returns The root node of the tree or undefined if empty.\r\n */\r\n public getRootNode(): PagedTreeNode<F> | undefined {\r\n return this._nodes$.value[0];\r\n }\r\n\r\n /**\r\n * Build the cache key for the given page number and filter.\r\n * The default implementation just returns a stringified object\r\n * containing the page number and the filter. You may override\r\n * this method to provide a custom cache key.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns A string to be used as cache key.\r\n */\r\n public buildCacheKey(pageNumber: number, filter: F): string {\r\n if (this._customCacheKeyBuilder) {\r\n return this._customCacheKeyBuilder(pageNumber, filter);\r\n }\r\n return JSON.stringify({ ...filter, pageNumber });\r\n }\r\n\r\n /**\r\n * Get the specified page of nodes, either from cache or from the server.\r\n * When the page is retrieved from the server, it is stored in cache.\r\n * @param filter The filter to apply.\r\n * @param pageNumber The page number to get.\r\n * @returns Observable of the page of nodes.\r\n */\r\n private getPageFromCacheOrServer(\r\n filter: F,\r\n pageNumber: number\r\n ): Observable<DataPage<TreeNode>> {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n const pageInCache = this._cache.get(key);\r\n\r\n if (pageInCache) {\r\n return of(pageInCache);\r\n } else {\r\n return this._service\r\n .getNodes(filter, pageNumber, this._pageSize, this._hasMockRoot)\r\n .pipe(\r\n tap((page) => {\r\n this._cache.put(key, page, 0);\r\n })\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Create paged tree nodes from a page of tree nodes, by providing further\r\n * metadata like page number, page count and total items.\r\n * @param page The page to create nodes from.\r\n * @returns Paged nodes.\r\n */\r\n private createPageNodes(page: DataPage<TreeNode>): E[] {\r\n return page.items.map((n) => {\r\n return {\r\n ...n,\r\n hasChildren: n.hasChildren,\r\n paging: {\r\n pageNumber: page.pageNumber,\r\n pageCount: page.pageCount,\r\n total: page.total,\r\n },\r\n } as E;\r\n });\r\n }\r\n\r\n /**\r\n * Sets the filter for this store. Whenever the filter is set,\r\n * the store is reset.\r\n * @param filter The filter.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public setFilter(filter: F): Promise<boolean> {\r\n if (this._filter$.value === filter) {\r\n return Promise.resolve(false);\r\n }\r\n this._filter$.next(filter);\r\n this._dirty = true;\r\n return this.reset();\r\n }\r\n\r\n /**\r\n * Reset the store, loading the root nodes and their children.\r\n * @returns true if tree was changed, false otherwise.\r\n */\r\n public reset(): Promise<boolean> {\r\n if (!this._dirty) {\r\n return Promise.resolve(false);\r\n }\r\n this._cache.clear();\r\n const filter = this._filter$.value;\r\n\r\n return new Promise<boolean>((resolve, reject) => {\r\n this._service\r\n .getNodes(\r\n {\r\n ...filter,\r\n parentId: undefined,\r\n },\r\n 1,\r\n this._pageSize,\r\n this._hasMockRoot\r\n )\r\n .subscribe({\r\n next: (page: DataPage<TreeNode>) => {\r\n this._nodes$.next(this.createPageNodes(page));\r\n\r\n // get the children of each node thus calculating their hasChildren property\r\n const childrenObservables = this._nodes$.value.map((node) =>\r\n this.getPageFromCacheOrServer({ ...filter, parentId: node.id }, 1)\r\n );\r\n forkJoin(childrenObservables).subscribe((childrenPages) => {\r\n childrenPages.forEach((page, i) => {\r\n this._nodes$.value[i].hasChildren = page.total > 0;\r\n });\r\n });\r\n\r\n this._dirty = false;\r\n resolve(true);\r\n },\r\n error: (error) => {\r\n reject(error);\r\n },\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Set the node filter for the node with the specified ID.\r\n * @param id The node ID.\r\n * @param filter The filter to set.\r\n * @returns Promise with true if filter was set, false otherwise.\r\n */\r\n public setNodeFilter(id: number, filter?: F | null): Promise<boolean> {\r\n if (!id) {\r\n return Promise.resolve(false);\r\n }\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node) {\r\n reject(`Node ID ${id} not found in store`);\r\n }\r\n node!.filter = filter || undefined;\r\n return this.changePage(id, 1);\r\n });\r\n }\r\n\r\n /**\r\n * Expand the node with the specified ID. If the node is not expandable,\r\n * or it is already expanded, this method does nothing.\r\n * @param node The ID of the node to expand.\r\n * @returns Promise with true if the node was expanded, false otherwise.\r\n */\r\n public expand(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(node), parentId: id },\r\n 1\r\n ).subscribe((page) => {\r\n // no children, set hasChildren to false\r\n if (!page.total) {\r\n node!.hasChildren = false;\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // insert page nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node!);\r\n if (index === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n const pageNodes = this.createPageNodes(page);\r\n nodes.splice(index + 1, 0, ...(pageNodes as E[]));\r\n this._nodes$.next(nodes);\r\n node!.hasChildren = true;\r\n node!.expanded = true;\r\n resolve(true);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Expand all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to expand, or undefined to expand the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public expandAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each root level node call expandAll\r\n const nodes = [...this._nodes$.value];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.expandAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n // get the parent node to start from\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.findIndex((n) => n.id === id);\r\n if (nodeIndex === -1) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n // collect all the descendant nodes IDs\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n const nodesToExpand = nodes.slice(nodeIndex, i).map((n) => n.id);\r\n\r\n // expand all the descendant nodes\r\n return new Promise<boolean>((resolve, reject) => {\r\n nodesToExpand.forEach((id) => {\r\n this.expand(id);\r\n this.expandAll(id);\r\n });\r\n resolve(true);\r\n });\r\n }\r\n\r\n public getChildren(id: number): E[] {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false) {\r\n return [];\r\n }\r\n const nodes = this._nodes$.value;\r\n const index = nodes.indexOf(node);\r\n if (index === -1) {\r\n return [];\r\n }\r\n const children: E[] = [];\r\n let i = index + 1;\r\n while (i < nodes.length && nodes[i].y > node.y) {\r\n children.push(nodes[i]);\r\n i++;\r\n }\r\n return children;\r\n }\r\n\r\n private removeDescendants(\r\n nodes: PagedTreeNode<F>[],\r\n nodeIndex: number\r\n ): void {\r\n let i = nodeIndex + 1;\r\n while (i < nodes.length && nodes[i].y > nodes[nodeIndex].y) {\r\n i++;\r\n }\r\n nodes.splice(nodeIndex + 1, i - nodeIndex - 1);\r\n }\r\n\r\n /**\r\n * Collapse the node with the specified ID. If the node is not expandable,\r\n * or it is already collapsed, this method does nothing.\r\n * @param node The node to collapse.\r\n * @returns Promise with true if the node was collapsed, false otherwise.\r\n */\r\n public collapse(id: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n const node = this._nodes$.value.find((n) => n.id === id);\r\n if (!node || node.hasChildren === false || !node.expanded) {\r\n resolve(false);\r\n }\r\n\r\n // remove all the descendant nodes after the current node\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(node!);\r\n if (nodeIndex === -1) {\r\n reject(`Node ID ${id} not found in store`);\r\n } else {\r\n this._dirty = true;\r\n this.removeDescendants(nodes, nodeIndex);\r\n node!.expanded = false;\r\n // reset paging info\r\n if (node?.paging) {\r\n node.paging.pageNumber = 1;\r\n }\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Collapse all the descendants of the node with the specified ID.\r\n *\r\n * @param id The ID of the node to collapse, or undefined to collapse the\r\n * descendants of all the root level nodes.\r\n * @returns Promise.\r\n */\r\n public collapseAll(id?: number): Promise<boolean> {\r\n if (id === undefined) {\r\n // for each expanded root level node\r\n const nodes = [...this._nodes$.value.filter((n) => n.expanded)];\r\n let i = 0;\r\n while (i < nodes.length) {\r\n if (nodes[i].parentId === undefined) {\r\n this.collapseAll(nodes[i].id);\r\n }\r\n i++;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n this.collapse(id);\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Change the page including the node with the specified ID.\r\n * @param parentId The ID of the parent node whose children are inside the page\r\n * you want to change.\r\n * @param pageNumber The new page number.\r\n * @returns Promise with true if the page was changed, false otherwise.\r\n */\r\n public changePage(parentId: number, pageNumber: number): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // get the parent node\r\n const parentNode = this._nodes$.value.find((n) => n.id === parentId);\r\n if (!parentNode) {\r\n resolve(false);\r\n }\r\n\r\n // get the page\r\n this.getPageFromCacheOrServer(\r\n { ...this.getFilter(parentNode), parentId },\r\n pageNumber\r\n ).subscribe((page) => {\r\n // if page is empty do nothing\r\n if (!page.total) {\r\n resolve(false);\r\n } else {\r\n this._dirty = true;\r\n // remove all the nodes in the same page of node\r\n // with all their descendants\r\n const nodes = this._nodes$.value;\r\n const nodeIndex = nodes.indexOf(parentNode!) + 1;\r\n const pageNodes = this.createPageNodes(page);\r\n\r\n // find the first node of the node's page\r\n let start = nodeIndex;\r\n const oldPageNr = nodes[start].paging.pageNumber;\r\n while (\r\n start > 0 &&\r\n nodes[start - 1].parentId === parentId &&\r\n nodes[start - 1].paging.pageNumber === oldPageNr\r\n ) {\r\n start--;\r\n }\r\n\r\n // find the last node of the node's page,\r\n // including all their descendants\r\n let end = start;\r\n const y = nodes[start].y;\r\n while (end < nodes.length && nodes[end].y >= y) {\r\n end++;\r\n }\r\n // replace all these nodes with the new ones\r\n nodes.splice(start, end - start);\r\n nodes.splice(start, 0, ...(pageNodes as E[]));\r\n\r\n // update the parent node paging info\r\n parentNode!.paging.pageNumber = page.pageNumber;\r\n this._nodes$.next(nodes);\r\n resolve(true);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Clear the store. The cache is cleared and the nodes are removed.\r\n */\r\n public clear(): void {\r\n this._cache.clear();\r\n this._nodes$.next([]);\r\n this._dirty = true;\r\n }\r\n\r\n /**\r\n * Clear the cache.\r\n */\r\n public clearCache(): void {\r\n this._cache.clear();\r\n }\r\n\r\n /**\r\n * Check if the page with the given number and filter is in cache.\r\n * @param pageNumber The page number.\r\n * @param filter The filter.\r\n * @returns True if the page is in cache, false otherwise.\r\n */\r\n public hasCachedPage(pageNumber: number, filter: F): boolean {\r\n const key = this.buildCacheKey(pageNumber, filter);\r\n return this._cache.has(key);\r\n }\r\n}\r\n","/*\n * Public API Surface of paged-data-browsers\n */\n\nexport * from './lib/components/compact-pager/compact-pager.component';\nexport * from './lib/components/range-view/range-view.component';\nexport * from './lib/components/browser-tree-node/browser-tree-node.component';\n\nexport * from './lib/services/paged-list.store';\nexport * from './lib/services/paged-tree.store';\nexport * from './lib/services/lru-cache';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;MAca,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOS,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAa,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAE5E;;AAEG;QACa,IAAY,CAAA,YAAA,GAAG,MAAM,EAAc;AAgCpD;IA9BQ,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;;IAGtD,UAAU,GAAA;QACf,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,CAAC,EAAE;AAChC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACrB,GAAG,IAAI,CAAC,MAAM,EAAE;gBAChB,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,CAAC;AACzC,aAAA,CAAC;;;IAIC,MAAM,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE;AACtD,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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B,CAAC;;oBAG7C,UAAW,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;AAC/C,oBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;oBACxB,OAAO,CAAC,IAAI,CAAC;;AAEjB,aAAC,CAAC;AACJ,SAAC,CAAC;;AAGJ;;AAEG;IACI,KAAK,GAAA;AACV,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;AACnB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;AACrB,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;;AAGpB;;AAEG;IACI,UAAU,GAAA;AACf,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;;AAGrB;;;;;AAKG;IACI,aAAa,CAAC,UAAkB,EAAE,MAAS,EAAA;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE9B;;ACtmBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -55,6 +55,10 @@ export declare class BrowserTreeNodeComponent {
|
|
|
55
55
|
* The indent size for the node's children.
|
|
56
56
|
*/
|
|
57
57
|
readonly indentSize: import("@angular/core").InputSignal<number>;
|
|
58
|
+
/**
|
|
59
|
+
* The width of the range view.
|
|
60
|
+
*/
|
|
61
|
+
readonly rangeWidth: import("@angular/core").InputSignal<number>;
|
|
58
62
|
/**
|
|
59
63
|
* Emits when the user wants to toggle the expanded state of the node.
|
|
60
64
|
*/
|
|
@@ -71,5 +75,5 @@ export declare class BrowserTreeNodeComponent {
|
|
|
71
75
|
onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void;
|
|
72
76
|
onEditFilter(): void;
|
|
73
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTreeNodeComponent, never>;
|
|
74
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BrowserTreeNodeComponent, "pdb-browser-tree-node", never, { "node": { "alias": "node"; "required": false; "isSignal": true; }; "paging": { "alias": "paging"; "required": false; "isSignal": true; }; "debug": { "alias": "debug"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "hideLoc": { "alias": "hideLoc"; "required": false; "isSignal": true; }; "hidePaging": { "alias": "hidePaging"; "required": false; "isSignal": true; }; "hideFilter": { "alias": "hideFilter"; "required": false; "isSignal": true; }; "indentSize": { "alias": "indentSize"; "required": false; "isSignal": true; }; }, { "toggleExpandedRequest": "toggleExpandedRequest"; "changePageRequest": "changePageRequest"; "editNodeFilterRequest": "editNodeFilterRequest"; }, never, ["*"], true, never>;
|
|
78
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BrowserTreeNodeComponent, "pdb-browser-tree-node", never, { "node": { "alias": "node"; "required": false; "isSignal": true; }; "paging": { "alias": "paging"; "required": false; "isSignal": true; }; "debug": { "alias": "debug"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "hideLoc": { "alias": "hideLoc"; "required": false; "isSignal": true; }; "hidePaging": { "alias": "hidePaging"; "required": false; "isSignal": true; }; "hideFilter": { "alias": "hideFilter"; "required": false; "isSignal": true; }; "indentSize": { "alias": "indentSize"; "required": false; "isSignal": true; }; "rangeWidth": { "alias": "rangeWidth"; "required": false; "isSignal": true; }; }, { "toggleExpandedRequest": "toggleExpandedRequest"; "changePageRequest": "changePageRequest"; "editNodeFilterRequest": "editNodeFilterRequest"; }, never, ["*"], true, never>;
|
|
75
79
|
}
|