@adyen/bento-vue2 1.56.2 → 1.57.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 +20 -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/card.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -0
- package/dist/assets/sidepanel.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +7 -0
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +1 -0
- package/dist/chunks/{action-bar.c68S34TI.js → action-bar.nUvnRVwP.js} +6 -6
- package/dist/chunks/{action-bar.c68S34TI.js.map → action-bar.nUvnRVwP.js.map} +1 -1
- package/dist/chunks/{alert.D8qqrobi.js → alert.Du9NfW-V.js} +2 -2
- package/dist/chunks/{alert.D8qqrobi.js.map → alert.Du9NfW-V.js.map} +1 -1
- package/dist/chunks/{base-modal.B9JnRNty.js → base-modal.DdznUtgC.js} +20 -20
- package/dist/chunks/base-modal.DdznUtgC.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.DhPRdnSt.js → button-actions-with-menu.CDLJMdJh.js} +5 -5
- package/dist/chunks/{button-actions-with-menu.DhPRdnSt.js.map → button-actions-with-menu.CDLJMdJh.js.map} +1 -1
- package/dist/chunks/{button-actions.ZBlB7bp4.js → button-actions.DUn_iPDm.js} +2 -2
- package/dist/chunks/{button-actions.ZBlB7bp4.js.map → button-actions.DUn_iPDm.js.map} +1 -1
- package/dist/chunks/{button.D7K0uXQm.js → button.BuD-IsW5.js} +2 -2
- package/dist/chunks/{button.D7K0uXQm.js.map → button.BuD-IsW5.js.map} +1 -1
- package/dist/chunks/{calendar.CiLR27-B.js → calendar.C0iatn5N.js} +39 -42
- package/dist/chunks/{calendar.CiLR27-B.js.map → calendar.C0iatn5N.js.map} +1 -1
- package/dist/chunks/{card.CZkqwnNe.js → card.BYUqSnBy.js} +2 -2
- package/dist/chunks/{card.CZkqwnNe.js.map → card.BYUqSnBy.js.map} +1 -1
- package/dist/chunks/{checkbox-group.COqNevz5.js → checkbox-group.HhNN-r-o.js} +4 -4
- package/dist/chunks/{checkbox-group.COqNevz5.js.map → checkbox-group.HhNN-r-o.js.map} +1 -1
- package/dist/chunks/{checkbox-input.CMhyJDdo.js → checkbox-input.Dr1GS2BZ.js} +53 -45
- package/dist/chunks/checkbox-input.Dr1GS2BZ.js.map +1 -0
- package/dist/chunks/{checkbox.LFeWM5p4.js → checkbox.CkaV8-b-.js} +4 -4
- package/dist/chunks/{checkbox.LFeWM5p4.js.map → checkbox.CkaV8-b-.js.map} +1 -1
- package/dist/chunks/{code-snippet.p15Tfobh.js → code-snippet.B1_T5Y4d.js} +5 -5
- package/dist/chunks/{code-snippet.p15Tfobh.js.map → code-snippet.B1_T5Y4d.js.map} +1 -1
- package/dist/chunks/{controls-group.B-JUz-ir.js → controls-group.CG5RvOSi.js} +2 -2
- package/dist/chunks/{controls-group.B-JUz-ir.js.map → controls-group.CG5RvOSi.js.map} +1 -1
- package/dist/chunks/{copy.JmRKnqLo.js → copy.MTsLLiC0.js} +4 -4
- package/dist/chunks/{copy.JmRKnqLo.js.map → copy.MTsLLiC0.js.map} +1 -1
- package/dist/chunks/{dashboard-section.DJ39VLp3.js → dashboard-section.DYk4LVm8.js} +4 -4
- package/dist/chunks/{dashboard-section.DJ39VLp3.js.map → dashboard-section.DYk4LVm8.js.map} +1 -1
- package/dist/chunks/{dashed-underline.D29Z776j.js → dashed-underline.lDp966e8.js} +3 -3
- package/dist/chunks/{dashed-underline.D29Z776j.js.map → dashed-underline.lDp966e8.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BrgmYdx9.js → data-grid-template.Dcnw2_Du.js} +3 -3
- package/dist/chunks/{data-grid-template.BrgmYdx9.js.map → data-grid-template.Dcnw2_Du.js.map} +1 -1
- package/dist/chunks/{data-grid.CX58NCuD.js → data-grid.BNgBYl3r.js} +20 -20
- package/dist/chunks/{data-grid.CX58NCuD.js.map → data-grid.BNgBYl3r.js.map} +1 -1
- package/dist/chunks/{date-picker.2shSM0mi.js → date-picker.S8ABQaHP.js} +15 -15
- package/dist/chunks/{date-picker.2shSM0mi.js.map → date-picker.S8ABQaHP.js.map} +1 -1
- package/dist/chunks/{date-range-picker.hAWOq77C.js → date-range-picker.CQNhNKK-.js} +24 -24
- package/dist/chunks/{date-range-picker.hAWOq77C.js.map → date-range-picker.CQNhNKK-.js.map} +1 -1
- package/dist/chunks/dialog-page.uGh0kYDL.js +131 -0
- package/dist/chunks/dialog-page.uGh0kYDL.js.map +1 -0
- package/dist/chunks/{dropdown-tag.D_LJJSDW.js → dropdown-tag.BiJvxp5n.js} +3 -3
- package/dist/chunks/{dropdown-tag.D_LJJSDW.js.map → dropdown-tag.BiJvxp5n.js.map} +1 -1
- package/dist/chunks/{dropdown.DfnKDRBQ.js → dropdown.Qc6K5BzU.js} +19 -19
- package/dist/chunks/{dropdown.DfnKDRBQ.js.map → dropdown.Qc6K5BzU.js.map} +1 -1
- package/dist/chunks/{empty-state.Z97lmDoK.js → empty-state.IvvHHQ35.js} +2 -2
- package/dist/chunks/{empty-state.Z97lmDoK.js.map → empty-state.IvvHHQ35.js.map} +1 -1
- package/dist/chunks/{error-message.7bsic_sK.js → error-message.JskAm-Td.js} +8 -8
- package/dist/chunks/error-message.JskAm-Td.js.map +1 -0
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.DtiNK2cF.js → file-uploader.DhOTdtfm.js} +6 -6
- package/dist/chunks/{file-uploader.DtiNK2cF.js.map → file-uploader.DhOTdtfm.js.map} +1 -1
- package/dist/chunks/{filter-bar.C3MsA2SC.js → filter-bar.BFAsFxQo.js} +19 -19
- package/dist/chunks/{filter-bar.C3MsA2SC.js.map → filter-bar.BFAsFxQo.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.BJh4fxeV.js → fixed-scroller.D0a6q8_i.js} +2 -2
- package/dist/chunks/{fixed-scroller.BJh4fxeV.js.map → fixed-scroller.D0a6q8_i.js.map} +1 -1
- package/dist/chunks/{focus-trap.DEHn1dxN.js → focus-trap.DiqwA-bw.js} +2 -2
- package/dist/chunks/{focus-trap.DEHn1dxN.js.map → focus-trap.DiqwA-bw.js.map} +1 -1
- package/dist/chunks/{footer-actions.Blk5X8z1.js → footer-actions.CWOEDPKJ.js} +3 -3
- package/dist/chunks/{footer-actions.Blk5X8z1.js.map → footer-actions.CWOEDPKJ.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CbdwXVqj.js → form-layout-title.DBCY18f8.js} +2 -2
- package/dist/chunks/{form-layout-title.CbdwXVqj.js.map → form-layout-title.DBCY18f8.js.map} +1 -1
- package/dist/chunks/{header-with-views.DCmkDn7u.js → header-with-views.CO2aEwi4.js} +13 -13
- package/dist/chunks/{header-with-views.DCmkDn7u.js.map → header-with-views.CO2aEwi4.js.map} +1 -1
- package/dist/chunks/{header.DbB-XuIe.js → header.byOrhnHk.js} +4 -4
- package/dist/chunks/{header.DbB-XuIe.js.map → header.byOrhnHk.js.map} +1 -1
- package/dist/chunks/index.oJzeCMPe.js +529 -0
- package/dist/chunks/{index.48Mn1OCp.js.map → index.oJzeCMPe.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.CzP2P-pl.js → info-icon-with-popover.Cfng_pMj.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.CzP2P-pl.js.map → info-icon-with-popover.Cfng_pMj.js.map} +1 -1
- package/dist/chunks/{info-icon.Dn0FHy-U.js → info-icon.DgCYoVE3.js} +3 -3
- package/dist/chunks/{info-icon.Dn0FHy-U.js.map → info-icon.DgCYoVE3.js.map} +1 -1
- package/dist/chunks/{input-field-password.DwRXYgcD.js → input-field-password.D6PVCLoF.js} +7 -7
- package/dist/chunks/{input-field-password.DwRXYgcD.js.map → input-field-password.D6PVCLoF.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.DGNoMZfu.js → input-field-phone-number.Bg9XyY_1.js} +3 -3
- package/dist/chunks/{input-field-phone-number.DGNoMZfu.js.map → input-field-phone-number.Bg9XyY_1.js.map} +1 -1
- package/dist/chunks/{input-field.BdJBLLFI.js → input-field.DgUkNPXo.js} +3 -3
- package/dist/chunks/{input-field.BdJBLLFI.js.map → input-field.DgUkNPXo.js.map} +1 -1
- package/dist/chunks/inspector.types.Dab4xYKV.js +104 -0
- package/dist/chunks/inspector.types.Dab4xYKV.js.map +1 -0
- package/dist/chunks/{layout-row.DWRoI0dm.js → layout-row.c0ugsIw6.js} +2 -2
- package/dist/chunks/{layout-row.DWRoI0dm.js.map → layout-row.c0ugsIw6.js.map} +1 -1
- package/dist/chunks/{link.BH3eB_7E.js → link.D0P79Toh.js} +35 -28
- package/dist/chunks/link.D0P79Toh.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.BSQ8bM-O.js → listbox-option-tag.CBGk4m-_.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BSQ8bM-O.js.map → listbox-option-tag.CBGk4m-_.js.map} +1 -1
- package/dist/chunks/{menu.BKcBx2qB.js → menu.DZEDTBYV.js} +3 -3
- package/dist/chunks/{menu.BKcBx2qB.js.map → menu.DZEDTBYV.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BwVQfDn1.js → modal-fullscreen.DRQ4V5tT.js} +5 -5
- package/dist/chunks/{modal-fullscreen.BwVQfDn1.js.map → modal-fullscreen.DRQ4V5tT.js.map} +1 -1
- package/dist/chunks/{modal.BL-FWXsY.js → modal.DDF63uBR.js} +5 -5
- package/dist/chunks/{modal.BL-FWXsY.js.map → modal.DDF63uBR.js.map} +1 -1
- package/dist/chunks/{pagination.CX5fg6Ma.js → pagination.1PxOrSA9.js} +87 -104
- package/dist/chunks/pagination.1PxOrSA9.js.map +1 -0
- package/dist/chunks/{popover.Bb9JeZVy.js → popover.DXo3nXew.js} +4 -4
- package/dist/chunks/{popover.Bb9JeZVy.js.map → popover.DXo3nXew.js.map} +1 -1
- package/dist/chunks/{popper-container.DieshXa8.js → popper-container.1kHSxyxu.js} +2 -2
- package/dist/chunks/{popper-container.DieshXa8.js.map → popper-container.1kHSxyxu.js.map} +1 -1
- package/dist/chunks/{promo-banner.D5QXTiEH.js → promo-banner.BpLrkuMc.js} +3 -3
- package/dist/chunks/{promo-banner.D5QXTiEH.js.map → promo-banner.BpLrkuMc.js.map} +1 -1
- package/dist/chunks/{radio-group.BuKC_n23.js → radio-group.DtCgLBuL.js} +4 -4
- package/dist/chunks/{radio-group.BuKC_n23.js.map → radio-group.DtCgLBuL.js.map} +1 -1
- package/dist/chunks/{search-bar.C-_Ba3wd.js → search-bar.-Lpxv9sU.js} +3 -3
- package/dist/chunks/{search-bar.C-_Ba3wd.js.map → search-bar.-Lpxv9sU.js.map} +1 -1
- package/dist/chunks/{secondary-nav.uhESbxKZ.js → secondary-nav.DvTPsW8x.js} +3 -3
- package/dist/chunks/{secondary-nav.uhESbxKZ.js.map → secondary-nav.DvTPsW8x.js.map} +1 -1
- package/dist/chunks/{segmented-control.CCgCeLDQ.js → segmented-control.BQlmGv2x.js} +2 -2
- package/dist/chunks/{segmented-control.CCgCeLDQ.js.map → segmented-control.BQlmGv2x.js.map} +1 -1
- package/dist/chunks/{selection-card-group.Dj9wWfmY.js → selection-card-group.BniN7KWU.js} +5 -5
- package/dist/chunks/{selection-card-group.Dj9wWfmY.js.map → selection-card-group.BniN7KWU.js.map} +1 -1
- package/dist/chunks/{sidepanel.DMXzlqbw.js → sidepanel.DfQaLZEA.js} +5 -5
- package/dist/chunks/{sidepanel.DMXzlqbw.js.map → sidepanel.DfQaLZEA.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DZ1_vy5W.js → structured-list-item.xaedKywV.js} +5 -5
- package/dist/chunks/{structured-list-item.DZ1_vy5W.js.map → structured-list-item.xaedKywV.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.D-OotxnX.js → summary-grid.types.CNEeGgWh.js} +5 -5
- package/dist/chunks/{summary-grid.types.D-OotxnX.js.map → summary-grid.types.CNEeGgWh.js.map} +1 -1
- package/dist/chunks/{tabs.BfL4CUD1.js → tabs.DX_Gq12z.js} +2 -2
- package/dist/chunks/{tabs.BfL4CUD1.js.map → tabs.DX_Gq12z.js.map} +1 -1
- package/dist/chunks/{tag.C7ATWnRW.js → tag.C7kJJ5Ki.js} +2 -2
- package/dist/chunks/{tag.C7ATWnRW.js.map → tag.C7kJJ5Ki.js.map} +1 -1
- package/dist/chunks/{textarea.BkUzMu8d.js → textarea.CdA36VsY.js} +3 -3
- package/dist/chunks/{textarea.BkUzMu8d.js.map → textarea.CdA36VsY.js.map} +1 -1
- package/dist/chunks/{timeline-item.DcutETie.js → timeline-item.D87PFH_o.js} +7 -7
- package/dist/chunks/{timeline-item.DcutETie.js.map → timeline-item.D87PFH_o.js.map} +1 -1
- package/dist/chunks/{toast.BV0qP2AF.js → toast.B2u2W_TQ.js} +2 -2
- package/dist/chunks/{toast.BV0qP2AF.js.map → toast.B2u2W_TQ.js.map} +1 -1
- package/dist/chunks/{toggle-button.TDry-9iu.js → toggle-button.ChDbeBZ8.js} +2 -2
- package/dist/chunks/{toggle-button.TDry-9iu.js.map → toggle-button.ChDbeBZ8.js.map} +1 -1
- package/dist/chunks/{tooltip.CfER_5In.js → tooltip.8KbMqaXP.js} +5 -3
- package/dist/chunks/{tooltip.CfER_5In.js.map → tooltip.8KbMqaXP.js.map} +1 -1
- package/dist/chunks/{tutorial.AOMH-Jq3.js → tutorial.D74hJVBb.js} +5 -5
- package/dist/chunks/{tutorial.AOMH-Jq3.js.map → tutorial.D74hJVBb.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.KPoAaRPS.js → use-cached-selected-values.CSVs_E5A.js} +4 -4
- package/dist/chunks/{use-cached-selected-values.KPoAaRPS.js.map → use-cached-selected-values.CSVs_E5A.js.map} +1 -1
- package/dist/code-snippet.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/dropdown.js +3 -3
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.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/info-icon.js +1 -1
- 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 +12 -12
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- 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/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +6203 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +22 -1
- package/dist/styles/bento-light.css +22 -1
- package/dist/styles/bento.css +22 -1
- package/dist/styles/legacy.css +22 -1
- package/dist/styles/styleguide.css +22 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.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 +254 -11
- package/package.json +16 -5
- package/dist/chunks/base-modal.B9JnRNty.js.map +0 -1
- package/dist/chunks/checkbox-input.CMhyJDdo.js.map +0 -1
- package/dist/chunks/dialog-page.BveDXzz1.js +0 -130
- package/dist/chunks/dialog-page.BveDXzz1.js.map +0 -1
- package/dist/chunks/error-message.7bsic_sK.js.map +0 -1
- package/dist/chunks/index.48Mn1OCp.js +0 -387
- package/dist/chunks/inspector.types.Cloa1Rnz.js +0 -105
- package/dist/chunks/inspector.types.Cloa1Rnz.js.map +0 -1
- package/dist/chunks/link.BH3eB_7E.js.map +0 -1
- package/dist/chunks/pagination.CX5fg6Ma.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions-with-menu.DhPRdnSt.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, Ref, ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: number;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref<number>(defaultActionsCount);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount) {\n displayedActionsCount.value += 1;\n\n showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoPopoverPositions } from '@/components/popover';\n import { computed, PropType, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n *\n * @see {@link BentoButtonActionsLayout}\n *\n */\n actionsLayout: {\n type: String as PropType<`${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n disableResponsiveBehavior: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The min-width breakpoint to hide the button actions.\n *\n * For example, a value of 200 means that buttons will be hidden at <= 200px.\n *\n * Defaults to 0 i.e. it shows all buttons.\n */\n hideDisplayedActionsBreakpoint: {\n type: Number,\n default: 0,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: props.displayedActions,\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_END,\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_START,\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() =>\n displayedActionsCount.value !== undefined && displayedActionsCount.value < props.actions.length\n ? (props.actions.slice(displayedActionsCount.value, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","_a","hideActions","watch","newWidth","containerEl","oldWidth","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","BentoButtonActionsLayout","computedMenuActions","el"],"mappings":";;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,CAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA,KAAAL;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,MACII,EAAA,SAAA,GAEAG,EAAA;AAAA,EACJ,GAGJK,IAAA,YAAA;;AACI,UAAAJ,EAAA;AAEA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cAAAC,EAAA,CAAA;AAGJ,UAAAQ,IAAAN,EAAA,OAAA;AAAA,MAA2C,8DAAA3B,EAAA,kBAAAkC,EAAA;AAAA,MAEc,gEAAAlC,EAAA,kBAAAkC,EAAA;AAAA,MAEA,kEAAAT,EAAA;AAAA,IAC4B,EAAA,GAGrFU,IAAAR;AAAA,MAA4B,MAAApB,EAAA,UAAA,UAAAA,EAAA,QAAAP,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAoC,OAAA;AAAA,QAEiE,MAAAA,EAAA;AAAA,QACtE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"button-actions-with-menu.CDLJMdJh.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, Ref, ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: number;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref<number>(defaultActionsCount);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount) {\n displayedActionsCount.value += 1;\n\n showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoPopoverPositions } from '@/components/popover';\n import { computed, PropType, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n *\n * @see {@link BentoButtonActionsLayout}\n *\n */\n actionsLayout: {\n type: String as PropType<`${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n disableResponsiveBehavior: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The min-width breakpoint to hide the button actions.\n *\n * For example, a value of 200 means that buttons will be hidden at <= 200px.\n *\n * Defaults to 0 i.e. it shows all buttons.\n */\n hideDisplayedActionsBreakpoint: {\n type: Number,\n default: 0,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: props.displayedActions,\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_END,\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_START,\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() =>\n displayedActionsCount.value !== undefined && displayedActionsCount.value < props.actions.length\n ? (props.actions.slice(displayedActionsCount.value, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","_a","hideActions","watch","newWidth","containerEl","oldWidth","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","BentoButtonActionsLayout","computedMenuActions","el"],"mappings":";;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,CAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA,KAAAL;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,MACII,EAAA,SAAA,GAEAG,EAAA;AAAA,EACJ,GAGJK,IAAA,YAAA;;AACI,UAAAJ,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA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,gEAAAlC,EAAA,kBAAAkC,EAAA;AAAA,MAEA,kEAAAT,EAAA;AAAA,IAC4B,EAAA,GAGrFU,IAAAR;AAAA,MAA4B,MAAApB,EAAA,UAAA,UAAAA,EAAA,QAAAP,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAoC,OAAA;AAAA,QAEiE,MAAAA,EAAA;AAAA,QACtE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as y, useSlots as h, computed as u, ref as p, inject as E, watch as N, nextTick as L, onMounted as O, onUnmounted as b } from "vue";
|
|
2
|
-
import { B as l } from "./button.
|
|
2
|
+
import { B as l } from "./button.BuD-IsW5.js";
|
|
3
3
|
import { o as R } from "./resize.Bqks3WUm.js";
|
|
4
4
|
import { f as x } from "./es6.BtaxuP0b.js";
|
|
5
5
|
import { B as U } from "./loading-indicator.z8COalOc.js";
|
|
@@ -191,4 +191,4 @@ export {
|
|
|
191
191
|
i as e,
|
|
192
192
|
J as f
|
|
193
193
|
};
|
|
194
|
-
//# sourceMappingURL=button-actions.
|
|
194
|
+
//# sourceMappingURL=button-actions.DUn_iPDm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions.ZBlB7bp4.js","sources":["../../../core/src/components/button-actions/button-actions.types.ts","../../../core/src/components/loading-button/loading-button.types.ts","../../src/components/button/components/loading-button/loading-button.vue","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.ts","../../src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.ts","../../src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { BentoButtonProps } from '@/core/components/button/button.types';\nimport { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n\nexport interface BentoButtonActionObject<IconType = object> extends BentoButtonProps {\n title: string;\n event?: (event: Event) => void;\n icon?: IconType;\n iconLeft?: IconType;\n iconRight?: IconType;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n iconOnly?: boolean;\n}\n\nexport type BentoButtonActionsList<IconType = object> = Array<BentoButtonActionObject<IconType>>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <bento-button\n :critical=\"isCritical\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n class=\"b-loading-button\"\n :class=\"conditionalClasses\"\n @click.capture.stop=\"onClick\"\n >\n <slot></slot>\n\n <template v-if=\"state === 'start' && hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\"></slot>\n </template>\n <template v-else-if=\"state !== 'start'\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === 'fail'\" :svg-title=\"t('failed')\" />\n <checkmark v-else-if=\"state === 'success'\" :svg-title=\"t('succeded')\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator v-else-if=\"state === 'loading'\" small :inverse=\"isInverseLoadingIndicator\" />\n </span>\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useSlots } from 'vue';\n import { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Displays loading-button as critical\n */\n critical: {\n type: BentoButton.props.critical.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState | `${BentoLoadingButtonState}`>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n });\n\n const emit = defineEmits([\"click\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n 'b-loading-button--loading': props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n [`b-loading-button--inverse`]: props.inverse,\n }));\n\n const isInverseLoadingIndicator = computed(\n () => (props.variant === 'primary' && !props.inverse) || (props.variant !== 'primary' && props.inverse)\n );\n const isCritical = computed(\n () =>\n (props.critical && props.state === BentoLoadingButtonState.START) ||\n props.state === BentoLoadingButtonState.FAIL\n );\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click', e);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Loading Button component is used for cases where pressing a button starts an event that requires a loading state, e.g. when you have any sort of asynchronous action and are waiting for a response\n *\n * @example\n * import { BentoLoadingButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLoadingButton },\n * template: `\n * <bento-loading-button state=\"loading\" variant=\"secondary\">\n * Loading\n * </bento-loading button>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/loading-button/loading-button.scss\" />\n","export const BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY = Symbol(\n 'button actions with menu container injection key'\n);\n","import { computed, inject, nextTick, onMounted, onUnmounted, ref, Ref, watch } from 'vue';\nimport { observeSizeOfElement } from '@/utils/ts/resize';\nimport { BButtonActionsButtonsEndColumnGap } from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { BentoButtonActionsList } from '../../button-actions.types';\nimport { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from '@/internal/button-actions-with-menu/button-actions-with-menu.keys';\n\nconst CONTAINER_QUERY = 242;\nconst BUTTONS_GAP = parseInt(BButtonActionsButtonsEndColumnGap, 10);\n\n/**\n * Calculates the width of the container and the buttons and decides if the buttons should be stacked or not\n *\n * @param buttonActions Reference to the container element\n * @param buttons Reference array of button elements\n * @param actions Button actions actions prop\n */\nexport const useStackButtons = (\n buttonActions: Ref<HTMLDivElement>,\n buttons: Ref<HTMLDivElement[]>,\n actions: BentoButtonActionsList\n) => {\n const originalButtonsWidth = ref(0);\n let containerObserver: ResizeObserver | null = null;\n\n const { buttonActionsWithMenu, menu, stackButtons } = inject(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, {\n buttonActionsWithMenu: ref(null),\n menu: ref(null),\n stackButtons: ref(false),\n });\n\n const container = computed(() => buttonActionsWithMenu.value ?? buttonActions.value);\n\n const computedButtons = computed(() => (menu.value ? [...buttons.value, menu.value.$el] : buttons.value));\n\n const areButtonsWiderThanContainer = (updateOriginalButtonsWidth?: boolean) => {\n const buttonsWidth = computedButtons.value?.reduce(\n (acc, button) => acc + button.clientWidth + BUTTONS_GAP,\n -BUTTONS_GAP - 1 // to remove the extra spacing, as if there's 3 buttons, only two will have a gap in between\n );\n\n const containersWidth = container.value.clientWidth;\n\n if (updateOriginalButtonsWidth) {\n originalButtonsWidth.value = containersWidth >= CONTAINER_QUERY && !stackButtons.value ? buttonsWidth : 0;\n }\n return originalButtonsWidth.value > containersWidth;\n };\n\n watch(\n () => actions,\n () => {\n nextTick(() => {\n stackButtons.value = areButtonsWiderThanContainer(true);\n });\n },\n { deep: true }\n );\n\n onMounted(() => {\n containerObserver = observeSizeOfElement(container.value, () => {\n stackButtons.value = areButtonsWiderThanContainer(originalButtonsWidth.value === 0);\n });\n });\n\n onUnmounted(() => {\n containerObserver?.disconnect();\n });\n\n return stackButtons;\n};\n","<template>\n <div ref=\"buttonActions\" class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div\n v-for=\"(button, index) in reversedActionsList\"\n :key=\"index\"\n ref=\"buttons\"\n class=\"b-button-actions__button-wrapper\"\n >\n <bento-loading-button\n v-if=\"button.state\"\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :state=\"button.state\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :link=\"button.link\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n <template v-if=\"button.icon || button.iconLeft\" #iconLeft>\n <component :is=\"button.icon || button.iconLeft\" :svg-title=\"button.title\"></component>\n </template>\n <template v-if=\"!isIconOnly(button)\" #default>\n {{ button.title }}\n </template>\n <template v-if=\"button.iconRight\" #iconRight>\n <component :is=\"button.iconRight\" :svg-title=\"button.title\"></component>\n </template>\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import BentoButton from '../../button.vue';\n import {\n BentoButtonActionObject,\n BentoButtonActionsLayout,\n } from '@/core/components/button-actions/button-actions.types';\n import type { BentoButtonActionsProps } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n import { useStackButtons } from '@/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons';\n\n const props = defineProps({\n actions: null,\n inverse: { type: Boolean, default: false },\n layout: { default: BentoButtonActionsLayout.BUTTONS_END }\n});\n\n const buttonActions = ref<HTMLDivElement>(null);\n const buttons = ref<HTMLDivElement[]>(null);\n const stackButtons = useStackButtons(buttonActions, buttons, props.actions);\n\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? 'primary' : 'secondary';\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n [`b-button-actions--stacked-buttons`]: stackButtons.value,\n }));\n\n const generateButtonEvents = (button: BentoButtonActionObject) =>\n button?.event !== undefined\n ? {\n click: button.event,\n }\n : {};\n\n const isIconOnly = (button: BentoButtonActionObject) =>\n button.iconOnly && (button.iconLeft || button.iconRight || button.icon);\n</script>\n\n<script lang=\"ts\">\n /**\n * ButtonActions component manages a set of actions a user can choose from by displaying a group of buttons.\n *\n * @example\n * import { BentoButtonActions } from '@adyen/bento-vue2';\n * import MachineLearningIcon from '@adyen/ui-assets-icons-16/vue/machine-learning';\n *\n * const clickedAction = () => { //your action here }\n *\n * <template>\n * <bento-button-actions\n * :actions=\"[{\n * title: 'Primary',\n * event: clickedAction,\n * icon: MachineLearningIcon,\n * }, {\n * title: 'Secondary',\n * event: clickedAction,\n * }, {\n * title: 'Tertiary',\n * event: clickedAction,\n * }]\"\n * />\n * </template>\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button-actions/button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","BentoLoadingButtonState","BentoLoadingButtonState2","__default__$1","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","props","isInverseLoadingIndicator","isCritical","e","emit","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","CONTAINER_QUERY","BUTTONS_GAP","BButtonActionsButtonsEndColumnGap","useStackButtons","buttonActions","buttons","actions","originalButtonsWidth","ref","containerObserver","buttonActionsWithMenu","menu","stackButtons","inject","container","computedButtons","areButtonsWiderThanContainer","updateOriginalButtonsWidth","buttonsWidth","_a","acc","button","containersWidth","watch","nextTick","onMounted","observeSizeOfElement","onUnmounted","__default__","reversedActionsList","generateButtonVariantByIndex","actionIndex","lastActionIndex"],"mappings":";;;;;;;;;;;AAeY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA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AAA,IAAA,GACAI,IAAAT,EAAAC,GAAAC,GAAAX,EAAA,OAAA,GAEAmC,IAAApC,EAAA,MAAAC,EAAA,QAAA,MAAA,EAAA,QAAA,CAAA,GACAoC,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAtC,EAAA,QAAA,SAAA;AACA,aAAAqC,MAAAC,IAAA,YAAA;AAAA,IAAqD,GAGzDxC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAC,EAAA,MAAA,EAAA,GAAA;AAAA,MACA,qCAAAkB,EAAA;AAAA,IACa,EAAA;uLAGxD,CAAAS,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA,eAI5B,CAAAA,MAAAA,EAAA,aAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"button-actions.DUn_iPDm.js","sources":["../../../core/src/components/button-actions/button-actions.types.ts","../../../core/src/components/loading-button/loading-button.types.ts","../../src/components/button/components/loading-button/loading-button.vue","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.ts","../../src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.ts","../../src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { BentoButtonProps } from '@/core/components/button/button.types';\nimport { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n\nexport interface BentoButtonActionObject<IconType = object> extends BentoButtonProps {\n title: string;\n event?: (event: Event) => void;\n icon?: IconType;\n iconLeft?: IconType;\n iconRight?: IconType;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n iconOnly?: boolean;\n}\n\nexport type BentoButtonActionsList<IconType = object> = Array<BentoButtonActionObject<IconType>>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <bento-button\n :critical=\"isCritical\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n class=\"b-loading-button\"\n :class=\"conditionalClasses\"\n @click.capture.stop=\"onClick\"\n >\n <slot></slot>\n\n <template v-if=\"state === 'start' && hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\"></slot>\n </template>\n <template v-else-if=\"state !== 'start'\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === 'fail'\" :svg-title=\"t('failed')\" />\n <checkmark v-else-if=\"state === 'success'\" :svg-title=\"t('succeded')\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator v-else-if=\"state === 'loading'\" small :inverse=\"isInverseLoadingIndicator\" />\n </span>\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useSlots } from 'vue';\n import { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Displays loading-button as critical\n */\n critical: {\n type: BentoButton.props.critical.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState | `${BentoLoadingButtonState}`>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n });\n\n const emit = defineEmits([\"click\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n 'b-loading-button--loading': props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n [`b-loading-button--inverse`]: props.inverse,\n }));\n\n const isInverseLoadingIndicator = computed(\n () => (props.variant === 'primary' && !props.inverse) || (props.variant !== 'primary' && props.inverse)\n );\n const isCritical = computed(\n () =>\n (props.critical && props.state === BentoLoadingButtonState.START) ||\n props.state === BentoLoadingButtonState.FAIL\n );\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click', e);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Loading Button component is used for cases where pressing a button starts an event that requires a loading state, e.g. when you have any sort of asynchronous action and are waiting for a response\n *\n * @example\n * import { BentoLoadingButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLoadingButton },\n * template: `\n * <bento-loading-button state=\"loading\" variant=\"secondary\">\n * Loading\n * </bento-loading button>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/loading-button/loading-button.scss\" />\n","export const BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY = Symbol(\n 'button actions with menu container injection key'\n);\n","import { computed, inject, nextTick, onMounted, onUnmounted, ref, Ref, watch } from 'vue';\nimport { observeSizeOfElement } from '@/utils/ts/resize';\nimport { BButtonActionsButtonsEndColumnGap } from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { BentoButtonActionsList } from '../../button-actions.types';\nimport { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from '@/internal/button-actions-with-menu/button-actions-with-menu.keys';\n\nconst CONTAINER_QUERY = 242;\nconst BUTTONS_GAP = parseInt(BButtonActionsButtonsEndColumnGap, 10);\n\n/**\n * Calculates the width of the container and the buttons and decides if the buttons should be stacked or not\n *\n * @param buttonActions Reference to the container element\n * @param buttons Reference array of button elements\n * @param actions Button actions actions prop\n */\nexport const useStackButtons = (\n buttonActions: Ref<HTMLDivElement>,\n buttons: Ref<HTMLDivElement[]>,\n actions: BentoButtonActionsList\n) => {\n const originalButtonsWidth = ref(0);\n let containerObserver: ResizeObserver | null = null;\n\n const { buttonActionsWithMenu, menu, stackButtons } = inject(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, {\n buttonActionsWithMenu: ref(null),\n menu: ref(null),\n stackButtons: ref(false),\n });\n\n const container = computed(() => buttonActionsWithMenu.value ?? buttonActions.value);\n\n const computedButtons = computed(() => (menu.value ? [...buttons.value, menu.value.$el] : buttons.value));\n\n const areButtonsWiderThanContainer = (updateOriginalButtonsWidth?: boolean) => {\n const buttonsWidth = computedButtons.value?.reduce(\n (acc, button) => acc + button.clientWidth + BUTTONS_GAP,\n -BUTTONS_GAP - 1 // to remove the extra spacing, as if there's 3 buttons, only two will have a gap in between\n );\n\n const containersWidth = container.value.clientWidth;\n\n if (updateOriginalButtonsWidth) {\n originalButtonsWidth.value = containersWidth >= CONTAINER_QUERY && !stackButtons.value ? buttonsWidth : 0;\n }\n return originalButtonsWidth.value > containersWidth;\n };\n\n watch(\n () => actions,\n () => {\n nextTick(() => {\n stackButtons.value = areButtonsWiderThanContainer(true);\n });\n },\n { deep: true }\n );\n\n onMounted(() => {\n containerObserver = observeSizeOfElement(container.value, () => {\n stackButtons.value = areButtonsWiderThanContainer(originalButtonsWidth.value === 0);\n });\n });\n\n onUnmounted(() => {\n containerObserver?.disconnect();\n });\n\n return stackButtons;\n};\n","<template>\n <div ref=\"buttonActions\" class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div\n v-for=\"(button, index) in reversedActionsList\"\n :key=\"index\"\n ref=\"buttons\"\n class=\"b-button-actions__button-wrapper\"\n >\n <bento-loading-button\n v-if=\"button.state\"\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :state=\"button.state\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :link=\"button.link\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n <template v-if=\"button.icon || button.iconLeft\" #iconLeft>\n <component :is=\"button.icon || button.iconLeft\" :svg-title=\"button.title\"></component>\n </template>\n <template v-if=\"!isIconOnly(button)\" #default>\n {{ button.title }}\n </template>\n <template v-if=\"button.iconRight\" #iconRight>\n <component :is=\"button.iconRight\" :svg-title=\"button.title\"></component>\n </template>\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import BentoButton from '../../button.vue';\n import {\n BentoButtonActionObject,\n BentoButtonActionsLayout,\n } from '@/core/components/button-actions/button-actions.types';\n import type { BentoButtonActionsProps } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n import { useStackButtons } from '@/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons';\n\n const props = defineProps({\n actions: null,\n inverse: { type: Boolean, default: false },\n layout: { default: BentoButtonActionsLayout.BUTTONS_END }\n});\n\n const buttonActions = ref<HTMLDivElement>(null);\n const buttons = ref<HTMLDivElement[]>(null);\n const stackButtons = useStackButtons(buttonActions, buttons, props.actions);\n\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? 'primary' : 'secondary';\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n [`b-button-actions--stacked-buttons`]: stackButtons.value,\n }));\n\n const generateButtonEvents = (button: BentoButtonActionObject) =>\n button?.event !== undefined\n ? {\n click: button.event,\n }\n : {};\n\n const isIconOnly = (button: BentoButtonActionObject) =>\n button.iconOnly && (button.iconLeft || button.iconRight || button.icon);\n</script>\n\n<script lang=\"ts\">\n /**\n * ButtonActions component manages a set of actions a user can choose from by displaying a group of buttons.\n *\n * @example\n * import { BentoButtonActions } from '@adyen/bento-vue2';\n * import MachineLearningIcon from '@adyen/ui-assets-icons-16/vue/machine-learning';\n *\n * const clickedAction = () => { //your action here }\n *\n * <template>\n * <bento-button-actions\n * :actions=\"[{\n * title: 'Primary',\n * event: clickedAction,\n * icon: MachineLearningIcon,\n * }, {\n * title: 'Secondary',\n * event: clickedAction,\n * }, {\n * title: 'Tertiary',\n * event: clickedAction,\n * }]\"\n * />\n * </template>\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button-actions/button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","BentoLoadingButtonState","BentoLoadingButtonState2","__default__$1","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","props","isInverseLoadingIndicator","isCritical","e","emit","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","CONTAINER_QUERY","BUTTONS_GAP","BButtonActionsButtonsEndColumnGap","useStackButtons","buttonActions","buttons","actions","originalButtonsWidth","ref","containerObserver","buttonActionsWithMenu","menu","stackButtons","inject","container","computedButtons","areButtonsWiderThanContainer","updateOriginalButtonsWidth","buttonsWidth","_a","acc","button","containersWidth","watch","nextTick","onMounted","observeSizeOfElement","onUnmounted","__default__","reversedActionsList","generateButtonVariantByIndex","actionIndex","lastActionIndex"],"mappings":";;;;;;;;;;;AAeY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA,IAAAD,KAAA,CAAA,CAAA;AAOL,MAAAE,IAAA,EAAA,GAAAJ,GAAA,GAAAE,EAAA;AC5BK,IAAAG,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;GCiJRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlDAC,IAAAC,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xD,CAAAS,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA,eAI5B,CAAAA,MAAAA,EAAA,aAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as y, useAttrs as m, useSlots as v, computed as i } from "vue";
|
|
2
2
|
import { B as S } from "./typography.J1v_SPG3.js";
|
|
3
3
|
import { u as g } from "./use-has-slot.C9lQZ6nz.js";
|
|
4
|
-
import { B as C, a as E } from "./link.
|
|
4
|
+
import { B as C, a as E } from "./link.D0P79Toh.js";
|
|
5
5
|
import { n as h } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "../assets/button.css";
|
|
7
7
|
var r = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.TERTIARY = "tertiary", e.TERTIARY_WITH_BACKGROUND = "tertiary-with-background", e))(r || {}), s = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DESTRUCTIVE = "critical", e.DISABLED = "disabled", e.ICON_ONLY = "icon-only", e.INVERSE = "inverse", e))(s || {});
|
|
@@ -96,4 +96,4 @@ export {
|
|
|
96
96
|
r as a,
|
|
97
97
|
s as b
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=button.
|
|
99
|
+
//# sourceMappingURL=button.BuD-IsW5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.
|
|
1
|
+
{"version":3,"file":"button.BuD-IsW5.js","sources":["../../../core/src/components/button/button.types.ts","../../src/components/button/button.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n TERTIARY = 'tertiary',\n TERTIARY_WITH_BACKGROUND = 'tertiary-with-background',\n}\n\nexport enum BentoButtonPropClass {\n CONDENSED = 'condensed',\n DESTRUCTIVE = 'critical',\n DISABLED = 'disabled',\n ICON_ONLY = 'icon-only',\n INVERSE = 'inverse',\n}\n\nexport interface BentoButtonProps {\n condensed?: boolean;\n critical?: boolean;\n disabled?: boolean;\n inverse?: boolean;\n variant?: BentoButtonVariant | `${BentoButtonVariant}`;\n type?: string;\n link?: object;\n}\n","<template>\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-button\"\n :class=\"{ ...conditionalClasses, ...getIconOnlyClass() }\"\n @click.capture=\"onClickButton\"\n >\n <span\n v-if=\"hasSlot('iconLeft')\"\n class=\"b-button__icon-left\"\n data-testid=\"icon-button-left\"\n :aria-hidden=\"hasSlot('default') ? 'true' : null\"\n >\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-button__label\">\n <slot />\n </bento-typography>\n <span\n v-if=\"hasSlot('iconRight')\"\n class=\"b-button__icon-right\"\n data-testid=\"icon-button-right\"\n :aria-hidden=\"hasSlot('default') ? 'true' : null\"\n >\n <slot name=\"iconRight\" />\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useAttrs, useSlots } from 'vue';\n import { BentoButtonPropClass, BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { Booleanish } from '@/types/prop-types';\n import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue/types/jsx.d.ts';\n import { BentoLink, BentoLinkVariant } from '@/components/link';\n\n // TODO: replace all this code when migrated to Vue 3 is complete as this is the only\n // current way to extend the `router-link` component in Vue 2 and Vue Router 3\n export interface LinkProps extends RouterLinkProps, AnchorHTMLAttributes {\n args?: { props: RouterLinkProps };\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external: boolean;\n }\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Displays button as critical\n */\n critical: { type: Boolean, default: false },\n\n /**\n * Disables button functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Sets color set to inverse\n */\n inverse: { type: Boolean, default: false },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: { type: Object, default: undefined },\n\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary, tertiary-with-background\n */\n variant: {\n type: String as PropType<BentoButtonVariant | `${BentoButtonVariant}`>,\n default: BentoButtonVariant.PRIMARY,\n validator: (value: BentoButtonVariant) => Object.values(BentoButtonVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"blur\", \"click\", \"focus\", \"keydown.esc\"]);\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => {\n if (props?.link !== undefined) {\n return BentoLink;\n }\n return 'button';\n });\n const ariaAttributes = computed(() => ({\n 'aria-controls': attrs['aria-controls']?.toString() as string,\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const componentProps = computed(() =>\n componentType.value === 'button'\n ? {\n ...ariaAttributes.value,\n disabled: props.disabled,\n type: props.type,\n }\n : { ...props.link, disableTypography: true, variant: BentoLinkVariant.DEFAULT, isButton: true }\n );\n\n const variantClass = computed(() => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(() => ({\n ...variantClass.value,\n [`b-button--${BentoButtonPropClass.CONDENSED}`]: props.condensed,\n [`b-button--${BentoButtonPropClass.DISABLED}`]: props.disabled,\n [`b-button--${BentoButtonPropClass.INVERSE}`]: props.inverse,\n }));\n\n const getIconOnlyClass = () => ({\n [`b-button--${BentoButtonPropClass.ICON_ONLY}`]: !hasSlot('default'),\n });\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Button component for all the various types of bento buttons.\n *\n * @example\n * import { BentoButton } from '@adyen/bento-vue2';\n * import { CheckMarkIcon } from '@adyen/ui-assets-icons-16';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * variant=\"secondary\"\n * >\n * <template #iconLeft>\n * <check-mark svg-title=\"checked\" />\n * </template>\n *\n * Button text\n *\n * <template #iconRight>\n * <check-mark svg-title=\"checked\" />\n * </template>\n * </bento-button>\n * `,\n * }\n */\n export default {\n name: 'bento-button',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","__default__","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","componentType","computed","props","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","e","emit"],"mappings":";;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,2BAAA,4BAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,cAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WALQA,IAAAD,KAAA,CAAA,CAAA;ACuKR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAhFAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,OACIC,KAAA,gBAAAA,EAAA,UAAA,SACIC,IAEJ,QAAO,GAEXC,IAAAH,EAAA,MAAA;;AAAA;AAAA,QAAuC,kBAAAI,IAAAX,EAAA,eAAA,MAAA,gBAAAW,EAAA;AAAA,QACe,kBAAAC,IAAAZ,EAAA,eAAA,MAAA,gBAAAY,EAAA;AAAA,MACA;AAAA,KAAA,GAGtDC,IAAAN;AAAA,MAAuB,MAAAD,EAAA,UAAA,WAAA;AAAA,QAEb,GAAAI,EAAA;AAAA,QACsB,UAAAF,EAAA;AAAA,QACF,MAAAA,EAAA;AAAA,MACJ,IAAA,EAAA,GAAAA,EAAA,MAAA,mBAAA,IAAA,SAAAM,EAAA,SAAA,UAAA,GAAA;AAAA,IAE4E,GAGtGC,IAAAR,EAAA,OAAA;AAAA,MAAqC,CAAA,aAAAC,EAAA,OAAA,GAAAA,EAAA,WAAA,IAAAX,EAAA,WAAA,KAAA,EAAA,EAAA,GAAA;AAAA,IAC8D,EAAA,GAGnGmB,IAAAT,EAAA,OAAA;AAAA,MAA2C,GAAAQ,EAAA;AAAA,MACvB,CAAA,aAAAlB,EAAA,SAAA,EAAA,GAAAW,EAAA;AAAA,MACuC,CAAA,aAAAX,EAAA,QAAA,EAAA,GAAAW,EAAA;AAAA,MACD,CAAA,aAAAX,EAAA,OAAA,EAAA,GAAAW,EAAA;AAAA,IACD,EAAA;6LAGzD,OAAA;AAAA,MAAgC,CAAA,aAAAX,EAAA,SAAA,EAAA,GAAA,CAAAO,EAAA,SAAA;AAAA,IACuC,mBAGvE,CAAAa,MAAA;AACI,MAAAT,EAAA,YAGIS,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAC,EAAA,SAAAD,CAAA;AAAA,IAIJ;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,13 +2,14 @@ import { defineComponent as te, computed as S, ref as $, watch as q, nextTick as
|
|
|
2
2
|
import { r as O, t as k, a as ge, g as $e } from "./get-date-locale.BN8xEjY0.js";
|
|
3
3
|
import { t as w, B as Te, a as Ie, f as be } from "./date.dYFFEunA.js";
|
|
4
4
|
import { d as Ne, a as ie } from "./index.BDuTpjD8.js";
|
|
5
|
-
import { B as pe } from "./button.
|
|
5
|
+
import { B as pe } from "./button.BuD-IsW5.js";
|
|
6
6
|
import { B as xe } from "./typography.J1v_SPG3.js";
|
|
7
7
|
import { n as ae } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
8
|
import { C as Le, a as Re } from "./chevron-left.DOMTgGel.js";
|
|
9
9
|
import { g as Ye } from "./generate-uid.NJ8tVoha.js";
|
|
10
10
|
import { u as Ae } from "./i18n.BQkEbtPM.js";
|
|
11
|
-
import { h as We } from "./index.
|
|
11
|
+
import { h as We } from "./index.oJzeCMPe.js";
|
|
12
|
+
import { g as je } from "./_commonjsHelpers.C6fGbg64.js";
|
|
12
13
|
import { a as Ce } from "./keyboard-navigation.pB8weElW.js";
|
|
13
14
|
import "../assets/calendar.css";
|
|
14
15
|
function ee(e, t) {
|
|
@@ -41,11 +42,11 @@ function H(e) {
|
|
|
41
42
|
var t = k(e);
|
|
42
43
|
return t.setHours(0, 0, 0, 0), t;
|
|
43
44
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
45
|
+
var He = 864e5;
|
|
46
|
+
function Ve(e, t) {
|
|
46
47
|
O(2, arguments);
|
|
47
48
|
var n = H(e), a = H(t), r = n.getTime() - ge(n), s = a.getTime() - ge(a);
|
|
48
|
-
return Math.round((r - s) /
|
|
49
|
+
return Math.round((r - s) / He);
|
|
49
50
|
}
|
|
50
51
|
function Pe(e, t) {
|
|
51
52
|
O(2, arguments);
|
|
@@ -61,9 +62,9 @@ function Ee(e, t) {
|
|
|
61
62
|
var n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
|
|
62
63
|
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function qe(e, t) {
|
|
65
66
|
O(2, arguments);
|
|
66
|
-
var n = k(e), a = k(t), r = Ee(n, a), s = Math.abs(
|
|
67
|
+
var n = k(e), a = k(t), r = Ee(n, a), s = Math.abs(Ve(n, a));
|
|
67
68
|
n.setDate(n.getDate() - r * s);
|
|
68
69
|
var u = +(Ee(n, a) === -r), o = r * (s - u);
|
|
69
70
|
return o === 0 ? 0 : o;
|
|
@@ -86,12 +87,12 @@ function ue(e, t) {
|
|
|
86
87
|
var o = k(e), c = o.getDay(), i = (c < u ? -7 : 0) + 6 - (c - u);
|
|
87
88
|
return o.setDate(o.getDate() + i), o.setHours(23, 59, 59, 999), o;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function Ke(e) {
|
|
90
91
|
O(1, arguments);
|
|
91
92
|
var t = k(e), n = t.getFullYear(), a = t.getMonth(), r = /* @__PURE__ */ new Date(0);
|
|
92
93
|
return r.setFullYear(n, a + 1, 0), r.setHours(0, 0, 0, 0), r.getDate();
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function Xe(e, t) {
|
|
95
96
|
O(2, arguments);
|
|
96
97
|
var n = w(t);
|
|
97
98
|
return ee(e, -n);
|
|
@@ -101,12 +102,12 @@ function Z(e, t) {
|
|
|
101
102
|
var n = w(t);
|
|
102
103
|
return j(e, -n);
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function ze(e, t) {
|
|
105
106
|
O(2, arguments);
|
|
106
107
|
var n = k(e), a = k(t);
|
|
107
108
|
return n.getTime() > a.getTime();
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function Qe(e, t) {
|
|
110
111
|
O(2, arguments);
|
|
111
112
|
var n = k(e), a = k(t);
|
|
112
113
|
return n.getTime() < a.getTime();
|
|
@@ -123,20 +124,20 @@ function le(e, t) {
|
|
|
123
124
|
throw new RangeError("Invalid interval");
|
|
124
125
|
return n >= a && n <= r;
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function Je(e, t) {
|
|
127
128
|
O(2, arguments);
|
|
128
129
|
var n = k(e), a = w(t), r = n.getFullYear(), s = n.getDate(), u = /* @__PURE__ */ new Date(0);
|
|
129
130
|
u.setFullYear(r, a, 15), u.setHours(0, 0, 0, 0);
|
|
130
|
-
var o =
|
|
131
|
+
var o = Ke(u);
|
|
131
132
|
return n.setMonth(a, Math.min(s, o)), n;
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function Ze(e, t) {
|
|
134
135
|
if (O(2, arguments), typeof t != "object" || t === null)
|
|
135
136
|
throw new RangeError("values parameter must be an object");
|
|
136
137
|
var n = k(e);
|
|
137
|
-
return isNaN(n.getTime()) ? /* @__PURE__ */ new Date(NaN) : (t.year != null && n.setFullYear(t.year), t.month != null && (n =
|
|
138
|
+
return isNaN(n.getTime()) ? /* @__PURE__ */ new Date(NaN) : (t.year != null && n.setFullYear(t.year), t.month != null && (n = Je(n, t.month)), t.date != null && n.setDate(w(t.date)), t.hours != null && n.setHours(w(t.hours)), t.minutes != null && n.setMinutes(w(t.minutes)), t.seconds != null && n.setSeconds(w(t.seconds)), t.milliseconds != null && n.setMilliseconds(w(t.milliseconds)), n);
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function et(e, t, n) {
|
|
140
141
|
O(2, arguments);
|
|
141
142
|
var a = {}, r = a.locale, s = r && r.options && r.options.weekStartsOn, u = s == null ? 0 : w(s), o = a.weekStartsOn == null ? u : w(a.weekStartsOn);
|
|
142
143
|
if (!(o >= 0 && o <= 6))
|
|
@@ -144,13 +145,13 @@ function Ze(e, t, n) {
|
|
|
144
145
|
var c = k(e), i = w(t), m = c.getDay(), d = i % 7, f = (d + 7) % 7, y = 7 - o, v = i < 0 || i > 6 ? i - (m + y) % 7 : (f + y) % 7 - (m + y) % 7;
|
|
145
146
|
return ee(c, v);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function tt(e, t) {
|
|
148
149
|
O(2, arguments);
|
|
149
150
|
var n = w(t);
|
|
150
151
|
return Pe(e, -n);
|
|
151
152
|
}
|
|
152
153
|
var R = /* @__PURE__ */ ((e) => (e.SINGLE = "single", e.MIDDLE = "middle", e.BEGINNING = "beginning", e.END = "end", e))(R || {}), F = /* @__PURE__ */ ((e) => (e.SINGLE = "single", e.MIDDLE = "middle", e.BEGINNING = "beginning", e.END = "end", e.SELECTED = "selected", e.UNSELECTED = "unselected", e.CURRENT_DAY = "current-day", e.DISABLED = "disabled", e))(F || {}), J = /* @__PURE__ */ ((e) => (e.CLICK = "click", e.MOUSE_OVER = "mouseover", e))(J || {});
|
|
153
|
-
const
|
|
154
|
+
const at = {
|
|
154
155
|
/**
|
|
155
156
|
* Date to be displayed as the calendar day. From 1st to 31st (or end of the month defined in the date)
|
|
156
157
|
*/
|
|
@@ -172,11 +173,11 @@ const tt = {
|
|
|
172
173
|
default: R.SINGLE,
|
|
173
174
|
validator: (e) => Object.values(R).includes(e)
|
|
174
175
|
}
|
|
175
|
-
},
|
|
176
|
+
}, nt = te({
|
|
176
177
|
name: "calendar-month-day",
|
|
177
178
|
components: { BentoDate: Te },
|
|
178
179
|
inheritAttrs: !0,
|
|
179
|
-
props:
|
|
180
|
+
props: at,
|
|
180
181
|
emits: [J.CLICK, J.MOUSE_OVER],
|
|
181
182
|
setup(e, { emit: t }) {
|
|
182
183
|
const n = S(() => {
|
|
@@ -209,27 +210,23 @@ const tt = {
|
|
|
209
210
|
};
|
|
210
211
|
}
|
|
211
212
|
});
|
|
212
|
-
var
|
|
213
|
+
var rt = function() {
|
|
213
214
|
var t = this, n = t._self._c;
|
|
214
215
|
return t._self._setupProxy, n("td", { staticClass: "b-calendar-month-day", class: t.conditionalClasses, attrs: { tabindex: t.selected ? "0" : "-1", "aria-selected": t.selected ? t.selected : void 0, "aria-disabled": t.disabled, "data-date": t.day.toDateString() }, on: { click: (a) => t.onClick(a, t.day), mouseover: function(a) {
|
|
215
216
|
return t.$emit(t.CalendarMonthDayEvent.MOUSE_OVER);
|
|
216
217
|
}, keydown: function(a) {
|
|
217
218
|
return !a.type.indexOf("key") && t._k(a.keyCode, "space", 32, a.key, [" ", "Spacebar"]) && t._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : ((r) => t.onClick(r, t.day)).apply(null, arguments);
|
|
218
219
|
} } }, [n("div", { staticClass: "b-calendar-month-day__wrapper" }, [n("bento-date", { staticClass: "b-calendar-month-day__label", attrs: { date: t.day, format: t.BentoDateFormat.DAY_OF_MONTH } })], 1)]);
|
|
219
|
-
},
|
|
220
|
-
at,
|
|
220
|
+
}, ot = [], st = /* @__PURE__ */ ae(
|
|
221
221
|
nt,
|
|
222
222
|
rt,
|
|
223
|
+
ot,
|
|
223
224
|
!1,
|
|
224
225
|
null,
|
|
225
226
|
"83a5b036"
|
|
226
227
|
);
|
|
227
|
-
const
|
|
228
|
-
var L = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.MOUSE_OVER = "mouseover", e.CHANGE_DAY = "changeDay", e.NEXT_MONTH = "nextMonth", e.PREVIOUS_MONTH = "previousMonth", e))(L || {}), W = /* @__PURE__ */ ((e) => (e[e.MONDAY = 1] = "MONDAY", e[e.SATURDAY = 6] = "SATURDAY", e[e.SUNDAY = 0] = "SUNDAY", e))(W || {}), U = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.START_DATE_SELECTED = "start-date-selected", e.END_DATE_SELECTED = "end-date-selected", e))(U || {}), V = /* @__PURE__ */ ((e) => (e.FIRST = "first", e.LAST = "last", e.MIDDLE = "middle", e.UNIQUE = "unique", e))(V || {}), ce = /* @__PURE__ */ ((e) => (e.DAY = "day", e.MONTH = "month", e))(ce || {});
|
|
229
|
-
function ut(e) {
|
|
230
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
231
|
-
}
|
|
232
|
-
var de = { exports: {} }, fe = { exports: {} };
|
|
228
|
+
const ut = st.exports;
|
|
229
|
+
var L = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.MOUSE_OVER = "mouseover", e.CHANGE_DAY = "changeDay", e.NEXT_MONTH = "nextMonth", e.PREVIOUS_MONTH = "previousMonth", e))(L || {}), W = /* @__PURE__ */ ((e) => (e[e.MONDAY = 1] = "MONDAY", e[e.SATURDAY = 6] = "SATURDAY", e[e.SUNDAY = 0] = "SUNDAY", e))(W || {}), U = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.START_DATE_SELECTED = "start-date-selected", e.END_DATE_SELECTED = "end-date-selected", e))(U || {}), V = /* @__PURE__ */ ((e) => (e.FIRST = "first", e.LAST = "last", e.MIDDLE = "middle", e.UNIQUE = "unique", e))(V || {}), ce = /* @__PURE__ */ ((e) => (e.DAY = "day", e.MONTH = "month", e))(ce || {}), de = { exports: {} }, fe = { exports: {} };
|
|
233
230
|
(function(e, t) {
|
|
234
231
|
Object.defineProperty(t, "__esModule", {
|
|
235
232
|
value: !0
|
|
@@ -302,7 +299,7 @@ var it = ve.exports;
|
|
|
302
299
|
e.exports = t.default;
|
|
303
300
|
})(de, de.exports);
|
|
304
301
|
var ct = de.exports;
|
|
305
|
-
const Oe = /* @__PURE__ */
|
|
302
|
+
const Oe = /* @__PURE__ */ je(ct), Be = ({ currentSelectedDate: e, month: t, isDateDisabled: n, firstDayOfWeek: a }, r) => {
|
|
306
303
|
const s = $(new Date(t.value));
|
|
307
304
|
q(
|
|
308
305
|
t,
|
|
@@ -398,7 +395,7 @@ const Oe = /* @__PURE__ */ ut(ct), Be = ({ currentSelectedDate: e, month: t, isD
|
|
|
398
395
|
},
|
|
399
396
|
moveToLastMonthOfYear: (l) => {
|
|
400
397
|
_(l);
|
|
401
|
-
const g =
|
|
398
|
+
const g = Ze(u.value, { month: 11, date: 1 }), I = Ne(g, u.value);
|
|
402
399
|
N({
|
|
403
400
|
nextDate: g,
|
|
404
401
|
isIncreasingDays: !0,
|
|
@@ -464,7 +461,7 @@ const Oe = /* @__PURE__ */ ut(ct), Be = ({ currentSelectedDate: e, month: t, isD
|
|
|
464
461
|
components: {
|
|
465
462
|
BentoButton: pe,
|
|
466
463
|
BentoTypography: xe,
|
|
467
|
-
CalendarMonthDay:
|
|
464
|
+
CalendarMonthDay: ut,
|
|
468
465
|
ChevronLeftIcon: Re,
|
|
469
466
|
ChevronRightIcon: Le
|
|
470
467
|
},
|
|
@@ -567,7 +564,7 @@ const Oe = /* @__PURE__ */ ut(ct), Be = ({ currentSelectedDate: e, month: t, isD
|
|
|
567
564
|
})
|
|
568
565
|
), z = S(
|
|
569
566
|
() => new Array(7).fill(/* @__PURE__ */ new Date()).map((E, Y) => {
|
|
570
|
-
const Q =
|
|
567
|
+
const Q = et(E, h.value + Y);
|
|
571
568
|
return be(Q, "EEE", {
|
|
572
569
|
locale: r[n.value.substring(0, 2)] || r.enUS
|
|
573
570
|
});
|
|
@@ -891,20 +888,20 @@ const we = St.exports, Tt = ({ selectedDate: e }, t) => {
|
|
|
891
888
|
() => e.value,
|
|
892
889
|
() => {
|
|
893
890
|
let { startDate: D = null, endDate: b = null } = e.value || {};
|
|
894
|
-
D && (D = H(D)), b && (b = H(b)), !(D && t && t(D) || b && t && t(b) || D && b &&
|
|
891
|
+
D && (D = H(D)), b && (b = H(b)), !(D && t && t(D) || b && t && t(b) || D && b && ze(D, b)) && (f.startDate = D, f.endDate = b);
|
|
895
892
|
},
|
|
896
893
|
{ immediate: !0, deep: !0 }
|
|
897
894
|
);
|
|
898
895
|
const v = (D, b, p) => {
|
|
899
896
|
if (f.startDate = D, f.endDate = b, n.value) {
|
|
900
|
-
const M =
|
|
901
|
-
M > 0 && (p < 1 ? (f.startDate = D, f.endDate =
|
|
897
|
+
const M = qe(b, D) - n.value;
|
|
898
|
+
M > 0 && (p < 1 ? (f.startDate = D, f.endDate = Xe(b, M)) : (f.startDate = ee(D, M), f.endDate = b));
|
|
902
899
|
}
|
|
903
900
|
o(U.START_DATE_SELECTED, f.startDate), o(U.END_DATE_SELECTED, f.endDate);
|
|
904
901
|
}, _ = (D) => {
|
|
905
902
|
var b, p, M, x;
|
|
906
903
|
if (!(!y.value || t && t(D)))
|
|
907
|
-
if (
|
|
904
|
+
if (Qe(D, y.value)) {
|
|
908
905
|
if (((b = a == null ? void 0 : a.value) == null ? void 0 : b.type) === "weekly") {
|
|
909
906
|
const { startDate: T, endDate: h } = m(D, y.value, s.value, u.value);
|
|
910
907
|
v(T, h, -1);
|
|
@@ -1069,7 +1066,7 @@ const we = St.exports, Tt = ({ selectedDate: e }, t) => {
|
|
|
1069
1066
|
const _ = e != null && e.showEndDateOnOpen && e.isRange ? Z(a.value, e.numberOfMonths - 1) : a.value;
|
|
1070
1067
|
return j(_, v);
|
|
1071
1068
|
}), d = S(() => (v) => {
|
|
1072
|
-
const _ = e != null && e.showEndDateOnOpen ?
|
|
1069
|
+
const _ = e != null && e.showEndDateOnOpen ? tt(a.value, e.numberOfMonths - 1) : a.value;
|
|
1073
1070
|
return Pe(_, v);
|
|
1074
1071
|
});
|
|
1075
1072
|
return {
|
|
@@ -1109,10 +1106,10 @@ var Lt = function() {
|
|
|
1109
1106
|
null,
|
|
1110
1107
|
"c4a9f725"
|
|
1111
1108
|
);
|
|
1112
|
-
const
|
|
1109
|
+
const Kt = Yt.exports;
|
|
1113
1110
|
export {
|
|
1114
1111
|
W as C,
|
|
1115
|
-
|
|
1112
|
+
Kt as a,
|
|
1116
1113
|
U as b,
|
|
1117
1114
|
V as c,
|
|
1118
1115
|
ce as d,
|
|
@@ -1121,10 +1118,10 @@ export {
|
|
|
1121
1118
|
ee as g,
|
|
1122
1119
|
ue as h,
|
|
1123
1120
|
ne as i,
|
|
1124
|
-
|
|
1121
|
+
Xe as j,
|
|
1125
1122
|
j as k,
|
|
1126
1123
|
Z as l,
|
|
1127
1124
|
se as s,
|
|
1128
1125
|
It as u
|
|
1129
1126
|
};
|
|
1130
|
-
//# sourceMappingURL=calendar.
|
|
1127
|
+
//# sourceMappingURL=calendar.C0iatn5N.js.map
|