mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
LeafOnly selection of et2-tree now possible
et2-tree-dropdown can now also be leafOnly used e.g. in timezone preferences
This commit is contained in:
parent
c08555ee08
commit
0605f6c2f5
@ -98,7 +98,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
||||
@property({type: Function})
|
||||
onclick;// description: "JS code which gets executed when clicks on text of a node"
|
||||
@property({type:String})
|
||||
selection = "single"
|
||||
leafOnly = false
|
||||
|
||||
|
||||
//onselect and oncheck only appear in multiselectTree
|
||||
|
@ -81,15 +81,34 @@ export class Et2TreeDropdown extends SearchMixin<Constructor<any> & Et2InputWidg
|
||||
@property({type: Object}) actions = {};
|
||||
|
||||
@property()
|
||||
leafOnly:Boolean;
|
||||
set leafOnly(_leafOnly: boolean)
|
||||
{
|
||||
this.updateComplete.then(() => {
|
||||
const tree = this._tree
|
||||
if (tree)
|
||||
{
|
||||
tree.leafOnly = _leafOnly;
|
||||
tree.requestUpdate("leafOnly")
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@state() currentTag: Et2Tag;
|
||||
|
||||
// We show search results in the same dropdown
|
||||
@state() treeOrSearch : "tree" | "search" = "tree";
|
||||
|
||||
private get _popup() : SlPopup { return this.shadowRoot.querySelector("sl-popup")}
|
||||
private get _tree() : Et2Tree { return this.shadowRoot.querySelector("et2-tree")}
|
||||
private get _popup(): SlPopup
|
||||
{
|
||||
return this.shadowRoot?.querySelector("sl-popup")
|
||||
}
|
||||
|
||||
private get _tree(): Et2Tree
|
||||
{
|
||||
return this.shadowRoot?.querySelector("et2-tree")
|
||||
}
|
||||
|
||||
private get _tags() : Et2Tag[] { return Array.from(this.shadowRoot.querySelectorAll("et2-tag"));}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user