@esri/solutions-components 0.6.37 → 0.6.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/dist/cjs/calcite-alert_3.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  4. package/dist/cjs/card-manager_3.cjs.entry.js +4 -3
  5. package/dist/cjs/{downloadUtils-37d9aaf3.js → downloadUtils-d8e48fbd.js} +55 -12
  6. package/dist/cjs/{index.es-d1d9b140.js → index.es-6159eedc.js} +4 -3
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -3
  9. package/dist/cjs/{mapViewUtils-96172223.js → mapViewUtils-f7bbc35b.js} +5 -2
  10. package/dist/cjs/public-notification.cjs.entry.js +5 -4
  11. package/dist/cjs/{clean-url-d5326abb.js → restHelpersGet-c94617cf.js} +398 -0
  12. package/dist/cjs/solution-configuration.cjs.entry.js +565 -565
  13. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  14. package/dist/cjs/{solution-store-714601a2.js → solution-store-b40c2f46.js} +19 -383
  15. package/dist/cjs/solutions-components.cjs.js +1 -1
  16. package/dist/collection/components/public-notification/public-notification.js +6 -5
  17. package/dist/collection/utils/downloadUtils.js +50 -8
  18. package/dist/collection/utils/downloadUtils.ts +62 -9
  19. package/dist/collection/utils/queryUtils.js +5 -2
  20. package/dist/collection/utils/queryUtils.ts +4 -2
  21. package/dist/components/downloadUtils.js +51 -8
  22. package/dist/components/public-notification.js +2 -2
  23. package/dist/components/queryUtils.js +5 -2
  24. package/dist/components/{clean-url.js → restHelpersGet.js} +392 -1
  25. package/dist/components/solution-configuration.js +552 -552
  26. package/dist/components/solution-store.js +2 -365
  27. package/dist/esm/calcite-alert_3.entry.js +1 -1
  28. package/dist/esm/calcite-combobox_6.entry.js +1 -1
  29. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  30. package/dist/esm/card-manager_3.entry.js +4 -3
  31. package/dist/esm/{downloadUtils-76379e4a.js → downloadUtils-d41ecba9.js} +53 -10
  32. package/dist/esm/{index.es-0d134a52.js → index.es-b226bf47.js} +4 -3
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/esm/map-select-tools_3.entry.js +4 -3
  35. package/dist/esm/{mapViewUtils-08f6cfce.js → mapViewUtils-1e2befd7.js} +5 -2
  36. package/dist/esm/public-notification.entry.js +5 -4
  37. package/dist/esm/{clean-url-bce022e6.js → restHelpersGet-a5ec2192.js} +392 -1
  38. package/dist/esm/solution-configuration.entry.js +552 -552
  39. package/dist/esm/solution-contents_3.entry.js +2 -2
  40. package/dist/esm/{solution-store-3ee6c7a3.js → solution-store-17bb0a75.js} +2 -365
  41. package/dist/esm/solutions-components.js +1 -1
  42. package/dist/solutions-components/{p-9800e602.entry.js → p-091120c5.entry.js} +1 -1
  43. package/dist/solutions-components/p-1b14b687.entry.js +6 -0
  44. package/dist/solutions-components/p-20e627ed.entry.js +6 -0
  45. package/dist/solutions-components/{p-646e983f.entry.js → p-2d143359.entry.js} +1 -1
  46. package/dist/solutions-components/{p-ac7332b3.entry.js → p-40e95e2b.entry.js} +1 -1
  47. package/dist/solutions-components/p-420e1585.entry.js +36 -0
  48. package/dist/solutions-components/p-4807b2a1.js +36 -0
  49. package/dist/solutions-components/p-56a3b81e.entry.js +6 -0
  50. package/dist/solutions-components/p-5856dc4f.js +66 -0
  51. package/dist/solutions-components/p-89b4b401.js +145 -0
  52. package/dist/solutions-components/{p-4ecad91c.entry.js → p-973625f8.entry.js} +1 -1
  53. package/dist/solutions-components/{p-03130804.js → p-9ecb5d66.js} +1 -1
  54. package/dist/solutions-components/{p-b02eb8f4.js → p-a8661f1f.js} +30 -30
  55. package/dist/solutions-components/solutions-components.esm.js +1 -1
  56. package/dist/solutions-components/utils/downloadUtils.ts +62 -9
  57. package/dist/solutions-components/utils/queryUtils.ts +4 -2
  58. package/dist/types/components/public-notification/public-notification.d.ts +1 -1
  59. package/dist/types/components.d.ts +2 -2
  60. package/package.json +1 -1
  61. package/dist/esm/polyfills/core-js.js +0 -11
  62. package/dist/esm/polyfills/dom.js +0 -79
  63. package/dist/esm/polyfills/es5-html-element.js +0 -1
  64. package/dist/esm/polyfills/index.js +0 -34
  65. package/dist/esm/polyfills/system.js +0 -6
  66. package/dist/solutions-components/p-13b21d19.entry.js +0 -36
  67. package/dist/solutions-components/p-15070568.js +0 -36
  68. package/dist/solutions-components/p-81a0c88f.entry.js +0 -6
  69. package/dist/solutions-components/p-b7804687.entry.js +0 -6
  70. package/dist/solutions-components/p-d0544f24.js +0 -192
  71. package/dist/solutions-components/p-eba875d9.entry.js +0 -6
  72. package/dist/solutions-components/p-ecc95259.js +0 -20
@@ -23,7 +23,7 @@ import { exportCSV } from "./csvUtils";
23
23
  import { exportPDF } from "./pdfUtils";
24
24
  import { loadModules } from "./loadModules";
25
25
  import { queryFeaturesByID } from "./queryUtils";
26
- //import * as common from "@esri/solution-common";
26
+ import * as common from "@esri/solution-common";
27
27
  export { ILabel } from "./pdfUtils";
28
28
  const lineSeparatorChar = "|";
29
29
  import { queryRelated } from "@esri/arcgis-rest-feature-layer";
@@ -427,13 +427,55 @@ export async function _getLabelFormat(webmap, layer, formatUsingLayerPopup) {
427
427
  const labelFormatType = (_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type;
428
428
  if (labelFormatType === "relationship") {
429
429
  const relationshipId = layer.popupTemplate.content[0].relationshipId;
430
- const webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray())
431
- .filter((entry) => entry.type === "feature"
432
- && entry.id !== layer.id
433
- && entry.relationships
434
- && entry.relationships.some(relationship => relationship.id === relationshipId));
435
- labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
436
- labelFormatProps.relationshipId = relationshipId;
430
+ // Get related layer
431
+ let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
432
+ webmapLayers = webmapLayers.filter((webmapLayer) => webmapLayer.type === "feature"
433
+ && webmapLayer.id !== layer.id
434
+ && webmapLayer.relationships
435
+ && webmapLayer.relationships.some(relationship => relationship.id === relationshipId));
436
+ if (webmapLayers.length > 0) {
437
+ labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
438
+ labelFormatProps.relationshipId = relationshipId;
439
+ }
440
+ else {
441
+ // Related layer info is not in webmap; get the label info from the related layer
442
+ webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
443
+ // Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
444
+ // match the one we entered this function with and who have a URL that we can query
445
+ const relationshipCandidatePromises = [];
446
+ webmapLayers = webmapLayers.filter((webmapLayer) => {
447
+ if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
448
+ // Query the feature layer/table for properties missing from the webmap version
449
+ const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
450
+ relationshipCandidatePromises.push(common.getJson(webmapLayerUrl /*, authentication*/));
451
+ return true;
452
+ }
453
+ else {
454
+ return false;
455
+ }
456
+ });
457
+ // Of the queried feature layers/tables, find the one with the matching relationship id
458
+ const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
459
+ let labelFormatPropsPromise;
460
+ if (!relationshipCandidates.some((candidateLayer, i) => {
461
+ if (candidateLayer.relationships
462
+ && candidateLayer.relationships.some(relationship => relationship.id === relationshipId)) {
463
+ // Found the matching relationship; get the label format from it
464
+ labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
465
+ return true;
466
+ }
467
+ else {
468
+ return false;
469
+ }
470
+ })) {
471
+ // Fallback to all fields
472
+ labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
473
+ }
474
+ else {
475
+ labelFormatProps = await labelFormatPropsPromise;
476
+ labelFormatProps.relationshipId = relationshipId;
477
+ }
478
+ }
437
479
  }
438
480
  else if (labelFormatType === "fields") {
439
481
  labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
@@ -21,7 +21,7 @@ import { ILabel, exportPDF } from "./pdfUtils";
21
21
  import { loadModules } from "./loadModules";
22
22
  import { queryFeaturesByID } from "./queryUtils";
23
23
  import { IExportInfo, IExportInfos } from "../utils/interfaces";
24
- //import * as common from "@esri/solution-common";
24
+ import * as common from "@esri/solution-common";
25
25
 
26
26
  export { ILabel } from "./pdfUtils";
27
27
 
@@ -584,15 +584,68 @@ export async function _getLabelFormat(
584
584
  if (labelFormatType === "relationship") {
585
585
  const relationshipId = layer.popupTemplate.content[0].relationshipId;
586
586
 
587
- const webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray())
588
- .filter((entry: __esri.FeatureLayer) =>
589
- entry.type === "feature"
590
- && entry.id !== layer.id
591
- && entry.relationships
592
- && entry.relationships.some(relationship => relationship.id === relationshipId));
587
+ // Get related layer
588
+ let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray()) as __esri.FeatureLayer[];
589
+ webmapLayers = webmapLayers.filter(
590
+ (webmapLayer: __esri.FeatureLayer) =>
591
+ webmapLayer.type === "feature"
592
+ && webmapLayer.id !== layer.id
593
+ && webmapLayer.relationships
594
+ && webmapLayer.relationships.some(relationship => relationship.id === relationshipId)
595
+ );
593
596
 
594
- labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0] as __esri.FeatureLayer, formatUsingLayerPopup);
595
- labelFormatProps.relationshipId = relationshipId;
597
+ if (webmapLayers.length > 0) {
598
+ labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
599
+ labelFormatProps.relationshipId = relationshipId;
600
+
601
+ } else {
602
+ // Related layer info is not in webmap; get the label info from the related layer
603
+ webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray()) as __esri.FeatureLayer[];
604
+
605
+ // Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
606
+ // match the one we entered this function with and who have a URL that we can query
607
+ const relationshipCandidatePromises: Promise<any>[] = [];
608
+ webmapLayers = webmapLayers.filter(
609
+ (webmapLayer: __esri.FeatureLayer) => {
610
+ if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
611
+ // Query the feature layer/table for properties missing from the webmap version
612
+ const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
613
+ relationshipCandidatePromises.push(
614
+ common.getJson(webmapLayerUrl/*, authentication*/)
615
+ );
616
+ return true;
617
+ } else {
618
+ return false;
619
+ }
620
+ }
621
+ )
622
+
623
+ // Of the queried feature layers/tables, find the one with the matching relationship id
624
+ const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
625
+ let labelFormatPropsPromise: Promise<ILabelFormatProps>;
626
+ if (
627
+ !relationshipCandidates.some(
628
+ (candidateLayer: any, i: number) => {
629
+ if (
630
+ candidateLayer.relationships
631
+ && candidateLayer.relationships.some(relationship => relationship.id === relationshipId)
632
+ ) {
633
+ // Found the matching relationship; get the label format from it
634
+ labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
635
+ return true;
636
+ } else {
637
+ return false;
638
+ }
639
+ }
640
+ )
641
+ ) {
642
+ // Fallback to all fields
643
+ labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
644
+ } else {
645
+ labelFormatProps = await labelFormatPropsPromise;
646
+ labelFormatProps.relationshipId = relationshipId;
647
+ }
648
+ }
596
649
 
597
650
  } else if (labelFormatType === "fields") {
598
651
  labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
@@ -103,13 +103,16 @@ export async function queryObjectIds(geometries, layer) {
103
103
  * @returns Promise with the featureSet from the layer that match the provided ids
104
104
  */
105
105
  export async function queryFeaturesByID(ids, layer, graphics, returnGeometry, outSpatialReference) {
106
- const num = layer.capabilities.query.maxRecordCount;
106
+ var _a;
107
+ const num = (_a = layer.capabilities) === null || _a === void 0 ? void 0 : _a.query.maxRecordCount;
107
108
  const start = 0;
108
109
  const q = layer.createQuery();
109
110
  q.start = start;
110
- q.num = num;
111
111
  q.returnGeometry = returnGeometry;
112
112
  q.objectIds = ids.slice(start, num);
113
+ if (num) {
114
+ q.num = num;
115
+ }
113
116
  if (outSpatialReference) {
114
117
  q.outSpatialReference = outSpatialReference;
115
118
  }
@@ -128,14 +128,16 @@ export async function queryFeaturesByID(
128
128
  returnGeometry: boolean,
129
129
  outSpatialReference?: __esri.SpatialReference
130
130
  ): Promise<__esri.Graphic[]> {
131
- const num = layer.capabilities.query.maxRecordCount;
131
+ const num = layer.capabilities?.query.maxRecordCount;
132
132
  const start = 0;
133
133
 
134
134
  const q = layer.createQuery();
135
135
  q.start = start;
136
- q.num = num;
137
136
  q.returnGeometry = returnGeometry;
138
137
  q.objectIds = ids.slice(start, num);
138
+ if (num) {
139
+ q.num = num;
140
+ }
139
141
  if (outSpatialReference) {
140
142
  q.outSpatialReference = outSpatialReference;
141
143
  }
@@ -7,7 +7,8 @@ import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_comm
7
7
  import { getAssetPath } from '@stencil/core/internal/client';
8
8
  import { l as loadModules } from './loadModules.js';
9
9
  import { q as queryFeaturesByID } from './queryUtils.js';
10
- import { _ as __assign$1, r as request, c as cleanUrl } from './clean-url.js';
10
+ import './solution-resource.js';
11
+ import { _ as __assign$1, r as request, c as cleanUrl, g as getJson } from './restHelpersGet.js';
11
12
 
12
13
  /** @license
13
14
  * Copyright 2022 Esri
@@ -2742,13 +2743,55 @@ async function _getLabelFormat(webmap, layer, formatUsingLayerPopup) {
2742
2743
  const labelFormatType = (_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type;
2743
2744
  if (labelFormatType === "relationship") {
2744
2745
  const relationshipId = layer.popupTemplate.content[0].relationshipId;
2745
- const webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray())
2746
- .filter((entry) => entry.type === "feature"
2747
- && entry.id !== layer.id
2748
- && entry.relationships
2749
- && entry.relationships.some(relationship => relationship.id === relationshipId));
2750
- labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
2751
- labelFormatProps.relationshipId = relationshipId;
2746
+ // Get related layer
2747
+ let webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
2748
+ webmapLayers = webmapLayers.filter((webmapLayer) => webmapLayer.type === "feature"
2749
+ && webmapLayer.id !== layer.id
2750
+ && webmapLayer.relationships
2751
+ && webmapLayer.relationships.some(relationship => relationship.id === relationshipId));
2752
+ if (webmapLayers.length > 0) {
2753
+ labelFormatProps = await _getLabelFormat(webmap, webmapLayers[0], formatUsingLayerPopup);
2754
+ labelFormatProps.relationshipId = relationshipId;
2755
+ }
2756
+ else {
2757
+ // Related layer info is not in webmap; get the label info from the related layer
2758
+ webmapLayers = webmap.layers.toArray().concat(webmap.tables.toArray());
2759
+ // Keep only feature layers and tables that have the type "feature" and whose layerId doesn't
2760
+ // match the one we entered this function with and who have a URL that we can query
2761
+ const relationshipCandidatePromises = [];
2762
+ webmapLayers = webmapLayers.filter((webmapLayer) => {
2763
+ if (webmapLayer.type === "feature" && webmapLayer.layerId != layer.layerId && webmapLayer.url) {
2764
+ // Query the feature layer/table for properties missing from the webmap version
2765
+ const webmapLayerUrl = webmapLayer.url + "/" + webmapLayer.layerId.toString();
2766
+ relationshipCandidatePromises.push(getJson(webmapLayerUrl /*, authentication*/));
2767
+ return true;
2768
+ }
2769
+ else {
2770
+ return false;
2771
+ }
2772
+ });
2773
+ // Of the queried feature layers/tables, find the one with the matching relationship id
2774
+ const relationshipCandidates = await Promise.all(relationshipCandidatePromises);
2775
+ let labelFormatPropsPromise;
2776
+ if (!relationshipCandidates.some((candidateLayer, i) => {
2777
+ if (candidateLayer.relationships
2778
+ && candidateLayer.relationships.some(relationship => relationship.id === relationshipId)) {
2779
+ // Found the matching relationship; get the label format from it
2780
+ labelFormatPropsPromise = _getLabelFormat(webmap, webmapLayers[i], formatUsingLayerPopup);
2781
+ return true;
2782
+ }
2783
+ else {
2784
+ return false;
2785
+ }
2786
+ })) {
2787
+ // Fallback to all fields
2788
+ labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
2789
+ }
2790
+ else {
2791
+ labelFormatProps = await labelFormatPropsPromise;
2792
+ labelFormatProps.relationshipId = relationshipId;
2793
+ }
2794
+ }
2752
2795
  }
2753
2796
  else if (labelFormatType === "fields") {
2754
2797
  labelFormatProps.labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
@@ -80,7 +80,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
80
80
  this.defaultBufferDistance = undefined;
81
81
  this.defaultBufferUnit = undefined;
82
82
  this.defaultExportTitle = "";
83
- this.defaultNumLabelsPerPage = undefined;
83
+ this.defaultNumLabelsPerPage = 6;
84
84
  this.featureEffect = undefined;
85
85
  this.featureHighlightEnabled = undefined;
86
86
  this.mapView = undefined;
@@ -901,7 +901,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class PublicNotifi
901
901
  "defaultBufferDistance": [2, "default-buffer-distance"],
902
902
  "defaultBufferUnit": [1, "default-buffer-unit"],
903
903
  "defaultExportTitle": [1, "default-export-title"],
904
- "defaultNumLabelsPerPage": [8, "default-num-labels-per-page"],
904
+ "defaultNumLabelsPerPage": [2, "default-num-labels-per-page"],
905
905
  "featureEffect": [16],
906
906
  "featureHighlightEnabled": [4, "feature-highlight-enabled"],
907
907
  "mapView": [16],
@@ -60,13 +60,16 @@ async function queryObjectIds(geometries, layer) {
60
60
  * @returns Promise with the featureSet from the layer that match the provided ids
61
61
  */
62
62
  async function queryFeaturesByID(ids, layer, graphics, returnGeometry, outSpatialReference) {
63
- const num = layer.capabilities.query.maxRecordCount;
63
+ var _a;
64
+ const num = (_a = layer.capabilities) === null || _a === void 0 ? void 0 : _a.query.maxRecordCount;
64
65
  const start = 0;
65
66
  const q = layer.createQuery();
66
67
  q.start = start;
67
- q.num = num;
68
68
  q.returnGeometry = returnGeometry;
69
69
  q.objectIds = ids.slice(start, num);
70
+ if (num) {
71
+ q.num = num;
72
+ }
70
73
  if (outSpatialReference) {
71
74
  q.outSpatialReference = outSpatialReference;
72
75
  }