@esri/solutions-components 0.10.6 → 0.10.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +24 -8
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-combobox_3.cjs.entry.js +354 -967
  4. package/dist/cjs/calcite-graph_2.cjs.entry.js +1082 -0
  5. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
  6. package/dist/cjs/calcite-tree_3.cjs.entry.js +1 -1
  7. package/dist/cjs/card-manager_3.cjs.entry.js +246 -18
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +169 -49
  9. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -1
  10. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +40 -21
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  13. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  14. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  15. package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
  16. package/dist/cjs/share-item.cjs.entry.js +1 -1
  17. package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
  18. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
  19. package/dist/cjs/solutions-components.cjs.js +1 -1
  20. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  21. package/dist/collection/assets/t9n/crowdsource-manager/resources.json +5 -1
  22. package/dist/collection/assets/t9n/crowdsource-manager/resources_en.json +5 -1
  23. package/dist/collection/assets/t9n/layer-table/resources.json +1 -0
  24. package/dist/collection/assets/t9n/layer-table/resources_en.json +1 -0
  25. package/dist/collection/assets/t9n/map-card/resources.json +6 -1
  26. package/dist/collection/assets/t9n/map-card/resources_en.json +6 -1
  27. package/dist/collection/components/card-manager/card-manager.js +34 -8
  28. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +173 -65
  29. package/dist/collection/components/layer-table/layer-table.js +175 -8
  30. package/dist/collection/components/map-card/map-card.css +4 -0
  31. package/dist/collection/components/map-card/map-card.js +368 -3
  32. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  33. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  34. package/dist/collection/components/map-layer-picker/map-layer-picker.js +9 -3
  35. package/dist/collection/components/map-legend/map-legend.js +1 -1
  36. package/dist/collection/components/map-picker/map-picker.css +8 -0
  37. package/dist/collection/components/map-picker/map-picker.js +74 -3
  38. package/dist/collection/components/map-search/map-search.js +1 -1
  39. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  40. package/dist/collection/components/map-tools/map-tools.js +1 -1
  41. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  42. package/dist/collection/components/pdf-download/pdf-download.js +1 -1
  43. package/dist/collection/components/public-notification/public-notification.js +1 -1
  44. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
  45. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  46. package/dist/collection/components/share-item/share-item.js +1 -1
  47. package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
  48. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  49. package/dist/collection/components/solution-item/solution-item.js +1 -1
  50. package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
  51. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  52. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
  53. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
  54. package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
  55. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
  56. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  57. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  58. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  59. package/dist/collection/demos/crowdsource-manager.html +1 -0
  60. package/dist/components/card-manager2.js +20 -8
  61. package/dist/components/crowdsource-manager.js +172 -53
  62. package/dist/components/instant-apps-control-panel.js +2 -1
  63. package/dist/components/instant-apps-time-filter.js +46 -23
  64. package/dist/components/layer-table2.js +72 -10
  65. package/dist/components/map-card2.js +288 -47
  66. package/dist/components/map-draw-tools2.js +1 -1
  67. package/dist/components/map-fullscreen2.js +1 -1
  68. package/dist/components/map-layer-picker2.js +9 -3
  69. package/dist/components/map-legend2.js +1 -1
  70. package/dist/components/map-picker2.js +24 -5
  71. package/dist/components/map-search2.js +1 -1
  72. package/dist/components/map-select-tools2.js +1 -1
  73. package/dist/components/map-tools2.js +1 -1
  74. package/dist/components/pci-calculator.js +1 -1
  75. package/dist/components/pdf-download2.js +1 -1
  76. package/dist/components/public-notification.js +1 -1
  77. package/dist/components/refine-results-flow-item.js +1 -1
  78. package/dist/components/refine-selection2.js +1 -1
  79. package/dist/components/share-item.js +1 -1
  80. package/dist/components/solution-configuration.js +3 -3
  81. package/dist/components/solution-contents2.js +1 -1
  82. package/dist/components/solution-item-details2.js +1 -1
  83. package/dist/components/solution-item-icon2.js +1 -1
  84. package/dist/components/solution-item-sharing2.js +1 -1
  85. package/dist/components/solution-item2.js +1 -1
  86. package/dist/components/solution-organization-variables2.js +1 -1
  87. package/dist/components/solution-resource-item2.js +1 -1
  88. package/dist/components/solution-spatial-ref2.js +1 -1
  89. package/dist/components/solution-template-data2.js +1 -1
  90. package/dist/components/solution-variables2.js +1 -1
  91. package/dist/components/spatial-ref.js +1 -1
  92. package/dist/esm/basemap-gallery_7.entry.js +24 -8
  93. package/dist/esm/buffer-tools_3.entry.js +1 -1
  94. package/dist/esm/calcite-combobox_3.entry.js +369 -982
  95. package/dist/esm/calcite-graph_2.entry.js +1077 -0
  96. package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
  97. package/dist/esm/calcite-tree_3.entry.js +1 -1
  98. package/dist/esm/card-manager_3.entry.js +248 -20
  99. package/dist/esm/crowdsource-manager.entry.js +170 -50
  100. package/dist/esm/instant-apps-control-panel.entry.js +2 -1
  101. package/dist/esm/instant-apps-time-filter.entry.js +41 -22
  102. package/dist/esm/loader.js +1 -1
  103. package/dist/esm/map-select-tools_3.entry.js +3 -3
  104. package/dist/esm/pci-calculator.entry.js +1 -1
  105. package/dist/esm/public-notification.entry.js +1 -1
  106. package/dist/esm/refine-results-flow-item.entry.js +1 -1
  107. package/dist/esm/share-item.entry.js +1 -1
  108. package/dist/esm/solution-configuration.entry.js +3 -3
  109. package/dist/esm/solution-contents_3.entry.js +3 -3
  110. package/dist/esm/solutions-components.js +1 -1
  111. package/dist/esm/spatial-ref.entry.js +1 -1
  112. package/dist/solutions-components/assets/t9n/crowdsource-manager/resources.json +5 -1
  113. package/dist/solutions-components/assets/t9n/crowdsource-manager/resources_en.json +5 -1
  114. package/dist/solutions-components/assets/t9n/layer-table/resources.json +1 -0
  115. package/dist/solutions-components/assets/t9n/layer-table/resources_en.json +1 -0
  116. package/dist/solutions-components/assets/t9n/map-card/resources.json +6 -1
  117. package/dist/solutions-components/assets/t9n/map-card/resources_en.json +6 -1
  118. package/dist/solutions-components/demos/crowdsource-manager.html +1 -0
  119. package/dist/solutions-components/p-0abc1354.entry.js +6 -0
  120. package/dist/solutions-components/p-0f7b5d36.entry.js +6 -0
  121. package/dist/solutions-components/p-1867168b.entry.js +6 -0
  122. package/dist/solutions-components/{p-a9818be2.entry.js → p-20c465e9.entry.js} +1 -1
  123. package/dist/solutions-components/{p-db18bce8.entry.js → p-36b50b5b.entry.js} +1 -1
  124. package/dist/solutions-components/{p-85512ae3.entry.js → p-445213cf.entry.js} +1 -1
  125. package/dist/solutions-components/{p-d49f895d.entry.js → p-4a5f0a97.entry.js} +1 -1
  126. package/dist/solutions-components/{p-002c97df.entry.js → p-5d201016.entry.js} +1 -1
  127. package/dist/solutions-components/{p-b7cec3bd.entry.js → p-618bafec.entry.js} +1 -1
  128. package/dist/solutions-components/p-6a66d5a9.entry.js +6 -0
  129. package/dist/solutions-components/p-71a2d5b8.entry.js +6 -0
  130. package/dist/solutions-components/p-7a64b026.entry.js +17 -0
  131. package/dist/solutions-components/p-85c25564.entry.js +6 -0
  132. package/dist/solutions-components/{p-235bf02e.entry.js → p-913413c3.entry.js} +1 -1
  133. package/dist/solutions-components/p-9af1cb14.entry.js +6 -0
  134. package/dist/solutions-components/{p-49aa2929.entry.js → p-bebd4646.entry.js} +1 -1
  135. package/dist/solutions-components/{p-ab2adcaf.entry.js → p-cc092b22.entry.js} +1 -1
  136. package/dist/solutions-components/p-ce454f5a.entry.js +11 -0
  137. package/dist/solutions-components/solutions-components.esm.js +1 -1
  138. package/dist/types/components/card-manager/card-manager.d.ts +11 -0
  139. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +86 -20
  140. package/dist/types/components/layer-table/layer-table.d.ts +30 -0
  141. package/dist/types/components/map-card/map-card.d.ts +124 -0
  142. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +4 -0
  143. package/dist/types/components/map-picker/map-picker.d.ts +12 -0
  144. package/dist/types/components.d.ts +130 -0
  145. package/dist/types/preact.d.ts +4 -2
  146. package/package.json +2 -2
  147. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +0 -453
  148. package/dist/esm/calcite-dropdown-group_2.entry.js +0 -448
  149. package/dist/solutions-components/p-129fd80e.entry.js +0 -6
  150. package/dist/solutions-components/p-3b426576.entry.js +0 -6
  151. package/dist/solutions-components/p-72b217f2.entry.js +0 -6
  152. package/dist/solutions-components/p-72f01088.entry.js +0 -6
  153. package/dist/solutions-components/p-8b999a2b.entry.js +0 -6
  154. package/dist/solutions-components/p-973ff7b2.entry.js +0 -23
  155. package/dist/solutions-components/p-a001f9c9.entry.js +0 -6
  156. package/dist/solutions-components/p-c683b3fe.entry.js +0 -6
  157. package/dist/solutions-components/p-e9d049bd.entry.js +0 -6
@@ -1,448 +0,0 @@
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 registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e3f04fa1.js';
7
- import { c as createObserver } from './observers-0f4a5f9e.js';
8
- import { C as CSS } from './resources-27689859.js';
9
- import { g as getLocaleComponentStrings } from './locale-7162b55a.js';
10
- import { d as getMapLayerHash, p as getMapTableHash } from './mapViewUtils-3e3d33ea.js';
11
- import { s as state } from './publicNotificationStore-065c7136.js';
12
- import './browser-8c71dd57.js';
13
- import './esri-loader-c6842c6b.js';
14
- import './_commonjsHelpers-089957fe.js';
15
- import './interfaces-659e3836.js';
16
- import './index-1dc14abf.js';
17
-
18
- const dropdownGroupCss = ":host{position:relative;display:block}.container{text-align:start}.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([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}";
19
- const CalciteDropdownGroupStyle0 = dropdownGroupCss;
20
-
21
- const DropdownGroup = class {
22
- constructor(hostRef) {
23
- registerInstance(this, hostRef);
24
- this.calciteInternalDropdownItemChange = createEvent(this, "calciteInternalDropdownItemChange", 6);
25
- this.updateItems = () => {
26
- Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((item) => (item.selectionMode = this.selectionMode));
27
- };
28
- this.mutationObserver = createObserver("mutation", () => this.updateItems());
29
- this.groupTitle = undefined;
30
- this.scale = "m";
31
- this.selectionMode = "single";
32
- }
33
- handlePropsChange() {
34
- this.updateItems();
35
- }
36
- //--------------------------------------------------------------------------
37
- //
38
- // Lifecycle
39
- //
40
- //--------------------------------------------------------------------------
41
- connectedCallback() {
42
- this.updateItems();
43
- this.mutationObserver?.observe(this.el, { childList: true });
44
- }
45
- componentWillLoad() {
46
- this.groupPosition = this.getGroupPosition();
47
- }
48
- disconnectedCallback() {
49
- this.mutationObserver?.disconnect();
50
- }
51
- render() {
52
- const groupTitle = this.groupTitle ? (h("span", { "aria-hidden": "true", class: "dropdown-title" }, this.groupTitle)) : null;
53
- const dropdownSeparator = this.groupPosition > 0 ? h("div", { class: "dropdown-separator", role: "separator" }) : null;
54
- return (h(Host, { key: '1c189e8ff87a118d296781b729c889307c2b4a5b', "aria-label": this.groupTitle, role: "group" }, h("div", { key: '2afc3aee9c68b26af882168ce24cb2937a17c9e8', class: {
55
- [CSS.container]: true,
56
- } }, dropdownSeparator, groupTitle, h("slot", { key: '3fdcfab750b0541a4a24764f1a1875c867db06e8' }))));
57
- }
58
- //--------------------------------------------------------------------------
59
- //
60
- // Event Listeners
61
- //
62
- //--------------------------------------------------------------------------
63
- updateActiveItemOnChange(event) {
64
- this.requestedDropdownGroup = event.detail.requestedDropdownGroup;
65
- this.requestedDropdownItem = event.detail.requestedDropdownItem;
66
- this.calciteInternalDropdownItemChange.emit({
67
- requestedDropdownGroup: this.requestedDropdownGroup,
68
- requestedDropdownItem: this.requestedDropdownItem,
69
- });
70
- }
71
- //--------------------------------------------------------------------------
72
- //
73
- // Private Methods
74
- //
75
- //--------------------------------------------------------------------------
76
- getGroupPosition() {
77
- return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"), this.el);
78
- }
79
- static get delegatesFocus() { return true; }
80
- get el() { return getElement(this); }
81
- static get watchers() { return {
82
- "selectionMode": ["handlePropsChange"]
83
- }; }
84
- };
85
- DropdownGroup.style = CalciteDropdownGroupStyle0;
86
-
87
- const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.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}";
88
- const MapLayerPickerStyle0 = mapLayerPickerCss;
89
-
90
- const MapLayerPicker = class {
91
- constructor(hostRef) {
92
- registerInstance(this, hostRef);
93
- this.idsFound = createEvent(this, "idsFound", 7);
94
- this.noLayersFound = createEvent(this, "noLayersFound", 7);
95
- this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
96
- this.appearance = "transparent";
97
- this.defaultLayerId = "";
98
- this.display = "inline-block";
99
- this.enabledLayerIds = [];
100
- this.enabledTableIds = [];
101
- this.height = undefined;
102
- this.isMobile = undefined;
103
- this.mapView = undefined;
104
- this.onlyShowUpdatableLayers = undefined;
105
- this.placeholderIcon = "";
106
- this.selectedIds = [];
107
- this.scale = "m";
108
- this.showTables = undefined;
109
- this.showSingleLayerAsLabel = false;
110
- this.type = "select";
111
- this._hasMultipleLayers = true;
112
- this._hasValidLayers = true;
113
- this._isDropdownOpen = undefined;
114
- this.ids = [];
115
- this.selectedName = "";
116
- this._translations = undefined;
117
- }
118
- get el() { return getElement(this); }
119
- //--------------------------------------------------------------------------
120
- //
121
- // Properties (protected)
122
- //
123
- //--------------------------------------------------------------------------
124
- /**
125
- * boolean: When true the default layer has been loaded once and should no longer be used
126
- */
127
- defaultLayerHonored = false;
128
- /**
129
- * HTMLCalciteSelectElement: The html element for selecting layers
130
- */
131
- _layerElement;
132
- /**
133
- * IMapItemHash: id/name lookup
134
- */
135
- _layerNameHash;
136
- /**
137
- * IMapItemHash: id/name lookup
138
- */
139
- _tableNameHash;
140
- //--------------------------------------------------------------------------
141
- //
142
- // Watch handlers
143
- //
144
- //--------------------------------------------------------------------------
145
- /**
146
- * Called each time the mapView prop is changed.
147
- */
148
- async mapViewWatchHandler() {
149
- await this._setLayers();
150
- if (this.ids.length > 0) {
151
- this._hasValidLayers = true;
152
- this._hasMultipleLayers = this.ids.length > 1;
153
- this._setSelectedLayer(this.ids[0]);
154
- }
155
- else {
156
- this._hasValidLayers = false;
157
- this.noLayersFound.emit();
158
- }
159
- }
160
- //--------------------------------------------------------------------------
161
- //
162
- // Methods (public)
163
- //
164
- //--------------------------------------------------------------------------
165
- //--------------------------------------------------------------------------
166
- //
167
- // Events (public)
168
- //
169
- //--------------------------------------------------------------------------
170
- /**
171
- * Emitted on demand when no valid layers are found
172
- *
173
- */
174
- idsFound;
175
- /**
176
- * Emitted on demand when no valid layers are found
177
- *
178
- */
179
- noLayersFound;
180
- /**
181
- * Emitted on demand when a layer is selected
182
- *
183
- */
184
- layerSelectionChange;
185
- //--------------------------------------------------------------------------
186
- //
187
- // Functions (lifecycle)
188
- //
189
- //--------------------------------------------------------------------------
190
- /**
191
- * StencilJS: Called once just after the component is first connected to the DOM.
192
- */
193
- async componentWillLoad() {
194
- await this._getTranslations();
195
- await this._setLayers();
196
- if (this.ids.length > 0 || this.selectedIds.length === 1) {
197
- this.layerSelectionChange.emit(this.selectedIds.length === 1 ? [this.selectedIds[0]] : [this.ids[0]]);
198
- }
199
- }
200
- /**
201
- * Renders the component.
202
- */
203
- render() {
204
- const id = "map-layer-picker";
205
- let style = this.height > 0 ? { "height": `${this.height.toString()}px` } : {};
206
- style = { ...style, "display": this.display };
207
- return (h(Host, { key: 'a96e93924530d926c5e10dd2f7212f3f8c1cbe3c' }, h("div", { key: '4b96a73e43e86c31291e4ac60eb15976b01de6a2', class: "map-layer-picker-container", style: style }, h("div", { key: 'e75c61d8ce0853814dd3903b9e1952cc613b6fbb', class: "map-layer-picker", style: style }, !this._hasValidLayers ? this._getInvalidPlaceholder() :
208
- !this._hasMultipleLayers && this.showSingleLayerAsLabel ? this._getSingleLayerPlaceholder() :
209
- this.type === "combobox" ? this._getCombobox(id) :
210
- this.type === "select" ? this._getSelect(id) : this._getDropdown(id)))));
211
- }
212
- /**
213
- * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
214
- */
215
- async componentDidLoad() {
216
- if (this.ids.length > 0 || this.selectedIds.length === 1) {
217
- const id = this.selectedIds.length === 1 ? this.selectedIds[0] : this.ids[0];
218
- if (this.type === "select") {
219
- this._layerElement.value = id;
220
- }
221
- else if (this.type === "dropdown") {
222
- this.selectedName = Object.keys(this._layerNameHash).indexOf(id) > -1 ?
223
- this._layerNameHash[id].name : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
224
- this._tableNameHash[id].name : "";
225
- }
226
- }
227
- }
228
- //--------------------------------------------------------------------------
229
- //
230
- // Functions (protected)
231
- //
232
- //--------------------------------------------------------------------------
233
- /**
234
- * Create a notice to inform the user that no layers were found
235
- *
236
- * @returns Calcite Notice component with the message
237
- */
238
- _getInvalidPlaceholder() {
239
- return (h("div", null, h("calcite-notice", { class: "height-100", icon: "exclamation-mark-triangle", id: "no-valid-layers", kind: "danger", open: true }, h("div", { slot: "message" }, this._translations.noLayersFound)), h("calcite-tooltip", { label: this._translations.enableEditUpdate, placement: "bottom", "reference-element": "no-valid-layers" }, h("span", null, this._translations.enableEditUpdate))));
240
- }
241
- /**
242
- * Show layer name as a label with icon
243
- *
244
- * @returns Calcite label with the layer name and icon
245
- */
246
- _getSingleLayerPlaceholder() {
247
- return (h("div", { class: "layer-picker-label-container cursor-default" }, h("calcite-icon", { icon: "layers", scale: "s" }), h("calcite-label", { class: "no-bottom-margin padding-start-1" }, this.selectedName)));
248
- }
249
- /**
250
- * Create a list of layers from the map
251
- * Used for selecting a single layer.
252
- *
253
- * @param id the id for the select component used to support the tooltip
254
- *
255
- * @returns Calcite Select component with the ids of the layers from the map
256
- */
257
- _getSelect(id) {
258
- return (h("calcite-select", { id: id, label: "", onCalciteSelectChange: () => this._layerSelectionChange(), ref: (el) => { this._layerElement = el; }, scale: this.scale }, this._getMapLayerOptions()));
259
- }
260
- /**
261
- * Create a list of layer ids from the map
262
- * Used for selecting multiple layers
263
- *
264
- * @param id the id for the combobox component used to support the tooltip
265
- *
266
- * @returns Calcite ComboBox component with the ids of the layers from the map
267
- */
268
- _getCombobox(id) {
269
- return (h("calcite-combobox", { clearDisabled: true, id: id, label: "", onCalciteComboboxChange: () => this._layerSelectionChange(), "placeholder-icon": this.placeholderIcon, ref: (el) => { this._layerElement = el; }, scale: this.scale, "selection-mode": "single" }, this._getMapLayerOptions()));
270
- }
271
- /**
272
- * Hydrate a dropdown component with items to display the layer names
273
- *
274
- * @param id the id for the dropdown component used to support the tooltip
275
- *
276
- * @returns Array of Dropdown items with layer names
277
- */
278
- _getDropdown(id) {
279
- return (h("calcite-dropdown", { class: "layer-picker-dropdown", onCalciteDropdownBeforeClose: () => this._isDropdownOpen = false, onCalciteDropdownBeforeOpen: () => this._isDropdownOpen = true }, this.isMobile ? this._getDropdownButton() : this._getActionDropdownButton(id), h("calcite-dropdown-group", { "selection-mode": "single" }, this._getMapLayerOptions())));
280
- }
281
- /**
282
- * Get the button that will open the dropdown list wrapped in an action
283
- *
284
- * @returns the node for the action and button
285
- */
286
- _getActionDropdownButton(id) {
287
- return (h("calcite-action", { id: id, slot: "trigger", text: "" }, this._getDropdownButton()));
288
- }
289
- /**
290
- * Get the button that will open the dropdown list
291
- *
292
- * @returns the node for the button
293
- */
294
- _getDropdownButton() {
295
- const buttonClass = this.isMobile ? "" : "max-width-350";
296
- const buttonSlot = this.isMobile ? "trigger" : "";
297
- const buttonIcon = this._isDropdownOpen ? "chevron-up" : "chevron-down";
298
- return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart: "layers", kind: "neutral", slot: buttonSlot, width: "full" }, h("div", null, this.selectedName)));
299
- }
300
- /**
301
- * Get the appropriate type of dom nodes for each valid layer or table
302
- *
303
- * @returns Array of dom nodes with the names of the layers and optionally of the tables
304
- */
305
- _getMapLayerOptions() {
306
- return this.ids.reduce((prev, cur) => {
307
- if (this._validLayer(cur)) {
308
- prev.push(this._getItem(cur, "layer"));
309
- }
310
- else if (this._validTable(cur)) {
311
- prev.push(this._getItem(cur, "table"));
312
- }
313
- return prev;
314
- }, []);
315
- }
316
- /**
317
- * Get the appropriate type of dom node for the current layer or table id
318
- *
319
- * @returns A dom node with the name of the layer or table
320
- */
321
- _getItem(id, itemType) {
322
- const item = itemType === "layer" ? this._layerNameHash[id] : this._tableNameHash[id];
323
- const disabled = this.onlyShowUpdatableLayers ? !item.supportsUpdate : false;
324
- const name = item.name;
325
- const selected = this.selectedIds.indexOf(id) > -1;
326
- return this.type === "combobox" ? (h("calcite-combobox-item", { disabled: disabled, selected: selected, textLabel: name, value: id })) :
327
- this.type === "select" ? (h("calcite-option", { disabled: disabled, label: name, selected: selected, value: id })) : (h("calcite-dropdown-group", { class: disabled ? "disabled" : "", selectionMode: disabled ? "none" : "single" }, h("calcite-dropdown-item", { onClick: disabled ? undefined : () => void this._setSelectedLayer(id), selected: selected }, name)));
328
- }
329
- /**
330
- * Store the layer name based on the user selection
331
- */
332
- _setSelectedLayer(id) {
333
- let item;
334
- const hasDefaultLayer = this.defaultLayerId && !this.defaultLayerHonored;
335
- if (hasDefaultLayer) {
336
- item = this._getLayerFromHash(this.defaultLayerId);
337
- this.defaultLayerHonored = item !== undefined;
338
- id = this.defaultLayerHonored ? this.defaultLayerId : id;
339
- }
340
- item = item ? item : this._getLayerFromHash(id);
341
- this.selectedName = item?.name;
342
- this.selectedIds = [id];
343
- this.layerSelectionChange.emit(this.selectedIds);
344
- }
345
- /**
346
- * Fetch layer hash info for the given id
347
- *
348
- * @returns ILayerHashInfo for the id
349
- */
350
- _getLayerFromHash(id) {
351
- return Object.keys(this._layerNameHash).indexOf(id) > -1 ?
352
- this._layerNameHash[id] : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
353
- this._tableNameHash[id] : undefined;
354
- }
355
- /**
356
- * Fetch the ids of the layers from the map
357
- *
358
- * @returns Promise when the operation has completed
359
- */
360
- async _setLayers() {
361
- if (this.mapView) {
362
- await this._initLayerTableHash();
363
- const layerIds = this.onlyShowUpdatableLayers ?
364
- this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
365
- const tableIds = this.showTables ? this.onlyShowUpdatableLayers ?
366
- this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
367
- this.ids = [
368
- ...layerIds.reverse().filter(n => this.enabledLayerIds?.length > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true),
369
- ...tableIds.reverse().filter(n => this.enabledTableIds?.length > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true),
370
- ];
371
- this.idsFound.emit({
372
- layerIds,
373
- tableIds
374
- });
375
- }
376
- }
377
- /**
378
- * Fetch the ids of all layers that support edits with the update capability
379
- *
380
- * @returns array of layer ids
381
- */
382
- _getEditableIds(hash) {
383
- return Object.keys(hash).reduce((prev, cur) => {
384
- if (hash[cur].supportsUpdate) {
385
- prev.push(cur);
386
- }
387
- return prev;
388
- }, []);
389
- }
390
- /**
391
- * Create a layer id:title hash for layer name display
392
- *
393
- * @returns Promise when the operation has completed
394
- */
395
- async _initLayerTableHash() {
396
- this._layerNameHash = await getMapLayerHash(this.mapView, this.onlyShowUpdatableLayers);
397
- this._tableNameHash = this.showTables ? await getMapTableHash(this.mapView, this.onlyShowUpdatableLayers) : {};
398
- }
399
- /**
400
- * Evaluate if the id exists in the current hash and verify if it should be excluded
401
- *
402
- * @returns boolean when true the layer will be used in the current layer picker type
403
- */
404
- _validLayer(id) {
405
- const name = this._layerNameHash[id]?.name;
406
- return name && Object.keys(state.managedLayers).indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
407
- this.enabledLayerIds.indexOf(id) > -1 : true);
408
- }
409
- /**
410
- * Evaluate if the id exists in the current hash and verify if it should be excluded
411
- *
412
- * @returns boolean when true the table will be used in the current layer picker type
413
- */
414
- _validTable(id) {
415
- const name = this._tableNameHash[id]?.name;
416
- const validName = name && this.showTables;
417
- return validName ? state.managedTables.indexOf(name) < 0 &&
418
- (this.enabledTableIds.length > 0 ? this.enabledTableIds.indexOf(id) > -1 : true) : validName;
419
- }
420
- /**
421
- * Fetch the ids of the layers from the map
422
- *
423
- * @returns Promise when the operation has completed
424
- */
425
- _layerSelectionChange() {
426
- const ids = Array.isArray(this._layerElement.value) ? this._layerElement.value : [this._layerElement.value];
427
- if (JSON.stringify(ids) !== JSON.stringify([""])) {
428
- this.selectedIds = ids;
429
- this.layerSelectionChange.emit(this.selectedIds);
430
- }
431
- }
432
- /**
433
- * Fetches the component's translations
434
- *
435
- * @returns Promise when complete
436
- * @protected
437
- */
438
- async _getTranslations() {
439
- const messages = await getLocaleComponentStrings(this.el);
440
- this._translations = messages[0];
441
- }
442
- static get watchers() { return {
443
- "mapView": ["mapViewWatchHandler"]
444
- }; }
445
- };
446
- MapLayerPicker.style = MapLayerPickerStyle0;
447
-
448
- export { DropdownGroup as calcite_dropdown_group, MapLayerPicker as map_layer_picker };
@@ -1,6 +0,0 @@
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,g as s,h as a,H as r}from"./p-f4c4a2b7.js";const t=class{constructor(s){e(this,s)}get el(){return s(this)}render(){return a(r,{key:"064acd664456a39d14fd4bd81adb9b217670290f"},a("slot",{key:"e2e0fee4f2bff7a48befd54fbc8b724cb5a5f660"}))}};t.style=":host{display:block}";export{t as share_item}
@@ -1,6 +0,0 @@
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,g as i,h as s,H as e,c as h}from"./p-f4c4a2b7.js";import{g as a,l as o}from"./p-d7868dd4.js";import{q as l,g as n,e as d,f as c,i as r,j as p,c as b}from"./p-eb483242.js";import{d as f}from"./p-4b3cc01f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";const u=class{constructor(i){t(this,i),this.enableEditGeometry=!1,this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}get el(){return i(this)}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const s=i.length>0?await l(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 n(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){const t=this._graphics?.length>0?"":"display-none",i=this._graphics?.length>0?"display-none":"";return s(e,{key:"ff2b82f23cc912a79d4f2d04a3263215e54ff03d"},s("div",{key:"64a96d7162508794b955dc4b557fa94d18f8ab53",class:"overflow-auto height-full"},s("calcite-shell",{key:"77b8ad0b9a459d2fb9399ccfebc6d0211147bb01",class:"position-relative "+t},s("div",{key:"e0725835f5c1c32a9164e04d6321ba5853a3892c"},s("info-card",{key:"6712a077c4746585e7b2474aedd14e1869b37c34",enableEditGeometry:this.enableEditGeometry,graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView}))),s("calcite-shell",{key:"38c85dbb72df9b9b1225f1488c3bf384f67d7db4",class:"position-relative "+i},s("div",{key:"66386d1a0d19fb4a023515e5dc4b41ac73a8c257",class:"padding-1"},s("calcite-notice",{key:"12a843bede7b688651b436bcb9b7ad9e7f6217e0",icon:"table",open:!0},s("div",{key:"28862f4aa25802ca6b2bdc0ef2af3bcb825267f9",slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}};u.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 m=class{constructor(i){t(this,i),this.featureSelectionChange=h(this,"featureSelectionChange",7),this.defaultGlobalId=void 0,this.defaultLayerId=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.isMobile=void 0,this.mapHidden=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this.zoomToScale=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}get el(){return i(this)}FeatureTable;TableTemplate;_columnsInfo;_ctrlIsPressed=!1;_currentId;_editEnabled;_defaultFilterHonored=!1;_defaultGlobalIdHonored=!1;_defaultOidHonored=!1;_defaultVisibleToolSizeInfos;_definitionExpression;_deleteEnabled;_filterList;_floorExpression;_floorField;_floorFacility;_floorLevel;_floorSite;_layerExpressions;_loaded=!1;_mapClickHandle;_observerSet=!1;_previousCurrentId;reactiveUtils;_refreshHandle;_resizeObserver;_selectAllElement;_selectionFromMap=!1;_shareNode;_shiftIsPressed=!1;_showHideDropdown;_skipOnChange=!1;_moreDropdown;_table;_tableNode;_timeout;_toolbar;_toolbarSizeInfos;async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){this._toolInfos?.length>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_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}}))}mapHiddenWatchHandler(){this._toolInfos?.length>0&&this._initToolInfos()}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar(),await this._sortTable()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await(this._layer?.when((async()=>{this._definitionExpression=this._layer.definitionExpression,this._floorField=this._layer.floorInfo?.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1),this.selectedIds.length>0&&(this._table.rowHighlightIds.removeAll(),this._table.rowHighlightIds.add(this.selectedIds[0]))}featureSelectionChange;async selectionChanged(t){const i=t.detail.selectedFeature[0],s=i.getObjectId(),e=this._table;if(e.rowHighlightIds.length&&e.rowHighlightIds.removeAll(),e.rowHighlightIds.add(s),this.zoomAndScrollToSelected){const t=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(t);const e=i.layer;let h;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===e.title&&"feature"===t.layer.type)return h=t,!0})),h&&await d([s],h,this.mapView,!0,void 0,this.zoomToScale)}}async editsComplete(t){const i=t.detail;"delete"!==i&&"add"!==i||(this._allIds=await c(this._layer)),await this._refresh()}async facilityChanged(t){this._floorFacility=t.detail,this._updateFloorDefinitionExpression()}async levelChanged(t){this._floorLevel=t.detail,this._updateFloorDefinitionExpression()}async siteChanged(t){this._floorSite=t.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const t=this._fetchingData?"display-none":"",i=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),a=this.selectedIds.length.toString(),o=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),s(e,{key:"547a08c45cc3a0b0bdb5ab841ee202d2d43018dc"},s("calcite-shell",{key:"7ac39e863586727df7685eb5c3faffd87c46bf9d"},this._getTableControlRow("header"),s("div",{key:"322dc4820b17365f3f202ce43d85330d25081eb5",class:`width-full ${o}`},s("calcite-panel",{key:"764955f3cf9371a5ff554821613fffbc9e0bd705",class:"height-full width-full"},s("calcite-loader",{key:"031fc6520de11b166111626501f0208f1b69c9ff",class:i,label:this._translations.fetchingData,scale:"l"}),s("div",{key:"8d62258ee356fdf6bc6c03f88848a32270ce5eed",class:t,ref:this.onTableNodeCreate})),this.isMobile?void 0:s("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",a)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=t=>this._handleDocumentClick(t),document.onkeydown=t=>this._handleKeyDown(t),document.onkeyup=t=>this._handleKeyUp(t)}componentDidRender(){this._updateToolbar()}async _initModules(){const[t,i,s]=await o(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=t,this.reactiveUtils=i,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(t){return s("div",{class:"display-flex border-bottom height-51",ref:t=>this._toolbar=t,slot:t},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const t=this.isMobile?"width-full":"",i=this.isMobile?"border-top":"";return s("calcite-action-bar",{class:t,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},s("div",{class:`border-end ${t} ${i}`,id:"solutions-map-layer-picker-container"},s("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:t=>{this._layerSelectionChanged(t)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const t=this._getActionItems();return t?.reduce(((t,i)=>(i&&!i.isOverflow&&t.push(i.isDanger?this._getDangerAction(i.icon,i.label,i.func,i.disabled):i.isSublist?s("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(i.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._showHideDropdown=t},this._getAction(i.active,this._showHideOpen?"chevron-down":i.icon,i.indicator,i.label,i.func,i.disabled,i.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(i.active,i.icon,i.indicator,i.label,i.func,i.disabled,i.loading)),t)),[])}_getFieldlist(){return this._columnsInfo?s("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((t=>s("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)}))}_validateActiveActions(){const t=["filter","list-check-all","selected-items-filter"];this._toolInfos?.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const t=this._featuresSelected(),i=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[this.mapHidden?void 0:{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!t,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!t,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!t,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!t,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:i,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:i,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:i,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const t=`${this._floorField} = '${this._floorLevel}'`,i=this._layer.definitionExpression;this._layer.definitionExpression=i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):i?`${i} AND (${t})`:t,this._floorExpression=t}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){let t;return this.mapInfo?.filterConfig?.layerExpressions&&this._layer?.id&&(t=this.mapInfo.filterConfig.layerExpressions.filter((t=>t.id===this._layer.id))),t?.length>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(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 a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||i+o.width<=t)?(e.indexOf(o.id)<0&&(i+=o.width),a.push(o)):s.indexOf(o.id)<0&&i+o.width>t&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_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 i=this._getDropdownItems();return i.length>0?s("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._moreDropdown=t},s("calcite-action",{appearance:"solid",id:t,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},s("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),s("calcite-dropdown-group",{"selection-mode":"none"},i.map((t=>s("calcite-dropdown-group",{class:t.disabled?"disabled":"",selectionMode:t.disabled?"none":"single"},s("calcite-dropdown-item",{disabled:t.loading,iconStart:t.isSublist&&this._showHideOpen?"chevron-down":t.loading?"":t.icon,id:"solutions-subset-list",onClick:t.func},t.loading?s("div",{class:"display-flex"},s("calcite-loader",{inline:!0,label:t.label,scale:"m"}),t.label):t.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){return this._toolInfos?.filter((t=>t&&t.isOverflow))}_getAction(t,i,e,h,a,o,l,n){const d=void 0===this._layer||o;return s("div",{class:"display-flex",id:this._getId(i),slot:n},s("calcite-action",{active:t,appearance:"solid",disabled:d,icon:i,id:i,indicator:e,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",i,h))}_getShare(t){return s("div",{class:"share-action",id:this._getId(t)},s("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(){const t=this._shareNode?.shareUrl;if(!t)return;const i=new URL(t);this.mapInfo?.id?i.searchParams.set("webmap",this.mapInfo.id):i.searchParams.delete("webmap"),this._layer?.id?i.searchParams.set("layer",this._layer.id):i.searchParams.delete("layer"),this.selectedIds?.length>0?i.searchParams.set("oid",this.selectedIds.join(",")):i.searchParams.delete("oid"),this._shareNode.shareUrl=i.href}_getToolTip(t,i,e){return document.getElementById(i)?s("calcite-tooltip",{placement:t,"reference-element":i},s("span",null,e)):void 0}_getId(t){return`solutions-action-${t}`}_getDangerAction(t,i,e,h){const a=void 0===this._layer||h;return s("div",{class:"display-flex",id:this._getId(t)},"trash"===t?s("delete-button",{buttonType:"action",class:"display-flex",disabled:a,icon:t,ids:this._getIds(),layer:this._layer}):s("calcite-action",{appearance:"solid",disabled:a,id:t,onClick:e,text:""},s("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},i)),this._getToolTip("bottom",t,i))}_getIds(){return this._table.highlightIds.toArray()}onTableNodeCreate=t=>{this._tableNode=t};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})})),await this._table.when((()=>{this._table.highlightIds.on("change",(t=>{this._handleOnChange(t)}))})))}async _handleOnChange(t){const i=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(!this._ctrlIsPressed&&!this._shiftIsPressed||this._selectionFromMap&&this._shiftIsPressed)if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===t.removed.length?t.removed:i.filter((t=>this.selectedIds.indexOf(t)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=i.reverse();else if(this._ctrlIsPressed)this.selectedIds=i.reverse();else if(this._shiftIsPressed&&i?.length>0)if(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...i].reverse()[0],1===i.length)this._skipOnChange=!1;else if(this._previousCurrentId!==this._currentId){const t=this._table.activeSortOrders.reduce(((t,i)=>(t.push(`${i.fieldName} ${i.direction}`),t)),[]),s=await r(0,this._layer,[],t);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),a=this._table.viewModel.getObjectIdIndex(this._currentId);this._skipOnChange=(h<a?h:a)+1!==(a>h?a:h);const o=s.reduce(((t,i)=>{const s=i;return s===this._currentId||s===this._previousCurrentId?(e=!e,t.indexOf(s)<0&&t.push(s)):e&&t.indexOf(s)<0&&t.push(s),t}),[]),l=h<a?o.reverse():o;this.selectedIds=[...new Set([...l,...this.selectedIds])],this._table.highlightIds.addMany(this.selectedIds.filter((t=>i.indexOf(t)<0)))}this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._selectionFromMap=!1}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){const t=this._getColumnTemplates(this._layer?.id,this._layer?.fields),i=t?.some(((t,i)=>JSON.stringify(this._table?.tableTemplate.columnTemplates[i])!==JSON.stringify(t)));if(this._table&&t&&(i||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:t});const i=t.map((t=>t.fieldName));this._initColumnsInfo(i)}}async _resetTable(){if(this._loaded=!1,this._clearSelection(),this._allIds=await c(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,this._layer?.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this._table.when(),setTimeout((()=>{this._loaded||(console.log(`table.state: ${this._table.state}`),this.finishLoading())}),1e3),await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{await this.finishLoading()}))}async finishLoading(){try{this._loaded=!0,this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}catch(t){console.log(t)}}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(t=>{t.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await c(this._layer),this.selectedIds=this.selectedIds.filter((t=>this._allIds.indexOf(t)>-1)),await this._refresh()}async _handleDefaults(){if(!this._defaultOidHonored&&this.defaultOid?.length>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&this.defaultGlobalId?.length>0&&this._table){const t=await p(this.defaultGlobalId,this._layer),i=t?.length>0?t.map((t=>t.getObjectId())):void 0;i&&await this._selectDefaultFeature(i),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(t){const i=this._table?.columns.reduce(((i,s)=>((!t||t?.indexOf(s.name)>-1)&&(i[s.name]=!s.hidden),i)),{}),s=this._table?.columns.map((t=>t.name));(t?t.filter((t=>s.indexOf(t)<0)):[]).forEach((t=>{i[t]=!0})),this._columnsInfo=t?t.reduce(((t,s)=>(t[s]=i[s],t)),{}):i}async _selectDefaultFeature(t){t.length>0&&this._table.highlightIds.addMany(t)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){let t,i=this._layer?.objectIdField,s="desc";this.mapInfo?.layerOptions?.layers?.length>0&&this._layer?.id&&(t=this.mapInfo.layerOptions.layers.filter((t=>t.id===this._layer.id)),t&&t.length>0&&(t=t[0],t.sortField&&t.fields?.includes(t.sortField)&&(i=t.sortField),s=t?.sortOrder?t.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(i,s)})))}_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){const i=t.target?.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(i)<0&&"solutions-subset-list"!==i&&"chevron-right"!==i&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(t){this._ctrlIsPressed=t.ctrlKey,this._shiftIsPressed=t.shiftKey}_handleKeyUp(t){this._ctrlIsPressed=t.ctrlKey,this._shiftIsPressed=t.shiftKey}_filterModal(){return s("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},s("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations?.filter?.replace("{{title}}",this._layer?.title)),s("div",{slot:"content"},s("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:t=>this._filterList=t,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const t=this._layer.definitionExpression;if(this._floorExpression){const i=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=t&&this._floorField&&t.indexOf(`${this._floorField} = '`)>-1?t.replace(i,this._floorExpression):t?`${t} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await c(this._layer),this._filterOpen=!1)}async _mapClicked(t){const i={include:this._layer},s=await this.mapView.hitTest(t.screenPoint,i);s.results.length>0?(s.results.forEach((t=>{const i=t.graphic.getObjectId();this._table.highlightIds.indexOf(i)<0&&(this._selectionFromMap=!0,this._table.highlightIds.add(i))})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const t=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){this.selectedIds=[],this._table?.highlightIds.removeAll(),this._table?.rowHighlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){const t=this.mapInfo?.filterConfig?.layerExpressions;this._layerExpressions=t?t.filter((t=>t.id===this._layer?.id)):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((t=>t.expressions.filter((t=>t.active)).length>0)).length>0}_switchSelected(){const t=[...this.selectedIds];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._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange()}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[this._layer.title],ids:i,layer:this._layer};const s=this._table.columns.toArray().reduce(((t,i)=>(i.hidden||t.push(i.name.toLocaleLowerCase()),t)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await f(null,t,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(t,i){this._toolInfos.some((s=>{if(s?.icon===t)return s.loading=i,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}async _zoom(){if(this._layer){const t=await b(this.mapView,this._layer.id);await d(this.selectedIds,t,this.mapView,!0,void 0,this.zoomToScale)}}async _layerSelectionChanged(t){const i=t.detail[0];if(i!==this._layer?.id||this._featuresEmpty()){this._fetchingData=!0;const t=await n(this.mapView,i);await t.when((()=>{this._layer=t}))}this._fetchingData=!1}_getColumnTemplates(t,i){let s;this.mapInfo?.layerOptions?.layers.some((i=>{if(i.id===t)return s=i,!0}));const e=s?.fields&&s?.fieldOrder?s.fieldOrder.filter((t=>s.fields.indexOf(t)>-1)):void 0;let h;return i&&(h=s&&s?.fields?i.reduce(((t,i)=>{if(s.fields.indexOf(i.name)>-1){const s={type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)};t.push(s)}return t}),[]).sort(this._sortFields.bind(this,s?.fieldOrder)):i.map((t=>({type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)})))),e?h?.sort(this._sortFields.bind(this,e)):h}_sortFields(t,i,s){return t?.indexOf(i.fieldName)-t.indexOf(s.fieldName)}_getMenuConfig(t){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(t)}}]}}_handleHideClick(t){this._columnsInfo[t]=!1,this._table.hideColumn(t),this._table.tableTemplate.columnTemplates.forEach((i=>{i.fieldName===t&&(i.visible=!1)}))}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],mapHidden:["mapHiddenWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};function v(t){return function(t){return-1!==t?.indexOf("http://")}(t)?t.replace(/^http:\/\//,"https://"):t}m.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}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}.esri-feature-table__table-container{height:100%}';const g=class{constructor(i){t(this,i),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}get el(){return i(this)}esriConfig;Home;MapView;WebMap;_defaultWebmapHonored=!1;_homeWidget;_loadedId="";_mapDiv;_mapPicker;_mapTools;enableHomeWatchHandler(){this._initHome()}mapChanged;beforeMapChanged;async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){const t=this.hidden?"visibility-hidden-1":"",i="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",h=this.mapInfos?.length>1?"":"display-none",a=this.mapInfos?.length>1?"map-height":"height-full";return s(e,{key:"4f5c0cd408f92856ceb2ba281a02856064ef6a5a"},s("map-picker",{key:"f69742384dc5ba13bbf257592cc8c35de77590f0",class:h,mapInfos:this.mapInfos,ref:t=>this._mapPicker=t}),s("div",{key:"3ddddf3f674d49ae59fe627af1c67ec59718c9a3",class:`${a} ${t}`,ref:t=>this._mapDiv=t}),s("map-tools",{key:"6cb9518e74af0594ab6b657f0caec3598c250cb2",basemapConfig:this.basemapConfig,class:`box-shadow ${i}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[t,i,s,e]=await o(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=t,this.MapView=i,this.Home=s,this.esriConfig=e}async _loadMap(t){const i=!this._defaultWebmapHonored&&this.defaultWebmapId,s=this.mapInfos?.filter((t=>t.id===this.defaultWebmapId)),e=JSON.stringify(t)!==JSON.stringify(this._webMapInfo);this._webMapInfo=i&&s?s[0]:!t?.id&&this.mapInfos.length>0?this.mapInfos[0]:t;const h=this._webMapInfo.id,a=i&&t?.id===this.defaultWebmapId;if(this._loadedId!==h&&!i||a){const t=new this.WebMap({portalItem:{id:h}});this.appProxies&&(await t.load(),await(o=t,l=this.esriConfig,n=this.appProxies,n&&n.forEach((t=>{o.allLayers.forEach((i=>{i&&i.url===t.sourceUrl&&(i.url=v(t.proxyUrl),i.portalItem&&i.portalItem.when((()=>{i.portalItem.url=v(t.proxyUrl)})),l.request?.interceptors?.push({urls:t.sourceUrl,before:i=>{i.url&&i.url===t.sourceUrl&&(i.url=v(t.proxyUrl))}}))}))})),o)),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:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!a||this._defaultWebmapHonored,this.mapChanged.emit({id:h,mapView:this.mapView})}))}else i?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(h)):e&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:h,mapView:this.mapView}));var o,l,n}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const t="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=t,this._homeWidget.domNode.style.width=t}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};g.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-1{visibility:hidden;height:1px;}.display-none{display:none}";export{u as card_manager,m as layer_table,g as map_card}
@@ -1,6 +0,0 @@
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 a,g as e,h as i,H as t}from"./p-f4c4a2b7.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(e){a(this,e),this.showAddDeduct=!1}get el(){return e(this)}_deductValuesElement;render(){const a=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"233eb3eff2bc15f80185cb307036525e29fe8f5b"},i("div",{key:"db45b9f334c57a2b0100b8f4b4ad3c3744410acf",class:this.showAddDeduct?"display-none":"display-grid"},i("div",{key:"eb8750201d287d5558167501aa7ef96eacfa3ae4",class:"label-display"},i("calcite-label",{key:"da7df5155e6913225e7e7518fb5e6a4653c9bf52",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),i("div",{key:"fb09ba5c7f6eab2463d6f170ba123fbfa71bffd2"},this._getCalculateButton())),i("div",{key:"f95f8ae0cdb7130af0dad47c55996556ad02ae34",class:a},i("div",{key:"6ac0a2b8486706dfa8cd00a53cad3e549d87ce52",class:"position-right"},i("calcite-action",{key:"c88e53dcfda877905a674a5dee2c4385651db92a",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),i("deduct-calculator",{key:"58396ab41f9d83629fe504b208eb3168dd86ceb8",class:"display-grid padding-top-1",onDeductValueComplete:a=>this._addDeductValue(a)})))}_getDeductValuesInput(){return i("div",{class:"display-flex"},i("calcite-input",{class:"main-input",ref:a=>{this._deductValuesElement=a}}),i("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return i("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(a){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${a.detail}`:a.detail}_calculatePCI(a){const e=l(a,!0),i=e<=10?"Failed":e<=25?"Serious":e<=40?"Very Poor":e<=55?"Poor":e<=70?"Fair":e<=85?"Satisfactory":"Good";console.log(`PCI: ${e}`),console.log(`Rating: ${i}`),alert("See debug console for results")}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}