@esri/solutions-components 0.7.7 → 0.7.8
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 +3 -3
- package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-alert_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +16 -9
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
- package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
- package/dist/cjs/{helpers-ff831524.js → helpers-a0719076.js} +1 -1
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +10 -10
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-export.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-header.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-landing-page.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +8 -8
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-popover.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-splash.cjs.entry.js +3 -3
- package/dist/cjs/{languageSwitcher-cae609d9.js → languageSwitcher-7de41e17.js} +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +1 -1
- package/dist/cjs/{loadModules-1d0f0316.js → loadModules-51c30ab9.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-56c3447b.js → locale-9b9d0e94.js} +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/{utils-41eb3a01.js → utils-35b31785.js} +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +5 -5
- package/dist/collection/components/edit-card/edit-card.css +3 -3
- package/dist/collection/components/info-card/info-card.css +2 -2
- package/dist/collection/components/json-editor/json-editor.css +3 -123
- package/dist/collection/components/layer-table/layer-table.css +9 -12
- package/dist/collection/components/layer-table/layer-table.js +1 -1
- package/dist/collection/components/layout-manager/layout-manager.css +73 -73
- package/dist/collection/components/map-draw-tools/map-draw-tools.css +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.css +5 -3
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-picker/map-picker.css +3 -3
- package/dist/collection/components/map-search/map-search.css +24 -24
- package/dist/collection/components/map-select-tools/map-select-tools.css +5 -5
- package/dist/collection/components/map-tools/map-tools.css +1 -1
- package/dist/collection/components/public-notification/public-notification.css +11 -11
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/components/refine-selection/refine-selection.css +2 -2
- package/dist/collection/components/solution-item-details/solution-item-details.css +0 -148
- package/dist/collection/components/solution-item-icon/solution-item-icon.css +2 -124
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.css +5 -125
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.css +6 -126
- package/dist/collection/components/solution-resource-item/solution-resource-item.css +6 -126
- package/dist/collection/components/solution-variables/solution-variables.css +9 -129
- package/dist/collection/demos/browse-solutions.html +2 -0
- package/dist/collection/demos/buffer-tools.html +1 -1
- package/dist/collection/demos/card-manager.html +2 -2
- package/dist/collection/demos/crowdsource-manager.html +3 -3
- package/dist/collection/demos/crowdsource-reporter.html +5 -5
- package/dist/collection/demos/deduct-calculator.html +1 -1
- package/dist/collection/demos/info-card.html +2 -2
- package/dist/collection/demos/layer-table.html +2 -2
- package/dist/collection/demos/list-item.html +2 -2
- package/dist/collection/demos/map-card.html +2 -2
- package/dist/collection/demos/map-draw-tools.html +1 -1
- package/dist/collection/demos/map-layer-picker.html +1 -1
- package/dist/collection/demos/map-select-tools.html +1 -1
- package/dist/collection/demos/new-public-notification.html +5 -5
- package/dist/collection/demos/pci-calculator.html +1 -1
- package/dist/components/crowdsource-manager.js +1 -1
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/info-card2.js +1 -1
- package/dist/components/instant-apps-ckeditor-wrapper2.js +2 -2
- package/dist/components/instant-apps-control-panel.js +1 -1
- package/dist/components/instant-apps-export.js +2 -2
- package/dist/components/instant-apps-filter-list2.js +4 -2
- package/dist/components/instant-apps-header2.js +2 -2
- package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-count2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-group-legend-element-caption.js +5 -5
- package/dist/components/instant-apps-interactive-legend-group-legend-element2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-layer-element-caption2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-layer-element2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-relationship2.js +1 -1
- package/dist/components/instant-apps-interactive-legend.js +1 -1
- package/dist/components/instant-apps-keyboard-shortcuts.js +1 -1
- package/dist/components/instant-apps-landing-page.js +1 -1
- package/dist/components/instant-apps-language-switcher.js +4 -4
- package/dist/components/instant-apps-language-translator-item2.js +4 -4
- package/dist/components/instant-apps-language-translator-search2.js +1 -1
- package/dist/components/instant-apps-language-translator2.js +3 -3
- package/dist/components/instant-apps-measurement.js +2 -2
- package/dist/components/instant-apps-popover.js +1 -1
- package/dist/components/instant-apps-scoreboard.js +1 -1
- package/dist/components/instant-apps-social-share2.js +11 -5
- package/dist/components/instant-apps-splash.js +1 -1
- package/dist/components/json-editor2.js +1 -1
- package/dist/components/layer-table2.js +2 -2
- package/dist/components/layout-manager.js +1 -1
- package/dist/components/loadModules2.js +1 -1
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-layer-picker2.js +2 -2
- package/dist/components/map-picker2.js +1 -1
- 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/public-notification.js +2 -2
- package/dist/components/refine-selection2.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-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +3 -3
- package/dist/esm/buffer-tools_3.entry.js +1 -1
- package/dist/esm/calcite-action-pad_2.entry.js +1 -1
- package/dist/esm/calcite-alert_3.entry.js +2 -2
- package/dist/esm/calcite-combobox_6.entry.js +2 -2
- package/dist/esm/calcite-input-date-picker_3.entry.js +16 -9
- package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
- package/dist/esm/card-manager_3.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +1 -1
- package/dist/esm/{helpers-e8282221.js → helpers-078591d2.js} +1 -1
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +10 -10
- package/dist/esm/instant-apps-control-panel.entry.js +2 -2
- package/dist/esm/instant-apps-export.entry.js +4 -4
- package/dist/esm/instant-apps-header.entry.js +2 -2
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +7 -7
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +6 -6
- package/dist/esm/instant-apps-interactive-legend.entry.js +4 -4
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +3 -3
- package/dist/esm/instant-apps-landing-page.entry.js +1 -1
- package/dist/esm/instant-apps-language-switcher.entry.js +8 -8
- package/dist/esm/instant-apps-language-translator.entry.js +7 -7
- package/dist/esm/instant-apps-measurement.entry.js +4 -4
- package/dist/esm/instant-apps-popover.entry.js +3 -3
- package/dist/esm/instant-apps-scoreboard.entry.js +3 -3
- package/dist/esm/instant-apps-splash.entry.js +3 -3
- package/dist/esm/{languageSwitcher-75765d90.js → languageSwitcher-62232826.js} +1 -1
- package/dist/esm/layout-manager.entry.js +1 -1
- package/dist/esm/{loadModules-037feea8.js → loadModules-b677d6d7.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-53d724b5.js → locale-89b49505.js} +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-item-icon.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/{utils-06bace50.js → utils-b1bd777e.js} +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-export/instant-apps-export.css +20 -20
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-filter-list/instant-apps-filter-list.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-classic/instant-apps-interactive-legend-classic.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-count/instant-apps-interactive-legend-count.css +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-group-legend-element-caption/instant-apps-interactive-legend-group-legend-element-caption.css +5 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-layer-element-caption/instant-apps-interactive-legend-layer-element-caption.css +5 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-legend-element-caption/instant-apps-interactive-legend-legend-element-caption.css +4 -5
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-relationship/instant-apps-interactive-legend-relationship.css +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-keyboard-shortcuts/instant-apps-keyboard-shortcuts.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +6 -6
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-switcher/instant-apps-language-switcher.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator-item/instant-apps-language-translator-item.css +7 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator-search/instant-apps-language-translator-search.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-measurement/instant-apps-measurement.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-popover/instant-apps-popover.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-scoreboard/instant-apps-scoreboard.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-social-share/instant-apps-social-share.css +6 -6
- package/dist/solutions-components/demos/browse-solutions.html +2 -0
- package/dist/solutions-components/demos/buffer-tools.html +1 -1
- package/dist/solutions-components/demos/card-manager.html +2 -2
- package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
- package/dist/solutions-components/demos/crowdsource-reporter.html +5 -5
- package/dist/solutions-components/demos/deduct-calculator.html +1 -1
- package/dist/solutions-components/demos/info-card.html +2 -2
- package/dist/solutions-components/demos/layer-table.html +2 -2
- package/dist/solutions-components/demos/list-item.html +2 -2
- package/dist/solutions-components/demos/map-card.html +2 -2
- package/dist/solutions-components/demos/map-draw-tools.html +1 -1
- package/dist/solutions-components/demos/map-layer-picker.html +1 -1
- package/dist/solutions-components/demos/map-select-tools.html +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +5 -5
- package/dist/solutions-components/demos/pci-calculator.html +1 -1
- package/dist/solutions-components/{p-bab0aa05.js → p-00f9774c.js} +1 -1
- package/dist/solutions-components/p-14097810.entry.js +6 -0
- package/dist/solutions-components/{p-019f0baa.entry.js → p-166d5bcc.entry.js} +1 -1
- package/dist/solutions-components/{p-9270f6da.entry.js → p-1b9709ce.entry.js} +1 -1
- package/dist/solutions-components/p-3bf0115f.entry.js +6 -0
- package/dist/solutions-components/{p-796ce3a2.entry.js → p-3ea18af7.entry.js} +1 -1
- package/dist/solutions-components/p-4f1c4004.entry.js +6 -0
- package/dist/solutions-components/{p-8c7d5880.entry.js → p-546a3d3c.entry.js} +1 -1
- package/dist/solutions-components/p-60d212df.entry.js +6 -0
- package/dist/solutions-components/{p-bd3f4aa6.entry.js → p-627c19b5.entry.js} +1 -1
- package/dist/solutions-components/{p-84034340.js → p-62e92138.js} +1 -1
- package/dist/solutions-components/{p-149d80ad.js → p-68434a63.js} +1 -1
- package/dist/solutions-components/{p-b2a9bae3.entry.js → p-75f7bfe3.entry.js} +1 -1
- package/dist/solutions-components/{p-188483e2.entry.js → p-789f606f.entry.js} +1 -1
- package/dist/solutions-components/{p-a7a06d6a.js → p-83225907.js} +1 -1
- package/dist/solutions-components/{p-c3fa8a3d.entry.js → p-95ebc2e5.entry.js} +1 -1
- package/dist/solutions-components/p-98fe7b5d.entry.js +6 -0
- package/dist/solutions-components/p-99ca7674.entry.js +6 -0
- package/dist/solutions-components/p-a0b8cecf.entry.js +6 -0
- package/dist/solutions-components/{p-7eec285c.entry.js → p-a5d924a9.entry.js} +1 -1
- package/dist/solutions-components/{p-0ad0b29a.js → p-a8a0187d.js} +1 -1
- package/dist/solutions-components/p-a9f21aaf.entry.js +6 -0
- package/dist/solutions-components/{p-a2467088.entry.js → p-b42bde59.entry.js} +1 -1
- package/dist/solutions-components/p-baf82bab.entry.js +6 -0
- package/dist/solutions-components/p-c504529e.entry.js +6 -0
- package/dist/solutions-components/p-c556ed60.entry.js +6 -0
- package/dist/solutions-components/p-c99843aa.entry.js +6 -0
- package/dist/solutions-components/p-cc774829.entry.js +6 -0
- package/dist/solutions-components/p-ced4e208.entry.js +6 -0
- package/dist/solutions-components/{p-9e92fd19.entry.js → p-d78f13cb.entry.js} +1 -1
- package/dist/solutions-components/{p-10e99d5d.entry.js → p-d8b3d156.entry.js} +1 -1
- package/dist/solutions-components/p-db3ca38d.entry.js +17 -0
- package/dist/solutions-components/p-dcd6e7b9.entry.js +6 -0
- package/dist/solutions-components/{p-811313d1.entry.js → p-dd48cc25.entry.js} +1 -1
- package/dist/solutions-components/p-e8011829.entry.js +47 -0
- package/dist/solutions-components/solutions-components.css +1 -7
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/package.json +2 -2
- package/dist/solutions-components/p-0103dee1.entry.js +0 -6
- package/dist/solutions-components/p-2f496e4c.entry.js +0 -6
- package/dist/solutions-components/p-3977568f.entry.js +0 -17
- package/dist/solutions-components/p-3c3c2587.entry.js +0 -6
- package/dist/solutions-components/p-4b3ebd24.entry.js +0 -6
- package/dist/solutions-components/p-59407d94.entry.js +0 -6
- package/dist/solutions-components/p-7283bfe4.entry.js +0 -6
- package/dist/solutions-components/p-74a89c71.entry.js +0 -6
- package/dist/solutions-components/p-81c5c5f2.entry.js +0 -6
- package/dist/solutions-components/p-847193e7.entry.js +0 -6
- package/dist/solutions-components/p-a1c924c0.entry.js +0 -47
- package/dist/solutions-components/p-a44f1e85.entry.js +0 -6
- package/dist/solutions-components/p-abab359e.entry.js +0 -6
- package/dist/solutions-components/p-ad5f374e.entry.js +0 -6
- package/dist/solutions-components/p-afd9d486.entry.js +0 -6
- package/dist/solutions-components/p-f4742b64.entry.js +0 -6
- package/dist/solutions-components/p-f7042c6a.entry.js +0 -6
@@ -36,7 +36,7 @@
|
|
36
36
|
.over-map {
|
37
37
|
position: absolute;
|
38
38
|
left: 0px;
|
39
|
-
background-color: var(--calcite-
|
39
|
+
background-color: var(--calcite-color-foreground-1);
|
40
40
|
}
|
41
41
|
.over-map[dir="rtl"] {
|
42
42
|
right: 0px;
|
@@ -44,7 +44,7 @@
|
|
44
44
|
.column {
|
45
45
|
width: 320px;
|
46
46
|
padding: 1rem;
|
47
|
-
border: 1px solid var(--calcite-
|
47
|
+
border: 1px solid var(--calcite-color-border-2);
|
48
48
|
height: -webkit-fill-available;
|
49
49
|
height: 100%;
|
50
50
|
}
|
@@ -55,17 +55,17 @@
|
|
55
55
|
|
56
56
|
<link
|
57
57
|
rel="stylesheet"
|
58
|
-
href="https://jsdev.arcgis.com/4.
|
58
|
+
href="https://jsdev.arcgis.com/4.29/esri/themes/light/main.css"
|
59
59
|
/>
|
60
60
|
<!-- <link
|
61
61
|
rel="stylesheet"
|
62
|
-
href="https://jsdev.arcgis.com/4.
|
62
|
+
href="https://jsdev.arcgis.com/4.29/esri/themes/dark/main.css"
|
63
63
|
/> -->
|
64
64
|
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
65
65
|
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
66
66
|
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.0.0/calcite.css" />
|
67
67
|
|
68
|
-
<script src="https://jsdev.arcgis.com/4.
|
68
|
+
<script src="https://jsdev.arcgis.com/4.29/"></script>
|
69
69
|
<script type="module" src="../solutions-components.esm.js"></script>
|
70
70
|
|
71
71
|
<script>
|
@@ -23,14 +23,14 @@
|
|
23
23
|
-->
|
24
24
|
<style>
|
25
25
|
.main {
|
26
|
-
background-color: var(--calcite-
|
26
|
+
background-color: var(--calcite-color-foreground-1);
|
27
27
|
display: grid;
|
28
28
|
align-self: center;
|
29
29
|
}
|
30
30
|
.column {
|
31
31
|
min-width: 300px;
|
32
32
|
padding: 1rem;
|
33
|
-
border: 1px solid var(--calcite-
|
33
|
+
border: 1px solid var(--calcite-color-border-2);
|
34
34
|
}
|
35
35
|
</style>
|
36
36
|
|
@@ -31,12 +31,12 @@
|
|
31
31
|
.over-map {
|
32
32
|
position: absolute;
|
33
33
|
right: 0px;
|
34
|
-
background-color: var(--calcite-
|
34
|
+
background-color: var(--calcite-color-foreground-1);
|
35
35
|
}
|
36
36
|
.column {
|
37
37
|
width: 50%;
|
38
38
|
height: 100%;
|
39
|
-
border: 1px solid var(--calcite-
|
39
|
+
border: 1px solid var(--calcite-color-border-2);
|
40
40
|
}
|
41
41
|
.column[dir="rtl"] {
|
42
42
|
float: left;
|
@@ -25,12 +25,12 @@
|
|
25
25
|
.over-map {
|
26
26
|
position: absolute;
|
27
27
|
right: 0px;
|
28
|
-
background-color: var(--calcite-
|
28
|
+
background-color: var(--calcite-color-foreground-1);
|
29
29
|
}
|
30
30
|
.column {
|
31
31
|
min-width: 300px;
|
32
32
|
padding: 1rem;
|
33
|
-
border: 1px solid var(--calcite-
|
33
|
+
border: 1px solid var(--calcite-color-border-2);
|
34
34
|
height: -webkit-fill-available;
|
35
35
|
height: 100%;
|
36
36
|
}
|
@@ -25,12 +25,12 @@
|
|
25
25
|
.over-map {
|
26
26
|
position: absolute;
|
27
27
|
right: 0px;
|
28
|
-
background-color: var(--calcite-
|
28
|
+
background-color: var(--calcite-color-foreground-1);
|
29
29
|
}
|
30
30
|
.column {
|
31
31
|
width: 100%;
|
32
32
|
height: 100%;
|
33
|
-
border: 1px solid var(--calcite-
|
33
|
+
border: 1px solid var(--calcite-color-border-2);
|
34
34
|
}
|
35
35
|
.column[dir="rtl"] {
|
36
36
|
float: left;
|
@@ -36,7 +36,7 @@
|
|
36
36
|
.over-map {
|
37
37
|
position: absolute;
|
38
38
|
right: 0px;
|
39
|
-
background-color: var(--calcite-
|
39
|
+
background-color: var(--calcite-color-foreground-1);
|
40
40
|
}
|
41
41
|
.over-map[dir="rtl"] {
|
42
42
|
left: 0px;
|
@@ -44,7 +44,7 @@
|
|
44
44
|
.column {
|
45
45
|
width: 320px;
|
46
46
|
padding: 1rem;
|
47
|
-
border: 1px solid var(--calcite-
|
47
|
+
border: 1px solid var(--calcite-color-border-2);
|
48
48
|
height: -webkit-fill-available;
|
49
49
|
height: 100%;
|
50
50
|
}
|
@@ -55,17 +55,17 @@
|
|
55
55
|
|
56
56
|
<link
|
57
57
|
rel="stylesheet"
|
58
|
-
href="https://jsdev.arcgis.com/4.
|
58
|
+
href="https://jsdev.arcgis.com/4.29/esri/themes/light/main.css"
|
59
59
|
/>
|
60
60
|
<!-- <link
|
61
61
|
rel="stylesheet"
|
62
|
-
href="https://jsdev.arcgis.com/4.
|
62
|
+
href="https://jsdev.arcgis.com/4.29/esri/themes/dark/main.css"
|
63
63
|
/> -->
|
64
64
|
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
65
65
|
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
66
66
|
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.0.0/calcite.css" />
|
67
67
|
|
68
|
-
<script src="https://jsdev.arcgis.com/4.
|
68
|
+
<script src="https://jsdev.arcgis.com/4.29/"></script>
|
69
69
|
<script type="module" src="../solutions-components.esm.js"></script>
|
70
70
|
|
71
71
|
<script>
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{l as o}from"./p-
|
6
|
+
import{l as o}from"./p-a8a0187d.js";async function t(o,t){var n,a,e;try{const s=null===(e=null===(a=null===(n=null==t?void 0:t.portalItem)||void 0===n?void 0:n.portal)||void 0===a?void 0:a.credential)||void 0===e?void 0:e.token,i={responseType:"json"};s&&(i.query={token:s});var r="cacheBuster="+Date.now();const l=`${t.url}?${r}`,c=await o(l,i);return Promise.resolve(c.data)}catch(o){console.error("Unable to get resource t9n data.")}}async function n(t){if(!t)return null;const[n]=await o(["esri/portal/PortalItemResource"]),a=await t.fetchResources(),e=`t9n/${null==t?void 0:t.id}.json`,r=new n({path:e,portalItem:t}),s=a.resources.filter((o=>o.resource.path===e));if(0!==s.length)return Promise.resolve(s[0].resource);{const o="application/json",n=new Blob([JSON.stringify({})],{type:o});try{await t.addResource(r,n);const o=await t.fetchResources(),a=`t9n/${null==t?void 0:t.id}.json`,e=o.resources.filter((o=>o.resource.path===a));return Promise.resolve(e[0].resource)}catch(o){return console.error("ERROR: ",o),Promise.reject(null)}}}export{t as f,n as g}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as s,h as i,H as o,g as e}from"./p-78780f63.js";import{l as n}from"./p-a8a0187d.js";import{b as a}from"./p-83225907.js";import{w as r}from"./p-abea8ef5.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";const l="instant-apps-scoreboard",d=`${l}--`,c=`${l}__`,p=r.medium[1],h={BASE:l,itemsContainer:`${c}items-container`,items:`${c}items`,item:`${c}item`,label:`${c}item-label`,value:`${c}item-value`,valuePlaceholder:`${c}item-value-placeholder`,position:{bottom:`${c}position--bottom`,side:`${c}position--side`,left:`${c}position--left`,right:`${c}position--right`},mode:{floating:`${c}mode--floating`,pinned:`${c}mode--pinned`}},b=class{constructor(i){t(this,i),this.scoreboardItemsUpdated=s(this,"scoreboardItemsUpdated",7),this.view=void 0,this.items=void 0,this.position="bottom",this.mode="floating",this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.state="loading",this.messages=void 0,this.itemIndex=0,this.layers=void 0,this.layerViews=void 0,this.isMobile=!1}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state="calculating",await this.view.map.loadAll();const t=this.items.map((t=>{var s;return null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id}));this.layers=this.view.map.allLayers.filter((s=>(s=>(t=>!t.isTable)(s)&&(t=>"feature"===t.type||"scene"===t.type)(s)&&(s=>t.indexOf(s.id)>-1)(s))(s))),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach((t=>t.outFields=["*"]));const t=[];this.layers.forEach((s=>{const i=this.view.whenLayerView(s);t.push(i)}));const s=(await Promise.allSettled(t)).filter((t=>"fulfilled"==t.status&&t.value)).map((t=>t.value)),i=[];s.forEach((t=>{var s;return i.push(null===(s=this.reactiveUtils)||void 0===s?void 0:s.whenOnce((()=>!t.updating)))})),await Promise.all(i),this.layerViews=new this.Collection([...s])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&0===this.layers.length||this.layerViews&&0===this.layerViews.length)return;this.state="calculating";const t=[...this.items],s=[];this.queryStatDefinitions(t,s);const i=await Promise.all(s);this.handleQueryFeaturesResponses(i,t),this.items.length=0,t.forEach((t=>this.items.push(t))),this.state="complete",this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async componentWillLoad(){var t;new ResizeObserver((()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)})).observe(null===(t=this.el)||void 0===t?void 0:t.parentElement);try{this.state="loading",await this.initMessages()}catch(t){return this.state="disabled",Promise.reject()}finally{if(!this.view||!this.items)return this.state="disabled",Promise.reject();try{return await this.initModules(),Promise.resolve()}catch(t){return this.state="disabled",Promise.reject()}}}async componentDidLoad(){var t;if("disabled"!==this.state)try{await(null===(t=this.reactiveUtils)||void 0===t?void 0:t.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready}))),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch(t){this.state="disabled",console.error(`${l}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){var t,s,i,o,e,n;this.state="disabled",this.itemIndex=0,null===(t=this.layers)||void 0===t||t.removeAll(),null===(s=this.layers)||void 0===s||s.destroy(),this.layers=null,null===(i=this.layerViews)||void 0===i||i.removeAll(),null===(o=this.layerViews)||void 0===o||o.destroy(),this.layerViews=null,null===(e=this.handles)||void 0===e||e.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initMessages(){let t;try{return t=(await a(this.el))[0],this.messages=Object.assign(Object.assign({},this.messages),t),Promise.resolve()}catch(t){console.error("FAILED TO LOAD MESSAGES"),Promise.reject()}}async initModules(){try{const[t,s,i,o]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/core/Collection","esri/intl"]);return this.reactiveUtils=s,this.Collection=i,this.intl=o,this.handles=new t,this.layers=new i,this.layerViews=new i,Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}async loadMapResources(){const{map:t}=this.view,s=t;try{return await s.loadAll(),Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}generateUID(){return t=>{const s=Math.random(),i=Math.floor(10*Math.random())+11,o=s.toString(i).replace("0.","");t.uid=o}}render(){var t,s;const{state:e}=this,n="disabled"===e,a="loading"===e||"calculating"===e||(null===(t=this.view)||void 0===t?void 0:t.updating)?this.renderProgress():null;return i(o,{class:`${this.getPositionClass} ${this.getStyleClass}`},n?null:[a,(null===(s=this.items)||void 0===s?void 0:s.length)>0?this.renderBase():null])}renderBase(){return i("div",{key:"instant-apps-scoreboard-base",class:l},this.renderContent())}renderContent(){const{state:t}=this;return"loading"===t?this.renderLoader():"calculating"===t||"complete"===t?this.renderItemsContainer():null}renderItemsContainer(){const[t,s]=this.renderPreviousNextButtons();return i("div",{class:h.itemsContainer},t,this.renderItems(),s)}renderPreviousNextButtons(){var t,s,o;const e=this.getItemLimit(),n=(null===(t=this.items.filter((t=>t.visible)))||void 0===t?void 0:t.length)<=e,a=0===this.itemIndex,r=this.isEnd,l=!!this.isMobile||"bottom"===this.position,d=l?"start":"center",c={previous:l?"chevron-left":"chevron-up",next:l?"chevron-right":"chevron-down"},p=a||n?"blank":c.previous,h=r||n?"blank":c.next,b={previous:a||n,next:r||n},u="transparent",m=this.isMobile?"s":"l",v={previous:null===(s=this.messages)||void 0===s?void 0:s.previous,next:null===(o=this.messages)||void 0===o?void 0:o.next};return[i("calcite-action",{onClick:this.previousItem.bind(this),icon:p,disabled:b.previous,alignment:d,scale:m,appearance:u,text:v.previous,label:v.previous}),i("calcite-action",{onClick:this.nextItem.bind(this),icon:h,disabled:b.next,alignment:d,scale:m,appearance:u,text:v.next,label:v.next})]}renderItems(){const{items:t}=h,s=this.getItemsToDisplay.map((t=>this.renderItem(t)));return i("ul",{class:t},s)}renderItem(t){const{label:s}=t;return i("li",{class:h.item},i("span",{class:h.label,title:s},s),this.renderValue(t))}renderValue(t){var s,o,e;const{displayValue:n}=t,a="disabled"===this.state,r=void 0===n&&"calculating"===this.state,l=n||(null===(s=this.messages)||void 0===s?void 0:s.NA),d=null===(o=this.layers)||void 0===o?void 0:o.find((s=>{var i;return(null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id)===s.id})),c=!(null==d?void 0:d.visible),p=r?this.renderValuePlaceholder():a?"":c?i("calcite-icon",{icon:"view-hide",scale:"l",title:null===(e=this.messages)||void 0===e?void 0:e.layerVisibilityOff}):l;return i("span",{class:h.value},p)}renderValuePlaceholder(){return i("span",{class:h.valuePlaceholder})}renderProgress(){return i("calcite-progress",{key:`${d}calcite-progress`,type:"indeterminate"})}renderLoader(){var t;const s=null===(t=this.messages)||void 0===t?void 0:t.loading;return i("calcite-loader",{key:`${d}calcite-loader`,label:s,text:s,scale:"m"})}get getPositionClass(){const{bottom:t,left:s,right:i,side:o}=h.position;return this.isMobile||"bottom"===this.position?t:`${"left"===this.position?s:i} ${o}`}get getStyleClass(){const{floating:t,pinned:s}=h.mode;return this.isMobile?s:"floating"===this.mode?t:s}get checkMobile(){var t,s;const i=null===(s=null===(t=this.el)||void 0===t?void 0:t.parentElement)||void 0===s?void 0:s.offsetWidth;return!isNaN(i)&&i>0&&i<p}get getItemsToDisplay(){const t=this.getItemLimit();return this.items.filter((t=>t.visible)).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){const t=this.getItemLimit(),s=this.items.slice(this.items.length-t).map((t=>t.uid)),i=this.items.slice(this.itemIndex,this.itemIndex+t).map((t=>t.uid));return s.every(((t,s)=>t===i[s]))}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,s){const i=(t,s)=>{const i=t.createQuery(),o=this.geometry?this.geometry:this.view.extent;return i.outStatistics=[s],i.geometry=o,i};t.forEach((()=>async t=>{var o;const e=null===(o=this.layerViews)||void 0===o?void 0:o.find((s=>{var i;return s.layer.id===(null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id)}));if(!e)return;const n=(t=>{const{field:s,operation:i}=t;return{onStatisticField:s,outStatisticFieldName:`${s}_${i}`,statisticType:i}})(t),a=i(e,n),r=e.queryFeatures(a);s.push(r)})())}handleQueryFeaturesResponses(t,s){t.forEach((()=>(t,i)=>{const o=(t=>{const s=t.features[0],{attributes:i}=s;return Object.values(i)[0]})(t),e=null!==o,n=e?this.intl.formatNumber(o,{notation:"compact",compactDisplay:"short"}):null;s[i].displayValue=e?`${n}`:"",s[i].value=o})())}initStationaryWatcher(){var t,s;const i={once:!0,initial:!0},o=()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.interacting)}),(()=>this.calculateScoreboardItemValues()),i)},e="stationary-watcher-key";(null===(t=this.handles)||void 0===t?void 0:t.has(e))&&this.handles.remove(e),null===(s=this.handles)||void 0===s||s.add((()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.stationary}),(()=>o()))})(),e)}initViewUpdateWatcher(){return this.reactiveUtils.watch((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.updating}),(()=>{this.reactiveUtils.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.updating)}),(()=>this.calculateScoreboardItemValues()),{once:!0,initial:!0})}),{initial:!0})}watchLayerVisibility(){var t,s;if(!this.layers)return;const i="visbilityWatcherKey";null===(t=this.handles)||void 0===t||t.remove(i);const o=[];this.layers.forEach((t=>{const s=async()=>{const s=await this.view.whenLayerView(t);await this.reactiveUtils.whenOnce((()=>!1===(null==s?void 0:s.updating))),this.calculateScoreboardItemValues()},i=this.reactiveUtils.watch((()=>null==t?void 0:t.visible),(async()=>s()));o.push(i)})),null===(s=this.handles)||void 0===s||s.add([...o],i)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?6:this.itemLimit}get el(){return e(this)}static get watchers(){return{items:["generateUIDs","storeLayers"],layers:["storeLayerViews"],geometry:["calculateScoreboardItemValuesFromGeometry"],layerViews:["calculateScoreboardItemValues"]}}};b.style=":host{display:block;--instant-apps-scoreboard-background-color:var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color:var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom:0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0px 3px 15px rgba(0, 0, 0, 0.2);border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding:1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word;font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%, -15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:0.5vh;padding-bottom:0.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width: 992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}";export{b as instant_apps_scoreboard}
|
@@ -3,4 +3,4 @@
|
|
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 t,c as i,h as a,H as e,g as
|
6
|
+
import{r as t,c as i,h as a,H as e,g as o}from"./p-78780f63.js";import{g as n}from"./p-6b943f52.js";import{E as c}from"./p-4af32c75.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const r=class{constructor(a){t(this,a),this.layoutChanged=i(this,"layoutChanged",7),this._layoutMode=c.GRID,this._translations=void 0}async componentWillLoad(){await this._getTranslations()}render(){return a(e,null,a("div",{class:"display-flex"},a("div",{class:"display-flex action-center"},a("calcite-icon",{class:"icon icon-color",icon:"information",id:"app-information-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",referenceElement:"app-information-icon"},a("span",{class:"tooltip-message"},this._translations.appInfo))),a("div",{class:"header-text"},this._translations.layout),this._getAction("grid-background",c.GRID,this._translations.grid),this._getAction("vertical-background",c.VERTICAL,this._translations.vertical),this._getAction("horizontal-background",c.HORIZONTAL,this._translations.horizontal)))}_getAction(t,i,e){return a("div",null,a("calcite-action",{alignment:"center",appearance:"transparent",compact:!1,id:t,indicator:i===this._layoutMode,onClick:()=>{this._setLayoutMode(i)},text:""},a("div",{class:t+" img-background"})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("span",null,e)))}_setLayoutMode(t){this._layoutMode=t,this.layoutChanged.emit(this._layoutMode)}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return o(this)}};r.style=":host{display:block}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.display-flex{display:flex}.icon-color{--calcite-color-icon-color:var(--calcite-color-brand)}.icon{cursor:pointer}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.header-text{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);padding-inline:0.75rem;padding-block:0.875rem;line-height:1.25rem}.img-background{background-repeat:no-repeat;background-size:100% 100%;width:38px;height:26px}.grid-background{background-image:url('../../assets/data/images/grid.png')}.horizontal-background{background-image:url('../../assets/data/images/horizontal.png')}.vertical-background{background-image:url('../../assets/data/images/vertical.png')}";export{r as layout_manager}
|
@@ -3,4 +3,4 @@
|
|
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 t,h as i,H as e,g as s}from"./p-78780f63.js";import{g as h}from"./p-6b943f52.js";import{E as l}from"./p-4af32c75.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.classicGrid=!1,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.hideMap=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._translations=void 0,this._layoutMode=l.GRID,this._mapView=void 0,this._panelOpen=!0}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full"},this._getBody(this._layoutMode,this._panelOpen,this.hideMap))))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=this.classicGrid?i?"chevrons-down":"chevrons-up":i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:e=this.classicGrid?i?"chevrons-right":"chevrons-left":i?"chevrons-left":"chevrons-right";break;case l.GRID:e=this.classicGrid?i?"chevrons-up":"chevrons-down":i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-0")+" width-full position-relative";break;case l.GRID:e=this.classicGrid?(i?"position-relative":"position-absolute-53")+" height-full width-full display-flex":"height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:e="height-full position-relative "+(i?"width-1-2":"width-0")}return e}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=this.classicGrid?(i?"height-full":"height-53")+" position-relative width-full display-flex":(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){const h=this.classicGrid&&t===l.GRID&&e?"display-grid":t===l.HORIZONTAL?"":"display-flex";return i("calcite-panel",{class:"width-full height-full"},this.classicGrid?i("div",{class:`width-full height-full ${h}`},this._getTable(t,e),this._getMapAndCard(t,e,s)):i("div",{class:`width-full height-full ${h}`},this._getMapAndCard(t,e,s),this._getTable(t,e)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e);return this.classicGrid?i("div",{class:`${h} overflow-hidden`},this._getCardNode(),this._getMapNode(t,s)):i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,s),this._getPopupExpandNode())}_getMapNode(t,e){var s;return i("div",{class:`${this.classicGrid&&t===l.GRID?"width-full":"adjusted-height-50"} overflow-hidden ${this.classicGrid&&t===l.GRID?"display-flex height-full width-1-2":t!==l.GRID||e?"display-none":""}`},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,hidden:this._expandPopup,mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((t=>!1!==t.visible)),theme:this.theme}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)?"position-absolute-0":"position-absolute-50":"height-full";return i("div",{class:"calcite-mode-dark "+a},i("calcite-panel",null,i("div",{class:"display-flex align-items-center",slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup?"height-full":"height-50")+" width-full",mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e){const s=this._getTableSizeClass(t,e),h=this._getDividerIcon(t,e),a=e?this._translations.close:this._translations.open,o="toggle-layout",d=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:s+" border-bottom"},i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL||this.classicGrid?"horizontal":"vertical",slot:this.classicGrid&&t!==l.VERTICAL?"footer":this.classicGrid&&t===l.VERTICAL?"panel-end":t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:h,id:o,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:a,placement:"bottom","reference-element":o},i("span",null,a))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultGlobalId:d?this._defaultGlobalId:void 0,defaultLayerId:d?this.defaultLayer:"",defaultOid:d&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,enableZoom:this.enableZoom,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_toggleLayout(){this._panelOpen=!this._panelOpen}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),i}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-
|
6
|
+
import{r as t,h as i,H as e,g as s}from"./p-78780f63.js";import{g as h}from"./p-6b943f52.js";import{E as l}from"./p-4af32c75.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.classicGrid=!1,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.hideMap=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._translations=void 0,this._layoutMode=l.GRID,this._mapView=void 0,this._panelOpen=!0}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async componentWillLoad(){await this._getTranslations()}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full"},this._getBody(this._layoutMode,this._panelOpen,this.hideMap))))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=this.classicGrid?i?"chevrons-down":"chevrons-up":i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:e=this.classicGrid?i?"chevrons-right":"chevrons-left":i?"chevrons-left":"chevrons-right";break;case l.GRID:e=this.classicGrid?i?"chevrons-up":"chevrons-down":i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-0")+" width-full position-relative";break;case l.GRID:e=this.classicGrid?(i?"position-relative":"position-absolute-53")+" height-full width-full display-flex":"height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:e="height-full position-relative "+(i?"width-1-2":"width-0")}return e}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=this.classicGrid?(i?"height-full":"height-53")+" position-relative width-full display-flex":(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){const h=this.classicGrid&&t===l.GRID&&e?"display-grid":t===l.HORIZONTAL?"":"display-flex";return i("calcite-panel",{class:"width-full height-full"},this.classicGrid?i("div",{class:`width-full height-full ${h}`},this._getTable(t,e),this._getMapAndCard(t,e,s)):i("div",{class:`width-full height-full ${h}`},this._getMapAndCard(t,e,s),this._getTable(t,e)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e);return this.classicGrid?i("div",{class:`${h} overflow-hidden`},this._getCardNode(),this._getMapNode(t,s)):i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,s),this._getPopupExpandNode())}_getMapNode(t,e){var s;return i("div",{class:`${this.classicGrid&&t===l.GRID?"width-full":"adjusted-height-50"} overflow-hidden ${this.classicGrid&&t===l.GRID?"display-flex height-full width-1-2":t!==l.GRID||e?"display-none":""}`},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,hidden:this._expandPopup,mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((t=>!1!==t.visible)),theme:this.theme}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)?"position-absolute-0":"position-absolute-50":"height-full";return i("div",{class:"calcite-mode-dark "+a},i("calcite-panel",null,i("div",{class:"display-flex align-items-center",slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup?"height-full":"height-50")+" width-full",mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e){const s=this._getTableSizeClass(t,e),h=this._getDividerIcon(t,e),a=e?this._translations.close:this._translations.open,o="toggle-layout",d=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:s+" border-bottom"},i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL||this.classicGrid?"horizontal":"vertical",slot:this.classicGrid&&t!==l.VERTICAL?"footer":this.classicGrid&&t===l.VERTICAL?"panel-end":t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:h,id:o,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:a,placement:"bottom","reference-element":o},i("span",null,a))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultGlobalId:d?this._defaultGlobalId:void 0,defaultLayerId:d?this.defaultLayer:"",defaultOid:d&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,enableZoom:this.enableZoom,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_toggleLayout(){this._panelOpen=!this._panelOpen}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),i}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}";export{a as crowdsource_manager}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as o,h as i,H as e,g as a}from"./p-78780f63.js";import{g as l}from"./p-83225907.js";import"./p-a8a0187d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";const s=class{constructor(i){t(this,i),this.measureActive=o(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){l(this)}componentDidLoad(){}render(){var t;return i(e,null,i("calcite-panel",{heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},i("div",null,this.renderActionPad()),this.renderMeasureToolPanel()))}renderMeasureToolPanel(){const{view:t,coordinateFormat:o,areaUnit:e,linearUnit:a,activeToolType:l}=this;return i("calcite-panel",{class:"instant-apps-measurement__content"},i("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:o,areaUnit:e,linearUnit:a,activeToolType:l}}))}renderActionPad(){const{messages:t,activeToolType:o}=this;return i("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},i("calcite-action",{class:"distance"===o?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.line)),i("calcite-action",{class:"area"===o?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.area)),i("calcite-action",{class:"point"===o?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.point)),i("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var o,i,e,a;if(!(null==this?void 0:this.measureTool))return;const l=null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.dataset.value;this.measureTool.activeTool=l;const s=document.getElementsByClassName("active-tool");for(let t=0;t<(null==s?void 0:s.length);t++)null===(e=null===(i=s[t])||void 0===i?void 0:i.classList)||void 0===e||e.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==l&&"clear"!==l)}get el(){return a(this)}};s.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{s as instant_apps_measurement}
|
@@ -3,4 +3,4 @@
|
|
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 t,c as s,h as i,g as e}from"./p-78780f63.js";import{S as n}from"./p-a230b270.js";import{b as o}from"./p-
|
6
|
+
import{r as t,c as s,h as i,g as e}from"./p-78780f63.js";import{S as n}from"./p-a230b270.js";import{b as o}from"./p-83225907.js";import"./p-a8a0187d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";function l(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const a=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=n)||"function"!=typeof e?null:new e({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"]}},!0),this.localStorageKey=void 0,this.titleText="",this.content="",this.primaryButtonText="",this.open=!0,this.closeButtonDisabled=!1,this.messages=void 0}sanitizeContent(){this.content=this._sanitizer.sanitize(this.content)}componentWillLoad(){let t;const{localStorageKey:s}=this;t=s?this.open&&!l(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){this.setMessages()}render(){return i("calcite-modal",{onCalciteModalClose:this.close.bind(this),open:this.open,closeButtonDisabled:this.closeButtonDisabled},this.renderHeader(),this.renderContent(),this.localStorageKey?this.renderDontShowThisAgainCheckbox():null,this.renderPrimaryButton())}renderHeader(){const{titleText:t}=this;return i("header",{slot:"header"},t)}renderContent(){const{content:t}=this;return i("div",{slot:"content",innerHTML:t})}renderDontShowThisAgainCheckbox(){const{localStorageKey:t,messages:s}=this,e=!!l(t)||null;return i("div",{class:"instant-apps-splash__back-content",slot:"back"},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{onCalciteCheckboxChange:this.handleDontShowThisAgain.bind(this),checked:null!=e?e:void 0}),null==s?void 0:s.dontShowThisAgain))}renderPrimaryButton(){const{primaryButtonText:t}=this;return i("calcite-button",{onClick:this.close.bind(this),slot:"primary"},t)}close(){this.open=!1,this.splashClose.emit()}async setMessages(){const t=await o(this.el);this.messages=t[0]}handleDontShowThisAgain(t){const{localStorageKey:s}=this;if(!s)return;const i=t.target,{checked:e}=i;e?null===window||void 0===window||window.localStorage.setItem(s,"false"):function(t){var s;null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s||s.removeItem(t)}(s)}get el(){return e(this)}static get watchers(){return{content:["sanitizeContent"]}}};a.style=":host{display:block}:host .instant-apps-splash__back-content{display:flex;align-items:center}:host .instant-apps-splash__back-content calcite-label{--calcite-label-margin-bottom:0}";export{a as instant_apps_splash}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as i,H as s,g as e,c as h}from"./p-78780f63.js";import{g as o}from"./p-6b943f52.js";import{q as a,a as l,g as n,b as d,c as r}from"./p-b7e2c75b.js";import{l as c}from"./p-48ff9cea.js";import{d as p}from"./p-d6050d57.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-4af32c75.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const v=class{constructor(i){t(this,i),this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const s=i.length>0?await a(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((t,s)=>i.indexOf(t.getObjectId())-i.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await l(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,e;const h=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",o=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return i(s,null,i("div",{class:"overflow-auto height-full"},i("calcite-shell",{class:"position-relative "+h},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("calcite-shell",{class:"position-relative "+o},i("div",{class:"padding-1"},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return e(this)}};v.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const u=class{constructor(i){t(this,i),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._allIds=[],this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.defaultLayerId=void 0,this.defaultGlobalId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.enableZoom=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._confirmDelete=!1,this._controlsThatFit=void 0,this._fetchingData=!1,this._filterOpen=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showHideOpen=!1,this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}enableZoomWatchHandler(){var t;(null===(t=this._toolInfos)||void 0===t?void 0:t.length)>0&&this._initToolInfos()}enableCSVWatchHandler(){var t;(null===(t=this._toolInfos)||void 0===t?void 0:t.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}_controlsThatFitWatchHandler(){const t=this._controlsThatFit?this._controlsThatFit.reduce(((t,i)=>(t.push(i.id),t)),[]):[];this._toolInfos=this._toolInfos.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._updateShareUrl(),this._initLayerExpressions(),this._fetchingData=!1}async _selectedIndexesWatchHandler(){this._updateShareUrl(),this._validateEnabledActions()}async _sortActiveWatchHandler(){this._sortActive||await this._sortTable()}async selectionChanged(t){if(this.zoomAndScrollToSelected){const i=t.detail,s=i.getObjectId(),e=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(e);const h=i.layer;let o;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===h.title&&"feature"===t.layer.type)return o=t,!0})),o&&await n([s],o,this.mapView,!0)}}async editsComplete(){await this._refresh()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),o=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full-adjusted width-full"},i("calcite-panel",{class:"height-full width-full"},i("calcite-loader",{class:e,label:this._translations.fetchingData,scale:"l"}),i("div",{class:t,ref:this.onTableNodeCreate})),i("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",o)))),this._deleteMessage(),this._filterModal())}async componentDidLoad(){this._resizeObserver.observe(this._toolbar),document.onclick=t=>this._handleDocumentClick(t)}componentDidRender(){this._updateToolbar()}async _initModules(){const[t,i]=await c(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_onResize(){this._updateToolbar()}_getTableControlRow(t){return i("div",{class:"display-flex border-bottom height-51",ref:t=>this._toolbar=t,slot:t},this._getActionBar(),this._getDropdown("more-table-options"),this.enableShare?this._getShare("share"):void 0)}_getActionBar(){return i("calcite-action-bar",{expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},i("div",{class:"border-end",id:"solutions-map-layer-picker-container"},i("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this._getActions())}_getActions(){return this._getActionItems().reduce(((t,s)=>(s&&!s.isOverflow&&t.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?i("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._showHideDropdown=t},this._getAction(this._showHideOpen?"chevron-down":s.icon,s.label,s.func,s.disabled,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.icon,s.label,s.func,s.disabled)),t)),[])}_getFieldlist(){return this._columnsInfo?i("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((t=>i("calcite-dropdown-item",{id:t,onClick:t=>{const i=t.target;this._columnsInfo[i.id]=i.selected,i.selected?this._table.showColumn(i.id):this._table.hideColumn(i.id)},selected:this._columnsInfo[t]},t)))):void 0}_validateEnabledActions(){const t=this._featuresSelected(),i=["zoom-to-object","trash","erase","selected-items-filter"];this._toolInfos.forEach((s=>{s&&i.indexOf(s.icon)>-1&&(s.disabled=!t)}))}_initToolInfos(){const t=this._featuresSelected(),i=this._featuresEmpty(),s=this._hasFilterExpressions();this._toolInfos=[this.enableZoom?{icon:"zoom-to-object",label:this._translations.zoom,func:()=>this._zoom(),disabled:!t,isOverflow:!1}:void 0,s?{icon:"filter",label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{icon:"trash",label:this._translations.delete,func:()=>this._delete(),disabled:!t,isDanger:!0,isOverflow:!1}:void 0,{icon:"erase",label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!t,isOverflow:!1},{icon:"selected-items-filter",label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!t,isOverflow:!1},{icon:"list-check-all",func:()=>this._selectAll(),label:this._translations.selectAll,disabled:i,isOverflow:!1},{icon:"compare",func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:i,isOverflow:!1},{icon:"refresh",func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{icon:"export",func:()=>{this._exportToCSV()},label:this._translations.exportCSV,disabled:i,isOverflow:!1}:void 0,{icon:this._showHideOpen?"chevron-down":"chevron-right",func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0}_featuresSelected(){return this._selectedIndexes.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var t,i;let s;return(null===(i=null===(t=this.mapInfo)||void 0===t?void 0:t.filterConfig)||void 0===i?void 0:i.layerExpressions)&&(s=this.mapInfo.filterConfig.layerExpressions.filter((t=>t.id===this._layer.id))),(null==s?void 0:s.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const t=this._toolbar.offsetWidth;let i=this._toolbarSizeInfos.reduce(((t,i)=>t+i.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(i>t){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(i>t?i-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((t,i)=>(t.push(i.id),t)),[]);let h=!1;const o=[...this._defaultVisibleToolSizeInfos].reduce(((o,a)=>(!h&&s.indexOf(a.id)<0&&(e.indexOf(a.id)>-1||i+a.width<=t)?(e.indexOf(a.id)<0&&(i+=a.width),o.push(a)):s.indexOf(a.id)<0&&i+a.width>t&&(h=!0),o)),[]);this._setControlsThatFit(o,s)}}),5)}_setControlsThatFit(t,i){let s=JSON.stringify(t)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((t=>{i.indexOf(t.id)<0&&!s&&(s=this._controlsThatFit.map((t=>t.id)).indexOf(t.id)<0)})),s&&(this._controlsThatFit=[...t])}_setToolbarSizeInfos(){let t=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((i,s)=>{0===s?i.childNodes.forEach((i=>{this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0)})):i.referenceElement||(this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0))})),t&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){return this._toolInfos.filter((t=>t&&!t.isOverflow))}_getDropdown(t){const s=this._getDropdownItems();return s.length>0?i("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._moreDropdown=t},i("calcite-action",{appearance:"solid",id:t,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},s.map((t=>i("calcite-dropdown-group",{class:t.disabled?"disabled":"",selectionMode:t.disabled?"none":"single"},i("calcite-dropdown-item",{iconStart:t.isSublist&&this._showHideOpen?"chevron-down":t.icon,id:"solutions-subset-list",onClick:t.func},t.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){return this._toolInfos.filter((t=>t&&t.isOverflow))}_getAction(t,s,e,h,o){const a=void 0===this._layer||h;return i("div",{class:"display-flex",id:this._getId(t),slot:o},i("calcite-action",{appearance:"solid",disabled:a,icon:t,id:t,label:s,onClick:e,text:s,textEnabled:!0}),this._getToolTip("bottom",t,s))}_getShare(t){return i("div",{class:"share-action",id:this._getId(t)},i("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:t=>this._shareNode=t,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",t,this._translations.share))}_updateShareUrl(){var t,i,s,e;const h=null===(t=this._shareNode)||void 0===t?void 0:t.shareUrl;if(!h)return;const o=new URL(h);(null===(i=this.mapInfo)||void 0===i?void 0:i.id)&&o.searchParams.set("webmap",this.mapInfo.id),(null===(s=this._layer)||void 0===s?void 0:s.id)&&o.searchParams.set("layer",this._layer.id),(null===(e=this._selectedIndexes)||void 0===e?void 0:e.length)>0&&o.searchParams.set("oid",this._selectedIndexes.join(",")),this._shareNode.shareUrl=o.href}_getToolTip(t,s,e){return i("calcite-tooltip",{placement:t,"reference-element":s},i("span",null,e))}_getId(t){return`solutions-action-${t}`}_getDangerAction(t,s,e,h){const o=void 0===this._layer||h;return i("div",{class:"display-flex",id:this._getId(t)},i("calcite-action",{appearance:"solid",disabled:o,id:t,onClick:e,text:""},i("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},s)),this._getToolTip("bottom",t,s))}async _getTable(t,i){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),this._initColumnsInfo(),this._checkEditEnabled(),await this._table.when((()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray().reverse(),this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,h;this._sortActive=!!this._layer&&(t.length>0&&"asc"===(null===(i=t[0])||void 0===i?void 0:i.direction)||"desc"===(null===(s=t[0])||void 0===s?void 0:s.direction)||null===(null===(e=t[0])||void 0===e?void 0:e.direction)&&(null===(h=t[0])||void 0===h?void 0:h.fieldName)===this._layer.objectIdField)}))})))}async _resetTable(){var t;this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes);const i=this._getColumnTemplates(this._layer.id,null===(t=this._layer)||void 0===t?void 0:t.fields);this._allIds=await d(this._layer),this._table?i&&(this._table.tableTemplate.columnTemplates=i):await this._getTable(this._tableNode,i),this._table.layer=this._layer,this._table.view=this.mapView,this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._initToolInfos(),await this._table.when((async()=>{var t,i;if(this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._initColumnsInfo(),!this._defaultOidHonored&&(null===(t=this.defaultOid)||void 0===t?void 0:t.length)>0&&this.defaultOid[0]>-1&&(this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0),!this._defaultGlobalIdHonored&&(null===(i=this.defaultGlobalId)||void 0===i?void 0:i.length)>0){const t=await r(this.defaultGlobalId,this._layer),i=(null==t?void 0:t.length)>0?t.map((t=>t.getObjectId())):void 0;i&&this._selectDefaultFeature(i),this._defaultGlobalIdHonored=!0}})),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()}_initColumnsInfo(){this._columnsInfo=this._table.columns.reduce(((t,i)=>(t[i.name]=!i.hidden,t)),{})}_selectDefaultFeature(t){t.length>0&&(this._table.highlightIds.addMany(t),this._table.when((()=>{const i=this._table.viewModel.getObjectIdIndex(t[0]);this._table.viewModel.scrollToIndex(i)})))}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){this._table&&this._layer&&!this._sortActive&&!this._tableSorting&&this.showNewestFirst&&(this._tableSorting=!0,await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(this._layer.objectIdField,"desc"),this._tableSorting=!1})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(t){var i;const s=null===(i=t.target)||void 0===i?void 0:i.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_filterModal(){var t,s,e;return i("calcite-modal",{"aria-labelledby":"modal-title",kind:"brand",onCalciteModalClose:()=>this._closeFilter(),open:this._filterOpen,widthScale:"s"},i("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(t=this._translations)||void 0===t?void 0:t.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),i("div",{slot:"content"},i("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:()=>this._closeFilter(),layerExpressions:this._layerExpressions,ref:t=>this._filterList=t,view:this.mapView})))}_closeFilter(){this._filterOpen=!1}_deleteMessage(){return i("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",onCalciteModalClose:()=>this._deleteClosed(),open:this._confirmDelete},i("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations.deleteFeature),i("div",{slot:"content"},this._translations.confirm),i("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._deleteClosed(),slot:"secondary",width:"full"},this._translations.cancel),i("calcite-button",{kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"primary",width:"full"},this._translations.delete))}async _deleteFeatures(){this._isDeleting=!0;const t=this._table.highlightIds.toArray().map((t=>({objectId:t})));await this._layer.applyEdits({deleteFeatures:t}),await this._table.refresh(),this._allIds=await d(this._layer),this._isDeleting=!1,this._deleteClosed()}async _mapClicked(t){const i={include:this._layer},s=await this.mapView.hitTest(t.screenPoint,i);s.results.length>0&&(s.results.forEach((t=>{this._clearSelection();const i=t.graphic.getObjectId(),s=this._table.highlightIds.indexOf(i);s>-1?this._table.highlightIds.removeAt(s):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_deleteClosed(){this._confirmDelete=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var t;this._selectedIndexes=[],null===(t=this._table)||void 0===t||t.highlightIds.removeAll()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var t;const i=null===(t=this.mapInfo.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=i.filter((t=>t.id===this._layer.id))}_switchSelected(){const t=[...this._selectedIndexes];this._table.highlightIds.removeAll();const i=this._allIds.reduce(((i,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]).sort(((t,i)=>t-i));this._table.highlightIds.addMany(i),this._selectedIndexes=i}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[this._layer.title],ids:i,layer:this._layer},p(null,t,!1,!1,!0)}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this._selectedIndexes)}_zoom(){this._table.zoomToSelection()}_delete(){this._confirmDelete=!0}async _layerSelectionChanged(t){var i;const s=t.detail[0];if(s!==(null===(i=this._layer)||void 0===i?void 0:i.id)||this._featuresEmpty()){this._fetchingData=!0;const t=await l(this.mapView,s);await t.when((()=>{this._layer=t}))}this._fetchingData=!1}_getColumnTemplates(t,i){var s;let e;null===(s=this.mapInfo.layerInfos)||void 0===s||s.some((i=>{if(i.id===t)return e=i,!0}));let h=null==e?void 0:e.columnTemplates;return i&&(h=h?h.map((t=>(i.some((i=>{if(i.name===t.fieldName)return t.label=i.alias,!0})),t))):i.map((t=>({type:"field",fieldName:t.name,label:t.alias})))),h}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_selectedIndexes:["_selectedIndexesWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};u.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}';const b=class{constructor(i){t(this,i),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.mapInfos=[],this.mapView=void 0,this.theme=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){var t,e;const h=this.hidden?"visibility-hidden":"",o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=(null===(t=this.mapInfos)||void 0===t?void 0:t.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return i(s,null,i("map-picker",{class:a,mapInfos:this.mapInfos,ref:t=>this._mapPicker=t}),i("div",{class:`${l} ${h}`,ref:t=>this._mapDiv=t}),i("map-tools",{basemapConfig:this.basemapConfig,class:`box-shadow ${o}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableLegend:this.enableLegend,enableSearch:this.enableSearch,mapView:this.mapView,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration}))}async _initModules(){const[t,i,s]=await c(["esri/WebMap","esri/views/MapView","esri/widgets/Home"]);this.WebMap=t,this.MapView=i,this.Home=s}async _loadMap(t){var i;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((t=>t.id===this.defaultWebmapId));this._webMapInfo=s&&e?e[0]:!(null==t?void 0:t.id)&&this.mapInfos.length>0?this.mapInfos[0]:t;const h=this._webMapInfo.id,o=s&&(null==t?void 0:t.id)===this.defaultWebmapId;if(this._loadedId!==h&&!s||o){const t=new this.WebMap({portalItem:{id:h}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"center"}),this._loadedId=h,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0}),this._defaultWebmapHonored=!!o||this._defaultWebmapHonored,this.mapChanged.emit({id:h,mapView:this.mapView})}))}else s&&(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(h))}_initHome(){this.enableHome?(this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:"top-left",index:3})):this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};b.style=":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{visibility:hidden}.display-none{display:none}";export{v as card_manager,u as layer_table,b as map_card}
|
@@ -26,4 +26,4 @@ const wt=class{constructor(t){i(this,t),this.calciteDropdownSelect=e(this,"calci
|
|
26
26
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
27
27
|
* v2.0.0
|
28
28
|
*/
|
29
|
-
const yt="container",kt=class{constructor(t){i(this,t),this.calciteInternalDropdownItemChange=e(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=F("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const i=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,e=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(s,{"aria-label":this.groupTitle,role:"group"},t("div",{class:{[yt]:!0,[`${yt}--${this.scale}`]:!0}},e,i,t("slot",null)))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};kt.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const Ct=class{constructor(t){i(this,t),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.selected=!1,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.href=void 0,this.label=void 0,this.rel=void 0,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){var t;await A(this),null===(t=this.el)||void 0===t||t.focus()}componentWillLoad(){P(this),this.initialize()}componentDidLoad(){O(this)}connectedCallback(){this.initialize()}render(){const{href:i,selectionMode:e,label:n,iconFlipRtl:o,scale:a}=this,l=t("calcite-icon",{class:"dropdown-item-icon-start",flipRtl:"start"===o||"both"===o,icon:this.iconStart,scale:Z(this.scale)}),c=t("span",{class:"dropdown-item-content"},t("slot",null)),h=t("calcite-icon",{class:"dropdown-item-icon-end",flipRtl:"end"===o||"both"===o,icon:this.iconEnd,scale:Z(this.scale)}),d=this.iconStart&&this.iconEnd?[l,c,h]:this.iconStart?[l,c]:this.iconEnd?[c,h]:c,p=i?t("a",{"aria-label":n,class:"dropdown-link",href:i,rel:this.rel,tabIndex:-1,target:this.target,ref:t=>this.childLink=t},d):d,m=i?null:"single"===e?"menuitemradio":"multiple"===e?"menuitemcheckbox":"menuitem",u="none"!==e?r(this.selected):null;return t(s,{"aria-checked":u,"aria-label":i?"":n,role:m,tabindex:"0"},t("div",{class:{[yt]:!0,"container--link":!!i,[`${yt}--${a}`]:!0,"container--multi-selection":"multiple"===e,"container--single-selection":"single"===e,"container--none-selection":"none"===e}},"none"!==e?t("calcite-icon",{class:"dropdown-item-icon",icon:"multiple"===e?"check":"bullet-point",scale:Z(this.scale)}):null,p))}onClick(){this.emitRequestedItem()}keyDownHandler(t){switch(t.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),t.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),t.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":t.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t})}}updateActiveItemOnChange(t){t.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.determineActiveItem()),t.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return n(this)}};Ct.style=".container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover) .container,:host(:active) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover) .container--link .dropdown-link,:host(:active) .container--link .dropdown-link{color:var(--calcite-color-text-1)}:host(:focus) .container{color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:active) .container{background-color:var(--calcite-color-foreground-3)}:host(:hover) .container:before,:host(:active) .container:before,:host(:focus) .container:before{opacity:1}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection):before,:host([selected]) .container--link .dropdown-link:before{opacity:1;color:var(--calcite-color-brand)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-color-brand)}.container--multi-selection:before,.container--none-selection:before{display:none}.container--s:before{inset-inline-start:0.5rem}.container--m:before{inset-inline-start:0.75rem}.container--l:before{inset-inline-start:1rem}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}";const zt=class{constructor(t){i(this,t),this.noLayersFound=e(this,"noLayersFound",7),this.layerSelectionChange=e(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.enabledLayerIds=[],this.enabledTableIds=[],this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const i="map-layer-picker";return t(s,null,t("div",{class:"map-layer-picker-container"},t("div",{class:"map-layer-picker"},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(i):"select"===this.type?this._getSelect(i):this._getDropdown(i):this._getInvalidPlaceholder(),t("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},t("span",null,this._translations.switchLayer)))))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return t("div",null,t("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},t("div",{slot:"message"},this._translations.noLayersFound)),t("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},t("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return t("div",{class:"layer-picker-label-container"},t("calcite-icon",{icon:"layers",scale:"s"}),t("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(i){return t("calcite-select",{id:i,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(i){return t("calcite-combobox",{clearDisabled:!0,id:i,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(i){return t("calcite-dropdown",{class:"layer-picker-dropdown"},t("calcite-action",{id:i,slot:"trigger",text:""},t("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:"max-width-350",iconEnd:"chevron-down",iconStart:"layers",kind:"neutral",width:"full"},t("div",null,this.selectedName))),t("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(i,e){const s="layer"===e?this._layerNameHash[i]:this._tableNameHash[i],n=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,a=this.selectedIds.indexOf(i)>-1;return"combobox"===this.type?t("calcite-combobox-item",{disabled:n,selected:a,textLabel:o,value:i}):"select"===this.type?t("calcite-option",{disabled:n,label:o,selected:a,value:i}):t("calcite-dropdown-group",{class:n?"disabled":"",selectionMode:n?"none":"single"},t("calcite-dropdown-item",{onClick:n?void 0:()=>{this._setSelectedLayer(i)},selected:a},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))]}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await ot(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await at(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&<.managedLayers.indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?lt.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await nt(this.el);this._translations=t[0]}get el(){return n(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};zt.style=":host{display:block}.map-layer-picker-container{width:100%;height:100%}.map-layer-picker{position:relative;width:100%;display:inline-block;height:100%}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}";export{bt as calcite_combobox,xt as calcite_combobox_item,wt as calcite_dropdown,kt as calcite_dropdown_group,Ct as calcite_dropdown_item,zt as map_layer_picker}
|
29
|
+
const yt="container",kt=class{constructor(t){i(this,t),this.calciteInternalDropdownItemChange=e(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=F("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const i=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,e=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(s,{"aria-label":this.groupTitle,role:"group"},t("div",{class:{[yt]:!0,[`${yt}--${this.scale}`]:!0}},e,i,t("slot",null)))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};kt.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const Ct=class{constructor(t){i(this,t),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.selected=!1,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.href=void 0,this.label=void 0,this.rel=void 0,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){var t;await A(this),null===(t=this.el)||void 0===t||t.focus()}componentWillLoad(){P(this),this.initialize()}componentDidLoad(){O(this)}connectedCallback(){this.initialize()}render(){const{href:i,selectionMode:e,label:n,iconFlipRtl:o,scale:a}=this,l=t("calcite-icon",{class:"dropdown-item-icon-start",flipRtl:"start"===o||"both"===o,icon:this.iconStart,scale:Z(this.scale)}),c=t("span",{class:"dropdown-item-content"},t("slot",null)),h=t("calcite-icon",{class:"dropdown-item-icon-end",flipRtl:"end"===o||"both"===o,icon:this.iconEnd,scale:Z(this.scale)}),d=this.iconStart&&this.iconEnd?[l,c,h]:this.iconStart?[l,c]:this.iconEnd?[c,h]:c,p=i?t("a",{"aria-label":n,class:"dropdown-link",href:i,rel:this.rel,tabIndex:-1,target:this.target,ref:t=>this.childLink=t},d):d,m=i?null:"single"===e?"menuitemradio":"multiple"===e?"menuitemcheckbox":"menuitem",u="none"!==e?r(this.selected):null;return t(s,{"aria-checked":u,"aria-label":i?"":n,role:m,tabindex:"0"},t("div",{class:{[yt]:!0,"container--link":!!i,[`${yt}--${a}`]:!0,"container--multi-selection":"multiple"===e,"container--single-selection":"single"===e,"container--none-selection":"none"===e}},"none"!==e?t("calcite-icon",{class:"dropdown-item-icon",icon:"multiple"===e?"check":"bullet-point",scale:Z(this.scale)}):null,p))}onClick(){this.emitRequestedItem()}keyDownHandler(t){switch(t.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),t.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),t.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":t.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t})}}updateActiveItemOnChange(t){t.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.determineActiveItem()),t.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return n(this)}};Ct.style=".container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover) .container,:host(:active) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover) .container--link .dropdown-link,:host(:active) .container--link .dropdown-link{color:var(--calcite-color-text-1)}:host(:focus) .container{color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:active) .container{background-color:var(--calcite-color-foreground-3)}:host(:hover) .container:before,:host(:active) .container:before,:host(:focus) .container:before{opacity:1}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection):before,:host([selected]) .container--link .dropdown-link:before{opacity:1;color:var(--calcite-color-brand)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-color-brand)}.container--multi-selection:before,.container--none-selection:before{display:none}.container--s:before{inset-inline-start:0.5rem}.container--m:before{inset-inline-start:0.75rem}.container--l:before{inset-inline-start:1rem}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}";const zt=class{constructor(t){i(this,t),this.noLayersFound=e(this,"noLayersFound",7),this.layerSelectionChange=e(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.enabledLayerIds=[],this.enabledTableIds=[],this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const i="map-layer-picker";return t(s,null,t("div",{class:"map-layer-picker-container"},t("div",{class:"map-layer-picker"},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(i):"select"===this.type?this._getSelect(i):this._getDropdown(i):this._getInvalidPlaceholder(),t("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},t("span",null,this._translations.switchLayer)))))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return t("div",null,t("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},t("div",{slot:"message"},this._translations.noLayersFound)),t("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},t("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return t("div",{class:"layer-picker-label-container cursor-default"},t("calcite-icon",{icon:"layers",scale:"s"}),t("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(i){return t("calcite-select",{id:i,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(i){return t("calcite-combobox",{clearDisabled:!0,id:i,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(i){return t("calcite-dropdown",{class:"layer-picker-dropdown"},t("calcite-action",{id:i,slot:"trigger",text:""},t("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:"max-width-350",iconEnd:"chevron-down",iconStart:"layers",kind:"neutral",width:"full"},t("div",null,this.selectedName))),t("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(i,e){const s="layer"===e?this._layerNameHash[i]:this._tableNameHash[i],n=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,a=this.selectedIds.indexOf(i)>-1;return"combobox"===this.type?t("calcite-combobox-item",{disabled:n,selected:a,textLabel:o,value:i}):"select"===this.type?t("calcite-option",{disabled:n,label:o,selected:a,value:i}):t("calcite-dropdown-group",{class:n?"disabled":"",selectionMode:n?"none":"single"},t("calcite-dropdown-item",{onClick:n?void 0:()=>{this._setSelectedLayer(i)},selected:a},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))]}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await ot(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await at(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&<.managedLayers.indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?lt.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await nt(this.el);this._translations=t[0]}get el(){return n(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};zt.style=":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{bt as calcite_combobox,xt as calcite_combobox_item,wt as calcite_dropdown,kt as calcite_dropdown_group,Ct as calcite_dropdown_item,zt as map_layer_picker}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as e,f as t,h as n,g as i,c as a}from"./p-78780f63.js";import{l as s}from"./p-a8a0187d.js";import{g as r,i as l,q as c,r as o,t as p,m as d,w as v,x as g,k as h,v as m}from"./p-68434a63.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";const u=class{constructor(t){e(this,t),this.showTotal=!1,this.legendvm=void 0,this.activeLayerInfo=void 0,this.categoryId=void 0,this.infoIndex=void 0,this.messages=void 0,this.selected=void 0,this.legendElement=void 0}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e]=await s(["esri/intl","esri/core/reactiveUtils","esri/core/Handles"]);this.intl=e}render(){var e;return n("div",{key:"int-legend-count"},this.showTotal?n("span",null,null===(e=this.messages)||void 0===e?void 0:e.totalFeatureCount,": ",this.getTotalFeatureCount()):n("span",{key:"element-info-count",class:` instant-apps-interactive-legend__info-count-text ${r(this.el)}${this.selected?" instant-apps-interactive-legend__info-count-text--selected":""}`},this.getCount()))}getCount(){var e,t;const{categoryId:n}=this,i=this.activeLayerInfo.layer.id,a=null===(t=null===(e=l.data[i])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size;if(!(l.data&&i&&n||a))return"";const s=l.data[i];if(!s)return;const{categories:r}=s,c=r.get(n);let o;return o=(null==c?void 0:c.nestedInfos)?g(c,this.infoIndex):c,isNaN(null==o?void 0:o.count)?"":this.intl.formatNumber(o.count)}getTotalFeatureCount(){const e=this.activeLayerInfo.layer.id;if(!l.data||!e)return"";const t=l.data[e];if(!t)return;const{categories:n}=t,i=c(n);let a;if(o(n))a=p(i);else if(d(this.activeLayerInfo)){const e=h(this.activeLayerInfo.layer);a=c(e.categories)[1].count}else a=v(i);return this.intl.formatNumber(a)}get el(){return i(this)}};u.style=".sc-instant-apps-interactive-legend-count-h{display:flex;align-items:center}.instant-apps-interactive-legend__info-count-text.sc-instant-apps-interactive-legend-count{font-size:var(--instant-apps-interactive-legend-info-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.calcite-mode-dark.instant-apps-interactive-legend__info-count-text.instant-apps-interactive-legend__info-count-text--selected.sc-instant-apps-interactive-legend-count{color:var(--calcite-color-text-inverse)}html[dir=rtl] .sc-instant-apps-interactive-legend-count-h{margin-left:0;margin-right:auto}";const y=class{constructor(t){e(this,t),this.layerCaptionElementExpandUpdatedEvent=a(this,"layerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,t,i;const a=m(this.activeLayerInfo),{expanded:s}=this,l=s?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(t=this.messages)||void 0===t?void 0:t.expand,c=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return n("header",{class:`instant-apps-interactive-legend__header ${r(this.el)}`},n("calcite-action",{onClick:this.toggleExpanded(),icon:s?"chevron-down":"chevron-up",appearance:"transparent",text:l,label:l,scale:"s"}),n("span",null,n("span",{class:"instant-apps-interactive-legend__header-action-container"},n("h3",{class:`esri-widget__heading esri-legend__service-label${c}`},null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title)),this.featureCount&&a?n("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.layerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};y.style=".sc-instant-apps-interactive-legend-layer-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption h3.sc-instant-apps-interactive-legend-layer-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color);margin-bottom:5px}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-layer-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption span.sc-instant-apps-interactive-legend-layer-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-layer-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{u as instant_apps_interactive_legend_count,y as instant_apps_interactive_legend_layer_element_caption}
|