@patternfly/elements 3.0.0 → 3.0.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 (365) hide show
  1. package/custom-elements.json +490 -484
  2. package/package.json +1 -1
  3. package/pf-accordion/BaseAccordion.js +2 -1
  4. package/pf-accordion/BaseAccordion.js.map +1 -1
  5. package/pf-accordion/BaseAccordionHeader.js +4 -1
  6. package/pf-accordion/BaseAccordionHeader.js.map +1 -1
  7. package/pf-accordion/BaseAccordionPanel.d.ts +1 -1
  8. package/pf-accordion/pf-accordion-header.d.ts +1 -1
  9. package/pf-accordion/pf-accordion.d.ts +0 -5
  10. package/pf-accordion/pf-accordion.js +0 -5
  11. package/pf-accordion/pf-accordion.js.map +1 -1
  12. package/pf-accordion/test/pf-accordion.e2e.d.ts +1 -0
  13. package/pf-accordion/test/pf-accordion.e2e.js +11 -0
  14. package/pf-accordion/test/pf-accordion.e2e.js.map +1 -0
  15. package/pf-accordion/test/pf-accordion.spec.d.ts +1 -0
  16. package/pf-accordion/test/pf-accordion.spec.js +1222 -0
  17. package/pf-accordion/test/pf-accordion.spec.js.map +1 -0
  18. package/pf-avatar/BaseAvatar.d.ts +1 -1
  19. package/pf-avatar/test/pf-avatar.e2e.d.ts +1 -0
  20. package/pf-avatar/test/pf-avatar.e2e.js +11 -0
  21. package/pf-avatar/test/pf-avatar.e2e.js.map +1 -0
  22. package/pf-avatar/test/pf-avatar.spec.d.ts +1 -0
  23. package/pf-avatar/test/pf-avatar.spec.js +45 -0
  24. package/pf-avatar/test/pf-avatar.spec.js.map +1 -0
  25. package/pf-back-to-top/demo/demo.css +25 -0
  26. package/pf-back-to-top/pf-back-to-top.d.ts +1 -1
  27. package/pf-back-to-top/test/pf-back-to-top.e2e.d.ts +1 -0
  28. package/pf-back-to-top/test/pf-back-to-top.e2e.js +11 -0
  29. package/pf-back-to-top/test/pf-back-to-top.e2e.js.map +1 -0
  30. package/pf-back-to-top/test/pf-back-to-top.spec.d.ts +1 -0
  31. package/pf-back-to-top/test/pf-back-to-top.spec.js +267 -0
  32. package/pf-back-to-top/test/pf-back-to-top.spec.js.map +1 -0
  33. package/pf-background-image/pf-background-image.d.ts +1 -4
  34. package/pf-background-image/pf-background-image.js +1 -4
  35. package/pf-background-image/pf-background-image.js.map +1 -1
  36. package/pf-background-image/test/pf-background-image.e2e.d.ts +1 -0
  37. package/pf-background-image/test/pf-background-image.e2e.js +11 -0
  38. package/pf-background-image/test/pf-background-image.e2e.js.map +1 -0
  39. package/pf-background-image/test/pf-background-image.spec.d.ts +1 -0
  40. package/pf-background-image/test/pf-background-image.spec.js +89 -0
  41. package/pf-background-image/test/pf-background-image.spec.js.map +1 -0
  42. package/pf-badge/BaseBadge.d.ts +1 -1
  43. package/pf-badge/test/pf-badge.e2e.d.ts +1 -0
  44. package/pf-badge/test/pf-badge.e2e.js +11 -0
  45. package/pf-badge/test/pf-badge.e2e.js.map +1 -0
  46. package/pf-badge/test/pf-badge.spec.d.ts +1 -0
  47. package/pf-badge/test/pf-badge.spec.js +52 -0
  48. package/pf-badge/test/pf-badge.spec.js.map +1 -0
  49. package/pf-banner/pf-banner.d.ts +1 -10
  50. package/pf-banner/pf-banner.js +0 -9
  51. package/pf-banner/pf-banner.js.map +1 -1
  52. package/pf-banner/test/pf-banner.e2e.d.ts +1 -0
  53. package/pf-banner/test/pf-banner.e2e.js +11 -0
  54. package/pf-banner/test/pf-banner.e2e.js.map +1 -0
  55. package/pf-banner/test/pf-banner.spec.d.ts +1 -0
  56. package/pf-banner/test/pf-banner.spec.js +81 -0
  57. package/pf-banner/test/pf-banner.spec.js.map +1 -0
  58. package/pf-button/BaseButton.d.ts +7 -2
  59. package/pf-button/BaseButton.js +4 -1
  60. package/pf-button/BaseButton.js.map +1 -1
  61. package/pf-button/pf-button.d.ts +1 -17
  62. package/pf-button/pf-button.js +10 -18
  63. package/pf-button/pf-button.js.map +1 -1
  64. package/pf-button/test/pf-button.e2e.d.ts +1 -0
  65. package/pf-button/test/pf-button.e2e.js +11 -0
  66. package/pf-button/test/pf-button.e2e.js.map +1 -0
  67. package/pf-button/test/pf-button.spec.d.ts +1 -0
  68. package/pf-button/test/pf-button.spec.js +124 -0
  69. package/pf-button/test/pf-button.spec.js.map +1 -0
  70. package/pf-card/BaseCard.d.ts +1 -1
  71. package/pf-card/test/pf-card.e2e.d.ts +1 -0
  72. package/pf-card/test/pf-card.e2e.js +11 -0
  73. package/pf-card/test/pf-card.e2e.js.map +1 -0
  74. package/pf-card/test/pf-card.spec.d.ts +1 -0
  75. package/pf-card/test/pf-card.spec.js +160 -0
  76. package/pf-card/test/pf-card.spec.js.map +1 -0
  77. package/pf-chip/pf-chip-group.d.ts +8 -5
  78. package/pf-chip/pf-chip-group.js +10 -10
  79. package/pf-chip/pf-chip-group.js.map +1 -1
  80. package/pf-chip/pf-chip.d.ts +8 -5
  81. package/pf-chip/pf-chip.js +4 -4
  82. package/pf-chip/pf-chip.js.map +1 -1
  83. package/pf-chip/test/pf-chip-group.spec.d.ts +1 -0
  84. package/pf-chip/test/pf-chip-group.spec.js +189 -0
  85. package/pf-chip/test/pf-chip-group.spec.js.map +1 -0
  86. package/pf-chip/test/pf-chip.e2e.d.ts +1 -0
  87. package/pf-chip/test/pf-chip.e2e.js +11 -0
  88. package/pf-chip/test/pf-chip.e2e.js.map +1 -0
  89. package/pf-chip/test/pf-chip.spec.d.ts +1 -0
  90. package/pf-chip/test/pf-chip.spec.js +116 -0
  91. package/pf-chip/test/pf-chip.spec.js.map +1 -0
  92. package/pf-clipboard-copy/pf-clipboard-copy.css +4 -0
  93. package/pf-clipboard-copy/pf-clipboard-copy.d.ts +8 -3
  94. package/pf-clipboard-copy/pf-clipboard-copy.js +6 -4
  95. package/pf-clipboard-copy/pf-clipboard-copy.js.map +1 -1
  96. package/pf-clipboard-copy/test/pf-clipboard-copy.e2e.d.ts +1 -0
  97. package/pf-clipboard-copy/test/pf-clipboard-copy.e2e.js +11 -0
  98. package/pf-clipboard-copy/test/pf-clipboard-copy.e2e.js.map +1 -0
  99. package/pf-clipboard-copy/test/pf-clipboard-copy.spec.d.ts +1 -0
  100. package/pf-clipboard-copy/test/pf-clipboard-copy.spec.js +103 -0
  101. package/pf-clipboard-copy/test/pf-clipboard-copy.spec.js.map +1 -0
  102. package/pf-code-block/BaseCodeBlock.js +2 -2
  103. package/pf-code-block/BaseCodeBlock.js.map +1 -1
  104. package/pf-code-block/pf-code-block.d.ts +1 -1
  105. package/pf-code-block/test/pf-code-block.e2e.d.ts +1 -0
  106. package/pf-code-block/test/pf-code-block.e2e.js +11 -0
  107. package/pf-code-block/test/pf-code-block.e2e.js.map +1 -0
  108. package/pf-code-block/test/pf-code-block.spec.d.ts +1 -0
  109. package/pf-code-block/test/pf-code-block.spec.js +89 -0
  110. package/pf-code-block/test/pf-code-block.spec.js.map +1 -0
  111. package/pf-dropdown/pf-dropdown-group.d.ts +1 -1
  112. package/pf-dropdown/pf-dropdown-group.js +4 -1
  113. package/pf-dropdown/pf-dropdown-group.js.map +1 -1
  114. package/pf-dropdown/pf-dropdown-item.d.ts +1 -2
  115. package/pf-dropdown/pf-dropdown-item.js +4 -2
  116. package/pf-dropdown/pf-dropdown-item.js.map +1 -1
  117. package/pf-dropdown/pf-dropdown-menu.d.ts +1 -2
  118. package/pf-dropdown/pf-dropdown-menu.js +8 -6
  119. package/pf-dropdown/pf-dropdown-menu.js.map +1 -1
  120. package/pf-dropdown/pf-dropdown.d.ts +8 -6
  121. package/pf-dropdown/pf-dropdown.js +11 -11
  122. package/pf-dropdown/pf-dropdown.js.map +1 -1
  123. package/pf-dropdown/test/pf-dropdown.e2e.d.ts +1 -0
  124. package/pf-dropdown/test/pf-dropdown.e2e.js +11 -0
  125. package/pf-dropdown/test/pf-dropdown.e2e.js.map +1 -0
  126. package/pf-dropdown/test/pf-dropdown.spec.d.ts +1 -0
  127. package/pf-dropdown/test/pf-dropdown.spec.js +129 -0
  128. package/pf-dropdown/test/pf-dropdown.spec.js.map +1 -0
  129. package/pf-icon/BaseIcon.d.ts +1 -2
  130. package/pf-icon/BaseIcon.js +3 -4
  131. package/pf-icon/BaseIcon.js.map +1 -1
  132. package/pf-icon/demo/icons/rh/boba-tea.js +5 -0
  133. package/pf-icon/demo/icons/rh/lifecycle.js +3 -0
  134. package/pf-icon/test/pf-icon.e2e.d.ts +1 -0
  135. package/pf-icon/test/pf-icon.e2e.js +11 -0
  136. package/pf-icon/test/pf-icon.e2e.js.map +1 -0
  137. package/pf-icon/test/pf-icon.spec.d.ts +1 -0
  138. package/pf-icon/test/pf-icon.spec.js +130 -0
  139. package/pf-icon/test/pf-icon.spec.js.map +1 -0
  140. package/pf-icon/test/rh-icon-aed.js +2 -0
  141. package/pf-icon/test/rh-icon-api.js +2 -0
  142. package/pf-icon/test/rh-icon-atom.js +2 -0
  143. package/pf-icon/test/rh-icon-bike.js +2 -0
  144. package/pf-jump-links/pf-jump-links-item.d.ts +8 -2
  145. package/pf-jump-links/pf-jump-links-item.js +4 -1
  146. package/pf-jump-links/pf-jump-links-item.js.map +1 -1
  147. package/pf-jump-links/pf-jump-links-list.d.ts +1 -1
  148. package/pf-jump-links/pf-jump-links.d.ts +1 -7
  149. package/pf-jump-links/pf-jump-links.js +1 -7
  150. package/pf-jump-links/pf-jump-links.js.map +1 -1
  151. package/pf-jump-links/test/pf-jump-links.e2e.d.ts +1 -0
  152. package/pf-jump-links/test/pf-jump-links.e2e.js +11 -0
  153. package/pf-jump-links/test/pf-jump-links.e2e.js.map +1 -0
  154. package/pf-jump-links/test/pf-jump-links.spec.d.ts +1 -0
  155. package/pf-jump-links/test/pf-jump-links.spec.js +85 -0
  156. package/pf-jump-links/test/pf-jump-links.spec.js.map +1 -0
  157. package/pf-label/BaseLabel.d.ts +1 -1
  158. package/pf-label/pf-label.d.ts +10 -24
  159. package/pf-label/pf-label.js +4 -21
  160. package/pf-label/pf-label.js.map +1 -1
  161. package/pf-label/test/pf-label.e2e.d.ts +1 -0
  162. package/pf-label/test/pf-label.e2e.js +11 -0
  163. package/pf-label/test/pf-label.e2e.js.map +1 -0
  164. package/pf-label/test/pf-label.spec.d.ts +1 -0
  165. package/pf-label/test/pf-label.spec.js +111 -0
  166. package/pf-label/test/pf-label.spec.js.map +1 -0
  167. package/pf-modal/pf-modal.d.ts +1 -6
  168. package/pf-modal/pf-modal.js +6 -8
  169. package/pf-modal/pf-modal.js.map +1 -1
  170. package/pf-modal/test/pf-modal.e2e.d.ts +1 -0
  171. package/pf-modal/test/pf-modal.e2e.js +13 -0
  172. package/pf-modal/test/pf-modal.e2e.js.map +1 -0
  173. package/pf-modal/test/pf-modal.spec.d.ts +1 -0
  174. package/pf-modal/test/pf-modal.spec.js +197 -0
  175. package/pf-modal/test/pf-modal.spec.js.map +1 -0
  176. package/pf-panel/pf-panel.d.ts +1 -1
  177. package/pf-panel/test/pf-panel.e2e.d.ts +1 -0
  178. package/pf-panel/test/pf-panel.e2e.js +11 -0
  179. package/pf-panel/test/pf-panel.e2e.js.map +1 -0
  180. package/pf-panel/test/pf-panel.spec.d.ts +1 -0
  181. package/pf-panel/test/pf-panel.spec.js +22 -0
  182. package/pf-panel/test/pf-panel.spec.js.map +1 -0
  183. package/pf-popover/pf-popover.d.ts +1 -5
  184. package/pf-popover/pf-popover.js +12 -7
  185. package/pf-popover/pf-popover.js.map +1 -1
  186. package/pf-popover/test/pf-popover.e2e.d.ts +1 -0
  187. package/pf-popover/test/pf-popover.e2e.js +11 -0
  188. package/pf-popover/test/pf-popover.e2e.js.map +1 -0
  189. package/pf-popover/test/pf-popover.spec.d.ts +1 -0
  190. package/pf-popover/test/pf-popover.spec.js +233 -0
  191. package/pf-popover/test/pf-popover.spec.js.map +1 -0
  192. package/pf-progress/demo/kitchen-sink.css +4 -0
  193. package/pf-progress/pf-progress.d.ts +1 -22
  194. package/pf-progress/pf-progress.js +1 -22
  195. package/pf-progress/pf-progress.js.map +1 -1
  196. package/pf-progress/test/pf-progress.e2e.d.ts +1 -0
  197. package/pf-progress/test/pf-progress.e2e.js +11 -0
  198. package/pf-progress/test/pf-progress.e2e.js.map +1 -0
  199. package/pf-progress/test/pf-progress.spec.d.ts +1 -0
  200. package/pf-progress/test/pf-progress.spec.js +45 -0
  201. package/pf-progress/test/pf-progress.spec.js.map +1 -0
  202. package/pf-progress-stepper/pf-progress-step.d.ts +1 -1
  203. package/pf-progress-stepper/pf-progress-stepper.d.ts +1 -1
  204. package/pf-progress-stepper/test/pf-progress-stepper.e2e.d.ts +1 -0
  205. package/pf-progress-stepper/test/pf-progress-stepper.e2e.js +11 -0
  206. package/pf-progress-stepper/test/pf-progress-stepper.e2e.js.map +1 -0
  207. package/pf-progress-stepper/test/pf-progress-stepper.spec.d.ts +1 -0
  208. package/pf-progress-stepper/test/pf-progress-stepper.spec.js +18 -0
  209. package/pf-progress-stepper/test/pf-progress-stepper.spec.js.map +1 -0
  210. package/pf-select/pf-option-group.d.ts +1 -1
  211. package/pf-select/pf-option-group.js +2 -0
  212. package/pf-select/pf-option-group.js.map +1 -1
  213. package/pf-select/pf-option.d.ts +1 -2
  214. package/pf-select/pf-option.js +3 -4
  215. package/pf-select/pf-option.js.map +1 -1
  216. package/pf-select/pf-select.d.ts +8 -3
  217. package/pf-select/pf-select.js +51 -21
  218. package/pf-select/pf-select.js.map +1 -1
  219. package/pf-select/test/pf-select.e2e.d.ts +1 -0
  220. package/pf-select/test/pf-select.e2e.js +11 -0
  221. package/pf-select/test/pf-select.e2e.js.map +1 -0
  222. package/pf-select/test/pf-select.spec.d.ts +1 -0
  223. package/pf-select/test/pf-select.spec.js +866 -0
  224. package/pf-select/test/pf-select.spec.js.map +1 -0
  225. package/pf-spinner/BaseSpinner.d.ts +1 -2
  226. package/pf-spinner/BaseSpinner.js +2 -4
  227. package/pf-spinner/BaseSpinner.js.map +1 -1
  228. package/pf-spinner/pf-spinner.d.ts +2 -2
  229. package/pf-spinner/pf-spinner.js +8 -1
  230. package/pf-spinner/pf-spinner.js.map +1 -1
  231. package/pf-spinner/test/pf-spinner.e2e.d.ts +1 -0
  232. package/pf-spinner/test/pf-spinner.e2e.js +11 -0
  233. package/pf-spinner/test/pf-spinner.e2e.js.map +1 -0
  234. package/pf-spinner/test/pf-spinner.spec.d.ts +1 -0
  235. package/pf-spinner/test/pf-spinner.spec.js +64 -0
  236. package/pf-spinner/test/pf-spinner.spec.js.map +1 -0
  237. package/pf-switch/BaseSwitch.d.ts +1 -1
  238. package/pf-switch/BaseSwitch.js +3 -3
  239. package/pf-switch/BaseSwitch.js.map +1 -1
  240. package/pf-switch/test/pf-switch.e2e.d.ts +1 -0
  241. package/pf-switch/test/pf-switch.e2e.js +11 -0
  242. package/pf-switch/test/pf-switch.e2e.js.map +1 -0
  243. package/pf-switch/test/pf-switch.spec.d.ts +1 -0
  244. package/pf-switch/test/pf-switch.spec.js +191 -0
  245. package/pf-switch/test/pf-switch.spec.js.map +1 -0
  246. package/pf-table/pf-caption.d.ts +1 -1
  247. package/pf-table/pf-table.d.ts +1 -3
  248. package/pf-table/pf-table.js +2 -4
  249. package/pf-table/pf-table.js.map +1 -1
  250. package/pf-table/pf-tbody.d.ts +1 -1
  251. package/pf-table/pf-td.d.ts +1 -1
  252. package/pf-table/pf-th.d.ts +1 -1
  253. package/pf-table/pf-th.js +3 -3
  254. package/pf-table/pf-th.js.map +1 -1
  255. package/pf-table/pf-thead.d.ts +1 -1
  256. package/pf-table/pf-tr.d.ts +1 -1
  257. package/pf-table/pf-tr.js +4 -4
  258. package/pf-table/pf-tr.js.map +1 -1
  259. package/pf-table/test/pf-table.e2e.d.ts +1 -0
  260. package/pf-table/test/pf-table.e2e.js +11 -0
  261. package/pf-table/test/pf-table.e2e.js.map +1 -0
  262. package/pf-table/test/pf-table.spec.d.ts +1 -0
  263. package/pf-table/test/pf-table.spec.js +17 -0
  264. package/pf-table/test/pf-table.spec.js.map +1 -0
  265. package/pf-tabs/BaseTab.d.ts +2 -2
  266. package/pf-tabs/BaseTab.js +4 -1
  267. package/pf-tabs/BaseTab.js.map +1 -1
  268. package/pf-tabs/BaseTabPanel.d.ts +1 -1
  269. package/pf-tabs/BaseTabs.d.ts +1 -3
  270. package/pf-tabs/BaseTabs.js +11 -12
  271. package/pf-tabs/BaseTabs.js.map +1 -1
  272. package/pf-tabs/pf-tab-panel.d.ts +1 -1
  273. package/pf-tabs/pf-tab.d.ts +1 -17
  274. package/pf-tabs/pf-tab.js +0 -16
  275. package/pf-tabs/pf-tab.js.map +1 -1
  276. package/pf-tabs/pf-tabs.d.ts +1 -12
  277. package/pf-tabs/pf-tabs.js +2 -13
  278. package/pf-tabs/pf-tabs.js.map +1 -1
  279. package/pf-tabs/test/pf-tabs.e2e.d.ts +1 -0
  280. package/pf-tabs/test/pf-tabs.e2e.js +13 -0
  281. package/pf-tabs/test/pf-tabs.e2e.js.map +1 -0
  282. package/pf-tabs/test/pf-tabs.spec.d.ts +1 -0
  283. package/pf-tabs/test/pf-tabs.spec.js +285 -0
  284. package/pf-tabs/test/pf-tabs.spec.js.map +1 -0
  285. package/pf-text-area/pf-text-area.d.ts +1 -2
  286. package/pf-text-area/pf-text-area.js +5 -5
  287. package/pf-text-area/pf-text-area.js.map +1 -1
  288. package/pf-text-area/test/pf-text-area.e2e.d.ts +1 -0
  289. package/pf-text-area/test/pf-text-area.e2e.js +11 -0
  290. package/pf-text-area/test/pf-text-area.e2e.js.map +1 -0
  291. package/pf-text-area/test/pf-text-area.spec.d.ts +1 -0
  292. package/pf-text-area/test/pf-text-area.spec.js +89 -0
  293. package/pf-text-area/test/pf-text-area.spec.js.map +1 -0
  294. package/pf-text-input/demo/demo.css +6 -0
  295. package/pf-text-input/pf-text-input.d.ts +8 -3
  296. package/pf-text-input/pf-text-input.js +4 -2
  297. package/pf-text-input/pf-text-input.js.map +1 -1
  298. package/pf-text-input/test/pf-text-input.e2e.d.ts +1 -0
  299. package/pf-text-input/test/pf-text-input.e2e.js +11 -0
  300. package/pf-text-input/test/pf-text-input.e2e.js.map +1 -0
  301. package/pf-text-input/test/pf-text-input.spec.d.ts +1 -0
  302. package/pf-text-input/test/pf-text-input.spec.js +20 -0
  303. package/pf-text-input/test/pf-text-input.spec.js.map +1 -0
  304. package/pf-tile/BaseTile.d.ts +1 -1
  305. package/pf-tile/pf-tile.d.ts +0 -12
  306. package/pf-tile/pf-tile.js +0 -12
  307. package/pf-tile/pf-tile.js.map +1 -1
  308. package/pf-tile/test/pf-tile.e2e.d.ts +1 -0
  309. package/pf-tile/test/pf-tile.e2e.js +11 -0
  310. package/pf-tile/test/pf-tile.e2e.js.map +1 -0
  311. package/pf-tile/test/pf-tile.spec.d.ts +1 -0
  312. package/pf-tile/test/pf-tile.spec.js +54 -0
  313. package/pf-tile/test/pf-tile.spec.js.map +1 -0
  314. package/pf-timestamp/pf-timestamp.d.ts +1 -1
  315. package/pf-timestamp/pf-timestamp.js +5 -1
  316. package/pf-timestamp/pf-timestamp.js.map +1 -1
  317. package/pf-timestamp/test/pf-timestamp.e2e.d.ts +1 -0
  318. package/pf-timestamp/test/pf-timestamp.e2e.js +12 -0
  319. package/pf-timestamp/test/pf-timestamp.e2e.js.map +1 -0
  320. package/pf-timestamp/test/pf-timestamp.spec.d.ts +1 -0
  321. package/pf-timestamp/test/pf-timestamp.spec.js +156 -0
  322. package/pf-timestamp/test/pf-timestamp.spec.js.map +1 -0
  323. package/pf-tooltip/BaseTooltip.d.ts +1 -1
  324. package/pf-tooltip/pf-tooltip.d.ts +1 -4
  325. package/pf-tooltip/pf-tooltip.js +6 -7
  326. package/pf-tooltip/pf-tooltip.js.map +1 -1
  327. package/pf-tooltip/test/pf-tooltip.e2e.d.ts +1 -0
  328. package/pf-tooltip/test/pf-tooltip.e2e.js +11 -0
  329. package/pf-tooltip/test/pf-tooltip.e2e.js.map +1 -0
  330. package/pf-tooltip/test/pf-tooltip.spec.d.ts +1 -0
  331. package/pf-tooltip/test/pf-tooltip.spec.js +53 -0
  332. package/pf-tooltip/test/pf-tooltip.spec.js.map +1 -0
  333. package/pfe.min.js +273 -266
  334. package/pfe.min.js.map +3 -3
  335. package/pf-accordion/README.md +0 -44
  336. package/pf-avatar/README.md +0 -31
  337. package/pf-back-to-top/README.md +0 -32
  338. package/pf-background-image/README.md +0 -37
  339. package/pf-badge/README.md +0 -57
  340. package/pf-banner/README.md +0 -60
  341. package/pf-button/README.md +0 -61
  342. package/pf-card/README.md +0 -34
  343. package/pf-chip/README.md +0 -20
  344. package/pf-clipboard-copy/README.md +0 -8
  345. package/pf-code-block/README.md +0 -77
  346. package/pf-dropdown/README.md +0 -46
  347. package/pf-icon/README.md +0 -86
  348. package/pf-icon/icons/fab/readme.svg +0 -1
  349. package/pf-jump-links/README.md +0 -27
  350. package/pf-label/README.md +0 -61
  351. package/pf-modal/README.md +0 -63
  352. package/pf-panel/README.md +0 -10
  353. package/pf-popover/README.md +0 -48
  354. package/pf-progress/README.md +0 -33
  355. package/pf-progress-stepper/README.md +0 -41
  356. package/pf-select/README.md +0 -21
  357. package/pf-spinner/README.md +0 -46
  358. package/pf-switch/README.md +0 -91
  359. package/pf-table/README.md +0 -43
  360. package/pf-tabs/README.md +0 -40
  361. package/pf-text-area/README.md +0 -11
  362. package/pf-text-input/README.md +0 -9
  363. package/pf-tile/README.md +0 -12
  364. package/pf-timestamp/README.md +0 -64
  365. package/pf-tooltip/README.md +0 -64
@@ -0,0 +1,866 @@
1
+ import { expect, html, nextFrame } from '@open-wc/testing';
2
+ import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
3
+ import { PfSelect } from '../pf-select.js';
4
+ import { sendKeys } from '@web/test-runner-commands';
5
+ import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
6
+ async function shiftHold() {
7
+ await sendKeys({ down: 'Shift' });
8
+ }
9
+ async function shiftRelease() {
10
+ await sendKeys({ up: 'Shift' });
11
+ }
12
+ async function ctrlA() {
13
+ await sendKeys({ down: 'Control' });
14
+ await sendKeys({ down: 'a' });
15
+ await sendKeys({ up: 'a' });
16
+ await sendKeys({ up: 'Control' });
17
+ }
18
+ function press(key) {
19
+ return async function () {
20
+ await sendKeys({ press: key });
21
+ };
22
+ }
23
+ function getValues(element) {
24
+ return [element.selected].flat().filter(x => !!x).map(x => x.value);
25
+ }
26
+ describe('<pf-select>', function () {
27
+ let element;
28
+ const updateComplete = () => element.updateComplete;
29
+ const focus = () => element.focus();
30
+ describe('simply instantiating', function () {
31
+ it('imperatively instantiates', function () {
32
+ expect(document.createElement('pf-select')).to.be.an.instanceof(PfSelect);
33
+ });
34
+ it('should upgrade', async function () {
35
+ element = await createFixture(html `<pf-select></pf-select>`);
36
+ const klass = customElements.get('pf-select');
37
+ expect(element)
38
+ .to.be.an.instanceOf(klass)
39
+ .and
40
+ .to.be.an.instanceOf(PfSelect);
41
+ });
42
+ });
43
+ describe('variant="single"', function () {
44
+ beforeEach(async function () {
45
+ element = await createFixture(html `
46
+ <pf-select variant="single"
47
+ accessible-label="Choose a number"
48
+ placeholder="Choose a number">
49
+ <pf-option value="1">1</pf-option>
50
+ <pf-option value="2">2</pf-option>
51
+ <pf-option value="3">3</pf-option>
52
+ <pf-option value="4">4</pf-option>
53
+ <pf-option value="5">5</pf-option>
54
+ <pf-option value="6">6</pf-option>
55
+ <pf-option value="7">7</pf-option>
56
+ <pf-option value="8">8</pf-option>
57
+ </pf-select>`);
58
+ });
59
+ it('is accessible', async function () {
60
+ await expect(element).to.be.accessible();
61
+ });
62
+ describe('without accessible label', function () {
63
+ beforeEach(function () {
64
+ element.accessibleLabel = undefined;
65
+ });
66
+ beforeEach(updateComplete);
67
+ it('fails accessibility audit', async function () {
68
+ await expect(element).to.not.be.accessible();
69
+ });
70
+ });
71
+ describe('calling focus())', function () {
72
+ beforeEach(function () {
73
+ element.focus();
74
+ });
75
+ beforeEach(updateComplete);
76
+ describe('pressing Enter', function () {
77
+ beforeEach(press('Enter'));
78
+ beforeEach(updateComplete);
79
+ it('expands', async function () {
80
+ expect(element.expanded).to.be.true;
81
+ const snapshot = await a11ySnapshot();
82
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
83
+ expect(listbox).to.be.ok;
84
+ });
85
+ it('focuses on the placeholder', async function () {
86
+ const snapshot = await a11ySnapshot();
87
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
88
+ const focused = listbox?.children?.find(x => x.focused);
89
+ expect(focused?.name).to.equal('Choose a number');
90
+ });
91
+ });
92
+ describe('pressing Space', function () {
93
+ beforeEach(press(' '));
94
+ beforeEach(updateComplete);
95
+ it('expands', async function () {
96
+ expect(element.expanded).to.be.true;
97
+ const snapshot = await a11ySnapshot();
98
+ expect(snapshot.children?.at(1)).to.be.ok;
99
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
100
+ });
101
+ it('focuses on the placeholder', async function () {
102
+ const snapshot = await a11ySnapshot();
103
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
104
+ const focused = listbox?.children?.find(x => x.focused);
105
+ expect(focused?.name).to.equal('Choose a number');
106
+ });
107
+ });
108
+ describe('pressing ArrowDown', function () {
109
+ beforeEach(press('ArrowDown'));
110
+ beforeEach(updateComplete);
111
+ it('expands', async function () {
112
+ expect(element.expanded).to.be.true;
113
+ const snapshot = await a11ySnapshot();
114
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
115
+ expect(listbox).to.be.ok;
116
+ });
117
+ it('focuses on option 1', async function () {
118
+ const snapshot = await a11ySnapshot();
119
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
120
+ const focused = listbox?.children?.find(x => x.focused);
121
+ expect(focused?.name).to.equal('Choose a number');
122
+ });
123
+ describe('then pressing ArrowUp', function () {
124
+ beforeEach(press('ArrowUp'));
125
+ beforeEach(updateComplete);
126
+ it('focuses on the last option', async function () {
127
+ const snapshot = await a11ySnapshot();
128
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
129
+ const focused = listbox?.children?.find(x => x.focused);
130
+ expect(focused?.name).to.equal('8');
131
+ });
132
+ describe('then pressing ArrowDown', function () {
133
+ beforeEach(press('ArrowDown'));
134
+ beforeEach(updateComplete);
135
+ it('focuses on the placeholder', async function () {
136
+ const snapshot = await a11ySnapshot();
137
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
138
+ const focused = listbox?.children?.find(x => x.focused);
139
+ expect(focused?.name).to.equal('Choose a number');
140
+ });
141
+ });
142
+ });
143
+ describe('then pressing ArrowDown', function () {
144
+ beforeEach(press('ArrowDown'));
145
+ beforeEach(updateComplete);
146
+ it('focuses on option 1', async function () {
147
+ const snapshot = await a11ySnapshot();
148
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
149
+ const focused = listbox?.children?.find(x => x.focused);
150
+ expect(focused?.name).to.equal('1');
151
+ });
152
+ describe('then pressing ArrowUp', function () {
153
+ beforeEach(press('ArrowUp'));
154
+ beforeEach(updateComplete);
155
+ it('focuses on the placeholder', async function () {
156
+ const snapshot = await a11ySnapshot();
157
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
158
+ const focused = listbox?.children?.find(x => x.focused);
159
+ expect(focused?.name).to.equal('Choose a number');
160
+ });
161
+ });
162
+ describe('then pressing Enter', function () {
163
+ beforeEach(press('Enter'));
164
+ beforeEach(updateComplete);
165
+ it('selects option 1', function () {
166
+ expect(getValues(element)).to.deep.equal(['1']);
167
+ });
168
+ });
169
+ });
170
+ describe('then pressing Space', function () {
171
+ beforeEach(press(' '));
172
+ beforeEach(updateComplete);
173
+ it('closes', function () {
174
+ expect(element.expanded).to.be.false;
175
+ });
176
+ it('hides the listbox', async function () {
177
+ const snapshot = await a11ySnapshot();
178
+ expect(snapshot.children?.find(x => x.role === 'listbox')).to.be.undefined;
179
+ });
180
+ it('focuses the button', async function () {
181
+ const snapshot = await a11ySnapshot();
182
+ const focused = snapshot.children?.find(x => x.focused);
183
+ expect(focused?.role).to.equal('combobox');
184
+ expect(focused?.haspopup).to.equal('listbox');
185
+ });
186
+ it('does not select anything', async function () {
187
+ // because the placeholder was focused
188
+ expect(getValues(element)).to.deep.equal([]);
189
+ });
190
+ });
191
+ describe('then pressing Tab', function () {
192
+ beforeEach(press('Tab'));
193
+ beforeEach(nextFrame);
194
+ beforeEach(updateComplete);
195
+ it('closes', function () {
196
+ expect(element.expanded).to.be.false;
197
+ });
198
+ it('hides the listbox', async function () {
199
+ const snapshot = await a11ySnapshot();
200
+ expect(snapshot.children?.at(1)).to.be.undefined;
201
+ });
202
+ it('focuses the button', async function () {
203
+ const snapshot = await a11ySnapshot();
204
+ const focused = snapshot.children?.find(x => x.focused);
205
+ expect(focused?.role).to.equal('combobox');
206
+ expect(focused?.haspopup).to.equal('listbox');
207
+ });
208
+ });
209
+ describe('then pressing Shift+Tab', function () {
210
+ beforeEach(shiftHold);
211
+ beforeEach(press('Tab'));
212
+ beforeEach(shiftRelease);
213
+ beforeEach(updateComplete);
214
+ it('closes', function () {
215
+ expect(element.expanded).to.be.false;
216
+ });
217
+ it('hides the listbox', async function () {
218
+ const snapshot = await a11ySnapshot();
219
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
220
+ expect(listbox).to.be.undefined;
221
+ });
222
+ it('focuses the button', async function () {
223
+ const snapshot = await a11ySnapshot();
224
+ const focused = snapshot.children?.find(x => x.focused);
225
+ expect(focused?.role).to.equal('combobox');
226
+ expect(focused?.haspopup).to.equal('listbox');
227
+ });
228
+ });
229
+ describe('then pressing Escape', function () {
230
+ beforeEach(press('Escape'));
231
+ beforeEach(nextFrame);
232
+ beforeEach(updateComplete);
233
+ it('closes', function () {
234
+ expect(element.expanded).to.be.false;
235
+ });
236
+ it('hides the listbox', async function () {
237
+ const snapshot = await a11ySnapshot();
238
+ expect(snapshot.children?.at(1)).to.be.undefined;
239
+ });
240
+ it('focuses the button', async function () {
241
+ const snapshot = await a11ySnapshot();
242
+ const focused = snapshot.children?.find(x => x.focused);
243
+ expect(focused?.role).to.equal('combobox');
244
+ expect(focused?.haspopup).to.equal('listbox');
245
+ });
246
+ });
247
+ });
248
+ });
249
+ });
250
+ describe('variant="checkbox"', function () {
251
+ beforeEach(async function () {
252
+ element = await createFixture(html `
253
+ <pf-select variant="checkbox"
254
+ accessible-label="Check it out">
255
+ <pf-option value="1">1</pf-option>
256
+ <pf-option value="2">2</pf-option>
257
+ <pf-option value="3">3</pf-option>
258
+ <pf-option value="4">4</pf-option>
259
+ <pf-option value="5">5</pf-option>
260
+ <pf-option value="6">6</pf-option>
261
+ <pf-option value="7">7</pf-option>
262
+ <pf-option value="8">8</pf-option>
263
+ </pf-select>`);
264
+ });
265
+ it('is accessible', async function () {
266
+ await expect(element).to.be.accessible();
267
+ });
268
+ describe('calling focus())', function () {
269
+ beforeEach(function () {
270
+ element.focus();
271
+ });
272
+ beforeEach(updateComplete);
273
+ describe('pressing Enter', function () {
274
+ beforeEach(press('Enter'));
275
+ beforeEach(updateComplete);
276
+ it('expands', async function () {
277
+ expect(element.expanded).to.be.true;
278
+ const snapshot = await a11ySnapshot();
279
+ expect(snapshot.children?.at(1)).to.be.ok;
280
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
281
+ });
282
+ it('should NOT use checkbox role for options', async function () {
283
+ const snapshot = await a11ySnapshot();
284
+ expect(snapshot.children?.at(1)?.children?.filter(x => x.role === 'checkbox')?.length)
285
+ .to.equal(0);
286
+ });
287
+ });
288
+ describe('pressing Space', function () {
289
+ beforeEach(press(' '));
290
+ beforeEach(updateComplete);
291
+ it('expands', async function () {
292
+ expect(element.expanded).to.be.true;
293
+ const snapshot = await a11ySnapshot();
294
+ expect(snapshot.children?.at(1)).to.be.ok;
295
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
296
+ });
297
+ });
298
+ describe('pressing ArrowDown', function () {
299
+ beforeEach(press('ArrowDown'));
300
+ beforeEach(updateComplete);
301
+ it('expands', async function () {
302
+ expect(element.expanded).to.be.true;
303
+ const snapshot = await a11ySnapshot();
304
+ expect(snapshot.children?.at(1)).to.be.ok;
305
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
306
+ });
307
+ describe('then pressing Shift+Tab', function () {
308
+ beforeEach(shiftHold);
309
+ beforeEach(press('Tab'));
310
+ beforeEach(shiftRelease);
311
+ beforeEach(updateComplete);
312
+ it('closes', async function () {
313
+ expect(element.expanded).to.be.false;
314
+ });
315
+ it('hides the listbox', async function () {
316
+ const snapshot = await a11ySnapshot();
317
+ expect(snapshot.children?.at(1)).to.be.undefined;
318
+ });
319
+ it('focuses the button', async function () {
320
+ const snapshot = await a11ySnapshot();
321
+ expect(snapshot.children?.at(0)?.role).to.equal('combobox');
322
+ expect(snapshot.children?.at(0)?.focused).to.be.true;
323
+ });
324
+ });
325
+ describe('then pressing Tab', function () {
326
+ beforeEach(press('Tab'));
327
+ beforeEach(nextFrame);
328
+ beforeEach(updateComplete);
329
+ // a little extra sleep to de-flake this test
330
+ beforeEach(nextFrame);
331
+ beforeEach(updateComplete);
332
+ it('closes', function () {
333
+ expect(element.expanded).to.be.false;
334
+ });
335
+ it('hides the listbox', async function () {
336
+ const snapshot = await a11ySnapshot();
337
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
338
+ expect(listbox).to.be.undefined;
339
+ });
340
+ });
341
+ describe('then pressing Escape', function () {
342
+ beforeEach(press('Escape'));
343
+ beforeEach(updateComplete);
344
+ it('closes', function () {
345
+ expect(element.expanded).to.be.false;
346
+ });
347
+ it('hides the listbox', async function () {
348
+ const snapshot = await a11ySnapshot();
349
+ expect(snapshot.children?.at(1)).to.be.undefined;
350
+ });
351
+ it('focuses the button', async function () {
352
+ const snapshot = await a11ySnapshot();
353
+ const focused = snapshot.children?.find(x => x.focused);
354
+ expect(focused?.role).to.equal('combobox');
355
+ });
356
+ });
357
+ describe('then pressing Space', function () {
358
+ beforeEach(press(' '));
359
+ beforeEach(updateComplete);
360
+ it('selects option 1', function () {
361
+ // because the placeholder was focused
362
+ expect(getValues(element)).to.deep.equal(['1']);
363
+ });
364
+ it('remains expanded', async function () {
365
+ expect(element.expanded).to.be.true;
366
+ const snapshot = await a11ySnapshot();
367
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
368
+ });
369
+ describe('then pressing ArrowDown', function () {
370
+ beforeEach(press('ArrowDown'));
371
+ beforeEach(updateComplete);
372
+ it('focuses option 1', async function () {
373
+ const snapshot = await a11ySnapshot();
374
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
375
+ const focused = listbox?.children?.find(x => x.focused);
376
+ expect(focused?.name).to.equal('2');
377
+ });
378
+ describe('then pressing Enter', function () {
379
+ beforeEach(press('Enter'));
380
+ beforeEach(updateComplete);
381
+ it('adds option 2 to selection', function () {
382
+ expect(getValues(element)).to.deep.equal([
383
+ '1',
384
+ '2',
385
+ ]);
386
+ });
387
+ it('remains expanded', async function () {
388
+ expect(element.expanded).to.be.true;
389
+ const snapshot = await a11ySnapshot();
390
+ expect(snapshot.children?.at(1)?.role).to.equal('listbox');
391
+ });
392
+ describe('then holding Shift and pressing down arrow / enter twice in a row', function () {
393
+ beforeEach(shiftHold);
394
+ beforeEach(press('ArrowDown'));
395
+ beforeEach(press('Enter'));
396
+ beforeEach(press('ArrowDown'));
397
+ beforeEach(press('Enter'));
398
+ beforeEach(shiftRelease);
399
+ beforeEach(updateComplete);
400
+ it('adds options 2 and 3 to the selected list', function () {
401
+ expect(getValues(element)).to.deep.equal([
402
+ '1',
403
+ '2',
404
+ '3',
405
+ '4',
406
+ ]);
407
+ });
408
+ describe('then pressing ArrowUp and Enter', function () {
409
+ beforeEach(press('ArrowUp'));
410
+ beforeEach(press('Enter'));
411
+ beforeEach(updateComplete);
412
+ it('deselects option 3', function () {
413
+ expect(getValues(element)).to.deep.equal([
414
+ '1',
415
+ '2',
416
+ '4',
417
+ ]);
418
+ });
419
+ describe('then holding down Shift and pressing arrow up / enter twice in a row', function () {
420
+ beforeEach(press('ArrowUp'));
421
+ beforeEach(press('Enter'));
422
+ beforeEach(updateComplete);
423
+ beforeEach(press('ArrowUp'));
424
+ beforeEach(press('Enter'));
425
+ beforeEach(updateComplete);
426
+ beforeEach(shiftRelease);
427
+ beforeEach(updateComplete);
428
+ it('deselects options 1 and 2', function () {
429
+ expect(getValues(element)).to.deep.equal([
430
+ '4',
431
+ ]);
432
+ });
433
+ describe('then pressing Ctrl+A', function () {
434
+ beforeEach(ctrlA);
435
+ beforeEach(updateComplete);
436
+ it('selects all options', function () {
437
+ expect(getValues(element)).to.deep.equal([
438
+ '1',
439
+ '2',
440
+ '3',
441
+ '4',
442
+ '5',
443
+ '6',
444
+ '7',
445
+ '8',
446
+ ]);
447
+ });
448
+ describe('then pressing Ctrl+A again', function () {
449
+ beforeEach(ctrlA);
450
+ beforeEach(updateComplete);
451
+ it('deselects all options', function () {
452
+ expect(getValues(element)).to.deep.equal([]);
453
+ });
454
+ });
455
+ });
456
+ });
457
+ });
458
+ });
459
+ });
460
+ });
461
+ });
462
+ });
463
+ });
464
+ });
465
+ // try again when we implement activedescendant
466
+ describe.skip('variant="typeahead"', function () {
467
+ beforeEach(async function () {
468
+ element = await createFixture(html `
469
+ <pf-select variant="${'typeahead'}">
470
+ <pf-option value="Blue">Blue</pf-option>
471
+ <pf-option value="Green">Green</pf-option>
472
+ <pf-option value="Magenta">Magenta</pf-option>
473
+ <pf-option value="Orange">Orange</pf-option>
474
+ <pf-option value="Purple">Purple</pf-option>
475
+ <pf-option value="Pink">Pink</pf-option>
476
+ <pf-option value="Red">Red</pf-option>
477
+ <pf-option value="Yellow">Yellow</pf-option>
478
+ </pf-select>`);
479
+ });
480
+ describe('custom filtering', function () {
481
+ beforeEach(function () {
482
+ // @ts-expect-error: we intend to implement this in the next release
483
+ element.customFilter = option =>
484
+ // @ts-expect-error: TODO add filter feature
485
+ new RegExp(element.filter).test(option.value);
486
+ });
487
+ beforeEach(focus);
488
+ beforeEach(updateComplete);
489
+ describe('typing "r"', function () {
490
+ beforeEach(press('r'));
491
+ beforeEach(updateComplete);
492
+ it('shows options with "r" anywhere in them', async function () {
493
+ const snapshot = await a11ySnapshot();
494
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
495
+ expect(listbox?.children?.length).to.equal(3);
496
+ expect(listbox?.children?.at(0)?.name).to.equal('Green');
497
+ expect(listbox?.children?.at(1)?.name).to.equal('Orange');
498
+ expect(listbox?.children?.at(2)?.name).to.equal('Purple');
499
+ });
500
+ });
501
+ describe('typing "R"', function () {
502
+ beforeEach(press('R'));
503
+ beforeEach(nextFrame);
504
+ beforeEach(updateComplete);
505
+ it('shows options that contain "R"', async function () {
506
+ const snapshot = await a11ySnapshot();
507
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
508
+ expect(listbox?.children?.length).to.equal(1);
509
+ expect(listbox?.children?.at(0)?.name).to.equal('Red');
510
+ });
511
+ });
512
+ });
513
+ describe('calling focus()', function () {
514
+ beforeEach(focus);
515
+ beforeEach(updateComplete);
516
+ it('has a text input for typeahead', async function () {
517
+ const snapshot = await a11ySnapshot();
518
+ const [typeahead] = snapshot.children ?? [];
519
+ expect(typeahead).to.deep.equal({
520
+ role: 'combobox',
521
+ name: 'Options',
522
+ focused: true,
523
+ autocomplete: 'both',
524
+ haspopup: 'listbox',
525
+ });
526
+ });
527
+ describe('typing "r"', function () {
528
+ beforeEach(press('r'));
529
+ beforeEach(updateComplete);
530
+ it('only shows options that start with "r" or "R"', async function () {
531
+ const snapshot = await a11ySnapshot();
532
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
533
+ expect(listbox?.children?.every(x => x.name.toLowerCase().startsWith('r'))).to.be.true;
534
+ });
535
+ });
536
+ describe('setting filter to "*"', function () {
537
+ beforeEach(function () {
538
+ // @ts-expect-error: todo: add filter feature
539
+ element.filter = '*';
540
+ });
541
+ beforeEach(updateComplete);
542
+ it('does not error', async function () {
543
+ const snapshot = await a11ySnapshot();
544
+ const [, , listbox] = snapshot.children ?? [];
545
+ expect(listbox?.children).to.not.be.ok;
546
+ });
547
+ });
548
+ describe('changing input value to "p"', function () {
549
+ beforeEach(press('p'));
550
+ beforeEach(updateComplete);
551
+ it('only shows listbox items starting with the letter p', async function () {
552
+ const snapshot = await a11ySnapshot();
553
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
554
+ expect(listbox?.children?.length).to.equal(2);
555
+ expect(listbox?.children?.at(0)?.name).to.equal('Purple');
556
+ expect(listbox?.children?.at(1)?.name).to.equal('Pink');
557
+ });
558
+ it('maintains focus on the input', async function () {
559
+ const snapshot = await a11ySnapshot();
560
+ const focused = snapshot.children?.find(x => x.focused);
561
+ expect(focused?.role).to.equal('combobox');
562
+ });
563
+ describe('pressing Backspace so input value is ""', function () {
564
+ beforeEach(press('Backspace'));
565
+ beforeEach(updateComplete);
566
+ it('all options are visible', async function () {
567
+ const snapshot = await a11ySnapshot();
568
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
569
+ expect(listbox?.children?.length).to.equal(8);
570
+ expect(listbox?.children?.at(0)?.name).to.equal('Blue');
571
+ expect(listbox?.children?.at(1)?.name).to.equal('Green');
572
+ expect(listbox?.children?.at(2)?.name).to.equal('Magenta');
573
+ expect(listbox?.children?.at(3)?.name).to.equal('Orange');
574
+ expect(listbox?.children?.at(4)?.name).to.equal('Purple');
575
+ expect(listbox?.children?.at(5)?.name).to.equal('Pink');
576
+ expect(listbox?.children?.at(6)?.name).to.equal('Red');
577
+ expect(listbox?.children?.at(7)?.name).to.equal('Yellow');
578
+ });
579
+ });
580
+ });
581
+ describe('pressing ArrowDown', function () {
582
+ beforeEach(press('ArrowDown'));
583
+ beforeEach(nextFrame);
584
+ beforeEach(updateComplete);
585
+ it('expands', async function () {
586
+ expect(element.expanded).to.be.true;
587
+ const snapshot = await a11ySnapshot();
588
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
589
+ expect(listbox).to.be.ok;
590
+ });
591
+ it('selects the first item', async function () {
592
+ const snapshot = await a11ySnapshot();
593
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
594
+ const focused = listbox?.children?.find(x => x.focused);
595
+ expect(focused).to.not.be.ok;
596
+ const selected = listbox?.children?.find(x => x.selected);
597
+ expect(selected).to.be.ok;
598
+ expect(listbox?.children?.at(0)).to.equal(selected);
599
+ });
600
+ it('does not move keyboard focus', async function () {
601
+ const snapshot = await a11ySnapshot();
602
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
603
+ const focused = listbox?.children?.find(x => x.focused);
604
+ expect(focused).to.not.be.ok;
605
+ });
606
+ describe('then pressing ArrowDown', function () {
607
+ beforeEach(press('ArrowDown'));
608
+ beforeEach(updateComplete);
609
+ it('focuses the first option', async function () {
610
+ const snapshot = await a11ySnapshot();
611
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
612
+ const focused = listbox?.children?.find(x => x.focused);
613
+ expect(focused).to.be.ok;
614
+ expect(listbox?.children?.indexOf(focused)).to.equal(0);
615
+ });
616
+ describe('then pressing Enter', function () {
617
+ beforeEach(press('Enter'));
618
+ beforeEach(updateComplete);
619
+ it('selects the second option', function () {
620
+ expect(getValues(element)).to.deep.equal(['Green']);
621
+ });
622
+ it('sets typeahead input to second option value', async function () {
623
+ const snapshot = await a11ySnapshot();
624
+ const [combobox] = snapshot.children ?? [];
625
+ expect(combobox?.value).to.equal('Green');
626
+ });
627
+ it('focuses on toggle button', async function () {
628
+ const snapshot = await a11ySnapshot();
629
+ const focused = snapshot.children?.find(x => x.focused);
630
+ expect(focused?.role).to.equal('button');
631
+ expect(focused?.haspopup).to.equal('listbox');
632
+ });
633
+ it('closes', async function () {
634
+ expect(element.expanded).to.be.false;
635
+ const snapshot = await a11ySnapshot();
636
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
637
+ expect(listbox).to.be.undefined;
638
+ });
639
+ });
640
+ });
641
+ });
642
+ });
643
+ });
644
+ // try again when we implement activedescendant
645
+ describe.skip('variant="typeaheadmulti"', function () {
646
+ beforeEach(async function () {
647
+ element = await createFixture(html `
648
+ <pf-select variant="typeaheadmulti">
649
+ <pf-option value="Amethyst">Amethyst</pf-option>
650
+ <pf-option value="Beryl">Beryl</pf-option>
651
+ <pf-option value="Chalcedony">Chalcedony</pf-option>
652
+ <pf-option value="Diamond">Diamond</pf-option>
653
+ <pf-option value="Emerald">Emerald</pf-option>
654
+ <pf-option value="Fool's Gold">Fool's Gold</pf-option>
655
+ <pf-option value="Garnet">Garnet</pf-option>
656
+ <pf-option value="Halite">Halite</pf-option>
657
+ <pf-option value="Iris">Iris</pf-option>
658
+ </pf-select>`);
659
+ });
660
+ describe('calling focus()', function () {
661
+ beforeEach(function () {
662
+ element.focus();
663
+ });
664
+ beforeEach(updateComplete);
665
+ it('focuses the typeahead input', async function () {
666
+ const snapshot = await a11ySnapshot();
667
+ const [input] = snapshot.children ?? [];
668
+ expect(input.focused).to.be.true;
669
+ expect(input.role).to.equal('combobox');
670
+ });
671
+ describe('pressing ArrowDown', function () {
672
+ beforeEach(press('ArrowDown'));
673
+ beforeEach(updateComplete);
674
+ it('expands', function () {
675
+ expect(element.expanded).to.be.true;
676
+ });
677
+ it('shows the listbox', async function () {
678
+ const snapshot = await a11ySnapshot();
679
+ expect(snapshot.children?.find(x => x.role === 'listbox')).to.be.ok;
680
+ });
681
+ it('focuses the first option', async function () {
682
+ const snapshot = await a11ySnapshot();
683
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
684
+ expect(listbox?.children?.find(x => x.focused)?.name).to.equal('Amethyst');
685
+ });
686
+ describe('then pressing Shift+Tab', function () {
687
+ beforeEach(shiftHold);
688
+ beforeEach(press('Tab'));
689
+ beforeEach(shiftRelease);
690
+ beforeEach(updateComplete);
691
+ it('closes', function () {
692
+ expect(element.expanded).to.be.false;
693
+ });
694
+ it('hides the listbox', async function () {
695
+ const snapshot = await a11ySnapshot();
696
+ expect(snapshot.children?.find(x => x.role === 'listbox')).to.be.undefined;
697
+ });
698
+ it('focuses the toggle button', async function () {
699
+ const snapshot = await a11ySnapshot();
700
+ const focused = snapshot?.children?.find(x => x.focused);
701
+ expect(focused?.role).to.equal('button');
702
+ expect(focused?.haspopup).to.equal('listbox');
703
+ });
704
+ describe('then pressing Shift+Tab', function () {
705
+ beforeEach(shiftHold);
706
+ beforeEach(press('Tab'));
707
+ beforeEach(shiftRelease);
708
+ beforeEach(updateComplete);
709
+ it('focuses the combobox input', async function () {
710
+ const snapshot = await a11ySnapshot();
711
+ const focused = snapshot?.children?.find(x => x.focused);
712
+ expect(focused?.role).to.equal('combobox');
713
+ expect(focused?.haspopup).to.equal('listbox');
714
+ });
715
+ });
716
+ });
717
+ describe('then pressing ArrowDown', function () {
718
+ beforeEach(press('ArrowDown'));
719
+ beforeEach(updateComplete);
720
+ describe('then pressing Enter', function () {
721
+ beforeEach(press('Enter'));
722
+ beforeEach(updateComplete);
723
+ it('selects the second option', function () {
724
+ expect(getValues(element)).to.deep.equal(['Beryl']);
725
+ });
726
+ it('focuses on second option', async function () {
727
+ const snapshot = await a11ySnapshot();
728
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
729
+ expect(listbox?.children?.find(x => x.focused)?.name).to.equal('Beryl');
730
+ });
731
+ it('remains expanded', async function () {
732
+ expect(element.expanded).to.be.true;
733
+ const snapshot = await a11ySnapshot();
734
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
735
+ expect(listbox).to.be.ok;
736
+ });
737
+ it('shows 1 chip', async function () {
738
+ const snapshot = await a11ySnapshot();
739
+ const [, chip1close] = snapshot.children ?? [];
740
+ expect(chip1close?.role).to.equal('button');
741
+ expect(chip1close?.name).to.equal('Close');
742
+ expect(chip1close?.description).to.equal('Beryl');
743
+ });
744
+ describe('then pressing ArrowUp', function () {
745
+ beforeEach(press('ArrowUp'));
746
+ beforeEach(updateComplete);
747
+ it('focuses the first option', async function () {
748
+ const snapshot = await a11ySnapshot();
749
+ const listbox = snapshot.children?.find(x => x.role === 'listbox');
750
+ const focused = listbox?.children?.find(x => x.focused);
751
+ expect(focused?.name).to.equal('Amethyst');
752
+ });
753
+ describe('then pressing Enter', function () {
754
+ beforeEach(press('Enter'));
755
+ beforeEach(updateComplete);
756
+ it('adds second option to selected values', function () {
757
+ expect(getValues(element)).to.deep.equal(['Amethyst', 'Beryl']);
758
+ });
759
+ it('accessible combo button label should be "2 items selected"', async function () {
760
+ const snapshot = await a11ySnapshot();
761
+ const button = snapshot.children?.find(x => x.role === 'combobox');
762
+ expect(button?.name).to.equal('2 items selected');
763
+ });
764
+ it('shows 2 chips', async function () {
765
+ const snapshot = await a11ySnapshot();
766
+ const [, chip1close, , chip2close] = snapshot.children ?? [];
767
+ expect(chip1close?.role).to.equal('button');
768
+ expect(chip1close?.name).to.equal('Close');
769
+ expect(chip1close?.description).to.equal('Amethyst');
770
+ expect(chip2close?.role).to.equal('button');
771
+ expect(chip2close?.name).to.equal('Close');
772
+ expect(chip2close?.description).to.equal('Beryl');
773
+ });
774
+ describe('then pressing Shift+Tab', function () {
775
+ beforeEach(shiftHold);
776
+ beforeEach(press('Tab'));
777
+ beforeEach(shiftRelease);
778
+ beforeEach(updateComplete);
779
+ it('focuses the toggle button', async function () {
780
+ const snapshot = await a11ySnapshot();
781
+ const focused = snapshot.children?.find(x => x.focused);
782
+ expect(focused?.role).to.equal('button');
783
+ expect(focused?.haspopup).to.equal('listbox');
784
+ });
785
+ describe('then pressing Shift+Tab', function () {
786
+ beforeEach(shiftHold);
787
+ beforeEach(press('Tab'));
788
+ beforeEach(shiftRelease);
789
+ beforeEach(updateComplete);
790
+ it('focuses the combobox input', async function () {
791
+ const snapshot = await a11ySnapshot();
792
+ const focused = snapshot.children?.find(x => x.focused);
793
+ expect(focused?.role).to.equal('combobox');
794
+ });
795
+ describe('then pressing Shift+Tab', function () {
796
+ beforeEach(shiftHold);
797
+ beforeEach(press('Tab'));
798
+ beforeEach(shiftRelease);
799
+ beforeEach(updateComplete);
800
+ it('focuses the last chip\'s close button', async function () {
801
+ const snapshot = await a11ySnapshot();
802
+ const focused = snapshot.children?.find(x => x.focused);
803
+ expect(focused?.role).to.equal('button');
804
+ expect(focused?.name).to.equal('Close');
805
+ expect(focused?.description).to.equal('Beryl');
806
+ });
807
+ describe('then pressing Space', function () {
808
+ beforeEach(updateComplete);
809
+ beforeEach(press(' '));
810
+ beforeEach(updateComplete);
811
+ beforeEach(updateComplete);
812
+ it('removes the second chip', async function () {
813
+ const snapshot = await a11ySnapshot();
814
+ const [, chip1close, ...rest] = snapshot.children ?? [];
815
+ expect(chip1close?.role).to.equal('button');
816
+ expect(chip1close?.name).to.equal('Close');
817
+ expect(chip1close?.description).to.equal('Amethyst');
818
+ expect(rest.filter(x => 'description' in x)?.length).to.equal(0);
819
+ });
820
+ it('removes the second option from the selected values', function () {
821
+ expect(getValues(element)).to.deep.equal(['Amethyst']);
822
+ });
823
+ it('focuses the combobox', async function () {
824
+ const snapshot = await a11ySnapshot();
825
+ const focused = snapshot.children?.find(x => x.focused);
826
+ expect(focused?.role).to.equal('combobox');
827
+ });
828
+ describe('then pressing Shift+Tab', function () {
829
+ beforeEach(shiftHold);
830
+ beforeEach(press('Tab'));
831
+ beforeEach(shiftRelease);
832
+ beforeEach(updateComplete);
833
+ it('focuses the first chip', async function () {
834
+ const snapshot = await a11ySnapshot();
835
+ const focused = snapshot.children?.find(x => x.focused);
836
+ expect(focused?.role).to.equal('button');
837
+ expect(focused?.description).to.equal('Amethyst');
838
+ });
839
+ describe('then pressing Space', function () {
840
+ beforeEach(press(' '));
841
+ beforeEach(updateComplete);
842
+ it('removes all chips', async function () {
843
+ const snapshot = await a11ySnapshot();
844
+ expect(snapshot.children?.find(x => x.role === 'button' && x.name === 'Close'))
845
+ .to.be.undefined;
846
+ });
847
+ it('focuses the typeahead input', async function () {
848
+ const snapshot = await a11ySnapshot();
849
+ const focused = snapshot.children?.find(x => x.focused);
850
+ expect(focused?.role).to.equal('combobox');
851
+ });
852
+ });
853
+ });
854
+ });
855
+ });
856
+ });
857
+ });
858
+ });
859
+ });
860
+ });
861
+ });
862
+ });
863
+ });
864
+ });
865
+ });
866
+ //# sourceMappingURL=pf-select.spec.js.map