@esri/solutions-components 0.6.17 → 0.6.18
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/assets/t9n/map-tools/resources.json +2 -1
- package/dist/assets/t9n/map-tools/resources_en.json +2 -1
- package/dist/assets/t9n/solution-spatial-ref/resources.json +0 -1
- package/dist/assets/t9n/solution-spatial-ref/resources_en.json +0 -1
- package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +6 -0
- package/dist/assets/t9n/solution-spatial-ref/resources_he.json +6 -0
- package/dist/assets/t9n/spatial-ref/resources.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_en.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_fr.json +3 -0
- package/dist/assets/t9n/spatial-ref/resources_he.json +3 -0
- package/dist/cjs/{basemap-gallery_6.cjs.entry.js → basemap-gallery_7.cjs.entry.js} +124 -3
- package/dist/cjs/{calcite-tree_3.cjs.entry.js → calcite-checkbox_3.cjs.entry.js} +123 -319
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +4 -3
- package/dist/cjs/card-manager_3.cjs.entry.js +8 -5
- package/dist/{collection/components/basemap-gallery/test/basemap-gallery.e2e.js → cjs/common-13719149.js} +17 -9
- package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -7
- package/dist/cjs/edit-card_2.cjs.entry.js +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js +21 -21256
- package/dist/cjs/solution-item-icon.cjs.entry.js +327 -0
- package/dist/cjs/{solution-store-c443e657.js → solution-resource-f9e3b289.js} +2 -1698
- package/dist/cjs/solution-store-2414dd8a.js +1707 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +21293 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/card-manager/card-manager.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +15 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +47 -6
- package/dist/collection/components/edit-card/edit-card.css +0 -12
- package/dist/collection/components/floor-filter/floor-filter.css +19 -0
- package/dist/collection/components/floor-filter/floor-filter.js +163 -0
- package/dist/collection/components/info-card/info-card.js +3 -2
- package/dist/collection/components/layer-table/layer-table.css +8 -0
- package/dist/collection/components/layer-table/layer-table.js +18 -2
- package/dist/collection/components/map-card/map-card.js +19 -1
- package/dist/collection/components/map-picker/map-picker.css +0 -4
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-tools/map-tools.js +54 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +1 -7
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +37 -291
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +24 -12
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +32 -128
- package/dist/collection/components/spatial-ref/spatial-ref.css +20 -0
- package/dist/collection/components/spatial-ref/spatial-ref.js +445 -0
- package/dist/collection/components/spatial-ref/test/spatial-ref.e2e.js +71 -0
- package/dist/collection/components/spatial-ref/test/spatial-ref.spec.js +158 -0
- package/dist/collection/demos/crowdsource-manager.html +4 -0
- package/dist/collection/demos/solution-spatial-ref.html +9 -16
- package/dist/collection/demos/spatial-ref.html +53 -0
- package/dist/collection/utils/{templates.e2e.js → test/templates.e2e.js} +2 -2
- package/dist/collection/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
- package/dist/components/card-manager2.js +1 -1
- package/dist/components/crowdsource-manager.js +86 -73
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/floor-filter.d.ts +11 -0
- package/dist/components/floor-filter.js +11 -0
- package/dist/components/floor-filter2.js +115 -0
- package/dist/components/info-card2.js +3 -2
- package/dist/components/layer-table2.js +5 -3
- package/dist/components/map-card2.js +45 -37
- package/dist/components/map-picker2.js +2 -2
- package/dist/components/map-tools2.js +52 -11
- package/dist/components/solution-configuration.js +79 -72
- package/dist/components/solution-resource-item2.js +2 -1
- package/dist/components/solution-resource.js +1836 -0
- package/dist/components/solution-spatial-ref2.js +41 -21277
- package/dist/components/solution-store.js +2 -1830
- package/dist/components/spatial-ref.d.ts +11 -0
- package/dist/components/spatial-ref.js +11 -0
- package/dist/components/spatial-ref2.js +21374 -0
- package/dist/esm/{basemap-gallery_6.entry.js → basemap-gallery_7.entry.js} +124 -4
- package/dist/esm/{calcite-tree_3.entry.js → calcite-checkbox_3.entry.js} +125 -321
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -1
- package/dist/esm/card-manager_3.entry.js +8 -5
- package/dist/{collection/components/layer-table/test/layer-table.e2e.js → esm/common-e4a8e353.js} +15 -9
- package/dist/esm/crowdsource-manager.entry.js +12 -7
- package/dist/esm/edit-card_2.entry.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/solution-configuration.entry.js +2 -1
- package/dist/esm/solution-contents_3.entry.js +20 -21255
- package/dist/esm/solution-item-icon.entry.js +323 -0
- package/dist/esm/{solution-store-b29d50f7.js → solution-resource-be35d35b.js} +1 -1697
- package/dist/esm/solution-store-e734626a.js +1704 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +21289 -0
- package/dist/solutions-components/demos/crowdsource-manager.html +4 -0
- package/dist/solutions-components/demos/solution-spatial-ref.html +9 -16
- package/dist/solutions-components/demos/spatial-ref.html +53 -0
- package/dist/solutions-components/{p-64d29ba2.entry.js → p-0bc27ba7.entry.js} +2 -2
- package/dist/{collection/components/map-card/test/map-card.e2e.js → solutions-components/p-1b228f97.js} +2 -10
- package/dist/solutions-components/p-5b8c8942.entry.js +21 -0
- package/dist/solutions-components/p-63c6fc29.entry.js +6 -0
- package/dist/solutions-components/p-64945b43.entry.js +18 -0
- package/dist/solutions-components/p-770bff06.entry.js +6 -0
- package/dist/solutions-components/p-7741dbab.entry.js +6 -0
- package/dist/solutions-components/p-80465067.entry.js +6 -0
- package/dist/solutions-components/p-846df994.entry.js +6 -0
- package/dist/solutions-components/p-b3f8d2cb.js +192 -0
- package/dist/solutions-components/p-c26d8b36.entry.js +6 -0
- package/dist/solutions-components/{p-4d942b0f.entry.js → p-f35147d5.entry.js} +1 -1
- package/dist/solutions-components/p-ff0d7712.js +44 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/{templates.e2e.ts → test/templates.e2e.ts} +2 -2
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
- package/dist/types/components/floor-filter/floor-filter.d.ts +61 -0
- package/dist/types/components/layer-table/layer-table.d.ts +4 -0
- package/dist/types/components/map-card/map-card.d.ts +4 -0
- package/dist/types/components/map-tools/map-tools.d.ts +24 -0
- package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +11 -93
- package/dist/types/components/spatial-ref/spatial-ref.d.ts +142 -0
- package/dist/types/components.d.ts +123 -16
- package/dist/types/preact.d.ts +8 -1
- package/package.json +6 -6
- package/dist/cjs/calcite-checkbox.cjs.entry.js +0 -136
- package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +0 -37
- package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +0 -29
- package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +0 -160
- package/dist/collection/components/card-manager/test/card-manager.e2e.js +0 -29
- package/dist/collection/components/card-manager/test/card-manager.spec.js +0 -37
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +0 -29
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +0 -37
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +0 -29
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +0 -37
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +0 -29
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +0 -37
- package/dist/collection/components/edit-card/test/edit-card.e2e.js +0 -14
- package/dist/collection/components/edit-card/test/edit-card.spec.js +0 -22
- package/dist/collection/components/info-card/test/info-card.e2e.js +0 -29
- package/dist/collection/components/info-card/test/info-card.spec.js +0 -37
- package/dist/collection/components/json-editor/test/json-editor.e2e.js +0 -36
- package/dist/collection/components/json-editor/test/json-editor.spec.js +0 -65
- package/dist/collection/components/layer-table/test/layer-table.spec.js +0 -37
- package/dist/collection/components/layout-manager/test/layout-manager.e2e.js +0 -29
- package/dist/collection/components/layout-manager/test/layout-manager.spec.js +0 -37
- package/dist/collection/components/list-item/test/list-item.e2e.js +0 -29
- package/dist/collection/components/list-item/test/list-item.spec.js +0 -37
- package/dist/collection/components/map-card/test/map-card.spec.js +0 -37
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +0 -29
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +0 -37
- package/dist/collection/components/map-fullscreen/test/map-fullscreen.e2e.js +0 -29
- package/dist/collection/components/map-fullscreen/test/map-fullscreen.spec.js +0 -37
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +0 -29
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +0 -114
- package/dist/collection/components/map-legend/test/map-legend.e2e.js +0 -14
- package/dist/collection/components/map-legend/test/map-legend.spec.js +0 -22
- package/dist/collection/components/map-picker/test/map-picker.e2e.js +0 -29
- package/dist/collection/components/map-picker/test/map-picker.spec.js +0 -37
- package/dist/collection/components/map-search/test/map-search.e2e.js +0 -29
- package/dist/collection/components/map-search/test/map-search.spec.js +0 -37
- package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +0 -29
- package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +0 -366
- package/dist/collection/components/map-tools/test/map-tools.e2e.js +0 -29
- package/dist/collection/components/map-tools/test/map-tools.spec.js +0 -37
- package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +0 -29
- package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +0 -37
- package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +0 -76
- package/dist/collection/components/pdf-download/test/pdf-download.spec.js +0 -107
- package/dist/collection/components/public-notification/test/public-notification.spec.js +0 -161
- package/dist/collection/components/refine-selection/test/refine-selection.e2e.js +0 -14
- package/dist/collection/components/refine-selection/test/refine-selection.spec.js +0 -22
- package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +0 -36
- package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +0 -119
- package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +0 -94
- package/dist/collection/components/solution-contents/test/solution-contents.spec.js +0 -143
- package/dist/collection/components/solution-item/test/solution-item.e2e.js +0 -36
- package/dist/collection/components/solution-item/test/solution-item.spec.js +0 -77
- package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +0 -36
- package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +0 -142
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +0 -29
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +0 -39
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +0 -36
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +0 -54
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +0 -36
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +0 -65
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +0 -36
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +0 -55
- package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +0 -36
- package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +0 -60
- package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +0 -36
- package/dist/collection/components/solution-variables/test/solution-variables.spec.js +0 -131
- package/dist/esm/calcite-checkbox.entry.js +0 -132
- package/dist/solutions-components/p-17d176b5.js +0 -230
- package/dist/solutions-components/p-1d9a5198.entry.js +0 -37
- package/dist/solutions-components/p-3707d9bd.entry.js +0 -6
- package/dist/solutions-components/p-41bbccbc.entry.js +0 -6
- package/dist/solutions-components/p-4f2fce86.entry.js +0 -6
- package/dist/solutions-components/p-5ffaaaf4.entry.js +0 -6
- package/dist/solutions-components/p-736e76fb.entry.js +0 -17
- package/dist/solutions-components/p-dda517b9.entry.js +0 -6
- /package/dist/collection/components/{solution-spatial-ref → spatial-ref}/spatialreferences.js +0 -0
- /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-
|
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 {
|
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.
|
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-
|
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.
|
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
|
-
"
|
358
|
-
"type": "
|
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": "
|
202
|
+
"text": "List of service names the spatial reference should apply to"
|
370
203
|
},
|
371
|
-
"
|
372
|
-
"reflect": true,
|
373
|
-
"defaultValue": "this.defaultWkid.toString()"
|
204
|
+
"defaultValue": "[]"
|
374
205
|
},
|
375
|
-
"
|
376
|
-
"type": "
|
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": "
|
218
|
+
"text": "Contains the public value for this component, which is a wkid or a wkt."
|
388
219
|
},
|
389
|
-
"
|
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 <wkid>\" if a description doesn't exist for the WKID"
|
503
|
-
}]
|
504
|
-
}
|
505
|
-
}
|
506
|
-
};
|
507
|
-
}
|
508
251
|
static get elementRef() { return "el"; }
|
509
|
-
static get
|
252
|
+
static get listeners() {
|
510
253
|
return [{
|
511
|
-
"
|
512
|
-
"
|
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
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
});
|