@ember-eui/core 11.0.2 → 12.0.0

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 (544) hide show
  1. package/README.md +9 -7
  2. package/declarations/-private/random-id.d.ts +0 -1
  3. package/declarations/-private/random-id.d.ts.map +1 -1
  4. package/declarations/components/eui-accordion.d.ts +2 -1
  5. package/declarations/components/eui-accordion.d.ts.map +1 -1
  6. package/declarations/components/eui-breadcrumbs.d.ts +2 -1
  7. package/declarations/components/eui-breadcrumbs.d.ts.map +1 -1
  8. package/declarations/components/eui-code-block/virtualized.d.ts +1 -1
  9. package/declarations/components/eui-code-block.d.ts +2 -1
  10. package/declarations/components/eui-code-block.d.ts.map +1 -1
  11. package/declarations/components/eui-code.d.ts +2 -1
  12. package/declarations/components/eui-code.d.ts.map +1 -1
  13. package/declarations/components/eui-combo-box/options.d.ts +1 -1
  14. package/declarations/components/eui-combo-box/options.d.ts.map +1 -1
  15. package/declarations/components/eui-combo-box/trigger/input.d.ts +1 -1
  16. package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
  17. package/declarations/components/eui-form-control-layout-custom-icon.d.ts +1 -1
  18. package/declarations/components/eui-global-toast-list.d.ts +2 -1
  19. package/declarations/components/eui-global-toast-list.d.ts.map +1 -1
  20. package/declarations/components/eui-hide-for.d.ts.map +1 -1
  21. package/declarations/components/eui-i18n.d.ts +1 -1
  22. package/declarations/components/eui-icon.d.ts +1 -0
  23. package/declarations/components/eui-icon.d.ts.map +1 -1
  24. package/declarations/components/eui-markdown-editor-toolbar.d.ts +4 -3
  25. package/declarations/components/eui-markdown-editor-toolbar.d.ts.map +1 -1
  26. package/declarations/components/eui-markdown-editor.d.ts +8 -3
  27. package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
  28. package/declarations/components/eui-page-header-content.d.ts +1 -1
  29. package/declarations/components/eui-popover.d.ts +2 -1
  30. package/declarations/components/eui-popover.d.ts.map +1 -1
  31. package/declarations/components/eui-portal.d.ts +2 -1
  32. package/declarations/components/eui-portal.d.ts.map +1 -1
  33. package/declarations/components/eui-range-track.d.ts +1 -1
  34. package/declarations/components/eui-show-for.d.ts +1 -1
  35. package/declarations/components/eui-show-for.d.ts.map +1 -1
  36. package/declarations/components/eui-super-date-picker/date-popover/absolute-tab.d.ts +2 -1
  37. package/declarations/components/eui-super-date-picker/date-popover/absolute-tab.d.ts.map +1 -1
  38. package/declarations/components/eui-super-date-picker/date-popover/datetime-picker.d.ts +2 -1
  39. package/declarations/components/eui-super-date-picker/date-popover/datetime-picker.d.ts.map +1 -1
  40. package/declarations/components/eui-super-date-picker/date-popover/eui-date-popover-content.d.ts +1 -1
  41. package/declarations/components/eui-super-date-picker/date-popover/relative-tab.d.ts +2 -1
  42. package/declarations/components/eui-super-date-picker/date-popover/relative-tab.d.ts.map +1 -1
  43. package/declarations/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.d.ts +2 -1
  44. package/declarations/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.d.ts.map +1 -1
  45. package/declarations/components/eui-tabbed-content.d.ts +2 -1
  46. package/declarations/components/eui-tabbed-content.d.ts.map +1 -1
  47. package/declarations/components/eui-tool-tip-popover.d.ts +2 -1
  48. package/declarations/components/eui-tool-tip-popover.d.ts.map +1 -1
  49. package/declarations/components.d.ts +148 -148
  50. package/declarations/helpers/arg-or-default.d.ts +1 -1
  51. package/declarations/helpers/eui-page-restrict-width.d.ts +1 -1
  52. package/declarations/helpers/eui-palette.d.ts +1 -1
  53. package/declarations/helpers/get-range-tick.d.ts +2 -2
  54. package/declarations/helpers/hex-to-rgb.d.ts +1 -1
  55. package/declarations/helpers/is-color-dark.d.ts +1 -1
  56. package/declarations/helpers/is-item-open.d.ts +1 -1
  57. package/declarations/helpers/is-valid-hex.d.ts +1 -1
  58. package/declarations/helpers/nullish.d.ts +1 -1
  59. package/declarations/helpers/starts-with.d.ts +1 -1
  60. package/declarations/helpers/to-initials.d.ts +1 -1
  61. package/declarations/helpers/type-of.d.ts +3 -3
  62. package/declarations/helpers/type-of.d.ts.map +1 -1
  63. package/declarations/helpers/use-state.d.ts +1 -1
  64. package/declarations/modifiers/screen-reader-only.d.ts +1 -1
  65. package/declarations/modifiers/simple-style.d.ts +1 -1
  66. package/declarations/modifiers/validatable-control.d.ts +1 -1
  67. package/declarations/utils/markdown/markdown-actions.d.ts +1 -1
  68. package/declarations/utils/markdown/markdown-modes.d.ts.map +1 -1
  69. package/declarations/utils/markdown/markdown-types.d.ts +1 -1
  70. package/declarations/utils/markdown/markdown-types.d.ts.map +1 -1
  71. package/dist/-private/random-id.js.map +1 -1
  72. package/dist/components/common.js.map +1 -1
  73. package/dist/components/eui-accordion.js +14 -14
  74. package/dist/components/eui-accordion.js.map +1 -1
  75. package/dist/components/eui-auto-sizer.js +31 -31
  76. package/dist/components/eui-auto-sizer.js.map +1 -1
  77. package/dist/components/eui-avatar.js +2 -2
  78. package/dist/components/eui-avatar.js.map +1 -1
  79. package/dist/components/eui-badge-group.js.map +1 -1
  80. package/dist/components/eui-badge.js +1 -1
  81. package/dist/components/eui-badge.js.map +1 -1
  82. package/dist/components/eui-beta-badge.js +1 -1
  83. package/dist/components/eui-beta-badge.js.map +1 -1
  84. package/dist/components/eui-bottom-bar.js +13 -13
  85. package/dist/components/eui-bottom-bar.js.map +1 -1
  86. package/dist/components/eui-breadcrumbs.js +40 -42
  87. package/dist/components/eui-breadcrumbs.js.map +1 -1
  88. package/dist/components/eui-button-content.js.map +1 -1
  89. package/dist/components/eui-button-empty.js +1 -1
  90. package/dist/components/eui-button-empty.js.map +1 -1
  91. package/dist/components/eui-button-group-button.js +1 -1
  92. package/dist/components/eui-button-group-button.js.map +1 -1
  93. package/dist/components/eui-button-group.js +1 -1
  94. package/dist/components/eui-button-group.js.map +1 -1
  95. package/dist/components/eui-button-icon.js +1 -1
  96. package/dist/components/eui-button-icon.js.map +1 -1
  97. package/dist/components/eui-button.js +2 -2
  98. package/dist/components/eui-button.js.map +1 -1
  99. package/dist/components/eui-call-out.js +1 -1
  100. package/dist/components/eui-call-out.js.map +1 -1
  101. package/dist/components/eui-card-select.js +8 -8
  102. package/dist/components/eui-card-select.js.map +1 -1
  103. package/dist/components/eui-card.js +6 -6
  104. package/dist/components/eui-card.js.map +1 -1
  105. package/dist/components/eui-checkable-card.js.map +1 -1
  106. package/dist/components/eui-checkbox-group.js +1 -1
  107. package/dist/components/eui-checkbox-group.js.map +1 -1
  108. package/dist/components/eui-checkbox.js +4 -4
  109. package/dist/components/eui-checkbox.js.map +1 -1
  110. package/dist/components/eui-code-block/controls.js.map +1 -1
  111. package/dist/components/eui-code-block/full-screen-display.js.map +1 -1
  112. package/dist/components/eui-code-block/virtualized.js +9 -9
  113. package/dist/components/eui-code-block/virtualized.js.map +1 -1
  114. package/dist/components/eui-code-block.js +71 -71
  115. package/dist/components/eui-code-block.js.map +1 -1
  116. package/dist/components/eui-code.js +16 -16
  117. package/dist/components/eui-code.js.map +1 -1
  118. package/dist/components/eui-collapsible-nav-group.js +1 -1
  119. package/dist/components/eui-collapsible-nav-group.js.map +1 -1
  120. package/dist/components/eui-collapsible-nav.js +21 -22
  121. package/dist/components/eui-collapsible-nav.js.map +1 -1
  122. package/dist/components/eui-combo-box/create-option.js +9 -9
  123. package/dist/components/eui-combo-box/create-option.js.map +1 -1
  124. package/dist/components/eui-combo-box/group.js.map +1 -1
  125. package/dist/components/eui-combo-box/no-matches-message.js.map +1 -1
  126. package/dist/components/eui-combo-box/options.js +32 -16
  127. package/dist/components/eui-combo-box/options.js.map +1 -1
  128. package/dist/components/eui-combo-box/search-message.js.map +1 -1
  129. package/dist/components/eui-combo-box/trigger/input.js +20 -19
  130. package/dist/components/eui-combo-box/trigger/input.js.map +1 -1
  131. package/dist/components/eui-combo-box/trigger.js +2 -2
  132. package/dist/components/eui-combo-box/trigger.js.map +1 -1
  133. package/dist/components/eui-combo-box-pill.js +1 -1
  134. package/dist/components/eui-combo-box-pill.js.map +1 -1
  135. package/dist/components/eui-combo-box.js +58 -60
  136. package/dist/components/eui-combo-box.js.map +1 -1
  137. package/dist/components/eui-comment-list.js.map +1 -1
  138. package/dist/components/eui-comment-timeline.js +1 -1
  139. package/dist/components/eui-comment-timeline.js.map +1 -1
  140. package/dist/components/eui-comment.js +1 -1
  141. package/dist/components/eui-comment.js.map +1 -1
  142. package/dist/components/eui-confirm-modal.js.map +1 -1
  143. package/dist/components/eui-context-menu-item.js +4 -4
  144. package/dist/components/eui-context-menu-item.js.map +1 -1
  145. package/dist/components/eui-context-menu-panel.js.map +1 -1
  146. package/dist/components/eui-copy.js +3 -3
  147. package/dist/components/eui-copy.js.map +1 -1
  148. package/dist/components/eui-described-form-group.js.map +1 -1
  149. package/dist/components/eui-description-list-description.js.map +1 -1
  150. package/dist/components/eui-description-list-title.js.map +1 -1
  151. package/dist/components/eui-description-list.js.map +1 -1
  152. package/dist/components/eui-dual-range.js +110 -110
  153. package/dist/components/eui-dual-range.js.map +1 -1
  154. package/dist/components/eui-empty-prompt.js +1 -1
  155. package/dist/components/eui-empty-prompt.js.map +1 -1
  156. package/dist/components/eui-field-number.js +1 -1
  157. package/dist/components/eui-field-number.js.map +1 -1
  158. package/dist/components/eui-field-password.js +1 -1
  159. package/dist/components/eui-field-password.js.map +1 -1
  160. package/dist/components/eui-field-search.js +26 -26
  161. package/dist/components/eui-field-search.js.map +1 -1
  162. package/dist/components/eui-field-text.js +1 -1
  163. package/dist/components/eui-field-text.js.map +1 -1
  164. package/dist/components/eui-file-picker.js +16 -16
  165. package/dist/components/eui-file-picker.js.map +1 -1
  166. package/dist/components/eui-flex-grid.js.map +1 -1
  167. package/dist/components/eui-flex-group.js.map +1 -1
  168. package/dist/components/eui-flex-item.js.map +1 -1
  169. package/dist/components/eui-flyout-body.js.map +1 -1
  170. package/dist/components/eui-flyout-footer.js.map +1 -1
  171. package/dist/components/eui-flyout-header.js.map +1 -1
  172. package/dist/components/eui-flyout.js +35 -36
  173. package/dist/components/eui-flyout.js.map +1 -1
  174. package/dist/components/eui-form-control-layout-clear-button.js.map +1 -1
  175. package/dist/components/eui-form-control-layout-custom-icon.js.map +1 -1
  176. package/dist/components/eui-form-control-layout-delimited.js +1 -1
  177. package/dist/components/eui-form-control-layout-delimited.js.map +1 -1
  178. package/dist/components/eui-form-control-layout-icons.js +1 -1
  179. package/dist/components/eui-form-control-layout-icons.js.map +1 -1
  180. package/dist/components/eui-form-control-layout.js +1 -1
  181. package/dist/components/eui-form-control-layout.js.map +1 -1
  182. package/dist/components/eui-form-error-text.js.map +1 -1
  183. package/dist/components/eui-form-fieldset.js.map +1 -1
  184. package/dist/components/eui-form-help-text.js.map +1 -1
  185. package/dist/components/eui-form-label.js.map +1 -1
  186. package/dist/components/eui-form-legend.js.map +1 -1
  187. package/dist/components/eui-form-row.js +4 -4
  188. package/dist/components/eui-form-row.js.map +1 -1
  189. package/dist/components/eui-form.js +1 -1
  190. package/dist/components/eui-form.js.map +1 -1
  191. package/dist/components/eui-global-toast-list.js +43 -43
  192. package/dist/components/eui-global-toast-list.js.map +1 -1
  193. package/dist/components/eui-header-alert.js.map +1 -1
  194. package/dist/components/eui-header-breadcrumbs.js.map +1 -1
  195. package/dist/components/eui-header-link.js.map +1 -1
  196. package/dist/components/eui-header-links.js +1 -1
  197. package/dist/components/eui-header-links.js.map +1 -1
  198. package/dist/components/eui-header-logo.js.map +1 -1
  199. package/dist/components/eui-header-section-item-button.js +6 -6
  200. package/dist/components/eui-header-section-item-button.js.map +1 -1
  201. package/dist/components/eui-header-section-item.js.map +1 -1
  202. package/dist/components/eui-header-section.js.map +1 -1
  203. package/dist/components/eui-header.js +2 -2
  204. package/dist/components/eui-header.js.map +1 -1
  205. package/dist/components/eui-health.js.map +1 -1
  206. package/dist/components/eui-hide-for.js.map +1 -1
  207. package/dist/components/eui-horizontal-rule.js.map +1 -1
  208. package/dist/components/eui-i18n/render.js.map +1 -1
  209. package/dist/components/eui-i18n.js +3 -3
  210. package/dist/components/eui-i18n.js.map +1 -1
  211. package/dist/components/eui-icon-tip.js.map +1 -1
  212. package/dist/components/eui-icon.js +43 -37
  213. package/dist/components/eui-icon.js.map +1 -1
  214. package/dist/components/eui-image.js +8 -8
  215. package/dist/components/eui-image.js.map +1 -1
  216. package/dist/components/eui-inner-text.js +11 -11
  217. package/dist/components/eui-inner-text.js.map +1 -1
  218. package/dist/components/eui-input-popover.js +32 -32
  219. package/dist/components/eui-input-popover.js.map +1 -1
  220. package/dist/components/eui-key-pad-menu-item.js +3 -3
  221. package/dist/components/eui-key-pad-menu-item.js.map +1 -1
  222. package/dist/components/eui-key-pad-menu.js.map +1 -1
  223. package/dist/components/eui-link.js +1 -1
  224. package/dist/components/eui-link.js.map +1 -1
  225. package/dist/components/eui-list-group-item.js +4 -1
  226. package/dist/components/eui-list-group-item.js.map +1 -1
  227. package/dist/components/eui-list-group.js +1 -1
  228. package/dist/components/eui-list-group.js.map +1 -1
  229. package/dist/components/eui-loading-content.js +1 -1
  230. package/dist/components/eui-loading-content.js.map +1 -1
  231. package/dist/components/eui-loading-logo.js.map +1 -1
  232. package/dist/components/eui-loading-spinner.js.map +1 -1
  233. package/dist/components/eui-markdown-editor-drop-zone.js.map +1 -1
  234. package/dist/components/eui-markdown-editor-footer/icons/markdown-logo.js.map +1 -1
  235. package/dist/components/eui-markdown-editor-footer.js +3 -3
  236. package/dist/components/eui-markdown-editor-footer.js.map +1 -1
  237. package/dist/components/eui-markdown-editor-text-area.js.map +1 -1
  238. package/dist/components/eui-markdown-editor-toolbar/icons/markdown-checkmark.js.map +1 -1
  239. package/dist/components/eui-markdown-editor-toolbar.js +9 -11
  240. package/dist/components/eui-markdown-editor-toolbar.js.map +1 -1
  241. package/dist/components/eui-markdown-editor.js +147 -96
  242. package/dist/components/eui-markdown-editor.js.map +1 -1
  243. package/dist/components/eui-markdown-format/markdown-checkbox.js +7 -7
  244. package/dist/components/eui-markdown-format/markdown-checkbox.js.map +1 -1
  245. package/dist/components/eui-markdown-format/markdown-code-block.js.map +1 -1
  246. package/dist/components/eui-markdown-format/markdown-code.js.map +1 -1
  247. package/dist/components/eui-markdown-format/markdown-tooltip.js.map +1 -1
  248. package/dist/components/eui-markdown-format.js +14 -16
  249. package/dist/components/eui-markdown-format.js.map +1 -1
  250. package/dist/components/eui-modal-body.js.map +1 -1
  251. package/dist/components/eui-modal-footer.js.map +1 -1
  252. package/dist/components/eui-modal-header-title.js.map +1 -1
  253. package/dist/components/eui-modal-header.js.map +1 -1
  254. package/dist/components/eui-modal.js +1 -1
  255. package/dist/components/eui-modal.js.map +1 -1
  256. package/dist/components/eui-notification-badge.js.map +1 -1
  257. package/dist/components/eui-notification-event-messages.js.map +1 -1
  258. package/dist/components/eui-notification-event-meta.js +1 -1
  259. package/dist/components/eui-notification-event-meta.js.map +1 -1
  260. package/dist/components/eui-notification-event-read-button.js.map +1 -1
  261. package/dist/components/eui-notification-event-read-icon.js.map +1 -1
  262. package/dist/components/eui-notification-event.js +1 -1
  263. package/dist/components/eui-notification-event.js.map +1 -1
  264. package/dist/components/eui-overlay-mask.js +6 -6
  265. package/dist/components/eui-overlay-mask.js.map +1 -1
  266. package/dist/components/eui-page-body.js.map +1 -1
  267. package/dist/components/eui-page-content-body.js.map +1 -1
  268. package/dist/components/eui-page-content-header-section.js.map +1 -1
  269. package/dist/components/eui-page-content-header.js.map +1 -1
  270. package/dist/components/eui-page-content.js.map +1 -1
  271. package/dist/components/eui-page-header-content.js +4 -4
  272. package/dist/components/eui-page-header-content.js.map +1 -1
  273. package/dist/components/eui-page-header-section.js.map +1 -1
  274. package/dist/components/eui-page-header.js +1 -1
  275. package/dist/components/eui-page-header.js.map +1 -1
  276. package/dist/components/eui-page-side-bar.js.map +1 -1
  277. package/dist/components/eui-page-template.js +12 -12
  278. package/dist/components/eui-page-template.js.map +1 -1
  279. package/dist/components/eui-page.js.map +1 -1
  280. package/dist/components/eui-pagination/button-wrapper.js.map +1 -1
  281. package/dist/components/eui-pagination/next-button.js +1 -1
  282. package/dist/components/eui-pagination/next-button.js.map +1 -1
  283. package/dist/components/eui-pagination/previous-button.js +1 -1
  284. package/dist/components/eui-pagination/previous-button.js.map +1 -1
  285. package/dist/components/eui-pagination-button.js.map +1 -1
  286. package/dist/components/eui-pagination.js +39 -39
  287. package/dist/components/eui-pagination.js.map +1 -1
  288. package/dist/components/eui-panel.js +1 -1
  289. package/dist/components/eui-panel.js.map +1 -1
  290. package/dist/components/eui-popover-footer.js.map +1 -1
  291. package/dist/components/eui-popover-title.js.map +1 -1
  292. package/dist/components/eui-popover.js +126 -126
  293. package/dist/components/eui-popover.js.map +1 -1
  294. package/dist/components/eui-portal.js +8 -8
  295. package/dist/components/eui-portal.js.map +1 -1
  296. package/dist/components/eui-progress.js +1 -1
  297. package/dist/components/eui-progress.js.map +1 -1
  298. package/dist/components/eui-radio-group.js +2 -2
  299. package/dist/components/eui-radio-group.js.map +1 -1
  300. package/dist/components/eui-radio.js +1 -1
  301. package/dist/components/eui-radio.js.map +1 -1
  302. package/dist/components/eui-range-highlight.js.map +1 -1
  303. package/dist/components/eui-range-input.js +1 -1
  304. package/dist/components/eui-range-input.js.map +1 -1
  305. package/dist/components/eui-range-label.js.map +1 -1
  306. package/dist/components/eui-range-levels.js +7 -7
  307. package/dist/components/eui-range-levels.js.map +1 -1
  308. package/dist/components/eui-range-slider.js.map +1 -1
  309. package/dist/components/eui-range-thumb.js.map +1 -1
  310. package/dist/components/eui-range-ticks.js +6 -6
  311. package/dist/components/eui-range-ticks.js.map +1 -1
  312. package/dist/components/eui-range-tooltip.js +20 -20
  313. package/dist/components/eui-range-tooltip.js.map +1 -1
  314. package/dist/components/eui-range-track.js +49 -49
  315. package/dist/components/eui-range-track.js.map +1 -1
  316. package/dist/components/eui-range-wrapper.js.map +1 -1
  317. package/dist/components/eui-range.js +26 -26
  318. package/dist/components/eui-range.js.map +1 -1
  319. package/dist/components/eui-select.js +1 -1
  320. package/dist/components/eui-select.js.map +1 -1
  321. package/dist/components/eui-selectable-list-item.js +1 -1
  322. package/dist/components/eui-selectable-list-item.js.map +1 -1
  323. package/dist/components/eui-show-for.js +8 -8
  324. package/dist/components/eui-show-for.js.map +1 -1
  325. package/dist/components/eui-side-nav-item/button.js.map +1 -1
  326. package/dist/components/eui-side-nav-item.js +1 -1
  327. package/dist/components/eui-side-nav-item.js.map +1 -1
  328. package/dist/components/eui-side-nav.js +4 -4
  329. package/dist/components/eui-side-nav.js.map +1 -1
  330. package/dist/components/eui-spacer.js.map +1 -1
  331. package/dist/components/eui-split-panel/inner.js.map +1 -1
  332. package/dist/components/eui-split-panel/outer.js +1 -1
  333. package/dist/components/eui-split-panel/outer.js.map +1 -1
  334. package/dist/components/eui-stat/description.js +1 -0
  335. package/dist/components/eui-stat/description.js.map +1 -1
  336. package/dist/components/eui-stat/title.js.map +1 -1
  337. package/dist/components/eui-stat.js +5 -5
  338. package/dist/components/eui-stat.js.map +1 -1
  339. package/dist/components/eui-step-horizontal.js.map +1 -1
  340. package/dist/components/eui-step-number.js +1 -1
  341. package/dist/components/eui-step-number.js.map +1 -1
  342. package/dist/components/eui-step.js.map +1 -1
  343. package/dist/components/eui-steps-horizontal.js.map +1 -1
  344. package/dist/components/eui-steps.js.map +1 -1
  345. package/dist/components/eui-sub-steps.js.map +1 -1
  346. package/dist/components/eui-super-date-picker/date-popover/absolute-tab.js +27 -27
  347. package/dist/components/eui-super-date-picker/date-popover/absolute-tab.js.map +1 -1
  348. package/dist/components/eui-super-date-picker/date-popover/datetime-picker.js +73 -73
  349. package/dist/components/eui-super-date-picker/date-popover/datetime-picker.js.map +1 -1
  350. package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-button.js +6 -6
  351. package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-button.js.map +1 -1
  352. package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-content.js +5 -5
  353. package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-content.js.map +1 -1
  354. package/dist/components/eui-super-date-picker/date-popover/now-tab.js.map +1 -1
  355. package/dist/components/eui-super-date-picker/date-popover/relative-tab.js +27 -27
  356. package/dist/components/eui-super-date-picker/date-popover/relative-tab.js.map +1 -1
  357. package/dist/components/eui-super-date-picker/eui-date-picker-range.js.map +1 -1
  358. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-commonly-used-time-ranges.js +1 -1
  359. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-commonly-used-time-ranges.js.map +1 -1
  360. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.js +25 -25
  361. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.js.map +1 -1
  362. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-recently-used.js +1 -1
  363. package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-recently-used.js.map +1 -1
  364. package/dist/components/eui-super-date-picker/eui-quick-select-popover.js +9 -9
  365. package/dist/components/eui-super-date-picker/eui-quick-select-popover.js.map +1 -1
  366. package/dist/components/eui-super-date-picker/eui-super-update-button.js.map +1 -1
  367. package/dist/components/eui-super-date-picker/utils/date-utils.js.map +1 -1
  368. package/dist/components/eui-super-date-picker/utils/index.js.map +1 -1
  369. package/dist/components/eui-super-date-picker/utils/pretty-duration.js.map +1 -1
  370. package/dist/components/eui-super-date-picker/utils/quick-select.js +1 -1
  371. package/dist/components/eui-super-date-picker/utils/quick-select.js.map +1 -1
  372. package/dist/components/eui-super-date-picker/utils/time-options.js.map +1 -1
  373. package/dist/components/eui-super-date-picker.js +34 -34
  374. package/dist/components/eui-super-date-picker.js.map +1 -1
  375. package/dist/components/eui-switch.js +4 -4
  376. package/dist/components/eui-switch.js.map +1 -1
  377. package/dist/components/eui-tab.js +1 -1
  378. package/dist/components/eui-tab.js.map +1 -1
  379. package/dist/components/eui-tabbed-content.js +31 -31
  380. package/dist/components/eui-tabbed-content.js.map +1 -1
  381. package/dist/components/eui-tabs.js.map +1 -1
  382. package/dist/components/eui-text-align.js.map +1 -1
  383. package/dist/components/eui-text-area.js.map +1 -1
  384. package/dist/components/eui-text-color.js.map +1 -1
  385. package/dist/components/eui-text.js +1 -1
  386. package/dist/components/eui-text.js.map +1 -1
  387. package/dist/components/eui-title.js.map +1 -1
  388. package/dist/components/eui-toast.js.map +1 -1
  389. package/dist/components/eui-tool-tip-popover.js +5 -5
  390. package/dist/components/eui-tool-tip-popover.js.map +1 -1
  391. package/dist/components/eui-tool-tip.js +44 -46
  392. package/dist/components/eui-tool-tip.js.map +1 -1
  393. package/dist/components/text-block.js.map +1 -1
  394. package/dist/helpers/arg-or-default.js.map +1 -1
  395. package/dist/helpers/cast-to.js.map +1 -1
  396. package/dist/helpers/class-names.js.map +1 -1
  397. package/dist/helpers/eui-page-restrict-width.js.map +1 -1
  398. package/dist/helpers/eui-palette.js +1 -1
  399. package/dist/helpers/eui-palette.js.map +1 -1
  400. package/dist/helpers/get-eui-config.js +1 -1
  401. package/dist/helpers/get-eui-config.js.map +1 -1
  402. package/dist/helpers/get-range-tick.js.map +1 -1
  403. package/dist/helpers/hex-to-rgb.js.map +1 -1
  404. package/dist/helpers/inline-styles.js.map +1 -1
  405. package/dist/helpers/is-color-dark.js.map +1 -1
  406. package/dist/helpers/is-item-open.js.map +1 -1
  407. package/dist/helpers/is-valid-hex.js.map +1 -1
  408. package/dist/helpers/is-within-number.js.map +1 -1
  409. package/dist/helpers/merge.js.map +1 -1
  410. package/dist/helpers/nullish.js.map +1 -1
  411. package/dist/helpers/starts-with.js.map +1 -1
  412. package/dist/helpers/to-initials.js.map +1 -1
  413. package/dist/helpers/type-of.js.map +1 -1
  414. package/dist/helpers/use-state.js +1 -1
  415. package/dist/helpers/use-state.js.map +1 -1
  416. package/dist/i18n/util.js.map +1 -1
  417. package/dist/modifiers/mutation-observer.js.map +1 -1
  418. package/dist/modifiers/outside-click-detector.js +4 -0
  419. package/dist/modifiers/outside-click-detector.js.map +1 -1
  420. package/dist/modifiers/resize-observer.js +3 -0
  421. package/dist/modifiers/resize-observer.js.map +1 -1
  422. package/dist/modifiers/screen-reader-only.js.map +1 -1
  423. package/dist/modifiers/simple-style.js.map +1 -1
  424. package/dist/modifiers/use-is-within-breakpoints.js.map +1 -1
  425. package/dist/modifiers/validatable-control.js.map +1 -1
  426. package/dist/services/eui-config.js +1 -1
  427. package/dist/services/eui-config.js.map +1 -1
  428. package/dist/services/eui-i18n.js.map +1 -1
  429. package/dist/services/eui-toaster.js +1 -1
  430. package/dist/services/eui-toaster.js.map +1 -1
  431. package/dist/utils/accesibility/accessible-click-keys.js +1 -1
  432. package/dist/utils/accesibility/accessible-click-keys.js.map +1 -1
  433. package/dist/utils/accesibility/cascading-menu-keys.js +1 -1
  434. package/dist/utils/accesibility/cascading-menu-keys.js.map +1 -1
  435. package/dist/utils/accesibility/combo-box-keys.js +1 -1
  436. package/dist/utils/accesibility/combo-box-keys.js.map +1 -1
  437. package/dist/utils/breakpoint.js.map +1 -1
  438. package/dist/utils/browser/browser.js.map +1 -1
  439. package/dist/utils/code/utils.js.map +1 -1
  440. package/dist/utils/color/color_palette.js.map +1 -1
  441. package/dist/utils/color/eui_palettes.js.map +1 -1
  442. package/dist/utils/copy-to-clipboard.js.map +1 -1
  443. package/dist/utils/css-mappings/eui-accordion.js.map +1 -1
  444. package/dist/utils/css-mappings/eui-avatar.js +1 -1
  445. package/dist/utils/css-mappings/eui-avatar.js.map +1 -1
  446. package/dist/utils/css-mappings/eui-badge-group.js.map +1 -1
  447. package/dist/utils/css-mappings/eui-badge.js.map +1 -1
  448. package/dist/utils/css-mappings/eui-beta-badge.js.map +1 -1
  449. package/dist/utils/css-mappings/eui-bottom-bar.js.map +1 -1
  450. package/dist/utils/css-mappings/eui-button-empty.js.map +1 -1
  451. package/dist/utils/css-mappings/eui-button-group-button.js.map +1 -1
  452. package/dist/utils/css-mappings/eui-button-group.js.map +1 -1
  453. package/dist/utils/css-mappings/eui-button-icon.js.map +1 -1
  454. package/dist/utils/css-mappings/eui-button.js.map +1 -1
  455. package/dist/utils/css-mappings/eui-call-out.js.map +1 -1
  456. package/dist/utils/css-mappings/eui-card-select.js.map +1 -1
  457. package/dist/utils/css-mappings/eui-card.js.map +1 -1
  458. package/dist/utils/css-mappings/eui-code-block.js.map +1 -1
  459. package/dist/utils/css-mappings/eui-collapsible-nav-group.js.map +1 -1
  460. package/dist/utils/css-mappings/eui-comment-event.js.map +1 -1
  461. package/dist/utils/css-mappings/eui-comment-timeline-icon.js.map +1 -1
  462. package/dist/utils/css-mappings/eui-context-menu-item.js.map +1 -1
  463. package/dist/utils/css-mappings/eui-described-form-group.js.map +1 -1
  464. package/dist/utils/css-mappings/eui-description-list.js.map +1 -1
  465. package/dist/utils/css-mappings/eui-empty-prompt.js.map +1 -1
  466. package/dist/utils/css-mappings/eui-file-picker.js.map +1 -1
  467. package/dist/utils/css-mappings/eui-flex-grid.js.map +1 -1
  468. package/dist/utils/css-mappings/eui-flex-group.js.map +1 -1
  469. package/dist/utils/css-mappings/eui-flex-item.js.map +1 -1
  470. package/dist/utils/css-mappings/eui-flyout.js.map +1 -1
  471. package/dist/utils/css-mappings/eui-form-control-layout-clear-button.js.map +1 -1
  472. package/dist/utils/css-mappings/eui-form-row.js.map +1 -1
  473. package/dist/utils/css-mappings/eui-global-toast-list.js.map +1 -1
  474. package/dist/utils/css-mappings/eui-header-links.js.map +1 -1
  475. package/dist/utils/css-mappings/eui-header-section-item.js.map +1 -1
  476. package/dist/utils/css-mappings/eui-header-section.js.map +1 -1
  477. package/dist/utils/css-mappings/eui-header.js.map +1 -1
  478. package/dist/utils/css-mappings/eui-health.js.map +1 -1
  479. package/dist/utils/css-mappings/eui-horizontal-rule.js.map +1 -1
  480. package/dist/utils/css-mappings/eui-icon.js.map +1 -1
  481. package/dist/utils/css-mappings/eui-image.js.map +1 -1
  482. package/dist/utils/css-mappings/eui-link.js.map +1 -1
  483. package/dist/utils/css-mappings/eui-list-group-item.js.map +1 -1
  484. package/dist/utils/css-mappings/eui-list-group.js.map +1 -1
  485. package/dist/utils/css-mappings/eui-loading-spinner.js.map +1 -1
  486. package/dist/utils/css-mappings/eui-modal.js.map +1 -1
  487. package/dist/utils/css-mappings/eui-notification-badge.js.map +1 -1
  488. package/dist/utils/css-mappings/eui-page-body.js.map +1 -1
  489. package/dist/utils/css-mappings/eui-page-content-body.js.map +1 -1
  490. package/dist/utils/css-mappings/eui-page-content.js.map +1 -1
  491. package/dist/utils/css-mappings/eui-page-header.js.map +1 -1
  492. package/dist/utils/css-mappings/eui-page-side-bar.js.map +1 -1
  493. package/dist/utils/css-mappings/eui-page.js.map +1 -1
  494. package/dist/utils/css-mappings/eui-panel.js.map +1 -1
  495. package/dist/utils/css-mappings/eui-popover-footer.js.map +1 -1
  496. package/dist/utils/css-mappings/eui-popover-title.js.map +1 -1
  497. package/dist/utils/css-mappings/eui-popover.js.map +1 -1
  498. package/dist/utils/css-mappings/eui-progress-data.js.map +1 -1
  499. package/dist/utils/css-mappings/eui-progress.js.map +1 -1
  500. package/dist/utils/css-mappings/eui-range-highlight.js.map +1 -1
  501. package/dist/utils/css-mappings/eui-range-input.js.map +1 -1
  502. package/dist/utils/css-mappings/eui-range-levels.js.map +1 -1
  503. package/dist/utils/css-mappings/eui-selectable-list-item.js.map +1 -1
  504. package/dist/utils/css-mappings/eui-spacer.js.map +1 -1
  505. package/dist/utils/css-mappings/eui-stat.js.map +1 -1
  506. package/dist/utils/css-mappings/eui-step-number.js.map +1 -1
  507. package/dist/utils/css-mappings/eui-tabs.js.map +1 -1
  508. package/dist/utils/css-mappings/eui-text-align.js.map +1 -1
  509. package/dist/utils/css-mappings/eui-text-area.js.map +1 -1
  510. package/dist/utils/css-mappings/eui-text-color.js.map +1 -1
  511. package/dist/utils/css-mappings/eui-text.js.map +1 -1
  512. package/dist/utils/css-mappings/eui-title.js.map +1 -1
  513. package/dist/utils/css-mappings/eui-toast.js.map +1 -1
  514. package/dist/utils/css-mappings/eui-tool-tip.js.map +1 -1
  515. package/dist/utils/css-mappings/index.js +140 -140
  516. package/dist/utils/css-mappings/index.js.map +1 -1
  517. package/dist/utils/detect-element-resize.js.map +1 -1
  518. package/dist/utils/keys.js.map +1 -1
  519. package/dist/utils/markdown/markdown-actions.js +1 -0
  520. package/dist/utils/markdown/markdown-actions.js.map +1 -1
  521. package/dist/utils/markdown/markdown-modes.js.map +1 -1
  522. package/dist/utils/markdown/markdown-types.js.map +1 -1
  523. package/dist/utils/markdown/plugins/markdown-add-components/processor.js.map +1 -1
  524. package/dist/utils/markdown/plugins/markdown-checkbox/parser.js.map +1 -1
  525. package/dist/utils/markdown/plugins/markdown-default-plugins/parsing-plugins.js.map +1 -1
  526. package/dist/utils/markdown/plugins/markdown-default-plugins/plugins.js.map +1 -1
  527. package/dist/utils/markdown/plugins/markdown-default-plugins/processing-plugins.js.map +1 -1
  528. package/dist/utils/markdown/plugins/markdown-default-plugins/ui-plugins.js.map +1 -1
  529. package/dist/utils/markdown/plugins/markdown-tooltip/parser.js.map +1 -1
  530. package/dist/utils/markdown/plugins/markdown-tooltip/plugin.js.map +1 -1
  531. package/dist/utils/markdown/plugins/to-dom.js.map +1 -1
  532. package/dist/utils/markdown/remark/remark-prismjs.js.map +1 -1
  533. package/dist/utils/maybe-unwrap-proxy.js.map +1 -1
  534. package/dist/utils/number/number.js.map +1 -1
  535. package/dist/utils/popover/index.js +1 -4
  536. package/dist/utils/popover/index.js.map +1 -1
  537. package/dist/utils/predicate/common_predicates.js.map +1 -1
  538. package/dist/utils/predicate/lodash_predicates.js.map +1 -1
  539. package/dist/utils/timer.js +4 -1
  540. package/dist/utils/timer.js.map +1 -1
  541. package/dist/utils/transition.js.map +1 -1
  542. package/package.json +63 -46
  543. package/declarations/modifiers/open-collapsible-nav.d.ts +0 -9
  544. package/declarations/modifiers/open-collapsible-nav.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-unwrap-proxy.js","sources":["../../src/utils/maybe-unwrap-proxy.js"],"sourcesContent":["import ArrayProxy from '@ember/array/proxy';\nimport { get } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nexport function isProxy(o) {\n return !!(o && (o instanceof ObjectProxy || o instanceof ArrayProxy));\n}\n\nexport function maybeUnwrapProxy(o) {\n const key = 'content';\n\n return isProxy(o) ? maybeUnwrapProxy(get(o, key)) : o;\n}\n"],"names":["isProxy","o","ObjectProxy","ArrayProxy","maybeUnwrapProxy","key","get"],"mappings":";;;;AAIO,SAASA,OAAOA,CAACC,CAAC,EAAE;AACzB,EAAA,OAAO,CAAC,EAAEA,CAAC,KAAKA,CAAC,YAAYC,WAAW,IAAID,CAAC,YAAYE,UAAU,CAAC,CAAC,CAAA;AACvE,CAAA;AAEO,SAASC,gBAAgBA,CAACH,CAAC,EAAE;EAClC,MAAMI,GAAG,GAAG,SAAS,CAAA;AAErB,EAAA,OAAOL,OAAO,CAACC,CAAC,CAAC,GAAGG,gBAAgB,CAACE,GAAG,CAACL,CAAC,EAAEI,GAAG,CAAC,CAAC,GAAGJ,CAAC,CAAA;AACvD;;;;"}
1
+ {"version":3,"file":"maybe-unwrap-proxy.js","sources":["../../src/utils/maybe-unwrap-proxy.js"],"sourcesContent":["import ArrayProxy from '@ember/array/proxy';\nimport { get } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nexport function isProxy(o) {\n return !!(o && (o instanceof ObjectProxy || o instanceof ArrayProxy));\n}\n\nexport function maybeUnwrapProxy(o) {\n const key = 'content';\n\n return isProxy(o) ? maybeUnwrapProxy(get(o, key)) : o;\n}\n"],"names":["isProxy","o","ObjectProxy","ArrayProxy","maybeUnwrapProxy","key","get"],"mappings":";;;;AAIO,SAASA,OAAOA,CAACC,CAAC,EAAE;AACzB,EAAA,OAAO,CAAC,EAAEA,CAAC,KAAKA,CAAC,YAAYC,WAAW,IAAID,CAAC,YAAYE,UAAU,CAAC,CAAC;AACvE;AAEO,SAASC,gBAAgBA,CAACH,CAAC,EAAE;EAClC,MAAMI,GAAG,GAAG,SAAS;AAErB,EAAA,OAAOL,OAAO,CAACC,CAAC,CAAC,GAAGG,gBAAgB,CAACE,GAAG,CAACL,CAAC,EAAEI,GAAG,CAAC,CAAC,GAAGJ,CAAC;AACvD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"number.js","sources":["../../../src/utils/number/number.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport const isWithinRange = (\n min: number | string,\n max: number | string,\n value: number | string\n): boolean => {\n if (min === '' || max === '' || value === '') {\n return false;\n }\n\n const val = Number(value);\n\n return Number(min) <= val && val <= Number(max);\n};\n\n// 1e-6 covers up to 10,000,000,000 factored by a decimal\nconst EPSILON = 1e-6;\n\nexport function isEvenlyDivisibleBy(num: number, factor: number): boolean {\n const remainder = num % factor;\n\n // due to floating point issues the remainder needs to be within a margin instead of exactly 0\n // 1 % 0.1 === 0.09999999999999995\n // 1000000000 % 0.1 === 0.09999994448884877\n // 1 % 0.05 === 0.04999999999999995\n\n // Compare the smaller of (remainder, factor - remainder) to EPSILON\n return (\n Math.min(\n remainder, // remainder may be smallest, it is 0 in the well-formed case\n Math.abs(factor - remainder) // otherwise the positive difference between factor and remainder\n ) < EPSILON\n );\n}\n"],"names":["isWithinRange","min","max","value","val","Number","EPSILON","isEvenlyDivisibleBy","num","factor","remainder","Math","abs"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,GAAoB,EACpBC,GAAoB,EACpBC,KAAsB,KACV;EACZ,IAAIF,GAAG,KAAK,EAAE,IAAIC,GAAG,KAAK,EAAE,IAAIC,KAAK,KAAK,EAAE,EAAE;AAC5C,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;AAEA,EAAA,MAAMC,GAAG,GAAGC,MAAM,CAACF,KAAK,CAAC,CAAA;AAEzB,EAAA,OAAOE,MAAM,CAACJ,GAAG,CAAC,IAAIG,GAAG,IAAIA,GAAG,IAAIC,MAAM,CAACH,GAAG,CAAC,CAAA;AACjD,EAAC;;AAED;AACA,MAAMI,OAAO,GAAG,IAAI,CAAA;AAEb,SAASC,mBAAmBA,CAACC,GAAW,EAAEC,MAAc,EAAW;AACxE,EAAA,MAAMC,SAAS,GAAGF,GAAG,GAAGC,MAAM,CAAA;;AAE9B;AACA;AACA;AACA;;AAEA;AACA,EAAA,OACEE,IAAI,CAACV,GAAG,CACNS,SAAS;AAAE;AACXC,EAAAA,IAAI,CAACC,GAAG,CAACH,MAAM,GAAGC,SAAS,CAAC;AAC9B,GAAC,GAAGJ,OAAO,CAAA;AAEf;;;;"}
1
+ {"version":3,"file":"number.js","sources":["../../../src/utils/number/number.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport const isWithinRange = (\n min: number | string,\n max: number | string,\n value: number | string\n): boolean => {\n if (min === '' || max === '' || value === '') {\n return false;\n }\n\n const val = Number(value);\n\n return Number(min) <= val && val <= Number(max);\n};\n\n// 1e-6 covers up to 10,000,000,000 factored by a decimal\nconst EPSILON = 1e-6;\n\nexport function isEvenlyDivisibleBy(num: number, factor: number): boolean {\n const remainder = num % factor;\n\n // due to floating point issues the remainder needs to be within a margin instead of exactly 0\n // 1 % 0.1 === 0.09999999999999995\n // 1000000000 % 0.1 === 0.09999994448884877\n // 1 % 0.05 === 0.04999999999999995\n\n // Compare the smaller of (remainder, factor - remainder) to EPSILON\n return (\n Math.min(\n remainder, // remainder may be smallest, it is 0 in the well-formed case\n Math.abs(factor - remainder) // otherwise the positive difference between factor and remainder\n ) < EPSILON\n );\n}\n"],"names":["isWithinRange","min","max","value","val","Number","EPSILON","isEvenlyDivisibleBy","num","factor","remainder","Math","abs"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,GAAoB,EACpBC,GAAoB,EACpBC,KAAsB,KACV;EACZ,IAAIF,GAAG,KAAK,EAAE,IAAIC,GAAG,KAAK,EAAE,IAAIC,KAAK,KAAK,EAAE,EAAE;AAC5C,IAAA,OAAO,KAAK;AACd;AAEA,EAAA,MAAMC,GAAG,GAAGC,MAAM,CAACF,KAAK,CAAC;AAEzB,EAAA,OAAOE,MAAM,CAACJ,GAAG,CAAC,IAAIG,GAAG,IAAIA,GAAG,IAAIC,MAAM,CAACH,GAAG,CAAC;AACjD;;AAEA;AACA,MAAMI,OAAO,GAAG,IAAI;AAEb,SAASC,mBAAmBA,CAACC,GAAW,EAAEC,MAAc,EAAW;AACxE,EAAA,MAAMC,SAAS,GAAGF,GAAG,GAAGC,MAAM;;AAE9B;AACA;AACA;AACA;;AAEA;AACA,EAAA,OACEE,IAAI,CAACV,GAAG,CACNS,SAAS;AAAE;AACXC,EAAAA,IAAI,CAACC,GAAG,CAACH,MAAM,GAAGC,SAAS,CAAC;AAC9B,GAAC,GAAGJ,OAAO;AAEf;;;;"}
@@ -99,10 +99,7 @@ function findPopoverPosition({
99
99
  top: 0,
100
100
  right: documentWidth,
101
101
  bottom: documentHeight,
102
- left: 0,
103
- height: documentHeight,
104
- width: documentWidth
105
- };
102
+ left: 0};
106
103
 
107
104
  // if no container element is given fall back to using the window viewport
108
105
  const containerBoundingBox = container ? getElementBoundingBox(container) : windowBoundingBox;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/popover/index.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport type { EuiPopoverPosition } from './types';\n\ntype Dimension = 'height' | 'width';\n\nexport const POSITIONS: EuiPopoverPosition[] = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\n\ninterface BoundingBox {\n [position: string]: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface EuiClientRect extends BoundingBox {\n height: number;\n width: number;\n}\n\nconst relatedDimension: { [position in EuiPopoverPosition]: Dimension } = {\n top: 'height',\n right: 'width',\n bottom: 'height',\n left: 'width'\n};\n\nconst dimensionPositionAttribute: {\n [dimension in Dimension]: 'top' | 'left';\n} = {\n height: 'top',\n width: 'left'\n};\n\nconst positionComplements: {\n [position in EuiPopoverPosition]: EuiPopoverPosition;\n} = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right'\n};\n\n// always resolving to top/left is taken advantage of by knowing they are the\n// minimum edges of the bounding box\nconst positionSubstitutes: {\n [position in EuiPopoverPosition]: 'left' | 'top';\n} = {\n top: 'left',\n right: 'top',\n bottom: 'left',\n left: 'top'\n};\n\ninterface FindPopoverPositionArgs {\n anchor: HTMLElement;\n popover: HTMLElement;\n host?: HTMLElement | null;\n align?: EuiPopoverPosition;\n position: EuiPopoverPosition;\n forcePosition?: boolean;\n buffer?: number | [number, number, number, number];\n offset?: number;\n allowCrossAxis?: boolean;\n container?: HTMLElement;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n returnBoundingBox?: boolean;\n}\n\ninterface FindPopoverPositionResult {\n top: number;\n left: number;\n position: 'top' | 'right' | 'bottom' | 'left';\n fit: number;\n arrow?: { left: number; top: number };\n anchorBoundingBox?: EuiClientRect;\n}\n\nconst getBufferValues = (\n buffer: number | [number, number, number, number]\n): [number, number, number, number] => {\n if (Array.isArray(buffer)) {\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] = buffer;\n\n return [topBuffer, rightBuffer, bottomBuffer, leftBuffer];\n }\n\n return [buffer, buffer, buffer, buffer];\n};\n\n/**\n * Calculates the absolute positioning (relative to document.body) to place a popover element\n *\n * @param anchor {HTMLElement} Element to anchor the popover to\n * @param popover {HTMLElement} Element containing the popover content\n * @param position {string} Position the user wants. One of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param [forcePosition] {boolean} If true, use only the provided `position` value and don't try any other position\n * @param host {HTMLElement} Element the popover must be positioned relative to\n * @param [align] {string} Cross-axis alignment. One of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param [buffer=16] {number} Minimum distance between the popover and the bounding container\n * @param [offset=0] {number} Distance between the popover and the anchor\n * @param [allowCrossAxis=true] {boolean} Whether to allow the popover to be positioned on the cross-axis\n * @param [container] {HTMLElement} Element the popover must be constrained to fit within\n * @param [arrowConfig] {{arrowWidth: number, arrowBuffer: number}} If\n * present, describes the size & constraints for an arrow element, and the\n * function return value will include an `arrow` param with position details\n *\n * @returns {FindPopoverPositionResult} absolute page coordinates for the\n * popover, and the placement's relation to the anchor or undefined\n * there's no room.\n */\nexport function findPopoverPosition({\n anchor,\n popover,\n align,\n position,\n forcePosition,\n host,\n buffer = 16,\n offset = 0,\n allowCrossAxis = true,\n container,\n arrowConfig,\n returnBoundingBox\n}: FindPopoverPositionArgs): FindPopoverPositionResult {\n // find the screen-relative bounding boxes of the anchor, popover, and container\n const anchorBoundingBox = getElementBoundingBox(anchor);\n const popoverBoundingBox = getElementBoundingBox(popover);\n\n // calculate the window's bounds\n // window.(innerWidth|innerHeight) do not account for scrollbars\n // so prefer the clientWidth/clientHeight of the DOM if available\n const documentWidth =\n document.documentElement.clientWidth || window.innerWidth;\n const documentHeight =\n document.documentElement.clientHeight || window.innerHeight;\n const windowBoundingBox: EuiClientRect = {\n top: 0,\n right: documentWidth,\n bottom: documentHeight,\n left: 0,\n height: documentHeight,\n width: documentWidth\n };\n\n // if no container element is given fall back to using the window viewport\n const containerBoundingBox = container\n ? getElementBoundingBox(container)\n : windowBoundingBox;\n\n // the anchor is positioned relative to the host element if provided\n if (host) {\n const hostBoundingBox = getElementBoundingBox(host);\n\n const anchorBoundingRelativeToHost = {\n top: anchorBoundingBox.top - hostBoundingBox.top,\n left: anchorBoundingBox.left - hostBoundingBox.left,\n right: hostBoundingBox.right - anchorBoundingBox.right,\n bottom: hostBoundingBox.bottom - anchorBoundingBox.bottom\n };\n\n\n anchorBoundingBox.top = anchorBoundingRelativeToHost.top;\n anchorBoundingBox.left = anchorBoundingRelativeToHost.left;\n anchorBoundingBox.right = anchorBoundingRelativeToHost.right;\n anchorBoundingBox.bottom = anchorBoundingRelativeToHost.bottom;\n }\n\n /**\n * `position` was specified by the function caller and is a strong hint\n * as to the preferred location of the popover relative to the anchor.\n * However, we strongly prefer showing all of the popover content within\n * the window+container boundary and will iterate over the four\n * possible sides until a perfect fit is located. If none of the locations\n * fully contain popover, the location with the best fit is selected.\n *\n * This approach first checks the preferred `position`, then its opposite\n * along the same axis, next a location on the cross-axis, and finally it\n * tests the remaining position.\n *\n * e.g.\n * if position = \"top\" the order is top, bottom, left right\n * if position = \"right\" the order is right, left, top, bottom\n */\n\n // Try the user-desired position first.\n const iterationPositions = [position];\n\n // keep user-defined alignment in the original positions.\n type valuekey = undefined | EuiPopoverPosition;\n\n const iterationAlignments: valuekey[] = [align];\n\n if (forcePosition !== true) {\n iterationPositions.push(positionComplements[position]); // Try the complementary position.\n iterationAlignments.push(align); // keep user-defined alignment in the complementary position.\n\n if (allowCrossAxis) {\n iterationPositions.push(\n positionSubstitutes[position], // Switch to the cross axis.\n positionComplements[positionSubstitutes[position]] // Try the complementary position on the cross axis.\n );\n iterationAlignments.push(undefined, undefined); // discard desired alignment on cross-axis\n }\n } else {\n // position is forced, if it conflicts with the alignment then reset align to `null`\n // e.g. original placement request for `downLeft` is moved to the `left` side, future calls\n // will position and align `left`, and `leftLeft` is not a valid placement\n if (\n position === align ||\n (align !== undefined && position === positionComplements[align])\n ) {\n iterationAlignments[0] = undefined;\n }\n }\n\n let bestFit: number | undefined = undefined;\n let bestPosition: FindPopoverPositionResult | null = null;\n\n for (let idx = 0; idx < iterationPositions.length; idx++) {\n const iterationPosition = iterationPositions[idx];\n\n // See if we can find a position with a better fit than we've found so far.\n const screenCoordinates = getPopoverScreenCoordinates({\n position: iterationPosition!,\n align: iterationAlignments[idx],\n anchorBoundingBox,\n popoverBoundingBox,\n windowBoundingBox,\n containerBoundingBox,\n offset,\n buffer,\n arrowConfig\n });\n\n if (bestFit === undefined || screenCoordinates.fit > bestFit) {\n bestFit = screenCoordinates.fit;\n bestPosition = {\n fit: screenCoordinates.fit,\n position: iterationPosition!,\n top: screenCoordinates.top + window.pageYOffset,\n left: screenCoordinates.left + window.pageXOffset,\n arrow: screenCoordinates.arrow\n };\n\n // If we've already found the ideal fit, use that position.\n if (bestFit === 1) {\n break;\n }\n }\n\n // If we haven't improved the fit, then continue on and try a new position.\n }\n\n if (bestPosition == null) {\n throw new Error('Failed to calculate bestPosition');\n }\n\n if (returnBoundingBox) {\n bestPosition.anchorBoundingBox = anchorBoundingBox;\n }\n\n return bestPosition;\n}\n\ninterface GetPopoverScreenCoordinatesArgs {\n position: EuiPopoverPosition;\n align?: EuiPopoverPosition;\n anchorBoundingBox: EuiClientRect;\n popoverBoundingBox: EuiClientRect;\n windowBoundingBox: EuiClientRect;\n containerBoundingBox: EuiClientRect;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n offset?: number;\n buffer?: number | [number, number, number, number];\n}\n\ninterface GetPopoverScreenCoordinatesResult {\n top: number;\n left: number;\n fit: number;\n arrow: { top: number; left: number } | undefined;\n}\n\n/**\n * Given a target position and the popover's surrounding context, returns either an\n * object with {top, left} screen coordinates or `null` if it's not possible to show\n * content in the target position\n * @param position {string} the target position, one of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param align {string} target alignment on the cross-axis, one of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param anchorBoundingBox {Object} bounding box of the anchor element\n * @param popoverBoundingBox {Object} bounding box of the popover element\n * @param windowBoundingBox {Object} bounding box of the window\n * @param containerBoundingBox {Object} bounding box of the container\n * @param [arrowConfig] {{arrowWidth: number, arrowBuffer: number}} If present, describes the size &\n * constraints for an arrow element, and the function return value will include an `arrow` param\n * with position details\n * @param [offset=0] {number} Distance between the popover and the anchor\n * @param [buffer=0] {number} Minimum distance between the popover's\n * placement and the container edge\n *\n * @returns {GetPopoverScreenCoordinatesResult}\n * object with top/left coordinates, the popover's relative position to the anchor, and how well the\n * popover fits in the location (0.0 -> 1.0) coordinates and the popover's relative position, if\n * there is no room in this placement then null\n */\nexport function getPopoverScreenCoordinates({\n position,\n align,\n anchorBoundingBox,\n popoverBoundingBox,\n windowBoundingBox,\n containerBoundingBox,\n arrowConfig,\n offset = 0,\n buffer = 0\n}: GetPopoverScreenCoordinatesArgs): GetPopoverScreenCoordinatesResult {\n /**\n * The goal is to find the best way to align the popover content\n * on the given side of the anchor element. The popover prefers\n * centering on the anchor but can shift along the cross-axis as needed.\n *\n * We return the top/left coordinates that best fit the popover inside\n * the given boundaries, and also return the `fit` value which indicates\n * what percentage of the popover is within the bounds.\n *\n * e.g. finding a location when position=top\n * the preferred location is directly over the anchor\n *\n * +----------------------+\n * | popover |\n * +----------------------+\n * v\n * +--------------+\n * | anchor |\n * +--------------+\n *\n * but if anchor doesn't have much (or any) room on its ride side\n * the popover will shift to the left\n *\n * +----------------------+\n * | popover |\n * +----------------------+\n * v\n * +--------------+\n * | anchor |\n * +--------------+\n *\n */\n\n const crossAxisFirstSide = positionSubstitutes[position]; // \"top\" -> \"left\"\n const crossAxisSecondSide = positionComplements[crossAxisFirstSide]; // \"left\" -> \"right\"\n const crossAxisDimension = relatedDimension[crossAxisFirstSide]; // \"left\" -> \"width\"\n\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] =\n getBufferValues(buffer);\n\n const { crossAxisPosition, crossAxisArrowPosition } = getCrossAxisPosition({\n crossAxisFirstSide,\n crossAxisSecondSide,\n crossAxisDimension,\n position,\n align,\n buffer,\n offset,\n windowBoundingBox,\n containerBoundingBox,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n });\n\n const primaryAxisDimension = relatedDimension[position]; // \"top\" -> \"height\"\n const primaryAxisPositionName =\n dimensionPositionAttribute[primaryAxisDimension]; // \"height\" -> \"top\"\n\n const { primaryAxisPosition, primaryAxisArrowPosition } =\n getPrimaryAxisPosition({\n position,\n offset,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n });\n\n const popoverPlacement = {\n [crossAxisFirstSide]: crossAxisPosition,\n [primaryAxisPositionName]: primaryAxisPosition\n };\n\n // calculate the fit of the popover in this location\n // fit is in range 0.0 -> 1.0 and is the percentage of the popover which is visible in this location\n const combinedBoundingBox = intersectBoundingBoxes(\n windowBoundingBox,\n containerBoundingBox\n );\n\n // shrink the visible bounding box by `buffer`\n // to compute a fit value\n combinedBoundingBox.top += topBuffer;\n combinedBoundingBox.right -= rightBuffer;\n combinedBoundingBox.bottom -= bottomBuffer;\n combinedBoundingBox.left += leftBuffer;\n\n const fit = getVisibleFit(\n {\n top: popoverPlacement['top']!,\n right: popoverPlacement['left']! + popoverBoundingBox.width,\n bottom: popoverPlacement['top']! + popoverBoundingBox.height,\n left: popoverPlacement['left']!,\n width: popoverBoundingBox.width,\n height: popoverBoundingBox.height\n },\n combinedBoundingBox\n );\n\n const arrow = arrowConfig\n ? {\n [crossAxisFirstSide]:\n crossAxisArrowPosition! - popoverPlacement[crossAxisFirstSide]!,\n [primaryAxisPositionName]: primaryAxisArrowPosition\n }\n : undefined;\n\n return {\n fit,\n top: popoverPlacement['top']!,\n left: popoverPlacement['left']!,\n arrow: arrow ? { left: arrow['left']!, top: arrow['top']! } : undefined\n };\n}\n\ninterface GetCrossAxisPositionArgs {\n crossAxisFirstSide: EuiPopoverPosition;\n crossAxisSecondSide: EuiPopoverPosition;\n crossAxisDimension: Dimension;\n position: EuiPopoverPosition;\n align?: EuiPopoverPosition;\n buffer: number | [number, number, number, number];\n offset: number;\n windowBoundingBox: EuiClientRect;\n containerBoundingBox: EuiClientRect;\n popoverBoundingBox: EuiClientRect;\n anchorBoundingBox: EuiClientRect;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n}\n\ninterface CrossAxisPosition {\n crossAxisPosition: number;\n crossAxisArrowPosition: number | undefined;\n}\n\nfunction getCrossAxisPosition({\n crossAxisFirstSide,\n crossAxisSecondSide,\n crossAxisDimension,\n position,\n align,\n buffer,\n offset,\n windowBoundingBox,\n containerBoundingBox,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n}: GetCrossAxisPositionArgs): CrossAxisPosition {\n // how much of the popover overflows past either side of the anchor if its centered\n const popoverSizeOnCrossAxis = popoverBoundingBox[crossAxisDimension];\n const anchorSizeOnCrossAxis = anchorBoundingBox[crossAxisDimension];\n const anchorHalfSize = anchorSizeOnCrossAxis / 2;\n\n // the popover's original position on the cross-axis is determined by:\n const crossAxisPositionOriginal =\n anchorBoundingBox[crossAxisFirstSide] + // where the anchor is located\n anchorHalfSize - // plus half anchor dimension\n popoverSizeOnCrossAxis / 2; // less half the popover dimension\n\n // To fit the content within both the window and container,\n // compute the smaller of the two spaces along each edge\n const combinedBoundingBox = intersectBoundingBoxes(\n windowBoundingBox,\n containerBoundingBox\n );\n const availableSpace = getAvailableSpace(\n anchorBoundingBox,\n combinedBoundingBox,\n buffer,\n offset,\n position\n );\n const minimumSpace = arrowConfig ? arrowConfig.arrowBuffer : 0;\n\n const contentOverflowSize =\n (popoverSizeOnCrossAxis - anchorSizeOnCrossAxis) / 2;\n\n let alignAmount = 0;\n let alignDirection = 1;\n let amountOfShiftNeeded = 0;\n let shiftDirection = 1;\n\n if (align != null) {\n // no alignment, find how much the container boundary requires the content to shift\n alignDirection = align === 'top' || align === 'left' ? 1 : -1;\n alignAmount = contentOverflowSize;\n\n const alignedOverflowAmount = contentOverflowSize + alignAmount;\n const needsShift =\n alignedOverflowAmount > availableSpace[positionComplements[align]];\n\n amountOfShiftNeeded = needsShift\n ? alignedOverflowAmount - availableSpace[positionComplements[align]]\n : 0;\n shiftDirection = -1 * alignDirection;\n } else {\n // shifting the popover to one side may yield a better fit\n const spaceAvailableOnFirstSide = availableSpace[crossAxisFirstSide];\n const spaceAvailableOnSecondSide = availableSpace[crossAxisSecondSide];\n\n const isShiftTowardFirstSide =\n spaceAvailableOnFirstSide > spaceAvailableOnSecondSide;\n\n shiftDirection = isShiftTowardFirstSide ? -1 : 1;\n\n // determine which direction has more room and the popover should shift to\n const leastAvailableSpace = Math.min(\n spaceAvailableOnFirstSide,\n spaceAvailableOnSecondSide\n );\n\n const needsShift = contentOverflowSize > leastAvailableSpace;\n\n amountOfShiftNeeded = needsShift\n ? contentOverflowSize - leastAvailableSpace\n : 0;\n }\n\n // shift over the popover if necessary\n const shiftAmount = amountOfShiftNeeded * shiftDirection;\n let crossAxisPosition =\n crossAxisPositionOriginal + shiftAmount + alignAmount * alignDirection;\n\n // if an `arrowConfig` is specified, find where to position the arrow\n let crossAxisArrowPosition;\n\n if (arrowConfig) {\n const { arrowWidth } = arrowConfig;\n\n crossAxisArrowPosition =\n anchorBoundingBox[crossAxisFirstSide] + anchorHalfSize - arrowWidth / 2;\n\n // make sure there's enough buffer around the arrow\n // by calculating how how much the arrow would need to move\n // but instead of moving the arrow, shift the popover content\n if (crossAxisArrowPosition < crossAxisPosition + minimumSpace) {\n // arrow is too close to the minimum side\n const difference =\n crossAxisPosition + minimumSpace - crossAxisArrowPosition;\n\n crossAxisPosition -= difference;\n } else if (\n crossAxisArrowPosition + minimumSpace + arrowWidth >\n crossAxisPosition + popoverSizeOnCrossAxis\n ) {\n // arrow is too close to the maximum side\n const edge = crossAxisPosition + popoverSizeOnCrossAxis;\n const difference =\n crossAxisArrowPosition - (edge - minimumSpace - arrowWidth);\n\n crossAxisPosition += difference;\n }\n }\n\n return {\n crossAxisPosition,\n crossAxisArrowPosition\n };\n}\n\ninterface GetPrimaryAxisPositionArgs {\n position: EuiPopoverPosition;\n offset: number;\n popoverBoundingBox: BoundingBox;\n anchorBoundingBox: BoundingBox;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n}\n\nfunction getPrimaryAxisPosition({\n position,\n offset,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n}: GetPrimaryAxisPositionArgs): {\n primaryAxisPosition: number;\n primaryAxisArrowPosition: number | undefined;\n} {\n // if positioning to the top or left, the target position decreases\n // from the anchor's top or left, otherwise the position adds to the anchor's\n const isOffsetDecreasing = position === 'top' || position === 'left';\n\n const primaryAxisDimension = relatedDimension[position]; // \"top\" -> \"height\"\n const popoverSizeOnPrimaryAxis = popoverBoundingBox[primaryAxisDimension];\n\n // start at the top or left edge of the anchor element\n const primaryAxisPositionName =\n dimensionPositionAttribute[primaryAxisDimension]; // \"height\" -> \"top\"\n const anchorEdgeOrigin = anchorBoundingBox[primaryAxisPositionName];\n\n // find the popover position on the primary axis\n const anchorSizeOnPrimaryAxis = anchorBoundingBox[primaryAxisDimension];\n const primaryAxisOffset =\n (isOffsetDecreasing ? popoverSizeOnPrimaryAxis : anchorSizeOnPrimaryAxis) ||\n 0;\n const contentOffset =\n (offset + primaryAxisOffset) * (isOffsetDecreasing ? -1 : 1);\n const primaryAxisPosition = anchorEdgeOrigin + contentOffset;\n\n let primaryAxisArrowPosition;\n\n if (arrowConfig) {\n primaryAxisArrowPosition = isOffsetDecreasing\n ? popoverSizeOnPrimaryAxis\n : 0;\n }\n\n return {\n primaryAxisPosition,\n primaryAxisArrowPosition\n };\n}\n\n/**\n * Finds the client pixel coordinate of each edge for the element's bounding box,\n * and the bounding box's width & height\n *\n * @param {HTMLElement} element\n * @returns {{top: number, right: number, bottom: number, left: number, height: number, width: number}}\n */\nexport function getElementBoundingBox(element: HTMLElement): EuiClientRect {\n const rect = element.getBoundingClientRect();\n\n return {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n height: rect.height,\n width: rect.width\n };\n}\n\n/**\n * Calculates the available content space between anchor and container\n *\n * @param {Object} anchorBoundingBox Client bounding box of the anchor element\n * @param {Object} containerBoundingBox Client bounding box of the container element\n * @param {number} buffer Minimum distance between the popover and the bounding container\n * @param {number} offset Distance between the popover and the anchor\n * @param {string} offsetSide Side the offset needs to be applied to, one\n * of [\"top\", \"right\", \"bottom\", \"left\"]\n * @returns {{top: number, right: number, bottom: number, left: number}}\n */\nexport function getAvailableSpace(\n anchorBoundingBox: BoundingBox,\n containerBoundingBox: BoundingBox,\n buffer: number | [number, number, number, number],\n offset: number,\n offsetSide: EuiPopoverPosition\n): BoundingBox {\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] =\n getBufferValues(buffer);\n\n return {\n top:\n anchorBoundingBox.top -\n containerBoundingBox.top -\n topBuffer -\n (offsetSide === 'top' ? offset : 0),\n right:\n containerBoundingBox.right -\n anchorBoundingBox.right -\n rightBuffer -\n (offsetSide === 'right' ? offset : 0),\n bottom:\n containerBoundingBox.bottom -\n anchorBoundingBox.bottom -\n bottomBuffer -\n (offsetSide === 'bottom' ? offset : 0),\n left:\n anchorBoundingBox.left -\n containerBoundingBox.left -\n leftBuffer -\n (offsetSide === 'left' ? offset : 0)\n };\n}\n\n/**\n * Computes the fit (overlap) of the content within the container, fit is in range 0.0 => 1.0\n * @param contentBoundingBox bounding box of content to calculate fit for\n * @param containerBoundingBox bounding box of container\n * @returns {number}\n */\nexport function getVisibleFit(\n contentBoundingBox: BoundingBox,\n containerBoundingBox: BoundingBox\n): number {\n const intersection = intersectBoundingBoxes(\n contentBoundingBox,\n containerBoundingBox\n );\n\n if (\n intersection.left > intersection.right ||\n intersection.top > intersection.top\n ) {\n // there is no intersection, the boxes are completely separated on at least one axis\n return 0;\n }\n\n const intersectionArea =\n (intersection.right - intersection.left) *\n (intersection.bottom - intersection.top);\n const contentArea =\n (contentBoundingBox.right - contentBoundingBox.left) *\n (contentBoundingBox.bottom - contentBoundingBox.top);\n\n return intersectionArea / contentArea;\n}\n\n/**\n * Calculates the intersection space between two bounding boxes\n *\n * @param firstBox\n * @param secondBox\n * @returns {EuiClientRect}\n */\nexport function intersectBoundingBoxes(\n firstBox: BoundingBox,\n secondBox: BoundingBox\n): EuiClientRect {\n const top = Math.max(firstBox.top, secondBox.top);\n const right = Math.min(firstBox.right, secondBox.right);\n const bottom = Math.min(firstBox.bottom, secondBox.bottom);\n const left = Math.max(firstBox.left, secondBox.left);\n const height = Math.max(bottom - top, 0);\n const width = Math.max(right - left, 0);\n\n return {\n top,\n right,\n bottom,\n left,\n height,\n width\n };\n}\n\n/**\n * Returns the top-most defined z-index in the element's ancestor hierarchy\n * relative to the `target` element; if no z-index is defined, returns 0\n * @param element {HTMLElement}\n * @param cousin {HTMLElement}\n * @returns {number}\n */\nexport function getElementZIndex(\n element: HTMLElement,\n cousin: HTMLElement\n): number {\n /**\n * finding the z-index of `element` is not the full story\n * its the CSS stacking context that is important\n * take this DOM for example:\n * body\n * section[z-index: 1000]\n * p[z-index: 500]\n * button\n * div\n *\n * what z-index does the `div` need to display next to `button`?\n * the `div` and `section` are where the stacking context splits\n * so `div` needs to copy `section`'s z-index in order to\n * appear next to / over `button`\n *\n * calculate this by starting at `button` and finding its offsetParents\n * then walk the parents from top -> down until the stacking context\n * split is found, or if there is no split then a specific z-index is unimportant\n */\n\n // build the array of the element + its offset parents\n const nodesToInspect: HTMLElement[] = [];\n // eslint-disable-next-line\n while (true) {\n nodesToInspect.push(element);\n\n // AFAICT this is a valid cast - the libdefs appear wrong\n element = element.offsetParent as HTMLElement;\n\n // stop if there is no parent\n if (element == null) {\n break;\n }\n\n // stop if the parent contains the related element\n // as this is the z-index ancestor\n if (element.contains(cousin)) {\n break;\n }\n }\n\n // reverse the nodes to walk from top -> element\n nodesToInspect.reverse();\n\n for (const node of nodesToInspect) {\n // get this node's z-index css value\n const zIndex = window.document\n .defaultView!.getComputedStyle(node)\n .getPropertyValue('z-index');\n\n // if the z-index is not a number (e.g. \"auto\") return null, else the value\n const parsedZIndex = parseInt(zIndex, 10);\n\n if (!isNaN(parsedZIndex)) {\n return parsedZIndex;\n }\n }\n\n return 0;\n}\n"],"names":["POSITIONS","relatedDimension","top","right","bottom","left","dimensionPositionAttribute","height","width","positionComplements","positionSubstitutes","getBufferValues","buffer","Array","isArray","topBuffer","rightBuffer","bottomBuffer","leftBuffer","findPopoverPosition","anchor","popover","align","position","forcePosition","host","offset","allowCrossAxis","container","arrowConfig","returnBoundingBox","anchorBoundingBox","getElementBoundingBox","popoverBoundingBox","documentWidth","document","documentElement","clientWidth","window","innerWidth","documentHeight","clientHeight","innerHeight","windowBoundingBox","containerBoundingBox","hostBoundingBox","anchorBoundingRelativeToHost","iterationPositions","iterationAlignments","push","undefined","bestFit","bestPosition","idx","length","iterationPosition","screenCoordinates","getPopoverScreenCoordinates","fit","pageYOffset","pageXOffset","arrow","Error","crossAxisFirstSide","crossAxisSecondSide","crossAxisDimension","crossAxisPosition","crossAxisArrowPosition","getCrossAxisPosition","primaryAxisDimension","primaryAxisPositionName","primaryAxisPosition","primaryAxisArrowPosition","getPrimaryAxisPosition","popoverPlacement","combinedBoundingBox","intersectBoundingBoxes","getVisibleFit","popoverSizeOnCrossAxis","anchorSizeOnCrossAxis","anchorHalfSize","crossAxisPositionOriginal","availableSpace","getAvailableSpace","minimumSpace","arrowBuffer","contentOverflowSize","alignAmount","alignDirection","amountOfShiftNeeded","shiftDirection","alignedOverflowAmount","needsShift","spaceAvailableOnFirstSide","spaceAvailableOnSecondSide","isShiftTowardFirstSide","leastAvailableSpace","Math","min","shiftAmount","arrowWidth","difference","edge","isOffsetDecreasing","popoverSizeOnPrimaryAxis","anchorEdgeOrigin","anchorSizeOnPrimaryAxis","primaryAxisOffset","contentOffset","element","rect","getBoundingClientRect","offsetSide","contentBoundingBox","intersection","intersectionArea","contentArea","firstBox","secondBox","max","getElementZIndex","cousin","nodesToInspect","offsetParent","contains","reverse","node","zIndex","defaultView","getComputedStyle","getPropertyValue","parsedZIndex","parseInt","isNaN"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,SAA+B,GAAG,CAC7C,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACP;AAeD,MAAMC,gBAAiE,GAAG;AACxEC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,IAAI,EAAE,OAAA;AACR,CAAC,CAAA;AAED,MAAMC,0BAEL,GAAG;AACFC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,KAAK,EAAE,MAAA;AACT,CAAC,CAAA;AAED,MAAMC,mBAEL,GAAG;AACFP,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,KAAK,EAAE,MAAM;AACbC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,IAAI,EAAE,OAAA;AACR,CAAC,CAAA;;AAED;AACA;AACA,MAAMK,mBAEL,GAAG;AAC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B,EACX;AACR;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEE;EACA,MAAMC,cAA6B,GAAG,EAAE,CAAA;AACxC;AACA,EAAA,OAAO,IAAI,EAAE;AACXA,IAAAA,cAAc,CAACzE,IAAI,CAAC4D,OAAO,CAAC,CAAA;;AAE5B;IACAA,OAAO,GAAGA,OAAO,CAACc,YAA2B,CAAA;;AAE7C;IACA,IAAId,OAAO,IAAI,IAAI,EAAE;AACnB,MAAA,MAAA;AACF,KAAA;;AAEA;AACA;AACA,IAAA,IAAIA,OAAO,CAACe,QAAQ,CAACH,MAAM,CAAC,EAAE;AAC5B,MAAA,MAAA;AACF,KAAA;AACF,GAAA;;AAEA;EACAC,cAAc,CAACG,OAAO,EAAE,CAAA;AAExB,EAAA,KAAK,MAAMC,IAAI,IAAIJ,cAAc,EAAE;AACjC;AACA,IAAA,MAAMK,MAAM,GAAGzF,MAAM,CAACH,QAAQ,CAC3B6F,WAAW,CAAEC,gBAAgB,CAACH,IAAI,CAAC,CACnCI,gBAAgB,CAAC,SAAS,CAAC,CAAA;;AAE9B;AACA,IAAA,MAAMC,YAAY,GAAGC,QAAQ,CAACL,MAAM,EAAE,EAAE,CAAC,CAAA;AAEzC,IAAA,IAAI,CAACM,KAAK,CAACF,YAAY,CAAC,EAAE;AACxB,MAAA,OAAOA,YAAY,CAAA;AACrB,KAAA;AACF,GAAA;AAEA,EAAA,OAAO,CAAC,CAAA;AACV;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/popover/index.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport type { EuiPopoverPosition } from './types';\n\ntype Dimension = 'height' | 'width';\n\nexport const POSITIONS: EuiPopoverPosition[] = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\n\ninterface BoundingBox {\n [position: string]: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface EuiClientRect extends BoundingBox {\n height: number;\n width: number;\n}\n\nconst relatedDimension: { [position in EuiPopoverPosition]: Dimension } = {\n top: 'height',\n right: 'width',\n bottom: 'height',\n left: 'width'\n};\n\nconst dimensionPositionAttribute: {\n [dimension in Dimension]: 'top' | 'left';\n} = {\n height: 'top',\n width: 'left'\n};\n\nconst positionComplements: {\n [position in EuiPopoverPosition]: EuiPopoverPosition;\n} = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right'\n};\n\n// always resolving to top/left is taken advantage of by knowing they are the\n// minimum edges of the bounding box\nconst positionSubstitutes: {\n [position in EuiPopoverPosition]: 'left' | 'top';\n} = {\n top: 'left',\n right: 'top',\n bottom: 'left',\n left: 'top'\n};\n\ninterface FindPopoverPositionArgs {\n anchor: HTMLElement;\n popover: HTMLElement;\n host?: HTMLElement | null;\n align?: EuiPopoverPosition;\n position: EuiPopoverPosition;\n forcePosition?: boolean;\n buffer?: number | [number, number, number, number];\n offset?: number;\n allowCrossAxis?: boolean;\n container?: HTMLElement;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n returnBoundingBox?: boolean;\n}\n\ninterface FindPopoverPositionResult {\n top: number;\n left: number;\n position: 'top' | 'right' | 'bottom' | 'left';\n fit: number;\n arrow?: { left: number; top: number };\n anchorBoundingBox?: EuiClientRect;\n}\n\nconst getBufferValues = (\n buffer: number | [number, number, number, number]\n): [number, number, number, number] => {\n if (Array.isArray(buffer)) {\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] = buffer;\n\n return [topBuffer, rightBuffer, bottomBuffer, leftBuffer];\n }\n\n return [buffer, buffer, buffer, buffer];\n};\n\n/**\n * Calculates the absolute positioning (relative to document.body) to place a popover element\n *\n * @param anchor {HTMLElement} Element to anchor the popover to\n * @param popover {HTMLElement} Element containing the popover content\n * @param position {string} Position the user wants. One of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param [forcePosition] {boolean} If true, use only the provided `position` value and don't try any other position\n * @param host {HTMLElement} Element the popover must be positioned relative to\n * @param [align] {string} Cross-axis alignment. One of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param [buffer=16] {number} Minimum distance between the popover and the bounding container\n * @param [offset=0] {number} Distance between the popover and the anchor\n * @param [allowCrossAxis=true] {boolean} Whether to allow the popover to be positioned on the cross-axis\n * @param [container] {HTMLElement} Element the popover must be constrained to fit within\n * @param [arrowConfig] {{arrowWidth: number, arrowBuffer: number}} If\n * present, describes the size & constraints for an arrow element, and the\n * function return value will include an `arrow` param with position details\n *\n * @returns {FindPopoverPositionResult} absolute page coordinates for the\n * popover, and the placement's relation to the anchor or undefined\n * there's no room.\n */\nexport function findPopoverPosition({\n anchor,\n popover,\n align,\n position,\n forcePosition,\n host,\n buffer = 16,\n offset = 0,\n allowCrossAxis = true,\n container,\n arrowConfig,\n returnBoundingBox\n}: FindPopoverPositionArgs): FindPopoverPositionResult {\n // find the screen-relative bounding boxes of the anchor, popover, and container\n const anchorBoundingBox = getElementBoundingBox(anchor);\n const popoverBoundingBox = getElementBoundingBox(popover);\n\n // calculate the window's bounds\n // window.(innerWidth|innerHeight) do not account for scrollbars\n // so prefer the clientWidth/clientHeight of the DOM if available\n const documentWidth =\n document.documentElement.clientWidth || window.innerWidth;\n const documentHeight =\n document.documentElement.clientHeight || window.innerHeight;\n const windowBoundingBox: EuiClientRect = {\n top: 0,\n right: documentWidth,\n bottom: documentHeight,\n left: 0,\n height: documentHeight,\n width: documentWidth\n };\n\n // if no container element is given fall back to using the window viewport\n const containerBoundingBox = container\n ? getElementBoundingBox(container)\n : windowBoundingBox;\n\n // the anchor is positioned relative to the host element if provided\n if (host) {\n const hostBoundingBox = getElementBoundingBox(host);\n\n const anchorBoundingRelativeToHost = {\n top: anchorBoundingBox.top - hostBoundingBox.top,\n left: anchorBoundingBox.left - hostBoundingBox.left,\n right: hostBoundingBox.right - anchorBoundingBox.right,\n bottom: hostBoundingBox.bottom - anchorBoundingBox.bottom\n };\n\n\n anchorBoundingBox.top = anchorBoundingRelativeToHost.top;\n anchorBoundingBox.left = anchorBoundingRelativeToHost.left;\n anchorBoundingBox.right = anchorBoundingRelativeToHost.right;\n anchorBoundingBox.bottom = anchorBoundingRelativeToHost.bottom;\n }\n\n /**\n * `position` was specified by the function caller and is a strong hint\n * as to the preferred location of the popover relative to the anchor.\n * However, we strongly prefer showing all of the popover content within\n * the window+container boundary and will iterate over the four\n * possible sides until a perfect fit is located. If none of the locations\n * fully contain popover, the location with the best fit is selected.\n *\n * This approach first checks the preferred `position`, then its opposite\n * along the same axis, next a location on the cross-axis, and finally it\n * tests the remaining position.\n *\n * e.g.\n * if position = \"top\" the order is top, bottom, left right\n * if position = \"right\" the order is right, left, top, bottom\n */\n\n // Try the user-desired position first.\n const iterationPositions = [position];\n\n // keep user-defined alignment in the original positions.\n type valuekey = undefined | EuiPopoverPosition;\n\n const iterationAlignments: valuekey[] = [align];\n\n if (forcePosition !== true) {\n iterationPositions.push(positionComplements[position]); // Try the complementary position.\n iterationAlignments.push(align); // keep user-defined alignment in the complementary position.\n\n if (allowCrossAxis) {\n iterationPositions.push(\n positionSubstitutes[position], // Switch to the cross axis.\n positionComplements[positionSubstitutes[position]] // Try the complementary position on the cross axis.\n );\n iterationAlignments.push(undefined, undefined); // discard desired alignment on cross-axis\n }\n } else {\n // position is forced, if it conflicts with the alignment then reset align to `null`\n // e.g. original placement request for `downLeft` is moved to the `left` side, future calls\n // will position and align `left`, and `leftLeft` is not a valid placement\n if (\n position === align ||\n (align !== undefined && position === positionComplements[align])\n ) {\n iterationAlignments[0] = undefined;\n }\n }\n\n let bestFit: number | undefined = undefined;\n let bestPosition: FindPopoverPositionResult | null = null;\n\n for (let idx = 0; idx < iterationPositions.length; idx++) {\n const iterationPosition = iterationPositions[idx];\n\n // See if we can find a position with a better fit than we've found so far.\n const screenCoordinates = getPopoverScreenCoordinates({\n position: iterationPosition!,\n align: iterationAlignments[idx],\n anchorBoundingBox,\n popoverBoundingBox,\n windowBoundingBox,\n containerBoundingBox,\n offset,\n buffer,\n arrowConfig\n });\n\n if (bestFit === undefined || screenCoordinates.fit > bestFit) {\n bestFit = screenCoordinates.fit;\n bestPosition = {\n fit: screenCoordinates.fit,\n position: iterationPosition!,\n top: screenCoordinates.top + window.pageYOffset,\n left: screenCoordinates.left + window.pageXOffset,\n arrow: screenCoordinates.arrow\n };\n\n // If we've already found the ideal fit, use that position.\n if (bestFit === 1) {\n break;\n }\n }\n\n // If we haven't improved the fit, then continue on and try a new position.\n }\n\n if (bestPosition == null) {\n throw new Error('Failed to calculate bestPosition');\n }\n\n if (returnBoundingBox) {\n bestPosition.anchorBoundingBox = anchorBoundingBox;\n }\n\n return bestPosition;\n}\n\ninterface GetPopoverScreenCoordinatesArgs {\n position: EuiPopoverPosition;\n align?: EuiPopoverPosition;\n anchorBoundingBox: EuiClientRect;\n popoverBoundingBox: EuiClientRect;\n windowBoundingBox: EuiClientRect;\n containerBoundingBox: EuiClientRect;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n offset?: number;\n buffer?: number | [number, number, number, number];\n}\n\ninterface GetPopoverScreenCoordinatesResult {\n top: number;\n left: number;\n fit: number;\n arrow: { top: number; left: number } | undefined;\n}\n\n/**\n * Given a target position and the popover's surrounding context, returns either an\n * object with {top, left} screen coordinates or `null` if it's not possible to show\n * content in the target position\n * @param position {string} the target position, one of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param align {string} target alignment on the cross-axis, one of [\"top\", \"right\", \"bottom\", \"left\"]\n * @param anchorBoundingBox {Object} bounding box of the anchor element\n * @param popoverBoundingBox {Object} bounding box of the popover element\n * @param windowBoundingBox {Object} bounding box of the window\n * @param containerBoundingBox {Object} bounding box of the container\n * @param [arrowConfig] {{arrowWidth: number, arrowBuffer: number}} If present, describes the size &\n * constraints for an arrow element, and the function return value will include an `arrow` param\n * with position details\n * @param [offset=0] {number} Distance between the popover and the anchor\n * @param [buffer=0] {number} Minimum distance between the popover's\n * placement and the container edge\n *\n * @returns {GetPopoverScreenCoordinatesResult}\n * object with top/left coordinates, the popover's relative position to the anchor, and how well the\n * popover fits in the location (0.0 -> 1.0) coordinates and the popover's relative position, if\n * there is no room in this placement then null\n */\nexport function getPopoverScreenCoordinates({\n position,\n align,\n anchorBoundingBox,\n popoverBoundingBox,\n windowBoundingBox,\n containerBoundingBox,\n arrowConfig,\n offset = 0,\n buffer = 0\n}: GetPopoverScreenCoordinatesArgs): GetPopoverScreenCoordinatesResult {\n /**\n * The goal is to find the best way to align the popover content\n * on the given side of the anchor element. The popover prefers\n * centering on the anchor but can shift along the cross-axis as needed.\n *\n * We return the top/left coordinates that best fit the popover inside\n * the given boundaries, and also return the `fit` value which indicates\n * what percentage of the popover is within the bounds.\n *\n * e.g. finding a location when position=top\n * the preferred location is directly over the anchor\n *\n * +----------------------+\n * | popover |\n * +----------------------+\n * v\n * +--------------+\n * | anchor |\n * +--------------+\n *\n * but if anchor doesn't have much (or any) room on its ride side\n * the popover will shift to the left\n *\n * +----------------------+\n * | popover |\n * +----------------------+\n * v\n * +--------------+\n * | anchor |\n * +--------------+\n *\n */\n\n const crossAxisFirstSide = positionSubstitutes[position]; // \"top\" -> \"left\"\n const crossAxisSecondSide = positionComplements[crossAxisFirstSide]; // \"left\" -> \"right\"\n const crossAxisDimension = relatedDimension[crossAxisFirstSide]; // \"left\" -> \"width\"\n\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] =\n getBufferValues(buffer);\n\n const { crossAxisPosition, crossAxisArrowPosition } = getCrossAxisPosition({\n crossAxisFirstSide,\n crossAxisSecondSide,\n crossAxisDimension,\n position,\n align,\n buffer,\n offset,\n windowBoundingBox,\n containerBoundingBox,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n });\n\n const primaryAxisDimension = relatedDimension[position]; // \"top\" -> \"height\"\n const primaryAxisPositionName =\n dimensionPositionAttribute[primaryAxisDimension]; // \"height\" -> \"top\"\n\n const { primaryAxisPosition, primaryAxisArrowPosition } =\n getPrimaryAxisPosition({\n position,\n offset,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n });\n\n const popoverPlacement = {\n [crossAxisFirstSide]: crossAxisPosition,\n [primaryAxisPositionName]: primaryAxisPosition\n };\n\n // calculate the fit of the popover in this location\n // fit is in range 0.0 -> 1.0 and is the percentage of the popover which is visible in this location\n const combinedBoundingBox = intersectBoundingBoxes(\n windowBoundingBox,\n containerBoundingBox\n );\n\n // shrink the visible bounding box by `buffer`\n // to compute a fit value\n combinedBoundingBox.top += topBuffer;\n combinedBoundingBox.right -= rightBuffer;\n combinedBoundingBox.bottom -= bottomBuffer;\n combinedBoundingBox.left += leftBuffer;\n\n const fit = getVisibleFit(\n {\n top: popoverPlacement['top']!,\n right: popoverPlacement['left']! + popoverBoundingBox.width,\n bottom: popoverPlacement['top']! + popoverBoundingBox.height,\n left: popoverPlacement['left']!,\n width: popoverBoundingBox.width,\n height: popoverBoundingBox.height\n },\n combinedBoundingBox\n );\n\n const arrow = arrowConfig\n ? {\n [crossAxisFirstSide]:\n crossAxisArrowPosition! - popoverPlacement[crossAxisFirstSide]!,\n [primaryAxisPositionName]: primaryAxisArrowPosition\n }\n : undefined;\n\n return {\n fit,\n top: popoverPlacement['top']!,\n left: popoverPlacement['left']!,\n arrow: arrow ? { left: arrow['left']!, top: arrow['top']! } : undefined\n };\n}\n\ninterface GetCrossAxisPositionArgs {\n crossAxisFirstSide: EuiPopoverPosition;\n crossAxisSecondSide: EuiPopoverPosition;\n crossAxisDimension: Dimension;\n position: EuiPopoverPosition;\n align?: EuiPopoverPosition;\n buffer: number | [number, number, number, number];\n offset: number;\n windowBoundingBox: EuiClientRect;\n containerBoundingBox: EuiClientRect;\n popoverBoundingBox: EuiClientRect;\n anchorBoundingBox: EuiClientRect;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n}\n\ninterface CrossAxisPosition {\n crossAxisPosition: number;\n crossAxisArrowPosition: number | undefined;\n}\n\nfunction getCrossAxisPosition({\n crossAxisFirstSide,\n crossAxisSecondSide,\n crossAxisDimension,\n position,\n align,\n buffer,\n offset,\n windowBoundingBox,\n containerBoundingBox,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n}: GetCrossAxisPositionArgs): CrossAxisPosition {\n // how much of the popover overflows past either side of the anchor if its centered\n const popoverSizeOnCrossAxis = popoverBoundingBox[crossAxisDimension];\n const anchorSizeOnCrossAxis = anchorBoundingBox[crossAxisDimension];\n const anchorHalfSize = anchorSizeOnCrossAxis / 2;\n\n // the popover's original position on the cross-axis is determined by:\n const crossAxisPositionOriginal =\n anchorBoundingBox[crossAxisFirstSide] + // where the anchor is located\n anchorHalfSize - // plus half anchor dimension\n popoverSizeOnCrossAxis / 2; // less half the popover dimension\n\n // To fit the content within both the window and container,\n // compute the smaller of the two spaces along each edge\n const combinedBoundingBox = intersectBoundingBoxes(\n windowBoundingBox,\n containerBoundingBox\n );\n const availableSpace = getAvailableSpace(\n anchorBoundingBox,\n combinedBoundingBox,\n buffer,\n offset,\n position\n );\n const minimumSpace = arrowConfig ? arrowConfig.arrowBuffer : 0;\n\n const contentOverflowSize =\n (popoverSizeOnCrossAxis - anchorSizeOnCrossAxis) / 2;\n\n let alignAmount = 0;\n let alignDirection = 1;\n let amountOfShiftNeeded = 0;\n let shiftDirection = 1;\n\n if (align != null) {\n // no alignment, find how much the container boundary requires the content to shift\n alignDirection = align === 'top' || align === 'left' ? 1 : -1;\n alignAmount = contentOverflowSize;\n\n const alignedOverflowAmount = contentOverflowSize + alignAmount;\n const needsShift =\n alignedOverflowAmount > availableSpace[positionComplements[align]];\n\n amountOfShiftNeeded = needsShift\n ? alignedOverflowAmount - availableSpace[positionComplements[align]]\n : 0;\n shiftDirection = -1 * alignDirection;\n } else {\n // shifting the popover to one side may yield a better fit\n const spaceAvailableOnFirstSide = availableSpace[crossAxisFirstSide];\n const spaceAvailableOnSecondSide = availableSpace[crossAxisSecondSide];\n\n const isShiftTowardFirstSide =\n spaceAvailableOnFirstSide > spaceAvailableOnSecondSide;\n\n shiftDirection = isShiftTowardFirstSide ? -1 : 1;\n\n // determine which direction has more room and the popover should shift to\n const leastAvailableSpace = Math.min(\n spaceAvailableOnFirstSide,\n spaceAvailableOnSecondSide\n );\n\n const needsShift = contentOverflowSize > leastAvailableSpace;\n\n amountOfShiftNeeded = needsShift\n ? contentOverflowSize - leastAvailableSpace\n : 0;\n }\n\n // shift over the popover if necessary\n const shiftAmount = amountOfShiftNeeded * shiftDirection;\n let crossAxisPosition =\n crossAxisPositionOriginal + shiftAmount + alignAmount * alignDirection;\n\n // if an `arrowConfig` is specified, find where to position the arrow\n let crossAxisArrowPosition;\n\n if (arrowConfig) {\n const { arrowWidth } = arrowConfig;\n\n crossAxisArrowPosition =\n anchorBoundingBox[crossAxisFirstSide] + anchorHalfSize - arrowWidth / 2;\n\n // make sure there's enough buffer around the arrow\n // by calculating how how much the arrow would need to move\n // but instead of moving the arrow, shift the popover content\n if (crossAxisArrowPosition < crossAxisPosition + minimumSpace) {\n // arrow is too close to the minimum side\n const difference =\n crossAxisPosition + minimumSpace - crossAxisArrowPosition;\n\n crossAxisPosition -= difference;\n } else if (\n crossAxisArrowPosition + minimumSpace + arrowWidth >\n crossAxisPosition + popoverSizeOnCrossAxis\n ) {\n // arrow is too close to the maximum side\n const edge = crossAxisPosition + popoverSizeOnCrossAxis;\n const difference =\n crossAxisArrowPosition - (edge - minimumSpace - arrowWidth);\n\n crossAxisPosition += difference;\n }\n }\n\n return {\n crossAxisPosition,\n crossAxisArrowPosition\n };\n}\n\ninterface GetPrimaryAxisPositionArgs {\n position: EuiPopoverPosition;\n offset: number;\n popoverBoundingBox: BoundingBox;\n anchorBoundingBox: BoundingBox;\n arrowConfig?: { arrowWidth: number; arrowBuffer: number };\n}\n\nfunction getPrimaryAxisPosition({\n position,\n offset,\n popoverBoundingBox,\n anchorBoundingBox,\n arrowConfig\n}: GetPrimaryAxisPositionArgs): {\n primaryAxisPosition: number;\n primaryAxisArrowPosition: number | undefined;\n} {\n // if positioning to the top or left, the target position decreases\n // from the anchor's top or left, otherwise the position adds to the anchor's\n const isOffsetDecreasing = position === 'top' || position === 'left';\n\n const primaryAxisDimension = relatedDimension[position]; // \"top\" -> \"height\"\n const popoverSizeOnPrimaryAxis = popoverBoundingBox[primaryAxisDimension];\n\n // start at the top or left edge of the anchor element\n const primaryAxisPositionName =\n dimensionPositionAttribute[primaryAxisDimension]; // \"height\" -> \"top\"\n const anchorEdgeOrigin = anchorBoundingBox[primaryAxisPositionName];\n\n // find the popover position on the primary axis\n const anchorSizeOnPrimaryAxis = anchorBoundingBox[primaryAxisDimension];\n const primaryAxisOffset =\n (isOffsetDecreasing ? popoverSizeOnPrimaryAxis : anchorSizeOnPrimaryAxis) ||\n 0;\n const contentOffset =\n (offset + primaryAxisOffset) * (isOffsetDecreasing ? -1 : 1);\n const primaryAxisPosition = anchorEdgeOrigin + contentOffset;\n\n let primaryAxisArrowPosition;\n\n if (arrowConfig) {\n primaryAxisArrowPosition = isOffsetDecreasing\n ? popoverSizeOnPrimaryAxis\n : 0;\n }\n\n return {\n primaryAxisPosition,\n primaryAxisArrowPosition\n };\n}\n\n/**\n * Finds the client pixel coordinate of each edge for the element's bounding box,\n * and the bounding box's width & height\n *\n * @param {HTMLElement} element\n * @returns {{top: number, right: number, bottom: number, left: number, height: number, width: number}}\n */\nexport function getElementBoundingBox(element: HTMLElement): EuiClientRect {\n const rect = element.getBoundingClientRect();\n\n return {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n height: rect.height,\n width: rect.width\n };\n}\n\n/**\n * Calculates the available content space between anchor and container\n *\n * @param {Object} anchorBoundingBox Client bounding box of the anchor element\n * @param {Object} containerBoundingBox Client bounding box of the container element\n * @param {number} buffer Minimum distance between the popover and the bounding container\n * @param {number} offset Distance between the popover and the anchor\n * @param {string} offsetSide Side the offset needs to be applied to, one\n * of [\"top\", \"right\", \"bottom\", \"left\"]\n * @returns {{top: number, right: number, bottom: number, left: number}}\n */\nexport function getAvailableSpace(\n anchorBoundingBox: BoundingBox,\n containerBoundingBox: BoundingBox,\n buffer: number | [number, number, number, number],\n offset: number,\n offsetSide: EuiPopoverPosition\n): BoundingBox {\n const [topBuffer, rightBuffer, bottomBuffer, leftBuffer] =\n getBufferValues(buffer);\n\n return {\n top:\n anchorBoundingBox.top -\n containerBoundingBox.top -\n topBuffer -\n (offsetSide === 'top' ? offset : 0),\n right:\n containerBoundingBox.right -\n anchorBoundingBox.right -\n rightBuffer -\n (offsetSide === 'right' ? offset : 0),\n bottom:\n containerBoundingBox.bottom -\n anchorBoundingBox.bottom -\n bottomBuffer -\n (offsetSide === 'bottom' ? offset : 0),\n left:\n anchorBoundingBox.left -\n containerBoundingBox.left -\n leftBuffer -\n (offsetSide === 'left' ? offset : 0)\n };\n}\n\n/**\n * Computes the fit (overlap) of the content within the container, fit is in range 0.0 => 1.0\n * @param contentBoundingBox bounding box of content to calculate fit for\n * @param containerBoundingBox bounding box of container\n * @returns {number}\n */\nexport function getVisibleFit(\n contentBoundingBox: BoundingBox,\n containerBoundingBox: BoundingBox\n): number {\n const intersection = intersectBoundingBoxes(\n contentBoundingBox,\n containerBoundingBox\n );\n\n if (\n intersection.left > intersection.right ||\n intersection.top > intersection.top\n ) {\n // there is no intersection, the boxes are completely separated on at least one axis\n return 0;\n }\n\n const intersectionArea =\n (intersection.right - intersection.left) *\n (intersection.bottom - intersection.top);\n const contentArea =\n (contentBoundingBox.right - contentBoundingBox.left) *\n (contentBoundingBox.bottom - contentBoundingBox.top);\n\n return intersectionArea / contentArea;\n}\n\n/**\n * Calculates the intersection space between two bounding boxes\n *\n * @param firstBox\n * @param secondBox\n * @returns {EuiClientRect}\n */\nexport function intersectBoundingBoxes(\n firstBox: BoundingBox,\n secondBox: BoundingBox\n): EuiClientRect {\n const top = Math.max(firstBox.top, secondBox.top);\n const right = Math.min(firstBox.right, secondBox.right);\n const bottom = Math.min(firstBox.bottom, secondBox.bottom);\n const left = Math.max(firstBox.left, secondBox.left);\n const height = Math.max(bottom - top, 0);\n const width = Math.max(right - left, 0);\n\n return {\n top,\n right,\n bottom,\n left,\n height,\n width\n };\n}\n\n/**\n * Returns the top-most defined z-index in the element's ancestor hierarchy\n * relative to the `target` element; if no z-index is defined, returns 0\n * @param element {HTMLElement}\n * @param cousin {HTMLElement}\n * @returns {number}\n */\nexport function getElementZIndex(\n element: HTMLElement,\n cousin: HTMLElement\n): number {\n /**\n * finding the z-index of `element` is not the full story\n * its the CSS stacking context that is important\n * take this DOM for example:\n * body\n * section[z-index: 1000]\n * p[z-index: 500]\n * button\n * div\n *\n * what z-index does the `div` need to display next to `button`?\n * the `div` and `section` are where the stacking context splits\n * so `div` needs to copy `section`'s z-index in order to\n * appear next to / over `button`\n *\n * calculate this by starting at `button` and finding its offsetParents\n * then walk the parents from top -> down until the stacking context\n * split is found, or if there is no split then a specific z-index is unimportant\n */\n\n // build the array of the element + its offset parents\n const nodesToInspect: HTMLElement[] = [];\n // eslint-disable-next-line\n while (true) {\n nodesToInspect.push(element);\n\n // AFAICT this is a valid cast - the libdefs appear wrong\n element = element.offsetParent as HTMLElement;\n\n // stop if there is no parent\n if (element == null) {\n break;\n }\n\n // stop if the parent contains the related element\n // as this is the z-index ancestor\n if (element.contains(cousin)) {\n break;\n }\n }\n\n // reverse the nodes to walk from top -> element\n nodesToInspect.reverse();\n\n for (const node of nodesToInspect) {\n // get this node's z-index css value\n const zIndex = window.document\n .defaultView!.getComputedStyle(node)\n .getPropertyValue('z-index');\n\n // if the z-index is not a number (e.g. \"auto\") return null, else the value\n const parsedZIndex = parseInt(zIndex, 10);\n\n if (!isNaN(parsedZIndex)) {\n return parsedZIndex;\n }\n }\n\n return 0;\n}\n"],"names":["POSITIONS","relatedDimension","top","right","bottom","left","dimensionPositionAttribute","height","width","positionComplements","positionSubstitutes","getBufferValues","buffer","Array","isArray","topBuffer","rightBuffer","bottomBuffer","leftBuffer","findPopoverPosition","anchor","popover","align","position","forcePosition","host","offset","allowCrossAxis","container","arrowConfig","returnBoundingBox","anchorBoundingBox","getElementBoundingBox","popoverBoundingBox","documentWidth","document","documentElement","clientWidth","window","innerWidth","documentHeight","clientHeight","innerHeight","windowBoundingBox","containerBoundingBox","hostBoundingBox","anchorBoundingRelativeToHost","iterationPositions","iterationAlignments","push","undefined","bestFit","bestPosition","idx","length","iterationPosition","screenCoordinates","getPopoverScreenCoordinates","fit","pageYOffset","pageXOffset","arrow","Error","crossAxisFirstSide","crossAxisSecondSide","crossAxisDimension","crossAxisPosition","crossAxisArrowPosition","getCrossAxisPosition","primaryAxisDimension","primaryAxisPositionName","primaryAxisPosition","primaryAxisArrowPosition","getPrimaryAxisPosition","popoverPlacement","combinedBoundingBox","intersectBoundingBoxes","getVisibleFit","popoverSizeOnCrossAxis","anchorSizeOnCrossAxis","anchorHalfSize","crossAxisPositionOriginal","availableSpace","getAvailableSpace","minimumSpace","arrowBuffer","contentOverflowSize","alignAmount","alignDirection","amountOfShiftNeeded","shiftDirection","alignedOverflowAmount","needsShift","spaceAvailableOnFirstSide","spaceAvailableOnSecondSide","isShiftTowardFirstSide","leastAvailableSpace","Math","min","shiftAmount","arrowWidth","difference","edge","isOffsetDecreasing","popoverSizeOnPrimaryAxis","anchorEdgeOrigin","anchorSizeOnPrimaryAxis","primaryAxisOffset","contentOffset","element","rect","getBoundingClientRect","offsetSide","contentBoundingBox","intersection","intersectionArea","contentArea","firstBox","secondBox","max","getElementZIndex","cousin","nodesToInspect","offsetParent","contains","reverse","node","zIndex","defaultView","getComputedStyle","getPropertyValue","parsedZIndex","parseInt","isNaN"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,SAA+B,GAAG,CAC7C,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM;AAgBR,MAAMC,gBAAiE,GAAG;AACxEC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,0BAEL,GAAG;AACFC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,mBAEL,GAAG;AACFP,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,KAAK,EAAE,MAAM;AACbC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA,MAAMK,mBAEL,GAAG;AACFR,EAAAA,GAAG,EAAE,MAAM;AACXC,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,MAAM,EAAE,MAAM;AACdC,EAAAA,IAAI,EAAE;AACR,CAAC;AA0BD,MAAMM,eAAe,GACnBC,MAAiD,IACZ;AACrC,EAAA,IAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACzB,MAAM,CAACG,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,CAAC,GAAGN,MAAM;IAEjE,OAAO,CAACG,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,CAAC;AAC3D;EAEA,OAAO,CAACN,MAAM,EAAEA,MAAM,EAAEA,MAAM,EAAEA,MAAM,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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IAAIA,OAAO,CAACe,QAAQ,CAACH,MAAM,CAAC,EAAE;AAC5B,MAAA;AACF;AACF;;AAEA;EACAC,cAAc,CAACG,OAAO,EAAE;AAExB,EAAA,KAAK,MAAMC,IAAI,IAAIJ,cAAc,EAAE;AACjC;AACA,IAAA,MAAMK,MAAM,GAAGzF,MAAM,CAACH,QAAQ,CAC3B6F,WAAW,CAAEC,gBAAgB,CAACH,IAAI,CAAC,CACnCI,gBAAgB,CAAC,SAAS,CAAC;;AAE9B;AACA,IAAA,MAAMC,YAAY,GAAGC,QAAQ,CAACL,MAAM,EAAE,EAAE,CAAC;AAEzC,IAAA,IAAI,CAACM,KAAK,CAACF,YAAY,CAAC,EAAE;AACxB,MAAA,OAAOA,YAAY;AACrB;AACF;AAEA,EAAA,OAAO,CAAC;AACV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"common_predicates.js","sources":["../../../src/utils/predicate/common_predicates.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\n// import moment from 'moment';\n\nexport const always = (_value?: any) => true;\n\nexport const never = (_value?: any) => false;\n\nexport const isUndefined = (value: any): value is undefined => {\n return value === undefined;\n};\n\nexport const isNull = (value: any): value is null => {\n return value === null;\n};\n\nexport const isNil = (value: any): value is null | undefined => {\n return isUndefined(value) || isNull(value);\n};\n\n// export const isMoment = (value: any) => {\n// return moment.isMoment(value);\n// };\n\n// export const isDate = (value: any): value is Date => {\n// return moment.isDate(value);\n// };\n\n// export const isDateLike = (value: any): value is moment.Moment | Date => {\n// return isDate(value);\n// };\n"],"names":["always","_value","never","isUndefined","value","undefined","isNull","isNil"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEaA,MAAAA,MAAM,GAAIC,MAAY,IAAK,KAAI;AAE/BC,MAAAA,KAAK,GAAID,MAAY,IAAK,MAAK;AAE/BE,MAAAA,WAAW,GAAIC,KAAU,IAAyB;EAC7D,OAAOA,KAAK,KAAKC,SAAS,CAAA;AAC5B,EAAC;AAEYC,MAAAA,MAAM,GAAIF,KAAU,IAAoB;EACnD,OAAOA,KAAK,KAAK,IAAI,CAAA;AACvB,EAAC;AAEYG,MAAAA,KAAK,GAAIH,KAAU,IAAgC;EAC9D,OAAOD,WAAW,CAACC,KAAK,CAAC,IAAIE,MAAM,CAACF,KAAK,CAAC,CAAA;AAC5C,EAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"common_predicates.js","sources":["../../../src/utils/predicate/common_predicates.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\n// import moment from 'moment';\n\nexport const always = (_value?: any) => true;\n\nexport const never = (_value?: any) => false;\n\nexport const isUndefined = (value: any): value is undefined => {\n return value === undefined;\n};\n\nexport const isNull = (value: any): value is null => {\n return value === null;\n};\n\nexport const isNil = (value: any): value is null | undefined => {\n return isUndefined(value) || isNull(value);\n};\n\n// export const isMoment = (value: any) => {\n// return moment.isMoment(value);\n// };\n\n// export const isDate = (value: any): value is Date => {\n// return moment.isDate(value);\n// };\n\n// export const isDateLike = (value: any): value is moment.Moment | Date => {\n// return isDate(value);\n// };\n"],"names":["always","_value","never","isUndefined","value","undefined","isNull","isNil"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEaA,MAAAA,MAAM,GAAIC,MAAY,IAAK;AAE3BC,MAAAA,KAAK,GAAID,MAAY,IAAK;AAE1BE,MAAAA,WAAW,GAAIC,KAAU,IAAyB;EAC7D,OAAOA,KAAK,KAAKC,SAAS;AAC5B;AAEaC,MAAAA,MAAM,GAAIF,KAAU,IAAoB;EACnD,OAAOA,KAAK,KAAK,IAAI;AACvB;AAEaG,MAAAA,KAAK,GAAIH,KAAU,IAAgC;EAC9D,OAAOD,WAAW,CAACC,KAAK,CAAC,IAAIE,MAAM,CAACF,KAAK,CAAC;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"lodash_predicates.js","sources":["../../../src/utils/predicate/lodash_predicates.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\nimport _isArray from 'lodash-es/isArray';\nimport _isBoolean from 'lodash-es/isBoolean';\nimport _isFunction from 'lodash-es/isFunction';\nimport _isNaN from 'lodash-es/isNaN';\nimport _isNumber from 'lodash-es/isNumber';\nimport _isObject from 'lodash-es/isObject';\nimport _isString from 'lodash-es/isString';\n\n// wrap the lodash functions to avoid having lodash's TS type definition from being\n// exported, which can conflict with the lodash namespace if other versions are used\n\nexport const isFunction = (value: any): value is (...args: any[]) => any =>\n _isFunction(value);\nexport const isArray = (value: any): value is any[] => _isArray(value);\nexport const isString = (value: any): value is string => _isString(value);\nexport const isBoolean = (value: any): value is boolean => _isBoolean(value);\nexport const isNumber = (value: any): value is number => _isNumber(value);\nexport const isNaN = (value: any) => _isNaN(value);\nexport const isObject = (value: any): value is object => _isObject(value);\n"],"names":["isFunction","value","_isFunction","isArray","_isArray","isString","_isString","isBoolean","_isBoolean","isNumber","_isNumber","isNaN","_isNaN","isObject","_isObject"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACA;;AAEO,MAAMA,UAAU,GAAIC,KAAU,IACnCC,WAAW,CAACD,KAAK,EAAC;AACb,MAAME,OAAO,GAAIF,KAAU,IAAqBG,QAAQ,CAACH,KAAK,EAAC;AAC/D,MAAMI,QAAQ,GAAIJ,KAAU,IAAsBK,SAAS,CAACL,KAAK,EAAC;AAClE,MAAMM,SAAS,GAAIN,KAAU,IAAuBO,UAAU,CAACP,KAAK,EAAC;AACrE,MAAMQ,QAAQ,GAAIR,KAAU,IAAsBS,SAAS,CAACT,KAAK,EAAC;AAClE,MAAMU,KAAK,GAAIV,KAAU,IAAKW,MAAM,CAACX,KAAK,EAAC;AAC3C,MAAMY,QAAQ,GAAIZ,KAAU,IAAsBa,SAAS,CAACb,KAAK;;;;"}
1
+ {"version":3,"file":"lodash_predicates.js","sources":["../../../src/utils/predicate/lodash_predicates.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\nimport _isArray from 'lodash-es/isArray';\nimport _isBoolean from 'lodash-es/isBoolean';\nimport _isFunction from 'lodash-es/isFunction';\nimport _isNaN from 'lodash-es/isNaN';\nimport _isNumber from 'lodash-es/isNumber';\nimport _isObject from 'lodash-es/isObject';\nimport _isString from 'lodash-es/isString';\n\n// wrap the lodash functions to avoid having lodash's TS type definition from being\n// exported, which can conflict with the lodash namespace if other versions are used\n\nexport const isFunction = (value: any): value is (...args: any[]) => any =>\n _isFunction(value);\nexport const isArray = (value: any): value is any[] => _isArray(value);\nexport const isString = (value: any): value is string => _isString(value);\nexport const isBoolean = (value: any): value is boolean => _isBoolean(value);\nexport const isNumber = (value: any): value is number => _isNumber(value);\nexport const isNaN = (value: any) => _isNaN(value);\nexport const isObject = (value: any): value is object => _isObject(value);\n"],"names":["isFunction","value","_isFunction","isArray","_isArray","isString","_isString","isBoolean","_isBoolean","isNumber","_isNumber","isNaN","_isNaN","isObject","_isObject"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACA;;AAEO,MAAMA,UAAU,GAAIC,KAAU,IACnCC,WAAW,CAACD,KAAK;AACZ,MAAME,OAAO,GAAIF,KAAU,IAAqBG,QAAQ,CAACH,KAAK;AAC9D,MAAMI,QAAQ,GAAIJ,KAAU,IAAsBK,SAAS,CAACL,KAAK;AACjE,MAAMM,SAAS,GAAIN,KAAU,IAAuBO,UAAU,CAACP,KAAK;AACpE,MAAMQ,QAAQ,GAAIR,KAAU,IAAsBS,SAAS,CAACT,KAAK;AACjE,MAAMU,KAAK,GAAIV,KAAU,IAAKW,MAAM,CAACX,KAAK;AAC1C,MAAMY,QAAQ,GAAIZ,KAAU,IAAsBa,SAAS,CAACb,KAAK;;;;"}
@@ -3,7 +3,10 @@ import { later, cancel } from '@ember/runloop';
3
3
  class Timer {
4
4
  // In a browser this is a number, but in node it's a NodeJS.Time (a
5
5
  // class). We don't care about this difference.
6
-
6
+ id;
7
+ callback;
8
+ finishTime;
9
+ timeRemaining;
7
10
  constructor(callback, timeMs) {
8
11
  this.id = later(this.finish, timeMs);
9
12
  this.callback = callback;
@@ -1 +1 @@
1
- {"version":3,"file":"timer.js","sources":["../../src/utils/timer.ts"],"sourcesContent":["import { cancel,later } from '@ember/runloop';\nexport default class Timer {\n // In a browser this is a number, but in node it's a NodeJS.Time (a\n // class). We don't care about this difference.\n id: ReturnType<typeof later> | undefined;\n callback: undefined | (() => void);\n finishTime: number | undefined;\n timeRemaining: number | undefined;\n\n constructor(callback: () => void, timeMs: number) {\n this.id = later(this.finish, timeMs);\n this.callback = callback;\n this.finishTime = Date.now() + timeMs;\n this.timeRemaining = undefined;\n }\n\n pause = (): void => {\n cancel(this.id as ReturnType<typeof later>);\n this.id = undefined;\n this.timeRemaining = (this.finishTime || 0) - Date.now();\n };\n\n resume = (): void => {\n this.id = later(this.finish, this.timeRemaining as number);\n this.finishTime = Date.now() + (this.timeRemaining || 0);\n this.timeRemaining = undefined;\n };\n\n clear = (): void => {\n cancel(this.id as ReturnType<typeof later>);\n this.id = undefined;\n this.callback = undefined;\n this.finishTime = undefined;\n this.timeRemaining = undefined;\n };\n\n finish = (): void => {\n if (this.callback) {\n this.callback();\n }\n\n this.clear();\n };\n}\n"],"names":["Timer","constructor","callback","timeMs","id","later","finish","finishTime","Date","now","timeRemaining","undefined","pause","cancel","resume","clear"],"mappings":";;AACe,MAAMA,KAAK,CAAC;AACzB;AACA;;AAMAC,EAAAA,WAAWA,CAACC,QAAoB,EAAEC,MAAc,EAAE;IAChD,IAAI,CAACC,EAAE,GAAGC,KAAK,CAAC,IAAI,CAACC,MAAM,EAAEH,MAAM,CAAC,CAAA;IACpC,IAAI,CAACD,QAAQ,GAAGA,QAAQ,CAAA;IACxB,IAAI,CAACK,UAAU,GAAGC,IAAI,CAACC,GAAG,EAAE,GAAGN,MAAM,CAAA;IACrC,IAAI,CAACO,aAAa,GAAGC,SAAS,CAAA;AAChC,GAAA;EAEAC,KAAK,GAAGA,MAAY;AAClBC,IAAAA,MAAM,CAAC,IAAI,CAACT,EAA8B,CAAC,CAAA;IAC3C,IAAI,CAACA,EAAE,GAAGO,SAAS,CAAA;AACnB,IAAA,IAAI,CAACD,aAAa,GAAG,CAAC,IAAI,CAACH,UAAU,IAAI,CAAC,IAAIC,IAAI,CAACC,GAAG,EAAE,CAAA;GACzD,CAAA;EAEDK,MAAM,GAAGA,MAAY;AACnB,IAAA,IAAI,CAACV,EAAE,GAAGC,KAAK,CAAC,IAAI,CAACC,MAAM,EAAE,IAAI,CAACI,aAAuB,CAAC,CAAA;AAC1D,IAAA,IAAI,CAACH,UAAU,GAAGC,IAAI,CAACC,GAAG,EAAE,IAAI,IAAI,CAACC,aAAa,IAAI,CAAC,CAAC,CAAA;IACxD,IAAI,CAACA,aAAa,GAAGC,SAAS,CAAA;GAC/B,CAAA;EAEDI,KAAK,GAAGA,MAAY;AAClBF,IAAAA,MAAM,CAAC,IAAI,CAACT,EAA8B,CAAC,CAAA;IAC3C,IAAI,CAACA,EAAE,GAAGO,SAAS,CAAA;IACnB,IAAI,CAACT,QAAQ,GAAGS,SAAS,CAAA;IACzB,IAAI,CAACJ,UAAU,GAAGI,SAAS,CAAA;IAC3B,IAAI,CAACD,aAAa,GAAGC,SAAS,CAAA;GAC/B,CAAA;EAEDL,MAAM,GAAGA,MAAY;IACnB,IAAI,IAAI,CAACJ,QAAQ,EAAE;MACjB,IAAI,CAACA,QAAQ,EAAE,CAAA;AACjB,KAAA;IAEA,IAAI,CAACa,KAAK,EAAE,CAAA;GACb,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"timer.js","sources":["../../src/utils/timer.ts"],"sourcesContent":["import { cancel,later } from '@ember/runloop';\nexport default class Timer {\n // In a browser this is a number, but in node it's a NodeJS.Time (a\n // class). We don't care about this difference.\n id: ReturnType<typeof later> | undefined;\n callback: undefined | (() => void);\n finishTime: number | undefined;\n timeRemaining: number | undefined;\n\n constructor(callback: () => void, timeMs: number) {\n this.id = later(this.finish, timeMs);\n this.callback = callback;\n this.finishTime = Date.now() + timeMs;\n this.timeRemaining = undefined;\n }\n\n pause = (): void => {\n cancel(this.id as ReturnType<typeof later>);\n this.id = undefined;\n this.timeRemaining = (this.finishTime || 0) - Date.now();\n };\n\n resume = (): void => {\n this.id = later(this.finish, this.timeRemaining as number);\n this.finishTime = Date.now() + (this.timeRemaining || 0);\n this.timeRemaining = undefined;\n };\n\n clear = (): void => {\n cancel(this.id as ReturnType<typeof later>);\n this.id = undefined;\n this.callback = undefined;\n this.finishTime = undefined;\n this.timeRemaining = undefined;\n };\n\n finish = (): void => {\n if (this.callback) {\n this.callback();\n }\n\n this.clear();\n };\n}\n"],"names":["Timer","id","callback","finishTime","timeRemaining","constructor","timeMs","later","finish","Date","now","undefined","pause","cancel","resume","clear"],"mappings":";;AACe,MAAMA,KAAK,CAAC;AACzB;AACA;EACAC,EAAE;EACFC,QAAQ;EACRC,UAAU;EACV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src/utils/transition.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst GROUP_NUMERIC = /^([\\d.]+)(s|ms)/;\n\nfunction getMilliseconds(value: string, unit: string): number {\n // Given the regex match and capture groups, we can assume `unit` to be either 's' or 'ms'\n const multiplier = unit === 's' ? 1000 : 1;\n\n return parseFloat(value) * multiplier;\n}\n\n// Find CSS `transition-duration` and `transition-delay` intervals\n// and return the value of each computed property in 'ms'\nexport const getTransitionTimings = (\n element: Element\n): { durationMatch: number; delayMatch: number } => {\n const computedStyle = window.getComputedStyle(element);\n\n const computedDuration = computedStyle.getPropertyValue(\n 'transition-duration'\n );\n const durationMatchArray = computedDuration.match(GROUP_NUMERIC);\n const durationMatch = durationMatchArray\n ? getMilliseconds(durationMatchArray[1]!, durationMatchArray[2]!)\n : 0;\n\n const computedDelay = computedStyle.getPropertyValue('transition-delay');\n const delayMatchArray = computedDelay.match(GROUP_NUMERIC);\n const delayMatch = delayMatchArray\n ? getMilliseconds(delayMatchArray[1]!, delayMatchArray[2]!)\n : 0;\n\n return { durationMatch, delayMatch };\n};\n\nfunction isElementNode(element: Node): element is Element {\n return element.nodeType === document.ELEMENT_NODE;\n}\n\n// Uses `getTransitionTimings` to find the total transition time for\n// all elements targeted by a MutationObserver callback\nexport const getWaitDuration = (records: MutationRecord[]): number => {\n return records.reduce((waitDuration, record) => {\n // only check for CSS transition values for ELEMENT nodes\n if (isElementNode(record.target)) {\n const { durationMatch, delayMatch } = getTransitionTimings(record.target);\n\n waitDuration = Math.max(waitDuration, durationMatch + delayMatch);\n }\n\n return waitDuration;\n }, 0);\n};\n\n// Uses `requestAnimationFrame` to perform a given callback after a specified waiting period\nexport const performOnFrame = (\n waitDuration: number,\n toPerform: () => void\n): void => {\n if (waitDuration > 0) {\n const startTime = Date.now();\n const endTime = startTime + waitDuration;\n\n const onFrame = () => {\n toPerform();\n\n if (endTime > Date.now()) {\n requestAnimationFrame(onFrame);\n }\n };\n\n requestAnimationFrame(onFrame);\n }\n};\n\n// Convenience method for combining the result of 'getWaitDuration' directly with 'performOnFrame'\nexport const getDurationAndPerformOnFrame = (\n records: MutationRecord[],\n toPerform: () => void\n): void => {\n performOnFrame(getWaitDuration(records), toPerform);\n};\n"],"names":["GROUP_NUMERIC","getMilliseconds","value","unit","multiplier","parseFloat","getTransitionTimings","element","computedStyle","window","getComputedStyle","computedDuration","getPropertyValue","durationMatchArray","match","durationMatch","computedDelay","delayMatchArray","delayMatch","isElementNode","nodeType","document","ELEMENT_NODE","getWaitDuration","records","reduce","waitDuration","record","target","Math","max","performOnFrame","toPerform","startTime","Date","now","endTime","onFrame","requestAnimationFrame","getDurationAndPerformOnFrame"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,aAAa,GAAG,iBAAiB,CAAA;AAEvC,SAASC,eAAeA,CAACC,KAAa,EAAEC,IAAY,EAAU;AAC5D;EACA,MAAMC,UAAU,GAAGD,IAAI,KAAK,GAAG,GAAG,IAAI,GAAG,CAAC,CAAA;AAE1C,EAAA,OAAOE,UAAU,CAACH,KAAK,CAAC,GAAGE,UAAU,CAAA;AACvC,CAAA;;AAEA;AACA;AACaE,MAAAA,oBAAoB,GAC/BC,OAAgB,IACkC;AAClD,EAAA,MAAMC,aAAa,GAAGC,MAAM,CAACC,gBAAgB,CAACH,OAAO,CAAC,CAAA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A;GACpB,EAAE,CAAC,CAAC,CAAA;AACP,EAAC;;AAED;MACaK,cAAc,GAAGA,CAC5BL,YAAoB,EACpBM,SAAqB,KACZ;EACT,IAAIN,YAAY,GAAG,CAAC,EAAE;AACpB,IAAA,MAAMO,SAAS,GAAGC,IAAI,CAACC,GAAG,EAAE,CAAA;AAC5B,IAAA,MAAMC,OAAO,GAAGH,SAAS,GAAGP,YAAY,CAAA;IAExC,MAAMW,OAAO,GAAGA,MAAM;AACpBL,MAAAA,SAAS,EAAE,CAAA;AAEX,MAAA,IAAII,OAAO,GAAGF,IAAI,CAACC,GAAG,EAAE,EAAE;QACxBG,qBAAqB,CAACD,OAAO,CAAC,CAAA;AAChC,OAAA;KACD,CAAA;IAEDC,qBAAqB,CAACD,OAAO,CAAC,CAAA;AAChC,GAAA;AACF,EAAC;;AAED;MACaE,4BAA4B,GAAGA,CAC1Cf,OAAyB,EACzBQ,SAAqB,KACZ;AACTD,EAAAA,cAAc,CAACR,eAAe,CAACC,OAAO,CAAC,EAAEQ,SAAS,CAAC,CAAA;AACrD;;;;"}
1
+ {"version":3,"file":"transition.js","sources":["../../src/utils/transition.ts"],"sourcesContent":["/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst GROUP_NUMERIC = /^([\\d.]+)(s|ms)/;\n\nfunction getMilliseconds(value: string, unit: string): number {\n // Given the regex match and capture groups, we can assume `unit` to be either 's' or 'ms'\n const multiplier = unit === 's' ? 1000 : 1;\n\n return parseFloat(value) * multiplier;\n}\n\n// Find CSS `transition-duration` and `transition-delay` intervals\n// and return the value of each computed property in 'ms'\nexport const getTransitionTimings = (\n element: Element\n): { durationMatch: number; delayMatch: number } => {\n const computedStyle = window.getComputedStyle(element);\n\n const computedDuration = computedStyle.getPropertyValue(\n 'transition-duration'\n );\n const durationMatchArray = computedDuration.match(GROUP_NUMERIC);\n const durationMatch = durationMatchArray\n ? getMilliseconds(durationMatchArray[1]!, durationMatchArray[2]!)\n : 0;\n\n const computedDelay = computedStyle.getPropertyValue('transition-delay');\n const delayMatchArray = computedDelay.match(GROUP_NUMERIC);\n const delayMatch = delayMatchArray\n ? getMilliseconds(delayMatchArray[1]!, delayMatchArray[2]!)\n : 0;\n\n return { durationMatch, delayMatch };\n};\n\nfunction isElementNode(element: Node): element is Element {\n return element.nodeType === document.ELEMENT_NODE;\n}\n\n// Uses `getTransitionTimings` to find the total transition time for\n// all elements targeted by a MutationObserver callback\nexport const getWaitDuration = (records: MutationRecord[]): number => {\n return records.reduce((waitDuration, record) => {\n // only check for CSS transition values for ELEMENT nodes\n if (isElementNode(record.target)) {\n const { durationMatch, delayMatch } = getTransitionTimings(record.target);\n\n waitDuration = Math.max(waitDuration, durationMatch + delayMatch);\n }\n\n return waitDuration;\n }, 0);\n};\n\n// Uses `requestAnimationFrame` to perform a given callback after a specified waiting period\nexport const performOnFrame = (\n waitDuration: number,\n toPerform: () => void\n): void => {\n if (waitDuration > 0) {\n const startTime = Date.now();\n const endTime = startTime + waitDuration;\n\n const onFrame = () => {\n toPerform();\n\n if (endTime > Date.now()) {\n requestAnimationFrame(onFrame);\n }\n };\n\n requestAnimationFrame(onFrame);\n }\n};\n\n// Convenience method for combining the result of 'getWaitDuration' directly with 'performOnFrame'\nexport const getDurationAndPerformOnFrame = (\n records: MutationRecord[],\n toPerform: () => void\n): void => {\n performOnFrame(getWaitDuration(records), toPerform);\n};\n"],"names":["GROUP_NUMERIC","getMilliseconds","value","unit","multiplier","parseFloat","getTransitionTimings","element","computedStyle","window","getComputedStyle","computedDuration","getPropertyValue","durationMatchArray","match","durationMatch","computedDelay","delayMatchArray","delayMatch","isElementNode","nodeType","document","ELEMENT_NODE","getWaitDuration","records","reduce","waitDuration","record","target","Math","max","performOnFrame","toPerform","startTime","Date","now","endTime","onFrame","requestAnimationFrame","getDurationAndPerformOnFrame"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,aAAa,GAAG,iBAAiB;AAEvC,SAASC,eAAeA,CAACC,KAAa,EAAEC,IAAY,EAAU;AAC5D;EACA,MAAMC,UAAU,GAAGD,IAAI,KAAK,GAAG,GAAG,IAAI,GAAG,CAAC;AAE1C,EAAA,OAAOE,UAAU,CAACH,KAAK,CAAC,GAAGE,UAAU;AACvC;;AAEA;AACA;AACaE,MAAAA,oBAAoB,GAC/BC,OAAgB,IACkC;AAClD,EAAA,MAAMC,aAAa,GAAGC,MAAM,CAACC,gBAAgB,CAACH,OAAO,CAAC;AAEtD,EAAA,MAAMI,gBAAgB,GAAGH,aAAa,CAACI,gBAAgB,CACrD,qBACF,CAAC;AACD,EAAA,MAAMC,kBAAkB,GAAGF,gBAAgB,CAACG,KAAK,CAACd,aAAa,CAAC;AAChE,EAAA,MAAMe,aAAa,GAAGF,kBAAkB,GACpCZ,eAAe,CAACY,kBAAkB,CAAC,CAAC,CAAC,EAAGA,kBAAkB,CAAC,CAAC,CAAE,CAAC,GAC/D,CAAC;AAEL,EAAA,MAAMG,aAAa,GAAGR,aAAa,CAACI,gBAAgB,CAAC,kBAAkB,CAAC;AACxE,EAAA,MAAMK,eAAe,GAAGD,aAAa,CAACF,KAAK,CAACd,aAAa,CAAC;AAC1D,EAAA,MAAMkB,UAAU,GAAGD,eAAe,GAC9BhB,eAAe,CAACgB,eAAe,CAAC,CAAC,CAAC,EAAGA,eAAe,CAAC,CAAC,CAAE,CAAC,GACzD,C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",
3
- "version": "11.0.2",
3
+ "version": "12.0.0",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -34,6 +34,13 @@
34
34
  "./themes/dark.css": "./vendor/eui_theme_dark.min.css",
35
35
  "./themes/light.css": "./vendor/eui_theme_light.min.css"
36
36
  },
37
+ "typesVersions": {
38
+ "*": {
39
+ "*": [
40
+ "declarations/*"
41
+ ]
42
+ }
43
+ },
37
44
  "files": [
38
45
  "addon-main.js",
39
46
  "declarations",
@@ -52,20 +59,22 @@
52
59
  ]
53
60
  },
54
61
  "devDependencies": {
55
- "pnpm-sync-dependencies-meta-injected": "^0.0.10",
56
- "@babel/core": "^7.23.2",
57
- "@babel/eslint-parser": "^7.23.3",
62
+ "@babel/core": "^7.26.0",
63
+ "@babel/eslint-parser": "^7.26.5",
58
64
  "@babel/plugin-proposal-class-properties": "^7.18.6",
59
- "@babel/plugin-proposal-decorators": "^7.17.9",
65
+ "@babel/plugin-proposal-decorators": "^7.25.9",
60
66
  "@babel/plugin-transform-class-static-block": "^7.20.0",
61
67
  "@babel/plugin-transform-typescript": "^7.12.13",
62
68
  "@babel/preset-typescript": "^7.18.6",
63
- "@embroider/addon-dev": "^4.3.1",
64
- "@glimmer/component": "^1.1.2",
69
+ "@embroider/addon-dev": "7.1.1",
70
+ "@eslint/js": "^9.19.0",
71
+ "@ember/string": "^4.0.0",
72
+ "@glimmer/component": "^2.0.0",
65
73
  "@glimmer/tracking": "^1.1.2",
66
- "@glint/environment-ember-loose": "^1.3.0",
67
- "@glint/environment-ember-template-imports": "^1.3.0",
68
- "@glint/template": "^1.3.0",
74
+ "@glint/core": "1.5.2",
75
+ "@glint/environment-ember-loose": "1.5.2",
76
+ "@glint/environment-ember-template-imports": "1.5.2",
77
+ "@glint/template": "1.5.2",
69
78
  "@rollup/plugin-babel": "^6.0.4",
70
79
  "@rollup/plugin-node-resolve": "^15.2.3",
71
80
  "@tsconfig/ember": "3.0.0",
@@ -94,49 +103,52 @@
94
103
  "@types/lodash-es": "^4.17.4",
95
104
  "@types/refractor": "^3.0.0",
96
105
  "babel-plugin-ember-template-compilation": "^2.2.5",
97
- "concurrently": "^8.2.2",
98
- "@ember/string": "^3.1.1",
106
+ "concurrently": "^9.1.2",
107
+ "ember-basic-dropdown": "^8.5.0",
108
+ "ember-cli": "~6.2.0",
109
+ "ember-cli-clean-css": "^3.0.0",
110
+ "ember-concurrency": "^4.0.2",
99
111
  "ember-focus-trap": "^1.1.0",
100
- "ember-source": "~4.2.0",
101
- "ember-template-imports": "^4.1.1",
102
- "ember-template-lint": "^5.11.2",
103
- "eslint": "^8.31.0",
104
- "eslint-config-prettier": "^8.5.0",
105
- "eslint-plugin-ember": "^11.6.0",
106
- "eslint-plugin-node": "^11.1.0",
112
+ "ember-power-select": "8.7.0",
113
+ "ember-source": "~6.2.0",
114
+ "ember-template-lint": "^6.1.0",
115
+ "eslint": "^9.19.0",
116
+ "eslint-config-prettier": "^9.1.0",
117
+ "eslint-plugin-ember": "^12.5.0",
118
+ "eslint-plugin-n": "^17.15.1",
119
+ "globals": "^15.14.0",
107
120
  "moment": "^2.29.3",
108
- "rollup": "~4.3.0",
121
+ "pnpm-sync-dependencies-meta-injected": "^0.0.10",
122
+ "prettier-plugin-ember-template-tag": "^2.0.4",
123
+ "rollup": "^4.6.0",
109
124
  "rollup-plugin-copy": "^3.5.0",
110
- "rollup-plugin-glimmer-template-tag": "^0.4.1",
111
- "rollup-plugin-ts": "^3.0.2",
112
- "execa": "^8.0.1",
113
- "fix-bad-declaration-output": "^1.1.4",
125
+ "stylelint": "^16.14.1",
126
+ "stylelint-config-standard": "^36.0.1",
127
+ "stylelint-prettier": "^5.0.3",
114
128
  "typescript": "^5.3.3",
115
- "webpack": "^5.89.0"
129
+ "webpack": "^5.97.1"
116
130
  },
117
131
  "dependencies": {
132
+ "@embroider/addon-shim": "^1.9.0",
133
+ "decorator-transforms": "^2.3.0",
134
+ "@babel/core": "^7.26.7",
118
135
  "@babel/runtime": "^7.23.2",
119
136
  "@elastic/datemath": "^5.0.3",
120
137
  "@ember/render-modifiers": "^2.1.0",
121
- "@embroider/addon-shim": "^1.8.9",
122
138
  "@embroider/util": "^1.13.1",
123
139
  "@html-next/vertical-collection": "4.0.0",
124
140
  "chroma-js": "^2.1.0",
125
- "ember-auto-import": "^2.7.2",
126
- "ember-cached-decorator-polyfill": "^1.0.2",
127
- "ember-cli-string-helpers": "^6.1.0",
141
+ "ember-auto-import": "^2.10.0",
128
142
  "ember-composable-helpers": "^5.0.0",
129
143
  "ember-element-helper": "^0.8.6",
130
144
  "ember-event-helpers": "^0.1.1",
131
- "ember-in-element-polyfill": "^1.0.0",
132
- "ember-keyboard": "^7.0.1",
145
+ "ember-keyboard": "^9.0.1",
133
146
  "ember-math-helpers": "^2.15.0",
134
- "ember-modifier": "^4.1.0",
135
- "ember-power-select": "7.2.0",
147
+ "ember-modifier": "^4.2.0",
136
148
  "ember-set-body-class": "^1.0.2",
137
149
  "ember-set-helper": "^2.0.1",
138
- "ember-style-modifier": "^3.0.1",
139
- "ember-svg-jar": "^2.4.7",
150
+ "ember-style-modifier": "^4.4.0",
151
+ "ember-svg-jar": "^2.6.0",
140
152
  "ember-truth-helpers": "^4.0.3",
141
153
  "lodash-es": "^4.17.21",
142
154
  "mdast-util-to-hast": "^10.2.0",
@@ -152,23 +164,25 @@
152
164
  "unified": "^9.2.0",
153
165
  "unist-util-visit": "^2.0.3",
154
166
  "vfile": "^4.2.0",
155
- "vfile-message": "^2.0.0",
156
- "decorator-transforms": "^1.0.3"
167
+ "vfile-message": "^2.0.0"
157
168
  },
158
169
  "peerDependencies": {
159
- "@glimmer/component": "^1.1.2",
170
+ "@glimmer/component": "^2.0.0",
160
171
  "@glimmer/tracking": "^1.1.2",
161
- "ember-auto-import": "^2.7.2",
172
+ "ember-auto-import": "^2.10.0",
173
+ "ember-basic-dropdown": "^8.5.0",
174
+ "ember-concurrency": "^4.0.2",
162
175
  "ember-focus-trap": "^1.1.0",
163
- "ember-source": "^3.28.0 || >=4.0.0",
164
- "moment": "^2.29.3",
165
- "@ember/string": "^3.1.1"
176
+ "ember-power-select": "^8.7.0",
177
+ "ember-source": ">= 4.0.0",
178
+ "@ember/string": "^4.0.0",
179
+ "moment": "^2.29.3"
166
180
  },
167
181
  "publishConfig": {
168
182
  "access": "public"
169
183
  },
170
184
  "engines": {
171
- "node": "12.* || 14.* || >= 16"
185
+ "node": ">= 18"
172
186
  },
173
187
  "ember": {
174
188
  "edition": "octane"
@@ -543,9 +557,12 @@
543
557
  },
544
558
  "scripts": {
545
559
  "build": "concurrently 'npm:build:*'",
546
- "build:js": "rollup --config ./rollup.config.mjs",
547
- "lint": "eslint . --cache",
548
- "lint:fix": "eslint . --fix",
560
+ "build:js": "rollup --config",
561
+ "build:types": "glint --declaration",
562
+ "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
563
+ "lint:css": "stylelint \"**/*.css\"",
564
+ "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
565
+ "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
549
566
  "lint:js": "eslint . --cache",
550
567
  "lint:js:fix": "eslint . --fix",
551
568
  "start": "concurrently 'npm:start:*'",
@@ -1,9 +0,0 @@
1
- declare const _default: import("ember-modifier").FunctionBasedModifier<{
2
- Args: {
3
- Positional: [boolean];
4
- Named: import("ember-modifier/-private/signature.js").EmptyObject;
5
- };
6
- Element: Element;
7
- }>;
8
- export default _default;
9
- //# sourceMappingURL=open-collapsible-nav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-collapsible-nav.d.ts","sourceRoot":"","sources":["../../src/modifiers/open-collapsible-nav.ts"],"names":[],"mappings":";;;;;;;AAIA,wBAuBG"}