@myrmidon/paged-data-browsers 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ interface PagingInfo {
|
|
|
32
32
|
total: number;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* A tree node with paging information, used in
|
|
35
|
+
* A tree node with paging information, used in PagedTreeStore.
|
|
36
36
|
*/
|
|
37
37
|
interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {
|
|
38
38
|
paging: PagingInfo;
|
|
@@ -40,7 +40,7 @@ interface PagedTreeNode<F extends TreeNodeFilter> extends TreeNode {
|
|
|
40
40
|
filter?: F;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* The interface to be implemented by the service used by
|
|
43
|
+
* The interface to be implemented by the service used by PagedTreeStore
|
|
44
44
|
* to load nodes.
|
|
45
45
|
*/
|
|
46
46
|
interface PagedTreeStoreService<F extends TreeNodeFilter> {
|
|
@@ -194,9 +194,10 @@ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilte
|
|
|
194
194
|
* Expand the node with the specified ID. If the node is not expandable,
|
|
195
195
|
* or it is already expanded, this method does nothing.
|
|
196
196
|
* @param node The ID of the node to expand.
|
|
197
|
+
* @param silent If true, don't clear hilites (used internally).
|
|
197
198
|
* @returns Promise with true if the node was expanded, false otherwise.
|
|
198
199
|
*/
|
|
199
|
-
expand(id: number): Promise<boolean>;
|
|
200
|
+
expand(id: number, silent?: boolean): Promise<boolean>;
|
|
200
201
|
/**
|
|
201
202
|
* Expand all the descendants of the node with the specified ID.
|
|
202
203
|
*
|
|
@@ -233,9 +234,10 @@ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilte
|
|
|
233
234
|
* @param parentId The ID of the parent node whose children are inside the page
|
|
234
235
|
* you want to change.
|
|
235
236
|
* @param pageNumber The new page number.
|
|
237
|
+
* @param silent If true, don't clear hilites (used internally).
|
|
236
238
|
* @returns Promise with true if the page was changed, false otherwise.
|
|
237
239
|
*/
|
|
238
|
-
changePage(parentId: number, pageNumber: number): Promise<boolean>;
|
|
240
|
+
changePage(parentId: number, pageNumber: number, silent?: boolean): Promise<boolean>;
|
|
239
241
|
/**
|
|
240
242
|
* Clear the store. The cache is cleared and the nodes are removed.
|
|
241
243
|
*/
|
|
@@ -277,10 +279,10 @@ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilte
|
|
|
277
279
|
*/
|
|
278
280
|
private searchNodeAndDescendants;
|
|
279
281
|
/**
|
|
280
|
-
* Ensure a node
|
|
281
|
-
* @param nodeId The ID of the node
|
|
282
|
+
* Ensure all ancestors of a node are expanded (used internally by findLabels).
|
|
283
|
+
* @param nodeId The ID of the node whose ancestors should be expanded.
|
|
282
284
|
*/
|
|
283
|
-
private
|
|
285
|
+
private ensureAncestorsExpandedInternal;
|
|
284
286
|
private get _isEditable();
|
|
285
287
|
private get _editableService();
|
|
286
288
|
/**
|
|
@@ -337,6 +339,58 @@ declare class PagedTreeStore<E extends PagedTreeNode<F>, F extends TreeNodeFilte
|
|
|
337
339
|
* Clear all unsaved changes.
|
|
338
340
|
*/
|
|
339
341
|
clearUnsavedChanges(): void;
|
|
342
|
+
/**
|
|
343
|
+
* Ensure that the node with the specified ID is visible in the tree.
|
|
344
|
+
* This method will:
|
|
345
|
+
* 1. Optionally refresh data by clearing cache
|
|
346
|
+
* 2. Find the node and determine which page it's on
|
|
347
|
+
* 3. Expand all ancestor nodes to make it visible
|
|
348
|
+
* 4. Navigate to the page containing the node
|
|
349
|
+
* 5. Optionally set the node's expanded/collapsed state
|
|
350
|
+
*
|
|
351
|
+
* @param id The ID of the node to make visible.
|
|
352
|
+
* @param expanded If true, expand the node; if false, collapse it; if undefined, don't change.
|
|
353
|
+
* @param refresh If true, clear cache to reload data from service.
|
|
354
|
+
* @returns Promise that resolves to true if successful, false otherwise.
|
|
355
|
+
*/
|
|
356
|
+
ensureNodeVisible(id: number, expanded?: boolean, refresh?: boolean): Promise<boolean>;
|
|
357
|
+
/**
|
|
358
|
+
* Find and load a node that is not currently visible by querying the service
|
|
359
|
+
* to build the path from root to the target node, then expand only the nodes
|
|
360
|
+
* on that path.
|
|
361
|
+
* @param id The ID of the node to find.
|
|
362
|
+
* @returns The node if found, undefined otherwise.
|
|
363
|
+
*/
|
|
364
|
+
private findAndLoadNode;
|
|
365
|
+
/**
|
|
366
|
+
* Find the path from root to a target node by querying the service.
|
|
367
|
+
* @param targetId The ID of the target node.
|
|
368
|
+
* @returns Array of nodes from root to target, or undefined if not found.
|
|
369
|
+
*/
|
|
370
|
+
private findNodePath;
|
|
371
|
+
/**
|
|
372
|
+
* Ensure all ancestors of a node are expanded.
|
|
373
|
+
* @param nodeId The ID of the node whose ancestors should be expanded.
|
|
374
|
+
*/
|
|
375
|
+
private ensureAncestorsExpanded;
|
|
376
|
+
/**
|
|
377
|
+
* Get all siblings of a node, including those not currently visible.
|
|
378
|
+
* @param node The node whose siblings to retrieve.
|
|
379
|
+
* @returns Array of all siblings.
|
|
380
|
+
*/
|
|
381
|
+
private getAllSiblings;
|
|
382
|
+
/**
|
|
383
|
+
* Get the ID of the node that should be selected after deleting the
|
|
384
|
+
* node with the specified ID. This follows the priority:
|
|
385
|
+
* 1. Next sibling of the deleted node
|
|
386
|
+
* 2. Previous sibling of the deleted node
|
|
387
|
+
* 3. Parent node of the deleted node
|
|
388
|
+
* 4. null if none of the above exist
|
|
389
|
+
*
|
|
390
|
+
* @param id The ID of the node to be deleted.
|
|
391
|
+
* @returns The ID of the anchor node, or null if none can be determined.
|
|
392
|
+
*/
|
|
393
|
+
getAnchorForDeletedNode(id: number): number | null;
|
|
340
394
|
}
|
|
341
395
|
|
|
342
396
|
declare class CompactPagerComponent {
|