@adyen/bento-vue2 1.47.0 → 1.48.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/components.d.ts +4 -0
- package/dist/@types/index.d.ts +347 -112
- 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/chip.css +1 -0
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -0
- package/dist/assets/input-field.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/popover.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid-item-custom.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +5 -0
- package/dist/chip.js.map +1 -0
- package/dist/chunks/{action-bar.EcN2I7Az.js → action-bar.CSgrrcK0.js} +5 -5
- package/dist/chunks/{action-bar.EcN2I7Az.js.map → action-bar.CSgrrcK0.js.map} +1 -1
- package/dist/chunks/{alert.BRN8cpXl.js → alert.hiTIDSeX.js} +2 -2
- package/dist/chunks/{alert.BRN8cpXl.js.map → alert.hiTIDSeX.js.map} +1 -1
- package/dist/chunks/{base-modal.BgTZ8iQ6.js → base-modal.47Xa68h9.js} +4 -4
- package/dist/chunks/{base-modal.BgTZ8iQ6.js.map → base-modal.47Xa68h9.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.C8EjGVCT.js → button-actions-with-menu.D13mJiKO.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.C8EjGVCT.js.map → button-actions-with-menu.D13mJiKO.js.map} +1 -1
- package/dist/chunks/{button-actions.BU173IFE.js → button-actions.BovYBINL.js} +2 -2
- package/dist/chunks/{button-actions.BU173IFE.js.map → button-actions.BovYBINL.js.map} +1 -1
- package/dist/chunks/{button.BX6ZJxF7.js → button.CdAFZa4V.js} +2 -2
- package/dist/chunks/{button.BX6ZJxF7.js.map → button.CdAFZa4V.js.map} +1 -1
- package/dist/chunks/{calendar.DlOcbH6E.js → calendar.Bb0-Svhx.js} +4 -4
- package/dist/chunks/{calendar.DlOcbH6E.js.map → calendar.Bb0-Svhx.js.map} +1 -1
- package/dist/chunks/{card.DoyCGJay.js → card.D-w9c3-n.js} +2 -2
- package/dist/chunks/{card.DoyCGJay.js.map → card.D-w9c3-n.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BQN9gjgH.js → checkbox-group.BXfJo9NR.js} +2 -2
- package/dist/chunks/{checkbox-group.BQN9gjgH.js.map → checkbox-group.BXfJo9NR.js.map} +1 -1
- package/dist/chunks/{checkbox.O1CbmNdS.js → checkbox.BEHpJDrF.js} +18 -18
- package/dist/chunks/{checkbox.O1CbmNdS.js.map → checkbox.BEHpJDrF.js.map} +1 -1
- package/dist/chunks/chip.HNUA9VZl.js +63 -0
- package/dist/chunks/chip.HNUA9VZl.js.map +1 -0
- package/dist/chunks/{code-snippet.BDBD85qD.js → code-snippet.CUx6b252.js} +6 -6
- package/dist/chunks/{code-snippet.BDBD85qD.js.map → code-snippet.CUx6b252.js.map} +1 -1
- package/dist/chunks/{codemirror.0fz2cWJS.js → codemirror.Zv80n3Z2.js} +13 -14
- package/dist/chunks/{codemirror.0fz2cWJS.js.map → codemirror.Zv80n3Z2.js.map} +1 -1
- package/dist/chunks/{copy.BuMSGw23.js → copy.adSQlAOY.js} +2 -2
- package/dist/chunks/{copy.BuMSGw23.js.map → copy.adSQlAOY.js.map} +1 -1
- package/dist/chunks/{country.2-ZtYkh7.js → country.Df7erZov.js} +22 -21
- package/dist/chunks/{country.2-ZtYkh7.js.map → country.Df7erZov.js.map} +1 -1
- package/dist/chunks/country.types.C0Q_hhgJ.js +269 -0
- package/dist/chunks/country.types.C0Q_hhgJ.js.map +1 -0
- package/dist/chunks/{currency.BmI4Sqy5.js → currency.B1F9YOIx.js} +2 -2
- package/dist/chunks/{currency.BmI4Sqy5.js.map → currency.B1F9YOIx.js.map} +1 -1
- package/dist/chunks/{dashboard-section.COWO5SVw.js → dashboard-section.q1XXEUZc.js} +3 -3
- package/dist/chunks/{dashboard-section.COWO5SVw.js.map → dashboard-section.q1XXEUZc.js.map} +1 -1
- package/dist/chunks/{dashed-underline.BEAEmTCb.js → dashed-underline.CpVP3VDL.js} +2 -2
- package/dist/chunks/{dashed-underline.BEAEmTCb.js.map → dashed-underline.CpVP3VDL.js.map} +1 -1
- package/dist/chunks/{data-grid-template.vBl7u2cB.js → data-grid-template.kCxfVaW7.js} +3 -3
- package/dist/chunks/{data-grid-template.vBl7u2cB.js.map → data-grid-template.kCxfVaW7.js.map} +1 -1
- package/dist/chunks/{data-grid.DQ0578m9.js → data-grid.DgxC3G4n.js} +492 -487
- package/dist/chunks/data-grid.DgxC3G4n.js.map +1 -0
- package/dist/chunks/{date-picker.Bym2OEd9.js → date-picker.DqsQJ7P7.js} +4 -4
- package/dist/chunks/{date-picker.Bym2OEd9.js.map → date-picker.DqsQJ7P7.js.map} +1 -1
- package/dist/chunks/date-range-picker.VZlIz83o.js +884 -0
- package/dist/chunks/date-range-picker.VZlIz83o.js.map +1 -0
- package/dist/chunks/{date.1zs9CRhw.js → date.YLIcAerL.js} +69 -1
- package/dist/chunks/{date.1zs9CRhw.js.map → date.YLIcAerL.js.map} +1 -1
- package/dist/chunks/{dialog-page.DcJ7LaOE.js → dialog-page.Bf07JxdG.js} +2 -2
- package/dist/chunks/{dialog-page.DcJ7LaOE.js.map → dialog-page.Bf07JxdG.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CiCDvGyN.js → dropdown-tag.BLAjuup5.js} +6 -6
- package/dist/chunks/{dropdown-tag.CiCDvGyN.js.map → dropdown-tag.BLAjuup5.js.map} +1 -1
- package/dist/chunks/{dropdown.hc9ZuuTt.js → dropdown.DWgwNFNB.js} +4 -4
- package/dist/chunks/{dropdown.hc9ZuuTt.js.map → dropdown.DWgwNFNB.js.map} +1 -1
- package/dist/chunks/{empty-state.1TyzB5ju.js → empty-state.BnHTBgKG.js} +2 -2
- package/dist/chunks/{empty-state.1TyzB5ju.js.map → empty-state.BnHTBgKG.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.DVyryYaq.js → file-uploader.DT7GsNqI.js} +4 -4
- package/dist/chunks/{file-uploader.DVyryYaq.js.map → file-uploader.DT7GsNqI.js.map} +1 -1
- package/dist/chunks/{filter-bar.DzcNo5nF.js → filter-bar.D2YR4Tpz.js} +103 -105
- package/dist/chunks/filter-bar.D2YR4Tpz.js.map +1 -0
- package/dist/chunks/{fixed-scroller.IPM3AzHS.js → fixed-scroller.DX2YUuoU.js} +2 -2
- package/dist/chunks/{fixed-scroller.IPM3AzHS.js.map → fixed-scroller.DX2YUuoU.js.map} +1 -1
- package/dist/chunks/{footer-actions.Cbe_YLjP.js → footer-actions.BsoofCrv.js} +3 -3
- package/dist/chunks/{footer-actions.Cbe_YLjP.js.map → footer-actions.BsoofCrv.js.map} +1 -1
- package/dist/chunks/{form-layout-title.Xdsi84v2.js → form-layout-title.CJbgfh3P.js} +2 -2
- package/dist/chunks/{form-layout-title.Xdsi84v2.js.map → form-layout-title.CJbgfh3P.js.map} +1 -1
- package/dist/chunks/get-slot-text.BQS5Olxm.js +12 -0
- package/dist/chunks/get-slot-text.BQS5Olxm.js.map +1 -0
- package/dist/chunks/{header.BIZTUAJE.js → header.D5MLt9hG.js} +4 -4
- package/dist/chunks/{header.BIZTUAJE.js.map → header.D5MLt9hG.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.Bly2e0uy.js → info-icon-with-popover.CO0mky_N.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.Bly2e0uy.js.map → info-icon-with-popover.CO0mky_N.js.map} +1 -1
- package/dist/chunks/{input-field-password.CosL-n__.js → input-field-password.CQtzruQM.js} +4 -4
- package/dist/chunks/{input-field-password.CosL-n__.js.map → input-field-password.CQtzruQM.js.map} +1 -1
- package/dist/chunks/input-field-phone-number.DWKZy2-k.js +3098 -0
- package/dist/chunks/input-field-phone-number.DWKZy2-k.js.map +1 -0
- package/dist/chunks/{input-field.DgDFJbg7.js → input-field.3V5IblWw.js} +31 -26
- package/dist/chunks/input-field.3V5IblWw.js.map +1 -0
- package/dist/chunks/{inspector.types.8071wkf0.js → inspector.types.GOl_-hXm.js} +2 -2
- package/dist/chunks/{inspector.types.8071wkf0.js.map → inspector.types.GOl_-hXm.js.map} +1 -1
- package/dist/chunks/{keyboard-navigation.Clz1jOaA.js → keyboard-navigation.pB8weElW.js} +2 -1
- package/dist/chunks/{keyboard-navigation.Clz1jOaA.js.map → keyboard-navigation.pB8weElW.js.map} +1 -1
- package/dist/chunks/{link.UOEUR35A.js → link.DZlbzVSB.js} +35 -28
- package/dist/chunks/link.DZlbzVSB.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.Co0ycEdQ.js → listbox-option-tag.XbvBQqlt.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Co0ycEdQ.js.map → listbox-option-tag.XbvBQqlt.js.map} +1 -1
- package/dist/chunks/{menu.Dq7RlryT.js → menu.DYopJZ12.js} +3 -3
- package/dist/chunks/{menu.Dq7RlryT.js.map → menu.DYopJZ12.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CfrgVR_K.js → modal-fullscreen.Pp5mp7hD.js} +4 -4
- package/dist/chunks/{modal-fullscreen.CfrgVR_K.js.map → modal-fullscreen.Pp5mp7hD.js.map} +1 -1
- package/dist/chunks/{modal.CuUUMIU_.js → modal.CCjAy7Hv.js} +5 -5
- package/dist/chunks/{modal.CuUUMIU_.js.map → modal.CCjAy7Hv.js.map} +1 -1
- package/dist/chunks/{pagination.QF1EEUfX.js → pagination.8g4bC4tv.js} +3 -3
- package/dist/chunks/{pagination.QF1EEUfX.js.map → pagination.8g4bC4tv.js.map} +1 -1
- package/dist/chunks/{payment-method.UaERFtej.js → payment-method.BKr_q5cZ.js} +2 -2
- package/dist/chunks/{payment-method.UaERFtej.js.map → payment-method.BKr_q5cZ.js.map} +1 -1
- package/dist/chunks/{popover.nev0GndY.js → popover.C-LwO38X.js} +3 -3
- package/dist/chunks/{popover.nev0GndY.js.map → popover.C-LwO38X.js.map} +1 -1
- package/dist/chunks/{promo-banner.BXtIM4C9.js → promo-banner.DS0_aROF.js} +2 -2
- package/dist/chunks/{promo-banner.BXtIM4C9.js.map → promo-banner.DS0_aROF.js.map} +1 -1
- package/dist/chunks/{radio-group.D1q0VKvv.js → radio-group.1z-IZvLU.js} +3 -3
- package/dist/chunks/{radio-group.D1q0VKvv.js.map → radio-group.1z-IZvLU.js.map} +1 -1
- package/dist/chunks/{search-bar.fmMx-zRN.js → search-bar.Bu12OC-l.js} +3 -3
- package/dist/chunks/{search-bar.fmMx-zRN.js.map → search-bar.Bu12OC-l.js.map} +1 -1
- package/dist/chunks/{secondary-nav.ldVrzGbB.js → secondary-nav.CLDlWCXX.js} +2 -2
- package/dist/chunks/{secondary-nav.ldVrzGbB.js.map → secondary-nav.CLDlWCXX.js.map} +1 -1
- package/dist/chunks/{segmented-control.DL0W7lJ_.js → segmented-control.BJIlas0M.js} +17 -16
- package/dist/chunks/segmented-control.BJIlas0M.js.map +1 -0
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.CdkrhyZV.js → selection-card-group.usHcqYKO.js} +8 -8
- package/dist/chunks/{selection-card-group.CdkrhyZV.js.map → selection-card-group.usHcqYKO.js.map} +1 -1
- package/dist/chunks/{sidepanel.D-KuHnwI.js → sidepanel.C_ff-PEn.js} +4 -4
- package/dist/chunks/{sidepanel.D-KuHnwI.js.map → sidepanel.C_ff-PEn.js.map} +1 -1
- package/dist/chunks/{status.types.Ce018tQy.js → status.types.p_TCvoo0.js} +16 -17
- package/dist/chunks/{status.types.Ce018tQy.js.map → status.types.p_TCvoo0.js.map} +1 -1
- package/dist/chunks/{step.BsIdWhaZ.js → step.DrP2Frvn.js} +2 -2
- package/dist/chunks/{step.BsIdWhaZ.js.map → step.DrP2Frvn.js.map} +1 -1
- package/dist/chunks/{structured-list-item.Dk8Z-FPn.js → structured-list-item.TC8mVrrA.js} +3 -3
- package/dist/chunks/{structured-list-item.Dk8Z-FPn.js.map → structured-list-item.TC8mVrrA.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.atXX3GY9.js → summary-grid-item-custom.A11AzfH0.js} +109 -104
- package/dist/chunks/summary-grid-item-custom.A11AzfH0.js.map +1 -0
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js +6 -0
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js.map +1 -0
- package/dist/chunks/{tabs.9kObZry9.js → tabs.5zgaD1k3.js} +2 -2
- package/dist/chunks/{tabs.9kObZry9.js.map → tabs.5zgaD1k3.js.map} +1 -1
- package/dist/chunks/{tag.-YNhsBv7.js → tag.3fthBtwc.js} +2 -2
- package/dist/chunks/{tag.-YNhsBv7.js.map → tag.3fthBtwc.js.map} +1 -1
- package/dist/chunks/{textarea.BVzGn3zO.js → textarea.CpXux8qX.js} +2 -2
- package/dist/chunks/{textarea.BVzGn3zO.js.map → textarea.CpXux8qX.js.map} +1 -1
- package/dist/chunks/{timeline-item.D_YNHlRi.js → timeline-item.Ca9RJt0z.js} +8 -8
- package/dist/chunks/{timeline-item.D_YNHlRi.js.map → timeline-item.Ca9RJt0z.js.map} +1 -1
- package/dist/chunks/{toast.DgJbW9CL.js → toast.C5I7Wsfa.js} +2 -2
- package/dist/chunks/{toast.DgJbW9CL.js.map → toast.C5I7Wsfa.js.map} +1 -1
- package/dist/chunks/{toggle-button.Cf8C7p6e.js → toggle-button.BX_9vB0d.js} +2 -2
- package/dist/chunks/{toggle-button.Cf8C7p6e.js.map → toggle-button.BX_9vB0d.js.map} +1 -1
- package/dist/chunks/{toggle.CnS7qszG.js → toggle.CyaY0U0K.js} +2 -2
- package/dist/chunks/{toggle.CnS7qszG.js.map → toggle.CyaY0U0K.js.map} +1 -1
- package/dist/chunks/truncate.BfIl_-71.js +8 -0
- package/dist/chunks/truncate.BfIl_-71.js.map +1 -0
- package/dist/chunks/{tutorial.cQXPvqV4.js → tutorial.Cc0tv59x.js} +4 -4
- package/dist/chunks/{tutorial.cQXPvqV4.js.map → tutorial.Cc0tv59x.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BGlHmPhX.js → use-cached-selected-values.C24AnZ-w.js} +5 -5
- package/dist/chunks/{use-cached-selected-values.BGlHmPhX.js.map → use-cached-selected-values.C24AnZ-w.js.map} +1 -1
- package/dist/chunks/use-country-items.HFnjuDsG.js +30 -0
- package/dist/chunks/{use-country-items.eWARMT6I.js.map → use-country-items.HFnjuDsG.js.map} +1 -1
- package/dist/chunks/{country.types.CLjbulKL.js → use-country-phon-code.DVgE19zT.js} +497 -761
- package/dist/chunks/use-country-phon-code.DVgE19zT.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +7 -6
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/dropdown.js +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/form-layout.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +217 -212
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +5 -0
- package/dist/input-field-phone-number.js.map +1 -0
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +9 -9
- 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/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/status.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +15 -1
- package/dist/styles/bento-light.css +15 -1
- package/dist/styles/bento.css +15 -1
- package/dist/styles/legacy.css +14 -0
- package/dist/styles/styleguide.css +15 -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/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +263 -5
- package/package.json +6 -5
- package/dist/chunks/country.types.CLjbulKL.js.map +0 -1
- package/dist/chunks/data-grid.DQ0578m9.js.map +0 -1
- package/dist/chunks/date-range-picker.P2Q5FNB-.js +0 -840
- package/dist/chunks/date-range-picker.P2Q5FNB-.js.map +0 -1
- package/dist/chunks/filter-bar.DzcNo5nF.js.map +0 -1
- package/dist/chunks/get-slot-text.Cgn-E48s.js +0 -9
- package/dist/chunks/get-slot-text.Cgn-E48s.js.map +0 -1
- package/dist/chunks/input-field.DgDFJbg7.js.map +0 -1
- package/dist/chunks/link.UOEUR35A.js.map +0 -1
- package/dist/chunks/segmented-control.DL0W7lJ_.js.map +0 -1
- package/dist/chunks/summary-grid-item-custom.atXX3GY9.js.map +0 -1
- package/dist/chunks/summary-grid.keys.BBbFrFGF.js +0 -5
- package/dist/chunks/summary-grid.keys.BBbFrFGF.js.map +0 -1
- package/dist/chunks/use-country-items.eWARMT6I.js +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.BsIdWhaZ.js","sources":["../../src/components/stepper/composables/use-keyboard-navigation/use-keyboard-navigation.ts","../../src/components/stepper/composables/use-step-register/use-step-register.ts","../../src/components/stepper/stepper.keys.ts","../../src/components/stepper/stepper.types.ts","../../src/components/stepper/stepper.vue","../../src/components/stepper/components/step/step.vue"],"sourcesContent":["import { Ref, UnwrapRef } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<UnwrapRef<HTMLButtonElement[]>>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { Ref, UnwrapRef } from 'vue';\nimport type { BentoStepperStepExposeState } from '../../stepper.types';\n\n/**\n * Gets the position of a `bento-step` element within its `bento-stepper` parent.\n * @param stepState The `bento-step` state.\n * @returns The index of the element.\n */\nconst getStepPosition = (stepState: BentoStepperStepExposeState) => {\n // Button is wrapped by <li> element\n const listItemElement = (stepState.buttonElement as Ref<UnwrapRef<HTMLButtonElement>>).value.parentElement;\n const listElement = listItemElement.parentElement;\n return Array.from(listElement.children).indexOf(listItemElement);\n};\n\n/**\n * Provides methods to register/unregister `bento-step` elements to/from the `bento-stepper` step state.\n * These methods allow for tracking the child step elements, including their position in the DOM tree.\n * @param childrenSteps The `bento-stepper` (or `bento-step` if substeps) step state.\n */\nexport const useStepRegister = (childrenSteps: Ref<BentoStepperStepExposeState[]>) => {\n /**\n * Registers a step's HTML element in the stepper state.\n * Should be called by a `bento-step` when it is mounted.\n * @param stepState The `bento-step` state.\n */\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n const position = getStepPosition(stepState);\n childrenSteps.value.splice(position, 0, {\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n /**\n * Unregisters a step's HTML element in the stepper state.\n * Should be called by a `bento-step` before it is unmounted.\n * @param stepState The `bento-step` state.\n */\n const removeStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.splice(\n childrenSteps.value.findIndex(step => step.buttonElement === stepState.buttonElement.value),\n 1\n );\n };\n\n return { registerStep, removeStep };\n};\n","export const STEPPER_STATE = Symbol('stepper state');\n","import type { ComputedRef, Ref, UnwrapRef } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<UnwrapRef<HTMLButtonElement>>;\n substeps: BentoStepperStepExposeState[] | Ref<BentoStepperStepExposeState[]>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: HTMLElement[];\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n removeStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', { currentIndex: activeStepIndex + 1, totalSteps: stepsAmount, content: currentStepContent })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, type DeepReadonly, PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation, useStepRegister } from './composables';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:index\"]);\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<BentoStepperStepExposeState[]>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n const { registerStep, removeStep } = useStepRegister(childrenSteps);\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n removeStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide<DeepReadonly<BentoStepperState>>(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","<template>\n <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onBeforeUnmount, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { useStepRegister } from '../../composables';\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { Booleanish } from '@/types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:substep-index\"]);\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<BentoStepperStepExposeState[]>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject<BentoStepperState>(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const { registerStep, removeStep } = useStepRegister(substeps);\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep,\n removeStep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n onBeforeUnmount(() => {\n stepper.value.removeStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","getStepPosition","stepState","listItemElement","listElement","useStepRegister","childrenSteps","position","step","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","useI18n","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","registerStep","removeStep","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","onMounted","onBeforeUnmount","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,MAAA;;AACI,MAAAA,EAAA,eAAA;AAEA,YAAAC,IAAAJ,EAAA,MAAA,QAAA,SAAA,aAAA;AACA,MAAAI,IAAA,MAIAC,IAAAL,EAAA,MAAAI,IAAAF,CAAA,MAAA,QAAAG,EAAA;AAAA,IAA+C;AAAA,EACnD;AAGJ,QAAAC,IAAAL,EAAA,EAAA,GACAM,IAAAN,EAAA,CAAA;AAEA,SAAA;AAAA,IAAO,CAAAO,EAAA,UAAA,GAAAD;AAAA,IAC+C,CAAAC,EAAA,WAAA,GAAAD;AAAA,IACC,CAAAC,EAAA,QAAA,GAAAF;AAAA,IACH,CAAAE,EAAA,UAAA,GAAAF;AAAA,EACE;AAE1D,GC1BAG,IAAA,CAAAC,MAAA;AAEI,QAAAC,IAAAD,EAAA,cAAA,MAAA,eACAE,IAAAD,EAAA;AACA,SAAA,MAAA,KAAAC,EAAA,QAAA,EAAA,QAAAD,CAAA;AACJ,GAOaE,IAAA,CAAAC,OA2BT,EAAA,cArBA,CAAAJ,MAAA;AACI,QAAAK,IAAAN,EAAAC,CAAA;AACA,EAAAI,EAAA,MAAA,OAAAC,GAAA,GAAA;AAAA,IAAwC,aAAAL,EAAA;AAAA,IACb,eAAAA,EAAA;A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AAA,GACAsC,IAAApC;AAAA,MAA0B,MAAAmC,EAAA,SAAAb,EAAA,MAAA,YAAAnC,EAAA,cAAA,CAAA8C,EAAA,SAAAf,EAAA;AAAA,IAKZ,GAEdmB,IAAArC,EAAA,OACIsB,KAAA,gBAAAA,EAAA,MAAA,UAAArC,EAAA,aACIU,EAAA,aAGJ2B,KAAA,gBAAAA,EAAA,MAAA,oBAAAxB,EAAA,KAA+C,GAEnDwC,IAAAtC;AAAA,MAAmB,OAAAsB,KAAA,gBAAAA,EAAA,MAAA,UAAArC,EAAA,UAAAa,EAAA,SAAAwB,KAAA,gBAAAA,EAAA,MAAA;AAAA,IAC6E,GAGhGzB,IAAA,MAAA;AACI,MAAAyC,EAAA,SAIAhB,EAAA,MAAA,eAAAxB,EAAA,KAAA;AAAA,IAAwC,GAI5CyC,IAAAvC,EAAA,MAAAmC,EAAA,QAAA,SAAA,OAAA,GACAK,IAAAxC,EAAA,MAAAsC,EAAA,MAAA,SAAA,CAAA,GACAG,IAAAzC,EAAA,MAAAkC,EAAA,SAAApC,EAAA,UAAA,KAAA,CAAAmC,EAAA,QAAA,MAAA,IAAA,GAEAtB,IAAAX,EAAA,OAAA;AAAA,MAA2C,kBAAAmC,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"step.DrP2Frvn.js","sources":["../../src/components/stepper/composables/use-keyboard-navigation/use-keyboard-navigation.ts","../../src/components/stepper/composables/use-step-register/use-step-register.ts","../../src/components/stepper/stepper.keys.ts","../../src/components/stepper/stepper.types.ts","../../src/components/stepper/stepper.vue","../../src/components/stepper/components/step/step.vue"],"sourcesContent":["import { Ref, UnwrapRef } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<UnwrapRef<HTMLButtonElement[]>>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { Ref, UnwrapRef } from 'vue';\nimport type { BentoStepperStepExposeState } from '../../stepper.types';\n\n/**\n * Gets the position of a `bento-step` element within its `bento-stepper` parent.\n * @param stepState The `bento-step` state.\n * @returns The index of the element.\n */\nconst getStepPosition = (stepState: BentoStepperStepExposeState) => {\n // Button is wrapped by <li> element\n const listItemElement = (stepState.buttonElement as Ref<UnwrapRef<HTMLButtonElement>>).value.parentElement;\n const listElement = listItemElement.parentElement;\n return Array.from(listElement.children).indexOf(listItemElement);\n};\n\n/**\n * Provides methods to register/unregister `bento-step` elements to/from the `bento-stepper` step state.\n * These methods allow for tracking the child step elements, including their position in the DOM tree.\n * @param childrenSteps The `bento-stepper` (or `bento-step` if substeps) step state.\n */\nexport const useStepRegister = (childrenSteps: Ref<BentoStepperStepExposeState[]>) => {\n /**\n * Registers a step's HTML element in the stepper state.\n * Should be called by a `bento-step` when it is mounted.\n * @param stepState The `bento-step` state.\n */\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n const position = getStepPosition(stepState);\n childrenSteps.value.splice(position, 0, {\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n /**\n * Unregisters a step's HTML element in the stepper state.\n * Should be called by a `bento-step` before it is unmounted.\n * @param stepState The `bento-step` state.\n */\n const removeStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.splice(\n childrenSteps.value.findIndex(step => step.buttonElement === stepState.buttonElement.value),\n 1\n );\n };\n\n return { registerStep, removeStep };\n};\n","export const STEPPER_STATE = Symbol('stepper state');\n","import type { ComputedRef, Ref, UnwrapRef } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<UnwrapRef<HTMLButtonElement>>;\n substeps: BentoStepperStepExposeState[] | Ref<BentoStepperStepExposeState[]>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: HTMLElement[];\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n removeStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', { currentIndex: activeStepIndex + 1, totalSteps: stepsAmount, content: currentStepContent })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, type DeepReadonly, PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation, useStepRegister } from './composables';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:index\"]);\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<BentoStepperStepExposeState[]>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n const { registerStep, removeStep } = useStepRegister(childrenSteps);\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n removeStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide<DeepReadonly<BentoStepperState>>(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","<template>\n <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onBeforeUnmount, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { useStepRegister } from '../../composables';\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { Booleanish } from '@/types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:substep-index\"]);\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<BentoStepperStepExposeState[]>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject<BentoStepperState>(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const { registerStep, removeStep } = useStepRegister(substeps);\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep,\n removeStep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n onBeforeUnmount(() => {\n stepper.value.removeStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","getStepPosition","stepState","listItemElement","listElement","useStepRegister","childrenSteps","position","step","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","useI18n","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","registerStep","removeStep","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","onMounted","onBeforeUnmount","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,MAAA;;AACI,MAAAA,EAAA,eAAA;AAEA,YAAAC,IAAAJ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MAAAmC,EAAA,QAAA,SAAA,OAAA,GACAK,IAAAxC,EAAA,MAAAsC,EAAA,MAAA,SAAA,CAAA,GACAG,IAAAzC,EAAA,MAAAkC,EAAA,SAAApC,EAAA,UAAA,KAAA,CAAAmC,EAAA,QAAA,MAAA,IAAA,GAEAtB,IAAAX,EAAA,OAAA;AAAA,MAA2C,kBAAAmC,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as c, inject as n, computed as r, provide as y, ref as b } from "vue";
|
|
2
2
|
import { n as i } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
3
|
-
import { B as v } from "./button.
|
|
3
|
+
import { B as v } from "./button.CdAFZa4V.js";
|
|
4
4
|
import { B as h } from "./info-icon.0d0GzDe2.js";
|
|
5
5
|
import { B as C } from "./typography.J1v_SPG3.js";
|
|
6
|
-
import { C as B } from "./copy.
|
|
6
|
+
import { C as B } from "./copy.adSQlAOY.js";
|
|
7
7
|
import { S as T } from "./search.CBKhp7zB.js";
|
|
8
8
|
import { u as S } from "./i18n.BQkEbtPM.js";
|
|
9
9
|
import { B as I } from "./tooltip.R2sqydIE.js";
|
|
@@ -84,4 +84,4 @@ export {
|
|
|
84
84
|
u as S,
|
|
85
85
|
z as a
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=structured-list-item.
|
|
87
|
+
//# sourceMappingURL=structured-list-item.TC8mVrrA.js.map
|
package/dist/chunks/{structured-list-item.Dk8Z-FPn.js.map → structured-list-item.TC8mVrrA.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-list-item.
|
|
1
|
+
{"version":3,"file":"structured-list-item.TC8mVrrA.js","sources":["../../src/components/structured-list/structured-list.keys.ts","../../src/components/structured-list/structured-list.types.ts","../../src/components/structured-list/structured-list.vue","../../src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = defineProps({\n labelsWidth: { default: null },\n layout: { default: '33-66' }\n});\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps({\n label: null,\n labelInfo: null,\n copy: null,\n search: { type: Function },\n searchTooltip: null,\n truncate: { type: Boolean }\n});\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","isCondensed","inject","computedLayout","computed","props","computedLabelsWidth","provide","__default__","messages","DEFAULT_LABELS_WIDTH","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","labelTypographyVariant"],"mappings":";;;;;;;;;;AAAa,MAAAA,IAAA,OAAA,+CAAA,GACAC,IAAA,OAAA,4CAAA,GCANC,IAAA,CAAA,SAAA,SAAA,SAAA,OAAA,GC6DHC,IAAA,CAAA;;;;;;;;iBA3CAC,IAAAC,EAAAL,GAAA,EAAA,GAEAM,IAAAC;AAAA,MAAuB,MAAAL,EAAA,SAAAM,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EC,IAAAF,EAAA,MACIH,IACI,UAGJI,EAAA,cACI,GAAAA,EAAA,WAAA,OAGJ,GAAAF,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA,CAAA,GAA4C;AAGhD,WAAAI,EAAAT,GAAAQ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;GC+DAE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;iBApDAC,IAAA,OAWA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GACAX,IAAAC,EAAAL,GAAA,EAAA,GACAgB,IAAAX,EAAAJ,GAAAgB,EAAAJ,CAAA,CAAA,GACAK,IAAAX,EAAA,MAAA,cAAAS,EAAA,KAAA,EAAA,GACAG,IAAAZ,EAAA,OAAA;AAAA,MAA2C,qCAAAH;AAAA,IACF,EAAA,GAGzCgB,IAAAb,EAAA,OAAA;AAAA,MAAgD,2CAAAC,EAAA;AAAA,IACK,EAAA,GAGrDa,IAAAd,EAAA,MAAAH,IAAA,YAAA,MAAA;;;;;;;;;;;;;;;;;;"}
|
package/dist/chunks/{summary-grid-item-custom.atXX3GY9.js → summary-grid-item-custom.A11AzfH0.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { S as
|
|
4
|
-
import { G as
|
|
5
|
-
import { n as
|
|
6
|
-
import { B as
|
|
7
|
-
import { B as
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
1
|
+
import { defineComponent as c, provide as g, toRef as O, toRefs as L, inject as M, ref as R, computed as l } from "vue";
|
|
2
|
+
import { u as S } from "./use-has-slot.C9lQZ6nz.js";
|
|
3
|
+
import { S as P, a as T } from "./summary-grid.keys.CxTf_FOc.js";
|
|
4
|
+
import { G as A } from "./grid-layout.HvTAa4to.js";
|
|
5
|
+
import { n as u } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
+
import { B as D } from "./info-icon.0d0GzDe2.js";
|
|
7
|
+
import { B as V, a as v } from "./typography.J1v_SPG3.js";
|
|
8
|
+
import { B as j, a as _ } from "./tag.3fthBtwc.js";
|
|
9
|
+
import { C as B } from "./copy.adSQlAOY.js";
|
|
10
10
|
import "../assets/summary-grid-item-custom.css";
|
|
11
|
-
const
|
|
11
|
+
const G = c({
|
|
12
12
|
name: "bento-summary-grid",
|
|
13
|
-
components: { GridLayout:
|
|
13
|
+
components: { GridLayout: A },
|
|
14
14
|
props: {
|
|
15
15
|
/**
|
|
16
16
|
* Sets the responsive columns widths values for 1 of the 3 rows.
|
|
@@ -18,32 +18,36 @@ const R = l({
|
|
|
18
18
|
columnWidth: {
|
|
19
19
|
type: Object,
|
|
20
20
|
default: null
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Renders a font numeric style with slashed zeros instead of normal ones.
|
|
24
|
+
*/
|
|
25
|
+
slashedZero: { type: Boolean, default: !1 }
|
|
22
26
|
},
|
|
23
27
|
setup(e, { slots: t }) {
|
|
24
|
-
var
|
|
28
|
+
var i, s;
|
|
25
29
|
let r = 1;
|
|
26
30
|
if (t) {
|
|
27
|
-
const
|
|
28
|
-
var
|
|
29
|
-
return parseInt((
|
|
31
|
+
const m = (s = (i = Object.keys(t)) == null ? void 0 : i.filter((d) => d.includes("cell-"))) == null ? void 0 : s.map((d) => {
|
|
32
|
+
var p;
|
|
33
|
+
return parseInt((p = d.split("-")) == null ? void 0 : p[1], 10);
|
|
30
34
|
});
|
|
31
|
-
if (r = Math.max(...
|
|
35
|
+
if (r = Math.max(...m), r > 3)
|
|
32
36
|
throw new Error(
|
|
33
37
|
"BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information."
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
|
-
return
|
|
37
|
-
hasSlot:
|
|
40
|
+
return g(P, () => ({ isSummaryGridLayout: !0 })), g(T, O(e, "slashedZero")), {
|
|
41
|
+
hasSlot: S(t),
|
|
38
42
|
numberOfRows: r
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
});
|
|
42
|
-
var
|
|
46
|
+
var w = function() {
|
|
43
47
|
var t = this, r = t._self._c;
|
|
44
48
|
return t._self._setupProxy, r("div", { staticClass: "b-summary-grid" }, t._l(t.numberOfRows, function(n) {
|
|
45
|
-
var
|
|
46
|
-
return r("grid-layout", { key: `summary-grid-row-${n}`, attrs: { "data-testid": `summary-grid-row-${n}`, "column-width": (
|
|
49
|
+
var i;
|
|
50
|
+
return r("grid-layout", { key: `summary-grid-row-${n}`, attrs: { "data-testid": `summary-grid-row-${n}`, "column-width": (i = t.columnWidth) == null ? void 0 : i[`row${n}`] }, scopedSlots: t._u([t.hasSlot(`cell-${n}-1`) ? { key: "col-1", fn: function() {
|
|
47
51
|
return [t._t(`cell-${n}-1`)];
|
|
48
52
|
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-2`) ? { key: "col-2", fn: function() {
|
|
49
53
|
return [t._t(`cell-${n}-2`)];
|
|
@@ -57,19 +61,19 @@ var V = function() {
|
|
|
57
61
|
return [t._t(`cell-${n}-6`)];
|
|
58
62
|
}, proxy: !0 } : null], null, !0) });
|
|
59
63
|
}), 1);
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
}, k = [], z = /* @__PURE__ */ u(
|
|
65
|
+
G,
|
|
66
|
+
w,
|
|
67
|
+
k,
|
|
64
68
|
!1,
|
|
65
69
|
null,
|
|
66
|
-
"
|
|
70
|
+
"0612378b"
|
|
67
71
|
);
|
|
68
|
-
const
|
|
69
|
-
var
|
|
70
|
-
const
|
|
72
|
+
const bt = z.exports;
|
|
73
|
+
var a = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(a || {}), o = /* @__PURE__ */ ((e) => (e.POSITIVE = "positive", e.NEGATIVE = "negative", e.NEUTRAL = "neutral", e))(o || {}), f = /* @__PURE__ */ ((e) => (e.AMOUNT = "amount", e.PERCENTAGE = "percentage", e.NUMERIC = "numeric", e.TEXT = "text", e.CUSTOM = "custom", e))(f || {});
|
|
74
|
+
const q = c({
|
|
71
75
|
name: "summary-grid-item",
|
|
72
|
-
components: { BentoInfoIcon:
|
|
76
|
+
components: { BentoInfoIcon: D, BentoTypography: V, BentoTag: j, Copy: B },
|
|
73
77
|
props: {
|
|
74
78
|
/**
|
|
75
79
|
* Text to copy to the clipboard
|
|
@@ -103,8 +107,8 @@ const j = l({
|
|
|
103
107
|
// TODO implement logic for Large size
|
|
104
108
|
size: {
|
|
105
109
|
type: String,
|
|
106
|
-
default:
|
|
107
|
-
validator: (e) => Object.values(
|
|
110
|
+
default: a.SMALL,
|
|
111
|
+
validator: (e) => Object.values(a).includes(e)
|
|
108
112
|
},
|
|
109
113
|
/**
|
|
110
114
|
* Shows colored trend label next to text content
|
|
@@ -138,8 +142,8 @@ const j = l({
|
|
|
138
142
|
}
|
|
139
143
|
},
|
|
140
144
|
setup(e, { slots: t }) {
|
|
141
|
-
const { trendDirection: r, secondaryTrendDirection: n, itemType:
|
|
142
|
-
switch (
|
|
145
|
+
const { trendDirection: r, secondaryTrendDirection: n, itemType: i, size: s } = L(e), m = M(T, R(!1)), d = (E) => {
|
|
146
|
+
switch (E) {
|
|
143
147
|
case o.POSITIVE:
|
|
144
148
|
return _.GREEN;
|
|
145
149
|
case o.NEGATIVE:
|
|
@@ -147,41 +151,42 @@ const j = l({
|
|
|
147
151
|
default:
|
|
148
152
|
return _.BLUE;
|
|
149
153
|
}
|
|
150
|
-
},
|
|
151
|
-
medium: s.value ===
|
|
152
|
-
strongest: s.value ===
|
|
153
|
-
wide: s.value ===
|
|
154
|
-
variant:
|
|
155
|
-
})),
|
|
154
|
+
}, p = l(() => d(r.value)), b = l(() => d(n.value)), C = l(() => s.value === a.SMALL ? v.BODY : i.value !== f.TEXT ? v.TITLE : null), I = l(() => ({
|
|
155
|
+
medium: s.value === a.LARGE,
|
|
156
|
+
strongest: s.value === a.SMALL,
|
|
157
|
+
wide: s.value === a.SMALL,
|
|
158
|
+
variant: C.value
|
|
159
|
+
})), h = l(() => e.fitContent ? { width: "fit-content" } : {}), $ = l(() => ({ "b-summary-grid-item--slashed-zero": m.value })), x = l(() => ({
|
|
156
160
|
[`b-summary-grid-item__content-trend--${e.trend}`]: e.trend
|
|
157
161
|
}));
|
|
158
162
|
return {
|
|
159
163
|
// Values
|
|
160
|
-
trendVariant:
|
|
161
|
-
secondaryTrendVariant:
|
|
162
|
-
typographyProps:
|
|
164
|
+
trendVariant: p,
|
|
165
|
+
secondaryTrendVariant: b,
|
|
166
|
+
typographyProps: I,
|
|
163
167
|
// Styles
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
conditionalClasses: $,
|
|
169
|
+
computedStyles: h,
|
|
170
|
+
summaryBarItemTrendConditionalClasses: x,
|
|
166
171
|
// Utils
|
|
167
|
-
hasSlot:
|
|
172
|
+
hasSlot: S(t)
|
|
168
173
|
};
|
|
169
174
|
}
|
|
170
175
|
});
|
|
171
|
-
var
|
|
176
|
+
var N = function() {
|
|
172
177
|
var t = this, r = t._self._c;
|
|
173
|
-
return t._self._setupProxy, r("div", { staticClass: "b-summary-grid-item", style: t.computedStyles }, [r("div", { staticClass: "b-summary-grid-item__header" }, [r("bento-typography", { staticClass: "b-summary-grid-item__title", attrs: { el: "span", variant: "body" } }, [t._v(" " + t._s(t.title) + " ")]), r("div", { staticClass: "b-summary-grid-item__title-icons" }, [t.copy ? r("copy", { staticClass: "b-structured-list__icon", attrs: { text: t.copy } }) : t._e(), t.infoIconTooltipText ? r("bento-info-icon", { staticClass: "b-summary-grid-item__title-tooltip", attrs: { "tooltip-text": t.infoIconTooltipText, "tooltip-position": "top" } }) : t._e()], 1)], 1), r("bento-typography", t._b({ staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-content-typography", el: "span" } }, "bento-typography", t.typographyProps, !1), [t._t("default"), t.trend && t.itemType !== "text" ? r("bento-tag", { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.trendVariant, label: t.trend } }) : t._e()], 2), t.hasSlot("secondary") ? r("bento-typography", { staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-secondary-metric-typography", el: "span", variant: "caption", stronger: "" } }, [t._t("secondary"), t.secondaryTrend ? r("bento-tag", { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.secondaryTrendVariant, label: t.secondaryTrend } }) : t._e()], 2) : t._e()], 1);
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
return t._self._setupProxy, r("div", { staticClass: "b-summary-grid-item", class: t.conditionalClasses, style: t.computedStyles }, [r("div", { staticClass: "b-summary-grid-item__header" }, [r("bento-typography", { staticClass: "b-summary-grid-item__title", attrs: { el: "span", variant: "body" } }, [t._v(" " + t._s(t.title) + " ")]), r("div", { staticClass: "b-summary-grid-item__title-icons" }, [t.copy ? r("copy", { staticClass: "b-structured-list__icon", attrs: { text: t.copy } }) : t._e(), t.infoIconTooltipText ? r("bento-info-icon", { staticClass: "b-summary-grid-item__title-tooltip", attrs: { "tooltip-text": t.infoIconTooltipText, "tooltip-position": "top" } }) : t._e()], 1)], 1), r("bento-typography", t._b({ staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-content-typography", el: "span" } }, "bento-typography", t.typographyProps, !1), [t._t("default"), t.trend && t.itemType !== "text" ? r("bento-tag", { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.trendVariant, label: t.trend } }) : t._e()], 2), t.hasSlot("secondary") ? r("bento-typography", { staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-secondary-metric-typography", el: "span", variant: "caption", stronger: "" } }, [t._t("secondary"), t.secondaryTrend ? r("bento-tag", { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.secondaryTrendVariant, label: t.secondaryTrend } }) : t._e()], 2) : t._e()], 1);
|
|
179
|
+
}, U = [], F = /* @__PURE__ */ u(
|
|
180
|
+
q,
|
|
181
|
+
N,
|
|
182
|
+
U,
|
|
178
183
|
!1,
|
|
179
184
|
null,
|
|
180
|
-
"
|
|
185
|
+
"a6358e03"
|
|
181
186
|
);
|
|
182
|
-
const
|
|
187
|
+
const y = F.exports, Y = c({
|
|
183
188
|
name: "bento-summary-grid-item-amount",
|
|
184
|
-
components: { SummaryGridItem:
|
|
189
|
+
components: { SummaryGridItem: y },
|
|
185
190
|
props: {
|
|
186
191
|
/**
|
|
187
192
|
* Text to copy to the clipboard
|
|
@@ -264,27 +269,27 @@ const p = G.exports, k = l({
|
|
|
264
269
|
*/
|
|
265
270
|
size: {
|
|
266
271
|
type: String,
|
|
267
|
-
default:
|
|
268
|
-
validator: (e) => Object.values(
|
|
272
|
+
default: a.SMALL,
|
|
273
|
+
validator: (e) => Object.values(a).includes(e)
|
|
269
274
|
}
|
|
270
275
|
}
|
|
271
276
|
});
|
|
272
|
-
var
|
|
277
|
+
var Z = function() {
|
|
273
278
|
var t = this, r = t._self._c;
|
|
274
279
|
return t._self._setupProxy, r("summary-grid-item", { staticClass: "b-summary-grid-item-amount", attrs: { "item-type": "amount", "info-icon-tooltip-text": t.infoIconTooltipText, title: t.title, copy: t.copy, "fit-content": t.fitContent, size: t.size, trend: t.trend, "trend-direction": t.trendDirection, "secondary-trend": t.secondaryTrend, "secondary-trend-direction": t.secondaryTrendDirection }, scopedSlots: t._u([t.secondaryMetric ? { key: "secondary", fn: function() {
|
|
275
280
|
return [t._v(" " + t._s(t.secondaryMetric) + " ")];
|
|
276
281
|
}, proxy: !0 } : null], null, !0) }, [r("div", { staticClass: "b-summary-grid-item-amount__content" }, [r("div", [t._v(t._s(t.label))]), t.secondaryLabel ? r("div", { staticClass: "b-summary-grid-item-amount__secondary-label" }, [t._v(t._s(t.secondaryLabel))]) : t._e()])]);
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
}, H = [], W = /* @__PURE__ */ u(
|
|
283
|
+
Y,
|
|
284
|
+
Z,
|
|
285
|
+
H,
|
|
281
286
|
!1,
|
|
282
287
|
null,
|
|
283
288
|
"13717f92"
|
|
284
289
|
);
|
|
285
|
-
const
|
|
290
|
+
const Ct = W.exports, X = c({
|
|
286
291
|
name: "bento-summary-grid-item-numeric",
|
|
287
|
-
components: { SummaryGridItem:
|
|
292
|
+
components: { SummaryGridItem: y },
|
|
288
293
|
props: {
|
|
289
294
|
/**
|
|
290
295
|
* Text to copy to the clipboard
|
|
@@ -360,27 +365,27 @@ const _t = N.exports, U = l({
|
|
|
360
365
|
*/
|
|
361
366
|
size: {
|
|
362
367
|
type: String,
|
|
363
|
-
default:
|
|
364
|
-
validator: (e) => Object.values(
|
|
368
|
+
default: a.SMALL,
|
|
369
|
+
validator: (e) => Object.values(a).includes(e)
|
|
365
370
|
}
|
|
366
371
|
}
|
|
367
372
|
});
|
|
368
|
-
var
|
|
373
|
+
var J = function() {
|
|
369
374
|
var t = this, r = t._self._c;
|
|
370
375
|
return t._self._setupProxy, r("summary-grid-item", { staticClass: "b-summary-grid-item-numeric", attrs: { "item-type": "numeric", "info-icon-tooltip-text": t.infoIconTooltipText, title: t.title, copy: t.copy, "fit-content": t.fitContent, size: t.size, trend: t.trend, "trend-direction": t.trendDirection, "secondary-trend": t.secondaryTrend, "secondary-trend-direction": t.secondaryTrendDirection }, scopedSlots: t._u([t.secondaryMetric ? { key: "secondary", fn: function() {
|
|
371
376
|
return [t._v(" " + t._s(t.secondaryMetric) + " ")];
|
|
372
377
|
}, proxy: !0 } : null], null, !0) }, [t._v(" " + t._s(t.label) + " ")]);
|
|
373
|
-
},
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
378
|
+
}, K = [], Q = /* @__PURE__ */ u(
|
|
379
|
+
X,
|
|
380
|
+
J,
|
|
381
|
+
K,
|
|
377
382
|
!1,
|
|
378
383
|
null,
|
|
379
384
|
null
|
|
380
385
|
);
|
|
381
|
-
const
|
|
386
|
+
const It = Q.exports, tt = c({
|
|
382
387
|
name: "bento-summary-grid-item-percentage",
|
|
383
|
-
components: { SummaryGridItem:
|
|
388
|
+
components: { SummaryGridItem: y },
|
|
384
389
|
props: {
|
|
385
390
|
/**
|
|
386
391
|
* Amount to be shown as the main value
|
|
@@ -456,27 +461,27 @@ const gt = W.exports, X = l({
|
|
|
456
461
|
*/
|
|
457
462
|
size: {
|
|
458
463
|
type: String,
|
|
459
|
-
default:
|
|
460
|
-
validator: (e) => Object.values(
|
|
464
|
+
default: a.SMALL,
|
|
465
|
+
validator: (e) => Object.values(a).includes(e)
|
|
461
466
|
}
|
|
462
467
|
}
|
|
463
468
|
});
|
|
464
|
-
var
|
|
469
|
+
var et = function() {
|
|
465
470
|
var t = this, r = t._self._c;
|
|
466
471
|
return t._self._setupProxy, r("summary-grid-item", { staticClass: "b-summary-grid-item-percentage", attrs: { "item-type": "percentage", "info-icon-tooltip-text": t.infoIconTooltipText, title: t.title, copy: t.copy, "fit-content": t.fitContent, size: t.size, trend: t.trend, "trend-direction": t.trendDirection, "secondary-trend": t.secondaryTrend, "secondary-trend-direction": t.secondaryTrendDirection }, scopedSlots: t._u([t.secondaryMetric ? { key: "secondary", fn: function() {
|
|
467
472
|
return [t._v(" " + t._s(t.secondaryMetric) + "% ")];
|
|
468
473
|
}, proxy: !0 } : null], null, !0) }, [t._v(" " + t._s(t.label) + "% ")]);
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
474
|
+
}, rt = [], nt = /* @__PURE__ */ u(
|
|
475
|
+
tt,
|
|
476
|
+
et,
|
|
477
|
+
rt,
|
|
473
478
|
!1,
|
|
474
479
|
null,
|
|
475
480
|
null
|
|
476
481
|
);
|
|
477
|
-
const
|
|
482
|
+
const ht = nt.exports, ot = c({
|
|
478
483
|
name: "bento-summary-grid-item-text",
|
|
479
|
-
components: { SummaryGridItem:
|
|
484
|
+
components: { SummaryGridItem: y },
|
|
480
485
|
props: {
|
|
481
486
|
/**
|
|
482
487
|
* Text to copy to the clipboard
|
|
@@ -512,20 +517,20 @@ const vt = K.exports, Q = l({
|
|
|
512
517
|
}
|
|
513
518
|
}
|
|
514
519
|
});
|
|
515
|
-
var
|
|
520
|
+
var at = function() {
|
|
516
521
|
var t = this, r = t._self._c;
|
|
517
522
|
return t._self._setupProxy, r("summary-grid-item", { staticClass: "b-summary-grid-item-text", attrs: { "item-type": "text", "info-icon-tooltip-text": t.infoIconTooltipText, title: t.title, copy: t.copy, "fit-content": t.fitContent } }, [t._v(" " + t._s(t.label) + " ")]);
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
}, it = [], st = /* @__PURE__ */ u(
|
|
524
|
+
ot,
|
|
525
|
+
at,
|
|
526
|
+
it,
|
|
522
527
|
!1,
|
|
523
528
|
null,
|
|
524
529
|
null
|
|
525
530
|
);
|
|
526
|
-
const
|
|
531
|
+
const $t = st.exports, lt = c({
|
|
527
532
|
name: "bento-summary-grid-item-custom",
|
|
528
|
-
components: { SummaryGridItem:
|
|
533
|
+
components: { SummaryGridItem: y },
|
|
529
534
|
props: {
|
|
530
535
|
/**
|
|
531
536
|
* Text to copy to the clipboard
|
|
@@ -546,28 +551,28 @@ const St = et.exports, rt = l({
|
|
|
546
551
|
},
|
|
547
552
|
emits: ["copy-to-clipboard"]
|
|
548
553
|
});
|
|
549
|
-
var
|
|
554
|
+
var ct = function() {
|
|
550
555
|
var t = this, r = t._self._c;
|
|
551
556
|
return t._self._setupProxy, r("summary-grid-item", { attrs: { title: t.title, "info-icon-tooltip-text": t.infoIconTooltipText, copy: t.copy, "fit-content": t.fitContent }, on: { "copy-to-clipoard": function(n) {
|
|
552
557
|
return t.$emit("copy-to-clipboard");
|
|
553
558
|
} } }, [t._t("default")], 2);
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
559
|
+
}, ut = [], dt = /* @__PURE__ */ u(
|
|
560
|
+
lt,
|
|
561
|
+
ct,
|
|
562
|
+
ut,
|
|
558
563
|
!1,
|
|
559
564
|
null,
|
|
560
565
|
null
|
|
561
566
|
);
|
|
562
|
-
const
|
|
567
|
+
const xt = dt.exports;
|
|
563
568
|
export {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
569
|
+
a as B,
|
|
570
|
+
Ct as a,
|
|
571
|
+
It as b,
|
|
572
|
+
ht as c,
|
|
573
|
+
$t as d,
|
|
574
|
+
xt as e,
|
|
570
575
|
o as f,
|
|
571
|
-
|
|
576
|
+
bt as s
|
|
572
577
|
};
|
|
573
|
-
//# sourceMappingURL=summary-grid-item-custom.
|
|
578
|
+
//# sourceMappingURL=summary-grid-item-custom.A11AzfH0.js.map
|