@adyen/bento-vue3 1.55.1 → 1.56.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/index.d.ts +844 -289
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/code-snippet.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/teleport.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.DLyCF015.js → accordion-item.CihL7JaZ.js} +2 -2
- package/dist/chunks/{accordion-item.DLyCF015.js.map → accordion-item.CihL7JaZ.js.map} +1 -1
- package/dist/chunks/{action-bar.CDOaDenE.js → action-bar.CD5FQjE9.js} +6 -6
- package/dist/chunks/{action-bar.CDOaDenE.js.map → action-bar.CD5FQjE9.js.map} +1 -1
- package/dist/chunks/{alert.4SefwHLO.js → alert.CFb4Sejw.js} +3 -3
- package/dist/chunks/{alert.4SefwHLO.js.map → alert.CFb4Sejw.js.map} +1 -1
- package/dist/chunks/{base-modal.DZy1WuJs.js → base-modal.qhldLovE.js} +5 -5
- package/dist/chunks/{base-modal.DZy1WuJs.js.map → base-modal.qhldLovE.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.DQRTu42W.js → button-actions-with-menu.CxB1fVvx.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.DQRTu42W.js.map → button-actions-with-menu.CxB1fVvx.js.map} +1 -1
- package/dist/chunks/{button-actions.N99QthUv.js → button-actions.ODJKaCW7.js} +3 -3
- package/dist/chunks/{button-actions.N99QthUv.js.map → button-actions.ODJKaCW7.js.map} +1 -1
- package/dist/chunks/{button.DEVuqLVT.js → button.BHZgsGkp.js} +43 -41
- package/dist/chunks/button.BHZgsGkp.js.map +1 -0
- package/dist/chunks/{calendar.CNt90BvO.js → calendar.Dymq4e0Y.js} +4 -4
- package/dist/chunks/{calendar.CNt90BvO.js.map → calendar.Dymq4e0Y.js.map} +1 -1
- package/dist/chunks/{card.E2xhS_6Z.js → card.DQ6g6hqK.js} +3 -3
- package/dist/chunks/{card.E2xhS_6Z.js.map → card.DQ6g6hqK.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BMzsgOeI.js → checkbox-group.DFmUrvgx.js} +4 -4
- package/dist/chunks/{checkbox-group.BMzsgOeI.js.map → checkbox-group.DFmUrvgx.js.map} +1 -1
- package/dist/chunks/{checkbox.BIaD03Bg.js → checkbox.Bti_jnp2.js} +17 -17
- package/dist/chunks/{checkbox.BIaD03Bg.js.map → checkbox.Bti_jnp2.js.map} +1 -1
- package/dist/chunks/{chip.3T0x6FuI.js → chip.DbhxDQiT.js} +2 -2
- package/dist/chunks/{chip.3T0x6FuI.js.map → chip.DbhxDQiT.js.map} +1 -1
- package/dist/chunks/code-snippet.Df5XwyWD.js +334 -0
- package/dist/chunks/code-snippet.Df5XwyWD.js.map +1 -0
- package/dist/chunks/{controls-group.DJqvAWte.js → controls-group.DgrzEh4C.js} +2 -2
- package/dist/chunks/{controls-group.DJqvAWte.js.map → controls-group.DgrzEh4C.js.map} +1 -1
- package/dist/chunks/{copy.MId-I684.js → copy.CfFh4b_c.js} +3 -3
- package/dist/chunks/{copy.MId-I684.js.map → copy.CfFh4b_c.js.map} +1 -1
- package/dist/chunks/{country.D0WFfaql.js → country.BhAcCmRx.js} +2 -2
- package/dist/chunks/{country.D0WFfaql.js.map → country.BhAcCmRx.js.map} +1 -1
- package/dist/chunks/{dashboard-section.CrbSjoA8.js → dashboard-section.tza4iYcv.js} +3 -3
- package/dist/chunks/{dashboard-section.CrbSjoA8.js.map → dashboard-section.tza4iYcv.js.map} +1 -1
- package/dist/chunks/dashed-underline.B2cIJkg_.js +98 -0
- package/dist/chunks/dashed-underline.B2cIJkg_.js.map +1 -0
- package/dist/chunks/data-grid-template.PGPytWvk.js +111 -0
- package/dist/chunks/data-grid-template.PGPytWvk.js.map +1 -0
- package/dist/chunks/{data-grid.CsyayKK3.js → data-grid.DsZQ-F9m.js} +1328 -1299
- package/dist/chunks/data-grid.DsZQ-F9m.js.map +1 -0
- package/dist/chunks/{date-picker.CjwoOQ3B.js → date-picker.8jgg3MJm.js} +7 -7
- package/dist/chunks/{date-picker.CjwoOQ3B.js.map → date-picker.8jgg3MJm.js.map} +1 -1
- package/dist/chunks/{date-range-picker.DGY91Rwc.js → date-range-picker.uGwtO7SA.js} +10 -10
- package/dist/chunks/{date-range-picker.DGY91Rwc.js.map → date-range-picker.uGwtO7SA.js.map} +1 -1
- package/dist/chunks/{date.DoJuTLhO.js → date.CKXySBQv.js} +2 -2
- package/dist/chunks/{date.DoJuTLhO.js.map → date.CKXySBQv.js.map} +1 -1
- package/dist/chunks/{dialog-page.BRlAYf5w.js → dialog-page.MLFdqTcL.js} +3 -3
- package/dist/chunks/{dialog-page.BRlAYf5w.js.map → dialog-page.MLFdqTcL.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CTyt2klK.js → dropdown-default-textbox.BNhy-QDH.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.CTyt2klK.js.map → dropdown-default-textbox.BNhy-QDH.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CJtSH5cZ.js → dropdown-tag.DEAOevYN.js} +3 -3
- package/dist/chunks/{dropdown-tag.CJtSH5cZ.js.map → dropdown-tag.DEAOevYN.js.map} +1 -1
- package/dist/chunks/{dropdown.CQvyjn6d.js → dropdown.CVa4_qCe.js} +6 -6
- package/dist/chunks/{dropdown.CQvyjn6d.js.map → dropdown.CVa4_qCe.js.map} +1 -1
- package/dist/chunks/{empty-state.m0U14LVw.js → empty-state.DiXLZmQJ.js} +2 -2
- package/dist/chunks/{empty-state.m0U14LVw.js.map → empty-state.DiXLZmQJ.js.map} +1 -1
- package/dist/chunks/{error-message.CMgsMDny.js → error-message.CPw3y44N.js} +2 -2
- package/dist/chunks/{error-message.CMgsMDny.js.map → error-message.CPw3y44N.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.D3KUe-MO.js → file-uploader.Dv4sh1IO.js} +477 -452
- package/dist/chunks/file-uploader.Dv4sh1IO.js.map +1 -0
- package/dist/chunks/filter-bar.DfIcZ5dX.js +2886 -0
- package/dist/chunks/filter-bar.DfIcZ5dX.js.map +1 -0
- package/dist/chunks/{fixed-scroller.BNP4SR5J.js → fixed-scroller.DsTyshyt.js} +3 -3
- package/dist/chunks/{fixed-scroller.BNP4SR5J.js.map → fixed-scroller.DsTyshyt.js.map} +1 -1
- package/dist/chunks/{footer-actions.DmGDpPBW.js → footer-actions.C00o4tuW.js} +3 -3
- package/dist/chunks/{footer-actions.DmGDpPBW.js.map → footer-actions.C00o4tuW.js.map} +1 -1
- package/dist/chunks/{form-layout-title.P5ajTo4C.js → form-layout-title.dcT8eXwc.js} +2 -2
- package/dist/chunks/{form-layout-title.P5ajTo4C.js.map → form-layout-title.dcT8eXwc.js.map} +1 -1
- package/dist/chunks/{header-with-views.BJIQZVAq.js → header-with-views.DEn9HFkT.js} +14 -14
- package/dist/chunks/{header-with-views.BJIQZVAq.js.map → header-with-views.DEn9HFkT.js.map} +1 -1
- package/dist/chunks/{header.vHSsdURt.js → header.hDkWwQuQ.js} +5 -5
- package/dist/chunks/{header.vHSsdURt.js.map → header.hDkWwQuQ.js.map} +1 -1
- package/dist/chunks/{i18n.D9azDLPe.js → i18n.B6g5VX0q.js} +1050 -1020
- package/dist/chunks/i18n.B6g5VX0q.js.map +1 -0
- package/dist/chunks/{info-icon-with-popover.CXaaxjeT.js → info-icon-with-popover.COJrCw_o.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.CXaaxjeT.js.map → info-icon-with-popover.COJrCw_o.js.map} +1 -1
- package/dist/chunks/{input-field-password.CWr26esx.js → input-field-password._CliYJ7N.js} +86 -81
- package/dist/chunks/{input-field-password.CWr26esx.js.map → input-field-password._CliYJ7N.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.zf8WxBCn.js → input-field-phone-number.WPcQbE3z.js} +4 -4
- package/dist/chunks/{input-field-phone-number.zf8WxBCn.js.map → input-field-phone-number.WPcQbE3z.js.map} +1 -1
- package/dist/chunks/{input-field.CR262X1w.js → input-field.Cr1r2STY.js} +4 -4
- package/dist/chunks/{input-field.CR262X1w.js.map → input-field.Cr1r2STY.js.map} +1 -1
- package/dist/chunks/{inspector.types.YK45k4D_.js → inspector.types.D5QBC3-G.js} +3 -3
- package/dist/chunks/{inspector.types.YK45k4D_.js.map → inspector.types.D5QBC3-G.js.map} +1 -1
- package/dist/chunks/{menu.CVMSGvtb.js → menu.B0q9q97N.js} +17 -16
- package/dist/chunks/{menu.CVMSGvtb.js.map → menu.B0q9q97N.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.Cqlf6PWo.js → modal-fullscreen.BgqNc9jE.js} +5 -5
- package/dist/chunks/{modal-fullscreen.Cqlf6PWo.js.map → modal-fullscreen.BgqNc9jE.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js → modal.vue_vue_type_script_setup_true_lang.Dr847POU.js} +6 -6
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js.map → modal.vue_vue_type_script_setup_true_lang.Dr847POU.js.map} +1 -1
- package/dist/chunks/{pagination.C65tc-nX.js → pagination.Bi5BwIWq.js} +4 -4
- package/dist/chunks/{pagination.C65tc-nX.js.map → pagination.Bi5BwIWq.js.map} +1 -1
- package/dist/chunks/{popover.DjbACET6.js → popover.R5OM_tFu.js} +3 -3
- package/dist/chunks/{popover.DjbACET6.js.map → popover.R5OM_tFu.js.map} +1 -1
- package/dist/chunks/{promo-banner.ZCfJQh-S.js → promo-banner.DFt2dVxk.js} +3 -3
- package/dist/chunks/{promo-banner.ZCfJQh-S.js.map → promo-banner.DFt2dVxk.js.map} +1 -1
- package/dist/chunks/{radio-group.Tgf3BF5X.js → radio-group.muZVaVEm.js} +3 -3
- package/dist/chunks/{radio-group.Tgf3BF5X.js.map → radio-group.muZVaVEm.js.map} +1 -1
- package/dist/chunks/{search-bar.CTn5DIQZ.js → search-bar.DlVK3bBQ.js} +4 -4
- package/dist/chunks/{search-bar.CTn5DIQZ.js.map → search-bar.DlVK3bBQ.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CnE-aV2P.js → secondary-nav.CIEVFTYS.js} +3 -3
- package/dist/chunks/{secondary-nav.CnE-aV2P.js.map → secondary-nav.CIEVFTYS.js.map} +1 -1
- package/dist/chunks/{selection-card-group.C2OFZgKd.js → selection-card-group.BgANSy3b.js} +11 -11
- package/dist/chunks/{selection-card-group.C2OFZgKd.js.map → selection-card-group.BgANSy3b.js.map} +1 -1
- package/dist/chunks/{sidepanel.Drn-lKR3.js → sidepanel.BjR0Ab22.js} +5 -5
- package/dist/chunks/{sidepanel.Drn-lKR3.js.map → sidepanel.BjR0Ab22.js.map} +1 -1
- package/dist/chunks/{step.BGFaHGFO.js → step.7l-t-eN9.js} +2 -2
- package/dist/chunks/{step.BGFaHGFO.js.map → step.7l-t-eN9.js.map} +1 -1
- package/dist/chunks/{structured-list-item.CWiwoP5F.js → structured-list-item.BMsATRrU.js} +4 -4
- package/dist/chunks/{structured-list-item.CWiwoP5F.js.map → structured-list-item.BMsATRrU.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.DOYW579A.js → summary-grid.types.lGX16F4w.js} +126 -114
- package/dist/chunks/summary-grid.types.lGX16F4w.js.map +1 -0
- package/dist/chunks/{tabs.DZk78MLK.js → tabs.BVuOvNxx.js} +17 -17
- package/dist/chunks/{tabs.DZk78MLK.js.map → tabs.BVuOvNxx.js.map} +1 -1
- package/dist/chunks/{teleport.zSiKZmRE.js → teleport.CfGWjxe2.js} +17 -26
- package/dist/chunks/teleport.CfGWjxe2.js.map +1 -0
- package/dist/chunks/{textarea.CR7su54i.js → textarea.CAc_VYFm.js} +4 -4
- package/dist/chunks/{textarea.CR7su54i.js.map → textarea.CAc_VYFm.js.map} +1 -1
- package/dist/chunks/timeline-item.BQ4qiBii.js +567 -0
- package/dist/chunks/timeline-item.BQ4qiBii.js.map +1 -0
- package/dist/chunks/{toast.DxVfamh-.js → toast.BOpWHAfu.js} +3 -3
- package/dist/chunks/{toast.DxVfamh-.js.map → toast.BOpWHAfu.js.map} +1 -1
- package/dist/chunks/{toggle-button.D-9TFTy8.js → toggle-button.E0VQtyEX.js} +2 -2
- package/dist/chunks/{toggle-button.D-9TFTy8.js.map → toggle-button.E0VQtyEX.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js → tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js.map → tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.CQKeFUJd.js → use-cached-selected-values.DHUa2Emx.js} +6 -6
- package/dist/chunks/{use-cached-selected-values.CQKeFUJd.js.map → use-cached-selected-values.DHUa2Emx.js.map} +1 -1
- package/dist/chunks/use-click-outside.BnhTgpSt.js +14 -0
- package/dist/chunks/use-click-outside.BnhTgpSt.js.map +1 -0
- package/dist/chunks/{use-country-items.BMhCqIWd.js → use-country-items.4kZgVg_l.js} +2 -2
- package/dist/chunks/{use-country-items.BMhCqIWd.js.map → use-country-items.4kZgVg_l.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +55 -55
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +13 -2
- package/dist/styles/bento-light.css +13 -2
- package/dist/styles/bento.css +13 -2
- package/dist/styles/legacy.css +14 -4
- package/dist/styles/styleguide.css +13 -2
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/button.DEVuqLVT.js.map +0 -1
- package/dist/chunks/code-snippet.DJgiqDzZ.js +0 -422
- package/dist/chunks/code-snippet.DJgiqDzZ.js.map +0 -1
- package/dist/chunks/dashed-underline.DWhGZIhS.js +0 -80
- package/dist/chunks/dashed-underline.DWhGZIhS.js.map +0 -1
- package/dist/chunks/data-grid-template.LlK-7o84.js +0 -93
- package/dist/chunks/data-grid-template.LlK-7o84.js.map +0 -1
- package/dist/chunks/data-grid.CsyayKK3.js.map +0 -1
- package/dist/chunks/file-uploader.D3KUe-MO.js.map +0 -1
- package/dist/chunks/filter-bar.cRJmUX-v.js +0 -2771
- package/dist/chunks/filter-bar.cRJmUX-v.js.map +0 -1
- package/dist/chunks/i18n.D9azDLPe.js.map +0 -1
- package/dist/chunks/summary-grid.types.DOYW579A.js.map +0 -1
- package/dist/chunks/teleport.zSiKZmRE.js.map +0 -1
- package/dist/chunks/timeline-item.BhQp0ICP.js +0 -560
- package/dist/chunks/timeline-item.BhQp0ICP.js.map +0 -1
|
@@ -0,0 +1,2886 @@
|
|
|
1
|
+
import { defineComponent as z, useSlots as Le, useAttrs as Et, computed as c, ref as M, createBlock as E, openBlock as v, unref as C, normalizeClass as ie, withCtx as y, createElementVNode as j, renderSlot as re, createCommentVNode as Q, createVNode as $, createTextVNode as G, toDisplayString as Z, watch as ue, createElementBlock as J, nextTick as st, resolveComponent as P, withKeys as be, toRef as x, onBeforeUpdate as Oe, provide as it, mergeProps as oe, Fragment as Ae, reactive as Lt, createSlots as De, renderList as fe, normalizeProps as $e, guardReactiveProps as Pe, onMounted as rt, resolveDynamicComponent as Te } from "vue";
|
|
2
|
+
import { B as Ue, b as he } from "./search-bar.DlVK3bBQ.js";
|
|
3
|
+
import { u as Ot } from "./use-bento-toast-controller.D3LA1FCd.js";
|
|
4
|
+
import { u as de } from "./i18n.B6g5VX0q.js";
|
|
5
|
+
import { b as Rt } from "./index.BzJQl-2M.js";
|
|
6
|
+
import { F as ut } from "./fixed-scroller.DsTyshyt.js";
|
|
7
|
+
import { _ as wt } from "./modal.vue_vue_type_script_setup_true_lang.Dr847POU.js";
|
|
8
|
+
import { g as Vt } from "./base-modal.qhldLovE.js";
|
|
9
|
+
import { B as kt } from "./button.BHZgsGkp.js";
|
|
10
|
+
import { B as Je, I as Nt, b as Mt } from "./popover.R5OM_tFu.js";
|
|
11
|
+
import { B as Ht } from "./directive.Cbdox5VL.js";
|
|
12
|
+
import { B as jt } from "./events.FNmSWp_P.js";
|
|
13
|
+
import { g as ke } from "./generate-uid.NJ8tVoha.js";
|
|
14
|
+
import { u as Kt } from "./use-click-outside.BnhTgpSt.js";
|
|
15
|
+
import { C as qt } from "./cross-small.CFrBIeYK.js";
|
|
16
|
+
import { _ as ee } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
17
|
+
import { B as dt, a as ze } from "./base-button.DdNFlbgH.js";
|
|
18
|
+
import { B as pe, d as Ne } from "./typography.DN5eC5ch.js";
|
|
19
|
+
import { u as ct } from "./use-has-slot.B7eQSabc.js";
|
|
20
|
+
import { u as pt } from "./aria-label.CaUURpnB.js";
|
|
21
|
+
import { g as bt } from "./get-slot-text.DQlZEsId.js";
|
|
22
|
+
import { B as ft } from "./teleport.CfGWjxe2.js";
|
|
23
|
+
import { B as Jt } from "./radio-group.muZVaVEm.js";
|
|
24
|
+
import { t as Se } from "./chip.DbhxDQiT.js";
|
|
25
|
+
import { B as Me } from "./input-field.Cr1r2STY.js";
|
|
26
|
+
import { u as vt, B as zt } from "./dropdown.CVa4_qCe.js";
|
|
27
|
+
import { g as Yt } from "./focus-trap.D9cfQpl7.js";
|
|
28
|
+
import { a as Wt, C as Gt } from "./chevron-up.-0oLlHmh.js";
|
|
29
|
+
/* empty css */
|
|
30
|
+
import { B as He } from "./divider.qUOSAbU6.js";
|
|
31
|
+
import { c as Ye, b as Zt } from "./use-cached-selected-values.DHUa2Emx.js";
|
|
32
|
+
import { L as mt } from "./listbox-option-tag.BJh2kEN1.js";
|
|
33
|
+
import { B as Qt } from "./payment-method.eazefwm6.js";
|
|
34
|
+
import { u as Xt } from "./use-country-items.4kZgVg_l.js";
|
|
35
|
+
import { B as xt } from "./avatar.B0-9jC6H.js";
|
|
36
|
+
import { D as el, B as tl, i as we, b as ll } from "./date-range-picker.uGwtO7SA.js";
|
|
37
|
+
import { g as yt } from "./get-date-locale.BN8xEjY0.js";
|
|
38
|
+
import { D as We } from "./date-input.BqBdAO1E.js";
|
|
39
|
+
import { a as al, i as nl } from "./calendar.Dymq4e0Y.js";
|
|
40
|
+
import { f as ye } from "./date.CKXySBQv.js";
|
|
41
|
+
import { B as ol } from "./button-actions.ODJKaCW7.js";
|
|
42
|
+
import { B as sl } from "./date-picker.8jgg3MJm.js";
|
|
43
|
+
import { R as Ge } from "./refresh.C20ROVDS.js";
|
|
44
|
+
import "../assets/filter-bar.css";
|
|
45
|
+
var g = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.UPDATE = "update", e))(g || {}), _e = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.UPDATE_FILTER_VALUES = "update:filter-values", e))(_e || {}), ne = /* @__PURE__ */ ((e) => (e.BOOLEAN = "BentoBooleanFilter", e.RANGE = "BentoRangeFilter", e.INPUT = "BentoInputFilter", e.INPUT_DROPDOWN = "BentoInputWithDropdownFilter", e.SELECT = "BentoSelectFilter", e.SELECT_AVATAR = "BentoSelectAvatarFilter", e.SELECT_COUNTRY = "BentoSelectCountryFilter", e.SELECT_CURRENCY = "BentoSelectCurrencyFilter", e.SELECT_PAYMENT_METHOD = "BentoSelectPaymentMethodFilter", e.SELECT_TAG = "BentoSelectTagFilter", e.DATE = "BentoDateFilter", e.DATE_RANGE = "BentoDateRangeFilter", e))(ne || {});
|
|
46
|
+
const il = { class: "b-filter-bar-button__container" }, rl = { class: "b-filter-bar-button__label-container" }, ul = {}, dl = /* @__PURE__ */ z({
|
|
47
|
+
...ul,
|
|
48
|
+
__name: "filter-bar-button",
|
|
49
|
+
props: {
|
|
50
|
+
/**
|
|
51
|
+
* The number of applied values within the filter.
|
|
52
|
+
* Text can also be applied here such as 'All'.
|
|
53
|
+
* e.g. if 2 items in a dropdown filter have been applied, the number 2 will be shown here.
|
|
54
|
+
*/
|
|
55
|
+
appliedFiltersCount: { type: [String, Number], default: null },
|
|
56
|
+
/**
|
|
57
|
+
* Disables button functionality.
|
|
58
|
+
*/
|
|
59
|
+
disabled: { type: Boolean, default: !1 },
|
|
60
|
+
/**
|
|
61
|
+
* Signifies if the filter is open or closed.
|
|
62
|
+
*/
|
|
63
|
+
isFilterOpen: { type: Boolean, default: !1 },
|
|
64
|
+
/**
|
|
65
|
+
* Signifies if the filter is a persistent filter
|
|
66
|
+
*/
|
|
67
|
+
isPersistentFilter: { type: Boolean, default: !1 },
|
|
68
|
+
/**
|
|
69
|
+
* Renders the button without the applied state styles
|
|
70
|
+
*/
|
|
71
|
+
noAppliedStateStyles: { type: Boolean, default: !1 },
|
|
72
|
+
/**
|
|
73
|
+
* A secondary label to be added next to the primary for additional filtering information.
|
|
74
|
+
* i.e. Can be used to show the set value for said filter.
|
|
75
|
+
*/
|
|
76
|
+
secondaryLabel: { type: String, default: null }
|
|
77
|
+
},
|
|
78
|
+
emits: ["click"],
|
|
79
|
+
setup(e, { emit: n }) {
|
|
80
|
+
const t = e, r = n, l = Le(), a = Et(), i = ct(l), s = c(() => l.default ? bt(l)("default") : null), u = c(() => !i("default") && i("iconLeft")), p = pt({ ariaLabel: s }), f = M(null), h = c(() => {
|
|
81
|
+
var I;
|
|
82
|
+
return {
|
|
83
|
+
"aria-controls": (I = a["aria-controls"]) == null ? void 0 : I.toString()
|
|
84
|
+
};
|
|
85
|
+
}), _ = c(
|
|
86
|
+
() => (t.appliedFiltersCount || t.secondaryLabel || t.isPersistentFilter) && !t.noAppliedStateStyles
|
|
87
|
+
), d = c(() => ({
|
|
88
|
+
"b-filter-bar-button--applied": _.value,
|
|
89
|
+
"b-filter-bar-button--filter-open": t.isFilterOpen && !_.value,
|
|
90
|
+
"b-filter-bar-button--filter-open-applied": t.isFilterOpen && _.value,
|
|
91
|
+
"b-filter-bar-button--with-secondary-label": t.secondaryLabel,
|
|
92
|
+
"b-filter-bar-button--with-counter": t.appliedFiltersCount,
|
|
93
|
+
"b-filter-bar-button--icon-only": u.value
|
|
94
|
+
})), A = (I) => {
|
|
95
|
+
I.preventDefault(), t.disabled || r("click", I);
|
|
96
|
+
};
|
|
97
|
+
return (I, T) => (v(), E(C(dt), {
|
|
98
|
+
ref_key: "filterBarButtonRef",
|
|
99
|
+
ref: f,
|
|
100
|
+
class: ie(["b-filter-bar-button", d.value]),
|
|
101
|
+
disabled: e.disabled,
|
|
102
|
+
"aria-label": C(p),
|
|
103
|
+
"aria-controls": h.value["aria-controls"],
|
|
104
|
+
type: "button",
|
|
105
|
+
onClick: A
|
|
106
|
+
}, {
|
|
107
|
+
iconRight: y(() => [
|
|
108
|
+
e.appliedFiltersCount && !u.value ? (v(), E(C(pe), {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "b-filter-bar-button__counter",
|
|
111
|
+
el: "span",
|
|
112
|
+
variant: "body",
|
|
113
|
+
stronger: ""
|
|
114
|
+
}, {
|
|
115
|
+
default: y(() => [
|
|
116
|
+
G(Z(e.appliedFiltersCount), 1)
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
})) : Q("", !0)
|
|
120
|
+
]),
|
|
121
|
+
default: y(() => [
|
|
122
|
+
j("div", il, [
|
|
123
|
+
C(i)("iconLeft") ? re(I.$slots, "iconLeft", { key: 0 }, void 0, !0) : Q("", !0),
|
|
124
|
+
j("div", rl, [
|
|
125
|
+
$(C(pe), {
|
|
126
|
+
el: "span",
|
|
127
|
+
variant: "body",
|
|
128
|
+
stronger: "",
|
|
129
|
+
class: "b-filter-bar-button__label"
|
|
130
|
+
}, {
|
|
131
|
+
default: y(() => [
|
|
132
|
+
j("span", null, [
|
|
133
|
+
re(I.$slots, "default", {}, void 0, !0)
|
|
134
|
+
]),
|
|
135
|
+
e.secondaryLabel && !u.value ? (v(), E(C(pe), {
|
|
136
|
+
key: 0,
|
|
137
|
+
el: "span",
|
|
138
|
+
variant: "body",
|
|
139
|
+
stronger: "",
|
|
140
|
+
class: "b-filter-bar-button__label"
|
|
141
|
+
}, {
|
|
142
|
+
default: y(() => T[0] || (T[0] = [
|
|
143
|
+
G(":")
|
|
144
|
+
])),
|
|
145
|
+
_: 1
|
|
146
|
+
})) : Q("", !0)
|
|
147
|
+
]),
|
|
148
|
+
_: 3
|
|
149
|
+
}),
|
|
150
|
+
e.secondaryLabel && !u.value ? (v(), E(C(pe), {
|
|
151
|
+
key: 0,
|
|
152
|
+
el: "span",
|
|
153
|
+
variant: "body",
|
|
154
|
+
stronger: "",
|
|
155
|
+
class: "b-filter-bar-button__secondary-label"
|
|
156
|
+
}, {
|
|
157
|
+
default: y(() => [
|
|
158
|
+
G(Z(e.secondaryLabel), 1)
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
})) : Q("", !0)
|
|
162
|
+
])
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
_: 3
|
|
166
|
+
}, 8, ["class", "disabled", "aria-label", "aria-controls"]));
|
|
167
|
+
}
|
|
168
|
+
}), Ee = /* @__PURE__ */ ee(dl, [["__scopeId", "data-v-3556e231"]]), Ze = 430, Qe = 700;
|
|
169
|
+
function cl(e, n) {
|
|
170
|
+
const t = M("div"), r = M(!1), l = M(0), a = c(() => !(l.value < Ze && n.value.small === "multi-line"));
|
|
171
|
+
function i() {
|
|
172
|
+
r.value = !1, t.value = "div";
|
|
173
|
+
}
|
|
174
|
+
function s() {
|
|
175
|
+
r.value = !0, t.value = ut;
|
|
176
|
+
}
|
|
177
|
+
function u() {
|
|
178
|
+
l.value > Qe || l.value < Qe && l.value >= Ze && n.value.medium === "multi-line" ? i() : s();
|
|
179
|
+
}
|
|
180
|
+
return ue(() => n.value, u), Rt(e, (p) => {
|
|
181
|
+
l.value = p[0].contentRect.width, u();
|
|
182
|
+
}), {
|
|
183
|
+
screenLayoutComponent: t,
|
|
184
|
+
showSearchbarInsideContainer: a,
|
|
185
|
+
isOneLineLayout: r
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const pl = {}, bl = /* @__PURE__ */ z({
|
|
189
|
+
...pl,
|
|
190
|
+
__name: "filter-bar-button-group",
|
|
191
|
+
props: {
|
|
192
|
+
isActive: { type: Boolean, default: !1 },
|
|
193
|
+
skipGrouping: { type: Boolean, default: !1 }
|
|
194
|
+
},
|
|
195
|
+
setup(e) {
|
|
196
|
+
const n = e, t = c(() => ({
|
|
197
|
+
"b-filter-bar-button-group--active": n.isActive,
|
|
198
|
+
"b-filter-bar-button-group--grouped": !n.skipGrouping
|
|
199
|
+
}));
|
|
200
|
+
return (r, l) => (v(), J("div", {
|
|
201
|
+
class: ie(["b-filter-bar-button-group", t.value])
|
|
202
|
+
}, [
|
|
203
|
+
re(r.$slots, "default", {}, void 0, !0)
|
|
204
|
+
], 2));
|
|
205
|
+
}
|
|
206
|
+
}), fl = /* @__PURE__ */ ee(bl, [["__scopeId", "data-v-5b52b43a"]]);
|
|
207
|
+
var se = /* @__PURE__ */ ((e) => (e.APPLY = "apply", e.CLEAR = "clear", e.OPEN = "open", e.CLOSE = "close", e.RESET = "reset", e))(se || {});
|
|
208
|
+
const Xe = {
|
|
209
|
+
"en-US": {
|
|
210
|
+
apply: "Apply",
|
|
211
|
+
clear: "Clear",
|
|
212
|
+
clearFilter: "Clear filter {function}",
|
|
213
|
+
filterButton: "Filter by {function}",
|
|
214
|
+
filtersHaveBeenCleared: "Filters have been cleared",
|
|
215
|
+
reset: "Reset",
|
|
216
|
+
resetFilter: "Reset filter {function}"
|
|
217
|
+
},
|
|
218
|
+
"ja-JP": {
|
|
219
|
+
apply: "適用",
|
|
220
|
+
clear: "クリア",
|
|
221
|
+
reset: "リセット"
|
|
222
|
+
},
|
|
223
|
+
"pt-BR": {
|
|
224
|
+
apply: "Aplicar",
|
|
225
|
+
clear: "Limpar",
|
|
226
|
+
reset: "Reiniciar"
|
|
227
|
+
}
|
|
228
|
+
}, vl = z({
|
|
229
|
+
i18n: { messages: Xe },
|
|
230
|
+
name: "bento-base-filter",
|
|
231
|
+
components: {
|
|
232
|
+
BentoPopover: Je,
|
|
233
|
+
BentoTeleport: ft,
|
|
234
|
+
FilterBarButton: Ee,
|
|
235
|
+
FilterBarButtonGroup: fl,
|
|
236
|
+
CrossSmallIcon: qt
|
|
237
|
+
},
|
|
238
|
+
directives: { BentoClickOutsideDirective: Ht },
|
|
239
|
+
props: {
|
|
240
|
+
/**
|
|
241
|
+
* Total count of applied filters
|
|
242
|
+
*/
|
|
243
|
+
appliedFiltersCount: { type: [String, Number], default: null },
|
|
244
|
+
/**
|
|
245
|
+
* Overrides the label of the popover visibility toggle button text.
|
|
246
|
+
*/
|
|
247
|
+
buttonLabel: { type: String, default: void 0 },
|
|
248
|
+
/**
|
|
249
|
+
* Sets the secondary label text of the popover visibility toggle button text.
|
|
250
|
+
*/
|
|
251
|
+
buttonSecondaryLabel: { type: String, default: void 0 },
|
|
252
|
+
/**
|
|
253
|
+
* Disables the filter from being interacted with.
|
|
254
|
+
*/
|
|
255
|
+
disabled: { type: Boolean, default: !1 },
|
|
256
|
+
/**
|
|
257
|
+
* Default value of the filter to reset to.
|
|
258
|
+
*/
|
|
259
|
+
defaultValue: {
|
|
260
|
+
type: [Object, Number, Boolean, Array, String, Date],
|
|
261
|
+
default: null
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
265
|
+
* Used for the allFiltersModal component.
|
|
266
|
+
*/
|
|
267
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
268
|
+
/**
|
|
269
|
+
* Allows to handle the controls (apply/clear) from outside
|
|
270
|
+
* of the component
|
|
271
|
+
*/
|
|
272
|
+
controlled: { type: Boolean, default: !1 },
|
|
273
|
+
/**
|
|
274
|
+
* Disable the "apply" button
|
|
275
|
+
*/
|
|
276
|
+
disableApplyButton: { type: Boolean, default: !1 },
|
|
277
|
+
/**
|
|
278
|
+
* Disable the secondary button action.
|
|
279
|
+
*/
|
|
280
|
+
disableSecondaryButton: { type: Boolean, default: !1 },
|
|
281
|
+
/**
|
|
282
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
283
|
+
* Should be unique per filter bar.
|
|
284
|
+
*/
|
|
285
|
+
field: { type: String, required: !0 },
|
|
286
|
+
/**
|
|
287
|
+
* Label text to be displayed
|
|
288
|
+
*/
|
|
289
|
+
label: { type: String, required: !0 },
|
|
290
|
+
/**
|
|
291
|
+
* Sets the size of the container to fit its content
|
|
292
|
+
*/
|
|
293
|
+
fitContent: Je.props.fitContent,
|
|
294
|
+
/**
|
|
295
|
+
* The current value of the filter, used for v-model.
|
|
296
|
+
*/
|
|
297
|
+
value: {
|
|
298
|
+
type: [Object, Number, Boolean, Array, String, Date],
|
|
299
|
+
default: void 0
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
emits: [
|
|
303
|
+
se.APPLY,
|
|
304
|
+
se.CLEAR,
|
|
305
|
+
se.OPEN,
|
|
306
|
+
se.CLOSE,
|
|
307
|
+
se.RESET
|
|
308
|
+
],
|
|
309
|
+
setup(e, { emit: n }) {
|
|
310
|
+
const { t } = de({ messages: Xe }), r = ke("base-filter-popover"), l = M(!1), a = M(null), i = M(null), s = c(() => e.defaultValue !== null), u = c(() => s.value ? JSON.stringify(e.value) !== JSON.stringify(e.defaultValue) : e.appliedFiltersCount || e.buttonSecondaryLabel), p = c(
|
|
311
|
+
() => s.value ? t("filterButton", {
|
|
312
|
+
function: e.label
|
|
313
|
+
}) : h.value
|
|
314
|
+
), f = c(
|
|
315
|
+
() => s.value ? t("resetFilter", {
|
|
316
|
+
function: h.value
|
|
317
|
+
}) : t("clearFilter", {
|
|
318
|
+
function: h.value
|
|
319
|
+
})
|
|
320
|
+
), h = c(() => e.buttonLabel || e.label), _ = async () => {
|
|
321
|
+
var F, R;
|
|
322
|
+
await st(), (R = (F = a.value) == null ? void 0 : F.$el) == null || R.focus();
|
|
323
|
+
}, d = () => {
|
|
324
|
+
l.value && (l.value = !1, _(), n(se.CLOSE));
|
|
325
|
+
}, A = () => {
|
|
326
|
+
s.value ? n(se.RESET) : n(se.CLEAR), _();
|
|
327
|
+
}, I = () => {
|
|
328
|
+
d(), A();
|
|
329
|
+
}, T = () => d(), V = () => {
|
|
330
|
+
l.value ? d() : (l.value = !0, n(se.OPEN));
|
|
331
|
+
}, w = () => {
|
|
332
|
+
d(), n(se.APPLY);
|
|
333
|
+
}, U = c(() => [
|
|
334
|
+
{
|
|
335
|
+
title: t("apply"),
|
|
336
|
+
event: w,
|
|
337
|
+
disabled: e.disableApplyButton
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: s.value ? t("reset") : t("clear"),
|
|
341
|
+
event: I,
|
|
342
|
+
disabled: e.disableSecondaryButton
|
|
343
|
+
}
|
|
344
|
+
]);
|
|
345
|
+
return ue(
|
|
346
|
+
() => l.value,
|
|
347
|
+
(F, R) => {
|
|
348
|
+
var k, N;
|
|
349
|
+
!F && R && (N = (k = a.value) == null ? void 0 : k.filterBarButtonRef) != null && N.bentoBaseButtonRef && a.value.filterBarButtonRef.bentoBaseButtonRef.focus();
|
|
350
|
+
}
|
|
351
|
+
), Kt(i, T, { ignore: [a] }), {
|
|
352
|
+
// Values
|
|
353
|
+
actions: U,
|
|
354
|
+
popoverId: r,
|
|
355
|
+
isFilterOpen: l,
|
|
356
|
+
isPersistentFilter: s,
|
|
357
|
+
isValueChanged: u,
|
|
358
|
+
computedAriaLabel: p,
|
|
359
|
+
computedButtonText: h,
|
|
360
|
+
computedClearButtonLabel: f,
|
|
361
|
+
// Enums
|
|
362
|
+
BentoTooltipPosition: jt,
|
|
363
|
+
// Events
|
|
364
|
+
onClickFilter: V,
|
|
365
|
+
onClickApply: w,
|
|
366
|
+
onClickSecondaryAction: I,
|
|
367
|
+
onClickOutside: T,
|
|
368
|
+
closePopover: d,
|
|
369
|
+
resetFilter: A,
|
|
370
|
+
// Refs
|
|
371
|
+
filterButtonRef: a,
|
|
372
|
+
popoverRef: i
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}), ml = { key: 0 }, yl = {
|
|
376
|
+
key: 1,
|
|
377
|
+
class: "b-base-filter"
|
|
378
|
+
};
|
|
379
|
+
function Fl(e, n, t, r, l, a) {
|
|
380
|
+
const i = P("filter-bar-button"), s = P("cross-small-icon"), u = P("filter-bar-button-group"), p = P("bento-popover"), f = P("bento-teleport");
|
|
381
|
+
return e.onlySlot ? (v(), J("div", ml, [
|
|
382
|
+
re(e.$slots, "default", {}, void 0, !0)
|
|
383
|
+
])) : (v(), J("div", yl, [
|
|
384
|
+
$(u, {
|
|
385
|
+
"is-active": e.isFilterOpen,
|
|
386
|
+
"skip-grouping": !e.isValueChanged
|
|
387
|
+
}, {
|
|
388
|
+
default: y(() => [
|
|
389
|
+
$(i, {
|
|
390
|
+
ref: "filterButtonRef",
|
|
391
|
+
"aria-label": e.computedAriaLabel,
|
|
392
|
+
"aria-controls": e.isFilterOpen ? e.popoverId : null,
|
|
393
|
+
"applied-filters-count": e.appliedFiltersCount,
|
|
394
|
+
disabled: e.disabled,
|
|
395
|
+
"is-persistent-filter": e.isPersistentFilter,
|
|
396
|
+
"is-filter-open": e.isFilterOpen,
|
|
397
|
+
"secondary-label": e.buttonSecondaryLabel,
|
|
398
|
+
onClick: e.onClickFilter,
|
|
399
|
+
onKeydown: be(e.closePopover, ["esc"])
|
|
400
|
+
}, {
|
|
401
|
+
default: y(() => [
|
|
402
|
+
G(Z(e.computedButtonText), 1)
|
|
403
|
+
]),
|
|
404
|
+
_: 1
|
|
405
|
+
}, 8, ["aria-label", "aria-controls", "applied-filters-count", "disabled", "is-persistent-filter", "is-filter-open", "secondary-label", "onClick", "onKeydown"]),
|
|
406
|
+
e.isValueChanged ? (v(), E(i, {
|
|
407
|
+
key: 0,
|
|
408
|
+
"applied-filters-count": e.appliedFiltersCount,
|
|
409
|
+
disabled: e.disabled,
|
|
410
|
+
"is-persistent-filter": e.isPersistentFilter,
|
|
411
|
+
"is-filter-open": e.isFilterOpen,
|
|
412
|
+
"secondary-label": e.buttonSecondaryLabel,
|
|
413
|
+
onClick: e.resetFilter
|
|
414
|
+
}, {
|
|
415
|
+
iconLeft: y(() => [
|
|
416
|
+
$(s, { "svg-title": e.computedClearButtonLabel }, null, 8, ["svg-title"])
|
|
417
|
+
]),
|
|
418
|
+
_: 1
|
|
419
|
+
}, 8, ["applied-filters-count", "disabled", "is-persistent-filter", "is-filter-open", "secondary-label", "onClick"])) : Q("", !0)
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
}, 8, ["is-active", "skip-grouping"]),
|
|
423
|
+
e.filterButtonRef ? (v(), E(f, { key: 0 }, {
|
|
424
|
+
default: y(() => [
|
|
425
|
+
e.filterButtonRef ? (v(), E(p, {
|
|
426
|
+
key: 0,
|
|
427
|
+
id: e.popoverId,
|
|
428
|
+
ref: "popoverRef",
|
|
429
|
+
class: "b-base-filter__popover",
|
|
430
|
+
divider: "",
|
|
431
|
+
open: e.isFilterOpen,
|
|
432
|
+
actions: e.controlled ? null : e.actions,
|
|
433
|
+
"actions-layout": "space-between",
|
|
434
|
+
"target-element": e.filterButtonRef,
|
|
435
|
+
title: e.controlled ? null : e.label,
|
|
436
|
+
"fit-content": e.fitContent,
|
|
437
|
+
position: "bottom-start",
|
|
438
|
+
"without-space": e.controlled,
|
|
439
|
+
"fallback-position": ["bottom-end"]
|
|
440
|
+
}, {
|
|
441
|
+
default: y(() => [
|
|
442
|
+
j("div", {
|
|
443
|
+
onKeydown: n[0] || (n[0] = be((...h) => e.closePopover && e.closePopover(...h), ["esc"]))
|
|
444
|
+
}, [
|
|
445
|
+
re(e.$slots, "default", {}, void 0, !0)
|
|
446
|
+
], 32)
|
|
447
|
+
]),
|
|
448
|
+
_: 3
|
|
449
|
+
}, 8, ["id", "open", "actions", "target-element", "title", "fit-content", "without-space"])) : Q("", !0)
|
|
450
|
+
]),
|
|
451
|
+
_: 3
|
|
452
|
+
})) : Q("", !0)
|
|
453
|
+
]));
|
|
454
|
+
}
|
|
455
|
+
const Fe = /* @__PURE__ */ ee(vl, [["render", Fl], ["__scopeId", "data-v-de3ab178"]]), gl = (e) => e instanceof Array, xe = (e) => gl(e) ? e.length === 0 || e.every((n) => n === "") : !e, et = (e, n) => JSON.stringify(e) === JSON.stringify(n), ve = (e, n) => {
|
|
456
|
+
const t = M(e.value);
|
|
457
|
+
ue(
|
|
458
|
+
() => e.value,
|
|
459
|
+
() => {
|
|
460
|
+
t.value = e.value;
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
const r = c(() => xe(e.value)), l = c(
|
|
464
|
+
() => n.value !== null ? et(n.value, e.value) : r.value
|
|
465
|
+
), a = c(() => et(t.value, e.value) || xe(t.value) && r.value);
|
|
466
|
+
return {
|
|
467
|
+
internalFilterValue: t,
|
|
468
|
+
isSecondaryButtonDisabled: l,
|
|
469
|
+
isApplyButtonDisabled: a
|
|
470
|
+
};
|
|
471
|
+
}, hl = {
|
|
472
|
+
name: "bento-input-filter"
|
|
473
|
+
}, Sl = /* @__PURE__ */ z({
|
|
474
|
+
...hl,
|
|
475
|
+
props: {
|
|
476
|
+
defaultValue: { default: null },
|
|
477
|
+
disabled: { type: Boolean, default: !1 },
|
|
478
|
+
field: {},
|
|
479
|
+
label: {},
|
|
480
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
481
|
+
options: { default: void 0 },
|
|
482
|
+
value: { default: null }
|
|
483
|
+
},
|
|
484
|
+
emits: ["input", "update"],
|
|
485
|
+
setup(e, { emit: n }) {
|
|
486
|
+
var N, te;
|
|
487
|
+
const t = e, r = n, l = M(null), a = M((te = (N = t == null ? void 0 : t.options) == null ? void 0 : N.dropdown) == null ? void 0 : te.value), i = c(
|
|
488
|
+
() => {
|
|
489
|
+
var D, K;
|
|
490
|
+
return ((D = t == null ? void 0 : t.options) == null ? void 0 : D.variant) === "dropdown" && ((K = t == null ? void 0 : t.options) == null ? void 0 : K.dropdown) !== void 0;
|
|
491
|
+
}
|
|
492
|
+
), s = c(
|
|
493
|
+
() => {
|
|
494
|
+
var D;
|
|
495
|
+
return i.value ? { ...(D = t == null ? void 0 : t.options) == null ? void 0 : D.dropdown, value: a.value } : void 0;
|
|
496
|
+
}
|
|
497
|
+
), u = c(() => {
|
|
498
|
+
var D;
|
|
499
|
+
return ((D = t == null ? void 0 : t.options) == null ? void 0 : D.variant) === "dropdown" ? "dropdown" : "default";
|
|
500
|
+
}), p = c(
|
|
501
|
+
() => {
|
|
502
|
+
var D;
|
|
503
|
+
return i.value ? (D = t.value) == null ? void 0 : D.inputValue : t == null ? void 0 : t.value;
|
|
504
|
+
}
|
|
505
|
+
), { internalFilterValue: f, isSecondaryButtonDisabled: h, isApplyButtonDisabled: _ } = ve(
|
|
506
|
+
p,
|
|
507
|
+
x(t, "defaultValue")
|
|
508
|
+
), d = c(() => t.label), A = c(() => Se(p.value, 12)), I = c(() => ({
|
|
509
|
+
"b-input-filter--only-slot": t.onlySlot
|
|
510
|
+
}));
|
|
511
|
+
Oe(() => {
|
|
512
|
+
f.value === "" && (f.value = null);
|
|
513
|
+
}), ue(l, () => {
|
|
514
|
+
var D;
|
|
515
|
+
(D = l.value) == null || D.focusInput();
|
|
516
|
+
});
|
|
517
|
+
const T = () => {
|
|
518
|
+
f.value = p.value;
|
|
519
|
+
}, V = () => {
|
|
520
|
+
!f.value && t.defaultValue !== null && (f.value = t.defaultValue), r("update", {
|
|
521
|
+
...t,
|
|
522
|
+
value: i.value ? {
|
|
523
|
+
inputValue: f.value,
|
|
524
|
+
dropdownValue: a.value
|
|
525
|
+
} : f.value
|
|
526
|
+
});
|
|
527
|
+
}, w = () => r("update", { ...t, value: t.defaultValue }), U = () => {
|
|
528
|
+
f.value = null, V();
|
|
529
|
+
}, F = () => {
|
|
530
|
+
r("input", { ...t, value: f.value });
|
|
531
|
+
}, R = (D) => {
|
|
532
|
+
f.value = D;
|
|
533
|
+
}, k = (D) => {
|
|
534
|
+
a.value = D;
|
|
535
|
+
};
|
|
536
|
+
return it(Nt, i.value), ue(
|
|
537
|
+
() => t.options,
|
|
538
|
+
() => {
|
|
539
|
+
var D, K, q;
|
|
540
|
+
((D = t.options) != null && D.dropdown || (K = t.options) != null && K.dropdownPosition || (q = t.options) != null && q.variant) && Ne(
|
|
541
|
+
'BentoInputFilter "options" property',
|
|
542
|
+
`BentoInputFilter "options" no longer supports "dropdown", "dropdownPosition" or "variant" attributes.
|
|
543
|
+
Use the "BentoFilterItemType.INPUT_DROPDOWN" instead of "BentoFilterItemType.INPUT"
|
|
544
|
+
<bento-filter-bar
|
|
545
|
+
:config="[{
|
|
546
|
+
field: 'name',
|
|
547
|
+
label: 'Name',
|
|
548
|
+
type: BentoFilterItemType.INPUT_DROPDOWN,
|
|
549
|
+
options: [...],
|
|
550
|
+
}]"
|
|
551
|
+
/>`,
|
|
552
|
+
"2.0.0"
|
|
553
|
+
);
|
|
554
|
+
},
|
|
555
|
+
{ immediate: !0 }
|
|
556
|
+
), (D, K) => (v(), E(C(Fe), oe(D.$props, {
|
|
557
|
+
"button-label": d.value,
|
|
558
|
+
"button-secondary-label": A.value,
|
|
559
|
+
"disable-apply-button": C(_),
|
|
560
|
+
"disable-secondary-button": C(h),
|
|
561
|
+
"only-slot": D.onlySlot,
|
|
562
|
+
"popover-overflow-visible": i.value,
|
|
563
|
+
onApply: V,
|
|
564
|
+
onClear: U,
|
|
565
|
+
onOpen: T,
|
|
566
|
+
onReset: w
|
|
567
|
+
}), {
|
|
568
|
+
default: y(() => {
|
|
569
|
+
var q, X;
|
|
570
|
+
return [
|
|
571
|
+
j("div", {
|
|
572
|
+
class: ie(["b-input-filter", I.value]),
|
|
573
|
+
onKeydown: be(V, ["enter"]),
|
|
574
|
+
onInput: F
|
|
575
|
+
}, [
|
|
576
|
+
$(C(Me), {
|
|
577
|
+
ref_key: "inputTextRef",
|
|
578
|
+
ref: l,
|
|
579
|
+
dropdown: s.value,
|
|
580
|
+
"dropdown-position": (q = D.options) == null ? void 0 : q.dropdownPosition,
|
|
581
|
+
placeholder: (X = D.options) == null ? void 0 : X.placeholder,
|
|
582
|
+
variant: u.value,
|
|
583
|
+
value: C(f),
|
|
584
|
+
onInput: R,
|
|
585
|
+
onDropdownInput: k
|
|
586
|
+
}, null, 8, ["dropdown", "dropdown-position", "placeholder", "variant", "value"])
|
|
587
|
+
], 34)
|
|
588
|
+
];
|
|
589
|
+
}),
|
|
590
|
+
_: 1
|
|
591
|
+
}, 16, ["button-label", "button-secondary-label", "disable-apply-button", "disable-secondary-button", "only-slot", "popover-overflow-visible"]));
|
|
592
|
+
}
|
|
593
|
+
}), Ft = /* @__PURE__ */ ee(Sl, [["__scopeId", "data-v-3323f252"]]), Bl = {
|
|
594
|
+
name: "bento-input-with-dropdown-filter"
|
|
595
|
+
}, Cl = /* @__PURE__ */ z({
|
|
596
|
+
...Bl,
|
|
597
|
+
props: {
|
|
598
|
+
disabled: { type: Boolean },
|
|
599
|
+
defaultValue: { default: void 0 },
|
|
600
|
+
field: {},
|
|
601
|
+
label: {},
|
|
602
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
603
|
+
options: { default: void 0 },
|
|
604
|
+
value: { default: void 0 }
|
|
605
|
+
},
|
|
606
|
+
emits: [g.INPUT, g.UPDATE],
|
|
607
|
+
setup(e, { emit: n }) {
|
|
608
|
+
const t = e, r = n, l = M(null), { internalFilterValue: a, isSecondaryButtonDisabled: i, isApplyButtonDisabled: s } = ve(x(t, "value"), x(t, "defaultValue")), u = c(() => t.label), p = c(() => {
|
|
609
|
+
var F;
|
|
610
|
+
return Se((F = t.value) == null ? void 0 : F.inputValue, 12);
|
|
611
|
+
}), f = c(() => {
|
|
612
|
+
var F, R;
|
|
613
|
+
return {
|
|
614
|
+
...((F = t.options) == null ? void 0 : F.dropdown) || {},
|
|
615
|
+
value: (R = a.value) == null ? void 0 : R.dropdownValue
|
|
616
|
+
};
|
|
617
|
+
}), h = c(() => ({
|
|
618
|
+
"b-input-with-dropdown-filter--only-slot": t.onlySlot
|
|
619
|
+
})), _ = c(() => {
|
|
620
|
+
var R, k;
|
|
621
|
+
return !(!!((R = a.value) != null && R.inputValue) && !!((k = a.value) != null && k.dropdownValue)) || s.value;
|
|
622
|
+
});
|
|
623
|
+
Oe(() => {
|
|
624
|
+
var F;
|
|
625
|
+
((F = a.value) == null ? void 0 : F.inputValue) === "" && (a.value = { ...a.value, inputValue: void 0 });
|
|
626
|
+
}), ue(l, () => {
|
|
627
|
+
var F;
|
|
628
|
+
(F = l.value) == null || F.focusInput();
|
|
629
|
+
});
|
|
630
|
+
const d = () => {
|
|
631
|
+
a.value = t.value;
|
|
632
|
+
}, A = () => {
|
|
633
|
+
var F;
|
|
634
|
+
!((F = a.value) != null && F.inputValue) && t.defaultValue !== null && (a.value = { ...t.defaultValue }), r(g.UPDATE, {
|
|
635
|
+
...t,
|
|
636
|
+
value: a.value
|
|
637
|
+
});
|
|
638
|
+
}, I = () => r(g.UPDATE, { ...t, value: t.defaultValue }), T = () => {
|
|
639
|
+
a.value = null, A();
|
|
640
|
+
}, V = () => {
|
|
641
|
+
r(g.INPUT, { ...t, value: a.value });
|
|
642
|
+
}, w = (F) => {
|
|
643
|
+
a.value = { ...a.value, inputValue: F };
|
|
644
|
+
}, U = (F) => {
|
|
645
|
+
a.value = { ...a.value, dropdownValue: F };
|
|
646
|
+
};
|
|
647
|
+
return it(Mt, !0), (F, R) => (v(), E(C(Fe), oe(F.$props, {
|
|
648
|
+
"button-label": u.value,
|
|
649
|
+
"button-secondary-label": p.value,
|
|
650
|
+
"disable-apply-button": _.value,
|
|
651
|
+
"disable-secondary-button": C(i),
|
|
652
|
+
"only-slot": F.onlySlot,
|
|
653
|
+
onApply: A,
|
|
654
|
+
onClear: T,
|
|
655
|
+
onOpen: d,
|
|
656
|
+
onReset: I
|
|
657
|
+
}), {
|
|
658
|
+
default: y(() => {
|
|
659
|
+
var k, N;
|
|
660
|
+
return [
|
|
661
|
+
j("div", {
|
|
662
|
+
class: ie(["b-input-with-dropdown-filter", h.value]),
|
|
663
|
+
onKeydown: be(A, ["enter"]),
|
|
664
|
+
onInput: V
|
|
665
|
+
}, [
|
|
666
|
+
$(C(Me), {
|
|
667
|
+
ref_key: "inputTextRef",
|
|
668
|
+
ref: l,
|
|
669
|
+
dropdown: f.value,
|
|
670
|
+
"dropdown-position": (k = F.options) == null ? void 0 : k.dropdownPosition,
|
|
671
|
+
variant: "dropdown",
|
|
672
|
+
value: (N = C(a)) == null ? void 0 : N.inputValue,
|
|
673
|
+
onInput: w,
|
|
674
|
+
onDropdownInput: U
|
|
675
|
+
}, null, 8, ["dropdown", "dropdown-position", "value"])
|
|
676
|
+
], 34)
|
|
677
|
+
];
|
|
678
|
+
}),
|
|
679
|
+
_: 1
|
|
680
|
+
}, 16, ["button-label", "button-secondary-label", "disable-apply-button", "disable-secondary-button", "only-slot"]));
|
|
681
|
+
}
|
|
682
|
+
}), gt = /* @__PURE__ */ ee(Cl, [["__scopeId", "data-v-f096c58d"]]), _l = z({
|
|
683
|
+
name: "bento-date-filter",
|
|
684
|
+
components: {
|
|
685
|
+
BentoBaseFilter: Fe,
|
|
686
|
+
BentoDatePicker: sl,
|
|
687
|
+
BentoDivider: He,
|
|
688
|
+
Calendar: al
|
|
689
|
+
},
|
|
690
|
+
props: {
|
|
691
|
+
/**
|
|
692
|
+
* Disables the filter from being interacted with.
|
|
693
|
+
*/
|
|
694
|
+
disabled: { type: Boolean, default: !1 },
|
|
695
|
+
isDateInput: { type: Boolean, default: !0 },
|
|
696
|
+
/**
|
|
697
|
+
* Default value of the filter to reset to.
|
|
698
|
+
*/
|
|
699
|
+
defaultValue: { type: Date, default: null },
|
|
700
|
+
/**
|
|
701
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
702
|
+
* Should be unique per filter bar.
|
|
703
|
+
*/
|
|
704
|
+
field: { type: String, required: !0 },
|
|
705
|
+
/**
|
|
706
|
+
* Label text to be displayed
|
|
707
|
+
*/
|
|
708
|
+
label: { type: String, required: !0 },
|
|
709
|
+
/**
|
|
710
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
711
|
+
* Used for the allFiltersModal component.
|
|
712
|
+
*/
|
|
713
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
714
|
+
/**
|
|
715
|
+
* List of options that are needed to setup the filter
|
|
716
|
+
* Available options:
|
|
717
|
+
* - firstDayOfWeek: Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
718
|
+
* - isDateDisabled: Indicate if a date should be disabled or not
|
|
719
|
+
*/
|
|
720
|
+
options: {
|
|
721
|
+
type: Object,
|
|
722
|
+
default: void 0
|
|
723
|
+
},
|
|
724
|
+
/**
|
|
725
|
+
* Current value of the filter
|
|
726
|
+
*/
|
|
727
|
+
value: { type: Date, default: void 0 }
|
|
728
|
+
},
|
|
729
|
+
emits: [g.INPUT, g.UPDATE],
|
|
730
|
+
setup(e, { emit: n }) {
|
|
731
|
+
const { locale: t } = de(void 0, !0), r = yt(), { internalFilterValue: l, isSecondaryButtonDisabled: a, isApplyButtonDisabled: i } = ve(
|
|
732
|
+
x(e, "value"),
|
|
733
|
+
x(e, "defaultValue")
|
|
734
|
+
), s = c(
|
|
735
|
+
() => e.value ? ye(e.value, "dd MMM, yyyy", {
|
|
736
|
+
locale: r[t.value.substring(0, 2)] || r.enUS
|
|
737
|
+
}) : null
|
|
738
|
+
), u = c(() => e.label), p = c(() => s.value), f = () => {
|
|
739
|
+
n(g.UPDATE, { ...e, value: l.value });
|
|
740
|
+
}, h = () => {
|
|
741
|
+
l.value = null, f();
|
|
742
|
+
}, _ = () => {
|
|
743
|
+
l.value = e.defaultValue, f();
|
|
744
|
+
}, d = () => {
|
|
745
|
+
l.value = e.value;
|
|
746
|
+
}, A = (T) => {
|
|
747
|
+
l.value = T, n(g.INPUT, { ...e, value: l.value });
|
|
748
|
+
};
|
|
749
|
+
return {
|
|
750
|
+
// Values
|
|
751
|
+
internalFilterValue: l,
|
|
752
|
+
isApplyButtonDisabled: i,
|
|
753
|
+
isSecondaryButtonDisabled: a,
|
|
754
|
+
buttonLabel: u,
|
|
755
|
+
buttonSecondaryLabel: p,
|
|
756
|
+
// Events
|
|
757
|
+
clearFilter: h,
|
|
758
|
+
onDateSelected: A,
|
|
759
|
+
openFilter: d,
|
|
760
|
+
updateFilter: f,
|
|
761
|
+
resetFilter: _,
|
|
762
|
+
onDateInputSelected: (T) => {
|
|
763
|
+
l.value = T, A(T), f();
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
}), Al = { class: "b-date-filter" };
|
|
768
|
+
function Dl(e, n, t, r, l, a) {
|
|
769
|
+
const i = P("bento-date-picker"), s = P("bento-divider"), u = P("calendar"), p = P("bento-base-filter");
|
|
770
|
+
return v(), E(p, {
|
|
771
|
+
"button-label": e.buttonLabel,
|
|
772
|
+
"button-secondary-label": e.buttonSecondaryLabel,
|
|
773
|
+
disabled: e.disabled,
|
|
774
|
+
"default-value": e.defaultValue,
|
|
775
|
+
"disable-apply-button": e.isApplyButtonDisabled,
|
|
776
|
+
"disable-secondary-button": e.isSecondaryButtonDisabled,
|
|
777
|
+
field: e.field,
|
|
778
|
+
label: e.label,
|
|
779
|
+
"only-slot": e.onlySlot,
|
|
780
|
+
"fit-content": "",
|
|
781
|
+
onApply: e.updateFilter,
|
|
782
|
+
onClear: e.clearFilter,
|
|
783
|
+
onOpen: e.openFilter,
|
|
784
|
+
onReset: e.resetFilter
|
|
785
|
+
}, {
|
|
786
|
+
default: y(() => {
|
|
787
|
+
var f, h, _, d, A, I;
|
|
788
|
+
return [
|
|
789
|
+
e.onlySlot ? (v(), E(i, {
|
|
790
|
+
key: 0,
|
|
791
|
+
value: e.internalFilterValue,
|
|
792
|
+
"first-day-of-week": (f = e.options) == null ? void 0 : f.firstDayOfWeek,
|
|
793
|
+
"is-date-disabled": (h = e.options) == null ? void 0 : h.isDateDisabled,
|
|
794
|
+
variant: (_ = e.options) == null ? void 0 : _.variant,
|
|
795
|
+
onInput: e.onDateInputSelected
|
|
796
|
+
}, null, 8, ["value", "first-day-of-week", "is-date-disabled", "variant", "onInput"])) : (v(), J(Ae, { key: 1 }, [
|
|
797
|
+
$(s, { class: "b-date-filter__divider" }),
|
|
798
|
+
j("div", Al, [
|
|
799
|
+
$(u, {
|
|
800
|
+
"first-day-of-week": (d = e.options) == null ? void 0 : d.firstDayOfWeek,
|
|
801
|
+
"is-date-disabled": (A = e.options) == null ? void 0 : A.isDateDisabled,
|
|
802
|
+
"number-of-months": 1,
|
|
803
|
+
value: e.internalFilterValue,
|
|
804
|
+
variant: (I = e.options) == null ? void 0 : I.variant,
|
|
805
|
+
onInput: e.onDateSelected
|
|
806
|
+
}, null, 8, ["first-day-of-week", "is-date-disabled", "value", "variant", "onInput"])
|
|
807
|
+
])
|
|
808
|
+
], 64))
|
|
809
|
+
];
|
|
810
|
+
}),
|
|
811
|
+
_: 1
|
|
812
|
+
}, 8, ["button-label", "button-secondary-label", "disabled", "default-value", "disable-apply-button", "disable-secondary-button", "field", "label", "only-slot", "onApply", "onClear", "onOpen", "onReset"]);
|
|
813
|
+
}
|
|
814
|
+
const ht = /* @__PURE__ */ ee(_l, [["render", Dl], ["__scopeId", "data-v-1e5e2fcf"]]), tt = {
|
|
815
|
+
"en-US": {
|
|
816
|
+
apply: "Apply",
|
|
817
|
+
clear: "Clear",
|
|
818
|
+
reset: "Reset"
|
|
819
|
+
},
|
|
820
|
+
"ja-JP": {
|
|
821
|
+
apply: "適用",
|
|
822
|
+
clear: "クリア",
|
|
823
|
+
reset: "リセット"
|
|
824
|
+
},
|
|
825
|
+
"pt-BR": {
|
|
826
|
+
apply: "Aplicar",
|
|
827
|
+
clear: "Limpar",
|
|
828
|
+
reset: "Reiniciar"
|
|
829
|
+
}
|
|
830
|
+
}, Il = z({
|
|
831
|
+
i18n: { messages: tt },
|
|
832
|
+
name: "bento-date-range-filter",
|
|
833
|
+
components: {
|
|
834
|
+
BentoBaseFilter: Fe,
|
|
835
|
+
BentoButtonActions: ol,
|
|
836
|
+
BentoDateRangePicker: tl,
|
|
837
|
+
BentoTypography: pe,
|
|
838
|
+
BentoDivider: He,
|
|
839
|
+
DateRangePickerCalendar: el
|
|
840
|
+
},
|
|
841
|
+
props: {
|
|
842
|
+
/**
|
|
843
|
+
* Disables the filter from being interacted with.
|
|
844
|
+
*/
|
|
845
|
+
disabled: { type: Boolean, default: !1 },
|
|
846
|
+
/**
|
|
847
|
+
* Default value of the filter to reset to.
|
|
848
|
+
*/
|
|
849
|
+
defaultValue: { type: Object, default: null },
|
|
850
|
+
/**
|
|
851
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
852
|
+
* Should be unique per filter bar.
|
|
853
|
+
*/
|
|
854
|
+
field: { type: String, required: !0 },
|
|
855
|
+
/**
|
|
856
|
+
* Label text to be displayed
|
|
857
|
+
*/
|
|
858
|
+
label: { type: String, required: !0 },
|
|
859
|
+
/**
|
|
860
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
861
|
+
* Used for the allFiltersModal component.
|
|
862
|
+
*/
|
|
863
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
864
|
+
/**
|
|
865
|
+
* List of options that are needed to setup the filter
|
|
866
|
+
* Available options:
|
|
867
|
+
* - allowTimeInput: Allows user to enter time values in the form
|
|
868
|
+
* - firstDayOfWeek: Allows user to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
869
|
+
* - isDateDisabled: Indicate if a date should be disabled or not
|
|
870
|
+
* - maxRange: Set a maximum number of dates to be selectable by the range
|
|
871
|
+
* - numberOfMonths: Number of months rendered on pane
|
|
872
|
+
* - quickSelectRanges: An array that sets the custom range dropdown items. @see BentoDateRangePicker
|
|
873
|
+
* - showEndDateOnOpen: Upon opening date range picker, end date's month will be pre-selected.
|
|
874
|
+
*/
|
|
875
|
+
options: {
|
|
876
|
+
type: Object,
|
|
877
|
+
default: void 0
|
|
878
|
+
},
|
|
879
|
+
/**
|
|
880
|
+
* Current value of the filter
|
|
881
|
+
*/
|
|
882
|
+
value: {
|
|
883
|
+
type: Object,
|
|
884
|
+
default: () => ({ startDate: void 0, endDate: void 0 })
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
emits: [g.INPUT, g.UPDATE],
|
|
888
|
+
setup(e, { emit: n }) {
|
|
889
|
+
var q, X, B, S;
|
|
890
|
+
const { locale: t, t: r } = de({ messages: tt }), l = yt(), { internalFilterValue: a, isSecondaryButtonDisabled: i, isApplyButtonDisabled: s } = ve(
|
|
891
|
+
x(e, "value"),
|
|
892
|
+
x(e, "defaultValue")
|
|
893
|
+
), u = M(!1), p = (o) => o ? ye(o, We.NUMERIC_DATE_YEAR_FIRST, {
|
|
894
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
895
|
+
}) : void 0, f = (o) => o ? ye(o, We.HOUR_MINUTE_SECONDS, {
|
|
896
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
897
|
+
}) : "", h = M(null), _ = M(!1), d = Lt({
|
|
898
|
+
startDate: p((q = e.value) == null ? void 0 : q.startDate),
|
|
899
|
+
endDate: p((X = e.value) == null ? void 0 : X.endDate),
|
|
900
|
+
startTime: f((B = e.value) == null ? void 0 : B.startDate),
|
|
901
|
+
endTime: f((S = e.value) == null ? void 0 : S.endDate)
|
|
902
|
+
});
|
|
903
|
+
function A(o) {
|
|
904
|
+
return (o == null ? void 0 : o.length) !== void 0;
|
|
905
|
+
}
|
|
906
|
+
const I = c(() => {
|
|
907
|
+
var o, L, Y, m, b, O, H, W, ae;
|
|
908
|
+
if (!((o = e.value) != null && o.startDate) && !e.value.endDate)
|
|
909
|
+
return null;
|
|
910
|
+
if (A((L = e.options) == null ? void 0 : L.quickSelectRanges) && ((m = (Y = e.options) == null ? void 0 : Y.quickSelectRanges) == null ? void 0 : m.length) > 0) {
|
|
911
|
+
const ce = (O = (b = e.options) == null ? void 0 : b.quickSelectRanges) == null ? void 0 : O.find(({ value: me, data: le }) => {
|
|
912
|
+
if (a.value.range)
|
|
913
|
+
return me === a.value.range;
|
|
914
|
+
if (!(le != null && le.endDate))
|
|
915
|
+
we(le == null ? void 0 : le.startDate, a.value.startDate) && ll(a.value.endDate);
|
|
916
|
+
else
|
|
917
|
+
return we(le == null ? void 0 : le.startDate, a.value.startDate) && we(le == null ? void 0 : le.endDate, a.value.endDate);
|
|
918
|
+
});
|
|
919
|
+
if (ce)
|
|
920
|
+
return ce.label;
|
|
921
|
+
}
|
|
922
|
+
return nl((H = e.value) == null ? void 0 : H.startDate, (W = e.value) == null ? void 0 : W.endDate) && ((ae = e == null ? void 0 : e.options) != null && ae.allowTimeInput) ? `${ye(e.value.startDate, "dd MMM, yyyy HH:mm:ss", {
|
|
923
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
924
|
+
})} - ${ye(e.value.endDate, "HH:mm:ss", {
|
|
925
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
926
|
+
})}` : `${ye(e.value.startDate, "dd MMM, yyyy", {
|
|
927
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
928
|
+
})} - ${ye(e.value.endDate, "dd MMM, yyyy", {
|
|
929
|
+
locale: l[t.value.substring(0, 2)] || l.enUS
|
|
930
|
+
})}`;
|
|
931
|
+
}), T = c(() => e.label), V = () => {
|
|
932
|
+
h.value.closePopover();
|
|
933
|
+
const { onlySlot: o, ...L } = e;
|
|
934
|
+
n(g.UPDATE, { ...L, value: a.value });
|
|
935
|
+
}, w = () => {
|
|
936
|
+
a.value = void 0, V();
|
|
937
|
+
}, U = () => {
|
|
938
|
+
a.value = e.defaultValue, V();
|
|
939
|
+
}, F = () => {
|
|
940
|
+
a.value = e.value;
|
|
941
|
+
}, R = (o) => {
|
|
942
|
+
u.value = !1, a.value = o, d.startDate = p(o.startDate), d.endDate = p(o.endDate), n(g.INPUT, { ...e, value: a.value });
|
|
943
|
+
}, k = (o) => {
|
|
944
|
+
o != null && o.startDate && (o != null && o.endDate) && (a.value = o, d.startDate = p(o.startDate), d.endDate = p(o.endDate), n(g.INPUT, { ...e, value: a.value }));
|
|
945
|
+
}, N = (o) => {
|
|
946
|
+
R(o), n(g.INPUT, { ...e, value: a.value });
|
|
947
|
+
}, te = c(
|
|
948
|
+
() => [
|
|
949
|
+
{
|
|
950
|
+
title: r("apply"),
|
|
951
|
+
event: V,
|
|
952
|
+
disabled: u.value || _.value || s.value
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
title: e.defaultValue ? r("reset") : r("clear"),
|
|
956
|
+
event: e.defaultValue ? U : w,
|
|
957
|
+
disabled: _.value && i.value
|
|
958
|
+
}
|
|
959
|
+
]
|
|
960
|
+
);
|
|
961
|
+
return {
|
|
962
|
+
// Refs
|
|
963
|
+
baseFilter: h,
|
|
964
|
+
// Values
|
|
965
|
+
actions: te,
|
|
966
|
+
formData: d,
|
|
967
|
+
internalFilterValue: a,
|
|
968
|
+
isApplyButtonDisabled: s,
|
|
969
|
+
isSecondaryButtonDisabled: i,
|
|
970
|
+
isSelectingDate: u,
|
|
971
|
+
buttonLabel: T,
|
|
972
|
+
buttonSecondaryLabel: I,
|
|
973
|
+
// Events
|
|
974
|
+
onDateSelected: R,
|
|
975
|
+
openFilter: F,
|
|
976
|
+
clearFilter: w,
|
|
977
|
+
resetFilter: U,
|
|
978
|
+
updateFilter: V,
|
|
979
|
+
onDatePickerRangeError: () => {
|
|
980
|
+
_.value = !0, a.value = { startDate: void 0, endDate: void 0 }, n(g.INPUT, { ...e, value: a.value });
|
|
981
|
+
},
|
|
982
|
+
onDatePickerRangeFormDateInputUpdate: (o) => {
|
|
983
|
+
_.value = !1, o.startTime && (d.startTime = o.startTime), o.endTime && (d.endTime = o.endTime);
|
|
984
|
+
},
|
|
985
|
+
onDateInputSelected: N,
|
|
986
|
+
onRangeSelectorInput: k
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
}), Tl = {
|
|
990
|
+
key: 1,
|
|
991
|
+
class: "b-date-range-filter"
|
|
992
|
+
};
|
|
993
|
+
function $l(e, n, t, r, l, a) {
|
|
994
|
+
const i = P("bento-date-range-picker"), s = P("bento-typography"), u = P("bento-divider"), p = P("bento-button-actions"), f = P("date-range-picker-calendar"), h = P("bento-base-filter");
|
|
995
|
+
return v(), E(h, {
|
|
996
|
+
ref: "baseFilter",
|
|
997
|
+
class: "b-base-filter-date-range-filter",
|
|
998
|
+
"button-label": e.buttonLabel,
|
|
999
|
+
"button-secondary-label": e.buttonSecondaryLabel,
|
|
1000
|
+
controlled: !e.onlySlot,
|
|
1001
|
+
disabled: e.disabled,
|
|
1002
|
+
"disable-apply-button": e.isApplyButtonDisabled,
|
|
1003
|
+
"disable-secondary-button": e.isSecondaryButtonDisabled,
|
|
1004
|
+
"default-value": e.defaultValue,
|
|
1005
|
+
field: e.field,
|
|
1006
|
+
label: e.label,
|
|
1007
|
+
"only-slot": e.onlySlot,
|
|
1008
|
+
"fit-content": "",
|
|
1009
|
+
onOpen: e.openFilter,
|
|
1010
|
+
onClear: e.clearFilter,
|
|
1011
|
+
onReset: e.resetFilter
|
|
1012
|
+
}, {
|
|
1013
|
+
default: y(() => {
|
|
1014
|
+
var _, d, A, I, T, V, w, U, F, R, k, N, te, D, K, q, X;
|
|
1015
|
+
return [
|
|
1016
|
+
e.onlySlot ? (v(), E(i, {
|
|
1017
|
+
key: 0,
|
|
1018
|
+
"allow-time-input": (_ = e.options) == null ? void 0 : _.allowTimeInput,
|
|
1019
|
+
value: e.internalFilterValue,
|
|
1020
|
+
"first-day-of-week": (d = e.options) == null ? void 0 : d.firstDayOfWeek,
|
|
1021
|
+
"is-date-disabled": (A = e.options) == null ? void 0 : A.isDateDisabled,
|
|
1022
|
+
"number-of-months": (I = e.options) == null ? void 0 : I.numberOfMonths,
|
|
1023
|
+
"quick-select-ranges": (T = e.options) == null ? void 0 : T.quickSelectRanges,
|
|
1024
|
+
variant: (V = e.options) == null ? void 0 : V.variant,
|
|
1025
|
+
onInput: e.onDateInputSelected
|
|
1026
|
+
}, null, 8, ["allow-time-input", "value", "first-day-of-week", "is-date-disabled", "number-of-months", "quick-select-ranges", "variant", "onInput"])) : (v(), J("div", Tl, [
|
|
1027
|
+
$(f, {
|
|
1028
|
+
"allow-time-input": (w = e.options) == null ? void 0 : w.allowTimeInput,
|
|
1029
|
+
"first-day-of-week": (U = e.options) == null ? void 0 : U.firstDayOfWeek,
|
|
1030
|
+
"is-date-disabled": (F = e.options) == null ? void 0 : F.isDateDisabled,
|
|
1031
|
+
granularities: (R = e.options) == null ? void 0 : R.granularities,
|
|
1032
|
+
"max-range": (k = e.options) == null ? void 0 : k.maxRange,
|
|
1033
|
+
min: (N = e.options) == null ? void 0 : N.min,
|
|
1034
|
+
max: (te = e.options) == null ? void 0 : te.max,
|
|
1035
|
+
"number-of-months": (D = e.options) == null ? void 0 : D.numberOfMonths,
|
|
1036
|
+
"quick-select-ranges": (K = e.options) == null ? void 0 : K.quickSelectRanges,
|
|
1037
|
+
value: e.internalFilterValue,
|
|
1038
|
+
"date-form-data": e.formData,
|
|
1039
|
+
"show-end-date-on-open": (q = e.options) == null ? void 0 : q.showEndDateOnOpen,
|
|
1040
|
+
variant: (X = e.options) == null ? void 0 : X.variant,
|
|
1041
|
+
onInput: e.onDateSelected,
|
|
1042
|
+
onCustomRange: e.onRangeSelectorInput,
|
|
1043
|
+
onError: e.onDatePickerRangeError,
|
|
1044
|
+
onFormDate: e.onDatePickerRangeFormDateInputUpdate,
|
|
1045
|
+
onStartDateSelected: n[0] || (n[0] = (B) => e.isSelectingDate = !0)
|
|
1046
|
+
}, {
|
|
1047
|
+
title: y(() => [
|
|
1048
|
+
$(s, {
|
|
1049
|
+
strongest: "",
|
|
1050
|
+
variant: "body",
|
|
1051
|
+
el: "span"
|
|
1052
|
+
}, {
|
|
1053
|
+
default: y(() => [
|
|
1054
|
+
G(Z(e.label), 1)
|
|
1055
|
+
]),
|
|
1056
|
+
_: 1
|
|
1057
|
+
})
|
|
1058
|
+
]),
|
|
1059
|
+
actions: y(() => [
|
|
1060
|
+
$(u, { class: "b-date-range-filter__divider" }),
|
|
1061
|
+
$(p, {
|
|
1062
|
+
class: "b-date-range-filter__actions",
|
|
1063
|
+
actions: e.actions,
|
|
1064
|
+
layout: "space-between"
|
|
1065
|
+
}, null, 8, ["actions"])
|
|
1066
|
+
]),
|
|
1067
|
+
_: 1
|
|
1068
|
+
}, 8, ["allow-time-input", "first-day-of-week", "is-date-disabled", "granularities", "max-range", "min", "max", "number-of-months", "quick-select-ranges", "value", "date-form-data", "show-end-date-on-open", "variant", "onInput", "onCustomRange", "onError", "onFormDate"])
|
|
1069
|
+
]))
|
|
1070
|
+
];
|
|
1071
|
+
}),
|
|
1072
|
+
_: 1
|
|
1073
|
+
}, 8, ["button-label", "button-secondary-label", "controlled", "disabled", "disable-apply-button", "disable-secondary-button", "default-value", "field", "label", "only-slot", "onOpen", "onClear", "onReset"]);
|
|
1074
|
+
}
|
|
1075
|
+
const St = /* @__PURE__ */ ee(Il, [["render", $l], ["__scopeId", "data-v-703b3102"]]), Bt = {
|
|
1076
|
+
"en-US": {
|
|
1077
|
+
all: "All",
|
|
1078
|
+
noFiltersMatchThisSearch: "No filters match this search",
|
|
1079
|
+
searchFilter: "Search {filter}"
|
|
1080
|
+
},
|
|
1081
|
+
"ja-JP": {
|
|
1082
|
+
all: "すべて"
|
|
1083
|
+
},
|
|
1084
|
+
"pt-BR": {
|
|
1085
|
+
all: "Todos"
|
|
1086
|
+
}
|
|
1087
|
+
}, Pl = { class: "b-select-filter-button__search-bar" }, Ul = { class: "b-select-filter-button__divider" }, El = {
|
|
1088
|
+
i18n: { messages: Bt }
|
|
1089
|
+
}, Ll = /* @__PURE__ */ z({
|
|
1090
|
+
...El,
|
|
1091
|
+
__name: "select-filter-button",
|
|
1092
|
+
props: {
|
|
1093
|
+
/**
|
|
1094
|
+
* Disables the filter from being interacted with.
|
|
1095
|
+
*/
|
|
1096
|
+
disabled: { type: Boolean, default: !1 },
|
|
1097
|
+
/**
|
|
1098
|
+
* Default value of the filter to reset to.
|
|
1099
|
+
*
|
|
1100
|
+
*/
|
|
1101
|
+
defaultValue: {
|
|
1102
|
+
type: [String, Number, Array],
|
|
1103
|
+
default: null
|
|
1104
|
+
},
|
|
1105
|
+
/**
|
|
1106
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
1107
|
+
* Should be unique per filter bar.
|
|
1108
|
+
*/
|
|
1109
|
+
field: { type: String, required: !0 },
|
|
1110
|
+
/**
|
|
1111
|
+
* Label text to be displayed
|
|
1112
|
+
*/
|
|
1113
|
+
label: { type: String, required: !0 },
|
|
1114
|
+
/**
|
|
1115
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
1116
|
+
* Used for the allFiltersModal component.
|
|
1117
|
+
*/
|
|
1118
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
1119
|
+
/**
|
|
1120
|
+
* List of options that are needed to setup the filter
|
|
1121
|
+
* Available options:
|
|
1122
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1123
|
+
* - listboxItems: The option elements to populate the filter with.
|
|
1124
|
+
*
|
|
1125
|
+
* @default undefined
|
|
1126
|
+
*/
|
|
1127
|
+
options: {
|
|
1128
|
+
type: Object,
|
|
1129
|
+
default: void 0
|
|
1130
|
+
},
|
|
1131
|
+
/**
|
|
1132
|
+
* Current value of the filter
|
|
1133
|
+
*
|
|
1134
|
+
* @default undefined
|
|
1135
|
+
*/
|
|
1136
|
+
value: {
|
|
1137
|
+
type: [String, Number, Array],
|
|
1138
|
+
default: void 0
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
emits: ["input", "update"],
|
|
1142
|
+
setup(e, { emit: n }) {
|
|
1143
|
+
var X, B;
|
|
1144
|
+
const t = Le(), r = n, l = e, { t: a } = de({ messages: Bt }), i = M(""), s = x(l, "options"), u = M(l.options.listboxItems ?? []), { cachedSelectedListboxOptions: p, setCachedValues: f, resetCache: h } = Ye(
|
|
1145
|
+
u,
|
|
1146
|
+
x(l, "value"),
|
|
1147
|
+
x(s.value, "multiple")
|
|
1148
|
+
), { cachedSelectedListboxOptions: _ } = Ye(
|
|
1149
|
+
u,
|
|
1150
|
+
x(l, "defaultValue"),
|
|
1151
|
+
x(s.value, "multiple")
|
|
1152
|
+
), { internalFilterValue: d, isSecondaryButtonDisabled: A, isApplyButtonDisabled: I } = ve(p, _);
|
|
1153
|
+
ue(s, () => {
|
|
1154
|
+
u.value = s.value.listboxItems ?? [];
|
|
1155
|
+
});
|
|
1156
|
+
const T = vt(
|
|
1157
|
+
i,
|
|
1158
|
+
u,
|
|
1159
|
+
(B = (X = l.options) == null ? void 0 : X.search) == null ? void 0 : B.searchEvent
|
|
1160
|
+
), V = c(() => a("noFiltersMatchThisSearch")), w = c(() => l.label), U = c(() => {
|
|
1161
|
+
var L, Y, m, b;
|
|
1162
|
+
const S = !((L = l == null ? void 0 : l.options) != null && L.multiple) && (l == null ? void 0 : l.value), o = ((m = ((Y = l == null ? void 0 : l.options) == null ? void 0 : Y.multiple) && l.value) == null ? void 0 : m.length) === 1;
|
|
1163
|
+
if (S || o) {
|
|
1164
|
+
let H = (b = l.options.listboxItems.flatMap((W) => W.items ? W.items : W).find(
|
|
1165
|
+
({ value: W }) => {
|
|
1166
|
+
var ae;
|
|
1167
|
+
return Array.isArray(l.value) ? (ae = l == null ? void 0 : l.value) == null ? void 0 : ae.includes(W) : W === l.value;
|
|
1168
|
+
}
|
|
1169
|
+
)) == null ? void 0 : b.label;
|
|
1170
|
+
return !H && l.value && (H = l.value[0]), Se(H, 12);
|
|
1171
|
+
}
|
|
1172
|
+
return null;
|
|
1173
|
+
}), F = c(() => ke(`filter-listbox-${l.field}`)), R = (S) => {
|
|
1174
|
+
d.value = S;
|
|
1175
|
+
const { onlySlot: o, ...L } = l;
|
|
1176
|
+
if (l.options.multiple) {
|
|
1177
|
+
const m = S.length ? d.value.map(({ value: b }) => b) : null;
|
|
1178
|
+
r(g.INPUT, { ...L, value: m });
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
const Y = S.length ? S[0].value : null;
|
|
1182
|
+
r(g.INPUT, { ...L, value: Y });
|
|
1183
|
+
}, k = () => {
|
|
1184
|
+
var Y, m, b;
|
|
1185
|
+
const { onlySlot: S, ...o } = l;
|
|
1186
|
+
if (l.options.multiple) {
|
|
1187
|
+
d.value && ((Y = d.value) == null ? void 0 : Y.length) === 0 && (d.value = l.defaultValue !== null ? _.value : void 0);
|
|
1188
|
+
const O = (m = d.value) != null && m.length ? (b = d.value) == null ? void 0 : b.map(({ value: H }) => H) : null;
|
|
1189
|
+
r(g.UPDATE, {
|
|
1190
|
+
...o,
|
|
1191
|
+
value: O
|
|
1192
|
+
});
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
const L = d.value.length ? d.value[0].value : void 0;
|
|
1196
|
+
r(g.UPDATE, { ...o, value: L });
|
|
1197
|
+
}, N = () => {
|
|
1198
|
+
d.value = p.value;
|
|
1199
|
+
}, te = () => {
|
|
1200
|
+
i.value && (i.value = "");
|
|
1201
|
+
}, D = () => {
|
|
1202
|
+
f(_.value), d.value = _.value, k();
|
|
1203
|
+
}, K = () => {
|
|
1204
|
+
h(), d.value = [], k();
|
|
1205
|
+
}, q = c(() => {
|
|
1206
|
+
var L, Y;
|
|
1207
|
+
if (l.value == null || !l.options.multiple)
|
|
1208
|
+
return null;
|
|
1209
|
+
const S = (L = l.options.listboxItems) == null ? void 0 : L.reduce((m, b) => {
|
|
1210
|
+
var O;
|
|
1211
|
+
return m += (O = b == null ? void 0 : b.items) != null && O.length ? b.items.length : 1, m;
|
|
1212
|
+
}, 0), o = (Y = l.value) == null ? void 0 : Y.length;
|
|
1213
|
+
return o === 1 ? null : o === S ? a("all") : o;
|
|
1214
|
+
});
|
|
1215
|
+
return (S, o) => (v(), E(C(Fe), {
|
|
1216
|
+
"applied-filters-count": q.value,
|
|
1217
|
+
"button-label": w.value,
|
|
1218
|
+
"button-secondary-label": U.value,
|
|
1219
|
+
disabled: e.disabled,
|
|
1220
|
+
"disable-apply-button": C(I),
|
|
1221
|
+
"disable-secondary-button": C(A),
|
|
1222
|
+
"default-value": e.defaultValue,
|
|
1223
|
+
label: e.label,
|
|
1224
|
+
field: e.field,
|
|
1225
|
+
"only-slot": !1,
|
|
1226
|
+
value: e.value,
|
|
1227
|
+
onApply: k,
|
|
1228
|
+
onClear: K,
|
|
1229
|
+
onReset: D,
|
|
1230
|
+
onOpen: N,
|
|
1231
|
+
onClose: te
|
|
1232
|
+
}, {
|
|
1233
|
+
default: y(() => {
|
|
1234
|
+
var L, Y, m, b, O, H, W, ae, ce, me, le, je, Ke, qe;
|
|
1235
|
+
return [
|
|
1236
|
+
j("div", Pl, [
|
|
1237
|
+
$(C(Ue), {
|
|
1238
|
+
"debounce-time": (Y = (L = e.options) == null ? void 0 : L.search) == null ? void 0 : Y.debounceTime,
|
|
1239
|
+
value: i.value,
|
|
1240
|
+
"input-field-aria-label": C(a)("searchFilter", { filter: e.label.toLocaleLowerCase() }),
|
|
1241
|
+
onInput: o[0] || (o[0] = (Re) => i.value = Re)
|
|
1242
|
+
}, null, 8, ["debounce-time", "value", "input-field-aria-label"])
|
|
1243
|
+
]),
|
|
1244
|
+
j("div", Ul, [
|
|
1245
|
+
$(C(He))
|
|
1246
|
+
]),
|
|
1247
|
+
$(C(Zt), {
|
|
1248
|
+
id: F.value,
|
|
1249
|
+
"aria-label": e.label,
|
|
1250
|
+
class: "b-select-filter-button__wrapper",
|
|
1251
|
+
"component-loading": (m = e.options) == null ? void 0 : m.loading,
|
|
1252
|
+
"empty-state": (b = e.options) == null ? void 0 : b.emptyState,
|
|
1253
|
+
"has-more-items": (H = (O = e.options) == null ? void 0 : O.lazy) == null ? void 0 : H.hasMoreItems,
|
|
1254
|
+
items: C(T),
|
|
1255
|
+
"is-option-disabled": (W = e.options) == null ? void 0 : W.isOptionDisabled,
|
|
1256
|
+
"lazy-load-type": (ce = (ae = e.options) == null ? void 0 : ae.lazy) == null ? void 0 : ce.lazyLoadType,
|
|
1257
|
+
loading: (le = (me = e.options) == null ? void 0 : me.lazy) == null ? void 0 : le.loading,
|
|
1258
|
+
multiple: (je = e.options) == null ? void 0 : je.multiple,
|
|
1259
|
+
"static-categories": (Ke = e.options) == null ? void 0 : Ke.staticCategories,
|
|
1260
|
+
"no-results-message": V.value,
|
|
1261
|
+
searching: !!i.value,
|
|
1262
|
+
"selected-value": C(d),
|
|
1263
|
+
"virtual-scroll": (qe = e.options) == null ? void 0 : qe.virtualScroll,
|
|
1264
|
+
onSelect: R,
|
|
1265
|
+
onSpacePressed: R,
|
|
1266
|
+
onEnterPressed: R,
|
|
1267
|
+
onShowMore: o[1] || (o[1] = (Re) => {
|
|
1268
|
+
var Ce, Ie;
|
|
1269
|
+
return (Ie = (Ce = e.options) == null ? void 0 : Ce.lazy) == null ? void 0 : Ie.showMoreEvent();
|
|
1270
|
+
})
|
|
1271
|
+
}, De({ _: 2 }, [
|
|
1272
|
+
fe(C(t), (Re, Ce) => ({
|
|
1273
|
+
name: Ce,
|
|
1274
|
+
fn: y((Ie) => [
|
|
1275
|
+
re(S.$slots, Ce, $e(Pe(Ie)), void 0, !0)
|
|
1276
|
+
])
|
|
1277
|
+
}))
|
|
1278
|
+
]), 1032, ["id", "aria-label", "component-loading", "empty-state", "has-more-items", "items", "is-option-disabled", "lazy-load-type", "loading", "multiple", "static-categories", "no-results-message", "searching", "selected-value", "virtual-scroll"])
|
|
1279
|
+
];
|
|
1280
|
+
}),
|
|
1281
|
+
_: 3
|
|
1282
|
+
}, 8, ["applied-filters-count", "button-label", "button-secondary-label", "disabled", "disable-apply-button", "disable-secondary-button", "default-value", "label", "field", "value"]));
|
|
1283
|
+
}
|
|
1284
|
+
}), Ol = /* @__PURE__ */ ee(Ll, [["__scopeId", "data-v-96b1316d"]]), Ct = {
|
|
1285
|
+
"en-US": {
|
|
1286
|
+
noFiltersMatchThisSearch: "No filters match this search"
|
|
1287
|
+
}
|
|
1288
|
+
}, Rl = {
|
|
1289
|
+
i18n: { messages: Ct },
|
|
1290
|
+
name: "select-filter-dropdown"
|
|
1291
|
+
}, wl = /* @__PURE__ */ z({
|
|
1292
|
+
...Rl,
|
|
1293
|
+
props: {
|
|
1294
|
+
/**
|
|
1295
|
+
* Disables the filter from being interacted with.
|
|
1296
|
+
*/
|
|
1297
|
+
disabled: { type: Boolean, default: !1 },
|
|
1298
|
+
/**
|
|
1299
|
+
* Default value of the filter to reset to.
|
|
1300
|
+
*
|
|
1301
|
+
*/
|
|
1302
|
+
defaultValue: {
|
|
1303
|
+
type: [String, Number, Array],
|
|
1304
|
+
default: null
|
|
1305
|
+
},
|
|
1306
|
+
/**
|
|
1307
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
1308
|
+
* Should be unique per filter bar.
|
|
1309
|
+
*/
|
|
1310
|
+
field: { type: String, required: !0 },
|
|
1311
|
+
/**
|
|
1312
|
+
* Label text to be displayed
|
|
1313
|
+
*/
|
|
1314
|
+
label: { type: String, required: !0 },
|
|
1315
|
+
/**
|
|
1316
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
1317
|
+
* Used for the allFiltersModal component.
|
|
1318
|
+
*
|
|
1319
|
+
*/
|
|
1320
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
1321
|
+
/**
|
|
1322
|
+
* List of options that are needed to setup the filter
|
|
1323
|
+
* Available options:
|
|
1324
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1325
|
+
* - listboxItems: The option elements to populate the filter with.
|
|
1326
|
+
*
|
|
1327
|
+
* @default undefined
|
|
1328
|
+
*/
|
|
1329
|
+
options: {
|
|
1330
|
+
type: Object,
|
|
1331
|
+
default: void 0
|
|
1332
|
+
},
|
|
1333
|
+
/**
|
|
1334
|
+
* Current value of the filter
|
|
1335
|
+
*
|
|
1336
|
+
* @default undefined
|
|
1337
|
+
*/
|
|
1338
|
+
value: {
|
|
1339
|
+
type: [String, Number, Array],
|
|
1340
|
+
default: void 0
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
emits: ["input", "update"],
|
|
1344
|
+
setup(e, { emit: n }) {
|
|
1345
|
+
const { t } = de({ messages: Ct }), r = Le(), l = n, a = e, { internalFilterValue: i } = ve(x(a, "value"), x(a, "defaultValue")), s = x(a, "options"), u = M(a.options.listboxItems);
|
|
1346
|
+
ue(s, () => {
|
|
1347
|
+
u.value = s.value.listboxItems;
|
|
1348
|
+
});
|
|
1349
|
+
const p = c(() => t("noFiltersMatchThisSearch")), f = (h) => {
|
|
1350
|
+
i.value = h;
|
|
1351
|
+
const { onlySlot: _, ...d } = a;
|
|
1352
|
+
l(g.INPUT, { ...d, value: i.value });
|
|
1353
|
+
};
|
|
1354
|
+
return (h, _) => {
|
|
1355
|
+
var d, A, I, T, V;
|
|
1356
|
+
return v(), E(C(zt), {
|
|
1357
|
+
value: C(i),
|
|
1358
|
+
items: e.options.listboxItems,
|
|
1359
|
+
search: (d = e.options) == null ? void 0 : d.search,
|
|
1360
|
+
multiple: (A = e.options) == null ? void 0 : A.multiple,
|
|
1361
|
+
"static-categories": (I = e.options) == null ? void 0 : I.staticCategories,
|
|
1362
|
+
"no-results-message": p.value,
|
|
1363
|
+
"is-option-disabled": e.options.isOptionDisabled,
|
|
1364
|
+
"dynamic-filtering": !0,
|
|
1365
|
+
"component-loading": (T = e.options) == null ? void 0 : T.loading,
|
|
1366
|
+
"empty-state": (V = e.options) == null ? void 0 : V.emptyState,
|
|
1367
|
+
disabled: e.disabled,
|
|
1368
|
+
onInput: f
|
|
1369
|
+
}, De({ _: 2 }, [
|
|
1370
|
+
fe(C(r), (w, U) => ({
|
|
1371
|
+
name: U,
|
|
1372
|
+
fn: y((F) => [
|
|
1373
|
+
re(h.$slots, U, $e(Pe(F)))
|
|
1374
|
+
])
|
|
1375
|
+
}))
|
|
1376
|
+
]), 1032, ["value", "items", "search", "multiple", "static-categories", "no-results-message", "is-option-disabled", "component-loading", "empty-state", "disabled"]);
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
}), Be = {
|
|
1380
|
+
/**
|
|
1381
|
+
* Disables the filter from being interacted with.
|
|
1382
|
+
*/
|
|
1383
|
+
disabled: { type: Boolean, default: !1 },
|
|
1384
|
+
/**
|
|
1385
|
+
* Default value of the filter to reset to.
|
|
1386
|
+
*
|
|
1387
|
+
*/
|
|
1388
|
+
defaultValue: {
|
|
1389
|
+
type: [String, Number, Array],
|
|
1390
|
+
default: null
|
|
1391
|
+
},
|
|
1392
|
+
/**
|
|
1393
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
1394
|
+
* Should be unique per filter bar.
|
|
1395
|
+
*/
|
|
1396
|
+
field: { type: String, required: !0 },
|
|
1397
|
+
/**
|
|
1398
|
+
* Label text to be displayed
|
|
1399
|
+
*/
|
|
1400
|
+
label: { type: String, required: !0 },
|
|
1401
|
+
/**
|
|
1402
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
1403
|
+
* Used for the allFiltersModal component.
|
|
1404
|
+
*
|
|
1405
|
+
*/
|
|
1406
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
1407
|
+
/**
|
|
1408
|
+
* List of options that are needed to setup the filter
|
|
1409
|
+
* Available options:
|
|
1410
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1411
|
+
* - listboxItems: The option elements to populate the filter with.
|
|
1412
|
+
*
|
|
1413
|
+
* @default undefined
|
|
1414
|
+
*/
|
|
1415
|
+
options: {
|
|
1416
|
+
type: Object,
|
|
1417
|
+
default: void 0
|
|
1418
|
+
},
|
|
1419
|
+
/**
|
|
1420
|
+
* Current value of the filter
|
|
1421
|
+
*
|
|
1422
|
+
* @default undefined
|
|
1423
|
+
*/
|
|
1424
|
+
value: {
|
|
1425
|
+
type: [String, Number, Array],
|
|
1426
|
+
default: void 0
|
|
1427
|
+
}
|
|
1428
|
+
}, Vl = {}, ge = /* @__PURE__ */ z({
|
|
1429
|
+
...Vl,
|
|
1430
|
+
__name: "select-filter",
|
|
1431
|
+
props: Be,
|
|
1432
|
+
emits: ["input", "update"],
|
|
1433
|
+
setup(e, { emit: n }) {
|
|
1434
|
+
const t = Le(), r = n, l = e, a = (s) => r("input", s), i = (s) => r("update", s);
|
|
1435
|
+
return rt(() => {
|
|
1436
|
+
var s;
|
|
1437
|
+
(s = l == null ? void 0 : l.options) != null && s.messages && Ne(
|
|
1438
|
+
'BentoFilterBar filter of type "BentoFilterItemType.SELECT" options message property',
|
|
1439
|
+
`Please remove the "options.messages" property from this filter, it is not required any more for persistent filters.
|
|
1440
|
+
This will be the default behavior in the v2 and "options.messages" will be removed.`,
|
|
1441
|
+
"2.0.0"
|
|
1442
|
+
);
|
|
1443
|
+
}), (s, u) => s.onlySlot ? (v(), E(C(wl), {
|
|
1444
|
+
key: 0,
|
|
1445
|
+
disabled: s.disabled,
|
|
1446
|
+
"default-value": s.defaultValue,
|
|
1447
|
+
field: s.field,
|
|
1448
|
+
label: s.label,
|
|
1449
|
+
options: s.options,
|
|
1450
|
+
value: s.value,
|
|
1451
|
+
onInput: a,
|
|
1452
|
+
onUpdate: i
|
|
1453
|
+
}, De({ _: 2 }, [
|
|
1454
|
+
fe(C(t), (p, f) => ({
|
|
1455
|
+
name: f,
|
|
1456
|
+
fn: y((h) => [
|
|
1457
|
+
re(s.$slots, f, $e(Pe(h)))
|
|
1458
|
+
])
|
|
1459
|
+
}))
|
|
1460
|
+
]), 1032, ["disabled", "default-value", "field", "label", "options", "value"])) : (v(), E(C(Ol), {
|
|
1461
|
+
key: 1,
|
|
1462
|
+
disabled: s.disabled,
|
|
1463
|
+
"default-value": s.defaultValue,
|
|
1464
|
+
field: s.field,
|
|
1465
|
+
label: s.label,
|
|
1466
|
+
options: s.options,
|
|
1467
|
+
value: s.value,
|
|
1468
|
+
onInput: a,
|
|
1469
|
+
onUpdate: i
|
|
1470
|
+
}, De({ _: 2 }, [
|
|
1471
|
+
fe(C(t), (p, f) => ({
|
|
1472
|
+
name: f,
|
|
1473
|
+
fn: y((h) => [
|
|
1474
|
+
re(s.$slots, f, $e(Pe(h)))
|
|
1475
|
+
])
|
|
1476
|
+
}))
|
|
1477
|
+
]), 1032, ["disabled", "default-value", "field", "label", "options", "value"]));
|
|
1478
|
+
}
|
|
1479
|
+
}), kl = z({
|
|
1480
|
+
name: "bento-select-avatar-filter",
|
|
1481
|
+
components: {
|
|
1482
|
+
BentoSelectFilter: ge,
|
|
1483
|
+
BentoAvatar: xt
|
|
1484
|
+
},
|
|
1485
|
+
props: {
|
|
1486
|
+
...Be,
|
|
1487
|
+
/**
|
|
1488
|
+
* List of options that are needed to setup the country filter
|
|
1489
|
+
* Available options:
|
|
1490
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1491
|
+
* - listboxItems: The option elements to populate the filter with {@see BentoSelectCountryFilterOptions}
|
|
1492
|
+
*/
|
|
1493
|
+
options: {
|
|
1494
|
+
type: Object,
|
|
1495
|
+
default: void 0
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1499
|
+
setup(e, { emit: n }) {
|
|
1500
|
+
return {
|
|
1501
|
+
// Enums
|
|
1502
|
+
BentoFilterEvent: g,
|
|
1503
|
+
// Methods
|
|
1504
|
+
onUpdate: (r) => n(g.UPDATE, r)
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
function Nl(e, n, t, r, l, a) {
|
|
1509
|
+
const i = P("bento-avatar"), s = P("bento-select-filter");
|
|
1510
|
+
return v(), E(s, oe(e.$props, {
|
|
1511
|
+
field: e.field,
|
|
1512
|
+
label: e.label,
|
|
1513
|
+
onUpdate: e.onUpdate,
|
|
1514
|
+
onInput: n[0] || (n[0] = (u) => e.$emit(e.BentoFilterEvent.INPUT, u))
|
|
1515
|
+
}), {
|
|
1516
|
+
default: y(({ label: u, data: p }) => [
|
|
1517
|
+
$(i, {
|
|
1518
|
+
username: u,
|
|
1519
|
+
src: p
|
|
1520
|
+
}, null, 8, ["username", "src"])
|
|
1521
|
+
]),
|
|
1522
|
+
_: 1
|
|
1523
|
+
}, 16, ["field", "label", "onUpdate"]);
|
|
1524
|
+
}
|
|
1525
|
+
const _t = /* @__PURE__ */ ee(kl, [["render", Nl]]), Ml = z({
|
|
1526
|
+
name: "bento-select-country-filter",
|
|
1527
|
+
components: {
|
|
1528
|
+
BentoSelectFilter: ge,
|
|
1529
|
+
ListboxOptionTag: mt
|
|
1530
|
+
},
|
|
1531
|
+
props: {
|
|
1532
|
+
...Be,
|
|
1533
|
+
/**
|
|
1534
|
+
* List of options that are needed to setup the country filter
|
|
1535
|
+
* Available options:
|
|
1536
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1537
|
+
* - listboxItems: The option elements to populate the filter with {@see BentoSelectCurrencyFilterOptions}
|
|
1538
|
+
*/
|
|
1539
|
+
options: {
|
|
1540
|
+
type: Object,
|
|
1541
|
+
default: void 0
|
|
1542
|
+
}
|
|
1543
|
+
},
|
|
1544
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1545
|
+
setup(e, { emit: n }) {
|
|
1546
|
+
return {
|
|
1547
|
+
// Enums
|
|
1548
|
+
BentoFilterEvent: g,
|
|
1549
|
+
// Methods
|
|
1550
|
+
onUpdate: (r) => {
|
|
1551
|
+
n(g.UPDATE, r);
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
function Hl(e, n, t, r, l, a) {
|
|
1557
|
+
const i = P("listbox-option-tag"), s = P("bento-select-filter");
|
|
1558
|
+
return v(), E(s, oe(e.$props, {
|
|
1559
|
+
field: e.field,
|
|
1560
|
+
label: e.label,
|
|
1561
|
+
onUpdate: e.onUpdate,
|
|
1562
|
+
onInput: n[0] || (n[0] = (u) => e.$emit(e.BentoFilterEvent.INPUT, u))
|
|
1563
|
+
}), {
|
|
1564
|
+
default: y((u) => [
|
|
1565
|
+
$(i, { option: u }, null, 8, ["option"])
|
|
1566
|
+
]),
|
|
1567
|
+
_: 1
|
|
1568
|
+
}, 16, ["field", "label", "onUpdate"]);
|
|
1569
|
+
}
|
|
1570
|
+
const At = /* @__PURE__ */ ee(Ml, [["render", Hl]]), jl = {
|
|
1571
|
+
name: "bento-select-country-filter"
|
|
1572
|
+
}, Dt = /* @__PURE__ */ z({
|
|
1573
|
+
...jl,
|
|
1574
|
+
props: {
|
|
1575
|
+
...Be,
|
|
1576
|
+
/**
|
|
1577
|
+
* List of options that are needed to setup the country filter
|
|
1578
|
+
* Available options:
|
|
1579
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1580
|
+
* - listboxItems: The option elements to populate the filter with {@see BentoSelectCountryFilterOptions}
|
|
1581
|
+
* - variant: Which label variant to display for the option item.
|
|
1582
|
+
*/
|
|
1583
|
+
options: {
|
|
1584
|
+
type: Object,
|
|
1585
|
+
default: void 0
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1589
|
+
setup(e, { emit: n }) {
|
|
1590
|
+
const t = e, r = n, l = M(t.options.variant), a = M(t.options.listboxItems);
|
|
1591
|
+
ue([() => t.options.variant, () => t.options.listboxItems], () => {
|
|
1592
|
+
l.value = t.options.variant, a.value = t.options.listboxItems;
|
|
1593
|
+
});
|
|
1594
|
+
const i = (p) => r(g.UPDATE, p), s = Xt(l, a), u = c(() => ({
|
|
1595
|
+
...t != null && t.options ? t.options : {},
|
|
1596
|
+
listboxItems: s.value
|
|
1597
|
+
}));
|
|
1598
|
+
return (!l.value || l.value === "custom") && Ne(
|
|
1599
|
+
'BentoSelectCountryFilter type with `options.variant==="custom"`',
|
|
1600
|
+
"Use any of the other BentoSelectCountryFilter variants instead OR use BentoSelectFilter type for custom labels",
|
|
1601
|
+
"2.0.0"
|
|
1602
|
+
), (p, f) => (v(), E(ge, oe(t, {
|
|
1603
|
+
field: p.field,
|
|
1604
|
+
label: p.label,
|
|
1605
|
+
options: u.value,
|
|
1606
|
+
onUpdate: i,
|
|
1607
|
+
onInput: f[0] || (f[0] = (h) => p.$emit(C(g).INPUT, h))
|
|
1608
|
+
}), {
|
|
1609
|
+
default: y(({ label: h }) => [
|
|
1610
|
+
$(C(pe), { el: "span" }, {
|
|
1611
|
+
default: y(() => [
|
|
1612
|
+
G(Z(h), 1)
|
|
1613
|
+
]),
|
|
1614
|
+
_: 2
|
|
1615
|
+
}, 1024)
|
|
1616
|
+
]),
|
|
1617
|
+
_: 1
|
|
1618
|
+
}, 16, ["field", "label", "options"]));
|
|
1619
|
+
}
|
|
1620
|
+
}), Kl = z({
|
|
1621
|
+
name: "bento-select-payment-method-filter",
|
|
1622
|
+
components: {
|
|
1623
|
+
BentoSelectFilter: ge,
|
|
1624
|
+
BentoPaymentMethod: Qt
|
|
1625
|
+
},
|
|
1626
|
+
props: {
|
|
1627
|
+
...Be,
|
|
1628
|
+
/**
|
|
1629
|
+
* List of options that are needed to setup the payment method filter
|
|
1630
|
+
* Available options:
|
|
1631
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1632
|
+
* - listboxItems: The option elements to populate the filter with {@see BentoSelectPaymentMethodFilterOptions}
|
|
1633
|
+
*/
|
|
1634
|
+
options: {
|
|
1635
|
+
type: Object,
|
|
1636
|
+
default: void 0
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1640
|
+
setup(e, { emit: n }) {
|
|
1641
|
+
return {
|
|
1642
|
+
// Enums
|
|
1643
|
+
BentoFilterEvent: g,
|
|
1644
|
+
// Methods
|
|
1645
|
+
onUpdate: (r) => n(g.UPDATE, r)
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
function ql(e, n, t, r, l, a) {
|
|
1650
|
+
const i = P("bento-payment-method"), s = P("bento-select-filter");
|
|
1651
|
+
return v(), E(s, oe(e.$props, {
|
|
1652
|
+
field: e.field,
|
|
1653
|
+
label: e.label,
|
|
1654
|
+
onUpdate: e.onUpdate,
|
|
1655
|
+
onInput: n[0] || (n[0] = (u) => e.$emit(e.BentoFilterEvent.INPUT, u))
|
|
1656
|
+
}), {
|
|
1657
|
+
default: y(({ value: u, label: p }) => [
|
|
1658
|
+
$(i, {
|
|
1659
|
+
type: u,
|
|
1660
|
+
label: p
|
|
1661
|
+
}, null, 8, ["type", "label"])
|
|
1662
|
+
]),
|
|
1663
|
+
_: 1
|
|
1664
|
+
}, 16, ["field", "label", "onUpdate"]);
|
|
1665
|
+
}
|
|
1666
|
+
const It = /* @__PURE__ */ ee(Kl, [["render", ql]]), Jl = z({
|
|
1667
|
+
name: "bento-select-country-filter",
|
|
1668
|
+
components: {
|
|
1669
|
+
BentoSelectFilter: ge,
|
|
1670
|
+
ListboxOptionTag: mt
|
|
1671
|
+
},
|
|
1672
|
+
props: {
|
|
1673
|
+
...Be,
|
|
1674
|
+
/**
|
|
1675
|
+
* List of options that are needed to setup the tag filter
|
|
1676
|
+
* Available options:
|
|
1677
|
+
* - multiple: If "true", the user will be able to select multiple items.
|
|
1678
|
+
* - listboxItems: The option elements to populate the filter with {@see BentoSelectTagFilterOptions}
|
|
1679
|
+
*/
|
|
1680
|
+
options: {
|
|
1681
|
+
type: Object,
|
|
1682
|
+
default: void 0
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1686
|
+
setup(e, { emit: n }) {
|
|
1687
|
+
const t = (a) => n(g.UPDATE, a), r = c(
|
|
1688
|
+
() => {
|
|
1689
|
+
var a, i;
|
|
1690
|
+
return (i = (a = e == null ? void 0 : e.options) == null ? void 0 : a.listboxItems) == null ? void 0 : i.map(({ label: s, value: u, variant: p }) => ({ label: s, value: u, data: p }));
|
|
1691
|
+
}
|
|
1692
|
+
);
|
|
1693
|
+
return {
|
|
1694
|
+
// Values
|
|
1695
|
+
countryOptions: c(() => ({
|
|
1696
|
+
...e.options,
|
|
1697
|
+
listboxItems: r.value
|
|
1698
|
+
})),
|
|
1699
|
+
// Methods
|
|
1700
|
+
onUpdate: t,
|
|
1701
|
+
// Enums
|
|
1702
|
+
BentoFilterEvent: g
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
function zl(e, n, t, r, l, a) {
|
|
1707
|
+
const i = P("listbox-option-tag"), s = P("bento-select-filter");
|
|
1708
|
+
return v(), E(s, oe(e.$props, {
|
|
1709
|
+
field: e.field,
|
|
1710
|
+
label: e.label,
|
|
1711
|
+
options: e.countryOptions,
|
|
1712
|
+
onUpdate: e.onUpdate,
|
|
1713
|
+
onInput: n[0] || (n[0] = (u) => e.$emit(e.BentoFilterEvent.INPUT, u))
|
|
1714
|
+
}), {
|
|
1715
|
+
default: y(({ label: u, data: p }) => [
|
|
1716
|
+
$(i, {
|
|
1717
|
+
option: { value: u, data: p, label: "" }
|
|
1718
|
+
}, null, 8, ["option"])
|
|
1719
|
+
]),
|
|
1720
|
+
_: 1
|
|
1721
|
+
}, 16, ["field", "label", "options", "onUpdate"]);
|
|
1722
|
+
}
|
|
1723
|
+
const Tt = /* @__PURE__ */ ee(Jl, [["render", zl]]), lt = {
|
|
1724
|
+
"en-US": {
|
|
1725
|
+
no: "No",
|
|
1726
|
+
yes: "Yes"
|
|
1727
|
+
},
|
|
1728
|
+
"ja-JP": {
|
|
1729
|
+
no: "いいえ",
|
|
1730
|
+
yes: "はい"
|
|
1731
|
+
},
|
|
1732
|
+
"pt-BR": {
|
|
1733
|
+
no: "Não",
|
|
1734
|
+
yes: "Sim"
|
|
1735
|
+
}
|
|
1736
|
+
}, Yl = z({
|
|
1737
|
+
name: "bento-boolean-filter",
|
|
1738
|
+
i18n: { messages: lt },
|
|
1739
|
+
components: { BentoBaseFilter: Fe, BentoRadioGroup: Jt },
|
|
1740
|
+
props: {
|
|
1741
|
+
/**
|
|
1742
|
+
* Disables the filter from being interacted with.
|
|
1743
|
+
*/
|
|
1744
|
+
disabled: { type: Boolean, default: !1 },
|
|
1745
|
+
/**
|
|
1746
|
+
* Default value of the filter to reset to.
|
|
1747
|
+
*/
|
|
1748
|
+
defaultValue: { type: [String, Boolean], default: null },
|
|
1749
|
+
/**
|
|
1750
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
1751
|
+
* Should be unique per filter bar.
|
|
1752
|
+
*/
|
|
1753
|
+
field: { type: String, required: !0 },
|
|
1754
|
+
/**
|
|
1755
|
+
* Label text to be displayed
|
|
1756
|
+
*/
|
|
1757
|
+
label: { type: String, required: !0 },
|
|
1758
|
+
/**
|
|
1759
|
+
* Current value of the filter
|
|
1760
|
+
*/
|
|
1761
|
+
value: { type: [String, Boolean], default: null },
|
|
1762
|
+
/**
|
|
1763
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
1764
|
+
* Used for the allFiltersModal component.
|
|
1765
|
+
*/
|
|
1766
|
+
onlySlot: { type: Boolean, default: !1 },
|
|
1767
|
+
/**
|
|
1768
|
+
* List of options that are needed to setup the filter
|
|
1769
|
+
* Available options:
|
|
1770
|
+
* - listboxItems: The option elements to populate the filter with.
|
|
1771
|
+
*/
|
|
1772
|
+
options: {
|
|
1773
|
+
type: Object,
|
|
1774
|
+
default: void 0
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1778
|
+
setup(e, { emit: n }) {
|
|
1779
|
+
const { t } = de({ messages: lt }), r = (U) => typeof U == "boolean" ? U == null ? void 0 : U.toString() : U, l = (U) => {
|
|
1780
|
+
var F, R, k, N;
|
|
1781
|
+
return ((R = (F = e == null ? void 0 : e.options) == null ? void 0 : F.positiveOption) == null ? void 0 : R.value) !== void 0 && ((N = (k = e == null ? void 0 : e.options) == null ? void 0 : k.negativeOption) == null ? void 0 : N.value) !== void 0 && typeof e.options.positiveOption.value == "boolean" && typeof e.options.negativeOption.value == "boolean" && typeof U == "string" ? U === "true" : U;
|
|
1782
|
+
}, a = c(() => r(e.defaultValue)), i = c(() => r(e.value)), s = c(() => e.options && e.options.positiveOption && e.options.negativeOption ? [
|
|
1783
|
+
{
|
|
1784
|
+
...e.options.positiveOption,
|
|
1785
|
+
value: r(e.options.positiveOption.value)
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
...e.options.negativeOption,
|
|
1789
|
+
value: r(e.options.negativeOption.value)
|
|
1790
|
+
}
|
|
1791
|
+
] : [
|
|
1792
|
+
{ value: "yes", label: t("yes") },
|
|
1793
|
+
{ value: "no", label: t("no") }
|
|
1794
|
+
]), { internalFilterValue: u, isSecondaryButtonDisabled: p, isApplyButtonDisabled: f } = ve(
|
|
1795
|
+
i,
|
|
1796
|
+
a
|
|
1797
|
+
), h = c(() => e.label), _ = c(
|
|
1798
|
+
() => {
|
|
1799
|
+
var U;
|
|
1800
|
+
return Se((U = s.value.find(({ value: F }) => F === i.value)) == null ? void 0 : U.label, 12);
|
|
1801
|
+
}
|
|
1802
|
+
), d = c(() => ({
|
|
1803
|
+
"b-boolean-filter--only-slot": e.onlySlot
|
|
1804
|
+
}));
|
|
1805
|
+
Oe(() => {
|
|
1806
|
+
u.value || (u.value = null);
|
|
1807
|
+
});
|
|
1808
|
+
const A = (U) => {
|
|
1809
|
+
u.value = U, n(g.INPUT, {
|
|
1810
|
+
...e,
|
|
1811
|
+
value: l(u.value)
|
|
1812
|
+
});
|
|
1813
|
+
}, I = () => {
|
|
1814
|
+
u.value = i.value;
|
|
1815
|
+
}, T = () => {
|
|
1816
|
+
n(g.UPDATE, {
|
|
1817
|
+
...e,
|
|
1818
|
+
value: l(u.value)
|
|
1819
|
+
});
|
|
1820
|
+
};
|
|
1821
|
+
return {
|
|
1822
|
+
// Values
|
|
1823
|
+
items: s,
|
|
1824
|
+
conditionalClasses: d,
|
|
1825
|
+
buttonLabel: h,
|
|
1826
|
+
buttonSecondaryLabel: _,
|
|
1827
|
+
internalFilterValue: u,
|
|
1828
|
+
isApplyButtonDisabled: f,
|
|
1829
|
+
isSecondaryButtonDisabled: p,
|
|
1830
|
+
translatedValue: i,
|
|
1831
|
+
translatedDefaultValue: a,
|
|
1832
|
+
// Events
|
|
1833
|
+
onInput: A,
|
|
1834
|
+
updateFilter: T,
|
|
1835
|
+
clearFilter: () => {
|
|
1836
|
+
u.value = null, T();
|
|
1837
|
+
},
|
|
1838
|
+
openFilter: I,
|
|
1839
|
+
resetFilter: () => n(g.UPDATE, { ...e, value: e.defaultValue })
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
function Wl(e, n, t, r, l, a) {
|
|
1844
|
+
const i = P("bento-radio-group"), s = P("bento-base-filter");
|
|
1845
|
+
return v(), E(s, oe(e.$props, {
|
|
1846
|
+
value: e.translatedValue,
|
|
1847
|
+
"default-value": e.translatedDefaultValue,
|
|
1848
|
+
"button-label": e.buttonLabel,
|
|
1849
|
+
"button-secondary-label": e.buttonSecondaryLabel,
|
|
1850
|
+
"disable-apply-button": e.isApplyButtonDisabled,
|
|
1851
|
+
"disable-secondary-button": e.isSecondaryButtonDisabled,
|
|
1852
|
+
"only-slot": e.onlySlot,
|
|
1853
|
+
onApply: e.updateFilter,
|
|
1854
|
+
onClear: e.clearFilter,
|
|
1855
|
+
onOpen: e.openFilter,
|
|
1856
|
+
onReset: e.resetFilter
|
|
1857
|
+
}), {
|
|
1858
|
+
default: y(() => [
|
|
1859
|
+
j("div", {
|
|
1860
|
+
class: ie(["b-boolean-filter", e.conditionalClasses]),
|
|
1861
|
+
onKeydown: n[0] || (n[0] = be((...u) => e.updateFilter && e.updateFilter(...u), ["enter"]))
|
|
1862
|
+
}, [
|
|
1863
|
+
$(i, {
|
|
1864
|
+
items: e.items,
|
|
1865
|
+
label: e.label,
|
|
1866
|
+
"model-value": e.internalFilterValue,
|
|
1867
|
+
"hide-label": "",
|
|
1868
|
+
"onUpdate:modelValue": e.onInput
|
|
1869
|
+
}, null, 8, ["items", "label", "model-value", "onUpdate:modelValue"])
|
|
1870
|
+
], 34)
|
|
1871
|
+
]),
|
|
1872
|
+
_: 1
|
|
1873
|
+
}, 16, ["value", "default-value", "button-label", "button-secondary-label", "disable-apply-button", "disable-secondary-button", "only-slot", "onApply", "onClear", "onOpen", "onReset"]);
|
|
1874
|
+
}
|
|
1875
|
+
const $t = /* @__PURE__ */ ee(Yl, [["render", Wl], ["__scopeId", "data-v-4619720e"]]), at = {
|
|
1876
|
+
"en-US": {
|
|
1877
|
+
from: "From",
|
|
1878
|
+
to: "To"
|
|
1879
|
+
}
|
|
1880
|
+
}, Gl = z({
|
|
1881
|
+
name: "bento-range-filter",
|
|
1882
|
+
i18n: { messages: at },
|
|
1883
|
+
components: { BentoBaseFilter: Fe, BentoInputField: Me },
|
|
1884
|
+
props: {
|
|
1885
|
+
/**
|
|
1886
|
+
* Disables the filter from being interacted with.
|
|
1887
|
+
*/
|
|
1888
|
+
disabled: { type: Boolean, default: !1 },
|
|
1889
|
+
/**
|
|
1890
|
+
* Default value of the filter to reset to.
|
|
1891
|
+
*/
|
|
1892
|
+
defaultValue: { type: Array, default: null },
|
|
1893
|
+
/**
|
|
1894
|
+
* Filter name/key referencing the actual property name in the data set.
|
|
1895
|
+
* Should be unique per filter bar.
|
|
1896
|
+
*/
|
|
1897
|
+
field: { type: String, required: !0 },
|
|
1898
|
+
/**
|
|
1899
|
+
* Label text to be displayed
|
|
1900
|
+
*/
|
|
1901
|
+
label: { type: String, required: !0 },
|
|
1902
|
+
/**
|
|
1903
|
+
* Current value of the filter
|
|
1904
|
+
*/
|
|
1905
|
+
value: { type: Array, default: () => ["", ""] },
|
|
1906
|
+
/**
|
|
1907
|
+
* Renders the base filter's slot content only - leaving out the button and the popover.
|
|
1908
|
+
* Used for the allFiltersModal component.
|
|
1909
|
+
*/
|
|
1910
|
+
onlySlot: { type: Boolean, default: !1 }
|
|
1911
|
+
},
|
|
1912
|
+
emits: [g.INPUT, g.UPDATE],
|
|
1913
|
+
setup(e, { emit: n }) {
|
|
1914
|
+
const { t } = de({ messages: at }), r = M(null), { internalFilterValue: l, isSecondaryButtonDisabled: a, isApplyButtonDisabled: i } = ve(
|
|
1915
|
+
x(e, "value"),
|
|
1916
|
+
x(e, "defaultValue")
|
|
1917
|
+
), s = c(() => {
|
|
1918
|
+
var k, N, te, D, K, q, X, B;
|
|
1919
|
+
if (!((k = e.value) != null && k[0]) && !((N = e.value) != null && N[1]))
|
|
1920
|
+
return null;
|
|
1921
|
+
let w = "";
|
|
1922
|
+
(te = e.value) != null && te[0] ? (D = e.value) != null && D[1] || (w = "≥") : w = "≤";
|
|
1923
|
+
const U = (K = e.value) != null && K[0] ? `${Se(e.value[0], 5)}` : "", F = (q = e.value) != null && q[0] && ((X = e.value) != null && X[1]) ? " - " : "", R = (B = e.value) != null && B[1] ? `${Se(e.value[1], 5)}` : "";
|
|
1924
|
+
return `${w}${U}${F}${R}`;
|
|
1925
|
+
}), u = c(() => e.label), p = c(() => s.value), f = c(() => ({
|
|
1926
|
+
"b-range-filter--only-slot": e.onlySlot
|
|
1927
|
+
})), h = () => {
|
|
1928
|
+
l.value = e.value, st(() => r.value.focusInput());
|
|
1929
|
+
}, _ = () => {
|
|
1930
|
+
n(g.INPUT, { ...e, value: l.value });
|
|
1931
|
+
}, d = (w) => {
|
|
1932
|
+
l.value = [w, l.value[1]], _();
|
|
1933
|
+
}, A = (w) => {
|
|
1934
|
+
l.value = [l.value[0], w], _();
|
|
1935
|
+
}, I = () => {
|
|
1936
|
+
l.value.some((w) => w) || (l.value = e.defaultValue !== null ? e.defaultValue : void 0), n(g.UPDATE, {
|
|
1937
|
+
...e,
|
|
1938
|
+
value: l.value
|
|
1939
|
+
});
|
|
1940
|
+
};
|
|
1941
|
+
return {
|
|
1942
|
+
// Values
|
|
1943
|
+
inputTextRef: r,
|
|
1944
|
+
conditionalClasses: f,
|
|
1945
|
+
internalFilterValue: l,
|
|
1946
|
+
isApplyButtonDisabled: i,
|
|
1947
|
+
isSecondaryButtonDisabled: a,
|
|
1948
|
+
buttonLabel: u,
|
|
1949
|
+
buttonSecondaryLabel: p,
|
|
1950
|
+
// Events
|
|
1951
|
+
updateFrom: d,
|
|
1952
|
+
updateTo: A,
|
|
1953
|
+
updateFilter: I,
|
|
1954
|
+
clearFilter: () => {
|
|
1955
|
+
l.value = ["", ""], I();
|
|
1956
|
+
},
|
|
1957
|
+
openFilter: h,
|
|
1958
|
+
resetFilter: () => n(g.UPDATE, { ...e, value: e.defaultValue }),
|
|
1959
|
+
// Translations
|
|
1960
|
+
t
|
|
1961
|
+
};
|
|
1962
|
+
}
|
|
1963
|
+
});
|
|
1964
|
+
function Zl(e, n, t, r, l, a) {
|
|
1965
|
+
const i = P("bento-input-field"), s = P("bento-base-filter");
|
|
1966
|
+
return v(), E(s, oe(e.$props, {
|
|
1967
|
+
"disable-apply-button": e.isApplyButtonDisabled,
|
|
1968
|
+
"disable-secondary-button": e.isSecondaryButtonDisabled,
|
|
1969
|
+
"button-label": e.buttonLabel,
|
|
1970
|
+
"button-secondary-label": e.buttonSecondaryLabel,
|
|
1971
|
+
"only-slot": e.onlySlot,
|
|
1972
|
+
onApply: e.updateFilter,
|
|
1973
|
+
onClear: e.clearFilter,
|
|
1974
|
+
onOpen: e.openFilter,
|
|
1975
|
+
onReset: e.resetFilter
|
|
1976
|
+
}), {
|
|
1977
|
+
default: y(() => [
|
|
1978
|
+
j("div", {
|
|
1979
|
+
class: ie(["b-range-filter", e.conditionalClasses]),
|
|
1980
|
+
onKeydown: n[0] || (n[0] = be((...u) => e.updateFilter && e.updateFilter(...u), ["enter"]))
|
|
1981
|
+
}, [
|
|
1982
|
+
$(i, {
|
|
1983
|
+
ref: "inputTextRef",
|
|
1984
|
+
value: e.internalFilterValue ? e.internalFilterValue[0] : "",
|
|
1985
|
+
type: "number",
|
|
1986
|
+
"aria-label": e.t("from").toString(),
|
|
1987
|
+
onInput: e.updateFrom
|
|
1988
|
+
}, {
|
|
1989
|
+
default: y(() => [
|
|
1990
|
+
G(Z(e.t("from")), 1)
|
|
1991
|
+
]),
|
|
1992
|
+
_: 1
|
|
1993
|
+
}, 8, ["value", "aria-label", "onInput"]),
|
|
1994
|
+
$(i, {
|
|
1995
|
+
class: "b-range-filter__input-field",
|
|
1996
|
+
value: e.internalFilterValue ? e.internalFilterValue[1] : "",
|
|
1997
|
+
type: "number",
|
|
1998
|
+
"aria-label": e.t("to"),
|
|
1999
|
+
onInput: e.updateTo
|
|
2000
|
+
}, {
|
|
2001
|
+
default: y(() => [
|
|
2002
|
+
G(Z(e.t("to")), 1)
|
|
2003
|
+
]),
|
|
2004
|
+
_: 1
|
|
2005
|
+
}, 8, ["value", "aria-label", "onInput"])
|
|
2006
|
+
], 34)
|
|
2007
|
+
]),
|
|
2008
|
+
_: 1
|
|
2009
|
+
}, 16, ["disable-apply-button", "disable-secondary-button", "button-label", "button-secondary-label", "only-slot", "onApply", "onClear", "onOpen", "onReset"]);
|
|
2010
|
+
}
|
|
2011
|
+
const Pt = /* @__PURE__ */ ee(Gl, [["render", Zl], ["__scopeId", "data-v-e7e81bac"]]);
|
|
2012
|
+
var Ve = /* @__PURE__ */ ((e) => (e.INPUT = "input", e))(Ve || {});
|
|
2013
|
+
const Ql = z({
|
|
2014
|
+
name: "base-filter-button",
|
|
2015
|
+
components: { BaseButton: dt, BentoTypography: pe, ChevronUpIcon: Gt, ChevronDownIcon: Wt },
|
|
2016
|
+
props: {
|
|
2017
|
+
/**
|
|
2018
|
+
* The number of applies values within the filter.
|
|
2019
|
+
* e.g. if 2 items in a dropdown filter have been applied, the number 2 will be shown here.
|
|
2020
|
+
*/
|
|
2021
|
+
amountAppliedValues: { type: [Number, String], default: null },
|
|
2022
|
+
/**
|
|
2023
|
+
* Disables button functionality.
|
|
2024
|
+
*/
|
|
2025
|
+
disabled: { type: Boolean, default: !1 },
|
|
2026
|
+
/**
|
|
2027
|
+
* Signifies if the filter is open or closed.
|
|
2028
|
+
*/
|
|
2029
|
+
isFilterOpen: { type: Boolean, default: !1 },
|
|
2030
|
+
/**
|
|
2031
|
+
* Toggles if a chevron icon should be displayed in the button.
|
|
2032
|
+
* The chevron will change depending on the open state of the filter.
|
|
2033
|
+
*/
|
|
2034
|
+
hasChevron: { type: Boolean, default: !1 },
|
|
2035
|
+
/**
|
|
2036
|
+
* Renders the text in a stronger variant.
|
|
2037
|
+
*/
|
|
2038
|
+
bold: { type: Boolean, default: !1 }
|
|
2039
|
+
},
|
|
2040
|
+
emits: [ze.CLICK],
|
|
2041
|
+
setup(e, { slots: n, emit: t, attrs: r }) {
|
|
2042
|
+
const l = c(() => n.default ? bt(n)("default") : null), a = pt({ ariaLabel: l }), i = M(null), s = c(() => {
|
|
2043
|
+
var f;
|
|
2044
|
+
return {
|
|
2045
|
+
"aria-controls": (f = r["aria-controls"]) == null ? void 0 : f.toString()
|
|
2046
|
+
};
|
|
2047
|
+
}), u = c(() => ({
|
|
2048
|
+
"b-base-filter-button--with-chevron": e.hasChevron,
|
|
2049
|
+
"b-base-filter-button--filter-open": e.isFilterOpen
|
|
2050
|
+
}));
|
|
2051
|
+
return {
|
|
2052
|
+
// Values
|
|
2053
|
+
ariaAttributes: s,
|
|
2054
|
+
computedAriaLabel: a,
|
|
2055
|
+
conditionalClasses: u,
|
|
2056
|
+
// Methods
|
|
2057
|
+
onClickButton: () => {
|
|
2058
|
+
e.disabled || t(ze.CLICK);
|
|
2059
|
+
},
|
|
2060
|
+
hasSlot: ct(n),
|
|
2061
|
+
// Refs
|
|
2062
|
+
baseFilterButtonRef: i
|
|
2063
|
+
};
|
|
2064
|
+
}
|
|
2065
|
+
}), Xl = { class: "b-base-filter-button__default-container" }, xl = { class: "b-base-filter-button__label-container" }, ea = {
|
|
2066
|
+
key: 0,
|
|
2067
|
+
class: "b-base-filter-button__counter-wrapper"
|
|
2068
|
+
};
|
|
2069
|
+
function ta(e, n, t, r, l, a) {
|
|
2070
|
+
const i = P("bento-typography"), s = P("chevron-up-icon"), u = P("chevron-down-icon"), p = P("base-button");
|
|
2071
|
+
return v(), E(p, {
|
|
2072
|
+
ref: "baseFilterButtonRef",
|
|
2073
|
+
class: ie(["b-base-filter-button", e.conditionalClasses]),
|
|
2074
|
+
disabled: e.disabled,
|
|
2075
|
+
"aria-label": e.computedAriaLabel,
|
|
2076
|
+
"aria-controls": e.ariaAttributes["aria-controls"],
|
|
2077
|
+
type: "button",
|
|
2078
|
+
onClick: e.onClickButton
|
|
2079
|
+
}, De({
|
|
2080
|
+
default: y(() => [
|
|
2081
|
+
j("div", Xl, [
|
|
2082
|
+
j("div", xl, [
|
|
2083
|
+
$(i, {
|
|
2084
|
+
el: "span",
|
|
2085
|
+
variant: "body",
|
|
2086
|
+
stronger: e.bold,
|
|
2087
|
+
class: "b-base-filter-button__label"
|
|
2088
|
+
}, {
|
|
2089
|
+
default: y(() => [
|
|
2090
|
+
re(e.$slots, "default", {}, void 0, !0)
|
|
2091
|
+
]),
|
|
2092
|
+
_: 3
|
|
2093
|
+
}, 8, ["stronger"])
|
|
2094
|
+
]),
|
|
2095
|
+
e.amountAppliedValues && !e.hasChevron ? (v(), J("div", ea, [
|
|
2096
|
+
$(i, {
|
|
2097
|
+
class: "b-base-filter-button__counter",
|
|
2098
|
+
el: "span",
|
|
2099
|
+
variant: "body",
|
|
2100
|
+
stronger: ""
|
|
2101
|
+
}, {
|
|
2102
|
+
default: y(() => [
|
|
2103
|
+
G(Z(e.amountAppliedValues), 1)
|
|
2104
|
+
]),
|
|
2105
|
+
_: 1
|
|
2106
|
+
})
|
|
2107
|
+
])) : Q("", !0)
|
|
2108
|
+
])
|
|
2109
|
+
]),
|
|
2110
|
+
_: 2
|
|
2111
|
+
}, [
|
|
2112
|
+
e.hasChevron ? {
|
|
2113
|
+
name: "iconRight",
|
|
2114
|
+
fn: y(() => [
|
|
2115
|
+
e.isFilterOpen ? (v(), E(s, {
|
|
2116
|
+
key: 0,
|
|
2117
|
+
"aria-hidden": "true"
|
|
2118
|
+
})) : (v(), E(u, {
|
|
2119
|
+
key: 1,
|
|
2120
|
+
"aria-hidden": "true"
|
|
2121
|
+
}))
|
|
2122
|
+
]),
|
|
2123
|
+
key: "0"
|
|
2124
|
+
} : void 0
|
|
2125
|
+
]), 1032, ["class", "disabled", "aria-label", "aria-controls", "onClick"]);
|
|
2126
|
+
}
|
|
2127
|
+
const la = /* @__PURE__ */ ee(Ql, [["render", ta], ["__scopeId", "data-v-af9efc73"]]), aa = z({
|
|
2128
|
+
name: "all-filters-modal-button",
|
|
2129
|
+
components: { BaseFilterButton: la },
|
|
2130
|
+
props: {
|
|
2131
|
+
/**
|
|
2132
|
+
* Button label to be displayed
|
|
2133
|
+
*/
|
|
2134
|
+
label: { type: String, required: !0 },
|
|
2135
|
+
/**
|
|
2136
|
+
* Total count of applied filters
|
|
2137
|
+
*/
|
|
2138
|
+
appliedFiltersCount: { type: [Number, String], default: null },
|
|
2139
|
+
/**
|
|
2140
|
+
* Indicates whether the filter popover tied to this button is showing
|
|
2141
|
+
*/
|
|
2142
|
+
isFilterOpen: { type: Boolean, default: !1 },
|
|
2143
|
+
/**
|
|
2144
|
+
* Disables button functionality.
|
|
2145
|
+
*/
|
|
2146
|
+
disabled: { type: Boolean, default: !1 }
|
|
2147
|
+
},
|
|
2148
|
+
emits: ["click"],
|
|
2149
|
+
setup(e, { emit: n }) {
|
|
2150
|
+
return {
|
|
2151
|
+
conditionalClasses: c(() => ({
|
|
2152
|
+
"b-all-filters-modal-button--with-counter": e.appliedFiltersCount,
|
|
2153
|
+
"b-all-filters-modal-button--filter-open": e.isFilterOpen
|
|
2154
|
+
})),
|
|
2155
|
+
onClick: () => {
|
|
2156
|
+
n("click");
|
|
2157
|
+
}
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
function na(e, n, t, r, l, a) {
|
|
2162
|
+
const i = P("base-filter-button");
|
|
2163
|
+
return v(), E(i, {
|
|
2164
|
+
class: ie(["b-all-filters-modal-button", e.conditionalClasses]),
|
|
2165
|
+
"amount-applied-values": e.appliedFiltersCount,
|
|
2166
|
+
"is-filter-open": e.isFilterOpen,
|
|
2167
|
+
disabled: e.disabled,
|
|
2168
|
+
onClick: e.onClick
|
|
2169
|
+
}, {
|
|
2170
|
+
default: y(() => [
|
|
2171
|
+
G(Z(e.label), 1)
|
|
2172
|
+
]),
|
|
2173
|
+
_: 1
|
|
2174
|
+
}, 8, ["class", "amount-applied-values", "is-filter-open", "disabled", "onClick"]);
|
|
2175
|
+
}
|
|
2176
|
+
const oa = /* @__PURE__ */ ee(aa, [["render", na], ["__scopeId", "data-v-b96a672f"]]);
|
|
2177
|
+
let nt = 0;
|
|
2178
|
+
const sa = {
|
|
2179
|
+
beforeCreate() {
|
|
2180
|
+
this.uuid = nt.toString(), nt += 1;
|
|
2181
|
+
}
|
|
2182
|
+
}, ia = { key: 0 };
|
|
2183
|
+
function ra(e, n, t, r, l, a) {
|
|
2184
|
+
return v(), J("svg", oe({ role: "img" }, e.$attrs, {
|
|
2185
|
+
class: "ui-assets-icons-16",
|
|
2186
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2187
|
+
width: "16",
|
|
2188
|
+
height: "16",
|
|
2189
|
+
fill: "none"
|
|
2190
|
+
}), [
|
|
2191
|
+
e.$attrs["svg-title"] ? (v(), J("title", ia, Z(e.$attrs["svg-title"]), 1)) : Q("", !0),
|
|
2192
|
+
n[0] || (n[0] = j("path", {
|
|
2193
|
+
fill: "#00112C",
|
|
2194
|
+
d: "M12.6465 4.58337C12.32 3.42912 11.2588 2.58337 10 2.58337C8.74122 2.58337 7.67998 3.42912 7.35352 4.58337H1.25V6.08337H7.35352C7.67998 7.23763 8.74122 8.08337 10 8.08337C11.2588 8.08337 12.32 7.23763 12.6465 6.08337H14.75V4.58337H12.6465ZM11.25 5.33337C11.25 6.02373 10.6904 6.58337 10 6.58337C9.30964 6.58337 8.75 6.02373 8.75 5.33337C8.75 4.64302 9.30964 4.08337 10 4.08337C10.6904 4.08337 11.25 4.64302 11.25 5.33337Z"
|
|
2195
|
+
}, null, -1)),
|
|
2196
|
+
n[1] || (n[1] = j("path", {
|
|
2197
|
+
fill: "#00112C",
|
|
2198
|
+
d: "M4 7.91687C5.25878 7.91687 6.32002 8.76262 6.64648 9.91687H14.75V11.4169H6.64648C6.32002 12.5711 5.25878 13.4169 4 13.4169C2.48122 13.4169 1.25 12.1857 1.25 10.6669C1.25 9.14809 2.48122 7.91687 4 7.91687ZM5.25 10.6669C5.25 9.97651 4.69036 9.41687 4 9.41687C3.30964 9.41687 2.75 9.97651 2.75 10.6669C2.75 11.3572 3.30964 11.9169 4 11.9169C4.69036 11.9169 5.25 11.3572 5.25 10.6669Z"
|
|
2199
|
+
}, null, -1))
|
|
2200
|
+
], 16);
|
|
2201
|
+
}
|
|
2202
|
+
const ua = /* @__PURE__ */ ee(sa, [["render", ra]]), ot = {
|
|
2203
|
+
"en-US": {
|
|
2204
|
+
activeFilters: "Active filters",
|
|
2205
|
+
all: "All",
|
|
2206
|
+
allFilters: "All filters",
|
|
2207
|
+
applyAll: "Apply all",
|
|
2208
|
+
cancel: "Cancel",
|
|
2209
|
+
clear: "Clear",
|
|
2210
|
+
clearAll: "Clear all",
|
|
2211
|
+
noFiltersMatchThisSearch: "No filters match this search",
|
|
2212
|
+
otherFilters: "Other filters",
|
|
2213
|
+
searchBar: "Search bar"
|
|
2214
|
+
},
|
|
2215
|
+
"ja-JP": {
|
|
2216
|
+
all: "すべて",
|
|
2217
|
+
cancel: "キャンセル",
|
|
2218
|
+
clear: "クリア",
|
|
2219
|
+
clearAll: "すべてクリア"
|
|
2220
|
+
},
|
|
2221
|
+
"pt-BR": {
|
|
2222
|
+
all: "Todos",
|
|
2223
|
+
cancel: "Cancelar",
|
|
2224
|
+
clear: "Limpar",
|
|
2225
|
+
clearAll: "Limpar tudo"
|
|
2226
|
+
}
|
|
2227
|
+
}, da = z({
|
|
2228
|
+
i18n: { messages: ot },
|
|
2229
|
+
name: "all-filters-modal",
|
|
2230
|
+
components: {
|
|
2231
|
+
AllFiltersModalButton: oa,
|
|
2232
|
+
BentoBooleanFilter: $t,
|
|
2233
|
+
BentoButton: kt,
|
|
2234
|
+
BentoDateFilter: ht,
|
|
2235
|
+
BentoDateRangeFilter: St,
|
|
2236
|
+
BentoInputFilter: Ft,
|
|
2237
|
+
BentoInputWithDropdownFilter: gt,
|
|
2238
|
+
BentoModal: wt,
|
|
2239
|
+
BentoRangeFilter: Pt,
|
|
2240
|
+
BentoSearchBar: Ue,
|
|
2241
|
+
BentoSelectAvatarFilter: _t,
|
|
2242
|
+
BentoSelectCurrencyFilter: At,
|
|
2243
|
+
BentoSelectCountryFilter: Dt,
|
|
2244
|
+
BentoSelectFilter: ge,
|
|
2245
|
+
BentoSelectPaymentMethodFilter: It,
|
|
2246
|
+
BentoSelectTagFilter: Tt,
|
|
2247
|
+
BentoTypography: pe,
|
|
2248
|
+
FilterBarButton: Ee,
|
|
2249
|
+
SlidersIcon: ua
|
|
2250
|
+
},
|
|
2251
|
+
props: {
|
|
2252
|
+
/**
|
|
2253
|
+
* Array of filters based on {@see FilterBarModel}.
|
|
2254
|
+
* Each one of the elements in the array correspond to a filter that will
|
|
2255
|
+
* be created and rendered in the AllFiltersModal.
|
|
2256
|
+
*
|
|
2257
|
+
* Can be used with v-model or independently with the @input event.
|
|
2258
|
+
*
|
|
2259
|
+
* @example
|
|
2260
|
+
* [{
|
|
2261
|
+
* field: 'company',
|
|
2262
|
+
* label: 'Company',
|
|
2263
|
+
* value: '200',
|
|
2264
|
+
* type: FilterType.TEXT,
|
|
2265
|
+
* }, {
|
|
2266
|
+
* field: 'name',
|
|
2267
|
+
* label: 'Name',
|
|
2268
|
+
* value: null,
|
|
2269
|
+
* type: FilterType.TEXT,
|
|
2270
|
+
* }]
|
|
2271
|
+
*/
|
|
2272
|
+
value: {
|
|
2273
|
+
type: Array,
|
|
2274
|
+
default: () => []
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
emits: [Ve.INPUT],
|
|
2278
|
+
setup(e, { emit: n }) {
|
|
2279
|
+
const t = M(e.value), r = ke("all-filters-modal"), l = M([]), a = M(!1), i = M(0), s = M(null), u = M(""), { t: p } = de({ messages: ot }), f = vt(u, x(t, "value")), h = M({});
|
|
2280
|
+
Oe(() => {
|
|
2281
|
+
h.value = [];
|
|
2282
|
+
}), ue(
|
|
2283
|
+
() => e.value,
|
|
2284
|
+
() => {
|
|
2285
|
+
a.value ? t.value = e.value.map((m, b) => ({ ...m, value: t.value[b].value })) : t.value = e.value;
|
|
2286
|
+
}
|
|
2287
|
+
);
|
|
2288
|
+
const _ = (m) => m.sort((b, O) => b.label > O.label ? 1 : O.label > b.label ? -1 : 0), d = c(
|
|
2289
|
+
() => _(
|
|
2290
|
+
f.value.filter(
|
|
2291
|
+
(m) => {
|
|
2292
|
+
var b, O;
|
|
2293
|
+
return Array.isArray(m.value) ? ((b = m.value) == null ? void 0 : b.length) && ((O = m.value) == null ? void 0 : O.find((H) => H !== "")) : m.value;
|
|
2294
|
+
}
|
|
2295
|
+
)
|
|
2296
|
+
)
|
|
2297
|
+
), A = c(
|
|
2298
|
+
() => _(
|
|
2299
|
+
f.value.filter(
|
|
2300
|
+
(m) => {
|
|
2301
|
+
var b, O;
|
|
2302
|
+
return Array.isArray(m.value) ? ((b = m.value) == null ? void 0 : b.length) === 0 || ((O = m.value) == null ? void 0 : O.every((H) => H === "")) : !m.value;
|
|
2303
|
+
}
|
|
2304
|
+
)
|
|
2305
|
+
)
|
|
2306
|
+
), I = c(() => {
|
|
2307
|
+
var m;
|
|
2308
|
+
return u.value && ((m = f.value) == null ? void 0 : m.length) === 0;
|
|
2309
|
+
}), T = c(() => t.value[i.value]), V = () => {
|
|
2310
|
+
const m = d.value.length ? d.value[0] : A.value[0], b = t.value.findIndex(
|
|
2311
|
+
(O) => O.label === m.label && O.field === m.field
|
|
2312
|
+
);
|
|
2313
|
+
i.value = b;
|
|
2314
|
+
};
|
|
2315
|
+
rt(() => {
|
|
2316
|
+
V();
|
|
2317
|
+
});
|
|
2318
|
+
const w = (m) => m.map((b) => {
|
|
2319
|
+
var O, H, W, ae, ce, me;
|
|
2320
|
+
switch (b.type) {
|
|
2321
|
+
case ne.SELECT:
|
|
2322
|
+
case ne.SELECT_AVATAR:
|
|
2323
|
+
case ne.SELECT_COUNTRY:
|
|
2324
|
+
case ne.SELECT_CURRENCY:
|
|
2325
|
+
case ne.SELECT_PAYMENT_METHOD:
|
|
2326
|
+
case ne.SELECT_TAG:
|
|
2327
|
+
switch ((O = b.options) == null ? void 0 : O.multiple) {
|
|
2328
|
+
case !0:
|
|
2329
|
+
return {
|
|
2330
|
+
label: b.label,
|
|
2331
|
+
field: b.field,
|
|
2332
|
+
count: (H = b.value) != null && H.length ? (W = b.value) == null ? void 0 : W.length : null
|
|
2333
|
+
};
|
|
2334
|
+
default:
|
|
2335
|
+
return {
|
|
2336
|
+
label: b.label,
|
|
2337
|
+
field: b.field,
|
|
2338
|
+
count: b.value == null ? null : 1
|
|
2339
|
+
};
|
|
2340
|
+
}
|
|
2341
|
+
case ne.DATE_RANGE:
|
|
2342
|
+
return {
|
|
2343
|
+
label: b.label,
|
|
2344
|
+
field: b.field,
|
|
2345
|
+
count: ((ae = b.value) == null ? void 0 : ae.startDate) != null && ((ce = b.value) == null ? void 0 : ce.endDate) != null ? 1 : null
|
|
2346
|
+
};
|
|
2347
|
+
case ne.RANGE:
|
|
2348
|
+
return {
|
|
2349
|
+
label: b.label,
|
|
2350
|
+
field: b.field,
|
|
2351
|
+
count: (me = b.value) != null && me.find((le) => le !== "") ? 1 : null
|
|
2352
|
+
};
|
|
2353
|
+
case ne.INPUT:
|
|
2354
|
+
case ne.BOOLEAN:
|
|
2355
|
+
case ne.DATE:
|
|
2356
|
+
default:
|
|
2357
|
+
return {
|
|
2358
|
+
label: b.label,
|
|
2359
|
+
field: b.field,
|
|
2360
|
+
count: b.value != null ? 1 : null
|
|
2361
|
+
};
|
|
2362
|
+
}
|
|
2363
|
+
}), U = c(
|
|
2364
|
+
() => {
|
|
2365
|
+
var m;
|
|
2366
|
+
return Array.isArray(T.value.value) ? ((m = T.value) == null ? void 0 : m.value.length) && T.value.value.find((b) => b !== "") : !!t.value[i.value].value;
|
|
2367
|
+
}
|
|
2368
|
+
), F = c(
|
|
2369
|
+
() => {
|
|
2370
|
+
var m;
|
|
2371
|
+
return (m = w(e.value)) == null ? void 0 : m.filter(({ count: b }) => !!b).length;
|
|
2372
|
+
}
|
|
2373
|
+
), R = () => {
|
|
2374
|
+
a.value ? a.value = !1 : a.value = !0;
|
|
2375
|
+
}, k = (m) => {
|
|
2376
|
+
var O, H, W;
|
|
2377
|
+
const b = w(t.value).find((ae) => ae.field === m.field).count;
|
|
2378
|
+
return m.type.includes("BentoSelect") && ((O = m.options) != null && O.multiple) && b === ((W = (H = m.options) == null ? void 0 : H.listboxItems) == null ? void 0 : W.length) ? p("all") : b;
|
|
2379
|
+
}, N = (m, b) => {
|
|
2380
|
+
i.value = t.value.findIndex(
|
|
2381
|
+
(O) => O.label === m && O.field === b
|
|
2382
|
+
);
|
|
2383
|
+
}, te = () => {
|
|
2384
|
+
u.value = "";
|
|
2385
|
+
}, D = () => {
|
|
2386
|
+
a.value = !1, t.value = e.value, te(), V();
|
|
2387
|
+
}, K = (m) => {
|
|
2388
|
+
const b = t.value.map(({ value: O, ...H }, W) => W === i.value ? { value: m.value, ...H } : { value: O, ...H });
|
|
2389
|
+
t.value = b;
|
|
2390
|
+
}, q = () => {
|
|
2391
|
+
K({
|
|
2392
|
+
field: T.value.field,
|
|
2393
|
+
label: T.value.label,
|
|
2394
|
+
type: T.value.type,
|
|
2395
|
+
value: void 0
|
|
2396
|
+
});
|
|
2397
|
+
}, X = () => {
|
|
2398
|
+
t.value = e.value.map(({ value: m, ...b }) => ({
|
|
2399
|
+
...b,
|
|
2400
|
+
value: void 0
|
|
2401
|
+
}));
|
|
2402
|
+
}, B = () => {
|
|
2403
|
+
n(Ve.INPUT, t.value), a.value = !1;
|
|
2404
|
+
}, S = c(
|
|
2405
|
+
() => JSON.stringify(t.value) === JSON.stringify(e.value)
|
|
2406
|
+
), o = c(() => [
|
|
2407
|
+
{
|
|
2408
|
+
title: p("applyAll"),
|
|
2409
|
+
disabled: S.value,
|
|
2410
|
+
event: B
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
title: p("cancel"),
|
|
2414
|
+
event: D
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
title: p("clearAll"),
|
|
2418
|
+
disabled: !F.value,
|
|
2419
|
+
event: X
|
|
2420
|
+
}
|
|
2421
|
+
]);
|
|
2422
|
+
return {
|
|
2423
|
+
// Enums
|
|
2424
|
+
BentoModalEvent: Vt,
|
|
2425
|
+
// Values
|
|
2426
|
+
allFiltersModalUniqueId: r,
|
|
2427
|
+
allFiltersModalFiltersSection: l,
|
|
2428
|
+
allFiltersModalFilterButtons: h,
|
|
2429
|
+
numberOfActiveFilters: F,
|
|
2430
|
+
isEmptyResultForSearchFilter: I,
|
|
2431
|
+
isModalOpen: a,
|
|
2432
|
+
isClearButtonEnabled: U,
|
|
2433
|
+
activeFilters: d,
|
|
2434
|
+
otherFilters: A,
|
|
2435
|
+
modalActions: o,
|
|
2436
|
+
selectedFilter: T,
|
|
2437
|
+
selectedFilterRef: s,
|
|
2438
|
+
searchTerm: u,
|
|
2439
|
+
// Methods
|
|
2440
|
+
onClickAllFiltersModal: R,
|
|
2441
|
+
getFilterCount: k,
|
|
2442
|
+
cancel: D,
|
|
2443
|
+
selectFilter: N,
|
|
2444
|
+
clearFilter: q,
|
|
2445
|
+
updateFilter: K,
|
|
2446
|
+
onSearchbarClear: te,
|
|
2447
|
+
onKeydownRight: () => {
|
|
2448
|
+
Yt(1, s.value.$el).focus();
|
|
2449
|
+
},
|
|
2450
|
+
onKeydownLeft: () => {
|
|
2451
|
+
h.value[T.value.label].$el.focus();
|
|
2452
|
+
},
|
|
2453
|
+
// Translations
|
|
2454
|
+
t: p
|
|
2455
|
+
};
|
|
2456
|
+
}
|
|
2457
|
+
}), ca = { class: "b-all-filters-modal" }, pa = {
|
|
2458
|
+
key: 0,
|
|
2459
|
+
class: "b-all-filters-modal__empty-search-message"
|
|
2460
|
+
}, ba = {
|
|
2461
|
+
key: 1,
|
|
2462
|
+
class: "b-all-filters-modal__filters-section"
|
|
2463
|
+
}, fa = ["aria-labelledby"], va = {
|
|
2464
|
+
key: 2,
|
|
2465
|
+
class: "b-all-filters-modal__filters-section"
|
|
2466
|
+
}, ma = ["aria-labelledby"], ya = { class: "b-all-filters-modal__selected-filter-text" }, Fa = { class: "b-all-filters-modal__selected-filter-component" }, ga = { class: "b-all-filters-modal__clear-button" };
|
|
2467
|
+
function ha(e, n, t, r, l, a) {
|
|
2468
|
+
const i = P("sliders-icon"), s = P("filter-bar-button"), u = P("bento-search-bar"), p = P("bento-typography"), f = P("all-filters-modal-button"), h = P("bento-button"), _ = P("bento-modal");
|
|
2469
|
+
return v(), J("div", ca, [
|
|
2470
|
+
$(s, {
|
|
2471
|
+
"is-filter-open": e.isModalOpen,
|
|
2472
|
+
"applied-filters-count": e.numberOfActiveFilters,
|
|
2473
|
+
"no-applied-state-styles": "",
|
|
2474
|
+
onClick: e.onClickAllFiltersModal
|
|
2475
|
+
}, {
|
|
2476
|
+
iconLeft: y(() => [
|
|
2477
|
+
$(i, { "aria-hidden": "true" })
|
|
2478
|
+
]),
|
|
2479
|
+
default: y(() => [
|
|
2480
|
+
G(Z(e.t("allFilters")) + " ", 1)
|
|
2481
|
+
]),
|
|
2482
|
+
_: 1
|
|
2483
|
+
}, 8, ["is-filter-open", "applied-filters-count", "onClick"]),
|
|
2484
|
+
$(_, {
|
|
2485
|
+
class: "'b-all-filters-modal__modal'",
|
|
2486
|
+
"is-open": e.isModalOpen,
|
|
2487
|
+
"with-column-layout": !0,
|
|
2488
|
+
size: "large",
|
|
2489
|
+
actions: e.modalActions,
|
|
2490
|
+
"is-dismissible": !1,
|
|
2491
|
+
"hide-close-button": "",
|
|
2492
|
+
onCloseModal: e.cancel
|
|
2493
|
+
}, {
|
|
2494
|
+
default: y(() => [
|
|
2495
|
+
G(Z(e.t("allFilters")), 1)
|
|
2496
|
+
]),
|
|
2497
|
+
"content-col-1": y(() => [
|
|
2498
|
+
j("div", {
|
|
2499
|
+
ref: "allFiltersModalFiltersSection",
|
|
2500
|
+
class: "b-all-filters-modal__filters",
|
|
2501
|
+
onKeydown: n[1] || (n[1] = be((...d) => e.onKeydownRight && e.onKeydownRight(...d), ["right"]))
|
|
2502
|
+
}, [
|
|
2503
|
+
$(u, {
|
|
2504
|
+
class: "b-all-filters-modal__search-bar",
|
|
2505
|
+
value: e.searchTerm,
|
|
2506
|
+
"input-field-aria-label": e.t("searchBar").toString(),
|
|
2507
|
+
onInput: n[0] || (n[0] = (d) => e.searchTerm = d),
|
|
2508
|
+
onClear: e.onSearchbarClear
|
|
2509
|
+
}, null, 8, ["value", "input-field-aria-label", "onClear"]),
|
|
2510
|
+
e.isEmptyResultForSearchFilter ? (v(), J("div", pa, [
|
|
2511
|
+
$(p, { el: "span" }, {
|
|
2512
|
+
default: y(() => [
|
|
2513
|
+
G(Z(e.t("noFiltersMatchThisSearch")), 1)
|
|
2514
|
+
]),
|
|
2515
|
+
_: 1
|
|
2516
|
+
})
|
|
2517
|
+
])) : Q("", !0),
|
|
2518
|
+
e.activeFilters.length ? (v(), J("div", ba, [
|
|
2519
|
+
$(p, {
|
|
2520
|
+
id: `active-filters-${e.allFiltersModalUniqueId}`,
|
|
2521
|
+
class: "b-all-filters-modal__filters-section-title",
|
|
2522
|
+
el: "span",
|
|
2523
|
+
variant: "caption"
|
|
2524
|
+
}, {
|
|
2525
|
+
default: y(() => [
|
|
2526
|
+
G(Z(e.t("activeFilters")), 1)
|
|
2527
|
+
]),
|
|
2528
|
+
_: 1
|
|
2529
|
+
}, 8, ["id"]),
|
|
2530
|
+
j("ul", {
|
|
2531
|
+
class: "b-all-filters-modal__filters-list",
|
|
2532
|
+
"aria-labelledby": `active-filters-${e.allFiltersModalUniqueId}`
|
|
2533
|
+
}, [
|
|
2534
|
+
(v(!0), J(Ae, null, fe(e.activeFilters, (d) => (v(), J("li", {
|
|
2535
|
+
key: `${d.label}-${d.field}`
|
|
2536
|
+
}, [
|
|
2537
|
+
$(f, {
|
|
2538
|
+
ref_for: !0,
|
|
2539
|
+
ref: (A) => e.allFiltersModalFilterButtons[d.label] = A,
|
|
2540
|
+
label: d.label,
|
|
2541
|
+
"applied-filters-count": e.getFilterCount(d),
|
|
2542
|
+
"is-filter-open": e.selectedFilter.label === d.label,
|
|
2543
|
+
onClick: (A) => e.selectFilter(d.label, d.field)
|
|
2544
|
+
}, null, 8, ["label", "applied-filters-count", "is-filter-open", "onClick"])
|
|
2545
|
+
]))), 128))
|
|
2546
|
+
], 8, fa)
|
|
2547
|
+
])) : Q("", !0),
|
|
2548
|
+
e.otherFilters.length ? (v(), J("div", va, [
|
|
2549
|
+
e.activeFilters.length ? (v(), E(p, {
|
|
2550
|
+
key: 0,
|
|
2551
|
+
id: `other-filters-${e.allFiltersModalUniqueId}`,
|
|
2552
|
+
class: "b-all-filters-modal__filters-section-title",
|
|
2553
|
+
el: "span",
|
|
2554
|
+
variant: "caption"
|
|
2555
|
+
}, {
|
|
2556
|
+
default: y(() => [
|
|
2557
|
+
G(Z(e.t("otherFilters")), 1)
|
|
2558
|
+
]),
|
|
2559
|
+
_: 1
|
|
2560
|
+
}, 8, ["id"])) : Q("", !0),
|
|
2561
|
+
j("ul", {
|
|
2562
|
+
class: "b-all-filters-modal__filters-list",
|
|
2563
|
+
"aria-labelledby": `other-filters-${e.allFiltersModalUniqueId}`
|
|
2564
|
+
}, [
|
|
2565
|
+
(v(!0), J(Ae, null, fe(e.otherFilters, (d) => (v(), J("li", {
|
|
2566
|
+
key: `${d.label}-${d.field}`
|
|
2567
|
+
}, [
|
|
2568
|
+
$(f, {
|
|
2569
|
+
ref_for: !0,
|
|
2570
|
+
ref: (A) => e.allFiltersModalFilterButtons[d.label] = A,
|
|
2571
|
+
label: d.label,
|
|
2572
|
+
"applied-filters-count": e.getFilterCount(d),
|
|
2573
|
+
"is-filter-open": e.selectedFilter.label === d.label,
|
|
2574
|
+
onClick: (A) => e.selectFilter(d.label, d.field)
|
|
2575
|
+
}, null, 8, ["label", "applied-filters-count", "is-filter-open", "onClick"])
|
|
2576
|
+
]))), 128))
|
|
2577
|
+
], 8, ma)
|
|
2578
|
+
])) : Q("", !0)
|
|
2579
|
+
], 544)
|
|
2580
|
+
]),
|
|
2581
|
+
"content-col-2": y(() => [
|
|
2582
|
+
j("div", {
|
|
2583
|
+
class: "b-all-filters-modal__selected-filter-content",
|
|
2584
|
+
onKeydown: n[2] || (n[2] = be((...d) => e.onKeydownLeft && e.onKeydownLeft(...d), ["left"]))
|
|
2585
|
+
}, [
|
|
2586
|
+
j("div", ya, [
|
|
2587
|
+
$(p, {
|
|
2588
|
+
el: "div",
|
|
2589
|
+
variant: "title",
|
|
2590
|
+
medium: ""
|
|
2591
|
+
}, {
|
|
2592
|
+
default: y(() => [
|
|
2593
|
+
G(Z(e.selectedFilter.label), 1)
|
|
2594
|
+
]),
|
|
2595
|
+
_: 1
|
|
2596
|
+
}),
|
|
2597
|
+
e.selectedFilter.description ? (v(), E(p, {
|
|
2598
|
+
key: 0,
|
|
2599
|
+
el: "div",
|
|
2600
|
+
variant: "body",
|
|
2601
|
+
wide: ""
|
|
2602
|
+
}, {
|
|
2603
|
+
default: y(() => [
|
|
2604
|
+
G(Z(e.selectedFilter.description), 1)
|
|
2605
|
+
]),
|
|
2606
|
+
_: 1
|
|
2607
|
+
})) : Q("", !0)
|
|
2608
|
+
]),
|
|
2609
|
+
j("div", Fa, [
|
|
2610
|
+
(v(), E(Te(e.selectedFilter.type), {
|
|
2611
|
+
ref: "selectedFilterRef",
|
|
2612
|
+
key: e.selectedFilter.field,
|
|
2613
|
+
field: e.selectedFilter.field,
|
|
2614
|
+
label: e.selectedFilter.label,
|
|
2615
|
+
options: e.selectedFilter.options,
|
|
2616
|
+
value: e.selectedFilter.value,
|
|
2617
|
+
"default-value": e.selectedFilter.defaultValue,
|
|
2618
|
+
"only-slot": !0,
|
|
2619
|
+
onInput: e.updateFilter
|
|
2620
|
+
}, null, 40, ["field", "label", "options", "value", "default-value", "onInput"]))
|
|
2621
|
+
]),
|
|
2622
|
+
j("div", ga, [
|
|
2623
|
+
$(h, {
|
|
2624
|
+
variant: "secondary",
|
|
2625
|
+
disabled: !e.isClearButtonEnabled,
|
|
2626
|
+
onClick: e.clearFilter
|
|
2627
|
+
}, {
|
|
2628
|
+
default: y(() => [
|
|
2629
|
+
G(Z(e.t("clear")), 1)
|
|
2630
|
+
]),
|
|
2631
|
+
_: 1
|
|
2632
|
+
}, 8, ["disabled", "onClick"])
|
|
2633
|
+
])
|
|
2634
|
+
], 32)
|
|
2635
|
+
]),
|
|
2636
|
+
_: 1
|
|
2637
|
+
}, 8, ["is-open", "actions", "onCloseModal"])
|
|
2638
|
+
]);
|
|
2639
|
+
}
|
|
2640
|
+
const Sa = /* @__PURE__ */ ee(da, [["render", ha], ["__scopeId", "data-v-5fbd6554"]]), Ut = {
|
|
2641
|
+
"en-US": {
|
|
2642
|
+
clearFilters: "Clear filters",
|
|
2643
|
+
filtersHaveBeenCleared: "Filters have been cleared.",
|
|
2644
|
+
filtersHaveBeenReset: "Filters have been reset.",
|
|
2645
|
+
resetFilters: "Reset filters",
|
|
2646
|
+
searchBar: "Search bar",
|
|
2647
|
+
undo: "Undo"
|
|
2648
|
+
},
|
|
2649
|
+
"ja-JP": {
|
|
2650
|
+
clearFilters: "フィルターをクリア",
|
|
2651
|
+
filtersHaveBeenCleared: "フィルターをクリアしました",
|
|
2652
|
+
resetFilters: "フィルターのリセット",
|
|
2653
|
+
undo: "元に戻す"
|
|
2654
|
+
},
|
|
2655
|
+
"pt-BR": {
|
|
2656
|
+
clearFilters: "Limpar filtros",
|
|
2657
|
+
filtersHaveBeenCleared: "Os filtros foram apagados",
|
|
2658
|
+
resetFilters: "Redefinir filtros",
|
|
2659
|
+
undo: "Desfazer"
|
|
2660
|
+
}
|
|
2661
|
+
}, Ba = {
|
|
2662
|
+
key: 0,
|
|
2663
|
+
class: "b-filter-bar__search-external-container"
|
|
2664
|
+
}, Ca = { key: 0 }, _a = {
|
|
2665
|
+
i18n: { messages: Ut },
|
|
2666
|
+
name: "bento-filter-bar",
|
|
2667
|
+
components: {
|
|
2668
|
+
BentoBooleanFilter: $t,
|
|
2669
|
+
BentoDateFilter: ht,
|
|
2670
|
+
BentoDateRangeFilter: St,
|
|
2671
|
+
BentoInputFilter: Ft,
|
|
2672
|
+
BentoInputWithDropdownFilter: gt,
|
|
2673
|
+
BentoRangeFilter: Pt,
|
|
2674
|
+
BentoSelectAvatarFilter: _t,
|
|
2675
|
+
BentoSelectCountryFilter: Dt,
|
|
2676
|
+
BentoSelectCurrencyFilter: At,
|
|
2677
|
+
BentoSelectFilter: ge,
|
|
2678
|
+
BentoSelectPaymentMethodFilter: It,
|
|
2679
|
+
BentoSelectTagFilter: Tt,
|
|
2680
|
+
BentoTeleport: ft,
|
|
2681
|
+
FixedScroller: ut
|
|
2682
|
+
}
|
|
2683
|
+
}, Aa = /* @__PURE__ */ z({
|
|
2684
|
+
..._a,
|
|
2685
|
+
props: {
|
|
2686
|
+
config: { default: () => [] },
|
|
2687
|
+
filterValues: { default: () => [] },
|
|
2688
|
+
containerSizeLayout: { default: () => ({
|
|
2689
|
+
medium: "one-line",
|
|
2690
|
+
small: "multi-line"
|
|
2691
|
+
}) },
|
|
2692
|
+
search: { default: void 0 },
|
|
2693
|
+
searchTerm: { default: void 0 },
|
|
2694
|
+
showAppliedHiddenFilters: { type: Boolean, default: !1 },
|
|
2695
|
+
value: { default: () => [] }
|
|
2696
|
+
},
|
|
2697
|
+
emits: [
|
|
2698
|
+
_e.INPUT,
|
|
2699
|
+
_e.UPDATE_FILTER_VALUES,
|
|
2700
|
+
he.CLEAR,
|
|
2701
|
+
he.INPUT,
|
|
2702
|
+
he.UPDATE
|
|
2703
|
+
],
|
|
2704
|
+
setup(e, { expose: n, emit: t }) {
|
|
2705
|
+
const r = e, l = t, { t: a } = de({ messages: Ut }), i = M(null), s = c(
|
|
2706
|
+
() => {
|
|
2707
|
+
var B, S;
|
|
2708
|
+
return (S = ((B = r.config) == null ? void 0 : B.length) > 0 ? r.config : r.value) == null ? void 0 : S.map((o) => {
|
|
2709
|
+
var Y;
|
|
2710
|
+
let L = (Y = r.filterValues.find(({ field: m }) => m === o.field)) == null ? void 0 : Y.value;
|
|
2711
|
+
return L === void 0 && (L = (o == null ? void 0 : o.value) === void 0 && (o == null ? void 0 : o.defaultValue) !== void 0 ? o == null ? void 0 : o.defaultValue : o == null ? void 0 : o.value), { ...o, value: L !== void 0 ? L : o == null ? void 0 : o.value };
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
), { addToast: u } = Ot(), { screenLayoutComponent: p, showSearchbarInsideContainer: f, isOneLineLayout: h } = cl(
|
|
2715
|
+
i,
|
|
2716
|
+
x(r, "containerSizeLayout")
|
|
2717
|
+
), _ = c(() => ({
|
|
2718
|
+
"b-filter-bar__fixed-scroller": h.value,
|
|
2719
|
+
"b-filter-bar__container": !h.value
|
|
2720
|
+
// Multi-line
|
|
2721
|
+
})), d = c(() => ({
|
|
2722
|
+
"b-filter-bar__scroller-content": h.value,
|
|
2723
|
+
"b-filter-bar__filters": !h.value
|
|
2724
|
+
// Multi-line
|
|
2725
|
+
})), A = c(() => {
|
|
2726
|
+
var B;
|
|
2727
|
+
return ((B = r.search) == null ? void 0 : B.inputFieldAriaLabel) || a("searchBar");
|
|
2728
|
+
}), I = c(() => {
|
|
2729
|
+
if (!r.search)
|
|
2730
|
+
return;
|
|
2731
|
+
const { hint: B, inputFieldAriaLabel: S, debounceTime: o, placeholder: L } = r.search;
|
|
2732
|
+
return { hint: B, inputFieldAriaLabel: S, debounceTime: o, placeholder: L };
|
|
2733
|
+
}), T = c(() => s.value.some(
|
|
2734
|
+
({ visible: S }) => S != null
|
|
2735
|
+
) ? s.value.some(({ visible: S }) => !S) : !1), V = c(
|
|
2736
|
+
() => s.value.filter(({ defaultValue: B }) => B !== void 0)
|
|
2737
|
+
), w = c(() => s.value.some(
|
|
2738
|
+
({ visible: S }) => S != null
|
|
2739
|
+
) ? s.value.filter(
|
|
2740
|
+
({ defaultValue: S, visible: o, value: L }) => (
|
|
2741
|
+
// eslint-disable-next-line eqeqeq
|
|
2742
|
+
S === void 0 && o || r.showAppliedHiddenFilters && L != null
|
|
2743
|
+
)
|
|
2744
|
+
) : s.value.filter(
|
|
2745
|
+
({ defaultValue: S, value: o }) => (
|
|
2746
|
+
// eslint-disable-next-line eqeqeq
|
|
2747
|
+
S === void 0 || r.showAppliedHiddenFilters && o != null
|
|
2748
|
+
)
|
|
2749
|
+
)), U = c(() => r.searchTerm != null), F = c(
|
|
2750
|
+
() => s.value.filter(({ defaultValue: B }) => B == null).some(({ value: B }) => B != null)
|
|
2751
|
+
), R = c(() => V.value.length === 0 && F.value), k = c(() => V.value.length === 0 ? !1 : !s.value.filter(({ defaultValue: S }) => S !== void 0 || S !== null).every(({ value: S, defaultValue: o }) => JSON.stringify(S) === JSON.stringify(o)) || F.value), N = (B) => {
|
|
2752
|
+
l(_e.INPUT, B), l(
|
|
2753
|
+
_e.UPDATE_FILTER_VALUES,
|
|
2754
|
+
B == null ? void 0 : B.filter(({ value: S }) => S !== null || S !== void 0).map(({ field: S, value: o }) => ({ field: S, value: o }))
|
|
2755
|
+
);
|
|
2756
|
+
}, te = (B) => {
|
|
2757
|
+
const S = s.value.findIndex(
|
|
2758
|
+
(L) => L.field === B.field
|
|
2759
|
+
), o = s.value.slice();
|
|
2760
|
+
o[S].value = B.value, N(o);
|
|
2761
|
+
}, D = () => {
|
|
2762
|
+
const B = s.value.slice(), S = s.value.map(({ value: o, ...L }) => ({
|
|
2763
|
+
...L,
|
|
2764
|
+
value: void 0
|
|
2765
|
+
}));
|
|
2766
|
+
u({
|
|
2767
|
+
text: a("filtersHaveBeenCleared"),
|
|
2768
|
+
action: {
|
|
2769
|
+
handler: () => N(B),
|
|
2770
|
+
text: a("undo")
|
|
2771
|
+
}
|
|
2772
|
+
}), N(S);
|
|
2773
|
+
}, K = () => {
|
|
2774
|
+
const B = s.value.slice(), S = s.value.map(({ defaultValue: o, ...L }) => ({
|
|
2775
|
+
...L,
|
|
2776
|
+
defaultValue: o,
|
|
2777
|
+
value: o
|
|
2778
|
+
}));
|
|
2779
|
+
u({
|
|
2780
|
+
text: a("filtersHaveBeenReset"),
|
|
2781
|
+
action: {
|
|
2782
|
+
handler: () => N(B),
|
|
2783
|
+
text: a("undo")
|
|
2784
|
+
}
|
|
2785
|
+
}), N(S);
|
|
2786
|
+
}, q = (B) => {
|
|
2787
|
+
l(he.INPUT, B), l(he.UPDATE, B);
|
|
2788
|
+
}, X = () => {
|
|
2789
|
+
l(he.CLEAR);
|
|
2790
|
+
};
|
|
2791
|
+
return n({ isClearAllVisible: R, clearAllFilters: D, isResetAllVisible: k, resetAllFilters: K }), (B, S) => (v(), J("div", {
|
|
2792
|
+
ref_key: "filterBarRef",
|
|
2793
|
+
ref: i,
|
|
2794
|
+
class: "b-filter-bar"
|
|
2795
|
+
}, [
|
|
2796
|
+
!C(f) && U.value ? (v(), J("div", Ba, [
|
|
2797
|
+
$(C(Ue), oe({ class: "b-filter-bar__search-bar" }, I.value, {
|
|
2798
|
+
"input-field-aria-label": A.value,
|
|
2799
|
+
value: B.searchTerm,
|
|
2800
|
+
condensed: "",
|
|
2801
|
+
onInput: q,
|
|
2802
|
+
onClear: X
|
|
2803
|
+
}), null, 16, ["input-field-aria-label", "value"])
|
|
2804
|
+
])) : Q("", !0),
|
|
2805
|
+
(v(), E(Te(C(p)), {
|
|
2806
|
+
class: ie(_.value),
|
|
2807
|
+
condensed: ""
|
|
2808
|
+
}, {
|
|
2809
|
+
default: y(() => [
|
|
2810
|
+
j("div", {
|
|
2811
|
+
class: ie(d.value)
|
|
2812
|
+
}, [
|
|
2813
|
+
C(f) && U.value ? (v(), J("div", Ca, [
|
|
2814
|
+
$(C(Ue), oe({ class: "b-filter-bar__search-bar" }, I.value, {
|
|
2815
|
+
"input-field-aria-label": A.value,
|
|
2816
|
+
value: B.searchTerm,
|
|
2817
|
+
condensed: "",
|
|
2818
|
+
onInput: q,
|
|
2819
|
+
onClear: X
|
|
2820
|
+
}), null, 16, ["input-field-aria-label", "value"])
|
|
2821
|
+
])) : Q("", !0),
|
|
2822
|
+
V.value.length ? (v(!0), J(Ae, { key: 1 }, fe(V.value, (o) => (v(), E(Te(o.type), {
|
|
2823
|
+
key: o.field,
|
|
2824
|
+
field: o.field,
|
|
2825
|
+
label: o.label,
|
|
2826
|
+
disabled: o == null ? void 0 : o.disabled,
|
|
2827
|
+
options: o.options,
|
|
2828
|
+
value: o.value,
|
|
2829
|
+
"default-value": o.defaultValue,
|
|
2830
|
+
onUpdate: te
|
|
2831
|
+
}, null, 40, ["field", "label", "disabled", "options", "value", "default-value"]))), 128)) : Q("", !0),
|
|
2832
|
+
(v(!0), J(Ae, null, fe(w.value, (o) => (v(), E(Te(o.type), {
|
|
2833
|
+
key: o.field,
|
|
2834
|
+
field: o.field,
|
|
2835
|
+
label: o.label,
|
|
2836
|
+
disabled: o == null ? void 0 : o.disabled,
|
|
2837
|
+
options: o.options,
|
|
2838
|
+
value: o.value,
|
|
2839
|
+
onUpdate: te
|
|
2840
|
+
}, null, 40, ["field", "label", "disabled", "options", "value"]))), 128)),
|
|
2841
|
+
T.value ? (v(), E(Sa, {
|
|
2842
|
+
key: 2,
|
|
2843
|
+
class: "b-filter-bar__all-filters-modal",
|
|
2844
|
+
value: s.value,
|
|
2845
|
+
onInput: N
|
|
2846
|
+
}, null, 8, ["value"])) : Q("", !0),
|
|
2847
|
+
R.value ? (v(), E(C(Ee), {
|
|
2848
|
+
key: 3,
|
|
2849
|
+
class: "b-filter-bar__clear-all",
|
|
2850
|
+
onClick: D
|
|
2851
|
+
}, {
|
|
2852
|
+
iconLeft: y(() => [
|
|
2853
|
+
$(C(Ge), { "aria-hidden": "true" })
|
|
2854
|
+
]),
|
|
2855
|
+
default: y(() => [
|
|
2856
|
+
G(Z(C(a)("clearFilters")) + " ", 1)
|
|
2857
|
+
]),
|
|
2858
|
+
_: 1
|
|
2859
|
+
})) : Q("", !0),
|
|
2860
|
+
k.value ? (v(), E(C(Ee), {
|
|
2861
|
+
key: 4,
|
|
2862
|
+
class: "b-filter-bar__reset-all",
|
|
2863
|
+
onClick: K
|
|
2864
|
+
}, {
|
|
2865
|
+
iconLeft: y(() => [
|
|
2866
|
+
$(C(Ge), { "aria-hidden": "true" })
|
|
2867
|
+
]),
|
|
2868
|
+
default: y(() => [
|
|
2869
|
+
G(Z(C(a)("resetFilters")) + " ", 1)
|
|
2870
|
+
]),
|
|
2871
|
+
_: 1
|
|
2872
|
+
})) : Q("", !0)
|
|
2873
|
+
], 2)
|
|
2874
|
+
]),
|
|
2875
|
+
_: 1
|
|
2876
|
+
}, 8, ["class"]))
|
|
2877
|
+
], 512));
|
|
2878
|
+
}
|
|
2879
|
+
}), mn = /* @__PURE__ */ ee(Aa, [["__scopeId", "data-v-8336859c"]]);
|
|
2880
|
+
export {
|
|
2881
|
+
mn as B,
|
|
2882
|
+
g as a,
|
|
2883
|
+
_e as b,
|
|
2884
|
+
ne as c
|
|
2885
|
+
};
|
|
2886
|
+
//# sourceMappingURL=filter-bar.DfIcZ5dX.js.map
|