12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../../chunks/tslib.es6.js";import{watch as t,initial as s}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import a from"./FeatureMedia.js";import l from"./FeatureExpression/FeatureExpressionViewModel.js";import"../support/widgetUtils.js";import{tsx as p}from"../support/jsxFactory.js";const c={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let u=class extends r{constructor(e,t){super(e,t),this.viewModel=new l}initialize(){this.addHandles(t((()=>this.viewModel?.contentElementViewModel),(()=>this._setupExpressionWidget()),s))}destroy(){this._destroyContentWidget()}renderLoading(){return p("div",{key:"loading-container",class:c.loadingSpinnerContainer},p("span",{class:this.classes(c.iconLoading,c.spinner)}))}render(){const{state:e}=this.viewModel;return p("div",{class:c.base},"loading"===e?this.renderLoading():"disabled"===e?null:this._contentWidget?.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,s=t?.type;this._destroyContentWidget();const o=e?"fields"===s?new d({viewModel:e}):"media"===s?new a({viewModel:e}):"text"===s?new n({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};e([o({type:l})],u.prototype,"viewModel",void 0),u=e([i("esri.widgets.Feature.FeatureExpression")],u);const m=u;export{m as default};
|