@esri/solutions-components 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +4 -1
  2. package/dist/assets/t9n/public-notification/resources_en.json +4 -1
  3. package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -7
  4. package/dist/cjs/calcite-combobox_3.cjs.entry.js +38 -25
  5. package/dist/cjs/calcite-input-message_5.cjs.entry.js +272 -21
  6. package/dist/cjs/{csvUtils-18a03353.js → csvUtils-83af7ae1.js} +5 -5
  7. package/dist/cjs/layer-table.cjs.entry.js +3 -3
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/map-search.cjs.entry.js +46 -7
  10. package/dist/cjs/{mapViewUtils-8ea9adc5.js → mapViewUtils-55ac76cb.js} +40 -25
  11. package/dist/cjs/public-notification.cjs.entry.js +101 -18
  12. package/dist/cjs/{publicNotificationStore-aca88430.js → publicNotificationStore-28a8759d.js} +3 -1
  13. package/dist/cjs/solutions-components.cjs.js +1 -1
  14. package/dist/collection/collection-manifest.json +0 -5
  15. package/dist/collection/components/buffer-tools/buffer-tools.js +7 -6
  16. package/dist/collection/components/layer-table/layer-table.js +1 -1
  17. package/dist/collection/components/map-layer-picker/map-layer-picker.js +47 -29
  18. package/dist/collection/components/map-search/map-search.js +66 -7
  19. package/dist/collection/components/map-select-tools/map-select-tools.js +125 -8
  20. package/dist/collection/components/pdf-download/pdf-download.js +32 -8
  21. package/dist/collection/components/public-notification/public-notification.css +46 -41
  22. package/dist/collection/components/public-notification/public-notification.js +267 -19
  23. package/dist/collection/components/refine-selection/refine-selection.js +18 -1
  24. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +22 -5
  25. package/dist/{solutions-components/demos/config-pdf-download.html → collection/demos/buffer-tools.html} +13 -21
  26. package/dist/collection/demos/index.html +0 -24
  27. package/dist/collection/demos/map-draw-tools.html +17 -17
  28. package/dist/collection/demos/map-layer-picker.html +2 -0
  29. package/dist/collection/demos/map-search.html +16 -15
  30. package/dist/collection/demos/map-select-tools.html +16 -24
  31. package/dist/collection/demos/new-public-notification.html +46 -35
  32. package/dist/collection/demos/pdf-download.html +8 -1
  33. package/dist/collection/utils/csvUtils.js +4 -4
  34. package/dist/collection/utils/csvUtils.ts +6 -4
  35. package/dist/collection/utils/interfaces.ts +65 -1
  36. package/dist/collection/utils/mapViewUtils.js +36 -22
  37. package/dist/collection/utils/mapViewUtils.ts +50 -27
  38. package/dist/collection/utils/publicNotificationStore.js +3 -1
  39. package/dist/collection/utils/publicNotificationStore.ts +3 -1
  40. package/dist/collection/utils/queryUtils.js +2 -2
  41. package/dist/collection/utils/queryUtils.ts +2 -2
  42. package/dist/components/buffer-tools2.js +1 -1
  43. package/dist/components/csvUtils.js +4 -4
  44. package/dist/components/index.d.ts +0 -5
  45. package/dist/components/index.js +0 -5
  46. package/dist/components/layer-table.js +2 -3
  47. package/dist/components/map-layer-picker2.js +177 -28
  48. package/dist/components/map-search.js +47 -7
  49. package/dist/components/map-select-tools2.js +56 -11
  50. package/dist/components/pdf-download2.js +217 -8
  51. package/dist/components/public-notification.js +154 -55
  52. package/dist/components/publicNotificationStore.js +3 -1
  53. package/dist/components/queryUtils.js +3 -3
  54. package/dist/components/refine-selection-tools2.js +9 -8
  55. package/dist/components/refine-selection2.js +3 -1
  56. package/dist/esm/buffer-tools_6.entry.js +8 -7
  57. package/dist/esm/calcite-combobox_3.entry.js +38 -25
  58. package/dist/esm/calcite-input-message_5.entry.js +271 -20
  59. package/dist/esm/{csvUtils-edc0c2a8.js → csvUtils-eb231cfb.js} +5 -5
  60. package/dist/esm/layer-table.entry.js +3 -3
  61. package/dist/esm/loader.js +1 -1
  62. package/dist/esm/map-search.entry.js +46 -7
  63. package/dist/esm/{mapViewUtils-31d2c2bb.js → mapViewUtils-e5d8a1e1.js} +39 -25
  64. package/dist/esm/public-notification.entry.js +101 -18
  65. package/dist/esm/{publicNotificationStore-3e762eea.js → publicNotificationStore-8e9cb73b.js} +3 -1
  66. package/dist/esm/solutions-components.js +1 -1
  67. package/dist/{collection/demos/config-pdf-download.html → solutions-components/demos/buffer-tools.html} +13 -21
  68. package/dist/solutions-components/demos/index.html +0 -24
  69. package/dist/solutions-components/demos/map-draw-tools.html +17 -17
  70. package/dist/solutions-components/demos/map-layer-picker.html +2 -0
  71. package/dist/solutions-components/demos/map-search.html +16 -15
  72. package/dist/solutions-components/demos/map-select-tools.html +16 -24
  73. package/dist/solutions-components/demos/new-public-notification.html +46 -35
  74. package/dist/solutions-components/demos/pdf-download.html +8 -1
  75. package/dist/solutions-components/p-07593958.entry.js +6 -0
  76. package/dist/solutions-components/p-3fa9b3c8.js +36 -0
  77. package/dist/solutions-components/p-9b5a9117.entry.js +12 -0
  78. package/dist/solutions-components/{p-15cd8a97.js → p-9c1ebc90.js} +1 -1
  79. package/dist/solutions-components/{p-c76f8ff7.entry.js → p-a516c658.entry.js} +1 -1
  80. package/dist/solutions-components/{p-ad42039f.js → p-b668daf8.js} +2 -2
  81. package/dist/solutions-components/p-bfa95147.entry.js +17 -0
  82. package/dist/solutions-components/p-d09a168c.entry.js +6 -0
  83. package/dist/solutions-components/{p-fa6046a8.entry.js → p-fc9609e6.entry.js} +2 -2
  84. package/dist/solutions-components/solutions-components.esm.js +1 -1
  85. package/dist/solutions-components/utils/csvUtils.ts +6 -4
  86. package/dist/solutions-components/utils/interfaces.ts +65 -1
  87. package/dist/solutions-components/utils/mapViewUtils.ts +50 -27
  88. package/dist/solutions-components/utils/publicNotificationStore.ts +3 -1
  89. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  90. package/dist/types/components/buffer-tools/buffer-tools.d.ts +4 -3
  91. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +22 -11
  92. package/dist/types/components/map-search/map-search.d.ts +18 -1
  93. package/dist/types/components/map-select-tools/map-select-tools.d.ts +31 -1
  94. package/dist/types/components/pdf-download/pdf-download.d.ts +7 -2
  95. package/dist/types/components/public-notification/public-notification.d.ts +98 -4
  96. package/dist/types/components/refine-selection/refine-selection.d.ts +5 -0
  97. package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +6 -1
  98. package/dist/types/components.d.ts +154 -180
  99. package/dist/types/preact.d.ts +0 -10
  100. package/dist/types/utils/csvUtils.d.ts +1 -1
  101. package/dist/types/utils/interfaces.d.ts +56 -1
  102. package/dist/types/utils/mapViewUtils.d.ts +19 -9
  103. package/dist/types/utils/publicNotificationStore.d.ts +1 -0
  104. package/package.json +1 -1
  105. package/dist/cjs/check-list.cjs.entry.js +0 -103
  106. package/dist/cjs/config-buffer-tools.cjs.entry.js +0 -125
  107. package/dist/cjs/config-draw-tools.cjs.entry.js +0 -85
  108. package/dist/cjs/config-layer-picker.cjs.entry.js +0 -113
  109. package/dist/cjs/config-pdf-download.cjs.entry.js +0 -117
  110. package/dist/cjs/labelFormats-3236d2e0.js +0 -212
  111. package/dist/collection/components/check-list/check-list.css +0 -3
  112. package/dist/collection/components/check-list/check-list.js +0 -179
  113. package/dist/collection/components/config-buffer-tools/config-buffer-tools.css +0 -34
  114. package/dist/collection/components/config-buffer-tools/config-buffer-tools.js +0 -209
  115. package/dist/collection/components/config-draw-tools/config-draw-tools.css +0 -17
  116. package/dist/collection/components/config-draw-tools/config-draw-tools.js +0 -150
  117. package/dist/collection/components/config-layer-picker/config-layer-picker.css +0 -17
  118. package/dist/collection/components/config-layer-picker/config-layer-picker.js +0 -218
  119. package/dist/collection/components/config-pdf-download/config-pdf-download.css +0 -17
  120. package/dist/collection/components/config-pdf-download/config-pdf-download.js +0 -183
  121. package/dist/collection/demos/check-list.html +0 -65
  122. package/dist/collection/demos/config-buffer-tools.html +0 -92
  123. package/dist/collection/demos/config-draw-tools.html +0 -58
  124. package/dist/collection/demos/config-layer-picker.html +0 -97
  125. package/dist/components/check-list.d.ts +0 -11
  126. package/dist/components/check-list.js +0 -11
  127. package/dist/components/check-list2.js +0 -131
  128. package/dist/components/config-buffer-tools.d.ts +0 -11
  129. package/dist/components/config-buffer-tools.js +0 -187
  130. package/dist/components/config-draw-tools.d.ts +0 -11
  131. package/dist/components/config-draw-tools.js +0 -121
  132. package/dist/components/config-layer-picker.d.ts +0 -11
  133. package/dist/components/config-layer-picker.js +0 -163
  134. package/dist/components/config-pdf-download.d.ts +0 -11
  135. package/dist/components/config-pdf-download.js +0 -154
  136. package/dist/components/labelFormats.js +0 -210
  137. package/dist/components/mapViewUtils.js +0 -129
  138. package/dist/esm/check-list.entry.js +0 -99
  139. package/dist/esm/config-buffer-tools.entry.js +0 -121
  140. package/dist/esm/config-draw-tools.entry.js +0 -81
  141. package/dist/esm/config-layer-picker.entry.js +0 -109
  142. package/dist/esm/config-pdf-download.entry.js +0 -113
  143. package/dist/esm/labelFormats-b37958c3.js +0 -210
  144. package/dist/solutions-components/demos/check-list.html +0 -65
  145. package/dist/solutions-components/demos/config-buffer-tools.html +0 -92
  146. package/dist/solutions-components/demos/config-draw-tools.html +0 -58
  147. package/dist/solutions-components/demos/config-layer-picker.html +0 -97
  148. package/dist/solutions-components/p-16a0e65a.entry.js +0 -6
  149. package/dist/solutions-components/p-35078393.entry.js +0 -17
  150. package/dist/solutions-components/p-3d72bba6.entry.js +0 -6
  151. package/dist/solutions-components/p-3e444242.entry.js +0 -6
  152. package/dist/solutions-components/p-67afea92.entry.js +0 -12
  153. package/dist/solutions-components/p-7dcab29d.js +0 -36
  154. package/dist/solutions-components/p-89f7b02a.entry.js +0 -6
  155. package/dist/solutions-components/p-906b7b96.entry.js +0 -6
  156. package/dist/solutions-components/p-99c98510.entry.js +0 -6
  157. package/dist/solutions-components/p-b1a3605f.entry.js +0 -6
  158. package/dist/solutions-components/p-e99b1247.js +0 -6
  159. package/dist/types/components/check-list/check-list.d.ts +0 -57
  160. package/dist/types/components/config-buffer-tools/config-buffer-tools.d.ts +0 -92
  161. package/dist/types/components/config-draw-tools/config-draw-tools.d.ts +0 -58
  162. package/dist/types/components/config-layer-picker/config-layer-picker.d.ts +0 -83
  163. package/dist/types/components/config-pdf-download/config-pdf-download.d.ts +0 -81
@@ -5,7 +5,7 @@
5
5
  name="viewport"
6
6
  content="initial-scale=1,maximum-scale=1,user-scalable=no"
7
7
  />
8
- <title>Config PDF Download</title>
8
+ <title>Buffer Tools</title>
9
9
  <!--
10
10
  | Copyright 2022 Esri
11
11
  |
@@ -22,7 +22,7 @@
22
22
  | limitations under the License.
23
23
  -->
24
24
  <style>
25
- .map-div {
25
+ #viewDiv {
26
26
  padding: 0;
27
27
  margin: 0;
28
28
  height: 100%;
@@ -39,6 +39,9 @@
39
39
  padding: 1rem;
40
40
  border: 1px solid;
41
41
  }
42
+ .column[dir="rtl"] {
43
+ float: left;
44
+ }
42
45
  </style>
43
46
 
44
47
  <link
@@ -51,39 +54,28 @@
51
54
  <script src="https://js.arcgis.com/4.25/"></script>
52
55
  <script type="module" src="../solutions-components.esm.js"></script>
53
56
  <script>
54
- require(["esri/WebMap", "esri/views/MapView"], (
55
- WebMap,
57
+ require(["esri/Map", "esri/views/MapView"], (
58
+ Map,
56
59
  MapView
57
60
  ) => {
58
- var webMap = new WebMap({
59
- portalItem: {
60
- id: "6a55f6678208461bb7a26d9e418a00bc"
61
- }
61
+
62
+ const map = new Map({
63
+ basemap: "topo-vector"
62
64
  });
63
65
 
64
66
  const demo = document.getElementById("demo");
65
67
  demo.mapView = new MapView({
66
68
  container: "viewDiv",
67
- map: webMap,
69
+ map: map,
68
70
  zoom: 5,
69
71
  center: [-98, 42]
70
72
  });
71
73
  });
72
-
73
- function showResults() {
74
- const demo = document.getElementById("demo");
75
- demo?.getConfigInfo().then(configInfo => {
76
- alert(JSON.stringify(configInfo));
77
- });
78
- };
79
74
  </script>
80
75
  </head>
81
76
 
82
77
  <body>
83
- <div id="viewDiv" class="map-div"></div>
84
- <div class="over-map column">
85
- <config-pdf-download id="demo"></config-pdf-download>
86
- <calcite-button onclick="showResults()">Demo Results</calcite-button>
87
- </div>
78
+ <div id="viewDiv"></div>
79
+ <buffer-tools id="demo" class="over-map column" distance="10" unit="miles"></map-search>
88
80
  </body>
89
81
  </html>
@@ -124,30 +124,6 @@
124
124
  </div>
125
125
  </div>
126
126
  </div>
127
- <div>
128
- <h3>Config Public Notification Examples!</h3>
129
- <div>
130
- <div class="demo-column">
131
- <ul class="nav">
132
- <li>
133
- <calcite-link href="./config-buffer-tools.html" target="_blank">&lt;config-buffer-tools&gt;</calcite-link>
134
- </li>
135
- <li>
136
- <calcite-link href="./config-draw-tools.html" target="_blank">&lt;config-draw-tools&gt;</calcite-link>
137
- </li>
138
- <li>
139
- <calcite-link href="./config-layer-picker.html" target="_blank">&lt;config-layer-picker&gt;</calcite-link>
140
- </li>
141
- <li>
142
- <calcite-link href="./config-pdf-download.html" target="_blank">&lt;config-pdf-download&gt;</calcite-link>
143
- </li>
144
- <li>
145
- <calcite-link href="./check-list.html" target="_blank">&lt;check-list&gt;</calcite-link>
146
- </li>
147
- </ul>
148
- </div>
149
- </div>
150
- </div>
151
127
 
152
128
  <div>
153
129
  <h3>Roadway Management</h3>
@@ -49,27 +49,27 @@
49
49
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
50
50
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
51
51
 
52
+ <script src="https://js.arcgis.com/4.25/"></script>
52
53
  <script type="module" src="../solutions-components.esm.js"></script>
53
- <script type="module">
54
- import Map from 'https://js.arcgis.com/4.25/@arcgis/core/Map.js';
55
- import MapView from 'https://js.arcgis.com/4.25/@arcgis/core/views/MapView.js';
56
- import Sketch from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Sketch.js';
57
- import GraphicsLayer from 'https://js.arcgis.com/4.25/@arcgis/core/layers/GraphicsLayer.js';
54
+ <script>
55
+ require(["esri/WebMap", "esri/views/MapView", "esri/widgets/Legend"], (
56
+ WebMap,
57
+ MapView,
58
+ Legend
59
+ ) => {
58
60
 
59
- const map = new Map({
60
- basemap: "topo-vector"
61
- });
61
+ const map = new Map({
62
+ basemap: "topo-vector"
63
+ });
62
64
 
63
- const demo = document.getElementById("demo");
64
- demo.mapView = new MapView({
65
- container: "viewDiv",
66
- map: map,
67
- zoom: 5,
68
- center: [-98, 42]
65
+ const demo = document.getElementById("demo");
66
+ demo.mapView = new MapView({
67
+ container: "viewDiv",
68
+ map: map,
69
+ zoom: 5,
70
+ center: [-98, 42]
71
+ });
69
72
  });
70
-
71
- demo.Sketch = Sketch;
72
- demo.GraphicsLayer = GraphicsLayer;
73
73
  </script>
74
74
  </head>
75
75
 
@@ -68,6 +68,8 @@
68
68
  zoom: 5,
69
69
  center: [-98, 42]
70
70
  });
71
+
72
+ demo.enabledLayerIds = ["Colorado14ers"];
71
73
  });
72
74
  </script>
73
75
  </head>
@@ -51,25 +51,26 @@
51
51
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
52
52
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
53
53
 
54
+ <script src="https://js.arcgis.com/4.25/"></script>
54
55
  <script type="module" src="../solutions-components.esm.js"></script>
55
- <script type="module">
56
- import Map from 'https://js.arcgis.com/4.25/@arcgis/core/Map.js';
57
- import MapView from 'https://js.arcgis.com/4.25/@arcgis/core/views/MapView.js';
58
- import Search from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Search.js';
56
+ <script>
57
+ require(["esri/Map", "esri/views/MapView"], (
58
+ Map,
59
+ MapView
60
+ ) => {
59
61
 
60
- const map = new Map({
61
- basemap: "topo-vector"
62
- });
62
+ const map = new Map({
63
+ basemap: "topo-vector"
64
+ });
63
65
 
64
- const demo = document.getElementById("demo");
65
- demo.mapView = new MapView({
66
- container: "viewDiv",
67
- map: map,
68
- zoom: 5,
69
- center: [-98, 42]
66
+ const demo = document.getElementById("demo");
67
+ demo.mapView = new MapView({
68
+ container: "viewDiv",
69
+ map: map,
70
+ zoom: 5,
71
+ center: [-98, 42]
72
+ });
70
73
  });
71
-
72
- demo.Search = Search;
73
74
  </script>
74
75
  </head>
75
76
 
@@ -51,33 +51,25 @@
51
51
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
52
52
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
53
53
 
54
+ <script src="https://js.arcgis.com/4.25/"></script>
54
55
  <script type="module" src="../solutions-components.esm.js"></script>
55
- <script type="module">
56
- import Map from 'https://js.arcgis.com/4.25/@arcgis/core/Map.js';
57
- import MapView from 'https://js.arcgis.com/4.25/@arcgis/core/views/MapView.js';
58
- import Sketch from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Sketch.js';
59
- import GraphicsLayer from 'https://js.arcgis.com/4.25/@arcgis/core/layers/GraphicsLayer.js';
60
- import Search from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Search.js';
61
- import Graphic from 'https://js.arcgis.com/4.25/@arcgis/core/Graphic.js';
62
- import SketchViewModel from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Sketch/SketchViewModel.js';
56
+ <script>
57
+ require(["esri/Map", "esri/views/MapView"], (
58
+ Map,
59
+ MapView
60
+ ) => {
61
+ const map = new Map({
62
+ basemap: "topo-vector"
63
+ });
63
64
 
64
- const map = new Map({
65
- basemap: "topo-vector"
65
+ const demo = document.getElementById("demo");
66
+ demo.mapView = new MapView({
67
+ container: "viewDiv",
68
+ map: map,
69
+ zoom: 5,
70
+ center: [-98, 42]
71
+ });
66
72
  });
67
-
68
- const demo = document.getElementById("demo");
69
- demo.mapView = new MapView({
70
- container: "viewDiv",
71
- map: map,
72
- zoom: 5,
73
- center: [-98, 42]
74
- });
75
-
76
- demo.Sketch = Sketch;
77
- demo.GraphicsLayer = GraphicsLayer;
78
- demo.Search = Search;
79
- demo.Graphic = Graphic;
80
- demo.SketchViewModel = SketchViewModel;
81
73
  </script>
82
74
  </head>
83
75
 
@@ -60,47 +60,58 @@
60
60
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
61
61
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
62
62
 
63
+ <script src="https://js.arcgis.com/4.25/"></script>
63
64
  <script type="module" src="../solutions-components.esm.js"></script>
64
65
 
65
- <script type="module">
66
- import WebMap from 'https://js.arcgis.com/4.25/@arcgis/core/WebMap.js';
67
- import MapView from 'https://js.arcgis.com/4.25/@arcgis/core/views/MapView.js';
68
- import Legend from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Legend.js';
69
- import Sketch from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Sketch.js';
70
- import GraphicsLayer from 'https://js.arcgis.com/4.25/@arcgis/core/layers/GraphicsLayer.js';
71
- import Search from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Search.js';
72
- import Graphic from 'https://js.arcgis.com/4.25/@arcgis/core/Graphic.js';
73
- import SketchViewModel from 'https://js.arcgis.com/4.25/@arcgis/core/widgets/Sketch/SketchViewModel.js';
74
- import * as geometryEngine from 'https://js.arcgis.com/4.25/@arcgis/core/geometry/geometryEngine.js';
75
-
76
- var webMap = new WebMap({
77
- portalItem: {
78
- // solutions
79
- // id: "3715f4899bea4b2a948347c5c2357e58"
80
- // InstantApps
81
- id: "863e4f6f2a7840db896cc1b1606d552d"
82
- }
83
- });
66
+ <script>
67
+ require(["esri/WebMap", "esri/views/MapView", "esri/widgets/Legend"], (
68
+ WebMap,
69
+ MapView,
70
+ Legend
71
+ ) => {
72
+ var webMap = new WebMap({
73
+ portalItem: {
74
+ // solutions
75
+ // id: "3715f4899bea4b2a948347c5c2357e58"
76
+ // InstantApps
77
+ id: "863e4f6f2a7840db896cc1b1606d552d"
78
+ }
79
+ });
84
80
 
85
- const demo = document.getElementById("demo");
86
- demo.mapView = new MapView({
87
- container: "viewDiv",
88
- map: webMap
89
- });
81
+ const demo = document.getElementById("demo");
82
+ demo.mapView = new MapView({
83
+ container: "viewDiv",
84
+ map: webMap
85
+ });
90
86
 
91
- demo.mapView.when(() => {
92
- const legend = new Legend({
93
- view: demo.mapView
87
+ demo.mapView.when(() => {
88
+ const legend = new Legend({
89
+ view: demo.mapView
90
+ });
91
+ demo.mapView.ui.add(legend, "top-left");
94
92
  });
95
- demo.mapView.ui.add(legend, "top-left");
93
+ demo.addresseeLayerIds = ["18434515eb8-layer-12"];
94
+ demo.defaultBufferDistance = 100;
95
+ demo.defaultBufferUnit = "kilometers";
96
+ demo.exportOptions = {
97
+ csvOptions: {
98
+ enabled: true, // I question if this should be exposed
99
+ addColumnTitle: false
100
+ },
101
+ pdfOptions: {
102
+ enabled: true, // I question if this should be exposed
103
+ enabledSizeValues: [6,10,14,20]
104
+ }
105
+ };
106
+ demo.featureEffect = {
107
+ includedEffect: "invert(100%)",
108
+ excludedEffect: "blur(5px)"
109
+ };
110
+ demo.featureHighlightEnabled = true;
111
+ demo.noResultText = "No results found";
112
+ demo.selectionLayerIds = ["1843422bf6b-layer-7"];
113
+ demo.showSearchSettings = false;
96
114
  });
97
-
98
- demo.Sketch = Sketch;
99
- demo.GraphicsLayer = GraphicsLayer;
100
- demo.Search = Search;
101
- demo.Graphic = Graphic;
102
- demo.SketchViewModel = SketchViewModel;
103
- demo.geometryEngine = geometryEngine;
104
115
  </script>
105
116
  </head>
106
117
 
@@ -39,9 +39,16 @@
39
39
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
40
40
 
41
41
  <script type="module" src="../solutions-components.esm.js"></script>
42
+ <script>
43
+ function init() {
44
+ const demo = document.getElementById("demo");
45
+ demo.enabledSizeValues = [6,10];
46
+ demo.disabled = false;
47
+ }
48
+ </script>
42
49
  </head>
43
50
 
44
- <body>
51
+ <body onload="init()">
45
52
  <pdf-download class="column over-map" id="demo"></pdf-download>
46
53
  </body>
47
54
  </html>
@@ -0,0 +1,6 @@
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{r as i,h as t,H as e,g as s}from"./p-c023e6a1.js";import{b as a,c as l,E as n,d as o}from"./p-be41429f.js";import{l as d}from"./p-1c567f3a.js";import{a as c,c as h,g as r,h as p}from"./p-3fa9b3c8.js";import{s as g}from"./p-9c1ebc90.js";import{g as b}from"./p-44da2507.js";import{g as u,a as m}from"./p-fc884dd6.js";import"./p-4307dacd.js";import"./p-3b010ce1.js";const v=class{constructor(t){i(this,t),this.addresseeLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.exportOptions=void 0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.addresseeLayer=void 0,this._downloadActive=!0,this._numSelected=0,this._pageType=a.LIST,this._saveEnabled=!1,this._selectionSets=[],this._sketchType=l.INTERACTIVE,this._selectionWorkflowType=n.SEARCH,this._showLayerSelectionChangeModal=!1,this._translations=void 0}async mapViewWatchHandler(i){(null==i?void 0:i.popup)&&(this._popupsEnabled=null==i?void 0:i.popup.autoOpenEnabled)}async selectionSetsWatchHandler(i,t){i&&i!==t&&i.length>0&&0===i.filter((i=>i.workflowType!==n.REFINE)).length&&(this._selectionSets=[])}async pageTypeWatchHandler(i,t){if(this._checkPopups(),this._clearHighlight(),t!==a.SELECT&&t!==a.REFINE||await this._clearSelection(),i!==a.SELECT)return this._highlightFeatures()}selectionSetsChanged(i){this._selectionSets=[...i.detail]}sketchTypeChange(i){this._sketchType=i.detail}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){var i,s,l,n,o,d;const c=this._selectionSets.length>0,h="boolean"!=typeof(null===(s=null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions)||void 0===s?void 0:s.enabled)||(null===(l=this.exportOptions)||void 0===l?void 0:l.csvOptions.enabled),r="boolean"!=typeof(null===(o=null===(n=this.exportOptions)||void 0===n?void 0:n.pdfOptions)||void 0===o?void 0:o.enabled)||(null===(d=this.exportOptions)||void 0===d?void 0:d.pdfOptions.enabled);return t(e,null,t("calcite-shell",null,t("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",!1,a.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",!c,a.REFINE,this._translations.refineSelection):void 0,r?this._getActionGroup("file-pdf",!c,a.PDF,this._translations.downloadPDF):void 0,h?this._getActionGroup("file-csv",!c,a.CSV,this._translations.downloadCSV):void 0),this._getPage(this._pageType)))}async _initModules(){const[i]=await d(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getActionGroup(i,e,s,a){return t("calcite-action-group",{class:this.showRefineSelection?"action-center w-1-4":"action-center w-1-3",layout:"horizontal"},t("calcite-action",{active:this._pageType===s,alignment:"center",class:"width-full height-full",compact:!1,disabled:e,icon:i,id:i,onClick:()=>{this._setPageType(s)},text:""}),t("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},t("span",null,a)))}_setPageType(i){this._pageType=i}_getPage(i){let t;switch(i){case a.LIST:t=this._getListPage();break;case a.SELECT:t=this._getSelectPage();break;case a.REFINE:t=this._getRefinePage();break;case a.PDF:t=this._getPDFPage();break;case a.CSV:t=this._getCSVPage()}return t}_getListPage(){const i=this._selectionSets.filter((i=>i.workflowType!==n.REFINE)).length>0,e=u(this._selectionSets);return i?t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},this._translations.myLists)),this._getNotice(this._translations.listHasSetsTip,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),t("div",{class:"padding-sides-1 height-1-1-2"},t("div",{class:"position-left"},t("calcite-label",{alignment:"start",class:"font-bold"},this._translations.notifications)),t("div",{class:"position-right"},t("calcite-input-message",{active:!0,class:"info-blue margin-top-0",scale:"m"},this._translations.uniqueCout.replace("{{n}}",e.toString())))),i?this._getSelectionSetList():t("div",{class:"info-message"},t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},this._translations.add)),this._showModal(this._showLayerSelectionChangeModal)):t("calcite-panel",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},this._translations.myLists)),t("div",{class:"padding-sides-1"},t("calcite-label",null,this._translations.notifications)),t("div",{class:"info-message padding-bottom-1"},t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),this._getNotice(this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),t("div",{class:"display-flex padding-1"},t("calcite-button",{onClick:()=>{this._setPageType(a.SELECT)},width:"full"},this._translations.add)))}_getMapLayerPicker(){var i;return t("div",{class:"display-flex padding-sides-1"},t("calcite-label",{class:"font-bold width-full"},this._translations.addresseeLayer,t("map-layer-picker",{enabledLayerIds:this.addresseeLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._layerSelectionChange(i),selectedLayerIds:this.addresseeLayer?[null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.id]:[],selectionMode:"single"})))}_getSelectionSetList(){return t("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((i,e,s)=>(e.workflowType!==n.REFINE&&i.push(t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),label:e.label,onClick:()=>this._gotoSelection(e,this.mapView)},this._getAction(!0,"pencil","",(i=>this._openSelection(e,i)),!1,"actions-end"),this._getAction(!0,"x","",(i=>this._deleteSelection(s,i)),!1,"actions-end"))),i)),[]))}_showModal(i){return t("calcite-modal",{"aria-labelledby":"modal-title","background-color":"grey",color:"red",open:i,scale:"s",width:"s"},t("div",{id:"modal-title",slot:"header"},this._translations.shouldProceed),t("div",{slot:"content"},this._translations.proceedInfo),t("calcite-button",{appearance:"outline",onClick:()=>this._cancelLayerChange(),slot:"secondary",width:"full"},this._translations.cancel),t("calcite-button",{onClick:()=>this._handleLayerChange(),slot:"primary",width:"full"},this._translations.proceed))}_cancelLayerChange(){this._layerSelectionChangeEvt.preventDefault(),this._layerSelectionChangeEvt.stopPropagation(),this._layerSelectionChangeEvt=void 0,this._showLayerSelectionChangeModal=!1}async _handleLayerChange(){var i,t;this._showLayerSelectionChangeModal=!1;const e=(null===(t=null===(i=this._layerSelectionChangeEvt)||void 0===i?void 0:i.detail)||void 0===t?void 0:t.length)>0?this._layerSelectionChangeEvt.detail[0]:"";await this._updateAddresseeLayer(e)}_getSelectPage(){var i,e;const s=this._selectionWorkflowType===n.SELECT?this._translations.selectLayerTip:this._selectionWorkflowType===n.SKETCH?this._sketchType===l.INTERACTIVE?this._translations.selectSketchTip:this._translations.selectLayerTip:this._translations.selectSearchTip;return t("calcite-panel",null,this._getLabel(this._translations.stepTwoFull.replace("{{layer}}",null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.title)),this._getNotice(s),t("div",{class:"padding-1"},t("map-select-tools",{class:"font-bold",enabledLayerIds:this.selectionLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,onSelectionSetChange:i=>this._updateForSelection(i),onWorkflowTypeChange:i=>this._updateForWorkflowType(i),ref:i=>{this._selectTools=i},searchConfiguration:this.searchConfiguration,selectLayerView:this.addresseeLayer,selectionSet:this._activeSelection,showBufferTools:this.showSearchSettings})),t("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},t("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),t("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedAddresses.replace("{{n}}",this._numSelected.toString()).replace("{{layer}}",(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.title)||""))),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getRefinePage(){return t("calcite-panel",null,this._getLabel(this._translations.refineSelection),this._getNotice(this._translations.refineTip,"padding-sides-1"),t("refine-selection",{addresseeLayer:this.addresseeLayer,enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets}))}_getPDFPage(){return this._getDownloadPage(o.PDF)}_getCSVPage(){return this._getDownloadPage(o.CSV)}_getDownloadPage(i){var e,s;const a=i===o.PDF,l=(null===(e=this.exportOptions)||void 0===e?void 0:e.pdfOptions.enabledSizeValues.length)>1;return t("calcite-panel",null,t("div",null,t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold"},a?this._translations.pdfDownloads:this._translations.csvDownloads),t("calcite-label",null,this._translations.notifications)),this._getSelectionLists(),t("div",{class:"margin-side-1 padding-top-1 border-bottom"}),t("div",{class:"padding-top-sides-1"},t("calcite-label",{layout:"inline"},t("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicates=i}}),this._translations.removeDuplicate)),t("div",{class:a&&l?"":"display-none"},this._getLabel(this._translations.selectPDFLabelOption,!1),t("div",{class:"padding-sides-1"},t("pdf-download",{disabled:!this._downloadActive,enabledSizeValues:null===(s=this.exportOptions)||void 0===s?void 0:s.pdfOptions.enabledSizeValues,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),t("div",{class:"padding-1 display-flex"},t("calcite-button",{disabled:!this._downloadActive,onClick:a?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},a?this._translations.downloadPDF:this._translations.downloadCSV))))}_getPageNavButtons(i,e,s,a,l,n){return t("div",null,t("div",{class:"display-flex padding-top-sides-1"},t("calcite-button",{disabled:e,onClick:s,width:"full"},i)),t("div",{class:"display-flex padding-top-1-2 padding-sides-1"},t("calcite-button",{appearance:"outline",disabled:l,onClick:n,width:"full"},a)))}_getNotice(i,e="padding-1"){return t("calcite-notice",{class:e,color:"green",icon:"lightbulb",open:!0},t("div",{slot:"message"},i))}_getLabel(i,e=!1){return t("div",{class:"padding-top-sides-1"},t("calcite-label",{class:"font-bold","disable-spacing":e},i))}_getSelectionLists(){return this._selectionSets.reduce(((i,e)=>(e.workflowType!==n.REFINE&&(!this._downloadActive&&e.download&&(this._downloadActive=!0),i.push(t("div",{class:"display-flex padding-sides-1 padding-bottom-1"},t("calcite-checkbox",{checked:e.download,onClick:()=>{this._toggleDownload(e.id)}}),t("calcite-list",{class:"list-border margin-start-1-2 w-100",id:"download-list"},t("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",e.selectedIds.length.toString()),disabled:!e.download,label:e.label,onClick:()=>{this._toggleDownload(e.id)}}))))),i)),[])||t("div",null)}async _toggleDownload(i){let t=!1;this._selectionSets=this._selectionSets.map((e=>(e.download=e.id===i?!e.download:e.download,t=!!e.download||t,e))),this._downloadActive=t,await this._highlightFeatures()}_downloadPDF(){const i=m(this._getDownloadSelectionSets());this._downloadTools.downloadPDF(i,this._removeDuplicates.checked)}_downloadCSV(){var i;const t=m(this._getDownloadSelectionSets());this._downloadTools.downloadCSV(t,this._removeDuplicates.checked,null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions.addColumnTitle)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===n.REFINE))}_updateForWorkflowType(i){this._selectionWorkflowType=i.detail}_getAction(i,e,s,a,l=!1,n=""){return t("calcite-action",{disabled:!i,icon:e,indicator:l,onClick:a,slot:n,text:s})}_updateForSelection(i){this._numSelected=i.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),"boolean"==typeof this._popupsEnabled&&this.mapView.popup&&(this.mapView.popup.autoOpenEnabled=this._popupsEnabled),this._setPageType(a.LIST)}async _layerSelectionChange(i){var t,e,s;const a=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";a!==(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.id)&&(this._showLayerSelectionChangeModal=void 0!==(null===(s=this.addresseeLayer)||void 0===s?void 0:s.layer.id)&&this._selectionSets.length>0,this._showLayerSelectionChangeModal?this._layerSelectionChangeEvt=i:await this._updateAddresseeLayer(a))}async _updateAddresseeLayer(i){this.addresseeLayer=await c(this.mapView,i),await this._updateSelectionSets(this.addresseeLayer)}async _updateSelectionSets(i){const t=this._selectionSets.filter((i=>i.workflowType!==n.REFINE)),e=[];return t.forEach((t=>{t.layerView=i,t.selectedIds=[],e.push(h(t,this._geometryEngine))})),Promise.all(e).then((async i=>{i.forEach(((i,e)=>{t[e].selectedIds=i})),await this._highlightFeatures(),this._selectionSets=[...t]}))}async _saveSelection(){var i,t;const e=await(null===(i=this._selectTools)||void 0===i?void 0:i.getSelection()),s=null===(t=this._selectTools)||void 0===t?void 0:t.isUpdate;return this._selectionSets=s?this._selectionSets.map((i=>i.id===e.id?e:i)):[...this._selectionSets,e],this._home()}async _clearSelection(){var i;await(null===(i=this._selectTools)||void 0===i?void 0:i.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(i,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter(((t,e)=>{if(e!==i)return t})),this._highlightFeatures()}_gotoSelection(i,t){r(i.selectedIds,i.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(i,t){t.stopPropagation(),this._activeSelection=i,this._pageType=a.SELECT}async _highlightFeatures(){this._clearHighlight();const i=m(this._selectionSets);i.length>0&&(g.highlightHandle=await p(i,this.addresseeLayer,this.mapView))}_checkPopups(){var i;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(i=this.mapView)||void 0===i?void 0:i.popup.autoOpenEnabled)}_clearHighlight(){var i;g&&g.highlightHandle&&(null===(i=g.highlightHandle)||void 0===i||i.remove())}async _getTranslations(){const i=await b(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_selectionSets:["selectionSetsWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};v.style=':host{display:block;--calcite-input-message-spacing-value:0}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-3{width:33.3%}.w-1-4{width:25%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.main-label{float:left}html[dir="rtl"] .main-label{float:right}.back-label:hover{cursor:pointer;color:var(--calcite-ui-brand-hover)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.margin-side-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.border-top{border-top:1px solid var(--calcite-ui-border-2)}.w-100{width:100%}.w-50{width:50%}.padding-1-2{padding:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.position-left{position:absolute;left:1rem}.position-left[dir="rtl"]{position:absolute;right:1rem}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.num-selected{align-items:center;display:flex}';export{v as public_notification}
@@ -0,0 +1,36 @@
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{E as t}from"./p-be41429f.js";
7
+ /** @license
8
+ * Copyright 2022 Esri
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */async function n(t,a,s){const e=a.capabilities.query.maxRecordCount,o={start:t,num:e,outFields:["*"],returnGeometry:!0,where:"1=1"},r=await a.queryFeatures(o);return s=s.concat(r.features),r.exceededTransferLimit?n(t+=e,a,s):Promise.resolve(s)}async function a(t,n){let a=[];const s=t.map((t=>async function(t,n){const a=n.createQuery();return a.spatialRelationship="intersects",a.geometry=t,n.queryObjectIds(a)}
22
+ /** @license
23
+ * Copyright 2022 Esri
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */(t,n)));return(await Promise.all(s)).forEach((t=>{a=[...a,...t||[]]})),a}async function s(t,n){const a=n.createQuery();return a.outFields=["*"],a.objectIds=t,n.queryFeatures(a)}async function e(t,n,a,s){const o=n.capabilities.query.maxRecordCount,r={start:t,num:o,outFields:["*"],returnGeometry:!0,geometry:a},c=await n.queryFeatures(r);return s[n.id]=s[n.id].concat(c.features),c.exceededTransferLimit?e(t+=o,n,a,s):Promise.resolve(s)}function o(t,n){return[...c(t,"polygon",n),...c(t,"polyline",n),...c(t,"point",n)]}function r(n,s){let e=Promise.resolve([]);return n.workflowType!==t.REFINE&&(e=a(n.buffer?[n.buffer]:o(n.geometries,s),n.layerView.layer)),e}function c(t,n,a){const s=t.filter((t=>t.type===n));return s.length<=1?s:[a.union(s)]}async function i(t){let n={};return await t.when((()=>{n=t.map.layers.toArray().reduce(((t,n)=>(t[n.id]=n.title,t)),{})})),n}async function u(t){let n=[];return await t.when((()=>{n=t.map.layers.toArray().map((t=>t.id))})),n}async function f(t,n){const a=await async function(t,n){let a=[];return await t.when((()=>{a=t.map.layers.toArray().filter((t=>t.id===n))})),a.length>0?a[0]:void 0}(t,n);return a?await t.whenLayerView(a):void 0}async function y(t,n,a,s=!1){return s&&await w(t,n,a,!1),n.highlight(t)}async function w(t,n,a,s=!0,e){const o=await async function(t,n){const a=n.createQuery();return a.objectIds=t,n.queryExtent(a)}(t,n.layer);await a.goTo(o.extent),s&&await async function(t,n,a){const s={objectIds:t};n.featureEffect=Object.assign(Object.assign({},a),{filter:s}),setTimeout((()=>{n.featureEffect=void 0}),1300)}(t,n,e)}export{f as a,s as b,r as c,a as d,o as e,e as f,w as g,y as h,u as i,i as j,n as q}
@@ -0,0 +1,12 @@
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{r as i,c as t,h as e,H as s,g as a}from"./p-c023e6a1.js";import{f as n}from"./p-d48a24e6.js";import{d as o,f as c,c as l,u as r,r as h,a as d,F as m}from"./p-cdc46c0c.js";import{g as p}from"./p-a80b3880.js";import{T as u,C as b,b as g,c as f,h as v,d as x,e as y,g as w,a as k}from"./p-a5b1ab03.js";import{c as C,d as z,g as I}from"./p-bd67334c.js";import{s as $,c as H,a as _,d as D,H as j}from"./p-316f56db.js";import{c as L}from"./p-9a9955db.js";import{u as A}from"./p-7daea1df.js";import{i as E,t as S,g as P,a as F}from"./p-83166522.js";import{c as T,d as B}from"./p-2e9ed892.js";import{d as M}from"./p-4e32bf8c.js";import{c as O,d as R}from"./p-ea534300.js";import{i as W,j as U}from"./p-3fa9b3c8.js";import{s as V}from"./p-9c1ebc90.js";import"./p-729708a3.js";import"./p-be41429f.js";import"./p-4307dacd.js";const X="combobox-item-",Y="combobox-chip-",G="combobox-label-",K="combobox-listbox-",N="combobox-input-",q=class{constructor(e){i(this,e),this.calciteLookupChange=t(this,"calciteLookupChange",6),this.calciteComboboxChange=t(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=t(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipDismiss=t(this,"calciteComboboxChipDismiss",6),this.calciteComboboxBeforeClose=t(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=t(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=t(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=t(this,"calciteComboboxOpen",6),this.active=!1,this.open=!1,this.disabled=!1,this.maxItems=0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multi",this.scale="m",this.value=null,this.intlRemoveTag=u.removeTag,this.placement=o,this.internalValueChangeFlag=!1,this.items=[],this.groupItems=[],this.selectedItems=[],this.visibleItems=[],this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.text="",this.textInput=null,this.mutationObserver=L("mutation",(()=>this.updateItems())),this.resizeObserver=L("resize",(()=>this.setMaxScrollerHeight())),this.guid=p(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?c(t,i):null},this.getValue=()=>{const i=this.selectedItems.map((i=>{var t;return null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.toString()}));return(null==i?void 0:i.length)?i.length>1?i:i[0]:""},this.onLabelClick=()=>{this.setFocus()},this.keydownHandler=i=>{const{key:t}=i;switch(t){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):this.open&&(this.open=!1,i.preventDefault());break;case"ArrowLeft":this.previousChip(),i.preventDefault();break;case"ArrowRight":this.nextChip(),i.preventDefault();break;case"ArrowUp":i.preventDefault(),this.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":i.preventDefault(),this.open||(this.open=!0),this.shiftActiveItemIndex(1),this.comboboxInViewport()||this.el.scrollIntoView();break;case" ":this.textInput.value||(i.preventDefault(),this.open=!0,this.shiftActiveItemIndex(1));break;case"Home":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(this.visibleItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.open=!1,i.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.visibleItems[this.activeItemIndex]),i.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),i.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):i.defaultPrevented||$(this)&&i.preventDefault();break;case"Delete":case"Backspace":this.activeChipIndex>-1?(i.preventDefault(),this.removeActiveChip()):!this.text&&this.isMulti()&&(i.preventDefault(),this.removeLastChip())}},this.toggleCloseEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxClose",this.toggleCloseEnd)},this.toggleOpenEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxOpen",this.toggleOpenEnd)},this.setMaxScrollerHeight=async()=>{const{listContainerEl:i,open:t,referenceEl:e}=this;if(!i||!t)return;await this.reposition(!0);const s=this.getMaxScrollerHeight();i.style.maxHeight=s>0?`${s}px`:"",i.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipDismissHandler=(i,t)=>{this.open=!1;const e=this.items.find((i=>i===t));e&&this.toggleSelection(e,!1),this.calciteComboboxChipDismiss.emit(i.detail)},this.clickHandler=i=>{i.composedPath().some((i=>"CALCITE-CHIP"===i.tagName))||(this.open=!this.open,this.updateActiveItemIndex(0),this.setFocus())},this.setInactiveIfNotContained=i=>{const t=i.composedPath();!this.open||t.includes(this.el)||t.includes(this.referenceEl)||(this.allowCustomValues&&this.text.trim().length&&this.addCustomChip(this.text),"single"===this.selectionMode&&(this.textInput&&(this.textInput.value=""),this.text="",this.filterItems(""),this.updateActiveItemIndex(-1)),this.open=!1)},this.setFloatingEl=i=>{this.floatingEl=i,l(this,this.referenceEl,this.floatingEl)},this.setContainerEl=i=>{this.resizeObserver.observe(i),this.listContainerEl=i,this.transitionEl=i,T(this)},this.setReferenceEl=i=>{this.referenceEl=i,l(this,this.referenceEl,this.floatingEl)},this.inputHandler=i=>{const t=i.target.value;this.text=t,this.filterItems(t),t&&(this.activeChipIndex=-1)},this.filterItems=(()=>{const i=(i,t)=>i&&t.some((({label:t,value:e})=>i.tagName===y?e===i.label:e===i.textLabel||e===i.value||t===i.textLabel||t===i.value));return M((t=>{const e=n(this.data,t);this.getCombinedItems().forEach((t=>{const s=!i(t,e);t.hidden=s;const[a,n]=t.ancestors;(i(a,e)||i(n,e))&&(t.hidden=!1),s||t.ancestors.forEach((i=>i.hidden=!1))})),this.visibleItems=this.getVisibleItems(),this.calciteComboboxFilterChange.emit({visibleItems:[...this.visibleItems],text:t})}),100)})(),this.internalCalciteLookupChangeEvent=()=>{this.calciteLookupChange.emit(this.selectedItems)},this.emitCalciteLookupChange=M(this.internalCalciteLookupChangeEvent,0),this.internalComboboxChangeEvent=()=>{const{selectedItems:i}=this;this.calciteComboboxChange.emit({selectedItems:i})},this.emitComboboxChange=M(this.internalComboboxChangeEvent,0),this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.visibleItems=this.getVisibleItems(),this.needsIcon=this.getNeedsIcon(),this.allowCustomValues||this.setMaxScrollerHeight()},this.scrollToActiveItem=()=>{const i=this.visibleItems[this.activeItemIndex],t=this.calculateSingleItemHeight(i),{offsetHeight:e,scrollTop:s}=this.listContainerEl;e+s<i.offsetTop+t?this.listContainerEl.scrollTop=i.offsetTop-e+t:i.offsetTop<s&&(this.listContainerEl.scrollTop=i.offsetTop)},this.comboboxFocusHandler=()=>{var i;null===(i=this.textInput)||void 0===i||i.focus()},this.comboboxBlurHandler=i=>{this.setInactiveIfNotContained(i)}}activeHandler(i){if(this.disabled)return this.active=!1,void(this.open=!1);this.open=i}openHandler(i){if(i||r(this.floatingEl),this.disabled)return this.active=!1,void(this.open=!1);this.active=i,this.setMaxScrollerHeight()}handleDisabledChange(i){i||(this.active=!1,this.open=!1)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}valueHandler(i){if(!this.internalValueChangeFlag){const t=this.getItems();Array.isArray(i)?t.forEach((t=>t.selected=i.includes(t.value))):t.forEach(i?t=>t.selected=i===t.value:i=>i.selected=!1),this.updateItems()}}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}documentClickHandler(i){E(i)&&this.setInactiveIfNotContained(i)}calciteComboboxItemChangeHandler(i){if(this.ignoreSelectedEventsFlag)return;const t=i.target,e=this.visibleItems.indexOf(t);this.updateActiveItemIndex(e),this.toggleSelection(t,t.selected)}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return h(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},i)}async setFocus(){var i;null===(i=this.textInput)||void 0===i||i.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var i;this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0}),C(this),H(this),T(this),this.setFilteredPlacements(),this.reposition(!0),this.active&&this.activeHandler(this.active),this.open&&this.openHandler(this.open)}componentWillLoad(){this.updateItems()}componentDidLoad(){_(this,this.getValue()),this.reposition(!0)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),A(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),z(this),D(this),d(this,this.referenceEl,this.floatingEl),B(this)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}textHandler(){this.updateActiveItemIndex(-1)}comboboxInViewport(){const i=this.el.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.right<=(window.innerWidth||document.documentElement.clientWidth)&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onBeforeOpen(){this.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}getMaxScrollerHeight(){const i=this.getCombinedItems().filter((i=>!i.hidden)),{maxItems:t}=this;let e=0,s=0;return i.length>t&&i.forEach((i=>{if(e<t&&t>0){const t=this.calculateSingleItemHeight(i);t>0&&(s+=t,e++)}})),s}calculateSingleItemHeight(i){let t=i.offsetHeight;return Array.from(i.querySelectorAll(b)).map((i=>null==i?void 0:i.offsetHeight)).forEach((i=>{t-=i})),t}getCombinedItems(){return[...this.groupItems,...this.items]}toggleSelection(i,t=!i.selected){i&&(this.isMulti()?(i.selected=t,this.updateAncestors(i),this.selectedItems=this.getSelectedItems(),this.emitCalciteLookupChange(),this.emitComboboxChange(),this.resetText(),this.filterItems("")):(this.ignoreSelectedEventsFlag=!0,this.items.forEach((e=>e.selected=e===i&&t)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.textInput&&(this.textInput.value=i.textLabel),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")))}updateAncestors(i){if("ancestors"!==this.selectionMode)return;const t=g(i),e=f(i);i.selected?t.forEach((i=>{i.selected=!0})):(e.forEach((i=>i.selected=!1)),[...t].forEach((i=>{v(i)||(i.selected=!1)})))}getVisibleItems(){return this.items.filter((i=>!i.hidden))}getSelectedItems(){if(!this.isMulti()){const i=this.items.find((({selected:i})=>i));return i?[i]:[]}return this.items.filter((i=>i.selected&&("ancestors"!==this.selectionMode||!v(i)))).sort(((i,t)=>{const e=this.selectedItems.indexOf(i),s=this.selectedItems.indexOf(t);return e>-1&&s>-1?e-s:s-e}))}getData(){return this.items.map((i=>({constant:i.constant,filterDisabled:i.filterDisabled,value:i.value,label:i.textLabel})))}getNeedsIcon(){return"single"===this.selectionMode&&this.items.some((i=>i.icon))}resetText(){this.textInput&&(this.textInput.value=""),this.text=""}getItems(){return Array.from(this.el.querySelectorAll(x)).filter((i=>!i.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(y))}addCustomChip(i,t){const e=this.items.find((t=>t.textLabel===i));if(e)this.toggleSelection(e,!0);else{this.isMulti()||this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1);const e=document.createElement(x);e.value=i,e.textLabel=i,e.selected=!0,this.el.appendChild(e),this.resetText(),t&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitCalciteLookupChange(),this.emitComboboxChange()}}removeActiveChip(){this.toggleSelection(this.selectedItems[this.activeChipIndex],!1),this.setFocus()}removeLastChip(){this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1),this.setFocus()}previousChip(){if(this.text)return;const i=this.activeChipIndex;this.activeChipIndex=-1===i?this.selectedItems.length-1:Math.max(i-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){if(this.text||-1===this.activeChipIndex)return;const i=this.activeChipIndex+1;i>this.selectedItems.length-1?(this.activeChipIndex=-1,this.setFocus()):(this.activeChipIndex=i,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){var i;const t=null===(i=this.selectedItems[this.activeChipIndex])||void 0===i?void 0:i.guid,e=t?this.referenceEl.querySelector(`#${Y}${t}`):null;null==e||e.setFocus()}shiftActiveItemIndex(i){const{length:t}=this.visibleItems;this.updateActiveItemIndex((this.activeItemIndex+t+i)%t),this.scrollToActiveItem()}updateActiveItemIndex(i){var t;this.activeItemIndex=i;let e=null;this.visibleItems.forEach(((t,s)=>{s===i?(t.active=!0,e=`${X}${t.guid}`):t.active=!1})),this.activeDescendant=e,this.activeItemIndex>-1&&(this.activeChipIndex=-1,null===(t=this.textInput)||void 0===t||t.focus())}isMulti(){return"single"!==this.selectionMode}renderChips(){const{activeChipIndex:i,scale:t,selectionMode:s,intlRemoveTag:a}=this;return this.selectedItems.map(((n,o)=>{const c={chip:!0,"chip--active":i===o},l=[...[...g(n)].reverse(),n].map((i=>i.textLabel)),r="ancestors"!==s?n.textLabel:l.join(" / ");return e("calcite-chip",{class:c,dismissLabel:a,dismissible:!0,icon:n.icon,id:n.guid?`${Y}${n.guid}`:null,key:n.textLabel,onCalciteChipDismiss:i=>this.calciteChipDismissHandler(i,n),scale:t,title:r,value:n.value},r)}))}renderInput(){const{guid:i,active:t,disabled:s,placeholder:a,selectionMode:n,selectedItems:o,open:c}=this,l="single"===n,r=o[0],h=!(c||t)&&l&&!!r;return e("span",{class:{"input-wrap":!0,"input-wrap--single":l}},h&&e("span",{class:{label:!0,"label--icon":!!(null==r?void 0:r.icon)},key:"label"},r.textLabel),e("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${K}${i}`,"aria-label":I(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":h,"input--icon":!!this.placeholderIcon},disabled:s,id:`${N}${i}`,key:"input",onBlur:this.comboboxBlurHandler,onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:a,ref:i=>this.textInput=i,type:"text"}))}renderListBoxOptions(){return this.visibleItems.map((i=>e("li",{"aria-selected":S(i.selected),id:i.guid?`${X}${i.guid}`:null,role:"option",tabindex:"-1"},i.textLabel)))}renderFloatingUIContainer(){const{active:i,setFloatingEl:t,setContainerEl:s,open:a}=this;return e("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":a||i},ref:t},e("div",{class:{"list-container":!0,[m.animation]:!0,[m.animationActive]:a||i},ref:s},e("ul",{class:{list:!0,"list--hide":!(a||i)}},e("slot",null))))}renderIconStart(){const{selectedItems:i,placeholderIcon:t,selectionMode:s}=this,a=i[0],n=null==a?void 0:a.icon,o="single"===s;return(!this.open&&a?!!n&&o:!!this.placeholderIcon&&(!a||o))&&e("span",{class:"icon-start"},e("calcite-icon",{class:"selected-icon",icon:!this.open&&a?n:t,scale:"s"}))}renderIconEnd(){const{active:i,open:t}=this;return e("span",{class:"icon-end"},e("calcite-icon",{icon:i||t?"chevron-up":"chevron-down",scale:"s"}))}render(){const{active:i,guid:t,label:a,open:n}=this,o="single"===this.selectionMode;return e(s,null,e("div",{"aria-autocomplete":"list","aria-controls":`${K}${t}`,"aria-expanded":S(n||i),"aria-haspopup":"listbox","aria-labelledby":`${G}${t}`,"aria-live":"polite","aria-owns":`${K}${t}`,class:{wrapper:!0,"wrapper--single":o||!this.selectedItems.length,"wrapper--active":n||i},onClick:this.clickHandler,onKeyDown:this.keydownHandler,ref:this.setReferenceEl,role:"combobox"},e("div",{class:"grid-input"},this.renderIconStart(),!o&&this.renderChips(),e("label",{class:"screen-readers-only",htmlFor:`${N}${t}`,id:`${G}${t}`},a),this.renderInput()),this.renderIconEnd()),e("ul",{"aria-labelledby":`${G}${t}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${K}${t}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),e(j,{component:this}))}get el(){return a(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],value:["valueHandler"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"]}}};q.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){font-size:var(--calcite-font-size--2);--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-input-height:1.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-input-height:2rem}:host([scale=l]){font-size:var(--calcite-font-size-0);--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-input-height:2.75rem}.wrapper{display:flex;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);outline-color:transparent;padding-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.wrapper--single{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l);cursor:pointer;flex-wrap:nowrap}.grid-input{display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px}.input{flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-style:none;background-color:transparent;padding:0px;font-family:inherit;color:var(--calcite-ui-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);min-inline-size:120px;-webkit-margin-after:var(--calcite-combobox-item-spacing-unit-s);margin-block-end:var(--calcite-combobox-item-spacing-unit-s)}.input:focus{outline:2px solid transparent;outline-offset:2px}.input--transparent{opacity:0}.input--single{margin-block:0px;padding:0px}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;inline-size:0px;min-inline-size:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.input-wrap{display:flex;flex-grow:1}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;display:flex;max-inline-size:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon-end,.icon-start{display:flex;inline-size:1rem;cursor:pointer;align-items:center}.icon-end{flex:none}.floating-ui-container{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}.floating-ui-container--active{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}@media (forced-colors: active){.wrapper,.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.list-container{max-block-size:45vh;overflow-y:auto;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.list{margin:0px;display:block;padding:0px}.list--hide{block-size:0px;overflow:hidden}.chip{margin-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);margin-inline:0 var(--calcite-combobox-item-spacing-unit-s);max-inline-size:100%}.chip--active{background-color:var(--calcite-ui-foreground-3)}.item{display:block}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
10
+ * v1.0.0-beta.97
11
+ */
12
+ const J="icon",Q=class{constructor(e){i(this,e),this.calciteComboboxItemChange=t(this,"calciteComboboxItemChange",6),this.disabled=!1,this.selected=!1,this.active=!1,this.guid=p(),this.scale="m",this.itemClickHandler=i=>{i.preventDefault(),this.disabled||(this.selected=!this.selected)}}selectedWatchHandler(){this.calciteComboboxItemChange.emit(this.el)}connectedCallback(){this.ancestors=w(this.el),this.scale=P(this.el,"scale",this.scale),O(this)}disconnectedCallback(){R(this)}componentDidRender(){A(this)}async toggleSelected(i){this.disabled||(this.selected="boolean"==typeof i?i:!this.selected)}renderIcon(i){const{icon:t,disabled:s,selected:a}=this,n=`${J}--indent`;return!i||t||s?e("calcite-icon",{class:{[J]:!t,"icon--custom":!!t,"icon--active":t&&a,[n]:!0},icon:t||(s?"circle-disallowed":i?"dot":"check"),scale:"s"}):e("span",{class:{[J]:!0,"icon--dot":!0,[n]:!0}})}renderChildren(){return F(this.el)?e("ul",{key:"default-slot-container"},e("slot",null)):null}render(){const i="single"===P(this.el,"selection-mode","multi"),t={label:!0,"label--selected":this.selected,"label--active":this.active,"label--single":i},a=k(this.el);return e(s,{"aria-hidden":"true"},e("div",{class:`container scale--${this.scale}`,style:{"--calcite-combobox-item-spacing-indent-multiplier":`${a}`}},e("li",{class:t,id:this.guid,onClick:this.itemClickHandler},this.renderIcon(i),e("span",{class:"title"},this.textLabel)),this.renderChildren()))}get el(){return a(this)}static get watchers(){return{selected:["selectedWatchHandler"]}}};Q.style='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.scale--s{font-size:var(--calcite-font-size--2);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-item-spacing-indent:0.5rem}.scale--m{font-size:var(--calcite-font-size--1);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-item-spacing-indent:0.75rem}.scale--l{font-size:var(--calcite-font-size-0);line-height:1.25rem;--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-item-spacing-indent:1rem}.container{--calcite-combobox-item-indent-value:calc(\n var(--calcite-combobox-item-spacing-indent) * var(--calcite-combobox-item-spacing-indent-multiplier)\n )}:host(:focus){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host,ul{margin:0px;display:flex;flex-direction:column;padding:0px}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent;padding-block:var(--calcite-combobox-item-spacing-unit-s);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host([disabled]) .label{cursor:default}.label--selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.label--active{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.label:hover,.label:active{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.title{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon{display:inline-flex;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-ui-border-1)}.icon--indent{-webkit-padding-start:var(--calcite-combobox-item-indent-value);padding-inline-start:var(--calcite-combobox-item-indent-value)}.icon--custom{-webkit-margin-before:-1px;margin-block-start:-1px;color:var(--calcite-ui-text-3)}.icon--active{color:var(--calcite-ui-text-1)}.icon--dot{display:flex;justify-content:flex-end;min-inline-size:var(--calcite-combobox-item-spacing-unit-l)}.icon--dot:before{text-align:start;content:"•"}.label--active .icon{opacity:1}.label--selected .icon{opacity:1;color:var(--calcite-ui-brand)}:host(:hover[disabled]) .icon{opacity:1}';const Z=class{constructor(e){i(this,e),this.layerSelectionChange=t(this,"layerSelectionChange",7),this.enabledLayerIds=[],this.mapView=void 0,this.selectedLayerIds=[],this.selectionMode="single",this.layerIds=[]}async watchStateHandler(i,t){i!==t&&(await this._setLayers(),"single"===this.selectionMode&&this.layerSelectionChange.emit([this.layerIds[0]]))}async componentWillLoad(){await this._setLayers(),"single"===this.selectionMode&&(this.layerIds.length>0||1===this.selectedLayerIds.length)&&this.layerSelectionChange.emit(1===this.selectedLayerIds.length?[this.selectedLayerIds[0]]:[this.layerIds[0]])}render(){return e(s,null,e("div",{class:"map-layer-picker-container"},e("div",{class:"map-layer-picker"},"multi"===this.selectionMode?this._getCombobox():this._getSelect())))}_getSelect(){return e("calcite-select",{label:"",onCalciteSelectChange:i=>this._layerSelectionChange(i),ref:i=>{this._layerElement=i}},this._addMapLayersOptions())}_getCombobox(){return e("calcite-combobox",{label:"",onCalciteComboboxChange:i=>this._layerSelectionChange(i),"selection-mode":this.selectionMode},this._addMapLayersOptions())}_addMapLayersOptions(){return this.layerIds.reduce(((i,t)=>(V.managedLayers.indexOf(V.layerNameHash[t])<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)&&i.push("multi"===this.selectionMode&&this.selectedLayerIds.indexOf(t)>-1?e("calcite-combobox-item",{selected:!0,textLabel:V.layerNameHash[t],value:t}):"multi"===this.selectionMode?e("calcite-combobox-item",{textLabel:V.layerNameHash[t],value:t}):this.selectedLayerIds.indexOf(t)>-1?e("calcite-option",{label:V.layerNameHash[t],selected:!0,value:t}):e("calcite-option",{label:V.layerNameHash[t],value:t})),i)),[])}async _setLayers(){if(this.mapView){const i=await W(this.mapView);this.layerIds=i.filter((i=>{var t;return!((null===(t=this.enabledLayerIds)||void 0===t?void 0:t.length)>0)||this.enabledLayerIds.indexOf(i)>-1})),await this._initLayerHashState()}}async _initLayerHashState(){this.mapView&&(V.layerNameHash=await U(this.mapView))}_layerSelectionChange(i){var t;this.selectedLayerIds="single"===this.selectionMode?[this._layerElement.value]:(null===(t=i.detail)||void 0===t?void 0:t.selectedItems.map((i=>i.value)))||[],this.layerSelectionChange.emit(this.selectedLayerIds)}get el(){return a(this)}static get watchers(){return{mapView:["watchStateHandler"]}}};Z.style=":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}";export{q as calcite_combobox,Q as calcite_combobox_item,Z as map_layer_picker}
@@ -18,4 +18,4 @@ import{c as a}from"./p-4307dacd.js";
18
18
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
- */const{state:e,onChange:s}=a({managedLayers:[],highlightHandle:void 0}),n=new CustomEvent("managedLayersChanged",{bubbles:!0,cancelable:!1,composed:!0});s("managedLayers",(()=>{dispatchEvent(n)}));export{e as s}
21
+ */const{state:e,onChange:s}=a({managedLayers:[],highlightHandle:void 0,layerNameHash:{}}),n=new CustomEvent("managedLayersChanged",{bubbles:!0,cancelable:!1,composed:!0});s("managedLayers",(()=>{dispatchEvent(n)}));export{e as s}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,h as e,H as i,g as a}from"./p-c023e6a1.js";import{g as l}from"./p-44da2507.js";import{a as s,b as r,q as o}from"./p-7dcab29d.js";import{e as c}from"./p-ad42039f.js";import"./p-3b010ce1.js";import"./p-be41429f.js";const n=class{constructor(e){t(this,e),this._graphics=[],this._fieldNames=[],this.mapView=void 0,this._translations=void 0,this._selectedIndexes=[]}async componentWillLoad(){await this._getTranslations()}render(){return e(i,null,this._getTableControlRow(),e("div",{class:"data-container"},e("div",{class:"table-container"},e("div",{class:"table"},this._getTableHeader(),this._getTableRows()))),e("edit-record-modal",{ref:t=>this._editMultipleMpdal=t}))}_getTableControlRow(){const t=this._selectedIndexes.length>0,i=this._selectedIndexes.length>1;return e("div",{class:"display-flex table-border"},e("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),e("div",null,e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!i,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),e("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},e("calcite-dropdown-group",{"selection-mode":"none"},e("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),e("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),e("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),e("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),e("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTableHeader(){return e("div",{class:"header"},e("div",{class:"table-header-cell padding-3-4"},e("calcite-checkbox",{class:"display-flex justify-center",onClick:()=>this._selectAll(this._selectAllElement.checked),ref:t=>this._selectAllElement=t})),this._fieldNames.map((t=>this._getTableHeaderCell(t))))}_getTableHeaderCell(t){return e("div",{class:"table-header-cell field-width"},t)}_getTableRows(){return e("div",{class:"table-body"},this._graphics.map(((t,e)=>this._getTableRow(t,e))))}_getTableRow(t,i){const a=this._selectedIndexes.indexOf(i)>-1;return e("div",{class:"row"},e("div",{class:"table-cell table-border padding-3-4"},e("calcite-checkbox",{checked:a,class:"display-flex justify-center",onClick:()=>this._rowSelected(i),value:i})),this._fieldNames.map((e=>{const i=this._layerView.layer.fieldsIndex.get(e);return this._getTableRowCell(t.attributes[e],i,a)})))}_getTableRowCell(t,i,a){const l=i.editable&&a,s=this._getInputType(i.type);let r;const o=i.domain;return o&&(r="coded-value"===o.type?e("calcite-select",{label:""},o.codedValues.map((i=>e("calcite-option",{label:i.name,selected:t===i.code.toString(),value:i.code})))):e("calcite-input",{max:o.maxValue,min:o.minValue,type:"number",value:t})),e("div",{class:"table-cell table-border field-width"},l&&r?r:l?e("calcite-input",{type:s,value:t}):t)}_getInputType(t){const e={string:"text","small-integer":"number",integer:"number",single:"number",double:"number",long:"number",date:"datetime-local",oid:"number",guid:"text","global-id":"text"};return Object.keys(e).indexOf(t)>-1?e[t]:"text"}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,e)=>e)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((e,i,a)=>(t.indexOf(a)<0&&e.push(a),e)),[])}_exportToCSV(){const t=this._getSelectedIds();c(this._layerView,t)}_zoom(){const t=this._getSelectedIds();s(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((e,i)=>t.indexOf(i)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const e=this._selectedIndexes.indexOf(t);e>-1?(this._selectedIndexes.splice(e,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const e=t.detail[0];this._layerView=await r(this.mapView,e),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await o(0,this._layerView.layer,[]),this._selectedIndexes=[]}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}};n.style=":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";export{n as layer_table}
6
+ import{r as t,h as e,H as i,g as a}from"./p-c023e6a1.js";import{g as l}from"./p-44da2507.js";import{g as s,a as r,q as o}from"./p-3fa9b3c8.js";import{e as c}from"./p-b668daf8.js";import"./p-3b010ce1.js";import"./p-be41429f.js";const n=class{constructor(e){t(this,e),this._graphics=[],this._fieldNames=[],this.mapView=void 0,this._translations=void 0,this._selectedIndexes=[]}async componentWillLoad(){await this._getTranslations()}render(){return e(i,null,this._getTableControlRow(),e("div",{class:"data-container"},e("div",{class:"table-container"},e("div",{class:"table"},this._getTableHeader(),this._getTableRows()))),e("edit-record-modal",{ref:t=>this._editMultipleMpdal=t}))}_getTableControlRow(){const t=this._selectedIndexes.length>0,i=this._selectedIndexes.length>1;return e("div",{class:"display-flex table-border"},e("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),e("div",null,e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!i,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),e("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},e("calcite-dropdown-group",{"selection-mode":"none"},e("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),e("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),e("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),e("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),e("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTableHeader(){return e("div",{class:"header"},e("div",{class:"table-header-cell padding-3-4"},e("calcite-checkbox",{class:"display-flex justify-center",onClick:()=>this._selectAll(this._selectAllElement.checked),ref:t=>this._selectAllElement=t})),this._fieldNames.map((t=>this._getTableHeaderCell(t))))}_getTableHeaderCell(t){return e("div",{class:"table-header-cell field-width"},t)}_getTableRows(){return e("div",{class:"table-body"},this._graphics.map(((t,e)=>this._getTableRow(t,e))))}_getTableRow(t,i){const a=this._selectedIndexes.indexOf(i)>-1;return e("div",{class:"row"},e("div",{class:"table-cell table-border padding-3-4"},e("calcite-checkbox",{checked:a,class:"display-flex justify-center",onClick:()=>this._rowSelected(i),value:i})),this._fieldNames.map((e=>{const i=this._layerView.layer.fieldsIndex.get(e);return this._getTableRowCell(t.attributes[e],i,a)})))}_getTableRowCell(t,i,a){const l=i.editable&&a,s=this._getInputType(i.type);let r;const o=i.domain;return o&&(r="coded-value"===o.type?e("calcite-select",{label:""},o.codedValues.map((i=>e("calcite-option",{label:i.name,selected:t===i.code.toString(),value:i.code})))):e("calcite-input",{max:o.maxValue,min:o.minValue,type:"number",value:t})),e("div",{class:"table-cell table-border field-width"},l&&r?r:l?e("calcite-input",{type:s,value:t}):t)}_getInputType(t){const e={string:"text","small-integer":"number",integer:"number",single:"number",double:"number",long:"number",date:"datetime-local",oid:"number",guid:"text","global-id":"text"};return Object.keys(e).indexOf(t)>-1?e[t]:"text"}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,e)=>e)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((e,i,a)=>(t.indexOf(a)<0&&e.push(a),e)),[])}_exportToCSV(){const t=this._getSelectedIds();c(this._layerView,t,!0)}_zoom(){const t=this._getSelectedIds();s(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((e,i)=>t.indexOf(i)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const e=this._selectedIndexes.indexOf(t);e>-1?(this._selectedIndexes.splice(e,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const e=t.detail[0];this._layerView=await r(this.mapView,e),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await o(0,this._layerView.layer,[]),this._selectedIndexes=[]}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}};n.style=":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";export{n as layer_table}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{c as t}from"./p-7dcab29d.js";
6
+ import{b as t}from"./p-3fa9b3c8.js";
7
7
  /** @license
8
8
  * Copyright 2022 Esri
9
9
  *
@@ -18,4 +18,4 @@ import{c as t}from"./p-7dcab29d.js";
18
18
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
- */async function c(c,e){const n=(await t(e,c.layer)).features.map((t=>t.attributes)),o={},s=n[0];Object.keys(s).forEach((t=>{s.hasOwnProperty(t)&&(o[t]=t)})),function(t,c,e){t&&c.unshift(t);const n=c.reduce(((t,c)=>t+Object.values(c).map((t=>`"${t}"`)).join(",")+"\r\n"),""),o=document.createElement("a");void 0!==o.download&&(o.href=URL.createObjectURL(new Blob([n],{type:"text/csv;charset=utf-8;"})),o.download=`${e}.csv`||"export.csv",o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o))}(o,n,`notify-${Date.now().toString()}`)}export{c as e}
21
+ */async function c(c,e,n){const o=(await t(e,c.layer)).features.map((t=>t.attributes)),s={},a=o[0];Object.keys(a).forEach((t=>{a.hasOwnProperty(t)&&(s[t]=t)})),function(t,c,e,n){n&&t&&c.unshift(t);const o=c.reduce(((t,c)=>t+Object.values(c).map((t=>`"${t}"`)).join(",")+"\r\n"),""),s=document.createElement("a");void 0!==s.download&&(s.href=URL.createObjectURL(new Blob([o],{type:"text/csv;charset=utf-8;"})),s.download=`${e}.csv`||"export.csv",s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s))}(s,o,`notify-${Date.now().toString()}`,n)}export{c as e}