@acorex/components 20.2.47 → 20.2.49

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
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@acorex/components",
3
- "version": "20.2.47",
3
+ "version": "20.2.49",
4
4
  "peerDependencies": {
5
- "@acorex/core": "20.2.47",
6
- "@acorex/cdk": "20.2.47",
5
+ "@acorex/core": "20.2.49",
6
+ "@acorex/cdk": "20.2.49",
7
7
  "@angular/common": "^20.0.0",
8
8
  "@angular/core": "^20.0.0",
9
9
  "@angular/cdk": "^20.0.0",
@@ -235,6 +235,138 @@ declare class AXTreeViewComponent {
235
235
  * Check if a node is currently loading
236
236
  */
237
237
  isNodeLoading(nodeId: string): boolean;
238
+ /**
239
+ * Edit/update a node's properties
240
+ * @param nodeId - The ID of the node to edit
241
+ * @param updates - Partial node object with properties to update
242
+ * @returns true if node was found and updated, false otherwise
243
+ */
244
+ editNode(nodeId: string, updates: Partial<AXTreeViewNode>): boolean;
245
+ /**
246
+ * Add a child node to a parent node
247
+ * @param parentId - The ID of the parent node
248
+ * @param childNode - The child node to add
249
+ * @param index - Optional index to insert at (default: append to end)
250
+ * @returns true if parent was found and child was added, false otherwise
251
+ */
252
+ addChild(parentId: string, childNode: AXTreeViewNode, index?: number): boolean;
253
+ /**
254
+ * Remove a node from the tree
255
+ * @param nodeId - The ID of the node to remove
256
+ * @returns The removed node if found, null otherwise
257
+ */
258
+ removeNode(nodeId: string): AXTreeViewNode | null;
259
+ /**
260
+ * Expand a specific node
261
+ * @param nodeId - The ID of the node to expand
262
+ * @returns Promise that resolves when expansion is complete (if lazy loading)
263
+ */
264
+ expandNode(nodeId: string): Promise<void>;
265
+ /**
266
+ * Collapse a specific node
267
+ * @param nodeId - The ID of the node to collapse
268
+ */
269
+ collapseNode(nodeId: string): void;
270
+ /**
271
+ * Toggle expansion state of a specific node
272
+ * @param nodeId - The ID of the node to toggle
273
+ * @returns Promise that resolves when toggle is complete (if lazy loading)
274
+ */
275
+ toggleNodeExpansion(nodeId: string): Promise<void>;
276
+ /**
277
+ * Programmatically select a node
278
+ * @param nodeId - The ID of the node to select
279
+ * @returns true if node was found and selected, false otherwise
280
+ */
281
+ selectNode(nodeId: string): boolean;
282
+ /**
283
+ * Programmatically deselect a node
284
+ * @param nodeId - The ID of the node to deselect
285
+ * @returns true if node was found and deselected, false otherwise
286
+ */
287
+ deselectNode(nodeId: string): boolean;
288
+ /**
289
+ * Get parent node of a given node
290
+ * @param nodeId - The ID of the node
291
+ * @returns The parent node if found, null otherwise
292
+ */
293
+ getParent(nodeId: string): AXTreeViewNode | null;
294
+ /**
295
+ * Get children of a node
296
+ * @param nodeId - The ID of the parent node
297
+ * @returns Array of child nodes, or null if node not found
298
+ */
299
+ getChildren(nodeId: string): AXTreeViewNode[] | null;
300
+ /**
301
+ * Get all root nodes
302
+ * @returns Array of root nodes
303
+ */
304
+ getRootNodes(): AXTreeViewNode[];
305
+ /**
306
+ * Get all nodes in a flat array
307
+ * @returns Array of all nodes in the tree
308
+ */
309
+ getAllNodes(): AXTreeViewNode[];
310
+ /**
311
+ * Get the path to a node (array of parent IDs from root to node)
312
+ * @param nodeId - The ID of the node
313
+ * @returns Array of node IDs representing the path, or empty array if node not found
314
+ */
315
+ getNodePath(nodeId: string): string[];
316
+ /**
317
+ * Get the level/depth of a node (0 = root level)
318
+ * @param nodeId - The ID of the node
319
+ * @returns The level of the node, or -1 if node not found
320
+ */
321
+ getNodeLevel(nodeId: string): number;
322
+ /**
323
+ * Programmatically move a node to a new parent
324
+ * @param nodeId - The ID of the node to move
325
+ * @param newParentId - The ID of the new parent (undefined for root level)
326
+ * @param index - Optional index to insert at (default: append to end)
327
+ * @returns true if move was successful, false otherwise
328
+ */
329
+ moveNode(nodeId: string, newParentId?: string, index?: number): boolean;
330
+ /**
331
+ * Clone a node (creates a deep copy)
332
+ * @param nodeId - The ID of the node to clone
333
+ * @returns The cloned node, or null if node not found
334
+ */
335
+ cloneNode(nodeId: string): AXTreeViewNode | null;
336
+ /**
337
+ * Focus a specific node by ID
338
+ * @param nodeId - The ID of the node to focus
339
+ * @returns true if node was found and focused, false otherwise
340
+ */
341
+ focusNode(nodeId: string): boolean;
342
+ /**
343
+ * Get all expanded nodes
344
+ * @returns Array of expanded nodes
345
+ */
346
+ getExpandedNodes(): AXTreeViewNode[];
347
+ /**
348
+ * Get all collapsed nodes that have children
349
+ * @returns Array of collapsed nodes with children
350
+ */
351
+ getCollapsedNodes(): AXTreeViewNode[];
352
+ /**
353
+ * Check if a node is expanded
354
+ * @param nodeId - The ID of the node
355
+ * @returns true if node is expanded, false otherwise
356
+ */
357
+ isNodeExpanded(nodeId: string): boolean;
358
+ /**
359
+ * Check if a node is selected
360
+ * @param nodeId - The ID of the node
361
+ * @returns true if node is selected, false otherwise
362
+ */
363
+ isNodeSelected(nodeId: string): boolean;
364
+ /**
365
+ * Check if a node has children
366
+ * @param nodeId - The ID of the node
367
+ * @returns true if node has children, false otherwise
368
+ */
369
+ hasChildren(nodeId: string): boolean;
238
370
  /**
239
371
  * Get template context for a node
240
372
  */
@@ -317,8 +449,14 @@ declare class AXTreeViewComponent {
317
449
  private loadNodeChildren;
318
450
  /**
319
451
  * Internal method to refresh nodes signal and sync back to datasource if it's an array
452
+ * Creates new array references for all nested children to ensure reactivity
320
453
  */
321
454
  private refreshNodes;
455
+ /**
456
+ * Recursively ensure all children arrays have new references to trigger change detection
457
+ * Mutates the tree structure by replacing children arrays with new array references
458
+ */
459
+ private ensureNewArrayReferences;
322
460
  /**
323
461
  * Handle single selection mode
324
462
  */
@@ -501,6 +639,33 @@ declare class AXTreeViewService {
501
639
  * Get list prefix constant
502
640
  */
503
641
  getListPrefix(): string;
642
+ /**
643
+ * Get all nodes in a flat array
644
+ */
645
+ getAllNodes(nodes: AXTreeViewNode[]): AXTreeViewNode[];
646
+ /**
647
+ * Get the path to a node (array of parent nodes from root to node)
648
+ */
649
+ getNodePath(nodes: AXTreeViewNode[], nodeId: string): AXTreeViewNode[];
650
+ /**
651
+ * Get the level/depth of a node (0 = root level)
652
+ */
653
+ getNodeLevel(nodes: AXTreeViewNode[], nodeId: string): number;
654
+ /**
655
+ * Get sibling nodes of a given node
656
+ */
657
+ getSiblings(nodes: AXTreeViewNode[], nodeId: string): AXTreeViewNode[];
658
+ /**
659
+ * Clone a node (creates a deep copy)
660
+ */
661
+ cloneNode(node: AXTreeViewNode): AXTreeViewNode;
662
+ /**
663
+ * Validate node structure (check for required fields and circular references)
664
+ */
665
+ validateNode(node: AXTreeViewNode, visitedIds?: Set<string>): {
666
+ valid: boolean;
667
+ errors: string[];
668
+ };
504
669
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewService, never>;
505
670
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXTreeViewService>;
506
671
  }