ngx-core-components 0.3.27 → 0.3.29

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.
Files changed (34) hide show
  1. package/ai/ai-chat/ai-chat.component.d.ts +9 -1
  2. package/ai/ai-chat-widget/ai-chat-widget.component.d.ts +3 -1
  3. package/ai/ai-prompt-editor/ai-prompt-editor.component.d.ts +14 -1
  4. package/ai/ai-rag-inspector/ai-rag-inspector.component.d.ts +6 -0
  5. package/charts/gauge-chart/gauge-chart.component.d.ts +18 -2
  6. package/fesm2022/ngx-core-components-ai.mjs +633 -258
  7. package/fesm2022/ngx-core-components-ai.mjs.map +1 -1
  8. package/fesm2022/ngx-core-components-charts.mjs +274 -36
  9. package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
  10. package/fesm2022/ngx-core-components-grid.mjs +3635 -892
  11. package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
  12. package/fesm2022/ngx-core-components-inputs.mjs +56 -14
  13. package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
  14. package/fesm2022/ngx-core-components-views.mjs +308 -117
  15. package/fesm2022/ngx-core-components-views.mjs.map +1 -1
  16. package/grid/data-grid/components/grid-filter-builder/grid-filter-builder.component.d.ts +70 -0
  17. package/grid/data-grid/components/grid-status-bar/grid-status-bar.component.d.ts +25 -0
  18. package/grid/data-grid/data-grid.component.d.ts +18 -1
  19. package/grid/data-grid/models.d.ts +65 -0
  20. package/grid/data-grid/services/grid-clipboard.service.d.ts +40 -0
  21. package/grid/data-grid/services/grid-edit.service.d.ts +48 -0
  22. package/grid/data-grid/services/grid-export-xlsx.service.d.ts +67 -0
  23. package/grid/data-grid/services/grid-keyboard.service.d.ts +70 -0
  24. package/grid/data-grid/services/grid-selection.service.d.ts +36 -0
  25. package/grid/data-grid/services/grid-state.service.d.ts +41 -0
  26. package/grid/data-grid/services/grid-virtualization.service.d.ts +81 -0
  27. package/grid/data-grid/utils/grid-aggregate.util.d.ts +13 -0
  28. package/grid/data-grid/utils/grid-filter.util.d.ts +11 -0
  29. package/grid/data-grid/utils/grid-sort.util.d.ts +17 -0
  30. package/grid/pivot-grid/pivot-grid.component.d.ts +15 -2
  31. package/grid/public-api.d.ts +17 -1
  32. package/inputs/segmented-control/segmented-control.component.d.ts +12 -3
  33. package/package.json +1 -1
  34. package/views/tree-view/tree-view.component.d.ts +20 -2
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, output, signal, ChangeDetectionStrategy, Component, inject, computed, effect, ContentChild, ViewChildren, Directive, contentChild, TemplateRef, HostListener, ViewChild, model } from '@angular/core';
2
+ import { input, output, signal, computed, ChangeDetectionStrategy, Component, inject, effect, ContentChild, ViewChildren, Directive, contentChild, TemplateRef, HostListener, ViewChild, model } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
- import { NgTemplateOutlet, CommonModule } from '@angular/common';
4
+ import { CommonModule, NgTemplateOutlet } from '@angular/common';
5
5
  import { NGX_CORE_I18N } from 'ngx-core-components/i18n';
6
6
  import * as i1$1 from '@angular/forms';
7
7
  import { FormsModule } from '@angular/forms';
@@ -12,23 +12,94 @@ class TreeViewComponent {
12
12
  checkable = input(false);
13
13
  selectedId = input(null);
14
14
  expandedIds = input([]);
15
+ showSearch = input(false);
16
+ searchPlaceholder = input('Search nodes...');
17
+ showActions = input(false);
18
+ theme = input('light');
19
+ // Outputs
15
20
  nodeSelect = output();
16
21
  nodeExpand = output();
17
22
  nodeCollapse = output();
18
23
  checkChange = output();
24
+ actionClick = output();
25
+ // State Signals
19
26
  expandedSet = signal(new Set());
20
27
  checkedSet = signal(new Set());
28
+ indeterminateSet = signal(new Set());
21
29
  focusedId = signal(null);
22
- isExpanded(id) { return this.expandedSet().has(id) || this.expandedIds().includes(id); }
23
- isChecked(id) { return this.checkedSet().has(id); }
24
- hasNodeChildren(node) { return !!(node.children?.length || node.hasChildren); }
30
+ searchQuery = signal('');
31
+ ngOnInit() {
32
+ // Sync initial expanded ids
33
+ if (this.expandedIds().length > 0) {
34
+ this.expandedSet.set(new Set(this.expandedIds()));
35
+ }
36
+ this.updateAncestorCheckStates();
37
+ }
38
+ isExpanded(id) {
39
+ return this.expandedSet().has(id) || this.expandedIds().includes(id);
40
+ }
41
+ isChecked(id) {
42
+ return this.checkedSet().has(id);
43
+ }
44
+ isIndeterminate(id) {
45
+ return this.indeterminateSet().has(id);
46
+ }
47
+ hasNodeChildren(node) {
48
+ return !!(node.children?.length || node.hasChildren);
49
+ }
50
+ // Computed signal that filters the nodes reactively based on searchQuery
51
+ filteredNodes = computed(() => {
52
+ const query = this.searchQuery().trim().toLowerCase();
53
+ if (!query) {
54
+ return this.nodes();
55
+ }
56
+ const expanded = new Set(this.expandedSet());
57
+ const filterList = (list) => {
58
+ const match = [];
59
+ let hasAnyMatch = false;
60
+ for (const node of list) {
61
+ const matchesSelf = node.label.toLowerCase().includes(query);
62
+ let childrenMatches = [];
63
+ let hasChildrenMatch = false;
64
+ if (node.children) {
65
+ const res = filterList(node.children);
66
+ childrenMatches = res.match;
67
+ hasChildrenMatch = res.hasMatch;
68
+ }
69
+ if (matchesSelf || hasChildrenMatch) {
70
+ hasAnyMatch = true;
71
+ // Auto-expand paths to matching elements
72
+ if (hasChildrenMatch) {
73
+ expanded.add(node.id);
74
+ }
75
+ match.push({
76
+ ...node,
77
+ children: node.children ? childrenMatches : undefined
78
+ });
79
+ }
80
+ }
81
+ return { match, hasMatch: hasAnyMatch };
82
+ };
83
+ const result = filterList(this.nodes()).match;
84
+ // Trigger expansion outside signal computation loop
85
+ setTimeout(() => {
86
+ this.expandedSet.set(expanded);
87
+ }, 0);
88
+ return result;
89
+ });
90
+ onSearchInput(event) {
91
+ const val = event.target.value;
92
+ this.searchQuery.set(val);
93
+ }
94
+ clearSearch() {
95
+ this.searchQuery.set('');
96
+ }
25
97
  onNodeClick(node, e) {
26
98
  e.stopPropagation();
27
99
  this.focusedId.set(node.id);
28
- if (this.selectable())
100
+ if (this.selectable()) {
29
101
  this.nodeSelect.emit({ node });
30
- if (this.hasNodeChildren(node))
31
- this.toggleExpand(node, e);
102
+ }
32
103
  }
33
104
  toggleExpand(node, e) {
34
105
  e.stopPropagation();
@@ -46,10 +117,67 @@ class TreeViewComponent {
46
117
  onCheck(node) {
47
118
  const s = new Set(this.checkedSet());
48
119
  const checked = !s.has(node.id);
49
- checked ? s.add(node.id) : s.delete(node.id);
120
+ // Recursively check/uncheck descendants
121
+ const toggleDescendants = (n, checkVal) => {
122
+ if (checkVal) {
123
+ s.add(n.id);
124
+ }
125
+ else {
126
+ s.delete(n.id);
127
+ }
128
+ if (n.children) {
129
+ for (const child of n.children) {
130
+ toggleDescendants(child, checkVal);
131
+ }
132
+ }
133
+ };
134
+ toggleDescendants(node, checked);
50
135
  this.checkedSet.set(s);
136
+ // Calculate indeterminate and checked states up the chain
137
+ this.updateAncestorCheckStates();
51
138
  this.checkChange.emit({ node, checked });
52
139
  }
140
+ updateAncestorCheckStates() {
141
+ const checked = new Set(this.checkedSet());
142
+ const indeterminate = new Set();
143
+ const evaluate = (n) => {
144
+ if (!n.children || n.children.length === 0) {
145
+ return checked.has(n.id) ? 'checked' : 'unchecked';
146
+ }
147
+ let checkedCount = 0;
148
+ let indeterminateCount = 0;
149
+ for (const child of n.children) {
150
+ const state = evaluate(child);
151
+ if (state === 'checked')
152
+ checkedCount++;
153
+ else if (state === 'indeterminate')
154
+ indeterminateCount++;
155
+ }
156
+ if (checkedCount === n.children.length) {
157
+ checked.add(n.id);
158
+ indeterminate.delete(n.id);
159
+ return 'checked';
160
+ }
161
+ else if (checkedCount > 0 || indeterminateCount > 0) {
162
+ checked.delete(n.id);
163
+ indeterminate.add(n.id);
164
+ return 'indeterminate';
165
+ }
166
+ else {
167
+ checked.delete(n.id);
168
+ indeterminate.delete(n.id);
169
+ return 'unchecked';
170
+ }
171
+ };
172
+ for (const root of this.nodes()) {
173
+ evaluate(root);
174
+ }
175
+ this.checkedSet.set(checked);
176
+ this.indeterminateSet.set(indeterminate);
177
+ }
178
+ onAction(node, action) {
179
+ this.actionClick.emit({ node, action });
180
+ }
53
181
  onKeyDown(e) {
54
182
  const flat = this.flatVisibleIds();
55
183
  const cur = this.focusedId();
@@ -67,8 +195,9 @@ class TreeViewComponent {
67
195
  if (e.key === 'Enter' || e.key === ' ') {
68
196
  if (cur) {
69
197
  const node = this.findNode(cur, this.nodes());
70
- if (node)
198
+ if (node) {
71
199
  this.nodeSelect.emit({ node });
200
+ }
72
201
  }
73
202
  }
74
203
  }
@@ -81,7 +210,7 @@ class TreeViewComponent {
81
210
  collect(n.children);
82
211
  }
83
212
  };
84
- collect(this.nodes());
213
+ collect(this.filteredNodes());
85
214
  return ids;
86
215
  }
87
216
  findNode(id, nodes) {
@@ -116,131 +245,191 @@ class TreeViewComponent {
116
245
  this.expandedSet.set(new Set());
117
246
  }
118
247
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TreeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
119
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TreeViewComponent, isStandalone: true, selector: "ngx-tree-view", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, checkable: { classPropertyName: "checkable", publicName: "checkable", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeSelect: "nodeSelect", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", checkChange: "checkChange" }, ngImport: i0, template: `
120
- <div class="ngx-tree-view" role="tree" (keydown)="onKeyDown($event)" tabindex="0">
121
- @for (node of nodes(); track node.id) {
122
- <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: node, depth: 0 }"/>
248
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TreeViewComponent, isStandalone: true, selector: "ngx-tree-view", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, checkable: { classPropertyName: "checkable", publicName: "checkable", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeSelect: "nodeSelect", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", checkChange: "checkChange", actionClick: "actionClick" }, ngImport: i0, template: `
249
+ <div class="ngx-tree-wrapper" [class.dark]="theme() === 'dark'">
250
+ <!-- Search Panel -->
251
+ @if (showSearch()) {
252
+ <div class="tree-search-bar">
253
+ <input
254
+ type="text"
255
+ class="tree-search-input"
256
+ [placeholder]="searchPlaceholder()"
257
+ [value]="searchQuery()"
258
+ (input)="onSearchInput($event)"
259
+ />
260
+ @if (searchQuery()) {
261
+ <button class="tree-clear-btn" (click)="clearSearch()">✕</button>
262
+ }
263
+ </div>
123
264
  }
124
265
 
125
- <ng-template #nodeTemplate let-node="node" let-depth="depth">
126
- <div
127
- class="tree-node"
128
- [style.padding-left.px]="depth * 20 + 8"
129
- [class.selected]="selectedId() === node.id"
130
- [class.focused]="focusedId() === node.id"
131
- [class.disabled]="node.disabled"
132
- role="treeitem"
133
- [attr.aria-expanded]="isExpanded(node.id)"
134
- [attr.aria-selected]="selectedId() === node.id"
135
- [attr.aria-disabled]="node.disabled || null"
136
- (click)="!node.disabled && onNodeClick(node, $event)"
137
- >
138
- <!-- Expand/collapse -->
139
- @if (hasNodeChildren(node)) {
140
- <button
141
- class="tree-expand-btn"
142
- (click)="toggleExpand(node, $event)"
143
- [attr.aria-label]="isExpanded(node.id) ? 'Collapse' : 'Expand'"
144
- >
145
- <span class="expand-icon" [class.expanded]="isExpanded(node.id)">&#9658;</span>
146
- </button>
147
- } @else {
148
- <span class="tree-leaf-spacer"></span>
149
- }
266
+ <!-- Tree Nodes Scroll Container -->
267
+ <div class="ngx-tree-view" role="tree" (keydown)="onKeyDown($event)" tabindex="0">
268
+ @for (node of filteredNodes(); track node.id) {
269
+ <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: node, depth: 0 }"/>
270
+ }
150
271
 
151
- <!-- Checkbox -->
152
- @if (checkable()) {
153
- <input
154
- type="checkbox"
155
- class="tree-checkbox"
156
- [checked]="isChecked(node.id)"
157
- (change)="onCheck(node)"
158
- (click)="$event.stopPropagation()"
159
- />
160
- }
272
+ <ng-template #nodeTemplate let-node="node" let-depth="depth">
273
+ <div
274
+ class="tree-node"
275
+ [class.selected]="selectedId() === node.id"
276
+ [class.focused]="focusedId() === node.id"
277
+ [class.disabled]="node.disabled"
278
+ role="treeitem"
279
+ [attr.aria-expanded]="isExpanded(node.id)"
280
+ [attr.aria-selected]="selectedId() === node.id"
281
+ [attr.aria-disabled]="node.disabled || null"
282
+ (click)="!node.disabled && onNodeClick(node, $event)"
283
+ >
284
+ <!-- Expand/collapse -->
285
+ @if (hasNodeChildren(node)) {
286
+ <button
287
+ class="tree-expand-btn"
288
+ (click)="toggleExpand(node, $event)"
289
+ [attr.aria-label]="isExpanded(node.id) ? 'Collapse' : 'Expand'"
290
+ >
291
+ <span class="expand-icon" [class.expanded]="isExpanded(node.id)">&#9654;</span>
292
+ </button>
293
+ } @else {
294
+ <span class="tree-leaf-spacer"></span>
295
+ }
161
296
 
162
- <!-- Icon -->
163
- @if (node.icon) {
164
- <span class="tree-icon">{{ node.icon }}</span>
165
- }
297
+ <!-- Checkbox -->
298
+ @if (checkable()) {
299
+ <input
300
+ type="checkbox"
301
+ class="tree-checkbox"
302
+ [checked]="isChecked(node.id)"
303
+ [indeterminate]="isIndeterminate(node.id)"
304
+ (change)="onCheck(node)"
305
+ (click)="$event.stopPropagation()"
306
+ />
307
+ }
166
308
 
167
- <!-- Label -->
168
- <span class="tree-label">{{ node.label }}</span>
169
- </div>
309
+ <!-- Icon -->
310
+ @if (node.icon) {
311
+ <span class="tree-icon">{{ node.icon }}</span>
312
+ }
313
+
314
+ <!-- Label -->
315
+ <span class="tree-label">{{ node.label }}</span>
170
316
 
171
- <!-- Children -->
172
- @if (isExpanded(node.id) && node.children) {
173
- @for (child of node.children; track child.id) {
174
- <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: child, depth: depth + 1 }"/>
317
+ <!-- Inline Hover Actions -->
318
+ @if (showActions() && !node.disabled) {
319
+ <div class="tree-node-actions" (click)="$event.stopPropagation()">
320
+ <button class="action-btn add" (click)="onAction(node, 'add')" title="Add Subnode">➕</button>
321
+ <button class="action-btn edit" (click)="onAction(node, 'edit')" title="Edit Node">✏️</button>
322
+ <button class="action-btn delete" (click)="onAction(node, 'delete')" title="Delete Node">🗑️</button>
323
+ </div>
324
+ }
325
+ </div>
326
+
327
+ <!-- Nested Children with गाइड Lines -->
328
+ @if (isExpanded(node.id) && node.children) {
329
+ <div class="tree-node-children-group">
330
+ @for (child of node.children; track child.id) {
331
+ <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: child, depth: depth + 1 }"/>
332
+ }
333
+ </div>
175
334
  }
176
- }
177
- </ng-template>
335
+ </ng-template>
336
+ </div>
178
337
  </div>
179
- `, isInline: true, styles: [":host{display:block}.ngx-tree-view{background:var(--ngx-tree-bg, #fff);border:1px solid var(--ngx-tree-border, #dee2e6);border-radius:var(--ngx-tree-radius, 4px);overflow-y:auto;font-family:inherit;outline:none}.tree-node{display:flex;align-items:center;gap:4px;height:32px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:3px;margin:1px 4px;transition:background .1s}.tree-node:hover{background:var(--ngx-tree-hover-bg, #f1f3f5)}.tree-node.selected{background:var(--ngx-tree-selected-bg, #e8f0fe);color:var(--ngx-tree-selected-color, #1a73e8)}.tree-node.focused{outline:2px solid rgba(74,144,217,.4);outline-offset:-1px}.tree-node.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.tree-expand-btn{width:20px;height:20px;background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;color:var(--ngx-tree-text-secondary, #6c757d)}.tree-expand-btn:hover{background:var(--ngx-tree-border, #dee2e6)}.expand-icon{font-size:9px;transition:transform .15s;display:inline-block}.expand-icon.expanded{transform:rotate(90deg)}.tree-leaf-spacer{width:20px;flex-shrink:0}.tree-checkbox{width:14px;height:14px;cursor:pointer;flex-shrink:0;accent-color:#4a90d9}.tree-icon{font-size:14px;flex-shrink:0}.tree-label{font-size:13px;color:var(--ngx-tree-text, #212529);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selected .tree-label{color:var(--ngx-tree-selected-color, #1a73e8);font-weight:500}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
338
+ `, isInline: true, styles: [":host{display:block;width:100%}.ngx-tree-wrapper{display:flex;flex-direction:column;gap:8px;width:100%}.tree-search-bar{position:relative;display:flex;align-items:center;width:100%}.tree-search-input{width:100%;padding:8px 32px 8px 12px;font-size:13px;border:1px solid var(--border-color, #cbd5e1);border-radius:8px;outline:none;background:var(--bg-secondary, #ffffff);color:var(--text-primary, #0f172a);transition:all .2s ease}.tree-search-input:focus{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px #4f46e51f}.tree-clear-btn{position:absolute;right:10px;background:none;border:none;cursor:pointer;color:#94a3b8;font-size:11px;padding:4px}.tree-clear-btn:hover{color:#64748b}.ngx-tree-view{background:var(--bg-primary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:8px;overflow-y:auto;max-height:480px;font-family:var(--ngx-font-family, system-ui, sans-serif);outline:none}.dark .ngx-tree-view{background:var(--bg-secondary, #1e293b);border-color:#ffffff14}.tree-node{display:flex;align-items:center;gap:6px;height:34px;padding:0 8px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:8px;margin:1px 0;transition:background .15s ease,color .15s ease;position:relative}.tree-node:hover{background:#0f172a0a}.dark .tree-node:hover{background:#ffffff0a}.tree-node.selected{background:#4f46e514;color:var(--primary-color, #4f46e5)}.dark .tree-node.selected{background:#6366f129;color:#818cf8}.tree-node.focused{box-shadow:inset 0 0 0 1.5px var(--primary-color, #4f46e5)}.tree-node.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.tree-expand-btn{width:20px;height:20px;background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:4px;color:#94a3b8;transition:background .15s}.tree-expand-btn:hover{background:#0f172a14;color:#475569}.dark .tree-expand-btn:hover{background:#ffffff14;color:#cbd5e1}.expand-icon{font-size:8px;transition:transform .2s cubic-bezier(.2,.8,.2,1);display:inline-block}.expand-icon.expanded{transform:rotate(90deg)}.tree-leaf-spacer{width:20px;flex-shrink:0}.tree-checkbox{width:14px;height:14px;cursor:pointer;flex-shrink:0;accent-color:var(--primary-color, #4f46e5);border-radius:4px}.tree-icon{font-size:14px;flex-shrink:0}.tree-label{font-size:13px;color:var(--text-primary, #1e293b);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.selected .tree-label{font-weight:600}.dark .tree-label{color:#cbd5e1}.tree-node-actions{display:none;align-items:center;gap:4px;margin-left:auto;padding-left:8px}.tree-node:hover .tree-node-actions{display:flex}.action-btn{background:none;border:none;cursor:pointer;font-size:10px;padding:4px;border-radius:4px;transition:all .15s;opacity:.65}.action-btn:hover{opacity:1;background:#0f172a14}.dark .action-btn:hover{background:#ffffff14}.tree-node-children-group{position:relative;border-left:1px solid rgba(15,23,42,.08);margin-left:17px;padding-left:10px}.dark .tree-node-children-group{border-left-color:#ffffff14}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
180
339
  }
181
340
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TreeViewComponent, decorators: [{
182
341
  type: Component,
183
- args: [{ selector: 'ngx-tree-view', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: `
184
- <div class="ngx-tree-view" role="tree" (keydown)="onKeyDown($event)" tabindex="0">
185
- @for (node of nodes(); track node.id) {
186
- <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: node, depth: 0 }"/>
342
+ args: [{ selector: 'ngx-tree-view', standalone: true, imports: [CommonModule, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: `
343
+ <div class="ngx-tree-wrapper" [class.dark]="theme() === 'dark'">
344
+ <!-- Search Panel -->
345
+ @if (showSearch()) {
346
+ <div class="tree-search-bar">
347
+ <input
348
+ type="text"
349
+ class="tree-search-input"
350
+ [placeholder]="searchPlaceholder()"
351
+ [value]="searchQuery()"
352
+ (input)="onSearchInput($event)"
353
+ />
354
+ @if (searchQuery()) {
355
+ <button class="tree-clear-btn" (click)="clearSearch()">✕</button>
356
+ }
357
+ </div>
187
358
  }
188
359
 
189
- <ng-template #nodeTemplate let-node="node" let-depth="depth">
190
- <div
191
- class="tree-node"
192
- [style.padding-left.px]="depth * 20 + 8"
193
- [class.selected]="selectedId() === node.id"
194
- [class.focused]="focusedId() === node.id"
195
- [class.disabled]="node.disabled"
196
- role="treeitem"
197
- [attr.aria-expanded]="isExpanded(node.id)"
198
- [attr.aria-selected]="selectedId() === node.id"
199
- [attr.aria-disabled]="node.disabled || null"
200
- (click)="!node.disabled && onNodeClick(node, $event)"
201
- >
202
- <!-- Expand/collapse -->
203
- @if (hasNodeChildren(node)) {
204
- <button
205
- class="tree-expand-btn"
206
- (click)="toggleExpand(node, $event)"
207
- [attr.aria-label]="isExpanded(node.id) ? 'Collapse' : 'Expand'"
208
- >
209
- <span class="expand-icon" [class.expanded]="isExpanded(node.id)">&#9658;</span>
210
- </button>
211
- } @else {
212
- <span class="tree-leaf-spacer"></span>
213
- }
360
+ <!-- Tree Nodes Scroll Container -->
361
+ <div class="ngx-tree-view" role="tree" (keydown)="onKeyDown($event)" tabindex="0">
362
+ @for (node of filteredNodes(); track node.id) {
363
+ <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: node, depth: 0 }"/>
364
+ }
214
365
 
215
- <!-- Checkbox -->
216
- @if (checkable()) {
217
- <input
218
- type="checkbox"
219
- class="tree-checkbox"
220
- [checked]="isChecked(node.id)"
221
- (change)="onCheck(node)"
222
- (click)="$event.stopPropagation()"
223
- />
224
- }
366
+ <ng-template #nodeTemplate let-node="node" let-depth="depth">
367
+ <div
368
+ class="tree-node"
369
+ [class.selected]="selectedId() === node.id"
370
+ [class.focused]="focusedId() === node.id"
371
+ [class.disabled]="node.disabled"
372
+ role="treeitem"
373
+ [attr.aria-expanded]="isExpanded(node.id)"
374
+ [attr.aria-selected]="selectedId() === node.id"
375
+ [attr.aria-disabled]="node.disabled || null"
376
+ (click)="!node.disabled && onNodeClick(node, $event)"
377
+ >
378
+ <!-- Expand/collapse -->
379
+ @if (hasNodeChildren(node)) {
380
+ <button
381
+ class="tree-expand-btn"
382
+ (click)="toggleExpand(node, $event)"
383
+ [attr.aria-label]="isExpanded(node.id) ? 'Collapse' : 'Expand'"
384
+ >
385
+ <span class="expand-icon" [class.expanded]="isExpanded(node.id)">&#9654;</span>
386
+ </button>
387
+ } @else {
388
+ <span class="tree-leaf-spacer"></span>
389
+ }
225
390
 
226
- <!-- Icon -->
227
- @if (node.icon) {
228
- <span class="tree-icon">{{ node.icon }}</span>
229
- }
391
+ <!-- Checkbox -->
392
+ @if (checkable()) {
393
+ <input
394
+ type="checkbox"
395
+ class="tree-checkbox"
396
+ [checked]="isChecked(node.id)"
397
+ [indeterminate]="isIndeterminate(node.id)"
398
+ (change)="onCheck(node)"
399
+ (click)="$event.stopPropagation()"
400
+ />
401
+ }
230
402
 
231
- <!-- Label -->
232
- <span class="tree-label">{{ node.label }}</span>
233
- </div>
403
+ <!-- Icon -->
404
+ @if (node.icon) {
405
+ <span class="tree-icon">{{ node.icon }}</span>
406
+ }
234
407
 
235
- <!-- Children -->
236
- @if (isExpanded(node.id) && node.children) {
237
- @for (child of node.children; track child.id) {
238
- <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: child, depth: depth + 1 }"/>
408
+ <!-- Label -->
409
+ <span class="tree-label">{{ node.label }}</span>
410
+
411
+ <!-- Inline Hover Actions -->
412
+ @if (showActions() && !node.disabled) {
413
+ <div class="tree-node-actions" (click)="$event.stopPropagation()">
414
+ <button class="action-btn add" (click)="onAction(node, 'add')" title="Add Subnode">➕</button>
415
+ <button class="action-btn edit" (click)="onAction(node, 'edit')" title="Edit Node">✏️</button>
416
+ <button class="action-btn delete" (click)="onAction(node, 'delete')" title="Delete Node">🗑️</button>
417
+ </div>
418
+ }
419
+ </div>
420
+
421
+ <!-- Nested Children with गाइड Lines -->
422
+ @if (isExpanded(node.id) && node.children) {
423
+ <div class="tree-node-children-group">
424
+ @for (child of node.children; track child.id) {
425
+ <ng-container *ngTemplateOutlet="nodeTemplate; context: { node: child, depth: depth + 1 }"/>
426
+ }
427
+ </div>
239
428
  }
240
- }
241
- </ng-template>
429
+ </ng-template>
430
+ </div>
242
431
  </div>
243
- `, styles: [":host{display:block}.ngx-tree-view{background:var(--ngx-tree-bg, #fff);border:1px solid var(--ngx-tree-border, #dee2e6);border-radius:var(--ngx-tree-radius, 4px);overflow-y:auto;font-family:inherit;outline:none}.tree-node{display:flex;align-items:center;gap:4px;height:32px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:3px;margin:1px 4px;transition:background .1s}.tree-node:hover{background:var(--ngx-tree-hover-bg, #f1f3f5)}.tree-node.selected{background:var(--ngx-tree-selected-bg, #e8f0fe);color:var(--ngx-tree-selected-color, #1a73e8)}.tree-node.focused{outline:2px solid rgba(74,144,217,.4);outline-offset:-1px}.tree-node.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.tree-expand-btn{width:20px;height:20px;background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;color:var(--ngx-tree-text-secondary, #6c757d)}.tree-expand-btn:hover{background:var(--ngx-tree-border, #dee2e6)}.expand-icon{font-size:9px;transition:transform .15s;display:inline-block}.expand-icon.expanded{transform:rotate(90deg)}.tree-leaf-spacer{width:20px;flex-shrink:0}.tree-checkbox{width:14px;height:14px;cursor:pointer;flex-shrink:0;accent-color:#4a90d9}.tree-icon{font-size:14px;flex-shrink:0}.tree-label{font-size:13px;color:var(--ngx-tree-text, #212529);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selected .tree-label{color:var(--ngx-tree-selected-color, #1a73e8);font-weight:500}\n"] }]
432
+ `, styles: [":host{display:block;width:100%}.ngx-tree-wrapper{display:flex;flex-direction:column;gap:8px;width:100%}.tree-search-bar{position:relative;display:flex;align-items:center;width:100%}.tree-search-input{width:100%;padding:8px 32px 8px 12px;font-size:13px;border:1px solid var(--border-color, #cbd5e1);border-radius:8px;outline:none;background:var(--bg-secondary, #ffffff);color:var(--text-primary, #0f172a);transition:all .2s ease}.tree-search-input:focus{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px #4f46e51f}.tree-clear-btn{position:absolute;right:10px;background:none;border:none;cursor:pointer;color:#94a3b8;font-size:11px;padding:4px}.tree-clear-btn:hover{color:#64748b}.ngx-tree-view{background:var(--bg-primary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:8px;overflow-y:auto;max-height:480px;font-family:var(--ngx-font-family, system-ui, sans-serif);outline:none}.dark .ngx-tree-view{background:var(--bg-secondary, #1e293b);border-color:#ffffff14}.tree-node{display:flex;align-items:center;gap:6px;height:34px;padding:0 8px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:8px;margin:1px 0;transition:background .15s ease,color .15s ease;position:relative}.tree-node:hover{background:#0f172a0a}.dark .tree-node:hover{background:#ffffff0a}.tree-node.selected{background:#4f46e514;color:var(--primary-color, #4f46e5)}.dark .tree-node.selected{background:#6366f129;color:#818cf8}.tree-node.focused{box-shadow:inset 0 0 0 1.5px var(--primary-color, #4f46e5)}.tree-node.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.tree-expand-btn{width:20px;height:20px;background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:4px;color:#94a3b8;transition:background .15s}.tree-expand-btn:hover{background:#0f172a14;color:#475569}.dark .tree-expand-btn:hover{background:#ffffff14;color:#cbd5e1}.expand-icon{font-size:8px;transition:transform .2s cubic-bezier(.2,.8,.2,1);display:inline-block}.expand-icon.expanded{transform:rotate(90deg)}.tree-leaf-spacer{width:20px;flex-shrink:0}.tree-checkbox{width:14px;height:14px;cursor:pointer;flex-shrink:0;accent-color:var(--primary-color, #4f46e5);border-radius:4px}.tree-icon{font-size:14px;flex-shrink:0}.tree-label{font-size:13px;color:var(--text-primary, #1e293b);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.selected .tree-label{font-weight:600}.dark .tree-label{color:#cbd5e1}.tree-node-actions{display:none;align-items:center;gap:4px;margin-left:auto;padding-left:8px}.tree-node:hover .tree-node-actions{display:flex}.action-btn{background:none;border:none;cursor:pointer;font-size:10px;padding:4px;border-radius:4px;transition:all .15s;opacity:.65}.action-btn:hover{opacity:1;background:#0f172a14}.dark .action-btn:hover{background:#ffffff14}.tree-node-children-group{position:relative;border-left:1px solid rgba(15,23,42,.08);margin-left:17px;padding-left:10px}.dark .tree-node-children-group{border-left-color:#ffffff14}\n"] }]
244
433
  }] });
245
434
 
246
435
  class ListViewComponent {
@@ -3000,6 +3189,7 @@ class VirtualListComponent {
3000
3189
  [class.vl-row--striped]="striped() && entry.index % 2 !== 0"
3001
3190
  [style.height]="itemHeight() + 'px'"
3002
3191
  role="option"
3192
+ [attr.aria-selected]="selectedIndex() === entry.index"
3003
3193
  tabindex="0"
3004
3194
  (click)="handleItemClick(entry.item, entry.index)"
3005
3195
  (keydown.enter)="handleItemClick(entry.item, entry.index)"
@@ -3055,6 +3245,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
3055
3245
  [class.vl-row--striped]="striped() && entry.index % 2 !== 0"
3056
3246
  [style.height]="itemHeight() + 'px'"
3057
3247
  role="option"
3248
+ [attr.aria-selected]="selectedIndex() === entry.index"
3058
3249
  tabindex="0"
3059
3250
  (click)="handleItemClick(entry.item, entry.index)"
3060
3251
  (keydown.enter)="handleItemClick(entry.item, entry.index)"