@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.
Files changed (52) hide show
  1. package/dist/cdn/CSS4AELA.js +2 -0
  2. package/dist/cdn/EVGXFAJU.js +2 -0
  3. package/dist/cdn/J5K2SIY6.js +4 -0
  4. package/dist/cdn/{HZOBBQYW.js → JSQHZGE3.js} +91 -91
  5. package/dist/cdn/RMCQZMLA.js +2 -0
  6. package/dist/cdn/U4A4FLFF.js +2 -0
  7. package/dist/cdn/{N2UNOXJ6.js → W5L4RUZC.js} +1 -1
  8. package/dist/cdn/{DYCGZ67C.js → WK7CB4GW.js} +1 -1
  9. package/dist/cdn/{6IMLSV3Z.js → YZVDT3ZT.js} +1 -1
  10. package/dist/cdn/Z4BCFJUQ.js +88 -0
  11. package/dist/cdn/ZTO4S3BZ.js +2 -0
  12. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
  13. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
  14. package/dist/cdn/assets/create-feature/t9n/messages.en.json +1 -1
  15. package/dist/cdn/assets/create-feature/t9n/messages.json +1 -1
  16. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.en.json +1 -1
  17. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.json +1 -1
  18. package/dist/cdn/index.js +1 -1
  19. package/dist/chunks/updateDesign.js +1 -1
  20. package/dist/components/arcgis-solutions-assistant/customElement.d.ts +6 -0
  21. package/dist/components/arcgis-solutions-assistant/customElement.js +340 -340
  22. package/dist/components/create-feature/customElement.d.ts +35 -3
  23. package/dist/components/create-feature/customElement.js +176 -76
  24. package/dist/components/create-feature/index.js +2 -1
  25. package/dist/components/create-related-feature/customElement.d.ts +4 -4
  26. package/dist/components/create-related-feature/customElement.js +60 -80
  27. package/dist/components/create-related-feature/index.js +1 -0
  28. package/dist/components/crowdsource-reporter/customElement.d.ts +16 -2
  29. package/dist/components/crowdsource-reporter/customElement.js +75 -49
  30. package/dist/components/feature-list/customElement.d.ts +1 -1
  31. package/dist/components/feature-list/customElement.js +2 -2
  32. package/dist/components/layer-list/customElement.d.ts +1 -1
  33. package/dist/components/solution-builder-assistant/customElement.js +97 -98
  34. package/dist/docs/api.json +1 -1
  35. package/dist/docs/docs.json +1 -1
  36. package/dist/docs/vscode.html-custom-data.json +1 -1
  37. package/dist/docs/web-types.json +1 -1
  38. package/dist/loader.js +2 -2
  39. package/dist/solutions-components_commit.txt +7 -7
  40. package/dist/types/lumina.d.ts +2 -2
  41. package/dist/types/preact.d.ts +2 -2
  42. package/dist/types/react.d.ts +2 -2
  43. package/dist/types/stencil.d.ts +2 -2
  44. package/dist/utils/interfaces.d.ts +17 -0
  45. package/package.json +1 -1
  46. package/dist/cdn/53MDMQSB.js +0 -88
  47. package/dist/cdn/H4YPSJ5G.js +0 -2
  48. package/dist/cdn/KLCBAO3U.js +0 -4
  49. package/dist/cdn/NSKVOAA7.js +0 -2
  50. package/dist/cdn/ODB4CELR.js +0 -2
  51. package/dist/cdn/QYWT7Y5Q.js +0 -2
  52. 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 u } from "../../chunks/runtime.js";
3
- import { u as m } from "../../chunks/useT9n.js";
4
- import { css as p, html as c } from "lit";
5
- import { LitElement as f, createEvent as d, noShadowRoot as w, safeClassMap as b } from "@arcgis/lumina";
6
- import y from "@arcgis/core/widgets/Editor.js";
7
- import * as l from "@arcgis/core/core/reactiveUtils.js";
8
- const _ = 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 g extends f {
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 = m({ name: "create-related-feature", blocking: !0 }), this._addingAttachment = !1, this._isSubmitBtnClicked = !1, this.success = d(), this.fail = d(), this.isActionPending = d(), this.formReady = d();
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 = w;
27
+ this.shadowRootOptions = g;
21
28
  }
22
29
  willUpdate(e) {
23
- e.has("mapView") && this.mapViewWatchHandler(), e.has("_editorLoading") && (this.hasUpdated || this._editorLoading !== !1) && this._editorLoadingWatchHandler(this._editorLoading);
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?.viewModel?.featureFormViewModel && (this._isSubmitBtnClicked = !0, this._editor.viewModel.featureFormViewModel.submit());
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 c`${this.showGuidingMsg && c`<calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.provideDetailsMsg}</div></calcite-notice>` || ""}<calcite-loader class=${b(e)} .label=${this._translations.loading} scale=s></calcite-loader>`;
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
- async createEditorWidget() {
50
- this._editor && this._editor.destroy(), this._container = document.createElement("div"), this._container?.classList.add("display-none"), this.enableSnapping || this._container.classList.add("hide-editor-toolbar"), this._editor = new y({
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 startCreate() {
45
+ async _startCreate() {
74
46
  const e = this.selectedFeature?.layer, t = this.table;
75
- if (e?.relationships && t?.relationships && this.selectedFeature && t.templates) {
76
- const a = e.relationships[0], i = t.relationships.find((o) => e.layerId === o.relatedTableId), s = Number(this.selectedFeature.getObjectId());
77
- if (!Number.isNaN(s) && i) {
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: [s],
80
- outFields: [e.objectIdField, a.keyField]
81
- })).features[0], n = t.templates[0], h = {
82
- attributeOverrides: this.makeAttributesForRelatedFeature(r, a, i),
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: n
56
+ template: l
85
57
  };
86
- await this._editor?.startCreateFeaturesWorkflowAtFeatureCreation(h), await this.hideEditorsElements(), this._editor?.viewModel?.featureFormViewModel?.addHandles(this._editor.viewModel.featureFormViewModel.on("submit", this.submitted.bind(this)));
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
- this.customizeSubmit && (await this.timeout(700), this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((e) => {
92
- const t = e.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");
93
- t?.querySelector("header")?.setAttribute("style", "display: none"), t?.querySelector("footer")?.setAttribute("style", "display: none");
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, a) {
97
- const i = t.keyField;
98
- let s;
99
- e.attributes.hasOwnProperty(i) ? s = e.getAttribute(i) : e.attributes.hasOwnProperty(i.toLowerCase()) ? s = e.getAttribute(i.toLowerCase()) : e.attributes.hasOwnProperty(i.toUpperCase()) && (s = e.getAttribute(i.toUpperCase()));
100
- let o = a.keyField;
101
- const r = this.table?.fields.find((n) => n.name.toLocaleLowerCase() === o.toLocaleLowerCase());
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]: s
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
- this._editor?.activeWorkflow && (await this._editor.activeWorkflow.commit(), this._editor.viewModel.failures?.length && this._editor.viewModel.failures.some((t) => {
116
- if (t.error)
117
- throw t.error;
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
- u("create-related-feature", g);
110
+ m("create-related-feature", k);
131
111
  export {
132
- g as CreateRelatedFeature
112
+ k as CreateRelatedFeature
133
113
  };
@@ -1,3 +1,4 @@
1
1
  import "@esri/calcite-components/components/calcite-notice";
2
2
  import "@esri/calcite-components/components/calcite-loader";
3
+ import "@arcgis/map-components/components/arcgis-editor";
3
4
  export * from "./customElement.js";
@@ -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 nessage to display when a comment is submitted
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
  *