@esri/solutions-components 0.5.7 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/dist/assets/t9n/buffer-tools/resources_ar.json +4 -4
  2. package/dist/assets/t9n/buffer-tools/resources_bg.json +4 -4
  3. package/dist/assets/t9n/buffer-tools/resources_bs.json +4 -4
  4. package/dist/assets/t9n/buffer-tools/resources_ca.json +4 -4
  5. package/dist/assets/t9n/buffer-tools/resources_cs.json +4 -4
  6. package/dist/assets/t9n/buffer-tools/resources_da.json +4 -4
  7. package/dist/assets/t9n/buffer-tools/resources_de.json +4 -4
  8. package/dist/assets/t9n/buffer-tools/resources_el.json +4 -4
  9. package/dist/assets/t9n/buffer-tools/resources_es.json +4 -4
  10. package/dist/assets/t9n/buffer-tools/resources_et.json +4 -4
  11. package/dist/assets/t9n/buffer-tools/resources_fi.json +4 -4
  12. package/dist/assets/t9n/buffer-tools/resources_fr.json +4 -4
  13. package/dist/assets/t9n/buffer-tools/resources_he.json +4 -4
  14. package/dist/assets/t9n/buffer-tools/resources_hr.json +4 -4
  15. package/dist/assets/t9n/buffer-tools/resources_hu.json +4 -4
  16. package/dist/assets/t9n/buffer-tools/resources_id.json +4 -4
  17. package/dist/assets/t9n/buffer-tools/resources_it.json +4 -4
  18. package/dist/assets/t9n/buffer-tools/resources_ja.json +4 -4
  19. package/dist/assets/t9n/buffer-tools/resources_ko.json +4 -4
  20. package/dist/assets/t9n/buffer-tools/resources_lt.json +4 -4
  21. package/dist/assets/t9n/buffer-tools/resources_lv.json +4 -4
  22. package/dist/assets/t9n/buffer-tools/resources_nb.json +4 -4
  23. package/dist/assets/t9n/buffer-tools/resources_nl.json +4 -4
  24. package/dist/assets/t9n/buffer-tools/resources_pl.json +4 -4
  25. package/dist/assets/t9n/buffer-tools/resources_pt-BR.json +4 -4
  26. package/dist/assets/t9n/buffer-tools/resources_pt-PT.json +4 -4
  27. package/dist/assets/t9n/buffer-tools/resources_ro.json +4 -4
  28. package/dist/assets/t9n/buffer-tools/resources_ru.json +4 -4
  29. package/dist/assets/t9n/buffer-tools/resources_sk.json +4 -4
  30. package/dist/assets/t9n/buffer-tools/resources_sl.json +4 -4
  31. package/dist/assets/t9n/buffer-tools/resources_sr.json +4 -4
  32. package/dist/assets/t9n/buffer-tools/resources_sv.json +4 -4
  33. package/dist/assets/t9n/buffer-tools/resources_th.json +4 -4
  34. package/dist/assets/t9n/buffer-tools/resources_tr.json +4 -4
  35. package/dist/assets/t9n/buffer-tools/resources_uk.json +4 -4
  36. package/dist/assets/t9n/buffer-tools/resources_vi.json +4 -4
  37. package/dist/assets/t9n/buffer-tools/resources_zh-CN.json +4 -4
  38. package/dist/assets/t9n/buffer-tools/resources_zh-HK.json +4 -4
  39. package/dist/assets/t9n/buffer-tools/resources_zh-TW.json +4 -4
  40. package/dist/assets/t9n/map-draw-tools/resources_ar.json +3 -3
  41. package/dist/assets/t9n/map-draw-tools/resources_bg.json +3 -3
  42. package/dist/assets/t9n/map-draw-tools/resources_bs.json +3 -3
  43. package/dist/assets/t9n/map-draw-tools/resources_ca.json +3 -3
  44. package/dist/assets/t9n/map-draw-tools/resources_cs.json +3 -3
  45. package/dist/assets/t9n/map-draw-tools/resources_da.json +3 -3
  46. package/dist/assets/t9n/map-draw-tools/resources_de.json +3 -3
  47. package/dist/assets/t9n/map-draw-tools/resources_el.json +3 -3
  48. package/dist/assets/t9n/map-draw-tools/resources_es.json +3 -3
  49. package/dist/assets/t9n/map-draw-tools/resources_et.json +3 -3
  50. package/dist/assets/t9n/map-draw-tools/resources_fi.json +3 -3
  51. package/dist/assets/t9n/map-draw-tools/resources_fr.json +3 -3
  52. package/dist/assets/t9n/map-draw-tools/resources_he.json +3 -3
  53. package/dist/assets/t9n/map-draw-tools/resources_hr.json +3 -3
  54. package/dist/assets/t9n/map-draw-tools/resources_hu.json +3 -3
  55. package/dist/assets/t9n/map-draw-tools/resources_id.json +3 -3
  56. package/dist/assets/t9n/map-draw-tools/resources_it.json +3 -3
  57. package/dist/assets/t9n/map-draw-tools/resources_ja.json +3 -3
  58. package/dist/assets/t9n/map-draw-tools/resources_ko.json +3 -3
  59. package/dist/assets/t9n/map-draw-tools/resources_lt.json +3 -3
  60. package/dist/assets/t9n/map-draw-tools/resources_lv.json +3 -3
  61. package/dist/assets/t9n/map-draw-tools/resources_nb.json +3 -3
  62. package/dist/assets/t9n/map-draw-tools/resources_nl.json +3 -3
  63. package/dist/assets/t9n/map-draw-tools/resources_pl.json +3 -3
  64. package/dist/assets/t9n/map-draw-tools/resources_pt-BR.json +3 -3
  65. package/dist/assets/t9n/map-draw-tools/resources_pt-PT.json +3 -3
  66. package/dist/assets/t9n/map-draw-tools/resources_ro.json +3 -3
  67. package/dist/assets/t9n/map-draw-tools/resources_ru.json +3 -3
  68. package/dist/assets/t9n/map-draw-tools/resources_sk.json +3 -3
  69. package/dist/assets/t9n/map-draw-tools/resources_sl.json +3 -3
  70. package/dist/assets/t9n/map-draw-tools/resources_sr.json +3 -3
  71. package/dist/assets/t9n/map-draw-tools/resources_sv.json +3 -3
  72. package/dist/assets/t9n/map-draw-tools/resources_th.json +3 -3
  73. package/dist/assets/t9n/map-draw-tools/resources_tr.json +3 -3
  74. package/dist/assets/t9n/map-draw-tools/resources_uk.json +3 -3
  75. package/dist/assets/t9n/map-draw-tools/resources_vi.json +3 -3
  76. package/dist/assets/t9n/map-draw-tools/resources_zh-CN.json +3 -3
  77. package/dist/assets/t9n/map-draw-tools/resources_zh-HK.json +3 -3
  78. package/dist/assets/t9n/map-draw-tools/resources_zh-TW.json +3 -3
  79. package/dist/assets/t9n/map-select-tools/resources_ar.json +13 -11
  80. package/dist/assets/t9n/map-select-tools/resources_bg.json +13 -11
  81. package/dist/assets/t9n/map-select-tools/resources_bs.json +13 -11
  82. package/dist/assets/t9n/map-select-tools/resources_ca.json +13 -11
  83. package/dist/assets/t9n/map-select-tools/resources_cs.json +13 -11
  84. package/dist/assets/t9n/map-select-tools/resources_da.json +13 -11
  85. package/dist/assets/t9n/map-select-tools/resources_de.json +13 -11
  86. package/dist/assets/t9n/map-select-tools/resources_el.json +13 -11
  87. package/dist/assets/t9n/map-select-tools/resources_es.json +13 -11
  88. package/dist/assets/t9n/map-select-tools/resources_et.json +13 -11
  89. package/dist/assets/t9n/map-select-tools/resources_fi.json +13 -11
  90. package/dist/assets/t9n/map-select-tools/resources_fr.json +13 -11
  91. package/dist/assets/t9n/map-select-tools/resources_he.json +13 -11
  92. package/dist/assets/t9n/map-select-tools/resources_hr.json +13 -11
  93. package/dist/assets/t9n/map-select-tools/resources_hu.json +13 -11
  94. package/dist/assets/t9n/map-select-tools/resources_id.json +13 -11
  95. package/dist/assets/t9n/map-select-tools/resources_it.json +13 -11
  96. package/dist/assets/t9n/map-select-tools/resources_ja.json +13 -11
  97. package/dist/assets/t9n/map-select-tools/resources_ko.json +13 -11
  98. package/dist/assets/t9n/map-select-tools/resources_lt.json +13 -11
  99. package/dist/assets/t9n/map-select-tools/resources_lv.json +13 -11
  100. package/dist/assets/t9n/map-select-tools/resources_nb.json +13 -11
  101. package/dist/assets/t9n/map-select-tools/resources_nl.json +13 -11
  102. package/dist/assets/t9n/map-select-tools/resources_pl.json +13 -11
  103. package/dist/assets/t9n/map-select-tools/resources_pt-BR.json +13 -11
  104. package/dist/assets/t9n/map-select-tools/resources_pt-PT.json +13 -11
  105. package/dist/assets/t9n/map-select-tools/resources_ro.json +13 -11
  106. package/dist/assets/t9n/map-select-tools/resources_ru.json +13 -11
  107. package/dist/assets/t9n/map-select-tools/resources_sk.json +13 -11
  108. package/dist/assets/t9n/map-select-tools/resources_sl.json +13 -11
  109. package/dist/assets/t9n/map-select-tools/resources_sr.json +13 -11
  110. package/dist/assets/t9n/map-select-tools/resources_sv.json +13 -11
  111. package/dist/assets/t9n/map-select-tools/resources_th.json +13 -11
  112. package/dist/assets/t9n/map-select-tools/resources_tr.json +13 -11
  113. package/dist/assets/t9n/map-select-tools/resources_uk.json +13 -11
  114. package/dist/assets/t9n/map-select-tools/resources_vi.json +13 -11
  115. package/dist/assets/t9n/map-select-tools/resources_zh-CN.json +13 -11
  116. package/dist/assets/t9n/map-select-tools/resources_zh-HK.json +13 -11
  117. package/dist/assets/t9n/map-select-tools/resources_zh-TW.json +13 -11
  118. package/dist/assets/t9n/pdf-download/resources_ar.json +1 -1
  119. package/dist/assets/t9n/pdf-download/resources_bg.json +1 -1
  120. package/dist/assets/t9n/pdf-download/resources_bs.json +1 -1
  121. package/dist/assets/t9n/pdf-download/resources_ca.json +1 -1
  122. package/dist/assets/t9n/pdf-download/resources_cs.json +1 -1
  123. package/dist/assets/t9n/pdf-download/resources_da.json +1 -1
  124. package/dist/assets/t9n/pdf-download/resources_de.json +1 -1
  125. package/dist/assets/t9n/pdf-download/resources_el.json +1 -1
  126. package/dist/assets/t9n/pdf-download/resources_es.json +1 -1
  127. package/dist/assets/t9n/pdf-download/resources_et.json +1 -1
  128. package/dist/assets/t9n/pdf-download/resources_fi.json +1 -1
  129. package/dist/assets/t9n/pdf-download/resources_fr.json +1 -1
  130. package/dist/assets/t9n/pdf-download/resources_he.json +1 -1
  131. package/dist/assets/t9n/pdf-download/resources_hr.json +1 -1
  132. package/dist/assets/t9n/pdf-download/resources_hu.json +1 -1
  133. package/dist/assets/t9n/pdf-download/resources_id.json +1 -1
  134. package/dist/assets/t9n/pdf-download/resources_it.json +1 -1
  135. package/dist/assets/t9n/pdf-download/resources_ja.json +1 -1
  136. package/dist/assets/t9n/pdf-download/resources_ko.json +1 -1
  137. package/dist/assets/t9n/pdf-download/resources_lt.json +1 -1
  138. package/dist/assets/t9n/pdf-download/resources_lv.json +1 -1
  139. package/dist/assets/t9n/pdf-download/resources_nb.json +1 -1
  140. package/dist/assets/t9n/pdf-download/resources_nl.json +1 -1
  141. package/dist/assets/t9n/pdf-download/resources_pl.json +1 -1
  142. package/dist/assets/t9n/pdf-download/resources_pt-BR.json +1 -1
  143. package/dist/assets/t9n/pdf-download/resources_pt-PT.json +1 -1
  144. package/dist/assets/t9n/pdf-download/resources_ro.json +1 -1
  145. package/dist/assets/t9n/pdf-download/resources_ru.json +1 -1
  146. package/dist/assets/t9n/pdf-download/resources_sk.json +1 -1
  147. package/dist/assets/t9n/pdf-download/resources_sl.json +1 -1
  148. package/dist/assets/t9n/pdf-download/resources_sr.json +1 -1
  149. package/dist/assets/t9n/pdf-download/resources_sv.json +1 -1
  150. package/dist/assets/t9n/pdf-download/resources_th.json +1 -1
  151. package/dist/assets/t9n/pdf-download/resources_tr.json +1 -1
  152. package/dist/assets/t9n/pdf-download/resources_uk.json +1 -1
  153. package/dist/assets/t9n/pdf-download/resources_vi.json +1 -1
  154. package/dist/assets/t9n/pdf-download/resources_zh-CN.json +1 -1
  155. package/dist/assets/t9n/pdf-download/resources_zh-HK.json +1 -1
  156. package/dist/assets/t9n/pdf-download/resources_zh-TW.json +1 -1
  157. package/dist/assets/t9n/public-notification/resources.json +11 -9
  158. package/dist/assets/t9n/public-notification/resources_ar.json +39 -38
  159. package/dist/assets/t9n/public-notification/resources_bg.json +39 -38
  160. package/dist/assets/t9n/public-notification/resources_bs.json +39 -38
  161. package/dist/assets/t9n/public-notification/resources_ca.json +39 -38
  162. package/dist/assets/t9n/public-notification/resources_cs.json +39 -38
  163. package/dist/assets/t9n/public-notification/resources_da.json +39 -38
  164. package/dist/assets/t9n/public-notification/resources_de.json +39 -38
  165. package/dist/assets/t9n/public-notification/resources_el.json +39 -38
  166. package/dist/assets/t9n/public-notification/resources_en.json +11 -9
  167. package/dist/assets/t9n/public-notification/resources_es.json +39 -38
  168. package/dist/assets/t9n/public-notification/resources_et.json +39 -38
  169. package/dist/assets/t9n/public-notification/resources_fi.json +39 -38
  170. package/dist/assets/t9n/public-notification/resources_fr.json +39 -38
  171. package/dist/assets/t9n/public-notification/resources_he.json +39 -38
  172. package/dist/assets/t9n/public-notification/resources_hr.json +39 -38
  173. package/dist/assets/t9n/public-notification/resources_hu.json +39 -38
  174. package/dist/assets/t9n/public-notification/resources_id.json +39 -38
  175. package/dist/assets/t9n/public-notification/resources_it.json +39 -38
  176. package/dist/assets/t9n/public-notification/resources_ja.json +39 -38
  177. package/dist/assets/t9n/public-notification/resources_ko.json +39 -38
  178. package/dist/assets/t9n/public-notification/resources_lt.json +39 -38
  179. package/dist/assets/t9n/public-notification/resources_lv.json +39 -38
  180. package/dist/assets/t9n/public-notification/resources_nb.json +39 -38
  181. package/dist/assets/t9n/public-notification/resources_nl.json +39 -38
  182. package/dist/assets/t9n/public-notification/resources_pl.json +39 -38
  183. package/dist/assets/t9n/public-notification/resources_pt-BR.json +39 -38
  184. package/dist/assets/t9n/public-notification/resources_pt-PT.json +39 -38
  185. package/dist/assets/t9n/public-notification/resources_ro.json +39 -38
  186. package/dist/assets/t9n/public-notification/resources_ru.json +39 -38
  187. package/dist/assets/t9n/public-notification/resources_sk.json +39 -38
  188. package/dist/assets/t9n/public-notification/resources_sl.json +39 -38
  189. package/dist/assets/t9n/public-notification/resources_sr.json +39 -38
  190. package/dist/assets/t9n/public-notification/resources_sv.json +39 -38
  191. package/dist/assets/t9n/public-notification/resources_th.json +39 -38
  192. package/dist/assets/t9n/public-notification/resources_tr.json +39 -38
  193. package/dist/assets/t9n/public-notification/resources_uk.json +39 -38
  194. package/dist/assets/t9n/public-notification/resources_vi.json +39 -38
  195. package/dist/assets/t9n/public-notification/resources_zh-CN.json +39 -38
  196. package/dist/assets/t9n/public-notification/resources_zh-HK.json +39 -38
  197. package/dist/assets/t9n/public-notification/resources_zh-TW.json +39 -38
  198. package/dist/assets/t9n/refine-selection/resources.json +3 -1
  199. package/dist/assets/t9n/refine-selection/resources_en.json +3 -1
  200. package/dist/cjs/calcite-input-text_5.cjs.entry.js +3 -3
  201. package/dist/cjs/{downloadUtils-06876768.js → downloadUtils-4ef4b28b.js} +87 -21
  202. package/dist/cjs/{index.es-d07646b4.js → index.es-cbe67d5b.js} +1 -1
  203. package/dist/cjs/layer-table_2.cjs.entry.js +1 -1
  204. package/dist/cjs/loader.cjs.js +1 -1
  205. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  206. package/dist/cjs/solutions-components.cjs.js +1 -1
  207. package/dist/collection/components/public-notification/public-notification.js +2 -2
  208. package/dist/collection/components/refine-selection/refine-selection.css +106 -85
  209. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  210. package/dist/collection/utils/downloadUtils.js +86 -20
  211. package/dist/collection/utils/downloadUtils.ts +139 -27
  212. package/dist/components/downloadUtils.js +86 -20
  213. package/dist/components/public-notification.js +2 -2
  214. package/dist/components/refine-selection2.js +36 -24
  215. package/dist/esm/calcite-input-text_5.entry.js +3 -3
  216. package/dist/esm/{downloadUtils-046ce0aa.js → downloadUtils-2ebeb46d.js} +87 -21
  217. package/dist/esm/{index.es-3fd0e8f6.js → index.es-6dd27a48.js} +1 -1
  218. package/dist/esm/layer-table_2.entry.js +1 -1
  219. package/dist/esm/loader.js +1 -1
  220. package/dist/esm/public-notification.entry.js +2 -2
  221. package/dist/esm/solutions-components.js +1 -1
  222. package/dist/solutions-components/{p-2e0db581.js → p-657caece.js} +11 -11
  223. package/dist/solutions-components/{p-1b08d9d6.entry.js → p-6f27bea2.entry.js} +2 -2
  224. package/dist/solutions-components/{p-99aec087.js → p-ad82c173.js} +1 -1
  225. package/dist/solutions-components/p-db82a9ce.entry.js +6 -0
  226. package/dist/solutions-components/{p-1850a763.entry.js → p-deb90ce7.entry.js} +1 -1
  227. package/dist/solutions-components/solutions-components.esm.js +1 -1
  228. package/dist/solutions-components/utils/downloadUtils.ts +139 -27
  229. package/dist/types/utils/downloadUtils.d.ts +21 -0
  230. package/package.json +1 -1
  231. package/dist/solutions-components/p-f66a7ea7.entry.js +0 -6
@@ -196,6 +196,38 @@ export function _createFilename(selectionSetNames) {
196
196
  const title = selectionSetNames.length > 0 ? selectionSetNames.join(", ") : "download";
197
197
  return title;
198
198
  }
199
+ /**
200
+ * Creates relationship queries for each relationship flag in a popup.
201
+ * @param layer Layer whose popup is to be examined
202
+ * @return Hash of relationships by their id, or null if there are no relationship flags in the
203
+ * popup; each relationship has the properties layer and relatedQuery for the related layer
204
+ * and the query for that layer
205
+ */
206
+ export function _createRelationshipQueries(layer) {
207
+ const relationships = {};
208
+ const relationshipFieldPattern = /\{relationships\/\d+\//gm;
209
+ const relationshipIdPattern = /\d+/;
210
+ // Test if this popup has any relationship references
211
+ const matches = layer.popupTemplate.content[0].text.match(relationshipFieldPattern);
212
+ if (matches) {
213
+ matches.forEach(match => {
214
+ // Add a query to a found relationship if we don't already have one
215
+ const id = match.match(relationshipIdPattern)[0];
216
+ if (!relationships.hasOwnProperty(id)) {
217
+ const relatedQuery = {
218
+ outFields: ['*'],
219
+ relationshipId: id,
220
+ returnGeometry: false
221
+ };
222
+ relationships[id] = {
223
+ layer,
224
+ relatedQuery
225
+ };
226
+ }
227
+ });
228
+ }
229
+ return relationships;
230
+ }
199
231
  /**
200
232
  * Prepares an attribute's value by applying domain and type information.
201
233
  *
@@ -256,7 +288,7 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
256
288
  * @returns Promise resolving when function is done
257
289
  */
258
290
  async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLayerPopup = true, includeHeaderNames = false) {
259
- var _a, _b, _c, _d;
291
+ var _a, _b, _c, _d, _e, _f;
260
292
  const [intl] = await loadModules(["esri/intl"]);
261
293
  // Get the features to export
262
294
  const featureSet = await queryFeaturesByID(ids, layer);
@@ -270,6 +302,7 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
270
302
  const attributeFormats = {};
271
303
  // Get the label formatting, if any
272
304
  let labelFormat;
305
+ let relationshipQueries = {};
273
306
  let arcadeExecutors = {};
274
307
  if (layer.popupEnabled) {
275
308
  layer.popupTemplate.fieldInfos.forEach(
@@ -298,6 +331,8 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
298
331
  }
299
332
  else if (formatUsingLayerPopup && ((_d = (_c = layer.popupTemplate) === null || _c === void 0 ? void 0 : _c.content[0]) === null || _d === void 0 ? void 0 : _d.type) === "text") {
300
333
  labelFormat = _convertPopupTextToLabelSpec(layer.popupTemplate.content[0].text);
334
+ // Do we need any relationship queries?
335
+ relationshipQueries = _createRelationshipQueries(layer);
301
336
  // Do we need any Arcade executors?
302
337
  arcadeExecutors = await _createArcadeExecutors(labelFormat, layer);
303
338
  }
@@ -309,33 +344,64 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
309
344
  const arcadeExpressionRegExp = /\{expression\/\w+\}/g;
310
345
  const attributeRegExp = /\{\w+\}/g;
311
346
  // Find the label fields that we need to replace with values
312
- const arcadeExpressionMatches = labelFormat.match(arcadeExpressionRegExp);
313
- const attributeMatches = labelFormat.match(attributeRegExp);
347
+ const arcadeExpressionMatches = (_e = labelFormat.match(arcadeExpressionRegExp)) !== null && _e !== void 0 ? _e : [];
348
+ const attributeMatches = (_f = labelFormat.match(attributeRegExp)) !== null && _f !== void 0 ? _f : [];
314
349
  // Convert feature attributes into an array of labels
315
- labels = featureSet.features.map(feature => {
350
+ const relationshipKeys = Object.keys(relationshipQueries);
351
+ labels = await Promise.all(featureSet.features.map(async (feature) => {
316
352
  let labelPrep = labelFormat;
317
- // Replace Arcade expressions
318
- if (arcadeExpressionMatches) {
319
- arcadeExpressionMatches.forEach((match) => {
320
- const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
321
- const value = arcadeExecutors[expressionName].execute({ "$feature": feature });
322
- labelPrep = labelPrep.replace(match, value);
323
- });
324
- }
325
- // Replace non-Arcade fields
326
- if (attributeMatches) {
327
- attributeMatches.forEach((match) => {
328
- const attributeName = match.substring(1, match.length - 1);
329
- const value = _prepareAttributeValue(feature.attributes[attributeName], attributeTypes[attributeName], attributeDomains[attributeName], attributeFormats[attributeName], intl);
330
- labelPrep = labelPrep.replace(match, value);
353
+ // Replace Arcade expressions in this feature
354
+ arcadeExpressionMatches.forEach((match) => {
355
+ const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
356
+ const value = arcadeExecutors[expressionName].execute({ "$feature": feature });
357
+ labelPrep = labelPrep.replace(match, value);
358
+ });
359
+ // Replace relationship expressions in this feature
360
+ const relatedFeatureQueries = [];
361
+ const relationshipIds = [];
362
+ relationshipKeys.forEach((relationshipId) => {
363
+ const relationship = relationshipQueries[relationshipId];
364
+ const objectId = feature.attributes[relationship.layer.objectIdField];
365
+ const relatedQuery = Object.assign(Object.assign({}, relationship.relatedQuery), { objectIds: [objectId] });
366
+ relatedFeatureQueries.push(relationship.layer.queryRelatedFeatures(relatedQuery));
367
+ relationshipIds.push(relationshipId);
368
+ });
369
+ // Wait for all of the queries for related records for this label
370
+ const relatedFeatureQueryResults = await Promise.all(relatedFeatureQueries);
371
+ relatedFeatureQueryResults.forEach((relatedFeatureQueryResult, i) => {
372
+ // We have an object with FeatureSets grouped by source layer or table objectIds
373
+ const relationshipId = relationshipIds[i];
374
+ // Run through the source layer or table objectIds
375
+ Object.keys(relatedFeatureQueryResult).forEach(relatedFeatureSetId => {
376
+ // We have a feature set
377
+ const relatedFeatures = relatedFeatureQueryResult[relatedFeatureSetId].features;
378
+ // Get the values from each feature and replace them in the label
379
+ relatedFeatures.forEach(feature => {
380
+ // Merge the base and related feature attributes and create the label
381
+ // Prefix related feature's attributes with "relationships/<id>/" to match popup
382
+ const rePrefix = "\{relationships/" + relationshipId + "/";
383
+ const reSuffix = "\}";
384
+ const attributes = feature.attributes;
385
+ Object.keys(attributes).forEach(attributeName => {
386
+ // Replace the value using the attribute name as a relationship
387
+ const attributeRelationshipRegExp = new RegExp(rePrefix + attributeName + reSuffix, "g");
388
+ labelPrep = labelPrep.replaceAll(attributeRelationshipRegExp, attributes[attributeName]);
389
+ });
390
+ });
331
391
  });
332
- }
392
+ });
393
+ // Replace non-Arcade fields in this feature
394
+ attributeMatches.forEach((match) => {
395
+ const attributeName = match.substring(1, match.length - 1);
396
+ const value = _prepareAttributeValue(feature.attributes[attributeName], attributeTypes[attributeName], attributeDomains[attributeName], attributeFormats[attributeName], intl);
397
+ labelPrep = labelPrep.replace(match, value);
398
+ });
333
399
  // Split label into lines
334
400
  let label = labelPrep.split(lineSeparatorChar);
335
401
  // Trim lines
336
402
  label = label.map(line => line.trim());
337
403
  return label;
338
- });
404
+ }));
339
405
  }
340
406
  else {
341
407
  // Export all attributes
@@ -43,6 +43,25 @@ interface IAttributeTypes {
43
43
  [attributeName: string]: string;
44
44
  }
45
45
 
46
+ interface ILayerRelationshipQuery {
47
+ layer: __esri.FeatureLayer;
48
+ relatedQuery: IRelatedFeaturesQuery;
49
+ }
50
+
51
+ interface ILayerRelationshipQueryHash {
52
+ [relationshipId: string]: ILayerRelationshipQuery;
53
+ }
54
+
55
+ // Class RelationshipQuery doesn't appear to work, and so since
56
+ // https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryRelatedFeatures
57
+ // says that the relationshipQuery argument is autocast, we'll set up a variant for the class
58
+ interface IRelatedFeaturesQuery {
59
+ outFields: string[];
60
+ relationshipId: string;
61
+ returnGeometry: boolean;
62
+ objectIds?: number;
63
+ }
64
+
46
65
  const lineSeparatorChar = "|";
47
66
 
48
67
  //#endregion
@@ -278,6 +297,44 @@ export function _createFilename(
278
297
  return title;
279
298
  }
280
299
 
300
+ /**
301
+ * Creates relationship queries for each relationship flag in a popup.
302
+ * @param layer Layer whose popup is to be examined
303
+ * @return Hash of relationships by their id, or null if there are no relationship flags in the
304
+ * popup; each relationship has the properties layer and relatedQuery for the related layer
305
+ * and the query for that layer
306
+ */
307
+ export function _createRelationshipQueries(
308
+ layer: __esri.FeatureLayer,
309
+ ): ILayerRelationshipQueryHash {
310
+
311
+ const relationships: ILayerRelationshipQueryHash = {};
312
+ const relationshipFieldPattern = /\{relationships\/\d+\//gm;
313
+ const relationshipIdPattern = /\d+/;
314
+
315
+ // Test if this popup has any relationship references
316
+ const matches = layer.popupTemplate.content[0].text.match(relationshipFieldPattern);
317
+ if (matches) {
318
+ matches.forEach(match => {
319
+ // Add a query to a found relationship if we don't already have one
320
+ const id = match.match(relationshipIdPattern)[0];
321
+ if (!relationships.hasOwnProperty(id)) {
322
+ const relatedQuery: IRelatedFeaturesQuery = {
323
+ outFields: ['*'],
324
+ relationshipId: id,
325
+ returnGeometry: false
326
+ };
327
+ relationships[id] = {
328
+ layer,
329
+ relatedQuery
330
+ } as ILayerRelationshipQuery;
331
+ }
332
+ });
333
+ }
334
+
335
+ return relationships;
336
+ }
337
+
281
338
  /**
282
339
  * Prepares an attribute's value by applying domain and type information.
283
340
  *
@@ -369,6 +426,7 @@ async function _prepareLabels(
369
426
 
370
427
  // Get the label formatting, if any
371
428
  let labelFormat: string;
429
+ let relationshipQueries: ILayerRelationshipQueryHash = {};
372
430
  let arcadeExecutors: IArcadeExecutors = {};
373
431
  if (layer.popupEnabled) {
374
432
  layer.popupTemplate.fieldInfos.forEach(
@@ -401,6 +459,9 @@ async function _prepareLabels(
401
459
  } else if (formatUsingLayerPopup && layer.popupTemplate?.content[0]?.type === "text") {
402
460
  labelFormat = _convertPopupTextToLabelSpec(layer.popupTemplate.content[0].text);
403
461
 
462
+ // Do we need any relationship queries?
463
+ relationshipQueries = _createRelationshipQueries(layer);
464
+
404
465
  // Do we need any Arcade executors?
405
466
  arcadeExecutors = await _createArcadeExecutors(labelFormat, layer);
406
467
  }
@@ -414,37 +475,88 @@ async function _prepareLabels(
414
475
  const attributeRegExp = /\{\w+\}/g;
415
476
 
416
477
  // Find the label fields that we need to replace with values
417
- const arcadeExpressionMatches = labelFormat.match(arcadeExpressionRegExp);
418
- const attributeMatches = labelFormat.match(attributeRegExp);
478
+ const arcadeExpressionMatches = labelFormat.match(arcadeExpressionRegExp) ?? [];
479
+ const attributeMatches = labelFormat.match(attributeRegExp) ?? [];
419
480
 
420
481
  // Convert feature attributes into an array of labels
421
- labels = featureSet.features.map(
422
- feature => {
482
+ const relationshipKeys = Object.keys(relationshipQueries);
483
+ labels = await Promise.all(featureSet.features.map(
484
+ async feature => {
423
485
  let labelPrep = labelFormat;
424
486
 
425
- // Replace Arcade expressions
426
- if (arcadeExpressionMatches) {
427
- arcadeExpressionMatches.forEach(
428
- (match: string) => {
429
- const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
430
- const value = arcadeExecutors[expressionName].execute({"$feature": feature});
431
- labelPrep = labelPrep.replace(match, value);
432
- }
433
- )
434
- }
487
+ // Replace Arcade expressions in this feature
488
+ arcadeExpressionMatches.forEach(
489
+ (match: string) => {
490
+ const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
491
+ const value = arcadeExecutors[expressionName].execute({"$feature": feature});
492
+ labelPrep = labelPrep.replace(match, value);
493
+ }
494
+ )
495
+
496
+ // Replace relationship expressions in this feature
497
+ const relatedFeatureQueries = [] as Promise<__esri.FeatureSet>[];
498
+ const relationshipIds = [] as string[];
499
+ relationshipKeys.forEach(
500
+ (relationshipId) => {
501
+ const relationship = relationshipQueries[relationshipId];
502
+ const objectId = feature.attributes[relationship.layer.objectIdField];
503
+ const relatedQuery = {
504
+ ...relationship.relatedQuery,
505
+ objectIds: [objectId]
506
+ };
507
+ relatedFeatureQueries.push(relationship.layer.queryRelatedFeatures(relatedQuery as any));
508
+ relationshipIds.push(relationshipId);
509
+ }
510
+ );
435
511
 
436
- // Replace non-Arcade fields
437
- if (attributeMatches) {
438
- attributeMatches.forEach(
439
- (match: string) => {
440
- const attributeName = match.substring(1, match.length - 1);
441
- const value = _prepareAttributeValue(feature.attributes[attributeName],
442
- attributeTypes[attributeName], attributeDomains[attributeName],
443
- attributeFormats[attributeName], intl);
444
- labelPrep = labelPrep.replace(match, value);
445
- }
446
- )
447
- }
512
+ // Wait for all of the queries for related records for this label
513
+ const relatedFeatureQueryResults = await Promise.all(relatedFeatureQueries);
514
+ relatedFeatureQueryResults.forEach(
515
+ (relatedFeatureQueryResult, i) => {
516
+ // We have an object with FeatureSets grouped by source layer or table objectIds
517
+ const relationshipId = relationshipIds[i];
518
+
519
+ // Run through the source layer or table objectIds
520
+ Object.keys(relatedFeatureQueryResult).forEach(
521
+ relatedFeatureSetId => {
522
+ // We have a feature set
523
+ const relatedFeatures = relatedFeatureQueryResult[relatedFeatureSetId].features;
524
+
525
+ // Get the values from each feature and replace them in the label
526
+ relatedFeatures.forEach(
527
+ feature => {
528
+ // Merge the base and related feature attributes and create the label
529
+ // Prefix related feature's attributes with "relationships/<id>/" to match popup
530
+ const rePrefix = "\{relationships/" + relationshipId + "/";
531
+ const reSuffix = "\}";
532
+
533
+ const attributes = feature.attributes;
534
+ Object.keys(attributes).forEach(
535
+ attributeName => {
536
+ // Replace the value using the attribute name as a relationship
537
+ const attributeRelationshipRegExp = new RegExp(rePrefix + attributeName + reSuffix, "g");
538
+ labelPrep = labelPrep.replaceAll(attributeRelationshipRegExp, attributes[attributeName]);
539
+ }
540
+ );
541
+ }
542
+ );
543
+ }
544
+ );
545
+ }
546
+ );
547
+
548
+ // Replace non-Arcade fields in this feature
549
+ attributeMatches.forEach(
550
+ (match: string) => {
551
+ const attributeName = match.substring(1, match.length - 1);
552
+
553
+ const value = _prepareAttributeValue(feature.attributes[attributeName],
554
+ attributeTypes[attributeName], attributeDomains[attributeName],
555
+ attributeFormats[attributeName], intl);
556
+ labelPrep = labelPrep.replace(match, value);
557
+
558
+ }
559
+ )
448
560
 
449
561
  // Split label into lines
450
562
  let label = labelPrep.split(lineSeparatorChar);
@@ -454,7 +566,7 @@ async function _prepareLabels(
454
566
 
455
567
  return label;
456
568
  }
457
- );
569
+ ));
458
570
 
459
571
  } else {
460
572
  // Export all attributes
@@ -2425,6 +2425,38 @@ function _createFilename(selectionSetNames) {
2425
2425
  const title = selectionSetNames.length > 0 ? selectionSetNames.join(", ") : "download";
2426
2426
  return title;
2427
2427
  }
2428
+ /**
2429
+ * Creates relationship queries for each relationship flag in a popup.
2430
+ * @param layer Layer whose popup is to be examined
2431
+ * @return Hash of relationships by their id, or null if there are no relationship flags in the
2432
+ * popup; each relationship has the properties layer and relatedQuery for the related layer
2433
+ * and the query for that layer
2434
+ */
2435
+ function _createRelationshipQueries(layer) {
2436
+ const relationships = {};
2437
+ const relationshipFieldPattern = /\{relationships\/\d+\//gm;
2438
+ const relationshipIdPattern = /\d+/;
2439
+ // Test if this popup has any relationship references
2440
+ const matches = layer.popupTemplate.content[0].text.match(relationshipFieldPattern);
2441
+ if (matches) {
2442
+ matches.forEach(match => {
2443
+ // Add a query to a found relationship if we don't already have one
2444
+ const id = match.match(relationshipIdPattern)[0];
2445
+ if (!relationships.hasOwnProperty(id)) {
2446
+ const relatedQuery = {
2447
+ outFields: ['*'],
2448
+ relationshipId: id,
2449
+ returnGeometry: false
2450
+ };
2451
+ relationships[id] = {
2452
+ layer,
2453
+ relatedQuery
2454
+ };
2455
+ }
2456
+ });
2457
+ }
2458
+ return relationships;
2459
+ }
2428
2460
  /**
2429
2461
  * Prepares an attribute's value by applying domain and type information.
2430
2462
  *
@@ -2485,7 +2517,7 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
2485
2517
  * @returns Promise resolving when function is done
2486
2518
  */
2487
2519
  async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLayerPopup = true, includeHeaderNames = false) {
2488
- var _a, _b, _c, _d;
2520
+ var _a, _b, _c, _d, _e, _f;
2489
2521
  const [intl] = await loadModules(["esri/intl"]);
2490
2522
  // Get the features to export
2491
2523
  const featureSet = await queryFeaturesByID(ids, layer);
@@ -2499,6 +2531,7 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
2499
2531
  const attributeFormats = {};
2500
2532
  // Get the label formatting, if any
2501
2533
  let labelFormat;
2534
+ let relationshipQueries = {};
2502
2535
  let arcadeExecutors = {};
2503
2536
  if (layer.popupEnabled) {
2504
2537
  layer.popupTemplate.fieldInfos.forEach(
@@ -2527,6 +2560,8 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
2527
2560
  }
2528
2561
  else if (formatUsingLayerPopup && ((_d = (_c = layer.popupTemplate) === null || _c === void 0 ? void 0 : _c.content[0]) === null || _d === void 0 ? void 0 : _d.type) === "text") {
2529
2562
  labelFormat = _convertPopupTextToLabelSpec(layer.popupTemplate.content[0].text);
2563
+ // Do we need any relationship queries?
2564
+ relationshipQueries = _createRelationshipQueries(layer);
2530
2565
  // Do we need any Arcade executors?
2531
2566
  arcadeExecutors = await _createArcadeExecutors(labelFormat, layer);
2532
2567
  }
@@ -2538,33 +2573,64 @@ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLa
2538
2573
  const arcadeExpressionRegExp = /\{expression\/\w+\}/g;
2539
2574
  const attributeRegExp = /\{\w+\}/g;
2540
2575
  // Find the label fields that we need to replace with values
2541
- const arcadeExpressionMatches = labelFormat.match(arcadeExpressionRegExp);
2542
- const attributeMatches = labelFormat.match(attributeRegExp);
2576
+ const arcadeExpressionMatches = (_e = labelFormat.match(arcadeExpressionRegExp)) !== null && _e !== void 0 ? _e : [];
2577
+ const attributeMatches = (_f = labelFormat.match(attributeRegExp)) !== null && _f !== void 0 ? _f : [];
2543
2578
  // Convert feature attributes into an array of labels
2544
- labels = featureSet.features.map(feature => {
2579
+ const relationshipKeys = Object.keys(relationshipQueries);
2580
+ labels = await Promise.all(featureSet.features.map(async (feature) => {
2545
2581
  let labelPrep = labelFormat;
2546
- // Replace Arcade expressions
2547
- if (arcadeExpressionMatches) {
2548
- arcadeExpressionMatches.forEach((match) => {
2549
- const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
2550
- const value = arcadeExecutors[expressionName].execute({ "$feature": feature });
2551
- labelPrep = labelPrep.replace(match, value);
2552
- });
2553
- }
2554
- // Replace non-Arcade fields
2555
- if (attributeMatches) {
2556
- attributeMatches.forEach((match) => {
2557
- const attributeName = match.substring(1, match.length - 1);
2558
- const value = _prepareAttributeValue(feature.attributes[attributeName], attributeTypes[attributeName], attributeDomains[attributeName], attributeFormats[attributeName], intl);
2559
- labelPrep = labelPrep.replace(match, value);
2582
+ // Replace Arcade expressions in this feature
2583
+ arcadeExpressionMatches.forEach((match) => {
2584
+ const expressionName = match.substring(match.indexOf("/") + 1, match.length - 1);
2585
+ const value = arcadeExecutors[expressionName].execute({ "$feature": feature });
2586
+ labelPrep = labelPrep.replace(match, value);
2587
+ });
2588
+ // Replace relationship expressions in this feature
2589
+ const relatedFeatureQueries = [];
2590
+ const relationshipIds = [];
2591
+ relationshipKeys.forEach((relationshipId) => {
2592
+ const relationship = relationshipQueries[relationshipId];
2593
+ const objectId = feature.attributes[relationship.layer.objectIdField];
2594
+ const relatedQuery = Object.assign(Object.assign({}, relationship.relatedQuery), { objectIds: [objectId] });
2595
+ relatedFeatureQueries.push(relationship.layer.queryRelatedFeatures(relatedQuery));
2596
+ relationshipIds.push(relationshipId);
2597
+ });
2598
+ // Wait for all of the queries for related records for this label
2599
+ const relatedFeatureQueryResults = await Promise.all(relatedFeatureQueries);
2600
+ relatedFeatureQueryResults.forEach((relatedFeatureQueryResult, i) => {
2601
+ // We have an object with FeatureSets grouped by source layer or table objectIds
2602
+ const relationshipId = relationshipIds[i];
2603
+ // Run through the source layer or table objectIds
2604
+ Object.keys(relatedFeatureQueryResult).forEach(relatedFeatureSetId => {
2605
+ // We have a feature set
2606
+ const relatedFeatures = relatedFeatureQueryResult[relatedFeatureSetId].features;
2607
+ // Get the values from each feature and replace them in the label
2608
+ relatedFeatures.forEach(feature => {
2609
+ // Merge the base and related feature attributes and create the label
2610
+ // Prefix related feature's attributes with "relationships/<id>/" to match popup
2611
+ const rePrefix = "\{relationships/" + relationshipId + "/";
2612
+ const reSuffix = "\}";
2613
+ const attributes = feature.attributes;
2614
+ Object.keys(attributes).forEach(attributeName => {
2615
+ // Replace the value using the attribute name as a relationship
2616
+ const attributeRelationshipRegExp = new RegExp(rePrefix + attributeName + reSuffix, "g");
2617
+ labelPrep = labelPrep.replaceAll(attributeRelationshipRegExp, attributes[attributeName]);
2618
+ });
2619
+ });
2560
2620
  });
2561
- }
2621
+ });
2622
+ // Replace non-Arcade fields in this feature
2623
+ attributeMatches.forEach((match) => {
2624
+ const attributeName = match.substring(1, match.length - 1);
2625
+ const value = _prepareAttributeValue(feature.attributes[attributeName], attributeTypes[attributeName], attributeDomains[attributeName], attributeFormats[attributeName], intl);
2626
+ labelPrep = labelPrep.replace(match, value);
2627
+ });
2562
2628
  // Split label into lines
2563
2629
  let label = labelPrep.split(lineSeparatorChar);
2564
2630
  // Trim lines
2565
2631
  label = label.map(line => line.trim());
2566
2632
  return label;
2567
- });
2633
+ }));
2568
2634
  }
2569
2635
  else {
2570
2636
  // Export all attributes
@@ -430,7 +430,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
430
430
  */
431
431
  _getSelectPage() {
432
432
  const noticeText = this._translations.selectSearchTip;
433
- return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull, true), this._getNotice(noticeText), h("div", { class: "padding-top-1" }, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", customLabelEnabled: this.customLabelEnabled, defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.selectionLayerIds, isUpdate: !!this._activeSelection, mapView: this.mapView, noResultText: this.noResultText, onSelectionSetChange: (evt) => this._updateForSelection(evt), ref: (el) => { this._selectTools = el; }, searchConfiguration: this._searchConfiguration, selectionSet: this._activeSelection, sketchLineSymbol: this.sketchLineSymbol, sketchPointSymbol: this.sketchPointSymbol, sketchPolygonSymbol: this.sketchPolygonSymbol })), this._getPageNavButtons(this._translations.done, this._numSelected === 0, () => { void this._saveSelection(); }, this._translations.cancel, false, () => { void this._home(); })));
433
+ return (h("calcite-panel", null, this._getLabel(this._translations.stepTwoFull, true), this._getNotice(noticeText), h("div", null, h("map-select-tools", { bufferColor: this.bufferColor, bufferOutlineColor: this.bufferOutlineColor, class: "font-bold", customLabelEnabled: this.customLabelEnabled, defaultBufferDistance: this.defaultBufferDistance, defaultBufferUnit: this.defaultBufferUnit, enabledLayerIds: this.selectionLayerIds, isUpdate: !!this._activeSelection, mapView: this.mapView, noResultText: this.noResultText, onSelectionSetChange: (evt) => this._updateForSelection(evt), ref: (el) => { this._selectTools = el; }, searchConfiguration: this._searchConfiguration, selectionSet: this._activeSelection, sketchLineSymbol: this.sketchLineSymbol, sketchPointSymbol: this.sketchPointSymbol, sketchPolygonSymbol: this.sketchPolygonSymbol })), this._getPageNavButtons(this._translations.done, this._numSelected === 0, () => { void this._saveSelection(); }, this._translations.cancel, false, () => { void this._home(); })));
434
434
  }
435
435
  /**
436
436
  * Create the main download page that has the shared aspects of both PDF and CSV
@@ -442,7 +442,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
442
442
  _getExportPage() {
443
443
  const hasSelections = this._hasSelections(this.showRefineSelection);
444
444
  const numDuplicates = this._getNumDuplicates(this._getSelectedIds());
445
- return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.myLists), this._getExportSelectionLists(), h("div", { class: "padding-sides-1" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}", numDuplicates.toString())}`))))), h("div", { class: "border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-segmented-control", { class: "w-100", onCalciteSegmentedControlChange: (evt) => this._exportTypeChange(evt) }, h("calcite-segmented-control-item", { checked: this._exportType === EExportType.PDF, class: "w-50 end-border", value: EExportType.PDF }, this._translations.pdf), h("calcite-segmented-control-item", { checked: this._exportType === EExportType.CSV, class: "w-50", value: EExportType.CSV }, this._translations.csv))), h("div", { class: "padding-bottom-1" }, this._getExportOptions()), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: () => void this._export(), width: "full" }, this._translations.export)))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
445
+ return (h("calcite-panel", null, h("div", null, this._getLabel(this._translations.export, false), hasSelections ? (h("div", null, this._getNotice(this._translations.exportTip, "padding-sides-1"), this._getLabel(this._translations.exportListsLabel), this._getExportSelectionLists(), h("div", { class: "padding-sides-1" }, h("div", { class: "display-flex" }, h("calcite-label", { layout: "inline" }, h("calcite-checkbox", { ref: (el) => { this._removeDuplicates = el; } }), h("div", { class: "display-flex" }, this._translations.removeDuplicate, h("div", { class: "info-message padding-start-1-2" }, h("calcite-input-message", { class: "info-blue margin-top-0", scale: "m" }, ` ${this._translations.numDuplicates.replace("{{n}}", numDuplicates.toString())}`)))), h("calcite-icon", { class: "padding-start-1-2 icon", icon: "question", id: "remove-duplicates-icon", scale: "s" })), h("calcite-popover", { closable: true, label: "", referenceElement: "remove-duplicates-icon" }, h("span", { class: "tooltip-message" }, this._translations.duplicatesTip))), h("div", { class: "border-bottom" }), h("div", { class: "padding-top-sides-1" }, h("calcite-segmented-control", { class: "w-100", onCalciteSegmentedControlChange: (evt) => this._exportTypeChange(evt) }, h("calcite-segmented-control-item", { checked: this._exportType === EExportType.PDF, class: "w-50 end-border", value: EExportType.PDF }, this._translations.pdf), h("calcite-segmented-control-item", { checked: this._exportType === EExportType.CSV, class: "w-50", value: EExportType.CSV }, this._translations.csv))), h("div", { class: "padding-bottom-1" }, this._getExportOptions()), h("div", { class: "padding-1 display-flex" }, h("calcite-button", { disabled: !this._downloadActive, onClick: () => void this._export(), width: "full" }, this._translations.export)))) : (this._getNotice(this._translations.downloadNoLists, "padding-sides-1 padding-bottom-1")))));
446
446
  }
447
447
  /**
448
448
  * Store the user selected export type CSV || PDF