@adyen/bento-vue3 1.24.0 → 1.26.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 (280) hide show
  1. package/dist/@types/packages/vue2/src/components/alert/alert.types.d.ts +3 -0
  2. package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +46 -54
  3. package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +86 -179
  4. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
  5. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  6. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.keys.d.ts +1 -0
  7. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.types.d.ts +8 -1
  8. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.vue.d.ts +7 -4
  9. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +10 -2
  10. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +6 -2
  11. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.types.d.ts +3 -0
  12. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +8 -6
  13. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +26 -11
  14. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.types.d.ts +1 -0
  15. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-hovering/use-column-hovering.d.ts +18 -6
  16. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +36 -12
  17. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +18 -6
  18. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-resizer.d.ts +18 -6
  19. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +19 -53
  20. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +2 -2
  21. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
  22. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +1 -1
  23. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +1 -1
  24. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/use-dropdown-options-listbox.d.ts +13 -7
  25. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +14 -14
  26. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
  27. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +2 -2
  28. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.types.d.ts +3 -24
  29. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +4 -4
  30. package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +1 -1
  31. package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/index.d.ts +1 -0
  32. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/index.d.ts +2 -0
  33. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/select-filter-button/select-filter-button.vue.d.ts +148 -0
  34. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/select-filter-dropdown/select-filter-dropdown.vue.d.ts +150 -0
  35. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +28 -27
  36. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +11 -7
  37. package/dist/@types/packages/vue2/src/components/internal/checkbox-input/checkbox-input.vue.d.ts +1 -1
  38. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  39. package/dist/@types/packages/vue2/src/components/internal/dialog-page/dialog-page.types.d.ts +1 -0
  40. package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +1 -1
  41. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/listbox-multi-select-chips.vue.d.ts +3 -3
  42. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +1 -2
  43. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +45 -9
  44. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -9
  45. package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-cached-selected-values/use-cached-selected-values.d.ts +2 -2
  46. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +15 -15
  47. package/dist/@types/packages/vue2/src/components/internal/radio-input/radio-input.vue.d.ts +1 -1
  48. package/dist/@types/packages/vue2/src/components/menu/components/menu-item-list/menu-item-list.vue.d.ts +3 -2
  49. package/dist/@types/packages/vue2/src/components/menu/components/menu-list-container/menu-list-container.vue.d.ts +8 -1
  50. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +3 -1
  51. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +2 -2
  52. package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +3 -3
  53. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +2 -2
  54. package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +1 -1
  55. package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +20 -0
  56. package/dist/@types/packages/vue2/src/components/tutorial/tutorial.types.d.ts +1 -0
  57. package/dist/@types/packages/vue2/src/components/tutorial/tutorial.vue.d.ts +22 -2
  58. package/dist/@types/packages/vue2/src/components/typography/index.d.ts +1 -1
  59. package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +1 -1
  60. package/dist/@types/packages/vue2/src/composables/use-click-outside/index.d.ts +1 -0
  61. package/dist/@types/packages/vue2/src/index.d.ts +1 -0
  62. package/dist/accordion.js +3 -3
  63. package/dist/action-bar.js +7 -7
  64. package/dist/alert.js +126 -166
  65. package/dist/alert.js.map +1 -1
  66. package/dist/assets/base-modal.css +1 -1
  67. package/dist/assets/dialog-page.css +1 -1
  68. package/dist/assets/dropdown.css +1 -1
  69. package/dist/assets/index.css +1 -1
  70. package/dist/assets/index10.css +1 -1
  71. package/dist/assets/index11.css +1 -1
  72. package/dist/assets/index12.css +1 -1
  73. package/dist/assets/index13.css +1 -1
  74. package/dist/assets/index14.css +1 -1
  75. package/dist/assets/index15.css +1 -1
  76. package/dist/assets/index16.css +1 -1
  77. package/dist/assets/index17.css +1 -1
  78. package/dist/assets/index18.css +1 -1
  79. package/dist/assets/index19.css +1 -1
  80. package/dist/assets/index2.css +1 -1
  81. package/dist/assets/index20.css +1 -1
  82. package/dist/assets/index21.css +1 -1
  83. package/dist/assets/index22.css +1 -1
  84. package/dist/assets/index23.css +1 -1
  85. package/dist/assets/index24.css +1 -1
  86. package/dist/assets/index25.css +1 -1
  87. package/dist/assets/index26.css +1 -1
  88. package/dist/assets/index27.css +1 -1
  89. package/dist/assets/index28.css +1 -1
  90. package/dist/assets/index29.css +1 -1
  91. package/dist/assets/index3.css +1 -1
  92. package/dist/assets/index30.css +1 -1
  93. package/dist/assets/index31.css +1 -1
  94. package/dist/assets/index32.css +1 -1
  95. package/dist/assets/index33.css +1 -1
  96. package/dist/assets/index34.css +1 -1
  97. package/dist/assets/index35.css +1 -1
  98. package/dist/assets/index36.css +1 -1
  99. package/dist/assets/index37.css +1 -1
  100. package/dist/assets/index38.css +1 -1
  101. package/dist/assets/index39.css +1 -1
  102. package/dist/assets/index4.css +1 -1
  103. package/dist/assets/index40.css +1 -1
  104. package/dist/assets/index41.css +1 -1
  105. package/dist/assets/index42.css +1 -1
  106. package/dist/assets/index43.css +1 -1
  107. package/dist/assets/index44.css +1 -1
  108. package/dist/assets/index45.css +1 -1
  109. package/dist/assets/index46.css +1 -1
  110. package/dist/assets/index47.css +1 -1
  111. package/dist/assets/index48.css +1 -1
  112. package/dist/assets/index5.css +1 -1
  113. package/dist/assets/index6.css +1 -1
  114. package/dist/assets/index7.css +1 -1
  115. package/dist/assets/index8.css +1 -1
  116. package/dist/assets/index9.css +1 -1
  117. package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
  118. package/dist/avatar-image.js +1 -1
  119. package/dist/badge.js +1 -1
  120. package/dist/button.js +5 -5
  121. package/dist/card.js +168 -267
  122. package/dist/card.js.map +1 -1
  123. package/dist/checkbox.js +6 -6
  124. package/dist/chunks/{base-button.ab9c947e.js → base-button.e84acf30.js} +2 -2
  125. package/dist/chunks/{base-button.ab9c947e.js.map → base-button.e84acf30.js.map} +1 -1
  126. package/dist/chunks/{base-modal.28b5ff83.js → base-modal.29e062d0.js} +7 -7
  127. package/dist/chunks/{base-modal.28b5ff83.js.map → base-modal.29e062d0.js.map} +1 -1
  128. package/dist/chunks/{button-actions-with-menu.305991e5.js → button-actions-with-menu.7fce47a2.js} +4 -4
  129. package/dist/chunks/{button-actions-with-menu.305991e5.js.map → button-actions-with-menu.7fce47a2.js.map} +1 -1
  130. package/dist/chunks/{button-actions.ea025810.js → button-actions.642b37de.js} +3 -3
  131. package/dist/chunks/{button-actions.ea025810.js.map → button-actions.642b37de.js.map} +1 -1
  132. package/dist/chunks/{button.ce5d1f5e.js → button.60dad578.js} +3 -3
  133. package/dist/chunks/{button.ce5d1f5e.js.map → button.60dad578.js.map} +1 -1
  134. package/dist/chunks/{calendar.24a492f1.js → calendar.f38cdab9.js} +5 -5
  135. package/dist/chunks/{calendar.24a492f1.js.map → calendar.f38cdab9.js.map} +1 -1
  136. package/dist/chunks/{checkbox-input.99336948.js → checkbox-input.ab758a81.js} +2 -2
  137. package/dist/chunks/{checkbox-input.99336948.js.map → checkbox-input.ab758a81.js.map} +1 -1
  138. package/dist/chunks/{checkbox.d0f897e0.js → checkbox.f55ee3a5.js} +4 -4
  139. package/dist/chunks/{checkbox.d0f897e0.js.map → checkbox.f55ee3a5.js.map} +1 -1
  140. package/dist/chunks/{checkmark-circle-fill.c45a999d.js → checkmark-circle-fill.f3a69c6a.js} +2 -2
  141. package/dist/chunks/{checkmark-circle-fill.c45a999d.js.map → checkmark-circle-fill.f3a69c6a.js.map} +1 -1
  142. package/dist/chunks/{checkmark-small.c79220d9.js → checkmark-small.d7e31e5e.js} +2 -2
  143. package/dist/chunks/{checkmark-small.c79220d9.js.map → checkmark-small.d7e31e5e.js.map} +1 -1
  144. package/dist/chunks/{checkmark.eb3c7a06.js → checkmark.87919b24.js} +2 -2
  145. package/dist/chunks/{checkmark.eb3c7a06.js.map → checkmark.87919b24.js.map} +1 -1
  146. package/dist/chunks/{chevron-left.4ee92950.js → chevron-left.963d35e9.js} +2 -2
  147. package/dist/chunks/{chevron-left.4ee92950.js.map → chevron-left.963d35e9.js.map} +1 -1
  148. package/dist/chunks/{chevron-up.638a9f34.js → chevron-up.05ca20db.js} +2 -2
  149. package/dist/chunks/{chevron-up.638a9f34.js.map → chevron-up.05ca20db.js.map} +1 -1
  150. package/dist/chunks/{controls-group.2b31233c.js → controls-group.9e0f17b2.js} +3 -3
  151. package/dist/chunks/{controls-group.2b31233c.js.map → controls-group.9e0f17b2.js.map} +1 -1
  152. package/dist/chunks/{copy.9003ed59.js → copy.852d4cb8.js} +4 -4
  153. package/dist/chunks/{copy.9003ed59.js.map → copy.852d4cb8.js.map} +1 -1
  154. package/dist/chunks/{cross-circle-fill.1abec1a2.js → cross-circle-fill.81925c7f.js} +2 -2
  155. package/dist/chunks/{cross-circle-fill.1abec1a2.js.map → cross-circle-fill.81925c7f.js.map} +1 -1
  156. package/dist/chunks/{cross-small.b85406fe.js → cross-small.9bc6a02f.js} +2 -2
  157. package/dist/chunks/{cross-small.b85406fe.js.map → cross-small.9bc6a02f.js.map} +1 -1
  158. package/dist/chunks/{cross.26509efc.js → cross.a60533f6.js} +2 -2
  159. package/dist/chunks/{cross.26509efc.js.map → cross.a60533f6.js.map} +1 -1
  160. package/dist/chunks/dialog-page.ea67bb14.js +173 -0
  161. package/dist/chunks/dialog-page.ea67bb14.js.map +1 -0
  162. package/dist/chunks/{dropdown-default-textbox.311443a8.js → dropdown-default-textbox.ad5063c2.js} +4 -4
  163. package/dist/chunks/{dropdown-default-textbox.311443a8.js.map → dropdown-default-textbox.ad5063c2.js.map} +1 -1
  164. package/dist/chunks/{dropdown.170b43c4.js → dropdown.d8587f36.js} +295 -317
  165. package/dist/chunks/dropdown.d8587f36.js.map +1 -0
  166. package/dist/chunks/{error-message.4678cbdc.js → error-message.3fb5573a.js} +3 -3
  167. package/dist/chunks/{error-message.4678cbdc.js.map → error-message.3fb5573a.js.map} +1 -1
  168. package/dist/chunks/{fixed-scroller.f09618f2.js → fixed-scroller.59aefd1b.js} +3 -3
  169. package/dist/chunks/{fixed-scroller.f09618f2.js.map → fixed-scroller.59aefd1b.js.map} +1 -1
  170. package/dist/chunks/{footer-actions.2efe610e.js → footer-actions.89e68269.js} +4 -4
  171. package/dist/chunks/{footer-actions.2efe610e.js.map → footer-actions.89e68269.js.map} +1 -1
  172. package/dist/chunks/{index.1b1646bf.js → index.030c1dd7.js} +212 -191
  173. package/dist/chunks/index.030c1dd7.js.map +1 -0
  174. package/dist/chunks/{index.70c91b3b.js → index.07122048.js} +2 -2
  175. package/dist/chunks/{index.70c91b3b.js.map → index.07122048.js.map} +1 -1
  176. package/dist/chunks/{index.c41d1bbb.js → index.146f967e.js} +2 -2
  177. package/dist/chunks/{index.c41d1bbb.js.map → index.146f967e.js.map} +1 -1
  178. package/dist/chunks/{index.920cc1ee.js → index.5bdebf9d.js} +7 -7
  179. package/dist/chunks/{index.920cc1ee.js.map → index.5bdebf9d.js.map} +1 -1
  180. package/dist/chunks/{index.b772214b.js → index.6e0e9d21.js} +3 -3
  181. package/dist/chunks/{index.b772214b.js.map → index.6e0e9d21.js.map} +1 -1
  182. package/dist/chunks/{index.44f2aca7.js → index.8be283d5.js} +2 -2
  183. package/dist/chunks/{index.44f2aca7.js.map → index.8be283d5.js.map} +1 -1
  184. package/dist/chunks/{index.0d513625.js → index.96cd0d4c.js} +9 -9
  185. package/dist/chunks/{index.0d513625.js.map → index.96cd0d4c.js.map} +1 -1
  186. package/dist/chunks/{index.b3cb905c.js → index.9bf04b01.js} +3 -3
  187. package/dist/chunks/{index.b3cb905c.js.map → index.9bf04b01.js.map} +1 -1
  188. package/dist/chunks/{index.51fe0fc2.js → index.a3d60e4f.js} +17 -17
  189. package/dist/chunks/index.a3d60e4f.js.map +1 -0
  190. package/dist/chunks/{index.c5b58864.js → index.ba3396d3.js} +3 -3
  191. package/dist/chunks/{index.c5b58864.js.map → index.ba3396d3.js.map} +1 -1
  192. package/dist/chunks/{index.6987f880.js → index.c8ffede1.js} +7 -7
  193. package/dist/chunks/{index.6987f880.js.map → index.c8ffede1.js.map} +1 -1
  194. package/dist/chunks/{info.550f9511.js → info.205b4496.js} +2 -2
  195. package/dist/chunks/{info.550f9511.js.map → info.205b4496.js.map} +1 -1
  196. package/dist/chunks/{listbox-option-tag.bf77e0c4.js → listbox-option-tag.b6182b2e.js} +3 -3
  197. package/dist/chunks/{listbox-option-tag.bf77e0c4.js.map → listbox-option-tag.b6182b2e.js.map} +1 -1
  198. package/dist/chunks/{loading-button.cdc193c6.js → loading-button.0391ad8b.js} +4 -4
  199. package/dist/chunks/{loading-button.cdc193c6.js.map → loading-button.0391ad8b.js.map} +1 -1
  200. package/dist/chunks/{payment-method.ea1788f7.js → payment-method.31a68b9b.js} +2 -2
  201. package/dist/chunks/{payment-method.ea1788f7.js.map → payment-method.31a68b9b.js.map} +1 -1
  202. package/dist/chunks/{refresh.bd60f6a8.js → refresh.53691839.js} +2 -2
  203. package/dist/chunks/{refresh.bd60f6a8.js.map → refresh.53691839.js.map} +1 -1
  204. package/dist/chunks/{search.ade93bda.js → search.4e4ee4dd.js} +2 -2
  205. package/dist/chunks/{search.ade93bda.js.map → search.4e4ee4dd.js.map} +1 -1
  206. package/dist/chunks/{tooltip.10210728.js → tooltip.1084d92b.js} +3 -3
  207. package/dist/chunks/{tooltip.10210728.js.map → tooltip.1084d92b.js.map} +1 -1
  208. package/dist/chunks/{use-bento-toast-controller.3275a505.js → use-bento-toast-controller.98d8613c.js} +2 -2
  209. package/dist/chunks/{use-bento-toast-controller.3275a505.js.map → use-bento-toast-controller.98d8613c.js.map} +1 -1
  210. package/dist/chunks/use-cached-selected-values.852aeafe.js +1537 -0
  211. package/dist/chunks/use-cached-selected-values.852aeafe.js.map +1 -0
  212. package/dist/code-snippet.js +7 -7
  213. package/dist/code-snippet.js.map +1 -1
  214. package/dist/country.js +2 -2
  215. package/dist/currency.js +1 -1
  216. package/dist/data-grid-template.js +1 -1
  217. package/dist/data-grid.js +1317 -1256
  218. package/dist/data-grid.js.map +1 -1
  219. package/dist/date-picker.js +8 -8
  220. package/dist/date-range-picker.js +2 -2
  221. package/dist/date.js +1 -1
  222. package/dist/divider.js +1 -1
  223. package/dist/dropdown.js +7 -7
  224. package/dist/empty-state.js +3 -3
  225. package/dist/filter-bar.js +1260 -1108
  226. package/dist/filter-bar.js.map +1 -1
  227. package/dist/focus-trap.js +1 -1
  228. package/dist/form-layout.js +53 -51
  229. package/dist/form-layout.js.map +1 -1
  230. package/dist/header.js +5 -5
  231. package/dist/index.js +141 -133
  232. package/dist/index.js.map +1 -1
  233. package/dist/info-icon.js +4 -4
  234. package/dist/input-field.js +50 -48
  235. package/dist/input-field.js.map +1 -1
  236. package/dist/internal.js +31 -78
  237. package/dist/internal.js.map +1 -1
  238. package/dist/link.js +1 -1
  239. package/dist/loading-indicator.js +1 -1
  240. package/dist/menu.js +1 -1
  241. package/dist/modal-fullscreen.js +7 -7
  242. package/dist/modal.js +6 -6
  243. package/dist/pagination.js +4 -4
  244. package/dist/payment-method.js +1 -1
  245. package/dist/popover.js +1 -1
  246. package/dist/popper-container.js +1 -1
  247. package/dist/radio-group.js +112 -112
  248. package/dist/radio-group.js.map +1 -1
  249. package/dist/search-bar.js +4 -4
  250. package/dist/secondary-nav.js +2 -2
  251. package/dist/segmented-control.js +4 -4
  252. package/dist/selection-card.js +5 -5
  253. package/dist/sidepanel.js +64 -62
  254. package/dist/sidepanel.js.map +1 -1
  255. package/dist/status.js +2 -2
  256. package/dist/stepper.js +4 -4
  257. package/dist/structured-list.js +1 -1
  258. package/dist/summary-grid.js +3 -3
  259. package/dist/tabs.js +22 -20
  260. package/dist/tabs.js.map +1 -1
  261. package/dist/tag.js +3 -3
  262. package/dist/textarea.js +4 -4
  263. package/dist/timeline.js +7 -7
  264. package/dist/toast.js +5 -5
  265. package/dist/toggle.js +3 -3
  266. package/dist/tutorial.js +145 -124
  267. package/dist/tutorial.js.map +1 -1
  268. package/dist/typography.js +1 -1
  269. package/dist/web-types.json +1 -1
  270. package/package.json +7 -3
  271. package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +0 -8
  272. package/dist/chunks/dialog-page.2c07d294.js +0 -172
  273. package/dist/chunks/dialog-page.2c07d294.js.map +0 -1
  274. package/dist/chunks/dropdown.170b43c4.js.map +0 -1
  275. package/dist/chunks/index.1b1646bf.js.map +0 -1
  276. package/dist/chunks/index.51fe0fc2.js.map +0 -1
  277. package/dist/chunks/listbox.b6a1aea2.js +0 -1466
  278. package/dist/chunks/listbox.b6a1aea2.js.map +0 -1
  279. /package/dist/@types/packages/{vue2 → core}/src/components/typography/typography.types.d.ts +0 -0
  280. /package/dist/assets/{cross.css → checkmark-circle-fill.css} +0 -0
@@ -1,1466 +0,0 @@
1
- import { computed as m, ref as M, onMounted as Oe, onUnmounted as Ge, watch as Le, defineComponent as q, resolveComponent as C, openBlock as v, createElementBlock as T, createVNode as $, withCtx as E, createTextVNode as w, toDisplayString as x, createElementVNode as z, renderSlot as G, mergeProps as V, withKeys as ge, createBlock as k, toHandlerKey as te, normalizeProps as Y, guardReactiveProps as W, createCommentVNode as J, withDirectives as ce, vShow as Ae, toRef as de, resolveDirective as ye, toHandlers as se, Fragment as X, renderList as F, createSlots as ae, normalizeClass as pe, unref as re, pushScopeId as Fe, popScopeId as Ye } from "vue";
2
- import { B as K, a as _e } from "./keyboard-navigation.ca47dfa8.js";
3
- import { B as Q } from "./index.51fe0fc2.js";
4
- import { BentoLoadingIndicator as Ke } from "../loading-indicator.js";
5
- import { BentoEmptyState as ze } from "../empty-state.js";
6
- import { u as ue } from "./i18n.f7e6533e.js";
7
- import { d as We } from "./debounce.b5ef6acf.js";
8
- import { _ as H } from "./_plugin-vue_export-helper.dad06003.js";
9
- import { C as qe } from "./checkmark.eb3c7a06.js";
10
- import { B as Se } from "./checkbox.d0f897e0.js";
11
- import { a as He, C as je } from "./chevron-up.638a9f34.js";
12
- import { B as Xe } from "./base-button.ab9c947e.js";
13
- import { C as Je } from "./cross-small.b85406fe.js";
14
- import { B as Qe, a as Ce } from "./loading-button.cdc193c6.js";
15
- import { o as Ze } from "./resize.a041304d.js";
16
- import "../assets/listbox.css";
17
- const Ie = (e, t, a, b) => {
18
- const l = m(
19
- () => {
20
- var s, d;
21
- return !!((s = e.value) != null && s.length) && ((d = e.value) == null ? void 0 : d.length) === t.value.length;
22
- }
23
- ), i = m(() => {
24
- var s;
25
- return e.value == null || e.value.length === 0 ? !1 : ((s = e.value) == null ? void 0 : s.length) !== t.value.length;
26
- });
27
- return {
28
- isAllSelected: l,
29
- isIndeterminate: i,
30
- toggleSelectAll: (s) => {
31
- s ? a() : b();
32
- }
33
- };
34
- };
35
- function et(e, { disabled: t, itemHeight: a, overscan: b = 5, prefixHeight: l }) {
36
- const i = M(null), n = M([]), s = M(0), d = M(0), o = M(0);
37
- let f;
38
- const c = m(() => {
39
- const O = typeof a == "number" ? e.value.length * a : e.value.reduce((R, _, L) => R + a(L), 0), D = typeof a == "number" ? s.value * a : e.value.slice(0, s.value).reduce((R, _, L) => R + a(L), 0);
40
- return {
41
- style: {
42
- marginTop: `${D}px`,
43
- height: `${O - D}px`
44
- }
45
- };
46
- }), g = () => {
47
- const O = (l == null ? void 0 : l.value) ?? 0, D = Math.max(i.value.scrollTop - O, 0);
48
- if (typeof a == "number")
49
- return Math.floor(D / a);
50
- let R = 0, _ = 0;
51
- for (let L = 0; L < e.value.length; L += 1) {
52
- const U = a(L);
53
- if (R += U, R >= D) {
54
- _ = L;
55
- break;
56
- }
57
- }
58
- return _;
59
- }, u = () => {
60
- if (o.value = i.value.clientHeight, typeof a == "number")
61
- return Math.ceil(o.value / a);
62
- const O = s.value ?? 0;
63
- let D = 0, R = 0;
64
- for (let _ = O; _ < e.value.length; _ += 1) {
65
- const L = a(_);
66
- if (D += L, R = _, D > o.value)
67
- break;
68
- }
69
- return R - O;
70
- }, S = () => {
71
- if (i.value) {
72
- const O = u();
73
- s.value = g(), d.value = Math.min(s.value + O + b, e.value.length), n.value = e.value.slice(s.value, d.value);
74
- }
75
- }, I = () => {
76
- S();
77
- };
78
- t || (Oe(() => {
79
- i.value && (o.value = i.value.clientHeight, f = Ze(i.value, ({ clientHeight: O }) => {
80
- o.value = O, S();
81
- }), S());
82
- }), Ge(() => {
83
- f == null || f.disconnect();
84
- }), Le(
85
- () => e.value,
86
- () => {
87
- S();
88
- }
89
- ));
90
- const P = {
91
- ref: i,
92
- style: { overflowY: "auto" }
93
- };
94
- return t ? {
95
- containerRef: i,
96
- containerProps: P,
97
- // eslint-disable-next-line @typescript-eslint/no-empty-function
98
- onScroll: () => {
99
- },
100
- list: e
101
- } : {
102
- containerRef: i,
103
- containerProps: P,
104
- onScroll: I,
105
- list: n,
106
- wrapperProps: c
107
- };
108
- }
109
- var r = /* @__PURE__ */ ((e) => (e.SELECT = "select", e.SHOW_MORE = "show-more", e.ESCAPE = "escape-pressed", e.CLICK = "click", e.ENTER = "enter-pressed", e.SPACE = "space-pressed", e.TAB = "tab-pressed", e.CLOSE_DROPDOWN = "close-dropdown", e))(r || {}), ee = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(ee || {});
110
- const tt = q({
111
- name: "bento-listbox-static-category",
112
- components: {
113
- BentoTypography: Q
114
- },
115
- props: {
116
- /**
117
- * Category label text
118
- */
119
- categoryLabel: {
120
- type: String,
121
- required: !0
122
- }
123
- }
124
- });
125
- const st = { class: "b-listbox-single-select-category" };
126
- function lt(e, t, a, b, l, i) {
127
- const n = C("bento-typography");
128
- return v(), T("div", st, [
129
- $(n, {
130
- variant: "caption",
131
- el: "span",
132
- class: "b-listbox-single-select-category__label-text"
133
- }, {
134
- default: E(() => [
135
- w(x(e.categoryLabel), 1)
136
- ]),
137
- _: 1
138
- }),
139
- z("div", null, [
140
- G(e.$slots, "default", {}, void 0, !0)
141
- ])
142
- ]);
143
- }
144
- const ot = /* @__PURE__ */ H(tt, [["render", lt], ["__scopeId", "data-v-a90eff17"]]), nt = q({
145
- name: "bento-listbox-option",
146
- props: {
147
- /**
148
- * Setting this property to true will disable the option.
149
- */
150
- disabled: { type: Boolean, default: !1 },
151
- /**
152
- * Indicates if the value is selected. Only one element can be selected at a time.
153
- */
154
- selected: { type: Boolean, default: !1 }
155
- },
156
- emits: [r.CLICK, r.ENTER, r.SPACE, r.TAB],
157
- setup(e, { emit: t }) {
158
- const a = m(() => ({
159
- "b-listbox-option--disabled": e.disabled,
160
- "b-listbox-option--selected": e.selected
161
- }));
162
- return {
163
- // Enums
164
- BentoKeyboardNavigationKeyDownEvent: K,
165
- BentoListboxEvent: r,
166
- // Values
167
- conditionalClasses: a,
168
- // Events
169
- onClick: (i) => {
170
- t(r.CLICK, i);
171
- },
172
- onOptionSelected: (i, n) => {
173
- t(i, n);
174
- }
175
- };
176
- }
177
- });
178
- function it(e, t, a, b, l, i) {
179
- return v(), T("label", V({
180
- class: ["b-listbox-option", e.conditionalClasses],
181
- role: "option"
182
- }, e.$attrs, {
183
- onClick: t[0] || (t[0] = (...n) => e.onClick && e.onClick(...n)),
184
- onKeydown: [
185
- t[1] || (t[1] = ge((n) => e.onOptionSelected(e.BentoListboxEvent.ENTER, n), ["enter"])),
186
- t[2] || (t[2] = ge((n) => e.onOptionSelected(e.BentoListboxEvent.SPACE, n), ["space"])),
187
- t[3] || (t[3] = ge((n) => e.onOptionSelected(e.BentoListboxEvent.TAB, n), ["tab"]))
188
- ]
189
- }), [
190
- G(e.$slots, "default", {}, void 0, !0)
191
- ], 16);
192
- }
193
- const be = /* @__PURE__ */ H(nt, [["render", it], ["__scopeId", "data-v-18a61f5d"]]), at = q({
194
- name: "bento-listbox-single-select-option",
195
- components: {
196
- BentoListboxOption: be,
197
- BentoTypography: Q,
198
- CheckmarkIcon: qe
199
- },
200
- props: {
201
- /**
202
- * Setting this property to true will disable the option.
203
- */
204
- disabled: { type: Boolean, default: !1 },
205
- /**
206
- * The option item that contains all the option item's data.
207
- * @type {BentoListboxOptionItem}
208
- */
209
- option: {
210
- type: Object,
211
- required: !0
212
- },
213
- /**
214
- * Indicates if the value is selected. Only one element can be selected at a time.
215
- */
216
- selected: { type: Boolean, default: !1 }
217
- },
218
- emits: [r.ENTER, r.SELECT, r.SPACE, r.TAB],
219
- setup(e, { emit: t }) {
220
- const a = (n) => {
221
- e.disabled || t(n, e.option.value);
222
- }, b = m(() => e.disabled ? !0 : null), l = m(() => e.selected ? !0 : null), i = m(() => e.disabled ? -1 : 0);
223
- return {
224
- // Values
225
- ariaDisabled: b,
226
- ariaSelected: l,
227
- tabIndex: i,
228
- // Enums
229
- BentoListboxEvent: r,
230
- // Events
231
- onOptionSelected: a
232
- };
233
- }
234
- });
235
- const ct = { class: "b-listbox-single-select-option__text" }, rt = { class: "b-listbox-single-select-option__check-icon" };
236
- function dt(e, t, a, b, l, i) {
237
- const n = C("bento-typography"), s = C("checkmark-icon"), d = C("bento-listbox-option");
238
- return v(), k(d, V({
239
- class: "b-listbox-single-select-option",
240
- disabled: e.disabled,
241
- selected: e.selected,
242
- "aria-selected": e.ariaSelected,
243
- "aria-disabled": e.ariaDisabled,
244
- tabindex: e.tabIndex,
245
- onClick: t[0] || (t[0] = (o) => e.onOptionSelected(e.BentoListboxEvent.SELECT))
246
- }, {
247
- [te(e.BentoListboxEvent.ENTER)]: t[1] || (t[1] = (o) => e.onOptionSelected(e.BentoListboxEvent.ENTER))
248
- }, {
249
- [te(e.BentoListboxEvent.SPACE)]: t[2] || (t[2] = (o) => e.onOptionSelected(e.BentoListboxEvent.SPACE))
250
- }, {
251
- [te(e.BentoListboxEvent.TAB)]: t[3] || (t[3] = (o) => e.onOptionSelected(e.BentoListboxEvent.TAB))
252
- }), {
253
- default: E(() => [
254
- G(e.$slots, "default", Y(W(e.option)), () => [
255
- z("span", ct, [
256
- $(n, { el: "span" }, {
257
- default: E(() => [
258
- w(x(e.option.label), 1)
259
- ]),
260
- _: 1
261
- }),
262
- e.option.description ? (v(), k(n, {
263
- key: 0,
264
- class: "b-listbox-single-select-option__description",
265
- el: "span"
266
- }, {
267
- default: E(() => [
268
- w(x(e.option.description), 1)
269
- ]),
270
- _: 1
271
- })) : J("", !0)
272
- ])
273
- ], !0),
274
- z("span", rt, [
275
- ce($(s, { "svg-title": "selected" }, null, 512), [
276
- [Ae, e.selected]
277
- ])
278
- ])
279
- ]),
280
- _: 3
281
- }, 16, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
282
- }
283
- const ut = /* @__PURE__ */ H(at, [["render", dt], ["__scopeId", "data-v-d112952c"]]), $e = ({ items: e, isOptionDisabled: t }, a) => {
284
- const b = m(() => e.value.length - 1), l = M(0);
285
- Oe(() => {
286
- t && (l.value = e.value.findIndex((u) => !t(u)));
287
- });
288
- const i = (u) => !t || !!t && t(e.value[u]), n = (u) => !t || !!t && !t(e.value[u]), s = (u) => {
289
- switch (u) {
290
- case "increase":
291
- l.value += 1;
292
- break;
293
- case "decrease":
294
- l.value -= 1;
295
- break;
296
- }
297
- }, d = ({ edgeCaseItem: u, isItemBeforeEdgeCaseItem: S }, I, P) => {
298
- l.value !== u && (S ? n(u) && s(P) : (s(P), i(l.value) && I()), a(l.value));
299
- }, o = (u) => {
300
- var I;
301
- (I = u == null ? void 0 : u.detail) == null || I.preventDefault();
302
- const S = l.value === b.value - 2;
303
- d(
304
- {
305
- isItemBeforeEdgeCaseItem: S,
306
- edgeCaseItem: b.value
307
- },
308
- o,
309
- "increase"
310
- /* INCREASE */
311
- );
312
- }, f = (u) => {
313
- var I;
314
- (I = u == null ? void 0 : u.detail) == null || I.preventDefault();
315
- const S = l.value === 1;
316
- d(
317
- {
318
- edgeCaseItem: 0,
319
- isItemBeforeEdgeCaseItem: S
320
- },
321
- f,
322
- "decrease"
323
- /* DECREASE */
324
- );
325
- };
326
- return {
327
- moveToFirstElement: () => {
328
- l.value = 0, i(l.value) ? o() : a(l.value);
329
- },
330
- moveToLastElement: () => {
331
- l.value = b.value, i(l.value) ? f() : a(l.value);
332
- },
333
- moveToNextElement: o,
334
- moveToPreviousElement: f
335
- };
336
- }, bt = q({
337
- name: "bento-listbox-single-select",
338
- components: {
339
- BentoListboxSingleSelectCategory: ot,
340
- BentoListboxSingleSelectOption: ut
341
- },
342
- directives: { BentoKeyboardNavigationDirective: _e },
343
- inheritAttrs: !1,
344
- props: {
345
- /**
346
- * Function that allows the options to be disabled
347
- *
348
- * @type {BentoListboxIsOptionDisabled}
349
- * @param {BentoListboxOptionItem} option - listbox option object
350
- * @param {string} option.label - Option's label text
351
- * @param {string|number} option.value - Option's value
352
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
353
- */
354
- isOptionDisabled: {
355
- type: Function,
356
- default: () => !1
357
- },
358
- /**
359
- * The option elements to populate the listbox with.
360
- * It must be an array of {@see BentoListboxOptionItem }.
361
- *
362
- * @property {string} value.label - Text to be displayed in the option
363
- * @property {string,number} value.value - Value of the option
364
- */
365
- items: {
366
- type: Array,
367
- required: !0
368
- },
369
- /**
370
- * The `input` value.
371
- * Providing an empty string will select no options.
372
- * Set to an empty string `''` if you don't want any of the available options to be selected
373
- */
374
- selectedValue: {
375
- type: [String, Number],
376
- default: void 0
377
- },
378
- /**
379
- * If enabled, dropdown will display non-selectable, static categories
380
- */
381
- staticCategories: { type: Boolean, default: !1 }
382
- },
383
- emits: [r.SELECT, r.ENTER, r.SPACE, r.TAB],
384
- setup(e, { emit: t, slots: a }) {
385
- const b = M([]), l = m(() => !!e.items.find(({ items: u }) => !!u)), i = (u) => (S) => {
386
- t(u, S);
387
- }, n = (u) => b.value[u].$el.focus(), { moveToNextElement: s, moveToPreviousElement: d, moveToFirstElement: o, moveToLastElement: f } = $e(
388
- {
389
- items: de(e, "items"),
390
- isOptionDisabled: e.isOptionDisabled
391
- },
392
- n
393
- ), c = {
394
- [K.ARROW_UP]: d,
395
- [K.ARROW_DOWN]: s,
396
- [K.HOME]: o,
397
- [K.END]: f
398
- }, g = {
399
- [r.SELECT]: i(r.SELECT),
400
- [r.SPACE]: i(r.SPACE),
401
- [r.TAB]: i(r.TAB),
402
- [r.ENTER]: i(r.ENTER)
403
- };
404
- return {
405
- // Enums
406
- BentoListboxEvent: r,
407
- // Values
408
- listboxItemRef: b,
409
- slots: a,
410
- // Computed
411
- hasCategories: l,
412
- // Methods
413
- onOptionSelected: i,
414
- // Keyboard navigation
415
- listboxListeners: c,
416
- listboxOptionListeners: g
417
- };
418
- }
419
- });
420
- function mt(e, t, a, b, l, i) {
421
- const n = C("bento-listbox-single-select-option"), s = C("bento-listbox-single-select-category"), d = ye("bento-keyboard-navigation-directive");
422
- return ce((v(), T("div", se(e.listboxListeners, !0), [
423
- e.hasCategories && e.staticCategories ? (v(!0), T(X, { key: 0 }, F(e.items, (o) => (v(), k(s, {
424
- key: o.value,
425
- "category-label": o.label,
426
- role: "group"
427
- }, {
428
- default: E(() => [
429
- (v(!0), T(X, null, F(o.items, (f) => (v(), k(n, V({
430
- key: f.value,
431
- ref_for: !0,
432
- ref: "listboxItemRef",
433
- role: "option",
434
- option: f,
435
- disabled: e.isOptionDisabled ? e.isOptionDisabled(f) : null,
436
- selected: f.value === e.selectedValue
437
- }, se(e.listboxOptionListeners)), ae({ _: 2 }, [
438
- F(e.slots, (c, g) => ({
439
- name: g,
440
- fn: E((u) => [
441
- G(e.$slots, g, Y(W(u)))
442
- ])
443
- }))
444
- ]), 1040, ["option", "disabled", "selected"]))), 128))
445
- ]),
446
- _: 2
447
- }, 1032, ["category-label"]))), 128)) : (v(!0), T(X, { key: 1 }, F(e.items, (o) => (v(), k(n, V({
448
- key: o.value,
449
- ref_for: !0,
450
- ref: "listboxItemRef",
451
- role: "option",
452
- option: o,
453
- disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
454
- selected: o.value === e.selectedValue
455
- }, se(e.listboxOptionListeners)), ae({ _: 2 }, [
456
- F(e.slots, (f, c) => ({
457
- name: c,
458
- fn: E((g) => [
459
- G(e.$slots, c, Y(W(g)))
460
- ])
461
- }))
462
- ]), 1040, ["option", "disabled", "selected"]))), 128))
463
- ], 16)), [
464
- [d]
465
- ]);
466
- }
467
- const vt = /* @__PURE__ */ H(bt, [["render", mt]]);
468
- var fe = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(fe || {}), ie = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e))(ie || {});
469
- const gt = {
470
- "en-US": {
471
- categoryClosed: "{category} closed",
472
- categoryOpened: "{category} opened"
473
- }
474
- }, pt = q({
475
- i18n: { messages: gt },
476
- name: "bento-listbox-multi-select-category",
477
- components: {
478
- BentoCheckbox: Se,
479
- BentoTypography: Q,
480
- BentoListboxOption: be,
481
- ChevronDownIcon: He,
482
- ChevronUpIcon: je
483
- },
484
- props: {
485
- /**
486
- * The option elements to populate the listbox with.
487
- * It must be an array of {@see BentoListboxOptionItem }.
488
- *
489
- * @property {string} value.label - Text to be displayed in the option
490
- * @property {string,number} value.value - Value of the option
491
- * @property {BentoListboxOptionItem} value.items - Category items list
492
- */
493
- category: {
494
- type: Object,
495
- required: !0
496
- },
497
- /**
498
- * Function that allows the options to be disabled
499
- *
500
- * @type {BentoListboxIsOptionDisabled}
501
- * @param {BentoListboxOptionItem} option - listbox option object
502
- * @param {string} option.label - Option's label text
503
- * @param {string|number} option.value - Option's value
504
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
505
- */
506
- isOptionDisabled: {
507
- type: [Function],
508
- default: () => !1
509
- },
510
- /**
511
- * The `input` value.
512
- * Providing an empty array will select no options.
513
- */
514
- selectedItemsList: {
515
- type: Array,
516
- default: () => []
517
- },
518
- /**
519
- * If enabled, dropdown will display non-selectable, static categories
520
- */
521
- staticCategories: { type: Boolean, default: !1 }
522
- },
523
- emits: [ie.SELECT_CATEGORY, ie.UNSELECT_CATEGORY],
524
- setup(e, { emit: t }) {
525
- const a = M(!1), { t: b } = ue(), l = (_) => e.isOptionDisabled ? e.isOptionDisabled(_) : !1, i = m(
526
- () => e.category.items.every((_) => l(_))
527
- ), n = de(e, "staticCategories"), s = m(() => a.value || e.staticCategories), d = m(() => ({
528
- [`b-listbox-multi-select-category--${fe.DISABLED}`]: i.value,
529
- [`b-listbox-multi-select-category--${fe.STATIC_CATEGORY}`]: e.staticCategories
530
- })), o = (_) => {
531
- _.preventDefault(), a.value = !a.value;
532
- }, f = (_) => {
533
- var Z;
534
- const L = l(_), U = ((Z = e.selectedItemsList) == null ? void 0 : Z.includes(_.value)) || !1;
535
- return { isDisabled: L, isPreSelected: U };
536
- }, c = m(
537
- () => e.category.items.filter((_) => {
538
- const { isDisabled: L, isPreSelected: U } = f(_);
539
- return L && U || !L;
540
- })
541
- ), g = m(
542
- () => {
543
- var _;
544
- return (_ = c.value) == null ? void 0 : _.filter(
545
- ({ value: L }) => {
546
- var U;
547
- return (U = e.selectedItemsList) == null ? void 0 : U.includes(L);
548
- }
549
- );
550
- }
551
- ), u = m(() => {
552
- const _ = a.value ? "categoryOpened" : "categoryClosed";
553
- return b(_, { category: e.category.label });
554
- }), S = m(
555
- () => ({
556
- el: "span",
557
- variant: e.staticCategories ? "caption" : "body"
558
- })
559
- ), I = () => {
560
- t(ie.SELECT_CATEGORY);
561
- }, P = () => {
562
- t(ie.UNSELECT_CATEGORY);
563
- }, { isAllSelected: O, isIndeterminate: D, toggleSelectAll: R } = Ie(
564
- g,
565
- c,
566
- I,
567
- P
568
- );
569
- return {
570
- // Values
571
- chevronTitle: u,
572
- conditionalClass: d,
573
- hasAllPropsDisabled: i,
574
- isOpen: a,
575
- isAllSelected: O,
576
- isIndeterminate: D,
577
- isStaticCategory: n,
578
- // Computed
579
- showItemChildren: s,
580
- categoryLabelProps: S,
581
- // Methods
582
- toggleOpen: o,
583
- toggleSelectAll: R
584
- };
585
- }
586
- });
587
- const ft = { class: "b-listbox-multi-select-category__label" };
588
- function yt(e, t, a, b, l, i) {
589
- const n = C("bento-checkbox"), s = C("bento-typography"), d = C("chevron-up-icon"), o = C("chevron-down-icon"), f = C("bento-listbox-option");
590
- return v(), T("div", null, [
591
- $(f, {
592
- class: pe(["b-listbox-multi-select-category__option", e.conditionalClass])
593
- }, {
594
- default: E(() => [
595
- e.isStaticCategory ? J("", !0) : (v(), k(n, {
596
- key: 0,
597
- "model-value": e.isAllSelected,
598
- indeterminate: e.isIndeterminate,
599
- disabled: e.hasAllPropsDisabled,
600
- "aria-label": e.category.label,
601
- value: e.category.value,
602
- "onUpdate:modelValue": e.toggleSelectAll
603
- }, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "value", "onUpdate:modelValue"])),
604
- z("span", ft, [
605
- $(s, V(e.categoryLabelProps, { class: "b-listbox-multi-select-category__label-text" }), {
606
- default: E(() => [
607
- w(x(e.category.label), 1)
608
- ]),
609
- _: 1
610
- }, 16),
611
- e.isStaticCategory ? J("", !0) : (v(), T("div", {
612
- key: 0,
613
- class: "b-listbox-multi-select-category__label-chevron",
614
- "data-testid": "toggle-listbox",
615
- onClickCapture: t[0] || (t[0] = (...c) => e.toggleOpen && e.toggleOpen(...c))
616
- }, [
617
- e.isOpen ? (v(), k(d, {
618
- key: 0,
619
- "svg-title": e.chevronTitle
620
- }, null, 8, ["svg-title"])) : (v(), k(o, {
621
- key: 1,
622
- "svg-title": e.chevronTitle
623
- }, null, 8, ["svg-title"]))
624
- ], 32))
625
- ])
626
- ]),
627
- _: 1
628
- }, 8, ["class"]),
629
- ce(z("div", null, [
630
- G(e.$slots, "default", {}, void 0, !0)
631
- ], 512), [
632
- [Ae, e.showItemChildren]
633
- ])
634
- ]);
635
- }
636
- const _t = /* @__PURE__ */ H(pt, [["render", yt], ["__scopeId", "data-v-9a00de22"]]);
637
- var j = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e))(j || {});
638
- const St = q({
639
- name: "listbox-multi-select-options",
640
- components: {
641
- BentoCheckbox: Se,
642
- BentoListboxOption: be,
643
- BentoTypography: Q,
644
- ListboxMultiSelectCategory: _t
645
- },
646
- props: {
647
- /**
648
- * Indicates if the items listed are inside a category
649
- * so they can be padded to right by one level in recursion.
650
- * Items of categories are automatically defined as "categoryItems"
651
- */
652
- categoryItems: { type: Boolean, default: !1 },
653
- /**
654
- * Function that allows the options to be disabled
655
- *
656
- * @type {BentoListboxIsOptionDisabled}
657
- * @param {BentoListboxOptionItem} option - listbox option object
658
- * @param {string} option.label - Option's label text
659
- * @param {string|number} option.value - Option's value
660
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
661
- */
662
- isOptionDisabled: {
663
- type: Function,
664
- default: () => !1
665
- },
666
- /**
667
- * The option elements to populate the listbox with.
668
- * It must be an array of {@see BentoListboxOptionItem }.
669
- *
670
- * @property {string} value.label - Text to be displayed in the option
671
- * @property {string,number} value.value - Value of the option
672
- */
673
- items: {
674
- type: Array,
675
- required: !0
676
- },
677
- /**
678
- * Indicates if the elements options are inside a multi-level category
679
- */
680
- isMultiLevel: { type: Boolean, default: !1 },
681
- /**
682
- * Flag that indicates that an external search it's being made
683
- * to filter out the items inside the the multi-select listbox
684
- *
685
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
686
- */
687
- searching: { type: Boolean, default: !1 },
688
- /**
689
- * List of selected items.
690
- * Providing an empty array will select no options.
691
- */
692
- selectedItemsList: {
693
- type: Array,
694
- default: () => []
695
- },
696
- /**
697
- * If enabled, dropdown will display non-selectable, static categories
698
- */
699
- staticCategories: { type: Boolean, default: !1 }
700
- },
701
- emits: [
702
- j.TOGGLE_CHECKBOX_SELECTION,
703
- j.SELECT_CATEGORY,
704
- j.UNSELECT_CATEGORY
705
- ],
706
- setup(e, { emit: t }) {
707
- const a = (d) => {
708
- t(j.TOGGLE_CHECKBOX_SELECTION, d);
709
- }, b = (d) => !!d.items, l = (d) => {
710
- const o = e.isMultiLevel && e.searching;
711
- return d.description && (!e.isMultiLevel || o);
712
- }, i = (d) => d.items ? !!d.items.find((o) => e.selectedItemsList.includes(o.value)) : e.selectedItemsList.includes(d.value), n = (d, o) => {
713
- if (b(o))
714
- return t(d ? j.SELECT_CATEGORY : j.UNSELECT_CATEGORY, o);
715
- a(o.value);
716
- };
717
- return {
718
- // Values
719
- conditionalClasses: m(() => ({
720
- "b-listbox-multi-select-options__static-category-option": e.staticCategories,
721
- "b-listbox-multi-select-options__category-option": e.categoryItems
722
- })),
723
- // Methods
724
- isCategory: b,
725
- isOptionSelected: i,
726
- shouldShowDescription: l,
727
- toggleCheckboxSelection: a,
728
- selectSearch: n,
729
- // Enums
730
- BentoListboxEvent: r,
731
- ListboxMultiSelectOptionsEvent: j
732
- };
733
- }
734
- });
735
- const Ct = { class: "b-listbox-multi-select__option-text" }, Et = { class: "b-listbox-multi-select__option-text" };
736
- function ht(e, t, a, b, l, i) {
737
- const n = C("bento-checkbox"), s = C("bento-typography"), d = C("bento-listbox-option"), o = C("listbox-multi-select-options", !0), f = C("listbox-multi-select-category");
738
- return v(), T("div", null, [
739
- (v(!0), T(X, null, F(e.items, (c) => (v(), T("div", {
740
- key: `selected-${c.value}`
741
- }, [
742
- e.searching && e.isMultiLevel ? (v(), k(d, {
743
- key: 0,
744
- class: pe(["b-listbox-multi-select-options", e.conditionalClasses]),
745
- disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null
746
- }, {
747
- default: E(() => [
748
- $(n, {
749
- "model-value": e.isOptionSelected(c),
750
- "aria-label": c.label,
751
- disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
752
- value: c.value,
753
- "onUpdate:modelValue": (g) => e.selectSearch(g, c)
754
- }, null, 8, ["model-value", "aria-label", "disabled", "value", "onUpdate:modelValue"]),
755
- G(e.$slots, "default", Y(W(c)), () => [
756
- z("span", Ct, [
757
- $(s, { el: "span" }, {
758
- default: E(() => [
759
- w(x(c.label), 1)
760
- ]),
761
- _: 2
762
- }, 1024),
763
- e.shouldShowDescription(c) ? (v(), k(s, {
764
- key: 0,
765
- class: "b-listbox-multi-select__option-description",
766
- el: "span"
767
- }, {
768
- default: E(() => [
769
- w(x(c.description), 1)
770
- ]),
771
- _: 2
772
- }, 1024)) : J("", !0)
773
- ])
774
- ], !0)
775
- ]),
776
- _: 2
777
- }, 1032, ["class", "disabled"])) : (v(), T(X, { key: 1 }, [
778
- c.items ? (v(), k(f, {
779
- key: 0,
780
- category: c,
781
- "static-categories": e.staticCategories,
782
- "is-option-disabled": e.isOptionDisabled,
783
- "selected-items-list": e.selectedItemsList,
784
- onSelectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, c),
785
- onUnselectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, c)
786
- }, {
787
- default: E(() => [
788
- $(o, {
789
- "category-items": "",
790
- items: c.items,
791
- "is-option-disabled": e.isOptionDisabled,
792
- "is-multi-level": e.isMultiLevel,
793
- "static-categories": e.staticCategories,
794
- "selected-items-list": e.selectedItemsList,
795
- searching: e.searching,
796
- onToggleCheckboxSelection: t[0] || (t[0] = (g) => e.toggleCheckboxSelection(g))
797
- }, null, 8, ["items", "is-option-disabled", "is-multi-level", "static-categories", "selected-items-list", "searching"])
798
- ]),
799
- _: 2
800
- }, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "onSelectCategory", "onUnselectCategory"])) : (v(), k(d, {
801
- key: 1,
802
- class: pe(["b-listbox-multi-select-options", e.conditionalClasses]),
803
- disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null
804
- }, {
805
- default: E(() => [
806
- $(n, {
807
- "model-value": e.selectedItemsList,
808
- "aria-label": c.label,
809
- disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
810
- value: c.value,
811
- "onUpdate:modelValue": (g) => e.toggleCheckboxSelection(c.value)
812
- }, null, 8, ["model-value", "aria-label", "disabled", "value", "onUpdate:modelValue"]),
813
- G(e.$slots, "default", Y(W(c)), () => [
814
- z("span", Et, [
815
- $(s, { el: "span" }, {
816
- default: E(() => [
817
- w(x(c.label), 1)
818
- ]),
819
- _: 2
820
- }, 1024),
821
- e.shouldShowDescription(c) ? (v(), k(s, {
822
- key: 0,
823
- class: "b-listbox-multi-select__option-description",
824
- el: "span"
825
- }, {
826
- default: E(() => [
827
- w(x(c.description), 1)
828
- ]),
829
- _: 2
830
- }, 1024)) : J("", !0)
831
- ])
832
- ], !0)
833
- ]),
834
- _: 2
835
- }, 1032, ["class", "disabled"]))
836
- ], 64))
837
- ]))), 128))
838
- ]);
839
- }
840
- const Tt = /* @__PURE__ */ H(St, [["render", ht], ["__scopeId", "data-v-ade259b2"]]), Be = {
841
- "en-US": {
842
- remove: "Remove"
843
- }
844
- }, Ot = { class: "b-listbox-multi-select-chips" }, Lt = {
845
- i18n: { messages: Be }
846
- }, At = /* @__PURE__ */ q({
847
- ...Lt,
848
- __name: "listbox-multi-select-chips",
849
- props: {
850
- /**
851
- * Function that defines the options to be disabled
852
- */
853
- isOptionDisabled: {
854
- type: Function,
855
- default: () => !1
856
- },
857
- /**
858
- * The option elements to populate the listbox with.
859
- * It must be an array of {@see BentoListboxOptionItem }.
860
- *
861
- * @property {string} value.label - Text to be displayed in the option
862
- * @property {string,number} value.value - Value of the option
863
- */
864
- items: {
865
- type: Array,
866
- required: !0
867
- }
868
- },
869
- emits: ["unselect-item", "unselect-category"],
870
- setup(e, { emit: t }) {
871
- const { t: a } = ue({ messages: Be }), b = (l) => l.items ? t("unselect-category", l) : t("unselect-item", l.value);
872
- return (l, i) => (v(), T("div", Ot, [
873
- (v(!0), T(X, null, F(e.items, (n) => (v(), T("div", {
874
- key: `selected-${n.value}`
875
- }, [
876
- $(re(Xe), {
877
- class: "b-listbox-multi-select-chips__chip",
878
- disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
879
- onClick: (s) => b(n)
880
- }, {
881
- iconRight: E(() => [
882
- $(re(Je), {
883
- "svg-title": re(a)("remove")
884
- }, null, 8, ["svg-title"])
885
- ]),
886
- default: E(() => [
887
- $(re(Q), {
888
- el: "span",
889
- variant: "caption",
890
- class: "b-listbox-multi-select-chips__option-text"
891
- }, {
892
- default: E(() => [
893
- w(x(n.label), 1)
894
- ]),
895
- _: 2
896
- }, 1024)
897
- ]),
898
- _: 2
899
- }, 1032, ["disabled", "onClick"])
900
- ]))), 128))
901
- ]));
902
- }
903
- });
904
- const It = /* @__PURE__ */ H(At, [["__scopeId", "data-v-77ad1d28"]]), Ee = {
905
- "en-US": {
906
- allSelected: "All selected ({total})",
907
- numberOfTotalSelected: "{number} of {total} selected",
908
- selectAll: "Select all ({total})"
909
- }
910
- }, $t = (e) => {
911
- const t = m(() => {
912
- var b;
913
- return !!((b = e.value) != null && b.find(({ items: l }) => !!l));
914
- }), a = m(() => {
915
- var b;
916
- return t.value ? (b = e.value) == null ? void 0 : b.reduce((l, i) => (i.items ? l.push(...i.items.flat()) : l.push(i), l), []) : e.value;
917
- });
918
- return {
919
- isMultiLevelSelect: t,
920
- flattenedItemsList: a
921
- };
922
- }, Bt = q({
923
- i18n: { messages: Ee },
924
- name: "bento-listbox-multi-select",
925
- components: {
926
- BentoCheckbox: Se,
927
- BentoListboxOption: be,
928
- BentoTypography: Q,
929
- ListboxMultiSelectOptions: Tt,
930
- ListboxMultiSelectChips: It
931
- },
932
- directives: { BentoKeyboardNavigationDirective: _e },
933
- props: {
934
- /**
935
- * Function that allows the options to be disabled
936
- *
937
- * @type {BentoListboxIsOptionDisabled}
938
- * @param {BentoListboxOptionItem} option - listbox option object
939
- * @param {string} option.label - Option's label text
940
- * @param {string|number} option.value - Option's value
941
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
942
- */
943
- isOptionDisabled: {
944
- type: Function,
945
- default: () => !1
946
- },
947
- /**
948
- * The option elements to populate the listbox with.
949
- * It must be an array of {@see BentoListboxOptionItem }.
950
- *
951
- * @property {string} value.label - Text to be displayed in the option
952
- * @property {string,number} value.value - Value of the option
953
- */
954
- items: {
955
- type: Array,
956
- required: !0
957
- },
958
- /**
959
- * Flag that indicates that an external search it's being made
960
- * to filter out the items inside the the multi-select listbox
961
- *
962
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
963
- */
964
- searching: { type: Boolean, default: !1 },
965
- /**
966
- * The `input` value.
967
- * Providing an empty array will select no options.
968
- */
969
- selectedValues: {
970
- type: Array,
971
- default: () => []
972
- },
973
- /**
974
- * If enabled, dropdown will display non-selectable, static categories
975
- */
976
- staticCategories: { type: Boolean, default: !1 }
977
- },
978
- emits: [r.SELECT],
979
- setup(e, { emit: t, slots: a }) {
980
- const { t: b } = ue({ messages: Ee }), l = M(null), i = M(null), n = M(null), s = M();
981
- Le(
982
- () => e.selectedValues,
983
- () => {
984
- s.value = [...e.selectedValues ?? []];
985
- },
986
- {
987
- immediate: !0
988
- }
989
- );
990
- const { isMultiLevelSelect: d, flattenedItemsList: o } = $t(de(e, "items")), f = (p) => {
991
- var A;
992
- const y = e.isOptionDisabled(p), h = ((A = s.value) == null ? void 0 : A.includes(p.value)) || !1;
993
- return { isDisabled: y, isPreSelected: h };
994
- }, c = m(
995
- () => e.searching && d ? e.items : o.value.filter((p) => {
996
- const { isDisabled: y, isPreSelected: h } = f(p);
997
- return y && h || !y;
998
- })
999
- ), g = m(
1000
- () => {
1001
- var p;
1002
- return (p = c.value) == null ? void 0 : p.filter((y) => {
1003
- var h;
1004
- return y.items && d.value && e.searching ? y.items.filter(
1005
- (B) => (e.selectedValues ?? []).includes(
1006
- B.value
1007
- )
1008
- ).length === y.items.length : (h = s.value) == null ? void 0 : h.includes(y.value);
1009
- });
1010
- }
1011
- ), u = () => d.value && !e.searching ? o.value.length : e.items.length, S = m(() => {
1012
- var A;
1013
- const p = c.value.length, y = u(), h = ((A = g.value) == null ? void 0 : A.length) || 0;
1014
- return h === 0 ? b("selectAll", { total: p }) : h === y ? b("allSelected", { total: y }) : b("numberOfTotalSelected", { number: h, total: y });
1015
- }), I = (p) => {
1016
- const y = (A) => {
1017
- const { isDisabled: B, isPreSelected: ne } = f(A);
1018
- return B && ne || !B;
1019
- }, h = p.filter(y).filter((A) => !s.value.includes(A.value)).map(({ value: A }) => A);
1020
- s.value = [...s.value, ...h], t(r.SELECT, s.value);
1021
- }, P = (p) => {
1022
- const y = (A) => {
1023
- const { isDisabled: B, isPreSelected: ne } = f(A);
1024
- return !(B && ne);
1025
- }, h = p.filter(y).map(({ value: A }) => A);
1026
- s.value = s.value.filter((A) => !(h != null && h.includes(A))), t(r.SELECT, s.value);
1027
- }, O = () => {
1028
- I(o.value);
1029
- }, D = () => {
1030
- P(o.value);
1031
- }, { isAllSelected: R, isIndeterminate: _, toggleSelectAll: L } = Ie(
1032
- g,
1033
- c,
1034
- O,
1035
- D
1036
- ), U = (p) => {
1037
- I(p.items);
1038
- }, Z = (p) => {
1039
- P(p.items);
1040
- }, me = (p, y) => {
1041
- let h = !1;
1042
- s.value = s.value.filter((A) => y === A ? (h = !0, !1) : !0), h || s.value.push(y), t(p, s.value);
1043
- }, le = m(() => {
1044
- const p = (B) => s.value.includes(B.value), y = (B) => !e.staticCategories && B.every((ne) => p(ne));
1045
- return e.items.flatMap(
1046
- (B) => B.items && !y(B.items) ? B.items : B
1047
- ).filter((B) => B.items ? !0 : p(B));
1048
- }), ve = m(
1049
- () => {
1050
- var p, y, h;
1051
- return ((p = le.value) == null ? void 0 : p.length) > 0 && ((y = g.value) == null ? void 0 : y.length) !== ((h = o.value) == null ? void 0 : h.length);
1052
- }
1053
- ), N = m(
1054
- () => l.value ? [l.value] : []
1055
- ), oe = m(
1056
- () => {
1057
- var p, y;
1058
- return (y = (p = i.value) == null ? void 0 : p.$children) != null && y.length ? i.value.$children : [];
1059
- }
1060
- ), Re = m(
1061
- () => {
1062
- var p, y;
1063
- return (y = (p = n.value) == null ? void 0 : p.$children) != null && y.length ? n.value.$children : [];
1064
- }
1065
- ), De = m(() => ({ label: S, value: R })), Ne = m(() => [
1066
- De,
1067
- ...le.value,
1068
- ...o.value
1069
- ]), Me = (p) => {
1070
- [
1071
- ...N.value,
1072
- ...oe.value,
1073
- ...Re.value
1074
- ][p].$el.focus();
1075
- }, { moveToNextElement: Pe, moveToPreviousElement: Ue, moveToFirstElement: we, moveToLastElement: xe } = $e(
1076
- {
1077
- items: M(Ne),
1078
- isOptionDisabled: e.isOptionDisabled
1079
- },
1080
- Me
1081
- ), Ve = {
1082
- [K.ARROW_UP]: (p) => Ue(p),
1083
- [K.ARROW_DOWN]: (p) => Pe(p),
1084
- [K.HOME]: we,
1085
- [K.END]: xe
1086
- };
1087
- return {
1088
- // Refs
1089
- selectAllListboxItemsRef: l,
1090
- selectedListboxItemsRef: i,
1091
- listboxItemsRef: n,
1092
- // Values
1093
- isAllSelected: R,
1094
- showSelectedItems: ve,
1095
- isIndeterminate: _,
1096
- isMultiLevelSelect: d,
1097
- flattenedItemsList: o,
1098
- selectedItemsList: s,
1099
- selectAllCheckboxText: S,
1100
- selectedOptions: le,
1101
- slots: a,
1102
- // Enums
1103
- BentoListboxEvent: r,
1104
- // Methods
1105
- selectAllCategory: U,
1106
- toggleCheckboxSelection: me,
1107
- toggleSelectAll: L,
1108
- unselectAllCategory: Z,
1109
- // Events
1110
- listboxListeners: Ve
1111
- };
1112
- }
1113
- });
1114
- const ke = (e) => (Fe("data-v-5da1ae45"), e = e(), Ye(), e), kt = { key: 0 }, Rt = /* @__PURE__ */ ke(() => /* @__PURE__ */ z("hr", { class: "b-listbox-multi-select__divider" }, null, -1)), Dt = /* @__PURE__ */ ke(() => /* @__PURE__ */ z("hr", { class: "b-listbox-multi-select__divider" }, null, -1));
1115
- function Nt(e, t, a, b, l, i) {
1116
- const n = C("bento-checkbox"), s = C("bento-typography"), d = C("bento-listbox-option"), o = C("listbox-multi-select-chips"), f = C("listbox-multi-select-options"), c = ye("bento-keyboard-navigation-directive");
1117
- return ce((v(), T("div", V({ class: "b-listbox-multi-select" }, se(e.listboxListeners, !0)), [
1118
- $(d, {
1119
- ref: "selectAllListboxItemsRef",
1120
- class: "b-listbox-multi-select__option"
1121
- }, {
1122
- default: E(() => [
1123
- $(n, {
1124
- "aria-label": e.selectAllCheckboxText,
1125
- "model-value": e.isAllSelected,
1126
- indeterminate: e.isIndeterminate,
1127
- "onUpdate:modelValue": e.toggleSelectAll
1128
- }, null, 8, ["aria-label", "model-value", "indeterminate", "onUpdate:modelValue"]),
1129
- $(s, { el: "span" }, {
1130
- default: E(() => [
1131
- w(x(e.selectAllCheckboxText), 1)
1132
- ]),
1133
- _: 1
1134
- })
1135
- ]),
1136
- _: 1
1137
- }, 512),
1138
- e.showSelectedItems ? (v(), T("div", kt, [
1139
- Rt,
1140
- $(o, {
1141
- ref: "selectedListboxItemsRef",
1142
- items: e.selectedOptions,
1143
- "is-option-disabled": e.isOptionDisabled,
1144
- onUnselectCategory: e.unselectAllCategory,
1145
- onUnselectItem: t[0] || (t[0] = (g) => e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, g))
1146
- }, null, 8, ["items", "is-option-disabled", "onUnselectCategory"])
1147
- ])) : J("", !0),
1148
- Dt,
1149
- $(f, V({
1150
- ref: "listboxItemsRef",
1151
- items: e.items,
1152
- "is-option-disabled": e.isOptionDisabled,
1153
- "is-multi-level": e.isMultiLevelSelect,
1154
- "static-categories": e.staticCategories,
1155
- searching: e.searching,
1156
- "selected-items-list": e.selectedItemsList,
1157
- onToggleCheckboxSelection: t[1] || (t[1] = (g) => e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, g)),
1158
- onSelectCategory: e.selectAllCategory,
1159
- onUnselectCategory: e.unselectAllCategory
1160
- }, {
1161
- [te(e.BentoListboxEvent.SPACE)]: t[2] || (t[2] = (g) => e.toggleCheckboxSelection(e.BentoListboxEvent.SPACE, g))
1162
- }, {
1163
- [te(e.BentoListboxEvent.TAB)]: t[3] || (t[3] = (g) => e.toggleCheckboxSelection(e.BentoListboxEvent.TAB, g))
1164
- }, {
1165
- [te(e.BentoListboxEvent.ENTER)]: t[4] || (t[4] = (g) => e.toggleCheckboxSelection(e.BentoListboxEvent.ENTER, g))
1166
- }), ae({ _: 2 }, [
1167
- F(e.slots, (g, u) => ({
1168
- name: u,
1169
- fn: E((S) => [
1170
- G(e.$slots, u, Y(W(S)), void 0, !0)
1171
- ])
1172
- }))
1173
- ]), 1040, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "onSelectCategory", "onUnselectCategory"])
1174
- ], 16)), [
1175
- [c]
1176
- ]);
1177
- }
1178
- const he = /* @__PURE__ */ H(Bt, [["render", Nt], ["__scopeId", "data-v-5da1ae45"]]), Te = {
1179
- "en-US": {
1180
- showMore: "Show more",
1181
- loading: "Loading"
1182
- }
1183
- }, Mt = 36, Pt = q({
1184
- name: "bento-listbox",
1185
- components: {
1186
- BentoEmptyState: ze,
1187
- BentoListboxSingleSelect: vt,
1188
- BentoListboxMultiSelect: he,
1189
- BentoTypography: Q,
1190
- BentoLoadingIndicator: Ke,
1191
- BentoLoadingButton: Qe
1192
- },
1193
- directives: { BentoKeyboardNavigationDirective: _e },
1194
- i18n: { messages: Te },
1195
- props: {
1196
- /**
1197
- * Defines a string value that labels an interactive element.
1198
- */
1199
- ariaLabel: { type: String, default: null },
1200
- /**
1201
- * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
1202
- */
1203
- emptyState: {
1204
- type: Object,
1205
- default: void 0
1206
- },
1207
- /**
1208
- * Indicates whether there are more items to load
1209
- */
1210
- hasMoreItems: { type: Boolean, default: !1 },
1211
- /**
1212
- * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
1213
- */
1214
- id: { type: String, required: !0 },
1215
- /**
1216
- * Function that allows the options to be disabled
1217
- *
1218
- * @type {BentoListboxIsOptionDisabled}
1219
- * @param {BentoListboxOptionItem} option - Listbox option object
1220
- * @param {string} option.label - Option's label text
1221
- * @param {string|number} option.value - Option's value
1222
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
1223
- */
1224
- isOptionDisabled: {
1225
- type: Function,
1226
- default: () => {
1227
- }
1228
- },
1229
- /**
1230
- * The option elements to populate the listbox with.
1231
- * It must be an array of {@see BentoListboxOptionItem }
1232
- * * @property {string} value.label - Text to be displayed in the option
1233
- * * @property {string,number} value.value - Value of the option
1234
- */
1235
- items: {
1236
- type: Array,
1237
- required: !0
1238
- },
1239
- /**
1240
- * Indicates if new options are loading.
1241
- */
1242
- loading: { type: Boolean, default: !1 },
1243
- /**
1244
- * The type of `Lazy Load`.
1245
- * Type "automatic" will enable infinite scrolling
1246
- * Type "button" will enable lazy loading with "Show more" button
1247
- */
1248
- lazyLoadType: {
1249
- type: String,
1250
- default: ee.NONE,
1251
- validator: (e) => Object.values(ee).includes(e)
1252
- },
1253
- /**
1254
- * If enabled, the user will be able to select multiple items.
1255
- */
1256
- multiple: { type: Boolean, default: !1 },
1257
- /**
1258
- * If enabled, dropdown will display non-selectable, static categories
1259
- */
1260
- staticCategories: { type: Boolean, default: !1 },
1261
- /**
1262
- * Messaged displayed when no items are listed in the listbox
1263
- */
1264
- noResultsMessage: { type: String, required: !0 },
1265
- /**
1266
- * Flag that indicates that an external search it's being made
1267
- * to filter out the items inside the the multi-select listbox
1268
- *
1269
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
1270
- */
1271
- searching: he.props.searching,
1272
- /**
1273
- * The `input` value.
1274
- * Providing an empty string or empty array will select no options.
1275
- * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1276
- */
1277
- selectedValue: {
1278
- type: [String, Number, Array],
1279
- default: void 0
1280
- },
1281
- /**
1282
- * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
1283
- * The itemHeight function is used to calculate the height of rendered item given it's index.
1284
- */
1285
- virtualScroll: {
1286
- type: [Boolean, Object],
1287
- default: !1
1288
- }
1289
- },
1290
- emits: [
1291
- r.SELECT,
1292
- r.SPACE,
1293
- r.SHOW_MORE,
1294
- r.ENTER,
1295
- r.ESCAPE,
1296
- r.TAB
1297
- ],
1298
- setup(e, { emit: t, slots: a }) {
1299
- const b = M([]), l = de(e, "items"), { t: i } = ue({ messages: Te }), n = m(() => e.lazyLoadType !== ee.AUTOMATIC), s = m(() => e.lazyLoadType === ee.AUTOMATIC), d = () => {
1300
- var N;
1301
- return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((N = e == null ? void 0 : e.virtualScroll) != null && N.itemHeight) ? e.virtualScroll.itemHeight : Mt;
1302
- }, {
1303
- containerRef: o,
1304
- containerProps: f,
1305
- onScroll: c,
1306
- list: g,
1307
- wrapperProps: u
1308
- } = et(l, {
1309
- itemHeight: d(),
1310
- // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
1311
- disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
1312
- }), S = m(
1313
- () => n.value ? "true" : void 0
1314
- ), I = m(
1315
- () => n.value && e.loading ? "true" : "false"
1316
- ), P = m(
1317
- () => n.value ? "polite" : void 0
1318
- ), O = (N) => (oe) => {
1319
- t(N, oe);
1320
- }, D = () => {
1321
- t(r.SHOW_MORE);
1322
- }, R = We(() => {
1323
- const N = o.value;
1324
- if (!N)
1325
- return;
1326
- const oe = Math.round(N.scrollTop) + N.clientHeight >= N.scrollHeight;
1327
- e.hasMoreItems && oe && !e.loading && D();
1328
- }), _ = () => {
1329
- s.value ? R() : c();
1330
- }, L = m(() => {
1331
- var N;
1332
- return e.searching && ((N = e.items) == null ? void 0 : N.length) === 0;
1333
- }), U = m(
1334
- () => e.lazyLoadType === ee.BUTTON && e.hasMoreItems
1335
- ), Z = m(
1336
- () => e.loading ? Ce.LOADING : Ce.START
1337
- ), me = m(() => e.loading ? i("loading") : i("showMore")), le = m(() => ({
1338
- ...e.emptyState,
1339
- variant: "condensed"
1340
- })), ve = {
1341
- [r.SELECT]: O(r.SELECT),
1342
- [r.SPACE]: O(r.SPACE),
1343
- [r.TAB]: O(r.TAB),
1344
- [r.ENTER]: O(r.ENTER)
1345
- };
1346
- return {
1347
- // Refs
1348
- listboxRef: o,
1349
- listboxItemRef: b,
1350
- // a11y
1351
- ariaAtomic: S,
1352
- ariaBusy: I,
1353
- ariaLive: P,
1354
- // Values
1355
- containerProps: f,
1356
- isSearchResultEmpty: L,
1357
- limitedEmptyStateProps: le,
1358
- loadingButtonState: Z,
1359
- slots: a,
1360
- shouldDisplayShowMoreButton: U,
1361
- showMoreButtonText: me,
1362
- virtualisedItems: g,
1363
- wrapperProps: u,
1364
- // Enums
1365
- BentoKeyboardNavigationKeyDownEvent: K,
1366
- BentoListboxEvent: r,
1367
- // Methods
1368
- onListboxContainerScroll: _,
1369
- onOptionSelected: O,
1370
- emitShowMore: D,
1371
- listboxListeners: ve
1372
- };
1373
- }
1374
- });
1375
- const Ut = ["id", "aria-busy", "aria-atomic", "aria-label", "aria-live"], wt = {
1376
- key: 0,
1377
- class: "b-listbox__empty-search-message"
1378
- }, xt = {
1379
- key: 2,
1380
- class: "b-listbox__lazy-load"
1381
- }, Vt = {
1382
- key: 3,
1383
- class: "b-listbox__lazy-load"
1384
- };
1385
- function Gt(e, t, a, b, l, i) {
1386
- const n = C("bento-empty-state"), s = C("bento-typography"), d = C("bento-listbox-multi-select"), o = C("bento-listbox-single-select"), f = C("bento-loading-button"), c = C("bento-loading-indicator"), g = ye("bento-keyboard-navigation-directive");
1387
- return ce((v(), T("div", V({ id: e.id }, e.containerProps, {
1388
- class: "b-listbox",
1389
- role: "listbox",
1390
- tabindex: "-1",
1391
- "aria-busy": e.ariaBusy,
1392
- "aria-atomic": e.ariaAtomic,
1393
- "aria-label": e.ariaLabel,
1394
- "aria-live": e.ariaLive,
1395
- onScroll: t[0] || (t[0] = (...u) => e.onListboxContainerScroll && e.onListboxContainerScroll(...u))
1396
- }), [
1397
- z("div", Y(W(e.wrapperProps)), [
1398
- e.isSearchResultEmpty ? (v(), T("div", wt, [
1399
- e.emptyState ? (v(), k(n, Y(V({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (v(), k(s, {
1400
- key: 1,
1401
- el: "span"
1402
- }, {
1403
- default: E(() => [
1404
- w(x(e.noResultsMessage), 1)
1405
- ]),
1406
- _: 1
1407
- }))
1408
- ])) : (v(), T(X, { key: 1 }, [
1409
- e.multiple ? (v(), k(d, V({
1410
- key: 0,
1411
- ref: "listboxItemRef",
1412
- items: e.items,
1413
- "static-categories": e.staticCategories,
1414
- "selected-values": e.selectedValue,
1415
- searching: e.searching,
1416
- "is-option-disabled": e.isOptionDisabled
1417
- }, se(e.listboxListeners)), ae({ _: 2 }, [
1418
- F(e.slots, (u, S) => ({
1419
- name: S,
1420
- fn: E((I) => [
1421
- G(e.$slots, S, Y(W(I)), void 0, !0)
1422
- ])
1423
- }))
1424
- ]), 1040, ["items", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (v(), k(o, V({
1425
- key: 1,
1426
- ref: "listboxItemRef",
1427
- items: e.virtualisedItems,
1428
- "selected-value": e.selectedValue,
1429
- "static-categories": e.staticCategories,
1430
- "is-option-disabled": e.isOptionDisabled
1431
- }, se(e.listboxListeners)), ae({ _: 2 }, [
1432
- F(e.slots, (u, S) => ({
1433
- name: S,
1434
- fn: E((I) => [
1435
- G(e.$slots, S, Y(W(I)), void 0, !0)
1436
- ])
1437
- }))
1438
- ]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
1439
- e.shouldDisplayShowMoreButton ? (v(), T("div", xt, [
1440
- $(f, {
1441
- state: e.loadingButtonState,
1442
- variant: "secondary",
1443
- onClickCapture: e.emitShowMore
1444
- }, {
1445
- default: E(() => [
1446
- w(x(e.showMoreButtonText), 1)
1447
- ]),
1448
- _: 1
1449
- }, 8, ["state", "onClickCapture"])
1450
- ])) : e.loading ? (v(), T("div", Vt, [
1451
- $(c)
1452
- ])) : J("", !0)
1453
- ], 64))
1454
- ], 16)
1455
- ], 16, Ut)), [
1456
- [g]
1457
- ]);
1458
- }
1459
- const ls = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4110c0cb"]]);
1460
- export {
1461
- ls as B,
1462
- ee as a,
1463
- r as b,
1464
- $t as u
1465
- };
1466
- //# sourceMappingURL=listbox.b6a1aea2.js.map