@esri/solutions-components 0.6.16 → 0.6.18

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 (216) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/t9n/map-tools/resources.json +2 -1
  3. package/dist/assets/t9n/map-tools/resources_en.json +2 -1
  4. package/dist/assets/t9n/solution-spatial-ref/resources.json +0 -1
  5. package/dist/assets/t9n/solution-spatial-ref/resources_en.json +0 -1
  6. package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +6 -0
  7. package/dist/assets/t9n/solution-spatial-ref/resources_he.json +6 -0
  8. package/dist/assets/t9n/spatial-ref/resources.json +3 -0
  9. package/dist/assets/t9n/spatial-ref/resources_en.json +3 -0
  10. package/dist/assets/t9n/spatial-ref/resources_fr.json +3 -0
  11. package/dist/assets/t9n/spatial-ref/resources_he.json +3 -0
  12. package/dist/cjs/{basemap-gallery_6.cjs.entry.js → basemap-gallery_7.cjs.entry.js} +124 -3
  13. package/dist/cjs/{calcite-tree_3.cjs.entry.js → calcite-checkbox_3.cjs.entry.js} +123 -319
  14. package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
  15. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +4 -3
  16. package/dist/cjs/card-manager_3.cjs.entry.js +10 -7
  17. package/dist/{collection/components/basemap-gallery/test/basemap-gallery.e2e.js → cjs/common-13719149.js} +17 -9
  18. package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -7
  19. package/dist/cjs/{downloadUtils-34a515ad.js → downloadUtils-121fd7ff.js} +2 -2
  20. package/dist/cjs/edit-card_2.cjs.entry.js +4 -3
  21. package/dist/cjs/{index.es-0ba11065.js → index.es-5c0c137a.js} +2 -2
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  24. package/dist/cjs/{mapViewUtils-a2884698.js → mapViewUtils-786a219b.js} +32 -19
  25. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  26. package/dist/cjs/solution-configuration.cjs.entry.js +2 -1
  27. package/dist/cjs/solution-contents_3.cjs.entry.js +21 -21256
  28. package/dist/cjs/solution-item-icon.cjs.entry.js +327 -0
  29. package/dist/cjs/{solution-store-c443e657.js → solution-resource-f9e3b289.js} +2 -1698
  30. package/dist/cjs/solution-store-2414dd8a.js +1707 -0
  31. package/dist/cjs/solutions-components.cjs.js +1 -1
  32. package/dist/cjs/spatial-ref.cjs.entry.js +21293 -0
  33. package/dist/collection/collection-manifest.json +2 -0
  34. package/dist/collection/components/card-manager/card-manager.js +1 -1
  35. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +17 -2
  36. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +47 -6
  37. package/dist/collection/components/edit-card/edit-card.css +0 -8
  38. package/dist/collection/components/floor-filter/floor-filter.css +19 -0
  39. package/dist/collection/components/floor-filter/floor-filter.js +163 -0
  40. package/dist/collection/components/info-card/info-card.js +3 -2
  41. package/dist/collection/components/layer-table/layer-table.css +8 -0
  42. package/dist/collection/components/layer-table/layer-table.js +18 -2
  43. package/dist/collection/components/map-card/map-card.js +19 -1
  44. package/dist/collection/components/map-picker/map-picker.css +0 -4
  45. package/dist/collection/components/map-picker/map-picker.js +1 -1
  46. package/dist/collection/components/map-tools/map-tools.js +54 -1
  47. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +1 -7
  48. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +37 -291
  49. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +24 -12
  50. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +32 -128
  51. package/dist/collection/components/spatial-ref/spatial-ref.css +20 -0
  52. package/dist/collection/components/spatial-ref/spatial-ref.js +445 -0
  53. package/dist/collection/components/spatial-ref/test/spatial-ref.e2e.js +71 -0
  54. package/dist/collection/components/spatial-ref/test/spatial-ref.spec.js +158 -0
  55. package/dist/collection/demos/crowdsource-manager.html +4 -0
  56. package/dist/collection/demos/solution-spatial-ref.html +9 -16
  57. package/dist/collection/demos/spatial-ref.html +53 -0
  58. package/dist/collection/utils/mapViewUtils.js +32 -19
  59. package/dist/collection/utils/mapViewUtils.ts +43 -20
  60. package/dist/collection/utils/{templates.e2e.js → test/templates.e2e.js} +2 -2
  61. package/dist/collection/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
  62. package/dist/components/card-manager2.js +1 -1
  63. package/dist/components/crowdsource-manager.js +86 -73
  64. package/dist/components/edit-card2.js +1 -1
  65. package/dist/components/floor-filter.d.ts +11 -0
  66. package/dist/components/floor-filter.js +11 -0
  67. package/dist/components/floor-filter2.js +115 -0
  68. package/dist/components/info-card2.js +3 -2
  69. package/dist/components/layer-table2.js +5 -3
  70. package/dist/components/map-card2.js +45 -37
  71. package/dist/components/map-picker2.js +2 -2
  72. package/dist/components/map-tools2.js +52 -11
  73. package/dist/components/mapViewUtils.js +32 -19
  74. package/dist/components/solution-configuration.js +79 -72
  75. package/dist/components/solution-resource-item2.js +2 -1
  76. package/dist/components/solution-resource.js +1836 -0
  77. package/dist/components/solution-spatial-ref2.js +41 -21277
  78. package/dist/components/solution-store.js +2 -1830
  79. package/dist/components/spatial-ref.d.ts +11 -0
  80. package/dist/components/spatial-ref.js +11 -0
  81. package/dist/components/spatial-ref2.js +21374 -0
  82. package/dist/esm/{basemap-gallery_6.entry.js → basemap-gallery_7.entry.js} +124 -4
  83. package/dist/esm/{calcite-tree_3.entry.js → calcite-checkbox_3.entry.js} +125 -321
  84. package/dist/esm/calcite-combobox_6.entry.js +1 -1
  85. package/dist/esm/calcite-shell-panel_14.entry.js +2 -1
  86. package/dist/esm/card-manager_3.entry.js +10 -7
  87. package/dist/{collection/components/layer-table/test/layer-table.e2e.js → esm/common-e4a8e353.js} +15 -9
  88. package/dist/esm/crowdsource-manager.entry.js +12 -7
  89. package/dist/esm/{downloadUtils-ac67a786.js → downloadUtils-287994b1.js} +2 -2
  90. package/dist/esm/edit-card_2.entry.js +4 -3
  91. package/dist/esm/{index.es-f553598f.js → index.es-a3f8409f.js} +2 -2
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/map-select-tools_3.entry.js +2 -2
  94. package/dist/esm/{mapViewUtils-8141d8c1.js → mapViewUtils-8bfabd80.js} +32 -19
  95. package/dist/esm/public-notification.entry.js +2 -2
  96. package/dist/esm/solution-configuration.entry.js +2 -1
  97. package/dist/esm/solution-contents_3.entry.js +20 -21255
  98. package/dist/esm/solution-item-icon.entry.js +323 -0
  99. package/dist/esm/{solution-store-b29d50f7.js → solution-resource-be35d35b.js} +1 -1697
  100. package/dist/esm/solution-store-e734626a.js +1704 -0
  101. package/dist/esm/solutions-components.js +1 -1
  102. package/dist/esm/spatial-ref.entry.js +21289 -0
  103. package/dist/solutions-components/demos/crowdsource-manager.html +4 -0
  104. package/dist/solutions-components/demos/solution-spatial-ref.html +9 -16
  105. package/dist/solutions-components/demos/spatial-ref.html +53 -0
  106. package/dist/solutions-components/{p-64d29ba2.entry.js → p-0bc27ba7.entry.js} +2 -2
  107. package/dist/{collection/components/map-card/test/map-card.e2e.js → solutions-components/p-1b228f97.js} +2 -10
  108. package/dist/solutions-components/{p-9f11a403.entry.js → p-3c5c1487.entry.js} +1 -1
  109. package/dist/solutions-components/{p-a26711e8.js → p-469c8f8a.js} +1 -1
  110. package/dist/solutions-components/p-53bc5fc1.js +36 -0
  111. package/dist/solutions-components/p-5b8c8942.entry.js +21 -0
  112. package/dist/solutions-components/p-63c6fc29.entry.js +6 -0
  113. package/dist/solutions-components/p-64945b43.entry.js +18 -0
  114. package/dist/solutions-components/{p-c8d0ce92.js → p-698c6a56.js} +2 -2
  115. package/dist/solutions-components/{p-b9d29f30.entry.js → p-734cb206.entry.js} +1 -1
  116. package/dist/solutions-components/p-770bff06.entry.js +6 -0
  117. package/dist/solutions-components/p-7741dbab.entry.js +6 -0
  118. package/dist/solutions-components/p-80465067.entry.js +6 -0
  119. package/dist/solutions-components/p-846df994.entry.js +6 -0
  120. package/dist/solutions-components/p-b3f8d2cb.js +192 -0
  121. package/dist/solutions-components/p-c26d8b36.entry.js +6 -0
  122. package/dist/solutions-components/{p-57cf6784.entry.js → p-d22be647.entry.js} +1 -1
  123. package/dist/solutions-components/{p-4d942b0f.entry.js → p-f35147d5.entry.js} +1 -1
  124. package/dist/solutions-components/p-ff0d7712.js +44 -0
  125. package/dist/solutions-components/solutions-components.esm.js +1 -1
  126. package/dist/solutions-components/utils/mapViewUtils.ts +43 -20
  127. package/dist/solutions-components/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
  128. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
  129. package/dist/types/components/floor-filter/floor-filter.d.ts +61 -0
  130. package/dist/types/components/layer-table/layer-table.d.ts +4 -0
  131. package/dist/types/components/map-card/map-card.d.ts +4 -0
  132. package/dist/types/components/map-tools/map-tools.d.ts +24 -0
  133. package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +11 -93
  134. package/dist/types/components/spatial-ref/spatial-ref.d.ts +142 -0
  135. package/dist/types/components.d.ts +123 -16
  136. package/dist/types/preact.d.ts +8 -1
  137. package/package.json +6 -6
  138. package/dist/cjs/calcite-checkbox.cjs.entry.js +0 -136
  139. package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +0 -37
  140. package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +0 -29
  141. package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +0 -160
  142. package/dist/collection/components/card-manager/test/card-manager.e2e.js +0 -29
  143. package/dist/collection/components/card-manager/test/card-manager.spec.js +0 -37
  144. package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +0 -29
  145. package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +0 -37
  146. package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +0 -29
  147. package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +0 -37
  148. package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +0 -29
  149. package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +0 -37
  150. package/dist/collection/components/edit-card/test/edit-card.e2e.js +0 -14
  151. package/dist/collection/components/edit-card/test/edit-card.spec.js +0 -22
  152. package/dist/collection/components/info-card/test/info-card.e2e.js +0 -29
  153. package/dist/collection/components/info-card/test/info-card.spec.js +0 -37
  154. package/dist/collection/components/json-editor/test/json-editor.e2e.js +0 -36
  155. package/dist/collection/components/json-editor/test/json-editor.spec.js +0 -65
  156. package/dist/collection/components/layer-table/test/layer-table.spec.js +0 -37
  157. package/dist/collection/components/layout-manager/test/layout-manager.e2e.js +0 -29
  158. package/dist/collection/components/layout-manager/test/layout-manager.spec.js +0 -37
  159. package/dist/collection/components/list-item/test/list-item.e2e.js +0 -29
  160. package/dist/collection/components/list-item/test/list-item.spec.js +0 -37
  161. package/dist/collection/components/map-card/test/map-card.spec.js +0 -37
  162. package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +0 -29
  163. package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +0 -37
  164. package/dist/collection/components/map-fullscreen/test/map-fullscreen.e2e.js +0 -29
  165. package/dist/collection/components/map-fullscreen/test/map-fullscreen.spec.js +0 -37
  166. package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +0 -29
  167. package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +0 -114
  168. package/dist/collection/components/map-legend/test/map-legend.e2e.js +0 -14
  169. package/dist/collection/components/map-legend/test/map-legend.spec.js +0 -22
  170. package/dist/collection/components/map-picker/test/map-picker.e2e.js +0 -29
  171. package/dist/collection/components/map-picker/test/map-picker.spec.js +0 -37
  172. package/dist/collection/components/map-search/test/map-search.e2e.js +0 -29
  173. package/dist/collection/components/map-search/test/map-search.spec.js +0 -37
  174. package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +0 -29
  175. package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +0 -366
  176. package/dist/collection/components/map-tools/test/map-tools.e2e.js +0 -29
  177. package/dist/collection/components/map-tools/test/map-tools.spec.js +0 -37
  178. package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +0 -29
  179. package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +0 -37
  180. package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +0 -76
  181. package/dist/collection/components/pdf-download/test/pdf-download.spec.js +0 -107
  182. package/dist/collection/components/public-notification/test/public-notification.spec.js +0 -161
  183. package/dist/collection/components/refine-selection/test/refine-selection.e2e.js +0 -14
  184. package/dist/collection/components/refine-selection/test/refine-selection.spec.js +0 -22
  185. package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +0 -36
  186. package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +0 -119
  187. package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +0 -94
  188. package/dist/collection/components/solution-contents/test/solution-contents.spec.js +0 -143
  189. package/dist/collection/components/solution-item/test/solution-item.e2e.js +0 -36
  190. package/dist/collection/components/solution-item/test/solution-item.spec.js +0 -77
  191. package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +0 -36
  192. package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +0 -142
  193. package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +0 -29
  194. package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +0 -39
  195. package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +0 -36
  196. package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +0 -54
  197. package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +0 -36
  198. package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +0 -65
  199. package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +0 -36
  200. package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +0 -55
  201. package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +0 -36
  202. package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +0 -60
  203. package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +0 -36
  204. package/dist/collection/components/solution-variables/test/solution-variables.spec.js +0 -131
  205. package/dist/esm/calcite-checkbox.entry.js +0 -132
  206. package/dist/solutions-components/p-07d7e11f.entry.js +0 -6
  207. package/dist/solutions-components/p-16362eb4.js +0 -36
  208. package/dist/solutions-components/p-17d176b5.js +0 -230
  209. package/dist/solutions-components/p-1d9a5198.entry.js +0 -37
  210. package/dist/solutions-components/p-3707d9bd.entry.js +0 -6
  211. package/dist/solutions-components/p-4dbe8337.entry.js +0 -6
  212. package/dist/solutions-components/p-5ffaaaf4.entry.js +0 -6
  213. package/dist/solutions-components/p-736e76fb.entry.js +0 -17
  214. package/dist/solutions-components/p-99f1a767.entry.js +0 -6
  215. /package/dist/collection/components/{solution-spatial-ref → spatial-ref}/spatialreferences.js +0 -0
  216. /package/dist/types/components/{solution-spatial-ref → spatial-ref}/spatialreferences.d.ts +0 -0
@@ -17,7 +17,7 @@
17
17
  margin-inline-end: 0.5rem;
18
18
  }
19
19
 
20
- .spatial-ref-switch-title {
20
+ .spatial-ref-component {
21
21
  margin-top: 0.625rem;
22
22
  margin-inline-start: 2.5rem;
23
23
  }
@@ -52,12 +52,6 @@
52
52
  opacity: 0.4;
53
53
  }
54
54
 
55
- .spatial-ref-container {
56
- max-height: 200px;
57
- margin-bottom: 1rem;
58
- overflow-y: auto;
59
- }
60
-
61
55
  .spatial-ref-desc {
62
56
  padding-bottom: 0.5rem;
63
57
  padding-inline-start: 0.25rem;
@@ -18,39 +18,26 @@
18
18
  * See the License for the specific language governing permissions and
19
19
  * limitations under the License.
20
20
  */
21
- import { h, Host } from "@stencil/core";
22
21
  import "@esri/calcite-components";
23
- import { wkids } from "./spatialreferences";
24
22
  import state from "../../utils/solution-store";
25
- import { nodeListToArray } from "../../utils/common";
23
+ import { h, Host } from "@stencil/core";
26
24
  import { getLocaleComponentStrings } from "../../utils/locale";
25
+ import { nodeListToArray } from "../../utils/common";
27
26
  export class SolutionSpatialRef {
28
- valueChanged(newValue) {
29
- this.spatialRef = this._createSpatialRefDisplay(newValue);
30
- this._updateStore();
31
- const searchBox = document.getElementById("calcite-sr-search");
32
- if (searchBox) {
33
- searchBox.value = this._srSearchText = "";
34
- }
35
- this._clearSelection();
36
- }
37
- //--------------------------------------------------------------------------
38
- //
39
- // Lifecycle
40
- //
41
- //--------------------------------------------------------------------------
42
27
  constructor() {
43
28
  this.defaultWkid = 102100;
29
+ this.loaded = false;
44
30
  this.locked = true;
45
- this.value = this.defaultWkid.toString();
46
31
  this.services = [];
47
- this.loaded = false;
48
- this.spatialRef = undefined;
32
+ this.value = this.defaultWkid.toString();
49
33
  this._srSearchText = undefined;
50
34
  this._translations = undefined;
51
- this.spatialRef = this._createSpatialRefDisplay(this.value);
52
- this.locked = typeof this.value === "undefined";
53
35
  }
36
+ //--------------------------------------------------------------------------
37
+ //
38
+ // Lifecycle
39
+ //
40
+ //--------------------------------------------------------------------------
54
41
  /**
55
42
  * StencilJS: Called once just after the component is first connected to the DOM.
56
43
  */
@@ -61,77 +48,24 @@ export class SolutionSpatialRef {
61
48
  * Renders the component.
62
49
  */
63
50
  render() {
64
- return (h(Host, null, h("div", { class: "spatial-ref-desc" }, h("calcite-label", null, this._translations.paramDescription)), h("label", { class: "switch-label" }, h("calcite-switch", { checked: !this.locked, class: "spatial-ref-switch", onCalciteSwitchChange: (event) => this._updateLocked(event), scale: "m" }), this._translations.specifyParam), h("div", { class: "spatial-ref-switch-title", id: "spatialRefDefn" }, h("calcite-label", null, this._translations.spatialReferenceInfo, h("label", { class: "spatial-ref-default" }, h("calcite-input", { disabled: this.locked, id: "calcite-sr-search", onCalciteInputInput: (evt) => this._searchSpatialReferences(evt), onKeyDown: (evt) => this._inputKeyDown(evt), placeholder: this._translations.spatialReferencePlaceholder }))), h("div", { class: this.locked ? 'disabled-div' : '' }, h("calcite-tree", { id: "calcite-sr-tree", slot: "children" }, this._getTreeContent())), this._getFeatureServices(this.services))));
51
+ return (h(Host, null, h("div", { class: "spatial-ref" }, h("div", { class: "spatial-ref-desc" }, h("calcite-label", null, this._translations.paramDescription)), h("label", { class: "switch-label" }, h("calcite-switch", { checked: !this.locked, class: "spatial-ref-switch", onCalciteSwitchChange: (event) => this._updateLocked(event), scale: "m" }), this._translations.specifyParam), h("div", { class: "spatial-ref-component", id: "spatialRefDefn" }, h("calcite-label", null, this._translations.spatialReferenceInfo, h("label", { class: "spatial-ref-default" }, h("spatial-ref", { defaultWkid: this.defaultWkid, disabled: this.locked, value: this.value }))), this._getFeatureServices(this.services)))));
52
+ }
53
+ /**
54
+ * Handle changes to the buffer distance value
55
+ */
56
+ spatialReferenceChange(event) {
57
+ this.value = event.detail.newValue;
65
58
  }
66
59
  //--------------------------------------------------------------------------
67
60
  //
68
61
  // Public Methods (async)
69
62
  //
70
63
  //--------------------------------------------------------------------------
71
- /**
72
- * Returns the spatial reference description of the supplied value.
73
- * (Exposes protected method `_createSpatialRefDisplay` for testing.)
74
- *
75
- * @param value WKID or WKT or null for default
76
- * @returns If component is using a WKID, description using WKID; otherwise, the WKT; defaults to 102100
77
- */
78
- async createSpatialRefDisplay(value) {
79
- return this._createSpatialRefDisplay(value);
80
- }
81
- /**
82
- * Returns the current spatial reference description.
83
- * (Exposes protected variable `spatialRef` for testing.)
84
- */
85
- async getSpatialRef() {
86
- return this.spatialRef;
87
- }
88
- /**
89
- * Converts a WKID into a spatial reference description.
90
- * (Exposes protected method `_wkidToDisplay` for testing.)
91
- *
92
- * @param wkid WKID to look up
93
- * @returns Description, or "WKID <wkid>" if a description doesn't exist for the WKID
94
- */
95
- async wkidToDisplay(wkid) {
96
- return this._wkidToDisplay(wkid);
97
- }
98
64
  //--------------------------------------------------------------------------
99
65
  //
100
66
  // Private Methods
101
67
  //
102
68
  //--------------------------------------------------------------------------
103
- /**
104
- * Returns the spatial reference description of the supplied value.
105
- *
106
- * @param value WKID or WKT or null for default
107
- * @returns If component is using a WKID, description using WKID; otherwise, the WKT; defaults to 102100
108
- */
109
- _createSpatialRefDisplay(value) {
110
- let spatialRef;
111
- if (!value) {
112
- spatialRef = {
113
- display: this._wkidToDisplay(this.defaultWkid),
114
- usingWkid: true,
115
- wkid: this.defaultWkid,
116
- wkt: ""
117
- };
118
- }
119
- else {
120
- const wkid = Number.parseInt(value);
121
- spatialRef = isNaN(wkid) ? {
122
- display: value,
123
- usingWkid: false,
124
- wkid: 0,
125
- wkt: value
126
- } : {
127
- display: this._wkidToDisplay(wkid),
128
- usingWkid: true,
129
- wkid: wkid,
130
- wkt: ""
131
- };
132
- }
133
- return spatialRef;
134
- }
135
69
  /**
136
70
  * Toggles the ability to set the default spatial reference.
137
71
  */
@@ -160,24 +94,6 @@ export class SolutionSpatialRef {
160
94
  fsNodes.forEach((node) => node.checked = true);
161
95
  services.forEach(name => this._updateEnabledServices({ detail: { switched: true } }, name));
162
96
  }
163
- /**
164
- * Stores the wkid as the components value.
165
- */
166
- _setSpatialRef(wkid) {
167
- if (this.value !== wkid) {
168
- this.value = wkid;
169
- }
170
- }
171
- /**
172
- * Converts a WKID into a spatial reference description.
173
- *
174
- * @param wkid WKID to look up
175
- * @returns Description, or "WKID <wkid>" if a description doesn't exist for the WKID
176
- */
177
- _wkidToDisplay(wkid) {
178
- const description = wkids[wkid];
179
- return description ? description.label + " (" + wkid.toString() + ")" : "WKID " + wkid.toString();
180
- }
181
97
  /**
182
98
  * Create a switch control for each of the services
183
99
  *
@@ -198,7 +114,7 @@ export class SolutionSpatialRef {
198
114
  _updateStore() {
199
115
  const spatialReferenceInfo = state.getStoreInfo("spatialReferenceInfo");
200
116
  spatialReferenceInfo.enabled = !this.locked;
201
- spatialReferenceInfo.spatialReference = this.spatialRef.wkid;
117
+ spatialReferenceInfo.spatialReference = this.value;
202
118
  state.setStoreInfo("spatialReferenceInfo", spatialReferenceInfo);
203
119
  }
204
120
  /**
@@ -213,89 +129,6 @@ export class SolutionSpatialRef {
213
129
  enabled: event.detail.switched
214
130
  });
215
131
  }
216
- /**
217
- * Select the first child on Enter key click
218
- * OR
219
- * Clear any selection while user is entering values and use the default wkid
220
- *
221
- * @param event The keyboard event
222
- */
223
- _inputKeyDown(event) {
224
- var _a;
225
- if (event.key === "Enter") {
226
- this._selectFirstChild(true);
227
- }
228
- else {
229
- if (((_a = this._srSearchText) === null || _a === void 0 ? void 0 : _a.length) > 1) {
230
- this._clearSelection();
231
- this._setSpatialRef(this.defaultWkid.toString());
232
- }
233
- }
234
- }
235
- /**
236
- * Clear any selected items in the elements tree.
237
- *
238
- */
239
- _clearSelection() {
240
- const selectedItems = nodeListToArray(this.el.querySelectorAll("calcite-tree-item[selected]"));
241
- selectedItems.forEach((treeItem) => {
242
- treeItem.selected = false;
243
- });
244
- }
245
- /**
246
- * Select the first child from the tree.
247
- *
248
- * @param autoFocus Boolean to indicate if focus should also be shifted to the first child.
249
- *
250
- */
251
- _selectFirstChild(autoFocus) {
252
- const wkidContainer = document.getElementById("solution-wkid-container");
253
- if (wkidContainer && wkidContainer.firstChild) {
254
- const firstChild = wkidContainer.firstChild;
255
- firstChild.selected = true;
256
- this._setSpatialRef(firstChild.id);
257
- if (autoFocus) {
258
- firstChild.focus();
259
- }
260
- }
261
- }
262
- /**
263
- * Set the search text State and cause render.
264
- *
265
- * @param event the event to get the value from
266
- *
267
- */
268
- _searchSpatialReferences(event) {
269
- this._srSearchText = event.detail.value;
270
- }
271
- /**
272
- * Get the tree items for the current spatial reference search
273
- *
274
- */
275
- _getTreeContent() {
276
- const id = "solution-wkid-container";
277
- const containerClass = "spatial-ref-container";
278
- if (this._srSearchText && this._srSearchText !== "" && this._srSearchText.length > 1) {
279
- const regEx = new RegExp(`${this._srSearchText}`, 'gi');
280
- const matches = Object.keys(wkids).filter(wkid => {
281
- return regEx.test(wkid.toString()) || regEx.test(wkids[wkid].label);
282
- });
283
- return matches.length > 0 ? (h("div", { class: containerClass, id: id }, matches.map((wkid) => this._getTreeItem(wkid, false)))) : (null);
284
- }
285
- else {
286
- return (h("div", { class: containerClass, id: id }, this._getTreeItem(this.value.toString(), true)));
287
- }
288
- }
289
- /**
290
- * Get the individual spatial reference tree item
291
- *
292
- * @param wkid The wkid for the spatial reference that will be displayed.
293
- * @param selected Should the item be selected by default.
294
- *
295
- */
296
- _getTreeItem(wkid, selected) {
297
- return (h("calcite-tree-item", { "aria-selected": selected, id: wkid, onClick: () => this._setSpatialRef(wkid), selected: selected }, h("div", null, `${wkids[wkid].label} (${wkid})`)));
298
- }
299
132
  /**
300
133
  * Fetches the component's translations
301
134
  *
@@ -354,46 +187,45 @@ export class SolutionSpatialRef {
354
187
  "reflect": true,
355
188
  "defaultValue": "true"
356
189
  },
357
- "value": {
358
- "type": "string",
190
+ "services": {
191
+ "type": "unknown",
359
192
  "mutable": true,
360
193
  "complexType": {
361
- "original": "string",
362
- "resolved": "string",
194
+ "original": "string[]",
195
+ "resolved": "string[]",
363
196
  "references": {}
364
197
  },
365
198
  "required": false,
366
199
  "optional": false,
367
200
  "docs": {
368
201
  "tags": [],
369
- "text": "Contains the public value for this component, which is a wkid or a wkt."
202
+ "text": "List of service names the spatial reference should apply to"
370
203
  },
371
- "attribute": "value",
372
- "reflect": true,
373
- "defaultValue": "this.defaultWkid.toString()"
204
+ "defaultValue": "[]"
374
205
  },
375
- "services": {
376
- "type": "unknown",
206
+ "value": {
207
+ "type": "string",
377
208
  "mutable": true,
378
209
  "complexType": {
379
- "original": "string[]",
380
- "resolved": "string[]",
210
+ "original": "string",
211
+ "resolved": "string",
381
212
  "references": {}
382
213
  },
383
214
  "required": false,
384
215
  "optional": false,
385
216
  "docs": {
386
217
  "tags": [],
387
- "text": "List of service names the spatial reference should apply to"
218
+ "text": "Contains the public value for this component, which is a wkid or a wkt."
388
219
  },
389
- "defaultValue": "[]"
220
+ "attribute": "value",
221
+ "reflect": true,
222
+ "defaultValue": "this.defaultWkid.toString()"
390
223
  }
391
224
  };
392
225
  }
393
226
  static get states() {
394
227
  return {
395
228
  "loaded": {},
396
- "spatialRef": {},
397
229
  "_srSearchText": {},
398
230
  "_translations": {}
399
231
  };
@@ -416,100 +248,14 @@ export class SolutionSpatialRef {
416
248
  }
417
249
  }];
418
250
  }
419
- static get methods() {
420
- return {
421
- "createSpatialRefDisplay": {
422
- "complexType": {
423
- "signature": "(value: string) => Promise<ISpatialRefRepresentation>",
424
- "parameters": [{
425
- "tags": [{
426
- "name": "param",
427
- "text": "value WKID or WKT or null for default"
428
- }],
429
- "text": "WKID or WKT or null for default"
430
- }],
431
- "references": {
432
- "Promise": {
433
- "location": "global",
434
- "id": "global::Promise"
435
- },
436
- "ISpatialRefRepresentation": {
437
- "location": "import",
438
- "path": "../../utils/interfaces",
439
- "id": "src/utils/interfaces.ts::ISpatialRefRepresentation"
440
- }
441
- },
442
- "return": "Promise<ISpatialRefRepresentation>"
443
- },
444
- "docs": {
445
- "text": "Returns the spatial reference description of the supplied value.\r\n(Exposes protected method `_createSpatialRefDisplay` for testing.)",
446
- "tags": [{
447
- "name": "param",
448
- "text": "value WKID or WKT or null for default"
449
- }, {
450
- "name": "returns",
451
- "text": "If component is using a WKID, description using WKID; otherwise, the WKT; defaults to 102100"
452
- }]
453
- }
454
- },
455
- "getSpatialRef": {
456
- "complexType": {
457
- "signature": "() => Promise<ISpatialRefRepresentation>",
458
- "parameters": [],
459
- "references": {
460
- "Promise": {
461
- "location": "global",
462
- "id": "global::Promise"
463
- },
464
- "ISpatialRefRepresentation": {
465
- "location": "import",
466
- "path": "../../utils/interfaces",
467
- "id": "src/utils/interfaces.ts::ISpatialRefRepresentation"
468
- }
469
- },
470
- "return": "Promise<ISpatialRefRepresentation>"
471
- },
472
- "docs": {
473
- "text": "Returns the current spatial reference description.\r\n(Exposes protected variable `spatialRef` for testing.)",
474
- "tags": []
475
- }
476
- },
477
- "wkidToDisplay": {
478
- "complexType": {
479
- "signature": "(wkid: number) => Promise<string>",
480
- "parameters": [{
481
- "tags": [{
482
- "name": "param",
483
- "text": "wkid WKID to look up"
484
- }],
485
- "text": "WKID to look up"
486
- }],
487
- "references": {
488
- "Promise": {
489
- "location": "global",
490
- "id": "global::Promise"
491
- }
492
- },
493
- "return": "Promise<string>"
494
- },
495
- "docs": {
496
- "text": "Converts a WKID into a spatial reference description.\r\n(Exposes protected method `_wkidToDisplay` for testing.)",
497
- "tags": [{
498
- "name": "param",
499
- "text": "wkid WKID to look up"
500
- }, {
501
- "name": "returns",
502
- "text": "Description, or \"WKID &lt;wkid&gt;\" if a description doesn't exist for the WKID"
503
- }]
504
- }
505
- }
506
- };
507
- }
508
251
  static get elementRef() { return "el"; }
509
- static get watchers() {
252
+ static get listeners() {
510
253
  return [{
511
- "propName": "value",
512
- "methodName": "valueChanged"
254
+ "name": "spatialReferenceChange",
255
+ "method": "spatialReferenceChange",
256
+ "target": "window",
257
+ "capture": false,
258
+ "passive": false
513
259
  }];
514
260
  }
515
261
  }
@@ -18,19 +18,31 @@
18
18
  * See the License for the specific language governing permissions and
19
19
  * limitations under the License.
20
20
  */
21
- // import { newE2EPage } from '@stencil/core/testing';
21
+ import { newE2EPage } from "@stencil/core/testing";
22
22
  describe('solution-spatial-ref', () => {
23
+ let page;
24
+ beforeEach(async () => {
25
+ page = await newE2EPage();
26
+ });
23
27
  it('renders', async () => {
24
- //TEST commented out for now.
25
- // need to work out how we pass translations
26
- // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
27
- // could flatten the translations further so it would contain no sub groups
28
- // could set default translations for each file
29
- // and could still have a test to compare the default with the actual as a way to verify
30
- expect("a").toEqual("a");
31
- // const page = await newE2EPage();
32
- // await page.setContent('<solution-spatial-ref></solution-spatial-ref>');
33
- // const element = await page.find('solution-spatial-ref');
34
- // expect(element).toHaveClass('hydrated');
28
+ await page.setContent('<solution-spatial-ref/>');
29
+ const solution_spatial_ref = await page.find('solution-spatial-ref');
30
+ expect(solution_spatial_ref).toHaveClass('hydrated');
31
+ expect(await solution_spatial_ref.getProperty('defaultWkid')).toBe(102100);
32
+ expect(await solution_spatial_ref.getProperty('value')).toBe('102100');
33
+ });
34
+ it('echoes value of contained spatial-ref component', async () => {
35
+ await page.setContent('<solution-spatial-ref/>');
36
+ await page.waitForChanges();
37
+ const newSpatialRef = '2243';
38
+ const spatial_ref = await page.find('spatial-ref');
39
+ await page.waitForChanges();
40
+ await spatial_ref.setProperty('value', newSpatialRef);
41
+ await page.waitForChanges();
42
+ /*
43
+ expect(await spatial_ref.getProperty('value')).toBe(newSpatialRef);
44
+ */
45
+ const solution_spatial_ref = await page.find('solution-spatial-ref');
46
+ expect(await solution_spatial_ref.getProperty('value')).toBe(newSpatialRef);
35
47
  });
36
48
  });