@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.
- package/dist/cjs/calcite-alert_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/card-manager_3.cjs.entry.js +4 -3
- package/dist/cjs/{downloadUtils-37d9aaf3.js → downloadUtils-d8e48fbd.js} +55 -12
- package/dist/cjs/{index.es-d1d9b140.js → index.es-6159eedc.js} +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -3
- package/dist/cjs/{mapViewUtils-96172223.js → mapViewUtils-f7bbc35b.js} +5 -2
- package/dist/cjs/public-notification.cjs.entry.js +5 -4
- package/dist/cjs/{clean-url-d5326abb.js → restHelpersGet-c94617cf.js} +398 -0
- package/dist/cjs/solution-configuration.cjs.entry.js +565 -565
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-714601a2.js → solution-store-b40c2f46.js} +19 -383
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +6 -5
- package/dist/collection/utils/downloadUtils.js +50 -8
- package/dist/collection/utils/downloadUtils.ts +62 -9
- package/dist/collection/utils/queryUtils.js +5 -2
- package/dist/collection/utils/queryUtils.ts +4 -2
- package/dist/components/downloadUtils.js +51 -8
- package/dist/components/public-notification.js +2 -2
- package/dist/components/queryUtils.js +5 -2
- package/dist/components/{clean-url.js → restHelpersGet.js} +392 -1
- package/dist/components/solution-configuration.js +552 -552
- package/dist/components/solution-store.js +2 -365
- package/dist/esm/calcite-alert_3.entry.js +1 -1
- package/dist/esm/calcite-combobox_6.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/card-manager_3.entry.js +4 -3
- package/dist/esm/{downloadUtils-76379e4a.js → downloadUtils-d41ecba9.js} +53 -10
- package/dist/esm/{index.es-0d134a52.js → index.es-b226bf47.js} +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +4 -3
- package/dist/esm/{mapViewUtils-08f6cfce.js → mapViewUtils-1e2befd7.js} +5 -2
- package/dist/esm/public-notification.entry.js +5 -4
- package/dist/esm/{clean-url-bce022e6.js → restHelpersGet-a5ec2192.js} +392 -1
- package/dist/esm/solution-configuration.entry.js +552 -552
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-3ee6c7a3.js → solution-store-17bb0a75.js} +2 -365
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-9800e602.entry.js → p-091120c5.entry.js} +1 -1
- package/dist/solutions-components/p-1b14b687.entry.js +6 -0
- package/dist/solutions-components/p-20e627ed.entry.js +6 -0
- package/dist/solutions-components/{p-646e983f.entry.js → p-2d143359.entry.js} +1 -1
- package/dist/solutions-components/{p-ac7332b3.entry.js → p-40e95e2b.entry.js} +1 -1
- package/dist/solutions-components/p-420e1585.entry.js +36 -0
- package/dist/solutions-components/p-4807b2a1.js +36 -0
- package/dist/solutions-components/p-56a3b81e.entry.js +6 -0
- package/dist/solutions-components/p-5856dc4f.js +66 -0
- package/dist/solutions-components/p-89b4b401.js +145 -0
- package/dist/solutions-components/{p-4ecad91c.entry.js → p-973625f8.entry.js} +1 -1
- package/dist/solutions-components/{p-03130804.js → p-9ecb5d66.js} +1 -1
- package/dist/solutions-components/{p-b02eb8f4.js → p-a8661f1f.js} +30 -30
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +62 -9
- package/dist/solutions-components/utils/queryUtils.ts +4 -2
- package/dist/types/components/public-notification/public-notification.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/solutions-components/p-13b21d19.entry.js +0 -36
- package/dist/solutions-components/p-15070568.js +0 -36
- package/dist/solutions-components/p-81a0c88f.entry.js +0 -6
- package/dist/solutions-components/p-b7804687.entry.js +0 -6
- package/dist/solutions-components/p-d0544f24.js +0 -192
- package/dist/solutions-components/p-eba875d9.entry.js +0 -6
- 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
|
-
|
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
|
-
|
431
|
-
|
432
|
-
|
433
|
-
&&
|
434
|
-
&&
|
435
|
-
|
436
|
-
|
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
|
-
|
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
|
-
|
588
|
-
.
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
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
|
-
|
595
|
-
|
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
|
-
|
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
|
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
|
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
|
-
|
2746
|
-
|
2747
|
-
|
2748
|
-
&&
|
2749
|
-
&&
|
2750
|
-
|
2751
|
-
|
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 =
|
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": [
|
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
|
-
|
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
|
}
|