@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.78 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{LayerTreeNode as o}from"../support/LayerTreeNode.js";import{loadCalciteComponents as r}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as l}from"../../support/jsxFactory.js";var n;const c={expand:"expand",collapse:"collapse",hideSublayer:"hideSublayer",showSublayer:"showSublayer"},a="esri-building-disciplines-tree-node",p={base:a,label:`${a}__label`};let d=class extends s{static{n=this}constructor(e){super(e),this.messages=c,this.toggleSiblingsVisibility=!1,this._onCheckboxClick=e=>{e.stopPropagation();(e.metaKey||e.ctrlKey)&&this.toggleSiblingsVisibility&&(this.node.toggleVisibility(),this.node.toggleAllSiblingsVisibility())},this._onCheckboxToggle=e=>{this.node.toggleVisibility(e.currentTarget.checked)}}static loadDependencies(){return r({checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),tree:()=>import("@esri/calcite-components/dist/components/calcite-tree"),"tree-item":()=>import("@esri/calcite-components/dist/components/calcite-tree-item")})}loadDependencies(){return n.loadDependencies()}static{this.vnodeSelector="calcite-tree-item"}render(){const{node:e,messages:i}=this;if(e.isDiscipline&&!e.hasChildren)return l("div",{key:`${e.id}-empty`});const t=e.visible,s=!0===t,o=null===t,r=s?i?.hideSublayer:i?.showSublayer;return l("calcite-tree-item",{class:p.base,key:e.id},l("calcite-label",{class:p.label,layout:"inline"},l("calcite-checkbox",{checked:s,indeterminate:o,label:r,onclick:this._onCheckboxClick,title:r,onCalciteCheckboxChange:this._onCheckboxToggle}),e.title),this._renderedChildren)}get _renderedChildren(){const{node:e}=this;if(!e.hasChildren)return null;const{messages:i}=this,{toggleSiblingsVisibility:t}=this;return l("calcite-tree",{lines:!0,selectionMode:"none",slot:"children"},this.node.children.toArray().reverse().map((e=>l(n,{messages:i,node:e,toggleSiblingsVisibility:t}))))}};e([i({type:o})],d.prototype,"node",void 0),e([i()],d.prototype,"messages",void 0),e([i({nonNullable:!0})],d.prototype,"toggleSiblingsVisibility",void 0),e([i()],d.prototype,"_renderedChildren",null),d=n=e([t("esri.widgets.BuildingExplorer.BuildingDisciplinesTree.BuildingDisciplinesNode")],d);const h=d;export{h as default};