UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 1.34 kB
import*as Common from"../../core/common/common.js";import*as UI from"../../ui/legacy/legacy.js";export class ApplicationPanelTreeElement extends UI.TreeOutline.TreeElement{resourcesPanel;constructor(e,t,n){super(t,n),this.resourcesPanel=e,UI.ARIAUtils.setLabel(this.listItemElement,t),this.listItemElement.tabIndex=-1}deselect(){super.deselect(),this.listItemElement.tabIndex=-1}get itemURL(){throw new Error("Unimplemented Method")}onselect(e){if(!e)return!1;const t=[];for(let e=this;e;e=e.parent){const n=e instanceof ApplicationPanelTreeElement&&e.itemURL;if(!n)break;t.push(n)}return this.resourcesPanel.setLastSelectedItemPath(t),!1}showView(e){this.resourcesPanel.showView(e)}}export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeElement{expandedSetting;categoryName;categoryLink;constructor(e,t,n,s=!1){super(e,t,!1),this.expandedSetting=Common.Settings.Settings.instance().createSetting("resources"+n+"Expanded",s),this.categoryName=t,this.categoryLink=null}get itemURL(){return"category://"+this.categoryName}setLink(e){this.categoryLink=e}onselect(e){return super.onselect(e),this.resourcesPanel.showCategoryView(this.categoryName,this.categoryLink),!1}onattach(){super.onattach(),this.expandedSetting.get()&&this.expand()}onexpand(){this.expandedSetting.set(!0)}oncollapse(){this.expandedSetting.set(!1)}}