@esri/solutions-components 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  2. package/dist/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  3. package/dist/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  4. package/dist/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  5. package/dist/assets/arcgis-pdf-creator/grid.js +1 -1
  6. package/dist/assets/data/images/grid.png +0 -0
  7. package/dist/assets/data/images/horizontal.png +0 -0
  8. package/dist/assets/data/images/vertical.png +0 -0
  9. package/dist/assets/t9n/crowdsource-manager/resources.json +7 -1
  10. package/dist/assets/t9n/crowdsource-manager/resources_en.json +7 -1
  11. package/dist/cjs/buffer-tools_6.cjs.entry.js +88 -92
  12. package/dist/cjs/{calcite-block_2.cjs.entry.js → calcite-action-bar_4.cjs.entry.js} +307 -18
  13. package/dist/cjs/{calcite-action.cjs.entry.js → calcite-action_2.cjs.entry.js} +84 -1
  14. package/dist/cjs/{calcite-combobox_3.cjs.entry.js → calcite-chip_4.cjs.entry.js} +131 -5
  15. package/dist/cjs/{calcite-dropdown-group_4.cjs.entry.js → calcite-dropdown_5.cjs.entry.js} +467 -1
  16. package/dist/cjs/calcite-input-message_5.cjs.entry.js +19 -17
  17. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  18. package/dist/cjs/{calcite-action-bar_2.cjs.entry.js → calcite-tooltip.cjs.entry.js} +2 -208
  19. package/dist/cjs/crowdsource-manager.cjs.entry.js +88 -14
  20. package/dist/cjs/{downloadUtils-415ab342.js → downloadUtils-9359e9ff.js} +135 -44
  21. package/dist/cjs/{index.es-98008aa0.js → index.es-9c0d0ed6.js} +3 -3
  22. package/dist/cjs/{interfaces-17c631bf.js → interfaces-cac36920.js} +6 -0
  23. package/dist/cjs/layer-table_2.cjs.entry.js +512 -0
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{mapViewUtils-f617ae9a.js → mapViewUtils-090f4d4d.js} +3 -3
  26. package/dist/cjs/public-notification.cjs.entry.js +173 -48
  27. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  28. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  29. package/dist/cjs/{solution-store-b86759b2.js → solution-store-d28c332e.js} +1 -1
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  32. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  33. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  34. package/dist/collection/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  35. package/dist/collection/assets/arcgis-pdf-creator/grid.js +1 -1
  36. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +122 -0
  37. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +130 -14
  38. package/dist/collection/components/layer-table/layer-table.css +2 -70
  39. package/dist/collection/components/layer-table/layer-table.js +66 -106
  40. package/dist/collection/components/map-card/map-card.css +4 -7
  41. package/dist/collection/components/map-card/map-card.js +44 -10
  42. package/dist/collection/components/map-draw-tools/map-draw-tools.js +4 -8
  43. package/dist/collection/components/map-select-tools/map-select-tools.js +75 -15
  44. package/dist/collection/components/public-notification/public-notification.js +217 -25
  45. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +1 -1
  46. package/dist/collection/demos/crowdsource-manager.html +14 -41
  47. package/dist/collection/utils/csvDownload.js +41 -0
  48. package/dist/collection/utils/csvDownload.ts +42 -0
  49. package/dist/collection/utils/csvUtils.js +6 -23
  50. package/dist/collection/utils/csvUtils.ts +8 -27
  51. package/dist/collection/utils/downloadUtils.js +30 -14
  52. package/dist/collection/utils/downloadUtils.ts +36 -14
  53. package/dist/collection/utils/interfaces.js +6 -0
  54. package/dist/collection/utils/interfaces.ts +6 -0
  55. package/dist/collection/utils/pdfUtils.js +9 -6
  56. package/dist/collection/utils/pdfUtils.ts +13 -8
  57. package/dist/collection/utils/queryUtils.js +2 -2
  58. package/dist/collection/utils/queryUtils.ts +2 -2
  59. package/dist/collection/utils/test/csvUtils.spec.tsx +56 -0
  60. package/dist/collection/utils/test/downloadUtils.spec.tsx +133 -0
  61. package/dist/components/crowdsource-manager.js +293 -17
  62. package/dist/components/downloadUtils.js +133 -42
  63. package/dist/components/interfaces3.js +7 -1
  64. package/dist/components/layer-table.js +1 -443
  65. package/dist/components/layer-table2.js +429 -0
  66. package/dist/components/map-card.js +1 -339
  67. package/dist/{esm/map-card.entry.js → components/map-card2.js} +118 -22
  68. package/dist/components/map-draw-tools2.js +19 -23
  69. package/dist/components/map-layer-picker2.js +1 -1
  70. package/dist/components/map-select-tools2.js +21 -16
  71. package/dist/components/public-notification.js +209 -81
  72. package/dist/components/queryUtils.js +2 -2
  73. package/dist/components/refine-selection-tools2.js +3 -3
  74. package/dist/components/refine-selection2.js +1 -1
  75. package/dist/components/solution-resource-item2.js +1 -1
  76. package/dist/components/solution-store.js +1 -1
  77. package/dist/esm/buffer-tools_6.entry.js +79 -83
  78. package/dist/esm/{calcite-block_2.entry.js → calcite-action-bar_4.entry.js} +307 -20
  79. package/dist/esm/{calcite-action.entry.js → calcite-action_2.entry.js} +84 -2
  80. package/dist/esm/{calcite-combobox_3.entry.js → calcite-chip_4.entry.js} +134 -9
  81. package/dist/esm/{calcite-dropdown-group_4.entry.js → calcite-dropdown_5.entry.js} +468 -3
  82. package/dist/esm/calcite-input-message_5.entry.js +19 -17
  83. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  84. package/dist/esm/{calcite-action-bar_2.entry.js → calcite-tooltip.entry.js} +4 -209
  85. package/dist/esm/crowdsource-manager.entry.js +88 -14
  86. package/dist/esm/{downloadUtils-606b0f0e.js → downloadUtils-a8f139c5.js} +135 -44
  87. package/dist/esm/{index.es-c736c805.js → index.es-a75412ff.js} +3 -3
  88. package/dist/esm/{interfaces-d0d83efa.js → interfaces-cd4054e5.js} +7 -1
  89. package/dist/esm/layer-table_2.entry.js +507 -0
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{mapViewUtils-4e945e07.js → mapViewUtils-8ffcd36d.js} +4 -4
  92. package/dist/esm/public-notification.entry.js +169 -44
  93. package/dist/esm/solution-configuration.entry.js +2 -2
  94. package/dist/esm/solution-contents_3.entry.js +2 -2
  95. package/dist/esm/{solution-store-477288ac.js → solution-store-1b67f2c8.js} +1 -1
  96. package/dist/esm/solutions-components.js +1 -1
  97. package/dist/solutions-components/demos/crowdsource-manager.html +14 -41
  98. package/dist/solutions-components/{p-dd11eeb2.js → p-1395b0ef.js} +1 -1
  99. package/dist/solutions-components/{p-4f5641b4.entry.js → p-1affd711.entry.js} +18 -18
  100. package/dist/solutions-components/p-30de8da1.entry.js +17 -0
  101. package/dist/solutions-components/{p-91cad71e.entry.js → p-439c878d.entry.js} +3 -9
  102. package/dist/solutions-components/{p-72117a18.js → p-765a27f3.js} +1 -1
  103. package/dist/solutions-components/p-813a04c3.entry.js +6 -0
  104. package/dist/solutions-components/{p-9e8a371f.entry.js → p-874b39a7.entry.js} +3 -3
  105. package/dist/solutions-components/p-8cece97f.js +21 -0
  106. package/dist/solutions-components/{p-dd0241fb.entry.js → p-97aa7211.entry.js} +1 -1
  107. package/dist/solutions-components/{p-0e459cc7.entry.js → p-a955a3e6.entry.js} +10 -4
  108. package/dist/solutions-components/{p-6a657ff6.js → p-bb64bd47.js} +25 -9
  109. package/dist/solutions-components/p-c392dd95.entry.js +17 -0
  110. package/dist/solutions-components/p-ca386a72.entry.js +6 -0
  111. package/dist/solutions-components/p-d47d74a6.entry.js +23 -0
  112. package/dist/solutions-components/p-db846ee2.entry.js +11 -0
  113. package/dist/solutions-components/p-dc53c9c1.js +36 -0
  114. package/dist/solutions-components/p-e1c93241.entry.js +6 -0
  115. package/dist/solutions-components/{p-4cbaf0f1.entry.js → p-e6d235d6.entry.js} +1 -1
  116. package/dist/solutions-components/solutions-components.esm.js +6 -6
  117. package/dist/solutions-components/utils/csvDownload.ts +42 -0
  118. package/dist/solutions-components/utils/csvUtils.ts +8 -27
  119. package/dist/solutions-components/utils/downloadUtils.ts +36 -14
  120. package/dist/solutions-components/utils/interfaces.ts +6 -0
  121. package/dist/solutions-components/utils/pdfUtils.ts +13 -8
  122. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  123. package/dist/solutions-components/utils/test/csvUtils.spec.tsx +56 -0
  124. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +133 -0
  125. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +39 -0
  126. package/dist/types/components/layer-table/layer-table.d.ts +35 -48
  127. package/dist/types/components/map-card/map-card.d.ts +10 -6
  128. package/dist/types/components/map-select-tools/map-select-tools.d.ts +16 -1
  129. package/dist/types/components/public-notification/public-notification.d.ts +86 -4
  130. package/dist/types/components.d.ts +68 -0
  131. package/dist/types/preact.d.ts +2 -1
  132. package/dist/types/utils/csvDownload.d.ts +24 -0
  133. package/dist/types/utils/csvUtils.d.ts +2 -1
  134. package/dist/types/utils/downloadUtils.d.ts +25 -0
  135. package/dist/types/utils/interfaces.d.ts +5 -0
  136. package/dist/types/utils/pdfUtils.d.ts +2 -1
  137. package/package.json +4 -4
  138. package/dist/cjs/calcite-chip.cjs.entry.js +0 -142
  139. package/dist/cjs/calcite-dropdown.cjs.entry.js +0 -481
  140. package/dist/cjs/calcite-handle.cjs.entry.js +0 -99
  141. package/dist/cjs/calcite-loader.cjs.entry.js +0 -95
  142. package/dist/cjs/layer-table.cjs.entry.js +0 -317
  143. package/dist/cjs/map-card.cjs.entry.js +0 -252
  144. package/dist/esm/calcite-chip.entry.js +0 -138
  145. package/dist/esm/calcite-dropdown.entry.js +0 -477
  146. package/dist/esm/calcite-handle.entry.js +0 -95
  147. package/dist/esm/calcite-loader.entry.js +0 -91
  148. package/dist/esm/layer-table.entry.js +0 -313
  149. package/dist/solutions-components/p-11132485.entry.js +0 -11
  150. package/dist/solutions-components/p-15b43c29.entry.js +0 -11
  151. package/dist/solutions-components/p-5034aabc.entry.js +0 -11
  152. package/dist/solutions-components/p-5ee7b022.entry.js +0 -12
  153. package/dist/solutions-components/p-6f012424.entry.js +0 -6
  154. package/dist/solutions-components/p-7fd10eb3.entry.js +0 -11
  155. package/dist/solutions-components/p-84bbaebf.entry.js +0 -6
  156. package/dist/solutions-components/p-88e28de2.js +0 -36
  157. package/dist/solutions-components/p-a57ef371.entry.js +0 -6
  158. package/dist/solutions-components/p-ac76d270.entry.js +0 -17
  159. package/dist/solutions-components/p-dbc9a5a8.js +0 -21
  160. package/dist/solutions-components/p-e162304e.entry.js +0 -6
  161. package/dist/solutions-components/p-f5c70be2.entry.js +0 -6
  162. package/dist/solutions-components/p-f6b17cc6.entry.js +0 -11
@@ -3,25 +3,150 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c246d90e.js';
6
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-c246d90e.js';
7
+ import { a as getSlotted, i as isPrimaryPointerButton, t as toAriaBoolean, g as getElementProp } from './dom-3bdc69ee.js';
8
+ import { g as guid } from './guid-15fce7c0.js';
9
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-d09506c4.js';
7
10
  import { f as filter } from './filter-82935f2d.js';
8
11
  import { d as defaultMenuPlacement, f as filterComputedPlacements, c as connectFloatingUI, u as updateAfterClose, r as reposition, a as disconnectFloatingUI, F as FloatingCSS } from './floating-ui-63460291.js';
9
- import { g as guid } from './guid-15fce7c0.js';
10
- import { T as TEXT, C as ComboboxChildSelector, b as getItemAncestors, c as getItemChildren, h as hasActiveChildren, d as ComboboxItem$1, e as ComboboxItemGroup, g as getAncestors, a as getDepth } from './utils-bef8e381.js';
12
+ import { T as TEXT$1, C as ComboboxChildSelector, b as getItemAncestors, c as getItemChildren, h as hasActiveChildren, d as ComboboxItem$1, e as ComboboxItemGroup, g as getAncestors, a as getDepth } from './utils-bef8e381.js';
11
13
  import { c as connectLabel, d as disconnectLabel, g as getLabelText } from './label-aa562647.js';
12
14
  import { s as submitForm, c as connectForm, a as afterConnectDefaultValueSet, d as disconnectForm, H as HiddenFormInputSlot } from './form-62bc7b1f.js';
13
15
  import { c as createObserver } from './observers-31601001.js';
14
16
  import { u as updateHostInteraction } from './interactive-822ffed6.js';
15
- import { i as isPrimaryPointerButton, t as toAriaBoolean, g as getElementProp, a as getSlotted } from './dom-3bdc69ee.js';
16
17
  import { c as connectOpenCloseComponent, d as disconnectOpenCloseComponent } from './openCloseComponent-5caff873.js';
17
18
  import { d as debounce } from './debounce-4c884e5c.js';
18
- import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-d09506c4.js';
19
- import { i as getMapLayerIds, j as getMapLayerHash } from './mapViewUtils-4e945e07.js';
19
+ import { e as getMapLayerIds, j as getMapLayerHash } from './mapViewUtils-8ffcd36d.js';
20
20
  import { s as state } from './publicNotificationStore-b9daaee4.js';
21
21
  import './resources-436ae282.js';
22
- import './interfaces-d0d83efa.js';
22
+ import './interfaces-cd4054e5.js';
23
23
  import './index-ac7f66eb.js';
24
24
 
25
+ /*!
26
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
27
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
28
+ * v1.0.0-beta.97
29
+ */
30
+ const CSS$1 = {
31
+ title: "title",
32
+ close: "close",
33
+ imageContainer: "image-container",
34
+ chipIcon: "chip-icon",
35
+ closeIcon: "close-icon"
36
+ };
37
+ const TEXT = {
38
+ close: "Close"
39
+ };
40
+ const SLOTS = {
41
+ image: "image"
42
+ };
43
+ const ICONS = {
44
+ close: "x"
45
+ };
46
+
47
+ const chipCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){block-size:1.5rem;font-size:var(--calcite-font-size--2);--calcite-chip-spacing-unit-l:0.5rem;--calcite-chip-spacing-unit-s:0.25rem}:host([scale=s]) .image-container{block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:2rem;font-size:var(--calcite-font-size--1);--calcite-chip-spacing-unit-l:0.75rem;--calcite-chip-spacing-unit-s:6px}:host([scale=m]) .image-container{block-size:1.5rem;inline-size:1.5rem;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host([scale=l]){block-size:2.75rem;font-size:var(--calcite-font-size-0);--calcite-chip-spacing-unit-l:1rem;--calcite-chip-spacing-unit-s:0.5rem}:host([scale=l]) .image-container{block-size:2rem;inline-size:2rem;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host{box-sizing:border-box;display:inline-flex;cursor:default;align-items:center;border-radius:9999px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container{display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center}.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host span{padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-l)}:host([closable]) span{padding-inline:var(--calcite-chip-spacing-unit-l) var(--calcite-chip-spacing-unit-s)}:host([icon]:not([closable])) span{padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-l)}:host button{margin:0px;display:inline-flex;max-block-size:100%;min-block-size:100%;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-1);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-appearance:none;border-start-start-radius:0;border-start-end-radius:50px;border-end-end-radius:50px;border-end-start-radius:0;padding-block:0;padding-inline:var(--calcite-chip-spacing-unit-s);color:inherit;--calcite-chip-transparent-hover:var(--calcite-button-transparent-hover);--calcite-chip-transparent-press:var(--calcite-button-transparent-press)}:host button:hover{background-color:var(--calcite-chip-transparent-hover)}:host button:focus{background-color:var(--calcite-chip-transparent-hover);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host button:active{background-color:var(--calcite-chip-transparent-press)}.image-container{display:inline-flex;overflow:hidden;border-radius:50%}:host slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:var(--calcite-chip-spacing-unit-l);margin-inline-start:var(--calcite-chip-spacing-unit-l);border-start-start-radius:0;border-start-end-radius:50px;border-end-end-radius:50px;border-end-start-radius:0}:host([color=blue]){border-color:transparent;background-color:var(--calcite-ui-info);color:var(--calcite-ui-text-inverse)}:host([color=red]){border-color:transparent;background-color:var(--calcite-ui-danger);color:var(--calcite-ui-text-inverse)}:host([color=yellow]){border-color:transparent;background-color:var(--calcite-ui-warning);color:#151515}:host([color=green]){border-color:transparent;background-color:var(--calcite-ui-success);color:#151515}:host([color=grey]){border-color:transparent;background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host([color=grey]) button,:host([color=grey]) .close-icon{color:var(--calcite-ui-text-3)}:host([color=grey]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([appearance=clear]),:host([appearance=transparent]){background-color:transparent;color:var(--calcite-ui-text-1)}:host([color=blue][appearance=clear]),:host([color=blue][appearance=transparent]){border-color:var(--calcite-ui-info)}:host([color=blue][appearance=clear]) .chip-icon,:host([color=blue][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-info))}:host([color=red][appearance=clear]),:host([color=red][appearance=transparent]){border-color:var(--calcite-ui-danger)}:host([color=red][appearance=clear]) .chip-icon,:host([color=red][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-danger))}:host([color=yellow][appearance=clear]),:host([color=yellow][appearance=transparent]){border-color:var(--calcite-ui-warning)}:host([color=yellow][appearance=clear]) .chip-icon,:host([color=yellow][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-warning))}:host([color=green][appearance=clear]),:host([color=green][appearance=transparent]){border-color:var(--calcite-ui-success)}:host([color=green][appearance=clear]) .chip-icon,:host([color=green][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-success))}:host([color=grey][appearance=clear]),:host([color=grey][appearance=transparent]){border-color:var(--calcite-ui-border-1)}:host([color=grey][appearance=clear]) .chip-icon,:host([color=grey][appearance=transparent]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([closed]){display:none}";
48
+
49
+ const Chip = class {
50
+ constructor(hostRef) {
51
+ registerInstance(this, hostRef);
52
+ this.calciteChipDismiss = createEvent(this, "calciteChipDismiss", 6);
53
+ //--------------------------------------------------------------------------
54
+ //
55
+ // Public Properties
56
+ //
57
+ //--------------------------------------------------------------------------
58
+ /** Specifies the appearance style of the component. */
59
+ this.appearance = "solid";
60
+ /** Specifies the color for the component. */
61
+ this.color = "grey";
62
+ /**
63
+ * When `true`, a close button is added to the component.
64
+ *
65
+ * @deprecated use `closable` instead.
66
+ */
67
+ this.dismissible = false;
68
+ /** When `true`, a close button is added to the component. */
69
+ this.closable = false;
70
+ /**
71
+ * Accessible name for the component's close button.
72
+ *
73
+ * @default "Close"
74
+ */
75
+ this.dismissLabel = TEXT.close;
76
+ /** When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). */
77
+ this.iconFlipRtl = false;
78
+ /** Specifies the size of the component. */
79
+ this.scale = "m";
80
+ /** When `true`, hides the component. */
81
+ this.closed = false;
82
+ // --------------------------------------------------------------------------
83
+ //
84
+ // Private Methods
85
+ //
86
+ // --------------------------------------------------------------------------
87
+ this.closeClickHandler = (event) => {
88
+ event.preventDefault();
89
+ this.calciteChipDismiss.emit(this.el);
90
+ this.closed = true;
91
+ };
92
+ this.guid = guid();
93
+ }
94
+ handleDismissible(value) {
95
+ this.closable = value;
96
+ }
97
+ handleClosable(value) {
98
+ this.dismissible = value;
99
+ }
100
+ // --------------------------------------------------------------------------
101
+ //
102
+ // Lifecycle
103
+ //
104
+ // --------------------------------------------------------------------------
105
+ connectedCallback() {
106
+ connectConditionalSlotComponent(this);
107
+ if (this.dismissible) {
108
+ this.handleDismissible(this.dismissible);
109
+ }
110
+ if (this.closable) {
111
+ this.handleClosable(this.closable);
112
+ }
113
+ }
114
+ disconnectedCallback() {
115
+ disconnectConditionalSlotComponent(this);
116
+ }
117
+ //--------------------------------------------------------------------------
118
+ //
119
+ // Public Methods
120
+ //
121
+ //--------------------------------------------------------------------------
122
+ /** Sets focus on the component. */
123
+ async setFocus() {
124
+ var _a;
125
+ (_a = this.closeButton) === null || _a === void 0 ? void 0 : _a.focus();
126
+ }
127
+ //--------------------------------------------------------------------------
128
+ //
129
+ // Render Methods
130
+ //
131
+ //--------------------------------------------------------------------------
132
+ renderChipImage() {
133
+ const { el } = this;
134
+ const hasChipImage = getSlotted(el, SLOTS.image);
135
+ return hasChipImage ? (h("div", { class: CSS$1.imageContainer, key: "image" }, h("slot", { name: SLOTS.image }))) : null;
136
+ }
137
+ render() {
138
+ const iconEl = (h("calcite-icon", { class: CSS$1.chipIcon, flipRtl: this.iconFlipRtl, icon: this.icon, scale: "s" }));
139
+ const closeButton = (h("button", { "aria-describedby": this.guid, "aria-label": this.dismissLabel, class: CSS$1.close, onClick: this.closeClickHandler, ref: (el) => (this.closeButton = el) }, h("calcite-icon", { class: CSS$1.closeIcon, icon: ICONS.close, scale: "s" })));
140
+ return (h("div", { class: "container" }, this.renderChipImage(), this.icon ? iconEl : null, h("span", { class: CSS$1.title, id: this.guid }, h("slot", null)), this.closable ? closeButton : null));
141
+ }
142
+ get el() { return getElement(this); }
143
+ static get watchers() { return {
144
+ "dismissible": ["handleDismissible"],
145
+ "closable": ["handleClosable"]
146
+ }; }
147
+ };
148
+ Chip.style = chipCss;
149
+
25
150
  const comboboxCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){font-size:var(--calcite-font-size--2);--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-input-height:1.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-input-height:2rem}:host([scale=l]){font-size:var(--calcite-font-size-0);--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-input-height:2.75rem}.wrapper{display:flex;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);outline-color:transparent;padding-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.wrapper--single{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l);cursor:pointer;flex-wrap:nowrap}.grid-input{display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px}.input{flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-style:none;background-color:transparent;padding:0px;font-family:inherit;color:var(--calcite-ui-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);min-inline-size:120px;-webkit-margin-after:var(--calcite-combobox-item-spacing-unit-s);margin-block-end:var(--calcite-combobox-item-spacing-unit-s)}.input:focus{outline:2px solid transparent;outline-offset:2px}.input--transparent{opacity:0}.input--single{margin-block:0px;padding:0px}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;inline-size:0px;min-inline-size:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.input-wrap{display:flex;flex-grow:1}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;display:flex;max-inline-size:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon-end,.icon-start{display:flex;inline-size:1rem;cursor:pointer;align-items:center}.icon-end{flex:none}.floating-ui-container{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}.floating-ui-container--active{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}@media (forced-colors: active){.wrapper,.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.list-container{max-block-size:45vh;overflow-y:auto;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.list{margin:0px;display:block;padding:0px}.list--hide{block-size:0px;overflow:hidden}.chip{margin-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);margin-inline:0 var(--calcite-combobox-item-spacing-unit-s);max-inline-size:100%}.chip--active{background-color:var(--calcite-ui-foreground-3)}.item{display:block}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
26
151
 
27
152
  const isGroup = (el) => el.tagName === ComboboxItemGroup;
@@ -89,7 +214,7 @@ const Combobox = class {
89
214
  *
90
215
  * @default "Remove tag"
91
216
  */
92
- this.intlRemoveTag = TEXT.removeTag;
217
+ this.intlRemoveTag = TEXT$1.removeTag;
93
218
  //--------------------------------------------------------------------------
94
219
  //
95
220
  // Private State/Props
@@ -1129,4 +1254,4 @@ const MapLayerPicker = class {
1129
1254
  };
1130
1255
  MapLayerPicker.style = mapLayerPickerCss;
1131
1256
 
1132
- export { Combobox as calcite_combobox, ComboboxItem as calcite_combobox_item, MapLayerPicker as map_layer_picker };
1257
+ export { Chip as calcite_chip, Combobox as calcite_combobox, ComboboxItem as calcite_combobox_item, MapLayerPicker as map_layer_picker };
@@ -4,13 +4,478 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c246d90e.js';
7
- import { g as getElementProp, t as toAriaBoolean } from './dom-3bdc69ee.js';
7
+ import { t as toAriaBoolean, i as isPrimaryPointerButton, f as focusElement, g as getElementProp } from './dom-3bdc69ee.js';
8
+ import { d as defaultMenuPlacement, f as filterComputedPlacements, c as connectFloatingUI, u as updateAfterClose, a as disconnectFloatingUI, F as FloatingCSS, r as reposition } from './floating-ui-63460291.js';
9
+ import { c as createObserver } from './observers-31601001.js';
8
10
  import { u as updateHostInteraction } from './interactive-822ffed6.js';
11
+ import { c as connectOpenCloseComponent, d as disconnectOpenCloseComponent } from './openCloseComponent-5caff873.js';
12
+ import { g as guid } from './guid-15fce7c0.js';
13
+ import { i as isActivationKey } from './key-acb660e7.js';
9
14
  import { g as getLocaleComponentStrings } from './locale-7bf10e0a.js';
10
15
  import './resources-436ae282.js';
11
- import './guid-15fce7c0.js';
16
+ import './debounce-4c884e5c.js';
12
17
  import './_commonjsHelpers-d5f9d613.js';
13
18
 
19
+ /*!
20
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
21
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
22
+ * v1.0.0-beta.97
23
+ */
24
+ const SLOTS = {
25
+ dropdownTrigger: "dropdown-trigger"
26
+ };
27
+
28
+ const dropdownCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:inline-flex;flex:0 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host .calcite-dropdown-wrapper{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-dropdown-trigger-container{position:relative;display:flex;flex:1 1 auto}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width=s]){--calcite-dropdown-width:12rem}:host([width=m]){--calcite-dropdown-width:14rem}:host([width=l]){--calcite-dropdown-width:16rem}";
29
+
30
+ const Dropdown = class {
31
+ constructor(hostRef) {
32
+ registerInstance(this, hostRef);
33
+ this.calciteDropdownSelect = createEvent(this, "calciteDropdownSelect", 6);
34
+ this.calciteDropdownBeforeClose = createEvent(this, "calciteDropdownBeforeClose", 6);
35
+ this.calciteDropdownClose = createEvent(this, "calciteDropdownClose", 6);
36
+ this.calciteDropdownBeforeOpen = createEvent(this, "calciteDropdownBeforeOpen", 6);
37
+ this.calciteDropdownOpen = createEvent(this, "calciteDropdownOpen", 6);
38
+ //--------------------------------------------------------------------------
39
+ //
40
+ // Public Properties
41
+ //
42
+ //--------------------------------------------------------------------------
43
+ /**
44
+ * Opens or closes the dropdown
45
+ *
46
+ * @deprecated use open instead.
47
+ */
48
+ this.active = false;
49
+ /** When true, opens the dropdown */
50
+ this.open = false;
51
+ /**
52
+ allow the dropdown to remain open after a selection is made
53
+ if the selection-mode of the selected item's containing group is "none", the dropdown will always close
54
+ */
55
+ this.disableCloseOnSelect = false;
56
+ /** is the dropdown disabled */
57
+ this.disabled = false;
58
+ /**
59
+ specify the maximum number of calcite-dropdown-items to display before showing the scroller, must be greater than 0 -
60
+ this value does not include groupTitles passed to calcite-dropdown-group
61
+ */
62
+ this.maxItems = 0;
63
+ /**
64
+ * Determines the type of positioning to use for the overlaid content.
65
+ *
66
+ * Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
67
+ *
68
+ * `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
69
+ *
70
+ */
71
+ this.overlayPositioning = "absolute";
72
+ /**
73
+ * Determines where the dropdown will be positioned relative to the button.
74
+ *
75
+ * @default "bottom-start"
76
+ */
77
+ this.placement = defaultMenuPlacement;
78
+ /** specify the scale of dropdown, defaults to m */
79
+ this.scale = "m";
80
+ /**
81
+ * **read-only** The currently selected items
82
+ *
83
+ * @readonly
84
+ */
85
+ this.selectedItems = [];
86
+ /** specify whether the dropdown is opened by hover or click of a trigger element */
87
+ this.type = "click";
88
+ this.items = [];
89
+ this.groups = [];
90
+ this.mutationObserver = createObserver("mutation", () => this.updateItems());
91
+ this.resizeObserver = createObserver("resize", (entries) => this.resizeObserverCallback(entries));
92
+ this.openTransitionProp = "visibility";
93
+ this.guid = `calcite-dropdown-${guid()}`;
94
+ this.defaultAssignedElements = [];
95
+ //--------------------------------------------------------------------------
96
+ //
97
+ // Private Methods
98
+ //
99
+ //--------------------------------------------------------------------------
100
+ this.slotChangeHandler = (event) => {
101
+ this.defaultAssignedElements = event.target.assignedElements({
102
+ flatten: true
103
+ });
104
+ this.updateItems();
105
+ };
106
+ this.setFilteredPlacements = () => {
107
+ const { el, flipPlacements } = this;
108
+ this.filteredFlipPlacements = flipPlacements
109
+ ? filterComputedPlacements(flipPlacements, el)
110
+ : null;
111
+ };
112
+ this.updateTriggers = (event) => {
113
+ this.triggers = event.target.assignedElements({
114
+ flatten: true
115
+ });
116
+ this.reposition(true);
117
+ };
118
+ this.updateItems = () => {
119
+ this.items = this.groups
120
+ .map((group) => Array.from(group === null || group === void 0 ? void 0 : group.querySelectorAll("calcite-dropdown-item")))
121
+ .reduce((previousValue, currentValue) => [...previousValue, ...currentValue], []);
122
+ this.updateSelectedItems();
123
+ this.reposition(true);
124
+ };
125
+ this.updateGroups = (event) => {
126
+ const groups = event.target
127
+ .assignedElements({ flatten: true })
128
+ .filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-dropdown-group"));
129
+ this.groups = groups;
130
+ this.updateItems();
131
+ };
132
+ this.resizeObserverCallback = (entries) => {
133
+ entries.forEach((entry) => {
134
+ const { target } = entry;
135
+ if (target === this.referenceEl) {
136
+ this.setDropdownWidth();
137
+ }
138
+ else if (target === this.scrollerEl) {
139
+ this.setMaxScrollerHeight();
140
+ }
141
+ });
142
+ };
143
+ this.setDropdownWidth = () => {
144
+ const { referenceEl, scrollerEl } = this;
145
+ const referenceElWidth = referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.clientWidth;
146
+ if (!referenceElWidth || !scrollerEl) {
147
+ return;
148
+ }
149
+ scrollerEl.style.minWidth = `${referenceElWidth}px`;
150
+ };
151
+ this.setMaxScrollerHeight = () => {
152
+ const { scrollerEl } = this;
153
+ if (!scrollerEl) {
154
+ return;
155
+ }
156
+ this.reposition(true);
157
+ const maxScrollerHeight = this.getMaxScrollerHeight();
158
+ scrollerEl.style.maxHeight = maxScrollerHeight > 0 ? `${maxScrollerHeight}px` : "";
159
+ this.reposition(true);
160
+ };
161
+ this.setScrollerAndTransitionEl = (el) => {
162
+ this.resizeObserver.observe(el);
163
+ this.scrollerEl = el;
164
+ this.transitionEl = el;
165
+ connectOpenCloseComponent(this);
166
+ };
167
+ this.setReferenceEl = (el) => {
168
+ this.referenceEl = el;
169
+ connectFloatingUI(this, this.referenceEl, this.floatingEl);
170
+ this.resizeObserver.observe(el);
171
+ };
172
+ this.setFloatingEl = (el) => {
173
+ this.floatingEl = el;
174
+ connectFloatingUI(this, this.referenceEl, this.floatingEl);
175
+ };
176
+ this.keyDownHandler = (event) => {
177
+ const target = event.target;
178
+ if (target !== this.referenceEl) {
179
+ return;
180
+ }
181
+ const { defaultPrevented, key } = event;
182
+ if (defaultPrevented) {
183
+ return;
184
+ }
185
+ if (this.open) {
186
+ if (key === "Escape") {
187
+ this.closeCalciteDropdown();
188
+ event.preventDefault();
189
+ return;
190
+ }
191
+ else if (event.shiftKey && key === "Tab") {
192
+ this.closeCalciteDropdown();
193
+ event.preventDefault();
194
+ return;
195
+ }
196
+ }
197
+ if (isActivationKey(key)) {
198
+ this.openCalciteDropdown();
199
+ event.preventDefault();
200
+ }
201
+ else if (key === "Escape") {
202
+ this.closeCalciteDropdown();
203
+ event.preventDefault();
204
+ }
205
+ };
206
+ this.focusOnFirstActiveOrFirstItem = () => {
207
+ this.getFocusableElement(this.items.find((item) => item.selected) || this.items[0]);
208
+ };
209
+ this.toggleOpenEnd = () => {
210
+ this.focusOnFirstActiveOrFirstItem();
211
+ this.el.removeEventListener("calciteDropdownOpen", this.toggleOpenEnd);
212
+ };
213
+ this.openCalciteDropdown = () => {
214
+ this.open = !this.open;
215
+ if (this.open) {
216
+ this.el.addEventListener("calciteDropdownOpen", this.toggleOpenEnd);
217
+ }
218
+ };
219
+ }
220
+ activeHandler(value) {
221
+ this.open = value;
222
+ }
223
+ openHandler(value) {
224
+ if (!this.disabled) {
225
+ if (value) {
226
+ this.reposition(true);
227
+ }
228
+ else {
229
+ updateAfterClose(this.floatingEl);
230
+ }
231
+ this.active = value;
232
+ return;
233
+ }
234
+ if (!value) {
235
+ updateAfterClose(this.floatingEl);
236
+ }
237
+ this.open = false;
238
+ }
239
+ handleDisabledChange(value) {
240
+ if (!value) {
241
+ this.open = false;
242
+ }
243
+ }
244
+ flipPlacementsHandler() {
245
+ this.setFilteredPlacements();
246
+ this.reposition(true);
247
+ }
248
+ maxItemsHandler() {
249
+ this.setMaxScrollerHeight();
250
+ }
251
+ overlayPositioningHandler() {
252
+ this.reposition(true);
253
+ }
254
+ placementHandler() {
255
+ this.reposition(true);
256
+ }
257
+ //--------------------------------------------------------------------------
258
+ //
259
+ // Lifecycle
260
+ //
261
+ //--------------------------------------------------------------------------
262
+ connectedCallback() {
263
+ var _a;
264
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
265
+ this.setFilteredPlacements();
266
+ this.reposition(true);
267
+ if (this.open) {
268
+ this.openHandler(this.open);
269
+ }
270
+ if (this.active) {
271
+ this.activeHandler(this.active);
272
+ }
273
+ connectOpenCloseComponent(this);
274
+ }
275
+ componentDidLoad() {
276
+ this.reposition(true);
277
+ }
278
+ componentDidRender() {
279
+ updateHostInteraction(this);
280
+ }
281
+ disconnectedCallback() {
282
+ var _a, _b;
283
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
284
+ disconnectFloatingUI(this, this.referenceEl, this.floatingEl);
285
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
286
+ disconnectOpenCloseComponent(this);
287
+ }
288
+ render() {
289
+ const { open, guid } = this;
290
+ return (h(Host, null, h("div", { class: "calcite-dropdown-trigger-container", id: `${guid}-menubutton`, onClick: this.openCalciteDropdown, onKeyDown: this.keyDownHandler, ref: this.setReferenceEl }, h("slot", { "aria-controls": `${guid}-menu`, "aria-expanded": toAriaBoolean(open), "aria-haspopup": "menu", name: SLOTS.dropdownTrigger, onSlotchange: this.updateTriggers })), h("div", { "aria-hidden": toAriaBoolean(!open), class: "calcite-dropdown-wrapper", ref: this.setFloatingEl }, h("div", { "aria-labelledby": `${guid}-menubutton`, class: {
291
+ ["calcite-dropdown-content"]: true,
292
+ [FloatingCSS.animation]: true,
293
+ [FloatingCSS.animationActive]: open
294
+ }, id: `${guid}-menu`, ref: this.setScrollerAndTransitionEl, role: "menu" }, h("slot", { onSlotchange: this.updateGroups })))));
295
+ }
296
+ //--------------------------------------------------------------------------
297
+ //
298
+ // Public Methods
299
+ //
300
+ //--------------------------------------------------------------------------
301
+ /**
302
+ * Updates the position of the component.
303
+ *
304
+ * @param delayed
305
+ */
306
+ async reposition(delayed = false) {
307
+ const { floatingEl, referenceEl, placement, overlayPositioning, filteredFlipPlacements } = this;
308
+ return reposition(this, {
309
+ floatingEl,
310
+ referenceEl,
311
+ overlayPositioning,
312
+ placement,
313
+ flipPlacements: filteredFlipPlacements,
314
+ type: "menu"
315
+ }, delayed);
316
+ }
317
+ closeCalciteDropdownOnClick(event) {
318
+ if (!isPrimaryPointerButton(event) || !this.open || event.composedPath().includes(this.el)) {
319
+ return;
320
+ }
321
+ this.closeCalciteDropdown(false);
322
+ }
323
+ closeCalciteDropdownOnEvent(event) {
324
+ this.closeCalciteDropdown();
325
+ event.stopPropagation();
326
+ }
327
+ closeCalciteDropdownOnOpenEvent(event) {
328
+ if (event.composedPath().includes(this.el)) {
329
+ return;
330
+ }
331
+ this.open = false;
332
+ }
333
+ mouseEnterHandler() {
334
+ if (this.type === "hover") {
335
+ this.openCalciteDropdown();
336
+ }
337
+ }
338
+ mouseLeaveHandler() {
339
+ if (this.type === "hover") {
340
+ this.closeCalciteDropdown();
341
+ }
342
+ }
343
+ calciteInternalDropdownItemKeyEvent(event) {
344
+ const { keyboardEvent } = event.detail;
345
+ // handle edge
346
+ const target = keyboardEvent.target;
347
+ const itemToFocus = target.nodeName !== "A" ? target : target.parentNode;
348
+ const isFirstItem = this.itemIndex(itemToFocus) === 0;
349
+ const isLastItem = this.itemIndex(itemToFocus) === this.items.length - 1;
350
+ switch (keyboardEvent.key) {
351
+ case "Tab":
352
+ if (isLastItem && !keyboardEvent.shiftKey) {
353
+ this.closeCalciteDropdown();
354
+ }
355
+ else if (isFirstItem && keyboardEvent.shiftKey) {
356
+ this.closeCalciteDropdown();
357
+ }
358
+ else if (keyboardEvent.shiftKey) {
359
+ this.focusPrevItem(itemToFocus);
360
+ }
361
+ else {
362
+ this.focusNextItem(itemToFocus);
363
+ }
364
+ break;
365
+ case "ArrowDown":
366
+ this.focusNextItem(itemToFocus);
367
+ break;
368
+ case "ArrowUp":
369
+ this.focusPrevItem(itemToFocus);
370
+ break;
371
+ case "Home":
372
+ this.focusFirstItem();
373
+ break;
374
+ case "End":
375
+ this.focusLastItem();
376
+ break;
377
+ }
378
+ event.stopPropagation();
379
+ }
380
+ handleItemSelect(event) {
381
+ this.updateSelectedItems();
382
+ event.stopPropagation();
383
+ this.calciteDropdownSelect.emit({
384
+ item: event.detail.requestedDropdownItem
385
+ });
386
+ if (!this.disableCloseOnSelect ||
387
+ event.detail.requestedDropdownGroup.selectionMode === "none") {
388
+ this.closeCalciteDropdown();
389
+ }
390
+ event.stopPropagation();
391
+ }
392
+ onBeforeOpen() {
393
+ this.calciteDropdownBeforeOpen.emit();
394
+ }
395
+ onOpen() {
396
+ this.calciteDropdownOpen.emit();
397
+ }
398
+ onBeforeClose() {
399
+ this.calciteDropdownBeforeClose.emit();
400
+ }
401
+ onClose() {
402
+ this.calciteDropdownClose.emit();
403
+ }
404
+ updateSelectedItems() {
405
+ this.selectedItems = this.items.filter((item) => item.selected);
406
+ }
407
+ getMaxScrollerHeight() {
408
+ const { maxItems, items } = this;
409
+ let itemsToProcess = 0;
410
+ let maxScrollerHeight = 0;
411
+ let groupHeaderHeight;
412
+ this.groups.forEach((group) => {
413
+ if (maxItems > 0 && itemsToProcess < maxItems) {
414
+ Array.from(group.children).forEach((item, index) => {
415
+ if (index === 0) {
416
+ if (isNaN(groupHeaderHeight)) {
417
+ groupHeaderHeight = item.offsetTop;
418
+ }
419
+ maxScrollerHeight += groupHeaderHeight;
420
+ }
421
+ if (itemsToProcess < maxItems) {
422
+ maxScrollerHeight += item.offsetHeight;
423
+ itemsToProcess += 1;
424
+ }
425
+ });
426
+ }
427
+ });
428
+ return items.length > maxItems ? maxScrollerHeight : 0;
429
+ }
430
+ closeCalciteDropdown(focusTrigger = true) {
431
+ this.open = false;
432
+ if (focusTrigger) {
433
+ focusElement(this.triggers[0]);
434
+ }
435
+ }
436
+ focusFirstItem() {
437
+ const firstItem = this.items[0];
438
+ this.getFocusableElement(firstItem);
439
+ }
440
+ focusLastItem() {
441
+ const lastItem = this.items[this.items.length - 1];
442
+ this.getFocusableElement(lastItem);
443
+ }
444
+ focusNextItem(el) {
445
+ const index = this.itemIndex(el);
446
+ const nextItem = this.items[index + 1] || this.items[0];
447
+ this.getFocusableElement(nextItem);
448
+ }
449
+ focusPrevItem(el) {
450
+ const index = this.itemIndex(el);
451
+ const prevItem = this.items[index - 1] || this.items[this.items.length - 1];
452
+ this.getFocusableElement(prevItem);
453
+ }
454
+ itemIndex(el) {
455
+ return this.items.indexOf(el);
456
+ }
457
+ getFocusableElement(item) {
458
+ if (!item) {
459
+ return;
460
+ }
461
+ const target = item.attributes.isLink
462
+ ? item.shadowRoot.querySelector("a")
463
+ : item;
464
+ focusElement(target);
465
+ }
466
+ get el() { return getElement(this); }
467
+ static get watchers() { return {
468
+ "active": ["activeHandler"],
469
+ "open": ["openHandler"],
470
+ "disabled": ["handleDisabledChange"],
471
+ "flipPlacements": ["flipPlacementsHandler"],
472
+ "maxItems": ["maxItemsHandler"],
473
+ "overlayPositioning": ["overlayPositioningHandler"],
474
+ "placement": ["placementHandler"]
475
+ }; }
476
+ };
477
+ Dropdown.style = dropdownCss;
478
+
14
479
  /*!
15
480
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
16
481
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
@@ -453,4 +918,4 @@ const EditRecordModal = class {
453
918
  };
454
919
  EditRecordModal.style = editRecordModalCss;
455
920
 
456
- export { DropdownGroup as calcite_dropdown_group, DropdownItem as calcite_dropdown_item, SplitButton as calcite_split_button, EditRecordModal as edit_record_modal };
921
+ export { Dropdown as calcite_dropdown, DropdownGroup as calcite_dropdown_group, DropdownItem as calcite_dropdown_item, SplitButton as calcite_split_button, EditRecordModal as edit_record_modal };