@esri/solutions-components 0.6.13 → 0.6.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/dist/assets/t9n/layer-table/resources.json +1 -1
  2. package/dist/assets/t9n/layer-table/resources_en.json +1 -1
  3. package/dist/assets/t9n/map-layer-picker/resources.json +4 -0
  4. package/dist/assets/t9n/map-layer-picker/resources_en.json +4 -0
  5. package/dist/cjs/basemap-gallery_6.cjs.entry.js +20 -5
  6. package/dist/cjs/buffer-tools_4.cjs.entry.js +1 -1
  7. package/dist/cjs/calcite-chip_3.cjs.entry.js +803 -0
  8. package/dist/cjs/calcite-combobox_6.cjs.entry.js +76 -28
  9. package/dist/cjs/card-manager_3.cjs.entry.js +112 -54
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +18 -5
  11. package/dist/cjs/{downloadUtils-fb4744e0.js → downloadUtils-34a515ad.js} +2 -2
  12. package/dist/cjs/edit-card_2.cjs.entry.js +29 -18
  13. package/dist/cjs/{index.es-372e33de.js → index.es-0ba11065.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  16. package/dist/cjs/{mapViewUtils-a4dd36ec.js → mapViewUtils-a2884698.js} +39 -55
  17. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  18. package/dist/cjs/{publicNotificationStore-b69862af.js → publicNotificationStore-610bd880.js} +0 -4
  19. package/dist/cjs/solutions-components.cjs.js +1 -1
  20. package/dist/collection/components/basemap-gallery/basemap-gallery.js +23 -1
  21. package/dist/collection/components/card-manager/card-manager.js +2 -2
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +171 -5
  23. package/dist/collection/components/edit-card/edit-card.js +44 -21
  24. package/dist/collection/components/layer-table/layer-table.js +127 -47
  25. package/dist/collection/components/map-card/map-card.js +115 -5
  26. package/dist/collection/components/map-layer-picker/map-layer-picker.css +6 -0
  27. package/dist/collection/components/map-layer-picker/map-layer-picker.js +107 -27
  28. package/dist/collection/components/map-picker/map-picker.css +5 -1
  29. package/dist/collection/components/map-picker/map-picker.js +3 -3
  30. package/dist/collection/components/map-tools/map-tools.js +104 -1
  31. package/dist/collection/demos/crowdsource-manager.html +2 -2
  32. package/dist/collection/demos/new-public-notification.html +3 -3
  33. package/dist/collection/utils/interfaces.ts +12 -1
  34. package/dist/collection/utils/mapViewUtils.js +38 -52
  35. package/dist/collection/utils/mapViewUtils.ts +41 -57
  36. package/dist/collection/utils/publicNotificationStore.js +0 -4
  37. package/dist/collection/utils/publicNotificationStore.ts +0 -4
  38. package/dist/components/basemap-gallery2.js +2 -0
  39. package/dist/components/card-manager2.js +2 -2
  40. package/dist/components/crowdsource-manager.js +27 -6
  41. package/dist/components/edit-card2.js +29 -18
  42. package/dist/components/layer-table2.js +136 -78
  43. package/dist/components/map-card2.js +17 -5
  44. package/dist/components/map-layer-picker2.js +114 -52
  45. package/dist/components/map-picker2.js +4 -4
  46. package/dist/components/map-select-tools2.js +55 -43
  47. package/dist/components/map-tools2.js +20 -1
  48. package/dist/components/mapViewUtils.js +39 -53
  49. package/dist/components/public-notification.js +1 -1
  50. package/dist/components/publicNotificationStore.js +0 -4
  51. package/dist/components/refine-selection2.js +61 -49
  52. package/dist/esm/basemap-gallery_6.entry.js +20 -5
  53. package/dist/esm/buffer-tools_4.entry.js +1 -1
  54. package/dist/esm/calcite-chip_3.entry.js +797 -0
  55. package/dist/esm/calcite-combobox_6.entry.js +76 -28
  56. package/dist/esm/card-manager_3.entry.js +112 -54
  57. package/dist/esm/crowdsource-manager.entry.js +18 -5
  58. package/dist/esm/{downloadUtils-67c7a6c8.js → downloadUtils-ac67a786.js} +2 -2
  59. package/dist/esm/edit-card_2.entry.js +29 -18
  60. package/dist/esm/{index.es-59a67d3d.js → index.es-f553598f.js} +2 -2
  61. package/dist/esm/loader.js +1 -1
  62. package/dist/esm/map-select-tools_3.entry.js +3 -3
  63. package/dist/esm/{mapViewUtils-00a04d52.js → mapViewUtils-8141d8c1.js} +39 -53
  64. package/dist/esm/polyfills/core-js.js +11 -0
  65. package/dist/esm/polyfills/dom.js +79 -0
  66. package/dist/esm/polyfills/es5-html-element.js +1 -0
  67. package/dist/esm/polyfills/index.js +34 -0
  68. package/dist/esm/polyfills/system.js +6 -0
  69. package/dist/esm/public-notification.entry.js +3 -3
  70. package/dist/esm/{publicNotificationStore-90a6a274.js → publicNotificationStore-dcf39a55.js} +0 -4
  71. package/dist/esm/solutions-components.js +1 -1
  72. package/dist/solutions-components/demos/crowdsource-manager.html +2 -2
  73. package/dist/solutions-components/demos/new-public-notification.html +3 -3
  74. package/dist/solutions-components/p-08b52ed8.entry.js +6 -0
  75. package/dist/solutions-components/p-16362eb4.js +36 -0
  76. package/dist/solutions-components/{p-3691a072.js → p-1ab414e0.js} +2 -2
  77. package/dist/solutions-components/{p-73ab9d9a.entry.js → p-3d7aa1b2.entry.js} +1 -1
  78. package/dist/solutions-components/{p-9a8c51bf.entry.js → p-57cf6784.entry.js} +1 -1
  79. package/dist/solutions-components/p-64b22d57.entry.js +6 -0
  80. package/dist/solutions-components/p-654dd5df.entry.js +6 -0
  81. package/dist/solutions-components/{p-0219a1a9.entry.js → p-83a52f9e.entry.js} +6 -6
  82. package/dist/solutions-components/{p-f9166fcb.js → p-a26711e8.js} +1 -1
  83. package/dist/solutions-components/{p-b892e595.entry.js → p-b9d29f30.entry.js} +1 -1
  84. package/dist/solutions-components/{p-1b41181b.js → p-c8d0ce92.js} +2 -2
  85. package/dist/solutions-components/p-ee7e2f00.entry.js +34 -0
  86. package/dist/solutions-components/p-ef6ec812.entry.js +6 -0
  87. package/dist/solutions-components/solutions-components.esm.js +1 -1
  88. package/dist/solutions-components/utils/interfaces.ts +12 -1
  89. package/dist/solutions-components/utils/mapViewUtils.ts +41 -57
  90. package/dist/solutions-components/utils/publicNotificationStore.ts +0 -4
  91. package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +5 -0
  92. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +37 -1
  93. package/dist/types/components/edit-card/edit-card.d.ts +10 -9
  94. package/dist/types/components/layer-table/layer-table.d.ts +40 -0
  95. package/dist/types/components/map-card/map-card.d.ts +25 -1
  96. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +50 -3
  97. package/dist/types/components/map-picker/map-picker.d.ts +2 -2
  98. package/dist/types/components/map-tools/map-tools.d.ts +21 -1
  99. package/dist/types/components.d.ts +182 -2
  100. package/dist/types/preact.d.ts +6 -3
  101. package/dist/types/utils/interfaces.d.ts +10 -1
  102. package/dist/types/utils/mapViewUtils.d.ts +8 -24
  103. package/dist/types/utils/publicNotificationStore.d.ts +0 -2
  104. package/package.json +1 -1
  105. package/dist/cjs/calcite-chip.cjs.entry.js +0 -259
  106. package/dist/cjs/calcite-notice.cjs.entry.js +0 -139
  107. package/dist/cjs/calcite-tooltip.cjs.entry.js +0 -439
  108. package/dist/esm/calcite-chip.entry.js +0 -255
  109. package/dist/esm/calcite-notice.entry.js +0 -135
  110. package/dist/esm/calcite-tooltip.entry.js +0 -435
  111. package/dist/solutions-components/p-2cff8331.entry.js +0 -6
  112. package/dist/solutions-components/p-3a6c8fc3.entry.js +0 -6
  113. package/dist/solutions-components/p-3b1fc7a2.entry.js +0 -6
  114. package/dist/solutions-components/p-767002cd.js +0 -36
  115. package/dist/solutions-components/p-a776b7e6.entry.js +0 -6
  116. package/dist/solutions-components/p-be36d5ed.entry.js +0 -22
  117. package/dist/solutions-components/p-c644edf5.entry.js +0 -11
  118. package/dist/solutions-components/p-cfd88a2f.entry.js +0 -11
@@ -1,435 +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-c7de2486.js';
7
- import { q as queryElementRoots, i as isPrimaryPointerButton, A as getShadowRootNode, t as toAriaBoolean } from './dom-2b326ec3.js';
8
- import { c as connectFloatingUI, b as defaultOffsetDistance, a as disconnectFloatingUI, r as reposition, F as FloatingCSS } from './floating-ui-9f8e4ed4.js';
9
- import { g as guid } from './guid-70cda807.js';
10
- import { o as onToggleOpenCloseComponent } from './openCloseComponent-9fce341c.js';
11
- import { F as FloatingArrow } from './FloatingArrow-4a1b35d6.js';
12
- import './resources-1e6d76df.js';
13
- import './debounce-229b1a22.js';
14
-
15
- /*!
16
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
17
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
18
- * v1.6.1
19
- */
20
- const CSS = {
21
- container: "container",
22
- };
23
- const TOOLTIP_OPEN_DELAY_MS = 300;
24
- const TOOLTIP_CLOSE_DELAY_MS = 500;
25
- const ARIA_DESCRIBED_BY = "aria-describedby";
26
-
27
- /*!
28
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
29
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
30
- * v1.6.1
31
- */
32
- function getEffectiveReferenceElement(tooltip) {
33
- const { referenceElement } = tooltip;
34
- return ((typeof referenceElement === "string" ? queryElementRoots(tooltip, { id: referenceElement }) : referenceElement) ||
35
- null);
36
- }
37
-
38
- /*!
39
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
40
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
41
- * v1.6.1
42
- */
43
- class TooltipManager {
44
- constructor() {
45
- // --------------------------------------------------------------------------
46
- //
47
- // Private Properties
48
- //
49
- // --------------------------------------------------------------------------
50
- this.registeredElements = new WeakMap();
51
- this.registeredShadowRootCounts = new WeakMap();
52
- this.hoverOpenTimeout = null;
53
- this.hoverCloseTimeout = null;
54
- this.hoveredTooltip = null;
55
- this.clickedTooltip = null;
56
- this.activeTooltip = null;
57
- this.registeredElementCount = 0;
58
- // --------------------------------------------------------------------------
59
- //
60
- // Private Methods
61
- //
62
- // --------------------------------------------------------------------------
63
- this.queryTooltip = (composedPath) => {
64
- const { registeredElements } = this;
65
- const registeredElement = composedPath.find((pathEl) => registeredElements.has(pathEl));
66
- return registeredElements.get(registeredElement);
67
- };
68
- this.keyDownHandler = (event) => {
69
- if (event.key === "Escape" && !event.defaultPrevented) {
70
- const { activeTooltip } = this;
71
- if (activeTooltip?.open) {
72
- this.clearHoverTimeout();
73
- this.closeActiveTooltip();
74
- const referenceElement = getEffectiveReferenceElement(activeTooltip);
75
- if (referenceElement instanceof Element && referenceElement.contains(event.target)) {
76
- event.preventDefault();
77
- }
78
- }
79
- }
80
- };
81
- this.pointerMoveHandler = (event) => {
82
- const composedPath = event.composedPath();
83
- const { activeTooltip } = this;
84
- const hoveringActiveTooltip = activeTooltip?.open && composedPath.includes(activeTooltip);
85
- if (hoveringActiveTooltip) {
86
- this.clearHoverTimeout();
87
- return;
88
- }
89
- const tooltip = this.queryTooltip(composedPath);
90
- this.hoveredTooltip = tooltip;
91
- if (this.isClosableClickedTooltip(tooltip)) {
92
- return;
93
- }
94
- this.clickedTooltip = null;
95
- if (tooltip) {
96
- this.openHoveredTooltip(tooltip);
97
- }
98
- else if (activeTooltip) {
99
- this.closeHoveredTooltip();
100
- }
101
- };
102
- this.pointerDownHandler = (event) => {
103
- if (!isPrimaryPointerButton(event)) {
104
- return;
105
- }
106
- const clickedTooltip = this.queryTooltip(event.composedPath());
107
- this.clickedTooltip = clickedTooltip;
108
- if (clickedTooltip?.closeOnClick) {
109
- this.toggleTooltip(clickedTooltip, false);
110
- this.clearHoverTimeout();
111
- }
112
- };
113
- this.focusInHandler = (event) => {
114
- this.queryFocusedTooltip(event, true);
115
- };
116
- this.focusOutHandler = (event) => {
117
- this.queryFocusedTooltip(event, false);
118
- };
119
- this.openHoveredTooltip = (tooltip) => {
120
- this.hoverOpenTimeout = window.setTimeout(() => {
121
- if (this.hoverOpenTimeout === null) {
122
- return;
123
- }
124
- this.clearHoverCloseTimeout();
125
- if (this.activeTooltip === this.hoveredTooltip) {
126
- return;
127
- }
128
- this.closeActiveTooltip();
129
- if (tooltip !== this.hoveredTooltip) {
130
- return;
131
- }
132
- this.toggleTooltip(tooltip, true);
133
- }, this.activeTooltip ? 0 : TOOLTIP_OPEN_DELAY_MS);
134
- };
135
- this.closeHoveredTooltip = () => {
136
- this.hoverCloseTimeout = window.setTimeout(() => {
137
- if (this.hoverCloseTimeout === null) {
138
- return;
139
- }
140
- this.closeActiveTooltip();
141
- }, TOOLTIP_CLOSE_DELAY_MS);
142
- };
143
- }
144
- // --------------------------------------------------------------------------
145
- //
146
- // Public Methods
147
- //
148
- // --------------------------------------------------------------------------
149
- registerElement(referenceEl, tooltip) {
150
- this.registeredElementCount++;
151
- this.registeredElements.set(referenceEl, tooltip);
152
- const shadowRoot = this.getReferenceElShadowRootNode(referenceEl);
153
- if (shadowRoot) {
154
- this.registerShadowRoot(shadowRoot);
155
- }
156
- if (this.registeredElementCount === 1) {
157
- this.addListeners();
158
- }
159
- }
160
- unregisterElement(referenceEl) {
161
- const shadowRoot = this.getReferenceElShadowRootNode(referenceEl);
162
- if (shadowRoot) {
163
- this.unregisterShadowRoot(shadowRoot);
164
- }
165
- if (this.registeredElements.delete(referenceEl)) {
166
- this.registeredElementCount--;
167
- }
168
- if (this.registeredElementCount === 0) {
169
- this.removeListeners();
170
- }
171
- }
172
- addShadowListeners(shadowRoot) {
173
- shadowRoot.addEventListener("focusin", this.focusInHandler, { capture: true });
174
- shadowRoot.addEventListener("focusout", this.focusOutHandler, { capture: true });
175
- }
176
- removeShadowListeners(shadowRoot) {
177
- shadowRoot.removeEventListener("focusin", this.focusInHandler, { capture: true });
178
- shadowRoot.removeEventListener("focusout", this.focusOutHandler, { capture: true });
179
- }
180
- addListeners() {
181
- document.addEventListener("keydown", this.keyDownHandler, { capture: true });
182
- document.addEventListener("pointermove", this.pointerMoveHandler, { capture: true });
183
- document.addEventListener("pointerdown", this.pointerDownHandler, { capture: true });
184
- document.addEventListener("focusin", this.focusInHandler, { capture: true });
185
- document.addEventListener("focusout", this.focusOutHandler, { capture: true });
186
- }
187
- removeListeners() {
188
- document.removeEventListener("keydown", this.keyDownHandler, { capture: true });
189
- document.removeEventListener("pointermove", this.pointerMoveHandler, { capture: true });
190
- document.removeEventListener("pointerdown", this.pointerDownHandler, { capture: true });
191
- document.removeEventListener("focusin", this.focusInHandler, { capture: true });
192
- document.removeEventListener("focusout", this.focusOutHandler, { capture: true });
193
- }
194
- clearHoverOpenTimeout() {
195
- window.clearTimeout(this.hoverOpenTimeout);
196
- this.hoverOpenTimeout = null;
197
- }
198
- clearHoverCloseTimeout() {
199
- window.clearTimeout(this.hoverCloseTimeout);
200
- this.hoverCloseTimeout = null;
201
- }
202
- clearHoverTimeout() {
203
- this.clearHoverOpenTimeout();
204
- this.clearHoverCloseTimeout();
205
- }
206
- closeActiveTooltip() {
207
- const { activeTooltip } = this;
208
- if (activeTooltip?.open) {
209
- this.toggleTooltip(activeTooltip, false);
210
- }
211
- }
212
- toggleFocusedTooltip(tooltip, open) {
213
- this.closeActiveTooltip();
214
- if (open) {
215
- this.clearHoverTimeout();
216
- }
217
- this.toggleTooltip(tooltip, open);
218
- }
219
- toggleTooltip(tooltip, open) {
220
- tooltip.open = open;
221
- this.activeTooltip = open ? tooltip : null;
222
- }
223
- queryFocusedTooltip(event, open) {
224
- const tooltip = this.queryTooltip(event.composedPath());
225
- if (!tooltip || this.isClosableClickedTooltip(tooltip)) {
226
- return;
227
- }
228
- this.toggleFocusedTooltip(tooltip, open);
229
- }
230
- isClosableClickedTooltip(tooltip) {
231
- return tooltip?.closeOnClick && tooltip === this.clickedTooltip;
232
- }
233
- registerShadowRoot(shadowRoot) {
234
- const { registeredShadowRootCounts } = this;
235
- const newCount = (registeredShadowRootCounts.get(shadowRoot) ?? 0) + 1;
236
- if (newCount === 1) {
237
- this.addShadowListeners(shadowRoot);
238
- }
239
- registeredShadowRootCounts.set(shadowRoot, newCount);
240
- }
241
- unregisterShadowRoot(shadowRoot) {
242
- const { registeredShadowRootCounts } = this;
243
- const newCount = registeredShadowRootCounts.get(shadowRoot) - 1;
244
- if (newCount === 0) {
245
- this.removeShadowListeners(shadowRoot);
246
- }
247
- registeredShadowRootCounts.set(shadowRoot, newCount);
248
- }
249
- getReferenceElShadowRootNode(referenceEl) {
250
- return referenceEl instanceof Element ? getShadowRootNode(referenceEl) : null;
251
- }
252
- }
253
-
254
- const tooltipCss = ":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-app-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}";
255
-
256
- const manager = new TooltipManager();
257
- const Tooltip = class {
258
- constructor(hostRef) {
259
- registerInstance(this, hostRef);
260
- this.calciteTooltipBeforeClose = createEvent(this, "calciteTooltipBeforeClose", 6);
261
- this.calciteTooltipClose = createEvent(this, "calciteTooltipClose", 6);
262
- this.calciteTooltipBeforeOpen = createEvent(this, "calciteTooltipBeforeOpen", 6);
263
- this.calciteTooltipOpen = createEvent(this, "calciteTooltipOpen", 6);
264
- this.guid = `calcite-tooltip-${guid()}`;
265
- this.hasLoaded = false;
266
- this.openTransitionProp = "opacity";
267
- this.setTransitionEl = (el) => {
268
- this.transitionEl = el;
269
- };
270
- this.setUpReferenceElement = (warn = true) => {
271
- this.removeReferences();
272
- this.effectiveReferenceElement = getEffectiveReferenceElement(this.el);
273
- connectFloatingUI(this, this.effectiveReferenceElement, this.el);
274
- const { el, referenceElement, effectiveReferenceElement } = this;
275
- if (warn && referenceElement && !effectiveReferenceElement) {
276
- console.warn(`${el.tagName}: reference-element id "${referenceElement}" was not found.`, {
277
- el,
278
- });
279
- }
280
- this.addReferences();
281
- };
282
- this.getId = () => {
283
- return this.el.id || this.guid;
284
- };
285
- this.addReferences = () => {
286
- const { effectiveReferenceElement } = this;
287
- if (!effectiveReferenceElement) {
288
- return;
289
- }
290
- const id = this.getId();
291
- if ("setAttribute" in effectiveReferenceElement) {
292
- effectiveReferenceElement.setAttribute(ARIA_DESCRIBED_BY, id);
293
- }
294
- manager.registerElement(effectiveReferenceElement, this.el);
295
- };
296
- this.removeReferences = () => {
297
- const { effectiveReferenceElement } = this;
298
- if (!effectiveReferenceElement) {
299
- return;
300
- }
301
- if ("removeAttribute" in effectiveReferenceElement) {
302
- effectiveReferenceElement.removeAttribute(ARIA_DESCRIBED_BY);
303
- }
304
- manager.unregisterElement(effectiveReferenceElement);
305
- };
306
- this.closeOnClick = false;
307
- this.label = undefined;
308
- this.offsetDistance = defaultOffsetDistance;
309
- this.offsetSkidding = 0;
310
- this.open = false;
311
- this.overlayPositioning = "absolute";
312
- this.placement = "auto";
313
- this.referenceElement = undefined;
314
- this.effectiveReferenceElement = undefined;
315
- this.floatingLayout = "vertical";
316
- }
317
- offsetDistanceOffsetHandler() {
318
- this.reposition(true);
319
- }
320
- offsetSkiddingHandler() {
321
- this.reposition(true);
322
- }
323
- openHandler(value) {
324
- onToggleOpenCloseComponent(this);
325
- if (value) {
326
- this.reposition(true);
327
- }
328
- }
329
- overlayPositioningHandler() {
330
- this.reposition(true);
331
- }
332
- placementHandler() {
333
- this.reposition(true);
334
- }
335
- referenceElementHandler() {
336
- this.setUpReferenceElement();
337
- }
338
- // --------------------------------------------------------------------------
339
- //
340
- // Lifecycle
341
- //
342
- // --------------------------------------------------------------------------
343
- connectedCallback() {
344
- this.setUpReferenceElement(this.hasLoaded);
345
- if (this.open) {
346
- onToggleOpenCloseComponent(this);
347
- }
348
- }
349
- async componentWillLoad() {
350
- if (this.open) {
351
- onToggleOpenCloseComponent(this);
352
- }
353
- }
354
- componentDidLoad() {
355
- if (this.referenceElement && !this.effectiveReferenceElement) {
356
- this.setUpReferenceElement();
357
- }
358
- this.reposition(true);
359
- this.hasLoaded = true;
360
- }
361
- disconnectedCallback() {
362
- this.removeReferences();
363
- disconnectFloatingUI(this, this.effectiveReferenceElement, this.el);
364
- }
365
- // --------------------------------------------------------------------------
366
- //
367
- // Public Methods
368
- //
369
- // --------------------------------------------------------------------------
370
- /**
371
- * Updates the position of the component.
372
- *
373
- * @param delayed
374
- */
375
- async reposition(delayed = false) {
376
- const { el, effectiveReferenceElement, placement, overlayPositioning, offsetDistance, offsetSkidding, arrowEl, } = this;
377
- return reposition(this, {
378
- floatingEl: el,
379
- referenceEl: effectiveReferenceElement,
380
- overlayPositioning,
381
- placement,
382
- offsetDistance,
383
- offsetSkidding,
384
- arrowEl,
385
- type: "tooltip",
386
- }, delayed);
387
- }
388
- // --------------------------------------------------------------------------
389
- //
390
- // Private Methods
391
- //
392
- // --------------------------------------------------------------------------
393
- onBeforeOpen() {
394
- this.calciteTooltipBeforeOpen.emit();
395
- }
396
- onOpen() {
397
- this.calciteTooltipOpen.emit();
398
- }
399
- onBeforeClose() {
400
- this.calciteTooltipBeforeClose.emit();
401
- }
402
- onClose() {
403
- this.calciteTooltipClose.emit();
404
- }
405
- // --------------------------------------------------------------------------
406
- //
407
- // Render Methods
408
- //
409
- // --------------------------------------------------------------------------
410
- render() {
411
- const { effectiveReferenceElement, label, open, floatingLayout } = this;
412
- const displayed = effectiveReferenceElement && open;
413
- const hidden = !displayed;
414
- return (h(Host, { "aria-hidden": toAriaBoolean(hidden), "aria-label": label, "aria-live": "polite", "calcite-hydrated-hidden": hidden, id: this.getId(), role: "tooltip" }, h("div", { class: {
415
- [FloatingCSS.animation]: true,
416
- [FloatingCSS.animationActive]: displayed,
417
- },
418
- // eslint-disable-next-line react/jsx-sort-props
419
- ref: this.setTransitionEl }, h(FloatingArrow, { floatingLayout: floatingLayout,
420
- // eslint-disable-next-line react/jsx-sort-props
421
- ref: (arrowEl) => (this.arrowEl = arrowEl) }), h("div", { class: CSS.container }, h("slot", null)))));
422
- }
423
- get el() { return getElement(this); }
424
- static get watchers() { return {
425
- "offsetDistance": ["offsetDistanceOffsetHandler"],
426
- "offsetSkidding": ["offsetSkiddingHandler"],
427
- "open": ["openHandler"],
428
- "overlayPositioning": ["overlayPositioningHandler"],
429
- "placement": ["placementHandler"],
430
- "referenceElement": ["referenceElementHandler"]
431
- }; }
432
- };
433
- Tooltip.style = tooltipCss;
434
-
435
- export { Tooltip as calcite_tooltip };
@@ -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,h as i,H as s,g as e,c as a}from"./p-33613993.js";import{l as h}from"./p-0dab4c93.js";import{g as n}from"./p-22833bd3.js";import"./p-e1a4994d.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._basemapElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/BasemapGallery"]);this.BasemapGallery=t}_initBaseMapGallery(t){t&&this.BasemapGallery&&(this.basemapWidget?this.basemapWidget.view=t:this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.mapView=void 0,this.fullscreenWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,null,i("div",{class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){this._initFullscreenWidget()}async componentDidLoad(){this._initFullscreenWidget()}async _initModules(){const[t]=await h(["esri/widgets/Fullscreen"]);this.Fullscreen=t}_initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?this.fullscreenWidget=new this.Fullscreen({view:this.mapView}):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._legendElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this.mapInfoChange.emit(t[0])}render(){return i(s,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidRender(){this._mapListExpanded&&await this._list.setFocus()}componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){var t;return i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name)}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"action-bar-color border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border"},this.mapInfos.map((t=>i("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};l.style=":host{display:block}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.action-bar-color{background-color:var(--calcite-ui-border-3) !important}";const d=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,null,i("div",{class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,n=h?i.map.findLayerById(h):null,o=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;n?a.layer=n:o&&(a.layer=new this.FeatureLayer(o))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},t),{includeDefaultSources:!0}),t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};d.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}";const p=class{constructor(i){t(this,i),this.layout="vertical",this.mapView=void 0,this.searchConfiguration=void 0,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?i.viewModel.enter():i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations()}render(){const t=this._showTools?"":"display-none",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFullscreen?"":"display-none",o=this._showFullscreen?"full-screen-exit":"full-screen",r=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return i(s,null,i("div",null,i("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))),i("div",{class:`margin-top-1-2 box-shadow ${t}`},this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())),this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())),this._getActionGroup(o,!1,r,(()=>this._expand())),this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())))),i("basemap-gallery",{class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},searchConfiguration:this.searchConfiguration}),i("map-legend",{class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{class:n,mapView:this.mapView,ref:t=>{this._fullscreenElement=t}}))}_getActionGroup(t,s,e,a){return i("div",{class:"border-bottom"},i("calcite-action",{alignment:"center",class:"square-40",compact:!1,disabled:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("span",null,e)))}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};p.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-40{width:40px;height:40px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}";export{o as basemap_gallery,r as map_fullscreen,c as map_legend,l as map_picker,d as map_search,p as map_tools}
@@ -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,h as i,H as e,g as h}from"./p-33613993.js";import{g as s}from"./p-22833bd3.js";import{E as l}from"./p-2a58e378.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.classicGrid=!1,this.enableAutoRefresh=!0,this.enableInlineEdit=!1,this.showNewestFirst=!0,this.hideMap=!1,this.mapInfos=[],this.searchConfiguration=void 0,this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._translations=void 0,this._layoutMode=l.GRID,this._mapView=void 0,this._panelOpen=!0}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,this._expandPopup?(this._shouldSetMapView=!0,this._expandPopup=!1):this._setMapView()}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))))}componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,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,h){const s=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 ${s}`},this._getTable(t,e),this._getMapAndCard(t,e,h)):i("div",{class:`width-full height-full ${s}`},this._getMapAndCard(t,e,h),this._getTable(t,e)))}_getMapAndCard(t,e,h){const s=this._getMapSizeClass(t,e);return this.classicGrid?i("div",{class:`${s} overflow-hidden`},this._getCardNode(t,h),this._getMapNode(t,h)):i("div",{class:`${s} overflow-hidden`},this._getMapNode(t,h),this._getPopupExpandNode(),this._getCardNode(t,h))}_getMapNode(t,e){return i("div",{class:`${this.classicGrid&&t===l.GRID?"width-full":this._expandPopup?"height-50-px":"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",{class:"width-full",mapInfos:this.mapInfos}))}_getPopupExpandNode(){const t=this._expandPopup?"chevrons-down":"chevrons-up";return i("div",{class:"height-49-px calcite-mode-dark"},i("calcite-panel",null,i("div",{class:"display-flex align-items-center",slot:"header-content"},i("calcite-icon",{class:"padding-inline-end-75",icon:"information",scale:"s"}),i("div",null,this._translations.information)),i("calcite-action",{class:"height-49-px",icon:t,onClick:()=>this._togglePopup(),slot:"header-actions-end"})))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(t,e){return i("div",{class:""+(this.classicGrid&&t===l.GRID?"width-full adjusted-height-100":this._expandPopup?"width-50 adjusted-height-100-50":"width-50 height-full")},i("card-manager",{class:(this.classicGrid&&t===l.GRID?"":t!==l.GRID||this._expandPopup||e?"adjusted-height-100":"adjusted-height-50")+" width-full",mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e){const h=this._getTableSizeClass(t,e),s=this._getDividerIcon(t,e),a=e?this._translations.close:this._translations.open,o="toggle-layout";return i("calcite-shell",{class:h+" border-bottom"},i("calcite-action-bar",{class:"border",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:s,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",{enableAutoRefresh:this.enableAutoRefresh,enableInlineEdit:this.enableInlineEdit,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,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}_setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._mapView.popupEnabled=!1}async _getTranslations(){const t=await s(this.el);this._translations=t[0]}get el(){return h(this)}};a.style=":host{display:block;--calcite-label-margin-bottom:0px}.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-ui-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-ui-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-49-px{height:49px}.height-50-px{height:50px}.padding-inline-end-75{padding-inline-end:0.75rem}.align-items-center{align-items:center}";export{a as crowdsource_manager}
@@ -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,c as i,h as s,H as e,g as o}from"./p-33613993.js";import{l as a}from"./p-0dab4c93.js";import{g as n}from"./p-22833bd3.js";import"./p-e1a4994d.js";const l=class{constructor(s){t(this,s),this.closeEdit=i(this,"closeEdit",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._translations=void 0}graphicIndexWatchHandler(){this._initEditorWidget()}graphicsWatchHandler(){this._initEditorWidget()}mapViewWatchHandler(){this._initEditorWidget()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;const s=document.getElementsByTagName("layer-table");if(1===s.length){const t=s[0];this.graphics=await t.getSelectedGraphics()}(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer)}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled);return s(e,null,s("div",{class:"position-relative"},i?s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)):void 0,s("div",{slot:"content"},s("div",{id:"feature-form",ref:t=>this._editContainer=t}))))}async _initModules(){const[t,i]=await a(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}_initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div");this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,visibleElements:{snappingControls:!1,sketchTooltipControls:!1},container:t}),this._editHandle&&this._attachmentHandle&&this._activeWorkflowHandle&&(this._editHandle.remove(),this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._editHandle=this.reactiveUtils.when((()=>"ready"===this._editor.viewModel.state),(()=>{this._shouldClose&&(this.closeEdit.emit(),this._shouldClose=!1),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&(this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0)})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1)})),this._editContainer.appendChild(t)}}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphicIndex:["graphicIndexWatchHandler"],graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-ui-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}";const r=class{constructor(s){t(this,s),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._translations=void 0}async graphicsWatchHandler(){var t;if(this._features||await this._initFeaturesWidget(),this.graphics.length>0){const i=null===(t=this.graphics[0])||void 0===t?void 0:t.layer;this._editEnabled=i.editingEnabled&&i.capabilities.operations.supportsUpdate,this._features.open({features:this.graphics})}else this._features.clear(),this._features.close()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){var t;const i=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",o=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",a=!this.isLoading&&this._editRecordOpen?"display-none":"";return s(e,null,s("calcite-shell",null,s("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),s("div",{class:"esri-widget "+i,id:"features-node"}),s("div",{class:`${a} width-100`,slot:"footer"},s("div",{class:"display-flex top-border padding-1-2"},s("calcite-button",{appearance:"solid","icon-start":"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},s("span",null,this._translations.edit))),s("div",{class:"display-flex padding-1-2 button-container top-border"},s("div",{class:"min-width-100"},s("calcite-button",{appearance:"outline",id:"solutions-back",onClick:()=>this._back(),width:"full"},this._translations.back),s("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},s("span",null,this._translations.back))),s("div",null,this._getCount()),s("div",{class:"min-width-100"},s("calcite-button",{appearance:"outline",id:"solutions-next",onClick:()=>this._next(),width:"full"},this._translations.next),s("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-next"},s("span",null,this._translations.next))))),s("edit-card",{class:o,graphicIndex:null===(t=this._features)||void 0===t?void 0:t.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{slot:"title"},this._translations.editDisabled),s("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await a(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async _initFeaturesWidget(){return await this.mapView.when((()=>{this._features?this._features.view=this.mapView:(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!0}}),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit(this._features.selectedFeature)})))}))}_alertClosed(){this._alertOpen=!1}_editRecordClosed(){this._editRecordOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,s;const e=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),o=null===(s=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===s?void 0:s.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",o)}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return o(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block;--calcite-label-margin-bottom:0}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:8px}tr:nth-child(odd){background:var(--calcite-ui-foreground-2)}.bottom-border{padding-bottom:0.5rem;border-bottom:1px solid var(--calcite-ui-border-1)}.padding-1-2{padding:0.5rem}.padding-top-1-2{padding-top:0.5rem}.font-color-3{color:var(--calcite-ui-text-3)}.display-none{display:none}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-features__footer{display:none !important}.button-container{justify-content:space-between;align-items:center}.top-border{border-top:1px solid var(--calcite-ui-border-1)}.min-width-100{min-width:100px}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-ui-foreground-1) !important;height:100% !important}";export{l as edit_card,r as info_card}
@@ -1,36 +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{c as n}from"./p-2a58e378.js";
7
- /** @license
8
- * Copyright 2022 Esri
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */async function t(n){const t=n.createQuery();return t.where="1=1",await n.queryObjectIds(t)}async function a(n,t){let a=[];const c=n?n.map((n=>async function(n,t){const a=t.createQuery();return a.spatialRelationship="intersects",a.geometry=n,t.queryObjectIds(a)}
22
- /** @license
23
- * Copyright 2022 Esri
24
- *
25
- * Licensed under the Apache License, Version 2.0 (the "License");
26
- * you may not use this file except in compliance with the License.
27
- * You may obtain a copy of the License at
28
- *
29
- * http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software
32
- * distributed under the License is distributed on an "AS IS" BASIS,
33
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
- * See the License for the specific language governing permissions and
35
- * limitations under the License.
36
- */(n,t))):[Promise.resolve()];return(await Promise.all(c)).forEach((n=>{a=[...a,...n||[]]})),a}async function c(n,t,a,s,e){const o=t.capabilities.query.maxRecordCount,i=t.createQuery();i.start=0,i.num=o,i.returnGeometry=s,i.objectIds=n.slice(0,o),e&&(i.outSpatialReference=e);const r=await t.queryFeatures(i);a=a.concat(r.features);const u=n.slice(o,n.length);return u.length>0?c(u,t,a,s,e):Promise.resolve(a)}async function s(n,t,a,c){const e=t.capabilities.query.maxRecordCount,o=t.createQuery();o.start=n,o.num=e,o.geometry=a;const i=await t.queryFeatures(o);return c[t.id]=c[t.id].concat(i.features),i.exceededTransferLimit?s(n+=e,t,a,c):Promise.resolve(c)}function e(n,t){return[...o(n,"polygon",t),...o(n,"polyline",t),...o(n,"point",t)]}function o(n,t,a){const c=(null==n?void 0:n.filter((n=>n.type===t)))||[];return c.length<=1?c:[a.union(c)]}async function i(n){let t={};return await n.when((()=>{t=n.map.allLayers.toArray().reduce(((n,t)=>("feature"===t.type&&(n[t.id]=t.title),n)),{})})),t}async function r(n){let t={};return await n.when((()=>{t=n.map.allTables.toArray().reduce(((n,t)=>(n[t.id]=t.title,n)),{})})),t}async function u(n){let t=[];return await n.when((()=>{t=n.map.allLayers.toArray().reduce(((n,t)=>("feature"===t.type&&n.push(t.id),n)),[])})),t}async function f(n){let t=[];return await n.when((()=>{t=n.map.allTables.toArray().reduce(((n,t)=>(n.push(t.id),n)),[])})),t}async function y(n,t){const a=await w(n,t);return a?await n.whenLayerView(a):void 0}async function w(n,t){let a=[];return await n.when((()=>{a=[...n.map.allLayers.toArray(),...n.map.allTables.toArray()].filter((n=>n.id===t))})),a.length>0?a[0]:void 0}async function l(n,t,a,c=!1){return c&&await d(n,t,a,!1),t.highlight(n)}async function j(n){const t=b(n);return Object.keys(t).reduce(((n,a)=>{const c=t[a];return n.push(c.layerView.highlight(c.ids)),n}),[])}function b(t){return t.reduce(((t,a)=>{const c=a.layerView,s=null==c?void 0:c.layer.id;return s&&Object.keys(t).indexOf(s)>-1?t[s].ids=[...new Set([...a.selectedIds,...t[s].ids])]:s&&(t[s]={layerView:c,ids:a.selectedIds}),a.workflowType===n.REFINE&&Object.keys(a.refineInfos).forEach((n=>{const c=a.refineInfos[n];Object.keys(t).indexOf(n)>-1&&(t[n].ids=[...new Set([...c.addIds,...t[n].ids])],t[n].ids=t[n].ids.filter((n=>c.removeIds.indexOf(n)<0)))})),t}),{})}async function d(n,t,a,c=!0,s){const e=await async function(n,t){const a=t.createQuery();return a.objectIds=n,t.queryExtent(a)}(n,t.layer);await a.goTo(e.extent),c&&await async function(n,t,a){const c={objectIds:n};t.featureEffect=Object.assign(Object.assign({},a),{filter:c}),setTimeout((()=>{t.featureEffect=void 0}),1300)}(n,t,s)}export{w as a,u as b,t as c,a as d,e,y as f,d as g,l as h,s as i,b as j,j as k,f as l,i as m,r as n,c as q}
@@ -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,h as i,H as s,g as e,c as a}from"./p-33613993.js";import{g as l}from"./p-22833bd3.js";import{q as h,a as n,b as o,g as c,c as r}from"./p-767002cd.js";import{l as d}from"./p-0dab4c93.js";import{d as p}from"./p-1b41181b.js";import"./p-e1a4994d.js";import"./p-2a58e378.js";import"./p-ecc95259.js";const m=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 h(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s,this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await n(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,e;const a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",l=(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 "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),i("div",{class:"padding-1 "+l},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart)))))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return e(this)}};m.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 g=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this._allIds=[],this._tableSorting=!1,this.onTableNodeCreate=t=>{this._tableNode=t},this.enableAutoRefresh=void 0,this.enableInlineEdit=void 0,this.mapInfo=void 0,this.mapView=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._alertOpen=!1,this._fetchingData=!1,this._isDeleting=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._sortActive=!1,this._translations=void 0}async mapViewWatchHandler(){this._fetchingData=!0;const t=await o(this.mapView);this._layer=await n(this.mapView,t[0]),this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})),this._fetchingData=!1}async _layerWatchHandler(){this._fetchingData=!0,await this._resetTable(),this._fetchingData=!1}async _sortActiveWatchHandler(){this._sortActive||await this._sortTable()}async getSelectedGraphics(){return this._selectedIndexes.length>0?await this._getGraphics(this._selectedIndexes):[]}async selectionChanged(t){if(this.zoomAndScrollToSelected){const i=t.detail,s=i.getObjectId(),e=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(e);const a=i.layer;let l;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===a.title&&"feature"===t.layer.type)return l=t,!0})),l&&await c([s],l,this.mapView,!0)}}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){if(!this._layer)return null;const t=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",a=this._allIds.length.toString(),l=this._selectedIndexes.length.toString();return i(s,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full 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 background text-color"},this._translations.recordsSelected.replace("{{total}}",a).replace("{{selected}}",l))),this._getEditDisabledWarning()),this._deleteMessage())}async _initModules(){const[t,i]=await d(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_getTableControlRow(t){const s=this._selectedIndexes.length>0;return i("div",{class:"display-flex table-border height-51",slot:t},i("calcite-action-bar",{expandDisabled:!0,expanded:!0,layout:"horizontal"},i("div",{class:"border-end"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),placeholderIcon:"layers",scale:"l",type:"dropdown"})),i("calcite-action",{appearance:"solid",disabled:!s,icon:"magnifying-glass",id:"magnifying-glass",label:this._translations.zoom,onClick:()=>this._zoom(),text:this._translations.zoom,textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"magnifying-glass"},i("span",null,this._translations.zoom)),i("calcite-action",{appearance:"solid",icon:"filter",id:"filter",onClick:()=>this._filter(),text:this._translations.filters,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"filter"},i("span",null,this._translations.filters)),i("calcite-action",{appearance:"solid",disabled:!s,id:"trash",onClick:()=>this._delete(),text:""},i("calcite-button",{appearance:"transparent",iconStart:"trash",kind:"danger"},this._translations.delete)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"trash"},i("span",null,this._translations.delete)),i("calcite-action",{appearance:"solid",disabled:!s,icon:"erase",id:"erase",onClick:()=>this._clearSelection(),text:this._translations.clearSelection,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"erase"},i("span",null,this._translations.clearSelection))),i("calcite-dropdown",null,i("calcite-action",{appearance:"solid",label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll()},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._toggleShowSelected()},this._showOnlySelected?this._translations.showAll:this._translations.showSelected),i("calcite-dropdown-item",{iconStart:"compare",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._refresh()},this._translations.refresh),i("calcite-dropdown-item",{iconStart:"export",onClick:()=>{this._exportToCSV()}},this._translations.exportCSV))))}async _getTable(t,i){this._layer&&await this._layer.when((async()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t}),this._checkEditEnabled(),await this._table.when((async()=>{this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})),this.reactiveUtils.watch((()=>this._table.activeSortOrders),(t=>{var i,s,e,a;this._sortActive=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===(a=t[0])||void 0===a?void 0:a.fieldName)===this._layer.objectIdField}))}))}))}async _resetTable(){if(this._layer&&this._table){this._clearSelection(),this._allIds=[],this.featureSelectionChange.emit(this._selectedIndexes);const t=this._getColumnTemplates(this._layer.id);this._table.layer=this._layer,this._table.tableTemplate.columnTemplates=t,this._checkEditEnabled(),this._table.view=this.mapView,this._table.editingEnabled=this._editEnabled,this._table.clearSelectionFilter(),this._showOnlySelected=!1,this._sortActive=!1,await this._sortTable()}}_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((async()=>{await this._layer.when((async()=>{this._table.sortColumn(this._layer.objectIdField,"desc"),this._tableSorting=!1}))})))}_getEditDisabledWarning(){return i("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen&&!this._confirmDelete,placement:"top"},i("div",{slot:"title"},this._translations.deleteDisabled),i("div",{slot:"message"},this._translations.enableEditing))}_deleteMessage(){return i("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",open:this._confirmDelete},i("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},i("calcite-icon",{"aria-hidden":"true",class:"padding-end-1 danger-color",icon:"exclamation-mark-triangle",scale:"m"}),this._translations.deleteFeature),i("div",{slot:"content"},this._translations.confirm),i("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._alertClosed(),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 r(this._layer),this._isDeleting=!1,this._alertClosed()}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(),s=this._table.highlightIds.indexOf(i);s>-1?this._table.highlightIds.removeAt(s):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_alertClosed(){this._alertOpen=!1,this._confirmDelete=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){this._selectedIndexes=[],this._table.highlightIds.removeAll()}_filter(){alert("do whatever this button is supposed to do")}_switchSelected(){const t=[...this._selectedIndexes];this._table.highlightIds.removeAll();const i=this._allIds.reduce(((i,s)=>(t.indexOf(s)<0&&i.push(s),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)}_refresh(){this._table.refresh()}_zoom(){this._table.zoomToSelection()}_delete(){this._editEnabled&&(this._confirmDelete=!0),this._alertOpen=!0}async _getGraphics(t){return t.length>0?h(t,this._table.layer,[],!1,this.mapView.spatialReference):[]}async _layerSelectionChanged(t){const i=t.detail[0];if(i!==this._layer.id||0===this._allIds.length){this._fetchingData=!0;const t=this._getColumnTemplates(i);this._layer=await n(this.mapView,i),this._allIds=await r(this._layer),this._table?t&&(this._table.tableTemplate.columnTemplates=t):await this._getTable(this._tableNode,t),await this._table.when((()=>{this._table.highlightIds.removeAll()})),this._selectedIndexes=[],this._table.layer=this._layer,this._table.render()}this._sortActive=!1,await this._sortTable(),this._fetchingData=!1}_getColumnTemplates(t){var i;let s;return null===(i=this.mapInfo.layerInfos)||void 0===i||i.some((i=>{if(i.id===t)return s=i,!0})),null==s?void 0:s.columnTemplates}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],_sortActive:["_sortActiveWatchHandler"]}}};g.style=':host{display:block}.height-full{height:100%}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{border-inline-end:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.bottom-left{position:absolute;left:0;bottom:0}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0}.background{background-color:var(--calcite-ui-background)}.text-color{color:var(--calcite-ui-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-ui-danger)}';const u=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this._loadedId="",this.mapInfos=[],this.mapView=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}async mapInfoChange(t){await this._loadMap(t.detail)}async componentWillLoad(){await this._initModules()}render(){return i(s,null,i("map-picker",{mapInfos:this.mapInfos}),i("div",{class:"map-height",ref:t=>this._mapDiv=t}),i("map-tools",{class:"box-shadow",mapView:this.mapView,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration}))}async _initModules(){const[t,i,s]=await d(["esri/WebMap","esri/views/MapView","esri/widgets/Home"]);this.WebMap=t,this.MapView=i,this.Home=s}async _loadMap(t){let i=null==t?void 0:t.id;if(this._webMapInfo=(""===i||!i)&&this.mapInfos.length>0?this.mapInfos[0]:t,i=this._webMapInfo.id,this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.mapChanged.emit({id:i,mapView:this.mapView}),await this.mapView.when((()=>{const t=new this.Home({view:this.mapView});this.mapView.ui.add(t,{position:"top-left",index:3}),this.mapView.ui.add(this._mapTools,{position:"top-right",index:0})}))}}get el(){return e(this)}};u.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 58px)}.box-shadow{box-shadow:none !important}";export{m as card_manager,g as layer_table,u as map_card}
@@ -1,22 +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,c as i,h as e,H as s,g as o}from"./p-33613993.js";import{q as n,i as a,A as r,t as l}from"./p-e4f9b782.js";import{c,b as h,a as d,r as p,F as f}from"./p-2ee21e9d.js";import{g as u}from"./p-8b448a5b.js";import{o as m}from"./p-a097edf0.js";import{F as g}from"./p-2723beaa.js";import"./p-e3525c00.js";import"./p-a82f35c9.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
- * v1.6.1
11
- */const v="aria-describedby";
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
- * v1.6.1
16
- */
17
- function b(t){const{referenceElement:i}=t;return("string"==typeof i?n(t,{id:i}):i)||null}
18
- /*!
19
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
21
- * v1.6.1
22
- */const w=new class{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.hoveredTooltip=null,this.clickedTooltip=null,this.activeTooltip=null,this.registeredElementCount=0,this.queryTooltip=t=>{const{registeredElements:i}=this,e=t.find((t=>i.has(t)));return i.get(e)},this.keyDownHandler=t=>{if("Escape"===t.key&&!t.defaultPrevented){const{activeTooltip:i}=this;if(i?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const e=b(i);e instanceof Element&&e.contains(t.target)&&t.preventDefault()}}},this.pointerMoveHandler=t=>{const i=t.composedPath(),{activeTooltip:e}=this;if(e?.open&&i.includes(e))return void this.clearHoverTimeout();const s=this.queryTooltip(i);this.hoveredTooltip=s,this.isClosableClickedTooltip(s)||(this.clickedTooltip=null,s?this.openHoveredTooltip(s):e&&this.closeHoveredTooltip())},this.pointerDownHandler=t=>{if(!a(t))return;const i=this.queryTooltip(t.composedPath());this.clickedTooltip=i,i?.closeOnClick&&(this.toggleTooltip(i,!1),this.clearHoverTimeout())},this.focusInHandler=t=>{this.queryFocusedTooltip(t,!0)},this.focusOutHandler=t=>{this.queryFocusedTooltip(t,!1)},this.openHoveredTooltip=t=>{this.hoverOpenTimeout=window.setTimeout((()=>{null!==this.hoverOpenTimeout&&(this.clearHoverCloseTimeout(),this.activeTooltip!==this.hoveredTooltip&&(this.closeActiveTooltip(),t===this.hoveredTooltip&&this.toggleTooltip(t,!0)))}),this.activeTooltip?0:300)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout((()=>{null!==this.hoverCloseTimeout&&this.closeActiveTooltip()}),500)}}registerElement(t,i){this.registeredElementCount++,this.registeredElements.set(t,i);const e=this.getReferenceElShadowRootNode(t);e&&this.registerShadowRoot(e),1===this.registeredElementCount&&this.addListeners()}unregisterElement(t){const i=this.getReferenceElShadowRootNode(t);i&&this.unregisterShadowRoot(i),this.registeredElements.delete(t)&&this.registeredElementCount--,0===this.registeredElementCount&&this.removeListeners()}addShadowListeners(t){t.addEventListener("focusin",this.focusInHandler,{capture:!0}),t.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeShadowListeners(t){t.removeEventListener("focusin",this.focusInHandler,{capture:!0}),t.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}addListeners(){document.addEventListener("keydown",this.keyDownHandler,{capture:!0}),document.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.addEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.addEventListener("focusin",this.focusInHandler,{capture:!0}),document.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),document.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.removeEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.removeEventListener("focusin",this.focusInHandler,{capture:!0}),document.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeActiveTooltip(){const{activeTooltip:t}=this;t?.open&&this.toggleTooltip(t,!1)}toggleFocusedTooltip(t,i){this.closeActiveTooltip(),i&&this.clearHoverTimeout(),this.toggleTooltip(t,i)}toggleTooltip(t,i){t.open=i,this.activeTooltip=i?t:null}queryFocusedTooltip(t,i){const e=this.queryTooltip(t.composedPath());e&&!this.isClosableClickedTooltip(e)&&this.toggleFocusedTooltip(e,i)}isClosableClickedTooltip(t){return t?.closeOnClick&&t===this.clickedTooltip}registerShadowRoot(t){const{registeredShadowRootCounts:i}=this,e=(i.get(t)??0)+1;1===e&&this.addShadowListeners(t),i.set(t,e)}unregisterShadowRoot(t){const{registeredShadowRootCounts:i}=this,e=i.get(t)-1;0===e&&this.removeShadowListeners(t),i.set(t,e)}getReferenceElShadowRootNode(t){return t instanceof Element?r(t):null}},y=class{constructor(e){t(this,e),this.calciteTooltipBeforeClose=i(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=i(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=i(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=i(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${u()}`,this.hasLoaded=!1,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=b(this.el),c(this,this.effectiveReferenceElement,this.el);const{el:i,referenceElement:e,effectiveReferenceElement:s}=this;t&&e&&!s&&console.warn(`${i.tagName}: reference-element id "${e}" was not found.`,{el:i}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const i=this.getId();"setAttribute"in t&&t.setAttribute(v,i),w.registerElement(t,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&t.removeAttribute(v),w.unregisterElement(t))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=h,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){m(this),t&&this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(this.hasLoaded),this.open&&m(this)}async componentWillLoad(){this.open&&m(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),d(this,this.effectiveReferenceElement,this.el)}async reposition(t=!1){const{el:i,effectiveReferenceElement:e,placement:s,overlayPositioning:o,offsetDistance:n,offsetSkidding:a,arrowEl:r}=this;return p(this,{floatingEl:i,referenceEl:e,overlayPositioning:o,placement:s,offsetDistance:n,offsetSkidding:a,arrowEl:r,type:"tooltip"},t)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:t,label:i,open:o,floatingLayout:n}=this,a=t&&o,r=!a;return e(s,{"aria-hidden":l(r),"aria-label":i,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},e("div",{class:{[f.animation]:!0,[f.animationActive]:a},ref:this.setTransitionEl},e(g,{floatingLayout:n,ref:t=>this.arrowEl=t}),e("div",{class:"container"},e("slot",null))))}get el(){return o(this)}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}};y.style=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-app-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}";export{y as calcite_tooltip}