@myrmidon/paged-data-browsers 4.0.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,554 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { DataPage } from '@myrmidon/ngx-tools';
4
+
1
5
  /**
2
- * Generated bundle index. Do not edit.
6
+ * A tree node. Your data service should return a list of these nodes
7
+ * or of any type extending this interface.
3
8
  */
4
- /// <amd-module name="@myrmidon/paged-data-browsers" />
5
- export * from './public-api';
9
+ interface TreeNode {
10
+ id: number;
11
+ parentId?: number;
12
+ y: number;
13
+ x: number;
14
+ label: string;
15
+ tag?: string;
16
+ hasChildren?: boolean;
17
+ }
18
+ /**
19
+ * A filter for tree nodes.
20
+ */
21
+ interface TreeNodeFilter {
22
+ tags?: string[];
23
+ parentId?: number;
24
+ }
25
+ /**
26
+ * Paging information for a paged tree node.
27
+ */
28
+ interface PagingInfo {
29
+ pageNumber: number;
30
+ pageCount: number;
31
+ total: number;
32
+ }
33
+ /**
34
+ * A tree node with paging information, used in NodeBrowserStore.
35
+ */
36
+ interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {
37
+ paging: PagingInfo;
38
+ expanded?: boolean;
39
+ filter?: F;
40
+ }
41
+ /**
42
+ * The interface to be implemented by the service used by NodeBrowserStore
43
+ * to load nodes.
44
+ */
45
+ interface PagedTreeStoreService<F extends TreeNodeFilter> {
46
+ /**
47
+ * Get the specified page of nodes.
48
+ * @param filter The filter.
49
+ * @param pageNumber The page number.
50
+ * @param pageSize The page size.
51
+ * @param hasMockRoot If true, the root node is a mock node provided by your
52
+ * service, which implies that its Y value is 0 rather than 1. Default is
53
+ * false, meaning that your service will return a single root node with Y
54
+ * value 1.
55
+ */
56
+ getNodes(filter: F, pageNumber: number, pageSize: number, hasMockRoot?: boolean): Observable<DataPage<TreeNode>>;
57
+ }
58
+ /**
59
+ * Options for the NodeBrowserStore.
60
+ */
61
+ interface PagedTreeStoreOptions {
62
+ /**
63
+ * The size of pages in the store.
64
+ */
65
+ pageSize: number;
66
+ /**
67
+ * The size of the cache for pages in the store.
68
+ */
69
+ cacheSize: number;
70
+ /**
71
+ * A custom function for building the cache key for the given page number
72
+ * and filter.
73
+ * @param pageNumber The page number.
74
+ * @param filter The filter.
75
+ * @returns A string to be used as cache key.
76
+ */
77
+ buildCacheKey?: (pageNumber: number, filter: any) => string;
78
+ /**
79
+ * If true, the root node is a mock node provided by your service, which
80
+ * implies that its Y value is 0 rather than 1. Default is false, meaning
81
+ * that there are many root-level nodes, all with parent ID = undefined.
82
+ */
83
+ hasMockRoot?: boolean;
84
+ }
85
+ /**
86
+ * A store for the node browser component. This store is used to keep a
87
+ * list of nodes, and to load them from the API. It also keeps the root
88
+ * node. Every tree node in the list is extended with page number,
89
+ * page count and total items, plus expansion-related metadata.
90
+ * The store keeps a flat list of these tree nodes, allowing users to
91
+ * expand and collapse them.
92
+ * F is the type of the filter object, E is the type of the paged tree nodes.
93
+ */
94
+ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilter> {
95
+ private _service;
96
+ private _nodes$;
97
+ private _filter$;
98
+ private readonly _customCacheKeyBuilder?;
99
+ private readonly _cache;
100
+ private readonly _hasMockRoot;
101
+ private _pageSize;
102
+ private _dirty?;
103
+ /**
104
+ * The flat list of paged nodes in this store.
105
+ */
106
+ nodes$: Observable<Readonly<E[]>>;
107
+ /**
108
+ * The global filter for all the nodes.
109
+ */
110
+ filter$: Observable<Readonly<F>>;
111
+ /**
112
+ * The size of nodes pages in this store. If you change it, the store
113
+ * is reset. The default value is 20.
114
+ */
115
+ get pageSize(): number;
116
+ set pageSize(value: number);
117
+ /**
118
+ * Create an instance of the store.
119
+ * @param _service The service used to load nodes.
120
+ * @param options The options to configure this store.
121
+ */
122
+ constructor(_service: PagedTreeStoreService<F>, options?: PagedTreeStoreOptions);
123
+ /**
124
+ * Gets the global filter, eventually overridden with values
125
+ * from the specified node's filter.
126
+ * @param node The optional node.
127
+ * @returns The filter.
128
+ */
129
+ private getFilter;
130
+ /**
131
+ * Checks if this store is empty.
132
+ * @returns True if this store is empty.
133
+ */
134
+ isEmpty(): boolean;
135
+ /**
136
+ * Gets all the nodes in the store.
137
+ * @returns The nodes.
138
+ */
139
+ getNodes(): Readonly<PagedTreeNode<F>[]>;
140
+ /**
141
+ * Get the root node of the tree.
142
+ * @returns The root node of the tree or undefined if empty.
143
+ */
144
+ getRootNode(): PagedTreeNode<F> | undefined;
145
+ /**
146
+ * Build the cache key for the given page number and filter.
147
+ * The default implementation just returns a stringified object
148
+ * containing the page number and the filter. You may override
149
+ * this method to provide a custom cache key.
150
+ * @param pageNumber The page number.
151
+ * @param filter The filter.
152
+ * @returns A string to be used as cache key.
153
+ */
154
+ buildCacheKey(pageNumber: number, filter: F): string;
155
+ /**
156
+ * Get the specified page of nodes, either from cache or from the server.
157
+ * When the page is retrieved from the server, it is stored in cache.
158
+ * @param filter The filter to apply.
159
+ * @param pageNumber The page number to get.
160
+ * @returns Observable of the page of nodes.
161
+ */
162
+ private getPageFromCacheOrServer;
163
+ /**
164
+ * Create paged tree nodes from a page of tree nodes, by providing further
165
+ * metadata like page number, page count and total items.
166
+ * @param page The page to create nodes from.
167
+ * @returns Paged nodes.
168
+ */
169
+ private createPageNodes;
170
+ /**
171
+ * Sets the filter for this store. Whenever the filter is set,
172
+ * the store is reset.
173
+ * @param filter The filter.
174
+ * @returns true if tree was changed, false otherwise.
175
+ */
176
+ setFilter(filter: F): Promise<boolean>;
177
+ /**
178
+ * Reset the store, loading the root nodes and their children.
179
+ * @returns true if tree was changed, false otherwise.
180
+ */
181
+ reset(): Promise<boolean>;
182
+ /**
183
+ * Set the node filter for the node with the specified ID.
184
+ * @param id The node ID.
185
+ * @param filter The filter to set.
186
+ * @returns Promise with true if filter was set, false otherwise.
187
+ */
188
+ setNodeFilter(id: number, filter?: F | null): Promise<boolean>;
189
+ /**
190
+ * Expand the node with the specified ID. If the node is not expandable,
191
+ * or it is already expanded, this method does nothing.
192
+ * @param node The ID of the node to expand.
193
+ * @returns Promise with true if the node was expanded, false otherwise.
194
+ */
195
+ expand(id: number): Promise<boolean>;
196
+ /**
197
+ * Expand all the descendants of the node with the specified ID.
198
+ *
199
+ * @param id The ID of the node to expand, or undefined to expand the
200
+ * descendants of all the root level nodes.
201
+ * @returns Promise.
202
+ */
203
+ expandAll(id?: number): Promise<boolean>;
204
+ getChildren(id: number): E[];
205
+ private removeDescendants;
206
+ /**
207
+ * Collapse the node with the specified ID. If the node is not expandable,
208
+ * or it is already collapsed, this method does nothing.
209
+ * @param node The node to collapse.
210
+ * @returns Promise with true if the node was collapsed, false otherwise.
211
+ */
212
+ collapse(id: number): Promise<boolean>;
213
+ /**
214
+ * Collapse all the descendants of the node with the specified ID.
215
+ *
216
+ * @param id The ID of the node to collapse, or undefined to collapse the
217
+ * descendants of all the root level nodes.
218
+ * @returns Promise.
219
+ */
220
+ collapseAll(id?: number): Promise<boolean>;
221
+ /**
222
+ * Change the page including the node with the specified ID.
223
+ * @param parentId The ID of the parent node whose children are inside the page
224
+ * you want to change.
225
+ * @param pageNumber The new page number.
226
+ * @returns Promise with true if the page was changed, false otherwise.
227
+ */
228
+ changePage(parentId: number, pageNumber: number): Promise<boolean>;
229
+ /**
230
+ * Clear the store. The cache is cleared and the nodes are removed.
231
+ */
232
+ clear(): void;
233
+ /**
234
+ * Clear the cache.
235
+ */
236
+ clearCache(): void;
237
+ /**
238
+ * Check if the page with the given number and filter is in cache.
239
+ * @param pageNumber The page number.
240
+ * @param filter The filter.
241
+ * @returns True if the page is in cache, false otherwise.
242
+ */
243
+ hasCachedPage(pageNumber: number, filter: F): boolean;
244
+ }
245
+
246
+ declare class CompactPagerComponent {
247
+ paging: _angular_core.InputSignal<PagingInfo>;
248
+ /**
249
+ * Emits the new paging information when the user changes the page.
250
+ */
251
+ readonly pagingChange: _angular_core.OutputEmitterRef<PagingInfo>;
252
+ onFirst(): void;
253
+ onPrevious(): void;
254
+ onNext(): void;
255
+ onLast(): void;
256
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompactPagerComponent, never>;
257
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompactPagerComponent, "pdb-compact-pager", never, { "paging": { "alias": "paging"; "required": false; "isSignal": true; }; }, { "pagingChange": "pagingChange"; }, never, never, true, never>;
258
+ }
259
+
260
+ declare class RangeViewComponent {
261
+ /**
262
+ * The domain of the range view (start, limit).
263
+ */
264
+ domain: _angular_core.InputSignal<number[]>;
265
+ /**
266
+ * The range of the range view (start, limit).
267
+ */
268
+ range: _angular_core.InputSignal<number[]>;
269
+ /**
270
+ * The width of the component.
271
+ */
272
+ width: _angular_core.InputSignal<number>;
273
+ /**
274
+ * The height of the component.
275
+ */
276
+ height: _angular_core.InputSignal<number>;
277
+ scaledRange: _angular_core.Signal<number[]>;
278
+ constructor();
279
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RangeViewComponent, never>;
280
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RangeViewComponent, "pdb-range-view", never, { "domain": { "alias": "domain"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
281
+ }
282
+
283
+ /**
284
+ * A request to change the page number of a node's children.
285
+ */
286
+ interface PageChangeRequest {
287
+ node: PagedTreeNode<any>;
288
+ paging: PagingInfo;
289
+ }
290
+ /**
291
+ * Browser tree node component view. This wraps some HTML content providing
292
+ * a toggle button to expand/collapse the node, a paging control for the
293
+ * node's children, and a button to edit the node's filter. You should then
294
+ * provide the HTML content to display the node's data inside this component, e.g.
295
+ * <pdb-browser-tree-node [node]="node">
296
+ * <your-node-view [node]="node" />
297
+ * <pdb-browser-tree-node>
298
+ */
299
+ declare class BrowserTreeNodeComponent {
300
+ /**
301
+ * The node to display.
302
+ */
303
+ readonly node: _angular_core.InputSignal<PagedTreeNode<any> | null | undefined>;
304
+ /**
305
+ * The paging information for the node's children.
306
+ */
307
+ readonly paging: _angular_core.InputSignal<PagingInfo | undefined>;
308
+ /**
309
+ * True to show debug information.
310
+ */
311
+ readonly debug: _angular_core.InputSignal<boolean | undefined>;
312
+ /**
313
+ * True to hide the node's loc and label. This is useful if you want to
314
+ * provide your own view for the node, between the expansion toggle and
315
+ * the filter edit button. In this case, in your consumer template provide
316
+ * your own view as the content of this component. If instead you are fine
317
+ * with the default loc and label, and just want to add more data to
318
+ * the view, then you can just add your own content to this component's
319
+ * template, without setting this property to true.
320
+ */
321
+ readonly hideLabel: _angular_core.InputSignal<boolean | undefined>;
322
+ /**
323
+ * True to hide the node's location (y and x).
324
+ */
325
+ readonly hideLoc: _angular_core.InputSignal<boolean | undefined>;
326
+ /**
327
+ * True to hide the node's paging control unless hovered.
328
+ */
329
+ readonly hidePaging: _angular_core.InputSignal<boolean | undefined>;
330
+ /**
331
+ * True to hide the node's filter edit button.
332
+ */
333
+ readonly hideFilter: _angular_core.InputSignal<boolean | undefined>;
334
+ /**
335
+ * The indent size for the node's children.
336
+ */
337
+ readonly indentSize: _angular_core.InputSignal<number>;
338
+ /**
339
+ * The width of the range view.
340
+ */
341
+ readonly rangeWidth: _angular_core.InputSignal<number>;
342
+ /**
343
+ * Emits when the user wants to toggle the expanded state of the node.
344
+ */
345
+ readonly toggleExpandedRequest: _angular_core.OutputEmitterRef<PagedTreeNode<any>>;
346
+ /**
347
+ * Emits when the user wants to change the page number of the node's children.
348
+ */
349
+ readonly changePageRequest: _angular_core.OutputEmitterRef<PageChangeRequest>;
350
+ /**
351
+ * Emits when the user wants to edit the node's filter.
352
+ */
353
+ readonly editNodeFilterRequest: _angular_core.OutputEmitterRef<PagedTreeNode<any>>;
354
+ onToggleExpanded(): void;
355
+ onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void;
356
+ onEditFilter(): void;
357
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrowserTreeNodeComponent, never>;
358
+ static ɵcmp: _angular_core.ɵɵ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>;
359
+ }
360
+
361
+ /**
362
+ * Options for the paged list store.
363
+ */
364
+ interface PagedListStoreOptions {
365
+ /**
366
+ * The size of pages in the store.
367
+ */
368
+ pageSize: number;
369
+ /**
370
+ * The size of the cache for pages in the store.
371
+ */
372
+ cacheSize: number;
373
+ /**
374
+ * A custom function for building the cache key for the given page number
375
+ * and filter.
376
+ * @param pageNumber The page number.
377
+ * @param filter The filter.
378
+ * @returns A string to be used as cache key.
379
+ */
380
+ buildCacheKey?: (pageNumber: number, filter: any) => string;
381
+ }
382
+ /**
383
+ * Default options for the paged list store.
384
+ */
385
+ declare const DEFAULT_PAGED_LIST_STORE_OPTIONS: PagedListStoreOptions;
386
+ /**
387
+ * The interface to be implemented by the service used by PagedListStore.
388
+ */
389
+ interface PagedListStoreService<F, E> {
390
+ /**
391
+ * Load the page with the given number.
392
+ * @param pageNumber The page number to load.
393
+ * @param pageSize The size of the page to load.
394
+ * @param filter The filter to apply.
395
+ */
396
+ loadPage(pageNumber: number, pageSize: number, filter: F): Observable<DataPage<E>>;
397
+ }
398
+ /**
399
+ * A generic paged list store using a filter object of type F
400
+ * and a list of elements of type E.
401
+ */
402
+ declare class PagedListStore<F, E> {
403
+ private _service;
404
+ private _pageSize;
405
+ private readonly _customCacheKeyBuilder?;
406
+ private _page$;
407
+ private _filter$;
408
+ private readonly _cache;
409
+ /**
410
+ * The page. It is updated when the page is changed or the filter is changed.
411
+ */
412
+ page$: Observable<Readonly<DataPage<E>>>;
413
+ /**
414
+ * The filter. It is updated when the filter is changed.
415
+ */
416
+ filter$: Observable<Readonly<F>>;
417
+ /**
418
+ * The size of nodes pages in this store. If you change it, the store
419
+ * is reset. The default value is 20.
420
+ */
421
+ get pageSize(): number;
422
+ set pageSize(value: number);
423
+ /**
424
+ * Create a new paged list store.
425
+ * @param options Options for the paged list store.
426
+ */
427
+ constructor(_service: PagedListStoreService<F, E>, options?: PagedListStoreOptions);
428
+ /**
429
+ * Returns true if the store is empty, false otherwise.
430
+ * @returns true if the store is empty, false otherwise.
431
+ */
432
+ isEmpty(): boolean;
433
+ /**
434
+ * Build the cache key for the given page number and filter.
435
+ * The default implementation just returns a stringified object
436
+ * containing the page number and the filter. You may override
437
+ * this method to provide a custom cache key.
438
+ * @param pageNumber The page number.
439
+ * @param filter The filter.
440
+ * @returns A string to be used as cache key.
441
+ */
442
+ buildCacheKey(pageNumber: number, filter: F): string;
443
+ /**
444
+ * Load the page with the given number.
445
+ * @param pageNumber the page number to load.
446
+ */
447
+ private loadPage;
448
+ /**
449
+ * Set the page with the given number.
450
+ * @param pageNumber The page number to load.
451
+ * @param pageSize The page size.
452
+ * @returns Promise which resolves when the page is loaded.
453
+ */
454
+ setPage(pageNumber: number, pageSize?: number): Promise<void>;
455
+ /**
456
+ * Get the current page.
457
+ * @returns The current page.
458
+ */
459
+ getPage(): DataPage<E>;
460
+ /**
461
+ * Apply the given filter and load the first page.
462
+ * @param filter The filter to apply.
463
+ * @returns Promise which resolves when the page is loaded.
464
+ */
465
+ setFilter(filter: F): Promise<void>;
466
+ /**
467
+ * Get the current filter.
468
+ * @returns The current filter.
469
+ */
470
+ getFilter(): F;
471
+ /**
472
+ * Reset the filter and load the first page. The cache is cleared.
473
+ * @returns Promise which resolves when the page is loaded.
474
+ */
475
+ reset(): Promise<void>;
476
+ /**
477
+ * Clear the store. The cache is cleared and the page is emptied.
478
+ */
479
+ clear(): void;
480
+ /**
481
+ * Clear the cache.
482
+ */
483
+ clearCache(): void;
484
+ /**
485
+ * Check if the page with the given number and filter is in cache.
486
+ * @param pageNumber The page number.
487
+ * @param filter The filter.
488
+ * @returns True if the page is in cache, false otherwise.
489
+ */
490
+ hasCachedPage(pageNumber: number, filter: F): boolean;
491
+ }
492
+
493
+ /**
494
+ * A Least Recently Used cache that can be used to store any type of object.
495
+ * The cache works in two modes: considering the size of the objects or not.
496
+ * If the size is considered, the cache will have a maximum size and will
497
+ * remove the oldest objects when the maximum size is reached. Note that
498
+ * the size is only roughly estimated. This avoids removing too many
499
+ * entries from the cache when the maximum is reached.
500
+ * If the size is not considered, the cache will have a maximum number of
501
+ * objects and will remove the oldest objects when the maximum number is
502
+ * reached.
503
+ */
504
+ declare class LRUCache<T> {
505
+ private _maxSize;
506
+ private _totalSize;
507
+ private _considerSize;
508
+ private _cache;
509
+ private _sizes;
510
+ /**
511
+ * Creates a new cache.
512
+ * @param maxSize The maximum size of the cache. This is either
513
+ * the maximum number of items in the cache (when considerSize
514
+ * is false) or the maximum total size of all items in the
515
+ * cache in bytes (when considerSize is true).
516
+ * @param considerSize True if the size of the objects should be
517
+ * considered.
518
+ */
519
+ constructor(maxSize: number, considerSize?: boolean);
520
+ /**
521
+ * Get an item from the cache.
522
+ * @param key The key of the item to get.
523
+ * @returns The item or undefined if the item is not in the cache.
524
+ */
525
+ get(key: string): T | undefined;
526
+ /**
527
+ * Check if an item is in the cache.
528
+ * @param key The key of the item to check.
529
+ * @returns True if the item is in cache.
530
+ */
531
+ has(key: string): boolean;
532
+ /**
533
+ * Put an item in the cache.
534
+ * @param key The key of the item to put.
535
+ * @param item The item to put.
536
+ * @param size The estimated size of the item in bytes.
537
+ * This must be calculated by the caller but only when
538
+ * considerSize is true.
539
+ */
540
+ put(key: string, item: T, size: number): void;
541
+ /**
542
+ * Clear the cache.
543
+ */
544
+ clear(): void;
545
+ /**
546
+ * Estimate the size of an object in bytes.
547
+ * @param obj The object to calculate the size of.
548
+ * @returns The estimated size of the object in bytes.
549
+ */
550
+ static calculateObjectSize(obj: any): number;
551
+ }
552
+
553
+ export { BrowserTreeNodeComponent, CompactPagerComponent, DEFAULT_PAGED_LIST_STORE_OPTIONS, LRUCache, PagedListStore, PagedTreeStore, RangeViewComponent };
554
+ export type { PageChangeRequest, PagedListStoreOptions, PagedListStoreService, PagedTreeNode, PagedTreeStoreOptions, PagedTreeStoreService, PagingInfo, TreeNode, TreeNodeFilter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/paged-data-browsers",
3
- "version": "4.0.1",
3
+ "version": "5.0.0",
4
4
  "description": "Generic simple paged data browsers.",
5
5
  "keywords": [
6
6
  "data browsers"
@@ -14,11 +14,11 @@
14
14
  "name": "Daniele Fusi"
15
15
  },
16
16
  "peerDependencies": {
17
- "@angular/common": "^19.0.0",
18
- "@angular/core": "^19.0.0",
19
- "@angular/forms": "^19.0.0",
20
- "@angular/material": "^19.0.0",
21
- "@myrmidon/ngx-tools": "^0.0.1"
17
+ "@angular/common": "^20.0.0",
18
+ "@angular/core": "^20.0.0",
19
+ "@angular/forms": "^20.0.0",
20
+ "@angular/material": "^20.0.1",
21
+ "@myrmidon/ngx-tools": "^2.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "tslib": "^2.3.0"
@@ -1,79 +0,0 @@
1
- import { PagedTreeNode, PagingInfo } from '../../services/paged-tree.store';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * A request to change the page number of a node's children.
5
- */
6
- export interface PageChangeRequest {
7
- node: PagedTreeNode<any>;
8
- paging: PagingInfo;
9
- }
10
- /**
11
- * Browser tree node component view. This wraps some HTML content providing
12
- * a toggle button to expand/collapse the node, a paging control for the
13
- * node's children, and a button to edit the node's filter. You should then
14
- * provide the HTML content to display the node's data inside this component, e.g.
15
- * <pdb-browser-tree-node [node]="node">
16
- * <your-node-view [node]="node" />
17
- * <pdb-browser-tree-node>
18
- */
19
- export declare class BrowserTreeNodeComponent {
20
- /**
21
- * The node to display.
22
- */
23
- readonly node: import("@angular/core").InputSignal<PagedTreeNode<any> | null | undefined>;
24
- /**
25
- * The paging information for the node's children.
26
- */
27
- readonly paging: import("@angular/core").InputSignal<PagingInfo | undefined>;
28
- /**
29
- * True to show debug information.
30
- */
31
- readonly debug: import("@angular/core").InputSignal<boolean | undefined>;
32
- /**
33
- * True to hide the node's loc and label. This is useful if you want to
34
- * provide your own view for the node, between the expansion toggle and
35
- * the filter edit button. In this case, in your consumer template provide
36
- * your own view as the content of this component. If instead you are fine
37
- * with the default loc and label, and just want to add more data to
38
- * the view, then you can just add your own content to this component's
39
- * template, without setting this property to true.
40
- */
41
- readonly hideLabel: import("@angular/core").InputSignal<boolean | undefined>;
42
- /**
43
- * True to hide the node's location (y and x).
44
- */
45
- readonly hideLoc: import("@angular/core").InputSignal<boolean | undefined>;
46
- /**
47
- * True to hide the node's paging control unless hovered.
48
- */
49
- readonly hidePaging: import("@angular/core").InputSignal<boolean | undefined>;
50
- /**
51
- * True to hide the node's filter edit button.
52
- */
53
- readonly hideFilter: import("@angular/core").InputSignal<boolean | undefined>;
54
- /**
55
- * The indent size for the node's children.
56
- */
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>;
62
- /**
63
- * Emits when the user wants to toggle the expanded state of the node.
64
- */
65
- readonly toggleExpandedRequest: import("@angular/core").OutputEmitterRef<PagedTreeNode<any>>;
66
- /**
67
- * Emits when the user wants to change the page number of the node's children.
68
- */
69
- readonly changePageRequest: import("@angular/core").OutputEmitterRef<PageChangeRequest>;
70
- /**
71
- * Emits when the user wants to edit the node's filter.
72
- */
73
- readonly editNodeFilterRequest: import("@angular/core").OutputEmitterRef<PagedTreeNode<any>>;
74
- onToggleExpanded(): void;
75
- onPagingChange(node: PagedTreeNode<any>, paging: PagingInfo): void;
76
- onEditFilter(): void;
77
- static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTreeNodeComponent, 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>;
79
- }
@@ -1,15 +0,0 @@
1
- import { PagingInfo } from '../../services/paged-tree.store';
2
- import * as i0 from "@angular/core";
3
- export declare class CompactPagerComponent {
4
- paging: import("@angular/core").InputSignal<PagingInfo>;
5
- /**
6
- * Emits the new paging information when the user changes the page.
7
- */
8
- readonly pagingChange: import("@angular/core").OutputEmitterRef<PagingInfo>;
9
- onFirst(): void;
10
- onPrevious(): void;
11
- onNext(): void;
12
- onLast(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<CompactPagerComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<CompactPagerComponent, "pdb-compact-pager", never, { "paging": { "alias": "paging"; "required": false; "isSignal": true; }; }, { "pagingChange": "pagingChange"; }, never, never, true, never>;
15
- }