UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.99 kB
/* 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 t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{findMatchingChildren as o}from"./responsiveToolbarUtils.js";const r=r=>{let i=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=>o(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()],i.prototype,"priority",void 0),e([t()],i.prototype,"measurementManager",null),e([t()],i.prototype,"budgetedLength",null),e([t()],i.prototype,"actionChildren",null),e([t()],i.prototype,"activeChildElement",null),e([t()],i.prototype,"scale",void 0),e([t()],i.prototype,"slot",void 0),e([t()],i.prototype,"lastActiveKey",void 0),e([t()],i.prototype,"layout",void 0),i=e([s("esri.widgets.Sketch.support.ResponsiveToolbar.ToolbarGroupBase")],i),i};export{r as ToolbarGroupBase};