@esri/solutions-components 0.10.7 → 0.10.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +24 -8
- package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +354 -967
- package/dist/cjs/calcite-graph_2.cjs.entry.js +1082 -0
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
- package/dist/cjs/calcite-tree_3.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +246 -18
- package/dist/cjs/crowdsource-manager.cjs.entry.js +171 -50
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/share-item.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
- package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
- package/dist/collection/assets/t9n/crowdsource-manager/resources.json +5 -1
- package/dist/collection/assets/t9n/crowdsource-manager/resources_en.json +5 -1
- package/dist/collection/assets/t9n/layer-table/resources.json +1 -0
- package/dist/collection/assets/t9n/layer-table/resources_en.json +1 -0
- package/dist/collection/assets/t9n/map-card/resources.json +6 -1
- package/dist/collection/assets/t9n/map-card/resources_en.json +6 -1
- package/dist/collection/components/card-manager/card-manager.js +34 -8
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +176 -84
- package/dist/collection/components/layer-table/layer-table.js +175 -8
- package/dist/collection/components/map-card/map-card.css +4 -0
- package/dist/collection/components/map-card/map-card.js +368 -3
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +9 -3
- package/dist/collection/components/map-legend/map-legend.js +1 -1
- package/dist/collection/components/map-picker/map-picker.css +8 -0
- package/dist/collection/components/map-picker/map-picker.js +74 -3
- package/dist/collection/components/map-search/map-search.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
- package/dist/collection/components/map-tools/map-tools.js +1 -1
- package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
- package/dist/collection/components/pdf-download/pdf-download.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/components/share-item/share-item.js +1 -1
- package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
- package/dist/collection/components/solution-contents/solution-contents.js +1 -1
- package/dist/collection/components/solution-item/solution-item.js +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
- package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
- package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
- package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
- package/dist/collection/components/solution-variables/solution-variables.js +1 -1
- package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
- package/dist/collection/demos/crowdsource-manager.html +1 -0
- package/dist/components/card-manager2.js +20 -8
- package/dist/components/crowdsource-manager.js +175 -55
- package/dist/components/layer-table2.js +72 -10
- package/dist/components/map-card2.js +288 -47
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-fullscreen2.js +1 -1
- package/dist/components/map-layer-picker2.js +9 -3
- package/dist/components/map-legend2.js +1 -1
- package/dist/components/map-picker2.js +24 -5
- package/dist/components/map-search2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/map-tools2.js +1 -1
- package/dist/components/pci-calculator.js +1 -1
- package/dist/components/pdf-download2.js +1 -1
- package/dist/components/public-notification.js +1 -1
- package/dist/components/refine-results-flow-item.js +1 -1
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/share-item.js +1 -1
- package/dist/components/solution-configuration.js +3 -3
- package/dist/components/solution-contents2.js +1 -1
- package/dist/components/solution-item-details2.js +1 -1
- package/dist/components/solution-item-icon2.js +1 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-item2.js +1 -1
- package/dist/components/solution-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-spatial-ref2.js +1 -1
- package/dist/components/solution-template-data2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/components/spatial-ref.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +24 -8
- package/dist/esm/buffer-tools_3.entry.js +1 -1
- package/dist/esm/calcite-combobox_3.entry.js +369 -982
- package/dist/esm/calcite-graph_2.entry.js +1077 -0
- package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
- package/dist/esm/calcite-tree_3.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +248 -20
- package/dist/esm/crowdsource-manager.entry.js +172 -51
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +3 -3
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/refine-results-flow-item.entry.js +1 -1
- package/dist/esm/share-item.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +3 -3
- package/dist/esm/solution-contents_3.entry.js +3 -3
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +1 -1
- package/dist/solutions-components/assets/t9n/crowdsource-manager/resources.json +5 -1
- package/dist/solutions-components/assets/t9n/crowdsource-manager/resources_en.json +5 -1
- package/dist/solutions-components/assets/t9n/layer-table/resources.json +1 -0
- package/dist/solutions-components/assets/t9n/layer-table/resources_en.json +1 -0
- package/dist/solutions-components/assets/t9n/map-card/resources.json +6 -1
- package/dist/solutions-components/assets/t9n/map-card/resources_en.json +6 -1
- package/dist/solutions-components/demos/crowdsource-manager.html +1 -0
- package/dist/solutions-components/p-0abc1354.entry.js +6 -0
- package/dist/solutions-components/p-0f7b5d36.entry.js +6 -0
- package/dist/solutions-components/{p-a9818be2.entry.js → p-20c465e9.entry.js} +1 -1
- package/dist/solutions-components/{p-db18bce8.entry.js → p-36b50b5b.entry.js} +1 -1
- package/dist/solutions-components/{p-85512ae3.entry.js → p-445213cf.entry.js} +1 -1
- package/dist/solutions-components/{p-d49f895d.entry.js → p-4a5f0a97.entry.js} +1 -1
- package/dist/solutions-components/{p-002c97df.entry.js → p-5d201016.entry.js} +1 -1
- package/dist/solutions-components/{p-b7cec3bd.entry.js → p-618bafec.entry.js} +1 -1
- package/dist/solutions-components/p-6a66d5a9.entry.js +6 -0
- package/dist/solutions-components/p-71a2d5b8.entry.js +6 -0
- package/dist/solutions-components/p-7a64b026.entry.js +17 -0
- package/dist/solutions-components/p-7d514d7f.entry.js +6 -0
- package/dist/solutions-components/p-85c25564.entry.js +6 -0
- package/dist/solutions-components/{p-235bf02e.entry.js → p-913413c3.entry.js} +1 -1
- package/dist/solutions-components/{p-49aa2929.entry.js → p-bebd4646.entry.js} +1 -1
- package/dist/solutions-components/p-ce454f5a.entry.js +11 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/card-manager/card-manager.d.ts +11 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +88 -22
- package/dist/types/components/layer-table/layer-table.d.ts +30 -0
- package/dist/types/components/map-card/map-card.d.ts +124 -0
- package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +4 -0
- package/dist/types/components/map-picker/map-picker.d.ts +12 -0
- package/dist/types/components.d.ts +130 -8
- package/dist/types/preact.d.ts +4 -2
- package/package.json +5 -5
- package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +0 -453
- package/dist/esm/calcite-dropdown-group_2.entry.js +0 -448
- package/dist/solutions-components/p-129fd80e.entry.js +0 -6
- package/dist/solutions-components/p-3b426576.entry.js +0 -6
- package/dist/solutions-components/p-72b217f2.entry.js +0 -6
- package/dist/solutions-components/p-8b999a2b.entry.js +0 -6
- package/dist/solutions-components/p-973ff7b2.entry.js +0 -23
- package/dist/solutions-components/p-a001f9c9.entry.js +0 -6
- package/dist/solutions-components/p-c683b3fe.entry.js +0 -6
- package/dist/solutions-components/p-e9d049bd.entry.js +0 -6
@@ -2203,7 +2203,7 @@ const SolutionItemDetails = class {
|
|
2203
2203
|
* Renders the component.
|
2204
2204
|
*/
|
2205
2205
|
render() {
|
2206
|
-
return (h(Host, { key: '
|
2206
|
+
return (h(Host, { key: 'f93ee5d1152024c4c9d4b7376d8e19e5a0ebaccd' }, h("div", { key: 'd03106d1566be78c478a8ca798cea04161e835a2', class: "parent-container" }, h("div", { key: '78f52543e511e7deecffdc998808fce766863ef3', class: "inputBottomSeparation" }, h("calcite-input", { key: '70783f0059d5e526f56a4ff2cff18e20348c4c16', id: "item-title", value: this.itemDetails.title })), h("div", { key: 'b2cfc981837ee9fd8549dc62057bc98429f3f50a', class: "inputBottomSeparation" }, h("input", { key: '47bdb6fe76a080c297c01ee8624088a501f31f17', accept: ".jpg,.gif,.png,image/jpg,image/gif,image/png", class: "display-none", onChange: (event) => (this._updateThumbnail(event)), ref: (el) => (this.browseForThumbnail = el), type: "file" }), h("button", { key: '7c2b6882f87d63f97c609c071b60b62474931c93', class: "font-size--3 btn-link inline-block trailer-quarter", onClick: () => this._getThumbnail() }, h("svg", { key: 'b530933142b3aa03de26baa33e4be11ea9f4c806', class: "icon-inline icon-inline--on-left", height: "16", viewBox: "0 0 16 16", width: "16" }, h("path", { key: '57388aa06be3e6c3bed24673ab63386cc433f6c0', d: "M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z" })), this._translations.editThumbnail), h("div", { key: '3906eeaa6bd72d0c53a0e472c3606f0ab879a3d3', class: "flex" }, h("div", { key: 'fa88b2ea055748202ed7c34ce7df2cfc9a1592a0', class: "img-container", ref: (el) => (this.thumbnailContainer = el) }, h("img", { key: '2b5e960405c8f41a66bdf93f47e669d5eae646ad', class: "scale-down", height: "133", id: "item-thumbnail", ref: (el) => (this.thumbnail = el), width: "200" })), h("div", { key: '7762aca4498ef2ca8d70beb59cfc5906229c3e5d', class: "snippet-count-container" }, h("calcite-input", { key: '1a6e9e299e551f2c7a3f99395a789fd4e1bf1e88', id: "item-snippet", maxLength: 250, type: "textarea", value: this.itemDetails.snippet }), h("label", { key: 'a66a1569c45189e013d230f7d2c11fd315ffaa29', class: "font-size--3", id: "item-snippet-count", ref: (el) => (this.itemSnippetCount = el) })))), h("calcite-label", { key: '1befca128558c7b638d86521f162bcbf44e889a1' }, this._translations.description, h("label", { key: '496939ec6171b926b8f7d6610fa153a0ee63243c', id: "item-description-label" }, h("calcite-input", { key: 'a97b85340d620f4fa909b4b697e058e5398df145', id: "item-description", type: "textarea", value: this.itemDetails.description }))), h("calcite-label", { key: 'eecadd422f35b01124dbf9ac8ce030c561f8b76d' }, this._translations.tags, h("label", { key: 'be9ba3c1c3e4d3bff74bcaf586cef39a8a5c76f2', id: "item-tags-label" }, h("calcite-input", { key: '9772f1e364dcb9810ea81bbf2871ee3c81bb0f92', id: "item-tags", value: (this.itemDetails.tags && Array.isArray(this.itemDetails.tags) ? this.itemDetails.tags : [this.itemDetails.tags]).join(",") }))), this.itemType !== "Group" ? h("calcite-label", null, this._translations.credits, h("label", { id: "item-credits-label" }, h("calcite-input", { id: "item-credits", value: this.itemDetails.accessInformation }))) : null, this.itemType !== "Group" ? h("calcite-label", null, h("label", { id: "item-terms-label" }, this._translations.termsOfUse, h("calcite-input", { id: "item-terms", type: "textarea", value: this.itemDetails.licenseInfo }))) : null)));
|
2207
2207
|
}
|
2208
2208
|
componentDidRender() {
|
2209
2209
|
this._loadThumb();
|
@@ -2381,7 +2381,7 @@ const SolutionItemSharing = class {
|
|
2381
2381
|
* Renders the component.
|
2382
2382
|
*/
|
2383
2383
|
render() {
|
2384
|
-
return (h(Host, { key: '
|
2384
|
+
return (h(Host, { key: 'b2086d83295956bff47fd5951056000043a4db72' }, h("div", { key: '1344ce75b7ae023544d0c177d883ba1c6eaed05b', class: "container-border" }, h("calcite-label", { key: 'abbd7a7f1e9dbf94d54ef61a2182b2659d60026e' }, this._translations.groupInfo), this._renderItems(this.sharing))));
|
2385
2385
|
}
|
2386
2386
|
//--------------------------------------------------------------------------
|
2387
2387
|
//
|
@@ -2500,7 +2500,7 @@ const SolutionOrganizationVariables = class {
|
|
2500
2500
|
* Renders the component.
|
2501
2501
|
*/
|
2502
2502
|
render() {
|
2503
|
-
return (h(Host, { key: '
|
2503
|
+
return (h(Host, { key: '387c9a17b83de9f4aa2dc60666e4c45268b7d656' }, h("div", { key: '5181a83dbd700220b8ec55828a37d35fd1406ed1' }, h("h4", { key: '88eea182594f50b86ba873289d84ea0e1b7cc3eb', class: "org-var-header" }, this._translations.orgVariables)), h("div", { key: 'dcbaf3f135d1a6d660e4f17bce722feb6d2fed3e', class: "container-border" }, h("calcite-tree", { key: '4b85c9bd443deb82e570e58ae59c546d8ea9d36d', id: "variable-label" }, this._renderHierarchy(this._organizationVariables)))));
|
2504
2504
|
}
|
2505
2505
|
//--------------------------------------------------------------------------
|
2506
2506
|
//
|
@@ -2598,7 +2598,7 @@ const SolutionResourceItem = class {
|
|
2598
2598
|
*/
|
2599
2599
|
render() {
|
2600
2600
|
const hasValidResources = this._hasValidResources();
|
2601
|
-
return (h(Host, { key: '
|
2601
|
+
return (h(Host, { key: '3209042541d0df8440c8ae7b1564ddad9adb4466' }, h("div", { key: '11d0ad8b5ad181a4db7836e9f3f05fa3e79b924b', class: "resource-item" }, h("div", { key: '1b768c980d3679dd8ce0557cd24c18ab397cac16', class: "margin-bottom-1" }, h("calcite-button", { key: '33a827d3df40e68d985a0f6f8c9fdfb89b78ef25', appearance: "solid", class: "resource-button", color: "blue", onClick: () => this._addNewResource() }, this._translations.addResource), h("calcite-button", { key: '22adce285d7eb9c5fb5a189b0bee43cd25eb89a3', appearance: "solid", color: "blue", disabled: !hasValidResources, onClick: () => this._downloadAll() }, this._translations.downloadAll)), h("div", { key: '20b41623ed7ab10202a5ea929b9ddd63b62d0c0e', class: "resources-container", style: { display: hasValidResources ? "inherit" : "none" } }, this._renderResourceList()))));
|
2602
2602
|
}
|
2603
2603
|
_removedResources = {};
|
2604
2604
|
//--------------------------------------------------------------------------
|
@@ -2880,7 +2880,7 @@ const SolutionTemplateData = class {
|
|
2880
2880
|
* Renders the component.
|
2881
2881
|
*/
|
2882
2882
|
render() {
|
2883
|
-
return (h(Host, { key: '
|
2883
|
+
return (h(Host, { key: '2ac01aadffbe8719d947d3258721a24e79c5827a' }, h("div", { key: '8576d2c273b557393ae9c959817c3a1803000ca6', class: "solution-data-container" }, h("calcite-shell", { key: '7962b2da3ebce8428119e95dee13a79fb06a71ca', class: "light var-container", dir: "ltr" }, h("calcite-panel", { key: '49c9e36a219e8f09431f88b7e698bd53bc538e43', class: "json-editor" }, h("div", { key: 'ef96fb9a8d9bced4a36dca4786b7c77f06bd3dc7', class: "solution-data-child-container calcite-match-height" }, h("json-editor", { key: 'f8e1662a22f6b36e0be929aec00c539508527a81', class: "solution-data-editor-container", instanceid: this.itemId + "|" + this.instanceid, value: this.value }))), h("calcite-shell-panel", { key: '853f9c2df14fe53cc305b290cd1e5b9a8f694b4d', "height-scale": "l", position: "end", slot: "contextual-panel", "width-scale": "xs" }, h("div", { key: '0bc3d510ba7dc9d4ca1339bf6d5fa1a52c249723', class: this.varsOpen ? "solution-data-child-container" : "solution-data-child-container-collapsed" }, h("calcite-button", { key: '2c316175ebe7bdbd4911abbdd58c2bcac8c6e39c', appearance: "transparent", class: "collapse-btn", "icon-start": this.varsOpen ? "chevrons-right" : "chevrons-left", id: "collapse-vars", onClick: () => this._toggleVars(), scale: "s", title: this.varsOpen ? this._translations.collapse : this._translations.expand }), h("div", { key: 'e436c6dba30492a9eda496c4da41a7632cc03232', class: this.varsOpen ? "org-vars" : "org-vars display-none", id: "orgVars" }, h("solution-organization-variables", { key: '4956e3bf41676ccf3dd0168f6f4f573f14927110', value: this.organizationVariables })), h("div", { key: '3376d0034d66f01cd78d01adf5653aeeca63b47f', class: this.varsOpen ? "sol-vars" : "sol-vars display-none", id: "solVars" }, h("solution-variables", { key: 'bb3978deedbe0a439d85d1bb7a8d26380e226dd7', value: this.solutionVariables }))))))));
|
2884
2884
|
}
|
2885
2885
|
_initializing = false;
|
2886
2886
|
//--------------------------------------------------------------------------
|
@@ -2954,7 +2954,7 @@ const SolutionVariables = class {
|
|
2954
2954
|
* Renders the component.
|
2955
2955
|
*/
|
2956
2956
|
render() {
|
2957
|
-
return (h(Host, { key: '
|
2957
|
+
return (h(Host, { key: '207eba2b3a7c2ae6958bc253c50a30ba05e4ad53' }, h("div", { key: '258351a67b1ffac4ce9290bdbc7a15fe045e1cf8' }, h("h4", { key: 'e8b6c6ff6b78d2ee885f352069426a79e12a4376', class: "org-var-header" }, this._translations.solVariables)), h("div", { key: 'e68c85b552c5313300250d4e7a29aee50e3d070d', class: "container-border" }, h("calcite-tree", { key: '011383a8abb007bd6d7a59f6a7681f24fc32d3b0', id: "variable-label" }, this._renderHierarchy(this._solutionVariables)))));
|
2958
2958
|
}
|
2959
2959
|
//--------------------------------------------------------------------------
|
2960
2960
|
//
|
@@ -610,7 +610,7 @@ const SolutionItemIcon = class {
|
|
610
610
|
* Renders the component.
|
611
611
|
*/
|
612
612
|
render() {
|
613
|
-
return h("div", { key: '
|
613
|
+
return h("div", { key: '3a30434531363d13bcc0207dbc90f1ee32454113', title: this.type }, h("img", { key: '8ae2eaaeaa00bb86aed97665036fdb1edd14b6be', class: "item-type-icon item-type-icon-margin", height: "16", src: this._getIconUrl(this.type, this.typeKeywords), width: "16" }));
|
614
614
|
}
|
615
615
|
//--------------------------------------------------------------------------
|
616
616
|
//
|
@@ -3,9 +3,9 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import { r as registerInstance, g as getElement, h, H as Host, c as createEvent } from './index-e3f04fa1.js';
|
6
|
+
import { r as registerInstance, g as getElement, h, H as Host, c as createEvent, F as Fragment } from './index-e3f04fa1.js';
|
7
7
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-7162b55a.js';
|
8
|
-
import {
|
8
|
+
import { g as getLayerOrTable, q as queryFeaturesByID, e as goToSelection, f as queryAllIds, i as queryAllOidsWithQueryFeatures, j as queryFeaturesByGlobalID, c as getFeatureLayerView } from './mapViewUtils-3e3d33ea.js';
|
9
9
|
import { d as downloadCSV } from './downloadUtils-16c51b10.js';
|
10
10
|
import './esri-loader-c6842c6b.js';
|
11
11
|
import './_commonjsHelpers-089957fe.js';
|
@@ -24,6 +24,7 @@ const CardManager = class {
|
|
24
24
|
this.layer = undefined;
|
25
25
|
this.mapView = undefined;
|
26
26
|
this.zoomAndScrollToSelected = undefined;
|
27
|
+
this.selectedFeaturesIds = undefined;
|
27
28
|
this._cardLoading = false;
|
28
29
|
this._graphics = undefined;
|
29
30
|
this._translations = undefined;
|
@@ -49,12 +50,7 @@ const CardManager = class {
|
|
49
50
|
*/
|
50
51
|
async featureSelectionChange(evt) {
|
51
52
|
const ids = evt.detail;
|
52
|
-
this.
|
53
|
-
// only query if we have some ids...query with no ids will result in all features being returned
|
54
|
-
const featureSet = ids.length > 0 ? await queryFeaturesByID(ids, this.layer, [], false, this.mapView.spatialReference) : [];
|
55
|
-
// https://github.com/Esri/solutions-components/issues/365
|
56
|
-
this._graphics = featureSet.sort((a, b) => ids.indexOf(a.getObjectId()) - ids.indexOf(b.getObjectId()));
|
57
|
-
this._cardLoading = false;
|
53
|
+
this._graphics = await this._getFeaturesByIds(ids);
|
58
54
|
}
|
59
55
|
/**
|
60
56
|
* Get the layer view for the provided layer id
|
@@ -75,6 +71,9 @@ const CardManager = class {
|
|
75
71
|
*/
|
76
72
|
async componentWillLoad() {
|
77
73
|
await this._getTranslations();
|
74
|
+
if (this.selectedFeaturesIds?.length > 0) {
|
75
|
+
this._graphics = await this._getFeaturesByIds(this.selectedFeaturesIds);
|
76
|
+
}
|
78
77
|
}
|
79
78
|
/**
|
80
79
|
* Renders the component.
|
@@ -82,13 +81,25 @@ const CardManager = class {
|
|
82
81
|
render() {
|
83
82
|
const featuresClass = this._graphics?.length > 0 ? "" : "display-none";
|
84
83
|
const messageClass = this._graphics?.length > 0 ? "display-none" : "";
|
85
|
-
return (h(Host, { key: '
|
84
|
+
return (h(Host, { key: '0309205d485d9c7a5c558b3619a6c5ac03fcb528' }, h("div", { key: 'a5d291f6073b0e0a918573549c6eb29fe1d892dd', class: "overflow-auto height-full" }, h("calcite-shell", { key: '572b9cdf002e0c8c46e6c4bc5e2f1f8494228e93', class: "position-relative " + featuresClass }, h("div", { key: 'f8ba07deb9786d64f3d25011ff66ead43d809bf1' }, h("info-card", { key: '6eda3ab2cfa2e5fb948f5a7ddaeb6b9022aa5543', enableEditGeometry: this.enableEditGeometry, graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), h("calcite-shell", { key: 'f32d9cfe3a41bbd7d58cdc732c8abe99b232beb7', class: "position-relative " + messageClass }, h("div", { key: 'b97eb023c5d57a4a8dda09467d8599166da40f3c', class: "padding-1" }, h("calcite-notice", { key: '23a204782bd254909e3ab803a944d10004e4954a', icon: "table", open: true }, h("div", { key: 'ea25078647612b8fa40e26b4474a91c853dae126', slot: "message" }, this._translations.selectFeaturesToStart)))))));
|
86
85
|
}
|
87
86
|
//--------------------------------------------------------------------------
|
88
87
|
//
|
89
88
|
// Functions (protected)
|
90
89
|
//
|
91
90
|
//--------------------------------------------------------------------------
|
91
|
+
/**
|
92
|
+
* Gets the Feature using its ids
|
93
|
+
*
|
94
|
+
* @returns Promise when complete
|
95
|
+
* @protected
|
96
|
+
*/
|
97
|
+
async _getFeaturesByIds(ids) {
|
98
|
+
// only query if we have some ids...query with no ids will result in all features being returned
|
99
|
+
const featureSet = ids.length > 0 ? await queryFeaturesByID(ids, this.layer, [], false, this.mapView.spatialReference) : [];
|
100
|
+
// https://github.com/Esri/solutions-components/issues/365
|
101
|
+
return featureSet.sort((a, b) => ids.indexOf(a.getObjectId()) - ids.indexOf(b.getObjectId()));
|
102
|
+
}
|
92
103
|
/**
|
93
104
|
* Fetches the component's translations
|
94
105
|
*
|
@@ -109,6 +120,7 @@ const LayerTable = class {
|
|
109
120
|
constructor(hostRef) {
|
110
121
|
registerInstance(this, hostRef);
|
111
122
|
this.featureSelectionChange = createEvent(this, "featureSelectionChange", 7);
|
123
|
+
this.toggleFilter = createEvent(this, "toggleFilter", 7);
|
112
124
|
this.defaultGlobalId = undefined;
|
113
125
|
this.defaultLayerId = undefined;
|
114
126
|
this.defaultOid = undefined;
|
@@ -128,6 +140,7 @@ const LayerTable = class {
|
|
128
140
|
this.showNewestFirst = undefined;
|
129
141
|
this.zoomAndScrollToSelected = undefined;
|
130
142
|
this.zoomToScale = undefined;
|
143
|
+
this.createFilterModal = true;
|
131
144
|
this._allIds = [];
|
132
145
|
this._controlsThatFit = undefined;
|
133
146
|
this._csvExporting = false;
|
@@ -379,7 +392,9 @@ const LayerTable = class {
|
|
379
392
|
*/
|
380
393
|
async mapInfoWatchHandler() {
|
381
394
|
this._resetColumnTemplates();
|
382
|
-
this.
|
395
|
+
if (this.createFilterModal) {
|
396
|
+
this._initLayerExpressions();
|
397
|
+
}
|
383
398
|
this._initToolInfos();
|
384
399
|
this._updateToolbar();
|
385
400
|
await this._sortTable();
|
@@ -409,7 +424,9 @@ const LayerTable = class {
|
|
409
424
|
this._floorField = this._layer.floorInfo?.floorField;
|
410
425
|
this._updateFloorDefinitionExpression();
|
411
426
|
await this._resetTable();
|
412
|
-
this.
|
427
|
+
if (this.createFilterModal) {
|
428
|
+
this._initLayerExpressions();
|
429
|
+
}
|
413
430
|
this._updateShareUrl();
|
414
431
|
this._fetchingData = false;
|
415
432
|
});
|
@@ -433,6 +450,30 @@ const LayerTable = class {
|
|
433
450
|
// Methods (public)
|
434
451
|
//
|
435
452
|
//--------------------------------------------------------------------------
|
453
|
+
/**
|
454
|
+
* Reset the filter
|
455
|
+
*/
|
456
|
+
async filterReset() {
|
457
|
+
void this._handleFilterListReset();
|
458
|
+
}
|
459
|
+
/**
|
460
|
+
* Updates the filter
|
461
|
+
*/
|
462
|
+
async filterUpdate() {
|
463
|
+
this._handleFilterUpdate();
|
464
|
+
}
|
465
|
+
/**
|
466
|
+
* Closes the filter
|
467
|
+
*/
|
468
|
+
async closeFilter() {
|
469
|
+
await this._closeFilter();
|
470
|
+
}
|
471
|
+
/**
|
472
|
+
* refresh the feature table
|
473
|
+
*/
|
474
|
+
async refresh() {
|
475
|
+
await this._refresh();
|
476
|
+
}
|
436
477
|
//--------------------------------------------------------------------------
|
437
478
|
//
|
438
479
|
// Events (public)
|
@@ -442,6 +483,10 @@ const LayerTable = class {
|
|
442
483
|
* Emitted on demand when a layer is selected
|
443
484
|
*/
|
444
485
|
featureSelectionChange;
|
486
|
+
/**
|
487
|
+
* Emitted on demand when filter action is clicked
|
488
|
+
*/
|
489
|
+
toggleFilter;
|
445
490
|
/**
|
446
491
|
* Scroll and zoom to the selected feature from the Features widget.
|
447
492
|
*
|
@@ -473,6 +518,14 @@ const LayerTable = class {
|
|
473
518
|
}
|
474
519
|
}
|
475
520
|
}
|
521
|
+
/**
|
522
|
+
* Handles layer selection change to show new table
|
523
|
+
*
|
524
|
+
* @param evt CustomEvent the id for the current layer
|
525
|
+
*/
|
526
|
+
async layerSelectionChange(evt) {
|
527
|
+
await this._layerSelectionChanged(evt);
|
528
|
+
}
|
476
529
|
/**
|
477
530
|
* Refresh the table when edits are completed
|
478
531
|
*/
|
@@ -540,9 +593,9 @@ const LayerTable = class {
|
|
540
593
|
const selected = this.selectedIds.length.toString();
|
541
594
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
542
595
|
this._validateActiveActions();
|
543
|
-
return (h(Host, { key: '
|
596
|
+
return (h(Host, { key: '17071727cb283d84afb8beab8382bd3623f35920' }, h("calcite-shell", { key: 'f8508d67fd4b100fdc3f52b7db63194714cf216b' }, this._getTableControlRow("header"), h("div", { key: '5c1ebcb0530764a9568dc5dae153632a3d9491c8', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '7a6420894e4e50e2b4cda6e5ebe043134f4c0397', class: "height-full width-full" }, h("calcite-loader", { key: '48d4fe7e27fae877ca0e4caa22555968636f6c33', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: 'cce71356e8ca141d1a18b32944d4fa03af8aae33', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
544
597
|
.replace("{{total}}", total)
|
545
|
-
.replace("{{selected}}", selected))) : undefined)), this._filterModal()));
|
598
|
+
.replace("{{selected}}", selected))) : undefined)), this.createFilterModal && this._filterModal()));
|
546
599
|
}
|
547
600
|
/**
|
548
601
|
* Called once after the component is loaded
|
@@ -611,7 +664,7 @@ const LayerTable = class {
|
|
611
664
|
_getActionBar() {
|
612
665
|
const containerClass = this.isMobile ? "width-full" : "";
|
613
666
|
const mobileClass = this.isMobile ? "border-top" : "";
|
614
|
-
return (h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView,
|
667
|
+
return (h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", selectedIds: this._layer ? [this._layer?.id] : [], showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), !this.isMobile ? this._getActions() : undefined));
|
615
668
|
}
|
616
669
|
/**
|
617
670
|
* Get the actions that are used for various interactions with the table
|
@@ -656,15 +709,19 @@ const LayerTable = class {
|
|
656
709
|
*/
|
657
710
|
_validateEnabledActions() {
|
658
711
|
const featuresSelected = this._featuresSelected();
|
712
|
+
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate;
|
659
713
|
const selectionDependant = [
|
660
714
|
"zoom-to-object",
|
715
|
+
"pencil",
|
661
716
|
"trash",
|
662
717
|
"erase",
|
663
718
|
"selected-items-filter"
|
664
719
|
];
|
665
720
|
this._toolInfos?.forEach(ti => {
|
666
721
|
if (ti && selectionDependant.indexOf(ti.icon) > -1) {
|
667
|
-
|
722
|
+
// disable the pencil icon if multiple features are not selected
|
723
|
+
// For other icons disable them if any feature is not selected
|
724
|
+
ti.disabled = ti.icon === "pencil" ? !showMultipleEdits : !featuresSelected;
|
668
725
|
}
|
669
726
|
});
|
670
727
|
}
|
@@ -698,6 +755,7 @@ const LayerTable = class {
|
|
698
755
|
*/
|
699
756
|
_initToolInfos() {
|
700
757
|
const featuresSelected = this._featuresSelected();
|
758
|
+
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate;
|
701
759
|
const featuresEmpty = this._featuresEmpty();
|
702
760
|
const hasFilterExpressions = this._hasFilterExpressions();
|
703
761
|
if (this._translations) {
|
@@ -716,10 +774,20 @@ const LayerTable = class {
|
|
716
774
|
icon: "filter",
|
717
775
|
indicator: false,
|
718
776
|
label: this._translations.filters,
|
719
|
-
func: () => this._toggleFilter(),
|
777
|
+
func: () => this.createFilterModal ? this._toggleFilter() : this.toggleFilter.emit(),
|
720
778
|
disabled: false,
|
721
779
|
isOverflow: false
|
722
780
|
} : undefined,
|
781
|
+
!this.mapHidden ? {
|
782
|
+
active: false,
|
783
|
+
icon: "pencil",
|
784
|
+
indicator: false,
|
785
|
+
label: this._translations.editMultiple,
|
786
|
+
func: () => alert(this._translations.editMultiple),
|
787
|
+
disabled: !showMultipleEdits,
|
788
|
+
isOverflow: false,
|
789
|
+
isSublist: false
|
790
|
+
} : undefined,
|
723
791
|
this._deleteEnabled ? {
|
724
792
|
active: undefined,
|
725
793
|
icon: "trash",
|
@@ -904,7 +972,7 @@ const LayerTable = class {
|
|
904
972
|
_setControlsThatFit(controlsThatFit, skipControls) {
|
905
973
|
let update = JSON.stringify(controlsThatFit) !== JSON.stringify(this._controlsThatFit);
|
906
974
|
const actionbar = document.getElementById("solutions-action-bar");
|
907
|
-
actionbar
|
975
|
+
actionbar?.childNodes?.forEach((n) => {
|
908
976
|
if (skipControls.indexOf(n.id) < 0 && !update) {
|
909
977
|
update = this._controlsThatFit.map(c => c.id).indexOf(n.id) < 0;
|
910
978
|
}
|
@@ -1794,7 +1862,7 @@ function joinAppProxies(map, config, appProxies) {
|
|
1794
1862
|
return map;
|
1795
1863
|
}
|
1796
1864
|
|
1797
|
-
const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";
|
1865
|
+
const mapCardCss = ":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.height-50-px{height:50px}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";
|
1798
1866
|
const MapCardStyle0 = mapCardCss;
|
1799
1867
|
|
1800
1868
|
const MapCard = class {
|
@@ -1802,8 +1870,10 @@ const MapCard = class {
|
|
1802
1870
|
registerInstance(this, hostRef);
|
1803
1871
|
this.mapChanged = createEvent(this, "mapChanged", 7);
|
1804
1872
|
this.beforeMapChanged = createEvent(this, "beforeMapChanged", 7);
|
1873
|
+
this.toggleFilter = createEvent(this, "toggleFilter", 7);
|
1805
1874
|
this.appProxies = undefined;
|
1806
1875
|
this.defaultWebmapId = "";
|
1876
|
+
this.defaultLayerId = undefined;
|
1807
1877
|
this.enableHome = undefined;
|
1808
1878
|
this.enableLegend = undefined;
|
1809
1879
|
this.enableFloorFilter = undefined;
|
@@ -1824,8 +1894,17 @@ const MapCard = class {
|
|
1824
1894
|
this.stackTools = true;
|
1825
1895
|
this.theme = undefined;
|
1826
1896
|
this.toolOrder = undefined;
|
1897
|
+
this.isMapLayout = undefined;
|
1898
|
+
this.selectedFeaturesIds = undefined;
|
1899
|
+
this.selectedLayer = undefined;
|
1900
|
+
this.zoomToScale = undefined;
|
1901
|
+
this.onlyShowUpdatableLayers = undefined;
|
1902
|
+
this.isMobile = undefined;
|
1903
|
+
this.mapInfo = undefined;
|
1904
|
+
this._translations = undefined;
|
1827
1905
|
this._searchConfiguration = undefined;
|
1828
1906
|
this._webMapInfo = undefined;
|
1907
|
+
this._showHideOpen = false;
|
1829
1908
|
}
|
1830
1909
|
get el() { return getElement(this); }
|
1831
1910
|
//--------------------------------------------------------------------------
|
@@ -1873,6 +1952,22 @@ const MapCard = class {
|
|
1873
1952
|
* HTMLMapToolsElement: the container div for the map tools
|
1874
1953
|
*/
|
1875
1954
|
_mapTools;
|
1955
|
+
/**
|
1956
|
+
* HTMLCalciteDropdownElement: Dropdown the will support overflow tools that won't fit in the current display
|
1957
|
+
*/
|
1958
|
+
_moreDropdown;
|
1959
|
+
/**
|
1960
|
+
* boolean: When true the show/hide fields list is forced open
|
1961
|
+
*/
|
1962
|
+
_mapListExpanded = false;
|
1963
|
+
/**
|
1964
|
+
* boolean: When true an indicator will be shown on the action
|
1965
|
+
*/
|
1966
|
+
_filterActive = false;
|
1967
|
+
/**
|
1968
|
+
* string: The current layers definition expression
|
1969
|
+
*/
|
1970
|
+
_definitionExpression;
|
1876
1971
|
//--------------------------------------------------------------------------
|
1877
1972
|
//
|
1878
1973
|
// Watch handlers
|
@@ -1884,11 +1979,31 @@ const MapCard = class {
|
|
1884
1979
|
enableHomeWatchHandler() {
|
1885
1980
|
this._initHome();
|
1886
1981
|
}
|
1982
|
+
/**
|
1983
|
+
* watch for changes in layer view and verify if it has editing enabled
|
1984
|
+
*/
|
1985
|
+
async selectedLayerWatchHandler() {
|
1986
|
+
await this.selectedLayer?.when(async () => {
|
1987
|
+
this._definitionExpression = this.selectedLayer.definitionExpression;
|
1988
|
+
});
|
1989
|
+
}
|
1887
1990
|
//--------------------------------------------------------------------------
|
1888
1991
|
//
|
1889
1992
|
// Methods (public)
|
1890
1993
|
//
|
1891
1994
|
//--------------------------------------------------------------------------
|
1995
|
+
/**
|
1996
|
+
* Reset the filter
|
1997
|
+
*/
|
1998
|
+
async filterReset() {
|
1999
|
+
this._filterActive = false;
|
2000
|
+
}
|
2001
|
+
/**
|
2002
|
+
* updates the filter
|
2003
|
+
*/
|
2004
|
+
async updateFilter() {
|
2005
|
+
this._filterActive = this._definitionExpression !== this.selectedLayer.definitionExpression;
|
2006
|
+
}
|
1892
2007
|
//--------------------------------------------------------------------------
|
1893
2008
|
//
|
1894
2009
|
// Events (public)
|
@@ -1902,12 +2017,23 @@ const MapCard = class {
|
|
1902
2017
|
* Emitted before a new map is loaded
|
1903
2018
|
*/
|
1904
2019
|
beforeMapChanged;
|
2020
|
+
/**
|
2021
|
+
* Emitted on demand when filter action is clicked
|
2022
|
+
*/
|
2023
|
+
toggleFilter;
|
1905
2024
|
/**
|
1906
2025
|
* Listen for changes to map info and load the appropriate map
|
1907
2026
|
*/
|
1908
2027
|
async mapInfoChange(evt) {
|
1909
2028
|
await this._loadMap(evt.detail);
|
1910
2029
|
}
|
2030
|
+
/**
|
2031
|
+
* Listen for change when mapview doesn't contain any layer
|
2032
|
+
*/
|
2033
|
+
noLayersFound() {
|
2034
|
+
this.selectedLayer = undefined;
|
2035
|
+
this.selectedFeaturesIds = [];
|
2036
|
+
}
|
1911
2037
|
//--------------------------------------------------------------------------
|
1912
2038
|
//
|
1913
2039
|
// Functions (lifecycle)
|
@@ -1917,17 +2043,28 @@ const MapCard = class {
|
|
1917
2043
|
* StencilJS: Called once just after the component is first connected to the DOM.
|
1918
2044
|
*/
|
1919
2045
|
async componentWillLoad() {
|
2046
|
+
await this._getTranslations();
|
1920
2047
|
await this._initModules();
|
1921
2048
|
}
|
1922
2049
|
/**
|
1923
2050
|
* Renders the component.
|
1924
2051
|
*/
|
1925
2052
|
render() {
|
2053
|
+
const mapContainerClass = this.isMapLayout ? "display-flex height-50-px" : "";
|
1926
2054
|
const mapClass = this.hidden ? "visibility-hidden-1" : "";
|
1927
2055
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
1928
2056
|
const mapPickerClass = this.mapInfos?.length > 1 ? "" : "display-none";
|
1929
2057
|
const mapHeightClass = this.mapInfos?.length > 1 ? "map-height" : "height-full";
|
1930
|
-
|
2058
|
+
const containerClass = this.isMobile ? "width-full" : "";
|
2059
|
+
const mobileClass = this.isMobile ? "border-top" : "";
|
2060
|
+
const headerElements = this.isMapLayout ? "" : "display-none";
|
2061
|
+
return (h(Host, { key: '7029e518173a8c1e6e00049b8e68e23bed23d9cb' }, h("div", { key: '2b8d9197dcb68529562728fddeb53d0a7e9cbb86', class: `${mapContainerClass}` }, h("map-picker", { key: '2e50b7c70832f4151fafd06e860846a5efa8f6f1', class: mapPickerClass, isMapLayout: this.isMapLayout, mapInfos: this.mapInfos, ref: (el) => this._mapPicker = el }), h("div", { key: 'bc01ef7fb34400e3ff58151cab6abbabd9fa8a6f', class: `mapView-header display-flex ${headerElements}` }, h("div", { key: '1f1bf6ffb92fbc182be8333b4ae3d70271ea2f1b', class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, this.mapView && h("map-layer-picker", { key: '47320f3794f060262c4ed29ec1400a50d9744a97', appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView, onlyShowUpdatableLayers: this.onlyShowUpdatableLayers, placeholderIcon: "layers", scale: "l", selectedIds: this.selectedLayer ? [this.selectedLayer.id] : [], showSingleLayerAsLabel: true, showTables: true, type: "dropdown" })), this._getDropDownItem())), h("div", { key: '7101bfed6c0e0932275b0d28eea0ea5e1603aa8e', class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), h("map-tools", { key: '8ca28e50a77a25699cd6c17fe4f31788ca1cb49d', basemapConfig: this.basemapConfig, class: `box-shadow ${themeClass}`, enableBasemap: this.enableBasemap, enableFloorFilter: this.enableFloorFilter, enableFullscreen: this.enableFullscreen, enableHome: this.enableHome, enableLegend: this.enableLegend, enableSearch: this.enableSearch, enableSingleExpand: this.enableSingleExpand, homeZoomToolsSize: this.homeZoomToolsSize, mapView: this.mapView, mapWidgetsSize: this.mapWidgetsSize, position: this.mapWidgetsPosition, ref: (el) => this._mapTools = el, searchConfiguration: this._searchConfiguration, stackTools: this.stackTools, toolOrder: this.toolOrder })));
|
2062
|
+
}
|
2063
|
+
/**
|
2064
|
+
* Called each time after the component is loaded
|
2065
|
+
*/
|
2066
|
+
async componentDidRender() {
|
2067
|
+
document.onclick = (e) => this._handleDocumentClick(e);
|
1931
2068
|
}
|
1932
2069
|
//--------------------------------------------------------------------------
|
1933
2070
|
//
|
@@ -2026,8 +2163,99 @@ const MapCard = class {
|
|
2026
2163
|
this.mapView.ui.remove(this._homeWidget);
|
2027
2164
|
}
|
2028
2165
|
}
|
2166
|
+
/**
|
2167
|
+
* Toggle show/hide dropdown
|
2168
|
+
*/
|
2169
|
+
_toggleShowHide() {
|
2170
|
+
this._showHideOpen = !this._showHideOpen;
|
2171
|
+
}
|
2172
|
+
/**
|
2173
|
+
* Open show/hide dropdown
|
2174
|
+
*/
|
2175
|
+
_forceShowHide() {
|
2176
|
+
if (this._moreDropdown) {
|
2177
|
+
this._moreDropdown.open = this._showHideOpen;
|
2178
|
+
}
|
2179
|
+
}
|
2180
|
+
/**
|
2181
|
+
* Close show/hide dropdown when the user clicks outside of it
|
2182
|
+
*/
|
2183
|
+
_handleDocumentClick(e) {
|
2184
|
+
const id = e.target?.id;
|
2185
|
+
if (this._showHideOpen && id !== "solutions-subset-list" && id !== "solutions-more" && id !== "chevron-down") {
|
2186
|
+
if (this._moreDropdown) {
|
2187
|
+
this._showHideOpen = false;
|
2188
|
+
this._moreDropdown.open = false;
|
2189
|
+
}
|
2190
|
+
}
|
2191
|
+
// if clicked on map picker then toggle the dropdown
|
2192
|
+
if (e.target.tagName === 'MAP-PICKER') {
|
2193
|
+
this._mapListExpanded = !this._mapListExpanded;
|
2194
|
+
void this._mapPicker.toggle(this._mapListExpanded);
|
2195
|
+
}
|
2196
|
+
// if clicked on other place then just close the dropdown
|
2197
|
+
if (e.target.tagName !== 'MAP-PICKER') {
|
2198
|
+
this._mapListExpanded = false;
|
2199
|
+
void this._mapPicker.close();
|
2200
|
+
}
|
2201
|
+
}
|
2202
|
+
/**
|
2203
|
+
* Zoom to all selected features
|
2204
|
+
*
|
2205
|
+
* @returns a promise that will resolve when the operation is complete
|
2206
|
+
*/
|
2207
|
+
async _zoom() {
|
2208
|
+
if (this.selectedLayer) {
|
2209
|
+
const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayer.id);
|
2210
|
+
await goToSelection(this.selectedFeaturesIds, selectedLayerView, this.mapView, true, undefined, this.zoomToScale);
|
2211
|
+
}
|
2212
|
+
}
|
2213
|
+
async _toggleFilter() {
|
2214
|
+
this.toggleFilter.emit();
|
2215
|
+
}
|
2216
|
+
/**
|
2217
|
+
* Return true when we have at least 1 layer expression for the current layer
|
2218
|
+
*
|
2219
|
+
* @returns boolean
|
2220
|
+
*/
|
2221
|
+
_hasFilterExpressions() {
|
2222
|
+
let layerExpressions;
|
2223
|
+
if (this.mapInfo?.filterConfig?.layerExpressions && this.selectedLayer?.id) {
|
2224
|
+
layerExpressions = this.mapInfo.filterConfig.layerExpressions.filter((exp) => exp.id === this.selectedLayer.id);
|
2225
|
+
}
|
2226
|
+
return layerExpressions?.length > 0;
|
2227
|
+
}
|
2228
|
+
/**
|
2229
|
+
* Get Dropdown action item
|
2230
|
+
* @returns Dropdown item
|
2231
|
+
*/
|
2232
|
+
_getDropDownItem() {
|
2233
|
+
return (h("calcite-dropdown", { closeOnSelectDisabled: true, disabled: this.selectedLayer === undefined, id: "solutions-more", onCalciteDropdownBeforeClose: () => this._forceShowHide(), ref: (el) => this._moreDropdown = el, widthScale: "l" }, h("calcite-action", { appearance: "solid", id: 'solutions-more', label: "", onClick: () => this._toggleShowHide(), slot: "trigger", text: "" }, h("calcite-button", { appearance: "transparent", iconEnd: this._showHideOpen ? "chevron-up" : "chevron-down", kind: "neutral" }, this._translations.more)), h("calcite-dropdown-group", { selectionMode: "none" }, this._getDropDownItems())));
|
2234
|
+
}
|
2235
|
+
/**
|
2236
|
+
* Gets the dropdown items
|
2237
|
+
* @returns dropdown items
|
2238
|
+
*/
|
2239
|
+
_getDropDownItems() {
|
2240
|
+
const featureSelected = this.selectedFeaturesIds?.length > 0;
|
2241
|
+
const showMultipleEdits = this.selectedFeaturesIds?.length > 1;
|
2242
|
+
const hasFilterExpressions = this._hasFilterExpressions();
|
2243
|
+
return (h(Fragment, null, h("calcite-dropdown-group", { selectionMode: "none" }, h("calcite-dropdown-item", { disabled: !showMultipleEdits, iconStart: "pencil", id: "solutions-subset-list", onClick: () => alert(this._translations.editMultiple) }, this._translations.editMultiple)), h("calcite-dropdown-group", { selectionMode: "none" }, h("calcite-dropdown-item", { iconStart: "refresh", id: "solutions-subset-list", onClick: () => { this.selectedLayer.refresh(); } }, this._translations.refresh)), h("calcite-dropdown-group", { selectionMode: "none" }, h("calcite-dropdown-item", { disabled: !featureSelected, iconStart: "zoom-to-object", id: "solutions-subset-list", onClick: this._zoom.bind(this) }, this._translations.zoom)), hasFilterExpressions &&
|
2244
|
+
h("calcite-dropdown-group", null, h("calcite-dropdown-item", { disabled: false, iconStart: "filter", id: "solutions-subset-list", onClick: this._toggleFilter.bind(this), selected: this._filterActive }, this._translations.filters))));
|
2245
|
+
}
|
2246
|
+
/**
|
2247
|
+
* Fetches the component's translations
|
2248
|
+
*
|
2249
|
+
* @returns Promise when complete
|
2250
|
+
* @protected
|
2251
|
+
*/
|
2252
|
+
async _getTranslations() {
|
2253
|
+
const messages = await getLocaleComponentStrings(this.el);
|
2254
|
+
this._translations = messages[0];
|
2255
|
+
}
|
2029
2256
|
static get watchers() { return {
|
2030
|
-
"enableHome": ["enableHomeWatchHandler"]
|
2257
|
+
"enableHome": ["enableHomeWatchHandler"],
|
2258
|
+
"selectedLayer": ["selectedLayerWatchHandler"]
|
2031
2259
|
}; }
|
2032
2260
|
};
|
2033
2261
|
MapCard.style = MapCardStyle0;
|