@ember-eui/core 8.0.65 → 8.0.67

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 (441) hide show
  1. package/declarations/-private/associate-form-row-label.d.ts +9 -0
  2. package/declarations/-private/associate-form-row-label.d.ts.map +1 -0
  3. package/declarations/-private/color.d.ts +64 -0
  4. package/declarations/-private/color.d.ts.map +1 -0
  5. package/declarations/-private/css-style.d.ts +11 -0
  6. package/declarations/-private/css-style.d.ts.map +1 -0
  7. package/declarations/-private/drag-drop.d.ts +13 -0
  8. package/declarations/-private/drag-drop.d.ts.map +1 -0
  9. package/declarations/-private/event-helpers.d.ts +12 -0
  10. package/declarations/-private/event-helpers.d.ts.map +1 -0
  11. package/declarations/-private/icon-loader.d.ts +13 -0
  12. package/declarations/-private/icon-loader.d.ts.map +1 -0
  13. package/declarations/-private/icons.d.ts +18 -0
  14. package/declarations/-private/icons.d.ts.map +1 -0
  15. package/declarations/-private/language-loader.d.ts +12 -0
  16. package/declarations/-private/language-loader.d.ts.map +1 -0
  17. package/declarations/-private/languages.d.ts +10 -0
  18. package/declarations/-private/languages.d.ts.map +1 -0
  19. package/declarations/-private/link-form-row-control.d.ts +17 -0
  20. package/declarations/-private/link-form-row-control.d.ts.map +1 -0
  21. package/declarations/-private/random-id.d.ts +2 -0
  22. package/declarations/-private/random-id.d.ts.map +1 -1
  23. package/declarations/-private/resizable.d.ts +34 -0
  24. package/declarations/-private/resizable.d.ts.map +1 -0
  25. package/declarations/-private/selectable-options.d.ts +38 -0
  26. package/declarations/-private/selectable-options.d.ts.map +1 -0
  27. package/declarations/-private/set-body-class.d.ts +14 -0
  28. package/declarations/-private/set-body-class.d.ts.map +1 -0
  29. package/declarations/-private/table.d.ts +20 -0
  30. package/declarations/-private/table.d.ts.map +1 -0
  31. package/declarations/-private/text-diff.d.ts +11 -0
  32. package/declarations/-private/text-diff.d.ts.map +1 -0
  33. package/declarations/-private/vis-colors.d.ts +8 -0
  34. package/declarations/-private/vis-colors.d.ts.map +1 -0
  35. package/declarations/components/eui-aspect-ratio.d.ts +23 -0
  36. package/declarations/components/eui-aspect-ratio.d.ts.map +1 -0
  37. package/declarations/components/eui-beacon.d.ts +15 -0
  38. package/declarations/components/eui-beacon.d.ts.map +1 -0
  39. package/declarations/components/eui-color-palette-display.d.ts +25 -0
  40. package/declarations/components/eui-color-palette-display.d.ts.map +1 -0
  41. package/declarations/components/eui-color-palette-picker.d.ts +53 -0
  42. package/declarations/components/eui-color-palette-picker.d.ts.map +1 -0
  43. package/declarations/components/eui-color-picker-swatch.d.ts +19 -0
  44. package/declarations/components/eui-color-picker-swatch.d.ts.map +1 -0
  45. package/declarations/components/eui-color-picker.d.ts +153 -0
  46. package/declarations/components/eui-color-picker.d.ts.map +1 -0
  47. package/declarations/components/eui-color-stops/thumb.d.ts +56 -0
  48. package/declarations/components/eui-color-stops/thumb.d.ts.map +1 -0
  49. package/declarations/components/eui-color-stops.d.ts +100 -0
  50. package/declarations/components/eui-color-stops.d.ts.map +1 -0
  51. package/declarations/components/eui-combo-box/options.d.ts +1 -2
  52. package/declarations/components/eui-combo-box/options.d.ts.map +1 -1
  53. package/declarations/components/eui-context-menu-item.d.ts +22 -2
  54. package/declarations/components/eui-context-menu-item.d.ts.map +1 -1
  55. package/declarations/components/eui-context-menu-panel.d.ts +87 -3
  56. package/declarations/components/eui-context-menu-panel.d.ts.map +1 -1
  57. package/declarations/components/eui-context-menu.d.ts +94 -0
  58. package/declarations/components/eui-context-menu.d.ts.map +1 -0
  59. package/declarations/components/eui-control-bar.d.ts +110 -0
  60. package/declarations/components/eui-control-bar.d.ts.map +1 -0
  61. package/declarations/components/eui-date-picker-range.d.ts +28 -0
  62. package/declarations/components/eui-date-picker-range.d.ts.map +1 -0
  63. package/declarations/components/eui-delay-hide.d.ts +21 -0
  64. package/declarations/components/eui-delay-hide.d.ts.map +1 -0
  65. package/declarations/components/eui-delay-render.d.ts +21 -0
  66. package/declarations/components/eui-delay-render.d.ts.map +1 -0
  67. package/declarations/components/eui-drag-drop-context.d.ts +66 -0
  68. package/declarations/components/eui-drag-drop-context.d.ts.map +1 -0
  69. package/declarations/components/eui-draggable.d.ts +76 -0
  70. package/declarations/components/eui-draggable.d.ts.map +1 -0
  71. package/declarations/components/eui-droppable.d.ts +86 -0
  72. package/declarations/components/eui-droppable.d.ts.map +1 -0
  73. package/declarations/components/eui-expression.d.ts +46 -0
  74. package/declarations/components/eui-expression.d.ts.map +1 -0
  75. package/declarations/components/eui-facet-button.d.ts +30 -0
  76. package/declarations/components/eui-facet-button.d.ts.map +1 -0
  77. package/declarations/components/eui-facet-group.d.ts +21 -0
  78. package/declarations/components/eui-facet-group.d.ts.map +1 -0
  79. package/declarations/components/eui-filter-button.d.ts +54 -0
  80. package/declarations/components/eui-filter-button.d.ts.map +1 -0
  81. package/declarations/components/eui-filter-group.d.ts +19 -0
  82. package/declarations/components/eui-filter-group.d.ts.map +1 -0
  83. package/declarations/components/eui-filter-select-item.d.ts +29 -0
  84. package/declarations/components/eui-filter-select-item.d.ts.map +1 -0
  85. package/declarations/components/eui-highlight.d.ts +26 -0
  86. package/declarations/components/eui-highlight.d.ts.map +1 -0
  87. package/declarations/components/eui-hue.d.ts +25 -0
  88. package/declarations/components/eui-hue.d.ts.map +1 -0
  89. package/declarations/components/eui-i18n-number.d.ts +25 -0
  90. package/declarations/components/eui-i18n-number.d.ts.map +1 -0
  91. package/declarations/components/eui-loading-chart.d.ts +17 -0
  92. package/declarations/components/eui-loading-chart.d.ts.map +1 -0
  93. package/declarations/components/eui-loading-elastic.d.ts +15 -0
  94. package/declarations/components/eui-loading-elastic.d.ts.map +1 -0
  95. package/declarations/components/eui-mark.d.ts +15 -0
  96. package/declarations/components/eui-mark.d.ts.map +1 -0
  97. package/declarations/components/eui-markdown-editor.d.ts +2 -2
  98. package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
  99. package/declarations/components/eui-pinnable-list-group.d.ts +59 -0
  100. package/declarations/components/eui-pinnable-list-group.d.ts.map +1 -0
  101. package/declarations/components/eui-popover.d.ts +1 -0
  102. package/declarations/components/eui-popover.d.ts.map +1 -1
  103. package/declarations/components/eui-refresh-interval.d.ts +46 -0
  104. package/declarations/components/eui-refresh-interval.d.ts.map +1 -0
  105. package/declarations/components/eui-resizable-container/button.d.ts +38 -0
  106. package/declarations/components/eui-resizable-container/button.d.ts.map +1 -0
  107. package/declarations/components/eui-resizable-container/collapse-button.d.ts +15 -0
  108. package/declarations/components/eui-resizable-container/collapse-button.d.ts.map +1 -0
  109. package/declarations/components/eui-resizable-container/panel.d.ts +86 -0
  110. package/declarations/components/eui-resizable-container/panel.d.ts.map +1 -0
  111. package/declarations/components/eui-resizable-container.d.ts +82 -0
  112. package/declarations/components/eui-resizable-container.d.ts.map +1 -0
  113. package/declarations/components/eui-saturation.d.ts +62 -0
  114. package/declarations/components/eui-saturation.d.ts.map +1 -0
  115. package/declarations/components/eui-screen-reader-only.d.ts +23 -0
  116. package/declarations/components/eui-screen-reader-only.d.ts.map +1 -0
  117. package/declarations/components/eui-selectable-list-item.d.ts +53 -3
  118. package/declarations/components/eui-selectable-list-item.d.ts.map +1 -1
  119. package/declarations/components/eui-selectable-list.d.ts +95 -0
  120. package/declarations/components/eui-selectable-list.d.ts.map +1 -0
  121. package/declarations/components/eui-selectable-message.d.ts +19 -0
  122. package/declarations/components/eui-selectable-message.d.ts.map +1 -0
  123. package/declarations/components/eui-selectable-search.d.ts +33 -0
  124. package/declarations/components/eui-selectable-search.d.ts.map +1 -0
  125. package/declarations/components/eui-selectable-template-sitewide.d.ts +86 -0
  126. package/declarations/components/eui-selectable-template-sitewide.d.ts.map +1 -0
  127. package/declarations/components/eui-selectable.d.ts +123 -0
  128. package/declarations/components/eui-selectable.d.ts.map +1 -0
  129. package/declarations/components/eui-skip-link.d.ts +31 -0
  130. package/declarations/components/eui-skip-link.d.ts.map +1 -0
  131. package/declarations/components/eui-suggest-input.d.ts +55 -0
  132. package/declarations/components/eui-suggest-input.d.ts.map +1 -0
  133. package/declarations/components/eui-suggest-item.d.ts +38 -0
  134. package/declarations/components/eui-suggest-item.d.ts.map +1 -0
  135. package/declarations/components/eui-suggest.d.ts +52 -0
  136. package/declarations/components/eui-suggest.d.ts.map +1 -0
  137. package/declarations/components/eui-super-date-picker/eui-quick-select-popover.d.ts +7 -1
  138. package/declarations/components/eui-super-date-picker/eui-quick-select-popover.d.ts.map +1 -1
  139. package/declarations/components/eui-super-date-picker.d.ts +69 -18
  140. package/declarations/components/eui-super-date-picker.d.ts.map +1 -1
  141. package/declarations/components/eui-super-select-control.d.ts +57 -0
  142. package/declarations/components/eui-super-select-control.d.ts.map +1 -0
  143. package/declarations/components/eui-super-select.d.ts +84 -0
  144. package/declarations/components/eui-super-select.d.ts.map +1 -0
  145. package/declarations/components/eui-table-body.d.ts +12 -0
  146. package/declarations/components/eui-table-body.d.ts.map +1 -0
  147. package/declarations/components/eui-table-footer-cell.d.ts +19 -0
  148. package/declarations/components/eui-table-footer-cell.d.ts.map +1 -0
  149. package/declarations/components/eui-table-footer.d.ts +12 -0
  150. package/declarations/components/eui-table-footer.d.ts.map +1 -0
  151. package/declarations/components/eui-table-header-button.d.ts +17 -0
  152. package/declarations/components/eui-table-header-button.d.ts.map +1 -0
  153. package/declarations/components/eui-table-header-cell-checkbox.d.ts +18 -0
  154. package/declarations/components/eui-table-header-cell-checkbox.d.ts.map +1 -0
  155. package/declarations/components/eui-table-header-cell.d.ts +43 -0
  156. package/declarations/components/eui-table-header-cell.d.ts.map +1 -0
  157. package/declarations/components/eui-table-header-mobile.d.ts +15 -0
  158. package/declarations/components/eui-table-header-mobile.d.ts.map +1 -0
  159. package/declarations/components/eui-table-header.d.ts +16 -0
  160. package/declarations/components/eui-table-header.d.ts.map +1 -0
  161. package/declarations/components/eui-table-pagination.d.ts +40 -0
  162. package/declarations/components/eui-table-pagination.d.ts.map +1 -0
  163. package/declarations/components/eui-table-row-cell-checkbox.d.ts +12 -0
  164. package/declarations/components/eui-table-row-cell-checkbox.d.ts.map +1 -0
  165. package/declarations/components/eui-table-row-cell.d.ts +44 -0
  166. package/declarations/components/eui-table-row-cell.d.ts.map +1 -0
  167. package/declarations/components/eui-table-row.d.ts +26 -0
  168. package/declarations/components/eui-table-row.d.ts.map +1 -0
  169. package/declarations/components/eui-table-sort-mobile-item.d.ts +22 -0
  170. package/declarations/components/eui-table-sort-mobile-item.d.ts.map +1 -0
  171. package/declarations/components/eui-table-sort-mobile.d.ts +37 -0
  172. package/declarations/components/eui-table-sort-mobile.d.ts.map +1 -0
  173. package/declarations/components/eui-table.d.ts +28 -0
  174. package/declarations/components/eui-table.d.ts.map +1 -0
  175. package/declarations/components/eui-text-diff.d.ts +30 -0
  176. package/declarations/components/eui-text-diff.d.ts.map +1 -0
  177. package/declarations/components/eui-token.d.ts +37 -0
  178. package/declarations/components/eui-token.d.ts.map +1 -0
  179. package/declarations/components/eui-tour-step-indicator.d.ts +19 -0
  180. package/declarations/components/eui-tour-step-indicator.d.ts.map +1 -0
  181. package/declarations/components/eui-tour-step.d.ts +93 -0
  182. package/declarations/components/eui-tour-step.d.ts.map +1 -0
  183. package/declarations/components/eui-tour.d.ts +77 -0
  184. package/declarations/components/eui-tour.d.ts.map +1 -0
  185. package/declarations/components/eui-tree-view.d.ts +71 -0
  186. package/declarations/components/eui-tree-view.d.ts.map +1 -0
  187. package/declarations/components.d.ts +75 -1
  188. package/declarations/components.d.ts.map +1 -1
  189. package/declarations/services/eui-i18n.d.ts +6 -0
  190. package/declarations/services/eui-i18n.d.ts.map +1 -1
  191. package/declarations/template-registry.d.ts +221 -0
  192. package/declarations/template-registry.d.ts.map +1 -1
  193. package/declarations/utils/drag-drop.d.ts +21 -0
  194. package/declarations/utils/drag-drop.d.ts.map +1 -0
  195. package/declarations/utils/icons-from-glob.d.ts +39 -0
  196. package/declarations/utils/icons-from-glob.d.ts.map +1 -0
  197. package/declarations/utils/preload-icons.d.ts +21 -0
  198. package/declarations/utils/preload-icons.d.ts.map +1 -0
  199. package/declarations/utils/token-map.d.ts +11 -0
  200. package/declarations/utils/token-map.d.ts.map +1 -0
  201. package/dist/-private/color.js +168 -0
  202. package/dist/-private/color.js.map +1 -0
  203. package/dist/-private/css-style.js +24 -0
  204. package/dist/-private/css-style.js.map +1 -0
  205. package/dist/-private/random-id.js +2 -1
  206. package/dist/-private/random-id.js.map +1 -1
  207. package/dist/-private/resizable.js +44 -0
  208. package/dist/-private/resizable.js.map +1 -0
  209. package/dist/-private/selectable-options.js +59 -0
  210. package/dist/-private/selectable-options.js.map +1 -0
  211. package/dist/-private/table.js +20 -0
  212. package/dist/-private/table.js.map +1 -0
  213. package/dist/-private/text-diff.js +94 -0
  214. package/dist/-private/text-diff.js.map +1 -0
  215. package/dist/_app_/components/eui-aspect-ratio.js +1 -0
  216. package/dist/_app_/components/eui-beacon.js +1 -0
  217. package/dist/_app_/components/eui-color-palette-display.js +1 -0
  218. package/dist/_app_/components/eui-color-palette-picker.js +1 -0
  219. package/dist/_app_/components/eui-color-picker-swatch.js +1 -0
  220. package/dist/_app_/components/eui-color-picker.js +1 -0
  221. package/dist/_app_/components/eui-color-stops/thumb.js +1 -0
  222. package/dist/_app_/components/eui-color-stops.js +1 -0
  223. package/dist/_app_/components/eui-context-menu.js +1 -0
  224. package/dist/_app_/components/eui-control-bar.js +1 -0
  225. package/dist/_app_/components/eui-date-picker-range.js +1 -0
  226. package/dist/_app_/components/eui-delay-hide.js +1 -0
  227. package/dist/_app_/components/eui-delay-render.js +1 -0
  228. package/dist/_app_/components/eui-drag-drop-context.js +1 -0
  229. package/dist/_app_/components/eui-draggable.js +1 -0
  230. package/dist/_app_/components/eui-droppable.js +1 -0
  231. package/dist/_app_/components/eui-expression.js +1 -0
  232. package/dist/_app_/components/eui-facet-button.js +1 -0
  233. package/dist/_app_/components/eui-facet-group.js +1 -0
  234. package/dist/_app_/components/eui-filter-button.js +1 -0
  235. package/dist/_app_/components/eui-filter-group.js +1 -0
  236. package/dist/_app_/components/eui-filter-select-item.js +1 -0
  237. package/dist/_app_/components/eui-highlight.js +1 -0
  238. package/dist/_app_/components/eui-hue.js +1 -0
  239. package/dist/_app_/components/eui-i18n-number.js +1 -0
  240. package/dist/_app_/components/eui-loading-chart.js +1 -0
  241. package/dist/_app_/components/eui-loading-elastic.js +1 -0
  242. package/dist/_app_/components/eui-mark.js +1 -0
  243. package/dist/_app_/components/eui-pinnable-list-group.js +1 -0
  244. package/dist/_app_/components/eui-refresh-interval.js +1 -0
  245. package/dist/_app_/components/eui-resizable-container/button.js +1 -0
  246. package/dist/_app_/components/eui-resizable-container/collapse-button.js +1 -0
  247. package/dist/_app_/components/eui-resizable-container/panel.js +1 -0
  248. package/dist/_app_/components/eui-resizable-container.js +1 -0
  249. package/dist/_app_/components/eui-saturation.js +1 -0
  250. package/dist/_app_/components/eui-screen-reader-only.js +1 -0
  251. package/dist/_app_/components/eui-selectable-list.js +1 -0
  252. package/dist/_app_/components/eui-selectable-message.js +1 -0
  253. package/dist/_app_/components/eui-selectable-search.js +1 -0
  254. package/dist/_app_/components/eui-selectable-template-sitewide.js +1 -0
  255. package/dist/_app_/components/eui-selectable.js +1 -0
  256. package/dist/_app_/components/eui-skip-link.js +1 -0
  257. package/dist/_app_/components/eui-suggest-input.js +1 -0
  258. package/dist/_app_/components/eui-suggest-item.js +1 -0
  259. package/dist/_app_/components/eui-suggest.js +1 -0
  260. package/dist/_app_/components/eui-super-select-control.js +1 -0
  261. package/dist/_app_/components/eui-super-select.js +1 -0
  262. package/dist/_app_/components/eui-table-body.js +1 -0
  263. package/dist/_app_/components/eui-table-footer-cell.js +1 -0
  264. package/dist/_app_/components/eui-table-footer.js +1 -0
  265. package/dist/_app_/components/eui-table-header-button.js +1 -0
  266. package/dist/_app_/components/eui-table-header-cell-checkbox.js +1 -0
  267. package/dist/_app_/components/eui-table-header-cell.js +1 -0
  268. package/dist/_app_/components/eui-table-header-mobile.js +1 -0
  269. package/dist/_app_/components/eui-table-header.js +1 -0
  270. package/dist/_app_/components/eui-table-pagination.js +1 -0
  271. package/dist/_app_/components/eui-table-row-cell-checkbox.js +1 -0
  272. package/dist/_app_/components/eui-table-row-cell.js +1 -0
  273. package/dist/_app_/components/eui-table-row.js +1 -0
  274. package/dist/_app_/components/eui-table-sort-mobile-item.js +1 -0
  275. package/dist/_app_/components/eui-table-sort-mobile.js +1 -0
  276. package/dist/_app_/components/eui-table.js +1 -0
  277. package/dist/_app_/components/eui-text-diff.js +1 -0
  278. package/dist/_app_/components/eui-token.js +1 -0
  279. package/dist/_app_/components/eui-tour-step-indicator.js +1 -0
  280. package/dist/_app_/components/eui-tour-step.js +1 -0
  281. package/dist/_app_/components/eui-tour.js +1 -0
  282. package/dist/_app_/components/eui-tree-view.js +1 -0
  283. package/dist/components/eui-aspect-ratio.js +45 -0
  284. package/dist/components/eui-aspect-ratio.js.map +1 -0
  285. package/dist/components/eui-beacon.js +29 -0
  286. package/dist/components/eui-beacon.js.map +1 -0
  287. package/dist/components/eui-color-palette-display.js +67 -0
  288. package/dist/components/eui-color-palette-display.js.map +1 -0
  289. package/dist/components/eui-color-palette-picker.js +96 -0
  290. package/dist/components/eui-color-palette-picker.js.map +1 -0
  291. package/dist/components/eui-color-picker-swatch.js +51 -0
  292. package/dist/components/eui-color-picker-swatch.js.map +1 -0
  293. package/dist/components/eui-color-picker.js +529 -0
  294. package/dist/components/eui-color-picker.js.map +1 -0
  295. package/dist/components/eui-color-stops/thumb.js +278 -0
  296. package/dist/components/eui-color-stops/thumb.js.map +1 -0
  297. package/dist/components/eui-color-stops.js +405 -0
  298. package/dist/components/eui-color-stops.js.map +1 -0
  299. package/dist/components/eui-combo-box/options.js +14 -17
  300. package/dist/components/eui-combo-box/options.js.map +1 -1
  301. package/dist/components/eui-context-menu-item.js +7 -3
  302. package/dist/components/eui-context-menu-item.js.map +1 -1
  303. package/dist/components/eui-context-menu-panel.js +218 -7
  304. package/dist/components/eui-context-menu-panel.js.map +1 -1
  305. package/dist/components/eui-context-menu.js +254 -0
  306. package/dist/components/eui-context-menu.js.map +1 -0
  307. package/dist/components/eui-control-bar.js +241 -0
  308. package/dist/components/eui-control-bar.js.map +1 -0
  309. package/dist/components/eui-date-picker-range.js +42 -0
  310. package/dist/components/eui-date-picker-range.js.map +1 -0
  311. package/dist/components/eui-delay-hide.js +68 -0
  312. package/dist/components/eui-delay-hide.js.map +1 -0
  313. package/dist/components/eui-delay-render.js +38 -0
  314. package/dist/components/eui-delay-render.js.map +1 -0
  315. package/dist/components/eui-drag-drop-context.js +85 -0
  316. package/dist/components/eui-drag-drop-context.js.map +1 -0
  317. package/dist/components/eui-draggable.js +201 -0
  318. package/dist/components/eui-draggable.js.map +1 -0
  319. package/dist/components/eui-droppable.js +140 -0
  320. package/dist/components/eui-droppable.js.map +1 -0
  321. package/dist/components/eui-expression.js +88 -0
  322. package/dist/components/eui-expression.js.map +1 -0
  323. package/dist/components/eui-facet-button.js +66 -0
  324. package/dist/components/eui-facet-button.js.map +1 -0
  325. package/dist/components/eui-facet-group.js +41 -0
  326. package/dist/components/eui-facet-group.js.map +1 -0
  327. package/dist/components/eui-filter-button.js +106 -0
  328. package/dist/components/eui-filter-button.js.map +1 -0
  329. package/dist/components/eui-filter-group.js +20 -0
  330. package/dist/components/eui-filter-group.js.map +1 -0
  331. package/dist/components/eui-filter-select-item.js +58 -0
  332. package/dist/components/eui-filter-select-item.js.map +1 -0
  333. package/dist/components/eui-highlight.js +61 -0
  334. package/dist/components/eui-highlight.js.map +1 -0
  335. package/dist/components/eui-hue.js +57 -0
  336. package/dist/components/eui-hue.js.map +1 -0
  337. package/dist/components/eui-i18n-number.js +43 -0
  338. package/dist/components/eui-i18n-number.js.map +1 -0
  339. package/dist/components/eui-loading-chart.js +34 -0
  340. package/dist/components/eui-loading-chart.js.map +1 -0
  341. package/dist/components/eui-loading-elastic.js +34 -0
  342. package/dist/components/eui-loading-elastic.js.map +1 -0
  343. package/dist/components/eui-mark.js +17 -0
  344. package/dist/components/eui-mark.js.map +1 -0
  345. package/dist/components/eui-pinnable-list-group.js +102 -0
  346. package/dist/components/eui-pinnable-list-group.js.map +1 -0
  347. package/dist/components/eui-popover.js.map +1 -1
  348. package/dist/components/eui-refresh-interval.js +205 -0
  349. package/dist/components/eui-refresh-interval.js.map +1 -0
  350. package/dist/components/eui-resizable-container/button.js +87 -0
  351. package/dist/components/eui-resizable-container/button.js.map +1 -0
  352. package/dist/components/eui-resizable-container/collapse-button.js +36 -0
  353. package/dist/components/eui-resizable-container/collapse-button.js.map +1 -0
  354. package/dist/components/eui-resizable-container/panel.js +246 -0
  355. package/dist/components/eui-resizable-container/panel.js.map +1 -0
  356. package/dist/components/eui-resizable-container.js +306 -0
  357. package/dist/components/eui-resizable-container.js.map +1 -0
  358. package/dist/components/eui-saturation.js +197 -0
  359. package/dist/components/eui-saturation.js.map +1 -0
  360. package/dist/components/eui-screen-reader-only.js +25 -0
  361. package/dist/components/eui-screen-reader-only.js.map +1 -0
  362. package/dist/components/eui-selectable-list-item.js +131 -24
  363. package/dist/components/eui-selectable-list-item.js.map +1 -1
  364. package/dist/components/eui-selectable-list.js +169 -0
  365. package/dist/components/eui-selectable-list.js.map +1 -0
  366. package/dist/components/eui-selectable-message.js +27 -0
  367. package/dist/components/eui-selectable-message.js.map +1 -0
  368. package/dist/components/eui-selectable-search.js +54 -0
  369. package/dist/components/eui-selectable-search.js.map +1 -0
  370. package/dist/components/eui-selectable-template-sitewide.js +259 -0
  371. package/dist/components/eui-selectable-template-sitewide.js.map +1 -0
  372. package/dist/components/eui-selectable.js +334 -0
  373. package/dist/components/eui-selectable.js.map +1 -0
  374. package/dist/components/eui-skip-link.js +40 -0
  375. package/dist/components/eui-skip-link.js.map +1 -0
  376. package/dist/components/eui-suggest-input.js +140 -0
  377. package/dist/components/eui-suggest-input.js.map +1 -0
  378. package/dist/components/eui-suggest-item.js +59 -0
  379. package/dist/components/eui-suggest-item.js.map +1 -0
  380. package/dist/components/eui-suggest.js +89 -0
  381. package/dist/components/eui-suggest.js.map +1 -0
  382. package/dist/components/eui-super-date-picker/eui-quick-select-popover.js +12 -1
  383. package/dist/components/eui-super-date-picker/eui-quick-select-popover.js.map +1 -1
  384. package/dist/components/eui-super-date-picker.js +87 -40
  385. package/dist/components/eui-super-date-picker.js.map +1 -1
  386. package/dist/components/eui-super-select-control.js +111 -0
  387. package/dist/components/eui-super-select-control.js.map +1 -0
  388. package/dist/components/eui-super-select.js +202 -0
  389. package/dist/components/eui-super-select.js.map +1 -0
  390. package/dist/components/eui-table-body.js +14 -0
  391. package/dist/components/eui-table-body.js.map +1 -0
  392. package/dist/components/eui-table-footer-cell.js +23 -0
  393. package/dist/components/eui-table-footer-cell.js.map +1 -0
  394. package/dist/components/eui-table-footer.js +14 -0
  395. package/dist/components/eui-table-footer.js.map +1 -0
  396. package/dist/components/eui-table-header-button.js +34 -0
  397. package/dist/components/eui-table-header-button.js.map +1 -0
  398. package/dist/components/eui-table-header-cell-checkbox.js +25 -0
  399. package/dist/components/eui-table-header-cell-checkbox.js.map +1 -0
  400. package/dist/components/eui-table-header-cell.js +136 -0
  401. package/dist/components/eui-table-header-cell.js.map +1 -0
  402. package/dist/components/eui-table-header-mobile.js +17 -0
  403. package/dist/components/eui-table-header-mobile.js.map +1 -0
  404. package/dist/components/eui-table-header.js +26 -0
  405. package/dist/components/eui-table-header.js.map +1 -0
  406. package/dist/components/eui-table-pagination.js +129 -0
  407. package/dist/components/eui-table-pagination.js.map +1 -0
  408. package/dist/components/eui-table-row-cell-checkbox.js +16 -0
  409. package/dist/components/eui-table-row-cell-checkbox.js.map +1 -0
  410. package/dist/components/eui-table-row-cell.js +89 -0
  411. package/dist/components/eui-table-row-cell.js.map +1 -0
  412. package/dist/components/eui-table-row.js +62 -0
  413. package/dist/components/eui-table-row.js.map +1 -0
  414. package/dist/components/eui-table-sort-mobile-item.js +37 -0
  415. package/dist/components/eui-table-sort-mobile-item.js.map +1 -0
  416. package/dist/components/eui-table-sort-mobile.js +90 -0
  417. package/dist/components/eui-table-sort-mobile.js.map +1 -0
  418. package/dist/components/eui-table.js +29 -0
  419. package/dist/components/eui-table.js.map +1 -0
  420. package/dist/components/eui-text-diff.js +52 -0
  421. package/dist/components/eui-text-diff.js.map +1 -0
  422. package/dist/components/eui-token.js +74 -0
  423. package/dist/components/eui-token.js.map +1 -0
  424. package/dist/components/eui-tour-step-indicator.js +65 -0
  425. package/dist/components/eui-tour-step-indicator.js.map +1 -0
  426. package/dist/components/eui-tour-step.js +183 -0
  427. package/dist/components/eui-tour-step.js.map +1 -0
  428. package/dist/components/eui-tour.js +102 -0
  429. package/dist/components/eui-tour.js.map +1 -0
  430. package/dist/components/eui-tree-view.js +229 -0
  431. package/dist/components/eui-tree-view.js.map +1 -0
  432. package/dist/components.js +74 -0
  433. package/dist/components.js.map +1 -1
  434. package/dist/services/eui-i18n.js +18 -3
  435. package/dist/services/eui-i18n.js.map +1 -1
  436. package/dist/styles/ember-eui.css +24 -0
  437. package/dist/utils/drag-drop.js +43 -0
  438. package/dist/utils/drag-drop.js.map +1 -0
  439. package/dist/utils/token-map.js +217 -0
  440. package/dist/utils/token-map.js.map +1 -0
  441. package/package.json +69 -1
@@ -0,0 +1,39 @@
1
+ import type { EuiIconComponent } from '../-private/icons.ts';
2
+ export interface IconsFromGlobOptions {
3
+ /**
4
+ * Prepended to every icon name: `prefix: 'app-'` + `logo.svg` -> `app-logo`.
5
+ */
6
+ prefix?: string;
7
+ /**
8
+ * Custom naming. Receives the path as returned by `import.meta.glob`.
9
+ * Defaults to the file name without extension, like ember-svg-jar's
10
+ * `stripPath` default: `../icons/brands/logo.svg` -> `logo`.
11
+ */
12
+ name?: (path: string) => string;
13
+ }
14
+ /**
15
+ * Turns the result of an eager `import.meta.glob` of svg files (imported
16
+ * as components, e.g. with @svg-jar/plugin) into the name -> component
17
+ * map expected by the `euiIcon.icons` config, so a whole folder of icons
18
+ * can be registered at once:
19
+ *
20
+ * ```js
21
+ * import { iconsFromGlob } from '@ember-eui/core/utils/icons-from-glob';
22
+ *
23
+ * euiConfig.updateConfig({
24
+ * 'euiIcon.icons': iconsFromGlob(
25
+ * import.meta.glob('../icons/**\/*.svg', { eager: true })
26
+ * ),
27
+ * });
28
+ * ```
29
+ *
30
+ * ```hbs
31
+ * <EuiIcon @type="logo" />
32
+ * ```
33
+ *
34
+ * The glob must be `{ eager: true }` (lazy globs return loader functions,
35
+ * which cannot be told apart from components). Both module namespaces and
36
+ * `{ import: 'default' }` results are accepted.
37
+ */
38
+ export declare function iconsFromGlob(modules: Record<string, unknown>, options?: IconsFromGlobOptions): Record<string, EuiIconComponent>;
39
+ //# sourceMappingURL=icons-from-glob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons-from-glob.d.ts","sourceRoot":"","sources":["../../src/utils/icons-from-glob.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACjC;AASD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CA6BlC"}
@@ -0,0 +1,21 @@
1
+ import type { EuiIconType } from '../components/eui-icon';
2
+ /**
3
+ * EUI icons are loaded the first time they render, with an empty icon in
4
+ * their place meanwhile. Preload the ones that should show up right away,
5
+ * e.g. in the application route:
6
+ *
7
+ * ```js
8
+ * import { preloadIcons } from '@ember-eui/core/utils/preload-icons';
9
+ *
10
+ * export default class ApplicationRoute extends Route {
11
+ * async beforeModel() {
12
+ * await preloadIcons(['arrowDown', 'cross', 'search']);
13
+ * }
14
+ * }
15
+ * ```
16
+ *
17
+ * Resolves once they are all loaded; an icon that fails to load is logged
18
+ * and loaded again the next time it renders.
19
+ */
20
+ export declare function preloadIcons(types: EuiIconType[]): Promise<void>;
21
+ //# sourceMappingURL=preload-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preload-icons.d.ts","sourceRoot":"","sources":["../../src/utils/preload-icons.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * How each `token*` icon is shown by EuiToken (from EUI): square shapes
3
+ * for common types like string and number, circles for the rarer ones.
4
+ */
5
+ export interface TokenDisplay {
6
+ shape: 'circle' | 'square' | 'rectangle';
7
+ color: string;
8
+ fill?: 'light' | 'dark' | 'none';
9
+ }
10
+ export declare const TOKEN_MAP: Record<string, TokenDisplay>;
11
+ //# sourceMappingURL=token-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-map.d.ts","sourceRoot":"","sources":["../../src/utils/token-map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAgNlD,CAAC"}
@@ -0,0 +1,168 @@
1
+ import chroma from 'chroma-js';
2
+ import { euiPaletteColorBlind } from '../utils/color/eui_palettes.js';
3
+
4
+ const HEX_FALLBACK = '';
5
+ const HSV_FALLBACK = [0, 0, 0];
6
+ const RGB_FALLBACK = [NaN, NaN, NaN, 1];
7
+ const RGB_JOIN = ', ';
8
+
9
+ /** EUI's color-blind safe palette, the default swatches of EuiColorPicker. */
10
+ const VISUALIZATION_COLORS = euiPaletteColorBlind();
11
+
12
+ /**
13
+ * Where a pointer is inside an element, clamped to its box:
14
+ * `{ left, top, width, height }` in px.
15
+ */
16
+ function getEventPosition(location, container) {
17
+ const {
18
+ width,
19
+ height,
20
+ left,
21
+ top
22
+ } = container.getBoundingClientRect();
23
+ return {
24
+ left: Math.min(Math.max(location.x - left, 0), width),
25
+ top: Math.min(Math.max(location.y - top, 0), height),
26
+ width,
27
+ height
28
+ };
29
+ }
30
+
31
+ /** A hex string, or `r, g, b(, a)` numbers from a comma separated string. */
32
+ function parseColor(input) {
33
+ if (!input) return null;
34
+ if (input.indexOf(',') > 0) {
35
+ if (!/^[\s,.0-9]*$/.test(input)) return null;
36
+ const rgb = input.trim().split(',').filter(n => n !== '').map(Number);
37
+ return rgb.length > 2 && rgb.length < 5 ? rgb : HEX_FALLBACK;
38
+ }
39
+ return input;
40
+ }
41
+
42
+ /** Whether the color is a valid hex, `r, g, b` or `r, g, b, a` color. */
43
+ function chromaValid(color) {
44
+ const parsed = typeof color === 'string' ? parseColor(color) : color;
45
+ if (!parsed) return false;
46
+ if (typeof parsed === 'object') {
47
+ return chroma.valid(parsed, 'rgb') || chroma.valid(parsed, 'rgba');
48
+ }
49
+ return chroma.valid(parsed, 'hex');
50
+ }
51
+
52
+ /**
53
+ * A chroma-js color from a hex or `r, g, b(, a)` string, or `null` when
54
+ * invalid (or transparent while `allowOpacity` is false).
55
+ */
56
+ function getChromaColor(input, allowOpacity = false) {
57
+ const parsed = parseColor(input);
58
+ if (!parsed || !chromaValid(parsed)) return null;
59
+ const color = typeof parsed === 'object' ? chroma(parsed) : chroma(parsed);
60
+ if (typeof parsed === 'object' && parsed.length === 4) color.alpha(parsed[3]);
61
+ return !allowOpacity && color.alpha() < 1 ? null : color;
62
+ }
63
+ function hasStops(palette) {
64
+ return palette.some(item => typeof item === 'object');
65
+ }
66
+
67
+ /** A CSS `linear-gradient` through the colors (evenly) or color stops. */
68
+ function getLinearGradient(palette) {
69
+ const last = palette.length - 1;
70
+ if (hasStops(palette)) {
71
+ const scale = 100 / palette[last].stop;
72
+ const middle = palette.slice(1, last).map(({
73
+ color,
74
+ stop
75
+ }) => ` ${color} ${Math.floor(stop * scale)}%,`).join('');
76
+ return `linear-gradient(to right, ${palette[0].color} 0%,${middle} ${palette[last].color} 100%)`;
77
+ }
78
+ const colors = palette;
79
+ const middle = colors.slice(1, last).map((color, i) => ` ${color} ${Math.floor(100 * (i + 1) / last)}%,`).join('');
80
+ return `linear-gradient(to right, ${colors[0]} 0%,${middle} ${colors[last]} 100%)`;
81
+ }
82
+
83
+ /** Blocks of solid color: `{ color, width }` for each color or stop. */
84
+ function getFixedLinearGradient(palette) {
85
+ if (hasStops(palette)) {
86
+ const scale = 100 / palette[palette.length - 1].stop;
87
+ return palette.map(({
88
+ color,
89
+ stop
90
+ }, index) => {
91
+ const previous = index === 0 ? 0 : Math.floor(palette[index - 1].stop * scale);
92
+ return {
93
+ color,
94
+ width: `${Math.floor(stop * scale) - previous}%`
95
+ };
96
+ });
97
+ }
98
+ return palette.map(color => ({
99
+ color,
100
+ width: `${100 / palette.length}%`
101
+ }));
102
+ }
103
+
104
+ /** The default color of new color stops (EUI's second visualization color). */
105
+ const DEFAULT_VISUALIZATION_COLOR = VISUALIZATION_COLORS[1];
106
+
107
+ /** Width of a range thumb in px. */
108
+ const EUI_THUMB_SIZE = 16;
109
+
110
+ /** `steps` colors evenly spread over the color stops. */
111
+ function getSteppedGradient(colors, steps) {
112
+ const offset = colors[0].stop;
113
+ const range = colors[colors.length - 1].stop - offset;
114
+ return chroma.scale(colors.map(item => item.color)).domain(colors.map(item => (item.stop - offset) / range)).colors(steps);
115
+ }
116
+
117
+ /* color stops ------------------------------------------------------------ */
118
+
119
+ function removeStop(colorStops, index) {
120
+ if (colorStops.length === 1) return colorStops;
121
+ return [...colorStops.slice(0, index), ...colorStops.slice(index + 1)];
122
+ }
123
+ function addDefinedStop(colorStops, stop, color = DEFAULT_VISUALIZATION_COLOR) {
124
+ return [...colorStops, {
125
+ stop,
126
+ color
127
+ }].sort((a, b) => a.stop - b.stop);
128
+ }
129
+
130
+ /** A stop after the last one, at the same distance as the last two. */
131
+ function addStop(colorStops, color = DEFAULT_VISUALIZATION_COLOR, max) {
132
+ const index = colorStops.length ? colorStops.length - 1 : 0;
133
+ const stops = colorStops.map(el => el.stop);
134
+ const currentStop = stops[index] ?? max;
135
+ const delta = index !== 0 ? currentStop - stops[index - 1] : 1;
136
+ let stop = Math.min(currentStop + delta, max);
137
+
138
+ // at the max: go back to the first free value
139
+ while (stops.includes(stop)) stop--;
140
+ return [...colorStops.slice(0, index + 1), {
141
+ stop,
142
+ color
143
+ }, ...colorStops.slice(index + 1)];
144
+ }
145
+ function isColorInvalid(color, showAlpha = false) {
146
+ return getChromaColor(color, showAlpha) === null || color === '';
147
+ }
148
+ function isStopInvalid(stop) {
149
+ return stop === null || stop === undefined || isNaN(stop);
150
+ }
151
+ function isStopsInvalid(colorStops, showAlpha = false) {
152
+ return colorStops.some(colorStop => isColorInvalid(colorStop.color, showAlpha) || isStopInvalid(colorStop.stop));
153
+ }
154
+ function calculateScale(trackWidth) {
155
+ return (1 - EUI_THUMB_SIZE / trackWidth) * 100;
156
+ }
157
+ function getStopFromMouseLocation(location, element, min, max) {
158
+ const box = getEventPosition(location, element);
159
+ return Math.round(box.left / box.width * (max - min) + min);
160
+ }
161
+
162
+ /** The stop's position in percent of the track (keeping the thumb inside). */
163
+ function getPositionFromStop(stop, trackWidth, min, max) {
164
+ return parseFloat(((stop - min) / (max - min) * calculateScale(trackWidth > 0 ? trackWidth : 100)).toFixed(1));
165
+ }
166
+
167
+ export { DEFAULT_VISUALIZATION_COLOR, EUI_THUMB_SIZE, HEX_FALLBACK, HSV_FALLBACK, RGB_FALLBACK, RGB_JOIN, VISUALIZATION_COLORS, addDefinedStop, addStop, chromaValid, getChromaColor, getEventPosition, getFixedLinearGradient, getLinearGradient, getPositionFromStop, getSteppedGradient, getStopFromMouseLocation, isColorInvalid, isStopInvalid, isStopsInvalid, parseColor, removeStop };
168
+ //# sourceMappingURL=color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.js","sources":["../../src/-private/color.ts"],"sourcesContent":["import chroma from 'chroma-js';\n\nimport { euiPaletteColorBlind } from '../utils/color/eui_palettes.ts';\n\nimport type { Color } from 'chroma-js';\n\nexport type HSV = [number, number, number];\nexport type RGBA = [number, number, number, number];\n\nexport interface ColorStop {\n /** Position of the stop, in the palette's units (e.g. 0 to 100). */\n stop: number;\n /** Its color. */\n color: string;\n}\n\nexport const HEX_FALLBACK = '';\nexport const HSV_FALLBACK: HSV = [0, 0, 0];\nexport const RGB_FALLBACK: RGBA = [NaN, NaN, NaN, 1];\nexport const RGB_JOIN = ', ';\n\n/** EUI's color-blind safe palette, the default swatches of EuiColorPicker. */\nexport const VISUALIZATION_COLORS: string[] = euiPaletteColorBlind();\n\n/**\n * Where a pointer is inside an element, clamped to its box:\n * `{ left, top, width, height }` in px.\n */\nexport function getEventPosition(\n location: { x: number; y: number },\n container: HTMLElement\n): { left: number; top: number; width: number; height: number } {\n const { width, height, left, top } = container.getBoundingClientRect();\n\n return {\n left: Math.min(Math.max(location.x - left, 0), width),\n top: Math.min(Math.max(location.y - top, 0), height),\n width,\n height\n };\n}\n\n/** A hex string, or `r, g, b(, a)` numbers from a comma separated string. */\nexport function parseColor(input?: string | null): string | number[] | null {\n if (!input) return null;\n\n if (input.indexOf(',') > 0) {\n if (!/^[\\s,.0-9]*$/.test(input)) return null;\n\n const rgb = input\n .trim()\n .split(',')\n .filter((n) => n !== '')\n .map(Number);\n\n return rgb.length > 2 && rgb.length < 5 ? rgb : HEX_FALLBACK;\n }\n\n return input;\n}\n\n/** Whether the color is a valid hex, `r, g, b` or `r, g, b, a` color. */\nexport function chromaValid(color: string | number[]): boolean {\n const parsed = typeof color === 'string' ? parseColor(color) : color;\n\n if (!parsed) return false;\n if (typeof parsed === 'object') {\n return chroma.valid(parsed, 'rgb') || chroma.valid(parsed, 'rgba');\n }\n\n return chroma.valid(parsed, 'hex');\n}\n\n/**\n * A chroma-js color from a hex or `r, g, b(, a)` string, or `null` when\n * invalid (or transparent while `allowOpacity` is false).\n */\nexport function getChromaColor(input?: string | null, allowOpacity = false): Color | null {\n const parsed = parseColor(input);\n\n if (!parsed || !chromaValid(parsed)) return null;\n\n const color =\n typeof parsed === 'object'\n ? chroma(parsed as [number, number, number])\n : chroma(parsed);\n\n if (typeof parsed === 'object' && parsed.length === 4) color.alpha(parsed[3]!);\n\n return !allowOpacity && color.alpha() < 1 ? null : color;\n}\n\nfunction hasStops(palette: (string | ColorStop)[]): palette is ColorStop[] {\n return palette.some((item) => typeof item === 'object');\n}\n\n/** A CSS `linear-gradient` through the colors (evenly) or color stops. */\nexport function getLinearGradient(palette: (string | ColorStop)[]): string {\n const last = palette.length - 1;\n\n if (hasStops(palette)) {\n const scale = 100 / palette[last]!.stop;\n const middle = palette\n .slice(1, last)\n .map(({ color, stop }) => ` ${color} ${Math.floor(stop * scale)}%,`)\n .join('');\n\n return `linear-gradient(to right, ${palette[0]!.color} 0%,${middle} ${palette[last]!.color} 100%)`;\n }\n\n const colors = palette as string[];\n const middle = colors\n .slice(1, last)\n .map((color, i) => ` ${color} ${Math.floor((100 * (i + 1)) / last)}%,`)\n .join('');\n\n return `linear-gradient(to right, ${colors[0]} 0%,${middle} ${colors[last]} 100%)`;\n}\n\n/** Blocks of solid color: `{ color, width }` for each color or stop. */\nexport function getFixedLinearGradient(\n palette: (string | ColorStop)[]\n): { color: string; width: string }[] {\n if (hasStops(palette)) {\n const scale = 100 / palette[palette.length - 1]!.stop;\n\n return palette.map(({ color, stop }, index) => {\n const previous = index === 0 ? 0 : Math.floor(palette[index - 1]!.stop * scale);\n\n return { color, width: `${Math.floor(stop * scale) - previous}%` };\n });\n }\n\n return (palette as string[]).map((color) => ({ color, width: `${100 / palette.length}%` }));\n}\n\n/** The default color of new color stops (EUI's second visualization color). */\nexport const DEFAULT_VISUALIZATION_COLOR: string = VISUALIZATION_COLORS[1]!;\n\n/** Width of a range thumb in px. */\nexport const EUI_THUMB_SIZE = 16;\n\n/** `steps` colors evenly spread over the color stops. */\nexport function getSteppedGradient(colors: ColorStop[], steps: number): string[] {\n const offset = colors[0]!.stop;\n const range = colors[colors.length - 1]!.stop - offset;\n\n return chroma\n .scale(colors.map((item) => item.color))\n .domain(colors.map((item) => (item.stop - offset) / range))\n .colors(steps);\n}\n\n/* color stops ------------------------------------------------------------ */\n\nexport function removeStop(colorStops: ColorStop[], index: number): ColorStop[] {\n if (colorStops.length === 1) return colorStops;\n\n return [...colorStops.slice(0, index), ...colorStops.slice(index + 1)];\n}\n\nexport function addDefinedStop(\n colorStops: ColorStop[],\n stop: number,\n color = DEFAULT_VISUALIZATION_COLOR\n): ColorStop[] {\n return [...colorStops, { stop, color }].sort((a, b) => a.stop - b.stop);\n}\n\n/** A stop after the last one, at the same distance as the last two. */\nexport function addStop(\n colorStops: ColorStop[],\n color = DEFAULT_VISUALIZATION_COLOR,\n max: number\n): ColorStop[] {\n const index = colorStops.length ? colorStops.length - 1 : 0;\n const stops = colorStops.map((el) => el.stop);\n const currentStop = stops[index] ?? max;\n const delta = index !== 0 ? currentStop - stops[index - 1]! : 1;\n let stop = Math.min(currentStop + delta, max);\n\n // at the max: go back to the first free value\n while (stops.includes(stop)) stop--;\n\n return [...colorStops.slice(0, index + 1), { stop, color }, ...colorStops.slice(index + 1)];\n}\n\nexport function isColorInvalid(color: string, showAlpha = false): boolean {\n return getChromaColor(color, showAlpha) === null || color === '';\n}\n\nexport function isStopInvalid(stop: number | null | undefined): boolean {\n return stop === null || stop === undefined || isNaN(stop);\n}\n\nexport function isStopsInvalid(colorStops: ColorStop[], showAlpha = false): boolean {\n return colorStops.some(\n (colorStop) => isColorInvalid(colorStop.color, showAlpha) || isStopInvalid(colorStop.stop)\n );\n}\n\nfunction calculateScale(trackWidth: number): number {\n return (1 - EUI_THUMB_SIZE / trackWidth) * 100;\n}\n\nexport function getStopFromMouseLocation(\n location: { x: number; y: number },\n element: HTMLElement,\n min: number,\n max: number\n): number {\n const box = getEventPosition(location, element);\n\n return Math.round((box.left / box.width) * (max - min) + min);\n}\n\n/** The stop's position in percent of the track (keeping the thumb inside). */\nexport function getPositionFromStop(stop: number, trackWidth: number, min: number, max: number): number {\n return parseFloat(\n (((stop - min) / (max - min)) * calculateScale(trackWidth > 0 ? trackWidth : 100)).toFixed(1)\n );\n}\n"],"names":["HEX_FALLBACK","HSV_FALLBACK","RGB_FALLBACK","NaN","RGB_JOIN","VISUALIZATION_COLORS","euiPaletteColorBlind","getEventPosition","location","container","width","height","left","top","getBoundingClientRect","Math","min","max","x","y","parseColor","input","indexOf","test","rgb","trim","split","filter","n","map","Number","length","chromaValid","color","parsed","chroma","valid","getChromaColor","allowOpacity","alpha","hasStops","palette","some","item","getLinearGradient","last","scale","stop","middle","slice","floor","join","colors","i","getFixedLinearGradient","index","previous","DEFAULT_VISUALIZATION_COLOR","EUI_THUMB_SIZE","getSteppedGradient","steps","offset","range","domain","removeStop","colorStops","addDefinedStop","sort","a","b","addStop","stops","el","currentStop","delta","includes","isColorInvalid","showAlpha","isStopInvalid","undefined","isNaN","isStopsInvalid","colorStop","calculateScale","trackWidth","getStopFromMouseLocation","element","box","round","getPositionFromStop","parseFloat","toFixed"],"mappings":";;;AAgBO,MAAMA,YAAY,GAAG,GAAE;AACvB,MAAMC,YAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;AACnC,MAAMC,YAAkB,GAAG,CAACC,GAAG,EAAEA,GAAG,EAAEA,GAAG,EAAE,CAAC,EAAC;AAC7C,MAAMC,QAAQ,GAAG,KAAI;;AAE5B;AACaC,MAAAA,oBAA8B,GAAGC,oBAAoB,GAAE;;AAEpE;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC9BC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AU,IAAI,GAAG,CAAA;AAChD,CAAA;AAEO,SAASC,wBAAwBA,CACtC7E,QAAkC,EAClC8E,OAAoB,EACpBtE,GAAW,EACXC,GAAW,EACH;AACR,EAAA,MAAMsE,GAAG,GAAGhF,gBAAgB,CAACC,QAAQ,EAAE8E,OAAO,CAAC,CAAA;AAE/C,EAAA,OAAOvE,IAAI,CAACyE,KAAK,CAAED,GAAG,CAAC3E,IAAI,GAAG2E,GAAG,CAAC7E,KAAK,IAAKO,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG,CAAC,CAAA;AAC/D,CAAA;;AAEA;AACO,SAASyE,mBAAmBA,CAAC1C,IAAY,EAAEqC,UAAkB,EAAEpE,GAAW,EAAEC,GAAW,EAAU;AACtG,EAAA,OAAOyE,UAAU,CACf,CAAE,CAAC3C,IAAI,GAAG/B,GAAG,KAAKC,GAAG,GAAGD,GAAG,CAAC,GAAImE,cAAc,CAACC,UAAU,GAAG,CAAC,GAAGA,UAAU,GAAG,GAAG,CAAC,EAAEO,OAAO,CAAC,CAAC,CAC9F,CAAC,CAAA;AACH;;;;"}
@@ -0,0 +1,24 @@
1
+ import { htmlSafe } from '@ember/template';
2
+
3
+ // CSS properties whose unitless numbers are not pixels
4
+ const UNITLESS = new Set(['flex', 'flexGrow', 'flexShrink', 'fontWeight', 'lineHeight', 'opacity', 'order', 'zIndex']);
5
+
6
+ /**
7
+ * Builds a `style` attribute from an object of CSS properties
8
+ * (`{ maxWidth: 300, backgroundColor: '#fff' }`). Empty values are skipped,
9
+ * numbers get `px` (except unitless properties like `opacity`), and
10
+ * characters that could end the declaration are dropped, so values from
11
+ * arguments cannot inject other properties.
12
+ */
13
+ function cssStyle(properties) {
14
+ const declarations = Object.entries(properties).flatMap(([key, value]) => {
15
+ if (value === null || value === undefined || value === '') return [];
16
+ const property = key.startsWith('--') ? key : key.replace(/[A-Z]/g, char => `-${char.toLowerCase()}`);
17
+ const text = typeof value === 'number' && !UNITLESS.has(key) && !key.startsWith('--') ? `${value}px` : String(value);
18
+ return [`${property}: ${text.replace(/[;{}<>"]/g, '')}`];
19
+ });
20
+ return declarations.length ? htmlSafe(declarations.join('; ')) : undefined;
21
+ }
22
+
23
+ export { cssStyle as default };
24
+ //# sourceMappingURL=css-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-style.js","sources":["../../src/-private/css-style.ts"],"sourcesContent":["import { htmlSafe } from '@ember/template';\n\nimport type { SafeString } from '@ember/template/-private/handlebars';\n\nexport type CssProperties = Record<string, string | number | null | undefined>;\n\n// CSS properties whose unitless numbers are not pixels\nconst UNITLESS = new Set([\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'fontWeight',\n 'lineHeight',\n 'opacity',\n 'order',\n 'zIndex'\n]);\n\n/**\n * Builds a `style` attribute from an object of CSS properties\n * (`{ maxWidth: 300, backgroundColor: '#fff' }`). Empty values are skipped,\n * numbers get `px` (except unitless properties like `opacity`), and\n * characters that could end the declaration are dropped, so values from\n * arguments cannot inject other properties.\n */\nexport default function cssStyle(properties: CssProperties): SafeString | undefined {\n const declarations = Object.entries(properties).flatMap(([key, value]) => {\n if (value === null || value === undefined || value === '') return [];\n\n const property = key.startsWith('--')\n ? key\n : key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n const text =\n typeof value === 'number' && !UNITLESS.has(key) && !key.startsWith('--')\n ? `${value}px`\n : String(value);\n\n return [`${property}: ${text.replace(/[;{}<>\"]/g, '')}`];\n });\n\n return declarations.length ? htmlSafe(declarations.join('; ')) : undefined;\n}\n"],"names":["UNITLESS","Set","cssStyle","properties","declarations","Object","entries","flatMap","key","value","undefined","property","startsWith","replace","char","toLowerCase","text","has","String","length","htmlSafe","join"],"mappings":";;AAMA;AACA,MAAMA,QAAQ,GAAG,IAAIC,GAAG,CAAC,CACvB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,OAAO,EACP,QAAQ,CACT,CAAC,CAAA;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,QAAQA,CAACC,UAAyB,EAA0B;AAClF,EAAA,MAAMC,YAAY,GAAGC,MAAM,CAACC,OAAO,CAACH,UAAU,CAAC,CAACI,OAAO,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;AACxE,IAAA,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,EAAE,EAAE,OAAO,EAAE,CAAA;IAEpE,MAAME,QAAQ,GAAGH,GAAG,CAACI,UAAU,CAAC,IAAI,CAAC,GACjCJ,GAAG,GACHA,GAAG,CAACK,OAAO,CAAC,QAAQ,EAAGC,IAAI,IAAM,CAAA,CAAA,EAAGA,IAAI,CAACC,WAAW,EAAG,CAAA,CAAC,CAAC,CAAA;AAC7D,IAAA,MAAMC,IAAI,GACR,OAAOP,KAAK,KAAK,QAAQ,IAAI,CAACT,QAAQ,CAACiB,GAAG,CAACT,GAAG,CAAC,IAAI,CAACA,GAAG,CAACI,UAAU,CAAC,IAAI,CAAC,GACnE,CAAEH,EAAAA,KAAM,CAAG,EAAA,CAAA,GACZS,MAAM,CAACT,KAAK,CAAC,CAAA;AAEnB,IAAA,OAAO,CAAE,CAAA,EAAEE,QAAS,CAAA,EAAA,EAAIK,IAAI,CAACH,OAAO,CAAC,WAAW,EAAE,EAAE,CAAE,EAAC,CAAC,CAAA;AAC1D,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOT,YAAY,CAACe,MAAM,GAAGC,QAAQ,CAAChB,YAAY,CAACiB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAGX,SAAS,CAAA;AAC5E;;;;"}
@@ -4,10 +4,11 @@ var randomId = helper(randomId$1);
4
4
 
5
5
  // Copy-pasted from the ember-source implementation:
6
6
  // https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts
7
+ /** A random id, for use in JavaScript (the default export is the helper). */
7
8
  function randomId$1() {
8
9
  //@ts-expect-error
9
10
  return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, a => (a * 4 ^ Math.random() * 16 >> (a & 2)).toString(16));
10
11
  }
11
12
 
12
- export { randomId as default };
13
+ export { randomId as default, randomId$1 as randomId };
13
14
  //# sourceMappingURL=random-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"random-id.js","sources":["../../src/-private/random-id.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\n\nexport default helper<{\n Args: {\n Positional: [];\n };\n Return: string;\n}>(randomId);\n\n// Copy-pasted from the ember-source implementation:\n// https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts\nfunction randomId() {\n //@ts-expect-error\n return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n );\n}\n"],"names":["helper","randomId","replace","a","Math","random","toString"],"mappings":";;AAEA,eAAeA,MAAM,CAKlBC,UAAQ,CAAC,CAAA;;AAEZ;AACA;AACA,SAASA,UAAQA,GAAG;AAClB;EACA,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,EAAEC,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAC9D,CAAEA,CAAC,GAAG,CAAC,GAAMC,IAAI,CAACC,MAAM,EAAE,GAAG,EAAE,KAAMF,CAAC,GAAG,CAAC,CAAE,EAAEG,QAAQ,CAAC,EAAE,CAC3D,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"random-id.js","sources":["../../src/-private/random-id.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\n\nexport default helper<{\n Args: {\n Positional: [];\n };\n Return: string;\n}>(randomId);\n\n// Copy-pasted from the ember-source implementation:\n// https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts\n/** A random id, for use in JavaScript (the default export is the helper). */\nexport function randomId(): string {\n //@ts-expect-error\n return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n );\n}\n"],"names":["helper","randomId","replace","a","Math","random","toString"],"mappings":";;AAEA,eAAeA,MAAM,CAKlBC,UAAQ,CAAC,CAAA;;AAEZ;AACA;AACA;AACO,SAASA,UAAQA,GAAW;AACjC;EACA,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,EAAEC,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAC9D,CAAEA,CAAC,GAAG,CAAC,GAAMC,IAAI,CAACC,MAAM,EAAE,GAAG,EAAE,KAAMF,CAAC,GAAG,CAAC,CAAE,EAAEG,QAAQ,CAAC,EAAE,CAC3D,CAAC,CAAA;AACH;;;;"}
@@ -0,0 +1,44 @@
1
+ /** Padding of EuiPanel per size, in px. */
2
+ const PANEL_PADDING = {
3
+ none: 0,
4
+ s: 8,
5
+ m: 16,
6
+ l: 24
7
+ };
8
+ function pxToPercent(proportion, whole) {
9
+ if (whole < 1 || proportion < 0) return 0;
10
+ return proportion / whole * 100;
11
+ }
12
+ function sizesOnly(panels) {
13
+ return Object.fromEntries(Object.values(panels).map(panel => [panel.id, panel.size]));
14
+ }
15
+ function minSizePercent(minSize, containerSize) {
16
+ const value = parseInt(minSize);
17
+ if (minSize.includes('px')) return pxToPercent(value, containerSize);
18
+ if (minSize.includes('%')) return pxToPercent(containerSize * (value / 100), containerSize);
19
+ return 0;
20
+ }
21
+
22
+ /** The larger of the panel's minimum size and its padding, in percent. */
23
+ function getPanelMinSize(minSize, containerSize) {
24
+ return Math.max(minSizePercent(minSize[0], containerSize), minSizePercent(minSize[1], containerSize));
25
+ }
26
+ function getPointerPosition(event, isHorizontal) {
27
+ const point = 'touches' in event ? event.touches[0] : event;
28
+ return isHorizontal ? point.clientX : point.clientY;
29
+ }
30
+
31
+ /** The closest open panel before or after the element. */
32
+ function getSiblingPanel(element, adjacency) {
33
+ if (!element) return null;
34
+ const step = el => adjacency === 'prev' ? el.previousElementSibling : el.nextElementSibling;
35
+ let sibling = step(element);
36
+ while (sibling) {
37
+ if (sibling.matches('.euiResizablePanel:not(.euiResizablePanel-isCollapsed)')) return sibling;
38
+ sibling = step(sibling);
39
+ }
40
+ return null;
41
+ }
42
+
43
+ export { PANEL_PADDING, getPanelMinSize, getPointerPosition, getSiblingPanel, pxToPercent, sizesOnly };
44
+ //# sourceMappingURL=resizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.js","sources":["../../src/-private/resizable.ts"],"sourcesContent":["export type PanelModeType = 'collapsible' | 'main' | 'custom';\nexport type PanelPosition = 'first' | 'middle' | 'last';\n\nexport interface PanelState {\n id: string;\n /** Size in percent of the container. */\n size: number;\n prevSize: number;\n getSizePx: () => number;\n /** `[the panel's @minSize, twice its padding]`, e.g. `['20%', '32px']`. */\n minSize: [string, string];\n mode?: PanelModeType;\n isCollapsed: boolean;\n position: PanelPosition;\n}\n\nexport interface ResizerState {\n id: string;\n isFocused: boolean;\n isDisabled: boolean;\n}\n\n/** Padding of EuiPanel per size, in px. */\nexport const PANEL_PADDING = { none: 0, s: 8, m: 16, l: 24 };\n\nexport function pxToPercent(proportion: number, whole: number): number {\n if (whole < 1 || proportion < 0) return 0;\n\n return (proportion / whole) * 100;\n}\n\nexport function sizesOnly(panels: Record<string, PanelState>): Record<string, number> {\n return Object.fromEntries(Object.values(panels).map((panel) => [panel.id, panel.size]));\n}\n\nfunction minSizePercent(minSize: string, containerSize: number): number {\n const value = parseInt(minSize);\n\n if (minSize.includes('px')) return pxToPercent(value, containerSize);\n if (minSize.includes('%')) return pxToPercent(containerSize * (value / 100), containerSize);\n\n return 0;\n}\n\n/** The larger of the panel's minimum size and its padding, in percent. */\nexport function getPanelMinSize(minSize: [string, string], containerSize: number): number {\n return Math.max(minSizePercent(minSize[0], containerSize), minSizePercent(minSize[1], containerSize));\n}\n\nexport function getPointerPosition(event: MouseEvent | TouchEvent, isHorizontal: boolean): number {\n const point = 'touches' in event ? event.touches[0]! : event;\n\n return isHorizontal ? point.clientX : point.clientY;\n}\n\n/** The closest open panel before or after the element. */\nexport function getSiblingPanel(element: Element | null, adjacency: 'prev' | 'next'): Element | null {\n if (!element) return null;\n\n const step = (el: Element) => (adjacency === 'prev' ? el.previousElementSibling : el.nextElementSibling);\n let sibling = step(element);\n\n while (sibling) {\n if (sibling.matches('.euiResizablePanel:not(.euiResizablePanel-isCollapsed)')) return sibling;\n sibling = step(sibling);\n }\n\n return null;\n}\n"],"names":["PANEL_PADDING","none","s","m","l","pxToPercent","proportion","whole","sizesOnly","panels","Object","fromEntries","values","map","panel","id","size","minSizePercent","minSize","containerSize","value","parseInt","includes","getPanelMinSize","Math","max","getPointerPosition","event","isHorizontal","point","touches","clientX","clientY","getSiblingPanel","element","adjacency","step","el","previousElementSibling","nextElementSibling","sibling","matches"],"mappings":"AAsBA;AACO,MAAMA,aAAa,GAAG;AAAEC,EAAAA,IAAI,EAAE,CAAC;AAAEC,EAAAA,CAAC,EAAE,CAAC;AAAEC,EAAAA,CAAC,EAAE,EAAE;AAAEC,EAAAA,CAAC,EAAE,EAAA;AAAG,EAAC;AAErD,SAASC,WAAWA,CAACC,UAAkB,EAAEC,KAAa,EAAU;EACrE,IAAIA,KAAK,GAAG,CAAC,IAAID,UAAU,GAAG,CAAC,EAAE,OAAO,CAAC,CAAA;AAEzC,EAAA,OAAQA,UAAU,GAAGC,KAAK,GAAI,GAAG,CAAA;AACnC,CAAA;AAEO,SAASC,SAASA,CAACC,MAAkC,EAA0B;EACpF,OAAOC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,MAAM,CAACH,MAAM,CAAC,CAACI,GAAG,CAAEC,KAAK,IAAK,CAACA,KAAK,CAACC,E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C,OAAO,GAAGJ,IAAI,CAACF,OAAO,CAAC,CAAA;AAE3B,EAAA,OAAOM,OAAO,EAAE;IACd,IAAIA,OAAO,CAACC,OAAO,CAAC,wDAAwD,CAAC,EAAE,OAAOD,OAAO,CAAA;AAC7FA,IAAAA,OAAO,GAAGJ,IAAI,CAACI,OAAO,CAAC,CAAA;AACzB,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb;;;;"}
@@ -0,0 +1,59 @@
1
+ function searchableLabel(option) {
2
+ return (option.searchableLabel ?? option.label).trim().toLowerCase();
3
+ }
4
+
5
+ /**
6
+ * The options whose label (or `searchableLabel`) contains the search,
7
+ * ignoring case. With `isPreFiltered` every option matches (the options
8
+ * were already filtered, e.g. by a server).
9
+ */
10
+ function getMatchingOptions(options, searchValue = '', isPreFiltered = false) {
11
+ const search = searchValue.toLowerCase();
12
+ if (isPreFiltered || !search) return [...options];
13
+ return options.filter(option => searchableLabel(option).includes(search));
14
+ }
15
+
16
+ /**
17
+ * All options with `option` pressed: unchecked options get checked (with
18
+ * `singleSelection`, the others are unchecked), checked ones get excluded
19
+ * (`allowExclusions`) or unchecked (unless `singleSelection` is
20
+ * `'always'`), excluded ones get unchecked. Disabled options do nothing.
21
+ */
22
+ function toggleOption(options, option, {
23
+ allowExclusions,
24
+ singleSelection
25
+ } = {}) {
26
+ if (option.disabled) return undefined;
27
+ const unchecked = item => {
28
+ const {
29
+ checked: _checked,
30
+ ...rest
31
+ } = item;
32
+ return rest;
33
+ };
34
+ if (option.checked === 'on' && allowExclusions) {
35
+ return options.map(item => item === option ? {
36
+ ...item,
37
+ checked: 'off'
38
+ } : {
39
+ ...item
40
+ });
41
+ }
42
+ if (option.checked === 'on' || option.checked === 'off') {
43
+ return options.map(item => item === option && singleSelection !== 'always' ? unchecked(item) : {
44
+ ...item
45
+ });
46
+ }
47
+ return options.map(item => {
48
+ if (item === option) return {
49
+ ...item,
50
+ checked: 'on'
51
+ };
52
+ return singleSelection ? unchecked(item) : {
53
+ ...item
54
+ };
55
+ });
56
+ }
57
+
58
+ export { getMatchingOptions, toggleOption };
59
+ //# sourceMappingURL=selectable-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectable-options.js","sources":["../../src/-private/selectable-options.ts"],"sourcesContent":["export interface EuiSelectableOption {\n /** The option's text; also what the search matches. */\n label: string;\n /** `'on'` (selected / included), `'off'` (excluded) or nothing. */\n checked?: 'on' | 'off';\n /** Disables the option. */\n disabled?: boolean;\n /** A heading between groups of options, not selectable. */\n isGroupLabel?: boolean;\n /** Text before the label. */\n prepend?: string;\n /** Text after the label (e.g. a count). */\n append?: string;\n /** Text the search matches instead of the label. */\n searchableLabel?: string;\n /** Unique key, when labels repeat. */\n key?: string;\n /** Extra classes for the option's `<li>`. */\n className?: string;\n [key: string]: unknown;\n}\n\nfunction searchableLabel(option: EuiSelectableOption): string {\n return (option.searchableLabel ?? option.label).trim().toLowerCase();\n}\n\n/**\n * The options whose label (or `searchableLabel`) contains the search,\n * ignoring case. With `isPreFiltered` every option matches (the options\n * were already filtered, e.g. by a server).\n */\nexport function getMatchingOptions<T extends EuiSelectableOption>(\n options: T[],\n searchValue = '',\n isPreFiltered = false\n): T[] {\n const search = searchValue.toLowerCase();\n\n if (isPreFiltered || !search) return [...options];\n\n return options.filter((option) => searchableLabel(option).includes(search));\n}\n\n/**\n * All options with `option` pressed: unchecked options get checked (with\n * `singleSelection`, the others are unchecked), checked ones get excluded\n * (`allowExclusions`) or unchecked (unless `singleSelection` is\n * `'always'`), excluded ones get unchecked. Disabled options do nothing.\n */\nexport function toggleOption<T extends EuiSelectableOption>(\n options: T[],\n option: T,\n {\n allowExclusions,\n singleSelection\n }: { allowExclusions?: boolean; singleSelection?: boolean | 'always' } = {}\n): T[] | undefined {\n if (option.disabled) return undefined;\n\n const unchecked = (item: T): T => {\n const { checked: _checked, ...rest } = item;\n\n return rest as T;\n };\n\n if (option.checked === 'on' && allowExclusions) {\n return options.map((item) => (item === option ? { ...item, checked: 'off' } : { ...item }));\n }\n\n if (option.checked === 'on' || option.checked === 'off') {\n return options.map((item) =>\n item === option && singleSelection !== 'always' ? unchecked(item) : { ...item }\n );\n }\n\n return options.map((item) => {\n if (item === option) return { ...item, checked: 'on' };\n\n return singleSelection ? unchecked(item) : { ...item };\n });\n}\n"],"names":["searchableLabel","option","label","trim","toLowerCase","getMatchingOptions","options","searchValue","isPreFiltered","search","filter","includes","toggleOption","allowExclusions","singleSelection","disabled","undefined","unchecked","item","checked","_checked","rest","map"],"mappings":"AAsBA,SAASA,eAAeA,CAACC,MAA2B,EAAU;AAC5D,EAAA,OAAO,CAACA,MAAM,CAACD,eAAe,IAAIC,MAAM,CAACC,KAAK,EAAEC,IAAI,EAAE,CAACC,WAAW,EAAE,CAAA;AACtE,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,OAAY,EACZC,WAAW,GAAG,EAAE,EAChBC,aAAa,GAAG,KAAK,EAChB;AACL,EAAA,MAAMC,MAAM,GAAGF,WAAW,CAACH,WAAW,EAAE,CAAA;EAExC,IAAII,aAAa,IAAI,CAACC,MAAM,EAAE,OAAO,CAAC,GAAGH,OAAO,CAAC,CAAA;AAEjD,EAAA,OAAOA,OAAO,CAACI,MAAM,CAAET,MAAM,IAAKD,eAAe,CAACC,MAAM,CAAC,CAACU,QAAQ,CAACF,MAAM,CAAC,CAAC,CAAA;AAC7E,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAC1BN,OAAY,EACZL,MAAS,EACT;EACEY,eAAe;AACfC,EAAAA,eAAAA;AACmE,CAAC,GAAG,EAAE,EAC1D;AACjB,EAAA,IAAIb,MAAM,CAACc,QAAQ,EAAE,OAAOC,SAAS,CAAA;EAErC,MAAMC,SAAS,GAAIC,IAAO,IAAQ;IAChC,MAAM;AAAEC,MAAAA,OAAO,EAAEC,QAAQ;MAAE,GAAGC,IAAAA;AAAK,KAAC,GAAGH,IAAI,CAAA;AAE3C,IAAA,OAAOG,IAAI,CAAA;GACZ,CAAA;AAED,EAAA,IAAIpB,MAAM,CAACkB,OAAO,KAAK,IAAI,IAAIN,eAAe,EAAE;IAC9C,OAAOP,OAAO,CAACgB,GAAG,CAAEJ,IAAI,IAAMA,IAAI,KAAKjB,MAAM,GAAG;AAAE,MAAA,GAAGiB,IAAI;AAAEC,MAAAA,OAAO,EAAE,KAAA;AAAM,KAAC,GAAG;MAAE,GAAGD,IAAAA;AAAK,KAAE,CAAC,CAAA;AAC7F,GAAA;EAEA,IAAIjB,MAAM,CAACkB,OAAO,KAAK,IAAI,IAAIlB,MAAM,CAACkB,OAAO,KAAK,KAAK,EAAE;AACvD,IAAA,OAAOb,OAAO,CAACgB,GAAG,CAAEJ,IAAI,IACtBA,IAAI,KAAKjB,MAAM,IAAIa,eAAe,KAAK,QAAQ,GAAGG,SAAS,CAACC,IAAI,CAAC,GAAG;MAAE,GAAGA,IAAAA;AAAK,KAChF,CAAC,CAAA;AACH,GAAA;AAEA,EAAA,OAAOZ,OAAO,CAACgB,GAAG,CAAEJ,IAAI,IAAK;AAC3B,IAAA,IAAIA,IAAI,KAAKjB,MAAM,EAAE,OAAO;AAAE,MAAA,GAAGiB,IAAI;AAAEC,MAAAA,OAAO,EAAE,IAAA;KAAM,CAAA;AAEtD,IAAA,OAAOL,eAAe,GAAGG,SAAS,CAACC,IAAI,CAAC,GAAG;MAAE,GAAGA,IAAAA;KAAM,CAAA;AACxD,GAAC,CAAC,CAAA;AACJ;;;;"}
@@ -0,0 +1,20 @@
1
+ import cssStyle from './css-style.js';
2
+
3
+ /** Options of a cell on small screens (the table becomes cards). */
4
+
5
+ /** A cell's width: numbers (or unitless strings) are px. */
6
+ function widthStyle(width) {
7
+ if (width === undefined || width === null || width === '') return undefined;
8
+ const value = typeof width === 'number' || !isNaN(Number(width)) ? `${width}px` : width;
9
+ return cssStyle({
10
+ width: value
11
+ });
12
+ }
13
+ function alignClasses(align) {
14
+ if (align === 'right') return 'euiTableCellContent--alignRight';
15
+ if (align === 'center') return 'euiTableCellContent--alignCenter';
16
+ return undefined;
17
+ }
18
+
19
+ export { alignClasses, widthStyle };
20
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sources":["../../src/-private/table.ts"],"sourcesContent":["import cssStyle from './css-style.ts';\n\nexport type TableAlignment = 'left' | 'right' | 'center';\n\n/** Options of a cell on small screens (the table becomes cards). */\nexport interface TableMobileOptions {\n /** Shows the cell on small screens. Defaults to `true`. */\n show?: boolean;\n /** Shows the cell only on small screens. */\n only?: boolean;\n /** Label of the cell on small screens (a row cell). */\n header?: string;\n /** Bigger text on small screens (a row cell). */\n enlarge?: boolean;\n /** Alignment on small screens (a row cell). */\n align?: TableAlignment;\n /** Truncates the text on small screens (a row cell). */\n truncateText?: boolean;\n}\n\n/** A cell's width: numbers (or unitless strings) are px. */\nexport function widthStyle(width?: number | string) {\n if (width === undefined || width === null || width === '') return undefined;\n\n const value = typeof width === 'number' || !isNaN(Number(width)) ? `${width}px` : width;\n\n return cssStyle({ width: value });\n}\n\nexport function alignClasses(align?: TableAlignment): string | undefined {\n if (align === 'right') return 'euiTableCellContent--alignRight';\n if (align === 'center') return 'euiTableCellContent--alignCenter';\n\n return undefined;\n}\n"],"names":["widthStyle","width","undefined","value","isNaN","Number","cssStyle","alignClasses","align"],"mappings":";;AAIA;;AAgBA;AACO,SAASA,UAAUA,CAACC,KAAuB,EAAE;AAClD,EAAA,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE,OAAOC,SAAS,CAAA;EAE3E,MAAMC,KAAK,GAAG,OAAOF,KAAK,KAAK,QAAQ,IAAI,CAACG,KAAK,CAACC,MAAM,CAACJ,KAAK,CAAC,CAAC,GAAI,GAAEA,KAAM,CAAA,EAAA,CAAG,GAAGA,KAAK,CAAA;AAEvF,EAAA,OAAOK,QAAQ,CAAC;AAAEL,IAAAA,KAAK,EAAEE,KAAAA;AAAM,GAAC,CAAC,CAAA;AACnC,CAAA;AAEO,SAASI,YAAYA,CAACC,KAAsB,EAAsB;AACvE,EAAA,IAAIA,KAAK,KAAK,OAAO,EAAE,OAAO,iCAAiC,CAAA;AAC/D,EAAA,IAAIA,KAAK,KAAK,QAAQ,EAAE,OAAO,kCAAkC,CAAA;AAEjE,EAAA,OAAON,SAAS,CAAA;AAClB;;;;"}
@@ -0,0 +1,94 @@
1
+ /** -1: only in the before text, 1: only in the after text, 0: in both. */
2
+
3
+ /** Splits text into words and the whitespace between them. */
4
+ function words(text) {
5
+ return text.match(/\s+|[^\s]+/g) ?? [];
6
+ }
7
+
8
+ /**
9
+ * Diffs two lists of tokens (characters or words) with Myers' algorithm
10
+ * and returns the text of consecutive tokens with the same operation.
11
+ */
12
+ function diffTokens(before, after) {
13
+ // common prefix and suffix need no search
14
+ let start = 0;
15
+ while (start < before.length && start < after.length && before[start] === after[start]) {
16
+ start++;
17
+ }
18
+ let endBefore = before.length;
19
+ let endAfter = after.length;
20
+ while (endBefore > start && endAfter > start && before[endBefore - 1] === after[endAfter - 1]) {
21
+ endBefore--;
22
+ endAfter--;
23
+ }
24
+ const chunks = [];
25
+ const push = (operation, token) => {
26
+ const last = chunks[chunks.length - 1];
27
+ if (last && last[0] === operation) {
28
+ last[1] += token;
29
+ } else {
30
+ chunks.push([operation, token]);
31
+ }
32
+ };
33
+ before.slice(0, start).forEach(token => push(0, token));
34
+ myers(before.slice(start, endBefore), after.slice(start, endAfter)).forEach(([op, token]) => push(op, token));
35
+ before.slice(endBefore).forEach(token => push(0, token));
36
+ return chunks;
37
+ }
38
+ function myers(a, b) {
39
+ const n = a.length;
40
+ const m = b.length;
41
+ if (n === 0) return b.map(token => [1, token]);
42
+ if (m === 0) return a.map(token => [-1, token]);
43
+ const max = n + m;
44
+ const offset = max + 1;
45
+ const v = new Int32Array(2 * max + 3);
46
+ // v's entries for diagonals -(d + 1)..(d + 1) at the start of each step
47
+ const trace = [];
48
+ let found = -1;
49
+ for (let d = 0; d <= max && found < 0; d++) {
50
+ trace.push(v.slice(offset - d - 1, offset + d + 2));
51
+ for (let k = -d; k <= d; k += 2) {
52
+ let x = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1] ? v[offset + k + 1] : v[offset + k - 1] + 1;
53
+ let y = x - k;
54
+ while (x < n && y < m && a[x] === b[y]) {
55
+ x++;
56
+ y++;
57
+ }
58
+ v[offset + k] = x;
59
+ if (x >= n && y >= m) {
60
+ found = d;
61
+ break;
62
+ }
63
+ }
64
+ }
65
+ const reversed = [];
66
+ let x = n;
67
+ let y = m;
68
+ for (let d = found; d >= 0; d--) {
69
+ const snapshot = trace[d];
70
+ const at = k => snapshot[k + d + 1];
71
+ const k = x - y;
72
+ const prevK = k === -d || k !== d && at(k - 1) < at(k + 1) ? k + 1 : k - 1;
73
+ const prevX = at(prevK);
74
+ const prevY = prevX - prevK;
75
+ while (x > prevX && y > prevY) {
76
+ reversed.push([0, a[x - 1]]);
77
+ x--;
78
+ y--;
79
+ }
80
+ if (d > 0) {
81
+ if (x === prevX) {
82
+ reversed.push([1, b[prevY]]);
83
+ } else {
84
+ reversed.push([-1, a[prevX]]);
85
+ }
86
+ }
87
+ x = prevX;
88
+ y = prevY;
89
+ }
90
+ return reversed.reverse();
91
+ }
92
+
93
+ export { diffTokens, words };
94
+ //# sourceMappingURL=text-diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-diff.js","sources":["../../src/-private/text-diff.ts"],"sourcesContent":["/** -1: only in the before text, 1: only in the after text, 0: in both. */\nexport type DiffOperation = -1 | 0 | 1;\nexport type DiffChunk = [DiffOperation, string];\n\n/** Splits text into words and the whitespace between them. */\nexport function words(text: string): string[] {\n return text.match(/\\s+|[^\\s]+/g) ?? [];\n}\n\n/**\n * Diffs two lists of tokens (characters or words) with Myers' algorithm\n * and returns the text of consecutive tokens with the same operation.\n */\nexport function diffTokens(before: string[], after: string[]): DiffChunk[] {\n // common prefix and suffix need no search\n let start = 0;\n while (start < before.length && start < after.length && before[start] === after[start]) {\n start++;\n }\n\n let endBefore = before.length;\n let endAfter = after.length;\n while (endBefore > start && endAfter > start && before[endBefore - 1] === after[endAfter - 1]) {\n endBefore--;\n endAfter--;\n }\n\n const chunks: DiffChunk[] = [];\n const push = (operation: DiffOperation, token: string) => {\n const last = chunks[chunks.length - 1];\n\n if (last && last[0] === operation) {\n last[1] += token;\n } else {\n chunks.push([operation, token]);\n }\n };\n\n before.slice(0, start).forEach((token) => push(0, token));\n myers(before.slice(start, endBefore), after.slice(start, endAfter)).forEach(([op, token]) =>\n push(op, token)\n );\n before.slice(endBefore).forEach((token) => push(0, token));\n\n return chunks;\n}\n\nfunction myers(a: string[], b: string[]): DiffChunk[] {\n const n = a.length;\n const m = b.length;\n\n if (n === 0) return b.map((token) => [1, token]);\n if (m === 0) return a.map((token) => [-1, token]);\n\n const max = n + m;\n const offset = max + 1;\n const v = new Int32Array(2 * max + 3);\n // v's entries for diagonals -(d + 1)..(d + 1) at the start of each step\n const trace: Int32Array[] = [];\n\n let found = -1;\n\n for (let d = 0; d <= max && found < 0; d++) {\n trace.push(v.slice(offset - d - 1, offset + d + 2));\n\n for (let k = -d; k <= d; k += 2) {\n let x =\n k === -d || (k !== d && v[offset + k - 1]! < v[offset + k + 1]!)\n ? v[offset + k + 1]!\n : v[offset + k - 1]! + 1;\n let y = x - k;\n\n while (x < n && y < m && a[x] === b[y]) {\n x++;\n y++;\n }\n\n v[offset + k] = x;\n\n if (x >= n && y >= m) {\n found = d;\n break;\n }\n }\n }\n\n const reversed: DiffChunk[] = [];\n let x = n;\n let y = m;\n\n for (let d = found; d >= 0; d--) {\n const snapshot = trace[d]!;\n const at = (k: number) => snapshot[k + d + 1]!;\n const k = x - y;\n const prevK = k === -d || (k !== d && at(k - 1) < at(k + 1)) ? k + 1 : k - 1;\n const prevX = at(prevK);\n const prevY = prevX - prevK;\n\n while (x > prevX && y > prevY) {\n reversed.push([0, a[x - 1]!]);\n x--;\n y--;\n }\n\n if (d > 0) {\n if (x === prevX) {\n reversed.push([1, b[prevY]!]);\n } else {\n reversed.push([-1, a[prevX]!]);\n }\n }\n\n x = prevX;\n y = prevY;\n }\n\n return reversed.reverse();\n}\n"],"names":["words","text","match","diffTokens","before","after","start","length","endBefore","endAfter","chunks","push","operation","token","last","slice","forEach","myers","op","a","b","n","m","map","max","offset","v","Int32Array","trace","found","d","k","x","y","reversed","snapshot","at","prevK","prevX","prevY","reverse"],"mappings":"AAAA;;AAIA;AACO,SAASA,KAAKA,CAACC,IAAY,EAAY;AAC5C,EAAA,OAAOA,IAAI,CAACC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;AACxC,CAAA;;AAEA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,MAAgB,EAAEC,KAAe,EAAe;AACzE;EACA,IAAIC,KAAK,GAAG,CAAC,CAAA;EACb,OAAOA,KAAK,GAAGF,MAAM,CAACG,MAAM,IAAID,KAAK,GAAGD,KAAK,CAACE,MAAM,IAAIH,MAAM,CAACE,KAAK,CAAC,KAAKD,KAAK,CAACC,KAAK,CAAC,EAAE;AACtFA,IAAAA,KAAK,EAAE,CAAA;AACT,GAAA;AAEA,EAAA,IAAIE,SAAS,GAAGJ,MAAM,CAACG,MAAM,CAAA;AAC7B,EAAA,IAAIE,QAAQ,GAAGJ,KAAK,CAACE,MAAM,CAAA;EAC3B,OAAOC,SAAS,GAAGF,KAAK,IAAIG,QAAQ,GAAGH,KAAK,IAAIF,MAAM,CAACI,SAAS,GAAG,CAAC,CAAC,KAAKH,KAAK,CAACI,QAAQ,GAAG,CAAC,CAAC,EAAE;AAC7FD,IAAAA,SAAS,EAAE,CAAA;AACXC,IAAAA,QAAQ,EAAE,CAAA;AACZ,GAAA;EAEA,MAAMC,MAAmB,GAAG,EAAE,CAAA;AAC9B,EAAA,MAAMC,IAAI,GAAGA,CAACC,SAAwB,EAAEC,KAAa,KAAK;IACxD,MAAMC,IAAI,GAAGJ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AEQ,CAAC,CAACa,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,CAAA;AAC7BA,MAAAA,CAAC,EAAE,CAAA;AACHC,MAAAA,CAAC,EAAE,CAAA;AACL,KAAA;IAEA,IAAIH,CAAC,GAAG,CAAC,EAAE;MACT,IAAIE,CAAC,KAAKM,KAAK,EAAE;QACfJ,QAAQ,CAACvB,IAAI,CAAC,CAAC,CAAC,EAAES,CAAC,CAACmB,KAAK,CAAC,CAAE,CAAC,CAAA;AAC/B,OAAC,MAAM;AACLL,QAAAA,QAAQ,CAACvB,IAAI,CAAC,CAAC,CAAC,CAAC,EAAEQ,CAAC,CAACmB,KAAK,CAAC,CAAE,CAAC,CAAA;AAChC,OAAA;AACF,KAAA;AAEAN,IAAAA,CAAC,GAAGM,KAAK,CAAA;AACTL,IAAAA,CAAC,GAAGM,KAAK,CAAA;AACX,GAAA;AAEA,EAAA,OAAOL,QAAQ,CAACM,OAAO,EAAE,CAAA;AAC3B;;;;"}
@@ -0,0 +1 @@
1
+ export { default } from "@ember-eui/core/components/eui-aspect-ratio";
@@ -0,0 +1 @@
1
+ export { default } from "@ember-eui/core/components/eui-beacon";
@@ -0,0 +1 @@
1
+ export { default } from "@ember-eui/core/components/eui-color-palette-display";
@@ -0,0 +1 @@
1
+ export { default } from "@ember-eui/core/components/eui-color-palette-picker";
@@ -0,0 +1 @@
1
+ export { default } from "@ember-eui/core/components/eui-color-picker-swatch";