UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.07 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */ import{__decorate as e}from"tslib";import{watch as t,initial as i}from"../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import o from"../Attachments.js";import n from"../Widget.js";import a from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import l from"./support/FeatureElementInfo.js";import{tsx as d}from"../support/widget.js";const p={base:"esri-feature-attachments"};let h=class extends n{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new o({suppressDeprecationWarning:!0}),this.headingLevel=2,this.viewModel=new a}initialize(){this._featureElementInfo=new l,this.addHandles([t(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),i),t(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return d("div",{class:p.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};e([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),e([s()],h.prototype,"description",null),e([s()],h.prototype,"displayType",null),e([s()],h.prototype,"graphic",null),e([s()],h.prototype,"headingLevel",void 0),e([s()],h.prototype,"title",null),e([s({type:a})],h.prototype,"viewModel",void 0),h=e([r("esri.widgets.Feature.FeatureAttachments")],h);export{h as default};