@adyen/bento-vue2 1.91.0 → 1.92.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 +118 -127
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- 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/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.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/use-cached-selected-values.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.Dj830k6L.js → action-bar.ChuPTyQG.js} +3 -3
- package/dist/chunks/{action-bar.Dj830k6L.js.map → action-bar.ChuPTyQG.js.map} +1 -1
- package/dist/chunks/{ai-tag.AyG2UWCB.js → ai-tag.Dt8nijLW.js} +2 -2
- package/dist/chunks/{ai-tag.AyG2UWCB.js.map → ai-tag.Dt8nijLW.js.map} +1 -1
- package/dist/chunks/{alert.CXRb-Smf.js → alert.CLqcPN0Q.js} +73 -55
- package/dist/chunks/alert.CLqcPN0Q.js.map +1 -0
- package/dist/chunks/{base-modal.C52VMtnd.js → base-modal.DMdzcBrq.js} +3 -3
- package/dist/chunks/base-modal.DMdzcBrq.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.OsPQ-POD.js → button-actions-with-menu.CXFziNUr.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.OsPQ-POD.js.map → button-actions-with-menu.CXFziNUr.js.map} +1 -1
- package/dist/chunks/{button-actions.Bdbu0bvt.js → button-actions.CXD6_9qN.js} +4 -4
- package/dist/chunks/button-actions.CXD6_9qN.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/button.C9b2AC9w.js.map +1 -1
- package/dist/chunks/{calendar.CqsfThnC.js → calendar.rZsIZPxm.js} +526 -466
- package/dist/chunks/calendar.rZsIZPxm.js.map +1 -0
- package/dist/chunks/{card.8z7UQeVK.js → card.Brma5kdb.js} +2 -2
- package/dist/chunks/card.Brma5kdb.js.map +1 -0
- package/dist/chunks/{checkbox-group.Dur2Edtw.js → checkbox-group.DWZvFkjz.js} +4 -4
- package/dist/chunks/checkbox-group.DWZvFkjz.js.map +1 -0
- package/dist/chunks/{checkbox.vNjt6QDJ.js → checkbox.BZP0wtnE.js} +3 -5
- package/dist/chunks/checkbox.BZP0wtnE.js.map +1 -0
- package/dist/chunks/{code-snippet.BVpFBhKq.js → code-snippet.DHAymIXp.js} +3 -3
- package/dist/chunks/code-snippet.DHAymIXp.js.map +1 -0
- package/dist/chunks/constructNow.CK0ryPil.js +8 -0
- package/dist/chunks/{constructNow.CIc7d13I.js.map → constructNow.CK0ryPil.js.map} +1 -1
- package/dist/chunks/country.types.jjXwaoMl.js.map +1 -1
- package/dist/chunks/{dashboard-section.DNxNVV44.js → dashboard-section.D9rS8myE.js} +2 -2
- package/dist/chunks/{dashboard-section.DNxNVV44.js.map → dashboard-section.D9rS8myE.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DL2_sik5.js → dashed-underline.D_FhFRXM.js} +2 -2
- package/dist/chunks/{dashed-underline.DL2_sik5.js.map → dashed-underline.D_FhFRXM.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BFv1zr6g.js → data-grid-template.CRijG20n.js} +2 -2
- package/dist/chunks/{data-grid-template.BFv1zr6g.js.map → data-grid-template.CRijG20n.js.map} +1 -1
- package/dist/chunks/{data-grid.ZHY5EzP3.js → data-grid.hMM9F36T.js} +363 -363
- package/dist/chunks/data-grid.hMM9F36T.js.map +1 -0
- package/dist/chunks/{date-picker.kl6aFlr1.js → date-picker.BSo6Cvum.js} +7 -7
- package/dist/chunks/{date-picker.kl6aFlr1.js.map → date-picker.BSo6Cvum.js.map} +1 -1
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{date-range-picker.LCWVAa5R.js → date-range-picker.D90k5b8p.js} +419 -411
- package/dist/chunks/date-range-picker.D90k5b8p.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{de.BJvo6njq.js → de.pvjpUJ1o.js} +2 -2
- package/dist/chunks/{de.BJvo6njq.js.map → de.pvjpUJ1o.js.map} +1 -1
- package/dist/chunks/{differenceInMonths.CIYECBxK.js → differenceInMonths.CpwVtHZX.js} +3 -2
- package/dist/chunks/{differenceInMonths.CIYECBxK.js.map → differenceInMonths.CpwVtHZX.js.map} +1 -1
- package/dist/chunks/{draggable-handle.Ba28eM8o.js → draggable-handle.BR_aQH5N.js} +2 -2
- package/dist/chunks/{draggable-handle.Ba28eM8o.js.map → draggable-handle.BR_aQH5N.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.B61hPq5n.js → dropdown-tag.z3rsxbpW.js} +4 -4
- package/dist/chunks/dropdown-tag.z3rsxbpW.js.map +1 -0
- package/dist/chunks/{dropdown.Ca-f8tdX.js → dropdown.BYJwx-JD.js} +313 -305
- package/dist/chunks/dropdown.BYJwx-JD.js.map +1 -0
- package/dist/chunks/{en-GB.C3-QUpva.js → en-GB.-Q7Oq-nY.js} +2 -2
- package/dist/chunks/{en-GB.C3-QUpva.js.map → en-GB.-Q7Oq-nY.js.map} +1 -1
- package/dist/chunks/{en-US.YeSsZuOc.js → en-US.BK5uiAND.js} +5 -5
- package/dist/chunks/{en-US.YeSsZuOc.js.map → en-US.BK5uiAND.js.map} +1 -1
- package/dist/chunks/{es.DyUjjSL8.js → es.2H4LvTyV.js} +2 -2
- package/dist/chunks/{es.DyUjjSL8.js.map → es.2H4LvTyV.js.map} +1 -1
- package/dist/chunks/{file-uploader.DeWmLpfp.js → file-uploader.Djl0xaDN.js} +4 -5
- package/dist/chunks/{file-uploader.DeWmLpfp.js.map → file-uploader.Djl0xaDN.js.map} +1 -1
- package/dist/chunks/{filter-bar.Bd4ghW_B.js → filter-bar.C9rWMIWO.js} +50 -50
- package/dist/chunks/filter-bar.C9rWMIWO.js.map +1 -0
- package/dist/chunks/{footer-actions.CvUaoMzj.js → footer-actions.D9mHwk5l.js} +2 -2
- package/dist/chunks/{footer-actions.CvUaoMzj.js.map → footer-actions.D9mHwk5l.js.map} +1 -1
- package/dist/chunks/{form-layout-title.DzGajv4U.js → form-layout-title.zZVLCyqe.js} +2 -2
- package/dist/chunks/{form-layout-title.DzGajv4U.js.map → form-layout-title.zZVLCyqe.js.map} +1 -1
- package/dist/chunks/{fr.JD_4GwS8.js → fr.Cu0IIfBP.js} +2 -2
- package/dist/chunks/{fr.JD_4GwS8.js.map → fr.Cu0IIfBP.js.map} +1 -1
- package/dist/chunks/{header-meta.AXUGoqDd.js → header-meta.BSPnWWmi.js} +14 -14
- package/dist/chunks/{header-meta.AXUGoqDd.js.map → header-meta.BSPnWWmi.js.map} +1 -1
- package/dist/chunks/{header-with-views.Ba4dswJF.js → header-with-views.g6J7x6l2.js} +8 -8
- package/dist/chunks/{header-with-views.Ba4dswJF.js.map → header-with-views.g6J7x6l2.js.map} +1 -1
- package/dist/chunks/{header.C7B7RBib.js → header.DyZG7qWe.js} +3 -3
- package/dist/chunks/header.DyZG7qWe.js.map +1 -0
- package/dist/chunks/{input-field-password.BNAtIn_D.js → input-field-password.CiDdI6A_.js} +4 -4
- package/dist/chunks/input-field-password.CiDdI6A_.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.CEYx1s4b.js → input-field-phone-number.DFS58acU.js} +3 -3
- package/dist/chunks/{input-field-phone-number.CEYx1s4b.js.map → input-field-phone-number.DFS58acU.js.map} +1 -1
- package/dist/chunks/input-field.CGLjYab8.js +222 -0
- package/dist/chunks/input-field.CGLjYab8.js.map +1 -0
- package/dist/chunks/{input-time.BLuMfakv.js → input-time.BhAUyKZM.js} +4 -4
- package/dist/chunks/{input-time.BLuMfakv.js.map → input-time.BhAUyKZM.js.map} +1 -1
- package/dist/chunks/isSameWeek.TrpUOIn5.js +14 -0
- package/dist/chunks/{isSameWeek.CzBCmu7d.js.map → isSameWeek.TrpUOIn5.js.map} +1 -1
- package/dist/chunks/{it.BlUnV-yA.js → it.B65snrJA.js} +3 -3
- package/dist/chunks/{it.BlUnV-yA.js.map → it.B65snrJA.js.map} +1 -1
- package/dist/chunks/{ja.nUwDmVf2.js → ja.xGVfFSzL.js} +2 -2
- package/dist/chunks/{ja.nUwDmVf2.js.map → ja.xGVfFSzL.js.map} +1 -1
- package/dist/chunks/link.DB5g6d48.js.map +1 -1
- package/dist/chunks/{modal-fullscreen.DTvg2NLk.js → modal-fullscreen.De6mevyD.js} +2 -2
- package/dist/chunks/{modal-fullscreen.DTvg2NLk.js.map → modal-fullscreen.De6mevyD.js.map} +1 -1
- package/dist/chunks/{modal.D_TcWTkf.js → modal.BXxwn9H4.js} +93 -91
- package/dist/chunks/{modal.D_TcWTkf.js.map → modal.BXxwn9H4.js.map} +1 -1
- package/dist/chunks/{pagination.D6BxMw5L.js → pagination.BzsKZFnw.js} +2 -2
- package/dist/chunks/{pagination.D6BxMw5L.js.map → pagination.BzsKZFnw.js.map} +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/popover.types.hA13DZPg.js.map +1 -1
- package/dist/chunks/popper-container.C_n9Ds1W.js.map +1 -1
- package/dist/chunks/promo-banner.Dc_kK1x9.js.map +1 -1
- package/dist/chunks/{pt-BR.BCU2Hj36.js → pt-BR.D9FuAQZm.js} +2 -2
- package/dist/chunks/{pt-BR.BCU2Hj36.js.map → pt-BR.D9FuAQZm.js.map} +1 -1
- package/dist/chunks/radio-group.Bb-L-0io.js.map +1 -1
- package/dist/chunks/{rich-text-editor.Dtdfh-0V.js → rich-text-editor.DPpIzYid.js} +3 -3
- package/dist/chunks/{rich-text-editor.Dtdfh-0V.js.map → rich-text-editor.DPpIzYid.js.map} +1 -1
- package/dist/chunks/{search-bar.MVJS9-Mh.js → search-bar.BEOieKeA.js} +4 -4
- package/dist/chunks/{search-bar.MVJS9-Mh.js.map → search-bar.BEOieKeA.js.map} +1 -1
- package/dist/chunks/{secondary-nav.C-nPZR-2.js → secondary-nav.BBL5zZPK.js} +2 -2
- package/dist/chunks/{secondary-nav.C-nPZR-2.js.map → secondary-nav.BBL5zZPK.js.map} +1 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{sidepanel.BTRfwGiS.js → sidepanel.nW0Bhk_u.js} +3 -3
- package/dist/chunks/{sidepanel.BTRfwGiS.js.map → sidepanel.nW0Bhk_u.js.map} +1 -1
- package/dist/chunks/{startOfWeek.CXhhX-R7.js → startOfWeek.Br5KM4z_.js} +2 -2
- package/dist/chunks/{startOfWeek.CXhhX-R7.js.map → startOfWeek.Br5KM4z_.js.map} +1 -1
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
- package/dist/chunks/{summary-grid.types.DUIqCmwg.js → summary-grid.types.Dp_efYVN.js} +2 -2
- package/dist/chunks/{summary-grid.types.DUIqCmwg.js.map → summary-grid.types.Dp_efYVN.js.map} +1 -1
- package/dist/chunks/tag.D2xagTJv.js.map +1 -1
- package/dist/chunks/textarea.CJS-1I41.js.map +1 -1
- package/dist/chunks/{timeline-item.BOUWkLi1.js → timeline-item.CF9jbIRr.js} +4 -4
- package/dist/chunks/timeline-item.CF9jbIRr.js.map +1 -0
- package/dist/chunks/{toggle.B1z1YPe_.js → toggle.Ca-MM3dt.js} +3 -5
- package/dist/chunks/toggle.Ca-MM3dt.js.map +1 -0
- package/dist/chunks/tooltip.BxtnF3is.js.map +1 -1
- package/dist/chunks/{tutorial.CZt_mcuT.js → tutorial.CoWDVs7_.js} +2 -2
- package/dist/chunks/{tutorial.CZt_mcuT.js.map → tutorial.CoWDVs7_.js.map} +1 -1
- package/dist/chunks/typography.C8lPlsbD.js.map +1 -1
- package/dist/chunks/{use-cached-selected-values.BJbWbkEQ.js → use-cached-selected-values.Du8-wWR2.js} +616 -551
- package/dist/chunks/use-cached-selected-values.Du8-wWR2.js.map +1 -0
- package/dist/chunks/{use-date-input-formatter.Djf8AoLr.js → use-date-input-formatter.ibZeLD_V.js} +4 -4
- package/dist/chunks/{use-date-input-formatter.Djf8AoLr.js.map → use-date-input-formatter.ibZeLD_V.js.map} +1 -1
- package/dist/chunks/{zh-CN.ChYkuQAR.js → zh-CN.Be4pa3-g.js} +3 -3
- package/dist/chunks/{zh-CN.ChYkuQAR.js.map → zh-CN.Be4pa3-g.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/draggable.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +40 -40
- package/dist/index.js.map +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/input-time.js +1 -1
- package/dist/internal.js +5 -5
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +45 -4
- package/package.json +5 -5
- package/dist/chunks/alert.CXRb-Smf.js.map +0 -1
- package/dist/chunks/base-modal.C52VMtnd.js.map +0 -1
- package/dist/chunks/button-actions.Bdbu0bvt.js.map +0 -1
- package/dist/chunks/calendar.CqsfThnC.js.map +0 -1
- package/dist/chunks/card.8z7UQeVK.js.map +0 -1
- package/dist/chunks/checkbox-group.Dur2Edtw.js.map +0 -1
- package/dist/chunks/checkbox.vNjt6QDJ.js.map +0 -1
- package/dist/chunks/code-snippet.BVpFBhKq.js.map +0 -1
- package/dist/chunks/constructNow.CIc7d13I.js +0 -8
- package/dist/chunks/data-grid.ZHY5EzP3.js.map +0 -1
- package/dist/chunks/date-range-picker.LCWVAa5R.js.map +0 -1
- package/dist/chunks/dropdown-tag.B61hPq5n.js.map +0 -1
- package/dist/chunks/dropdown.Ca-f8tdX.js.map +0 -1
- package/dist/chunks/filter-bar.Bd4ghW_B.js.map +0 -1
- package/dist/chunks/header.C7B7RBib.js.map +0 -1
- package/dist/chunks/input-field-password.BNAtIn_D.js.map +0 -1
- package/dist/chunks/input-field.Dh5W0Az-.js +0 -211
- package/dist/chunks/input-field.Dh5W0Az-.js.map +0 -1
- package/dist/chunks/isSameWeek.CzBCmu7d.js +0 -14
- package/dist/chunks/timeline-item.BOUWkLi1.js.map +0 -1
- package/dist/chunks/toggle.B1z1YPe_.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.BJbWbkEQ.js.map +0 -1
- package/dist/chunks/warning-filled.CbJ1pcB2.js +0 -24
- package/dist/chunks/warning-filled.CbJ1pcB2.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as m, provide as _, toRef as b, useAttrs as C, ref as u, watch as S } from "vue";
|
|
2
|
-
import { d as v } from "./use-cached-selected-values.
|
|
2
|
+
import { d as v } from "./use-cached-selected-values.Du8-wWR2.js";
|
|
3
3
|
import { u as y } from "./index.B6WW_F-J.js";
|
|
4
|
-
import { I } from "./dropdown.
|
|
5
|
-
import { B as E } from "./input-field.
|
|
4
|
+
import { I } from "./dropdown.BYJwx-JD.js";
|
|
5
|
+
import { B as E } from "./input-field.CGLjYab8.js";
|
|
6
6
|
import { S as k } from "./search.D53Ia3rC.js";
|
|
7
7
|
import { C as T } from "./cross-circle-fill.DTDtgLMf.js";
|
|
8
8
|
import { n as F } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
@@ -123,4 +123,4 @@ export {
|
|
|
123
123
|
A as a,
|
|
124
124
|
i as b
|
|
125
125
|
};
|
|
126
|
-
//# sourceMappingURL=search-bar.
|
|
126
|
+
//# sourceMappingURL=search-bar.BEOieKeA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.
|
|
1
|
+
{"version":3,"file":"search-bar.BEOieKeA.js","sources":["../../src/components/search-bar/search-bar.types.ts","../../src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n\nexport interface BentoSearchBarProps {\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: string;\n\n /**\n * Reduces height of the search bar. Default: false\n */\n condensed?: boolean;\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * Disables the text input.\n */\n disabled?: boolean;\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint?: string;\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: string;\n\n /**\n * Text displayed as the value being searched\n */\n value?: string;\n}\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :model-value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n @update:model-value=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, useAttrs, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent, type BentoSearchBarProps } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n import BentoInputField from '@/components/input-field/input-field.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n inputFieldAriaLabel: null,\n condensed: { type: Boolean, default: false },\n debounceTime: { default: 300 },\n disabled: { type: Boolean, default: false },\n hint: { default: '' },\n placeholder: { default: '' },\n value: { default: undefined }\n});\n\n const emit = defineEmits([\"input\", \"clear\", \"escape-pressed\", \"blur\", \"focus\"]);\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n // bentoInputField.value?.focusInput();\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","t","useI18n","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","props","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","emit","debouncedEmit","debounce","onInputEvent","value","focus","expose"],"mappings":";;;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCiJRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;iBAvGA,EAAA,GAAAC,EAAA,IAAAC,EAAA;AAcA,IAAAC,EAAAC,GAAAC,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAJ,EAAA,KAAA,GACAK,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAN,EAAA;AAAA,MACgB,MAAA;AAER,QAAAG,EAAA,QAAAH,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAO,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAK,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBC,IAAAC,EAAA,MAAA;AACI,MAAAF,EAAA,SAAAL,EAAA,KAAA;AAAA,IAA8B,GAAAH,EAAA,YAAA,GAGlCW,IAAA,CAAAC,MAAA;AACI,MAAAT,EAAA,QAAAS,GACAH,EAAA;AAAA,IAAc,GAGlBI,IAAA,MAAA;AAEI,MAAAR,EAAA,MAAA,WAAA;AAAA,IAAiC;AAIrC,WAAAS,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OAAAD;AAAA,IAIT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as T, inject as M, ref as w, computed as m, watch as x, toRef as B, readonly as k, provide as E } from "vue";
|
|
2
|
-
import { B as $ } from "./dropdown.
|
|
2
|
+
import { B as $ } from "./dropdown.BYJwx-JD.js";
|
|
3
3
|
import { B as S } from "./typography.C8lPlsbD.js";
|
|
4
4
|
import { j as L } from "./index.CwzYJHw2.js";
|
|
5
5
|
import { u as R } from "./index.B6WW_F-J.js";
|
|
@@ -223,4 +223,4 @@ const he = ie.exports;
|
|
|
223
223
|
export {
|
|
224
224
|
he as s
|
|
225
225
|
};
|
|
226
|
-
//# sourceMappingURL=secondary-nav.
|
|
226
|
+
//# sourceMappingURL=secondary-nav.BBL5zZPK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-nav.C-nPZR-2.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <div class=\"b-secondary-nav-item\">\n <div class=\"b-secondary-nav-item__wrapper\">\n <button\n class=\"b-secondary-nav-item__option\"\n :class=\"conditionalClasses\"\n :aria-current=\"isItemSelected ? 'page' : undefined\"\n :aria-expanded=\"expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click=\"expandleItemIsToggleOnly ? onToggleClick() : onClick($event)\"\n >\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n <bento-button\n v-if=\"hasSubItems\"\n :aria-hidden=\"expandleItemIsToggleOnly\"\n :tabindex=\"expandleItemIsToggleOnly ? -1 : undefined\"\n class=\"b-secondary-nav-item__toggle\"\n variant=\"tertiary\"\n :aria-label=\"isOpen ? `Collapse ${label}` : `Expand ${label}`\"\n :aria-expanded=\"!expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"!expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click.stop=\"onToggleClick\"\n >\n <template #iconLeft>\n <chevron-up-icon v-if=\"isOpen\" class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n <chevron-down-icon v-else class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <Transition :name=\"CONTENT_TRANSITION_NAME\">\n <div v-if=\"hasSubItems && isOpen\" :id=\"subItemsId\" :style=\"subItemsMaxHeight\">\n <ul ref=\"subItemsRef\" class=\"b-secondary-nav-item__sub-items\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" is-sub-item />\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import { computed, inject, ref, watch } from 'vue';\n import { generateUid } from '@/core/utils/ts';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n const { activeItemValue, updateActiveItemValue, allowExpandableItemNavigation } = inject(SECONDARY_NAV_STATE);\n const CONTENT_TRANSITION_NAME = 'b-secondary-nav-item__animation--content';\n\n const props = defineProps({\n label: null,\n value: null,\n items: null,\n isSubItem: { type: Boolean }\n});\n\n const isOpen = ref(false);\n const subItemsId = generateUid('secondary-nav-sub-items');\n const subItemsRef = ref<HTMLUListElement>(null);\n const hasSubItems = computed(() => !!props.items?.length);\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n const expandleItemIsToggleOnly = computed(() => hasSubItems.value && !allowExpandableItemNavigation.value);\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(subItemsRef, isOpen);\n const subItemsMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item__option--active': isItemSelected.value,\n 'b-secondary-nav-item__option--expandable': hasSubItems.value,\n 'b-secondary-nav-item__option--sub-item': props.isSubItem,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n\n const onToggleClick = () => {\n isOpen.value = !isOpen.value;\n };\n\n const hasActiveDescendant = (items: Array<BentoSecondaryNavItemsItem>, value: string): boolean => {\n return items.some(\n item => item.value === value || (item.items ? hasActiveDescendant(item.items, value) : false)\n );\n };\n\n watch(\n () => subItemsRef.value,\n () => {\n let observer: ResizeObserver | null = null;\n\n if (!observer && subItemsRef.value) {\n observer = observeSizeOfElement(subItemsRef.value, () => {\n if (subItemsRef.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n watch(\n isOpen,\n () => {\n updateContentHeight();\n },\n { immediate: true }\n );\n\n watch(\n activeItemValue,\n value => {\n if (hasSubItems.value && props.items && hasActiveDescendant(props.items, value)) {\n isOpen.value = true;\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"mobileDropdownItems\"\n :static-categories=\"hasCategories\"\n :model-value=\"activeItemValue\"\n :is-option-disabled=\"isMobileOptionDisabled\"\n @update:model-value=\"updateActiveItemValue\"\n >\n <template #display-value=\"{ label }\">\n <bento-typography el=\"span\">\n {{ label }}\n </bento-typography>\n </template>\n <template #default=\"{ label, data }\">\n <bento-typography el=\"span\" :class=\"{ 'b-secondary-nav__nested-option': !!data?.level }\">\n {{ label }}\n </bento-typography>\n </template>\n </bento-dropdown>\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category\n v-if=\"'items' in item && !('value' in item)\"\n :label=\"item.label\"\n :items=\"item.items\"\n />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, toRef, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import {\n type BentoSecondaryNavItems,\n type BentoSecondaryNavItemsCategory,\n type BentoSecondaryNavItemsItem,\n type BentoSecondaryNavState,\n } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptionItem, type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null,\n allowExpandableItemNavigation: { type: Boolean }\n});\n\n const emit = defineEmits([\"change\"]);\n\n const isCategory = (item: BentoSecondaryNavItems[number]): item is BentoSecondaryNavItemsCategory =>\n 'items' in item && !('value' in item);\n\n const mapNestedItems = (items: Array<BentoSecondaryNavItemsItem>, level = 0): BentoListboxOptions =>\n items.flatMap((item): BentoListboxOptions => {\n const currentItem: BentoListboxOptionItem = {\n label: item.label,\n value: item.value,\n data: { level, hasSubItems: !!item.items?.length },\n };\n\n if (item.items?.length) {\n return [currentItem, ...mapNestedItems(item.items, level + 1)];\n }\n\n return [currentItem];\n });\n\n const isMobileOptionDisabled = (option: BentoListboxOptionItem): boolean =>\n !props.allowExpandableItemNavigation && (option.data as { hasSubItems?: boolean })?.hasSubItems;\n\n const hasCategories = computed(() => props.items.some(item => isCategory(item)));\n const mobileDropdownItems = computed<BentoListboxOptions>(() => {\n return props.items.flatMap(item => {\n if (isCategory(item)) {\n return [\n {\n label: item.label,\n value: `category-${item.label}`,\n items: mapNestedItems(item.items),\n } satisfies BentoListboxOptionItem,\n ];\n }\n\n if (item.items?.length) {\n return mapNestedItems([item]);\n }\n\n return [\n {\n label: item.label,\n value: item.value,\n data: { level: 0 },\n } satisfies BentoListboxOptionItem,\n ];\n });\n });\n\n const flattenNestedItems = (items: Array<BentoSecondaryNavItemsItem>): Array<BentoSecondaryNavItemsItem> =>\n items.flatMap(item => [item, ...(item.items?.length ? flattenNestedItems(item.items) : [])]);\n\n const findFirstSelectableNestedItemValue = (items: Array<BentoSecondaryNavItemsItem>): string =>\n flattenNestedItems(items).find(item => props.allowExpandableItemNavigation || !item.items?.length)?.value ?? '';\n\n const activeItemValueFallback = computed(() => {\n if (!props.items.length) {\n return '';\n }\n\n return findFirstSelectableNestedItemValue(\n props.items.flatMap(item =>\n isCategory(item) ? flattenNestedItems(item.items) : flattenNestedItems([item])\n )\n );\n });\n\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n allowExpandableItemNavigation: toRef(props, 'allowExpandableItemNavigation'),\n };\n\n watch(\n () => props.value,\n value => {\n if (value !== undefined) {\n activeItemValue.value = value;\n }\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","allowExpandableItemNavigation","inject","CONTENT_TRANSITION_NAME","isOpen","ref","subItemsId","generateUid","subItemsRef","hasSubItems","computed","_a","props","isItemSelected","expandleItemIsToggleOnly","updateContentHeight","contentHeight","useExpandableContentHeight","subItemsMaxHeight","conditionalClasses","onClick","e","emit","onToggleClick","hasActiveDescendant","items","value","item","watch","observer","observeSizeOfElement","__default__$1","__default__","messages","t","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","isCategory","mapNestedItems","level","currentItem","_b","isMobileOptionDisabled","option","hasCategories","mobileDropdownItems","flattenNestedItems","findFirstSelectableNestedItemValue","activeItemValueFallback","state","readonly","toRef","provide"],"mappings":";;;;;;;;;;;;;;AAGO,MAAAA,IAAA,uBAAA,qBAAA,GCqIHC,IAAA,CAAA;;;;;;;;;;;iBAhFA,EAAA,iBAAAC,GAAA,uBAAAC,GAAA,+BAAAC,EAAA,IAAAC,EAAAL,CAAA,GACAM,IAAA,4CASAC,IAAAC,EAAA,EAAA,GACAC,IAAAC,EAAA,yBAAA,GACAC,IAAAH,EAAA,IAAA,GACAI,IAAAC,EAAA,MAAA;;AAAA,cAAA,GAAAC,IAAAC,EAAA,UAAA,QAAAD,EAAA;AAAA,KAAA,GACAE,IAAAH,EAAA,MAAAX,EAAA,UAAAa,EAAA,KAAA,GACAE,IAAAJ,EAAA,MAAAD,EAAA,SAAA,CAAAR,EAAA,KAAA,GACA,EAAA,qBAAAc,GAAA,eAAAC,EAAA,IAAAC,EAAAT,GAAAJ,CAAA,GACAc,IAAAR,EAAA,MAAAM,EAAA,QAAA,EAAA,cAAAA,EAAA,MAAA,IAAA,CAAA,CAAA,GAEAG,IAAAT,EAAA,OAAA;AAAA,MAA2C,wCAAAG,EAAA;AAAA,MACg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IAAA,CAAA,CAAA;AAAA,KAAA,GAGAuB,IAAA,CAAAzB,MAAA;;AAAA,eAAAd,IAAAsC,EAAAxB,CAAA,EAAA,KAAA,CAAAE,MAAA;;AAAA,eAAAf,EAAA,iCAAA,GAAAD,IAAAgB,EAAA,UAAA,QAAAhB,EAAA;AAAA,OAAA,MAAA,gBAAAA,EAAA,UAAA;AAAA,OAGAwC,IAAAzC,EAAA,MACIE,EAAA,MAAA,SAIAsC;AAAA,MAAOtC,EAAA,MAAA;AAAA,QACS,CAAAe,MAAAa,EAAAb,CAAA,IAAAsB,EAAAtB,EAAA,KAAA,IAAAsB,EAAA,CAAAtB,CAAA,CAAA;AAAA,MACqE;AAAA,IACjF,IANA,EAOJ,GAGJ5B,IAAAM,EAAAO,EAAA,SAAAuC,EAAA,KAAA,GACAnD,IAAA,CAAA0B,MAAA;AACI,MAAA3B,EAAA,QAAA2B,GACAJ,EAAA,UAAAI,CAAA;AAAA,IAAoB,GAKxB0B,IAAA;AAAA,MAAsC,iBAAAC,EAAAtD,CAAA;AAAA,MACO,uBAAAC;AAAA,MACzC,+BAAAsD,EAAA1C,GAAA,+BAAA;AAAA,IAC2E;AAG/E,WAAAgB;AAAA,MAAA,MAAAhB,EAAA;AAAA,MACgB,CAAAc,MAAA;AAER,QAAAA,MAAA,WACI3B,EAAA,QAAA2B;AAAA,MACJ;AAAA,IACJ,GAGJ6B,EAAA1D,GAAAuD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"secondary-nav.BBL5zZPK.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <div class=\"b-secondary-nav-item\">\n <div class=\"b-secondary-nav-item__wrapper\">\n <button\n class=\"b-secondary-nav-item__option\"\n :class=\"conditionalClasses\"\n :aria-current=\"isItemSelected ? 'page' : undefined\"\n :aria-expanded=\"expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click=\"expandleItemIsToggleOnly ? onToggleClick() : onClick($event)\"\n >\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n <bento-button\n v-if=\"hasSubItems\"\n :aria-hidden=\"expandleItemIsToggleOnly\"\n :tabindex=\"expandleItemIsToggleOnly ? -1 : undefined\"\n class=\"b-secondary-nav-item__toggle\"\n variant=\"tertiary\"\n :aria-label=\"isOpen ? `Collapse ${label}` : `Expand ${label}`\"\n :aria-expanded=\"!expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"!expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click.stop=\"onToggleClick\"\n >\n <template #iconLeft>\n <chevron-up-icon v-if=\"isOpen\" class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n <chevron-down-icon v-else class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <Transition :name=\"CONTENT_TRANSITION_NAME\">\n <div v-if=\"hasSubItems && isOpen\" :id=\"subItemsId\" :style=\"subItemsMaxHeight\">\n <ul ref=\"subItemsRef\" class=\"b-secondary-nav-item__sub-items\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" is-sub-item />\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import { computed, inject, ref, watch } from 'vue';\n import { generateUid } from '@/core/utils/ts';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n const { activeItemValue, updateActiveItemValue, allowExpandableItemNavigation } = inject(SECONDARY_NAV_STATE);\n const CONTENT_TRANSITION_NAME = 'b-secondary-nav-item__animation--content';\n\n const props = defineProps({\n label: null,\n value: null,\n items: null,\n isSubItem: { type: Boolean }\n});\n\n const isOpen = ref(false);\n const subItemsId = generateUid('secondary-nav-sub-items');\n const subItemsRef = ref<HTMLUListElement>(null);\n const hasSubItems = computed(() => !!props.items?.length);\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n const expandleItemIsToggleOnly = computed(() => hasSubItems.value && !allowExpandableItemNavigation.value);\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(subItemsRef, isOpen);\n const subItemsMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item__option--active': isItemSelected.value,\n 'b-secondary-nav-item__option--expandable': hasSubItems.value,\n 'b-secondary-nav-item__option--sub-item': props.isSubItem,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n\n const onToggleClick = () => {\n isOpen.value = !isOpen.value;\n };\n\n const hasActiveDescendant = (items: Array<BentoSecondaryNavItemsItem>, value: string): boolean => {\n return items.some(\n item => item.value === value || (item.items ? hasActiveDescendant(item.items, value) : false)\n );\n };\n\n watch(\n () => subItemsRef.value,\n () => {\n let observer: ResizeObserver | null = null;\n\n if (!observer && subItemsRef.value) {\n observer = observeSizeOfElement(subItemsRef.value, () => {\n if (subItemsRef.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n watch(\n isOpen,\n () => {\n updateContentHeight();\n },\n { immediate: true }\n );\n\n watch(\n activeItemValue,\n value => {\n if (hasSubItems.value && props.items && hasActiveDescendant(props.items, value)) {\n isOpen.value = true;\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"mobileDropdownItems\"\n :static-categories=\"hasCategories\"\n :model-value=\"activeItemValue\"\n :is-option-disabled=\"isMobileOptionDisabled\"\n @update:model-value=\"updateActiveItemValue\"\n >\n <template #display-value=\"{ label }\">\n <bento-typography el=\"span\">\n {{ label }}\n </bento-typography>\n </template>\n <template #default=\"{ label, data }\">\n <bento-typography el=\"span\" :class=\"{ 'b-secondary-nav__nested-option': !!data?.level }\">\n {{ label }}\n </bento-typography>\n </template>\n </bento-dropdown>\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category\n v-if=\"'items' in item && !('value' in item)\"\n :label=\"item.label\"\n :items=\"item.items\"\n />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" :items=\"item.items\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, toRef, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import {\n type BentoSecondaryNavItems,\n type BentoSecondaryNavItemsCategory,\n type BentoSecondaryNavItemsItem,\n type BentoSecondaryNavState,\n } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptionItem, type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null,\n allowExpandableItemNavigation: { type: Boolean }\n});\n\n const emit = defineEmits([\"change\"]);\n\n const isCategory = (item: BentoSecondaryNavItems[number]): item is BentoSecondaryNavItemsCategory =>\n 'items' in item && !('value' in item);\n\n const mapNestedItems = (items: Array<BentoSecondaryNavItemsItem>, level = 0): BentoListboxOptions =>\n items.flatMap((item): BentoListboxOptions => {\n const currentItem: BentoListboxOptionItem = {\n label: item.label,\n value: item.value,\n data: { level, hasSubItems: !!item.items?.length },\n };\n\n if (item.items?.length) {\n return [currentItem, ...mapNestedItems(item.items, level + 1)];\n }\n\n return [currentItem];\n });\n\n const isMobileOptionDisabled = (option: BentoListboxOptionItem): boolean =>\n !props.allowExpandableItemNavigation && (option.data as { hasSubItems?: boolean })?.hasSubItems;\n\n const hasCategories = computed(() => props.items.some(item => isCategory(item)));\n const mobileDropdownItems = computed<BentoListboxOptions>(() => {\n return props.items.flatMap(item => {\n if (isCategory(item)) {\n return [\n {\n label: item.label,\n value: `category-${item.label}`,\n items: mapNestedItems(item.items),\n } satisfies BentoListboxOptionItem,\n ];\n }\n\n if (item.items?.length) {\n return mapNestedItems([item]);\n }\n\n return [\n {\n label: item.label,\n value: item.value,\n data: { level: 0 },\n } satisfies BentoListboxOptionItem,\n ];\n });\n });\n\n const flattenNestedItems = (items: Array<BentoSecondaryNavItemsItem>): Array<BentoSecondaryNavItemsItem> =>\n items.flatMap(item => [item, ...(item.items?.length ? flattenNestedItems(item.items) : [])]);\n\n const findFirstSelectableNestedItemValue = (items: Array<BentoSecondaryNavItemsItem>): string =>\n flattenNestedItems(items).find(item => props.allowExpandableItemNavigation || !item.items?.length)?.value ?? '';\n\n const activeItemValueFallback = computed(() => {\n if (!props.items.length) {\n return '';\n }\n\n return findFirstSelectableNestedItemValue(\n props.items.flatMap(item =>\n isCategory(item) ? flattenNestedItems(item.items) : flattenNestedItems([item])\n )\n );\n });\n\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n allowExpandableItemNavigation: toRef(props, 'allowExpandableItemNavigation'),\n };\n\n watch(\n () => props.value,\n value => {\n if (value !== undefined) {\n activeItemValue.value = value;\n }\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","allowExpandableItemNavigation","inject","CONTENT_TRANSITION_NAME","isOpen","ref","subItemsId","generateUid","subItemsRef","hasSubItems","computed","_a","props","isItemSelected","expandleItemIsToggleOnly","updateContentHeight","contentHeight","useExpandableContentHeight","subItemsMaxHeight","conditionalClasses","onClick","e","emit","onToggleClick","hasActiveDescendant","items","value","item","watch","observer","observeSizeOfElement","__default__$1","__default__","messages","t","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","isCategory","mapNestedItems","level","currentItem","_b","isMobileOptionDisabled","option","hasCategories","mobileDropdownItems","flattenNestedItems","findFirstSelectableNestedItemValue","activeItemValueFallback","state","readonly","toRef","provide"],"mappings":";;;;;;;;;;;;;;AAGO,MAAAA,IAAA,uBAAA,qBAAA,GCqIHC,IAAA,CAAA;;;;;;;;;;;iBAhFA,EAAA,iBAAAC,GAAA,uBAAAC,GAAA,+BAAAC,EAAA,IAAAC,EAAAL,CAAA,GACAM,IAAA,4CASAC,IAAAC,EAAA,EAAA,GACAC,IAAAC,EAAA,yBAAA,GACAC,IAAAH,EAAA,IAAA,GACAI,IAAAC,EAAA,MAAA;;AAAA,cAAA,GAAAC,IAAAC,EAAA,UAAA,QAAAD,EAAA;AAAA,KAAA,GACAE,IAAAH,EAAA,MAAAX,EAAA,UAAAa,EAAA,KAAA,GACAE,IAAAJ,EAAA,MAAAD,EAAA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components/segmented-control/segmented-control.types.ts"],"sourcesContent":["export type BentoSegmentedControlValue = string | number;\nexport interface BentoSegmentedControlProps {\n /**\n * Accessible name describing the segmented control.\n * @deprecated
|
|
1
|
+
{"version":3,"file":"segmented-control.types.BHRLV8KU.js","sources":["../../src/components/segmented-control/segmented-control.types.ts"],"sourcesContent":["export type BentoSegmentedControlValue = string | number;\nexport interface BentoSegmentedControlProps {\n /**\n * Accessible name describing the segmented control.\n * @deprecated Since v2.0.0. Use `aria-label` instead.\n */\n ariaLabel?: string;\n\n /**\n * If set to true, renders the component full width.\n */\n fullWidth?: boolean;\n\n /**\n * Items that will populate the segmented control.\n */\n items: Array<BentoSegmentedControlItem>;\n\n /**\n * Determines the selected value of the group. Corresponds to the BentoSegmentedControlItem's value.\n */\n modelValue?: BentoSegmentedControlValue;\n\n /**\n * If set to true, wraps the items in the segmented control to show their content whenever these don't fit in the available space anymore.\n */\n wrap?: boolean;\n}\n\nexport interface BentoSegmentedControlItem {\n label: string;\n value: string | number;\n disabled?: boolean;\n}\n\n/**\n * @deprecated Since v2.0.0. Use `update:model-value` or `v-model` instead.\n */\nexport enum BentoSegmentedControlEvent {\n UPDATE = 'update:model-value',\n}\n"],"names":["BentoSegmentedControlEvent"],"mappings":"AAsCO,IAAKA,sBAAAA,OACRA,EAAA,SAAS,sBADDA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as h, toRefs as N, ref as n, computed as P, onMounted as G, onUnmounted as F, watch as x, provide as g } from "vue";
|
|
2
2
|
import { B as R, d as U } from "./typography.C8lPlsbD.js";
|
|
3
|
-
import { F as L } from "./footer-actions.
|
|
3
|
+
import { F as L } from "./footer-actions.D9mHwk5l.js";
|
|
4
4
|
import { b as J, B as M, D as K, a as Y } from "./dialog-page.EdejG53a.js";
|
|
5
5
|
import { n as I } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import { B as w } from "./button.C9b2AC9w.js";
|
|
7
7
|
import { B as z } from "./focus-trap.DRqjHzt6.js";
|
|
8
8
|
import { C as H } from "./cross.CC_B-vG-.js";
|
|
9
|
-
import { S as $ } from "./button-actions.
|
|
9
|
+
import { S as $ } from "./button-actions.CXD6_9qN.js";
|
|
10
10
|
import { u as j } from "./index.B6WW_F-J.js";
|
|
11
11
|
import { g as V } from "./generate-uid.NJ8tVoha.js";
|
|
12
12
|
import { B as X } from "./directive.Bfr4fuOy.js";
|
|
@@ -232,4 +232,4 @@ export {
|
|
|
232
232
|
Ae as a,
|
|
233
233
|
Ee as s
|
|
234
234
|
};
|
|
235
|
-
//# sourceMappingURL=sidepanel.
|
|
235
|
+
//# sourceMappingURL=sidepanel.nW0Bhk_u.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.BTRfwGiS.js","sources":["../../src/components/sidepanel/components/sidepanel-page.vue","../../src/components/sidepanel/sidepanel.types.ts","../../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n 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 * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v2.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v2.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits([]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","activePage","isOpen","toRefs","props","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","emit","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","_a","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AA2II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IAAAC,IAAA,kBAAAC,OACHA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC4PRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlKA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GACA,EA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,UACIA,EAAA,MAAA,KAAAT,EAAA,KAAA,KACJ6B,EAAA,QAEAP,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC;AAIrC,UAAAQ,IAAA,CAAAC,MAAAV,EAAAzB,EAAA,oBAAAmC,CAAA,GAGAC,IAAA,CAAAC,MAAA,MAAA;;AACI,MAAAzB,EAAA,SAAA0B,IAAA1B,EAAA,UAAA,gBAAA0B,EAAA,OAAA,CAAAC,MAAAA,MAAAF;AAAA,IAAqE,GAIzEG,IAAA,CAAAD,OACI3B,EAAA,MAAA,KAAA2B,CAAA,GAEA,EAAA,gBAAAH,EAAAG,CAAA,EAAA;AAGJ,WAAAE,EAAAC,GAAA;AAAA,MAAqE,YAAAtC;AAAA,MACjE,WAAAU;AAAA,MACA,mBAAAM;AAAA,MACA,QAAAD;AAAA,MACQ,OAAAP;AAAA,MACR,eAAAC;AAAA,MACA,YAAAqB;AAAA,IACA,CAAA,GAEJO,EAAAE,GAAAH,CAAA,GAGAC,EAAAG,GAAA3B,CAAA,GAEA,CAAAV,EAAA,iBAAAA,EAAA,oBAAA,QACIsC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sidepanel.nW0Bhk_u.js","sources":["../../src/components/sidepanel/components/sidepanel-page.vue","../../src/components/sidepanel/sidepanel.types.ts","../../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n 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 * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v2.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v2.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits([]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","activePage","isOpen","toRefs","props","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","emit","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","_a","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AA2II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IA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var s, O, f, k;
|
|
4
4
|
const a = D(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((O = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : O.weekStartsOn) ?? a.weekStartsOn ?? ((k = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : k.weekStartsOn) ?? 0, t = w(l, e == null ? void 0 : e.in), c = t.getDay(), u = (c < r ? 7 : 0) + c - r;
|
|
@@ -7,4 +7,4 @@ function d(l, e) {
|
|
|
7
7
|
export {
|
|
8
8
|
d as s
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=startOfWeek.
|
|
10
|
+
//# sourceMappingURL=startOfWeek.Br5KM4z_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startOfWeek.
|
|
1
|
+
{"version":3,"file":"startOfWeek.Br5KM4z_.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js"],"sourcesContent":["import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n"],"names":["startOfWeek","date","options","defaultOptions","getDefaultOptions","weekStartsOn","_b","_a","_d","_c","_date","toDate","day","diff"],"mappings":";AAkCO,SAASA,EAAYC,GAAMC,GAAS;;AACzC,QAAMC,IAAiBC,EAAiB,GAClCC,KACJH,KAAA,gBAAAA,EAAS,mBACTI,KAAAC,IAAAL,KAAA,gBAAAA,EAAS,WAAT,gBAAAK,EAAiB,YAAjB,gBAAAD,EAA0B,iBAC1BH,EAAe,kBACfK,KAAAC,IAAAN,EAAe,WAAf,gBAAAM,EAAuB,YAAvB,gBAAAD,EAAgC,iBAChC,GAEIE,IAAQC,EAAOV,GAAMC,KAAA,gBAAAA,EAAS,EAAE,GAChCU,IAAMF,EAAM,OAAM,GAClBG,KAAQD,IAAMP,IAAe,IAAI,KAAKO,IAAMP;AAElD,SAAAK,EAAM,QAAQA,EAAM,QAAO,IAAKG,CAAI,GACpCH,EAAM,SAAS,GAAG,GAAG,GAAG,CAAC,GAClBA;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.types.Dx8MDhEH.js","sources":["../../src/components/status/status.types.ts"],"sourcesContent":["/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"status.types.Dx8MDhEH.js","sources":["../../src/components/status/status.types.ts"],"sourcesContent":["/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoStatusProps {\n /**\n * Defines the type and color of the Status\n */\n variant: BentoStatusVariant | `${BentoStatusVariant}`;\n}\n"],"names":["BentoStatusVariant"],"mappings":"AAGO,IAAKA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,MAAM,OACNA,EAAA,SAAS,UANDA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -5,7 +5,7 @@ import { G as R } from "./grid-layout.1aIiz2N_.js";
|
|
|
5
5
|
import { n as f } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import { B as g } from "./typography.C8lPlsbD.js";
|
|
7
7
|
import { u as G } from "./index.B6WW_F-J.js";
|
|
8
|
-
import { B as w } from "./dashed-underline.
|
|
8
|
+
import { B as w } from "./dashed-underline.D_FhFRXM.js";
|
|
9
9
|
import { B as L } from "./info-icon.DCR42Kvm.js";
|
|
10
10
|
import { B as E } from "./tag.D2xagTJv.js";
|
|
11
11
|
import { C as N } from "./copy.qqGYFbKJ.js";
|
|
@@ -334,4 +334,4 @@ export {
|
|
|
334
334
|
ge as f,
|
|
335
335
|
Re as s
|
|
336
336
|
};
|
|
337
|
-
//# sourceMappingURL=summary-grid.types.
|
|
337
|
+
//# sourceMappingURL=summary-grid.types.Dp_efYVN.js.map
|
package/dist/chunks/{summary-grid.types.DUIqCmwg.js.map → summary-grid.types.Dp_efYVN.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary-grid.types.DUIqCmwg.js","sources":["../../src/components/summary-grid/summary-grid.vue","../../src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = defineProps({\n columnWidth: { default: null },\n slashedZero: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n itemType: { default: 'custom' }\n});\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <bento-typography\n v-if=\"secondaryLabel\"\n variant=\"caption\"\n class=\"b-summary-grid-item-amount__secondary-label\"\n >{{ secondaryLabel }}</bento-typography\n >\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryLabel: { default: null },\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n label: null,\n title: null,\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n infoIconTooltipText: { default: null },\n title: null,\n fitContent: { type: Boolean, default: false },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","registerComponentsInSummaryGrid","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","props","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"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;;;;;;;;;uBCVA+B,KAAA,CAAA;;;;;;;;;;;;;;AAtBA,UAAA9C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;uBCeA+C,KAAA,CAAA;;;;;;;;;;;;;AApBA,UAAA/C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;AC/BG,IAAAgD,KAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,MAAA,CAAA,CAAA,GASLE,KAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,UAAA,WAHQA,IAAAD,MAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"summary-grid.types.Dp_efYVN.js","sources":["../../src/components/summary-grid/summary-grid.vue","../../src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = defineProps({\n columnWidth: { default: null },\n slashedZero: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n itemType: { default: 'custom' }\n});\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <bento-typography\n v-if=\"secondaryLabel\"\n variant=\"caption\"\n class=\"b-summary-grid-item-amount__secondary-label\"\n >{{ secondaryLabel }}</bento-typography\n >\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryLabel: { default: null },\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n label: null,\n title: null,\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n infoIconTooltipText: { default: null },\n title: null,\n fitContent: { type: Boolean, default: false },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { type GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","registerComponentsInSummaryGrid","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","props","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":";;;;;;;;;;;;AAgGI,MAAAA,IAAA,CAAA;;;;;;;;;iBAnDAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;AAEA,QAAAI,IAAA;AACA,QAAAJ,GAAA;AACI,YAAAK,KAAAC,KAAAC,IAAA,OAAA,KAAAP,CAAA,MAAA,gBAAAO,EAAA,OAAA,CAAAC,MAAAA,EAAA,SAAA,OAAA,OAAA,gBAAAF,EAAA,IAAA,CAAAE,MAAA;;AAAA,yBAAAD,IAAAC,EAAA,MAAA,GAAA,MAAA,gBAAAD,EAAA,IAAA,EAAA;AAAA;AAGA,MAAAH,IAAA,KAAA,IAAA,GAAAC,CAAA;AAAA,IAAmC;AAGvC,IAAAI,EAAA,MAAA;AACI,UAAAL,IAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAAA,IAER,CAAA;AAGJ,UAA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/tag/tag.types.ts","../../src/components/tag/tag.vue"],"sourcesContent":["export interface BentoTagProps {\n /**\n * The label text content of the Tag.\n */\n label?: string;\n\n /**\n * The number of characters to limit the number of displayed characters for the tag text, truncating it with an ellipsis of three dots \"...\".\n */\n truncate?: number;\n\n /**\n * The variant variant of tag\n */\n variant?: BentoTagVariant | `${BentoTagVariant}`;\n}\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"tag.D2xagTJv.js","sources":["../../src/components/tag/tag.types.ts","../../src/components/tag/tag.vue"],"sourcesContent":["export interface BentoTagProps {\n /**\n * The label text content of the Tag.\n */\n label?: string;\n\n /**\n * The number of characters to limit the number of displayed characters for the tag text, truncating it with an ellipsis of three dots \"...\".\n */\n truncate?: number;\n\n /**\n * The variant variant of tag\n */\n variant?: BentoTagVariant | `${BentoTagVariant}`;\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoTagVariant {\n GREY = 'grey',\n BLUE = 'blue',\n GREEN = 'green',\n ORANGE = 'orange',\n RED = 'red',\n WHITE = 'white',\n}\n","<template>\n <span\n v-bento-tooltip-directive=\"shouldShowTooltip ? textFromSlot : null\"\n data-testid=\"tag\"\n class=\"b-tag\"\n :class=\"tagConditionalClasses\"\n :aria-label=\"computedAriaLabel\"\n >\n <div v-if=\"hasTextContent && hasSlot('icon')\" class=\"b-tag__icon\" role=\"presentation\">\n <slot name=\"icon\"></slot>\n </div>\n <bento-typography class=\"b-tag__label\" el=\"span\" variant=\"caption\" stronger>\n {{ formattedText }}\n </bento-typography>\n </span>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n // Use relative paths otherwise the interface won't be correctly detected\n // TODO: Use alias once the support is added to work with the betterDefine macro\n import { type BentoTagProps, BentoTagVariant } from './tag.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const props = defineProps({\n label: { default: null },\n truncate: { default: null },\n variant: { default: BentoTagVariant.GREY }\n});\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const hasTextContent = computed(() => !!(props.label || getSlotText(slots)('default')));\n\n const computedAriaLabel = useAriaLabel({\n label: props.label || getSlotText(slots)('default'),\n defaultFallback: 'tag',\n });\n\n const tagConditionalClasses = computed(() => ({\n [`b-tag--${props.variant}`]: props.variant,\n }));\n\n const textFromSlot = computed(() => props.label ?? getSlotText(slots)('default') ?? 'tag');\n const shouldShowTooltip = computed(() => props.truncate && textFromSlot.value.length > props.truncate);\n\n const formattedText = computed(() => {\n if (!props.truncate) {\n return textFromSlot.value;\n }\n\n return shouldShowTooltip.value ? `${textFromSlot.value.slice(0, props.truncate)}...` : textFromSlot.value;\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n name: 'bento-tag',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./tag.scss\" />\n"],"names":["BentoTagVariant","BentoTagVariant2","__default__","slots","useSlots","hasSlot","name","hasTextContent","computed","props","getSlotText","computedAriaLabel","useAriaLabel","tagConditionalClasses","textFromSlot","shouldShowTooltip","formattedText"],"mappings":";;;;;;;AAoBO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;AC2CR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;iBAhCAC,IAAAC,EAAA,GAIAC,IAAA,CAAAC,MAAA,CAAA,CAAAH,EAAAG,CAAA,GAEAC,IAAAC,EAAA,MAAA,CAAA,EAAAC,EAAA,SAAAC,EAAAP,CAAA,EAAA,SAAA,EAAA,GAEAQ,IAAAC,EAAA;AAAA,MAAuC,OAAAH,EAAA,SAAAC,EAAAP,CAAA,EAAA,SAAA;AAAA,MACe,iBAAA;AAAA,IACjC,CAAA,GAGrBU,IAAAL,EAAA,OAAA;AAAA,MAA8C,CAAA,UAAAC,EAAA,OAAA,EAAA,GAAAA,EAAA;AAAA,IACP,EAAA,GAGvCK,IAAAN,EAAA,MAAAC,EAAA,SAAAC,EAAAP,CAAA,EAAA,SAAA,KAAA,KAAA,GACAY,IAAAP,EAAA,MAAAC,EAAA,YAAAK,EAAA,MAAA,SAAAL,EAAA,QAAA,GAEAO,IAAAR,EAAA,MACIC,EAAA,YAIAM,EAAA,QAAA,GAAAD,EAAA,MAAA,MAAA,GAAAL,EAAA,QAAA,CAAA,QAHIK,EAAA,KAGgG;;;;;;;;;;;;;;;;"}
|