Compare commits

...

1 Commits

Author SHA1 Message Date
shamoon
3e3ff39b0c Enhancement: allow tags list selection without auto parent/child 2025-11-04 08:28:14 -08:00
2 changed files with 6 additions and 2 deletions

View File

@@ -210,6 +210,7 @@
<pngx-input-tags
[allowCreate]="false"
[title]="null"
[autoHeirarchy]="false"
formControlName="values"
></pngx-input-tags>
} @else if (

View File

@@ -103,6 +103,9 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
@Input()
multiple: boolean = true
@Input()
autoHeirarchy: boolean = true
@Output()
filterDocuments = new EventEmitter<Tag[]>()
@@ -134,7 +137,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
oldValue.splice(index, 1)
// remove children
oldValue = this.removeChildren(oldValue, tag)
if (this.autoHeirarchy) oldValue = this.removeChildren(oldValue, tag)
this.value = [...oldValue]
this.onChange(this.value)
@@ -153,7 +156,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
}
public onAdd(tag: Tag) {
if (tag.parent) {
if (this.autoHeirarchy && tag.parent) {
// add all parents recursively
const parent = this.getTag(tag.parent)
this.value = [...this.value, parent.id]