@esri/solutions-components 5.1.0-next.146 → 5.1.0-next.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{BQE6IVEF.js → 3A2YSBVB.js} +1 -1
- package/dist/cdn/{QKJJHBMB.js → 42GXADY4.js} +1 -1
- package/dist/cdn/{L3UI7EZZ.js → 4DAGSZIC.js} +1 -1
- package/dist/cdn/{ULUJKWT5.js → 4FRYNYQ6.js} +1 -1
- package/dist/cdn/4RJURJQ5.js +2 -0
- package/dist/cdn/{7CLM77HQ.js → 4SBOBTOR.js} +1 -1
- package/dist/cdn/{CVRBLJ5O.js → 5MPDXVRM.js} +1 -1
- package/dist/cdn/{MPCJZCL5.js → 5O7LFBHI.js} +2 -2
- package/dist/cdn/{7ADKNWWI.js → 6AUKNSKW.js} +1 -1
- package/dist/cdn/{FSWG7SUT.js → 6K3C5JX2.js} +1 -1
- package/dist/cdn/6VCG2ITQ.js +2 -0
- package/dist/cdn/{NOXANMDF.js → 757HAEJS.js} +1 -1
- package/dist/cdn/{P4XNRWG7.js → 7Q5BT35O.js} +1 -1
- package/dist/cdn/{4NZDPHHF.js → 7WYPODAB.js} +1 -1
- package/dist/cdn/{463VANZI.js → BH42V5CR.js} +1 -1
- package/dist/cdn/DD2Y5NOB.js +2 -0
- package/dist/cdn/{J5K2SIY6.js → DMM5WA5Q.js} +3 -3
- package/dist/cdn/DO7NLLUV.js +2 -0
- package/dist/cdn/{UKQPYE7U.js → DQQTSOMQ.js} +1 -1
- package/dist/cdn/{Y4KGXRSD.js → FWLPMS4Q.js} +1 -1
- package/dist/cdn/{M4II4TSX.js → G3C6IL5Y.js} +1 -1
- package/dist/cdn/{3DCFUYKP.js → GG4IIHQE.js} +1 -1
- package/dist/cdn/GRQLB7ZG.js +2 -0
- package/dist/cdn/{5DEYOM7D.js → HQLA2AI4.js} +1 -1
- package/dist/cdn/{MHVLVLRA.js → HYQVSB6C.js} +1 -1
- package/dist/cdn/I46CXTVR.js +2 -0
- package/dist/cdn/{MIH5YMTN.js → JMBANG5V.js} +1 -1
- package/dist/cdn/KETYOYXQ.js +2 -0
- package/dist/cdn/{GJD7AOUI.js → KH5WPLZK.js} +1 -1
- package/dist/cdn/{IDEOFV22.js → LTLR4VF3.js} +1 -1
- package/dist/cdn/NQH7ZZWD.js +2 -0
- package/dist/cdn/OANAQ6HY.js +2 -0
- package/dist/cdn/{FAIQTEVJ.js → PP7EF7UU.js} +1 -1
- package/dist/cdn/{L6P26BYB.js → Q2DJUFVO.js} +1 -1
- package/dist/cdn/{LCV5GKUD.js → Q35DDH7J.js} +123 -123
- package/dist/cdn/{RIHOGDUV.js → QC4MO5BO.js} +1 -1
- package/dist/cdn/QDKHYQJB.js +2 -0
- package/dist/cdn/{FCJSMT5G.js → RMO244NW.js} +1 -1
- package/dist/cdn/RY6KZ77P.js +2 -0
- package/dist/cdn/{PBGG3TGN.js → RYBSWXQQ.js} +1 -1
- package/dist/cdn/{2UMMLVCR.js → SYQ5E5TV.js} +1 -1
- package/dist/cdn/{E6YCTW3S.js → TKOGOWYQ.js} +14 -14
- package/dist/cdn/UBEU6ULP.js +2 -0
- package/dist/cdn/UCQJWFUW.js +2 -0
- package/dist/cdn/{2PUK3PST.js → W7I22AW3.js} +1 -1
- package/dist/cdn/{RUQ4RO4T.js → WUEJANIZ.js} +1 -1
- package/dist/cdn/{BMMIXOTR.js → WXL7GVUU.js} +1 -1
- package/dist/cdn/{B5MBF4JC.js → XO54BFTC.js} +1 -1
- package/dist/cdn/{XGYNSCTA.js → Y37QLEAM.js} +1 -1
- package/dist/cdn/{O6ZQYZKL.js → YFJZN5K5.js} +1 -1
- package/dist/cdn/{6T35OGRG.js → YTU2BYBP.js} +1 -1
- package/dist/cdn/{5LF6C3S5.js → YWALGZAG.js} +1 -1
- package/dist/cdn/{F26SXWZ5.js → ZNH7LRND.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/Auth.js +1 -1
- package/dist/chunks/deployFlowController.js +1 -1
- package/dist/chunks/helpers.js +47 -43
- package/dist/chunks/interfaces.js +105 -102
- package/dist/chunks/solution-builder-assistant.js +183 -119
- package/dist/chunks/solution-deploy-dialog.js +4 -4
- package/dist/chunks/solutions-deploy-app-nav.js +2 -2
- package/dist/chunks/validators.js +3 -3
- package/dist/components/arcgis-solutions-assistant/customElement.js +115 -101
- package/dist/components/arcgis-solutions-assistant/index.js +1 -0
- package/dist/components/card-manager/customElement.js +8 -8
- package/dist/components/create-feature/customElement.js +107 -113
- package/dist/components/crowdsource-reporter/customElement.js +1 -1
- package/dist/components/layer-table/customElement.d.ts +3 -0
- package/dist/components/layer-table/customElement.js +110 -100
- package/dist/components/solution-configure-titles/customElement.js +11 -10
- package/dist/components/solution-delete-dialog/customElement.js +9 -8
- package/dist/components/solution-deploy-dialog/customElement.d.ts +6 -2
- package/dist/components/solution-deployed-card-panel/customElement.js +41 -38
- package/dist/components/solution-details-card/customElement.js +1 -1
- package/dist/components/solution-details-panel/customElement.js +114 -100
- package/dist/components/solution-item-diagram/customElement.js +6 -6
- package/dist/components/solution-resource-card/customElement.js +1 -1
- package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
- package/dist/components/solutions-all-panel/customElement.js +1 -1
- package/dist/components/solutions-deploy-app/customElement.js +9 -11
- package/dist/components/solutions-deployed-panel/customElement.js +7 -7
- package/dist/components/solutions-deployed-shell/customElement.js +1 -1
- package/dist/components/solutions-filter-panel/customElement.js +1 -1
- package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +9 -6
- package/dist/types/lumina.d.ts +1 -0
- package/dist/types/preact.d.ts +1 -0
- package/dist/types/react.d.ts +1 -0
- package/dist/types/stencil.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cdn/3JQ2RXVJ.js +0 -2
- package/dist/cdn/54AE7WD2.js +0 -2
- package/dist/cdn/7WD3GNG4.js +0 -2
- package/dist/cdn/D3XPV5W4.js +0 -2
- package/dist/cdn/KDNGZ47C.js +0 -2
- package/dist/cdn/KIPRPYME.js +0 -2
- package/dist/cdn/PBMTIFFX.js +0 -2
- package/dist/cdn/PECGJO2P.js +0 -2
- package/dist/cdn/QGCF64WY.js +0 -2
- package/dist/cdn/Z3B5KW2S.js +0 -2
- package/dist/cdn/ZM27FRZG.js +0 -2
- package/dist/cdn/ZUPXKH75.js +0 -2
- package/dist/cdn/ZYLKUZID.js +0 -2
|
@@ -11,6 +11,8 @@ class S extends y {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super(), this.customInfoText = "", this.enableEditGeometry = !1, this.enableSnapping = !1, this.isMobile = !1, this.zoomAndScrollToSelected = !1, this.selectedFeaturesIds = [], this.enableCreateFeatures = !0, this.createBtnLabel = "", this.selectingFeatureFromMap = !1, this.showSketchWidgets = !1, this.mapComponentId = "", this.pasteEnabled = !1, this.showCopyPasteActions = !1, this.allowedPasteLayerIds = [], this._cardLoading = !1, this._graphics = [], this._showCreateFeatureComponent = !1, this._showSubmitBtn = !1, this._activeFeatureCreationCount = 1, this._isPasting = !1, this._translations = f({ name: "card-manager", blocking: !0 }), this._isFeatureCreated = !1, this._createFeature = p(), this._pasteComponent = p(), this.createWorkFlowStarted = o(), this.backFromCreateWorkFlow = o(), this.featureOrRecordSubmitted = o(), this.featuresCopied = o(), this.featuresPasted = o(), this._featuresAdded = () => {
|
|
13
13
|
this._isPasting && this._pasteComponent.value && this._resetPasteWorkflow();
|
|
14
|
+
}, this._initCreateComponent = () => {
|
|
15
|
+
this._showCreateFeatureComponent = !0;
|
|
14
16
|
}, this._pasteComponentReady = async () => {
|
|
15
17
|
if (this._pasteComponent.value && this.mapComponentId && this._pasteComponent.value.referenceElement === void 0) {
|
|
16
18
|
const e = document.getElementById(this.mapComponentId);
|
|
@@ -26,7 +28,7 @@ class S extends y {
|
|
|
26
28
|
} catch (t) {
|
|
27
29
|
await this._resetPasteWorkflow(), console.error("Paste failed:", t);
|
|
28
30
|
}
|
|
29
|
-
}, this.listenOn(window, "featureSelectionChange", this.featureSelectionChange), this.listenOn(window, "layerSelectionChange", this.layerSelectionChange), this.listenOn(window, "mapChanged", this.mapChanged), this.listenOn(window, "relatedRecordToggled", this.relatedRecordToggled), this.listenOn(window, "copyFeatures", this._copyFeatures), this.listenOn(window, "pasteFeatures", this._pasteFeatures), this.listenOn(window, "featuresAdded", this._featuresAdded);
|
|
31
|
+
}, this.listenOn(window, "featureSelectionChange", this.featureSelectionChange), this.listenOn(window, "layerSelectionChange", this.layerSelectionChange), this.listenOn(window, "mapChanged", this.mapChanged), this.listenOn(window, "relatedRecordToggled", this.relatedRecordToggled), this.listenOn(window, "copyFeatures", this._copyFeatures), this.listenOn(window, "pasteFeatures", this._pasteFeatures), this.listenOn(window, "featuresAdded", this._featuresAdded), this.listenOn(window, "initCreateComponent", this._initCreateComponent);
|
|
30
32
|
}
|
|
31
33
|
static {
|
|
32
34
|
this.properties = { customInfoText: 1, enableEditGeometry: 5, enableSnapping: 5, isMobile: 5, layerOrTable: 0, mapView: 0, zoomAndScrollToSelected: 5, selectedFeaturesIds: 0, enableCreateFeatures: 5, createBtnLabel: 1, selectingFeatureFromMap: 5, showSketchWidgets: 5, mapComponentId: 1, pasteEnabled: 5, showCopyPasteActions: 5, allowedPasteLayerIds: 0, _cardLoading: 16, _graphics: 16, _showCreateFeatureComponent: 16, _showSubmitBtn: 16, _activeFeatureCreationCount: 16, _isPasting: 16, _translations: 16 };
|
|
@@ -73,7 +75,7 @@ class S extends y {
|
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
77
|
try {
|
|
76
|
-
this._pasteComponent.value.closed = !1, await this._pasteComponent.value.showClipboardItems(!0), this.
|
|
78
|
+
this._pasteComponent.value.closed = !1, await this._pasteComponent.value.showClipboardItems(!0), this.layerOrTable?.isTable || await this._pasteComponent.value.startMoveClipboard(!0), this.featuresPasted.emit();
|
|
77
79
|
} catch (t) {
|
|
78
80
|
console.error("Paste failed:", t);
|
|
79
81
|
}
|
|
@@ -81,8 +83,8 @@ class S extends y {
|
|
|
81
83
|
_getLayerPermissionsCheck() {
|
|
82
84
|
const e = this.allowedPasteLayerIds?.length > 0 ? this.allowedPasteLayerIds.map(String) : this.layerOrTable?.id !== void 0 ? [String(this.layerOrTable.id)] : [], t = new Set(e);
|
|
83
85
|
return {
|
|
84
|
-
canCreate: (a) => t.has(String(a.id)) &&
|
|
85
|
-
canUpdate: (a) => t.has(String(a.id)) &&
|
|
86
|
+
canCreate: (a) => t.has(String(a.id)) && a.editingEnabled && a.capabilities?.operations?.supportsAdd,
|
|
87
|
+
canUpdate: (a) => t.has(String(a.id)) && a.editingEnabled && a.capabilities?.operations?.supportsUpdate
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
async _resetPasteWorkflow() {
|
|
@@ -102,7 +104,7 @@ class S extends y {
|
|
|
102
104
|
this.selectedFeaturesIds?.length > 0 && (this._graphics = await this._getFeaturesByIds(this.selectedFeaturesIds));
|
|
103
105
|
}
|
|
104
106
|
render() {
|
|
105
|
-
const e = (this._pasteComponent.value?.closed || !this.showCopyPasteActions) && this._graphics?.length > 0, t = this._pasteComponent.value?.closed ? "display-none" : "", a = this._graphics?.length === 0 && this._showCreateFeatureComponent ? "" : "display-none", i = this._graphics?.length > 0 || this._showCreateFeatureComponent || !this._pasteComponent.value?.closed && this.showCopyPasteActions ? "display-none" : "", r = this.layerOrTable?.isTable, n = this.customInfoText ? this.customInfoText : this.selectingFeatureFromMap ? this._translations.selectFeaturesFromMapToStart : this._translations.selectFeaturesToStart, l = this.enableCreateFeatures && this.layerOrTable?.capabilities?.operations?.supportsAdd, h = this.createBtnLabel ? this.createBtnLabel : r ? this._translations.createRecord : this._translations.createFeature, u = !this.layerOrTable, m = this.enableSnapping && !this.layerOrTable?.isTable, C = this.layerOrTable?.isTable ? ["paste"] : ["paste", "paste-as"], g =
|
|
107
|
+
const e = (this._pasteComponent.value?.closed || !this.showCopyPasteActions) && this._graphics?.length > 0, t = this._pasteComponent.value?.closed ? "display-none" : "", a = this._graphics?.length === 0 && this._showCreateFeatureComponent ? "" : "display-none", i = this._graphics?.length > 0 || this._showCreateFeatureComponent || !this._pasteComponent.value?.closed && this.showCopyPasteActions ? "display-none" : "", r = this.layerOrTable?.isTable, n = this.customInfoText ? this.customInfoText : this.selectingFeatureFromMap ? this._translations.selectFeaturesFromMapToStart : this._translations.selectFeaturesToStart, l = this.enableCreateFeatures && this.layerOrTable?.editingEnabled && this.layerOrTable?.capabilities?.operations?.supportsAdd, h = this.createBtnLabel ? this.createBtnLabel : r ? this._translations.createRecord : this._translations.createFeature, u = !this.layerOrTable, m = this.enableSnapping && !this.layerOrTable?.isTable, C = this.layerOrTable?.isTable ? ["paste"] : ["paste", "paste-as"], g = !this.layerOrTable?.isTable;
|
|
106
108
|
return s`<calcite-panel><div class="overflow-auto height-full">${e && s`<calcite-shell class=${"position-relative"}><div class="position-static z-index-500 height-full"><info-card .allowEditing=${this.layerOrTable?.editingEnabled} .enableEditGeometry=${this.enableEditGeometry} .enableSnapping=${m} .graphics=${this._graphics.reverse()} .isLoading=${this._cardLoading} .isMobile=${this.isMobile} .mapView=${this.mapView} .featuresReferenceId=${this.mapComponentId} position=relative .pasteEnabled=${this.pasteEnabled} show-close-btn .showCopyPasteActions=${this.showCopyPasteActions}></info-card></div></calcite-shell>` || ""}<calcite-shell class=${`position-relative ${i}`}><calcite-panel><div class=padding-1><calcite-notice .icon=${this.selectingFeatureFromMap ? "map" : "table"} icon-flip-rtl open><div slot=message>${n}</div></calcite-notice></div>${!this.isMobile && l && s`<calcite-button .disabled=${u} @click=${() => this._createFeatureBtnClicked()} slot=footer width=full>${h}</calcite-button>` || ""}</calcite-panel></calcite-shell><calcite-shell class=${`position-relative ${a}`}><calcite-flow-item selected><calcite-panel .heading=${h}><calcite-action class="back-button hydrated" icon=chevron-left @click=${this._backFromCreateFeature} scale=s slot=header-actions-start .text=${this._translations.back}></calcite-action>${this.getEditorComponent()}${this._showSubmitBtn && s`<calcite-button appearance=solid class="footer-top-button footer-button" @click=${() => this._createFeature.value && void this._createFeature.value.submit()} slot=footer width=full>${this._activeFeatureCreationCount > 1 ? this._translations.createMultiple.replace("{{n}}", String(this._activeFeatureCreationCount)) : this._translations.create}</calcite-button>` || ""}</calcite-panel></calcite-flow-item></calcite-shell>${this.showCopyPasteActions && s`<calcite-panel class=${v(t)} .loading=${this._isPasting}><arcgis-paste always-show-feature-form class=${`paste-component ${t}`} closed @arcgisReady=${this._pasteComponentReady} @arcgisApplyPasteCommand=${this._applyPasteCommand} @arcgisClose=${() => {
|
|
107
109
|
this._resetPasteWorkflow();
|
|
108
110
|
}} paste-with-multiple-layers-enabled paste-with-multiple-features-enabled .layerPermissionsCheck=${this._getLayerPermissionsCheck()} .supportedCommands=${C} .view=${this.mapView} ${d(this._pasteComponent)}>${g && s`<calcite-notice slot=commands-page-message class="margin-top-10" open icon=move><div slot=message>${this._translations.moveClipboardFeatures}</div></calcite-notice>` || ""}</arcgis-paste></calcite-panel>` || ""}</div></calcite-panel>`;
|
|
@@ -131,9 +133,7 @@ class S extends y {
|
|
|
131
133
|
this._createFeature.value && (this._showCreateFeatureComponent = !1, this.backFromCreateWorkFlow.emit()), this._showSubmitBtn = !1;
|
|
132
134
|
}
|
|
133
135
|
_featureCreated() {
|
|
134
|
-
this._showCreateFeatureComponent = !1, this._showSubmitBtn = !1, this._isFeatureCreated = !0, this.featureOrRecordSubmitted.emit()
|
|
135
|
-
this._showCreateFeatureComponent = !0;
|
|
136
|
-
}, 50);
|
|
136
|
+
this._showCreateFeatureComponent = !1, this._showSubmitBtn = !1, this._isFeatureCreated = !0, this.featureOrRecordSubmitted.emit();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
w("card-manager", S);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { a as
|
|
2
|
+
import { c as I } from "../../chunks/runtime.js";
|
|
3
|
+
import { a as x, g as w } from "../../chunks/mapViewUtils.js";
|
|
4
4
|
import { u as A } from "../../chunks/useT9n.js";
|
|
5
|
-
import { css as M, html as
|
|
6
|
-
import { createRef as
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import { p as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
5
|
+
import { css as M, html as r, nothing as _ } from "lit";
|
|
6
|
+
import { createRef as g, ref as u } from "lit-html/directives/ref.js";
|
|
7
|
+
import { LitElement as L, createEvent as c, noShadowRoot as E, safeClassMap as v } from "@arcgis/lumina";
|
|
8
|
+
import { p as k } from "../../chunks/queryUtils.js";
|
|
9
|
+
import P from "@arcgis/core/form/ExpressionInfo.js";
|
|
10
|
+
import $ from "@arcgis/core/layers/FeatureLayer.js";
|
|
11
|
+
import C from "@arcgis/core/form/elements/FieldElement.js";
|
|
12
|
+
import S from "@arcgis/core/form/FormTemplate.js";
|
|
13
13
|
import V from "@arcgis/core/views/MapView.js";
|
|
14
14
|
import F from "@arcgis/core/Graphic.js";
|
|
15
15
|
import * as y from "@arcgis/core/core/reactiveUtils.js";
|
|
@@ -19,9 +19,37 @@ import * as R from "exifr";
|
|
|
19
19
|
import U from "@arcgis/core/geometry/Point.js";
|
|
20
20
|
import z from "@arcgis/core/geometry/SpatialReference.js";
|
|
21
21
|
const H = M`@layer{:host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none!important}.esri-editor__panel-content{padding-block:0px!important}.esri-editor .esri-item-list__group__header,.esri-editor__panel-content__section .esri-widget__heading{display:none!important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px!important;padding-inline:10px!important}.search-widget{width:92%!important;margin:5px 14px 20px}.display-none{display:none!important}.hide-map{height:1%!important;visibility:hidden;position:static!important}.show-map{padding:10px!important;position:absolute!important;bottom:0;height:auto!important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.edit-location-btn{margin:5px;display:flex}.esri-editor__panel-content{padding-block:10px!important}.image-preview-container{padding:10px}.esri-editor{height:auto!important}.height-fit-content{height:fit-content!important}.content-container{padding:1.5rem}.instruction-text{margin-bottom:1.5rem;font-size:1rem}.selected-card{border:2px solid var(--calcite-ui-brand)}.upload-img-footer-container{width:100%;gap:5px;display:grid}.info-container{display:flex;align-items:center;gap:6px;margin-bottom:10px}.info-container calcite-icon{--calcite-icon-color: var(--calcite-color-brand)}.info-container span{font-size:12px;color:var(--calcite-ui-text-3)}.padding-10{padding:10px}.report-selection-container{display:flex;flex-direction:column;padding:10px;--calcite-card-border-color: var(--calcite-color-border-1)}.pb-12{padding-bottom:12px!important}.pt-0{padding-top:0!important}.pt-15{padding-top:15px!important}.option-description-container{display:flex;align-items:center;gap:6px}.cursor-pointer{cursor:pointer;padding:6px 0}.card-body-content{display:flex;flex-direction:row;align-items:center;padding:10px 5px;gap:15px}.text-stack{display:flex;flex-direction:column;gap:2px}.option-title{font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-1);font-size:var(--calcite-font-size--1)}.option-description{color:var(--calcite-ui-text-3);font-size:var(--calcite-font-size--1)}.action-footer{display:flex;justify-content:center;margin-top:16px}.analysis-wrapper{display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;margin:auto}.analyzing-icon{--calcite-icon-color: var(--calcite-color-brand);animation:sparkle 2s infinite ease-in-out}.adjusted-height{height:30px!important;min-height:auto!important}@keyframes sparkle{0%,to{transform:scale(1)}50%{transform:scale(1.5)}}@media only screen and (max-width:600px){.esri-editor__panel-content{padding-block:0!important;min-height:0!important}}}`, f = "geocodedLocation", D = `Extract the address from the user's message and return it in JSON format '{"address":"<address>"}'. If no address is found, return null.`;
|
|
22
|
-
class N extends
|
|
22
|
+
class N extends L {
|
|
23
23
|
constructor() {
|
|
24
|
-
super(...arguments), this.customizeSubmit = !1, this.enableSearch = !1, this.enableSnapping = !1, this.floorLevel = "", this.isMobile = !1, this.selectedLayerId = "", this.showGuidingMsg = !0, this.submitNewReportsMessage = "", this.updateMapPosition = !1, this.reportingArea = !1, this.reportingAreaLayer = "", this.reportingAreaMessage = "", this.showSketchWidgets = !1, this.allowMultipleCreation = !1, this.popupEnabled = !1, this.showLayerVisibilityMsg = !1, this.enablePhotoLocation = !1, this.enableMessageLocation = !1, this._currentPage = "templatePicker", this._showSearchComponent = this.enableSearch, this._layerInfos = [], this._inValidGeometryDrawn = !1, this._selectedImageBase64 = "", this._enteredMessage = "", this._analysisFailed = !1, this._translations = A({ name: "create-feature", blocking: !0 }), this._addingAttachment = !1, this._uploadedImage = null, this._calciteNotice =
|
|
24
|
+
super(...arguments), this.customizeSubmit = !1, this.enableSearch = !1, this.enableSnapping = !1, this.floorLevel = "", this.isMobile = !1, this.selectedLayerId = "", this.showGuidingMsg = !0, this.submitNewReportsMessage = "", this.updateMapPosition = !1, this.reportingArea = !1, this.reportingAreaLayer = "", this.reportingAreaMessage = "", this.showSketchWidgets = !1, this.allowMultipleCreation = !1, this.popupEnabled = !1, this.showLayerVisibilityMsg = !1, this.enablePhotoLocation = !1, this.enableMessageLocation = !1, this._currentPage = "templatePicker", this._showSearchComponent = this.enableSearch, this._layerInfos = [], this._inValidGeometryDrawn = !1, this._selectedImageBase64 = "", this._enteredMessage = "", this._analysisFailed = !1, this._translations = A({ name: "create-feature", blocking: !0 }), this._addingAttachment = !1, this._uploadedImage = null, this._calciteNotice = g(), this._editor = g(), this._mapViewContainer = g(), this._searchRef = g(), this._inputImageForAI = g(), this._guidingMessageRefNode = g(), this._abortController = new AbortController(), this._awaitingLayerEdits = !1, this._pendingAttachmentUpload = !1, this.success = c(), this.fail = c(), this.drawComplete = c(), this.editingLocation = c(), this.editingAttachment = c(), this.progressStatus = c(), this.modeChanged = c(), this.activeFeatureCountChange = c(), this._onLayerEdits = async (e) => {
|
|
25
|
+
if (!this._awaitingLayerEdits)
|
|
26
|
+
return;
|
|
27
|
+
const t = [
|
|
28
|
+
...e.addedFeatures || []
|
|
29
|
+
].filter((i) => i?.error);
|
|
30
|
+
if (t.length) {
|
|
31
|
+
this._onFail(t[0].error);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (this._pendingAttachmentUpload) {
|
|
35
|
+
const i = e?.addedFeatures?.[0]?.objectId;
|
|
36
|
+
if (i && this._uploadedImage && this._selectedLayer)
|
|
37
|
+
try {
|
|
38
|
+
const a = new FormData();
|
|
39
|
+
a.set("keywords", "ai-image"), a.set("attachment", this._uploadedImage), a.append("f", "json");
|
|
40
|
+
const s = new F({
|
|
41
|
+
attributes: {
|
|
42
|
+
[this._selectedLayer.objectIdField]: i
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
await this._selectedLayer.addAttachment(s, a);
|
|
46
|
+
} catch (a) {
|
|
47
|
+
this._onFail(a);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
this._awaitingLayerEdits = !1, this._pendingAttachmentUpload = !1, this.success.emit();
|
|
52
|
+
};
|
|
25
53
|
}
|
|
26
54
|
static {
|
|
27
55
|
this.properties = { appName: 1, customizeSubmit: 5, enableSearch: 5, enableSnapping: 5, floorLevel: 1, formElements: 1, isMobile: 5, mapView: 0, searchConfiguration: 0, selectedLayerId: 1, showGuidingMsg: 5, submitNewReportsMessage: 1, updateMapPosition: 5, reportingArea: 5, reportingAreaLayer: 1, reportingAreaMessage: 1, showSketchWidgets: 5, allowMultipleCreation: 5, popupEnabled: 5, showLayerVisibilityMsg: 5, enablePhotoLocation: 5, enableMessageLocation: 5, aiImageExtraction: 0, aiTextExtraction: 0, _currentPage: 16, _showSearchComponent: 16, _layerInfos: 16, _inValidGeometryDrawn: 16, _selectedImageBase64: 16, _enteredMessage: 16, _analysisFailed: 16, _updatedMapView: 16, _translations: 16 };
|
|
@@ -30,7 +58,7 @@ class N extends k {
|
|
|
30
58
|
this.styles = H;
|
|
31
59
|
}
|
|
32
60
|
static {
|
|
33
|
-
this.shadowRootOptions =
|
|
61
|
+
this.shadowRootOptions = E;
|
|
34
62
|
}
|
|
35
63
|
willUpdate(e) {
|
|
36
64
|
e.has("mapView") && this.hasUpdated && this.mapViewWatchHandler(), e.has("isMobile") && this.hasUpdated && this.isMobileHandler(), e.has("enableSearch") && this.hasUpdated && this.searchHandler(), e.has("searchConfiguration") && this.hasUpdated && this.searchConfigurationHandler(this.searchConfiguration, e.get("searchConfiguration"));
|
|
@@ -51,7 +79,11 @@ class N extends k {
|
|
|
51
79
|
}
|
|
52
80
|
async submit() {
|
|
53
81
|
const e = this._editor.value?.activeWorkflow;
|
|
54
|
-
e
|
|
82
|
+
if (e && (this._pendingAttachmentUpload = !!(this._selectedLayer && this._selectedLayer.capabilities.data.supportsAttachment && this._selectedImageBase64), this._awaitingLayerEdits = !0, e.data?.creationInfo && this._updatedMapView && (e.data.creationInfo.view = this._updatedMapView), await e.save(), e.data.viewModel.failures.length)) {
|
|
83
|
+
const t = e.data.viewModel.failures[0].error;
|
|
84
|
+
this._currentPage = "drawing", this._onFail(t);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
55
87
|
}
|
|
56
88
|
async refresh(e) {
|
|
57
89
|
this._editor.value && (e ? await this._setFloorLevel(e) : this.reportingArea && this.reportingAreaLayer && this._currentPage !== "drawing" ? await this.queryIntersectingFeatures() : this._currentPage !== "drawing" && (this._inValidGeometryDrawn = !1, this.drawComplete.emit(this._inValidGeometryDrawn)));
|
|
@@ -80,12 +112,12 @@ class N extends k {
|
|
|
80
112
|
super.disconnectedCallback(), this._editor.value && (this._editor.value.destroy(), this.enableSnapping && this.mapView?.ui.view && (this.mapView.ui.view.grid = null), this._removeHandlers());
|
|
81
113
|
}
|
|
82
114
|
render() {
|
|
83
|
-
const e = this._currentPage === "loading" ? "" : "display-none", t = this.isMobile && this.updateMapPosition ? "show-map" : "display-none", i = this._inValidGeometryDrawn ? "danger" : "success", a = this._inValidGeometryDrawn ? "exclamation-mark-triangle" : "lightbulb", s = this.showLayerVisibilityMsg && this._currentPage === "templatePicker",
|
|
84
|
-
let
|
|
85
|
-
const
|
|
86
|
-
return this._inValidGeometryDrawn ?
|
|
115
|
+
const e = this._currentPage === "loading" ? "" : "display-none", t = this.isMobile && this.updateMapPosition ? "show-map" : "display-none", i = this._inValidGeometryDrawn ? "danger" : "success", a = this._inValidGeometryDrawn ? "exclamation-mark-triangle" : "lightbulb", s = this.showLayerVisibilityMsg && this._currentPage === "templatePicker", o = (this.showGuidingMsg || s) && this._currentPage !== "loading" && this._currentPage !== "drawingMultipleFeatures";
|
|
116
|
+
let n = this._translations.chooseCategoryMsg;
|
|
117
|
+
const l = this._aiAnalysisInfo?.results?.filter((p) => !p.success && p.key !== f), h = l?.length ? !0 : this._analysisFailed, d = this._getAnalysisErrorMessage(l?.length), m = this._aiAnalysisInfo?.canUseAI && ["chooseReportType", "analyzingImage", "analyzingMessage", "imageUpload", "messageInput"].includes(this._currentPage);
|
|
118
|
+
return this._inValidGeometryDrawn ? n = this.reportingAreaMessage || this._translations.reportOutsideAreaMessage : this._currentPage === "drawing" || this._currentPage === "editing" ? n = this._translations.provideLocationMsg : this._currentPage === "featureForm" ? n = this._aiAnalysisInfo?.results?.filter((p) => p.success).length ? this._analysisMode === "text" ? this._translations.textReviewMsg : this._translations.formReviewMsg : this._translations.provideDetailsMsg : s && (n = this._translations.enableFeatureTemplatesMessage), r`${h && r`<calcite-alert auto-close icon=x-octagon kind=danger label @calciteAlertClose=${() => {
|
|
87
119
|
this._analysisFailed = !1;
|
|
88
|
-
}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${d}</div></calcite-alert>` || ""}${
|
|
120
|
+
}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${d}</div></calcite-alert>` || ""}${m && r`<calcite-panel>${this._currentPage === "chooseReportType" && this._getReportTypePage() || ""}${this._currentPage === "imageUpload" && this._aiImageExtractionPage() || ""}${this._currentPage === "messageInput" && this._aiTextExtractionPage() || ""}${this._currentPage === "analyzingImage" && this._getAnalyzingImagePage() || ""}${this._currentPage === "analyzingMessage" && this._getAnalyzingMessagePage() || ""}</calcite-panel>` || ""}${!m && r`${o && r`<calcite-notice class="notice-msg" .icon=${a} .kind=${i} open ${u(this._calciteNotice)}><div slot=message .innerHTML=${n ?? ""} ${u(this._guidingMessageRefNode)}></div></calcite-notice>` || ""}${this._selectedImageBase64 && this._currentPage === "featureForm" && r`<div class="image-preview-container"><calcite-label>${this._translations.photo}</calcite-label><img class="width-full" src=${this._selectedImageBase64 ?? _}></div>` || ""}<calcite-loader class=${v(e)} label scale=s></calcite-loader>${this._currentPage === "featureForm" && this.isMobile && r`<calcite-button appearance=transparent class="edit-location-btn" icon-start=pin @click=${this.editLocation}>${this._translations.editLocationLabel}</calcite-button>` || ""}${this._showSearchComponent && this._updatedMapView && this._selectedLayer && this._getSearchComponent() || ""}${this._updatedMapView && this._selectedLayer && this._getEditor() || ""}` || ""}<div class=${v(t)} ${u(this._mapViewContainer)}></div>`;
|
|
89
121
|
}
|
|
90
122
|
async init() {
|
|
91
123
|
this.mapView && this.selectedLayerId && (this._updatedMapView = this.mapView, await (this.isMobile && this.updateMapPosition ? this.createMobileMapView() : this._loadLayerInfos()));
|
|
@@ -106,8 +138,8 @@ class N extends k {
|
|
|
106
138
|
}));
|
|
107
139
|
}
|
|
108
140
|
async _loadLayerInfos() {
|
|
109
|
-
const e = [], t = this._updatedMapView && await
|
|
110
|
-
i && (this._selectedLayer = i, !this._selectedLayer.isTable && t && t.forEach((a) => {
|
|
141
|
+
const e = [], t = this._updatedMapView && await x(this._updatedMapView), i = this.mapView && await w(this.mapView, this.selectedLayerId);
|
|
142
|
+
i && (this._selectedLayer = i, this._attachEditsListener(this._selectedLayer), !this._selectedLayer.isTable && t && t.forEach((a) => {
|
|
111
143
|
e.push({
|
|
112
144
|
layer: a,
|
|
113
145
|
enabled: a.type === "feature" && a.id === this.selectedLayerId,
|
|
@@ -117,40 +149,46 @@ class N extends k {
|
|
|
117
149
|
});
|
|
118
150
|
})), this._layerInfos = e;
|
|
119
151
|
}
|
|
152
|
+
_attachEditsListener(e) {
|
|
153
|
+
this._attachedEditsLayerId === e.id && this._layerEditsHandler || (this._layerEditsHandler?.remove(), this._attachedEditsLayerId = e.id, this._layerEditsHandler = e.on("edits", this._onLayerEdits));
|
|
154
|
+
}
|
|
155
|
+
_onFail(e) {
|
|
156
|
+
this._awaitingLayerEdits = !1, this._pendingAttachmentUpload = !1, this.fail.emit(e);
|
|
157
|
+
}
|
|
120
158
|
_getReportTypePage() {
|
|
121
159
|
const e = this._hasImageExtraction(), t = this._hasTextExtraction();
|
|
122
|
-
return
|
|
160
|
+
return r`<div class="report-selection-container"><calcite-label class="pb-12">${this._translations.createReportHeading}</calcite-label><div class="option-description-container"><span class="option-description">${this._translations.aiAssistedReport}</span><calcite-icon icon=effects scale=s></calcite-icon></div>${t && r`<calcite-card class="cursor-pointer pt-0" @click=${() => {
|
|
123
161
|
this._analysisMode = "text", this.progressStatus.emit(35), this._currentPage = "messageInput";
|
|
124
|
-
}}><div slot=description class="card-body-content"><calcite-icon icon=speech-bubble scale=m></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.useDescription}</span><span class="option-description">${this._translations.aiTextAssistantDescription}</span></div></div></calcite-card>` || ""}${e &&
|
|
162
|
+
}}><div slot=description class="card-body-content"><calcite-icon icon=speech-bubble scale=m></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.useDescription}</span><span class="option-description">${this._translations.aiTextAssistantDescription}</span></div></div></calcite-card>` || ""}${e && r`<calcite-card class="cursor-pointer" @click=${() => {
|
|
125
163
|
this._analysisMode = "image", this.progressStatus.emit(35), this._currentPage = "imageUpload";
|
|
126
164
|
}}><div slot=description class="card-body-content"><calcite-icon aria-hidden=true icon=camera scale=m style="color: var(--calcite-ui-text-2)"></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.usePhoto}</span><span class="option-description">${this._translations.aiAssistantDescription}</span></div></div></calcite-card>` || ""}<span class="option-description pt-15">${this._translations.manualReport}</span><calcite-card class="cursor-pointer pt-0" @click=${() => {
|
|
127
165
|
this._currentPage = "templatePicker", this.init();
|
|
128
166
|
}}><div slot=description class="card-body-content"><calcite-icon aria-hidden=true icon=pencil scale=m></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.fillOutManually}</span><span class="option-description">${this._translations.startBlank}</span></div></div></calcite-card></div>`;
|
|
129
167
|
}
|
|
130
168
|
_getEditor() {
|
|
131
|
-
return
|
|
169
|
+
return r`<arcgis-editor class=height-fit-content .view=${this._updatedMapView} .layerInfos=${this._layerInfos} hide-edit-features-section .hideSettingsMenu=${!this.enableSnapping} .hideSketch=${!this.showSketchWidgets || this._selectedLayer?.geometryType === "point"} .hideSnappingControlsElementsEnabledToggle=${!this.enableSnapping} @arcgisReady=${this._onEditorComponentReady} @arcgisPropertyChange=${this._onEditorPropertyChange} @arcgisSketchUpdate=${this._onSketchUpdate} ${u(this._editor)}></arcgis-editor>`;
|
|
132
170
|
}
|
|
133
171
|
_getSearchComponent() {
|
|
134
172
|
const e = this._currentPage === "drawing" || this._currentPage === "editing" ? "" : "display-none", t = this.searchConfiguration && this._updatedMapView ? this._getSearchConfig(this.searchConfiguration, this._updatedMapView) : void 0;
|
|
135
|
-
return
|
|
173
|
+
return r`<arcgis-search class=${`search-widget ${e}`} .view=${this._updatedMapView} @arcgisSearchComplete=${this.searchComplete} popup-disabled result-graphic-disabled .sources=${t?.sources || []} .allPlaceholder=${t?.allPlaceholder} .searchAllDisabled=${!t?.searchAllEnabled} ${u(this._searchRef)}></arcgis-search>`;
|
|
136
174
|
}
|
|
137
175
|
_aiImageExtractionPage() {
|
|
138
176
|
const e = this._selectedImageBase64 !== "", t = e ? this._translations.replaceImage : this._translations.imageUploadLimitHint;
|
|
139
|
-
return
|
|
177
|
+
return r`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiAssistantProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.photo}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-input type=file accept="image/*;capture=camera" @calciteInputInput=${this._onImageUpload} ${u(this._inputImageForAI)}></calcite-input></calcite-label><div class="info-container"><calcite-icon aria-hidden=true icon=information scale=s></calcite-icon><span>${t}</span></div>${e && r`<img alt=${this._translations.photo ?? _} class="width-full" src=${this._selectedImageBase64 ?? _}>` || ""}</div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeImage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
|
|
140
178
|
}
|
|
141
179
|
_aiTextExtractionPage() {
|
|
142
180
|
const e = this._enteredMessage.trim();
|
|
143
|
-
return
|
|
181
|
+
return r`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiTextProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.description}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-text-area @input=${(t) => {
|
|
144
182
|
this._enteredMessage = t.target.value;
|
|
145
183
|
}} .placeholder=${this._translations.messageInputHint} resize=vertical rows=6 .value=${this._enteredMessage}></calcite-text-area></calcite-label><div class="info-container"><calcite-icon icon=information scale=s></calcite-icon><span>${this._translations.descriptionRequiredHint}</span></div></div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeMessage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
|
|
146
184
|
}
|
|
147
185
|
_getAnalyzingImagePage() {
|
|
148
|
-
return
|
|
186
|
+
return r`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingImage}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
|
|
149
187
|
this._abortController.abort(), this._currentPage = "templatePicker";
|
|
150
188
|
}}>${this._translations.skip}</calcite-button></div>`;
|
|
151
189
|
}
|
|
152
190
|
_getAnalyzingMessagePage() {
|
|
153
|
-
return
|
|
191
|
+
return r`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingText}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
|
|
154
192
|
this._abortController.abort(), this._currentPage = "templatePicker";
|
|
155
193
|
}}>${this._translations.skip}</calcite-button></div>`;
|
|
156
194
|
}
|
|
@@ -172,38 +210,38 @@ class N extends k {
|
|
|
172
210
|
}
|
|
173
211
|
try {
|
|
174
212
|
this._analysisMode = "image", this._currentPage = "analyzingImage", this.progressStatus.emit(45);
|
|
175
|
-
const i = this._inputImageForAI.value.files[0], a = await new Promise((
|
|
176
|
-
const
|
|
177
|
-
|
|
213
|
+
const i = this._inputImageForAI.value.files[0], a = await new Promise((o, n) => {
|
|
214
|
+
const l = new FileReader();
|
|
215
|
+
l.onloadend = () => o(l.result), l.onerror = n, this._inputImageForAI.value && l.readAsDataURL(i);
|
|
178
216
|
});
|
|
179
217
|
if (this.enablePhotoLocation) {
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
longitude:
|
|
184
|
-
latitude:
|
|
218
|
+
const o = await R.gps(i);
|
|
219
|
+
if (o?.longitude && o.latitude && this.mapView?.spatialReference) {
|
|
220
|
+
const n = new U({
|
|
221
|
+
longitude: o.longitude,
|
|
222
|
+
latitude: o.latitude,
|
|
185
223
|
spatialReference: new z({ wkid: 4326 })
|
|
186
|
-
}),
|
|
187
|
-
this._aiAnalysisInfo && (this._aiAnalysisInfo.location =
|
|
224
|
+
}), l = await k(n, this.mapView.spatialReference);
|
|
225
|
+
this._aiAnalysisInfo && (this._aiAnalysisInfo.location = l);
|
|
188
226
|
}
|
|
189
227
|
}
|
|
190
228
|
const s = this._getImageExtractionData();
|
|
191
229
|
if (s.length) {
|
|
192
|
-
const
|
|
230
|
+
const o = {
|
|
193
231
|
input: a,
|
|
194
232
|
data: s
|
|
195
|
-
},
|
|
233
|
+
}, n = await b(t.imageUrl, {
|
|
196
234
|
method: "post",
|
|
197
235
|
headers: {
|
|
198
236
|
"Content-Type": "application/json",
|
|
199
237
|
"x-esri-authorization": `Bearer ${t.token}`,
|
|
200
238
|
"x-esri-request-source": `instantapps/${this.appName}`
|
|
201
239
|
},
|
|
202
|
-
body: JSON.stringify(
|
|
240
|
+
body: JSON.stringify(o),
|
|
203
241
|
responseType: "json",
|
|
204
242
|
signal: e
|
|
205
243
|
});
|
|
206
|
-
this._aiAnalysisInfo && (this._aiAnalysisInfo.results =
|
|
244
|
+
this._aiAnalysisInfo && (this._aiAnalysisInfo.results = n.data.results);
|
|
207
245
|
}
|
|
208
246
|
this._currentPage = "loading", await this.init();
|
|
209
247
|
} catch (i) {
|
|
@@ -220,7 +258,7 @@ class N extends k {
|
|
|
220
258
|
}
|
|
221
259
|
try {
|
|
222
260
|
this._analysisMode = "text", this._currentPage = "analyzingMessage", this.progressStatus.emit(45);
|
|
223
|
-
const
|
|
261
|
+
const o = await b(t.textUrl, {
|
|
224
262
|
method: "post",
|
|
225
263
|
headers: {
|
|
226
264
|
"Content-Type": "application/json",
|
|
@@ -234,16 +272,16 @@ class N extends k {
|
|
|
234
272
|
responseType: "json",
|
|
235
273
|
signal: e
|
|
236
274
|
});
|
|
237
|
-
if (this._aiAnalysisInfo && (this._aiAnalysisInfo.results =
|
|
238
|
-
const
|
|
239
|
-
|
|
275
|
+
if (this._aiAnalysisInfo && (this._aiAnalysisInfo.results = o.data.results, s.url)) {
|
|
276
|
+
const n = this._getExtractedAddress(o.data.results);
|
|
277
|
+
n && (this._aiAnalysisInfo.location = await this._geocodeExtractedAddress(n, {
|
|
240
278
|
url: s.url,
|
|
241
279
|
singleLineFieldName: s.singleLineFieldName
|
|
242
280
|
}));
|
|
243
281
|
}
|
|
244
282
|
this._currentPage = "loading", await this.init();
|
|
245
|
-
} catch (
|
|
246
|
-
|
|
283
|
+
} catch (o) {
|
|
284
|
+
o.name === "AbortError" ? console.error("Aborted", o) : (this._analysisFailed = !0, console.error("Analyzing failed", o)), this._resetAIAnalysisInfo(), this.init();
|
|
247
285
|
}
|
|
248
286
|
}
|
|
249
287
|
_resetAIAnalysisInfo() {
|
|
@@ -286,7 +324,7 @@ class N extends k {
|
|
|
286
324
|
this.progressStatus.emit(75), this.editingLocation.emit(), this._editor.value?.classList.add("display-none"), this._mapViewContainer.value?.classList.replace("hide-map", "show-map"), this._currentPage = "editing";
|
|
287
325
|
}
|
|
288
326
|
async _onEditorComponentReady() {
|
|
289
|
-
if (this._currentPage = "templatePicker", this._selectedLayer && this._selectedLayer.templates?.length === 1 && this._editor.value) {
|
|
327
|
+
if (this._currentPage = "templatePicker", this._selectedLayer && this._selectedLayer.templates?.length === 1 && this._editor.value && this._updatedMapView) {
|
|
290
328
|
const e = this._selectedLayer.templates[0], t = {
|
|
291
329
|
layer: this._selectedLayer,
|
|
292
330
|
template: e
|
|
@@ -301,7 +339,7 @@ class N extends k {
|
|
|
301
339
|
const i = this._editor.value?.activeWorkflow;
|
|
302
340
|
t === "creating-features" && i?.formViewModel?.state === "disabled" && (this._mapViewContainer.value?.classList.replace("hide-map", "show-map"), this._selectedLayer && !this._selectedLayer.isTable && (this._currentPage = "drawing", this.progressStatus.emit(50), i?.sketchViewModel?.createGraphic && this._aiAnalysisInfo?.location && (await this._updatedMapView?.goTo({ center: this._aiAnalysisInfo.location }), this._selectedLayer.geometryType === "point" && await this._initializeSketchPoint(this._aiAnalysisInfo.location.clone()))), this.isMobile && this._adjustPanelContentHeight()), t === "adding-attachment" || t === "editing-attachment" ? (this._addingAttachment = !0, this.editingAttachment.emit(!0)) : this._addingAttachment && (this.editingAttachment.emit(!1), this._addingAttachment = !1);
|
|
303
341
|
})), this._featureFormHandler || (this._featureFormHandler = y.watch(() => e.activeWorkflow?.formViewModel?.state, (t) => {
|
|
304
|
-
t === "ready" && this._currentPage !== "editing" ? (this._mapViewContainer.value?.classList?.replace("show-map", "hide-map"),
|
|
342
|
+
t === "ready" && this._currentPage !== "editing" ? (this._mapViewContainer.value?.classList?.replace("show-map", "hide-map"), setTimeout(() => {
|
|
305
343
|
this._setFloorLevel(this.floorLevel), this._aiAnalysisInfo?.results && this._setAttributeValuesFromAIAnalysis();
|
|
306
344
|
}, 500), !this.allowMultipleCreation && this._editor.value?.activeWorkflow && (this._editor.value.activeWorkflow.data.creationInfo.maxFeatures = 1), this._currentPage = "featureForm", this.progressStatus.emit(100), this.drawComplete.emit(!1)) : t === "disabled" && this.allowMultipleCreation && this._currentPage !== "editing" && (this._currentPage = "drawingMultipleFeatures");
|
|
307
345
|
})), this.allowMultipleCreation && e.activeWorkflow && (this._activeFeatureCountHandler || (this._activeFeatureCountHandler = y.watch(() => e.activeWorkflow?.data?.viewModel?.activeFeatureCount, (t) => {
|
|
@@ -349,17 +387,17 @@ class N extends k {
|
|
|
349
387
|
const i = "includeDefaultSources", a = e.sources;
|
|
350
388
|
return a && a?.length > 0 ? (e[i] = !1, a.forEach((s) => {
|
|
351
389
|
if (s.hasOwnProperty("layer")) {
|
|
352
|
-
const
|
|
353
|
-
h ?
|
|
390
|
+
const n = s, l = n.layer?.id, h = l ? t.map?.findLayerById(l) : "", d = n?.layer?.url;
|
|
391
|
+
h ? n.layer = h : d && (n.layer = new $(d));
|
|
354
392
|
}
|
|
355
393
|
}), a?.forEach((s) => {
|
|
356
394
|
if (s.hasOwnProperty("locator")) {
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
const
|
|
360
|
-
|
|
395
|
+
const n = s;
|
|
396
|
+
if (n?.name === "ArcGIS World Geocoding Service") {
|
|
397
|
+
const l = n.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
|
|
398
|
+
n.outFields = l, n.singleLineFieldName = "SingleLine";
|
|
361
399
|
}
|
|
362
|
-
|
|
400
|
+
n.url = n.url, delete n.url;
|
|
363
401
|
}
|
|
364
402
|
})) : e = {
|
|
365
403
|
...e,
|
|
@@ -376,12 +414,12 @@ class N extends k {
|
|
|
376
414
|
const s = this._editor.value?.activeWorkflow;
|
|
377
415
|
s?.formViewModel && (s.formViewModel?.setValue?.(a.name, e), a.editable = !1);
|
|
378
416
|
} else if (t.formTemplate && this.formElements) {
|
|
379
|
-
const s = new
|
|
417
|
+
const s = new P({
|
|
380
418
|
expression: `'${e}'`,
|
|
381
419
|
name: "floor-info-test",
|
|
382
420
|
title: "Floor Info",
|
|
383
421
|
returnType: "string"
|
|
384
|
-
}),
|
|
422
|
+
}), o = new C({
|
|
385
423
|
label: i,
|
|
386
424
|
editableExpression: "false",
|
|
387
425
|
fieldName: i,
|
|
@@ -392,16 +430,16 @@ class N extends k {
|
|
|
392
430
|
},
|
|
393
431
|
valueExpression: s.name
|
|
394
432
|
});
|
|
395
|
-
this._updatedMapView?.map.editableLayers.forEach((
|
|
396
|
-
const
|
|
397
|
-
if (d.push(
|
|
398
|
-
const
|
|
399
|
-
title:
|
|
400
|
-
description:
|
|
433
|
+
this._updatedMapView?.map.editableLayers.forEach((n) => {
|
|
434
|
+
const l = this.formElements.orgElements, h = this.formElements.orgExpressionInfos, d = [...l];
|
|
435
|
+
if (d.push(o), n.type === "feature") {
|
|
436
|
+
const m = n, p = new S({
|
|
437
|
+
title: m?.formTemplate?.title,
|
|
438
|
+
description: m?.formTemplate?.description,
|
|
401
439
|
elements: d,
|
|
402
440
|
expressionInfos: [s].concat(h)
|
|
403
441
|
});
|
|
404
|
-
|
|
442
|
+
n.formTemplate = p;
|
|
405
443
|
}
|
|
406
444
|
});
|
|
407
445
|
}
|
|
@@ -482,58 +520,14 @@ class N extends k {
|
|
|
482
520
|
i?.querySelector("header")?.setAttribute("style", "display: none"), i?.querySelector("footer")?.setAttribute("style", "display: none");
|
|
483
521
|
});
|
|
484
522
|
}
|
|
485
|
-
async submitted(e) {
|
|
486
|
-
let t = !1;
|
|
487
|
-
if (e.invalid.length) {
|
|
488
|
-
this._isSubmitBtnClicked = !1;
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
if (this._isSubmitBtnClicked) {
|
|
492
|
-
this._isSubmitBtnClicked = !1;
|
|
493
|
-
try {
|
|
494
|
-
if (this._editor.value?.activeWorkflow) {
|
|
495
|
-
if (this._selectedLayer && this._selectedLayer.capabilities.data.supportsAttachment && this._selectedImageBase64 && (t = !0), t) {
|
|
496
|
-
const i = this._selectedLayer?.on("edits", async (a) => {
|
|
497
|
-
if (a.addedFeatures.length > 0) {
|
|
498
|
-
const s = a.addedFeatures[0].objectId;
|
|
499
|
-
try {
|
|
500
|
-
if (this._uploadedImage && this._selectedLayer) {
|
|
501
|
-
const n = this._uploadedImage, o = new FormData();
|
|
502
|
-
o.set("keywords", "ai-image"), o.set("attachment", n), o.append("f", "json");
|
|
503
|
-
const r = new F({
|
|
504
|
-
attributes: {
|
|
505
|
-
[this._selectedLayer.objectIdField]: s
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
await this._selectedLayer.addAttachment(r, o);
|
|
509
|
-
}
|
|
510
|
-
} catch (n) {
|
|
511
|
-
console.error("Attachment upload failed", n);
|
|
512
|
-
}
|
|
513
|
-
i?.remove(), this.success.emit();
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
await this._editor.value.activeWorkflow.commit(), this._editor.value.activeWorkflow.failures?.length && this._editor.value.activeWorkflow.failures.some((i) => {
|
|
518
|
-
if (i.error)
|
|
519
|
-
throw i.error;
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
|
-
} catch (i) {
|
|
523
|
-
this.fail.emit(i);
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
t || this.success.emit();
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
523
|
async timeout(e) {
|
|
530
524
|
return await new Promise((t) => setTimeout(t, e));
|
|
531
525
|
}
|
|
532
526
|
_removeHandlers() {
|
|
533
|
-
this._drawingHandler?.remove(), this._featureFormHandler?.remove(), this._activeFeatureCountHandler?.remove();
|
|
527
|
+
this._drawingHandler?.remove(), this._featureFormHandler?.remove(), this._activeFeatureCountHandler?.remove(), this._layerEditsHandler?.remove();
|
|
534
528
|
}
|
|
535
529
|
}
|
|
536
|
-
|
|
530
|
+
I("create-feature", N);
|
|
537
531
|
export {
|
|
538
532
|
N as CreateFeature
|
|
539
533
|
};
|
|
@@ -243,7 +243,7 @@ class M extends $ {
|
|
|
243
243
|
this._createRelatedFeature.value && (this._showSubmitCancelButton = !1), this.backFromSelectedPanel();
|
|
244
244
|
}
|
|
245
245
|
createFeatureFailed(e) {
|
|
246
|
-
console.error(e.detail), this._featureCreationFailedErrorMsg = e.detail.message;
|
|
246
|
+
console.error(e.detail), this._showSubmitCancelButton = !1, this._featureCreationFailedErrorMsg = e.detail.message;
|
|
247
247
|
}
|
|
248
248
|
async onReportSubmitted() {
|
|
249
249
|
this._showSubmitCancelButton = !1, this.updateNonVisibleLayersOnMap(!1), await this.navigateToHomePage(), this._reportSubmitted = !0, this._updatedProgressBarStatus = 25, this._showFullPanel && this.updatePanelState(this._sidePanelCollapsed, !1);
|
|
@@ -239,6 +239,8 @@ export abstract class LayerTable extends LitElement {
|
|
|
239
239
|
readonly featuresAdded: import("@arcgis/lumina").TargetedEvent<this, (number | string)[]>;
|
|
240
240
|
/** Emitted on demand when a layer is selected */
|
|
241
241
|
readonly featureSelectionChange: import("@arcgis/lumina").TargetedEvent<this, (number | string)[]>;
|
|
242
|
+
/** Emitted when the create feature component should be shown */
|
|
243
|
+
readonly initCreateComponent: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
242
244
|
/** Emitted on demand when paste action is clicked */
|
|
243
245
|
readonly pasteFeatures: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
244
246
|
/** Emitted when related record toggled from related table */
|
|
@@ -255,6 +257,7 @@ export abstract class LayerTable extends LitElement {
|
|
|
255
257
|
editMultipleFeatures: LayerTable["editMultipleFeatures"]["detail"];
|
|
256
258
|
featuresAdded: LayerTable["featuresAdded"]["detail"];
|
|
257
259
|
featureSelectionChange: LayerTable["featureSelectionChange"]["detail"];
|
|
260
|
+
initCreateComponent: LayerTable["initCreateComponent"]["detail"];
|
|
258
261
|
pasteFeatures: LayerTable["pasteFeatures"]["detail"];
|
|
259
262
|
relatedRecordToggled: LayerTable["relatedRecordToggled"]["detail"];
|
|
260
263
|
requestLayerSelectionChange: LayerTable["requestLayerSelectionChange"]["detail"];
|