@arcgis/map-components 5.2.0-next.26 → 5.2.0-next.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/3JEAUEUY.js +2 -0
- package/dist/cdn/{VAYZZ5OC.js → 3PM2WTS4.js} +1 -1
- package/dist/cdn/4LB5GOV2.js +2 -0
- package/dist/cdn/{HOIUABRJ.js → A5W6D3EH.js} +1 -1
- package/dist/cdn/BM3NHWBY.js +2 -0
- package/dist/cdn/YNIECEKR.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-feature-utility-network-associations/customElement.js +86 -93
- package/dist/components/arcgis-features/customElement.d.ts +2 -2
- package/dist/components/arcgis-features/customElement.js +23 -21
- package/dist/components/arcgis-features-next/customElement.d.ts +0 -7
- package/dist/components/arcgis-features-next/customElement.js +1 -5
- package/dist/components/arcgis-popup/customElement.d.ts +0 -9
- package/dist/components/arcgis-popup/customElement.js +0 -3
- package/dist/components/arcgis-presentation/PresentationViewModel.d.ts +4 -1
- package/dist/components/arcgis-presentation/customElement.d.ts +7 -0
- package/dist/components/arcgis-presentation/customElement.js +117 -101
- package/dist/components/arcgis-search/customElement.js +5 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/H6MYLGUN.js +0 -2
- package/dist/cdn/MGAHLABQ.js +0 -2
- package/dist/cdn/W5HSEDAR.js +0 -2
- package/dist/cdn/XMBA7QLQ.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import j from"./G4CPNGQ6.js";import{a as k}from"./SBUR54TP.js";import i from"./QFH7PJYV.js";import h from"./MZWO5JYA.js";import g from"./DUWXDGIW.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./6IEKX6LJ.js";import{a as P}from"./KPOSO4HB.js";import e from"./R5NVFWFA.js";import d from"./GPVFCWMU.js";import{f as L,h as H}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import b from"./HKTQWWXP.js";import{d as y}from"./DU6OKLV4.js";import{M,N as v,O as N,P as x,R as c,S as R,U as B,a as O,b as a,o as C,p as $,x as A}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.hideExpressionContent=!1,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.visible,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null)}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as R}from"./NQSW6QJ6.js";import{a as h}from"./VJVKFKSG.js";import e from"./6IEKX6LJ.js";import{a as y}from"./KPOSO4HB.js";import{a as $}from"./JD74LG7K.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{h as S}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as M}from"./DU6OKLV4.js";import{N as _,O as v,P as w,R as f,S as b,U as x,a as p,b as r,x as m}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{isAbortError:T},{substitute:k},{watch:u,on:A},,,{a:a},C])=>{var L=p`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}.esri-hidden{display:none!important}:host{width:240px}.root{--arcgis-internal-search-width: 240px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;width:100%}.dropdown{--calcite-color-border-1: var(--calcite-color-border-input);--calcite-dropdown-width: var(--arcgis-internal-search-width);width:31px}.dropdown calcite-button{--calcite-offset-invert-focus: 1}.autocomplete{flex:1}.container{display:flex;position:relative;flex:1 0 100%;flex-flow:row nowrap;align-items:stretch}.form{display:flex;flex:1 0;flex-flow:row nowrap;align-items:stretch;margin:0;padding:0}.submit-button{position:absolute;margin:-1px;border-width:0;padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0)}`,z=C(E);function D(n){return typeof n=="object"&&n!==null&&"openPopup"in n&&"closePopup"in n}var g=class extends v{constructor(){super(...arguments),this.viewModel=z(this),this._currentLocationValue="search-use-current-location",this._autocompleteEl=void 0,this._searchResultRendererEl=void 0,this._searchResultRendererContentEl=void 0,this._suggestController=void 0,this._searchController=void 0,this._lastSearchTerm="",this._handleSelectResult=e=>{let{name:t}=e.detail.result;this._selectedMessage=k(this.messages.resultSelected,{resultName:t})},this.messages=y({blocking:!0}),this._locateFailed=!1,this._showNoResults=!1,this.view=this.viewModel.view,this.goToOverride=this.viewModel.goToOverride,this.icon="search",this.hideSourcesMenu=!1,this.activeMenu="none",this.activeSourceIndex=this.viewModel.activeSourceIndex,this.allPlaceholder=this.viewModel.allPlaceholder,this.allSources=this.viewModel.allSources,this.autoNavigateDisabled=this.viewModel.autoNavigate,this.autoSelectDisabled=this.viewModel.autoSelect,this.defaultSources=this.viewModel.defaultSources,this.disabled=!1,this.includeDefaultSourcesDisabled=this.viewModel.includeDefaultSources,this.locationDisabled=this.viewModel.locationEnabled,this.maxResults=this.viewModel.maxResults,this.maxSuggestions=this.viewModel.maxSuggestions,this.minSuggestCharacters=this.viewModel.minSuggestCharacters,this.popupDisabled=this.viewModel.popupEnabled,this.popupTemplate=this.viewModel.popupTemplate,this.portal=this.viewModel.portal,this.resultGraphic=this.viewModel.resultGraphic,this.resultGraphicDisabled=this.viewModel.resultGraphicEnabled,this.results=this.viewModel.results,this.searchAllDisabled=this.viewModel.searchAllEnabled,this.searchTerm=this.viewModel.searchTerm,this.selectedResult=this.viewModel.selectedResult,this.sources=this.viewModel.sources,this.suggestions=this.viewModel.suggestions,this.suggestionsDisabled=this.viewModel.suggestionsEnabled,this.topLayerDisabled=!1,this.autoDestroyDisabled=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=S()("state"),this.arcgisReady=m(),this.arcgisSearchClear=a(()=>this.viewModel,"search-clear"),this.arcgisSearchComplete=a(()=>this.viewModel,"search-complete"),this.arcgisSearchStart=a(()=>this.viewModel,"search-start"),this.arcgisSelectResult=a(()=>this.viewModel,"select-result"),this.arcgisSuggestComplete=a(()=>this.viewModel,"suggest-complete"),this.arcgisSuggestStart=a(()=>this.viewModel,"suggest-start")}static{this.properties={_selectedMessage:16,messages:16,_locateFailed:16,_showNoResults:16,_isDisabled:16,_showCurrentLocation:16,_effectiveActiveMenu:16,view:0,referenceElement:1,goToOverride:0,icon:1,hideSourcesMenu:5,activeMenu:1,activeSource:32,activeSourceIndex:9,allPlaceholder:1,allSources:0,autoNavigateDisabled:5,autoSelectDisabled:5,defaultSources:0,disabled:5,includeDefaultSourcesDisabled:5,locationDisabled:5,maxResults:9,maxSuggestions:9,minSuggestCharacters:9,popupDisabled:5,popupTemplate:0,portal:0,resultGraphic:0,resultGraphicDisabled:5,results:0,searchAllDisabled:5,searchTerm:1,selectedResult:0,sources:0,suggestions:32,suggestionsDisabled:5,topLayerDisabled:5,autoDestroyDisabled:5,messageOverrides:0,label:1,state:32}}static{this.styles=[L,R]}get _isDisabled(){let{state:e}=this.viewModel;return e==="disabled"||e==="loading"||this.disabled}get _showCurrentLocation(){return!this.locationDisabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){return this._isDisabled?"none":this.activeMenu}get activeSource(){return this.viewModel?.activeSource}clear(){this._locateFailed=!1,this._selectedMessage=void 0,this.viewModel.clear()}async destroy(){this._closePopup(this.viewModel.resultGraphic),this._cancelQueries(),await this._searchResultRendererEl?.destroy(),await this._searchResultRendererContentEl?.destroy(),await this.manager.destroy()}async search(e){this._cancelQueries();let t=new AbortController,{signal:i}=t;this._searchController=t;try{let s=await this.viewModel.search(e,{signal:i});return this._searchController!==t?void 0:(s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=void 0,s)}catch{if(this._searchController!==t)return;this._searchController=void 0;return}}async setFocus(){await this._autocompleteEl?.setFocus()}async suggest(e){this._cancelSuggest();let t=new AbortController,{signal:i}=t;this._suggestController=t;try{let s=await this.viewModel.suggest(e,null,{signal:i});return this._suggestController!==t?void 0:(this._suggestController=void 0,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s)}catch{return this._suggestController!==t||(this._suggestController=void 0),null}}loaded(){this.listen("arcgisSelectResult",this._handleSelectResult),this.manager.onLifecycle(()=>[u(()=>[this._searchResultRendererEl,this.viewModel?.defaultPopupTemplate],()=>{let e=this.viewModel?.defaultPopupTemplate,{_searchResultRendererEl:t}=this;if(e&&t){let i=document.createElement("div");i.appendChild(t),e.content=i,this._searchResultRendererContentEl=t}},{initial:!0}),u(()=>this.messages,e=>this.viewModel.messages=e,{initial:!0}),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),A(()=>this.viewModel,"select-result",e=>{let{popupEnabled:t}=e;t&&this._openPopup()})])}_addSearchResultRenderer(){this._searchResultRendererEl=b(r`<arcgis-search-result-renderer auto-destroy-disabled .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-search-result-renderer>`)}_closePopup(e){let{referenceElement:t,view:i}=this;D(t)&&t.popupElement?.selectedFeature===e?t?.closePopup():i?.popup?.selectedFeature===e&&i?.closePopup()}_openPopup(){if(D(this.referenceElement)){let{resultGraphic:e,resultLocation:t}=this.viewModel,i={features:e?[e]:[],location:t};this.referenceElement?.openPopup(i)}else if(this.view){let{resultGraphic:e,resultLocation:t}=this.viewModel;this.view.openPopup({features:e?[e]:[],location:t})}}_handleInputKeydown(e){e.key==="Tab"&&this._cancelSuggest()}_handleAutocompleteCreate(e){this._autocompleteEl=e}_handleCalciteAutocompleteTextInput(e){let t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){this.activeMenu==="suggestion"&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){let t=e.target.value;if(t===this._currentLocationValue){this._useCurrentLocation();return}let i=JSON.parse(t),s=this.viewModel.suggestions?.find(({sourceIndex:o})=>o===i.sourceIndex)?.results?.find(({key:o})=>`${o}`==`${i.key}`);s&&this.search(s)}async _useCurrentLocation(){this._cancelQueries();let e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(i){T(i)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=void 0}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){this.activeMenu==="source"&&(this.activeMenu="none")}_handleSourceSelect(e){let t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=Number.parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=h(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=h(this._searchController)}_scrollToTopSuggestion(){this._autocompleteEl?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){let{messages:t}=this,{allSources:i}=this.viewModel,s=i.at(e);return(e===-1?t.all:s?.name||t.untitledSource)||""}render(){return this._addSearchResultRenderer(),r`<div class=${w(M("root",$.widget))}><div class="sr-only" aria-live=polite>${this._selectedMessage}</div><div class="container">${this._renderSourcesMenu()}${this._renderForm()}</div></div>`}_renderSourcesMenu(){let{hideSourcesMenu:e,messages:t,_isDisabled:i,_effectiveActiveMenu:s}=this,{allSources:o,searchAllEnabled:l}=this.viewModel;return o.length>1&&!e?r`<calcite-dropdown class="dropdown" .disabled=${i} .open=${s==="source"} overlay-positioning=fixed .topLayerDisabled=${this.topLayerDisabled} @calciteDropdownClose=${this._handleSourceClose} @calciteDropdownOpen=${this._handleSourceOpen} @calciteDropdownSelect=${this._handleSourceSelect}><calcite-button appearance=outline-fill icon-start=caret-down kind=neutral .label=${t.searchIn} slot=trigger></calcite-button><calcite-dropdown-group .groupTitle=${t.searchIn}>${l?this._renderSource(-1):null}${o.map((c,d)=>this._renderSource(d)).toArray()}</calcite-dropdown-group></calcite-dropdown>`:null}_renderUseCurrentLocation(){let{_currentLocationValue:e}=this;return r`<calcite-autocomplete-item .heading=${this.messages.useCurrentLocation??""} icon-start=gps-on .value=${e}></calcite-autocomplete-item>`}_renderAutocomplete(){let{_effectiveActiveMenu:e,messages:t,_isDisabled:i}=this,{maxInputLength:s,placeholder:o,searchTerm:l,state:c}=this.viewModel,d=this.label??t.searchButtonTitle??"";return r`<calcite-autocomplete autocomplete=off class="autocomplete" .disabled=${i} .icon=${this.icon||void 0} .inputValue=${l} .label=${d} .loading=${c==="searching"} .maxLength=${s} .name=${this.el.id} @keydown=${this._handleInputKeydown} .open=${e==="suggestion"} overlay-positioning=fixed .placeholder=${o} .topLayerDisabled=${this.topLayerDisabled} title=${(l?"":o)??f} @calciteAutocompleteChange=${this._handleCalciteAutocompleteChange} @calciteAutocompleteClose=${this._handleAutocompleteClose} @calciteAutocompleteOpen=${this._handleAutocompleteOpen} @calciteAutocompleteTextChange=${this._handleCalciteAutocompleteTextInput} @calciteAutocompleteTextInput=${this._handleCalciteAutocompleteTextInput} ${_(this._handleAutocompleteCreate)}>${this._renderSuggestions()}${this._renderNotices()}</calcite-autocomplete>`}_renderForm(){return r`<form class="form" @submit=${this._formSubmit} role=search>${this._renderAutocomplete()}<button class="submit-button" type=submit>${this.label??this.messages.searchButtonTitle??""}</button></form>`}_renderSuggestGroup(e){return e.results?.map(t=>this._renderSuggestion(t))}_renderSuggestions(){let{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(t=>this._renderSuggestResults(t))}_renderSuggestResults(e){let{allSources:t,activeSourceIndex:i}=this.viewModel,{sourceIndex:s}=e,o=e.results?.length,l=t.length>1&&i===-1,c=this._getSourceName(s);return o&&l?r`<calcite-autocomplete-item-group .heading=${c}>${this._renderSuggestGroup(e)}</calcite-autocomplete-item-group>`:this._renderSuggestGroup(e)}_renderSuggestion({key:e,sourceIndex:t,text:i}){let s={key:e,sourceIndex:t};return r`<calcite-autocomplete-item .heading=${i??this.messages.untitledResult??""} .value=${JSON.stringify(s)}></calcite-autocomplete-item>`}_renderSource(e){let t=this._getSourceName(e);return r`<calcite-dropdown-item data-source-index=${`${e}`} .selected=${e===this.viewModel.activeSourceIndex}>${t}</calcite-dropdown-item>`}_renderNoResultsWarning(e){let{messages:t}=this,i=e?k(t.noResultsFoundForValue??"",{value:`"${e}"`}):t.noResultsFound;return r`<calcite-notice icon=exclamation-mark-triangle kind=warning open slot=content-bottom><div slot=title>${t.noResults}</div><div slot=message>${i}</div></calcite-notice>`}_renderLocateError(){return r`<calcite-notice icon=exclamation-mark-circle kind=danger open slot=content-bottom><div slot=message>${this.messages.locateError}</div></calcite-notice>`}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}};x("arcgis-search",g);return g},"widgets/Search/SearchViewModel","core/promiseUtils","intl","core/reactiveUtils",a,c,d,e)
|
|
2
|
+
import{a as R}from"./NQSW6QJ6.js";import{a as h}from"./VJVKFKSG.js";import e from"./6IEKX6LJ.js";import{a as y}from"./KPOSO4HB.js";import{a as $}from"./JD74LG7K.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{h as S}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as M}from"./DU6OKLV4.js";import{N as _,O as v,P as w,R as f,S as b,U as x,a as p,b as o,x as m}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{isAbortError:T},{substitute:k},{watch:u,on:A},,,{a:a},C])=>{var L=p`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}.esri-hidden{display:none!important}:host{width:240px}.root{--arcgis-internal-search-width: 240px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;width:100%}.dropdown{--calcite-color-border-1: var(--calcite-color-border-input);--calcite-dropdown-width: var(--arcgis-internal-search-width);width:31px}.dropdown calcite-button{--calcite-offset-invert-focus: 1}.autocomplete{flex:1}.container{display:flex;position:relative;flex:1 0 100%;flex-flow:row nowrap;align-items:stretch}.form{display:flex;flex:1 0;flex-flow:row nowrap;align-items:stretch;margin:0;padding:0}.submit-button{position:absolute;margin:-1px;border-width:0;padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0)}`,z=C(E);function D(n){return typeof n=="object"&&n!==null&&"openPopup"in n&&"closePopup"in n}var g=class extends v{constructor(){super(...arguments),this.viewModel=z(this),this._currentLocationValue="search-use-current-location",this._autocompleteEl=void 0,this._searchResultRendererEl=void 0,this._searchResultRendererContentEl=void 0,this._suggestController=void 0,this._searchController=void 0,this._lastSearchTerm="",this._handleSelectResult=e=>{let{name:t}=e.detail.result;this._selectedMessage=k(this.messages.resultSelected,{resultName:t})},this.messages=y({blocking:!0}),this._locateFailed=!1,this._showNoResults=!1,this.view=this.viewModel.view,this.goToOverride=this.viewModel.goToOverride,this.icon="search",this.hideSourcesMenu=!1,this.activeMenu="none",this.activeSourceIndex=this.viewModel.activeSourceIndex,this.allPlaceholder=this.viewModel.allPlaceholder,this.allSources=this.viewModel.allSources,this.autoNavigateDisabled=this.viewModel.autoNavigate,this.autoSelectDisabled=this.viewModel.autoSelect,this.defaultSources=this.viewModel.defaultSources,this.disabled=!1,this.includeDefaultSourcesDisabled=this.viewModel.includeDefaultSources,this.locationDisabled=this.viewModel.locationEnabled,this.maxResults=this.viewModel.maxResults,this.maxSuggestions=this.viewModel.maxSuggestions,this.minSuggestCharacters=this.viewModel.minSuggestCharacters,this.popupDisabled=this.viewModel.popupEnabled,this.popupTemplate=this.viewModel.popupTemplate,this.portal=this.viewModel.portal,this.resultGraphic=this.viewModel.resultGraphic,this.resultGraphicDisabled=this.viewModel.resultGraphicEnabled,this.results=this.viewModel.results,this.searchAllDisabled=this.viewModel.searchAllEnabled,this.searchTerm=this.viewModel.searchTerm,this.selectedResult=this.viewModel.selectedResult,this.sources=this.viewModel.sources,this.suggestions=this.viewModel.suggestions,this.suggestionsDisabled=this.viewModel.suggestionsEnabled,this.topLayerDisabled=!1,this.autoDestroyDisabled=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=S()("state"),this.arcgisReady=m(),this.arcgisSearchClear=a(()=>this.viewModel,"search-clear"),this.arcgisSearchComplete=a(()=>this.viewModel,"search-complete"),this.arcgisSearchStart=a(()=>this.viewModel,"search-start"),this.arcgisSelectResult=a(()=>this.viewModel,"select-result"),this.arcgisSuggestComplete=a(()=>this.viewModel,"suggest-complete"),this.arcgisSuggestStart=a(()=>this.viewModel,"suggest-start")}static{this.properties={_selectedMessage:16,messages:16,_locateFailed:16,_showNoResults:16,_isDisabled:16,_showCurrentLocation:16,_effectiveActiveMenu:16,view:0,referenceElement:1,goToOverride:0,icon:1,hideSourcesMenu:5,activeMenu:1,activeSource:32,activeSourceIndex:9,allPlaceholder:1,allSources:0,autoNavigateDisabled:5,autoSelectDisabled:5,defaultSources:0,disabled:5,includeDefaultSourcesDisabled:5,locationDisabled:5,maxResults:9,maxSuggestions:9,minSuggestCharacters:9,popupDisabled:5,popupTemplate:0,portal:0,resultGraphic:0,resultGraphicDisabled:5,results:0,searchAllDisabled:5,searchTerm:1,selectedResult:0,sources:0,suggestions:32,suggestionsDisabled:5,topLayerDisabled:5,autoDestroyDisabled:5,messageOverrides:0,label:1,state:32}}static{this.styles=[L,R]}get _isDisabled(){let{state:e}=this.viewModel;return e==="disabled"||e==="loading"||this.disabled}get _showCurrentLocation(){return!this.locationDisabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){return this._isDisabled?"none":this.activeMenu}get activeSource(){return this.viewModel?.activeSource}clear(){this._locateFailed=!1,this._selectedMessage=void 0,this.viewModel.clear()}async destroy(){this._closePopup(this.viewModel.resultGraphic),this._cancelQueries(),await this._searchResultRendererEl?.destroy(),await this._searchResultRendererContentEl?.destroy(),await this.manager.destroy()}async search(e){this._cancelQueries();let t=new AbortController,{signal:i}=t;this._searchController=t;try{let s=await this.viewModel.search(e,{signal:i});return this._searchController!==t?void 0:(s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=void 0,s)}catch{if(this._searchController!==t)return;this._searchController=void 0;return}}async setFocus(){await this._autocompleteEl?.setFocus()}async suggest(e){this._cancelSuggest();let t=new AbortController,{signal:i}=t;this._suggestController=t;try{let s=await this.viewModel.suggest(e,null,{signal:i});return this._suggestController!==t?void 0:(this._suggestController=void 0,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s)}catch{return this._suggestController!==t||(this._suggestController=void 0),null}}loaded(){this.listen("arcgisSelectResult",this._handleSelectResult),this.manager.onLifecycle(()=>[u(()=>[this._searchResultRendererEl,this.viewModel?.defaultPopupTemplate],()=>{let e=this.viewModel?.defaultPopupTemplate,{_searchResultRendererEl:t}=this;if(e&&t){let i=document.createElement("div");i.appendChild(t),e.content=i,this._searchResultRendererContentEl=t}},{initial:!0}),u(()=>this.messages,e=>this.viewModel.messages=e,{initial:!0}),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),A(()=>this.viewModel,"select-result",e=>{let{popupEnabled:t}=e;t&&this._openPopup()})])}_addSearchResultRenderer(){this._searchResultRendererEl=b(o`<arcgis-search-result-renderer auto-destroy-disabled .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-search-result-renderer>`)}_closePopup(e){let{referenceElement:t,view:i}=this;D(t)&&t.popupElement?.selectedFeature===e?t?.closePopup():i?.popup?.selectedFeature===e&&i?.closePopup()}_openPopup(){if(D(this.referenceElement)){let{resultGraphic:e,resultLocation:t}=this.viewModel,i={features:e?[e]:[],location:t};this.referenceElement?.openPopup(i)}else if(this.view){let{resultGraphic:e,resultLocation:t}=this.viewModel;this.view.openPopup({features:e?[e]:[],location:t})}}_handleInputKeydown(e){e.key==="Tab"&&this._cancelSuggest()}_handleAutocompleteCreate(e){this._autocompleteEl=e}_handleCalciteAutocompleteTextInput(e){let t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){this.activeMenu==="suggestion"&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){let t=e.target.value;if(t===this._currentLocationValue){this._useCurrentLocation();return}let i=JSON.parse(t),s=this.viewModel.suggestions?.find(({sourceIndex:r})=>r===i.sourceIndex)?.results?.find(({key:r})=>`${r}`==`${i.key}`);s&&this.search(s)}async _useCurrentLocation(){this._cancelQueries();let e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(i){T(i)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=void 0}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){this.activeMenu==="source"&&(this.activeMenu="none")}_handleSourceSelect(e){let t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=Number.parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=h(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=h(this._searchController)}_scrollToTopSuggestion(){this._autocompleteEl?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){let{messages:t}=this,{allSources:i}=this.viewModel,s=i.at(e);return(e===-1?t.all:s?.name||t.untitledSource)||""}render(){return this._addSearchResultRenderer(),o`<div class=${w(M("root",$.widget))}><div class="sr-only" aria-live=polite>${this._selectedMessage}</div><div class="container">${this._renderSourcesMenu()}${this._renderForm()}</div></div>`}_renderSourcesMenu(){let{hideSourcesMenu:e,messages:t,_isDisabled:i,_effectiveActiveMenu:s}=this,{allSources:r,searchAllEnabled:l}=this.viewModel;return r.length>1&&!e?o`<calcite-dropdown class="dropdown" .disabled=${i} .open=${s==="source"} overlay-positioning=fixed .topLayerDisabled=${this.topLayerDisabled} @calciteDropdownClose=${this._handleSourceClose} @calciteDropdownOpen=${this._handleSourceOpen} @calciteDropdownSelect=${this._handleSourceSelect}><calcite-button appearance=outline-fill icon-start=caret-down kind=neutral .label=${t.searchIn} slot=trigger></calcite-button><calcite-dropdown-group .groupTitle=${t.searchIn}>${l?this._renderSource(-1):null}${r.map((c,d)=>this._renderSource(d)).toArray()}</calcite-dropdown-group></calcite-dropdown>`:null}_renderUseCurrentLocation(){let{_currentLocationValue:e}=this;return o`<calcite-autocomplete-item .heading=${this.messages.useCurrentLocation??""} icon-start=gps-on .value=${e}></calcite-autocomplete-item>`}_renderAutocomplete(){let{_effectiveActiveMenu:e,messages:t,_isDisabled:i}=this,{maxInputLength:s,placeholder:r,searchTerm:l,state:c}=this.viewModel,d=this.label??t.searchButtonTitle??"";return o`<calcite-autocomplete autocomplete=off class="autocomplete" .disabled=${i} .icon=${this.icon||void 0} .inputValue=${l} .label=${d} .loading=${c==="searching"} .maxLength=${s} .name=${this.el.id} @keydown=${this._handleInputKeydown} .open=${e==="suggestion"} overlay-positioning=fixed .placeholder=${r} .topLayerDisabled=${this.topLayerDisabled} title=${(l?"":r)??f} @calciteAutocompleteChange=${this._handleCalciteAutocompleteChange} @calciteAutocompleteClose=${this._handleAutocompleteClose} @calciteAutocompleteOpen=${this._handleAutocompleteOpen} @calciteAutocompleteTextChange=${this._handleCalciteAutocompleteTextInput} @calciteAutocompleteTextInput=${this._handleCalciteAutocompleteTextInput} ${_(this._handleAutocompleteCreate)}>${this._renderSuggestions()}${this._renderNotices()}</calcite-autocomplete>`}_renderForm(){return o`<form class="form" @submit=${this._formSubmit} role=search>${this._renderAutocomplete()}<button class="submit-button" type=submit>${this.label??this.messages.searchButtonTitle??""}</button></form>`}_renderSuggestGroup(e){return e.results?.map(t=>this._renderSuggestion(t))}_renderSuggestions(){let{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(t=>this._renderSuggestResults(t))}_renderSuggestResults(e){let{allSources:t,activeSourceIndex:i}=this.viewModel,{sourceIndex:s}=e,r=e.results?.length,l=t.length>1&&i===-1,c=this._getSourceName(s);return r&&l?o`<calcite-autocomplete-item-group .heading=${c}>${this._renderSuggestGroup(e)}</calcite-autocomplete-item-group>`:this._renderSuggestGroup(e)}_renderSuggestion(e){let{key:t,sourceIndex:i,text:s}=e,r={key:t,sourceIndex:i};return o`<calcite-autocomplete-item .heading=${s??this.messages.untitledResult??""} .value=${JSON.stringify(r)} .selected=${e===this.viewModel.selectedSuggestion}></calcite-autocomplete-item>`}_renderSource(e){let t=this._getSourceName(e);return o`<calcite-dropdown-item data-source-index=${`${e}`} .selected=${e===this.viewModel.activeSourceIndex}>${t}</calcite-dropdown-item>`}_renderNoResultsWarning(e){let{messages:t}=this,i=e?k(t.noResultsFoundForValue??"",{value:`"${e}"`}):t.noResultsFound;return o`<calcite-notice icon=exclamation-mark-triangle kind=warning open slot=content-bottom><div slot=title>${t.noResults}</div><div slot=message>${i}</div></calcite-notice>`}_renderLocateError(){return o`<calcite-notice icon=exclamation-mark-circle kind=danger open slot=content-bottom><div slot=message>${this.messages.locateError}</div></calcite-notice>`}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}};x("arcgis-search",g);return g},"widgets/Search/SearchViewModel","core/promiseUtils","intl","core/reactiveUtils",a,c,d,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{c as S}from"./TN5C3MSL.js";import d from"./6IEKX6LJ.js";import{a as N}from"./KPOSO4HB.js";import c from"./R5NVFWFA.js";import b from"./GPVFCWMU.js";import{a as R,f as $}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import"./DU6OKLV4.js";import{O as E,R as y,U as M,a as F,b as g,x as v,z as x}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:p,subclass:H},k,_,{ignoreAbortErrors:T},{watch:u,on:D,whenOnce:I},j,V,K,W,U,Q,q,J,{fetchPopupFeaturesFromGraphics:z},,,,B])=>{var X=F`:host{width:100%;height:100%;padding:var(--calcite-spacing-none);margin:var(--calcite-spacing-none);display:flex;--internal-attribution-height: 16px;--arcgis-internal-presentation-padding-start: unset;--arcgis-internal-presentation-padding-end: unset;--arcgis-internal-presentation-cover-padding-top: unset;--arcgis-internal-presentation-cover-padding-bottom: unset;--arcgis-internal-presentation-cover-padding-start: unset;--arcgis-internal-presentation-cover-padding-end: unset}p{padding:0;margin:0}.root{display:flex;flex-direction:column;justify-content:space-between;width:100%;height:100%}.presentation-content{display:flex;width:100%;justify-content:flex-end;padding-top:var(--calcite-spacing-lg);padding-inline-start:calc(var(--calcite-spacing-lg) + var(--arcgis-internal-presentation-padding-start));padding-inline-end:calc(var(--calcite-spacing-lg) + var(--arcgis-internal-presentation-padding-end))}.navigation{width:fit-content;pointer-events:auto;display:flex;align-items:center;gap:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);box-shadow:var(--arcgis-internal-box-shadow);margin-block:auto calc(var(--calcite-spacing-lg) + var(--internal-attribution-height));margin-inline-start:var(--calcite-spacing-lg)}.slide-counter-text{display:flex;align-items:center;justify-content:center;gap:var(--calcite-spacing-base);min-width:64px}.slide-counter-text-element{box-sizing:border-box;max-width:28px;margin:0;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}.legend{pointer-events:all;box-shadow:var(--calcite-shadow-sm);max-width:300px;height:auto;max-height:calc(100vh - 136px);overflow:hidden auto}`,Z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,d=(i,e,t,s)=>{for(var n=s>1?void 0:s?Y(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(n=(s?a(e,t,n):a(n))||n);return s&&n&&Z(e,t,n),n},o=class extends k{constructor(i){super(i),this.transitionActive=!1,this.showLegend=!1,this.keyboardNavigationEnabled=!1,this._subscribeToSlideEvents=e=>{this._unsubscribeToSlideEvents(e),e.forEach(t=>{let s=t.on("apply-slide-start",()=>this._onApplySlideStart(t)),n=t.on("apply-slide-complete",()=>this._onApplySlideComplete(t)),r=t.on("apply-slide-cancel",()=>this._onApplySlideCancel(t));this.addHandles(s,t.id),this.addHandles(n,t.id),this.addHandles(r,t.id)})},this._unsubscribeToSlideEvents=e=>{e.forEach(t=>{this.hasHandles(t.id)&&this.removeHandles(t.id)})}}initialize(){this.addHandles(u(()=>this.view?.map,(i,e)=>{if(this.hasHandles("sceneLoaded")&&this.removeHandles("sceneLoaded"),e){let t=e.presentation?.slides;t&&t.length>0&&this._unsubscribeToSlideEvents(t)}i&&this.addHandles(u(()=>i.loaded,t=>{t&&(this.removeHandles("sceneLoaded"),this._startWatchSlides(),this._slideId&&this._applySlideById(this._slideId))},{initial:!0}),"sceneLoaded")},{initial:!0}))}destroy(){this._unsubscribeToSlideEvents(this.slides)}get slideId(){return this._slideId}set slideId(i){i===void 0||!this.view?.map?.loaded?this._slideId=i:this._applySlideById(i)}get visibleSlides(){return this.view?.map?.presentation?.slides?.filter(i=>!i.hidden)??new _}get slides(){return this.view?.map?.presentation?.slides??new _}get lastSlideSelected(){return this.getSlideIndexBySlideId(this.slideId)===this.visibleSlides.length-1}get firstSlideSelected(){return this.getSlideIndexBySlideId(this.slideId)===0}get slideSelected(){return this.getSlideIndexBySlideId(this.slideId)>-1}get hasOnlyOneSlide(){return this.visibleSlides.length===1}get slideIndex(){return this.getSlideIndexBySlideId(this.slideId)}getSlideIndexBySlideId(i){let e=-1;return i&&(e=this.visibleSlides.findIndex(t=>t.id===i)),e}navigateInPresentation(i){let e=this.slideIndex+i,t=this._getSlideBySlideIndex(e);t??=this._getSlideBySlideIndex(0),t&&this._applySlide(t)}captureArrowKeysForNavigation(i,e){let t=["ArrowLeft","ArrowRight","PageUp","PageDown"];if(document.activeElement?.nodeName.toLowerCase()==="arcgis-scene"||!t.includes(i.code))return;let s=e==="rtl"?"ArrowRight":"ArrowLeft",n=i.code===s||i.code==="PageUp"?-1:1;this.navigateInPresentation(n)}async setSliceAnalysisInteractive(i){if(!this.view?.analyses?.length)return;let e=this.view.analyses.find(s=>s.type==="slice"&&s.origin?.type==="web-scene");if(!e)return;let t=await this.view.whenAnalysisView(e);t&&(t.interactive=i)}getSlideBySlideId(i){return this.visibleSlides.find(e=>e.id===i)}_getSlideBySlideIndex(i){if(i!=null&&i>=0&&i<this.visibleSlides.length)return this.visibleSlides.getItemAt(i)}async _applySlideById(i){let e=i?this.getSlideBySlideId(i):void 0;e&&await this._applySlide(e)}async _applySlide(i){this.view&&await T(i.applyTo(this.view))}_startWatchSlides(){this._subscribeToSlideEvents(this.slides),this.addHandles(D(()=>this.slides,"change",i=>{this._subscribeToSlideEvents(new _(i.added)),this._unsubscribeToSlideEvents(new _(i.removed))},{onListenerAdd:this._subscribeToSlideEvents,onListenerRemove:this._unsubscribeToSlideEvents}))}_onApplySlideStart(i){this._slideId=i.id,this.transitionActive=!0,this.showLegend=!1,this.onApplySlideStart?.(i)}_onApplySlideComplete(i){this.transitionActive=!1,this.showLegend=!!i.elements.legendInfo?.visible,this.onApplySlideComplete?.(i)}_onApplySlideCancel(i){this.transitionActive=!1,this.showLegend=!!i.elements.legendInfo?.visible,this.onApplySlideCancel?.(i)}};d([p()],o.prototype,"_slideId",2);d([p()],o.prototype,"view",2);d([p()],o.prototype,"slideId",1);d([p()],o.prototype,"transitionActive",2);d([p()],o.prototype,"showLegend",2);d([p()],o.prototype,"keyboardNavigationEnabled",2);d([p()],o.prototype,"visibleSlides",1);d([p()],o.prototype,"slides",1);d([p()],o.prototype,"lastSlideSelected",1);d([p()],o.prototype,"firstSlideSelected",1);d([p()],o.prototype,"slideSelected",1);d([p()],o.prototype,"hasOnlyOneSlide",1);d([p()],o.prototype,"onApplySlideStart",2);d([p()],o.prototype,"onApplySlideComplete",2);d([p()],o.prototype,"onApplySlideCancel",2);d([p()],o.prototype,"getSlideIndexBySlideId",1);o=d([H("components.presentation.PresentationViewModel")],o);var P=class extends x{constructor(e){super(e)}hostLoaded(){this.component.manager.onLifecycle(()=>{let e=this.component;I(()=>e.referenceElement).then(t=>{this._isArcgisScene(t)&&(this._sceneRef=t)})})}openPopup(e){this.component.view&&this.component.slideId===e.id&&e.elements.popupInfo!=null&&this._preparePopupFeature(this.component.view,e.elements.popupInfo).then(({success:t,features:s,popupInfo:n})=>{this.component.slideId===e.id&&(t?this._handlePopupFeatureFound(e,s,n):this.component.arcgisPopupFeatureNotFound.emit({slide:e}))})}_isArcgisScene(e){return e===void 0||typeof e=="string"?!1:"tagName"in e&&e.tagName==="ARCGIS-SCENE"}closePopup(e){(!this.component.slidePopupDisabled||e)&&this._sceneRef?.closePopup()}async _handlePopupFeatureFound(e,t,s){let n=s?.location??void 0;this.component.arcgisPopupFeaturesRetrieved.emit({slide:e,features:t,location:n}),this.component.slidePopupDisabled||await this._sceneRef?.openPopup({features:t,location:n})}async _preparePopupFeature(e,t){let s=[];if(!t.features?.length||t.features.length===0)return{success:!1,features:s};let n=t.features?.getItemAt(t.selectedFeatureIndex)?.layerReference;if(n?.layerId==null)return{success:!1,features:s};let{layer:r,sublayer:a}=this._getLayersFromView(e,n.layerId,n?.sublayerId);if(!r)return{success:!1,features:s};let c=a??r;if(!c||!this._layerTypeSupportsCapturePopup(c))return{success:!1,features:s};if(s=await this._fetchFeaturesFromQueryable(e,t,r,a,c),s&&this._featureHasBeenFilledWithAttributes(s)){let l=s[0];return this._setFallbackPopupTemplate(l,a,r),this._setFallbackGeometry(l,t?.location),{success:!0,features:s,popupInfo:t}}return{success:!1,features:s}}_getLayersFromView(e,t,s){let n=e.map?.findLayerById(t)??void 0,r=this._getBuildingSceneLayerSublayer(n,s);return{layer:n,sublayer:r}}_getBuildingSceneLayerSublayer(e,t){let s;return e&&this._isLayer(e)&&this._isBuildingSceneLayer(e)&&t!=null&&(s=e.allSublayers.find(n=>n.id===t&&n.type==="building-component")),s}_featureHasBeenFilledWithAttributes(e){return e&&e.length>0&&e[0].attributes&&Object.entries(e[0].attributes)?.length>1}async _fetchFeaturesFromQueryable(e,t,s,n,r){let a=t.features?.getItemAt(t.selectedFeatureIndex);if(a?.id==null)return await Promise.resolve([]);let c=await e.whenLayerView(s);await I(()=>!c.updating);let l=this._tryGetBuildingComponentSublayerView(s,n,c)??c;await I(()=>!l.updating);let h=this._createFeatureGraphic(s,n,r,a.id),b=await z(l,[h]);return this._featureHasBeenFilledWithAttributes(b)||(await I(()=>!e.updating),b=await z(l,[h])),b}_tryGetBuildingComponentSublayerView(e,t,s){let n;return this._isLayer(e)&&this._isBuildingSceneLayer(e)&&t!=null&&(n=s.sublayerViews.find(r=>r.sublayer.id===t.id)),n}_setFallbackPopupTemplate(e,t,s){e.popupTemplate==null&&(e.popupTemplate=t?.popupTemplate?t.popupTemplate:s.popupTemplate)}_setFallbackGeometry(e,t){e.geometry==null&&t&&(e.geometry=t.clone())}_createFeatureGraphic(e,t,s,n){let r=this._getGlobalIdFieldNameFromLayer(s),a=n.type==="global-id"&&r?r:s.objectIdField,c=this._getGraphicOrigin(e,t),l=new j({attributes:{},layer:e,origin:c});return l.attributes[a]=n.value,l}_getGraphicOrigin(e,t){switch(e.type){case"csv":return new K(e);case"feature":return new J(e);case"geojson":return new W(e);case"scene":return new U(e);case"wfs":return new Q(e);case"building-scene":return t?new q(t):void 0;default:return}}_layerTypeSupportsCapturePopup(e){return e!=null&&["csv","feature","geojson","wfs","scene","building-component"].includes(e.type)}_isLayer(e){return!!e&&e instanceof V}_isBuildingSceneLayer(e){return e?.type==="building-scene"}_getGlobalIdFieldNameFromLayer(e){return e.fields?.find(t=>t.type==="global-id")?.name}},ee=i=>new P(i),m=Object.freeze({width:0,height:0}),w=new WeakMap,f=()=>({topCenter:{...m},topLeft:{...m},topRight:{...m},bottomCenter:{...m},bottomLeft:{...m},bottomRight:{...m}}),G=i=>({topCenter:{...i.topCenter},topLeft:{...i.topLeft},topRight:{...i.topRight},bottomCenter:{...i.bottomCenter},bottomLeft:{...i.bottomLeft},bottomRight:{...i.bottomRight}}),O=i=>{let e=w.get(i);return e||(e={observedGroups:new Map,observedSizes:f(),subscribers:new Set},w.set(i,e)),e},te=i=>{let e=i?.topCenter.value,t=i?.topLeft.value,s=i?.topRight.value,n=i?.bottomCenter.value,r=i?.bottomLeft.value,a=i?.bottomRight.value;return e&&t&&s&&n&&r&&a?{topCenter:e,topLeft:t,topRight:s,bottomCenter:n,bottomLeft:r,bottomRight:a}:null},ie=(i,e)=>S.every(t=>i.get(t)===e[t]),se=i=>{let e=G(i.observedSizes);i.subscribers.forEach(t=>t(e))},ne=(i,e)=>{let t=w.get(i);if(!t)return;let s=!1;e.forEach(n=>{let r=S.find(b=>t.observedGroups.get(b)===n.target);if(!r)return;let{width:a,height:c}=n.contentRect,l={width:a,height:c},h=t.observedSizes[r];h.width===l.width&&h.height===l.height||(t.observedSizes[r]=l,s=!0)}),s&&se(t)},A=(i,e)=>{let t=O(i);t.resizeObserver||(t.resizeObserver=new ResizeObserver(n=>{ne(i,n)}));let s=te(e);if(!s){t.observedGroups.size>0&&(t.resizeObserver.disconnect(),t.observedGroups.clear());return}ie(t.observedGroups,s)||(t.resizeObserver.disconnect(),t.observedGroups.clear(),S.forEach(n=>{let r=s[n];t.observedGroups.set(n,r),t.resizeObserver?.observe(r)}))},re=(i,e)=>{let t=O(i);return t.subscribers.add(e),e(G(t.observedSizes)),()=>{let s=w.get(i);s&&(s.subscribers.delete(e),s.subscribers.size===0&&(s.resizeObserver?.disconnect(),s.observedGroups.clear(),w.delete(i)))}},L=class extends x{#t;#e;#i;constructor(e){super(e),this.exports=f()}hostDisconnected(){this.#i?.(),this.#i=void 0,this.#e=void 0,this.#t=void 0,this.exports=f()}hostLifecycle(){return[u(()=>this.#s(),e=>{if(this.#e!==e){if(this.#i?.(),this.#i=void 0,this.#e=e,this.#t=e?.slotGroupRefs,!e){this.exports=f();return}this.#i=re(e,t=>{this.#n(t)||(this.exports=t)}),A(e,this.#t)}},{sync:!0,initial:!0}),u(()=>this.#s()?.slotGroupRefs,e=>{this.#t=e,this.#e&&e&&A(this.#e,e)},{sync:!0,initial:!0})]}#s(){let{referenceElement:e}=this.component;return e&&typeof e!="string"?e:void 0}hostUpdated(){!this.#e||!this.#t||A(this.#e,this.#t)}#n(e){let t=this.exports??f();return S.every(s=>{let n=t[s],r=e[s];return n.width===r.width&&n.height===r.height})}},ae=R(L),oe=B(o),C=class extends E{constructor(){super(...arguments),this._messages=N(),this.viewModel=oe(this),this._direction=$(),this._captureArrowKeysForNavigation=e=>{this.viewModel.captureArrowKeysForNavigation(e,this._direction)},this._useFeatureRefPopup=ee(this),this._handleApplySlideStart=e=>{this._useFeatureRefPopup.closePopup(),this.arcgisSlideApplyStart.emit({slide:e})},this._handleApplySlideComplete=e=>{this._useFeatureRefPopup.openPopup(e),this.sliceAnalysisInteractive&&this.viewModel.setSliceAnalysisInteractive(!0),this.arcgisSlideApplyComplete.emit({slide:e})},this._handleApplySlideCancel=e=>{this.arcgisSlideApplyCancel.emit({slide:e})},this.autoDestroyDisabled=!1,this.view=this.viewModel.view,this.scale="m",this.keyboardNavigationEnabled=!1,this.slidePopupDisabled=!1,this.slideCaptionsDisabled=!1,this.slideLegendDisabled=!1,this.sliceAnalysisInteractive=!1,this.navigationHidden=!1,this.arcgisPopupFeatureNotFound=v(),this.arcgisPopupFeaturesRetrieved=v(),this.arcgisSlideApplyStart=v(),this.arcgisSlideApplyCancel=v(),this.arcgisSlideApplyComplete=v(),this.arcgisReady=v()}static{this.properties={_slotSizesController:16,_slotSizeHandle:16,slideId:1,autoDestroyDisabled:5,view:0,scale:1,keyboardNavigationEnabled:5,slidePopupDisabled:5,slideCaptionsDisabled:5,slideLegendDisabled:5,sliceAnalysisInteractive:5,navigationHidden:5}}static{this.styles=X}get slideId(){return this.viewModel.slideId}set slideId(e){this.viewModel.slideId=e}async destroy(){await this.manager.destroy()}loaded(){this.viewModel.onApplySlideStart=this._handleApplySlideStart,this.viewModel.onApplySlideComplete=this._handleApplySlideComplete,this.viewModel.onApplySlideCancel=this._handleApplySlideCancel,this._enableKeyboardNavigation();let e=this;this.manager.onLifecycle(()=>[u(()=>this.slidePopupDisabled,t=>{if(this.slideId&&!t){let s=this.viewModel.getSlideBySlideId(this.slideId);s&&this._useFeatureRefPopup.openPopup(s)}else t&&this._useFeatureRefPopup.closePopup(!0)}),u(()=>this.sliceAnalysisInteractive,t=>{this.viewModel.setSliceAnalysisInteractive(t)},{initial:!0}),u(()=>e.referenceElement,t=>{this._isArcgisScene(t)&&(this._slotSizesController=ae(this),this._slotSizeHandle=this._watchSceneViewSlotSizes())},{once:!0,initial:!0}),{remove:()=>{document.removeEventListener("keydown",this._captureArrowKeysForNavigation),this._keyboardHandle?.remove(),this._slotSizeHandle?.remove()}}])}_isArcgisScene(e){return e===void 0||typeof e=="string"?!1:"tagName"in e&&e.tagName==="ARCGIS-SCENE"}_watchSceneViewSlotSizes(){return u(()=>this._slotSizesController,e=>this._updatePresentationCaptionsPadding(e?.topLeft,e?.topRight,e?.bottomLeft,e?.bottomRight),{initial:!0})}_updatePresentationCaptionsPadding(e,t,s,n){let r=this._direction==="ltr"?e?.width??0:t?.width??0,a=this._direction==="ltr"?t?.width??0:e?.width??0,c=Math.max(e?.height??0,t?.height??0),l=Math.max(s?.height??0,n?.height??0);r>0?this.el.style.setProperty("--arcgis-internal-presentation-padding-start",`calc(var(--calcite-spacing-lg) + ${r.toString()}px)`):this.el.style.setProperty("--arcgis-internal-presentation-padding-start","0px"),a>0?this.el.style.setProperty("--arcgis-internal-presentation-padding-end",`calc(var(--calcite-spacing-lg) + ${a.toString()}px)`):this.el.style.setProperty("--arcgis-internal-presentation-padding-end","0px");let h=r<=Math.max(c,l)&&a<=Math.max(c,l);this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-top",h?"0":`${c}px`),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-bottom",h?"0":`${l}px`),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-start",h?`${r}px`:"0"),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-end",h?`${a}px`:"0")}_enableKeyboardNavigation(){this._keyboardHandle=u(()=>this.keyboardNavigationEnabled,e=>{document.removeEventListener("keydown",this._captureArrowKeysForNavigation),e&&document.addEventListener("keydown",this._captureArrowKeysForNavigation)},{initial:!0})}render(){if(this.viewModel.visibleSlides.length===0)return g`<div></div>`;let e=this.viewModel.visibleSlides.find(r=>r.id===this.slideId),t=this._renderNavigation(),s=this._renderCaptions(e),n=this._renderLegend();return g`<div class="root"><div class="presentation-content">${s}${n}</div>${t}</div>`}_renderNavigation(){if(this.navigationHidden)return null;let e=this.viewModel.lastSlideSelected&&!this.viewModel.hasOnlyOneSlide,t=this._direction==="rtl",s=t?"chevron-right":"chevron-left",n=t?"chevron-left":"chevron-right";return g`<div class="navigation"><calcite-button appearance=transparent icon-start=${s??y} kind=neutral .scale=${this.scale} .disabled=${this.viewModel.firstSlideSelected||!this.viewModel.slideSelected} .label=${this._messages.previous} title=${this._messages.previous??y} @click=${()=>this.viewModel.navigateInPresentation(-1)}></calcite-button><div class="slide-counter-text">${this._renderSlideCounter()}</div><calcite-button appearance=transparent icon-start=${(e?"reset":n)??y} kind=neutral .scale=${this.scale} .label=${e?this._messages.restart:this._messages.next} title=${(e?this._messages.restart:this._messages.next)??y} @click=${()=>this.viewModel.navigateInPresentation(1)}></calcite-button></div>`}_renderSlideCounter(){let e=this.viewModel.slideIndex+1,t=this._messages?.slideNavAriaText?.replace("${index}",e.toString()).replace("${numberOfSlides}",this.viewModel.visibleSlides.length.toString());return this.viewModel.slideSelected?g`<p role=banner aria-label=${t??y} aria-live=polite><div class="slide-counter-text-element" data-testId=arcgis-map-presentation-slideIndex>${e}</div><div class="slide-counter-text-element">/</div><p class="slide-counter-text-element" data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides.length}</p></p>`:g`<p role=banner data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides?.length} ${this._messages?.slides}</p>`}_renderCaptions(e){return this.slideCaptionsDisabled?null:g`<arcgis-presentation-captions .slide=${e} .transitionActive=${this.viewModel.transitionActive}></arcgis-presentation-captions>`}_renderLegend(){return this.slideLegendDisabled||!this.viewModel.showLegend?null:g`<calcite-panel data-testid=presentation-legend class="legend" .heading=${this._messages.legend} closable @calcitePanelClose=${()=>this.viewModel.showLegend=!1}><arcgis-legend .view=${this.view} @arcgisReady=${e=>e.stopPropagation()}></arcgis-legend></calcite-panel>`}};M("arcgis-presentation",C);return C},"core/accessorSupport/decorators","core/Accessor","core/Collection","core/promiseUtils","core/reactiveUtils","Graphic","layers/Layer","graphic/CSVGraphicOrigin","graphic/GeoJSONGraphicOrigin","graphic/SceneGraphicOrigin","graphic/WFSGraphicOrigin","graphic/BuildingGraphicOrigin","graphic/FeatureGraphicOrigin","applications/SceneViewer/sceneViewerUtils",a,b,c,d)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import j from"./435CL2BU.js";import i from"./SPJCXMMT.js";import"./SBUR54TP.js";import e from"./6IEKX6LJ.js";import{a as F}from"./KPOSO4HB.js";import"./JD74LG7K.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{f as E,h as P}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as k}from"./DU6OKLV4.js";import{M as h,N as g,O as M,P as v,Q as D,U as A,a as z,b,x as f}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([H,{stripHTML:V},{watch:p},B,,,,$,,L])=>{var R=z`:host{display:contents;--arcgis-internal-popup-pointer-size: 12px;--arcgis-internal-popup-content-small-size: 280px;--arcgis-internal-popup-content-medium-size: 340px;--arcgis-internal-popup-content-large-size: 400px;--arcgis-internal-popup-content-x-large-size: 460px;--arcgis-internal-popup-content-min-size-y: 48px;--arcgis-internal-popup-pointer-size-half: calc(var(--arcgis-internal-popup-pointer-size) / 2);--arcgis-internal-popup-pointer-size-half-negative: calc(var(--arcgis-internal-popup-pointer-size-half) * -1)}.root{display:flex;position:absolute;flex-flow:column nowrap;z-index:401;pointer-events:none;border:none;overflow:visible;padding:0;width:auto;height:auto;background-color:transparent}.hidden{visibility:hidden}.root:popover-open{display:flex;position:fixed;flex-flow:column nowrap;margin:0}arcgis-features{flex:1;width:100%}.shadow{box-shadow:var(--calcite-shadow-sm)}.aligned-top-center{transform-origin:50% 100%}.aligned-bottom-center{transform-origin:50% -5%}.aligned-top-left,.aligned-bottom-left{transform-origin:100% 50%}.aligned-top-right,.aligned-bottom-right{transform-origin:-5% 50%}.aligned-top-center,.aligned-top-left,.aligned-top-right{animation:popup-intro-animation-down .2s ease-in-out}.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:popup-intro-animation-up .2s ease-in-out}.main-container{display:flex;position:relative;z-index:1;background-color:var(--calcite-color-foreground-1);width:var(--arcgis-internal-popup-content-medium-size);min-height:var(--arcgis-internal-popup-content-min-size-y);max-height:var(--arcgis-internal-popup-content-medium-size);overflow:hidden;pointer-events:auto}.pointer{position:absolute;width:0;height:0}.pointer-direction{position:absolute;width:var(--arcgis-internal-popup-pointer-size);height:var(--arcgis-internal-popup-pointer-size);content:"";background-color:var(--calcite-color-foreground-1)}.aligned-top-center .pointer{top:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-bottom-center .pointer{bottom:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-top-left .pointer{right:var(--arcgis-internal-popup-pointer-size-half);bottom:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-bottom-left .pointer{top:var(--arcgis-internal-popup-pointer-size-half);right:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-top-right .pointer{bottom:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-bottom-right .pointer{top:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-top-center .pointer-direction,.aligned-bottom-center .pointer-direction{transform:scale(.75,2) rotate(45deg)}.aligned-top-left .pointer-direction,.aligned-bottom-left .pointer-direction,.aligned-top-right .pointer-direction,.aligned-bottom-right .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:var(--arcgis-internal-popup-pointer-size-half-negative);transform:scale(.75,2.5) rotate(45deg)}.aligned-top-center .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.aligned-bottom-center .pointer-direction{bottom:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.is-xl-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-large-size)}.is-md-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-medium-size)}.is-sm-width-breakpoint .main-container,.is-xs-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-small-size)}.is-xs-width-breakpoint.is-docked-top-center,.is-xs-width-breakpoint.is-docked-bottom-center{margin:0;width:auto}.is-xs-width-breakpoint.is-docked-top-center .main-container,.is-xs-width-breakpoint.is-docked-bottom-center .main-container{position:absolute;right:0;left:0;width:100%;max-height:75%}.is-xs-width-breakpoint.is-docked-bottom-center .main-container{bottom:0}.is-xs-width-breakpoint.is-docked-top-center .main-container{top:0}.is-xl-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-large-size)}.is-sm-height-breakpoint .main-container,.is-xs-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-small-size)}.is-docked{flex-flow:row nowrap;inset:0;margin:var(--arcgis-layout-overlay-space-top, 0) var(--arcgis-layout-overlay-space-right, 0) var(--arcgis-layout-overlay-space-bottom, 0) var(--arcgis-layout-overlay-space-left, 0);padding:var(--calcite-spacing-lg) var(--calcite-spacing-lg) var(--calcite-spacing-xxxl) var(--calcite-spacing-lg);animation:docking-animation .25s ease-out}.is-docked-top-left,.is-docked-top-center,.is-docked-top-right,.is-docked-top-start,.is-docked-top-end{align-items:flex-start}.is-docked-bottom-left,.is-docked-bottom-center,.is-docked-bottom-right,.is-docked-bottom-start,.is-docked-bottom-end{align-items:flex-end}.is-docked-top-left,.is-docked-bottom-left,.is-docked-top-start,.is-docked-bottom-start{justify-content:flex-start}.is-docked-top-center,.is-docked-bottom-center{justify-content:center}.is-docked-top-right,.is-docked-bottom-right,.is-docked-top-end,.is-docked-bottom-end{justify-content:flex-end}.is-docked-top-left.is-rtl,.is-docked-top-right.is-rtl,.is-docked-bottom-left.is-rtl,.is-docked-bottom-right.is-rtl{flex-direction:row-reverse}.is-docked-top-left .main-container,.is-docked-top-right .main-container,.is-docked-bottom-left .main-container,.is-docked-bottom-right .main-container,.is-docked-top-start .main-container,.is-docked-top-end .main-container,.is-docked-bottom-start .main-container,.is-docked-bottom-end .main-container{max-height:80%}.is-docked-top-center .main-container,.is-docked-bottom-center .main-container{max-height:40%}@media(prefers-reduced-motion){.aligned-top-center,.aligned-top-left,.aligned-top-right,.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:none}}@media(prefers-reduced-motion){.is-docked{animation:none}}@keyframes docking-animation{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes popup-intro-animation-down{0%{transform:translateY(calc(var(--calcite-spacing-xs) * -1));opacity:0}to{transform:translate(0);opacity:1}}@keyframes popup-intro-animation-up{0%{transform:translateY(var(--calcite-spacing-xs));opacity:0}to{transform:translate(0);opacity:1}}`;function w(_){return _&&Number.parseInt(_.replaceAll(/[^-\d.]/gu,""),10)||0}var I=$(H),N={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},C=class extends M{constructor(){super(...arguments),this._direction=E(),this._featuresComponent=h(),this._dockAction=new B({id:"popup-dock-action"}),this._mainContainerNode=h(),this._pointerNode=h(),this.messages=F(),this.viewModel=I(this),this._containerNode=h(),this._popupResizeObserver=new ResizeObserver(()=>this._positionContainer()),this._positionContainer=()=>{this.positionStyle=this._calculatePositionStyle()},this.screenLocation=L(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.alignment="auto",this.autoCloseEnabled=!1,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.dockEnabled=!1,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.features=this.viewModel.features,this.focusTrapDisabled=!1,this.goToOverride=this.viewModel.goToOverride,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideCollapseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSpinner=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=P()("active","collapsed","currentAlignment","dockEnabled","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=f(),this.arcgisClose=f(),this.arcgisTriggerAction=f()}static{this.properties={screenLocation:16,positionStyle:16,_featureNavigationTop:16,actions:0,active:0,alignment:1,autoCloseEnabled:5,autoDestroyDisabled:5,collapsed:5,content:1,currentAlignment:32,currentDockPosition:32,defaultPopupTemplateEnabled:5,dockEnabled:5,dockOptions:0,effectiveHeading:32,featureCount:0,featureMenuOpen:5,featureMenuTitle:1,features:0,focusTrapDisabled:5,goToOverride:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideCollapseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSpinner:5,highlightDisabled:5,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,messageOverrides:0,open:5,promises:0,referenceElement:1,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,state:32,topLayerDisabled:5,updateLocationEnabled:5,view:0}}static{this.styles=R}get trackLocation(){return this.active&&!this.dockEnabled}get _featureNavigationTop(){let{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||t==="bottom-start"||t==="bottom-end"||e==="top-left"||e==="top-center"||e==="top-right"||e==="top-start"||e==="top-end"}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._dockOptions||N}set dockOptions(t){let e={...N},o=this.viewModel?.view?.breakpoints,i={};o&&(i.width=o.xsmall,i.height=o.xsmall);let a={...e,...t},n={...e.breakpoint,...i},{breakpoint:r}=a;typeof r=="object"?a.breakpoint={...n,...r}:r&&(a.breakpoint=n),this._dockOptions=a}get selectedDrillInFeature(){return this._featuresComponent.value?.selectedDrillInFeature??null}get selectedFeatureComponent(){return this._featuresComponent.value?.selectedFeatureComponent??null}async handleViewClick(t){return this.viewModel.handleViewClick(t)}async clear(){this.viewModel.clear()}async destroy(){await this.manager.destroy(),this._dockAction.destroy(),this._popupResizeObserver.disconnect()}async fetchFeatures(t,e){await this._featuresComponent.value?.fetchFeatures(t,e)}async next(){this.viewModel.next()}async previous(){this.viewModel.previous()}async setFocus(){this._featuresComponent.value?.setFocus()}async triggerAction(t){await this._featuresComponent.value?.triggerAction(t)}connectedCallback(){super.connectedCallback(),this._syncPopupResizeObserver()}loaded(){this.manager.onLifecycle(()=>[p(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled,this._direction],()=>this._handleDockIcon(),{initial:!0}),p(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),{initial:!0}),p(()=>[this.dockOptions,this._featuresComponent.value],()=>{let{_dockAction:t,dockOptions:e}=this,o=this._featuresComponent.value?.headerActions;o?.remove(t),e.buttonEnabled&&o?.add(t)},{initial:!0}),p(()=>[this._pointerNode.value,this.alignment,this.currentAlignment,this.dockEnabled,this.dockOptions,this.screenLocation,this.viewModel?.active,this.viewModel?.location,this.viewModel?.view?.size],()=>this._positionContainer(),{initial:!0}),p(()=>this._mainContainerNode.value,t=>{this._syncPopupResizeObserver(t)},{initial:!0}),p(()=>this.viewModel?.view?.size,(t,e)=>this._updateDockEnabledForViewSize(t,e)),p(()=>this.viewModel?.view?.ready,()=>this._setDockEnabledForViewSize(this.dockOptions),{initial:!0}),p(()=>this.view?.map,t=>{this.viewModel.map=t},{initial:!0}),p(()=>this.screenLocation,(t,e)=>this._autoClose(t,e)),p(()=>[this.active,this._containerNode.value,this.dockEnabled,this.topLayerDisabled],()=>this._togglePopover(),{initial:!0})])}disconnectedCallback(){super.disconnectedCallback(),this._popupResizeObserver.disconnect()}_togglePopover(){this._containerNode.value?.togglePopover(this.active&&!this.dockEnabled&&!this.topLayerDisabled)}_syncPopupResizeObserver(t=this._mainContainerNode.value){this._popupResizeObserver.disconnect(),t&&this._popupResizeObserver.observe(t)}_handleClose(t){t.stopPropagation(),this.arcgisClose.emit()}_autoClose(t,e){this.autoCloseEnabled&&t!=null&&e!=null&&(this.open=!1)}_handleArcgisPropertyChange(t){t.detail.name==="collapsed"&&(this.collapsed=t.target.collapsed)}_handleArcgisTriggerAction(t){t.stopPropagation(),t.detail.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled),this.arcgisTriggerAction.emit({action:t.detail.action})}_isOutsideView(t){let{popupHeight:e,popupWidth:o,screenLocation:i,side:a,view:n}=t;return Number.isNaN(o)||Number.isNaN(e)||!n||!i?!1:a==="right"&&i.x+o/2>n.width||a==="left"&&i.x-o/2<0||a==="top"&&i.y-e<0||a==="bottom"&&i.y+e>n.height}_getPointerSize(){let{_pointerNode:t}=this,e=t.value?window.getComputedStyle(t.value):null,o=w(e?.height),i=w(e?.width);return Math.hypot(o,i)}_calculateAutoAlignment(t){if(t!=="auto")return t;let{_mainContainerNode:e,_popupRect:o,viewModel:i}=this,{view:a}=i,{screenLocation:n}=this;if(n==null||!a||!o||!e.value)return"top-center";let r=window.getComputedStyle(e.value),l=w(r.maxHeight),s=w(r.height),c=this._getPointerSize(),{height:d,width:y}=o,u=y+c,m=Math.max(d,l,s)+c,O=this._isOutsideView({popupHeight:m,popupWidth:u,screenLocation:n,side:"right",view:a}),S=this._isOutsideView({popupHeight:m,popupWidth:u,screenLocation:n,side:"left",view:a}),x=this._isOutsideView({popupHeight:m,popupWidth:u,screenLocation:n,side:"top",view:a}),T=this._isOutsideView({popupHeight:m,popupWidth:u,screenLocation:n,side:"bottom",view:a});return S?x?"bottom-right":"top-right":O?x?"bottom-left":"top-left":x?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){return this.dockEnabled||!this.active||!this._mainContainerNode.value?null:this._calculateAutoAlignment(this._callCurrentAlignment(this.alignment))}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){return this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position))}_getCurrentDockPosition(){return this.dockEnabled&&this.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if(t!=="auto")return t;let e=this.viewModel?.view,o="top-end";if(!e)return o;let{breakpoints:i}=e;return i?.xsmall&&e.width<=i.xsmall?"bottom-center":o}_getDockIcon(){let t=this._getDockPosition(),{_direction:e}=this;if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";case"top-right":case"bottom-right":return"dock-right";case"top-start":case"bottom-start":return e==="rtl"?"dock-right":"dock-left";default:return e==="rtl"?"dock-left":"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_calculateAlignmentPosition(t,e,o,i){if(t<0||e<0||!o||!i||t>o.width||e>o.height)return;let{topLayerDisabled:a}=this,n=a?t:t+o.x,r=a?e:e+o.y,{_direction:l,currentAlignment:s}=this,c=this._getPointerSize(),d=c/2;if(s==="top-left"||s==="top-start"&&l==="ltr"||s==="top-end"&&l==="rtl")return{top:r-(i.height+d),left:n-i.width-d};if(s==="top-center")return{top:r-(i.height+c),left:n-i.width/2};if(s==="top-right"||s==="top-end"&&l==="ltr"||s==="top-start"&&l==="rtl")return{top:r-(i.height+d),left:n+d};if(s==="bottom-left"||s==="bottom-start"&&l==="ltr"||s==="bottom-end"&&l==="rtl")return{top:r+d,left:n-i.width-d};if(s==="bottom-center")return{top:r+c,left:n-i.width/2};if(s==="bottom-right"||s==="bottom-end"&&l==="ltr"||s==="bottom-start"&&l==="rtl")return{top:r+d,left:n+d}}_getPositionStyleValue(t){return t!=null?`${t}px`:"auto"}_calculatePositionStyle(){if(this.dockEnabled)return;let{screenLocation:t}=this;if(t==null)return;let e=this.view?.container?.getBoundingClientRect(),o=this._mainContainerNode.value?.getBoundingClientRect();this._popupRect=o;let i=this._calculateAlignmentPosition(t.x,t.y,e,o);if(i)return`inset: ${this._getPositionStyleValue(i.top)} ${this._getPositionStyleValue(i.right)} ${this._getPositionStyleValue(i.bottom)} ${this._getPositionStyleValue(i.left)};`}_dockingThresholdCrossed(t,e,o){let[i,a]=t,[n,r]=e,{width:l=0,height:s=0}=o??{};return i<=l&&n>l||i>l&&n<=l||a<=s&&r>s||a>s&&r<=s}_updateDockEnabledForViewSize(t,e){if(!t||!e||!this.viewModel?.view?.ready)return;let{dockOptions:o}=this,i=o.breakpoint;typeof i=="object"&&this._dockingThresholdCrossed(t,e,i)&&this._setDockEnabledForViewSize(o)}_shouldDockAtCurrentViewSize(t){let e=t.breakpoint,o=this.viewModel?.view?.ui;if(!o)return!1;let{width:i,height:a}=o;if(Number.isNaN(i)||Number.isNaN(a)||typeof e!="object")return!1;let n=typeof e.width=="number"&&i<=(e.width??0),r=typeof e.height=="number"&&a<=(e.height??0);return n||r}_setDockEnabledForViewSize(t){this.viewModel?.view?.ready&&typeof t.breakpoint=="object"&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}render(){let{_direction:t,dockEnabled:e,currentAlignment:o,currentDockPosition:i,positionStyle:a}=this,{active:n,view:r}=this.viewModel,l=n&&e,s=n&&!e,c=r?.widthBreakpoint,d=r?.heightBreakpoint,y={"aligned-top-center":o==="top-center","aligned-bottom-center":o==="bottom-center","aligned-top-left":o==="top-left"||o==="top-start"&&t==="ltr"||o==="top-end"&&t==="rtl","aligned-bottom-left":o==="bottom-left"||o==="bottom-start"&&t==="ltr"||o==="bottom-end"&&t==="rtl","aligned-top-right":o==="top-right"||o==="top-end"&&t==="ltr"||o==="top-start"&&t==="rtl","aligned-bottom-right":o==="bottom-right"||o==="bottom-end"&&t==="ltr"||o==="bottom-start"&&t==="rtl","is-docked":l,shadow:s,"is-rtl":this._direction==="rtl","is-docked-top-start":i==="top-start","is-docked-top-end":i==="top-end","is-docked-top-left":i==="top-left","is-docked-top-center":i==="top-center","is-docked-top-right":i==="top-right","is-docked-bottom-left":i==="bottom-left","is-docked-bottom-center":i==="bottom-center","is-docked-bottom-right":i==="bottom-right","is-docked-bottom-start":i==="bottom-start","is-docked-bottom-end":i==="bottom-end","is-xl-width-breakpoint":c==="xlarge","is-lg-width-breakpoint":c==="large","is-md-width-breakpoint":c==="medium","is-sm-width-breakpoint":c==="small","is-xs-width-breakpoint":c==="xsmall","is-xl-height-breakpoint":d==="xlarge","is-lg-height-breakpoint":d==="large","is-md-height-breakpoint":d==="medium","is-sm-height-breakpoint":d==="small","is-xs-height-breakpoint":d==="xsmall"};return b`<div style=${D(a)} class=${v(k("root",y,{hidden:!n||!a&&!e}))} .ariaHidden=${!n} .ariaLabel=${V(this.heading??"")} role=dialog popover=manual ${g(this._containerNode)}>${this._renderMainContainer()}${this._renderPointer()}</div>`}_renderPointer(){return!this.dockEnabled||!this.active?b`<div class="pointer" role=presentation><div class=${v(k("pointer-direction","shadow"))} ${g(this._pointerNode)}></div></div>`:null}_renderMainContainer(){let t={shadow:this.dockEnabled};return b`<div class=${v(k("main-container",t))} ${g(this._mainContainerNode)}><arcgis-features-next .collapsed=${this.collapsed} .autoDestroyDisabled=${this.autoDestroyDisabled} .featureNavigationTop=${this._featureNavigationTop} .focusTrapEnabled=${!this.focusTrapDisabled} .headingLevel=${this.headingLevel} .hideActionBar=${this.hideActionBar} .hideCloseButton=${this.hideCloseButton} .hideFeatureListLayerTitle=${this.hideFeatureListLayerTitle} .hideFeatureMenuHeading=${this.hideFeatureMenuHeading} .hideFeatureNavigation=${this.hideFeatureNavigation} .hideHeading=${this.hideHeading} .hideSpinner=${this.hideSpinner} @arcgisPropertyChange=${this._handleArcgisPropertyChange} @arcgisTriggerAction=${this._handleArcgisTriggerAction} @arcgisClose=${this._handleClose} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .referenceElement=${this.referenceElement} .responsiveActionsEnabled=${!0} .showCollapseButton=${!this.hideCollapseButton} .viewModel=${this.viewModel} ${g(this._featuresComponent)}><slot name=actions-start slot=actions-start></slot><slot name=actions-end slot=actions-end></slot></arcgis-features-next></div>`}};A("arcgis-popup",C);return C},"popup/Features","applications/Components/stringUtils","core/reactiveUtils","support/actions/ActionButton",a,c,d,e,i,j)
|
|
2
|
+
import i from"./435CL2BU.js";import g from"./SPJCXMMT.js";import"./SBUR54TP.js";import e from"./6IEKX6LJ.js";import{a as F}from"./KPOSO4HB.js";import"./JD74LG7K.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{f as E,h as P}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as k}from"./DU6OKLV4.js";import{M as h,N as u,O as M,P as v,Q as D,U as A,a as z,b,x as f}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([H,{stripHTML:V},{watch:p},B,,,,$,,L])=>{var R=z`:host{display:contents;--arcgis-internal-popup-pointer-size: 12px;--arcgis-internal-popup-content-small-size: 280px;--arcgis-internal-popup-content-medium-size: 340px;--arcgis-internal-popup-content-large-size: 400px;--arcgis-internal-popup-content-x-large-size: 460px;--arcgis-internal-popup-content-min-size-y: 48px;--arcgis-internal-popup-pointer-size-half: calc(var(--arcgis-internal-popup-pointer-size) / 2);--arcgis-internal-popup-pointer-size-half-negative: calc(var(--arcgis-internal-popup-pointer-size-half) * -1)}.root{display:flex;position:absolute;flex-flow:column nowrap;z-index:401;pointer-events:none;border:none;overflow:visible;padding:0;width:auto;height:auto;background-color:transparent}.hidden{visibility:hidden}.root:popover-open{display:flex;position:fixed;flex-flow:column nowrap;margin:0}arcgis-features{flex:1;width:100%}.shadow{box-shadow:var(--calcite-shadow-sm)}.aligned-top-center{transform-origin:50% 100%}.aligned-bottom-center{transform-origin:50% -5%}.aligned-top-left,.aligned-bottom-left{transform-origin:100% 50%}.aligned-top-right,.aligned-bottom-right{transform-origin:-5% 50%}.aligned-top-center,.aligned-top-left,.aligned-top-right{animation:popup-intro-animation-down .2s ease-in-out}.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:popup-intro-animation-up .2s ease-in-out}.main-container{display:flex;position:relative;z-index:1;background-color:var(--calcite-color-foreground-1);width:var(--arcgis-internal-popup-content-medium-size);min-height:var(--arcgis-internal-popup-content-min-size-y);max-height:var(--arcgis-internal-popup-content-medium-size);overflow:hidden;pointer-events:auto}.pointer{position:absolute;width:0;height:0}.pointer-direction{position:absolute;width:var(--arcgis-internal-popup-pointer-size);height:var(--arcgis-internal-popup-pointer-size);content:"";background-color:var(--calcite-color-foreground-1)}.aligned-top-center .pointer{top:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-bottom-center .pointer{bottom:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-top-left .pointer{right:var(--arcgis-internal-popup-pointer-size-half);bottom:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-bottom-left .pointer{top:var(--arcgis-internal-popup-pointer-size-half);right:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-top-right .pointer{bottom:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-bottom-right .pointer{top:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-top-center .pointer-direction,.aligned-bottom-center .pointer-direction{transform:scale(.75,2) rotate(45deg)}.aligned-top-left .pointer-direction,.aligned-bottom-left .pointer-direction,.aligned-top-right .pointer-direction,.aligned-bottom-right .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:var(--arcgis-internal-popup-pointer-size-half-negative);transform:scale(.75,2.5) rotate(45deg)}.aligned-top-center .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.aligned-bottom-center .pointer-direction{bottom:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.is-xl-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-large-size)}.is-md-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-medium-size)}.is-sm-width-breakpoint .main-container,.is-xs-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-small-size)}.is-xs-width-breakpoint.is-docked-top-center,.is-xs-width-breakpoint.is-docked-bottom-center{margin:0;width:auto}.is-xs-width-breakpoint.is-docked-top-center .main-container,.is-xs-width-breakpoint.is-docked-bottom-center .main-container{position:absolute;right:0;left:0;width:100%;max-height:75%}.is-xs-width-breakpoint.is-docked-bottom-center .main-container{bottom:0}.is-xs-width-breakpoint.is-docked-top-center .main-container{top:0}.is-xl-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-large-size)}.is-sm-height-breakpoint .main-container,.is-xs-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-small-size)}.is-docked{flex-flow:row nowrap;inset:0;margin:var(--arcgis-layout-overlay-space-top, 0) var(--arcgis-layout-overlay-space-right, 0) var(--arcgis-layout-overlay-space-bottom, 0) var(--arcgis-layout-overlay-space-left, 0);padding:var(--calcite-spacing-lg) var(--calcite-spacing-lg) var(--calcite-spacing-xxxl) var(--calcite-spacing-lg);animation:docking-animation .25s ease-out}.is-docked-top-left,.is-docked-top-center,.is-docked-top-right,.is-docked-top-start,.is-docked-top-end{align-items:flex-start}.is-docked-bottom-left,.is-docked-bottom-center,.is-docked-bottom-right,.is-docked-bottom-start,.is-docked-bottom-end{align-items:flex-end}.is-docked-top-left,.is-docked-bottom-left,.is-docked-top-start,.is-docked-bottom-start{justify-content:flex-start}.is-docked-top-center,.is-docked-bottom-center{justify-content:center}.is-docked-top-right,.is-docked-bottom-right,.is-docked-top-end,.is-docked-bottom-end{justify-content:flex-end}.is-docked-top-left.is-rtl,.is-docked-top-right.is-rtl,.is-docked-bottom-left.is-rtl,.is-docked-bottom-right.is-rtl{flex-direction:row-reverse}.is-docked-top-left .main-container,.is-docked-top-right .main-container,.is-docked-bottom-left .main-container,.is-docked-bottom-right .main-container,.is-docked-top-start .main-container,.is-docked-top-end .main-container,.is-docked-bottom-start .main-container,.is-docked-bottom-end .main-container{max-height:80%}.is-docked-top-center .main-container,.is-docked-bottom-center .main-container{max-height:40%}@media(prefers-reduced-motion){.aligned-top-center,.aligned-top-left,.aligned-top-right,.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:none}}@media(prefers-reduced-motion){.is-docked{animation:none}}@keyframes docking-animation{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes popup-intro-animation-down{0%{transform:translateY(calc(var(--calcite-spacing-xs) * -1));opacity:0}to{transform:translate(0);opacity:1}}@keyframes popup-intro-animation-up{0%{transform:translateY(var(--calcite-spacing-xs));opacity:0}to{transform:translate(0);opacity:1}}`;function w(_){return _&&Number.parseInt(_.replaceAll(/[^-\d.]/gu,""),10)||0}var I=$(H),N={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},C=class extends M{constructor(){super(...arguments),this._direction=E(),this._featuresComponent=h(),this._dockAction=new B({id:"popup-dock-action"}),this._mainContainerNode=h(),this._pointerNode=h(),this.messages=F(),this.viewModel=I(this),this._containerNode=h(),this._popupResizeObserver=new ResizeObserver(()=>this._positionContainer()),this._positionContainer=()=>{this.positionStyle=this._calculatePositionStyle()},this.screenLocation=L(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.alignment="auto",this.autoCloseEnabled=!1,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.dockEnabled=!1,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.features=this.viewModel.features,this.focusTrapDisabled=!1,this.goToOverride=this.viewModel.goToOverride,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideCollapseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSpinner=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=P()("active","collapsed","currentAlignment","dockEnabled","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=f(),this.arcgisClose=f(),this.arcgisTriggerAction=f()}static{this.properties={screenLocation:16,positionStyle:16,_featureNavigationTop:16,actions:0,active:0,alignment:1,autoCloseEnabled:5,autoDestroyDisabled:5,collapsed:5,content:1,currentAlignment:32,currentDockPosition:32,defaultPopupTemplateEnabled:5,dockEnabled:5,dockOptions:0,effectiveHeading:32,featureCount:0,featureMenuOpen:5,featureMenuTitle:1,features:0,focusTrapDisabled:5,goToOverride:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideCollapseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSpinner:5,highlightDisabled:5,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,messageOverrides:0,open:5,promises:0,referenceElement:1,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,state:32,topLayerDisabled:5,updateLocationEnabled:5,view:0}}static{this.styles=R}get trackLocation(){return this.active&&!this.dockEnabled}get _featureNavigationTop(){let{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||t==="bottom-start"||t==="bottom-end"||e==="top-left"||e==="top-center"||e==="top-right"||e==="top-start"||e==="top-end"}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._dockOptions||N}set dockOptions(t){let e={...N},o=this.viewModel?.view?.breakpoints,i={};o&&(i.width=o.xsmall,i.height=o.xsmall);let a={...e,...t},n={...e.breakpoint,...i},{breakpoint:r}=a;typeof r=="object"?a.breakpoint={...n,...r}:r&&(a.breakpoint=n),this._dockOptions=a}get selectedDrillInFeature(){return this._featuresComponent.value?.selectedDrillInFeature??null}get selectedFeatureComponent(){return this._featuresComponent.value?.selectedFeatureComponent??null}async handleViewClick(t){return this.viewModel.handleViewClick(t)}async clear(){this.viewModel.clear()}async destroy(){await this.manager.destroy(),this._dockAction.destroy(),this._popupResizeObserver.disconnect()}async fetchFeatures(t,e){await this._featuresComponent.value?.fetchFeatures(t,e)}async next(){this.viewModel.next()}async previous(){this.viewModel.previous()}async setFocus(){this._featuresComponent.value?.setFocus()}connectedCallback(){super.connectedCallback(),this._syncPopupResizeObserver()}loaded(){this.manager.onLifecycle(()=>[p(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled,this._direction],()=>this._handleDockIcon(),{initial:!0}),p(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),{initial:!0}),p(()=>[this.dockOptions,this._featuresComponent.value],()=>{let{_dockAction:t,dockOptions:e}=this,o=this._featuresComponent.value?.headerActions;o?.remove(t),e.buttonEnabled&&o?.add(t)},{initial:!0}),p(()=>[this._pointerNode.value,this.alignment,this.currentAlignment,this.dockEnabled,this.dockOptions,this.screenLocation,this.viewModel?.active,this.viewModel?.location,this.viewModel?.view?.size],()=>this._positionContainer(),{initial:!0}),p(()=>this._mainContainerNode.value,t=>{this._syncPopupResizeObserver(t)},{initial:!0}),p(()=>this.viewModel?.view?.size,(t,e)=>this._updateDockEnabledForViewSize(t,e)),p(()=>this.viewModel?.view?.ready,()=>this._setDockEnabledForViewSize(this.dockOptions),{initial:!0}),p(()=>this.view?.map,t=>{this.viewModel.map=t},{initial:!0}),p(()=>this.screenLocation,(t,e)=>this._autoClose(t,e)),p(()=>[this.active,this._containerNode.value,this.dockEnabled,this.topLayerDisabled],()=>this._togglePopover(),{initial:!0})])}disconnectedCallback(){super.disconnectedCallback(),this._popupResizeObserver.disconnect()}_togglePopover(){this._containerNode.value?.togglePopover(this.active&&!this.dockEnabled&&!this.topLayerDisabled)}_syncPopupResizeObserver(t=this._mainContainerNode.value){this._popupResizeObserver.disconnect(),t&&this._popupResizeObserver.observe(t)}_handleClose(t){t.stopPropagation(),this.arcgisClose.emit()}_autoClose(t,e){this.autoCloseEnabled&&t!=null&&e!=null&&(this.open=!1)}_handleArcgisPropertyChange(t){t.detail.name==="collapsed"&&(this.collapsed=t.target.collapsed)}_handleArcgisTriggerAction(t){t.stopPropagation(),t.detail.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled),this.arcgisTriggerAction.emit({action:t.detail.action})}_isOutsideView(t){let{popupHeight:e,popupWidth:o,screenLocation:i,side:a,view:n}=t;return Number.isNaN(o)||Number.isNaN(e)||!n||!i?!1:a==="right"&&i.x+o/2>n.width||a==="left"&&i.x-o/2<0||a==="top"&&i.y-e<0||a==="bottom"&&i.y+e>n.height}_getPointerSize(){let{_pointerNode:t}=this,e=t.value?window.getComputedStyle(t.value):null,o=w(e?.height),i=w(e?.width);return Math.hypot(o,i)}_calculateAutoAlignment(t){if(t!=="auto")return t;let{_mainContainerNode:e,_popupRect:o,viewModel:i}=this,{view:a}=i,{screenLocation:n}=this;if(n==null||!a||!o||!e.value)return"top-center";let r=window.getComputedStyle(e.value),l=w(r.maxHeight),s=w(r.height),c=this._getPointerSize(),{height:d,width:y}=o,g=y+c,m=Math.max(d,l,s)+c,O=this._isOutsideView({popupHeight:m,popupWidth:g,screenLocation:n,side:"right",view:a}),S=this._isOutsideView({popupHeight:m,popupWidth:g,screenLocation:n,side:"left",view:a}),x=this._isOutsideView({popupHeight:m,popupWidth:g,screenLocation:n,side:"top",view:a}),T=this._isOutsideView({popupHeight:m,popupWidth:g,screenLocation:n,side:"bottom",view:a});return S?x?"bottom-right":"top-right":O?x?"bottom-left":"top-left":x?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){return this.dockEnabled||!this.active||!this._mainContainerNode.value?null:this._calculateAutoAlignment(this._callCurrentAlignment(this.alignment))}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){return this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position))}_getCurrentDockPosition(){return this.dockEnabled&&this.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if(t!=="auto")return t;let e=this.viewModel?.view,o="top-end";if(!e)return o;let{breakpoints:i}=e;return i?.xsmall&&e.width<=i.xsmall?"bottom-center":o}_getDockIcon(){let t=this._getDockPosition(),{_direction:e}=this;if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";case"top-right":case"bottom-right":return"dock-right";case"top-start":case"bottom-start":return e==="rtl"?"dock-right":"dock-left";default:return e==="rtl"?"dock-left":"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_calculateAlignmentPosition(t,e,o,i){if(t<0||e<0||!o||!i||t>o.width||e>o.height)return;let{topLayerDisabled:a}=this,n=a?t:t+o.x,r=a?e:e+o.y,{_direction:l,currentAlignment:s}=this,c=this._getPointerSize(),d=c/2;if(s==="top-left"||s==="top-start"&&l==="ltr"||s==="top-end"&&l==="rtl")return{top:r-(i.height+d),left:n-i.width-d};if(s==="top-center")return{top:r-(i.height+c),left:n-i.width/2};if(s==="top-right"||s==="top-end"&&l==="ltr"||s==="top-start"&&l==="rtl")return{top:r-(i.height+d),left:n+d};if(s==="bottom-left"||s==="bottom-start"&&l==="ltr"||s==="bottom-end"&&l==="rtl")return{top:r+d,left:n-i.width-d};if(s==="bottom-center")return{top:r+c,left:n-i.width/2};if(s==="bottom-right"||s==="bottom-end"&&l==="ltr"||s==="bottom-start"&&l==="rtl")return{top:r+d,left:n+d}}_getPositionStyleValue(t){return t!=null?`${t}px`:"auto"}_calculatePositionStyle(){if(this.dockEnabled)return;let{screenLocation:t}=this;if(t==null)return;let e=this.view?.container?.getBoundingClientRect(),o=this._mainContainerNode.value?.getBoundingClientRect();this._popupRect=o;let i=this._calculateAlignmentPosition(t.x,t.y,e,o);if(i)return`inset: ${this._getPositionStyleValue(i.top)} ${this._getPositionStyleValue(i.right)} ${this._getPositionStyleValue(i.bottom)} ${this._getPositionStyleValue(i.left)};`}_dockingThresholdCrossed(t,e,o){let[i,a]=t,[n,r]=e,{width:l=0,height:s=0}=o??{};return i<=l&&n>l||i>l&&n<=l||a<=s&&r>s||a>s&&r<=s}_updateDockEnabledForViewSize(t,e){if(!t||!e||!this.viewModel?.view?.ready)return;let{dockOptions:o}=this,i=o.breakpoint;typeof i=="object"&&this._dockingThresholdCrossed(t,e,i)&&this._setDockEnabledForViewSize(o)}_shouldDockAtCurrentViewSize(t){let e=t.breakpoint,o=this.viewModel?.view?.ui;if(!o)return!1;let{width:i,height:a}=o;if(Number.isNaN(i)||Number.isNaN(a)||typeof e!="object")return!1;let n=typeof e.width=="number"&&i<=(e.width??0),r=typeof e.height=="number"&&a<=(e.height??0);return n||r}_setDockEnabledForViewSize(t){this.viewModel?.view?.ready&&typeof t.breakpoint=="object"&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}render(){let{_direction:t,dockEnabled:e,currentAlignment:o,currentDockPosition:i,positionStyle:a}=this,{active:n,view:r}=this.viewModel,l=n&&e,s=n&&!e,c=r?.widthBreakpoint,d=r?.heightBreakpoint,y={"aligned-top-center":o==="top-center","aligned-bottom-center":o==="bottom-center","aligned-top-left":o==="top-left"||o==="top-start"&&t==="ltr"||o==="top-end"&&t==="rtl","aligned-bottom-left":o==="bottom-left"||o==="bottom-start"&&t==="ltr"||o==="bottom-end"&&t==="rtl","aligned-top-right":o==="top-right"||o==="top-end"&&t==="ltr"||o==="top-start"&&t==="rtl","aligned-bottom-right":o==="bottom-right"||o==="bottom-end"&&t==="ltr"||o==="bottom-start"&&t==="rtl","is-docked":l,shadow:s,"is-rtl":this._direction==="rtl","is-docked-top-start":i==="top-start","is-docked-top-end":i==="top-end","is-docked-top-left":i==="top-left","is-docked-top-center":i==="top-center","is-docked-top-right":i==="top-right","is-docked-bottom-left":i==="bottom-left","is-docked-bottom-center":i==="bottom-center","is-docked-bottom-right":i==="bottom-right","is-docked-bottom-start":i==="bottom-start","is-docked-bottom-end":i==="bottom-end","is-xl-width-breakpoint":c==="xlarge","is-lg-width-breakpoint":c==="large","is-md-width-breakpoint":c==="medium","is-sm-width-breakpoint":c==="small","is-xs-width-breakpoint":c==="xsmall","is-xl-height-breakpoint":d==="xlarge","is-lg-height-breakpoint":d==="large","is-md-height-breakpoint":d==="medium","is-sm-height-breakpoint":d==="small","is-xs-height-breakpoint":d==="xsmall"};return b`<div style=${D(a)} class=${v(k("root",y,{hidden:!n||!a&&!e}))} .ariaHidden=${!n} .ariaLabel=${V(this.heading??"")} role=dialog popover=manual ${u(this._containerNode)}>${this._renderMainContainer()}${this._renderPointer()}</div>`}_renderPointer(){return!this.dockEnabled||!this.active?b`<div class="pointer" role=presentation><div class=${v(k("pointer-direction","shadow"))} ${u(this._pointerNode)}></div></div>`:null}_renderMainContainer(){let t={shadow:this.dockEnabled};return b`<div class=${v(k("main-container",t))} ${u(this._mainContainerNode)}><arcgis-features-next .collapsed=${this.collapsed} .autoDestroyDisabled=${this.autoDestroyDisabled} .featureNavigationTop=${this._featureNavigationTop} .focusTrapEnabled=${!this.focusTrapDisabled} .headingLevel=${this.headingLevel} .hideActionBar=${this.hideActionBar} .hideCloseButton=${this.hideCloseButton} .hideFeatureListLayerTitle=${this.hideFeatureListLayerTitle} .hideFeatureMenuHeading=${this.hideFeatureMenuHeading} .hideFeatureNavigation=${this.hideFeatureNavigation} .hideHeading=${this.hideHeading} .hideSpinner=${this.hideSpinner} @arcgisPropertyChange=${this._handleArcgisPropertyChange} @arcgisTriggerAction=${this._handleArcgisTriggerAction} @arcgisClose=${this._handleClose} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .referenceElement=${this.referenceElement} .responsiveActionsEnabled=${!0} .showCollapseButton=${!this.hideCollapseButton} .viewModel=${this.viewModel} ${u(this._featuresComponent)}><slot name=actions-start slot=actions-start></slot><slot name=actions-end slot=actions-end></slot></arcgis-features-next></div>`}};A("arcgis-popup",C);return C},"popup/Features","applications/Components/stringUtils","core/reactiveUtils","support/actions/ActionButton",a,c,d,e,g,i)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as C}from"./ECNI2A4K.js";import{a as I}from"./SBUR54TP.js";import a from"./MZWO5JYA.js";import{O as $,S as F,U as L,a as q,b as p}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([{createReactiveMap:k,findUtilityNetwork:U,getOrCreateMapValue:x},{stripHTML:E},f,{ignoreAbortErrors:S},{watch:v},V,P,Q,B,{b:N,f:A}])=>{var G=q`.list-container{min-height:var(--calcite-spacing-xxxl)}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none;height:500px}`,M=100,D={assetGroup:"assetgroup",assetType:"assettype"},j="{00000000-0000-0000-0000-000000000000}",T=class extends ${constructor(){super(...arguments),this._addFlowItem=t=>{t&&this.flowItems?.push(t)},this._attachmentAssociations=new f,this._attachmentFeatureCount=0,this._cancelQuery=()=>{let{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._connectivityAssociations=new f,this._connectivityFeatureCount=0,this._containerAssociations=new f,this._containerFeatureCount=0,this._contentAssociations=new f,this._contentFeatureCount=0,this._networkSourceIdsInUse=new Set,this._query=async t=>{if(!t)return;await this._loadUtiltyNetworks();let{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this._featureCount&&await this._queryAssociatedFeatures(t,{signal:e?.signal})},this._queryController=async t=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await S(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let t=new AbortController;this._queryFeatureCountAbortController=t,await S(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=C(this._queryController,M),this._queryFeatureCountDebounced=C(this._queryFeatureCountController,M),this._structureAssociations=new f,this._structureFeatureCount=0,this._queryAssociationType=async()=>{this._activeAssociationType&&this._queryDebounced(this._activeAssociationType)},this._associationFeatures=k(),this._associationViewModels=k(),this._featureCount=0,this._loaded=!1,this._queryAbortController=null,this._queryFeatureCountAbortController=null,this._queryPageAbortController=null,this.associationTypes=null,this.autoDestroyDisabled=!1,this.useFeatureNextFlowItem=!1,this.flowType="feature-utility-network-associations",this.headingLevel=2,this.source="popup"}static{this.properties={_activeAssociationType:16,_associationFeatures:16,_associationViewModels:16,_canLoad:16,_canQuery:16,_featureCount:16,_loaded:16,_queryAbortController:16,_queryFeatureCountAbortController:16,_queryPageAbortController:16,_state:16,associationTypes:0,autoDestroyDisabled:5,description:1,flowItems:0,useFeatureNextFlowItem:5,flowType:1,graphic:0,heading:1,headingLevel:9,layer:0,map:0,messages:0,parentFeatureViewModel:0,referenceElement:1,source:1,spatialReference:0,timeZone:1,view:0}}static{this.styles=G}get _globalId(){return(this._globalIdField&&this.graphic?.attributes?.[this._globalIdField])??null}get _globalIdField(){return this.layer?.globalIdField}get _objectId(){return(this._objectIdField&&this.graphic?.attributes?.[this._objectIdField])??null}get _objectIdField(){return this.layer?.objectIdField}get _supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get _utilityNetwork(){let{layer:t,map:e}=this;if(!t?.loaded||!e)return null;let s=A(t)?t.parent:t;return U(e,s)}get _canLoad(){return!!this.map}get _canQuery(){return!!this.layer?.capabilities?.query?.supportsPagination}get _state(){let{_canLoad:t,_canQuery:e,_featureCount:s,_loaded:a,_queryAbortController:i,_queryFeatureCountAbortController:r,_queryPageAbortController:o,associationTypes:l}=this;return r||t&&!a?"loading":i||o?"querying":!this._globalId||!l||!e||!s?"disabled":"ready"}get heading(){return this._heading}set heading(t){this._heading=t}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[v(()=>[this.graphic,this.layer,this.map,this.associationTypes,this._canQuery,this._objectId,this._globalId],()=>{this._queryFeatureCountDebounced(),this._queryAssociationType()},{initial:!0}),v(()=>this._activeAssociationType,t=>{this._queryDebounced(t)}),v(()=>this._associationFeatures.values(),()=>{this._setUpUtilityNetworkAssociationsViewModels()})]),this.manager.onDestroy(()=>{this._cancelQuery(),this._cancelQueryFeatureCount()})}_addAssociationTypeFlowItem(t){let e=this.useFeatureNextFlowItem?F(p`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this._associationViewModels} .description=${this._getParentFeatureDescription()} .flowItems=${this.flowItems} .flowType=${this.flowType} .heading=${this._getAssociationTypeTitle(t)} .messages=${this.messages} .map=${this.map} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .state=${this._state} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} use-feature-next-flow-item .view=${this.view}></arcgis-feature-utility-network-association-list>`):F(p`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this._associationViewModels} .description=${this._getParentFeatureDescription()} .flowItems=${this.flowItems} .flowType=${this.flowType} .heading=${this._getAssociationTypeTitle(t)} .messages=${this.messages} .map=${this.map} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .state=${this._state} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature-utility-network-association-list>`);this._addFlowItem(e)}_clearAssociations(){this._attachmentAssociations.removeAll(),this._connectivityAssociations.removeAll(),this._containerAssociations.removeAll(),this._contentAssociations.removeAll(),this._structureAssociations.removeAll()}_clearFeatures(){this._associationFeatures.forEach(t=>t.removeAll()),this._associationFeatures.clear()}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _countAssociatedFeatureCount(t,e,s,a,i){let r=this._getFeatureQueryWhereClause(t,e,s,a),o=t.createQuery();return o.where=r,o.outFields=["*"],o.returnGeometry=!1,await t.queryFeatureCount(o,{signal:i?.signal})}async _countAssociatedFeatures(t,e,s,a,i){if(!e.length)return 0;let r=await this._findLayersBySourceId(t);await this._loadLayers(r);let o=r.map(l=>this._countAssociatedFeatureCount(l,e,s,a,i));return(await Promise.all(o)).reduce((l,c)=>l+c,0)}async _createAssociationFeatureObjects(t,e,s,a,i){if(!t.length)return[];let r=new Map,o=Array.from(e.entries()).map(async([c,d])=>{let u=await this._findLayersBySourceId(c);await this._loadLayers(u);let h=u.map(m=>this._queryLayer(m,d,s,a,i));(await Promise.all(h)).forEach(m=>{m.forEach(n=>{if(this.source==="popup"?n.sourceLayer&&n.getEffectivePopupTemplate():n.sourceLayer){let _=n.layer.globalIdField??"",y=n.getAttribute(_),w=r.get(y)??[];w.push(n),r.set(y,w)}})})});await Promise.all(o);let l=[];return await Promise.all(t.toArray().map(async c=>{let{fromNetworkElement:d,toNetworkElement:u}=c,h=d.globalId===this._globalId?u:d,m=r.get(h.globalId)??[];await Promise.all(m.map(async n=>{let _=this._utilityNetwork?.getTerminalById(h?.terminalId??void 0)?.name,y=await n.sourceLayer.getFeatureTitle(n)||this._getFeatureTitle(n);l.push({title:y,feature:n,association:c,terminalName:_})}))})),l}_destroyAssociatedFeatureViewModels(){this._associationViewModels.forEach(t=>t.destroyAll())}_equals(t,e){if(t.globalId===j&&e.globalId===j){let s=function(d,u){return d.networkSourceId===u.networkSourceId&&d.globalId===u.globalId&&d.terminalId===u.terminalId&&d.firstUnit===u.firstUnit&&d.numUnits===u.numUnits},a=t.fromNetworkElement,i=t.toNetworkElement,r=e.fromNetworkElement,o=e.toNetworkElement,l=s(a,r),c=s(i,o);return l&&c&&t.associationType===e.associationType}return t.globalId!=null&&e.globalId!=null&&t.globalId===e.globalId}async _findLayersBySourceId(t){let{_utilityNetwork:e,map:s}=this;e?.loaded||await e?.load();let a=e.getLayerIdBySourceId(t),i=s.allLayers.filter(o=>!!e?.isUtilityLayer(o)&&o.layerId===a),r=s.allTables.filter(o=>!!e?.isUtilityLayer(o)&&o.layerId===a);return i.concat(r).toArray()}_getAssociationsByType(t){switch(t){case"attachment":return this._attachmentAssociations;case"structure":return this._structureAssociations;case"connectivity":return this._connectivityAssociations;case"container":return this._containerAssociations;case"content":return this._contentAssociations}}_getAssociationTypeTitle(t){let{messages:e}=this;if(t.title)return t.title;switch(t.type){case"attachment":return e?.associationsAttachments??this.messages?.noTitle??"";case"connectivity":return e?.associationsConnectivity??this.messages?.noTitle??"";case"structure":return e?.associationsStructure??this.messages?.noTitle??"";case"content":return e?.associationsContents??this.messages?.noTitle??"";case"container":return e?.associationsContainer??this.messages?.noTitle??""}}_getFeatureCountForAssociationType(t){switch(t){case"attachment":return this._attachmentFeatureCount;case"structure":return this._structureFeatureCount;case"content":return this._contentFeatureCount;case"container":return this._containerFeatureCount;case"connectivity":return this._connectivityFeatureCount}}_getFeatureQueryWhereClause(t,e,s,a){let i=t.globalIdField,r=t.fieldsIndex.get(D.assetGroup),o=t.fieldsIndex.get(D.assetType),l=s!=null,c=a!=null,d=i?V.sqlIn(i,e):null,u=l?`(${r?.name} = ${s})`:null,h=l&&c?`(${o?.name} = ${a})`:null;return[d,u,h].filter(Boolean).join(" AND ")}_getFeatureTitle(t){let e=t.attributes,s=t.sourceLayer;if(!e||!s)return"";let a="displayField"in s?s.displayField:null,i=a!=null?e[a.toString()]:null,r=i!=null?i.toString():null,o=t.getObjectId()?.toString();return r||o||""}_getParentFeatureDescription(){let{parentFeatureViewModel:t}=this;if(t){if("heading"in t)return t.heading;if("title"in t)return t.title}}async _loadUtiltyNetworks(){let t=this.map;if(!t)return;t.utilityNetworks&&await Promise.allSettled(t.utilityNetworks.map(s=>s.load()));let e=this._utilityNetwork;if(e){let s=a=>{if("layerId"in a&&e.isUtilityLayer(a)){let i=a.layerId!=null?e.getSourceIdByLayerId(a.layerId):null;i!=null&&this._networkSourceIdsInUse.add(i)}};this._networkSourceIdsInUse=new Set,t.allLayers.forEach(s),t.allTables.forEach(s)}}async _loadLayers(t){let e=t.filter(s=>!s.loaded).map(s=>s.load());e.length&&await Promise.allSettled(e)}_matchesGlobalFeature(t,e){return this._equals(t.association,e.association)}async _queryAssociatedFeatures(t,e){let{layer:s,_globalId:a,associationTypes:i,_utilityNetwork:r,_canQuery:o,_associationFeatures:l}=this;if(await Promise.allSettled([s?.load(),r?.load()]),!o||!s||!i||!r)return;let c=this._getAssociationsByType(t.type),{associatedAssetGroup:d,associatedAssetType:u}=t,h=new Map;c.forEach(n=>{let{fromNetworkElement:_,toNetworkElement:y}=n,{networkSourceId:w,elementGlobalId:b}=_.globalId===a?{networkSourceId:y.networkSourceId,elementGlobalId:y.globalId}:{networkSourceId:_.networkSourceId,elementGlobalId:_.globalId},g=h.get(w)||[];g.push(b),h.set(w,g)});let m=await this._createAssociationFeatureObjects(c,h,d,u,e);this._parseFeatureObjects(m,l)}async _queryAssociations(t){let{layer:e,_globalId:s,associationTypes:a,_utilityNetwork:i,_canQuery:r}=this;if(await Promise.allSettled([e?.load(),i?.load()]),this._clearAssociations(),!r||!e||!a||!i||!s)return;let o=A(e)?e.parent:e,l=new P({globalId:s,networkSourceId:i.getSourceIdByLayerId(o.layerId)}),c=new Set;a.forEach(n=>{switch(n.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity");break}});let d=await i?.queryAssociations(new Q({elements:[l],types:Array.from(c)}),{signal:t?.signal}),u=new Map,h=new Map;a.forEach(n=>{h.set(n.type,n),u.set(n.type,[])}),d.forEach(n=>{let{toNetworkElement:_,fromNetworkElement:y}=n;switch(n.associationType){case"attachment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"attachment",h))break;u.get("attachment")?.push(_.globalId),this._attachmentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"structure",h))break;u.get("structure")?.push(y.globalId),this._structureAssociations.add(n)}break;case"connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":case"junction-junction-connectivity":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"connectivity",h))break;u.get("connectivity")?.push(_.globalId)}else{if(this._shouldDiscardNetworkElement(y,"connectivity",h))break;u.get("connectivity")?.push(y.globalId)}this._connectivityAssociations.add(n);break;case"containment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"content",h))break;u.get("content")?.push(_.globalId),this._contentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"container",h))break;u.get("container")?.push(y.globalId),this._containerAssociations.add(n)}break}});let m=a.map(async n=>{let{associatedNetworkSourceId:_,associatedAssetGroup:y,associatedAssetType:w}=n,b=u.get(n.type),g=y!=null?await this._countAssociatedFeatures(_,b,y,w,t):b.length;switch(n.type){case"attachment":this._attachmentFeatureCount=g;break;case"connectivity":this._connectivityFeatureCount=g;break;case"container":this._containerFeatureCount=g;break;case"content":this._contentFeatureCount=g;break;case"structure":this._structureFeatureCount=g;break}});await Promise.allSettled(m)}async _queryFeatureCount(){await this._loadUtiltyNetworks();let{_queryFeatureCountAbortController:t,_canQuery:e}=this;if(!e){this._featureCount=0;return}await this._queryAssociations(t),this._featureCount=this._attachmentFeatureCount+this._connectivityFeatureCount+this._containerFeatureCount+this._contentFeatureCount+this._structureFeatureCount}async _queryLayer(t,e,s,a,i){let r=this._getFeatureQueryWhereClause(t,e,s,a),o=t.createQuery();o.where=r,o.outFields=["*"],o.returnGeometry=!1,o.cacheHint=this._supportsCacheHint;let{features:l}=await N(t,o,i);return l}_parseFeatureObjects(t,e){let s=k();t.forEach(a=>{let i=(a?.feature).sourceLayer;x(s,i,()=>new f).add(a)});for(let[a,i]of s)this._sortFeatureObjectsByTitle(i),e.set(a,i)}_selectAssociationType(t){let{flowItems:e}=this;e&&(this._activeAssociationType=t,this._setUpUtilityNetworkAssociationsViewModels(),this._addAssociationTypeFlowItem(t))}_setUpUtilityNetworkAssociationsViewModels(){this._associationViewModels.forEach((i,r)=>{let o=this._associationFeatures.get(r);o?i.forEach(l=>{o.find(c=>this._matchesGlobalFeature(l,c))||(i.remove(l),i.length||this._associationViewModels.delete(r))}):(i.removeAll(),this._associationViewModels.delete(r))});let{map:t,view:e,spatialReference:s,timeZone:a}=this;this._associationFeatures.forEach((i,r)=>{let o=this._associationViewModels.get(r)||new f;i?.filter(Boolean).forEach((l,c)=>{if(!o.some(d=>this._matchesGlobalFeature(d,l))){let{association:d,feature:u,terminalName:h,title:m}=l;o.add({title:m,association:d,featureViewModel:new B({abilities:{utilityNetworkAssociationsContent:!1},map:t,view:e,spatialReference:s,timeZone:a,graphic:u}),terminalName:h},c)}}),this._associationViewModels.set(r,o)})}_shouldDiscardNetworkElement(t,e,s){if(!t)return!1;let{networkSourceId:a}=t,i=s.get(e)?.associatedNetworkSourceId,r=this._networkSourceIdsInUse.has(a);return i!=null&&i!==a||!r}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}render(){let{_state:t}=this;return p`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${t==="loading"?this._renderLoading():t==="disabled"?this._renderAssociationNotFound():this._renderContent()}</div>`}_renderAssociationNotFound(){return p`<calcite-notice icon=information kind=info open scale=s width=full><div slot=message>${this.messages?.noAssociations}</div></calcite-notice>`}_renderAssociationTypeList(t){return this._getFeatureCountForAssociationType(t.type)>0?this._renderAssociationTypeListItem(t):null}_renderAssociationTypeListItem(t){let e=this._getAssociationTypeTitle(t);return I(`association-type-${t.type}`,p`<calcite-list-item .description=${E(t.description)} .label=${E(e)} .value=${t.type} @calciteListItemSelect=${()=>this._selectAssociationType(t)}><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`)}_renderContent(){let{_state:t,associationTypes:e,messages:s}=this,a=s?.associationsList??s?.noTitle??"";return I("list-container",p`<div class="list-container">${t==="ready"?p`<div><calcite-list display-mode=flat .label=${a}>${e.map(i=>this._renderAssociationTypeList(i))}</calcite-list></div>`:null}${this._renderStickyLoading()}</div>`)}_renderLoading(){return p`<div class="loading-container">${this._renderLoadingIcon()}${this._renderStickyLoading()}</div>`}_renderLoadingIcon(){return p`<calcite-loader inline label></calcite-loader>`}_renderStickyLoading(){return this._state==="querying"?p`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}};L("arcgis-feature-utility-network-associations",T);return T},"applications/Components/featureUtils","applications/Components/stringUtils","core/Collection","core/promiseUtils","core/reactiveUtils","core/sql","rest/networks/support/NetworkElement","rest/networks/support/QueryAssociationsParameters","popup/Feature",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import j from"./G4CPNGQ6.js";import{a as E}from"./SBUR54TP.js";import i from"./QFH7PJYV.js";import h from"./MZWO5JYA.js";import f from"./DUWXDGIW.js";import{a as y}from"./VJVKFKSG.js";import{b as Z,c as U}from"./32XG4IQO.js";import e from"./6IEKX6LJ.js";import{a as z}from"./KPOSO4HB.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{f as P,h as H}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{a as D,d as I}from"./DU6OKLV4.js";import{M as v,N as g,O as L,P as C,R as p,S as O,U as R,a as B,b as o,o as T,x as b}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([W,q,X,{initializeProjection:J},{renderingSanitizer:M},{stripHTML:S},{substitute:m,formatNumber:A},{watch:c},,,,V,,,{d:k},{c:j,d:K}])=>{var Q=B`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}.flow-item-drill-in{--calcite-flow-item-footer-padding: 0}`;function Y(_){return _?.declaredClass.startsWith("esri.layers.")??!1}function ee(_){if(!(!_||!("featureReduction"in _)))return _.featureReduction?.type}var te=V(X),N=class extends L{constructor(){super(...arguments),this._zoomToFeature=new W({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusTrapNode=v(),this._focusTrapAnimationFrameId=null,this._rootFlowItemNode=v(),this._featureMenuViewportNode=v(),this._actionBarMenuNode=v(),this._flowContainerNode=v(),this._aggregatedFeaturesComponent=v(),this.messages=z(),this._selectedFeatureComponent=v(),this._direction=P(),this._cancelOpenRelatedFeature=()=>{this._openRelatedFeatureAbortController=y(this._openRelatedFeatureAbortController)},this._openRelatedFeatureAbortController=null,this.flowItems=new q,this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._hasActionsStartSlotContent=!1,this._hasActionsEndSlotContent=!1,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.focusTrapEnabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureItemAbilities=this.viewModel.featureItemAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new q,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.chartAnimationDisabled=this.viewModel.featureItemAbilities?.chartAnimation,this.hideAttachmentsContent=this.viewModel.featureItemAbilities?.attachmentsContent,this.hideCustomContent=this.viewModel.featureItemAbilities?.customContent,this.hideExpressionContent=!1,this.hideFieldsContent=this.viewModel.featureItemAbilities?.fieldsContent,this.hideMediaContent=this.viewModel.featureItemAbilities?.mediaContent,this.hideRelationshipContent=this.viewModel.featureItemAbilities?.relationshipContent,this.hideTextContent=this.viewModel.featureItemAbilities?.textContent,this.hideUtilityNetworkContent=this.viewModel.featureItemAbilities?.utilityNetworkAssociationsContent,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=b(),this.arcgisClose=b(),this.arcgisTriggerAction=b()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_aggregatedFeatureCount:16,_selectedAggregatedFeatureIndex:16,_aggregatedFeaturesLoading:16,_hasActionsStartSlotContent:16,_hasActionsEndSlotContent:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,focusTrapEnabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureItemAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureItem?.heading)&&!!(this.content||this.viewModel.selectedFeatureItem?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}clear(){this.viewModel.clear()}close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._cancelToggleFocusTrapAnimationFrame(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:a}=t??{},i=new AbortController,{signal:s}=i,n=a?AbortSignal.any([s,a]):s;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await J(this.location.spatialReference,this.view.spatialReference,null,{signal:n}),e=this.view.toScreen(this.location)??void 0),!e)return;let r=await this.viewModel.fetchFeatures(e,{...t,signal:n});this.location=r.location,this.promises=r.pendingFeatures}next(){this.viewModel.next()}previous(){this.viewModel.previous()}async setFocus(){await this._focusTrapNode.value?.setFocus()}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._cancelToggleFocusTrapAnimationFrame(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[c(()=>this.viewModel?.active,()=>this._toggleFocusTrap()),c(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),c(()=>this.viewModel?.view?.scale,()=>this._viewScaleChange()),c(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),c(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),c(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),c(()=>this.viewModel?.featureItems,()=>this._featureMenuViewportScrollTop()),c(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),c(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),c(()=>this.viewModel.aggregatedFeaturesEnabled,e=>{e||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._removeFlowItems())}),c(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),c(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.open],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&T(()=>this.selectedFeatureComponent=e)}_toggleFocusTrap(){this._cancelToggleFocusTrapAnimationFrame(),this._focusTrapAnimationFrameId=requestAnimationFrame(()=>{this._focusTrapAnimationFrameId=null,this.viewModel.active?this._focusTrapNode.value?.activate():this._focusTrapNode.value?.deactivate()})}_cancelToggleFocusTrapAnimationFrame(){this._focusTrapAnimationFrameId!=null&&(cancelAnimationFrame(this._focusTrapAnimationFrameId),this._focusTrapAnimationFrameId=null)}_cancelFetchingFeatures(){this._fetchFeaturesController=y(this._fetchFeaturesController)}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureItems:e}=this.viewModel,t=new Map;return e.forEach(a=>{let i=a?.graphic;if(!i)return;let s=k(i),n=Y(s)?s:null,r=t.get(n);r||(r=[],t.set(n,r)),r.push(a)}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),t.signal.aborted)return;let a=e.graphic,i=a?.geometry;if(i==null||a==null){this._openRelatedFeatureAbortController=null;return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),t.signal.aborted)return;let s=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(t.signal.aborted)return;let n=s.execute(i);n!=null&&(this.location=n),this.features=[a],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController=null}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:a}=this,{id:i}=e,s=a?.attributes,n=e.title??"",r=i==="zoom-to-feature"?m(n,{messages:t}):i==="remove-selected-feature"?m(n,{messages:t}):i==="zoom-to-clustered-features"?m(n,{messages:t}):i==="browse-aggregated-features"?m(n,{messages:t}):e.title;return r&&s?m(r,s):r??""}_onMainKeydown(e){let{key:t}=e;U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:a,waitingForResult:i}=this.viewModel;i||!a||e===t||e===-1||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){e.disabled||(e?.type==="toggle"&&(e.value=!e.value),K(e,this.viewModel),this.arcgisTriggerAction.emit({action:e}))}_viewScaleChange(){let{selectedFeature:e}=this;!e?.isAggregate||ee(k(e))!=="cluster"||(this.viewModel.aggregatedFeaturesEnabled=!1,this.open=!1,this.clear())}_viewChange(){this.viewModel.clear(),this.open=!1,this._aggregatedFeatureCount=0,this._removeFlowItems()}_handleAggregatedFeaturesPropertyChange({detail:e,target:t}){e.name==="aggregatedFeatureCount"&&(this._aggregatedFeatureCount=t.aggregatedFeatureCount),e.name==="selectedAggregatedFeatureIndex"&&(this._selectedAggregatedFeatureIndex=t.selectedAggregatedFeatureIndex,this._syncSelectedDrillInFeature()),e.name==="loading"&&(this._aggregatedFeaturesLoading=t.loading)}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);T(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_removeFlowItems(){this.viewModel.aggregatedFeaturesEnabled=!1,this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_getHeading(){let{effectiveHeading:e}=this.viewModel;return!this.hideHeading&&e?e:""}_handleActionsStartSlotChange(e){this._hasActionsStartSlotContent=D(e)}_handleActionsEndSlotChange(e){this._hasActionsEndSlotContent=D(e)}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=O(o`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.open&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return o`<div class="root" @keydown=${this._onMainKeydown}><calcite-focus-trap .focusTrapDisabled=${!this.focusTrapEnabled} ${g(this._focusTrapNode)}>${this._renderHeader()}${this._renderContentContainer()}</calcite-focus-trap></div>`}_renderFeatureNavigation(){return[this._renderPagination(()=>this._previousFeature(),()=>this._nextFeature()),this.initialDisplayMode==="list"?this._renderFeaturePaginationText(this.viewModel.featureCount,this.viewModel.selectedFeatureIndex):this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(e,t){let{messages:a}=this;return o`<div class="pagination-text">${m(a.pageText??"",{index:A(t+1),total:A(e)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:a,selectedFeatureIndex:i,pendingPromisesCount:s}=t;return o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${s>0} @click=${this._handlePaginationMenuButton} .text=${m(e.pageText??"",{index:A(i+1),total:A(a)})} text-enabled title=${e.selectFeature??p}></calcite-action>`}_renderPagination(e,t){let{previous:a,next:i}=this.messages;return o`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${a??""} @click=${e} .text=${a??""} title=${a??""??p}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${i??""} @click=${t} .text=${i??""} title=${i??""??p}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e,t){let{initialDisplayMode:a}=this,{selectedFeatureItem:i}=this.viewModel,s=e===i;return o`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(t)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(t)} .selected=${s} @calciteListItemSelect=${()=>this._selectFeature(t)}><span .innerHTML=${(M.sanitize(e.heading)||this.messages.untitled)??""} slot=content></span>${a==="list"?o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,a=this._groupResultsByLayer(),i=new Map;t.featureItems.forEach((n,r)=>i.set(n,r));let s=this.initialDisplayMode==="list"?"none":"single";return t.featureItems.length?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${s}>${Array.from(a.keys(),n=>{let r=a.get(n)?.map(l=>{let h=i.get(l);return h==null?null:this._renderFeatureMenuItem(l,h)}),d=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&d!==null?E(n??"map-graphics",o`<calcite-list-item-group .heading=${d}>${r}</calcite-list-item-group>`):r})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??p}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(e){let{headingLevel:t,hideCloseButton:a,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n,initialDisplayMode:r,selectedFeature:d,hideHeading:l}=this,{active:h,selectedFeatureItem:f,content:F}=this.viewModel,u=this._getHeading();if(r==="list"&&!d)return null;let w=f?!f.content:!F;return o`<calcite-flow-item class=${C(I({"content-feature":!0,"flow-item-collapsed":i}))} .closable=${!a} .closed=${!h} .collapsed=${i} .collapseDirection=${this.collapseDirection??(n?"down":"up")} .collapsible=${s} .headingLevel=${t} .selected=${e} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!l&&u?S(u):void 0} ${g(this._rootFlowItemNode)}>${!l&&u?o`<div slot=heading><div .innerHTML=${M.sanitize(u??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${C(I("container","content-container",{"content-hidden":w}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:a,messages:i,initialDisplayMode:s,featureMenuOpen:n,_featureFlowItemSelected:r,_collapseEnabled:d,_isCollapsed:l,featureNavigationTop:h,headingLevel:f}=this,{active:F,featureItems:u,pendingPromisesCount:w}=e,x=a??i.selectFeature;if(s==="feature"&&!n)return null;let $=!r;return o`<calcite-flow-item class=${C(I({"flow-item-collapsed":l}))} .closable=${s==="list"&&!t} .closed=${!F} .collapsed=${s==="list"&&l} .collapseDirection=${this.collapseDirection??(h?"down":"up")} .collapsible=${s==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:m(i.total??"",{total:u.length})} .heading=${this.hideFeatureMenuHeading?void 0:x} .headingLevel=${f} .loading=${e.waitingForContents} .selected=${$} @calciteFlowItemBack=${G=>{G.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${g(this._featureMenuViewportNode)}>${s==="list"?this._renderHeaderActions():null}${w>0?o`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${$?this._renderFeatureMenu():null}</div><div class="feature-menu-observer" ${g(this._featureMenuIntersectionObserverCreated)}></div>${s==="feature"?o`<calcite-button scale=s appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:a,hideCloseButton:i,hideSelectFeature:s,active:n,hideHeading:r}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,l=d&&!s,h=e.flowType==="feature-association",f=a.returnToInitialFeature??"",F=a?.selectFeature,u=this._getActionTitle(this._zoomToFeature),w=!this.hideActionBar&&h&&d,x=e.flowType==="feature"&&this.viewModel.aggregatedFeaturesEnabled?o`<div class="footer" slot=footer>${this._renderPagination(()=>{this._aggregatedFeaturesComponent.value?.previous()},()=>{this._aggregatedFeaturesComponent.value?.next()})}${this._renderFeaturePaginationText(this._aggregatedFeatureCount,this._selectedAggregatedFeatureIndex)}</div>`:null;return o`<calcite-flow-item .closable=${!i} .closed=${!n} class="flow-item-drill-in" .description=${S(this._getDrillInFlowItemDescription(e)??"")} .heading=${r?void 0:S(e.heading??"")} .selected=${t} @calciteFlowItemBack=${$=>{$.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${r?null:o`<div slot=heading><div .innerHTML=${M.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${M.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${f??""} title=${f??""??p}></calcite-action>${l?o`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${F??""} title=${F??p}></calcite-action>`:null}${w?o`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${this._zoomToFeature.disabled} .icon=${this._zoomToFeature.icon??void 0} .loading=${this._zoomToFeature.active} scale=s text-enabled .text=${u} title=${u??p} @click=${()=>j(this.viewModel,this._zoomToFeature,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div>${x}</calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e.length>0,a=this.viewModel.aggregatedFeaturesEnabled&&this.viewModel.selectedFeature?.isAggregate&&!t,i=a&&e.length===0,s=e.length===0&&this._featureFlowItemSelected&&!a,n=e?.map((l,h)=>this._renderFlowItem(l,this._featureFlowItemSelected&&h===e.length-1)),r=this._renderBrowseAggregateContainer(!!i),d=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(s)]:[this._renderContentFeature(s),this._renderFeatureMenuContainer()];return o`<calcite-flow ${g(this._flowContainerNode)}>${d}${r}${n}</calcite-flow>`}_renderBrowseAggregateContainer(e){let{hideCloseButton:t,active:a,messages:i}=this,{selectedFeature:s}=this.viewModel;return this.viewModel.aggregatedFeaturesEnabled&&s?.isAggregate?o`<calcite-flow-item .selected=${e} .closable=${!t} .closed=${!a} .description=${this._aggregatedFeatureCount?m(i.total??"",{total:this._aggregatedFeatureCount}):""} .heading=${i.aggregatedFeatures} @calciteFlowItemBack=${n=>{n.preventDefault(),this.viewModel.aggregatedFeaturesEnabled=!1}} .loading=${this._aggregatedFeaturesLoading} @calciteFlowItemClose=${this._handleClose}><arcgis-aggregated-features .autoDestroyDisabled=${this.autoDestroyDisabled} .feature=${s??void 0} .flowItems=${this.flowItems} .map=${this.map??void 0} .messages=${i} @arcgisPropertyChange=${this._handleAggregatedFeaturesPropertyChange} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.view??void 0} ${g(this._aggregatedFeaturesComponent)}></arcgis-aggregated-features><calcite-button appearance=transparent @click=${()=>this.viewModel.aggregatedFeaturesEnabled=!1} slot=footer-start scale=s width=full>${i.back}</calcite-button></calcite-flow-item>`:null}_renderActionBar(){let e=this.viewModel.selectedFeatureItem?.isFeatureFromTable,t=this.viewModel.allActions.toArray(),a=e&&!this.location?t.filter(s=>s.id!==this._zoomToFeature.id):t,i=!!a.length||this._hasActionsStartSlotContent||this._hasActionsEndSlotContent;return!this._isCollapsed&&!this.hideActionBar&&i?o`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><slot name=actions-start @slotchange=${this._handleActionsStartSlotChange}></slot><calcite-action-group overlay-positioning=fixed scale=s ${g(this._actionBarMenuNode)}>${this._renderActions(a)}</calcite-action-group><slot name=actions-end @slotchange=${this._handleActionsEndSlotChange}></slot></calcite-action-bar>`:null}_renderActions(e){return e.map(t=>{let a=this._getActionTitle(t);return o`<calcite-action .active=${t.type==="toggle"?t.value:!1} .disabled=${t.disabled} .icon=${t.icon??void 0} .loading=${t.active} scale=s .textEnabled=${!this._hideActionText} .text=${a??""} title=${a??p} .hidden=${!t.visible} @click=${()=>this._triggerAction(t)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureItem:t}=this.viewModel;return t?o`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${g(this._selectedFeatureComponent)}></arcgis-feature-next>`:typeof e=="string"?E(e,o`<div .innerHTML=${M.sanitize(e)??""}></div>`):e??null}};R("arcgis-features-next",N);return N},"support/actions/ActionButton","core/Collection","popup/Features","applications/Components/featureUtils","applications/Components/sanitizerUtils","applications/Components/stringUtils","intl","core/reactiveUtils",a,c,d,e,f,h,i,j)
|