@otto-de/b2b-core-components 1.34.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
  2. package/dist/b2b-core-components/{p-d2f4db88.entry.js → p-01f2aca4.entry.js} +1 -1
  3. package/dist/b2b-core-components/p-02bb4145.entry.js +1 -0
  4. package/dist/b2b-core-components/{p-e512628d.entry.js → p-0cd95c1e.entry.js} +1 -1
  5. package/dist/b2b-core-components/{p-04f5748b.entry.js → p-0e994814.entry.js} +1 -1
  6. package/dist/b2b-core-components/p-0f0fcb25.entry.js +1 -0
  7. package/dist/b2b-core-components/{p-81cffff6.entry.js → p-121ead75.entry.js} +1 -1
  8. package/dist/b2b-core-components/{p-b9a6ad5d.entry.js → p-1875aef7.entry.js} +1 -1
  9. package/dist/b2b-core-components/{p-d163d252.entry.js → p-1a232e86.entry.js} +1 -1
  10. package/dist/b2b-core-components/{p-e3877fc1.entry.js → p-1e5732bb.entry.js} +1 -1
  11. package/dist/b2b-core-components/{p-a46674a7.entry.js → p-212d2e61.entry.js} +1 -1
  12. package/dist/b2b-core-components/p-22967672.entry.js +1 -0
  13. package/dist/b2b-core-components/{p-8aba659a.entry.js → p-253502a0.entry.js} +1 -1
  14. package/dist/b2b-core-components/{p-13d37dec.entry.js → p-2aaa326b.entry.js} +1 -1
  15. package/dist/b2b-core-components/{p-c8b5c7e2.entry.js → p-3752cc70.entry.js} +1 -1
  16. package/dist/b2b-core-components/{p-c086532b.entry.js → p-3b52a3fb.entry.js} +1 -1
  17. package/dist/b2b-core-components/{p-997a232e.entry.js → p-3c6abe16.entry.js} +1 -1
  18. package/dist/b2b-core-components/p-470378e2.entry.js +1 -0
  19. package/dist/b2b-core-components/{p-f9f9820a.entry.js → p-4b8c879e.entry.js} +1 -1
  20. package/dist/b2b-core-components/p-51086123.entry.js +1 -0
  21. package/dist/b2b-core-components/{p-0648230f.entry.js → p-696b9e54.entry.js} +1 -1
  22. package/dist/b2b-core-components/{p-d62e615b.entry.js → p-6b3788ae.entry.js} +1 -1
  23. package/dist/b2b-core-components/{p-371df3f8.entry.js → p-6f5dbb23.entry.js} +1 -1
  24. package/dist/b2b-core-components/{p-b4310b58.entry.js → p-6f607a94.entry.js} +1 -1
  25. package/dist/b2b-core-components/{p-66c435c1.entry.js → p-73db8251.entry.js} +1 -1
  26. package/dist/b2b-core-components/p-7d2fb5f3.entry.js +1 -0
  27. package/dist/b2b-core-components/{p-540a8b9c.entry.js → p-80104e55.entry.js} +1 -1
  28. package/dist/b2b-core-components/{p-0aa0c59a.entry.js → p-861dba01.entry.js} +1 -1
  29. package/dist/b2b-core-components/{p-17778cfc.entry.js → p-96211730.entry.js} +1 -1
  30. package/dist/b2b-core-components/{p-f3c0fe56.entry.js → p-98ee5fd5.entry.js} +1 -1
  31. package/dist/b2b-core-components/{p-2486830b.entry.js → p-9f0dbb21.entry.js} +1 -1
  32. package/dist/b2b-core-components/p-a2d97f5d.entry.js +1 -0
  33. package/dist/b2b-core-components/{p-a9c9552f.entry.js → p-a5cc60f3.entry.js} +1 -1
  34. package/dist/b2b-core-components/{p-c25832e1.entry.js → p-a95ed002.entry.js} +1 -1
  35. package/dist/b2b-core-components/p-abcbd1cc.entry.js +1 -0
  36. package/dist/b2b-core-components/{p-0ab41eb5.entry.js → p-acdcb8c8.entry.js} +1 -1
  37. package/dist/b2b-core-components/{p-c8cc1797.entry.js → p-b0abf9e3.entry.js} +1 -1
  38. package/dist/b2b-core-components/p-b95b2de3.entry.js +1 -0
  39. package/dist/b2b-core-components/{p-433a3f3e.entry.js → p-bb0f31a9.entry.js} +1 -1
  40. package/dist/b2b-core-components/{p-89e817e9.entry.js → p-bf1d5618.entry.js} +1 -1
  41. package/dist/b2b-core-components/{p-79a01d0d.entry.js → p-db898e98.entry.js} +1 -1
  42. package/dist/b2b-core-components/p-e52728b3.entry.js +1 -0
  43. package/dist/b2b-core-components/{p-8ae9c2fe.entry.js → p-ef93e944.entry.js} +1 -1
  44. package/dist/b2b-core-components/{p-4b27240b.entry.js → p-f9e61af5.entry.js} +1 -1
  45. package/dist/b2b-core-components/{p-c43e067a.entry.js → p-fa050815.entry.js} +1 -1
  46. package/dist/b2b-core-components/p-fdb7d12c.entry.js +1 -0
  47. package/dist/cjs/b2b-background-box.cjs.entry.js +1 -1
  48. package/dist/cjs/b2b-button_2.cjs.entry.js +1 -1
  49. package/dist/cjs/b2b-chip-component_2.cjs.entry.js +2 -2
  50. package/dist/cjs/b2b-core-components.cjs.js +1 -1
  51. package/dist/cjs/b2b-custom-dropdown.cjs.entry.js +9 -5
  52. package/dist/cjs/b2b-dropdown.cjs.entry.js +72 -7
  53. package/dist/cjs/b2b-flyout-menu-option.cjs.entry.js +1 -1
  54. package/dist/cjs/b2b-flyout-menu.cjs.entry.js +3 -3
  55. package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
  56. package/dist/cjs/b2b-grid-row.cjs.entry.js +2 -2
  57. package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
  58. package/dist/cjs/b2b-input-group_2.cjs.entry.js +16 -3
  59. package/dist/cjs/b2b-input-label.cjs.entry.js +2 -2
  60. package/dist/cjs/b2b-input-list-option.cjs.entry.js +30 -0
  61. package/dist/cjs/{b2b-input_2.cjs.entry.js → b2b-input.cjs.entry.js} +4 -28
  62. package/dist/cjs/b2b-label.cjs.entry.js +2 -2
  63. package/dist/cjs/b2b-modal.cjs.entry.js +2 -2
  64. package/dist/cjs/b2b-multiselect-dropdown.cjs.entry.js +3 -3
  65. package/dist/cjs/b2b-pagination.cjs.entry.js +1 -1
  66. package/dist/cjs/b2b-progress-bar.cjs.entry.js +3 -3
  67. package/dist/cjs/b2b-radio-button.cjs.entry.js +2 -2
  68. package/dist/cjs/b2b-radio-group.cjs.entry.js +2 -2
  69. package/dist/cjs/b2b-required-separator.cjs.entry.js +1 -1
  70. package/dist/cjs/b2b-rounded-icon.cjs.entry.js +4 -4
  71. package/dist/cjs/b2b-scrollable-container.cjs.entry.js +1 -1
  72. package/dist/cjs/b2b-search.cjs.entry.js +1 -1
  73. package/dist/cjs/b2b-separator.cjs.entry.js +1 -1
  74. package/dist/cjs/b2b-shimmer.cjs.entry.js +1 -1
  75. package/dist/cjs/b2b-snackbar.cjs.entry.js +4 -4
  76. package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
  77. package/dist/cjs/b2b-tab-panel.cjs.entry.js +1 -1
  78. package/dist/cjs/b2b-tab.cjs.entry.js +2 -2
  79. package/dist/cjs/b2b-table-cell_2.cjs.entry.js +3 -3
  80. package/dist/cjs/b2b-table-row.cjs.entry.js +2 -2
  81. package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +2 -2
  82. package/dist/cjs/b2b-table.cjs.entry.js +2 -2
  83. package/dist/cjs/b2b-textarea.cjs.entry.js +2 -2
  84. package/dist/cjs/b2b-time-picker.cjs.entry.js +157 -0
  85. package/dist/cjs/b2b-toggle-button.cjs.entry.js +3 -3
  86. package/dist/cjs/b2b-toggle-chip.cjs.entry.js +3 -3
  87. package/dist/cjs/b2b-toggle-group.cjs.entry.js +2 -2
  88. package/dist/cjs/b2b-toggle-switch.cjs.entry.js +4 -4
  89. package/dist/cjs/b2b-tooltip.cjs.entry.js +3 -3
  90. package/dist/cjs/b2b-wizard-icon.cjs.entry.js +1 -1
  91. package/dist/cjs/b2b-wizard-step.cjs.entry.js +2 -2
  92. package/dist/cjs/b2b-wizard.cjs.entry.js +1 -1
  93. package/dist/cjs/index-668808fd.js +10 -2
  94. package/dist/cjs/loader.cjs.js +1 -1
  95. package/dist/collection/collection-manifest.json +1 -0
  96. package/dist/collection/components/background-box/background-box.css +2 -2
  97. package/dist/collection/components/background-box/background-box.e2e.js +1 -1
  98. package/dist/collection/components/background-box/background-box.stories.js +1 -1
  99. package/dist/collection/components/custom-dropdown/custom-dropdown.css +13 -1
  100. package/dist/collection/components/custom-dropdown/custom-dropdown.e2e.js +69 -0
  101. package/dist/collection/components/custom-dropdown/custom-dropdown.js +26 -4
  102. package/dist/collection/components/custom-dropdown/custom-dropdown.stories.js +11 -0
  103. package/dist/collection/components/dropdown/dropdown.css +11 -0
  104. package/dist/collection/components/dropdown/dropdown.e2e.js +54 -0
  105. package/dist/collection/components/dropdown/dropdown.js +90 -6
  106. package/dist/collection/components/dropdown/dropdown.stories.js +7 -2
  107. package/dist/collection/components/flyout-menu/flyout-menu-option.js +1 -1
  108. package/dist/collection/components/flyout-menu/flyout-menu.js +3 -3
  109. package/dist/collection/components/grid/column.js +1 -1
  110. package/dist/collection/components/grid/grid.js +1 -1
  111. package/dist/collection/components/grid/row.js +2 -2
  112. package/dist/collection/components/input/input.js +4 -4
  113. package/dist/collection/components/input-group/input-group.js +1 -1
  114. package/dist/collection/components/input-label/input-label.js +2 -2
  115. package/dist/collection/components/input-list/input-list-option.js +1 -1
  116. package/dist/collection/components/input-list/input-list.e2e.js +5 -5
  117. package/dist/collection/components/input-list/input-list.js +23 -6
  118. package/dist/collection/components/label/label.js +2 -2
  119. package/dist/collection/components/modal/modal.js +2 -2
  120. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.js +3 -3
  121. package/dist/collection/components/multiselect-dropdown/multiselect-option/multiselect-option.js +2 -2
  122. package/dist/collection/components/pagination/pagination.js +1 -1
  123. package/dist/collection/components/progress-bar/progress-bar.js +3 -3
  124. package/dist/collection/components/radio/radio.js +2 -2
  125. package/dist/collection/components/radio-group/radio-group.js +2 -2
  126. package/dist/collection/components/required-separator/required-separator.js +1 -1
  127. package/dist/collection/components/rounded-icon/rounded-icon.js +4 -4
  128. package/dist/collection/components/scrollable-container/scrollable-container.js +1 -1
  129. package/dist/collection/components/search/search.e2e.js +1 -1
  130. package/dist/collection/components/search/search.js +1 -1
  131. package/dist/collection/components/separator/separator.js +1 -1
  132. package/dist/collection/components/shimmer/shimmer.js +1 -1
  133. package/dist/collection/components/snackbar/snackbar.js +4 -4
  134. package/dist/collection/components/spinner/spinner.js +1 -1
  135. package/dist/collection/components/tab/tab.js +2 -2
  136. package/dist/collection/components/tab-group/tab-group.js +1 -1
  137. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  138. package/dist/collection/components/table/table-cell/table-cell.js +2 -2
  139. package/dist/collection/components/table/table-header/table-header.js +1 -1
  140. package/dist/collection/components/table/table-row/table-row.js +2 -2
  141. package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +2 -2
  142. package/dist/collection/components/table/table.js +2 -2
  143. package/dist/collection/components/textarea/textarea.js +2 -2
  144. package/dist/collection/components/time-picker/time-picker.css +345 -0
  145. package/dist/collection/components/time-picker/time-picker.e2e.js +135 -0
  146. package/dist/collection/components/time-picker/time-picker.js +411 -0
  147. package/dist/collection/components/time-picker/time-picker.stories.js +80 -0
  148. package/dist/collection/components/toggle-button/toggle-button.js +3 -3
  149. package/dist/collection/components/toggle-chip/toggle-chip.js +3 -3
  150. package/dist/collection/components/toggle-group/toggle-group.js +2 -2
  151. package/dist/collection/components/toggle-switch/toggle-switch.js +4 -4
  152. package/dist/collection/components/tooltip/tooltip.js +3 -3
  153. package/dist/collection/components/wizard/wizard-step.js +2 -2
  154. package/dist/collection/components/wizard/wizard.js +1 -1
  155. package/dist/collection/components/wizard-icon/wizard-icon.js +1 -1
  156. package/dist/components/b2b-custom-dropdown.js +10 -5
  157. package/dist/components/b2b-dropdown.js +87 -8
  158. package/dist/components/b2b-flyout-menu-option.js +1 -1
  159. package/dist/components/b2b-flyout-menu.js +3 -3
  160. package/dist/components/b2b-grid-col.js +1 -1
  161. package/dist/components/b2b-grid-row.js +2 -2
  162. package/dist/components/b2b-grid.js +1 -1
  163. package/dist/components/b2b-label.js +2 -2
  164. package/dist/components/b2b-modal.js +2 -2
  165. package/dist/components/b2b-multiselect-dropdown.js +3 -3
  166. package/dist/components/b2b-pagination.js +1 -1
  167. package/dist/components/b2b-progress-bar.js +3 -3
  168. package/dist/components/b2b-radio-button.js +2 -2
  169. package/dist/components/b2b-radio-group.js +2 -2
  170. package/dist/components/b2b-required-separator.js +1 -1
  171. package/dist/components/b2b-scrollable-container.js +1 -1
  172. package/dist/components/b2b-search.js +1 -1
  173. package/dist/components/b2b-shimmer.js +1 -1
  174. package/dist/components/b2b-snackbar.js +4 -4
  175. package/dist/components/b2b-tab-group.js +1 -1
  176. package/dist/components/b2b-tab-panel.js +1 -1
  177. package/dist/components/b2b-tab.js +2 -2
  178. package/dist/components/b2b-table-row.js +2 -2
  179. package/dist/components/b2b-table-rowgroup.js +2 -2
  180. package/dist/components/b2b-table.js +2 -2
  181. package/dist/components/b2b-textarea.js +2 -2
  182. package/dist/components/b2b-time-picker.d.ts +11 -0
  183. package/dist/components/b2b-time-picker.js +200 -0
  184. package/dist/components/b2b-toggle-button.js +3 -3
  185. package/dist/components/b2b-toggle-chip.js +3 -3
  186. package/dist/components/b2b-toggle-group.js +2 -2
  187. package/dist/components/b2b-toggle-switch.js +4 -4
  188. package/dist/components/b2b-tooltip.js +3 -3
  189. package/dist/components/b2b-wizard-step.js +2 -2
  190. package/dist/components/b2b-wizard.js +1 -1
  191. package/dist/components/background-box.js +1 -1
  192. package/dist/components/input-group.js +1 -1
  193. package/dist/components/input-label.js +2 -2
  194. package/dist/components/input-list-option.js +1 -1
  195. package/dist/components/input-list.js +19 -4
  196. package/dist/components/input.js +4 -4
  197. package/dist/components/multiselect-option.js +2 -2
  198. package/dist/components/rounded-icon.js +4 -4
  199. package/dist/components/separator.js +1 -1
  200. package/dist/components/spinner.js +1 -1
  201. package/dist/components/table-cell.js +2 -2
  202. package/dist/components/table-header.js +1 -1
  203. package/dist/components/wizard-icon.js +1 -1
  204. package/dist/custom-elements.json +64 -0
  205. package/dist/esm/b2b-background-box.entry.js +1 -1
  206. package/dist/esm/b2b-button_2.entry.js +1 -1
  207. package/dist/esm/b2b-chip-component_2.entry.js +2 -2
  208. package/dist/esm/b2b-core-components.js +1 -1
  209. package/dist/esm/b2b-custom-dropdown.entry.js +9 -5
  210. package/dist/esm/b2b-dropdown.entry.js +72 -7
  211. package/dist/esm/b2b-flyout-menu-option.entry.js +1 -1
  212. package/dist/esm/b2b-flyout-menu.entry.js +3 -3
  213. package/dist/esm/b2b-grid-col.entry.js +1 -1
  214. package/dist/esm/b2b-grid-row.entry.js +2 -2
  215. package/dist/esm/b2b-grid.entry.js +1 -1
  216. package/dist/esm/b2b-input-group_2.entry.js +16 -3
  217. package/dist/esm/b2b-input-label.entry.js +2 -2
  218. package/dist/esm/b2b-input-list-option.entry.js +26 -0
  219. package/dist/esm/{b2b-input_2.entry.js → b2b-input.entry.js} +5 -28
  220. package/dist/esm/b2b-label.entry.js +2 -2
  221. package/dist/esm/b2b-modal.entry.js +2 -2
  222. package/dist/esm/b2b-multiselect-dropdown.entry.js +3 -3
  223. package/dist/esm/b2b-pagination.entry.js +1 -1
  224. package/dist/esm/b2b-progress-bar.entry.js +3 -3
  225. package/dist/esm/b2b-radio-button.entry.js +2 -2
  226. package/dist/esm/b2b-radio-group.entry.js +2 -2
  227. package/dist/esm/b2b-required-separator.entry.js +1 -1
  228. package/dist/esm/b2b-rounded-icon.entry.js +4 -4
  229. package/dist/esm/b2b-scrollable-container.entry.js +1 -1
  230. package/dist/esm/b2b-search.entry.js +1 -1
  231. package/dist/esm/b2b-separator.entry.js +1 -1
  232. package/dist/esm/b2b-shimmer.entry.js +1 -1
  233. package/dist/esm/b2b-snackbar.entry.js +4 -4
  234. package/dist/esm/b2b-tab-group.entry.js +1 -1
  235. package/dist/esm/b2b-tab-panel.entry.js +1 -1
  236. package/dist/esm/b2b-tab.entry.js +2 -2
  237. package/dist/esm/b2b-table-cell_2.entry.js +3 -3
  238. package/dist/esm/b2b-table-row.entry.js +2 -2
  239. package/dist/esm/b2b-table-rowgroup.entry.js +2 -2
  240. package/dist/esm/b2b-table.entry.js +2 -2
  241. package/dist/esm/b2b-textarea.entry.js +2 -2
  242. package/dist/esm/b2b-time-picker.entry.js +153 -0
  243. package/dist/esm/b2b-toggle-button.entry.js +3 -3
  244. package/dist/esm/b2b-toggle-chip.entry.js +3 -3
  245. package/dist/esm/b2b-toggle-group.entry.js +2 -2
  246. package/dist/esm/b2b-toggle-switch.entry.js +4 -4
  247. package/dist/esm/b2b-tooltip.entry.js +3 -3
  248. package/dist/esm/b2b-wizard-icon.entry.js +1 -1
  249. package/dist/esm/b2b-wizard-step.entry.js +2 -2
  250. package/dist/esm/b2b-wizard.entry.js +1 -1
  251. package/dist/esm/index-ab9eb36d.js +10 -2
  252. package/dist/esm/loader.js +1 -1
  253. package/dist/types/components/custom-dropdown/custom-dropdown.d.ts +2 -0
  254. package/dist/types/components/custom-dropdown/custom-dropdown.stories.d.ts +3 -0
  255. package/dist/types/components/dropdown/dropdown.d.ts +9 -1
  256. package/dist/types/components/dropdown/dropdown.stories.d.ts +1 -0
  257. package/dist/types/components/input-list/input-list.d.ts +4 -1
  258. package/dist/types/components/time-picker/time-picker.d.ts +50 -0
  259. package/dist/types/components/time-picker/time-picker.stories.d.ts +10 -0
  260. package/dist/types/components.d.ts +134 -2
  261. package/dist/web-types.json +165 -4
  262. package/package.json +2 -2
  263. package/dist/b2b-core-components/p-04ac661d.entry.js +0 -1
  264. package/dist/b2b-core-components/p-24c6aa56.entry.js +0 -1
  265. package/dist/b2b-core-components/p-260dcc05.entry.js +0 -1
  266. package/dist/b2b-core-components/p-4e0ed246.entry.js +0 -1
  267. package/dist/b2b-core-components/p-b175fb79.entry.js +0 -1
  268. package/dist/b2b-core-components/p-b481eb09.entry.js +0 -1
  269. package/dist/b2b-core-components/p-dff37884.entry.js +0 -1
  270. package/dist/b2b-core-components/p-e8151556.entry.js +0 -1
  271. package/dist/b2b-core-components/p-e90d3aba.entry.js +0 -1
@@ -1,6 +1,7 @@
1
1
  import { h, Host, } from "@stencil/core";
2
2
  export class DropdownComponent {
3
3
  constructor() {
4
+ this.ignoreNextMutation = false;
4
5
  this.onClickOutside = (ev) => {
5
6
  if (!this.hostElement.contains(ev.target))
6
7
  this.isOpen = false;
@@ -17,22 +18,42 @@ export class DropdownComponent {
17
18
  this.focused = false;
18
19
  this.b2bBlur.emit(ev);
19
20
  };
21
+ this.clearSelectedValue = (event) => {
22
+ event.stopPropagation();
23
+ this.clearSelection();
24
+ this.searchValue = '';
25
+ this.b2bChange.emit(this.placeholderValue);
26
+ };
20
27
  this.onSelect = (event) => {
21
28
  var _a;
22
29
  const target = event.target;
23
30
  const value = target.getAttribute('data-value');
24
31
  const label = (_a = target.textContent) === null || _a === void 0 ? void 0 : _a.trim();
25
32
  if (value != null) {
33
+ this.ignoreNextMutation = true;
26
34
  this.selectedValue = value;
27
35
  this.selectedText = label || '';
28
- this.b2bChange.emit(value);
29
36
  this.options = this.options.map(opt => (Object.assign(Object.assign({}, opt), { selected: opt.value === value })));
37
+ const nativeOptions = this.hostElement.querySelectorAll('option');
38
+ nativeOptions.forEach(opt => {
39
+ if (opt.value === value) {
40
+ opt.setAttribute('selected', '');
41
+ opt.selected = true;
42
+ }
43
+ else {
44
+ opt.removeAttribute('selected');
45
+ opt.selected = false;
46
+ }
47
+ });
30
48
  this.isOpen = false;
49
+ this.b2bChange.emit(value);
31
50
  this.updateTruncatedText();
51
+ this.ignoreNextMutation = false;
32
52
  }
33
53
  };
34
54
  this.updateTruncatedText = () => {
35
- const rawText = this.selectedText || this.placeholder;
55
+ const inputValue = this.search ? '' : this.placeholder;
56
+ const rawText = this.selectedText || inputValue;
36
57
  if (this.selectEl == null) {
37
58
  this.truncatedText = rawText;
38
59
  return;
@@ -67,7 +88,35 @@ export class DropdownComponent {
67
88
  }
68
89
  this.truncatedText = truncated + '…';
69
90
  };
91
+ this.handleSearchInput = (event) => {
92
+ if (this.selectedText &&
93
+ event.target.value !== this.selectedText) {
94
+ this.selectedText = '';
95
+ this.selectedValue = this.placeholderValue;
96
+ this.options = this.options.map(opt => (Object.assign(Object.assign({}, opt), { selected: false })));
97
+ }
98
+ this.searchValue = event.target.value;
99
+ this.isOpen = true;
100
+ };
101
+ this.toggleDropdownWithSearch = (event) => {
102
+ event.stopPropagation();
103
+ this.toggleDropdown();
104
+ if (this.isOpen) {
105
+ this.focusSearchInput();
106
+ }
107
+ };
108
+ this.focusSearchInput = () => {
109
+ var _a, _b;
110
+ const inputComponent = (_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('b2b-input');
111
+ if (inputComponent != null) {
112
+ const inputElement = (_b = inputComponent.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
113
+ if (inputElement != null) {
114
+ inputElement.focus();
115
+ }
116
+ }
117
+ };
70
118
  this.label = undefined;
119
+ this.search = false;
71
120
  this.required = false;
72
121
  this.name = undefined;
73
122
  this.placeholder = 'Select an option...';
@@ -82,21 +131,31 @@ export class DropdownComponent {
82
131
  this.selectedValue = '';
83
132
  this.selectedText = '';
84
133
  this.options = [];
134
+ this.searchValue = '';
85
135
  this.truncatedText = '';
86
136
  }
87
137
  /** Method to programmatically clear selection of the dropdown. */
88
138
  async clearSelection() {
139
+ this.ignoreNextMutation = true;
89
140
  this.selectedValue = this.placeholderValue;
90
141
  this.selectedText = '';
91
142
  this.options = this.options.map(opt => (Object.assign(Object.assign({}, opt), { selected: false })));
143
+ const nativeOptions = this.hostElement.querySelectorAll('option');
144
+ nativeOptions.forEach(opt => {
145
+ opt.removeAttribute('selected');
146
+ opt.selected = false;
147
+ });
92
148
  this.isOpen = false;
93
149
  this.updateTruncatedText();
150
+ this.ignoreNextMutation = false;
94
151
  }
95
152
  componentWillLoad() {
96
153
  this.initializeOptions();
97
154
  if (typeof MutationObserver !== 'undefined') {
98
155
  this.mutationObserver = new MutationObserver(() => {
99
- this.initializeOptions();
156
+ if (!this.ignoreNextMutation) {
157
+ this.initializeOptions();
158
+ }
100
159
  });
101
160
  this.mutationObserver.observe(this.hostElement, {
102
161
  childList: true,
@@ -149,15 +208,21 @@ export class DropdownComponent {
149
208
  const hasError = this.invalid && !this.disabled && !this.groupDisabled;
150
209
  const showHint = this.hint && !hasError;
151
210
  const showError = this.error && hasError;
152
- return (h(Host, { key: 'e719de6e666225d6b807810570bd32d4906a2647', class: {
211
+ const filteredOptions = this.options.filter(opt => opt.label.toLowerCase().includes(this.searchValue.toLowerCase()));
212
+ return (h(Host, { key: 'd9762514c854be8f40fd2baaa991b4ae1366cfa3', class: {
153
213
  'b2b-dropdown': true,
154
214
  'b2b-dropdown--error': hasError,
155
215
  'b2b-dropdown--disabled': this.disabled || this.groupDisabled,
156
- } }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: '690c9a335c7171312fb9de9cf6894af979eaa471', class: "b2b-dropdown__wrapper", onFocus: this.onFocus, onBlur: this.onBlur }, h("div", { key: 'fcbbc73636118d451f0ec5aa5ce1cd2baa0dec9b', class: {
216
+ } }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: '2473ccb7d1d9949bbd500adbbad53b1c302593d3', class: "b2b-dropdown__wrapper", onFocus: this.onFocus, onBlur: this.onBlur }, this.search ? (h("b2b-input", { placeholder: this.placeholder, invalid: hasError, value: this.truncatedText || this.searchValue, disabled: this.disabled || this.groupDisabled, "onB2b-focus": () => {
217
+ this.isOpen = true;
218
+ this.focused = true;
219
+ }, "onB2b-input": this.handleSearchInput }, h("div", { slot: "end" }, (this.selectedText || this.searchValue) &&
220
+ !this.disabled &&
221
+ !this.groupDisabled && (h("b2b-icon-100", { class: "b2b-dropdown__clear-icon", icon: 'b2b_icon-close', clickable: true, onClick: this.clearSelectedValue })), h("b2b-icon-100", { class: "b2b-dropdown__arrow-icon", icon: 'b2b_icon-arrow-down', onClick: this.toggleDropdownWithSearch })))) : (h("div", { class: {
157
222
  'b2b-dropdown__select': true,
158
223
  'b2b-dropdown__select--open': this.isOpen,
159
224
  'b2b-dropdown__select--focused': this.focused,
160
- }, ref: el => (this.selectEl = el), onClick: this.toggleDropdown, role: "combobox", "aria-expanded": `${this.isOpen}`, "aria-labelledby": this.name }, this.truncatedText), this.isOpen && (h("div", { class: "b2b-dropdown__options", role: "listbox" }, this.options.map(option => (h("div", { key: option.value, class: {
225
+ }, ref: el => (this.selectEl = el), onClick: this.toggleDropdown, role: "combobox", "aria-expanded": `${this.isOpen}`, "aria-labelledby": this.name }, this.truncatedText, this.selectedText && !this.disabled && !this.groupDisabled && (h("b2b-icon-100", { class: "b2b-dropdown__clear-icon", onClick: this.clearSelectedValue, clickable: true, icon: 'b2b_icon-close' })))), this.isOpen && (h("div", { class: "b2b-dropdown__options", role: "listbox" }, filteredOptions.map(option => (h("div", { key: option.value, class: {
161
226
  'b2b-dropdown__option': true,
162
227
  'b2b-dropdown__option--selected': option.selected,
163
228
  'b2b-dropdown__option--disabled': option.disabled,
@@ -194,6 +259,24 @@ export class DropdownComponent {
194
259
  "attribute": "label",
195
260
  "reflect": false
196
261
  },
262
+ "search": {
263
+ "type": "boolean",
264
+ "mutable": false,
265
+ "complexType": {
266
+ "original": "boolean",
267
+ "resolved": "boolean",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": "Enables the search functionality when set to true within the dropdown. By default search is disabled."
275
+ },
276
+ "attribute": "search",
277
+ "reflect": true,
278
+ "defaultValue": "false"
279
+ },
197
280
  "required": {
198
281
  "type": "boolean",
199
282
  "mutable": false,
@@ -365,6 +448,7 @@ export class DropdownComponent {
365
448
  "selectedValue": {},
366
449
  "selectedText": {},
367
450
  "options": {},
451
+ "searchValue": {},
368
452
  "truncatedText": {}
369
453
  };
370
454
  }
@@ -1,7 +1,7 @@
1
1
  import { userEvent } from "@storybook/test";
2
2
  import { html } from "lit-html";
3
3
  import { getArgTypes } from "../../docs/config/utils";
4
- const Template = ({ label = 'Favorite Fruit', required, name, disabled, invalid, hint, error, selected = false, }) => {
4
+ const Template = ({ label = 'Favorite Fruit', required, name, disabled, invalid, hint, error, search, selected = false, }) => {
5
5
  return html `<b2b-dropdown
6
6
  label="${label}"
7
7
  name="${name}"
@@ -9,7 +9,8 @@ const Template = ({ label = 'Favorite Fruit', required, name, disabled, invalid,
9
9
  hint="${hint}"
10
10
  disabled="${disabled}"
11
11
  invalid="${invalid}"
12
- required="${required}">
12
+ required="${required}"
13
+ search="${search}">
13
14
  <option value="strawberry">Strawberry</option>
14
15
  <option value="orange">Orange</option>
15
16
  <option value="banana">Banana</option>
@@ -33,6 +34,7 @@ const defaultArgs = {
33
34
  invalid: false,
34
35
  hint: 'Pick one',
35
36
  error: 'Not that one!',
37
+ search: false,
36
38
  };
37
39
  export const story010Default = Template.bind({});
38
40
  story010Default.args = Object.assign({}, defaultArgs);
@@ -57,6 +59,9 @@ story050Selected.play = async ({ canvasElement }) => {
57
59
  await userEvent.click(wrapper);
58
60
  }, 500);
59
61
  };
62
+ export const story060Search = Template.bind({});
63
+ story060Search.args = Object.assign(Object.assign({}, defaultArgs), { search: true });
64
+ story060Search.storyName = 'Search';
60
65
  const dropdownArgs = getArgTypes('b2b-dropdown');
61
66
  export default {
62
67
  title: 'Components/Form/Dropdown',
@@ -16,7 +16,7 @@ export class FlyoutMenuOptionComponent {
16
16
  }
17
17
  }
18
18
  render() {
19
- return (h(Host, { key: 'd9f5fada05c44e475d2e645d51c3ba268844a8e3', class: {
19
+ return (h(Host, { key: '4064c5827dffd55637271a59061a2c2abb54d3ca', class: {
20
20
  'b2b-flyout-menu__option': true,
21
21
  'b2b-flyout-menu__option--disabled': this.disabled,
22
22
  'b2b-flyout-menu__option--separator': this.separator,
@@ -144,12 +144,12 @@ export class FlyoutMenuComponent {
144
144
  options[index].focus();
145
145
  }
146
146
  render() {
147
- return (h(Host, { key: '5e1d292b710d19a4bf5ece7047d4c5288b24f9b5' }, h("div", { key: 'd7d781fa8dfdd9f4bdecad06209400610a7f37bf', class: {
147
+ return (h(Host, { key: '03efeb4e28ef04b0719b3ade8e52d20cf3046372' }, h("div", { key: 'e2508205d7402d2ed8ef031c8ab5483a6fbdedbd', class: {
148
148
  'b2b-flyout-menu': true,
149
- } }, h("div", { key: '124c0ee9f83a252aabac1f09a11932ffde4b6bf1', class: "b2b-flyout-menu__trigger" }, h("slot", { key: '588027fd799f42d6b095ad82247cc6974424fc23', name: "trigger" })), h("div", { key: 'baa37193ac12427e868c6742a526516f91e37a02', onFocusout: this.blurMenu, class: {
149
+ } }, h("div", { key: 'c6283f5ebff4ec0962face0e0f440e2cf0ec9ceb', class: "b2b-flyout-menu__trigger" }, h("slot", { key: '303181fa8dac70e463b0efa7fa18a339c84b7009', name: "trigger" })), h("div", { key: 'ff4058c24c1c84c967316569bee8d75d49497eba', onFocusout: this.blurMenu, class: {
150
150
  'b2b-flyout-menu__options__container': true,
151
151
  'b2b-flyout-menu__options__container--on': this.opened,
152
- } }, h("div", { key: '043ff6439dca6d4fccaa29f4bda5c52645154196', class: "b2b-flyout-menu__arrow" }), h("slot", { key: 'e95bcf37c9d1fc77509fbdf2de47001d88d7630a', name: "option" })))));
152
+ } }, h("div", { key: '860224aa691a4c06814731aca94d85a762fc806b', class: "b2b-flyout-menu__arrow" }), h("slot", { key: 'be5a754361d59fdbdf5ac934b0d1f5b50de8e3a1', name: "option" })))));
153
153
  }
154
154
  static get is() { return "b2b-flyout-menu"; }
155
155
  static get encapsulation() { return "shadow"; }
@@ -13,7 +13,7 @@ export class B2bGridColumnComponent {
13
13
  this.textAlign = 'left';
14
14
  }
15
15
  render() {
16
- return (h(Host, { key: 'ca84abbad02173e29f80329a4faab238aa41ec9d', style: Object.assign(Object.assign({}, this.calculateGrowDimension(this.span)), { ['text-align']: `${this.textAlign}` }) }, h("slot", { key: 'e11625544ba0b0fc501ff811e8f5ca1ac89194c9' })));
16
+ return (h(Host, { key: 'e6a06fd72fd364f57b423bdc69cd9c2d4a87d0ca', style: Object.assign(Object.assign({}, this.calculateGrowDimension(this.span)), { ['text-align']: `${this.textAlign}` }) }, h("slot", { key: 'd5785321b8ae17e90fd3aa9e69cc8911430d3e8c' })));
17
17
  }
18
18
  static get is() { return "b2b-grid-col"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -4,7 +4,7 @@ export class B2bGridComponent {
4
4
  this.margin = 24;
5
5
  }
6
6
  render() {
7
- return (h(Host, { key: '01c61abbb9d20b4479031e0545967f08782650dc', style: { ['padding']: `${this.margin}px` }, class: "b2b-grid" }, h("slot", { key: '64a173edfae1ff772091163fecc55bebdc2462b9' })));
7
+ return (h(Host, { key: '0a61abf781f924eb4b88ceb02bece63d2a39f76b', style: { ['padding']: `${this.margin}px` }, class: "b2b-grid" }, h("slot", { key: '02903dbdba9c4973573bac7be02b0e6d3a9cd71a' })));
8
8
  }
9
9
  static get is() { return "b2b-grid"; }
10
10
  static get encapsulation() { return "shadow"; }
@@ -66,7 +66,7 @@ export class B2bGridRowComponent {
66
66
  });
67
67
  }
68
68
  render() {
69
- return (h(Host, { key: '019e65e7db27c37305f49e396389c72fbcf82281', style: {
69
+ return (h(Host, { key: '60ea771fe5da5fc9aa305824f6718d5f1d687374', style: {
70
70
  ['justify-content']: `${this.justify}`,
71
71
  ['gap']: `${this.columnGap}px`,
72
72
  ['margin']: `${this.rowGap}px 0`,
@@ -74,7 +74,7 @@ export class B2bGridRowComponent {
74
74
  ['display']: 'flex',
75
75
  ['flex-wrap']: 'wrap',
76
76
  ['box-sizing']: 'border-box',
77
- } }, h("slot", { key: 'e203c9bde0b21f923b356b6e330ab6e4227fd1a5' })));
77
+ } }, h("slot", { key: 'f38f2b66439b0d8820aa2b25ab88f2c7e02d4ae5' })));
78
78
  }
79
79
  static get is() { return "b2b-grid-row"; }
80
80
  static get encapsulation() { return "shadow"; }
@@ -98,18 +98,18 @@ export class InputComponent {
98
98
  this.filterHintSlotContent();
99
99
  }
100
100
  render() {
101
- return (h(Host, { key: 'b18e9dad8fdc84804b77049fd7b94c6b05541c3f', class: {
101
+ return (h(Host, { key: '69031aea30430dd03e384611a5f351f9e4411583', class: {
102
102
  'b2b-input': true,
103
103
  'b2b-input--error': this.invalid && !this.disabled,
104
- } }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: '655f632484049add498904c26d766670eb3b9203', class: {
104
+ } }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: '5e17439f86886dd04cf3a0bc42f83e75c060e3d9', class: {
105
105
  'b2b-input__wrapper': true,
106
106
  'b2b-input__wrapper--focused': this.hasFocus,
107
107
  'b2b-input__wrapper--disabled': this.disabled || this.groupDisabled,
108
- } }, h("slot", { key: '1d0650fa02aa56cf183a8c3c89e5791a53c54944', name: "start" }), this.hasTextPrefix && h("div", { class: "border" }), h("input", { key: '88e9aa5076bd6dd59eafac8491d6fafc9eec8b5e', class: {
108
+ } }, h("slot", { key: '69d66dec8cdd7bf0de111e32395812bdee4fe006', name: "start" }), this.hasTextPrefix && h("div", { class: "border" }), h("input", { key: 'e2fd5a7753d9543dc0093dba0a611f653a5862df', class: {
109
109
  'b2b-input__native-input': true,
110
110
  ['b2b-input__native-input--align-' + this.inputTextAlign]: true,
111
111
  'b2b-input__native-input--disabled': this.disabled || this.groupDisabled,
112
- }, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.focusOnLoad, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: 'c93445fb93de27a7e1d4681bc7a48d44bb8baa1a', name: "end" })), (this.hint !== undefined || this.hintSlot) &&
112
+ }, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.focusOnLoad, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: '28bc5adffc6b4144e87904a9a059fd609661ac75', name: "end" })), (this.hint !== undefined || this.hintSlot) &&
113
113
  (!this.invalid || this.disabled || this.groupDisabled) ? (h("span", null, h("slot", { name: "hint" }, this.hint))) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : ('')));
114
114
  }
115
115
  static get is() { return "b2b-input"; }
@@ -49,7 +49,7 @@ export class B2BInputGroup {
49
49
  }
50
50
  }
51
51
  render() {
52
- return (h(Host, { key: '30fc190f60b27b6f11fdcc7ed37cc95eee557e5e' }, h("div", { key: '054b44ad5994365e1ea8034a854e2d1b23c6d5e2', class: { 'b2b-input-wrapper': true } }, h("slot", { key: '73b19a2684e84873ada8ec3b2f5c4f465f1fb382', name: "start" }), h("slot", { key: 'f0d15628f49e1d7c83eafaa7a631bd71a673ff97' }), h("slot", { key: '00209dc3c6bf3b3e4418e79dcb6387effc0d8531', name: "end" })), (this.hint || (this.invalid && !this.disabled)) && (h("span", { class: {
52
+ return (h(Host, { key: 'fa99a4e2f8a5923b14d6304378fc574e8fa0f451' }, h("div", { key: 'ac085ec1ba4ae6566e29192fcf41487a5aeaf2dd', class: { 'b2b-input-wrapper': true } }, h("slot", { key: '9412332e469771720376b5d16b101b21867a29ad', name: "start" }), h("slot", { key: 'eb2201d7243365abd486e6a17c99ba84e942415d' }), h("slot", { key: 'c4d8b4c1b837de6bf80049d8b94e402dbb1e663d', name: "end" })), (this.hint || (this.invalid && !this.disabled)) && (h("span", { class: {
53
53
  'b2b-input-wrapper__hint': true,
54
54
  'b2b-input-wrapper__hint--error': this.invalid && !this.disabled,
55
55
  } }, this.invalid && !this.disabled ? this.error : this.hint))));
@@ -5,11 +5,11 @@ export class InputLabelComponent {
5
5
  this.disabled = false;
6
6
  }
7
7
  render() {
8
- return (h(Host, { key: '87fe33e03bfe683d013e8d992bba9e3863834514' }, h("label", { key: 'e88216535eb3d9638fc75a638daffb81bcdf0bb1', class: {
8
+ return (h(Host, { key: '8cdefd0d3cafc0bdf9dba5fa7a15080a4a288379' }, h("label", { key: '04d4659be8363b1b8760c94e5607a3048e02cebf', class: {
9
9
  'b2b-input-label': true,
10
10
  'b2b-input-label--required': this.required,
11
11
  'b2b-input-label--disabled': this.disabled,
12
- } }, h("slot", { key: 'cf1736baaf9fd224071f3e21122c263b9865c318' }))));
12
+ } }, h("slot", { key: 'a858c509020588bb10669c4fa0bc682ba97a5675' }))));
13
13
  }
14
14
  static get is() { return "b2b-input-label"; }
15
15
  static get encapsulation() { return "shadow"; }
@@ -12,7 +12,7 @@ export class InputListOptionComponent {
12
12
  }
13
13
  }
14
14
  render() {
15
- return (h(Host, { key: '566b7cf1696550467c5b8c29cedccf5f8821dc6e', class: "b2b-input-list__option", onClick: this.handleClick, role: "option" }, this.option));
15
+ return (h(Host, { key: 'e9c7180cdbf328d435b5bcac76e4e11a234d4dcc', class: "b2b-input-list__option", onClick: this.handleClick, role: "option" }, this.option));
16
16
  }
17
17
  static get is() { return "b2b-input-list-option"; }
18
18
  static get originalStyleUrls() {
@@ -7,7 +7,7 @@ describe('B2B-InputList', () => {
7
7
  search.setProperty('optionsList', optionsList);
8
8
  await page.waitForChanges();
9
9
  };
10
- const typeInput = async (key = '8') => {
10
+ const typeInput = async (key = 'o') => {
11
11
  let input = await page.find('b2b-input-list >>> b2b-input');
12
12
  // focus on input element, focus method did not work
13
13
  await input.click();
@@ -62,11 +62,11 @@ describe('B2B-InputList', () => {
62
62
  it('should not show search list when the input has no value', async () => {
63
63
  await setOptionsList();
64
64
  const input = await page.find('b2b-input-list');
65
- // focus on input element, focus method did not work
66
65
  await input.click();
67
- await input.press('8');
66
+ await input.press('1');
68
67
  await page.waitForChanges();
69
68
  let searchListResults = await page.find({ text: optionsList[0] });
69
+ expect(searchListResults).not.toBeNull();
70
70
  expect(await searchListResults.isVisible()).toBe(true);
71
71
  await input.click();
72
72
  await input.press('Backspace');
@@ -105,10 +105,10 @@ describe('B2B-InputList', () => {
105
105
  });
106
106
  it('should fill up input value with option selected', async () => {
107
107
  await setOptionsList();
108
- await typeInput('8');
108
+ await typeInput('1');
109
109
  const input = await page.find('b2b-input-list >>> b2b-input');
110
110
  let inputValue = await input.getProperty('value');
111
- expect(inputValue).toBe('8');
111
+ expect(inputValue).toBe('1');
112
112
  // Click first option on the list
113
113
  const option = await page.find({ text: optionsList[0] });
114
114
  await option.click();
@@ -1,4 +1,5 @@
1
1
  import { h, Host, } from "@stencil/core";
2
+ import { parsePropToArray } from "../../utils/json-property-binding-util";
2
3
  const keys = {
3
4
  ARROW_UP: 'ArrowUp',
4
5
  ARROW_DOWN: 'ArrowDown',
@@ -21,6 +22,11 @@ export class InputListComponent {
21
22
  // needed to trigger re-render
22
23
  this.handleInput = event => {
23
24
  this.value = event.detail.value;
25
+ const term = event.target.value.toLowerCase();
26
+ const list = parsePropToArray(this.optionsList);
27
+ this.currentList =
28
+ term === '' ? list : list.filter(o => o.toLowerCase().includes(term));
29
+ this.searchValue = term;
24
30
  if (this.value === '' || null || undefined) {
25
31
  this.setElementOnBlur();
26
32
  }
@@ -81,7 +87,13 @@ export class InputListComponent {
81
87
  this.disabled = false;
82
88
  this.groupDisabled = false;
83
89
  this.hasOptionList = this.optionsList.length > 0;
90
+ this.currentList = [];
84
91
  this.isElementFocused = false;
92
+ this.searchValue = '';
93
+ }
94
+ componentWillLoad() {
95
+ this.currentList = parsePropToArray(this.optionsList);
96
+ this.hasOptionList = this.optionsList.length > 0;
85
97
  }
86
98
  handleKeyDown(event) {
87
99
  /** we need to be informed when a user changes focus to the clear button
@@ -129,6 +141,7 @@ export class InputListComponent {
129
141
  }
130
142
  watchPropHandler(newList) {
131
143
  this.hasOptionList = newList.length > 0;
144
+ this.currentList = [...newList];
132
145
  }
133
146
  /* Notes:
134
147
  Needs onFocusin and onFocusout in the Host element so that the click would
@@ -137,13 +150,13 @@ export class InputListComponent {
137
150
  */
138
151
  render() {
139
152
  const groupOrderClass = this.getGroupOrderClassName() || '';
140
- return (h(Host, { key: 'c22a6a73eca142a88eb7cc3f4c975b579df1d709', onBlur: this.setElementOnBlur, onFocus: this.setElementOnFocus }, h("div", { key: '3fb28f6a327c958fcf9d178c4d1814915a13ad3a', class: {
153
+ return (h(Host, { key: 'a3b50598632e6a0a796a9eb141f26fe12b29e8be', onBlur: this.setElementOnBlur, onFocus: this.setElementOnFocus }, h("div", { key: '9d7e4f051f2593947ce3cbf5602f6a4a602fbdfc', class: {
141
154
  'b2b-input-list': true,
142
155
  'b2b-input-list__options-on': this.hasOptionList &&
143
156
  this.isElementFocused &&
144
157
  Boolean(this.value),
145
158
  [groupOrderClass]: true,
146
- } }, h("b2b-input", { key: '2cd2ba2a073ca4b1980ac5621b60f0ee351e5cca', type: "text", label: this.label, value: this.value, disabled: this.disabled || this.groupDisabled, "onb2b-input": this.handleInput, placeholder: this.placeholder, required: this.required }, !(this.disabled || this.groupDisabled) && Boolean(this.value) && (h("b2b-icon-100", { icon: "b2b_icon-close", "aria-label": "reset", slot: "end", tabIndex: 0, onMouseDown: this.resetInput, onKeyDown: this.resetInput }))), this.isElementFocused && Boolean(this.value) ? (h("div", { class: "b2b-input-list__options-container" }, this.hasOptionList ? (h("div", { class: "b2b-input-list__options", role: "listbox" }, this.optionsList.map(option => (h("b2b-input-list-option", { option: option, tabIndex: -1, "onb2b-option-selected": this.onOptionSelected }))))) : (h("slot", null)))) : null)));
159
+ } }, h("b2b-input", { key: '654211622b3bc8094ce6b20edd2b3c19f2ac28c3', type: "text", label: this.label, value: this.value, disabled: this.disabled || this.groupDisabled, "onb2b-input": this.handleInput, placeholder: this.placeholder, required: this.required }, !(this.disabled || this.groupDisabled) && Boolean(this.value) && (h("b2b-icon-100", { icon: "b2b_icon-close", "aria-label": "reset", slot: "end", tabIndex: 0, onMouseDown: this.resetInput, onKeyDown: this.resetInput }))), this.isElementFocused && Boolean(this.value) ? (h("div", { class: "b2b-input-list__options-container" }, this.hasOptionList ? (h("div", { class: "b2b-input-list__options", role: "listbox" }, this.currentList.map(option => (h("b2b-input-list-option", { option: option, tabIndex: -1, "onb2b-option-selected": this.onOptionSelected }))))) : (h("slot", null)))) : null)));
147
160
  }
148
161
  static get is() { return "b2b-input-list"; }
149
162
  static get encapsulation() { return "shadow"; }
@@ -212,11 +225,11 @@ export class InputListComponent {
212
225
  "reflect": true
213
226
  },
214
227
  "optionsList": {
215
- "type": "unknown",
228
+ "type": "string",
216
229
  "mutable": false,
217
230
  "complexType": {
218
- "original": "string[]",
219
- "resolved": "string[]",
231
+ "original": "string | string[]",
232
+ "resolved": "string | string[]",
220
233
  "references": {}
221
234
  },
222
235
  "required": false,
@@ -225,6 +238,8 @@ export class InputListComponent {
225
238
  "tags": [],
226
239
  "text": "The list of options passed into the search dropdown. Can be static or dynamic, i.e. updated when the b2b-search or b2b-input emitters fire."
227
240
  },
241
+ "attribute": "options-list",
242
+ "reflect": false,
228
243
  "defaultValue": "[]"
229
244
  },
230
245
  "value": {
@@ -289,7 +304,9 @@ export class InputListComponent {
289
304
  static get states() {
290
305
  return {
291
306
  "hasOptionList": {},
292
- "isElementFocused": {}
307
+ "currentList": {},
308
+ "isElementFocused": {},
309
+ "searchValue": {}
293
310
  };
294
311
  }
295
312
  static get events() {
@@ -4,10 +4,10 @@ export class LabelComponent {
4
4
  this.type = 'neutral';
5
5
  }
6
6
  render() {
7
- return (h("span", { key: '8b3e3c895c71501e761b6a80843403df68190cca', class: {
7
+ return (h("span", { key: '86d64389cf254eb3fb56e58c9399087e4d053f5f', class: {
8
8
  'b2b-label': true,
9
9
  [`b2b-label--${this.type}`]: true,
10
- } }, h("slot", { key: '737f1fff0fd98d426cc910a6af713786aa7bd1cc' })));
10
+ } }, h("slot", { key: 'd85ee68f76a02a02c4c10e2ef634fdc4c412229a' })));
11
11
  }
12
12
  static get is() { return "b2b-label"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -82,10 +82,10 @@ export class ModalComponent {
82
82
  this.attemptFocus(this.getFirstFocusableElement());
83
83
  }
84
84
  render() {
85
- return (h(Host, { key: '1ae4da3d85c98d784c5aa3254eec819791538b75' }, h("div", { key: 'a504235885dd6d98d6f909d9cf3d67adf0f1f6c0', class: { 'b2b-modal': true, 'b2b-modal--open': this.opened } }, h("div", { key: 'fffccabe0df78b009dc23f7dac95f5bbf7ce07e4', "data-focus-trap-edge": true, onFocus: this.handleTopFocus, tabIndex: 0 }), h("div", { key: 'd4c09be02aa93046ad8835da3affb70c0d7685dc', class: {
85
+ return (h(Host, { key: 'bea74834a3926bc7efd9100f065eb4a8603e8bd4' }, h("div", { key: '5d5cca368682bcd7de4f77fe05e702b87943f762', class: { 'b2b-modal': true, 'b2b-modal--open': this.opened } }, h("div", { key: 'ba06899cee12d6ef3d3e71a96040daccfdf3b364', "data-focus-trap-edge": true, onFocus: this.handleTopFocus, tabIndex: 0 }), h("div", { key: '0be5c5dcc62576e1662ed7f6185b0ff24afaadc4', class: {
86
86
  'b2b-modal__dialog': true,
87
87
  [`b2b-modal__dialog--${this.variant}`]: true,
88
- } }, h("div", { key: '85add6446151ec3df71ba825bab64d100306bc10', class: "b2b-modal__dialog__header" }, h("div", { key: '3fc56d466fe2eb9e6ca594ff867c48fe05ffda09', class: "b2b-modal__dialog__header-left" }, h("b2b-headline", { key: 'cf348827107b36494427ddaac019a539c379364a', align: "center", size: "200", noMargin: true }, this.heading), h("slot", { key: '8df87ec03dcdb11bbf96c1c49c9ea9d81a84a558', name: "header-icon" })), h("div", { key: '80f6e9e7d7ad6e71c15525a7a12eb885c48c6c2a', class: "b2b-modal__dialog__header-right" }, h("button", { key: '7e2373011323d5abc38803862f30aa0b3ae394e6', type: "button", class: "b2b-modal__dialog__close", onMouseEnter: this.toggleIconHover, onMouseLeave: this.toggleIconHover, onClick: this.handleClickDismiss, ref: el => (this.closeButton = el) }, h("b2b-icon-100", { key: 'a4955d65f73cf81cd919e5dbcf63db3251cf7449', clickable: true, icon: "b2b_icon-close", color: this.iconHover ? 'primary' : 'secondary' })))), h("div", { key: '3147b6a75f66f90d45f1a404f9dfb140634a6a35', class: "b2b-modal__dialog__body" }, h("slot", { key: '7ad81c8b9e610720c3ed918d255017a32d4128d4' })), h("div", { key: '7e7b6105f3bc4b1ad06eb7b7c7f43c91eb310c51', class: "b2b-modal__dialog__footer" }, h("div", { key: 'd3abac0aade1244074f2bb038e736e981d67f5ae', class: "b2b-modal__dialog__footer-left" }, h("slot", { key: '61599dfd481e53897522fabc44915546ac3d0f59', name: "footer-left" })), h("div", { key: '07c6cfca3f4e1545644292e4c04c9f02149d37b8', class: "b2b-modal__dialog__footer-right" }, h("slot", { key: '7b161e0e61c4e36c0ae1a2930b95e39991d72879', name: "footer-right" })))), h("div", { key: 'd5ac30a02abfd2b89dce1d913971a417198cd155', "data-focus-trap-edge": true, onFocus: this.handleBottomFocus, tabIndex: 0 }), h("div", { key: '570e98eefabd147193cb04d9d493e46a08411e3f', class: "b2b-modal__backdrop", onClick: this.handleBackdropDismiss }))));
88
+ } }, h("div", { key: '11b056ce706f572663e3a64cd5115ccc45109190', class: "b2b-modal__dialog__header" }, h("div", { key: '073420de4937e8f18a2172a45eb7088caef4624e', class: "b2b-modal__dialog__header-left" }, h("b2b-headline", { key: '3fdaeaccfd4606560ae82c8cbc8ad8eb65a9dfa8', align: "center", size: "200", noMargin: true }, this.heading), h("slot", { key: 'f280675fcff7e81d1dc6388820f04110de703f8f', name: "header-icon" })), h("div", { key: '6a821204fdce083dfa0267714e1bc438b3dfcd56', class: "b2b-modal__dialog__header-right" }, h("button", { key: 'aa97e6cf511417d3a283017419577e6da8f65fff', type: "button", class: "b2b-modal__dialog__close", onMouseEnter: this.toggleIconHover, onMouseLeave: this.toggleIconHover, onClick: this.handleClickDismiss, ref: el => (this.closeButton = el) }, h("b2b-icon-100", { key: 'c4ff1783dc4d7c7d7b85bc739d0b5154fc60eacb', clickable: true, icon: "b2b_icon-close", color: this.iconHover ? 'primary' : 'secondary' })))), h("div", { key: 'ebf5d6a280718bf7f4c98e41846dea91dbde6943', class: "b2b-modal__dialog__body" }, h("slot", { key: 'b9b1b56a4b45760e88f6cb7e54281cd468137ccc' })), h("div", { key: 'ff0f612d9581c5f5bd48bd99699b1fc1348a577a', class: "b2b-modal__dialog__footer" }, h("div", { key: 'bf034c403f883695a72bd5ee0ec7a6b5c40f6ef1', class: "b2b-modal__dialog__footer-left" }, h("slot", { key: '52a6a99d0a722bf37c8659290ceaec53d5acc546', name: "footer-left" })), h("div", { key: '5d5a6786dfe6708cb17ca37e92c0f5c4366b6e0c', class: "b2b-modal__dialog__footer-right" }, h("slot", { key: '37f62cb0bf38031673f53f7ef2578e2c5c5219f9', name: "footer-right" })))), h("div", { key: 'b0eb907e93024c42e2b3668316f51b1e6b7d5aa3', "data-focus-trap-edge": true, onFocus: this.handleBottomFocus, tabIndex: 0 }), h("div", { key: '6d6762fb11007e46c3d3872ab208e40aa0e28d4a', class: "b2b-modal__backdrop", onClick: this.handleBackdropDismiss }))));
89
89
  }
90
90
  static get is() { return "b2b-modal"; }
91
91
  static get encapsulation() { return "shadow"; }
@@ -207,16 +207,16 @@ export class B2bMultiSelectDropdown {
207
207
  const hasError = this.invalid && !disabled;
208
208
  const showHint = this.hint && !hasError;
209
209
  const showError = this.errorMessage && hasError;
210
- return (h(Host, { key: 'ce7c585a53dfb0dc39216bca8de421f5c6f6bb63', onFocus: this.setElementOnFocus, onBlur: this.setElementOnBlur, onClick: this.handleMouseDown, onKeyDown: this.handleKeyDown }, h("b2b-input-label", { key: '5f70368b3502a9e3f313f701e254d0efefae6fd8', required: this.required }, this.label), h("div", { key: '3bc73b137d9b53d54b8a692965b83c299a09faa1', class: {
210
+ return (h(Host, { key: '67df2c8968bd816fdd57b9e1c0b3dcd37f9bc401', onFocus: this.setElementOnFocus, onBlur: this.setElementOnBlur, onClick: this.handleMouseDown, onKeyDown: this.handleKeyDown }, h("b2b-input-label", { key: '32d25f1327ffab15969ca4dcb4faa953bf9923c3', required: this.required }, this.label), h("div", { key: 'b4d0182e211f6aab9c3061eeffccdd1ceddbf03a', class: {
211
211
  'b2b-multiselect-dropdown': true,
212
212
  'b2b-multiselect-dropdown--open': this.isOpen,
213
213
  'b2b-multiselect-dropdown--error': hasError,
214
214
  'b2b-multiselect-dropdown--disabled': disabled,
215
215
  'b2b-multiselect-dropdown--focused': this.invalid && this.isElementFocused,
216
- }, tabindex: 0, role: "combobox", onClick: () => (this.isOpen = !this.isOpen && !disabled), "aria-expanded": this.isElementFocused }, h("div", { key: 'b4e95e6072ebe7a49f1ff092521758bef17c9443', class: "b2b-multiselect-dropdown__chip-container" }, this.currentSelectedValues.length === 0 ? (h("span", { class: "b2b-multiselect-dropdown__placeholder" }, this.placeholder)) : (this.renderChips())), h("b2b-icon-100", { key: 'a79e61c1e78be92e394772e4fe45ccaa840bb23c', icon: "b2b_icon-arrow-down" })), h("div", { key: 'f8b8c5d70b18c1ffc175b966e1568ec719fd5aa6', class: {
216
+ }, tabindex: 0, role: "combobox", onClick: () => (this.isOpen = !this.isOpen && !disabled), "aria-expanded": this.isElementFocused }, h("div", { key: 'b6a69e9160fa5869d06cc2fc1f6f2d56c8964114', class: "b2b-multiselect-dropdown__chip-container" }, this.currentSelectedValues.length === 0 ? (h("span", { class: "b2b-multiselect-dropdown__placeholder" }, this.placeholder)) : (this.renderChips())), h("b2b-icon-100", { key: '99a6b2e5baba4598a46f328e808b06e6e4b9d725', icon: "b2b_icon-arrow-down" })), h("div", { key: '0de344aa373d4ca82bf716df966448e95b5717f8', class: {
217
217
  'b2b-multiselect-dropdown__options-container': true,
218
218
  'b2b-multiselect-dropdown__options-container--visible': this.isOpen,
219
- } }, h("div", { key: '94b799c83a30906027023ee78c9202afc152cb98', class: "b2b-multiselect-dropdown__options", role: "listbox", "aria-label": this.label, tabIndex: -1 }, h("div", { key: 'c844dc9be611cf2533549cf03bdc1fb5cf7e5755', class: "b2b-multiselect-dropdown__option__search" }, h("input", { key: 'ec3380739b47ae8ee490ed4bf9369a81045f2d3b', type: "text", onInput: this.handleInput, class: "b2b-multiselect-dropdown__option__search__input", placeholder: this.searchPlaceholder })), h("b2b-multiselect-option", { key: 'bf17215713121f4f359872c8c1f6ed4f1ec32e45', class: "b2b-multiselect-dropdown__option__select-all", option: this.selectAllLabel, id: "select-all", "onB2b-option-selected": this.handleSelectAll }), this.hasOptionList &&
219
+ } }, h("div", { key: '53e6ef0829f30ab13e0441eb54118b19835ce353', class: "b2b-multiselect-dropdown__options", role: "listbox", "aria-label": this.label, tabIndex: -1 }, h("div", { key: 'eb30f1caec191fb6021c172fae01ccf30e7d4f68', class: "b2b-multiselect-dropdown__option__search" }, h("input", { key: '7b29fd3710eb4fecc9dc8d3c29dfae60ec3ea375', type: "text", onInput: this.handleInput, class: "b2b-multiselect-dropdown__option__search__input", placeholder: this.searchPlaceholder })), h("b2b-multiselect-option", { key: '9efd9cac0ef3c2c9d61d32292bbf5ade76991996', class: "b2b-multiselect-dropdown__option__select-all", option: this.selectAllLabel, id: "select-all", "onB2b-option-selected": this.handleSelectAll }), this.hasOptionList &&
220
220
  this.currentList.map(option => (h("b2b-multiselect-option", { "onB2b-option-selected": this.handleSelectedChange, option: option.value, label: option.label }))))), showHint && (h("span", { class: "b2b-multiselect-dropdown__hint" }, this.hint)), showError && (h("span", { class: "b2b-multiselect-dropdown__error-message" }, this.errorMessage))));
221
221
  }
222
222
  static get is() { return "b2b-multiselect-dropdown"; }
@@ -15,9 +15,9 @@ export class B2bMultiSelectOption {
15
15
  }
16
16
  render() {
17
17
  var _a;
18
- return (h(Host, { key: '0147313a2d52d7cdf334f118f8a5eae6fb2a73df', role: "option", class: {
18
+ return (h(Host, { key: 'f1a1faa0a97e00af9fbfa291aba3c53ea92ad44c', role: "option", class: {
19
19
  'b2b-multiselect-dropdown__option': true,
20
- } }, h("b2b-checkbox", { key: 'bf1504c0924dbda95990369b31c010804b2ceac7', checked: this.selected, "onB2b-change": this.handleCheckboxChange, label: (_a = this.label) !== null && _a !== void 0 ? _a : this.option, indeterminate: this.indeterminate, value: this.option })));
20
+ } }, h("b2b-checkbox", { key: '251ccb65111ecb72b57c19786df65a11a1432ab7', checked: this.selected, "onB2b-change": this.handleCheckboxChange, label: (_a = this.label) !== null && _a !== void 0 ? _a : this.option, indeterminate: this.indeterminate, value: this.option })));
21
21
  }
22
22
  static get is() { return "b2b-multiselect-option"; }
23
23
  static get originalStyleUrls() {
@@ -91,7 +91,7 @@ export class PaginationComponent {
91
91
  };
92
92
  }
93
93
  render() {
94
- return (h("nav", { key: '6f43e77c9989aafe2f5ff9d7de619853f807ceb9' }, h("ol", { key: 'ebc029acf51035b9859ed5793a29fc689c536484', class: "b2b-pagination" }, this.activePage !== 1 && (h("li", { class: "b2b-pagination--previous" }, h("b2b-button", { onClick: this.selectPreviousPage, size: "50", variant: "secondary", "aria-label": this.ariaLabelPreviousPage }, "\u2039" /* PaginationConstants.BACK */))), this.navItems.map((navItem, index) => {
94
+ return (h("nav", { key: '88eb108790c1be9f974f7c88f602afa2ee35f1e9' }, h("ol", { key: '19a0fff8f2ac83913593530d921e8915e496400b', class: "b2b-pagination" }, this.activePage !== 1 && (h("li", { class: "b2b-pagination--previous" }, h("b2b-button", { onClick: this.selectPreviousPage, size: "50", variant: "secondary", "aria-label": this.ariaLabelPreviousPage }, "\u2039" /* PaginationConstants.BACK */))), this.navItems.map((navItem, index) => {
95
95
  const isItemActive = this.activePage === navItem;
96
96
  return (h("li", { class: this.getItemClass(navItem) }, h("b2b-button", { onClick: () => this.setSelectedPage(navItem, index), active: isItemActive, disabled: isItemActive, size: "50", variant: "secondary" }, navItem)));
97
97
  }), this.activePage !== this.totalPages && (h("li", { class: "b2b-pagination--next" }, h("b2b-button", { onClick: this.selectNextPage, size: "50", variant: "secondary", "aria-label": this.ariaLabelNextPage }, "\u203A" /* PaginationConstants.NEXT */))))));
@@ -17,11 +17,11 @@ export class ProgressBarComponent {
17
17
  }
18
18
  render() {
19
19
  const labelExists = this.label !== undefined && this.label !== '';
20
- return (h(Host, { key: '4511acab06e497842a84eed7cfa9beb7d575dbe7' }, h("div", { key: '03b04648866fed3e0c276ca8218201639b23f6fc', class: {
20
+ return (h(Host, { key: 'b0060404440e78b3a2331df11a2d56d4071c7e19' }, h("div", { key: '031bd2160763920981cd6491bc1099636f3c21fd', class: {
21
21
  [`b2b-progress-bar__${this.labelPosition}-${this.labelType}`]: true,
22
- } }, h("div", { key: '8ddd2295fd43f56b8393178e38ea414e96f332ed', class: "b2b-progress-bar__wrapper" }, h("div", { key: 'e6ea32124f8df1b937dd8f62e1e06d306229cd75', class: "b2b-progress-bar__progress", style: {
22
+ } }, h("div", { key: '945e5c7bf601cd8d34b0cd095245a8cc6b801cea', class: "b2b-progress-bar__wrapper" }, h("div", { key: '93086dd441221a8ff681d9de2da8ff2f2d4ae0b5', class: "b2b-progress-bar__progress", style: {
23
23
  width: `${this.getProgress()}%`,
24
- } })), h("div", { key: '36a7f3c4c5229350ea3a37827fa0613db0ab33b7', class: {
24
+ } })), h("div", { key: '82ce3cabe0897878d2715ca96a07ba8347f42590', class: {
25
25
  'b2b-progress-bar__label': labelExists,
26
26
  'b2b-progress-bar__label-none': !labelExists,
27
27
  [`b2b-progress-bar__label__${this.labelPosition}-${this.labelType}`]: labelExists,
@@ -53,11 +53,11 @@ export class B2bRadioButtonComponent {
53
53
  return Array.from(document.querySelectorAll(`b2b-radio-button[name="${this.name}"]`)).filter((radio) => radio.value !== this.value);
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: '5fbc72c2f038679ea04d1c99a6f687e4829d7d51', onClick: this.onClick }, h("div", { key: '895c751c5086b2f7d466635020a39a96d1c9f220', class: {
56
+ return (h(Host, { key: 'fd1084fd2df24d7de2727441f69c03f9aa497f22', onClick: this.onClick }, h("div", { key: 'a4d0e872905049f686a1d70a883aba37bc7b3823', class: {
57
57
  'b2b-radio': true,
58
58
  'b2b-radio--error': this.invalid && !this.disabled,
59
59
  'b2b-radio--disabled': this.disabled,
60
- } }, h("div", { key: '0f6b79277a4ad8520b77054c79bf835e6e2a0a7c', class: "b2b-radio-items" }, h("input", { key: 'bd9d51857f574d9c37d482ae6b23bd25027369a5', class: "b2b-radio-input", "aria-labelledby": this.name, type: "radio", checked: this.checked, disabled: this.disabled, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, value: this.value }), h("b2b-input-label", { key: '8ab71684ff2f26fdbe119c852109ce3b44ed1c4f', id: this.name, required: this.required, disabled: this.disabled }, h("slot", { key: '474cc5a22301f4be53130579845152da0caa849b', name: "label" }, this.label))), (this.hint !== undefined && !this.invalid) ||
60
+ } }, h("div", { key: 'e334d57a546380ae10aad7bd6c8c1688650d5107', class: "b2b-radio-items" }, h("input", { key: '20b59620275ef3c93ecec45c4c84fd8098ce47dc', class: "b2b-radio-input", "aria-labelledby": this.name, type: "radio", checked: this.checked, disabled: this.disabled, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, value: this.value }), h("b2b-input-label", { key: '71e1468f0d8046d9c80cb0bb159081a772e2b871', id: this.name, required: this.required, disabled: this.disabled }, h("slot", { key: '00b2e6022ff3cc78ef450d7a7611f08e6a5d0adb', name: "label" }, this.label))), (this.hint !== undefined && !this.invalid) ||
61
61
  (this.hint !== undefined && this.disabled) ? (h("span", null, this.hint)) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : (''))));
62
62
  }
63
63
  static get is() { return "b2b-radio-button"; }