@esri/solutions-components 0.2.6 → 0.2.7

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 (314) hide show
  1. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  2. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  3. package/dist/cjs/{pciUtils-6a806ba4.js → pciUtils-423cfc68.js} +25 -7
  4. package/dist/collection/demos/deduct-calculator.html +2 -5
  5. package/dist/collection/demos/new-public-notification.html +6 -4
  6. package/dist/collection/utils/pciUtils.js +25 -7
  7. package/dist/collection/utils/pciUtils.ts +30 -7
  8. package/dist/components/ExpandToggle.js +110 -0
  9. package/dist/components/Heading.js +22 -0
  10. package/dist/components/_commonjsHelpers.js +22 -0
  11. package/dist/components/action-bar.js +276 -0
  12. package/dist/components/action-group.js +149 -0
  13. package/dist/components/action-menu.js +356 -0
  14. package/dist/components/action.js +214 -0
  15. package/dist/components/add-record-modal.d.ts +11 -0
  16. package/dist/components/add-record-modal.js +171 -0
  17. package/dist/components/array.js +15 -0
  18. package/dist/components/block.js +272 -0
  19. package/dist/components/buffer-tools.d.ts +11 -0
  20. package/dist/components/buffer-tools.js +11 -0
  21. package/dist/components/buffer-tools2.js +262 -0
  22. package/dist/components/button.js +263 -0
  23. package/dist/components/calcite-accordion-item.js +244 -0
  24. package/dist/components/calcite-accordion.js +180 -0
  25. package/dist/components/calcite-action-bar.js +11 -0
  26. package/dist/components/calcite-action-group.js +11 -0
  27. package/dist/components/calcite-action-menu.js +11 -0
  28. package/dist/components/calcite-action-pad.js +197 -0
  29. package/dist/components/calcite-action.js +11 -0
  30. package/dist/components/calcite-alert.js +297 -0
  31. package/dist/components/calcite-avatar.js +182 -0
  32. package/dist/components/calcite-block-section.js +155 -0
  33. package/dist/components/calcite-block.js +11 -0
  34. package/dist/components/calcite-button.js +11 -0
  35. package/dist/components/calcite-card.js +187 -0
  36. package/dist/components/calcite-checkbox.js +11 -0
  37. package/dist/components/calcite-chip.js +11 -0
  38. package/dist/components/calcite-color-picker-hex-input.js +11 -0
  39. package/dist/components/calcite-color-picker-swatch.js +11 -0
  40. package/dist/components/calcite-color-picker.js +1036 -0
  41. package/dist/components/calcite-combobox-item-group.js +75 -0
  42. package/dist/components/calcite-combobox-item.js +11 -0
  43. package/dist/components/calcite-combobox.js +11 -0
  44. package/dist/components/calcite-date-picker-day.js +11 -0
  45. package/dist/components/calcite-date-picker-month-header.js +11 -0
  46. package/dist/components/calcite-date-picker-month.js +11 -0
  47. package/dist/components/calcite-date-picker.js +11 -0
  48. package/dist/components/calcite-dropdown-group.js +11 -0
  49. package/dist/components/calcite-dropdown-item.js +11 -0
  50. package/dist/components/calcite-dropdown.js +11 -0
  51. package/dist/components/calcite-fab.js +144 -0
  52. package/dist/components/calcite-filter.js +195 -0
  53. package/dist/components/calcite-flow-item.js +243 -0
  54. package/dist/components/calcite-flow.js +147 -0
  55. package/dist/components/calcite-graph.js +11 -0
  56. package/dist/components/calcite-handle.js +11 -0
  57. package/dist/components/calcite-icon.js +11 -0
  58. package/dist/components/calcite-inline-editable.js +294 -0
  59. package/dist/components/calcite-input-date-picker.js +713 -0
  60. package/dist/components/calcite-input-message.js +11 -0
  61. package/dist/components/calcite-input-number.js +637 -0
  62. package/dist/components/calcite-input-text.js +400 -0
  63. package/dist/components/calcite-input-time-picker.js +434 -0
  64. package/dist/components/calcite-input.js +11 -0
  65. package/dist/components/calcite-label.js +11 -0
  66. package/dist/components/calcite-link.js +11 -0
  67. package/dist/components/calcite-list-item-group.js +65 -0
  68. package/dist/components/calcite-list-item.js +11 -0
  69. package/dist/components/calcite-list.js +11 -0
  70. package/dist/components/calcite-loader.js +11 -0
  71. package/dist/components/calcite-modal.js +11 -0
  72. package/dist/components/calcite-notice.js +11 -0
  73. package/dist/components/calcite-option-group.js +64 -0
  74. package/dist/components/calcite-option.js +11 -0
  75. package/dist/components/calcite-pagination.js +258 -0
  76. package/dist/components/calcite-panel.js +11 -0
  77. package/dist/components/calcite-pick-list-group.js +74 -0
  78. package/dist/components/calcite-pick-list-item.js +11 -0
  79. package/dist/components/calcite-pick-list.js +11 -0
  80. package/dist/components/calcite-popover-manager.js +94 -0
  81. package/dist/components/calcite-popover.js +11 -0
  82. package/dist/components/calcite-progress.js +11 -0
  83. package/dist/components/calcite-radio-button-group.js +132 -0
  84. package/dist/components/calcite-radio-button.js +310 -0
  85. package/dist/components/calcite-radio-group-item.js +11 -0
  86. package/dist/components/calcite-radio-group.js +11 -0
  87. package/dist/components/calcite-rating.js +201 -0
  88. package/dist/components/calcite-scrim.js +11 -0
  89. package/dist/components/calcite-select.js +11 -0
  90. package/dist/components/calcite-shell-center-row.js +100 -0
  91. package/dist/components/calcite-shell-panel.js +11 -0
  92. package/dist/components/calcite-shell.js +11 -0
  93. package/dist/components/calcite-slider.js +11 -0
  94. package/dist/components/calcite-sortable-list.js +202 -0
  95. package/dist/components/calcite-split-button.js +11 -0
  96. package/dist/components/calcite-stepper-item.js +271 -0
  97. package/dist/components/calcite-stepper.js +256 -0
  98. package/dist/components/calcite-switch.js +11 -0
  99. package/dist/components/calcite-tab-nav.js +11 -0
  100. package/dist/components/calcite-tab-title.js +11 -0
  101. package/dist/components/calcite-tab.js +11 -0
  102. package/dist/components/calcite-tabs.js +11 -0
  103. package/dist/components/calcite-tile-select-group.js +65 -0
  104. package/dist/components/calcite-tile-select.js +266 -0
  105. package/dist/components/calcite-tile.js +11 -0
  106. package/dist/components/calcite-time-picker.js +11 -0
  107. package/dist/components/calcite-tip-group.js +41 -0
  108. package/dist/components/calcite-tip-manager.js +223 -0
  109. package/dist/components/calcite-tip.js +162 -0
  110. package/dist/components/calcite-tooltip-manager.js +57 -0
  111. package/dist/components/calcite-tooltip.js +11 -0
  112. package/dist/components/calcite-tree-item.js +11 -0
  113. package/dist/components/calcite-tree.js +11 -0
  114. package/dist/components/calcite-value-list-item.js +11 -0
  115. package/dist/components/calcite-value-list.js +11 -0
  116. package/dist/components/card-manager.d.ts +11 -0
  117. package/dist/components/card-manager.js +143 -0
  118. package/dist/components/check-list.d.ts +11 -0
  119. package/dist/components/check-list.js +11 -0
  120. package/dist/components/check-list2.js +131 -0
  121. package/dist/components/checkbox.js +165 -0
  122. package/dist/components/chip.js +170 -0
  123. package/dist/components/color-picker-hex-input.js +363 -0
  124. package/dist/components/color-picker-swatch.js +2034 -0
  125. package/dist/components/combobox-item.js +182 -0
  126. package/dist/components/combobox.js +912 -0
  127. package/dist/components/comment-card.d.ts +11 -0
  128. package/dist/components/comment-card.js +90 -0
  129. package/dist/components/conditionalSlot.js +50 -0
  130. package/dist/components/config-buffer-tools.d.ts +11 -0
  131. package/dist/components/config-buffer-tools.js +187 -0
  132. package/dist/components/config-draw-tools.d.ts +11 -0
  133. package/dist/components/config-draw-tools.js +121 -0
  134. package/dist/components/config-layer-picker.d.ts +11 -0
  135. package/dist/components/config-layer-picker.js +163 -0
  136. package/dist/components/config-pdf-download.d.ts +11 -0
  137. package/dist/components/config-pdf-download.js +154 -0
  138. package/dist/components/crowdsource-manager.d.ts +11 -0
  139. package/dist/components/crowdsource-manager.js +90 -0
  140. package/dist/components/crowdsource-reporter.d.ts +11 -0
  141. package/dist/components/crowdsource-reporter.js +90 -0
  142. package/dist/components/csvUtils.js +74 -0
  143. package/dist/components/date-picker-day.js +111 -0
  144. package/dist/components/date-picker-month-header.js +224 -0
  145. package/dist/components/date-picker-month.js +344 -0
  146. package/dist/components/date-picker.js +575 -0
  147. package/dist/components/date.js +180 -0
  148. package/dist/components/debounce.js +487 -0
  149. package/dist/components/deduct-calculator.d.ts +11 -0
  150. package/dist/components/deduct-calculator.js +11 -0
  151. package/dist/components/deduct-calculator2.js +1002 -0
  152. package/dist/components/dom.js +231 -0
  153. package/dist/components/dropdown-group.js +96 -0
  154. package/dist/components/dropdown-item.js +232 -0
  155. package/dist/components/dropdown.js +505 -0
  156. package/dist/components/edit-record-modal.d.ts +11 -0
  157. package/dist/components/edit-record-modal.js +11 -0
  158. package/dist/components/edit-record-modal2.js +161 -0
  159. package/dist/components/filter.js +763 -0
  160. package/dist/components/floating-ui.js +1768 -0
  161. package/dist/components/form.js +228 -0
  162. package/dist/components/graph.js +254 -0
  163. package/dist/components/guid.js +24 -0
  164. package/dist/components/handle.js +119 -0
  165. package/dist/components/icon.js +202 -0
  166. package/dist/components/index.d.ts +61 -0
  167. package/dist/components/index.js +196 -0
  168. package/dist/components/index2.js +199 -0
  169. package/dist/components/info-card.d.ts +11 -0
  170. package/dist/components/info-card.js +11 -0
  171. package/dist/components/info-card2.js +97 -0
  172. package/dist/components/input-message.js +101 -0
  173. package/dist/components/input.js +740 -0
  174. package/dist/components/interactive.js +51 -0
  175. package/dist/components/interfaces.js +19 -0
  176. package/dist/components/interfaces2.js +21 -0
  177. package/dist/components/interfaces3.js +80 -0
  178. package/dist/components/json-editor.d.ts +11 -0
  179. package/dist/components/json-editor.js +11 -0
  180. package/dist/components/json-editor2.js +441 -0
  181. package/dist/components/key.js +16 -0
  182. package/dist/components/label.js +106 -0
  183. package/dist/components/label2.js +131 -0
  184. package/dist/components/labelFormats.js +210 -0
  185. package/dist/components/layer-table.d.ts +11 -0
  186. package/dist/components/layer-table.js +453 -0
  187. package/dist/components/link.js +123 -0
  188. package/dist/components/list-item.d.ts +11 -0
  189. package/dist/components/list-item.js +90 -0
  190. package/dist/components/list-item2.js +149 -0
  191. package/dist/components/list.js +83 -0
  192. package/dist/components/loadModules.js +28 -0
  193. package/dist/components/loader.js +116 -0
  194. package/dist/components/locale.js +412 -0
  195. package/dist/components/locale2.js +413 -0
  196. package/dist/components/map-card.d.ts +11 -0
  197. package/dist/components/map-card.js +354 -0
  198. package/dist/components/map-draw-tools.d.ts +11 -0
  199. package/dist/components/map-draw-tools.js +11 -0
  200. package/dist/components/map-draw-tools2.js +228 -0
  201. package/dist/components/map-layer-picker.d.ts +11 -0
  202. package/dist/components/map-layer-picker.js +11 -0
  203. package/dist/components/map-layer-picker2.js +188 -0
  204. package/dist/components/map-search.d.ts +11 -0
  205. package/dist/components/map-search.js +155 -0
  206. package/dist/components/map-select-tools.d.ts +11 -0
  207. package/dist/components/map-select-tools.js +11 -0
  208. package/dist/components/map-select-tools2.js +588 -0
  209. package/dist/components/mapViewUtils.js +129 -0
  210. package/dist/components/math.js +24 -0
  211. package/dist/components/media-card.d.ts +11 -0
  212. package/dist/components/media-card.js +11 -0
  213. package/dist/components/media-card2.js +177 -0
  214. package/dist/components/modal.js +495 -0
  215. package/dist/components/nonChromiumPlatformUtils.js +503 -0
  216. package/dist/components/notice.js +192 -0
  217. package/dist/components/observers.js +56 -0
  218. package/dist/components/openCloseComponent.js +56 -0
  219. package/dist/components/option.js +109 -0
  220. package/dist/components/panel.js +459 -0
  221. package/dist/components/pci-calculator.d.ts +11 -0
  222. package/dist/components/pci-calculator.js +193 -0
  223. package/dist/components/pdf-download.d.ts +11 -0
  224. package/dist/components/pdf-download.js +11 -0
  225. package/dist/components/pdf-download2.js +189 -0
  226. package/dist/components/pick-list-item.js +255 -0
  227. package/dist/components/pick-list.js +170 -0
  228. package/dist/components/popover.js +500 -0
  229. package/dist/components/progress.js +60 -0
  230. package/dist/components/public-notification.d.ts +11 -0
  231. package/dist/components/public-notification.js +825 -0
  232. package/dist/components/publicNotificationStore.js +38 -0
  233. package/dist/components/queryUtils.js +187 -0
  234. package/dist/components/radio-group-item.js +101 -0
  235. package/dist/components/radio-group.js +235 -0
  236. package/dist/components/refine-selection-tools.d.ts +11 -0
  237. package/dist/components/refine-selection-tools.js +11 -0
  238. package/dist/components/refine-selection-tools2.js +492 -0
  239. package/dist/components/refine-selection.d.ts +11 -0
  240. package/dist/components/refine-selection.js +11 -0
  241. package/dist/components/refine-selection2.js +376 -0
  242. package/dist/components/resources.js +24 -0
  243. package/dist/components/resources2.js +21 -0
  244. package/dist/components/resources3.js +38 -0
  245. package/dist/components/scrim.js +83 -0
  246. package/dist/components/select.js +259 -0
  247. package/dist/components/shared-list-render.js +319 -0
  248. package/dist/components/shell-panel.js +281 -0
  249. package/dist/components/shell.js +121 -0
  250. package/dist/components/slider.js +896 -0
  251. package/dist/components/solution-configuration.d.ts +11 -0
  252. package/dist/components/solution-configuration.js +2233 -0
  253. package/dist/components/solution-contents.d.ts +11 -0
  254. package/dist/components/solution-contents.js +11 -0
  255. package/dist/components/solution-contents2.js +128 -0
  256. package/dist/components/solution-item-details.d.ts +11 -0
  257. package/dist/components/solution-item-details.js +11 -0
  258. package/dist/components/solution-item-details2.js +234 -0
  259. package/dist/components/solution-item-icon.d.ts +11 -0
  260. package/dist/components/solution-item-icon.js +11 -0
  261. package/dist/components/solution-item-icon2.js +342 -0
  262. package/dist/components/solution-item-sharing.d.ts +11 -0
  263. package/dist/components/solution-item-sharing.js +11 -0
  264. package/dist/components/solution-item-sharing2.js +167 -0
  265. package/dist/components/solution-item.d.ts +11 -0
  266. package/dist/components/solution-item.js +11 -0
  267. package/dist/components/solution-item2.js +315 -0
  268. package/dist/components/solution-organization-variables.d.ts +11 -0
  269. package/dist/components/solution-organization-variables.js +11 -0
  270. package/dist/components/solution-organization-variables2.js +132 -0
  271. package/dist/components/solution-resource-item.d.ts +11 -0
  272. package/dist/components/solution-resource-item.js +11 -0
  273. package/dist/components/solution-resource-item2.js +356 -0
  274. package/dist/components/solution-spatial-ref.d.ts +11 -0
  275. package/dist/components/solution-spatial-ref.js +11 -0
  276. package/dist/components/solution-spatial-ref2.js +21446 -0
  277. package/dist/components/solution-store.js +4092 -0
  278. package/dist/components/solution-template-data.d.ts +11 -0
  279. package/dist/components/solution-template-data.js +11 -0
  280. package/dist/components/solution-template-data2.js +233 -0
  281. package/dist/components/solution-variables.d.ts +11 -0
  282. package/dist/components/solution-variables.js +11 -0
  283. package/dist/components/solution-variables2.js +150 -0
  284. package/dist/components/sortable.esm.js +3026 -0
  285. package/dist/components/split-button.js +165 -0
  286. package/dist/components/store-manager.d.ts +11 -0
  287. package/dist/components/store-manager.js +83 -0
  288. package/dist/components/switch.js +139 -0
  289. package/dist/components/tab-nav.js +241 -0
  290. package/dist/components/tab-title.js +276 -0
  291. package/dist/components/tab.js +154 -0
  292. package/dist/components/tabs.js +188 -0
  293. package/dist/components/tile.js +129 -0
  294. package/dist/components/time-picker.js +943 -0
  295. package/dist/components/tooltip.js +399 -0
  296. package/dist/components/tree-item.js +294 -0
  297. package/dist/components/tree.js +327 -0
  298. package/dist/components/utils.js +119 -0
  299. package/dist/components/utils2.js +51 -0
  300. package/dist/components/value-list-item.js +204 -0
  301. package/dist/components/value-list.js +333 -0
  302. package/dist/esm/deduct-calculator.entry.js +1 -1
  303. package/dist/esm/pci-calculator.entry.js +1 -1
  304. package/dist/esm/{pciUtils-e3007a1c.js → pciUtils-ecda46e5.js} +25 -7
  305. package/dist/solutions-components/demos/deduct-calculator.html +2 -5
  306. package/dist/solutions-components/demos/new-public-notification.html +6 -4
  307. package/dist/solutions-components/{p-ff80ffbb.entry.js → p-0512635b.entry.js} +1 -1
  308. package/dist/solutions-components/{p-5ec407c2.entry.js → p-0c088725.entry.js} +1 -1
  309. package/dist/solutions-components/p-cc815aca.js +21 -0
  310. package/dist/solutions-components/solutions-components.esm.js +1 -1
  311. package/dist/solutions-components/utils/pciUtils.ts +30 -7
  312. package/dist/types/utils/pciUtils.d.ts +2 -1
  313. package/package.json +4 -3
  314. package/dist/solutions-components/p-647bbd18.js +0 -21
@@ -0,0 +1,588 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
7
+ import { l as loadModules } from './loadModules.js';
8
+ import { a as goToSelection, h as highlightFeatures } from './mapViewUtils.js';
9
+ import { a as queryObjectIds, b as getQueryGeoms } from './queryUtils.js';
10
+ import { c as EWorkflowType, e as ESelectionMode, f as ERefineMode, b as ESketchType } from './interfaces3.js';
11
+ import { s as state } from './publicNotificationStore.js';
12
+ import { g as getLocaleComponentStrings } from './locale.js';
13
+ import { d as defineCustomElement$k } from './buffer-tools2.js';
14
+ import { d as defineCustomElement$j } from './action.js';
15
+ import { d as defineCustomElement$i } from './checkbox.js';
16
+ import { d as defineCustomElement$h } from './chip.js';
17
+ import { d as defineCustomElement$g } from './combobox.js';
18
+ import { d as defineCustomElement$f } from './combobox-item.js';
19
+ import { d as defineCustomElement$e } from './graph.js';
20
+ import { d as defineCustomElement$d } from './icon.js';
21
+ import { d as defineCustomElement$c } from './input.js';
22
+ import { d as defineCustomElement$b } from './label.js';
23
+ import { d as defineCustomElement$a } from './loader.js';
24
+ import { d as defineCustomElement$9 } from './option.js';
25
+ import { d as defineCustomElement$8 } from './progress.js';
26
+ import { d as defineCustomElement$7 } from './radio-group.js';
27
+ import { d as defineCustomElement$6 } from './radio-group-item.js';
28
+ import { d as defineCustomElement$5 } from './select.js';
29
+ import { d as defineCustomElement$4 } from './slider.js';
30
+ import { d as defineCustomElement$3 } from './map-draw-tools2.js';
31
+ import { d as defineCustomElement$2 } from './map-layer-picker2.js';
32
+ import { d as defineCustomElement$1 } from './refine-selection-tools2.js';
33
+
34
+ const mapSelectToolsCss = ":host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:\"1rem\" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}";
35
+
36
+ const MapSelectTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
37
+ constructor() {
38
+ super();
39
+ this.__registerHost();
40
+ this.selectionSetChange = createEvent(this, "selectionSetChange", 7);
41
+ this.sketchTypeChange = createEvent(this, "sketchTypeChange", 7);
42
+ this.workflowTypeChange = createEvent(this, "workflowTypeChange", 7);
43
+ /**
44
+ * number[]: the oids of the selected features
45
+ */
46
+ this._selectedIds = [];
47
+ /**
48
+ * string: A label to help uniquely identify the selection set
49
+ */
50
+ this._selectionLabel = "";
51
+ this.geometries = undefined;
52
+ this.isUpdate = false;
53
+ this.mapView = undefined;
54
+ this.selectionSet = undefined;
55
+ this.selectLayerView = undefined;
56
+ this.showBufferTools = true;
57
+ this._layerSelectChecked = undefined;
58
+ this._searchTerm = undefined;
59
+ this._translations = undefined;
60
+ this._workflowType = undefined;
61
+ }
62
+ //--------------------------------------------------------------------------
63
+ //
64
+ // Watch handlers
65
+ //
66
+ //--------------------------------------------------------------------------
67
+ /**
68
+ * Called each time the geometries prop is changed.
69
+ *
70
+ * @returns Promise when complete
71
+ */
72
+ async watchGeometriesHandler(newValue, oldValue) {
73
+ if (newValue !== oldValue) {
74
+ if (newValue.length > 0) {
75
+ return this._geomQuery(this.geometries);
76
+ }
77
+ else if (newValue.length === 0) {
78
+ return this._clearResults(true, true);
79
+ }
80
+ }
81
+ }
82
+ /**
83
+ * Called each time the workflowType prop is changed and emits the workflowTypeChange event.
84
+ *
85
+ * @returns Promise when complete
86
+ */
87
+ async workflowTypeHandler(newValue, oldValue) {
88
+ if (newValue !== oldValue) {
89
+ this.mapView.popup.autoOpenEnabled = ["SELECT", "SKETCH", "REFINE"].indexOf(newValue) < 0;
90
+ this.workflowTypeChange.emit(newValue);
91
+ }
92
+ }
93
+ //--------------------------------------------------------------------------
94
+ //
95
+ // Methods (public)
96
+ //
97
+ //--------------------------------------------------------------------------
98
+ /**
99
+ * Clear any selection results
100
+ *
101
+ * @returns Promise when the results have been cleared
102
+ */
103
+ async clearSelection() {
104
+ return this._clearResults();
105
+ }
106
+ /**
107
+ * Get the new selection set
108
+ *
109
+ * @returns Promise with the new selection set
110
+ */
111
+ async getSelection() {
112
+ return {
113
+ id: this.isUpdate ? this.selectionSet.id : Date.now(),
114
+ workflowType: this._workflowType,
115
+ searchResult: this._searchResult,
116
+ buffer: this._bufferGeometry,
117
+ distance: this._bufferTools.distance,
118
+ download: true,
119
+ unit: this._bufferTools.unit,
120
+ label: this._workflowType === EWorkflowType.SEARCH ?
121
+ this._selectionLabel : `${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,
122
+ selectedIds: this._selectedIds,
123
+ layerView: this.selectLayerView,
124
+ geometries: this.geometries,
125
+ refineSelectLayers: this._refineTools.layerViews
126
+ };
127
+ }
128
+ /**
129
+ * Listen to changes in the sketch graphics
130
+ *
131
+ */
132
+ sketchGraphicsChange(event) {
133
+ this._updateSelection(EWorkflowType.SKETCH, event.detail, this._translations.sketch);
134
+ }
135
+ /**
136
+ * Listen to changes in the refine graphics
137
+ *
138
+ */
139
+ refineSelectionGraphicsChange(event) {
140
+ const graphics = event.detail;
141
+ this._updateSelection(EWorkflowType.SELECT, graphics, this._translations.select);
142
+ // Using OIDs to avoid issue with points
143
+ const oids = Array.isArray(graphics) ? graphics.map(g => g.attributes[g.layer.objectIdField]) : [];
144
+ return this._highlightFeatures(oids);
145
+ }
146
+ //--------------------------------------------------------------------------
147
+ //
148
+ // Functions (lifecycle)
149
+ //
150
+ //--------------------------------------------------------------------------
151
+ /**
152
+ * StencilJS: Called once just after the component is first connected to the DOM.
153
+ */
154
+ async componentWillLoad() {
155
+ await this._getTranslations();
156
+ await this._initModules();
157
+ }
158
+ /**
159
+ * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
160
+ */
161
+ async componentDidLoad() {
162
+ return this._init();
163
+ }
164
+ /**
165
+ * Renders the component.
166
+ */
167
+ render() {
168
+ var _a, _b;
169
+ const searchEnabled = this._workflowType === EWorkflowType.SEARCH;
170
+ const showSearchClass = searchEnabled ? " div-visible-search" : " div-not-visible";
171
+ const drawEnabled = this._workflowType === EWorkflowType.SKETCH || this._workflowType === EWorkflowType.SELECT;
172
+ //const showDrawToolsClass = drawEnabled ? " div-visible" : " div-not-visible";
173
+ // const selectEnabled = this._workflowType === EWorkflowType.SELECT;
174
+ // const showSelectToolsClass = selectEnabled ? " div-visible" : " div-not-visible";
175
+ const showBufferToolsClass = this.showBufferTools ? "search-distance" : "div-not-visible";
176
+ const useSelectClass = this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
177
+ const useDrawClass = !this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
178
+ const showLayerChoiceClass = searchEnabled ? "div-not-visible" : "div-visible";
179
+ return (h(Host, null, h("div", { class: "padding-bottom-1" }, h("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._workflowChange(evt) }, h("calcite-radio-group-item", { checked: searchEnabled, class: "w-50 end-border", value: EWorkflowType.SEARCH }, this._translations.search), h("calcite-radio-group-item", { checked: drawEnabled, class: "w-50", value: EWorkflowType.SKETCH }, this._translations.sketch))), h("div", { class: showSearchClass }, h("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })), h("div", { class: showLayerChoiceClass }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { onCalciteCheckboxChange: () => this._layerSelectChanged(), ref: (el) => this._selectFromLayerElement = el }), "Use layer features")), h("div", { class: useDrawClass }, h("map-draw-tools", {
180
+ //active={drawEnabled}
181
+ active: true, border: true,
182
+ //class={showDrawToolsClass}
183
+ mapView: this.mapView, ref: (el) => { this._drawTools = el; }
184
+ })), h("div", { class: useSelectClass }, h("refine-selection-tools", {
185
+ //active={selectEnabled}
186
+ active: true, border: true,
187
+ //class={showSelectToolsClass}
188
+ layerViews: this._refineSelectLayers, mapView: this.mapView, mode: ESelectionMode.ADD, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.SUBSET
189
+ })), h("calcite-label", { class: showBufferToolsClass }, this._translations.searchDistance, h("buffer-tools", { distance: (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.distance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: (_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.unit })), h("slot", null)));
190
+ }
191
+ //--------------------------------------------------------------------------
192
+ //
193
+ // Functions (protected)
194
+ //
195
+ //--------------------------------------------------------------------------
196
+ /**
197
+ * Load esri javascript api modules
198
+ *
199
+ * @returns Promise resolving when function is done
200
+ *
201
+ * @protected
202
+ */
203
+ async _initModules() {
204
+ const [GraphicsLayer, Graphic, Search, Geometry, geometryEngine] = await loadModules([
205
+ "esri/layers/GraphicsLayer",
206
+ "esri/Graphic",
207
+ "esri/widgets/Search",
208
+ "esri/geometry/Geometry",
209
+ "esri/geometry/geometryEngine"
210
+ ]);
211
+ this.GraphicsLayer = GraphicsLayer;
212
+ this.Graphic = Graphic;
213
+ this.Search = Search;
214
+ this.Geometry = Geometry;
215
+ this._geometryEngine = geometryEngine;
216
+ }
217
+ /**
218
+ * Initialize the graphics layer, selection set, and search widget
219
+ *
220
+ * @returns Promise when the operation has completed
221
+ */
222
+ async _init() {
223
+ this._initGraphicsLayer();
224
+ this._initSelectionSet();
225
+ this._initSearchWidget();
226
+ }
227
+ /**
228
+ * Initialize the state of the component with any stored values in a selection set
229
+ *
230
+ * @protected
231
+ */
232
+ _initSelectionSet() {
233
+ var _a, _b, _c, _d, _e, _f, _g;
234
+ if (this.selectionSet) {
235
+ this._searchTerm = (_b = (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.searchResult) === null || _b === void 0 ? void 0 : _b.name;
236
+ this._workflowType = (_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.workflowType;
237
+ this._searchResult = (_d = this.selectionSet) === null || _d === void 0 ? void 0 : _d.searchResult;
238
+ this._refineSelectLayers = (_e = this.selectionSet) === null || _e === void 0 ? void 0 : _e.refineSelectLayers;
239
+ this.geometries = [
240
+ ...(_f = this.selectionSet) === null || _f === void 0 ? void 0 : _f.geometries
241
+ ];
242
+ // reset selection label base
243
+ this._selectionLabel = this._workflowType === EWorkflowType.SKETCH ?
244
+ this._translations.sketch : this._workflowType === EWorkflowType.SELECT ?
245
+ this._translations.select : (_g = this.selectionSet) === null || _g === void 0 ? void 0 : _g.label;
246
+ void goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
247
+ }
248
+ else {
249
+ this._workflowType = EWorkflowType.SEARCH;
250
+ }
251
+ }
252
+ /**
253
+ * Initialize the search widget
254
+ *
255
+ * @protected
256
+ */
257
+ _initSearchWidget() {
258
+ if (this.mapView && this._searchElement) {
259
+ const searchOptions = {
260
+ view: this.mapView,
261
+ container: this._searchElement,
262
+ searchTerm: this._searchTerm
263
+ };
264
+ this._searchWidget = new this.Search(searchOptions);
265
+ this._searchWidget.on("search-clear", () => {
266
+ void this._clearResults(false);
267
+ });
268
+ this._searchWidget.on("select-result", (searchResults) => {
269
+ var _a;
270
+ void this._clearResults(false);
271
+ if (searchResults.result) {
272
+ this._searchResult = searchResults.result;
273
+ this._updateSelection(EWorkflowType.SEARCH, [searchResults.result.feature], (_a = searchResults === null || searchResults === void 0 ? void 0 : searchResults.result) === null || _a === void 0 ? void 0 : _a.name);
274
+ }
275
+ });
276
+ }
277
+ }
278
+ /**
279
+ * Initialize the graphics layer used to store any buffer grapghics
280
+ *
281
+ * @protected
282
+ */
283
+ _initGraphicsLayer() {
284
+ const title = this._translations.bufferLayer;
285
+ const bufferIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
286
+ if (bufferIndex > -1) {
287
+ this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
288
+ }
289
+ else {
290
+ this._bufferGraphicsLayer = new this.GraphicsLayer({ title });
291
+ state.managedLayers.push(title);
292
+ const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
293
+ if (sketchIndex > -1) {
294
+ this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
295
+ }
296
+ else {
297
+ this.mapView.map.layers.add(this._bufferGraphicsLayer);
298
+ }
299
+ }
300
+ }
301
+ /**
302
+ * Store the layer select checked change
303
+ *
304
+ * @protected
305
+ */
306
+ _layerSelectChanged() {
307
+ this._layerSelectChecked = this._selectFromLayerElement.checked;
308
+ this.sketchTypeChange.emit(this._layerSelectChecked ? ESketchType.LAYER : ESketchType.INTERACTIVE);
309
+ }
310
+ /**
311
+ * Store workflow type change
312
+ *
313
+ * @protected
314
+ */
315
+ _workflowChange(evt) {
316
+ this._workflowType = evt.detail;
317
+ }
318
+ /**
319
+ * Highlight the features in the map
320
+ *
321
+ * @protected
322
+ */
323
+ async _highlightFeatures(ids) {
324
+ var _a;
325
+ (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
326
+ if (ids.length > 0) {
327
+ state.highlightHandle = await highlightFeatures(ids, this.selectLayerView, this.mapView);
328
+ }
329
+ this.selectionSetChange.emit(ids.length);
330
+ }
331
+ /**
332
+ * Query the selectLayerView based on any user drawn geometries or buffers
333
+ *
334
+ * @param geometries Array of geometries used for the selection of ids from the select layer view
335
+ *
336
+ * @returns Promise when the selection is complete and the graphics have been highlighted
337
+ */
338
+ async _selectFeatures(geometries) {
339
+ this._selectedIds = await queryObjectIds(geometries, this.selectLayerView.layer);
340
+ // Add geometries used for selecting features as graphics
341
+ this._drawTools.graphics = this.geometries.map(geom => {
342
+ var _a, _b, _c;
343
+ const props = {
344
+ "geometry": geom,
345
+ "symbol": geom.type === "point" ?
346
+ (_a = this._drawTools) === null || _a === void 0 ? void 0 : _a.pointSymbol : geom.type === "polyline" ?
347
+ (_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.polylineSymbol : geom.type === "polygon" ?
348
+ (_c = this._drawTools) === null || _c === void 0 ? void 0 : _c.polygonSymbol : undefined
349
+ };
350
+ return new this.Graphic(props);
351
+ });
352
+ void this._highlightFeatures(this._selectedIds);
353
+ }
354
+ /**
355
+ * Query the selectLayerView based on any user drawn geometries or buffers
356
+ *
357
+ * @param evt CustomEvent that contains the result of the buffer
358
+ *
359
+ * @protected
360
+ */
361
+ async _bufferComplete(evt) {
362
+ this._bufferGeometry = Array.isArray(evt.detail) ?
363
+ evt.detail[0] : evt.detail;
364
+ if (this._bufferGeometry) {
365
+ // Create a symbol for rendering the graphic
366
+ const symbol = {
367
+ type: "simple-fill",
368
+ color: [227, 139, 79, 0.8],
369
+ outline: {
370
+ color: [255, 255, 255],
371
+ width: 1
372
+ }
373
+ };
374
+ // Add the geometry and symbol to a new graphic
375
+ const polygonGraphic = new this.Graphic({
376
+ geometry: this._bufferGeometry,
377
+ symbol
378
+ });
379
+ this._bufferGraphicsLayer.removeAll();
380
+ this._bufferGraphicsLayer.add(polygonGraphic);
381
+ void this._selectFeatures([this._bufferGeometry]);
382
+ void this.mapView.goTo(polygonGraphic.geometry.extent);
383
+ }
384
+ else {
385
+ if (this._bufferGraphicsLayer) {
386
+ this._bufferGraphicsLayer.removeAll();
387
+ }
388
+ void this._geomQuery(this.geometries);
389
+ }
390
+ }
391
+ /**
392
+ * Fetch a single geometry for each potential geometry type
393
+ *
394
+ * @param geometries All current selection geometries
395
+ *
396
+ * @protected
397
+ */
398
+ _geomQuery(geometries) {
399
+ const queryGeoms = getQueryGeoms(geometries, this._geometryEngine);
400
+ return this._selectFeatures(queryGeoms);
401
+ }
402
+ /**
403
+ * Clear all stored values and general state for the component
404
+ *
405
+ * @param clearSearchWidget Optional boolean for clearing the search widget (default is true)
406
+ * @param clearLabel Optional boolean for clearing the search label (default is true)
407
+ *
408
+ * @protected
409
+ */
410
+ async _clearResults(clearSearchWidget = true, clearLabel = true) {
411
+ var _a, _b;
412
+ this._selectedIds = [];
413
+ if (clearLabel) {
414
+ this._selectionLabel = "";
415
+ }
416
+ if (this._bufferGraphicsLayer) {
417
+ this._bufferGraphicsLayer.removeAll();
418
+ }
419
+ if (clearSearchWidget && this._searchWidget) {
420
+ this._searchWidget.clear();
421
+ }
422
+ (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
423
+ // for sketch
424
+ // checking for clear as it would throw off tests
425
+ if ((_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.clear) {
426
+ void this._drawTools.clear();
427
+ }
428
+ this.selectionSetChange.emit(this._selectedIds.length);
429
+ }
430
+ /**
431
+ * Fetch a single geometry for the current geometry type
432
+ *
433
+ * @param type worflow type
434
+ * @param graphics graphics to be used for selection
435
+ * @param label selection label
436
+ *
437
+ * @protected
438
+ */
439
+ _updateSelection(type, graphics, label) {
440
+ this.geometries = Array.isArray(graphics) ? graphics.map(g => g.geometry) : this.geometries;
441
+ this._workflowType = type;
442
+ this._selectionLabel = label;
443
+ }
444
+ /**
445
+ * Fetches the component's translations
446
+ *
447
+ * @protected
448
+ */
449
+ async _getTranslations() {
450
+ const translations = await getLocaleComponentStrings(this.el);
451
+ this._translations = translations[0];
452
+ }
453
+ get el() { return this; }
454
+ static get watchers() { return {
455
+ "geometries": ["watchGeometriesHandler"],
456
+ "_workflowType": ["workflowTypeHandler"]
457
+ }; }
458
+ static get style() { return mapSelectToolsCss; }
459
+ }, [4, "map-select-tools", {
460
+ "geometries": [16],
461
+ "isUpdate": [4, "is-update"],
462
+ "mapView": [16],
463
+ "selectionSet": [16],
464
+ "selectLayerView": [16],
465
+ "showBufferTools": [4, "show-buffer-tools"],
466
+ "_layerSelectChecked": [32],
467
+ "_searchTerm": [32],
468
+ "_translations": [32],
469
+ "_workflowType": [32],
470
+ "clearSelection": [64],
471
+ "getSelection": [64]
472
+ }, [[8, "sketchGraphicsChange", "sketchGraphicsChange"], [8, "refineSelectionGraphicsChange", "refineSelectionGraphicsChange"]]]);
473
+ function defineCustomElement() {
474
+ if (typeof customElements === "undefined") {
475
+ return;
476
+ }
477
+ const components = ["map-select-tools", "buffer-tools", "calcite-action", "calcite-checkbox", "calcite-chip", "calcite-combobox", "calcite-combobox-item", "calcite-graph", "calcite-icon", "calcite-input", "calcite-label", "calcite-loader", "calcite-option", "calcite-progress", "calcite-radio-group", "calcite-radio-group-item", "calcite-select", "calcite-slider", "map-draw-tools", "map-layer-picker", "refine-selection-tools"];
478
+ components.forEach(tagName => { switch (tagName) {
479
+ case "map-select-tools":
480
+ if (!customElements.get(tagName)) {
481
+ customElements.define(tagName, MapSelectTools);
482
+ }
483
+ break;
484
+ case "buffer-tools":
485
+ if (!customElements.get(tagName)) {
486
+ defineCustomElement$k();
487
+ }
488
+ break;
489
+ case "calcite-action":
490
+ if (!customElements.get(tagName)) {
491
+ defineCustomElement$j();
492
+ }
493
+ break;
494
+ case "calcite-checkbox":
495
+ if (!customElements.get(tagName)) {
496
+ defineCustomElement$i();
497
+ }
498
+ break;
499
+ case "calcite-chip":
500
+ if (!customElements.get(tagName)) {
501
+ defineCustomElement$h();
502
+ }
503
+ break;
504
+ case "calcite-combobox":
505
+ if (!customElements.get(tagName)) {
506
+ defineCustomElement$g();
507
+ }
508
+ break;
509
+ case "calcite-combobox-item":
510
+ if (!customElements.get(tagName)) {
511
+ defineCustomElement$f();
512
+ }
513
+ break;
514
+ case "calcite-graph":
515
+ if (!customElements.get(tagName)) {
516
+ defineCustomElement$e();
517
+ }
518
+ break;
519
+ case "calcite-icon":
520
+ if (!customElements.get(tagName)) {
521
+ defineCustomElement$d();
522
+ }
523
+ break;
524
+ case "calcite-input":
525
+ if (!customElements.get(tagName)) {
526
+ defineCustomElement$c();
527
+ }
528
+ break;
529
+ case "calcite-label":
530
+ if (!customElements.get(tagName)) {
531
+ defineCustomElement$b();
532
+ }
533
+ break;
534
+ case "calcite-loader":
535
+ if (!customElements.get(tagName)) {
536
+ defineCustomElement$a();
537
+ }
538
+ break;
539
+ case "calcite-option":
540
+ if (!customElements.get(tagName)) {
541
+ defineCustomElement$9();
542
+ }
543
+ break;
544
+ case "calcite-progress":
545
+ if (!customElements.get(tagName)) {
546
+ defineCustomElement$8();
547
+ }
548
+ break;
549
+ case "calcite-radio-group":
550
+ if (!customElements.get(tagName)) {
551
+ defineCustomElement$7();
552
+ }
553
+ break;
554
+ case "calcite-radio-group-item":
555
+ if (!customElements.get(tagName)) {
556
+ defineCustomElement$6();
557
+ }
558
+ break;
559
+ case "calcite-select":
560
+ if (!customElements.get(tagName)) {
561
+ defineCustomElement$5();
562
+ }
563
+ break;
564
+ case "calcite-slider":
565
+ if (!customElements.get(tagName)) {
566
+ defineCustomElement$4();
567
+ }
568
+ break;
569
+ case "map-draw-tools":
570
+ if (!customElements.get(tagName)) {
571
+ defineCustomElement$3();
572
+ }
573
+ break;
574
+ case "map-layer-picker":
575
+ if (!customElements.get(tagName)) {
576
+ defineCustomElement$2();
577
+ }
578
+ break;
579
+ case "refine-selection-tools":
580
+ if (!customElements.get(tagName)) {
581
+ defineCustomElement$1();
582
+ }
583
+ break;
584
+ } });
585
+ }
586
+ defineCustomElement();
587
+
588
+ export { MapSelectTools as M, defineCustomElement as d };