UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 1.71 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */ import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{findMatchingChildren as i}from"./responsiveToolbarUtils.js";const o=o=>{const r=o;let a=class extends r{constructor(){super(...arguments),this.priority=0,this.scale="m",this.slot=void 0,this.lastActiveKey=null,this.layout="horizontal"}destroy(){this.measurementManager?.managedElements.remove(this),this.measurementManager=null}set measurementManager(e){const t=this._get("measurementManager");e!==t&&(t&&t.managedElements.remove(this),this._set("measurementManager",e),e?.managedElements.add(this))}set budgetedLength(e){this.budgetedLength!==e&&(this._set("budgetedLength",e),this.scheduleRender())}get actionChildren(){return this.children?.flatMap(e=>i(e,"calcite-action"))??[]}get activeChildElement(){const e=this.actionChildren.find(e=>!0===e.properties?.active);return e?(this._set("lastActiveKey",e.properties?.key),e):this.lastActiveKey?this.actionChildren.find(e=>e.properties?.key===this.lastActiveKey):void 0}_handleClick(e){e?.dataset&&"dataset"in e&&e.dataset.actionKey&&(this.lastActiveKey=e.dataset.actionKey)}};return e([t()],a.prototype,"priority",void 0),e([t()],a.prototype,"measurementManager",null),e([t()],a.prototype,"budgetedLength",null),e([t()],a.prototype,"actionChildren",null),e([t()],a.prototype,"activeChildElement",null),e([t()],a.prototype,"scale",void 0),e([t()],a.prototype,"slot",void 0),e([t()],a.prototype,"lastActiveKey",void 0),e([t()],a.prototype,"layout",void 0),a=e([s("esri.widgets.Sketch.support.ResponsiveToolbar.ToolbarGroupBase")],a),a};export{o as ToolbarGroupBase};