@adyen/bento-vue3 1.53.0 → 1.54.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 +1851 -2155
- package/dist/action-bar.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-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.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/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/payment-method.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -0
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.PIz6tShf.js → action-bar.CUDi5Po7.js} +5 -5
- package/dist/chunks/{action-bar.PIz6tShf.js.map → action-bar.CUDi5Po7.js.map} +1 -1
- package/dist/chunks/{base-modal.D4INiJGX.js → base-modal.BegK8cPb.js} +3 -3
- package/dist/chunks/{base-modal.D4INiJGX.js.map → base-modal.BegK8cPb.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.DFD7gbdT.js → button-actions-with-menu.CcoKss9T.js} +5 -5
- package/dist/chunks/{button-actions-with-menu.DFD7gbdT.js.map → button-actions-with-menu.CcoKss9T.js.map} +1 -1
- package/dist/chunks/{button-actions.BvGAE7sw.js → button-actions.CdlXZ29B.js} +59 -117
- package/dist/chunks/{button-actions.BvGAE7sw.js.map → button-actions.CdlXZ29B.js.map} +1 -1
- package/dist/chunks/{calendar.DKHNrb9_.js → calendar.BRsV4rkQ.js} +72 -72
- package/dist/chunks/{calendar.DKHNrb9_.js.map → calendar.BRsV4rkQ.js.map} +1 -1
- package/dist/chunks/{card.IrL_Fw-f.js → card.C5bSqYsB.js} +2 -2
- package/dist/chunks/{card.IrL_Fw-f.js.map → card.C5bSqYsB.js.map} +1 -1
- package/dist/chunks/{checkbox-group.X2fi2jkS.js → checkbox-group.EPDS2n3a.js} +4 -4
- package/dist/chunks/{checkbox-group.X2fi2jkS.js.map → checkbox-group.EPDS2n3a.js.map} +1 -1
- package/dist/chunks/{checkbox.CXZQtFhM.js → checkbox.Z2Jeglk-.js} +52 -52
- package/dist/chunks/checkbox.Z2Jeglk-.js.map +1 -0
- package/dist/chunks/{code-snippet.CcdsPxT7.js → code-snippet.zdidL9RT.js} +5 -5
- package/dist/chunks/{code-snippet.CcdsPxT7.js.map → code-snippet.zdidL9RT.js.map} +1 -1
- package/dist/chunks/{controls-group.ClMNznTz.js → controls-group.DcbOWqxA.js} +2 -2
- package/dist/chunks/{controls-group.ClMNznTz.js.map → controls-group.DcbOWqxA.js.map} +1 -1
- package/dist/chunks/{copy.BYG9aoNO.js → copy.CFhrpASp.js} +2 -2
- package/dist/chunks/{copy.BYG9aoNO.js.map → copy.CFhrpASp.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Dz9GpOvy.js → dashboard-section.DpL72ax7.js} +4 -4
- package/dist/chunks/{dashboard-section.Dz9GpOvy.js.map → dashboard-section.DpL72ax7.js.map} +1 -1
- package/dist/chunks/{dashed-underline.BuCIjMch.js → dashed-underline.BYAXhfnX.js} +3 -3
- package/dist/chunks/{dashed-underline.BuCIjMch.js.map → dashed-underline.BYAXhfnX.js.map} +1 -1
- package/dist/chunks/{data-grid-template.B4jxtwoW.js → data-grid-template.CJxPIu3E.js} +3 -3
- package/dist/chunks/{data-grid-template.B4jxtwoW.js.map → data-grid-template.CJxPIu3E.js.map} +1 -1
- package/dist/chunks/{data-grid.CLu8mvil.js → data-grid.i-NPmpso.js} +15 -15
- package/dist/chunks/data-grid.i-NPmpso.js.map +1 -0
- package/dist/chunks/{date-picker.CA2i6QxD.js → date-picker.wesQox8h.js} +17 -17
- package/dist/chunks/{date-picker.CA2i6QxD.js.map → date-picker.wesQox8h.js.map} +1 -1
- package/dist/chunks/{date-range-picker.DVQ-j-JX.js → date-range-picker.V6QCtfnc.js} +26 -26
- package/dist/chunks/{date-range-picker.DVQ-j-JX.js.map → date-range-picker.V6QCtfnc.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DFWV7Zj_.js → dropdown-tag.D8wU10wx.js} +4 -4
- package/dist/chunks/{dropdown-tag.DFWV7Zj_.js.map → dropdown-tag.D8wU10wx.js.map} +1 -1
- package/dist/chunks/{dropdown.RVt9T6j5.js → dropdown.DQunMieR.js} +138 -139
- package/dist/chunks/{dropdown.RVt9T6j5.js.map → dropdown.DQunMieR.js.map} +1 -1
- package/dist/chunks/{error-message.BQ5MlnLg.js → error-message.DH8Er2JS.js} +2 -2
- package/dist/chunks/{error-message.BQ5MlnLg.js.map → error-message.DH8Er2JS.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.DJLGEmtF.js → file-uploader.Rtt1Uz2U.js} +592 -540
- package/dist/chunks/file-uploader.Rtt1Uz2U.js.map +1 -0
- package/dist/chunks/{filter-bar.GGHRoo6O.js → filter-bar.DW7lAAtF.js} +697 -689
- package/dist/chunks/filter-bar.DW7lAAtF.js.map +1 -0
- package/dist/chunks/{focus-trap.D-HSKa_Q.js → focus-trap.BFCzfiI_.js} +2 -2
- package/dist/chunks/{focus-trap.D-HSKa_Q.js.map → focus-trap.BFCzfiI_.js.map} +1 -1
- package/dist/chunks/{footer-actions.DK3pMfDY.js → footer-actions.A9H5F5D-.js} +2 -2
- package/dist/chunks/{footer-actions.DK3pMfDY.js.map → footer-actions.A9H5F5D-.js.map} +1 -1
- package/dist/chunks/{header-with-views.BkcFu7QW.js → header-with-views.D2B-20ZR.js} +11 -11
- package/dist/chunks/{header-with-views.BkcFu7QW.js.map → header-with-views.D2B-20ZR.js.map} +1 -1
- package/dist/chunks/{header.CyTcPWF4.js → header.CoyUQXFL.js} +4 -4
- package/dist/chunks/{header.CyTcPWF4.js.map → header.CoyUQXFL.js.map} +1 -1
- package/dist/chunks/{index.C5sL_d0I.js → index.BzJQl-2M.js} +3 -3
- package/dist/chunks/{index.C5sL_d0I.js.map → index.BzJQl-2M.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.DgZh2mnN.js → info-icon-with-popover.CBi7CmUZ.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.DgZh2mnN.js.map → info-icon-with-popover.CBi7CmUZ.js.map} +1 -1
- package/dist/chunks/{info-icon.DxOAiUg4.js → info-icon.Bomzzcc5.js} +2 -2
- package/dist/chunks/{info-icon.DxOAiUg4.js.map → info-icon.Bomzzcc5.js.map} +1 -1
- package/dist/chunks/input-field-password.DMEjy243.js +343 -0
- package/dist/chunks/input-field-password.DMEjy243.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.BtRMkC84.js → input-field-phone-number.DhJznFQP.js} +3 -3
- package/dist/chunks/{input-field-phone-number.BtRMkC84.js.map → input-field-phone-number.DhJznFQP.js.map} +1 -1
- package/dist/chunks/{input-field.CRlXtS3z.js → input-field.B9AU1IsG.js} +3 -3
- package/dist/chunks/{input-field.CRlXtS3z.js.map → input-field.B9AU1IsG.js.map} +1 -1
- package/dist/chunks/inspector.types.Fs9URmPq.js +188 -0
- package/dist/chunks/inspector.types.Fs9URmPq.js.map +1 -0
- package/dist/chunks/{layout-row.CwwbWO7s.js → layout-row.BC3Z1mQx.js} +2 -2
- package/dist/chunks/{layout-row.CwwbWO7s.js.map → layout-row.BC3Z1mQx.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.2k0hRv0z.js → listbox-option-tag.CqnkZr9x.js} +2 -2
- package/dist/chunks/{listbox-option-tag.2k0hRv0z.js.map → listbox-option-tag.CqnkZr9x.js.map} +1 -1
- package/dist/chunks/{menu.DBRBVdsd.js → menu.P_KG1J8b.js} +2 -2
- package/dist/chunks/{menu.DBRBVdsd.js.map → menu.P_KG1J8b.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.POY-6qYC.js → modal-fullscreen.DxuMKagz.js} +3 -3
- package/dist/chunks/{modal-fullscreen.POY-6qYC.js.map → modal-fullscreen.DxuMKagz.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CGV0E6eK.js → modal.vue_vue_type_script_setup_true_lang.DfzxXSwn.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CGV0E6eK.js.map → modal.vue_vue_type_script_setup_true_lang.DfzxXSwn.js.map} +1 -1
- package/dist/chunks/{pagination.TWtayPVy.js → pagination.DsEd-vpq.js} +3 -3
- package/dist/chunks/{pagination.TWtayPVy.js.map → pagination.DsEd-vpq.js.map} +1 -1
- package/dist/chunks/{payment-method.CLUppDo_.js → payment-method.eazefwm6.js} +9 -9
- package/dist/chunks/payment-method.eazefwm6.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js +5 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -0
- package/dist/chunks/{popover.BBnUL5Y_.js → popover.Csq1gQ6T.js} +3 -3
- package/dist/chunks/{popover.BBnUL5Y_.js.map → popover.Csq1gQ6T.js.map} +1 -1
- package/dist/chunks/{popper-container.Be3h7X17.js → popper-container.DnlxQ9eS.js} +2 -2
- package/dist/chunks/{popper-container.Be3h7X17.js.map → popper-container.DnlxQ9eS.js.map} +1 -1
- package/dist/chunks/{promo-banner.BdaUFMsl.js → promo-banner.CN-TTSov.js} +2 -2
- package/dist/chunks/{promo-banner.BdaUFMsl.js.map → promo-banner.CN-TTSov.js.map} +1 -1
- package/dist/chunks/{radio-group.BUazlUAi.js → radio-group.Vm-hmL1q.js} +4 -4
- package/dist/chunks/{radio-group.BUazlUAi.js.map → radio-group.Vm-hmL1q.js.map} +1 -1
- package/dist/chunks/{search-bar.21CWuOHb.js → search-bar.BBV1KNdd.js} +3 -3
- package/dist/chunks/{search-bar.21CWuOHb.js.map → search-bar.BBV1KNdd.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CUQi4Ybt.js → secondary-nav.O2R1ltD9.js} +3 -3
- package/dist/chunks/{secondary-nav.CUQi4Ybt.js.map → secondary-nav.O2R1ltD9.js.map} +1 -1
- package/dist/chunks/{segmented-control.BZJ9DzRF.js → segmented-control.DBy-nbYM.js} +2 -2
- package/dist/chunks/{segmented-control.BZJ9DzRF.js.map → segmented-control.DBy-nbYM.js.map} +1 -1
- package/dist/chunks/{selection-card-group.Bdrx1b6M.js → selection-card-group.Bt4jBqjc.js} +4 -4
- package/dist/chunks/{selection-card-group.Bdrx1b6M.js.map → selection-card-group.Bt4jBqjc.js.map} +1 -1
- package/dist/chunks/{sidepanel.D_bGUcyi.js → sidepanel.Ds2CCG9L.js} +3 -3
- package/dist/chunks/{sidepanel.D_bGUcyi.js.map → sidepanel.Ds2CCG9L.js.map} +1 -1
- package/dist/chunks/{structured-list-item.r1jYiX6Y.js → structured-list-item.CygGTBVl.js} +4 -4
- package/dist/chunks/{structured-list-item.r1jYiX6Y.js.map → structured-list-item.CygGTBVl.js.map} +1 -1
- package/dist/chunks/summary-grid.types.DzvuP-NU.js +454 -0
- package/dist/chunks/summary-grid.types.DzvuP-NU.js.map +1 -0
- package/dist/chunks/tabs.B8BRqQpv.js +272 -0
- package/dist/chunks/tabs.B8BRqQpv.js.map +1 -0
- package/dist/chunks/{tag.DVkBzXMx.js → tag.C4SGN5Eb.js} +2 -2
- package/dist/chunks/{tag.DVkBzXMx.js.map → tag.C4SGN5Eb.js.map} +1 -1
- package/dist/chunks/{textarea.C8R71Q4l.js → textarea.bQwvvIkq.js} +103 -95
- package/dist/chunks/textarea.bQwvvIkq.js.map +1 -0
- package/dist/chunks/{timeline-item.DBeAlt3N.js → timeline-item.Bxt_pNII.js} +5 -5
- package/dist/chunks/{timeline-item.DBeAlt3N.js.map → timeline-item.Bxt_pNII.js.map} +1 -1
- package/dist/chunks/{tooltip.Cbs_YIap.js → tooltip.CyQxprBQ.js} +2 -2
- package/dist/chunks/{tooltip.Cbs_YIap.js.map → tooltip.CyQxprBQ.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4smMvopK.js → tutorial.vue_vue_type_script_setup_true_lang.BtVT3Ltg.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4smMvopK.js.map → tutorial.vue_vue_type_script_setup_true_lang.BtVT3Ltg.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.Chb18cq_.js → use-cached-selected-values.DmW8XRgJ.js} +135 -135
- package/dist/chunks/{use-cached-selected-values.Chb18cq_.js.map → use-cached-selected-values.DmW8XRgJ.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/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +61 -61
- 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 +10 -10
- package/dist/layout.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/payment-method.js +2 -2
- 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/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 +42 -16
- package/dist/styles/bento-light.css +42 -16
- package/dist/styles/bento.css +42 -16
- package/dist/styles/legacy.css +30 -4
- package/dist/styles/styleguide.css +42 -16
- 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/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/assets/summary-grid-item-custom.css +0 -1
- package/dist/chunks/checkbox.CXZQtFhM.js.map +0 -1
- package/dist/chunks/data-grid.CLu8mvil.js.map +0 -1
- package/dist/chunks/file-uploader.DJLGEmtF.js.map +0 -1
- package/dist/chunks/filter-bar.GGHRoo6O.js.map +0 -1
- package/dist/chunks/input-field-password.BSJMbPHf.js +0 -313
- package/dist/chunks/input-field-password.BSJMbPHf.js.map +0 -1
- package/dist/chunks/inspector.types.s0va--Nn.js +0 -184
- package/dist/chunks/inspector.types.s0va--Nn.js.map +0 -1
- package/dist/chunks/payment-method.CLUppDo_.js.map +0 -1
- package/dist/chunks/payment-method.types.CJKfZQN5.js +0 -5
- package/dist/chunks/payment-method.types.CJKfZQN5.js.map +0 -1
- package/dist/chunks/summary-grid-item-custom.ACP0RH0N.js +0 -826
- package/dist/chunks/summary-grid-item-custom.ACP0RH0N.js.map +0 -1
- package/dist/chunks/tabs.hp52NnXH.js +0 -211
- package/dist/chunks/tabs.hp52NnXH.js.map +0 -1
- package/dist/chunks/textarea.C8R71Q4l.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions.BvGAE7sw.js","sources":["../../../core/src/components/button-actions/button-actions.types.ts","../../../core/src/components/loading-button/loading-button.types.ts","../../../vue2/src/components/button/components/loading-button/loading-button.vue","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.ts","../../../vue2/src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.ts","../../../vue2/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<{\n /**\n * Click event handler\n */\n (e: 'click', event: MouseEvent): void;\n }>();\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, PropType, ref } from 'vue';\n import BentoButton from '../../button.vue';\n import {\n BentoButtonActionObject,\n BentoButtonActionsLayout,\n BentoButtonActionsList,\n } from '@/core/components/button-actions/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 /**\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: 'secondary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Sets the Button Actions to color scheme inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n layout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (layout: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(layout),\n },\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","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","isInverseLoadingIndicator","isCritical","onClick","e","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","generateButtonEvents","isIconOnly"],"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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtHA,UAAA7C,IAAAC,GAkEAoB,IAAAI,EAAA,IAAA,GACAH,IAAAG,EAAA,IAAA,GACAI,IAAAT,GAAAC,GAAAC,GAAAtB,EAAA,OAAA,GAEA8C,IAAAnC,EAAA,MAAAX,EAAA,QAAA,MAAA,EAAA,QAAA,CAAA,GACA+C,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAjD,EAAA,QAAA,SAAA;AACA,aAAAgD,MAAAC,IAAA,YAAA;AAAA,IAAqD,GAGzDvC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAX,EAAA,MAAA,EAAA,GAAA;AAAA,MACA,qCAAA6B,EAAA;AAAA,IACa,EAAA,GAGxDqB,IAAA,CAAAZ,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA,GAI5Ba,IAAA,CAAAb,MAAAA,EAAA,aAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"button-actions.CdlXZ29B.js","sources":["../../../core/src/components/button-actions/button-actions.types.ts","../../../core/src/components/loading-button/loading-button.types.ts","../../../vue2/src/components/button/components/loading-button/loading-button.vue","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.ts","../../../vue2/src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.ts","../../../vue2/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<{\n /**\n * Click event handler\n */\n (e: 'click', event: MouseEvent): void;\n }>();\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 = withDefaults(defineProps<BentoButtonActionsProps>(), {\n inverse: false,\n layout: 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","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","isInverseLoadingIndicator","isCritical","onClick","e","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","generateButtonEvents","isIconOnly"],"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,KAAA,EAAA,GAAAJ,GAAA,GAAAE,E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AKAoB,IAAAI,EAAA,IAAA,GACAH,IAAAG,EAAA,IAAA,GACAI,IAAAT,GAAAC,GAAAC,GAAAtB,EAAA,OAAA,GAEA8C,IAAAnC,EAAA,MAAAX,EAAA,QAAA,MAAA,EAAA,QAAA,CAAA,GACA+C,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAjD,EAAA,QAAA,SAAA;AACA,aAAAgD,MAAAC,IAAA,YAAA;AAAA,IAAqD,GAGzDvC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAX,EAAA,MAAA,EAAA,GAAA;AAAA,MACA,qCAAA6B,EAAA;AAAA,IACa,EAAA,GAGxDqB,IAAA,CAAAZ,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA,GAI5Ba,IAAA,CAAAb,MAAAA,EAAA,aAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,7 +10,7 @@ import "./events.FNmSWp_P.js";
|
|
|
10
10
|
import { a as Ze } from "./keyboard-navigation.CqgGzfZQ.js";
|
|
11
11
|
import { g as et } from "./generate-uid.NJ8tVoha.js";
|
|
12
12
|
import { u as tt } from "./i18n.D9azDLPe.js";
|
|
13
|
-
import { h as ct } from "./index.
|
|
13
|
+
import { h as ct } from "./index.BzJQl-2M.js";
|
|
14
14
|
import "../assets/calendar.css";
|
|
15
15
|
function fe(e, t) {
|
|
16
16
|
S(2, arguments);
|
|
@@ -53,7 +53,7 @@ function at(e, t) {
|
|
|
53
53
|
var a = I(t);
|
|
54
54
|
return te(e, a * 12);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ye(e, t) {
|
|
57
57
|
S(2, arguments);
|
|
58
58
|
var a = ae(e), n = ae(t);
|
|
59
59
|
return a.getTime() === n.getTime();
|
|
@@ -92,7 +92,7 @@ function mt(e) {
|
|
|
92
92
|
var t = w(e), a = t.getFullYear(), n = t.getMonth(), o = /* @__PURE__ */ new Date(0);
|
|
93
93
|
return o.setFullYear(a, n + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function yt(e, t) {
|
|
96
96
|
S(2, arguments);
|
|
97
97
|
var a = I(t);
|
|
98
98
|
return fe(e, -a);
|
|
@@ -102,7 +102,7 @@ function ve(e, t) {
|
|
|
102
102
|
var a = I(t);
|
|
103
103
|
return te(e, -a);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function ht(e, t) {
|
|
106
106
|
S(2, arguments);
|
|
107
107
|
var a = w(e), n = w(t);
|
|
108
108
|
return a.getTime() > n.getTime();
|
|
@@ -112,7 +112,7 @@ function gt(e, t) {
|
|
|
112
112
|
var a = w(e), n = w(t);
|
|
113
113
|
return a.getTime() < n.getTime();
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function he(e, t) {
|
|
116
116
|
S(2, arguments);
|
|
117
117
|
var a = w(e), n = w(t);
|
|
118
118
|
return a.getFullYear() === n.getFullYear() && a.getMonth() === n.getMonth();
|
|
@@ -338,7 +338,7 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
338
338
|
}, c = (u) => {
|
|
339
339
|
const g = !!d.value[u == null ? void 0 : u.toDateString()];
|
|
340
340
|
u && g && d.value[u.toDateString()].$el.focus();
|
|
341
|
-
},
|
|
341
|
+
}, h = (u) => {
|
|
342
342
|
u.preventDefault(), u.stopImmediatePropagation(), u.stopPropagation();
|
|
343
343
|
}, N = ({ nextDate: u, isIncreasingDays: g, amountOfMonths: L, isCalendarButtonsNav: V }) => {
|
|
344
344
|
if (!V && a && a(u))
|
|
@@ -366,29 +366,29 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
366
366
|
*/
|
|
367
367
|
// ArrowRight
|
|
368
368
|
moveToNextDay: (u) => {
|
|
369
|
-
|
|
369
|
+
h(u), N({ nextDate: fe(i.value, 1), isIncreasingDays: !0 });
|
|
370
370
|
},
|
|
371
371
|
// ArrowLeft
|
|
372
372
|
moveToPreviousDay: (u) => {
|
|
373
|
-
|
|
373
|
+
h(u), N({ nextDate: Ue(i.value, 1), isIncreasingDays: !1 });
|
|
374
374
|
},
|
|
375
375
|
// ArrowUp
|
|
376
376
|
moveToPreviousWeek: (u) => {
|
|
377
|
-
|
|
377
|
+
h(u), N({ nextDate: Ue(i.value, 7), isIncreasingDays: !1 });
|
|
378
378
|
},
|
|
379
379
|
// ArrowDown
|
|
380
380
|
moveToNextWeek: (u) => {
|
|
381
|
-
|
|
381
|
+
h(u), N({ nextDate: fe(i.value, 7), isIncreasingDays: !0 });
|
|
382
382
|
},
|
|
383
383
|
// Home
|
|
384
384
|
moveToFirstDayOfWeek: (u) => {
|
|
385
|
-
|
|
385
|
+
h(u), N({
|
|
386
386
|
nextDate: ge(i.value, { weekStartsOn: n }),
|
|
387
387
|
isIncreasingDays: !1
|
|
388
388
|
});
|
|
389
389
|
},
|
|
390
390
|
moveToFirstMonthOfYear: (u) => {
|
|
391
|
-
|
|
391
|
+
h(u);
|
|
392
392
|
const g = Ce(l.value, Be(l.value));
|
|
393
393
|
N({
|
|
394
394
|
nextDate: Be(l.value),
|
|
@@ -398,13 +398,13 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
398
398
|
},
|
|
399
399
|
// End
|
|
400
400
|
moveToLastDayOfWeek: (u) => {
|
|
401
|
-
|
|
401
|
+
h(u), N({
|
|
402
402
|
nextDate: be(i.value, { weekStartsOn: n }),
|
|
403
403
|
isIncreasingDays: !0
|
|
404
404
|
});
|
|
405
405
|
},
|
|
406
406
|
moveToLastMonthOfYear: (u) => {
|
|
407
|
-
|
|
407
|
+
h(u);
|
|
408
408
|
const g = bt(l.value, { month: 11, date: 1 }), L = Ce(g, l.value);
|
|
409
409
|
N({
|
|
410
410
|
nextDate: g,
|
|
@@ -414,7 +414,7 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
414
414
|
},
|
|
415
415
|
// PageUp
|
|
416
416
|
moveToPreviousMonth: (u, g = !1, L = 1) => {
|
|
417
|
-
|
|
417
|
+
h(u);
|
|
418
418
|
const V = L;
|
|
419
419
|
N({
|
|
420
420
|
nextDate: ve(i.value, V),
|
|
@@ -425,7 +425,7 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
425
425
|
},
|
|
426
426
|
// Shift+PageUp
|
|
427
427
|
moveToPreviousYear: (u, g = !1) => {
|
|
428
|
-
|
|
428
|
+
h(u);
|
|
429
429
|
const L = 12;
|
|
430
430
|
N({
|
|
431
431
|
nextDate: ve(i.value, L),
|
|
@@ -436,7 +436,7 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
436
436
|
},
|
|
437
437
|
// PageDown
|
|
438
438
|
moveToNextMonth: (u, g = !1, L = 1) => {
|
|
439
|
-
|
|
439
|
+
h(u);
|
|
440
440
|
const V = L;
|
|
441
441
|
N({
|
|
442
442
|
nextDate: te(i.value, V),
|
|
@@ -447,7 +447,7 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
447
447
|
},
|
|
448
448
|
// Shift-PageDown
|
|
449
449
|
moveToNextYear: (u, g = !1) => {
|
|
450
|
-
|
|
450
|
+
h(u);
|
|
451
451
|
const L = 12;
|
|
452
452
|
N({
|
|
453
453
|
nextDate: te(i.value, L),
|
|
@@ -550,9 +550,9 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
550
550
|
moveToNextDay: v,
|
|
551
551
|
moveToPreviousDay: m,
|
|
552
552
|
moveToPreviousWeek: c,
|
|
553
|
-
moveToNextWeek:
|
|
553
|
+
moveToNextWeek: h,
|
|
554
554
|
moveToFirstDayOfWeek: N,
|
|
555
|
-
moveToLastDayOfWeek:
|
|
555
|
+
moveToLastDayOfWeek: y,
|
|
556
556
|
moveToPreviousMonth: b,
|
|
557
557
|
moveToPreviousYear: Y,
|
|
558
558
|
moveToNextMonth: T,
|
|
@@ -600,15 +600,15 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
600
600
|
// Enums
|
|
601
601
|
CalendarMonthEvent: U,
|
|
602
602
|
// Functions
|
|
603
|
-
isSelectedDate: (M) => r.value &&
|
|
603
|
+
isSelectedDate: (M) => r.value && ye(r.value, M) && !e.endDate ? !0 : e.startDate && e.endDate && Ee(M, { start: e.startDate, end: e.endDate }),
|
|
604
604
|
showNextMonth: D,
|
|
605
605
|
showPreviousMonth: f,
|
|
606
606
|
dayVariant: (M) => {
|
|
607
|
-
if (!e.isRange ||
|
|
607
|
+
if (!e.isRange || ye(e.startDate, e.endDate))
|
|
608
608
|
return G.SINGLE;
|
|
609
|
-
if (e.startDate &&
|
|
609
|
+
if (e.startDate && ye(e.startDate, M))
|
|
610
610
|
return G.BEGINNING;
|
|
611
|
-
if (e.endDate &&
|
|
611
|
+
if (e.endDate && ye(e.endDate, M))
|
|
612
612
|
return G.END;
|
|
613
613
|
if (e.startDate && e.endDate && Ee(M, { start: e.startDate, end: e.endDate }))
|
|
614
614
|
return G.MIDDLE;
|
|
@@ -624,9 +624,9 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
624
624
|
"keydown:arrow-right": v,
|
|
625
625
|
"keydown:arrow-left": m,
|
|
626
626
|
"keydown:arrow-up": c,
|
|
627
|
-
"keydown:arrow-down":
|
|
627
|
+
"keydown:arrow-down": h,
|
|
628
628
|
"keydown:home": N,
|
|
629
|
-
"keydown:end":
|
|
629
|
+
"keydown:end": y,
|
|
630
630
|
"keydown:page-up": b,
|
|
631
631
|
"keydown:shift-page-up": Y,
|
|
632
632
|
"keydown:page-down": T,
|
|
@@ -637,9 +637,9 @@ const Ue = /* @__PURE__ */ _t($t), ot = ({ currentSelectedDate: e, month: t, isD
|
|
|
637
637
|
moveToNextDay: v,
|
|
638
638
|
moveToPreviousDay: m,
|
|
639
639
|
moveToPreviousWeek: c,
|
|
640
|
-
moveToNextWeek:
|
|
640
|
+
moveToNextWeek: h,
|
|
641
641
|
moveToFirstDayOfWeek: N,
|
|
642
|
-
moveToLastDayOfWeek:
|
|
642
|
+
moveToLastDayOfWeek: y,
|
|
643
643
|
moveToPreviousMonth: b,
|
|
644
644
|
moveToPreviousYear: Y,
|
|
645
645
|
moveToNextMonth: T,
|
|
@@ -723,10 +723,10 @@ function Ut(e, t, a, n, o, s) {
|
|
|
723
723
|
key: 0,
|
|
724
724
|
colspan: 7 - v.length
|
|
725
725
|
}, null, 8, Bt)) : ce("", !0),
|
|
726
|
-
(O(!0), $(le, null, ue(v, (c,
|
|
726
|
+
(O(!0), $(le, null, ue(v, (c, h) => (O(), ee(D, {
|
|
727
727
|
ref_for: !0,
|
|
728
728
|
ref: e.addDayRef(c),
|
|
729
|
-
key: `calendar-day-${
|
|
729
|
+
key: `calendar-day-${h}`,
|
|
730
730
|
day: c,
|
|
731
731
|
disabled: e.computedIsDateDisabled(c),
|
|
732
732
|
selected: e.isSelectedDate(c),
|
|
@@ -837,9 +837,9 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
837
837
|
moveToPreviousMonth: v,
|
|
838
838
|
moveToPreviousYear: m,
|
|
839
839
|
moveToNextMonth: c,
|
|
840
|
-
moveToNextYear:
|
|
840
|
+
moveToNextYear: h,
|
|
841
841
|
moveToFirstMonthOfYear: N,
|
|
842
|
-
moveToLastMonthOfYear:
|
|
842
|
+
moveToLastMonthOfYear: y,
|
|
843
843
|
focusOnDate: b
|
|
844
844
|
} = ot(
|
|
845
845
|
{
|
|
@@ -860,7 +860,7 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
860
860
|
E.push(z);
|
|
861
861
|
}
|
|
862
862
|
return E;
|
|
863
|
-
}), T = (E) => !o.isRange ||
|
|
863
|
+
}), T = (E) => !o.isRange || he(o.startDate, o.endDate) ? H.SINGLE : o.startDate && he(o.startDate, E) ? H.BEGINNING : o.endDate && he(o.endDate, E) ? H.END : o.startDate && o.endDate && Ee(E, { start: o.startDate, end: o.endDate }) ? H.MIDDLE : null, P = (E) => D.value && he(D.value, E) ? !0 : o.startDate && o.endDate && Ee(E, { start: o.startDate, end: o.endDate }), p = (E) => {
|
|
864
864
|
s("input", E);
|
|
865
865
|
}, R = o.isRange ? {} : {
|
|
866
866
|
"keydown:arrow-right": c,
|
|
@@ -868,9 +868,9 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
868
868
|
"keydown:arrow-up": (E) => v(E, !1, 4),
|
|
869
869
|
"keydown:arrow-down": (E) => c(E, !1, 4),
|
|
870
870
|
"keydown:home": N,
|
|
871
|
-
"keydown:end":
|
|
871
|
+
"keydown:end": y,
|
|
872
872
|
"keydown:page-up": m,
|
|
873
|
-
"keydown:page-down":
|
|
873
|
+
"keydown:page-down": h
|
|
874
874
|
};
|
|
875
875
|
return (E, C) => He((O(), $("div", Ve({ class: "b-calendar-year" }, xe(_(R), !0)), [
|
|
876
876
|
A("div", xt, [
|
|
@@ -903,7 +903,7 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
903
903
|
d.value ? (O(), ee(_(Se), {
|
|
904
904
|
key: 0,
|
|
905
905
|
variant: "tertiary",
|
|
906
|
-
onClick: C[1] || (C[1] = (B) => _(
|
|
906
|
+
onClick: C[1] || (C[1] = (B) => _(h)(B, !0))
|
|
907
907
|
}, {
|
|
908
908
|
iconLeft: J(() => [
|
|
909
909
|
K(_(Qe), {
|
|
@@ -915,7 +915,7 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
915
915
|
])
|
|
916
916
|
]),
|
|
917
917
|
A("table", {
|
|
918
|
-
class: "b-calendar-
|
|
918
|
+
class: "b-calendar-year__year-container",
|
|
919
919
|
role: "grid",
|
|
920
920
|
"aria-labelledby": _(n)
|
|
921
921
|
}, [
|
|
@@ -939,7 +939,7 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
939
939
|
[_(Ze)]
|
|
940
940
|
]);
|
|
941
941
|
}
|
|
942
|
-
}), je = /* @__PURE__ */ me(Qt, [["__scopeId", "data-v-
|
|
942
|
+
}), je = /* @__PURE__ */ me(Qt, [["__scopeId", "data-v-0a67988c"]]), Jt = ({ selectedDate: e }, t) => {
|
|
943
943
|
const a = qe({
|
|
944
944
|
startDate: null,
|
|
945
945
|
endDate: null
|
|
@@ -998,66 +998,66 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
998
998
|
se(
|
|
999
999
|
() => e.value,
|
|
1000
1000
|
() => {
|
|
1001
|
-
let { startDate:
|
|
1002
|
-
|
|
1001
|
+
let { startDate: y = null, endDate: b = null } = e.value || {};
|
|
1002
|
+
y && (y = ae(y)), b && (b = ae(b)), !(y && t && t(y) || b && t && t(b) || y && b && ht(y, b)) && (v.startDate = y, v.endDate = b);
|
|
1003
1003
|
},
|
|
1004
1004
|
{ immediate: !0, deep: !0 }
|
|
1005
1005
|
);
|
|
1006
|
-
const c = (
|
|
1007
|
-
if (v.startDate =
|
|
1008
|
-
const T = Dt(b,
|
|
1009
|
-
T > 0 && (Y < 1 ? (v.startDate =
|
|
1006
|
+
const c = (y, b, Y) => {
|
|
1007
|
+
if (v.startDate = y, v.endDate = b, a.value) {
|
|
1008
|
+
const T = Dt(b, y) - a.value;
|
|
1009
|
+
T > 0 && (Y < 1 ? (v.startDate = y, v.endDate = yt(b, T)) : (v.startDate = fe(y, T), v.endDate = b));
|
|
1010
1010
|
}
|
|
1011
1011
|
r(X.START_DATE_SELECTED, v.startDate), r(X.END_DATE_SELECTED, v.endDate);
|
|
1012
|
-
},
|
|
1012
|
+
}, h = (y) => {
|
|
1013
1013
|
var b, Y, T, P;
|
|
1014
|
-
if (!(!m.value || t && t(
|
|
1015
|
-
if (gt(
|
|
1014
|
+
if (!(!m.value || t && t(y)))
|
|
1015
|
+
if (gt(y, m.value)) {
|
|
1016
1016
|
if (((b = n == null ? void 0 : n.value) == null ? void 0 : b.type) === "weekly") {
|
|
1017
|
-
const { startDate: p, endDate: R } = D(
|
|
1017
|
+
const { startDate: p, endDate: R } = D(y, m.value, s.value, l.value);
|
|
1018
1018
|
c(p, R, -1);
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
1021
1021
|
if (((Y = n == null ? void 0 : n.value) == null ? void 0 : Y.type) === "monthly") {
|
|
1022
|
-
const { startDate: p, endDate: R } = f(
|
|
1022
|
+
const { startDate: p, endDate: R } = f(y, m.value, s.value, l.value);
|
|
1023
1023
|
c(p, R, -1);
|
|
1024
1024
|
return;
|
|
1025
1025
|
}
|
|
1026
|
-
c(
|
|
1026
|
+
c(y, m.value, -1);
|
|
1027
1027
|
} else {
|
|
1028
1028
|
if (((T = n == null ? void 0 : n.value) == null ? void 0 : T.type) === "weekly") {
|
|
1029
|
-
const { startDate: p, endDate: R } = D(m.value,
|
|
1029
|
+
const { startDate: p, endDate: R } = D(m.value, y, s.value, l.value);
|
|
1030
1030
|
c(p, R, 1);
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
1033
|
if (((P = n == null ? void 0 : n.value) == null ? void 0 : P.type) === "monthly") {
|
|
1034
|
-
const { startDate: p, endDate: R } = f(m.value,
|
|
1034
|
+
const { startDate: p, endDate: R } = f(m.value, y, s.value, l.value);
|
|
1035
1035
|
c(p, R, 1);
|
|
1036
1036
|
return;
|
|
1037
1037
|
}
|
|
1038
|
-
c(m.value,
|
|
1038
|
+
c(m.value, y, 1);
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
return {
|
|
1042
1042
|
internalValue: v,
|
|
1043
|
-
onDateInput: (
|
|
1043
|
+
onDateInput: (y) => {
|
|
1044
1044
|
var b, Y;
|
|
1045
1045
|
if (m.value)
|
|
1046
1046
|
m.value = null, r(X.INPUT, v);
|
|
1047
1047
|
else {
|
|
1048
|
-
let T =
|
|
1048
|
+
let T = y;
|
|
1049
1049
|
if (((b = n == null ? void 0 : n.value) == null ? void 0 : b.type) === "weekly") {
|
|
1050
|
-
const { startDate: P, endDate: p } = D(
|
|
1050
|
+
const { startDate: P, endDate: p } = D(y);
|
|
1051
1051
|
T = P, c(T, p);
|
|
1052
1052
|
}
|
|
1053
1053
|
if (((Y = n == null ? void 0 : n.value) == null ? void 0 : Y.type) === "monthly") {
|
|
1054
|
-
const { startDate: P, endDate: p } = f(
|
|
1054
|
+
const { startDate: P, endDate: p } = f(y);
|
|
1055
1055
|
T = P, c(T, p);
|
|
1056
1056
|
}
|
|
1057
|
-
m.value = T,
|
|
1057
|
+
m.value = T, h(T);
|
|
1058
1058
|
}
|
|
1059
1059
|
},
|
|
1060
|
-
onMouseOver:
|
|
1060
|
+
onMouseOver: h
|
|
1061
1061
|
};
|
|
1062
1062
|
}, ta = De({
|
|
1063
1063
|
name: "calendar",
|
|
@@ -1138,12 +1138,12 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
1138
1138
|
se(
|
|
1139
1139
|
() => e.value,
|
|
1140
1140
|
() => {
|
|
1141
|
-
var c,
|
|
1141
|
+
var c, h, N;
|
|
1142
1142
|
if (e.isRange)
|
|
1143
|
-
n.value = e != null && e.showEndDateOnOpen && ((c = e.value) != null && c.endDate) ? (
|
|
1143
|
+
n.value = e != null && e.showEndDateOnOpen && ((c = e.value) != null && c.endDate) ? (h = e.value) == null ? void 0 : h.endDate : ((N = e.value) == null ? void 0 : N.startDate) || /* @__PURE__ */ new Date();
|
|
1144
1144
|
else {
|
|
1145
|
-
const
|
|
1146
|
-
n.value = e.value ||
|
|
1145
|
+
const y = e.defaultDisplayMonth && new Date(e.defaultDisplayMonth).getTime() ? new Date(e.defaultDisplayMonth) : /* @__PURE__ */ new Date();
|
|
1146
|
+
n.value = e.value || y;
|
|
1147
1147
|
}
|
|
1148
1148
|
},
|
|
1149
1149
|
{ immediate: !0 }
|
|
@@ -1174,11 +1174,11 @@ const Gt = ["tabindex", "aria-selected"], Wt = { class: "b-calendar-year-month__
|
|
|
1174
1174
|
},
|
|
1175
1175
|
t
|
|
1176
1176
|
), d = (c) => e.numberOfMonths === 1 ? re.UNIQUE : c === 0 ? re.FIRST : c === e.numberOfMonths - 1 ? re.LAST : re.MIDDLE, D = k(() => (c) => {
|
|
1177
|
-
const
|
|
1178
|
-
return te(
|
|
1177
|
+
const h = e != null && e.showEndDateOnOpen && e.isRange ? ve(n.value, e.numberOfMonths - 1) : n.value;
|
|
1178
|
+
return te(h, c);
|
|
1179
1179
|
}), f = k(() => (c) => {
|
|
1180
|
-
const
|
|
1181
|
-
return at(
|
|
1180
|
+
const h = e != null && e.showEndDateOnOpen ? Mt(n.value, e.numberOfMonths - 1) : n.value;
|
|
1181
|
+
return at(h, c);
|
|
1182
1182
|
});
|
|
1183
1183
|
return {
|
|
1184
1184
|
// Refs
|
|
@@ -1231,10 +1231,10 @@ function aa(e, t, a, n, o, s) {
|
|
|
1231
1231
|
}, null, 40, ["first-day-of-week", "is-date-disabled", "month", "year", "position", "min", "max", "is-range", "start-date", "end-date", "granularity", "onInput", "onMouseover", "onChangeDay", "onNextMonth", "onPreviousMonth"]))), 128))
|
|
1232
1232
|
], 2);
|
|
1233
1233
|
}
|
|
1234
|
-
const
|
|
1234
|
+
const ya = /* @__PURE__ */ me(ta, [["render", aa], ["__scopeId", "data-v-71902e62"]]);
|
|
1235
1235
|
export {
|
|
1236
1236
|
Z as C,
|
|
1237
|
-
|
|
1237
|
+
ya as a,
|
|
1238
1238
|
X as b,
|
|
1239
1239
|
re as c,
|
|
1240
1240
|
Te as d,
|
|
@@ -1242,11 +1242,11 @@ export {
|
|
|
1242
1242
|
ge as f,
|
|
1243
1243
|
fe as g,
|
|
1244
1244
|
be as h,
|
|
1245
|
-
|
|
1246
|
-
|
|
1245
|
+
ye as i,
|
|
1246
|
+
yt as j,
|
|
1247
1247
|
te as k,
|
|
1248
1248
|
ve as l,
|
|
1249
1249
|
Ne as s,
|
|
1250
1250
|
Zt as u
|
|
1251
1251
|
};
|
|
1252
|
-
//# sourceMappingURL=calendar.
|
|
1252
|
+
//# sourceMappingURL=calendar.BRsV4rkQ.js.map
|