@esri/solutions-components 0.6.16 → 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-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +4 -3
- package/dist/cjs/card-manager_3.cjs.entry.js +10 -7
- 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/{downloadUtils-34a515ad.js → downloadUtils-121fd7ff.js} +2 -2
- package/dist/cjs/edit-card_2.cjs.entry.js +4 -3
- package/dist/cjs/{index.es-0ba11065.js → index.es-5c0c137a.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/{mapViewUtils-a2884698.js → mapViewUtils-786a219b.js} +32 -19
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- 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 +17 -2
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +47 -6
- package/dist/collection/components/edit-card/edit-card.css +0 -8
- 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/mapViewUtils.js +32 -19
- package/dist/collection/utils/mapViewUtils.ts +43 -20
- 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/mapViewUtils.js +32 -19
- 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-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -1
- package/dist/esm/card-manager_3.entry.js +10 -7
- 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/{downloadUtils-ac67a786.js → downloadUtils-287994b1.js} +2 -2
- package/dist/esm/edit-card_2.entry.js +4 -3
- package/dist/esm/{index.es-f553598f.js → index.es-a3f8409f.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/{mapViewUtils-8141d8c1.js → mapViewUtils-8bfabd80.js} +32 -19
- package/dist/esm/public-notification.entry.js +2 -2
- 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-9f11a403.entry.js → p-3c5c1487.entry.js} +1 -1
- package/dist/solutions-components/{p-a26711e8.js → p-469c8f8a.js} +1 -1
- package/dist/solutions-components/p-53bc5fc1.js +36 -0
- 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-c8d0ce92.js → p-698c6a56.js} +2 -2
- package/dist/solutions-components/{p-b9d29f30.entry.js → p-734cb206.entry.js} +1 -1
- 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-57cf6784.entry.js → p-d22be647.entry.js} +1 -1
- 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/mapViewUtils.ts +43 -20
- 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-07d7e11f.entry.js +0 -6
- package/dist/solutions-components/p-16362eb4.js +0 -36
- 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-4dbe8337.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-99f1a767.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
@@ -1,114 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
xdescribe('map-layer-picker', () => {
|
22
|
-
it('is a placeholder', () => {
|
23
|
-
});
|
24
|
-
});
|
25
|
-
/*
|
26
|
-
import { h } from '@stencil/core';
|
27
|
-
import { newSpecPage } from '@stencil/core/testing';
|
28
|
-
import { MapLayerPicker } from '../map-layer-picker';
|
29
|
-
import * as mapViewUtils from "../../../utils/mapViewUtils";
|
30
|
-
|
31
|
-
let mapView;
|
32
|
-
|
33
|
-
beforeEach(() => {
|
34
|
-
jest.spyOn(mapViewUtils, "getMapLayerNames").mockImplementation(() => [
|
35
|
-
"A", "B"
|
36
|
-
] as any);
|
37
|
-
|
38
|
-
mapView = {
|
39
|
-
map: {
|
40
|
-
layers: {
|
41
|
-
add: () => {},
|
42
|
-
getItemAt: () => { return -1 },
|
43
|
-
findIndex: () => { return -1 }
|
44
|
-
}
|
45
|
-
}
|
46
|
-
} as unknown as any;
|
47
|
-
});
|
48
|
-
|
49
|
-
xdescribe('map-layer-picker', () => {
|
50
|
-
it('renders single selection mode', async () => {
|
51
|
-
const page = await newSpecPage({
|
52
|
-
autoApplyChanges: true,
|
53
|
-
components: [MapLayerPicker],
|
54
|
-
template: () => (<map-layer-picker mapView={mapView}></map-layer-picker>),
|
55
|
-
});
|
56
|
-
expect(page.root).toEqualHtml(`
|
57
|
-
<map-layer-picker selection-mode="single">
|
58
|
-
<div class="map-layer-picker-container">
|
59
|
-
<div class="map-layer-picker">
|
60
|
-
<calcite-select label="">
|
61
|
-
<calcite-option label="A" value="A"></calcite-option>
|
62
|
-
<calcite-option label="B" value="B"></calcite-option>
|
63
|
-
</calcite-select>
|
64
|
-
</div>
|
65
|
-
</div>
|
66
|
-
</map-layer-picker>
|
67
|
-
`);
|
68
|
-
|
69
|
-
jest.spyOn(mapViewUtils, "getMapLayerNames").mockImplementation(() => [
|
70
|
-
"A", "B", "C"
|
71
|
-
] as any);
|
72
|
-
|
73
|
-
page.root.mapView = {...mapView};
|
74
|
-
|
75
|
-
expect(page.root).toEqualHtml(`
|
76
|
-
<map-layer-picker selection-mode="single">
|
77
|
-
<div class="map-layer-picker-container">
|
78
|
-
<div class="map-layer-picker">
|
79
|
-
<calcite-select label="">
|
80
|
-
<calcite-option label="A" value="A"></calcite-option>
|
81
|
-
<calcite-option label="B" value="B"></calcite-option>
|
82
|
-
</calcite-select>
|
83
|
-
</div>
|
84
|
-
</div>
|
85
|
-
</map-layer-picker>
|
86
|
-
`);
|
87
|
-
});
|
88
|
-
|
89
|
-
it('renders single selection mode with selectedLayers', async () => {
|
90
|
-
const page = await newSpecPage({
|
91
|
-
autoApplyChanges: true,
|
92
|
-
components: [MapLayerPicker],
|
93
|
-
template: () => (
|
94
|
-
<map-layer-picker
|
95
|
-
mapView={mapView}
|
96
|
-
selectedLayers={["B"]}
|
97
|
-
></map-layer-picker>
|
98
|
-
),
|
99
|
-
});
|
100
|
-
expect(page.root).toEqualHtml(`
|
101
|
-
<map-layer-picker selection-mode="single">
|
102
|
-
<div class="map-layer-picker-container">
|
103
|
-
<div class="map-layer-picker">
|
104
|
-
<calcite-select label="">
|
105
|
-
<calcite-option label="A" value="A"></calcite-option>
|
106
|
-
<calcite-option label="B" selected="" value="B"></calcite-option>
|
107
|
-
</calcite-select>
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
</map-layer-picker>
|
111
|
-
`);
|
112
|
-
});
|
113
|
-
});
|
114
|
-
*/
|
@@ -1,14 +0,0 @@
|
|
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 { newE2EPage } from "@stencil/core/testing";
|
7
|
-
xdescribe('map-legend', () => {
|
8
|
-
it('renders', async () => {
|
9
|
-
const page = await newE2EPage();
|
10
|
-
await page.setContent('<map-legend></map-legend>');
|
11
|
-
const element = await page.find('map-legend');
|
12
|
-
expect(element).toHaveClass('hydrated');
|
13
|
-
});
|
14
|
-
});
|
@@ -1,22 +0,0 @@
|
|
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 { newSpecPage } from "@stencil/core/testing";
|
7
|
-
import { MapLegend } from "../map-legend";
|
8
|
-
xdescribe('map-legend', () => {
|
9
|
-
it('renders', async () => {
|
10
|
-
const page = await newSpecPage({
|
11
|
-
components: [MapLegend],
|
12
|
-
html: `<map-legend></map-legend>`,
|
13
|
-
});
|
14
|
-
expect(page.root).toEqualHtml(`
|
15
|
-
<map-legend>
|
16
|
-
<mock:shadow-root>
|
17
|
-
<slot></slot>
|
18
|
-
</mock:shadow-root>
|
19
|
-
</map-legend>
|
20
|
-
`);
|
21
|
-
});
|
22
|
-
});
|
@@ -1,29 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2023 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { newE2EPage } from "@stencil/core/testing";
|
22
|
-
xdescribe('map-picker', () => {
|
23
|
-
it('renders', async () => {
|
24
|
-
const page = await newE2EPage();
|
25
|
-
await page.setContent('<map-picker></map-picker>');
|
26
|
-
const element = await page.find('map-picker');
|
27
|
-
expect(element).toHaveClass('hydrated');
|
28
|
-
});
|
29
|
-
});
|
@@ -1,37 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2023 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { newSpecPage } from "@stencil/core/testing";
|
22
|
-
import { MapPicker } from "../map-picker";
|
23
|
-
xdescribe('map-picker', () => {
|
24
|
-
it('renders', async () => {
|
25
|
-
const page = await newSpecPage({
|
26
|
-
components: [MapPicker],
|
27
|
-
html: `<map-picker></map-picker>`,
|
28
|
-
});
|
29
|
-
expect(page.root).toEqualHtml(`
|
30
|
-
<map-picker>
|
31
|
-
<mock:shadow-root>
|
32
|
-
<slot></slot>
|
33
|
-
</mock:shadow-root>
|
34
|
-
</map-picker>
|
35
|
-
`);
|
36
|
-
});
|
37
|
-
});
|
@@ -1,29 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { newE2EPage } from "@stencil/core/testing";
|
22
|
-
xdescribe('map-search', () => {
|
23
|
-
it('renders', async () => {
|
24
|
-
const page = await newE2EPage();
|
25
|
-
await page.setContent('<map-search></map-search>');
|
26
|
-
const element = await page.find('map-search');
|
27
|
-
expect(element).toHaveClass('hydrated');
|
28
|
-
});
|
29
|
-
});
|
@@ -1,37 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { newSpecPage } from "@stencil/core/testing";
|
22
|
-
import { MapSearch } from "../map-search";
|
23
|
-
xdescribe('map-search', () => {
|
24
|
-
it('renders', async () => {
|
25
|
-
const page = await newSpecPage({
|
26
|
-
components: [MapSearch],
|
27
|
-
html: `<map-search></map-search>`,
|
28
|
-
});
|
29
|
-
expect(page.root).toEqualHtml(`
|
30
|
-
<map-search>
|
31
|
-
<mock:shadow-root>
|
32
|
-
<slot></slot>
|
33
|
-
</mock:shadow-root>
|
34
|
-
</map-search>
|
35
|
-
`);
|
36
|
-
});
|
37
|
-
});
|
@@ -1,29 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { newE2EPage } from "@stencil/core/testing";
|
22
|
-
xdescribe('map-select-tools', () => {
|
23
|
-
it('renders', async () => {
|
24
|
-
const page = await newE2EPage();
|
25
|
-
await page.setContent('<map-select-tools></map-select-tools>');
|
26
|
-
const element = await page.find('map-select-tools');
|
27
|
-
expect(element).toHaveClass('hydrated');
|
28
|
-
});
|
29
|
-
});
|
@@ -1,366 +0,0 @@
|
|
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
|
-
/** @license
|
7
|
-
* Copyright 2022 Esri
|
8
|
-
*
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
-
* you may not use this file except in compliance with the License.
|
11
|
-
* You may obtain a copy of the License at
|
12
|
-
*
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
-
*
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
-
* See the License for the specific language governing permissions and
|
19
|
-
* limitations under the License.
|
20
|
-
*/
|
21
|
-
import { h } from "@stencil/core";
|
22
|
-
import { newSpecPage } from "@stencil/core/testing";
|
23
|
-
import { MapSelectTools } from "../map-select-tools";
|
24
|
-
import * as locale from "../../../utils/locale";
|
25
|
-
import * as translations from "../../../assets/t9n/map-select-tools/resources.json";
|
26
|
-
import { LayerView } from "../../../utils/test/mocks/jsApi";
|
27
|
-
import * as mapViewUtils from "../../../utils/mapViewUtils";
|
28
|
-
import * as queryUtils from "../../../utils/queryUtils";
|
29
|
-
import { EWorkflowType } from "../../../utils/interfaces";
|
30
|
-
jest.setTimeout(30000);
|
31
|
-
afterEach(() => {
|
32
|
-
jest.restoreAllMocks();
|
33
|
-
});
|
34
|
-
let mapView;
|
35
|
-
let _unknown;
|
36
|
-
beforeEach(() => {
|
37
|
-
jest.spyOn(locale, "getLocaleComponentStrings").mockImplementation(() => [
|
38
|
-
translations
|
39
|
-
]);
|
40
|
-
jest.spyOn(mapViewUtils, "highlightFeatures").mockImplementation(async () => {
|
41
|
-
return { remove: () => { } };
|
42
|
-
});
|
43
|
-
jest.spyOn(mapViewUtils, "goToSelection").mockImplementation(async () => { });
|
44
|
-
jest.spyOn(queryUtils, "getQueryGeoms").mockImplementation((geoms) => {
|
45
|
-
return geoms;
|
46
|
-
});
|
47
|
-
jest.spyOn(queryUtils, "queryObjectIds").mockImplementation(async (oids) => {
|
48
|
-
return oids.map((_, i) => i);
|
49
|
-
});
|
50
|
-
jest.spyOn(console, 'warn').mockImplementation(() => { });
|
51
|
-
mapView = {
|
52
|
-
map: {
|
53
|
-
layers: {
|
54
|
-
add: () => { },
|
55
|
-
getItemAt: () => { return -1; },
|
56
|
-
findIndex: () => { return -1; }
|
57
|
-
}
|
58
|
-
}
|
59
|
-
};
|
60
|
-
_unknown = {};
|
61
|
-
});
|
62
|
-
xdescribe('map-select-tools', () => {
|
63
|
-
it('renders', async () => {
|
64
|
-
const page = await newSpecPage({
|
65
|
-
components: [MapSelectTools],
|
66
|
-
template: () => (h("map-select-tools", { mapView: mapView })),
|
67
|
-
});
|
68
|
-
expect(page.root).toEqualHtml(`
|
69
|
-
<map-select-tools>
|
70
|
-
<div class="padding-bottom-1">
|
71
|
-
<calcite-radio-group class="w-100">
|
72
|
-
<calcite-radio-group-item checked="" class="end-border w-50" value="SEARCH">
|
73
|
-
Search
|
74
|
-
</calcite-radio-group-item>
|
75
|
-
<calcite-radio-group-item class="w-50" value="SKETCH">
|
76
|
-
Sketch
|
77
|
-
</calcite-radio-group-item>
|
78
|
-
</calcite-radio-group>
|
79
|
-
</div>
|
80
|
-
<div class="div-visible-search">
|
81
|
-
<div class="search-widget"></div>
|
82
|
-
</div>
|
83
|
-
<div class="div-not-visible">
|
84
|
-
<calcite-label layout="inline">
|
85
|
-
<calcite-checkbox></calcite-checkbox>
|
86
|
-
Use layer features
|
87
|
-
</calcite-label>
|
88
|
-
</div>
|
89
|
-
<div class="div-not-visible">
|
90
|
-
<map-draw-tools active="" border=""></map-draw-tools>
|
91
|
-
</div>
|
92
|
-
<div class="div-not-visible">
|
93
|
-
<refine-selection-tools active="" border="" mode="ADD" refinemode="SUBSET"></refine-selection-tools>
|
94
|
-
</div>
|
95
|
-
<calcite-label class="search-distance">
|
96
|
-
Search Distance
|
97
|
-
<buffer-tools></buffer-tools>
|
98
|
-
</calcite-label>
|
99
|
-
</map-select-tools>
|
100
|
-
`);
|
101
|
-
const actual = await page.root.getSelection();
|
102
|
-
expect(actual.workflowType).toEqual(EWorkflowType.SEARCH);
|
103
|
-
expect(actual.selectedIds.length).toEqual(0);
|
104
|
-
});
|
105
|
-
it('fires selectionSetChange event when geometries are cleared', async () => {
|
106
|
-
const page = await newSpecPage({
|
107
|
-
components: [MapSelectTools],
|
108
|
-
template: () => (h("map-select-tools", { geometries: [_unknown], mapView: mapView })),
|
109
|
-
});
|
110
|
-
expect(page.root.geometries.length).toEqual(1);
|
111
|
-
page.doc.addEventListener("selectionSetChange", (evt) => {
|
112
|
-
expect(evt.detail).toEqual(0);
|
113
|
-
});
|
114
|
-
page.root.geometries = [];
|
115
|
-
});
|
116
|
-
it('fires selectionSetChange event when geometries are changed', async () => {
|
117
|
-
const page = await newSpecPage({
|
118
|
-
components: [MapSelectTools],
|
119
|
-
template: () => (h("map-select-tools", { geometries: [_unknown], mapView: mapView, selectLayerView: new LayerView() })),
|
120
|
-
});
|
121
|
-
expect(page.root.geometries.length).toEqual(1);
|
122
|
-
let selectionSetChange = (evt) => {
|
123
|
-
expect(evt.detail).toEqual(2);
|
124
|
-
};
|
125
|
-
page.doc.addEventListener("selectionSetChange", selectionSetChange);
|
126
|
-
page.root.geometries = [...page.root.geometries, _unknown];
|
127
|
-
});
|
128
|
-
it('clears geometries on clearSelection', async () => {
|
129
|
-
const page = await newSpecPage({
|
130
|
-
components: [MapSelectTools],
|
131
|
-
template: () => (h("map-select-tools", { geometries: [_unknown], mapView: mapView, selectLayerView: new LayerView() })),
|
132
|
-
});
|
133
|
-
expect(page.root.geometries.length).toEqual(1);
|
134
|
-
let selectionSetChange = (evt) => {
|
135
|
-
expect(evt.detail).toEqual(0);
|
136
|
-
};
|
137
|
-
page.doc.addEventListener("selectionSetChange", selectionSetChange);
|
138
|
-
page.root.clearSelection();
|
139
|
-
});
|
140
|
-
it('can reload existing SELECT selectionSet', async () => {
|
141
|
-
const layerView = new LayerView();
|
142
|
-
const selectionSet = {
|
143
|
-
id: 12345,
|
144
|
-
searchResult: undefined,
|
145
|
-
buffer: {},
|
146
|
-
distance: 100,
|
147
|
-
download: true,
|
148
|
-
unit: "feet",
|
149
|
-
label: "selection-label",
|
150
|
-
selectedIds: [0],
|
151
|
-
layerView,
|
152
|
-
geometries: [_unknown],
|
153
|
-
graphics: [],
|
154
|
-
selectLayers: [],
|
155
|
-
workflowType: EWorkflowType.SELECT,
|
156
|
-
searchDistanceEnabled: true,
|
157
|
-
useLayerFeaturesEnabled: true,
|
158
|
-
refineInfos: undefined,
|
159
|
-
sketchGraphic: undefined
|
160
|
-
};
|
161
|
-
const page = await newSpecPage({
|
162
|
-
components: [MapSelectTools],
|
163
|
-
template: () => (h("map-select-tools", { selectLayerView: layerView, selectionSet: selectionSet, mapView: mapView })),
|
164
|
-
});
|
165
|
-
page.doc.addEventListener("workflowTypeChange", (evt) => {
|
166
|
-
expect(evt.detail).toEqual(EWorkflowType.SELECT);
|
167
|
-
});
|
168
|
-
expect(page.root).toEqualHtml(`
|
169
|
-
<map-select-tools>
|
170
|
-
<div class="padding-bottom-1">
|
171
|
-
<calcite-radio-group class="w-100">
|
172
|
-
<calcite-radio-group-item class="end-border w-50" value="SEARCH">
|
173
|
-
Search
|
174
|
-
</calcite-radio-group-item>
|
175
|
-
<calcite-radio-group-item checked="" class="w-50" value="SKETCH">
|
176
|
-
Sketch
|
177
|
-
</calcite-radio-group-item>
|
178
|
-
</calcite-radio-group>
|
179
|
-
</div>
|
180
|
-
<div class="div-not-visible">
|
181
|
-
<div class="search-widget"></div>
|
182
|
-
</div>
|
183
|
-
<div class="div-visible">
|
184
|
-
<calcite-label layout="inline">
|
185
|
-
<calcite-checkbox></calcite-checkbox>
|
186
|
-
Use layer features
|
187
|
-
</calcite-label>
|
188
|
-
</div>
|
189
|
-
<div class="div-visible">
|
190
|
-
<map-draw-tools active="" border=""></map-draw-tools>
|
191
|
-
</div>
|
192
|
-
<div class="div-not-visible">
|
193
|
-
<refine-selection-tools active="" border="" mode="ADD" refinemode="SUBSET"></refine-selection-tools>
|
194
|
-
</div>
|
195
|
-
<calcite-label class="search-distance">
|
196
|
-
Search Distance
|
197
|
-
<buffer-tools distance="100" unit="feet"></buffer-tools>
|
198
|
-
</calcite-label>
|
199
|
-
</map-select-tools>
|
200
|
-
`);
|
201
|
-
const actual = await page.root.getSelection();
|
202
|
-
expect(actual.label.startsWith("Layer")).toEqual(true);
|
203
|
-
});
|
204
|
-
it('can reload existing SKETCH selectionSet', async () => {
|
205
|
-
const layerView = new LayerView();
|
206
|
-
const selectionSet = {
|
207
|
-
id: 12345,
|
208
|
-
searchResult: undefined,
|
209
|
-
buffer: _unknown,
|
210
|
-
distance: 100,
|
211
|
-
download: true,
|
212
|
-
unit: "feet",
|
213
|
-
label: "selection-label",
|
214
|
-
selectedIds: [0],
|
215
|
-
layerView,
|
216
|
-
geometries: [_unknown],
|
217
|
-
graphics: [],
|
218
|
-
selectLayers: [],
|
219
|
-
workflowType: EWorkflowType.SKETCH,
|
220
|
-
searchDistanceEnabled: true,
|
221
|
-
useLayerFeaturesEnabled: true,
|
222
|
-
refineInfos: undefined,
|
223
|
-
sketchGraphic: undefined
|
224
|
-
};
|
225
|
-
const page = await newSpecPage({
|
226
|
-
components: [MapSelectTools],
|
227
|
-
template: () => (h("map-select-tools", { selectLayerView: layerView, selectionSet: selectionSet, mapView: mapView })),
|
228
|
-
});
|
229
|
-
page.doc.addEventListener("workflowTypeChange", (evt) => {
|
230
|
-
expect(evt.detail).toEqual(EWorkflowType.SKETCH);
|
231
|
-
});
|
232
|
-
expect(page.root).toEqualHtml(`
|
233
|
-
<map-select-tools>
|
234
|
-
<div class="padding-bottom-1">
|
235
|
-
<calcite-radio-group class="w-100">
|
236
|
-
<calcite-radio-group-item class="end-border w-50" value="SEARCH">
|
237
|
-
Search
|
238
|
-
</calcite-radio-group-item>
|
239
|
-
<calcite-radio-group-item checked="" class="w-50" value="SKETCH">
|
240
|
-
Sketch
|
241
|
-
</calcite-radio-group-item>
|
242
|
-
</calcite-radio-group>
|
243
|
-
</div>
|
244
|
-
<div class="div-not-visible">
|
245
|
-
<div class="search-widget"></div>
|
246
|
-
</div>
|
247
|
-
<div class="div-visible">
|
248
|
-
<calcite-label layout="inline">
|
249
|
-
<calcite-checkbox></calcite-checkbox>
|
250
|
-
Use layer features
|
251
|
-
</calcite-label>
|
252
|
-
</div>
|
253
|
-
<div class="div-visible">
|
254
|
-
<map-draw-tools active="" border=""></map-draw-tools>
|
255
|
-
</div>
|
256
|
-
<div class="div-not-visible">
|
257
|
-
<refine-selection-tools active="" border="" mode="ADD" refinemode="SUBSET"></refine-selection-tools>
|
258
|
-
</div>
|
259
|
-
<calcite-label class="search-distance">
|
260
|
-
Search Distance
|
261
|
-
<buffer-tools distance="100" unit="feet"></buffer-tools>
|
262
|
-
</calcite-label>
|
263
|
-
</map-select-tools>
|
264
|
-
`);
|
265
|
-
const actual = await page.root.getSelection();
|
266
|
-
expect(actual.label.startsWith("Sketch")).toEqual(true);
|
267
|
-
});
|
268
|
-
it('can reload existing SEARCH selectionSet', async () => {
|
269
|
-
const layerView = new LayerView();
|
270
|
-
const selectionSet = {
|
271
|
-
id: 12345,
|
272
|
-
searchResult: undefined,
|
273
|
-
buffer: _unknown,
|
274
|
-
distance: 100,
|
275
|
-
download: true,
|
276
|
-
unit: "feet",
|
277
|
-
label: "selection-label",
|
278
|
-
selectedIds: [0, 1],
|
279
|
-
layerView,
|
280
|
-
geometries: [_unknown, _unknown],
|
281
|
-
graphics: [],
|
282
|
-
selectLayers: [],
|
283
|
-
workflowType: EWorkflowType.SEARCH,
|
284
|
-
searchDistanceEnabled: true,
|
285
|
-
useLayerFeaturesEnabled: true,
|
286
|
-
refineInfos: undefined,
|
287
|
-
sketchGraphic: undefined
|
288
|
-
};
|
289
|
-
const page = await newSpecPage({
|
290
|
-
components: [MapSelectTools],
|
291
|
-
template: () => (h("map-select-tools", { isUpdate: true, selectLayerView: layerView, selectionSet: selectionSet, mapView: mapView })),
|
292
|
-
});
|
293
|
-
page.doc.addEventListener("workflowTypeChange", (evt) => {
|
294
|
-
expect(evt.detail).toEqual(EWorkflowType.SEARCH);
|
295
|
-
});
|
296
|
-
expect(page.root).toEqualHtml(`
|
297
|
-
<map-select-tools>
|
298
|
-
<div class="padding-bottom-1">
|
299
|
-
<calcite-radio-group class="w-100">
|
300
|
-
<calcite-radio-group-item checked="" class="end-border w-50" value="SEARCH">
|
301
|
-
Search
|
302
|
-
</calcite-radio-group-item>
|
303
|
-
<calcite-radio-group-item class="w-50" value="SKETCH">
|
304
|
-
Sketch
|
305
|
-
</calcite-radio-group-item>
|
306
|
-
</calcite-radio-group>
|
307
|
-
</div>
|
308
|
-
<div class="div-visible-search">
|
309
|
-
<div class="search-widget"></div>
|
310
|
-
</div>
|
311
|
-
<div class="div-not-visible">
|
312
|
-
<calcite-label layout="inline">
|
313
|
-
<calcite-checkbox></calcite-checkbox>
|
314
|
-
Use layer features
|
315
|
-
</calcite-label>
|
316
|
-
</div>
|
317
|
-
<div class="div-not-visible">
|
318
|
-
<map-draw-tools active="" border=""></map-draw-tools>
|
319
|
-
</div>
|
320
|
-
<div class="div-not-visible">
|
321
|
-
<refine-selection-tools active="" border="" mode="ADD" refinemode="SUBSET"></refine-selection-tools>
|
322
|
-
</div>
|
323
|
-
<calcite-label class="search-distance">
|
324
|
-
Search Distance
|
325
|
-
<buffer-tools distance="100" unit="feet"></buffer-tools>
|
326
|
-
</calcite-label>
|
327
|
-
</map-select-tools>
|
328
|
-
`);
|
329
|
-
const actual = await page.root.getSelection();
|
330
|
-
expect(actual.id).toEqual(selectionSet.id);
|
331
|
-
});
|
332
|
-
it('handles sketchGraphicsChange', async () => {
|
333
|
-
const page = await newSpecPage({
|
334
|
-
components: [MapSelectTools],
|
335
|
-
template: () => (h("map-select-tools", { geometries: [_unknown], mapView: mapView, selectLayerView: new LayerView() })),
|
336
|
-
});
|
337
|
-
expect(page.root.geometries.length).toEqual(1);
|
338
|
-
page.win.dispatchEvent(new CustomEvent("sketchGraphicsChange", { detail: [] }));
|
339
|
-
expect(page.root.geometries.length).toEqual(0);
|
340
|
-
_unknown = { geometry: {} };
|
341
|
-
page.win.dispatchEvent(new CustomEvent("sketchGraphicsChange", { detail: [_unknown, _unknown] }));
|
342
|
-
expect(page.root.geometries.length).toEqual(2);
|
343
|
-
page.win.dispatchEvent(new CustomEvent("sketchGraphicsChange", { detail: undefined }));
|
344
|
-
expect(page.root.geometries.length).toEqual(2);
|
345
|
-
});
|
346
|
-
it('handles sketchGraphicsChange', async () => {
|
347
|
-
const page = await newSpecPage({
|
348
|
-
components: [MapSelectTools],
|
349
|
-
template: () => (h("map-select-tools", { geometries: [], mapView: mapView, selectLayerView: new LayerView() })),
|
350
|
-
});
|
351
|
-
page.win.dispatchEvent(new CustomEvent("layerSelectionGraphicsChange", { detail: undefined }));
|
352
|
-
expect(page.root.geometries.length).toEqual(0);
|
353
|
-
page.doc.addEventListener("selectionSetChange", (evt) => {
|
354
|
-
expect(evt.detail).toEqual(1);
|
355
|
-
});
|
356
|
-
_unknown = {
|
357
|
-
attributes: { "OID": 1 },
|
358
|
-
layer: {
|
359
|
-
objectIdField: "OID"
|
360
|
-
},
|
361
|
-
geometry: {}
|
362
|
-
};
|
363
|
-
page.win.dispatchEvent(new CustomEvent("layerSelectionGraphicsChange", { detail: [_unknown] }));
|
364
|
-
expect(page.root.geometries.length).toEqual(1);
|
365
|
-
});
|
366
|
-
});
|