@esri/solutions-components 5.1.0-next.104 → 5.1.0-next.106

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 (89) hide show
  1. package/dist/cdn/3SBBPBXS.js +2 -0
  2. package/dist/cdn/4SJS3AAR.js +2 -0
  3. package/dist/cdn/AHGEJEUD.js +385 -0
  4. package/dist/cdn/AXMPMDEB.js +2 -0
  5. package/dist/cdn/{JMVHSWQR.js → FBE7FIV6.js} +1 -1
  6. package/dist/cdn/GYL4W6ZG.js +33 -0
  7. package/dist/cdn/JQLLXM7G.js +11 -0
  8. package/dist/cdn/MZXUUA7G.js +16 -0
  9. package/dist/cdn/{CGCDR6AO.js → O5WDG5KL.js} +1 -1
  10. package/dist/cdn/{D6D5Y5L4.js → OMY6UWJY.js} +1 -1
  11. package/dist/cdn/PPRYGYWD.js +2 -0
  12. package/dist/cdn/RHQMSPFV.js +2 -0
  13. package/dist/cdn/{NHBGCM7D.js → XI7NTLLE.js} +1 -1
  14. package/dist/cdn/{EW4O5UX4.js → ZM32VKIW.js} +1 -1
  15. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
  16. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
  17. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
  18. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
  19. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
  20. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
  21. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
  22. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
  23. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
  24. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
  25. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
  26. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
  27. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
  28. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
  29. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
  30. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
  31. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
  32. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
  33. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
  34. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
  35. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
  36. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
  37. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
  38. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
  39. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
  40. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
  41. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
  42. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
  43. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
  44. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
  45. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
  46. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
  47. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
  48. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
  49. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
  50. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
  51. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
  52. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
  53. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
  54. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
  55. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
  56. package/dist/cdn/index.js +1 -1
  57. package/dist/chunks/description.js +32 -31
  58. package/dist/chunks/solutions_assistant_description.js +8 -26
  59. package/dist/chunks/solutions_explorer_description.js +13 -25
  60. package/dist/components/arcgis-solutions-assistant/customElement.js +13154 -10426
  61. package/dist/components/map-draw-tools/customElement.d.ts +5 -5
  62. package/dist/components/map-draw-tools/customElement.js +80 -114
  63. package/dist/components/map-draw-tools/index.js +1 -0
  64. package/dist/components/map-layer-picker/customElement.js +9 -9
  65. package/dist/components/map-select-tools/customElement.d.ts +13 -6
  66. package/dist/components/map-select-tools/customElement.js +43 -54
  67. package/dist/components/map-select-tools/index.js +1 -0
  68. package/dist/components/public-notification/customElement.d.ts +5 -5
  69. package/dist/components/public-notification/customElement.js +34 -34
  70. package/dist/components/refine-selection/customElement.js +17 -17
  71. package/dist/components/solution-builder-assistant/customElement.d.ts +6 -0
  72. package/dist/components/solution-builder-assistant/customElement.js +71 -39
  73. package/dist/components/solution-builder-assistant/index.js +1 -0
  74. package/dist/components/solution-details-card/customElement.js +5 -5
  75. package/dist/docs/api.json +1 -1
  76. package/dist/docs/docs.json +1 -1
  77. package/dist/docs/vscode.html-custom-data.json +1 -1
  78. package/dist/docs/web-types.json +1 -1
  79. package/dist/solutions-components_commit.txt +8 -5
  80. package/package.json +1 -1
  81. package/dist/cdn/224TOFAW.js +0 -29
  82. package/dist/cdn/36TEZXBH.js +0 -28
  83. package/dist/cdn/64ZLSOK3.js +0 -2
  84. package/dist/cdn/6GOYDVLJ.js +0 -2
  85. package/dist/cdn/7JOL6EOJ.js +0 -2
  86. package/dist/cdn/M6HNHWAM.js +0 -32
  87. package/dist/cdn/PCZFIXAY.js +0 -2
  88. package/dist/cdn/RSS5TMGK.js +0 -384
  89. package/dist/cdn/VBOMEOGC.js +0 -2
@@ -49,20 +49,20 @@ export abstract class MapDrawTools extends LitElement {
49
49
  accessor graphics: Graphic[];
50
50
  /** esri/views/View: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html */
51
51
  accessor mapView: MapView | undefined;
52
- /** esri/symbols/SimpleMarkerSymbol: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html */
52
+ /** SimpleMarkerSymbol: Point symbol used for sketching and updating point graphics */
53
53
  accessor pointSymbol: SimpleMarkerSymbol | undefined;
54
- /** esri/symbols/SimpleFillSymbol: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html */
54
+ /** SimpleFillSymbol: Polygon symbol used for sketching and updating polygon graphics */
55
55
  accessor polygonSymbol: SimpleFillSymbol | undefined;
56
- /** esri/symbols/SimpleLineSymbol: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html */
56
+ /** SimpleLineSymbol: Polyline symbol used for sketching and updating polyline graphics */
57
57
  accessor polylineSymbol: SimpleLineSymbol | undefined;
58
58
  /**
59
- * boolean: when eanbled the user can redo the previous operation
59
+ * boolean: when enabled the user can redo the previous operation
60
60
  *
61
61
  * @default false
62
62
  */
63
63
  accessor redoEnabled: boolean;
64
64
  /**
65
- * boolean: when eanbled the user can undo the previous operation
65
+ * boolean: when enabled the user can undo the previous operation
66
66
  *
67
67
  * @default false
68
68
  */
@@ -1,39 +1,78 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as r } from "../../chunks/runtime.js";
2
+ import { c as h } from "../../chunks/runtime.js";
3
3
  import { u as c } from "../../chunks/useT9n.js";
4
- import { css as l, html as n } from "lit";
5
- import { createRef as d, ref as p } from "lit-html/directives/ref.js";
6
- import { LitElement as g, createEvent as o, noShadowRoot as m, safeClassMap as h } from "@arcgis/lumina";
7
- import { useContextConsumer as f } from "@arcgis/lumina/context";
8
- import { p as y } from "../../chunks/publicNotificationContext.js";
9
- import _ from "@arcgis/core/layers/GraphicsLayer.js";
10
- import k from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
11
- import w from "@arcgis/core/widgets/Sketch.js";
12
- const u = l`@layer{:host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=rtl]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:Avenir Next,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v: 12px;--esri-widget-padding-h: 15px;--esri-widget-padding: var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start!important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-responsive-toolbar__bar--horizontal{--calcite-action-group-border-color: var(--calcite-color-border-3) !important}}`;
13
- class b extends g {
4
+ import { css as n, html as l } from "lit";
5
+ import { createRef as p, ref as d } from "lit-html/directives/ref.js";
6
+ import { LitElement as m, createEvent as a, noShadowRoot as g, safeClassMap as o } from "@arcgis/lumina";
7
+ import { useContextConsumer as _ } from "@arcgis/lumina/context";
8
+ import { p as u } from "../../chunks/publicNotificationContext.js";
9
+ import y from "@arcgis/core/layers/GraphicsLayer.js";
10
+ const f = n`@layer{:host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=rtl]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:Avenir Next,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v: 12px;--esri-widget-padding-h: 15px;--esri-widget-padding: var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start!important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-responsive-toolbar__bar--horizontal{--calcite-action-group-border-color: var(--calcite-color-border-3) !important}}`;
11
+ class k extends m {
14
12
  constructor() {
15
- super(...arguments), this.active = !1, this.drawMode = "SKETCH", this.editGraphicsEnabled = !0, this.graphics = [], this.redoEnabled = !1, this.undoEnabled = !1, this._translations = c({ name: "map-draw-tools", blocking: !0 }), this._pnContextConsumer = f({
16
- context: y,
13
+ super(...arguments), this.active = !1, this.drawMode = "SKETCH", this.editGraphicsEnabled = !0, this.graphics = [], this.redoEnabled = !1, this.undoEnabled = !1, this._translations = c({ name: "map-draw-tools", blocking: !0 }), this._pnContextConsumer = _({
14
+ context: u,
17
15
  subscribe: !0
18
- }), this._sketchElement = d(), this.selectionLoadingChange = o(), this.sketchGraphicsChange = o(), this.drawUndo = o(), this.drawRedo = o();
16
+ }), this._sketchComponent = p(), this._forceCreate = !1, this.selectionLoadingChange = a(), this.sketchGraphicsChange = a(), this.drawUndo = a(), this.drawRedo = a(), this._onSketchReady = async () => {
17
+ await new Promise((t) => setTimeout(t, 50)), this._sketchComponent.value?.getElementsByTagName("calcite-popover")[0]?.setAttribute("placement", "auto");
18
+ }, this._onSketchCreate = (e) => {
19
+ const t = e.detail;
20
+ t.state === "complete" && (this.graphics = t.graphic ? [t.graphic] : [], this.sketchGraphicsChange.emit({
21
+ graphics: this.graphics,
22
+ useOIDs: !1
23
+ }), this.drawMode === "REFINE" && (this._forceCreate = !0, this._sketchComponent.value?.create(t.tool))), t.state === "cancel" && this.drawMode === "REFINE" && this._forceCreate && (this._forceCreate = !this._forceCreate, this._sketchComponent.value?.create(t.tool));
24
+ }, this._onSketchUpdate = (e) => {
25
+ if (!this.editGraphicsEnabled) {
26
+ this._sketchComponent.value?.cancel();
27
+ return;
28
+ }
29
+ const t = e.detail, i = t.toolEventInfo?.type;
30
+ (t.state === "active" && i === "update" || i === "move" || i === "reshape-stop" || i === "move-stop") && (clearTimeout(this._debounceTimer), this._debounceTimer = window.setTimeout(() => {
31
+ this.graphics = t.graphics, this.sketchGraphicsChange.emit({
32
+ graphics: this.graphics,
33
+ useOIDs: !1
34
+ });
35
+ }, 1e3));
36
+ }, this._onSketchDelete = () => {
37
+ this.graphics = [], this.sketchGraphicsChange.emit({
38
+ graphics: this.graphics,
39
+ useOIDs: !1
40
+ });
41
+ }, this._onSketchUndo = (e) => {
42
+ if (this._sketchComponent.value?.state === "active")
43
+ return;
44
+ const t = e.detail;
45
+ this.graphics = t.graphics, this.sketchGraphicsChange.emit({
46
+ graphics: this.graphics,
47
+ useOIDs: !1
48
+ });
49
+ }, this._onSketchRedo = (e) => {
50
+ if (this._sketchComponent.value?.state === "active")
51
+ return;
52
+ const t = e.detail;
53
+ t.graphics[0].geometry && (this.graphics = t.graphics, this.sketchGraphicsChange.emit({
54
+ graphics: this.graphics,
55
+ useOIDs: !1
56
+ }));
57
+ };
19
58
  }
20
59
  static {
21
60
  this.properties = { active: 5, drawMode: 1, editGraphicsEnabled: 5, graphics: 0, mapView: 0, pointSymbol: 0, polylineSymbol: 0, polygonSymbol: 0, redoEnabled: 5, undoEnabled: 5, _translations: 16, _selectionMode: 16 };
22
61
  }
23
62
  static {
24
- this.styles = u;
63
+ this.styles = f;
25
64
  }
26
65
  static {
27
- this.shadowRootOptions = m;
66
+ this.shadowRootOptions = g;
28
67
  }
29
68
  willUpdate(e) {
30
69
  e.has("graphics") && this.graphicsWatchHandler(this.graphics, e.get("graphics")), e.has("mapView") && this.mapView && this.mapViewWatchHandler(this.mapView, e.get("mapView"));
31
70
  }
32
- graphicsWatchHandler(e, i) {
33
- e && e.length > 0 && JSON.stringify(e) !== JSON.stringify(i) && this._sketchGraphicsLayer && (this._updateGraphicsSymbols(e), this._sketchGraphicsLayer.removeAll(), this._sketchGraphicsLayer.addMany(e));
71
+ graphicsWatchHandler(e, t) {
72
+ e && e.length > 0 && JSON.stringify(e) !== JSON.stringify(t) && this._sketchGraphicsLayer && (this._updateGraphicsSymbols(e), this._sketchGraphicsLayer.removeAll(), this._sketchGraphicsLayer.addMany(e));
34
73
  }
35
- mapViewWatchHandler(e, i) {
36
- e && e !== i && this._init();
74
+ mapViewWatchHandler(e, t) {
75
+ e && e !== t && this._init();
37
76
  }
38
77
  async clear() {
39
78
  this._clearSketch();
@@ -45,101 +84,34 @@ class b extends g {
45
84
  this._init();
46
85
  }
47
86
  disconnectedCallback() {
48
- super.disconnectedCallback(), this._sketchWidget?.cancel(), this._clearSketch();
87
+ super.disconnectedCallback(), this._sketchComponent.value?.cancel(), this._clearSketch();
49
88
  }
50
89
  render() {
51
- const e = this.drawMode === "SKETCH" ? "border" : "border esri-widget esri-sketch__panel", i = this.drawMode === "SKETCH" ? "display-none" : "esri-widget esri-sketch__panel border-left esri-sketch__section";
52
- return n`<div class=${h(e)}><div ${p(this._sketchElement)}></div><div class=${h(i)}><calcite-action appearance=solid .disabled=${!this.undoEnabled} icon=undo @click=${() => this._undo()} scale=s .text=${this._translations.undo}></calcite-action><calcite-action appearance=solid .disabled=${!this.redoEnabled} icon=redo @click=${() => this._redo()} scale=s .text=${this._translations.redo}></calcite-action></div></div>`;
90
+ const e = this.drawMode === "SKETCH" ? "border" : "border esri-widget esri-sketch__panel", t = this.drawMode === "SKETCH" ? "display-none" : "esri-widget esri-sketch__panel border-left esri-sketch__section";
91
+ return l`<div class=${o(e)}><arcgis-sketch @arcgisReady=${this._onSketchReady} @arcgisCreate=${this._onSketchCreate} @arcgisUpdate=${this._onSketchUpdate} @arcgisDelete=${this._onSketchDelete} @arcgisUndo=${this._onSketchUndo} @arcgisRedo=${this._onSketchRedo} ${d(this._sketchComponent)}></arcgis-sketch><div class=${o(t)}><calcite-action .disabled=${!this.undoEnabled} icon=undo @click=${() => this._undo()} scale=s .text=${this._translations.undo}></calcite-action><calcite-action .disabled=${!this.redoEnabled} icon=redo @click=${() => this._redo()} scale=s .text=${this._translations.redo}></calcite-action></div></div>`;
53
92
  }
54
93
  _init() {
55
- this.mapView && this._sketchElement.value && (this._initGraphicsLayer(), this._initSketch());
94
+ this.mapView && (this._initGraphicsLayer(), this._initSketch());
56
95
  }
57
96
  _initGraphicsLayer() {
58
- const e = this._pnContextConsumer.value, i = this._translations.sketchLayer;
97
+ const e = this._pnContextConsumer.value, t = this._translations.sketchLayer;
59
98
  if (this.mapView) {
60
- const s = this.mapView.map.layers.findIndex((t) => t.title === i);
61
- s > -1 ? this._sketchGraphicsLayer = this.mapView.map.layers.getItemAt(s) : (this._sketchGraphicsLayer = new _({ title: i, listMode: "hide" }), this._sketchGraphicsLayer && (e.managedLayers[i] = "sketch", this.mapView.map.layers.add(this._sketchGraphicsLayer))), this.graphics && this.graphics.length > 0 && this._sketchGraphicsLayer && this._sketchGraphicsLayer.addMany(this.graphics);
99
+ const i = this.mapView.map.layers.findIndex((s) => s.title === t);
100
+ i > -1 ? this._sketchGraphicsLayer = this.mapView.map.layers.getItemAt(i) : (this._sketchGraphicsLayer = new y({ title: t, listMode: "hide" }), this._sketchGraphicsLayer && (e.managedLayers[t] = "sketch", this.mapView.map.layers.add(this._sketchGraphicsLayer))), this.graphics && this.graphics.length > 0 && this._sketchGraphicsLayer && this._sketchGraphicsLayer.addMany(this.graphics);
62
101
  }
63
102
  }
64
103
  _initSketch() {
65
- const e = {
66
- layer: this._sketchGraphicsLayer,
67
- view: this.mapView,
68
- defaultCreateOptions: {
69
- mode: "hybrid"
70
- },
71
- defaultUpdateOptions: {
72
- preserveAspectRatio: !1,
73
- enableScaling: !1,
74
- enableRotation: !1,
75
- tool: "reshape",
76
- toggleToolOnClick: !1
77
- }
78
- };
79
- if (this._sketchWidget = new w({
80
- ...e,
81
- container: this._sketchElement.value,
82
- creationMode: "single",
83
- toolbarKind: "docked",
84
- useLegacyCreateTools: !0,
85
- visibleElements: {
86
- duplicateButton: !1,
87
- selectionTools: {
88
- "lasso-selection": !1,
89
- "rectangle-selection": !1
90
- },
91
- createTools: {
92
- circle: !1
93
- },
94
- undoRedoMenu: !1,
95
- settingsMenu: this.drawMode === "SKETCH"
96
- }
97
- }), this._sketchWidget && this._sketchWidget.viewModel) {
98
- this._sketchViewModel = new k({
99
- ...e
100
- }), this.polylineSymbol && (this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol), this.pointSymbol && (this._sketchWidget.viewModel.pointSymbol = this.pointSymbol), this.polygonSymbol && (this._sketchWidget.viewModel.polygonSymbol = this.polygonSymbol), this._sketchWidget?.when(async () => {
101
- await new Promise((a) => setTimeout(a, 50)), this._sketchElement.value?.getElementsByTagName("calcite-popover")[0]?.setAttribute("placement", "auto");
102
- });
103
- let i = !1;
104
- this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("create", (t) => {
105
- t.state === "complete" && (this.graphics = t.graphic ? [t.graphic] : [], this.sketchGraphicsChange.emit({
106
- graphics: this.graphics,
107
- useOIDs: !1
108
- }), this.drawMode === "REFINE" && (i = !0, this._sketchWidget?.viewModel.create(t.tool))), t.state === "cancel" && this.drawMode === "REFINE" && i && (i = !i, this._sketchWidget?.viewModel.create(t.tool));
109
- }));
110
- let s;
111
- this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("update", (t) => {
112
- if (!this.editGraphicsEnabled)
113
- this._sketchWidget?.viewModel.cancel(), this._sketchViewModel?.cancel();
114
- else {
115
- const a = t?.toolEventInfo?.type;
116
- (a === "move" || a === "reshape-stop" || a === "move-stop") && (clearTimeout(s), s = window.setTimeout(async () => {
117
- this.graphics = t.graphics, this.sketchGraphicsChange.emit({
118
- graphics: this.graphics,
119
- useOIDs: !1
120
- });
121
- }, 1e3));
122
- }
123
- })), this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("delete", () => {
124
- this.graphics = [], this.sketchGraphicsChange.emit({
125
- graphics: this.graphics,
126
- useOIDs: !1
127
- });
128
- })), this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("undo", (t) => {
129
- this.graphics = t.graphics, this.sketchGraphicsChange.emit({
130
- graphics: this.graphics,
131
- useOIDs: !1
132
- });
133
- })), this._sketchWidget.viewModel.addHandles(this._sketchWidget.on("redo", (t) => {
134
- this.graphics = t.graphics, this.sketchGraphicsChange.emit({
135
- graphics: this.graphics,
136
- useOIDs: !1
137
- });
138
- }));
139
- }
104
+ const e = this._sketchComponent.value;
105
+ e && (e.view = this.mapView, e.layer = this._sketchGraphicsLayer, e.creationMode = "single", e.toolbarKind = "docked", e.defaultCreateOptions = { mode: "hybrid" }, e.defaultUpdateOptions = {
106
+ preserveAspectRatio: !1,
107
+ enableScaling: !1,
108
+ enableRotation: !1,
109
+ tool: "reshape",
110
+ toggleToolOnClick: !1
111
+ }, e.hideDuplicateButton = !0, e.hideSelectionToolsLassoSelection = !0, e.hideSelectionToolsRectangleSelection = !0, e.hideCreateToolsCircle = !0, e.hideUndoRedoMenu = !0, e.hideSettingsMenu = this.drawMode !== "SKETCH", this.pointSymbol ? e.pointSymbol = this.pointSymbol : this.polylineSymbol ? e.polylineSymbol = this.polylineSymbol : this.polygonSymbol && (e.polygonSymbol = this.polygonSymbol));
140
112
  }
141
113
  _clearSketch() {
142
- this._sketchWidget?.viewModel.cancel(), this.graphics = [], this._sketchGraphicsLayer?.removeAll();
114
+ this._sketchComponent.value?.cancel(), this.graphics = [], this._sketchGraphicsLayer?.removeAll();
143
115
  }
144
116
  _undo() {
145
117
  this.drawUndo.emit();
@@ -149,21 +121,15 @@ class b extends g {
149
121
  }
150
122
  _updateGraphics() {
151
123
  setTimeout(() => {
152
- this.graphics.length === 1 && this._sketchWidget && this._sketchWidget.update(this.graphics, {
153
- tool: "reshape",
154
- enableRotation: !1,
155
- enableScaling: !1,
156
- preserveAspectRatio: !1,
157
- toggleToolOnClick: !1
158
- });
124
+ this.graphics.length === 1 && this.graphics[0].geometry && this._sketchComponent.value && this._sketchComponent.value.triggerUpdate(this.graphics);
159
125
  }, 100);
160
126
  }
161
127
  _updateGraphicsSymbols(e) {
162
- const s = e[0]?.geometry?.type, t = s === "point" ? this.pointSymbol : s === "polyline" ? this.polylineSymbol : s === "polygon" ? this.polygonSymbol : void 0;
163
- t && e.forEach((a) => a.symbol = t);
128
+ const i = e[0]?.geometry?.type, s = i === "point" ? this.pointSymbol : i === "polyline" ? this.polylineSymbol : i === "polygon" ? this.polygonSymbol : void 0;
129
+ s && e.forEach((r) => r.symbol = s);
164
130
  }
165
131
  }
166
- r("map-draw-tools", b);
132
+ h("map-draw-tools", k);
167
133
  export {
168
- b as MapDrawTools
134
+ k as MapDrawTools
169
135
  };
@@ -1,2 +1,3 @@
1
+ import "@arcgis/map-components/components/arcgis-sketch";
1
2
  import "@esri/calcite-components/components/calcite-action";
2
3
  export * from "./customElement.js";
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as m } from "../../chunks/runtime.js";
3
- import { g as y, d as b, f as _ } from "../../chunks/mapViewUtils.js";
4
- import { u as f } from "../../chunks/useT9n.js";
3
+ import { g as y, d as b, f } from "../../chunks/mapViewUtils.js";
4
+ import { u as _ } from "../../chunks/useT9n.js";
5
5
  import { css as u, html as i, nothing as l } from "lit";
6
6
  import { createRef as o, ref as d } from "lit-html/directives/ref.js";
7
7
  import { LitElement as g, createEvent as n, noShadowRoot as L, safeStyleMap as c, safeClassMap as p } from "@arcgis/lumina";
@@ -10,7 +10,7 @@ import { p as v } from "../../chunks/publicNotificationContext.js";
10
10
  const I = u`@layer{:host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom: 0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}.popover-list{overflow:auto;width:250px}}`;
11
11
  class $ extends g {
12
12
  constructor() {
13
- super(), this.appearance = "transparent", this.configLayerOrderDefined = !1, this.defaultLayerId = "", this.disabled = !1, this.display = "inline-block", this.enabledLayerIds = [], this.isMobile = !1, this.showOnlyUpdatableLayers = !1, this.selectedIds = [], this.scale = "m", this.showTables = !1, this.showTablesDisabled = !1, this.showSingleLayerAsLabel = !1, this.type = "select", this.showLayersListInPopover = !1, this.referenceElement = "", this.force = !1, this._hasMultipleLayers = !0, this._hasValidLayers = !0, this._isDropdownOpen = !1, this.ids = [], this.selectedName = "", this._translations = f({ name: "map-layer-picker", blocking: !0 }), this.defaultLayerHonored = !1, this._layerSelectElement = o(), this._layerComboboxElement = o(), this._pnContextConsumer = w({
13
+ super(), this.appearance = "transparent", this.configLayerOrderDefined = !1, this.defaultLayerId = "", this.disabled = !1, this.display = "inline-block", this.enabledLayerIds = [], this.isMobile = !1, this.showOnlyUpdatableLayers = !1, this.selectedIds = [], this.scale = "m", this.showTables = !1, this.showTablesDisabled = !1, this.showSingleLayerAsLabel = !1, this.type = "select", this.showLayersListInPopover = !1, this.referenceElement = "", this.force = !1, this._hasMultipleLayers = !0, this._hasValidLayers = !0, this._isDropdownOpen = !1, this.ids = [], this.selectedName = "", this._translations = _({ name: "map-layer-picker", blocking: !0 }), this.defaultLayerHonored = !1, this._layerSelectElement = o(), this._layerComboboxElement = o(), this._pnContextConsumer = w({
14
14
  context: v,
15
15
  subscribe: !0
16
16
  }), this._skipEditCheck = !1, this._popover = o(), this.beforeLayerSelectionChange = n(), this.idsFound = n(), this.noLayersFound = n(), this.layerSelectionChange = n(), this.listenOn(window, "mapChanged", this.mapChanged);
@@ -93,7 +93,7 @@ class $ extends g {
93
93
  return i`<calcite-dropdown class="layer-picker-dropdown" @calciteDropdownBeforeClose=${() => this._isDropdownOpen = !1} @calciteDropdownBeforeOpen=${() => this._isDropdownOpen = !0}>${this.isMobile ? this._getDropdownButton() : this._getActionDropdownButton(e)}<calcite-dropdown-group selection-mode=single>${this._getMapLayerOptions()}</calcite-dropdown-group></calcite-dropdown>`;
94
94
  }
95
95
  _getActionDropdownButton(e) {
96
- return i`<calcite-action appearance=solid id=${e ?? l} slot=trigger text>${this._getDropdownButton()}</calcite-action>`;
96
+ return i`<calcite-action id=${e ?? l} slot=trigger text>${this._getDropdownButton()}</calcite-action>`;
97
97
  }
98
98
  _getDropdownButton() {
99
99
  const e = this._getItemTypeIcon(), t = this.isMobile ? "" : "max-width-350", s = this.isMobile ? "trigger" : "", a = this._isDropdownOpen ? "chevron-up" : "chevron-down";
@@ -107,10 +107,10 @@ class $ extends g {
107
107
  return this.ids.reduce((e, t) => (this._validLayer(t) ? e.push(this._getItem(t, "layer")) : this._validTable(t) && e.push(this._getItem(t, "table")), e), []);
108
108
  }
109
109
  _getItem(e, t) {
110
- const s = t === "layer" && this._layerNameHash ? this._layerNameHash[e] : this._tableNameHash ? this._tableNameHash[e] : void 0, a = this.showOnlyUpdatableLayers ? s && !s.supportsUpdate : !1, h = s?.name || "", r = this.selectedIds.indexOf(e) > -1;
111
- return this.type === "combobox" ? i`<calcite-combobox-item .disabled=${a} .heading=${h} .selected=${r} .value=${e}></calcite-combobox-item>` : this.type === "select" ? i`<calcite-option .disabled=${a} .label=${h} .selected=${r} .value=${e}></calcite-option>` : this.force && r || !this.force ? i`<calcite-dropdown-group class=${p(a ? "disabled" : "")} id=${h ?? l} .selectionMode=${a ? "none" : "single"}><calcite-dropdown-item .disabled=${!!(t === "table" && this.showTablesDisabled)} .iconStart=${t} @click=${a ? void 0 : () => {
110
+ const s = t === "layer" && this._layerNameHash ? this._layerNameHash[e] : this._tableNameHash ? this._tableNameHash[e] : void 0, a = this.showOnlyUpdatableLayers ? s && !s.supportsUpdate : !1, r = s?.name || "", h = this.selectedIds.indexOf(e) > -1;
111
+ return this.type === "combobox" ? i`<calcite-combobox-item .disabled=${a} .heading=${r} .selected=${h} .value=${e}></calcite-combobox-item>` : this.type === "select" ? i`<calcite-option .disabled=${a} .label=${r} .selected=${h} .value=${e}></calcite-option>` : this.force && h || !this.force ? i`<calcite-dropdown-group class=${p(a ? "disabled" : "")} id=${r ?? l} .selectionMode=${a ? "none" : "single"}><calcite-dropdown-item .disabled=${!!(t === "table" && this.showTablesDisabled)} .iconStart=${t} @click=${a ? void 0 : () => {
112
112
  this._setSelectedLayer(e);
113
- }} .selected=${r}>${h}</calcite-dropdown-item></calcite-dropdown-group>` : null;
113
+ }} .selected=${h}>${r}</calcite-dropdown-item></calcite-dropdown-group>` : null;
114
114
  }
115
115
  async _setSelectedLayer(e) {
116
116
  if (e !== this.selectedIds[0]) {
@@ -151,7 +151,7 @@ class $ extends g {
151
151
  return Object.keys(e).filter((t) => e[t].supportsUpdate);
152
152
  }
153
153
  async _initLayerTableHash() {
154
- this._layerNameHash = this.mapView && await b(this.mapView, this.showOnlyUpdatableLayers), this._tableNameHash = this.showTables && this.mapView ? await _(this.mapView, this.showOnlyUpdatableLayers) : {};
154
+ this._layerNameHash = this.mapView && await b(this.mapView, this.showOnlyUpdatableLayers), this._tableNameHash = this.showTables && this.mapView ? await f(this.mapView, this.showOnlyUpdatableLayers) : {};
155
155
  }
156
156
  _validLayer(e) {
157
157
  const t = this._pnContextConsumer.value, s = this._layerNameHash && this._layerNameHash[e]?.name;
@@ -165,7 +165,7 @@ class $ extends g {
165
165
  if (this._layerElement.value) {
166
166
  const t = e || (Array.isArray(this._layerElement.value.value) ? this._layerElement.value.value : [this._layerElement.value.value]);
167
167
  if (JSON.stringify(t) !== JSON.stringify([""])) {
168
- if (!this._skipEditCheck && this.beforeLayerSelectionChange.emit({
168
+ if (JSON.stringify(t) === JSON.stringify(this.selectedIds) || !this._skipEditCheck && this.beforeLayerSelectionChange.emit({
169
169
  currentIds: this.selectedIds,
170
170
  newIds: t,
171
171
  ref: this.el
@@ -1,9 +1,9 @@
1
1
  /// <reference path="../../index.d.ts" />
2
- import type Geometry from "@arcgis/core/geometry/Geometry.js";
3
- import type FeatureLayerView from "@arcgis/core/views/layers/FeatureLayerView.js";
4
2
  import type MapView from "@arcgis/core/views/MapView.js";
5
3
  import type SimpleFillSymbol from "@arcgis/core/symbols/SimpleFillSymbol.js";
6
4
  import type SimpleMarkerSymbol from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
5
+ import type Geometry from "@arcgis/core/geometry/Geometry.js";
6
+ import type FeatureLayerView from "@arcgis/core/views/layers/FeatureLayerView.js";
7
7
  import type SimpleLineSymbol from "@arcgis/core/symbols/SimpleLineSymbol.js";
8
8
  import type { DistanceUnit, ISearchConfiguration, ISelectionSet } from "../../utils/interfaces.js";
9
9
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
@@ -96,7 +96,7 @@ export abstract class MapSelectTools extends LitElement {
96
96
  * @default true
97
97
  */
98
98
  accessor enableSketchTools: boolean;
99
- /** esri/geometry: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html */
99
+ /** Geometry[]: List of geometries */
100
100
  accessor geometries: Geometry[];
101
101
  /**
102
102
  * string: Header label class
@@ -110,9 +110,9 @@ export abstract class MapSelectTools extends LitElement {
110
110
  * @default false
111
111
  */
112
112
  accessor isUpdate: boolean;
113
- /** esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html */
113
+ /** FeatureLayerView[]: List of layer views */
114
114
  accessor layerViews: FeatureLayerView[];
115
- /** esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html */
115
+ /** MapView: The view of the map */
116
116
  accessor mapView: MapView | undefined;
117
117
  /**
118
118
  * string: The value to show for no results
@@ -136,7 +136,7 @@ export abstract class MapSelectTools extends LitElement {
136
136
  accessor selectionLayerIds: string[];
137
137
  /** utils/interfaces/ISelectionSet: Used to store key details about any selections that have been made. */
138
138
  accessor selectionSet: ISelectionSet | undefined;
139
- /** esri/views/layers/FeatureLayerView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html */
139
+ /** FeatureLayerView: The view of the selected layer */
140
140
  accessor selectLayerView: FeatureLayerView | undefined;
141
141
  /** esri/symbols/SimpleLineSymbol | JSON representation : https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html */
142
142
  accessor sketchLineSymbol: SimpleLineSymbol | undefined;
@@ -151,6 +151,13 @@ export abstract class MapSelectTools extends LitElement {
151
151
  */
152
152
  accessor useLayerFeaturesEnabled: boolean;
153
153
  /**
154
+ * //--------------------------------------------------------------------------
155
+ * //
156
+ * // Methods (public)
157
+ * //
158
+ * //--------------------------------------------------------------------------
159
+ *
160
+ * /**
154
161
  * Clear any selection results
155
162
  *
156
163
  * @returns Promise when the results have been cleared
@@ -2,36 +2,35 @@
2
2
  import { c as w } from "../../chunks/runtime.js";
3
3
  import { e as L, h as S, c as m } from "../../chunks/mapViewUtils.js";
4
4
  import { c as v, g as C, d as V } from "../../chunks/queryUtils.js";
5
- import { u as k } from "../../chunks/useT9n.js";
6
- import { css as G, html as c } from "lit";
5
+ import { u as $ } from "../../chunks/useT9n.js";
6
+ import { css as k, html as c } from "lit";
7
7
  import { createRef as d, ref as u } from "lit-html/directives/ref.js";
8
- import { LitElement as T, createEvent as $, noShadowRoot as I, safeClassMap as f, safeStyleMap as O } from "@arcgis/lumina";
8
+ import { LitElement as I, createEvent as G, noShadowRoot as T, safeClassMap as f, safeStyleMap as O } from "@arcgis/lumina";
9
9
  import { useContextConsumer as E } from "@arcgis/lumina/context";
10
10
  import { p as F } from "../../chunks/publicNotificationContext.js";
11
11
  import D from "@arcgis/core/request.js";
12
12
  import x from "@arcgis/core/layers/FeatureLayer.js";
13
13
  import b from "@arcgis/core/Graphic.js";
14
- import N from "@arcgis/core/layers/GraphicsLayer.js";
15
- import R from "@arcgis/core/widgets/Search.js";
16
- const W = G`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`;
17
- class U extends T {
14
+ import R from "@arcgis/core/layers/GraphicsLayer.js";
15
+ const N = k`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`;
16
+ class U extends I {
18
17
  constructor() {
19
- super(), this.bufferColor = [227, 139, 79, 0.8], this.bufferOutlineColor = [255, 255, 255], this.customLabelEnabled = !1, this.enabledLayerIds = [], this.enableLayerFeatures = !0, this.enableLayerFeaturesOnLoad = !1, this.enableSearchDistance = !0, this.enableSearchDistanceOnLoad = !1, this.enableSketchTools = !0, this.geometries = [], this.headerLabelClass = "font-bold", this.isUpdate = !1, this.layerViews = [], this.noResultText = "", this.selectionLayerIds = [], this.searchDistanceEnabled = !1, this.useLayerFeaturesEnabled = !1, this._numSelected = 0, this._searchTerm = "", this._selectionLoading = !1, this._translations = k({ name: "map-select-tools", blocking: !0 }), this._bufferTools = d(), this._drawTools = d(), this._labelName = d(), this._pnContextConsumer = E({
18
+ super(), this.bufferColor = [227, 139, 79, 0.8], this.bufferOutlineColor = [255, 255, 255], this.customLabelEnabled = !1, this.enabledLayerIds = [], this.enableLayerFeatures = !0, this.enableLayerFeaturesOnLoad = !1, this.enableSearchDistance = !0, this.enableSearchDistanceOnLoad = !1, this.enableSketchTools = !0, this.geometries = [], this.headerLabelClass = "font-bold", this.isUpdate = !1, this.layerViews = [], this.noResultText = "", this.selectionLayerIds = [], this.searchDistanceEnabled = !1, this.useLayerFeaturesEnabled = !1, this._numSelected = 0, this._searchTerm = "", this._selectionLoading = !1, this._translations = $({ name: "map-select-tools", blocking: !0 }), this._bufferTools = d(), this._drawTools = d(), this._labelName = d(), this._pnContextConsumer = E({
20
19
  context: F,
21
20
  subscribe: !0
22
- }), this._searchElement = d(), this._selectedIds = [], this._selectionLabel = "", this._graphics = [], this._featuresCollection = {}, this.selectionSetChange = $(), this.listenOn(window, "searchConfigurationChange", this.searchConfigurationChangeChanged), this.listenOn(window, "distanceChanged", this.distanceChanged), this.listenOn(window, "unitChanged", this.unitChanged);
21
+ }), this._searchElement = d(), this._selectedIds = [], this._selectionLabel = "", this._graphics = [], this._featuresCollection = {}, this.selectionSetChange = G(), this.listenOn(window, "searchConfigurationChange", this.searchConfigurationChangeChanged), this.listenOn(window, "distanceChanged", this.distanceChanged), this.listenOn(window, "unitChanged", this.unitChanged);
23
22
  }
24
23
  static {
25
24
  this.properties = { bufferColor: 1, bufferOutlineColor: 1, customLabelEnabled: 5, enabledLayerIds: 0, enableLayerFeatures: 5, enableLayerFeaturesOnLoad: 5, enableSearchDistance: 5, enableSearchDistanceOnLoad: 5, enableSketchTools: 5, defaultBufferDistance: 9, defaultBufferUnit: 1, geometries: 0, headerLabelClass: 1, isUpdate: 5, layerViews: 0, mapView: 0, noResultText: 1, searchConfiguration: 0, selectionSet: 0, selectionLayerIds: 0, selectLayerView: 0, sketchLineSymbol: 0, sketchPointSymbol: 0, sketchPolygonSymbol: 0, searchDistanceEnabled: 5, useLayerFeaturesEnabled: 5, _numSelected: 16, _searchTerm: 16, _selectionLoading: 16, _translations: 16 };
26
25
  }
27
26
  static {
28
- this.styles = W;
27
+ this.styles = N;
29
28
  }
30
29
  static {
31
- this.shadowRootOptions = I;
30
+ this.shadowRootOptions = T;
32
31
  }
33
32
  willUpdate(e) {
34
- e.has("geometries") && (this.hasUpdated || this.geometries?.length > 0) && this.watchGeometriesHandler(this.geometries, e.get("geometries")), e.has("mapView") && this.mapView && this.mapViewWatchHandler(this.mapView, e.get("mapView")), e.has("searchConfiguration") && this.searchConfiguration && this.watchSearchConfigurationHandler(this.searchConfiguration, e.get("searchConfiguration")), e.has("defaultBufferUnit") && this.hasUpdated && (this.selectionSet && (this.selectionSet.unit = this.defaultBufferUnit), this._bufferTools.value && this.defaultBufferUnit !== void 0 && (this._bufferTools.value.unit = this.defaultBufferUnit), this._updateLabel()), e.has("defaultBufferDistance") && this.hasUpdated && (this.selectionSet && (this.selectionSet.distance = this.defaultBufferDistance), this._updateLabel());
33
+ e.has("geometries") && (this.hasUpdated || this.geometries?.length > 0) && this.watchGeometriesHandler(this.geometries, e.get("geometries")), e.has("mapView") && this.mapView && this.mapViewWatchHandler(this.mapView, e.get("mapView")), e.has("defaultBufferUnit") && this.hasUpdated && (this.selectionSet && (this.selectionSet.unit = this.defaultBufferUnit), this._bufferTools.value && this.defaultBufferUnit !== void 0 && (this._bufferTools.value.unit = this.defaultBufferUnit), this._updateLabel()), e.has("defaultBufferDistance") && this.hasUpdated && (this.selectionSet && (this.selectionSet.distance = this.defaultBufferDistance), this._updateLabel());
35
34
  }
36
35
  async watchGeometriesHandler(e, t) {
37
36
  if (e !== t && e.length > 0)
@@ -40,9 +39,6 @@ class U extends T {
40
39
  async mapViewWatchHandler(e, t) {
41
40
  e && e !== t && await this._init();
42
41
  }
43
- async watchSearchConfigurationHandler(e, t) {
44
- JSON.stringify(e) !== JSON.stringify(t) && await this._initSearchWidget();
45
- }
46
42
  async clearSelection() {
47
43
  return this._clearResults(!0, !0);
48
44
  }
@@ -80,9 +76,13 @@ class U extends T {
80
76
  await this._init();
81
77
  }
82
78
  render() {
83
- const e = this.enableSketchTools ? "" : "display-none", t = this.enableSketchTools ? "padding-top-1" : "";
84
- return c`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><div class="search-widget" ${u(this._searchElement)}></div><div class=${f(t)}><map-draw-tools active class=${f(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${(s) => {
85
- this._sketchGraphicsChanged(s);
79
+ const e = this.enableSketchTools ? "" : "display-none", t = this.enableSketchTools ? "padding-top-1" : "", s = this.searchConfiguration && this.mapView ? this._getSearchConfig(this.searchConfiguration, this.mapView) : void 0, i = this.searchConfiguration?.allPlaceholder && this.searchConfiguration.allPlaceholder.toLowerCase() !== "find address or place" ? this.searchConfiguration.allPlaceholder : this._translations.placeholder;
80
+ return c`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><arcgis-search class="search-widget" .activeSourceIndex=${s?.activeSourceIndex} .allPlaceholder=${i} .includeDefaultSourcesDisabled=${s?.includeDefaultSources === !1} @arcgisSearchClear=${() => {
81
+ this._handleSearchClear();
82
+ }} @arcgisSelectResult=${(a) => {
83
+ this._handleSearchSelectResult(a);
84
+ }} popup-disabled result-graphic-disabled .searchAllDisabled=${s?.searchAllEnabled === !1} .searchTerm=${this._searchTerm} .sources=${s?.sources} .view=${this.mapView} ${u(this._searchElement)}></arcgis-search><div class=${f(t)}><map-draw-tools active class=${f(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${(a) => {
85
+ this._sketchGraphicsChanged(a);
86
86
  }} .pointSymbol=${this.sketchPointSymbol} .polygonSymbol=${this.sketchPolygonSymbol} .polylineSymbol=${this.sketchLineSymbol} ${u(this._drawTools)}></map-draw-tools></div>${this.enableSearchDistance ? this._getBufferOptions() : void 0}${this.enableLayerFeatures ? this._getUseLayerFeaturesOptions() : void 0}${this._getNumSelected()}</div><div class="border-bottom"></div>${this._getNameInput()}`;
87
87
  }
88
88
  _getBufferOptions() {
@@ -118,7 +118,7 @@ class U extends T {
118
118
  }} .selectedIds=${this.selectLayerView ? [this.selectLayerView.layer.id] : this.selectionSet && e !== void 0 ? [e] : []}></map-layer-picker></calcite-label></div>`;
119
119
  }
120
120
  async _init() {
121
- this._initGraphicsLayer(), await this._initSelectionSet(), await this._initSearchWidget();
121
+ this._initGraphicsLayer(), await this._initSelectionSet();
122
122
  }
123
123
  async _initSelectionSet() {
124
124
  this.selectionSet && (this._searchTerm = this.selectionSet.searchResult?.name, this._searchResult = this.selectionSet.searchResult, this._selectedIds = this.selectionSet.selectedIds, this._skipGeomOIDs = this.selectionSet.skipGeomOIDs || [], this.searchDistanceEnabled = this.selectionSet.searchDistanceEnabled, this.useLayerFeaturesEnabled = this.selectionSet.useLayerFeaturesEnabled, this._distance = this.selectionSet.searchDistanceEnabled ? this.selectionSet.distance : 0, this._unit = this.selectionSet.unit, this._workflowType = this.selectionSet.workflowType, this.selectLayerView = this.selectionSet.layerView, this._sketchGraphic = this.selectionSet.sketchGraphic, this.geometries = [...this.selectionSet?.geometries || []], this._graphics = this.geometries.reduce((e, t) => {
@@ -129,23 +129,12 @@ class U extends T {
129
129
  })), e;
130
130
  }, []), this._selectionLabel = this.selectionSet?.label, this.useLayerFeaturesEnabled || await this._drawTools.value?.updateGraphics(), this.selectionSet.layerView && this.mapView && await L(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, !1));
131
131
  }
132
- async _initSearchWidget() {
133
- if (this.mapView && this._searchElement.value) {
134
- const e = this.searchConfiguration && this._getSearchConfig(this.searchConfiguration, this.mapView), t = {
135
- view: this.mapView,
136
- container: this._searchElement.value,
137
- searchTerm: this._searchTerm,
138
- ...e
139
- };
140
- this._searchWidget ? (this._searchWidget.view = this.mapView, this._searchWidget.searchTerm = this._searchTerm) : this._searchWidget = new R(t), this._searchWidget && (this._searchWidget.popupEnabled = !1, this._searchWidget.resultGraphicEnabled = !1, this._searchWidget.viewModel.addHandles(this._searchWidget.on("search-clear", () => {
141
- const s = this._searchClearLabel();
142
- this._searchResult?.name && this._clearResults(!1, s);
143
- })), this._searchWidget.viewModel.addHandles(this._searchWidget.on("select-result", (s) => {
144
- this._selectResult(s.result);
145
- })), await this._searchWidget.when(() => {
146
- this._searchWidget && (this._searchWidget.allPlaceholder = this.searchConfiguration?.allPlaceholder && this.searchConfiguration.allPlaceholder.toLowerCase() !== "find address or place" ? this.searchConfiguration.allPlaceholder : this._translations.placeholder);
147
- }));
148
- }
132
+ async _handleSearchClear() {
133
+ const e = this._searchClearLabel();
134
+ this._searchResult?.name && await this._clearResults(!1, e);
135
+ }
136
+ async _handleSearchSelectResult(e) {
137
+ await this._selectResult(e.detail.result);
149
138
  }
150
139
  async _selectResult(e) {
151
140
  if (e) {
@@ -155,10 +144,10 @@ class U extends T {
155
144
  s?.sourceJSON?.isView && s.url && (l = await this._getViewSourceUrl(s.url));
156
145
  let r;
157
146
  i?.sourceJSON?.isView && i.url && (r = await this._getViewSourceUrl(i.url));
158
- const n = s?.url?.toLowerCase(), h = l?.toLowerCase(), o = i?.url?.toLowerCase(), p = r?.toLowerCase(), _ = n && o && (n === o || n === p || h === o || h === p) && !Number.isNaN(a), g = _ ? [a] : void 0;
147
+ const h = s?.url?.toLowerCase(), o = l?.toLowerCase(), n = i?.url?.toLowerCase(), p = r?.toLowerCase(), y = h && n && (h === n || h === p || o === n || o === p) && !Number.isNaN(a), g = y ? [a] : void 0;
159
148
  this._workflowType = "SEARCH", this._updateLabel();
160
- const y = [e.feature];
161
- this._updateSelection(y, _, g), this._drawTools.value && (this._drawTools.value.graphics = y), this._searchWidget?.resultGraphic && (this._searchWidget.resultGraphic.visible = !1);
149
+ const _ = [e.feature];
150
+ this._updateSelection(_, y, g), this._drawTools.value && (this._drawTools.value.graphics = _);
162
151
  } else {
163
152
  const t = this._searchClearLabel();
164
153
  this._clearResults(!1, t);
@@ -189,8 +178,8 @@ class U extends T {
189
178
  includeDefaultSources: !1
190
179
  }, s.forEach((i) => {
191
180
  if (i.hasOwnProperty("layer")) {
192
- const l = i, r = l.layer?.id, n = r ? t.map?.findLayerById(r) : null, h = l?.layer?.url;
193
- n && l ? l.layer = n : h && (l.layer = new x(h));
181
+ const l = i, r = l.layer?.id, h = r ? t.map?.findLayerById(r) : null, o = l?.layer?.url;
182
+ h && l ? l.layer = h : o && (l.layer = new x(o));
194
183
  }
195
184
  }), s?.forEach((i) => {
196
185
  if (i.hasOwnProperty("locator")) {
@@ -212,7 +201,7 @@ class U extends T {
212
201
  const s = this.mapView.map.layers.findIndex((i) => i.title === t);
213
202
  if (s > -1)
214
203
  this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(s);
215
- else if (this._bufferGraphicsLayer = new N({ title: t, listMode: "hide" }), this._bufferGraphicsLayer) {
204
+ else if (this._bufferGraphicsLayer = new R({ title: t, listMode: "hide" }), this._bufferGraphicsLayer) {
216
205
  e.managedLayers[t] = "buffer";
217
206
  const i = this.mapView.map.layers.findIndex((a) => a.title === this._translations.sketchLayer);
218
207
  i > -1 ? this.mapView.map.layers.add(this._bufferGraphicsLayer, i) : this.mapView.map.layers.add(this._bufferGraphicsLayer);
@@ -261,7 +250,7 @@ class U extends T {
261
250
  geometry: this._bufferGeometry,
262
251
  symbol: i
263
252
  });
264
- this._bufferGraphicsLayer && a && this.mapView && (this._bufferGraphicsLayer.removeAll(), this._bufferGraphicsLayer.add(a), await this._selectFeatures([this._bufferGeometry]), a.geometry?.extent && await this.mapView.goTo(a.geometry.extent)), s = t, t = 0;
253
+ this._bufferGraphicsLayer && this.mapView && (this._bufferGraphicsLayer.removeAll(), this._bufferGraphicsLayer.add(a), await this._selectFeatures([this._bufferGeometry]), a.geometry?.extent && await this.mapView.goTo(a.geometry.extent)), s = t, t = 0;
265
254
  } else
266
255
  this._bufferGraphicsLayer && this._bufferGraphicsLayer.removeAll(), await this._highlightWithOIDsOrGeoms();
267
256
  await this._distanceChanged({
@@ -269,15 +258,15 @@ class U extends T {
269
258
  newValue: s
270
259
  });
271
260
  }
272
- _geomQuery(e) {
261
+ async _geomQuery(e) {
273
262
  const t = C(e);
274
263
  return t ? this._selectFeatures(t) : Promise.resolve();
275
264
  }
276
265
  async _clearResults(e = !0, t = !1) {
277
- this._selectedIds = [], this._distance = void 0, this._unit = void 0, t && (this._selectionLabel = "", this._labelName.value && (this._labelName.value.value = "")), this._bufferGraphicsLayer && this._bufferGraphicsLayer.removeAll(), e && this._searchWidget && this._clearSearchWidget(), this._pnContextConsumer.value.removeHandles(), this._drawTools.value?.clear && (this._graphics = [], await this._drawTools.value.clear()), this._numSelected = this._selectedIds.length, this.selectionSetChange.emit(this._numSelected);
266
+ this._selectedIds = [], this._distance = void 0, this._unit = void 0, t && (this._selectionLabel = "", this._labelName.value && (this._labelName.value.value = "")), this._bufferGraphicsLayer && this._bufferGraphicsLayer.removeAll(), e && this._clearSearchWidget(), this._pnContextConsumer.value.removeHandles(), this._drawTools.value?.clear && (this._graphics = [], this.geometries = [], await this._drawTools.value.clear()), this._numSelected = this._selectedIds.length, this.selectionSetChange.emit(this._numSelected);
278
267
  }
279
268
  _clearSearchWidget() {
280
- this._searchWidget?.clear(), this._searchResult = void 0;
269
+ this._searchElement.value?.clear(), this._searchResult = void 0;
281
270
  }
282
271
  _updateSelection(e, t, s) {
283
272
  this._selectedIds = t && s ? s : this._selectedIds, this._skipGeomOIDs = t ? s : void 0, this.geometries = Array.isArray(e) ? e.reduce((i, a) => (a.geometry && i.push(a.geometry), i), []) : this.geometries, this._graphics = e;
@@ -314,21 +303,21 @@ class U extends T {
314
303
  return Promise.all(t).then(async (s) => {
315
304
  this._selectionLoading = !1;
316
305
  let i = [];
317
- s.forEach((h) => {
318
- Object.keys(h).forEach((o) => {
319
- i = i.concat(h[o]);
306
+ s.forEach((o) => {
307
+ Object.keys(o).forEach((n) => {
308
+ i = i.concat(o[n]);
320
309
  });
321
310
  });
322
311
  let a = !1;
323
- i.forEach((h) => {
324
- const o = h.geometry;
325
- h.symbol = o && o.type === "point" ? this.sketchPointSymbol : o && o.type === "polyline" ? this.sketchLineSymbol : o && o.type === "polygon" ? this.sketchPolygonSymbol : void 0, a = h?.layer?.hasOwnProperty("objectIdField") || h.hasOwnProperty("getObjectId");
312
+ i.forEach((o) => {
313
+ const n = o.geometry;
314
+ o.symbol = n && n.type === "point" ? this.sketchPointSymbol : n && n.type === "polyline" ? this.sketchLineSymbol : n && n.type === "polygon" ? this.sketchPolygonSymbol : void 0, a = o?.layer?.hasOwnProperty("objectIdField") || o.hasOwnProperty("getObjectId");
326
315
  });
327
- const l = this.layerViews[0].layer, r = this.selectLayerView?.layer, n = a && l.url === r?.url && r?.layerId === l.layerId;
316
+ const l = this.layerViews[0].layer, r = this.selectLayerView?.layer, h = a && l.url === r?.url && r?.layerId === l.layerId;
328
317
  await this._sketchGraphicsChanged({
329
318
  detail: {
330
319
  graphics: i,
331
- useOIDs: n
320
+ useOIDs: h
332
321
  }
333
322
  }, !0);
334
323
  });