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