UNPKG

@arcgis/map-components

Version:
46 lines (45 loc) 1.95 kB
import { c as i } from "../../chunks/runtime.js"; import { usePropertyChange as e } from "@arcgis/lumina/controllers"; import { watch as o } from "@arcgis/core/core/reactiveUtils.js"; import s from "@arcgis/core/widgets/UtilityNetworkValidateTopology.js"; import { LitElement as a, createEvent as r, noShadowRoot as l } from "@arcgis/lumina"; import { m as h } from "../../chunks/useWidget.js"; /*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. v4.33.16 */ const w = h( // Workaround for https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/69562 s ); class d extends a { constructor() { super(...arguments), this.widget = w(this), this.viewModel = this.widget.viewModel, this.view = this.widget.view, this.autoDestroyDisabled = !1, this.extentToValidate = this.widget.extentToValidate, this.icon = this.widget.icon, this.label = this.widget.label, this.position = "top-right", this.state = this.viewModel.state, this.utilityNetwork = this.widget.utilityNetwork, this.arcgisPropertyChange = e()("state"), this.arcgisReady = r(); } static { this.properties = { view: 16, autoDestroyDisabled: 5, extentToValidate: 1, icon: 1, label: 1, position: 1, referenceElement: 1, state: 3, utilityNetwork: 0 }; } static { this.shadowRootOptions = l; } async destroy() { await this.manager.destroy(); } async loaded() { await this._loadUtilityNetwork(), this.manager.onLifecycle(() => [ o(() => this.view, () => { this._loadUtilityNetwork(); }) ]); } async _loadUtilityNetwork() { if (this.view?.map && this.view.map.portalItem) { await this.view.map.load(); const t = this.view.map.utilityNetworks?.getItemAt(0); await t?.load(), this.utilityNetwork = t; } } } i("arcgis-utility-network-validate-topology", d); export { d as ArcgisUtilityNetworkValidateTopology };