@adyen/bento-vue3 1.43.0 → 1.44.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/packages/vue2/src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +8 -8
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +50 -32
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +21 -15
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +56 -38
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +77 -53
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +6 -4
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +4 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +20 -12
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/file-uploader/file-uploader.types.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +228 -180
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +12 -12
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +27 -21
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +139 -97
- package/dist/@types/packages/vue2/src/components/filter-bar/components/filter-bar-button/filter-bar-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +208 -160
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/input-field-password/input-field-password.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue.d.ts +16 -1
- package/dist/@types/packages/vue2/src/components/internal/button-actions-with-menu/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/checkbox-input/checkbox-input.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +6 -6
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/internal/radio-input/radio-input.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/tooltip/tooltip.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item-list/menu-item-list.vue.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +48 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/components/modal-page/modal-page.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/modal-fullscreen/components/modal-fullscreen-page.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal-fullscreen/modal-fullscreen.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/promo-banner/promo-banner.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/sidepanel/components/sidepanel-page.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +6 -4
- package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +6 -4
- package/dist/@types/packages/vue2/src/composables/use-form-validate/use-form.d.ts +9 -6
- package/dist/@types/packages/vue2/src/composables/use-form-validate/use-form.types.d.ts +5 -1
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions-with-menu.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/button.js +7 -8
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.COQrEUYU.js → action-bar.B-_JS43H.js} +10 -9
- package/dist/chunks/action-bar.B-_JS43H.js.map +1 -0
- package/dist/chunks/{base-modal.ku0lyHOs.js → base-modal.BR_pB6eH.js} +2 -2
- package/dist/chunks/{base-modal.ku0lyHOs.js.map → base-modal.BR_pB6eH.js.map} +1 -1
- package/dist/chunks/button-actions-with-menu.GT_kNv28.js +119 -0
- package/dist/chunks/button-actions-with-menu.GT_kNv28.js.map +1 -0
- package/dist/chunks/button-actions.BjlQS6tm.js +322 -0
- package/dist/chunks/button-actions.BjlQS6tm.js.map +1 -0
- package/dist/chunks/{card.D_XL2TWr.js → card.BrEfcUoE.js} +2 -2
- package/dist/chunks/{card.D_XL2TWr.js.map → card.BrEfcUoE.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BUmkYc2R.js → checkbox-group.C5IweVVx.js} +2 -2
- package/dist/chunks/{checkbox-group.BUmkYc2R.js.map → checkbox-group.C5IweVVx.js.map} +1 -1
- package/dist/chunks/{checkbox.L94hTcPY.js → checkbox.B72ok3Yu.js} +15 -15
- package/dist/chunks/{checkbox.L94hTcPY.js.map → checkbox.B72ok3Yu.js.map} +1 -1
- package/dist/chunks/{code-snippet.DbUGxmYi.js → code-snippet.S5NdUu0p.js} +4 -4
- package/dist/chunks/{code-snippet.DbUGxmYi.js.map → code-snippet.S5NdUu0p.js.map} +1 -1
- package/dist/chunks/{dashboard-section.YU5gKDEJ.js → dashboard-section.LWxBcOV_.js} +2 -2
- package/dist/chunks/{dashboard-section.YU5gKDEJ.js.map → dashboard-section.LWxBcOV_.js.map} +1 -1
- package/dist/chunks/{dashed-underline.BKfUevuM.js → dashed-underline.CRlWNPrd.js} +2 -2
- package/dist/chunks/{dashed-underline.BKfUevuM.js.map → dashed-underline.CRlWNPrd.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DI27ou71.js → data-grid-template.BZVeRN6g.js} +2 -2
- package/dist/chunks/{data-grid-template.DI27ou71.js.map → data-grid-template.BZVeRN6g.js.map} +1 -1
- package/dist/chunks/{data-grid.DgPWs1hH.js → data-grid.CKDW-rbM.js} +10 -10
- package/dist/chunks/{data-grid.DgPWs1hH.js.map → data-grid.CKDW-rbM.js.map} +1 -1
- package/dist/chunks/{date-picker.DDsfecHp.js → date-picker.BrZ2X1nQ.js} +3 -3
- package/dist/chunks/{date-picker.DDsfecHp.js.map → date-picker.BrZ2X1nQ.js.map} +1 -1
- package/dist/chunks/{date-range-picker.DjPmRy0E.js → date-range-picker.4y2goCI8.js} +6 -6
- package/dist/chunks/{date-range-picker.DjPmRy0E.js.map → date-range-picker.4y2goCI8.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CcRQ1f4U.js → dropdown-default-textbox.ZjVeMHVC.js} +131 -120
- package/dist/chunks/{dropdown-default-textbox.CcRQ1f4U.js.map → dropdown-default-textbox.ZjVeMHVC.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.BKDmDRSv.js → dropdown-tag.ClKm4xAo.js} +2 -2
- package/dist/chunks/{dropdown-tag.BKDmDRSv.js.map → dropdown-tag.ClKm4xAo.js.map} +1 -1
- package/dist/chunks/dropdown.Sj2OLuEF.js +911 -0
- package/dist/chunks/{dropdown.DpjMobyf.js.map → dropdown.Sj2OLuEF.js.map} +1 -1
- package/dist/chunks/es6.C-HLzYPA.js +11 -0
- package/dist/chunks/{es6.b4enG1py.js.map → es6.C-HLzYPA.js.map} +1 -1
- package/dist/chunks/{file-uploader.cRbwpcAw.js → file-uploader.BgRbkW2V.js} +368 -365
- package/dist/chunks/file-uploader.BgRbkW2V.js.map +1 -0
- package/dist/chunks/{filter-bar.BwJTrH5U.js → filter-bar.CM1FZ02d.js} +16 -17
- package/dist/chunks/{filter-bar.BwJTrH5U.js.map → filter-bar.CM1FZ02d.js.map} +1 -1
- package/dist/chunks/{footer-actions.DvIVWqWv.js → footer-actions.Dvsb0g5Y.js} +2 -2
- package/dist/chunks/{footer-actions.DvIVWqWv.js.map → footer-actions.Dvsb0g5Y.js.map} +1 -1
- package/dist/chunks/{header.C0NBlBJv.js → header.8BzBNgxj.js} +23 -23
- package/dist/chunks/{header.C0NBlBJv.js.map → header.8BzBNgxj.js.map} +1 -1
- package/dist/chunks/{input-field-password.DxNS4MmO.js → input-field-password.CXsERnQX.js} +3 -3
- package/dist/chunks/{input-field-password.DxNS4MmO.js.map → input-field-password.CXsERnQX.js.map} +1 -1
- package/dist/chunks/{input-field.BQKEQIZd.js → input-field.C-7_iMIS.js} +2 -2
- package/dist/chunks/{input-field.BQKEQIZd.js.map → input-field.C-7_iMIS.js.map} +1 -1
- package/dist/chunks/{menu.BpqOdkxR.js → menu.hDynz4lc.js} +132 -104
- package/dist/chunks/menu.hDynz4lc.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.DtgTb1Xh.js → modal-fullscreen.BCGaxVNb.js} +2 -2
- package/dist/chunks/{modal-fullscreen.DtgTb1Xh.js.map → modal-fullscreen.BCGaxVNb.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CjD91zJo.js → modal.vue_vue_type_script_setup_true_lang.DJXx8ftn.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CjD91zJo.js.map → modal.vue_vue_type_script_setup_true_lang.DJXx8ftn.js.map} +1 -1
- package/dist/chunks/{pagination.C34l_EYf.js → pagination.C9kqX5tD.js} +2 -2
- package/dist/chunks/{pagination.C34l_EYf.js.map → pagination.C9kqX5tD.js.map} +1 -1
- package/dist/chunks/{popover.D9Zw4w9l.js → popover.DwGgnCyn.js} +2 -2
- package/dist/chunks/{popover.D9Zw4w9l.js.map → popover.DwGgnCyn.js.map} +1 -1
- package/dist/chunks/{search-bar.Dy0dBek2.js → search-bar.DPC0amNg.js} +3 -3
- package/dist/chunks/{search-bar.Dy0dBek2.js.map → search-bar.DPC0amNg.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DYFnrUIK.js → secondary-nav.DH7aXddE.js} +3 -3
- package/dist/chunks/{secondary-nav.DYFnrUIK.js.map → secondary-nav.DH7aXddE.js.map} +1 -1
- package/dist/chunks/{selection-card-group.BY8o4PYF.js → selection-card-group.DDBJ423n.js} +19 -19
- package/dist/chunks/{selection-card-group.BY8o4PYF.js.map → selection-card-group.DDBJ423n.js.map} +1 -1
- package/dist/chunks/{sidepanel.BywianGe.js → sidepanel.8NclWh0V.js} +2 -2
- package/dist/chunks/{sidepanel.BywianGe.js.map → sidepanel.8NclWh0V.js.map} +1 -1
- package/dist/chunks/{teleport.CI0k6eaC.js → teleport.B255JhsV.js} +26 -17
- package/dist/chunks/teleport.B255JhsV.js.map +1 -0
- package/dist/chunks/{textarea.vAp6HFi9.js → textarea.D1weaQCC.js} +72 -68
- package/dist/chunks/{textarea.vAp6HFi9.js.map → textarea.D1weaQCC.js.map} +1 -1
- package/dist/chunks/{timeline-item.ND_EMuwP.js → timeline-item.BDYrjKhM.js} +3 -3
- package/dist/chunks/{timeline-item.ND_EMuwP.js.map → timeline-item.BDYrjKhM.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.LBw_ALfS.js → tutorial.vue_vue_type_script_setup_true_lang.ltZUbc6M.js} +4 -4
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.LBw_ALfS.js.map → tutorial.vue_vue_type_script_setup_true_lang.ltZUbc6M.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BOZK76mN.js → use-cached-selected-values.B6beyyvX.js} +3 -3
- package/dist/chunks/{use-cached-selected-values.BOZK76mN.js.map → use-cached-selected-values.B6beyyvX.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 +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +67 -68
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +28 -24
- package/dist/internal.js.map +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/@types/packages/vue2/src/components/button/button.demo.d.ts +0 -6
- package/dist/assets/loading-button.css +0 -1
- package/dist/chunks/action-bar.COQrEUYU.js.map +0 -1
- package/dist/chunks/button-actions-with-menu.Bn7Kdx4v.js +0 -106
- package/dist/chunks/button-actions-with-menu.Bn7Kdx4v.js.map +0 -1
- package/dist/chunks/button-actions.Bjfo46Q_.js +0 -150
- package/dist/chunks/button-actions.Bjfo46Q_.js.map +0 -1
- package/dist/chunks/dropdown.DpjMobyf.js +0 -907
- package/dist/chunks/es6.b4enG1py.js +0 -10
- package/dist/chunks/file-uploader.cRbwpcAw.js.map +0 -1
- package/dist/chunks/loading-button.CNWhVIPK.js +0 -137
- package/dist/chunks/loading-button.CNWhVIPK.js.map +0 -1
- package/dist/chunks/menu.BpqOdkxR.js.map +0 -1
- package/dist/chunks/teleport.CI0k6eaC.js.map +0 -1
- package/dist/chunks/use-click-outside.D6aIgS15.js +0 -14
- package/dist/chunks/use-click-outside.D6aIgS15.js.map +0 -1
package/dist/code-snippet.js
CHANGED
package/dist/dashed-underline.js
CHANGED
package/dist/data-grid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as e, d as o, a as r, f as n, e as i, c as B, b as d } from "./chunks/data-grid.
|
|
1
|
+
import { B as e, d as o, a as r, f as n, e as i, c as B, b as d } from "./chunks/data-grid.CKDW-rbM.js";
|
|
2
2
|
export {
|
|
3
3
|
e as BentoColumnOverflow,
|
|
4
4
|
o as BentoDataGrid,
|
package/dist/date-picker.js
CHANGED
package/dist/dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as r } from "./chunks/dropdown.
|
|
2
|
-
import { B as t } from "./chunks/dropdown-default-textbox.
|
|
3
|
-
import { _ as p, a as d, b as B, c as s, d as w } from "./chunks/dropdown-tag.
|
|
4
|
-
import { a as m, B as y } from "./chunks/use-cached-selected-values.
|
|
1
|
+
import { B as r } from "./chunks/dropdown.Sj2OLuEF.js";
|
|
2
|
+
import { B as t } from "./chunks/dropdown-default-textbox.ZjVeMHVC.js";
|
|
3
|
+
import { _ as p, a as d, b as B, c as s, d as w } from "./chunks/dropdown-tag.ClKm4xAo.js";
|
|
4
|
+
import { a as m, B as y } from "./chunks/use-cached-selected-values.B6beyyvX.js";
|
|
5
5
|
export {
|
|
6
6
|
r as BentoDropdown,
|
|
7
7
|
p as BentoDropdownAvatar,
|
package/dist/file-uploader.js
CHANGED
package/dist/filter-bar.js
CHANGED
package/dist/header.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,86 +1,85 @@
|
|
|
1
|
-
import { shallowRef as T, ref as
|
|
1
|
+
import { shallowRef as T, ref as l, inject as g } from "vue";
|
|
2
2
|
import { t as y, c as h } from "./chunks/use-bento-toast-controller.C2wUDcoc.js";
|
|
3
3
|
import { u as A } from "./chunks/use-bento-toast-controller.C2wUDcoc.js";
|
|
4
4
|
import { p as b, d as u } from "./chunks/typography.DNzU41ah.js";
|
|
5
5
|
import { B as R, c as _, b as j, a as Y } from "./chunks/typography.DNzU41ah.js";
|
|
6
|
-
import { B as z } from "./chunks/action-bar.
|
|
6
|
+
import { B as z } from "./chunks/action-bar.B-_JS43H.js";
|
|
7
7
|
import { a as H, b as q } from "./chunks/accordion-item.BOftQTUm.js";
|
|
8
8
|
import { B as Z, c as J, b as Q, a as X } from "./chunks/alert.B9V6kUmo.js";
|
|
9
9
|
import { B as ee } from "./chunks/avatar.DqdDHXay.js";
|
|
10
10
|
import { B as oe, b as ae, a as ne } from "./chunks/button.pwNCxwPu.js";
|
|
11
|
-
import { c as se, B as Be, a as ie } from "./chunks/card.
|
|
12
|
-
import { d as pe } from "./chunks/dashed-underline.
|
|
13
|
-
import { B as
|
|
14
|
-
import { B as ye, a as he } from "./chunks/date-picker.
|
|
15
|
-
import { B as Ee, a as Ce } from "./chunks/date-range-picker.
|
|
16
|
-
import { B as ve, u as Ie } from "./chunks/dropdown.
|
|
17
|
-
import { B as Pe } from "./chunks/dropdown-default-textbox.
|
|
11
|
+
import { c as se, B as Be, a as ie } from "./chunks/card.BrEfcUoE.js";
|
|
12
|
+
import { d as pe } from "./chunks/dashed-underline.CRlWNPrd.js";
|
|
13
|
+
import { B as le, d as ue, a as ce, f as fe, e as xe, c as Se, b as Te } from "./chunks/data-grid.CKDW-rbM.js";
|
|
14
|
+
import { B as ye, a as he } from "./chunks/date-picker.BrZ2X1nQ.js";
|
|
15
|
+
import { B as Ee, a as Ce } from "./chunks/date-range-picker.4y2goCI8.js";
|
|
16
|
+
import { B as ve, u as Ie } from "./chunks/dropdown.Sj2OLuEF.js";
|
|
17
|
+
import { B as Pe } from "./chunks/dropdown-default-textbox.ZjVeMHVC.js";
|
|
18
18
|
import { B as Ge } from "./chunks/divider.ugNXYI-T.js";
|
|
19
|
-
import { B as ke, a as we } from "./chunks/checkbox.
|
|
19
|
+
import { B as ke, a as we } from "./chunks/checkbox.B72ok3Yu.js";
|
|
20
20
|
import { B as Ve } from "./chunks/click-outside.DSszkIvs.js";
|
|
21
|
-
import { c as Ne, b as Re, a as _e, B as je } from "./chunks/code-snippet.
|
|
21
|
+
import { c as Ne, b as Re, a as _e, B as je } from "./chunks/code-snippet.S5NdUu0p.js";
|
|
22
22
|
import { c as Ue } from "./chunks/country.DEQhE7oa.js";
|
|
23
23
|
import { a as Ke, B as He, u as qe, b as We, c as Ze } from "./chunks/country.types.Br0AjxGy.js";
|
|
24
24
|
import { c as Qe, B as Xe } from "./chunks/currency.Dz2x17_Q.js";
|
|
25
25
|
import { B as et, a as tt } from "./chunks/date.DVGj7WKQ.js";
|
|
26
26
|
import { B as at, b as nt, c as rt, a as st } from "./chunks/empty-state.CpXSj1aU.js";
|
|
27
|
-
import { f as it } from "./chunks/file-uploader.
|
|
28
|
-
import { B as pt, b as
|
|
27
|
+
import { f as it } from "./chunks/file-uploader.BgRbkW2V.js";
|
|
28
|
+
import { B as pt, b as dt, a as lt, c as ut } from "./chunks/filter-bar.CM1FZ02d.js";
|
|
29
29
|
import { f as ft, a as xt, c as St, b as Tt } from "./chunks/form-layout-title.BqNDCnLk.js";
|
|
30
30
|
import { _ as yt, B as ht, a as bt } from "./chunks/image.vue_vue_type_script_setup_true_lang.BMoSMeM-.js";
|
|
31
31
|
import { B as Ct } from "./chunks/info-icon.CUC0fwLb.js";
|
|
32
|
-
import { B as vt, b as It, e as Lt, c as Pt, d as Ft, a as Gt } from "./chunks/input-field.
|
|
33
|
-
import { i as kt, m as wt, r as Mt, b as Vt, c as At, a as Nt } from "./chunks/input-field-password.
|
|
32
|
+
import { B as vt, b as It, e as Lt, c as Pt, d as Ft, a as Gt } from "./chunks/input-field.C-7_iMIS.js";
|
|
33
|
+
import { i as kt, m as wt, r as Mt, b as Vt, c as At, a as Nt } from "./chunks/input-field-password.CXsERnQX.js";
|
|
34
34
|
import { i as _t, B as jt } from "./chunks/inspector.types.DcdY_5cC.js";
|
|
35
35
|
import { l as Ut, a as zt } from "./chunks/layout-row.DcyZ3DP3.js";
|
|
36
36
|
import { B as Ht, a as qt } from "./chunks/loading-indicator.N_WV9Gwz.js";
|
|
37
37
|
import { B as Zt, a as Jt } from "./chunks/link.D7wA0jkY.js";
|
|
38
|
-
import { B as Xt, a as $t } from "./chunks/menu.
|
|
39
|
-
import { d as to, f as oo, g as ao, B as no, e as ro, c as so, a as Bo, b as io } from "./chunks/base-modal.
|
|
40
|
-
import { m as po, B as lo } from "./chunks/modal-fullscreen.
|
|
41
|
-
import { B as co } from "./chunks/header.
|
|
42
|
-
import { B as xo } from "./chunks/pagination.
|
|
38
|
+
import { B as Xt, a as $t } from "./chunks/menu.hDynz4lc.js";
|
|
39
|
+
import { d as to, f as oo, g as ao, B as no, e as ro, c as so, a as Bo, b as io } from "./chunks/base-modal.BR_pB6eH.js";
|
|
40
|
+
import { m as po, B as lo } from "./chunks/modal-fullscreen.BCGaxVNb.js";
|
|
41
|
+
import { B as co } from "./chunks/header.8BzBNgxj.js";
|
|
42
|
+
import { B as xo } from "./chunks/pagination.C9kqX5tD.js";
|
|
43
43
|
import { B as To } from "./chunks/payment-method.Lwl-3chY.js";
|
|
44
44
|
import { B as yo } from "./chunks/payment-method.types.CJKfZQN5.js";
|
|
45
|
-
import { B as bo, a as Eo } from "./chunks/popover.
|
|
45
|
+
import { B as bo, a as Eo } from "./chunks/popover.DwGgnCyn.js";
|
|
46
46
|
import { p as Do, B as vo, a as Io } from "./chunks/promo-banner.CzR9ri5v.js";
|
|
47
47
|
import { b as Po, B as Fo, a as Go } from "./chunks/radio-group.DIyCKfOQ.js";
|
|
48
|
-
import { B as ko, b as wo, a as Mo } from "./chunks/search-bar.
|
|
49
|
-
import { s as Ao } from "./chunks/secondary-nav.
|
|
48
|
+
import { B as ko, b as wo, a as Mo } from "./chunks/search-bar.DPC0amNg.js";
|
|
49
|
+
import { s as Ao } from "./chunks/secondary-nav.DH7aXddE.js";
|
|
50
50
|
import { B as Ro } from "./chunks/segmented-control.B5H5Wiyz.js";
|
|
51
51
|
import { B as jo } from "./chunks/segmented-control.types.BHRLV8KU.js";
|
|
52
|
-
import { B as Uo, s as zo, a as Ko } from "./chunks/selection-card-group.
|
|
53
|
-
import { a as qo, B as Wo, s as Zo } from "./chunks/sidepanel.
|
|
52
|
+
import { B as Uo, s as zo, a as Ko } from "./chunks/selection-card-group.DDBJ423n.js";
|
|
53
|
+
import { a as qo, B as Wo, s as Zo } from "./chunks/sidepanel.8NclWh0V.js";
|
|
54
54
|
import { s as Qo, B as Xo } from "./chunks/status.types.Bh_mGknA.js";
|
|
55
55
|
import { a as ea, s as ta, B as oa, b as aa } from "./chunks/step.Db0UJ8mx.js";
|
|
56
56
|
import { B as ra, a as sa } from "./chunks/structured-list-item.C_6ju-IY.js";
|
|
57
|
-
import { s as ia, a as ma, e as pa, b as
|
|
57
|
+
import { s as ia, a as ma, e as pa, b as da, c as la, B as ua, d as ca, f as fa } from "./chunks/summary-grid-item-custom.FxBnzHzb.js";
|
|
58
58
|
import { B as Sa, a as Ta } from "./chunks/tabs.B3DGxpmI.js";
|
|
59
59
|
import { B as ya, a as ha } from "./chunks/tag.xvqrfTwk.js";
|
|
60
|
-
import { B as Ea } from "./chunks/textarea.
|
|
61
|
-
import { t as Da, b as va, a as Ia, c as La, B as Pa, d as Fa } from "./chunks/timeline-item.
|
|
60
|
+
import { B as Ea } from "./chunks/textarea.D1weaQCC.js";
|
|
61
|
+
import { t as Da, b as va, a as Ia, c as La, B as Pa, d as Fa } from "./chunks/timeline-item.BDYrjKhM.js";
|
|
62
62
|
import { t as Oa } from "./chunks/toast.D8AYOorS.js";
|
|
63
63
|
import { B as wa, b as Ma, a as Va } from "./chunks/toggle.Bme9eaeR.js";
|
|
64
64
|
import * as s from "zod";
|
|
65
|
-
import { u as Na } from "./chunks/
|
|
66
|
-
import { a as _a, d as ja } from "./chunks/dashboard-section.
|
|
67
|
-
import { d as Ua } from "./chunks/data-grid-template.
|
|
65
|
+
import { u as Na } from "./chunks/teleport.B255JhsV.js";
|
|
66
|
+
import { a as _a, d as ja } from "./chunks/dashboard-section.LWxBcOV_.js";
|
|
67
|
+
import { d as Ua } from "./chunks/data-grid-template.BZVeRN6g.js";
|
|
68
68
|
import { D as Ka } from "./chunks/date-input.BqBdAO1E.js";
|
|
69
69
|
import { a as qa, B as Wa } from "./chunks/keyboard-navigation.C3QMVRKY.js";
|
|
70
|
-
import { a as Ja, B as Qa, a as Xa, B as $a } from "./chunks/use-cached-selected-values.
|
|
70
|
+
import { a as Ja, B as Qa, a as Xa, B as $a } from "./chunks/use-cached-selected-values.B6beyyvX.js";
|
|
71
71
|
import { B as tn } from "./chunks/directive.O3yEdalv.js";
|
|
72
72
|
import { B as an, a as nn } from "./chunks/events.FNmSWp_P.js";
|
|
73
73
|
import { B as sn } from "./chunks/tooltip.BvJoy09y.js";
|
|
74
|
-
import { B as mn, c as pn, a as
|
|
75
|
-
import { B as
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import { _ as An } from "./chunks/tutorial.vue_vue_type_script_setup_true_lang.LBw_ALfS.js";
|
|
74
|
+
import { B as mn, c as pn, a as dn, b as ln, d as un, e as cn } from "./chunks/button-actions.BjlQS6tm.js";
|
|
75
|
+
import { B as xn } from "./chunks/toggle-button.Bf77_tMh.js";
|
|
76
|
+
import { C as Tn, C as gn } from "./chunks/calendar.S9HFQA8j.js";
|
|
77
|
+
import { _ as hn, a as bn, b as En, c as Cn, d as Dn } from "./chunks/dropdown-tag.ClKm4xAo.js";
|
|
78
|
+
import { C as In } from "./chunks/checkbox-input.D8ZUqd4m.js";
|
|
79
|
+
import { c as Pn, B as Fn } from "./chunks/checkbox-group.C5IweVVx.js";
|
|
80
|
+
import { _ as On } from "./chunks/modal.vue_vue_type_script_setup_true_lang.DJXx8ftn.js";
|
|
81
|
+
import { R as wn } from "./chunks/radio-input.DtvlM-mr.js";
|
|
82
|
+
import { _ as Vn } from "./chunks/tutorial.vue_vue_type_script_setup_true_lang.ltZUbc6M.js";
|
|
84
83
|
function G(e) {
|
|
85
84
|
return e;
|
|
86
85
|
}
|
|
@@ -96,7 +95,7 @@ function E(e) {
|
|
|
96
95
|
function O({
|
|
97
96
|
validationSchema: e
|
|
98
97
|
}) {
|
|
99
|
-
const t = T({}), a =
|
|
98
|
+
const t = T({}), a = l({}), n = l(p(e)), i = () => {
|
|
100
99
|
t.value = {}, a.value = {};
|
|
101
100
|
}, x = () => {
|
|
102
101
|
i(), n.value = p(e);
|
|
@@ -110,8 +109,8 @@ function O({
|
|
|
110
109
|
handleReset: () => x(),
|
|
111
110
|
submitForm: (S) => () => {
|
|
112
111
|
i();
|
|
113
|
-
const
|
|
114
|
-
|
|
112
|
+
const d = e.safeParse(n.value);
|
|
113
|
+
d.success ? S(n.value) : d.error.issues.forEach((m) => {
|
|
115
114
|
const B = E(m);
|
|
116
115
|
t.value[B] || (t.value[B] = m.message), a.value[B] ? a.value[B].push(m.message) : a.value[B] = [m.message];
|
|
117
116
|
});
|
|
@@ -172,8 +171,8 @@ export {
|
|
|
172
171
|
oe as BentoButton,
|
|
173
172
|
mn as BentoButtonActions,
|
|
174
173
|
pn as BentoButtonActionsLayout,
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
dn as BentoButtonActionsLayoutBasic,
|
|
175
|
+
ln as BentoButtonActionsLayoutExtended,
|
|
177
176
|
ae as BentoButtonPropClass,
|
|
178
177
|
ne as BentoButtonVariant,
|
|
179
178
|
se as BentoCard,
|
|
@@ -181,16 +180,16 @@ export {
|
|
|
181
180
|
ie as BentoCardTitleSize,
|
|
182
181
|
ke as BentoCheckbox,
|
|
183
182
|
we as BentoCheckboxEvent,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
Pn as BentoCheckboxGroup,
|
|
184
|
+
Fn as BentoCheckboxGroupVariant,
|
|
185
|
+
In as BentoCheckboxState,
|
|
187
186
|
Ve as BentoClickOutside,
|
|
188
187
|
tn as BentoClickOutsideDirective,
|
|
189
188
|
Ne as BentoCodeSnippet,
|
|
190
189
|
Re as BentoCodeSnippetEvent,
|
|
191
190
|
_e as BentoCodeSnippetSupportedLanguage,
|
|
192
191
|
je as BentoCodeSnippetVariant,
|
|
193
|
-
|
|
192
|
+
le as BentoColumnOverflow,
|
|
194
193
|
Ue as BentoCountry,
|
|
195
194
|
Ke as BentoCountryCode,
|
|
196
195
|
He as BentoCountryVariant,
|
|
@@ -210,28 +209,28 @@ export {
|
|
|
210
209
|
tt as BentoDateFormat,
|
|
211
210
|
ye as BentoDatePicker,
|
|
212
211
|
he as BentoDatePickerEvent,
|
|
213
|
-
|
|
212
|
+
Tn as BentoDatePickerFirstDayOfWeek,
|
|
214
213
|
Ee as BentoDateRangePicker,
|
|
215
214
|
Ce as BentoDateRangePickerEvent,
|
|
216
|
-
|
|
215
|
+
gn as BentoDateRangePickerFirstDayOfWeek,
|
|
217
216
|
Ge as BentoDivider,
|
|
218
217
|
ve as BentoDropdown,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
hn as BentoDropdownAvatar,
|
|
219
|
+
bn as BentoDropdownCountry,
|
|
220
|
+
En as BentoDropdownCurrency,
|
|
222
221
|
Ja as BentoDropdownEvent,
|
|
223
222
|
Qa as BentoDropdownLazyLoadType,
|
|
224
|
-
|
|
223
|
+
Cn as BentoDropdownPaymentMethod,
|
|
225
224
|
Pe as BentoDropdownSize,
|
|
226
|
-
|
|
225
|
+
Dn as BentoDropdownTag,
|
|
227
226
|
at as BentoEmptyState,
|
|
228
227
|
nt as BentoEmptyStateImage,
|
|
229
228
|
rt as BentoEmptyStateImageVariant,
|
|
230
229
|
st as BentoEmptyStateVariant,
|
|
231
230
|
it as BentoFileUploader,
|
|
232
231
|
pt as BentoFilterBar,
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
dt as BentoFilterBarEvent,
|
|
233
|
+
lt as BentoFilterEvent,
|
|
235
234
|
ut as BentoFilterItemType,
|
|
236
235
|
ft as BentoFormLayout,
|
|
237
236
|
xt as BentoFormLayoutFieldTip,
|
|
@@ -259,13 +258,13 @@ export {
|
|
|
259
258
|
Jt as BentoLinkVariant,
|
|
260
259
|
Xa as BentoListboxEvent,
|
|
261
260
|
$a as BentoListboxLazyLoadType,
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
un as BentoLoadingButton,
|
|
262
|
+
cn as BentoLoadingButtonState,
|
|
264
263
|
Ht as BentoLoadingIndicator,
|
|
265
264
|
qt as BentoLoadingIndicatorEvent,
|
|
266
265
|
Xt as BentoMenu,
|
|
267
266
|
$t as BentoMenuEvent,
|
|
268
|
-
|
|
267
|
+
On as BentoModal,
|
|
269
268
|
to as BentoModalColumnLayoutVariant,
|
|
270
269
|
oo as BentoModalDialogType,
|
|
271
270
|
ao as BentoModalEvent,
|
|
@@ -285,7 +284,7 @@ export {
|
|
|
285
284
|
vo as BentoPromoBannerColor,
|
|
286
285
|
Io as BentoPromoBannerLayout,
|
|
287
286
|
Po as BentoRadioButton,
|
|
288
|
-
|
|
287
|
+
wn as BentoRadioButtonStateClass,
|
|
289
288
|
Fo as BentoRadioGroup,
|
|
290
289
|
Go as BentoRadioGroupVariant,
|
|
291
290
|
ko as BentoSearchBar,
|
|
@@ -311,8 +310,8 @@ export {
|
|
|
311
310
|
ia as BentoSummaryGrid,
|
|
312
311
|
ma as BentoSummaryGridItemAmount,
|
|
313
312
|
pa as BentoSummaryGridItemCustom,
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
da as BentoSummaryGridItemNumeric,
|
|
314
|
+
la as BentoSummaryGridItemPercentage,
|
|
316
315
|
ua as BentoSummaryGridItemSize,
|
|
317
316
|
ca as BentoSummaryGridItemText,
|
|
318
317
|
fa as BentoSummaryGridItemTrendDirection,
|
|
@@ -330,13 +329,13 @@ export {
|
|
|
330
329
|
Fa as BentoTimelineStatus,
|
|
331
330
|
Oa as BentoToast,
|
|
332
331
|
wa as BentoToggle,
|
|
333
|
-
|
|
332
|
+
xn as BentoToggleButton,
|
|
334
333
|
Ma as BentoToggleLabelPosition,
|
|
335
334
|
Va as BentoTogglePropClass,
|
|
336
335
|
sn as BentoTooltipDirective,
|
|
337
336
|
an as BentoTooltipPosition,
|
|
338
337
|
nn as BentoTooltipState,
|
|
339
|
-
|
|
338
|
+
Vn as BentoTutorial,
|
|
340
339
|
R as BentoTypography,
|
|
341
340
|
_ as BentoTypographyElement,
|
|
342
341
|
j as BentoTypographyModifier,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../vue2/src/composables/use-form-validate/use-form.ts","../../vue2/src/composables/use-bento-theme/use-bento-theme.types.ts","../../vue2/src/composables/use-bento-theme/use-bento-theme.ts","../../vue2/src/composables/use-bento-toast-controller/install.ts","../../vue2/src/composables/use-bento-theme/install.ts","../../vue2/src/install.ts"],"sourcesContent":["import { type Ref, ref, type ShallowRef, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { ErrorBag, UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @param {T extends ZodSchema} formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns {UseForm<T>} schema Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param {ZodSchema} schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @param {UseForm<T>} props Form configuration object\n * @param {T extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns {Object} response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns {Ref<ErrorBag<T>>} response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns {Ref<T>} response.errors Object with all the form values and the first error found for that field (if any)\n * @returns {Ref<T>} response.values Object with all the form values and their current value\n * @returns {() => void} response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns {(callback: (values: T) => void) => () => void} response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<ErrorBag<z.TypeOf<T>>>;\n errors: Ref<z.TypeOf<T>> | ShallowRef<z.TypeOf<T>>;\n values: Ref<z.TypeOf<T>>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { BentoTheme } from './install';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import type { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { BentoTheme, setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.LEGACY) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n } else if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","inject","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","getTheme","_a","getThemeForSystemPreference","BentoTheme","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gB;AAAA,IAClB,UAAAV;AAAA,IACA,UAAAI;AAAA,EACJ;AAOK,EAAAP,EAAY,QAAQN,GAAkBmB,CAAa;AAE5D,GCvDMC,IAAuC;AAAA,EACzC,MAAM;AAAA,EACN,SAAS,OACLd,GACA;AAAA,IACI,OAAAQ,IAAQF,EAAW;AAAA,IACnB,WAAAS,IAAY;AAAA,IACZ,oBAAAC,IAAqB;AAAA,IACrB,8BAAAC,IAA+B;AAAA,EAAA,MAElC;AACD,IAAAL,EAAaZ,CAAG,GAEZe,KACAhB,EAAaC,CAAG,GAEhBiB,MACAC;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MACA;AAAA,IACJ,GAEIV,MAAUF,EAAW,SACrB,MAAM,OAAO,gEAAgE,IACtEE,MAAUF,EAAW,aAC5B,MAAM,OAAO,oEAAoE,IAEjF,MAAM,OAAO,yDAAyD,GAGtEU,KACA,MAAM,OAAO,uDAAuD,IAIxER,MAAUF,EAAW,SACrBC,EAASD,EAAW,MAAM,IACnBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,IACvBE,MAAUF,EAAW,eAC5BC,EAASD,EAAW,YAAY,IACzBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,KACvBE,MAAUF,EAAW,SAClBY,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASD,EAAW,WAAW;AAAA,EAGnC;AAER;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../vue2/src/composables/use-form-validate/use-form.ts","../../vue2/src/composables/use-bento-theme/use-bento-theme.types.ts","../../vue2/src/composables/use-bento-theme/use-bento-theme.ts","../../vue2/src/composables/use-bento-toast-controller/install.ts","../../vue2/src/composables/use-bento-theme/install.ts","../../vue2/src/install.ts"],"sourcesContent":["import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { allKeys, ErrorBag, UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @param {T extends ZodSchema} formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns {UseForm<T>} schema Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param {ZodSchema} schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @param {UseForm<T>} props Form configuration object\n * @param {T extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns {Object} response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns {Ref<ErrorBag<T>>} response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns {Ref<T>} response.errors Object with all the form values and the first error found for that field (if any)\n * @returns {Ref<T>} response.values Object with all the form values and their current value\n * @returns {() => void} response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns {(callback: (values: T) => void) => () => void} response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string[];\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { BentoTheme } from './install';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import type { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { BentoTheme, setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.LEGACY) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n } else if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","inject","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","getTheme","_a","getThemeForSystemPreference","BentoTheme","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAASA,EAAmCC,GAAe;AACvD,SAAAA;AACX;AA4BA,SAASC,EAA0CC,GAAmC;AAClF,MAAMC,KAAKD,aAAkBC,EAAE;AAC3B,WAAO,OAAO;AAAA,MACV,OAAO,QAAQD,EAAO,KAAK,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,MACnCF,KAAKE,aAAiBF,EAAE,aAEnB,CAACC,GAAKC,EAAM,KAAK,cAAc,I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A+B;AAAA,EAAA,MAElC;AACD,IAAAL,EAAaZ,CAAG,GAEZe,KACAhB,EAAaC,CAAG,GAEhBiB,MACAC;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MACA;AAAA,IACJ,GAEIV,MAAUF,EAAW,SACrB,MAAM,OAAO,gEAAgE,IACtEE,MAAUF,EAAW,aAC5B,MAAM,OAAO,oEAAoE,IAEjF,MAAM,OAAO,yDAAyD,GAGtEU,KACA,MAAM,OAAO,uDAAuD,IAIxER,MAAUF,EAAW,SACrBC,EAASD,EAAW,MAAM,IACnBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,IACvBE,MAAUF,EAAW,eAC5BC,EAASD,EAAW,YAAY,IACzBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,KACvBE,MAAUF,EAAW,SAClBY,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASD,EAAW,WAAW;AAAA,EAGnC;AAER;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as a, m as s, r as i, b as c, c as u, a as o } from "./chunks/input-field-password.
|
|
1
|
+
import { i as a, m as s, r as i, b as c, c as u, a as o } from "./chunks/input-field-password.CXsERnQX.js";
|
|
2
2
|
export {
|
|
3
3
|
a as BentoInputFieldPassword,
|
|
4
4
|
s as minLength,
|
package/dist/input-field.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as n, b as a, e as o, c as i, d as s, a as l } from "./chunks/input-field.
|
|
1
|
+
import { B as n, b as a, e as o, c as i, d as s, a as l } from "./chunks/input-field.C-7_iMIS.js";
|
|
2
2
|
export {
|
|
3
3
|
n as BentoInputField,
|
|
4
4
|
a as BentoInputFieldElementPosition,
|
package/dist/internal.js
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import { a as e, b as r, C as t } from "./chunks/calendar.S9HFQA8j.js";
|
|
2
|
-
import { C as p, a as
|
|
3
|
-
import { C
|
|
4
|
-
import { B as
|
|
5
|
-
import { E as
|
|
6
|
-
import { F as
|
|
7
|
-
import { G as u, a as
|
|
8
|
-
import { b as
|
|
9
|
-
import { L as
|
|
10
|
-
import { B as
|
|
11
|
-
import { T as
|
|
2
|
+
import { C as p, a as i } from "./chunks/copy.CnzLQyvJ.js";
|
|
3
|
+
import { C } from "./chunks/controls-group.Dg_YRS1e.js";
|
|
4
|
+
import { B as x, b as E, a as f, D as m } from "./chunks/dialog-page.CnDOg98_.js";
|
|
5
|
+
import { E as _, F as I } from "./chunks/error-message.BYXS0kUN.js";
|
|
6
|
+
import { F as G } from "./chunks/fixed-scroller.DM2JOokC.js";
|
|
7
|
+
import { G as u, a as d } from "./chunks/grid-layout.CqLbbEzI.js";
|
|
8
|
+
import { b as L, c as B, u as b } from "./chunks/use-cached-selected-values.B6beyyvX.js";
|
|
9
|
+
import { L as y } from "./chunks/listbox-option-tag.DU_NVK_z.js";
|
|
10
|
+
import { B as F } from "./chunks/teleport.B255JhsV.js";
|
|
11
|
+
import { T as P } from "./chunks/tooltip.BvJoy09y.js";
|
|
12
|
+
import { B as M } from "./chunks/button-actions-with-menu.GT_kNv28.js";
|
|
13
|
+
import { f as K } from "./chunks/button-actions.BjlQS6tm.js";
|
|
12
14
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
K as BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY,
|
|
16
|
+
x as BentoDialogPageAnimation,
|
|
17
|
+
L as BentoListbox,
|
|
18
|
+
F as BentoTeleport,
|
|
19
|
+
M as ButtonActionsWithMenu,
|
|
16
20
|
e as Calendar,
|
|
17
21
|
r as CalendarEvent,
|
|
18
22
|
t as CalendarFirstDayOfWeek,
|
|
19
|
-
|
|
23
|
+
C as ControlsGroup,
|
|
20
24
|
p as Copy,
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
i as CopyTooltipState,
|
|
26
|
+
E as DIALOG_PAGE_CONFIG_INJECTION_KEY,
|
|
23
27
|
f as DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
m as DialogPage,
|
|
29
|
+
_ as ErrorMessage,
|
|
26
30
|
I as FieldLabel,
|
|
27
|
-
|
|
31
|
+
G as FixedScroller,
|
|
28
32
|
u as GridLayout,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
d as GridLayoutContainerType,
|
|
34
|
+
y as ListboxOptionTag,
|
|
35
|
+
P as Tooltip,
|
|
36
|
+
B as useCachedSelectedValues,
|
|
37
|
+
b as useMultiLevelItems
|
|
34
38
|
};
|
|
35
39
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
package/dist/menu.js
CHANGED
package/dist/modal-fullscreen.js
CHANGED
package/dist/modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as e, f as t, g as n, B as l, e as d, c as B, a as M, b as s } from "./chunks/base-modal.
|
|
2
|
-
import { _ as i } from "./chunks/modal.vue_vue_type_script_setup_true_lang.
|
|
1
|
+
import { d as e, f as t, g as n, B as l, e as d, c as B, a as M, b as s } from "./chunks/base-modal.BR_pB6eH.js";
|
|
2
|
+
import { _ as i } from "./chunks/modal.vue_vue_type_script_setup_true_lang.DJXx8ftn.js";
|
|
3
3
|
export {
|
|
4
4
|
i as BentoModal,
|
|
5
5
|
e as BentoModalColumnLayoutVariant,
|
package/dist/pagination.js
CHANGED
package/dist/popover.js
CHANGED
package/dist/search-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as r, b as t, a as B } from "./chunks/search-bar.
|
|
2
|
-
import { u as o } from "./chunks/dropdown.
|
|
1
|
+
import { B as r, b as t, a as B } from "./chunks/search-bar.DPC0amNg.js";
|
|
2
|
+
import { u as o } from "./chunks/dropdown.Sj2OLuEF.js";
|
|
3
3
|
export {
|
|
4
4
|
r as BentoSearchBar,
|
|
5
5
|
t as BentoSearchBarEvent,
|
package/dist/secondary-nav.js
CHANGED
package/dist/selection-card.js
CHANGED
package/dist/sidepanel.js
CHANGED
package/dist/textarea.js
CHANGED
package/dist/timeline.js
CHANGED