@ember-eui/core 14.1.0 → 14.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/declarations/components/eui-accordion.d.ts.map +1 -1
  2. package/declarations/components/eui-aspect-ratio.d.ts.map +1 -1
  3. package/declarations/components/eui-auto-sizer.d.ts.map +1 -1
  4. package/declarations/components/eui-avatar.d.ts.map +1 -1
  5. package/declarations/components/eui-badge-group.d.ts.map +1 -1
  6. package/declarations/components/eui-badge.d.ts.map +1 -1
  7. package/declarations/components/eui-beacon.d.ts.map +1 -1
  8. package/declarations/components/eui-beta-badge.d.ts.map +1 -1
  9. package/declarations/components/eui-bottom-bar.d.ts.map +1 -1
  10. package/declarations/components/eui-breadcrumbs.d.ts.map +1 -1
  11. package/declarations/components/eui-button-content.d.ts.map +1 -1
  12. package/declarations/components/eui-button-empty.d.ts.map +1 -1
  13. package/declarations/components/eui-button-group-button.d.ts.map +1 -1
  14. package/declarations/components/eui-button-group.d.ts.map +1 -1
  15. package/declarations/components/eui-button-icon.d.ts.map +1 -1
  16. package/declarations/components/eui-button.d.ts +2 -1
  17. package/declarations/components/eui-button.d.ts.map +1 -1
  18. package/declarations/components/eui-call-out.d.ts.map +1 -1
  19. package/declarations/components/eui-card-select.d.ts.map +1 -1
  20. package/declarations/components/eui-card.d.ts.map +1 -1
  21. package/declarations/components/eui-checkable-card.d.ts.map +1 -1
  22. package/declarations/components/eui-checkbox-group.d.ts.map +1 -1
  23. package/declarations/components/eui-checkbox.d.ts.map +1 -1
  24. package/declarations/components/eui-code-block/controls.d.ts.map +1 -1
  25. package/declarations/components/eui-code-block/full-screen-display.d.ts.map +1 -1
  26. package/declarations/components/eui-code-block/virtualized.d.ts.map +1 -1
  27. package/declarations/components/eui-code-block.d.ts.map +1 -1
  28. package/declarations/components/eui-code.d.ts.map +1 -1
  29. package/declarations/components/eui-collapsible-nav-group.d.ts.map +1 -1
  30. package/declarations/components/eui-collapsible-nav.d.ts.map +1 -1
  31. package/declarations/components/eui-color-palette-display.d.ts.map +1 -1
  32. package/declarations/components/eui-color-palette-picker.d.ts.map +1 -1
  33. package/declarations/components/eui-color-picker-swatch.d.ts.map +1 -1
  34. package/declarations/components/eui-color-picker.d.ts.map +1 -1
  35. package/declarations/components/eui-color-stops/thumb.d.ts.map +1 -1
  36. package/declarations/components/eui-color-stops.d.ts.map +1 -1
  37. package/declarations/components/eui-combo-box/create-option.d.ts.map +1 -1
  38. package/declarations/components/eui-combo-box/group.d.ts.map +1 -1
  39. package/declarations/components/eui-combo-box/no-matches-message.d.ts.map +1 -1
  40. package/declarations/components/eui-combo-box/options.d.ts +4 -1
  41. package/declarations/components/eui-combo-box/options.d.ts.map +1 -1
  42. package/declarations/components/eui-combo-box/search-message.d.ts.map +1 -1
  43. package/declarations/components/eui-combo-box/trigger/input.d.ts.map +1 -1
  44. package/declarations/components/eui-combo-box/trigger.d.ts.map +1 -1
  45. package/declarations/components/eui-combo-box-pill.d.ts.map +1 -1
  46. package/declarations/components/eui-combo-box.d.ts.map +1 -1
  47. package/declarations/components/eui-comment-list.d.ts.map +1 -1
  48. package/declarations/components/eui-comment-timeline.d.ts.map +1 -1
  49. package/declarations/components/eui-comment.d.ts.map +1 -1
  50. package/declarations/components/eui-confirm-modal.d.ts.map +1 -1
  51. package/declarations/components/eui-context-menu-item.d.ts.map +1 -1
  52. package/declarations/components/eui-context-menu-panel.d.ts.map +1 -1
  53. package/declarations/components/eui-context-menu.d.ts.map +1 -1
  54. package/declarations/components/eui-control-bar.d.ts.map +1 -1
  55. package/declarations/components/eui-copy.d.ts.map +1 -1
  56. package/declarations/components/eui-date-picker-range.d.ts.map +1 -1
  57. package/declarations/components/eui-delay-hide.d.ts.map +1 -1
  58. package/declarations/components/eui-delay-render.d.ts.map +1 -1
  59. package/declarations/components/eui-described-form-group.d.ts.map +1 -1
  60. package/declarations/components/eui-description-list-description.d.ts.map +1 -1
  61. package/declarations/components/eui-description-list-title.d.ts.map +1 -1
  62. package/declarations/components/eui-description-list.d.ts.map +1 -1
  63. package/declarations/components/eui-drag-drop-context.d.ts.map +1 -1
  64. package/declarations/components/eui-draggable.d.ts +1 -1
  65. package/declarations/components/eui-draggable.d.ts.map +1 -1
  66. package/declarations/components/eui-droppable.d.ts.map +1 -1
  67. package/declarations/components/eui-dual-range.d.ts.map +1 -1
  68. package/declarations/components/eui-empty-prompt.d.ts.map +1 -1
  69. package/declarations/components/eui-expression.d.ts.map +1 -1
  70. package/declarations/components/eui-facet-button.d.ts.map +1 -1
  71. package/declarations/components/eui-facet-group.d.ts.map +1 -1
  72. package/declarations/components/eui-field-number.d.ts.map +1 -1
  73. package/declarations/components/eui-field-password.d.ts.map +1 -1
  74. package/declarations/components/eui-field-search.d.ts.map +1 -1
  75. package/declarations/components/eui-field-text.d.ts.map +1 -1
  76. package/declarations/components/eui-file-picker.d.ts.map +1 -1
  77. package/declarations/components/eui-filter-button.d.ts.map +1 -1
  78. package/declarations/components/eui-filter-group.d.ts.map +1 -1
  79. package/declarations/components/eui-filter-select-item.d.ts.map +1 -1
  80. package/declarations/components/eui-flex-grid.d.ts.map +1 -1
  81. package/declarations/components/eui-flex-group.d.ts.map +1 -1
  82. package/declarations/components/eui-flex-item.d.ts.map +1 -1
  83. package/declarations/components/eui-flyout-body.d.ts.map +1 -1
  84. package/declarations/components/eui-flyout-footer.d.ts.map +1 -1
  85. package/declarations/components/eui-flyout-header.d.ts.map +1 -1
  86. package/declarations/components/eui-flyout.d.ts.map +1 -1
  87. package/declarations/components/eui-form-control-layout-clear-button.d.ts.map +1 -1
  88. package/declarations/components/eui-form-control-layout-custom-icon.d.ts.map +1 -1
  89. package/declarations/components/eui-form-control-layout-delimited.d.ts.map +1 -1
  90. package/declarations/components/eui-form-control-layout-icons.d.ts.map +1 -1
  91. package/declarations/components/eui-form-control-layout.d.ts.map +1 -1
  92. package/declarations/components/eui-form-error-text.d.ts.map +1 -1
  93. package/declarations/components/eui-form-fieldset.d.ts.map +1 -1
  94. package/declarations/components/eui-form-help-text.d.ts.map +1 -1
  95. package/declarations/components/eui-form-label.d.ts.map +1 -1
  96. package/declarations/components/eui-form-legend.d.ts.map +1 -1
  97. package/declarations/components/eui-form-row.d.ts.map +1 -1
  98. package/declarations/components/eui-form.d.ts.map +1 -1
  99. package/declarations/components/eui-global-toast-list.d.ts.map +1 -1
  100. package/declarations/components/eui-header-alert.d.ts.map +1 -1
  101. package/declarations/components/eui-header-breadcrumbs.d.ts.map +1 -1
  102. package/declarations/components/eui-header-link.d.ts.map +1 -1
  103. package/declarations/components/eui-header-links.d.ts.map +1 -1
  104. package/declarations/components/eui-header-logo.d.ts.map +1 -1
  105. package/declarations/components/eui-header-section-item-button.d.ts.map +1 -1
  106. package/declarations/components/eui-header-section-item.d.ts.map +1 -1
  107. package/declarations/components/eui-header-section.d.ts.map +1 -1
  108. package/declarations/components/eui-header.d.ts.map +1 -1
  109. package/declarations/components/eui-health.d.ts.map +1 -1
  110. package/declarations/components/eui-hide-for.d.ts.map +1 -1
  111. package/declarations/components/eui-highlight.d.ts.map +1 -1
  112. package/declarations/components/eui-horizontal-rule.d.ts.map +1 -1
  113. package/declarations/components/eui-hue.d.ts.map +1 -1
  114. package/declarations/components/eui-i18n/render.d.ts.map +1 -1
  115. package/declarations/components/eui-i18n-number.d.ts.map +1 -1
  116. package/declarations/components/eui-i18n.d.ts.map +1 -1
  117. package/declarations/components/eui-icon-tip.d.ts.map +1 -1
  118. package/declarations/components/eui-icon.d.ts.map +1 -1
  119. package/declarations/components/eui-image.d.ts.map +1 -1
  120. package/declarations/components/eui-inner-text.d.ts.map +1 -1
  121. package/declarations/components/eui-input-popover.d.ts.map +1 -1
  122. package/declarations/components/eui-key-pad-menu-item.d.ts.map +1 -1
  123. package/declarations/components/eui-key-pad-menu.d.ts.map +1 -1
  124. package/declarations/components/eui-link.d.ts.map +1 -1
  125. package/declarations/components/eui-list-group-item.d.ts.map +1 -1
  126. package/declarations/components/eui-list-group.d.ts.map +1 -1
  127. package/declarations/components/eui-loading-chart.d.ts.map +1 -1
  128. package/declarations/components/eui-loading-content.d.ts.map +1 -1
  129. package/declarations/components/eui-loading-elastic.d.ts.map +1 -1
  130. package/declarations/components/eui-loading-logo.d.ts.map +1 -1
  131. package/declarations/components/eui-loading-spinner.d.ts.map +1 -1
  132. package/declarations/components/eui-mark.d.ts.map +1 -1
  133. package/declarations/components/eui-markdown-editor-drop-zone.d.ts.map +1 -1
  134. package/declarations/components/eui-markdown-editor-footer/icons/markdown-logo.d.ts.map +1 -1
  135. package/declarations/components/eui-markdown-editor-footer.d.ts.map +1 -1
  136. package/declarations/components/eui-markdown-editor-text-area.d.ts.map +1 -1
  137. package/declarations/components/eui-markdown-editor-toolbar/icons/markdown-checkmark.d.ts.map +1 -1
  138. package/declarations/components/eui-markdown-editor-toolbar.d.ts.map +1 -1
  139. package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
  140. package/declarations/components/eui-markdown-format/markdown-checkbox.d.ts.map +1 -1
  141. package/declarations/components/eui-markdown-format/markdown-code-block.d.ts.map +1 -1
  142. package/declarations/components/eui-markdown-format/markdown-code.d.ts.map +1 -1
  143. package/declarations/components/eui-markdown-format/markdown-tooltip.d.ts.map +1 -1
  144. package/declarations/components/eui-markdown-format.d.ts.map +1 -1
  145. package/declarations/components/eui-modal-body.d.ts.map +1 -1
  146. package/declarations/components/eui-modal-footer.d.ts.map +1 -1
  147. package/declarations/components/eui-modal-header-title.d.ts.map +1 -1
  148. package/declarations/components/eui-modal-header.d.ts.map +1 -1
  149. package/declarations/components/eui-modal.d.ts.map +1 -1
  150. package/declarations/components/eui-notification-badge.d.ts.map +1 -1
  151. package/declarations/components/eui-notification-event-messages.d.ts.map +1 -1
  152. package/declarations/components/eui-notification-event-meta.d.ts.map +1 -1
  153. package/declarations/components/eui-notification-event-read-button.d.ts.map +1 -1
  154. package/declarations/components/eui-notification-event-read-icon.d.ts.map +1 -1
  155. package/declarations/components/eui-notification-event.d.ts.map +1 -1
  156. package/declarations/components/eui-overlay-mask.d.ts.map +1 -1
  157. package/declarations/components/eui-page-body.d.ts.map +1 -1
  158. package/declarations/components/eui-page-content-body.d.ts.map +1 -1
  159. package/declarations/components/eui-page-content-header-section.d.ts.map +1 -1
  160. package/declarations/components/eui-page-content-header.d.ts.map +1 -1
  161. package/declarations/components/eui-page-content.d.ts.map +1 -1
  162. package/declarations/components/eui-page-header-content.d.ts.map +1 -1
  163. package/declarations/components/eui-page-header-section.d.ts.map +1 -1
  164. package/declarations/components/eui-page-header.d.ts.map +1 -1
  165. package/declarations/components/eui-page-side-bar.d.ts.map +1 -1
  166. package/declarations/components/eui-page-template.d.ts.map +1 -1
  167. package/declarations/components/eui-page.d.ts.map +1 -1
  168. package/declarations/components/eui-pagination/button-wrapper.d.ts.map +1 -1
  169. package/declarations/components/eui-pagination/next-button.d.ts.map +1 -1
  170. package/declarations/components/eui-pagination/previous-button.d.ts.map +1 -1
  171. package/declarations/components/eui-pagination-button.d.ts.map +1 -1
  172. package/declarations/components/eui-pagination.d.ts.map +1 -1
  173. package/declarations/components/eui-panel.d.ts.map +1 -1
  174. package/declarations/components/eui-pinnable-list-group.d.ts.map +1 -1
  175. package/declarations/components/eui-popover-footer.d.ts.map +1 -1
  176. package/declarations/components/eui-popover-title.d.ts.map +1 -1
  177. package/declarations/components/eui-popover.d.ts.map +1 -1
  178. package/declarations/components/eui-portal.d.ts.map +1 -1
  179. package/declarations/components/eui-progress.d.ts.map +1 -1
  180. package/declarations/components/eui-radio-group.d.ts.map +1 -1
  181. package/declarations/components/eui-radio.d.ts.map +1 -1
  182. package/declarations/components/eui-range-highlight.d.ts.map +1 -1
  183. package/declarations/components/eui-range-input.d.ts.map +1 -1
  184. package/declarations/components/eui-range-label.d.ts.map +1 -1
  185. package/declarations/components/eui-range-levels.d.ts.map +1 -1
  186. package/declarations/components/eui-range-slider.d.ts.map +1 -1
  187. package/declarations/components/eui-range-thumb.d.ts.map +1 -1
  188. package/declarations/components/eui-range-ticks.d.ts.map +1 -1
  189. package/declarations/components/eui-range-tooltip.d.ts.map +1 -1
  190. package/declarations/components/eui-range-track.d.ts.map +1 -1
  191. package/declarations/components/eui-range-wrapper.d.ts.map +1 -1
  192. package/declarations/components/eui-range.d.ts.map +1 -1
  193. package/declarations/components/eui-refresh-interval.d.ts.map +1 -1
  194. package/declarations/components/eui-resizable-container/button.d.ts.map +1 -1
  195. package/declarations/components/eui-resizable-container/collapse-button.d.ts.map +1 -1
  196. package/declarations/components/eui-resizable-container/panel.d.ts.map +1 -1
  197. package/declarations/components/eui-resizable-container.d.ts.map +1 -1
  198. package/declarations/components/eui-saturation.d.ts.map +1 -1
  199. package/declarations/components/eui-screen-reader-only.d.ts.map +1 -1
  200. package/declarations/components/eui-select.d.ts.map +1 -1
  201. package/declarations/components/eui-selectable-list-item.d.ts.map +1 -1
  202. package/declarations/components/eui-selectable-list.d.ts.map +1 -1
  203. package/declarations/components/eui-selectable-message.d.ts.map +1 -1
  204. package/declarations/components/eui-selectable-search.d.ts.map +1 -1
  205. package/declarations/components/eui-selectable-template-sitewide.d.ts.map +1 -1
  206. package/declarations/components/eui-selectable.d.ts.map +1 -1
  207. package/declarations/components/eui-show-for.d.ts.map +1 -1
  208. package/declarations/components/eui-side-nav-item/button.d.ts.map +1 -1
  209. package/declarations/components/eui-side-nav-item.d.ts.map +1 -1
  210. package/declarations/components/eui-side-nav.d.ts.map +1 -1
  211. package/declarations/components/eui-skip-link.d.ts.map +1 -1
  212. package/declarations/components/eui-spacer.d.ts.map +1 -1
  213. package/declarations/components/eui-split-panel/inner.d.ts.map +1 -1
  214. package/declarations/components/eui-split-panel/outer.d.ts.map +1 -1
  215. package/declarations/components/eui-stat/description.d.ts.map +1 -1
  216. package/declarations/components/eui-stat/title.d.ts.map +1 -1
  217. package/declarations/components/eui-stat.d.ts.map +1 -1
  218. package/declarations/components/eui-step-horizontal.d.ts.map +1 -1
  219. package/declarations/components/eui-step-number.d.ts.map +1 -1
  220. package/declarations/components/eui-step.d.ts.map +1 -1
  221. package/declarations/components/eui-steps-horizontal.d.ts.map +1 -1
  222. package/declarations/components/eui-steps.d.ts.map +1 -1
  223. package/declarations/components/eui-sub-steps.d.ts.map +1 -1
  224. package/declarations/components/eui-suggest-input.d.ts.map +1 -1
  225. package/declarations/components/eui-suggest-item.d.ts.map +1 -1
  226. package/declarations/components/eui-suggest.d.ts.map +1 -1
  227. package/declarations/components/eui-super-date-picker/date-popover/absolute-tab.d.ts.map +1 -1
  228. package/declarations/components/eui-super-date-picker/date-popover/datetime-picker.d.ts.map +1 -1
  229. package/declarations/components/eui-super-date-picker/date-popover/eui-date-popover-button.d.ts.map +1 -1
  230. package/declarations/components/eui-super-date-picker/date-popover/eui-date-popover-content.d.ts.map +1 -1
  231. package/declarations/components/eui-super-date-picker/date-popover/now-tab.d.ts.map +1 -1
  232. package/declarations/components/eui-super-date-picker/date-popover/relative-tab.d.ts.map +1 -1
  233. package/declarations/components/eui-super-date-picker/eui-date-picker-range.d.ts.map +1 -1
  234. package/declarations/components/eui-super-date-picker/eui-quick-select-popover/eui-commonly-used-time-ranges.d.ts.map +1 -1
  235. package/declarations/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.d.ts.map +1 -1
  236. package/declarations/components/eui-super-date-picker/eui-quick-select-popover/eui-recently-used.d.ts.map +1 -1
  237. package/declarations/components/eui-super-date-picker/eui-quick-select-popover.d.ts.map +1 -1
  238. package/declarations/components/eui-super-date-picker/eui-super-update-button.d.ts.map +1 -1
  239. package/declarations/components/eui-super-date-picker.d.ts.map +1 -1
  240. package/declarations/components/eui-super-select-control.d.ts.map +1 -1
  241. package/declarations/components/eui-super-select.d.ts.map +1 -1
  242. package/declarations/components/eui-switch.d.ts.map +1 -1
  243. package/declarations/components/eui-tab.d.ts.map +1 -1
  244. package/declarations/components/eui-tabbed-content.d.ts.map +1 -1
  245. package/declarations/components/eui-table-body.d.ts.map +1 -1
  246. package/declarations/components/eui-table-footer-cell.d.ts.map +1 -1
  247. package/declarations/components/eui-table-footer.d.ts.map +1 -1
  248. package/declarations/components/eui-table-header-button.d.ts.map +1 -1
  249. package/declarations/components/eui-table-header-cell-checkbox.d.ts.map +1 -1
  250. package/declarations/components/eui-table-header-cell.d.ts.map +1 -1
  251. package/declarations/components/eui-table-header-mobile.d.ts.map +1 -1
  252. package/declarations/components/eui-table-header.d.ts.map +1 -1
  253. package/declarations/components/eui-table-pagination.d.ts.map +1 -1
  254. package/declarations/components/eui-table-row-cell-checkbox.d.ts.map +1 -1
  255. package/declarations/components/eui-table-row-cell.d.ts.map +1 -1
  256. package/declarations/components/eui-table-row.d.ts.map +1 -1
  257. package/declarations/components/eui-table-sort-mobile-item.d.ts.map +1 -1
  258. package/declarations/components/eui-table-sort-mobile.d.ts.map +1 -1
  259. package/declarations/components/eui-table.d.ts.map +1 -1
  260. package/declarations/components/eui-tabs.d.ts.map +1 -1
  261. package/declarations/components/eui-text-align.d.ts.map +1 -1
  262. package/declarations/components/eui-text-area.d.ts.map +1 -1
  263. package/declarations/components/eui-text-color.d.ts.map +1 -1
  264. package/declarations/components/eui-text-diff.d.ts.map +1 -1
  265. package/declarations/components/eui-text.d.ts.map +1 -1
  266. package/declarations/components/eui-title.d.ts.map +1 -1
  267. package/declarations/components/eui-toast.d.ts.map +1 -1
  268. package/declarations/components/eui-token.d.ts.map +1 -1
  269. package/declarations/components/eui-tool-tip-popover.d.ts.map +1 -1
  270. package/declarations/components/eui-tool-tip.d.ts.map +1 -1
  271. package/declarations/components/eui-tour-step-indicator.d.ts.map +1 -1
  272. package/declarations/components/eui-tour-step.d.ts.map +1 -1
  273. package/declarations/components/eui-tour.d.ts.map +1 -1
  274. package/declarations/components/eui-tree-view.d.ts.map +1 -1
  275. package/declarations/components/eui-wrapping-popover.d.ts.map +1 -1
  276. package/declarations/components/text-block.d.ts.map +1 -1
  277. package/declarations/helpers/merge.d.ts +4 -3
  278. package/declarations/helpers/merge.d.ts.map +1 -1
  279. package/declarations/utils/markdown/markdown-actions.d.ts +1 -1
  280. package/dist/components/eui-badge.js +1 -1
  281. package/dist/components/eui-badge.js.map +1 -1
  282. package/dist/components/eui-button.js.map +1 -1
  283. package/dist/components/eui-card.js +1 -1
  284. package/dist/components/eui-card.js.map +1 -1
  285. package/dist/components/eui-combo-box/options.js +11 -15
  286. package/dist/components/eui-combo-box/options.js.map +1 -1
  287. package/dist/components/eui-file-picker.js +1 -1
  288. package/dist/components/eui-file-picker.js.map +1 -1
  289. package/dist/components/eui-flyout.js +1 -1
  290. package/dist/components/eui-flyout.js.map +1 -1
  291. package/dist/components/eui-form-label.js +1 -1
  292. package/dist/components/eui-form-label.js.map +1 -1
  293. package/dist/components/eui-icon.js +1 -1
  294. package/dist/components/eui-icon.js.map +1 -1
  295. package/dist/components/eui-link.js +4 -3
  296. package/dist/components/eui-link.js.map +1 -1
  297. package/dist/components/eui-markdown-editor-footer.js +1 -1
  298. package/dist/components/eui-markdown-editor-footer.js.map +1 -1
  299. package/dist/components/eui-range-thumb.js +1 -1
  300. package/dist/components/eui-range-thumb.js.map +1 -1
  301. package/dist/components/eui-tab.js +1 -1
  302. package/dist/components/eui-tab.js.map +1 -1
  303. package/dist/helpers/merge.js +2 -1
  304. package/dist/helpers/merge.js.map +1 -1
  305. package/dist/icons-CQELx6Ce.js.map +1 -1
  306. package/dist/styles/ember-eui.css +29 -2
  307. package/package.json +10 -10
@@ -1,3 +1,4 @@
1
+ import { cached } from '@glimmer/tracking';
1
2
  import { service } from '@ember/service';
2
3
  import { htmlSafe } from '@ember/template';
3
4
  import { VerticalCollection } from '@html-next/vertical-collection';
@@ -13,27 +14,22 @@ import EuiLoadingSpinner from '../eui-loading-spinner.js';
13
14
  import EuiTextComponent from '../eui-text.js';
14
15
  import { precompileTemplate } from '@ember/template-compilation';
15
16
  import { setComponentTemplate } from '@ember/component';
16
- import { g, i } from 'decorator-transforms/runtime-esm';
17
+ import { g, i, n } from 'decorator-transforms/runtime-esm';
17
18
 
18
19
  class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {
19
20
  static {
20
21
  g(this.prototype, "euiConfig", [service]);
21
22
  }
22
23
  #euiConfig = (i(this, "euiConfig"), void 0);
23
- _optionsCache = [];
24
+ /**
25
+ * Groups followed by their options, in one list (the rows of the
26
+ * virtualized list; `data-option-index` is an index in it).
27
+ */
24
28
  get flattedOptions() {
25
- if (this._optionsCache !== this.args.options) {
26
- this._optionsCache = this.args.options;
27
- return this.args.options?.reduce((acc, curr) => {
28
- if (emberPowerSelectIsGroup(curr)) {
29
- acc.push(curr, ...curr.options);
30
- } else {
31
- acc.push(curr);
32
- }
33
- return acc;
34
- }, []);
35
- }
36
- return this._optionsCache;
29
+ return (this.args.options ?? []).flatMap(option => emberPowerSelectIsGroup(option) ? [option, ...option.options] : [option]);
30
+ }
31
+ static {
32
+ n(this.prototype, "flattedOptions", [cached]);
37
33
  }
38
34
  _optionFromIndex(index) {
39
35
  const parts = index.split('.');
@@ -54,7 +50,7 @@ class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {
54
50
  return htmlSafe(`height:${this.rowHeight}px;`);
55
51
  }
56
52
  static {
57
- setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n{{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup @gutterSize=\"s\" @justifyContent=\"center\" @responsive={{false}}>\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{!-- template-lint-disable --}}\n <VerticalCollection @items={{this.flattedOptions}} @tagName=\"div\" @estimateHeight={{this.rowHeight}} @staticHeight={{true}} @bufferSize={{3}} style=\"overflow-y: auto;\" role=\"listbox\" aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\" class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}} {{this.setupHandlers}} ...attributes as |opt index|>\n {{!-- template-lint-enable --}}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group @group={{opt}} @select={{@select}} @extra={{@extra}} style={{this.rowHeightString}} data-option-index=\"{{index}}\" />\n {{else}}\n <button type=\"button\" style={{this.rowHeightString}} class=\"euiFilterSelectItem\n {{if (eq opt @select.highlighted) \" euiFilterSelectItem-isFocused\"}}\" aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\" aria-disabled={{if opt.disabled \"true\"}} aria-current=\"{{eq opt @select.highlighted}}\" data-option-index=\"{{index}}\" role=\"option\" tabindex={{if opt.disabled \"-1\" \"0\"}}>\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n {{!--template-lint-disable require-presentational-children--}}\n <EuiBadge class=\"euiComboBoxOption__enterBadge\" @color=\"hollow\" @iconType=\"returnKey\" aria-hidden=\"true\" />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n{{/let}}", {
53
+ setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck: not typesafe yet --}}\n{{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup @gutterSize=\"s\" @justifyContent=\"center\" @responsive={{false}}>\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{!-- template-lint-disable --}}\n <VerticalCollection @items={{this.flattedOptions}} @tagName=\"div\" @estimateHeight={{this.rowHeight}} @staticHeight={{true}} @bufferSize={{3}} style=\"overflow-y: auto;\" role=\"listbox\" aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\" class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}} {{this.setupHandlers}} ...attributes as |opt index|>\n {{!-- template-lint-enable --}}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group @group={{opt}} @select={{@select}} @extra={{@extra}} style={{this.rowHeightString}} />\n {{else}}\n <button type=\"button\" style={{this.rowHeightString}} class=\"euiFilterSelectItem\n {{if (eq opt @select.highlighted) \" euiFilterSelectItem-isFocused\"}}\" aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\" aria-disabled={{if opt.disabled \"true\"}} aria-current=\"{{eq opt @select.highlighted}}\" data-option-index=\"{{index}}\" role=\"option\" tabindex={{if opt.disabled \"-1\" \"0\"}}>\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n {{!--template-lint-disable require-presentational-children--}}\n <EuiBadge class=\"euiComboBoxOption__enterBadge\" @color=\"hollow\" @iconType=\"returnKey\" aria-hidden=\"true\" />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n{{/let}}", {
58
54
  strictMode: true,
59
55
  scope: () => ({
60
56
  EuiText: EuiTextComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\n//@ts-expect-error\nimport { VerticalCollection } from '@html-next/vertical-collection';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\nimport emberPowerSelectIsGroup from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport classNames from '../../helpers/class-names.ts';\nimport EuiBadge from '../eui-badge.gts';\nimport EuiFlexGroup from '../eui-flex-group.gts';\nimport EuiFlexItem from '../eui-flex-item.gts';\nimport EuiLoadingSpinner from '../eui-loading-spinner.gts';\nimport EuiText from '../eui-text.gts';\n\nimport type EuiConfigService from '../../services/eui-config';\n\n/**\n * @private EuiComboBox's options list: virtualized, with groups. Extends\n * ember-power-select's options component.\n */\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n _optionsCache: readonly unknown[] = [];\n\n get flattedOptions(): unknown[] {\n if (this._optionsCache !== this.args.options) {\n this._optionsCache = this.args.options;\n\n return this.args.options?.reduce<unknown[]>((acc, curr) => {\n if (emberPowerSelectIsGroup(curr)) {\n acc.push(curr, ...curr.options);\n } else {\n acc.push(curr);\n }\n\n return acc;\n }, []);\n }\n\n return this._optionsCache as unknown[];\n }\n\n _optionFromIndex(index: string) {\n const parts = index.split('.');\n let option: any = this.flattedOptions[parseInt(parts[0]!, 10)];\n\n for (let i = 1; i < parts.length; i++) {\n option = option.options[parseInt(parts[i]!, 10)];\n }\n\n return option;\n }\n\n get configRowHeight() {\n return (\n (this.euiConfig.getConfig('euiComboBoxOptionsHeight') as number) || 29\n );\n }\n\n get rowHeight() {\n //@ts-expect-error\n return this.args.rowHeight ?? this.configRowHeight;\n }\n\n get rowHeightString() {\n return htmlSafe(`height:${this.rowHeight}px;`);\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n {{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup\n @gutterSize=\"s\"\n @justifyContent=\"center\"\n @responsive={{false}}\n >\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{! template-lint-disable }}\n <VerticalCollection\n @items={{this.flattedOptions}}\n @tagName=\"div\"\n @estimateHeight={{this.rowHeight}}\n @staticHeight={{true}}\n @bufferSize={{3}}\n style=\"overflow-y: auto;\"\n role=\"listbox\"\n aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\"\n class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}}\n {{this.setupHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\n data-option-index=\"{{index}}\"\n />\n {{else}}\n <button\n type=\"button\"\n style={{this.rowHeightString}}\n class=\"euiFilterSelectItem\n {{if\n (eq opt @select.highlighted)\n ' euiFilterSelectItem-isFocused'\n }}\"\n aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\"\n aria-disabled={{if opt.disabled \"true\"}}\n aria-current=\"{{eq opt @select.highlighted}}\"\n data-option-index=\"{{index}}\"\n role=\"option\"\n tabindex={{if opt.disabled \"-1\" \"0\"}}\n >\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n {{!template-lint-disable require-presentational-children}}\n <EuiBadge\n class=\"euiComboBoxOption__enterBadge\"\n @color=\"hollow\"\n @iconType=\"returnKey\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiComboBoxOptionsComponent","EmberPowerSelectOptions","g","prototype","service","i","_optionsCache","flattedOptions","args","options","reduce","acc","curr","emberPowerSelectIsGroup","push","_optionFromIndex","index","parts","split","option","parseInt","length","configRowHeight","euiConfig","getConfig","rowHeight","rowHeightString","htmlSafe","setComponentTemplate","precompileTemplate","strictMode","scope","EuiText","EuiFlexGroup","EuiFlexItem","EuiLoadingSpinner","VerticalCollection","classNames","eq","emberPowerSelectIsEqual","and","not","EuiBadge"],"mapp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W,QAAA,CAASH,KAAK,CAACZ,CAAA,CAAE,EAAG,EAAA,CAAA,CAAI;AAClD,IAAA;AAEA,IAAA,OAAOc,MAAA;AACT,EAAA;EAEA,IAAIG,eAAAA,GAAkB;IACpB,OACG,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC,0BAAA,CAAA,IAA0C,EACtE;AACF,EAAA;EAEA,IAAIC,SAAAA,GAAY;AACd;IACA,OAAO,IAAI,CAACjB,IAAI,CAACiB,SAAS,IAAI,IAAI,CAACH,eAAe;AACpD,EAAA;EAEA,IAAII,eAAAA,GAAkB;AACpB,IAAA,OAAOC,QAAA,CAAS,CAAA,OAAA,EAAU,IAAI,CAACF,SAAS,KAAK,CAAA;AAC/C,EAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,qpEAAA,EA8EA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAC,WAAA;QAAAC,iBAAA;QAAAC,kBAAA;QAAAC,UAAA;QAAAxB,uBAAA;QAAAyB,EAAA;QAAAC,uBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"options.js","sources":["../../../src/components/eui-combo-box/options.gts"],"sourcesContent":["import { cached } from '@glimmer/tracking';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\n//@ts-expect-error\nimport { VerticalCollection } from '@html-next/vertical-collection';\nimport EmberPowerSelectOptions from 'ember-power-select/components/power-select/options';\nimport emberPowerSelectIsEqual from 'ember-power-select/helpers/ember-power-select-is-equal';\nimport emberPowerSelectIsGroup from 'ember-power-select/helpers/ember-power-select-is-group';\nimport { and, eq, not } from 'ember-truth-helpers';\n\nimport classNames from '../../helpers/class-names.ts';\nimport EuiBadge from '../eui-badge.gts';\nimport EuiFlexGroup from '../eui-flex-group.gts';\nimport EuiFlexItem from '../eui-flex-item.gts';\nimport EuiLoadingSpinner from '../eui-loading-spinner.gts';\nimport EuiText from '../eui-text.gts';\n\nimport type EuiConfigService from '../../services/eui-config';\n\n/**\n * @private EuiComboBox's options list: virtualized, with groups. Extends\n * ember-power-select's options component.\n */\nexport default class EuiComboBoxOptionsComponent extends EmberPowerSelectOptions {\n @service declare euiConfig: EuiConfigService;\n\n /**\n * Groups followed by their options, in one list (the rows of the\n * virtualized list; `data-option-index` is an index in it).\n */\n @cached\n get flattedOptions(): unknown[] {\n return (this.args.options ?? []).flatMap((option) =>\n emberPowerSelectIsGroup(option) ? [option, ...option.options] : [option]\n );\n }\n\n _optionFromIndex(index: string) {\n const parts = index.split('.');\n let option: any = this.flattedOptions[parseInt(parts[0]!, 10)];\n\n for (let i = 1; i < parts.length; i++) {\n option = option.options[parseInt(parts[i]!, 10)];\n }\n\n return option;\n }\n\n get configRowHeight() {\n return (\n (this.euiConfig.getConfig('euiComboBoxOptionsHeight') as number) || 29\n );\n }\n\n get rowHeight() {\n //@ts-expect-error\n return this.args.rowHeight ?? this.configRowHeight;\n }\n\n get rowHeightString() {\n return htmlSafe(`height:${this.rowHeight}px;`);\n }\n\n <template>\n {{! @glint-nocheck: not typesafe yet }}\n {{#let (component @groupComponent) as |Group|}}\n {{#if @select.loading}}\n <EuiText @size=\"xs\" class=\"euiComboBoxOptionsList__empty\">\n <EuiFlexGroup\n @gutterSize=\"s\"\n @justifyContent=\"center\"\n @responsive={{false}}\n >\n <EuiFlexItem @grow={{false}}>\n <EuiLoadingSpinner @size=\"m\" />\n </EuiFlexItem>\n <EuiFlexItem @grow={{false}}>\n {{@loadingMessage}}\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiText>\n {{else}}\n {{! template-lint-disable }}\n <VerticalCollection\n @items={{this.flattedOptions}}\n @tagName=\"div\"\n @estimateHeight={{this.rowHeight}}\n @staticHeight={{true}}\n @bufferSize={{3}}\n style=\"overflow-y: auto;\"\n role=\"listbox\"\n aria-controls=\"ember-power-select-trigger-{{@select.uniqueId}}\"\n class={{classNames \"euiComboBoxOptionsList__rowWrap\" @class}}\n {{this.setupHandlers}}\n ...attributes\n as |opt index|\n >\n {{! template-lint-enable }}\n {{#if (emberPowerSelectIsGroup opt)}}\n <Group\n @group={{opt}}\n @select={{@select}}\n @extra={{@extra}}\n style={{this.rowHeightString}}\n />\n {{else}}\n <button\n type=\"button\"\n style={{this.rowHeightString}}\n class=\"euiFilterSelectItem\n {{if\n (eq opt @select.highlighted)\n ' euiFilterSelectItem-isFocused'\n }}\"\n aria-selected=\"{{emberPowerSelectIsEqual opt @select.selected}}\"\n aria-disabled={{if opt.disabled \"true\"}}\n aria-current=\"{{eq opt @select.highlighted}}\"\n data-option-index=\"{{index}}\"\n role=\"option\"\n tabindex={{if opt.disabled \"-1\" \"0\"}}\n >\n <span class=\"euiComboBoxOption__contentWrapper\">\n <span class=\"euiComboBoxOption__content\">\n {{yield opt index @select}}\n </span>\n {{#if (and (eq opt @select.highlighted) (not opt.disabled))}}\n {{!template-lint-disable require-presentational-children}}\n <EuiBadge\n class=\"euiComboBoxOption__enterBadge\"\n @color=\"hollow\"\n @iconType=\"returnKey\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </span>\n </button>\n {{/if}}\n </VerticalCollection>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiComboBoxOptionsComponent","EmberPowerSelectOptions","g","prototype","service","i","flattedOptions","args","options","flatMap","option","emberPowerSelectIsGroup","n","cached","_optionFromIndex","index","parts","split","parseInt","length","configRowHeight","euiConfig","getConfig","rowHeight","rowHeightString","htmlSafe","setComponentTemplate","precompileTemplate","strictMode","scope","EuiText","EuiFlexGroup","EuiFlexItem","EuiLoadingSpinner","VerticalCollection","classNames","eq","emberPowerSelectIsEqual","and","not","EuiBadge"],"mappings":";;;;;;;;;;;;;;;;;;AAwBe,MAAMA,2BAAA,SAAoCC,uBAAA,CAAA;AAAA,EAAA;IAAAC,CAAA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GAAkB;AACpB,IAAA,OAAOC,QAAA,CAAS,CAAA,OAAA,EAAU,IAAI,CAACF,SAAS,KAAK,CAAA;AAC/C,EAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,qnEAAA,EA6EA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAC,WAAA;QAAAC,iBAAA;QAAAC,kBAAA;QAAAC,UAAA;QAAAxB,uBAAA;QAAAyB,EAAA;QAAAC,uBAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -112,7 +112,7 @@ class EuiFilePickerComponent extends Component {
112
112
  this.fileInput = null;
113
113
  }
114
114
  static {
115
- setComponentTemplate(precompileTemplate("{{#let (classNames (if @compressed \"euiFilePicker--compressed\") (if @fullWidth \"euiFilePicker--fullWidth\") (if @isInvalid \"euiFilePicker--isInvalid\") (if @isLoading \"euiFilePicker--isLoading\") display=this.display componentName=\"EuiFilePicker\") (argOrDefault @id (randomId)) as |classes inputId|}}\n {{#let (if inputId (concat inputId \"-filePicker__prompt\") (randomId)) (notEq this.promptText null) (eq this.display \"default\") as |promptId isOverridingInitialPrompt normalFormControl|}}\n <div class={{classNames classes (if this.isHoveringDrop \"euiFilePicker__showDrop\") (if isOverridingInitialPrompt \"euiFilePicker--hasFiles\")}}>\n <div class=\"euiFilePicker__wrap\">\n <input type=\"file\" id={{inputId}} name={{@name}} class=\"euiFilePicker__input\" disabled={{@disabled}} aria-describedby={{promptId}} multiple={{@multiple}} {{on \"dragover\" this.showDrop}} {{on \"dragleave\" this.hideDrop}} {{on \"drop\" this.hideDrop}} {{on \"change\" this.handleChange}} {{didInsert this.didInsertInput}} {{validatableControl @isInvalid}} ...attributes />\n <div class=\"euiFilePicker__prompt\" id={{promptId}}>\n <EuiIcon @iconClasses=\"euiFilePicker__icon\" @type=\"importAction\" @size={{if true \"m\" \"l\"}} aria-hidden=\"true\" />\n <div class=\"euiFilePicker__promptText\">\n {{if this.promptText this.promptText this.initialPromptText}}\n </div>\n {{#if (and @isLoading normalFormControl)}}\n <EuiLoadingSpinner class=\"euiFilePicker__loadingSpinner\" />\n {{else if isOverridingInitialPrompt}}\n {{#if normalFormControl}}\n <button type=\"button\" aria-label=\"Clear selected files\" class=\"euiFilePicker__clearButton\" {{on \"click\" this.removeFiles}}>\n <EuiIcon @iconClasses=\"euiFilePicker__clearIcon\" @type=\"cross\" />\n </button>\n {{else}}\n <EuiButtonEmpty aria-label=\"Clear selected files\" class=\"euiFilePicker__clearButton\" @size=\"xs\" {{on \"click\" this.removeFiles}}>\n <EuiI18n @token=\"euiFilePicker.removeFiles\" @default=\"Remove\" as |Token|>\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </EuiButtonEmpty>\n {{/if}}\n {{/if}}\n {{#if (and (not normalFormControl) @isLoading)}}\n <EuiProgress @size=\"xs\" @color=\"accent\" position=\"absolute\" />\n {{/if}}\n </div>\n </div>\n </div>\n {{/let}}\n{{/let}}", {
115
+ setComponentTemplate(precompileTemplate("{{#let (classNames (if @compressed \"euiFilePicker--compressed\") (if @fullWidth \"euiFilePicker--fullWidth\") (if @isInvalid \"euiFilePicker--isInvalid\") (if @isLoading \"euiFilePicker--isLoading\") display=this.display componentName=\"EuiFilePicker\") (argOrDefault @id (randomId)) as |classes inputId|}}\n {{#let (if inputId (concat inputId \"-filePicker__prompt\") (randomId)) (notEq this.promptText null) (eq this.display \"default\") as |promptId isOverridingInitialPrompt normalFormControl|}}\n <div class={{classNames classes (if this.isHoveringDrop \"euiFilePicker__showDrop\") (if isOverridingInitialPrompt \"euiFilePicker--hasFiles\")}}>\n <div class=\"euiFilePicker__wrap\">\n <input type=\"file\" id={{inputId}} name={{@name}} class=\"euiFilePicker__input\" disabled={{@disabled}} aria-describedby={{promptId}} multiple={{@multiple}} {{on \"dragover\" this.showDrop}} {{on \"dragleave\" this.hideDrop}} {{on \"drop\" this.hideDrop}} {{on \"change\" this.handleChange}} {{didInsert this.didInsertInput}} {{validatableControl @isInvalid}} ...attributes />\n <div class=\"euiFilePicker__prompt\" id={{promptId}}>\n <EuiIcon @iconClasses=\"euiFilePicker__icon\" @type=\"importAction\" @size={{if true \"m\" \"l\"}} aria-hidden=\"true\" />\n <div class=\"euiFilePicker__promptText\">\n {{if this.promptText this.promptText this.initialPromptText}}\n </div>\n {{#if (and @isLoading normalFormControl)}}\n <EuiLoadingSpinner class=\"euiFilePicker__loadingSpinner\" />\n {{else if isOverridingInitialPrompt}}\n {{#if normalFormControl}}\n <button type=\"button\" aria-label=\"Clear selected files\" class=\"euiFilePicker__clearButton\" {{on \"click\" this.removeFiles}}>\n <EuiIcon @iconClasses=\"euiFilePicker__clearIcon\" @type=\"cross\" />\n </button>\n {{else}}\n <EuiButtonEmpty aria-label=\"Clear selected files\" class=\"euiFilePicker__clearButton\" @size=\"xs\" {{on \"click\" this.removeFiles}}>\n <EuiI18n @token=\"euiFilePicker.removeFiles\" @default=\"Remove\" as |Token|>\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </EuiButtonEmpty>\n {{/if}}\n {{/if}}\n {{#if (and (not normalFormControl) @isLoading)}}\n <EuiProgress @size=\"xs\" @color=\"accent\" @position=\"absolute\" />\n {{/if}}\n </div>\n </div>\n </div>\n {{/let}}\n{{/let}}", {
116
116
  strictMode: true,
117
117
  scope: () => ({
118
118
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-file-picker.js","sources":["../../src/components/eui-file-picker.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport { and, eq, not, notEq } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault, { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiI18n from './eui-i18n.gts';\nimport EuiIcon from './eui-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiProgress from './eui-progress.gts';\n\nimport type { displayMapping } from '../utils/css-mappings/eui-file-picker.ts';\n\nexport type EuiFilePickerDisplay = keyof typeof displayMapping;\n\n/**\n * You can find more typing on the template\n */\ntype EuiFilePicker = {\n /** Id of the file input. Defaults to a random id. */\n id?: string;\n /** `name` of the file input, for forms. */\n name?: string;\n /** @deprecated Has no effect, use `class=`. */\n class?: string;\n /**\n * The content that appears in the dropzone if no file is attached.\n * Defaults to \"Select or drag and drop a file\".\n */\n initialPromptText?: Component | string | null;\n /**\n * Called with the selected files (a `FileList`) when they change,\n * including when they are removed (an empty list).\n */\n onChange?: (files: FileList | null) => void;\n /**\n * Reduces the size to a typical (compressed) input\n */\n compressed?: boolean;\n /**\n * Size or type of display;\n * `default` for normal height, similar to other controls;\n * `large` for taller size\n */\n display?: EuiFilePickerDisplay;\n /** Stretches the picker to its container's width. */\n fullWidth?: boolean;\n /** Shows the invalid state and marks the input invalid for native form validation. */\n isInvalid?: boolean;\n /** Shows a spinner. */\n isLoading?: boolean;\n /** Disables the picker. */\n disabled?: boolean;\n /** Allows selecting several files. */\n multiple?: boolean;\n\n /**\n * Called with the component instance, e.g. to call its `removeFiles()`\n * action and reset the picker.\n */\n ref?: (c: typeof EuiFilePickerComponent) => void;\n};\n\n/**\n * A file input styled as a drop zone. Attributes such as `accept` go to the\n * `<input type=\"file\">`.\n */\nexport interface EuiFilePickerSignature {\n Element: HTMLInputElement;\n Args: EuiFilePicker;\n Blocks: {\n /** Unused. */\n default: [];\n };\n}\n\nexport default class EuiFilePickerComponent extends Component<EuiFilePickerSignature> {\n @tracked fileInput: HTMLInputElement | null = null;\n @tracked promptText: string | null | undefined = null;\n @tracked isHoveringDrop = false;\n\n @argOrDefaultDecorator('Select or drag and drop a file') initialPromptText!:\n | Component\n | string\n | null;\n\n @argOrDefaultDecorator(false) compressed!: boolean;\n @argOrDefaultDecorator('') display!: string;\n\n @action\n showDrop(): void {\n if (!this.args.disabled) {\n this.isHoveringDrop = true;\n }\n }\n\n @action\n hideDrop(): void {\n this.isHoveringDrop = false;\n }\n\n @action\n handleChange(): void {\n if (!this.fileInput) return;\n\n if (this.fileInput.files && this.fileInput.files.length > 1) {\n this.promptText = `${this.fileInput.files.length} files selected`;\n // TODO: Change when EuiI18n is available\n // <EuiI18n\n // token=\"euiFilePicker.filesSelected\"\n // default=\"{fileCount} files selected\"\n // values={{ fileCount: this.fileInput.files.length }}\n // />\n } else if (this.fileInput.files && this.fileInput.files.length === 0) {\n this.promptText = null;\n } else {\n this.promptText = this.fileInput.value.split('\\\\').pop();\n }\n\n const { onChange } = this.args;\n\n if (onChange) {\n onChange(this.fileInput.files);\n }\n }\n\n @action\n removeFiles(e?: MouseEvent): void {\n if (e) {\n e.stopPropagation();\n e.preventDefault();\n }\n\n if (!this.fileInput) return;\n\n this.fileInput.value = '';\n this.handleChange();\n }\n\n @action\n didInsertInput(inputRef: HTMLInputElement): void {\n this.fileInput = inputRef;\n this.args.ref?.(this as any as typeof EuiFilePickerComponent);\n }\n\n willDestroy(): void {\n super.willDestroy();\n\n this.fileInput = null;\n }\n\n <template>\n {{#let\n (classNames\n (if @compressed \"euiFilePicker--compressed\")\n (if @fullWidth \"euiFilePicker--fullWidth\")\n (if @isInvalid \"euiFilePicker--isInvalid\")\n (if @isLoading \"euiFilePicker--isLoading\")\n display=this.display\n componentName=\"EuiFilePicker\"\n )\n (argOrDefault @id (randomId))\n as |classes inputId|\n }}\n {{#let\n (if inputId (concat inputId \"-filePicker__prompt\") (randomId))\n (notEq this.promptText null)\n (eq this.display \"default\")\n as |promptId isOverridingInitialPrompt normalFormControl|\n }}\n <div\n class={{classNames\n classes\n (if this.isHoveringDrop \"euiFilePicker__showDrop\")\n (if isOverridingInitialPrompt \"euiFilePicker--hasFiles\")\n }}\n >\n <div class=\"euiFilePicker__wrap\">\n <input\n type=\"file\"\n id={{inputId}}\n name={{@name}}\n class=\"euiFilePicker__input\"\n disabled={{@disabled}}\n aria-describedby={{promptId}}\n multiple={{@multiple}}\n {{on \"dragover\" this.showDrop}}\n {{on \"dragleave\" this.hideDrop}}\n {{on \"drop\" this.hideDrop}}\n {{on \"change\" this.handleChange}}\n {{didInsert this.didInsertInput}}\n {{validatableControl @isInvalid}}\n ...attributes\n />\n <div class=\"euiFilePicker__prompt\" id={{promptId}}>\n <EuiIcon\n @iconClasses=\"euiFilePicker__icon\"\n @type=\"importAction\"\n @size={{if true \"m\" \"l\"}}\n aria-hidden=\"true\"\n />\n <div class=\"euiFilePicker__promptText\">\n {{if this.promptText this.promptText this.initialPromptText}}\n </div>\n {{#if (and @isLoading normalFormControl)}}\n <EuiLoadingSpinner class=\"euiFilePicker__loadingSpinner\" />\n {{else if isOverridingInitialPrompt}}\n {{#if normalFormControl}}\n <button\n type=\"button\"\n aria-label=\"Clear selected files\"\n class=\"euiFilePicker__clearButton\"\n {{on \"click\" this.removeFiles}}\n >\n <EuiIcon\n @iconClasses=\"euiFilePicker__clearIcon\"\n @type=\"cross\"\n />\n </button>\n {{else}}\n <EuiButtonEmpty\n aria-label=\"Clear selected files\"\n class=\"euiFilePicker__clearButton\"\n @size=\"xs\"\n {{on \"click\" this.removeFiles}}\n >\n <EuiI18n\n @token=\"euiFilePicker.removeFiles\"\n @default=\"Remove\"\n as |Token|\n >\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </EuiButtonEmpty>\n {{/if}}\n {{/if}}\n {{#if (and (not normalFormControl) @isLoading)}}\n <EuiProgress @size=\"xs\" @color=\"accent\" position=\"absolute\" />\n {{/if}}\n </div>\n </div>\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n"],"names":["EuiFilePickerComponent","Component","g","prototype","tracked","i","argOrDefaultDecorator","showDrop","args","disabled","isHoveringDrop","n","action","hideDrop","handleChange","fileInput","files","length","promptText","value","split","pop","onChange","removeFiles","e","stopPropagation","preventDefault","didInsertInput","inputRef","ref","willDestroy","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","argOrDefault","randomId","concat","notEq","eq","on","didInsert","validatableControl","EuiIcon","and","EuiLoadingSpinner","EuiButtonEmpty","EuiI18n","not","EuiProgress"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoFe,MAAMA,+BAA+BC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAC3DC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAA6C,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,YAAA,EAAA,CAC7CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAgD,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,WAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,YAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,gBAAA,EAAA,CAChDC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAyB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,eAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,gBAAA,CAAA,EAAA,MAAA;AAAA,EAAA;AAAAH,IAAAA,CAAA,MAAAC,SAAA,EAAA,mBAAA,EAAA,CAEzBG,qBAAA,CAAsB,gCAAA,CAAA,CAAA,CAAA;AAAA;EAAA,kBAAA,IAAAD,CAAA,CAAA,IAAA,EAAA,mBAAA,CAAA,EAAA,MAAA;AAAA,EAA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BAAA,CAAAC,kBAAA,CAAA,oiFAAA,EA+FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,MAAA;QAAAC,KAAA;QAAAC,EAAA;QAAAC,EAAA;QAAAC,SAAA;QAAAC,kBAAA;QAAAC,OAAA;QAAAC,GAAA;QAAAC,iBAAA;QAAAC,cAAA;iBAAAC,gBAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"eui-file-picker.js","sources":["../../src/components/eui-file-picker.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\n\nimport { and, eq, not, notEq } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\nimport argOrDefault, { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport validatableControl from '../modifiers/validatable-control.ts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiI18n from './eui-i18n.gts';\nimport EuiIcon from './eui-icon.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiProgress from './eui-progress.gts';\n\nimport type { displayMapping } from '../utils/css-mappings/eui-file-picker.ts';\n\nexport type EuiFilePickerDisplay = keyof typeof displayMapping;\n\n/**\n * You can find more typing on the template\n */\ntype EuiFilePicker = {\n /** Id of the file input. Defaults to a random id. */\n id?: string;\n /** `name` of the file input, for forms. */\n name?: string;\n /** @deprecated Has no effect, use `class=`. */\n class?: string;\n /**\n * The content that appears in the dropzone if no file is attached.\n * Defaults to \"Select or drag and drop a file\".\n */\n initialPromptText?: Component | string | null;\n /**\n * Called with the selected files (a `FileList`) when they change,\n * including when they are removed (an empty list).\n */\n onChange?: (files: FileList | null) => void;\n /**\n * Reduces the size to a typical (compressed) input\n */\n compressed?: boolean;\n /**\n * Size or type of display;\n * `default` for normal height, similar to other controls;\n * `large` for taller size\n */\n display?: EuiFilePickerDisplay;\n /** Stretches the picker to its container's width. */\n fullWidth?: boolean;\n /** Shows the invalid state and marks the input invalid for native form validation. */\n isInvalid?: boolean;\n /** Shows a spinner. */\n isLoading?: boolean;\n /** Disables the picker. */\n disabled?: boolean;\n /** Allows selecting several files. */\n multiple?: boolean;\n\n /**\n * Called with the component instance, e.g. to call its `removeFiles()`\n * action and reset the picker.\n */\n ref?: (c: typeof EuiFilePickerComponent) => void;\n};\n\n/**\n * A file input styled as a drop zone. Attributes such as `accept` go to the\n * `<input type=\"file\">`.\n */\nexport interface EuiFilePickerSignature {\n Element: HTMLInputElement;\n Args: EuiFilePicker;\n Blocks: {\n /** Unused. */\n default: [];\n };\n}\n\nexport default class EuiFilePickerComponent extends Component<EuiFilePickerSignature> {\n @tracked fileInput: HTMLInputElement | null = null;\n @tracked promptText: string | null | undefined = null;\n @tracked isHoveringDrop = false;\n\n @argOrDefaultDecorator('Select or drag and drop a file') initialPromptText!:\n | Component\n | string\n | null;\n\n @argOrDefaultDecorator(false) compressed!: boolean;\n @argOrDefaultDecorator('') display!: string;\n\n @action\n showDrop(): void {\n if (!this.args.disabled) {\n this.isHoveringDrop = true;\n }\n }\n\n @action\n hideDrop(): void {\n this.isHoveringDrop = false;\n }\n\n @action\n handleChange(): void {\n if (!this.fileInput) return;\n\n if (this.fileInput.files && this.fileInput.files.length > 1) {\n this.promptText = `${this.fileInput.files.length} files selected`;\n // TODO: Change when EuiI18n is available\n // <EuiI18n\n // token=\"euiFilePicker.filesSelected\"\n // default=\"{fileCount} files selected\"\n // values={{ fileCount: this.fileInput.files.length }}\n // />\n } else if (this.fileInput.files && this.fileInput.files.length === 0) {\n this.promptText = null;\n } else {\n this.promptText = this.fileInput.value.split('\\\\').pop();\n }\n\n const { onChange } = this.args;\n\n if (onChange) {\n onChange(this.fileInput.files);\n }\n }\n\n @action\n removeFiles(e?: MouseEvent): void {\n if (e) {\n e.stopPropagation();\n e.preventDefault();\n }\n\n if (!this.fileInput) return;\n\n this.fileInput.value = '';\n this.handleChange();\n }\n\n @action\n didInsertInput(inputRef: HTMLInputElement): void {\n this.fileInput = inputRef;\n this.args.ref?.(this as any as typeof EuiFilePickerComponent);\n }\n\n willDestroy(): void {\n super.willDestroy();\n\n this.fileInput = null;\n }\n\n <template>\n {{#let\n (classNames\n (if @compressed \"euiFilePicker--compressed\")\n (if @fullWidth \"euiFilePicker--fullWidth\")\n (if @isInvalid \"euiFilePicker--isInvalid\")\n (if @isLoading \"euiFilePicker--isLoading\")\n display=this.display\n componentName=\"EuiFilePicker\"\n )\n (argOrDefault @id (randomId))\n as |classes inputId|\n }}\n {{#let\n (if inputId (concat inputId \"-filePicker__prompt\") (randomId))\n (notEq this.promptText null)\n (eq this.display \"default\")\n as |promptId isOverridingInitialPrompt normalFormControl|\n }}\n <div\n class={{classNames\n classes\n (if this.isHoveringDrop \"euiFilePicker__showDrop\")\n (if isOverridingInitialPrompt \"euiFilePicker--hasFiles\")\n }}\n >\n <div class=\"euiFilePicker__wrap\">\n <input\n type=\"file\"\n id={{inputId}}\n name={{@name}}\n class=\"euiFilePicker__input\"\n disabled={{@disabled}}\n aria-describedby={{promptId}}\n multiple={{@multiple}}\n {{on \"dragover\" this.showDrop}}\n {{on \"dragleave\" this.hideDrop}}\n {{on \"drop\" this.hideDrop}}\n {{on \"change\" this.handleChange}}\n {{didInsert this.didInsertInput}}\n {{validatableControl @isInvalid}}\n ...attributes\n />\n <div class=\"euiFilePicker__prompt\" id={{promptId}}>\n <EuiIcon\n @iconClasses=\"euiFilePicker__icon\"\n @type=\"importAction\"\n @size={{if true \"m\" \"l\"}}\n aria-hidden=\"true\"\n />\n <div class=\"euiFilePicker__promptText\">\n {{if this.promptText this.promptText this.initialPromptText}}\n </div>\n {{#if (and @isLoading normalFormControl)}}\n <EuiLoadingSpinner class=\"euiFilePicker__loadingSpinner\" />\n {{else if isOverridingInitialPrompt}}\n {{#if normalFormControl}}\n <button\n type=\"button\"\n aria-label=\"Clear selected files\"\n class=\"euiFilePicker__clearButton\"\n {{on \"click\" this.removeFiles}}\n >\n <EuiIcon\n @iconClasses=\"euiFilePicker__clearIcon\"\n @type=\"cross\"\n />\n </button>\n {{else}}\n <EuiButtonEmpty\n aria-label=\"Clear selected files\"\n class=\"euiFilePicker__clearButton\"\n @size=\"xs\"\n {{on \"click\" this.removeFiles}}\n >\n <EuiI18n\n @token=\"euiFilePicker.removeFiles\"\n @default=\"Remove\"\n as |Token|\n >\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </EuiButtonEmpty>\n {{/if}}\n {{/if}}\n {{#if (and (not normalFormControl) @isLoading)}}\n <EuiProgress @size=\"xs\" @color=\"accent\" @position=\"absolute\" />\n {{/if}}\n </div>\n </div>\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n"],"names":["EuiFilePickerComponent","Component","g","prototype","tracked","i","argOrDefaultDecorator","showDrop","args","disabled","isHoveringDrop","n","action","hideDrop","handleChange","fileInput","files","length","promptText","value","split","pop","onChange","removeFiles","e","stopPropagation","preventDefault","didInsertInput","inputRef","ref","willDestroy","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","argOrDefault","randomId","concat","notEq","eq","on","didInsert","validatableControl","EuiIcon","and","EuiLoadingSpinner","EuiButtonEmpty","EuiI18n","not","EuiProgress"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoFe,MAAMA,+BAA+BC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAC3DC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAA6C,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA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EE,cAAc,EAAA;AAClB,IAAA;AAEA,IAAA,IAAI,CAAC,IAAI,CAACX,SAAS,EAAE;AAErB,IAAA,IAAI,CAACA,SAAS,CAACI,KAAK,GAAG,EAAA;IACvB,IAAI,CAACL,YAAY,EAAA;AACnB,EAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAR,SAAA,EAAA,aAAA,EAAA,CAXCS,MAAA,CAAA,CAAA;AAAA;EAcDe,cAAAA,CAAeC,QAA0B,EAAQ;IAC/C,IAAI,CAACb,SAAS,GAAGa,QAAA;AACjB,IAAA,IAAI,CAACpB,IAAI,CAACqB,GAAG,GAAG,IAAsB,CAAA;AACxC,EAAA;AAAA,EAAA;IAAAlB,CAAA,CAAA,IAAA,CAAAR,SAAA,EAAA,gBAAA,EAAA,CAJCS,MAAA,CAAA,CAAA;AAAA;AAMDkB,EAAAA,WAAAA,GAAoB;IAClB,KAAK,CAACA,WAAA,EAAA;IAEN,IAAI,CAACf,SAAS,GAAG,IAAA;AACnB,EAAA;AAEA,EAAA;IAAAgB,oBAAA,CAAAC,kBAAA,CAAA,qiFAAA,EA+FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,MAAA;QAAAC,KAAA;QAAAC,EAAA;QAAAC,EAAA;QAAAC,SAAA;QAAAC,kBAAA;QAAAC,OAAA;QAAAC,GAAA;QAAAC,iBAAA;QAAAC,cAAA;iBAAAC,gBAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -168,7 +168,7 @@ class EuiFlyoutComponent extends Component {
168
168
  n(this.prototype, "onResize", [action]);
169
169
  }
170
170
  static {
171
- setComponentTemplate(precompileTemplate("{{#let (classNames (if (eq this.maxWidth true) \"euiFlyout--maxWidth-default\") componentName=\"EuiFlyout\" type=this.type side=this.side size=this.size padding=this.paddingSize) (classNames \"euiFlyout__closeButton\" (concat \"euiFlyout__closeButton--\" this.closeButtonPosition) (or @closeButtonProps.className @closeButtonProps.classes)) (modifier focusTrap isActive=(argOrDefault @isFocusTrapActive true) shouldSelfFocus=(argOrDefault @shouldSelfFocus true) isPaused=this.isPushed focusTrapOptions=(argOrDefault @focusTrapOptions (hash allowOutsideClick=true clickOutsideDeactivates=(not this.ownFocus)))) (modifier outsideClickDetectorModifier isDisabled=(or this.isPushed (not this.outsideClickCloses)) onOutsideClick=this.onClose) (modifier styleModifier this.styles) (modifier onKey \"Escape\" this.onClose) (modifier classesModifier type=this.type isPushed=this.isPushed side=this.side dimensions=this.dimensions functionToCallOnWindowResize=this.functionToCallOnWindowResize) (modifier resizeObserverModifier onResize=this.onResize) (element this.as) as |classes closeButtonClasses focusTrapModifier outsideClickDetector currentStyles onEscape classesModifier resizeObserver TheElement|}}\n\n {{#if (and this.ownFocus (not this.isPushed))}}\n <EuiOverlayMask @headerZindexLocation=\"below\" @onClick={{this.onClose}}>\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{!--@glint-expect-error--}} {{currentStyles}} {{!--@glint-expect-error--}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiOverlayMask>\n {{else if (not this.isPushed)}}\n <EuiPortal>\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{currentStyles}} {{!--@glint-expect-error--}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiPortal>\n {{else}}\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{currentStyles}} {{!--@glint-expect-error--}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n {{/if}}\n{{/let}}", {
171
+ setComponentTemplate(precompileTemplate("{{#let (classNames (if (eq this.maxWidth true) \"euiFlyout--maxWidth-default\") componentName=\"EuiFlyout\" type=this.type side=this.side size=this.size padding=this.paddingSize) (classNames \"euiFlyout__closeButton\" (concat \"euiFlyout__closeButton--\" this.closeButtonPosition) (or @closeButtonProps.className @closeButtonProps.classes)) (modifier focusTrap isActive=(argOrDefault @isFocusTrapActive true) shouldSelfFocus=(argOrDefault @shouldSelfFocus true) isPaused=this.isPushed focusTrapOptions=(argOrDefault @focusTrapOptions (hash allowOutsideClick=true clickOutsideDeactivates=(not this.ownFocus)))) (modifier outsideClickDetectorModifier isDisabled=(or this.isPushed (not this.outsideClickCloses)) onOutsideClick=this.onClose) (modifier styleModifier this.styles) (modifier onKey \"Escape\" this.onClose) (modifier classesModifier type=this.type isPushed=this.isPushed side=this.side dimensions=this.dimensions functionToCallOnWindowResize=this.functionToCallOnWindowResize) (modifier resizeObserverModifier onResize=this.onResize) (element this.as) as |classes closeButtonClasses focusTrapModifier outsideClickDetector currentStyles onEscape classesModifier resizeObserver TheElement|}}\n\n {{#if (and this.ownFocus (not this.isPushed))}}\n <EuiOverlayMask @headerZindexLocation=\"below\" @onClick={{this.onClose}}>\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{!--@glint-expect-error--}} {{currentStyles}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiOverlayMask>\n {{else if (not this.isPushed)}}\n <EuiPortal>\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{currentStyles}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiPortal>\n {{else}}\n <TheElement role={{this.role}} class={{classes}} tabindex={{-1}} {{currentStyles}} {{focusTrapModifier}} {{outsideClickDetector}} {{onEscape}} {{classesModifier}} {{resizeObserver}} ...attributes>\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon @display={{if (eq this.closeButtonPosition \"outside\") \"fill\" \"empty\"}} @iconType=\"cross\" @color=\"text\" aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}} data-test-subj=\"euiFlyoutCloseButton\" class={{closeButtonClasses}} {{on \"click\" this.onButtonCloseClicked}} />\n {{/if}}\n {{yield}}\n </TheElement>\n {{/if}}\n{{/let}}", {
172
172
  strictMode: true,
173
173
  scope: () => ({
174
174
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-flyout.js","sources":["../../src/components/eui-flyout.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport { throttle } from '@ember/runloop';\n\nimport { element } from 'ember-element-helper';\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { modifier as modBuilder } from 'ember-modifier';\nimport styleModifier from 'ember-style-modifier/modifiers/style';\nimport { and, eq, not, or } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport outsideClickDetectorModifier from '../modifiers/outside-click-detector.ts';\nimport resizeObserverModifier from '../modifiers/resize-observer.ts';\nimport { isWithinMinBreakpoint } from '../utils/breakpoint.ts';\nimport { sizeMapping } from '../utils/css-mappings/eui-flyout.ts';\nimport { keysOf } from './common.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiOverlayMask from './eui-overlay-mask.gts';\nimport EuiPortal from './eui-portal.gts';\n\nimport type { EuiBreakpointSize } from '../utils/breakpoint.ts';\n\nexport type EuiFlyoutArgs = {\n /** Same as `@closeButtonAriaLabel`. */\n closeAriaLabel?: string;\n /** @deprecated Has no effect: render the flyout only while it is open. */\n isOpen?: boolean;\n /** @deprecated Has no effect, see EuiCollapsibleNav; use `@type=\"push\"`. */\n isDocked?: boolean;\n /** @deprecated Has no effect; use `@pushMinBreakpoint`. */\n dockedBreakpoint?: EuiBreakpointSize | number;\n /** @deprecated Has no effect. */\n showButtonIfDocked?: boolean;\n\n /** Traps keyboard focus inside the flyout. Defaults to `true`. */\n isFocusTrapActive?: boolean;\n\n /** Tag of the flyout, e.g. `'nav'` or `'aside'`. Defaults to `'div'`. */\n as?: string;\n\n /**\n * Width: `'s'`, `'m'` or `'l'`, a number in px or any CSS width.\n * Defaults to `'m'`.\n */\n size?: number | string;\n\n /** Side of the window it slides in from. Defaults to `'right'`. */\n side?: 'left' | 'right';\n\n /** `role` of the flyout. Defaults to `'dialog'`. */\n role?: null | string;\n\n /**\n * Renders a mask over the page behind the flyout, which closes it when\n * clicked. Without it, the page stays usable. Defaults to `true`.\n */\n ownFocus?: boolean;\n\n /** Clicking outside the flyout calls `@onClose`. Defaults to `false`. */\n outsideClickCloses?: boolean;\n\n /**\n * Close button `'inside'` the flyout's corner or `'outside'` next to it.\n * Defaults to `'inside'`.\n */\n closeButtonPosition?: 'outside' | 'inside';\n\n /**\n * Padding of `EuiFlyoutHeader`, `EuiFlyoutBody` and `EuiFlyoutFooter`:\n * `'none'`, `'s'`, `'m'` or `'l'`. Defaults to `'l'`.\n */\n paddingSize?: string;\n\n /** Hides the close button (e.g. when the flyout has its own). */\n hideCloseButton?: boolean;\n\n /** Props for the close button: `{ className, onClick }`. */\n closeButtonProps?: {\n className?: string;\n onClick?: (e: MouseEvent) => void;\n classes?: string;\n };\n\n /** Accessible label of the close button. Defaults to \"Close this dialog\". */\n closeButtonAriaLabel?: string;\n\n /**\n * Called by the close button, Escape, the mask and outside clicks. Stop\n * rendering the flyout here. Without it there is no close button.\n */\n onClose?: () => void;\n\n /**\n * Caps the width: `true` for EUI's default max width, or a number in px.\n * Defaults to `false`.\n */\n maxWidth?: boolean | number;\n\n /** @deprecated Has no effect. */\n maskProps?: Record<string, unknown>;\n\n /**\n * `'overlay'` covers the page; `'push'` pads the page so the flyout sits\n * beside it (on windows at least `@pushMinBreakpoint` wide).\n * Defaults to `'overlay'`.\n */\n type?: string;\n\n /**\n * Minimum window width for `@type=\"push\"`: a named breakpoint (`'xs'`\n * to `'xl'`) or px. Smaller windows get an overlay. Defaults to `'l'`.\n */\n pushMinBreakpoint?: number | EuiBreakpointSize;\n\n /** Focuses the flyout itself when it opens. Defaults to `true`. */\n shouldSelfFocus?: boolean;\n\n /**\n * Options for the focus trap (focus-trap library), e.g.\n * `{ initialFocus: '#name' }`. Defaults to allowing outside clicks.\n */\n focusTrapOptions?: {\n allowOutsideClick?: boolean;\n clickOutsideDeactivates?: boolean;\n initialFocus?: string | HTMLElement | (() => HTMLElement);\n fallbackFocus?: string | HTMLElement | (() => HTMLElement);\n escapeDeactivates?: boolean;\n returnFocusOnDeactivate?: boolean;\n preventScroll?: boolean;\n };\n};\n\nconst classesModifier = modBuilder(\n (\n _element: Element,\n _pos,\n {\n type,\n isPushed,\n side,\n dimensions = {},\n functionToCallOnWindowResize\n }: {\n type: string;\n isPushed: boolean;\n side: string;\n dimensions?: { width?: number };\n functionToCallOnWindowResize: () => void;\n }\n ) => {\n // This class doesn't actually do anything by EUI, but is nice to add for consumers (JIC)\n document.body.classList.add('euiBody--hasFlyout');\n\n /**\n * Accomodate for the `isPushed` state by adding padding to the body equal to the width of the element\n */\n if (type === 'push') {\n // Only add the event listener if we'll need to accommodate with padding\n window.addEventListener('resize', functionToCallOnWindowResize);\n\n if (isPushed && dimensions.width) {\n if (side === 'right') {\n document.body.style.paddingRight = `${dimensions.width}px`;\n } else if (side === 'left') {\n document.body.style.paddingLeft = `${dimensions.width}px`;\n }\n }\n }\n\n return () => {\n document.body.classList.remove('euiBody--hasFlyout');\n\n if (type === 'push') {\n window.removeEventListener('resize', functionToCallOnWindowResize);\n\n if (side === 'right') {\n document.body.style.paddingRight = '';\n } else if (side === 'left') {\n document.body.style.paddingLeft = '';\n }\n }\n };\n }\n);\n\nexport const SIZES = keysOf(sizeMapping);\nexport type EuiFlyoutSize = (typeof SIZES)[number];\n\nfunction isEuiFlyoutSizeNamed(value: any): value is EuiFlyoutSize {\n return SIZES.includes(value);\n}\n\n/**\n * A panel sliding in from the side of the window, for details or forms\n * that keep the page context. Render it only while open:\n * `{{#if this.isOpen}}<EuiFlyout @onClose={{…}}>…</EuiFlyout>{{/if}}`.\n */\nexport interface EuiFlyoutSignature {\n Element: any;\n Args: EuiFlyoutArgs;\n Blocks: {\n /** Usually `EuiFlyoutHeader`, `EuiFlyoutBody` and `EuiFlyoutFooter`. */\n default: [];\n };\n}\n\nexport default class EuiFlyoutComponent extends Component<EuiFlyoutSignature> {\n @tracked windowIsLargeEnoughToPush = isWithinMinBreakpoint(\n typeof window === 'undefined' ? -Infinity : window.innerWidth,\n this.pushMinBreakpoint\n );\n\n @tracked dimensions?: { width?: number; height?: number };\n\n get as() {\n return this.args.as ?? 'div';\n }\n\n get hideCloseButton() {\n return this.args.hideCloseButton ?? false;\n }\n\n get closeButtonPosition() {\n return this.args.closeButtonPosition ?? 'inside';\n }\n\n get ownFocus() {\n return this.args.ownFocus ?? true;\n }\n\n get side() {\n return this.args.side ?? 'right';\n }\n\n get size() {\n return this.args.size ?? 'm';\n }\n\n get paddingSize() {\n return this.args.paddingSize ?? 'l';\n }\n\n get maxWidth() {\n return this.args.maxWidth ?? false;\n }\n\n get type() {\n return this.args.type ?? 'overlay';\n }\n\n get outsideClickCloses() {\n return this.args.outsideClickCloses ?? false;\n }\n\n get role() {\n return this.args.role ?? 'dialog';\n }\n\n get pushMinBreakpoint() {\n return this.args.pushMinBreakpoint ?? 'l';\n }\n\n get isPushed() {\n return this.type === 'push' && this.windowIsLargeEnoughToPush;\n }\n\n get styles() {\n let newStyle: { [key: string]: unknown } = {};\n\n if (this.maxWidth !== false) {\n const value =\n typeof this.maxWidth === 'number'\n ? `${this.maxWidth}px`\n : this.maxWidth;\n\n newStyle = { maxWidth: value };\n }\n\n if (!isEuiFlyoutSizeNamed(this.size) && newStyle) {\n newStyle['width'] = this.size;\n } else {\n newStyle = { width: this.size };\n }\n\n return newStyle;\n }\n\n @action\n functionToCallOnWindowResize() {\n throttle(() => {\n if (isWithinMinBreakpoint(window.innerWidth, this.pushMinBreakpoint)) {\n this.windowIsLargeEnoughToPush = true;\n } else {\n this.windowIsLargeEnoughToPush = false;\n }\n }, 50);\n }\n\n @action\n onClose() {\n this.args.onClose?.();\n }\n\n @action\n onButtonCloseClicked(e: MouseEvent) {\n this.onClose();\n this.args.closeButtonProps?.onClick?.(e);\n }\n\n @action\n onResize(dimensions: { width: number; height: number }) {\n this.dimensions = dimensions;\n }\n\n <template>\n {{#let\n (classNames\n (if (eq this.maxWidth true) \"euiFlyout--maxWidth-default\")\n componentName=\"EuiFlyout\"\n type=this.type\n side=this.side\n size=this.size\n padding=this.paddingSize\n )\n (classNames\n \"euiFlyout__closeButton\"\n (concat \"euiFlyout__closeButton--\" this.closeButtonPosition)\n (or @closeButtonProps.className @closeButtonProps.classes)\n )\n (modifier\n focusTrap\n isActive=(argOrDefault @isFocusTrapActive true)\n shouldSelfFocus=(argOrDefault @shouldSelfFocus true)\n isPaused=this.isPushed\n focusTrapOptions=(argOrDefault\n @focusTrapOptions\n (hash\n allowOutsideClick=true clickOutsideDeactivates=(not this.ownFocus)\n )\n )\n )\n (modifier\n outsideClickDetectorModifier\n isDisabled=(or this.isPushed (not this.outsideClickCloses))\n onOutsideClick=this.onClose\n )\n (modifier styleModifier this.styles)\n (modifier onKey \"Escape\" this.onClose)\n (modifier\n classesModifier\n type=this.type\n isPushed=this.isPushed\n side=this.side\n dimensions=this.dimensions\n functionToCallOnWindowResize=this.functionToCallOnWindowResize\n )\n (modifier resizeObserverModifier onResize=this.onResize)\n (element this.as)\n as |classes closeButtonClasses focusTrapModifier outsideClickDetector currentStyles onEscape classesModifier resizeObserver TheElement|\n }}\n\n {{#if (and this.ownFocus (not this.isPushed))}}\n <EuiOverlayMask @headerZindexLocation=\"below\" @onClick={{this.onClose}}>\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{!@glint-expect-error}}\n {{currentStyles}}\n {{!@glint-expect-error}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiOverlayMask>\n {{else if (not this.isPushed)}}\n <EuiPortal>\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{currentStyles}}\n {{!@glint-expect-error}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiPortal>\n {{else}}\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{currentStyles}}\n {{!@glint-expect-error}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["classesModifier","modBuilder","_element","_pos","type","isPushed","side","dimensions","functionToCallOnWindowResize","document","body","classList","add","window","addEventListener","width","style","paddingRight","paddingLeft","remove","removeEventListener","SIZES","keysOf","sizeMapping","isEuiFlyoutSizeNamed","value","includes","EuiFlyoutComponent","Component","g","prototype","tracked","isWithinMinBreakpoint","Infinity","innerWidth","pushMinBreakpoint","i","as","args","hideCloseButton","closeButtonPosition","ownFocus","size","paddingSize","maxWidth","outsideClickCloses","role","windowIsLargeEnoughToPush","styles","newStyle","throttle","n","action","onClose","onButtonCloseClicked","e","closeButtonProps","onClick","onResize","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","concat","or","focusTrap","argOrDefault","hash","not","outsideClickDetectorModifier","styleModifier","onKey","resizeObserverModifier","element","and","EuiOverlayMask","EuiButtonIcon","on","EuiPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0IA,MAAMA,kBAAkBC,QAAA,CACtB,CACEC,QAAU,EACVC,MACA;EACEC,IAAI;EACJC,QAAQ;EACRC,IAAI;EACJC,aAAa,EAAE;AACfC,EAAAA;AAOD,CAAA,KAAA;AAED;EACAC,QAAA,CAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,oBAAA,CAAA;AAE5B;;;EAGA,IAAIR,SAAS,MAAA,EAAQ;AACnB;AACAS,IAAAA,MAAA,CAAOC,gBAAgB,CAAC,QAAA,EAAUN,4BAAA,CAAA;AAElC,IAAA,IAAIH,QAAA,IAAYE,UAAA,CAAWQ,KAAK,EAAE;MAChC,IAAIT,SAAS,OAAA,EAAS;QACpBG,QAAA,CAASC,IAAI,CAACM,KA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,CAAArB,SAAA,EAAA,8BAAA,EAAA,CATCsB,MAAA,CAAA,CAAA;AAAA;AAYDC,EAAAA,OAAAA,GAAU;AACR,IAAA,IAAI,CAACf,IAAI,CAACe,OAAO,IAAA;AACnB,EAAA;AAAA,EAAA;IAAAF,CAAA,CAAA,IAAA,CAAArB,SAAA,EAAA,SAAA,EAAA,CAHCsB,MAAA,CAAA,CAAA;AAAA;EAMDE,oBAAAA,CAAqBC,CAAa,EAAE;IAClC,IAAI,CAACF,OAAO,EAAA;IACZ,IAAI,CAACf,IAAI,CAACkB,gBAAgB,EAAEC,OAAA,GAAUF,CAAA,CAAA;AACxC,EAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAArB,SAAA,EAAA,sBAAA,EAAA,CAJCsB,MAAA,CAAA,CAAA;AAAA;EAODM,QAAAA,CAASnD,UAA6C,EAAE;IACtD,IAAI,CAACA,UAAU,GAAGA,UAAA;AACpB,EAAA;AAAA,EAAA;IAAA4C,CAAA,CAAA,IAAA,CAAArB,SAAA,EAAA,UAAA,EAAA,CAHCsB,MAAA,CAAA,CAAA;AAAA;AAKD,EAAA;IAAAO,oBAAA,CAAAC,kBAAA,CAAA,m7GAAA,EAmJA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,EAAA;QAAAC,MAAA;QAAAC,EAAA;QAAAC,SAAA;QAAAC,YAAA;QAAAC,IAAA;QAAAC,GAAA;sCAAAC,oBAAA;uBAAAC,KAAA;QAAAC,KAAA;QAAAzE,eAAA;gCAAA0E,cAAA;QAAAC,OAAA;QAAAC,GAAA;wBAAAC,uBAAA;QAAAC,aAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"eui-flyout.js","sources":["../../src/components/eui-flyout.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport { throttle } from '@ember/runloop';\n\nimport { element } from 'ember-element-helper';\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { modifier as modBuilder } from 'ember-modifier';\nimport styleModifier from 'ember-style-modifier/modifiers/style';\nimport { and, eq, not, or } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport outsideClickDetectorModifier from '../modifiers/outside-click-detector.ts';\nimport resizeObserverModifier from '../modifiers/resize-observer.ts';\nimport { isWithinMinBreakpoint } from '../utils/breakpoint.ts';\nimport { sizeMapping } from '../utils/css-mappings/eui-flyout.ts';\nimport { keysOf } from './common.ts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiOverlayMask from './eui-overlay-mask.gts';\nimport EuiPortal from './eui-portal.gts';\n\nimport type { EuiBreakpointSize } from '../utils/breakpoint.ts';\n\nexport type EuiFlyoutArgs = {\n /** Same as `@closeButtonAriaLabel`. */\n closeAriaLabel?: string;\n /** @deprecated Has no effect: render the flyout only while it is open. */\n isOpen?: boolean;\n /** @deprecated Has no effect, see EuiCollapsibleNav; use `@type=\"push\"`. */\n isDocked?: boolean;\n /** @deprecated Has no effect; use `@pushMinBreakpoint`. */\n dockedBreakpoint?: EuiBreakpointSize | number;\n /** @deprecated Has no effect. */\n showButtonIfDocked?: boolean;\n\n /** Traps keyboard focus inside the flyout. Defaults to `true`. */\n isFocusTrapActive?: boolean;\n\n /** Tag of the flyout, e.g. `'nav'` or `'aside'`. Defaults to `'div'`. */\n as?: string;\n\n /**\n * Width: `'s'`, `'m'` or `'l'`, a number in px or any CSS width.\n * Defaults to `'m'`.\n */\n size?: number | string;\n\n /** Side of the window it slides in from. Defaults to `'right'`. */\n side?: 'left' | 'right';\n\n /** `role` of the flyout. Defaults to `'dialog'`. */\n role?: null | string;\n\n /**\n * Renders a mask over the page behind the flyout, which closes it when\n * clicked. Without it, the page stays usable. Defaults to `true`.\n */\n ownFocus?: boolean;\n\n /** Clicking outside the flyout calls `@onClose`. Defaults to `false`. */\n outsideClickCloses?: boolean;\n\n /**\n * Close button `'inside'` the flyout's corner or `'outside'` next to it.\n * Defaults to `'inside'`.\n */\n closeButtonPosition?: 'outside' | 'inside';\n\n /**\n * Padding of `EuiFlyoutHeader`, `EuiFlyoutBody` and `EuiFlyoutFooter`:\n * `'none'`, `'s'`, `'m'` or `'l'`. Defaults to `'l'`.\n */\n paddingSize?: string;\n\n /** Hides the close button (e.g. when the flyout has its own). */\n hideCloseButton?: boolean;\n\n /** Props for the close button: `{ className, onClick }`. */\n closeButtonProps?: {\n className?: string;\n onClick?: (e: MouseEvent) => void;\n classes?: string;\n };\n\n /** Accessible label of the close button. Defaults to \"Close this dialog\". */\n closeButtonAriaLabel?: string;\n\n /**\n * Called by the close button, Escape, the mask and outside clicks. Stop\n * rendering the flyout here. Without it there is no close button.\n */\n onClose?: () => void;\n\n /**\n * Caps the width: `true` for EUI's default max width, or a number in px.\n * Defaults to `false`.\n */\n maxWidth?: boolean | number;\n\n /** @deprecated Has no effect. */\n maskProps?: Record<string, unknown>;\n\n /**\n * `'overlay'` covers the page; `'push'` pads the page so the flyout sits\n * beside it (on windows at least `@pushMinBreakpoint` wide).\n * Defaults to `'overlay'`.\n */\n type?: string;\n\n /**\n * Minimum window width for `@type=\"push\"`: a named breakpoint (`'xs'`\n * to `'xl'`) or px. Smaller windows get an overlay. Defaults to `'l'`.\n */\n pushMinBreakpoint?: number | EuiBreakpointSize;\n\n /** Focuses the flyout itself when it opens. Defaults to `true`. */\n shouldSelfFocus?: boolean;\n\n /**\n * Options for the focus trap (focus-trap library), e.g.\n * `{ initialFocus: '#name' }`. Defaults to allowing outside clicks.\n */\n focusTrapOptions?: {\n allowOutsideClick?: boolean;\n clickOutsideDeactivates?: boolean;\n initialFocus?: string | HTMLElement | (() => HTMLElement);\n fallbackFocus?: string | HTMLElement | (() => HTMLElement);\n escapeDeactivates?: boolean;\n returnFocusOnDeactivate?: boolean;\n preventScroll?: boolean;\n };\n};\n\nconst classesModifier = modBuilder(\n (\n _element: Element,\n _pos,\n {\n type,\n isPushed,\n side,\n dimensions = {},\n functionToCallOnWindowResize\n }: {\n type: string;\n isPushed: boolean;\n side: string;\n dimensions?: { width?: number };\n functionToCallOnWindowResize: () => void;\n }\n ) => {\n // This class doesn't actually do anything by EUI, but is nice to add for consumers (JIC)\n document.body.classList.add('euiBody--hasFlyout');\n\n /**\n * Accomodate for the `isPushed` state by adding padding to the body equal to the width of the element\n */\n if (type === 'push') {\n // Only add the event listener if we'll need to accommodate with padding\n window.addEventListener('resize', functionToCallOnWindowResize);\n\n if (isPushed && dimensions.width) {\n if (side === 'right') {\n document.body.style.paddingRight = `${dimensions.width}px`;\n } else if (side === 'left') {\n document.body.style.paddingLeft = `${dimensions.width}px`;\n }\n }\n }\n\n return () => {\n document.body.classList.remove('euiBody--hasFlyout');\n\n if (type === 'push') {\n window.removeEventListener('resize', functionToCallOnWindowResize);\n\n if (side === 'right') {\n document.body.style.paddingRight = '';\n } else if (side === 'left') {\n document.body.style.paddingLeft = '';\n }\n }\n };\n }\n);\n\nexport const SIZES = keysOf(sizeMapping);\nexport type EuiFlyoutSize = (typeof SIZES)[number];\n\nfunction isEuiFlyoutSizeNamed(value: any): value is EuiFlyoutSize {\n return SIZES.includes(value);\n}\n\n/**\n * A panel sliding in from the side of the window, for details or forms\n * that keep the page context. Render it only while open:\n * `{{#if this.isOpen}}<EuiFlyout @onClose={{…}}>…</EuiFlyout>{{/if}}`.\n */\nexport interface EuiFlyoutSignature {\n Element: any;\n Args: EuiFlyoutArgs;\n Blocks: {\n /** Usually `EuiFlyoutHeader`, `EuiFlyoutBody` and `EuiFlyoutFooter`. */\n default: [];\n };\n}\n\nexport default class EuiFlyoutComponent extends Component<EuiFlyoutSignature> {\n @tracked windowIsLargeEnoughToPush = isWithinMinBreakpoint(\n typeof window === 'undefined' ? -Infinity : window.innerWidth,\n this.pushMinBreakpoint\n );\n\n @tracked dimensions?: { width?: number; height?: number };\n\n get as() {\n return this.args.as ?? 'div';\n }\n\n get hideCloseButton() {\n return this.args.hideCloseButton ?? false;\n }\n\n get closeButtonPosition() {\n return this.args.closeButtonPosition ?? 'inside';\n }\n\n get ownFocus() {\n return this.args.ownFocus ?? true;\n }\n\n get side() {\n return this.args.side ?? 'right';\n }\n\n get size() {\n return this.args.size ?? 'm';\n }\n\n get paddingSize() {\n return this.args.paddingSize ?? 'l';\n }\n\n get maxWidth() {\n return this.args.maxWidth ?? false;\n }\n\n get type() {\n return this.args.type ?? 'overlay';\n }\n\n get outsideClickCloses() {\n return this.args.outsideClickCloses ?? false;\n }\n\n get role() {\n return this.args.role ?? 'dialog';\n }\n\n get pushMinBreakpoint() {\n return this.args.pushMinBreakpoint ?? 'l';\n }\n\n get isPushed() {\n return this.type === 'push' && this.windowIsLargeEnoughToPush;\n }\n\n get styles() {\n let newStyle: { [key: string]: unknown } = {};\n\n if (this.maxWidth !== false) {\n const value =\n typeof this.maxWidth === 'number'\n ? `${this.maxWidth}px`\n : this.maxWidth;\n\n newStyle = { maxWidth: value };\n }\n\n if (!isEuiFlyoutSizeNamed(this.size) && newStyle) {\n newStyle['width'] = this.size;\n } else {\n newStyle = { width: this.size };\n }\n\n return newStyle;\n }\n\n @action\n functionToCallOnWindowResize() {\n throttle(() => {\n if (isWithinMinBreakpoint(window.innerWidth, this.pushMinBreakpoint)) {\n this.windowIsLargeEnoughToPush = true;\n } else {\n this.windowIsLargeEnoughToPush = false;\n }\n }, 50);\n }\n\n @action\n onClose() {\n this.args.onClose?.();\n }\n\n @action\n onButtonCloseClicked(e: MouseEvent) {\n this.onClose();\n this.args.closeButtonProps?.onClick?.(e);\n }\n\n @action\n onResize(dimensions: { width: number; height: number }) {\n this.dimensions = dimensions;\n }\n\n <template>\n {{#let\n (classNames\n (if (eq this.maxWidth true) \"euiFlyout--maxWidth-default\")\n componentName=\"EuiFlyout\"\n type=this.type\n side=this.side\n size=this.size\n padding=this.paddingSize\n )\n (classNames\n \"euiFlyout__closeButton\"\n (concat \"euiFlyout__closeButton--\" this.closeButtonPosition)\n (or @closeButtonProps.className @closeButtonProps.classes)\n )\n (modifier\n focusTrap\n isActive=(argOrDefault @isFocusTrapActive true)\n shouldSelfFocus=(argOrDefault @shouldSelfFocus true)\n isPaused=this.isPushed\n focusTrapOptions=(argOrDefault\n @focusTrapOptions\n (hash\n allowOutsideClick=true clickOutsideDeactivates=(not this.ownFocus)\n )\n )\n )\n (modifier\n outsideClickDetectorModifier\n isDisabled=(or this.isPushed (not this.outsideClickCloses))\n onOutsideClick=this.onClose\n )\n (modifier styleModifier this.styles)\n (modifier onKey \"Escape\" this.onClose)\n (modifier\n classesModifier\n type=this.type\n isPushed=this.isPushed\n side=this.side\n dimensions=this.dimensions\n functionToCallOnWindowResize=this.functionToCallOnWindowResize\n )\n (modifier resizeObserverModifier onResize=this.onResize)\n (element this.as)\n as |classes closeButtonClasses focusTrapModifier outsideClickDetector currentStyles onEscape classesModifier resizeObserver TheElement|\n }}\n\n {{#if (and this.ownFocus (not this.isPushed))}}\n <EuiOverlayMask @headerZindexLocation=\"below\" @onClick={{this.onClose}}>\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{!@glint-expect-error}}\n {{currentStyles}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiOverlayMask>\n {{else if (not this.isPushed)}}\n <EuiPortal>\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{currentStyles}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n </EuiPortal>\n {{else}}\n <TheElement\n role={{this.role}}\n class={{classes}}\n tabindex={{-1}}\n {{currentStyles}}\n {{focusTrapModifier}}\n {{outsideClickDetector}}\n {{onEscape}}\n {{classesModifier}}\n {{resizeObserver}}\n ...attributes\n >\n {{#if (and @onClose (not @hideCloseButton))}}\n <EuiButtonIcon\n @display={{if\n (eq this.closeButtonPosition \"outside\")\n \"fill\"\n \"empty\"\n }}\n @iconType=\"cross\"\n @color=\"text\"\n aria-label={{or @closeButtonAriaLabel @closeAriaLabel \"Close this dialog\"}}\n data-test-subj=\"euiFlyoutCloseButton\"\n class={{closeButtonClasses}}\n {{on \"click\" this.onButtonCloseClicked}}\n />\n {{/if}}\n {{yield}}\n </TheElement>\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["classesModifier","modBuilder","_element","_pos","type","isPushed","side","dimensions","functionToCallOnWindowResize","document","body","classList","add","window","addEventListener","width","style","paddingRight","paddingLeft","remove","removeEventListener","SIZES","keysOf","sizeMapping","isEuiFlyoutSizeNamed","value","includes","EuiFlyoutComponent","Component","g","prototype","tracked","isWithinMinBreakpoint","Infinity","innerWidth","pushMinBreakpoint","i","as","args","hideCloseButton","closeButtonPosition","ownFocus","size","paddingSize","maxWidth","outsideClickCloses","role","windowIsLargeEnoughToPush","styles","newStyle","throttle","n","action","onClose","onButtonCloseClicked","e","closeButtonProps","onClick","onResize","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","concat","or","focusTrap","argOrDefault","hash","not","outsideClickDetectorModifier","styleModifier","onKey","resizeObserverModifier","element","and","EuiOverlayMask","EuiButtonIcon","on","EuiPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0IA,MAAMA,kBAAkBC,QAAA,CACtB,CACEC,QAAU,EACVC,MACA;EACEC,IAAI;EACJC,QAAQ;EACRC,IAAI;EACJC,aAAa,EAAE;AACfC,EAAAA;AAOD,CAAA,KAAA;AAED;EACAC,QAAA,CAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,oBAAA,CAAA;AAE5B;;;EAGA,IAAIR,SAAS,MAAA,EAAQ;AACnB;AACAS,IAAAA,MAAA,CAAOC,gBAAgB,CAAC,QAAA,EAAUN,4BAAA,CAAA;AAElC,IAAA,IAAIH,QAAA,IAAYE,UAAA,CAAWQ,KAAK,EAAE;MAChC,IAAIT,SAAS,OAAA,EAAS;QACpBG,QAAA,CAASC,IAAI,CAACM,KAAK,CAACC,YAAY,GAAG,CAAA,EAAGV,UAAA,CAAWQ,KAAK,CAAA,EAAA,CAAI;AAC5D,MAAA,CAAA,MAAO,IAAIT,SAAS,MAAA,EAAQ;QAC1BG,QAAA,CAASC,IAAI,CAACM,KAAK,CAACE,WAAW,GAAG,CAAA,EAAGX,UAAA,CAAWQ,KAAK,CAAA,EAAA,CAAI;AAC3D,MAAA;AACF,IAAA;AACF,EAAA;AAEA,EAAA,OAAO,MAAA;IACLN,QAAA,CAASC,IAAI,CAACC,SAAS,CAACQ,MAAM,CAAC,oBAAA,CAAA;IAE/B,IAAIf,SAAS,MAAA,EAAQ;AACnBS,MAAAA,MAAA,CAAOO,mBAAmB,CAAC,QAAA,EAA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B,SAAA,EAAA,sBAAA,EAAA,CAJCsB,MAAA,CAAA,CAAA;AAAA;EAODM,QAAAA,CAASnD,UAA6C,EAAE;IACtD,IAAI,CAACA,UAAU,GAAGA,UAAA;AACpB,EAAA;AAAA,EAAA;IAAA4C,CAAA,CAAA,IAAA,CAAArB,SAAA,EAAA,UAAA,EAAA,CAHCsB,MAAA,CAAA,CAAA;AAAA;AAKD,EAAA;IAAAO,oBAAA,CAAAC,kBAAA,CAAA,41GAAA,EAgJA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,EAAA;QAAAC,MAAA;QAAAC,EAAA;QAAAC,SAAA;QAAAC,YAAA;QAAAC,IAAA;QAAAC,GAAA;sCAAAC,oBAAA;uBAAAC,KAAA;QAAAC,KAAA;QAAAzE,eAAA;gCAAA0E,cAAA;QAAAC,OAAA;QAAAC,GAAA;wBAAAC,uBAAA;QAAAC,aAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -4,7 +4,7 @@ import { precompileTemplate } from '@ember/template-compilation';
4
4
  import { setComponentTemplate } from '@ember/component';
5
5
  import templateOnly from '@ember/component/template-only';
6
6
 
7
- const EuiFormLabel = setComponentTemplate(precompileTemplate("{{#let (classNames (if @isFocused \"euiFormLabel-isFocused\") (if @isInvalid \"euiFormLabel-isInvalid\") \"euiFormLabel\") as |classes|}}\n {{#if (eq @type \"legend\")}}\n <legend class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </legend>\n {{else}}\n <label class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </label>\n {{/if}}\n{{/let}}", {
7
+ const EuiFormLabel = setComponentTemplate(precompileTemplate("{{#let (classNames (if @isFocused \"euiFormLabel-isFocused\") (if @isInvalid \"euiFormLabel-isInvalid\") \"euiFormLabel\") as |classes|}}\n {{#if (eq @type \"legend\")}}\n <legend class={{classes}} ...attributes>\n {{@label}}\n {{yield}}\n </legend>\n {{else}}\n <label class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </label>\n {{/if}}\n{{/let}}", {
8
8
  strictMode: true,
9
9
  scope: () => ({
10
10
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-form-label.js","sources":["../../src/components/eui-form-label.gts"],"sourcesContent":["import { eq } from 'ember-truth-helpers';\n\nimport classNames from '../helpers/class-names.ts';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\n/** The label of a control; EuiFormRow renders it from `@label`. */\nexport interface EuiFormLabelSignature {\n Element: HTMLLabelElement | HTMLLegendElement;\n Args: {\n /** Focused styling (the control has focus). */\n isFocused?: boolean;\n /** Invalid styling. */\n isInvalid?: boolean;\n /**\n * `'label'` renders a `<label>`, `'legend'` a `<legend>` (for fieldsets).\n * Defaults to `'label'`.\n */\n type?: 'legend' | 'label';\n /** Id of the control it labels. */\n for?: string;\n /** The label text, before the block content. */\n label?: string;\n };\n Blocks: {\n /** The label text. */\n default: [];\n };\n}\n\nconst EuiFormLabel: TemplateOnlyComponent<EuiFormLabelSignature> = <template>\n {{#let\n (classNames\n (if @isFocused \"euiFormLabel-isFocused\")\n (if @isInvalid \"euiFormLabel-isInvalid\")\n \"euiFormLabel\"\n )\n as |classes|\n }}\n {{#if (eq @type \"legend\")}}\n <legend class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </legend>\n {{else}}\n <label class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </label>\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiFormLabel;\n"],"names":["EuiFormLabel","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","templateOnly"],"mappings":";;;;;;AA8BA,MAAMA,YAAoC,GAAAC,oBAAA,CAAyBC,kBAAA,CAAA,qaAAA,EAqBnE;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
1
+ {"version":3,"file":"eui-form-label.js","sources":["../../src/components/eui-form-label.gts"],"sourcesContent":["import { eq } from 'ember-truth-helpers';\n\nimport classNames from '../helpers/class-names.ts';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\n/** The label of a control; EuiFormRow renders it from `@label`. */\nexport interface EuiFormLabelSignature {\n Element: HTMLLabelElement | HTMLLegendElement;\n Args: {\n /** Focused styling (the control has focus). */\n isFocused?: boolean;\n /** Invalid styling. */\n isInvalid?: boolean;\n /**\n * `'label'` renders a `<label>`, `'legend'` a `<legend>` (for fieldsets).\n * Defaults to `'label'`.\n */\n type?: 'legend' | 'label';\n /** Id of the control it labels. */\n for?: string;\n /** The label text, before the block content. */\n label?: string;\n };\n Blocks: {\n /** The label text. */\n default: [];\n };\n}\n\nconst EuiFormLabel: TemplateOnlyComponent<EuiFormLabelSignature> = <template>\n {{#let\n (classNames\n (if @isFocused \"euiFormLabel-isFocused\")\n (if @isInvalid \"euiFormLabel-isInvalid\")\n \"euiFormLabel\"\n )\n as |classes|\n }}\n {{#if (eq @type \"legend\")}}\n <legend class={{classes}} ...attributes>\n {{@label}}\n {{yield}}\n </legend>\n {{else}}\n <label class={{classes}} for={{@for}} ...attributes>\n {{@label}}\n {{yield}}\n </label>\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiFormLabel;\n"],"names":["EuiFormLabel","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","templateOnly"],"mappings":";;;;;;AA8BA,MAAMA,YAAoC,GAAAC,oBAAA,CAAyBC,kBAAA,CAAA,wZAAA,EAqBnE;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
@@ -151,7 +151,7 @@ class EuiIcon extends Component {
151
151
  return this.args.titleId ?? `${guidFor(this)}-title`;
152
152
  }
153
153
  static {
154
- setComponentTemplate(precompileTemplate("{{#if @useComponent}}\n {{!--@glint-expect-error--}}\n {{#let (component @type) as |IconComponent|}}\n {{!--template-lint-disable--}}\n <IconComponent class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} role=\"image\" aria-hidden={{if this.isAriaHidden \"true\"}} aria-label={{@aria-label}} aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}} {{!-- @glint-expect-error --}} tabindex={{@tabIndex}} style={{this.optionalCustomStyles}} color={{@color}} ...attributes>\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </IconComponent>\n {{/let}}\n{{else}}\n {{#if this.useImage}}\n <img {{!-- @glint-expect-error --}} src={{this.icon}} class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} color={{@color}} alt={{if @title @title}} {{!-- @glint-expect-error --}} tabIndex={{@tabIndex}} ...attributes />\n {{else if this.iconComponent}}\n <this.iconComponent class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} color={{@color}} data-type={{this.dataType}} role=\"image\" aria-hidden={{if this.isAriaHidden \"true\"}} aria-label={{@aria-label}} aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}} {{!-- @glint-expect-error --}} tabindex={{@tabIndex}} style={{this.optionalCustomStyles}} ...attributes>\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </this.iconComponent>\n {{/if}}\n{{/if}}", {
154
+ setComponentTemplate(precompileTemplate("{{#if @useComponent}}\n {{!--@glint-expect-error--}}\n {{#let (component @type) as |IconComponent|}}\n {{!--template-lint-disable--}}\n <IconComponent class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} role=\"image\" aria-hidden={{if this.isAriaHidden \"true\"}} aria-label={{@aria-label}} aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}} {{!-- @glint-expect-error --}} tabindex={{@tabIndex}} style={{this.optionalCustomStyles}} color={{@color}} ...attributes>\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </IconComponent>\n {{/let}}\n{{else}}\n {{#if this.useImage}}\n <img {{!-- @glint-expect-error --}} src={{this.icon}} class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} alt={{if @title @title}} {{!-- @glint-expect-error --}} tabIndex={{@tabIndex}} ...attributes />\n {{else if this.iconComponent}}\n <this.iconComponent class={{classNames @iconClasses this.optionalColorClass (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\") componentName=\"EuiIcon\" size=this.size}} color={{@color}} data-type={{this.dataType}} role=\"image\" aria-hidden={{if this.isAriaHidden \"true\"}} aria-label={{@aria-label}} aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}} {{!-- @glint-expect-error --}} tabindex={{@tabIndex}} style={{this.optionalCustomStyles}} ...attributes>\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </this.iconComponent>\n {{/if}}\n{{/if}}", {
155
155
  strictMode: true,
156
156
  scope: () => ({
157
157
  classNames,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-icon.js","sources":["../../src/components/eui-icon.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { warn } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\nimport { and, not } from 'ember-truth-helpers';\n\nimport { loadedIcon } from '../-private/icon-loader.ts';\nimport { emptyIcon, iconDataTypes } from '../-private/icons.ts';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport {\n colorToClassMap,\n typeToPathMap\n} from '../utils/css-mappings/eui-icon.ts';\nimport { keysOf } from './common.ts';\n\nimport type { EuiIconComponent } from '../-private/icons.ts';\nimport type EuiConfigService from '../services/eui-config';\nimport type { sizeToClassNameMap } from '../utils/css-mappings/eui-icon.ts';\nimport type { CommonArgs } from './common.ts';\nimport type { ComponentLike } from '@glint/template';\n\nexport const TYPES = keysOf(typeToPathMap);\n\nexport type EuiIconType = keyof typeof typeToPathMap;\n\nexport type IconType = EuiIconType | string | ComponentLike;\n\nexport const COLORS: NamedColor[] = keysOf(colorToClassMap);\n\ntype NamedColor = keyof typeof colorToClassMap;\n\nfunction isNamedColor(name: NamedColor | string): name is NamedColor {\n return Object.prototype.hasOwnProperty.call(colorToClassMap, name);\n}\n\n// We accept arbitrary color strings, which are impossible to type.\ntype IconColor = string | NamedColor;\n\nexport type IconSize = keyof typeof sizeToClassNameMap;\n\nexport type EuiIconArgs = CommonArgs & {\n /**\n * `Enum` is any of the named icons listed in the docs, `string` is usually a URL to an SVG file, and `elementType` is any Ember Icon SVG component\n */\n type: IconType;\n\n /**\n * One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.\n * Note that coloring only works if your SVG is removed of fill attributes.\n */\n color?: IconColor;\n /**\n * Note that every size other than `original` assumes the provided SVG sits on a square viewbox.\n */\n size?: IconSize;\n\n /**\n * If the type is not a named eui icon, render as Svg, not as img.\n */\n /**\n * @deprecated No longer has any effect. EUI icons are always inline svgs,\n * icons registered through the `euiIcon.icons` config are rendered as\n * components and any other string is treated as an image URL.\n */\n useSvg?: boolean;\n\n /**\n * Descriptive title for naming the icon based on its use\n */\n title?: string;\n /**\n * A unique identifier for the title element\n */\n titleId?: string;\n\n tabIndex?: unknown;\n\n /**\n * Its value should be one or more element IDs\n */\n 'aria-labelledby'?: string;\n\n /**\n * Callback when the icon has been loaded & rendered\n */\n onIconLoad?: () => void;\n\n /**\n * @deprecated Not needed anymore: a component passed as `@type` is\n * always rendered as a component.\n */\n useComponent?: boolean;\n\n /**\n * Classes to pass to the icon\n */\n iconClasses?: string;\n};\n\nexport interface EuiIconSignature {\n Element: HTMLImageElement | Element;\n Args: EuiIconArgs;\n}\n\nfunction isEuiIconType(x: EuiIconArgs['type']): x is EuiIconType {\n return (\n typeof x === 'string' &&\n Object.prototype.hasOwnProperty.call(typeToPathMap, x)\n );\n}\n\nexport default class EuiIcon extends Component<EuiIconSignature> {\n @service declare euiConfig: EuiConfigService;\n\n @argOrDefaultDecorator('m') size!: IconSize;\n\n /**\n * The component rendering the svg: for EUI icon names, for names\n * registered by the app through the `euiIcon.icons` config, and for\n * components passed directly as `@type` (e.g. `@iconType={{MyLogo}}`).\n * EUI icons load the first time they render (see preloadIcons); the empty\n * icon takes their place meanwhile.\n */\n get iconComponent(): EuiIconComponent | undefined {\n const { type } = this.args;\n\n if (type && (typeof type === 'object' || typeof type === 'function')) {\n return type as EuiIconComponent;\n }\n\n if (typeof type !== 'string') return undefined;\n\n if (isEuiIconType(type)) return loadedIcon(type) ?? emptyIcon;\n\n return this.euiConfig.getConfig('euiIcon.icons')?.[type];\n }\n\n get dataType(): string | undefined {\n const { type } = this.args;\n\n return isEuiIconType(type) ? iconDataTypes[type] : undefined;\n }\n\n get useImage(): boolean {\n const { type } = this.args;\n\n if (typeof type !== 'string' || this.iconComponent) return false;\n\n warn(\n `<EuiIcon @type=\"${type}\"> is not an EUI icon nor an icon registered in the \\`euiIcon.icons\\` config, so it is rendered as an <img> with that URL. ` +\n `If this used to be an ember-svg-jar asset, register it instead, e.g. euiConfig.updateConfig({ 'euiIcon.icons': { '${type}': MyIconComponent } }).`,\n /[/.:]/.test(type),\n { id: 'ember-eui.eui-icon.unknown-type' }\n );\n\n return true;\n }\n\n get icon(): IconType | ComponentLike | undefined {\n const { type } = this.args;\n\n if (type === null) {\n return undefined;\n }\n\n //We should probably find a better way to always\n if (isEuiIconType(type)) {\n return this.getEuiIconSvgPath(type);\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n return undefined;\n }\n\n get emptyIcon(): string {\n return this.getEuiIconSvgPath('empty');\n }\n\n getEuiIconSvgPath(type: EuiIconType): string {\n return typeToPathMap[type];\n }\n\n get isAppIcon(): string | boolean {\n const { type } = this.args;\n\n return (\n type &&\n typeof type === 'string' &&\n (/.+App$/.test(type) || /.+Job$/.test(type) || type === 'dataVisualizer')\n );\n }\n\n get appIconHasColor() {\n return this.args.color && this.args.color !== 'default';\n }\n\n get focusable(): string {\n const { tabIndex } = this.args;\n\n return tabIndex == null || tabIndex === -1 ? 'false' : 'true';\n }\n\n // undefined (not '') when there is no custom color, so no `style`\n // attribute is bound (a plain string triggers Ember's style binding warning)\n get optionalCustomStyles(): ReturnType<typeof htmlSafe> | undefined {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (!isNamedColor(color)) {\n return htmlSafe(`fill: ${color}`);\n }\n }\n\n return undefined;\n }\n\n get optionalColorClass(): NamedColor | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (isNamedColor(color)) {\n return colorToClassMap[color];\n } else {\n return 'euiIcon--customColor';\n }\n }\n\n return '';\n }\n\n // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true\n get isAriaHidden(): boolean {\n const { icon } = this;\n\n return (\n icon === 'empty' ||\n !(\n this.args['aria-label'] ||\n this.args['aria-labelledby'] ||\n this.args.title\n )\n );\n }\n\n /**\n * With a `@title` (and no `@aria-label` / `@aria-labelledby`), the svg\n * gets a `<title>` with this id and is labelled by it.\n */\n get titleId(): string | undefined {\n const { title } = this.args;\n\n if (!title || this.args['aria-label'] || this.args['aria-labelledby']) {\n return undefined;\n }\n\n return this.args.titleId ?? `${guidFor(this)}-title`;\n }\n\n <template>\n {{#if @useComponent}}\n {{!@glint-expect-error}}\n {{#let (component @type) as |IconComponent|}}\n {{!template-lint-disable}}\n <IconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{@aria-label}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n color={{@color}}\n ...attributes\n >\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </IconComponent>\n {{/let}}\n {{else}}\n {{#if this.useImage}}\n <img\n {{! @glint-expect-error }}\n src={{this.icon}}\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n color={{@color}}\n alt={{if @title @title}}\n {{! @glint-expect-error }}\n tabIndex={{@tabIndex}}\n ...attributes\n />\n {{else if this.iconComponent}}\n <this.iconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n color={{@color}}\n data-type={{this.dataType}}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{@aria-label}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n ...attributes\n >\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </this.iconComponent>\n {{/if}}\n {{/if}}\n </template>\n}\n"],"names":["TYPES","keysOf","typeToPathMap","COLORS","colorToClassMap","isNamedColor","name","Object","prototype","hasOwnProperty","call","isEuiIconType","x","EuiIcon","Component","g","service","i","argOrDefaultDecorator","iconComponent","type","args","undefined","loadedIcon","emptyIcon","euiConfig","getConfig","dataType","iconDataTypes","useImage","warn","test","id","icon","getEuiIconSvgPath","isAppIcon","appIconHasColor","color","focusable","tabIndex","optionalCustomStyles","htmlSafe","optionalColorClass","isAriaHidden","title","titleId","guidFor","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","and","not"],"mappings":";;;;;;;;;;;;;;;;MAyBaA,KAAA,GAAQC,MAAA,CAAOC,aAAA;MAMfC,MAAQ,GAAeF,MAAA,CAAOG,eAAA;AAI3C,SAASC,YAAAA,CAAaC,IAAyB,EAAW;EACxD,OAAOC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,eAAA,EAAiBE,IAAA,CAAA;AAC/D;AAEA;;AAqEA,SAASK,aAAAA,CAAcC,CAAsB,EAAQ;AACnD,EAAA,OACE,OAAOA,CAAA,KAAM,QAAA,IACbL,MAAA,CAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,aAAA,EAAeU,CAAA,CACtD;AACF;AAEe,MAAMC,gBAAgBC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAP,SAAA,EAAA,WAAA,EAAA,CAC5CQ,OAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAAA,EAAA;AAAAF,IAAAA,CAAA,MAAAP,SAAA,EAAA,MAAA,EAAA,CAEAU,qBAAA,CAAsB,GAAA,CAAA,CAAA,CAAA;AAAA;EAAA,KAAA,IAAAD,CAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAEvB;;;;;;AAMC;EACD,IAAIE,aAAAA,GAA8C;IAChD,MAAM;AAAEC,MAAAA;KAAM,GAAG,IAAI,CAACC,IAAI;AAE1B,IAAA,IAAID,IAAA,KAAS,OAAOA,IAAA,KAAS,YAAY,OAAOA,IAAA,KAAS,UAAU,CAAA,EAAG;AACpE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AS,OAAOA,KAAA,KAAU,QAAA,EAAU;AACtC,MAAA,IAAIhC,aAAagC,KAAA,CAAA,EAAQ;QACvB,OAAOjC,eAAe,CAACiC,KAAA,CAAM;AAC/B,MAAA,CAAA,MAAO;AACL,QAAA,OAAO,sBAAA;AACT,MAAA;AACF,IAAA;AAEA,IAAA,OAAO,EAAA;AACT,EAAA;AAEA;EACA,IAAIM,YAAAA,GAAwB;IAC1B,MAAM;AAAEV,MAAAA;AAAI,KAAE,GAAG,IAAI;IAErB,OACEA,SAAS,OAAA,IACT,EACE,IAAI,CAACZ,IAAI,CAAC,YAAA,CAAa,IACvB,IAAI,CAACA,IAAI,CAAC,iBAAA,CAAkB,IAC5B,IAAI,CAACA,IAAI,CAACuB,KACZ,CACF;AACF,EAAA;AAEA;;;AAGC;EACD,IAAIC,OAAAA,GAA8B;IAChC,MAAM;AAAED,MAAAA;KAAO,GAAG,IAAI,CAACvB,IAAI;AAE3B,IAAA,IAAI,CAACuB,KAAA,IAAS,IAAI,CAACvB,IAAI,CAAC,YAAA,CAAa,IAAI,IAAI,CAACA,IAAI,CAAC,kBAAkB,EAAE;AACrE,MAAA,OAAOC,SAAA;AACT,IAAA;IAEA,OAAO,IAAI,CAACD,IAAI,CAACwB,OAAO,IAAI,CAAA,EAAGC,OAAA,CAAQ,IAAI,CAAA,CAAA,MAAA,CAAS;AACtD,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,swDAAA,EAwEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"eui-icon.js","sources":["../../src/components/eui-icon.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { warn } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\nimport { and, not } from 'ember-truth-helpers';\n\nimport { loadedIcon } from '../-private/icon-loader.ts';\nimport { emptyIcon, iconDataTypes } from '../-private/icons.ts';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport {\n colorToClassMap,\n typeToPathMap\n} from '../utils/css-mappings/eui-icon.ts';\nimport { keysOf } from './common.ts';\n\nimport type { EuiIconComponent } from '../-private/icons.ts';\nimport type EuiConfigService from '../services/eui-config';\nimport type { sizeToClassNameMap } from '../utils/css-mappings/eui-icon.ts';\nimport type { CommonArgs } from './common.ts';\nimport type { ComponentLike } from '@glint/template';\n\nexport const TYPES = keysOf(typeToPathMap);\n\nexport type EuiIconType = keyof typeof typeToPathMap;\n\nexport type IconType = EuiIconType | string | ComponentLike;\n\nexport const COLORS: NamedColor[] = keysOf(colorToClassMap);\n\ntype NamedColor = keyof typeof colorToClassMap;\n\nfunction isNamedColor(name: NamedColor | string): name is NamedColor {\n return Object.prototype.hasOwnProperty.call(colorToClassMap, name);\n}\n\n// We accept arbitrary color strings, which are impossible to type.\ntype IconColor = string | NamedColor;\n\nexport type IconSize = keyof typeof sizeToClassNameMap;\n\nexport type EuiIconArgs = CommonArgs & {\n /**\n * `Enum` is any of the named icons listed in the docs, `string` is usually a URL to an SVG file, and `elementType` is any Ember Icon SVG component\n */\n type: IconType;\n\n /**\n * One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.\n * Note that coloring only works if your SVG is removed of fill attributes.\n */\n color?: IconColor;\n /**\n * Note that every size other than `original` assumes the provided SVG sits on a square viewbox.\n */\n size?: IconSize;\n\n /**\n * If the type is not a named eui icon, render as Svg, not as img.\n */\n /**\n * @deprecated No longer has any effect. EUI icons are always inline svgs,\n * icons registered through the `euiIcon.icons` config are rendered as\n * components and any other string is treated as an image URL.\n */\n useSvg?: boolean;\n\n /**\n * Descriptive title for naming the icon based on its use\n */\n title?: string;\n /**\n * A unique identifier for the title element\n */\n titleId?: string;\n\n tabIndex?: unknown;\n\n /**\n * Its value should be one or more element IDs\n */\n 'aria-labelledby'?: string;\n\n /**\n * Callback when the icon has been loaded & rendered\n */\n onIconLoad?: () => void;\n\n /**\n * @deprecated Not needed anymore: a component passed as `@type` is\n * always rendered as a component.\n */\n useComponent?: boolean;\n\n /**\n * Classes to pass to the icon\n */\n iconClasses?: string;\n};\n\nexport interface EuiIconSignature {\n Element: HTMLImageElement | Element;\n Args: EuiIconArgs;\n}\n\nfunction isEuiIconType(x: EuiIconArgs['type']): x is EuiIconType {\n return (\n typeof x === 'string' &&\n Object.prototype.hasOwnProperty.call(typeToPathMap, x)\n );\n}\n\nexport default class EuiIcon extends Component<EuiIconSignature> {\n @service declare euiConfig: EuiConfigService;\n\n @argOrDefaultDecorator('m') size!: IconSize;\n\n /**\n * The component rendering the svg: for EUI icon names, for names\n * registered by the app through the `euiIcon.icons` config, and for\n * components passed directly as `@type` (e.g. `@iconType={{MyLogo}}`).\n * EUI icons load the first time they render (see preloadIcons); the empty\n * icon takes their place meanwhile.\n */\n get iconComponent(): EuiIconComponent | undefined {\n const { type } = this.args;\n\n if (type && (typeof type === 'object' || typeof type === 'function')) {\n return type as EuiIconComponent;\n }\n\n if (typeof type !== 'string') return undefined;\n\n if (isEuiIconType(type)) return loadedIcon(type) ?? emptyIcon;\n\n return this.euiConfig.getConfig('euiIcon.icons')?.[type];\n }\n\n get dataType(): string | undefined {\n const { type } = this.args;\n\n return isEuiIconType(type) ? iconDataTypes[type] : undefined;\n }\n\n get useImage(): boolean {\n const { type } = this.args;\n\n if (typeof type !== 'string' || this.iconComponent) return false;\n\n warn(\n `<EuiIcon @type=\"${type}\"> is not an EUI icon nor an icon registered in the \\`euiIcon.icons\\` config, so it is rendered as an <img> with that URL. ` +\n `If this used to be an ember-svg-jar asset, register it instead, e.g. euiConfig.updateConfig({ 'euiIcon.icons': { '${type}': MyIconComponent } }).`,\n /[/.:]/.test(type),\n { id: 'ember-eui.eui-icon.unknown-type' }\n );\n\n return true;\n }\n\n get icon(): IconType | ComponentLike | undefined {\n const { type } = this.args;\n\n if (type === null) {\n return undefined;\n }\n\n //We should probably find a better way to always\n if (isEuiIconType(type)) {\n return this.getEuiIconSvgPath(type);\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n return undefined;\n }\n\n get emptyIcon(): string {\n return this.getEuiIconSvgPath('empty');\n }\n\n getEuiIconSvgPath(type: EuiIconType): string {\n return typeToPathMap[type];\n }\n\n get isAppIcon(): string | boolean {\n const { type } = this.args;\n\n return (\n type &&\n typeof type === 'string' &&\n (/.+App$/.test(type) || /.+Job$/.test(type) || type === 'dataVisualizer')\n );\n }\n\n get appIconHasColor() {\n return this.args.color && this.args.color !== 'default';\n }\n\n get focusable(): string {\n const { tabIndex } = this.args;\n\n return tabIndex == null || tabIndex === -1 ? 'false' : 'true';\n }\n\n // undefined (not '') when there is no custom color, so no `style`\n // attribute is bound (a plain string triggers Ember's style binding warning)\n get optionalCustomStyles(): ReturnType<typeof htmlSafe> | undefined {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (!isNamedColor(color)) {\n return htmlSafe(`fill: ${color}`);\n }\n }\n\n return undefined;\n }\n\n get optionalColorClass(): NamedColor | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (isNamedColor(color)) {\n return colorToClassMap[color];\n } else {\n return 'euiIcon--customColor';\n }\n }\n\n return '';\n }\n\n // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true\n get isAriaHidden(): boolean {\n const { icon } = this;\n\n return (\n icon === 'empty' ||\n !(\n this.args['aria-label'] ||\n this.args['aria-labelledby'] ||\n this.args.title\n )\n );\n }\n\n /**\n * With a `@title` (and no `@aria-label` / `@aria-labelledby`), the svg\n * gets a `<title>` with this id and is labelled by it.\n */\n get titleId(): string | undefined {\n const { title } = this.args;\n\n if (!title || this.args['aria-label'] || this.args['aria-labelledby']) {\n return undefined;\n }\n\n return this.args.titleId ?? `${guidFor(this)}-title`;\n }\n\n <template>\n {{#if @useComponent}}\n {{!@glint-expect-error}}\n {{#let (component @type) as |IconComponent|}}\n {{!template-lint-disable}}\n <IconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{@aria-label}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n color={{@color}}\n ...attributes\n >\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </IconComponent>\n {{/let}}\n {{else}}\n {{#if this.useImage}}\n <img\n {{! @glint-expect-error }}\n src={{this.icon}}\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n alt={{if @title @title}}\n {{! @glint-expect-error }}\n tabIndex={{@tabIndex}}\n ...attributes\n />\n {{else if this.iconComponent}}\n <this.iconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n color={{@color}}\n data-type={{this.dataType}}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{@aria-label}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n ...attributes\n >\n {{#if this.titleId}}\n <title id={{this.titleId}}>{{@title}}</title>\n {{/if}}\n </this.iconComponent>\n {{/if}}\n {{/if}}\n </template>\n}\n"],"names":["TYPES","keysOf","typeToPathMap","COLORS","colorToClassMap","isNamedColor","name","Object","prototype","hasOwnProperty","call","isEuiIconType","x","EuiIcon","Component","g","service","i","argOrDefaultDecorator","iconComponent","type","args","undefined","loadedIcon","emptyIcon","euiConfig","getConfig","dataType","iconDataTypes","useImage","warn","test","id","icon","getEuiIconSvgPath","isAppIcon","appIconHasColor","color","focusable","tabIndex","optionalCustomStyles","htmlSafe","optionalColorClass","isAriaHidden","title","titleId","guidFor","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","and","not"],"mappings":";;;;;;;;;;;;;;;;MAyBaA,KAAA,GAAQC,MAAA,CAAOC,aAAA;MAMfC,MAAQ,GAAeF,MAAA,CAAOG,eAAA;AAI3C,SAASC,YAAAA,CAAaC,IAAyB,EAAW;EACxD,OAAOC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,eAAA,EAAiBE,IAAA,CAAA;AAC/D;AAEA;;AAqEA,SAASK,aAAAA,CAAcC,CAAsB,EAAQ;AACnD,EAAA,OACE,OAAOA,CAAA,KAAM,QAAA,IACbL,MAAA,CAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,aAAA,EAAeU,CAAA,CACtD;AACF;AAEe,MAAMC,gBAAgBC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAP,SAAA,EAAA,WAAA,EAAA,CAC5CQ,OAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAAA,EAAA;AAAAF,IAAAA,CAAA,MAAAP,SAAA,EAAA,MAAA,EAAA,CAEAU,qBAAA,CAAsB,GAAA,CAAA,CAAA,CAAA;AAAA;EAAA,KAAA,IAAAD,CAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAEvB;;;;;;AAMC;EACD,IAAIE,aAAAA,GAA8C;IAChD,MAAM;AAAEC,MAAAA;KAAM,GAAG,IAAI,CAACC,IAAI;AAE1B,IAAA,IAAID,IAAA,KAAS,OAAOA,IAAA,KAA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,IAAI,CAAChB,IAAI;AAE3B,IAAA,IAAIgB,KAAA,IAAS,OAAOA,KAAA,KAAU,QAAA,EAAU;AACtC,MAAA,IAAIhC,aAAagC,KAAA,CAAA,EAAQ;QACvB,OAAOjC,eAAe,CAACiC,KAAA,CAAM;AAC/B,MAAA,CAAA,MAAO;AACL,QAAA,OAAO,sBAAA;AACT,MAAA;AACF,IAAA;AAEA,IAAA,OAAO,EAAA;AACT,EAAA;AAEA;EACA,IAAIM,YAAAA,GAAwB;IAC1B,MAAM;AAAEV,MAAAA;AAAI,KAAE,GAAG,IAAI;IAErB,OACEA,SAAS,OAAA,IACT,EACE,IAAI,CAACZ,IAAI,CAAC,YAAA,CAAa,IACvB,IAAI,CAACA,IAAI,CAAC,iBAAA,CAAkB,IAC5B,IAAI,CAACA,IAAI,CAACuB,KACZ,CACF;AACF,EAAA;AAEA;;;AAGC;EACD,IAAIC,OAAAA,GAA8B;IAChC,MAAM;AAAED,MAAAA;KAAO,GAAG,IAAI,CAACvB,IAAI;AAE3B,IAAA,IAAI,CAACuB,KAAA,IAAS,IAAI,CAACvB,IAAI,CAAC,YAAA,CAAa,IAAI,IAAI,CAACA,IAAI,CAAC,kBAAkB,EAAE;AACrE,MAAA,OAAOC,SAAA;AACT,IAAA;IAEA,OAAO,IAAI,CAACD,IAAI,CAACwB,OAAO,IAAI,CAAA,EAAGC,OAAA,CAAQ,IAAI,CAAA,CAAA,MAAA,CAAS;AACtD,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,qvDAAA,EAuEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1,4 +1,4 @@
1
- import { notEq, eq, and, or } from 'ember-truth-helpers';
1
+ import { notEq, eq, or, not, and } from 'ember-truth-helpers';
2
2
  import argOrDefault from '../helpers/arg-or-default.js';
3
3
  import classNames from '../helpers/class-names.js';
4
4
  import screenReaderOnly from '../modifiers/screen-reader-only.js';
@@ -7,13 +7,14 @@ import { precompileTemplate } from '@ember/template-compilation';
7
7
  import { setComponentTemplate } from '@ember/component';
8
8
  import templateOnly from '@ember/component/template-only';
9
9
 
10
- const EuiLink = setComponentTemplate(precompileTemplate("{{#let (argOrDefault @color \"primary\") as |color|}}\n {{#if @href}}\n <a href={{@href}} class={{classNames (if @disabled \"euiLink--disabled\") componentName=\"EuiLink\" color=(unless @disabled color)}} target={{@target}} disabled={{@disabled}} ...attributes>\n\n {{yield}}\n {{#if (or (and (eq @target \"_blank\") (notEq @external false)) (eq @external true))}}\n <EuiIcon @type=\"popout\" @aria-label=\"External link\" @size=\"s\" class=\"euiLink__externalIcon\" />\n {{/if}}\n {{#if (eq @target \"_blank\")}}\n <span {{screenReaderOnly}}>\n (opens in a new tab or window)\n </span>\n {{/if}}\n </a>\n {{else}}\n <button type={{argOrDefault @type \"button\"}} class={{classNames (if @disabled \"euiLink-disabled\") componentName=\"EuiLink\" color=(unless @disabled color)}} disabled={{@disabled}} ...attributes>\n {{yield}}\n </button>\n\n {{/if}}\n{{/let}}", {
10
+ const EuiLink = setComponentTemplate(precompileTemplate("{{#let (argOrDefault @color \"primary\") as |color|}}\n {{!-- like EuiTab and EuiBadge: <a> cannot be disabled, a disabled link is a button --}}\n {{#if (and @href (not @disabled))}}\n <a href={{@href}} class={{classNames componentName=\"EuiLink\" color=color}} target={{@target}} ...attributes>\n\n {{yield}}\n {{#if (or (and (eq @target \"_blank\") (notEq @external false)) (eq @external true))}}\n <EuiIcon @type=\"popout\" @aria-label=\"External link\" @size=\"s\" class=\"euiLink__externalIcon\" />\n {{/if}}\n {{#if (eq @target \"_blank\")}}\n <span {{screenReaderOnly}}>\n (opens in a new tab or window)\n </span>\n {{/if}}\n </a>\n {{else}}\n <button type={{argOrDefault @type \"button\"}} class={{classNames (if @disabled \"euiLink-disabled\") componentName=\"EuiLink\" color=(unless @disabled color)}} disabled={{@disabled}} ...attributes>\n {{yield}}\n </button>\n\n {{/if}}\n{{/let}}", {
11
11
  strictMode: true,
12
12
  scope: () => ({
13
13
  argOrDefault,
14
+ and,
15
+ not,
14
16
  classNames,
15
17
  or,
16
- and,
17
18
  eq,
18
19
  notEq,
19
20
  EuiIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-link.js","sources":["../../src/components/eui-link.gts"],"sourcesContent":["import { and,eq, notEq, or } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport screenReaderOnly from '../modifiers/screen-reader-only.ts';\nimport EuiIcon from './eui-icon.gts';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\n/**\n * A text link: an `<a>` with `@href`, otherwise a `<button>` styled as a\n * link (add `{{on \"click\" …}}`).\n */\nexport interface EuiLinkSignature {\n Element: HTMLAnchorElement | HTMLButtonElement;\n Args: {\n /**\n * `'primary'`, `'subdued'`, `'success'`, `'accent'`, `'danger'`,\n * `'warning'`, `'ghost'` or `'text'`. Defaults to `'primary'`.\n */\n color?: string;\n /** Disables the link. */\n disabled?: boolean;\n /**\n * Shows the external link icon. Defaults to `true` for\n * `@target=\"_blank\"`.\n */\n external?: boolean;\n /** Where it links to; without it the link is a button. */\n href?: string;\n /**\n * `target` of the link. `'_blank'` also adds the external icon and a\n * screen reader note that it opens a new tab.\n */\n target?: string;\n /** `type` of the button (without `@href`). Defaults to `'button'`. */\n type?: string;\n };\n Blocks: {\n /** The link's text. */\n default: [];\n };\n}\n\nconst EuiLink: TemplateOnlyComponent<EuiLinkSignature> = <template>\n {{#let (argOrDefault @color \"primary\") as |color|}}\n {{#if @href}}\n <a\n href={{@href}}\n class={{classNames\n (if @disabled \"euiLink--disabled\")\n componentName=\"EuiLink\"\n color=(unless @disabled color)\n }}\n target={{@target}}\n disabled={{@disabled}}\n ...attributes\n >\n\n {{yield}}\n {{#if\n (or\n (and (eq @target \"_blank\") (notEq @external false))\n (eq @external true)\n )\n }}\n <EuiIcon\n @type=\"popout\"\n @aria-label=\"External link\"\n @size=\"s\"\n class=\"euiLink__externalIcon\"\n />\n {{/if}}\n {{#if (eq @target \"_blank\")}}\n <span {{screenReaderOnly}}>\n (opens in a new tab or window)\n </span>\n {{/if}}\n </a>\n {{else}}\n <button\n type={{argOrDefault @type \"button\"}}\n class={{classNames\n (if @disabled \"euiLink-disabled\")\n componentName=\"EuiLink\"\n color=(unless @disabled color)\n }}\n disabled={{@disabled}}\n ...attributes\n >\n {{yield}}\n </button>\n\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiLink;\n"],"names":["EuiLink","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","classNames","or","and","eq","notEq","EuiIcon","screenReaderOnly","templateOnly"],"mappings":";;;;;;;;;AA4CA,MAAMA,OAA+B,GAAAC,oBAAA,CAAoBC,kBAAA,CAAA,06BAAA,EAmDzD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,YAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,KAAA;IAAAC,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
1
+ {"version":3,"file":"eui-link.js","sources":["../../src/components/eui-link.gts"],"sourcesContent":["import { and, eq, not, notEq, or } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport screenReaderOnly from '../modifiers/screen-reader-only.ts';\nimport EuiIcon from './eui-icon.gts';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\n/**\n * A text link: an `<a>` with `@href`, otherwise a `<button>` styled as a\n * link (add `{{on \"click\" …}}`).\n */\nexport interface EuiLinkSignature {\n Element: HTMLAnchorElement | HTMLButtonElement;\n Args: {\n /**\n * `'primary'`, `'subdued'`, `'success'`, `'accent'`, `'danger'`,\n * `'warning'`, `'ghost'` or `'text'`. Defaults to `'primary'`.\n */\n color?: string;\n /** Disables the link. */\n disabled?: boolean;\n /**\n * Shows the external link icon. Defaults to `true` for\n * `@target=\"_blank\"`.\n */\n external?: boolean;\n /** Where it links to; without it the link is a button. */\n href?: string;\n /**\n * `target` of the link. `'_blank'` also adds the external icon and a\n * screen reader note that it opens a new tab.\n */\n target?: string;\n /** `type` of the button (without `@href`). Defaults to `'button'`. */\n type?: string;\n };\n Blocks: {\n /** The link's text. */\n default: [];\n };\n}\n\nconst EuiLink: TemplateOnlyComponent<EuiLinkSignature> = <template>\n {{#let (argOrDefault @color \"primary\") as |color|}}\n {{! like EuiTab and EuiBadge: <a> cannot be disabled, a disabled link is a button }}\n {{#if (and @href (not @disabled))}}\n <a\n href={{@href}}\n class={{classNames componentName=\"EuiLink\" color=color}}\n target={{@target}}\n ...attributes\n >\n\n {{yield}}\n {{#if\n (or\n (and (eq @target \"_blank\") (notEq @external false))\n (eq @external true)\n )\n }}\n <EuiIcon\n @type=\"popout\"\n @aria-label=\"External link\"\n @size=\"s\"\n class=\"euiLink__externalIcon\"\n />\n {{/if}}\n {{#if (eq @target \"_blank\")}}\n <span {{screenReaderOnly}}>\n (opens in a new tab or window)\n </span>\n {{/if}}\n </a>\n {{else}}\n <button\n type={{argOrDefault @type \"button\"}}\n class={{classNames\n (if @disabled \"euiLink-disabled\")\n componentName=\"EuiLink\"\n color=(unless @disabled color)\n }}\n disabled={{@disabled}}\n ...attributes\n >\n {{yield}}\n </button>\n\n {{/if}}\n {{/let}}\n</template>;\n\nexport default EuiLink;\n"],"names":["EuiLink","setComponentTemplate","precompileTemplate","strictMode","scope","argOrDefault","and","not","classNames","or","eq","notEq","EuiIcon","screenReaderOnly","templateOnly"],"mappings":";;;;;;;;;AA4CA,MAAMA,OAA+B,GAAAC,oBAAA,CAAoBC,kBAAA,CAAA,68BAAA,EA+CzD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,YAAA;IAAAC,GAAA;IAAAC,GAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,EAAA;IAAAC,KAAA;IAAAC,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
@@ -41,7 +41,7 @@ class EuiMarkdownEditorFooterComponent extends Component {
41
41
  }
42
42
  #isShowingHelp = (i(this, "isShowingHelp"), void 0);
43
43
  static {
44
- setComponentTemplate(precompileTemplate("<div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{!-- pending implementation--}}\n <EuiButtonIcon @iconType={{component EuiLoadingSpinner}} @useComponent={{true}} {{!-- aria-label={ariaLabels.uploadingFiles} --}} />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover @isOpen={{this.isPopoverOpen}} @closePopover={{set this \"isPopoverOpen\" false}}>\n <:button>\n <EuiButtonEmpty @iconType=\"error\" @size=\"s\" @color=\"danger\" {{!-- aria-label={ariaLabels.showSyntaxErrors} --}} {{on \"click\" (set this \"isPopoverOpen\" (not this.isPopoverOpen))}}>\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon class=\"euiMarkdownEditorFooter__help\" @iconType={{component MarkdownLogo}} @useComponent={{true}} @color=\"text\" @useSvg={{true}} {{!-- aria-label={ariaLabels.showMarkdownHelp} --}} {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}} />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n <EuiI18n @token=\"euiMarkdownEditorFooter.syntaxTitle\" @default=\"Syntax Help\" as |Token|>\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiI18n @token=\"euiMarkdownEditorFooter.syntaxHelp\" @default={{defaultMarkdownSyntaxHelp}} as |Token|>\n <Token as |value|>\n <EuiMarkdownFormat @value={{value}} />\n </Token>\n </EuiI18n>\n\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n</div>", {
44
+ setComponentTemplate(precompileTemplate("<div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{!-- pending implementation--}}\n <EuiButtonIcon @iconType={{component EuiLoadingSpinner}} @useComponent={{true}} {{!-- aria-label={ariaLabels.uploadingFiles} --}} />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover @isOpen={{this.isPopoverOpen}} @closePopover={{set this \"isPopoverOpen\" false}}>\n <:button>\n <EuiButtonEmpty @iconType=\"error\" @size=\"s\" @color=\"danger\" {{!-- aria-label={ariaLabels.showSyntaxErrors} --}} {{on \"click\" (set this \"isPopoverOpen\" (not this.isPopoverOpen))}}>\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon class=\"euiMarkdownEditorFooter__help\" @iconType={{component MarkdownLogo}} @useComponent={{true}} @color=\"text\" @useSvg={{true}} {{!-- aria-label={ariaLabels.showMarkdownHelp} --}} {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}} />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n <EuiI18n @token=\"euiMarkdownEditorFooter.syntaxTitle\" @default=\"Syntax Help\" as |Token|>\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiI18n @token=\"euiMarkdownEditorFooter.syntaxHelp\" @default={{defaultMarkdownSyntaxHelp}} as |Token|>\n <Token as |value|>\n <EuiMarkdownFormat @value={{value}} />\n </Token>\n </EuiI18n>\n\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle @size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer @size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer @size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n</div>", {
45
45
  strictMode: true,
46
46
  scope: () => ({
47
47
  EuiButtonIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"eui-markdown-editor-footer.js","sources":["../../src/components/eui-markdown-editor-footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport set from 'ember-set-helper/helpers/set';\nimport { and, not } from 'ember-truth-helpers';\n\nimport MarkdownLogo from '../components/eui-markdown-editor-footer/icons/markdown-logo.gts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiHorizontalRule from './eui-horizontal-rule.gts';\nimport EuiI18n from './eui-i18n.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiMarkdownFormat from './eui-markdown-format.gts';\nimport EuiModal from './eui-modal.gts';\nimport EuiModalBody from './eui-modal-body.gts';\nimport EuiModalHeader from './eui-modal-header.gts';\nimport EuiPopover from './eui-popover.gts';\nimport EuiSpacer from './eui-spacer.gts';\nimport EuiTitle from './eui-title.gts';\n\n/** @private EuiMarkdownEditor's footer: upload status, errors and syntax help. */\nexport interface EuiMarkdownEditorFooterSignature {\n Args: {\n /** Shows the upload spinner. */\n isUploadingFiles?: boolean;\n /** Errors shown in a popover. */\n errors?: string[];\n /** The editor's plugins, whose help text the help popover lists. */\n uiPlugins?: any[];\n };\n}\n\nconst defaultMarkdownSyntaxHelp = `\nThe editor uses \n\n[Github flavored markdown](https://github.github.com/gfm/).\n\nYou can also utilize these additional syntax plugins to add rich content to your text.\n`;\n\nexport default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterSignature> {\n @tracked isPopoverOpen = false;\n @tracked isShowingHelp = false;\n\n <template>\n <div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{! pending implementation}}\n <EuiButtonIcon\n @iconType={{component EuiLoadingSpinner}}\n @useComponent={{true}}\n {{! aria-label={ariaLabels.uploadingFiles} }}\n />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover\n @isOpen={{this.isPopoverOpen}}\n @closePopover={{set this \"isPopoverOpen\" false}}\n >\n <:button>\n <EuiButtonEmpty\n @iconType=\"error\"\n @size=\"s\"\n @color=\"danger\"\n {{! aria-label={ariaLabels.showSyntaxErrors} }}\n {{on\n \"click\"\n (set this \"isPopoverOpen\" (not this.isPopoverOpen))\n }}\n >\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon\n class=\"euiMarkdownEditorFooter__help\"\n @iconType={{component MarkdownLogo}}\n @useComponent={{true}}\n @color=\"text\"\n @useSvg={{true}}\n {{! aria-label={ariaLabels.showMarkdownHelp} }}\n {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}}\n />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n <EuiI18n\n @token=\"euiMarkdownEditorFooter.syntaxTitle\"\n @default=\"Syntax Help\"\n as |Token|\n >\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiI18n\n @token=\"euiMarkdownEditorFooter.syntaxHelp\"\n @default={{defaultMarkdownSyntaxHelp}}\n as |Token|\n >\n <Token as |value|>\n <EuiMarkdownFormat @value={{value}} />\n </Token>\n </EuiI18n>\n\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n </div>\n </template>\n}\n"],"names":["defaultMarkdownSyntaxHelp","EuiMarkdownEditorFooterComponent","Component","g","prototype","tracked","i","setComponentTemplate","precompileTemplate","strictMode","scope","EuiButtonIcon","EuiLoadingSpinner","and","EuiPopover","set","EuiButtonEmpty","on","not","MarkdownLogo","EuiModal","EuiModalHeader","EuiTitle","EuiI18n","EuiModalBody","EuiMarkdownFormat","EuiHorizontalRule","EuiSpacer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAMA,4BAA4B;;;;;;AAMlC,CAAC;AAEc,MAAMC,yCAAyCC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACrEC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACxBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAA,MAAA;AAEzB,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,gvEAAA,EA6FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,aAAA;QAAAC,iBAAA;QAAAC,GAAA;oBAAAC,mBAAA;QAAAC,GAAA;QAAAC,cAAA;QAAAC,EAAA;QAAAC,GAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,cAAA;QAAAC,QAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAxB,yBAAA;2BAAAyB,iCAAA;QAAAC,iBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"eui-markdown-editor-footer.js","sources":["../../src/components/eui-markdown-editor-footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport set from 'ember-set-helper/helpers/set';\nimport { and, not } from 'ember-truth-helpers';\n\nimport MarkdownLogo from '../components/eui-markdown-editor-footer/icons/markdown-logo.gts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiHorizontalRule from './eui-horizontal-rule.gts';\nimport EuiI18n from './eui-i18n.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiMarkdownFormat from './eui-markdown-format.gts';\nimport EuiModal from './eui-modal.gts';\nimport EuiModalBody from './eui-modal-body.gts';\nimport EuiModalHeader from './eui-modal-header.gts';\nimport EuiPopover from './eui-popover.gts';\nimport EuiSpacer from './eui-spacer.gts';\nimport EuiTitle from './eui-title.gts';\n\n/** @private EuiMarkdownEditor's footer: upload status, errors and syntax help. */\nexport interface EuiMarkdownEditorFooterSignature {\n Args: {\n /** Shows the upload spinner. */\n isUploadingFiles?: boolean;\n /** Errors shown in a popover. */\n errors?: string[];\n /** The editor's plugins, whose help text the help popover lists. */\n uiPlugins?: any[];\n };\n}\n\nconst defaultMarkdownSyntaxHelp = `\nThe editor uses \n\n[Github flavored markdown](https://github.github.com/gfm/).\n\nYou can also utilize these additional syntax plugins to add rich content to your text.\n`;\n\nexport default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterSignature> {\n @tracked isPopoverOpen = false;\n @tracked isShowingHelp = false;\n\n <template>\n <div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{! pending implementation}}\n <EuiButtonIcon\n @iconType={{component EuiLoadingSpinner}}\n @useComponent={{true}}\n {{! aria-label={ariaLabels.uploadingFiles} }}\n />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover\n @isOpen={{this.isPopoverOpen}}\n @closePopover={{set this \"isPopoverOpen\" false}}\n >\n <:button>\n <EuiButtonEmpty\n @iconType=\"error\"\n @size=\"s\"\n @color=\"danger\"\n {{! aria-label={ariaLabels.showSyntaxErrors} }}\n {{on\n \"click\"\n (set this \"isPopoverOpen\" (not this.isPopoverOpen))\n }}\n >\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon\n class=\"euiMarkdownEditorFooter__help\"\n @iconType={{component MarkdownLogo}}\n @useComponent={{true}}\n @color=\"text\"\n @useSvg={{true}}\n {{! aria-label={ariaLabels.showMarkdownHelp} }}\n {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}}\n />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n <EuiI18n\n @token=\"euiMarkdownEditorFooter.syntaxTitle\"\n @default=\"Syntax Help\"\n as |Token|\n >\n <Token as |value|>\n {{value}}\n </Token>\n </EuiI18n>\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiI18n\n @token=\"euiMarkdownEditorFooter.syntaxHelp\"\n @default={{defaultMarkdownSyntaxHelp}}\n as |Token|\n >\n <Token as |value|>\n <EuiMarkdownFormat @value={{value}} />\n </Token>\n </EuiI18n>\n\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle @size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer @size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer @size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n </div>\n </template>\n}\n"],"names":["defaultMarkdownSyntaxHelp","EuiMarkdownEditorFooterComponent","Component","g","prototype","tracked","i","setComponentTemplate","precompileTemplate","strictMode","scope","EuiButtonIcon","EuiLoadingSpinner","and","EuiPopover","set","EuiButtonEmpty","on","not","MarkdownLogo","EuiModal","EuiModalHeader","EuiTitle","EuiI18n","EuiModalBody","EuiMarkdownFormat","EuiHorizontalRule","EuiSpacer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAMA,4BAA4B;;;;;;AAMlC,CAAC;AAEc,MAAMC,yCAAyCC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACrEC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACxBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAA,MAAA;AAEzB,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,mvEAAA,EA6FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,aAAA;QAAAC,iBAAA;QAAAC,GAAA;oBAAAC,mBAAA;QAAAC,GAAA;QAAAC,cAAA;QAAAC,EAAA;QAAAC,GAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,cAAA;QAAAC,QAAA;iBAAAC,gBAAA;QAAAC,YAAA;QAAAxB,yBAAA;2BAAAyB,iCAAA;QAAAC,iBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -4,7 +4,7 @@ import { precompileTemplate } from '@ember/template-compilation';
4
4
  import { setComponentTemplate } from '@ember/component';
5
5
  import templateOnly from '@ember/component/template-only';
6
6
 
7
- const EuiRangeThumb = setComponentTemplate(precompileTemplate("{{!-- template-lint-disable --}}\n<button type=\"button\" class={{classNames \"euiRangeThumb\" (if @showTicks \"euiRangeThumb--hasTicks\")}} aria-valuemin={{@min}} aria-valuemax={{@max}} aria-valuenow={{castTo @value to=\"number\"}} aria-diabled={{@disabled}} tabindex={{if @disabled -1 (if @tabIndex @tabIndex 0)}} ...attributes>\n <div role=\"slider\" aria-valuemin={{@min}} aria-valuemax={{@max}} aria-valuenow={{castTo @value to=\"number\"}} aria-diabled={{@disabled}} tabindex={{if @disabled -1 (if @tabIndex 0)}}></div>\n</button>\n{{!-- template-lint-enable --}}", {
7
+ const EuiRangeThumb = setComponentTemplate(precompileTemplate("{{!-- template-lint-disable --}}\n<button type=\"button\" class={{classNames \"euiRangeThumb\" (if @showTicks \"euiRangeThumb--hasTicks\")}} aria-valuemin={{@min}} aria-valuemax={{@max}} aria-valuenow={{castTo @value to=\"number\"}} aria-disabled={{if @disabled \"true\"}} tabindex={{if @disabled -1 (if @tabIndex @tabIndex 0)}} ...attributes>\n <div role=\"slider\" aria-valuemin={{@min}} aria-valuemax={{@max}} aria-valuenow={{castTo @value to=\"number\"}} aria-disabled={{if @disabled \"true\"}} tabindex={{if @disabled -1 (if @tabIndex 0)}}></div>\n</button>\n{{!-- template-lint-enable --}}", {
8
8
  strictMode: true,
9
9
  scope: () => ({
10
10
  classNames,