UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) • 24.1 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"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as n,when as r}from"../core/reactiveUtils.js";import{waitAnimationFrame as l}from"../core/scheduling.js";import{throttle as a}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as u}from"../geometry/support/geometryUtils.js";import{loadActionUtilsComponents as h,substituteActionImage as p,getActionStyles as m,renderAction as v}from"../support/actions/actionUtils.js";import g from"./Feature.js";import w from"./Spinner.js";import _ from"./Widget.js";import{css as M}from"./Feature/resources.js";import{FeatureContentMixin as f}from"./Feature/support/FeatureContentMixin.js";import{css as F}from"./Features/css.js";import y from"./Features/FeaturesDrillIn.js";import b from"./Features/FeaturesViewModel.js";import I from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as C}from"./Popup/actions.js";import{zoomToLocation as x}from"./Popup/actionUtils.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{globalCss as N}from"./support/globalCss.js";import{Heading as T}from"./support/Heading.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as j}from"./support/jsxFactory.js";import{substitute as L}from"../intl/substitute.js";import{formatNumber as W}from"../intl/number.js";const D="selected-index",B=0,S="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(f(_)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new y({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new C,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new b,this.visibleElements=new I,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=a((()=>this._displaySpinner()),B),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),s((()=>this.visibleElements?.closeButton),(e=>this._drillInWidget.closable=e)),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),s((()=>this.selectedFeatureWidget?.viewModel),(()=>this._destroyDrillInFlowItemWidgets())),s((()=>this.featureMenuOpen),(()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen),n),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),s((()=>this._drillInFlowItems.length),(()=>this._focusFlowItemNode())),this._drillInWidget.on("close",(()=>this.close())),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>x(this.viewModel,e)))])}loadDependencies(){return Promise.all([h(),A({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new g({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(D);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(r((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return j("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(F.base,N.widget,N.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?j("div",{class:F.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?j("div",{class:F.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o}=t;return j("div",{class:F.paginationText,key:"feature-pagination-text"},L(e.pageText,{index:W(o+1),total:W(i)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return j("calcite-action",{appearance:"solid",bind:this,class:F.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._handlePaginationMenuButton,scale:"s",text:L(e.pageText,{index:W(o+1),total:W(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return j("calcite-action-bar",{class:F.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},j("calcite-action-group",{scale:"s"},j("calcite-action",{appearance:"solid",class:F.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),j("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return j("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},j("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?j("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach((e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])})),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?j("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),(e=>{const t=i.get(e)?.map((e=>this._renderFeatureMenuItem(e))),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?j("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t}))):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?j("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return j("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[F.contentFeature]:!0,[F.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?j(T,{class:this.classes(F.featuresHeading,N.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),j("div",{class:this.classes(F.container,F.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:t,featureMenuTitle:i,messages:o,messagesCommon:s,initialDisplayMode:n,featureMenuOpen:r,selectedFeature:l,_collapseEnabled:a,_isCollapsed:d,featureNavigationTop:c,headingLevel:u}=this,{active:h,featureViewModels:p,pendingPromisesCount:m}=e,{featureMenuHeading:v}=t,g=i??o.selectFeature;if("feature"===n&&!r)return null;const w="list"===n?!l:r;return j("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[F.flowItemCollapsed]:d}),closable:"list"===n&&t.closeButton,closed:!h,collapsed:"list"===n&&d,collapseDirection:c?"down":"up",collapsible:"list"===n&&a,description:v?L(o.total,{total:p.length}):void 0,heading:v?g:void 0,headingLevel:u,key:"feature-menu",loading:e.waitingForContents,selected:w,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===n?this._renderHeaderActions():null,m>0?j("calcite-loader",{class:F.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,j("div",{class:F.container},this._renderFeatureMenu()),j("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:F.featureMenuObserver}),"feature"===n?j("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?j("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=p({action:e,feature:this.selectedFeature}),s={[F.icon]:!!t,[F.actionImage]:!!o};return t&&(s[t]=!0),o||t?j("span",{"aria-hidden":"true",class:this.classes(F.icon,s),key:"icon",styles:m(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?j("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},j("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(((e,t)=>{const i=this._getActionTitle(e);return v(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))}))}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?j("div",{class:M.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=u(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await o(l(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");k(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?L(r,{messages:t}):"remove-selected-feature"===s?L(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?L(r,{messages:t}):e.title;return l&&n?L(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,D)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new w({view:e}),e.ui.add(this._spinner,{key:S,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,S),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([d()],H.prototype,"_drillInFlowItems",void 0),e([d()],H.prototype,"_hideActionText",null),e([d()],H.prototype,"_featureNavigationVisible",null),e([d()],H.prototype,"_isCollapsed",null),e([d()],H.prototype,"_collapseEnabled",null),e([d({readOnly:!0})],H.prototype,"active",null),e([d()],H.prototype,"collapsed",void 0),e([d()],H.prototype,"content",null),e([d()],H.prototype,"icon",null),e([d()],H.prototype,"featureMenuOpen",null),e([d()],H.prototype,"featureMenuTitle",null),e([d()],H.prototype,"featureNavigationTop",void 0),e([d()],H.prototype,"features",null),e([d()],H.prototype,"goToOverride",null),e([d({type:C})],H.prototype,"headerActions",void 0),e([d()],H.prototype,"headingLevel",void 0),e([d()],H.prototype,"initialDisplayMode",null),e([d()],H.prototype,"location",null),e([d()],H.prototype,"label",null),e([d()],H.prototype,"map",null),e([d(),O("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([d(),O("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([d()],H.prototype,"promises",null),e([d()],H.prototype,"responsiveActionsEnabled",void 0),e([d({readOnly:!0})],H.prototype,"selectedFeature",null),e([d({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([d()],H.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([d()],H.prototype,"spatialReference",null),e([d()],H.prototype,"title",null),e([d()],H.prototype,"timeZone",null),e([d()],H.prototype,"updateLocationEnabled",null),e([d()],H.prototype,"view",null),e([d({type:b}),E(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([d({type:I,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([d()],H.prototype,"visible",null),H=e([c("esri.widgets.Features")],H);export{H as default};