UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.9 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 t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{watch as l,initial as r}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var o;let n=o=class extends e{constructor(t){super(t),this._activeFetchInfo={id:null,request:null},this.disabledFunction=null,this.layer=null,this.template=null,this.thumbnail=null}initialize(){this.addHandles(l((()=>{const{layer:t}=this;return[t&&"renderer"in t?t.renderer:null,this.template]}),(()=>{this._activeFetchInfo.id=null,this._activeFetchInfo.request=null,this._set("thumbnail",null)}),r))}get description(){return this.template?.description}set description(t){this.template&&(this.template.description=t)}get disabled(){return this.disabledFunction?.(this)??!1}get label(){return this.template?.name}set label(t){this.template&&(this.template.name=t)}get id(){return`${this.label??""}–${this.layer?.id}`}get supportsUpload(){return"scene"===this.layer?.type}clone(){const t=null!=this.thumbnail?this.thumbnail.cloneNode(!0):null,e=new o({layer:this.layer,template:this.template});return e._set("thumbnail",t),e}};t([s()],n.prototype,"description",null),t([s()],n.prototype,"disabled",null),t([s()],n.prototype,"disabledFunction",void 0),t([s()],n.prototype,"label",null),t([s()],n.prototype,"layer",void 0),t([s()],n.prototype,"template",void 0),t([s()],n.prototype,"thumbnail",void 0),t([s()],n.prototype,"id",null),t([s()],n.prototype,"supportsUpload",null),n=o=t([i("esri.widgets.FeatureTemplates.TemplateItem")],n);const a=n;export{a as default};