@adyen/bento-mcp 0.0.0 → 0.1.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 (410) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +113 -0
  4. package/dist/assets/components/accordion/accordion.docs.mdx +77 -0
  5. package/dist/assets/components/accordion/accordion.stories.ts +1 -0
  6. package/dist/assets/components/accordion/accordion.vue +1 -0
  7. package/dist/assets/components/accordion/components/accordion-item.stories.ts +1 -0
  8. package/dist/assets/components/accordion/components/accordion-item.vue +1 -0
  9. package/dist/assets/components/action-bar/action-bar.docs.mdx +103 -0
  10. package/dist/assets/components/action-bar/action-bar.stories.ts +1 -0
  11. package/dist/assets/components/action-bar/action-bar.vue +1 -0
  12. package/dist/assets/components/alert/alert.docs.mdx +106 -0
  13. package/dist/assets/components/alert/alert.stories.ts +1 -0
  14. package/dist/assets/components/alert/alert.vue +1 -0
  15. package/dist/assets/components/avatar/avatar.docs.mdx +44 -0
  16. package/dist/assets/components/avatar/avatar.stories.ts +1 -0
  17. package/dist/assets/components/avatar/avatar.vue +1 -0
  18. package/dist/assets/components/avatar/components/avatar-image/avatar-image.vue +1 -0
  19. package/dist/assets/components/button/button.docs.mdx +137 -0
  20. package/dist/assets/components/button/button.stories.ts +1 -0
  21. package/dist/assets/components/button/button.vue +1 -0
  22. package/dist/assets/components/button/components/ai-button/ai-button.docs.mdx +40 -0
  23. package/dist/assets/components/button/components/ai-button/ai-button.stories.ts +1 -0
  24. package/dist/assets/components/button/components/ai-button/ai-button.vue +1 -0
  25. package/dist/assets/components/button/components/button-actions/button-actions.docs.mdx +169 -0
  26. package/dist/assets/components/button/components/button-actions/button-actions.stories.ts +1 -0
  27. package/dist/assets/components/button/components/button-actions/button-actions.vue +1 -0
  28. package/dist/assets/components/button/components/loading-button/loading-button.docs.mdx +106 -0
  29. package/dist/assets/components/button/components/loading-button/loading-button.stories.ts +1 -0
  30. package/dist/assets/components/button/components/loading-button/loading-button.vue +1 -0
  31. package/dist/assets/components/button/components/toggle-button/toggle-button.docs.mdx +81 -0
  32. package/dist/assets/components/button/components/toggle-button/toggle-button.stories.ts +1 -0
  33. package/dist/assets/components/button/components/toggle-button/toggle-button.vue +1 -0
  34. package/dist/assets/components/card/card.docs.mdx +166 -0
  35. package/dist/assets/components/card/card.stories.ts +1 -0
  36. package/dist/assets/components/card/card.vue +1 -0
  37. package/dist/assets/components/checkbox/checkbox.docs.mdx +116 -0
  38. package/dist/assets/components/checkbox/checkbox.stories.ts +1 -0
  39. package/dist/assets/components/checkbox/checkbox.vue +1 -0
  40. package/dist/assets/components/checkbox/components/checkbox-group/checkbox-group.docs.mdx +134 -0
  41. package/dist/assets/components/checkbox/components/checkbox-group/checkbox-group.stories.ts +1 -0
  42. package/dist/assets/components/checkbox/components/checkbox-group/checkbox-group.vue +1 -0
  43. package/dist/assets/components/chip/chip.docs.mdx +51 -0
  44. package/dist/assets/components/chip/chip.stories.ts +1 -0
  45. package/dist/assets/components/chip/chip.vue +1 -0
  46. package/dist/assets/components/click-outside/click-outside.docs.mdx +30 -0
  47. package/dist/assets/components/click-outside/click-outside.stories.ts +1 -0
  48. package/dist/assets/components/code-snippet/code-snippet.docs.mdx +73 -0
  49. package/dist/assets/components/code-snippet/code-snippet.stories.ts +1 -0
  50. package/dist/assets/components/code-snippet/code-snippet.vue +1 -0
  51. package/dist/assets/components/country/country.docs.mdx +61 -0
  52. package/dist/assets/components/country/country.stories.ts +1 -0
  53. package/dist/assets/components/country/country.vue +1 -0
  54. package/dist/assets/components/currency/currency.docs.mdx +38 -0
  55. package/dist/assets/components/currency/currency.stories.ts +1 -0
  56. package/dist/assets/components/currency/currency.vue +1 -0
  57. package/dist/assets/components/dashed-underline/dashed-underline.docs.mdx +57 -0
  58. package/dist/assets/components/dashed-underline/dashed-underline.stories.ts +1 -0
  59. package/dist/assets/components/dashed-underline/dashed-underline.vue +1 -0
  60. package/dist/assets/components/data-grid/components/data-grid-cell/data-grid-cell.vue +1 -0
  61. package/dist/assets/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue +1 -0
  62. package/dist/assets/components/data-grid/components/data-grid-columns/data-grid-columns.vue +1 -0
  63. package/dist/assets/components/data-grid/components/data-grid-config-settings/components/data-grid-config-settings-column-row/data-grid-config-settings-column-row.vue +1 -0
  64. package/dist/assets/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue +1 -0
  65. package/dist/assets/components/data-grid/components/data-grid-lazy-load/data-grid-lazy-load.vue +1 -0
  66. package/dist/assets/components/data-grid/components/data-grid-row/data-grid-row.vue +1 -0
  67. package/dist/assets/components/data-grid/components/data-grid-static-icon/data-grid-static-icon.docs.mdx +61 -0
  68. package/dist/assets/components/data-grid/components/data-grid-static-icon/data-grid-static-icon.stories.ts +1 -0
  69. package/dist/assets/components/data-grid/components/data-grid-static-icon/data-grid-static-icon.vue +1 -0
  70. package/dist/assets/components/data-grid/components/data-grid-summary-cell/data-grid-summary-cell.docs.mdx +56 -0
  71. package/dist/assets/components/data-grid/components/data-grid-summary-cell/data-grid-summary-cell.stories.ts +1 -0
  72. package/dist/assets/components/data-grid/components/data-grid-summary-cell/data-grid-summary-cell.vue +1 -0
  73. package/dist/assets/components/data-grid/components/data-grid-trend-cell/data-grid-trend-cell.docs.mdx +48 -0
  74. package/dist/assets/components/data-grid/components/data-grid-trend-cell/data-grid-trend-cell.stories.ts +1 -0
  75. package/dist/assets/components/data-grid/components/data-grid-trend-cell/data-grid-trend-cell.vue +1 -0
  76. package/dist/assets/components/data-grid/data-grid.docs.mdx +951 -0
  77. package/dist/assets/components/data-grid/data-grid.stories.ts +1 -0
  78. package/dist/assets/components/data-grid/data-grid.vue +1 -0
  79. package/dist/assets/components/date/date.docs.mdx +49 -0
  80. package/dist/assets/components/date/date.stories.ts +1 -0
  81. package/dist/assets/components/date/date.vue +1 -0
  82. package/dist/assets/components/date-picker/date-picker.docs.mdx +69 -0
  83. package/dist/assets/components/date-picker/date-picker.stories.ts +1 -0
  84. package/dist/assets/components/date-picker/date-picker.vue +1 -0
  85. package/dist/assets/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue +1 -0
  86. package/dist/assets/components/date-range-picker/date-range-picker.docs.mdx +168 -0
  87. package/dist/assets/components/date-range-picker/date-range-picker.stories.ts +1 -0
  88. package/dist/assets/components/date-range-picker/date-range-picker.vue +1 -0
  89. package/dist/assets/components/divider/divider.docs.mdx +27 -0
  90. package/dist/assets/components/divider/divider.stories.ts +1 -0
  91. package/dist/assets/components/divider/divider.vue +1 -0
  92. package/dist/assets/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue +1 -0
  93. package/dist/assets/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue +1 -0
  94. package/dist/assets/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue +1 -0
  95. package/dist/assets/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue +1 -0
  96. package/dist/assets/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.stories.ts +1 -0
  97. package/dist/assets/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue +1 -0
  98. package/dist/assets/components/dropdown/components/variants/dropdown-country/dropdown-country.stories.ts +1 -0
  99. package/dist/assets/components/dropdown/components/variants/dropdown-country/dropdown-country.vue +1 -0
  100. package/dist/assets/components/dropdown/components/variants/dropdown-currency/dropdown-currency.stories.ts +1 -0
  101. package/dist/assets/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue +1 -0
  102. package/dist/assets/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.stories.ts +1 -0
  103. package/dist/assets/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue +1 -0
  104. package/dist/assets/components/dropdown/components/variants/dropdown-tag/dropdown-tag.stories.ts +1 -0
  105. package/dist/assets/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue +1 -0
  106. package/dist/assets/components/dropdown/dropdown.docs.mdx +420 -0
  107. package/dist/assets/components/dropdown/dropdown.stories.ts +1 -0
  108. package/dist/assets/components/dropdown/dropdown.vue +1 -0
  109. package/dist/assets/components/empty-state/empty-state.docs.mdx +115 -0
  110. package/dist/assets/components/empty-state/empty-state.stories.ts +1 -0
  111. package/dist/assets/components/empty-state/empty-state.vue +1 -0
  112. package/dist/assets/components/file-uploader/components/file-uploader-file-card/components/file-uploader-file-card-animation/file-uploader-file-card-animation.vue +1 -0
  113. package/dist/assets/components/file-uploader/components/file-uploader-file-card/file-uploader-file-card.stories.ts +1 -0
  114. package/dist/assets/components/file-uploader/components/file-uploader-file-card/file-uploader-file-card.vue +1 -0
  115. package/dist/assets/components/file-uploader/components/file-uploader-restrictions/file-uploader-restrictions.stories.ts +1 -0
  116. package/dist/assets/components/file-uploader/components/file-uploader-restrictions/file-uploader-restrictions.vue +1 -0
  117. package/dist/assets/components/file-uploader/file-uploader.docs.mdx +117 -0
  118. package/dist/assets/components/file-uploader/file-uploader.stories.ts +1 -0
  119. package/dist/assets/components/file-uploader/file-uploader.vue +1 -0
  120. package/dist/assets/components/filter-bar/components/all-filters-modal/all-filters-modal.stories.ts +1 -0
  121. package/dist/assets/components/filter-bar/components/all-filters-modal/all-filters-modal.vue +1 -0
  122. package/dist/assets/components/filter-bar/components/all-filters-modal/components/all-filters-modal-button/all-filters-modal-button.vue +1 -0
  123. package/dist/assets/components/filter-bar/components/base-filter/base-filter.docs.mdx +90 -0
  124. package/dist/assets/components/filter-bar/components/base-filter/base-filter.stories.ts +1 -0
  125. package/dist/assets/components/filter-bar/components/base-filter/base-filter.vue +1 -0
  126. package/dist/assets/components/filter-bar/components/base-filter-button/base-filter-button.vue +1 -0
  127. package/dist/assets/components/filter-bar/components/boolean-filter/boolean-filter.vue +1 -0
  128. package/dist/assets/components/filter-bar/components/checkbox-group-filter/checkbox-group-filter.stories.ts +1 -0
  129. package/dist/assets/components/filter-bar/components/checkbox-group-filter/checkbox-group-filter.vue +1 -0
  130. package/dist/assets/components/filter-bar/components/date-filter/date-filter.stories.ts +1 -0
  131. package/dist/assets/components/filter-bar/components/date-filter/date-filter.vue +1 -0
  132. package/dist/assets/components/filter-bar/components/date-range-filter/date-range-filter.stories.ts +1 -0
  133. package/dist/assets/components/filter-bar/components/date-range-filter/date-range-filter.vue +1 -0
  134. package/dist/assets/components/filter-bar/components/filter-bar-button/filter-bar-button.vue +1 -0
  135. package/dist/assets/components/filter-bar/components/filter-bar-button-group/filter-bar-button-group.vue +1 -0
  136. package/dist/assets/components/filter-bar/components/input-filter/input-filter.docs.mdx +18 -0
  137. package/dist/assets/components/filter-bar/components/input-filter/input-filter.stories.ts +1 -0
  138. package/dist/assets/components/filter-bar/components/input-filter/input-filter.vue +1 -0
  139. package/dist/assets/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.docs.mdx +18 -0
  140. package/dist/assets/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.stories.ts +1 -0
  141. package/dist/assets/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.vue +1 -0
  142. package/dist/assets/components/filter-bar/components/radio-group-filter/radio-group-filter.stories.ts +1 -0
  143. package/dist/assets/components/filter-bar/components/radio-group-filter/radio-group-filter.vue +1 -0
  144. package/dist/assets/components/filter-bar/components/range-filter/range-filter.vue +1 -0
  145. package/dist/assets/components/filter-bar/components/select-filter/components/select-filter-button/select-filter-button.vue +1 -0
  146. package/dist/assets/components/filter-bar/components/select-filter/components/select-filter-dropdown/select-filter-dropdown.vue +1 -0
  147. package/dist/assets/components/filter-bar/components/select-filter/select-filter.stories.ts +1 -0
  148. package/dist/assets/components/filter-bar/components/select-filter/select-filter.vue +1 -0
  149. package/dist/assets/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.stories.ts +1 -0
  150. package/dist/assets/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.vue +1 -0
  151. package/dist/assets/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.stories.ts +1 -0
  152. package/dist/assets/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue +1 -0
  153. package/dist/assets/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.stories.ts +1 -0
  154. package/dist/assets/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.vue +1 -0
  155. package/dist/assets/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.stories.ts +1 -0
  156. package/dist/assets/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.vue +1 -0
  157. package/dist/assets/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.stories.ts +1 -0
  158. package/dist/assets/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue +1 -0
  159. package/dist/assets/components/filter-bar/components/toggle-filter/toggle-filter.stories.ts +1 -0
  160. package/dist/assets/components/filter-bar/components/toggle-filter/toggle-filter.vue +1 -0
  161. package/dist/assets/components/filter-bar/filter-bar.docs.mdx +1005 -0
  162. package/dist/assets/components/filter-bar/filter-bar.stories.ts +1 -0
  163. package/dist/assets/components/filter-bar/filter-bar.vue +1 -0
  164. package/dist/assets/components/focus-trap/focus-trap.docs.mdx +10 -0
  165. package/dist/assets/components/focus-trap/focus-trap.stories.ts +1 -0
  166. package/dist/assets/components/focus-trap/focus-trap.vue +1 -0
  167. package/dist/assets/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue +1 -0
  168. package/dist/assets/components/form-layout/components/form-layout-group/form-layout-group.vue +1 -0
  169. package/dist/assets/components/form-layout/components/form-layout-title/form-layout-title.vue +1 -0
  170. package/dist/assets/components/form-layout/form-layout.docs.mdx +452 -0
  171. package/dist/assets/components/form-layout/form-layout.stories.ts +1 -0
  172. package/dist/assets/components/form-layout/form-layout.vue +1 -0
  173. package/dist/assets/components/header/header.docs.mdx +85 -0
  174. package/dist/assets/components/header/header.stories.ts +1 -0
  175. package/dist/assets/components/header/header.vue +1 -0
  176. package/dist/assets/components/header-with-views/components/header-with-views-all-views/header-with-views-all-views.vue +1 -0
  177. package/dist/assets/components/header-with-views/components/header-with-views-item-edit-form/header-with-views-edit-form.vue +1 -0
  178. package/dist/assets/components/header-with-views/header-with-views.docs.mdx +103 -0
  179. package/dist/assets/components/header-with-views/header-with-views.stories.ts +1 -0
  180. package/dist/assets/components/header-with-views/header-with-views.vue +1 -0
  181. package/dist/assets/components/image/image.docs.mdx +34 -0
  182. package/dist/assets/components/image/image.stories.ts +1 -0
  183. package/dist/assets/components/image/image.vue +1 -0
  184. package/dist/assets/components/info-icon/info-icon.docs.mdx +57 -0
  185. package/dist/assets/components/info-icon/info-icon.stories.ts +1 -0
  186. package/dist/assets/components/info-icon/info-icon.vue +1 -0
  187. package/dist/assets/components/input-field/input-field.docs.mdx +141 -0
  188. package/dist/assets/components/input-field/input-field.stories.ts +1 -0
  189. package/dist/assets/components/input-field/input-field.vue +1 -0
  190. package/dist/assets/components/input-field-password/input-field-password.docs.mdx +292 -0
  191. package/dist/assets/components/input-field-password/input-field-password.stories.ts +1 -0
  192. package/dist/assets/components/input-field-password/input-field-password.vue +1 -0
  193. package/dist/assets/components/input-field-phone-number/input-field-phone-number.docs.mdx +72 -0
  194. package/dist/assets/components/input-field-phone-number/input-field-phone-number.stories.ts +1 -0
  195. package/dist/assets/components/input-field-phone-number/input-field-phone-number.vue +1 -0
  196. package/dist/assets/components/inspector/inspector.docs.mdx +118 -0
  197. package/dist/assets/components/inspector/inspector.stories.ts +1 -0
  198. package/dist/assets/components/inspector/inspector.vue +1 -0
  199. package/dist/assets/components/internal/base-button/base-button.vue +1 -0
  200. package/dist/assets/components/internal/button-actions-with-menu/button-actions-with-menu.stories.ts +1 -0
  201. package/dist/assets/components/internal/button-actions-with-menu/button-actions-with-menu.vue +1 -0
  202. package/dist/assets/components/internal/calendar/calendar.stories.ts +1 -0
  203. package/dist/assets/components/internal/calendar/calendar.vue +1 -0
  204. package/dist/assets/components/internal/calendar/components/calendar-month/calendar-month.stories.ts +1 -0
  205. package/dist/assets/components/internal/calendar/components/calendar-month/calendar-month.vue +1 -0
  206. package/dist/assets/components/internal/calendar/components/calendar-month/components/calendar-month-day/__test__/calendar-month-day-stub.vue +1 -0
  207. package/dist/assets/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.stories.ts +1 -0
  208. package/dist/assets/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.vue +1 -0
  209. package/dist/assets/components/internal/calendar/components/calendar-year/calendar-year.vue +1 -0
  210. package/dist/assets/components/internal/calendar/components/calendar-year/components/calendar-year-month/__test__/calendar-year-month-stub.vue +1 -0
  211. package/dist/assets/components/internal/calendar/components/calendar-year/components/calendar-year-month/calendar-year-month.vue +1 -0
  212. package/dist/assets/components/internal/checkbox-input/checkbox-input.stories.ts +1 -0
  213. package/dist/assets/components/internal/checkbox-input/checkbox-input.vue +1 -0
  214. package/dist/assets/components/internal/controls-group/controls-group.vue +1 -0
  215. package/dist/assets/components/internal/copy/copy.docs.mdx +43 -0
  216. package/dist/assets/components/internal/copy/copy.stories.ts +1 -0
  217. package/dist/assets/components/internal/copy/copy.vue +1 -0
  218. package/dist/assets/components/internal/decorative-checkbox/decorative-checkbox.vue +1 -0
  219. package/dist/assets/components/internal/dialog-page/dialog-page.vue +1 -0
  220. package/dist/assets/components/internal/error-message/error-message.vue +1 -0
  221. package/dist/assets/components/internal/field-label/field-label.vue +1 -0
  222. package/dist/assets/components/internal/fixed-scroller/fixed-scroller.docs.mdx +21 -0
  223. package/dist/assets/components/internal/fixed-scroller/fixed-scroller.stories.ts +1 -0
  224. package/dist/assets/components/internal/fixed-scroller/fixed-scroller.vue +1 -0
  225. package/dist/assets/components/internal/footer-actions/footer-actions.vue +1 -0
  226. package/dist/assets/components/internal/grid-layout/grid-layout.vue +1 -0
  227. package/dist/assets/components/internal/header-meta/header-meta.vue +1 -0
  228. package/dist/assets/components/internal/info-icon-with-popover/info-icon-with-popover.vue +1 -0
  229. package/dist/assets/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue +1 -0
  230. package/dist/assets/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue +1 -0
  231. package/dist/assets/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue +1 -0
  232. package/dist/assets/components/internal/listbox/components/listbox-option/listbox-option.vue +1 -0
  233. package/dist/assets/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue +1 -0
  234. package/dist/assets/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue +1 -0
  235. package/dist/assets/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue +1 -0
  236. package/dist/assets/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue +1 -0
  237. package/dist/assets/components/internal/listbox/listbox.stories.ts +1 -0
  238. package/dist/assets/components/internal/listbox/listbox.vue +1 -0
  239. package/dist/assets/components/internal/radio-input/radio-input.stories.ts +1 -0
  240. package/dist/assets/components/internal/radio-input/radio-input.vue +1 -0
  241. package/dist/assets/components/internal/teleport/teleport.vue +1 -0
  242. package/dist/assets/components/internal/tooltip/tooltip.test.vue +1 -0
  243. package/dist/assets/components/internal/tooltip/tooltip.vue +1 -0
  244. package/dist/assets/components/layout/components/layout-row/layout-row.stories.ts +1 -0
  245. package/dist/assets/components/layout/components/layout-row/layout-row.vue +1 -0
  246. package/dist/assets/components/layout/layout.docs.mdx +108 -0
  247. package/dist/assets/components/layout/layout.stories.ts +1 -0
  248. package/dist/assets/components/layout/layout.vue +1 -0
  249. package/dist/assets/components/link/link.docs.mdx +119 -0
  250. package/dist/assets/components/link/link.stories.ts +1 -0
  251. package/dist/assets/components/link/link.vue +1 -0
  252. package/dist/assets/components/loading-indicator/loading-indicator.docs.mdx +65 -0
  253. package/dist/assets/components/loading-indicator/loading-indicator.stories.ts +1 -0
  254. package/dist/assets/components/loading-indicator/loading-indicator.vue +1 -0
  255. package/dist/assets/components/menu/components/menu-item/menu-item.vue +1 -0
  256. package/dist/assets/components/menu/components/menu-item-list/menu-item-list.vue +1 -0
  257. package/dist/assets/components/menu/components/menu-list-container/menu-list-container.vue +1 -0
  258. package/dist/assets/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue +1 -0
  259. package/dist/assets/components/menu/menu.docs.mdx +121 -0
  260. package/dist/assets/components/menu/menu.stories.ts +1 -0
  261. package/dist/assets/components/menu/menu.vue +1 -0
  262. package/dist/assets/components/modal/components/base-modal/base-modal.vue +1 -0
  263. package/dist/assets/components/modal/components/modal-default/modal-default.vue +1 -0
  264. package/dist/assets/components/modal/components/modal-dialog/modal-dialog.vue +1 -0
  265. package/dist/assets/components/modal/components/modal-page/modal-page.vue +1 -0
  266. package/dist/assets/components/modal/modal.docs.mdx +215 -0
  267. package/dist/assets/components/modal/modal.stories.ts +1 -0
  268. package/dist/assets/components/modal/modal.vue +1 -0
  269. package/dist/assets/components/modal-fullscreen/components/modal-fullscreen-page.vue +1 -0
  270. package/dist/assets/components/modal-fullscreen/modal-fullscreen.docs.mdx +217 -0
  271. package/dist/assets/components/modal-fullscreen/modal-fullscreen.stories.ts +1 -0
  272. package/dist/assets/components/modal-fullscreen/modal-fullscreen.vue +1 -0
  273. package/dist/assets/components/pagination/components/pagination-context/pagination-context.vue +1 -0
  274. package/dist/assets/components/pagination/components/pagination-controls/pagination-controls.vue +1 -0
  275. package/dist/assets/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue +1 -0
  276. package/dist/assets/components/pagination/pagination.docs.mdx +116 -0
  277. package/dist/assets/components/pagination/pagination.stories.ts +1 -0
  278. package/dist/assets/components/pagination/pagination.vue +1 -0
  279. package/dist/assets/components/payment-method/payment-method.docs.mdx +34 -0
  280. package/dist/assets/components/payment-method/payment-method.stories.ts +1 -0
  281. package/dist/assets/components/payment-method/payment-method.vue +1 -0
  282. package/dist/assets/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue +1 -0
  283. package/dist/assets/components/popover/components/popover-image/popover-image.vue +1 -0
  284. package/dist/assets/components/popover/components/popover-title/popover-title.vue +1 -0
  285. package/dist/assets/components/popover/popover.docs.mdx +89 -0
  286. package/dist/assets/components/popover/popover.stories.ts +1 -0
  287. package/dist/assets/components/popover/popover.vue +1 -0
  288. package/dist/assets/components/popper-container/popper-container.docs.mdx +11 -0
  289. package/dist/assets/components/popper-container/popper-container.stories.ts +1 -0
  290. package/dist/assets/components/popper-container/popper-container.vue +1 -0
  291. package/dist/assets/components/promo-banner/promo-banner.docs.mdx +94 -0
  292. package/dist/assets/components/promo-banner/promo-banner.stories.ts +1 -0
  293. package/dist/assets/components/promo-banner/promo-banner.vue +1 -0
  294. package/dist/assets/components/radio-group/components/radio-button/radio-button.docs.mdx +76 -0
  295. package/dist/assets/components/radio-group/components/radio-button/radio-button.stories.ts +1 -0
  296. package/dist/assets/components/radio-group/components/radio-button/radio-button.vue +1 -0
  297. package/dist/assets/components/radio-group/radio-group.docs.mdx +154 -0
  298. package/dist/assets/components/radio-group/radio-group.stories.ts +1 -0
  299. package/dist/assets/components/radio-group/radio-group.vue +1 -0
  300. package/dist/assets/components/rich-text-editor/components/rich-text-editor-content-area/rich-text-editor-content-area.vue +1 -0
  301. package/dist/assets/components/rich-text-editor/components/rich-text-editor-renderer/components/rich-text-editor-code-block/rich-text-editor-code-block.vue +1 -0
  302. package/dist/assets/components/rich-text-editor/components/rich-text-editor-renderer/components/rich-text-editor-inline-code/rich-text-editor-inline-code.vue +1 -0
  303. package/dist/assets/components/rich-text-editor/components/rich-text-editor-renderer/components/rich-text-editor-link/rich-text-editor-link.vue +1 -0
  304. package/dist/assets/components/rich-text-editor/components/rich-text-editor-renderer/components/rich-text-editor-list-item/rich-text-editor-list-item.vue +1 -0
  305. package/dist/assets/components/rich-text-editor/components/rich-text-editor-renderer/components/rich-text-editor-table/rich-text-editor-table.vue +1 -0
  306. package/dist/assets/components/rich-text-editor/rich-text-editor.docs.mdx +52 -0
  307. package/dist/assets/components/rich-text-editor/rich-text-editor.stories.ts +1 -0
  308. package/dist/assets/components/rich-text-editor/rich-text-editor.vue +1 -0
  309. package/dist/assets/components/search-bar/search-bar.docs.mdx +117 -0
  310. package/dist/assets/components/search-bar/search-bar.stories.ts +1 -0
  311. package/dist/assets/components/search-bar/search-bar.vue +1 -0
  312. package/dist/assets/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue +1 -0
  313. package/dist/assets/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue +1 -0
  314. package/dist/assets/components/secondary-nav/secondary-nav.docs.mdx +40 -0
  315. package/dist/assets/components/secondary-nav/secondary-nav.stories.ts +1 -0
  316. package/dist/assets/components/secondary-nav/secondary-nav.vue +1 -0
  317. package/dist/assets/components/segmented-control/components/segmented-control-button/segmented-control-button.vue +1 -0
  318. package/dist/assets/components/segmented-control/segmented-control.docs.mdx +90 -0
  319. package/dist/assets/components/segmented-control/segmented-control.stories.ts +1 -0
  320. package/dist/assets/components/segmented-control/segmented-control.vue +1 -0
  321. package/dist/assets/components/selection-card/components/selection-card-group/selection-card-group.docs.mdx +119 -0
  322. package/dist/assets/components/selection-card/components/selection-card-group/selection-card-group.stories.ts +1 -0
  323. package/dist/assets/components/selection-card/components/selection-card-group/selection-card-group.vue +1 -0
  324. package/dist/assets/components/selection-card/selection-card.docs.mdx +108 -0
  325. package/dist/assets/components/selection-card/selection-card.stories.ts +1 -0
  326. package/dist/assets/components/selection-card/selection-card.vue +1 -0
  327. package/dist/assets/components/sidepanel/components/sidepanel-page.stories.ts +1 -0
  328. package/dist/assets/components/sidepanel/components/sidepanel-page.vue +1 -0
  329. package/dist/assets/components/sidepanel/sidepanel.docs.mdx +129 -0
  330. package/dist/assets/components/sidepanel/sidepanel.stories.ts +1 -0
  331. package/dist/assets/components/sidepanel/sidepanel.vue +1 -0
  332. package/dist/assets/components/status/status.docs.mdx +62 -0
  333. package/dist/assets/components/status/status.stories.ts +1 -0
  334. package/dist/assets/components/status/status.vue +1 -0
  335. package/dist/assets/components/stepper/components/step/step.stories.ts +1 -0
  336. package/dist/assets/components/stepper/components/step/step.vue +1 -0
  337. package/dist/assets/components/stepper/stepper.docs.mdx +127 -0
  338. package/dist/assets/components/stepper/stepper.stories.ts +1 -0
  339. package/dist/assets/components/stepper/stepper.vue +1 -0
  340. package/dist/assets/components/structured-list/components/structered-list-item/structured-list-item.stories.ts +1 -0
  341. package/dist/assets/components/structured-list/components/structered-list-item/structured-list-item.vue +1 -0
  342. package/dist/assets/components/structured-list/structured-list.docs.mdx +68 -0
  343. package/dist/assets/components/structured-list/structured-list.stories.ts +1 -0
  344. package/dist/assets/components/structured-list/structured-list.vue +1 -0
  345. package/dist/assets/components/summary-grid/components/summary-grid-item/summary-grid-item.vue +1 -0
  346. package/dist/assets/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.stories.ts +1 -0
  347. package/dist/assets/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue +1 -0
  348. package/dist/assets/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.stories.ts +1 -0
  349. package/dist/assets/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue +1 -0
  350. package/dist/assets/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.stories.ts +1 -0
  351. package/dist/assets/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue +1 -0
  352. package/dist/assets/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.stories.ts +1 -0
  353. package/dist/assets/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue +1 -0
  354. package/dist/assets/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.stories.ts +1 -0
  355. package/dist/assets/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue +1 -0
  356. package/dist/assets/components/summary-grid/summary-grid.docs.mdx +152 -0
  357. package/dist/assets/components/summary-grid/summary-grid.stories.ts +1 -0
  358. package/dist/assets/components/summary-grid/summary-grid.vue +1 -0
  359. package/dist/assets/components/tabs/components/tab.vue +1 -0
  360. package/dist/assets/components/tabs/tabs.docs.mdx +98 -0
  361. package/dist/assets/components/tabs/tabs.stories.ts +1 -0
  362. package/dist/assets/components/tabs/tabs.vue +1 -0
  363. package/dist/assets/components/tag/tag.docs.mdx +137 -0
  364. package/dist/assets/components/tag/tag.stories.ts +1 -0
  365. package/dist/assets/components/tag/tag.vue +1 -0
  366. package/dist/assets/components/textarea/textarea.docs.mdx +53 -0
  367. package/dist/assets/components/textarea/textarea.stories.ts +1 -0
  368. package/dist/assets/components/textarea/textarea.vue +1 -0
  369. package/dist/assets/components/timeline/components/timeline-item/timeline-item.stories.ts +1 -0
  370. package/dist/assets/components/timeline/components/timeline-item/timeline-item.vue +1 -0
  371. package/dist/assets/components/timeline/timeline.docs.mdx +131 -0
  372. package/dist/assets/components/timeline/timeline.stories.ts +1 -0
  373. package/dist/assets/components/timeline/timeline.vue +1 -0
  374. package/dist/assets/components/toast/components/toast-item/toast-item.vue +1 -0
  375. package/dist/assets/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue +1 -0
  376. package/dist/assets/components/toast/toast.docs.mdx +151 -0
  377. package/dist/assets/components/toast/toast.stories.ts +1 -0
  378. package/dist/assets/components/toast/toast.vue +1 -0
  379. package/dist/assets/components/toggle/toggle.docs.mdx +81 -0
  380. package/dist/assets/components/toggle/toggle.stories.ts +1 -0
  381. package/dist/assets/components/toggle/toggle.vue +1 -0
  382. package/dist/assets/components/tutorial/components/tutorial-popover/components/tutorial-indicator/tutorial-indicator.vue +1 -0
  383. package/dist/assets/components/tutorial/components/tutorial-popover/tutorial-popover.vue +1 -0
  384. package/dist/assets/components/tutorial/tutorial.docs.mdx +85 -0
  385. package/dist/assets/components/tutorial/tutorial.stories.ts +1 -0
  386. package/dist/assets/components/tutorial/tutorial.vue +1 -0
  387. package/dist/assets/components/typography/typography.docs.mdx +124 -0
  388. package/dist/assets/components/typography/typography.stories.ts +1 -0
  389. package/dist/assets/components/typography/typography.vue +1 -0
  390. package/dist/assets/composables/use-bento-currency/use-bento-currency.docs.mdx +28 -0
  391. package/dist/assets/composables/use-bento-currency/use-bento-currency.stories.ts +1 -0
  392. package/dist/assets/composables/use-click-outside/use-click-outside.docs.mdx +10 -0
  393. package/dist/assets/composables/use-click-outside/use-click-outside.stories.ts +1 -0
  394. package/dist/assets/directives/highlight/highlight.docs.mdx +64 -0
  395. package/dist/assets/directives/highlight/highlight.stories.ts +1 -0
  396. package/dist/assets/directives/keyboard-navigation/keyboard-navigation.docs.mdx +41 -0
  397. package/dist/assets/directives/keyboard-navigation/keyboard-navigation.stories.ts +1 -0
  398. package/dist/assets/directives/tooltip/tooltip.docs.mdx +86 -0
  399. package/dist/assets/directives/tooltip/tooltip.stories.ts +1 -0
  400. package/dist/assets/index.ts +1 -0
  401. package/dist/assets/templates/dashboard-template/components/dashboard-section/dashboard-section.stories.ts +1 -0
  402. package/dist/assets/templates/dashboard-template/components/dashboard-section/dashboard-section.vue +1 -0
  403. package/dist/assets/templates/dashboard-template/dashboard-template.docs.mdx +148 -0
  404. package/dist/assets/templates/dashboard-template/dashboard-template.stories.ts +1 -0
  405. package/dist/assets/templates/dashboard-template/dashboard-template.vue +1 -0
  406. package/dist/assets/templates/data-grid-template/data-grid-template.docs.mdx +117 -0
  407. package/dist/assets/templates/data-grid-template/data-grid-template.stories.ts +1 -0
  408. package/dist/assets/templates/data-grid-template/data-grid-template.vue +1 -0
  409. package/dist/main.js +30031 -0
  410. package/package.json +45 -3
@@ -0,0 +1,951 @@
1
+ import { Canvas, Meta, Source, Story } from '@storybook/blocks';
2
+ import * as ComponentStories from './data-grid.stories';
3
+ import DataGridFitContentInCardExample from './__tests__/data-grid-fit-content-in-card-example.vue?raw';
4
+ import DataGridFitContentInModalExample from './__tests__/data-grid-fit-content-in-modal-example.vue?raw';
5
+ import DataGridFitContentInModalFullscreenExample from './__tests__/data-grid-fit-content-in-modal-fullscreen-example.vue?raw';
6
+
7
+ <Meta of={ComponentStories} />
8
+
9
+ # Data Grid
10
+
11
+ <Canvas of={ComponentStories.Default} />
12
+
13
+ The data grid is used to display set of data of information to the user. Using this they will be able to interact with
14
+ the data items through the use of links or buttons. Depending on how the data grid has been configured they can also
15
+ filter and sort the information.
16
+
17
+ ## Table of contents
18
+
19
+ - [Use Cases](#use-cases)
20
+ - [Do not use](#do-not-use)
21
+ - [Configurations](#configurations)
22
+ - [Columns](#columns)
23
+ - [Column width](#column-width)
24
+ - [Fluid Column width](#fluid-column-width)
25
+ - [Automatic width](#automatic-width)
26
+ - [Column padding](#column-padding)
27
+ - [Numeric column](#numeric-column)
28
+ - [Column (text) overflow](#column-text-overflow)
29
+ - [Column visibility](#column-visibility)
30
+ - [Freezing (Column pinning)](#freezing-column-pinning)
31
+ - [Column reactivity and emits](#column-reactivity-and-emits)
32
+ - [Data](#data)
33
+ - [Modifiers](#modifiers)
34
+ - [Custom slots](#custom-slots)
35
+ - [Sorting](#sorting)
36
+ - [Filtering](#filtering)
37
+ - [Usage](#usage)
38
+ - [Filter search bar](#filter-search-bar)
39
+ - [Empty state](#empty-state)
40
+ - [Sticky filters](#sticky-filters)
41
+ - [Pagination](#pagination)
42
+ - [Pagination slot](#pagination-slot)
43
+ - [Lazy loading](#lazy-loading)
44
+ - [Selection and Bulk Actions](#selection-and-bulk-actions)
45
+ - [Bulk selection](#bulk-selection)
46
+ - [Resizing](#resizing)
47
+ - [Condensed](#condensed)
48
+ - [Zebra rows](#zebra-rows)
49
+ - [Slashed zero](#slashed-zero)
50
+ - [Truncate headers](#truncate-headers)
51
+ - [Fitting content within a container (`fit-content`)](#fitting-content-within-a-container-fit-content)
52
+ - [In containers with a fixed height](#in-containers-with-a-fixed-height)
53
+ - [Inside a `bento-modal`](#inside-a-bento-modal)
54
+ - [In containers with a dynamic height](#in-containers-with-a-dynamic-height)
55
+ - [Inside padded containers](#inside-padded-containers)
56
+ - [Dragging](#dragging)
57
+ - [Column Panel (Display options)](#column-panel-display-options)
58
+ - [Nested content slot](#nested-content-slot)
59
+ - [Sticky horizontal scrollbar](#sticky-horizontal-scrollbar)
60
+ - [Nested Rows](#nested-rows)
61
+ - [Prepopulate data with children](#prepopulate-data-with-children)
62
+ - [Asynchronously populate the children when parent is toggled](#asynchronously-populate-the-children-when-parent-is-toggled)
63
+ - [Actions](#actions)
64
+ - [Cell Actions](#cell-actions)
65
+ - [Row Actions](#row-actions)
66
+ - [Action types](#action-types)
67
+ - [Components](#components)
68
+ - [Summary Cell](#summary-cell)
69
+ - [Trend Cell](#trend-cell)
70
+ - [Everything Bagel Example](#everything-bagel-example)
71
+ - [Server side filtering and sorting](#server-side-filtering-and-sorting)
72
+ - [Accessibility 🚧](#accessibility-🚧)
73
+ - [Roles, States, and Properties](#roles-states-and-properties)
74
+ - [Resources](#resources)
75
+
76
+ ## Use Cases
77
+
78
+ Here are some examples:
79
+
80
+ - Show a user a data set where they can edit and delete items.
81
+ - Show a list of data items that can be ordered by status and filtered by name.
82
+
83
+ ### Do not use
84
+
85
+ When using the data grid:
86
+
87
+ - do not add the filter-bar component in the header slot but use the filters prop instead.
88
+
89
+ ## Configurations
90
+
91
+ ### Columns
92
+
93
+ An array of column definitions must be provided to the data grid.
94
+
95
+ ```
96
+ [{
97
+ autoWidth?: boolean;
98
+ field: string;
99
+ flex?: number;
100
+ label: string;
101
+ mandatory?: boolean;
102
+ minWidth?: number;
103
+ numeric: boolean;
104
+ padding?: {
105
+ left?: boolean;
106
+ right?: boolean;
107
+ };
108
+ sortable?: boolean;
109
+ width?: number;
110
+ }]
111
+ ```
112
+
113
+ The following properties are required in each definition:
114
+
115
+ `field` - the name of the key in the data item in the `data` array of items.
116
+
117
+ `label` - the label of the column header.
118
+
119
+ While `mandatory` is not required, it is best practice to have at least one `mandatory` column to ensure data always
120
+ stays displayed even if the user hides all columns.
121
+
122
+ #### Column width
123
+
124
+ For each column the following width properties can be applied:
125
+
126
+ `width` - the initial width of the column.
127
+
128
+ `minWidth` - the minimum width the column.
129
+
130
+ #### Fluid Column width
131
+
132
+ You can also set a fluid width for achieving column fluidity & responsiveness (similar to the CSS flexbox). This can be
133
+ by done by setting the following properties:
134
+
135
+ `minWidth` - the minimum width the column can be resized to.
136
+
137
+ `flex` - can be between 0 and ∞. It works by dividing the remaining space in the grid among all flex columns in
138
+ proportion to their flex value. It works a lot like the `flex` used in
139
+ [CSS flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/flex).
140
+
141
+ <Canvas of={ComponentStories.Fluid} />
142
+
143
+ #### Automatic width
144
+
145
+ You can also set the column's width to automatic by setting `autoWidth` to `true`. This will automatically scale the
146
+ column's width depending on its data. The scaling chooses the largest width for that columns row cells and column header
147
+ label so that the text does not overflow.
148
+
149
+ Is it important however to make sure you do not use this on all columns especially the ones you know that will have a
150
+ fixed width or that have been specified in the Figma design your designer has provided to you.
151
+
152
+ #### Column padding
153
+
154
+ It is possible to remove padding from columns - note that this will affect on all row cells for that column including
155
+ the column header.
156
+
157
+ This can be done by using the properties:
158
+
159
+ `padding` - is an object with 2 boolean properties `left` and `right` which can be set to false to remove padding from
160
+ that side for that given column.
161
+
162
+ #### Numeric column
163
+
164
+ It's possible to indicate that the column will contain only numeric values. With this, the column name and cell values
165
+ for this column will be aligned to the right
166
+
167
+ This can be done by using the `numeric` boolean property
168
+
169
+ #### Column (text) overflow
170
+
171
+ <Canvas of={ComponentStories.EverythingBagelExample} />
172
+
173
+ It is possible to customise the text overflow for columns - note that this will affect on all row cells for that column.
174
+
175
+ This can be done by using the properties:
176
+
177
+ `overflow` - which can set to `BentoColumnOverflow.WRAP` (default) or `BentoColumnOverflow.ELLIPSIS`.
178
+
179
+ The result of using the values are explained below:
180
+
181
+ `BentoColumnOverflow.WRAP` - Wraps the cell's text upon overflow.
182
+
183
+ `BentoColumnOverflow.ELLIPSIS` - Truncates cell's text with a `...` ellipsis upon overflow. NOTE: when using this option
184
+ set a `title` attribute on the cell's content if using the `item-{columnKey}` slot. This will allow the user to hover
185
+ over the truncated content to see the whole content.
186
+
187
+ #### Column visibility
188
+
189
+ It is possible to set a column's visibility by changing the `visible` property in it's Column definition.
190
+
191
+ `mandatory` columns cannot be hidden and will stay visible even when the user hides all columns.
192
+
193
+ #### Freezing (Column pinning)
194
+
195
+ To pin a column to the left-hand side of the screen (i.e. pinning the column in place for horizontal scrolling) you can
196
+ set the `frozen` property to `true` in the it's Column definition
197
+
198
+ #### Column reactivity and emits
199
+
200
+ In order to make sure the consumer's column definition and the internal Datagrid are in sync, it required for the
201
+ [**Dragging**](#dragging) and [**Column panel**](#column-panel-display-options) features to update the `columns` prop
202
+ when the `update:columns` emit is fired.
203
+
204
+ This can easily be done by creating the `columns` array as a
205
+ [Vue reference](https://vuejs.org/guide/essentials/reactivity-fundamentals.html#ref).
206
+
207
+ e.g.
208
+
209
+ ```typescript
210
+ const columns = ref([
211
+ { field: 'payment', label: 'Payment' },
212
+ { field: 'countryCode', label: 'Country' },
213
+ ]);
214
+ ```
215
+
216
+ and then setting this as a [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier) on
217
+ the Datagrid:
218
+
219
+ ```html
220
+ <bento-data-grid :data="dataArray" :columns.sync="columns" />
221
+ ```
222
+
223
+ ### Data
224
+
225
+ Data is simply an array of objects that are a string keyed object of data values.
226
+
227
+ ```
228
+ [
229
+ {
230
+ "id": "03c0a799-1ced-4017-aea3-0cebb0106335",
231
+ "name": "Shepherd Kane",
232
+ "payment": 1604,
233
+ "company": "VURBO",
234
+ "registered": "2017-07-17T02:50:50 -02:00",
235
+ },
236
+ {
237
+ "id": "b6d4f1fd-b1f6-40a6-a443-f785c89604ef",
238
+ "name": "Santos Palmer",
239
+ "payment": 1635,
240
+ "company": "POLARAX",
241
+ "registered": "2020-04-20T09:56:06 -02:00",
242
+ },
243
+ ]
244
+ ```
245
+
246
+ ## Modifiers
247
+
248
+ ### Custom slots
249
+
250
+ The Data Grid provides the following customizeable slots:
251
+
252
+ - Header: `#header`
253
+ - Table header: `#head-FIELD="{column}"`
254
+ - Table cell: `#item-FIELD="{item}"`
255
+ - Footer: `#footer`
256
+
257
+ > Please note if you use a `BentoLink` inside a table cell its style will automatically be adjusted for you.
258
+
259
+ With descriptions:
260
+
261
+ All descriptions must use the color **Label secondary** (`--b-color-label-secondary`). The use of CSS variables is
262
+ encouraged to be able to support _themes_ (e.g. `dark` & `light`) over the use of JS variables or hard coded values.
263
+
264
+ <Canvas of={ComponentStories.Slots} />
265
+
266
+ ### Sorting
267
+
268
+ You can sort columns by using the `sortBy` and `@update:sort-by` / `@sort` events.
269
+
270
+ `sortBy` is an array of `BentoDatagridSortByColumn` items with a structure of:
271
+
272
+ ```typescript
273
+ {
274
+ field: string;
275
+ direction: BentoDatagridSortDirection;
276
+ }
277
+ ```
278
+
279
+ `sortBy` can be used with the [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier)
280
+ for automatic updating of the `sortBy` ref.
281
+
282
+ | Prop / Events | Purpose |
283
+ | ------------- | ------------------------------------------------------------------------------------------------------------------- |
284
+ | `sortBy` | Array of `BentoDatagridSortByColumn` items noting the `field` that was sorted and the `direction` it was sorted in. |
285
+ | `@sort` | Event emitted when the `sortBy` has changed. |
286
+
287
+ <Canvas of={ComponentStories.Sorting} />
288
+
289
+ ### Filtering
290
+
291
+ You can add filtering to the data grid by adding an array of filter configurations (`BentoFilterBarModel`) to `filters`
292
+ property & filter values (`BentoFilterValues`) to the `filter-values` property (NOTE: in order to watch `filter-values`
293
+ you will need to do a [deep watch](https://vuejs.org/guide/essentials/watchers.html#deep-watchers)).
294
+
295
+ To see more about what filter can be set on the `filters` property, go to the
296
+ [filter bar documentation](../?path=/docs/components-filter-bar--docs#available-filter-configurations)
297
+
298
+ You can automatically update `filter-values` using the
299
+ [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier) (in vue 2) or the `v-model`
300
+ (in vue 3) or independently with the `@update:filter-values` event.
301
+
302
+ | Prop | Purpose |
303
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
304
+ | `filters` | Array of filter objects. Each one of the elements in the array corresponds to a filter that will be created and rendered in the FilterBar. |
305
+ | `filterValues` | Array of filter values. Each one of the elements in the array corresponds to a filter's value to be set in the filter bar. |
306
+ | `filterSearchTerm` | String that contains the search term used to filter the data with, it is displayed in the search input of the filter bar. |
307
+ | `filterSearchConfig` | Sets the configuration options (`hint`, `placeholder`, `debounceTime` and `inputFieldAriaLabel`) for the filter's search bar. |
308
+
309
+ <Canvas of={ComponentStories.Filtering} />
310
+
311
+ #### Usage
312
+
313
+ `bento-data-grid` filters internally rely on the `bento-toast` component.
314
+
315
+ If you want to use filtering in your `bento-data-grid` component, then it's needed to initialize the **Bento plugin**
316
+ with the toast enabled by setting the `withToast` property set to `true`
317
+
318
+ More information with example can be found in [Toast usage documentation](../?path=/docs/components-toast--docs#usage)
319
+
320
+ #### Filter search bar
321
+
322
+ It is also possible to filter using the search bar. Typing the word dynamically filters the content to show relevant
323
+ results.
324
+
325
+ - Can be used with `filterSearchTerm.sync` or independently with `filterSearchTerm` and `@filter-search-input`.
326
+ - When the search is cleared, the event `@filter-search-clear` is emitted, updating `filterSearchTerm` if the `sync`
327
+ option is set
328
+
329
+ <Canvas of={ComponentStories.Filtering} />
330
+
331
+ ### Empty state
332
+
333
+ The empty state will be shown when an empty array is set on the `data` property.
334
+
335
+ Setting the `emptyState` property can be used to configure the inner `bento-empty-state` component. For more information
336
+ about what properties can be set, [see the EmptyState documentation](../?path=/docs/components-empty-state--docs).
337
+
338
+ Please note there is limitation for which values can be set on the `emptyState.image` property, please use the following
339
+ UX rules to decide which one to set:
340
+
341
+ - 'embedded' - When only one single data grid has been rendered on the page.
342
+ - 'basic' - When multiple datagrid are being rendered on the page.
343
+
344
+ <Canvas of={ComponentStories.NoResults} />
345
+
346
+ #### Sticky filters
347
+
348
+ By default, filters will be sticky, showing always on top of the page as the user scrolls, along with the column
349
+ headers. This behaviour can be disabled by setting `stickyFilters` to false.
350
+
351
+ ### Pagination
352
+
353
+ You can add the pagination component to the data grid using the `pagination` prop. This prop accepts an object
354
+ containing all the properties available for the `bento-pagination` component (see the Pagination component story for
355
+ more details).
356
+
357
+ To handle pagination changes, such as a user navigating to a new page, you have two primary methods:
358
+
359
+ - **Using the `@update:pagination` event:** This event is emitted whenever the pagination state changes. You can listen
360
+ for this event to trigger a method that fetches new data or updates the currently displayed data slice.
361
+ - **Using the `.sync` modifier:** You can use the
362
+ [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier) on the `pagination` prop
363
+ (`:pagination.sync="yourPaginationRef"`) to create a two-way binding with a local reactive property. When the user
364
+ interacts with the pagination, your local property is automatically updated. You can then use a `watch`er on this
365
+ property to react to changes, which is a common pattern for triggering API calls for server-side pagination.
366
+
367
+ <Canvas of={ComponentStories.Pagination} />
368
+
369
+ #### Pagination slot
370
+
371
+ You can use the pagination slot to pass content to the default slot in `bento-pagination`, which will be displayed on
372
+ the left side of the component. The slot will only be visible if `hidePageSize` is true, as the slot takes up the same
373
+ space in the component.
374
+
375
+ ### Lazy loading
376
+
377
+ You can enable lazy loading of data by passing the `lazy-load-type` property. This property defaults to `none` (no lazy
378
+ loading provided), but can take up the following values:
379
+
380
+ - `automatic`: an infinite scroll will be provided and an `update:show-more` event will be emitted by the data-grd every
381
+ time the user reaches the bottom of the data list
382
+ - `button`: a `Show more` button will be displayed and the `update:show-more` event will be emitted on button click
383
+
384
+ Note that the loading state has to be handled by the consumer via the `loading` property.
385
+
386
+ When the lazy load variant is enabled, the pagination component will be automatically hidden if present.
387
+
388
+ <Canvas of={ComponentStories.lazyLoading} />
389
+
390
+ ### Selection and Bulk Actions
391
+
392
+ <Canvas of={ComponentStories.Selection} />
393
+
394
+ The prop `selectable` enables the selection of rows in the data grid to perform some action on them. The selected items
395
+ will be kept in sync with the component through the `selection` prop, which expects an array of IDs.
396
+
397
+ Rows can also be disabled for selection, with `isDataItemDisabled` prop.
398
+
399
+ In order for the action bar to be rendered, you must also pass the actions into the `bulk-actions` prop.
400
+
401
+ #### Bulk selection
402
+
403
+ If a data grid is selectable, a checkbox will be rendered as the column header to be able to select every item in the
404
+ page.
405
+
406
+ By default, this will select every item in the page that is enabled, but in situations where you want to select items
407
+ from other pages too you can pass the `selectableAcrossPages` prop. This will render a selection menu with the option to
408
+ select all items on the page or across all pages (the menu will only render if there is more than one page, therefore
409
+ pagination needs to be set up too with the correct total count).
410
+
411
+ While selection on the page is handled by the component, to select items across all pages, we emit an event
412
+ `select-all-across-pages` and the data needs to be handled externally, by updating the `selection` array to contain all
413
+ the selected items from different pages.
414
+
415
+ Here's an example on how to use all selection functionalities:
416
+
417
+ ```html
418
+ <template>
419
+ <bento-data-grid
420
+ :data="data"
421
+ :columns.sync="columns"
422
+ selectable
423
+ :selection.sync="selection"
424
+ :bulk-actions="actions"
425
+ :is-data-item-disabled="isDataItemDisabledForSelection"
426
+ selectable-across-pages
427
+ @select-all-across-pages="onSelectAll"
428
+ :pagination="pagination"
429
+ />
430
+ </template>
431
+ <script setup lang="ts">
432
+ import { BentoDataGrid } from '@adyen/bento-vue2';
433
+ import type { BentoDatagridData, BentoDatagridDataItem, BentoDatagridSelection } from '@adyen/bento-vue2';
434
+
435
+ const data = ref<BentoDatagridData>([
436
+ {
437
+ id: '03c0a799-1ced-4017-aea3-0cebb0106335',
438
+ name: 'Shepherd Kane',
439
+ },
440
+ {
441
+ id: 'b6d4f1fd-b1f6-40a6-a443-f785c89604ef',
442
+ name: 'Santos Palmer',
443
+ },
444
+ {
445
+ id: '8f9e7877-1ca2-4929-9217-f1ec78709291',
446
+ name: 'Joyce Johns',
447
+ },
448
+ ]);
449
+
450
+ // Selection
451
+ const isDataItemDisabledForSelection = (row: BentoDatagridDataItem) =>
452
+ row.id === 'b6d4f1fd-b1f6-40a6-a443-f785c89604ef';
453
+ const selection = ref<BentoDatagridSelection>(['03c0a799-1ced-4017-aea3-0cebb0106335']);
454
+
455
+ const onSelectAll = () => {
456
+ const enabledIdsInThisPage = ['03c0a799-1ced-4017-aea3-0cebb0106335', '8f9e7877-1ca2-4929-9217-f1ec78709291'];
457
+ const idsFromOtherPages = [
458
+ 'b7d95f8a-953c-4f9a-afcf-ea97d5a2fbf0',
459
+ 'de10f8dc-4f9b-4b78-b30b-27ea6b9c2c20',
460
+ 'a9b5e6c9-35c4-40be-aa2b-2651c9f70f36',
461
+ ];
462
+ selection.value = [
463
+ ...enabledIdsInThisPage
464
+ ...idsFromOtherPages,
465
+ ];
466
+ };
467
+
468
+ // Bulk actions
469
+ const actions = [
470
+ {
471
+ title: 'Edit',
472
+ event: () => true,
473
+ },
474
+ {
475
+ title: 'Delete',
476
+ critical: true,
477
+ event: () => true,
478
+ },
479
+ ];
480
+
481
+ // Pagination object
482
+ const pagination = { size: 20, totalCount: 100 }
483
+ </script>
484
+ ```
485
+
486
+ | Prop / Events | Purpose |
487
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
488
+ | `selectable` | Boolean value that toggles on / off selection functionality. |
489
+ | `selection` | Array of selected row IDs. |
490
+ | `update:selection` | Event that fires upon selecting a row. This allows the use of the [sync modifier](https://v2.vuejs.org/v2/guide/components-custom-events.html#sync-Modifier) |
491
+ | `actions` | Array of actions to be displayed to the user in the action bar |
492
+ | `getDataItemId` | Function to tell the data grid the unique identifier for the data item, if none provided `row.id` is used. |
493
+ | `isDataItemDisabled` | Function that tells the data grid if the row is disabled from selection. |
494
+ | `select` | Event that fires upon selecting a row. |
495
+
496
+ ### Resizing
497
+
498
+ Enables resizing of the columns by dragging the column divider.
499
+
500
+ | Prop / Events | Purpose |
501
+ | --------------------- | ----------------------------------------------- |
502
+ | `hasResizableColumns` | enable / disable the ability to resize columns. |
503
+ | `@column-resize` | Resize event. |
504
+
505
+ ### Condensed
506
+
507
+ _NOTE: You must sync the `condensed` property using the emits as explained [here](#column-reactivity-and-emits)_.
508
+
509
+ Enables the condensed view for the data grid. This essentially reduces the row cells to a smaller vertical padding.
510
+
511
+ ### Zebra rows
512
+
513
+ _NOTE: You must sync the `zebraRows` property using the emits as explained [here](#column-reactivity-and-emits)_.
514
+
515
+ Enables the zebra-like rows for the data grid, where each even row is displayed in a darker shade than the odd-numbered
516
+ rows.
517
+
518
+ ### Slashed zero
519
+
520
+ If the `slashedZero` prop is set to `true`, the data grid will render zeroes in a slashed font numeric style.
521
+
522
+ ### Truncate headers
523
+
524
+ You can pass the `truncateColumnHeaders` prop to the `bento-data-grid` to truncate headers that are breaking into
525
+ multiple lines.
526
+
527
+ ### Fitting content within a container (`fit-content`)
528
+
529
+ _NOTE: Using a `bento-data-grid` inside a small container (e.g. modal) is not recommended and using alternatives such as
530
+ creating a new view and redirecting are encouraged. If no alternative can be found here are some guidelines._
531
+
532
+ When you need the data grid to fill the available vertical space of its parent container, you can use the `fit-content`
533
+ prop. This makes the data grid's body scrollable while the headers remain fixed, which is useful for both containers
534
+ with a fixed height and those that are dynamically sized.
535
+
536
+ <Canvas of={ComponentStories.GridInCard} />
537
+
538
+ #### In containers with a fixed height
539
+
540
+ When placing the data grid inside a container with a defined height, like a `bento-card`, the `fit-content` prop allows
541
+ the grid to adapt to that specific height. You must ensure the parent element of the data grid has a `height` defined.
542
+
543
+ **Example inside a `bento-card`:**
544
+
545
+ <Source dark language="html" code={DataGridFitContentInCardExample} />
546
+
547
+ #### Inside a `bento-modal`
548
+
549
+ <Source dark language="html" code={DataGridFitContentInModalExample} />
550
+
551
+ #### In containers with a dynamic height
552
+
553
+ <Source dark language="html" code={DataGridFitContentInModalFullscreenExample} />
554
+
555
+ ### Inside padded containers
556
+
557
+ When `bento-data-grid` is rendered inside components that already have their own content padding, like
558
+ `bento-accordion`, you can pass the `noSpacingTop` prop to remove the extra spacing.
559
+
560
+ ### Dragging
561
+
562
+ _NOTE: You must sync the `column` property using the emits as explained [here](#column-reactivity-and-emits)_.
563
+
564
+ If the `allowColumnDragAndDrop` property is set to true, users can drag and drop columns to re-arrange their order. Also
565
+ note the users can drag and drop column to and from the frozen section.
566
+
567
+ ### Column Panel (Display options)
568
+
569
+ _NOTE: You must sync the `column` and `condensed` property using the emits as explained
570
+ [here](#column-reactivity-and-emits)_.
571
+
572
+ Enabling this boolean property will add the Column wiew settings functionality. This allows users to toggle:
573
+
574
+ - condensed view
575
+ - column visibility
576
+ - column freezing (using the freeze icon)
577
+
578
+ <Canvas of={ComponentStories.DisplayOptions} />
579
+
580
+ ### Nested content slot
581
+
582
+ <Canvas of={ComponentStories.NestedContentSlot} />
583
+
584
+ It's possible to nest content inside of each data row in the Datagrid. In order to do this you have to set the
585
+ `hasNestedContent` to true and then use the `nested-slot` slot to render elements in the slot. This slot passes on the
586
+ `BentoDatagridDataItem` object which you can use to customise the slot.
587
+
588
+ You can also use the `shouldShowNestedContent` property to filter which rows should show the nested content slot. This
589
+ property accepts a function of type `BentoDatagridShouldShowNestedContentFn`. i.e.
590
+ `(item: BentoDatagridDataItem) => boolean;`.
591
+
592
+ ### Sticky horizontal scrollbar
593
+
594
+ <Canvas of={ComponentStories.StickyHorizontalScrollbar} />
595
+
596
+ If you have a very large data grid and prefer not to limit its height, you can enable a sticky horizontal scrollbar
597
+ instead. Simply set the `stickyHorizontalScrollbar` property to `true`.
598
+
599
+ This ensures users can scroll horizontally without needing to reach the bottom of the data grid.
600
+
601
+ ### Nested Rows
602
+
603
+ <Canvas of={ComponentStories.NestedRows} />
604
+
605
+ It's possible to show nested rows (of the same data structure) for each data row in the Datagrid. In order to do this
606
+ you have to set `hasNestedRows` to `true` and do either of the following:
607
+
608
+ #### Prepopulate data with children
609
+
610
+ If you set in each data item i.e. `BentoDatagridDataItem`, the `children` attribte to an array of
611
+ `BentoDatagridDataItem` objects. These data rows will be shown when the parent data item is toggled.
612
+
613
+ #### Asynchronously populate the children when parent is toggled
614
+
615
+ If you hook into the `nested-content-toggled` you can asynchronously populate the children by updating the `data`
616
+ property of that parent's `BentoDatagridDataItem.children` attribute.
617
+
618
+ ### Actions
619
+
620
+ #### Cell Actions
621
+
622
+ <Canvas of={ComponentStories.CellActions} />
623
+
624
+ Cell Actions are inline buttons that appear within a specific table cell, typically on hover. They are ideal for actions
625
+ directly related to the cell's content.
626
+
627
+ You can configure these by providing an array or function to the `cellActions` property within a specific column's
628
+ definition. Using the function will allow you to conditionally display actions based on the row's state.
629
+
630
+ The available configurations for each action object are detailed in the Action Types section below.
631
+
632
+ #### Row Actions
633
+
634
+ <Canvas of={ComponentStories.RowActions} />
635
+
636
+ Row Actions provide a persistent set of buttons in a dedicated column at the end of each row. They are best suited for
637
+ record-level operations, such as editing or deleting an entire entry.
638
+
639
+ To implement them, pass an array or function to the `rowActions` prop. Using the function will allow you to
640
+ conditionally display actions based on the row's state.
641
+
642
+ Please see "Types of actions" in the below section to see what type of actions you can render.
643
+
644
+ #### Action types
645
+
646
+ The following action types can be used to build the array for both the `cellActions` and `rowActions` properties.
647
+
648
+ Note: For `rowActions`, the columnKey parameter is not applicable and will not be passed to event handlers.
649
+
650
+ ##### Copy action
651
+
652
+ | Prop | type | value |
653
+ | ------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
654
+ | `variant` | `string` | Must be set to 'copy'. |
655
+ | `isShort` | `boolean` | If set to true, will only show icon. |
656
+ | `getCopyData` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => string` | A function that can be used to customise what data is copied upon the user clicking the button. |
657
+
658
+ ##### Edit action
659
+
660
+ | Prop | type | value |
661
+ | --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------- |
662
+ | `variant` | `string` | Must be set to 'edit'. |
663
+ | `isShort` | `boolean` | If set to true, will only show icon. |
664
+ | `event` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => void` | Click event that will emit the row data and the column key of the cell. |
665
+
666
+ ##### Open action
667
+
668
+ | Prop | type | value |
669
+ | ------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
670
+ | `variant` | `string` | Must be set to 'open'. |
671
+ | `isShort` | `boolean` | If set to true, will only show icon. |
672
+ | `menuData` | `BentoColumnCellActionMenuItem[]` | Can be set to an array of `BentoColumnCellActionMenuItem` to create a menu button. |
673
+ | `menuData[menuItemIndex].event` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => void` | The menu item click event that will emit the row data and the column key of the cell. |
674
+
675
+ ##### More action
676
+
677
+ | Prop | type | value |
678
+ | ------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
679
+ | `variant` | `string` | Must be set to 'more'. |
680
+ | `isShort` | `boolean` | If set to true, will only show icon. |
681
+ | `menuData` | `BentoColumnCellActionMenuItem[]` | Can be set to an array of `BentoColumnCellActionMenuItem` to create a menu button. |
682
+ | `menuData[menuItemIndex].event` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => void` | The menu item click event that will emit the row data and the column key of the cell. |
683
+
684
+ ##### Custom action
685
+
686
+ | Prop | type | value |
687
+ | ------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
688
+ | `title` | `string` | Sets the button title. |
689
+ | `critical` | `boolean` | Toggles the critical state of the `BentoButton`. |
690
+ | `disabled` | `boolean` | Toggles the disabled state of the `BentoButton`. |
691
+ | `event` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => void` | Click event that will emit the row data and the column key of the cell. |
692
+ | `iconLeft` | An icon from the `@adyen/ui-assets-icons-16` NPM package. | e.g. `import StarIcon from '@adyen/ui-assets-icons-16/vue/star';` |
693
+ | `iconRight` | An icon from the `@adyen/ui-assets-icons-16` NPM package. | e.g. `import StarIcon from '@adyen/ui-assets-icons-16/vue/star';` |
694
+ | `link` | An object containing `BentoLink` properties. | e.g. `{ to: 'https://adyen.com', external: true }` |
695
+ | `menuData` | `BentoColumnCellActionMenuItem[]` | Can be set to an array of `BentoColumnCellActionMenuItem` to create a menu button. |
696
+ | `menuData[menuItemIndex].event` | `(rowDataItem: BentoDatagridDataItem, columnKey: string) => void` | The menu item click event that will emit the row data and the column key of the cell. |
697
+
698
+ ## Components
699
+
700
+ ### Summary Cell
701
+
702
+ <Canvas of={ComponentStories.SummaryCell} />
703
+
704
+ The `bento-data-grid-summary-cell` is a specialized component designed to be used within a data grid cell when the
705
+ underlying data for that cell is an array of items. It elegantly displays a summary (e.g., "2 merchants") and reveals
706
+ the full list in a popover on hover. This is particularly useful for representing one-to-many relationships in your
707
+ data.
708
+
709
+ When there's only one item in the array, it will be rendered as plain text. If there are multiple items, the summary
710
+ `label` is shown with a dashed underline, which triggers the popover.
711
+
712
+ To use it, use a specific column's item slot, like `#item-company`. Then pass the relevant array of strings using cell's
713
+ data to the `items` property.
714
+
715
+ Passing a `searchTerm` (from the filter bar or global search) to the summary cell will add a tooltip to each cell whose
716
+ `items` array contains a match. When the popover is opened, the component automatically highlights the matching items.
717
+
718
+ You can also use the `tooltipText` property to override the default tooltip text. By default, the tooltip displays
719
+ `"{numberOfResultsInItems} results"`.
720
+
721
+ ### Trend Cell
722
+
723
+ <Canvas of={ComponentStories.TrendCell} />
724
+
725
+ The `bento-data-grid-trend-cell` is a specialized component for `bento-data-grid` that displays a percentage value with
726
+ an optional arrow icon. This is useful for showing changes in data, such as growth or decline. It always displays a `%`
727
+ regardless of the value passed and supports up to 10 decimal places.
728
+
729
+ To use it, place `bento-data-grid-trend-cell` inside a column's item slot (e.g., `#item-yourColumn`). Then pass the
730
+ relevant cell's data to the `items` property.
731
+
732
+ ## Everything Bagel Example
733
+
734
+ <Canvas of={ComponentStories.EverythingBagelExample} />
735
+
736
+ Above is an example of using all the above features in one single Datagrid.
737
+
738
+ This example uses local filtering, searching and sorting of the data using the `setup` function defined below. Please
739
+ note of course this is a contrived example which may require more complex filtering methods for different data types.
740
+
741
+ As you can see from the example we use the `computed` function to react to changes on the `sortBy`, `filters` and
742
+ `searchTerm` variables.
743
+
744
+ ```typescript
745
+ setup(props) {
746
+ // References
747
+ const columns = ref<BentoColumn[]>([
748
+ { field: 'name', label: 'Name', minWidth: 300, mandatory: true, frozen: true, autoWidth: true, sortable: true },
749
+ { field: 'company', label: 'Reference' },
750
+ { field: 'payment', label: 'Payment', width: 200, minWidth: 150 },
751
+ ]);
752
+ const filtersSet = ref<BentoFilterBarModel>([
753
+ {
754
+ field: 'company',
755
+ label: 'Company',
756
+ value: null,
757
+ type: BentoFilterItemType.INPUT,
758
+ },
759
+ {
760
+ field: 'countryCode',
761
+ label: 'Country',
762
+ value: undefined,
763
+ options: {
764
+ listboxItems: [
765
+ {
766
+ value: BentoCountryCode.NL,
767
+ },
768
+ {
769
+ value: BentoCountryCode.BE,
770
+ },
771
+ ],
772
+ variant: 'name',
773
+ },
774
+ type: BentoFilterItemType.SELECT_COUNTRY,
775
+ },
776
+ ]);
777
+
778
+ const sortBy = ref<BentoDatagridSortByColumn[]>([]);
779
+ const searchTerm = ref('');
780
+ const isCondensed = ref(false);
781
+
782
+ // Methods
783
+ const getPaymentStatus = (paymentStatus: number) => {
784
+ switch (paymentStatus) {
785
+ case 2:
786
+ return BentoStatusVariant.GREEN;
787
+ case 1:
788
+ return BentoStatusVariant.YELLOW;
789
+ case 0:
790
+ default:
791
+ return BentoStatusVariant.RED;
792
+ }
793
+ };
794
+
795
+ const getPaymentText = (paymentStatus: number) => {
796
+ switch (paymentStatus) {
797
+ case 2:
798
+ return 'Paid';
799
+ case 1:
800
+ return 'In progress';
801
+ case 0:
802
+ default:
803
+ return 'Not paid';
804
+ }
805
+ };
806
+
807
+ const onRowClick = (item: BentoDatagridDataItem) => {
808
+ action('row-click')(item);
809
+ };
810
+
811
+ // Computed Values
812
+ // Filtering data
813
+ const filteredData = computed(() =>
814
+ // If any filters or search terms have been set
815
+ filtersSet.value?.length === 0 && searchTerm.value === ''
816
+ ? props.data
817
+ : props.data.filter(item => {
818
+ const foundFilteredItem =
819
+ filtersSet.value?.length > 0
820
+ ? filtersSet.value.every(filter =>
821
+ filter.value
822
+ ? (item[filter.field] as string)
823
+ .toLowerCase()
824
+ .includes((filter.value as string).toLowerCase())
825
+ : true
826
+ )
827
+ : true;
828
+ const foundSearchFilteredItem = searchTerm.value
829
+ ? (item?.company as string)
830
+ .toLowerCase()
831
+ .includes((searchTerm.value as string).toLowerCase())
832
+ : true;
833
+
834
+ return foundFilteredItem && foundSearchFilteredItem;
835
+ })
836
+ );
837
+
838
+ // Sorting data
839
+ const filteredAndSortedData = computed(() => {
840
+ if (sortBy.value?.length === 0) {
841
+ return filteredData.value;
842
+ }
843
+ return sortBy.value[0].direction === BentoDatagridSortDirection.ASCENDING
844
+ ? filteredData.value.sort((a, b) =>
845
+ (a[sortBy.value[0].field] as string).localeCompare(b[sortBy.value[0].field] as string)
846
+ )
847
+ : filteredData.value
848
+ .sort((a, b) =>
849
+ (a[sortBy.value[0].field] as string).localeCompare(b[sortBy.value[0].field] as string)
850
+ )
851
+ .reverse();
852
+ });
853
+
854
+ return {
855
+ // Methods
856
+ getPaymentStatus,
857
+ getPaymentText,
858
+
859
+ // Functions
860
+ onRowClick,
861
+
862
+ // Values
863
+ columns,
864
+ filteredAndSortedData,
865
+ sortBy,
866
+ filtersSet,
867
+ searchTerm,
868
+ isCondensed,
869
+
870
+ // Enums
871
+ BentoDateFormat,
872
+ };
873
+ },
874
+ ```
875
+
876
+ ### Server side filtering and sorting
877
+
878
+ It can be that you have filtering and sorting set up on a backend API and simply have to pass on these values to query
879
+ string values of the HTTP request.
880
+
881
+ To do this simply watch the `sortBy`, `filters` and `searchTerm` reative references and perform a HTTP request when a
882
+ change occurs. One thing to note would be to make sure to toggle the `isLoading` which we pass on to the `is-loading`
883
+ property on the Datagrid.
884
+
885
+ 🚧 NOTE: we are working on an erroneous state for the data-grid for a upcoming future release! When this work has been
886
+ completed this documentation will be updated. 🚧
887
+
888
+ ```typescript
889
+ const serverData = ref([]);
890
+ const isLoading = ref(false);
891
+
892
+ watch(
893
+ () => [sortBy.value, filtersSet.value, searchTerm.value],
894
+ async () => {
895
+ isLoading.value = true;
896
+ const { data } = await axios.get('/api/api-name/get', {
897
+ params: {
898
+ ...filtersSet.value?.reduce((acc, { field, value }) => {
899
+ acc[field] = value;
900
+ return acc;
901
+ }, {});
902
+ // assign params for search and sorting as well
903
+ },
904
+ paramsSerializer: params => {
905
+ return qs.stringify(params);
906
+ },
907
+ });
908
+
909
+ serverData.value = data;
910
+ isLoading.value = false;
911
+ }
912
+ );
913
+ ```
914
+
915
+ Another method would be to wrap up all these reactive refs into a `reactive` reference and deeply watch the reactive ref
916
+
917
+ ```typescript
918
+ const filteringAndSortingVals = reactive({ sortBy: [], filtersSet: [], searchTerm: '' });
919
+ watch(
920
+ () => [filteringAndSortingVals.sortBy, filteringAndSortingVals.filtersSet, filteringAndSortingVals.searchTerm],
921
+ async () => {
922
+ // etc...
923
+ }
924
+ );
925
+ ```
926
+
927
+ ## Accessibility 🚧
928
+
929
+ The full accessibility implementation for this component is still under development, so changes to this section are to
930
+ be expected. However, as for all the other `bento` components we are adhering to
931
+ [WAI-ARIA 1.2](https://www.w3.org/TR/wai-aria-1.2/) standard and using the
932
+ [Interactive Tabular Data pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).
933
+
934
+ ### Roles, States, and Properties
935
+
936
+ | ARIA role / attribute | is automatic? | fallback used | manual override |
937
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------- | --------------- |
938
+ | `role="grid"` | Yes, to container. | - | - |
939
+ | `role="rowgroup"` | Yes, set on the group of columns and rows. | - | - |
940
+ | `role="columnheader"` | Yes, set on the column header cells. | - | - |
941
+ | `role="gridcell"` | Yes, set data cells. | - | - |
942
+ | `aria-rowcount` | Yes, set data grid container to show the number of rows shown. | - | - |
943
+ | `aria-colcount` | Yes, set data grid container to show the number of columns shown. | - | - |
944
+ | `aria-colindex` | Yes, set on the columns. | - | - |
945
+ | `aria-label` | Yes, the data grid container has a label that uses `header` slot text. The column headers using the column `label` property | 'data grid' | - |
946
+ | `aria-label (column)` | Yes, set on the columns using the column `label` property. | - | - |
947
+
948
+ ## Resources
949
+
950
+ - [Figma link](https://www.figma.com/file/uLabwF3243jdMDsNSP7U9I/ADL-2.0---Components?node-id=1232-26553&t=YcnfGpJjnXqTOdu5-0)
951
+ - [Aria sort](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort)