@geoscene/core 4.33.18 → 4.33.20
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/WebLinkChart.js +1 -1
- package/assets/geoscene/themes/base/_core.scss +1 -1
- package/identity/IdentityModal.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/package.json +2 -2
- package/rest/query/operations/query.js +1 -1
- package/support/actions/actionUtils.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
- package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
package/widgets/TimeZoneLabel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{systemTimeZone as r,system as n,unknown as a}from"../time/constants.js";import c from"./Widget.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{isRTL as p}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as h}from"./support/jsxFactory.js";import{css as b}from"./TimeZoneLabel/css.js";import g from"./TimeZoneLabel/TimeZoneLabelViewModel.js";let u=class extends c{constructor(e,s){super(e,s),this.disabled=!1,this.expanded=!1,this.messages=null,this.viewModel=new g,this._onExpanderClick=()=>{this.expanded=!this.expanded},t(i.getLogger(this),"Time Zone Label","geoscene-time-zone-label",{version:"4.33"})}loadDependencies(){return l({action:()=>import("@
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{systemTimeZone as r,system as n,unknown as a}from"../time/constants.js";import c from"./Widget.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{isRTL as p}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as h}from"./support/jsxFactory.js";import{css as b}from"./TimeZoneLabel/css.js";import g from"./TimeZoneLabel/TimeZoneLabelViewModel.js";let u=class extends c{constructor(e,s){super(e,s),this.disabled=!1,this.expanded=!1,this.messages=null,this.viewModel=new g,this._onExpanderClick=()=>{this.expanded=!this.expanded},t(i.getLogger(this),"Time Zone Label","geoscene-time-zone-label",{version:"4.33"})}loadDependencies(){return l({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon"),"input-time-zone":()=>import("@geoscene/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@geoscene/calcite-components/dist/components/calcite-label")})}get expandDirection(){if(!this.view||!this.container)return"end";const e=p();switch(this.view.ui.getPosition(this.container)){case"top-right":case"bottom-right":case"top-trailing":case"bottom-trailing":return e?"end":"start";case"top-left":case"bottom-left":case"top-leading":case"bottom-leading":return e?"start":"end";default:return"end"}}set expandDirection(e){this._overrideIfSome("expandDirection",e)}get icon(){return"time-zone"}set icon(e){this._overrideIfSome("icon",e)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{expandDirection:e,interactive:t,label:i}=this,s=this.classes(b.base,d.widget,!t&&d.disabled),o=[this._renderExpander(),this._renderName(),this._renderBadge()];return"start"===e&&o.reverse(),h("div",{"aria-label":i,class:s},o)}_getIcon(){const{expanded:e,expandDirection:t}=this;return e?p()?"start"===t?"chevrons-left":"chevrons-right":"start"===t?"chevrons-right":"chevrons-left":"time-zone"}_renderExpander(){const{interactive:e,label:t}=this,i=this._getIcon();return h("calcite-action",{active:!1,class:b.expander,disabled:!e,icon:i,key:b.expander,onclick:this._onExpanderClick,scale:"s",text:t,title:t})}_renderBadge(){const{expanded:e,interactive:t}=this;return h("div",{class:this.classes(b.badge,!e&&b.badgeHidden,!t&&b.badgeDisabled)},h("calcite-icon",{class:b.badgeIcon,icon:"time-zone",scale:"s"}))}_renderName(){const e=this.viewModel.view?.timeZone,t=e===n?r:e,i=e===a;return[h("calcite-label",{class:this.classes(b.label,(!this.expanded||!i)&&b.labelHidden,!this.interactive&&b.labelDisabled)},this.messages.noAdjustment),h("calcite-input-time-zone",{class:this.classes(b.name,(!this.expanded||!t||i)&&b.nameHidden),disabled:!this.interactive,mode:"region",readOnly:!0,value:t})]}};e([s()],u.prototype,"disabled",void 0),e([s()],u.prototype,"expandDirection",null),e([s()],u.prototype,"expanded",void 0),e([s()],u.prototype,"icon",null),e([s({readOnly:!0})],u.prototype,"interactive",null),e([s()],u.prototype,"label",null),e([s(),m("geoscene/widgets/TimeZoneLabel/t9n/TimeZoneLabel")],u.prototype,"messages",void 0),e([s()],u.prototype,"view",null),e([s()],u.prototype,"viewModel",void 0),u=e([o("geoscene.widgets.TimeZoneLabel")],u);const v=u;export{v as default};
|
package/widgets/Track.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{vmEvent as c}from"./support/decorators/vmEvent.js";import{tsx as p}from"./support/jsxFactory.js";import d from"./Track/TrackViewModel.js";const g={base:"geoscene-track"};let u=class extends s{constructor(e,r){super(e,r),this.messages=null,this.viewModel=new d,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(t.getLogger(this),"Track","geoscene-track",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{vmEvent as c}from"./support/decorators/vmEvent.js";import{tsx as p}from"./support/jsxFactory.js";import d from"./Track/TrackViewModel.js";const g={base:"geoscene-track"};let u=class extends s{constructor(e,r){super(e,r),this.messages=null,this.viewModel=new d,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(t.getLogger(this),"Track","geoscene-track",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@geoscene/calcite-components/dist/components/calcite-button"),tooltip:()=>import("@geoscene/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:o,icon:t}=this,r=e?.state,i="tracking"===r,s=this._localizeError(this.viewModel?.error),a=(i?o?.stopTracking:o?.startTracking)??"",l="feature-unsupported"===r,c=("tracking"===r?"pause":void 0)??t;return p("div",{class:this.classes(g.base,n.widget)},!l&&p("calcite-button",{class:n.widgetButton,disabled:"disabled"===r,iconStart:c,kind:"neutral",label:a,loading:"waiting"===r,onclick:this._toggleTracking,title:a}),s?p("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container},s):null)}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([r()],u.prototype,"geolocationOptions",null),e([r()],u.prototype,"goToLocationEnabled",null),e([r()],u.prototype,"goToOverride",null),e([r()],u.prototype,"graphic",null),e([r()],u.prototype,"icon",null),e([r()],u.prototype,"label",null),e([r(),l("geoscene/widgets/Track/t9n/Track")],u.prototype,"messages",void 0),e([r()],u.prototype,"rotationEnabled",null),e([r()],u.prototype,"scale",null),e([r({readOnly:!0})],u.prototype,"tracking",null),e([r()],u.prototype,"view",null),e([r({type:d}),c(["track","track-error"])],u.prototype,"viewModel",void 0),u=e([i("geoscene.widgets.Track")],u);const m=u;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{getAssetUrl as t}from"../../assets.js";import o from"../../Color.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../symbols/LineSymbolMarker.js";import n from"../../symbols/SimpleLineSymbol.js";import l from"../Widget.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as a}from"../support/decorators/messageBundle.js";import{tsx as d}from"../support/jsxFactory.js";import p from"./VisibleElementsSettingsPane.js";const m="geoscene-un-associations",u={divControlsSymbolPicker:`${m}__div-controls-symbol-picker`,dropdown:`${m}__dropdown`,dropdownItemLineCap:`${m}__dropdown-item-line-cap`,dropdownItemLinePattern:`${m}__dropdown-item-line-pattern`,dropdownSelectedItemLineCap:`${m}__dropdown-selected-item-line-cap`,dropdownSelectedItemLinePattern:`${m}__dropdown-selected-item-line-pattern`,dropdownTrigger:`${m}__dropdown-trigger`,labelAndToggle:`${m}__label-and-toggle`};let w=class extends l{constructor(e,t){super(e,t),this._lineCapTypes=["butt","round","square"],this._lineStyleTypes=["solid","dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","short-dash","short-dash-dot","short-dash-dot-dot","short-dot"],this.lineSymbol=new n,this.messages=null,this.showArrows=!1,this.visibleElements=new p,this._afterComponentCreate=this._afterComponentCreate.bind(this)}render(){const{messages:{input:{lineCap:e,lineColor:t,lineStyle:o,lineWidth:r,showArrows:s}},visibleElements:i}=this,n=this.lineSymbol;return d("div",{class:u.divControlsSymbolPicker},i.arrowsToggle?this._renderToggle(s,this.showArrows,n,"marker"):void 0,i.capSelect?this._renderLineStylePicker(e,this._lineCapTypes,n,"cap"):void 0,i.colorPicker&&n.color?this._renderColorPicker(t,n.color.toHex(),n,"color"):void 0,i.stylePicker?this._renderLineStylePicker(o,this._lineStyleTypes,n,"style"):void 0,i.widthInput?this._renderNumberInput(r,n.width.toString(),n,"width"):void 0)}loadDependencies(){return c({dropdown:()=>import("@
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{getAssetUrl as t}from"../../assets.js";import o from"../../Color.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../symbols/LineSymbolMarker.js";import n from"../../symbols/SimpleLineSymbol.js";import l from"../Widget.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as a}from"../support/decorators/messageBundle.js";import{tsx as d}from"../support/jsxFactory.js";import p from"./VisibleElementsSettingsPane.js";const m="geoscene-un-associations",u={divControlsSymbolPicker:`${m}__div-controls-symbol-picker`,dropdown:`${m}__dropdown`,dropdownItemLineCap:`${m}__dropdown-item-line-cap`,dropdownItemLinePattern:`${m}__dropdown-item-line-pattern`,dropdownSelectedItemLineCap:`${m}__dropdown-selected-item-line-cap`,dropdownSelectedItemLinePattern:`${m}__dropdown-selected-item-line-pattern`,dropdownTrigger:`${m}__dropdown-trigger`,labelAndToggle:`${m}__label-and-toggle`};let w=class extends l{constructor(e,t){super(e,t),this._lineCapTypes=["butt","round","square"],this._lineStyleTypes=["solid","dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","short-dash","short-dash-dot","short-dash-dot-dot","short-dot"],this.lineSymbol=new n,this.messages=null,this.showArrows=!1,this.visibleElements=new p,this._afterComponentCreate=this._afterComponentCreate.bind(this)}render(){const{messages:{input:{lineCap:e,lineColor:t,lineStyle:o,lineWidth:r,showArrows:s}},visibleElements:i}=this,n=this.lineSymbol;return d("div",{class:u.divControlsSymbolPicker},i.arrowsToggle?this._renderToggle(s,this.showArrows,n,"marker"):void 0,i.capSelect?this._renderLineStylePicker(e,this._lineCapTypes,n,"cap"):void 0,i.colorPicker&&n.color?this._renderColorPicker(t,n.color.toHex(),n,"color"):void 0,i.stylePicker?this._renderLineStylePicker(o,this._lineStyleTypes,n,"style"):void 0,i.widthInput?this._renderNumberInput(r,n.width.toString(),n,"width"):void 0)}loadDependencies(){return c({dropdown:()=>import("@geoscene/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@geoscene/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@geoscene/calcite-components/dist/components/calcite-dropdown-item"),input:()=>import("@geoscene/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@geoscene/calcite-components/dist/components/calcite-input-number"),label:()=>import("@geoscene/calcite-components/dist/components/calcite-label"),switch:()=>import("@geoscene/calcite-components/dist/components/calcite-switch")})}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_renderColorPicker(e,t,r,s){return d("calcite-label",{scale:"s"},e,d("calcite-input",{scale:"s",type:"color",value:t,onCalciteInputInput:e=>{const t=e.currentTarget;r.set(s,new o(t.value))}}))}_renderLineStylePicker(e,o,r,s){const i="style"===s,n="geoscene/widgets/UtilityNetworkAssociations/assets/img";function l(e,o){return d("calcite-dropdown-item",{label:e,selected:r[o]===e},d("div",{class:i?u.dropdownItemLinePattern:u.dropdownItemLineCap,style:`background-image:url(${t(`${n}/line-${i?"patterns":"caps"}/${e}.png`)})`}))}return d("calcite-label",{scale:"s"},e,d("calcite-dropdown",{class:u.dropdown,onCalciteDropdownSelect:e=>{const t=e.currentTarget;r.set(s,t.selectedItems[0].label)}},d("div",{class:u.dropdownTrigger,role:"button",slot:"trigger"},d("div",{class:i?u.dropdownSelectedItemLinePattern:u.dropdownSelectedItemLineCap,style:`background-image:url(${t(`${n}/line-${i?"patterns":"caps"}/${r[s]}.png`)})`})),d("calcite-dropdown-group",null,o.map((e=>l(e,s))))))}_renderNumberInput(e,t,o,r){return d("calcite-label",{scale:"s"},e,d("calcite-input-number",{afterCreate:this._afterComponentCreate,max:10,min:1,scale:"s",step:1,type:"number",value:t,onCalciteInputNumberChange:e=>{const t=e.currentTarget;o.set(r,t.value)}}))}_renderToggle(e,t,o,r){return d("div",{class:u.labelAndToggle},d("calcite-label",{scale:"s"},e),d("calcite-switch",{bind:this,checked:t,onCalciteSwitchChange:e=>{e.currentTarget.checked?o.set(r,new i({style:"arrow"})):o.set(r,null)}}))}};e([r()],w.prototype,"lineSymbol",void 0),e([r(),a("geoscene/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),e([r()],w.prototype,"showArrows",void 0),e([r({type:p,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=e([s("geoscene.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationsLineSymbolPicker")],w);const g=w;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{watch as i,on as s,initial as e}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as r}from"./support/jsxFactory.js";import d from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import h from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";const A="geoscene-un-associations",u={action:`${A}__action`,actionRefresh:`${A}__action-refresh`,blockContent:`${A}__block-content`,blockSectionSettings:`${A}__block-section-settings`,combobox:`${A}__combobox`,comboboxItem:`${A}__combobox-item`,divControlsMain:`${A}__div-controls-main`,label:`${A}__label`,labelAndCombobox:`${A}__label-and-combobox`,labelAndSlider:`${A}__label-and-slider`,labelAndToggle:`${A}__label-and-toggle`,panel:`${A}__panel`,slider:`${A}__slider`,statusIconContainer:`${A}__status-icon-container`,statusIconWarning:`${A}__status-icon-warning`,switch:`${A}__switch`,switchContainer:`${A}__switch-container`,widgetContainer:`${A}__widget-container`};let w=class extends l{constructor(t,i){super(t,i),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new h,this.visibleElements=new m}initialize(){this.addHandles([i((()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations]),(()=>{!0===this.autoRefreshAssociations&&(!0===this.showAssociationsEnabled?this.viewModel.showAssociations():this.viewModel.removeAssociations())})),i((()=>this.view?.map?.utilityNetworks),(t=>{t?.items.forEach((async(t,i)=>{t.loaded||await t.load(),0===i&&(this.utilityNetwork=t)}))}),e),s((()=>this.view?.map?.utilityNetworks),"change",(t=>{const i=t.target;t.added.forEach((async t=>{t.loaded||await t.load()})),t.removed.some((t=>t.layerUrl===this.utilityNetwork?.layerUrl))&&(this.utilityNetwork=null),this.utilityNetwork=i.length?i.getItemAt(0):null}))])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(t){this._autoRefreshAssociations=t}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(t){this.viewModel.connectivityAssociationsLineSymbol=t}get icon(){return"view-associations"}set icon(t){this._overrideIfSome("icon",t)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(t){this.viewModel.includeConnectivityAssociations=t}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(t){this.viewModel.includeStructuralAttachmentAssociations=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(t){this.viewModel.maxAllowableAssociations=t}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(t){t<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=t)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(t){t<0||t>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=t)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(t){this._maxAllowableAssociationsSliderStep=t}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(t){this.viewModel.showArrowsConnectivity=t}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(t){this.viewModel.showArrowsStructuralAttachment=t}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(t){this.viewModel.showAssociationsEnabled=t}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(t){this.viewModel.structuralAttachmentAssociationsLineSymbol=t}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{label:t}=this;return r("div",{class:u.widgetContainer},r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()))}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}_connectivityAssociationsSwitchChange(t){this.includeConnectivityAssociations=t.currentTarget.checked}_getLoadErrorMessagesAsNotices(t,i){return r("calcite-notice",{closable:!1,key:`error-notice-${i}`,kind:"warning",open:!0,scale:"s"},r("div",{slot:"message"},t))}_maxAllowableAssociationsSliderChange(t){this.maxAllowableAssociations=Number(t.currentTarget.value)}_refreshAssociations(){const{viewModel:t,viewModel:{state:i}}=this;"ready"!==i&&"warning"!==i||t.showAssociations()}_renderConnectivityAssociationsSettings(){const{messages:{input:{enableConnectivity:t}},visibleElements:{connectivityAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:i}))}_renderConnectivityAssociationsToggle(){const{messages:{input:{enableConnectivity:t}}}=this;return r("div",{class:u.labelAndToggle,key:"connectivityAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:t,value:i,selected:s}){return r("calcite-combobox-item",{class:u.comboboxItem,heading:t,selected:s,textLabel:t,value:i})}_renderContent(){const{viewModel:{loadErrors:t,state:i}}=this;return"disabled"===i?r("div",{class:u.divControlsMain,key:"loadErrorsDiv"},t.items.map(this._getLoadErrorMessagesAsNotices)):r("calcite-panel",{class:u.panel,disabled:"loading"===i},r("div",{class:u.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingAction(t,i,s){return r("div",{key:t,slot:"control"},r("calcite-action",{id:i,loading:!0,text:s}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s)))}_renderMaxAllowableAssociationsSlider(){const{messages:{input:{maxAllowableAssociations:t}},visibleElements:{maxAllowableAssociationsSlider:i}}=this;if(i)return r("div",{class:u.labelAndSlider,key:"maxAllowableAssociationsSliderDiv"},r("calcite-label",{class:u.label},t),r("calcite-slider",{bind:this,class:u.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:"s",snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){const{messages:{input:{refreshAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-refresh-action`;if("disabled"!==s)return r("div",{class:u.actionRefresh,slot:"control"},r("calcite-action",{bind:this,class:u.action,icon:"refresh-f",id:e,loading:"loading"===s,onclick:this._refreshAssociations,text:t}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,"loading"===s?i:t)))}_renderSettingsPane(){const{messagesCommon:{settings:t},visibleElements:{maxAllowableAssociationsSlider:i,connectivityAssociationsSettings:s,structuralAttachmentAssociationsSettings:e}}=this,o=(this.view?.map).utilityNetworks?.items;if(1!==o?.length||i||s||e)return r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},r("div",{class:u.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){const{messages:{input:{enableAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-show-associations-switch`;if("disabled"!==s)return"loading"===s?this._renderLoadingAction("loadingActionDiv",`${this.id}-loading-action`,i):r("div",{class:u.switchContainer,key:"switchDiv",slot:"control"},r("calcite-switch",{bind:this,checked:this.showAssociationsEnabled,class:u.switch,id:e,onCalciteSwitchChange:this._showAssociationsSwitchChange}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,t)))}_renderStatusIcon(){const{messagesCommon:{executing:t},viewModel:{executionError:i,state:s}}=this;switch(s){case"disabled":return this._renderWarningIcon("statusDiv",`${this.id}-disabled-icon`,null);case"warning":return this._renderWarningIcon("statusDiv",`${this.id}-warning-icon`,i);case"executing":return this._renderLoadingAction("executingActionDiv",`${this.id}-executing-action`,t);default:return}}_renderStructuralAttachmentAssociationsSettings(){const{messages:{input:{enableStructuralAttachment:t}},visibleElements:{structuralAttachmentAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:i}))}_renderStructuralAttachmentAssociationsToggle(){const{messages:{input:{enableStructuralAttachment:t}}}=this;return r("div",{class:u.labelAndToggle,key:"structuralAttachmentAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){const{messages:{input:{utilityNetwork:t}}}=this,i=(this.view?.map).utilityNetworks?.items;if(1===i?.length)return null;const s=i?.map((t=>{const i=t.title,s=t.layerUrl,e=t.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:i,value:s,selected:e})}));return r("div",{class:u.labelAndCombobox,key:"utilityNetworkComboboxDiv"},r("calcite-label",{class:u.label},t),r("calcite-combobox",{class:u.combobox,clearDisabled:!0,label:"",maxItems:3,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:t=>{const s=i?.find((i=>i.layerUrl===t.currentTarget.value));this.utilityNetwork=s}},s))}_showAssociationsSwitchChange({currentTarget:t}){const{viewModel:i}=this;this.showAssociationsEnabled=t.checked,this._associationsOptionsEnabled=t.checked,this.showAssociationsEnabled||i.removeAssociations()}_structuralAttAssociationsSwitchChange(t){this.includeStructuralAttachmentAssociations=t.currentTarget.checked}_renderWarningIcon(t,i,s){return s?r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s))):r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}))}};t([o()],w.prototype,"autoRefreshAssociations",null),t([o()],w.prototype,"connectivityAssociationsLineSymbol",null),t([o()],w.prototype,"icon",null),t([o()],w.prototype,"includeConnectivityAssociations",null),t([o()],w.prototype,"includeStructuralAttachmentAssociations",null),t([o()],w.prototype,"label",null),t([o()],w.prototype,"maxAllowableAssociations",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMax",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMin",null),t([o()],w.prototype,"maxAllowableAssociationsSliderStep",null),t([o(),c("geoscene/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),t([o(),c("geoscene/t9n/common")],w.prototype,"messagesCommon",void 0),t([o()],w.prototype,"showArrowsConnectivity",null),t([o()],w.prototype,"showArrowsStructuralAttachment",null),t([o()],w.prototype,"showAssociationsEnabled",null),t([o()],w.prototype,"structuralAttachmentAssociationsLineSymbol",null),t([o()],w.prototype,"utilityNetwork",null),t([o()],w.prototype,"view",null),t([o({type:h})],w.prototype,"viewModel",void 0),t([o({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=t([n("geoscene.widgets.UtilityNetworkAssociations")],w);const b=w;export{b as default};
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{watch as i,on as s,initial as e}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as r}from"./support/jsxFactory.js";import d from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import h from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";const A="geoscene-un-associations",u={action:`${A}__action`,actionRefresh:`${A}__action-refresh`,blockContent:`${A}__block-content`,blockSectionSettings:`${A}__block-section-settings`,combobox:`${A}__combobox`,comboboxItem:`${A}__combobox-item`,divControlsMain:`${A}__div-controls-main`,label:`${A}__label`,labelAndCombobox:`${A}__label-and-combobox`,labelAndSlider:`${A}__label-and-slider`,labelAndToggle:`${A}__label-and-toggle`,panel:`${A}__panel`,slider:`${A}__slider`,statusIconContainer:`${A}__status-icon-container`,statusIconWarning:`${A}__status-icon-warning`,switch:`${A}__switch`,switchContainer:`${A}__switch-container`,widgetContainer:`${A}__widget-container`};let w=class extends l{constructor(t,i){super(t,i),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new h,this.visibleElements=new m}initialize(){this.addHandles([i((()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations]),(()=>{!0===this.autoRefreshAssociations&&(!0===this.showAssociationsEnabled?this.viewModel.showAssociations():this.viewModel.removeAssociations())})),i((()=>this.view?.map?.utilityNetworks),(t=>{t?.items.forEach((async(t,i)=>{t.loaded||await t.load(),0===i&&(this.utilityNetwork=t)}))}),e),s((()=>this.view?.map?.utilityNetworks),"change",(t=>{const i=t.target;t.added.forEach((async t=>{t.loaded||await t.load()})),t.removed.some((t=>t.layerUrl===this.utilityNetwork?.layerUrl))&&(this.utilityNetwork=null),this.utilityNetwork=i.length?i.getItemAt(0):null}))])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(t){this._autoRefreshAssociations=t}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(t){this.viewModel.connectivityAssociationsLineSymbol=t}get icon(){return"view-associations"}set icon(t){this._overrideIfSome("icon",t)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(t){this.viewModel.includeConnectivityAssociations=t}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(t){this.viewModel.includeStructuralAttachmentAssociations=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(t){this.viewModel.maxAllowableAssociations=t}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(t){t<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=t)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(t){t<0||t>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=t)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(t){this._maxAllowableAssociationsSliderStep=t}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(t){this.viewModel.showArrowsConnectivity=t}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(t){this.viewModel.showArrowsStructuralAttachment=t}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(t){this.viewModel.showAssociationsEnabled=t}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(t){this.viewModel.structuralAttachmentAssociationsLineSymbol=t}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{label:t}=this;return r("div",{class:u.widgetContainer},r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()))}loadDependencies(){return a({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),block:()=>import("@geoscene/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@geoscene/calcite-components/dist/components/calcite-block-section"),icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon"),combobox:()=>import("@geoscene/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@geoscene/calcite-components/dist/components/calcite-combobox-item"),label:()=>import("@geoscene/calcite-components/dist/components/calcite-label"),notice:()=>import("@geoscene/calcite-components/dist/components/calcite-notice"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel"),slider:()=>import("@geoscene/calcite-components/dist/components/calcite-slider"),switch:()=>import("@geoscene/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@geoscene/calcite-components/dist/components/calcite-tooltip")})}_connectivityAssociationsSwitchChange(t){this.includeConnectivityAssociations=t.currentTarget.checked}_getLoadErrorMessagesAsNotices(t,i){return r("calcite-notice",{closable:!1,key:`error-notice-${i}`,kind:"warning",open:!0,scale:"s"},r("div",{slot:"message"},t))}_maxAllowableAssociationsSliderChange(t){this.maxAllowableAssociations=Number(t.currentTarget.value)}_refreshAssociations(){const{viewModel:t,viewModel:{state:i}}=this;"ready"!==i&&"warning"!==i||t.showAssociations()}_renderConnectivityAssociationsSettings(){const{messages:{input:{enableConnectivity:t}},visibleElements:{connectivityAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:i}))}_renderConnectivityAssociationsToggle(){const{messages:{input:{enableConnectivity:t}}}=this;return r("div",{class:u.labelAndToggle,key:"connectivityAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:t,value:i,selected:s}){return r("calcite-combobox-item",{class:u.comboboxItem,heading:t,selected:s,textLabel:t,value:i})}_renderContent(){const{viewModel:{loadErrors:t,state:i}}=this;return"disabled"===i?r("div",{class:u.divControlsMain,key:"loadErrorsDiv"},t.items.map(this._getLoadErrorMessagesAsNotices)):r("calcite-panel",{class:u.panel,disabled:"loading"===i},r("div",{class:u.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingAction(t,i,s){return r("div",{key:t,slot:"control"},r("calcite-action",{id:i,loading:!0,text:s}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s)))}_renderMaxAllowableAssociationsSlider(){const{messages:{input:{maxAllowableAssociations:t}},visibleElements:{maxAllowableAssociationsSlider:i}}=this;if(i)return r("div",{class:u.labelAndSlider,key:"maxAllowableAssociationsSliderDiv"},r("calcite-label",{class:u.label},t),r("calcite-slider",{bind:this,class:u.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:"s",snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){const{messages:{input:{refreshAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-refresh-action`;if("disabled"!==s)return r("div",{class:u.actionRefresh,slot:"control"},r("calcite-action",{bind:this,class:u.action,icon:"refresh-f",id:e,loading:"loading"===s,onclick:this._refreshAssociations,text:t}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,"loading"===s?i:t)))}_renderSettingsPane(){const{messagesCommon:{settings:t},visibleElements:{maxAllowableAssociationsSlider:i,connectivityAssociationsSettings:s,structuralAttachmentAssociationsSettings:e}}=this,o=(this.view?.map).utilityNetworks?.items;if(1!==o?.length||i||s||e)return r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},r("div",{class:u.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){const{messages:{input:{enableAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-show-associations-switch`;if("disabled"!==s)return"loading"===s?this._renderLoadingAction("loadingActionDiv",`${this.id}-loading-action`,i):r("div",{class:u.switchContainer,key:"switchDiv",slot:"control"},r("calcite-switch",{bind:this,checked:this.showAssociationsEnabled,class:u.switch,id:e,onCalciteSwitchChange:this._showAssociationsSwitchChange}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,t)))}_renderStatusIcon(){const{messagesCommon:{executing:t},viewModel:{executionError:i,state:s}}=this;switch(s){case"disabled":return this._renderWarningIcon("statusDiv",`${this.id}-disabled-icon`,null);case"warning":return this._renderWarningIcon("statusDiv",`${this.id}-warning-icon`,i);case"executing":return this._renderLoadingAction("executingActionDiv",`${this.id}-executing-action`,t);default:return}}_renderStructuralAttachmentAssociationsSettings(){const{messages:{input:{enableStructuralAttachment:t}},visibleElements:{structuralAttachmentAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:i}))}_renderStructuralAttachmentAssociationsToggle(){const{messages:{input:{enableStructuralAttachment:t}}}=this;return r("div",{class:u.labelAndToggle,key:"structuralAttachmentAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){const{messages:{input:{utilityNetwork:t}}}=this,i=(this.view?.map).utilityNetworks?.items;if(1===i?.length)return null;const s=i?.map((t=>{const i=t.title,s=t.layerUrl,e=t.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:i,value:s,selected:e})}));return r("div",{class:u.labelAndCombobox,key:"utilityNetworkComboboxDiv"},r("calcite-label",{class:u.label},t),r("calcite-combobox",{class:u.combobox,clearDisabled:!0,label:"",maxItems:3,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:t=>{const s=i?.find((i=>i.layerUrl===t.currentTarget.value));this.utilityNetwork=s}},s))}_showAssociationsSwitchChange({currentTarget:t}){const{viewModel:i}=this;this.showAssociationsEnabled=t.checked,this._associationsOptionsEnabled=t.checked,this.showAssociationsEnabled||i.removeAssociations()}_structuralAttAssociationsSwitchChange(t){this.includeStructuralAttachmentAssociations=t.currentTarget.checked}_renderWarningIcon(t,i,s){return s?r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s))):r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}))}};t([o()],w.prototype,"autoRefreshAssociations",null),t([o()],w.prototype,"connectivityAssociationsLineSymbol",null),t([o()],w.prototype,"icon",null),t([o()],w.prototype,"includeConnectivityAssociations",null),t([o()],w.prototype,"includeStructuralAttachmentAssociations",null),t([o()],w.prototype,"label",null),t([o()],w.prototype,"maxAllowableAssociations",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMax",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMin",null),t([o()],w.prototype,"maxAllowableAssociationsSliderStep",null),t([o(),c("geoscene/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),t([o(),c("geoscene/t9n/common")],w.prototype,"messagesCommon",void 0),t([o()],w.prototype,"showArrowsConnectivity",null),t([o()],w.prototype,"showArrowsStructuralAttachment",null),t([o()],w.prototype,"showAssociationsEnabled",null),t([o()],w.prototype,"structuralAttachmentAssociationsLineSymbol",null),t([o()],w.prototype,"utilityNetwork",null),t([o()],w.prototype,"view",null),t([o({type:h})],w.prototype,"viewModel",void 0),t([o({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=t([n("geoscene.widgets.UtilityNetworkAssociations")],w);const b=w;export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{watch as i}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as r}from"../../intl/messages.js";import{isFeatureLayer as l,isSubtypeSublayer as a}from"../../layers/support/layerUtils.js";import"../../popup/content/AttachmentsContent.js";import"../../popup/content/Content.js";import"../../popup/content/CustomContent.js";import"../../popup/content/ExpressionContent.js";import"../../popup/content/FieldsContent.js";import"../../popup/content/MediaContent.js";import"../../popup/content/RelationshipContent.js";import"../../popup/content/TextContent.js";import c from"../../popup/content/UtilityNetworkAssociationsContent.js";import{substituteActionImage as d,getActionStyles as p}from"../../support/actions/actionUtils.js";import u from"../Feature.js";import h from"../Spinner.js";import m from"../Widget.js";import{css as g}from"../Feature/resources.js";import{FeatureContentMixin as w}from"../Feature/support/FeatureContentMixin.js";import{css as v}from"../Features/css.js";import _ from"../Features/FeaturesViewModel.js";import{ActionsCollection as f}from"../Popup/actions.js";import{zoomToLocation as y}from"../Popup/actionUtils.js";import{loadCalciteComponents as M}from"../support/componentsUtils.js";import{globalCss as F}from"../support/globalCss.js";import{Heading as A}from"../support/Heading.js";import"../support/widgetUtils.js";import{messageBundle as b}from"../support/decorators/messageBundle.js";import{vmEvent as I}from"../support/decorators/vmEvent.js";import{tsx as k}from"../support/jsxFactory.js";import C from"./UtilityNetworkTraceFeaturesDrillIn.js";import{substitute as T}from"../../intl/substitute.js";const j="selected-index",W=0,N="features-spinner",x="geoscene-utility-network-trace",S={blockContainer:`${x}__block-container`,blockContent:`${x}__block-content`,featureContent:`${x}__feature-content`,paddingBottom:`${x}__pad-bottom`,paddingTop:`${x}__pad-top`};let L=class extends(w(m)){constructor(e,s){super(e,s),this._actionBarMenuNode=null,this._drillInFlowItems=new t,this._drillInWidget=new C({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new f,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new _,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?k("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),k("calcite-notice",{icon:"information",kind:"info",open:!this.feature},k("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},k("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},k("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=o((()=>this._displaySpinner()),W),this.addHandles([this._displaySpinnerThrottled,i((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),i((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),i((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),i((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),i((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),i((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),i((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),i((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),i((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>{this.emit("close")})),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e))),this._drillInWidget.on("add-nso-trace-location",(({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e})))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await r("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return M({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some((e=>e instanceof c)))}get hasPopupInfo(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=n):this._feature=new u({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:n}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(j),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return k("div",{bind:this,class:this.classes(v.base,F.widget,F.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?k("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},k("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?k("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return k("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,n=o||"";return k("calcite-flow-item",{bind:this,class:this.classes({[v.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n?k(A,{class:this.classes(v.featuresHeading,F.heading),innerHTML:n,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),k("div",{class:"add-nso"===this.mode?this.classes(v.container,v.contentContainer):this.classes(v.container,v.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=d({action:e,feature:this.selectedFeature}),s={[v.icon]:!!t,[v.actionImage]:!!o};return t&&(s[t]=!0),o||t?k("span",{"aria-hidden":"true",class:this.classes(v.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?k("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new h({view:e}),e.ui.add(this._spinner,{key:N,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,N),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?T(r,{messages:t}):"remove-selected-feature"===s?T(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?T(r,{messages:t}):e.title;return l&&n?T(l,n):l??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([s()],L.prototype,"_drillInFlowItems",void 0),e([s()],L.prototype,"_hideActionText",null),e([s({readOnly:!0})],L.prototype,"active",null),e([s()],L.prototype,"content",null),e([s()],L.prototype,"feature",null),e([s()],L.prototype,"featureNavigationTop",void 0),e([s()],L.prototype,"goToOverride",null),e([s()],L.prototype,"hasAssociationsPopupElement",null),e([s()],L.prototype,"hasPopupInfo",null),e([s({type:f})],L.prototype,"headerActions",void 0),e([s()],L.prototype,"headingLevel",void 0),e([s()],L.prototype,"location",null),e([s(),b("geoscene/widgets/Features/t9n/Features")],L.prototype,"messages",void 0),e([s(),b("geoscene/t9n/common")],L.prototype,"messagesCommon",void 0),e([s()],L.prototype,"mode",null),e([s()],L.prototype,"promises",null),e([s()],L.prototype,"responsiveActionsEnabled",void 0),e([s({readOnly:!0})],L.prototype,"selectedFeature",null),e([s({readOnly:!0})],L.prototype,"selectedDrillInFeature",null),e([s({readOnly:!0})],L.prototype,"selectedFeatureWidget",null),e([s()],L.prototype,"timeZone",null),e([s()],L.prototype,"view",null),e([s({type:_}),I(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0),L=e([n("geoscene.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],L);const U=L;export{U as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{watch as i}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as r}from"../../intl/messages.js";import{isFeatureLayer as l,isSubtypeSublayer as a}from"../../layers/support/layerUtils.js";import"../../popup/content/AttachmentsContent.js";import"../../popup/content/Content.js";import"../../popup/content/CustomContent.js";import"../../popup/content/ExpressionContent.js";import"../../popup/content/FieldsContent.js";import"../../popup/content/MediaContent.js";import"../../popup/content/RelationshipContent.js";import"../../popup/content/TextContent.js";import c from"../../popup/content/UtilityNetworkAssociationsContent.js";import{substituteActionImage as d,getActionStyles as p}from"../../support/actions/actionUtils.js";import u from"../Feature.js";import h from"../Spinner.js";import m from"../Widget.js";import{css as g}from"../Feature/resources.js";import{FeatureContentMixin as w}from"../Feature/support/FeatureContentMixin.js";import{css as v}from"../Features/css.js";import _ from"../Features/FeaturesViewModel.js";import{ActionsCollection as f}from"../Popup/actions.js";import{zoomToLocation as y}from"../Popup/actionUtils.js";import{loadCalciteComponents as M}from"../support/componentsUtils.js";import{globalCss as F}from"../support/globalCss.js";import{Heading as A}from"../support/Heading.js";import"../support/widgetUtils.js";import{messageBundle as b}from"../support/decorators/messageBundle.js";import{vmEvent as I}from"../support/decorators/vmEvent.js";import{tsx as k}from"../support/jsxFactory.js";import C from"./UtilityNetworkTraceFeaturesDrillIn.js";import{substitute as T}from"../../intl/substitute.js";const j="selected-index",W=0,N="features-spinner",x="geoscene-utility-network-trace",S={blockContainer:`${x}__block-container`,blockContent:`${x}__block-content`,featureContent:`${x}__feature-content`,paddingBottom:`${x}__pad-bottom`,paddingTop:`${x}__pad-top`};let L=class extends(w(m)){constructor(e,s){super(e,s),this._actionBarMenuNode=null,this._drillInFlowItems=new t,this._drillInWidget=new C({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new f,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new _,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?k("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),k("calcite-notice",{icon:"information",kind:"info",open:!this.feature},k("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},k("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},k("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=o((()=>this._displaySpinner()),W),this.addHandles([this._displaySpinnerThrottled,i((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),i((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),i((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),i((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),i((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),i((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),i((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),i((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),i((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>{this.emit("close")})),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e))),this._drillInWidget.on("add-nso-trace-location",(({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e})))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await r("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return M({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@geoscene/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@geoscene/calcite-components/dist/components/calcite-action-group"),block:()=>import("@geoscene/calcite-components/dist/components/calcite-block"),flow:()=>import("@geoscene/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@geoscene/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@geoscene/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some((e=>e instanceof c)))}get hasPopupInfo(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=n):this._feature=new u({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:n}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(j),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return k("div",{bind:this,class:this.classes(v.base,F.widget,F.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?k("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},k("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?k("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return k("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,n=o||"";return k("calcite-flow-item",{bind:this,class:this.classes({[v.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n?k(A,{class:this.classes(v.featuresHeading,F.heading),innerHTML:n,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),k("div",{class:"add-nso"===this.mode?this.classes(v.container,v.contentContainer):this.classes(v.container,v.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=d({action:e,feature:this.selectedFeature}),s={[v.icon]:!!t,[v.actionImage]:!!o};return t&&(s[t]=!0),o||t?k("span",{"aria-hidden":"true",class:this.classes(v.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?k("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new h({view:e}),e.ui.add(this._spinner,{key:N,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,N),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?T(r,{messages:t}):"remove-selected-feature"===s?T(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?T(r,{messages:t}):e.title;return l&&n?T(l,n):l??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([s()],L.prototype,"_drillInFlowItems",void 0),e([s()],L.prototype,"_hideActionText",null),e([s({readOnly:!0})],L.prototype,"active",null),e([s()],L.prototype,"content",null),e([s()],L.prototype,"feature",null),e([s()],L.prototype,"featureNavigationTop",void 0),e([s()],L.prototype,"goToOverride",null),e([s()],L.prototype,"hasAssociationsPopupElement",null),e([s()],L.prototype,"hasPopupInfo",null),e([s({type:f})],L.prototype,"headerActions",void 0),e([s()],L.prototype,"headingLevel",void 0),e([s()],L.prototype,"location",null),e([s(),b("geoscene/widgets/Features/t9n/Features")],L.prototype,"messages",void 0),e([s(),b("geoscene/t9n/common")],L.prototype,"messagesCommon",void 0),e([s()],L.prototype,"mode",null),e([s()],L.prototype,"promises",null),e([s()],L.prototype,"responsiveActionsEnabled",void 0),e([s({readOnly:!0})],L.prototype,"selectedFeature",null),e([s({readOnly:!0})],L.prototype,"selectedDrillInFeature",null),e([s({readOnly:!0})],L.prototype,"selectedFeatureWidget",null),e([s()],L.prototype,"timeZone",null),e([s()],L.prototype,"view",null),e([s({type:_}),I(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0),L=e([n("geoscene.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],L);const U=L;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as o}from"../../intl/messages.js";import s from"../Widget.js";import{css as a}from"../Features/css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as c}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as d}from"../support/jsxFactory.js";import{substitute as p}from"../../intl/substitute.js";const m=r.clone(),u={featureContent:`${"geoscene-utility-network-trace"}__feature-content`};let h=class extends s{constructor(e,t){super(e,t),this._utilityNetworkTraceMessages=null,this.closed=!1,this.closable=!0,this.messages=null,this.messagesCommon=null,this._handleAddNonspatialTraceLocation=e=>{this.emit("add-nso-trace-location",{featureWidget:e})},this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}initialize(){(async()=>{this._utilityNetworkTraceMessages=await o("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})()}loadDependencies(){return n({action:()=>import("@
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as o}from"../../intl/messages.js";import s from"../Widget.js";import{css as a}from"../Features/css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as c}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as d}from"../support/jsxFactory.js";import{substitute as p}from"../../intl/substitute.js";const m=r.clone(),u={featureContent:`${"geoscene-utility-network-trace"}__feature-content`};let h=class extends s{constructor(e,t){super(e,t),this._utilityNetworkTraceMessages=null,this.closed=!1,this.closable=!0,this.messages=null,this.messagesCommon=null,this._handleAddNonspatialTraceLocation=e=>{this.emit("add-nso-trace-location",{featureWidget:e})},this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}initialize(){(async()=>{this._utilityNetworkTraceMessages=await o("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})()}loadDependencies(){return n({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@geoscene/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@geoscene/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@geoscene/calcite-components/dist/components/calcite-flow-item")})}get mode(){return this._get("mode")||"show-feature-info"}set mode(e){this._set("mode",e)}render(){const{flowItems:e}=this,t=e?.toArray();return l(d,null,t?.map(((t,i)=>this._renderFlowItem(t,i===e.length-1))))}_renderAddNonspatialTraceLocationAction(e){const{_utilityNetworkTraceMessages:t}=this;return l("calcite-action",{appearance:"solid",bind:this,icon:"utility-network-trace",onclick:()=>this._handleAddNonspatialTraceLocation(e),scale:"s",text:t.inputsStrings.addNonspatialOption,textEnabled:!0,title:t.inputsStrings.addNonspatialOption})}_renderFlowItem(e,t){const{messages:i,closable:o,closed:s}=this,r="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,c=this._getExitMessage(e),d=i.selectFeature,p=e,m=p?p.graphic?.sourceLayer:null,h=!(m?m.geometryType:null);return l("calcite-flow-item",{bind:this,closable:o,closed:s,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()}},l("calcite-action",{appearance:"transparent",bind:this,class:a.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:c,title:c}),r?l("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,"show-feature-info"===this.mode?l("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n&&"add-nso"===this.mode?l("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},l("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},h?this._renderAddNonspatialTraceLocationAction(e):this._renderZoomToFeatureAction(e))):null,l("div",{class:this.classes(a.container,u.featureContent)},e.render()))}_renderZoomToFeatureAction(e){const t=this._getActionTitle(m);return l("calcite-action",{active:m.active,appearance:"solid",bind:this,"data-action-uid":m.uid,disabled:m.disabled,icon:m.icon??"question",indicator:m.indicator,key:`action-${m.uid}`,loading:m.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return"zoom-to-feature"===i?p(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_handleExitClick(){this.emit("exit")}};e([t()],h.prototype,"closed",void 0),e([t()],h.prototype,"closable",void 0),e([t()],h.prototype,"flowItems",void 0),e([t(),c("geoscene/widgets/Features/t9n/Features")],h.prototype,"messages",void 0),e([t(),c("geoscene/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",null),h=e([i("geoscene.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeaturesDrillIn")],h);const f=h;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as i,on as r,initial as o,when as a}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../core/support/UpdatingHandles.js";import d from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as u}from"../layers/support/layerUtils.js";import h from"../rest/support/Query.js";import p from"./Widget.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{storeNode as _}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as v}from"./support/jsxFactory.js";import y from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import f from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as S}from"./UtilityNetworkTrace/support/GraphicHandler.js";const T="geoscene-utility-network-trace",k={base:T,addButtonContainer:`${T}__add-button-container`,blockContainer:`${T}__block-container`,blockContent:`${T}__block-content`,clearPrompt:`${T}__reset-prompt`,doublePaddingTop:`${T}__double-pad-top`,flow:`${T}__flow`,listContainer:`${T}__list-container`,noticeContainer:`${T}__notice-container`,numberInput:`${T}__number-input`,promptDivider:`${T}__divider`};function F(e){return{height:e+"px"}}function C(e){return{width:e+"px"}}function A(){return{width:"75%"}}function R(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function N(e){return{display:"flex",flexDirection:e}}function M(e){return e instanceof d}const x={noExtension:-2147208474};let I=class extends p{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new y({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new y({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new c,this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new f,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._utilityNetworkTraceInitialized(),this.addHandles([i((()=>this.view),(()=>this._viewChangeHandle()),o),i((()=>this.viewModel?.resultAreaProperties),(()=>this.scheduleRender())),i((()=>this._addNonspatialObjectActive),(e=>{this._findNonspatialFeatureWidget.feature=null,e?this._changeCursor("crosshair"):this.view.popupEnabled=this._wasPopupEnabled})),i((()=>this._showFeatureInfoActive),(e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)})),r((()=>this._findNonspatialFeatureWidget),"add-nso-trace-location",(({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1})),r((()=>this._findNonspatialFeatureWidget),"close-un-trace-feature-block",(()=>{this._changeCursor("default"),this._addNonspatialObjectActive=!1,this.viewModel.cancelAddFlagByHit()})),r((()=>this._resultFeatureWidget),"close-un-trace-feature-block",(()=>{this._showFeatureInfoActive=!1})),r((()=>this._resultFeatureWidget),"close",(()=>{this._resetResultFeatureWidget()}))])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get gdbVersion(){return t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion}set gdbVersion(e){t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach((e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}}))}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),v("div",{class:this.classes(k.base,m.widget,m.panel,{[m.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@esri/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@esri/calcite-components/dist/components/calcite-flow"),flow:()=>import("@esri/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@esri/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@esri/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@esri/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@esri/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@esri/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return v("calcite-block",{expanded:!0,key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return v("calcite-block",{class:k.blockContent,expanded:!0,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier},v("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),v("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},v("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return v("calcite-scrim",{key:"prompt"},v("div",{class:k.clearPrompt},v("h3",{slot:"header"},e.resultsStrings.startOverButton),v("div",{slot:"content"},e.resultsStrings.startOverValidation),v("div",{class:k.promptDivider}),v("div",{styles:N("row")},v("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),v("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return v("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs},v("calcite-flow",{class:k.flow},v("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?v("div",{styles:F(10)}):null,v("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),v("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?v("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"barrier"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))}));let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",overlayPositioning:"fixed"},v("div",{slot:"icon"},i||v("calcite-icon",{icon:"x-circle-f",scale:"s"})),v("div",null,e.inputsStrings.barrierPointHint),v("div",{class:k.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,this._warningNoBarrierAssetNsoFound?this._renderWarningMessage("noBarrierAssetNso",!0):null,v("div",{class:k.addButtonContainer},v("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},v("calcite-dropdown-group",{selectionMode:"none"},v("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach((t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(v("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))}))),v("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},v("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?v("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?v("calcite-label",{layout:"inline",scale:"s"},v("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?v("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach((t=>{this.viewModel.addTerminal(t.value,e)}))):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],a=new RegExp(`^${e.hex}$`,"i"),l=r.highlightColor.length>S.length?5:4;for(const n of r.highlightColor)o.push(v("calcite-action",{active:a.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},v("calcite-color-picker-swatch",{active:a.test(n.hex),color:n.hex,scale:"s"})));return v("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},v("calcite-action-group",{columns:l},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return v("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),v("calcite-tab",{key:`${this.id}__results-tab-item`},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults},v("calcite-flow",{class:k.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return v("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return v("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return v("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then((s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")})))}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find((({name:e})=>e===this._resultDisplayField)),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&M(i.domain)){const t=i.domain.codedValues.find((({code:t})=>t===e.details.attributes[this._resultDisplayField]));s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,v("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=u(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.subtypeField.toLowerCase()))??"assetgroup",i=t.sublayers.find((t=>t.subtypeCode===e.details.attributes[s])),r=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.objectIdField.toLowerCase()))??"objectid",o=new h;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const a=await(i?.queryFeatures(o));a&&this._resultFeatureWidget.open(a.features[0])}else this._resultFeatureWidget.open(e.details)}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"starting-point"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))}));let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",overlayPositioning:"fixed"},v("div",{slot:"icon"},i||v("calcite-icon",{icon:"pin",scale:"s"})),v("div",null,e.inputsStrings.startingPointHint),v("div",{class:k.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,this._warningNoStartAssetNsoFound?this._renderWarningMessage("noStartAssetNso",!0):null,v("div",{class:k.addButtonContainer},v("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},v("calcite-dropdown-group",{selectionMode:"none"},v("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return v("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return v("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},v("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return v("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},v("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach((e=>{s.push(this._renderResultRowFunctions(e))})),v("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some((({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase()))??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach((e=>{e?.details&&s.push(this._renderResultRowIndividual(e))})),0===s.length&&s.push(v("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return v("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},v("calcite-action",{afterCreate:_,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),v("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach((({name:e,alias:t})=>{s.push(v("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(v("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))})):(s.push(v("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(v("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),v("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?C(.75*this.domNode.clientWidth):A()},v("calcite-block",{expanded:!0,label:e.resultsStrings.displayAttribute,overlayPositioning:"fixed"},v("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,v("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),v("calcite-label",{scale:"s"},e.resultsStrings.sortBy,v("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach(((t,i)=>{let o=[],a=[],l=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(a=t.results.globalFunctionResults,a.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(l=!0)),(n||l)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(v("calcite-block",{class:k.blockContent,collapsible:!0,description:t.trace.description??"",expanded:!0,heading:t.trace.title,key:`${t.trace.title}${i}`,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),v("calcite-list",{label:""},c?v("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+a.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(a,"functions")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,l&&this.viewModel.showSelectionAttributes?v("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?v("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),l?v("div",{class:k.doublePaddingTop},v("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},v("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?v("calcite-block-section",{expanded:t.graphicEnabled,key:`aggregate-${t.trace.title}-${i}`,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},v("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},v("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||l)?v("calcite-block-section",{expanded:t.resultArea?.show,key:`area-${t.trace.title}-${i}`,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},v("calcite-list",{label:"",selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},v("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),v("calcite-list",{label:"",selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},v("calcite-input-number",{afterCreate:this._afterComponentCreate,class:k.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,v("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(v("calcite-block",{collapsible:!1,expanded:!0,heading:t.trace.title,key:"error-"+i,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))})),v("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?v("calcite-scrim",{key:"prompt"},v("div",{class:k.clearPrompt},v("h3",{slot:"header"},e.globalStrings.clearResults),v("div",{slot:"content"},e.alertsStrings.clearResultsAlert),v("div",{class:k.promptDivider}),v("div",{styles:N("row")},v("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),v("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map((e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1}))),s=this.viewModel.traces.filter((e=>e.selected)),i=e.tracingStrings.traceOperation+` (${s.length})`;return v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:i,overlayPositioning:"fixed"},v("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),v("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach((t=>{t.selected=e.currentTarget.selectedItems.some((e=>e.value===t.globalId))})),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=v("calcite-tabs",{layout:"center",position:"top",styles:R(this.container)},v("calcite-tab-nav",{slot:"title-group"},v("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),v("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=v("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=v("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noBarrierAssetNso":case"noStartAssetNso":r="",o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return v("div",{class:k.noticeContainer,key:e},v("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>this._handleWarningNoticeClose(e)},v("div",{slot:"title"},r),v("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach((e=>{t.forEach((t=>{t.featureSet.features.forEach((r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))}))}))})),i}_changeCursor(e="default"){const t=this.view?.container?.style;t&&(t.cursor=e)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,a=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(a)&&(a=a.toLowerCase()),"desc"===t?o>a?r=1:o<a&&(r=-1):o<a?r=1:o>a&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const e=i.assetGroups.find((e=>e.assetGroupCode===s));e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const r=i.assetGroups.find((e=>e.assetGroupCode===s));if(r){const s=r.assetTypes.find((t=>t.assetTypeCode===e.assetTypeCode));s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?v("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce(((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e)),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_handleWarningNoticeClose(e){switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noStartAssetNso":this._warningNoStartAssetNsoFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1;break;case"noBarrierAssetNso":this._warningNoBarrierAssetNsoFound=!1}}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach((t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)}))}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach((e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)}))}_processFlagOnLoad(){return this.view?.when().then((()=>{this._watchHandler=a((()=>!this.view?.updating),(async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()}))}))}_registerWatchers(){this.addHandles([i((()=>this.selectedTraces),(()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()})),i((()=>this.defaultGraphicColor),(()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach((e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)})),this.scheduleRender()}))])}_renderComboboxItem({text:e,value:t,selected:s}){return v("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_resetTraceLocationWarnings(){this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0,this._resetTraceLocationWarnings(),this.viewModel.getNonspatialTraceLocationInitialFeature().then((e=>{this._findNonspatialFeatureWidget.feature=null;const t=e.graphic;this._findNonspatialFeatureWidget.open(t)})).catch((()=>{this._warningNoStartAssetNsoFound="starting-point"===e,this._warningNoBarrierAssetNsoFound="barrier"===e,this._addNonspatialObjectActive=!1})).finally((()=>this._changeCursor("default")))}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._resetTraceLocationWarnings(),this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then((e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1}))}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then((e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&this._processFlagOnLoad()),this.disabled=!1})).catch((e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw?.extendedCode===x.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1}))}_viewChangeHandle(){this._wasPopupEnabled=this.view?.popupEnabled??!1,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view}};e([l()],I.prototype,"_activeTab",void 0),e([l()],I.prototype,"_activeTrace",void 0),e([l()],I.prototype,"_activeSwatch",void 0),e([l()],I.prototype,"_addNonspatialObjectActive",void 0),e([l()],I.prototype,"_alertRemoveModal",void 0),e([l()],I.prototype,"_assetGroupHeader",void 0),e([l()],I.prototype,"_assetTypeHeader",void 0),e([l()],I.prototype,"_confirmReset",void 0),e([l()],I.prototype,"_errorMessage",void 0),e([l()],I.prototype,"_swatchNode",void 0),e([l()],I.prototype,"_selectToolActive",void 0),e([l()],I.prototype,"_showFeatureInfoActive",void 0),e([l()],I.prototype,"_traceHeaderForFlow",void 0),e([l()],I.prototype,"_traceResultsFunctions",void 0),e([l()],I.prototype,"_traceResultsAssetGroup",void 0),e([l()],I.prototype,"_traceResultsAssetType",void 0),e([l()],I.prototype,"_traceResultsIndividual",void 0),e([l()],I.prototype,"_traceResultsState",void 0),e([l()],I.prototype,"_warningNoFlag",void 0),e([l()],I.prototype,"_warningNoTraceSelected",void 0),e([l()],I.prototype,"_updatingHandles",void 0),e([l()],I.prototype,"defaultGraphicColor",null),e([l()],I.prototype,"disabled",void 0),e([l()],I.prototype,"enableResultArea",null),e([l()],I.prototype,"flags",null),e([l()],I.prototype,"gdbVersion",null),e([l()],I.prototype,"icon",null),e([l()],I.prototype,"inputSettings",void 0),e([l()],I.prototype,"label",null),e([l(),b("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],I.prototype,"messages",void 0),e([l(),b("geoscene/t9n/common")],I.prototype,"messagesCommon",void 0),e([l(),b("geoscene/core/t9n/Units")],I.prototype,"messagesUnits",void 0),e([l()],I.prototype,"resultAreaProperties",null),e([l()],I.prototype,"selectedTraces",null),e([l()],I.prototype,"selectOnComplete",null),e([l()],I.prototype,"showGraphicsOnComplete",null),e([l()],I.prototype,"showSelectionAttributes",null),e([l()],I.prototype,"utilityNetwork",null),e([l()],I.prototype,"view",null),e([w(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),l({type:f})],I.prototype,"viewModel",void 0),I=e([n("geoscene.widgets.UtilityNetworkTrace")],I);const B=I;export{B as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as i,on as r,initial as o,when as a}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../core/support/UpdatingHandles.js";import d from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as u}from"../layers/support/layerUtils.js";import h from"../rest/support/Query.js";import p from"./Widget.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{storeNode as _}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as v}from"./support/jsxFactory.js";import y from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import f from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as S}from"./UtilityNetworkTrace/support/GraphicHandler.js";const T="geoscene-utility-network-trace",k={base:T,addButtonContainer:`${T}__add-button-container`,blockContainer:`${T}__block-container`,blockContent:`${T}__block-content`,clearPrompt:`${T}__reset-prompt`,doublePaddingTop:`${T}__double-pad-top`,flow:`${T}__flow`,listContainer:`${T}__list-container`,noticeContainer:`${T}__notice-container`,numberInput:`${T}__number-input`,promptDivider:`${T}__divider`};function F(e){return{height:e+"px"}}function C(e){return{width:e+"px"}}function A(){return{width:"75%"}}function R(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function N(e){return{display:"flex",flexDirection:e}}function M(e){return e instanceof d}const x={noExtension:-2147208474};let I=class extends p{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new y({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new y({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new c,this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new f,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._utilityNetworkTraceInitialized(),this.addHandles([i((()=>this.view),(()=>this._viewChangeHandle()),o),i((()=>this.viewModel?.resultAreaProperties),(()=>this.scheduleRender())),i((()=>this._addNonspatialObjectActive),(e=>{this._findNonspatialFeatureWidget.feature=null,e?this._changeCursor("crosshair"):this.view.popupEnabled=this._wasPopupEnabled})),i((()=>this._showFeatureInfoActive),(e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)})),r((()=>this._findNonspatialFeatureWidget),"add-nso-trace-location",(({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1})),r((()=>this._findNonspatialFeatureWidget),"close-un-trace-feature-block",(()=>{this._changeCursor("default"),this._addNonspatialObjectActive=!1,this.viewModel.cancelAddFlagByHit()})),r((()=>this._resultFeatureWidget),"close-un-trace-feature-block",(()=>{this._showFeatureInfoActive=!1})),r((()=>this._resultFeatureWidget),"close",(()=>{this._resetResultFeatureWidget()}))])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get gdbVersion(){return t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion}set gdbVersion(e){t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach((e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}}))}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),v("div",{class:this.classes(k.base,m.widget,m.panel,{[m.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return g({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@geoscene/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@geoscene/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@geoscene/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@geoscene/calcite-components/dist/components/calcite-block-section"),button:()=>import("@geoscene/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@geoscene/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@geoscene/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@geoscene/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@geoscene/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@geoscene/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@geoscene/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@geoscene/calcite-components/dist/components/calcite-flow"),flow:()=>import("@geoscene/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@geoscene/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@geoscene/calcite-components/dist/components/calcite-input-number"),label:()=>import("@geoscene/calcite-components/dist/components/calcite-label"),list:()=>import("@geoscene/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@geoscene/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@geoscene/calcite-components/dist/components/calcite-loader"),notice:()=>import("@geoscene/calcite-components/dist/components/calcite-notice"),option:()=>import("@geoscene/calcite-components/dist/components/calcite-option"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel"),popover:()=>import("@geoscene/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@geoscene/calcite-components/dist/components/calcite-scrim"),select:()=>import("@geoscene/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@geoscene/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@geoscene/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@geoscene/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@geoscene/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@geoscene/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return v("calcite-block",{expanded:!0,key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return v("calcite-block",{class:k.blockContent,expanded:!0,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier},v("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),v("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},v("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return v("calcite-scrim",{key:"prompt"},v("div",{class:k.clearPrompt},v("h3",{slot:"header"},e.resultsStrings.startOverButton),v("div",{slot:"content"},e.resultsStrings.startOverValidation),v("div",{class:k.promptDivider}),v("div",{styles:N("row")},v("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),v("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return v("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs},v("calcite-flow",{class:k.flow},v("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?v("div",{styles:F(10)}):null,v("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),v("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?v("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"barrier"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))}));let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",overlayPositioning:"fixed"},v("div",{slot:"icon"},i||v("calcite-icon",{icon:"x-circle-f",scale:"s"})),v("div",null,e.inputsStrings.barrierPointHint),v("div",{class:k.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,this._warningNoBarrierAssetNsoFound?this._renderWarningMessage("noBarrierAssetNso",!0):null,v("div",{class:k.addButtonContainer},v("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},v("calcite-dropdown-group",{selectionMode:"none"},v("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach((t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(v("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))}))),v("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},v("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?v("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?v("calcite-label",{layout:"inline",scale:"s"},v("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?v("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach((t=>{this.viewModel.addTerminal(t.value,e)}))):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],a=new RegExp(`^${e.hex}$`,"i"),l=r.highlightColor.length>S.length?5:4;for(const n of r.highlightColor)o.push(v("calcite-action",{active:a.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},v("calcite-color-picker-swatch",{active:a.test(n.hex),color:n.hex,scale:"s"})));return v("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},v("calcite-action-group",{columns:l},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return v("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),v("calcite-tab",{key:`${this.id}__results-tab-item`},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults},v("calcite-flow",{class:k.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return v("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return v("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return v("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then((s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")})))}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find((({name:e})=>e===this._resultDisplayField)),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&M(i.domain)){const t=i.domain.codedValues.find((({code:t})=>t===e.details.attributes[this._resultDisplayField]));s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,v("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=u(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.subtypeField.toLowerCase()))??"assetgroup",i=t.sublayers.find((t=>t.subtypeCode===e.details.attributes[s])),r=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.objectIdField.toLowerCase()))??"objectid",o=new h;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const a=await(i?.queryFeatures(o));a&&this._resultFeatureWidget.open(a.features[0])}else this._resultFeatureWidget.open(e.details)}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return v("calcite-block",{class:k.blockContainer,expanded:!0,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"starting-point"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))}));let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",overlayPositioning:"fixed"},v("div",{slot:"icon"},i||v("calcite-icon",{icon:"pin",scale:"s"})),v("div",null,e.inputsStrings.startingPointHint),v("div",{class:k.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,this._warningNoStartAssetNsoFound?this._renderWarningMessage("noStartAssetNso",!0):null,v("div",{class:k.addButtonContainer},v("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},v("calcite-dropdown-group",{selectionMode:"none"},v("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return v("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return v("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},v("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return v("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},v("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach((e=>{s.push(this._renderResultRowFunctions(e))})),v("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some((({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase()))??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach((e=>{e?.details&&s.push(this._renderResultRowIndividual(e))})),0===s.length&&s.push(v("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return v("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},v("calcite-action",{afterCreate:_,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),v("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach((({name:e,alias:t})=>{s.push(v("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(v("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))})):(s.push(v("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(v("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),v("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?C(.75*this.domNode.clientWidth):A()},v("calcite-block",{expanded:!0,label:e.resultsStrings.displayAttribute,overlayPositioning:"fixed"},v("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,v("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),v("calcite-label",{scale:"s"},e.resultsStrings.sortBy,v("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach(((t,i)=>{let o=[],a=[],l=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(a=t.results.globalFunctionResults,a.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(l=!0)),(n||l)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(v("calcite-block",{class:k.blockContent,collapsible:!0,description:t.trace.description??"",expanded:!0,heading:t.trace.title,key:`${t.trace.title}${i}`,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),v("calcite-list",{label:""},c?v("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+a.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(a,"functions")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,l&&this.viewModel.showSelectionAttributes?v("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},v("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?v("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),l?v("div",{class:k.doublePaddingTop},v("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},v("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?v("calcite-block-section",{expanded:t.graphicEnabled,key:`aggregate-${t.trace.title}-${i}`,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},v("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},v("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||l)?v("calcite-block-section",{expanded:t.resultArea?.show,key:`area-${t.trace.title}-${i}`,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},v("calcite-list",{label:"",selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},v("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),v("calcite-list",{label:"",selectionMode:"none"},v("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},v("calcite-input-number",{afterCreate:this._afterComponentCreate,class:k.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,v("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(v("calcite-block",{collapsible:!1,expanded:!0,heading:t.trace.title,key:"error-"+i,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))})),v("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?v("calcite-scrim",{key:"prompt"},v("div",{class:k.clearPrompt},v("h3",{slot:"header"},e.globalStrings.clearResults),v("div",{slot:"content"},e.alertsStrings.clearResultsAlert),v("div",{class:k.promptDivider}),v("div",{styles:N("row")},v("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),v("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map((e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1}))),s=this.viewModel.traces.filter((e=>e.selected)),i=e.tracingStrings.traceOperation+` (${s.length})`;return v("calcite-block",{class:k.blockContent,collapsible:!0,expanded:!0,heading:i,overlayPositioning:"fixed"},v("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),v("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach((t=>{t.selected=e.currentTarget.selectedItems.some((e=>e.value===t.globalId))})),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=v("calcite-tabs",{layout:"center",position:"top",styles:R(this.container)},v("calcite-tab-nav",{slot:"title-group"},v("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),v("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=v("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=v("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noBarrierAssetNso":case"noStartAssetNso":r="",o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return v("div",{class:k.noticeContainer,key:e},v("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>this._handleWarningNoticeClose(e)},v("div",{slot:"title"},r),v("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach((e=>{t.forEach((t=>{t.featureSet.features.forEach((r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))}))}))})),i}_changeCursor(e="default"){const t=this.view?.container?.style;t&&(t.cursor=e)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,a=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(a)&&(a=a.toLowerCase()),"desc"===t?o>a?r=1:o<a&&(r=-1):o<a?r=1:o>a&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const e=i.assetGroups.find((e=>e.assetGroupCode===s));e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const r=i.assetGroups.find((e=>e.assetGroupCode===s));if(r){const s=r.assetTypes.find((t=>t.assetTypeCode===e.assetTypeCode));s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?v("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce(((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e)),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_handleWarningNoticeClose(e){switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noStartAssetNso":this._warningNoStartAssetNsoFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1;break;case"noBarrierAssetNso":this._warningNoBarrierAssetNsoFound=!1}}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach((t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)}))}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach((e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)}))}_processFlagOnLoad(){return this.view?.when().then((()=>{this._watchHandler=a((()=>!this.view?.updating),(async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()}))}))}_registerWatchers(){this.addHandles([i((()=>this.selectedTraces),(()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()})),i((()=>this.defaultGraphicColor),(()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach((e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)})),this.scheduleRender()}))])}_renderComboboxItem({text:e,value:t,selected:s}){return v("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_resetTraceLocationWarnings(){this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0,this._resetTraceLocationWarnings(),this.viewModel.getNonspatialTraceLocationInitialFeature().then((e=>{this._findNonspatialFeatureWidget.feature=null;const t=e.graphic;this._findNonspatialFeatureWidget.open(t)})).catch((()=>{this._warningNoStartAssetNsoFound="starting-point"===e,this._warningNoBarrierAssetNsoFound="barrier"===e,this._addNonspatialObjectActive=!1})).finally((()=>this._changeCursor("default")))}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._resetTraceLocationWarnings(),this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then((e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1}))}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then((e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&this._processFlagOnLoad()),this.disabled=!1})).catch((e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw?.extendedCode===x.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1}))}_viewChangeHandle(){this._wasPopupEnabled=this.view?.popupEnabled??!1,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view}};e([l()],I.prototype,"_activeTab",void 0),e([l()],I.prototype,"_activeTrace",void 0),e([l()],I.prototype,"_activeSwatch",void 0),e([l()],I.prototype,"_addNonspatialObjectActive",void 0),e([l()],I.prototype,"_alertRemoveModal",void 0),e([l()],I.prototype,"_assetGroupHeader",void 0),e([l()],I.prototype,"_assetTypeHeader",void 0),e([l()],I.prototype,"_confirmReset",void 0),e([l()],I.prototype,"_errorMessage",void 0),e([l()],I.prototype,"_swatchNode",void 0),e([l()],I.prototype,"_selectToolActive",void 0),e([l()],I.prototype,"_showFeatureInfoActive",void 0),e([l()],I.prototype,"_traceHeaderForFlow",void 0),e([l()],I.prototype,"_traceResultsFunctions",void 0),e([l()],I.prototype,"_traceResultsAssetGroup",void 0),e([l()],I.prototype,"_traceResultsAssetType",void 0),e([l()],I.prototype,"_traceResultsIndividual",void 0),e([l()],I.prototype,"_traceResultsState",void 0),e([l()],I.prototype,"_warningNoFlag",void 0),e([l()],I.prototype,"_warningNoTraceSelected",void 0),e([l()],I.prototype,"_updatingHandles",void 0),e([l()],I.prototype,"defaultGraphicColor",null),e([l()],I.prototype,"disabled",void 0),e([l()],I.prototype,"enableResultArea",null),e([l()],I.prototype,"flags",null),e([l()],I.prototype,"gdbVersion",null),e([l()],I.prototype,"icon",null),e([l()],I.prototype,"inputSettings",void 0),e([l()],I.prototype,"label",null),e([l(),b("geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],I.prototype,"messages",void 0),e([l(),b("geoscene/t9n/common")],I.prototype,"messagesCommon",void 0),e([l(),b("geoscene/core/t9n/Units")],I.prototype,"messagesUnits",void 0),e([l()],I.prototype,"resultAreaProperties",null),e([l()],I.prototype,"selectedTraces",null),e([l()],I.prototype,"selectOnComplete",null),e([l()],I.prototype,"showGraphicsOnComplete",null),e([l()],I.prototype,"showSelectionAttributes",null),e([l()],I.prototype,"utilityNetwork",null),e([l()],I.prototype,"view",null),e([w(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),l({type:f})],I.prototype,"viewModel",void 0),I=e([n("geoscene.widgets.UtilityNetworkTrace")],I);const B=I;export{B as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as n}from"./support/decorators/messageBundle.js";import{tsx as c}from"./support/jsxFactory.js";import r from"./UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js";const a="geoscene-un-validate-topology",l={container:`${a}__container`,content:`${a}__content`,controlsContainer:`${a}__controls-container`,statusIconError:`${a}__status-icon-error`,statusIconSuccess:`${a}__status-icon-success`,statusIconContainer:`${a}__status-icon-container`};let d=class extends i{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new r}loadDependencies(){return s({action:()=>import("@
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as n}from"./support/decorators/messageBundle.js";import{tsx as c}from"./support/jsxFactory.js";import r from"./UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js";const a="geoscene-un-validate-topology",l={container:`${a}__container`,content:`${a}__content`,controlsContainer:`${a}__controls-container`,statusIconError:`${a}__status-icon-error`,statusIconSuccess:`${a}__status-icon-success`,statusIconContainer:`${a}__status-icon-container`};let d=class extends i{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new r}loadDependencies(){return s({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),block:()=>import("@geoscene/calcite-components/dist/components/calcite-block"),icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon"),notice:()=>import("@geoscene/calcite-components/dist/components/calcite-notice"),option:()=>import("@geoscene/calcite-components/dist/components/calcite-option"),select:()=>import("@geoscene/calcite-components/dist/components/calcite-select"),tooltip:()=>import("@geoscene/calcite-components/dist/components/calcite-tooltip")})}get extentToValidate(){return this.viewModel.extentToValidate}set extentToValidate(t){this.viewModel.extentToValidate=t}get icon(){return"check-circle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.label??""}set label(t){this._overrideIfSome("label",t)}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{viewModel:t}=this;return"disabled"===t.state?c("div",{class:l.container},c("calcite-block",{class:l.content,collapsible:!1,expanded:!0,heading:this.label},this._renderLoadErrorStatusIcon(),this._renderLoadErrorsNotices())):c("div",{class:l.container},c("calcite-block",{class:l.content,collapsible:!0,expanded:!1,heading:this.label},this._renderStatusIcon(),this._renderValidateTopologyAction(),this._renderControls()))}_extentOptionSelectChange(t){this.extentToValidate=t.currentTarget.value}_getLoadErrorMessagesAsNotices(t,e){return c("calcite-notice",{closable:!1,key:"error-notice-"+e,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t))}_handleValidateTopologyAction(){this.viewModel.validateTopology().catch((()=>{}))}_renderControls(){const{viewModel:t}=this;return"failed"===t.state?c("div",{class:l.controlsContainer},this._renderExtentOptionSelect(),this._renderStatusNotice()):this._renderExtentOptionSelect()}_renderExtentOptionSelect(){const{messages:t,viewModel:e}=this;return c("div",{key:"selectExtentDiv"},c("calcite-select",{bind:this,disabled:"loading"===e.state||"executing"===e.state,label:t.input.extentToValidate,onCalciteSelectChange:this._extentOptionSelectChange},c("calcite-option",{value:"current"},t.input.currentExtent),c("calcite-option",{value:"entire"},t.input.entireExtent)))}_renderLoadErrorsNotices(){const{viewModel:t}=this;return c("div",{class:l.controlsContainer,key:"loadErrorsDiv"},t.loadErrors.items.map(this._getLoadErrorMessagesAsNotices))}_renderLoadErrorStatusIcon(){return c("div",{class:l.statusIconContainer,key:"statusDiv",slot:"control"},c("calcite-icon",{class:l.statusIconError,icon:"exclamation-mark-triangle",scale:"s"}))}_renderStatusIcon(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-status-action`,i=`${this.id}-error-status-icon`,s=`${this.id}-success-status-icon`,n=t=>{setTimeout((()=>{t.textContent=""}),3500)};return"executing"===e.state?c("div",{key:"statusDivExecuting",slot:"control"},c("calcite-action",{id:o,loading:!0,text:t.status.executing}),c("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:o},c("span",null,t.status.executing))):"success"===e.state?c("div",{afterCreate:n,class:l.statusIconContainer,key:"statusDivSuccess",slot:"control"},c("calcite-icon",{class:l.statusIconSuccess,icon:"check-circle",id:s,scale:"s"}),c("calcite-tooltip",{referenceElement:s},c("span",null,t.status.success))):"failed"===e.state?c("div",{class:l.statusIconContainer,key:"statusDivFailed",slot:"control"},c("calcite-icon",{class:l.statusIconError,icon:"exclamation-mark-triangle",id:i,scale:"s"}),c("calcite-tooltip",{referenceElement:i},c("span",null,e.executionError))):c("div",{class:l.statusIconContainer,key:"statusDiv",slot:"control"})}_renderStatusNotice(){const{viewModel:t}=this;return c("div",{key:"executionErrorDiv"},c("calcite-notice",{closable:!0,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t.executionError)))}_renderValidateTopologyAction(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-action`;return c("div",{key:"actionDiv",slot:"control"},c("calcite-action",{bind:this,disabled:"executing"===e.state,icon:"play-f",id:o,loading:"loading"===e.state,onclick:this._handleValidateTopologyAction,text:t.input.validateTopology}),c("calcite-tooltip",{referenceElement:o},c("span",null,"loading"===e.state?t.status.loading:t.input.validateTopology)))}};t([e()],d.prototype,"extentToValidate",null),t([e()],d.prototype,"icon",null),t([e()],d.prototype,"label",null),t([e(),n("geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology")],d.prototype,"messages",void 0),t([e()],d.prototype,"utilityNetwork",null),t([e()],d.prototype,"view",null),t([e({type:r})],d.prototype,"viewModel",void 0),d=t([o("geoscene.widgets.UtilityNetworkValidateTopology")],d);const p=d;export{p as default};
|