@esri/solutions-components 0.10.6 → 0.10.8
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 +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 +169 -49
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -1
- package/dist/cjs/instant-apps-time-filter.cjs.entry.js +40 -21
- 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 +173 -65
- 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 +172 -53
- package/dist/components/instant-apps-control-panel.js +2 -1
- package/dist/components/instant-apps-time-filter.js +46 -23
- 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 +170 -50
- package/dist/esm/instant-apps-control-panel.entry.js +2 -1
- package/dist/esm/instant-apps-time-filter.entry.js +41 -22
- 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-1867168b.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-85c25564.entry.js +6 -0
- package/dist/solutions-components/{p-235bf02e.entry.js → p-913413c3.entry.js} +1 -1
- package/dist/solutions-components/p-9af1cb14.entry.js +6 -0
- package/dist/solutions-components/{p-49aa2929.entry.js → p-bebd4646.entry.js} +1 -1
- package/dist/solutions-components/{p-ab2adcaf.entry.js → p-cc092b22.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 +86 -20
- 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 -0
- package/dist/types/preact.d.ts +4 -2
- package/package.json +2 -2
- 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-72f01088.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
@@ -2207,7 +2207,7 @@ const SolutionItemDetails = class {
|
|
2207
2207
|
* Renders the component.
|
2208
2208
|
*/
|
2209
2209
|
render() {
|
2210
|
-
return (index.h(index.Host, { key: '
|
2210
|
+
return (index.h(index.Host, { key: 'f93ee5d1152024c4c9d4b7376d8e19e5a0ebaccd' }, index.h("div", { key: 'd03106d1566be78c478a8ca798cea04161e835a2', class: "parent-container" }, index.h("div", { key: '78f52543e511e7deecffdc998808fce766863ef3', class: "inputBottomSeparation" }, index.h("calcite-input", { key: '70783f0059d5e526f56a4ff2cff18e20348c4c16', id: "item-title", value: this.itemDetails.title })), index.h("div", { key: 'b2cfc981837ee9fd8549dc62057bc98429f3f50a', class: "inputBottomSeparation" }, index.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" }), index.h("button", { key: '7c2b6882f87d63f97c609c071b60b62474931c93', class: "font-size--3 btn-link inline-block trailer-quarter", onClick: () => this._getThumbnail() }, index.h("svg", { key: 'b530933142b3aa03de26baa33e4be11ea9f4c806', class: "icon-inline icon-inline--on-left", height: "16", viewBox: "0 0 16 16", width: "16" }, index.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), index.h("div", { key: '3906eeaa6bd72d0c53a0e472c3606f0ab879a3d3', class: "flex" }, index.h("div", { key: 'fa88b2ea055748202ed7c34ce7df2cfc9a1592a0', class: "img-container", ref: (el) => (this.thumbnailContainer = el) }, index.h("img", { key: '2b5e960405c8f41a66bdf93f47e669d5eae646ad', class: "scale-down", height: "133", id: "item-thumbnail", ref: (el) => (this.thumbnail = el), width: "200" })), index.h("div", { key: '7762aca4498ef2ca8d70beb59cfc5906229c3e5d', class: "snippet-count-container" }, index.h("calcite-input", { key: '1a6e9e299e551f2c7a3f99395a789fd4e1bf1e88', id: "item-snippet", maxLength: 250, type: "textarea", value: this.itemDetails.snippet }), index.h("label", { key: 'a66a1569c45189e013d230f7d2c11fd315ffaa29', class: "font-size--3", id: "item-snippet-count", ref: (el) => (this.itemSnippetCount = el) })))), index.h("calcite-label", { key: '1befca128558c7b638d86521f162bcbf44e889a1' }, this._translations.description, index.h("label", { key: '496939ec6171b926b8f7d6610fa153a0ee63243c', id: "item-description-label" }, index.h("calcite-input", { key: 'a97b85340d620f4fa909b4b697e058e5398df145', id: "item-description", type: "textarea", value: this.itemDetails.description }))), index.h("calcite-label", { key: 'eecadd422f35b01124dbf9ac8ce030c561f8b76d' }, this._translations.tags, index.h("label", { key: 'be9ba3c1c3e4d3bff74bcaf586cef39a8a5c76f2', id: "item-tags-label" }, index.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" ? index.h("calcite-label", null, this._translations.credits, index.h("label", { id: "item-credits-label" }, index.h("calcite-input", { id: "item-credits", value: this.itemDetails.accessInformation }))) : null, this.itemType !== "Group" ? index.h("calcite-label", null, index.h("label", { id: "item-terms-label" }, this._translations.termsOfUse, index.h("calcite-input", { id: "item-terms", type: "textarea", value: this.itemDetails.licenseInfo }))) : null)));
|
2211
2211
|
}
|
2212
2212
|
componentDidRender() {
|
2213
2213
|
this._loadThumb();
|
@@ -2385,7 +2385,7 @@ const SolutionItemSharing = class {
|
|
2385
2385
|
* Renders the component.
|
2386
2386
|
*/
|
2387
2387
|
render() {
|
2388
|
-
return (index.h(index.Host, { key: '
|
2388
|
+
return (index.h(index.Host, { key: 'b2086d83295956bff47fd5951056000043a4db72' }, index.h("div", { key: '1344ce75b7ae023544d0c177d883ba1c6eaed05b', class: "container-border" }, index.h("calcite-label", { key: 'abbd7a7f1e9dbf94d54ef61a2182b2659d60026e' }, this._translations.groupInfo), this._renderItems(this.sharing))));
|
2389
2389
|
}
|
2390
2390
|
//--------------------------------------------------------------------------
|
2391
2391
|
//
|
@@ -2504,7 +2504,7 @@ const SolutionOrganizationVariables = class {
|
|
2504
2504
|
* Renders the component.
|
2505
2505
|
*/
|
2506
2506
|
render() {
|
2507
|
-
return (index.h(index.Host, { key: '
|
2507
|
+
return (index.h(index.Host, { key: '387c9a17b83de9f4aa2dc60666e4c45268b7d656' }, index.h("div", { key: '5181a83dbd700220b8ec55828a37d35fd1406ed1' }, index.h("h4", { key: '88eea182594f50b86ba873289d84ea0e1b7cc3eb', class: "org-var-header" }, this._translations.orgVariables)), index.h("div", { key: 'dcbaf3f135d1a6d660e4f17bce722feb6d2fed3e', class: "container-border" }, index.h("calcite-tree", { key: '4b85c9bd443deb82e570e58ae59c546d8ea9d36d', id: "variable-label" }, this._renderHierarchy(this._organizationVariables)))));
|
2508
2508
|
}
|
2509
2509
|
//--------------------------------------------------------------------------
|
2510
2510
|
//
|
@@ -2602,7 +2602,7 @@ const SolutionResourceItem = class {
|
|
2602
2602
|
*/
|
2603
2603
|
render() {
|
2604
2604
|
const hasValidResources = this._hasValidResources();
|
2605
|
-
return (index.h(index.Host, { key: '
|
2605
|
+
return (index.h(index.Host, { key: '3209042541d0df8440c8ae7b1564ddad9adb4466' }, index.h("div", { key: '11d0ad8b5ad181a4db7836e9f3f05fa3e79b924b', class: "resource-item" }, index.h("div", { key: '1b768c980d3679dd8ce0557cd24c18ab397cac16', class: "margin-bottom-1" }, index.h("calcite-button", { key: '33a827d3df40e68d985a0f6f8c9fdfb89b78ef25', appearance: "solid", class: "resource-button", color: "blue", onClick: () => this._addNewResource() }, this._translations.addResource), index.h("calcite-button", { key: '22adce285d7eb9c5fb5a189b0bee43cd25eb89a3', appearance: "solid", color: "blue", disabled: !hasValidResources, onClick: () => this._downloadAll() }, this._translations.downloadAll)), index.h("div", { key: '20b41623ed7ab10202a5ea929b9ddd63b62d0c0e', class: "resources-container", style: { display: hasValidResources ? "inherit" : "none" } }, this._renderResourceList()))));
|
2606
2606
|
}
|
2607
2607
|
_removedResources = {};
|
2608
2608
|
//--------------------------------------------------------------------------
|
@@ -2884,7 +2884,7 @@ const SolutionTemplateData = class {
|
|
2884
2884
|
* Renders the component.
|
2885
2885
|
*/
|
2886
2886
|
render() {
|
2887
|
-
return (index.h(index.Host, { key: '
|
2887
|
+
return (index.h(index.Host, { key: '2ac01aadffbe8719d947d3258721a24e79c5827a' }, index.h("div", { key: '8576d2c273b557393ae9c959817c3a1803000ca6', class: "solution-data-container" }, index.h("calcite-shell", { key: '7962b2da3ebce8428119e95dee13a79fb06a71ca', class: "light var-container", dir: "ltr" }, index.h("calcite-panel", { key: '49c9e36a219e8f09431f88b7e698bd53bc538e43', class: "json-editor" }, index.h("div", { key: 'ef96fb9a8d9bced4a36dca4786b7c77f06bd3dc7', class: "solution-data-child-container calcite-match-height" }, index.h("json-editor", { key: 'f8e1662a22f6b36e0be929aec00c539508527a81', class: "solution-data-editor-container", instanceid: this.itemId + "|" + this.instanceid, value: this.value }))), index.h("calcite-shell-panel", { key: '853f9c2df14fe53cc305b290cd1e5b9a8f694b4d', "height-scale": "l", position: "end", slot: "contextual-panel", "width-scale": "xs" }, index.h("div", { key: '0bc3d510ba7dc9d4ca1339bf6d5fa1a52c249723', class: this.varsOpen ? "solution-data-child-container" : "solution-data-child-container-collapsed" }, index.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 }), index.h("div", { key: 'e436c6dba30492a9eda496c4da41a7632cc03232', class: this.varsOpen ? "org-vars" : "org-vars display-none", id: "orgVars" }, index.h("solution-organization-variables", { key: '4956e3bf41676ccf3dd0168f6f4f573f14927110', value: this.organizationVariables })), index.h("div", { key: '3376d0034d66f01cd78d01adf5653aeeca63b47f', class: this.varsOpen ? "sol-vars" : "sol-vars display-none", id: "solVars" }, index.h("solution-variables", { key: 'bb3978deedbe0a439d85d1bb7a8d26380e226dd7', value: this.solutionVariables }))))))));
|
2888
2888
|
}
|
2889
2889
|
_initializing = false;
|
2890
2890
|
//--------------------------------------------------------------------------
|
@@ -2958,7 +2958,7 @@ const SolutionVariables = class {
|
|
2958
2958
|
* Renders the component.
|
2959
2959
|
*/
|
2960
2960
|
render() {
|
2961
|
-
return (index.h(index.Host, { key: '
|
2961
|
+
return (index.h(index.Host, { key: '207eba2b3a7c2ae6958bc253c50a30ba05e4ad53' }, index.h("div", { key: '258351a67b1ffac4ce9290bdbc7a15fe045e1cf8' }, index.h("h4", { key: 'e8b6c6ff6b78d2ee885f352069426a79e12a4376', class: "org-var-header" }, this._translations.solVariables)), index.h("div", { key: 'e68c85b552c5313300250d4e7a29aee50e3d070d', class: "container-border" }, index.h("calcite-tree", { key: '011383a8abb007bd6d7a59f6a7681f24fc32d3b0', id: "variable-label" }, this._renderHierarchy(this._solutionVariables)))));
|
2962
2962
|
}
|
2963
2963
|
//--------------------------------------------------------------------------
|
2964
2964
|
//
|
@@ -614,7 +614,7 @@ const SolutionItemIcon = class {
|
|
614
614
|
* Renders the component.
|
615
615
|
*/
|
616
616
|
render() {
|
617
|
-
return index.h("div", { key: '
|
617
|
+
return index.h("div", { key: '3a30434531363d13bcc0207dbc90f1ee32454113', title: this.type }, index.h("img", { key: '8ae2eaaeaa00bb86aed97665036fdb1edd14b6be', class: "item-type-icon item-type-icon-margin", height: "16", src: this._getIconUrl(this.type, this.typeKeywords), width: "16" }));
|
618
618
|
}
|
619
619
|
//--------------------------------------------------------------------------
|
620
620
|
//
|
@@ -28,6 +28,7 @@ const CardManager = class {
|
|
28
28
|
this.layer = undefined;
|
29
29
|
this.mapView = undefined;
|
30
30
|
this.zoomAndScrollToSelected = undefined;
|
31
|
+
this.selectedFeaturesIds = undefined;
|
31
32
|
this._cardLoading = false;
|
32
33
|
this._graphics = undefined;
|
33
34
|
this._translations = undefined;
|
@@ -53,12 +54,7 @@ const CardManager = class {
|
|
53
54
|
*/
|
54
55
|
async featureSelectionChange(evt) {
|
55
56
|
const ids = evt.detail;
|
56
|
-
this.
|
57
|
-
// only query if we have some ids...query with no ids will result in all features being returned
|
58
|
-
const featureSet = ids.length > 0 ? await mapViewUtils.queryFeaturesByID(ids, this.layer, [], false, this.mapView.spatialReference) : [];
|
59
|
-
// https://github.com/Esri/solutions-components/issues/365
|
60
|
-
this._graphics = featureSet.sort((a, b) => ids.indexOf(a.getObjectId()) - ids.indexOf(b.getObjectId()));
|
61
|
-
this._cardLoading = false;
|
57
|
+
this._graphics = await this._getFeaturesByIds(ids);
|
62
58
|
}
|
63
59
|
/**
|
64
60
|
* Get the layer view for the provided layer id
|
@@ -79,6 +75,9 @@ const CardManager = class {
|
|
79
75
|
*/
|
80
76
|
async componentWillLoad() {
|
81
77
|
await this._getTranslations();
|
78
|
+
if (this.selectedFeaturesIds?.length > 0) {
|
79
|
+
this._graphics = await this._getFeaturesByIds(this.selectedFeaturesIds);
|
80
|
+
}
|
82
81
|
}
|
83
82
|
/**
|
84
83
|
* Renders the component.
|
@@ -86,13 +85,25 @@ const CardManager = class {
|
|
86
85
|
render() {
|
87
86
|
const featuresClass = this._graphics?.length > 0 ? "" : "display-none";
|
88
87
|
const messageClass = this._graphics?.length > 0 ? "display-none" : "";
|
89
|
-
return (index.h(index.Host, { key: '
|
88
|
+
return (index.h(index.Host, { key: '0309205d485d9c7a5c558b3619a6c5ac03fcb528' }, index.h("div", { key: 'a5d291f6073b0e0a918573549c6eb29fe1d892dd', class: "overflow-auto height-full" }, index.h("calcite-shell", { key: '572b9cdf002e0c8c46e6c4bc5e2f1f8494228e93', class: "position-relative " + featuresClass }, index.h("div", { key: 'f8ba07deb9786d64f3d25011ff66ead43d809bf1' }, index.h("info-card", { key: '6eda3ab2cfa2e5fb948f5a7ddaeb6b9022aa5543', enableEditGeometry: this.enableEditGeometry, graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), index.h("calcite-shell", { key: 'f32d9cfe3a41bbd7d58cdc732c8abe99b232beb7', class: "position-relative " + messageClass }, index.h("div", { key: 'b97eb023c5d57a4a8dda09467d8599166da40f3c', class: "padding-1" }, index.h("calcite-notice", { key: '23a204782bd254909e3ab803a944d10004e4954a', icon: "table", open: true }, index.h("div", { key: 'ea25078647612b8fa40e26b4474a91c853dae126', slot: "message" }, this._translations.selectFeaturesToStart)))))));
|
90
89
|
}
|
91
90
|
//--------------------------------------------------------------------------
|
92
91
|
//
|
93
92
|
// Functions (protected)
|
94
93
|
//
|
95
94
|
//--------------------------------------------------------------------------
|
95
|
+
/**
|
96
|
+
* Gets the Feature using its ids
|
97
|
+
*
|
98
|
+
* @returns Promise when complete
|
99
|
+
* @protected
|
100
|
+
*/
|
101
|
+
async _getFeaturesByIds(ids) {
|
102
|
+
// only query if we have some ids...query with no ids will result in all features being returned
|
103
|
+
const featureSet = ids.length > 0 ? await mapViewUtils.queryFeaturesByID(ids, this.layer, [], false, this.mapView.spatialReference) : [];
|
104
|
+
// https://github.com/Esri/solutions-components/issues/365
|
105
|
+
return featureSet.sort((a, b) => ids.indexOf(a.getObjectId()) - ids.indexOf(b.getObjectId()));
|
106
|
+
}
|
96
107
|
/**
|
97
108
|
* Fetches the component's translations
|
98
109
|
*
|
@@ -113,6 +124,7 @@ const LayerTable = class {
|
|
113
124
|
constructor(hostRef) {
|
114
125
|
index.registerInstance(this, hostRef);
|
115
126
|
this.featureSelectionChange = index.createEvent(this, "featureSelectionChange", 7);
|
127
|
+
this.toggleFilter = index.createEvent(this, "toggleFilter", 7);
|
116
128
|
this.defaultGlobalId = undefined;
|
117
129
|
this.defaultLayerId = undefined;
|
118
130
|
this.defaultOid = undefined;
|
@@ -132,6 +144,7 @@ const LayerTable = class {
|
|
132
144
|
this.showNewestFirst = undefined;
|
133
145
|
this.zoomAndScrollToSelected = undefined;
|
134
146
|
this.zoomToScale = undefined;
|
147
|
+
this.createFilterModal = true;
|
135
148
|
this._allIds = [];
|
136
149
|
this._controlsThatFit = undefined;
|
137
150
|
this._csvExporting = false;
|
@@ -383,7 +396,9 @@ const LayerTable = class {
|
|
383
396
|
*/
|
384
397
|
async mapInfoWatchHandler() {
|
385
398
|
this._resetColumnTemplates();
|
386
|
-
this.
|
399
|
+
if (this.createFilterModal) {
|
400
|
+
this._initLayerExpressions();
|
401
|
+
}
|
387
402
|
this._initToolInfos();
|
388
403
|
this._updateToolbar();
|
389
404
|
await this._sortTable();
|
@@ -413,7 +428,9 @@ const LayerTable = class {
|
|
413
428
|
this._floorField = this._layer.floorInfo?.floorField;
|
414
429
|
this._updateFloorDefinitionExpression();
|
415
430
|
await this._resetTable();
|
416
|
-
this.
|
431
|
+
if (this.createFilterModal) {
|
432
|
+
this._initLayerExpressions();
|
433
|
+
}
|
417
434
|
this._updateShareUrl();
|
418
435
|
this._fetchingData = false;
|
419
436
|
});
|
@@ -437,6 +454,30 @@ const LayerTable = class {
|
|
437
454
|
// Methods (public)
|
438
455
|
//
|
439
456
|
//--------------------------------------------------------------------------
|
457
|
+
/**
|
458
|
+
* Reset the filter
|
459
|
+
*/
|
460
|
+
async filterReset() {
|
461
|
+
void this._handleFilterListReset();
|
462
|
+
}
|
463
|
+
/**
|
464
|
+
* Updates the filter
|
465
|
+
*/
|
466
|
+
async filterUpdate() {
|
467
|
+
this._handleFilterUpdate();
|
468
|
+
}
|
469
|
+
/**
|
470
|
+
* Closes the filter
|
471
|
+
*/
|
472
|
+
async closeFilter() {
|
473
|
+
await this._closeFilter();
|
474
|
+
}
|
475
|
+
/**
|
476
|
+
* refresh the feature table
|
477
|
+
*/
|
478
|
+
async refresh() {
|
479
|
+
await this._refresh();
|
480
|
+
}
|
440
481
|
//--------------------------------------------------------------------------
|
441
482
|
//
|
442
483
|
// Events (public)
|
@@ -446,6 +487,10 @@ const LayerTable = class {
|
|
446
487
|
* Emitted on demand when a layer is selected
|
447
488
|
*/
|
448
489
|
featureSelectionChange;
|
490
|
+
/**
|
491
|
+
* Emitted on demand when filter action is clicked
|
492
|
+
*/
|
493
|
+
toggleFilter;
|
449
494
|
/**
|
450
495
|
* Scroll and zoom to the selected feature from the Features widget.
|
451
496
|
*
|
@@ -477,6 +522,14 @@ const LayerTable = class {
|
|
477
522
|
}
|
478
523
|
}
|
479
524
|
}
|
525
|
+
/**
|
526
|
+
* Handles layer selection change to show new table
|
527
|
+
*
|
528
|
+
* @param evt CustomEvent the id for the current layer
|
529
|
+
*/
|
530
|
+
async layerSelectionChange(evt) {
|
531
|
+
await this._layerSelectionChanged(evt);
|
532
|
+
}
|
480
533
|
/**
|
481
534
|
* Refresh the table when edits are completed
|
482
535
|
*/
|
@@ -544,9 +597,9 @@ const LayerTable = class {
|
|
544
597
|
const selected = this.selectedIds.length.toString();
|
545
598
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
546
599
|
this._validateActiveActions();
|
547
|
-
return (index.h(index.Host, { key: '
|
600
|
+
return (index.h(index.Host, { key: '17071727cb283d84afb8beab8382bd3623f35920' }, index.h("calcite-shell", { key: 'f8508d67fd4b100fdc3f52b7db63194714cf216b' }, this._getTableControlRow("header"), index.h("div", { key: '5c1ebcb0530764a9568dc5dae153632a3d9491c8', class: `width-full ${tableHeightClass}` }, index.h("calcite-panel", { key: '7a6420894e4e50e2b4cda6e5ebe043134f4c0397', class: "height-full width-full" }, index.h("calcite-loader", { key: '48d4fe7e27fae877ca0e4caa22555968636f6c33', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), index.h("div", { key: 'cce71356e8ca141d1a18b32944d4fa03af8aae33', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (index.h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
548
601
|
.replace("{{total}}", total)
|
549
|
-
.replace("{{selected}}", selected))) : undefined)), this._filterModal()));
|
602
|
+
.replace("{{selected}}", selected))) : undefined)), this.createFilterModal && this._filterModal()));
|
550
603
|
}
|
551
604
|
/**
|
552
605
|
* Called once after the component is loaded
|
@@ -615,7 +668,7 @@ const LayerTable = class {
|
|
615
668
|
_getActionBar() {
|
616
669
|
const containerClass = this.isMobile ? "width-full" : "";
|
617
670
|
const mobileClass = this.isMobile ? "border-top" : "";
|
618
|
-
return (index.h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, index.h("map-layer-picker", { appearance: "transparent", defaultLayerId: this.defaultLayerId, display: "inline-flex", height: 50, isMobile: this.isMobile, mapView: this.mapView,
|
671
|
+
return (index.h("calcite-action-bar", { class: containerClass, expandDisabled: true, expanded: true, id: this._getId("bar"), layout: "horizontal" }, index.h("div", { class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, index.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));
|
619
672
|
}
|
620
673
|
/**
|
621
674
|
* Get the actions that are used for various interactions with the table
|
@@ -660,15 +713,19 @@ const LayerTable = class {
|
|
660
713
|
*/
|
661
714
|
_validateEnabledActions() {
|
662
715
|
const featuresSelected = this._featuresSelected();
|
716
|
+
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate;
|
663
717
|
const selectionDependant = [
|
664
718
|
"zoom-to-object",
|
719
|
+
"pencil",
|
665
720
|
"trash",
|
666
721
|
"erase",
|
667
722
|
"selected-items-filter"
|
668
723
|
];
|
669
724
|
this._toolInfos?.forEach(ti => {
|
670
725
|
if (ti && selectionDependant.indexOf(ti.icon) > -1) {
|
671
|
-
|
726
|
+
// disable the pencil icon if multiple features are not selected
|
727
|
+
// For other icons disable them if any feature is not selected
|
728
|
+
ti.disabled = ti.icon === "pencil" ? !showMultipleEdits : !featuresSelected;
|
672
729
|
}
|
673
730
|
});
|
674
731
|
}
|
@@ -702,6 +759,7 @@ const LayerTable = class {
|
|
702
759
|
*/
|
703
760
|
_initToolInfos() {
|
704
761
|
const featuresSelected = this._featuresSelected();
|
762
|
+
const showMultipleEdits = this.selectedIds.length > 1 && this._layer?.capabilities?.operations?.supportsUpdate;
|
705
763
|
const featuresEmpty = this._featuresEmpty();
|
706
764
|
const hasFilterExpressions = this._hasFilterExpressions();
|
707
765
|
if (this._translations) {
|
@@ -720,10 +778,20 @@ const LayerTable = class {
|
|
720
778
|
icon: "filter",
|
721
779
|
indicator: false,
|
722
780
|
label: this._translations.filters,
|
723
|
-
func: () => this._toggleFilter(),
|
781
|
+
func: () => this.createFilterModal ? this._toggleFilter() : this.toggleFilter.emit(),
|
724
782
|
disabled: false,
|
725
783
|
isOverflow: false
|
726
784
|
} : undefined,
|
785
|
+
!this.mapHidden ? {
|
786
|
+
active: false,
|
787
|
+
icon: "pencil",
|
788
|
+
indicator: false,
|
789
|
+
label: this._translations.editMultiple,
|
790
|
+
func: () => alert(this._translations.editMultiple),
|
791
|
+
disabled: !showMultipleEdits,
|
792
|
+
isOverflow: false,
|
793
|
+
isSublist: false
|
794
|
+
} : undefined,
|
727
795
|
this._deleteEnabled ? {
|
728
796
|
active: undefined,
|
729
797
|
icon: "trash",
|
@@ -908,7 +976,7 @@ const LayerTable = class {
|
|
908
976
|
_setControlsThatFit(controlsThatFit, skipControls) {
|
909
977
|
let update = JSON.stringify(controlsThatFit) !== JSON.stringify(this._controlsThatFit);
|
910
978
|
const actionbar = document.getElementById("solutions-action-bar");
|
911
|
-
actionbar
|
979
|
+
actionbar?.childNodes?.forEach((n) => {
|
912
980
|
if (skipControls.indexOf(n.id) < 0 && !update) {
|
913
981
|
update = this._controlsThatFit.map(c => c.id).indexOf(n.id) < 0;
|
914
982
|
}
|
@@ -1798,7 +1866,7 @@ function joinAppProxies(map, config, appProxies) {
|
|
1798
1866
|
return map;
|
1799
1867
|
}
|
1800
1868
|
|
1801
|
-
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}";
|
1869
|
+
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}";
|
1802
1870
|
const MapCardStyle0 = mapCardCss;
|
1803
1871
|
|
1804
1872
|
const MapCard = class {
|
@@ -1806,8 +1874,10 @@ const MapCard = class {
|
|
1806
1874
|
index.registerInstance(this, hostRef);
|
1807
1875
|
this.mapChanged = index.createEvent(this, "mapChanged", 7);
|
1808
1876
|
this.beforeMapChanged = index.createEvent(this, "beforeMapChanged", 7);
|
1877
|
+
this.toggleFilter = index.createEvent(this, "toggleFilter", 7);
|
1809
1878
|
this.appProxies = undefined;
|
1810
1879
|
this.defaultWebmapId = "";
|
1880
|
+
this.defaultLayerId = undefined;
|
1811
1881
|
this.enableHome = undefined;
|
1812
1882
|
this.enableLegend = undefined;
|
1813
1883
|
this.enableFloorFilter = undefined;
|
@@ -1828,8 +1898,17 @@ const MapCard = class {
|
|
1828
1898
|
this.stackTools = true;
|
1829
1899
|
this.theme = undefined;
|
1830
1900
|
this.toolOrder = undefined;
|
1901
|
+
this.isMapLayout = undefined;
|
1902
|
+
this.selectedFeaturesIds = undefined;
|
1903
|
+
this.selectedLayer = undefined;
|
1904
|
+
this.zoomToScale = undefined;
|
1905
|
+
this.onlyShowUpdatableLayers = undefined;
|
1906
|
+
this.isMobile = undefined;
|
1907
|
+
this.mapInfo = undefined;
|
1908
|
+
this._translations = undefined;
|
1831
1909
|
this._searchConfiguration = undefined;
|
1832
1910
|
this._webMapInfo = undefined;
|
1911
|
+
this._showHideOpen = false;
|
1833
1912
|
}
|
1834
1913
|
get el() { return index.getElement(this); }
|
1835
1914
|
//--------------------------------------------------------------------------
|
@@ -1877,6 +1956,22 @@ const MapCard = class {
|
|
1877
1956
|
* HTMLMapToolsElement: the container div for the map tools
|
1878
1957
|
*/
|
1879
1958
|
_mapTools;
|
1959
|
+
/**
|
1960
|
+
* HTMLCalciteDropdownElement: Dropdown the will support overflow tools that won't fit in the current display
|
1961
|
+
*/
|
1962
|
+
_moreDropdown;
|
1963
|
+
/**
|
1964
|
+
* boolean: When true the show/hide fields list is forced open
|
1965
|
+
*/
|
1966
|
+
_mapListExpanded = false;
|
1967
|
+
/**
|
1968
|
+
* boolean: When true an indicator will be shown on the action
|
1969
|
+
*/
|
1970
|
+
_filterActive = false;
|
1971
|
+
/**
|
1972
|
+
* string: The current layers definition expression
|
1973
|
+
*/
|
1974
|
+
_definitionExpression;
|
1880
1975
|
//--------------------------------------------------------------------------
|
1881
1976
|
//
|
1882
1977
|
// Watch handlers
|
@@ -1888,11 +1983,31 @@ const MapCard = class {
|
|
1888
1983
|
enableHomeWatchHandler() {
|
1889
1984
|
this._initHome();
|
1890
1985
|
}
|
1986
|
+
/**
|
1987
|
+
* watch for changes in layer view and verify if it has editing enabled
|
1988
|
+
*/
|
1989
|
+
async selectedLayerWatchHandler() {
|
1990
|
+
await this.selectedLayer?.when(async () => {
|
1991
|
+
this._definitionExpression = this.selectedLayer.definitionExpression;
|
1992
|
+
});
|
1993
|
+
}
|
1891
1994
|
//--------------------------------------------------------------------------
|
1892
1995
|
//
|
1893
1996
|
// Methods (public)
|
1894
1997
|
//
|
1895
1998
|
//--------------------------------------------------------------------------
|
1999
|
+
/**
|
2000
|
+
* Reset the filter
|
2001
|
+
*/
|
2002
|
+
async filterReset() {
|
2003
|
+
this._filterActive = false;
|
2004
|
+
}
|
2005
|
+
/**
|
2006
|
+
* updates the filter
|
2007
|
+
*/
|
2008
|
+
async updateFilter() {
|
2009
|
+
this._filterActive = this._definitionExpression !== this.selectedLayer.definitionExpression;
|
2010
|
+
}
|
1896
2011
|
//--------------------------------------------------------------------------
|
1897
2012
|
//
|
1898
2013
|
// Events (public)
|
@@ -1906,12 +2021,23 @@ const MapCard = class {
|
|
1906
2021
|
* Emitted before a new map is loaded
|
1907
2022
|
*/
|
1908
2023
|
beforeMapChanged;
|
2024
|
+
/**
|
2025
|
+
* Emitted on demand when filter action is clicked
|
2026
|
+
*/
|
2027
|
+
toggleFilter;
|
1909
2028
|
/**
|
1910
2029
|
* Listen for changes to map info and load the appropriate map
|
1911
2030
|
*/
|
1912
2031
|
async mapInfoChange(evt) {
|
1913
2032
|
await this._loadMap(evt.detail);
|
1914
2033
|
}
|
2034
|
+
/**
|
2035
|
+
* Listen for change when mapview doesn't contain any layer
|
2036
|
+
*/
|
2037
|
+
noLayersFound() {
|
2038
|
+
this.selectedLayer = undefined;
|
2039
|
+
this.selectedFeaturesIds = [];
|
2040
|
+
}
|
1915
2041
|
//--------------------------------------------------------------------------
|
1916
2042
|
//
|
1917
2043
|
// Functions (lifecycle)
|
@@ -1921,17 +2047,28 @@ const MapCard = class {
|
|
1921
2047
|
* StencilJS: Called once just after the component is first connected to the DOM.
|
1922
2048
|
*/
|
1923
2049
|
async componentWillLoad() {
|
2050
|
+
await this._getTranslations();
|
1924
2051
|
await this._initModules();
|
1925
2052
|
}
|
1926
2053
|
/**
|
1927
2054
|
* Renders the component.
|
1928
2055
|
*/
|
1929
2056
|
render() {
|
2057
|
+
const mapContainerClass = this.isMapLayout ? "display-flex height-50-px" : "";
|
1930
2058
|
const mapClass = this.hidden ? "visibility-hidden-1" : "";
|
1931
2059
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
1932
2060
|
const mapPickerClass = this.mapInfos?.length > 1 ? "" : "display-none";
|
1933
2061
|
const mapHeightClass = this.mapInfos?.length > 1 ? "map-height" : "height-full";
|
1934
|
-
|
2062
|
+
const containerClass = this.isMobile ? "width-full" : "";
|
2063
|
+
const mobileClass = this.isMobile ? "border-top" : "";
|
2064
|
+
const headerElements = this.isMapLayout ? "" : "display-none";
|
2065
|
+
return (index.h(index.Host, { key: '7029e518173a8c1e6e00049b8e68e23bed23d9cb' }, index.h("div", { key: '2b8d9197dcb68529562728fddeb53d0a7e9cbb86', class: `${mapContainerClass}` }, index.h("map-picker", { key: '2e50b7c70832f4151fafd06e860846a5efa8f6f1', class: mapPickerClass, isMapLayout: this.isMapLayout, mapInfos: this.mapInfos, ref: (el) => this._mapPicker = el }), index.h("div", { key: 'bc01ef7fb34400e3ff58151cab6abbabd9fa8a6f', class: `mapView-header display-flex ${headerElements}` }, index.h("div", { key: '1f1bf6ffb92fbc182be8333b4ae3d70271ea2f1b', class: `border-end ${containerClass} ${mobileClass}`, id: "solutions-map-layer-picker-container" }, this.mapView && index.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())), index.h("div", { key: '7101bfed6c0e0932275b0d28eea0ea5e1603aa8e', class: `${mapHeightClass} ${mapClass}`, ref: (el) => (this._mapDiv = el) }), index.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 })));
|
2066
|
+
}
|
2067
|
+
/**
|
2068
|
+
* Called each time after the component is loaded
|
2069
|
+
*/
|
2070
|
+
async componentDidRender() {
|
2071
|
+
document.onclick = (e) => this._handleDocumentClick(e);
|
1935
2072
|
}
|
1936
2073
|
//--------------------------------------------------------------------------
|
1937
2074
|
//
|
@@ -2030,8 +2167,99 @@ const MapCard = class {
|
|
2030
2167
|
this.mapView.ui.remove(this._homeWidget);
|
2031
2168
|
}
|
2032
2169
|
}
|
2170
|
+
/**
|
2171
|
+
* Toggle show/hide dropdown
|
2172
|
+
*/
|
2173
|
+
_toggleShowHide() {
|
2174
|
+
this._showHideOpen = !this._showHideOpen;
|
2175
|
+
}
|
2176
|
+
/**
|
2177
|
+
* Open show/hide dropdown
|
2178
|
+
*/
|
2179
|
+
_forceShowHide() {
|
2180
|
+
if (this._moreDropdown) {
|
2181
|
+
this._moreDropdown.open = this._showHideOpen;
|
2182
|
+
}
|
2183
|
+
}
|
2184
|
+
/**
|
2185
|
+
* Close show/hide dropdown when the user clicks outside of it
|
2186
|
+
*/
|
2187
|
+
_handleDocumentClick(e) {
|
2188
|
+
const id = e.target?.id;
|
2189
|
+
if (this._showHideOpen && id !== "solutions-subset-list" && id !== "solutions-more" && id !== "chevron-down") {
|
2190
|
+
if (this._moreDropdown) {
|
2191
|
+
this._showHideOpen = false;
|
2192
|
+
this._moreDropdown.open = false;
|
2193
|
+
}
|
2194
|
+
}
|
2195
|
+
// if clicked on map picker then toggle the dropdown
|
2196
|
+
if (e.target.tagName === 'MAP-PICKER') {
|
2197
|
+
this._mapListExpanded = !this._mapListExpanded;
|
2198
|
+
void this._mapPicker.toggle(this._mapListExpanded);
|
2199
|
+
}
|
2200
|
+
// if clicked on other place then just close the dropdown
|
2201
|
+
if (e.target.tagName !== 'MAP-PICKER') {
|
2202
|
+
this._mapListExpanded = false;
|
2203
|
+
void this._mapPicker.close();
|
2204
|
+
}
|
2205
|
+
}
|
2206
|
+
/**
|
2207
|
+
* Zoom to all selected features
|
2208
|
+
*
|
2209
|
+
* @returns a promise that will resolve when the operation is complete
|
2210
|
+
*/
|
2211
|
+
async _zoom() {
|
2212
|
+
if (this.selectedLayer) {
|
2213
|
+
const selectedLayerView = await mapViewUtils.getFeatureLayerView(this.mapView, this.selectedLayer.id);
|
2214
|
+
await mapViewUtils.goToSelection(this.selectedFeaturesIds, selectedLayerView, this.mapView, true, undefined, this.zoomToScale);
|
2215
|
+
}
|
2216
|
+
}
|
2217
|
+
async _toggleFilter() {
|
2218
|
+
this.toggleFilter.emit();
|
2219
|
+
}
|
2220
|
+
/**
|
2221
|
+
* Return true when we have at least 1 layer expression for the current layer
|
2222
|
+
*
|
2223
|
+
* @returns boolean
|
2224
|
+
*/
|
2225
|
+
_hasFilterExpressions() {
|
2226
|
+
let layerExpressions;
|
2227
|
+
if (this.mapInfo?.filterConfig?.layerExpressions && this.selectedLayer?.id) {
|
2228
|
+
layerExpressions = this.mapInfo.filterConfig.layerExpressions.filter((exp) => exp.id === this.selectedLayer.id);
|
2229
|
+
}
|
2230
|
+
return layerExpressions?.length > 0;
|
2231
|
+
}
|
2232
|
+
/**
|
2233
|
+
* Get Dropdown action item
|
2234
|
+
* @returns Dropdown item
|
2235
|
+
*/
|
2236
|
+
_getDropDownItem() {
|
2237
|
+
return (index.h("calcite-dropdown", { closeOnSelectDisabled: true, disabled: this.selectedLayer === undefined, id: "solutions-more", onCalciteDropdownBeforeClose: () => this._forceShowHide(), ref: (el) => this._moreDropdown = el, widthScale: "l" }, index.h("calcite-action", { appearance: "solid", id: 'solutions-more', label: "", onClick: () => this._toggleShowHide(), slot: "trigger", text: "" }, index.h("calcite-button", { appearance: "transparent", iconEnd: this._showHideOpen ? "chevron-up" : "chevron-down", kind: "neutral" }, this._translations.more)), index.h("calcite-dropdown-group", { selectionMode: "none" }, this._getDropDownItems())));
|
2238
|
+
}
|
2239
|
+
/**
|
2240
|
+
* Gets the dropdown items
|
2241
|
+
* @returns dropdown items
|
2242
|
+
*/
|
2243
|
+
_getDropDownItems() {
|
2244
|
+
const featureSelected = this.selectedFeaturesIds?.length > 0;
|
2245
|
+
const showMultipleEdits = this.selectedFeaturesIds?.length > 1;
|
2246
|
+
const hasFilterExpressions = this._hasFilterExpressions();
|
2247
|
+
return (index.h(index.Fragment, null, index.h("calcite-dropdown-group", { selectionMode: "none" }, index.h("calcite-dropdown-item", { disabled: !showMultipleEdits, iconStart: "pencil", id: "solutions-subset-list", onClick: () => alert(this._translations.editMultiple) }, this._translations.editMultiple)), index.h("calcite-dropdown-group", { selectionMode: "none" }, index.h("calcite-dropdown-item", { iconStart: "refresh", id: "solutions-subset-list", onClick: () => { this.selectedLayer.refresh(); } }, this._translations.refresh)), index.h("calcite-dropdown-group", { selectionMode: "none" }, index.h("calcite-dropdown-item", { disabled: !featureSelected, iconStart: "zoom-to-object", id: "solutions-subset-list", onClick: this._zoom.bind(this) }, this._translations.zoom)), hasFilterExpressions &&
|
2248
|
+
index.h("calcite-dropdown-group", null, index.h("calcite-dropdown-item", { disabled: false, iconStart: "filter", id: "solutions-subset-list", onClick: this._toggleFilter.bind(this), selected: this._filterActive }, this._translations.filters))));
|
2249
|
+
}
|
2250
|
+
/**
|
2251
|
+
* Fetches the component's translations
|
2252
|
+
*
|
2253
|
+
* @returns Promise when complete
|
2254
|
+
* @protected
|
2255
|
+
*/
|
2256
|
+
async _getTranslations() {
|
2257
|
+
const messages = await locale.getLocaleComponentStrings(this.el);
|
2258
|
+
this._translations = messages[0];
|
2259
|
+
}
|
2033
2260
|
static get watchers() { return {
|
2034
|
-
"enableHome": ["enableHomeWatchHandler"]
|
2261
|
+
"enableHome": ["enableHomeWatchHandler"],
|
2262
|
+
"selectedLayer": ["selectedLayerWatchHandler"]
|
2035
2263
|
}; }
|
2036
2264
|
};
|
2037
2265
|
MapCard.style = MapCardStyle0;
|