@esri/solutions-components 0.10.21 → 0.10.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +1 -1
- package/dist/cjs/calcite-alert_5.cjs.entry.js +6 -2
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +17 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
- package/dist/cjs/map-select-tools_3.cjs.entry.js +78 -21
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +4 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +2 -1
- package/dist/collection/components/edit-card/edit-card.js +6 -2
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +17 -2
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +78 -21
- package/dist/components/crowdsource-manager.js +3 -2
- package/dist/components/edit-card2.js +6 -2
- package/dist/components/map-layer-picker2.js +17 -2
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-select-tools2.js +78 -21
- package/dist/esm/basemap-gallery_7.entry.js +1 -1
- package/dist/esm/calcite-alert_5.entry.js +6 -2
- package/dist/esm/calcite-combobox_3.entry.js +17 -2
- package/dist/esm/crowdsource-manager.entry.js +3 -2
- package/dist/esm/map-select-tools_3.entry.js +78 -21
- package/dist/solutions-components/p-671fd156.entry.js +6 -0
- package/dist/solutions-components/{p-9fed495d.entry.js → p-a85fd786.entry.js} +1 -1
- package/dist/solutions-components/{p-793f1b14.entry.js → p-c7046172.entry.js} +2 -2
- package/dist/solutions-components/p-cd5a9034.entry.js +6 -0
- package/dist/solutions-components/p-f6dc7347.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/edit-card/edit-card.d.ts +3 -1
- package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +6 -0
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +22 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-24a813a4.entry.js +0 -6
- package/dist/solutions-components/p-bd2278cf.entry.js +0 -6
- package/dist/solutions-components/p-bde2619f.entry.js +0 -6
@@ -732,7 +732,7 @@ const MapPicker = class {
|
|
732
732
|
_getMapPicker() {
|
733
733
|
const id = "map-picker-expand-toggle";
|
734
734
|
const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
|
735
|
-
return (index.h("div", { class: "width-full" }, index.h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), index.h("calcite-tooltip", {
|
735
|
+
return (index.h("div", { class: "width-full" }, index.h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, iconStart: "map", id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), index.h("calcite-tooltip", { placement: "bottom", "reference-element": id }, index.h("span", null, this._translations.switchMap))));
|
736
736
|
}
|
737
737
|
/**
|
738
738
|
* Create the toolbar (controls used for map and app interactions)
|
@@ -1287,6 +1287,8 @@ const EditCard = class {
|
|
1287
1287
|
_editor;
|
1288
1288
|
/**
|
1289
1289
|
* esri/layers/FeatureLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
|
1290
|
+
* OR
|
1291
|
+
* esri/layers/support/SubtypeSublayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html
|
1290
1292
|
*/
|
1291
1293
|
_layer;
|
1292
1294
|
/**
|
@@ -1391,7 +1393,9 @@ const EditCard = class {
|
|
1391
1393
|
if (this._layerEditHandle) {
|
1392
1394
|
this._layerEditHandle.remove();
|
1393
1395
|
}
|
1394
|
-
|
1396
|
+
// #896 Editing on sybtype group layer is failing in Manager
|
1397
|
+
const layer = this._layer.type === "subtype-sublayer" ? this._layer.parent : this._layer;
|
1398
|
+
this._layerEditHandle = layer.on("edits", () => {
|
1395
1399
|
this.editsComplete.emit();
|
1396
1400
|
});
|
1397
1401
|
}
|
@@ -1406,7 +1410,7 @@ const EditCard = class {
|
|
1406
1410
|
!this.graphics[0].layer.editingEnabled : true;
|
1407
1411
|
const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
|
1408
1412
|
const loadingClass = this._editorLoading ? "" : "display-none";
|
1409
|
-
return (index.h(index.Host, { key: '
|
1413
|
+
return (index.h(index.Host, { key: '16dd78822ee6d7c4e2da97c4b7ec7c0678b51e68' }, index.h("div", { key: '8aba2b86c7bf8e7dfbf7567b156e02b23b728f4e', class: "position-absolute" }, editDisabled ? (index.h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, index.h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, index.h("div", { key: '8230d44ec05ff207681e6333b7f08c80748c4f3d', class: "position-absolute" }, index.h("div", { key: '71792b5737c43a024ebc677ae168d74569349585', class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), index.h("calcite-loader", { key: '47176534c25769af8ae107c3864901c4294b4359', class: loadingClass, label: "", scale: "s" })))));
|
1410
1414
|
}
|
1411
1415
|
//--------------------------------------------------------------------------
|
1412
1416
|
//
|
@@ -1379,7 +1379,8 @@ const MapLayerPicker = class {
|
|
1379
1379
|
* @returns Calcite label with the layer name and icon
|
1380
1380
|
*/
|
1381
1381
|
_getSingleLayerPlaceholder() {
|
1382
|
-
|
1382
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
1383
|
+
return (index.h("div", { class: "layer-picker-label-container cursor-default" }, index.h("calcite-icon", { icon: itemTypeIcon, scale: "s" }), index.h("calcite-label", { class: "no-bottom-margin padding-start-1" }, this.selectedName)));
|
1383
1384
|
}
|
1384
1385
|
/**
|
1385
1386
|
* Create a list of layers from the map
|
@@ -1427,10 +1428,24 @@ const MapLayerPicker = class {
|
|
1427
1428
|
* @returns the node for the button
|
1428
1429
|
*/
|
1429
1430
|
_getDropdownButton() {
|
1431
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
1430
1432
|
const buttonClass = this.isMobile ? "" : "max-width-350";
|
1431
1433
|
const buttonSlot = this.isMobile ? "trigger" : "";
|
1432
1434
|
const buttonIcon = this._isDropdownOpen ? "chevron-up" : "chevron-down";
|
1433
|
-
return (index.h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart:
|
1435
|
+
return (index.h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart: itemTypeIcon, kind: "neutral", slot: buttonSlot, width: "full" }, index.h("div", null, this.selectedName)));
|
1436
|
+
}
|
1437
|
+
/**
|
1438
|
+
* Get the appropriate icon based on the selected layer or table
|
1439
|
+
*
|
1440
|
+
* @returns a string for the appropriate icon
|
1441
|
+
*/
|
1442
|
+
_getItemTypeIcon() {
|
1443
|
+
let itemTypeIcon = "layers";
|
1444
|
+
if (this.selectedIds.length > 0) {
|
1445
|
+
const id = this.selectedIds[0];
|
1446
|
+
itemTypeIcon = Object.keys(this._layerNameHash).indexOf(id) > -1 ? "layers" : "table";
|
1447
|
+
}
|
1448
|
+
return itemTypeIcon;
|
1434
1449
|
}
|
1435
1450
|
/**
|
1436
1451
|
* Get the appropriate type of dom nodes for each valid layer or table
|
@@ -14,7 +14,7 @@ const mapViewUtils = require('./mapViewUtils-18c46b84.js');
|
|
14
14
|
require('./esri-loader-08dc41bd.js');
|
15
15
|
require('./_commonjsHelpers-baf43783.js');
|
16
16
|
|
17
|
-
const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.height-51{height:51%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}";
|
17
|
+
const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.height-51{height:51%}.top-51{top:51px}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}";
|
18
18
|
const CrowdsourceManagerStyle0 = crowdsourceManagerCss;
|
19
19
|
|
20
20
|
const CrowdsourceManager = class {
|
@@ -420,7 +420,8 @@ const CrowdsourceManager = class {
|
|
420
420
|
const headerClass = this._isMobile && this._showInformationHeader ? "display-none height-0" : "";
|
421
421
|
const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
|
422
422
|
const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
|
423
|
-
|
423
|
+
const tableViewClass = this.appLayout === "tableView" ? "position-relative top-51" : "";
|
424
|
+
return (index.h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass} ${tableViewClass}`, style: {
|
424
425
|
'--calcite-color-foreground-1': this.popupHeaderColor, /* background color that will be displayed on the popup header */
|
425
426
|
'--calcite-color-foreground-2': this.popupHeaderHoverColor, /* background color that will be displayed on button when hovered */
|
426
427
|
'--calcite-color-text-3': this.popupHeaderTextColor, /* font color that will be displayed on button */
|
@@ -64,6 +64,10 @@ const MapSelectTools = class {
|
|
64
64
|
// Properties (protected)
|
65
65
|
//
|
66
66
|
//--------------------------------------------------------------------------
|
67
|
+
/**
|
68
|
+
* esri/request: https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html
|
69
|
+
*/
|
70
|
+
_esriRequest;
|
67
71
|
/**
|
68
72
|
* esri/layers/FeatureLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
|
69
73
|
*/
|
@@ -293,7 +297,7 @@ const MapSelectTools = class {
|
|
293
297
|
render() {
|
294
298
|
const mapToolsClass = this.enableSketchTools ? "" : "display-none";
|
295
299
|
const mapToolsContainerClass = this.enableSketchTools ? "padding-top-1" : "";
|
296
|
-
return (index.h(index.Host, { key: '
|
300
|
+
return (index.h(index.Host, { key: '6753158d00a33dd5dfbb1f22cc27388baf4c0b5e' }, this._getMapLayerPicker(), index.h("div", { key: '082c6be48d3dfbe2e39be2c462959c7772a91d40', class: "border-bottom" }), index.h("div", { key: '0e8133a809b05bef34c2f19adeff43c1e57cc002', class: "padding-top-sides-1" }, index.h("div", { key: '4434b5b4d073f3ba9a7e44b82078b9b81733025b', class: "search-widget", ref: (el) => { this._searchElement = el; } }), index.h("div", { key: '6f01e27e06ea365de6ff98df3f9edd973d87117c', class: mapToolsContainerClass }, index.h("map-draw-tools", { key: '24ffe562d080955f2aacfd080c0baa1997f8eaab', active: true, class: mapToolsClass, editGraphicsEnabled: !this._useLayerFeaturesEnabled, graphics: this._graphics, mapView: this.mapView, onSketchGraphicsChange: (evt) => void this._sketchGraphicsChanged(evt), pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, ref: (el) => { this._drawTools = el; } })), this.enableSearchDistance ? this._getBufferOptions() : undefined, this.enableLayerFeatures ? this._getUseLayerFeaturesOptions() : undefined, this._getNumSelected()), index.h("div", { key: '4c7cf401b5bcc7e4adef34e140d22676fce8ebbc', class: "border-bottom" }), this._getNameInput()));
|
297
301
|
}
|
298
302
|
/**
|
299
303
|
* Renders the buffer tools component.
|
@@ -360,13 +364,15 @@ const MapSelectTools = class {
|
|
360
364
|
* @protected
|
361
365
|
*/
|
362
366
|
async _initModules() {
|
363
|
-
const [GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await locale.loadModules([
|
367
|
+
const [esriRequest, GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await locale.loadModules([
|
368
|
+
"esri/request",
|
364
369
|
"esri/layers/GraphicsLayer",
|
365
370
|
"esri/Graphic",
|
366
371
|
"esri/widgets/Search",
|
367
372
|
"esri/geometry/geometryEngine",
|
368
373
|
"esri/layers/FeatureLayer"
|
369
374
|
]);
|
375
|
+
this._esriRequest = esriRequest;
|
370
376
|
this.GraphicsLayer = GraphicsLayer;
|
371
377
|
this.Graphic = Graphic;
|
372
378
|
this.Search = Search;
|
@@ -443,25 +449,7 @@ const MapSelectTools = class {
|
|
443
449
|
void this._clearResults(false, clearLabel);
|
444
450
|
});
|
445
451
|
this._searchWidget.on("select-result", (searchResults) => {
|
446
|
-
|
447
|
-
this._searchResult = searchResults.result;
|
448
|
-
const resultFeature = searchResults.result.feature;
|
449
|
-
const resultLayer = resultFeature?.layer;
|
450
|
-
const selectLayer = this.selectLayerView.layer;
|
451
|
-
const oid = resultFeature?.getObjectId();
|
452
|
-
const useOIDs = resultLayer?.url && selectLayer?.url && resultLayer.url === selectLayer.url && !isNaN(oid);
|
453
|
-
const oids = useOIDs ? [oid] : undefined;
|
454
|
-
this._workflowType = interfaces.EWorkflowType.SEARCH;
|
455
|
-
void this._updateLabel();
|
456
|
-
const graphics = [searchResults.result.feature];
|
457
|
-
this._updateSelection(graphics, useOIDs, oids);
|
458
|
-
this._drawTools.graphics = graphics;
|
459
|
-
this._searchWidget.resultGraphic.visible = false;
|
460
|
-
}
|
461
|
-
else {
|
462
|
-
const clearLabel = this._searchClearLabel();
|
463
|
-
void this._clearResults(false, clearLabel);
|
464
|
-
}
|
452
|
+
void this._selectResult(searchResults.result);
|
465
453
|
});
|
466
454
|
await this._searchWidget.when(() => {
|
467
455
|
this._searchWidget.allPlaceholder = this.searchConfiguration?.allPlaceholder &&
|
@@ -470,6 +458,75 @@ const MapSelectTools = class {
|
|
470
458
|
});
|
471
459
|
}
|
472
460
|
}
|
461
|
+
/**
|
462
|
+
* Handle the result from the search widget.
|
463
|
+
*
|
464
|
+
* @param url the url of the layer view
|
465
|
+
*
|
466
|
+
* @returns the url of the views source
|
467
|
+
* @protected
|
468
|
+
*/
|
469
|
+
async _selectResult(result) {
|
470
|
+
if (result) {
|
471
|
+
this._searchResult = result;
|
472
|
+
const resultFeature = result.feature;
|
473
|
+
const resultLayer = resultFeature?.layer;
|
474
|
+
const selectLayer = this.selectLayerView.layer;
|
475
|
+
const oid = resultFeature?.getObjectId();
|
476
|
+
let resultLayerSourceUrl;
|
477
|
+
if (resultLayer.sourceJSON?.isView) {
|
478
|
+
resultLayerSourceUrl = await this._getViewSourceUrl(resultLayer.url);
|
479
|
+
}
|
480
|
+
let selectLayerSourceUrl;
|
481
|
+
if (selectLayer.sourceJSON?.isView) {
|
482
|
+
selectLayerSourceUrl = await this._getViewSourceUrl(selectLayer.url);
|
483
|
+
}
|
484
|
+
const rUrl = resultLayer?.url?.toLowerCase();
|
485
|
+
const rSourceUrl = resultLayerSourceUrl?.toLowerCase();
|
486
|
+
const sUrl = selectLayer?.url?.toLowerCase();
|
487
|
+
const sSourceUrl = selectLayerSourceUrl?.toLowerCase();
|
488
|
+
const useOIDs = rUrl && sUrl &&
|
489
|
+
(rUrl === sUrl || rUrl === sSourceUrl || rSourceUrl === sUrl || rSourceUrl === sSourceUrl) &&
|
490
|
+
!isNaN(oid);
|
491
|
+
const oids = useOIDs ? [oid] : undefined;
|
492
|
+
this._workflowType = interfaces.EWorkflowType.SEARCH;
|
493
|
+
void this._updateLabel();
|
494
|
+
const graphics = [result.feature];
|
495
|
+
this._updateSelection(graphics, useOIDs, oids);
|
496
|
+
this._drawTools.graphics = graphics;
|
497
|
+
this._searchWidget.resultGraphic.visible = false;
|
498
|
+
}
|
499
|
+
else {
|
500
|
+
const clearLabel = this._searchClearLabel();
|
501
|
+
void this._clearResults(false, clearLabel);
|
502
|
+
}
|
503
|
+
}
|
504
|
+
/**
|
505
|
+
* Get the source url for a view. This function supports single source views only.
|
506
|
+
*
|
507
|
+
* @param url the url of the layer view
|
508
|
+
*
|
509
|
+
* @returns the url of the views source
|
510
|
+
* @protected
|
511
|
+
*/
|
512
|
+
async _getViewSourceUrl(url) {
|
513
|
+
let sourceUrl = "";
|
514
|
+
const resultLayerSourcesUrl = `${url}/sources?f=json`;
|
515
|
+
try {
|
516
|
+
const request = await this._esriRequest(resultLayerSourcesUrl, {
|
517
|
+
query: {
|
518
|
+
f: "json"
|
519
|
+
}
|
520
|
+
});
|
521
|
+
if (request?.data?.services?.length === 1) {
|
522
|
+
sourceUrl = request.data.services[0].url;
|
523
|
+
}
|
524
|
+
}
|
525
|
+
catch (error) {
|
526
|
+
console.log(error);
|
527
|
+
}
|
528
|
+
return sourceUrl;
|
529
|
+
}
|
473
530
|
/**
|
474
531
|
* Check if the current label should be cleared
|
475
532
|
*
|
@@ -427,7 +427,8 @@ export class CrowdsourceManager {
|
|
427
427
|
const headerClass = this._isMobile && this._showInformationHeader ? "display-none height-0" : "";
|
428
428
|
const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
|
429
429
|
const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
|
430
|
-
|
430
|
+
const tableViewClass = this.appLayout === "tableView" ? "position-relative top-51" : "";
|
431
|
+
return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass} ${tableViewClass}`, style: {
|
431
432
|
'--calcite-color-foreground-1': this.popupHeaderColor, /* background color that will be displayed on the popup header */
|
432
433
|
'--calcite-color-foreground-2': this.popupHeaderHoverColor, /* background color that will be displayed on button when hovered */
|
433
434
|
'--calcite-color-text-3': this.popupHeaderTextColor, /* font color that will be displayed on button */
|
@@ -75,6 +75,8 @@ export class EditCard {
|
|
75
75
|
_editor;
|
76
76
|
/**
|
77
77
|
* esri/layers/FeatureLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
|
78
|
+
* OR
|
79
|
+
* esri/layers/support/SubtypeSublayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html
|
78
80
|
*/
|
79
81
|
_layer;
|
80
82
|
/**
|
@@ -179,7 +181,9 @@ export class EditCard {
|
|
179
181
|
if (this._layerEditHandle) {
|
180
182
|
this._layerEditHandle.remove();
|
181
183
|
}
|
182
|
-
|
184
|
+
// #896 Editing on sybtype group layer is failing in Manager
|
185
|
+
const layer = this._layer.type === "subtype-sublayer" ? this._layer.parent : this._layer;
|
186
|
+
this._layerEditHandle = layer.on("edits", () => {
|
183
187
|
this.editsComplete.emit();
|
184
188
|
});
|
185
189
|
}
|
@@ -194,7 +198,7 @@ export class EditCard {
|
|
194
198
|
!this.graphics[0].layer.editingEnabled : true;
|
195
199
|
const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
|
196
200
|
const loadingClass = this._editorLoading ? "" : "display-none";
|
197
|
-
return (h(Host, { key: '
|
201
|
+
return (h(Host, { key: '16dd78822ee6d7c4e2da97c4b7ec7c0678b51e68' }, h("div", { key: '8aba2b86c7bf8e7dfbf7567b156e02b23b728f4e', class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { key: '8230d44ec05ff207681e6333b7f08c80748c4f3d', class: "position-absolute" }, h("div", { key: '71792b5737c43a024ebc677ae168d74569349585', class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { key: '47176534c25769af8ae107c3864901c4294b4359', class: loadingClass, label: "", scale: "s" })))));
|
198
202
|
}
|
199
203
|
//--------------------------------------------------------------------------
|
200
204
|
//
|
@@ -188,7 +188,8 @@ export class MapLayerPicker {
|
|
188
188
|
* @returns Calcite label with the layer name and icon
|
189
189
|
*/
|
190
190
|
_getSingleLayerPlaceholder() {
|
191
|
-
|
191
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
192
|
+
return (h("div", { class: "layer-picker-label-container cursor-default" }, h("calcite-icon", { icon: itemTypeIcon, scale: "s" }), h("calcite-label", { class: "no-bottom-margin padding-start-1" }, this.selectedName)));
|
192
193
|
}
|
193
194
|
/**
|
194
195
|
* Create a list of layers from the map
|
@@ -236,10 +237,24 @@ export class MapLayerPicker {
|
|
236
237
|
* @returns the node for the button
|
237
238
|
*/
|
238
239
|
_getDropdownButton() {
|
240
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
239
241
|
const buttonClass = this.isMobile ? "" : "max-width-350";
|
240
242
|
const buttonSlot = this.isMobile ? "trigger" : "";
|
241
243
|
const buttonIcon = this._isDropdownOpen ? "chevron-up" : "chevron-down";
|
242
|
-
return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart:
|
244
|
+
return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart: itemTypeIcon, kind: "neutral", slot: buttonSlot, width: "full" }, h("div", null, this.selectedName)));
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* Get the appropriate icon based on the selected layer or table
|
248
|
+
*
|
249
|
+
* @returns a string for the appropriate icon
|
250
|
+
*/
|
251
|
+
_getItemTypeIcon() {
|
252
|
+
let itemTypeIcon = "layers";
|
253
|
+
if (this.selectedIds.length > 0) {
|
254
|
+
const id = this.selectedIds[0];
|
255
|
+
itemTypeIcon = Object.keys(this._layerNameHash).indexOf(id) > -1 ? "layers" : "table";
|
256
|
+
}
|
257
|
+
return itemTypeIcon;
|
243
258
|
}
|
244
259
|
/**
|
245
260
|
* Get the appropriate type of dom nodes for each valid layer or table
|
@@ -147,7 +147,7 @@ export class MapPicker {
|
|
147
147
|
_getMapPicker() {
|
148
148
|
const id = "map-picker-expand-toggle";
|
149
149
|
const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
|
150
|
-
return (h("div", { class: "width-full" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), h("calcite-tooltip", {
|
150
|
+
return (h("div", { class: "width-full" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, iconStart: "map", id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, this._translations.switchMap))));
|
151
151
|
}
|
152
152
|
/**
|
153
153
|
* Create the toolbar (controls used for map and app interactions)
|
@@ -69,6 +69,10 @@ export class MapSelectTools {
|
|
69
69
|
// Properties (protected)
|
70
70
|
//
|
71
71
|
//--------------------------------------------------------------------------
|
72
|
+
/**
|
73
|
+
* esri/request: https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html
|
74
|
+
*/
|
75
|
+
_esriRequest;
|
72
76
|
/**
|
73
77
|
* esri/layers/FeatureLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
|
74
78
|
*/
|
@@ -298,7 +302,7 @@ export class MapSelectTools {
|
|
298
302
|
render() {
|
299
303
|
const mapToolsClass = this.enableSketchTools ? "" : "display-none";
|
300
304
|
const mapToolsContainerClass = this.enableSketchTools ? "padding-top-1" : "";
|
301
|
-
return (h(Host, { key: '
|
305
|
+
return (h(Host, { key: '6753158d00a33dd5dfbb1f22cc27388baf4c0b5e' }, this._getMapLayerPicker(), h("div", { key: '082c6be48d3dfbe2e39be2c462959c7772a91d40', class: "border-bottom" }), h("div", { key: '0e8133a809b05bef34c2f19adeff43c1e57cc002', class: "padding-top-sides-1" }, h("div", { key: '4434b5b4d073f3ba9a7e44b82078b9b81733025b', class: "search-widget", ref: (el) => { this._searchElement = el; } }), h("div", { key: '6f01e27e06ea365de6ff98df3f9edd973d87117c', class: mapToolsContainerClass }, h("map-draw-tools", { key: '24ffe562d080955f2aacfd080c0baa1997f8eaab', active: true, class: mapToolsClass, editGraphicsEnabled: !this._useLayerFeaturesEnabled, graphics: this._graphics, mapView: this.mapView, onSketchGraphicsChange: (evt) => void this._sketchGraphicsChanged(evt), pointSymbol: this.sketchPointSymbol, polygonSymbol: this.sketchPolygonSymbol, polylineSymbol: this.sketchLineSymbol, ref: (el) => { this._drawTools = el; } })), this.enableSearchDistance ? this._getBufferOptions() : undefined, this.enableLayerFeatures ? this._getUseLayerFeaturesOptions() : undefined, this._getNumSelected()), h("div", { key: '4c7cf401b5bcc7e4adef34e140d22676fce8ebbc', class: "border-bottom" }), this._getNameInput()));
|
302
306
|
}
|
303
307
|
/**
|
304
308
|
* Renders the buffer tools component.
|
@@ -365,13 +369,15 @@ export class MapSelectTools {
|
|
365
369
|
* @protected
|
366
370
|
*/
|
367
371
|
async _initModules() {
|
368
|
-
const [GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await loadModules([
|
372
|
+
const [esriRequest, GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await loadModules([
|
373
|
+
"esri/request",
|
369
374
|
"esri/layers/GraphicsLayer",
|
370
375
|
"esri/Graphic",
|
371
376
|
"esri/widgets/Search",
|
372
377
|
"esri/geometry/geometryEngine",
|
373
378
|
"esri/layers/FeatureLayer"
|
374
379
|
]);
|
380
|
+
this._esriRequest = esriRequest;
|
375
381
|
this.GraphicsLayer = GraphicsLayer;
|
376
382
|
this.Graphic = Graphic;
|
377
383
|
this.Search = Search;
|
@@ -448,25 +454,7 @@ export class MapSelectTools {
|
|
448
454
|
void this._clearResults(false, clearLabel);
|
449
455
|
});
|
450
456
|
this._searchWidget.on("select-result", (searchResults) => {
|
451
|
-
|
452
|
-
this._searchResult = searchResults.result;
|
453
|
-
const resultFeature = searchResults.result.feature;
|
454
|
-
const resultLayer = resultFeature?.layer;
|
455
|
-
const selectLayer = this.selectLayerView.layer;
|
456
|
-
const oid = resultFeature?.getObjectId();
|
457
|
-
const useOIDs = resultLayer?.url && selectLayer?.url && resultLayer.url === selectLayer.url && !isNaN(oid);
|
458
|
-
const oids = useOIDs ? [oid] : undefined;
|
459
|
-
this._workflowType = EWorkflowType.SEARCH;
|
460
|
-
void this._updateLabel();
|
461
|
-
const graphics = [searchResults.result.feature];
|
462
|
-
this._updateSelection(graphics, useOIDs, oids);
|
463
|
-
this._drawTools.graphics = graphics;
|
464
|
-
this._searchWidget.resultGraphic.visible = false;
|
465
|
-
}
|
466
|
-
else {
|
467
|
-
const clearLabel = this._searchClearLabel();
|
468
|
-
void this._clearResults(false, clearLabel);
|
469
|
-
}
|
457
|
+
void this._selectResult(searchResults.result);
|
470
458
|
});
|
471
459
|
await this._searchWidget.when(() => {
|
472
460
|
this._searchWidget.allPlaceholder = this.searchConfiguration?.allPlaceholder &&
|
@@ -475,6 +463,75 @@ export class MapSelectTools {
|
|
475
463
|
});
|
476
464
|
}
|
477
465
|
}
|
466
|
+
/**
|
467
|
+
* Handle the result from the search widget.
|
468
|
+
*
|
469
|
+
* @param url the url of the layer view
|
470
|
+
*
|
471
|
+
* @returns the url of the views source
|
472
|
+
* @protected
|
473
|
+
*/
|
474
|
+
async _selectResult(result) {
|
475
|
+
if (result) {
|
476
|
+
this._searchResult = result;
|
477
|
+
const resultFeature = result.feature;
|
478
|
+
const resultLayer = resultFeature?.layer;
|
479
|
+
const selectLayer = this.selectLayerView.layer;
|
480
|
+
const oid = resultFeature?.getObjectId();
|
481
|
+
let resultLayerSourceUrl;
|
482
|
+
if (resultLayer.sourceJSON?.isView) {
|
483
|
+
resultLayerSourceUrl = await this._getViewSourceUrl(resultLayer.url);
|
484
|
+
}
|
485
|
+
let selectLayerSourceUrl;
|
486
|
+
if (selectLayer.sourceJSON?.isView) {
|
487
|
+
selectLayerSourceUrl = await this._getViewSourceUrl(selectLayer.url);
|
488
|
+
}
|
489
|
+
const rUrl = resultLayer?.url?.toLowerCase();
|
490
|
+
const rSourceUrl = resultLayerSourceUrl?.toLowerCase();
|
491
|
+
const sUrl = selectLayer?.url?.toLowerCase();
|
492
|
+
const sSourceUrl = selectLayerSourceUrl?.toLowerCase();
|
493
|
+
const useOIDs = rUrl && sUrl &&
|
494
|
+
(rUrl === sUrl || rUrl === sSourceUrl || rSourceUrl === sUrl || rSourceUrl === sSourceUrl) &&
|
495
|
+
!isNaN(oid);
|
496
|
+
const oids = useOIDs ? [oid] : undefined;
|
497
|
+
this._workflowType = EWorkflowType.SEARCH;
|
498
|
+
void this._updateLabel();
|
499
|
+
const graphics = [result.feature];
|
500
|
+
this._updateSelection(graphics, useOIDs, oids);
|
501
|
+
this._drawTools.graphics = graphics;
|
502
|
+
this._searchWidget.resultGraphic.visible = false;
|
503
|
+
}
|
504
|
+
else {
|
505
|
+
const clearLabel = this._searchClearLabel();
|
506
|
+
void this._clearResults(false, clearLabel);
|
507
|
+
}
|
508
|
+
}
|
509
|
+
/**
|
510
|
+
* Get the source url for a view. This function supports single source views only.
|
511
|
+
*
|
512
|
+
* @param url the url of the layer view
|
513
|
+
*
|
514
|
+
* @returns the url of the views source
|
515
|
+
* @protected
|
516
|
+
*/
|
517
|
+
async _getViewSourceUrl(url) {
|
518
|
+
let sourceUrl = "";
|
519
|
+
const resultLayerSourcesUrl = `${url}/sources?f=json`;
|
520
|
+
try {
|
521
|
+
const request = await this._esriRequest(resultLayerSourcesUrl, {
|
522
|
+
query: {
|
523
|
+
f: "json"
|
524
|
+
}
|
525
|
+
});
|
526
|
+
if (request?.data?.services?.length === 1) {
|
527
|
+
sourceUrl = request.data.services[0].url;
|
528
|
+
}
|
529
|
+
}
|
530
|
+
catch (error) {
|
531
|
+
console.log(error);
|
532
|
+
}
|
533
|
+
return sourceUrl;
|
534
|
+
}
|
478
535
|
/**
|
479
536
|
* Check if the current label should be cleared
|
480
537
|
*
|
@@ -67,7 +67,7 @@ import { d as defineCustomElement$4 } from './map-picker2.js';
|
|
67
67
|
import { d as defineCustomElement$3 } from './map-search2.js';
|
68
68
|
import { d as defineCustomElement$2 } from './map-tools2.js';
|
69
69
|
|
70
|
-
const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.height-51{height:51%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}";
|
70
|
+
const crowdsourceManagerCss = ":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.position-absolute{position:absolute}.height-51{height:51%}.top-51{top:51px}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}.z-index-0{z-index:0 !important}";
|
71
71
|
const CrowdsourceManagerStyle0 = crowdsourceManagerCss;
|
72
72
|
|
73
73
|
const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceManager extends HTMLElement {
|
@@ -474,7 +474,8 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
|
|
474
474
|
const headerClass = this._isMobile && this._showInformationHeader ? "display-none height-0" : "";
|
475
475
|
const headerTheme = this.popupHeaderColor ? "" : !this._isMobile ? "calcite-mode-dark" : "calcite-mode-light";
|
476
476
|
const containerClass = this._isMobile && this._hideTable ? "position-absolute-0 width-full height-full" : this._isMobile ? "display-none height-0" : "";
|
477
|
-
|
477
|
+
const tableViewClass = this.appLayout === "tableView" ? "position-relative top-51" : "";
|
478
|
+
return (h("div", { class: `${headerTheme} ${popupNodeClass} ${containerClass} ${tableViewClass}`, style: {
|
478
479
|
'--calcite-color-foreground-1': this.popupHeaderColor, /* background color that will be displayed on the popup header */
|
479
480
|
'--calcite-color-foreground-2': this.popupHeaderHoverColor, /* background color that will be displayed on button when hovered */
|
480
481
|
'--calcite-color-text-3': this.popupHeaderTextColor, /* font color that will be displayed on button */
|
@@ -67,6 +67,8 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
67
67
|
_editor;
|
68
68
|
/**
|
69
69
|
* esri/layers/FeatureLayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
|
70
|
+
* OR
|
71
|
+
* esri/layers/support/SubtypeSublayer: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html
|
70
72
|
*/
|
71
73
|
_layer;
|
72
74
|
/**
|
@@ -171,7 +173,9 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
171
173
|
if (this._layerEditHandle) {
|
172
174
|
this._layerEditHandle.remove();
|
173
175
|
}
|
174
|
-
|
176
|
+
// #896 Editing on sybtype group layer is failing in Manager
|
177
|
+
const layer = this._layer.type === "subtype-sublayer" ? this._layer.parent : this._layer;
|
178
|
+
this._layerEditHandle = layer.on("edits", () => {
|
175
179
|
this.editsComplete.emit();
|
176
180
|
});
|
177
181
|
}
|
@@ -186,7 +190,7 @@ const EditCard = /*@__PURE__*/ proxyCustomElement(class EditCard extends HTMLEle
|
|
186
190
|
!this.graphics[0].layer.editingEnabled : true;
|
187
191
|
const tableNodeClass = this._editorLoading ? "display-none" : "position-absolute";
|
188
192
|
const loadingClass = this._editorLoading ? "" : "display-none";
|
189
|
-
return (h(Host, { key: '
|
193
|
+
return (h(Host, { key: '16dd78822ee6d7c4e2da97c4b7ec7c0678b51e68' }, h("div", { key: '8aba2b86c7bf8e7dfbf7567b156e02b23b728f4e', class: "position-absolute" }, editDisabled ? (h("calcite-notice", { kind: "warning", open: true, slot: "content-top", width: "full" }, h("div", { slot: "message" }, this._translations.enableEditing))) : undefined, h("div", { key: '8230d44ec05ff207681e6333b7f08c80748c4f3d', class: "position-absolute" }, h("div", { key: '71792b5737c43a024ebc677ae168d74569349585', class: tableNodeClass, id: "feature-form", ref: (el) => this._editContainer = el }), h("calcite-loader", { key: '47176534c25769af8ae107c3864901c4294b4359', class: loadingClass, label: "", scale: "s" })))));
|
190
194
|
}
|
191
195
|
//--------------------------------------------------------------------------
|
192
196
|
//
|
@@ -192,7 +192,8 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
192
192
|
* @returns Calcite label with the layer name and icon
|
193
193
|
*/
|
194
194
|
_getSingleLayerPlaceholder() {
|
195
|
-
|
195
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
196
|
+
return (h("div", { class: "layer-picker-label-container cursor-default" }, h("calcite-icon", { icon: itemTypeIcon, scale: "s" }), h("calcite-label", { class: "no-bottom-margin padding-start-1" }, this.selectedName)));
|
196
197
|
}
|
197
198
|
/**
|
198
199
|
* Create a list of layers from the map
|
@@ -240,10 +241,24 @@ const MapLayerPicker = /*@__PURE__*/ proxyCustomElement(class MapLayerPicker ext
|
|
240
241
|
* @returns the node for the button
|
241
242
|
*/
|
242
243
|
_getDropdownButton() {
|
244
|
+
const itemTypeIcon = this._getItemTypeIcon();
|
243
245
|
const buttonClass = this.isMobile ? "" : "max-width-350";
|
244
246
|
const buttonSlot = this.isMobile ? "trigger" : "";
|
245
247
|
const buttonIcon = this._isDropdownOpen ? "chevron-up" : "chevron-down";
|
246
|
-
return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart:
|
248
|
+
return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart: itemTypeIcon, kind: "neutral", slot: buttonSlot, width: "full" }, h("div", null, this.selectedName)));
|
249
|
+
}
|
250
|
+
/**
|
251
|
+
* Get the appropriate icon based on the selected layer or table
|
252
|
+
*
|
253
|
+
* @returns a string for the appropriate icon
|
254
|
+
*/
|
255
|
+
_getItemTypeIcon() {
|
256
|
+
let itemTypeIcon = "layers";
|
257
|
+
if (this.selectedIds.length > 0) {
|
258
|
+
const id = this.selectedIds[0];
|
259
|
+
itemTypeIcon = Object.keys(this._layerNameHash).indexOf(id) > -1 ? "layers" : "table";
|
260
|
+
}
|
261
|
+
return itemTypeIcon;
|
247
262
|
}
|
248
263
|
/**
|
249
264
|
* Get the appropriate type of dom nodes for each valid layer or table
|
@@ -152,7 +152,7 @@ const MapPicker = /*@__PURE__*/ proxyCustomElement(class MapPicker extends HTMLE
|
|
152
152
|
_getMapPicker() {
|
153
153
|
const id = "map-picker-expand-toggle";
|
154
154
|
const mapListIcon = this._mapListExpanded ? "chevron-up" : "chevron-down";
|
155
|
-
return (h("div", { class: "width-full" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), h("calcite-tooltip", {
|
155
|
+
return (h("div", { class: "width-full" }, h("calcite-button", { alignment: "icon-end-space-between", appearance: "transparent", class: "width-full height-full", iconEnd: mapListIcon, iconStart: "map", id: id, kind: "neutral", onClick: () => this._chooseMap(), width: "full" }, this._webMapInfo?.name), h("calcite-tooltip", { placement: "bottom", "reference-element": id }, h("span", null, this._translations.switchMap))));
|
156
156
|
}
|
157
157
|
/**
|
158
158
|
* Create the toolbar (controls used for map and app interactions)
|