Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
6.0 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("require ../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ../chunks/componentsUtils ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory ./UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel".split(" "),function(f,e,g,d,v,w,n,p,q,x,r,b,k){d=class extends p{constructor(a,c){super(a,c);this.messages=null;this.viewModel=new k}loadDependencies(){return q.loadCalciteComponents({action:()=>
new Promise((a,c)=>f(["../chunks/calcite-action"],a,c)),block:()=>new Promise((a,c)=>f(["../chunks/calcite-block"],a,c)),icon:()=>new Promise((a,c)=>f(["../chunks/calcite-icon"],a,c)),notice:()=>new Promise((a,c)=>f(["../chunks/calcite-notice"],a,c)),option:()=>new Promise((a,c)=>f(["../chunks/calcite-option"],a,c)),select:()=>new Promise((a,c)=>f(["../chunks/calcite-select"],a,c)),tooltip:()=>new Promise((a,c)=>f(["../chunks/calcite-tooltip"],a,c))})}get extentToValidate(){return this.viewModel.extentToValidate}set extentToValidate(a){this.viewModel.extentToValidate=
a}get icon(){return"check-circle"}set icon(a){this._overrideIfSome("icon",a)}get label(){return this.messages?.label??""}set label(a){this._overrideIfSome("label",a)}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(a){this.viewModel.utilityNetwork=a}get view(){return this.viewModel.view}set view(a){this.viewModel.view=a}render(){const {viewModel:a}=this;return"disabled"===a.state?b.tsx("div",{class:"esri-un-validate-topology__container"},b.tsx("calcite-block",{class:"esri-un-validate-topology__content",
collapsible:!1,heading:this.label,open:!0},this._renderLoadErrorStatusIcon(),this._renderLoadErrorsNotices())):b.tsx("div",{class:"esri-un-validate-topology__container"},b.tsx("calcite-block",{class:"esri-un-validate-topology__content",collapsible:!0,heading:this.label,open:!1},this._renderStatusIcon(),this._renderValidateTopologyAction(),this._renderControls()))}_extentOptionSelectChange(a){this.extentToValidate=a.target.value}_getLoadErrorMessagesAsNotices(a,c){return b.tsx("calcite-notice",{closable:!1,
key:"error-notice-"+c,kind:"warning",open:!0,scale:"s"},b.tsx("div",{slot:"message"},a))}_handleValidateTopologyAction(){this.viewModel.validateTopology().catch(()=>{})}_renderControls(){const {viewModel:a}=this;return"failed"===a.state?b.tsx("div",{class:"esri-un-validate-topology__controls-container"},this._renderExtentOptionSelect(),this._renderStatusNotice()):this._renderExtentOptionSelect()}_renderExtentOptionSelect(){const {messages:a,viewModel:c}=this;return b.tsx("div",{key:"selectExtentDiv"},
b.tsx("calcite-select",{bind:this,disabled:"loading"===c.state||"executing"===c.state,label:a.input.extentToValidate,onCalciteSelectChange:this._extentOptionSelectChange},b.tsx("calcite-option",{value:"current"},a.input.currentExtent),b.tsx("calcite-option",{value:"entire"},a.input.entireExtent)))}_renderLoadErrorsNotices(){const {viewModel:a}=this;return b.tsx("div",{class:"esri-un-validate-topology__controls-container",key:"loadErrorsDiv"},a.loadErrors.items.map(this._getLoadErrorMessagesAsNotices))}_renderLoadErrorStatusIcon(){return b.tsx("div",
{class:"esri-un-validate-topology__status-icon-container",key:"statusDiv",slot:"control"},b.tsx("calcite-icon",{class:"esri-un-validate-topology__status-icon-error",icon:"exclamation-mark-triangle",scale:"s"}))}_renderStatusIcon(){const {messages:a,viewModel:c}=this,h=`${this.id}-validation-status-action`,l=`${this.id}-error-status-icon`,m=`${this.id}-success-status-icon`,u=t=>{setTimeout(()=>{t.innerHTML=""},3500)};return"executing"===c.state?b.tsx("div",{key:"statusDivExecuting",slot:"control"},
b.tsx("calcite-action",{id:h,loading:!0,text:a.status.executing}),b.tsx("calcite-tooltip",{referenceElement:h},b.tsx("span",null,a.status.executing))):"success"===c.state?b.tsx("div",{afterCreate:u,class:"esri-un-validate-topology__status-icon-container",key:"statusDivSuccess",slot:"control"},b.tsx("calcite-icon",{class:"esri-un-validate-topology__status-icon-success",icon:"check-circle",id:m,scale:"s"}),b.tsx("calcite-tooltip",{referenceElement:m},b.tsx("span",null,a.status.success))):"failed"===
c.state?b.tsx("div",{class:"esri-un-validate-topology__status-icon-container",key:"statusDivFailed",slot:"control"},b.tsx("calcite-icon",{class:"esri-un-validate-topology__status-icon-error",icon:"exclamation-mark-triangle",id:l,scale:"s"}),b.tsx("calcite-tooltip",{referenceElement:l},b.tsx("span",null,c.executionError))):b.tsx("div",{class:"esri-un-validate-topology__status-icon-container",key:"statusDiv",slot:"control"})}_renderStatusNotice(){const {viewModel:a}=this;return b.tsx("div",{key:"executionErrorDiv"},
b.tsx("calcite-notice",{closable:!0,kind:"warning",open:!0,scale:"s"},b.tsx("div",{slot:"message"},a.executionError)))}_renderValidateTopologyAction(){const {messages:a,viewModel:c}=this,h=`${this.id}-validation-action`;return b.tsx("div",{key:"actionDiv",slot:"control"},b.tsx("calcite-action",{bind:this,disabled:"executing"===c.state,icon:"play-f",id:h,loading:"loading"===c.state,onclick:this._handleValidateTopologyAction,text:a.input.validateTopology}),b.tsx("calcite-tooltip",{referenceElement:h},
b.tsx("span",null,"loading"===c.state?a.status.loading:a.input.validateTopology)))}};e.__decorate([g.property()],d.prototype,"extentToValidate",null);e.__decorate([g.property()],d.prototype,"icon",null);e.__decorate([g.property()],d.prototype,"label",null);e.__decorate([g.property(),r.messageBundle("esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology")],d.prototype,"messages",void 0);e.__decorate([g.property()],d.prototype,"utilityNetwork",null);e.__decorate([g.property()],
d.prototype,"view",null);e.__decorate([g.property({type:k})],d.prototype,"viewModel",void 0);return d=e.__decorate([n.subclass("esri.widgets.UtilityNetworkValidateTopology")],d)});