@adyen/bento-vue2 1.24.0 → 1.26.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 +484 -629
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +6 -6
- package/dist/alert.js +69 -104
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +83 -180
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +5 -5
- package/dist/chunks/{base-button.090f511d.js → base-button.ad74b6f8.js} +2 -2
- package/dist/chunks/{base-button.090f511d.js.map → base-button.ad74b6f8.js.map} +1 -1
- package/dist/chunks/{base-modal.aa09a60c.js → base-modal.1fff7abe.js} +6 -6
- package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.1fff7abe.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.e845d77a.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.e845d77a.js.map} +1 -1
- package/dist/chunks/{button-actions.239456cb.js → button-actions.81db18e8.js} +3 -3
- package/dist/chunks/{button-actions.239456cb.js.map → button-actions.81db18e8.js.map} +1 -1
- package/dist/chunks/{button.6e6324f0.js → button.9d6435ae.js} +3 -3
- package/dist/chunks/{button.6e6324f0.js.map → button.9d6435ae.js.map} +1 -1
- package/dist/chunks/{calendar.1e416969.js → calendar.640b8d25.js} +4 -4
- package/dist/chunks/{calendar.1e416969.js.map → calendar.640b8d25.js.map} +1 -1
- package/dist/chunks/{checkbox.f38276e6.js → checkbox.bfed007c.js} +3 -3
- package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.bfed007c.js.map} +1 -1
- package/dist/chunks/{controls-group.f1dfa419.js → controls-group.4fb50009.js} +3 -3
- package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.4fb50009.js.map} +1 -1
- package/dist/chunks/{copy.acc9f1b0.js → copy.f85700c6.js} +4 -4
- package/dist/chunks/{copy.acc9f1b0.js.map → copy.f85700c6.js.map} +1 -1
- package/dist/chunks/dialog-page.73da22cf.js +133 -0
- package/dist/chunks/dialog-page.73da22cf.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.54ca1b18.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.54ca1b18.js.map} +1 -1
- package/dist/chunks/dropdown.10c034aa.js +775 -0
- package/dist/chunks/dropdown.10c034aa.js.map +1 -0
- package/dist/chunks/{error-message.8734e591.js → error-message.31ec12b7.js} +2 -2
- package/dist/chunks/{error-message.8734e591.js.map → error-message.31ec12b7.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.4eb9a9ac.js} +2 -2
- package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.4eb9a9ac.js.map} +1 -1
- package/dist/chunks/{footer-actions.11071f12.js → footer-actions.a1e09b4f.js} +4 -4
- package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.a1e09b4f.js.map} +1 -1
- package/dist/chunks/{index.5d5f2200.js → index.15b088b9.js} +6 -6
- package/dist/chunks/{index.5d5f2200.js.map → index.15b088b9.js.map} +1 -1
- package/dist/chunks/{index.87180cdd.js → index.1ea85d4a.js} +138 -119
- package/dist/chunks/index.1ea85d4a.js.map +1 -0
- package/dist/chunks/{index.8e6bc325.js → index.317fca12.js} +3 -3
- package/dist/chunks/{index.8e6bc325.js.map → index.317fca12.js.map} +1 -1
- package/dist/chunks/{index.51308a21.js → index.671768a1.js} +3 -3
- package/dist/chunks/{index.51308a21.js.map → index.671768a1.js.map} +1 -1
- package/dist/chunks/{index.49ce3f6a.js → index.7eefc59c.js} +3 -3
- package/dist/chunks/{index.49ce3f6a.js.map → index.7eefc59c.js.map} +1 -1
- package/dist/chunks/{index.f19887a1.js → index.885d05a9.js} +2 -2
- package/dist/chunks/{index.f19887a1.js.map → index.885d05a9.js.map} +1 -1
- package/dist/chunks/{index.73abb1a9.js → index.8b8c3b16.js} +9 -9
- package/dist/chunks/{index.73abb1a9.js.map → index.8b8c3b16.js.map} +1 -1
- package/dist/chunks/{index.ff09389c.js → index.aaf965f8.js} +6 -6
- package/dist/chunks/{index.ff09389c.js.map → index.aaf965f8.js.map} +1 -1
- package/dist/chunks/{index.03ae22b4.js → index.b21197ca.js} +2 -2
- package/dist/chunks/{index.03ae22b4.js.map → index.b21197ca.js.map} +1 -1
- package/dist/chunks/{index.94980f50.js → index.d553d3d1.js} +2 -2
- package/dist/chunks/{index.94980f50.js.map → index.d553d3d1.js.map} +1 -1
- package/dist/chunks/{index.ba6c1040.js → index.dd30e538.js} +3 -3
- package/dist/chunks/index.dd30e538.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.6bbb6bbe.js} +3 -3
- package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.6bbb6bbe.js.map} +1 -1
- package/dist/chunks/{loading-button.84a5529d.js → loading-button.eafc9e1b.js} +2 -2
- package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.eafc9e1b.js.map} +1 -1
- package/dist/chunks/{payment-method.faa302de.js → payment-method.6c1ce07c.js} +2 -2
- package/dist/chunks/{payment-method.faa302de.js.map → payment-method.6c1ce07c.js.map} +1 -1
- package/dist/chunks/{tooltip.8e9d733c.js → tooltip.58ef3f4a.js} +3 -3
- package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.58ef3f4a.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.c3277f73.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.c3277f73.js.map} +1 -1
- package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.69297473.js} +510 -448
- package/dist/chunks/use-cached-selected-values.69297473.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +947 -885
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +8 -8
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +7 -7
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +1115 -955
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +15 -14
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +4 -4
- package/dist/index.js +177 -169
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +31 -29
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +31 -78
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +6 -6
- package/dist/modal.js +6 -6
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +62 -62
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +2 -2
- package/dist/selection-card.js +4 -4
- package/dist/sidepanel.js +52 -50
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +52 -52
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +7 -7
- package/dist/toast.js +4 -4
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +88 -67
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +550 -266
- package/package.json +3 -2
- package/dist/chunks/dialog-page.75b295b7.js +0 -133
- package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
- package/dist/chunks/dropdown.669b858b.js +0 -797
- package/dist/chunks/dropdown.669b858b.js.map +0 -1
- package/dist/chunks/index.87180cdd.js.map +0 -1
- package/dist/chunks/index.ba6c1040.js.map +0 -1
- package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,133 +1,140 @@
|
|
|
1
1
|
import "./chunks/index.4c062058.js";
|
|
2
|
-
import { t as
|
|
3
|
-
import { u as P } from "./chunks/use-bento-toast-controller.
|
|
4
|
-
import { BentoAccordion as
|
|
5
|
-
import { BentoActionBar as
|
|
6
|
-
import { BentoAlert as O, BentoAlertEvent as R, BentoAlertTypeOption as
|
|
7
|
-
import { a as K, b as U, B as Z } from "./chunks/button.
|
|
2
|
+
import { t as f, c } from "./chunks/use-bento-toast-controller.c3277f73.js";
|
|
3
|
+
import { u as P } from "./chunks/use-bento-toast-controller.c3277f73.js";
|
|
4
|
+
import { BentoAccordion as k, BentoAccordionItem as w } from "./accordion.js";
|
|
5
|
+
import { BentoActionBar as M } from "./action-bar.js";
|
|
6
|
+
import { BentoAlert as O, BentoAlertEvent as R, BentoAlertTypeOption as z, BentoAlertVariant as j } from "./alert.js";
|
|
7
|
+
import { a as K, b as U, B as Z } from "./chunks/button.9d6435ae.js";
|
|
8
8
|
import { BentoColumnOverflow as Y, BentoDataGrid as H, BentoDatagridAriaSortValue as _, BentoDatagridEvent as q, BentoDatagridSortDirection as J, BentoDatagridStyleState as Q } from "./data-grid.js";
|
|
9
9
|
import { BentoCard as $, BentoCardBackground as ee, BentoCardTitleSize as te } from "./card.js";
|
|
10
|
-
import { BentoDatePicker as
|
|
11
|
-
import { B as Be, a as ie } from "./chunks/index.
|
|
12
|
-
import { B as
|
|
13
|
-
import { B as de, a as fe } from "./chunks/checkbox.
|
|
10
|
+
import { BentoDatePicker as ne, BentoDatePickerEvent as re } from "./date-picker.js";
|
|
11
|
+
import { B as Be, a as ie } from "./chunks/index.8b8c3b16.js";
|
|
12
|
+
import { B as se, a as pe, u as ue } from "./chunks/dropdown.10c034aa.js";
|
|
13
|
+
import { B as de, a as fe } from "./chunks/checkbox.bfed007c.js";
|
|
14
14
|
import { BentoClickOutside as xe } from "./click-outside.js";
|
|
15
|
-
import { BentoCodeSnippet as
|
|
16
|
-
import { BentoCountry as
|
|
17
|
-
import { c as
|
|
18
|
-
import { BentoCurrency as Ve, BentoCurrencyISOCode as
|
|
19
|
-
import { B as
|
|
20
|
-
import { B as Oe } from "./chunks/index.
|
|
21
|
-
import { BentoEmptyState as
|
|
15
|
+
import { BentoCodeSnippet as ge, BentoCodeSnippetEvent as Se, BentoCodeSnippetSupportedLanguage as Ce, BentoCodeSnippetVariant as Te } from "./code-snippet.js";
|
|
16
|
+
import { BentoCountry as De } from "./country.js";
|
|
17
|
+
import { c as he, B as Ee, a as Ie, u as Fe, b as Le } from "./chunks/country.types.002caff2.js";
|
|
18
|
+
import { BentoCurrency as Ve, BentoCurrencyISOCode as ke } from "./currency.js";
|
|
19
|
+
import { B as Ge, a as Me } from "./chunks/index.b21197ca.js";
|
|
20
|
+
import { B as Oe } from "./chunks/index.885d05a9.js";
|
|
21
|
+
import { BentoEmptyState as ze, BentoEmptyStateImage as je, BentoEmptyStateImageVariant as Ne, BentoEmptyStateVariant as Ke } from "./empty-state.js";
|
|
22
22
|
import { BentoFilterBar as Ze, BentoFilterBarEvent as We, BentoFilterEvent as Ye, BentoFilterItemType as He } from "./filter-bar.js";
|
|
23
23
|
import { BentoFormLayout as qe, BentoFormLayoutFieldTip as Je, BentoFormLayoutGroup as Qe, BentoFormLayoutTitle as Xe } from "./form-layout.js";
|
|
24
24
|
import { BentoImage as et, BentoImageAspectRatio as tt, BentoImageObjectFit as ot } from "./image.js";
|
|
25
|
-
import { BentoInfoIcon as
|
|
26
|
-
import { BentoInputField as Bt, BentoInputFieldElementPosition as it, BentoInputFieldEvent as mt, BentoInputFieldStateClass as
|
|
25
|
+
import { BentoInfoIcon as rt } from "./info-icon.js";
|
|
26
|
+
import { BentoInputField as Bt, BentoInputFieldElementPosition as it, BentoInputFieldEvent as mt, BentoInputFieldStateClass as st, BentoInputFieldType as pt, BentoInputFieldVariant as ut } from "./input-field.js";
|
|
27
27
|
import { BentoLoadingIndicator as dt, BentoLoadingIndicatorEvent as ft } from "./loading-indicator.js";
|
|
28
|
-
import { B as xt, a as yt } from "./chunks/index.
|
|
29
|
-
import { B as
|
|
30
|
-
import { d as vt, f as
|
|
28
|
+
import { B as xt, a as yt } from "./chunks/index.317fca12.js";
|
|
29
|
+
import { B as St, a as Ct } from "./chunks/index.1ea85d4a.js";
|
|
30
|
+
import { d as vt, f as Dt, g as bt, B as ht, e as Et, c as It, a as Ft, b as Lt } from "./chunks/base-modal.1fff7abe.js";
|
|
31
31
|
import { BentoModal as Vt } from "./modal.js";
|
|
32
|
-
import { BentoModalFullscreen as
|
|
32
|
+
import { BentoModalFullscreen as wt, BentoModalFullscreenPage as Gt } from "./modal-fullscreen.js";
|
|
33
33
|
import { BentoHeader as At } from "./header.js";
|
|
34
34
|
import { BentoPagination as Rt } from "./pagination.js";
|
|
35
|
-
import { B as
|
|
35
|
+
import { B as jt } from "./chunks/payment-method.6c1ce07c.js";
|
|
36
36
|
import { BentoPaymentMethodType as Kt } from "./payment-method.js";
|
|
37
|
-
import { a as Zt, B as Wt } from "./chunks/index.
|
|
37
|
+
import { a as Zt, B as Wt } from "./chunks/index.15b088b9.js";
|
|
38
38
|
import { BentoRadioButton as Ht, BentoRadioGroup as _t, BentoRadioGroupVariant as qt } from "./radio-group.js";
|
|
39
39
|
import { BentoSearchBar as Qt, BentoSearchBarEvent as Xt, BentoSearchBarInternalEvent as $t } from "./search-bar.js";
|
|
40
40
|
import { BentoSecondaryNav as to } from "./secondary-nav.js";
|
|
41
|
-
import { BentoSelectionCard as
|
|
41
|
+
import { BentoSelectionCard as no, BentoSelectionCardGroup as ro, BentoSelectionCardState as ao } from "./selection-card.js";
|
|
42
42
|
import { BentoSegmentedControl as io, BentoSegmentedControlEvent as mo } from "./segmented-control.js";
|
|
43
|
-
import { BentoSidepanel as
|
|
43
|
+
import { BentoSidepanel as po, BentoSidepanelEvent as uo, BentoSidepanelPage as lo } from "./sidepanel.js";
|
|
44
44
|
import { BentoStatus as co, BentoStatusVariant as xo } from "./status.js";
|
|
45
|
-
import { BentoStep as
|
|
46
|
-
import { B as
|
|
47
|
-
import { BentoSummaryGrid as
|
|
48
|
-
import { BentoTab as
|
|
49
|
-
import { BentoTag as Ro, BentoTagVariant as
|
|
45
|
+
import { BentoStep as go, BentoStepper as So, BentoStepperTypeOption as Co, BentoStepperVariantOption as To } from "./stepper.js";
|
|
46
|
+
import { B as Do, a as bo } from "./chunks/index.aaf965f8.js";
|
|
47
|
+
import { BentoSummaryGrid as Eo, BentoSummaryGridItemAmount as Io, BentoSummaryGridItemCustom as Fo, BentoSummaryGridItemNumeric as Lo, BentoSummaryGridItemPercentage as Po, BentoSummaryGridItemSize as Vo, BentoSummaryGridItemText as ko, BentoSummaryGridItemTrendDirection as wo } from "./summary-grid.js";
|
|
48
|
+
import { BentoTab as Mo, BentoTabs as Ao } from "./tabs.js";
|
|
49
|
+
import { BentoTag as Ro, BentoTagVariant as zo } from "./tag.js";
|
|
50
50
|
import { BentoTextarea as No } from "./textarea.js";
|
|
51
51
|
import { BentoTimeline as Uo, BentoTimelineGapUnit as Zo, BentoTimelineItem as Wo, BentoTimelineItemVariant as Yo, BentoTimelineShowMorePlacement as Ho, BentoTimelineStatus as _o } from "./timeline.js";
|
|
52
52
|
import { BentoToast as Jo } from "./toast.js";
|
|
53
|
-
import { BentoToggle as Xo, BentoToggleLabelPosition as $o, BentoTogglePropClass as
|
|
54
|
-
import { BentoTutorial as
|
|
55
|
-
import { B as
|
|
56
|
-
import { BentoDataGridTemplate as
|
|
57
|
-
import { B as
|
|
58
|
-
import { B as
|
|
59
|
-
import { BentoToggleButton as
|
|
60
|
-
import { b as
|
|
61
|
-
import {
|
|
62
|
-
import { BentoDropdownAvatar as
|
|
63
|
-
import { C as
|
|
64
|
-
import { BentoCheckboxGroup as
|
|
65
|
-
import { R as
|
|
66
|
-
import { shallowRef as
|
|
67
|
-
import * as
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import { B as
|
|
71
|
-
import {
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
import { BentoToggle as Xo, BentoToggleLabelPosition as $o, BentoTogglePropClass as en } from "./toggle.js";
|
|
54
|
+
import { BentoTutorial as on } from "./tutorial.js";
|
|
55
|
+
import { B as rn, c as an, b as Bn, a as mn } from "./chunks/index.dd30e538.js";
|
|
56
|
+
import { BentoDataGridTemplate as pn } from "./data-grid-template.js";
|
|
57
|
+
import { B as ln, c as dn, a as fn, b as cn } from "./chunks/button-actions.81db18e8.js";
|
|
58
|
+
import { B as yn, a as gn } from "./chunks/loading-button.eafc9e1b.js";
|
|
59
|
+
import { BentoToggleButton as Cn } from "./button.js";
|
|
60
|
+
import { b as vn, b as Dn } from "./chunks/calendar.640b8d25.js";
|
|
61
|
+
import { c as hn, b as En, c as In, b as Fn } from "./chunks/use-cached-selected-values.69297473.js";
|
|
62
|
+
import { BentoDropdownAvatar as Pn, BentoDropdownCountry as Vn, BentoDropdownCurrency as kn, BentoDropdownPaymentMethod as wn, BentoDropdownTag as Gn } from "./dropdown.js";
|
|
63
|
+
import { C as An } from "./chunks/checkbox-input.1c3cc8ed.js";
|
|
64
|
+
import { BentoCheckboxGroup as Rn, BentoCheckboxGroupVariant as zn } from "./checkbox.js";
|
|
65
|
+
import { R as Nn } from "./chunks/radio-input.c6550a9c.js";
|
|
66
|
+
import { shallowRef as x, ref as p } from "vue";
|
|
67
|
+
import * as n from "zod";
|
|
68
|
+
import { u as Un } from "./chunks/use-click-outside.941d1600.js";
|
|
69
|
+
import { D as Wn } from "./chunks/date-input.9186a0bf.js";
|
|
70
|
+
import { a as Hn, B as _n } from "./chunks/keyboard-navigation.ca47dfa8.js";
|
|
71
|
+
import { B as Jn } from "./chunks/dropdown-default-textbox.54ca1b18.js";
|
|
72
|
+
import { b as Xn, B as $n, a as er } from "./chunks/tooltip.58ef3f4a.js";
|
|
73
|
+
function h(e) {
|
|
74
|
+
return e;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
76
|
+
function i(e) {
|
|
77
|
+
if (n && e instanceof n.ZodObject)
|
|
77
78
|
return Object.fromEntries(
|
|
78
|
-
Object.entries(
|
|
79
|
+
Object.entries(e.shape).map(([t, o]) => n && o instanceof n.ZodDefault ? [t, o._def.defaultValue()] : n && o instanceof n.ZodObject ? [t, i(o)] : [t, void 0])
|
|
79
80
|
);
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
function y(e) {
|
|
83
|
+
return e.path.join(".");
|
|
84
|
+
}
|
|
85
|
+
function E({ validationSchema: e }) {
|
|
86
|
+
const t = x({}), o = p({}), a = p(i(e)), m = () => {
|
|
87
|
+
t.value = {}, o.value = {};
|
|
88
|
+
}, l = () => {
|
|
89
|
+
m(), a.value = i(e);
|
|
86
90
|
};
|
|
87
91
|
return {
|
|
88
92
|
// Values
|
|
89
93
|
errorBag: o,
|
|
90
|
-
errors:
|
|
91
|
-
values:
|
|
94
|
+
errors: t,
|
|
95
|
+
values: a,
|
|
92
96
|
// Methods
|
|
93
|
-
handleReset: () =>
|
|
94
|
-
submitForm: (
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
97
|
+
handleReset: () => l(),
|
|
98
|
+
submitForm: (d) => () => {
|
|
99
|
+
m();
|
|
100
|
+
const s = e.safeParse(a.value);
|
|
101
|
+
s.success ? d(a.value) : s.error.issues.forEach((B) => {
|
|
102
|
+
const r = y(B);
|
|
103
|
+
t.value[r] || (t.value[r] = B.message), o.value[r] ? o.value[r].push(B.message) : o.value[r] = [B.message];
|
|
104
|
+
});
|
|
98
105
|
}
|
|
99
106
|
};
|
|
100
107
|
}
|
|
101
|
-
const
|
|
102
|
-
|
|
108
|
+
const g = (e) => {
|
|
109
|
+
e.prototype[f] = c();
|
|
103
110
|
};
|
|
104
|
-
var
|
|
105
|
-
const
|
|
106
|
-
document.body.classList.add(
|
|
107
|
-
},
|
|
108
|
-
install: async (
|
|
109
|
-
|
|
111
|
+
var S = /* @__PURE__ */ ((e) => (e.LEGACY = "b-legacy-theme", e.STYLEGUIDE = "b-styleguide-theme", e.BENTO = "", e))(S || {});
|
|
112
|
+
const u = (e) => {
|
|
113
|
+
document.body.classList.add(e);
|
|
114
|
+
}, C = {
|
|
115
|
+
install: async (e, t) => {
|
|
116
|
+
t != null && t.withToast && g(e), (t == null ? void 0 : t.theme) === "b-legacy-theme" ? (u(
|
|
110
117
|
"b-legacy-theme"
|
|
111
118
|
/* LEGACY */
|
|
112
|
-
), await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css?used")) : (
|
|
119
|
+
), await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css?used")) : (t == null ? void 0 : t.theme) === "b-styleguide-theme" ? (u(
|
|
113
120
|
"b-styleguide-theme"
|
|
114
121
|
/* STYLEGUIDE */
|
|
115
|
-
), await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css?used")) : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css?used"),
|
|
122
|
+
), await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css?used")) : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css?used"), t != null && t.withUtilityClasses && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css?used");
|
|
116
123
|
}
|
|
117
|
-
},
|
|
124
|
+
}, I = C;
|
|
118
125
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
k as BentoAccordion,
|
|
127
|
+
w as BentoAccordionItem,
|
|
128
|
+
M as BentoActionBar,
|
|
122
129
|
O as BentoAlert,
|
|
123
130
|
R as BentoAlertEvent,
|
|
124
|
-
|
|
125
|
-
|
|
131
|
+
z as BentoAlertTypeOption,
|
|
132
|
+
j as BentoAlertVariant,
|
|
126
133
|
K as BentoButton,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
ln as BentoButtonActions,
|
|
135
|
+
dn as BentoButtonActionsLayout,
|
|
136
|
+
fn as BentoButtonActionsLayoutBasic,
|
|
137
|
+
cn as BentoButtonActionsLayoutExtended,
|
|
131
138
|
U as BentoButtonPropClass,
|
|
132
139
|
Z as BentoButtonVariant,
|
|
133
140
|
$ as BentoCard,
|
|
@@ -135,47 +142,47 @@ export {
|
|
|
135
142
|
te as BentoCardTitleSize,
|
|
136
143
|
de as BentoCheckbox,
|
|
137
144
|
fe as BentoCheckboxEvent,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
Rn as BentoCheckboxGroup,
|
|
146
|
+
zn as BentoCheckboxGroupVariant,
|
|
147
|
+
An as BentoCheckboxState,
|
|
141
148
|
xe as BentoClickOutside,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
Jn as BentoClickOutsideDirective,
|
|
150
|
+
ge as BentoCodeSnippet,
|
|
151
|
+
Se as BentoCodeSnippetEvent,
|
|
152
|
+
Ce as BentoCodeSnippetSupportedLanguage,
|
|
153
|
+
Te as BentoCodeSnippetVariant,
|
|
147
154
|
Y as BentoColumnOverflow,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
De as BentoCountry,
|
|
156
|
+
he as BentoCountryCode,
|
|
157
|
+
Ee as BentoCountryVariant,
|
|
151
158
|
Ve as BentoCurrency,
|
|
152
|
-
|
|
159
|
+
ke as BentoCurrencyISOCode,
|
|
153
160
|
H as BentoDataGrid,
|
|
154
|
-
|
|
161
|
+
pn as BentoDataGridTemplate,
|
|
155
162
|
_ as BentoDatagridAriaSortValue,
|
|
156
163
|
q as BentoDatagridEvent,
|
|
157
164
|
J as BentoDatagridSortDirection,
|
|
158
165
|
Q as BentoDatagridStyleState,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
Ge as BentoDate,
|
|
167
|
+
Me as BentoDateFormat,
|
|
168
|
+
ne as BentoDatePicker,
|
|
169
|
+
re as BentoDatePickerEvent,
|
|
170
|
+
vn as BentoDatePickerFirstDayOfWeek,
|
|
164
171
|
Be as BentoDateRangePicker,
|
|
165
172
|
ie as BentoDateRangePickerEvent,
|
|
166
|
-
|
|
173
|
+
Dn as BentoDateRangePickerFirstDayOfWeek,
|
|
167
174
|
Oe as BentoDivider,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
se as BentoDropdown,
|
|
176
|
+
Pn as BentoDropdownAvatar,
|
|
177
|
+
Vn as BentoDropdownCountry,
|
|
178
|
+
kn as BentoDropdownCurrency,
|
|
179
|
+
hn as BentoDropdownEvent,
|
|
180
|
+
En as BentoDropdownLazyLoadType,
|
|
181
|
+
wn as BentoDropdownPaymentMethod,
|
|
182
|
+
pe as BentoDropdownSize,
|
|
183
|
+
Gn as BentoDropdownTag,
|
|
184
|
+
ze as BentoEmptyState,
|
|
185
|
+
je as BentoEmptyStateImage,
|
|
179
186
|
Ne as BentoEmptyStateImageVariant,
|
|
180
187
|
Ke as BentoEmptyStateVariant,
|
|
181
188
|
Ze as BentoFilterBar,
|
|
@@ -190,43 +197,43 @@ export {
|
|
|
190
197
|
et as BentoImage,
|
|
191
198
|
tt as BentoImageAspectRatio,
|
|
192
199
|
ot as BentoImageObjectFit,
|
|
193
|
-
|
|
200
|
+
rt as BentoInfoIcon,
|
|
194
201
|
Bt as BentoInputField,
|
|
195
202
|
it as BentoInputFieldElementPosition,
|
|
196
203
|
mt as BentoInputFieldEvent,
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
st as BentoInputFieldStateClass,
|
|
205
|
+
pt as BentoInputFieldType,
|
|
199
206
|
ut as BentoInputFieldVariant,
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
Hn as BentoKeyboardNavigationDirective,
|
|
208
|
+
_n as BentoKeyboardNavigationKeyDownEvent,
|
|
202
209
|
xt as BentoLink,
|
|
203
210
|
yt as BentoLinkVariant,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
211
|
+
In as BentoListboxEvent,
|
|
212
|
+
Fn as BentoListboxLazyLoadType,
|
|
213
|
+
yn as BentoLoadingButton,
|
|
214
|
+
gn as BentoLoadingButtonState,
|
|
208
215
|
dt as BentoLoadingIndicator,
|
|
209
216
|
ft as BentoLoadingIndicatorEvent,
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
St as BentoMenu,
|
|
218
|
+
Ct as BentoMenuEvent,
|
|
212
219
|
Vt as BentoModal,
|
|
213
220
|
vt as BentoModalColumnLayoutVariant,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
Dt as BentoModalDialogType,
|
|
222
|
+
bt as BentoModalEvent,
|
|
223
|
+
wt as BentoModalFullscreen,
|
|
224
|
+
Gt as BentoModalFullscreenPage,
|
|
225
|
+
ht as BentoModalPage,
|
|
226
|
+
Et as BentoModalRole,
|
|
227
|
+
It as BentoModalSize,
|
|
221
228
|
Ft as BentoModalVariant,
|
|
222
229
|
Lt as BentoModalVariantMapping,
|
|
223
230
|
Rt as BentoPagination,
|
|
224
|
-
|
|
231
|
+
jt as BentoPaymentMethod,
|
|
225
232
|
Kt as BentoPaymentMethodType,
|
|
226
233
|
Zt as BentoPopover,
|
|
227
234
|
Wt as BentoPopoverPositions,
|
|
228
235
|
Ht as BentoRadioButton,
|
|
229
|
-
|
|
236
|
+
Nn as BentoRadioButtonStateClass,
|
|
230
237
|
_t as BentoRadioGroup,
|
|
231
238
|
qt as BentoRadioGroupVariant,
|
|
232
239
|
Qt as BentoSearchBar,
|
|
@@ -235,34 +242,34 @@ export {
|
|
|
235
242
|
to as BentoSecondaryNav,
|
|
236
243
|
io as BentoSegmentedControl,
|
|
237
244
|
mo as BentoSegmentedControlEvent,
|
|
238
|
-
|
|
239
|
-
|
|
245
|
+
no as BentoSelectionCard,
|
|
246
|
+
ro as BentoSelectionCardGroup,
|
|
240
247
|
ao as BentoSelectionCardState,
|
|
241
|
-
|
|
248
|
+
po as BentoSidepanel,
|
|
242
249
|
uo as BentoSidepanelEvent,
|
|
243
250
|
lo as BentoSidepanelPage,
|
|
244
251
|
co as BentoStatus,
|
|
245
252
|
xo as BentoStatusVariant,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
go as BentoStep,
|
|
254
|
+
So as BentoStepper,
|
|
255
|
+
Co as BentoStepperTypeOption,
|
|
256
|
+
To as BentoStepperVariantOption,
|
|
257
|
+
Do as BentoStructuredList,
|
|
258
|
+
bo as BentoStructuredListItem,
|
|
259
|
+
Eo as BentoSummaryGrid,
|
|
260
|
+
Io as BentoSummaryGridItemAmount,
|
|
254
261
|
Fo as BentoSummaryGridItemCustom,
|
|
255
262
|
Lo as BentoSummaryGridItemNumeric,
|
|
256
263
|
Po as BentoSummaryGridItemPercentage,
|
|
257
264
|
Vo as BentoSummaryGridItemSize,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
265
|
+
ko as BentoSummaryGridItemText,
|
|
266
|
+
wo as BentoSummaryGridItemTrendDirection,
|
|
267
|
+
Mo as BentoTab,
|
|
261
268
|
Ao as BentoTabs,
|
|
262
269
|
Ro as BentoTag,
|
|
263
|
-
|
|
270
|
+
zo as BentoTagVariant,
|
|
264
271
|
No as BentoTextarea,
|
|
265
|
-
|
|
272
|
+
S as BentoTheme,
|
|
266
273
|
Uo as BentoTimeline,
|
|
267
274
|
Zo as BentoTimelineGapUnit,
|
|
268
275
|
Wo as BentoTimelineItem,
|
|
@@ -271,25 +278,26 @@ export {
|
|
|
271
278
|
_o as BentoTimelineStatus,
|
|
272
279
|
Jo as BentoToast,
|
|
273
280
|
Xo as BentoToggle,
|
|
274
|
-
|
|
281
|
+
Cn as BentoToggleButton,
|
|
275
282
|
$o as BentoToggleLabelPosition,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
en as BentoTogglePropClass,
|
|
284
|
+
Xn as BentoTooltipDirective,
|
|
285
|
+
$n as BentoTooltipPosition,
|
|
286
|
+
er as BentoTooltipState,
|
|
287
|
+
on as BentoTutorial,
|
|
288
|
+
rn as BentoTypography,
|
|
289
|
+
an as BentoTypographyElement,
|
|
290
|
+
Bn as BentoTypographyModifier,
|
|
291
|
+
mn as BentoTypographyVariant,
|
|
292
|
+
Wn as DateFormat,
|
|
293
|
+
I as default,
|
|
294
|
+
h as toTypedSchema,
|
|
288
295
|
P as useBentoToastController,
|
|
289
|
-
|
|
296
|
+
Un as useClickOutside,
|
|
297
|
+
Ie as useCountryCapital,
|
|
290
298
|
Fe as useCountryName,
|
|
291
299
|
Le as useCountryPhoneCode,
|
|
292
|
-
|
|
300
|
+
E as useForm,
|
|
293
301
|
ue as useSearchBarFilter
|
|
294
302
|
};
|
|
295
303
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-toast-controller/install.ts","../src/install.ts"],"sourcesContent":["import { Ref, ref, 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 * 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>({ validationSchema }: UseForm<T>) {\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values = ref(getInitialFormValues(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 errorBag.value = (validSchema as z.SafeParseError<T>).error.flatten().fieldErrors;\n errors.value = Object.entries(errorBag.value).reduce((acc, [key, value]) => {\n // eslint-disable-next-line prefer-destructuring\n acc[key] = value[0];\n return acc;\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 { 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 { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n BENTO = '',\n}\n\ninterface BentoVuePlugin {\n theme: BentoTheme;\n withToast: boolean;\n}\n\nconst setTheme = (theme: BentoTheme) => {\n document.body.classList.add(theme);\n};\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n install: async (Vue, options: { theme: BentoTheme; withToast: boolean; withUtilityClasses: boolean }) => {\n if (options?.withToast) {\n installToast(Vue);\n }\n // Make sure to put all awaited CSS imports below this point and not above!\n if (options?.theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (options?.theme === BentoTheme.STYLEGUIDE) {\n setTheme(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 (options?.withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n },\n};\n\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","acc","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","setTheme","theme","plugin","options","BentoVue"],"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,aAAc,CAAA,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,GAAKH,EAAqBI,CAAK,CAAC,IAGrC,CAACD,GAAK,MAAS,CACzB;AAAA,IAAA;AAKb;AA2CgB,SAAAE,EAA6B,EAAE,kBAAAC,KAAgC;AACrE,QAAAC,IAASC,EAA6C,CAAA,CAAE,GAExDC,IAA4DC,EAAI,CAAA,CAAE,GAClEC,IAASD,EAAIV,EAAqBM,CAAgB,CAAC,GAEnDM,IAAc,MAAM;AACtB,IAAAL,EAAO,QAAQ,IACfE,EAAS,QAAQ;EAAC,GAGhBI,IAAY,MAAM;AACR,IAAAD,KACLD,EAAA,QAAQX,EAAwBM,CAAgB;AAAA,EAAA;AAsBpD,SAAA;AAAA;AAAA,IAEH,UAAAG;AAAA,IACA,QAAAF;AAAA,IACA,QAAAI;AAAA;AAAA,IAGA,aAAa,MAAME,EAAU;AAAA,IAC7B,YA3Be,OAAa,MAAM;AACtB,MAAAD;AAGZ,YAAME,IAAcR,EAAiB,UAAUK,EAAO,KAAK;AAGvD,MAACG,EAAY,UAQbC,EAAUJ,EAAO,KAAK,KAPtBF,EAAS,QAASK,EAAoC,MAAM,QAAA,EAAU,aACtEP,EAAO,QAAQ,OAAO,QAAQE,EAAS,KAAK,EAAE,OAAO,CAACO,GAAK,CAACb,GAAKC,CAAK,OAE9DY,EAAAb,CAAG,IAAIC,EAAM,CAAC,GACXY,IACR,CAAE,CAAA;AAAA,IAGT;AAAA,EAWA;AAER;AChJA,MAAeC,IAAA,CAAOC,MAAA;AAIb,EAAAA,EAAoB,UAAUC,CAAsB,IAAIC,EAAiB;AAIlF;ACZY,IAAAC,sBAAAA,OACRA,EAAA,SAAS,kBACTA,EAAA,aAAa,sBACbA,EAAA,QAAQ,IAHAA,IAAAA,KAAA,CAAA,CAAA;AAWZ,MAAMC,IAAW,CAACC,MAAsB;AAC3B,WAAA,KAAK,UAAU,IAAIA,CAAK;AACrC,GAEMC,IAAuC;AAAA,EACzC,SAAS,OAAON,GAAKO,MAAoF;AACrG,IAAIA,KAAA,QAAAA,EAAS,aACTR,EAAaC,CAAG,IAGhBO,KAAA,gBAAAA,EAAS,WAAU,oBACnBH;AAAA,MAAS;AAAA;AAAA,IAAiB,GAC1B,MAAM,OAAO,qEAAgE,MACtEG,KAAA,gBAAAA,EAAS,WAAU,wBAC1BH;AAAA,MAAS;AAAA;AAAA,IAAqB,GAC9B,MAAM,OAAO,yEAAoE,KAEjF,MAAM,OAAO,8DAAyD,GAGtEG,KAAA,QAAAA,EAAS,sBACT,MAAM,OAAO,4DAAuD;AAAA,EAE5E;AACJ,GAEAC,IAAeF;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-toast-controller/install.ts","../src/install.ts"],"sourcesContent":["import { Ref, ref, 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>({ validationSchema }: UseForm<T>) {\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(getInitialFormValues(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 { 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 { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n BENTO = '',\n}\n\ninterface BentoVuePlugin {\n theme: BentoTheme;\n withToast: boolean;\n}\n\nconst setTheme = (theme: BentoTheme) => {\n document.body.classList.add(theme);\n};\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n install: async (Vue, options: { theme: BentoTheme; withToast: boolean; withUtilityClasses: boolean }) => {\n if (options?.withToast) {\n installToast(Vue);\n }\n // Make sure to put all awaited CSS imports below this point and not above!\n if (options?.theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (options?.theme === BentoTheme.STYLEGUIDE) {\n setTheme(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 (options?.withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n },\n};\n\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","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","setTheme","theme","plugin","options","BentoVue"],"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,aAAc,CAAA,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,GAAKH,EAAqBI,CAAK,CAAC,IAGrC,CAACD,GAAK,MAAS,CACzB;AAAA,IAAA;AAKb;AAOA,SAASE,EAAkBC,GAAmB;AACnC,SAAAA,EAAM,KAAK,KAAK,GAAG;AAC9B;AA2CgB,SAAAC,EAA6B,EAAE,kBAAAC,KAAgC;AAErE,QAAAC,IAASC,EAA6C,CAAA,CAAE,GAExDC,IAA4DC,EAAI,CAAA,CAAE,GAClEC,IAASD,EAAIZ,EAAqBQ,CAAgB,CAAC,GAEnDM,IAAc,MAAM;AACtB,IAAAL,EAAO,QAAQ,IACfE,EAAS,QAAQ;EAAC,GAGhBI,IAAY,MAAM;AACR,IAAAD,KACLD,EAAA,QAAQb,EAAwBQ,CAAgB;AAAA,EAAA;AA+BpD,SAAA;AAAA;AAAA,IAEH,UAAAG;AAAA,IACA,QAAAF;AAAA,IACA,QAAAI;AAAA;AAAA,IAGA,aAAa,MAAME,EAAU;AAAA,IAC7B,YApCe,OAAa,MAAM;AACtB,MAAAD;AAGZ,YAAME,IAAcR,EAAiB,UAAUK,EAAO,KAAK;AAGvD,MAACG,EAAY,UAiBbC,EAAUJ,EAAO,KAAK,IAhBrBG,EAAoC,MAAM,OAAO,QAAQ,CAASE,MAAA;AACzD,cAAAC,IAAOd,EAAkBa,CAAK;AAGpC,QAAKT,EAAO,MAAMU,CAAI,MACXV,EAAA,MAAMU,CAAI,IAAID,EAAM,UAI1BP,EAAS,MAAMQ,CAAI,IAGpBR,EAAS,MAAMQ,CAAI,EAAE,KAAKD,EAAM,OAAO,IAFvCP,EAAS,MAAMQ,CAAI,IAAI,CAACD,EAAM,OAAO;AAAA,MAGzC,CACH;AAAA,IAGL;AAAA,EAWA;AAER;ACnKA,MAAeE,IAAA,CAAOC,MAAA;AAIb,EAAAA,EAAoB,UAAUC,CAAsB,IAAIC,EAAiB;AAIlF;ACZY,IAAAC,sBAAAA,OACRA,EAAA,SAAS,kBACTA,EAAA,aAAa,sBACbA,EAAA,QAAQ,IAHAA,IAAAA,KAAA,CAAA,CAAA;AAWZ,MAAMC,IAAW,CAACC,MAAsB;AAC3B,WAAA,KAAK,UAAU,IAAIA,CAAK;AACrC,GAEMC,IAAuC;AAAA,EACzC,SAAS,OAAON,GAAKO,MAAoF;AACrG,IAAIA,KAAA,QAAAA,EAAS,aACTR,EAAaC,CAAG,IAGhBO,KAAA,gBAAAA,EAAS,WAAU,oBACnBH;AAAA,MAAS;AAAA;AAAA,IAAiB,GAC1B,MAAM,OAAO,qEAAgE,MACtEG,KAAA,gBAAAA,EAAS,WAAU,wBAC1BH;AAAA,MAAS;AAAA;AAAA,IAAqB,GAC9B,MAAM,OAAO,yEAAoE,KAEjF,MAAM,OAAO,8DAAyD,GAGtEG,KAAA,QAAAA,EAAS,sBACT,MAAM,OAAO,4DAAuD;AAAA,EAE5E;AACJ,GAEAC,IAAeF;"}
|
package/dist/info-icon.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as n } from "vue";
|
|
2
|
-
import { c as i } from "./chunks/index.
|
|
2
|
+
import { c as i } from "./chunks/index.671768a1.js";
|
|
3
3
|
import { I as r } from "./chunks/info.8b6328aa.js";
|
|
4
|
-
import { b as s } from "./chunks/tooltip.
|
|
4
|
+
import { b as s } from "./chunks/tooltip.58ef3f4a.js";
|
|
5
5
|
import { n as a } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
6
|
-
import "./assets/
|
|
6
|
+
import "./assets/index27.css";
|
|
7
7
|
const p = n({
|
|
8
8
|
name: "bento-info-icon",
|
|
9
9
|
components: { InfoIcon: r },
|