@esri/solutions-components 5.1.0-next.129 → 5.1.0-next.130
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/CSS4AELA.js +2 -0
- package/dist/cdn/EVGXFAJU.js +2 -0
- package/dist/cdn/J5K2SIY6.js +4 -0
- package/dist/cdn/{HZOBBQYW.js → JSQHZGE3.js} +91 -91
- package/dist/cdn/RMCQZMLA.js +2 -0
- package/dist/cdn/U4A4FLFF.js +2 -0
- package/dist/cdn/{N2UNOXJ6.js → W5L4RUZC.js} +1 -1
- package/dist/cdn/{DYCGZ67C.js → WK7CB4GW.js} +1 -1
- package/dist/cdn/{6IMLSV3Z.js → YZVDT3ZT.js} +1 -1
- package/dist/cdn/Z4BCFJUQ.js +88 -0
- package/dist/cdn/ZTO4S3BZ.js +2 -0
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/create-feature/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/create-feature/t9n/messages.json +1 -1
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/updateDesign.js +1 -1
- package/dist/components/arcgis-solutions-assistant/customElement.d.ts +6 -0
- package/dist/components/arcgis-solutions-assistant/customElement.js +340 -340
- package/dist/components/create-feature/customElement.d.ts +35 -3
- package/dist/components/create-feature/customElement.js +176 -76
- package/dist/components/create-feature/index.js +2 -1
- package/dist/components/create-related-feature/customElement.d.ts +4 -4
- package/dist/components/create-related-feature/customElement.js +60 -80
- package/dist/components/create-related-feature/index.js +1 -0
- package/dist/components/crowdsource-reporter/customElement.d.ts +16 -2
- package/dist/components/crowdsource-reporter/customElement.js +75 -49
- package/dist/components/feature-list/customElement.d.ts +1 -1
- package/dist/components/feature-list/customElement.js +2 -2
- package/dist/components/layer-list/customElement.d.ts +1 -1
- package/dist/components/solution-builder-assistant/customElement.js +97 -98
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/interfaces.d.ts +17 -0
- package/package.json +1 -1
- package/dist/cdn/53MDMQSB.js +0 -88
- package/dist/cdn/H4YPSJ5G.js +0 -2
- package/dist/cdn/KLCBAO3U.js +0 -4
- package/dist/cdn/NSKVOAA7.js +0 -2
- package/dist/cdn/ODB4CELR.js +0 -2
- package/dist/cdn/QYWT7Y5Q.js +0 -2
- package/dist/cdn/UYOTCDME.js +0 -2
|
@@ -1,107 +1,83 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { css as p, html as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import y from "
|
|
7
|
-
import * as
|
|
8
|
-
const
|
|
9
|
-
class
|
|
2
|
+
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
+
import { u as f } from "../../chunks/useT9n.js";
|
|
4
|
+
import { css as p, html as d } from "lit";
|
|
5
|
+
import { LitElement as b, createEvent as n, noShadowRoot as g, safeClassMap as w } from "@arcgis/lumina";
|
|
6
|
+
import { createRef as y, ref as _ } from "lit-html/directives/ref.js";
|
|
7
|
+
import * as h from "@arcgis/core/core/reactiveUtils.js";
|
|
8
|
+
const v = p`@layer{:host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar,.display-none{display:none!important}.esri-editor__panel-content{padding-block:10px!important}.notice-msg{padding:10px;width:calc(100% - 20px)}}`;
|
|
9
|
+
class k extends b {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this.customizeSubmit = !1, this.enableSnapping = !1, this.showGuidingMsg = !0, this._editorLoading = !1, this._translations =
|
|
11
|
+
super(...arguments), this.customizeSubmit = !1, this.enableSnapping = !1, this.showGuidingMsg = !0, this._editorLoading = !1, this._translations = f({ name: "create-related-feature", blocking: !0 }), this._addingAttachment = !1, this._editor = y(), this._isSubmitBtnClicked = !1, this.success = n(), this.fail = n(), this.isActionPending = n(), this.formReady = n(), this._onEditorPropertyChange = () => {
|
|
12
|
+
const e = this._editor.value;
|
|
13
|
+
e && (h.watch(() => e.state, (t) => {
|
|
14
|
+
t === "adding-attachment" || t === "editing-attachment" ? (this._addingAttachment = !0, this.isActionPending.emit(!0)) : this._addingAttachment && (this.isActionPending.emit(!1), this._addingAttachment = !1);
|
|
15
|
+
}), h.watch(() => e.activeWorkflow?.formViewModel?.state, (t) => {
|
|
16
|
+
t === "ready" && this.formReady.emit();
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
12
19
|
}
|
|
13
20
|
static {
|
|
14
21
|
this.properties = { customizeSubmit: 5, enableSnapping: 5, mapView: 0, selectedFeature: 0, showGuidingMsg: 5, table: 0, _editorLoading: 16, _translations: 16 };
|
|
15
22
|
}
|
|
16
23
|
static {
|
|
17
|
-
this.styles =
|
|
24
|
+
this.styles = v;
|
|
18
25
|
}
|
|
19
26
|
static {
|
|
20
|
-
this.shadowRootOptions =
|
|
27
|
+
this.shadowRootOptions = g;
|
|
21
28
|
}
|
|
22
29
|
willUpdate(e) {
|
|
23
|
-
e.has("mapView")
|
|
24
|
-
}
|
|
25
|
-
async mapViewWatchHandler() {
|
|
26
|
-
await this.mapView?.when(async () => {
|
|
27
|
-
await this.init();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async _editorLoadingWatchHandler(e) {
|
|
31
|
-
e && (this._container?.classList.add("display-none"), await this.startCreate(), this._container?.classList.remove("display-none"), this._editorLoading = !1);
|
|
30
|
+
e.has("mapView");
|
|
32
31
|
}
|
|
33
32
|
async submit() {
|
|
34
|
-
this._editor?.
|
|
35
|
-
}
|
|
36
|
-
async init() {
|
|
37
|
-
this.mapView && await this.createEditorWidget();
|
|
33
|
+
this._editor.value?.activeWorkflow && (this._isSubmitBtnClicked = !0, this._editor.value.activeWorkflow?.formViewModel?.submit?.());
|
|
38
34
|
}
|
|
39
35
|
render() {
|
|
40
36
|
const e = this._editorLoading ? "" : "display-none";
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
loaded() {
|
|
44
|
-
this.init();
|
|
37
|
+
return d`${this.showGuidingMsg && d`<calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.provideDetailsMsg}</div></calcite-notice>` || ""}<calcite-loader class=${w(e)} .label=${this._translations.loading} scale=s></calcite-loader>${this.mapView && this._getEditor() || ""}`;
|
|
45
38
|
}
|
|
46
39
|
disconnectedCallback() {
|
|
47
|
-
super.disconnectedCallback(), this._editor && this._editor.destroy();
|
|
40
|
+
super.disconnectedCallback(), this._editor.value && this._editor.value.destroy();
|
|
48
41
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
view: this.mapView,
|
|
52
|
-
visibleElements: {
|
|
53
|
-
flow: !0,
|
|
54
|
-
settingsMenu: this.enableSnapping,
|
|
55
|
-
sketch: !1,
|
|
56
|
-
snappingControls: this.enableSnapping
|
|
57
|
-
},
|
|
58
|
-
container: this._container
|
|
59
|
-
}), this.el.appendChild(this._container);
|
|
60
|
-
const e = l.watch(() => this._editor?.viewModel.featureTemplatesViewModel.state, (i) => {
|
|
61
|
-
i === "ready" && (this._editorLoading = !0);
|
|
62
|
-
});
|
|
63
|
-
this._editor?.viewModel.addHandles(e);
|
|
64
|
-
const t = l.watch(() => this._editor?.viewModel.state, (i) => {
|
|
65
|
-
i === "adding-attachment" || i === "editing-attachment" ? (this._addingAttachment = !0, this.isActionPending.emit(!0)) : this._addingAttachment && (this.isActionPending.emit(!1), this._addingAttachment = !1);
|
|
66
|
-
});
|
|
67
|
-
this._editor?.viewModel.addHandles(t);
|
|
68
|
-
const a = l.watch(() => this._editor?.viewModel.featureFormViewModel?.state, (i) => {
|
|
69
|
-
i === "ready" && this.formReady.emit();
|
|
70
|
-
});
|
|
71
|
-
this._editor?.viewModel.addHandles(a);
|
|
42
|
+
_getEditor() {
|
|
43
|
+
return d`<arcgis-editor .view=${this.mapView} hide-edit-features-section .hideSettingsMenu=${!this.enableSnapping} hide-sketch .hideSnappingControlsElementsEnabledToggle=${!this.enableSnapping} @arcgisReady=${this._startCreate} @arcgisPropertyChange=${this._onEditorPropertyChange} ${_(this._editor)}></arcgis-editor>`;
|
|
72
44
|
}
|
|
73
|
-
async
|
|
45
|
+
async _startCreate() {
|
|
74
46
|
const e = this.selectedFeature?.layer, t = this.table;
|
|
75
|
-
if (e
|
|
76
|
-
const
|
|
77
|
-
if (!Number.isNaN(
|
|
47
|
+
if (e.relationships && t?.relationships && this.selectedFeature && t.templates) {
|
|
48
|
+
const i = e.relationships[0], s = t.relationships.find((o) => e.layerId === o.relatedTableId), a = Number(this.selectedFeature.getObjectId());
|
|
49
|
+
if (!Number.isNaN(a) && s) {
|
|
78
50
|
const r = (await e.queryFeatures({
|
|
79
|
-
objectIds: [
|
|
80
|
-
outFields: [e.objectIdField,
|
|
81
|
-
})).features[0],
|
|
82
|
-
attributeOverrides: this.makeAttributesForRelatedFeature(r,
|
|
51
|
+
objectIds: [a],
|
|
52
|
+
outFields: [e.objectIdField, i.keyField]
|
|
53
|
+
})).features[0], l = t.templates[0], u = {
|
|
54
|
+
attributeOverrides: this.makeAttributesForRelatedFeature(r, i, s),
|
|
83
55
|
layer: t,
|
|
84
|
-
template:
|
|
56
|
+
template: l
|
|
85
57
|
};
|
|
86
|
-
await this._editor?.startCreateFeaturesWorkflowAtFeatureCreation(
|
|
58
|
+
await this._editor.value?.startCreateFeaturesWorkflowAtFeatureCreation(u), await this.hideEditorsElements();
|
|
59
|
+
const c = this._editor.value?.activeWorkflow?.formViewModel;
|
|
60
|
+
c && this._editor.value?.activeWorkflow?.formViewModel?.addHandles(c.on("submit", this.submitted.bind(this)));
|
|
87
61
|
}
|
|
88
62
|
}
|
|
89
63
|
}
|
|
90
64
|
async hideEditorsElements() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
if (!this.customizeSubmit)
|
|
66
|
+
return;
|
|
67
|
+
await this.timeout(700), this.el.querySelector("arcgis-editor")?.shadowRoot?.querySelectorAll("calcite-flow-item")?.forEach((t) => {
|
|
68
|
+
const i = t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");
|
|
69
|
+
i?.querySelector("header")?.setAttribute("style", "display: none"), i?.querySelector("footer")?.setAttribute("style", "display: none");
|
|
70
|
+
});
|
|
95
71
|
}
|
|
96
|
-
makeAttributesForRelatedFeature(e, t,
|
|
97
|
-
const
|
|
98
|
-
let
|
|
99
|
-
e.attributes.hasOwnProperty(
|
|
100
|
-
let o =
|
|
101
|
-
const r = this.table?.fields.find((
|
|
72
|
+
makeAttributesForRelatedFeature(e, t, i) {
|
|
73
|
+
const s = t.keyField;
|
|
74
|
+
let a;
|
|
75
|
+
e.attributes.hasOwnProperty(s) ? a = e.getAttribute(s) : e.attributes.hasOwnProperty(s.toLowerCase()) ? a = e.getAttribute(s.toLowerCase()) : e.attributes.hasOwnProperty(s.toUpperCase()) && (a = e.getAttribute(s.toUpperCase()));
|
|
76
|
+
let o = i.keyField;
|
|
77
|
+
const r = this.table?.fields.find((l) => l.name.toLocaleLowerCase() === o.toLocaleLowerCase());
|
|
102
78
|
if (r)
|
|
103
79
|
return o = r.name, {
|
|
104
|
-
[o]:
|
|
80
|
+
[o]: a
|
|
105
81
|
};
|
|
106
82
|
}
|
|
107
83
|
async submitted(e) {
|
|
@@ -112,10 +88,14 @@ class g extends f {
|
|
|
112
88
|
if (e.valid.length && this._isSubmitBtnClicked) {
|
|
113
89
|
this._isSubmitBtnClicked = !1;
|
|
114
90
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
91
|
+
if (this._editor.value?.activeWorkflow) {
|
|
92
|
+
await this._editor.value.activeWorkflow.commit();
|
|
93
|
+
const t = this._editor.value.activeWorkflow.failures;
|
|
94
|
+
t?.length && t.some((i) => {
|
|
95
|
+
if (i.error)
|
|
96
|
+
throw i.error;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
119
99
|
} catch (t) {
|
|
120
100
|
this.fail.emit(t);
|
|
121
101
|
return;
|
|
@@ -124,10 +104,10 @@ class g extends f {
|
|
|
124
104
|
}
|
|
125
105
|
}
|
|
126
106
|
async timeout(e) {
|
|
127
|
-
return new Promise((t) => setTimeout(t, e));
|
|
107
|
+
return await new Promise((t) => setTimeout(t, e));
|
|
128
108
|
}
|
|
129
109
|
}
|
|
130
|
-
|
|
110
|
+
m("create-related-feature", k);
|
|
131
111
|
export {
|
|
132
|
-
|
|
112
|
+
k as CreateRelatedFeature
|
|
133
113
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type MapView from "@arcgis/core/views/MapView.js";
|
|
3
|
-
import type { IImageExtraction, ILayerExpression, IMapInfo, IReportingOptions, ISearchConfiguration, theme } from "../../utils/interfaces.js";
|
|
3
|
+
import type { IImageExtraction, ILayerExpression, IMapInfo, IReportingOptions, ISearchConfiguration, ISortFields, ITextExtraction, theme } from "../../utils/interfaces.js";
|
|
4
4
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
6
|
|
|
@@ -38,6 +38,8 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
38
38
|
sortOldest: string;
|
|
39
39
|
sortHighestVoted: string;
|
|
40
40
|
sortLowestVoted: string;
|
|
41
|
+
sortAlphabetical: string;
|
|
42
|
+
reverseSortAlphabetical: string;
|
|
41
43
|
resetFilter: string;
|
|
42
44
|
close: string;
|
|
43
45
|
submitBelow: string;
|
|
@@ -73,6 +75,8 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
73
75
|
sortOldest: string;
|
|
74
76
|
sortHighestVoted: string;
|
|
75
77
|
sortLowestVoted: string;
|
|
78
|
+
sortAlphabetical: string;
|
|
79
|
+
reverseSortAlphabetical: string;
|
|
76
80
|
resetFilter: string;
|
|
77
81
|
close: string;
|
|
78
82
|
submitBelow: string;
|
|
@@ -84,6 +88,8 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
84
88
|
}>;
|
|
85
89
|
/** array: Configured AI image extraction field and prompt for the selected LayerId */
|
|
86
90
|
accessor aiImageExtraction: IImageExtraction[];
|
|
91
|
+
/** array: Configured AI text extraction field and prompt for the selected LayerId */
|
|
92
|
+
accessor aiTextExtraction: ITextExtraction[];
|
|
87
93
|
/**
|
|
88
94
|
* string: Semicolon delimited numbers that will be used as the maps center point from URL params
|
|
89
95
|
*
|
|
@@ -97,7 +103,7 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
97
103
|
*/
|
|
98
104
|
accessor commentButtonText: string;
|
|
99
105
|
/**
|
|
100
|
-
* string: User configurable
|
|
106
|
+
* string: User configurable message to display when a comment is submitted
|
|
101
107
|
*
|
|
102
108
|
* @default ''
|
|
103
109
|
*/
|
|
@@ -144,6 +150,12 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
144
150
|
* @default false
|
|
145
151
|
*/
|
|
146
152
|
accessor enableLogin: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* boolean: When true photo get location from the message selected for AI text Extraction
|
|
155
|
+
*
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
accessor enableMessageLocation: boolean;
|
|
147
159
|
/**
|
|
148
160
|
* boolean: When true the user will be allowed to submit new reports
|
|
149
161
|
*
|
|
@@ -292,6 +304,8 @@ export abstract class CrowdsourceReporter extends LitElement {
|
|
|
292
304
|
* @default false
|
|
293
305
|
*/
|
|
294
306
|
accessor showUserImageInCommentsList: boolean;
|
|
307
|
+
/** ISortFields: Configuration for sorting fields */
|
|
308
|
+
accessor sortFields: ISortFields | undefined;
|
|
295
309
|
/**
|
|
296
310
|
* string: sorting option to show the feature list
|
|
297
311
|
*
|